@openchamber/web 1.4.8 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,9 +55,9 @@ Error generating stack: `+S.message+`
55
55
  `)},Xre=function(){var t=parseInt(document.body.getAttribute(Wb)||"0",10);return isFinite(t)?t:0},dZe=function(){K.useEffect(function(){return document.body.setAttribute(Wb,(Xre()+1).toString()),function(){var t=Xre()-1;t<=0?document.body.removeAttribute(Wb):document.body.setAttribute(Wb,t.toString())}},[])},pZe=function(t){var e=t.noRelative,n=t.noImportant,a=t.gapMode,r=a===void 0?"margin":a;dZe();var i=K.useMemo(function(){return cZe(r)},[r]);return K.createElement(lZe,{styles:uZe(i,!e,r,n?"":"!important")})},m$=!1;if(typeof window<"u")try{var OQ=Object.defineProperty({},"passive",{get:function(){return m$=!0,!0}});window.addEventListener("test",OQ,OQ),window.removeEventListener("test",OQ,OQ)}catch{m$=!1}var Wh=m$?{passive:!1}:!1,mZe=function(t){return t.tagName==="TEXTAREA"},ABe=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!mZe(t)&&n[e]==="visible")},gZe=function(t){return ABe(t,"overflowY")},fZe=function(t){return ABe(t,"overflowX")},eie=function(t,e){var n=e.ownerDocument,a=e;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=cBe(t,a);if(r){var i=lBe(t,a),o=i[1],s=i[2];if(o>s)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},hZe=function(t){var e=t.scrollTop,n=t.scrollHeight,a=t.clientHeight;return[e,n,a]},bZe=function(t){var e=t.scrollLeft,n=t.scrollWidth,a=t.clientWidth;return[e,n,a]},cBe=function(t,e){return t==="v"?gZe(e):fZe(e)},lBe=function(t,e){return t==="v"?hZe(e):bZe(e)},yZe=function(t,e){return t==="h"&&e==="rtl"?-1:1},CZe=function(t,e,n,a,r){var i=yZe(t,window.getComputedStyle(e).direction),o=i*a,s=n.target,A=e.contains(s),l=!1,u=o>0,d=0,p=0;do{if(!s)break;var m=lBe(t,s),g=m[0],h=m[1],b=m[2],y=h-b-i*g;(g||y)&&cBe(t,s)&&(d+=y,p+=g);var w=s.parentNode;s=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!A&&s!==document.body||A&&(e.contains(s)||e===s));return(u&&Math.abs(d)<1||!u&&Math.abs(p)<1)&&(l=!0),l},GQ=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},tie=function(t){return[t.deltaX,t.deltaY]},nie=function(t){return t&&"current"in t?t.current:t},wZe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},EZe=function(t){return`
56
56
  .block-interactivity-`.concat(t,` {pointer-events: none;}
57
57
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
58
- `)},BZe=0,Vh=[];function kZe(t){var e=K.useRef([]),n=K.useRef([0,0]),a=K.useRef(),r=K.useState(BZe++)[0],i=K.useState(sBe)[0],o=K.useRef(t);K.useEffect(function(){o.current=t},[t]),K.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var h=HKe([t.lockRef.current],(t.shards||[]).map(nie),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var s=K.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!o.current.allowPinchZoom;var y=GQ(h),w=n.current,E="deltaX"in h?h.deltaX:w[0]-y[0],k="deltaY"in h?h.deltaY:w[1]-y[1],v,_=h.target,I=Math.abs(E)>Math.abs(k)?"h":"v";if("touches"in h&&I==="h"&&_.type==="range")return!1;var x=window.getSelection(),N=x&&x.anchorNode,R=N?N===_||N.contains(_):!1;if(R)return!1;var T=eie(I,_);if(!T)return!0;if(T?v=I:(v=I==="v"?"h":"v",T=eie(I,_)),!T)return!1;if(!a.current&&"changedTouches"in h&&(E||k)&&(a.current=v),!v)return!0;var O=a.current||v;return CZe(O,b,h,O==="h"?E:k)},[]),A=K.useCallback(function(h){var b=h;if(!(!Vh.length||Vh[Vh.length-1]!==i)){var y="deltaY"in b?tie(b):GQ(b),w=e.current.filter(function(v){return v.name===b.type&&(v.target===b.target||b.target===v.shadowParent)&&wZe(v.delta,y)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}if(!w){var E=(o.current.shards||[]).map(nie).filter(Boolean).filter(function(v){return v.contains(b.target)}),k=E.length>0?s(b,E[0]):!o.current.noIsolation;k&&b.cancelable&&b.preventDefault()}}},[]),l=K.useCallback(function(h,b,y,w){var E={name:h,delta:b,target:y,should:w,shadowParent:vZe(y)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(k){return k!==E})},1)},[]),u=K.useCallback(function(h){n.current=GQ(h),a.current=void 0},[]),d=K.useCallback(function(h){l(h.type,tie(h),h.target,s(h,t.lockRef.current))},[]),p=K.useCallback(function(h){l(h.type,GQ(h),h.target,s(h,t.lockRef.current))},[]);K.useEffect(function(){return Vh.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",A,Wh),document.addEventListener("touchmove",A,Wh),document.addEventListener("touchstart",u,Wh),function(){Vh=Vh.filter(function(h){return h!==i}),document.removeEventListener("wheel",A,Wh),document.removeEventListener("touchmove",A,Wh),document.removeEventListener("touchstart",u,Wh)}},[]);var m=t.removeScrollBar,g=t.inert;return K.createElement(K.Fragment,null,g?K.createElement(i,{styles:EZe(r)}):null,m?K.createElement(pZe,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function vZe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const IZe=eZe(oBe,kZe);var lS=K.forwardRef(function(t,e){return K.createElement(cS,Jl({},t,{ref:e,sideCar:IZe}))});lS.classNames=cS.classNames;var g$=["Enter"," "],QZe=["ArrowDown","PageUp","Home"],uBe=["ArrowUp","PageDown","End"],_Ze=[...QZe,...uBe],xZe={ltr:[...g$,"ArrowRight"],rtl:[...g$,"ArrowLeft"]},DZe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},av="Menu",[NB,SZe,NZe]=BK(av),[D0,dBe]=Cl(av,[NZe,g1,JEe]),uS=g1(),pBe=JEe(),[FZe,S0]=D0(av),[TZe,rv]=D0(av),mBe=t=>{const{__scopeMenu:e,open:n=!1,children:a,dir:r,onOpenChange:i,modal:o=!0}=t,s=uS(e),[A,l]=K.useState(null),u=K.useRef(!1),d=Io(i),p=sS(r);return K.useEffect(()=>{const m=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),be.jsx(mK,{...s,children:be.jsx(FZe,{scope:e,open:n,onOpenChange:d,content:A,onContentChange:l,children:be.jsx(TZe,{scope:e,onClose:K.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:a})})})};mBe.displayName=av;var RZe="MenuAnchor",IK=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t,r=uS(n);return be.jsx(gK,{...r,...a,ref:e})});IK.displayName=RZe;var QK="MenuPortal",[MZe,gBe]=D0(QK,{forceMount:void 0}),fBe=t=>{const{__scopeMenu:e,forceMount:n,children:a,container:r}=t,i=S0(QK,e);return be.jsx(MZe,{scope:e,forceMount:n,children:be.jsx(vs,{present:n||i.open,children:be.jsx(Xk,{asChild:!0,container:r,children:a})})})};fBe.displayName=QK;var Ec="MenuContent",[LZe,_K]=D0(Ec),hBe=K.forwardRef((t,e)=>{const n=gBe(Ec,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,i=S0(Ec,t.__scopeMenu),o=rv(Ec,t.__scopeMenu);return be.jsx(NB.Provider,{scope:t.__scopeMenu,children:be.jsx(vs,{present:a||i.open,children:be.jsx(NB.Slot,{scope:t.__scopeMenu,children:o.modal?be.jsx(OZe,{...r,ref:e}):be.jsx(GZe,{...r,ref:e})})})})}),OZe=K.forwardRef((t,e)=>{const n=S0(Ec,t.__scopeMenu),a=K.useRef(null),r=ca(e,a);return K.useEffect(()=>{const i=a.current;if(i)return vK(i)},[]),be.jsx(xK,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:on(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),GZe=K.forwardRef((t,e)=>{const n=S0(Ec,t.__scopeMenu);return be.jsx(xK,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),PZe=C2("MenuContent.ScrollLock"),xK=K.forwardRef((t,e)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:A,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...h}=t,b=S0(Ec,n),y=rv(Ec,n),w=uS(n),E=pBe(n),k=SZe(n),[v,_]=K.useState(null),I=K.useRef(null),x=ca(e,I,b.onContentChange),N=K.useRef(0),R=K.useRef(""),T=K.useRef(0),O=K.useRef(null),$=K.useRef("right"),F=K.useRef(0),L=g?lS:K.Fragment,M=g?{as:PZe,allowPinchZoom:!0}:void 0,P=q=>{const U=R.current+q,G=k().filter(ee=>!ee.disabled),H=document.activeElement,j=G.find(ee=>ee.ref.current===H)?.textValue,Z=G.map(ee=>ee.textValue),J=JZe(Z,U,j),ae=G.find(ee=>ee.textValue===J)?.ref.current;(function ee(pe){R.current=pe,window.clearTimeout(N.current),pe!==""&&(N.current=window.setTimeout(()=>ee(""),1e3))})(U),ae&&setTimeout(()=>ae.focus())};K.useEffect(()=>()=>window.clearTimeout(N.current),[]),kK();const D=K.useCallback(q=>$.current===O.current?.side&&eWe(q,O.current?.area),[]);return be.jsx(LZe,{scope:n,searchRef:R,onItemEnter:K.useCallback(q=>{D(q)&&q.preventDefault()},[D]),onItemLeave:K.useCallback(q=>{D(q)||(I.current?.focus(),_(null))},[D]),onTriggerLeave:K.useCallback(q=>{D(q)&&q.preventDefault()},[D]),pointerGraceTimerRef:T,onPointerGraceIntentChange:K.useCallback(q=>{O.current=q},[]),children:be.jsx(L,{...M,children:be.jsx(AS,{asChild:!0,trapped:r,onMountAutoFocus:on(i,q=>{q.preventDefault(),I.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:be.jsx(Vk,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:be.jsx(PKe,{asChild:!0,...E,dir:y.dir,orientation:"vertical",loop:a,currentTabStopId:v,onCurrentTabStopIdChange:_,onEntryFocus:on(A,q=>{y.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:be.jsx(fK,{role:"menu","aria-orientation":"vertical","data-state":FBe(b.open),"data-radix-menu-content":"",dir:y.dir,...w,...h,ref:x,style:{outline:"none",...h.style},onKeyDown:on(h.onKeyDown,q=>{const G=q.target.closest("[data-radix-menu-content]")===q.currentTarget,H=q.ctrlKey||q.altKey||q.metaKey,j=q.key.length===1;G&&(q.key==="Tab"&&q.preventDefault(),!H&&j&&P(q.key));const Z=I.current;if(q.target!==Z||!_Ze.includes(q.key))return;q.preventDefault();const ae=k().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);uBe.includes(q.key)&&ae.reverse(),WZe(ae)}),onBlur:on(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(N.current),R.current="")}),onPointerMove:on(t.onPointerMove,FB(q=>{const U=q.target,G=F.current!==q.clientX;if(q.currentTarget.contains(U)&&G){const H=q.clientX>F.current?"right":"left";$.current=H,F.current=q.clientX}}))})})})})})})});hBe.displayName=Ec;var qZe="MenuGroup",DK=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return be.jsx(zn.div,{role:"group",...a,ref:e})});DK.displayName=qZe;var UZe="MenuLabel",bBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return be.jsx(zn.div,{...a,ref:e})});bBe.displayName=UZe;var AD="MenuItem",aie="menu.itemSelect",dS=K.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:a,...r}=t,i=K.useRef(null),o=rv(AD,t.__scopeMenu),s=_K(AD,t.__scopeMenu),A=ca(e,i),l=K.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(aie,{bubbles:!0,cancelable:!0});d.addEventListener(aie,m=>a?.(m),{once:!0}),Lwe(d,p),p.defaultPrevented?l.current=!1:o.onClose()}};return be.jsx(yBe,{...r,ref:A,disabled:n,onClick:on(t.onClick,u),onPointerDown:d=>{t.onPointerDown?.(d),l.current=!0},onPointerUp:on(t.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:on(t.onKeyDown,d=>{const p=s.searchRef.current!=="";n||p&&d.key===" "||g$.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});dS.displayName=AD;var yBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...i}=t,o=_K(AD,n),s=pBe(n),A=K.useRef(null),l=ca(e,A),[u,d]=K.useState(!1),[p,m]=K.useState("");return K.useEffect(()=>{const g=A.current;g&&m((g.textContent??"").trim())},[i.children]),be.jsx(NB.ItemSlot,{scope:n,disabled:a,textValue:r??p,children:be.jsx(qKe,{asChild:!0,...s,focusable:!a,children:be.jsx(zn.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...i,ref:l,onPointerMove:on(t.onPointerMove,FB(g=>{a?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:on(t.onPointerLeave,FB(g=>o.onItemLeave(g))),onFocus:on(t.onFocus,()=>d(!0)),onBlur:on(t.onBlur,()=>d(!1))})})})}),$Ze="MenuCheckboxItem",CBe=K.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:a,...r}=t;return be.jsx(vBe,{scope:t.__scopeMenu,checked:n,children:be.jsx(dS,{role:"menuitemcheckbox","aria-checked":cD(n)?"mixed":n,...r,ref:e,"data-state":NK(n),onSelect:on(r.onSelect,()=>a?.(cD(n)?!0:!n),{checkForDefaultPrevented:!1})})})});CBe.displayName=$Ze;var wBe="MenuRadioGroup",[jZe,HZe]=D0(wBe,{value:void 0,onValueChange:()=>{}}),EBe=K.forwardRef((t,e)=>{const{value:n,onValueChange:a,...r}=t,i=Io(a);return be.jsx(jZe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:be.jsx(DK,{...r,ref:e})})});EBe.displayName=wBe;var BBe="MenuRadioItem",kBe=K.forwardRef((t,e)=>{const{value:n,...a}=t,r=HZe(BBe,t.__scopeMenu),i=n===r.value;return be.jsx(vBe,{scope:t.__scopeMenu,checked:i,children:be.jsx(dS,{role:"menuitemradio","aria-checked":i,...a,ref:e,"data-state":NK(i),onSelect:on(a.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});kBe.displayName=BBe;var SK="MenuItemIndicator",[vBe,zZe]=D0(SK,{checked:!1}),IBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:a,...r}=t,i=zZe(SK,n);return be.jsx(vs,{present:a||cD(i.checked)||i.checked===!0,children:be.jsx(zn.span,{...r,ref:e,"data-state":NK(i.checked)})})});IBe.displayName=SK;var YZe="MenuSeparator",QBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return be.jsx(zn.div,{role:"separator","aria-orientation":"horizontal",...a,ref:e})});QBe.displayName=YZe;var KZe="MenuArrow",_Be=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t,r=uS(n);return be.jsx(hK,{...r,...a,ref:e})});_Be.displayName=KZe;var ZZe="MenuSub",[u5n,xBe]=D0(ZZe),Lw="MenuSubTrigger",DBe=K.forwardRef((t,e)=>{const n=S0(Lw,t.__scopeMenu),a=rv(Lw,t.__scopeMenu),r=xBe(Lw,t.__scopeMenu),i=_K(Lw,t.__scopeMenu),o=K.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:A}=i,l={__scopeMenu:t.__scopeMenu},u=K.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return K.useEffect(()=>u,[u]),K.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),A(null)}},[s,A]),be.jsx(IK,{asChild:!0,...l,children:be.jsx(yBe,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":FBe(n.open),...t,ref:fu(e,r.onTriggerChange),onClick:d=>{t.onClick?.(d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:on(t.onPointerMove,FB(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:on(t.onPointerLeave,FB(d=>{u();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,g=m==="right",h=g?-5:5,b=p[g?"left":"right"],y=p[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:b,y:p.top},{x:y,y:p.top},{x:y,y:p.bottom},{x:b,y:p.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:on(t.onKeyDown,d=>{const p=i.searchRef.current!=="";t.disabled||p&&d.key===" "||xZe[a.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});DBe.displayName=Lw;var SBe="MenuSubContent",NBe=K.forwardRef((t,e)=>{const n=gBe(Ec,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,i=S0(Ec,t.__scopeMenu),o=rv(Ec,t.__scopeMenu),s=xBe(SBe,t.__scopeMenu),A=K.useRef(null),l=ca(e,A);return be.jsx(NB.Provider,{scope:t.__scopeMenu,children:be.jsx(vs,{present:a||i.open,children:be.jsx(NB.Slot,{scope:t.__scopeMenu,children:be.jsx(xK,{id:s.contentId,"aria-labelledby":s.triggerId,...r,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{o.isUsingKeyboardRef.current&&A.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:on(t.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:on(t.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:on(t.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),p=DZe[o.dir].includes(u.key);d&&p&&(i.onOpenChange(!1),s.trigger?.focus(),u.preventDefault())})})})})})});NBe.displayName=SBe;function FBe(t){return t?"open":"closed"}function cD(t){return t==="indeterminate"}function NK(t){return cD(t)?"indeterminate":t?"checked":"unchecked"}function WZe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function VZe(t,e){return t.map((n,a)=>t[(e+a)%t.length])}function JZe(t,e,n){const r=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=VZe(t,Math.max(i,0));r.length===1&&(o=o.filter(l=>l!==n));const A=o.find(l=>l.toLowerCase().startsWith(r.toLowerCase()));return A!==n?A:void 0}function XZe(t,e){const{x:n,y:a}=t;let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const s=e[i],A=e[o],l=s.x,u=s.y,d=A.x,p=A.y;u>a!=p>a&&n<(d-l)*(a-u)/(p-u)+l&&(r=!r)}return r}function eWe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return XZe(n,e)}function FB(t){return e=>e.pointerType==="mouse"?t(e):void 0}var tWe=mBe,nWe=IK,aWe=fBe,rWe=hBe,iWe=DK,oWe=bBe,sWe=dS,AWe=CBe,cWe=EBe,lWe=kBe,uWe=IBe,dWe=QBe,pWe=_Be,mWe=DBe,gWe=NBe,pS="DropdownMenu",[fWe]=Cl(pS,[dBe]),Is=dBe(),[hWe,TBe]=fWe(pS),RBe=t=>{const{__scopeDropdownMenu:e,children:n,dir:a,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,A=Is(e),l=K.useRef(null),[u,d]=Dm({prop:r,defaultProp:i??!1,onChange:o,caller:pS});return be.jsx(hWe,{scope:e,triggerId:xo(),triggerRef:l,contentId:xo(),open:u,onOpenChange:d,onOpenToggle:K.useCallback(()=>d(p=>!p),[d]),modal:s,children:be.jsx(tWe,{...A,open:u,onOpenChange:d,dir:a,modal:s,children:n})})};RBe.displayName=pS;var MBe="DropdownMenuTrigger",LBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=t,i=TBe(MBe,n),o=Is(n);return be.jsx(nWe,{asChild:!0,...o,children:be.jsx(zn.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:fu(e,i.triggerRef),onPointerDown:on(t.onPointerDown,s=>{!a&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:on(t.onKeyDown,s=>{a||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});LBe.displayName=MBe;var bWe="DropdownMenuPortal",OBe=t=>{const{__scopeDropdownMenu:e,...n}=t,a=Is(e);return be.jsx(aWe,{...a,...n})};OBe.displayName=bWe;var GBe="DropdownMenuContent",PBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=TBe(GBe,n),i=Is(n),o=K.useRef(!1);return be.jsx(rWe,{id:r.contentId,"aria-labelledby":r.triggerId,...i,...a,ref:e,onCloseAutoFocus:on(t.onCloseAutoFocus,s=>{o.current||r.triggerRef.current?.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:on(t.onInteractOutside,s=>{const A=s.detail.originalEvent,l=A.button===0&&A.ctrlKey===!0,u=A.button===2||l;(!r.modal||u)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});PBe.displayName=GBe;var yWe="DropdownMenuGroup",CWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(iWe,{...r,...a,ref:e})});CWe.displayName=yWe;var wWe="DropdownMenuLabel",qBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(oWe,{...r,...a,ref:e})});qBe.displayName=wWe;var EWe="DropdownMenuItem",UBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(sWe,{...r,...a,ref:e})});UBe.displayName=EWe;var BWe="DropdownMenuCheckboxItem",kWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(AWe,{...r,...a,ref:e})});kWe.displayName=BWe;var vWe="DropdownMenuRadioGroup",$Be=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(cWe,{...r,...a,ref:e})});$Be.displayName=vWe;var IWe="DropdownMenuRadioItem",jBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(lWe,{...r,...a,ref:e})});jBe.displayName=IWe;var QWe="DropdownMenuItemIndicator",HBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(uWe,{...r,...a,ref:e})});HBe.displayName=QWe;var _We="DropdownMenuSeparator",zBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(dWe,{...r,...a,ref:e})});zBe.displayName=_We;var xWe="DropdownMenuArrow",DWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(pWe,{...r,...a,ref:e})});DWe.displayName=xWe;var SWe="DropdownMenuSubTrigger",NWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(mWe,{...r,...a,ref:e})});NWe.displayName=SWe;var FWe="DropdownMenuSubContent",TWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(gWe,{...r,...a,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});TWe.displayName=FWe;var d5n=RBe,p5n=LBe,m5n=OBe,g5n=PBe,f5n=qBe,h5n=UBe,b5n=$Be,y5n=jBe,C5n=HBe,w5n=zBe,RWe=Symbol.for("react.lazy"),lD=iK[" use ".trim().toString()];function MWe(t){return typeof t=="object"&&t!==null&&"then"in t}function YBe(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===RWe&&"_payload"in t&&MWe(t._payload)}function KBe(t){const e=LWe(t),n=K.forwardRef((a,r)=>{let{children:i,...o}=a;YBe(i)&&typeof lD=="function"&&(i=lD(i._payload));const s=K.Children.toArray(i),A=s.find(GWe);if(A){const l=A.props.children,u=s.map(d=>d===A?K.Children.count(l)>1?K.Children.only(null):K.isValidElement(l)?l.props.children:null:d);return be.jsx(e,{...o,ref:r,children:K.isValidElement(l)?K.cloneElement(l,void 0,u):null})}return be.jsx(e,{...o,ref:r,children:i})});return n.displayName=`${t}.Slot`,n}var E5n=KBe("Slot");function LWe(t){const e=K.forwardRef((n,a)=>{let{children:r,...i}=n;if(YBe(r)&&typeof lD=="function"&&(r=lD(r._payload)),K.isValidElement(r)){const o=qWe(r),s=PWe(i,r.props);return r.type!==K.Fragment&&(s.ref=a?fu(a,o):o),K.cloneElement(r,s)}return K.Children.count(r)>1?K.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var OWe=Symbol("radix.slottable");function GWe(t){return K.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OWe}function PWe(t,e){const n={...e};for(const a in e){const r=t[a],i=e[a];/^on[A-Z]/.test(a)?r&&i?n[a]=(...s)=>{const A=i(...s);return r(...s),A}:r&&(n[a]=r):a==="style"?n[a]={...r,...i}:a==="className"&&(n[a]=[r,i].filter(Boolean).join(" "))}return{...t,...n}}function qWe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const rie=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,iie=CEe,B5n=(t,e)=>n=>{var a;if(e?.variants==null)return iie(t,n?.class,n?.className);const{variants:r,defaultVariants:i}=e,o=Object.keys(r).map(l=>{const u=n?.[l],d=i?.[l];if(u===null)return null;const p=rie(u)||rie(d);return r[l][p]}),s=n&&Object.entries(n).reduce((l,u)=>{let[d,p]=u;return p===void 0||(l[d]=p),l},{}),A=e==null||(a=e.compoundVariants)===null||a===void 0?void 0:a.reduce((l,u)=>{let{class:d,className:p,...m}=u;return Object.entries(m).every(g=>{let[h,b]=g;return Array.isArray(b)?b.includes({...i,...s}[h]):{...i,...s}[h]===b})?[...l,d,p]:l},[]);return iie(t,o,A,n?.class,n?.className)},UWe={position:"absolute",top:0,bottom:0,textAlign:"center"},uD="diffs-container",$We=/(?=^From [a-f0-9]+ .+$)/m,FT=/(?=^diff --git)/gm,oie=/(?=^---\s+\S)/gm,jWe=/(?=^@@ )/gm,HWe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,f$=new RegExp("(?<=\\n)"),zWe=/^(---|\+\+\+)\s+([^\t\r\n]+)/,YWe=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,KWe=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,ZWe=/^index (?:[0-9a-f]+)\.\.(?:[0-9a-f]+)(?: (\d+))?/,FK="header-metadata",Vs={dark:"pierre-dark",light:"pierre-light"},ZBe="data-unsafe-css";function dD(t){return`annotation-${"side"in t?`${t.side}-`:""}${t.lineNumber}`}function WWe(t,e){return typeof window>"u"&&e!=null?be.jsxs(be.Fragment,{children:[be.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:e}}),t]}):be.jsx(be.Fragment,{children:t})}const Md=new Map,TT=new Map,h$=new Map,b$=new Set;function y$(t,e){t=Array.isArray(t)?t:[t];for(let n of t){let a;if(typeof n=="string"){if(a=Md.get(n),a==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else a=n,n=n.name,Md.has(n)||Md.set(n,a);b$.has(n)||(b$.add(n),e.loadThemeSync(a))}}const Kf=new Map,RT=new Map,C$=new Set;function sie(t,e){t=Array.isArray(t)?t:[t];for(const n of t){if(C$.has(n.name))continue;let a=Kf.get(n.name);a==null&&(a=n,Kf.set(n.name,a)),C$.add(a.name),e.loadLanguageSync(a.data)}}function WBe(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let hi=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function VWe(t){return TK(t)}function TK(t){return Array.isArray(t)?JWe(t):t instanceof RegExp?t:typeof t=="object"?XWe(t):t}function JWe(t){let e=[];for(let n=0,a=t.length;n<a;n++)e[n]=TK(t[n]);return e}function XWe(t){let e={};for(let n in t)e[n]=TK(t[n]);return e}function VBe(t,...e){return e.forEach(n=>{for(let a in n)t[a]=n[a]}),t}function JBe(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?JBe(t.substring(0,t.length-1)):t.substr(~e+1)}var MT=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,PQ=class{static hasCaptures(t){return t===null?!1:(MT.lastIndex=0,MT.test(t))}static replaceCaptures(t,e,n){return t.replace(MT,(a,r,i,o)=>{let s=n[parseInt(r||i,10)];if(s){let A=e.substring(s.start,s.end);for(;A[0]===".";)A=A.substring(1);switch(o){case"downcase":return A.toLowerCase();case"upcase":return A.toUpperCase();default:return A}}else return a})}};function XBe(t,e){return t<e?-1:t>e?1:0}function eke(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,a=e.length;if(n===a){for(let r=0;r<n;r++){let i=XBe(t[r],e[r]);if(i!==0)return i}return 0}return n-a}function Aie(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function tke(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var nke=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},pD=class{constructor(e,n,a){this._colorMap=e,this._defaults=n,this._root=a}static createFromRawTheme(e,n){return this.createFromParsedTheme(nVe(e),n)}static createFromParsedTheme(e,n){return rVe(e,n)}_cachedMatchRoot=new nke(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const n=e.scopeName,r=this._cachedMatchRoot.get(n).find(i=>eVe(e.parent,i.parentScopes));return r?new ake(r.fontStyle,r.foreground,r.background):null}},LT=class _x{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const a of n)e=new _x(e,a);return e}static from(...e){let n=null;for(let a=0;a<e.length;a++)n=new _x(n,e[a]);return n}push(e){return new _x(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push(a.scopeName),a=a.parent;return a===e?n.reverse():void 0}};function eVe(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let a=e[n],r=!1;if(a===">"){if(n===e.length-1)return!1;a=e[++n],r=!0}for(;t&&!tVe(t.scopeName,a);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function tVe(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var ake=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function nVe(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],a=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let s;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),s=d.split(",")}else Array.isArray(o.scope)?s=o.scope:s=[""];let A=-1;if(typeof o.settings.fontStyle=="string"){A=0;let d=o.settings.fontStyle.split(" ");for(let p=0,m=d.length;p<m;p++)switch(d[p]){case"italic":A=A|1;break;case"bold":A=A|2;break;case"underline":A=A|4;break;case"strikethrough":A=A|8;break}}let l=null;typeof o.settings.foreground=="string"&&Aie(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&Aie(o.settings.background)&&(u=o.settings.background);for(let d=0,p=s.length;d<p;d++){let g=s[d].trim().split(" "),h=g[g.length-1],b=null;g.length>1&&(b=g.slice(0,g.length-1),b.reverse()),n[a++]=new aVe(h,b,r,A,l,u)}}return n}var aVe=class{constructor(t,e,n,a,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},jo=(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))(jo||{});function rVe(t,e){t.sort((A,l)=>{let u=XBe(A.scope,l.scope);return u!==0||(u=eke(A.parentScopes,l.parentScopes),u!==0)?u:A.index-l.index});let n=0,a="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let A=t.shift();A.fontStyle!==-1&&(n=A.fontStyle),A.foreground!==null&&(a=A.foreground),A.background!==null&&(r=A.background)}let i=new iVe(e),o=new ake(n,i.getId(a),i.getId(r)),s=new sVe(new w$(0,null,-1,0,0),[]);for(let A=0,l=t.length;A<l;A++){let u=t[A];s.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new pD(i,o,s)}var iVe=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},oVe=Object.freeze([]),w$=class rke{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,a,r,i){this.scopeDepth=e,this.parentScopes=n||oVe,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new rke(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let a=0,r=e.length;a<r;a++)n[a]=e[a].clone();return n}acceptOverwrite(e,n,a,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},sVe=class E${constructor(e,n=[],a={}){this._mainRule=e,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let a=0,r=0;for(;e.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let a=e.indexOf("."),r,i;if(a===-1?(r=e,i=""):(r=e.substring(0,a),i=e.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(E$._cmpBySpecificity),n}insert(e,n,a,r,i,o){if(n===""){this._doInsertHere(e,a,r,i,o);return}let s=n.indexOf("."),A,l;s===-1?(A=n,l=""):(A=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(A)?u=this._children[A]:(u=new E$(this._mainRule.clone(),w$.cloneArr(this._rulesWithParentScopes)),this._children[A]=u),u.insert(e+1,l,a,r,i,o)}_doInsertHere(e,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(e,a,r,i);return}for(let o=0,s=this._rulesWithParentScopes.length;o<s;o++){let A=this._rulesWithParentScopes[o];if(eke(A.parentScopes,n)===0){A.acceptOverwrite(e,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new w$(e,n,a,r,i))}},B2=class nc{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=nc.getLanguageId(e),a=nc.getTokenType(e),r=nc.getFontStyle(e),i=nc.getForeground(e),o=nc.getBackground(e);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>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,a,r,i,o,s){let A=nc.getLanguageId(e),l=nc.getTokenType(e),u=nc.containsBalancedBrackets(e)?1:0,d=nc.getFontStyle(e),p=nc.getForeground(e),m=nc.getBackground(e);return n!==0&&(A=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(d=i),o!==0&&(p=o),s!==0&&(m=s),(A<<0|l<<8|u<<10|d<<11|p<<15|m<<24)>>>0}};function mD(t,e){const n=[],a=AVe(t);let r=a.next();for(;r!==null;){let A=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":A=1;break;case"L":A=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=o();if(n.push({matcher:l,priority:A}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const A=i();return l=>!!A&&!A(l)}if(r==="("){r=a.next();const A=s();return r===")"&&(r=a.next()),A}if(cie(r)){const A=[];do A.push(r),r=a.next();while(cie(r));return l=>e(A,l)}return null}function o(){const A=[];let l=i();for(;l;)A.push(l),l=i();return u=>A.every(d=>d(u))}function s(){const A=[];let l=o();for(;l&&(A.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=o()}return u=>A.some(d=>d(u))}}function cie(t){return!!t&&!!t.match(/[\w\.:]+/)}function AVe(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const a=n[0];return n=e.exec(t),a}}}function ike(t){typeof t.dispose=="function"&&t.dispose()}var TB=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},cVe=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},lVe=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))}},uVe=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new TB(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new lVe;for(const n of t)dVe(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof TB){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 dVe(t,e,n,a){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof TB?xx({baseGrammar:i,selfGrammar:r},a):B$(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const o=n.injections(t.scopeName);if(o)for(const s of o)a.add(new TB(s))}function B$(t,e,n){if(e.repository&&e.repository[t]){const a=e.repository[t];gD([a],e,n)}}function xx(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&gD(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&gD(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function gD(t,e,n){for(const a of t){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?VBe({},e.repository,a.repository):e.repository;Array.isArray(a.patterns)&&gD(a.patterns,{...e,repository:r},n);const i=a.include;if(!i)continue;const o=oke(i);switch(o.kind){case 0:xx({...e,selfGrammar:e.baseGrammar},n);break;case 1:xx(e,n);break;case 2:B$(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const s=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(s){const A={baseGrammar:e.baseGrammar,selfGrammar:s,repository:r};o.kind===4?B$(o.ruleName,A,n):xx(A,n)}else o.kind===4?n.add(new cVe(o.scopeName,o.ruleName)):n.add(new TB(o.scopeName));break}}}var pVe=class{kind=0},mVe=class{kind=1},gVe=class{constructor(t){this.ruleName=t}kind=2},fVe=class{constructor(t){this.scopeName=t}kind=3},hVe=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function oke(t){if(t==="$base")return new pVe;if(t==="$self")return new mVe;const e=t.indexOf("#");if(e===-1)return new fVe(t);if(e===0)return new gVe(t.substring(1));{const n=t.substring(0,e),a=t.substring(e+1);return new hVe(n,a)}}var bVe=/\\(\d+)/,lie=/\\(\d+)/g,yVe=-1,ske=-2;var iv=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,n,a,r){this.$location=e,this.id=n,this._name=a||null,this._nameIsCapturing=PQ.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=PQ.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${JBe(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,n){return!this._nameIsCapturing||this._name===null||e===null||n===null?this._name:PQ.replaceCaptures(this._name,e,n)}getContentName(e,n){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:PQ.replaceCaptures(this._contentName,e,n)}},CVe=class extends iv{retokenizeCapturedWithRuleId;constructor(t,e,n,a,r){super(t,e,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,a){throw new Error("Not supported!")}},wVe=class extends iv{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,null),this._match=new RB(a,this.id),this.captures=r,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,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new MB,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},uie=class extends iv{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.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,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new MB,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},k$=class extends iv{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r,i,o,s,A,l){super(t,e,n,a),this._begin=new RB(r,this.id),this.beginCaptures=i,this._end=new RB(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=A||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,a){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,a)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new MB;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}},fD=class extends iv{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,a,r,i,o,s,A){super(t,e,n,a),this._begin=new RB(r,this.id),this.beginCaptures=i,this.whileCaptures=s,this._while=new RB(o,ske),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=A.patterns,this.hasMissingPatterns=A.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,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new MB;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,a){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,a)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new MB,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},Ake=class Go{static createCaptureRule(e,n,a,r,i){return e.registerRule(o=>new CVe(n,o,a,r,i))}static getCompiledRuleId(e,n,a){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new wVe(e.$vscodeTextmateLocation,e.id,e.name,e.match,Go._compileCaptures(e.captures,n,a));if(typeof e.begin>"u"){e.repository&&(a=VBe({},a,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new uie(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Go._compilePatterns(i,n,a))}return e.while?new fD(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Go._compileCaptures(e.beginCaptures||e.captures,n,a),e.while,Go._compileCaptures(e.whileCaptures||e.captures,n,a),Go._compilePatterns(e.patterns,n,a)):new k$(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Go._compileCaptures(e.beginCaptures||e.captures,n,a),e.end,Go._compileCaptures(e.endCaptures||e.captures,n,a),e.applyEndPatternLast,Go._compilePatterns(e.patterns,n,a))}),e.id}static _compileCaptures(e,n,a){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);s>i&&(i=s)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);let A=0;e[o].patterns&&(A=Go.getCompiledRuleId(e[o],n,a)),r[s]=Go.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,A)}}return r}static _compilePatterns(e,n,a){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const s=e[i];let A=-1;if(s.include){const l=oke(s.include);switch(l.kind){case 0:case 1:A=Go.getCompiledRuleId(a[s.include],n,a);break;case 2:let u=a[l.ruleName];u&&(A=Go.getCompiledRuleId(u,n,a));break;case 3:case 4:const d=l.scopeName,p=l.kind===4?l.ruleName:null,m=n.getExternalGrammar(d,a);if(m)if(p){let g=m.repository[p];g&&(A=Go.getCompiledRuleId(g,n,m.repository))}else A=Go.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else A=Go.getCompiledRuleId(s,n,a);if(A!==-1){const l=n.getRule(A);let u=!1;if((l instanceof uie||l instanceof k$||l instanceof fD)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(A)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},RB=class cke{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const a=e.length;let r=0,i=[],o=!1;for(let s=0;s<a;s++)if(e.charAt(s)==="\\"&&s+1<a){const l=e.charAt(s+1);l==="z"?(i.push(e.substring(r,s)),i.push("$(?!\\n)(?<!\\n)"),r=s+2):(l==="A"||l==="G")&&(o=!0),s++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=bVe.test(this.source):this.hasBackReferences=!1}clone(){return new cke(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>e.substring(r.start,r.end));return lie.lastIndex=0,this.source.replace(lie,(r,i)=>tke(a[parseInt(i,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=[],a=[],r=[],i,o,s,A;for(i=0,o=this.source.length;i<o;i++)s=this.source.charAt(i),e[i]=s,n[i]=s,a[i]=s,r[i]=s,s==="\\"&&i+1<o&&(A=this.source.charAt(i+1),A==="A"?(e[i+1]="￿",n[i+1]="￿",a[i+1]="A",r[i+1]="A"):A==="G"?(e[i+1]="￿",n[i+1]="G",a[i+1]="￿",r[i+1]="G"):(e[i+1]=A,n[i+1]=A,a[i+1]=A,r[i+1]=A),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},MB=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new die(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 a=this._items.map(r=>r.resolveAnchors(e,n));return new die(t,a,this._items.map(r=>r.ruleId))}},die=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<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
59
- `)}findNextMatchSync(t,e,n){const a=this.scanner.findNextMatchSync(t,e,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},OT=class{constructor(t,e){this.languageId=t,this.tokenType=e}},EVe=class v${_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new OT(e,8),this._embeddedLanguagesMatcher=new BVe(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?v$._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new OT(0,0);_getBasicScopeAttributes=new nke(e=>{const n=this._scopeToLanguage(e),a=this._toStandardTokenType(e);return new OT(n,a)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(v$.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/},BVe=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,a])=>tke(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])}},pie=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function lke(t,e,n,a,r,i,o,s){const A=e.content.length;let l=!1,u=-1;if(o){const m=kVe(t,e,n,a,r,i);r=m.stack,a=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new pie(r,!0);p()}return new pie(r,!1);function p(){const m=vVe(t,e,n,a,r,u);if(!m){i.produce(r,A),l=!0;return}const g=m.captureIndices,h=m.matchedRuleId,b=g&&g.length>0?g[0].end>a:!1;if(h===yVe){const y=r.getRule(t);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),Ow(t,e,n,r,i,y.endCaptures,g),i.produce(r,g[0].end);const w=r;if(r=r.parent,u=w.getAnchorPos(),!b&&w.getEnterPos()===a){r=w,i.produce(r,A),l=!0;return}}else{const y=t.getRule(h);i.produce(r,g[0].start);const w=r,E=y.getName(e.content,g),k=r.contentNameScopesList.pushAttributed(E,t);if(r=r.push(h,a,u,g[0].end===A,null,k,k),y instanceof k$){const v=y;Ow(t,e,n,r,i,v.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const _=v.getContentName(e.content,g),I=k.pushAttributed(_,t);if(r=r.withContentNameScopesList(I),v.endHasBackReferences&&(r=r.withEndRule(v.getEndWithResolvedBackReferences(e.content,g))),!b&&w.hasSameRuleAs(r)){r=r.pop(),i.produce(r,A),l=!0;return}}else if(y instanceof fD){const v=y;Ow(t,e,n,r,i,v.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const _=v.getContentName(e.content,g),I=k.pushAttributed(_,t);if(r=r.withContentNameScopesList(I),v.whileHasBackReferences&&(r=r.withEndRule(v.getWhileWithResolvedBackReferences(e.content,g))),!b&&w.hasSameRuleAs(r)){r=r.pop(),i.produce(r,A),l=!0;return}}else if(Ow(t,e,n,r,i,y.captures,g),i.produce(r,g[0].end),r=r.pop(),!b){r=r.safePop(),i.produce(r,A),l=!0;return}}g[0].end>a&&(a=g[0].end,n=!1)}}function kVe(t,e,n,a,r,i){let o=r.beginRuleCapturedEOL?0:-1;const s=[];for(let A=r;A;A=A.pop()){const l=A.getRule(t);l instanceof fD&&s.push({rule:l,stack:A})}for(let A=s.pop();A;A=s.pop()){const{ruleScanner:l,findOptions:u}=_Ve(A.rule,t,A.stack.endRule,n,a===o),d=l.findNextMatchSync(e,a,u);if(d){if(d.ruleId!==ske){r=A.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(A.stack,d.captureIndices[0].start),Ow(t,e,n,A.stack,i,A.rule.whileCaptures,d.captureIndices),i.produce(A.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>a&&(a=d.captureIndices[0].end,n=!1))}else{r=A.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:o,isFirstLine:n}}function vVe(t,e,n,a,r,i){const o=IVe(t,e,n,a,r,i),s=t.getInjections();if(s.length===0)return o;const A=QVe(s,t,e,n,a,r,i);if(!A)return o;if(!o)return A;const l=o.captureIndices[0].start,u=A.captureIndices[0].start;return u<l||A.priorityMatch&&u===l?A:o}function IVe(t,e,n,a,r,i){const o=r.getRule(t),{ruleScanner:s,findOptions:A}=uke(o,t,r.endRule,n,a===i),l=s.findNextMatchSync(e,a,A);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function QVe(t,e,n,a,r,i,o){let s=Number.MAX_VALUE,A=null,l,u=0;const d=i.contentNameScopesList.getScopeNames();for(let p=0,m=t.length;p<m;p++){const g=t[p];if(!g.matcher(d))continue;const h=e.getRule(g.ruleId),{ruleScanner:b,findOptions:y}=uke(h,e,null,a,r===o),w=b.findNextMatchSync(n,r,y);if(!w)continue;const E=w.captureIndices[0].start;if(!(E>=s)&&(s=E,A=w.captureIndices,l=w.ruleId,u=g.priority,s===r))break}return A?{priorityMatch:u===-1,captureIndices:A,matchedRuleId:l}:null}function uke(t,e,n,a,r){return{ruleScanner:t.compileAG(e,n,a,r),findOptions:0}}function _Ve(t,e,n,a,r){return{ruleScanner:t.compileWhileAG(e,n,a,r),findOptions:0}}function Ow(t,e,n,a,r,i,o){if(i.length===0)return;const s=e.content,A=Math.min(i.length,o.length),l=[],u=o[0].end;for(let d=0;d<A;d++){const p=i[d];if(p===null)continue;const m=o[d];if(m.length===0)continue;if(m.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=m.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,m.start):r.produce(a,m.start),p.retokenizeCapturedWithRuleId){const h=p.getName(s,o),b=a.contentNameScopesList.pushAttributed(h,t),y=p.getContentName(s,o),w=b.pushAttributed(y,t),E=a.push(p.retokenizeCapturedWithRuleId,m.start,-1,!1,null,b,w),k=t.createOnigString(s.substring(0,m.end));lke(t,k,n&&m.start===0,m.start,E,r,!1,0),ike(k);continue}const g=p.getName(s,o);if(g!==null){const b=(l.length>0?l[l.length-1].scopes:a.contentNameScopesList).pushAttributed(g,t);l.push(new xVe(b,m.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var xVe=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function DVe(t,e,n,a,r,i,o,s){return new NVe(t,e,n,a,r,i,o,s)}function mie(t,e,n,a,r){const i=mD(e,hD),o=Ake.getCompiledRuleId(n,a,r.repository);for(const s of i)t.push({debugSelector:e,matcher:s.matcher,ruleId:o,grammar:r,priority:s.priority})}function hD(t,e){if(e.length<t.length)return!1;let n=0;return t.every(a=>{for(let r=n;r<e.length;r++)if(SVe(e[r],a))return n=r+1,!0;return!1})}function SVe(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var NVe=class{constructor(e,n,a,r,i,o,s,A){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=A,this._basicScopeAttributesProvider=new EVe(a,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=gie(n,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=mD(l,hD);for(const d of u)this._tokenTypeMatchers.push({matcher:d.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},n=[],a=this._rootScopeName,r=e.lookup(a);if(r){const i=r.injections;if(i)for(let s in i)mie(n,s,i[s],this,r);const o=this._grammarRepository.injections(a);o&&o.forEach(s=>{const A=this.getExternalGrammar(s);if(A){const l=A.injectionSelector;l&&mie(n,l,A,this,A)}})}return n.sort((i,o)=>i.priority-o.priority),n}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const n=++this._lastRuleId,a=e(n);return this._ruleId2desc[n]=a,a}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,n){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const a=this._grammarRepository.lookup(e);if(a)return this._includedGrammars[e]=gie(a,n&&n.$base),this._includedGrammars[e]}}tokenizeLine(e,n,a=0){const r=this._tokenize(e,n,!1,a);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,n,a=0){const r=this._tokenize(e,n,!0,a);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,n,a,r){this._rootId===-1&&(this._rootId=Ake.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!n||n===I$.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),p=B2.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),m=this.getRule(this._rootId).getName(null,null);let g;m?g=YE.createRootAndLookUpScopeName(m,p,this):g=YE.createRoot("unknown",p),n=new I$(null,this._rootId,-1,-1,!1,null,g,g)}else i=!1,n.reset();e=e+`
60
- `;const o=this.createOnigString(e),s=o.content.length,A=new TVe(a,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=lke(this,o,i,0,n,A,!0,r);return ike(o),{lineLength:s,lineTokens:A,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function gie(t,e){return t=VWe(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 YE=class Ll{constructor(e,n,a){this.parent=e,this.scopePath=n,this.tokenAttributes=a}static fromExtension(e,n){let a=e,r=e?.scopePath??null;for(const i of n)r=LT.push(r,i.scopeNames),a=new Ll(a,r,i.encodedTokenAttributes);return a}static createRoot(e,n){return new Ll(null,new LT(null,e),n)}static createRootAndLookUpScopeName(e,n,a){const r=a.getMetadataForScope(e),i=new LT(null,e),o=a.themeProvider.themeMatch(i),s=Ll.mergeAttributes(n,r,o);return new Ll(null,i,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Ll.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,a){let r=-1,i=0,o=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,o=a.backgroundId),B2.set(e,n.languageId,n.tokenType,null,r,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return Ll._pushAttributed(this,e,n);const a=e.split(/ /g);let r=this;for(const i of a)r=Ll._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,a){const r=a.getMetadataForScope(n),i=e.scopePath.push(n),o=a.themeProvider.themeMatch(i),s=Ll.mergeAttributes(e.tokenAttributes,r,o);return new Ll(e,i,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===e?n.reverse():void 0}},I$=class uf{constructor(e,n,a,r,i,o,s,A){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=s,this.contentNameScopesList=A,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new uf(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:uf._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?YE.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(){uf._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,a,r,i,o,s){return new uf(this,e,n,a,r,i,o,s)}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 uf(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 a=YE.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new uf(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,YE.fromExtension(a,n.contentNameScopesList))}},FVe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):mD(n,hD).map(a=>a.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>mD(n,hD).map(a=>a.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}},TVe=class{constructor(t,e,n,a){this.balancedBracketSelectors=a,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 a=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(i)&&(a=B2.set(a,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(a=B2.set(a,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),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 a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},RVe=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,a,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,DVe(t,i,e,n,a,r,this,this._onigLib))}return this._grammars.get(t)}},MVe=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new RVe(pD.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(pD.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,a){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(e,n,a){return this._loadGrammar(e,n,a.embeddedLanguages,a.tokenTypes,new FVe(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,a,r,i){const o=new uVe(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(s=>this._loadSingleGrammar(s.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,a,r,i)}_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 a=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(e,n=[],a=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,a,r)}_grammarForScopeName(e,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,a,r,i)}},Q$=I$.NULL;const dke=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ov{constructor(e,n,a){this.normal=n,this.property=e,a&&(this.space=a)}}ov.prototype.normal={};ov.prototype.property={};ov.prototype.space=void 0;function pke(t,e){const n={},a={};for(const r of t)Object.assign(n,r.property),Object.assign(a,r.normal);return new ov(n,a,e)}function LB(t){return t.toLowerCase()}let rA=class{constructor(e,n){this.attribute=n,this.property=e}};rA.prototype.attribute="";rA.prototype.booleanish=!1;rA.prototype.boolean=!1;rA.prototype.commaOrSpaceSeparated=!1;rA.prototype.commaSeparated=!1;rA.prototype.defined=!1;rA.prototype.mustUseProperty=!1;rA.prototype.number=!1;rA.prototype.overloadedBoolean=!1;rA.prototype.property="";rA.prototype.spaceSeparated=!1;rA.prototype.space=void 0;let LVe=0;const ea=N0(),di=N0(),_$=N0(),Ht=N0(),dr=N0(),Vb=N0(),CA=N0();function N0(){return 2**++LVe}const x$=Object.freeze(Object.defineProperty({__proto__:null,boolean:ea,booleanish:di,commaOrSpaceSeparated:CA,commaSeparated:Vb,number:Ht,overloadedBoolean:_$,spaceSeparated:dr},Symbol.toStringTag,{value:"Module"})),GT=Object.keys(x$);class RK extends rA{constructor(e,n,a,r){let i=-1;if(super(e,n),fie(this,"space",r),typeof a=="number")for(;++i<GT.length;){const o=GT[i];fie(this,GT[i],(a&x$[o])===x$[o])}}}RK.prototype.defined=!0;function fie(t,e,n){n&&(t[e]=n)}function b1(t){const e={},n={};for(const[a,r]of Object.entries(t.properties)){const i=new RK(a,t.transform(t.attributes||{},a),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),e[a]=i,n[LB(a)]=a,n[LB(i.attribute)]=a}return new ov(e,n,t.space)}const mke=b1({properties:{ariaActiveDescendant:null,ariaAtomic:di,ariaAutoComplete:null,ariaBusy:di,ariaChecked:di,ariaColCount:Ht,ariaColIndex:Ht,ariaColSpan:Ht,ariaControls:dr,ariaCurrent:null,ariaDescribedBy:dr,ariaDetails:null,ariaDisabled:di,ariaDropEffect:dr,ariaErrorMessage:null,ariaExpanded:di,ariaFlowTo:dr,ariaGrabbed:di,ariaHasPopup:null,ariaHidden:di,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dr,ariaLevel:Ht,ariaLive:null,ariaModal:di,ariaMultiLine:di,ariaMultiSelectable:di,ariaOrientation:null,ariaOwns:dr,ariaPlaceholder:null,ariaPosInSet:Ht,ariaPressed:di,ariaReadOnly:di,ariaRelevant:null,ariaRequired:di,ariaRoleDescription:dr,ariaRowCount:Ht,ariaRowIndex:Ht,ariaRowSpan:Ht,ariaSelected:di,ariaSetSize:Ht,ariaSort:null,ariaValueMax:Ht,ariaValueMin:Ht,ariaValueNow:Ht,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function gke(t,e){return e in t?t[e]:e}function fke(t,e){return gke(t,e.toLowerCase())}const OVe=b1({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vb,acceptCharset:dr,accessKey:dr,action:null,allow:null,allowFullScreen:ea,allowPaymentRequest:ea,allowUserMedia:ea,alt:null,as:null,async:ea,autoCapitalize:null,autoComplete:dr,autoFocus:ea,autoPlay:ea,blocking:dr,capture:null,charSet:null,checked:ea,cite:null,className:dr,cols:Ht,colSpan:null,content:null,contentEditable:di,controls:ea,controlsList:dr,coords:Ht|Vb,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ea,defer:ea,dir:null,dirName:null,disabled:ea,download:_$,draggable:di,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ea,formTarget:null,headers:dr,height:Ht,hidden:_$,high:Ht,href:null,hrefLang:null,htmlFor:dr,httpEquiv:dr,id:null,imageSizes:null,imageSrcSet:null,inert:ea,inputMode:null,integrity:null,is:null,isMap:ea,itemId:null,itemProp:dr,itemRef:dr,itemScope:ea,itemType:dr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ea,low:Ht,manifest:null,max:null,maxLength:Ht,media:null,method:null,min:null,minLength:Ht,multiple:ea,muted:ea,name:null,nonce:null,noModule:ea,noValidate:ea,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ea,optimum:Ht,pattern:null,ping:dr,placeholder:null,playsInline:ea,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ea,referrerPolicy:null,rel:dr,required:ea,reversed:ea,rows:Ht,rowSpan:Ht,sandbox:dr,scope:null,scoped:ea,seamless:ea,selected:ea,shadowRootClonable:ea,shadowRootDelegatesFocus:ea,shadowRootMode:null,shape:null,size:Ht,sizes:null,slot:null,span:Ht,spellCheck:di,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ht,step:null,style:null,tabIndex:Ht,target:null,title:null,translate:null,type:null,typeMustMatch:ea,useMap:null,value:di,width:Ht,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dr,axis:null,background:null,bgColor:null,border:Ht,borderColor:null,bottomMargin:Ht,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ea,declare:ea,event:null,face:null,frame:null,frameBorder:null,hSpace:Ht,leftMargin:Ht,link:null,longDesc:null,lowSrc:null,marginHeight:Ht,marginWidth:Ht,noResize:ea,noHref:ea,noShade:ea,noWrap:ea,object:null,profile:null,prompt:null,rev:null,rightMargin:Ht,rules:null,scheme:null,scrolling:di,standby:null,summary:null,text:null,topMargin:Ht,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ht,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ea,disableRemotePlayback:ea,prefix:null,property:null,results:Ht,security:null,unselectable:null},space:"html",transform:fke}),GVe=b1({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:CA,accentHeight:Ht,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ht,amplitude:Ht,arabicForm:null,ascent:Ht,attributeName:null,attributeType:null,azimuth:Ht,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ht,by:null,calcMode:null,capHeight:Ht,className:dr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ht,diffuseConstant:Ht,direction:null,display:null,dur:null,divisor:Ht,dominantBaseline:null,download:ea,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ht,enableBackground:null,end:null,event:null,exponent:Ht,externalResourcesRequired:null,fill:null,fillOpacity:Ht,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Vb,g2:Vb,glyphName:Vb,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ht,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ht,horizOriginX:Ht,horizOriginY:Ht,id:null,ideographic:Ht,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ht,k:Ht,k1:Ht,k2:Ht,k3:Ht,k4:Ht,kernelMatrix:CA,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ht,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ht,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ht,overlineThickness:Ht,paintOrder:null,panose1:null,path:null,pathLength:Ht,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ht,pointsAtY:Ht,pointsAtZ:Ht,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:CA,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:CA,rev:CA,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:CA,requiredFeatures:CA,requiredFonts:CA,requiredFormats:CA,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ht,specularExponent:Ht,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ht,strikethroughThickness:Ht,string:null,stroke:null,strokeDashArray:CA,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ht,strokeOpacity:Ht,strokeWidth:null,style:null,surfaceScale:Ht,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:CA,tabIndex:Ht,tableValues:null,target:null,targetX:Ht,targetY:Ht,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:CA,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ht,underlineThickness:Ht,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ht,values:null,vAlphabetic:Ht,vMathematical:Ht,vectorEffect:null,vHanging:Ht,vIdeographic:Ht,version:null,vertAdvY:Ht,vertOriginX:Ht,vertOriginY:Ht,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ht,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:gke}),hke=b1({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bke=b1({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fke}),yke=b1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),PVe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},qVe=/[A-Z]/g,hie=/-[a-z]/g,UVe=/^data[-\w.:]+$/i;function sv(t,e){const n=LB(e);let a=e,r=rA;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&UVe.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(hie,jVe);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!hie.test(i)){let o=i.replace(qVe,$Ve);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=RK}return new r(a,e)}function $Ve(t){return"-"+t.toLowerCase()}function jVe(t){return t.charAt(1).toUpperCase()}const y1=pke([mke,OVe,hke,bke,yke],"html"),vu=pke([mke,GVe,hke,bke,yke],"svg"),bie={}.hasOwnProperty;function MK(t,e){const n=e||{};function a(r,...i){let o=a.invalid;const s=a.handlers;if(r&&bie.call(r,t)){const A=String(r[t]);o=bie.call(s,A)?s[A]:a.unknown}if(o)return o.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const HVe=/["&'<>`]/g,zVe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,YVe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,KVe=/[|\\{}()[\]^$+*?.]/g,yie=new WeakMap;function ZVe(t,e){if(t=t.replace(e.subset?WVe(e.subset):HVe,a),e.subset||e.escapeOnly)return t;return t.replace(zVe,n).replace(YVe,a);function n(r,i,o){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function a(r,i,o){return e.format(r.charCodeAt(0),o.charCodeAt(i+1),e)}}function WVe(t){let e=yie.get(t);return e||(e=VVe(t),yie.set(t,e)),e}function VVe(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(KVe,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const JVe=/[\dA-Fa-f]/;function XVe(t,e,n){const a="&#x"+t.toString(16).toUpperCase();return n&&e&&!JVe.test(String.fromCharCode(e))?a:a+";"}const eJe=/\d/;function tJe(t,e,n){const a="&#"+String(t);return n&&e&&!eJe.test(String.fromCharCode(e))?a:a+";"}const nJe=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],PT={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},aJe=["cent","copy","divide","gt","lt","not","para","times"],Cke={}.hasOwnProperty,D$={};let qQ;for(qQ in PT)Cke.call(PT,qQ)&&(D$[PT[qQ]]=qQ);const rJe=/[^\dA-Za-z]/;function iJe(t,e,n,a){const r=String.fromCharCode(t);if(Cke.call(D$,r)){const i=D$[r],o="&"+i;return n&&nJe.includes(i)&&!aJe.includes(i)&&(!a||e&&e!==61&&rJe.test(String.fromCharCode(e)))?o:o+";"}return""}function oJe(t,e,n){let a=XVe(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=iJe(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=tJe(t,e,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function Jb(t,e){return ZVe(t,Object.assign({format:oJe},e))}const sJe=/^>|^->|<!--|-->|--!>|<!-$/g,AJe=[">"],cJe=["<",">"];function lJe(t,e,n,a){return a.settings.bogusComments?"<?"+Jb(t.value,Object.assign({},a.settings.characterReferences,{subset:AJe}))+">":"<!--"+t.value.replace(sJe,r)+"-->";function r(i){return Jb(i,Object.assign({},a.settings.characterReferences,{subset:cJe}))}}function uJe(t,e,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function bD(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(e);for(;r!==-1;)a++,r=n.indexOf(e,r+e.length);return a}function Cie(t){const e=[],n=String(t||"");let a=n.indexOf(","),r=0,i=!1;for(;!i;){a===-1&&(a=n.length,i=!0);const o=n.slice(r,a).trim();(o||!i)&&e.push(o),r=a+1,a=n.indexOf(",",r)}return e}function LK(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function wie(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function OK(t){return t.join(" ").trim()}const dJe=/[ \t\n\f\r]/g;function mS(t){return typeof t=="object"?t.type==="text"?Eie(t.value):!1:Eie(t)}function Eie(t){return t.replace(dJe,"")===""}const Ui=Eke(1),wke=Eke(-1),pJe=[];function Eke(t){return e;function e(n,a,r){const i=n?n.children:pJe;let o=(a||0)+t,s=i[o];if(!r)for(;s&&mS(s);)o+=t,s=i[o];return s}}const mJe={}.hasOwnProperty;function Bke(t){return e;function e(n,a,r){return mJe.call(t,n.tagName)&&t[n.tagName](n,a,r)}}const GK=Bke({body:fJe,caption:qT,colgroup:qT,dd:CJe,dt:yJe,head:qT,html:gJe,li:bJe,optgroup:wJe,option:EJe,p:hJe,rp:Bie,rt:Bie,tbody:kJe,td:kie,tfoot:vJe,th:kie,thead:BJe,tr:IJe});function qT(t,e,n){const a=Ui(n,e,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&mS(a.value.charAt(0)))}function gJe(t,e,n){const a=Ui(n,e);return!a||a.type!=="comment"}function fJe(t,e,n){const a=Ui(n,e);return!a||a.type!=="comment"}function hJe(t,e,n){const a=Ui(n,e);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.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 bJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&a.tagName==="li"}function yJe(t,e,n){const a=Ui(n,e);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function CJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Bie(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function wJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&a.tagName==="optgroup"}function EJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function BJe(t,e,n){const a=Ui(n,e);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function kJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function vJe(t,e,n){return!Ui(n,e)}function IJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&a.tagName==="tr"}function kie(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const QJe=Bke({body:DJe,colgroup:SJe,head:xJe,html:_Je,tbody:NJe});function _Je(t){const e=Ui(t,-1);return!e||e.type!=="comment"}function xJe(t){const e=new Set;for(const a of t.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(e.has(a.tagName))return!1;e.add(a.tagName)}const n=t.children[0];return!n||n.type==="element"}function DJe(t){const e=Ui(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&mS(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function SJe(t,e,n){const a=wke(n,e),r=Ui(t,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&GK(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function NJe(t,e,n){const a=wke(n,e),r=Ui(t,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&GK(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const UQ={name:[[`
58
+ `)},BZe=0,Vh=[];function kZe(t){var e=K.useRef([]),n=K.useRef([0,0]),a=K.useRef(),r=K.useState(BZe++)[0],i=K.useState(sBe)[0],o=K.useRef(t);K.useEffect(function(){o.current=t},[t]),K.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var h=HKe([t.lockRef.current],(t.shards||[]).map(nie),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var s=K.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!o.current.allowPinchZoom;var y=GQ(h),w=n.current,E="deltaX"in h?h.deltaX:w[0]-y[0],k="deltaY"in h?h.deltaY:w[1]-y[1],v,_=h.target,I=Math.abs(E)>Math.abs(k)?"h":"v";if("touches"in h&&I==="h"&&_.type==="range")return!1;var x=window.getSelection(),N=x&&x.anchorNode,R=N?N===_||N.contains(_):!1;if(R)return!1;var T=eie(I,_);if(!T)return!0;if(T?v=I:(v=I==="v"?"h":"v",T=eie(I,_)),!T)return!1;if(!a.current&&"changedTouches"in h&&(E||k)&&(a.current=v),!v)return!0;var O=a.current||v;return CZe(O,b,h,O==="h"?E:k)},[]),A=K.useCallback(function(h){var b=h;if(!(!Vh.length||Vh[Vh.length-1]!==i)){var y="deltaY"in b?tie(b):GQ(b),w=e.current.filter(function(v){return v.name===b.type&&(v.target===b.target||b.target===v.shadowParent)&&wZe(v.delta,y)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}if(!w){var E=(o.current.shards||[]).map(nie).filter(Boolean).filter(function(v){return v.contains(b.target)}),k=E.length>0?s(b,E[0]):!o.current.noIsolation;k&&b.cancelable&&b.preventDefault()}}},[]),l=K.useCallback(function(h,b,y,w){var E={name:h,delta:b,target:y,should:w,shadowParent:vZe(y)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(k){return k!==E})},1)},[]),u=K.useCallback(function(h){n.current=GQ(h),a.current=void 0},[]),d=K.useCallback(function(h){l(h.type,tie(h),h.target,s(h,t.lockRef.current))},[]),p=K.useCallback(function(h){l(h.type,GQ(h),h.target,s(h,t.lockRef.current))},[]);K.useEffect(function(){return Vh.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",A,Wh),document.addEventListener("touchmove",A,Wh),document.addEventListener("touchstart",u,Wh),function(){Vh=Vh.filter(function(h){return h!==i}),document.removeEventListener("wheel",A,Wh),document.removeEventListener("touchmove",A,Wh),document.removeEventListener("touchstart",u,Wh)}},[]);var m=t.removeScrollBar,g=t.inert;return K.createElement(K.Fragment,null,g?K.createElement(i,{styles:EZe(r)}):null,m?K.createElement(pZe,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function vZe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const IZe=eZe(oBe,kZe);var lS=K.forwardRef(function(t,e){return K.createElement(cS,Jl({},t,{ref:e,sideCar:IZe}))});lS.classNames=cS.classNames;var g$=["Enter"," "],QZe=["ArrowDown","PageUp","Home"],uBe=["ArrowUp","PageDown","End"],_Ze=[...QZe,...uBe],xZe={ltr:[...g$,"ArrowRight"],rtl:[...g$,"ArrowLeft"]},DZe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},av="Menu",[NB,SZe,NZe]=BK(av),[D0,dBe]=Cl(av,[NZe,g1,JEe]),uS=g1(),pBe=JEe(),[FZe,S0]=D0(av),[TZe,rv]=D0(av),mBe=t=>{const{__scopeMenu:e,open:n=!1,children:a,dir:r,onOpenChange:i,modal:o=!0}=t,s=uS(e),[A,l]=K.useState(null),u=K.useRef(!1),d=Io(i),p=sS(r);return K.useEffect(()=>{const m=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),be.jsx(mK,{...s,children:be.jsx(FZe,{scope:e,open:n,onOpenChange:d,content:A,onContentChange:l,children:be.jsx(TZe,{scope:e,onClose:K.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:a})})})};mBe.displayName=av;var RZe="MenuAnchor",IK=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t,r=uS(n);return be.jsx(gK,{...r,...a,ref:e})});IK.displayName=RZe;var QK="MenuPortal",[MZe,gBe]=D0(QK,{forceMount:void 0}),fBe=t=>{const{__scopeMenu:e,forceMount:n,children:a,container:r}=t,i=S0(QK,e);return be.jsx(MZe,{scope:e,forceMount:n,children:be.jsx(vs,{present:n||i.open,children:be.jsx(Xk,{asChild:!0,container:r,children:a})})})};fBe.displayName=QK;var Ec="MenuContent",[LZe,_K]=D0(Ec),hBe=K.forwardRef((t,e)=>{const n=gBe(Ec,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,i=S0(Ec,t.__scopeMenu),o=rv(Ec,t.__scopeMenu);return be.jsx(NB.Provider,{scope:t.__scopeMenu,children:be.jsx(vs,{present:a||i.open,children:be.jsx(NB.Slot,{scope:t.__scopeMenu,children:o.modal?be.jsx(OZe,{...r,ref:e}):be.jsx(GZe,{...r,ref:e})})})})}),OZe=K.forwardRef((t,e)=>{const n=S0(Ec,t.__scopeMenu),a=K.useRef(null),r=ca(e,a);return K.useEffect(()=>{const i=a.current;if(i)return vK(i)},[]),be.jsx(xK,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:on(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),GZe=K.forwardRef((t,e)=>{const n=S0(Ec,t.__scopeMenu);return be.jsx(xK,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),PZe=C2("MenuContent.ScrollLock"),xK=K.forwardRef((t,e)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:A,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...h}=t,b=S0(Ec,n),y=rv(Ec,n),w=uS(n),E=pBe(n),k=SZe(n),[v,_]=K.useState(null),I=K.useRef(null),x=ca(e,I,b.onContentChange),N=K.useRef(0),R=K.useRef(""),T=K.useRef(0),O=K.useRef(null),$=K.useRef("right"),F=K.useRef(0),L=g?lS:K.Fragment,M=g?{as:PZe,allowPinchZoom:!0}:void 0,P=q=>{const U=R.current+q,G=k().filter(ee=>!ee.disabled),H=document.activeElement,j=G.find(ee=>ee.ref.current===H)?.textValue,Z=G.map(ee=>ee.textValue),J=JZe(Z,U,j),ae=G.find(ee=>ee.textValue===J)?.ref.current;(function ee(pe){R.current=pe,window.clearTimeout(N.current),pe!==""&&(N.current=window.setTimeout(()=>ee(""),1e3))})(U),ae&&setTimeout(()=>ae.focus())};K.useEffect(()=>()=>window.clearTimeout(N.current),[]),kK();const D=K.useCallback(q=>$.current===O.current?.side&&eWe(q,O.current?.area),[]);return be.jsx(LZe,{scope:n,searchRef:R,onItemEnter:K.useCallback(q=>{D(q)&&q.preventDefault()},[D]),onItemLeave:K.useCallback(q=>{D(q)||(I.current?.focus(),_(null))},[D]),onTriggerLeave:K.useCallback(q=>{D(q)&&q.preventDefault()},[D]),pointerGraceTimerRef:T,onPointerGraceIntentChange:K.useCallback(q=>{O.current=q},[]),children:be.jsx(L,{...M,children:be.jsx(AS,{asChild:!0,trapped:r,onMountAutoFocus:on(i,q=>{q.preventDefault(),I.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:be.jsx(Vk,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:be.jsx(PKe,{asChild:!0,...E,dir:y.dir,orientation:"vertical",loop:a,currentTabStopId:v,onCurrentTabStopIdChange:_,onEntryFocus:on(A,q=>{y.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:be.jsx(fK,{role:"menu","aria-orientation":"vertical","data-state":FBe(b.open),"data-radix-menu-content":"",dir:y.dir,...w,...h,ref:x,style:{outline:"none",...h.style},onKeyDown:on(h.onKeyDown,q=>{const G=q.target.closest("[data-radix-menu-content]")===q.currentTarget,H=q.ctrlKey||q.altKey||q.metaKey,j=q.key.length===1;G&&(q.key==="Tab"&&q.preventDefault(),!H&&j&&P(q.key));const Z=I.current;if(q.target!==Z||!_Ze.includes(q.key))return;q.preventDefault();const ae=k().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);uBe.includes(q.key)&&ae.reverse(),WZe(ae)}),onBlur:on(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(N.current),R.current="")}),onPointerMove:on(t.onPointerMove,FB(q=>{const U=q.target,G=F.current!==q.clientX;if(q.currentTarget.contains(U)&&G){const H=q.clientX>F.current?"right":"left";$.current=H,F.current=q.clientX}}))})})})})})})});hBe.displayName=Ec;var qZe="MenuGroup",DK=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return be.jsx(zn.div,{role:"group",...a,ref:e})});DK.displayName=qZe;var UZe="MenuLabel",bBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return be.jsx(zn.div,{...a,ref:e})});bBe.displayName=UZe;var AD="MenuItem",aie="menu.itemSelect",dS=K.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:a,...r}=t,i=K.useRef(null),o=rv(AD,t.__scopeMenu),s=_K(AD,t.__scopeMenu),A=ca(e,i),l=K.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(aie,{bubbles:!0,cancelable:!0});d.addEventListener(aie,m=>a?.(m),{once:!0}),Lwe(d,p),p.defaultPrevented?l.current=!1:o.onClose()}};return be.jsx(yBe,{...r,ref:A,disabled:n,onClick:on(t.onClick,u),onPointerDown:d=>{t.onPointerDown?.(d),l.current=!0},onPointerUp:on(t.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:on(t.onKeyDown,d=>{const p=s.searchRef.current!=="";n||p&&d.key===" "||g$.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});dS.displayName=AD;var yBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...i}=t,o=_K(AD,n),s=pBe(n),A=K.useRef(null),l=ca(e,A),[u,d]=K.useState(!1),[p,m]=K.useState("");return K.useEffect(()=>{const g=A.current;g&&m((g.textContent??"").trim())},[i.children]),be.jsx(NB.ItemSlot,{scope:n,disabled:a,textValue:r??p,children:be.jsx(qKe,{asChild:!0,...s,focusable:!a,children:be.jsx(zn.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...i,ref:l,onPointerMove:on(t.onPointerMove,FB(g=>{a?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:on(t.onPointerLeave,FB(g=>o.onItemLeave(g))),onFocus:on(t.onFocus,()=>d(!0)),onBlur:on(t.onBlur,()=>d(!1))})})})}),$Ze="MenuCheckboxItem",CBe=K.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:a,...r}=t;return be.jsx(vBe,{scope:t.__scopeMenu,checked:n,children:be.jsx(dS,{role:"menuitemcheckbox","aria-checked":cD(n)?"mixed":n,...r,ref:e,"data-state":NK(n),onSelect:on(r.onSelect,()=>a?.(cD(n)?!0:!n),{checkForDefaultPrevented:!1})})})});CBe.displayName=$Ze;var wBe="MenuRadioGroup",[jZe,HZe]=D0(wBe,{value:void 0,onValueChange:()=>{}}),EBe=K.forwardRef((t,e)=>{const{value:n,onValueChange:a,...r}=t,i=Io(a);return be.jsx(jZe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:be.jsx(DK,{...r,ref:e})})});EBe.displayName=wBe;var BBe="MenuRadioItem",kBe=K.forwardRef((t,e)=>{const{value:n,...a}=t,r=HZe(BBe,t.__scopeMenu),i=n===r.value;return be.jsx(vBe,{scope:t.__scopeMenu,checked:i,children:be.jsx(dS,{role:"menuitemradio","aria-checked":i,...a,ref:e,"data-state":NK(i),onSelect:on(a.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});kBe.displayName=BBe;var SK="MenuItemIndicator",[vBe,zZe]=D0(SK,{checked:!1}),IBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:a,...r}=t,i=zZe(SK,n);return be.jsx(vs,{present:a||cD(i.checked)||i.checked===!0,children:be.jsx(zn.span,{...r,ref:e,"data-state":NK(i.checked)})})});IBe.displayName=SK;var YZe="MenuSeparator",QBe=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t;return be.jsx(zn.div,{role:"separator","aria-orientation":"horizontal",...a,ref:e})});QBe.displayName=YZe;var KZe="MenuArrow",_Be=K.forwardRef((t,e)=>{const{__scopeMenu:n,...a}=t,r=uS(n);return be.jsx(hK,{...r,...a,ref:e})});_Be.displayName=KZe;var ZZe="MenuSub",[u5n,xBe]=D0(ZZe),Lw="MenuSubTrigger",DBe=K.forwardRef((t,e)=>{const n=S0(Lw,t.__scopeMenu),a=rv(Lw,t.__scopeMenu),r=xBe(Lw,t.__scopeMenu),i=_K(Lw,t.__scopeMenu),o=K.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:A}=i,l={__scopeMenu:t.__scopeMenu},u=K.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return K.useEffect(()=>u,[u]),K.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),A(null)}},[s,A]),be.jsx(IK,{asChild:!0,...l,children:be.jsx(yBe,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":FBe(n.open),...t,ref:fu(e,r.onTriggerChange),onClick:d=>{t.onClick?.(d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:on(t.onPointerMove,FB(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:on(t.onPointerLeave,FB(d=>{u();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,g=m==="right",h=g?-5:5,b=p[g?"left":"right"],y=p[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:b,y:p.top},{x:y,y:p.top},{x:y,y:p.bottom},{x:b,y:p.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:on(t.onKeyDown,d=>{const p=i.searchRef.current!=="";t.disabled||p&&d.key===" "||xZe[a.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});DBe.displayName=Lw;var SBe="MenuSubContent",NBe=K.forwardRef((t,e)=>{const n=gBe(Ec,t.__scopeMenu),{forceMount:a=n.forceMount,...r}=t,i=S0(Ec,t.__scopeMenu),o=rv(Ec,t.__scopeMenu),s=xBe(SBe,t.__scopeMenu),A=K.useRef(null),l=ca(e,A);return be.jsx(NB.Provider,{scope:t.__scopeMenu,children:be.jsx(vs,{present:a||i.open,children:be.jsx(NB.Slot,{scope:t.__scopeMenu,children:be.jsx(xK,{id:s.contentId,"aria-labelledby":s.triggerId,...r,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{o.isUsingKeyboardRef.current&&A.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:on(t.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:on(t.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:on(t.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),p=DZe[o.dir].includes(u.key);d&&p&&(i.onOpenChange(!1),s.trigger?.focus(),u.preventDefault())})})})})})});NBe.displayName=SBe;function FBe(t){return t?"open":"closed"}function cD(t){return t==="indeterminate"}function NK(t){return cD(t)?"indeterminate":t?"checked":"unchecked"}function WZe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function VZe(t,e){return t.map((n,a)=>t[(e+a)%t.length])}function JZe(t,e,n){const r=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=VZe(t,Math.max(i,0));r.length===1&&(o=o.filter(l=>l!==n));const A=o.find(l=>l.toLowerCase().startsWith(r.toLowerCase()));return A!==n?A:void 0}function XZe(t,e){const{x:n,y:a}=t;let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const s=e[i],A=e[o],l=s.x,u=s.y,d=A.x,p=A.y;u>a!=p>a&&n<(d-l)*(a-u)/(p-u)+l&&(r=!r)}return r}function eWe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return XZe(n,e)}function FB(t){return e=>e.pointerType==="mouse"?t(e):void 0}var tWe=mBe,nWe=IK,aWe=fBe,rWe=hBe,iWe=DK,oWe=bBe,sWe=dS,AWe=CBe,cWe=EBe,lWe=kBe,uWe=IBe,dWe=QBe,pWe=_Be,mWe=DBe,gWe=NBe,pS="DropdownMenu",[fWe]=Cl(pS,[dBe]),Is=dBe(),[hWe,TBe]=fWe(pS),RBe=t=>{const{__scopeDropdownMenu:e,children:n,dir:a,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,A=Is(e),l=K.useRef(null),[u,d]=Dm({prop:r,defaultProp:i??!1,onChange:o,caller:pS});return be.jsx(hWe,{scope:e,triggerId:xo(),triggerRef:l,contentId:xo(),open:u,onOpenChange:d,onOpenToggle:K.useCallback(()=>d(p=>!p),[d]),modal:s,children:be.jsx(tWe,{...A,open:u,onOpenChange:d,dir:a,modal:s,children:n})})};RBe.displayName=pS;var MBe="DropdownMenuTrigger",LBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=t,i=TBe(MBe,n),o=Is(n);return be.jsx(nWe,{asChild:!0,...o,children:be.jsx(zn.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:fu(e,i.triggerRef),onPointerDown:on(t.onPointerDown,s=>{!a&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:on(t.onKeyDown,s=>{a||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});LBe.displayName=MBe;var bWe="DropdownMenuPortal",OBe=t=>{const{__scopeDropdownMenu:e,...n}=t,a=Is(e);return be.jsx(aWe,{...a,...n})};OBe.displayName=bWe;var GBe="DropdownMenuContent",PBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=TBe(GBe,n),i=Is(n),o=K.useRef(!1);return be.jsx(rWe,{id:r.contentId,"aria-labelledby":r.triggerId,...i,...a,ref:e,onCloseAutoFocus:on(t.onCloseAutoFocus,s=>{o.current||r.triggerRef.current?.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:on(t.onInteractOutside,s=>{const A=s.detail.originalEvent,l=A.button===0&&A.ctrlKey===!0,u=A.button===2||l;(!r.modal||u)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});PBe.displayName=GBe;var yWe="DropdownMenuGroup",CWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(iWe,{...r,...a,ref:e})});CWe.displayName=yWe;var wWe="DropdownMenuLabel",qBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(oWe,{...r,...a,ref:e})});qBe.displayName=wWe;var EWe="DropdownMenuItem",UBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(sWe,{...r,...a,ref:e})});UBe.displayName=EWe;var BWe="DropdownMenuCheckboxItem",kWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(AWe,{...r,...a,ref:e})});kWe.displayName=BWe;var vWe="DropdownMenuRadioGroup",$Be=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(cWe,{...r,...a,ref:e})});$Be.displayName=vWe;var IWe="DropdownMenuRadioItem",jBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(lWe,{...r,...a,ref:e})});jBe.displayName=IWe;var QWe="DropdownMenuItemIndicator",HBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(uWe,{...r,...a,ref:e})});HBe.displayName=QWe;var _We="DropdownMenuSeparator",zBe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(dWe,{...r,...a,ref:e})});zBe.displayName=_We;var xWe="DropdownMenuArrow",DWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(pWe,{...r,...a,ref:e})});DWe.displayName=xWe;var SWe="DropdownMenuSubTrigger",NWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(mWe,{...r,...a,ref:e})});NWe.displayName=SWe;var FWe="DropdownMenuSubContent",TWe=K.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...a}=t,r=Is(n);return be.jsx(gWe,{...r,...a,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});TWe.displayName=FWe;var d5n=RBe,p5n=LBe,m5n=OBe,g5n=PBe,f5n=qBe,h5n=UBe,b5n=$Be,y5n=jBe,C5n=HBe,w5n=zBe,RWe=Symbol.for("react.lazy"),lD=iK[" use ".trim().toString()];function MWe(t){return typeof t=="object"&&t!==null&&"then"in t}function YBe(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===RWe&&"_payload"in t&&MWe(t._payload)}function KBe(t){const e=LWe(t),n=K.forwardRef((a,r)=>{let{children:i,...o}=a;YBe(i)&&typeof lD=="function"&&(i=lD(i._payload));const s=K.Children.toArray(i),A=s.find(GWe);if(A){const l=A.props.children,u=s.map(d=>d===A?K.Children.count(l)>1?K.Children.only(null):K.isValidElement(l)?l.props.children:null:d);return be.jsx(e,{...o,ref:r,children:K.isValidElement(l)?K.cloneElement(l,void 0,u):null})}return be.jsx(e,{...o,ref:r,children:i})});return n.displayName=`${t}.Slot`,n}var E5n=KBe("Slot");function LWe(t){const e=K.forwardRef((n,a)=>{let{children:r,...i}=n;if(YBe(r)&&typeof lD=="function"&&(r=lD(r._payload)),K.isValidElement(r)){const o=qWe(r),s=PWe(i,r.props);return r.type!==K.Fragment&&(s.ref=a?fu(a,o):o),K.cloneElement(r,s)}return K.Children.count(r)>1?K.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var OWe=Symbol("radix.slottable");function GWe(t){return K.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OWe}function PWe(t,e){const n={...e};for(const a in e){const r=t[a],i=e[a];/^on[A-Z]/.test(a)?r&&i?n[a]=(...s)=>{const A=i(...s);return r(...s),A}:r&&(n[a]=r):a==="style"?n[a]={...r,...i}:a==="className"&&(n[a]=[r,i].filter(Boolean).join(" "))}return{...t,...n}}function qWe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const rie=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,iie=CEe,B5n=(t,e)=>n=>{var a;if(e?.variants==null)return iie(t,n?.class,n?.className);const{variants:r,defaultVariants:i}=e,o=Object.keys(r).map(l=>{const u=n?.[l],d=i?.[l];if(u===null)return null;const p=rie(u)||rie(d);return r[l][p]}),s=n&&Object.entries(n).reduce((l,u)=>{let[d,p]=u;return p===void 0||(l[d]=p),l},{}),A=e==null||(a=e.compoundVariants)===null||a===void 0?void 0:a.reduce((l,u)=>{let{class:d,className:p,...m}=u;return Object.entries(m).every(g=>{let[h,b]=g;return Array.isArray(b)?b.includes({...i,...s}[h]):{...i,...s}[h]===b})?[...l,d,p]:l},[]);return iie(t,o,A,n?.class,n?.className)};var mS="Collapsible",[UWe]=Cl(mS),[$We,FK]=UWe(mS),ZBe=K.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:a,defaultOpen:r,disabled:i,onOpenChange:o,...s}=t,[A,l]=Dm({prop:a,defaultProp:r??!1,onChange:o,caller:mS});return be.jsx($We,{scope:n,disabled:i,contentId:xo(),open:A,onOpenToggle:K.useCallback(()=>l(u=>!u),[l]),children:be.jsx(zn.div,{"data-state":RK(A),"data-disabled":i?"":void 0,...s,ref:e})})});ZBe.displayName=mS;var WBe="CollapsibleTrigger",jWe=K.forwardRef((t,e)=>{const{__scopeCollapsible:n,...a}=t,r=FK(WBe,n);return be.jsx(zn.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":RK(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...a,ref:e,onClick:on(t.onClick,r.onOpenToggle)})});jWe.displayName=WBe;var TK="CollapsibleContent",HWe=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=FK(TK,t.__scopeCollapsible);return be.jsx(vs,{present:n||r.open,children:({present:i})=>be.jsx(zWe,{...a,ref:e,present:i})})});HWe.displayName=TK;var zWe=K.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:a,children:r,...i}=t,o=FK(TK,n),[s,A]=K.useState(a),l=K.useRef(null),u=ca(e,l),d=K.useRef(0),p=d.current,m=K.useRef(0),g=m.current,h=o.open||s,b=K.useRef(h),y=K.useRef(void 0);return K.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),io(()=>{const w=l.current;if(w){y.current=y.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const E=w.getBoundingClientRect();d.current=E.height,m.current=E.width,b.current||(w.style.transitionDuration=y.current.transitionDuration,w.style.animationName=y.current.animationName),A(a)}},[o.open,a]),be.jsx(zn.div,{"data-state":RK(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!h,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:h&&r})});function RK(t){return t?"open":"closed"}var k5n=ZBe;const YWe={position:"absolute",top:0,bottom:0,textAlign:"center"},uD="diffs-container",KWe=/(?=^From [a-f0-9]+ .+$)/m,FT=/(?=^diff --git)/gm,oie=/(?=^---\s+\S)/gm,ZWe=/(?=^@@ )/gm,WWe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,f$=new RegExp("(?<=\\n)"),VWe=/^(---|\+\+\+)\s+([^\t\r\n]+)/,JWe=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,XWe=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,eVe=/^index (?:[0-9a-f]+)\.\.(?:[0-9a-f]+)(?: (\d+))?/,MK="header-metadata",Vs={dark:"pierre-dark",light:"pierre-light"},VBe="data-unsafe-css";function dD(t){return`annotation-${"side"in t?`${t.side}-`:""}${t.lineNumber}`}function tVe(t,e){return typeof window>"u"&&e!=null?be.jsxs(be.Fragment,{children:[be.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:e}}),t]}):be.jsx(be.Fragment,{children:t})}const Md=new Map,TT=new Map,h$=new Map,b$=new Set;function y$(t,e){t=Array.isArray(t)?t:[t];for(let n of t){let a;if(typeof n=="string"){if(a=Md.get(n),a==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else a=n,n=n.name,Md.has(n)||Md.set(n,a);b$.has(n)||(b$.add(n),e.loadThemeSync(a))}}const Kf=new Map,RT=new Map,C$=new Set;function sie(t,e){t=Array.isArray(t)?t:[t];for(const n of t){if(C$.has(n.name))continue;let a=Kf.get(n.name);a==null&&(a=n,Kf.set(n.name,a)),C$.add(a.name),e.loadLanguageSync(a.data)}}function JBe(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let hi=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function nVe(t){return LK(t)}function LK(t){return Array.isArray(t)?aVe(t):t instanceof RegExp?t:typeof t=="object"?rVe(t):t}function aVe(t){let e=[];for(let n=0,a=t.length;n<a;n++)e[n]=LK(t[n]);return e}function rVe(t){let e={};for(let n in t)e[n]=LK(t[n]);return e}function XBe(t,...e){return e.forEach(n=>{for(let a in n)t[a]=n[a]}),t}function eke(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?eke(t.substring(0,t.length-1)):t.substr(~e+1)}var MT=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,PQ=class{static hasCaptures(t){return t===null?!1:(MT.lastIndex=0,MT.test(t))}static replaceCaptures(t,e,n){return t.replace(MT,(a,r,i,o)=>{let s=n[parseInt(r||i,10)];if(s){let A=e.substring(s.start,s.end);for(;A[0]===".";)A=A.substring(1);switch(o){case"downcase":return A.toLowerCase();case"upcase":return A.toUpperCase();default:return A}}else return a})}};function tke(t,e){return t<e?-1:t>e?1:0}function nke(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,a=e.length;if(n===a){for(let r=0;r<n;r++){let i=tke(t[r],e[r]);if(i!==0)return i}return 0}return n-a}function Aie(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function ake(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var rke=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},pD=class{constructor(e,n,a){this._colorMap=e,this._defaults=n,this._root=a}static createFromRawTheme(e,n){return this.createFromParsedTheme(sVe(e),n)}static createFromParsedTheme(e,n){return cVe(e,n)}_cachedMatchRoot=new rke(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const n=e.scopeName,r=this._cachedMatchRoot.get(n).find(i=>iVe(e.parent,i.parentScopes));return r?new ike(r.fontStyle,r.foreground,r.background):null}},LT=class _x{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const a of n)e=new _x(e,a);return e}static from(...e){let n=null;for(let a=0;a<e.length;a++)n=new _x(n,e[a]);return n}push(e){return new _x(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push(a.scopeName),a=a.parent;return a===e?n.reverse():void 0}};function iVe(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let a=e[n],r=!1;if(a===">"){if(n===e.length-1)return!1;a=e[++n],r=!0}for(;t&&!oVe(t.scopeName,a);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function oVe(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var ike=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function sVe(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],a=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let s;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),s=d.split(",")}else Array.isArray(o.scope)?s=o.scope:s=[""];let A=-1;if(typeof o.settings.fontStyle=="string"){A=0;let d=o.settings.fontStyle.split(" ");for(let p=0,m=d.length;p<m;p++)switch(d[p]){case"italic":A=A|1;break;case"bold":A=A|2;break;case"underline":A=A|4;break;case"strikethrough":A=A|8;break}}let l=null;typeof o.settings.foreground=="string"&&Aie(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&Aie(o.settings.background)&&(u=o.settings.background);for(let d=0,p=s.length;d<p;d++){let g=s[d].trim().split(" "),h=g[g.length-1],b=null;g.length>1&&(b=g.slice(0,g.length-1),b.reverse()),n[a++]=new AVe(h,b,r,A,l,u)}}return n}var AVe=class{constructor(t,e,n,a,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},jo=(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))(jo||{});function cVe(t,e){t.sort((A,l)=>{let u=tke(A.scope,l.scope);return u!==0||(u=nke(A.parentScopes,l.parentScopes),u!==0)?u:A.index-l.index});let n=0,a="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let A=t.shift();A.fontStyle!==-1&&(n=A.fontStyle),A.foreground!==null&&(a=A.foreground),A.background!==null&&(r=A.background)}let i=new lVe(e),o=new ike(n,i.getId(a),i.getId(r)),s=new dVe(new w$(0,null,-1,0,0),[]);for(let A=0,l=t.length;A<l;A++){let u=t[A];s.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new pD(i,o,s)}var lVe=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},uVe=Object.freeze([]),w$=class oke{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,a,r,i){this.scopeDepth=e,this.parentScopes=n||uVe,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new oke(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let a=0,r=e.length;a<r;a++)n[a]=e[a].clone();return n}acceptOverwrite(e,n,a,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},dVe=class E${constructor(e,n=[],a={}){this._mainRule=e,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let a=0,r=0;for(;e.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let a=e.indexOf("."),r,i;if(a===-1?(r=e,i=""):(r=e.substring(0,a),i=e.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(E$._cmpBySpecificity),n}insert(e,n,a,r,i,o){if(n===""){this._doInsertHere(e,a,r,i,o);return}let s=n.indexOf("."),A,l;s===-1?(A=n,l=""):(A=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(A)?u=this._children[A]:(u=new E$(this._mainRule.clone(),w$.cloneArr(this._rulesWithParentScopes)),this._children[A]=u),u.insert(e+1,l,a,r,i,o)}_doInsertHere(e,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(e,a,r,i);return}for(let o=0,s=this._rulesWithParentScopes.length;o<s;o++){let A=this._rulesWithParentScopes[o];if(nke(A.parentScopes,n)===0){A.acceptOverwrite(e,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new w$(e,n,a,r,i))}},B2=class nc{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=nc.getLanguageId(e),a=nc.getTokenType(e),r=nc.getFontStyle(e),i=nc.getForeground(e),o=nc.getBackground(e);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>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,a,r,i,o,s){let A=nc.getLanguageId(e),l=nc.getTokenType(e),u=nc.containsBalancedBrackets(e)?1:0,d=nc.getFontStyle(e),p=nc.getForeground(e),m=nc.getBackground(e);return n!==0&&(A=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(d=i),o!==0&&(p=o),s!==0&&(m=s),(A<<0|l<<8|u<<10|d<<11|p<<15|m<<24)>>>0}};function mD(t,e){const n=[],a=pVe(t);let r=a.next();for(;r!==null;){let A=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":A=1;break;case"L":A=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=o();if(n.push({matcher:l,priority:A}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const A=i();return l=>!!A&&!A(l)}if(r==="("){r=a.next();const A=s();return r===")"&&(r=a.next()),A}if(cie(r)){const A=[];do A.push(r),r=a.next();while(cie(r));return l=>e(A,l)}return null}function o(){const A=[];let l=i();for(;l;)A.push(l),l=i();return u=>A.every(d=>d(u))}function s(){const A=[];let l=o();for(;l&&(A.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=o()}return u=>A.some(d=>d(u))}}function cie(t){return!!t&&!!t.match(/[\w\.:]+/)}function pVe(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const a=n[0];return n=e.exec(t),a}}}function ske(t){typeof t.dispose=="function"&&t.dispose()}var TB=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},mVe=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},gVe=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))}},fVe=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new TB(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new gVe;for(const n of t)hVe(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof TB){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 hVe(t,e,n,a){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof TB?xx({baseGrammar:i,selfGrammar:r},a):B$(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const o=n.injections(t.scopeName);if(o)for(const s of o)a.add(new TB(s))}function B$(t,e,n){if(e.repository&&e.repository[t]){const a=e.repository[t];gD([a],e,n)}}function xx(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&gD(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&gD(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function gD(t,e,n){for(const a of t){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?XBe({},e.repository,a.repository):e.repository;Array.isArray(a.patterns)&&gD(a.patterns,{...e,repository:r},n);const i=a.include;if(!i)continue;const o=Ake(i);switch(o.kind){case 0:xx({...e,selfGrammar:e.baseGrammar},n);break;case 1:xx(e,n);break;case 2:B$(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const s=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(s){const A={baseGrammar:e.baseGrammar,selfGrammar:s,repository:r};o.kind===4?B$(o.ruleName,A,n):xx(A,n)}else o.kind===4?n.add(new mVe(o.scopeName,o.ruleName)):n.add(new TB(o.scopeName));break}}}var bVe=class{kind=0},yVe=class{kind=1},CVe=class{constructor(t){this.ruleName=t}kind=2},wVe=class{constructor(t){this.scopeName=t}kind=3},EVe=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Ake(t){if(t==="$base")return new bVe;if(t==="$self")return new yVe;const e=t.indexOf("#");if(e===-1)return new wVe(t);if(e===0)return new CVe(t.substring(1));{const n=t.substring(0,e),a=t.substring(e+1);return new EVe(n,a)}}var BVe=/\\(\d+)/,lie=/\\(\d+)/g,kVe=-1,cke=-2;var iv=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,n,a,r){this.$location=e,this.id=n,this._name=a||null,this._nameIsCapturing=PQ.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=PQ.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${eke(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,n){return!this._nameIsCapturing||this._name===null||e===null||n===null?this._name:PQ.replaceCaptures(this._name,e,n)}getContentName(e,n){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:PQ.replaceCaptures(this._contentName,e,n)}},vVe=class extends iv{retokenizeCapturedWithRuleId;constructor(t,e,n,a,r){super(t,e,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,a){throw new Error("Not supported!")}},IVe=class extends iv{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,null),this._match=new RB(a,this.id),this.captures=r,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,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new MB,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},uie=class extends iv{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.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,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new MB,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},k$=class extends iv{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r,i,o,s,A,l){super(t,e,n,a),this._begin=new RB(r,this.id),this.beginCaptures=i,this._end=new RB(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=A||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,a){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,a)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new MB;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}},fD=class extends iv{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,a,r,i,o,s,A){super(t,e,n,a),this._begin=new RB(r,this.id),this.beginCaptures=i,this.whileCaptures=s,this._while=new RB(o,cke),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=A.patterns,this.hasMissingPatterns=A.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,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new MB;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,a){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,a)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new MB,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},lke=class Go{static createCaptureRule(e,n,a,r,i){return e.registerRule(o=>new vVe(n,o,a,r,i))}static getCompiledRuleId(e,n,a){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new IVe(e.$vscodeTextmateLocation,e.id,e.name,e.match,Go._compileCaptures(e.captures,n,a));if(typeof e.begin>"u"){e.repository&&(a=XBe({},a,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new uie(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Go._compilePatterns(i,n,a))}return e.while?new fD(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Go._compileCaptures(e.beginCaptures||e.captures,n,a),e.while,Go._compileCaptures(e.whileCaptures||e.captures,n,a),Go._compilePatterns(e.patterns,n,a)):new k$(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Go._compileCaptures(e.beginCaptures||e.captures,n,a),e.end,Go._compileCaptures(e.endCaptures||e.captures,n,a),e.applyEndPatternLast,Go._compilePatterns(e.patterns,n,a))}),e.id}static _compileCaptures(e,n,a){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);s>i&&(i=s)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);let A=0;e[o].patterns&&(A=Go.getCompiledRuleId(e[o],n,a)),r[s]=Go.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,A)}}return r}static _compilePatterns(e,n,a){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const s=e[i];let A=-1;if(s.include){const l=Ake(s.include);switch(l.kind){case 0:case 1:A=Go.getCompiledRuleId(a[s.include],n,a);break;case 2:let u=a[l.ruleName];u&&(A=Go.getCompiledRuleId(u,n,a));break;case 3:case 4:const d=l.scopeName,p=l.kind===4?l.ruleName:null,m=n.getExternalGrammar(d,a);if(m)if(p){let g=m.repository[p];g&&(A=Go.getCompiledRuleId(g,n,m.repository))}else A=Go.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else A=Go.getCompiledRuleId(s,n,a);if(A!==-1){const l=n.getRule(A);let u=!1;if((l instanceof uie||l instanceof k$||l instanceof fD)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(A)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},RB=class uke{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const a=e.length;let r=0,i=[],o=!1;for(let s=0;s<a;s++)if(e.charAt(s)==="\\"&&s+1<a){const l=e.charAt(s+1);l==="z"?(i.push(e.substring(r,s)),i.push("$(?!\\n)(?<!\\n)"),r=s+2):(l==="A"||l==="G")&&(o=!0),s++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=BVe.test(this.source):this.hasBackReferences=!1}clone(){return new uke(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>e.substring(r.start,r.end));return lie.lastIndex=0,this.source.replace(lie,(r,i)=>ake(a[parseInt(i,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=[],a=[],r=[],i,o,s,A;for(i=0,o=this.source.length;i<o;i++)s=this.source.charAt(i),e[i]=s,n[i]=s,a[i]=s,r[i]=s,s==="\\"&&i+1<o&&(A=this.source.charAt(i+1),A==="A"?(e[i+1]="￿",n[i+1]="￿",a[i+1]="A",r[i+1]="A"):A==="G"?(e[i+1]="￿",n[i+1]="G",a[i+1]="￿",r[i+1]="G"):(e[i+1]=A,n[i+1]=A,a[i+1]=A,r[i+1]=A),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},MB=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new die(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 a=this._items.map(r=>r.resolveAnchors(e,n));return new die(t,a,this._items.map(r=>r.ruleId))}},die=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<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
59
+ `)}findNextMatchSync(t,e,n){const a=this.scanner.findNextMatchSync(t,e,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},OT=class{constructor(t,e){this.languageId=t,this.tokenType=e}},QVe=class v${_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new OT(e,8),this._embeddedLanguagesMatcher=new _Ve(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?v$._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new OT(0,0);_getBasicScopeAttributes=new rke(e=>{const n=this._scopeToLanguage(e),a=this._toStandardTokenType(e);return new OT(n,a)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(v$.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/},_Ve=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,a])=>ake(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])}},pie=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function dke(t,e,n,a,r,i,o,s){const A=e.content.length;let l=!1,u=-1;if(o){const m=xVe(t,e,n,a,r,i);r=m.stack,a=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new pie(r,!0);p()}return new pie(r,!1);function p(){const m=DVe(t,e,n,a,r,u);if(!m){i.produce(r,A),l=!0;return}const g=m.captureIndices,h=m.matchedRuleId,b=g&&g.length>0?g[0].end>a:!1;if(h===kVe){const y=r.getRule(t);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),Ow(t,e,n,r,i,y.endCaptures,g),i.produce(r,g[0].end);const w=r;if(r=r.parent,u=w.getAnchorPos(),!b&&w.getEnterPos()===a){r=w,i.produce(r,A),l=!0;return}}else{const y=t.getRule(h);i.produce(r,g[0].start);const w=r,E=y.getName(e.content,g),k=r.contentNameScopesList.pushAttributed(E,t);if(r=r.push(h,a,u,g[0].end===A,null,k,k),y instanceof k$){const v=y;Ow(t,e,n,r,i,v.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const _=v.getContentName(e.content,g),I=k.pushAttributed(_,t);if(r=r.withContentNameScopesList(I),v.endHasBackReferences&&(r=r.withEndRule(v.getEndWithResolvedBackReferences(e.content,g))),!b&&w.hasSameRuleAs(r)){r=r.pop(),i.produce(r,A),l=!0;return}}else if(y instanceof fD){const v=y;Ow(t,e,n,r,i,v.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const _=v.getContentName(e.content,g),I=k.pushAttributed(_,t);if(r=r.withContentNameScopesList(I),v.whileHasBackReferences&&(r=r.withEndRule(v.getWhileWithResolvedBackReferences(e.content,g))),!b&&w.hasSameRuleAs(r)){r=r.pop(),i.produce(r,A),l=!0;return}}else if(Ow(t,e,n,r,i,y.captures,g),i.produce(r,g[0].end),r=r.pop(),!b){r=r.safePop(),i.produce(r,A),l=!0;return}}g[0].end>a&&(a=g[0].end,n=!1)}}function xVe(t,e,n,a,r,i){let o=r.beginRuleCapturedEOL?0:-1;const s=[];for(let A=r;A;A=A.pop()){const l=A.getRule(t);l instanceof fD&&s.push({rule:l,stack:A})}for(let A=s.pop();A;A=s.pop()){const{ruleScanner:l,findOptions:u}=FVe(A.rule,t,A.stack.endRule,n,a===o),d=l.findNextMatchSync(e,a,u);if(d){if(d.ruleId!==cke){r=A.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(A.stack,d.captureIndices[0].start),Ow(t,e,n,A.stack,i,A.rule.whileCaptures,d.captureIndices),i.produce(A.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>a&&(a=d.captureIndices[0].end,n=!1))}else{r=A.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:o,isFirstLine:n}}function DVe(t,e,n,a,r,i){const o=SVe(t,e,n,a,r,i),s=t.getInjections();if(s.length===0)return o;const A=NVe(s,t,e,n,a,r,i);if(!A)return o;if(!o)return A;const l=o.captureIndices[0].start,u=A.captureIndices[0].start;return u<l||A.priorityMatch&&u===l?A:o}function SVe(t,e,n,a,r,i){const o=r.getRule(t),{ruleScanner:s,findOptions:A}=pke(o,t,r.endRule,n,a===i),l=s.findNextMatchSync(e,a,A);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function NVe(t,e,n,a,r,i,o){let s=Number.MAX_VALUE,A=null,l,u=0;const d=i.contentNameScopesList.getScopeNames();for(let p=0,m=t.length;p<m;p++){const g=t[p];if(!g.matcher(d))continue;const h=e.getRule(g.ruleId),{ruleScanner:b,findOptions:y}=pke(h,e,null,a,r===o),w=b.findNextMatchSync(n,r,y);if(!w)continue;const E=w.captureIndices[0].start;if(!(E>=s)&&(s=E,A=w.captureIndices,l=w.ruleId,u=g.priority,s===r))break}return A?{priorityMatch:u===-1,captureIndices:A,matchedRuleId:l}:null}function pke(t,e,n,a,r){return{ruleScanner:t.compileAG(e,n,a,r),findOptions:0}}function FVe(t,e,n,a,r){return{ruleScanner:t.compileWhileAG(e,n,a,r),findOptions:0}}function Ow(t,e,n,a,r,i,o){if(i.length===0)return;const s=e.content,A=Math.min(i.length,o.length),l=[],u=o[0].end;for(let d=0;d<A;d++){const p=i[d];if(p===null)continue;const m=o[d];if(m.length===0)continue;if(m.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=m.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,m.start):r.produce(a,m.start),p.retokenizeCapturedWithRuleId){const h=p.getName(s,o),b=a.contentNameScopesList.pushAttributed(h,t),y=p.getContentName(s,o),w=b.pushAttributed(y,t),E=a.push(p.retokenizeCapturedWithRuleId,m.start,-1,!1,null,b,w),k=t.createOnigString(s.substring(0,m.end));dke(t,k,n&&m.start===0,m.start,E,r,!1,0),ske(k);continue}const g=p.getName(s,o);if(g!==null){const b=(l.length>0?l[l.length-1].scopes:a.contentNameScopesList).pushAttributed(g,t);l.push(new TVe(b,m.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var TVe=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function RVe(t,e,n,a,r,i,o,s){return new LVe(t,e,n,a,r,i,o,s)}function mie(t,e,n,a,r){const i=mD(e,hD),o=lke.getCompiledRuleId(n,a,r.repository);for(const s of i)t.push({debugSelector:e,matcher:s.matcher,ruleId:o,grammar:r,priority:s.priority})}function hD(t,e){if(e.length<t.length)return!1;let n=0;return t.every(a=>{for(let r=n;r<e.length;r++)if(MVe(e[r],a))return n=r+1,!0;return!1})}function MVe(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var LVe=class{constructor(e,n,a,r,i,o,s,A){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=A,this._basicScopeAttributesProvider=new QVe(a,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=gie(n,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=mD(l,hD);for(const d of u)this._tokenTypeMatchers.push({matcher:d.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},n=[],a=this._rootScopeName,r=e.lookup(a);if(r){const i=r.injections;if(i)for(let s in i)mie(n,s,i[s],this,r);const o=this._grammarRepository.injections(a);o&&o.forEach(s=>{const A=this.getExternalGrammar(s);if(A){const l=A.injectionSelector;l&&mie(n,l,A,this,A)}})}return n.sort((i,o)=>i.priority-o.priority),n}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const n=++this._lastRuleId,a=e(n);return this._ruleId2desc[n]=a,a}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,n){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const a=this._grammarRepository.lookup(e);if(a)return this._includedGrammars[e]=gie(a,n&&n.$base),this._includedGrammars[e]}}tokenizeLine(e,n,a=0){const r=this._tokenize(e,n,!1,a);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,n,a=0){const r=this._tokenize(e,n,!0,a);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,n,a,r){this._rootId===-1&&(this._rootId=lke.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!n||n===I$.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),p=B2.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),m=this.getRule(this._rootId).getName(null,null);let g;m?g=YE.createRootAndLookUpScopeName(m,p,this):g=YE.createRoot("unknown",p),n=new I$(null,this._rootId,-1,-1,!1,null,g,g)}else i=!1,n.reset();e=e+`
60
+ `;const o=this.createOnigString(e),s=o.content.length,A=new GVe(a,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=dke(this,o,i,0,n,A,!0,r);return ske(o),{lineLength:s,lineTokens:A,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function gie(t,e){return t=nVe(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 YE=class Ll{constructor(e,n,a){this.parent=e,this.scopePath=n,this.tokenAttributes=a}static fromExtension(e,n){let a=e,r=e?.scopePath??null;for(const i of n)r=LT.push(r,i.scopeNames),a=new Ll(a,r,i.encodedTokenAttributes);return a}static createRoot(e,n){return new Ll(null,new LT(null,e),n)}static createRootAndLookUpScopeName(e,n,a){const r=a.getMetadataForScope(e),i=new LT(null,e),o=a.themeProvider.themeMatch(i),s=Ll.mergeAttributes(n,r,o);return new Ll(null,i,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Ll.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,a){let r=-1,i=0,o=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,o=a.backgroundId),B2.set(e,n.languageId,n.tokenType,null,r,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return Ll._pushAttributed(this,e,n);const a=e.split(/ /g);let r=this;for(const i of a)r=Ll._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,a){const r=a.getMetadataForScope(n),i=e.scopePath.push(n),o=a.themeProvider.themeMatch(i),s=Ll.mergeAttributes(e.tokenAttributes,r,o);return new Ll(e,i,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===e?n.reverse():void 0}},I$=class uf{constructor(e,n,a,r,i,o,s,A){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=s,this.contentNameScopesList=A,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new uf(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:uf._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?YE.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(){uf._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,a,r,i,o,s){return new uf(this,e,n,a,r,i,o,s)}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 uf(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 a=YE.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new uf(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,YE.fromExtension(a,n.contentNameScopesList))}},OVe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):mD(n,hD).map(a=>a.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>mD(n,hD).map(a=>a.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}},GVe=class{constructor(t,e,n,a){this.balancedBracketSelectors=a,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 a=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(i)&&(a=B2.set(a,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(a=B2.set(a,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),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 a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},PVe=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,a,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,RVe(t,i,e,n,a,r,this,this._onigLib))}return this._grammars.get(t)}},qVe=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new PVe(pD.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(pD.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,a){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(e,n,a){return this._loadGrammar(e,n,a.embeddedLanguages,a.tokenTypes,new OVe(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,a,r,i){const o=new fVe(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(s=>this._loadSingleGrammar(s.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,a,r,i)}_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 a=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(e,n=[],a=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,a,r)}_grammarForScopeName(e,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,a,r,i)}},Q$=I$.NULL;const mke=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ov{constructor(e,n,a){this.normal=n,this.property=e,a&&(this.space=a)}}ov.prototype.normal={};ov.prototype.property={};ov.prototype.space=void 0;function gke(t,e){const n={},a={};for(const r of t)Object.assign(n,r.property),Object.assign(a,r.normal);return new ov(n,a,e)}function LB(t){return t.toLowerCase()}let rA=class{constructor(e,n){this.attribute=n,this.property=e}};rA.prototype.attribute="";rA.prototype.booleanish=!1;rA.prototype.boolean=!1;rA.prototype.commaOrSpaceSeparated=!1;rA.prototype.commaSeparated=!1;rA.prototype.defined=!1;rA.prototype.mustUseProperty=!1;rA.prototype.number=!1;rA.prototype.overloadedBoolean=!1;rA.prototype.property="";rA.prototype.spaceSeparated=!1;rA.prototype.space=void 0;let UVe=0;const ea=N0(),di=N0(),_$=N0(),Ht=N0(),dr=N0(),Vb=N0(),CA=N0();function N0(){return 2**++UVe}const x$=Object.freeze(Object.defineProperty({__proto__:null,boolean:ea,booleanish:di,commaOrSpaceSeparated:CA,commaSeparated:Vb,number:Ht,overloadedBoolean:_$,spaceSeparated:dr},Symbol.toStringTag,{value:"Module"})),GT=Object.keys(x$);class OK extends rA{constructor(e,n,a,r){let i=-1;if(super(e,n),fie(this,"space",r),typeof a=="number")for(;++i<GT.length;){const o=GT[i];fie(this,GT[i],(a&x$[o])===x$[o])}}}OK.prototype.defined=!0;function fie(t,e,n){n&&(t[e]=n)}function b1(t){const e={},n={};for(const[a,r]of Object.entries(t.properties)){const i=new OK(a,t.transform(t.attributes||{},a),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),e[a]=i,n[LB(a)]=a,n[LB(i.attribute)]=a}return new ov(e,n,t.space)}const fke=b1({properties:{ariaActiveDescendant:null,ariaAtomic:di,ariaAutoComplete:null,ariaBusy:di,ariaChecked:di,ariaColCount:Ht,ariaColIndex:Ht,ariaColSpan:Ht,ariaControls:dr,ariaCurrent:null,ariaDescribedBy:dr,ariaDetails:null,ariaDisabled:di,ariaDropEffect:dr,ariaErrorMessage:null,ariaExpanded:di,ariaFlowTo:dr,ariaGrabbed:di,ariaHasPopup:null,ariaHidden:di,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dr,ariaLevel:Ht,ariaLive:null,ariaModal:di,ariaMultiLine:di,ariaMultiSelectable:di,ariaOrientation:null,ariaOwns:dr,ariaPlaceholder:null,ariaPosInSet:Ht,ariaPressed:di,ariaReadOnly:di,ariaRelevant:null,ariaRequired:di,ariaRoleDescription:dr,ariaRowCount:Ht,ariaRowIndex:Ht,ariaRowSpan:Ht,ariaSelected:di,ariaSetSize:Ht,ariaSort:null,ariaValueMax:Ht,ariaValueMin:Ht,ariaValueNow:Ht,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function hke(t,e){return e in t?t[e]:e}function bke(t,e){return hke(t,e.toLowerCase())}const $Ve=b1({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vb,acceptCharset:dr,accessKey:dr,action:null,allow:null,allowFullScreen:ea,allowPaymentRequest:ea,allowUserMedia:ea,alt:null,as:null,async:ea,autoCapitalize:null,autoComplete:dr,autoFocus:ea,autoPlay:ea,blocking:dr,capture:null,charSet:null,checked:ea,cite:null,className:dr,cols:Ht,colSpan:null,content:null,contentEditable:di,controls:ea,controlsList:dr,coords:Ht|Vb,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ea,defer:ea,dir:null,dirName:null,disabled:ea,download:_$,draggable:di,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ea,formTarget:null,headers:dr,height:Ht,hidden:_$,high:Ht,href:null,hrefLang:null,htmlFor:dr,httpEquiv:dr,id:null,imageSizes:null,imageSrcSet:null,inert:ea,inputMode:null,integrity:null,is:null,isMap:ea,itemId:null,itemProp:dr,itemRef:dr,itemScope:ea,itemType:dr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ea,low:Ht,manifest:null,max:null,maxLength:Ht,media:null,method:null,min:null,minLength:Ht,multiple:ea,muted:ea,name:null,nonce:null,noModule:ea,noValidate:ea,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ea,optimum:Ht,pattern:null,ping:dr,placeholder:null,playsInline:ea,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ea,referrerPolicy:null,rel:dr,required:ea,reversed:ea,rows:Ht,rowSpan:Ht,sandbox:dr,scope:null,scoped:ea,seamless:ea,selected:ea,shadowRootClonable:ea,shadowRootDelegatesFocus:ea,shadowRootMode:null,shape:null,size:Ht,sizes:null,slot:null,span:Ht,spellCheck:di,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ht,step:null,style:null,tabIndex:Ht,target:null,title:null,translate:null,type:null,typeMustMatch:ea,useMap:null,value:di,width:Ht,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dr,axis:null,background:null,bgColor:null,border:Ht,borderColor:null,bottomMargin:Ht,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ea,declare:ea,event:null,face:null,frame:null,frameBorder:null,hSpace:Ht,leftMargin:Ht,link:null,longDesc:null,lowSrc:null,marginHeight:Ht,marginWidth:Ht,noResize:ea,noHref:ea,noShade:ea,noWrap:ea,object:null,profile:null,prompt:null,rev:null,rightMargin:Ht,rules:null,scheme:null,scrolling:di,standby:null,summary:null,text:null,topMargin:Ht,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ht,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ea,disableRemotePlayback:ea,prefix:null,property:null,results:Ht,security:null,unselectable:null},space:"html",transform:bke}),jVe=b1({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:CA,accentHeight:Ht,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ht,amplitude:Ht,arabicForm:null,ascent:Ht,attributeName:null,attributeType:null,azimuth:Ht,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ht,by:null,calcMode:null,capHeight:Ht,className:dr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ht,diffuseConstant:Ht,direction:null,display:null,dur:null,divisor:Ht,dominantBaseline:null,download:ea,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ht,enableBackground:null,end:null,event:null,exponent:Ht,externalResourcesRequired:null,fill:null,fillOpacity:Ht,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Vb,g2:Vb,glyphName:Vb,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ht,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ht,horizOriginX:Ht,horizOriginY:Ht,id:null,ideographic:Ht,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ht,k:Ht,k1:Ht,k2:Ht,k3:Ht,k4:Ht,kernelMatrix:CA,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ht,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ht,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ht,overlineThickness:Ht,paintOrder:null,panose1:null,path:null,pathLength:Ht,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ht,pointsAtY:Ht,pointsAtZ:Ht,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:CA,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:CA,rev:CA,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:CA,requiredFeatures:CA,requiredFonts:CA,requiredFormats:CA,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ht,specularExponent:Ht,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ht,strikethroughThickness:Ht,string:null,stroke:null,strokeDashArray:CA,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ht,strokeOpacity:Ht,strokeWidth:null,style:null,surfaceScale:Ht,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:CA,tabIndex:Ht,tableValues:null,target:null,targetX:Ht,targetY:Ht,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:CA,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ht,underlineThickness:Ht,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ht,values:null,vAlphabetic:Ht,vMathematical:Ht,vectorEffect:null,vHanging:Ht,vIdeographic:Ht,version:null,vertAdvY:Ht,vertOriginX:Ht,vertOriginY:Ht,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ht,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hke}),yke=b1({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Cke=b1({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bke}),wke=b1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),HVe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zVe=/[A-Z]/g,hie=/-[a-z]/g,YVe=/^data[-\w.:]+$/i;function sv(t,e){const n=LB(e);let a=e,r=rA;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&YVe.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(hie,ZVe);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!hie.test(i)){let o=i.replace(zVe,KVe);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=OK}return new r(a,e)}function KVe(t){return"-"+t.toLowerCase()}function ZVe(t){return t.charAt(1).toUpperCase()}const y1=gke([fke,$Ve,yke,Cke,wke],"html"),vu=gke([fke,jVe,yke,Cke,wke],"svg"),bie={}.hasOwnProperty;function GK(t,e){const n=e||{};function a(r,...i){let o=a.invalid;const s=a.handlers;if(r&&bie.call(r,t)){const A=String(r[t]);o=bie.call(s,A)?s[A]:a.unknown}if(o)return o.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const WVe=/["&'<>`]/g,VVe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,JVe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,XVe=/[|\\{}()[\]^$+*?.]/g,yie=new WeakMap;function eJe(t,e){if(t=t.replace(e.subset?tJe(e.subset):WVe,a),e.subset||e.escapeOnly)return t;return t.replace(VVe,n).replace(JVe,a);function n(r,i,o){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function a(r,i,o){return e.format(r.charCodeAt(0),o.charCodeAt(i+1),e)}}function tJe(t){let e=yie.get(t);return e||(e=nJe(t),yie.set(t,e)),e}function nJe(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(XVe,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const aJe=/[\dA-Fa-f]/;function rJe(t,e,n){const a="&#x"+t.toString(16).toUpperCase();return n&&e&&!aJe.test(String.fromCharCode(e))?a:a+";"}const iJe=/\d/;function oJe(t,e,n){const a="&#"+String(t);return n&&e&&!iJe.test(String.fromCharCode(e))?a:a+";"}const sJe=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],PT={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},AJe=["cent","copy","divide","gt","lt","not","para","times"],Eke={}.hasOwnProperty,D$={};let qQ;for(qQ in PT)Eke.call(PT,qQ)&&(D$[PT[qQ]]=qQ);const cJe=/[^\dA-Za-z]/;function lJe(t,e,n,a){const r=String.fromCharCode(t);if(Eke.call(D$,r)){const i=D$[r],o="&"+i;return n&&sJe.includes(i)&&!AJe.includes(i)&&(!a||e&&e!==61&&cJe.test(String.fromCharCode(e)))?o:o+";"}return""}function uJe(t,e,n){let a=rJe(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=lJe(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=oJe(t,e,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function Jb(t,e){return eJe(t,Object.assign({format:uJe},e))}const dJe=/^>|^->|<!--|-->|--!>|<!-$/g,pJe=[">"],mJe=["<",">"];function gJe(t,e,n,a){return a.settings.bogusComments?"<?"+Jb(t.value,Object.assign({},a.settings.characterReferences,{subset:pJe}))+">":"<!--"+t.value.replace(dJe,r)+"-->";function r(i){return Jb(i,Object.assign({},a.settings.characterReferences,{subset:mJe}))}}function fJe(t,e,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function bD(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(e);for(;r!==-1;)a++,r=n.indexOf(e,r+e.length);return a}function Cie(t){const e=[],n=String(t||"");let a=n.indexOf(","),r=0,i=!1;for(;!i;){a===-1&&(a=n.length,i=!0);const o=n.slice(r,a).trim();(o||!i)&&e.push(o),r=a+1,a=n.indexOf(",",r)}return e}function PK(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function wie(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function qK(t){return t.join(" ").trim()}const hJe=/[ \t\n\f\r]/g;function gS(t){return typeof t=="object"?t.type==="text"?Eie(t.value):!1:Eie(t)}function Eie(t){return t.replace(hJe,"")===""}const Ui=kke(1),Bke=kke(-1),bJe=[];function kke(t){return e;function e(n,a,r){const i=n?n.children:bJe;let o=(a||0)+t,s=i[o];if(!r)for(;s&&gS(s);)o+=t,s=i[o];return s}}const yJe={}.hasOwnProperty;function vke(t){return e;function e(n,a,r){return yJe.call(t,n.tagName)&&t[n.tagName](n,a,r)}}const UK=vke({body:wJe,caption:qT,colgroup:qT,dd:vJe,dt:kJe,head:qT,html:CJe,li:BJe,optgroup:IJe,option:QJe,p:EJe,rp:Bie,rt:Bie,tbody:xJe,td:kie,tfoot:DJe,th:kie,thead:_Je,tr:SJe});function qT(t,e,n){const a=Ui(n,e,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&gS(a.value.charAt(0)))}function CJe(t,e,n){const a=Ui(n,e);return!a||a.type!=="comment"}function wJe(t,e,n){const a=Ui(n,e);return!a||a.type!=="comment"}function EJe(t,e,n){const a=Ui(n,e);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.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 BJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&a.tagName==="li"}function kJe(t,e,n){const a=Ui(n,e);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function vJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Bie(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function IJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&a.tagName==="optgroup"}function QJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function _Je(t,e,n){const a=Ui(n,e);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function xJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function DJe(t,e,n){return!Ui(n,e)}function SJe(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&a.tagName==="tr"}function kie(t,e,n){const a=Ui(n,e);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const NJe=vke({body:RJe,colgroup:MJe,head:TJe,html:FJe,tbody:LJe});function FJe(t){const e=Ui(t,-1);return!e||e.type!=="comment"}function TJe(t){const e=new Set;for(const a of t.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(e.has(a.tagName))return!1;e.add(a.tagName)}const n=t.children[0];return!n||n.type==="element"}function RJe(t){const e=Ui(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&gS(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function MJe(t,e,n){const a=Bke(n,e),r=Ui(t,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&UK(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function LJe(t,e,n){const a=Bke(n,e),r=Ui(t,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&UK(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const UQ={name:[[`
61
61
  \f\r &/=>`.split(""),`
62
62
  \f\r "&'/=>\``.split("")],[`\0
63
63
  \f\r "&'/<=>`.split(""),`\0
@@ -65,10 +65,10 @@ Error generating stack: `+S.message+`
65
65
  \f\r &>`.split(""),`\0
66
66
  \f\r "&'<=>\``.split("")],[`\0
67
67
  \f\r "&'<=>\``.split(""),`\0
68
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function FJe(t,e,n,a){const r=a.schema,i=r.space==="svg"?!1:a.settings.omitOptionalTags;let o=r.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(t.tagName.toLowerCase());const s=[];let A;r.space==="html"&&t.tagName==="svg"&&(a.schema=vu);const l=TJe(a,t.properties),u=a.all(r.space==="html"&&t.tagName==="template"?t.content:t);return a.schema=r,u&&(o=!1),(l||!i||!QJe(t,e,n))&&(s.push("<",t.tagName,l?" "+l:""),o&&(r.space==="svg"||a.settings.closeSelfClosing)&&(A=l.charAt(l.length-1),(!a.settings.tightSelfClosing||A==="/"||A&&A!=='"'&&A!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(u),!o&&(!i||!GK(t,e,n))&&s.push("</"+t.tagName+">"),s.join("")}function TJe(t,e){const n=[];let a=-1,r;if(e){for(r in e)if(e[r]!==null&&e[r]!==void 0){const i=RJe(t,r,e[r]);i&&n.push(i)}}for(;++a<n.length;){const i=t.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&i!=='"'&&i!=="'"&&(n[a]+=" ")}return n.join("")}function RJe(t,e,n){const a=sv(t.schema,e),r=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let o=t.quote,s;if(a.overloadedBoolean&&(n===a.attribute||n==="")?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!="string"||n===a.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const A=Jb(a.attribute,Object.assign({},t.settings.characterReferences,{subset:UQ.name[r][i]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?LK:OK)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?A:(t.settings.preferUnquoted&&(s=Jb(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:UQ.unquoted[r][i]}))),s!==n&&(t.settings.quoteSmart&&bD(n,o)>bD(n,t.alternative)&&(o=t.alternative),s=o+Jb(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?UQ.single:UQ.double)[r][i],attribute:!0}))+o),A+(s&&"="+s))}const MJe=["<","&"];function kke(t,e,n,a){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Jb(t.value,Object.assign({},a.settings.characterReferences,{subset:MJe}))}function LJe(t,e,n,a){return a.settings.allowDangerousHtml?t.value:kke(t,e,n,a)}function OJe(t,e,n,a){return a.all(t)}const GJe=MK("type",{invalid:PJe,unknown:qJe,handlers:{comment:lJe,doctype:uJe,element:FJe,raw:LJe,root:OJe,text:kke}});function PJe(t){throw new Error("Expected node, not `"+t+"`")}function qJe(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const UJe={},$Je={},jJe=[];function KE(t,e){const n=e||UJe,a=n.quote||'"',r=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:HJe,all:zJe,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||dke,characterReferences:n.characterReferences||$Je,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?vu:y1,quote:a,alternative:r}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function HJe(t,e,n){return GJe(t,e,n,this)}function zJe(t){const e=[],n=t&&t.children||jJe;let a=-1;for(;++a<n.length;)e[a]=this.one(n[a],a,t);return e.join("")}function yD(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},a=typeof t=="string"?t:t.name;for(const[r,i]of Object.entries(e?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===a&&Object.assign(n,i);return n}function wm(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function YJe(t){return Array.isArray(t)?t:[t]}async function vke(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function PK(t){return!t||["plaintext","txt","text","plain"].includes(t)}function Ike(t){return t==="ansi"||PK(t)}function qK(t){return t==="none"}function Qke(t){return qK(t)}function _ke(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 a of n)a&&!t.properties.class.includes(a)&&t.properties.class.push(a);return t}function gS(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let a=0;const r=[];for(let i=0;i<n.length;i+=2){const o=e?n[i]+(n[i+1]||""):n[i];r.push([o,a]),a+=n[i].length,a+=n[i+1]?.length||0}return r}function KJe(t){const e=gS(t,!0).map(([r])=>r);function n(r){if(r===t.length)return{line:e.length-1,character:e[e.length-1].length};let i=r,o=0;for(const s of e){if(i<s.length)break;i-=s.length,o++}return{line:o,character:i}}function a(r,i){let o=0;for(let s=0;s<r;s++)o+=e[s].length;return o+=i,o}return{lines:e,indexToPos:n,posToIndex:a}}const UK="light-dark()",ZJe=["color","background-color"];function WJe(t,e){let n=0;const a=[];for(const r of e)r>n&&a.push({...t,content:t.content.slice(n,r),offset:t.offset+n}),n=r;return n<t.content.length&&a.push({...t,content:t.content.slice(n),offset:t.offset+n}),a}function VJe(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((a,r)=>a-r);return n.length?t.map(a=>a.flatMap(r=>{const i=n.filter(o=>r.offset<o&&o<r.offset+r.content.length).map(o=>o-r.offset).sort((o,s)=>o-s);return i.length?WJe(r,i):r})):t}function JJe(t,e,n,a,r="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},o=e.map(u=>CD(t.variants[u])),s=new Set(o.flatMap(u=>Object.keys(u))),A={},l=(u,d)=>{const p=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+e[u]+(d==="color"?"":p)};return o.forEach((u,d)=>{for(const p of s){const m=u[p]||"inherit";if(d===0&&a&&ZJe.includes(p))if(a===UK&&o.length>1){const g=e.findIndex(w=>w==="light"),h=e.findIndex(w=>w==="dark");if(g===-1||h===-1)throw new hi('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=o[g][p]||"inherit",y=o[h][p]||"inherit";A[p]=`light-dark(${b}, ${y})`,r==="css-vars"&&(A[l(d,p)]=m)}else A[p]=m;else r==="css-vars"&&(A[l(d,p)]=m)}}),i.htmlStyle=A,i}function CD(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&jo.Italic&&(e["font-style"]="italic"),t.fontStyle&jo.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&jo.Underline&&n.push("underline"),t.fontStyle&jo.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function S$(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const xke=new WeakMap;function fS(t,e){xke.set(t,e)}function OB(t){return xke.get(t)}class C1{_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 C1(Object.fromEntries(YJe(n).map(a=>[a,Q$])),e)}constructor(...e){if(e.length===2){const[n,a]=e;this.lang=a,this._stacks=n}else{const[n,a,r]=e;this.lang=a,this._stacks={[r]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return XJe(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function XJe(t){const e=[],n=new Set;function a(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&e.push(i),r.parent&&a(r.parent)}return a(t),e}function eXe(t,e){if(!(t instanceof C1))throw new hi("Invalid grammar state");return t.getInternalStack(e)}function tXe(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let a=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new hi(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...r.indexToPos(o),offset:o}}else{const s=r.lines[o.line];if(s===void 0)throw new hi(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);let A=o.character;if(A<0&&(A=s.length+A),A<0||A>s.length)throw new hi(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${s.length}`);return{...o,character:A,offset:r.posToIndex(o.line,A)}}};const r=KJe(n.source),i=(n.options.decorations||[]).map(o=>({...o,start:a(o.start),end:a(o.end)}));nXe(i),t.set(n.meta,{decorations:i,converter:r,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=e(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return VJe(n,r)},code(n){if(!this.options.decorations?.length)return;const a=e(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==a.converter.lines.length)throw new hi(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function i(u,d,p,m){const g=r[u];let h="",b=-1,y=-1;if(d===0&&(b=0),p===0&&(y=0),p===Number.POSITIVE_INFINITY&&(y=g.children.length),b===-1||y===-1)for(let E=0;E<g.children.length;E++)h+=Dke(g.children[E]),b===-1&&h.length===d&&(b=E+1),y===-1&&h.length===p&&(y=E+1);if(b===-1)throw new hi(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(y===-1)throw new hi(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const w=g.children.slice(b,y);if(!m.alwaysWrap&&w.length===g.children.length)s(g,m,"line");else if(!m.alwaysWrap&&w.length===1&&w[0].type==="element")s(w[0],m,"token");else{const E={type:"element",tagName:"span",properties:{},children:w};s(E,m,"wrapper"),g.children.splice(b,w.length,E)}}function o(u,d){r[u]=s(r[u],d,"line")}function s(u,d,p){const m=d.properties||{},g=d.transform||(h=>h);return u.tagName=d.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},d.properties?.class&&_ke(u,d.properties.class),u=g(u,p)||u,u}const A=[],l=a.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(const u of l){const{start:d,end:p}=u;if(d.line===p.line)i(d.line,d.character,p.character,u);else if(d.line<p.line){i(d.line,d.character,Number.POSITIVE_INFINITY,u);for(let m=d.line+1;m<p.line;m++)A.unshift(()=>o(m,u));i(p.line,0,p.character,u)}}A.forEach(u=>u())}}}function nXe(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new hi(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let a=e+1;a<t.length;a++){const r=t[a],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,o=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,s=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,A=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||o||s||A){if(i&&o||s&&A||s&&n.start.offset===n.end.offset||o&&r.start.offset===r.end.offset)continue;throw new hi(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function Dke(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(Dke).join(""):""}const aXe=[tXe()];function wD(t){const e=rXe(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...aXe]}function rXe(t){const e=[],n=[],a=[];for(const r of t)switch(r.enforce){case"pre":e.push(r);break;case"post":n.push(r);break;default:a.push(r)}return{pre:e,post:n,normal:a}}var If=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],UT={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function iXe(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const a=t.indexOf("m",n);if(a!==-1)return{sequence:t.substring(n+2,a).split(";"),startPosition:n,position:a+1}}return{position:t.length}}function vie(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(a=>Number.parseInt(a));return n.length!==3||n.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function oXe(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const a=Number.parseInt(n);if(!Number.isNaN(a))if(a===0)e.push({type:"resetAll"});else if(a<=9)UT[a]&&e.push({type:"setDecoration",value:UT[a]});else if(a<=29){const r=UT[a-20];r&&(e.push({type:"resetDecoration",value:r}),r==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)e.push({type:"setForegroundColor",value:{type:"named",name:If[a-30]}});else if(a===38){const r=vie(t);r&&e.push({type:"setForegroundColor",value:r})}else if(a===39)e.push({type:"resetForegroundColor"});else if(a<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:If[a-40]}});else if(a===48){const r=vie(t);r&&e.push({type:"setBackgroundColor",value:r})}else a===49?e.push({type:"resetBackgroundColor"}):a===53?e.push({type:"setDecoration",value:"overline"}):a===55?e.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?e.push({type:"setForegroundColor",value:{type:"named",name:If[a-90+8]}}):a>=100&&a<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:If[a-100+8]}})}return e}function sXe(){let t=null,e=null,n=new Set;return{parse(a){const r=[];let i=0;do{const o=iXe(a,i),s=o.sequence?a.substring(i,o.startPosition):a.substring(i);if(s.length>0&&r.push({value:s,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const A=oXe(o.sequence);for(const l of A)l.type==="resetAll"?(t=null,e=null,n.clear()):l.type==="resetForegroundColor"?t=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of A)l.type==="setForegroundColor"?t=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&n.add(l.value)}i=o.position}while(i<a.length);return r}}}var AXe={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function cXe(t=AXe){function e(s){return t[s]}function n(s){return`#${s.map(A=>Math.max(0,Math.min(A,255)).toString(16).padStart(2,"0")).join("")}`}let a;function r(){if(a)return a;a=[];for(let l=0;l<If.length;l++)a.push(e(If[l]));let s=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let d=0;d<6;d++)a.push(n([s[l],s[u],s[d]]));let A=8;for(let l=0;l<24;l++,A+=10)a.push(n([A,A,A]));return a}function i(s){return r()[s]}function o(s){switch(s.type){case"named":return e(s.name);case"rgb":return n(s.rgb);case"table":return i(s.index)}}return{value:o}}const lXe={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function uXe(t,e,n){const a=yD(t,n),r=gS(e),i=Object.fromEntries(If.map(A=>{const l=`terminal.ansi${A[0].toUpperCase()}${A.substring(1)}`,u=t.colors?.[l];return[A,u||lXe[A]]})),o=cXe(i),s=sXe();return r.map(A=>s.parse(A[0]).map(l=>{let u,d;l.decorations.has("reverse")?(u=l.background?o.value(l.background):t.bg,d=l.foreground?o.value(l.foreground):t.fg):(u=l.foreground?o.value(l.foreground):t.fg,d=l.background?o.value(l.background):void 0),u=wm(u,a),d=wm(d,a),l.decorations.has("dim")&&(u=dXe(u));let p=jo.None;return l.decorations.has("bold")&&(p|=jo.Bold),l.decorations.has("italic")&&(p|=jo.Italic),l.decorations.has("underline")&&(p|=jo.Underline),l.decorations.has("strikethrough")&&(p|=jo.Strikethrough),{content:l.value,offset:A[1],color:u,bgColor:d,fontStyle:p}}))}function dXe(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const a=e[1];if(a.length===8){const r=Math.round(Number.parseInt(a.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${a.slice(0,6)}${r}`}else{if(a.length===6)return`#${a}80`;if(a.length===4){const r=a[0],i=a[1],o=a[2],s=a[3],A=Math.round(Number.parseInt(`${s}${s}`,16)/2).toString(16).padStart(2,"0");return`#${r}${r}${i}${i}${o}${o}${A}`}else if(a.length===3){const r=a[0],i=a[1],o=a[2];return`#${r}${r}${i}${i}${o}${o}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function $K(t,e,n={}){const{theme:a=t.getLoadedThemes()[0]}=n,r=t.resolveLangAlias(n.lang||"text");if(PK(r)||qK(a))return gS(e).map(A=>[{content:A[0],offset:A[1]}]);const{theme:i,colorMap:o}=t.setTheme(a);if(r==="ansi")return uXe(i,e,n);const s=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new hi(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new hi(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return mXe(e,s,i,o,n)}function pXe(...t){if(t.length===2)return OB(t[1]);const[e,n,a={}]=t,{lang:r="text",theme:i=e.getLoadedThemes()[0]}=a;if(PK(r)||qK(i))throw new hi("Plain language does not have grammar state");if(r==="ansi")throw new hi("ANSI language does not have grammar state");const{theme:o,colorMap:s}=e.setTheme(i),A=e.getLanguage(r);return new C1(ED(n,A,o,s,a).stateStack,A.name,o.name)}function mXe(t,e,n,a,r){const i=ED(t,e,n,a,r),o=new C1(ED(t,e,n,a,r).stateStack,e.name,n.name);return fS(i.tokens,o),i.tokens}function ED(t,e,n,a,r){const i=yD(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=r,A=gS(t);let l=r.grammarState?eXe(r.grammarState,n.name)??Q$:r.grammarContextCode!=null?ED(r.grammarContextCode,e,n,a,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Q$,u=[];const d=[];for(let p=0,m=A.length;p<m;p++){const[g,h]=A[p];if(g===""){u=[],d.push([]);continue}if(o>0&&g.length>=o){u=[],d.push([{content:g,offset:h,color:"",fontStyle:0}]);continue}let b,y,w;r.includeExplanation&&(b=e.tokenizeLine(g,l,s),y=b.tokens,w=0);const E=e.tokenizeLine2(g,l,s),k=E.tokens.length/2;for(let v=0;v<k;v++){const _=E.tokens[2*v],I=v+1<k?E.tokens[2*v+2]:g.length;if(_===I)continue;const x=E.tokens[2*v+1],N=wm(a[B2.getForeground(x)],i),R=B2.getFontStyle(x),T={content:g.substring(_,I),offset:h+_,color:N,fontStyle:R};if(r.includeExplanation){const O=[];if(r.includeExplanation!=="scopeName")for(const F of n.settings){let L;switch(typeof F.scope){case"string":L=F.scope.split(/,/).map(M=>M.trim());break;case"object":L=F.scope;break;default:continue}O.push({settings:F,selectors:L.map(M=>M.split(/ /))})}T.explanation=[];let $=0;for(;_+$<I;){const F=y[w],L=g.substring(F.startIndex,F.endIndex);$+=L.length,T.explanation.push({content:L,scopes:r.includeExplanation==="scopeName"?gXe(F.scopes):fXe(O,F.scopes)}),w+=1}}u.push(T)}d.push(u),u=[],l=E.ruleStack}return{tokens:d,stateStack:l}}function gXe(t){return t.map(e=>({scopeName:e}))}function fXe(t,e){const n=[];for(let a=0,r=e.length;a<r;a++){const i=e[a];n[a]={scopeName:i,themeMatches:bXe(t,i,e.slice(0,a))}}return n}function Iie(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function hXe(t,e,n){if(!Iie(t[t.length-1],e))return!1;let a=t.length-2,r=n.length-1;for(;a>=0&&r>=0;)Iie(t[a],n[r])&&(a-=1),r-=1;return a===-1}function bXe(t,e,n){const a=[];for(const{selectors:r,settings:i}of t)for(const o of r)if(hXe(o,e,n)){a.push(i);break}return a}function Ske(t,e,n){const a=Object.entries(n.themes).filter(A=>A[1]).map(A=>({color:A[0],theme:A[1]})),r=a.map(A=>{const l=$K(t,e,{...n,theme:A.theme}),u=OB(l),d=typeof A.theme=="string"?A.theme:A.theme.name;return{tokens:l,state:u,theme:d}}),i=yXe(...r.map(A=>A.tokens)),o=i[0].map((A,l)=>A.map((u,d)=>{const p={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(p.explanation=u.explanation),i.forEach((m,g)=>{const{content:h,explanation:b,offset:y,...w}=m[l][d];p.variants[a[g].color]=w}),p})),s=r[0].state?new C1(Object.fromEntries(r.map(A=>[A.theme,A.state?.getInternalStack(A.theme)])),r[0].state.lang):void 0;return s&&fS(o,s),o}function yXe(...t){const e=t.map(()=>[]),n=t.length;for(let a=0;a<t[0].length;a++){const r=t.map(A=>A[a]),i=e.map(()=>[]);e.forEach((A,l)=>A.push(i[l]));const o=r.map(()=>0),s=r.map(A=>A[0]);for(;s.every(A=>A);){const A=Math.min(...s.map(l=>l.content.length));for(let l=0;l<n;l++){const u=s[l];u.content.length===A?(i[l].push(u),o[l]+=1,s[l]=r[l][o[l]]):(i[l].push({...u,content:u.content.slice(0,A)}),s[l]={...u,content:u.content.slice(A),offset:u.offset+A})}}}return e}function BD(t,e,n){let a,r,i,o,s,A;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=n,p=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,w)=>y.color===l?-1:w.color===l?1:0);if(p.length===0)throw new hi("`themes` option must not be empty");const m=Ske(t,e,n);if(A=OB(m),l&&UK!==l&&!p.find(y=>y.color===l))throw new hi(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=p.map(y=>t.getTheme(y.theme)),h=p.map(y=>y.color);i=m.map(y=>y.map(w=>JJe(w,h,u,l,d))),A&&fS(i,A);const b=p.map(y=>yD(y.theme,n));r=Qie(p,g,b,u,l,"fg",d),a=Qie(p,g,b,u,l,"bg",d),o=`shiki-themes ${g.map(y=>y.name).join(" ")}`,s=l?void 0:[r,a].join(";")}else if("theme"in n){const l=yD(n.theme,n);i=$K(t,e,n);const u=t.getTheme(n.theme);a=wm(u.bg,l),r=wm(u.fg,l),o=u.name,A=OB(i)}else throw new hi("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:a,themeName:o,rootStyle:s,grammarState:A}}function Qie(t,e,n,a,r,i,o){return t.map((s,A)=>{const l=wm(e[A][i],n[A])||"inherit",u=`${a+s.color}${i==="bg"?"-bg":""}:${l}`;if(A===0&&r){if(r===UK&&t.length>1){const d=t.findIndex(h=>h.color==="light"),p=t.findIndex(h=>h.color==="dark");if(d===-1||p===-1)throw new hi('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=wm(e[d][i],n[d])||"inherit",g=wm(e[p][i],n[p])||"inherit";return`light-dark(${m}, ${g});${u}`}return l}return o==="css-vars"?u:null}).filter(s=>!!s).join(";")}function kD(t,e,n,a={meta:{},options:n,codeToHast:(r,i)=>kD(t,r,i),codeToTokens:(r,i)=>BD(t,r,i)}){let r=e;for(const g of wD(n))r=g.preprocess?.call(a,r,n)||r;let{tokens:i,fg:o,bg:s,themeName:A,rootStyle:l,grammarState:u}=BD(t,r,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:p=!1}=n;d===!0?i=wXe(i):d==="never"&&(i=EXe(i)),p&&(i=BXe(i));const m={...a,get source(){return r}};for(const g of wD(n))i=g.tokens?.call(m,i)||i;return CXe(i,{...n,fg:o,bg:s,themeName:A,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},m,u)}function CXe(t,e,n,a=OB(t)){const r=wD(e),i=[],o={type:"root",children:[]},{structure:s="classic",tabindex:A="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),A!==!1&&A!=null&&(l.tabindex=A.toString());for(const[h,b]of Object.entries(e.meta||{}))h.startsWith("_")||(l[h]=b);let u={type:"element",tagName:"pre",properties:l,children:[]},d={type:"element",tagName:"code",properties:{},children:i};const p=[],m={...n,structure:s,addClassToHast:_ke,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 p}};if(t.forEach((h,b)=>{b&&(s==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):s==="classic"&&i.push({type:"text",value:`
69
- `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},w=0;for(const E of h){let k={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const v=S$(E.htmlStyle||CD(E));v&&(k.properties.style=v);for(const _ of r)k=_?.span?.call(m,k,b+1,w,y,E)||k;s==="inline"?o.children.push(k):s==="classic"&&y.children.push(k),w+=E.content.length}if(s==="classic"){for(const E of r)y=E?.line?.call(m,y,b+1)||y;p.push(y),i.push(y)}else s==="inline"&&p.push(y)}),s==="classic"){for(const h of r)d=h?.code?.call(m,d)||d;u.children.push(d);for(const h of r)u=h?.pre?.call(m,u)||u;o.children.push(u)}else if(s==="inline"){const h=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of o.children)E.type==="element"&&E.tagName==="br"?(h.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&b.children.push(E);h.push(b);let w={type:"element",tagName:"code",properties:{},children:h};for(const E of r)w=E?.code?.call(m,w)||w;o.children=[];for(let E=0;E<w.children.length;E++){E>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const k=w.children[E];k.type==="element"&&o.children.push(...k.children)}}let g=o;for(const h of r)g=h?.root?.call(m,g)||g;return a&&fS(g,a),g}function wXe(t){return t.map(e=>{const n=[];let a="",r;return e.forEach((i,o)=>{const A=!(i.fontStyle&&(i.fontStyle&jo.Underline||i.fontStyle&jo.Strikethrough));A&&i.content.match(/^\s+$/)&&e[o+1]?(r===void 0&&(r=i.offset),a+=i.content):a?(A?n.push({...i,offset:r,content:a+i.content}):n.push({content:a,offset:r},i),r=void 0,a=""):n.push(i)}),n})}function EXe(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const a=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return n;const[,r,i,o]=a;if(!r&&!o)return n;const s=[{...n,offset:n.offset+r.length,content:i}];return r&&s.unshift({content:r,offset:n.offset}),o&&s.push({content:o,offset:n.offset+r.length+i.length}),s}))}function BXe(t){return t.map(e=>{const n=[];for(const a of e){if(n.length===0){n.push({...a});continue}const r=n[n.length-1],i=S$(r.htmlStyle||CD(r)),o=S$(a.htmlStyle||CD(a)),s=r.fontStyle&&(r.fontStyle&jo.Underline||r.fontStyle&jo.Strikethrough),A=a.fontStyle&&(a.fontStyle&jo.Underline||a.fontStyle&jo.Strikethrough);!s&&!A&&i===o?r.content+=a.content:n.push({...a})}return n})}const kXe=KE;function vXe(t,e,n){const a={meta:{},options:n,codeToHast:(i,o)=>kD(t,i,o),codeToTokens:(i,o)=>BD(t,i,o)};let r=kXe(kD(t,e,n,a));for(const i of wD(n))r=i.postprocess?.call(a,r,n)||r;return r}const _ie={light:"#333333",dark:"#bbbbbb"},xie={light:"#fffffe",dark:"#1e1e1e"},Die="__shiki_resolved";function hS(t){if(t?.[Die])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:a}=e;if(!n||!a){const s=e.settings?e.settings.find(A=>!A.name&&!A.scope):void 0;s?.settings?.foreground&&(a=s.settings.foreground),s?.settings?.background&&(n=s.settings.background),!a&&e?.colors?.["editor.foreground"]&&(a=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),a||(a=e.type==="light"?_ie.light:_ie.dark),n||(n=e.type==="light"?xie.light:xie.dark),e.fg=a,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 r=0;const i=new Map;function o(s){if(i.has(s))return i.get(s);r+=1;const A=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${A}`]?o(s):(i.set(s,A),A)}e.settings=e.settings.map(s=>{const A=s.settings?.foreground&&!s.settings.foreground.startsWith("#"),l=s.settings?.background&&!s.settings.background.startsWith("#");if(!A&&!l)return s;const u={...s,settings:{...s.settings}};if(A){const d=o(s.settings.foreground);e.colorReplacements[d]=s.settings.foreground,u.settings.foreground=d}if(l){const d=o(s.settings.background);e.colorReplacements[d]=s.settings.background,u.settings.background=d}return u});for(const s of Object.keys(e.colors||{}))if((s==="editor.foreground"||s==="editor.background"||s.startsWith("terminal.ansi"))&&!e.colors[s]?.startsWith("#")){const A=o(e.colors[s]);e.colorReplacements[A]=e.colors[s],e.colors[s]=A}return Object.defineProperty(e,Die,{enumerable:!1,writable:!1,value:!0}),e}async function Nke(t){return Array.from(new Set((await Promise.all(t.filter(e=>!Ike(e)).map(async e=>await vke(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Fke(t){return(await Promise.all(t.map(async n=>Qke(n)?null:hS(await vke(n))))).filter(n=>!!n)}let IXe=3;function QXe(t,e=3){e>IXe||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let Nb=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Tke(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 Nb(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class _Xe extends MVe{constructor(e,n,a,r={}){super(e),this._resolver=e,this._themes=n,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),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=hS(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=pD.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=Tke(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const a={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,a);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),a=n.filter(([r,i])=>!i);if(a.length){const r=n.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(A=>a.map(([l])=>l).includes(A)):!1).filter(i=>!a.includes(i));throw new Nb(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}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 a of n)this._langGraph.set(a,this._langMap.get(a))}}class xXe{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:a=>e.createScanner(a),createOnigString:a=>e.createString(a)},n.forEach(a=>this.addLanguage(a))}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 a=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");a=[...a,...this._injections.get(i)||[]]}return a}}let VC=0;function DXe(t){VC+=1,t.warnings!==!1&&VC>=10&&VC%10===0&&console.warn(`[Shiki] ${VC} 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 Nb("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),a=(t.themes||[]).flat(1).map(hS),r=new xXe(t.engine,n),i=new _Xe(r,a,n,t.langAlias);let o;function s(E){return Tke(E,t.langAlias)}function A(E){y();const k=i.getGrammar(typeof E=="string"?E:E.name);if(!k)throw new Nb(`Language \`${E}\` not found, you may need to load it first`);return k}function l(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const k=i.getTheme(E);if(!k)throw new Nb(`Theme \`${E}\` not found, you may need to load it first`);return k}function u(E){y();const k=l(E);o!==E&&(i.setTheme(k),o=E);const v=i.getColorMap();return{theme:k,colorMap:v}}function d(){return y(),i.getLoadedThemes()}function p(){return y(),i.getLoadedLanguages()}function m(...E){y(),i.loadLanguages(E.flat(1))}async function g(...E){return m(await Nke(E))}function h(...E){y();for(const k of E.flat(1))i.loadTheme(k)}async function b(...E){return y(),h(await Fke(E))}function y(){if(e)throw new Nb("Shiki instance has been disposed")}function w(){e||(e=!0,i.dispose(),VC-=1)}return{setTheme:u,getTheme:l,getLanguage:A,getLoadedThemes:d,getLoadedLanguages:p,resolveLangAlias:s,loadLanguage:g,loadLanguageSync:m,loadTheme:b,loadThemeSync:h,dispose:w,[Symbol.dispose]:w}}async function SXe(t){t.engine||QXe("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,a]=await Promise.all([Fke(t.themes||[]),Nke(t.langs||[]),t.engine]);return DXe({...t,themes:e,langs:n,engine:a})}async function NXe(t){const e=await SXe(t);return{getLastGrammarState:(...n)=>pXe(e,...n),codeToTokensBase:(n,a)=>$K(e,n,a),codeToTokensWithThemes:(n,a)=>Ske(e,n,a),codeToTokens:(n,a)=>BD(e,n,a),codeToHast:(n,a)=>kD(e,n,a),codeToHtml:(n,a)=>vXe(e,n,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function FXe(t){const e=t.langs,n=t.themes,a=t.engine;async function r(i){function o(d){if(typeof d=="string"){if(d=i.langAlias?.[d]||d,Ike(d))return[];const p=e[d];if(!p)throw new hi(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return p}return d}function s(d){if(Qke(d))return"none";if(typeof d=="string"){const p=n[d];if(!p)throw new hi(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return p}return d}const A=(i.themes??[]).map(d=>s(d)),l=(i.langs??[]).map(d=>o(d)),u=await NXe({engine:i.engine??a(),...i,themes:A,langs:l});return{...u,loadLanguage(...d){return u.loadLanguage(...d.map(o))},loadTheme(...d){return u.loadTheme(...d.map(s))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return r}const Rke=[{id:"abap",name:"ABAP",import:(()=>_e(()=>Promise.resolve().then(()=>gDt),void 0))},{id:"actionscript-3",name:"ActionScript",import:(()=>_e(()=>Promise.resolve().then(()=>bDt),void 0))},{id:"ada",name:"Ada",import:(()=>_e(()=>Promise.resolve().then(()=>wDt),void 0))},{id:"angular-html",name:"Angular HTML",import:(()=>_e(()=>Promise.resolve().then(()=>FDt),void 0))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>_e(()=>Promise.resolve().then(()=>UDt),void 0))},{id:"apache",name:"Apache Conf",import:(()=>_e(()=>Promise.resolve().then(()=>HDt),void 0))},{id:"apex",name:"Apex",import:(()=>_e(()=>Promise.resolve().then(()=>KDt),void 0))},{id:"apl",name:"APL",import:(()=>_e(()=>Promise.resolve().then(()=>a3t),void 0))},{id:"applescript",name:"AppleScript",import:(()=>_e(()=>Promise.resolve().then(()=>o3t),void 0))},{id:"ara",name:"Ara",import:(()=>_e(()=>Promise.resolve().then(()=>c3t),void 0))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>_e(()=>Promise.resolve().then(()=>d3t),void 0))},{id:"asm",name:"Assembly",import:(()=>_e(()=>Promise.resolve().then(()=>g3t),void 0))},{id:"astro",name:"Astro",import:(()=>_e(()=>Promise.resolve().then(()=>k3t),void 0))},{id:"awk",name:"AWK",import:(()=>_e(()=>Promise.resolve().then(()=>Q3t),void 0))},{id:"ballerina",name:"Ballerina",import:(()=>_e(()=>Promise.resolve().then(()=>D3t),void 0))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>_e(()=>Promise.resolve().then(()=>F3t),void 0))},{id:"beancount",name:"Beancount",import:(()=>_e(()=>Promise.resolve().then(()=>M3t),void 0))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>_e(()=>Promise.resolve().then(()=>G3t),void 0))},{id:"bibtex",name:"BibTeX",import:(()=>_e(()=>Promise.resolve().then(()=>U3t),void 0))},{id:"bicep",name:"Bicep",import:(()=>_e(()=>Promise.resolve().then(()=>H3t),void 0))},{id:"blade",name:"Blade",import:(()=>_e(()=>Promise.resolve().then(()=>J3t),void 0))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>_e(()=>Promise.resolve().then(()=>a8t),void 0))},{id:"c",name:"C",import:(()=>_e(()=>Promise.resolve().then(()=>i8t),void 0))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>_e(()=>Promise.resolve().then(()=>A8t),void 0))},{id:"cairo",name:"Cairo",import:(()=>_e(()=>Promise.resolve().then(()=>p8t),void 0))},{id:"clarity",name:"Clarity",import:(()=>_e(()=>Promise.resolve().then(()=>f8t),void 0))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>_e(()=>Promise.resolve().then(()=>y8t),void 0))},{id:"cmake",name:"CMake",import:(()=>_e(()=>Promise.resolve().then(()=>w8t),void 0))},{id:"cobol",name:"COBOL",import:(()=>_e(()=>Promise.resolve().then(()=>k8t),void 0))},{id:"codeowners",name:"CODEOWNERS",import:(()=>_e(()=>Promise.resolve().then(()=>Q8t),void 0))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>_e(()=>Promise.resolve().then(()=>D8t),void 0))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>_e(()=>Promise.resolve().then(()=>F8t),void 0))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>_e(()=>Promise.resolve().then(()=>M8t),void 0))},{id:"coq",name:"Coq",import:(()=>_e(()=>Promise.resolve().then(()=>G8t),void 0))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>_e(()=>Promise.resolve().then(()=>Y8t),void 0))},{id:"crystal",name:"Crystal",import:(()=>_e(()=>Promise.resolve().then(()=>J8t),void 0))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>_e(()=>Promise.resolve().then(()=>eSt),void 0))},{id:"css",name:"CSS",import:(()=>_e(()=>Promise.resolve().then(()=>vDt),void 0))},{id:"csv",name:"CSV",import:(()=>_e(()=>Promise.resolve().then(()=>nSt),void 0))},{id:"cue",name:"CUE",import:(()=>_e(()=>Promise.resolve().then(()=>iSt),void 0))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>_e(()=>Promise.resolve().then(()=>ASt),void 0))},{id:"d",name:"D",import:(()=>_e(()=>Promise.resolve().then(()=>uSt),void 0))},{id:"dart",name:"Dart",import:(()=>_e(()=>Promise.resolve().then(()=>mSt),void 0))},{id:"dax",name:"DAX",import:(()=>_e(()=>Promise.resolve().then(()=>hSt),void 0))},{id:"desktop",name:"Desktop",import:(()=>_e(()=>Promise.resolve().then(()=>CSt),void 0))},{id:"diff",name:"Diff",import:(()=>_e(()=>Promise.resolve().then(()=>ESt),void 0))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>_e(()=>Promise.resolve().then(()=>vSt),void 0))},{id:"dotenv",name:"dotEnv",import:(()=>_e(()=>Promise.resolve().then(()=>_St),void 0))},{id:"dream-maker",name:"Dream Maker",import:(()=>_e(()=>Promise.resolve().then(()=>SSt),void 0))},{id:"edge",name:"Edge",import:(()=>_e(()=>Promise.resolve().then(()=>TSt),void 0))},{id:"elixir",name:"Elixir",import:(()=>_e(()=>Promise.resolve().then(()=>LSt),void 0))},{id:"elm",name:"Elm",import:(()=>_e(()=>Promise.resolve().then(()=>PSt),void 0))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>_e(()=>Promise.resolve().then(()=>$St),void 0))},{id:"erb",name:"ERB",import:(()=>_e(()=>Promise.resolve().then(()=>r6t),void 0))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>_e(()=>Promise.resolve().then(()=>c6t),void 0))},{id:"fennel",name:"Fennel",import:(()=>_e(()=>Promise.resolve().then(()=>d6t),void 0))},{id:"fish",name:"Fish",import:(()=>_e(()=>Promise.resolve().then(()=>g6t),void 0))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>_e(()=>Promise.resolve().then(()=>b6t),void 0))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>_e(()=>Promise.resolve().then(()=>B6t),void 0))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>_e(()=>Promise.resolve().then(()=>C6t),void 0))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>_e(()=>Promise.resolve().then(()=>I6t),void 0))},{id:"gdresource",name:"GDResource",import:(()=>_e(()=>Promise.resolve().then(()=>F6t),void 0))},{id:"gdscript",name:"GDScript",import:(()=>_e(()=>Promise.resolve().then(()=>D6t),void 0))},{id:"gdshader",name:"GDShader",import:(()=>_e(()=>Promise.resolve().then(()=>_6t),void 0))},{id:"genie",name:"Genie",import:(()=>_e(()=>Promise.resolve().then(()=>M6t),void 0))},{id:"gherkin",name:"Gherkin",import:(()=>_e(()=>Promise.resolve().then(()=>G6t),void 0))},{id:"git-commit",name:"Git Commit Message",import:(()=>_e(()=>Promise.resolve().then(()=>U6t),void 0))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>_e(()=>Promise.resolve().then(()=>H6t),void 0))},{id:"gleam",name:"Gleam",import:(()=>_e(()=>Promise.resolve().then(()=>K6t),void 0))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>_e(()=>Promise.resolve().then(()=>V6t),void 0))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>_e(()=>Promise.resolve().then(()=>e5t),void 0))},{id:"glsl",name:"GLSL",import:(()=>_e(()=>Promise.resolve().then(()=>$8t),void 0))},{id:"gnuplot",name:"Gnuplot",import:(()=>_e(()=>Promise.resolve().then(()=>a5t),void 0))},{id:"go",name:"Go",import:(()=>_e(()=>Promise.resolve().then(()=>i5t),void 0))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>_e(()=>Promise.resolve().then(()=>ZSt),void 0))},{id:"groovy",name:"Groovy",import:(()=>_e(()=>Promise.resolve().then(()=>A5t),void 0))},{id:"hack",name:"Hack",import:(()=>_e(()=>Promise.resolve().then(()=>u5t),void 0))},{id:"haml",name:"Ruby Haml",import:(()=>_e(()=>Promise.resolve().then(()=>HSt),void 0))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>_e(()=>Promise.resolve().then(()=>m5t),void 0))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>_e(()=>Promise.resolve().then(()=>h5t),void 0))},{id:"haxe",name:"Haxe",import:(()=>_e(()=>Promise.resolve().then(()=>y5t),void 0))},{id:"hcl",name:"HashiCorp HCL",import:(()=>_e(()=>Promise.resolve().then(()=>E5t),void 0))},{id:"hjson",name:"Hjson",import:(()=>_e(()=>Promise.resolve().then(()=>v5t),void 0))},{id:"hlsl",name:"HLSL",import:(()=>_e(()=>Promise.resolve().then(()=>Q5t),void 0))},{id:"html",name:"HTML",import:(()=>_e(()=>Promise.resolve().then(()=>QDt),void 0))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>_e(()=>Promise.resolve().then(()=>Y3t),void 0))},{id:"http",name:"HTTP",import:(()=>_e(()=>Promise.resolve().then(()=>D5t),void 0))},{id:"hurl",name:"Hurl",import:(()=>_e(()=>Promise.resolve().then(()=>F5t),void 0))},{id:"hxml",name:"HXML",import:(()=>_e(()=>Promise.resolve().then(()=>M5t),void 0))},{id:"hy",name:"Hy",import:(()=>_e(()=>Promise.resolve().then(()=>G5t),void 0))},{id:"imba",name:"Imba",import:(()=>_e(()=>Promise.resolve().then(()=>U5t),void 0))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>_e(()=>Promise.resolve().then(()=>H5t),void 0))},{id:"java",name:"Java",import:(()=>_e(()=>Promise.resolve().then(()=>WDt),void 0))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>_e(()=>Promise.resolve().then(()=>BDt),void 0))},{id:"jinja",name:"Jinja",import:(()=>_e(()=>Promise.resolve().then(()=>W5t),void 0))},{id:"jison",name:"Jison",import:(()=>_e(()=>Promise.resolve().then(()=>X5t),void 0))},{id:"json",name:"JSON",import:(()=>_e(()=>Promise.resolve().then(()=>e3t),void 0))},{id:"json5",name:"JSON5",import:(()=>_e(()=>Promise.resolve().then(()=>nNt),void 0))},{id:"jsonc",name:"JSON with Comments",import:(()=>_e(()=>Promise.resolve().then(()=>iNt),void 0))},{id:"jsonl",name:"JSON Lines",import:(()=>_e(()=>Promise.resolve().then(()=>ANt),void 0))},{id:"jsonnet",name:"Jsonnet",import:(()=>_e(()=>Promise.resolve().then(()=>uNt),void 0))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>_e(()=>Promise.resolve().then(()=>mNt),void 0))},{id:"jsx",name:"JSX",import:(()=>_e(()=>Promise.resolve().then(()=>YSt),void 0))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>_e(()=>Promise.resolve().then(()=>yNt),void 0))},{id:"kdl",name:"KDL",import:(()=>_e(()=>Promise.resolve().then(()=>ENt),void 0))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>_e(()=>Promise.resolve().then(()=>vNt),void 0))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>_e(()=>Promise.resolve().then(()=>_Nt),void 0))},{id:"latex",name:"LaTeX",import:(()=>_e(()=>Promise.resolve().then(()=>FNt),void 0))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>_e(()=>Promise.resolve().then(()=>MNt),void 0))},{id:"less",name:"Less",import:(()=>_e(()=>Promise.resolve().then(()=>ONt),void 0))},{id:"liquid",name:"Liquid",import:(()=>_e(()=>Promise.resolve().then(()=>qNt),void 0))},{id:"llvm",name:"LLVM IR",import:(()=>_e(()=>Promise.resolve().then(()=>jNt),void 0))},{id:"log",name:"Log file",import:(()=>_e(()=>Promise.resolve().then(()=>YNt),void 0))},{id:"logo",name:"Logo",import:(()=>_e(()=>Promise.resolve().then(()=>WNt),void 0))},{id:"lua",name:"Lua",import:(()=>_e(()=>Promise.resolve().then(()=>VSt),void 0))},{id:"luau",name:"Luau",import:(()=>_e(()=>Promise.resolve().then(()=>XNt),void 0))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>_e(()=>Promise.resolve().then(()=>nFt),void 0))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>_e(()=>Promise.resolve().then(()=>o6t),void 0))},{id:"marko",name:"Marko",import:(()=>_e(()=>Promise.resolve().then(()=>iFt),void 0))},{id:"matlab",name:"MATLAB",import:(()=>_e(()=>Promise.resolve().then(()=>AFt),void 0))},{id:"mdc",name:"MDC",import:(()=>_e(()=>Promise.resolve().then(()=>uFt),void 0))},{id:"mdx",name:"MDX",import:(()=>_e(()=>Promise.resolve().then(()=>mFt),void 0))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>_e(()=>Promise.resolve().then(()=>hFt),void 0))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>_e(()=>Promise.resolve().then(()=>CFt),void 0))},{id:"mojo",name:"Mojo",import:(()=>_e(()=>Promise.resolve().then(()=>BFt),void 0))},{id:"move",name:"Move",import:(()=>_e(()=>Promise.resolve().then(()=>IFt),void 0))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>_e(()=>Promise.resolve().then(()=>xFt),void 0))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>_e(()=>Promise.resolve().then(()=>NFt),void 0))},{id:"nginx",name:"Nginx",import:(()=>_e(()=>Promise.resolve().then(()=>RFt),void 0))},{id:"nim",name:"Nim",import:(()=>_e(()=>Promise.resolve().then(()=>OFt),void 0))},{id:"nix",name:"Nix",import:(()=>_e(()=>Promise.resolve().then(()=>$Ft),void 0))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>_e(()=>Promise.resolve().then(()=>zFt),void 0))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>_e(()=>Promise.resolve().then(()=>ZFt),void 0))},{id:"objective-cpp",name:"Objective-C++",import:(()=>_e(()=>Promise.resolve().then(()=>JFt),void 0))},{id:"ocaml",name:"OCaml",import:(()=>_e(()=>Promise.resolve().then(()=>tTt),void 0))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>_e(()=>Promise.resolve().then(()=>rTt),void 0))},{id:"pascal",name:"Pascal",import:(()=>_e(()=>Promise.resolve().then(()=>sTt),void 0))},{id:"perl",name:"Perl",import:(()=>_e(()=>Promise.resolve().then(()=>lTt),void 0))},{id:"php",name:"PHP",import:(()=>_e(()=>Promise.resolve().then(()=>dTt),void 0))},{id:"pkl",name:"Pkl",import:(()=>_e(()=>Promise.resolve().then(()=>gTt),void 0))},{id:"plsql",name:"PL/SQL",import:(()=>_e(()=>Promise.resolve().then(()=>bTt),void 0))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>_e(()=>Promise.resolve().then(()=>wTt),void 0))},{id:"polar",name:"Polar",import:(()=>_e(()=>Promise.resolve().then(()=>kTt),void 0))},{id:"postcss",name:"PostCSS",import:(()=>_e(()=>Promise.resolve().then(()=>y3t),void 0))},{id:"powerquery",name:"PowerQuery",import:(()=>_e(()=>Promise.resolve().then(()=>QTt),void 0))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>_e(()=>Promise.resolve().then(()=>DTt),void 0))},{id:"prisma",name:"Prisma",import:(()=>_e(()=>Promise.resolve().then(()=>FTt),void 0))},{id:"prolog",name:"Prolog",import:(()=>_e(()=>Promise.resolve().then(()=>MTt),void 0))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>_e(()=>Promise.resolve().then(()=>GTt),void 0))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>_e(()=>Promise.resolve().then(()=>UTt),void 0))},{id:"puppet",name:"Puppet",import:(()=>_e(()=>Promise.resolve().then(()=>HTt),void 0))},{id:"purescript",name:"PureScript",import:(()=>_e(()=>Promise.resolve().then(()=>KTt),void 0))},{id:"python",name:"Python",aliases:["py"],import:(()=>_e(()=>Promise.resolve().then(()=>l8t),void 0))},{id:"qml",name:"QML",import:(()=>_e(()=>Promise.resolve().then(()=>VTt),void 0))},{id:"qmldir",name:"QML Directory",import:(()=>_e(()=>Promise.resolve().then(()=>e9t),void 0))},{id:"qss",name:"Qt Style Sheets",import:(()=>_e(()=>Promise.resolve().then(()=>a9t),void 0))},{id:"r",name:"R",import:(()=>_e(()=>Promise.resolve().then(()=>fNt),void 0))},{id:"racket",name:"Racket",import:(()=>_e(()=>Promise.resolve().then(()=>o9t),void 0))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>_e(()=>Promise.resolve().then(()=>c9t),void 0))},{id:"razor",name:"ASP.NET Razor",import:(()=>_e(()=>Promise.resolve().then(()=>d9t),void 0))},{id:"reg",name:"Windows Registry Script",import:(()=>_e(()=>Promise.resolve().then(()=>g9t),void 0))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>_e(()=>Promise.resolve().then(()=>q8t),void 0))},{id:"rel",name:"Rel",import:(()=>_e(()=>Promise.resolve().then(()=>b9t),void 0))},{id:"riscv",name:"RISC-V",import:(()=>_e(()=>Promise.resolve().then(()=>w9t),void 0))},{id:"rosmsg",name:"ROS Interface",import:(()=>_e(()=>Promise.resolve().then(()=>k9t),void 0))},{id:"rst",name:"reStructuredText",import:(()=>_e(()=>Promise.resolve().then(()=>Q9t),void 0))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>_e(()=>Promise.resolve().then(()=>t6t),void 0))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>_e(()=>Promise.resolve().then(()=>D9t),void 0))},{id:"sas",name:"SAS",import:(()=>_e(()=>Promise.resolve().then(()=>F9t),void 0))},{id:"sass",name:"Sass",import:(()=>_e(()=>Promise.resolve().then(()=>M9t),void 0))},{id:"scala",name:"Scala",import:(()=>_e(()=>Promise.resolve().then(()=>G9t),void 0))},{id:"scheme",name:"Scheme",import:(()=>_e(()=>Promise.resolve().then(()=>U9t),void 0))},{id:"scss",name:"SCSS",import:(()=>_e(()=>Promise.resolve().then(()=>RDt),void 0))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>_e(()=>Promise.resolve().then(()=>e8t),void 0))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>_e(()=>Promise.resolve().then(()=>H9t),void 0))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>_e(()=>Promise.resolve().then(()=>Z8t),void 0))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>_e(()=>Promise.resolve().then(()=>K9t),void 0))},{id:"smalltalk",name:"Smalltalk",import:(()=>_e(()=>Promise.resolve().then(()=>V9t),void 0))},{id:"solidity",name:"Solidity",import:(()=>_e(()=>Promise.resolve().then(()=>eRt),void 0))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>_e(()=>Promise.resolve().then(()=>aRt),void 0))},{id:"sparql",name:"SPARQL",import:(()=>_e(()=>Promise.resolve().then(()=>ARt),void 0))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>_e(()=>Promise.resolve().then(()=>uRt),void 0))},{id:"sql",name:"SQL",import:(()=>_e(()=>Promise.resolve().then(()=>Z3t),void 0))},{id:"ssh-config",name:"SSH Config",import:(()=>_e(()=>Promise.resolve().then(()=>mRt),void 0))},{id:"stata",name:"Stata",import:(()=>_e(()=>Promise.resolve().then(()=>hRt),void 0))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>_e(()=>Promise.resolve().then(()=>yRt),void 0))},{id:"svelte",name:"Svelte",import:(()=>_e(()=>Promise.resolve().then(()=>ERt),void 0))},{id:"swift",name:"Swift",import:(()=>_e(()=>Promise.resolve().then(()=>vRt),void 0))},{id:"system-verilog",name:"SystemVerilog",import:(()=>_e(()=>Promise.resolve().then(()=>_Rt),void 0))},{id:"systemd",name:"Systemd Units",import:(()=>_e(()=>Promise.resolve().then(()=>SRt),void 0))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>_e(()=>Promise.resolve().then(()=>TRt),void 0))},{id:"tasl",name:"Tasl",import:(()=>_e(()=>Promise.resolve().then(()=>LRt),void 0))},{id:"tcl",name:"Tcl",import:(()=>_e(()=>Promise.resolve().then(()=>PRt),void 0))},{id:"templ",name:"Templ",import:(()=>_e(()=>Promise.resolve().then(()=>$Rt),void 0))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>_e(()=>Promise.resolve().then(()=>zRt),void 0))},{id:"tex",name:"TeX",import:(()=>_e(()=>Promise.resolve().then(()=>DNt),void 0))},{id:"toml",name:"TOML",import:(()=>_e(()=>Promise.resolve().then(()=>ZRt),void 0))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>_e(()=>Promise.resolve().then(()=>AMt),void 0))},{id:"tsv",name:"TSV",import:(()=>_e(()=>Promise.resolve().then(()=>uMt),void 0))},{id:"tsx",name:"TSX",import:(()=>_e(()=>Promise.resolve().then(()=>w3t),void 0))},{id:"turtle",name:"Turtle",import:(()=>_e(()=>Promise.resolve().then(()=>iRt),void 0))},{id:"twig",name:"Twig",import:(()=>_e(()=>Promise.resolve().then(()=>mMt),void 0))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>_e(()=>Promise.resolve().then(()=>h3t),void 0))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>_e(()=>Promise.resolve().then(()=>hMt),void 0))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>_e(()=>Promise.resolve().then(()=>CMt),void 0))},{id:"v",name:"V",import:(()=>_e(()=>Promise.resolve().then(()=>BMt),void 0))},{id:"vala",name:"Vala",import:(()=>_e(()=>Promise.resolve().then(()=>IMt),void 0))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>_e(()=>Promise.resolve().then(()=>xMt),void 0))},{id:"verilog",name:"Verilog",import:(()=>_e(()=>Promise.resolve().then(()=>NMt),void 0))},{id:"vhdl",name:"VHDL",import:(()=>_e(()=>Promise.resolve().then(()=>RMt),void 0))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>_e(()=>Promise.resolve().then(()=>OMt),void 0))},{id:"vue",name:"Vue",import:(()=>_e(()=>Promise.resolve().then(()=>KMt),void 0))},{id:"vue-html",name:"Vue HTML",import:(()=>_e(()=>Promise.resolve().then(()=>VMt),void 0))},{id:"vue-vine",name:"Vue Vine",import:(()=>_e(()=>Promise.resolve().then(()=>eLt),void 0))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>_e(()=>Promise.resolve().then(()=>aLt),void 0))},{id:"wasm",name:"WebAssembly",import:(()=>_e(()=>Promise.resolve().then(()=>oLt),void 0))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>_e(()=>Promise.resolve().then(()=>cLt),void 0))},{id:"wgsl",name:"WGSL",import:(()=>_e(()=>Promise.resolve().then(()=>dLt),void 0))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>_e(()=>Promise.resolve().then(()=>gLt),void 0))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>_e(()=>Promise.resolve().then(()=>bLt),void 0))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>_e(()=>Promise.resolve().then(()=>wLt),void 0))},{id:"xml",name:"XML",import:(()=>_e(()=>Promise.resolve().then(()=>JDt),void 0))},{id:"xsl",name:"XSL",import:(()=>_e(()=>Promise.resolve().then(()=>kLt),void 0))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>_e(()=>Promise.resolve().then(()=>XSt),void 0))},{id:"zenscript",name:"ZenScript",import:(()=>_e(()=>Promise.resolve().then(()=>QLt),void 0))},{id:"zig",name:"Zig",import:(()=>_e(()=>Promise.resolve().then(()=>DLt),void 0))}],TXe=Object.fromEntries(Rke.map(t=>[t.id,t.import])),RXe=Object.fromEntries(Rke.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),jK={...TXe,...RXe},MXe=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>NLt),void 0))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>TLt),void 0))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>MLt),void 0))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>OLt),void 0))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>PLt),void 0))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>ULt),void 0))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>jLt),void 0))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>zLt),void 0))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>KLt),void 0))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>WLt),void 0))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>JLt),void 0))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>e7t),void 0))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>n7t),void 0))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>r7t),void 0))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>o7t),void 0))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>A7t),void 0))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>l7t),void 0))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>d7t),void 0))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>m7t),void 0))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>f7t),void 0))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>b7t),void 0))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>C7t),void 0))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>E7t),void 0))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>k7t),void 0))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>I7t),void 0))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>_7t),void 0))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>D7t),void 0))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>N7t),void 0))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>T7t),void 0))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>M7t),void 0))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>O7t),void 0))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>P7t),void 0))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>U7t),void 0))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>j7t),void 0))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>z7t),void 0))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>K7t),void 0))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>W7t),void 0))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>J7t),void 0))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>eOt),void 0))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>nOt),void 0))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>rOt),void 0))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>oOt),void 0))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>AOt),void 0))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>lOt),void 0))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>dOt),void 0))},{id:"red",displayName:"Red",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>mOt),void 0))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>fOt),void 0))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>bOt),void 0))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>COt),void 0))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>EOt),void 0))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>kOt),void 0))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>IOt),void 0))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>_Ot),void 0))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>DOt),void 0))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>NOt),void 0))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>TOt),void 0))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>MOt),void 0))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>OOt),void 0))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>POt),void 0))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>UOt),void 0))}],Mke=Object.fromEntries(MXe.map(t=>[t.id,t.import]));class HK extends Error{constructor(e){super(e),this.name="ShikiError"}}function LXe(){return 2147483648}function OXe(){return typeof performance<"u"?performance.now():Date.now()}const GXe=(t,e)=>t+(e-t%e)%e;async function PXe(t){let e,n;const a={};function r(m){n=m,a.HEAPU8=new Uint8Array(m),a.HEAPU32=new Uint32Array(m)}function i(m,g,h){a.HEAPU8.copyWithin(m,g,g+h)}function o(m){try{return e.grow(m-n.byteLength+65535>>>16),r(e.buffer),1}catch{}}function s(m){const g=a.HEAPU8.length;m=m>>>0;const h=LXe();if(m>h)return!1;for(let b=1;b<=4;b*=2){let y=g*(1+.2/b);y=Math.min(y,m+100663296);const w=Math.min(h,GXe(Math.max(m,y),65536));if(o(w))return!0}return!1}const A=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function l(m,g,h=1024){const b=g+h;let y=g;for(;m[y]&&!(y>=b);)++y;if(y-g>16&&m.buffer&&A)return A.decode(m.subarray(g,y));let w="";for(;g<y;){let E=m[g++];if(!(E&128)){w+=String.fromCharCode(E);continue}const k=m[g++]&63;if((E&224)===192){w+=String.fromCharCode((E&31)<<6|k);continue}const v=m[g++]&63;if((E&240)===224?E=(E&15)<<12|k<<6|v:E=(E&7)<<18|k<<12|v<<6|m[g++]&63,E<65536)w+=String.fromCharCode(E);else{const _=E-65536;w+=String.fromCharCode(55296|_>>10,56320|_&1023)}}return w}function u(m,g){return m?l(a.HEAPU8,m,g):""}const d={emscripten_get_now:OXe,emscripten_memcpy_big:i,emscripten_resize_heap:s,fd_write:()=>0};async function p(){const g=await t({env:d,wasi_snapshot_preview1:d});e=g.memory,r(e.buffer),Object.assign(a,g),a.UTF8ToString=u}return await p(),a}var qXe=Object.defineProperty,UXe=(t,e,n)=>e in t?qXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fi=(t,e,n)=>UXe(t,typeof e!="symbol"?e+"":e,n);let Vi=null;function $Xe(t){throw new HK(t.UTF8ToString(t.getLastOnigError()))}class bS{constructor(e){Fi(this,"utf16Length"),Fi(this,"utf8Length"),Fi(this,"utf16Value"),Fi(this,"utf8Value"),Fi(this,"utf16OffsetToUtf8"),Fi(this,"utf8OffsetToUtf16");const n=e.length,a=bS._utf8ByteLength(e),r=a!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=a);const o=r?new Uint32Array(a+1):null;r&&(o[a]=n);const s=new Uint8Array(a);let A=0;for(let l=0;l<n;l++){const u=e.charCodeAt(l);let d=u,p=!1;if(u>=55296&&u<=56319&&l+1<n){const m=e.charCodeAt(l+1);m>=56320&&m<=57343&&(d=(u-55296<<10)+65536|m-56320,p=!0)}r&&(i[l]=A,p&&(i[l+1]=A),d<=127?o[A+0]=l:d<=2047?(o[A+0]=l,o[A+1]=l):d<=65535?(o[A+0]=l,o[A+1]=l,o[A+2]=l):(o[A+0]=l,o[A+1]=l,o[A+2]=l,o[A+3]=l)),d<=127?s[A++]=d:d<=2047?(s[A++]=192|(d&1984)>>>6,s[A++]=128|(d&63)>>>0):d<=65535?(s[A++]=224|(d&61440)>>>12,s[A++]=128|(d&4032)>>>6,s[A++]=128|(d&63)>>>0):(s[A++]=240|(d&1835008)>>>18,s[A++]=128|(d&258048)>>>12,s[A++]=128|(d&4032)>>>6,s[A++]=128|(d&63)>>>0),p&&l++}this.utf16Length=n,this.utf8Length=a,this.utf16Value=e,this.utf8Value=s,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let n=0;for(let a=0,r=e.length;a<r;a++){const i=e.charCodeAt(a);let o=i,s=!1;if(i>=55296&&i<=56319&&a+1<r){const A=e.charCodeAt(a+1);A>=56320&&A<=57343&&(o=(i-55296<<10)+65536|A-56320,s=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,s&&a++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const yS=class Ol{constructor(e){if(Fi(this,"id",++Ol.LAST_ID),Fi(this,"_onigBinding"),Fi(this,"content"),Fi(this,"utf16Length"),Fi(this,"utf8Length"),Fi(this,"utf16OffsetToUtf8"),Fi(this,"utf8OffsetToUtf16"),Fi(this,"ptr"),!Vi)throw new HK("Must invoke loadWasm first.");this._onigBinding=Vi,this.content=e;const n=new bS(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ol._sharedPtrInUse?(Ol._sharedPtr||(Ol._sharedPtr=Vi.omalloc(1e4)),Ol._sharedPtrInUse=!0,Vi.HEAPU8.set(n.utf8Value,Ol._sharedPtr),this.ptr=Ol._sharedPtr):this.ptr=n.createString(Vi)}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===Ol._sharedPtr?Ol._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Fi(yS,"LAST_ID",0);Fi(yS,"_sharedPtr",0);Fi(yS,"_sharedPtrInUse",!1);let Lke=yS;class jXe{constructor(e){if(Fi(this,"_onigBinding"),Fi(this,"_ptr"),!Vi)throw new HK("Must invoke loadWasm first.");const n=[],a=[];for(let s=0,A=e.length;s<A;s++){const l=new bS(e[s]);n[s]=l.createString(Vi),a[s]=l.utf8Length}const r=Vi.omalloc(4*e.length);Vi.HEAPU32.set(n,r/4);const i=Vi.omalloc(4*e.length);Vi.HEAPU32.set(a,i/4);const o=Vi.createOnigScanner(r,i,e.length);for(let s=0,A=e.length;s<A;s++)Vi.ofree(n[s]);Vi.ofree(i),Vi.ofree(r),o===0&&$Xe(Vi),this._onigBinding=Vi,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,a){let r=0;if(typeof a=="number"&&(r=a),typeof e=="string"){e=new Lke(e);const i=this._findNextMatchSync(e,n,!1,r);return e.dispose(),i}return this._findNextMatchSync(e,n,!1,r)}_findNextMatchSync(e,n,a,r){const i=this._onigBinding,o=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),r);if(o===0)return null;const s=i.HEAPU32;let A=o/4;const l=s[A++],u=s[A++],d=[];for(let p=0;p<u;p++){const m=e.convertUtf8OffsetToUtf16(s[A++]),g=e.convertUtf8OffsetToUtf16(s[A++]);d[p]={start:m,end:g,length:g-m}}return{index:l,captureIndices:d}}}function HXe(t){return typeof t.instantiator=="function"}function zXe(t){return typeof t.default=="function"}function YXe(t){return typeof t.data<"u"}function KXe(t){return typeof Response<"u"&&t instanceof Response}function ZXe(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let $Q;function WXe(t){if($Q)return $Q;async function e(){Vi=await PXe(async n=>{let a=t;return a=await a,typeof a=="function"&&(a=await a(n)),typeof a=="function"&&(a=await a(n)),HXe(a)?a=await a.instantiator(n):zXe(a)?a=await a.default(n):(YXe(a)&&(a=a.data),KXe(a)?typeof WebAssembly.instantiateStreaming=="function"?a=await VXe(a)(n):a=await JXe(a)(n):ZXe(a)?a=await $T(a)(n):a instanceof WebAssembly.Module?a=await $T(a)(n):"default"in a&&a.default instanceof WebAssembly.Module&&(a=await $T(a.default)(n))),"instance"in a&&(a=a.instance),"exports"in a&&(a=a.exports),a})}return $Q=e(),$Q}function $T(t){return e=>WebAssembly.instantiate(t,e)}function VXe(t){return e=>WebAssembly.instantiateStreaming(t,e)}function JXe(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function XXe(t){return t&&await WXe(t),{createScanner(e){return new jXe(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Lke(e)}}}const Oke=FXe({langs:jK,themes:Mke,engine:()=>XXe(_e(()=>Promise.resolve().then(()=>jOt),void 0))});function w1(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function eet(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}const zK=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),eo=String.raw;function E1(t,e){if(t==null)throw new Error(e??"Value expected");return t}const Gke=eo`\[\^?`,Pke=`c.? | C(?:-.?)?|${eo`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${eo`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${eo`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${eo`o\{[^\}]*\}?`}|${eo`\d{1,3}`}`,YK=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,jQ=new RegExp(eo`
68
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function OJe(t,e,n,a){const r=a.schema,i=r.space==="svg"?!1:a.settings.omitOptionalTags;let o=r.space==="svg"?a.settings.closeEmptyElements:a.settings.voids.includes(t.tagName.toLowerCase());const s=[];let A;r.space==="html"&&t.tagName==="svg"&&(a.schema=vu);const l=GJe(a,t.properties),u=a.all(r.space==="html"&&t.tagName==="template"?t.content:t);return a.schema=r,u&&(o=!1),(l||!i||!NJe(t,e,n))&&(s.push("<",t.tagName,l?" "+l:""),o&&(r.space==="svg"||a.settings.closeSelfClosing)&&(A=l.charAt(l.length-1),(!a.settings.tightSelfClosing||A==="/"||A&&A!=='"'&&A!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(u),!o&&(!i||!UK(t,e,n))&&s.push("</"+t.tagName+">"),s.join("")}function GJe(t,e){const n=[];let a=-1,r;if(e){for(r in e)if(e[r]!==null&&e[r]!==void 0){const i=PJe(t,r,e[r]);i&&n.push(i)}}for(;++a<n.length;){const i=t.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&i!=='"'&&i!=="'"&&(n[a]+=" ")}return n.join("")}function PJe(t,e,n){const a=sv(t.schema,e),r=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let o=t.quote,s;if(a.overloadedBoolean&&(n===a.attribute||n==="")?n=!0:(a.boolean||a.overloadedBoolean)&&(typeof n!="string"||n===a.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const A=Jb(a.attribute,Object.assign({},t.settings.characterReferences,{subset:UQ.name[r][i]}));return n===!0||(n=Array.isArray(n)?(a.commaSeparated?PK:qK)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?A:(t.settings.preferUnquoted&&(s=Jb(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:UQ.unquoted[r][i]}))),s!==n&&(t.settings.quoteSmart&&bD(n,o)>bD(n,t.alternative)&&(o=t.alternative),s=o+Jb(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?UQ.single:UQ.double)[r][i],attribute:!0}))+o),A+(s&&"="+s))}const qJe=["<","&"];function Ike(t,e,n,a){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Jb(t.value,Object.assign({},a.settings.characterReferences,{subset:qJe}))}function UJe(t,e,n,a){return a.settings.allowDangerousHtml?t.value:Ike(t,e,n,a)}function $Je(t,e,n,a){return a.all(t)}const jJe=GK("type",{invalid:HJe,unknown:zJe,handlers:{comment:gJe,doctype:fJe,element:OJe,raw:UJe,root:$Je,text:Ike}});function HJe(t){throw new Error("Expected node, not `"+t+"`")}function zJe(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const YJe={},KJe={},ZJe=[];function KE(t,e){const n=e||YJe,a=n.quote||'"',r=a==='"'?"'":'"';if(a!=='"'&&a!=="'")throw new Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:WJe,all:VJe,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||mke,characterReferences:n.characterReferences||KJe,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?vu:y1,quote:a,alternative:r}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function WJe(t,e,n){return jJe(t,e,n,this)}function VJe(t){const e=[],n=t&&t.children||ZJe;let a=-1;for(;++a<n.length;)e[a]=this.one(n[a],a,t);return e.join("")}function yD(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},a=typeof t=="string"?t:t.name;for(const[r,i]of Object.entries(e?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===a&&Object.assign(n,i);return n}function wm(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function JJe(t){return Array.isArray(t)?t:[t]}async function Qke(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function $K(t){return!t||["plaintext","txt","text","plain"].includes(t)}function _ke(t){return t==="ansi"||$K(t)}function jK(t){return t==="none"}function xke(t){return jK(t)}function Dke(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 a of n)a&&!t.properties.class.includes(a)&&t.properties.class.push(a);return t}function fS(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let a=0;const r=[];for(let i=0;i<n.length;i+=2){const o=e?n[i]+(n[i+1]||""):n[i];r.push([o,a]),a+=n[i].length,a+=n[i+1]?.length||0}return r}function XJe(t){const e=fS(t,!0).map(([r])=>r);function n(r){if(r===t.length)return{line:e.length-1,character:e[e.length-1].length};let i=r,o=0;for(const s of e){if(i<s.length)break;i-=s.length,o++}return{line:o,character:i}}function a(r,i){let o=0;for(let s=0;s<r;s++)o+=e[s].length;return o+=i,o}return{lines:e,indexToPos:n,posToIndex:a}}const HK="light-dark()",eXe=["color","background-color"];function tXe(t,e){let n=0;const a=[];for(const r of e)r>n&&a.push({...t,content:t.content.slice(n,r),offset:t.offset+n}),n=r;return n<t.content.length&&a.push({...t,content:t.content.slice(n),offset:t.offset+n}),a}function nXe(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((a,r)=>a-r);return n.length?t.map(a=>a.flatMap(r=>{const i=n.filter(o=>r.offset<o&&o<r.offset+r.content.length).map(o=>o-r.offset).sort((o,s)=>o-s);return i.length?tXe(r,i):r})):t}function aXe(t,e,n,a,r="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},o=e.map(u=>CD(t.variants[u])),s=new Set(o.flatMap(u=>Object.keys(u))),A={},l=(u,d)=>{const p=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+e[u]+(d==="color"?"":p)};return o.forEach((u,d)=>{for(const p of s){const m=u[p]||"inherit";if(d===0&&a&&eXe.includes(p))if(a===HK&&o.length>1){const g=e.findIndex(w=>w==="light"),h=e.findIndex(w=>w==="dark");if(g===-1||h===-1)throw new hi('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=o[g][p]||"inherit",y=o[h][p]||"inherit";A[p]=`light-dark(${b}, ${y})`,r==="css-vars"&&(A[l(d,p)]=m)}else A[p]=m;else r==="css-vars"&&(A[l(d,p)]=m)}}),i.htmlStyle=A,i}function CD(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&jo.Italic&&(e["font-style"]="italic"),t.fontStyle&jo.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&jo.Underline&&n.push("underline"),t.fontStyle&jo.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function S$(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const Ske=new WeakMap;function hS(t,e){Ske.set(t,e)}function OB(t){return Ske.get(t)}class C1{_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 C1(Object.fromEntries(JJe(n).map(a=>[a,Q$])),e)}constructor(...e){if(e.length===2){const[n,a]=e;this.lang=a,this._stacks=n}else{const[n,a,r]=e;this.lang=a,this._stacks={[r]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return rXe(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function rXe(t){const e=[],n=new Set;function a(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&e.push(i),r.parent&&a(r.parent)}return a(t),e}function iXe(t,e){if(!(t instanceof C1))throw new hi("Invalid grammar state");return t.getInternalStack(e)}function oXe(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let a=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new hi(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...r.indexToPos(o),offset:o}}else{const s=r.lines[o.line];if(s===void 0)throw new hi(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);let A=o.character;if(A<0&&(A=s.length+A),A<0||A>s.length)throw new hi(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${s.length}`);return{...o,character:A,offset:r.posToIndex(o.line,A)}}};const r=XJe(n.source),i=(n.options.decorations||[]).map(o=>({...o,start:a(o.start),end:a(o.end)}));sXe(i),t.set(n.meta,{decorations:i,converter:r,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const r=e(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return nXe(n,r)},code(n){if(!this.options.decorations?.length)return;const a=e(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==a.converter.lines.length)throw new hi(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${a.converter.lines.length}). Failed to apply decorations.`);function i(u,d,p,m){const g=r[u];let h="",b=-1,y=-1;if(d===0&&(b=0),p===0&&(y=0),p===Number.POSITIVE_INFINITY&&(y=g.children.length),b===-1||y===-1)for(let E=0;E<g.children.length;E++)h+=Nke(g.children[E]),b===-1&&h.length===d&&(b=E+1),y===-1&&h.length===p&&(y=E+1);if(b===-1)throw new hi(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(y===-1)throw new hi(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const w=g.children.slice(b,y);if(!m.alwaysWrap&&w.length===g.children.length)s(g,m,"line");else if(!m.alwaysWrap&&w.length===1&&w[0].type==="element")s(w[0],m,"token");else{const E={type:"element",tagName:"span",properties:{},children:w};s(E,m,"wrapper"),g.children.splice(b,w.length,E)}}function o(u,d){r[u]=s(r[u],d,"line")}function s(u,d,p){const m=d.properties||{},g=d.transform||(h=>h);return u.tagName=d.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},d.properties?.class&&Dke(u,d.properties.class),u=g(u,p)||u,u}const A=[],l=a.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(const u of l){const{start:d,end:p}=u;if(d.line===p.line)i(d.line,d.character,p.character,u);else if(d.line<p.line){i(d.line,d.character,Number.POSITIVE_INFINITY,u);for(let m=d.line+1;m<p.line;m++)A.unshift(()=>o(m,u));i(p.line,0,p.character,u)}}A.forEach(u=>u())}}}function sXe(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new hi(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let a=e+1;a<t.length;a++){const r=t[a],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,o=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,s=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,A=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||o||s||A){if(i&&o||s&&A||s&&n.start.offset===n.end.offset||o&&r.start.offset===r.end.offset)continue;throw new hi(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function Nke(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(Nke).join(""):""}const AXe=[oXe()];function wD(t){const e=cXe(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...AXe]}function cXe(t){const e=[],n=[],a=[];for(const r of t)switch(r.enforce){case"pre":e.push(r);break;case"post":n.push(r);break;default:a.push(r)}return{pre:e,post:n,normal:a}}var If=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],UT={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function lXe(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const a=t.indexOf("m",n);if(a!==-1)return{sequence:t.substring(n+2,a).split(";"),startPosition:n,position:a+1}}return{position:t.length}}function vie(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(a=>Number.parseInt(a));return n.length!==3||n.some(a=>Number.isNaN(a))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function uXe(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const a=Number.parseInt(n);if(!Number.isNaN(a))if(a===0)e.push({type:"resetAll"});else if(a<=9)UT[a]&&e.push({type:"setDecoration",value:UT[a]});else if(a<=29){const r=UT[a-20];r&&(e.push({type:"resetDecoration",value:r}),r==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(a<=37)e.push({type:"setForegroundColor",value:{type:"named",name:If[a-30]}});else if(a===38){const r=vie(t);r&&e.push({type:"setForegroundColor",value:r})}else if(a===39)e.push({type:"resetForegroundColor"});else if(a<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:If[a-40]}});else if(a===48){const r=vie(t);r&&e.push({type:"setBackgroundColor",value:r})}else a===49?e.push({type:"resetBackgroundColor"}):a===53?e.push({type:"setDecoration",value:"overline"}):a===55?e.push({type:"resetDecoration",value:"overline"}):a>=90&&a<=97?e.push({type:"setForegroundColor",value:{type:"named",name:If[a-90+8]}}):a>=100&&a<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:If[a-100+8]}})}return e}function dXe(){let t=null,e=null,n=new Set;return{parse(a){const r=[];let i=0;do{const o=lXe(a,i),s=o.sequence?a.substring(i,o.startPosition):a.substring(i);if(s.length>0&&r.push({value:s,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const A=uXe(o.sequence);for(const l of A)l.type==="resetAll"?(t=null,e=null,n.clear()):l.type==="resetForegroundColor"?t=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of A)l.type==="setForegroundColor"?t=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&n.add(l.value)}i=o.position}while(i<a.length);return r}}}var pXe={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function mXe(t=pXe){function e(s){return t[s]}function n(s){return`#${s.map(A=>Math.max(0,Math.min(A,255)).toString(16).padStart(2,"0")).join("")}`}let a;function r(){if(a)return a;a=[];for(let l=0;l<If.length;l++)a.push(e(If[l]));let s=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let d=0;d<6;d++)a.push(n([s[l],s[u],s[d]]));let A=8;for(let l=0;l<24;l++,A+=10)a.push(n([A,A,A]));return a}function i(s){return r()[s]}function o(s){switch(s.type){case"named":return e(s.name);case"rgb":return n(s.rgb);case"table":return i(s.index)}}return{value:o}}const gXe={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function fXe(t,e,n){const a=yD(t,n),r=fS(e),i=Object.fromEntries(If.map(A=>{const l=`terminal.ansi${A[0].toUpperCase()}${A.substring(1)}`,u=t.colors?.[l];return[A,u||gXe[A]]})),o=mXe(i),s=dXe();return r.map(A=>s.parse(A[0]).map(l=>{let u,d;l.decorations.has("reverse")?(u=l.background?o.value(l.background):t.bg,d=l.foreground?o.value(l.foreground):t.fg):(u=l.foreground?o.value(l.foreground):t.fg,d=l.background?o.value(l.background):void 0),u=wm(u,a),d=wm(d,a),l.decorations.has("dim")&&(u=hXe(u));let p=jo.None;return l.decorations.has("bold")&&(p|=jo.Bold),l.decorations.has("italic")&&(p|=jo.Italic),l.decorations.has("underline")&&(p|=jo.Underline),l.decorations.has("strikethrough")&&(p|=jo.Strikethrough),{content:l.value,offset:A[1],color:u,bgColor:d,fontStyle:p}}))}function hXe(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const a=e[1];if(a.length===8){const r=Math.round(Number.parseInt(a.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${a.slice(0,6)}${r}`}else{if(a.length===6)return`#${a}80`;if(a.length===4){const r=a[0],i=a[1],o=a[2],s=a[3],A=Math.round(Number.parseInt(`${s}${s}`,16)/2).toString(16).padStart(2,"0");return`#${r}${r}${i}${i}${o}${o}${A}`}else if(a.length===3){const r=a[0],i=a[1],o=a[2];return`#${r}${r}${i}${i}${o}${o}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function zK(t,e,n={}){const{theme:a=t.getLoadedThemes()[0]}=n,r=t.resolveLangAlias(n.lang||"text");if($K(r)||jK(a))return fS(e).map(A=>[{content:A[0],offset:A[1]}]);const{theme:i,colorMap:o}=t.setTheme(a);if(r==="ansi")return fXe(i,e,n);const s=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new hi(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new hi(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return yXe(e,s,i,o,n)}function bXe(...t){if(t.length===2)return OB(t[1]);const[e,n,a={}]=t,{lang:r="text",theme:i=e.getLoadedThemes()[0]}=a;if($K(r)||jK(i))throw new hi("Plain language does not have grammar state");if(r==="ansi")throw new hi("ANSI language does not have grammar state");const{theme:o,colorMap:s}=e.setTheme(i),A=e.getLanguage(r);return new C1(ED(n,A,o,s,a).stateStack,A.name,o.name)}function yXe(t,e,n,a,r){const i=ED(t,e,n,a,r),o=new C1(ED(t,e,n,a,r).stateStack,e.name,n.name);return hS(i.tokens,o),i.tokens}function ED(t,e,n,a,r){const i=yD(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=r,A=fS(t);let l=r.grammarState?iXe(r.grammarState,n.name)??Q$:r.grammarContextCode!=null?ED(r.grammarContextCode,e,n,a,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Q$,u=[];const d=[];for(let p=0,m=A.length;p<m;p++){const[g,h]=A[p];if(g===""){u=[],d.push([]);continue}if(o>0&&g.length>=o){u=[],d.push([{content:g,offset:h,color:"",fontStyle:0}]);continue}let b,y,w;r.includeExplanation&&(b=e.tokenizeLine(g,l,s),y=b.tokens,w=0);const E=e.tokenizeLine2(g,l,s),k=E.tokens.length/2;for(let v=0;v<k;v++){const _=E.tokens[2*v],I=v+1<k?E.tokens[2*v+2]:g.length;if(_===I)continue;const x=E.tokens[2*v+1],N=wm(a[B2.getForeground(x)],i),R=B2.getFontStyle(x),T={content:g.substring(_,I),offset:h+_,color:N,fontStyle:R};if(r.includeExplanation){const O=[];if(r.includeExplanation!=="scopeName")for(const F of n.settings){let L;switch(typeof F.scope){case"string":L=F.scope.split(/,/).map(M=>M.trim());break;case"object":L=F.scope;break;default:continue}O.push({settings:F,selectors:L.map(M=>M.split(/ /))})}T.explanation=[];let $=0;for(;_+$<I;){const F=y[w],L=g.substring(F.startIndex,F.endIndex);$+=L.length,T.explanation.push({content:L,scopes:r.includeExplanation==="scopeName"?CXe(F.scopes):wXe(O,F.scopes)}),w+=1}}u.push(T)}d.push(u),u=[],l=E.ruleStack}return{tokens:d,stateStack:l}}function CXe(t){return t.map(e=>({scopeName:e}))}function wXe(t,e){const n=[];for(let a=0,r=e.length;a<r;a++){const i=e[a];n[a]={scopeName:i,themeMatches:BXe(t,i,e.slice(0,a))}}return n}function Iie(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function EXe(t,e,n){if(!Iie(t[t.length-1],e))return!1;let a=t.length-2,r=n.length-1;for(;a>=0&&r>=0;)Iie(t[a],n[r])&&(a-=1),r-=1;return a===-1}function BXe(t,e,n){const a=[];for(const{selectors:r,settings:i}of t)for(const o of r)if(EXe(o,e,n)){a.push(i);break}return a}function Fke(t,e,n){const a=Object.entries(n.themes).filter(A=>A[1]).map(A=>({color:A[0],theme:A[1]})),r=a.map(A=>{const l=zK(t,e,{...n,theme:A.theme}),u=OB(l),d=typeof A.theme=="string"?A.theme:A.theme.name;return{tokens:l,state:u,theme:d}}),i=kXe(...r.map(A=>A.tokens)),o=i[0].map((A,l)=>A.map((u,d)=>{const p={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(p.explanation=u.explanation),i.forEach((m,g)=>{const{content:h,explanation:b,offset:y,...w}=m[l][d];p.variants[a[g].color]=w}),p})),s=r[0].state?new C1(Object.fromEntries(r.map(A=>[A.theme,A.state?.getInternalStack(A.theme)])),r[0].state.lang):void 0;return s&&hS(o,s),o}function kXe(...t){const e=t.map(()=>[]),n=t.length;for(let a=0;a<t[0].length;a++){const r=t.map(A=>A[a]),i=e.map(()=>[]);e.forEach((A,l)=>A.push(i[l]));const o=r.map(()=>0),s=r.map(A=>A[0]);for(;s.every(A=>A);){const A=Math.min(...s.map(l=>l.content.length));for(let l=0;l<n;l++){const u=s[l];u.content.length===A?(i[l].push(u),o[l]+=1,s[l]=r[l][o[l]]):(i[l].push({...u,content:u.content.slice(0,A)}),s[l]={...u,content:u.content.slice(A),offset:u.offset+A})}}}return e}function BD(t,e,n){let a,r,i,o,s,A;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=n,p=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,w)=>y.color===l?-1:w.color===l?1:0);if(p.length===0)throw new hi("`themes` option must not be empty");const m=Fke(t,e,n);if(A=OB(m),l&&HK!==l&&!p.find(y=>y.color===l))throw new hi(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=p.map(y=>t.getTheme(y.theme)),h=p.map(y=>y.color);i=m.map(y=>y.map(w=>aXe(w,h,u,l,d))),A&&hS(i,A);const b=p.map(y=>yD(y.theme,n));r=Qie(p,g,b,u,l,"fg",d),a=Qie(p,g,b,u,l,"bg",d),o=`shiki-themes ${g.map(y=>y.name).join(" ")}`,s=l?void 0:[r,a].join(";")}else if("theme"in n){const l=yD(n.theme,n);i=zK(t,e,n);const u=t.getTheme(n.theme);a=wm(u.bg,l),r=wm(u.fg,l),o=u.name,A=OB(i)}else throw new hi("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:a,themeName:o,rootStyle:s,grammarState:A}}function Qie(t,e,n,a,r,i,o){return t.map((s,A)=>{const l=wm(e[A][i],n[A])||"inherit",u=`${a+s.color}${i==="bg"?"-bg":""}:${l}`;if(A===0&&r){if(r===HK&&t.length>1){const d=t.findIndex(h=>h.color==="light"),p=t.findIndex(h=>h.color==="dark");if(d===-1||p===-1)throw new hi('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=wm(e[d][i],n[d])||"inherit",g=wm(e[p][i],n[p])||"inherit";return`light-dark(${m}, ${g});${u}`}return l}return o==="css-vars"?u:null}).filter(s=>!!s).join(";")}function kD(t,e,n,a={meta:{},options:n,codeToHast:(r,i)=>kD(t,r,i),codeToTokens:(r,i)=>BD(t,r,i)}){let r=e;for(const g of wD(n))r=g.preprocess?.call(a,r,n)||r;let{tokens:i,fg:o,bg:s,themeName:A,rootStyle:l,grammarState:u}=BD(t,r,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:p=!1}=n;d===!0?i=IXe(i):d==="never"&&(i=QXe(i)),p&&(i=_Xe(i));const m={...a,get source(){return r}};for(const g of wD(n))i=g.tokens?.call(m,i)||i;return vXe(i,{...n,fg:o,bg:s,themeName:A,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},m,u)}function vXe(t,e,n,a=OB(t)){const r=wD(e),i=[],o={type:"root",children:[]},{structure:s="classic",tabindex:A="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),A!==!1&&A!=null&&(l.tabindex=A.toString());for(const[h,b]of Object.entries(e.meta||{}))h.startsWith("_")||(l[h]=b);let u={type:"element",tagName:"pre",properties:l,children:[]},d={type:"element",tagName:"code",properties:{},children:i};const p=[],m={...n,structure:s,addClassToHast:Dke,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 p}};if(t.forEach((h,b)=>{b&&(s==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):s==="classic"&&i.push({type:"text",value:`
69
+ `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},w=0;for(const E of h){let k={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const v=S$(E.htmlStyle||CD(E));v&&(k.properties.style=v);for(const _ of r)k=_?.span?.call(m,k,b+1,w,y,E)||k;s==="inline"?o.children.push(k):s==="classic"&&y.children.push(k),w+=E.content.length}if(s==="classic"){for(const E of r)y=E?.line?.call(m,y,b+1)||y;p.push(y),i.push(y)}else s==="inline"&&p.push(y)}),s==="classic"){for(const h of r)d=h?.code?.call(m,d)||d;u.children.push(d);for(const h of r)u=h?.pre?.call(m,u)||u;o.children.push(u)}else if(s==="inline"){const h=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of o.children)E.type==="element"&&E.tagName==="br"?(h.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&b.children.push(E);h.push(b);let w={type:"element",tagName:"code",properties:{},children:h};for(const E of r)w=E?.code?.call(m,w)||w;o.children=[];for(let E=0;E<w.children.length;E++){E>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const k=w.children[E];k.type==="element"&&o.children.push(...k.children)}}let g=o;for(const h of r)g=h?.root?.call(m,g)||g;return a&&hS(g,a),g}function IXe(t){return t.map(e=>{const n=[];let a="",r;return e.forEach((i,o)=>{const A=!(i.fontStyle&&(i.fontStyle&jo.Underline||i.fontStyle&jo.Strikethrough));A&&i.content.match(/^\s+$/)&&e[o+1]?(r===void 0&&(r=i.offset),a+=i.content):a?(A?n.push({...i,offset:r,content:a+i.content}):n.push({content:a,offset:r},i),r=void 0,a=""):n.push(i)}),n})}function QXe(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const a=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!a)return n;const[,r,i,o]=a;if(!r&&!o)return n;const s=[{...n,offset:n.offset+r.length,content:i}];return r&&s.unshift({content:r,offset:n.offset}),o&&s.push({content:o,offset:n.offset+r.length+i.length}),s}))}function _Xe(t){return t.map(e=>{const n=[];for(const a of e){if(n.length===0){n.push({...a});continue}const r=n[n.length-1],i=S$(r.htmlStyle||CD(r)),o=S$(a.htmlStyle||CD(a)),s=r.fontStyle&&(r.fontStyle&jo.Underline||r.fontStyle&jo.Strikethrough),A=a.fontStyle&&(a.fontStyle&jo.Underline||a.fontStyle&jo.Strikethrough);!s&&!A&&i===o?r.content+=a.content:n.push({...a})}return n})}const xXe=KE;function DXe(t,e,n){const a={meta:{},options:n,codeToHast:(i,o)=>kD(t,i,o),codeToTokens:(i,o)=>BD(t,i,o)};let r=xXe(kD(t,e,n,a));for(const i of wD(n))r=i.postprocess?.call(a,r,n)||r;return r}const _ie={light:"#333333",dark:"#bbbbbb"},xie={light:"#fffffe",dark:"#1e1e1e"},Die="__shiki_resolved";function bS(t){if(t?.[Die])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:a}=e;if(!n||!a){const s=e.settings?e.settings.find(A=>!A.name&&!A.scope):void 0;s?.settings?.foreground&&(a=s.settings.foreground),s?.settings?.background&&(n=s.settings.background),!a&&e?.colors?.["editor.foreground"]&&(a=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),a||(a=e.type==="light"?_ie.light:_ie.dark),n||(n=e.type==="light"?xie.light:xie.dark),e.fg=a,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 r=0;const i=new Map;function o(s){if(i.has(s))return i.get(s);r+=1;const A=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${A}`]?o(s):(i.set(s,A),A)}e.settings=e.settings.map(s=>{const A=s.settings?.foreground&&!s.settings.foreground.startsWith("#"),l=s.settings?.background&&!s.settings.background.startsWith("#");if(!A&&!l)return s;const u={...s,settings:{...s.settings}};if(A){const d=o(s.settings.foreground);e.colorReplacements[d]=s.settings.foreground,u.settings.foreground=d}if(l){const d=o(s.settings.background);e.colorReplacements[d]=s.settings.background,u.settings.background=d}return u});for(const s of Object.keys(e.colors||{}))if((s==="editor.foreground"||s==="editor.background"||s.startsWith("terminal.ansi"))&&!e.colors[s]?.startsWith("#")){const A=o(e.colors[s]);e.colorReplacements[A]=e.colors[s],e.colors[s]=A}return Object.defineProperty(e,Die,{enumerable:!1,writable:!1,value:!0}),e}async function Tke(t){return Array.from(new Set((await Promise.all(t.filter(e=>!_ke(e)).map(async e=>await Qke(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Rke(t){return(await Promise.all(t.map(async n=>xke(n)?null:bS(await Qke(n))))).filter(n=>!!n)}let SXe=3;function NXe(t,e=3){e>SXe||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let Nb=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Mke(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 Nb(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class FXe extends qVe{constructor(e,n,a,r={}){super(e),this._resolver=e,this._themes=n,this._langs=a,this._alias=r,this._themes.map(i=>this.loadTheme(i)),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=bS(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=pD.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=Mke(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const a={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,a);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const n=Array.from(this._langGraph.entries()),a=n.filter(([r,i])=>!i);if(a.length){const r=n.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(A=>a.map(([l])=>l).includes(A)):!1).filter(i=>!a.includes(i));throw new Nb(`Missing languages ${a.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of n)this._resolver.addLanguage(i);for(const[r,i]of n)this.loadLanguage(i)}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 a of n)this._langGraph.set(a,this._langMap.get(a))}}class TXe{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:a=>e.createScanner(a),createOnigString:a=>e.createString(a)},n.forEach(a=>this.addLanguage(a))}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 a=[];for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");a=[...a,...this._injections.get(i)||[]]}return a}}let VC=0;function RXe(t){VC+=1,t.warnings!==!1&&VC>=10&&VC%10===0&&console.warn(`[Shiki] ${VC} 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 Nb("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),a=(t.themes||[]).flat(1).map(bS),r=new TXe(t.engine,n),i=new FXe(r,a,n,t.langAlias);let o;function s(E){return Mke(E,t.langAlias)}function A(E){y();const k=i.getGrammar(typeof E=="string"?E:E.name);if(!k)throw new Nb(`Language \`${E}\` not found, you may need to load it first`);return k}function l(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const k=i.getTheme(E);if(!k)throw new Nb(`Theme \`${E}\` not found, you may need to load it first`);return k}function u(E){y();const k=l(E);o!==E&&(i.setTheme(k),o=E);const v=i.getColorMap();return{theme:k,colorMap:v}}function d(){return y(),i.getLoadedThemes()}function p(){return y(),i.getLoadedLanguages()}function m(...E){y(),i.loadLanguages(E.flat(1))}async function g(...E){return m(await Tke(E))}function h(...E){y();for(const k of E.flat(1))i.loadTheme(k)}async function b(...E){return y(),h(await Rke(E))}function y(){if(e)throw new Nb("Shiki instance has been disposed")}function w(){e||(e=!0,i.dispose(),VC-=1)}return{setTheme:u,getTheme:l,getLanguage:A,getLoadedThemes:d,getLoadedLanguages:p,resolveLangAlias:s,loadLanguage:g,loadLanguageSync:m,loadTheme:b,loadThemeSync:h,dispose:w,[Symbol.dispose]:w}}async function MXe(t){t.engine||NXe("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,a]=await Promise.all([Rke(t.themes||[]),Tke(t.langs||[]),t.engine]);return RXe({...t,themes:e,langs:n,engine:a})}async function LXe(t){const e=await MXe(t);return{getLastGrammarState:(...n)=>bXe(e,...n),codeToTokensBase:(n,a)=>zK(e,n,a),codeToTokensWithThemes:(n,a)=>Fke(e,n,a),codeToTokens:(n,a)=>BD(e,n,a),codeToHast:(n,a)=>kD(e,n,a),codeToHtml:(n,a)=>DXe(e,n,a),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function OXe(t){const e=t.langs,n=t.themes,a=t.engine;async function r(i){function o(d){if(typeof d=="string"){if(d=i.langAlias?.[d]||d,_ke(d))return[];const p=e[d];if(!p)throw new hi(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return p}return d}function s(d){if(xke(d))return"none";if(typeof d=="string"){const p=n[d];if(!p)throw new hi(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return p}return d}const A=(i.themes??[]).map(d=>s(d)),l=(i.langs??[]).map(d=>o(d)),u=await LXe({engine:i.engine??a(),...i,themes:A,langs:l});return{...u,loadLanguage(...d){return u.loadLanguage(...d.map(o))},loadTheme(...d){return u.loadTheme(...d.map(s))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return r}const Lke=[{id:"abap",name:"ABAP",import:(()=>_e(()=>Promise.resolve().then(()=>gDt),void 0))},{id:"actionscript-3",name:"ActionScript",import:(()=>_e(()=>Promise.resolve().then(()=>bDt),void 0))},{id:"ada",name:"Ada",import:(()=>_e(()=>Promise.resolve().then(()=>wDt),void 0))},{id:"angular-html",name:"Angular HTML",import:(()=>_e(()=>Promise.resolve().then(()=>FDt),void 0))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>_e(()=>Promise.resolve().then(()=>UDt),void 0))},{id:"apache",name:"Apache Conf",import:(()=>_e(()=>Promise.resolve().then(()=>HDt),void 0))},{id:"apex",name:"Apex",import:(()=>_e(()=>Promise.resolve().then(()=>KDt),void 0))},{id:"apl",name:"APL",import:(()=>_e(()=>Promise.resolve().then(()=>a3t),void 0))},{id:"applescript",name:"AppleScript",import:(()=>_e(()=>Promise.resolve().then(()=>o3t),void 0))},{id:"ara",name:"Ara",import:(()=>_e(()=>Promise.resolve().then(()=>c3t),void 0))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>_e(()=>Promise.resolve().then(()=>d3t),void 0))},{id:"asm",name:"Assembly",import:(()=>_e(()=>Promise.resolve().then(()=>g3t),void 0))},{id:"astro",name:"Astro",import:(()=>_e(()=>Promise.resolve().then(()=>k3t),void 0))},{id:"awk",name:"AWK",import:(()=>_e(()=>Promise.resolve().then(()=>Q3t),void 0))},{id:"ballerina",name:"Ballerina",import:(()=>_e(()=>Promise.resolve().then(()=>D3t),void 0))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>_e(()=>Promise.resolve().then(()=>F3t),void 0))},{id:"beancount",name:"Beancount",import:(()=>_e(()=>Promise.resolve().then(()=>M3t),void 0))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>_e(()=>Promise.resolve().then(()=>G3t),void 0))},{id:"bibtex",name:"BibTeX",import:(()=>_e(()=>Promise.resolve().then(()=>U3t),void 0))},{id:"bicep",name:"Bicep",import:(()=>_e(()=>Promise.resolve().then(()=>H3t),void 0))},{id:"blade",name:"Blade",import:(()=>_e(()=>Promise.resolve().then(()=>J3t),void 0))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>_e(()=>Promise.resolve().then(()=>a8t),void 0))},{id:"c",name:"C",import:(()=>_e(()=>Promise.resolve().then(()=>i8t),void 0))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>_e(()=>Promise.resolve().then(()=>A8t),void 0))},{id:"cairo",name:"Cairo",import:(()=>_e(()=>Promise.resolve().then(()=>p8t),void 0))},{id:"clarity",name:"Clarity",import:(()=>_e(()=>Promise.resolve().then(()=>f8t),void 0))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>_e(()=>Promise.resolve().then(()=>y8t),void 0))},{id:"cmake",name:"CMake",import:(()=>_e(()=>Promise.resolve().then(()=>w8t),void 0))},{id:"cobol",name:"COBOL",import:(()=>_e(()=>Promise.resolve().then(()=>k8t),void 0))},{id:"codeowners",name:"CODEOWNERS",import:(()=>_e(()=>Promise.resolve().then(()=>Q8t),void 0))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>_e(()=>Promise.resolve().then(()=>D8t),void 0))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>_e(()=>Promise.resolve().then(()=>F8t),void 0))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>_e(()=>Promise.resolve().then(()=>M8t),void 0))},{id:"coq",name:"Coq",import:(()=>_e(()=>Promise.resolve().then(()=>G8t),void 0))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>_e(()=>Promise.resolve().then(()=>Y8t),void 0))},{id:"crystal",name:"Crystal",import:(()=>_e(()=>Promise.resolve().then(()=>J8t),void 0))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>_e(()=>Promise.resolve().then(()=>eSt),void 0))},{id:"css",name:"CSS",import:(()=>_e(()=>Promise.resolve().then(()=>vDt),void 0))},{id:"csv",name:"CSV",import:(()=>_e(()=>Promise.resolve().then(()=>nSt),void 0))},{id:"cue",name:"CUE",import:(()=>_e(()=>Promise.resolve().then(()=>iSt),void 0))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>_e(()=>Promise.resolve().then(()=>ASt),void 0))},{id:"d",name:"D",import:(()=>_e(()=>Promise.resolve().then(()=>uSt),void 0))},{id:"dart",name:"Dart",import:(()=>_e(()=>Promise.resolve().then(()=>mSt),void 0))},{id:"dax",name:"DAX",import:(()=>_e(()=>Promise.resolve().then(()=>hSt),void 0))},{id:"desktop",name:"Desktop",import:(()=>_e(()=>Promise.resolve().then(()=>CSt),void 0))},{id:"diff",name:"Diff",import:(()=>_e(()=>Promise.resolve().then(()=>ESt),void 0))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>_e(()=>Promise.resolve().then(()=>vSt),void 0))},{id:"dotenv",name:"dotEnv",import:(()=>_e(()=>Promise.resolve().then(()=>_St),void 0))},{id:"dream-maker",name:"Dream Maker",import:(()=>_e(()=>Promise.resolve().then(()=>SSt),void 0))},{id:"edge",name:"Edge",import:(()=>_e(()=>Promise.resolve().then(()=>TSt),void 0))},{id:"elixir",name:"Elixir",import:(()=>_e(()=>Promise.resolve().then(()=>LSt),void 0))},{id:"elm",name:"Elm",import:(()=>_e(()=>Promise.resolve().then(()=>PSt),void 0))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>_e(()=>Promise.resolve().then(()=>$St),void 0))},{id:"erb",name:"ERB",import:(()=>_e(()=>Promise.resolve().then(()=>r6t),void 0))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>_e(()=>Promise.resolve().then(()=>c6t),void 0))},{id:"fennel",name:"Fennel",import:(()=>_e(()=>Promise.resolve().then(()=>d6t),void 0))},{id:"fish",name:"Fish",import:(()=>_e(()=>Promise.resolve().then(()=>g6t),void 0))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>_e(()=>Promise.resolve().then(()=>b6t),void 0))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>_e(()=>Promise.resolve().then(()=>B6t),void 0))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>_e(()=>Promise.resolve().then(()=>C6t),void 0))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>_e(()=>Promise.resolve().then(()=>I6t),void 0))},{id:"gdresource",name:"GDResource",import:(()=>_e(()=>Promise.resolve().then(()=>F6t),void 0))},{id:"gdscript",name:"GDScript",import:(()=>_e(()=>Promise.resolve().then(()=>D6t),void 0))},{id:"gdshader",name:"GDShader",import:(()=>_e(()=>Promise.resolve().then(()=>_6t),void 0))},{id:"genie",name:"Genie",import:(()=>_e(()=>Promise.resolve().then(()=>M6t),void 0))},{id:"gherkin",name:"Gherkin",import:(()=>_e(()=>Promise.resolve().then(()=>G6t),void 0))},{id:"git-commit",name:"Git Commit Message",import:(()=>_e(()=>Promise.resolve().then(()=>U6t),void 0))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>_e(()=>Promise.resolve().then(()=>H6t),void 0))},{id:"gleam",name:"Gleam",import:(()=>_e(()=>Promise.resolve().then(()=>K6t),void 0))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>_e(()=>Promise.resolve().then(()=>V6t),void 0))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>_e(()=>Promise.resolve().then(()=>e5t),void 0))},{id:"glsl",name:"GLSL",import:(()=>_e(()=>Promise.resolve().then(()=>$8t),void 0))},{id:"gnuplot",name:"Gnuplot",import:(()=>_e(()=>Promise.resolve().then(()=>a5t),void 0))},{id:"go",name:"Go",import:(()=>_e(()=>Promise.resolve().then(()=>i5t),void 0))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>_e(()=>Promise.resolve().then(()=>ZSt),void 0))},{id:"groovy",name:"Groovy",import:(()=>_e(()=>Promise.resolve().then(()=>A5t),void 0))},{id:"hack",name:"Hack",import:(()=>_e(()=>Promise.resolve().then(()=>u5t),void 0))},{id:"haml",name:"Ruby Haml",import:(()=>_e(()=>Promise.resolve().then(()=>HSt),void 0))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>_e(()=>Promise.resolve().then(()=>m5t),void 0))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>_e(()=>Promise.resolve().then(()=>h5t),void 0))},{id:"haxe",name:"Haxe",import:(()=>_e(()=>Promise.resolve().then(()=>y5t),void 0))},{id:"hcl",name:"HashiCorp HCL",import:(()=>_e(()=>Promise.resolve().then(()=>E5t),void 0))},{id:"hjson",name:"Hjson",import:(()=>_e(()=>Promise.resolve().then(()=>v5t),void 0))},{id:"hlsl",name:"HLSL",import:(()=>_e(()=>Promise.resolve().then(()=>Q5t),void 0))},{id:"html",name:"HTML",import:(()=>_e(()=>Promise.resolve().then(()=>QDt),void 0))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>_e(()=>Promise.resolve().then(()=>Y3t),void 0))},{id:"http",name:"HTTP",import:(()=>_e(()=>Promise.resolve().then(()=>D5t),void 0))},{id:"hurl",name:"Hurl",import:(()=>_e(()=>Promise.resolve().then(()=>F5t),void 0))},{id:"hxml",name:"HXML",import:(()=>_e(()=>Promise.resolve().then(()=>M5t),void 0))},{id:"hy",name:"Hy",import:(()=>_e(()=>Promise.resolve().then(()=>G5t),void 0))},{id:"imba",name:"Imba",import:(()=>_e(()=>Promise.resolve().then(()=>U5t),void 0))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>_e(()=>Promise.resolve().then(()=>H5t),void 0))},{id:"java",name:"Java",import:(()=>_e(()=>Promise.resolve().then(()=>WDt),void 0))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>_e(()=>Promise.resolve().then(()=>BDt),void 0))},{id:"jinja",name:"Jinja",import:(()=>_e(()=>Promise.resolve().then(()=>W5t),void 0))},{id:"jison",name:"Jison",import:(()=>_e(()=>Promise.resolve().then(()=>X5t),void 0))},{id:"json",name:"JSON",import:(()=>_e(()=>Promise.resolve().then(()=>e3t),void 0))},{id:"json5",name:"JSON5",import:(()=>_e(()=>Promise.resolve().then(()=>nNt),void 0))},{id:"jsonc",name:"JSON with Comments",import:(()=>_e(()=>Promise.resolve().then(()=>iNt),void 0))},{id:"jsonl",name:"JSON Lines",import:(()=>_e(()=>Promise.resolve().then(()=>ANt),void 0))},{id:"jsonnet",name:"Jsonnet",import:(()=>_e(()=>Promise.resolve().then(()=>uNt),void 0))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>_e(()=>Promise.resolve().then(()=>mNt),void 0))},{id:"jsx",name:"JSX",import:(()=>_e(()=>Promise.resolve().then(()=>YSt),void 0))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>_e(()=>Promise.resolve().then(()=>yNt),void 0))},{id:"kdl",name:"KDL",import:(()=>_e(()=>Promise.resolve().then(()=>ENt),void 0))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>_e(()=>Promise.resolve().then(()=>vNt),void 0))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>_e(()=>Promise.resolve().then(()=>_Nt),void 0))},{id:"latex",name:"LaTeX",import:(()=>_e(()=>Promise.resolve().then(()=>FNt),void 0))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>_e(()=>Promise.resolve().then(()=>MNt),void 0))},{id:"less",name:"Less",import:(()=>_e(()=>Promise.resolve().then(()=>ONt),void 0))},{id:"liquid",name:"Liquid",import:(()=>_e(()=>Promise.resolve().then(()=>qNt),void 0))},{id:"llvm",name:"LLVM IR",import:(()=>_e(()=>Promise.resolve().then(()=>jNt),void 0))},{id:"log",name:"Log file",import:(()=>_e(()=>Promise.resolve().then(()=>YNt),void 0))},{id:"logo",name:"Logo",import:(()=>_e(()=>Promise.resolve().then(()=>WNt),void 0))},{id:"lua",name:"Lua",import:(()=>_e(()=>Promise.resolve().then(()=>VSt),void 0))},{id:"luau",name:"Luau",import:(()=>_e(()=>Promise.resolve().then(()=>XNt),void 0))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>_e(()=>Promise.resolve().then(()=>nFt),void 0))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>_e(()=>Promise.resolve().then(()=>o6t),void 0))},{id:"marko",name:"Marko",import:(()=>_e(()=>Promise.resolve().then(()=>iFt),void 0))},{id:"matlab",name:"MATLAB",import:(()=>_e(()=>Promise.resolve().then(()=>AFt),void 0))},{id:"mdc",name:"MDC",import:(()=>_e(()=>Promise.resolve().then(()=>uFt),void 0))},{id:"mdx",name:"MDX",import:(()=>_e(()=>Promise.resolve().then(()=>mFt),void 0))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>_e(()=>Promise.resolve().then(()=>hFt),void 0))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>_e(()=>Promise.resolve().then(()=>CFt),void 0))},{id:"mojo",name:"Mojo",import:(()=>_e(()=>Promise.resolve().then(()=>BFt),void 0))},{id:"move",name:"Move",import:(()=>_e(()=>Promise.resolve().then(()=>IFt),void 0))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>_e(()=>Promise.resolve().then(()=>xFt),void 0))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>_e(()=>Promise.resolve().then(()=>NFt),void 0))},{id:"nginx",name:"Nginx",import:(()=>_e(()=>Promise.resolve().then(()=>RFt),void 0))},{id:"nim",name:"Nim",import:(()=>_e(()=>Promise.resolve().then(()=>OFt),void 0))},{id:"nix",name:"Nix",import:(()=>_e(()=>Promise.resolve().then(()=>$Ft),void 0))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>_e(()=>Promise.resolve().then(()=>zFt),void 0))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>_e(()=>Promise.resolve().then(()=>ZFt),void 0))},{id:"objective-cpp",name:"Objective-C++",import:(()=>_e(()=>Promise.resolve().then(()=>JFt),void 0))},{id:"ocaml",name:"OCaml",import:(()=>_e(()=>Promise.resolve().then(()=>tTt),void 0))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>_e(()=>Promise.resolve().then(()=>rTt),void 0))},{id:"pascal",name:"Pascal",import:(()=>_e(()=>Promise.resolve().then(()=>sTt),void 0))},{id:"perl",name:"Perl",import:(()=>_e(()=>Promise.resolve().then(()=>lTt),void 0))},{id:"php",name:"PHP",import:(()=>_e(()=>Promise.resolve().then(()=>dTt),void 0))},{id:"pkl",name:"Pkl",import:(()=>_e(()=>Promise.resolve().then(()=>gTt),void 0))},{id:"plsql",name:"PL/SQL",import:(()=>_e(()=>Promise.resolve().then(()=>bTt),void 0))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>_e(()=>Promise.resolve().then(()=>wTt),void 0))},{id:"polar",name:"Polar",import:(()=>_e(()=>Promise.resolve().then(()=>kTt),void 0))},{id:"postcss",name:"PostCSS",import:(()=>_e(()=>Promise.resolve().then(()=>y3t),void 0))},{id:"powerquery",name:"PowerQuery",import:(()=>_e(()=>Promise.resolve().then(()=>QTt),void 0))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>_e(()=>Promise.resolve().then(()=>DTt),void 0))},{id:"prisma",name:"Prisma",import:(()=>_e(()=>Promise.resolve().then(()=>FTt),void 0))},{id:"prolog",name:"Prolog",import:(()=>_e(()=>Promise.resolve().then(()=>MTt),void 0))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>_e(()=>Promise.resolve().then(()=>GTt),void 0))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>_e(()=>Promise.resolve().then(()=>UTt),void 0))},{id:"puppet",name:"Puppet",import:(()=>_e(()=>Promise.resolve().then(()=>HTt),void 0))},{id:"purescript",name:"PureScript",import:(()=>_e(()=>Promise.resolve().then(()=>KTt),void 0))},{id:"python",name:"Python",aliases:["py"],import:(()=>_e(()=>Promise.resolve().then(()=>l8t),void 0))},{id:"qml",name:"QML",import:(()=>_e(()=>Promise.resolve().then(()=>VTt),void 0))},{id:"qmldir",name:"QML Directory",import:(()=>_e(()=>Promise.resolve().then(()=>e9t),void 0))},{id:"qss",name:"Qt Style Sheets",import:(()=>_e(()=>Promise.resolve().then(()=>a9t),void 0))},{id:"r",name:"R",import:(()=>_e(()=>Promise.resolve().then(()=>fNt),void 0))},{id:"racket",name:"Racket",import:(()=>_e(()=>Promise.resolve().then(()=>o9t),void 0))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>_e(()=>Promise.resolve().then(()=>c9t),void 0))},{id:"razor",name:"ASP.NET Razor",import:(()=>_e(()=>Promise.resolve().then(()=>d9t),void 0))},{id:"reg",name:"Windows Registry Script",import:(()=>_e(()=>Promise.resolve().then(()=>g9t),void 0))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>_e(()=>Promise.resolve().then(()=>q8t),void 0))},{id:"rel",name:"Rel",import:(()=>_e(()=>Promise.resolve().then(()=>b9t),void 0))},{id:"riscv",name:"RISC-V",import:(()=>_e(()=>Promise.resolve().then(()=>w9t),void 0))},{id:"rosmsg",name:"ROS Interface",import:(()=>_e(()=>Promise.resolve().then(()=>k9t),void 0))},{id:"rst",name:"reStructuredText",import:(()=>_e(()=>Promise.resolve().then(()=>Q9t),void 0))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>_e(()=>Promise.resolve().then(()=>t6t),void 0))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>_e(()=>Promise.resolve().then(()=>D9t),void 0))},{id:"sas",name:"SAS",import:(()=>_e(()=>Promise.resolve().then(()=>F9t),void 0))},{id:"sass",name:"Sass",import:(()=>_e(()=>Promise.resolve().then(()=>M9t),void 0))},{id:"scala",name:"Scala",import:(()=>_e(()=>Promise.resolve().then(()=>G9t),void 0))},{id:"scheme",name:"Scheme",import:(()=>_e(()=>Promise.resolve().then(()=>U9t),void 0))},{id:"scss",name:"SCSS",import:(()=>_e(()=>Promise.resolve().then(()=>RDt),void 0))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>_e(()=>Promise.resolve().then(()=>e8t),void 0))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>_e(()=>Promise.resolve().then(()=>H9t),void 0))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>_e(()=>Promise.resolve().then(()=>Z8t),void 0))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>_e(()=>Promise.resolve().then(()=>K9t),void 0))},{id:"smalltalk",name:"Smalltalk",import:(()=>_e(()=>Promise.resolve().then(()=>V9t),void 0))},{id:"solidity",name:"Solidity",import:(()=>_e(()=>Promise.resolve().then(()=>eRt),void 0))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>_e(()=>Promise.resolve().then(()=>aRt),void 0))},{id:"sparql",name:"SPARQL",import:(()=>_e(()=>Promise.resolve().then(()=>ARt),void 0))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>_e(()=>Promise.resolve().then(()=>uRt),void 0))},{id:"sql",name:"SQL",import:(()=>_e(()=>Promise.resolve().then(()=>Z3t),void 0))},{id:"ssh-config",name:"SSH Config",import:(()=>_e(()=>Promise.resolve().then(()=>mRt),void 0))},{id:"stata",name:"Stata",import:(()=>_e(()=>Promise.resolve().then(()=>hRt),void 0))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>_e(()=>Promise.resolve().then(()=>yRt),void 0))},{id:"svelte",name:"Svelte",import:(()=>_e(()=>Promise.resolve().then(()=>ERt),void 0))},{id:"swift",name:"Swift",import:(()=>_e(()=>Promise.resolve().then(()=>vRt),void 0))},{id:"system-verilog",name:"SystemVerilog",import:(()=>_e(()=>Promise.resolve().then(()=>_Rt),void 0))},{id:"systemd",name:"Systemd Units",import:(()=>_e(()=>Promise.resolve().then(()=>SRt),void 0))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>_e(()=>Promise.resolve().then(()=>TRt),void 0))},{id:"tasl",name:"Tasl",import:(()=>_e(()=>Promise.resolve().then(()=>LRt),void 0))},{id:"tcl",name:"Tcl",import:(()=>_e(()=>Promise.resolve().then(()=>PRt),void 0))},{id:"templ",name:"Templ",import:(()=>_e(()=>Promise.resolve().then(()=>$Rt),void 0))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>_e(()=>Promise.resolve().then(()=>zRt),void 0))},{id:"tex",name:"TeX",import:(()=>_e(()=>Promise.resolve().then(()=>DNt),void 0))},{id:"toml",name:"TOML",import:(()=>_e(()=>Promise.resolve().then(()=>ZRt),void 0))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>_e(()=>Promise.resolve().then(()=>AMt),void 0))},{id:"tsv",name:"TSV",import:(()=>_e(()=>Promise.resolve().then(()=>uMt),void 0))},{id:"tsx",name:"TSX",import:(()=>_e(()=>Promise.resolve().then(()=>w3t),void 0))},{id:"turtle",name:"Turtle",import:(()=>_e(()=>Promise.resolve().then(()=>iRt),void 0))},{id:"twig",name:"Twig",import:(()=>_e(()=>Promise.resolve().then(()=>mMt),void 0))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>_e(()=>Promise.resolve().then(()=>h3t),void 0))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>_e(()=>Promise.resolve().then(()=>hMt),void 0))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>_e(()=>Promise.resolve().then(()=>CMt),void 0))},{id:"v",name:"V",import:(()=>_e(()=>Promise.resolve().then(()=>BMt),void 0))},{id:"vala",name:"Vala",import:(()=>_e(()=>Promise.resolve().then(()=>IMt),void 0))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>_e(()=>Promise.resolve().then(()=>xMt),void 0))},{id:"verilog",name:"Verilog",import:(()=>_e(()=>Promise.resolve().then(()=>NMt),void 0))},{id:"vhdl",name:"VHDL",import:(()=>_e(()=>Promise.resolve().then(()=>RMt),void 0))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>_e(()=>Promise.resolve().then(()=>OMt),void 0))},{id:"vue",name:"Vue",import:(()=>_e(()=>Promise.resolve().then(()=>KMt),void 0))},{id:"vue-html",name:"Vue HTML",import:(()=>_e(()=>Promise.resolve().then(()=>VMt),void 0))},{id:"vue-vine",name:"Vue Vine",import:(()=>_e(()=>Promise.resolve().then(()=>eLt),void 0))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>_e(()=>Promise.resolve().then(()=>aLt),void 0))},{id:"wasm",name:"WebAssembly",import:(()=>_e(()=>Promise.resolve().then(()=>oLt),void 0))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>_e(()=>Promise.resolve().then(()=>cLt),void 0))},{id:"wgsl",name:"WGSL",import:(()=>_e(()=>Promise.resolve().then(()=>dLt),void 0))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>_e(()=>Promise.resolve().then(()=>gLt),void 0))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>_e(()=>Promise.resolve().then(()=>bLt),void 0))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>_e(()=>Promise.resolve().then(()=>wLt),void 0))},{id:"xml",name:"XML",import:(()=>_e(()=>Promise.resolve().then(()=>JDt),void 0))},{id:"xsl",name:"XSL",import:(()=>_e(()=>Promise.resolve().then(()=>kLt),void 0))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>_e(()=>Promise.resolve().then(()=>XSt),void 0))},{id:"zenscript",name:"ZenScript",import:(()=>_e(()=>Promise.resolve().then(()=>QLt),void 0))},{id:"zig",name:"Zig",import:(()=>_e(()=>Promise.resolve().then(()=>DLt),void 0))}],GXe=Object.fromEntries(Lke.map(t=>[t.id,t.import])),PXe=Object.fromEntries(Lke.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),YK={...GXe,...PXe},qXe=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>NLt),void 0))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>TLt),void 0))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>MLt),void 0))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>OLt),void 0))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>PLt),void 0))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>ULt),void 0))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>jLt),void 0))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>zLt),void 0))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>KLt),void 0))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>WLt),void 0))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>JLt),void 0))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>e7t),void 0))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>n7t),void 0))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>r7t),void 0))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>o7t),void 0))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>A7t),void 0))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>l7t),void 0))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>d7t),void 0))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>m7t),void 0))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>f7t),void 0))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>b7t),void 0))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>C7t),void 0))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>E7t),void 0))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>k7t),void 0))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>I7t),void 0))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>_7t),void 0))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>D7t),void 0))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>N7t),void 0))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>T7t),void 0))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>M7t),void 0))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>O7t),void 0))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>P7t),void 0))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>U7t),void 0))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>j7t),void 0))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>z7t),void 0))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>K7t),void 0))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>W7t),void 0))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>J7t),void 0))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>eOt),void 0))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>nOt),void 0))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>rOt),void 0))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>oOt),void 0))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>AOt),void 0))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>lOt),void 0))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>dOt),void 0))},{id:"red",displayName:"Red",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>mOt),void 0))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>fOt),void 0))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>bOt),void 0))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>COt),void 0))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>EOt),void 0))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>kOt),void 0))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>IOt),void 0))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>_Ot),void 0))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>DOt),void 0))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>NOt),void 0))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>TOt),void 0))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>MOt),void 0))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>OOt),void 0))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>_e(()=>Promise.resolve().then(()=>POt),void 0))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>_e(()=>Promise.resolve().then(()=>UOt),void 0))}],Oke=Object.fromEntries(qXe.map(t=>[t.id,t.import]));class KK extends Error{constructor(e){super(e),this.name="ShikiError"}}function UXe(){return 2147483648}function $Xe(){return typeof performance<"u"?performance.now():Date.now()}const jXe=(t,e)=>t+(e-t%e)%e;async function HXe(t){let e,n;const a={};function r(m){n=m,a.HEAPU8=new Uint8Array(m),a.HEAPU32=new Uint32Array(m)}function i(m,g,h){a.HEAPU8.copyWithin(m,g,g+h)}function o(m){try{return e.grow(m-n.byteLength+65535>>>16),r(e.buffer),1}catch{}}function s(m){const g=a.HEAPU8.length;m=m>>>0;const h=UXe();if(m>h)return!1;for(let b=1;b<=4;b*=2){let y=g*(1+.2/b);y=Math.min(y,m+100663296);const w=Math.min(h,jXe(Math.max(m,y),65536));if(o(w))return!0}return!1}const A=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function l(m,g,h=1024){const b=g+h;let y=g;for(;m[y]&&!(y>=b);)++y;if(y-g>16&&m.buffer&&A)return A.decode(m.subarray(g,y));let w="";for(;g<y;){let E=m[g++];if(!(E&128)){w+=String.fromCharCode(E);continue}const k=m[g++]&63;if((E&224)===192){w+=String.fromCharCode((E&31)<<6|k);continue}const v=m[g++]&63;if((E&240)===224?E=(E&15)<<12|k<<6|v:E=(E&7)<<18|k<<12|v<<6|m[g++]&63,E<65536)w+=String.fromCharCode(E);else{const _=E-65536;w+=String.fromCharCode(55296|_>>10,56320|_&1023)}}return w}function u(m,g){return m?l(a.HEAPU8,m,g):""}const d={emscripten_get_now:$Xe,emscripten_memcpy_big:i,emscripten_resize_heap:s,fd_write:()=>0};async function p(){const g=await t({env:d,wasi_snapshot_preview1:d});e=g.memory,r(e.buffer),Object.assign(a,g),a.UTF8ToString=u}return await p(),a}var zXe=Object.defineProperty,YXe=(t,e,n)=>e in t?zXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fi=(t,e,n)=>YXe(t,typeof e!="symbol"?e+"":e,n);let Vi=null;function KXe(t){throw new KK(t.UTF8ToString(t.getLastOnigError()))}class yS{constructor(e){Fi(this,"utf16Length"),Fi(this,"utf8Length"),Fi(this,"utf16Value"),Fi(this,"utf8Value"),Fi(this,"utf16OffsetToUtf8"),Fi(this,"utf8OffsetToUtf16");const n=e.length,a=yS._utf8ByteLength(e),r=a!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=a);const o=r?new Uint32Array(a+1):null;r&&(o[a]=n);const s=new Uint8Array(a);let A=0;for(let l=0;l<n;l++){const u=e.charCodeAt(l);let d=u,p=!1;if(u>=55296&&u<=56319&&l+1<n){const m=e.charCodeAt(l+1);m>=56320&&m<=57343&&(d=(u-55296<<10)+65536|m-56320,p=!0)}r&&(i[l]=A,p&&(i[l+1]=A),d<=127?o[A+0]=l:d<=2047?(o[A+0]=l,o[A+1]=l):d<=65535?(o[A+0]=l,o[A+1]=l,o[A+2]=l):(o[A+0]=l,o[A+1]=l,o[A+2]=l,o[A+3]=l)),d<=127?s[A++]=d:d<=2047?(s[A++]=192|(d&1984)>>>6,s[A++]=128|(d&63)>>>0):d<=65535?(s[A++]=224|(d&61440)>>>12,s[A++]=128|(d&4032)>>>6,s[A++]=128|(d&63)>>>0):(s[A++]=240|(d&1835008)>>>18,s[A++]=128|(d&258048)>>>12,s[A++]=128|(d&4032)>>>6,s[A++]=128|(d&63)>>>0),p&&l++}this.utf16Length=n,this.utf8Length=a,this.utf16Value=e,this.utf8Value=s,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let n=0;for(let a=0,r=e.length;a<r;a++){const i=e.charCodeAt(a);let o=i,s=!1;if(i>=55296&&i<=56319&&a+1<r){const A=e.charCodeAt(a+1);A>=56320&&A<=57343&&(o=(i-55296<<10)+65536|A-56320,s=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,s&&a++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const CS=class Ol{constructor(e){if(Fi(this,"id",++Ol.LAST_ID),Fi(this,"_onigBinding"),Fi(this,"content"),Fi(this,"utf16Length"),Fi(this,"utf8Length"),Fi(this,"utf16OffsetToUtf8"),Fi(this,"utf8OffsetToUtf16"),Fi(this,"ptr"),!Vi)throw new KK("Must invoke loadWasm first.");this._onigBinding=Vi,this.content=e;const n=new yS(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ol._sharedPtrInUse?(Ol._sharedPtr||(Ol._sharedPtr=Vi.omalloc(1e4)),Ol._sharedPtrInUse=!0,Vi.HEAPU8.set(n.utf8Value,Ol._sharedPtr),this.ptr=Ol._sharedPtr):this.ptr=n.createString(Vi)}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===Ol._sharedPtr?Ol._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Fi(CS,"LAST_ID",0);Fi(CS,"_sharedPtr",0);Fi(CS,"_sharedPtrInUse",!1);let Gke=CS;class ZXe{constructor(e){if(Fi(this,"_onigBinding"),Fi(this,"_ptr"),!Vi)throw new KK("Must invoke loadWasm first.");const n=[],a=[];for(let s=0,A=e.length;s<A;s++){const l=new yS(e[s]);n[s]=l.createString(Vi),a[s]=l.utf8Length}const r=Vi.omalloc(4*e.length);Vi.HEAPU32.set(n,r/4);const i=Vi.omalloc(4*e.length);Vi.HEAPU32.set(a,i/4);const o=Vi.createOnigScanner(r,i,e.length);for(let s=0,A=e.length;s<A;s++)Vi.ofree(n[s]);Vi.ofree(i),Vi.ofree(r),o===0&&KXe(Vi),this._onigBinding=Vi,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,a){let r=0;if(typeof a=="number"&&(r=a),typeof e=="string"){e=new Gke(e);const i=this._findNextMatchSync(e,n,!1,r);return e.dispose(),i}return this._findNextMatchSync(e,n,!1,r)}_findNextMatchSync(e,n,a,r){const i=this._onigBinding,o=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),r);if(o===0)return null;const s=i.HEAPU32;let A=o/4;const l=s[A++],u=s[A++],d=[];for(let p=0;p<u;p++){const m=e.convertUtf8OffsetToUtf16(s[A++]),g=e.convertUtf8OffsetToUtf16(s[A++]);d[p]={start:m,end:g,length:g-m}}return{index:l,captureIndices:d}}}function WXe(t){return typeof t.instantiator=="function"}function VXe(t){return typeof t.default=="function"}function JXe(t){return typeof t.data<"u"}function XXe(t){return typeof Response<"u"&&t instanceof Response}function eet(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let $Q;function tet(t){if($Q)return $Q;async function e(){Vi=await HXe(async n=>{let a=t;return a=await a,typeof a=="function"&&(a=await a(n)),typeof a=="function"&&(a=await a(n)),WXe(a)?a=await a.instantiator(n):VXe(a)?a=await a.default(n):(JXe(a)&&(a=a.data),XXe(a)?typeof WebAssembly.instantiateStreaming=="function"?a=await net(a)(n):a=await aet(a)(n):eet(a)?a=await $T(a)(n):a instanceof WebAssembly.Module?a=await $T(a)(n):"default"in a&&a.default instanceof WebAssembly.Module&&(a=await $T(a.default)(n))),"instance"in a&&(a=a.instance),"exports"in a&&(a=a.exports),a})}return $Q=e(),$Q}function $T(t){return e=>WebAssembly.instantiate(t,e)}function net(t){return e=>WebAssembly.instantiateStreaming(t,e)}function aet(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function ret(t){return t&&await tet(t),{createScanner(e){return new ZXe(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Gke(e)}}}const Pke=OXe({langs:YK,themes:Oke,engine:()=>ret(_e(()=>Promise.resolve().then(()=>jOt),void 0))});function w1(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function iet(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}const ZK=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),eo=String.raw;function E1(t,e){if(t==null)throw new Error(e??"Value expected");return t}const qke=eo`\[\^?`,Uke=`c.? | C(?:-.?)?|${eo`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${eo`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${eo`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${eo`o\{[^\}]*\}?`}|${eo`\d{1,3}`}`,WK=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,jQ=new RegExp(eo`
70
70
  \\ (?:
71
- ${Pke}
71
+ ${Uke}
72
72
  | [gk]<[^>]*>?
73
73
  | [gk]'[^']*'?
74
74
  | .
@@ -85,20 +85,20 @@ Error generating stack: `+S.message+`
85
85
  )?
86
86
  | \*[^\)]*\)?
87
87
  )?
88
- | (?:${YK.source})+
89
- | ${Gke}
88
+ | (?:${WK.source})+
89
+ | ${qke}
90
90
  | .
91
91
  `.replace(/\s+/g,""),"gsu"),jT=new RegExp(eo`
92
92
  \\ (?:
93
- ${Pke}
93
+ ${Uke}
94
94
  | .
95
95
  )
96
96
  | \[:(?:\^?\p{Alpha}+|\^):\]
97
- | ${Gke}
97
+ | ${qke}
98
98
  | &&
99
99
  | .
100
- `.replace(/\s+/g,""),"gsu");function tet(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 a=wet(n.flags),r=[a.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(d){r.push(d)},replaceCurrentModX(d){r[r.length-1]=d},singleline:n.rules.singleline};let o=[],s;for(jQ.lastIndex=0;s=jQ.exec(t);){const d=net(i,t,s[0],jQ.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(jQ.lastIndex=d.lastIndex)}const A=[];let l=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++l:d.raw==="("&&A.push(d)}),l||A.forEach((d,p)=>{d.kind="capturing",d.number=p+1});const u=l||A.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?Bet(d,u):d).flat(),flags:a}}function net(t,e,n,a){const[r,i]=n;if(n==="["||n==="[^"){const o=aet(e,n,a);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(i))return{token:Sie(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:met(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Uke(n)}}if(i==="K")return{token:$ke("keep",n)};if(i==="N"||i==="R")return{token:Qf("newline",n,{negate:i==="N"})};if(i==="O")return{token:Qf("any",n)};if(i==="X")return{token:Qf("text_segment",n)};const o=qke(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(r==="("){if(i==="*")return{token:bet(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[a]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:a+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:het(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:Cb("group",n)};if(n==="(?>")return{token:Cb("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Cb(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&t.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Cb("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Cb("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:uet(n)}}if(t.getCurrentModX()){if(n==="#"){const o=e.indexOf(`
101
- `,a);return{lastIndex:o===-1?e.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=a,{lastIndex:o.exec(e)?o.lastIndex:a}}}if(n===".")return{token:Qf("dot",n)};if(n==="^"||n==="$"){const o=t.singleline?{"^":eo`\A`,$:eo`\Z`}[n]:n;return{token:Sie(o,n)}}return n==="|"?{token:iet(n)}:YK.test(n)?{tokens:ket(n)}:{token:Qd(w1(n),n)}}function aet(t,e,n){const a=[Nie(e[1]==="^",e)];let r=1,i;for(jT.lastIndex=n;i=jT.exec(t);){const o=i[0];if(o[0]==="["&&o[1]!==":")r++,a.push(Nie(o[1]==="^",o));else if(o==="]"){if(a.at(-1).type==="CharacterClassOpen")a.push(Qd(93,o));else if(r--,a.push(oet(o)),!r)break}else{const s=ret(o);Array.isArray(s)?a.push(...s):a.push(s)}}return{tokens:a,lastIndex:jT.lastIndex||t.length}}function ret(t){if(t[0]==="\\")return qke(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!zK.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return Qf("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?set(t):t==="&&"?Aet(t):Qd(w1(t),t)}function qke(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return fet(t);if("dDhHsSwW".includes(n))return yet(t);if(t.startsWith(eo`\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 Cet(t)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(t))try{const a=t.split(/\\x/).slice(1).map(o=>parseInt(o,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(a)),i=new TextEncoder;return[...r].map(o=>{const s=[...i.encode(o)].map(A=>`\\x${A.toString(16)}`).join("");return Qd(w1(o),s)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Qd(Eet(t),t);if(Fie.has(n))return Qd(Fie.get(n),t);if(/\d/.test(n))return cet(e,t);if(t==="\\")throw new Error(eo`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return Qd(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function iet(t){return{type:"Alternator",raw:t}}function Sie(t,e){return{type:"Assertion",kind:t,raw:e}}function Uke(t){return{type:"Backreference",raw:t}}function Qd(t,e){return{type:"Character",value:t,raw:e}}function oet(t){return{type:"CharacterClassClose",raw:t}}function set(t){return{type:"CharacterClassHyphen",raw:t}}function Aet(t){return{type:"CharacterClassIntersector",raw:t}}function Nie(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function Qf(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function $ke(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:E1(n.flags),raw:e}}function cet(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function uet(t){return{type:"GroupClose",raw:t}}function Cb(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function det(t,e,n,a){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:a}}function pet(t,e,n,a){return{type:"Quantifier",kind:t,min:e,max:n,raw:a}}function met(t){return{type:"Subroutine",raw:t}}const get=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Fie=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function fet(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 Qd(w1(e.toUpperCase())-64,t)}function het(t,e){let{on:n,off:a}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;a??="";const r=(e.getCurrentModX()||n.includes("x"))&&!a.includes("x"),i=Rie(n),o=Rie(a),s={};if(i&&(s.enable=i),o&&(s.disable=o),t.endsWith(")"))return e.replaceCurrentModX(r),$ke("flags",t,{flags:s});if(t.endsWith(":"))return e.pushModX(r),e.numOpenGroups++,Cb("group",t,{...(i||o)&&{flags:s}});throw new Error(`Unexpected flag modifier "${t}"`)}function bet(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:n,tag:a,args:r}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(a==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const i=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[o,s,A]=i,l=get.has(n)?n.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);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(i.length===2&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);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 s=="number"||!/^(?:[<>!=]=|[<>])$/.test(s))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof A=="string"&&!/^[A-Za-z_]\w*$/.test(A))throw new Error(`Named callout argument three must be a tag or number "${A}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return det(l,a??null,r?.split(",")??null,t)}function Tie(t){let e=null,n,a;if(t[0]==="{"){const{minStr:r,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,o=1e5;if(+r>o||i&&+i>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,a=i===void 0?+r:i===""?1/0:+i,n>a&&(e="possessive",[n,a]=[a,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,a=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return pet(e,n,a,t)}function yet(t){const e=t[1].toLowerCase();return Qf({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function Cet(t){const{p:e,neg:n,value:a}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return Qf("property",t,{value:a,negate:e==="P"&&!n||e==="p"&&!!n})}function Rie(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 wet(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<t.length;n++){const a=t[n];if(!"imxDPSWy".includes(a))throw new Error(`Invalid flag "${a}"`);if(a==="y"){if(!/^y{[gw]}/.test(t.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[n+2]==="g"?"grapheme":"word",n+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[a]]=!0}return e}function Eet(t){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function Bet(t,e){const{raw:n,inCharClass:a}=t,r=n.slice(1);if(!a&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=e))return[Uke(n)];const i=[],o=r.match(/^[0-7]+|\d/g);for(let s=0;s<o.length;s++){const A=o[s];let l;if(s===0&&A!=="8"&&A!=="9"){if(l=parseInt(A,8),l>127)throw new Error(eo`Octal encoded byte above 177 unsupported "${n}"`)}else l=w1(A);i.push(Qd(l,(s===0?"\\":"")+A))}return i}function ket(t){const e=[],n=new RegExp(YK,"gy");let a;for(;a=n.exec(t);){const r=a[0];if(r[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(i){const{min:o,max:s}=i.groups;if(+o>+s&&r.endsWith("?")){n.lastIndex--,e.push(Tie(r.slice(0,-1)));continue}}}e.push(Tie(r))}return e}function jke(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(a=>e[a]===n[a])}function vet(t){return Iet.has(t.type)}const Iet=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Hke(t,e={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},a=tet(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(p,m)=>{const g=a.tokens[i.nextIndex];switch(i.parent=p,i.nextIndex++,g.type){case"Alternator":return Zf();case"Assertion":return Qet(g);case"Backreference":return _et(g,i);case"Character":return CS(g.value,{useLastValid:!!m.isCheckingRangeEnd});case"CharacterClassHyphen":return xet(g,i,m);case"CharacterClassOpen":return Det(g,i,m);case"CharacterSet":return Net(g,i);case"Directive":return Oet(g.kind,{flags:g.flags});case"GroupOpen":return Fet(g,i,m);case"NamedCallout":return Pet(g.kind,g.tag,g.arguments);case"Quantifier":return Tet(g,i);case"Subroutine":return Ret(g,i);default:throw new Error(`Unexpected token type "${g.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},o=Uet(Get(a.flags));let s=o.body[0];for(;i.nextIndex<a.tokens.length;){const p=r(s,{});p.type==="Alternative"?(o.body.push(p),s=p):s.body.push(p)}const{capturingGroups:A,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=i;if(l&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:p}of d)if(typeof p=="number"){if(p>A.length)throw new Error("Subroutine uses a group number that's not defined");p&&(A[p-1].isSubroutined=!0)}else if(u.has(p)){if(u.get(p).length>1)throw new Error(eo`Subroutine uses a duplicate group name "\g<${p}>"`);u.get(p)[0].isSubroutined=!0}else throw new Error(eo`Subroutine uses a group name that's not defined "\g<${p}>"`);return o}function Qet({kind:t}){return N$(E1({"^":"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===eo`\B`||t===eo`\Y`})}function _et({raw:t},e){const n=/^\\k[<']/.test(t),a=n?t.slice(3,-1):t.slice(1),r=(i,o=!1)=>{const s=e.capturingGroups.length;let A=!1;if(i>s)if(e.skipBackrefValidation)A=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,F$(o?s+1-i:i,{orphan:A})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);if(i)return r(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(a))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(a))throw new Error(`Group name not defined to the left "${t}"`);return F$(a)}return r(+a)}function xet(t,e,n){const{tokens:a,walk:r}=e,i=e.parent,o=i.body.at(-1),s=a[e.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&s&&s.type!=="CharacterClassOpen"&&s.type!=="CharacterClassClose"&&s.type!=="CharacterClassIntersector"){const A=r(i,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&A.type==="Character")return i.body.pop(),Let(o,A);throw new Error("Invalid character class range")}return CS(w1("-"))}function Det({negate:t},e,n){const{tokens:a,walk:r}=e,i=a[e.nextIndex],o=[Dx()];let s=Oie(i);for(;s.type!=="CharacterClassClose";){if(s.type==="CharacterClassIntersector")o.push(Dx()),e.nextIndex++;else{const l=o.at(-1);l.body.push(r(l,n))}s=Oie(a[e.nextIndex],i)}const A=Dx({negate:t});return o.length===1?A.body=o[0].body:(A.kind="intersection",A.body=o.map(l=>l.body.length===1?l.body[0]:l)),e.nextIndex++,A}function Net({kind:t,negate:e,value:n},a){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:o}=a;if(t==="property"){const s=wS(n);if(zK.has(s)&&!o?.has(s))t="posix",n=s;else return wb(n,{negate:e,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:o})}return t==="posix"?qet(n,{negate:e}):T$(t,{negate:e})}function Fet(t,e,n){const{tokens:a,capturingGroups:r,namedGroupsByName:i,skipLookbehindValidation:o,walk:s}=e,A=$et(t),l=A.type==="AbsenceFunction",u=Lie(A),d=u&&A.negate;if(A.type==="CapturingGroup"&&(r.push(A),A.name&&eet(i,A.name,[]).push(A)),l&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let p=Gie(a[e.nextIndex]);for(;p.type!=="GroupClose";){if(p.type==="Alternator")A.body.push(Zf()),e.nextIndex++;else{const m=A.body.at(-1),g=s(m,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(m.body.push(g),(u||n.isInLookbehind)&&!o){const h="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(Mie(g)||g.type==="CapturingGroup")throw new Error(h)}else if(Mie(g)||Lie(g)&&g.negate)throw new Error(h)}}p=Gie(a[e.nextIndex])}return e.nextIndex++,A}function Tet({kind:t,min:e,max:n},a){const r=a.parent,i=r.body.at(-1);if(!i||!vet(i))throw new Error("Quantifier requires a repeatable token");const o=Yke(t,e,n,i);return r.body.pop(),o}function Ret({raw:t},e){const{capturingGroups:n,subroutines:a}=e;let r=t.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(i){const s=+i.groups.num,A=n.length;if(e.hasNumberedRef=!0,r={"":s,"+":A+s,"-":A+1-s}[i.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const o=Kke(r);return a.push(o),o}function Met(t,e){return{type:"AbsenceFunction",kind:t,body:Av(e?.body)}}function Zf(t){return{type:"Alternative",body:Zke(t?.body)}}function N$(t,e){const n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!e?.negate),n}function F$(t,e){const n=!!e?.orphan;return{type:"Backreference",ref:t,...n&&{orphan:n}}}function zke(t,e){const n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!jet(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:Av(e?.body)}}function CS(t,e){const n={useLastValid:!1,...e};if(t>1114111){const a=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${a}}"`):new Error(`Invalid code point out of range in JS "\\x{${a}}"`)}return{type:"Character",value:t}}function Dx(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Zke(t?.body)}}function Let(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function T$(t,e){const n=!!e?.negate,a={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(a.negate=n),(t==="text_segment"||t==="newline"&&!n)&&(a.variableLength=!0),a}function Oet(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:E1(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function Get(t){return{type:"Flags",...t}}function Xc(t){const e=t?.atomic,n=t?.flags;if(e&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...n&&{flags:n},body:Av(t?.body)}}function yf(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Av(t?.body)}}function Pet(t,e,n){return{type:"NamedCallout",kind:t,tag:e,arguments:n}}function qet(t,e){const n=!!e?.negate;if(!zK.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:n}}function Yke(t,e,n,a){if(e>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:a}}function Uet(t,e){return{type:"Regex",body:Av(e?.body),flags:t}}function Kke(t){return{type:"Subroutine",ref:t}}function wb(t,e){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let a=n.unicodePropertyMap?.get(wS(t));if(!a){if(n.normalizeUnknownPropertyNames)a=Het(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(eo`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:a??t,negate:n.negate}}function $et({flags:t,kind:e,name:n,negate:a,number:r}){switch(e){case"absence_repeater":return Met("repeater");case"atomic":return Xc({atomic:!0});case"capturing":return zke(r,{name:n});case"group":return Xc({flags:t});case"lookahead":case"lookbehind":return yf({behind:e==="lookbehind",negate:a});default:throw new Error(`Unexpected group kind "${e}"`)}}function Av(t){if(t===void 0)t=[Zf()];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 Zke(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 Mie(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Lie(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function jet(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function Het(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 wS(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Oie(t,e){return E1(t,`${e?.type==="Character"&&e.value===93?"Empty":"Unclosed"} character class`)}function Gie(t){return E1(t,"Unclosed group")}function ZE(t,e,n=null){function a(i,o){for(let s=0;s<i.length;s++){const A=r(i[s],o,s,i);s=Math.max(-1,s+A)}}function r(i,o=null,s=null,A=null){let l=0,u=!1;const d={node:i,parent:o,key:s,container:A,root:t,remove(){HQ(A).splice(Math.max(0,Jh(s)+l),1),l--,u=!0},removeAllNextSiblings(){return HQ(A).splice(Jh(s)+1)},removeAllPrevSiblings(){const y=Jh(s)+l;return l-=y,HQ(A).splice(0,Math.max(0,y))},replaceWith(y,w={}){const E=!!w.traverse;A?A[Math.max(0,Jh(s)+l)]=y:E1(o,"Can't replace root node")[s]=y,E&&r(y,o,s,A),u=!0},replaceWithMultiple(y,w={}){const E=!!w.traverse;if(HQ(A).splice(Math.max(0,Jh(s)+l),1,...y),l+=y.length-1,E){let k=0;for(let v=0;v<y.length;v++)k+=r(y[v],o,Jh(s)+v+k,A)}u=!0},skip(){u=!0}},{type:p}=i,m=e["*"],g=e[p],h=typeof m=="function"?m:m?.enter,b=typeof g=="function"?g:g?.enter;if(h?.(d,n),b?.(d,n),!u)switch(p){case"AbsenceFunction":case"CapturingGroup":case"Group":a(i.body,i);break;case"Alternative":case"CharacterClass":a(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(i.min,i,"min"),r(i.max,i,"max");break;case"LookaroundAssertion":a(i.body,i);break;case"Quantifier":r(i.body,i,"body");break;case"Regex":a(i.body,i),r(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${p}"`)}return g?.exit?.(d,n),m?.exit?.(d,n),l}return r(t),t}function HQ(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function Jh(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const zet=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Yet(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function Ket(t,e,n,a){return t.slice(0,e)+a+t.slice(e+n.length)}const fc=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function KK(t,e,n,a){const r=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let o=0,s="";for(const A of t.matchAll(r)){const{0:l,groups:{$skip:u}}=A;if(!u&&(!a||a===fc.DEFAULT==!o)){n instanceof Function?s+=n(A,{context:o?fc.CHAR_CLASS:fc.DEFAULT,negated:i[i.length-1]}):s+=n;continue}l[0]==="["?(o++,i.push(l[1]==="^")):l==="]"&&o&&(o--,i.pop()),s+=l}return s}function Wke(t,e,n,a){KK(t,e,n,a)}function Zet(t,e,n=0,a){if(!new RegExp(e,"su").test(t))return null;const r=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let i=0,o;for(;o=r.exec(t);){const{0:s,groups:{$skip:A}}=o;if(!A&&(!a||a===fc.DEFAULT==!i))return o;s==="["?i++:s==="]"&&i&&i--,r.lastIndex==o.index&&r.lastIndex++}return null}function zQ(t,e,n){return!!Zet(t,e,0,n)}function Wet(t,e){const n=/\\?./gsu;n.lastIndex=e;let a=t.length,r=0,i=1,o;for(;o=n.exec(t);){const[s]=o;if(s==="[")r++;else if(r)s==="]"&&r--;else if(s==="(")i++;else if(s===")"&&(i--,!i)){a=o.index;break}}return t.slice(e,a)}const Pie=new RegExp(String.raw`(?<noncapturingStart>${zet})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Vet(t,e){const n=e?.hiddenCaptures??[];let a=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:a,hiddenCaptures:n};const r="(?>",i="(?:(?=(",o=[0],s=[];let A=0,l=0,u=NaN,d;do{d=!1;let p=0,m=0,g=!1,h;for(Pie.lastIndex=Number.isNaN(u)?0:u+i.length;h=Pie.exec(t);){const{0:b,index:y,groups:{capturingStart:w,noncapturingStart:E}}=h;if(b==="[")p++;else if(p)b==="]"&&p--;else if(b===r&&!g)u=y,g=!0;else if(g&&E)m++;else if(w)g?m++:(A++,o.push(A+l));else if(b===")"&&g){if(!m){l++;const k=A+l;if(t=`${t.slice(0,u)}${i}${t.slice(u+r.length,y)}))<$$${k}>)${t.slice(y+1)}`,d=!0,s.push(k),Yet(n,k),a.size){const v=new Map;a.forEach((_,I)=>{v.set(I>=k?I+1:I,_.map(x=>x>=k?x+1:x))}),a=v}break}m--}}}while(d);return n.push(...s),t=KK(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:p,groups:{backrefNum:m,wrappedBackrefNum:g}})=>{if(m){const h=+m;if(h>o.length-1)throw new Error(`Backref "${p}" greater than number of captures`);return`\\${o[h]}`}return`\\${g}`},fc.DEFAULT),{pattern:t,captureTransfers:a,hiddenCaptures:n}}const Vke=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,HT=new RegExp(String.raw`
100
+ `.replace(/\s+/g,""),"gsu");function oet(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 a=Iet(n.flags),r=[a.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(d){r.push(d)},replaceCurrentModX(d){r[r.length-1]=d},singleline:n.rules.singleline};let o=[],s;for(jQ.lastIndex=0;s=jQ.exec(t);){const d=set(i,t,s[0],jQ.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(jQ.lastIndex=d.lastIndex)}const A=[];let l=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++l:d.raw==="("&&A.push(d)}),l||A.forEach((d,p)=>{d.kind="capturing",d.number=p+1});const u=l||A.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?_et(d,u):d).flat(),flags:a}}function set(t,e,n,a){const[r,i]=n;if(n==="["||n==="[^"){const o=Aet(e,n,a);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(i))return{token:Sie(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:yet(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:jke(n)}}if(i==="K")return{token:Hke("keep",n)};if(i==="N"||i==="R")return{token:Qf("newline",n,{negate:i==="N"})};if(i==="O")return{token:Qf("any",n)};if(i==="X")return{token:Qf("text_segment",n)};const o=$ke(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(r==="("){if(i==="*")return{token:Bet(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[a]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:a+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Eet(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:Cb("group",n)};if(n==="(?>")return{token:Cb("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Cb(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&t.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Cb("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Cb("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:fet(n)}}if(t.getCurrentModX()){if(n==="#"){const o=e.indexOf(`
101
+ `,a);return{lastIndex:o===-1?e.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=a,{lastIndex:o.exec(e)?o.lastIndex:a}}}if(n===".")return{token:Qf("dot",n)};if(n==="^"||n==="$"){const o=t.singleline?{"^":eo`\A`,$:eo`\Z`}[n]:n;return{token:Sie(o,n)}}return n==="|"?{token:uet(n)}:WK.test(n)?{tokens:xet(n)}:{token:Qd(w1(n),n)}}function Aet(t,e,n){const a=[Nie(e[1]==="^",e)];let r=1,i;for(jT.lastIndex=n;i=jT.exec(t);){const o=i[0];if(o[0]==="["&&o[1]!==":")r++,a.push(Nie(o[1]==="^",o));else if(o==="]"){if(a.at(-1).type==="CharacterClassOpen")a.push(Qd(93,o));else if(r--,a.push(det(o)),!r)break}else{const s=cet(o);Array.isArray(s)?a.push(...s):a.push(s)}}return{tokens:a,lastIndex:jT.lastIndex||t.length}}function cet(t){if(t[0]==="\\")return $ke(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!ZK.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return Qf("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?pet(t):t==="&&"?met(t):Qd(w1(t),t)}function $ke(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return wet(t);if("dDhHsSwW".includes(n))return ket(t);if(t.startsWith(eo`\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 vet(t)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(t))try{const a=t.split(/\\x/).slice(1).map(o=>parseInt(o,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(a)),i=new TextEncoder;return[...r].map(o=>{const s=[...i.encode(o)].map(A=>`\\x${A.toString(16)}`).join("");return Qd(w1(o),s)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Qd(Qet(t),t);if(Fie.has(n))return Qd(Fie.get(n),t);if(/\d/.test(n))return get(e,t);if(t==="\\")throw new Error(eo`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return Qd(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function uet(t){return{type:"Alternator",raw:t}}function Sie(t,e){return{type:"Assertion",kind:t,raw:e}}function jke(t){return{type:"Backreference",raw:t}}function Qd(t,e){return{type:"Character",value:t,raw:e}}function det(t){return{type:"CharacterClassClose",raw:t}}function pet(t){return{type:"CharacterClassHyphen",raw:t}}function met(t){return{type:"CharacterClassIntersector",raw:t}}function Nie(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function Qf(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function Hke(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:E1(n.flags),raw:e}}function get(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function fet(t){return{type:"GroupClose",raw:t}}function Cb(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function het(t,e,n,a){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:a}}function bet(t,e,n,a){return{type:"Quantifier",kind:t,min:e,max:n,raw:a}}function yet(t){return{type:"Subroutine",raw:t}}const Cet=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Fie=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function wet(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 Qd(w1(e.toUpperCase())-64,t)}function Eet(t,e){let{on:n,off:a}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;a??="";const r=(e.getCurrentModX()||n.includes("x"))&&!a.includes("x"),i=Rie(n),o=Rie(a),s={};if(i&&(s.enable=i),o&&(s.disable=o),t.endsWith(")"))return e.replaceCurrentModX(r),Hke("flags",t,{flags:s});if(t.endsWith(":"))return e.pushModX(r),e.numOpenGroups++,Cb("group",t,{...(i||o)&&{flags:s}});throw new Error(`Unexpected flag modifier "${t}"`)}function Bet(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:n,tag:a,args:r}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(a==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const i=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[o,s,A]=i,l=Cet.has(n)?n.toLowerCase():"custom";switch(l){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);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(i.length===2&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);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 s=="number"||!/^(?:[<>!=]=|[<>])$/.test(s))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof A=="string"&&!/^[A-Za-z_]\w*$/.test(A))throw new Error(`Named callout argument three must be a tag or number "${A}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${l}"`)}return het(l,a??null,r?.split(",")??null,t)}function Tie(t){let e=null,n,a;if(t[0]==="{"){const{minStr:r,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,o=1e5;if(+r>o||i&&+i>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,a=i===void 0?+r:i===""?1/0:+i,n>a&&(e="possessive",[n,a]=[a,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,a=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return bet(e,n,a,t)}function ket(t){const e=t[1].toLowerCase();return Qf({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function vet(t){const{p:e,neg:n,value:a}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return Qf("property",t,{value:a,negate:e==="P"&&!n||e==="p"&&!!n})}function Rie(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 Iet(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<t.length;n++){const a=t[n];if(!"imxDPSWy".includes(a))throw new Error(`Invalid flag "${a}"`);if(a==="y"){if(!/^y{[gw]}/.test(t.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[n+2]==="g"?"grapheme":"word",n+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[a]]=!0}return e}function Qet(t){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function _et(t,e){const{raw:n,inCharClass:a}=t,r=n.slice(1);if(!a&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=e))return[jke(n)];const i=[],o=r.match(/^[0-7]+|\d/g);for(let s=0;s<o.length;s++){const A=o[s];let l;if(s===0&&A!=="8"&&A!=="9"){if(l=parseInt(A,8),l>127)throw new Error(eo`Octal encoded byte above 177 unsupported "${n}"`)}else l=w1(A);i.push(Qd(l,(s===0?"\\":"")+A))}return i}function xet(t){const e=[],n=new RegExp(WK,"gy");let a;for(;a=n.exec(t);){const r=a[0];if(r[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(i){const{min:o,max:s}=i.groups;if(+o>+s&&r.endsWith("?")){n.lastIndex--,e.push(Tie(r.slice(0,-1)));continue}}}e.push(Tie(r))}return e}function zke(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(a=>e[a]===n[a])}function Det(t){return Net.has(t.type)}const Net=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Yke(t,e={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},a=oet(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(p,m)=>{const g=a.tokens[i.nextIndex];switch(i.parent=p,i.nextIndex++,g.type){case"Alternator":return Zf();case"Assertion":return Fet(g);case"Backreference":return Tet(g,i);case"Character":return wS(g.value,{useLastValid:!!m.isCheckingRangeEnd});case"CharacterClassHyphen":return Ret(g,i,m);case"CharacterClassOpen":return Met(g,i,m);case"CharacterSet":return Let(g,i);case"Directive":return $et(g.kind,{flags:g.flags});case"GroupOpen":return Oet(g,i,m);case"NamedCallout":return Het(g.kind,g.tag,g.arguments);case"Quantifier":return Get(g,i);case"Subroutine":return Pet(g,i);default:throw new Error(`Unexpected token type "${g.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},o=Yet(jet(a.flags));let s=o.body[0];for(;i.nextIndex<a.tokens.length;){const p=r(s,{});p.type==="Alternative"?(o.body.push(p),s=p):s.body.push(p)}const{capturingGroups:A,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=i;if(l&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:p}of d)if(typeof p=="number"){if(p>A.length)throw new Error("Subroutine uses a group number that's not defined");p&&(A[p-1].isSubroutined=!0)}else if(u.has(p)){if(u.get(p).length>1)throw new Error(eo`Subroutine uses a duplicate group name "\g<${p}>"`);u.get(p)[0].isSubroutined=!0}else throw new Error(eo`Subroutine uses a group name that's not defined "\g<${p}>"`);return o}function Fet({kind:t}){return N$(E1({"^":"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===eo`\B`||t===eo`\Y`})}function Tet({raw:t},e){const n=/^\\k[<']/.test(t),a=n?t.slice(3,-1):t.slice(1),r=(i,o=!1)=>{const s=e.capturingGroups.length;let A=!1;if(i>s)if(e.skipBackrefValidation)A=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,F$(o?s+1-i:i,{orphan:A})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);if(i)return r(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(a))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(a))throw new Error(`Group name not defined to the left "${t}"`);return F$(a)}return r(+a)}function Ret(t,e,n){const{tokens:a,walk:r}=e,i=e.parent,o=i.body.at(-1),s=a[e.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&s&&s.type!=="CharacterClassOpen"&&s.type!=="CharacterClassClose"&&s.type!=="CharacterClassIntersector"){const A=r(i,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&A.type==="Character")return i.body.pop(),Uet(o,A);throw new Error("Invalid character class range")}return wS(w1("-"))}function Met({negate:t},e,n){const{tokens:a,walk:r}=e,i=a[e.nextIndex],o=[Dx()];let s=Oie(i);for(;s.type!=="CharacterClassClose";){if(s.type==="CharacterClassIntersector")o.push(Dx()),e.nextIndex++;else{const l=o.at(-1);l.body.push(r(l,n))}s=Oie(a[e.nextIndex],i)}const A=Dx({negate:t});return o.length===1?A.body=o[0].body:(A.kind="intersection",A.body=o.map(l=>l.body.length===1?l.body[0]:l)),e.nextIndex++,A}function Let({kind:t,negate:e,value:n},a){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:o}=a;if(t==="property"){const s=ES(n);if(ZK.has(s)&&!o?.has(s))t="posix",n=s;else return wb(n,{negate:e,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:i,unicodePropertyMap:o})}return t==="posix"?zet(n,{negate:e}):T$(t,{negate:e})}function Oet(t,e,n){const{tokens:a,capturingGroups:r,namedGroupsByName:i,skipLookbehindValidation:o,walk:s}=e,A=Ket(t),l=A.type==="AbsenceFunction",u=Lie(A),d=u&&A.negate;if(A.type==="CapturingGroup"&&(r.push(A),A.name&&iet(i,A.name,[]).push(A)),l&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let p=Gie(a[e.nextIndex]);for(;p.type!=="GroupClose";){if(p.type==="Alternator")A.body.push(Zf()),e.nextIndex++;else{const m=A.body.at(-1),g=s(m,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(m.body.push(g),(u||n.isInLookbehind)&&!o){const h="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(Mie(g)||g.type==="CapturingGroup")throw new Error(h)}else if(Mie(g)||Lie(g)&&g.negate)throw new Error(h)}}p=Gie(a[e.nextIndex])}return e.nextIndex++,A}function Get({kind:t,min:e,max:n},a){const r=a.parent,i=r.body.at(-1);if(!i||!Det(i))throw new Error("Quantifier requires a repeatable token");const o=Zke(t,e,n,i);return r.body.pop(),o}function Pet({raw:t},e){const{capturingGroups:n,subroutines:a}=e;let r=t.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(i){const s=+i.groups.num,A=n.length;if(e.hasNumberedRef=!0,r={"":s,"+":A+s,"-":A+1-s}[i.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const o=Wke(r);return a.push(o),o}function qet(t,e){return{type:"AbsenceFunction",kind:t,body:Av(e?.body)}}function Zf(t){return{type:"Alternative",body:Vke(t?.body)}}function N$(t,e){const n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!e?.negate),n}function F$(t,e){const n=!!e?.orphan;return{type:"Backreference",ref:t,...n&&{orphan:n}}}function Kke(t,e){const n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!Zet(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:Av(e?.body)}}function wS(t,e){const n={useLastValid:!1,...e};if(t>1114111){const a=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${a}}"`):new Error(`Invalid code point out of range in JS "\\x{${a}}"`)}return{type:"Character",value:t}}function Dx(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Vke(t?.body)}}function Uet(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function T$(t,e){const n=!!e?.negate,a={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(a.negate=n),(t==="text_segment"||t==="newline"&&!n)&&(a.variableLength=!0),a}function $et(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:E1(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function jet(t){return{type:"Flags",...t}}function Xc(t){const e=t?.atomic,n=t?.flags;if(e&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...n&&{flags:n},body:Av(t?.body)}}function yf(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Av(t?.body)}}function Het(t,e,n){return{type:"NamedCallout",kind:t,tag:e,arguments:n}}function zet(t,e){const n=!!e?.negate;if(!ZK.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:n}}function Zke(t,e,n,a){if(e>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:a}}function Yet(t,e){return{type:"Regex",body:Av(e?.body),flags:t}}function Wke(t){return{type:"Subroutine",ref:t}}function wb(t,e){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let a=n.unicodePropertyMap?.get(ES(t));if(!a){if(n.normalizeUnknownPropertyNames)a=Wet(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(eo`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:a??t,negate:n.negate}}function Ket({flags:t,kind:e,name:n,negate:a,number:r}){switch(e){case"absence_repeater":return qet("repeater");case"atomic":return Xc({atomic:!0});case"capturing":return Kke(r,{name:n});case"group":return Xc({flags:t});case"lookahead":case"lookbehind":return yf({behind:e==="lookbehind",negate:a});default:throw new Error(`Unexpected group kind "${e}"`)}}function Av(t){if(t===void 0)t=[Zf()];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 Vke(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 Mie(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Lie(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function Zet(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function Wet(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 ES(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Oie(t,e){return E1(t,`${e?.type==="Character"&&e.value===93?"Empty":"Unclosed"} character class`)}function Gie(t){return E1(t,"Unclosed group")}function ZE(t,e,n=null){function a(i,o){for(let s=0;s<i.length;s++){const A=r(i[s],o,s,i);s=Math.max(-1,s+A)}}function r(i,o=null,s=null,A=null){let l=0,u=!1;const d={node:i,parent:o,key:s,container:A,root:t,remove(){HQ(A).splice(Math.max(0,Jh(s)+l),1),l--,u=!0},removeAllNextSiblings(){return HQ(A).splice(Jh(s)+1)},removeAllPrevSiblings(){const y=Jh(s)+l;return l-=y,HQ(A).splice(0,Math.max(0,y))},replaceWith(y,w={}){const E=!!w.traverse;A?A[Math.max(0,Jh(s)+l)]=y:E1(o,"Can't replace root node")[s]=y,E&&r(y,o,s,A),u=!0},replaceWithMultiple(y,w={}){const E=!!w.traverse;if(HQ(A).splice(Math.max(0,Jh(s)+l),1,...y),l+=y.length-1,E){let k=0;for(let v=0;v<y.length;v++)k+=r(y[v],o,Jh(s)+v+k,A)}u=!0},skip(){u=!0}},{type:p}=i,m=e["*"],g=e[p],h=typeof m=="function"?m:m?.enter,b=typeof g=="function"?g:g?.enter;if(h?.(d,n),b?.(d,n),!u)switch(p){case"AbsenceFunction":case"CapturingGroup":case"Group":a(i.body,i);break;case"Alternative":case"CharacterClass":a(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(i.min,i,"min"),r(i.max,i,"max");break;case"LookaroundAssertion":a(i.body,i);break;case"Quantifier":r(i.body,i,"body");break;case"Regex":a(i.body,i),r(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${p}"`)}return g?.exit?.(d,n),m?.exit?.(d,n),l}return r(t),t}function HQ(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function Jh(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const Vet=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Jet(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function Xet(t,e,n,a){return t.slice(0,e)+a+t.slice(e+n.length)}const fc=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function VK(t,e,n,a){const r=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let o=0,s="";for(const A of t.matchAll(r)){const{0:l,groups:{$skip:u}}=A;if(!u&&(!a||a===fc.DEFAULT==!o)){n instanceof Function?s+=n(A,{context:o?fc.CHAR_CLASS:fc.DEFAULT,negated:i[i.length-1]}):s+=n;continue}l[0]==="["?(o++,i.push(l[1]==="^")):l==="]"&&o&&(o--,i.pop()),s+=l}return s}function Jke(t,e,n,a){VK(t,e,n,a)}function ett(t,e,n=0,a){if(!new RegExp(e,"su").test(t))return null;const r=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let i=0,o;for(;o=r.exec(t);){const{0:s,groups:{$skip:A}}=o;if(!A&&(!a||a===fc.DEFAULT==!i))return o;s==="["?i++:s==="]"&&i&&i--,r.lastIndex==o.index&&r.lastIndex++}return null}function zQ(t,e,n){return!!ett(t,e,0,n)}function ttt(t,e){const n=/\\?./gsu;n.lastIndex=e;let a=t.length,r=0,i=1,o;for(;o=n.exec(t);){const[s]=o;if(s==="[")r++;else if(r)s==="]"&&r--;else if(s==="(")i++;else if(s===")"&&(i--,!i)){a=o.index;break}}return t.slice(e,a)}const Pie=new RegExp(String.raw`(?<noncapturingStart>${Vet})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function ntt(t,e){const n=e?.hiddenCaptures??[];let a=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:a,hiddenCaptures:n};const r="(?>",i="(?:(?=(",o=[0],s=[];let A=0,l=0,u=NaN,d;do{d=!1;let p=0,m=0,g=!1,h;for(Pie.lastIndex=Number.isNaN(u)?0:u+i.length;h=Pie.exec(t);){const{0:b,index:y,groups:{capturingStart:w,noncapturingStart:E}}=h;if(b==="[")p++;else if(p)b==="]"&&p--;else if(b===r&&!g)u=y,g=!0;else if(g&&E)m++;else if(w)g?m++:(A++,o.push(A+l));else if(b===")"&&g){if(!m){l++;const k=A+l;if(t=`${t.slice(0,u)}${i}${t.slice(u+r.length,y)}))<$$${k}>)${t.slice(y+1)}`,d=!0,s.push(k),Jet(n,k),a.size){const v=new Map;a.forEach((_,I)=>{v.set(I>=k?I+1:I,_.map(x=>x>=k?x+1:x))}),a=v}break}m--}}}while(d);return n.push(...s),t=VK(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:p,groups:{backrefNum:m,wrappedBackrefNum:g}})=>{if(m){const h=+m;if(h>o.length-1)throw new Error(`Backref "${p}" greater than number of captures`);return`\\${o[h]}`}return`\\${g}`},fc.DEFAULT),{pattern:t,captureTransfers:a,hiddenCaptures:n}}const Xke=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,HT=new RegExp(String.raw`
102
102
  \\(?: \d+
103
103
  | c[A-Za-z]
104
104
  | [gk]<[^>]+>
@@ -111,9 +111,9 @@ Error generating stack: `+S.message+`
111
111
  | [A-Za-z\-]+:
112
112
  | \(DEFINE\)
113
113
  ))?
114
- | (?<qBase>${Vke})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
114
+ | (?<qBase>${Xke})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
115
115
  | \\?.
116
- `.replace(/\s+/g,""),"gsu");function Jet(t){if(!new RegExp(`${Vke}\\+`).test(t))return{pattern:t};const e=[];let n=null,a=null,r="",i=0,o;for(HT.lastIndex=0;o=HT.exec(t);){const{0:s,index:A,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s==="[")i||(a=A),i++;else if(s==="]")i?i--:a=null;else if(!i)if(u==="+"&&r&&!r.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${s}"`);let p=-1;if(/^\{\d+\}$/.test(l))t=Ket(t,A+l.length,u,"");else{if(r===")"||r==="]"){const m=r===")"?n:a;if(m===null)throw new Error(`Invalid unmatched "${r}"`);t=`${t.slice(0,m)}(?>${t.slice(m,A)}${l})${t.slice(A+s.length)}`}else t=`${t.slice(0,A-r.length)}(?>${r}${l})${t.slice(A+s.length)}`;p+=4}HT.lastIndex+=p}else s[0]==="("?e.push(A):s===")"&&(n=e.length?e.pop():null);r=s}return{pattern:t}}const mc=String.raw,Xet=mc`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,R$=mc`\(\?R=(?<rDepth>[^\)]+)\)|${Xet}`,ES=mc`\(\?<(?![=!])(?<captureName>[^>]+)>`,Jke=mc`${ES}|(?<unnamed>\()(?!\?)`,Vg=new RegExp(mc`${ES}|${R$}|\(\?|\\?.`,"gsu"),zT="Cannot use multiple overlapping recursions";function ett(t,e){const{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...e};let r=e?.captureTransfers??new Map;if(!new RegExp(R$,"su").test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};if(a==="plugin"&&zQ(t,mc`\(\?\(DEFINE\)`,fc.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],o=zQ(t,mc`\\[1-9]`,fc.DEFAULT),s=new Map,A=[];let l=!1,u=0,d=0,p;for(Vg.lastIndex=0;p=Vg.exec(t);){const{0:m,groups:{captureName:g,rDepth:h,gRNameOrNum:b,gRDepth:y}}=p;if(m==="[")u++;else if(u)m==="]"&&u--;else if(h){if(qie(h),l)throw new Error(zT);if(o)throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const w=t.slice(0,p.index),E=t.slice(Vg.lastIndex);if(zQ(E,R$,fc.DEFAULT))throw new Error(zT);const k=+h-1;t=Uie(w,E,k,!1,n,i,d),r=jie(r,w,k,i.length,0,d);break}else if(b){qie(y);let w=!1;for(const O of A)if(O.name===b||O.num===+b){if(w=!0,O.hasRecursedWithin)throw new Error(zT);break}if(!w)throw new Error(mc`Recursive \g cannot be used outside the referenced group "${a==="external"?b:mc`\g<${b}&R=${y}>`}"`);const E=s.get(b),k=Wet(t,E);if(o&&zQ(k,mc`${ES}|\((?!\?)`,fc.DEFAULT))throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const v=t.slice(E,p.index),_=k.slice(v.length+m.length),I=i.length,x=+y-1,N=Uie(v,_,x,!0,n,i,d);r=jie(r,v,x,i.length-I,I,d);const R=t.slice(0,E),T=t.slice(E+k.length);t=`${R}${N}${T}`,Vg.lastIndex+=N.length-m.length-v.length-_.length,A.forEach(O=>O.hasRecursedWithin=!0),l=!0}else if(g)d++,s.set(String(d),Vg.lastIndex),s.set(g,Vg.lastIndex),A.push({num:d,name:g});else if(m[0]==="("){const w=m==="(";w&&(d++,s.set(String(d),Vg.lastIndex)),A.push(w?{num:d}:{})}else m===")"&&A.pop()}return n.push(...i),{pattern:t,captureTransfers:r,hiddenCaptures:n}}function qie(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 Uie(t,e,n,a,r,i,o){const s=new Set;a&&Wke(t+e,ES,({groups:{captureName:l}})=>{s.add(l)},fc.DEFAULT);const A=[n,a?s:null,r,i,o];return`${t}${$ie(`(?:${t}`,"forward",...A)}(?:)${$ie(`${e})`,"backward",...A)}${e}`}function $ie(t,e,n,a,r,i,o){const A=u=>e==="forward"?u+2:n-u+2-1;let l="";for(let u=0;u<n;u++){const d=A(u);l+=KK(t,mc`${Jke}|\\k<(?<backref>[^>]+)>`,({0:p,groups:{captureName:m,unnamed:g,backref:h}})=>{if(h&&a&&!a.has(h))return p;const b=`_$${d}`;if(g||m){const y=o+i.length+1;return i.push(y),ttt(r,y),g?p:`(?<${m}${b}>`}return mc`\k<${h}${b}>`},fc.DEFAULT)}return l}function ttt(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function jie(t,e,n,a,r,i){if(t.size&&a){let o=0;Wke(e,Jke,()=>o++,fc.DEFAULT);const s=i-o+r,A=new Map;return t.forEach((l,u)=>{const d=(a-o*n)/n,p=o*n,m=u>s+o?u+a:u,g=[];for(const h of l)if(h<=s)g.push(h);else if(h>s+o+d)g.push(h+a);else if(h<=s+o)for(let b=0;b<=n;b++)g.push(h+o*b);else for(let b=0;b<=n;b++)g.push(h+p+d*b);A.set(m,g)}),A}return t}var Ti=String.fromCodePoint,Zn=String.raw,Ld={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};Ld.bugFlagVLiteralHyphenIsRange=Ld.unicodeSets?(()=>{try{new RegExp(Zn`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Ld.bugNestedClassIgnoresNegation=Ld.unicodeSets&&new RegExp("[[^a]]","v").test("a");function vD(t,{enable:e,disable:n}){return{dotAll:!n?.dotAll&&!!(e?.dotAll||t.dotAll),ignoreCase:!n?.ignoreCase&&!!(e?.ignoreCase||t.ignoreCase)}}function GB(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function M$(t,e){return Hie[t]>=Hie[e]}function ntt(t,e){if(t==null)throw new Error(e??"Value expected");return t}var Hie={ES2025:2025,ES2024:2024,ES2018:2018},att={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Xke(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!att[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=Ld.flagGroups?"ES2025":Ld.unicodeSets?"ES2024":"ES2018"),e}var rtt="[ -\r ]",itt=new Set([Ti(304),Ti(305)]),od=Zn`[\p{L}\p{M}\p{N}\p{Pc}]`;function eve(t){if(itt.has(t))return[t];const e=new Set,n=t.toLowerCase(),a=n.toUpperCase(),r=Att.get(n),i=ott.get(n),o=stt.get(n);return[...a].length===1&&e.add(a),o&&e.add(o),r&&e.add(r),e.add(n),i&&e.add(i),[...e]}var ZK=new Map(`C Other
116
+ `.replace(/\s+/g,""),"gsu");function att(t){if(!new RegExp(`${Xke}\\+`).test(t))return{pattern:t};const e=[];let n=null,a=null,r="",i=0,o;for(HT.lastIndex=0;o=HT.exec(t);){const{0:s,index:A,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s==="[")i||(a=A),i++;else if(s==="]")i?i--:a=null;else if(!i)if(u==="+"&&r&&!r.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${s}"`);let p=-1;if(/^\{\d+\}$/.test(l))t=Xet(t,A+l.length,u,"");else{if(r===")"||r==="]"){const m=r===")"?n:a;if(m===null)throw new Error(`Invalid unmatched "${r}"`);t=`${t.slice(0,m)}(?>${t.slice(m,A)}${l})${t.slice(A+s.length)}`}else t=`${t.slice(0,A-r.length)}(?>${r}${l})${t.slice(A+s.length)}`;p+=4}HT.lastIndex+=p}else s[0]==="("?e.push(A):s===")"&&(n=e.length?e.pop():null);r=s}return{pattern:t}}const mc=String.raw,rtt=mc`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,R$=mc`\(\?R=(?<rDepth>[^\)]+)\)|${rtt}`,BS=mc`\(\?<(?![=!])(?<captureName>[^>]+)>`,eve=mc`${BS}|(?<unnamed>\()(?!\?)`,Vg=new RegExp(mc`${BS}|${R$}|\(\?|\\?.`,"gsu"),zT="Cannot use multiple overlapping recursions";function itt(t,e){const{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...e};let r=e?.captureTransfers??new Map;if(!new RegExp(R$,"su").test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};if(a==="plugin"&&zQ(t,mc`\(\?\(DEFINE\)`,fc.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],o=zQ(t,mc`\\[1-9]`,fc.DEFAULT),s=new Map,A=[];let l=!1,u=0,d=0,p;for(Vg.lastIndex=0;p=Vg.exec(t);){const{0:m,groups:{captureName:g,rDepth:h,gRNameOrNum:b,gRDepth:y}}=p;if(m==="[")u++;else if(u)m==="]"&&u--;else if(h){if(qie(h),l)throw new Error(zT);if(o)throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const w=t.slice(0,p.index),E=t.slice(Vg.lastIndex);if(zQ(E,R$,fc.DEFAULT))throw new Error(zT);const k=+h-1;t=Uie(w,E,k,!1,n,i,d),r=jie(r,w,k,i.length,0,d);break}else if(b){qie(y);let w=!1;for(const O of A)if(O.name===b||O.num===+b){if(w=!0,O.hasRecursedWithin)throw new Error(zT);break}if(!w)throw new Error(mc`Recursive \g cannot be used outside the referenced group "${a==="external"?b:mc`\g<${b}&R=${y}>`}"`);const E=s.get(b),k=ttt(t,E);if(o&&zQ(k,mc`${BS}|\((?!\?)`,fc.DEFAULT))throw new Error(`${a==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const v=t.slice(E,p.index),_=k.slice(v.length+m.length),I=i.length,x=+y-1,N=Uie(v,_,x,!0,n,i,d);r=jie(r,v,x,i.length-I,I,d);const R=t.slice(0,E),T=t.slice(E+k.length);t=`${R}${N}${T}`,Vg.lastIndex+=N.length-m.length-v.length-_.length,A.forEach(O=>O.hasRecursedWithin=!0),l=!0}else if(g)d++,s.set(String(d),Vg.lastIndex),s.set(g,Vg.lastIndex),A.push({num:d,name:g});else if(m[0]==="("){const w=m==="(";w&&(d++,s.set(String(d),Vg.lastIndex)),A.push(w?{num:d}:{})}else m===")"&&A.pop()}return n.push(...i),{pattern:t,captureTransfers:r,hiddenCaptures:n}}function qie(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 Uie(t,e,n,a,r,i,o){const s=new Set;a&&Jke(t+e,BS,({groups:{captureName:l}})=>{s.add(l)},fc.DEFAULT);const A=[n,a?s:null,r,i,o];return`${t}${$ie(`(?:${t}`,"forward",...A)}(?:)${$ie(`${e})`,"backward",...A)}${e}`}function $ie(t,e,n,a,r,i,o){const A=u=>e==="forward"?u+2:n-u+2-1;let l="";for(let u=0;u<n;u++){const d=A(u);l+=VK(t,mc`${eve}|\\k<(?<backref>[^>]+)>`,({0:p,groups:{captureName:m,unnamed:g,backref:h}})=>{if(h&&a&&!a.has(h))return p;const b=`_$${d}`;if(g||m){const y=o+i.length+1;return i.push(y),ott(r,y),g?p:`(?<${m}${b}>`}return mc`\k<${h}${b}>`},fc.DEFAULT)}return l}function ott(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function jie(t,e,n,a,r,i){if(t.size&&a){let o=0;Jke(e,eve,()=>o++,fc.DEFAULT);const s=i-o+r,A=new Map;return t.forEach((l,u)=>{const d=(a-o*n)/n,p=o*n,m=u>s+o?u+a:u,g=[];for(const h of l)if(h<=s)g.push(h);else if(h>s+o+d)g.push(h+a);else if(h<=s+o)for(let b=0;b<=n;b++)g.push(h+o*b);else for(let b=0;b<=n;b++)g.push(h+p+d*b);A.set(m,g)}),A}return t}var Ti=String.fromCodePoint,Zn=String.raw,Ld={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};Ld.bugFlagVLiteralHyphenIsRange=Ld.unicodeSets?(()=>{try{new RegExp(Zn`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Ld.bugNestedClassIgnoresNegation=Ld.unicodeSets&&new RegExp("[[^a]]","v").test("a");function vD(t,{enable:e,disable:n}){return{dotAll:!n?.dotAll&&!!(e?.dotAll||t.dotAll),ignoreCase:!n?.ignoreCase&&!!(e?.ignoreCase||t.ignoreCase)}}function GB(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function M$(t,e){return Hie[t]>=Hie[e]}function stt(t,e){if(t==null)throw new Error(e??"Value expected");return t}var Hie={ES2025:2025,ES2024:2024,ES2018:2018},Att={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function tve(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!Att[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=Ld.flagGroups?"ES2025":Ld.unicodeSets?"ES2024":"ES2018"),e}var ctt="[ -\r ]",ltt=new Set([Ti(304),Ti(305)]),od=Zn`[\p{L}\p{M}\p{N}\p{Pc}]`;function nve(t){if(ltt.has(t))return[t];const e=new Set,n=t.toLowerCase(),a=n.toUpperCase(),r=ptt.get(n),i=utt.get(n),o=dtt.get(n);return[...a].length===1&&e.add(a),o&&e.add(o),r&&e.add(r),e.add(n),i&&e.add(i),[...e]}var JK=new Map(`C Other
117
117
  Cc Control cntrl
118
118
  Cf Format
119
119
  Cn Unassigned
@@ -203,23 +203,23 @@ Uppercase Upper
203
203
  Variation_Selector VS
204
204
  White_Space space
205
205
  XID_Continue XIDC
206
- XID_Start XIDS`.split(/\s/).map(t=>[wS(t),t])),ott=new Map([["s",Ti(383)],[Ti(383),"s"]]),stt=new Map([[Ti(223),Ti(7838)],[Ti(107),Ti(8490)],[Ti(229),Ti(8491)],[Ti(969),Ti(8486)]]),Att=new Map([Jp(453),Jp(456),Jp(459),Jp(498),...YT(8072,8079),...YT(8088,8095),...YT(8104,8111),Jp(8124),Jp(8140),Jp(8188)]),ctt=new Map([["alnum",Zn`[\p{Alpha}\p{Nd}]`],["alpha",Zn`\p{Alpha}`],["ascii",Zn`\p{ASCII}`],["blank",Zn`[\p{Zs}\t]`],["cntrl",Zn`\p{Cc}`],["digit",Zn`\p{Nd}`],["graph",Zn`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Zn`\p{Lower}`],["print",Zn`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Zn`[\p{P}\p{S}]`],["space",Zn`\p{space}`],["upper",Zn`\p{Upper}`],["word",Zn`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Zn`\p{AHex}`]]);function ltt(t,e){const n=[];for(let a=t;a<=e;a++)n.push(a);return n}function Jp(t){const e=Ti(t);return[e.toLowerCase(),e]}function YT(t,e){return ltt(t,e).map(n=>Jp(n))}var tve=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function utt(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};nve(t);const a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:M$(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};ZE(t,dtt,a);const r={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},i={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap};ZE(t,ptt,i);const o={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return ZE(t,mtt,o),t._originMap=i.groupOriginByCopy,t._strategy=a.strategy,t}var dtt={AbsenceFunction({node:t,parent:e,replaceWith:n}){const{body:a,kind:r}=t;if(r==="repeater"){const i=Xc();i.body[0].body.push(yf({negate:!0,body:a}),wb("Any"));const o=Xc();o.body[0].body.push(Yke("greedy",0,1/0,i)),n(Vr(o,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:a}){const r=t.body.filter(i=>i.kind==="flags");for(let i=n+1;i<e.body.length;i++){const o=e.body[i];GB(a,o,[]).push(...r)}},exit({node:t},{flagDirectivesByAlt:e}){if(e.get(t)?.length){const n=rve(e.get(t));if(n){const a=Xc({flags:n});a.body[0].body=t.body,t.body=[Vr(a,t)]}}}},Assertion({node:t,parent:e,key:n,container:a,root:r,remove:i,replaceWith:o},s){const{kind:A,negate:l}=t,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:p,wordIsAscii:m}=s;if(A==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${l?"Y":"y"}"`);if(A==="line_end")o(Vr(yf({body:[Zf({body:[N$("string_end")]}),Zf({body:[CS(10)]})]}),e));else if(A==="line_start")o(Vr(sd(Zn`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(A==="search_start")if(p.has(t))r.flags.sticky=!0,i();else{const g=a[n-1];if(g&&Ctt(g))o(Vr(yf({negate:!0}),e));else{if(d)throw new Error(Zn`Uses "\G" in a way that requires a subclass`);o(Xp(N$("string_start"),e)),s.strategy="clip_search"}}else if(!(A==="string_end"||A==="string_start"))if(A==="string_end_newline")o(Vr(sd(Zn`(?=\n?\z)`),e));else if(A==="word_boundary"){if(!m&&!u){const g=`(?:(?<=${od})(?!${od})|(?<!${od})(?=${od}))`,h=`(?:(?<=${od})(?=${od})|(?<!${od})(?!${od}))`;o(Vr(sd(l?h:g),e))}}else throw new Error(`Unexpected assertion kind "${A}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!ZT(n)&&(n=KT(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:a}=t;a&&!ZT(a)&&(a=KT(a,e),t.name=a),n.set(t.number,t),a&&n.set(a,t)},CharacterClassRange({node:t,parent:e,replaceWith:n}){if(e.kind==="intersection"){const a=Dx({body:[t]});n(Vr(a,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:n},{accuracy:a,minTargetEs2024:r,digitIsAscii:i,spaceIsAscii:o,wordIsAscii:s}){const{kind:A,negate:l,value:u}=t;if(i&&(A==="digit"||u==="digit")){n(Xp(T$("digit",{negate:l}),e));return}if(o&&(A==="space"||u==="space")){n(Vr(WT(sd(rtt),l),e));return}if(s&&(A==="word"||u==="word")){n(Xp(T$("word",{negate:l}),e));return}if(A==="any")n(Xp(wb("Any"),e));else if(A==="digit")n(Xp(wb("Nd",{negate:l}),e));else if(A!=="dot")if(A==="text_segment"){if(a==="strict")throw new Error(Zn`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",p=Zn`\p{RI}{2}|${d}(?:\u200D${d})*`;n(Vr(sd(Zn`(?>\r\n|${r?Zn`\p{RGI_Emoji}`:p}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(A==="hex")n(Xp(wb("AHex",{negate:l}),e));else if(A==="newline")n(Vr(sd(l?`[^
206
+ XID_Start XIDS`.split(/\s/).map(t=>[ES(t),t])),utt=new Map([["s",Ti(383)],[Ti(383),"s"]]),dtt=new Map([[Ti(223),Ti(7838)],[Ti(107),Ti(8490)],[Ti(229),Ti(8491)],[Ti(969),Ti(8486)]]),ptt=new Map([Jp(453),Jp(456),Jp(459),Jp(498),...YT(8072,8079),...YT(8088,8095),...YT(8104,8111),Jp(8124),Jp(8140),Jp(8188)]),mtt=new Map([["alnum",Zn`[\p{Alpha}\p{Nd}]`],["alpha",Zn`\p{Alpha}`],["ascii",Zn`\p{ASCII}`],["blank",Zn`[\p{Zs}\t]`],["cntrl",Zn`\p{Cc}`],["digit",Zn`\p{Nd}`],["graph",Zn`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Zn`\p{Lower}`],["print",Zn`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Zn`[\p{P}\p{S}]`],["space",Zn`\p{space}`],["upper",Zn`\p{Upper}`],["word",Zn`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Zn`\p{AHex}`]]);function gtt(t,e){const n=[];for(let a=t;a<=e;a++)n.push(a);return n}function Jp(t){const e=Ti(t);return[e.toLowerCase(),e]}function YT(t,e){return gtt(t,e).map(n=>Jp(n))}var ave=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function ftt(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};rve(t);const a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:M$(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};ZE(t,htt,a);const r={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},i={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap};ZE(t,btt,i);const o={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return ZE(t,ytt,o),t._originMap=i.groupOriginByCopy,t._strategy=a.strategy,t}var htt={AbsenceFunction({node:t,parent:e,replaceWith:n}){const{body:a,kind:r}=t;if(r==="repeater"){const i=Xc();i.body[0].body.push(yf({negate:!0,body:a}),wb("Any"));const o=Xc();o.body[0].body.push(Zke("greedy",0,1/0,i)),n(Vr(o,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:a}){const r=t.body.filter(i=>i.kind==="flags");for(let i=n+1;i<e.body.length;i++){const o=e.body[i];GB(a,o,[]).push(...r)}},exit({node:t},{flagDirectivesByAlt:e}){if(e.get(t)?.length){const n=ove(e.get(t));if(n){const a=Xc({flags:n});a.body[0].body=t.body,t.body=[Vr(a,t)]}}}},Assertion({node:t,parent:e,key:n,container:a,root:r,remove:i,replaceWith:o},s){const{kind:A,negate:l}=t,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:p,wordIsAscii:m}=s;if(A==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${l?"Y":"y"}"`);if(A==="line_end")o(Vr(yf({body:[Zf({body:[N$("string_end")]}),Zf({body:[wS(10)]})]}),e));else if(A==="line_start")o(Vr(sd(Zn`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(A==="search_start")if(p.has(t))r.flags.sticky=!0,i();else{const g=a[n-1];if(g&&vtt(g))o(Vr(yf({negate:!0}),e));else{if(d)throw new Error(Zn`Uses "\G" in a way that requires a subclass`);o(Xp(N$("string_start"),e)),s.strategy="clip_search"}}else if(!(A==="string_end"||A==="string_start"))if(A==="string_end_newline")o(Vr(sd(Zn`(?=\n?\z)`),e));else if(A==="word_boundary"){if(!m&&!u){const g=`(?:(?<=${od})(?!${od})|(?<!${od})(?=${od}))`,h=`(?:(?<=${od})(?=${od})|(?<!${od})(?!${od}))`;o(Vr(sd(l?h:g),e))}}else throw new Error(`Unexpected assertion kind "${A}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!ZT(n)&&(n=KT(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:a}=t;a&&!ZT(a)&&(a=KT(a,e),t.name=a),n.set(t.number,t),a&&n.set(a,t)},CharacterClassRange({node:t,parent:e,replaceWith:n}){if(e.kind==="intersection"){const a=Dx({body:[t]});n(Vr(a,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:n},{accuracy:a,minTargetEs2024:r,digitIsAscii:i,spaceIsAscii:o,wordIsAscii:s}){const{kind:A,negate:l,value:u}=t;if(i&&(A==="digit"||u==="digit")){n(Xp(T$("digit",{negate:l}),e));return}if(o&&(A==="space"||u==="space")){n(Vr(WT(sd(ctt),l),e));return}if(s&&(A==="word"||u==="word")){n(Xp(T$("word",{negate:l}),e));return}if(A==="any")n(Xp(wb("Any"),e));else if(A==="digit")n(Xp(wb("Nd",{negate:l}),e));else if(A!=="dot")if(A==="text_segment"){if(a==="strict")throw new Error(Zn`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",p=Zn`\p{RI}{2}|${d}(?:\u200D${d})*`;n(Vr(sd(Zn`(?>\r\n|${r?Zn`\p{RGI_Emoji}`:p}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(A==="hex")n(Xp(wb("AHex",{negate:l}),e));else if(A==="newline")n(Vr(sd(l?`[^
207
207
  ]`:`(?>\r
208
208
  ?|[
209
- \v\f…\u2028\u2029])`),e));else if(A==="posix")if(!r&&(u==="graph"||u==="print")){if(a==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];l&&(d=`\0-${Ti(d.codePointAt(0)-1)}${Ti(d.codePointAt(2)+1)}-􏿿`),n(Vr(sd(`[${d}]`),e))}else n(Vr(WT(sd(ctt.get(u)),l),e));else if(A==="property")ZK.has(wS(u))||(t.key="sc");else if(A==="space")n(Xp(wb("space",{negate:l}),e));else if(A==="word")n(Vr(WT(sd(od),l),e));else throw new Error(`Unexpected character set kind "${A}"`)},Directive({node:t,parent:e,root:n,remove:a,replaceWith:r,removeAllPrevSiblings:i,removeAllNextSiblings:o}){const{kind:s,flags:A}=t;if(s==="flags")if(!A.enable&&!A.disable)a();else{const l=Xc({flags:A});l.body[0].body=o(),r(Vr(l,e),{traverse:!0})}else if(s==="keep"){const l=n.body[0],d=n.body.length===1&&jke(l,{type:"Group"})&&l.body[0].body.length===1?l.body[0]:n;if(e.parent!==d||d.body.length>1)throw new Error(Zn`Uses "\K" in a way that's unsupported`);const p=yf({behind:!0});p.body[0].body=i(),r(Vr(p,e))}else throw new Error(`Unexpected directive kind "${s}"`)},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:a}=t;if(a==="fail")n(Vr(yf({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${a.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=Xc();e.body[0].body.push(t.body),t.body=Vr(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const n=[];let a=!1,r=!1;for(const i of t.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const o=ove(i.body);o?(a=!0,Array.isArray(o)?n.push(...o):n.push(o)):r=!0}a&&!r&&n.forEach(i=>e.add(i))},exit(t,{accuracy:e,passedLookbehind:n,strategy:a}){if(e==="strict"&&n&&a)throw new Error(Zn`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!ZT(n)&&(n=KT(n,e),t.ref=n)}},ptt={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:a,ref:r}=t;a||n.set(t,[...e.get(r).map(({node:i})=>i)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:a},{groupOriginByCopy:r,groupsByName:i,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:A}){const l=r.get(t);if(l&&s.has(t.number)){const d=Xp(zie(t.number),e);A.set(d,s.get(t.number)),n(d);return}s.set(t.number,t),o.set(t.number,[]),t.name&&GB(o,t.name,[]);const u=o.get(t.name??t.number);for(let d=0;d<u.length;d++){const p=u[d];if(l===p.node||l&&l===p.origin||t===p.origin){u.splice(d,1);break}}if(o.get(t.number).push({node:t,origin:l}),t.name&&o.get(t.name).push({node:t,origin:l}),t.name){const d=GB(i,t.name,new Map);let p=!1;if(l)p=!0;else for(const m of d.values())if(!m.hasDuplicateNameToRemove){p=!0;break}i.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:p})}},exit({node:t},{openRefs:e}){e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=vD(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:n},a){const{isRecursive:r,ref:i}=t;if(r){let u=e;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===i||u.number===i)););a.reffedNodesByReferencer.set(t,u);return}const o=a.subroutineRefMap.get(i),s=i===0,A=s?zie(0):ave(o,a.groupOriginByCopy,null);let l=A;if(!s){const u=rve(htt(o,p=>p.type==="Group"&&!!p.flags)),d=u?vD(a.globalFlags,u):a.globalFlags;gtt(d,a.currentFlags)||(l=Xc({flags:btt(d)}),l.body[0].body.push(A))}n(Vr(l,e),{traverse:!s})}},mtt={Backreference({node:t,parent:e,replaceWith:n},a){if(t.orphan){a.highestOrphanBackref=Math.max(a.highestOrphanBackref,t.ref);return}const i=a.reffedNodesByReferencer.get(t).filter(o=>ftt(o,t));if(!i.length)n(Vr(yf({negate:!0}),e));else if(i.length>1){const o=Xc({atomic:!0,body:i.reverse().map(s=>Zf({body:[F$(s.number)]}))});n(Vr(o,e))}else t.ref=i[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 a=0;a<n;a++){const r=zke();t.body.at(-1).body.push(r)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function nve(t){ZE(t,{"*"({node:e,parent:n}){e.parent=n}})}function gtt(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function ftt(t,e){let n=e;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===t)return!1;const a=ive(n.parent);for(const r of a){if(r===n)break;if(r===t||sve(r,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function ave(t,e,n,a){const r=Array.isArray(t)?[]:{};for(const[i,o]of Object.entries(t))i==="parent"?r.parent=Array.isArray(n)?a:n:o&&typeof o=="object"?r[i]=ave(o,e,r,n):(i==="type"&&o==="CapturingGroup"&&e.set(r,e.get(t)??t),r[i]=o);return r}function zie(t){const e=Kke(t);return e.isRecursive=!0,e}function htt(t,e){const n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function KT(t,e){if(e.has(t))return e.get(t);const n=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,n),n}function rve(t){const e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:a})=>{e.forEach(r=>{a.enable?.[r]&&(delete n.disable[r],n.enable[r]=!0),a.disable?.[r]&&(n.disable[r]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function btt({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 ive(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function ove(t){const e=t.find(n=>n.kind==="search_start"||wtt(n,{negate:!1})||!ytt(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 a of e.body){const r=ove(a.body);if(!r)return null;Array.isArray(r)?n.push(...r):n.push(r)}return n}return null}function sve(t,e){const n=ive(t)??[];for(const a of n)if(a===e||sve(a,e))return!0;return!1}function ytt({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function Ctt(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function wtt(t,e){const n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&jke(t.body[0],{type:"Assertion",kind:"search_start"})}function ZT(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function sd(t,e){const a=Hke(t,{...e,unicodePropertyMap:ZK}).body;return a.length>1||a[0].body.length>1?Xc({body:a}):a[0].body[0]}function WT(t,e){return t.negate=e,t}function Xp(t,e){return t.parent=e,t}function Vr(t,e){return nve(t),t.parent=e,t}function Ett(t,e){const n=Xke(e),a=M$(n.target,"ES2024"),r=M$(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,s=null;if(!r){const m=[t.flags.ignoreCase];ZE(t,Btt,{getCurrentModI:()=>m.at(-1),popModI(){m.pop()},pushModI(g){m.push(g)},setHasCasedChar(){m.at(-1)?o=!0:s=!0}})}const A={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||o)&&!s)};let l=t;const u={accuracy:n.accuracy,appliedGlobalFlags:A,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:t._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!r&&o&&s),useFlagMods:r,useFlagV:a,verbose:n.verbose};function d(m){return u.lastNode=l,l=m,ntt(ktt[m.type],`Unexpected node type "${m.type}"`)(m,u,d)}const p={pattern:t.body.map(d).join("|"),flags:d(t.flags),options:{...t.options}};return a||(delete p.options.force.v,p.options.disable.v=!0,p.options.unicodeSetsPlugin=null),p._captureTransfers=new Map,p._hiddenCaptures=[],u.captureMap.forEach((m,g)=>{m.hidden&&p._hiddenCaptures.push(g),m.transferTo&&GB(p._captureTransfers,m.transferTo,[]).push(g)}),p}var Btt={"*":{enter({node:t},e){if(Kie(t)){const n=e.getCurrentModI();e.pushModI(t.flags?vD({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){Kie(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){WK(Ti(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),Ave(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&tve.has(t.value)&&e.setHasCasedChar()}},ktt={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?Zn`\B`:Zn`\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:a,name:r,number:i}=t,o={ignoreCase:e.currentFlags.ignoreCase},s=e.originMap.get(t);return s&&(o.hidden=!0,i>s.number&&(o.transferTo=s.number)),e.captureMap.set(i,o),`(${r?`?<${r}>`:""}${a.map(n).join("|")})`},Character({value:t},e){const n=Ti(t),a=Xh(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(a!==n)return a;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&WK(n)){const r=eve(n);return e.inCharClass?r.join(""):r.length>1?`[${r.join("")}]`:r[0]}return n},CharacterClass(t,e,n){const{kind:a,negate:r,parent:i}=t;let{body:o}=t;if(a==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Ld.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&o.some(Zie)&&(o=[CS(45),...o.filter(l=>!Zie(l))]);const s=()=>`[${r?"^":""}${o.map(n).join(a==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||Ld.bugNestedClassIgnoresNegation)&&!r){const u=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){const d=Xc(),p=d.body[0];return d.parent=i,p.parent=d,o=o.filter(m=>!u.includes(m)),t.body=o,o.length?(t.parent=p,p.body.push(t)):d.body.pop(),u.forEach(m=>{const g=Zf({body:[m]});m.parent=g,g.parent=d,d.body.push(g)}),n(d)}}e.inCharClass=!0;const l=s();return e.inCharClass=!1,l}const A=o[0];if(a==="union"&&!r&&A&&((!e.useFlagV||!e.verbose)&&i.kind==="union"&&!(Ld.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&i.kind==="intersection"&&o.length===1&&A.type!=="CharacterClassRange"))return o.map(n).join("");if(!e.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return s()},CharacterClassRange(t,e){const n=t.min.value,a=t.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},i=Xh(n,r),o=Xh(a,r),s=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const A=Ave(t);xtt(A).forEach(u=>{s.add(Array.isArray(u)?`${Xh(u[0],r)}-${Xh(u[1],r)}`:Xh(u,r))})}return`${i}-${o}${[...s].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:a},r){if(t==="dot")return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":Zn`[^\n]`;if(t==="digit")return e?Zn`\D`:Zn`\d`;if(t==="property"){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&tve.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?Zn`\P`:Zn`\p`}{${a?`${a}=`:""}${n}}`}if(t==="word")return e?Zn`\W`:Zn`\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:a},r,i){const o=r.currentFlags;n&&(r.currentFlags=vD(o,n));const s=e.map(i).join("|"),A=!r.verbose&&e.length===1&&a.type!=="Quantifier"&&!t&&(!r.useFlagMods||!n)?s:`(?${Dtt(t,n,r.useFlagMods)}${s})`;return r.currentFlags=o,A},LookaroundAssertion({body:t,kind:e,negate:n},a,r){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(r).join("|")})`},Quantifier(t,e,n){return n(t.body)+Stt(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const a=n.recursionLimit;return e===0?`(?R=${a})`:Zn`\g<${e}&R=${a}>`}},vtt=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Itt=new Set(["-","\\","]","^","["]),Qtt=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Yie=new Map([[9,Zn`\t`],[10,Zn`\n`],[11,Zn`\v`],[12,Zn`\f`],[13,Zn`\r`],[8232,Zn`\u2028`],[8233,Zn`\u2029`],[65279,Zn`\uFEFF`]]),_tt=new RegExp("^\\p{Cased}$","u");function WK(t){return _tt.test(t)}function Ave(t,e){const n=!!e?.firstOnly,a=t.min.value,r=t.max.value,i=[];if(a<65&&(r===65535||r>=131071)||a===65536&&r>=131071)return i;for(let o=a;o<=r;o++){const s=Ti(o);if(!WK(s))continue;const A=eve(s).filter(l=>{const u=l.codePointAt(0);return u<a||u>r});if(A.length&&(i.push(...A),n))break}return i}function Xh(t,{escDigit:e,inCharClass:n,useFlagV:a}){if(Yie.has(t))return Yie.get(t);if(t<32||t>126&&t<160||t>262143||e&&Ntt(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const r=n?a?Qtt:Itt:vtt,i=Ti(t);return(r.has(i)?"\\":"")+i}function xtt(t){const e=t.map(r=>r.codePointAt(0)).sort((r,i)=>r-i),n=[];let a=null;for(let r=0;r<e.length;r++)e[r+1]===e[r]+1?a??=e[r]:a===null?n.push(e[r]):(n.push([a,e[r]]),a=null);return n}function Dtt(t,e,n){if(t)return">";let a="";if(e&&n){const{enable:r,disable:i}=e;a=(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")+(i?"-":"")+(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")}return`${a}:`}function Stt({kind:t,max:e,min:n}){let a;return!n&&e===1?a="?":!n&&e===1/0?a="*":n===1&&e===1/0?a="+":n===e?a=`{${n}}`:a=`{${n},${e===1/0?"":e}}`,a+{greedy:"",lazy:"?",possessive:"+"}[t]}function Kie({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function Ntt(t){return t>47&&t<58}function Zie({type:t,value:e}){return t==="Character"&&e===45}var Ftt=class L$ extends RegExp{#t=new Map;#e=null;#a;#n=null;#r=null;rawOptions={};get source(){return this.#a||"(?:)"}constructor(e,n,a){const r=!!a?.lazyCompile;if(e instanceof RegExp){if(a)throw new Error("Cannot provide options when copying a regexp");const i=e;super(i,n),this.#a=i.source,i instanceof L$&&(this.#t=i.#t,this.#n=i.#n,this.#r=i.#r,this.rawOptions=i.rawOptions)}else{const i={hiddenCaptures:[],strategy:null,transfers:[],...a};super(r?"":e,n),this.#a=e,this.#t=Rtt(i.hiddenCaptures,i.transfers),this.#r=i.strategy,this.rawOptions=a??{}}r||(this.#e=this)}exec(e){if(!this.#e){const{lazyCompile:r,...i}=this.rawOptions;this.#e=new L$(this.#a,this.flags,i)}const n=this.global||this.sticky,a=this.lastIndex;if(this.#r==="clip_search"&&n&&a){this.lastIndex=0;const r=this.#i(e.slice(a));return r&&(Ttt(r,a,e,this.hasIndices),this.lastIndex+=a),r}return this.#i(e)}#i(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 a=[...n];n.length=1;let r;this.hasIndices&&(r=[...n.indices],n.indices.length=1);const i=[0];for(let o=1;o<a.length;o++){const{hidden:s,transferTo:A}=this.#t.get(o)??{};if(s?i.push(null):(i.push(n.length),n.push(a[o]),this.hasIndices&&n.indices.push(r[o])),A&&a[o]!==void 0){const l=i[A];if(!l)throw new Error(`Invalid capture transfer to "${l}"`);if(n[l]=a[o],this.hasIndices&&(n.indices[l]=r[o]),n.groups){this.#n||(this.#n=Mtt(this.source));const u=this.#n.get(A);u&&(n.groups[u]=a[o],this.hasIndices&&(n.indices.groups[u]=r[o]))}}}return n}};function Ttt(t,e,n,a){if(t.index+=e,t.input=n,a){const r=t.indices;for(let o=0;o<r.length;o++){const s=r[o];s&&(r[o]=[s[0]+e,s[1]+e])}const i=r.groups;i&&Object.keys(i).forEach(o=>{const s=i[o];s&&(i[o]=[s[0]+e,s[1]+e])})}}function Rtt(t,e){const n=new Map;for(const a of t)n.set(a,{hidden:!0});for(const[a,r]of e)for(const i of r)GB(n,i,{}).transferTo=a;return n}function Mtt(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let a=0,r=0,i;for(;i=e.exec(t);){const{0:o,groups:{capture:s,name:A}}=i;o==="["?a++:a?o==="]"&&a--:s&&(r++,A&&n.set(r,A))}return n}function Ltt(t,e){const n=Ott(t,e);return n.options?new Ftt(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ott(t,e){const n=Xke(e),a=Hke(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:ZK}),r=utt(a,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Ett(r,n),o=ett(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),s=Jet(o.pattern),A=Vet(s.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),l={pattern:A.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const u=A.hiddenCaptures.sort((g,h)=>g-h),d=Array.from(A.captureTransfers),p=r._strategy,m=l.pattern.length>=n.lazyCompileLength;(u.length||d.length||p||m)&&(l.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...p&&{strategy:p},...m&&{lazyCompile:m}})}return l}const Wie=4294967295;class Gtt{constructor(e,n={}){this.patterns=e,this.options=n;const{forgiving:a=!1,cache:r,regexConstructor:i}=n;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=r?.get(o);if(s){if(s instanceof RegExp)return s;if(a)return null;throw s}try{const A=i(o);return r?.set(o,A),A}catch(A){if(r?.set(o,A),a)return null;throw A}})}regexps;findNextMatchSync(e,n,a){const r=typeof e=="string"?e:e.content,i=[];function o(s,A,l=0){return{index:s,captureIndices:A.indices.map(u=>u==null?{start:Wie,end:Wie,length:0}:{start:u[0]+l,end:u[1]+l,length:u[1]-u[0]})}}for(let s=0;s<this.regexps.length;s++){const A=this.regexps[s];if(A)try{A.lastIndex=n;const l=A.exec(r);if(!l)continue;if(l.index===n)return o(s,l,0);i.push([s,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(i.length){const s=Math.min(...i.map(A=>A[1].index));for(const[A,l,u]of i)if(l.index===s)return o(A,l,u)}return null}}function Ptt(t,e){return Ltt(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function cve(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=n=>Ptt(n,{target:e.target}),{createScanner(n){return new Gtt(n,e)},createString(n){return{content:n}}}}async function lve(t){if(WBe())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=RT.get(t);if(e!=null)return e;try{const n=jK[t];if(n==null)throw new Error(`resolveLanguage: "${t}" not found in bundled languages`);const a=n().then(({default:r})=>{const i={name:t,data:r};return Kf.has(t)||Kf.set(t,i),i});return RT.set(t,a),await a}finally{RT.delete(t)}}function uve(t){return Kf.get(t)??lve(t)}async function dve(t){if(WBe())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=TT.get(t);if(e!=null)return e;try{const n=h$.get(t)??Mke[t];if(n==null)throw new Error(`resolveTheme: No valid loader for ${t}`);const a=n().then(i=>qtt(t,"default"in i?i.default:i));TT.set(t,a);const r=await a;if(r.name!==t)throw new Error(`resolvedTheme: themeName: ${t} does not match theme.name: ${r.name}`);return Md.set(r.name,r),r}finally{TT.delete(t)}}function qtt(t,e){const n=Md.get(t);return n??(e=hS(e),Md.set(t,e),e)}function pve(t){return Md.get(t)??dve(t)}function mve(t,e){if(h$.has(t)){console.error("SharedHighlight.registerCustomTheme: theme name already registered",t);return}h$.set(t,e)}let Kl;async function O$({themes:t,langs:e}){Kl??=Oke({themes:[],langs:["text"],engine:cve()});const n=$tt(Kl)?await Kl:Kl;Kl=n;const a=[];for(const i of e){if(i==="text")continue;const o=uve(i);"then"in o?a.push(o):sie(o,n)}const r=[];for(const i of t){const o=pve(i);"then"in o?r.push(o):y$(o,Kl)}return(a.length>0||r.length>0)&&await Promise.all([Promise.all(a).then(i=>{sie(i,n)}),Promise.all(r).then(i=>{y$(i,n)})]),n}function Utt(){if(Kl!=null&&!("then"in Kl))return Kl}function $tt(t=Kl){return t!=null&&"then"in t}mve("pierre-dark",()=>_e(()=>Promise.resolve().then(()=>zOt),void 0));mve("pierre-light",()=>_e(()=>Promise.resolve().then(()=>KOt),void 0));function ID(t=Vs){const e=[];return typeof t=="string"?e.push(t):(e.push(t.dark),e.push(t.light)),e}function Vie(t){for(const e of t)if(!Md.has(e))return!1;return!0}function VK(t,e){return t==null||e==null||typeof t=="string"||typeof e=="string"?t===e:t.dark===e.dark&&t.light===e.light}const JC={"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 Em(t){if(JC[t]!=null)return JC[t];const e=t.match(/\.([^/\\]+\.[^/\\]+)$/);return e!=null&&JC[e[1]]!=null?JC[e[1]]??"text":JC[t.match(/\.([^.]+)$/)?.[1]??""]??"text"}function Wf(t){return t.replace(/\n$|\r\n$/,"")}function Sm(t){return{type:"text",value:t}}function Ta({tagName:t,children:e=[],properties:n={}}){return{type:"element",tagName:t,properties:n,children:e}}function G$({name:t,width:e=16,height:n=16,properties:a}){return Ta({tagName:"svg",properties:{width:e,height:n,viewBox:"0 0 16 16",...a},children:[Ta({tagName:"use",properties:{href:`#${t.replace(/^#/,"")}`}})]})}function jtt(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 Htt(t,e,n){const a=typeof n.lineInfo=="function"?n.lineInfo(e):n.lineInfo[e];if(a==null)throw console.error({node:t,line:e,state:n}),new Error(`processLine: line ${e}, contains no state.lineInfo`);return t.tagName="span",t.properties["data-column-content"]="",t.children.length===0&&t.children.push(Sm(`
210
- `)),Ta({tagName:"div",children:[Ta({tagName:"span",children:[Ta({tagName:"span",children:[{type:"text",value:`${a.lineNumber}`}],properties:{"data-line-number-content":""}})],properties:{"data-column-number":""}}),t],properties:{"data-line":a.lineNumber,"data-alt-line":a.altLineNumber,"data-line-type":a.type,"data-line-index":a.lineIndex}})}function ztt(t={}){const{classPrefix:e="__shiki_",classSuffix:n="",classReplacer:a=s=>s}=t,r=new Map;function i(s){return Object.entries(s).map(([A,l])=>`${A}:${l}`).join(";")}function o(s){const A=typeof s=="string"?s:i(s);let l=e+Ytt(A)+n;return l=a(l),r.has(l)||r.set(l,typeof s=="string"?s:{...s}),l}return{name:"@shikijs/transformers:style-to-class",pre(s){if(!s.properties.style)return;const A=o(s.properties.style);delete s.properties.style,this.addClassToHast(s,A)},tokens(s){for(const A of s)for(const l of A){if(!l.htmlStyle)continue;const u=o(l.htmlStyle);l.htmlStyle={},l.htmlAttrs||={},l.htmlAttrs.class?l.htmlAttrs.class+=` ${u}`:l.htmlAttrs.class=u}},getClassRegistry(){return r},getCSS(){let s="";for(const[A,l]of r.entries())s+=`.${A}{${typeof l=="string"?l:i(l)}}`;return s},clearRegistry(){r.clear()}}}function Ytt(t,e=0){let n=3735928559^e,a=1103547991^e;for(let r=0,i;r<t.length;r++)i=t.charCodeAt(r),n=Math.imul(n^i,2654435761),a=Math.imul(a^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(a^a>>>13,3266489909),a=Math.imul(a^a>>>16,2246822507),a^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&a)+(n>>>0)).toString(36).slice(0,6)}function gve(t=!1){const e={lineInfo:{}},n=[{line(a){return delete a.properties.class,a},pre(a){const r=jtt(a),i=[];if(r!=null){let o=1;for(const s of r.children)s.type==="element"&&(i.push(Htt(s,o,e)),o++);r.children=i}return a}}];return t&&n.push(Ktt,Jie),{state:e,transformers:n,toClass:Jie}}const Jie=ztt({classPrefix:"hl-"}),Ktt={name:"token-style-normalizer",tokens(t){for(const e of t)for(const n of e){if(n.htmlStyle!=null)continue;const a={};n.color!=null&&(a.color=n.color),n.bgColor!=null&&(a["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(a["font-style"]="italic"),(n.fontStyle&2)!==0&&(a["font-weight"]="bold"),(n.fontStyle&4)!==0&&(a["text-decoration"]="underline")),Object.keys(a).length>0&&(n.htmlStyle=a)}}};function IA(t="diffs"){return`--${t}-`}function fve({theme:t=Vs,highlighter:e,prefix:n}){let a="";if(typeof t=="string"){const r=e.getTheme(t);a+=`color:${r.fg};`,a+=`background-color:${r.bg};`,a+=`${IA(n)}fg:${r.fg};`,a+=`${IA(n)}bg:${r.bg};`,a+=VT(r,n)}else{let r=e.getTheme(t.dark);a+=`${IA(n)}dark:${r.fg};`,a+=`${IA(n)}dark-bg:${r.bg};`,a+=VT(r,n,"dark"),r=e.getTheme(t.light),a+=`${IA(n)}light:${r.fg};`,a+=`${IA(n)}light-bg:${r.bg};`,a+=VT(r,n,"light")}return a}function VT(t,e,n){n=n!=null?`${n}-`:"";let a="";const r=t.colors?.["gitDecoration.addedResourceForeground"]??t.colors?.["terminal.ansiGreen"];r!=null&&(a+=`${IA(e)}${n}addition-color:${r};`);const i=t.colors?.["gitDecoration.deletedResourceForeground"]??t.colors?.["terminal.ansiRed"];i!=null&&(a+=`${IA(e)}${n}deletion-color:${i};`);const o=t.colors?.["gitDecoration.modifiedResourceForeground"]??t.colors?.["terminal.ansiBlue"];return o!=null&&(a+=`${IA(e)}${n}modified-color:${o};`),a}function P$(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 Ztt(t,e,{theme:n=Vs,tokenizeMaxLineLength:a},r=!1){const{state:i,transformers:o}=gve(),s=r?"text":t.lang??Em(t.name),A=(()=>{if(typeof n=="string")return e.getTheme(n).type})(),l=fve({theme:n,highlighter:e});i.lineInfo=d=>({type:"context",lineIndex:d-1,lineNumber:d});const u=typeof n=="string"?{lang:s,theme:n,transformers:o,defaultColor:!1,cssVariablePrefix:IA(),tokenizeMaxLineLength:a}:{lang:s,themes:n,transformers:o,defaultColor:!1,cssVariablePrefix:IA(),tokenizeMaxLineLength:a};return{code:P$(e.codeToHast(Wf(t.contents),u)),themeStyles:l,baseThemeType:A}}class JK{diff(e,n,a={}){let r;typeof a=="function"?(r=a,a={}):"callback"in a&&(r=a.callback);const i=this.castInput(e,a),o=this.castInput(n,a),s=this.removeEmpty(this.tokenize(i,a)),A=this.removeEmpty(this.tokenize(o,a));return this.diffWithOptionsObj(s,A,a,r)}diffWithOptionsObj(e,n,a,r){var i;const o=w=>{if(w=this.postProcess(w,a),r){setTimeout(function(){r(w)},0);return}else return w},s=n.length,A=e.length;let l=1,u=s+A;a.maxEditLength!=null&&(u=Math.min(u,a.maxEditLength));const d=(i=a.timeout)!==null&&i!==void 0?i:1/0,p=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(m[0],n,e,0,a);if(m[0].oldPos+1>=A&&g+1>=s)return o(this.buildValues(m[0].lastComponent,n,e));let h=-1/0,b=1/0;const y=()=>{for(let w=Math.max(h,-l);w<=Math.min(b,l);w+=2){let E;const k=m[w-1],v=m[w+1];k&&(m[w-1]=void 0);let _=!1;if(v){const x=v.oldPos-w;_=v&&0<=x&&x<s}const I=k&&k.oldPos+1<A;if(!_&&!I){m[w]=void 0;continue}if(!I||_&&k.oldPos<v.oldPos?E=this.addToPath(v,!0,!1,0,a):E=this.addToPath(k,!1,!0,1,a),g=this.extractCommon(E,n,e,w,a),E.oldPos+1>=A&&g+1>=s)return o(this.buildValues(E.lastComponent,n,e))||!0;m[w]=E,E.oldPos+1>=A&&(b=Math.min(b,w-1)),g+1>=s&&(h=Math.max(h,w+1))}l++};if(r)(function w(){setTimeout(function(){if(l>u||Date.now()>p)return r(void 0);y()||w()},0)})();else for(;l<=u&&Date.now()<=p;){const w=y();if(w)return w}}addToPath(e,n,a,r,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===n&&o.removed===a?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:n,removed:a,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:a,previousComponent:o}}}extractCommon(e,n,a,r,i){const o=n.length,s=a.length;let A=e.oldPos,l=A-r,u=0;for(;l+1<o&&A+1<s&&this.equals(a[A+1],n[l+1],i);)l++,A++,u++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!i.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=A,l}equals(e,n,a){return a.comparator?a.comparator(e,n):e===n||!!a.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let a=0;a<e.length;a++)e[a]&&n.push(e[a]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,a){const r=[];let i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();const o=r.length;let s=0,A=0,l=0;for(;s<o;s++){const u=r[s];if(u.removed)u.value=this.join(a.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let d=n.slice(A,A+u.count);d=d.map(function(p,m){const g=a[l+m];return g.length>p.length?g:p}),u.value=this.join(d)}else u.value=this.join(n.slice(A,A+u.count));A+=u.count,u.added||(l+=u.count)}}return r}}class Wtt extends JK{}const Vtt=new Wtt;function Jtt(t,e,n){return Vtt.diff(t,e,n)}const Xie="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Xtt extends JK{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${Xie}]+|[^\\S\\n\\r]+|[^${Xie}]`,"ug");return e.match(n)||[]}}const ent=new Xtt;function tnt(t,e,n){return ent.diff(t,e,n)}class nnt extends JK{constructor(){super(...arguments),this.tokenize=rnt}equals(e,n,a){return a.ignoreWhitespace?((!a.newlineIsToken||!e.includes(`
209
+ \v\f…\u2028\u2029])`),e));else if(A==="posix")if(!r&&(u==="graph"||u==="print")){if(a==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];l&&(d=`\0-${Ti(d.codePointAt(0)-1)}${Ti(d.codePointAt(2)+1)}-􏿿`),n(Vr(sd(`[${d}]`),e))}else n(Vr(WT(sd(mtt.get(u)),l),e));else if(A==="property")JK.has(ES(u))||(t.key="sc");else if(A==="space")n(Xp(wb("space",{negate:l}),e));else if(A==="word")n(Vr(WT(sd(od),l),e));else throw new Error(`Unexpected character set kind "${A}"`)},Directive({node:t,parent:e,root:n,remove:a,replaceWith:r,removeAllPrevSiblings:i,removeAllNextSiblings:o}){const{kind:s,flags:A}=t;if(s==="flags")if(!A.enable&&!A.disable)a();else{const l=Xc({flags:A});l.body[0].body=o(),r(Vr(l,e),{traverse:!0})}else if(s==="keep"){const l=n.body[0],d=n.body.length===1&&zke(l,{type:"Group"})&&l.body[0].body.length===1?l.body[0]:n;if(e.parent!==d||d.body.length>1)throw new Error(Zn`Uses "\K" in a way that's unsupported`);const p=yf({behind:!0});p.body[0].body=i(),r(Vr(p,e))}else throw new Error(`Unexpected directive kind "${s}"`)},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:a}=t;if(a==="fail")n(Vr(yf({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${a.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=Xc();e.body[0].body.push(t.body),t.body=Vr(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const n=[];let a=!1,r=!1;for(const i of t.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const o=Ave(i.body);o?(a=!0,Array.isArray(o)?n.push(...o):n.push(o)):r=!0}a&&!r&&n.forEach(i=>e.add(i))},exit(t,{accuracy:e,passedLookbehind:n,strategy:a}){if(e==="strict"&&n&&a)throw new Error(Zn`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!ZT(n)&&(n=KT(n,e),t.ref=n)}},btt={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:a,ref:r}=t;a||n.set(t,[...e.get(r).map(({node:i})=>i)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:a},{groupOriginByCopy:r,groupsByName:i,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:A}){const l=r.get(t);if(l&&s.has(t.number)){const d=Xp(zie(t.number),e);A.set(d,s.get(t.number)),n(d);return}s.set(t.number,t),o.set(t.number,[]),t.name&&GB(o,t.name,[]);const u=o.get(t.name??t.number);for(let d=0;d<u.length;d++){const p=u[d];if(l===p.node||l&&l===p.origin||t===p.origin){u.splice(d,1);break}}if(o.get(t.number).push({node:t,origin:l}),t.name&&o.get(t.name).push({node:t,origin:l}),t.name){const d=GB(i,t.name,new Map);let p=!1;if(l)p=!0;else for(const m of d.values())if(!m.hasDuplicateNameToRemove){p=!0;break}i.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:p})}},exit({node:t},{openRefs:e}){e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=vD(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:n},a){const{isRecursive:r,ref:i}=t;if(r){let u=e;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===i||u.number===i)););a.reffedNodesByReferencer.set(t,u);return}const o=a.subroutineRefMap.get(i),s=i===0,A=s?zie(0):ive(o,a.groupOriginByCopy,null);let l=A;if(!s){const u=ove(Ett(o,p=>p.type==="Group"&&!!p.flags)),d=u?vD(a.globalFlags,u):a.globalFlags;Ctt(d,a.currentFlags)||(l=Xc({flags:Btt(d)}),l.body[0].body.push(A))}n(Vr(l,e),{traverse:!s})}},ytt={Backreference({node:t,parent:e,replaceWith:n},a){if(t.orphan){a.highestOrphanBackref=Math.max(a.highestOrphanBackref,t.ref);return}const i=a.reffedNodesByReferencer.get(t).filter(o=>wtt(o,t));if(!i.length)n(Vr(yf({negate:!0}),e));else if(i.length>1){const o=Xc({atomic:!0,body:i.reverse().map(s=>Zf({body:[F$(s.number)]}))});n(Vr(o,e))}else t.ref=i[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 a=0;a<n;a++){const r=Kke();t.body.at(-1).body.push(r)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function rve(t){ZE(t,{"*"({node:e,parent:n}){e.parent=n}})}function Ctt(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function wtt(t,e){let n=e;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===t)return!1;const a=sve(n.parent);for(const r of a){if(r===n)break;if(r===t||cve(r,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function ive(t,e,n,a){const r=Array.isArray(t)?[]:{};for(const[i,o]of Object.entries(t))i==="parent"?r.parent=Array.isArray(n)?a:n:o&&typeof o=="object"?r[i]=ive(o,e,r,n):(i==="type"&&o==="CapturingGroup"&&e.set(r,e.get(t)??t),r[i]=o);return r}function zie(t){const e=Wke(t);return e.isRecursive=!0,e}function Ett(t,e){const n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function KT(t,e){if(e.has(t))return e.get(t);const n=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,n),n}function ove(t){const e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:a})=>{e.forEach(r=>{a.enable?.[r]&&(delete n.disable[r],n.enable[r]=!0),a.disable?.[r]&&(n.disable[r]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Btt({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 sve(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function Ave(t){const e=t.find(n=>n.kind==="search_start"||Itt(n,{negate:!1})||!ktt(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 a of e.body){const r=Ave(a.body);if(!r)return null;Array.isArray(r)?n.push(...r):n.push(r)}return n}return null}function cve(t,e){const n=sve(t)??[];for(const a of n)if(a===e||cve(a,e))return!0;return!1}function ktt({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function vtt(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function Itt(t,e){const n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&zke(t.body[0],{type:"Assertion",kind:"search_start"})}function ZT(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function sd(t,e){const a=Yke(t,{...e,unicodePropertyMap:JK}).body;return a.length>1||a[0].body.length>1?Xc({body:a}):a[0].body[0]}function WT(t,e){return t.negate=e,t}function Xp(t,e){return t.parent=e,t}function Vr(t,e){return rve(t),t.parent=e,t}function Qtt(t,e){const n=tve(e),a=M$(n.target,"ES2024"),r=M$(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,s=null;if(!r){const m=[t.flags.ignoreCase];ZE(t,_tt,{getCurrentModI:()=>m.at(-1),popModI(){m.pop()},pushModI(g){m.push(g)},setHasCasedChar(){m.at(-1)?o=!0:s=!0}})}const A={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||o)&&!s)};let l=t;const u={accuracy:n.accuracy,appliedGlobalFlags:A,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:t._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!r&&o&&s),useFlagMods:r,useFlagV:a,verbose:n.verbose};function d(m){return u.lastNode=l,l=m,stt(xtt[m.type],`Unexpected node type "${m.type}"`)(m,u,d)}const p={pattern:t.body.map(d).join("|"),flags:d(t.flags),options:{...t.options}};return a||(delete p.options.force.v,p.options.disable.v=!0,p.options.unicodeSetsPlugin=null),p._captureTransfers=new Map,p._hiddenCaptures=[],u.captureMap.forEach((m,g)=>{m.hidden&&p._hiddenCaptures.push(g),m.transferTo&&GB(p._captureTransfers,m.transferTo,[]).push(g)}),p}var _tt={"*":{enter({node:t},e){if(Kie(t)){const n=e.getCurrentModI();e.pushModI(t.flags?vD({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){Kie(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){XK(Ti(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),lve(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&ave.has(t.value)&&e.setHasCasedChar()}},xtt={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?Zn`\B`:Zn`\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:a,name:r,number:i}=t,o={ignoreCase:e.currentFlags.ignoreCase},s=e.originMap.get(t);return s&&(o.hidden=!0,i>s.number&&(o.transferTo=s.number)),e.captureMap.set(i,o),`(${r?`?<${r}>`:""}${a.map(n).join("|")})`},Character({value:t},e){const n=Ti(t),a=Xh(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(a!==n)return a;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&XK(n)){const r=nve(n);return e.inCharClass?r.join(""):r.length>1?`[${r.join("")}]`:r[0]}return n},CharacterClass(t,e,n){const{kind:a,negate:r,parent:i}=t;let{body:o}=t;if(a==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Ld.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&o.some(Zie)&&(o=[wS(45),...o.filter(l=>!Zie(l))]);const s=()=>`[${r?"^":""}${o.map(n).join(a==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||Ld.bugNestedClassIgnoresNegation)&&!r){const u=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){const d=Xc(),p=d.body[0];return d.parent=i,p.parent=d,o=o.filter(m=>!u.includes(m)),t.body=o,o.length?(t.parent=p,p.body.push(t)):d.body.pop(),u.forEach(m=>{const g=Zf({body:[m]});m.parent=g,g.parent=d,d.body.push(g)}),n(d)}}e.inCharClass=!0;const l=s();return e.inCharClass=!1,l}const A=o[0];if(a==="union"&&!r&&A&&((!e.useFlagV||!e.verbose)&&i.kind==="union"&&!(Ld.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&i.kind==="intersection"&&o.length===1&&A.type!=="CharacterClassRange"))return o.map(n).join("");if(!e.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return s()},CharacterClassRange(t,e){const n=t.min.value,a=t.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},i=Xh(n,r),o=Xh(a,r),s=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const A=lve(t);Ttt(A).forEach(u=>{s.add(Array.isArray(u)?`${Xh(u[0],r)}-${Xh(u[1],r)}`:Xh(u,r))})}return`${i}-${o}${[...s].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:a},r){if(t==="dot")return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":Zn`[^\n]`;if(t==="digit")return e?Zn`\D`:Zn`\d`;if(t==="property"){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&ave.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?Zn`\P`:Zn`\p`}{${a?`${a}=`:""}${n}}`}if(t==="word")return e?Zn`\W`:Zn`\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:a},r,i){const o=r.currentFlags;n&&(r.currentFlags=vD(o,n));const s=e.map(i).join("|"),A=!r.verbose&&e.length===1&&a.type!=="Quantifier"&&!t&&(!r.useFlagMods||!n)?s:`(?${Rtt(t,n,r.useFlagMods)}${s})`;return r.currentFlags=o,A},LookaroundAssertion({body:t,kind:e,negate:n},a,r){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(r).join("|")})`},Quantifier(t,e,n){return n(t.body)+Mtt(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const a=n.recursionLimit;return e===0?`(?R=${a})`:Zn`\g<${e}&R=${a}>`}},Dtt=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Stt=new Set(["-","\\","]","^","["]),Ntt=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Yie=new Map([[9,Zn`\t`],[10,Zn`\n`],[11,Zn`\v`],[12,Zn`\f`],[13,Zn`\r`],[8232,Zn`\u2028`],[8233,Zn`\u2029`],[65279,Zn`\uFEFF`]]),Ftt=new RegExp("^\\p{Cased}$","u");function XK(t){return Ftt.test(t)}function lve(t,e){const n=!!e?.firstOnly,a=t.min.value,r=t.max.value,i=[];if(a<65&&(r===65535||r>=131071)||a===65536&&r>=131071)return i;for(let o=a;o<=r;o++){const s=Ti(o);if(!XK(s))continue;const A=nve(s).filter(l=>{const u=l.codePointAt(0);return u<a||u>r});if(A.length&&(i.push(...A),n))break}return i}function Xh(t,{escDigit:e,inCharClass:n,useFlagV:a}){if(Yie.has(t))return Yie.get(t);if(t<32||t>126&&t<160||t>262143||e&&Ltt(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const r=n?a?Ntt:Stt:Dtt,i=Ti(t);return(r.has(i)?"\\":"")+i}function Ttt(t){const e=t.map(r=>r.codePointAt(0)).sort((r,i)=>r-i),n=[];let a=null;for(let r=0;r<e.length;r++)e[r+1]===e[r]+1?a??=e[r]:a===null?n.push(e[r]):(n.push([a,e[r]]),a=null);return n}function Rtt(t,e,n){if(t)return">";let a="";if(e&&n){const{enable:r,disable:i}=e;a=(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")+(i?"-":"")+(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")}return`${a}:`}function Mtt({kind:t,max:e,min:n}){let a;return!n&&e===1?a="?":!n&&e===1/0?a="*":n===1&&e===1/0?a="+":n===e?a=`{${n}}`:a=`{${n},${e===1/0?"":e}}`,a+{greedy:"",lazy:"?",possessive:"+"}[t]}function Kie({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function Ltt(t){return t>47&&t<58}function Zie({type:t,value:e}){return t==="Character"&&e===45}var Ott=class L$ extends RegExp{#t=new Map;#e=null;#a;#n=null;#r=null;rawOptions={};get source(){return this.#a||"(?:)"}constructor(e,n,a){const r=!!a?.lazyCompile;if(e instanceof RegExp){if(a)throw new Error("Cannot provide options when copying a regexp");const i=e;super(i,n),this.#a=i.source,i instanceof L$&&(this.#t=i.#t,this.#n=i.#n,this.#r=i.#r,this.rawOptions=i.rawOptions)}else{const i={hiddenCaptures:[],strategy:null,transfers:[],...a};super(r?"":e,n),this.#a=e,this.#t=Ptt(i.hiddenCaptures,i.transfers),this.#r=i.strategy,this.rawOptions=a??{}}r||(this.#e=this)}exec(e){if(!this.#e){const{lazyCompile:r,...i}=this.rawOptions;this.#e=new L$(this.#a,this.flags,i)}const n=this.global||this.sticky,a=this.lastIndex;if(this.#r==="clip_search"&&n&&a){this.lastIndex=0;const r=this.#i(e.slice(a));return r&&(Gtt(r,a,e,this.hasIndices),this.lastIndex+=a),r}return this.#i(e)}#i(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 a=[...n];n.length=1;let r;this.hasIndices&&(r=[...n.indices],n.indices.length=1);const i=[0];for(let o=1;o<a.length;o++){const{hidden:s,transferTo:A}=this.#t.get(o)??{};if(s?i.push(null):(i.push(n.length),n.push(a[o]),this.hasIndices&&n.indices.push(r[o])),A&&a[o]!==void 0){const l=i[A];if(!l)throw new Error(`Invalid capture transfer to "${l}"`);if(n[l]=a[o],this.hasIndices&&(n.indices[l]=r[o]),n.groups){this.#n||(this.#n=qtt(this.source));const u=this.#n.get(A);u&&(n.groups[u]=a[o],this.hasIndices&&(n.indices.groups[u]=r[o]))}}}return n}};function Gtt(t,e,n,a){if(t.index+=e,t.input=n,a){const r=t.indices;for(let o=0;o<r.length;o++){const s=r[o];s&&(r[o]=[s[0]+e,s[1]+e])}const i=r.groups;i&&Object.keys(i).forEach(o=>{const s=i[o];s&&(i[o]=[s[0]+e,s[1]+e])})}}function Ptt(t,e){const n=new Map;for(const a of t)n.set(a,{hidden:!0});for(const[a,r]of e)for(const i of r)GB(n,i,{}).transferTo=a;return n}function qtt(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let a=0,r=0,i;for(;i=e.exec(t);){const{0:o,groups:{capture:s,name:A}}=i;o==="["?a++:a?o==="]"&&a--:s&&(r++,A&&n.set(r,A))}return n}function Utt(t,e){const n=$tt(t,e);return n.options?new Ott(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function $tt(t,e){const n=tve(e),a=Yke(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:JK}),r=ftt(a,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Qtt(r,n),o=itt(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),s=att(o.pattern),A=ntt(s.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),l={pattern:A.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const u=A.hiddenCaptures.sort((g,h)=>g-h),d=Array.from(A.captureTransfers),p=r._strategy,m=l.pattern.length>=n.lazyCompileLength;(u.length||d.length||p||m)&&(l.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...p&&{strategy:p},...m&&{lazyCompile:m}})}return l}const Wie=4294967295;class jtt{constructor(e,n={}){this.patterns=e,this.options=n;const{forgiving:a=!1,cache:r,regexConstructor:i}=n;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=r?.get(o);if(s){if(s instanceof RegExp)return s;if(a)return null;throw s}try{const A=i(o);return r?.set(o,A),A}catch(A){if(r?.set(o,A),a)return null;throw A}})}regexps;findNextMatchSync(e,n,a){const r=typeof e=="string"?e:e.content,i=[];function o(s,A,l=0){return{index:s,captureIndices:A.indices.map(u=>u==null?{start:Wie,end:Wie,length:0}:{start:u[0]+l,end:u[1]+l,length:u[1]-u[0]})}}for(let s=0;s<this.regexps.length;s++){const A=this.regexps[s];if(A)try{A.lastIndex=n;const l=A.exec(r);if(!l)continue;if(l.index===n)return o(s,l,0);i.push([s,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(i.length){const s=Math.min(...i.map(A=>A[1].index));for(const[A,l,u]of i)if(l.index===s)return o(A,l,u)}return null}}function Htt(t,e){return Utt(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function uve(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=n=>Htt(n,{target:e.target}),{createScanner(n){return new jtt(n,e)},createString(n){return{content:n}}}}async function dve(t){if(JBe())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=RT.get(t);if(e!=null)return e;try{const n=YK[t];if(n==null)throw new Error(`resolveLanguage: "${t}" not found in bundled languages`);const a=n().then(({default:r})=>{const i={name:t,data:r};return Kf.has(t)||Kf.set(t,i),i});return RT.set(t,a),await a}finally{RT.delete(t)}}function pve(t){return Kf.get(t)??dve(t)}async function mve(t){if(JBe())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=TT.get(t);if(e!=null)return e;try{const n=h$.get(t)??Oke[t];if(n==null)throw new Error(`resolveTheme: No valid loader for ${t}`);const a=n().then(i=>ztt(t,"default"in i?i.default:i));TT.set(t,a);const r=await a;if(r.name!==t)throw new Error(`resolvedTheme: themeName: ${t} does not match theme.name: ${r.name}`);return Md.set(r.name,r),r}finally{TT.delete(t)}}function ztt(t,e){const n=Md.get(t);return n??(e=bS(e),Md.set(t,e),e)}function gve(t){return Md.get(t)??mve(t)}function fve(t,e){if(h$.has(t)){console.error("SharedHighlight.registerCustomTheme: theme name already registered",t);return}h$.set(t,e)}let Kl;async function O$({themes:t,langs:e}){Kl??=Pke({themes:[],langs:["text"],engine:uve()});const n=Ktt(Kl)?await Kl:Kl;Kl=n;const a=[];for(const i of e){if(i==="text")continue;const o=pve(i);"then"in o?a.push(o):sie(o,n)}const r=[];for(const i of t){const o=gve(i);"then"in o?r.push(o):y$(o,Kl)}return(a.length>0||r.length>0)&&await Promise.all([Promise.all(a).then(i=>{sie(i,n)}),Promise.all(r).then(i=>{y$(i,n)})]),n}function Ytt(){if(Kl!=null&&!("then"in Kl))return Kl}function Ktt(t=Kl){return t!=null&&"then"in t}fve("pierre-dark",()=>_e(()=>Promise.resolve().then(()=>zOt),void 0));fve("pierre-light",()=>_e(()=>Promise.resolve().then(()=>KOt),void 0));function ID(t=Vs){const e=[];return typeof t=="string"?e.push(t):(e.push(t.dark),e.push(t.light)),e}function Vie(t){for(const e of t)if(!Md.has(e))return!1;return!0}function eZ(t,e){return t==null||e==null||typeof t=="string"||typeof e=="string"?t===e:t.dark===e.dark&&t.light===e.light}const JC={"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 Em(t){if(JC[t]!=null)return JC[t];const e=t.match(/\.([^/\\]+\.[^/\\]+)$/);return e!=null&&JC[e[1]]!=null?JC[e[1]]??"text":JC[t.match(/\.([^.]+)$/)?.[1]??""]??"text"}function Wf(t){return t.replace(/\n$|\r\n$/,"")}function Sm(t){return{type:"text",value:t}}function Ta({tagName:t,children:e=[],properties:n={}}){return{type:"element",tagName:t,properties:n,children:e}}function G$({name:t,width:e=16,height:n=16,properties:a}){return Ta({tagName:"svg",properties:{width:e,height:n,viewBox:"0 0 16 16",...a},children:[Ta({tagName:"use",properties:{href:`#${t.replace(/^#/,"")}`}})]})}function Ztt(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 Wtt(t,e,n){const a=typeof n.lineInfo=="function"?n.lineInfo(e):n.lineInfo[e];if(a==null)throw console.error({node:t,line:e,state:n}),new Error(`processLine: line ${e}, contains no state.lineInfo`);return t.tagName="span",t.properties["data-column-content"]="",t.children.length===0&&t.children.push(Sm(`
210
+ `)),Ta({tagName:"div",children:[Ta({tagName:"span",children:[Ta({tagName:"span",children:[{type:"text",value:`${a.lineNumber}`}],properties:{"data-line-number-content":""}})],properties:{"data-column-number":""}}),t],properties:{"data-line":a.lineNumber,"data-alt-line":a.altLineNumber,"data-line-type":a.type,"data-line-index":a.lineIndex}})}function Vtt(t={}){const{classPrefix:e="__shiki_",classSuffix:n="",classReplacer:a=s=>s}=t,r=new Map;function i(s){return Object.entries(s).map(([A,l])=>`${A}:${l}`).join(";")}function o(s){const A=typeof s=="string"?s:i(s);let l=e+Jtt(A)+n;return l=a(l),r.has(l)||r.set(l,typeof s=="string"?s:{...s}),l}return{name:"@shikijs/transformers:style-to-class",pre(s){if(!s.properties.style)return;const A=o(s.properties.style);delete s.properties.style,this.addClassToHast(s,A)},tokens(s){for(const A of s)for(const l of A){if(!l.htmlStyle)continue;const u=o(l.htmlStyle);l.htmlStyle={},l.htmlAttrs||={},l.htmlAttrs.class?l.htmlAttrs.class+=` ${u}`:l.htmlAttrs.class=u}},getClassRegistry(){return r},getCSS(){let s="";for(const[A,l]of r.entries())s+=`.${A}{${typeof l=="string"?l:i(l)}}`;return s},clearRegistry(){r.clear()}}}function Jtt(t,e=0){let n=3735928559^e,a=1103547991^e;for(let r=0,i;r<t.length;r++)i=t.charCodeAt(r),n=Math.imul(n^i,2654435761),a=Math.imul(a^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(a^a>>>13,3266489909),a=Math.imul(a^a>>>16,2246822507),a^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&a)+(n>>>0)).toString(36).slice(0,6)}function hve(t=!1){const e={lineInfo:{}},n=[{line(a){return delete a.properties.class,a},pre(a){const r=Ztt(a),i=[];if(r!=null){let o=1;for(const s of r.children)s.type==="element"&&(i.push(Wtt(s,o,e)),o++);r.children=i}return a}}];return t&&n.push(Xtt,Jie),{state:e,transformers:n,toClass:Jie}}const Jie=Vtt({classPrefix:"hl-"}),Xtt={name:"token-style-normalizer",tokens(t){for(const e of t)for(const n of e){if(n.htmlStyle!=null)continue;const a={};n.color!=null&&(a.color=n.color),n.bgColor!=null&&(a["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(a["font-style"]="italic"),(n.fontStyle&2)!==0&&(a["font-weight"]="bold"),(n.fontStyle&4)!==0&&(a["text-decoration"]="underline")),Object.keys(a).length>0&&(n.htmlStyle=a)}}};function IA(t="diffs"){return`--${t}-`}function bve({theme:t=Vs,highlighter:e,prefix:n}){let a="";if(typeof t=="string"){const r=e.getTheme(t);a+=`color:${r.fg};`,a+=`background-color:${r.bg};`,a+=`${IA(n)}fg:${r.fg};`,a+=`${IA(n)}bg:${r.bg};`,a+=VT(r,n)}else{let r=e.getTheme(t.dark);a+=`${IA(n)}dark:${r.fg};`,a+=`${IA(n)}dark-bg:${r.bg};`,a+=VT(r,n,"dark"),r=e.getTheme(t.light),a+=`${IA(n)}light:${r.fg};`,a+=`${IA(n)}light-bg:${r.bg};`,a+=VT(r,n,"light")}return a}function VT(t,e,n){n=n!=null?`${n}-`:"";let a="";const r=t.colors?.["gitDecoration.addedResourceForeground"]??t.colors?.["terminal.ansiGreen"];r!=null&&(a+=`${IA(e)}${n}addition-color:${r};`);const i=t.colors?.["gitDecoration.deletedResourceForeground"]??t.colors?.["terminal.ansiRed"];i!=null&&(a+=`${IA(e)}${n}deletion-color:${i};`);const o=t.colors?.["gitDecoration.modifiedResourceForeground"]??t.colors?.["terminal.ansiBlue"];return o!=null&&(a+=`${IA(e)}${n}modified-color:${o};`),a}function P$(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 ent(t,e,{theme:n=Vs,tokenizeMaxLineLength:a},r=!1){const{state:i,transformers:o}=hve(),s=r?"text":t.lang??Em(t.name),A=(()=>{if(typeof n=="string")return e.getTheme(n).type})(),l=bve({theme:n,highlighter:e});i.lineInfo=d=>({type:"context",lineIndex:d-1,lineNumber:d});const u=typeof n=="string"?{lang:s,theme:n,transformers:o,defaultColor:!1,cssVariablePrefix:IA(),tokenizeMaxLineLength:a}:{lang:s,themes:n,transformers:o,defaultColor:!1,cssVariablePrefix:IA(),tokenizeMaxLineLength:a};return{code:P$(e.codeToHast(Wf(t.contents),u)),themeStyles:l,baseThemeType:A}}class tZ{diff(e,n,a={}){let r;typeof a=="function"?(r=a,a={}):"callback"in a&&(r=a.callback);const i=this.castInput(e,a),o=this.castInput(n,a),s=this.removeEmpty(this.tokenize(i,a)),A=this.removeEmpty(this.tokenize(o,a));return this.diffWithOptionsObj(s,A,a,r)}diffWithOptionsObj(e,n,a,r){var i;const o=w=>{if(w=this.postProcess(w,a),r){setTimeout(function(){r(w)},0);return}else return w},s=n.length,A=e.length;let l=1,u=s+A;a.maxEditLength!=null&&(u=Math.min(u,a.maxEditLength));const d=(i=a.timeout)!==null&&i!==void 0?i:1/0,p=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(m[0],n,e,0,a);if(m[0].oldPos+1>=A&&g+1>=s)return o(this.buildValues(m[0].lastComponent,n,e));let h=-1/0,b=1/0;const y=()=>{for(let w=Math.max(h,-l);w<=Math.min(b,l);w+=2){let E;const k=m[w-1],v=m[w+1];k&&(m[w-1]=void 0);let _=!1;if(v){const x=v.oldPos-w;_=v&&0<=x&&x<s}const I=k&&k.oldPos+1<A;if(!_&&!I){m[w]=void 0;continue}if(!I||_&&k.oldPos<v.oldPos?E=this.addToPath(v,!0,!1,0,a):E=this.addToPath(k,!1,!0,1,a),g=this.extractCommon(E,n,e,w,a),E.oldPos+1>=A&&g+1>=s)return o(this.buildValues(E.lastComponent,n,e))||!0;m[w]=E,E.oldPos+1>=A&&(b=Math.min(b,w-1)),g+1>=s&&(h=Math.max(h,w+1))}l++};if(r)(function w(){setTimeout(function(){if(l>u||Date.now()>p)return r(void 0);y()||w()},0)})();else for(;l<=u&&Date.now()<=p;){const w=y();if(w)return w}}addToPath(e,n,a,r,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===n&&o.removed===a?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:n,removed:a,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:a,previousComponent:o}}}extractCommon(e,n,a,r,i){const o=n.length,s=a.length;let A=e.oldPos,l=A-r,u=0;for(;l+1<o&&A+1<s&&this.equals(a[A+1],n[l+1],i);)l++,A++,u++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!i.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=A,l}equals(e,n,a){return a.comparator?a.comparator(e,n):e===n||!!a.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let a=0;a<e.length;a++)e[a]&&n.push(e[a]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,a){const r=[];let i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();const o=r.length;let s=0,A=0,l=0;for(;s<o;s++){const u=r[s];if(u.removed)u.value=this.join(a.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let d=n.slice(A,A+u.count);d=d.map(function(p,m){const g=a[l+m];return g.length>p.length?g:p}),u.value=this.join(d)}else u.value=this.join(n.slice(A,A+u.count));A+=u.count,u.added||(l+=u.count)}}return r}}class tnt extends tZ{}const nnt=new tnt;function ant(t,e,n){return nnt.diff(t,e,n)}const Xie="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class rnt extends tZ{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${Xie}]+|[^\\S\\n\\r]+|[^${Xie}]`,"ug");return e.match(n)||[]}}const int=new rnt;function ont(t,e,n){return int.diff(t,e,n)}class snt extends tZ{constructor(){super(...arguments),this.tokenize=cnt}equals(e,n,a){return a.ignoreWhitespace?((!a.newlineIsToken||!e.includes(`
211
211
  `))&&(e=e.trim()),(!a.newlineIsToken||!n.includes(`
212
212
  `))&&(n=n.trim())):a.ignoreNewlineAtEof&&!a.newlineIsToken&&(e.endsWith(`
213
213
  `)&&(e=e.slice(0,-1)),n.endsWith(`
214
- `)&&(n=n.slice(0,-1))),super.equals(e,n,a)}}const ant=new nnt;function eoe(t,e,n){return ant.diff(t,e,n)}function rnt(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
215
- `));const n=[],a=t.split(/(\n|\r\n)/);a[a.length-1]||a.pop();for(let r=0;r<a.length;r++){const i=a[r];r%2&&!e.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function int(t,e,n,a,r,i,o){let s;s={},typeof s.context>"u"&&(s.context=4);const A=s.context;if(s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){const{callback:u}=s;eoe(n,a,Object.assign(Object.assign({},s),{callback:d=>{const p=l(d);u(p)}}))}else return l(eoe(n,a,s));function l(u){if(!u)return;u.push({value:"",lines:[]});function d(w){return w.map(function(E){return" "+E})}const p=[];let m=0,g=0,h=[],b=1,y=1;for(let w=0;w<u.length;w++){const E=u[w],k=E.lines||snt(E.value);if(E.lines=k,E.added||E.removed){if(!m){const v=u[w-1];m=b,g=y,v&&(h=A>0?d(v.lines.slice(-A)):[],m-=h.length,g-=h.length)}for(const v of k)h.push((E.added?"+":"-")+v);E.added?y+=k.length:b+=k.length}else{if(m)if(k.length<=A*2&&w<u.length-2)for(const v of d(k))h.push(v);else{const v=Math.min(k.length,A);for(const I of d(k.slice(0,v)))h.push(I);const _={oldStart:m,oldLines:b-m+v,newStart:g,newLines:y-g+v,lines:h};p.push(_),m=0,g=0,h=[]}b+=k.length,y+=k.length}}for(const w of p)for(let E=0;E<w.lines.length;E++)w.lines[E].endsWith(`
216
- `)?w.lines[E]=w.lines[E].slice(0,-1):(w.lines.splice(E+1,0,"\"),E++);return{oldFileName:t,newFileName:e,oldHeader:r,newHeader:i,hunks:p}}}function hve(t){if(Array.isArray(t))return t.map(hve).join(`
214
+ `)&&(n=n.slice(0,-1))),super.equals(e,n,a)}}const Ant=new snt;function eoe(t,e,n){return Ant.diff(t,e,n)}function cnt(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
215
+ `));const n=[],a=t.split(/(\n|\r\n)/);a[a.length-1]||a.pop();for(let r=0;r<a.length;r++){const i=a[r];r%2&&!e.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function lnt(t,e,n,a,r,i,o){let s;s={},typeof s.context>"u"&&(s.context=4);const A=s.context;if(s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){const{callback:u}=s;eoe(n,a,Object.assign(Object.assign({},s),{callback:d=>{const p=l(d);u(p)}}))}else return l(eoe(n,a,s));function l(u){if(!u)return;u.push({value:"",lines:[]});function d(w){return w.map(function(E){return" "+E})}const p=[];let m=0,g=0,h=[],b=1,y=1;for(let w=0;w<u.length;w++){const E=u[w],k=E.lines||dnt(E.value);if(E.lines=k,E.added||E.removed){if(!m){const v=u[w-1];m=b,g=y,v&&(h=A>0?d(v.lines.slice(-A)):[],m-=h.length,g-=h.length)}for(const v of k)h.push((E.added?"+":"-")+v);E.added?y+=k.length:b+=k.length}else{if(m)if(k.length<=A*2&&w<u.length-2)for(const v of d(k))h.push(v);else{const v=Math.min(k.length,A);for(const I of d(k.slice(0,v)))h.push(I);const _={oldStart:m,oldLines:b-m+v,newStart:g,newLines:y-g+v,lines:h};p.push(_),m=0,g=0,h=[]}b+=k.length,y+=k.length}}for(const w of p)for(let E=0;E<w.lines.length;E++)w.lines[E].endsWith(`
216
+ `)?w.lines[E]=w.lines[E].slice(0,-1):(w.lines.splice(E+1,0,"\"),E++);return{oldFileName:t,newFileName:e,oldHeader:r,newHeader:i,hunks:p}}}function yve(t){if(Array.isArray(t))return t.map(yve).join(`
217
217
  `);const e=[];t.oldFileName==t.newFileName&&e.push("Index: "+t.oldFileName),e.push("==================================================================="),e.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),e.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader));for(let n=0;n<t.hunks.length;n++){const a=t.hunks[n];a.oldLines===0&&(a.oldStart-=1),a.newLines===0&&(a.newStart-=1),e.push("@@ -"+a.oldStart+","+a.oldLines+" +"+a.newStart+","+a.newLines+" @@");for(const r of a.lines)e.push(r)}return e.join(`
218
218
  `)+`
219
- `}function ont(t,e,n,a,r,i,o){{const s=int(t,e,n,a,r,i);return s?hve(s):void 0}}function snt(t){const e=t.endsWith(`
219
+ `}function unt(t,e,n,a,r,i,o){{const s=lnt(t,e,n,a,r,i);return s?yve(s):void 0}}function dnt(t){const e=t.endsWith(`
220
220
  `),n=t.split(`
221
221
  `).map(a=>a+`
222
- `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function toe({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 YQ({item:t,arr:e,enableJoin:n,isNeutral:a=!1,isLastItem:r=!1}){const i=e[e.length-1];if(i==null||r||!n){e.push([a?0:1,t.value]);return}const o=i[0]===0;if(a===o||a&&t.value.length===1&&!o){i[1]+=t.value;return}e.push([a?0:1,t.value])}function bve(t,e,n,a=!1){const r=(()=>{const l=n.theme??Vs;if(typeof l=="string")return e.getTheme(l).type})(),i=fve({theme:n.theme,highlighter:e});if(t.newLines!=null&&t.oldLines!=null){const{oldContent:l,newContent:u,oldInfo:d,newInfo:p,oldDecorations:m,newDecorations:g}=noe({hunks:t.hunks,oldLines:t.oldLines,newLines:t.newLines,lineDiffType:n.lineDiffType});return{code:aoe({oldFile:{name:t.prevName??t.name,contents:l},oldInfo:d,oldDecorations:m,newFile:{name:t.name,contents:u},newInfo:p,newDecorations:g,highlighter:e,options:n,languageOverride:a?"text":t.lang}),themeStyles:i,baseThemeType:r}}const o=[];let s=0,A=0;for(const l of t.hunks){const{oldContent:u,newContent:d,oldInfo:p,newInfo:m,oldDecorations:g,newDecorations:h,splitLineIndex:b,unifiedLineIndex:y}=noe({hunks:[l],splitLineIndex:s,unifiedLineIndex:A,lineDiffType:n.lineDiffType}),w={name:t.prevName??t.name,contents:u},E={name:t.name,contents:d};o.push(aoe({oldFile:w,oldInfo:p,oldDecorations:g,newFile:E,newInfo:m,newDecorations:h,highlighter:e,options:n,languageOverride:a?"text":t.lang})),s=b,A=y}return{code:(()=>{if(o.length<=1){const l=o[0]??{oldLines:[],newLines:[]};if(l.newLines.length===0||l.oldLines.length===0)return l}return{hunks:o}})(),themeStyles:i,baseThemeType:r}}function Ant({oldLine:t,newLine:e,oldLineIndex:n,newLineIndex:a,oldDecorations:r,newDecorations:i,lineDiffType:o}){if(t==null||e==null||o==="none")return;t=Wf(t),e=Wf(e);const s=o==="char"?Jtt(t,e):tnt(t,e),A=[],l=[],u=o==="word-alt";for(const p of s){const m=p===s[s.length-1];!p.added&&!p.removed?(YQ({item:p,arr:A,enableJoin:u,isNeutral:!0,isLastItem:m}),YQ({item:p,arr:l,enableJoin:u,isNeutral:!0,isLastItem:m})):p.removed?YQ({item:p,arr:A,enableJoin:u,isLastItem:m}):YQ({item:p,arr:l,enableJoin:u,isLastItem:m})}let d=0;for(const p of A)p[0]===1&&r.push(toe({line:n-1,spanStart:d,spanLength:p[1].length})),d+=p[1].length;d=0;for(const p of l)p[0]===1&&i.push(toe({line:a-1,spanStart:d,spanLength:p[1].length})),d+=p[1].length}function noe({hunks:t,oldLines:e,newLines:n,splitLineIndex:a=0,unifiedLineIndex:r=0,lineDiffType:i}){const o={},s={},A=[],l=[];let u=1,d=1,p=1,m=1,g="",h="";for(const b of t){for(;e!=null&&n!=null&&u<b.additionStart&&d<b.deletionStart;)o[d]={type:"context-expanded",lineNumber:m,altLineNumber:p,lineIndex:`${r},${a}`},s[u]={type:"context-expanded",lineNumber:p,altLineNumber:m,lineIndex:`${r},${a}`},g+=e[d-1],h+=n[u-1],d++,u++,m++,p++,a++,r++;m=b.deletionStart,p=b.additionStart;for(const y of b.hunkContent)if(y.type==="context")for(const w of y.lines)o[d]={type:"context",lineNumber:m,altLineNumber:p,lineIndex:`${r},${a}`},s[u]={type:"context",lineNumber:p,altLineNumber:m,lineIndex:`${r},${a}`},g+=w,h+=w,d++,u++,p++,m++,a++,r++;else{const w=Math.max(y.additions.length,y.deletions.length);let E=0,k=r;for(;E<w;){const v=y.deletions[E],_=y.additions[E];Ant({newLine:_,oldLine:v,oldLineIndex:d,newLineIndex:u,oldDecorations:A,newDecorations:l,lineDiffType:i}),v!=null&&(o[d]={type:"change-deletion",lineNumber:m,lineIndex:`${k},${a}`},g+=v,d++,m++),_!=null&&(s[u]={type:"change-addition",lineNumber:p,lineIndex:`${k+y.deletions.length},${a}`},h+=_,u++,p++),a++,k++,E++}r+=y.additions.length+y.deletions.length}if(!(e==null||n==null||b!==t[t.length-1]))for(;d<=e.length||u<=e.length;){const y=e[d-1],w=n[u-1];if(y==null&&w==null)break;y!=null&&(o[d]={type:"context-expanded",lineNumber:m,altLineNumber:p,lineIndex:`${r},${a}`},g+=y,d++,m++),w!=null&&(s[u]={type:"context-expanded",lineNumber:p,altLineNumber:m,lineIndex:`${r},${a}`},h+=w,u++,p++),a++,r++}}return{oldContent:Wf(g),newContent:Wf(h),oldInfo:o,newInfo:s,oldDecorations:A,newDecorations:l,splitLineIndex:a,unifiedLineIndex:r}}function aoe({oldFile:t,newFile:e,oldInfo:n,newInfo:a,highlighter:r,oldDecorations:i,newDecorations:o,languageOverride:s,options:{theme:A=Vs,...l}}){const u=s??Em(t.name),d=s??Em(e.name),{state:p,transformers:m}=gve(),g=typeof A=="string"?{...l,lang:"text",theme:A,transformers:m,decorations:void 0,defaultColor:!1,cssVariablePrefix:IA()}:{...l,lang:"text",themes:A,transformers:m,decorations:void 0,defaultColor:!1,cssVariablePrefix:IA()};return{oldLines:t.contents===""?[]:(g.lang=u,p.lineInfo=n,g.decorations=i,P$(r.codeToHast(t.contents,g))),newLines:e.contents===""?[]:(g.lang=d,g.decorations=o,p.lineInfo=a,P$(r.codeToHast(e.contents,g)))}}function roe(t){const e=[];for(const n of t){const a=Kf.get(n);if(a==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);e.push(a)}return e}function ioe(t){for(const e of Array.isArray(t)?t:[t])if(!Kf.has(e))return!1;return!0}async function ooe(t){const e=[],n=[];for(const a of t){if(a==="text")continue;const r=uve(a)??lve(a);"then"in r?n.push(r):e.push(r)}return n.length>0&&await Promise.all(n).then(a=>{for(const r of a){if(r==null)throw new Error("resolvedLanguages: unable to resolve language");e.push(r)}}),e}function soe(t){const e=[];for(const n of t){const a=Md.get(n);if(a==null)throw new Error(`getAllResolvedThemes: ${n} is unresolved, you must resolve all necessary themes before calling this function`);e.push(a)}return e}async function Aoe(t){const e=[],n=[];for(const a of t){const r=pve(a)??dve(a);"then"in r?n.push(r):e.push(r)}return n.length>0&&await Promise.all(n).then(a=>{for(const r of a)r!=null&&e.push(r)}),e}var Gw={exports:{}},cnt=Gw.exports,coe;function lnt(){return coe||(coe=1,(function(t,e){(function(n,a){a(e)})(cnt,function(n){const a=Symbol("newer"),r=Symbol("older");class i{constructor(d,p){typeof d!="number"&&(p=d,d=0),this.size=0,this.limit=d,this.oldest=this.newest=void 0,this._keymap=new Map,p&&(this.assign(p),d<1&&(this.limit=this.size))}_markEntryAsUsed(d){d!==this.newest&&(d[a]&&(d===this.oldest&&(this.oldest=d[a]),d[a][r]=d[r]),d[r]&&(d[r][a]=d[a]),d[a]=void 0,d[r]=this.newest,this.newest&&(this.newest[a]=d),this.newest=d)}assign(d){let p,m=this.limit||Number.MAX_VALUE;this._keymap.clear();let g=d[Symbol.iterator]();for(let h=g.next();!h.done;h=g.next()){let b=new o(h.value[0],h.value[1]);if(this._keymap.set(b.key,b),p?(p[a]=b,b[r]=p):this.oldest=b,p=b,m--==0)throw new Error("overflow")}this.newest=p,this.size=this._keymap.size}get(d){var p=this._keymap.get(d);return p?(this._markEntryAsUsed(p),p.value):void 0}set(d,p){var m=this._keymap.get(d);return m?(m.value=p,this._markEntryAsUsed(m),this):(this._keymap.set(d,m=new o(d,p)),this.newest?(this.newest[a]=m,m[r]=this.newest):this.oldest=m,this.newest=m,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var d=this.oldest;if(d)return this.oldest[a]?(this.oldest=this.oldest[a],this.oldest[r]=void 0):(this.oldest=void 0,this.newest=void 0),d[a]=d[r]=void 0,this._keymap.delete(d.key),--this.size,[d.key,d.value]}find(d){let p=this._keymap.get(d);return p?p.value:void 0}has(d){return this._keymap.has(d)}delete(d){var p=this._keymap.get(d);return p?(this._keymap.delete(p.key),p[a]&&p[r]?(p[r][a]=p[a],p[a][r]=p[r]):p[a]?(p[a][r]=void 0,this.oldest=p[a]):p[r]?(p[r][a]=void 0,this.newest=p[r]):this.oldest=this.newest=void 0,this.size--,p.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new A(this.oldest)}values(){return new l(this.oldest)}entries(){return this}[Symbol.iterator](){return new s(this.oldest)}forEach(d,p){typeof p!="object"&&(p=this);let m=this.oldest;for(;m;)d.call(p,m.value,m.key,this),m=m[a]}toJSON(){for(var d=new Array(this.size),p=0,m=this.oldest;m;)d[p++]={key:m.key,value:m.value},m=m[a];return d}toString(){for(var d="",p=this.oldest;p;)d+=String(p.key)+":"+p.value,p=p[a],p&&(d+=" < ");return d}}n.LRUMap=i;function o(u,d){this.key=u,this.value=d,this[a]=void 0,this[r]=void 0}function s(u){this.entry=u}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let u=this.entry;return u?(this.entry=u[a],{done:!1,value:[u.key,u.value]}):{done:!0,value: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[a],{done:!1,value:u.key}):{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[a],{done:!1,value:u.value}):{done:!0,value:void 0}}})})(Gw,Gw.exports)),Gw.exports}var loe=lnt();const uoe=Symbol("IGNORE_RESPONSE");var unt=class{highlighter;renderOptions;initialized=!1;workers=[];taskQueue=[];pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;fileCache;diffCache;constructor(t,{langs:e,theme:n=Vs,lineDiffType:a="word-alt",tokenizeMaxLineLength:r=1e3}){this.options=t,this.renderOptions={theme:n,lineDiffType:a,tokenizeMaxLineLength:r},this.fileCache=new loe.LRUMap(t.totalASTLRUCacheSize??100),this.diffCache=new loe.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){return this.fileCache.delete(t)!==void 0}evictDiffFromCache(t){return this.diffCache.delete(t)!==void 0}async setRenderOptions({theme:t=Vs,lineDiffType:e="word-alt",tokenizeMaxLineLength:n=1e3}){const a={theme:t,lineDiffType:e,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const r=VK(a.theme,this.renderOptions.theme);if(r&&a.lineDiffType===this.renderOptions.lineDiffType&&a.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const i=ID(t);let o=[];if(r||(Vie(i)?o=soe(i):o=await Aoe(i)),this.highlighter!=null)y$(o,this.highlighter),await this.setRenderOptionsOnWorkers(a,o);else{const[s]=await Promise.all([O$({themes:i,langs:["text"]}),this.setRenderOptionsOnWorkers(a,o)]);this.highlighter=s}this.renderOptions=a,this.diffCache.clear(),this.fileCache.clear();for(const s of this.themeSubscribers)s.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 a of this.workers){if(!a.initialized)throw console.log({managedWorker:a}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((r,i)=>{const o=this.generateRequestId(),s={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:t,resolvedThemes:e},resolve:r,reject:i,requestStart:Date.now()};this.pendingTasks.set(o,s),a.worker.postMessage(s.request)}))}await Promise.all(n)}subscribeToThemeChanges(t){return this.themeSubscribers.add(t),()=>{this.unsubscribeToThemeChanges(t)}}unsubscribeToThemeChanges(t){this.themeSubscribers.delete(t)}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 a=ID(this.renderOptions.theme);let r=[];Vie(a)?r=soe(a):r=await Aoe(a);let i=[];ioe(t)?i=roe(t):i=await ooe(t);const[o]=await Promise.all([O$({themes:a,langs:["text",...t]}),this.initializeWorkers(r,i)]);if(this.initialized===!1){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),e()}catch(a){this.initialized=!1,this.workersFailed=!0,n(a)}})()});else return this.initialized}async initializeWorkers(t,e){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){const r=this.options.workerFactory(),i={worker:r,busy:!1,initialized:!1,langs:new Set(["text",...e.map(({name:o})=>o)])};r.addEventListener("message",o=>{this.handleWorkerMessage(i,o.data)}),r.addEventListener("error",o=>console.error("Worker error:",o,i)),this.workers.push(i),n.push(new Promise((o,s)=>{const A=this.generateRequestId(),l={type:"initialize",id:A,request:{type:"initialize",id:A,renderOptions:this.renderOptions,resolvedThemes:t,resolvedLanguages:e},resolve(){i.initialized=!0,o()},reject:s,requestStart:Date.now()};this.pendingTasks.set(A,l),this.executeTask(i,l)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.length===0))for(;this.taskQueue.length>0;){const t=this.taskQueue[0],e=doe(t),n=this.getAvailableWorker(e);if(n==null)break;this.taskQueue.shift(),this.resolveLanguagesAndExecuteTask(n,t,e)}};highlightFileAST(t,e){this.submitTask(t,{type:"file",file:e})}getPlainFileAST(t){if(this.highlighter==null){this.initialize();return}return Ztt(t,this.highlighter,this.renderOptions,!0)}highlightDiffAST(t,e){this.submitTask(t,{type:"diff",diff:e})}getPlainDiffAST(t){return this.highlighter!=null?bve(t,this.highlighter,this.renderOptions,!0):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.length=0,this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1}terminateWorkers(){for(const t of this.workers)t.worker.terminate();this.workers.length=0}getStats(){return{totalWorkers:this.workers.length,busyWorkers:this.workers.filter(t=>t.busy).length,queuedTasks:this.taskQueue.length,pendingTasks:this.pendingTasks.size}}submitTask(t,e){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),a=Date.now(),r=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instance:t,requestStart:a};case"diff":return{type:"diff",id:n,request:{...e,id:n},instance:t,requestStart:a}}})();this.instanceRequestMap.set(t,n),this.taskQueue.push(r),this.queueDrain()}async resolveLanguagesAndExecuteTask(t,e,n){if(e.type==="file"||e.type==="diff"){const a=n.filter(r=>!t.langs.has(r));a.length>0&&(ioe(a)?e.request.resolvedLanguages=roe(a):e.request.resolvedLanguages=await ooe(a))}this.executeTask(t,e)}handleWorkerMessage(t,e){const n=this.pendingTasks.get(e.id);try{if(n==null)throw new Error("handleWorkerMessage: Received response for unknown task");if(e.type==="error"){const a=new Error(e.error);throw e.stack&&(a.stack=e.stack),"reject"in n?n.reject(a):n.instance.onHighlightError(a),a}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==e.id)throw uoe;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:a,options:r}=e,{instance:i,request:o}=n;o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:a,options:r}),i.onHighlightSuccess(o.file,a,r);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:a,options:r}=e,{instance:i,request:o}=n;o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:a,options:r}),i.onHighlightSuccess(o.diff,a,r);break}}}}catch(a){a!==uoe&&console.error(a,n,e)}n!=null&&"instance"in n&&this.instanceRequestMap.get(n.instance)===e.id&&this.instanceRequestMap.delete(n.instance),this.pendingTasks.delete(e.id),t.busy=!1,this.taskQueue.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue))}executeTask(t,e){t.busy=!0,this.pendingTasks.set(e.id,e);for(const n of doe(e))t.langs.add(n);t.worker.postMessage(e.request)}getAvailableWorker(t){let e;for(const n of this.workers){if(n.busy||!n.initialized)continue;if(e=n,t.length===0)break;let a=!0;for(const r of t)if(!n.langs.has(r)){a=!1;break}if(a)break}return e}generateRequestId(){return`req_${++this.nextRequestId}`}};function doe(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??Em(t.request.file.name));break;case"diff":e.add(t.request.diff.lang??Em(t.request.diff.name)),e.add(t.request.diff.lang??Em(t.request.diff.prevName??"-"));break}return e.delete("text"),Array.from(e)}let _f;function dnt({poolOptions:t,highlighterOptions:e}){return _f==null&&(_f=new unt(t,e),_f.initialize()),_f}function pnt(){_f!=null&&(_f.terminate(),_f=void 0)}const XK=K.createContext(void 0);let JT=0;function S5n({children:t,poolOptions:e,highlighterOptions:n}){const[a]=K.useState(()=>{if(!(typeof window>"u"))return dnt({poolOptions:e,highlighterOptions:n})});return K.useInsertionEffect(()=>(JT++,()=>{JT--}),[]),K.useEffect(()=>()=>{JT===0&&pnt()},[]),be.jsx(XK.Provider,{value:a,children:t})}function N5n(){return K.useContext(XK)}function mnt(t){const e=K.useRef(t);return K.useInsertionEffect(()=>{e.current=t}),K.useCallback((...n)=>e.current(...n),[])}function gnt(t,e){return t?.start===e?.start&&t?.end===e?.end&&t?.side===e?.side&&t?.endSide===e?.endSide}var fnt=class{pre;selectedRange=null;renderedSelectionRange;anchor;_queuedRender;constructor(t={}){this.options=t}setOptions(t){this.options={...this.options,...t},this.removeEventListeners(),this.options.enableLineSelection===!0&&this.attachEventListeners()}cleanUp(){this.removeEventListeners(),this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre!=null&&delete this.pre.dataset.interactiveLineNumbers,this.pre=void 0}setup(t){this.setDirty(),this.pre!==t&&this.cleanUp(),this.pre=t;const{enableLineSelection:e=!1}=this.options;e?(this.pre.dataset.interactiveLineNumbers="",this.attachEventListeners()):(this.removeEventListeners(),delete this.pre.dataset.interactiveLineNumbers),this.setSelection(this.selectedRange)}setDirty(){this.renderedSelectionRange=void 0}isDirty(){return this.renderedSelectionRange===void 0}setSelection(t){const e=!(t===this.selectedRange||gnt(t??void 0,this.selectedRange??void 0));!this.isDirty()&&!e||(this.selectedRange=t,this.renderSelection(),e&&this.notifySelectionChange())}getSelection(){return this.selectedRange}attachEventListeners(){this.pre!=null&&(this.removeEventListeners(),this.pre.addEventListener("mousedown",this.handleMouseDown))}removeEventListeners(){this.pre!=null&&(this.pre.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp))}handleMouseDown=t=>{const e=t.button===0?this.getMouseEventDataForPath(t.composedPath(),"click"):void 0;if(e==null)return;t.preventDefault();const{lineNumber:n,eventSide:a,lineIndex:r}=e;if(t.shiftKey&&this.selectedRange!=null){const i=this.deriveRowRangeFromDOM(this.selectedRange,this.pre?.dataset.type==="split");if(i==null)return;const o=i.start<=i.end?r>=i.start:r<=i.end;this.anchor={line:o?this.selectedRange.start:this.selectedRange.end,side:(o?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side)??"additions"},this.updateSelection(n,a),this.notifySelectionStart(this.selectedRange)}else{if(this.selectedRange?.start===n&&this.selectedRange?.end===n){this.updateSelection(null),this.notifySelectionEnd(null),this.notifySelectionChange();return}this.selectedRange=null,this.anchor={line:n,side:a},this.updateSelection(n,a),this.notifySelectionStart(this.selectedRange)}document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)};handleMouseMove=t=>{const e=this.getMouseEventDataForPath(t.composedPath(),"move");if(e==null||this.anchor==null)return;const{lineNumber:n,eventSide:a}=e;this.updateSelection(n,a)};handleMouseUp=()=>{this.anchor=void 0,document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.notifySelectionEnd(this.selectedRange),this.notifySelectionChange()};updateSelection(t,e){if(t==null)this.selectedRange=null;else{const n=this.anchor?.side??e;this.selectedRange={start:this.anchor?.line??t,end:t,side:n,endSide:n!==e?e:void 0}}this._queuedRender??=requestAnimationFrame(this.renderSelection)}renderSelection=()=>{if(this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const t=this.pre.querySelectorAll("[data-selected-line]");for(const s of t)s.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const e=this.pre.querySelectorAll("[data-code]");if(e.length===0)return;if(e.length>2)throw console.error(e),new Error("LineSelectionManager.applySelectionToDOM: Somehow there are more than 2 code elements...");const n=this.pre.dataset.type==="split",a=this.deriveRowRangeFromDOM(this.selectedRange,n);if(a==null)throw console.error({rowRange:a,selectedRange:this.selectedRange}),new Error("LineSelectionManager.renderSelection: No valid rowRange");const r=a.start===a.end,i=Math.min(a.start,a.end),o=Math.max(a.start,a.end);for(const s of e)for(const A of s.children){if(!(A instanceof HTMLElement))continue;const l=this.getLineIndex(A,n);if((l??0)>o)break;if(l==null||l<i)continue;let u=r?"single":l===i?"first":l===o?"last":"";A.setAttribute("data-selected-line",u),A.nextSibling instanceof HTMLElement&&A.nextSibling.hasAttribute("data-line-annotation")&&(r?(u="last",A.setAttribute("data-selected-line","first")):l===i?u="":l===o&&A.setAttribute("data-selected-line",""),A.nextSibling.setAttribute("data-selected-line",u))}};deriveRowRangeFromDOM(t,e){if(t==null)return;const n=this.findRowIndexForLineNumber(t.start,t.side,e),a=t.end===t.start&&(t.endSide==null||t.endSide===t.side)?n:this.findRowIndexForLineNumber(t.end,t.endSide??t.side,e);return n!=null&&a!=null?{start:n,end:a}:void 0}findRowIndexForLineNumber(t,e="additions",n){if(this.pre==null)return;const a=Array.from(this.pre.querySelectorAll(`[data-line="${t}"]`));if(a.push(...Array.from(this.pre.querySelectorAll(`[data-alt-line="${t}"]`))),a.length!==0){for(const r of a)if(r instanceof HTMLElement){if(this.getLineSideFromElement(r)===e)return this.getLineIndex(r,n);if(parseInt(r.dataset.altLine??"")===t)return this.getLineIndex(r,n)}console.error("LineSelectionManager.findRowIndexForLineNumber: Invalid selection",t,e)}}notifySelectionChange(){const{onLineSelected:t}=this.options;t?.(this.selectedRange??null)}notifySelectionStart(t){const{onLineSelectionStart:e}=this.options;e?.(t)}notifySelectionEnd(t){const{onLineSelectionEnd:e}=this.options;e?.(t)}getMouseEventDataForPath(t,e){let n,a,r=!1,i;for(const o of t)if(o instanceof HTMLElement){if(o.hasAttribute("data-column-number")){r=!0;continue}if(o.hasAttribute("data-line")){if(n=this.getLineNumber(o),a=this.getLineIndex(o,this.pre?.dataset.type==="split"),o.dataset.lineType==="change-deletion"?i="deletions":o.dataset.lineType==="change-additions"&&(i="additions"),a==null||n==null){a=void 0,n=void 0;break}if(i!=null)break;continue}if(o.hasAttribute("data-code")){i??=o.hasAttribute("data-deletions")?"deletions":"additions";break}}if(!(e==="click"&&!r||a==null||n==null))return{lineIndex:a,lineNumber:n,eventSide:i??"additions"}}getLineNumber(t){const e=parseInt(t.dataset.line??"",10);return Number.isNaN(e)?void 0:e}getLineIndex(t,e){const n=(t.dataset.lineIndex??"").split(",").map(a=>parseInt(a)).filter(a=>!Number.isNaN(a));if(e&&n.length===2)return n[1];if(!e)return n[0]}getLineSideFromElement(t){if(t.dataset.lineType==="change-deletion")return"deletions";if(t.dataset.lineType==="change-addition")return"additions";const e=t.closest("[data-code]");return e instanceof HTMLElement&&e.hasAttribute("data-deletions")?"deletions":"additions"}};function poe({enableLineSelection:t,onLineSelected:e,onLineSelectionStart:n,onLineSelectionEnd:a}){return{enableLineSelection:t,onLineSelected:e,onLineSelectionStart:n,onLineSelectionEnd:a}}function XT(t,e){return t==null?!1:e==="file"?t.type==="line":t.type==="diff-line"}function hnt(t){return t?.type==="line-info"}var bnt=class{hoveredLine;pre;hoverSlot;constructor(t,e){this.mode=t,this.options=e}setOptions(t){this.options=t}cleanUp(){this.pre?.removeEventListener("click",this.handleMouseClick),this.pre?.removeEventListener("mousemove",this.handleMouseMove),this.pre?.removeEventListener("mouseout",this.handleMouseLeave),delete this.pre?.dataset.interactiveLines,delete this.pre?.dataset.interactiveLineNumbers,this.pre=void 0}setup(t){const{__debugMouseEvents:e,onLineClick:n,onLineNumberClick:a,onLineEnter:r,onLineLeave:i,onHunkExpand:o,enableHoverUtility:s=!1}=this.options;if(this.cleanUp(),this.pre=t,s&&this.hoverSlot==null){this.hoverSlot=document.createElement("div"),this.hoverSlot.dataset.hoverSlot="";const A=document.createElement("slot");A.name="hover-slot",this.hoverSlot.appendChild(A)}else!s&&this.hoverSlot!=null&&(this.hoverSlot.parentNode?.removeChild(this.hoverSlot),this.hoverSlot=void 0);(n!=null||a!=null||o!=null)&&(t.addEventListener("click",this.handleMouseClick),n!=null?t.dataset.interactiveLines="":a!=null&&(t.dataset.interactiveLineNumbers=""),ho(e,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const A=[];return(e==="both"||e==="click")&&(n!=null&&A.push("onLineClick"),a!=null&&A.push("onLineNumberClick"),o!=null&&A.push("expandable hunk separators")),A})())),(r!=null||i!=null||s)&&(t.addEventListener("mousemove",this.handleMouseMove),ho(e,"move","FileDiff.DEBUG.attachEventListeners: Attaching mouse move event"),t.addEventListener("mouseleave",this.handleMouseLeave),ho(e,"move","FileDiff.DEBUG.attachEventListeners: Attaching mouse leave event"))}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}}};handleMouseClick=t=>{ho(this.options.__debugMouseEvents,"click","FileDiff.DEBUG.handleMouseClick:",t),this.handleMouseEvent({eventType:"click",event:t})};handleMouseMove=t=>{ho(this.options.__debugMouseEvents,"move","FileDiff.DEBUG.handleMouseMove:",t),this.handleMouseEvent({eventType:"move",event:t})};handleMouseLeave=t=>{const{__debugMouseEvents:e}=this.options;if(ho(e,"move","FileDiff.DEBUG.handleMouseLeave: no event"),this.hoveredLine==null){ho(e,"move","FileDiff.DEBUG.handleMouseLeave: returned early, no .hoveredLine");return}this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),this.options.onLineLeave?.({...this.hoveredLine,event:t}),this.hoveredLine=void 0};handleMouseEvent({eventType:t,event:e}){const{__debugMouseEvents:n}=this.options,a=e.composedPath();ho(n,t,"FileDiff.DEBUG.handleMouseEvent:",{eventType:t,composedPath:a});const r=this.getLineData(a);ho(n,t,"FileDiff.DEBUG.handleMouseEvent: getLineData result:",r);const{onLineClick:i,onLineNumberClick:o,onLineEnter:s,onLineLeave:A,onHunkExpand:l}=this.options;switch(t){case"move":if(XT(r,this.mode)&&this.hoveredLine?.lineElement===r.lineElement){ho(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', returned early because same line");break}this.hoveredLine!=null&&(ho(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', clearing an existing hovered line and firing onLineLeave"),this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),A?.({...this.hoveredLine,event:e}),this.hoveredLine=void 0),XT(r,this.mode)&&(ho(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', setting up a new hoveredLine and firing onLineEnter"),this.hoveredLine=r,this.hoverSlot!=null&&r.numberElement?.appendChild(this.hoverSlot),s?.({...this.hoveredLine,event:e}));break;case"click":if(ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', with data:",r),r==null)break;if(hnt(r)&&l!=null){ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', expanding a hunk"),l(r.hunkIndex,r.direction);break}XT(r,this.mode)&&(o!=null&&r.numberColumn?(ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineNumberClick'"),o({...r,event:e})):i!=null?(ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineClick'"),i({...r,event:e})):ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', fell through, no event to fire"));break}}getLineData(t){let e=!1;const n=t.find(o=>o instanceof HTMLElement?(e=e||"columnNumber"in o.dataset,"line"in o.dataset||"expandIndex"in o.dataset):!1);if(!(n instanceof HTMLElement))return;if(n.dataset.expandIndex!=null){const o=parseInt(n.dataset.expandIndex);if(isNaN(o))return;let s;for(const A of t)if(A===n||A instanceof HTMLElement&&(s=s??("expandUp"in A.dataset?"up":void 0)??("expandDown"in A.dataset?"down":void 0)??("expandBoth"in A.dataset?"both":void 0),s!=null))break;return s!=null?{type:"line-info",hunkIndex:o,direction:s}:void 0}const a=parseInt(n.dataset.line??"");if(isNaN(a))return;const r=n.dataset.lineType;if(r!=="context"&&r!=="context-expanded"&&r!=="change-deletion"&&r!=="change-addition")return;const i=(()=>{const o=n.children[0];return o instanceof HTMLElement&&o.dataset.columnNumber!=null?o:void 0})();return this.mode==="file"?{type:"line",lineElement:n,lineNumber:a,numberElement:i,numberColumn:e}:{type:"diff-line",annotationSide:(()=>{if(r==="change-deletion")return"deletions";if(r==="change-addition")return"additions";const o=n.closest("[data-code]");return o instanceof HTMLElement&&"deletions"in o.dataset?"deletions":"additions"})(),lineType:r,lineElement:n,numberElement:i,lineNumber:a,numberColumn:e}}};function ho(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)}function moe({onLineClick:t,onLineNumberClick:e,onLineEnter:n,onLineLeave:a,enableHoverUtility:r,__debugMouseEvents:i},o){return{onLineClick:t,onLineNumberClick:e,onLineEnter:n,onLineLeave:a,enableHoverUtility:r,__debugMouseEvents:i,onHunkExpand:o}}var ynt=class{observedNodes=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear()}resizeObserver;setup(t){this.cleanUp();const e=t.querySelectorAll('[data-line-annotation*=","]');this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);const n=t.querySelectorAll("code");for(const r of n){let i=r.querySelector("[data-column-number]");i instanceof HTMLElement||(i=null);const o={type:"code",codeElement:r,numberElement:i,codeWidth:"auto",numberWidth:0};this.observedNodes.set(r,o),this.resizeObserver.observe(r),i!=null&&(this.observedNodes.set(i,o),this.resizeObserver.observe(i))}if(n.length<=1)return;const a=new Map;for(const r of e){if(!(r instanceof HTMLElement))continue;const{lineAnnotation:i=""}=r.dataset;if(!/^\d+,\d+$/.test(i)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:i,element:r});continue}let o=a.get(i);o==null&&(o=[],a.set(i,o)),o.push(r)}for(const[r,i]of a){if(i.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",r,i);continue}const[o,s]=i,A=o.firstElementChild,l=s.firstElementChild;if(!(o instanceof HTMLElement)||!(s instanceof HTMLElement)||!(A instanceof HTMLElement)||!(l instanceof HTMLElement))continue;const u={type:"annotations",column1:{container:o,child:A,childHeight:0},column2:{container:s,child:l,childHeight:0},currentHeight:"auto"};this.observedNodes.set(A,u),this.observedNodes.set(l,u),this.resizeObserver.observe(A),this.resizeObserver.observe(l)}}handleResizeObserver=t=>{for(const e of t){const{target:n,borderBoxSize:a}=e;if(!(n instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",e);continue}const r=this.observedNodes.get(n);if(r==null){console.error("FileDiff.handleResizeObserver: Not a valid observed node",e);continue}const i=a[0];if(r.type==="annotations"){const o=(()=>{if(n===r.column1.child)return r.column1;if(n===r.column2.child)return r.column2})();if(o==null){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:r,target:n});continue}o.childHeight=i.blockSize;const s=Math.max(r.column1.childHeight,r.column2.childHeight);s!==r.currentHeight&&(r.currentHeight=Math.max(s,0),r.column1.container.style.setProperty("--diffs-annotation-min-height",`${r.currentHeight}px`),r.column2.container.style.setProperty("--diffs-annotation-min-height",`${r.currentHeight}px`))}else r.type==="code"&&(n===r.codeElement?i.inlineSize!==r.codeWidth&&(r.codeWidth=i.inlineSize,r.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(r.codeWidth-r.numberWidth,0)}px`),r.codeElement.style.setProperty("--diffs-column-width",`${r.codeWidth}px`)):n===r.numberElement&&i.inlineSize!==r.numberWidth&&(r.numberWidth=i.inlineSize,r.codeElement.style.setProperty("--diffs-column-number-width",`${r.numberWidth}px`),r.codeWidth!=="auto"&&r.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(r.codeWidth-r.numberWidth,0)}px`)))}}};function goe(t){for(const e of Array.isArray(t)?t:[t])if(!C$.has(e))return!1;return!0}function e9(t){for(const e of ID(t))if(!b$.has(e))return!1;return!0}function t9(t){return Ta({tagName:"div",children:[Ta({tagName:"div",children:t.annotations?.map(e=>Ta({tagName:"slot",properties:{name:e}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${t.hunkIndex},${t.lineIndex}`}})}function Cnt(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 wnt({fileOrDiff:t,themeStyles:e,themeType:n}){const a="type"in t?t:void 0,r={"data-diffs-header":"","data-change-type":a?.type,"data-theme-type":n!=="system"?n:void 0,style:e};return Ta({tagName:"div",children:[Ent({name:t.name,prevName:"prevName"in t?t.prevName:void 0,iconType:a?.type??"file"}),Bnt(a)],properties:r})}function Ent({name:t,prevName:e,iconType:n}){const a=[G$({name:Cnt(n),properties:{"data-change-icon":n}})];return e!=null&&(a.push(Ta({tagName:"div",children:[Sm(e)],properties:{"data-prev-name":""}})),a.push(G$({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),a.push(Ta({tagName:"div",children:[Sm(t)],properties:{"data-title":""}})),Ta({tagName:"div",children:a,properties:{"data-header-content":""}})}function Bnt(t){const e=[];if(t!=null){let n=0,a=0;for(const r of t.hunks)n+=r.additionLines,a+=r.deletionLines;(a>0||n===0)&&e.push(Ta({tagName:"span",children:[Sm(`-${a}`)],properties:{"data-deletions-count":""}})),(n>0||a===0)&&e.push(Ta({tagName:"span",children:[Sm(`+${n}`)],properties:{"data-additions-count":""}}))}return e.push(Ta({tagName:"slot",properties:{name:FK}})),Ta({tagName:"div",children:e,properties:{"data-metadata":""}})}function knt(t){return Ta({tagName:"pre",properties:vnt(t)})}function vnt({diffIndicators:t,disableBackground:e,disableLineNumbers:n,overflow:a,split:r,themeType:i,themeStyles:o,totalLines:s}){const A={"data-diffs":"","data-type":r?"split":"file","data-overflow":a,"data-disable-line-numbers":n?"":void 0,"data-background":e?void 0:"","data-indicators":t==="bars"||t==="classic"?t:void 0,"data-theme-type":i!=="system"?i:void 0,style:o,tabIndex:0};return A.style+=`--diffs-min-number-column-width-default:${`${s}`.length}ch;`,A}function Int(t,e){return{langs:[t??"text"],themes:ID(e.theme)}}const Qnt=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
222
+ `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function toe({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 YQ({item:t,arr:e,enableJoin:n,isNeutral:a=!1,isLastItem:r=!1}){const i=e[e.length-1];if(i==null||r||!n){e.push([a?0:1,t.value]);return}const o=i[0]===0;if(a===o||a&&t.value.length===1&&!o){i[1]+=t.value;return}e.push([a?0:1,t.value])}function Cve(t,e,n,a=!1){const r=(()=>{const l=n.theme??Vs;if(typeof l=="string")return e.getTheme(l).type})(),i=bve({theme:n.theme,highlighter:e});if(t.newLines!=null&&t.oldLines!=null){const{oldContent:l,newContent:u,oldInfo:d,newInfo:p,oldDecorations:m,newDecorations:g}=noe({hunks:t.hunks,oldLines:t.oldLines,newLines:t.newLines,lineDiffType:n.lineDiffType});return{code:aoe({oldFile:{name:t.prevName??t.name,contents:l},oldInfo:d,oldDecorations:m,newFile:{name:t.name,contents:u},newInfo:p,newDecorations:g,highlighter:e,options:n,languageOverride:a?"text":t.lang}),themeStyles:i,baseThemeType:r}}const o=[];let s=0,A=0;for(const l of t.hunks){const{oldContent:u,newContent:d,oldInfo:p,newInfo:m,oldDecorations:g,newDecorations:h,splitLineIndex:b,unifiedLineIndex:y}=noe({hunks:[l],splitLineIndex:s,unifiedLineIndex:A,lineDiffType:n.lineDiffType}),w={name:t.prevName??t.name,contents:u},E={name:t.name,contents:d};o.push(aoe({oldFile:w,oldInfo:p,oldDecorations:g,newFile:E,newInfo:m,newDecorations:h,highlighter:e,options:n,languageOverride:a?"text":t.lang})),s=b,A=y}return{code:(()=>{if(o.length<=1){const l=o[0]??{oldLines:[],newLines:[]};if(l.newLines.length===0||l.oldLines.length===0)return l}return{hunks:o}})(),themeStyles:i,baseThemeType:r}}function pnt({oldLine:t,newLine:e,oldLineIndex:n,newLineIndex:a,oldDecorations:r,newDecorations:i,lineDiffType:o}){if(t==null||e==null||o==="none")return;t=Wf(t),e=Wf(e);const s=o==="char"?ant(t,e):ont(t,e),A=[],l=[],u=o==="word-alt";for(const p of s){const m=p===s[s.length-1];!p.added&&!p.removed?(YQ({item:p,arr:A,enableJoin:u,isNeutral:!0,isLastItem:m}),YQ({item:p,arr:l,enableJoin:u,isNeutral:!0,isLastItem:m})):p.removed?YQ({item:p,arr:A,enableJoin:u,isLastItem:m}):YQ({item:p,arr:l,enableJoin:u,isLastItem:m})}let d=0;for(const p of A)p[0]===1&&r.push(toe({line:n-1,spanStart:d,spanLength:p[1].length})),d+=p[1].length;d=0;for(const p of l)p[0]===1&&i.push(toe({line:a-1,spanStart:d,spanLength:p[1].length})),d+=p[1].length}function noe({hunks:t,oldLines:e,newLines:n,splitLineIndex:a=0,unifiedLineIndex:r=0,lineDiffType:i}){const o={},s={},A=[],l=[];let u=1,d=1,p=1,m=1,g="",h="";for(const b of t){for(;e!=null&&n!=null&&u<b.additionStart&&d<b.deletionStart;)o[d]={type:"context-expanded",lineNumber:m,altLineNumber:p,lineIndex:`${r},${a}`},s[u]={type:"context-expanded",lineNumber:p,altLineNumber:m,lineIndex:`${r},${a}`},g+=e[d-1],h+=n[u-1],d++,u++,m++,p++,a++,r++;m=b.deletionStart,p=b.additionStart;for(const y of b.hunkContent)if(y.type==="context")for(const w of y.lines)o[d]={type:"context",lineNumber:m,altLineNumber:p,lineIndex:`${r},${a}`},s[u]={type:"context",lineNumber:p,altLineNumber:m,lineIndex:`${r},${a}`},g+=w,h+=w,d++,u++,p++,m++,a++,r++;else{const w=Math.max(y.additions.length,y.deletions.length);let E=0,k=r;for(;E<w;){const v=y.deletions[E],_=y.additions[E];pnt({newLine:_,oldLine:v,oldLineIndex:d,newLineIndex:u,oldDecorations:A,newDecorations:l,lineDiffType:i}),v!=null&&(o[d]={type:"change-deletion",lineNumber:m,lineIndex:`${k},${a}`},g+=v,d++,m++),_!=null&&(s[u]={type:"change-addition",lineNumber:p,lineIndex:`${k+y.deletions.length},${a}`},h+=_,u++,p++),a++,k++,E++}r+=y.additions.length+y.deletions.length}if(!(e==null||n==null||b!==t[t.length-1]))for(;d<=e.length||u<=e.length;){const y=e[d-1],w=n[u-1];if(y==null&&w==null)break;y!=null&&(o[d]={type:"context-expanded",lineNumber:m,altLineNumber:p,lineIndex:`${r},${a}`},g+=y,d++,m++),w!=null&&(s[u]={type:"context-expanded",lineNumber:p,altLineNumber:m,lineIndex:`${r},${a}`},h+=w,u++,p++),a++,r++}}return{oldContent:g,newContent:h,oldInfo:o,newInfo:s,oldDecorations:A,newDecorations:l,splitLineIndex:a,unifiedLineIndex:r}}function aoe({oldFile:t,newFile:e,oldInfo:n,newInfo:a,highlighter:r,oldDecorations:i,newDecorations:o,languageOverride:s,options:{theme:A=Vs,...l}}){const u=s??Em(t.name),d=s??Em(e.name),{state:p,transformers:m}=hve(),g=typeof A=="string"?{...l,lang:"text",theme:A,transformers:m,decorations:void 0,defaultColor:!1,cssVariablePrefix:IA()}:{...l,lang:"text",themes:A,transformers:m,decorations:void 0,defaultColor:!1,cssVariablePrefix:IA()};return{oldLines:t.contents===""?[]:(g.lang=u,p.lineInfo=n,g.decorations=i,P$(r.codeToHast(Wf(t.contents),g))),newLines:e.contents===""?[]:(g.lang=d,g.decorations=o,p.lineInfo=a,P$(r.codeToHast(Wf(e.contents),g)))}}function roe(t){const e=[];for(const n of t){const a=Kf.get(n);if(a==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);e.push(a)}return e}function ioe(t){for(const e of Array.isArray(t)?t:[t])if(!Kf.has(e))return!1;return!0}async function ooe(t){const e=[],n=[];for(const a of t){if(a==="text")continue;const r=pve(a)??dve(a);"then"in r?n.push(r):e.push(r)}return n.length>0&&await Promise.all(n).then(a=>{for(const r of a){if(r==null)throw new Error("resolvedLanguages: unable to resolve language");e.push(r)}}),e}function soe(t){const e=[];for(const n of t){const a=Md.get(n);if(a==null)throw new Error(`getAllResolvedThemes: ${n} is unresolved, you must resolve all necessary themes before calling this function`);e.push(a)}return e}async function Aoe(t){const e=[],n=[];for(const a of t){const r=gve(a)??mve(a);"then"in r?n.push(r):e.push(r)}return n.length>0&&await Promise.all(n).then(a=>{for(const r of a)r!=null&&e.push(r)}),e}var Gw={exports:{}},mnt=Gw.exports,coe;function gnt(){return coe||(coe=1,(function(t,e){(function(n,a){a(e)})(mnt,function(n){const a=Symbol("newer"),r=Symbol("older");class i{constructor(d,p){typeof d!="number"&&(p=d,d=0),this.size=0,this.limit=d,this.oldest=this.newest=void 0,this._keymap=new Map,p&&(this.assign(p),d<1&&(this.limit=this.size))}_markEntryAsUsed(d){d!==this.newest&&(d[a]&&(d===this.oldest&&(this.oldest=d[a]),d[a][r]=d[r]),d[r]&&(d[r][a]=d[a]),d[a]=void 0,d[r]=this.newest,this.newest&&(this.newest[a]=d),this.newest=d)}assign(d){let p,m=this.limit||Number.MAX_VALUE;this._keymap.clear();let g=d[Symbol.iterator]();for(let h=g.next();!h.done;h=g.next()){let b=new o(h.value[0],h.value[1]);if(this._keymap.set(b.key,b),p?(p[a]=b,b[r]=p):this.oldest=b,p=b,m--==0)throw new Error("overflow")}this.newest=p,this.size=this._keymap.size}get(d){var p=this._keymap.get(d);return p?(this._markEntryAsUsed(p),p.value):void 0}set(d,p){var m=this._keymap.get(d);return m?(m.value=p,this._markEntryAsUsed(m),this):(this._keymap.set(d,m=new o(d,p)),this.newest?(this.newest[a]=m,m[r]=this.newest):this.oldest=m,this.newest=m,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var d=this.oldest;if(d)return this.oldest[a]?(this.oldest=this.oldest[a],this.oldest[r]=void 0):(this.oldest=void 0,this.newest=void 0),d[a]=d[r]=void 0,this._keymap.delete(d.key),--this.size,[d.key,d.value]}find(d){let p=this._keymap.get(d);return p?p.value:void 0}has(d){return this._keymap.has(d)}delete(d){var p=this._keymap.get(d);return p?(this._keymap.delete(p.key),p[a]&&p[r]?(p[r][a]=p[a],p[a][r]=p[r]):p[a]?(p[a][r]=void 0,this.oldest=p[a]):p[r]?(p[r][a]=void 0,this.newest=p[r]):this.oldest=this.newest=void 0,this.size--,p.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new A(this.oldest)}values(){return new l(this.oldest)}entries(){return this}[Symbol.iterator](){return new s(this.oldest)}forEach(d,p){typeof p!="object"&&(p=this);let m=this.oldest;for(;m;)d.call(p,m.value,m.key,this),m=m[a]}toJSON(){for(var d=new Array(this.size),p=0,m=this.oldest;m;)d[p++]={key:m.key,value:m.value},m=m[a];return d}toString(){for(var d="",p=this.oldest;p;)d+=String(p.key)+":"+p.value,p=p[a],p&&(d+=" < ");return d}}n.LRUMap=i;function o(u,d){this.key=u,this.value=d,this[a]=void 0,this[r]=void 0}function s(u){this.entry=u}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let u=this.entry;return u?(this.entry=u[a],{done:!1,value:[u.key,u.value]}):{done:!0,value: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[a],{done:!1,value:u.key}):{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[a],{done:!1,value:u.value}):{done:!0,value:void 0}}})})(Gw,Gw.exports)),Gw.exports}var loe=gnt();const uoe=Symbol("IGNORE_RESPONSE");var fnt=class{highlighter;renderOptions;initialized=!1;workers=[];taskQueue=[];pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;fileCache;diffCache;constructor(t,{langs:e,theme:n=Vs,lineDiffType:a="word-alt",tokenizeMaxLineLength:r=1e3}){this.options=t,this.renderOptions={theme:n,lineDiffType:a,tokenizeMaxLineLength:r},this.fileCache=new loe.LRUMap(t.totalASTLRUCacheSize??100),this.diffCache=new loe.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){return this.fileCache.delete(t)!==void 0}evictDiffFromCache(t){return this.diffCache.delete(t)!==void 0}async setRenderOptions({theme:t=Vs,lineDiffType:e="word-alt",tokenizeMaxLineLength:n=1e3}){const a={theme:t,lineDiffType:e,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const r=eZ(a.theme,this.renderOptions.theme);if(r&&a.lineDiffType===this.renderOptions.lineDiffType&&a.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const i=ID(t);let o=[];if(r||(Vie(i)?o=soe(i):o=await Aoe(i)),this.highlighter!=null)y$(o,this.highlighter),await this.setRenderOptionsOnWorkers(a,o);else{const[s]=await Promise.all([O$({themes:i,langs:["text"]}),this.setRenderOptionsOnWorkers(a,o)]);this.highlighter=s}this.renderOptions=a,this.diffCache.clear(),this.fileCache.clear();for(const s of this.themeSubscribers)s.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 a of this.workers){if(!a.initialized)throw console.log({managedWorker:a}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((r,i)=>{const o=this.generateRequestId(),s={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:t,resolvedThemes:e},resolve:r,reject:i,requestStart:Date.now()};this.pendingTasks.set(o,s),a.worker.postMessage(s.request)}))}await Promise.all(n)}subscribeToThemeChanges(t){return this.themeSubscribers.add(t),()=>{this.unsubscribeToThemeChanges(t)}}unsubscribeToThemeChanges(t){this.themeSubscribers.delete(t)}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 a=ID(this.renderOptions.theme);let r=[];Vie(a)?r=soe(a):r=await Aoe(a);let i=[];ioe(t)?i=roe(t):i=await ooe(t);const[o]=await Promise.all([O$({themes:a,langs:["text",...t]}),this.initializeWorkers(r,i)]);if(this.initialized===!1){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),e()}catch(a){this.initialized=!1,this.workersFailed=!0,n(a)}})()});else return this.initialized}async initializeWorkers(t,e){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){const r=this.options.workerFactory(),i={worker:r,busy:!1,initialized:!1,langs:new Set(["text",...e.map(({name:o})=>o)])};r.addEventListener("message",o=>{this.handleWorkerMessage(i,o.data)}),r.addEventListener("error",o=>console.error("Worker error:",o,i)),this.workers.push(i),n.push(new Promise((o,s)=>{const A=this.generateRequestId(),l={type:"initialize",id:A,request:{type:"initialize",id:A,renderOptions:this.renderOptions,resolvedThemes:t,resolvedLanguages:e},resolve(){i.initialized=!0,o()},reject:s,requestStart:Date.now()};this.pendingTasks.set(A,l),this.executeTask(i,l)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.length===0))for(;this.taskQueue.length>0;){const t=this.taskQueue[0],e=doe(t),n=this.getAvailableWorker(e);if(n==null)break;this.taskQueue.shift(),this.resolveLanguagesAndExecuteTask(n,t,e)}};highlightFileAST(t,e){this.submitTask(t,{type:"file",file:e})}getPlainFileAST(t){if(this.highlighter==null){this.initialize();return}return ent(t,this.highlighter,this.renderOptions,!0)}highlightDiffAST(t,e){this.submitTask(t,{type:"diff",diff:e})}getPlainDiffAST(t){return this.highlighter!=null?Cve(t,this.highlighter,this.renderOptions,!0):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.length=0,this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1}terminateWorkers(){for(const t of this.workers)t.worker.terminate();this.workers.length=0}getStats(){return{totalWorkers:this.workers.length,busyWorkers:this.workers.filter(t=>t.busy).length,queuedTasks:this.taskQueue.length,pendingTasks:this.pendingTasks.size}}submitTask(t,e){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),a=Date.now(),r=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instance:t,requestStart:a};case"diff":return{type:"diff",id:n,request:{...e,id:n},instance:t,requestStart:a}}})();this.instanceRequestMap.set(t,n),this.taskQueue.push(r),this.queueDrain()}async resolveLanguagesAndExecuteTask(t,e,n){if(e.type==="file"||e.type==="diff"){const a=n.filter(r=>!t.langs.has(r));a.length>0&&(ioe(a)?e.request.resolvedLanguages=roe(a):e.request.resolvedLanguages=await ooe(a))}this.executeTask(t,e)}handleWorkerMessage(t,e){const n=this.pendingTasks.get(e.id);try{if(n==null)throw new Error("handleWorkerMessage: Received response for unknown task");if(e.type==="error"){const a=new Error(e.error);throw e.stack&&(a.stack=e.stack),"reject"in n?n.reject(a):n.instance.onHighlightError(a),a}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==e.id)throw uoe;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:a,options:r}=e,{instance:i,request:o}=n;o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:a,options:r}),i.onHighlightSuccess(o.file,a,r);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:a,options:r}=e,{instance:i,request:o}=n;o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:a,options:r}),i.onHighlightSuccess(o.diff,a,r);break}}}}catch(a){a!==uoe&&console.error(a,n,e)}n!=null&&"instance"in n&&this.instanceRequestMap.get(n.instance)===e.id&&this.instanceRequestMap.delete(n.instance),this.pendingTasks.delete(e.id),t.busy=!1,this.taskQueue.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue))}executeTask(t,e){t.busy=!0,this.pendingTasks.set(e.id,e);for(const n of doe(e))t.langs.add(n);t.worker.postMessage(e.request)}getAvailableWorker(t){let e;for(const n of this.workers){if(n.busy||!n.initialized)continue;if(e=n,t.length===0)break;let a=!0;for(const r of t)if(!n.langs.has(r)){a=!1;break}if(a)break}return e}generateRequestId(){return`req_${++this.nextRequestId}`}};function doe(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??Em(t.request.file.name));break;case"diff":e.add(t.request.diff.lang??Em(t.request.diff.name)),e.add(t.request.diff.lang??Em(t.request.diff.prevName??"-"));break}return e.delete("text"),Array.from(e)}let _f;function hnt({poolOptions:t,highlighterOptions:e}){return _f==null&&(_f=new fnt(t,e),_f.initialize()),_f}function bnt(){_f!=null&&(_f.terminate(),_f=void 0)}const nZ=K.createContext(void 0);let JT=0;function N5n({children:t,poolOptions:e,highlighterOptions:n}){const[a]=K.useState(()=>{if(!(typeof window>"u"))return hnt({poolOptions:e,highlighterOptions:n})});return K.useInsertionEffect(()=>(JT++,()=>{JT--}),[]),K.useEffect(()=>()=>{JT===0&&bnt()},[]),be.jsx(nZ.Provider,{value:a,children:t})}function F5n(){return K.useContext(nZ)}function ynt(t){const e=K.useRef(t);return K.useInsertionEffect(()=>{e.current=t}),K.useCallback((...n)=>e.current(...n),[])}function Cnt(t,e){return t?.start===e?.start&&t?.end===e?.end&&t?.side===e?.side&&t?.endSide===e?.endSide}var wnt=class{pre;selectedRange=null;renderedSelectionRange;anchor;_queuedRender;constructor(t={}){this.options=t}setOptions(t){this.options={...this.options,...t},this.removeEventListeners(),this.options.enableLineSelection===!0&&this.attachEventListeners()}cleanUp(){this.removeEventListeners(),this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre!=null&&delete this.pre.dataset.interactiveLineNumbers,this.pre=void 0}setup(t){this.setDirty(),this.pre!==t&&this.cleanUp(),this.pre=t;const{enableLineSelection:e=!1}=this.options;e?(this.pre.dataset.interactiveLineNumbers="",this.attachEventListeners()):(this.removeEventListeners(),delete this.pre.dataset.interactiveLineNumbers),this.setSelection(this.selectedRange)}setDirty(){this.renderedSelectionRange=void 0}isDirty(){return this.renderedSelectionRange===void 0}setSelection(t){const e=!(t===this.selectedRange||Cnt(t??void 0,this.selectedRange??void 0));!this.isDirty()&&!e||(this.selectedRange=t,this.renderSelection(),e&&this.notifySelectionChange())}getSelection(){return this.selectedRange}attachEventListeners(){this.pre!=null&&(this.removeEventListeners(),this.pre.addEventListener("pointerdown",this.handleMouseDown))}removeEventListeners(){this.pre!=null&&(this.pre.removeEventListener("pointerdown",this.handleMouseDown),document.removeEventListener("pointermove",this.handleMouseMove),document.removeEventListener("pointerup",this.handleMouseUp))}handleMouseDown=t=>{const e=t.button===0?this.getMouseEventDataForPath(t.composedPath(),"click"):void 0;if(e==null)return;t.preventDefault();const{lineNumber:n,eventSide:a,lineIndex:r}=e;if(t.shiftKey&&this.selectedRange!=null){const i=this.deriveRowRangeFromDOM(this.selectedRange,this.pre?.dataset.type==="split");if(i==null)return;const o=i.start<=i.end?r>=i.start:r<=i.end;this.anchor={line:o?this.selectedRange.start:this.selectedRange.end,side:(o?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side)??"additions"},this.updateSelection(n,a),this.notifySelectionStart(this.selectedRange)}else{if(this.selectedRange?.start===n&&this.selectedRange?.end===n){this.updateSelection(null),this.notifySelectionEnd(null),this.notifySelectionChange();return}this.selectedRange=null,this.anchor={line:n,side:a},this.updateSelection(n,a),this.notifySelectionStart(this.selectedRange)}document.addEventListener("pointermove",this.handleMouseMove),document.addEventListener("pointerup",this.handleMouseUp)};handleMouseMove=t=>{const e=this.getMouseEventDataForPath(t.composedPath(),"move");if(e==null||this.anchor==null)return;const{lineNumber:n,eventSide:a}=e;this.updateSelection(n,a)};handleMouseUp=()=>{this.anchor=void 0,document.removeEventListener("pointermove",this.handleMouseMove),document.removeEventListener("pointerup",this.handleMouseUp),this.notifySelectionEnd(this.selectedRange),this.notifySelectionChange()};updateSelection(t,e){if(t==null)this.selectedRange=null;else{const n=this.anchor?.side??e;this.selectedRange={start:this.anchor?.line??t,end:t,side:n,endSide:n!==e?e:void 0}}this._queuedRender??=requestAnimationFrame(this.renderSelection)}renderSelection=()=>{if(this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const t=this.pre.querySelectorAll("[data-selected-line]");for(const s of t)s.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const e=this.pre.querySelectorAll("[data-code]");if(e.length===0)return;if(e.length>2)throw console.error(e),new Error("LineSelectionManager.applySelectionToDOM: Somehow there are more than 2 code elements...");const n=this.pre.dataset.type==="split",a=this.deriveRowRangeFromDOM(this.selectedRange,n);if(a==null)throw console.error({rowRange:a,selectedRange:this.selectedRange}),new Error("LineSelectionManager.renderSelection: No valid rowRange");const r=a.start===a.end,i=Math.min(a.start,a.end),o=Math.max(a.start,a.end);for(const s of e)for(const A of s.children){if(!(A instanceof HTMLElement))continue;const l=this.getLineIndex(A,n);if((l??0)>o)break;if(l==null||l<i)continue;let u=r?"single":l===i?"first":l===o?"last":"";A.setAttribute("data-selected-line",u),A.nextSibling instanceof HTMLElement&&A.nextSibling.hasAttribute("data-line-annotation")&&(r?(u="last",A.setAttribute("data-selected-line","first")):l===i?u="":l===o&&A.setAttribute("data-selected-line",""),A.nextSibling.setAttribute("data-selected-line",u))}};deriveRowRangeFromDOM(t,e){if(t==null)return;const n=this.findRowIndexForLineNumber(t.start,t.side,e),a=t.end===t.start&&(t.endSide==null||t.endSide===t.side)?n:this.findRowIndexForLineNumber(t.end,t.endSide??t.side,e);return n!=null&&a!=null?{start:n,end:a}:void 0}findRowIndexForLineNumber(t,e="additions",n){if(this.pre==null)return;const a=Array.from(this.pre.querySelectorAll(`[data-line="${t}"]`));if(a.push(...Array.from(this.pre.querySelectorAll(`[data-alt-line="${t}"]`))),a.length!==0){for(const r of a)if(r instanceof HTMLElement){if(this.getLineSideFromElement(r)===e)return this.getLineIndex(r,n);if(parseInt(r.dataset.altLine??"")===t)return this.getLineIndex(r,n)}console.error("LineSelectionManager.findRowIndexForLineNumber: Invalid selection",t,e)}}notifySelectionChange(){const{onLineSelected:t}=this.options;t?.(this.selectedRange??null)}notifySelectionStart(t){const{onLineSelectionStart:e}=this.options;e?.(t)}notifySelectionEnd(t){const{onLineSelectionEnd:e}=this.options;e?.(t)}getMouseEventDataForPath(t,e){let n,a,r=!1,i;for(const o of t)if(o instanceof HTMLElement){if(o.hasAttribute("data-column-number")){r=!0;continue}if(o.hasAttribute("data-line")){if(n=this.getLineNumber(o),a=this.getLineIndex(o,this.pre?.dataset.type==="split"),o.dataset.lineType==="change-deletion"?i="deletions":o.dataset.lineType==="change-additions"&&(i="additions"),a==null||n==null){a=void 0,n=void 0;break}if(i!=null)break;continue}if(o.hasAttribute("data-code")){i??=o.hasAttribute("data-deletions")?"deletions":"additions";break}}if(!(e==="click"&&!r||a==null||n==null))return{lineIndex:a,lineNumber:n,eventSide:i??"additions"}}getLineNumber(t){const e=parseInt(t.dataset.line??"",10);return Number.isNaN(e)?void 0:e}getLineIndex(t,e){const n=(t.dataset.lineIndex??"").split(",").map(a=>parseInt(a)).filter(a=>!Number.isNaN(a));if(e&&n.length===2)return n[1];if(!e)return n[0]}getLineSideFromElement(t){if(t.dataset.lineType==="change-deletion")return"deletions";if(t.dataset.lineType==="change-addition")return"additions";const e=t.closest("[data-code]");return e instanceof HTMLElement&&e.hasAttribute("data-deletions")?"deletions":"additions"}};function poe({enableLineSelection:t,onLineSelected:e,onLineSelectionStart:n,onLineSelectionEnd:a}){return{enableLineSelection:t,onLineSelected:e,onLineSelectionStart:n,onLineSelectionEnd:a}}function XT(t,e){return t==null?!1:e==="file"?t.type==="line":t.type==="diff-line"}function Ent(t){return t?.type==="line-info"}var Bnt=class{hoveredLine;pre;hoverSlot;constructor(t,e){this.mode=t,this.options=e}setOptions(t){this.options=t}cleanUp(){this.pre?.removeEventListener("click",this.handleMouseClick),this.pre?.removeEventListener("pointermove",this.handleMouseMove),this.pre?.removeEventListener("pointerout",this.handleMouseLeave),delete this.pre?.dataset.interactiveLines,delete this.pre?.dataset.interactiveLineNumbers,this.pre=void 0}setup(t){const{__debugMouseEvents:e,onLineClick:n,onLineNumberClick:a,onLineEnter:r,onLineLeave:i,onHunkExpand:o,enableHoverUtility:s=!1}=this.options;if(this.cleanUp(),this.pre=t,s&&this.hoverSlot==null){this.hoverSlot=document.createElement("div"),this.hoverSlot.dataset.hoverSlot="";const A=document.createElement("slot");A.name="hover-slot",this.hoverSlot.appendChild(A)}else!s&&this.hoverSlot!=null&&(this.hoverSlot.parentNode?.removeChild(this.hoverSlot),this.hoverSlot=void 0);(n!=null||a!=null||o!=null)&&(t.addEventListener("click",this.handleMouseClick),n!=null?t.dataset.interactiveLines="":a!=null&&(t.dataset.interactiveLineNumbers=""),ho(e,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const A=[];return(e==="both"||e==="click")&&(n!=null&&A.push("onLineClick"),a!=null&&A.push("onLineNumberClick"),o!=null&&A.push("expandable hunk separators")),A})())),(r!=null||i!=null||s)&&(t.addEventListener("pointermove",this.handleMouseMove),ho(e,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),t.addEventListener("pointerleave",this.handleMouseLeave),ho(e,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event"))}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}}};handleMouseClick=t=>{ho(this.options.__debugMouseEvents,"click","FileDiff.DEBUG.handleMouseClick:",t),this.handleMouseEvent({eventType:"click",event:t})};handleMouseMove=t=>{ho(this.options.__debugMouseEvents,"move","FileDiff.DEBUG.handleMouseMove:",t),this.handleMouseEvent({eventType:"move",event:t})};handleMouseLeave=t=>{const{__debugMouseEvents:e}=this.options;if(ho(e,"move","FileDiff.DEBUG.handleMouseLeave: no event"),this.hoveredLine==null){ho(e,"move","FileDiff.DEBUG.handleMouseLeave: returned early, no .hoveredLine");return}this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),this.options.onLineLeave?.({...this.hoveredLine,event:t}),this.hoveredLine=void 0};handleMouseEvent({eventType:t,event:e}){const{__debugMouseEvents:n}=this.options,a=e.composedPath();ho(n,t,"FileDiff.DEBUG.handleMouseEvent:",{eventType:t,composedPath:a});const r=this.getLineData(a);ho(n,t,"FileDiff.DEBUG.handleMouseEvent: getLineData result:",r);const{onLineClick:i,onLineNumberClick:o,onLineEnter:s,onLineLeave:A,onHunkExpand:l}=this.options;switch(t){case"move":if(XT(r,this.mode)&&this.hoveredLine?.lineElement===r.lineElement){ho(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', returned early because same line");break}this.hoveredLine!=null&&(ho(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', clearing an existing hovered line and firing onLineLeave"),this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),A?.({...this.hoveredLine,event:e}),this.hoveredLine=void 0),XT(r,this.mode)&&(ho(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', setting up a new hoveredLine and firing onLineEnter"),this.hoveredLine=r,this.hoverSlot!=null&&r.numberElement?.appendChild(this.hoverSlot),s?.({...this.hoveredLine,event:e}));break;case"click":if(ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', with data:",r),r==null)break;if(Ent(r)&&l!=null){ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', expanding a hunk"),l(r.hunkIndex,r.direction);break}XT(r,this.mode)&&(o!=null&&r.numberColumn?(ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineNumberClick'"),o({...r,event:e})):i!=null?(ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineClick'"),i({...r,event:e})):ho(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', fell through, no event to fire"));break}}getLineData(t){let e=!1;const n=t.find(o=>o instanceof HTMLElement?(e=e||"columnNumber"in o.dataset,"line"in o.dataset||"expandIndex"in o.dataset):!1);if(!(n instanceof HTMLElement))return;if(n.dataset.expandIndex!=null){const o=parseInt(n.dataset.expandIndex);if(isNaN(o))return;let s;for(const A of t)if(A===n||A instanceof HTMLElement&&(s=s??("expandUp"in A.dataset?"up":void 0)??("expandDown"in A.dataset?"down":void 0)??("expandBoth"in A.dataset?"both":void 0),s!=null))break;return s!=null?{type:"line-info",hunkIndex:o,direction:s}:void 0}const a=parseInt(n.dataset.line??"");if(isNaN(a))return;const r=n.dataset.lineType;if(r!=="context"&&r!=="context-expanded"&&r!=="change-deletion"&&r!=="change-addition")return;const i=(()=>{const o=n.children[0];return o instanceof HTMLElement&&o.dataset.columnNumber!=null?o:void 0})();return this.mode==="file"?{type:"line",lineElement:n,lineNumber:a,numberElement:i,numberColumn:e}:{type:"diff-line",annotationSide:(()=>{if(r==="change-deletion")return"deletions";if(r==="change-addition")return"additions";const o=n.closest("[data-code]");return o instanceof HTMLElement&&"deletions"in o.dataset?"deletions":"additions"})(),lineType:r,lineElement:n,numberElement:i,lineNumber:a,numberColumn:e}}};function ho(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)}function moe({onLineClick:t,onLineNumberClick:e,onLineEnter:n,onLineLeave:a,enableHoverUtility:r,__debugMouseEvents:i},o){return{onLineClick:t,onLineNumberClick:e,onLineEnter:n,onLineLeave:a,enableHoverUtility:r,__debugMouseEvents:i,onHunkExpand:o}}var knt=class{observedNodes=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear()}resizeObserver;setup(t){this.cleanUp();const e=t.querySelectorAll('[data-line-annotation*=","]');this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);const n=t.querySelectorAll("code");for(const r of n){let i=r.querySelector("[data-column-number]");i instanceof HTMLElement||(i=null);const o={type:"code",codeElement:r,numberElement:i,codeWidth:"auto",numberWidth:0};this.observedNodes.set(r,o),this.resizeObserver.observe(r),i!=null&&(this.observedNodes.set(i,o),this.resizeObserver.observe(i))}if(n.length<=1)return;const a=new Map;for(const r of e){if(!(r instanceof HTMLElement))continue;const{lineAnnotation:i=""}=r.dataset;if(!/^\d+,\d+$/.test(i)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:i,element:r});continue}let o=a.get(i);o==null&&(o=[],a.set(i,o)),o.push(r)}for(const[r,i]of a){if(i.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",r,i);continue}const[o,s]=i,A=o.firstElementChild,l=s.firstElementChild;if(!(o instanceof HTMLElement)||!(s instanceof HTMLElement)||!(A instanceof HTMLElement)||!(l instanceof HTMLElement))continue;const u={type:"annotations",column1:{container:o,child:A,childHeight:0},column2:{container:s,child:l,childHeight:0},currentHeight:"auto"};this.observedNodes.set(A,u),this.observedNodes.set(l,u),this.resizeObserver.observe(A),this.resizeObserver.observe(l)}}handleResizeObserver=t=>{for(const e of t){const{target:n,borderBoxSize:a}=e;if(!(n instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",e);continue}const r=this.observedNodes.get(n);if(r==null){console.error("FileDiff.handleResizeObserver: Not a valid observed node",e);continue}const i=a[0];if(r.type==="annotations"){const o=(()=>{if(n===r.column1.child)return r.column1;if(n===r.column2.child)return r.column2})();if(o==null){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:r,target:n});continue}o.childHeight=i.blockSize;const s=Math.max(r.column1.childHeight,r.column2.childHeight);s!==r.currentHeight&&(r.currentHeight=Math.max(s,0),r.column1.container.style.setProperty("--diffs-annotation-min-height",`${r.currentHeight}px`),r.column2.container.style.setProperty("--diffs-annotation-min-height",`${r.currentHeight}px`))}else r.type==="code"&&(n===r.codeElement?i.inlineSize!==r.codeWidth&&(r.codeWidth=i.inlineSize,r.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(r.codeWidth-r.numberWidth,0)}px`),r.codeElement.style.setProperty("--diffs-column-width",`${r.codeWidth}px`)):n===r.numberElement&&i.inlineSize!==r.numberWidth&&(r.numberWidth=i.inlineSize,r.codeElement.style.setProperty("--diffs-column-number-width",`${r.numberWidth}px`),r.codeWidth!=="auto"&&r.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(r.codeWidth-r.numberWidth,0)}px`)))}}};function goe(t){for(const e of Array.isArray(t)?t:[t])if(!C$.has(e))return!1;return!0}function e9(t){for(const e of ID(t))if(!b$.has(e))return!1;return!0}function t9(t){return Ta({tagName:"div",children:[Ta({tagName:"div",children:t.annotations?.map(e=>Ta({tagName:"slot",properties:{name:e}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${t.hunkIndex},${t.lineIndex}`}})}function vnt(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 Int({fileOrDiff:t,themeStyles:e,themeType:n}){const a="type"in t?t:void 0,r={"data-diffs-header":"","data-change-type":a?.type,"data-theme-type":n!=="system"?n:void 0,style:e};return Ta({tagName:"div",children:[Qnt({name:t.name,prevName:"prevName"in t?t.prevName:void 0,iconType:a?.type??"file"}),_nt(a)],properties:r})}function Qnt({name:t,prevName:e,iconType:n}){const a=[G$({name:vnt(n),properties:{"data-change-icon":n}})];return e!=null&&(a.push(Ta({tagName:"div",children:[Sm(e)],properties:{"data-prev-name":""}})),a.push(G$({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),a.push(Ta({tagName:"div",children:[Sm(t)],properties:{"data-title":""}})),Ta({tagName:"div",children:a,properties:{"data-header-content":""}})}function _nt(t){const e=[];if(t!=null){let n=0,a=0;for(const r of t.hunks)n+=r.additionLines,a+=r.deletionLines;(a>0||n===0)&&e.push(Ta({tagName:"span",children:[Sm(`-${a}`)],properties:{"data-deletions-count":""}})),(n>0||a===0)&&e.push(Ta({tagName:"span",children:[Sm(`+${n}`)],properties:{"data-additions-count":""}}))}return e.push(Ta({tagName:"slot",properties:{name:MK}})),Ta({tagName:"div",children:e,properties:{"data-metadata":""}})}function xnt(t){return Ta({tagName:"pre",properties:Dnt(t)})}function Dnt({diffIndicators:t,disableBackground:e,disableLineNumbers:n,overflow:a,split:r,themeType:i,themeStyles:o,totalLines:s}){const A={"data-diffs":"","data-type":r?"split":"file","data-overflow":a,"data-disable-line-numbers":n?"":void 0,"data-background":e?void 0:"","data-indicators":t==="bars"||t==="classic"?t:void 0,"data-theme-type":i!=="system"?i:void 0,style:o,tabIndex:0};return A.style+=`--diffs-min-number-column-width-default:${`${s}`.length}ch;`,A}function Snt(t,e){return{langs:[t??"text"],themes:ID(e.theme)}}const Nnt=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
223
223
  <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
224
224
  <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
225
225
  </symbol>
@@ -268,7 +268,7 @@ XID_Start XIDS`.split(/\s/).map(t=>[wS(t),t])),ott=new Map([["s",Ti(383)],[Ti(38
268
268
  <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
269
269
  <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
270
270
  </symbol>
271
- </svg>`;function foe(t,e){return t?.cacheKey===e?.cacheKey&&t?.contents===e?.contents&&t?.name===e?.name&&t?.lang===e?.lang}function _nt(t){const e=document.createElement("div");return e.dataset.annotationSlot="",e.slot=t,e.style.whiteSpace="normal",e}function n9({pre:t,columnType:e}={}){const n=document.createElement("code");return n.dataset.code="",e!=null&&(n.dataset[e]=""),t?.appendChild(n),n}function xnt(){const t=document.createElement("div");return t.slot="hover-slot",t.style.position="absolute",t.style.top="0",t.style.bottom="0",t.style.textAlign="center",t.style.whiteSpace="normal",t}function Dnt(){const t=document.createElement("style");return t.setAttribute(ZBe,""),t}var Snt=`@layer base, theme, unsafe;
271
+ </svg>`;function foe(t,e){return t?.cacheKey===e?.cacheKey&&t?.contents===e?.contents&&t?.name===e?.name&&t?.lang===e?.lang}function Fnt(t){const e=document.createElement("div");return e.dataset.annotationSlot="",e.slot=t,e.style.whiteSpace="normal",e}function n9({pre:t,columnType:e}={}){const n=document.createElement("code");return n.dataset.code="",e!=null&&(n.dataset[e]=""),t?.appendChild(n),n}function Tnt(){const t=document.createElement("div");return t.slot="hover-slot",t.style.position="absolute",t.style.top="0",t.style.bottom="0",t.style.textAlign="center",t.style.whiteSpace="normal",t}function Rnt(){const t=document.createElement("style");return t.setAttribute(VBe,""),t}var Mnt=`@layer base, theme, unsafe;
272
272
 
273
273
  @layer base {
274
274
  :host {
@@ -1311,22 +1311,23 @@ XID_Start XIDS`.split(/\s/).map(t=>[wS(t),t])),ott=new Map([["s",Ti(383)],[Ti(38
1311
1311
  }
1312
1312
  }
1313
1313
  }
1314
- `;const Nnt="@layer base, theme, unsafe;";function Fnt(t){return`${Nnt}
1314
+ `;const Lnt="@layer base, theme, unsafe;";function Ont(t){return`${Lnt}
1315
1315
  @layer unsafe {
1316
1316
  ${t}
1317
- }`}function Tnt(t,e){if(e==null)return;const n=t.shadowRoot??t.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=e)}function Rnt({diffIndicators:t,disableBackground:e,disableLineNumbers:n,overflow:a,pre:r,split:i,themeStyles:o,themeType:s,totalLines:A}){switch(s==="system"?delete r.dataset.themeType:r.dataset.themeType=s,t){case"bars":case"classic":r.dataset.indicators=t;break;case"none":delete r.dataset.indicators;break}return n?r.dataset.disableLineNumbers="":delete r.dataset.disableLineNumbers,e?delete r.dataset.background:r.dataset.background="",r.dataset.type=i?"split":"file",r.dataset.overflow=a,r.dataset.diffs="",r.tabIndex=0,r.style=o,r.style.setProperty("--diffs-min-number-column-width-default",`${`${A}`.length}ch`),r}if(typeof HTMLElement<"u"&&customElements.get(uD)==null){let t;class e extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const a=this.attachShadow({mode:"open"});t==null&&(t=new CSSStyleSheet,t.replaceSync(`@layer base, theme, unsafe;
1317
+ }`}function Gnt(t,e){if(e==null)return;const n=t.shadowRoot??t.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=e)}function Pnt({diffIndicators:t,disableBackground:e,disableLineNumbers:n,overflow:a,pre:r,split:i,themeStyles:o,themeType:s,totalLines:A}){switch(s==="system"?delete r.dataset.themeType:r.dataset.themeType=s,t){case"bars":case"classic":r.dataset.indicators=t;break;case"none":delete r.dataset.indicators;break}return n?r.dataset.disableLineNumbers="":delete r.dataset.disableLineNumbers,e?delete r.dataset.background:r.dataset.background="",r.dataset.type=i?"split":"file",r.dataset.overflow=a,r.dataset.diffs="",r.tabIndex=0,r.style=o,r.style.setProperty("--diffs-min-number-column-width-default",`${`${A}`.length}ch`),r}if(typeof HTMLElement<"u"&&customElements.get(uD)==null){let t;class e extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const a=this.attachShadow({mode:"open"});t==null&&(t=new CSSStyleSheet,t.replaceSync(`@layer base, theme, unsafe;
1318
1318
  @layer base {
1319
- ${Snt}
1320
- }`)),a.adoptedStyleSheets=[t]}}customElements.define(uD,e)}const Mnt=!0;function Lnt(t,e,n){if(t===e||t==null||e==null)return t===e;const a=new Set(n),r=Object.keys(t),i=new Set(Object.keys(e));for(const o of r)if(i.delete(o),!a.has(o)&&(!(o in e)||t[o]!==e[o]))return!1;for(const o of Array.from(i))if(!a.has(o))return!1;return!0}function Ont(t,e){return VK(t?.theme??Vs,e?.theme??Vs)&&Lnt(t,e,["theme"])}function Gnt({fileDiff:t,oldFile:e,newFile:n,renderHeaderMetadata:a,renderAnnotation:r,renderHoverUtility:i,lineAnnotations:o,getHoveredLine:s}){const A=a?.({fileDiff:t,oldFile:e,newFile:n});return be.jsxs(be.Fragment,{children:[A!=null&&be.jsx("div",{slot:FK,children:A}),r!=null&&o?.map((l,u)=>be.jsx("div",{slot:dD(l),children:r(l)},u)),i!=null&&be.jsx("div",{slot:"hover-slot",style:UWe,children:i(s)})]})}var Pnt=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;cleanUp(){this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0}setup(t,e,n){if(e==null||n==null)for(const a of t.children??[])a instanceof HTMLElement&&("deletions"in a.dataset?e=a:"additions"in a.dataset&&(n=a));if(n==null||e==null){this.cleanUp();return}this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeDeletions=e,this.codeAdditions=n,e.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0}),n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!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 eb(t){return Ta({tagName:"div",properties:{"data-buffer":"",style:`grid-row: span ${t};min-height:calc(${t} * 1lh)`}})}function a9(t){return Ta({tagName:"div",children:[Ta({tagName:"span",properties:{"data-column-number":""}}),Ta({tagName:"span",children:[Sm("No newline at end of file")],properties:{"data-column-content":""}})],properties:{"data-no-newline":"","data-line-type":t}})}function r9(t){return Ta({tagName:"div",children:[G$({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 i9({type:t,content:e,expandIndex:n,chunked:a=!1,slotName:r,isFirstHunk:i,isLastHunk:o}){const s=[];if(t==="metadata"&&e!=null&&s.push(Ta({tagName:"div",children:[Sm(e)],properties:{"data-separator-wrapper":""}})),t==="line-info"&&e!=null){const A=[];n!=null&&(a?(i||A.push(r9("up")),o||A.push(r9("down"))):A.push(r9(!i&&!o?"both":i?"down":"up"))),A.push(Ta({tagName:"div",children:[Ta({tagName:"span",children:[Sm(e)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),s.push(Ta({tagName:"div",children:A,properties:{"data-separator-wrapper":"","data-separator-multi-button":A.length>2?"":void 0}}))}return t==="custom"&&r!=null&&s.push(Ta({tagName:"slot",properties:{name:r}})),Ta({tagName:"div",children:s,properties:{"data-separator":s.length===0?"":t,"data-expand-index":n,"data-separator-first":i?"":void 0,"data-separator-last":o?"":void 0}})}function qnt(t,e){return`hunk-separator-${t}-${e}`}function Unt(t){const e=t[t.length-1];return e==null?0:Math.max(e.additionStart+e.additionCount,e.deletionStart+e.deletionCount)}const $nt={fromStart:0,fromEnd:0};var jnt=class{highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(t={theme:Vs},e,n){this.options=t,this.onRenderUpdate=e,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=e9(t.theme??Vs)?Utt():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}setOptions(t){this.options=t}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){this.getOptionsWithDefaults().themeType!==t&&this.mergeOptions({themeType:t})}expandHunk(t,e){const{expansionLineCount:n}=this.getOptionsWithDefaults(),a=this.expandedHunks.get(t)??{fromStart:0,fromEnd:0};(e==="up"||e==="both")&&(a.fromStart+=n),(e==="down"||e==="both")&&(a.fromEnd+=n),this.expandedHunks.set(t,a)}setLineAnnotations(t){this.additionAnnotations={},this.deletionAnnotations={};for(const e of t){const n=(()=>{switch(e.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),a=n[e.lineNumber]??[];n[e.lineNumber]=a,a.push(e)}}getOptionsWithDefaults(){const{diffIndicators:t="bars",diffStyle:e="split",disableBackground:n=!1,disableFileHeader:a=!1,disableLineNumbers:r=!1,expandUnchanged:i=!1,expansionLineCount:o=100,hunkSeparators:s="line-info",lineDiffType:A="word-alt",maxLineDiffLength:l=1e3,overflow:u="scroll",theme:d=Vs,themeType:p="system",tokenizeMaxLineLength:m=1e3,useCSSClasses:g=!1}=this.options;return{diffIndicators:t,diffStyle:e,disableBackground:n,disableFileHeader:a,disableLineNumbers:r,expandUnchanged:i,expansionLineCount:o,hunkSeparators:s,lineDiffType:A,maxLineDiffLength:l,overflow:u,theme:this.workerManager?.getDiffRenderOptions().theme??d,themeType:p,tokenizeMaxLineLength:m,useCSSClasses:g}}async initializeHighlighter(){return this.highlighter=await O$(Int(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&&!o9(e,n.options)&&(n=void 0),this.renderCache??={diff:t,highlighted:!0,options:e,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(t).then(({result:a,options:r})=>{this.onHighlightSuccess(t,a,r)})}getRenderOptions(t){const e=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:a,tokenizeMaxLineLength:r,lineDiffType:i}=this.getOptionsWithDefaults();return{theme:a,tokenizeMaxLineLength:r,lineDiffType:i}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:e,forceRender:!0}:t!==n.diff||!o9(e,n.options)?{options:e,forceRender:!0}:{options:e,forceRender:!1}}renderDiff(t=this.renderCache?.diff){if(t==null)return;const e=this.workerManager?.getDiffResultCache(t);e!=null&&this.renderCache==null&&(this.renderCache={diff:t,highlighted:!0,...e});const{options:n,forceRender:a}=this.getRenderOptions(t);if(this.renderCache??={diff:t,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainDiffAST(t),(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,t);else{this.computedLang=t.lang??Em(t.name);const r=this.highlighter!=null&&e9(n.theme),i=this.highlighter!=null&&goe(this.computedLang);if(this.highlighter!=null&&r&&(a||!this.renderCache.highlighted&&i||this.renderCache.result==null)){const{result:o,options:s}=this.renderDiffWithHighlighter(t,this.highlighter,!i);this.renderCache={diff:t,options:s,highlighted:i,result:o}}(!r||!i)&&this.asyncHighlight(t).then(({result:o,options:s})=>{this.onHighlightSuccess(t,o,s)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,this.renderCache.result):void 0}async asyncRender(t){const{result:e}=await this.asyncHighlight(t);return this.processDiffResult(t,e)}createPreElement(t,e,n,a){const{diffIndicators:r,disableBackground:i,disableLineNumbers:o,overflow:s,themeType:A}=this.getOptionsWithDefaults();return knt({diffIndicators:r,disableBackground:i,disableLineNumbers:o,overflow:s,themeStyles:n,split:t,themeType:a??A,totalLines:e})}async asyncHighlight(t){this.computedLang=t.lang??Em(t.name);const e=this.highlighter!=null&&e9(this.options.theme??Vs),n=this.highlighter!=null&&goe(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:a}=this.getRenderOptions(t);return{result:bve(t,e,a,n),options:a}}onHighlightSuccess(t,e,n){if(this.renderCache==null)return;const a=this.renderCache.diff!==t||!this.renderCache.highlighted||!o9(this.renderCache.options,n);this.renderCache={diff:t,options:n,highlighted:!0,result:e},a&&this.onRenderUpdate?.()}onHighlightError(t){console.error(t)}processDiffResult(t,{code:e,themeStyles:n,baseThemeType:a}){const{diffStyle:r,disableFileHeader:i}=this.getOptionsWithDefaults();this.diff=t;const o=r==="unified";let s=[],A=[],l=[],u=0;const d=[];let p,m=0;for(const b of t.hunks)m+=b.collapsedBefore,m=this.renderHunks({ast:e,hunk:b,prevHunk:p,hunkIndex:u,isLastHunk:u===t.hunks.length-1,additionsAST:s,deletionsAST:A,unifiedAST:l,hunkData:d,lineIndex:m}),u++,p=b;const g=Math.max(Unt(t.hunks),t.newLines?.length??0,t.oldLines?.length??0);s=!o&&(e.hunks!=null||e.newLines.length>0)?s:void 0,A=!o&&(e.hunks!=null||e.oldLines.length>0)?A:void 0,l=l.length>0?l:void 0;const h=this.createPreElement(A!=null&&s!=null,g,n,a);return{additionsAST:s,deletionsAST:A,unifiedAST:l,hunkData:d,preNode:h,themeStyles:n,baseThemeType:a,headerElement:i?void 0:this.renderHeader(this.diff,n,a),totalLines:g,css:""}}renderFullAST(t,e=[]){return t.unifiedAST!=null&&e.push(Ta({tagName:"code",children:t.unifiedAST,properties:{"data-code":"","data-unified":""}})),t.deletionsAST!=null&&e.push(Ta({tagName:"code",children:t.deletionsAST,properties:{"data-code":"","data-deletions":""}})),t.additionsAST!=null&&e.push(Ta({tagName:"code",children:t.additionsAST,properties:{"data-code":"","data-additions":""}})),{...t.preNode,children:e}}renderFullHTML(t,e=[]){return KE(this.renderFullAST(t,e))}renderPartialHTML(t,e){return e==null?KE(t):KE(Ta({tagName:"code",children:t,properties:{"data-code":"",[`data-${e}`]:""}}))}renderCollapsedHunks({ast:t,hunkData:e,hunkIndex:n,hunkSpecs:a,isFirstHunk:r,isLastHunk:i,rangeSize:o,lineIndex:s,additionLineNumber:A,deletionLineNumber:l,unifiedAST:u,deletionsAST:d,additionsAST:p}){if(o<=0)return;const{hunkSeparators:m,expandUnchanged:g,diffStyle:h,expansionLineCount:b}=this.getOptionsWithDefaults(),y=t.hunks==null&&t.newLines.length>0&&t.oldLines.length>0,w=this.expandedHunks.get(n)??$nt,E=o>b,k=Math.max(g?0:o-(w.fromEnd+w.fromStart),0),v=({type:I,linesAST:x})=>{if(m==="line-info"||m==="custom"){const N=qnt(I,n);x.push(i9({type:m,content:Hnt(k),expandIndex:y?n:void 0,chunked:E,slotName:N,isFirstHunk:r,isLastHunk:i})),e.push({slotName:N,hunkIndex:n,lines:k,type:I,expandable:y?{up:y&&!r,down:y,chunked:E}:void 0})}else m==="metadata"&&a!=null?x.push(i9({type:"metadata",content:a,isFirstHunk:r,isLastHunk:i})):m==="simple"&&n>0&&x.push(i9({type:"simple",isFirstHunk:r,isLastHunk:!1}))},_=({rangeLen:I,fromStart:x})=>{if(t.newLines==null||t.oldLines==null)return;const N=i?0:x?o:I;let R=l-N,T=A-N,O=s-N;for(let $=0;$<I;$++){const F=t.oldLines[R],L=t.newLines[T];if(F==null||L==null)throw console.error({aLineNumber:T,dLineNumber:R,ast:t}),new Error("DiffHunksRenderer.renderHunks prefill context invalid. Must include data for old and new lines");R++,T++,h==="unified"?this.pushLineWithAnnotation({newLine:L,unifiedAST:u,unifiedSpan:this.getAnnotations("unified",R,T,n,O)}):this.pushLineWithAnnotation({newLine:L,oldLine:F,additionsAST:p,deletionsAST:d,...this.getAnnotations("split",R,T,n,O)}),O++}};y&&_({rangeLen:Math.min(k===0||g?o:w.fromStart,o),fromStart:!0}),k>0&&(h==="unified"?v({type:"unified",linesAST:u}):(v({type:"deletions",linesAST:d}),v({type:"additions",linesAST:p}))),k>0&&w.fromEnd>0&&!i&&_({rangeLen:Math.min(w.fromEnd,o),fromStart:!1})}renderHunks({hunk:t,hunkData:e,hunkIndex:n,lineIndex:a,isLastHunk:r,prevHunk:i,ast:o,deletionsAST:s,additionsAST:A,unifiedAST:l}){const{diffStyle:u}=this.getOptionsWithDefaults(),d=u==="unified";let p=t.additionStart-1,m=t.deletionStart-1;this.renderCollapsedHunks({additionLineNumber:p,additionsAST:A,ast:o,deletionLineNumber:m,deletionsAST:s,hunkData:e,hunkIndex:n,hunkSpecs:t.hunkSpecs,isFirstHunk:i==null,isLastHunk:!1,lineIndex:a,rangeSize:Math.max(t.collapsedBefore,0),unifiedAST:l});let{oldLines:g,newLines:h,oldIndex:b,newIndex:y}=(()=>{if(o.hunks!=null){const w=o.hunks[n];if(w==null)throw console.error({ast:o,hunkIndex:n}),new Error("DiffHunksRenderer.renderHunks: lineHunk doesn't exist");return{oldLines:w.oldLines,newLines:w.newLines,oldIndex:0,newIndex:0}}return{oldLines:o.oldLines,newLines:o.newLines,oldIndex:m,newIndex:p}})();for(const w of t.hunkContent)if(w.type==="context"){const{length:E}=w.lines;for(let k=0;k<E;k++){const v=g[b],_=h[y];if(b++,y++,p++,m++,d){if(_==null)throw new Error("DiffHunksRenderer.renderHunks: newLine doesnt exist for context...");this.pushLineWithAnnotation({newLine:_,unifiedAST:l,unifiedSpan:this.getAnnotations("unified",m,p,n,a)})}else{if(_==null||v==null)throw new Error("DiffHunksRenderer.renderHunks: newLine or oldLine doesnt exist for context...");this.pushLineWithAnnotation({oldLine:v,newLine:_,deletionsAST:s,additionsAST:A,...this.getAnnotations("split",m,p,n,a)})}a++}if(w.noEOFCR){const k=a9("context");d?l.push(k):(s.push(k),A.push(k))}}else{const{length:E}=w.deletions,{length:k}=w.additions,v=d?E+k:Math.max(E,k);let _=0;for(let I=0;I<v;I++){const{oldLine:x,newLine:N}=(()=>{let R=g[b],T=h[y];if(d?I<E?T=void 0:R=void 0:(I>=E&&(R=void 0),I>=k&&(T=void 0)),R==null&&T==null)throw console.error({i:I,len:v,ast:o,hunkContent:w}),new Error("renderHunks: oldLine and newLine are null, something is wrong");return{oldLine:R,newLine:T}})();if(x!=null&&(b++,m++),N!=null&&(y++,p++),d)this.pushLineWithAnnotation({oldLine:x,newLine:N,unifiedAST:l,unifiedSpan:this.getAnnotations("unified",x!=null?m:void 0,N!=null?p:void 0,n,a)}),a++;else{(x==null||N==null)&&_++;const R=this.getAnnotations("split",x!=null?m:void 0,N!=null?p:void 0,n,a);R!=null&&_>0&&(k>E?s.push(eb(_)):A.push(eb(_)),_=0),this.pushLineWithAnnotation({newLine:N,oldLine:x,deletionsAST:s,additionsAST:A,...R}),a++}}d||(_>0&&(k>E?s.push(eb(_)):A.push(eb(_)),_=0),w.noEOFCRDeletions&&(s.push(a9("change-deletion")),w.noEOFCRAdditions||A.push(eb(1))),w.noEOFCRAdditions&&(A.push(a9("change-addition")),w.noEOFCRDeletions||s.push(eb(1))))}return r&&o.newLines!=null&&o.newLines.length>0&&this.renderCollapsedHunks({additionLineNumber:p,additionsAST:A,ast:o,deletionLineNumber:m,deletionsAST:s,hunkData:e,hunkIndex:n+1,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,lineIndex:a,rangeSize:Math.max(o.newLines.length-Math.max(t.additionStart+t.additionCount-1,0),0),unifiedAST:l}),a}pushLineWithAnnotation({newLine:t,oldLine:e,unifiedAST:n,additionsAST:a,deletionsAST:r,unifiedSpan:i,deletionSpan:o,additionSpan:s}){n!=null?(e!=null?n.push(e):t!=null&&n.push(t),i!=null&&n.push(t9(i))):r!=null&&a!=null&&(e!=null&&r.push(e),t!=null&&a.push(t),o!=null&&r.push(t9(o)),s!=null&&a.push(t9(s)))}getAnnotations(t,e,n,a,r){const i={type:"annotation",hunkIndex:a,lineIndex:r,annotations:[]};if(e!=null)for(const s of this.deletionAnnotations[e]??[])i.annotations.push(dD(s));const o={type:"annotation",hunkIndex:a,lineIndex:r,annotations:[]};if(n!=null)for(const s of this.additionAnnotations[n]??[])(t==="unified"?i:o).annotations.push(dD(s));if(t==="unified")return i.annotations.length>0?i:void 0;if(!(o.annotations.length===0&&i.annotations.length===0))return{deletionSpan:i,additionSpan:o}}renderHeader(t,e,n){const{themeType:a}=this.getOptionsWithDefaults();return wnt({fileOrDiff:t,themeStyles:e,themeType:n??a})}};function o9(t,e){return VK(t.theme,e.theme)&&t.tokenizeMaxLineLength===e.tokenizeMaxLineLength&&t.lineDiffType===e.lineDiffType}function Hnt(t){return`${t} unmodified line${t>1?"s":""}`}function znt(t){const e=t[0];if(e!=="+"&&e!=="-"&&e!==" "&&e!=="\\"){console.error(`parseLineType: Invalid firstChar: "${e}", full line: "${t}"`);return}return{line:t.substring(1),type:e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}}function Ynt(t,e){const n=FT.test(t),a=t.split(n?FT:oie);let r;const i=[];let o;for(const s of a){if(n&&!FT.test(s)){r==null?r=s:console.error("parsePatchContent: unknown file blob:",s);continue}else if(!n&&!oie.test(s)){r==null?r=s:console.error("parsePatchContent: unknown file blob:",s);continue}let A=0;const l=s.split(jWe);o=void 0;for(const u of l){const d=u.split(f$),p=d.shift();if(p==null){console.error("parsePatchContent: invalid hunk",u);continue}const m=p.match(HWe),g=[];let h=0,b=0;if(m==null||o==null){if(o!=null){console.error("parsePatchContent: Invalid hunk",u);continue}o={name:"",prevName:void 0,type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,cacheKey:void 0},d.unshift(p);for(const w of d){const E=w.match(n?YWe:zWe);if(w.startsWith("diff --git")){const[,,k,,v]=w.trim().match(KWe)??[];o.name=v.trim(),k!==v&&(o.prevName=k.trim())}else if(E!=null){const[,k,v]=E;k==="---"&&v!=="/dev/null"?(o.prevName=v.trim(),o.name=v.trim()):k==="+++"&&v!=="/dev/null"&&(o.name=v.trim())}else if(n){if(w.startsWith("new mode ")&&(o.mode=w.replace("new mode","").trim()),w.startsWith("old mode ")&&(o.oldMode=w.replace("old mode","").trim()),w.startsWith("new file mode")&&(o.type="new",o.mode=w.replace("new file mode","").trim()),w.startsWith("deleted file mode")&&(o.type="deleted",o.mode=w.replace("deleted file mode","").trim()),w.startsWith("similarity index")&&(w.startsWith("similarity index 100%")?o.type="rename-pure":o.type="rename-changed"),w.startsWith("index ")){const[,k]=w.trim().match(ZWe)??[];k!=null&&(o.mode=k)}w.startsWith("rename from ")&&(o.prevName=w.replace("rename from ","")),w.startsWith("rename to ")&&(o.name=w.replace("rename to ","").trim())}}continue}else{let w,E;for(;d.length>0&&(d[d.length-1]===`
1321
- `||d[d.length-1]==="");)d.pop();for(const k of d){const v=znt(k);if(v==null)continue;const{type:_,line:I}=v;if(_==="addition")(w==null||w.type!=="change")&&(w=s9("change"),g.push(w)),w.additions.push(I),h++,E="addition";else if(_==="deletion")(w==null||w.type!=="change")&&(w=s9("change"),g.push(w)),w.deletions.push(I),b++,E="deletion";else if(_==="context")(w==null||w.type!=="context")&&(w=s9("context"),g.push(w)),w.lines.push(I),E="context";else if(_==="metadata"&&w!=null){if(w.type==="context")w.noEOFCR=!0;else if(E==="deletion"){w.noEOFCRDeletions=!0;const x=w.deletions.length-1;x>=0&&(w.deletions[x]=Wf(w.deletions[x]))}else if(E==="addition"){w.noEOFCRAdditions=!0;const x=w.additions.length-1;x>=0&&(w.additions[x]=Wf(w.additions[x]))}}}}const y={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(m[4]??"1"),additionStart:parseInt(m[3]),additionLines:h,deletionCount:parseInt(m[2]??"1"),deletionStart:parseInt(m[1]),deletionLines:b,hunkContent:g,hunkContext:m[5],hunkSpecs:p};if(isNaN(y.additionCount)||isNaN(y.deletionCount)||isNaN(y.additionStart)||isNaN(y.deletionStart)){console.error("parsePatchContent: invalid hunk metadata",y);continue}y.collapsedBefore=Math.max(y.additionStart-1-A,0),o.hunks.push(y),A=y.additionStart+y.additionCount-1;for(const w of g)w.type==="context"?(y.splitLineCount+=w.lines.length,y.unifiedLineCount+=w.lines.length):(y.splitLineCount+=Math.max(w.additions.length,w.deletions.length),y.unifiedLineCount+=w.deletions.length+w.additions.length);y.splitLineStart=o.splitLineCount,y.unifiedLineStart=o.unifiedLineCount,o.splitLineCount+=y.splitLineCount,o.unifiedLineCount+=y.unifiedLineCount}o!=null&&(!n&&o.prevName!=null&&o.name!==o.prevName&&(o.hunks.length>0?o.type="rename-changed":o.type="rename-pure"),o.type!=="rename-pure"&&o.type!=="rename-changed"&&(o.prevName=void 0),i.push(o))}return{patchMetadata:r,files:i}}function Knt(t,e){const n=[];for(const a of t.split($We))try{n.push(Ynt(a,e!=null?`${e}-${n.length}`:void 0))}catch(r){console.error(r)}return n}function s9(t){return t==="change"?{type:"change",additions:[],deletions:[],noEOFCRAdditions:!1,noEOFCRDeletions:!1}:{type:"context",lines:[],noEOFCR:!1}}function hoe(t,e){const n=Knt(ont(t.name,e.name,t.contents,e.contents,t.header,e.header))[0]?.files[0];if(n==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return n.oldLines=t.contents.split(f$),n.newLines=e.contents.split(f$),t.cacheKey!=null&&e.cacheKey!=null&&(n.cacheKey=`${t.cacheKey}:${e.cacheKey}`),n}let Znt=-1;var Wnt=class{static LoadedCustomComponent=Mnt;__id=++Znt;fileContainer;spriteSVG;pre;unsafeCSSStyle;hoverContent;headerElement;headerMetadata;customHunkElements=[];errorWrapper;hunksRenderer;resizeManager;scrollSyncManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];oldFile;newFile;fileDiff;constructor(e={theme:Vs},n,a=!1){this.options=e,this.workerManager=n,this.isContainerManaged=a,this.hunksRenderer=new jnt({...e,hunkSeparators:typeof e.hunkSeparators=="function"?"custom":e.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new ynt,this.scrollSyncManager=new Pnt,this.mouseEventManager=new bnt("diff",moe(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager=new fnt(poe(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};setOptions(e){e!=null&&(this.options=e,this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof e.hunkSeparators=="function"?"custom":e.hunkSeparators}),this.mouseEventManager.setOptions(moe(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager.setOptions(poe(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.hunksRenderer.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.mouseEventManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.lineSelectionManager.setSelection(e)}cleanUp(){this.hunksRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.fileDiff=void 0,this.oldFile=void 0,this.newFile=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.headerElement=void 0,this.errorWrapper=void 0}hydrate(e){const{fileContainer:n,prerenderedHTML:a}=e;Tnt(n,a);for(const r of Array.from(n.shadowRoot?.children??[])){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r;continue}if("diffsHeader"in r.dataset){this.headerElement=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute(ZBe)){this.unsafeCSSStyle=r;continue}}}if(this.pre==null)this.render(e);else{const{lineAnnotations:r,oldFile:i,newFile:o,fileDiff:s}=e;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=r??this.lineAnnotations,this.newFile=o,this.oldFile=i,this.fileDiff=s??(i!=null&&o!=null?hoe(i,o):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&(this.resizeManager.setup(this.pre),this.scrollSyncManager.setup(this.pre))}}rerender(){this.fileDiff==null&&this.newFile==null&&this.oldFile==null||this.render({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff,forceRender:!0})}handleExpandHunk=(e,n)=>{this.expandHunk(e,n)};expandHunk(e,n){this.hunksRenderer.expandHunk(e,n),this.rerender()}render({oldFile:e,newFile:n,fileDiff:a,forceRender:r=!1,lineAnnotations:i,fileContainer:o,containerWrapper:s}){const A=e!=null&&n!=null&&(!foe(e,this.oldFile)||!foe(n,this.newFile)),l=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(!r&&!l&&(a!=null&&a===this.fileDiff||a==null&&!A)||(this.oldFile=e,this.newFile=n,a!=null?this.fileDiff=a:e!=null&&n!=null&&A&&(this.fileDiff=hoe(e,n)),i!=null&&this.setLineAnnotations(i),this.fileDiff==null))return;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators=="function"?"custom":this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:u=!1}=this.options;u&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),o=this.getOrCreateFileContainer(o,s);try{const d=this.hunksRenderer.renderDiff(this.fileDiff);if(d==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}d.headerElement!=null&&this.applyHeaderToDOM(d.headerElement,o);const p=this.getOrCreatePreNode(o);this.applyHunksToDOM(p,d),this.renderSeparators(d.hunkData),this.renderAnnotations(),this.renderHoverUtility()}catch(d){d instanceof Error&&this.applyErrorToDOM(d,o)}}renderSeparators(e){const{hunkSeparators:n}=this.options;if(!(this.isContainerManaged||this.fileContainer==null||typeof n!="function")){for(const a of this.customHunkElements)a.parentNode?.removeChild(a);this.customHunkElements.length=0;for(const a of e){const r=document.createElement("div");r.style.display="contents",r.slot=a.slotName,r.appendChild(n(a,this)),this.fileContainer.appendChild(r),this.customHunkElements.push(r)}}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const n of this.annotationElements)n.parentNode?.removeChild(n);this.annotationElements.length=0;const{renderAnnotation:e}=this.options;if(e!=null&&this.lineAnnotations.length>0)for(const n of this.lineAnnotations){const a=e(n);if(a==null)continue;const r=_nt(dD(n));r.appendChild(a),this.annotationElements.push(r),this.fileContainer.appendChild(r)}}renderHoverUtility(){const{renderHoverUtility:e}=this.options;if(this.fileContainer==null||e==null)return;this.hoverContent==null&&(this.hoverContent=xnt(),this.fileContainer.appendChild(this.hoverContent));const n=e(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",n!=null&&this.hoverContent.appendChild(n)}getOrCreateFileContainer(e,n){if(this.fileContainer=e??this.fileContainer??document.createElement(uD),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const a=document.createElement("div");a.innerHTML=Qnt;const r=a.firstChild;r instanceof SVGElement&&(this.spriteSVG=r,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){return this.pre==null?(this.pre=document.createElement("pre"),e.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==e&&e.shadowRoot?.appendChild(this.pre),this.pre}applyHeaderToDOM(e,n){this.cleanupErrorWrapper();const a=document.createElement("div");a.innerHTML=KE(e);const r=a.firstElementChild;if(!(r instanceof HTMLElement)||(this.headerElement!=null?n.shadowRoot?.replaceChild(r,this.headerElement):n.shadowRoot?.prepend(r),this.headerElement=r,this.isContainerManaged))return;const{renderHeaderMetadata:i}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const o=i?.({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff})??void 0;o!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=FK,o instanceof Element?this.headerMetadata.appendChild(o):this.headerMetadata.innerText=`${o}`,n.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:e}=this.options;e==null||e===""||(this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=Dnt(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Fnt(e))}applyHunksToDOM(e,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,n),e.innerHTML="";let a,r;if(n.unifiedAST!=null){const i=n9({columnType:"unified"});i.innerHTML=this.hunksRenderer.renderPartialHTML(n.unifiedAST),e.appendChild(i)}else n.deletionsAST!=null&&(a=n9({columnType:"deletions"}),a.innerHTML=this.hunksRenderer.renderPartialHTML(n.deletionsAST),e.appendChild(a)),n.additionsAST!=null&&(r=n9({columnType:"additions"}),r.innerHTML=this.hunksRenderer.renderPartialHTML(n.additionsAST),e.appendChild(r));this.injectUnsafeCSS(),this.mouseEventManager.setup(e),this.lineSelectionManager.setup(e),(this.options.overflow??"scroll")==="scroll"?(this.resizeManager.setup(e),this.scrollSyncManager.setup(e,a,r)):(this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp())}applyPreNodeAttributes(e,{themeStyles:n,baseThemeType:a,additionsAST:r,deletionsAST:i,totalLines:o}){const{diffIndicators:s="bars",disableBackground:A=!1,disableLineNumbers:l=!1,overflow:u="scroll",themeType:d="system",diffStyle:p="split"}=this.options;Rnt({pre:e,diffIndicators:s,disableBackground:A,disableLineNumbers:l,overflow:u,split:p==="unified"?!1:r!=null&&i!=null,themeStyles:n,themeType:a??d,totalLines:o})}applyErrorToDOM(e,n){this.cleanupErrorWrapper();const a=this.getOrCreatePreNode(n);a.innerHTML="",a.parentNode?.removeChild(a),this.pre=void 0;const r=n.shadowRoot??n.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=e.message,this.errorWrapper.appendChild(i);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}};const Vnt=typeof window>"u"?K.useEffect:K.useLayoutEffect;function Jnt({oldFile:t,newFile:e,fileDiff:n,options:a,lineAnnotations:r,selectedLines:i,prerenderedHTML:o}){const s=K.useContext(XK),A=K.useRef(null),l=mnt(u=>{if(u!=null){if(A.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");A.current=new Wnt(a,s,!0),A.current.hydrate({fileDiff:n,oldFile:t,newFile:e,fileContainer:u,lineAnnotations:r,prerenderedHTML:o})}else{if(A.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");A.current.cleanUp(),A.current=null}});return Vnt(()=>{if(A.current==null)return;const u=A.current,d=!Ont(u.options,a);u.setOptions(a),u.render({forceRender:d,fileDiff:n,oldFile:t,newFile:e,lineAnnotations:r}),i!==void 0&&u.setSelectedLines(i)}),{ref:l,getHoveredLine:K.useCallback(()=>A.current?.getHoveredLine(),[])}}function T5n({fileDiff:t,options:e,lineAnnotations:n,selectedLines:a,className:r,style:i,prerenderedHTML:o,renderAnnotation:s,renderHeaderMetadata:A,renderHoverUtility:l}){const{ref:u,getHoveredLine:d}=Jnt({fileDiff:t,options:e,lineAnnotations:n,selectedLines:a,prerenderedHTML:o});return be.jsx(uD,{ref:u,className:r,style:i,children:WWe(Gnt({fileDiff:t,renderHeaderMetadata:A,renderAnnotation:s,lineAnnotations:n,renderHoverUtility:l,getHoveredLine:d}),o)})}function yve(t){const e=K.useRef({value:t,previous:t});return K.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var BS="Switch",[Xnt]=Cl(BS),[eat,tat]=Xnt(BS),Cve=K.forwardRef((t,e)=>{const{__scopeSwitch:n,name:a,checked:r,defaultChecked:i,required:o,disabled:s,value:A="on",onCheckedChange:l,form:u,...d}=t,[p,m]=K.useState(null),g=ca(e,E=>m(E)),h=K.useRef(!1),b=p?u||!!p.closest("form"):!0,[y,w]=Dm({prop:r,defaultProp:i??!1,onChange:l,caller:BS});return be.jsxs(eat,{scope:n,checked:y,disabled:s,children:[be.jsx(zn.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":kve(y),"data-disabled":s?"":void 0,disabled:s,value:A,...d,ref:g,onClick:on(t.onClick,E=>{w(k=>!k),b&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),b&&be.jsx(Bve,{control:p,bubbles:!h.current,name:a,value:A,checked:y,required:o,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Cve.displayName=BS;var wve="SwitchThumb",Eve=K.forwardRef((t,e)=>{const{__scopeSwitch:n,...a}=t,r=tat(wve,n);return be.jsx(zn.span,{"data-state":kve(r.checked),"data-disabled":r.disabled?"":void 0,...a,ref:e})});Eve.displayName=wve;var nat="SwitchBubbleInput",Bve=K.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:a=!0,...r},i)=>{const o=K.useRef(null),s=ca(o,i),A=yve(n),l=Jwe(e);return K.useEffect(()=>{const u=o.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(A!==n&&m){const g=new Event("click",{bubbles:a});m.call(u,n),u.dispatchEvent(g)}},[A,n,a]),be.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:s,style:{...r.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Bve.displayName=nat;function kve(t){return t?"checked":"unchecked"}var R5n=Cve,M5n=Eve;function aat(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const rat=t=>{switch(t){case"success":return sat;case"info":return cat;case"warning":return Aat;case"error":return lat;default:return null}},iat=Array(12).fill(0),oat=({visible:t,className:e})=>Ce.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Ce.createElement("div",{className:"sonner-spinner"},iat.map((n,a)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),sat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Aat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),cat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),uat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),dat=()=>{const[t,e]=Ce.useState(document.hidden);return Ce.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let q$=1;class pat{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:a,...r}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:q$++,o=this.toasts.find(A=>A.id===i),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(A=>A.id===i?(this.publish({...A,...e,id:i,title:a}),{...A,...e,id:i,dismissible:s,title:a}):A):this.addToast({title:a,...r,dismissible:s,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let a;n.loading!==void 0&&(a=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let i=a!==void 0,o;const s=r.then(async l=>{if(o=["resolve",l],Ce.isValidElement(l))i=!1,this.create({id:a,type:"default",message:l});else if(gat(l)&&!l.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,g=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:p,...g})}else if(l instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(l):n.error,p=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:p,...g})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(l):n.success,p=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:a,type:"success",description:p,...g})}}).catch(async l=>{if(o=["reject",l],n.error!==void 0){i=!1;const u=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!Ce.isValidElement(u)?u:{message:u};this.create({id:a,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),A=()=>new Promise((l,u)=>s.then(()=>o[0]==="reject"?u(o[1]):l(o[1])).catch(u));return typeof a!="string"&&typeof a!="number"?{unwrap:A}:Object.assign(a,{unwrap:A})},this.custom=(e,n)=>{const a=n?.id||q$++;return this.create({jsx:e(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const js=new pat,mat=(t,e)=>{const n=e?.id||q$++;return js.addToast({title:t,...e,id:n}),n},gat=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",fat=mat,hat=()=>js.toasts,bat=()=>js.getActiveToasts(),yat=Object.assign(fat,{success:js.success,info:js.info,warning:js.warning,error:js.error,custom:js.custom,message:js.message,promise:js.promise,dismiss:js.dismiss,loading:js.loading},{getHistory:hat,getToasts:bat});aat("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function KQ(t){return t.label!==void 0}const Cat=3,wat="24px",Eat="16px",boe=4e3,Bat=356,kat=14,vat=45,Iat=200;function Nl(...t){return t.filter(Boolean).join(" ")}function Qat(t){const[e,n]=t.split("-"),a=[];return e&&a.push(e),n&&a.push(n),a}const _at=t=>{var e,n,a,r,i,o,s,A,l;const{invert:u,toast:d,unstyled:p,interacting:m,setHeights:g,visibleToasts:h,heights:b,index:y,toasts:w,expanded:E,removeToast:k,defaultRichColors:v,closeButton:_,style:I,cancelButtonStyle:x,actionButtonStyle:N,className:R="",descriptionClassName:T="",duration:O,position:$,gap:F,expandByDefault:L,classNames:M,icons:P,closeButtonAriaLabel:D="Close toast"}=t,[q,U]=Ce.useState(null),[G,H]=Ce.useState(null),[j,Z]=Ce.useState(!1),[J,ae]=Ce.useState(!1),[ee,pe]=Ce.useState(!1),[ie,re]=Ce.useState(!1),[ne,te]=Ce.useState(!1),[le,Ae]=Ce.useState(0),[Be,de]=Ce.useState(0),Ge=Ce.useRef(d.duration||O||boe),oe=Ce.useRef(null),Je=Ce.useRef(null),Ee=y===0,st=y+1<=h,nt=d.type,lt=d.dismissible!==!1,Me=d.className||"",tt=d.descriptionClassName||"",ye=Ce.useMemo(()=>b.findIndex(He=>He.toastId===d.id)||0,[b,d.id]),De=Ce.useMemo(()=>{var He;return(He=d.closeButton)!=null?He:_},[d.closeButton,_]),qe=Ce.useMemo(()=>d.duration||O||boe,[d.duration,O]),ke=Ce.useRef(0),$e=Ce.useRef(0),ue=Ce.useRef(0),we=Ce.useRef(null),[W,he]=$.split("-"),me=Ce.useMemo(()=>b.reduce((He,at,ze)=>ze>=ye?He:He+at.height,0),[b,ye]),Qe=dat(),xe=d.invert||u,Te=nt==="loading";$e.current=Ce.useMemo(()=>ye*F+me,[ye,me]),Ce.useEffect(()=>{Ge.current=qe},[qe]),Ce.useEffect(()=>{Z(!0)},[]),Ce.useEffect(()=>{const He=Je.current;if(He){const at=He.getBoundingClientRect().height;return de(at),g(ze=>[{toastId:d.id,height:at,position:d.position},...ze]),()=>g(ze=>ze.filter(Ve=>Ve.toastId!==d.id))}},[g,d.id]),Ce.useLayoutEffect(()=>{if(!j)return;const He=Je.current,at=He.style.height;He.style.height="auto";const ze=He.getBoundingClientRect().height;He.style.height=at,de(ze),g(Ve=>Ve.find(it=>it.toastId===d.id)?Ve.map(it=>it.toastId===d.id?{...it,height:ze}:it):[{toastId:d.id,height:ze,position:d.position},...Ve])},[j,d.title,d.description,g,d.id,d.jsx,d.action,d.cancel]);const Oe=Ce.useCallback(()=>{ae(!0),Ae($e.current),g(He=>He.filter(at=>at.toastId!==d.id)),setTimeout(()=>{k(d)},Iat)},[d,k,g,$e]);Ce.useEffect(()=>{if(d.promise&&nt==="loading"||d.duration===1/0||d.type==="loading")return;let He;return E||m||Qe?(()=>{if(ue.current<ke.current){const Ve=new Date().getTime()-ke.current;Ge.current=Ge.current-Ve}ue.current=new Date().getTime()})():Ge.current!==1/0&&(ke.current=new Date().getTime(),He=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Oe()},Ge.current)),()=>clearTimeout(He)},[E,m,d,nt,Qe,Oe]),Ce.useEffect(()=>{d.delete&&(Oe(),d.onDismiss==null||d.onDismiss.call(d,d))},[Oe,d.delete]);function Le(){var He;if(P?.loading){var at;return Ce.createElement("div",{className:Nl(M?.loader,d==null||(at=d.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":nt==="loading"},P.loading)}return Ce.createElement(oat,{className:Nl(M?.loader,d==null||(He=d.classNames)==null?void 0:He.loader),visible:nt==="loading"})}const Xe=d.icon||P?.[nt]||rat(nt);var yt,ht;return Ce.createElement("li",{tabIndex:0,ref:Je,className:Nl(R,Me,M?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,M?.default,M?.[nt],d==null||(n=d.classNames)==null?void 0:n[nt]),"data-sonner-toast":"","data-rich-colors":(yt=d.richColors)!=null?yt:v,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":j,"data-promise":!!d.promise,"data-swiped":ne,"data-removed":J,"data-visible":st,"data-y-position":W,"data-x-position":he,"data-index":y,"data-front":Ee,"data-swiping":ee,"data-dismissible":lt,"data-type":nt,"data-invert":xe,"data-swipe-out":ie,"data-swipe-direction":G,"data-expanded":!!(E||L&&j),"data-testid":d.testId,style:{"--index":y,"--toasts-before":y,"--z-index":w.length-y,"--offset":`${J?le:$e.current}px`,"--initial-height":L?"auto":`${Be}px`,...I,...d.style},onDragEnd:()=>{pe(!1),U(null),we.current=null},onPointerDown:He=>{He.button!==2&&(Te||!lt||(oe.current=new Date,Ae($e.current),He.target.setPointerCapture(He.pointerId),He.target.tagName!=="BUTTON"&&(pe(!0),we.current={x:He.clientX,y:He.clientY})))},onPointerUp:()=>{var He,at,ze;if(ie||!lt)return;we.current=null;const Ve=Number(((He=Je.current)==null?void 0:He.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),bt=Number(((at=Je.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),it=new Date().getTime()-((ze=oe.current)==null?void 0:ze.getTime()),We=q==="x"?Ve:bt,_t=Math.abs(We)/it;if(Math.abs(We)>=vat||_t>.11){Ae($e.current),d.onDismiss==null||d.onDismiss.call(d,d),H(q==="x"?Ve>0?"right":"left":bt>0?"down":"up"),Oe(),re(!0);return}else{var ct,wt;(ct=Je.current)==null||ct.style.setProperty("--swipe-amount-x","0px"),(wt=Je.current)==null||wt.style.setProperty("--swipe-amount-y","0px")}te(!1),pe(!1),U(null)},onPointerMove:He=>{var at,ze,Ve;if(!we.current||!lt||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;const it=He.clientY-we.current.y,We=He.clientX-we.current.x;var _t;const ct=(_t=t.swipeDirections)!=null?_t:Qat($);!q&&(Math.abs(We)>1||Math.abs(it)>1)&&U(Math.abs(We)>Math.abs(it)?"x":"y");let wt={x:0,y:0};const Nt=kt=>1/(1.5+Math.abs(kt)/20);if(q==="y"){if(ct.includes("top")||ct.includes("bottom"))if(ct.includes("top")&&it<0||ct.includes("bottom")&&it>0)wt.y=it;else{const kt=it*Nt(it);wt.y=Math.abs(kt)<Math.abs(it)?kt:it}}else if(q==="x"&&(ct.includes("left")||ct.includes("right")))if(ct.includes("left")&&We<0||ct.includes("right")&&We>0)wt.x=We;else{const kt=We*Nt(We);wt.x=Math.abs(kt)<Math.abs(We)?kt:We}(Math.abs(wt.x)>0||Math.abs(wt.y)>0)&&te(!0),(ze=Je.current)==null||ze.style.setProperty("--swipe-amount-x",`${wt.x}px`),(Ve=Je.current)==null||Ve.style.setProperty("--swipe-amount-y",`${wt.y}px`)}},De&&!d.jsx&&nt!=="loading"?Ce.createElement("button",{"aria-label":D,"data-disabled":Te,"data-close-button":!0,onClick:Te||!lt?()=>{}:()=>{Oe(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Nl(M?.closeButton,d==null||(a=d.classNames)==null?void 0:a.closeButton)},(ht=P?.close)!=null?ht:uat):null,(nt||d.icon||d.promise)&&d.icon!==null&&(P?.[nt]!==null||d.icon)?Ce.createElement("div",{"data-icon":"",className:Nl(M?.icon,d==null||(r=d.classNames)==null?void 0:r.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Le():null,d.type!=="loading"?Xe:null):null,Ce.createElement("div",{"data-content":"",className:Nl(M?.content,d==null||(i=d.classNames)==null?void 0:i.content)},Ce.createElement("div",{"data-title":"",className:Nl(M?.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Ce.createElement("div",{"data-description":"",className:Nl(T,tt,M?.description,d==null||(s=d.classNames)==null?void 0:s.description)},typeof d.description=="function"?d.description():d.description):null),Ce.isValidElement(d.cancel)?d.cancel:d.cancel&&KQ(d.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||x,onClick:He=>{KQ(d.cancel)&&lt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,He),Oe())},className:Nl(M?.cancelButton,d==null||(A=d.classNames)==null?void 0:A.cancelButton)},d.cancel.label):null,Ce.isValidElement(d.action)?d.action:d.action&&KQ(d.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||N,onClick:He=>{KQ(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,He),!He.defaultPrevented&&Oe())},className:Nl(M?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function yoe(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function xat(t,e){const n={};return[t,e].forEach((a,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",s=i?Eat:wat;function A(l){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof a=="number"||typeof a=="string"?A(a):typeof a=="object"?["top","right","bottom","left"].forEach(l=>{a[l]===void 0?n[`${o}-${l}`]=s:n[`${o}-${l}`]=typeof a[l]=="number"?`${a[l]}px`:a[l]}):A(s)}),n}const Dat=Ce.forwardRef(function(e,n){const{id:a,invert:r,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:A,className:l,offset:u,mobileOffset:d,theme:p="light",richColors:m,duration:g,style:h,visibleToasts:b=Cat,toastOptions:y,dir:w=yoe(),gap:E=kat,icons:k,containerAriaLabel:v="Notifications"}=e,[_,I]=Ce.useState([]),x=Ce.useMemo(()=>a?_.filter(j=>j.toasterId===a):_.filter(j=>!j.toasterId),[_,a]),N=Ce.useMemo(()=>Array.from(new Set([i].concat(x.filter(j=>j.position).map(j=>j.position)))),[x,i]),[R,T]=Ce.useState([]),[O,$]=Ce.useState(!1),[F,L]=Ce.useState(!1),[M,P]=Ce.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=Ce.useRef(null),q=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=Ce.useRef(null),G=Ce.useRef(!1),H=Ce.useCallback(j=>{I(Z=>{var J;return(J=Z.find(ae=>ae.id===j.id))!=null&&J.delete||js.dismiss(j.id),Z.filter(({id:ae})=>ae!==j.id)})},[]);return Ce.useEffect(()=>js.subscribe(j=>{if(j.dismiss){requestAnimationFrame(()=>{I(Z=>Z.map(J=>J.id===j.id?{...J,delete:!0}:J))});return}setTimeout(()=>{Rwe.flushSync(()=>{I(Z=>{const J=Z.findIndex(ae=>ae.id===j.id);return J!==-1?[...Z.slice(0,J),{...Z[J],...j},...Z.slice(J+1)]:[j,...Z]})})})}),[_]),Ce.useEffect(()=>{if(p!=="system"){P(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;const j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:Z})=>{P(Z?"dark":"light")})}catch{j.addListener(({matches:J})=>{try{P(J?"dark":"light")}catch(ae){console.error(ae)}})}},[p]),Ce.useEffect(()=>{_.length<=1&&$(!1)},[_]),Ce.useEffect(()=>{const j=Z=>{var J;if(o.every(pe=>Z[pe]||Z.code===pe)){var ee;$(!0),(ee=D.current)==null||ee.focus()}Z.code==="Escape"&&(document.activeElement===D.current||(J=D.current)!=null&&J.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[o]),Ce.useEffect(()=>{if(D.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,G.current=!1)}},[D.current]),Ce.createElement("section",{ref:n,"aria-label":`${v} ${q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((j,Z)=>{var J;const[ae,ee]=j.split("-");return x.length?Ce.createElement("ol",{key:j,dir:w==="auto"?yoe():w,tabIndex:-1,ref:D,className:l,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ae,"data-x-position":ee,style:{"--front-toast-height":`${((J=R[0])==null?void 0:J.height)||0}px`,"--width":`${Bat}px`,"--gap":`${E}px`,...h,...xat(u,d)},onBlur:pe=>{G.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(G.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||G.current||(G.current=!0,U.current=pe.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{F||$(!1)},onDragEnd:()=>$(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},x.filter(pe=>!pe.position&&Z===0||pe.position===j).map((pe,ie)=>{var re,ne;return Ce.createElement(_at,{key:pe.id,icons:k,index:ie,toast:pe,defaultRichColors:m,duration:(re=y?.duration)!=null?re:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:r,visibleToasts:b,closeButton:(ne=y?.closeButton)!=null?ne:A,interacting:F,position:j,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:H,toasts:x.filter(te=>te.position==pe.position),heights:R.filter(te=>te.position==pe.position),setHeights:T,expandByDefault:s,gap:E,expanded:O,swipeDirections:e.swipeDirections})})):null}))}),L5n=Object.freeze(Object.defineProperty({__proto__:null,Toaster:Dat,toast:yat},Symbol.toStringTag,{value:"Module"}));var kS="Dialog",[vve]=Cl(kS),[Sat,wl]=vve(kS),Ive=t=>{const{__scopeDialog:e,children:n,open:a,defaultOpen:r,onOpenChange:i,modal:o=!0}=t,s=K.useRef(null),A=K.useRef(null),[l,u]=Dm({prop:a,defaultProp:r??!1,onChange:i,caller:kS});return be.jsx(Sat,{scope:e,triggerRef:s,contentRef:A,contentId:xo(),titleId:xo(),descriptionId:xo(),open:l,onOpenChange:u,onOpenToggle:K.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};Ive.displayName=kS;var Qve="DialogTrigger",Nat=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(Qve,n),i=ca(e,r.triggerRef);return be.jsx(zn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":nZ(r.open),...a,ref:i,onClick:on(t.onClick,r.onOpenToggle)})});Nat.displayName=Qve;var eZ="DialogPortal",[Fat,_ve]=vve(eZ,{forceMount:void 0}),xve=t=>{const{__scopeDialog:e,forceMount:n,children:a,container:r}=t,i=wl(eZ,e);return be.jsx(Fat,{scope:e,forceMount:n,children:K.Children.map(a,o=>be.jsx(vs,{present:n||i.open,children:be.jsx(Xk,{asChild:!0,container:r,children:o})}))})};xve.displayName=eZ;var QD="DialogOverlay",Dve=K.forwardRef((t,e)=>{const n=_ve(QD,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=wl(QD,t.__scopeDialog);return i.modal?be.jsx(vs,{present:a||i.open,children:be.jsx(Rat,{...r,ref:e})}):null});Dve.displayName=QD;var Tat=C2("DialogOverlay.RemoveScroll"),Rat=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(QD,n);return be.jsx(lS,{as:Tat,allowPinchZoom:!0,shards:[r.contentRef],children:be.jsx(zn.div,{"data-state":nZ(r.open),...a,ref:e,style:{pointerEvents:"auto",...a.style}})})}),Vf="DialogContent",Sve=K.forwardRef((t,e)=>{const n=_ve(Vf,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=wl(Vf,t.__scopeDialog);return be.jsx(vs,{present:a||i.open,children:i.modal?be.jsx(Mat,{...r,ref:e}):be.jsx(Lat,{...r,ref:e})})});Sve.displayName=Vf;var Mat=K.forwardRef((t,e)=>{const n=wl(Vf,t.__scopeDialog),a=K.useRef(null),r=ca(e,n.contentRef,a);return K.useEffect(()=>{const i=a.current;if(i)return vK(i)},[]),be.jsx(Nve,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:on(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:on(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:on(t.onFocusOutside,i=>i.preventDefault())})}),Lat=K.forwardRef((t,e)=>{const n=wl(Vf,t.__scopeDialog),a=K.useRef(!1),r=K.useRef(!1);return be.jsx(Nve,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(a.current||n.triggerRef.current?.focus(),i.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(a.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),Nve=K.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=t,s=wl(Vf,n),A=K.useRef(null),l=ca(e,A);return kK(),be.jsxs(be.Fragment,{children:[be.jsx(AS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:i,children:be.jsx(Vk,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":nZ(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),be.jsxs(be.Fragment,{children:[be.jsx(Oat,{titleId:s.titleId}),be.jsx(Pat,{contentRef:A,descriptionId:s.descriptionId})]})]})}),tZ="DialogTitle",Fve=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(tZ,n);return be.jsx(zn.h2,{id:r.titleId,...a,ref:e})});Fve.displayName=tZ;var Tve="DialogDescription",Rve=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(Tve,n);return be.jsx(zn.p,{id:r.descriptionId,...a,ref:e})});Rve.displayName=Tve;var Mve="DialogClose",Lve=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(Mve,n);return be.jsx(zn.button,{type:"button",...a,ref:e,onClick:on(t.onClick,()=>r.onOpenChange(!1))})});Lve.displayName=Mve;function nZ(t){return t?"open":"closed"}var Ove="DialogTitleWarning",[O5n,Gve]=G$e(Ove,{contentName:Vf,titleName:tZ,docsSlug:"dialog"}),Oat=({titleId:t})=>{const e=Gve(Ove),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
1319
+ ${Mnt}
1320
+ }`)),a.adoptedStyleSheets=[t]}}customElements.define(uD,e)}const qnt=!0;function Unt(t,e,n){if(t===e||t==null||e==null)return t===e;const a=new Set(n),r=Object.keys(t),i=new Set(Object.keys(e));for(const o of r)if(i.delete(o),!a.has(o)&&(!(o in e)||t[o]!==e[o]))return!1;for(const o of Array.from(i))if(!a.has(o))return!1;return!0}function $nt(t,e){return eZ(t?.theme??Vs,e?.theme??Vs)&&Unt(t,e,["theme"])}function jnt({fileDiff:t,oldFile:e,newFile:n,renderHeaderMetadata:a,renderAnnotation:r,renderHoverUtility:i,lineAnnotations:o,getHoveredLine:s}){const A=a?.({fileDiff:t,oldFile:e,newFile:n});return be.jsxs(be.Fragment,{children:[A!=null&&be.jsx("div",{slot:MK,children:A}),r!=null&&o?.map((l,u)=>be.jsx("div",{slot:dD(l),children:r(l)},u)),i!=null&&be.jsx("div",{slot:"hover-slot",style:YWe,children:i(s)})]})}var Hnt=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;cleanUp(){this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0}setup(t,e,n){if(e==null||n==null)for(const a of t.children??[])a instanceof HTMLElement&&("deletions"in a.dataset?e=a:"additions"in a.dataset&&(n=a));if(n==null||e==null){this.cleanUp();return}this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeDeletions=e,this.codeAdditions=n,e.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0}),n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!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 eb(t){return Ta({tagName:"div",properties:{"data-buffer":"",style:`grid-row: span ${t};min-height:calc(${t} * 1lh)`}})}function a9(t){return Ta({tagName:"div",children:[Ta({tagName:"span",properties:{"data-column-number":""}}),Ta({tagName:"span",children:[Sm("No newline at end of file")],properties:{"data-column-content":""}})],properties:{"data-no-newline":"","data-line-type":t}})}function r9(t){return Ta({tagName:"div",children:[G$({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 i9({type:t,content:e,expandIndex:n,chunked:a=!1,slotName:r,isFirstHunk:i,isLastHunk:o}){const s=[];if(t==="metadata"&&e!=null&&s.push(Ta({tagName:"div",children:[Sm(e)],properties:{"data-separator-wrapper":""}})),t==="line-info"&&e!=null){const A=[];n!=null&&(a?(i||A.push(r9("up")),o||A.push(r9("down"))):A.push(r9(!i&&!o?"both":i?"down":"up"))),A.push(Ta({tagName:"div",children:[Ta({tagName:"span",children:[Sm(e)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),s.push(Ta({tagName:"div",children:A,properties:{"data-separator-wrapper":"","data-separator-multi-button":A.length>2?"":void 0}}))}return t==="custom"&&r!=null&&s.push(Ta({tagName:"slot",properties:{name:r}})),Ta({tagName:"div",children:s,properties:{"data-separator":s.length===0?"":t,"data-expand-index":n,"data-separator-first":i?"":void 0,"data-separator-last":o?"":void 0}})}function znt(t,e){return`hunk-separator-${t}-${e}`}function Ynt(t){const e=t[t.length-1];return e==null?0:Math.max(e.additionStart+e.additionCount,e.deletionStart+e.deletionCount)}const Knt={fromStart:0,fromEnd:0};var Znt=class{highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(t={theme:Vs},e,n){this.options=t,this.onRenderUpdate=e,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=e9(t.theme??Vs)?Ytt():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}setOptions(t){this.options=t}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){this.getOptionsWithDefaults().themeType!==t&&this.mergeOptions({themeType:t})}expandHunk(t,e){const{expansionLineCount:n}=this.getOptionsWithDefaults(),a=this.expandedHunks.get(t)??{fromStart:0,fromEnd:0};(e==="up"||e==="both")&&(a.fromStart+=n),(e==="down"||e==="both")&&(a.fromEnd+=n),this.expandedHunks.set(t,a)}setLineAnnotations(t){this.additionAnnotations={},this.deletionAnnotations={};for(const e of t){const n=(()=>{switch(e.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),a=n[e.lineNumber]??[];n[e.lineNumber]=a,a.push(e)}}getOptionsWithDefaults(){const{diffIndicators:t="bars",diffStyle:e="split",disableBackground:n=!1,disableFileHeader:a=!1,disableLineNumbers:r=!1,expandUnchanged:i=!1,expansionLineCount:o=100,hunkSeparators:s="line-info",lineDiffType:A="word-alt",maxLineDiffLength:l=1e3,overflow:u="scroll",theme:d=Vs,themeType:p="system",tokenizeMaxLineLength:m=1e3,useCSSClasses:g=!1}=this.options;return{diffIndicators:t,diffStyle:e,disableBackground:n,disableFileHeader:a,disableLineNumbers:r,expandUnchanged:i,expansionLineCount:o,hunkSeparators:s,lineDiffType:A,maxLineDiffLength:l,overflow:u,theme:this.workerManager?.getDiffRenderOptions().theme??d,themeType:p,tokenizeMaxLineLength:m,useCSSClasses:g}}async initializeHighlighter(){return this.highlighter=await O$(Snt(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&&!o9(e,n.options)&&(n=void 0),this.renderCache??={diff:t,highlighted:!0,options:e,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(t).then(({result:a,options:r})=>{this.onHighlightSuccess(t,a,r)})}getRenderOptions(t){const e=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:a,tokenizeMaxLineLength:r,lineDiffType:i}=this.getOptionsWithDefaults();return{theme:a,tokenizeMaxLineLength:r,lineDiffType:i}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:e,forceRender:!0}:t!==n.diff||!o9(e,n.options)?{options:e,forceRender:!0}:{options:e,forceRender:!1}}renderDiff(t=this.renderCache?.diff){if(t==null)return;const e=this.workerManager?.getDiffResultCache(t);e!=null&&this.renderCache==null&&(this.renderCache={diff:t,highlighted:!0,...e});const{options:n,forceRender:a}=this.getRenderOptions(t);if(this.renderCache??={diff:t,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainDiffAST(t),(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,t);else{this.computedLang=t.lang??Em(t.name);const r=this.highlighter!=null&&e9(n.theme),i=this.highlighter!=null&&goe(this.computedLang);if(this.highlighter!=null&&r&&(a||!this.renderCache.highlighted&&i||this.renderCache.result==null)){const{result:o,options:s}=this.renderDiffWithHighlighter(t,this.highlighter,!i);this.renderCache={diff:t,options:s,highlighted:i,result:o}}(!r||!i)&&this.asyncHighlight(t).then(({result:o,options:s})=>{this.onHighlightSuccess(t,o,s)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,this.renderCache.result):void 0}async asyncRender(t){const{result:e}=await this.asyncHighlight(t);return this.processDiffResult(t,e)}createPreElement(t,e,n,a){const{diffIndicators:r,disableBackground:i,disableLineNumbers:o,overflow:s,themeType:A}=this.getOptionsWithDefaults();return xnt({diffIndicators:r,disableBackground:i,disableLineNumbers:o,overflow:s,themeStyles:n,split:t,themeType:a??A,totalLines:e})}async asyncHighlight(t){this.computedLang=t.lang??Em(t.name);const e=this.highlighter!=null&&e9(this.options.theme??Vs),n=this.highlighter!=null&&goe(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:a}=this.getRenderOptions(t);return{result:Cve(t,e,a,n),options:a}}onHighlightSuccess(t,e,n){if(this.renderCache==null)return;const a=this.renderCache.diff!==t||!this.renderCache.highlighted||!o9(this.renderCache.options,n);this.renderCache={diff:t,options:n,highlighted:!0,result:e},a&&this.onRenderUpdate?.()}onHighlightError(t){console.error(t)}processDiffResult(t,{code:e,themeStyles:n,baseThemeType:a}){const{diffStyle:r,disableFileHeader:i}=this.getOptionsWithDefaults();this.diff=t;const o=r==="unified";let s=[],A=[],l=[],u=0;const d=[];let p,m=0;for(const b of t.hunks)m+=b.collapsedBefore,m=this.renderHunks({ast:e,hunk:b,prevHunk:p,hunkIndex:u,isLastHunk:u===t.hunks.length-1,additionsAST:s,deletionsAST:A,unifiedAST:l,hunkData:d,lineIndex:m}),u++,p=b;const g=Math.max(Ynt(t.hunks),t.newLines?.length??0,t.oldLines?.length??0);s=!o&&(e.hunks!=null||e.newLines.length>0)?s:void 0,A=!o&&(e.hunks!=null||e.oldLines.length>0)?A:void 0,l=l.length>0?l:void 0;const h=this.createPreElement(A!=null&&s!=null,g,n,a);return{additionsAST:s,deletionsAST:A,unifiedAST:l,hunkData:d,preNode:h,themeStyles:n,baseThemeType:a,headerElement:i?void 0:this.renderHeader(this.diff,n,a),totalLines:g,css:""}}renderFullAST(t,e=[]){return t.unifiedAST!=null&&e.push(Ta({tagName:"code",children:t.unifiedAST,properties:{"data-code":"","data-unified":""}})),t.deletionsAST!=null&&e.push(Ta({tagName:"code",children:t.deletionsAST,properties:{"data-code":"","data-deletions":""}})),t.additionsAST!=null&&e.push(Ta({tagName:"code",children:t.additionsAST,properties:{"data-code":"","data-additions":""}})),{...t.preNode,children:e}}renderFullHTML(t,e=[]){return KE(this.renderFullAST(t,e))}renderPartialHTML(t,e){return e==null?KE(t):KE(Ta({tagName:"code",children:t,properties:{"data-code":"",[`data-${e}`]:""}}))}renderCollapsedHunks({ast:t,hunkData:e,hunkIndex:n,hunkSpecs:a,isFirstHunk:r,isLastHunk:i,rangeSize:o,lineIndex:s,additionLineNumber:A,deletionLineNumber:l,unifiedAST:u,deletionsAST:d,additionsAST:p}){if(o<=0)return;const{hunkSeparators:m,expandUnchanged:g,diffStyle:h,expansionLineCount:b}=this.getOptionsWithDefaults(),y=t.hunks==null&&t.newLines.length>0&&t.oldLines.length>0,w=this.expandedHunks.get(n)??Knt,E=o>b,k=Math.max(g?0:o-(w.fromEnd+w.fromStart),0),v=({type:I,linesAST:x})=>{if(m==="line-info"||m==="custom"){const N=znt(I,n);x.push(i9({type:m,content:Wnt(k),expandIndex:y?n:void 0,chunked:E,slotName:N,isFirstHunk:r,isLastHunk:i})),e.push({slotName:N,hunkIndex:n,lines:k,type:I,expandable:y?{up:y&&!r,down:y,chunked:E}:void 0})}else m==="metadata"&&a!=null?x.push(i9({type:"metadata",content:a,isFirstHunk:r,isLastHunk:i})):m==="simple"&&n>0&&x.push(i9({type:"simple",isFirstHunk:r,isLastHunk:!1}))},_=({rangeLen:I,fromStart:x})=>{if(t.newLines==null||t.oldLines==null)return;const N=i?0:x?o:I;let R=l-N,T=A-N,O=s-N;for(let $=0;$<I;$++){const F=t.oldLines[R],L=t.newLines[T];if(F==null||L==null)throw console.error({aLineNumber:T,dLineNumber:R,ast:t}),new Error("DiffHunksRenderer.renderHunks prefill context invalid. Must include data for old and new lines");R++,T++,h==="unified"?this.pushLineWithAnnotation({newLine:L,unifiedAST:u,unifiedSpan:this.getAnnotations("unified",R,T,n,O)}):this.pushLineWithAnnotation({newLine:L,oldLine:F,additionsAST:p,deletionsAST:d,...this.getAnnotations("split",R,T,n,O)}),O++}};y&&_({rangeLen:Math.min(k===0||g?o:w.fromStart,o),fromStart:!0}),k>0&&(h==="unified"?v({type:"unified",linesAST:u}):(v({type:"deletions",linesAST:d}),v({type:"additions",linesAST:p}))),k>0&&w.fromEnd>0&&!i&&_({rangeLen:Math.min(w.fromEnd,o),fromStart:!1})}renderHunks({hunk:t,hunkData:e,hunkIndex:n,lineIndex:a,isLastHunk:r,prevHunk:i,ast:o,deletionsAST:s,additionsAST:A,unifiedAST:l}){const{diffStyle:u}=this.getOptionsWithDefaults(),d=u==="unified";let p=t.additionStart-1,m=t.deletionStart-1;this.renderCollapsedHunks({additionLineNumber:p,additionsAST:A,ast:o,deletionLineNumber:m,deletionsAST:s,hunkData:e,hunkIndex:n,hunkSpecs:t.hunkSpecs,isFirstHunk:i==null,isLastHunk:!1,lineIndex:a,rangeSize:Math.max(t.collapsedBefore,0),unifiedAST:l});let{oldLines:g,newLines:h,oldIndex:b,newIndex:y}=(()=>{if(o.hunks!=null){const w=o.hunks[n];if(w==null)throw console.error({ast:o,hunkIndex:n}),new Error("DiffHunksRenderer.renderHunks: lineHunk doesn't exist");return{oldLines:w.oldLines,newLines:w.newLines,oldIndex:0,newIndex:0}}return{oldLines:o.oldLines,newLines:o.newLines,oldIndex:m,newIndex:p}})();for(const w of t.hunkContent)if(w.type==="context"){const{length:E}=w.lines;for(let k=0;k<E;k++){const v=g[b],_=h[y];if(b++,y++,p++,m++,d){if(_==null)throw new Error("DiffHunksRenderer.renderHunks: newLine doesnt exist for context...");this.pushLineWithAnnotation({newLine:_,unifiedAST:l,unifiedSpan:this.getAnnotations("unified",m,p,n,a)})}else{if(_==null||v==null)throw new Error("DiffHunksRenderer.renderHunks: newLine or oldLine doesnt exist for context...");this.pushLineWithAnnotation({oldLine:v,newLine:_,deletionsAST:s,additionsAST:A,...this.getAnnotations("split",m,p,n,a)})}a++}if(w.noEOFCR){const k=a9("context");d?l.push(k):(s.push(k),A.push(k))}}else{const{length:E}=w.deletions,{length:k}=w.additions,v=d?E+k:Math.max(E,k);let _=0;for(let I=0;I<v;I++){const{oldLine:x,newLine:N}=(()=>{let R=g[b],T=h[y];if(d?I<E?T=void 0:R=void 0:(I>=E&&(R=void 0),I>=k&&(T=void 0)),R==null&&T==null)throw console.error({i:I,len:v,ast:o,hunkContent:w}),new Error("renderHunks: oldLine and newLine are null, something is wrong");return{oldLine:R,newLine:T}})();if(x!=null&&(b++,m++),N!=null&&(y++,p++),d)this.pushLineWithAnnotation({oldLine:x,newLine:N,unifiedAST:l,unifiedSpan:this.getAnnotations("unified",x!=null?m:void 0,N!=null?p:void 0,n,a)}),a++;else{(x==null||N==null)&&_++;const R=this.getAnnotations("split",x!=null?m:void 0,N!=null?p:void 0,n,a);R!=null&&_>0&&(k>E?s.push(eb(_)):A.push(eb(_)),_=0),this.pushLineWithAnnotation({newLine:N,oldLine:x,deletionsAST:s,additionsAST:A,...R}),a++}}d||(_>0&&(k>E?s.push(eb(_)):A.push(eb(_)),_=0),w.noEOFCRDeletions&&(s.push(a9("change-deletion")),w.noEOFCRAdditions||A.push(eb(1))),w.noEOFCRAdditions&&(A.push(a9("change-addition")),w.noEOFCRDeletions||s.push(eb(1))))}return r&&o.newLines!=null&&o.newLines.length>0&&this.renderCollapsedHunks({additionLineNumber:p,additionsAST:A,ast:o,deletionLineNumber:m,deletionsAST:s,hunkData:e,hunkIndex:n+1,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,lineIndex:a,rangeSize:Math.max(o.newLines.length-Math.max(t.additionStart+t.additionCount-1,0),0),unifiedAST:l}),a}pushLineWithAnnotation({newLine:t,oldLine:e,unifiedAST:n,additionsAST:a,deletionsAST:r,unifiedSpan:i,deletionSpan:o,additionSpan:s}){n!=null?(e!=null?n.push(e):t!=null&&n.push(t),i!=null&&n.push(t9(i))):r!=null&&a!=null&&(e!=null&&r.push(e),t!=null&&a.push(t),o!=null&&r.push(t9(o)),s!=null&&a.push(t9(s)))}getAnnotations(t,e,n,a,r){const i={type:"annotation",hunkIndex:a,lineIndex:r,annotations:[]};if(e!=null)for(const s of this.deletionAnnotations[e]??[])i.annotations.push(dD(s));const o={type:"annotation",hunkIndex:a,lineIndex:r,annotations:[]};if(n!=null)for(const s of this.additionAnnotations[n]??[])(t==="unified"?i:o).annotations.push(dD(s));if(t==="unified")return i.annotations.length>0?i:void 0;if(!(o.annotations.length===0&&i.annotations.length===0))return{deletionSpan:i,additionSpan:o}}renderHeader(t,e,n){const{themeType:a}=this.getOptionsWithDefaults();return Int({fileOrDiff:t,themeStyles:e,themeType:n??a})}};function o9(t,e){return eZ(t.theme,e.theme)&&t.tokenizeMaxLineLength===e.tokenizeMaxLineLength&&t.lineDiffType===e.lineDiffType}function Wnt(t){return`${t} unmodified line${t>1?"s":""}`}function Vnt(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===""?`
1321
+ `:n,type:e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}}function Jnt(t,e){const n=FT.test(t),a=t.split(n?FT:oie);let r;const i=[];let o;for(const s of a){if(n&&!FT.test(s)){r==null?r=s:console.error("parsePatchContent: unknown file blob:",s);continue}else if(!n&&!oie.test(s)){r==null?r=s:console.error("parsePatchContent: unknown file blob:",s);continue}let A=0;const l=s.split(ZWe);o=void 0;for(const u of l){const d=u.split(f$),p=d.shift();if(p==null){console.error("parsePatchContent: invalid hunk",u);continue}const m=p.match(WWe),g=[];let h=0,b=0;if(m==null||o==null){if(o!=null){console.error("parsePatchContent: Invalid hunk",u);continue}o={name:"",prevName:void 0,type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,cacheKey:void 0},d.unshift(p);for(const w of d){const E=w.match(n?JWe:VWe);if(w.startsWith("diff --git")){const[,,k,,v]=w.trim().match(XWe)??[];o.name=v.trim(),k!==v&&(o.prevName=k.trim())}else if(E!=null){const[,k,v]=E;k==="---"&&v!=="/dev/null"?(o.prevName=v.trim(),o.name=v.trim()):k==="+++"&&v!=="/dev/null"&&(o.name=v.trim())}else if(n){if(w.startsWith("new mode ")&&(o.mode=w.replace("new mode","").trim()),w.startsWith("old mode ")&&(o.oldMode=w.replace("old mode","").trim()),w.startsWith("new file mode")&&(o.type="new",o.mode=w.replace("new file mode","").trim()),w.startsWith("deleted file mode")&&(o.type="deleted",o.mode=w.replace("deleted file mode","").trim()),w.startsWith("similarity index")&&(w.startsWith("similarity index 100%")?o.type="rename-pure":o.type="rename-changed"),w.startsWith("index ")){const[,k]=w.trim().match(eVe)??[];k!=null&&(o.mode=k)}w.startsWith("rename from ")&&(o.prevName=w.replace("rename from ","")),w.startsWith("rename to ")&&(o.name=w.replace("rename to ","").trim())}}continue}else{let w,E;for(;d.length>0&&(d[d.length-1]===`
1322
+ `||d[d.length-1]==="");)d.pop();for(const k of d){const v=Vnt(k);if(v==null)continue;const{type:_,line:I}=v;if(_==="addition")(w==null||w.type!=="change")&&(w=s9("change"),g.push(w)),w.additions.push(I),h++,E="addition";else if(_==="deletion")(w==null||w.type!=="change")&&(w=s9("change"),g.push(w)),w.deletions.push(I),b++,E="deletion";else if(_==="context")(w==null||w.type!=="context")&&(w=s9("context"),g.push(w)),w.lines.push(I),E="context";else if(_==="metadata"&&w!=null){if(w.type==="context")w.noEOFCR=!0;else if(E==="deletion"){w.noEOFCRDeletions=!0;const x=w.deletions.length-1;x>=0&&(w.deletions[x]=Wf(w.deletions[x]))}else if(E==="addition"){w.noEOFCRAdditions=!0;const x=w.additions.length-1;x>=0&&(w.additions[x]=Wf(w.additions[x]))}}}}const y={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(m[4]??"1"),additionStart:parseInt(m[3]),additionLines:h,deletionCount:parseInt(m[2]??"1"),deletionStart:parseInt(m[1]),deletionLines:b,hunkContent:g,hunkContext:m[5],hunkSpecs:p};if(isNaN(y.additionCount)||isNaN(y.deletionCount)||isNaN(y.additionStart)||isNaN(y.deletionStart)){console.error("parsePatchContent: invalid hunk metadata",y);continue}y.collapsedBefore=Math.max(y.additionStart-1-A,0),o.hunks.push(y),A=y.additionStart+y.additionCount-1;for(const w of g)w.type==="context"?(y.splitLineCount+=w.lines.length,y.unifiedLineCount+=w.lines.length):(y.splitLineCount+=Math.max(w.additions.length,w.deletions.length),y.unifiedLineCount+=w.deletions.length+w.additions.length);y.splitLineStart=o.splitLineCount,y.unifiedLineStart=o.unifiedLineCount,o.splitLineCount+=y.splitLineCount,o.unifiedLineCount+=y.unifiedLineCount}o!=null&&(!n&&o.prevName!=null&&o.name!==o.prevName&&(o.hunks.length>0?o.type="rename-changed":o.type="rename-pure"),o.type!=="rename-pure"&&o.type!=="rename-changed"&&(o.prevName=void 0),i.push(o))}return{patchMetadata:r,files:i}}function Xnt(t,e){const n=[];for(const a of t.split(KWe))try{n.push(Jnt(a,e!=null?`${e}-${n.length}`:void 0))}catch(r){console.error(r)}return n}function s9(t){return t==="change"?{type:"change",additions:[],deletions:[],noEOFCRAdditions:!1,noEOFCRDeletions:!1}:{type:"context",lines:[],noEOFCR:!1}}function hoe(t,e,n){const a=Xnt(unt(t.name,e.name,t.contents,e.contents,t.header,e.header))[0]?.files[0];if(a==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return a.oldLines=t.contents.split(f$),a.newLines=e.contents.split(f$),t.cacheKey!=null&&e.cacheKey!=null&&(a.cacheKey=`${t.cacheKey}:${e.cacheKey}`),a}let eat=-1;var tat=class{static LoadedCustomComponent=qnt;__id=++eat;fileContainer;spriteSVG;pre;unsafeCSSStyle;hoverContent;headerElement;headerMetadata;customHunkElements=[];errorWrapper;hunksRenderer;resizeManager;scrollSyncManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];oldFile;newFile;fileDiff;constructor(e={theme:Vs},n,a=!1){this.options=e,this.workerManager=n,this.isContainerManaged=a,this.hunksRenderer=new Znt({...e,hunkSeparators:typeof e.hunkSeparators=="function"?"custom":e.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new knt,this.scrollSyncManager=new Hnt,this.mouseEventManager=new Bnt("diff",moe(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager=new wnt(poe(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};setOptions(e){e!=null&&(this.options=e,this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof e.hunkSeparators=="function"?"custom":e.hunkSeparators}),this.mouseEventManager.setOptions(moe(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager.setOptions(poe(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.hunksRenderer.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.mouseEventManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.lineSelectionManager.setSelection(e)}cleanUp(){this.hunksRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.fileDiff=void 0,this.oldFile=void 0,this.newFile=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.headerElement=void 0,this.errorWrapper=void 0}hydrate(e){const{fileContainer:n,prerenderedHTML:a}=e;Gnt(n,a);for(const r of Array.from(n.shadowRoot?.children??[])){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r;continue}if("diffsHeader"in r.dataset){this.headerElement=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute(VBe)){this.unsafeCSSStyle=r;continue}}}if(this.pre==null)this.render(e);else{const{lineAnnotations:r,oldFile:i,newFile:o,fileDiff:s}=e;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=r??this.lineAnnotations,this.newFile=o,this.oldFile=i,this.fileDiff=s??(i!=null&&o!=null?hoe(i,o):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&(this.resizeManager.setup(this.pre),this.scrollSyncManager.setup(this.pre))}}rerender(){this.fileDiff==null&&this.newFile==null&&this.oldFile==null||this.render({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff,forceRender:!0})}handleExpandHunk=(e,n)=>{this.expandHunk(e,n)};expandHunk(e,n){this.hunksRenderer.expandHunk(e,n),this.rerender()}render({oldFile:e,newFile:n,fileDiff:a,forceRender:r=!1,lineAnnotations:i,fileContainer:o,containerWrapper:s}){const A=e!=null&&n!=null&&(!foe(e,this.oldFile)||!foe(n,this.newFile)),l=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(!r&&!l&&(a!=null&&a===this.fileDiff||a==null&&!A)||(this.oldFile=e,this.newFile=n,a!=null?this.fileDiff=a:e!=null&&n!=null&&A&&(this.fileDiff=hoe(e,n)),i!=null&&this.setLineAnnotations(i),this.fileDiff==null))return;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators=="function"?"custom":this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:u=!1}=this.options;u&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),o=this.getOrCreateFileContainer(o,s);try{const d=this.hunksRenderer.renderDiff(this.fileDiff);if(d==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}d.headerElement!=null&&this.applyHeaderToDOM(d.headerElement,o);const p=this.getOrCreatePreNode(o);this.applyHunksToDOM(p,d),this.renderSeparators(d.hunkData),this.renderAnnotations(),this.renderHoverUtility()}catch(d){d instanceof Error&&this.applyErrorToDOM(d,o)}}renderSeparators(e){const{hunkSeparators:n}=this.options;if(!(this.isContainerManaged||this.fileContainer==null||typeof n!="function")){for(const a of this.customHunkElements)a.parentNode?.removeChild(a);this.customHunkElements.length=0;for(const a of e){const r=document.createElement("div");r.style.display="contents",r.slot=a.slotName,r.appendChild(n(a,this)),this.fileContainer.appendChild(r),this.customHunkElements.push(r)}}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const n of this.annotationElements)n.parentNode?.removeChild(n);this.annotationElements.length=0;const{renderAnnotation:e}=this.options;if(e!=null&&this.lineAnnotations.length>0)for(const n of this.lineAnnotations){const a=e(n);if(a==null)continue;const r=Fnt(dD(n));r.appendChild(a),this.annotationElements.push(r),this.fileContainer.appendChild(r)}}renderHoverUtility(){const{renderHoverUtility:e}=this.options;if(this.fileContainer==null||e==null)return;this.hoverContent==null&&(this.hoverContent=Tnt(),this.fileContainer.appendChild(this.hoverContent));const n=e(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",n!=null&&this.hoverContent.appendChild(n)}getOrCreateFileContainer(e,n){if(this.fileContainer=e??this.fileContainer??document.createElement(uD),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const a=document.createElement("div");a.innerHTML=Nnt;const r=a.firstChild;r instanceof SVGElement&&(this.spriteSVG=r,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){return this.pre==null?(this.pre=document.createElement("pre"),e.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==e&&e.shadowRoot?.appendChild(this.pre),this.pre}applyHeaderToDOM(e,n){this.cleanupErrorWrapper();const a=document.createElement("div");a.innerHTML=KE(e);const r=a.firstElementChild;if(!(r instanceof HTMLElement)||(this.headerElement!=null?n.shadowRoot?.replaceChild(r,this.headerElement):n.shadowRoot?.prepend(r),this.headerElement=r,this.isContainerManaged))return;const{renderHeaderMetadata:i}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const o=i?.({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff})??void 0;o!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=MK,o instanceof Element?this.headerMetadata.appendChild(o):this.headerMetadata.innerText=`${o}`,n.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:e}=this.options;e==null||e===""||(this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=Rnt(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Ont(e))}applyHunksToDOM(e,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,n),e.innerHTML="";let a,r;if(n.unifiedAST!=null){const i=n9({columnType:"unified"});i.innerHTML=this.hunksRenderer.renderPartialHTML(n.unifiedAST),e.appendChild(i)}else n.deletionsAST!=null&&(a=n9({columnType:"deletions"}),a.innerHTML=this.hunksRenderer.renderPartialHTML(n.deletionsAST),e.appendChild(a)),n.additionsAST!=null&&(r=n9({columnType:"additions"}),r.innerHTML=this.hunksRenderer.renderPartialHTML(n.additionsAST),e.appendChild(r));this.injectUnsafeCSS(),this.mouseEventManager.setup(e),this.lineSelectionManager.setup(e),(this.options.overflow??"scroll")==="scroll"?(this.resizeManager.setup(e),this.scrollSyncManager.setup(e,a,r)):(this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp())}applyPreNodeAttributes(e,{themeStyles:n,baseThemeType:a,additionsAST:r,deletionsAST:i,totalLines:o}){const{diffIndicators:s="bars",disableBackground:A=!1,disableLineNumbers:l=!1,overflow:u="scroll",themeType:d="system",diffStyle:p="split"}=this.options;Pnt({pre:e,diffIndicators:s,disableBackground:A,disableLineNumbers:l,overflow:u,split:p==="unified"?!1:r!=null&&i!=null,themeStyles:n,themeType:a??d,totalLines:o})}applyErrorToDOM(e,n){this.cleanupErrorWrapper();const a=this.getOrCreatePreNode(n);a.innerHTML="",a.parentNode?.removeChild(a),this.pre=void 0;const r=n.shadowRoot??n.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=e.message,this.errorWrapper.appendChild(i);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}};const nat=typeof window>"u"?K.useEffect:K.useLayoutEffect;function aat({oldFile:t,newFile:e,fileDiff:n,options:a,lineAnnotations:r,selectedLines:i,prerenderedHTML:o}){const s=K.useContext(nZ),A=K.useRef(null),l=ynt(u=>{if(u!=null){if(A.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");A.current=new tat(a,s,!0),A.current.hydrate({fileDiff:n,oldFile:t,newFile:e,fileContainer:u,lineAnnotations:r,prerenderedHTML:o})}else{if(A.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");A.current.cleanUp(),A.current=null}});return nat(()=>{if(A.current==null)return;const u=A.current,d=!$nt(u.options,a);u.setOptions(a),u.render({forceRender:d,fileDiff:n,oldFile:t,newFile:e,lineAnnotations:r}),i!==void 0&&u.setSelectedLines(i)}),{ref:l,getHoveredLine:K.useCallback(()=>A.current?.getHoveredLine(),[])}}function R5n({fileDiff:t,options:e,lineAnnotations:n,selectedLines:a,className:r,style:i,prerenderedHTML:o,renderAnnotation:s,renderHeaderMetadata:A,renderHoverUtility:l}){const{ref:u,getHoveredLine:d}=aat({fileDiff:t,options:e,lineAnnotations:n,selectedLines:a,prerenderedHTML:o});return be.jsx(uD,{ref:u,className:r,style:i,children:tVe(jnt({fileDiff:t,renderHeaderMetadata:A,renderAnnotation:s,lineAnnotations:n,renderHoverUtility:l,getHoveredLine:d}),o)})}function wve(t){const e=K.useRef({value:t,previous:t});return K.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var kS="Switch",[rat]=Cl(kS),[iat,oat]=rat(kS),Eve=K.forwardRef((t,e)=>{const{__scopeSwitch:n,name:a,checked:r,defaultChecked:i,required:o,disabled:s,value:A="on",onCheckedChange:l,form:u,...d}=t,[p,m]=K.useState(null),g=ca(e,E=>m(E)),h=K.useRef(!1),b=p?u||!!p.closest("form"):!0,[y,w]=Dm({prop:r,defaultProp:i??!1,onChange:l,caller:kS});return be.jsxs(iat,{scope:n,checked:y,disabled:s,children:[be.jsx(zn.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":Ive(y),"data-disabled":s?"":void 0,disabled:s,value:A,...d,ref:g,onClick:on(t.onClick,E=>{w(k=>!k),b&&(h.current=E.isPropagationStopped(),h.current||E.stopPropagation())})}),b&&be.jsx(vve,{control:p,bubbles:!h.current,name:a,value:A,checked:y,required:o,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Eve.displayName=kS;var Bve="SwitchThumb",kve=K.forwardRef((t,e)=>{const{__scopeSwitch:n,...a}=t,r=oat(Bve,n);return be.jsx(zn.span,{"data-state":Ive(r.checked),"data-disabled":r.disabled?"":void 0,...a,ref:e})});kve.displayName=Bve;var sat="SwitchBubbleInput",vve=K.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:a=!0,...r},i)=>{const o=K.useRef(null),s=ca(o,i),A=wve(n),l=Jwe(e);return K.useEffect(()=>{const u=o.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(A!==n&&m){const g=new Event("click",{bubbles:a});m.call(u,n),u.dispatchEvent(g)}},[A,n,a]),be.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:s,style:{...r.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});vve.displayName=sat;function Ive(t){return t?"checked":"unchecked"}var M5n=Eve,L5n=kve;function Aat(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const cat=t=>{switch(t){case"success":return dat;case"info":return mat;case"warning":return pat;case"error":return gat;default:return null}},lat=Array(12).fill(0),uat=({visible:t,className:e})=>Ce.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Ce.createElement("div",{className:"sonner-spinner"},lat.map((n,a)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),dat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),pat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),mat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),gat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),fat=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),hat=()=>{const[t,e]=Ce.useState(document.hidden);return Ce.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let q$=1;class bat{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:a,...r}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:q$++,o=this.toasts.find(A=>A.id===i),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(A=>A.id===i?(this.publish({...A,...e,id:i,title:a}),{...A,...e,id:i,dismissible:s,title:a}):A):this.addToast({title:a,...r,dismissible:s,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let a;n.loading!==void 0&&(a=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let i=a!==void 0,o;const s=r.then(async l=>{if(o=["resolve",l],Ce.isValidElement(l))i=!1,this.create({id:a,type:"default",message:l});else if(Cat(l)&&!l.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,g=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:p,...g})}else if(l instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(l):n.error,p=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:p,...g})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(l):n.success,p=typeof n.description=="function"?await n.description(l):n.description,g=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:a,type:"success",description:p,...g})}}).catch(async l=>{if(o=["reject",l],n.error!==void 0){i=!1;const u=typeof n.error=="function"?await n.error(l):n.error,d=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!Ce.isValidElement(u)?u:{message:u};this.create({id:a,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),A=()=>new Promise((l,u)=>s.then(()=>o[0]==="reject"?u(o[1]):l(o[1])).catch(u));return typeof a!="string"&&typeof a!="number"?{unwrap:A}:Object.assign(a,{unwrap:A})},this.custom=(e,n)=>{const a=n?.id||q$++;return this.create({jsx:e(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const js=new bat,yat=(t,e)=>{const n=e?.id||q$++;return js.addToast({title:t,...e,id:n}),n},Cat=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",wat=yat,Eat=()=>js.toasts,Bat=()=>js.getActiveToasts(),kat=Object.assign(wat,{success:js.success,info:js.info,warning:js.warning,error:js.error,custom:js.custom,message:js.message,promise:js.promise,dismiss:js.dismiss,loading:js.loading},{getHistory:Eat,getToasts:Bat});Aat("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function KQ(t){return t.label!==void 0}const vat=3,Iat="24px",Qat="16px",boe=4e3,_at=356,xat=14,Dat=45,Sat=200;function Nl(...t){return t.filter(Boolean).join(" ")}function Nat(t){const[e,n]=t.split("-"),a=[];return e&&a.push(e),n&&a.push(n),a}const Fat=t=>{var e,n,a,r,i,o,s,A,l;const{invert:u,toast:d,unstyled:p,interacting:m,setHeights:g,visibleToasts:h,heights:b,index:y,toasts:w,expanded:E,removeToast:k,defaultRichColors:v,closeButton:_,style:I,cancelButtonStyle:x,actionButtonStyle:N,className:R="",descriptionClassName:T="",duration:O,position:$,gap:F,expandByDefault:L,classNames:M,icons:P,closeButtonAriaLabel:D="Close toast"}=t,[q,U]=Ce.useState(null),[G,H]=Ce.useState(null),[j,Z]=Ce.useState(!1),[J,ae]=Ce.useState(!1),[ee,pe]=Ce.useState(!1),[ie,re]=Ce.useState(!1),[ne,te]=Ce.useState(!1),[le,Ae]=Ce.useState(0),[Be,de]=Ce.useState(0),Ge=Ce.useRef(d.duration||O||boe),oe=Ce.useRef(null),Je=Ce.useRef(null),Ee=y===0,st=y+1<=h,nt=d.type,lt=d.dismissible!==!1,Me=d.className||"",tt=d.descriptionClassName||"",ye=Ce.useMemo(()=>b.findIndex(He=>He.toastId===d.id)||0,[b,d.id]),De=Ce.useMemo(()=>{var He;return(He=d.closeButton)!=null?He:_},[d.closeButton,_]),qe=Ce.useMemo(()=>d.duration||O||boe,[d.duration,O]),ke=Ce.useRef(0),$e=Ce.useRef(0),ue=Ce.useRef(0),we=Ce.useRef(null),[W,he]=$.split("-"),me=Ce.useMemo(()=>b.reduce((He,at,ze)=>ze>=ye?He:He+at.height,0),[b,ye]),Qe=hat(),xe=d.invert||u,Te=nt==="loading";$e.current=Ce.useMemo(()=>ye*F+me,[ye,me]),Ce.useEffect(()=>{Ge.current=qe},[qe]),Ce.useEffect(()=>{Z(!0)},[]),Ce.useEffect(()=>{const He=Je.current;if(He){const at=He.getBoundingClientRect().height;return de(at),g(ze=>[{toastId:d.id,height:at,position:d.position},...ze]),()=>g(ze=>ze.filter(Ve=>Ve.toastId!==d.id))}},[g,d.id]),Ce.useLayoutEffect(()=>{if(!j)return;const He=Je.current,at=He.style.height;He.style.height="auto";const ze=He.getBoundingClientRect().height;He.style.height=at,de(ze),g(Ve=>Ve.find(it=>it.toastId===d.id)?Ve.map(it=>it.toastId===d.id?{...it,height:ze}:it):[{toastId:d.id,height:ze,position:d.position},...Ve])},[j,d.title,d.description,g,d.id,d.jsx,d.action,d.cancel]);const Oe=Ce.useCallback(()=>{ae(!0),Ae($e.current),g(He=>He.filter(at=>at.toastId!==d.id)),setTimeout(()=>{k(d)},Sat)},[d,k,g,$e]);Ce.useEffect(()=>{if(d.promise&&nt==="loading"||d.duration===1/0||d.type==="loading")return;let He;return E||m||Qe?(()=>{if(ue.current<ke.current){const Ve=new Date().getTime()-ke.current;Ge.current=Ge.current-Ve}ue.current=new Date().getTime()})():Ge.current!==1/0&&(ke.current=new Date().getTime(),He=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Oe()},Ge.current)),()=>clearTimeout(He)},[E,m,d,nt,Qe,Oe]),Ce.useEffect(()=>{d.delete&&(Oe(),d.onDismiss==null||d.onDismiss.call(d,d))},[Oe,d.delete]);function Le(){var He;if(P?.loading){var at;return Ce.createElement("div",{className:Nl(M?.loader,d==null||(at=d.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":nt==="loading"},P.loading)}return Ce.createElement(uat,{className:Nl(M?.loader,d==null||(He=d.classNames)==null?void 0:He.loader),visible:nt==="loading"})}const Xe=d.icon||P?.[nt]||cat(nt);var yt,ht;return Ce.createElement("li",{tabIndex:0,ref:Je,className:Nl(R,Me,M?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,M?.default,M?.[nt],d==null||(n=d.classNames)==null?void 0:n[nt]),"data-sonner-toast":"","data-rich-colors":(yt=d.richColors)!=null?yt:v,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":j,"data-promise":!!d.promise,"data-swiped":ne,"data-removed":J,"data-visible":st,"data-y-position":W,"data-x-position":he,"data-index":y,"data-front":Ee,"data-swiping":ee,"data-dismissible":lt,"data-type":nt,"data-invert":xe,"data-swipe-out":ie,"data-swipe-direction":G,"data-expanded":!!(E||L&&j),"data-testid":d.testId,style:{"--index":y,"--toasts-before":y,"--z-index":w.length-y,"--offset":`${J?le:$e.current}px`,"--initial-height":L?"auto":`${Be}px`,...I,...d.style},onDragEnd:()=>{pe(!1),U(null),we.current=null},onPointerDown:He=>{He.button!==2&&(Te||!lt||(oe.current=new Date,Ae($e.current),He.target.setPointerCapture(He.pointerId),He.target.tagName!=="BUTTON"&&(pe(!0),we.current={x:He.clientX,y:He.clientY})))},onPointerUp:()=>{var He,at,ze;if(ie||!lt)return;we.current=null;const Ve=Number(((He=Je.current)==null?void 0:He.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),bt=Number(((at=Je.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),it=new Date().getTime()-((ze=oe.current)==null?void 0:ze.getTime()),We=q==="x"?Ve:bt,_t=Math.abs(We)/it;if(Math.abs(We)>=Dat||_t>.11){Ae($e.current),d.onDismiss==null||d.onDismiss.call(d,d),H(q==="x"?Ve>0?"right":"left":bt>0?"down":"up"),Oe(),re(!0);return}else{var ct,wt;(ct=Je.current)==null||ct.style.setProperty("--swipe-amount-x","0px"),(wt=Je.current)==null||wt.style.setProperty("--swipe-amount-y","0px")}te(!1),pe(!1),U(null)},onPointerMove:He=>{var at,ze,Ve;if(!we.current||!lt||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;const it=He.clientY-we.current.y,We=He.clientX-we.current.x;var _t;const ct=(_t=t.swipeDirections)!=null?_t:Nat($);!q&&(Math.abs(We)>1||Math.abs(it)>1)&&U(Math.abs(We)>Math.abs(it)?"x":"y");let wt={x:0,y:0};const Nt=kt=>1/(1.5+Math.abs(kt)/20);if(q==="y"){if(ct.includes("top")||ct.includes("bottom"))if(ct.includes("top")&&it<0||ct.includes("bottom")&&it>0)wt.y=it;else{const kt=it*Nt(it);wt.y=Math.abs(kt)<Math.abs(it)?kt:it}}else if(q==="x"&&(ct.includes("left")||ct.includes("right")))if(ct.includes("left")&&We<0||ct.includes("right")&&We>0)wt.x=We;else{const kt=We*Nt(We);wt.x=Math.abs(kt)<Math.abs(We)?kt:We}(Math.abs(wt.x)>0||Math.abs(wt.y)>0)&&te(!0),(ze=Je.current)==null||ze.style.setProperty("--swipe-amount-x",`${wt.x}px`),(Ve=Je.current)==null||Ve.style.setProperty("--swipe-amount-y",`${wt.y}px`)}},De&&!d.jsx&&nt!=="loading"?Ce.createElement("button",{"aria-label":D,"data-disabled":Te,"data-close-button":!0,onClick:Te||!lt?()=>{}:()=>{Oe(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Nl(M?.closeButton,d==null||(a=d.classNames)==null?void 0:a.closeButton)},(ht=P?.close)!=null?ht:fat):null,(nt||d.icon||d.promise)&&d.icon!==null&&(P?.[nt]!==null||d.icon)?Ce.createElement("div",{"data-icon":"",className:Nl(M?.icon,d==null||(r=d.classNames)==null?void 0:r.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Le():null,d.type!=="loading"?Xe:null):null,Ce.createElement("div",{"data-content":"",className:Nl(M?.content,d==null||(i=d.classNames)==null?void 0:i.content)},Ce.createElement("div",{"data-title":"",className:Nl(M?.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Ce.createElement("div",{"data-description":"",className:Nl(T,tt,M?.description,d==null||(s=d.classNames)==null?void 0:s.description)},typeof d.description=="function"?d.description():d.description):null),Ce.isValidElement(d.cancel)?d.cancel:d.cancel&&KQ(d.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||x,onClick:He=>{KQ(d.cancel)&&lt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,He),Oe())},className:Nl(M?.cancelButton,d==null||(A=d.classNames)==null?void 0:A.cancelButton)},d.cancel.label):null,Ce.isValidElement(d.action)?d.action:d.action&&KQ(d.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||N,onClick:He=>{KQ(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,He),!He.defaultPrevented&&Oe())},className:Nl(M?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function yoe(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Tat(t,e){const n={};return[t,e].forEach((a,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",s=i?Qat:Iat;function A(l){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof l=="number"?`${l}px`:l})}typeof a=="number"||typeof a=="string"?A(a):typeof a=="object"?["top","right","bottom","left"].forEach(l=>{a[l]===void 0?n[`${o}-${l}`]=s:n[`${o}-${l}`]=typeof a[l]=="number"?`${a[l]}px`:a[l]}):A(s)}),n}const Rat=Ce.forwardRef(function(e,n){const{id:a,invert:r,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:A,className:l,offset:u,mobileOffset:d,theme:p="light",richColors:m,duration:g,style:h,visibleToasts:b=vat,toastOptions:y,dir:w=yoe(),gap:E=xat,icons:k,containerAriaLabel:v="Notifications"}=e,[_,I]=Ce.useState([]),x=Ce.useMemo(()=>a?_.filter(j=>j.toasterId===a):_.filter(j=>!j.toasterId),[_,a]),N=Ce.useMemo(()=>Array.from(new Set([i].concat(x.filter(j=>j.position).map(j=>j.position)))),[x,i]),[R,T]=Ce.useState([]),[O,$]=Ce.useState(!1),[F,L]=Ce.useState(!1),[M,P]=Ce.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=Ce.useRef(null),q=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=Ce.useRef(null),G=Ce.useRef(!1),H=Ce.useCallback(j=>{I(Z=>{var J;return(J=Z.find(ae=>ae.id===j.id))!=null&&J.delete||js.dismiss(j.id),Z.filter(({id:ae})=>ae!==j.id)})},[]);return Ce.useEffect(()=>js.subscribe(j=>{if(j.dismiss){requestAnimationFrame(()=>{I(Z=>Z.map(J=>J.id===j.id?{...J,delete:!0}:J))});return}setTimeout(()=>{Rwe.flushSync(()=>{I(Z=>{const J=Z.findIndex(ae=>ae.id===j.id);return J!==-1?[...Z.slice(0,J),{...Z[J],...j},...Z.slice(J+1)]:[j,...Z]})})})}),[_]),Ce.useEffect(()=>{if(p!=="system"){P(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;const j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:Z})=>{P(Z?"dark":"light")})}catch{j.addListener(({matches:J})=>{try{P(J?"dark":"light")}catch(ae){console.error(ae)}})}},[p]),Ce.useEffect(()=>{_.length<=1&&$(!1)},[_]),Ce.useEffect(()=>{const j=Z=>{var J;if(o.every(pe=>Z[pe]||Z.code===pe)){var ee;$(!0),(ee=D.current)==null||ee.focus()}Z.code==="Escape"&&(document.activeElement===D.current||(J=D.current)!=null&&J.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[o]),Ce.useEffect(()=>{if(D.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,G.current=!1)}},[D.current]),Ce.createElement("section",{ref:n,"aria-label":`${v} ${q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((j,Z)=>{var J;const[ae,ee]=j.split("-");return x.length?Ce.createElement("ol",{key:j,dir:w==="auto"?yoe():w,tabIndex:-1,ref:D,className:l,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ae,"data-x-position":ee,style:{"--front-toast-height":`${((J=R[0])==null?void 0:J.height)||0}px`,"--width":`${_at}px`,"--gap":`${E}px`,...h,...Tat(u,d)},onBlur:pe=>{G.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(G.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||G.current||(G.current=!0,U.current=pe.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{F||$(!1)},onDragEnd:()=>$(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},x.filter(pe=>!pe.position&&Z===0||pe.position===j).map((pe,ie)=>{var re,ne;return Ce.createElement(Fat,{key:pe.id,icons:k,index:ie,toast:pe,defaultRichColors:m,duration:(re=y?.duration)!=null?re:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:r,visibleToasts:b,closeButton:(ne=y?.closeButton)!=null?ne:A,interacting:F,position:j,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:H,toasts:x.filter(te=>te.position==pe.position),heights:R.filter(te=>te.position==pe.position),setHeights:T,expandByDefault:s,gap:E,expanded:O,swipeDirections:e.swipeDirections})})):null}))}),O5n=Object.freeze(Object.defineProperty({__proto__:null,Toaster:Rat,toast:kat},Symbol.toStringTag,{value:"Module"}));var vS="Dialog",[Qve]=Cl(vS),[Mat,wl]=Qve(vS),_ve=t=>{const{__scopeDialog:e,children:n,open:a,defaultOpen:r,onOpenChange:i,modal:o=!0}=t,s=K.useRef(null),A=K.useRef(null),[l,u]=Dm({prop:a,defaultProp:r??!1,onChange:i,caller:vS});return be.jsx(Mat,{scope:e,triggerRef:s,contentRef:A,contentId:xo(),titleId:xo(),descriptionId:xo(),open:l,onOpenChange:u,onOpenToggle:K.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};_ve.displayName=vS;var xve="DialogTrigger",Lat=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(xve,n),i=ca(e,r.triggerRef);return be.jsx(zn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":iZ(r.open),...a,ref:i,onClick:on(t.onClick,r.onOpenToggle)})});Lat.displayName=xve;var aZ="DialogPortal",[Oat,Dve]=Qve(aZ,{forceMount:void 0}),Sve=t=>{const{__scopeDialog:e,forceMount:n,children:a,container:r}=t,i=wl(aZ,e);return be.jsx(Oat,{scope:e,forceMount:n,children:K.Children.map(a,o=>be.jsx(vs,{present:n||i.open,children:be.jsx(Xk,{asChild:!0,container:r,children:o})}))})};Sve.displayName=aZ;var QD="DialogOverlay",Nve=K.forwardRef((t,e)=>{const n=Dve(QD,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=wl(QD,t.__scopeDialog);return i.modal?be.jsx(vs,{present:a||i.open,children:be.jsx(Pat,{...r,ref:e})}):null});Nve.displayName=QD;var Gat=C2("DialogOverlay.RemoveScroll"),Pat=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(QD,n);return be.jsx(lS,{as:Gat,allowPinchZoom:!0,shards:[r.contentRef],children:be.jsx(zn.div,{"data-state":iZ(r.open),...a,ref:e,style:{pointerEvents:"auto",...a.style}})})}),Vf="DialogContent",Fve=K.forwardRef((t,e)=>{const n=Dve(Vf,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=wl(Vf,t.__scopeDialog);return be.jsx(vs,{present:a||i.open,children:i.modal?be.jsx(qat,{...r,ref:e}):be.jsx(Uat,{...r,ref:e})})});Fve.displayName=Vf;var qat=K.forwardRef((t,e)=>{const n=wl(Vf,t.__scopeDialog),a=K.useRef(null),r=ca(e,n.contentRef,a);return K.useEffect(()=>{const i=a.current;if(i)return vK(i)},[]),be.jsx(Tve,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:on(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:on(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:on(t.onFocusOutside,i=>i.preventDefault())})}),Uat=K.forwardRef((t,e)=>{const n=wl(Vf,t.__scopeDialog),a=K.useRef(!1),r=K.useRef(!1);return be.jsx(Tve,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(a.current||n.triggerRef.current?.focus(),i.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(a.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),Tve=K.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=t,s=wl(Vf,n),A=K.useRef(null),l=ca(e,A);return kK(),be.jsxs(be.Fragment,{children:[be.jsx(AS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:i,children:be.jsx(Vk,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":iZ(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),be.jsxs(be.Fragment,{children:[be.jsx($at,{titleId:s.titleId}),be.jsx(Hat,{contentRef:A,descriptionId:s.descriptionId})]})]})}),rZ="DialogTitle",Rve=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(rZ,n);return be.jsx(zn.h2,{id:r.titleId,...a,ref:e})});Rve.displayName=rZ;var Mve="DialogDescription",Lve=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(Mve,n);return be.jsx(zn.p,{id:r.descriptionId,...a,ref:e})});Lve.displayName=Mve;var Ove="DialogClose",Gve=K.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=wl(Ove,n);return be.jsx(zn.button,{type:"button",...a,ref:e,onClick:on(t.onClick,()=>r.onOpenChange(!1))})});Gve.displayName=Ove;function iZ(t){return t?"open":"closed"}var Pve="DialogTitleWarning",[G5n,qve]=G$e(Pve,{contentName:Vf,titleName:rZ,docsSlug:"dialog"}),$at=({titleId:t})=>{const e=qve(Pve),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
1322
1323
 
1323
1324
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
1324
1325
 
1325
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return K.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Gat="DialogDescriptionWarning",Pat=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gve(Gat).contentName}}.`;return K.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},qat=Ive,Uat=xve,$at=Dve,jat=Sve,G5n=Fve,P5n=Rve,q5n=Lve,Coe=1,Hat=.9,zat=.8,Yat=.17,A9=.1,c9=.999,Kat=.9999,Zat=.99,Wat=/[\\\/_+.#"@\[\(\{&]/,Vat=/[\\\/_+.#"@\[\(\{&]/g,Jat=/[\s-]/,Pve=/[\s-]/g;function U$(t,e,n,a,r,i,o){if(i===e.length)return r===t.length?Coe:Zat;var s=`${r},${i}`;if(o[s]!==void 0)return o[s];for(var A=a.charAt(i),l=n.indexOf(A,r),u=0,d,p,m,g;l>=0;)d=U$(t,e,n,a,l+1,i+1,o),d>u&&(l===r?d*=Coe:Wat.test(t.charAt(l-1))?(d*=zat,m=t.slice(r,l-1).match(Vat),m&&r>0&&(d*=Math.pow(c9,m.length))):Jat.test(t.charAt(l-1))?(d*=Hat,g=t.slice(r,l-1).match(Pve),g&&r>0&&(d*=Math.pow(c9,g.length))):(d*=Yat,r>0&&(d*=Math.pow(c9,l-r))),t.charAt(l)!==e.charAt(i)&&(d*=Kat)),(d<A9&&n.charAt(l-1)===a.charAt(i+1)||a.charAt(i+1)===a.charAt(i)&&n.charAt(l-1)!==a.charAt(i))&&(p=U$(t,e,n,a,l+1,i+2,o),p*A9>d&&(d=p*A9)),d>u&&(u=d),l=n.indexOf(A,l+1);return o[s]=u,u}function woe(t){return t.toLowerCase().replace(Pve," ")}function Xat(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,U$(t,e,woe(t),woe(e),0,0,{})}var ert=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ig=ert.reduce((t,e)=>{const n=KBe(`Primitive.${e}`),a=K.forwardRef((r,i)=>{const{asChild:o,...s}=r,A=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),be.jsx(A,{...s,ref:i})});return a.displayName=`Primitive.${e}`,{...t,[e]:a}},{}),XC='[cmdk-group=""]',l9='[cmdk-group-items=""]',trt='[cmdk-group-heading=""]',qve='[cmdk-item=""]',Eoe=`${qve}:not([aria-disabled="true"])`,$$="cmdk-item-select",Eb="data-value",nrt=(t,e,n)=>Xat(t,e,n),Uve=K.createContext(void 0),cv=()=>K.useContext(Uve),$ve=K.createContext(void 0),aZ=()=>K.useContext($ve),jve=K.createContext(void 0),Hve=K.forwardRef((t,e)=>{let n=Bb(()=>{var H,j;return{search:"",value:(j=(H=t.value)!=null?H:t.defaultValue)!=null?j:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=Bb(()=>new Set),r=Bb(()=>new Map),i=Bb(()=>new Map),o=Bb(()=>new Set),s=zve(t),{label:A,children:l,value:u,onValueChange:d,filter:p,shouldFilter:m,loop:g,disablePointerSelection:h=!1,vimBindings:b=!0,...y}=t,w=xo(),E=xo(),k=xo(),v=K.useRef(null),_=prt();Jf(()=>{if(u!==void 0){let H=u.trim();n.current.value=H,I.emit()}},[u]),Jf(()=>{_(6,$)},[]);let I=K.useMemo(()=>({subscribe:H=>(o.current.add(H),()=>o.current.delete(H)),snapshot:()=>n.current,setState:(H,j,Z)=>{var J,ae,ee,pe;if(!Object.is(n.current[H],j)){if(n.current[H]=j,H==="search")O(),R(),_(1,T);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(k);ie?ie.focus():(J=document.getElementById(w))==null||J.focus()}if(_(7,()=>{var ie;n.current.selectedItemId=(ie=F())==null?void 0:ie.id,I.emit()}),Z||_(5,$),((ae=s.current)==null?void 0:ae.value)!==void 0){let ie=j??"";(pe=(ee=s.current).onValueChange)==null||pe.call(ee,ie);return}}I.emit()}},emit:()=>{o.current.forEach(H=>H())}}),[]),x=K.useMemo(()=>({value:(H,j,Z)=>{var J;j!==((J=i.current.get(H))==null?void 0:J.value)&&(i.current.set(H,{value:j,keywords:Z}),n.current.filtered.items.set(H,N(j,Z)),_(2,()=>{R(),I.emit()}))},item:(H,j)=>(a.current.add(H),j&&(r.current.has(j)?r.current.get(j).add(H):r.current.set(j,new Set([H]))),_(3,()=>{O(),R(),n.current.value||T(),I.emit()}),()=>{i.current.delete(H),a.current.delete(H),n.current.filtered.items.delete(H);let Z=F();_(4,()=>{O(),Z?.getAttribute("id")===H&&T(),I.emit()})}),group:H=>(r.current.has(H)||r.current.set(H,new Set),()=>{i.current.delete(H),r.current.delete(H)}),filter:()=>s.current.shouldFilter,label:A||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:w,inputId:k,labelId:E,listInnerRef:v}),[]);function N(H,j){var Z,J;let ae=(J=(Z=s.current)==null?void 0:Z.filter)!=null?J:nrt;return H?ae(H,n.current.search,j):0}function R(){if(!n.current.search||s.current.shouldFilter===!1)return;let H=n.current.filtered.items,j=[];n.current.filtered.groups.forEach(J=>{let ae=r.current.get(J),ee=0;ae.forEach(pe=>{let ie=H.get(pe);ee=Math.max(ie,ee)}),j.push([J,ee])});let Z=v.current;L().sort((J,ae)=>{var ee,pe;let ie=J.getAttribute("id"),re=ae.getAttribute("id");return((ee=H.get(re))!=null?ee:0)-((pe=H.get(ie))!=null?pe:0)}).forEach(J=>{let ae=J.closest(l9);ae?ae.appendChild(J.parentElement===ae?J:J.closest(`${l9} > *`)):Z.appendChild(J.parentElement===Z?J:J.closest(`${l9} > *`))}),j.sort((J,ae)=>ae[1]-J[1]).forEach(J=>{var ae;let ee=(ae=v.current)==null?void 0:ae.querySelector(`${XC}[${Eb}="${encodeURIComponent(J[0])}"]`);ee?.parentElement.appendChild(ee)})}function T(){let H=L().find(Z=>Z.getAttribute("aria-disabled")!=="true"),j=H?.getAttribute(Eb);I.setState("value",j||void 0)}function O(){var H,j,Z,J;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ae=0;for(let ee of a.current){let pe=(j=(H=i.current.get(ee))==null?void 0:H.value)!=null?j:"",ie=(J=(Z=i.current.get(ee))==null?void 0:Z.keywords)!=null?J:[],re=N(pe,ie);n.current.filtered.items.set(ee,re),re>0&&ae++}for(let[ee,pe]of r.current)for(let ie of pe)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=ae}function $(){var H,j,Z;let J=F();J&&(((H=J.parentElement)==null?void 0:H.firstChild)===J&&((Z=(j=J.closest(XC))==null?void 0:j.querySelector(trt))==null||Z.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function F(){var H;return(H=v.current)==null?void 0:H.querySelector(`${qve}[aria-selected="true"]`)}function L(){var H;return Array.from(((H=v.current)==null?void 0:H.querySelectorAll(Eoe))||[])}function M(H){let j=L()[H];j&&I.setState("value",j.getAttribute(Eb))}function P(H){var j;let Z=F(),J=L(),ae=J.findIndex(pe=>pe===Z),ee=J[ae+H];(j=s.current)!=null&&j.loop&&(ee=ae+H<0?J[J.length-1]:ae+H===J.length?J[0]:J[ae+H]),ee&&I.setState("value",ee.getAttribute(Eb))}function D(H){let j=F(),Z=j?.closest(XC),J;for(;Z&&!J;)Z=H>0?urt(Z,XC):drt(Z,XC),J=Z?.querySelector(Eoe);J?I.setState("value",J.getAttribute(Eb)):P(H)}let q=()=>M(L().length-1),U=H=>{H.preventDefault(),H.metaKey?q():H.altKey?D(1):P(1)},G=H=>{H.preventDefault(),H.metaKey?M(0):H.altKey?D(-1):P(-1)};return K.createElement(ig.div,{ref:e,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:H=>{var j;(j=y.onKeyDown)==null||j.call(y,H);let Z=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||Z))switch(H.key){case"n":case"j":{b&&H.ctrlKey&&U(H);break}case"ArrowDown":{U(H);break}case"p":case"k":{b&&H.ctrlKey&&G(H);break}case"ArrowUp":{G(H);break}case"Home":{H.preventDefault(),M(0);break}case"End":{H.preventDefault(),q();break}case"Enter":{H.preventDefault();let J=F();if(J){let ae=new Event($$);J.dispatchEvent(ae)}}}}},K.createElement("label",{"cmdk-label":"",htmlFor:x.inputId,id:x.labelId,style:grt},A),vS(t,H=>K.createElement($ve.Provider,{value:I},K.createElement(Uve.Provider,{value:x},H))))}),art=K.forwardRef((t,e)=>{var n,a;let r=xo(),i=K.useRef(null),o=K.useContext(jve),s=cv(),A=zve(t),l=(a=(n=A.current)==null?void 0:n.forceMount)!=null?a:o?.forceMount;Jf(()=>{if(!l)return s.item(r,o?.id)},[l]);let u=Yve(r,i,[t.value,t.children,i],t.keywords),d=aZ(),p=Nm(_=>_.value&&_.value===u.current),m=Nm(_=>l||s.filter()===!1?!0:_.search?_.filtered.items.get(r)>0:!0);K.useEffect(()=>{let _=i.current;if(!(!_||t.disabled))return _.addEventListener($$,g),()=>_.removeEventListener($$,g)},[m,t.onSelect,t.disabled]);function g(){var _,I;h(),(I=(_=A.current).onSelect)==null||I.call(_,u.current)}function h(){d.setState("value",u.current,!0)}if(!m)return null;let{disabled:b,value:y,onSelect:w,forceMount:E,keywords:k,...v}=t;return K.createElement(ig.div,{ref:fu(i,e),...v,id:r,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!p,"data-disabled":!!b,"data-selected":!!p,onPointerMove:b||s.getDisablePointerSelection()?void 0:h,onClick:b?void 0:g},t.children)}),rrt=K.forwardRef((t,e)=>{let{heading:n,children:a,forceMount:r,...i}=t,o=xo(),s=K.useRef(null),A=K.useRef(null),l=xo(),u=cv(),d=Nm(m=>r||u.filter()===!1?!0:m.search?m.filtered.groups.has(o):!0);Jf(()=>u.group(o),[]),Yve(o,s,[t.value,t.heading,A]);let p=K.useMemo(()=>({id:o,forceMount:r}),[r]);return K.createElement(ig.div,{ref:fu(s,e),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&K.createElement("div",{ref:A,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),vS(t,m=>K.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},K.createElement(jve.Provider,{value:p},m))))}),irt=K.forwardRef((t,e)=>{let{alwaysRender:n,...a}=t,r=K.useRef(null),i=Nm(o=>!o.search);return!n&&!i?null:K.createElement(ig.div,{ref:fu(r,e),...a,"cmdk-separator":"",role:"separator"})}),ort=K.forwardRef((t,e)=>{let{onValueChange:n,...a}=t,r=t.value!=null,i=aZ(),o=Nm(l=>l.search),s=Nm(l=>l.selectedItemId),A=cv();return K.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),K.createElement(ig.input,{ref:e,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":A.listId,"aria-labelledby":A.labelId,"aria-activedescendant":s,id:A.inputId,type:"text",value:r?t.value:o,onChange:l=>{r||i.setState("search",l.target.value),n?.(l.target.value)}})}),srt=K.forwardRef((t,e)=>{let{children:n,label:a="Suggestions",...r}=t,i=K.useRef(null),o=K.useRef(null),s=Nm(l=>l.selectedItemId),A=cv();return K.useEffect(()=>{if(o.current&&i.current){let l=o.current,u=i.current,d,p=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let m=l.offsetHeight;u.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return p.observe(l),()=>{cancelAnimationFrame(d),p.unobserve(l)}}},[]),K.createElement(ig.div,{ref:fu(i,e),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":a,id:A.listId},vS(t,l=>K.createElement("div",{ref:fu(o,A.listInnerRef),"cmdk-list-sizer":""},l)))}),Art=K.forwardRef((t,e)=>{let{open:n,onOpenChange:a,overlayClassName:r,contentClassName:i,container:o,...s}=t;return K.createElement(qat,{open:n,onOpenChange:a},K.createElement(Uat,{container:o},K.createElement($at,{"cmdk-overlay":"",className:r}),K.createElement(jat,{"aria-label":t.label,"cmdk-dialog":"",className:i},K.createElement(Hve,{ref:e,...s}))))}),crt=K.forwardRef((t,e)=>Nm(n=>n.filtered.count===0)?K.createElement(ig.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),lrt=K.forwardRef((t,e)=>{let{progress:n,children:a,label:r="Loading...",...i}=t;return K.createElement(ig.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},vS(t,o=>K.createElement("div",{"aria-hidden":!0},o)))}),U5n=Object.assign(Hve,{List:srt,Item:art,Input:ort,Group:rrt,Separator:irt,Dialog:Art,Empty:crt,Loading:lrt});function urt(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function drt(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function zve(t){let e=K.useRef(t);return Jf(()=>{e.current=t}),e}var Jf=typeof window>"u"?K.useEffect:K.useLayoutEffect;function Bb(t){let e=K.useRef();return e.current===void 0&&(e.current=t()),e}function Nm(t){let e=aZ(),n=()=>t(e.snapshot());return K.useSyncExternalStore(e.subscribe,n,n)}function Yve(t,e,n,a=[]){let r=K.useRef(),i=cv();return Jf(()=>{var o;let s=(()=>{var l;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(l=u.current.textContent)==null?void 0:l.trim():r.current}})(),A=a.map(l=>l.trim());i.value(t,s,A),(o=e.current)==null||o.setAttribute(Eb,s),r.current=s}),r}var prt=()=>{let[t,e]=K.useState(),n=Bb(()=>new Map);return Jf(()=>{n.current.forEach(a=>a()),n.current=new Map},[t]),(a,r)=>{n.current.set(a,r),e({})}};function mrt(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function vS({asChild:t,children:e},n){return t&&K.isValidElement(e)?K.cloneElement(mrt(e),{ref:e.ref},n(e.props.children)):n(e)}var grt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function frt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return K.useMemo(()=>a=>{e.forEach(r=>r(a))},e)}const IS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function B1(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function rZ(t){return"nodeType"in t}function Qs(t){var e,n;return t?B1(t)?t:rZ(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function iZ(t){const{Document:e}=Qs(t);return t instanceof e}function lv(t){return B1(t)?!1:t instanceof Qs(t).HTMLElement}function Kve(t){return t instanceof Qs(t).SVGElement}function k1(t){return t?B1(t)?t.document:rZ(t)?iZ(t)?t:lv(t)||Kve(t)?t.ownerDocument:document:document:document}const pl=IS?K.useLayoutEffect:K.useEffect;function QS(t){const e=K.useRef(t);return pl(()=>{e.current=t}),K.useCallback(function(){for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return e.current==null?void 0:e.current(...a)},[])}function hrt(){const t=K.useRef(null),e=K.useCallback((a,r)=>{t.current=setInterval(a,r)},[]),n=K.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function PB(t,e){e===void 0&&(e=[t]);const n=K.useRef(t);return pl(()=>{n.current!==t&&(n.current=t)},e),n}function uv(t,e){const n=K.useRef();return K.useMemo(()=>{const a=t(n.current);return n.current=a,a},[...e])}function _D(t){const e=QS(t),n=K.useRef(null),a=K.useCallback(r=>{r!==n.current&&e?.(r,n.current),n.current=r},[]);return[n,a]}function xD(t){const e=K.useRef();return K.useEffect(()=>{e.current=t},[t]),e.current}let u9={};function dv(t,e){return K.useMemo(()=>{if(e)return e;const n=u9[t]==null?0:u9[t]+1;return u9[t]=n,t+"-"+n},[t,e])}function Zve(t){return function(e){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return a.reduce((i,o)=>{const s=Object.entries(o);for(const[A,l]of s){const u=i[A];u!=null&&(i[A]=u+t*l)}return i},{...e})}}const Xb=Zve(1),qB=Zve(-1);function brt(t){return"clientX"in t&&"clientY"in t}function _S(t){if(!t)return!1;const{KeyboardEvent:e}=Qs(t.target);return e&&t instanceof e}function yrt(t){if(!t)return!1;const{TouchEvent:e}=Qs(t.target);return e&&t instanceof e}function DD(t){if(yrt(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return brt(t)?{x:t.clientX,y:t.clientY}:null}const Xf=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Xf.Translate.toString(t),Xf.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:a}=t;return e+" "+n+"ms "+a}}}),Boe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Crt(t){return t.matches(Boe)?t:t.querySelector(Boe)}const wrt={display:"none"};function Ert(t){let{id:e,value:n}=t;return Ce.createElement("div",{id:e,style:wrt},n)}function Brt(t){let{id:e,announcement:n,ariaLiveType:a="assertive"}=t;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ce.createElement("div",{id:e,style:r,role:"status","aria-live":a,"aria-atomic":!0},n)}function krt(){const[t,e]=K.useState("");return{announce:K.useCallback(a=>{a!=null&&e(a)},[]),announcement:t}}const Wve=K.createContext(null);function vrt(t){const e=K.useContext(Wve);K.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Irt(){const[t]=K.useState(()=>new Set),e=K.useCallback(a=>(t.add(a),()=>t.delete(a)),[t]);return[K.useCallback(a=>{let{type:r,event:i}=a;t.forEach(o=>{var s;return(s=o[r])==null?void 0:s.call(o,i)})},[t]),e]}const Qrt={draggable:`
1326
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return K.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},jat="DialogDescriptionWarning",Hat=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qve(jat).contentName}}.`;return K.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},zat=_ve,Yat=Sve,Kat=Nve,Zat=Fve,P5n=Rve,q5n=Lve,U5n=Gve,Coe=1,Wat=.9,Vat=.8,Jat=.17,A9=.1,c9=.999,Xat=.9999,ert=.99,trt=/[\\\/_+.#"@\[\(\{&]/,nrt=/[\\\/_+.#"@\[\(\{&]/g,art=/[\s-]/,Uve=/[\s-]/g;function U$(t,e,n,a,r,i,o){if(i===e.length)return r===t.length?Coe:ert;var s=`${r},${i}`;if(o[s]!==void 0)return o[s];for(var A=a.charAt(i),l=n.indexOf(A,r),u=0,d,p,m,g;l>=0;)d=U$(t,e,n,a,l+1,i+1,o),d>u&&(l===r?d*=Coe:trt.test(t.charAt(l-1))?(d*=Vat,m=t.slice(r,l-1).match(nrt),m&&r>0&&(d*=Math.pow(c9,m.length))):art.test(t.charAt(l-1))?(d*=Wat,g=t.slice(r,l-1).match(Uve),g&&r>0&&(d*=Math.pow(c9,g.length))):(d*=Jat,r>0&&(d*=Math.pow(c9,l-r))),t.charAt(l)!==e.charAt(i)&&(d*=Xat)),(d<A9&&n.charAt(l-1)===a.charAt(i+1)||a.charAt(i+1)===a.charAt(i)&&n.charAt(l-1)!==a.charAt(i))&&(p=U$(t,e,n,a,l+1,i+2,o),p*A9>d&&(d=p*A9)),d>u&&(u=d),l=n.indexOf(A,l+1);return o[s]=u,u}function woe(t){return t.toLowerCase().replace(Uve," ")}function rrt(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,U$(t,e,woe(t),woe(e),0,0,{})}var irt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ig=irt.reduce((t,e)=>{const n=KBe(`Primitive.${e}`),a=K.forwardRef((r,i)=>{const{asChild:o,...s}=r,A=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),be.jsx(A,{...s,ref:i})});return a.displayName=`Primitive.${e}`,{...t,[e]:a}},{}),XC='[cmdk-group=""]',l9='[cmdk-group-items=""]',ort='[cmdk-group-heading=""]',$ve='[cmdk-item=""]',Eoe=`${$ve}:not([aria-disabled="true"])`,$$="cmdk-item-select",Eb="data-value",srt=(t,e,n)=>rrt(t,e,n),jve=K.createContext(void 0),cv=()=>K.useContext(jve),Hve=K.createContext(void 0),oZ=()=>K.useContext(Hve),zve=K.createContext(void 0),Yve=K.forwardRef((t,e)=>{let n=Bb(()=>{var H,j;return{search:"",value:(j=(H=t.value)!=null?H:t.defaultValue)!=null?j:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=Bb(()=>new Set),r=Bb(()=>new Map),i=Bb(()=>new Map),o=Bb(()=>new Set),s=Kve(t),{label:A,children:l,value:u,onValueChange:d,filter:p,shouldFilter:m,loop:g,disablePointerSelection:h=!1,vimBindings:b=!0,...y}=t,w=xo(),E=xo(),k=xo(),v=K.useRef(null),_=brt();Jf(()=>{if(u!==void 0){let H=u.trim();n.current.value=H,I.emit()}},[u]),Jf(()=>{_(6,$)},[]);let I=K.useMemo(()=>({subscribe:H=>(o.current.add(H),()=>o.current.delete(H)),snapshot:()=>n.current,setState:(H,j,Z)=>{var J,ae,ee,pe;if(!Object.is(n.current[H],j)){if(n.current[H]=j,H==="search")O(),R(),_(1,T);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(k);ie?ie.focus():(J=document.getElementById(w))==null||J.focus()}if(_(7,()=>{var ie;n.current.selectedItemId=(ie=F())==null?void 0:ie.id,I.emit()}),Z||_(5,$),((ae=s.current)==null?void 0:ae.value)!==void 0){let ie=j??"";(pe=(ee=s.current).onValueChange)==null||pe.call(ee,ie);return}}I.emit()}},emit:()=>{o.current.forEach(H=>H())}}),[]),x=K.useMemo(()=>({value:(H,j,Z)=>{var J;j!==((J=i.current.get(H))==null?void 0:J.value)&&(i.current.set(H,{value:j,keywords:Z}),n.current.filtered.items.set(H,N(j,Z)),_(2,()=>{R(),I.emit()}))},item:(H,j)=>(a.current.add(H),j&&(r.current.has(j)?r.current.get(j).add(H):r.current.set(j,new Set([H]))),_(3,()=>{O(),R(),n.current.value||T(),I.emit()}),()=>{i.current.delete(H),a.current.delete(H),n.current.filtered.items.delete(H);let Z=F();_(4,()=>{O(),Z?.getAttribute("id")===H&&T(),I.emit()})}),group:H=>(r.current.has(H)||r.current.set(H,new Set),()=>{i.current.delete(H),r.current.delete(H)}),filter:()=>s.current.shouldFilter,label:A||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:w,inputId:k,labelId:E,listInnerRef:v}),[]);function N(H,j){var Z,J;let ae=(J=(Z=s.current)==null?void 0:Z.filter)!=null?J:srt;return H?ae(H,n.current.search,j):0}function R(){if(!n.current.search||s.current.shouldFilter===!1)return;let H=n.current.filtered.items,j=[];n.current.filtered.groups.forEach(J=>{let ae=r.current.get(J),ee=0;ae.forEach(pe=>{let ie=H.get(pe);ee=Math.max(ie,ee)}),j.push([J,ee])});let Z=v.current;L().sort((J,ae)=>{var ee,pe;let ie=J.getAttribute("id"),re=ae.getAttribute("id");return((ee=H.get(re))!=null?ee:0)-((pe=H.get(ie))!=null?pe:0)}).forEach(J=>{let ae=J.closest(l9);ae?ae.appendChild(J.parentElement===ae?J:J.closest(`${l9} > *`)):Z.appendChild(J.parentElement===Z?J:J.closest(`${l9} > *`))}),j.sort((J,ae)=>ae[1]-J[1]).forEach(J=>{var ae;let ee=(ae=v.current)==null?void 0:ae.querySelector(`${XC}[${Eb}="${encodeURIComponent(J[0])}"]`);ee?.parentElement.appendChild(ee)})}function T(){let H=L().find(Z=>Z.getAttribute("aria-disabled")!=="true"),j=H?.getAttribute(Eb);I.setState("value",j||void 0)}function O(){var H,j,Z,J;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ae=0;for(let ee of a.current){let pe=(j=(H=i.current.get(ee))==null?void 0:H.value)!=null?j:"",ie=(J=(Z=i.current.get(ee))==null?void 0:Z.keywords)!=null?J:[],re=N(pe,ie);n.current.filtered.items.set(ee,re),re>0&&ae++}for(let[ee,pe]of r.current)for(let ie of pe)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=ae}function $(){var H,j,Z;let J=F();J&&(((H=J.parentElement)==null?void 0:H.firstChild)===J&&((Z=(j=J.closest(XC))==null?void 0:j.querySelector(ort))==null||Z.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function F(){var H;return(H=v.current)==null?void 0:H.querySelector(`${$ve}[aria-selected="true"]`)}function L(){var H;return Array.from(((H=v.current)==null?void 0:H.querySelectorAll(Eoe))||[])}function M(H){let j=L()[H];j&&I.setState("value",j.getAttribute(Eb))}function P(H){var j;let Z=F(),J=L(),ae=J.findIndex(pe=>pe===Z),ee=J[ae+H];(j=s.current)!=null&&j.loop&&(ee=ae+H<0?J[J.length-1]:ae+H===J.length?J[0]:J[ae+H]),ee&&I.setState("value",ee.getAttribute(Eb))}function D(H){let j=F(),Z=j?.closest(XC),J;for(;Z&&!J;)Z=H>0?frt(Z,XC):hrt(Z,XC),J=Z?.querySelector(Eoe);J?I.setState("value",J.getAttribute(Eb)):P(H)}let q=()=>M(L().length-1),U=H=>{H.preventDefault(),H.metaKey?q():H.altKey?D(1):P(1)},G=H=>{H.preventDefault(),H.metaKey?M(0):H.altKey?D(-1):P(-1)};return K.createElement(ig.div,{ref:e,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:H=>{var j;(j=y.onKeyDown)==null||j.call(y,H);let Z=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||Z))switch(H.key){case"n":case"j":{b&&H.ctrlKey&&U(H);break}case"ArrowDown":{U(H);break}case"p":case"k":{b&&H.ctrlKey&&G(H);break}case"ArrowUp":{G(H);break}case"Home":{H.preventDefault(),M(0);break}case"End":{H.preventDefault(),q();break}case"Enter":{H.preventDefault();let J=F();if(J){let ae=new Event($$);J.dispatchEvent(ae)}}}}},K.createElement("label",{"cmdk-label":"",htmlFor:x.inputId,id:x.labelId,style:Crt},A),IS(t,H=>K.createElement(Hve.Provider,{value:I},K.createElement(jve.Provider,{value:x},H))))}),Art=K.forwardRef((t,e)=>{var n,a;let r=xo(),i=K.useRef(null),o=K.useContext(zve),s=cv(),A=Kve(t),l=(a=(n=A.current)==null?void 0:n.forceMount)!=null?a:o?.forceMount;Jf(()=>{if(!l)return s.item(r,o?.id)},[l]);let u=Zve(r,i,[t.value,t.children,i],t.keywords),d=oZ(),p=Nm(_=>_.value&&_.value===u.current),m=Nm(_=>l||s.filter()===!1?!0:_.search?_.filtered.items.get(r)>0:!0);K.useEffect(()=>{let _=i.current;if(!(!_||t.disabled))return _.addEventListener($$,g),()=>_.removeEventListener($$,g)},[m,t.onSelect,t.disabled]);function g(){var _,I;h(),(I=(_=A.current).onSelect)==null||I.call(_,u.current)}function h(){d.setState("value",u.current,!0)}if(!m)return null;let{disabled:b,value:y,onSelect:w,forceMount:E,keywords:k,...v}=t;return K.createElement(ig.div,{ref:fu(i,e),...v,id:r,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!p,"data-disabled":!!b,"data-selected":!!p,onPointerMove:b||s.getDisablePointerSelection()?void 0:h,onClick:b?void 0:g},t.children)}),crt=K.forwardRef((t,e)=>{let{heading:n,children:a,forceMount:r,...i}=t,o=xo(),s=K.useRef(null),A=K.useRef(null),l=xo(),u=cv(),d=Nm(m=>r||u.filter()===!1?!0:m.search?m.filtered.groups.has(o):!0);Jf(()=>u.group(o),[]),Zve(o,s,[t.value,t.heading,A]);let p=K.useMemo(()=>({id:o,forceMount:r}),[r]);return K.createElement(ig.div,{ref:fu(s,e),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&K.createElement("div",{ref:A,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),IS(t,m=>K.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},K.createElement(zve.Provider,{value:p},m))))}),lrt=K.forwardRef((t,e)=>{let{alwaysRender:n,...a}=t,r=K.useRef(null),i=Nm(o=>!o.search);return!n&&!i?null:K.createElement(ig.div,{ref:fu(r,e),...a,"cmdk-separator":"",role:"separator"})}),urt=K.forwardRef((t,e)=>{let{onValueChange:n,...a}=t,r=t.value!=null,i=oZ(),o=Nm(l=>l.search),s=Nm(l=>l.selectedItemId),A=cv();return K.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),K.createElement(ig.input,{ref:e,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":A.listId,"aria-labelledby":A.labelId,"aria-activedescendant":s,id:A.inputId,type:"text",value:r?t.value:o,onChange:l=>{r||i.setState("search",l.target.value),n?.(l.target.value)}})}),drt=K.forwardRef((t,e)=>{let{children:n,label:a="Suggestions",...r}=t,i=K.useRef(null),o=K.useRef(null),s=Nm(l=>l.selectedItemId),A=cv();return K.useEffect(()=>{if(o.current&&i.current){let l=o.current,u=i.current,d,p=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let m=l.offsetHeight;u.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return p.observe(l),()=>{cancelAnimationFrame(d),p.unobserve(l)}}},[]),K.createElement(ig.div,{ref:fu(i,e),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":a,id:A.listId},IS(t,l=>K.createElement("div",{ref:fu(o,A.listInnerRef),"cmdk-list-sizer":""},l)))}),prt=K.forwardRef((t,e)=>{let{open:n,onOpenChange:a,overlayClassName:r,contentClassName:i,container:o,...s}=t;return K.createElement(zat,{open:n,onOpenChange:a},K.createElement(Yat,{container:o},K.createElement(Kat,{"cmdk-overlay":"",className:r}),K.createElement(Zat,{"aria-label":t.label,"cmdk-dialog":"",className:i},K.createElement(Yve,{ref:e,...s}))))}),mrt=K.forwardRef((t,e)=>Nm(n=>n.filtered.count===0)?K.createElement(ig.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),grt=K.forwardRef((t,e)=>{let{progress:n,children:a,label:r="Loading...",...i}=t;return K.createElement(ig.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},IS(t,o=>K.createElement("div",{"aria-hidden":!0},o)))}),$5n=Object.assign(Yve,{List:drt,Item:Art,Input:urt,Group:crt,Separator:lrt,Dialog:prt,Empty:mrt,Loading:grt});function frt(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function hrt(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Kve(t){let e=K.useRef(t);return Jf(()=>{e.current=t}),e}var Jf=typeof window>"u"?K.useEffect:K.useLayoutEffect;function Bb(t){let e=K.useRef();return e.current===void 0&&(e.current=t()),e}function Nm(t){let e=oZ(),n=()=>t(e.snapshot());return K.useSyncExternalStore(e.subscribe,n,n)}function Zve(t,e,n,a=[]){let r=K.useRef(),i=cv();return Jf(()=>{var o;let s=(()=>{var l;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(l=u.current.textContent)==null?void 0:l.trim():r.current}})(),A=a.map(l=>l.trim());i.value(t,s,A),(o=e.current)==null||o.setAttribute(Eb,s),r.current=s}),r}var brt=()=>{let[t,e]=K.useState(),n=Bb(()=>new Map);return Jf(()=>{n.current.forEach(a=>a()),n.current=new Map},[t]),(a,r)=>{n.current.set(a,r),e({})}};function yrt(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function IS({asChild:t,children:e},n){return t&&K.isValidElement(e)?K.cloneElement(yrt(e),{ref:e.ref},n(e.props.children)):n(e)}var Crt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function wrt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return K.useMemo(()=>a=>{e.forEach(r=>r(a))},e)}const QS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function B1(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function sZ(t){return"nodeType"in t}function Qs(t){var e,n;return t?B1(t)?t:sZ(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function AZ(t){const{Document:e}=Qs(t);return t instanceof e}function lv(t){return B1(t)?!1:t instanceof Qs(t).HTMLElement}function Wve(t){return t instanceof Qs(t).SVGElement}function k1(t){return t?B1(t)?t.document:sZ(t)?AZ(t)?t:lv(t)||Wve(t)?t.ownerDocument:document:document:document}const pl=QS?K.useLayoutEffect:K.useEffect;function _S(t){const e=K.useRef(t);return pl(()=>{e.current=t}),K.useCallback(function(){for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return e.current==null?void 0:e.current(...a)},[])}function Ert(){const t=K.useRef(null),e=K.useCallback((a,r)=>{t.current=setInterval(a,r)},[]),n=K.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function PB(t,e){e===void 0&&(e=[t]);const n=K.useRef(t);return pl(()=>{n.current!==t&&(n.current=t)},e),n}function uv(t,e){const n=K.useRef();return K.useMemo(()=>{const a=t(n.current);return n.current=a,a},[...e])}function _D(t){const e=_S(t),n=K.useRef(null),a=K.useCallback(r=>{r!==n.current&&e?.(r,n.current),n.current=r},[]);return[n,a]}function xD(t){const e=K.useRef();return K.useEffect(()=>{e.current=t},[t]),e.current}let u9={};function dv(t,e){return K.useMemo(()=>{if(e)return e;const n=u9[t]==null?0:u9[t]+1;return u9[t]=n,t+"-"+n},[t,e])}function Vve(t){return function(e){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return a.reduce((i,o)=>{const s=Object.entries(o);for(const[A,l]of s){const u=i[A];u!=null&&(i[A]=u+t*l)}return i},{...e})}}const Xb=Vve(1),qB=Vve(-1);function Brt(t){return"clientX"in t&&"clientY"in t}function xS(t){if(!t)return!1;const{KeyboardEvent:e}=Qs(t.target);return e&&t instanceof e}function krt(t){if(!t)return!1;const{TouchEvent:e}=Qs(t.target);return e&&t instanceof e}function DD(t){if(krt(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Brt(t)?{x:t.clientX,y:t.clientY}:null}const Xf=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Xf.Translate.toString(t),Xf.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:a}=t;return e+" "+n+"ms "+a}}}),Boe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function vrt(t){return t.matches(Boe)?t:t.querySelector(Boe)}const Irt={display:"none"};function Qrt(t){let{id:e,value:n}=t;return Ce.createElement("div",{id:e,style:Irt},n)}function _rt(t){let{id:e,announcement:n,ariaLiveType:a="assertive"}=t;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ce.createElement("div",{id:e,style:r,role:"status","aria-live":a,"aria-atomic":!0},n)}function xrt(){const[t,e]=K.useState("");return{announce:K.useCallback(a=>{a!=null&&e(a)},[]),announcement:t}}const Jve=K.createContext(null);function Drt(t){const e=K.useContext(Jve);K.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Srt(){const[t]=K.useState(()=>new Set),e=K.useCallback(a=>(t.add(a),()=>t.delete(a)),[t]);return[K.useCallback(a=>{let{type:r,event:i}=a;t.forEach(o=>{var s;return(s=o[r])==null?void 0:s.call(o,i)})},[t]),e]}const Nrt={draggable:`
1326
1327
  To pick up a draggable item, press the space bar.
1327
1328
  While dragging, use the arrow keys to move the item.
1328
1329
  Press space again to drop the item in its new position, or press escape to cancel.
1329
- `},_rt={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function xrt(t){let{announcements:e=_rt,container:n,hiddenTextDescribedById:a,screenReaderInstructions:r=Qrt}=t;const{announce:i,announcement:o}=krt(),s=dv("DndLiveRegion"),[A,l]=K.useState(!1);if(K.useEffect(()=>{l(!0)},[]),vrt(K.useMemo(()=>({onDragStart(d){let{active:p}=d;i(e.onDragStart({active:p}))},onDragMove(d){let{active:p,over:m}=d;e.onDragMove&&i(e.onDragMove({active:p,over:m}))},onDragOver(d){let{active:p,over:m}=d;i(e.onDragOver({active:p,over:m}))},onDragEnd(d){let{active:p,over:m}=d;i(e.onDragEnd({active:p,over:m}))},onDragCancel(d){let{active:p,over:m}=d;i(e.onDragCancel({active:p,over:m}))}}),[i,e])),!A)return null;const u=Ce.createElement(Ce.Fragment,null,Ce.createElement(Ert,{id:a,value:r.draggable}),Ce.createElement(Brt,{id:s,announcement:o}));return n?Xl.createPortal(u,n):u}var Li;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Li||(Li={}));function SD(){}function $5n(t,e){return K.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function j5n(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return K.useMemo(()=>[...e].filter(a=>a!=null),[...e])}const ml=Object.freeze({x:0,y:0});function Vve(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Drt(t,e){const n=DD(t);if(!n)return"0 0";const a={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return a.x+"% "+a.y+"%"}function Jve(t,e){let{data:{value:n}}=t,{data:{value:a}}=e;return n-a}function Srt(t,e){let{data:{value:n}}=t,{data:{value:a}}=e;return a-n}function koe(t){let{left:e,top:n,height:a,width:r}=t;return[{x:e,y:n},{x:e+r,y:n},{x:e,y:n+a},{x:e+r,y:n+a}]}function Xve(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function voe(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const H5n=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=t;const r=voe(e,e.left,e.top),i=[];for(const o of a){const{id:s}=o,A=n.get(s);if(A){const l=Vve(voe(A),r);i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Jve)},Nrt=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=t;const r=koe(e),i=[];for(const o of a){const{id:s}=o,A=n.get(s);if(A){const l=koe(A),u=r.reduce((p,m,g)=>p+Vve(l[g],m),0),d=Number((u/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:d}})}}return i.sort(Jve)};function Frt(t,e){const n=Math.max(e.top,t.top),a=Math.max(e.left,t.left),r=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=r-a,s=i-n;if(a<r&&n<i){const A=e.width*e.height,l=t.width*t.height,u=o*s,d=u/(A+l-u);return Number(d.toFixed(4))}return 0}const Trt=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=t;const r=[];for(const i of a){const{id:o}=i,s=n.get(o);if(s){const A=Frt(s,e);A>0&&r.push({id:o,data:{droppableContainer:i,value:A}})}}return r.sort(Srt)};function Rrt(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function eIe(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:ml}function Mrt(t){return function(n){for(var a=arguments.length,r=new Array(a>1?a-1:0),i=1;i<a;i++)r[i-1]=arguments[i];return r.reduce((o,s)=>({...o,top:o.top+t*s.y,bottom:o.bottom+t*s.y,left:o.left+t*s.x,right:o.right+t*s.x}),{...n})}}const Lrt=Mrt(1);function tIe(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function Ort(t,e,n){const a=tIe(e);if(!a)return t;const{scaleX:r,scaleY:i,x:o,y:s}=a,A=t.left-o-(1-r)*parseFloat(n),l=t.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?t.width/r:t.width,d=i?t.height/i:t.height;return{width:u,height:d,top:l,right:A+u,bottom:l+d,left:A}}const Grt={ignoreTransform:!1};function v1(t,e){e===void 0&&(e=Grt);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:l,transformOrigin:u}=Qs(t).getComputedStyle(t);l&&(n=Ort(n,l,u))}const{top:a,left:r,width:i,height:o,bottom:s,right:A}=n;return{top:a,left:r,width:i,height:o,bottom:s,right:A}}function Ioe(t){return v1(t,{ignoreTransform:!0})}function Prt(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function qrt(t,e){return e===void 0&&(e=Qs(t).getComputedStyle(t)),e.position==="fixed"}function Urt(t,e){e===void 0&&(e=Qs(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const i=e[r];return typeof i=="string"?n.test(i):!1})}function xS(t,e){const n=[];function a(r){if(e!=null&&n.length>=e||!r)return n;if(iZ(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!lv(r)||Kve(r)||n.includes(r))return n;const i=Qs(t).getComputedStyle(r);return r!==t&&Urt(r,i)&&n.push(r),qrt(r,i)?n:a(r.parentNode)}return t?a(t):n}function nIe(t){const[e]=xS(t,1);return e??null}function d9(t){return!IS||!t?null:B1(t)?t:rZ(t)?iZ(t)||t===k1(t).scrollingElement?window:lv(t)?t:null:null}function aIe(t){return B1(t)?t.scrollX:t.scrollLeft}function rIe(t){return B1(t)?t.scrollY:t.scrollTop}function j$(t){return{x:aIe(t),y:rIe(t)}}var Xi;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Xi||(Xi={}));function iIe(t){return!IS||!t?!1:t===document.scrollingElement}function oIe(t){const e={x:0,y:0},n=iIe(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},a={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},r=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=a.y,s=t.scrollLeft>=a.x;return{isTop:r,isLeft:i,isBottom:o,isRight:s,maxScroll:a,minScroll:e}}const $rt={x:.2,y:.2};function jrt(t,e,n,a,r){let{top:i,left:o,right:s,bottom:A}=n;a===void 0&&(a=10),r===void 0&&(r=$rt);const{isTop:l,isBottom:u,isLeft:d,isRight:p}=oIe(t),m={x:0,y:0},g={x:0,y:0},h={height:e.height*r.y,width:e.width*r.x};return!l&&i<=e.top+h.height?(m.y=Xi.Backward,g.y=a*Math.abs((e.top+h.height-i)/h.height)):!u&&A>=e.bottom-h.height&&(m.y=Xi.Forward,g.y=a*Math.abs((e.bottom-h.height-A)/h.height)),!p&&s>=e.right-h.width?(m.x=Xi.Forward,g.x=a*Math.abs((e.right-h.width-s)/h.width)):!d&&o<=e.left+h.width&&(m.x=Xi.Backward,g.x=a*Math.abs((e.left+h.width-o)/h.width)),{direction:m,speed:g}}function Hrt(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:a,bottom:r}=t.getBoundingClientRect();return{top:e,left:n,right:a,bottom:r,width:t.clientWidth,height:t.clientHeight}}function sIe(t){return t.reduce((e,n)=>Xb(e,j$(n)),ml)}function zrt(t){return t.reduce((e,n)=>e+aIe(n),0)}function Yrt(t){return t.reduce((e,n)=>e+rIe(n),0)}function AIe(t,e){if(e===void 0&&(e=v1),!t)return;const{top:n,left:a,bottom:r,right:i}=e(t);nIe(t)&&(r<=0||i<=0||n>=window.innerHeight||a>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Krt=[["x",["left","right"],zrt],["y",["top","bottom"],Yrt]];class oZ{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=xS(n),r=sIe(a);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,s]of Krt)for(const A of o)Object.defineProperty(this,A,{get:()=>{const l=s(a),u=r[i]-l;return this.rect[A]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class WE{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...n)})},this.target=e}add(e,n,a){var r;(r=this.target)==null||r.addEventListener(e,n,a),this.listeners.push([e,n,a])}}function Zrt(t){const{EventTarget:e}=Qs(t);return t instanceof e?t:k1(t)}function p9(t,e){const n=Math.abs(t.x),a=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+a**2)>e:"x"in e&&"y"in e?n>e.x&&a>e.y:"x"in e?n>e.x:"y"in e?a>e.y:!1}var oc;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(oc||(oc={}));function Qoe(t){t.preventDefault()}function Wrt(t){t.stopPropagation()}var wa;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(wa||(wa={}));const cIe={start:[wa.Space,wa.Enter],cancel:[wa.Esc],end:[wa.Space,wa.Enter,wa.Tab]},Vrt=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case wa.Right:return{...n,x:n.x+25};case wa.Left:return{...n,x:n.x-25};case wa.Down:return{...n,y:n.y+25};case wa.Up:return{...n,y:n.y-25}}};class lIe{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new WE(k1(n)),this.windowListeners=new WE(Qs(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oc.Resize,this.handleCancel),this.windowListeners.add(oc.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oc.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,a=e.node.current;a&&AIe(a),n(ml)}handleKeyDown(e){if(_S(e)){const{active:n,context:a,options:r}=this.props,{keyboardCodes:i=cIe,coordinateGetter:o=Vrt,scrollBehavior:s="smooth"}=r,{code:A}=e;if(i.end.includes(A)){this.handleEnd(e);return}if(i.cancel.includes(A)){this.handleCancel(e);return}const{collisionRect:l}=a.current,u=l?{x:l.left,y:l.top}:ml;this.referenceCoordinates||(this.referenceCoordinates=u);const d=o(e,{active:n,context:a.current,currentCoordinates:u});if(d){const p=qB(d,u),m={x:0,y:0},{scrollableAncestors:g}=a.current;for(const h of g){const b=e.code,{isTop:y,isRight:w,isLeft:E,isBottom:k,maxScroll:v,minScroll:_}=oIe(h),I=Hrt(h),x={x:Math.min(b===wa.Right?I.right-I.width/2:I.right,Math.max(b===wa.Right?I.left:I.left+I.width/2,d.x)),y:Math.min(b===wa.Down?I.bottom-I.height/2:I.bottom,Math.max(b===wa.Down?I.top:I.top+I.height/2,d.y))},N=b===wa.Right&&!w||b===wa.Left&&!E,R=b===wa.Down&&!k||b===wa.Up&&!y;if(N&&x.x!==d.x){const T=h.scrollLeft+p.x,O=b===wa.Right&&T<=v.x||b===wa.Left&&T>=_.x;if(O&&!p.y){h.scrollTo({left:T,behavior:s});return}O?m.x=h.scrollLeft-T:m.x=b===wa.Right?h.scrollLeft-v.x:h.scrollLeft-_.x,m.x&&h.scrollBy({left:-m.x,behavior:s});break}else if(R&&x.y!==d.y){const T=h.scrollTop+p.y,O=b===wa.Down&&T<=v.y||b===wa.Up&&T>=_.y;if(O&&!p.x){h.scrollTo({top:T,behavior:s});return}O?m.y=h.scrollTop-T:m.y=b===wa.Down?h.scrollTop-v.y:h.scrollTop-_.y,m.y&&h.scrollBy({top:-m.y,behavior:s});break}}this.handleMove(e,Xb(qB(d,this.referenceCoordinates),m))}}}handleMove(e,n){const{onMove:a}=this.props;e.preventDefault(),a(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}lIe.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:a=cIe,onActivation:r}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(a.start.includes(o)){const s=i.activatorNode.current;return s&&t.target!==s?!1:(t.preventDefault(),r?.({event:t.nativeEvent}),!0)}return!1}}];function _oe(t){return!!(t&&"distance"in t)}function xoe(t){return!!(t&&"delay"in t)}class sZ{constructor(e,n,a){var r;a===void 0&&(a=Zrt(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=k1(o),this.documentListeners=new WE(this.document),this.listeners=new WE(a),this.windowListeners=new WE(Qs(o)),this.initialCoordinates=(r=DD(i))!=null?r:ml,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:a}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(oc.Resize,this.handleCancel),this.windowListeners.add(oc.DragStart,Qoe),this.windowListeners.add(oc.VisibilityChange,this.handleCancel),this.windowListeners.add(oc.ContextMenu,Qoe),this.documentListeners.add(oc.Keydown,this.handleKeydown),n){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xoe(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(_oe(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:a,onPending:r}=this.props;r(a,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(oc.Click,Wrt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oc.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:a,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!r)return;const A=(n=DD(e))!=null?n:ml,l=qB(r,A);if(!a&&s){if(_oe(s)){if(s.tolerance!=null&&p9(l,s.tolerance))return this.handleCancel();if(p9(l,s.distance))return this.handleStart()}if(xoe(s)&&p9(l,s.tolerance))return this.handleCancel();this.handlePending(s,l);return}e.cancelable&&e.preventDefault(),o(A)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===wa.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const Jrt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class uIe extends sZ{constructor(e){const{event:n}=e,a=k1(n.target);super(e,Jrt,a)}}uIe.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:a}=e;return!n.isPrimary||n.button!==0?!1:(a?.({event:n}),!0)}}];const Xrt={move:{name:"mousemove"},end:{name:"mouseup"}};var H$;(function(t){t[t.RightClick=2]="RightClick"})(H$||(H$={}));class eit extends sZ{constructor(e){super(e,Xrt,k1(e.event.target))}}eit.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:a}=e;return n.button===H$.RightClick?!1:(a?.({event:n}),!0)}}];const m9={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class tit extends sZ{constructor(e){super(e,m9)}static setup(){return window.addEventListener(m9.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(m9.move.name,e)};function e(){}}}tit.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:a}=e;const{touches:r}=n;return r.length>1?!1:(a?.({event:n}),!0)}}];var VE;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(VE||(VE={}));var ND;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(ND||(ND={}));function nit(t){let{acceleration:e,activator:n=VE.Pointer,canScroll:a,draggingRect:r,enabled:i,interval:o=5,order:s=ND.TreeOrder,pointerCoordinates:A,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:p}=t;const m=rit({delta:d,disabled:!i}),[g,h]=hrt(),b=K.useRef({x:0,y:0}),y=K.useRef({x:0,y:0}),w=K.useMemo(()=>{switch(n){case VE.Pointer:return A?{top:A.y,bottom:A.y,left:A.x,right:A.x}:null;case VE.DraggableRect:return r}},[n,r,A]),E=K.useRef(null),k=K.useCallback(()=>{const _=E.current;if(!_)return;const I=b.current.x*y.current.x,x=b.current.y*y.current.y;_.scrollBy(I,x)},[]),v=K.useMemo(()=>s===ND.TreeOrder?[...l].reverse():l,[s,l]);K.useEffect(()=>{if(!i||!l.length||!w){h();return}for(const _ of v){if(a?.(_)===!1)continue;const I=l.indexOf(_),x=u[I];if(!x)continue;const{direction:N,speed:R}=jrt(_,x,w,e,p);for(const T of["x","y"])m[T][N[T]]||(R[T]=0,N[T]=0);if(R.x>0||R.y>0){h(),E.current=_,g(k,o),b.current=R,y.current=N;return}}b.current={x:0,y:0},y.current={x:0,y:0},h()},[e,k,a,h,i,o,JSON.stringify(w),JSON.stringify(m),g,l,v,u,JSON.stringify(p)])}const ait={x:{[Xi.Backward]:!1,[Xi.Forward]:!1},y:{[Xi.Backward]:!1,[Xi.Forward]:!1}};function rit(t){let{delta:e,disabled:n}=t;const a=xD(e);return uv(r=>{if(n||!a||!r)return ait;const i={x:Math.sign(e.x-a.x),y:Math.sign(e.y-a.y)};return{x:{[Xi.Backward]:r.x[Xi.Backward]||i.x===-1,[Xi.Forward]:r.x[Xi.Forward]||i.x===1},y:{[Xi.Backward]:r.y[Xi.Backward]||i.y===-1,[Xi.Forward]:r.y[Xi.Forward]||i.y===1}}},[n,e,a])}function iit(t,e){const n=e!=null?t.get(e):void 0,a=n?n.node.current:null;return uv(r=>{var i;return e==null?null:(i=a??r)!=null?i:null},[a,e])}function oit(t,e){return K.useMemo(()=>t.reduce((n,a)=>{const{sensor:r}=a,i=r.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,a)}));return[...n,...i]},[]),[t,e])}var UB;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(UB||(UB={}));var z$;(function(t){t.Optimized="optimized"})(z$||(z$={}));const Doe=new Map;function sit(t,e){let{dragging:n,dependencies:a,config:r}=e;const[i,o]=K.useState(null),{frequency:s,measure:A,strategy:l}=r,u=K.useRef(t),d=b(),p=PB(d),m=K.useCallback(function(y){y===void 0&&(y=[]),!p.current&&o(w=>w===null?y:w.concat(y.filter(E=>!w.includes(E))))},[p]),g=K.useRef(null),h=uv(y=>{if(d&&!n)return Doe;if(!y||y===Doe||u.current!==t||i!=null){const w=new Map;for(let E of t){if(!E)continue;if(i&&i.length>0&&!i.includes(E.id)&&E.rect.current){w.set(E.id,E.rect.current);continue}const k=E.node.current,v=k?new oZ(A(k),k):null;E.rect.current=v,v&&w.set(E.id,v)}return w}return y},[t,i,n,d,A]);return K.useEffect(()=>{u.current=t},[t]),K.useEffect(()=>{d||m()},[n,d]),K.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),K.useEffect(()=>{d||typeof s!="number"||g.current!==null||(g.current=setTimeout(()=>{m(),g.current=null},s))},[s,d,m,...a]),{droppableRects:h,measureDroppableContainers:m,measuringScheduled:i!=null};function b(){switch(l){case UB.Always:return!1;case UB.BeforeDragging:return n;default:return!n}}}function AZ(t,e){return uv(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Ait(t,e){return AZ(t,e)}function cit(t){let{callback:e,disabled:n}=t;const a=QS(e),r=K.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(a)},[a,n]);return K.useEffect(()=>()=>r?.disconnect(),[r]),r}function DS(t){let{callback:e,disabled:n}=t;const a=QS(e),r=K.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(a)},[n]);return K.useEffect(()=>()=>r?.disconnect(),[r]),r}function lit(t){return new oZ(v1(t),t)}function Soe(t,e,n){e===void 0&&(e=lit);const[a,r]=K.useState(null);function i(){r(A=>{if(!t)return null;if(t.isConnected===!1){var l;return(l=A??n)!=null?l:null}const u=e(t);return JSON.stringify(A)===JSON.stringify(u)?A:u})}const o=cit({callback(A){if(t)for(const l of A){const{type:u,target:d}=l;if(u==="childList"&&d instanceof HTMLElement&&d.contains(t)){i();break}}}}),s=DS({callback:i});return pl(()=>{i(),t?(s?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[t]),a}function uit(t){const e=AZ(t);return eIe(t,e)}const Noe=[];function dit(t){const e=K.useRef(t),n=uv(a=>t?a&&a!==Noe&&t&&e.current&&t.parentNode===e.current.parentNode?a:xS(t):Noe,[t]);return K.useEffect(()=>{e.current=t},[t]),n}function pit(t){const[e,n]=K.useState(null),a=K.useRef(t),r=K.useCallback(i=>{const o=d9(i.target);o&&n(s=>s?(s.set(o,j$(o)),new Map(s)):null)},[]);return K.useEffect(()=>{const i=a.current;if(t!==i){o(i);const s=t.map(A=>{const l=d9(A);return l?(l.addEventListener("scroll",r,{passive:!0}),[l,j$(l)]):null}).filter(A=>A!=null);n(s.length?new Map(s):null),a.current=t}return()=>{o(t),o(i)};function o(s){s.forEach(A=>{const l=d9(A);l?.removeEventListener("scroll",r)})}},[r,t]),K.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Xb(i,o),ml):sIe(t):ml,[t,e])}function Foe(t,e){e===void 0&&(e=[]);const n=K.useRef(null);return K.useEffect(()=>{n.current=null},e),K.useEffect(()=>{const a=t!==ml;a&&!n.current&&(n.current=t),!a&&n.current&&(n.current=null)},[t]),n.current?qB(t,n.current):ml}function mit(t){K.useEffect(()=>{if(!IS)return;const e=t.map(n=>{let{sensor:a}=n;return a.setup==null?void 0:a.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function git(t,e){return K.useMemo(()=>t.reduce((n,a)=>{let{eventName:r,handler:i}=a;return n[r]=o=>{i(o,e)},n},{}),[t,e])}function dIe(t){return K.useMemo(()=>t?Prt(t):null,[t])}const Toe=[];function fit(t,e){e===void 0&&(e=v1);const[n]=t,a=dIe(n?Qs(n):null),[r,i]=K.useState(Toe);function o(){i(()=>t.length?t.map(A=>iIe(A)?a:new oZ(e(A),A)):Toe)}const s=DS({callback:o});return pl(()=>{s?.disconnect(),o(),t.forEach(A=>s?.observe(A))},[t]),r}function pIe(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return lv(e)?e:t}function hit(t){let{measure:e}=t;const[n,a]=K.useState(null),r=K.useCallback(l=>{for(const{target:u}of l)if(lv(u)){a(d=>{const p=e(u);return d?{...d,width:p.width,height:p.height}:p});break}},[e]),i=DS({callback:r}),o=K.useCallback(l=>{const u=pIe(l);i?.disconnect(),u&&i?.observe(u),a(u?e(u):null)},[e,i]),[s,A]=_D(o);return K.useMemo(()=>({nodeRef:s,rect:n,setRef:A}),[n,s,A])}const bit=[{sensor:uIe,options:{}},{sensor:lIe,options:{}}],yit={current:{}},Sx={draggable:{measure:Ioe},droppable:{measure:Ioe,strategy:UB.WhileDragging,frequency:z$.Optimized},dragOverlay:{measure:v1}};class JE extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,a;return(n=(a=this.get(e))==null?void 0:a.node.current)!=null?n:void 0}}const Cit={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new JE,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:SD},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sx,measureDroppableContainers:SD,windowRect:null,measuringScheduled:!1},mIe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:SD,draggableNodes:new Map,over:null,measureDroppableContainers:SD},pv=K.createContext(mIe),gIe=K.createContext(Cit);function wit(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new JE}}}function Eit(t,e){switch(e.type){case Li.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Li.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Li.DragEnd:case Li.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Li.RegisterDroppable:{const{element:n}=e,{id:a}=n,r=new JE(t.droppable.containers);return r.set(a,n),{...t,droppable:{...t.droppable,containers:r}}}case Li.SetDroppableDisabled:{const{id:n,key:a,disabled:r}=e,i=t.droppable.containers.get(n);if(!i||a!==i.key)return t;const o=new JE(t.droppable.containers);return o.set(n,{...i,disabled:r}),{...t,droppable:{...t.droppable,containers:o}}}case Li.UnregisterDroppable:{const{id:n,key:a}=e,r=t.droppable.containers.get(n);if(!r||a!==r.key)return t;const i=new JE(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Bit(t){let{disabled:e}=t;const{active:n,activatorEvent:a,draggableNodes:r}=K.useContext(pv),i=xD(a),o=xD(n?.id);return K.useEffect(()=>{if(!e&&!a&&i&&o!=null){if(!_S(i)||document.activeElement===i.target)return;const s=r.get(o);if(!s)return;const{activatorNode:A,node:l}=s;if(!A.current&&!l.current)return;requestAnimationFrame(()=>{for(const u of[A.current,l.current]){if(!u)continue;const d=Crt(u);if(d){d.focus();break}}})}},[a,e,r,o,i]),null}function fIe(t,e){let{transform:n,...a}=e;return t!=null&&t.length?t.reduce((r,i)=>i({transform:r,...a}),n):n}function kit(t){return K.useMemo(()=>({draggable:{...Sx.draggable,...t?.draggable},droppable:{...Sx.droppable,...t?.droppable},dragOverlay:{...Sx.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function vit(t){let{activeNode:e,measure:n,initialRect:a,config:r=!0}=t;const i=K.useRef(!1),{x:o,y:s}=typeof r=="boolean"?{x:r,y:r}:r;pl(()=>{if(!o&&!s||!e){i.current=!1;return}if(i.current||!a)return;const l=e?.node.current;if(!l||l.isConnected===!1)return;const u=n(l),d=eIe(u,a);if(o||(d.x=0),s||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=nIe(l);p&&p.scrollBy({top:d.y,left:d.x})}},[e,o,s,a,n])}const SS=K.createContext({...ml,scaleX:1,scaleY:1});var im;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(im||(im={}));const z5n=K.memo(function(e){var n,a,r,i;let{id:o,accessibility:s,autoScroll:A=!0,children:l,sensors:u=bit,collisionDetection:d=Trt,measuring:p,modifiers:m,...g}=e;const h=K.useReducer(Eit,void 0,wit),[b,y]=h,[w,E]=Irt(),[k,v]=K.useState(im.Uninitialized),_=k===im.Initialized,{draggable:{active:I,nodes:x,translate:N},droppable:{containers:R}}=b,T=I!=null?x.get(I):null,O=K.useRef({initial:null,translated:null}),$=K.useMemo(()=>{var yt;return I!=null?{id:I,data:(yt=T?.data)!=null?yt:yit,rect:O}:null},[I,T]),F=K.useRef(null),[L,M]=K.useState(null),[P,D]=K.useState(null),q=PB(g,Object.values(g)),U=dv("DndDescribedBy",o),G=K.useMemo(()=>R.getEnabled(),[R]),H=kit(p),{droppableRects:j,measureDroppableContainers:Z,measuringScheduled:J}=sit(G,{dragging:_,dependencies:[N.x,N.y],config:H.droppable}),ae=iit(x,I),ee=K.useMemo(()=>P?DD(P):null,[P]),pe=Xe(),ie=Ait(ae,H.draggable.measure);vit({activeNode:I!=null?x.get(I):null,config:pe.layoutShiftCompensation,initialRect:ie,measure:H.draggable.measure});const re=Soe(ae,H.draggable.measure,ie),ne=Soe(ae?ae.parentElement:null),te=K.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=R.getNodeFor((n=te.current.over)==null?void 0:n.id),Ae=hit({measure:H.dragOverlay.measure}),Be=(a=Ae.nodeRef.current)!=null?a:ae,de=_?(r=Ae.rect)!=null?r:re:null,Ge=!!(Ae.nodeRef.current&&Ae.rect),oe=uit(Ge?null:re),Je=dIe(Be?Qs(Be):null),Ee=dit(_?le??ae:null),st=fit(Ee),nt=fIe(m,{transform:{x:N.x-oe.x,y:N.y-oe.y,scaleX:1,scaleY:1},activatorEvent:P,active:$,activeNodeRect:re,containerNodeRect:ne,draggingNodeRect:de,over:te.current.over,overlayNodeRect:Ae.rect,scrollableAncestors:Ee,scrollableAncestorRects:st,windowRect:Je}),lt=ee?Xb(ee,N):null,Me=pit(Ee),tt=Foe(Me),ye=Foe(Me,[re]),De=Xb(nt,tt),qe=de?Lrt(de,nt):null,ke=$&&qe?d({active:$,collisionRect:qe,droppableRects:j,droppableContainers:G,pointerCoordinates:lt}):null,$e=Xve(ke,"id"),[ue,we]=K.useState(null),W=Ge?nt:Xb(nt,ye),he=Rrt(W,(i=ue?.rect)!=null?i:null,re),me=K.useRef(null),Qe=K.useCallback((yt,ht)=>{let{sensor:He,options:at}=ht;if(F.current==null)return;const ze=x.get(F.current);if(!ze)return;const Ve=yt.nativeEvent,bt=new He({active:F.current,activeNode:ze,event:Ve,options:at,context:te,onAbort(We){if(!x.get(We))return;const{onDragAbort:ct}=q.current,wt={id:We};ct?.(wt),w({type:"onDragAbort",event:wt})},onPending(We,_t,ct,wt){if(!x.get(We))return;const{onDragPending:kt}=q.current,It={id:We,constraint:_t,initialCoordinates:ct,offset:wt};kt?.(It),w({type:"onDragPending",event:It})},onStart(We){const _t=F.current;if(_t==null)return;const ct=x.get(_t);if(!ct)return;const{onDragStart:wt}=q.current,Nt={activatorEvent:Ve,active:{id:_t,data:ct.data,rect:O}};Xl.unstable_batchedUpdates(()=>{wt?.(Nt),v(im.Initializing),y({type:Li.DragStart,initialCoordinates:We,active:_t}),w({type:"onDragStart",event:Nt}),M(me.current),D(Ve)})},onMove(We){y({type:Li.DragMove,coordinates:We})},onEnd:it(Li.DragEnd),onCancel:it(Li.DragCancel)});me.current=bt;function it(We){return async function(){const{active:ct,collisions:wt,over:Nt,scrollAdjustedTranslate:kt}=te.current;let It=null;if(ct&&kt){const{cancelDrop:zt}=q.current;It={activatorEvent:Ve,active:ct,collisions:wt,delta:kt,over:Nt},We===Li.DragEnd&&typeof zt=="function"&&await Promise.resolve(zt(It))&&(We=Li.DragCancel)}F.current=null,Xl.unstable_batchedUpdates(()=>{y({type:We}),v(im.Uninitialized),we(null),M(null),D(null),me.current=null;const zt=We===Li.DragEnd?"onDragEnd":"onDragCancel";if(It){const In=q.current[zt];In?.(It),w({type:zt,event:It})}})}}},[x]),xe=K.useCallback((yt,ht)=>(He,at)=>{const ze=He.nativeEvent,Ve=x.get(at);if(F.current!==null||!Ve||ze.dndKit||ze.defaultPrevented)return;const bt={active:Ve};yt(He,ht.options,bt)===!0&&(ze.dndKit={capturedBy:ht.sensor},F.current=at,Qe(He,ht))},[x,Qe]),Te=oit(u,xe);mit(u),pl(()=>{re&&k===im.Initializing&&v(im.Initialized)},[re,k]),K.useEffect(()=>{const{onDragMove:yt}=q.current,{active:ht,activatorEvent:He,collisions:at,over:ze}=te.current;if(!ht||!He)return;const Ve={active:ht,activatorEvent:He,collisions:at,delta:{x:De.x,y:De.y},over:ze};Xl.unstable_batchedUpdates(()=>{yt?.(Ve),w({type:"onDragMove",event:Ve})})},[De.x,De.y]),K.useEffect(()=>{const{active:yt,activatorEvent:ht,collisions:He,droppableContainers:at,scrollAdjustedTranslate:ze}=te.current;if(!yt||F.current==null||!ht||!ze)return;const{onDragOver:Ve}=q.current,bt=at.get($e),it=bt&&bt.rect.current?{id:bt.id,rect:bt.rect.current,data:bt.data,disabled:bt.disabled}:null,We={active:yt,activatorEvent:ht,collisions:He,delta:{x:ze.x,y:ze.y},over:it};Xl.unstable_batchedUpdates(()=>{we(it),Ve?.(We),w({type:"onDragOver",event:We})})},[$e]),pl(()=>{te.current={activatorEvent:P,active:$,activeNode:ae,collisionRect:qe,collisions:ke,droppableRects:j,draggableNodes:x,draggingNode:Be,draggingNodeRect:de,droppableContainers:R,over:ue,scrollableAncestors:Ee,scrollAdjustedTranslate:De},O.current={initial:de,translated:qe}},[$,ae,ke,qe,x,Be,de,j,R,ue,Ee,De]),nit({...pe,delta:N,draggingRect:qe,pointerCoordinates:lt,scrollableAncestors:Ee,scrollableAncestorRects:st});const Oe=K.useMemo(()=>({active:$,activeNode:ae,activeNodeRect:re,activatorEvent:P,collisions:ke,containerNodeRect:ne,dragOverlay:Ae,draggableNodes:x,droppableContainers:R,droppableRects:j,over:ue,measureDroppableContainers:Z,scrollableAncestors:Ee,scrollableAncestorRects:st,measuringConfiguration:H,measuringScheduled:J,windowRect:Je}),[$,ae,re,P,ke,ne,Ae,x,R,j,ue,Z,Ee,st,H,J,Je]),Le=K.useMemo(()=>({activatorEvent:P,activators:Te,active:$,activeNodeRect:re,ariaDescribedById:{draggable:U},dispatch:y,draggableNodes:x,over:ue,measureDroppableContainers:Z}),[P,Te,$,re,y,U,x,ue,Z]);return Ce.createElement(Wve.Provider,{value:E},Ce.createElement(pv.Provider,{value:Le},Ce.createElement(gIe.Provider,{value:Oe},Ce.createElement(SS.Provider,{value:he},l)),Ce.createElement(Bit,{disabled:s?.restoreFocus===!1})),Ce.createElement(xrt,{...s,hiddenTextDescribedById:U}));function Xe(){const yt=L?.autoScrollEnabled===!1,ht=typeof A=="object"?A.enabled===!1:A===!1,He=_&&!yt&&!ht;return typeof A=="object"?{...A,enabled:He}:{enabled:He}}}),Iit=K.createContext(null),Roe="button",Qit="Draggable";function _it(t){let{id:e,data:n,disabled:a=!1,attributes:r}=t;const i=dv(Qit),{activators:o,activatorEvent:s,active:A,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:p}=K.useContext(pv),{role:m=Roe,roleDescription:g="draggable",tabIndex:h=0}=r??{},b=A?.id===e,y=K.useContext(b?SS:Iit),[w,E]=_D(),[k,v]=_D(),_=git(o,e),I=PB(n);pl(()=>(d.set(e,{id:e,key:i,node:w,activatorNode:k,data:I}),()=>{const N=d.get(e);N&&N.key===i&&d.delete(e)}),[d,e]);const x=K.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":a,"aria-pressed":b&&m===Roe?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[a,m,h,b,g,u.draggable]);return{active:A,activatorEvent:s,activeNodeRect:l,attributes:x,isDragging:b,listeners:a?void 0:_,node:w,over:p,setNodeRef:E,setActivatorNodeRef:v,transform:y}}function hIe(){return K.useContext(gIe)}const xit="Droppable",Dit={timeout:25};function Sit(t){let{data:e,disabled:n=!1,id:a,resizeObserverConfig:r}=t;const i=dv(xit),{active:o,dispatch:s,over:A,measureDroppableContainers:l}=K.useContext(pv),u=K.useRef({disabled:n}),d=K.useRef(!1),p=K.useRef(null),m=K.useRef(null),{disabled:g,updateMeasurementsFor:h,timeout:b}={...Dit,...r},y=PB(h??a),w=K.useCallback(()=>{if(!d.current){d.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(y.current)?y.current:[y.current]),m.current=null},b)},[b]),E=DS({callback:w,disabled:g||!o}),k=K.useCallback((x,N)=>{E&&(N&&(E.unobserve(N),d.current=!1),x&&E.observe(x))},[E]),[v,_]=_D(k),I=PB(e);return K.useEffect(()=>{!E||!v.current||(E.disconnect(),d.current=!1,E.observe(v.current))},[v,E]),K.useEffect(()=>(s({type:Li.RegisterDroppable,element:{id:a,key:i,disabled:n,node:v,rect:p,data:I}}),()=>s({type:Li.UnregisterDroppable,key:i,id:a})),[a]),K.useEffect(()=>{n!==u.current.disabled&&(s({type:Li.SetDroppableDisabled,id:a,key:i,disabled:n}),u.current.disabled=n)},[a,i,n,s]),{active:o,rect:p,isOver:A?.id===a,node:v,over:A,setNodeRef:_}}function Nit(t){let{animation:e,children:n}=t;const[a,r]=K.useState(null),[i,o]=K.useState(null),s=xD(n);return!n&&!a&&s&&r(s),pl(()=>{if(!i)return;const A=a?.key,l=a?.props.id;if(A==null||l==null){r(null);return}Promise.resolve(e(l,i)).then(()=>{r(null)})},[e,a,i]),Ce.createElement(Ce.Fragment,null,n,a?K.cloneElement(a,{ref:o}):null)}const Fit={x:0,y:0,scaleX:1,scaleY:1};function Tit(t){let{children:e}=t;return Ce.createElement(pv.Provider,{value:mIe},Ce.createElement(SS.Provider,{value:Fit},e))}const Rit={position:"fixed",touchAction:"none"},Mit=t=>_S(t)?"transform 250ms ease":void 0,Lit=K.forwardRef((t,e)=>{let{as:n,activatorEvent:a,adjustScale:r,children:i,className:o,rect:s,style:A,transform:l,transition:u=Mit}=t;if(!s)return null;const d=r?l:{...l,scaleX:1,scaleY:1},p={...Rit,width:s.width,height:s.height,top:s.top,left:s.left,transform:Xf.Transform.toString(d),transformOrigin:r&&a?Drt(a,s):void 0,transition:typeof u=="function"?u(a):u,...A};return Ce.createElement(n,{className:o,style:p,ref:e},i)}),Oit=t=>e=>{let{active:n,dragOverlay:a}=e;const r={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[s,A]of Object.entries(i.active))A!==void 0&&(r[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,A));if(i!=null&&i.dragOverlay)for(const[s,A]of Object.entries(i.dragOverlay))A!==void 0&&a.node.style.setProperty(s,A);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&a.node.classList.add(o.dragOverlay),function(){for(const[A,l]of Object.entries(r))n.node.style.setProperty(A,l);o!=null&&o.active&&n.node.classList.remove(o.active)}},Git=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Xf.Transform.toString(e)},{transform:Xf.Transform.toString(n)}]},Pit={duration:250,easing:"ease",keyframes:Git,sideEffects:Oit({styles:{active:{opacity:"0"}}})};function qit(t){let{config:e,draggableNodes:n,droppableContainers:a,measuringConfiguration:r}=t;return QS((i,o)=>{if(e===null)return;const s=n.get(i);if(!s)return;const A=s.node.current;if(!A)return;const l=pIe(o);if(!l)return;const{transform:u}=Qs(o).getComputedStyle(o),d=tIe(u);if(!d)return;const p=typeof e=="function"?e:Uit(e);return AIe(A,r.draggable.measure),p({active:{id:i,data:s.data,node:A,rect:r.draggable.measure(A)},draggableNodes:n,dragOverlay:{node:o,rect:r.dragOverlay.measure(l)},droppableContainers:a,measuringConfiguration:r,transform:d})})}function Uit(t){const{duration:e,easing:n,sideEffects:a,keyframes:r}={...Pit,...t};return i=>{let{active:o,dragOverlay:s,transform:A,...l}=i;if(!e)return;const u={x:s.rect.left-o.rect.left,y:s.rect.top-o.rect.top},d={scaleX:A.scaleX!==1?o.rect.width*A.scaleX/s.rect.width:1,scaleY:A.scaleY!==1?o.rect.height*A.scaleY/s.rect.height:1},p={x:A.x-u.x,y:A.y-u.y,...d},m=r({...l,active:o,dragOverlay:s,transform:{initial:A,final:p}}),[g]=m,h=m[m.length-1];if(JSON.stringify(g)===JSON.stringify(h))return;const b=a?.({active:o,dragOverlay:s,...l}),y=s.node.animate(m,{duration:e,easing:n,fill:"forwards"});return new Promise(w=>{y.onfinish=()=>{b?.(),w()}})}}let Moe=0;function $it(t){return K.useMemo(()=>{if(t!=null)return Moe++,Moe},[t])}const Y5n=Ce.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:a,style:r,transition:i,modifiers:o,wrapperElement:s="div",className:A,zIndex:l=999}=t;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:m,draggableNodes:g,droppableContainers:h,dragOverlay:b,over:y,measuringConfiguration:w,scrollableAncestors:E,scrollableAncestorRects:k,windowRect:v}=hIe(),_=K.useContext(SS),I=$it(d?.id),x=fIe(o,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:E,scrollableAncestorRects:k,transform:_,windowRect:v}),N=AZ(p),R=qit({config:a,draggableNodes:g,droppableContainers:h,measuringConfiguration:w}),T=N?b.setRef:void 0;return Ce.createElement(Tit,null,Ce.createElement(Nit,{animation:R},d&&I?Ce.createElement(Lit,{key:I,id:d.id,ref:T,as:s,activatorEvent:u,adjustScale:e,className:A,transition:i,rect:N,style:{zIndex:l,...r},transform:x},n):null))});function bIe(t,e,n){const a=t.slice();return a.splice(n<0?a.length+n:n,0,a.splice(e,1)[0]),a}function jit(t,e){return t.reduce((n,a,r)=>{const i=e.get(a);return i&&(n[r]=i),n},Array(t.length))}function ZQ(t){return t!==null&&t>=0}function Hit(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function zit(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const yIe=t=>{let{rects:e,activeIndex:n,overIndex:a,index:r}=t;const i=bIe(e,a,n),o=e[r],s=i[r];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},WQ={scaleX:1,scaleY:1},K5n=t=>{var e;let{activeIndex:n,activeNodeRect:a,index:r,rects:i,overIndex:o}=t;const s=(e=i[n])!=null?e:a;if(!s)return null;if(r===n){const l=i[o];return l?{x:0,y:n<o?l.top+l.height-(s.top+s.height):l.top-s.top,...WQ}:null}const A=Yit(i,r,n);return r>n&&r<=o?{x:0,y:-s.height-A,...WQ}:r<n&&r>=o?{x:0,y:s.height+A,...WQ}:{x:0,y:0,...WQ}};function Yit(t,e,n){const a=t[e],r=t[e-1],i=t[e+1];return a?n<e?r?a.top-(r.top+r.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):r?a.top-(r.top+r.height):0:0}const CIe="Sortable",wIe=Ce.createContext({activeIndex:-1,containerId:CIe,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:yIe,disabled:{draggable:!1,droppable:!1}});function Z5n(t){let{children:e,id:n,items:a,strategy:r=yIe,disabled:i=!1}=t;const{active:o,dragOverlay:s,droppableRects:A,over:l,measureDroppableContainers:u}=hIe(),d=dv(CIe,n),p=s.rect!==null,m=K.useMemo(()=>a.map(_=>typeof _=="object"&&"id"in _?_.id:_),[a]),g=o!=null,h=o?m.indexOf(o.id):-1,b=l?m.indexOf(l.id):-1,y=K.useRef(m),w=!Hit(m,y.current),E=b!==-1&&h===-1||w,k=zit(i);pl(()=>{w&&g&&u(m)},[w,m,g,u]),K.useEffect(()=>{y.current=m},[m]);const v=K.useMemo(()=>({activeIndex:h,containerId:d,disabled:k,disableTransforms:E,items:m,overIndex:b,useDragOverlay:p,sortedRects:jit(m,A),strategy:r}),[h,d,k.draggable,k.droppable,E,m,b,A,p,r]);return Ce.createElement(wIe.Provider,{value:v},e)}const Kit=t=>{let{id:e,items:n,activeIndex:a,overIndex:r}=t;return bIe(n,a,r).indexOf(e)},Zit=t=>{let{containerId:e,isSorting:n,wasDragging:a,index:r,items:i,newIndex:o,previousItems:s,previousContainerId:A,transition:l}=t;return!l||!a||s!==i&&r===o?!1:n?!0:o!==r&&e===A},Wit={duration:200,easing:"ease"},EIe="transform",Vit=Xf.Transition.toString({property:EIe,duration:0,easing:"linear"}),Jit={roleDescription:"sortable"};function Xit(t){let{disabled:e,index:n,node:a,rect:r}=t;const[i,o]=K.useState(null),s=K.useRef(n);return pl(()=>{if(!e&&n!==s.current&&a.current){const A=r.current;if(A){const l=v1(a.current,{ignoreTransform:!0}),u={x:A.left-l.left,y:A.top-l.top,scaleX:A.width/l.width,scaleY:A.height/l.height};(u.x||u.y)&&o(u)}}n!==s.current&&(s.current=n)},[e,n,a,r]),K.useEffect(()=>{i&&o(null)},[i]),i}function W5n(t){let{animateLayoutChanges:e=Zit,attributes:n,disabled:a,data:r,getNewIndex:i=Kit,id:o,strategy:s,resizeObserverConfig:A,transition:l=Wit}=t;const{items:u,containerId:d,activeIndex:p,disabled:m,disableTransforms:g,sortedRects:h,overIndex:b,useDragOverlay:y,strategy:w}=K.useContext(wIe),E=eot(a,m),k=u.indexOf(o),v=K.useMemo(()=>({sortable:{containerId:d,index:k,items:u},...r}),[d,r,k,u]),_=K.useMemo(()=>u.slice(u.indexOf(o)),[u,o]),{rect:I,node:x,isOver:N,setNodeRef:R}=Sit({id:o,data:v,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...A}}),{active:T,activatorEvent:O,activeNodeRect:$,attributes:F,setNodeRef:L,listeners:M,isDragging:P,over:D,setActivatorNodeRef:q,transform:U}=_it({id:o,data:v,attributes:{...Jit,...n},disabled:E.draggable}),G=frt(R,L),H=!!T,j=H&&!g&&ZQ(p)&&ZQ(b),Z=!y&&P,J=Z&&j?U:null,ee=j?J??(s??w)({rects:h,activeNodeRect:$,activeIndex:p,overIndex:b,index:k}):null,pe=ZQ(p)&&ZQ(b)?i({id:o,items:u,activeIndex:p,overIndex:b}):k,ie=T?.id,re=K.useRef({activeId:ie,items:u,newIndex:pe,containerId:d}),ne=u!==re.current.items,te=e({active:T,containerId:d,isDragging:P,isSorting:H,id:o,index:k,items:u,newIndex:re.current.newIndex,previousItems:re.current.items,previousContainerId:re.current.containerId,transition:l,wasDragging:re.current.activeId!=null}),le=Xit({disabled:!te,index:k,node:x,rect:I});return K.useEffect(()=>{H&&re.current.newIndex!==pe&&(re.current.newIndex=pe),d!==re.current.containerId&&(re.current.containerId=d),u!==re.current.items&&(re.current.items=u)},[H,pe,d,u]),K.useEffect(()=>{if(ie===re.current.activeId)return;if(ie!=null&&re.current.activeId==null){re.current.activeId=ie;return}const Be=setTimeout(()=>{re.current.activeId=ie},50);return()=>clearTimeout(Be)},[ie]),{active:T,activeIndex:p,attributes:F,data:v,rect:I,index:k,newIndex:pe,items:u,isOver:N,isSorting:H,isDragging:P,listeners:M,node:x,overIndex:b,over:D,setNodeRef:G,setActivatorNodeRef:q,setDroppableNodeRef:R,setDraggableNodeRef:L,transform:le??ee,transition:Ae()};function Ae(){if(le||ne&&re.current.newIndex===k)return Vit;if(!(Z&&!_S(O)||!l)&&(H||te))return Xf.Transition.toString({...l,property:EIe})}}function eot(t,e){var n,a;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(a=t?.droppable)!=null?a:e.droppable}}function FD(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const tot=[wa.Down,wa.Right,wa.Up,wa.Left],V5n=(t,e)=>{let{context:{active:n,collisionRect:a,droppableRects:r,droppableContainers:i,over:o,scrollableAncestors:s}}=e;if(tot.includes(t.code)){if(t.preventDefault(),!n||!a)return;const A=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=r.get(d.id);if(p)switch(t.code){case wa.Down:a.top<p.top&&A.push(d);break;case wa.Up:a.top>p.top&&A.push(d);break;case wa.Left:a.left>p.left&&A.push(d);break;case wa.Right:a.left<p.left&&A.push(d);break}});const l=Nrt({collisionRect:a,droppableRects:r,droppableContainers:A});let u=Xve(l,"id");if(u===o?.id&&l.length>1&&(u=l[1].id),u!=null){const d=i.get(n.id),p=i.get(u),m=p?r.get(p.id):null,g=p?.node.current;if(g&&m&&d&&p){const b=xS(g).some((_,I)=>s[I]!==_),y=BIe(d,p),w=not(d,p),E=b||!y?{x:0,y:0}:{x:w?a.width-m.width:0,y:w?a.height-m.height:0},k={x:m.left,y:m.top};return E.x&&E.y?k:qB(k,E)}}}};function BIe(t,e){return!FD(t)||!FD(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function not(t,e){return!FD(t)||!FD(e)||!BIe(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const J5n="/assets/worker-NULm4lOi.js";var NS="Collapsible",[aot]=Cl(NS),[rot,cZ]=aot(NS),kIe=K.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:a,defaultOpen:r,disabled:i,onOpenChange:o,...s}=t,[A,l]=Dm({prop:a,defaultProp:r??!1,onChange:o,caller:NS});return be.jsx(rot,{scope:n,disabled:i,contentId:xo(),open:A,onOpenToggle:K.useCallback(()=>l(u=>!u),[l]),children:be.jsx(zn.div,{"data-state":uZ(A),"data-disabled":i?"":void 0,...s,ref:e})})});kIe.displayName=NS;var vIe="CollapsibleTrigger",iot=K.forwardRef((t,e)=>{const{__scopeCollapsible:n,...a}=t,r=cZ(vIe,n);return be.jsx(zn.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":uZ(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...a,ref:e,onClick:on(t.onClick,r.onOpenToggle)})});iot.displayName=vIe;var lZ="CollapsibleContent",oot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=cZ(lZ,t.__scopeCollapsible);return be.jsx(vs,{present:n||r.open,children:({present:i})=>be.jsx(sot,{...a,ref:e,present:i})})});oot.displayName=lZ;var sot=K.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:a,children:r,...i}=t,o=cZ(lZ,n),[s,A]=K.useState(a),l=K.useRef(null),u=ca(e,l),d=K.useRef(0),p=d.current,m=K.useRef(0),g=m.current,h=o.open||s,b=K.useRef(h),y=K.useRef(void 0);return K.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),io(()=>{const w=l.current;if(w){y.current=y.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const E=w.getBoundingClientRect();d.current=E.height,m.current=E.width,b.current||(w.style.transitionDuration=y.current.transitionDuration,w.style.animationName=y.current.animationName),A(a)}},[o.open,a]),be.jsx(zn.div,{"data-state":uZ(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!h,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:h&&r})});function uZ(t){return t?"open":"closed"}var X5n=kIe;function Y$(t,[e,n]){return Math.min(n,Math.max(e,t))}var Aot=[" ","Enter","ArrowUp","ArrowDown"],cot=[" ","Enter"],e0="Select",[FS,TS,lot]=BK(e0),[I1]=Cl(e0,[lot,g1]),RS=g1(),[uot,og]=I1(e0),[dot,pot]=I1(e0),IIe=t=>{const{__scopeSelect:e,children:n,open:a,defaultOpen:r,onOpenChange:i,value:o,defaultValue:s,onValueChange:A,dir:l,name:u,autoComplete:d,disabled:p,required:m,form:g}=t,h=RS(e),[b,y]=K.useState(null),[w,E]=K.useState(null),[k,v]=K.useState(!1),_=sS(l),[I,x]=Dm({prop:a,defaultProp:r??!1,onChange:i,caller:e0}),[N,R]=Dm({prop:o,defaultProp:s,onChange:A,caller:e0}),T=K.useRef(null),O=b?g||!!b.closest("form"):!0,[$,F]=K.useState(new Set),L=Array.from($).map(M=>M.props.value).join(";");return be.jsx(mK,{...h,children:be.jsxs(uot,{required:m,scope:e,trigger:b,onTriggerChange:y,valueNode:w,onValueNodeChange:E,valueNodeHasChildren:k,onValueNodeHasChildrenChange:v,contentId:xo(),value:N,onValueChange:R,open:I,onOpenChange:x,dir:_,triggerPointerDownPosRef:T,disabled:p,children:[be.jsx(FS.Provider,{scope:e,children:be.jsx(dot,{scope:t.__scopeSelect,onNativeOptionAdd:K.useCallback(M=>{F(P=>new Set(P).add(M))},[]),onNativeOptionRemove:K.useCallback(M=>{F(P=>{const D=new Set(P);return D.delete(M),D})},[]),children:n})}),O?be.jsxs(ZIe,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:d,value:N,onChange:M=>R(M.target.value),disabled:p,form:g,children:[N===void 0?be.jsx("option",{value:""}):null,Array.from($)]},L):null]})})};IIe.displayName=e0;var QIe="SelectTrigger",_Ie=K.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:a=!1,...r}=t,i=RS(n),o=og(QIe,n),s=o.disabled||a,A=ca(e,o.onTriggerChange),l=TS(n),u=K.useRef("touch"),[d,p,m]=VIe(h=>{const b=l().filter(E=>!E.disabled),y=b.find(E=>E.value===o.value),w=JIe(b,h,y);w!==void 0&&o.onValueChange(w.value)}),g=h=>{s||(o.onOpenChange(!0),m()),h&&(o.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return be.jsx(gK,{asChild:!0,...i,children:be.jsx(zn.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":WIe(o.value)?"":void 0,...r,ref:A,onClick:on(r.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&g(h)}),onPointerDown:on(r.onPointerDown,h=>{u.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(g(h),h.preventDefault())}),onKeyDown:on(r.onKeyDown,h=>{const b=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(b&&h.key===" ")&&Aot.includes(h.key)&&(g(),h.preventDefault())})})})});_Ie.displayName=QIe;var xIe="SelectValue",DIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,className:a,style:r,children:i,placeholder:o="",...s}=t,A=og(xIe,n),{onValueNodeHasChildrenChange:l}=A,u=i!==void 0,d=ca(e,A.onValueNodeChange);return io(()=>{l(u)},[l,u]),be.jsx(zn.span,{...s,ref:d,style:{pointerEvents:"none"},children:WIe(A.value)?be.jsx(be.Fragment,{children:o}):i})});DIe.displayName=xIe;var mot="SelectIcon",SIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,children:a,...r}=t;return be.jsx(zn.span,{"aria-hidden":!0,...r,ref:e,children:a||"▼"})});SIe.displayName=mot;var got="SelectPortal",NIe=t=>be.jsx(Xk,{asChild:!0,...t});NIe.displayName=got;var t0="SelectContent",FIe=K.forwardRef((t,e)=>{const n=og(t0,t.__scopeSelect),[a,r]=K.useState();if(io(()=>{r(new DocumentFragment)},[]),!n.open){const i=a;return i?Xl.createPortal(be.jsx(TIe,{scope:t.__scopeSelect,children:be.jsx(FS.Slot,{scope:t.__scopeSelect,children:be.jsx("div",{children:t.children})})}),i):null}return be.jsx(RIe,{...t,ref:e})});FIe.displayName=t0;var jc=10,[TIe,sg]=I1(t0),fot="SelectContentImpl",hot=C2("SelectContent.RemoveScroll"),RIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:o,side:s,sideOffset:A,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:h,avoidCollisions:b,...y}=t,w=og(t0,n),[E,k]=K.useState(null),[v,_]=K.useState(null),I=ca(e,ee=>k(ee)),[x,N]=K.useState(null),[R,T]=K.useState(null),O=TS(n),[$,F]=K.useState(!1),L=K.useRef(!1);K.useEffect(()=>{if(E)return vK(E)},[E]),kK();const M=K.useCallback(ee=>{const[pe,...ie]=O().map(te=>te.ref.current),[re]=ie.slice(-1),ne=document.activeElement;for(const te of ee)if(te===ne||(te?.scrollIntoView({block:"nearest"}),te===pe&&v&&(v.scrollTop=0),te===re&&v&&(v.scrollTop=v.scrollHeight),te?.focus(),document.activeElement!==ne))return},[O,v]),P=K.useCallback(()=>M([x,E]),[M,x,E]);K.useEffect(()=>{$&&P()},[$,P]);const{onOpenChange:D,triggerPointerDownPosRef:q}=w;K.useEffect(()=>{if(E){let ee={x:0,y:0};const pe=re=>{ee={x:Math.abs(Math.round(re.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(re.pageY)-(q.current?.y??0))}},ie=re=>{ee.x<=10&&ee.y<=10?re.preventDefault():E.contains(re.target)||D(!1),document.removeEventListener("pointermove",pe),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",ie,{capture:!0})}}},[E,D,q]),K.useEffect(()=>{const ee=()=>D(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[D]);const[U,G]=VIe(ee=>{const pe=O().filter(ne=>!ne.disabled),ie=pe.find(ne=>ne.ref.current===document.activeElement),re=JIe(pe,ee,ie);re&&setTimeout(()=>re.ref.current.focus())}),H=K.useCallback((ee,pe,ie)=>{const re=!L.current&&!ie;(w.value!==void 0&&w.value===pe||re)&&(N(ee),re&&(L.current=!0))},[w.value]),j=K.useCallback(()=>E?.focus(),[E]),Z=K.useCallback((ee,pe,ie)=>{const re=!L.current&&!ie;(w.value!==void 0&&w.value===pe||re)&&T(ee)},[w.value]),J=a==="popper"?K$:MIe,ae=J===K$?{side:s,sideOffset:A,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:h,avoidCollisions:b}:{};return be.jsx(TIe,{scope:n,content:E,viewport:v,onViewportChange:_,itemRefCallback:H,selectedItem:x,onItemLeave:j,itemTextRefCallback:Z,focusSelectedItem:P,selectedItemText:R,position:a,isPositioned:$,searchRef:U,children:be.jsx(lS,{as:hot,allowPinchZoom:!0,children:be.jsx(AS,{asChild:!0,trapped:w.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:on(r,ee=>{w.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:be.jsx(Vk,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:be.jsx(J,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:ee=>ee.preventDefault(),...y,...ae,onPlaced:()=>F(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:on(y.onKeyDown,ee=>{const pe=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!pe&&ee.key.length===1&&G(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let re=O().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const ne=ee.target,te=re.indexOf(ne);re=re.slice(te+1)}setTimeout(()=>M(re)),ee.preventDefault()}})})})})})})});RIe.displayName=fot;var bot="SelectItemAlignedPosition",MIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:a,...r}=t,i=og(t0,n),o=sg(t0,n),[s,A]=K.useState(null),[l,u]=K.useState(null),d=ca(e,I=>u(I)),p=TS(n),m=K.useRef(!1),g=K.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:y,focusSelectedItem:w}=o,E=K.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&l&&h&&b&&y){const I=i.trigger.getBoundingClientRect(),x=l.getBoundingClientRect(),N=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const ne=R.left-x.left,te=N.left-ne,le=I.left-te,Ae=I.width+le,Be=Math.max(Ae,x.width),de=window.innerWidth-jc,Ge=Y$(te,[jc,Math.max(jc,de-Be)]);s.style.minWidth=Ae+"px",s.style.left=Ge+"px"}else{const ne=x.right-R.right,te=window.innerWidth-N.right-ne,le=window.innerWidth-I.right-te,Ae=I.width+le,Be=Math.max(Ae,x.width),de=window.innerWidth-jc,Ge=Y$(te,[jc,Math.max(jc,de-Be)]);s.style.minWidth=Ae+"px",s.style.right=Ge+"px"}const T=p(),O=window.innerHeight-jc*2,$=h.scrollHeight,F=window.getComputedStyle(l),L=parseInt(F.borderTopWidth,10),M=parseInt(F.paddingTop,10),P=parseInt(F.borderBottomWidth,10),D=parseInt(F.paddingBottom,10),q=L+M+$+D+P,U=Math.min(b.offsetHeight*5,q),G=window.getComputedStyle(h),H=parseInt(G.paddingTop,10),j=parseInt(G.paddingBottom,10),Z=I.top+I.height/2-jc,J=O-Z,ae=b.offsetHeight/2,ee=b.offsetTop+ae,pe=L+M+ee,ie=q-pe;if(pe<=Z){const ne=T.length>0&&b===T[T.length-1].ref.current;s.style.bottom="0px";const te=l.clientHeight-h.offsetTop-h.offsetHeight,le=Math.max(J,ae+(ne?j:0)+te+P),Ae=pe+le;s.style.height=Ae+"px"}else{const ne=T.length>0&&b===T[0].ref.current;s.style.top="0px";const le=Math.max(Z,L+h.offsetTop+(ne?H:0)+ae)+ie;s.style.height=le+"px",h.scrollTop=pe-Z+h.offsetTop}s.style.margin=`${jc}px 0`,s.style.minHeight=U+"px",s.style.maxHeight=O+"px",a?.(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,s,l,h,b,y,i.dir,a]);io(()=>E(),[E]);const[k,v]=K.useState();io(()=>{l&&v(window.getComputedStyle(l).zIndex)},[l]);const _=K.useCallback(I=>{I&&g.current===!0&&(E(),w?.(),g.current=!1)},[E,w]);return be.jsx(Cot,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:_,children:be.jsx("div",{ref:A,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:be.jsx(zn.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});MIe.displayName=bot;var yot="SelectPopperPosition",K$=K.forwardRef((t,e)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=jc,...i}=t,o=RS(n);return be.jsx(fK,{...o,...i,ref:e,align:a,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});K$.displayName=yot;var[Cot,dZ]=I1(t0,{}),Z$="SelectViewport",LIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:a,...r}=t,i=sg(Z$,n),o=dZ(Z$,n),s=ca(e,i.onViewportChange),A=K.useRef(0);return be.jsxs(be.Fragment,{children:[be.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),be.jsx(FS.Slot,{scope:n,children:be.jsx(zn.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:on(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=o;if(p?.current&&d){const m=Math.abs(A.current-u.scrollTop);if(m>0){const g=window.innerHeight-jc*2,h=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(h,b);if(y<g){const w=y+m,E=Math.min(g,w),k=w-E;d.style.height=E+"px",d.style.bottom==="0px"&&(u.scrollTop=k>0?k:0,d.style.justifyContent="flex-end")}}}A.current=u.scrollTop})})})]})});LIe.displayName=Z$;var OIe="SelectGroup",[wot,Eot]=I1(OIe),GIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,r=xo();return be.jsx(wot,{scope:n,id:r,children:be.jsx(zn.div,{role:"group","aria-labelledby":r,...a,ref:e})})});GIe.displayName=OIe;var PIe="SelectLabel",qIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,r=Eot(PIe,n);return be.jsx(zn.div,{id:r.id,...a,ref:e})});qIe.displayName=PIe;var TD="SelectItem",[Bot,UIe]=I1(TD),$Ie=K.forwardRef((t,e)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:i,...o}=t,s=og(TD,n),A=sg(TD,n),l=s.value===a,[u,d]=K.useState(i??""),[p,m]=K.useState(!1),g=ca(e,w=>A.itemRefCallback?.(w,a,r)),h=xo(),b=K.useRef("touch"),y=()=>{r||(s.onValueChange(a),s.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return be.jsx(Bot,{scope:n,value:a,disabled:r,textId:h,isSelected:l,onItemTextChange:K.useCallback(w=>{d(E=>E||(w?.textContent??"").trim())},[]),children:be.jsx(FS.ItemSlot,{scope:n,value:a,disabled:r,textValue:u,children:be.jsx(zn.div,{role:"option","aria-labelledby":h,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,ref:g,onFocus:on(o.onFocus,()=>m(!0)),onBlur:on(o.onBlur,()=>m(!1)),onClick:on(o.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:on(o.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:on(o.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:on(o.onPointerMove,w=>{b.current=w.pointerType,r?A.onItemLeave?.():b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:on(o.onPointerLeave,w=>{w.currentTarget===document.activeElement&&A.onItemLeave?.()}),onKeyDown:on(o.onKeyDown,w=>{A.searchRef?.current!==""&&w.key===" "||(cot.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});$Ie.displayName=TD;var Pw="SelectItemText",jIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,className:a,style:r,...i}=t,o=og(Pw,n),s=sg(Pw,n),A=UIe(Pw,n),l=pot(Pw,n),[u,d]=K.useState(null),p=ca(e,y=>d(y),A.onItemTextChange,y=>s.itemTextRefCallback?.(y,A.value,A.disabled)),m=u?.textContent,g=K.useMemo(()=>be.jsx("option",{value:A.value,disabled:A.disabled,children:m},A.value),[A.disabled,A.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=l;return io(()=>(h(g),()=>b(g)),[h,b,g]),be.jsxs(be.Fragment,{children:[be.jsx(zn.span,{id:A.textId,...i,ref:p}),A.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Xl.createPortal(i.children,o.valueNode):null]})});jIe.displayName=Pw;var HIe="SelectItemIndicator",zIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t;return UIe(HIe,n).isSelected?be.jsx(zn.span,{"aria-hidden":!0,...a,ref:e}):null});zIe.displayName=HIe;var W$="SelectScrollUpButton",kot=K.forwardRef((t,e)=>{const n=sg(W$,t.__scopeSelect),a=dZ(W$,t.__scopeSelect),[r,i]=K.useState(!1),o=ca(e,a.onScrollButtonChange);return io(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=A.scrollTop>0;i(l)};const A=n.viewport;return s(),A.addEventListener("scroll",s),()=>A.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?be.jsx(YIe,{...t,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:A}=n;s&&A&&(s.scrollTop=s.scrollTop-A.offsetHeight)}}):null});kot.displayName=W$;var V$="SelectScrollDownButton",vot=K.forwardRef((t,e)=>{const n=sg(V$,t.__scopeSelect),a=dZ(V$,t.__scopeSelect),[r,i]=K.useState(!1),o=ca(e,a.onScrollButtonChange);return io(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=A.scrollHeight-A.clientHeight,u=Math.ceil(A.scrollTop)<l;i(u)};const A=n.viewport;return s(),A.addEventListener("scroll",s),()=>A.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?be.jsx(YIe,{...t,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:A}=n;s&&A&&(s.scrollTop=s.scrollTop+A.offsetHeight)}}):null});vot.displayName=V$;var YIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=t,i=sg("SelectScrollButton",n),o=K.useRef(null),s=TS(n),A=K.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return K.useEffect(()=>()=>A(),[A]),io(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),be.jsx(zn.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:on(r.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(a,50))}),onPointerMove:on(r.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(a,50))}),onPointerLeave:on(r.onPointerLeave,()=>{A()})})}),Iot="SelectSeparator",KIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t;return be.jsx(zn.div,{"aria-hidden":!0,...a,ref:e})});KIe.displayName=Iot;var J$="SelectArrow",Qot=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,r=RS(n),i=og(J$,n),o=sg(J$,n);return i.open&&o.position==="popper"?be.jsx(hK,{...r,...a,ref:e}):null});Qot.displayName=J$;var _ot="SelectBubbleInput",ZIe=K.forwardRef(({__scopeSelect:t,value:e,...n},a)=>{const r=K.useRef(null),i=ca(a,r),o=yve(e);return K.useEffect(()=>{const s=r.current;if(!s)return;const A=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(A,"value").set;if(o!==e&&u){const d=new Event("change",{bubbles:!0});u.call(s,e),s.dispatchEvent(d)}},[o,e]),be.jsx(zn.select,{...n,style:{...AEe,...n.style},ref:i,defaultValue:e})});ZIe.displayName=_ot;function WIe(t){return t===""||t===void 0}function VIe(t){const e=Io(t),n=K.useRef(""),a=K.useRef(0),r=K.useCallback(o=>{const s=n.current+o;e(s),(function A(l){n.current=l,window.clearTimeout(a.current),l!==""&&(a.current=window.setTimeout(()=>A(""),1e3))})(s)},[e]),i=K.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return K.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,r,i]}function JIe(t,e,n){const r=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=xot(t,Math.max(i,0));r.length===1&&(o=o.filter(l=>l!==n));const A=o.find(l=>l.textValue.toLowerCase().startsWith(r.toLowerCase()));return A!==n?A:void 0}function xot(t,e){return t.map((n,a)=>t[(e+a)%t.length])}var eNn=IIe,tNn=_Ie,nNn=DIe,aNn=SIe,rNn=NIe,iNn=FIe,oNn=LIe,sNn=GIe,ANn=qIe,cNn=$Ie,lNn=jIe,uNn=zIe,dNn=KIe;const Loe=t=>Symbol.iterator in t,Ooe=t=>"entries"in t,Goe=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),a=e instanceof Map?e:new Map(e.entries());if(n.size!==a.size)return!1;for(const[r,i]of n)if(!a.has(r)||!Object.is(i,a.get(r)))return!1;return!0},Dot=(t,e)=>{const n=t[Symbol.iterator](),a=e[Symbol.iterator]();let r=n.next(),i=a.next();for(;!r.done&&!i.done;){if(!Object.is(r.value,i.value))return!1;r=n.next(),i=a.next()}return!!r.done&&!!i.done};function Sot(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Loe(t)&&Loe(e)?Ooe(t)&&Ooe(e)?Goe(t,e):Dot(t,e):Goe({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function pNn(t){const e=Ce.useRef(void 0);return n=>{const a=t(n);return Sot(e.current,a)?e.current:e.current=a}}function Not(t,e){return K.useReducer((n,a)=>e[n][a]??n,t)}var pZ="ScrollArea",[XIe]=Cl(pZ),[Fot,Mc]=XIe(pZ),eQe=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:a="hover",dir:r,scrollHideDelay:i=600,...o}=t,[s,A]=K.useState(null),[l,u]=K.useState(null),[d,p]=K.useState(null),[m,g]=K.useState(null),[h,b]=K.useState(null),[y,w]=K.useState(0),[E,k]=K.useState(0),[v,_]=K.useState(!1),[I,x]=K.useState(!1),N=ca(e,T=>A(T)),R=sS(r);return be.jsx(Fot,{scope:n,type:a,dir:R,scrollHideDelay:i,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:v,onScrollbarXEnabledChange:_,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:I,onScrollbarYEnabledChange:x,onCornerWidthChange:w,onCornerHeightChange:k,children:be.jsx(zn.div,{dir:R,...o,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":E+"px",...t.style}})})});eQe.displayName=pZ;var tQe="ScrollAreaViewport",nQe=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:a,nonce:r,...i}=t,o=Mc(tQe,n),s=K.useRef(null),A=ca(e,s,o.onViewportChange);return be.jsxs(be.Fragment,{children:[be.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),be.jsx(zn.div,{"data-radix-scroll-area-viewport":"",...i,ref:A,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style},children:be.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});nQe.displayName=tQe;var Iu="ScrollAreaScrollbar",Tot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=Mc(Iu,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=r,s=t.orientation==="horizontal";return K.useEffect(()=>(s?i(!0):o(!0),()=>{s?i(!1):o(!1)}),[s,i,o]),r.type==="hover"?be.jsx(Rot,{...a,ref:e,forceMount:n}):r.type==="scroll"?be.jsx(Mot,{...a,ref:e,forceMount:n}):r.type==="auto"?be.jsx(aQe,{...a,ref:e,forceMount:n}):r.type==="always"?be.jsx(mZ,{...a,ref:e}):null});Tot.displayName=Iu;var Rot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=Mc(Iu,t.__scopeScrollArea),[i,o]=K.useState(!1);return K.useEffect(()=>{const s=r.scrollArea;let A=0;if(s){const l=()=>{window.clearTimeout(A),o(!0)},u=()=>{A=window.setTimeout(()=>o(!1),r.scrollHideDelay)};return s.addEventListener("pointerenter",l),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(A),s.removeEventListener("pointerenter",l),s.removeEventListener("pointerleave",u)}}},[r.scrollArea,r.scrollHideDelay]),be.jsx(vs,{present:n||i,children:be.jsx(aQe,{"data-state":i?"visible":"hidden",...a,ref:e})})}),Mot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=Mc(Iu,t.__scopeScrollArea),i=t.orientation==="horizontal",o=LS(()=>A("SCROLL_END"),100),[s,A]=Not("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return K.useEffect(()=>{if(s==="idle"){const l=window.setTimeout(()=>A("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(l)}},[s,r.scrollHideDelay,A]),K.useEffect(()=>{const l=r.viewport,u=i?"scrollLeft":"scrollTop";if(l){let d=l[u];const p=()=>{const m=l[u];d!==m&&(A("SCROLL"),o()),d=m};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[r.viewport,i,A,o]),be.jsx(vs,{present:n||s!=="hidden",children:be.jsx(mZ,{"data-state":s==="hidden"?"hidden":"visible",...a,ref:e,onPointerEnter:on(t.onPointerEnter,()=>A("POINTER_ENTER")),onPointerLeave:on(t.onPointerLeave,()=>A("POINTER_LEAVE"))})})}),aQe=K.forwardRef((t,e)=>{const n=Mc(Iu,t.__scopeScrollArea),{forceMount:a,...r}=t,[i,o]=K.useState(!1),s=t.orientation==="horizontal",A=LS(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?l:u)}},10);return k2(n.viewport,A),k2(n.content,A),be.jsx(vs,{present:a||i,children:be.jsx(mZ,{"data-state":i?"visible":"hidden",...r,ref:e})})}),mZ=K.forwardRef((t,e)=>{const{orientation:n="vertical",...a}=t,r=Mc(Iu,t.__scopeScrollArea),i=K.useRef(null),o=K.useRef(0),[s,A]=K.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=sQe(s.viewport,s.content),u={...a,sizes:s,onSizesChange:A,hasThumb:l>0&&l<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function d(p,m){return $ot(p,o.current,s,m)}return n==="horizontal"?be.jsx(Lot,{...u,ref:e,onThumbPositionChange:()=>{if(r.viewport&&i.current){const p=r.viewport.scrollLeft,m=Poe(p,s,r.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollLeft=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollLeft=d(p,r.dir))}}):n==="vertical"?be.jsx(Oot,{...u,ref:e,onThumbPositionChange:()=>{if(r.viewport&&i.current){const p=r.viewport.scrollTop,m=Poe(p,s);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollTop=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollTop=d(p))}}):null}),Lot=K.forwardRef((t,e)=>{const{sizes:n,onSizesChange:a,...r}=t,i=Mc(Iu,t.__scopeScrollArea),[o,s]=K.useState(),A=K.useRef(null),l=ca(e,A,i.onScrollbarXChange);return K.useEffect(()=>{A.current&&s(getComputedStyle(A.current))},[A]),be.jsx(iQe,{"data-orientation":"horizontal",...r,ref:l,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":MS(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.x),onDragScroll:u=>t.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;t.onWheelScroll(p),cQe(p,d)&&u.preventDefault()}},onResize:()=>{A.current&&i.viewport&&o&&a({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:A.current.clientWidth,paddingStart:MD(o.paddingLeft),paddingEnd:MD(o.paddingRight)}})}})}),Oot=K.forwardRef((t,e)=>{const{sizes:n,onSizesChange:a,...r}=t,i=Mc(Iu,t.__scopeScrollArea),[o,s]=K.useState(),A=K.useRef(null),l=ca(e,A,i.onScrollbarYChange);return K.useEffect(()=>{A.current&&s(getComputedStyle(A.current))},[A]),be.jsx(iQe,{"data-orientation":"vertical",...r,ref:l,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":MS(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.y),onDragScroll:u=>t.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;t.onWheelScroll(p),cQe(p,d)&&u.preventDefault()}},onResize:()=>{A.current&&i.viewport&&o&&a({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:A.current.clientHeight,paddingStart:MD(o.paddingTop),paddingEnd:MD(o.paddingBottom)}})}})}),[Got,rQe]=XIe(Iu),iQe=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:r,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:A,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=t,m=Mc(Iu,n),[g,h]=K.useState(null),b=ca(e,N=>h(N)),y=K.useRef(null),w=K.useRef(""),E=m.viewport,k=a.content-a.viewport,v=Io(u),_=Io(A),I=LS(d,10);function x(N){if(y.current){const R=N.clientX-y.current.left,T=N.clientY-y.current.top;l({x:R,y:T})}}return K.useEffect(()=>{const N=R=>{const T=R.target;g?.contains(T)&&v(R,k)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[E,g,k,v]),K.useEffect(_,[a,_]),k2(g,I),k2(m.content,I),be.jsx(Got,{scope:n,scrollbar:g,hasThumb:r,onThumbChange:Io(i),onThumbPointerUp:Io(o),onThumbPositionChange:_,onThumbPointerDown:Io(s),children:be.jsx(zn.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:on(t.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),y.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),x(N))}),onPointerMove:on(t.onPointerMove,x),onPointerUp:on(t.onPointerUp,N=>{const R=N.target;R.hasPointerCapture(N.pointerId)&&R.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=w.current,m.viewport&&(m.viewport.style.scrollBehavior=""),y.current=null})})})}),RD="ScrollAreaThumb",Pot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=rQe(RD,t.__scopeScrollArea);return be.jsx(vs,{present:n||r.hasThumb,children:be.jsx(qot,{ref:e,...a})})}),qot=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:a,...r}=t,i=Mc(RD,n),o=rQe(RD,n),{onThumbPositionChange:s}=o,A=ca(e,d=>o.onThumbChange(d)),l=K.useRef(void 0),u=LS(()=>{l.current&&(l.current(),l.current=void 0)},100);return K.useEffect(()=>{const d=i.viewport;if(d){const p=()=>{if(u(),!l.current){const m=jot(d,s);l.current=m,s()}};return s(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[i.viewport,u,s]),be.jsx(zn.div,{"data-state":o.hasThumb?"visible":"hidden",...r,ref:A,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:on(t.onPointerDownCapture,d=>{const m=d.target.getBoundingClientRect(),g=d.clientX-m.left,h=d.clientY-m.top;o.onThumbPointerDown({x:g,y:h})}),onPointerUp:on(t.onPointerUp,o.onThumbPointerUp)})});Pot.displayName=RD;var gZ="ScrollAreaCorner",oQe=K.forwardRef((t,e)=>{const n=Mc(gZ,t.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?be.jsx(Uot,{...t,ref:e}):null});oQe.displayName=gZ;var Uot=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,...a}=t,r=Mc(gZ,n),[i,o]=K.useState(0),[s,A]=K.useState(0),l=!!(i&&s);return k2(r.scrollbarX,()=>{const u=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(u),A(u)}),k2(r.scrollbarY,()=>{const u=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(u),o(u)}),l?be.jsx(zn.div,{...a,ref:e,style:{width:i,height:s,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function MD(t){return t?parseInt(t,10):0}function sQe(t,e){const n=t/e;return isNaN(n)?0:n}function MS(t){const e=sQe(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=(t.scrollbar.size-n)*e;return Math.max(a,18)}function $ot(t,e,n,a="ltr"){const r=MS(n),i=r/2,o=e||i,s=r-o,A=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=a==="ltr"?[0,u]:[u*-1,0];return AQe([A,l],d)(t)}function Poe(t,e,n="ltr"){const a=MS(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-r,o=e.content-e.viewport,s=i-a,A=n==="ltr"?[0,o]:[o*-1,0],l=Y$(t,A);return AQe([0,o],[0,s])(l)}function AQe(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const a=(e[1]-e[0])/(t[1]-t[0]);return e[0]+a*(n-t[0])}}function cQe(t,e){return t>0&&t<e}var jot=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},a=0;return(function r(){const i={left:t.scrollLeft,top:t.scrollTop},o=n.left!==i.left,s=n.top!==i.top;(o||s)&&e(),n=i,a=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(a)};function LS(t,e){const n=Io(t),a=K.useRef(0);return K.useEffect(()=>()=>window.clearTimeout(a.current),[]),K.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,e)},[n,e])}function k2(t,e){const n=Io(e);io(()=>{let a=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(a),r.unobserve(t)}}},[t,n])}var mNn=eQe,gNn=nQe,fNn=oQe;const fZ=K.createContext({});function hZ(t){const e=K.useRef(null);return e.current===null&&(e.current=t()),e.current}const bZ=typeof window<"u",lQe=bZ?K.useLayoutEffect:K.useEffect,OS=K.createContext(null);function yZ(t,e){t.indexOf(e)===-1&&t.push(e)}function CZ(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Yd=(t,e,n)=>n>e?e:n<t?t:n;let wZ=()=>{};const Kd={},uQe=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function dQe(t){return typeof t=="object"&&t!==null}const pQe=t=>/^0[^.\s]+$/u.test(t);function EZ(t){let e;return()=>(e===void 0&&(e=t()),e)}const Bc=t=>t,Hot=(t,e)=>n=>e(t(n)),mv=(...t)=>t.reduce(Hot),$B=(t,e,n)=>{const a=e-t;return a===0?1:(n-t)/a};class BZ{constructor(){this.subscriptions=[]}add(e){return yZ(this.subscriptions,e),()=>CZ(this.subscriptions,e)}notify(e,n,a){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,a);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(e,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const uu=t=>t*1e3,hc=t=>t/1e3;function mQe(t,e){return e?t*(1e3/e):0}const gQe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,zot=1e-7,Yot=12;function Kot(t,e,n,a,r){let i,o,s=0;do o=e+(n-e)/2,i=gQe(o,a,r)-t,i>0?n=o:e=o;while(Math.abs(i)>zot&&++s<Yot);return o}function gv(t,e,n,a){if(t===e&&n===a)return Bc;const r=i=>Kot(i,0,1,t,n);return i=>i===0||i===1?i:gQe(r(i),e,a)}const fQe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,hQe=t=>e=>1-t(1-e),bQe=gv(.33,1.53,.69,.99),kZ=hQe(bQe),yQe=fQe(kZ),CQe=t=>(t*=2)<1?.5*kZ(t):.5*(2-Math.pow(2,-10*(t-1))),vZ=t=>1-Math.sin(Math.acos(t)),wQe=hQe(vZ),EQe=fQe(vZ),Zot=gv(.42,0,1,1),Wot=gv(0,0,.58,1),BQe=gv(.42,0,.58,1),Vot=t=>Array.isArray(t)&&typeof t[0]!="number",kQe=t=>Array.isArray(t)&&typeof t[0]=="number",Jot={linear:Bc,easeIn:Zot,easeInOut:BQe,easeOut:Wot,circIn:vZ,circInOut:EQe,circOut:wQe,backIn:kZ,backInOut:yQe,backOut:bQe,anticipate:CQe},Xot=t=>typeof t=="string",qoe=t=>{if(kQe(t)){wZ(t.length===4);const[e,n,a,r]=t;return gv(e,n,a,r)}else if(Xot(t))return Jot[t];return t},VQ=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function est(t,e){let n=new Set,a=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function A(u){o.has(u)&&(l.schedule(u),t()),u(s)}const l={schedule:(u,d=!1,p=!1)=>{const g=p&&r?n:a;return d&&o.add(u),g.has(u)||g.add(u),u},cancel:u=>{a.delete(u),o.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[n,a]=[a,n],n.forEach(A),n.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const tst=40;function vQe(t,e){let n=!1,a=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=VQ.reduce((E,k)=>(E[k]=est(i),E),{}),{setup:s,read:A,resolveKeyframes:l,preUpdate:u,update:d,preRender:p,render:m,postRender:g}=o,h=()=>{const E=Kd.useManualTiming?r.timestamp:performance.now();n=!1,Kd.useManualTiming||(r.delta=a?1e3/60:Math.max(Math.min(E-r.timestamp,tst),1)),r.timestamp=E,r.isProcessing=!0,s.process(r),A.process(r),l.process(r),u.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,n&&e&&(a=!1,t(h))},b=()=>{n=!0,a=!0,r.isProcessing||t(h)};return{schedule:VQ.reduce((E,k)=>{const v=o[k];return E[k]=(_,I=!1,x=!1)=>(n||b(),v.schedule(_,I,x)),E},{}),cancel:E=>{for(let k=0;k<VQ.length;k++)o[VQ[k]].cancel(E)},state:r,steps:o}}const{schedule:_r,cancel:Fm,state:Bo,steps:g9}=vQe(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bc,!0);let Nx;function nst(){Nx=void 0}const Js={now:()=>(Nx===void 0&&Js.set(Bo.isProcessing||Kd.useManualTiming?Bo.timestamp:performance.now()),Nx),set:t=>{Nx=t,queueMicrotask(nst)}},IQe=t=>e=>typeof e=="string"&&e.startsWith(t),QQe=IQe("--"),ast=IQe("var(--"),IZ=t=>ast(t)?rst.test(t.split("/*")[0].trim()):!1,rst=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Q1={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},jB={...Q1,transform:t=>Yd(0,1,t)},JQ={...Q1,default:1},XE=t=>Math.round(t*1e5)/1e5,QZ=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ist(t){return t==null}const ost=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,_Z=(t,e)=>n=>!!(typeof n=="string"&&ost.test(n)&&n.startsWith(t)||e&&!ist(n)&&Object.prototype.hasOwnProperty.call(n,e)),_Qe=(t,e,n)=>a=>{if(typeof a!="string")return a;const[r,i,o,s]=a.match(QZ);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},sst=t=>Yd(0,255,t),f9={...Q1,transform:t=>Math.round(sst(t))},xf={test:_Z("rgb","red"),parse:_Qe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:a=1})=>"rgba("+f9.transform(t)+", "+f9.transform(e)+", "+f9.transform(n)+", "+XE(jB.transform(a))+")"};function Ast(t){let e="",n="",a="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),a=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),a=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,a+=a,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:r?parseInt(r,16)/255:1}}const X$={test:_Z("#"),parse:Ast,transform:xf.transform},fv=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),em=fv("deg"),du=fv("%"),qn=fv("px"),cst=fv("vh"),lst=fv("vw"),Uoe={...du,parse:t=>du.parse(t)/100,transform:t=>du.transform(t*100)},Fb={test:_Z("hsl","hue"),parse:_Qe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:a=1})=>"hsla("+Math.round(t)+", "+du.transform(XE(e))+", "+du.transform(XE(n))+", "+XE(jB.transform(a))+")"},mi={test:t=>xf.test(t)||X$.test(t)||Fb.test(t),parse:t=>xf.test(t)?xf.parse(t):Fb.test(t)?Fb.parse(t):X$.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?xf.transform(t):Fb.transform(t),getAnimatableNone:t=>{const e=mi.parse(t);return e.alpha=0,mi.transform(e)}},ust=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function dst(t){return isNaN(t)&&typeof t=="string"&&(t.match(QZ)?.length||0)+(t.match(ust)?.length||0)>0}const xQe="number",DQe="color",pst="var",mst="var(",$oe="${}",gst=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function HB(t){const e=t.toString(),n=[],a={color:[],number:[],var:[]},r=[];let i=0;const s=e.replace(gst,A=>(mi.test(A)?(a.color.push(i),r.push(DQe),n.push(mi.parse(A))):A.startsWith(mst)?(a.var.push(i),r.push(pst),n.push(A)):(a.number.push(i),r.push(xQe),n.push(parseFloat(A))),++i,$oe)).split($oe);return{values:n,split:s,indexes:a,types:r}}function SQe(t){return HB(t).values}function NQe(t){const{split:e,types:n}=HB(t),a=e.length;return r=>{let i="";for(let o=0;o<a;o++)if(i+=e[o],r[o]!==void 0){const s=n[o];s===xQe?i+=XE(r[o]):s===DQe?i+=mi.transform(r[o]):i+=r[o]}return i}}const fst=t=>typeof t=="number"?0:mi.test(t)?mi.getAnimatableNone(t):t;function hst(t){const e=SQe(t);return NQe(t)(e.map(fst))}const Tm={test:dst,parse:SQe,createTransformer:NQe,getAnimatableNone:hst};function h9(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function bst({hue:t,saturation:e,lightness:n,alpha:a}){t/=360,e/=100,n/=100;let r=0,i=0,o=0;if(!e)r=i=o=n;else{const s=n<.5?n*(1+e):n+e-n*e,A=2*n-s;r=h9(A,s,t+1/3),i=h9(A,s,t),o=h9(A,s,t-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:a}}function LD(t,e){return n=>n>0?e:t}const Mr=(t,e,n)=>t+(e-t)*n,b9=(t,e,n)=>{const a=t*t,r=n*(e*e-a)+a;return r<0?0:Math.sqrt(r)},yst=[X$,xf,Fb],Cst=t=>yst.find(e=>e.test(t));function joe(t){const e=Cst(t);if(!e)return!1;let n=e.parse(t);return e===Fb&&(n=bst(n)),n}const Hoe=(t,e)=>{const n=joe(t),a=joe(e);if(!n||!a)return LD(t,e);const r={...n};return i=>(r.red=b9(n.red,a.red,i),r.green=b9(n.green,a.green,i),r.blue=b9(n.blue,a.blue,i),r.alpha=Mr(n.alpha,a.alpha,i),xf.transform(r))},ej=new Set(["none","hidden"]);function wst(t,e){return ej.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Est(t,e){return n=>Mr(t,e,n)}function xZ(t){return typeof t=="number"?Est:typeof t=="string"?IZ(t)?LD:mi.test(t)?Hoe:vst:Array.isArray(t)?FQe:typeof t=="object"?mi.test(t)?Hoe:Bst:LD}function FQe(t,e){const n=[...t],a=n.length,r=t.map((i,o)=>xZ(i)(i,e[o]));return i=>{for(let o=0;o<a;o++)n[o]=r[o](i);return n}}function Bst(t,e){const n={...t,...e},a={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(a[r]=xZ(t[r])(t[r],e[r]));return r=>{for(const i in a)n[i]=a[i](r);return n}}function kst(t,e){const n=[],a={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const i=e.types[r],o=t.indexes[i][a[i]],s=t.values[o]??0;n[r]=s,a[i]++}return n}const vst=(t,e)=>{const n=Tm.createTransformer(e),a=HB(t),r=HB(e);return a.indexes.var.length===r.indexes.var.length&&a.indexes.color.length===r.indexes.color.length&&a.indexes.number.length>=r.indexes.number.length?ej.has(t)&&!r.values.length||ej.has(e)&&!a.values.length?wst(t,e):mv(FQe(kst(a,r),r.values),n):LD(t,e)};function TQe(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Mr(t,e,n):xZ(t)(t,e)}const Ist=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>_r.update(e,n),stop:()=>Fm(e),now:()=>Bo.isProcessing?Bo.timestamp:Js.now()}},RQe=(t,e,n=10)=>{let a="";const r=Math.max(Math.round(e/n),2);for(let i=0;i<r;i++)a+=Math.round(t(i/(r-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},OD=2e4;function DZ(t){let e=0;const n=50;let a=t.next(e);for(;!a.done&&e<OD;)e+=n,a=t.next(e);return e>=OD?1/0:e}function Qst(t,e=100,n){const a=n({...t,keyframes:[0,e]}),r=Math.min(DZ(a),OD);return{type:"keyframes",ease:i=>a.next(r*i).value/e,duration:hc(r)}}const _st=5;function MQe(t,e,n){const a=Math.max(e-_st,0);return mQe(n-t(a),e-a)}const Ur={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},y9=.001;function xst({duration:t=Ur.duration,bounce:e=Ur.bounce,velocity:n=Ur.velocity,mass:a=Ur.mass}){let r,i,o=1-e;o=Yd(Ur.minDamping,Ur.maxDamping,o),t=Yd(Ur.minDuration,Ur.maxDuration,hc(t)),o<1?(r=l=>{const u=l*o,d=u*t,p=u-n,m=tj(l,o),g=Math.exp(-d);return y9-p/m*g},i=l=>{const d=l*o*t,p=d*n+n,m=Math.pow(o,2)*Math.pow(l,2)*t,g=Math.exp(-d),h=tj(Math.pow(l,2),o);return(-r(l)+y9>0?-1:1)*((p-m)*g)/h}):(r=l=>{const u=Math.exp(-l*t),d=(l-n)*t+1;return-y9+u*d},i=l=>{const u=Math.exp(-l*t),d=(n-l)*(t*t);return u*d});const s=5/t,A=Sst(r,i,s);if(t=uu(t),isNaN(A))return{stiffness:Ur.stiffness,damping:Ur.damping,duration:t};{const l=Math.pow(A,2)*a;return{stiffness:l,damping:o*2*Math.sqrt(a*l),duration:t}}}const Dst=12;function Sst(t,e,n){let a=n;for(let r=1;r<Dst;r++)a=a-t(a)/e(a);return a}function tj(t,e){return t*Math.sqrt(1-e*e)}const Nst=["duration","bounce"],Fst=["stiffness","damping","mass"];function zoe(t,e){return e.some(n=>t[n]!==void 0)}function Tst(t){let e={velocity:Ur.velocity,stiffness:Ur.stiffness,damping:Ur.damping,mass:Ur.mass,isResolvedFromDuration:!1,...t};if(!zoe(t,Fst)&&zoe(t,Nst))if(t.visualDuration){const n=t.visualDuration,a=2*Math.PI/(n*1.2),r=a*a,i=2*Yd(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Ur.mass,stiffness:r,damping:i}}else{const n=xst(t);e={...e,...n,mass:Ur.mass},e.isResolvedFromDuration=!0}return e}function GD(t=Ur.visualDuration,e=Ur.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:a,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:i},{stiffness:A,damping:l,mass:u,duration:d,velocity:p,isResolvedFromDuration:m}=Tst({...n,velocity:-hc(n.velocity||0)}),g=p||0,h=l/(2*Math.sqrt(A*u)),b=o-i,y=hc(Math.sqrt(A/u)),w=Math.abs(b)<5;a||(a=w?Ur.restSpeed.granular:Ur.restSpeed.default),r||(r=w?Ur.restDelta.granular:Ur.restDelta.default);let E;if(h<1){const v=tj(y,h);E=_=>{const I=Math.exp(-h*y*_);return o-I*((g+h*y*b)/v*Math.sin(v*_)+b*Math.cos(v*_))}}else if(h===1)E=v=>o-Math.exp(-y*v)*(b+(g+y*b)*v);else{const v=y*Math.sqrt(h*h-1);E=_=>{const I=Math.exp(-h*y*_),x=Math.min(v*_,300);return o-I*((g+h*y*b)*Math.sinh(x)+v*b*Math.cosh(x))/v}}const k={calculatedDuration:m&&d||null,next:v=>{const _=E(v);if(m)s.done=v>=d;else{let I=v===0?g:0;h<1&&(I=v===0?uu(g):MQe(E,v,_));const x=Math.abs(I)<=a,N=Math.abs(o-_)<=r;s.done=x&&N}return s.value=s.done?o:_,s},toString:()=>{const v=Math.min(DZ(k),OD),_=RQe(I=>k.next(v*I).value,v,30);return v+"ms "+_},toTransition:()=>{}};return k}GD.applyToOptions=t=>{const e=Qst(t,100,GD);return t.ease=e.ease,t.duration=uu(e.duration),t.type="keyframes",t};function nj({keyframes:t,velocity:e=0,power:n=.8,timeConstant:a=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:s,max:A,restDelta:l=.5,restSpeed:u}){const d=t[0],p={done:!1,value:d},m=x=>s!==void 0&&x<s||A!==void 0&&x>A,g=x=>s===void 0?A:A===void 0||Math.abs(s-x)<Math.abs(A-x)?s:A;let h=n*e;const b=d+h,y=o===void 0?b:o(b);y!==b&&(h=y-d);const w=x=>-h*Math.exp(-x/a),E=x=>y+w(x),k=x=>{const N=w(x),R=E(x);p.done=Math.abs(N)<=l,p.value=p.done?y:R};let v,_;const I=x=>{m(p.value)&&(v=x,_=GD({keyframes:[p.value,g(p.value)],velocity:MQe(E,x,p.value),damping:r,stiffness:i,restDelta:l,restSpeed:u}))};return I(0),{calculatedDuration:null,next:x=>{let N=!1;return!_&&v===void 0&&(N=!0,k(x),I(x)),v!==void 0&&x>=v?_.next(x-v):(!N&&k(x),p)}}}function Rst(t,e,n){const a=[],r=n||Kd.mix||TQe,i=t.length-1;for(let o=0;o<i;o++){let s=r(t[o],t[o+1]);if(e){const A=Array.isArray(e)?e[o]||Bc:e;s=mv(A,s)}a.push(s)}return a}function Mst(t,e,{clamp:n=!0,ease:a,mixer:r}={}){const i=t.length;if(wZ(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Rst(e,a,r),A=s.length,l=u=>{if(o&&u<t[0])return e[0];let d=0;if(A>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const p=$B(t[d],t[d+1],u);return s[d](p)};return n?u=>l(Yd(t[0],t[i-1],u)):l}function Lst(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const r=$B(0,e,a);t.push(Mr(n,1,r))}}function Ost(t){const e=[0];return Lst(e,t.length-1),e}function Gst(t,e){return t.map(n=>n*e)}function Pst(t,e){return t.map(()=>e||BQe).splice(0,t.length-1)}function eB({duration:t=300,keyframes:e,times:n,ease:a="easeInOut"}){const r=Vot(a)?a.map(qoe):qoe(a),i={done:!1,value:e[0]},o=Gst(n&&n.length===e.length?n:Ost(e),t),s=Mst(o,e,{ease:Array.isArray(r)?r:Pst(e,r)});return{calculatedDuration:t,next:A=>(i.value=s(A),i.done=A>=t,i)}}const qst=t=>t!==null;function SZ(t,{repeat:e,repeatType:n="loop"},a,r=1){const i=t.filter(qst),s=r<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||a===void 0?i[s]:a}const Ust={decay:nj,inertia:nj,tween:eB,keyframes:eB,spring:GD};function LQe(t){typeof t.type=="string"&&(t.type=Ust[t.type])}class NZ{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const $st=t=>t/100;class FZ extends NZ{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Js.now()&&this.tick(Js.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;LQe(e);const{type:n=eB,repeat:a=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e;let{keyframes:s}=e;const A=n||eB;A!==eB&&typeof s[0]!="number"&&(this.mixKeyframes=mv($st,TQe(s[0],s[1])),s=[0,100]);const l=A({...e,keyframes:s});i==="mirror"&&(this.mirroredGenerator=A({...e,keyframes:[...s].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=DZ(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(a+1)-r,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:a,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:A}=this;if(this.startTime===null)return a.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:p,repeatDelay:m,type:g,onUpdate:h,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let E=this.currentTime,k=a;if(d){const x=Math.min(this.currentTime,r)/s;let N=Math.floor(x),R=x%1;!R&&x>=1&&(R=1),R===1&&N--,N=Math.min(N,d+1),N%2&&(p==="reverse"?(R=1-R,m&&(R-=m/s)):p==="mirror"&&(k=o)),E=Yd(0,1,R)*s}const v=w?{done:!1,value:u[0]}:k.next(E);i&&(v.value=i(v.value));let{done:_}=v;!w&&A!==null&&(_=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return I&&g!==nj&&(v.value=SZ(u,this.options,b,this.speed)),h&&h(v.value),I&&this.finish(),v}then(e,n){return this.finished.then(e,n)}get duration(){return hc(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+hc(e)}get time(){return hc(this.currentTime)}set time(e){e=uu(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Js.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=hc(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Ist,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Js.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function jst(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Df=t=>t*180/Math.PI,aj=t=>{const e=Df(Math.atan2(t[1],t[0]));return rj(e)},Hst={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:aj,rotateZ:aj,skewX:t=>Df(Math.atan(t[1])),skewY:t=>Df(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},rj=t=>(t=t%360,t<0&&(t+=360),t),Yoe=aj,Koe=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Zoe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),zst={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Koe,scaleY:Zoe,scale:t=>(Koe(t)+Zoe(t))/2,rotateX:t=>rj(Df(Math.atan2(t[6],t[5]))),rotateY:t=>rj(Df(Math.atan2(-t[2],t[0]))),rotateZ:Yoe,rotate:Yoe,skewX:t=>Df(Math.atan(t[4])),skewY:t=>Df(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ij(t){return t.includes("scale")?1:0}function oj(t,e){if(!t||t==="none")return ij(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,r;if(n)a=zst,r=n;else{const s=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=Hst,r=s}if(!r)return ij(e);const i=a[e],o=r[1].split(",").map(Kst);return typeof i=="function"?i(o):o[i]}const Yst=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return oj(n,e)};function Kst(t){return parseFloat(t.trim())}const _1=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],x1=new Set(_1),Woe=t=>t===Q1||t===qn,Zst=new Set(["x","y","z"]),Wst=_1.filter(t=>!Zst.has(t));function Vst(t){const e=[];return Wst.forEach(n=>{const a=t.getValue(n);a!==void 0&&(e.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),e}const Pf={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>oj(e,"x"),y:(t,{transform:e})=>oj(e,"y")};Pf.translateX=Pf.x;Pf.translateY=Pf.y;const qf=new Set;let sj=!1,Aj=!1,cj=!1;function OQe(){if(Aj){const t=Array.from(qf).filter(a=>a.needsMeasurement),e=new Set(t.map(a=>a.element)),n=new Map;e.forEach(a=>{const r=Vst(a);r.length&&(n.set(a,r),a.render())}),t.forEach(a=>a.measureInitialState()),e.forEach(a=>{a.render();const r=n.get(a);r&&r.forEach(([i,o])=>{a.getValue(i)?.set(o)})}),t.forEach(a=>a.measureEndState()),t.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Aj=!1,sj=!1,qf.forEach(t=>t.complete(cj)),qf.clear()}function GQe(){qf.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Aj=!0)})}function Jst(){cj=!0,GQe(),OQe(),cj=!1}class TZ{constructor(e,n,a,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=a,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(qf.add(this),sj||(sj=!0,_r.read(GQe),_r.resolveKeyframes(OQe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:a,motionValue:r}=this;if(e[0]===null){const i=r?.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(a&&n){const s=a.readValue(n,o);s!=null&&(e[0]=s)}e[0]===void 0&&(e[0]=o),r&&i===void 0&&r.set(e[0])}jst(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qf.delete(this)}cancel(){this.state==="scheduled"&&(qf.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Xst=t=>t.startsWith("--");function eAt(t,e,n){Xst(e)?t.style.setProperty(e,n):t.style[e]=n}const tAt=EZ(()=>window.ScrollTimeline!==void 0),nAt={};function aAt(t,e){const n=EZ(t);return()=>nAt[e]??n()}const PQe=aAt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qw=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,Voe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qw([0,.65,.55,1]),circOut:qw([.55,0,1,.45]),backIn:qw([.31,.01,.66,-.59]),backOut:qw([.33,1.53,.69,.99])};function qQe(t,e){if(t)return typeof t=="function"?PQe()?RQe(t,e):"ease-out":kQe(t)?qw(t):Array.isArray(t)?t.map(n=>qQe(n,e)||Voe.easeOut):Voe[t]}function rAt(t,e,n,{delay:a=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:s="easeOut",times:A}={},l=void 0){const u={[e]:n};A&&(u.offset=A);const d=qQe(s,r);Array.isArray(d)&&(u.easing=d);const p={delay:a,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(p.pseudoElement=l),t.animate(u,p)}function UQe(t){return typeof t=="function"&&"applyToOptions"in t}function iAt({type:t,...e}){return UQe(t)&&PQe()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class oAt extends NZ{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:a,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:s,onComplete:A}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,wZ(typeof e.type!="string");const l=iAt(e);this.animation=rAt(n,a,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=SZ(r,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):eAt(n,a,u),this.animation.cancel()}A?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return hc(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+hc(e)}get time(){return hc(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=uu(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&tAt()?(this.animation.timeline=e,Bc):n(this)}}const $Qe={anticipate:CQe,backInOut:yQe,circInOut:EQe};function sAt(t){return t in $Qe}function AAt(t){typeof t.ease=="string"&&sAt(t.ease)&&(t.ease=$Qe[t.ease])}const Joe=10;class cAt extends oAt{constructor(e){AAt(e),LQe(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:a,onComplete:r,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const s=new FZ({...o,autoplay:!1}),A=uu(this.finishedTime??this.time);n.setWithVelocity(s.sample(A-Joe).value,s.sample(A).value,Joe),s.stop()}}const Xoe=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Tm.test(t)||t==="0")&&!t.startsWith("url("));function lAt(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function uAt(t,e,n,a){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=Xoe(r,e),s=Xoe(i,e);return!o||!s?!1:lAt(t)||(n==="spring"||UQe(n))&&a}function lj(t){t.duration=0,t.type="keyframes"}const dAt=new Set(["opacity","clipPath","filter","transform"]),pAt=EZ(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mAt(t){const{motionValue:e,name:n,repeatDelay:a,repeatType:r,damping:i,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:A,transformTemplate:l}=e.owner.getProps();return pAt()&&n&&dAt.has(n)&&(n!=="transform"||!l)&&!A&&!a&&r!=="mirror"&&i!==0&&o!=="inertia"}const gAt=40;class fAt extends NZ{constructor({autoplay:e=!0,delay:n=0,type:a="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:s,name:A,motionValue:l,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Js.now();const p={autoplay:e,delay:n,type:a,repeat:r,repeatDelay:i,repeatType:o,name:A,motionValue:l,element:u,...d},m=u?.KeyframeResolver||TZ;this.keyframeResolver=new m(s,(g,h,b)=>this.onKeyframesResolved(g,h,p,!b),A,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,a,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:s,delay:A,isHandoff:l,onUpdate:u}=a;this.resolvedAt=Js.now(),uAt(e,i,o,s)||((Kd.instantAnimations||!A)&&u?.(SZ(e,a,n)),e[0]=e[e.length-1],lj(a),a.repeat=0);const p={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>gAt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:e},m=!l&&mAt(p)?new cAt({...p,element:p.motionValue.owner.current}):new FZ(p);m.finished.then(()=>this.notifyFinished()).catch(Bc),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Jst()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const hAt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bAt(t){const e=hAt.exec(t);if(!e)return[,];const[,n,a,r]=e;return[`--${n??a}`,r]}function jQe(t,e,n=1){const[a,r]=bAt(t);if(!a)return;const i=window.getComputedStyle(e).getPropertyValue(a);if(i){const o=i.trim();return uQe(o)?parseFloat(o):o}return IZ(r)?jQe(r,e,n+1):r}function RZ(t,e){return t?.[e]??t?.default??t}const HQe=new Set(["width","height","top","left","right","bottom",..._1]),yAt={test:t=>t==="auto",parse:t=>t},zQe=t=>e=>e.test(t),YQe=[Q1,qn,du,em,lst,cst,yAt],ese=t=>YQe.find(zQe(t));function CAt(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||pQe(t):!0}const wAt=new Set(["brightness","contrast","saturate","opacity"]);function EAt(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[a]=n.match(QZ)||[];if(!a)return t;const r=n.replace(a,"");let i=wAt.has(e)?1:0;return a!==n&&(i*=100),e+"("+i+r+")"}const BAt=/\b([a-z-]*)\(.*?\)/gu,uj={...Tm,getAnimatableNone:t=>{const e=t.match(BAt);return e?e.map(EAt).join(" "):t}},tse={...Q1,transform:Math.round},kAt={rotate:em,rotateX:em,rotateY:em,rotateZ:em,scale:JQ,scaleX:JQ,scaleY:JQ,scaleZ:JQ,skew:em,skewX:em,skewY:em,distance:qn,translateX:qn,translateY:qn,translateZ:qn,x:qn,y:qn,z:qn,perspective:qn,transformPerspective:qn,opacity:jB,originX:Uoe,originY:Uoe,originZ:qn},MZ={borderWidth:qn,borderTopWidth:qn,borderRightWidth:qn,borderBottomWidth:qn,borderLeftWidth:qn,borderRadius:qn,radius:qn,borderTopLeftRadius:qn,borderTopRightRadius:qn,borderBottomRightRadius:qn,borderBottomLeftRadius:qn,width:qn,maxWidth:qn,height:qn,maxHeight:qn,top:qn,right:qn,bottom:qn,left:qn,padding:qn,paddingTop:qn,paddingRight:qn,paddingBottom:qn,paddingLeft:qn,margin:qn,marginTop:qn,marginRight:qn,marginBottom:qn,marginLeft:qn,backgroundPositionX:qn,backgroundPositionY:qn,...kAt,zIndex:tse,fillOpacity:jB,strokeOpacity:jB,numOctaves:tse},vAt={...MZ,color:mi,backgroundColor:mi,outlineColor:mi,fill:mi,stroke:mi,borderColor:mi,borderTopColor:mi,borderRightColor:mi,borderBottomColor:mi,borderLeftColor:mi,filter:uj,WebkitFilter:uj},KQe=t=>vAt[t];function ZQe(t,e){let n=KQe(t);return n!==uj&&(n=Tm),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const IAt=new Set(["auto","none","0"]);function QAt(t,e,n){let a=0,r;for(;a<t.length&&!r;){const i=t[a];typeof i=="string"&&!IAt.has(i)&&HB(i).values.length&&(r=t[a]),a++}if(r&&n)for(const i of e)t[i]=ZQe(n,r)}class _At extends TZ{constructor(e,n,a,r,i){super(e,n,a,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let A=0;A<e.length;A++){let l=e[A];if(typeof l=="string"&&(l=l.trim(),IZ(l))){const u=jQe(l,n.current);u!==void 0&&(e[A]=u),A===e.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!HQe.has(a)||e.length!==2)return;const[r,i]=e,o=ese(r),s=ese(i);if(o!==s)if(Woe(o)&&Woe(s))for(let A=0;A<e.length;A++){const l=e[A];typeof l=="string"&&(e[A]=parseFloat(l))}else Pf[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,a=[];for(let r=0;r<e.length;r++)(e[r]===null||CAt(e[r]))&&a.push(r);a.length&&QAt(e,a,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:a}=this;if(!e||!e.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pf[a](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(a,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:a}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=a.length-1,o=a[i];a[i]=Pf[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,A])=>{e.getValue(s).set(A)}),this.resolveNoneKeyframes()}}function xAt(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let a=document;const r=n?.[t]??a.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}const WQe=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function VQe(t){return dQe(t)&&"offsetHeight"in t}const nse=30,DAt=t=>!isNaN(parseFloat(t));class SAt{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const r=Js.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Js.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=DAt(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new BZ);const a=this.events[e].add(n);return e==="change"?()=>{a(),_r.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-a}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Js.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>nse)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,nse);return mQe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function v2(t,e){return new SAt(t,e)}const{schedule:LZ}=vQe(queueMicrotask,!1),Hc={x:!1,y:!1};function JQe(){return Hc.x||Hc.y}function NAt(t){return t==="x"||t==="y"?Hc[t]?null:(Hc[t]=!0,()=>{Hc[t]=!1}):Hc.x||Hc.y?null:(Hc.x=Hc.y=!0,()=>{Hc.x=Hc.y=!1})}function XQe(t,e){const n=xAt(t),a=new AbortController,r={passive:!0,...e,signal:a.signal};return[n,r,()=>a.abort()]}function ase(t){return!(t.pointerType==="touch"||JQe())}function FAt(t,e,n={}){const[a,r,i]=XQe(t,n),o=s=>{if(!ase(s))return;const{target:A}=s,l=e(A,s);if(typeof l!="function"||!A)return;const u=d=>{ase(d)&&(l(d),A.removeEventListener("pointerleave",u))};A.addEventListener("pointerleave",u,r)};return a.forEach(s=>{s.addEventListener("pointerenter",o,r)}),i}const e_e=(t,e)=>e?t===e?!0:e_e(t,e.parentElement):!1,OZ=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,TAt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function RAt(t){return TAt.has(t.tagName)||t.tabIndex!==-1}const Fx=new WeakSet;function rse(t){return e=>{e.key==="Enter"&&t(e)}}function C9(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const MAt=(t,e)=>{const n=t.currentTarget;if(!n)return;const a=rse(()=>{if(Fx.has(n))return;C9(n,"down");const r=rse(()=>{C9(n,"up")}),i=()=>C9(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",a,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),e)};function ise(t){return OZ(t)&&!JQe()}function LAt(t,e,n={}){const[a,r,i]=XQe(t,n),o=s=>{const A=s.currentTarget;if(!ise(s))return;Fx.add(A);const l=e(A,s),u=(m,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",p),Fx.has(A)&&Fx.delete(A),ise(m)&&typeof l=="function"&&l(m,{success:g})},d=m=>{u(m,A===window||A===document||n.useGlobalTarget||e_e(A,m.target))},p=m=>{u(m,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",p,r)};return a.forEach(s=>{(n.useGlobalTarget?window:s).addEventListener("pointerdown",o,r),VQe(s)&&(s.addEventListener("focus",l=>MAt(l,r)),!RAt(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),i}function t_e(t){return dQe(t)&&"ownerSVGElement"in t}function OAt(t){return t_e(t)&&t.tagName==="svg"}const Ho=t=>!!(t&&t.getVelocity),GAt=[...YQe,mi,Tm],PAt=t=>GAt.find(zQe(t)),GZ=K.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function ose(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function qAt(...t){return e=>{let n=!1;const a=t.map(r=>{const i=ose(r,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<a.length;r++){const i=a[r];typeof i=="function"?i():ose(t[r],null)}}}}function UAt(...t){return K.useCallback(qAt(...t),t)}class $At extends K.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const a=n.offsetParent,r=VQe(a)&&a.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=r-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function jAt({children:t,isPresent:e,anchorX:n,root:a}){const r=K.useId(),i=K.useRef(null),o=K.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=K.useContext(GZ),A=UAt(i,t?.ref);return K.useInsertionEffect(()=>{const{width:l,height:u,top:d,left:p,right:m}=o.current;if(e||!i.current||!l||!u)return;const g=n==="left"?`left: ${p}`:`right: ${m}`;i.current.dataset.motionPopId=r;const h=document.createElement("style");s&&(h.nonce=s);const b=a??document.head;return b.appendChild(h),h.sheet&&h.sheet.insertRule(`
1330
+ `},Frt={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Trt(t){let{announcements:e=Frt,container:n,hiddenTextDescribedById:a,screenReaderInstructions:r=Nrt}=t;const{announce:i,announcement:o}=xrt(),s=dv("DndLiveRegion"),[A,l]=K.useState(!1);if(K.useEffect(()=>{l(!0)},[]),Drt(K.useMemo(()=>({onDragStart(d){let{active:p}=d;i(e.onDragStart({active:p}))},onDragMove(d){let{active:p,over:m}=d;e.onDragMove&&i(e.onDragMove({active:p,over:m}))},onDragOver(d){let{active:p,over:m}=d;i(e.onDragOver({active:p,over:m}))},onDragEnd(d){let{active:p,over:m}=d;i(e.onDragEnd({active:p,over:m}))},onDragCancel(d){let{active:p,over:m}=d;i(e.onDragCancel({active:p,over:m}))}}),[i,e])),!A)return null;const u=Ce.createElement(Ce.Fragment,null,Ce.createElement(Qrt,{id:a,value:r.draggable}),Ce.createElement(_rt,{id:s,announcement:o}));return n?Xl.createPortal(u,n):u}var Li;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Li||(Li={}));function SD(){}function j5n(t,e){return K.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function H5n(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return K.useMemo(()=>[...e].filter(a=>a!=null),[...e])}const ml=Object.freeze({x:0,y:0});function Xve(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Rrt(t,e){const n=DD(t);if(!n)return"0 0";const a={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return a.x+"% "+a.y+"%"}function eIe(t,e){let{data:{value:n}}=t,{data:{value:a}}=e;return n-a}function Mrt(t,e){let{data:{value:n}}=t,{data:{value:a}}=e;return a-n}function koe(t){let{left:e,top:n,height:a,width:r}=t;return[{x:e,y:n},{x:e+r,y:n},{x:e,y:n+a},{x:e+r,y:n+a}]}function tIe(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function voe(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const z5n=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=t;const r=voe(e,e.left,e.top),i=[];for(const o of a){const{id:s}=o,A=n.get(s);if(A){const l=Xve(voe(A),r);i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(eIe)},Lrt=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=t;const r=koe(e),i=[];for(const o of a){const{id:s}=o,A=n.get(s);if(A){const l=koe(A),u=r.reduce((p,m,g)=>p+Xve(l[g],m),0),d=Number((u/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:d}})}}return i.sort(eIe)};function Ort(t,e){const n=Math.max(e.top,t.top),a=Math.max(e.left,t.left),r=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=r-a,s=i-n;if(a<r&&n<i){const A=e.width*e.height,l=t.width*t.height,u=o*s,d=u/(A+l-u);return Number(d.toFixed(4))}return 0}const Grt=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:a}=t;const r=[];for(const i of a){const{id:o}=i,s=n.get(o);if(s){const A=Ort(s,e);A>0&&r.push({id:o,data:{droppableContainer:i,value:A}})}}return r.sort(Mrt)};function Prt(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function nIe(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:ml}function qrt(t){return function(n){for(var a=arguments.length,r=new Array(a>1?a-1:0),i=1;i<a;i++)r[i-1]=arguments[i];return r.reduce((o,s)=>({...o,top:o.top+t*s.y,bottom:o.bottom+t*s.y,left:o.left+t*s.x,right:o.right+t*s.x}),{...n})}}const Urt=qrt(1);function aIe(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function $rt(t,e,n){const a=aIe(e);if(!a)return t;const{scaleX:r,scaleY:i,x:o,y:s}=a,A=t.left-o-(1-r)*parseFloat(n),l=t.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=r?t.width/r:t.width,d=i?t.height/i:t.height;return{width:u,height:d,top:l,right:A+u,bottom:l+d,left:A}}const jrt={ignoreTransform:!1};function v1(t,e){e===void 0&&(e=jrt);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:l,transformOrigin:u}=Qs(t).getComputedStyle(t);l&&(n=$rt(n,l,u))}const{top:a,left:r,width:i,height:o,bottom:s,right:A}=n;return{top:a,left:r,width:i,height:o,bottom:s,right:A}}function Ioe(t){return v1(t,{ignoreTransform:!0})}function Hrt(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function zrt(t,e){return e===void 0&&(e=Qs(t).getComputedStyle(t)),e.position==="fixed"}function Yrt(t,e){e===void 0&&(e=Qs(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const i=e[r];return typeof i=="string"?n.test(i):!1})}function DS(t,e){const n=[];function a(r){if(e!=null&&n.length>=e||!r)return n;if(AZ(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!lv(r)||Wve(r)||n.includes(r))return n;const i=Qs(t).getComputedStyle(r);return r!==t&&Yrt(r,i)&&n.push(r),zrt(r,i)?n:a(r.parentNode)}return t?a(t):n}function rIe(t){const[e]=DS(t,1);return e??null}function d9(t){return!QS||!t?null:B1(t)?t:sZ(t)?AZ(t)||t===k1(t).scrollingElement?window:lv(t)?t:null:null}function iIe(t){return B1(t)?t.scrollX:t.scrollLeft}function oIe(t){return B1(t)?t.scrollY:t.scrollTop}function j$(t){return{x:iIe(t),y:oIe(t)}}var Xi;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Xi||(Xi={}));function sIe(t){return!QS||!t?!1:t===document.scrollingElement}function AIe(t){const e={x:0,y:0},n=sIe(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},a={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},r=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=a.y,s=t.scrollLeft>=a.x;return{isTop:r,isLeft:i,isBottom:o,isRight:s,maxScroll:a,minScroll:e}}const Krt={x:.2,y:.2};function Zrt(t,e,n,a,r){let{top:i,left:o,right:s,bottom:A}=n;a===void 0&&(a=10),r===void 0&&(r=Krt);const{isTop:l,isBottom:u,isLeft:d,isRight:p}=AIe(t),m={x:0,y:0},g={x:0,y:0},h={height:e.height*r.y,width:e.width*r.x};return!l&&i<=e.top+h.height?(m.y=Xi.Backward,g.y=a*Math.abs((e.top+h.height-i)/h.height)):!u&&A>=e.bottom-h.height&&(m.y=Xi.Forward,g.y=a*Math.abs((e.bottom-h.height-A)/h.height)),!p&&s>=e.right-h.width?(m.x=Xi.Forward,g.x=a*Math.abs((e.right-h.width-s)/h.width)):!d&&o<=e.left+h.width&&(m.x=Xi.Backward,g.x=a*Math.abs((e.left+h.width-o)/h.width)),{direction:m,speed:g}}function Wrt(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:a,bottom:r}=t.getBoundingClientRect();return{top:e,left:n,right:a,bottom:r,width:t.clientWidth,height:t.clientHeight}}function cIe(t){return t.reduce((e,n)=>Xb(e,j$(n)),ml)}function Vrt(t){return t.reduce((e,n)=>e+iIe(n),0)}function Jrt(t){return t.reduce((e,n)=>e+oIe(n),0)}function lIe(t,e){if(e===void 0&&(e=v1),!t)return;const{top:n,left:a,bottom:r,right:i}=e(t);rIe(t)&&(r<=0||i<=0||n>=window.innerHeight||a>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Xrt=[["x",["left","right"],Vrt],["y",["top","bottom"],Jrt]];class cZ{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=DS(n),r=cIe(a);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,s]of Xrt)for(const A of o)Object.defineProperty(this,A,{get:()=>{const l=s(a),u=r[i]-l;return this.rect[A]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class WE{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...n)})},this.target=e}add(e,n,a){var r;(r=this.target)==null||r.addEventListener(e,n,a),this.listeners.push([e,n,a])}}function eit(t){const{EventTarget:e}=Qs(t);return t instanceof e?t:k1(t)}function p9(t,e){const n=Math.abs(t.x),a=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+a**2)>e:"x"in e&&"y"in e?n>e.x&&a>e.y:"x"in e?n>e.x:"y"in e?a>e.y:!1}var oc;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(oc||(oc={}));function Qoe(t){t.preventDefault()}function tit(t){t.stopPropagation()}var wa;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(wa||(wa={}));const uIe={start:[wa.Space,wa.Enter],cancel:[wa.Esc],end:[wa.Space,wa.Enter,wa.Tab]},nit=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case wa.Right:return{...n,x:n.x+25};case wa.Left:return{...n,x:n.x-25};case wa.Down:return{...n,y:n.y+25};case wa.Up:return{...n,y:n.y-25}}};class dIe{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new WE(k1(n)),this.windowListeners=new WE(Qs(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oc.Resize,this.handleCancel),this.windowListeners.add(oc.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oc.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,a=e.node.current;a&&lIe(a),n(ml)}handleKeyDown(e){if(xS(e)){const{active:n,context:a,options:r}=this.props,{keyboardCodes:i=uIe,coordinateGetter:o=nit,scrollBehavior:s="smooth"}=r,{code:A}=e;if(i.end.includes(A)){this.handleEnd(e);return}if(i.cancel.includes(A)){this.handleCancel(e);return}const{collisionRect:l}=a.current,u=l?{x:l.left,y:l.top}:ml;this.referenceCoordinates||(this.referenceCoordinates=u);const d=o(e,{active:n,context:a.current,currentCoordinates:u});if(d){const p=qB(d,u),m={x:0,y:0},{scrollableAncestors:g}=a.current;for(const h of g){const b=e.code,{isTop:y,isRight:w,isLeft:E,isBottom:k,maxScroll:v,minScroll:_}=AIe(h),I=Wrt(h),x={x:Math.min(b===wa.Right?I.right-I.width/2:I.right,Math.max(b===wa.Right?I.left:I.left+I.width/2,d.x)),y:Math.min(b===wa.Down?I.bottom-I.height/2:I.bottom,Math.max(b===wa.Down?I.top:I.top+I.height/2,d.y))},N=b===wa.Right&&!w||b===wa.Left&&!E,R=b===wa.Down&&!k||b===wa.Up&&!y;if(N&&x.x!==d.x){const T=h.scrollLeft+p.x,O=b===wa.Right&&T<=v.x||b===wa.Left&&T>=_.x;if(O&&!p.y){h.scrollTo({left:T,behavior:s});return}O?m.x=h.scrollLeft-T:m.x=b===wa.Right?h.scrollLeft-v.x:h.scrollLeft-_.x,m.x&&h.scrollBy({left:-m.x,behavior:s});break}else if(R&&x.y!==d.y){const T=h.scrollTop+p.y,O=b===wa.Down&&T<=v.y||b===wa.Up&&T>=_.y;if(O&&!p.x){h.scrollTo({top:T,behavior:s});return}O?m.y=h.scrollTop-T:m.y=b===wa.Down?h.scrollTop-v.y:h.scrollTop-_.y,m.y&&h.scrollBy({top:-m.y,behavior:s});break}}this.handleMove(e,Xb(qB(d,this.referenceCoordinates),m))}}}handleMove(e,n){const{onMove:a}=this.props;e.preventDefault(),a(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}dIe.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:a=uIe,onActivation:r}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(a.start.includes(o)){const s=i.activatorNode.current;return s&&t.target!==s?!1:(t.preventDefault(),r?.({event:t.nativeEvent}),!0)}return!1}}];function _oe(t){return!!(t&&"distance"in t)}function xoe(t){return!!(t&&"delay"in t)}class lZ{constructor(e,n,a){var r;a===void 0&&(a=eit(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=k1(o),this.documentListeners=new WE(this.document),this.listeners=new WE(a),this.windowListeners=new WE(Qs(o)),this.initialCoordinates=(r=DD(i))!=null?r:ml,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:a}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(oc.Resize,this.handleCancel),this.windowListeners.add(oc.DragStart,Qoe),this.windowListeners.add(oc.VisibilityChange,this.handleCancel),this.windowListeners.add(oc.ContextMenu,Qoe),this.documentListeners.add(oc.Keydown,this.handleKeydown),n){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xoe(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(_oe(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:a,onPending:r}=this.props;r(a,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(oc.Click,tit,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oc.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:a,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!r)return;const A=(n=DD(e))!=null?n:ml,l=qB(r,A);if(!a&&s){if(_oe(s)){if(s.tolerance!=null&&p9(l,s.tolerance))return this.handleCancel();if(p9(l,s.distance))return this.handleStart()}if(xoe(s)&&p9(l,s.tolerance))return this.handleCancel();this.handlePending(s,l);return}e.cancelable&&e.preventDefault(),o(A)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===wa.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const ait={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class pIe extends lZ{constructor(e){const{event:n}=e,a=k1(n.target);super(e,ait,a)}}pIe.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:a}=e;return!n.isPrimary||n.button!==0?!1:(a?.({event:n}),!0)}}];const rit={move:{name:"mousemove"},end:{name:"mouseup"}};var H$;(function(t){t[t.RightClick=2]="RightClick"})(H$||(H$={}));class iit extends lZ{constructor(e){super(e,rit,k1(e.event.target))}}iit.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:a}=e;return n.button===H$.RightClick?!1:(a?.({event:n}),!0)}}];const m9={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class oit extends lZ{constructor(e){super(e,m9)}static setup(){return window.addEventListener(m9.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(m9.move.name,e)};function e(){}}}oit.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:a}=e;const{touches:r}=n;return r.length>1?!1:(a?.({event:n}),!0)}}];var VE;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(VE||(VE={}));var ND;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(ND||(ND={}));function sit(t){let{acceleration:e,activator:n=VE.Pointer,canScroll:a,draggingRect:r,enabled:i,interval:o=5,order:s=ND.TreeOrder,pointerCoordinates:A,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:p}=t;const m=cit({delta:d,disabled:!i}),[g,h]=Ert(),b=K.useRef({x:0,y:0}),y=K.useRef({x:0,y:0}),w=K.useMemo(()=>{switch(n){case VE.Pointer:return A?{top:A.y,bottom:A.y,left:A.x,right:A.x}:null;case VE.DraggableRect:return r}},[n,r,A]),E=K.useRef(null),k=K.useCallback(()=>{const _=E.current;if(!_)return;const I=b.current.x*y.current.x,x=b.current.y*y.current.y;_.scrollBy(I,x)},[]),v=K.useMemo(()=>s===ND.TreeOrder?[...l].reverse():l,[s,l]);K.useEffect(()=>{if(!i||!l.length||!w){h();return}for(const _ of v){if(a?.(_)===!1)continue;const I=l.indexOf(_),x=u[I];if(!x)continue;const{direction:N,speed:R}=Zrt(_,x,w,e,p);for(const T of["x","y"])m[T][N[T]]||(R[T]=0,N[T]=0);if(R.x>0||R.y>0){h(),E.current=_,g(k,o),b.current=R,y.current=N;return}}b.current={x:0,y:0},y.current={x:0,y:0},h()},[e,k,a,h,i,o,JSON.stringify(w),JSON.stringify(m),g,l,v,u,JSON.stringify(p)])}const Ait={x:{[Xi.Backward]:!1,[Xi.Forward]:!1},y:{[Xi.Backward]:!1,[Xi.Forward]:!1}};function cit(t){let{delta:e,disabled:n}=t;const a=xD(e);return uv(r=>{if(n||!a||!r)return Ait;const i={x:Math.sign(e.x-a.x),y:Math.sign(e.y-a.y)};return{x:{[Xi.Backward]:r.x[Xi.Backward]||i.x===-1,[Xi.Forward]:r.x[Xi.Forward]||i.x===1},y:{[Xi.Backward]:r.y[Xi.Backward]||i.y===-1,[Xi.Forward]:r.y[Xi.Forward]||i.y===1}}},[n,e,a])}function lit(t,e){const n=e!=null?t.get(e):void 0,a=n?n.node.current:null;return uv(r=>{var i;return e==null?null:(i=a??r)!=null?i:null},[a,e])}function uit(t,e){return K.useMemo(()=>t.reduce((n,a)=>{const{sensor:r}=a,i=r.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,a)}));return[...n,...i]},[]),[t,e])}var UB;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(UB||(UB={}));var z$;(function(t){t.Optimized="optimized"})(z$||(z$={}));const Doe=new Map;function dit(t,e){let{dragging:n,dependencies:a,config:r}=e;const[i,o]=K.useState(null),{frequency:s,measure:A,strategy:l}=r,u=K.useRef(t),d=b(),p=PB(d),m=K.useCallback(function(y){y===void 0&&(y=[]),!p.current&&o(w=>w===null?y:w.concat(y.filter(E=>!w.includes(E))))},[p]),g=K.useRef(null),h=uv(y=>{if(d&&!n)return Doe;if(!y||y===Doe||u.current!==t||i!=null){const w=new Map;for(let E of t){if(!E)continue;if(i&&i.length>0&&!i.includes(E.id)&&E.rect.current){w.set(E.id,E.rect.current);continue}const k=E.node.current,v=k?new cZ(A(k),k):null;E.rect.current=v,v&&w.set(E.id,v)}return w}return y},[t,i,n,d,A]);return K.useEffect(()=>{u.current=t},[t]),K.useEffect(()=>{d||m()},[n,d]),K.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),K.useEffect(()=>{d||typeof s!="number"||g.current!==null||(g.current=setTimeout(()=>{m(),g.current=null},s))},[s,d,m,...a]),{droppableRects:h,measureDroppableContainers:m,measuringScheduled:i!=null};function b(){switch(l){case UB.Always:return!1;case UB.BeforeDragging:return n;default:return!n}}}function uZ(t,e){return uv(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function pit(t,e){return uZ(t,e)}function mit(t){let{callback:e,disabled:n}=t;const a=_S(e),r=K.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(a)},[a,n]);return K.useEffect(()=>()=>r?.disconnect(),[r]),r}function SS(t){let{callback:e,disabled:n}=t;const a=_S(e),r=K.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(a)},[n]);return K.useEffect(()=>()=>r?.disconnect(),[r]),r}function git(t){return new cZ(v1(t),t)}function Soe(t,e,n){e===void 0&&(e=git);const[a,r]=K.useState(null);function i(){r(A=>{if(!t)return null;if(t.isConnected===!1){var l;return(l=A??n)!=null?l:null}const u=e(t);return JSON.stringify(A)===JSON.stringify(u)?A:u})}const o=mit({callback(A){if(t)for(const l of A){const{type:u,target:d}=l;if(u==="childList"&&d instanceof HTMLElement&&d.contains(t)){i();break}}}}),s=SS({callback:i});return pl(()=>{i(),t?(s?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[t]),a}function fit(t){const e=uZ(t);return nIe(t,e)}const Noe=[];function hit(t){const e=K.useRef(t),n=uv(a=>t?a&&a!==Noe&&t&&e.current&&t.parentNode===e.current.parentNode?a:DS(t):Noe,[t]);return K.useEffect(()=>{e.current=t},[t]),n}function bit(t){const[e,n]=K.useState(null),a=K.useRef(t),r=K.useCallback(i=>{const o=d9(i.target);o&&n(s=>s?(s.set(o,j$(o)),new Map(s)):null)},[]);return K.useEffect(()=>{const i=a.current;if(t!==i){o(i);const s=t.map(A=>{const l=d9(A);return l?(l.addEventListener("scroll",r,{passive:!0}),[l,j$(l)]):null}).filter(A=>A!=null);n(s.length?new Map(s):null),a.current=t}return()=>{o(t),o(i)};function o(s){s.forEach(A=>{const l=d9(A);l?.removeEventListener("scroll",r)})}},[r,t]),K.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Xb(i,o),ml):cIe(t):ml,[t,e])}function Foe(t,e){e===void 0&&(e=[]);const n=K.useRef(null);return K.useEffect(()=>{n.current=null},e),K.useEffect(()=>{const a=t!==ml;a&&!n.current&&(n.current=t),!a&&n.current&&(n.current=null)},[t]),n.current?qB(t,n.current):ml}function yit(t){K.useEffect(()=>{if(!QS)return;const e=t.map(n=>{let{sensor:a}=n;return a.setup==null?void 0:a.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function Cit(t,e){return K.useMemo(()=>t.reduce((n,a)=>{let{eventName:r,handler:i}=a;return n[r]=o=>{i(o,e)},n},{}),[t,e])}function mIe(t){return K.useMemo(()=>t?Hrt(t):null,[t])}const Toe=[];function wit(t,e){e===void 0&&(e=v1);const[n]=t,a=mIe(n?Qs(n):null),[r,i]=K.useState(Toe);function o(){i(()=>t.length?t.map(A=>sIe(A)?a:new cZ(e(A),A)):Toe)}const s=SS({callback:o});return pl(()=>{s?.disconnect(),o(),t.forEach(A=>s?.observe(A))},[t]),r}function gIe(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return lv(e)?e:t}function Eit(t){let{measure:e}=t;const[n,a]=K.useState(null),r=K.useCallback(l=>{for(const{target:u}of l)if(lv(u)){a(d=>{const p=e(u);return d?{...d,width:p.width,height:p.height}:p});break}},[e]),i=SS({callback:r}),o=K.useCallback(l=>{const u=gIe(l);i?.disconnect(),u&&i?.observe(u),a(u?e(u):null)},[e,i]),[s,A]=_D(o);return K.useMemo(()=>({nodeRef:s,rect:n,setRef:A}),[n,s,A])}const Bit=[{sensor:pIe,options:{}},{sensor:dIe,options:{}}],kit={current:{}},Sx={draggable:{measure:Ioe},droppable:{measure:Ioe,strategy:UB.WhileDragging,frequency:z$.Optimized},dragOverlay:{measure:v1}};class JE extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,a;return(n=(a=this.get(e))==null?void 0:a.node.current)!=null?n:void 0}}const vit={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new JE,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:SD},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sx,measureDroppableContainers:SD,windowRect:null,measuringScheduled:!1},fIe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:SD,draggableNodes:new Map,over:null,measureDroppableContainers:SD},pv=K.createContext(fIe),hIe=K.createContext(vit);function Iit(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new JE}}}function Qit(t,e){switch(e.type){case Li.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Li.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Li.DragEnd:case Li.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Li.RegisterDroppable:{const{element:n}=e,{id:a}=n,r=new JE(t.droppable.containers);return r.set(a,n),{...t,droppable:{...t.droppable,containers:r}}}case Li.SetDroppableDisabled:{const{id:n,key:a,disabled:r}=e,i=t.droppable.containers.get(n);if(!i||a!==i.key)return t;const o=new JE(t.droppable.containers);return o.set(n,{...i,disabled:r}),{...t,droppable:{...t.droppable,containers:o}}}case Li.UnregisterDroppable:{const{id:n,key:a}=e,r=t.droppable.containers.get(n);if(!r||a!==r.key)return t;const i=new JE(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function _it(t){let{disabled:e}=t;const{active:n,activatorEvent:a,draggableNodes:r}=K.useContext(pv),i=xD(a),o=xD(n?.id);return K.useEffect(()=>{if(!e&&!a&&i&&o!=null){if(!xS(i)||document.activeElement===i.target)return;const s=r.get(o);if(!s)return;const{activatorNode:A,node:l}=s;if(!A.current&&!l.current)return;requestAnimationFrame(()=>{for(const u of[A.current,l.current]){if(!u)continue;const d=vrt(u);if(d){d.focus();break}}})}},[a,e,r,o,i]),null}function bIe(t,e){let{transform:n,...a}=e;return t!=null&&t.length?t.reduce((r,i)=>i({transform:r,...a}),n):n}function xit(t){return K.useMemo(()=>({draggable:{...Sx.draggable,...t?.draggable},droppable:{...Sx.droppable,...t?.droppable},dragOverlay:{...Sx.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Dit(t){let{activeNode:e,measure:n,initialRect:a,config:r=!0}=t;const i=K.useRef(!1),{x:o,y:s}=typeof r=="boolean"?{x:r,y:r}:r;pl(()=>{if(!o&&!s||!e){i.current=!1;return}if(i.current||!a)return;const l=e?.node.current;if(!l||l.isConnected===!1)return;const u=n(l),d=nIe(u,a);if(o||(d.x=0),s||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=rIe(l);p&&p.scrollBy({top:d.y,left:d.x})}},[e,o,s,a,n])}const NS=K.createContext({...ml,scaleX:1,scaleY:1});var im;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(im||(im={}));const Y5n=K.memo(function(e){var n,a,r,i;let{id:o,accessibility:s,autoScroll:A=!0,children:l,sensors:u=Bit,collisionDetection:d=Grt,measuring:p,modifiers:m,...g}=e;const h=K.useReducer(Qit,void 0,Iit),[b,y]=h,[w,E]=Srt(),[k,v]=K.useState(im.Uninitialized),_=k===im.Initialized,{draggable:{active:I,nodes:x,translate:N},droppable:{containers:R}}=b,T=I!=null?x.get(I):null,O=K.useRef({initial:null,translated:null}),$=K.useMemo(()=>{var yt;return I!=null?{id:I,data:(yt=T?.data)!=null?yt:kit,rect:O}:null},[I,T]),F=K.useRef(null),[L,M]=K.useState(null),[P,D]=K.useState(null),q=PB(g,Object.values(g)),U=dv("DndDescribedBy",o),G=K.useMemo(()=>R.getEnabled(),[R]),H=xit(p),{droppableRects:j,measureDroppableContainers:Z,measuringScheduled:J}=dit(G,{dragging:_,dependencies:[N.x,N.y],config:H.droppable}),ae=lit(x,I),ee=K.useMemo(()=>P?DD(P):null,[P]),pe=Xe(),ie=pit(ae,H.draggable.measure);Dit({activeNode:I!=null?x.get(I):null,config:pe.layoutShiftCompensation,initialRect:ie,measure:H.draggable.measure});const re=Soe(ae,H.draggable.measure,ie),ne=Soe(ae?ae.parentElement:null),te=K.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=R.getNodeFor((n=te.current.over)==null?void 0:n.id),Ae=Eit({measure:H.dragOverlay.measure}),Be=(a=Ae.nodeRef.current)!=null?a:ae,de=_?(r=Ae.rect)!=null?r:re:null,Ge=!!(Ae.nodeRef.current&&Ae.rect),oe=fit(Ge?null:re),Je=mIe(Be?Qs(Be):null),Ee=hit(_?le??ae:null),st=wit(Ee),nt=bIe(m,{transform:{x:N.x-oe.x,y:N.y-oe.y,scaleX:1,scaleY:1},activatorEvent:P,active:$,activeNodeRect:re,containerNodeRect:ne,draggingNodeRect:de,over:te.current.over,overlayNodeRect:Ae.rect,scrollableAncestors:Ee,scrollableAncestorRects:st,windowRect:Je}),lt=ee?Xb(ee,N):null,Me=bit(Ee),tt=Foe(Me),ye=Foe(Me,[re]),De=Xb(nt,tt),qe=de?Urt(de,nt):null,ke=$&&qe?d({active:$,collisionRect:qe,droppableRects:j,droppableContainers:G,pointerCoordinates:lt}):null,$e=tIe(ke,"id"),[ue,we]=K.useState(null),W=Ge?nt:Xb(nt,ye),he=Prt(W,(i=ue?.rect)!=null?i:null,re),me=K.useRef(null),Qe=K.useCallback((yt,ht)=>{let{sensor:He,options:at}=ht;if(F.current==null)return;const ze=x.get(F.current);if(!ze)return;const Ve=yt.nativeEvent,bt=new He({active:F.current,activeNode:ze,event:Ve,options:at,context:te,onAbort(We){if(!x.get(We))return;const{onDragAbort:ct}=q.current,wt={id:We};ct?.(wt),w({type:"onDragAbort",event:wt})},onPending(We,_t,ct,wt){if(!x.get(We))return;const{onDragPending:kt}=q.current,It={id:We,constraint:_t,initialCoordinates:ct,offset:wt};kt?.(It),w({type:"onDragPending",event:It})},onStart(We){const _t=F.current;if(_t==null)return;const ct=x.get(_t);if(!ct)return;const{onDragStart:wt}=q.current,Nt={activatorEvent:Ve,active:{id:_t,data:ct.data,rect:O}};Xl.unstable_batchedUpdates(()=>{wt?.(Nt),v(im.Initializing),y({type:Li.DragStart,initialCoordinates:We,active:_t}),w({type:"onDragStart",event:Nt}),M(me.current),D(Ve)})},onMove(We){y({type:Li.DragMove,coordinates:We})},onEnd:it(Li.DragEnd),onCancel:it(Li.DragCancel)});me.current=bt;function it(We){return async function(){const{active:ct,collisions:wt,over:Nt,scrollAdjustedTranslate:kt}=te.current;let It=null;if(ct&&kt){const{cancelDrop:zt}=q.current;It={activatorEvent:Ve,active:ct,collisions:wt,delta:kt,over:Nt},We===Li.DragEnd&&typeof zt=="function"&&await Promise.resolve(zt(It))&&(We=Li.DragCancel)}F.current=null,Xl.unstable_batchedUpdates(()=>{y({type:We}),v(im.Uninitialized),we(null),M(null),D(null),me.current=null;const zt=We===Li.DragEnd?"onDragEnd":"onDragCancel";if(It){const In=q.current[zt];In?.(It),w({type:zt,event:It})}})}}},[x]),xe=K.useCallback((yt,ht)=>(He,at)=>{const ze=He.nativeEvent,Ve=x.get(at);if(F.current!==null||!Ve||ze.dndKit||ze.defaultPrevented)return;const bt={active:Ve};yt(He,ht.options,bt)===!0&&(ze.dndKit={capturedBy:ht.sensor},F.current=at,Qe(He,ht))},[x,Qe]),Te=uit(u,xe);yit(u),pl(()=>{re&&k===im.Initializing&&v(im.Initialized)},[re,k]),K.useEffect(()=>{const{onDragMove:yt}=q.current,{active:ht,activatorEvent:He,collisions:at,over:ze}=te.current;if(!ht||!He)return;const Ve={active:ht,activatorEvent:He,collisions:at,delta:{x:De.x,y:De.y},over:ze};Xl.unstable_batchedUpdates(()=>{yt?.(Ve),w({type:"onDragMove",event:Ve})})},[De.x,De.y]),K.useEffect(()=>{const{active:yt,activatorEvent:ht,collisions:He,droppableContainers:at,scrollAdjustedTranslate:ze}=te.current;if(!yt||F.current==null||!ht||!ze)return;const{onDragOver:Ve}=q.current,bt=at.get($e),it=bt&&bt.rect.current?{id:bt.id,rect:bt.rect.current,data:bt.data,disabled:bt.disabled}:null,We={active:yt,activatorEvent:ht,collisions:He,delta:{x:ze.x,y:ze.y},over:it};Xl.unstable_batchedUpdates(()=>{we(it),Ve?.(We),w({type:"onDragOver",event:We})})},[$e]),pl(()=>{te.current={activatorEvent:P,active:$,activeNode:ae,collisionRect:qe,collisions:ke,droppableRects:j,draggableNodes:x,draggingNode:Be,draggingNodeRect:de,droppableContainers:R,over:ue,scrollableAncestors:Ee,scrollAdjustedTranslate:De},O.current={initial:de,translated:qe}},[$,ae,ke,qe,x,Be,de,j,R,ue,Ee,De]),sit({...pe,delta:N,draggingRect:qe,pointerCoordinates:lt,scrollableAncestors:Ee,scrollableAncestorRects:st});const Oe=K.useMemo(()=>({active:$,activeNode:ae,activeNodeRect:re,activatorEvent:P,collisions:ke,containerNodeRect:ne,dragOverlay:Ae,draggableNodes:x,droppableContainers:R,droppableRects:j,over:ue,measureDroppableContainers:Z,scrollableAncestors:Ee,scrollableAncestorRects:st,measuringConfiguration:H,measuringScheduled:J,windowRect:Je}),[$,ae,re,P,ke,ne,Ae,x,R,j,ue,Z,Ee,st,H,J,Je]),Le=K.useMemo(()=>({activatorEvent:P,activators:Te,active:$,activeNodeRect:re,ariaDescribedById:{draggable:U},dispatch:y,draggableNodes:x,over:ue,measureDroppableContainers:Z}),[P,Te,$,re,y,U,x,ue,Z]);return Ce.createElement(Jve.Provider,{value:E},Ce.createElement(pv.Provider,{value:Le},Ce.createElement(hIe.Provider,{value:Oe},Ce.createElement(NS.Provider,{value:he},l)),Ce.createElement(_it,{disabled:s?.restoreFocus===!1})),Ce.createElement(Trt,{...s,hiddenTextDescribedById:U}));function Xe(){const yt=L?.autoScrollEnabled===!1,ht=typeof A=="object"?A.enabled===!1:A===!1,He=_&&!yt&&!ht;return typeof A=="object"?{...A,enabled:He}:{enabled:He}}}),Sit=K.createContext(null),Roe="button",Nit="Draggable";function Fit(t){let{id:e,data:n,disabled:a=!1,attributes:r}=t;const i=dv(Nit),{activators:o,activatorEvent:s,active:A,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:p}=K.useContext(pv),{role:m=Roe,roleDescription:g="draggable",tabIndex:h=0}=r??{},b=A?.id===e,y=K.useContext(b?NS:Sit),[w,E]=_D(),[k,v]=_D(),_=Cit(o,e),I=PB(n);pl(()=>(d.set(e,{id:e,key:i,node:w,activatorNode:k,data:I}),()=>{const N=d.get(e);N&&N.key===i&&d.delete(e)}),[d,e]);const x=K.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":a,"aria-pressed":b&&m===Roe?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[a,m,h,b,g,u.draggable]);return{active:A,activatorEvent:s,activeNodeRect:l,attributes:x,isDragging:b,listeners:a?void 0:_,node:w,over:p,setNodeRef:E,setActivatorNodeRef:v,transform:y}}function yIe(){return K.useContext(hIe)}const Tit="Droppable",Rit={timeout:25};function Mit(t){let{data:e,disabled:n=!1,id:a,resizeObserverConfig:r}=t;const i=dv(Tit),{active:o,dispatch:s,over:A,measureDroppableContainers:l}=K.useContext(pv),u=K.useRef({disabled:n}),d=K.useRef(!1),p=K.useRef(null),m=K.useRef(null),{disabled:g,updateMeasurementsFor:h,timeout:b}={...Rit,...r},y=PB(h??a),w=K.useCallback(()=>{if(!d.current){d.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(y.current)?y.current:[y.current]),m.current=null},b)},[b]),E=SS({callback:w,disabled:g||!o}),k=K.useCallback((x,N)=>{E&&(N&&(E.unobserve(N),d.current=!1),x&&E.observe(x))},[E]),[v,_]=_D(k),I=PB(e);return K.useEffect(()=>{!E||!v.current||(E.disconnect(),d.current=!1,E.observe(v.current))},[v,E]),K.useEffect(()=>(s({type:Li.RegisterDroppable,element:{id:a,key:i,disabled:n,node:v,rect:p,data:I}}),()=>s({type:Li.UnregisterDroppable,key:i,id:a})),[a]),K.useEffect(()=>{n!==u.current.disabled&&(s({type:Li.SetDroppableDisabled,id:a,key:i,disabled:n}),u.current.disabled=n)},[a,i,n,s]),{active:o,rect:p,isOver:A?.id===a,node:v,over:A,setNodeRef:_}}function Lit(t){let{animation:e,children:n}=t;const[a,r]=K.useState(null),[i,o]=K.useState(null),s=xD(n);return!n&&!a&&s&&r(s),pl(()=>{if(!i)return;const A=a?.key,l=a?.props.id;if(A==null||l==null){r(null);return}Promise.resolve(e(l,i)).then(()=>{r(null)})},[e,a,i]),Ce.createElement(Ce.Fragment,null,n,a?K.cloneElement(a,{ref:o}):null)}const Oit={x:0,y:0,scaleX:1,scaleY:1};function Git(t){let{children:e}=t;return Ce.createElement(pv.Provider,{value:fIe},Ce.createElement(NS.Provider,{value:Oit},e))}const Pit={position:"fixed",touchAction:"none"},qit=t=>xS(t)?"transform 250ms ease":void 0,Uit=K.forwardRef((t,e)=>{let{as:n,activatorEvent:a,adjustScale:r,children:i,className:o,rect:s,style:A,transform:l,transition:u=qit}=t;if(!s)return null;const d=r?l:{...l,scaleX:1,scaleY:1},p={...Pit,width:s.width,height:s.height,top:s.top,left:s.left,transform:Xf.Transform.toString(d),transformOrigin:r&&a?Rrt(a,s):void 0,transition:typeof u=="function"?u(a):u,...A};return Ce.createElement(n,{className:o,style:p,ref:e},i)}),$it=t=>e=>{let{active:n,dragOverlay:a}=e;const r={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[s,A]of Object.entries(i.active))A!==void 0&&(r[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,A));if(i!=null&&i.dragOverlay)for(const[s,A]of Object.entries(i.dragOverlay))A!==void 0&&a.node.style.setProperty(s,A);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&a.node.classList.add(o.dragOverlay),function(){for(const[A,l]of Object.entries(r))n.node.style.setProperty(A,l);o!=null&&o.active&&n.node.classList.remove(o.active)}},jit=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Xf.Transform.toString(e)},{transform:Xf.Transform.toString(n)}]},Hit={duration:250,easing:"ease",keyframes:jit,sideEffects:$it({styles:{active:{opacity:"0"}}})};function zit(t){let{config:e,draggableNodes:n,droppableContainers:a,measuringConfiguration:r}=t;return _S((i,o)=>{if(e===null)return;const s=n.get(i);if(!s)return;const A=s.node.current;if(!A)return;const l=gIe(o);if(!l)return;const{transform:u}=Qs(o).getComputedStyle(o),d=aIe(u);if(!d)return;const p=typeof e=="function"?e:Yit(e);return lIe(A,r.draggable.measure),p({active:{id:i,data:s.data,node:A,rect:r.draggable.measure(A)},draggableNodes:n,dragOverlay:{node:o,rect:r.dragOverlay.measure(l)},droppableContainers:a,measuringConfiguration:r,transform:d})})}function Yit(t){const{duration:e,easing:n,sideEffects:a,keyframes:r}={...Hit,...t};return i=>{let{active:o,dragOverlay:s,transform:A,...l}=i;if(!e)return;const u={x:s.rect.left-o.rect.left,y:s.rect.top-o.rect.top},d={scaleX:A.scaleX!==1?o.rect.width*A.scaleX/s.rect.width:1,scaleY:A.scaleY!==1?o.rect.height*A.scaleY/s.rect.height:1},p={x:A.x-u.x,y:A.y-u.y,...d},m=r({...l,active:o,dragOverlay:s,transform:{initial:A,final:p}}),[g]=m,h=m[m.length-1];if(JSON.stringify(g)===JSON.stringify(h))return;const b=a?.({active:o,dragOverlay:s,...l}),y=s.node.animate(m,{duration:e,easing:n,fill:"forwards"});return new Promise(w=>{y.onfinish=()=>{b?.(),w()}})}}let Moe=0;function Kit(t){return K.useMemo(()=>{if(t!=null)return Moe++,Moe},[t])}const K5n=Ce.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:a,style:r,transition:i,modifiers:o,wrapperElement:s="div",className:A,zIndex:l=999}=t;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:m,draggableNodes:g,droppableContainers:h,dragOverlay:b,over:y,measuringConfiguration:w,scrollableAncestors:E,scrollableAncestorRects:k,windowRect:v}=yIe(),_=K.useContext(NS),I=Kit(d?.id),x=bIe(o,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:E,scrollableAncestorRects:k,transform:_,windowRect:v}),N=uZ(p),R=zit({config:a,draggableNodes:g,droppableContainers:h,measuringConfiguration:w}),T=N?b.setRef:void 0;return Ce.createElement(Git,null,Ce.createElement(Lit,{animation:R},d&&I?Ce.createElement(Uit,{key:I,id:d.id,ref:T,as:s,activatorEvent:u,adjustScale:e,className:A,transition:i,rect:N,style:{zIndex:l,...r},transform:x},n):null))});function CIe(t,e,n){const a=t.slice();return a.splice(n<0?a.length+n:n,0,a.splice(e,1)[0]),a}function Zit(t,e){return t.reduce((n,a,r)=>{const i=e.get(a);return i&&(n[r]=i),n},Array(t.length))}function ZQ(t){return t!==null&&t>=0}function Wit(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Vit(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const wIe=t=>{let{rects:e,activeIndex:n,overIndex:a,index:r}=t;const i=CIe(e,a,n),o=e[r],s=i[r];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},WQ={scaleX:1,scaleY:1},Z5n=t=>{var e;let{activeIndex:n,activeNodeRect:a,index:r,rects:i,overIndex:o}=t;const s=(e=i[n])!=null?e:a;if(!s)return null;if(r===n){const l=i[o];return l?{x:0,y:n<o?l.top+l.height-(s.top+s.height):l.top-s.top,...WQ}:null}const A=Jit(i,r,n);return r>n&&r<=o?{x:0,y:-s.height-A,...WQ}:r<n&&r>=o?{x:0,y:s.height+A,...WQ}:{x:0,y:0,...WQ}};function Jit(t,e,n){const a=t[e],r=t[e-1],i=t[e+1];return a?n<e?r?a.top-(r.top+r.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):r?a.top-(r.top+r.height):0:0}const EIe="Sortable",BIe=Ce.createContext({activeIndex:-1,containerId:EIe,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:wIe,disabled:{draggable:!1,droppable:!1}});function W5n(t){let{children:e,id:n,items:a,strategy:r=wIe,disabled:i=!1}=t;const{active:o,dragOverlay:s,droppableRects:A,over:l,measureDroppableContainers:u}=yIe(),d=dv(EIe,n),p=s.rect!==null,m=K.useMemo(()=>a.map(_=>typeof _=="object"&&"id"in _?_.id:_),[a]),g=o!=null,h=o?m.indexOf(o.id):-1,b=l?m.indexOf(l.id):-1,y=K.useRef(m),w=!Wit(m,y.current),E=b!==-1&&h===-1||w,k=Vit(i);pl(()=>{w&&g&&u(m)},[w,m,g,u]),K.useEffect(()=>{y.current=m},[m]);const v=K.useMemo(()=>({activeIndex:h,containerId:d,disabled:k,disableTransforms:E,items:m,overIndex:b,useDragOverlay:p,sortedRects:Zit(m,A),strategy:r}),[h,d,k.draggable,k.droppable,E,m,b,A,p,r]);return Ce.createElement(BIe.Provider,{value:v},e)}const Xit=t=>{let{id:e,items:n,activeIndex:a,overIndex:r}=t;return CIe(n,a,r).indexOf(e)},eot=t=>{let{containerId:e,isSorting:n,wasDragging:a,index:r,items:i,newIndex:o,previousItems:s,previousContainerId:A,transition:l}=t;return!l||!a||s!==i&&r===o?!1:n?!0:o!==r&&e===A},tot={duration:200,easing:"ease"},kIe="transform",not=Xf.Transition.toString({property:kIe,duration:0,easing:"linear"}),aot={roleDescription:"sortable"};function rot(t){let{disabled:e,index:n,node:a,rect:r}=t;const[i,o]=K.useState(null),s=K.useRef(n);return pl(()=>{if(!e&&n!==s.current&&a.current){const A=r.current;if(A){const l=v1(a.current,{ignoreTransform:!0}),u={x:A.left-l.left,y:A.top-l.top,scaleX:A.width/l.width,scaleY:A.height/l.height};(u.x||u.y)&&o(u)}}n!==s.current&&(s.current=n)},[e,n,a,r]),K.useEffect(()=>{i&&o(null)},[i]),i}function V5n(t){let{animateLayoutChanges:e=eot,attributes:n,disabled:a,data:r,getNewIndex:i=Xit,id:o,strategy:s,resizeObserverConfig:A,transition:l=tot}=t;const{items:u,containerId:d,activeIndex:p,disabled:m,disableTransforms:g,sortedRects:h,overIndex:b,useDragOverlay:y,strategy:w}=K.useContext(BIe),E=iot(a,m),k=u.indexOf(o),v=K.useMemo(()=>({sortable:{containerId:d,index:k,items:u},...r}),[d,r,k,u]),_=K.useMemo(()=>u.slice(u.indexOf(o)),[u,o]),{rect:I,node:x,isOver:N,setNodeRef:R}=Mit({id:o,data:v,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...A}}),{active:T,activatorEvent:O,activeNodeRect:$,attributes:F,setNodeRef:L,listeners:M,isDragging:P,over:D,setActivatorNodeRef:q,transform:U}=Fit({id:o,data:v,attributes:{...aot,...n},disabled:E.draggable}),G=wrt(R,L),H=!!T,j=H&&!g&&ZQ(p)&&ZQ(b),Z=!y&&P,J=Z&&j?U:null,ee=j?J??(s??w)({rects:h,activeNodeRect:$,activeIndex:p,overIndex:b,index:k}):null,pe=ZQ(p)&&ZQ(b)?i({id:o,items:u,activeIndex:p,overIndex:b}):k,ie=T?.id,re=K.useRef({activeId:ie,items:u,newIndex:pe,containerId:d}),ne=u!==re.current.items,te=e({active:T,containerId:d,isDragging:P,isSorting:H,id:o,index:k,items:u,newIndex:re.current.newIndex,previousItems:re.current.items,previousContainerId:re.current.containerId,transition:l,wasDragging:re.current.activeId!=null}),le=rot({disabled:!te,index:k,node:x,rect:I});return K.useEffect(()=>{H&&re.current.newIndex!==pe&&(re.current.newIndex=pe),d!==re.current.containerId&&(re.current.containerId=d),u!==re.current.items&&(re.current.items=u)},[H,pe,d,u]),K.useEffect(()=>{if(ie===re.current.activeId)return;if(ie!=null&&re.current.activeId==null){re.current.activeId=ie;return}const Be=setTimeout(()=>{re.current.activeId=ie},50);return()=>clearTimeout(Be)},[ie]),{active:T,activeIndex:p,attributes:F,data:v,rect:I,index:k,newIndex:pe,items:u,isOver:N,isSorting:H,isDragging:P,listeners:M,node:x,overIndex:b,over:D,setNodeRef:G,setActivatorNodeRef:q,setDroppableNodeRef:R,setDraggableNodeRef:L,transform:le??ee,transition:Ae()};function Ae(){if(le||ne&&re.current.newIndex===k)return not;if(!(Z&&!xS(O)||!l)&&(H||te))return Xf.Transition.toString({...l,property:kIe})}}function iot(t,e){var n,a;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(a=t?.droppable)!=null?a:e.droppable}}function FD(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const oot=[wa.Down,wa.Right,wa.Up,wa.Left],J5n=(t,e)=>{let{context:{active:n,collisionRect:a,droppableRects:r,droppableContainers:i,over:o,scrollableAncestors:s}}=e;if(oot.includes(t.code)){if(t.preventDefault(),!n||!a)return;const A=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=r.get(d.id);if(p)switch(t.code){case wa.Down:a.top<p.top&&A.push(d);break;case wa.Up:a.top>p.top&&A.push(d);break;case wa.Left:a.left>p.left&&A.push(d);break;case wa.Right:a.left<p.left&&A.push(d);break}});const l=Lrt({collisionRect:a,droppableRects:r,droppableContainers:A});let u=tIe(l,"id");if(u===o?.id&&l.length>1&&(u=l[1].id),u!=null){const d=i.get(n.id),p=i.get(u),m=p?r.get(p.id):null,g=p?.node.current;if(g&&m&&d&&p){const b=DS(g).some((_,I)=>s[I]!==_),y=vIe(d,p),w=sot(d,p),E=b||!y?{x:0,y:0}:{x:w?a.width-m.width:0,y:w?a.height-m.height:0},k={x:m.left,y:m.top};return E.x&&E.y?k:qB(k,E)}}}};function vIe(t,e){return!FD(t)||!FD(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function sot(t,e){return!FD(t)||!FD(e)||!vIe(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const X5n="/assets/worker-C7rwD-e5.js";function Y$(t,[e,n]){return Math.min(n,Math.max(e,t))}var Aot=[" ","Enter","ArrowUp","ArrowDown"],cot=[" ","Enter"],e0="Select",[FS,TS,lot]=BK(e0),[I1]=Cl(e0,[lot,g1]),RS=g1(),[uot,og]=I1(e0),[dot,pot]=I1(e0),IIe=t=>{const{__scopeSelect:e,children:n,open:a,defaultOpen:r,onOpenChange:i,value:o,defaultValue:s,onValueChange:A,dir:l,name:u,autoComplete:d,disabled:p,required:m,form:g}=t,h=RS(e),[b,y]=K.useState(null),[w,E]=K.useState(null),[k,v]=K.useState(!1),_=sS(l),[I,x]=Dm({prop:a,defaultProp:r??!1,onChange:i,caller:e0}),[N,R]=Dm({prop:o,defaultProp:s,onChange:A,caller:e0}),T=K.useRef(null),O=b?g||!!b.closest("form"):!0,[$,F]=K.useState(new Set),L=Array.from($).map(M=>M.props.value).join(";");return be.jsx(mK,{...h,children:be.jsxs(uot,{required:m,scope:e,trigger:b,onTriggerChange:y,valueNode:w,onValueNodeChange:E,valueNodeHasChildren:k,onValueNodeHasChildrenChange:v,contentId:xo(),value:N,onValueChange:R,open:I,onOpenChange:x,dir:_,triggerPointerDownPosRef:T,disabled:p,children:[be.jsx(FS.Provider,{scope:e,children:be.jsx(dot,{scope:t.__scopeSelect,onNativeOptionAdd:K.useCallback(M=>{F(P=>new Set(P).add(M))},[]),onNativeOptionRemove:K.useCallback(M=>{F(P=>{const D=new Set(P);return D.delete(M),D})},[]),children:n})}),O?be.jsxs(ZIe,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:d,value:N,onChange:M=>R(M.target.value),disabled:p,form:g,children:[N===void 0?be.jsx("option",{value:""}):null,Array.from($)]},L):null]})})};IIe.displayName=e0;var QIe="SelectTrigger",_Ie=K.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:a=!1,...r}=t,i=RS(n),o=og(QIe,n),s=o.disabled||a,A=ca(e,o.onTriggerChange),l=TS(n),u=K.useRef("touch"),[d,p,m]=VIe(h=>{const b=l().filter(E=>!E.disabled),y=b.find(E=>E.value===o.value),w=JIe(b,h,y);w!==void 0&&o.onValueChange(w.value)}),g=h=>{s||(o.onOpenChange(!0),m()),h&&(o.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return be.jsx(gK,{asChild:!0,...i,children:be.jsx(zn.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":WIe(o.value)?"":void 0,...r,ref:A,onClick:on(r.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&g(h)}),onPointerDown:on(r.onPointerDown,h=>{u.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(g(h),h.preventDefault())}),onKeyDown:on(r.onKeyDown,h=>{const b=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(b&&h.key===" ")&&Aot.includes(h.key)&&(g(),h.preventDefault())})})})});_Ie.displayName=QIe;var xIe="SelectValue",DIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,className:a,style:r,children:i,placeholder:o="",...s}=t,A=og(xIe,n),{onValueNodeHasChildrenChange:l}=A,u=i!==void 0,d=ca(e,A.onValueNodeChange);return io(()=>{l(u)},[l,u]),be.jsx(zn.span,{...s,ref:d,style:{pointerEvents:"none"},children:WIe(A.value)?be.jsx(be.Fragment,{children:o}):i})});DIe.displayName=xIe;var mot="SelectIcon",SIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,children:a,...r}=t;return be.jsx(zn.span,{"aria-hidden":!0,...r,ref:e,children:a||"▼"})});SIe.displayName=mot;var got="SelectPortal",NIe=t=>be.jsx(Xk,{asChild:!0,...t});NIe.displayName=got;var t0="SelectContent",FIe=K.forwardRef((t,e)=>{const n=og(t0,t.__scopeSelect),[a,r]=K.useState();if(io(()=>{r(new DocumentFragment)},[]),!n.open){const i=a;return i?Xl.createPortal(be.jsx(TIe,{scope:t.__scopeSelect,children:be.jsx(FS.Slot,{scope:t.__scopeSelect,children:be.jsx("div",{children:t.children})})}),i):null}return be.jsx(RIe,{...t,ref:e})});FIe.displayName=t0;var jc=10,[TIe,sg]=I1(t0),fot="SelectContentImpl",hot=C2("SelectContent.RemoveScroll"),RIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:o,side:s,sideOffset:A,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:h,avoidCollisions:b,...y}=t,w=og(t0,n),[E,k]=K.useState(null),[v,_]=K.useState(null),I=ca(e,ee=>k(ee)),[x,N]=K.useState(null),[R,T]=K.useState(null),O=TS(n),[$,F]=K.useState(!1),L=K.useRef(!1);K.useEffect(()=>{if(E)return vK(E)},[E]),kK();const M=K.useCallback(ee=>{const[pe,...ie]=O().map(te=>te.ref.current),[re]=ie.slice(-1),ne=document.activeElement;for(const te of ee)if(te===ne||(te?.scrollIntoView({block:"nearest"}),te===pe&&v&&(v.scrollTop=0),te===re&&v&&(v.scrollTop=v.scrollHeight),te?.focus(),document.activeElement!==ne))return},[O,v]),P=K.useCallback(()=>M([x,E]),[M,x,E]);K.useEffect(()=>{$&&P()},[$,P]);const{onOpenChange:D,triggerPointerDownPosRef:q}=w;K.useEffect(()=>{if(E){let ee={x:0,y:0};const pe=re=>{ee={x:Math.abs(Math.round(re.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(re.pageY)-(q.current?.y??0))}},ie=re=>{ee.x<=10&&ee.y<=10?re.preventDefault():E.contains(re.target)||D(!1),document.removeEventListener("pointermove",pe),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",ie,{capture:!0})}}},[E,D,q]),K.useEffect(()=>{const ee=()=>D(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[D]);const[U,G]=VIe(ee=>{const pe=O().filter(ne=>!ne.disabled),ie=pe.find(ne=>ne.ref.current===document.activeElement),re=JIe(pe,ee,ie);re&&setTimeout(()=>re.ref.current.focus())}),H=K.useCallback((ee,pe,ie)=>{const re=!L.current&&!ie;(w.value!==void 0&&w.value===pe||re)&&(N(ee),re&&(L.current=!0))},[w.value]),j=K.useCallback(()=>E?.focus(),[E]),Z=K.useCallback((ee,pe,ie)=>{const re=!L.current&&!ie;(w.value!==void 0&&w.value===pe||re)&&T(ee)},[w.value]),J=a==="popper"?K$:MIe,ae=J===K$?{side:s,sideOffset:A,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:h,avoidCollisions:b}:{};return be.jsx(TIe,{scope:n,content:E,viewport:v,onViewportChange:_,itemRefCallback:H,selectedItem:x,onItemLeave:j,itemTextRefCallback:Z,focusSelectedItem:P,selectedItemText:R,position:a,isPositioned:$,searchRef:U,children:be.jsx(lS,{as:hot,allowPinchZoom:!0,children:be.jsx(AS,{asChild:!0,trapped:w.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:on(r,ee=>{w.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:be.jsx(Vk,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:be.jsx(J,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:ee=>ee.preventDefault(),...y,...ae,onPlaced:()=>F(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:on(y.onKeyDown,ee=>{const pe=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!pe&&ee.key.length===1&&G(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let re=O().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const ne=ee.target,te=re.indexOf(ne);re=re.slice(te+1)}setTimeout(()=>M(re)),ee.preventDefault()}})})})})})})});RIe.displayName=fot;var bot="SelectItemAlignedPosition",MIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:a,...r}=t,i=og(t0,n),o=sg(t0,n),[s,A]=K.useState(null),[l,u]=K.useState(null),d=ca(e,I=>u(I)),p=TS(n),m=K.useRef(!1),g=K.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:y,focusSelectedItem:w}=o,E=K.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&l&&h&&b&&y){const I=i.trigger.getBoundingClientRect(),x=l.getBoundingClientRect(),N=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const ne=R.left-x.left,te=N.left-ne,le=I.left-te,Ae=I.width+le,Be=Math.max(Ae,x.width),de=window.innerWidth-jc,Ge=Y$(te,[jc,Math.max(jc,de-Be)]);s.style.minWidth=Ae+"px",s.style.left=Ge+"px"}else{const ne=x.right-R.right,te=window.innerWidth-N.right-ne,le=window.innerWidth-I.right-te,Ae=I.width+le,Be=Math.max(Ae,x.width),de=window.innerWidth-jc,Ge=Y$(te,[jc,Math.max(jc,de-Be)]);s.style.minWidth=Ae+"px",s.style.right=Ge+"px"}const T=p(),O=window.innerHeight-jc*2,$=h.scrollHeight,F=window.getComputedStyle(l),L=parseInt(F.borderTopWidth,10),M=parseInt(F.paddingTop,10),P=parseInt(F.borderBottomWidth,10),D=parseInt(F.paddingBottom,10),q=L+M+$+D+P,U=Math.min(b.offsetHeight*5,q),G=window.getComputedStyle(h),H=parseInt(G.paddingTop,10),j=parseInt(G.paddingBottom,10),Z=I.top+I.height/2-jc,J=O-Z,ae=b.offsetHeight/2,ee=b.offsetTop+ae,pe=L+M+ee,ie=q-pe;if(pe<=Z){const ne=T.length>0&&b===T[T.length-1].ref.current;s.style.bottom="0px";const te=l.clientHeight-h.offsetTop-h.offsetHeight,le=Math.max(J,ae+(ne?j:0)+te+P),Ae=pe+le;s.style.height=Ae+"px"}else{const ne=T.length>0&&b===T[0].ref.current;s.style.top="0px";const le=Math.max(Z,L+h.offsetTop+(ne?H:0)+ae)+ie;s.style.height=le+"px",h.scrollTop=pe-Z+h.offsetTop}s.style.margin=`${jc}px 0`,s.style.minHeight=U+"px",s.style.maxHeight=O+"px",a?.(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,s,l,h,b,y,i.dir,a]);io(()=>E(),[E]);const[k,v]=K.useState();io(()=>{l&&v(window.getComputedStyle(l).zIndex)},[l]);const _=K.useCallback(I=>{I&&g.current===!0&&(E(),w?.(),g.current=!1)},[E,w]);return be.jsx(Cot,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:_,children:be.jsx("div",{ref:A,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:be.jsx(zn.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});MIe.displayName=bot;var yot="SelectPopperPosition",K$=K.forwardRef((t,e)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=jc,...i}=t,o=RS(n);return be.jsx(fK,{...o,...i,ref:e,align:a,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});K$.displayName=yot;var[Cot,dZ]=I1(t0,{}),Z$="SelectViewport",LIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:a,...r}=t,i=sg(Z$,n),o=dZ(Z$,n),s=ca(e,i.onViewportChange),A=K.useRef(0);return be.jsxs(be.Fragment,{children:[be.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),be.jsx(FS.Slot,{scope:n,children:be.jsx(zn.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:on(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=o;if(p?.current&&d){const m=Math.abs(A.current-u.scrollTop);if(m>0){const g=window.innerHeight-jc*2,h=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(h,b);if(y<g){const w=y+m,E=Math.min(g,w),k=w-E;d.style.height=E+"px",d.style.bottom==="0px"&&(u.scrollTop=k>0?k:0,d.style.justifyContent="flex-end")}}}A.current=u.scrollTop})})})]})});LIe.displayName=Z$;var OIe="SelectGroup",[wot,Eot]=I1(OIe),GIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,r=xo();return be.jsx(wot,{scope:n,id:r,children:be.jsx(zn.div,{role:"group","aria-labelledby":r,...a,ref:e})})});GIe.displayName=OIe;var PIe="SelectLabel",qIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,r=Eot(PIe,n);return be.jsx(zn.div,{id:r.id,...a,ref:e})});qIe.displayName=PIe;var TD="SelectItem",[Bot,UIe]=I1(TD),$Ie=K.forwardRef((t,e)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:i,...o}=t,s=og(TD,n),A=sg(TD,n),l=s.value===a,[u,d]=K.useState(i??""),[p,m]=K.useState(!1),g=ca(e,w=>A.itemRefCallback?.(w,a,r)),h=xo(),b=K.useRef("touch"),y=()=>{r||(s.onValueChange(a),s.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return be.jsx(Bot,{scope:n,value:a,disabled:r,textId:h,isSelected:l,onItemTextChange:K.useCallback(w=>{d(E=>E||(w?.textContent??"").trim())},[]),children:be.jsx(FS.ItemSlot,{scope:n,value:a,disabled:r,textValue:u,children:be.jsx(zn.div,{role:"option","aria-labelledby":h,"data-highlighted":p?"":void 0,"aria-selected":l&&p,"data-state":l?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,ref:g,onFocus:on(o.onFocus,()=>m(!0)),onBlur:on(o.onBlur,()=>m(!1)),onClick:on(o.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:on(o.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:on(o.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:on(o.onPointerMove,w=>{b.current=w.pointerType,r?A.onItemLeave?.():b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:on(o.onPointerLeave,w=>{w.currentTarget===document.activeElement&&A.onItemLeave?.()}),onKeyDown:on(o.onKeyDown,w=>{A.searchRef?.current!==""&&w.key===" "||(cot.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});$Ie.displayName=TD;var Pw="SelectItemText",jIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,className:a,style:r,...i}=t,o=og(Pw,n),s=sg(Pw,n),A=UIe(Pw,n),l=pot(Pw,n),[u,d]=K.useState(null),p=ca(e,y=>d(y),A.onItemTextChange,y=>s.itemTextRefCallback?.(y,A.value,A.disabled)),m=u?.textContent,g=K.useMemo(()=>be.jsx("option",{value:A.value,disabled:A.disabled,children:m},A.value),[A.disabled,A.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=l;return io(()=>(h(g),()=>b(g)),[h,b,g]),be.jsxs(be.Fragment,{children:[be.jsx(zn.span,{id:A.textId,...i,ref:p}),A.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Xl.createPortal(i.children,o.valueNode):null]})});jIe.displayName=Pw;var HIe="SelectItemIndicator",zIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t;return UIe(HIe,n).isSelected?be.jsx(zn.span,{"aria-hidden":!0,...a,ref:e}):null});zIe.displayName=HIe;var W$="SelectScrollUpButton",kot=K.forwardRef((t,e)=>{const n=sg(W$,t.__scopeSelect),a=dZ(W$,t.__scopeSelect),[r,i]=K.useState(!1),o=ca(e,a.onScrollButtonChange);return io(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=A.scrollTop>0;i(l)};const A=n.viewport;return s(),A.addEventListener("scroll",s),()=>A.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?be.jsx(YIe,{...t,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:A}=n;s&&A&&(s.scrollTop=s.scrollTop-A.offsetHeight)}}):null});kot.displayName=W$;var V$="SelectScrollDownButton",vot=K.forwardRef((t,e)=>{const n=sg(V$,t.__scopeSelect),a=dZ(V$,t.__scopeSelect),[r,i]=K.useState(!1),o=ca(e,a.onScrollButtonChange);return io(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=A.scrollHeight-A.clientHeight,u=Math.ceil(A.scrollTop)<l;i(u)};const A=n.viewport;return s(),A.addEventListener("scroll",s),()=>A.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),r?be.jsx(YIe,{...t,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:A}=n;s&&A&&(s.scrollTop=s.scrollTop+A.offsetHeight)}}):null});vot.displayName=V$;var YIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=t,i=sg("SelectScrollButton",n),o=K.useRef(null),s=TS(n),A=K.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return K.useEffect(()=>()=>A(),[A]),io(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),be.jsx(zn.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:on(r.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(a,50))}),onPointerMove:on(r.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(a,50))}),onPointerLeave:on(r.onPointerLeave,()=>{A()})})}),Iot="SelectSeparator",KIe=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t;return be.jsx(zn.div,{"aria-hidden":!0,...a,ref:e})});KIe.displayName=Iot;var J$="SelectArrow",Qot=K.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,r=RS(n),i=og(J$,n),o=sg(J$,n);return i.open&&o.position==="popper"?be.jsx(hK,{...r,...a,ref:e}):null});Qot.displayName=J$;var _ot="SelectBubbleInput",ZIe=K.forwardRef(({__scopeSelect:t,value:e,...n},a)=>{const r=K.useRef(null),i=ca(a,r),o=wve(e);return K.useEffect(()=>{const s=r.current;if(!s)return;const A=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(A,"value").set;if(o!==e&&u){const d=new Event("change",{bubbles:!0});u.call(s,e),s.dispatchEvent(d)}},[o,e]),be.jsx(zn.select,{...n,style:{...AEe,...n.style},ref:i,defaultValue:e})});ZIe.displayName=_ot;function WIe(t){return t===""||t===void 0}function VIe(t){const e=Io(t),n=K.useRef(""),a=K.useRef(0),r=K.useCallback(o=>{const s=n.current+o;e(s),(function A(l){n.current=l,window.clearTimeout(a.current),l!==""&&(a.current=window.setTimeout(()=>A(""),1e3))})(s)},[e]),i=K.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return K.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,r,i]}function JIe(t,e,n){const r=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=xot(t,Math.max(i,0));r.length===1&&(o=o.filter(l=>l!==n));const A=o.find(l=>l.textValue.toLowerCase().startsWith(r.toLowerCase()));return A!==n?A:void 0}function xot(t,e){return t.map((n,a)=>t[(e+a)%t.length])}var eNn=IIe,tNn=_Ie,nNn=DIe,aNn=SIe,rNn=NIe,iNn=FIe,oNn=LIe,sNn=GIe,ANn=qIe,cNn=$Ie,lNn=jIe,uNn=zIe,dNn=KIe;const Loe=t=>Symbol.iterator in t,Ooe=t=>"entries"in t,Goe=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),a=e instanceof Map?e:new Map(e.entries());if(n.size!==a.size)return!1;for(const[r,i]of n)if(!a.has(r)||!Object.is(i,a.get(r)))return!1;return!0},Dot=(t,e)=>{const n=t[Symbol.iterator](),a=e[Symbol.iterator]();let r=n.next(),i=a.next();for(;!r.done&&!i.done;){if(!Object.is(r.value,i.value))return!1;r=n.next(),i=a.next()}return!!r.done&&!!i.done};function Sot(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Loe(t)&&Loe(e)?Ooe(t)&&Ooe(e)?Goe(t,e):Dot(t,e):Goe({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function pNn(t){const e=Ce.useRef(void 0);return n=>{const a=t(n);return Sot(e.current,a)?e.current:e.current=a}}function Not(t,e){return K.useReducer((n,a)=>e[n][a]??n,t)}var pZ="ScrollArea",[XIe]=Cl(pZ),[Fot,Mc]=XIe(pZ),eQe=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:a="hover",dir:r,scrollHideDelay:i=600,...o}=t,[s,A]=K.useState(null),[l,u]=K.useState(null),[d,p]=K.useState(null),[m,g]=K.useState(null),[h,b]=K.useState(null),[y,w]=K.useState(0),[E,k]=K.useState(0),[v,_]=K.useState(!1),[I,x]=K.useState(!1),N=ca(e,T=>A(T)),R=sS(r);return be.jsx(Fot,{scope:n,type:a,dir:R,scrollHideDelay:i,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:v,onScrollbarXEnabledChange:_,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:I,onScrollbarYEnabledChange:x,onCornerWidthChange:w,onCornerHeightChange:k,children:be.jsx(zn.div,{dir:R,...o,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":E+"px",...t.style}})})});eQe.displayName=pZ;var tQe="ScrollAreaViewport",nQe=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:a,nonce:r,...i}=t,o=Mc(tQe,n),s=K.useRef(null),A=ca(e,s,o.onViewportChange);return be.jsxs(be.Fragment,{children:[be.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),be.jsx(zn.div,{"data-radix-scroll-area-viewport":"",...i,ref:A,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style},children:be.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});nQe.displayName=tQe;var Iu="ScrollAreaScrollbar",Tot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=Mc(Iu,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=r,s=t.orientation==="horizontal";return K.useEffect(()=>(s?i(!0):o(!0),()=>{s?i(!1):o(!1)}),[s,i,o]),r.type==="hover"?be.jsx(Rot,{...a,ref:e,forceMount:n}):r.type==="scroll"?be.jsx(Mot,{...a,ref:e,forceMount:n}):r.type==="auto"?be.jsx(aQe,{...a,ref:e,forceMount:n}):r.type==="always"?be.jsx(mZ,{...a,ref:e}):null});Tot.displayName=Iu;var Rot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=Mc(Iu,t.__scopeScrollArea),[i,o]=K.useState(!1);return K.useEffect(()=>{const s=r.scrollArea;let A=0;if(s){const l=()=>{window.clearTimeout(A),o(!0)},u=()=>{A=window.setTimeout(()=>o(!1),r.scrollHideDelay)};return s.addEventListener("pointerenter",l),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(A),s.removeEventListener("pointerenter",l),s.removeEventListener("pointerleave",u)}}},[r.scrollArea,r.scrollHideDelay]),be.jsx(vs,{present:n||i,children:be.jsx(aQe,{"data-state":i?"visible":"hidden",...a,ref:e})})}),Mot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=Mc(Iu,t.__scopeScrollArea),i=t.orientation==="horizontal",o=LS(()=>A("SCROLL_END"),100),[s,A]=Not("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return K.useEffect(()=>{if(s==="idle"){const l=window.setTimeout(()=>A("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(l)}},[s,r.scrollHideDelay,A]),K.useEffect(()=>{const l=r.viewport,u=i?"scrollLeft":"scrollTop";if(l){let d=l[u];const p=()=>{const m=l[u];d!==m&&(A("SCROLL"),o()),d=m};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[r.viewport,i,A,o]),be.jsx(vs,{present:n||s!=="hidden",children:be.jsx(mZ,{"data-state":s==="hidden"?"hidden":"visible",...a,ref:e,onPointerEnter:on(t.onPointerEnter,()=>A("POINTER_ENTER")),onPointerLeave:on(t.onPointerLeave,()=>A("POINTER_LEAVE"))})})}),aQe=K.forwardRef((t,e)=>{const n=Mc(Iu,t.__scopeScrollArea),{forceMount:a,...r}=t,[i,o]=K.useState(!1),s=t.orientation==="horizontal",A=LS(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?l:u)}},10);return k2(n.viewport,A),k2(n.content,A),be.jsx(vs,{present:a||i,children:be.jsx(mZ,{"data-state":i?"visible":"hidden",...r,ref:e})})}),mZ=K.forwardRef((t,e)=>{const{orientation:n="vertical",...a}=t,r=Mc(Iu,t.__scopeScrollArea),i=K.useRef(null),o=K.useRef(0),[s,A]=K.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=sQe(s.viewport,s.content),u={...a,sizes:s,onSizesChange:A,hasThumb:l>0&&l<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function d(p,m){return $ot(p,o.current,s,m)}return n==="horizontal"?be.jsx(Lot,{...u,ref:e,onThumbPositionChange:()=>{if(r.viewport&&i.current){const p=r.viewport.scrollLeft,m=Poe(p,s,r.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollLeft=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollLeft=d(p,r.dir))}}):n==="vertical"?be.jsx(Oot,{...u,ref:e,onThumbPositionChange:()=>{if(r.viewport&&i.current){const p=r.viewport.scrollTop,m=Poe(p,s);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollTop=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollTop=d(p))}}):null}),Lot=K.forwardRef((t,e)=>{const{sizes:n,onSizesChange:a,...r}=t,i=Mc(Iu,t.__scopeScrollArea),[o,s]=K.useState(),A=K.useRef(null),l=ca(e,A,i.onScrollbarXChange);return K.useEffect(()=>{A.current&&s(getComputedStyle(A.current))},[A]),be.jsx(iQe,{"data-orientation":"horizontal",...r,ref:l,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":MS(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.x),onDragScroll:u=>t.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;t.onWheelScroll(p),cQe(p,d)&&u.preventDefault()}},onResize:()=>{A.current&&i.viewport&&o&&a({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:A.current.clientWidth,paddingStart:MD(o.paddingLeft),paddingEnd:MD(o.paddingRight)}})}})}),Oot=K.forwardRef((t,e)=>{const{sizes:n,onSizesChange:a,...r}=t,i=Mc(Iu,t.__scopeScrollArea),[o,s]=K.useState(),A=K.useRef(null),l=ca(e,A,i.onScrollbarYChange);return K.useEffect(()=>{A.current&&s(getComputedStyle(A.current))},[A]),be.jsx(iQe,{"data-orientation":"vertical",...r,ref:l,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":MS(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.y),onDragScroll:u=>t.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;t.onWheelScroll(p),cQe(p,d)&&u.preventDefault()}},onResize:()=>{A.current&&i.viewport&&o&&a({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:A.current.clientHeight,paddingStart:MD(o.paddingTop),paddingEnd:MD(o.paddingBottom)}})}})}),[Got,rQe]=XIe(Iu),iQe=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:r,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:A,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=t,m=Mc(Iu,n),[g,h]=K.useState(null),b=ca(e,N=>h(N)),y=K.useRef(null),w=K.useRef(""),E=m.viewport,k=a.content-a.viewport,v=Io(u),_=Io(A),I=LS(d,10);function x(N){if(y.current){const R=N.clientX-y.current.left,T=N.clientY-y.current.top;l({x:R,y:T})}}return K.useEffect(()=>{const N=R=>{const T=R.target;g?.contains(T)&&v(R,k)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[E,g,k,v]),K.useEffect(_,[a,_]),k2(g,I),k2(m.content,I),be.jsx(Got,{scope:n,scrollbar:g,hasThumb:r,onThumbChange:Io(i),onThumbPointerUp:Io(o),onThumbPositionChange:_,onThumbPointerDown:Io(s),children:be.jsx(zn.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:on(t.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),y.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),x(N))}),onPointerMove:on(t.onPointerMove,x),onPointerUp:on(t.onPointerUp,N=>{const R=N.target;R.hasPointerCapture(N.pointerId)&&R.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=w.current,m.viewport&&(m.viewport.style.scrollBehavior=""),y.current=null})})})}),RD="ScrollAreaThumb",Pot=K.forwardRef((t,e)=>{const{forceMount:n,...a}=t,r=rQe(RD,t.__scopeScrollArea);return be.jsx(vs,{present:n||r.hasThumb,children:be.jsx(qot,{ref:e,...a})})}),qot=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:a,...r}=t,i=Mc(RD,n),o=rQe(RD,n),{onThumbPositionChange:s}=o,A=ca(e,d=>o.onThumbChange(d)),l=K.useRef(void 0),u=LS(()=>{l.current&&(l.current(),l.current=void 0)},100);return K.useEffect(()=>{const d=i.viewport;if(d){const p=()=>{if(u(),!l.current){const m=jot(d,s);l.current=m,s()}};return s(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[i.viewport,u,s]),be.jsx(zn.div,{"data-state":o.hasThumb?"visible":"hidden",...r,ref:A,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:on(t.onPointerDownCapture,d=>{const m=d.target.getBoundingClientRect(),g=d.clientX-m.left,h=d.clientY-m.top;o.onThumbPointerDown({x:g,y:h})}),onPointerUp:on(t.onPointerUp,o.onThumbPointerUp)})});Pot.displayName=RD;var gZ="ScrollAreaCorner",oQe=K.forwardRef((t,e)=>{const n=Mc(gZ,t.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?be.jsx(Uot,{...t,ref:e}):null});oQe.displayName=gZ;var Uot=K.forwardRef((t,e)=>{const{__scopeScrollArea:n,...a}=t,r=Mc(gZ,n),[i,o]=K.useState(0),[s,A]=K.useState(0),l=!!(i&&s);return k2(r.scrollbarX,()=>{const u=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(u),A(u)}),k2(r.scrollbarY,()=>{const u=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(u),o(u)}),l?be.jsx(zn.div,{...a,ref:e,style:{width:i,height:s,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function MD(t){return t?parseInt(t,10):0}function sQe(t,e){const n=t/e;return isNaN(n)?0:n}function MS(t){const e=sQe(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=(t.scrollbar.size-n)*e;return Math.max(a,18)}function $ot(t,e,n,a="ltr"){const r=MS(n),i=r/2,o=e||i,s=r-o,A=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=a==="ltr"?[0,u]:[u*-1,0];return AQe([A,l],d)(t)}function Poe(t,e,n="ltr"){const a=MS(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-r,o=e.content-e.viewport,s=i-a,A=n==="ltr"?[0,o]:[o*-1,0],l=Y$(t,A);return AQe([0,o],[0,s])(l)}function AQe(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const a=(e[1]-e[0])/(t[1]-t[0]);return e[0]+a*(n-t[0])}}function cQe(t,e){return t>0&&t<e}var jot=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},a=0;return(function r(){const i={left:t.scrollLeft,top:t.scrollTop},o=n.left!==i.left,s=n.top!==i.top;(o||s)&&e(),n=i,a=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(a)};function LS(t,e){const n=Io(t),a=K.useRef(0);return K.useEffect(()=>()=>window.clearTimeout(a.current),[]),K.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,e)},[n,e])}function k2(t,e){const n=Io(e);io(()=>{let a=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(a),r.unobserve(t)}}},[t,n])}var mNn=eQe,gNn=nQe,fNn=oQe;const fZ=K.createContext({});function hZ(t){const e=K.useRef(null);return e.current===null&&(e.current=t()),e.current}const bZ=typeof window<"u",lQe=bZ?K.useLayoutEffect:K.useEffect,OS=K.createContext(null);function yZ(t,e){t.indexOf(e)===-1&&t.push(e)}function CZ(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Yd=(t,e,n)=>n>e?e:n<t?t:n;let wZ=()=>{};const Kd={},uQe=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function dQe(t){return typeof t=="object"&&t!==null}const pQe=t=>/^0[^.\s]+$/u.test(t);function EZ(t){let e;return()=>(e===void 0&&(e=t()),e)}const Bc=t=>t,Hot=(t,e)=>n=>e(t(n)),mv=(...t)=>t.reduce(Hot),$B=(t,e,n)=>{const a=e-t;return a===0?1:(n-t)/a};class BZ{constructor(){this.subscriptions=[]}add(e){return yZ(this.subscriptions,e),()=>CZ(this.subscriptions,e)}notify(e,n,a){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,a);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(e,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const uu=t=>t*1e3,hc=t=>t/1e3;function mQe(t,e){return e?t*(1e3/e):0}const gQe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,zot=1e-7,Yot=12;function Kot(t,e,n,a,r){let i,o,s=0;do o=e+(n-e)/2,i=gQe(o,a,r)-t,i>0?n=o:e=o;while(Math.abs(i)>zot&&++s<Yot);return o}function gv(t,e,n,a){if(t===e&&n===a)return Bc;const r=i=>Kot(i,0,1,t,n);return i=>i===0||i===1?i:gQe(r(i),e,a)}const fQe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,hQe=t=>e=>1-t(1-e),bQe=gv(.33,1.53,.69,.99),kZ=hQe(bQe),yQe=fQe(kZ),CQe=t=>(t*=2)<1?.5*kZ(t):.5*(2-Math.pow(2,-10*(t-1))),vZ=t=>1-Math.sin(Math.acos(t)),wQe=hQe(vZ),EQe=fQe(vZ),Zot=gv(.42,0,1,1),Wot=gv(0,0,.58,1),BQe=gv(.42,0,.58,1),Vot=t=>Array.isArray(t)&&typeof t[0]!="number",kQe=t=>Array.isArray(t)&&typeof t[0]=="number",Jot={linear:Bc,easeIn:Zot,easeInOut:BQe,easeOut:Wot,circIn:vZ,circInOut:EQe,circOut:wQe,backIn:kZ,backInOut:yQe,backOut:bQe,anticipate:CQe},Xot=t=>typeof t=="string",qoe=t=>{if(kQe(t)){wZ(t.length===4);const[e,n,a,r]=t;return gv(e,n,a,r)}else if(Xot(t))return Jot[t];return t},VQ=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function est(t,e){let n=new Set,a=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function A(u){o.has(u)&&(l.schedule(u),t()),u(s)}const l={schedule:(u,d=!1,p=!1)=>{const g=p&&r?n:a;return d&&o.add(u),g.has(u)||g.add(u),u},cancel:u=>{a.delete(u),o.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[n,a]=[a,n],n.forEach(A),n.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const tst=40;function vQe(t,e){let n=!1,a=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=VQ.reduce((E,k)=>(E[k]=est(i),E),{}),{setup:s,read:A,resolveKeyframes:l,preUpdate:u,update:d,preRender:p,render:m,postRender:g}=o,h=()=>{const E=Kd.useManualTiming?r.timestamp:performance.now();n=!1,Kd.useManualTiming||(r.delta=a?1e3/60:Math.max(Math.min(E-r.timestamp,tst),1)),r.timestamp=E,r.isProcessing=!0,s.process(r),A.process(r),l.process(r),u.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,n&&e&&(a=!1,t(h))},b=()=>{n=!0,a=!0,r.isProcessing||t(h)};return{schedule:VQ.reduce((E,k)=>{const v=o[k];return E[k]=(_,I=!1,x=!1)=>(n||b(),v.schedule(_,I,x)),E},{}),cancel:E=>{for(let k=0;k<VQ.length;k++)o[VQ[k]].cancel(E)},state:r,steps:o}}const{schedule:_r,cancel:Fm,state:Bo,steps:g9}=vQe(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bc,!0);let Nx;function nst(){Nx=void 0}const Js={now:()=>(Nx===void 0&&Js.set(Bo.isProcessing||Kd.useManualTiming?Bo.timestamp:performance.now()),Nx),set:t=>{Nx=t,queueMicrotask(nst)}},IQe=t=>e=>typeof e=="string"&&e.startsWith(t),QQe=IQe("--"),ast=IQe("var(--"),IZ=t=>ast(t)?rst.test(t.split("/*")[0].trim()):!1,rst=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Q1={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},jB={...Q1,transform:t=>Yd(0,1,t)},JQ={...Q1,default:1},XE=t=>Math.round(t*1e5)/1e5,QZ=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ist(t){return t==null}const ost=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,_Z=(t,e)=>n=>!!(typeof n=="string"&&ost.test(n)&&n.startsWith(t)||e&&!ist(n)&&Object.prototype.hasOwnProperty.call(n,e)),_Qe=(t,e,n)=>a=>{if(typeof a!="string")return a;const[r,i,o,s]=a.match(QZ);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},sst=t=>Yd(0,255,t),f9={...Q1,transform:t=>Math.round(sst(t))},xf={test:_Z("rgb","red"),parse:_Qe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:a=1})=>"rgba("+f9.transform(t)+", "+f9.transform(e)+", "+f9.transform(n)+", "+XE(jB.transform(a))+")"};function Ast(t){let e="",n="",a="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),a=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),a=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,a+=a,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:r?parseInt(r,16)/255:1}}const X$={test:_Z("#"),parse:Ast,transform:xf.transform},fv=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),em=fv("deg"),du=fv("%"),qn=fv("px"),cst=fv("vh"),lst=fv("vw"),Uoe={...du,parse:t=>du.parse(t)/100,transform:t=>du.transform(t*100)},Fb={test:_Z("hsl","hue"),parse:_Qe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:a=1})=>"hsla("+Math.round(t)+", "+du.transform(XE(e))+", "+du.transform(XE(n))+", "+XE(jB.transform(a))+")"},mi={test:t=>xf.test(t)||X$.test(t)||Fb.test(t),parse:t=>xf.test(t)?xf.parse(t):Fb.test(t)?Fb.parse(t):X$.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?xf.transform(t):Fb.transform(t),getAnimatableNone:t=>{const e=mi.parse(t);return e.alpha=0,mi.transform(e)}},ust=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function dst(t){return isNaN(t)&&typeof t=="string"&&(t.match(QZ)?.length||0)+(t.match(ust)?.length||0)>0}const xQe="number",DQe="color",pst="var",mst="var(",$oe="${}",gst=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function HB(t){const e=t.toString(),n=[],a={color:[],number:[],var:[]},r=[];let i=0;const s=e.replace(gst,A=>(mi.test(A)?(a.color.push(i),r.push(DQe),n.push(mi.parse(A))):A.startsWith(mst)?(a.var.push(i),r.push(pst),n.push(A)):(a.number.push(i),r.push(xQe),n.push(parseFloat(A))),++i,$oe)).split($oe);return{values:n,split:s,indexes:a,types:r}}function SQe(t){return HB(t).values}function NQe(t){const{split:e,types:n}=HB(t),a=e.length;return r=>{let i="";for(let o=0;o<a;o++)if(i+=e[o],r[o]!==void 0){const s=n[o];s===xQe?i+=XE(r[o]):s===DQe?i+=mi.transform(r[o]):i+=r[o]}return i}}const fst=t=>typeof t=="number"?0:mi.test(t)?mi.getAnimatableNone(t):t;function hst(t){const e=SQe(t);return NQe(t)(e.map(fst))}const Tm={test:dst,parse:SQe,createTransformer:NQe,getAnimatableNone:hst};function h9(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function bst({hue:t,saturation:e,lightness:n,alpha:a}){t/=360,e/=100,n/=100;let r=0,i=0,o=0;if(!e)r=i=o=n;else{const s=n<.5?n*(1+e):n+e-n*e,A=2*n-s;r=h9(A,s,t+1/3),i=h9(A,s,t),o=h9(A,s,t-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:a}}function LD(t,e){return n=>n>0?e:t}const Mr=(t,e,n)=>t+(e-t)*n,b9=(t,e,n)=>{const a=t*t,r=n*(e*e-a)+a;return r<0?0:Math.sqrt(r)},yst=[X$,xf,Fb],Cst=t=>yst.find(e=>e.test(t));function joe(t){const e=Cst(t);if(!e)return!1;let n=e.parse(t);return e===Fb&&(n=bst(n)),n}const Hoe=(t,e)=>{const n=joe(t),a=joe(e);if(!n||!a)return LD(t,e);const r={...n};return i=>(r.red=b9(n.red,a.red,i),r.green=b9(n.green,a.green,i),r.blue=b9(n.blue,a.blue,i),r.alpha=Mr(n.alpha,a.alpha,i),xf.transform(r))},ej=new Set(["none","hidden"]);function wst(t,e){return ej.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Est(t,e){return n=>Mr(t,e,n)}function xZ(t){return typeof t=="number"?Est:typeof t=="string"?IZ(t)?LD:mi.test(t)?Hoe:vst:Array.isArray(t)?FQe:typeof t=="object"?mi.test(t)?Hoe:Bst:LD}function FQe(t,e){const n=[...t],a=n.length,r=t.map((i,o)=>xZ(i)(i,e[o]));return i=>{for(let o=0;o<a;o++)n[o]=r[o](i);return n}}function Bst(t,e){const n={...t,...e},a={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(a[r]=xZ(t[r])(t[r],e[r]));return r=>{for(const i in a)n[i]=a[i](r);return n}}function kst(t,e){const n=[],a={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const i=e.types[r],o=t.indexes[i][a[i]],s=t.values[o]??0;n[r]=s,a[i]++}return n}const vst=(t,e)=>{const n=Tm.createTransformer(e),a=HB(t),r=HB(e);return a.indexes.var.length===r.indexes.var.length&&a.indexes.color.length===r.indexes.color.length&&a.indexes.number.length>=r.indexes.number.length?ej.has(t)&&!r.values.length||ej.has(e)&&!a.values.length?wst(t,e):mv(FQe(kst(a,r),r.values),n):LD(t,e)};function TQe(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Mr(t,e,n):xZ(t)(t,e)}const Ist=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>_r.update(e,n),stop:()=>Fm(e),now:()=>Bo.isProcessing?Bo.timestamp:Js.now()}},RQe=(t,e,n=10)=>{let a="";const r=Math.max(Math.round(e/n),2);for(let i=0;i<r;i++)a+=Math.round(t(i/(r-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},OD=2e4;function DZ(t){let e=0;const n=50;let a=t.next(e);for(;!a.done&&e<OD;)e+=n,a=t.next(e);return e>=OD?1/0:e}function Qst(t,e=100,n){const a=n({...t,keyframes:[0,e]}),r=Math.min(DZ(a),OD);return{type:"keyframes",ease:i=>a.next(r*i).value/e,duration:hc(r)}}const _st=5;function MQe(t,e,n){const a=Math.max(e-_st,0);return mQe(n-t(a),e-a)}const Ur={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},y9=.001;function xst({duration:t=Ur.duration,bounce:e=Ur.bounce,velocity:n=Ur.velocity,mass:a=Ur.mass}){let r,i,o=1-e;o=Yd(Ur.minDamping,Ur.maxDamping,o),t=Yd(Ur.minDuration,Ur.maxDuration,hc(t)),o<1?(r=l=>{const u=l*o,d=u*t,p=u-n,m=tj(l,o),g=Math.exp(-d);return y9-p/m*g},i=l=>{const d=l*o*t,p=d*n+n,m=Math.pow(o,2)*Math.pow(l,2)*t,g=Math.exp(-d),h=tj(Math.pow(l,2),o);return(-r(l)+y9>0?-1:1)*((p-m)*g)/h}):(r=l=>{const u=Math.exp(-l*t),d=(l-n)*t+1;return-y9+u*d},i=l=>{const u=Math.exp(-l*t),d=(n-l)*(t*t);return u*d});const s=5/t,A=Sst(r,i,s);if(t=uu(t),isNaN(A))return{stiffness:Ur.stiffness,damping:Ur.damping,duration:t};{const l=Math.pow(A,2)*a;return{stiffness:l,damping:o*2*Math.sqrt(a*l),duration:t}}}const Dst=12;function Sst(t,e,n){let a=n;for(let r=1;r<Dst;r++)a=a-t(a)/e(a);return a}function tj(t,e){return t*Math.sqrt(1-e*e)}const Nst=["duration","bounce"],Fst=["stiffness","damping","mass"];function zoe(t,e){return e.some(n=>t[n]!==void 0)}function Tst(t){let e={velocity:Ur.velocity,stiffness:Ur.stiffness,damping:Ur.damping,mass:Ur.mass,isResolvedFromDuration:!1,...t};if(!zoe(t,Fst)&&zoe(t,Nst))if(t.visualDuration){const n=t.visualDuration,a=2*Math.PI/(n*1.2),r=a*a,i=2*Yd(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Ur.mass,stiffness:r,damping:i}}else{const n=xst(t);e={...e,...n,mass:Ur.mass},e.isResolvedFromDuration=!0}return e}function GD(t=Ur.visualDuration,e=Ur.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:a,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:i},{stiffness:A,damping:l,mass:u,duration:d,velocity:p,isResolvedFromDuration:m}=Tst({...n,velocity:-hc(n.velocity||0)}),g=p||0,h=l/(2*Math.sqrt(A*u)),b=o-i,y=hc(Math.sqrt(A/u)),w=Math.abs(b)<5;a||(a=w?Ur.restSpeed.granular:Ur.restSpeed.default),r||(r=w?Ur.restDelta.granular:Ur.restDelta.default);let E;if(h<1){const v=tj(y,h);E=_=>{const I=Math.exp(-h*y*_);return o-I*((g+h*y*b)/v*Math.sin(v*_)+b*Math.cos(v*_))}}else if(h===1)E=v=>o-Math.exp(-y*v)*(b+(g+y*b)*v);else{const v=y*Math.sqrt(h*h-1);E=_=>{const I=Math.exp(-h*y*_),x=Math.min(v*_,300);return o-I*((g+h*y*b)*Math.sinh(x)+v*b*Math.cosh(x))/v}}const k={calculatedDuration:m&&d||null,next:v=>{const _=E(v);if(m)s.done=v>=d;else{let I=v===0?g:0;h<1&&(I=v===0?uu(g):MQe(E,v,_));const x=Math.abs(I)<=a,N=Math.abs(o-_)<=r;s.done=x&&N}return s.value=s.done?o:_,s},toString:()=>{const v=Math.min(DZ(k),OD),_=RQe(I=>k.next(v*I).value,v,30);return v+"ms "+_},toTransition:()=>{}};return k}GD.applyToOptions=t=>{const e=Qst(t,100,GD);return t.ease=e.ease,t.duration=uu(e.duration),t.type="keyframes",t};function nj({keyframes:t,velocity:e=0,power:n=.8,timeConstant:a=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:s,max:A,restDelta:l=.5,restSpeed:u}){const d=t[0],p={done:!1,value:d},m=x=>s!==void 0&&x<s||A!==void 0&&x>A,g=x=>s===void 0?A:A===void 0||Math.abs(s-x)<Math.abs(A-x)?s:A;let h=n*e;const b=d+h,y=o===void 0?b:o(b);y!==b&&(h=y-d);const w=x=>-h*Math.exp(-x/a),E=x=>y+w(x),k=x=>{const N=w(x),R=E(x);p.done=Math.abs(N)<=l,p.value=p.done?y:R};let v,_;const I=x=>{m(p.value)&&(v=x,_=GD({keyframes:[p.value,g(p.value)],velocity:MQe(E,x,p.value),damping:r,stiffness:i,restDelta:l,restSpeed:u}))};return I(0),{calculatedDuration:null,next:x=>{let N=!1;return!_&&v===void 0&&(N=!0,k(x),I(x)),v!==void 0&&x>=v?_.next(x-v):(!N&&k(x),p)}}}function Rst(t,e,n){const a=[],r=n||Kd.mix||TQe,i=t.length-1;for(let o=0;o<i;o++){let s=r(t[o],t[o+1]);if(e){const A=Array.isArray(e)?e[o]||Bc:e;s=mv(A,s)}a.push(s)}return a}function Mst(t,e,{clamp:n=!0,ease:a,mixer:r}={}){const i=t.length;if(wZ(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Rst(e,a,r),A=s.length,l=u=>{if(o&&u<t[0])return e[0];let d=0;if(A>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const p=$B(t[d],t[d+1],u);return s[d](p)};return n?u=>l(Yd(t[0],t[i-1],u)):l}function Lst(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const r=$B(0,e,a);t.push(Mr(n,1,r))}}function Ost(t){const e=[0];return Lst(e,t.length-1),e}function Gst(t,e){return t.map(n=>n*e)}function Pst(t,e){return t.map(()=>e||BQe).splice(0,t.length-1)}function eB({duration:t=300,keyframes:e,times:n,ease:a="easeInOut"}){const r=Vot(a)?a.map(qoe):qoe(a),i={done:!1,value:e[0]},o=Gst(n&&n.length===e.length?n:Ost(e),t),s=Mst(o,e,{ease:Array.isArray(r)?r:Pst(e,r)});return{calculatedDuration:t,next:A=>(i.value=s(A),i.done=A>=t,i)}}const qst=t=>t!==null;function SZ(t,{repeat:e,repeatType:n="loop"},a,r=1){const i=t.filter(qst),s=r<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||a===void 0?i[s]:a}const Ust={decay:nj,inertia:nj,tween:eB,keyframes:eB,spring:GD};function LQe(t){typeof t.type=="string"&&(t.type=Ust[t.type])}class NZ{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const $st=t=>t/100;class FZ extends NZ{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Js.now()&&this.tick(Js.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;LQe(e);const{type:n=eB,repeat:a=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e;let{keyframes:s}=e;const A=n||eB;A!==eB&&typeof s[0]!="number"&&(this.mixKeyframes=mv($st,TQe(s[0],s[1])),s=[0,100]);const l=A({...e,keyframes:s});i==="mirror"&&(this.mirroredGenerator=A({...e,keyframes:[...s].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=DZ(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(a+1)-r,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:a,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:A}=this;if(this.startTime===null)return a.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:p,repeatDelay:m,type:g,onUpdate:h,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let E=this.currentTime,k=a;if(d){const x=Math.min(this.currentTime,r)/s;let N=Math.floor(x),R=x%1;!R&&x>=1&&(R=1),R===1&&N--,N=Math.min(N,d+1),N%2&&(p==="reverse"?(R=1-R,m&&(R-=m/s)):p==="mirror"&&(k=o)),E=Yd(0,1,R)*s}const v=w?{done:!1,value:u[0]}:k.next(E);i&&(v.value=i(v.value));let{done:_}=v;!w&&A!==null&&(_=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return I&&g!==nj&&(v.value=SZ(u,this.options,b,this.speed)),h&&h(v.value),I&&this.finish(),v}then(e,n){return this.finished.then(e,n)}get duration(){return hc(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+hc(e)}get time(){return hc(this.currentTime)}set time(e){e=uu(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Js.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=hc(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Ist,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Js.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function jst(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Df=t=>t*180/Math.PI,aj=t=>{const e=Df(Math.atan2(t[1],t[0]));return rj(e)},Hst={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:aj,rotateZ:aj,skewX:t=>Df(Math.atan(t[1])),skewY:t=>Df(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},rj=t=>(t=t%360,t<0&&(t+=360),t),Yoe=aj,Koe=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Zoe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),zst={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Koe,scaleY:Zoe,scale:t=>(Koe(t)+Zoe(t))/2,rotateX:t=>rj(Df(Math.atan2(t[6],t[5]))),rotateY:t=>rj(Df(Math.atan2(-t[2],t[0]))),rotateZ:Yoe,rotate:Yoe,skewX:t=>Df(Math.atan(t[4])),skewY:t=>Df(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ij(t){return t.includes("scale")?1:0}function oj(t,e){if(!t||t==="none")return ij(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,r;if(n)a=zst,r=n;else{const s=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=Hst,r=s}if(!r)return ij(e);const i=a[e],o=r[1].split(",").map(Kst);return typeof i=="function"?i(o):o[i]}const Yst=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return oj(n,e)};function Kst(t){return parseFloat(t.trim())}const _1=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],x1=new Set(_1),Woe=t=>t===Q1||t===qn,Zst=new Set(["x","y","z"]),Wst=_1.filter(t=>!Zst.has(t));function Vst(t){const e=[];return Wst.forEach(n=>{const a=t.getValue(n);a!==void 0&&(e.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),e}const Pf={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>oj(e,"x"),y:(t,{transform:e})=>oj(e,"y")};Pf.translateX=Pf.x;Pf.translateY=Pf.y;const qf=new Set;let sj=!1,Aj=!1,cj=!1;function OQe(){if(Aj){const t=Array.from(qf).filter(a=>a.needsMeasurement),e=new Set(t.map(a=>a.element)),n=new Map;e.forEach(a=>{const r=Vst(a);r.length&&(n.set(a,r),a.render())}),t.forEach(a=>a.measureInitialState()),e.forEach(a=>{a.render();const r=n.get(a);r&&r.forEach(([i,o])=>{a.getValue(i)?.set(o)})}),t.forEach(a=>a.measureEndState()),t.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Aj=!1,sj=!1,qf.forEach(t=>t.complete(cj)),qf.clear()}function GQe(){qf.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Aj=!0)})}function Jst(){cj=!0,GQe(),OQe(),cj=!1}class TZ{constructor(e,n,a,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=a,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(qf.add(this),sj||(sj=!0,_r.read(GQe),_r.resolveKeyframes(OQe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:a,motionValue:r}=this;if(e[0]===null){const i=r?.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(a&&n){const s=a.readValue(n,o);s!=null&&(e[0]=s)}e[0]===void 0&&(e[0]=o),r&&i===void 0&&r.set(e[0])}jst(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qf.delete(this)}cancel(){this.state==="scheduled"&&(qf.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Xst=t=>t.startsWith("--");function eAt(t,e,n){Xst(e)?t.style.setProperty(e,n):t.style[e]=n}const tAt=EZ(()=>window.ScrollTimeline!==void 0),nAt={};function aAt(t,e){const n=EZ(t);return()=>nAt[e]??n()}const PQe=aAt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qw=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,Voe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qw([0,.65,.55,1]),circOut:qw([.55,0,1,.45]),backIn:qw([.31,.01,.66,-.59]),backOut:qw([.33,1.53,.69,.99])};function qQe(t,e){if(t)return typeof t=="function"?PQe()?RQe(t,e):"ease-out":kQe(t)?qw(t):Array.isArray(t)?t.map(n=>qQe(n,e)||Voe.easeOut):Voe[t]}function rAt(t,e,n,{delay:a=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:s="easeOut",times:A}={},l=void 0){const u={[e]:n};A&&(u.offset=A);const d=qQe(s,r);Array.isArray(d)&&(u.easing=d);const p={delay:a,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(p.pseudoElement=l),t.animate(u,p)}function UQe(t){return typeof t=="function"&&"applyToOptions"in t}function iAt({type:t,...e}){return UQe(t)&&PQe()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class oAt extends NZ{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:a,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:s,onComplete:A}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,wZ(typeof e.type!="string");const l=iAt(e);this.animation=rAt(n,a,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=SZ(r,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):eAt(n,a,u),this.animation.cancel()}A?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return hc(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+hc(e)}get time(){return hc(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=uu(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&tAt()?(this.animation.timeline=e,Bc):n(this)}}const $Qe={anticipate:CQe,backInOut:yQe,circInOut:EQe};function sAt(t){return t in $Qe}function AAt(t){typeof t.ease=="string"&&sAt(t.ease)&&(t.ease=$Qe[t.ease])}const Joe=10;class cAt extends oAt{constructor(e){AAt(e),LQe(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:a,onComplete:r,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const s=new FZ({...o,autoplay:!1}),A=uu(this.finishedTime??this.time);n.setWithVelocity(s.sample(A-Joe).value,s.sample(A).value,Joe),s.stop()}}const Xoe=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Tm.test(t)||t==="0")&&!t.startsWith("url("));function lAt(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function uAt(t,e,n,a){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=Xoe(r,e),s=Xoe(i,e);return!o||!s?!1:lAt(t)||(n==="spring"||UQe(n))&&a}function lj(t){t.duration=0,t.type="keyframes"}const dAt=new Set(["opacity","clipPath","filter","transform"]),pAt=EZ(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mAt(t){const{motionValue:e,name:n,repeatDelay:a,repeatType:r,damping:i,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:A,transformTemplate:l}=e.owner.getProps();return pAt()&&n&&dAt.has(n)&&(n!=="transform"||!l)&&!A&&!a&&r!=="mirror"&&i!==0&&o!=="inertia"}const gAt=40;class fAt extends NZ{constructor({autoplay:e=!0,delay:n=0,type:a="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:s,name:A,motionValue:l,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Js.now();const p={autoplay:e,delay:n,type:a,repeat:r,repeatDelay:i,repeatType:o,name:A,motionValue:l,element:u,...d},m=u?.KeyframeResolver||TZ;this.keyframeResolver=new m(s,(g,h,b)=>this.onKeyframesResolved(g,h,p,!b),A,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,a,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:s,delay:A,isHandoff:l,onUpdate:u}=a;this.resolvedAt=Js.now(),uAt(e,i,o,s)||((Kd.instantAnimations||!A)&&u?.(SZ(e,a,n)),e[0]=e[e.length-1],lj(a),a.repeat=0);const p={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>gAt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:e},m=!l&&mAt(p)?new cAt({...p,element:p.motionValue.owner.current}):new FZ(p);m.finished.then(()=>this.notifyFinished()).catch(Bc),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Jst()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const hAt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bAt(t){const e=hAt.exec(t);if(!e)return[,];const[,n,a,r]=e;return[`--${n??a}`,r]}function jQe(t,e,n=1){const[a,r]=bAt(t);if(!a)return;const i=window.getComputedStyle(e).getPropertyValue(a);if(i){const o=i.trim();return uQe(o)?parseFloat(o):o}return IZ(r)?jQe(r,e,n+1):r}function RZ(t,e){return t?.[e]??t?.default??t}const HQe=new Set(["width","height","top","left","right","bottom",..._1]),yAt={test:t=>t==="auto",parse:t=>t},zQe=t=>e=>e.test(t),YQe=[Q1,qn,du,em,lst,cst,yAt],ese=t=>YQe.find(zQe(t));function CAt(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||pQe(t):!0}const wAt=new Set(["brightness","contrast","saturate","opacity"]);function EAt(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[a]=n.match(QZ)||[];if(!a)return t;const r=n.replace(a,"");let i=wAt.has(e)?1:0;return a!==n&&(i*=100),e+"("+i+r+")"}const BAt=/\b([a-z-]*)\(.*?\)/gu,uj={...Tm,getAnimatableNone:t=>{const e=t.match(BAt);return e?e.map(EAt).join(" "):t}},tse={...Q1,transform:Math.round},kAt={rotate:em,rotateX:em,rotateY:em,rotateZ:em,scale:JQ,scaleX:JQ,scaleY:JQ,scaleZ:JQ,skew:em,skewX:em,skewY:em,distance:qn,translateX:qn,translateY:qn,translateZ:qn,x:qn,y:qn,z:qn,perspective:qn,transformPerspective:qn,opacity:jB,originX:Uoe,originY:Uoe,originZ:qn},MZ={borderWidth:qn,borderTopWidth:qn,borderRightWidth:qn,borderBottomWidth:qn,borderLeftWidth:qn,borderRadius:qn,radius:qn,borderTopLeftRadius:qn,borderTopRightRadius:qn,borderBottomRightRadius:qn,borderBottomLeftRadius:qn,width:qn,maxWidth:qn,height:qn,maxHeight:qn,top:qn,right:qn,bottom:qn,left:qn,padding:qn,paddingTop:qn,paddingRight:qn,paddingBottom:qn,paddingLeft:qn,margin:qn,marginTop:qn,marginRight:qn,marginBottom:qn,marginLeft:qn,backgroundPositionX:qn,backgroundPositionY:qn,...kAt,zIndex:tse,fillOpacity:jB,strokeOpacity:jB,numOctaves:tse},vAt={...MZ,color:mi,backgroundColor:mi,outlineColor:mi,fill:mi,stroke:mi,borderColor:mi,borderTopColor:mi,borderRightColor:mi,borderBottomColor:mi,borderLeftColor:mi,filter:uj,WebkitFilter:uj},KQe=t=>vAt[t];function ZQe(t,e){let n=KQe(t);return n!==uj&&(n=Tm),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const IAt=new Set(["auto","none","0"]);function QAt(t,e,n){let a=0,r;for(;a<t.length&&!r;){const i=t[a];typeof i=="string"&&!IAt.has(i)&&HB(i).values.length&&(r=t[a]),a++}if(r&&n)for(const i of e)t[i]=ZQe(n,r)}class _At extends TZ{constructor(e,n,a,r,i){super(e,n,a,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let A=0;A<e.length;A++){let l=e[A];if(typeof l=="string"&&(l=l.trim(),IZ(l))){const u=jQe(l,n.current);u!==void 0&&(e[A]=u),A===e.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!HQe.has(a)||e.length!==2)return;const[r,i]=e,o=ese(r),s=ese(i);if(o!==s)if(Woe(o)&&Woe(s))for(let A=0;A<e.length;A++){const l=e[A];typeof l=="string"&&(e[A]=parseFloat(l))}else Pf[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,a=[];for(let r=0;r<e.length;r++)(e[r]===null||CAt(e[r]))&&a.push(r);a.length&&QAt(e,a,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:a}=this;if(!e||!e.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pf[a](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(a,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:a}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=a.length-1,o=a[i];a[i]=Pf[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,A])=>{e.getValue(s).set(A)}),this.resolveNoneKeyframes()}}function xAt(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let a=document;const r=n?.[t]??a.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}const WQe=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function VQe(t){return dQe(t)&&"offsetHeight"in t}const nse=30,DAt=t=>!isNaN(parseFloat(t));class SAt{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const r=Js.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Js.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=DAt(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new BZ);const a=this.events[e].add(n);return e==="change"?()=>{a(),_r.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-a}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Js.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>nse)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,nse);return mQe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function v2(t,e){return new SAt(t,e)}const{schedule:LZ}=vQe(queueMicrotask,!1),Hc={x:!1,y:!1};function JQe(){return Hc.x||Hc.y}function NAt(t){return t==="x"||t==="y"?Hc[t]?null:(Hc[t]=!0,()=>{Hc[t]=!1}):Hc.x||Hc.y?null:(Hc.x=Hc.y=!0,()=>{Hc.x=Hc.y=!1})}function XQe(t,e){const n=xAt(t),a=new AbortController,r={passive:!0,...e,signal:a.signal};return[n,r,()=>a.abort()]}function ase(t){return!(t.pointerType==="touch"||JQe())}function FAt(t,e,n={}){const[a,r,i]=XQe(t,n),o=s=>{if(!ase(s))return;const{target:A}=s,l=e(A,s);if(typeof l!="function"||!A)return;const u=d=>{ase(d)&&(l(d),A.removeEventListener("pointerleave",u))};A.addEventListener("pointerleave",u,r)};return a.forEach(s=>{s.addEventListener("pointerenter",o,r)}),i}const e_e=(t,e)=>e?t===e?!0:e_e(t,e.parentElement):!1,OZ=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,TAt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function RAt(t){return TAt.has(t.tagName)||t.tabIndex!==-1}const Fx=new WeakSet;function rse(t){return e=>{e.key==="Enter"&&t(e)}}function C9(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const MAt=(t,e)=>{const n=t.currentTarget;if(!n)return;const a=rse(()=>{if(Fx.has(n))return;C9(n,"down");const r=rse(()=>{C9(n,"up")}),i=()=>C9(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",a,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),e)};function ise(t){return OZ(t)&&!JQe()}function LAt(t,e,n={}){const[a,r,i]=XQe(t,n),o=s=>{const A=s.currentTarget;if(!ise(s))return;Fx.add(A);const l=e(A,s),u=(m,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",p),Fx.has(A)&&Fx.delete(A),ise(m)&&typeof l=="function"&&l(m,{success:g})},d=m=>{u(m,A===window||A===document||n.useGlobalTarget||e_e(A,m.target))},p=m=>{u(m,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",p,r)};return a.forEach(s=>{(n.useGlobalTarget?window:s).addEventListener("pointerdown",o,r),VQe(s)&&(s.addEventListener("focus",l=>MAt(l,r)),!RAt(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),i}function t_e(t){return dQe(t)&&"ownerSVGElement"in t}function OAt(t){return t_e(t)&&t.tagName==="svg"}const Ho=t=>!!(t&&t.getVelocity),GAt=[...YQe,mi,Tm],PAt=t=>GAt.find(zQe(t)),GZ=K.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function ose(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function qAt(...t){return e=>{let n=!1;const a=t.map(r=>{const i=ose(r,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<a.length;r++){const i=a[r];typeof i=="function"?i():ose(t[r],null)}}}}function UAt(...t){return K.useCallback(qAt(...t),t)}class $At extends K.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const a=n.offsetParent,r=VQe(a)&&a.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=r-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function jAt({children:t,isPresent:e,anchorX:n,root:a}){const r=K.useId(),i=K.useRef(null),o=K.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=K.useContext(GZ),A=UAt(i,t?.ref);return K.useInsertionEffect(()=>{const{width:l,height:u,top:d,left:p,right:m}=o.current;if(e||!i.current||!l||!u)return;const g=n==="left"?`left: ${p}`:`right: ${m}`;i.current.dataset.motionPopId=r;const h=document.createElement("style");s&&(h.nonce=s);const b=a??document.head;return b.appendChild(h),h.sheet&&h.sheet.insertRule(`
1330
1331
  [data-motion-pop-id="${r}"] {
1331
1332
  position: absolute !important;
1332
1333
  width: ${l}px !important;
@@ -1597,7 +1598,7 @@ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
1597
1598
  ?)[ \r ]*`,Nj="[̀-ͯ]",Zpt=new RegExp(Nj+"+$"),Wpt="("+$xe+"+)|"+(Kpt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Nj+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Nj+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Ypt)+("|"+zpt+")");let GAe=class{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(Wpt,"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 SA("EOF",new Hs(this,n,n));var a=this.tokenRegex.exec(e);if(a===null||a.index!==n)throw new $t("Unexpected character: '"+e[n]+"'",new SA(e[n],new Hs(this,n,n+1)));var r=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[r]===14){var i=e.indexOf(`
1598
1599
  `,this.tokenRegex.lastIndex);return i===-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=i+1,this.lex()}return new SA(r,new Hs(this,n,this.tokenRegex.lastIndex))}};class Vpt{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 $t("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,a){if(a===void 0&&(a=!1),a){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var Jpt=Nxe;Ie("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Ie("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Ie("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Ie("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Ie("\\@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}});Ie("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Ie("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var PAe={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};Ie("\\char",function(t){var e=t.popToken(),n,a="";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]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new $t("\\char` missing argument");a=e.text.charCodeAt(0)}else n=10;if(n){if(a=PAe[e.text],a==null||a>=n)throw new $t("Invalid base-"+n+" digit "+e.text);for(var r;(r=PAe[t.future().text])!=null&&r<n;)a*=n,a+=r,t.popToken()}return"\\@char{"+a+"}"});var pW=(t,e,n,a)=>{var r=t.consumeArg().tokens;if(r.length!==1)throw new $t("\\newcommand's first argument must be a macro name");var i=r[0].text,o=t.isDefined(i);if(o&&!e)throw new $t("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!o&&!n)throw new $t("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(r=t.consumeArg().tokens,r.length===1&&r[0].text==="["){for(var A="",l=t.expandNextToken();l.text!=="]"&&l.text!=="EOF";)A+=l.text,l=t.expandNextToken();if(!A.match(/^\s*[0-9]+\s*$/))throw new $t("Invalid number of arguments: "+A);s=parseInt(A),r=t.consumeArg().tokens}return o&&a||t.macros.set(i,{tokens:r,numArgs:s}),""};Ie("\\newcommand",t=>pW(t,!1,!0,!1));Ie("\\renewcommand",t=>pW(t,!0,!1,!1));Ie("\\providecommand",t=>pW(t,!0,!0,!0));Ie("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});Ie("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});Ie("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),um[n],mr.math[n],mr.text[n]),""});Ie("\\bgroup","{");Ie("\\egroup","}");Ie("~","\\nobreakspace");Ie("\\lq","`");Ie("\\rq","'");Ie("\\aa","\\r a");Ie("\\AA","\\r A");Ie("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Ie("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Ie("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Ie("ℬ","\\mathscr{B}");Ie("ℰ","\\mathscr{E}");Ie("ℱ","\\mathscr{F}");Ie("ℋ","\\mathscr{H}");Ie("ℐ","\\mathscr{I}");Ie("ℒ","\\mathscr{L}");Ie("ℳ","\\mathscr{M}");Ie("ℛ","\\mathscr{R}");Ie("ℭ","\\mathfrak{C}");Ie("ℌ","\\mathfrak{H}");Ie("ℨ","\\mathfrak{Z}");Ie("\\Bbbk","\\Bbb{k}");Ie("·","\\cdotp");Ie("\\llap","\\mathllap{\\textrm{#1}}");Ie("\\rlap","\\mathrlap{\\textrm{#1}}");Ie("\\clap","\\mathclap{\\textrm{#1}}");Ie("\\mathstrut","\\vphantom{(}");Ie("\\underbar","\\underline{\\text{#1}}");Ie("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Ie("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Ie("\\ne","\\neq");Ie("≠","\\neq");Ie("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Ie("∉","\\notin");Ie("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Ie("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Ie("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Ie("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Ie("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Ie("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Ie("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Ie("⟂","\\perp");Ie("‼","\\mathclose{!\\mkern-0.8mu!}");Ie("∌","\\notni");Ie("⌜","\\ulcorner");Ie("⌝","\\urcorner");Ie("⌞","\\llcorner");Ie("⌟","\\lrcorner");Ie("©","\\copyright");Ie("®","\\textregistered");Ie("️","\\textregistered");Ie("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Ie("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Ie("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Ie("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Ie("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Ie("⋮","\\vdots");Ie("\\varGamma","\\mathit{\\Gamma}");Ie("\\varDelta","\\mathit{\\Delta}");Ie("\\varTheta","\\mathit{\\Theta}");Ie("\\varLambda","\\mathit{\\Lambda}");Ie("\\varXi","\\mathit{\\Xi}");Ie("\\varPi","\\mathit{\\Pi}");Ie("\\varSigma","\\mathit{\\Sigma}");Ie("\\varUpsilon","\\mathit{\\Upsilon}");Ie("\\varPhi","\\mathit{\\Phi}");Ie("\\varPsi","\\mathit{\\Psi}");Ie("\\varOmega","\\mathit{\\Omega}");Ie("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Ie("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Ie("\\boxed","\\fbox{$\\displaystyle{#1}$}");Ie("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Ie("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Ie("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Ie("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Ie("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var qAe={",":"\\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"};Ie("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in qAe?e=qAe[n]:(n.slice(0,4)==="\\not"||n in mr.math&&["bin","rel"].includes(mr.math[n].group))&&(e="\\dotsb"),e});var mW={")":!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};Ie("\\dotso",function(t){var e=t.future().text;return e in mW?"\\ldots\\,":"\\ldots"});Ie("\\dotsc",function(t){var e=t.future().text;return e in mW&&e!==","?"\\ldots\\,":"\\ldots"});Ie("\\cdots",function(t){var e=t.future().text;return e in mW?"\\@cdots\\,":"\\@cdots"});Ie("\\dotsb","\\cdots");Ie("\\dotsm","\\cdots");Ie("\\dotsi","\\!\\cdots");Ie("\\dotsx","\\ldots\\,");Ie("\\DOTSI","\\relax");Ie("\\DOTSB","\\relax");Ie("\\DOTSX","\\relax");Ie("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Ie("\\,","\\tmspace+{3mu}{.1667em}");Ie("\\thinspace","\\,");Ie("\\>","\\mskip{4mu}");Ie("\\:","\\tmspace+{4mu}{.2222em}");Ie("\\medspace","\\:");Ie("\\;","\\tmspace+{5mu}{.2777em}");Ie("\\thickspace","\\;");Ie("\\!","\\tmspace-{3mu}{.1667em}");Ie("\\negthinspace","\\!");Ie("\\negmedspace","\\tmspace-{4mu}{.2222em}");Ie("\\negthickspace","\\tmspace-{5mu}{.277em}");Ie("\\enspace","\\kern.5em ");Ie("\\enskip","\\hskip.5em\\relax");Ie("\\quad","\\hskip1em\\relax");Ie("\\qquad","\\hskip2em\\relax");Ie("\\tag","\\@ifstar\\tag@literal\\tag@paren");Ie("\\tag@paren","\\tag@literal{({#1})}");Ie("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new $t("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Ie("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Ie("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Ie("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Ie("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Ie("\\newline","\\\\\\relax");Ie("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var jxe=Wt(au["Main-Regular"][84][1]-.7*au["Main-Regular"][65][1]);Ie("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+jxe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Ie("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+jxe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Ie("\\hspace","\\@ifstar\\@hspacer\\@hspace");Ie("\\@hspace","\\hskip #1\\relax");Ie("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Ie("\\ordinarycolon",":");Ie("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Ie("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Ie("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Ie("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Ie("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Ie("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Ie("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Ie("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Ie("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Ie("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Ie("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Ie("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Ie("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Ie("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Ie("∷","\\dblcolon");Ie("∹","\\eqcolon");Ie("≔","\\coloneqq");Ie("≕","\\eqqcolon");Ie("⩴","\\Coloneqq");Ie("\\ratio","\\vcentcolon");Ie("\\coloncolon","\\dblcolon");Ie("\\colonequals","\\coloneqq");Ie("\\coloncolonequals","\\Coloneqq");Ie("\\equalscolon","\\eqqcolon");Ie("\\equalscoloncolon","\\Eqqcolon");Ie("\\colonminus","\\coloneq");Ie("\\coloncolonminus","\\Coloneq");Ie("\\minuscolon","\\eqcolon");Ie("\\minuscoloncolon","\\Eqcolon");Ie("\\coloncolonapprox","\\Colonapprox");Ie("\\coloncolonsim","\\Colonsim");Ie("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ie("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ie("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ie("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ie("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Ie("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Ie("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Ie("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Ie("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Ie("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Ie("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Ie("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Ie("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Ie("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Ie("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Ie("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Ie("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Ie("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Ie("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Ie("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Ie("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Ie("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Ie("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Ie("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Ie("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Ie("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Ie("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Ie("\\imath","\\html@mathml{\\@imath}{ı}");Ie("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Ie("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Ie("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Ie("⟦","\\llbracket");Ie("⟧","\\rrbracket");Ie("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Ie("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Ie("⦃","\\lBrace");Ie("⦄","\\rBrace");Ie("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Ie("⦵","\\minuso");Ie("\\darr","\\downarrow");Ie("\\dArr","\\Downarrow");Ie("\\Darr","\\Downarrow");Ie("\\lang","\\langle");Ie("\\rang","\\rangle");Ie("\\uarr","\\uparrow");Ie("\\uArr","\\Uparrow");Ie("\\Uarr","\\Uparrow");Ie("\\N","\\mathbb{N}");Ie("\\R","\\mathbb{R}");Ie("\\Z","\\mathbb{Z}");Ie("\\alef","\\aleph");Ie("\\alefsym","\\aleph");Ie("\\Alpha","\\mathrm{A}");Ie("\\Beta","\\mathrm{B}");Ie("\\bull","\\bullet");Ie("\\Chi","\\mathrm{X}");Ie("\\clubs","\\clubsuit");Ie("\\cnums","\\mathbb{C}");Ie("\\Complex","\\mathbb{C}");Ie("\\Dagger","\\ddagger");Ie("\\diamonds","\\diamondsuit");Ie("\\empty","\\emptyset");Ie("\\Epsilon","\\mathrm{E}");Ie("\\Eta","\\mathrm{H}");Ie("\\exist","\\exists");Ie("\\harr","\\leftrightarrow");Ie("\\hArr","\\Leftrightarrow");Ie("\\Harr","\\Leftrightarrow");Ie("\\hearts","\\heartsuit");Ie("\\image","\\Im");Ie("\\infin","\\infty");Ie("\\Iota","\\mathrm{I}");Ie("\\isin","\\in");Ie("\\Kappa","\\mathrm{K}");Ie("\\larr","\\leftarrow");Ie("\\lArr","\\Leftarrow");Ie("\\Larr","\\Leftarrow");Ie("\\lrarr","\\leftrightarrow");Ie("\\lrArr","\\Leftrightarrow");Ie("\\Lrarr","\\Leftrightarrow");Ie("\\Mu","\\mathrm{M}");Ie("\\natnums","\\mathbb{N}");Ie("\\Nu","\\mathrm{N}");Ie("\\Omicron","\\mathrm{O}");Ie("\\plusmn","\\pm");Ie("\\rarr","\\rightarrow");Ie("\\rArr","\\Rightarrow");Ie("\\Rarr","\\Rightarrow");Ie("\\real","\\Re");Ie("\\reals","\\mathbb{R}");Ie("\\Reals","\\mathbb{R}");Ie("\\Rho","\\mathrm{P}");Ie("\\sdot","\\cdot");Ie("\\sect","\\S");Ie("\\spades","\\spadesuit");Ie("\\sub","\\subset");Ie("\\sube","\\subseteq");Ie("\\supe","\\supseteq");Ie("\\Tau","\\mathrm{T}");Ie("\\thetasym","\\vartheta");Ie("\\weierp","\\wp");Ie("\\Zeta","\\mathrm{Z}");Ie("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Ie("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Ie("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Ie("\\bra","\\mathinner{\\langle{#1}|}");Ie("\\ket","\\mathinner{|{#1}\\rangle}");Ie("\\braket","\\mathinner{\\langle{#1}\\rangle}");Ie("\\Bra","\\left\\langle#1\\right|");Ie("\\Ket","\\left|#1\\right\\rangle");var Hxe=t=>e=>{var n=e.consumeArg().tokens,a=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,o=e.macros.get("|"),s=e.macros.get("\\|");e.macros.beginGroup();var A=d=>p=>{t&&(p.macros.set("|",o),r.length&&p.macros.set("\\|",s));var m=d;if(!d&&r.length){var g=p.future();g.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?r:a,numArgs:0}};e.macros.set("|",A(!1)),r.length&&e.macros.set("\\|",A(!0));var l=e.consumeArg().tokens,u=e.expandTokens([...i,...l,...n]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};Ie("\\bra@ket",Hxe(!1));Ie("\\bra@set",Hxe(!0));Ie("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Ie("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Ie("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Ie("\\angln","{\\angl n}");Ie("\\blue","\\textcolor{##6495ed}{#1}");Ie("\\orange","\\textcolor{##ffa500}{#1}");Ie("\\pink","\\textcolor{##ff00af}{#1}");Ie("\\red","\\textcolor{##df0030}{#1}");Ie("\\green","\\textcolor{##28ae7b}{#1}");Ie("\\gray","\\textcolor{gray}{#1}");Ie("\\purple","\\textcolor{##9d38bd}{#1}");Ie("\\blueA","\\textcolor{##ccfaff}{#1}");Ie("\\blueB","\\textcolor{##80f6ff}{#1}");Ie("\\blueC","\\textcolor{##63d9ea}{#1}");Ie("\\blueD","\\textcolor{##11accd}{#1}");Ie("\\blueE","\\textcolor{##0c7f99}{#1}");Ie("\\tealA","\\textcolor{##94fff5}{#1}");Ie("\\tealB","\\textcolor{##26edd5}{#1}");Ie("\\tealC","\\textcolor{##01d1c1}{#1}");Ie("\\tealD","\\textcolor{##01a995}{#1}");Ie("\\tealE","\\textcolor{##208170}{#1}");Ie("\\greenA","\\textcolor{##b6ffb0}{#1}");Ie("\\greenB","\\textcolor{##8af281}{#1}");Ie("\\greenC","\\textcolor{##74cf70}{#1}");Ie("\\greenD","\\textcolor{##1fab54}{#1}");Ie("\\greenE","\\textcolor{##0d923f}{#1}");Ie("\\goldA","\\textcolor{##ffd0a9}{#1}");Ie("\\goldB","\\textcolor{##ffbb71}{#1}");Ie("\\goldC","\\textcolor{##ff9c39}{#1}");Ie("\\goldD","\\textcolor{##e07d10}{#1}");Ie("\\goldE","\\textcolor{##a75a05}{#1}");Ie("\\redA","\\textcolor{##fca9a9}{#1}");Ie("\\redB","\\textcolor{##ff8482}{#1}");Ie("\\redC","\\textcolor{##f9685d}{#1}");Ie("\\redD","\\textcolor{##e84d39}{#1}");Ie("\\redE","\\textcolor{##bc2612}{#1}");Ie("\\maroonA","\\textcolor{##ffbde0}{#1}");Ie("\\maroonB","\\textcolor{##ff92c6}{#1}");Ie("\\maroonC","\\textcolor{##ed5fa6}{#1}");Ie("\\maroonD","\\textcolor{##ca337c}{#1}");Ie("\\maroonE","\\textcolor{##9e034e}{#1}");Ie("\\purpleA","\\textcolor{##ddd7ff}{#1}");Ie("\\purpleB","\\textcolor{##c6b9fc}{#1}");Ie("\\purpleC","\\textcolor{##aa87ff}{#1}");Ie("\\purpleD","\\textcolor{##7854ab}{#1}");Ie("\\purpleE","\\textcolor{##543b78}{#1}");Ie("\\mintA","\\textcolor{##f5f9e8}{#1}");Ie("\\mintB","\\textcolor{##edf2df}{#1}");Ie("\\mintC","\\textcolor{##e0e5cc}{#1}");Ie("\\grayA","\\textcolor{##f6f7f7}{#1}");Ie("\\grayB","\\textcolor{##f0f1f2}{#1}");Ie("\\grayC","\\textcolor{##e3e5e6}{#1}");Ie("\\grayD","\\textcolor{##d6d8da}{#1}");Ie("\\grayE","\\textcolor{##babec2}{#1}");Ie("\\grayF","\\textcolor{##888d93}{#1}");Ie("\\grayG","\\textcolor{##626569}{#1}");Ie("\\grayH","\\textcolor{##3b3e40}{#1}");Ie("\\grayI","\\textcolor{##21242c}{#1}");Ie("\\kaBlue","\\textcolor{##314453}{#1}");Ie("\\kaGreen","\\textcolor{##71B307}{#1}");var zxe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Xpt{constructor(e,n,a){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 Vpt(Jpt,n.macros),this.mode=a,this.stack=[]}feed(e){this.lexer=new GAe(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,a,r;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:r,end:a}=this.consumeArg(["]"])}else({tokens:r,start:n,end:a}=this.consumeArg());return this.pushToken(new SA("EOF",a.loc)),this.pushTokens(r),new SA("",Hs.range(n,a))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],a=e&&e.length>0;a||this.consumeSpaces();var r=this.future(),i,o=0,s=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++o;else if(i.text==="}"){if(--o,o===-1)throw new $t("Extra }",i)}else if(i.text==="EOF")throw new $t("Unexpected end of input in a macro argument, expected '"+(e&&a?e[s]:"}")+"'",i);if(e&&a)if((o===0||o===1&&e[s]==="{")&&i.text===e[s]){if(++s,s===e.length){n.splice(-s,s);break}}else s=0}while(o!==0||a);return r.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:r,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new $t("The length of delimiters doesn't match the number of args!");for(var a=n[0],r=0;r<a.length;r++){var i=this.popToken();if(a[r]!==i.text)throw new $t("Use of the macro doesn't match its definition",i)}}for(var o=[],s=0;s<e;s++)o.push(this.consumeArg(n&&n[s+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new $t("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),a=n.text,r=n.noexpand?null:this._getExpansion(a);if(r==null||e&&r.unexpandable){if(e&&r==null&&a[0]==="\\"&&!this.isDefined(a))throw new $t("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var i=r.tokens,o=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var s=i.length-1;s>=0;--s){var A=i[s];if(A.text==="#"){if(s===0)throw new $t("Incomplete placeholder at end of macro body",A);if(A=i[--s],A.text==="#")i.splice(s+1,1);else if(/^[1-9]$/.test(A.text))i.splice(s,2,...o[+A.text-1]);else throw new $t("Not a valid argument number",A)}}}return this.pushTokens(i),i.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 SA(e)]):void 0}expandTokens(e){var n=[],a=this.stack.length;for(this.pushTokens(e);this.stack.length>a;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),n.push(r)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(a=>a.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var a=this.lexer.catcodes[e];if(a!=null&&a!==13)return}var r=typeof n=="function"?n(this):n;if(typeof r=="string"){var i=0;if(r.indexOf("#")!==-1)for(var o=r.replace(/##/g,"");o.indexOf("#"+(i+1))!==-1;)++i;for(var s=new GAe(r,this.settings),A=[],l=s.lex();l.text!=="EOF";)A.push(l),l=s.lex();A.reverse();var u={tokens:A,numArgs:i};return u}return r}isDefined(e){return this.macros.has(e)||um.hasOwnProperty(e)||mr.math.hasOwnProperty(e)||mr.text.hasOwnProperty(e)||zxe.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:um.hasOwnProperty(e)&&!um[e].primitive}}var UAe=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,c_=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),H9={"́":{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"}},$Ae={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let Yxe=class Kxe{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 Xpt(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 $t("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 SA("}")),this.gullet.pushTokens(e);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(e,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var r=this.fetch();if(Kxe.endOfExpression.indexOf(r.text)!==-1||n&&r.text===n||e&&um[r.text]&&um[r.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;a.push(i)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(e){for(var n=-1,a,r=0;r<e.length;r++)if(e[r].type==="infix"){if(n!==-1)throw new $t("only one infix operator per group",e[r].token);n=r,a=e[r].replaceWith}if(n!==-1&&a){var i,o,s=e.slice(0,n),A=e.slice(n+1);s.length===1&&s[0].type==="ordgroup"?i=s[0]:i={type:"ordgroup",mode:this.mode,body:s},A.length===1&&A[0].type==="ordgroup"?o=A[0]:o={type:"ordgroup",mode:this.mode,body:A};var l;return a==="\\\\abovefrac"?l=this.callFunction(a,[i,e[n],o],[]):l=this.callFunction(a,[i,o],[]),[l]}else return e}handleSupSubscript(e){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var r;do{var i;r=this.parseGroup(e)}while(((i=r)==null?void 0:i.type)==="internal");if(!r)throw new $t("Expected group after '"+a+"'",n);return r}formatUnsupportedCmd(e){for(var n=[],a=0;a<e.length;a++)n.push({type:"textord",mode:"text",text:e[a]});var r={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]};return i}parseAtom(e){var n=this.parseGroup("atom",e);if(n?.type==="internal"||this.mode==="text")return n;for(var a,r;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(n&&n.type==="op"){var o=i.text==="\\limits";n.limits=o,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=i.text==="\\limits");else throw new $t("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(a)throw new $t("Double superscript",i);a=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(r)throw new $t("Double subscript",i);r=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(a)throw new $t("Double superscript",i);var s={type:"textord",mode:this.mode,text:"\\prime"},A=[s];for(this.consume();this.fetch().text==="'";)A.push(s),this.consume();this.fetch().text==="^"&&A.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:A}}else if(c_[i.text]){var l=UAe.test(i.text),u=[];for(u.push(new SA(c_[i.text])),this.consume();;){var d=this.fetch().text;if(!c_[d]||UAe.test(d)!==l)break;u.unshift(new SA(c_[d])),this.consume()}var p=this.subparse(u);l?r={type:"ordgroup",mode:"math",body:p}:a={type:"ordgroup",mode:"math",body:p}}else break}return a||r?{type:"supsub",mode:this.mode,base:n,sup:a,sub:r}:n}parseFunction(e,n){var a=this.fetch(),r=a.text,i=um[r];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new $t("Got function '"+r+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!i.allowedInText)throw new $t("Can't use function '"+r+"' in text mode",a);if(this.mode==="math"&&i.allowedInMath===!1)throw new $t("Can't use function '"+r+"' in math mode",a);var{args:o,optArgs:s}=this.parseArguments(r,i);return this.callFunction(r,o,s,a,e)}callFunction(e,n,a,r,i){var o={funcName:e,parser:this,token:r,breakOnTokenText:i},s=um[e];if(s&&s.handler)return s.handler(o,n,a);throw new $t("No function handler for "+e)}parseArguments(e,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var r=[],i=[],o=0;o<a;o++){var s=n.argTypes&&n.argTypes[o],A=o<n.numOptionalArgs;(n.primitive&&s==null||n.type==="sqrt"&&o===1&&i[0]==null)&&(s="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",s,A);if(A)i.push(l);else if(l!=null)r.push(l);else throw new $t("Null argument, please report this as a bug")}return{args:r,optArgs:i}}parseGroupOfType(e,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var r=this.parseArgumentGroup(a,"text");return r!=null?{type:"styling",mode:r.mode,body:[r],style:"text"}:null}case"raw":{var i=this.parseStringGroup("raw",a);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(a)throw new $t("A primitive argument cannot be optional");var o=this.parseGroup(e);if(o==null)throw new $t("Expected group as "+e,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new $t("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var r="",i;(i=this.fetch()).text!=="EOF";)r+=i.text,this.consume();return this.consume(),a.text=r,a}parseRegexGroup(e,n){for(var a=this.fetch(),r=a,i="",o;(o=this.fetch()).text!=="EOF"&&e.test(i+o.text);)r=o,i+=r.text,this.consume();if(i==="")throw new $t("Invalid "+n+": '"+a.text+"'",a);return a.range(r,i)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new $t("Invalid color: '"+n.text+"'",n);var r=a[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var n,a=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",a=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!r)throw new $t("Invalid size: '"+n.text+"'",n);var i={number:+(r[1]+r[2]),unit:r[3]};if(!nxe(i))throw new $t("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:a}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(e,n){var a=this.gullet.scanArgument(e);if(a==null)return null;var r=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:a.loc,body:i};return n&&this.switchMode(r),o}parseGroup(e,n){var a=this.fetch(),r=a.text,i;if(r==="{"||r==="\\begingroup"){this.consume();var o=r==="{"?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,o),A=this.fetch();this.expect(o),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:Hs.range(a,A),body:s,semisimple:r==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,e)||this.parseSymbol(),i==null&&r[0]==="\\"&&!zxe.hasOwnProperty(r)){if(this.settings.throwOnError)throw new $t("Undefined control sequence: "+r,a);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var n=e.length-1,a=0;a<n;++a){var r=e[a],i=r.text;i==="-"&&e[a+1].text==="-"&&(a+1<n&&e[a+2].text==="-"?(e.splice(a,3,{type:"textord",mode:"text",loc:Hs.range(r,e[a+2]),text:"---"}),n-=2):(e.splice(a,2,{type:"textord",mode:"text",loc:Hs.range(r,e[a+1]),text:"--"}),n-=1)),(i==="'"||i==="`")&&e[a+1].text===i&&(e.splice(a,2,{type:"textord",mode:"text",loc:Hs.range(r,e[a+1]),text:i+i}),n-=1)}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),r=a.charAt(0)==="*";if(r&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new $t(`\\verb assertion failed --
1599
1600
  please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:r}}$Ae.hasOwnProperty(n[0])&&!mr[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=$Ae[n[0]]+n.slice(1));var i=Zpt.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var o;if(mr[this.mode][n]){this.settings.strict&&this.mode==="math"&&Qj.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var s=mr[this.mode][n].group,A=Hs.range(e),l;if(qdt.hasOwnProperty(s)){var u=s;l={type:"atom",mode:this.mode,family:u,loc:A,text:n}}else l={type:s,mode:this.mode,loc:A,text:n};o=l}else if(n.charCodeAt(0)>=128)this.settings.strict&&(exe(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:Hs.range(e),text:n};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var p=i[0][d];if(!H9[p])throw new $t("Unknown accent ' "+p+"'",e);var m=H9[p][this.mode]||H9[p].text;if(!m)throw new $t("Accent "+p+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Hs.range(e),label:m,isStretchy:!1,isShifty:!0,base:o}}return o}};Yxe.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var gW=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Yxe(e,n);delete a.gullet.macros.current["\\df@tag"];var r=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new $t("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:a.subparse([new SA("\\df@tag")])}]}return r},fW=function(e,n,a){n.textContent="";var r=ZS(e,a).toNode();n.appendChild(r)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),fW=function(){throw new $t("KaTeX doesn't work in quirks mode.")});var Zxe=function(e,n){var a=ZS(e,n).toMarkup();return a},Wxe=function(e,n){var a=new VZ(n);return gW(e,a)},Vxe=function(e,n,a){if(a.throwOnError||!(e instanceof $t))throw e;var r=mt.makeSpan(["katex-error"],[new vc(n)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+a.errorColor),r},ZS=function(e,n){var a=new VZ(n);try{var r=gW(e,a);return lpt(r,e,a)}catch(i){return Vxe(i,e,a)}},Jxe=function(e,n){var a=new VZ(n);try{var r=gW(e,a);return upt(r,e,a)}catch(i){return Vxe(i,e,a)}},Xxe="0.16.27",e4e={Span:Cv,Anchor:eW,SymbolNode:vc,SvgNode:Zd,PathNode:Mm,LineNode:Ij},Fj={version:Xxe,render:fW,renderToString:Zxe,ParseError:$t,SETTINGS_SCHEMA:aB,__parse:Wxe,__renderToDomTree:ZS,__renderToHTMLTree:Jxe,__setFontMetrics:txe,__defineSymbol:X,__defineFunction:rn,__defineMacro:Ie,__domTree:e4e};const emt=Object.freeze(Object.defineProperty({__proto__:null,ParseError:$t,SETTINGS_SCHEMA:aB,__defineFunction:rn,__defineMacro:Ie,__defineSymbol:X,__domTree:e4e,__parse:Wxe,__renderToDomTree:ZS,__renderToHTMLTree:Jxe,__setFontMetrics:txe,default:Fj,get render(){return fW},renderToString:Zxe,version:Xxe},Symbol.toStringTag,{value:"Module"})),tmt={},nmt=[];function Tj(t){const e=t||tmt;return function(n,a){ZZ(n,"element",function(r,i){const o=Array.isArray(r.properties.className)?r.properties.className:nmt,s=o.includes("language-math"),A=o.includes("math-display"),l=o.includes("math-inline");let u=A;if(!s&&!A&&!l)return;let d=i[i.length-1],p=r;if(r.tagName==="code"&&s&&d&&d.type==="element"&&d.tagName==="pre"&&(p=d,d=i[i.length-2],u=!0),!d)return;const m=edt(p,{whitespace:"pre"});let g;try{g=Fj.renderToString(m,{...e,displayMode:u,throwOnError:!0})}catch(b){const y=b,w=y.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...i,r],cause:y,place:r.position,ruleId:w,source:"rehype-katex"});try{g=Fj.renderToString(m,{...e,displayMode:u,strict:"ignore",throwOnError:!1})}catch{g=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(b)},children:[{type:"text",value:m}]}]}}typeof g=="string"&&(g=zut(g).children);const h=d.children.indexOf(p);return d.children.splice(h,1,...g),$D})}}const t4e=-1,WS=0,iB=1,ZD=2,hW=3,bW=4,yW=5,CW=6,n4e=7,a4e=8,jAe=typeof self=="object"?self:globalThis,amt=(t,e)=>{const n=(r,i)=>(t.set(i,r),r),a=r=>{if(t.has(r))return t.get(r);const[i,o]=e[r];switch(i){case WS:case t4e:return n(o,r);case iB:{const s=n([],r);for(const A of o)s.push(a(A));return s}case ZD:{const s=n({},r);for(const[A,l]of o)s[a(A)]=a(l);return s}case hW:return n(new Date(o),r);case bW:{const{source:s,flags:A}=o;return n(new RegExp(s,A),r)}case yW:{const s=n(new Map,r);for(const[A,l]of o)s.set(a(A),a(l));return s}case CW:{const s=n(new Set,r);for(const A of o)s.add(a(A));return s}case n4e:{const{name:s,message:A}=o;return n(new jAe[s](A),r)}case a4e:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:s}=new Uint8Array(o);return n(new DataView(s),o)}}return n(new jAe[i](o),r)};return a},HAe=t=>amt(new Map,t)(0),nb="",{toString:rmt}={},{keys:imt}=Object,tw=t=>{const e=typeof t;if(e!=="object"||!t)return[WS,e];const n=rmt.call(t).slice(8,-1);switch(n){case"Array":return[iB,nb];case"Object":return[ZD,nb];case"Date":return[hW,nb];case"RegExp":return[bW,nb];case"Map":return[yW,nb];case"Set":return[CW,nb];case"DataView":return[iB,n]}return n.includes("Array")?[iB,n]:n.includes("Error")?[n4e,n]:[ZD,n]},l_=([t,e])=>t===WS&&(e==="function"||e==="symbol"),omt=(t,e,n,a)=>{const r=(o,s)=>{const A=a.push(o)-1;return n.set(s,A),A},i=o=>{if(n.has(o))return n.get(o);let[s,A]=tw(o);switch(s){case WS:{let u=o;switch(A){case"bigint":s=a4e,u=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+A);u=null;break;case"undefined":return r([t4e],o)}return r([s,u],o)}case iB:{if(A){let p=o;return A==="DataView"?p=new Uint8Array(o.buffer):A==="ArrayBuffer"&&(p=new Uint8Array(o)),r([A,[...p]],o)}const u=[],d=r([s,u],o);for(const p of o)u.push(i(p));return d}case ZD:{if(A)switch(A){case"BigInt":return r([A,o.toString()],o);case"Boolean":case"Number":case"String":return r([A,o.valueOf()],o)}if(e&&"toJSON"in o)return i(o.toJSON());const u=[],d=r([s,u],o);for(const p of imt(o))(t||!l_(tw(o[p])))&&u.push([i(p),i(o[p])]);return d}case hW:return r([s,o.toISOString()],o);case bW:{const{source:u,flags:d}=o;return r([s,{source:u,flags:d}],o)}case yW:{const u=[],d=r([s,u],o);for(const[p,m]of o)(t||!(l_(tw(p))||l_(tw(m))))&&u.push([i(p),i(m)]);return d}case CW:{const u=[],d=r([s,u],o);for(const p of o)(t||!l_(tw(p)))&&u.push(i(p));return d}}const{message:l}=o;return r([s,{name:A,message:l}],o)};return i},zAe=(t,{json:e,lossy:n}={})=>{const a=[];return omt(!(e||n),!!e,new Map,a)(t),a},x2=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?HAe(zAe(t,e)):structuredClone(t):(t,e)=>HAe(zAe(t,e));function smt(t){const e=String(t),n=[];return{toOffset:r,toPoint:a};function a(i){if(typeof i=="number"&&i>-1&&i<=e.length){let o=0;for(;;){let s=n[o];if(s===void 0){const A=YAe(e,n[o-1]);s=A===-1?e.length+1:A+1,n[o]=s}if(s>i)return{line:o+1,column:i-(o>0?n[o-1]:0)+1,offset:i};o++}}}function r(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const s=n[n.length-1],A=YAe(e,s),l=A===-1?e.length+1:A+1;if(s===l)break;n.push(l)}const o=(i.line>1?n[i.line-2]:0)+i.column-1;if(o<n[i.line-1])return o}}}function YAe(t,e){const n=t.indexOf("\r",e),a=t.indexOf(`
1600
- `,e);return a===-1?n:n===-1||n+1===a?a:n<a?n:a}const r4e={}.hasOwnProperty,Amt=Object.prototype;function cmt(t,e){const n=e||{};return wW({file:n.file||void 0,location:!1,schema:n.space==="svg"?vu:y1,verbose:n.verbose||!1},t)}function wW(t,e){let n;switch(e.nodeName){case"#comment":{const a=e;return n={type:"comment",value:a.data},Lx(t,a,n),n}case"#document":case"#document-fragment":{const a=e,r="mode"in a?a.mode==="quirks"||a.mode==="limited-quirks":!1;if(n={type:"root",children:i4e(t,e.childNodes),data:{quirksMode:r}},t.file&&t.location){const i=String(t.file),o=smt(i),s=o.toPoint(0),A=o.toPoint(i.length);n.position={start:s,end:A}}return n}case"#documentType":{const a=e;return n={type:"doctype"},Lx(t,a,n),n}case"#text":{const a=e;return n={type:"text",value:a.value},Lx(t,a,n),n}default:return n=lmt(t,e),n}}function i4e(t,e){let n=-1;const a=[];for(;++n<e.length;){const r=wW(t,e[n]);a.push(r)}return a}function lmt(t,e){const n=t.schema;t.schema=e.namespaceURI===nu.svg?vu:y1;let a=-1;const r={};for(;++a<e.attrs.length;){const s=e.attrs[a],A=(s.prefix?s.prefix+":":"")+s.name;r4e.call(Amt,A)||(r[A]=s.value)}const o=(t.schema.space==="svg"?z_e:H_e)(e.tagName,r,i4e(t,e.childNodes));if(Lx(t,e,o),o.tagName==="template"){const s=e,A=s.sourceCodeLocation,l=A&&A.startTag&&Ob(A.startTag),u=A&&A.endTag&&Ob(A.endTag),d=wW(t,s.content);l&&u&&t.file&&(d.position={start:l.end,end:u.start}),o.content=d}return t.schema=n,o}function Lx(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const a=umt(t,n,e.sourceCodeLocation);a&&(t.location=!0,n.position=a)}}function umt(t,e,n){const a=Ob(n);if(e.type==="element"){const r=e.children[e.children.length-1];if(a&&!n.endTag&&r&&r.position&&r.position.end&&(a.end=Object.assign({},r.position.end)),t.verbose){const i={};let o;if(n.attrs)for(o in n.attrs)r4e.call(n.attrs,o)&&(i[sv(t.schema,o).property]=Ob(n.attrs[o]));n.startTag;const s=Ob(n.startTag),A=n.endTag?Ob(n.endTag):void 0,l={opening:s};A&&(l.closing=A),l.properties=i,e.data={position:l}}}return a}function Ob(t){const e=KAe({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=KAe({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function KAe(t){return t.line&&t.column?t:void 0}const dmt={},pmt={}.hasOwnProperty,o4e=MK("type",{handlers:{root:gmt,element:Cmt,text:bmt,comment:ymt,doctype:hmt}});function mmt(t,e){const a=(e||dmt).space;return o4e(t,a==="svg"?vu:y1)}function gmt(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=EW(t.children,n,e),N1(t,n),n}function fmt(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=EW(t.children,n,e),N1(t,n),n}function hmt(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return N1(t,e),e}function bmt(t){const e={nodeName:"#text",value:t.value,parentNode:null};return N1(t,e),e}function ymt(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return N1(t,e),e}function Cmt(t,e){const n=e;let a=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=vu);const r=[];let i;if(t.properties){for(i in t.properties)if(i!=="children"&&pmt.call(t.properties,i)){const A=wmt(a,i,t.properties[i]);A&&r.push(A)}}const o=a.space,s={nodeName:t.tagName,tagName:t.tagName,attrs:r,namespaceURI:nu[o],childNodes:[],parentNode:null};return s.childNodes=EW(t.children,s,a),N1(t,s),t.tagName==="template"&&t.content&&(s.content=fmt(t.content,a)),s}function wmt(t,e,n){const a=sv(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&a.boolean)return;Array.isArray(n)&&(n=a.commaSeparated?LK(n):OK(n));const r={name:a.attribute,value:n===!0?"":String(n)};if(a.space&&a.space!=="html"&&a.space!=="svg"){const i=r.name.indexOf(":");i<0?r.prefix="":(r.name=r.name.slice(i+1),r.prefix=a.attribute.slice(0,i)),r.namespace=nu[a.space]}return r}function EW(t,e,n){let a=-1;const r=[];if(t)for(;++a<t.length;){const i=o4e(t[a],n);i.parentNode=e,r.push(i)}return r}function N1(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const Emt=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),vr="�";var Ne;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(Ne||(Ne={}));const Ps={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function s4e(t){return t>=55296&&t<=57343}function Bmt(t){return t>=56320&&t<=57343}function kmt(t,e){return(t-55296)*1024+9216+e}function A4e(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function c4e(t){return t>=64976&&t<=65007||Emt.has(t)}var Bt;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Bt||(Bt={}));const vmt=65536;class Imt{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=vmt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:a,col:r,offset:i}=this,o=r+n,s=i+n;return{code:e,startLine:a,endLine:a,startCol:o,endCol:o,startOffset:s,endOffset:s}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Bmt(n))return this.pos++,this._addGap(),kmt(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Ne.EOF;return this._err(Bt.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let a=0;a<e.length;a++)if((this.html.charCodeAt(this.pos+a)|32)!==e.charCodeAt(a))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Ne.EOF;const a=this.html.charCodeAt(n);return a===Ne.CARRIAGE_RETURN?Ne.LINE_FEED:a}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Ne.EOF;let e=this.html.charCodeAt(this.pos);return e===Ne.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Ne.LINE_FEED):e===Ne.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,s4e(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Ne.LINE_FEED||e===Ne.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){A4e(e)?this._err(Bt.controlCharacterInInputStream):c4e(e)&&this._err(Bt.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var sa;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(sa||(sa={}));function l4e(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const Qmt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),_mt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function xmt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=_mt.get(t))!==null&&e!==void 0?e:t}var to;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(to||(to={}));const Dmt=32;var dm;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(dm||(dm={}));function Rj(t){return t>=to.ZERO&&t<=to.NINE}function Smt(t){return t>=to.UPPER_A&&t<=to.UPPER_F||t>=to.LOWER_A&&t<=to.LOWER_F}function Nmt(t){return t>=to.UPPER_A&&t<=to.UPPER_Z||t>=to.LOWER_A&&t<=to.LOWER_Z||Rj(t)}function Fmt(t){return t===to.EQUALS||Nmt(t)}var Wi;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Wi||(Wi={}));var vd;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(vd||(vd={}));class Tmt{constructor(e,n,a){this.decodeTree=e,this.emitCodePoint=n,this.errors=a,this.state=Wi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vd.Strict}startEntity(e){this.decodeMode=e,this.state=Wi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Wi.EntityStart:return e.charCodeAt(n)===to.NUM?(this.state=Wi.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Wi.NamedEntity,this.stateNamedEntity(e,n));case Wi.NumericStart:return this.stateNumericStart(e,n);case Wi.NumericDecimal:return this.stateNumericDecimal(e,n);case Wi.NumericHex:return this.stateNumericHex(e,n);case Wi.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Dmt)===to.LOWER_X?(this.state=Wi.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Wi.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,a,r){if(n!==a){const i=a-n;this.result=this.result*Math.pow(r,i)+Number.parseInt(e.substr(n,i),r),this.consumed+=i}}stateNumericHex(e,n){const a=n;for(;n<e.length;){const r=e.charCodeAt(n);if(Rj(r)||Smt(r))n+=1;else return this.addToNumericResult(e,a,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,a,n,16),-1}stateNumericDecimal(e,n){const a=n;for(;n<e.length;){const r=e.charCodeAt(n);if(Rj(r))n+=1;else return this.addToNumericResult(e,a,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,a,n,10),-1}emitNumericEntity(e,n){var a;if(this.consumed<=n)return(a=this.errors)===null||a===void 0||a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===to.SEMI)this.consumed+=1;else if(this.decodeMode===vd.Strict)return 0;return this.emitCodePoint(xmt(this.result),this.consumed),this.errors&&(e!==to.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:a}=this;let r=a[this.treeIndex],i=(r&dm.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const o=e.charCodeAt(n);if(this.treeIndex=Rmt(a,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===vd.Attribute&&(i===0||Fmt(o))?0:this.emitNotTerminatedNamedEntity();if(r=a[this.treeIndex],i=(r&dm.VALUE_LENGTH)>>14,i!==0){if(o===to.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==vd.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:a}=this,r=(a[n]&dm.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,a){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[e]&~dm.VALUE_LENGTH:r[e+1],a),n===3&&this.emitCodePoint(r[e+2],a),a}end(){var e;switch(this.state){case Wi.NamedEntity:return this.result!==0&&(this.decodeMode!==vd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Wi.NumericDecimal:return this.emitNumericEntity(0,2);case Wi.NumericHex:return this.emitNumericEntity(0,3);case Wi.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wi.EntityStart:return 0}}}function Rmt(t,e,n,a){const r=(e&dm.BRANCH_LENGTH)>>7,i=e&dm.JUMP_TABLE;if(r===0)return i!==0&&a===i?n:-1;if(i){const A=a-i;return A<0||A>=r?-1:t[n+A]-1}let o=n,s=o+r-1;for(;o<=s;){const A=o+s>>>1,l=t[A];if(l<a)o=A+1;else if(l>a)s=A-1;else return t[A+r]}return-1}var Ot;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(Ot||(Ot={}));var Uf;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Uf||(Uf={}));var Ac;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Ac||(Ac={}));var dt;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(dt||(dt={}));var V;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(V||(V={}));const Mmt=new Map([[dt.A,V.A],[dt.ADDRESS,V.ADDRESS],[dt.ANNOTATION_XML,V.ANNOTATION_XML],[dt.APPLET,V.APPLET],[dt.AREA,V.AREA],[dt.ARTICLE,V.ARTICLE],[dt.ASIDE,V.ASIDE],[dt.B,V.B],[dt.BASE,V.BASE],[dt.BASEFONT,V.BASEFONT],[dt.BGSOUND,V.BGSOUND],[dt.BIG,V.BIG],[dt.BLOCKQUOTE,V.BLOCKQUOTE],[dt.BODY,V.BODY],[dt.BR,V.BR],[dt.BUTTON,V.BUTTON],[dt.CAPTION,V.CAPTION],[dt.CENTER,V.CENTER],[dt.CODE,V.CODE],[dt.COL,V.COL],[dt.COLGROUP,V.COLGROUP],[dt.DD,V.DD],[dt.DESC,V.DESC],[dt.DETAILS,V.DETAILS],[dt.DIALOG,V.DIALOG],[dt.DIR,V.DIR],[dt.DIV,V.DIV],[dt.DL,V.DL],[dt.DT,V.DT],[dt.EM,V.EM],[dt.EMBED,V.EMBED],[dt.FIELDSET,V.FIELDSET],[dt.FIGCAPTION,V.FIGCAPTION],[dt.FIGURE,V.FIGURE],[dt.FONT,V.FONT],[dt.FOOTER,V.FOOTER],[dt.FOREIGN_OBJECT,V.FOREIGN_OBJECT],[dt.FORM,V.FORM],[dt.FRAME,V.FRAME],[dt.FRAMESET,V.FRAMESET],[dt.H1,V.H1],[dt.H2,V.H2],[dt.H3,V.H3],[dt.H4,V.H4],[dt.H5,V.H5],[dt.H6,V.H6],[dt.HEAD,V.HEAD],[dt.HEADER,V.HEADER],[dt.HGROUP,V.HGROUP],[dt.HR,V.HR],[dt.HTML,V.HTML],[dt.I,V.I],[dt.IMG,V.IMG],[dt.IMAGE,V.IMAGE],[dt.INPUT,V.INPUT],[dt.IFRAME,V.IFRAME],[dt.KEYGEN,V.KEYGEN],[dt.LABEL,V.LABEL],[dt.LI,V.LI],[dt.LINK,V.LINK],[dt.LISTING,V.LISTING],[dt.MAIN,V.MAIN],[dt.MALIGNMARK,V.MALIGNMARK],[dt.MARQUEE,V.MARQUEE],[dt.MATH,V.MATH],[dt.MENU,V.MENU],[dt.META,V.META],[dt.MGLYPH,V.MGLYPH],[dt.MI,V.MI],[dt.MO,V.MO],[dt.MN,V.MN],[dt.MS,V.MS],[dt.MTEXT,V.MTEXT],[dt.NAV,V.NAV],[dt.NOBR,V.NOBR],[dt.NOFRAMES,V.NOFRAMES],[dt.NOEMBED,V.NOEMBED],[dt.NOSCRIPT,V.NOSCRIPT],[dt.OBJECT,V.OBJECT],[dt.OL,V.OL],[dt.OPTGROUP,V.OPTGROUP],[dt.OPTION,V.OPTION],[dt.P,V.P],[dt.PARAM,V.PARAM],[dt.PLAINTEXT,V.PLAINTEXT],[dt.PRE,V.PRE],[dt.RB,V.RB],[dt.RP,V.RP],[dt.RT,V.RT],[dt.RTC,V.RTC],[dt.RUBY,V.RUBY],[dt.S,V.S],[dt.SCRIPT,V.SCRIPT],[dt.SEARCH,V.SEARCH],[dt.SECTION,V.SECTION],[dt.SELECT,V.SELECT],[dt.SOURCE,V.SOURCE],[dt.SMALL,V.SMALL],[dt.SPAN,V.SPAN],[dt.STRIKE,V.STRIKE],[dt.STRONG,V.STRONG],[dt.STYLE,V.STYLE],[dt.SUB,V.SUB],[dt.SUMMARY,V.SUMMARY],[dt.SUP,V.SUP],[dt.TABLE,V.TABLE],[dt.TBODY,V.TBODY],[dt.TEMPLATE,V.TEMPLATE],[dt.TEXTAREA,V.TEXTAREA],[dt.TFOOT,V.TFOOT],[dt.TD,V.TD],[dt.TH,V.TH],[dt.THEAD,V.THEAD],[dt.TITLE,V.TITLE],[dt.TR,V.TR],[dt.TRACK,V.TRACK],[dt.TT,V.TT],[dt.U,V.U],[dt.UL,V.UL],[dt.SVG,V.SVG],[dt.VAR,V.VAR],[dt.WBR,V.WBR],[dt.XMP,V.XMP]]);function F1(t){var e;return(e=Mmt.get(t))!==null&&e!==void 0?e:V.UNKNOWN}const Pt=V,Lmt={[Ot.HTML]:new Set([Pt.ADDRESS,Pt.APPLET,Pt.AREA,Pt.ARTICLE,Pt.ASIDE,Pt.BASE,Pt.BASEFONT,Pt.BGSOUND,Pt.BLOCKQUOTE,Pt.BODY,Pt.BR,Pt.BUTTON,Pt.CAPTION,Pt.CENTER,Pt.COL,Pt.COLGROUP,Pt.DD,Pt.DETAILS,Pt.DIR,Pt.DIV,Pt.DL,Pt.DT,Pt.EMBED,Pt.FIELDSET,Pt.FIGCAPTION,Pt.FIGURE,Pt.FOOTER,Pt.FORM,Pt.FRAME,Pt.FRAMESET,Pt.H1,Pt.H2,Pt.H3,Pt.H4,Pt.H5,Pt.H6,Pt.HEAD,Pt.HEADER,Pt.HGROUP,Pt.HR,Pt.HTML,Pt.IFRAME,Pt.IMG,Pt.INPUT,Pt.LI,Pt.LINK,Pt.LISTING,Pt.MAIN,Pt.MARQUEE,Pt.MENU,Pt.META,Pt.NAV,Pt.NOEMBED,Pt.NOFRAMES,Pt.NOSCRIPT,Pt.OBJECT,Pt.OL,Pt.P,Pt.PARAM,Pt.PLAINTEXT,Pt.PRE,Pt.SCRIPT,Pt.SECTION,Pt.SELECT,Pt.SOURCE,Pt.STYLE,Pt.SUMMARY,Pt.TABLE,Pt.TBODY,Pt.TD,Pt.TEMPLATE,Pt.TEXTAREA,Pt.TFOOT,Pt.TH,Pt.THEAD,Pt.TITLE,Pt.TR,Pt.TRACK,Pt.UL,Pt.WBR,Pt.XMP]),[Ot.MATHML]:new Set([Pt.MI,Pt.MO,Pt.MN,Pt.MS,Pt.MTEXT,Pt.ANNOTATION_XML]),[Ot.SVG]:new Set([Pt.TITLE,Pt.FOREIGN_OBJECT,Pt.DESC]),[Ot.XLINK]:new Set,[Ot.XML]:new Set,[Ot.XMLNS]:new Set},Mj=new Set([Pt.H1,Pt.H2,Pt.H3,Pt.H4,Pt.H5,Pt.H6]);dt.STYLE,dt.SCRIPT,dt.XMP,dt.IFRAME,dt.NOEMBED,dt.NOFRAMES,dt.PLAINTEXT;var Re;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Re||(Re={}));const ti={DATA:Re.DATA,RCDATA:Re.RCDATA,RAWTEXT:Re.RAWTEXT,SCRIPT_DATA:Re.SCRIPT_DATA,PLAINTEXT:Re.PLAINTEXT,CDATA_SECTION:Re.CDATA_SECTION};function Omt(t){return t>=Ne.DIGIT_0&&t<=Ne.DIGIT_9}function jw(t){return t>=Ne.LATIN_CAPITAL_A&&t<=Ne.LATIN_CAPITAL_Z}function Gmt(t){return t>=Ne.LATIN_SMALL_A&&t<=Ne.LATIN_SMALL_Z}function tm(t){return Gmt(t)||jw(t)}function ZAe(t){return tm(t)||Omt(t)}function u_(t){return t+32}function u4e(t){return t===Ne.SPACE||t===Ne.LINE_FEED||t===Ne.TABULATION||t===Ne.FORM_FEED}function WAe(t){return u4e(t)||t===Ne.SOLIDUS||t===Ne.GREATER_THAN_SIGN}function Pmt(t){return t===Ne.NULL?Bt.nullCharacterReference:t>1114111?Bt.characterReferenceOutsideUnicodeRange:s4e(t)?Bt.surrogateCharacterReference:c4e(t)?Bt.noncharacterCharacterReference:A4e(t)||t===Ne.CARRIAGE_RETURN?Bt.controlCharacterReference:null}class qmt{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Re.DATA,this.returnState=Re.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Imt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Tmt(Qmt,(a,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(a)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Bt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:a=>{this._err(Bt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+a)},validateNumericCharacterReference:a=>{const r=Pmt(a);r&&this._err(r,1)}}:void 0)}_err(e,n=0){var a,r;(r=(a=this.handler).onParseError)===null||r===void 0||r.call(a,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,a){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||a?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:sa.START_TAG,tagName:"",tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:sa.END_TAG,tagName:"",tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:sa.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:sa.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const a=this.currentToken;if(l4e(a,this.currentAttr.name)===null){if(a.attrs.push(this.currentAttr),a.location&&this.currentLocation){const r=(e=(n=a.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Bt.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=F1(e.tagName),e.type===sa.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(Bt.endTagWithAttributes),e.selfClosing&&this._err(Bt.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case sa.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case sa.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case sa.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:sa.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=u4e(e)?sa.WHITESPACE_CHARACTER:e===Ne.NULL?sa.NULL_CHARACTER:sa.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(sa.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Re.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vd.Attribute:vd.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Re.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Re.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Re.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Re.DATA:{this._stateData(e);break}case Re.RCDATA:{this._stateRcdata(e);break}case Re.RAWTEXT:{this._stateRawtext(e);break}case Re.SCRIPT_DATA:{this._stateScriptData(e);break}case Re.PLAINTEXT:{this._statePlaintext(e);break}case Re.TAG_OPEN:{this._stateTagOpen(e);break}case Re.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Re.TAG_NAME:{this._stateTagName(e);break}case Re.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Re.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Re.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Re.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Re.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Re.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Re.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Re.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Re.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Re.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Re.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Re.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Re.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Re.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Re.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Re.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Re.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Re.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Re.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Re.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Re.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Re.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Re.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Re.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Re.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Re.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Re.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Re.COMMENT_START:{this._stateCommentStart(e);break}case Re.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Re.COMMENT:{this._stateComment(e);break}case Re.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Re.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Re.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Re.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Re.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Re.COMMENT_END:{this._stateCommentEnd(e);break}case Re.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Re.DOCTYPE:{this._stateDoctype(e);break}case Re.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Re.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Re.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Re.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Re.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Re.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Re.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Re.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Re.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Re.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Re.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Re.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Re.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Re.CDATA_SECTION:{this._stateCdataSection(e);break}case Re.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Re.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Re.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Re.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Ne.LESS_THAN_SIGN:{this.state=Re.TAG_OPEN;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitCodePoint(e);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.LESS_THAN_SIGN:{this.state=Re.RCDATA_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Ne.LESS_THAN_SIGN:{this.state=Re.RAWTEXT_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(tm(e))this._createStartTagToken(),this.state=Re.TAG_NAME,this._stateTagName(e);else switch(e){case Ne.EXCLAMATION_MARK:{this.state=Re.MARKUP_DECLARATION_OPEN;break}case Ne.SOLIDUS:{this.state=Re.END_TAG_OPEN;break}case Ne.QUESTION_MARK:{this._err(Bt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Re.BOGUS_COMMENT,this._stateBogusComment(e);break}case Ne.EOF:{this._err(Bt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Bt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Re.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(tm(e))this._createEndTagToken(),this.state=Re.TAG_NAME,this._stateTagName(e);else switch(e){case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingEndTagName),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Bt.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Re.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_ATTRIBUTE_NAME;break}case Ne.SOLIDUS:{this.state=Re.SELF_CLOSING_START_TAG;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.tagName+=vr;break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(jw(e)?u_(e):e)}}_stateRcdataLessThanSign(e){e===Ne.SOLIDUS?this.state=Re.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=Re.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){tm(e)?(this.state=Re.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=Re.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Re.BEFORE_ATTRIBUTE_NAME,!1;case Ne.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Re.SELF_CLOSING_START_TAG,!1;case Ne.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Re.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===Ne.SOLIDUS?this.state=Re.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=Re.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){tm(e)?(this.state=Re.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=Re.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case Ne.SOLIDUS:{this.state=Re.SCRIPT_DATA_END_TAG_OPEN;break}case Ne.EXCLAMATION_MARK:{this.state=Re.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=Re.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){tm(e)?(this.state=Re.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===Ne.HYPHEN_MINUS?(this.state=Re.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===Ne.HYPHEN_MINUS?(this.state=Re.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case Ne.HYPHEN_MINUS:{this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.SCRIPT_DATA,this._emitChars(">");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Ne.SOLIDUS?this.state=Re.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:tm(e)?(this._emitChars("<"),this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){tm(e)?(this.state=Re.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Ps.SCRIPT,!1)&&WAe(this.preprocessor.peek(Ps.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ps.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case Ne.HYPHEN_MINUS:{this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Ne.GREATER_THAN_SIGN:{this.state=Re.SCRIPT_DATA,this._emitChars(">");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Ne.SOLIDUS?(this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ps.SCRIPT,!1)&&WAe(this.preprocessor.peek(Ps.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ps.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Re.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.SOLIDUS:case Ne.GREATER_THAN_SIGN:case Ne.EOF:{this.state=Re.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case Ne.EQUALS_SIGN:{this._err(Bt.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=Re.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=Re.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:case Ne.SOLIDUS:case Ne.GREATER_THAN_SIGN:case Ne.EOF:{this._leaveAttrName(),this.state=Re.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case Ne.EQUALS_SIGN:{this._leaveAttrName(),this.state=Re.BEFORE_ATTRIBUTE_VALUE;break}case Ne.QUOTATION_MARK:case Ne.APOSTROPHE:case Ne.LESS_THAN_SIGN:{this._err(Bt.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.name+=vr;break}default:this.currentAttr.name+=String.fromCodePoint(jw(e)?u_(e):e)}}_stateAfterAttributeName(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.SOLIDUS:{this.state=Re.SELF_CLOSING_START_TAG;break}case Ne.EQUALS_SIGN:{this.state=Re.BEFORE_ATTRIBUTE_VALUE;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=Re.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.QUOTATION_MARK:{this.state=Re.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this.state=Re.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingAttributeValue),this.state=Re.DATA,this.emitCurrentTagToken();break}default:this.state=Re.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case Ne.QUOTATION_MARK:{this.state=Re.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.value+=vr;break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case Ne.APOSTROPHE:{this.state=Re.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.value+=vr;break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this._leaveAttrValue(),this.state=Re.BEFORE_ATTRIBUTE_NAME;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.value+=vr;break}case Ne.QUOTATION_MARK:case Ne.APOSTROPHE:case Ne.LESS_THAN_SIGN:case Ne.EQUALS_SIGN:case Ne.GRAVE_ACCENT:{this._err(Bt.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this._leaveAttrValue(),this.state=Re.BEFORE_ATTRIBUTE_NAME;break}case Ne.SOLIDUS:{this._leaveAttrValue(),this.state=Re.SELF_CLOSING_START_TAG;break}case Ne.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this._err(Bt.missingWhitespaceBetweenAttributes),this.state=Re.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case Ne.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this._err(Bt.unexpectedSolidusInTag),this.state=Re.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.data+=vr;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Ps.DASH_DASH,!0)?(this._createCommentToken(Ps.DASH_DASH.length+1),this.state=Re.COMMENT_START):this._consumeSequenceIfMatch(Ps.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ps.DOCTYPE.length+1),this.state=Re.DOCTYPE):this._consumeSequenceIfMatch(Ps.CDATA_START,!0)?this.inForeignNode?this.state=Re.CDATA_SECTION:(this._err(Bt.cdataInHtmlContent),this._createCommentToken(Ps.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=Re.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Bt.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Re.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_START_DASH;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptClosingOfEmptyComment),this.state=Re.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_END;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptClosingOfEmptyComment),this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Re.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_END_DASH;break}case Ne.LESS_THAN_SIGN:{n.data+="<",this.state=Re.COMMENT_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.data+=vr;break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case Ne.EXCLAMATION_MARK:{n.data+="!",this.state=Re.COMMENT_LESS_THAN_SIGN_BANG;break}case Ne.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===Ne.HYPHEN_MINUS?this.state=Re.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Re.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===Ne.HYPHEN_MINUS?this.state=Re.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Re.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==Ne.GREATER_THAN_SIGN&&e!==Ne.EOF&&this._err(Bt.nestedComment),this.state=Re.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_END;break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EXCLAMATION_MARK:{this.state=Re.COMMENT_END_BANG;break}case Ne.HYPHEN_MINUS:{n.data+="-";break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{n.data+="--!",this.state=Re.COMMENT_END_DASH;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.incorrectlyClosedComment),this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=Re.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_DOCTYPE_NAME;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case Ne.EOF:{this._err(Bt.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingWhitespaceBeforeDoctypeName),this.state=Re.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(jw(e))this._createDoctypeToken(String.fromCharCode(u_(e))),this.state=Re.DOCTYPE_NAME;else switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._createDoctypeToken(vr),this.state=Re.DOCTYPE_NAME;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Re.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.AFTER_DOCTYPE_NAME;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.name+=vr;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(jw(e)?u_(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ps.PUBLIC,!1)?this.state=Re.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ps.SYSTEM,!1)?this.state=Re.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Bt.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case Ne.QUOTATION_MARK:{this._err(Bt.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this._err(Bt.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.QUOTATION_MARK:{n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case Ne.QUOTATION_MARK:{this.state=Re.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.publicId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case Ne.APOSTROPHE:{this.state=Re.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.publicId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.QUOTATION_MARK:{this._err(Bt.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this._err(Bt.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.QUOTATION_MARK:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case Ne.QUOTATION_MARK:{this._err(Bt.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this._err(Bt.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.QUOTATION_MARK:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case Ne.QUOTATION_MARK:{this.state=Re.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.systemId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case Ne.APOSTROPHE:{this.state=Re.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.systemId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case Ne.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter);break}case Ne.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case Ne.RIGHT_SQUARE_BRACKET:{this.state=Re.CDATA_SECTION_BRACKET;break}case Ne.EOF:{this._err(Bt.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===Ne.RIGHT_SQUARE_BRACKET?this.state=Re.CDATA_SECTION_END:(this._emitChars("]"),this.state=Re.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA;break}case Ne.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=Re.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(Ne.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ZAe(this.preprocessor.peek(1))?Re.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){ZAe(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===Ne.SEMICOLON&&this._err(Bt.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const d4e=new Set([V.DD,V.DT,V.LI,V.OPTGROUP,V.OPTION,V.P,V.RB,V.RP,V.RT,V.RTC]),VAe=new Set([...d4e,V.CAPTION,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]),WD=new Set([V.APPLET,V.CAPTION,V.HTML,V.MARQUEE,V.OBJECT,V.TABLE,V.TD,V.TEMPLATE,V.TH]),Umt=new Set([...WD,V.OL,V.UL]),$mt=new Set([...WD,V.BUTTON]),JAe=new Set([V.ANNOTATION_XML,V.MI,V.MN,V.MO,V.MS,V.MTEXT]),XAe=new Set([V.DESC,V.FOREIGN_OBJECT,V.TITLE]),jmt=new Set([V.TR,V.TEMPLATE,V.HTML]),Hmt=new Set([V.TBODY,V.TFOOT,V.THEAD,V.TEMPLATE,V.HTML]),zmt=new Set([V.TABLE,V.TEMPLATE,V.HTML]),Ymt=new Set([V.TD,V.TH]);class Kmt{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,a){this.treeAdapter=n,this.handler=a,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=V.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===V.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ot.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const a=this._indexOf(e);this.items[a]=n,a===this.stackTop&&(this.current=n)}insertAfter(e,n,a){const r=this._indexOf(e)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,a),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ot.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const a=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(a,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Mj,Ot.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ymt,Ot.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let a=this.stackTop;a>=0;a--)if(e.has(this.tagIDs[a])&&this.treeAdapter.getNamespaceURI(this.items[a])===n)return a;return-1}clearBackTo(e,n){const a=this._indexOfTagNames(e,n);this.shortenToLength(a+1)}clearBackToTableContext(){this.clearBackTo(zmt,Ot.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Hmt,Ot.HTML)}clearBackToTableRowContext(){this.clearBackTo(jmt,Ot.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===V.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===V.HTML}hasInDynamicScope(e,n){for(let a=this.stackTop;a>=0;a--){const r=this.tagIDs[a];switch(this.treeAdapter.getNamespaceURI(this.items[a])){case Ot.HTML:{if(r===e)return!0;if(n.has(r))return!1;break}case Ot.SVG:{if(XAe.has(r))return!1;break}case Ot.MATHML:{if(JAe.has(r))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,WD)}hasInListItemScope(e){return this.hasInDynamicScope(e,Umt)}hasInButtonScope(e){return this.hasInDynamicScope(e,$mt)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Ot.HTML:{if(Mj.has(n))return!0;if(WD.has(n))return!1;break}case Ot.SVG:{if(XAe.has(n))return!1;break}case Ot.MATHML:{if(JAe.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ot.HTML)switch(this.tagIDs[n]){case e:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Ot.HTML)switch(this.tagIDs[e]){case V.TBODY:case V.THEAD:case V.TFOOT:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ot.HTML)switch(this.tagIDs[n]){case e:return!0;case V.OPTION:case V.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&d4e.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&VAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&VAe.has(this.currentTagId);)this.pop()}}const z9=3;var Wl;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Wl||(Wl={}));const ece={type:Wl.Marker};class Zmt{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const a=[],r=n.length,i=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let s=0;s<this.entries.length;s++){const A=this.entries[s];if(A.type===Wl.Marker)break;const{element:l}=A;if(this.treeAdapter.getTagName(l)===i&&this.treeAdapter.getNamespaceURI(l)===o){const u=this.treeAdapter.getAttrList(l);u.length===r&&a.push({idx:s,attrs:u})}}return a}_ensureNoahArkCondition(e){if(this.entries.length<z9)return;const n=this.treeAdapter.getAttrList(e),a=this._getNoahArkConditionCandidates(e,n);if(a.length<z9)return;const r=new Map(n.map(o=>[o.name,o.value]));let i=0;for(let o=0;o<a.length;o++){const s=a[o];s.attrs.every(A=>r.get(A.name)===A.value)&&(i+=1,i>=z9&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(ece)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Wl.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const a=this.entries.indexOf(this.bookmark);this.entries.splice(a,0,{type:Wl.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(ece);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(a=>a.type===Wl.Marker||this.treeAdapter.getTagName(a.element)===e);return n&&n.type===Wl.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Wl.Element&&n.element===e)}}const nm={createDocument(){return{nodeName:"#document",mode:Ac.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const a=t.childNodes.indexOf(n);t.childNodes.splice(a,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,a){const r=t.childNodes.find(i=>i.nodeName==="#documentType");if(r)r.name=e,r.publicId=n,r.systemId=a;else{const i={nodeName:"#documentType",name:e,publicId:n,systemId:a,parentNode:null};nm.appendChild(t,i)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(nm.isTextNode(n)){n.value+=e;return}}nm.appendChild(t,nm.createTextNode(e))},insertTextBefore(t,e,n){const a=t.childNodes[t.childNodes.indexOf(n)-1];a&&nm.isTextNode(a)?a.value+=e:nm.insertBefore(t,nm.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(a=>a.name));for(let a=0;a<e.length;a++)n.has(e[a].name)||t.attrs.push(e[a])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},p4e="html",Wmt="about:legacy-compat",Vmt="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",m4e=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Jmt=[...m4e,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Xmt=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),g4e=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],egt=[...g4e,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function tce(t,e){return e.some(n=>t.startsWith(n))}function tgt(t){return t.name===p4e&&t.publicId===null&&(t.systemId===null||t.systemId===Wmt)}function ngt(t){if(t.name!==p4e)return Ac.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===Vmt)return Ac.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),Xmt.has(n))return Ac.QUIRKS;let a=e===null?Jmt:m4e;if(tce(n,a))return Ac.QUIRKS;if(a=e===null?g4e:egt,tce(n,a))return Ac.LIMITED_QUIRKS}return Ac.NO_QUIRKS}const nce={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},agt="definitionurl",rgt="definitionURL",igt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),ogt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ot.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ot.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ot.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ot.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ot.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ot.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ot.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ot.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ot.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ot.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ot.XMLNS}]]),sgt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),Agt=new Set([V.B,V.BIG,V.BLOCKQUOTE,V.BODY,V.BR,V.CENTER,V.CODE,V.DD,V.DIV,V.DL,V.DT,V.EM,V.EMBED,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,V.HEAD,V.HR,V.I,V.IMG,V.LI,V.LISTING,V.MENU,V.META,V.NOBR,V.OL,V.P,V.PRE,V.RUBY,V.S,V.SMALL,V.SPAN,V.STRONG,V.STRIKE,V.SUB,V.SUP,V.TABLE,V.TT,V.U,V.UL,V.VAR]);function cgt(t){const e=t.tagID;return e===V.FONT&&t.attrs.some(({name:a})=>a===Uf.COLOR||a===Uf.SIZE||a===Uf.FACE)||Agt.has(e)}function f4e(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===agt){t.attrs[e].name=rgt;break}}function h4e(t){for(let e=0;e<t.attrs.length;e++){const n=igt.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function BW(t){for(let e=0;e<t.attrs.length;e++){const n=ogt.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function lgt(t){const e=sgt.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=F1(t.tagName))}function ugt(t,e){return e===Ot.MATHML&&(t===V.MI||t===V.MO||t===V.MN||t===V.MS||t===V.MTEXT)}function dgt(t,e,n){if(e===Ot.MATHML&&t===V.ANNOTATION_XML){for(let a=0;a<n.length;a++)if(n[a].name===Uf.ENCODING){const r=n[a].value.toLowerCase();return r===nce.TEXT_HTML||r===nce.APPLICATION_XML}}return e===Ot.SVG&&(t===V.FOREIGN_OBJECT||t===V.DESC||t===V.TITLE)}function pgt(t,e,n,a){return(!a||a===Ot.HTML)&&dgt(t,e,n)||(!a||a===Ot.MATHML)&&ugt(t,e)}const mgt="hidden",ggt=8,fgt=3;var je;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(je||(je={}));const hgt={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},b4e=new Set([V.TABLE,V.TBODY,V.TFOOT,V.THEAD,V.TR]),ace={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:nm,onParseError:null};let rce=class{constructor(e,n,a=null,r=null){this.fragmentContext=a,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=je.INITIAL,this.originalInsertionMode=je.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...ace,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new qmt(this.options,this),this.activeFormattingElements=new Zmt(this.treeAdapter),this.fragmentContextID=a?F1(this.treeAdapter.getTagName(a)):V.UNKNOWN,this._setContextModes(a??this.document,this.fragmentContextID),this.openElements=new Kmt(this.document,this.treeAdapter,this)}static parse(e,n){const a=new this(n);return a.tokenizer.write(e,!0),a.document}static getFragmentParser(e,n){const a={...ace,...n};e??(e=a.treeAdapter.createElement(dt.TEMPLATE,Ot.HTML,[]));const r=a.treeAdapter.createElement("documentmock",Ot.HTML,[]),i=new this(a,r,e);return i.fragmentContextID===V.TEMPLATE&&i.tmplInsertionModeStack.unshift(je.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,a){var r;if(!this.onParseError)return;const i=(r=e.location)!==null&&r!==void 0?r:hgt,o={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:a?i.startLine:i.endLine,endCol:a?i.startCol:i.endCol,endOffset:a?i.startOffset:i.endOffset};this.onParseError(o)}onItemPush(e,n,a){var r,i;(i=(r=this.treeAdapter).onItemPush)===null||i===void 0||i.call(r,e),a&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var a,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(a=this.treeAdapter).onItemPop)===null||r===void 0||r.call(a,e,this.openElements.current),n){let i,o;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,o=this.fragmentContextID):{current:i,currentTagId:o}=this.openElements,this._setContextModes(i,o)}}_setContextModes(e,n){const a=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Ot.HTML;this.currentNotInHTML=!a,this.tokenizer.inForeignNode=!a&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,Ot.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=je.TEXT}switchToPlaintextParsing(){this.insertionMode=je.TEXT,this.originalInsertionMode=je.IN_BODY,this.tokenizer.state=ti.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===dt.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ot.HTML))switch(this.fragmentContextID){case V.TITLE:case V.TEXTAREA:{this.tokenizer.state=ti.RCDATA;break}case V.STYLE:case V.XMP:case V.IFRAME:case V.NOEMBED:case V.NOFRAMES:case V.NOSCRIPT:{this.tokenizer.state=ti.RAWTEXT;break}case V.SCRIPT:{this.tokenizer.state=ti.SCRIPT_DATA;break}case V.PLAINTEXT:{this.tokenizer.state=ti.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",a=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,a,r),e.location){const o=this.treeAdapter.getChildNodes(this.document).find(s=>this.treeAdapter.isDocumentTypeNode(s));o&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const a=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,a)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const a=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(a??this.document,e)}}_appendElement(e,n){const a=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(a,e.location)}_insertElement(e,n){const a=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(a,e.location),this.openElements.push(a,e.tagID)}_insertFakeElement(e,n){const a=this.treeAdapter.createElement(e,Ot.HTML,[]);this._attachElementToTree(a,null),this.openElements.push(a,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,Ot.HTML,e.attrs),a=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,a),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(dt.HTML,Ot.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,V.HTML)}_appendCommentNode(e,n){const a=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,a),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_insertCharacters(e){let n,a;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:a}=this._findFosterParentingLocation(),a?this.treeAdapter.insertTextBefore(n,e.chars,a):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(n),i=a?r.lastIndexOf(a):r.length,o=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:A,endCol:l,endOffset:u}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:A,endCol:l,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}_adoptNodes(e,n){for(let a=this.treeAdapter.getFirstChild(e);a;a=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(a),this.treeAdapter.appendChild(n,a)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const a=n.location,r=this.treeAdapter.getTagName(e),i=n.type===sa.END_TAG&&r===n.tagName?{endTag:{...a},endLine:a.endLine,endCol:a.endCol,endOffset:a.endOffset}:{endLine:a.startLine,endCol:a.startCol,endOffset:a.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,a;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,a=this.fragmentContextID):{current:n,currentTagId:a}=this.openElements,e.tagID===V.SVG&&this.treeAdapter.getTagName(n)===dt.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ot.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===V.MGLYPH||e.tagID===V.MALIGNMARK)&&a!==void 0&&!this._isIntegrationPoint(a,n,Ot.HTML)}_processToken(e){switch(e.type){case sa.CHARACTER:{this.onCharacter(e);break}case sa.NULL_CHARACTER:{this.onNullCharacter(e);break}case sa.COMMENT:{this.onComment(e);break}case sa.DOCTYPE:{this.onDoctype(e);break}case sa.START_TAG:{this._processStartTag(e);break}case sa.END_TAG:{this.onEndTag(e);break}case sa.EOF:{this.onEof(e);break}case sa.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,a){const r=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return pgt(e,r,i,a)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Wl.Marker||this.openElements.contains(r.element)),a=n===-1?e-1:n-1;for(let r=a;r>=0;r--){const i=this.activeFormattingElements.entries[r];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=je.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(V.P),this.openElements.popUntilTagNamePopped(V.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case V.TR:{this.insertionMode=je.IN_ROW;return}case V.TBODY:case V.THEAD:case V.TFOOT:{this.insertionMode=je.IN_TABLE_BODY;return}case V.CAPTION:{this.insertionMode=je.IN_CAPTION;return}case V.COLGROUP:{this.insertionMode=je.IN_COLUMN_GROUP;return}case V.TABLE:{this.insertionMode=je.IN_TABLE;return}case V.BODY:{this.insertionMode=je.IN_BODY;return}case V.FRAMESET:{this.insertionMode=je.IN_FRAMESET;return}case V.SELECT:{this._resetInsertionModeForSelect(e);return}case V.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case V.HTML:{this.insertionMode=this.headElement?je.AFTER_HEAD:je.BEFORE_HEAD;return}case V.TD:case V.TH:{if(e>0){this.insertionMode=je.IN_CELL;return}break}case V.HEAD:{if(e>0){this.insertionMode=je.IN_HEAD;return}break}}this.insertionMode=je.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const a=this.openElements.tagIDs[n];if(a===V.TEMPLATE)break;if(a===V.TABLE){this.insertionMode=je.IN_SELECT_IN_TABLE;return}}this.insertionMode=je.IN_SELECT}_isElementCausesFosterParenting(e){return b4e.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case V.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ot.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case V.TABLE:{const a=this.treeAdapter.getParentNode(n);return a?{parent:a,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const a=this.treeAdapter.getNamespaceURI(e);return Lmt[a].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Yft(this,e);return}switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{oB(this,e);break}case je.BEFORE_HEAD:{sB(this,e);break}case je.IN_HEAD:{AB(this,e);break}case je.IN_HEAD_NO_SCRIPT:{cB(this,e);break}case je.AFTER_HEAD:{lB(this,e);break}case je.IN_BODY:case je.IN_CAPTION:case je.IN_CELL:case je.IN_TEMPLATE:{C4e(this,e);break}case je.TEXT:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case je.IN_TABLE:case je.IN_TABLE_BODY:case je.IN_ROW:{Y9(this,e);break}case je.IN_TABLE_TEXT:{I4e(this,e);break}case je.IN_COLUMN_GROUP:{VD(this,e);break}case je.AFTER_BODY:{JD(this,e);break}case je.AFTER_AFTER_BODY:{Ox(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){zft(this,e);return}switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{oB(this,e);break}case je.BEFORE_HEAD:{sB(this,e);break}case je.IN_HEAD:{AB(this,e);break}case je.IN_HEAD_NO_SCRIPT:{cB(this,e);break}case je.AFTER_HEAD:{lB(this,e);break}case je.TEXT:{this._insertCharacters(e);break}case je.IN_TABLE:case je.IN_TABLE_BODY:case je.IN_ROW:{Y9(this,e);break}case je.IN_COLUMN_GROUP:{VD(this,e);break}case je.AFTER_BODY:{JD(this,e);break}case je.AFTER_AFTER_BODY:{Ox(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Lj(this,e);return}switch(this.insertionMode){case je.INITIAL:case je.BEFORE_HTML:case je.BEFORE_HEAD:case je.IN_HEAD:case je.IN_HEAD_NO_SCRIPT:case je.AFTER_HEAD:case je.IN_BODY:case je.IN_TABLE:case je.IN_CAPTION:case je.IN_COLUMN_GROUP:case je.IN_TABLE_BODY:case je.IN_ROW:case je.IN_CELL:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:case je.IN_TEMPLATE:case je.IN_FRAMESET:case je.AFTER_FRAMESET:{Lj(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.AFTER_BODY:{kgt(this,e);break}case je.AFTER_AFTER_BODY:case je.AFTER_AFTER_FRAMESET:{vgt(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case je.INITIAL:{Igt(this,e);break}case je.BEFORE_HEAD:case je.IN_HEAD:case je.IN_HEAD_NO_SCRIPT:case je.AFTER_HEAD:{this._err(e,Bt.misplacedDoctype);break}case je.IN_TABLE_TEXT:{aw(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,Bt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Kft(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{Qgt(this,e);break}case je.BEFORE_HEAD:{xgt(this,e);break}case je.IN_HEAD:{El(this,e);break}case je.IN_HEAD_NO_SCRIPT:{Ngt(this,e);break}case je.AFTER_HEAD:{Tgt(this,e);break}case je.IN_BODY:{es(this,e);break}case je.IN_TABLE:{D2(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.IN_CAPTION:{Dft(this,e);break}case je.IN_COLUMN_GROUP:{IW(this,e);break}case je.IN_TABLE_BODY:{XS(this,e);break}case je.IN_ROW:{e6(this,e);break}case je.IN_CELL:{Fft(this,e);break}case je.IN_SELECT:{x4e(this,e);break}case je.IN_SELECT_IN_TABLE:{Rft(this,e);break}case je.IN_TEMPLATE:{Lft(this,e);break}case je.AFTER_BODY:{Gft(this,e);break}case je.IN_FRAMESET:{Pft(this,e);break}case je.AFTER_FRAMESET:{Uft(this,e);break}case je.AFTER_AFTER_BODY:{jft(this,e);break}case je.AFTER_AFTER_FRAMESET:{Hft(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Zft(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{_gt(this,e);break}case je.BEFORE_HEAD:{Dgt(this,e);break}case je.IN_HEAD:{Sgt(this,e);break}case je.IN_HEAD_NO_SCRIPT:{Fgt(this,e);break}case je.AFTER_HEAD:{Rgt(this,e);break}case je.IN_BODY:{JS(this,e);break}case je.TEXT:{Cft(this,e);break}case je.IN_TABLE:{WB(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.IN_CAPTION:{Sft(this,e);break}case je.IN_COLUMN_GROUP:{Nft(this,e);break}case je.IN_TABLE_BODY:{Oj(this,e);break}case je.IN_ROW:{_4e(this,e);break}case je.IN_CELL:{Tft(this,e);break}case je.IN_SELECT:{D4e(this,e);break}case je.IN_SELECT_IN_TABLE:{Mft(this,e);break}case je.IN_TEMPLATE:{Oft(this,e);break}case je.AFTER_BODY:{N4e(this,e);break}case je.IN_FRAMESET:{qft(this,e);break}case je.AFTER_FRAMESET:{$ft(this,e);break}case je.AFTER_AFTER_BODY:{Ox(this,e);break}}}onEof(e){switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{oB(this,e);break}case je.BEFORE_HEAD:{sB(this,e);break}case je.IN_HEAD:{AB(this,e);break}case je.IN_HEAD_NO_SCRIPT:{cB(this,e);break}case je.AFTER_HEAD:{lB(this,e);break}case je.IN_BODY:case je.IN_TABLE:case je.IN_CAPTION:case je.IN_COLUMN_GROUP:case je.IN_TABLE_BODY:case je.IN_ROW:case je.IN_CELL:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:{k4e(this,e);break}case je.TEXT:{wft(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.IN_TEMPLATE:{S4e(this,e);break}case je.AFTER_BODY:case je.IN_FRAMESET:case je.AFTER_FRAMESET:case je.AFTER_AFTER_BODY:case je.AFTER_AFTER_FRAMESET:{vW(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Ne.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case je.IN_HEAD:case je.IN_HEAD_NO_SCRIPT:case je.AFTER_HEAD:case je.TEXT:case je.IN_COLUMN_GROUP:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:case je.IN_FRAMESET:case je.AFTER_FRAMESET:{this._insertCharacters(e);break}case je.IN_BODY:case je.IN_CAPTION:case je.IN_CELL:case je.IN_TEMPLATE:case je.AFTER_BODY:case je.AFTER_AFTER_BODY:case je.AFTER_AFTER_FRAMESET:{y4e(this,e);break}case je.IN_TABLE:case je.IN_TABLE_BODY:case je.IN_ROW:{Y9(this,e);break}case je.IN_TABLE_TEXT:{v4e(this,e);break}}}};function bgt(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):B4e(t,e),n}function ygt(t,e){let n=null,a=t.openElements.stackTop;for(;a>=0;a--){const r=t.openElements.items[a];if(r===e.element)break;t._isSpecialElement(r,t.openElements.tagIDs[a])&&(n=r)}return n||(t.openElements.shortenToLength(Math.max(a,0)),t.activeFormattingElements.removeEntry(e)),n}function Cgt(t,e,n){let a=e,r=t.openElements.getCommonAncestor(e);for(let i=0,o=r;o!==n;i++,o=r){r=t.openElements.getCommonAncestor(o);const s=t.activeFormattingElements.getElementEntry(o),A=s&&i>=fgt;!s||A?(A&&t.activeFormattingElements.removeEntry(s),t.openElements.remove(o)):(o=wgt(t,s),a===e&&(t.activeFormattingElements.bookmark=s),t.treeAdapter.detachNode(a),t.treeAdapter.appendChild(o,a),a=o)}return a}function wgt(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),a=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,a),e.element=a,a}function Egt(t,e,n){const a=t.treeAdapter.getTagName(e),r=F1(a);if(t._isElementCausesFosterParenting(r))t._fosterParentElement(n);else{const i=t.treeAdapter.getNamespaceURI(e);r===V.TEMPLATE&&i===Ot.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function Bgt(t,e,n){const a=t.treeAdapter.getNamespaceURI(n.element),{token:r}=n,i=t.treeAdapter.createElement(r.tagName,a,r.attrs);t._adoptNodes(e,i),t.treeAdapter.appendChild(e,i),t.activeFormattingElements.insertElementAfterBookmark(i,r),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,i,r.tagID)}function kW(t,e){for(let n=0;n<ggt;n++){const a=bgt(t,e);if(!a)break;const r=ygt(t,a);if(!r)break;t.activeFormattingElements.bookmark=a;const i=Cgt(t,r,a.element),o=t.openElements.getCommonAncestor(a.element);t.treeAdapter.detachNode(i),o&&Egt(t,o,i),Bgt(t,r,a)}}function Lj(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function kgt(t,e){t._appendCommentNode(e,t.openElements.items[0])}function vgt(t,e){t._appendCommentNode(e,t.document)}function vW(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let a=t.openElements.stackTop;a>=n;a--)t._setEndLocation(t.openElements.items[a],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const a=t.openElements.items[0],r=t.treeAdapter.getNodeSourceCodeLocation(a);if(r&&!r.endTag&&(t._setEndLocation(a,e),t.openElements.stackTop>=1)){const i=t.openElements.items[1],o=t.treeAdapter.getNodeSourceCodeLocation(i);o&&!o.endTag&&t._setEndLocation(i,e)}}}}function Igt(t,e){t._setDocumentType(e);const n=e.forceQuirks?Ac.QUIRKS:ngt(e);tgt(e)||t._err(e,Bt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=je.BEFORE_HTML}function nw(t,e){t._err(e,Bt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Ac.QUIRKS),t.insertionMode=je.BEFORE_HTML,t._processToken(e)}function Qgt(t,e){e.tagID===V.HTML?(t._insertElement(e,Ot.HTML),t.insertionMode=je.BEFORE_HEAD):oB(t,e)}function _gt(t,e){const n=e.tagID;(n===V.HTML||n===V.HEAD||n===V.BODY||n===V.BR)&&oB(t,e)}function oB(t,e){t._insertFakeRootElement(),t.insertionMode=je.BEFORE_HEAD,t._processToken(e)}function xgt(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.HEAD:{t._insertElement(e,Ot.HTML),t.headElement=t.openElements.current,t.insertionMode=je.IN_HEAD;break}default:sB(t,e)}}function Dgt(t,e){const n=e.tagID;n===V.HEAD||n===V.BODY||n===V.HTML||n===V.BR?sB(t,e):t._err(e,Bt.endTagWithoutMatchingOpenElement)}function sB(t,e){t._insertFakeElement(dt.HEAD,V.HEAD),t.headElement=t.openElements.current,t.insertionMode=je.IN_HEAD,t._processToken(e)}function El(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:{t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.TITLE:{t._switchToTextParsing(e,ti.RCDATA);break}case V.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,ti.RAWTEXT):(t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_HEAD_NO_SCRIPT);break}case V.NOFRAMES:case V.STYLE:{t._switchToTextParsing(e,ti.RAWTEXT);break}case V.SCRIPT:{t._switchToTextParsing(e,ti.SCRIPT_DATA);break}case V.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=je.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(je.IN_TEMPLATE);break}case V.HEAD:{t._err(e,Bt.misplacedStartTagForHeadElement);break}default:AB(t,e)}}function Sgt(t,e){switch(e.tagID){case V.HEAD:{t.openElements.pop(),t.insertionMode=je.AFTER_HEAD;break}case V.BODY:case V.BR:case V.HTML:{AB(t,e);break}case V.TEMPLATE:{R0(t,e);break}default:t._err(e,Bt.endTagWithoutMatchingOpenElement)}}function R0(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==V.TEMPLATE&&t._err(e,Bt.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(V.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,Bt.endTagWithoutMatchingOpenElement)}function AB(t,e){t.openElements.pop(),t.insertionMode=je.AFTER_HEAD,t._processToken(e)}function Ngt(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.BASEFONT:case V.BGSOUND:case V.HEAD:case V.LINK:case V.META:case V.NOFRAMES:case V.STYLE:{El(t,e);break}case V.NOSCRIPT:{t._err(e,Bt.nestedNoscriptInHead);break}default:cB(t,e)}}function Fgt(t,e){switch(e.tagID){case V.NOSCRIPT:{t.openElements.pop(),t.insertionMode=je.IN_HEAD;break}case V.BR:{cB(t,e);break}default:t._err(e,Bt.endTagWithoutMatchingOpenElement)}}function cB(t,e){const n=e.type===sa.EOF?Bt.openElementsLeftAfterEof:Bt.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=je.IN_HEAD,t._processToken(e)}function Tgt(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.BODY:{t._insertElement(e,Ot.HTML),t.framesetOk=!1,t.insertionMode=je.IN_BODY;break}case V.FRAMESET:{t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_FRAMESET;break}case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:{t._err(e,Bt.abandonedHeadElementChild),t.openElements.push(t.headElement,V.HEAD),El(t,e),t.openElements.remove(t.headElement);break}case V.HEAD:{t._err(e,Bt.misplacedStartTagForHeadElement);break}default:lB(t,e)}}function Rgt(t,e){switch(e.tagID){case V.BODY:case V.HTML:case V.BR:{lB(t,e);break}case V.TEMPLATE:{R0(t,e);break}default:t._err(e,Bt.endTagWithoutMatchingOpenElement)}}function lB(t,e){t._insertFakeElement(dt.BODY,V.BODY),t.insertionMode=je.IN_BODY,VS(t,e)}function VS(t,e){switch(e.type){case sa.CHARACTER:{C4e(t,e);break}case sa.WHITESPACE_CHARACTER:{y4e(t,e);break}case sa.COMMENT:{Lj(t,e);break}case sa.START_TAG:{es(t,e);break}case sa.END_TAG:{JS(t,e);break}case sa.EOF:{k4e(t,e);break}}}function y4e(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function C4e(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function Mgt(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function Lgt(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function Ogt(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_FRAMESET)}function Ggt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML)}function Pgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Mj.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ot.HTML)}function qgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function Ugt(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),n||(t.formElement=t.openElements.current))}function $gt(t,e){t.framesetOk=!1;const n=e.tagID;for(let a=t.openElements.stackTop;a>=0;a--){const r=t.openElements.tagIDs[a];if(n===V.LI&&r===V.LI||(n===V.DD||n===V.DT)&&(r===V.DD||r===V.DT)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r);break}if(r!==V.ADDRESS&&r!==V.DIV&&r!==V.P&&t._isSpecialElement(t.openElements.items[a],r))break}t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML)}function jgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),t.tokenizer.state=ti.PLAINTEXT}function Hgt(t,e){t.openElements.hasInScope(V.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(V.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.framesetOk=!1}function zgt(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(dt.A);n&&(kW(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Ygt(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Kgt(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(V.NOBR)&&(kW(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ot.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Zgt(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function Wgt(t,e){t.treeAdapter.getDocumentMode(t.document)!==Ac.QUIRKS&&t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),t.framesetOk=!1,t.insertionMode=je.IN_TABLE}function w4e(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ot.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function E4e(t){const e=l4e(t,Uf.TYPE);return e!=null&&e.toLowerCase()===mgt}function Vgt(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ot.HTML),E4e(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function Jgt(t,e){t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0}function Xgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._appendElement(e,Ot.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function eft(t,e){e.tagName=dt.IMG,e.tagID=V.IMG,w4e(t,e)}function tft(t,e){t._insertElement(e,Ot.HTML),t.skipNextNewLine=!0,t.tokenizer.state=ti.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=je.TEXT}function nft(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,ti.RAWTEXT)}function aft(t,e){t.framesetOk=!1,t._switchToTextParsing(e,ti.RAWTEXT)}function ice(t,e){t._switchToTextParsing(e,ti.RAWTEXT)}function rft(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===je.IN_TABLE||t.insertionMode===je.IN_CAPTION||t.insertionMode===je.IN_TABLE_BODY||t.insertionMode===je.IN_ROW||t.insertionMode===je.IN_CELL?je.IN_SELECT_IN_TABLE:je.IN_SELECT}function ift(t,e){t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML)}function oft(t,e){t.openElements.hasInScope(V.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ot.HTML)}function sft(t,e){t.openElements.hasInScope(V.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(V.RTC),t._insertElement(e,Ot.HTML)}function Aft(t,e){t._reconstructActiveFormattingElements(),f4e(e),BW(e),e.selfClosing?t._appendElement(e,Ot.MATHML):t._insertElement(e,Ot.MATHML),e.ackSelfClosing=!0}function cft(t,e){t._reconstructActiveFormattingElements(),h4e(e),BW(e),e.selfClosing?t._appendElement(e,Ot.SVG):t._insertElement(e,Ot.SVG),e.ackSelfClosing=!0}function oce(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML)}function es(t,e){switch(e.tagID){case V.I:case V.S:case V.B:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.SMALL:case V.STRIKE:case V.STRONG:{Ygt(t,e);break}case V.A:{zgt(t,e);break}case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:{Pgt(t,e);break}case V.P:case V.DL:case V.OL:case V.UL:case V.DIV:case V.DIR:case V.NAV:case V.MAIN:case V.MENU:case V.ASIDE:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.DETAILS:case V.ADDRESS:case V.ARTICLE:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:{Ggt(t,e);break}case V.LI:case V.DD:case V.DT:{$gt(t,e);break}case V.BR:case V.IMG:case V.WBR:case V.AREA:case V.EMBED:case V.KEYGEN:{w4e(t,e);break}case V.HR:{Xgt(t,e);break}case V.RB:case V.RTC:{oft(t,e);break}case V.RT:case V.RP:{sft(t,e);break}case V.PRE:case V.LISTING:{qgt(t,e);break}case V.XMP:{nft(t,e);break}case V.SVG:{cft(t,e);break}case V.HTML:{Mgt(t,e);break}case V.BASE:case V.LINK:case V.META:case V.STYLE:case V.TITLE:case V.SCRIPT:case V.BGSOUND:case V.BASEFONT:case V.TEMPLATE:{El(t,e);break}case V.BODY:{Lgt(t,e);break}case V.FORM:{Ugt(t,e);break}case V.NOBR:{Kgt(t,e);break}case V.MATH:{Aft(t,e);break}case V.TABLE:{Wgt(t,e);break}case V.INPUT:{Vgt(t,e);break}case V.PARAM:case V.TRACK:case V.SOURCE:{Jgt(t,e);break}case V.IMAGE:{eft(t,e);break}case V.BUTTON:{Hgt(t,e);break}case V.APPLET:case V.OBJECT:case V.MARQUEE:{Zgt(t,e);break}case V.IFRAME:{aft(t,e);break}case V.SELECT:{rft(t,e);break}case V.OPTION:case V.OPTGROUP:{ift(t,e);break}case V.NOEMBED:case V.NOFRAMES:{ice(t,e);break}case V.FRAMESET:{Ogt(t,e);break}case V.TEXTAREA:{tft(t,e);break}case V.NOSCRIPT:{t.options.scriptingEnabled?ice(t,e):oce(t,e);break}case V.PLAINTEXT:{jgt(t,e);break}case V.COL:case V.TH:case V.TD:case V.TR:case V.HEAD:case V.FRAME:case V.TBODY:case V.TFOOT:case V.THEAD:case V.CAPTION:case V.COLGROUP:break;default:oce(t,e)}}function lft(t,e){if(t.openElements.hasInScope(V.BODY)&&(t.insertionMode=je.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function uft(t,e){t.openElements.hasInScope(V.BODY)&&(t.insertionMode=je.AFTER_BODY,N4e(t,e))}function dft(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function pft(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(V.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(V.FORM):n&&t.openElements.remove(n))}function mft(t){t.openElements.hasInButtonScope(V.P)||t._insertFakeElement(dt.P,V.P),t._closePElement()}function gft(t){t.openElements.hasInListItemScope(V.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(V.LI),t.openElements.popUntilTagNamePopped(V.LI))}function fft(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function hft(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function bft(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function yft(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(dt.BR,V.BR),t.openElements.pop(),t.framesetOk=!1}function B4e(t,e){const n=e.tagName,a=e.tagID;for(let r=t.openElements.stackTop;r>0;r--){const i=t.openElements.items[r],o=t.openElements.tagIDs[r];if(a===o&&(a!==V.UNKNOWN||t.treeAdapter.getTagName(i)===n)){t.openElements.generateImpliedEndTagsWithExclusion(a),t.openElements.stackTop>=r&&t.openElements.shortenToLength(r);break}if(t._isSpecialElement(i,o))break}}function JS(t,e){switch(e.tagID){case V.A:case V.B:case V.I:case V.S:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.NOBR:case V.SMALL:case V.STRIKE:case V.STRONG:{kW(t,e);break}case V.P:{mft(t);break}case V.DL:case V.UL:case V.OL:case V.DIR:case V.DIV:case V.NAV:case V.PRE:case V.MAIN:case V.MENU:case V.ASIDE:case V.BUTTON:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.ADDRESS:case V.ARTICLE:case V.DETAILS:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.LISTING:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:{dft(t,e);break}case V.LI:{gft(t);break}case V.DD:case V.DT:{fft(t,e);break}case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:{hft(t);break}case V.BR:{yft(t);break}case V.BODY:{lft(t,e);break}case V.HTML:{uft(t,e);break}case V.FORM:{pft(t);break}case V.APPLET:case V.OBJECT:case V.MARQUEE:{bft(t,e);break}case V.TEMPLATE:{R0(t,e);break}default:B4e(t,e)}}function k4e(t,e){t.tmplInsertionModeStack.length>0?S4e(t,e):vW(t,e)}function Cft(t,e){var n;e.tagID===V.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function wft(t,e){t._err(e,Bt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Y9(t,e){if(t.openElements.currentTagId!==void 0&&b4e.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=je.IN_TABLE_TEXT,e.type){case sa.CHARACTER:{I4e(t,e);break}case sa.WHITESPACE_CHARACTER:{v4e(t,e);break}}else Ev(t,e)}function Eft(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_CAPTION}function Bft(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_COLUMN_GROUP}function kft(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(dt.COLGROUP,V.COLGROUP),t.insertionMode=je.IN_COLUMN_GROUP,IW(t,e)}function vft(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_TABLE_BODY}function Ift(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(dt.TBODY,V.TBODY),t.insertionMode=je.IN_TABLE_BODY,XS(t,e)}function Qft(t,e){t.openElements.hasInTableScope(V.TABLE)&&(t.openElements.popUntilTagNamePopped(V.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function _ft(t,e){E4e(e)?t._appendElement(e,Ot.HTML):Ev(t,e),e.ackSelfClosing=!0}function xft(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ot.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function D2(t,e){switch(e.tagID){case V.TD:case V.TH:case V.TR:{Ift(t,e);break}case V.STYLE:case V.SCRIPT:case V.TEMPLATE:{El(t,e);break}case V.COL:{kft(t,e);break}case V.FORM:{xft(t,e);break}case V.TABLE:{Qft(t,e);break}case V.TBODY:case V.TFOOT:case V.THEAD:{vft(t,e);break}case V.INPUT:{_ft(t,e);break}case V.CAPTION:{Eft(t,e);break}case V.COLGROUP:{Bft(t,e);break}default:Ev(t,e)}}function WB(t,e){switch(e.tagID){case V.TABLE:{t.openElements.hasInTableScope(V.TABLE)&&(t.openElements.popUntilTagNamePopped(V.TABLE),t._resetInsertionMode());break}case V.TEMPLATE:{R0(t,e);break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:Ev(t,e)}}function Ev(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,VS(t,e),t.fosterParentingEnabled=n}function v4e(t,e){t.pendingCharacterTokens.push(e)}function I4e(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function aw(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Ev(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Q4e=new Set([V.CAPTION,V.COL,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]);function Dft(t,e){const n=e.tagID;Q4e.has(n)?t.openElements.hasInTableScope(V.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(V.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=je.IN_TABLE,D2(t,e)):es(t,e)}function Sft(t,e){const n=e.tagID;switch(n){case V.CAPTION:case V.TABLE:{t.openElements.hasInTableScope(V.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(V.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=je.IN_TABLE,n===V.TABLE&&WB(t,e));break}case V.BODY:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:JS(t,e)}}function IW(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.COL:{t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.TEMPLATE:{El(t,e);break}default:VD(t,e)}}function Nft(t,e){switch(e.tagID){case V.COLGROUP:{t.openElements.currentTagId===V.COLGROUP&&(t.openElements.pop(),t.insertionMode=je.IN_TABLE);break}case V.TEMPLATE:{R0(t,e);break}case V.COL:break;default:VD(t,e)}}function VD(t,e){t.openElements.currentTagId===V.COLGROUP&&(t.openElements.pop(),t.insertionMode=je.IN_TABLE,t._processToken(e))}function XS(t,e){switch(e.tagID){case V.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_ROW;break}case V.TH:case V.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(dt.TR,V.TR),t.insertionMode=je.IN_ROW,e6(t,e);break}case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE,D2(t,e));break}default:D2(t,e)}}function Oj(t,e){const n=e.tagID;switch(e.tagID){case V.TBODY:case V.TFOOT:case V.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE);break}case V.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE,WB(t,e));break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:case V.TR:break;default:WB(t,e)}}function e6(t,e){switch(e.tagID){case V.TH:case V.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_CELL,t.activeFormattingElements.insertMarker();break}case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:{t.openElements.hasInTableScope(V.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY,XS(t,e));break}default:D2(t,e)}}function _4e(t,e){switch(e.tagID){case V.TR:{t.openElements.hasInTableScope(V.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY);break}case V.TABLE:{t.openElements.hasInTableScope(V.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY,Oj(t,e));break}case V.TBODY:case V.TFOOT:case V.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(V.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY,Oj(t,e));break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:break;default:WB(t,e)}}function Fft(t,e){const n=e.tagID;Q4e.has(n)?(t.openElements.hasInTableScope(V.TD)||t.openElements.hasInTableScope(V.TH))&&(t._closeTableCell(),e6(t,e)):es(t,e)}function Tft(t,e){const n=e.tagID;switch(n){case V.TD:case V.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=je.IN_ROW);break}case V.TABLE:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),_4e(t,e));break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:break;default:JS(t,e)}}function x4e(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.OPTION:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t._insertElement(e,Ot.HTML);break}case V.OPTGROUP:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t.openElements.currentTagId===V.OPTGROUP&&t.openElements.pop(),t._insertElement(e,Ot.HTML);break}case V.HR:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t.openElements.currentTagId===V.OPTGROUP&&t.openElements.pop(),t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.INPUT:case V.KEYGEN:case V.TEXTAREA:case V.SELECT:{t.openElements.hasInSelectScope(V.SELECT)&&(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode(),e.tagID!==V.SELECT&&t._processStartTag(e));break}case V.SCRIPT:case V.TEMPLATE:{El(t,e);break}}}function D4e(t,e){switch(e.tagID){case V.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===V.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===V.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===V.OPTGROUP&&t.openElements.pop();break}case V.OPTION:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop();break}case V.SELECT:{t.openElements.hasInSelectScope(V.SELECT)&&(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode());break}case V.TEMPLATE:{R0(t,e);break}}}function Rft(t,e){const n=e.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode(),t._processStartTag(e)):x4e(t,e)}function Mft(t,e){const n=e.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode(),t.onEndTag(e)):D4e(t,e)}function Lft(t,e){switch(e.tagID){case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:{El(t,e);break}case V.CAPTION:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:{t.tmplInsertionModeStack[0]=je.IN_TABLE,t.insertionMode=je.IN_TABLE,D2(t,e);break}case V.COL:{t.tmplInsertionModeStack[0]=je.IN_COLUMN_GROUP,t.insertionMode=je.IN_COLUMN_GROUP,IW(t,e);break}case V.TR:{t.tmplInsertionModeStack[0]=je.IN_TABLE_BODY,t.insertionMode=je.IN_TABLE_BODY,XS(t,e);break}case V.TD:case V.TH:{t.tmplInsertionModeStack[0]=je.IN_ROW,t.insertionMode=je.IN_ROW,e6(t,e);break}default:t.tmplInsertionModeStack[0]=je.IN_BODY,t.insertionMode=je.IN_BODY,es(t,e)}}function Oft(t,e){e.tagID===V.TEMPLATE&&R0(t,e)}function S4e(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(V.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):vW(t,e)}function Gft(t,e){e.tagID===V.HTML?es(t,e):JD(t,e)}function N4e(t,e){var n;if(e.tagID===V.HTML){if(t.fragmentContext||(t.insertionMode=je.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===V.HTML){t._setEndLocation(t.openElements.items[0],e);const a=t.openElements.items[1];a&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(a))===null||n===void 0)&&n.endTag)&&t._setEndLocation(a,e)}}else JD(t,e)}function JD(t,e){t.insertionMode=je.IN_BODY,VS(t,e)}function Pft(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.FRAMESET:{t._insertElement(e,Ot.HTML);break}case V.FRAME:{t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.NOFRAMES:{El(t,e);break}}}function qft(t,e){e.tagID===V.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==V.FRAMESET&&(t.insertionMode=je.AFTER_FRAMESET))}function Uft(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.NOFRAMES:{El(t,e);break}}}function $ft(t,e){e.tagID===V.HTML&&(t.insertionMode=je.AFTER_AFTER_FRAMESET)}function jft(t,e){e.tagID===V.HTML?es(t,e):Ox(t,e)}function Ox(t,e){t.insertionMode=je.IN_BODY,VS(t,e)}function Hft(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.NOFRAMES:{El(t,e);break}}}function zft(t,e){e.chars=vr,t._insertCharacters(e)}function Yft(t,e){t._insertCharacters(e),t.framesetOk=!1}function F4e(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ot.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function Kft(t,e){if(cgt(e))F4e(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),a=t.treeAdapter.getNamespaceURI(n);a===Ot.MATHML?f4e(e):a===Ot.SVG&&(lgt(e),h4e(e)),BW(e),e.selfClosing?t._appendElement(e,a):t._insertElement(e,a),e.ackSelfClosing=!0}}function Zft(t,e){if(e.tagID===V.P||e.tagID===V.BR){F4e(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const a=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(a)===Ot.HTML){t._endTagOutsideForeignContent(e);break}const r=t.treeAdapter.getTagName(a);if(r.toLowerCase()===e.tagName){e.tagName=r,t.openElements.shortenToLength(n);break}}}dt.AREA,dt.BASE,dt.BASEFONT,dt.BGSOUND,dt.BR,dt.COL,dt.EMBED,dt.FRAME,dt.HR,dt.IMG,dt.INPUT,dt.KEYGEN,dt.LINK,dt.META,dt.PARAM,dt.SOURCE,dt.TRACK,dt.WBR;const t6=T4e("end"),Du=T4e("start");function T4e(t){return e;function e(n){const a=n&&n.position&&n.position[t]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Wft(t){const e=Du(t),n=t6(t);if(e&&n)return{start:e,end:n}}const Vft=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Jft=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),sce={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function R4e(t,e){const n=A0t(t),a=MK("type",{handlers:{root:Xft,element:e0t,text:t0t,comment:L4e,doctype:n0t,raw:r0t},unknown:i0t}),r={parser:n?new rce(sce):rce.getFragmentParser(void 0,sce),handle(s){a(s,r)},stitches:!1,options:e||{}};a(t,r),T1(r,Du());const i=n?r.parser.document:r.parser.getFragment(),o=cmt(i,{file:r.options.file});return r.stitches&&Q2(o,"comment",function(s,A,l){const u=s;if(u.value.stitch&&l&&A!==void 0){const d=l.children;return d[A]=u.value.stitch,A}}),o.type==="root"&&o.children.length===1&&o.children[0].type===t.type?o.children[0]:o}function M4e(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function Xft(t,e){M4e(t.children,e)}function e0t(t,e){o0t(t,e),M4e(t.children,e),s0t(t,e)}function t0t(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:sa.CHARACTER,chars:t.value,location:Bv(t)};T1(e,Du(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function n0t(t,e){const n={type:sa.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Bv(t)};T1(e,Du(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function a0t(t,e){e.stitches=!0;const n=c0t(t);if("children"in t&&"children"in n){const a=R4e({type:"root",children:t.children},e.options);n.children=a.children}L4e({type:"comment",value:{stitch:n}},e)}function L4e(t,e){const n=t.value,a={type:sa.COMMENT,data:n,location:Bv(t)};T1(e,Du(t)),e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken)}function r0t(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,O4e(e,Du(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(Vft,"&lt;$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function i0t(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))a0t(n,e);else{let a="";throw Jft.has(n.type)&&(a=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+a)}}function T1(t,e){O4e(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=ti.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function O4e(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function o0t(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===ti.PLAINTEXT)return;T1(e,Du(t));const a=e.parser.openElements.current;let r="namespaceURI"in a?a.namespaceURI:nu.html;r===nu.html&&n==="svg"&&(r=nu.svg);const i=mmt({...t,children:[]},{space:r===nu.svg?"svg":"html"}),o={type:sa.START_TAG,tagName:n,tagID:F1(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Bv(t)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function s0t(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&dke.includes(n)||e.parser.tokenizer.state===ti.PLAINTEXT)return;T1(e,t6(t));const a={type:sa.END_TAG,tagName:n,tagID:F1(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Bv(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===ti.RCDATA||e.parser.tokenizer.state===ti.RAWTEXT||e.parser.tokenizer.state===ti.SCRIPT_DATA)&&(e.parser.tokenizer.state=ti.DATA)}function A0t(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Bv(t){const e=Du(t)||{line:void 0,column:void 0,offset:void 0},n=t6(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function c0t(t){return"children"in t?x2({...t,children:[]}):x2(t)}function l0t(t){return function(e,n){return R4e(e,{...t,file:n})}}const _d={eof:null,asterisk:42,underscore:95,tilde:126},S2={attentionSideAfter:2,characterGroupPunctuation:2,characterGroupWhitespace:1},$l={data:"data",characterEscape:"characterEscape",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",strong:"strong",strongSequence:"strongSequence",strongText:"strongText"},us=lg(/[A-Za-z]/),zo=lg(/[\dA-Za-z]/),u0t=lg(/[#-'*+\--9=?A-Z^-~]/);function XD(t){return t!==null&&(t<32||t===127)}const Gj=lg(/\d/),d0t=lg(/[\dA-Fa-f]/),p0t=lg(/[!-/:-@[-`{-~]/);function wn(t){return t!==null&&t<-2}function ar(t){return t!==null&&(t<0||t===32)}function pa(t){return t===-2||t===-1||t===32}const n6=lg(new RegExp("\\p{P}|\\p{S}","u")),n0=lg(/\s/);function lg(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function m0t(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function g0t(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function f0t(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function h0t(t){return m0t(t)?"ambiguous":g0t(t)?"fullwidth":t===8361||t>=65377&&t<=65470||t>=65474&&t<=65479||t>=65482&&t<=65487||t>=65490&&t<=65495||t>=65498&&t<=65500||t>=65512&&t<=65518?"halfwidth":t>=32&&t<=126||t===162||t===163||t===165||t===166||t===172||t===175||t>=10214&&t<=10221||t===10629||t===10630?"narrow":f0t(t)?"wide":"neutral"}function b0t(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function y0t(t){return b0t(t),h0t(t)}var C0t=Object.defineProperty,w0t=(t,e,n)=>e in t?C0t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,E0t=(t,e,n)=>w0t(t,e+"",n);function B0t(t){return new RegExp("^\\p{Emoji_Presentation}","u").test(String.fromCodePoint(t))}function k0t(t){if(!t||t<4352)return!1;switch(y0t(t)){case"fullwidth":case"halfwidth":return!0;case"wide":return!B0t(t);case"narrow":return!1;case"ambiguous":return 917760<=t&&t<=917999?null:!1;case"neutral":return new RegExp("^\\p{sc=Hangul}","u").test(String.fromCodePoint(t))}}function v0t(t,e){return e!==65025||!t||t<8216?!1:t===8216||t===8217||t===8220||t===8221}function I0t(t){return t!==null&&t>=65024&&t<=65038}var Q0t=G4e(new RegExp("\\p{P}|\\p{S}","u")),_0t=G4e(/\s/);function G4e(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCodePoint(n))}}var NA;(t=>{t.spaceOrPunctuation=3,t.cjk=4096,t.cjkPunctuation=4098,t.ivs=8192,t.cjkOrIvs=12288,t.nonEmojiGeneralUseVS=16384,t.variationSelector=24576,t.ivsToCjkRightShift=1})(NA||(NA={}));function ny(t){if(t===_d.eof||ar(t)||_0t(t))return S2.characterGroupWhitespace;let e=0;if(t>=4352){if(I0t(t))return NA.nonEmojiGeneralUseVS;switch(k0t(t)){case null:return NA.ivs;case!0:e|=NA.cjk;break}}return Q0t(t)&&(e|=S2.characterGroupPunctuation),e}function P4e(t,e,n){if(!N0t(t))return t;const a=e(),r=ny(a);return!a||VB(r)?t:v0t(a,n)?NA.cjkPunctuation:x0t(r)}function x0t(t){return t&~NA.ivs}function VB(t){return!!(t&S2.characterGroupWhitespace)}function e3(t){return(t&NA.cjkPunctuation)===S2.characterGroupPunctuation}function Pj(t){return!!(t&NA.cjk)}function D0t(t){return t===NA.ivs}function S0t(t){return!!(t&NA.cjkOrIvs)}function N0t(t){return t===NA.nonEmojiGeneralUseVS}function Ace(t){return!!(t&NA.spaceOrPunctuation)}function q4e(t){return!!(t&&t>=55296&&t<=56319)}function U4e(t){return!!(t&&t>=56320&&t<=57343)}function $4e(t,e,n){if(e._bufferIndex<2)return t;const r=n({start:{...e,_bufferIndex:e._bufferIndex-2},end:e}).codePointAt(0);return r&&r>=65536?r:t}function F0t(t,e,n){const a=t>=65536?2:1;if(e._bufferIndex<1+a)return null;const r=e._bufferIndex-a-2,i=n({start:{...e,_bufferIndex:r>=0?r:0},end:{...e,_bufferIndex:e._bufferIndex-a}}),o=i.charCodeAt(i.length-1);if(Number.isNaN(o))return null;if(i.length<2||o<56320||57343<o)return o;const s=i.codePointAt(0);return s&&s>=65536?s:o}var j4e=class{constructor(t,e,n){this.previousCode=t,this.nowPoint=e,this.sliceSerialize=n,E0t(this,"cachedValue")}value(){return this.cachedValue===void 0&&(this.cachedValue=F0t(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function H4e(t,e,n){const a=n({start:e,end:{...e,_bufferIndex:e._bufferIndex+2}}).codePointAt(0);return a&&a>=65536?a:t}function Do(t,e,n,a){const r=t.length;let i=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,a.length<1e4)o=Array.from(a),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);i<a.length;)o=a.slice(i,i+1e4),o.unshift(e,0),t.splice(...o),i+=1e4,e+=1e4}function vo(t,e){return t.length>0?(Do(t,t.length,0,e),t):e}function R1(t,e,n){const a=[];let r=-1;for(;++r<t.length;){const i=t[r].resolveAll;i&&!a.includes(i)&&(e=i(e,n),a.push(i))}return e}var K9={name:"attention",resolveAll:T0t,tokenize:R0t};function T0t(t,e){let n=-1,a,r,i,o,s,A,l,u;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(a=n;a--;)if(t[a][0]==="exit"&&t[a][1].type==="attentionSequence"&&t[a][1]._open&&e.sliceSerialize(t[a][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[a][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[a][1].end.offset-t[a][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;A=t[a][1].end.offset-t[a][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const d={...t[a][1].end},p={...t[n][1].start};cce(d,-A),cce(p,A),o={type:A>1?$l.strongSequence:$l.emphasisSequence,start:d,end:{...t[a][1].end}},s={type:A>1?$l.strongSequence:$l.emphasisSequence,start:{...t[n][1].start},end:p},i={type:A>1?$l.strongText:$l.emphasisText,start:{...t[a][1].end},end:{...t[n][1].start}},r={type:A>1?$l.strong:$l.emphasis,start:{...o.start},end:{...s.end}},t[a][1].end={...o.start},t[n][1].start={...s.end},l=[],t[a][1].end.offset-t[a][1].start.offset&&(l=vo(l,[["enter",t[a][1],e],["exit",t[a][1],e]])),l=vo(l,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",i,e]]),e.parser.constructs.insideSpan.null,l=vo(l,R1(e.parser.constructs.insideSpan.null,t.slice(a+1,n),e)),l=vo(l,[["exit",i,e],["enter",s,e],["exit",s,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,l=vo(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Do(t,a-1,n-a+3,l),n=a+l.length-u-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function R0t(t,e){const n=this.parser.constructs.attentionMarkers.null,{now:a,sliceSerialize:r,previous:i}=this,o=U4e(i)?$4e(i,a(),r):i,s=ny(o),A=new j4e(o,a(),r),l=P4e(s,A.value.bind(A),o);let u;return d;function d(m){return u=m,t.enter("attentionSequence"),p(m)}function p(m){if(m===u)return t.consume(m),p;const g=t.exit("attentionSequence"),h=q4e(m)?H4e(m,a(),r):m,b=ny(h),y=e3(l),w=y||VB(l),E=e3(b),k=E||VB(b),v=S0t(l),_=!k||E&&(w||v)||n.includes(m),I=!w||y&&(k||Pj(b))||n.includes(o);return g._open=!!(u===_d.asterisk?_:_&&(Ace(l)||!I)),g._close=!!(u===_d.asterisk?I:I&&(Ace(b)||!_)),e(m)}}function cce(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}function M0t(){return{text:{[_d.asterisk]:K9,[_d.underscore]:K9},insideSpan:{null:[K9]}}}function L0t(){const t=this.data();(t.micromarkExtensions||(t.micromarkExtensions=[])).push(M0t())}function O0t(t){let n=(t||{}).singleTilde;const a={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{[_d.tilde]:a},insideSpan:{null:[a]},attentionMarkers:{null:[_d.tilde]}};function r(o,s){let A=-1;for(;++A<o.length;)if(o[A][0]==="enter"&&o[A][1].type==="strikethroughSequenceTemporary"&&o[A][1]._close){let l=A;for(;l--;)if(o[l][0]==="exit"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._open&&o[A][1].end.offset-o[A][1].start.offset===o[l][1].end.offset-o[l][1].start.offset){o[A][1].type="strikethroughSequence",o[l][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[l][1].start),end:Object.assign({},o[A][1].end)},d={type:"strikethroughText",start:Object.assign({},o[l][1].end),end:Object.assign({},o[A][1].start)},p=[["enter",u,s],["enter",o[l][1],s],["exit",o[l][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Do(p,p.length,0,R1(m,o.slice(l+1,A),s)),Do(p,p.length,0,[["exit",d,s],["enter",o[A][1],s],["exit",o[A][1],s],["exit",u,s]]),Do(o,l-1,A-l+3,p),A=l+p.length-2;break}}for(A=-1;++A<o.length;)o[A][1].type==="strikethroughSequenceTemporary"&&(o[A][1].type=$l.data);return o}function i(o,s,A){const{now:l,sliceSerialize:u,previous:d}=this,p=U4e(d)?$4e(d,l(),u):d,m=ny(p),g=new j4e(p,l(),u),h=P4e(m,g.value.bind(g),p),b=this.events;let y=0;return w;function w(k){return p===_d.tilde&&b[b.length-1][1].type!==$l.characterEscape?A(k):(o.enter("strikethroughSequenceTemporary"),E(k))}function E(k){const v=ny(p);if(k===_d.tilde)return y>1?A(k):(o.consume(k),y++,E);if(y<2&&!n)return A(k);const _=o.exit("strikethroughSequenceTemporary"),I=q4e(k)?H4e(k,l(),u):k,x=ny(I),R=e3(h)||VB(h),O=e3(x)||VB(x),$=Pj(h)||D0t(v);return _._open=!O||x===S2.attentionSideAfter&&(R||$),_._close=!R||v===S2.attentionSideAfter&&(O||Pj(x)),s(k)}}}function G0t(t){const e=this.data();(e.micromarkExtensions||(e.micromarkExtensions=[])).push(O0t(t))}function P0t(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function q0t(t,e,n){const r=bv((n||{}).ignore||[]),i=U0t(e);let o=-1;for(;++o<i.length;)ZZ(t,"text",s);function s(l,u){let d=-1,p;for(;++d<u.length;){const m=u[d],g=p?p.children:void 0;if(r(m,g?g.indexOf(m):void 0,p))return;p=m}if(p)return A(l,u)}function A(l,u){const d=u[u.length-1],p=i[o][0],m=i[o][1];let g=0;const b=d.children.indexOf(l);let y=!1,w=[];p.lastIndex=0;let E=p.exec(l.value);for(;E;){const k=E.index,v={index:E.index,input:E.input,stack:[...u,l]};let _=m(...E,v);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?p.lastIndex=k+1:(g!==k&&w.push({type:"text",value:l.value.slice(g,k)}),Array.isArray(_)?w.push(..._):_&&w.push(_),g=k+E[0].length,y=!0),!p.global)break;E=p.exec(l.value)}return y?(g<l.value.length&&w.push({type:"text",value:l.value.slice(g)}),d.children.splice(b,1,...w)):w=[l],b+w.length}}function U0t(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let a=-1;for(;++a<n.length;){const r=n[a];e.push([$0t(r[0]),j0t(r[1])])}return e}function $0t(t){return typeof t=="string"?new RegExp(P0t(t),"g"):t}function j0t(t){return typeof t=="function"?t:function(){return t}}const Z9="phrasing",W9=["autolink","link","image","label"];function H0t(){return{transforms:[J0t],enter:{literalAutolink:Y0t,literalAutolinkEmail:V9,literalAutolinkHttp:V9,literalAutolinkWww:V9},exit:{literalAutolink:V0t,literalAutolinkEmail:W0t,literalAutolinkHttp:K0t,literalAutolinkWww:Z0t}}}function z0t(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Z9,notInConstruct:W9},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Z9,notInConstruct:W9},{character:":",before:"[ps]",after:"\\/",inConstruct:Z9,notInConstruct:W9}]}}function Y0t(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function V9(t){this.config.enter.autolinkProtocol.call(this,t)}function K0t(t){this.config.exit.autolinkProtocol.call(this,t)}function Z0t(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function W0t(t){this.config.exit.autolinkEmail.call(this,t)}function V0t(t){this.exit(t)}function J0t(t){q0t(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,X0t],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),eht]],{ignore:["link","linkReference"]})}function X0t(t,e,n,a,r){let i="";if(!z4e(r)||(/^w/i.test(e)&&(n=e+n,e="",i="http://"),!tht(n)))return!1;const o=nht(n+a);if(!o[0])return!1;const s={type:"link",title:null,url:i+e+o[0],children:[{type:"text",value:e+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function eht(t,e,n,a){return!z4e(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function tht(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function nht(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],a=n.indexOf(")");const r=bD(t,"(");let i=bD(t,")");for(;a!==-1&&r>i;)t+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),i++;return[t,n]}function z4e(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||n0(n)||n6(n))&&(!e||n!==47)}function nl(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Y4e.peek=uht;function aht(){this.buffer()}function rht(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function iht(){this.buffer()}function oht(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function sht(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=nl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Aht(t){this.exit(t)}function cht(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=nl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function lht(t){this.exit(t)}function uht(){return"["}function Y4e(t,e,n,a){const r=n.createTracker(a);let i=r.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return i+=r.move(n.safe(n.associationId(t),{after:"]",before:i})),s(),o(),i+=r.move("]"),i}function dht(){return{enter:{gfmFootnoteCallString:aht,gfmFootnoteCall:rht,gfmFootnoteDefinitionLabelString:iht,gfmFootnoteDefinition:oht},exit:{gfmFootnoteCallString:sht,gfmFootnoteCall:Aht,gfmFootnoteDefinitionLabelString:cht,gfmFootnoteDefinition:lht}}}function pht(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Y4e},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,r,i,o){const s=i.createTracker(o);let A=s.move("[^");const l=i.enter("footnoteDefinition"),u=i.enter("label");return A+=s.move(i.safe(i.associationId(a),{before:A,after:"]"})),u(),A+=s.move("]:"),a.children&&a.children.length>0&&(s.shift(4),A+=s.move((e?`
1601
+ `,e);return a===-1?n:n===-1||n+1===a?a:n<a?n:a}const r4e={}.hasOwnProperty,Amt=Object.prototype;function cmt(t,e){const n=e||{};return wW({file:n.file||void 0,location:!1,schema:n.space==="svg"?vu:y1,verbose:n.verbose||!1},t)}function wW(t,e){let n;switch(e.nodeName){case"#comment":{const a=e;return n={type:"comment",value:a.data},Lx(t,a,n),n}case"#document":case"#document-fragment":{const a=e,r="mode"in a?a.mode==="quirks"||a.mode==="limited-quirks":!1;if(n={type:"root",children:i4e(t,e.childNodes),data:{quirksMode:r}},t.file&&t.location){const i=String(t.file),o=smt(i),s=o.toPoint(0),A=o.toPoint(i.length);n.position={start:s,end:A}}return n}case"#documentType":{const a=e;return n={type:"doctype"},Lx(t,a,n),n}case"#text":{const a=e;return n={type:"text",value:a.value},Lx(t,a,n),n}default:return n=lmt(t,e),n}}function i4e(t,e){let n=-1;const a=[];for(;++n<e.length;){const r=wW(t,e[n]);a.push(r)}return a}function lmt(t,e){const n=t.schema;t.schema=e.namespaceURI===nu.svg?vu:y1;let a=-1;const r={};for(;++a<e.attrs.length;){const s=e.attrs[a],A=(s.prefix?s.prefix+":":"")+s.name;r4e.call(Amt,A)||(r[A]=s.value)}const o=(t.schema.space==="svg"?z_e:H_e)(e.tagName,r,i4e(t,e.childNodes));if(Lx(t,e,o),o.tagName==="template"){const s=e,A=s.sourceCodeLocation,l=A&&A.startTag&&Ob(A.startTag),u=A&&A.endTag&&Ob(A.endTag),d=wW(t,s.content);l&&u&&t.file&&(d.position={start:l.end,end:u.start}),o.content=d}return t.schema=n,o}function Lx(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const a=umt(t,n,e.sourceCodeLocation);a&&(t.location=!0,n.position=a)}}function umt(t,e,n){const a=Ob(n);if(e.type==="element"){const r=e.children[e.children.length-1];if(a&&!n.endTag&&r&&r.position&&r.position.end&&(a.end=Object.assign({},r.position.end)),t.verbose){const i={};let o;if(n.attrs)for(o in n.attrs)r4e.call(n.attrs,o)&&(i[sv(t.schema,o).property]=Ob(n.attrs[o]));n.startTag;const s=Ob(n.startTag),A=n.endTag?Ob(n.endTag):void 0,l={opening:s};A&&(l.closing=A),l.properties=i,e.data={position:l}}}return a}function Ob(t){const e=KAe({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=KAe({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function KAe(t){return t.line&&t.column?t:void 0}const dmt={},pmt={}.hasOwnProperty,o4e=GK("type",{handlers:{root:gmt,element:Cmt,text:bmt,comment:ymt,doctype:hmt}});function mmt(t,e){const a=(e||dmt).space;return o4e(t,a==="svg"?vu:y1)}function gmt(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=EW(t.children,n,e),N1(t,n),n}function fmt(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=EW(t.children,n,e),N1(t,n),n}function hmt(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return N1(t,e),e}function bmt(t){const e={nodeName:"#text",value:t.value,parentNode:null};return N1(t,e),e}function ymt(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return N1(t,e),e}function Cmt(t,e){const n=e;let a=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=vu);const r=[];let i;if(t.properties){for(i in t.properties)if(i!=="children"&&pmt.call(t.properties,i)){const A=wmt(a,i,t.properties[i]);A&&r.push(A)}}const o=a.space,s={nodeName:t.tagName,tagName:t.tagName,attrs:r,namespaceURI:nu[o],childNodes:[],parentNode:null};return s.childNodes=EW(t.children,s,a),N1(t,s),t.tagName==="template"&&t.content&&(s.content=fmt(t.content,a)),s}function wmt(t,e,n){const a=sv(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&a.boolean)return;Array.isArray(n)&&(n=a.commaSeparated?PK(n):qK(n));const r={name:a.attribute,value:n===!0?"":String(n)};if(a.space&&a.space!=="html"&&a.space!=="svg"){const i=r.name.indexOf(":");i<0?r.prefix="":(r.name=r.name.slice(i+1),r.prefix=a.attribute.slice(0,i)),r.namespace=nu[a.space]}return r}function EW(t,e,n){let a=-1;const r=[];if(t)for(;++a<t.length;){const i=o4e(t[a],n);i.parentNode=e,r.push(i)}return r}function N1(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const Emt=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),vr="�";var Ne;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(Ne||(Ne={}));const Ps={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function s4e(t){return t>=55296&&t<=57343}function Bmt(t){return t>=56320&&t<=57343}function kmt(t,e){return(t-55296)*1024+9216+e}function A4e(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function c4e(t){return t>=64976&&t<=65007||Emt.has(t)}var Bt;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Bt||(Bt={}));const vmt=65536;class Imt{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=vmt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:a,col:r,offset:i}=this,o=r+n,s=i+n;return{code:e,startLine:a,endLine:a,startCol:o,endCol:o,startOffset:s,endOffset:s}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Bmt(n))return this.pos++,this._addGap(),kmt(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Ne.EOF;return this._err(Bt.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let a=0;a<e.length;a++)if((this.html.charCodeAt(this.pos+a)|32)!==e.charCodeAt(a))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Ne.EOF;const a=this.html.charCodeAt(n);return a===Ne.CARRIAGE_RETURN?Ne.LINE_FEED:a}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Ne.EOF;let e=this.html.charCodeAt(this.pos);return e===Ne.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Ne.LINE_FEED):e===Ne.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,s4e(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Ne.LINE_FEED||e===Ne.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){A4e(e)?this._err(Bt.controlCharacterInInputStream):c4e(e)&&this._err(Bt.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var sa;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(sa||(sa={}));function l4e(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const Qmt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),_mt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function xmt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=_mt.get(t))!==null&&e!==void 0?e:t}var to;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(to||(to={}));const Dmt=32;var dm;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(dm||(dm={}));function Rj(t){return t>=to.ZERO&&t<=to.NINE}function Smt(t){return t>=to.UPPER_A&&t<=to.UPPER_F||t>=to.LOWER_A&&t<=to.LOWER_F}function Nmt(t){return t>=to.UPPER_A&&t<=to.UPPER_Z||t>=to.LOWER_A&&t<=to.LOWER_Z||Rj(t)}function Fmt(t){return t===to.EQUALS||Nmt(t)}var Wi;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Wi||(Wi={}));var vd;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(vd||(vd={}));class Tmt{constructor(e,n,a){this.decodeTree=e,this.emitCodePoint=n,this.errors=a,this.state=Wi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vd.Strict}startEntity(e){this.decodeMode=e,this.state=Wi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Wi.EntityStart:return e.charCodeAt(n)===to.NUM?(this.state=Wi.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Wi.NamedEntity,this.stateNamedEntity(e,n));case Wi.NumericStart:return this.stateNumericStart(e,n);case Wi.NumericDecimal:return this.stateNumericDecimal(e,n);case Wi.NumericHex:return this.stateNumericHex(e,n);case Wi.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Dmt)===to.LOWER_X?(this.state=Wi.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Wi.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,a,r){if(n!==a){const i=a-n;this.result=this.result*Math.pow(r,i)+Number.parseInt(e.substr(n,i),r),this.consumed+=i}}stateNumericHex(e,n){const a=n;for(;n<e.length;){const r=e.charCodeAt(n);if(Rj(r)||Smt(r))n+=1;else return this.addToNumericResult(e,a,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,a,n,16),-1}stateNumericDecimal(e,n){const a=n;for(;n<e.length;){const r=e.charCodeAt(n);if(Rj(r))n+=1;else return this.addToNumericResult(e,a,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,a,n,10),-1}emitNumericEntity(e,n){var a;if(this.consumed<=n)return(a=this.errors)===null||a===void 0||a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===to.SEMI)this.consumed+=1;else if(this.decodeMode===vd.Strict)return 0;return this.emitCodePoint(xmt(this.result),this.consumed),this.errors&&(e!==to.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:a}=this;let r=a[this.treeIndex],i=(r&dm.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const o=e.charCodeAt(n);if(this.treeIndex=Rmt(a,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===vd.Attribute&&(i===0||Fmt(o))?0:this.emitNotTerminatedNamedEntity();if(r=a[this.treeIndex],i=(r&dm.VALUE_LENGTH)>>14,i!==0){if(o===to.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==vd.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:a}=this,r=(a[n]&dm.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,a){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[e]&~dm.VALUE_LENGTH:r[e+1],a),n===3&&this.emitCodePoint(r[e+2],a),a}end(){var e;switch(this.state){case Wi.NamedEntity:return this.result!==0&&(this.decodeMode!==vd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Wi.NumericDecimal:return this.emitNumericEntity(0,2);case Wi.NumericHex:return this.emitNumericEntity(0,3);case Wi.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wi.EntityStart:return 0}}}function Rmt(t,e,n,a){const r=(e&dm.BRANCH_LENGTH)>>7,i=e&dm.JUMP_TABLE;if(r===0)return i!==0&&a===i?n:-1;if(i){const A=a-i;return A<0||A>=r?-1:t[n+A]-1}let o=n,s=o+r-1;for(;o<=s;){const A=o+s>>>1,l=t[A];if(l<a)o=A+1;else if(l>a)s=A-1;else return t[A+r]}return-1}var Ot;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(Ot||(Ot={}));var Uf;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Uf||(Uf={}));var Ac;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Ac||(Ac={}));var dt;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(dt||(dt={}));var V;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(V||(V={}));const Mmt=new Map([[dt.A,V.A],[dt.ADDRESS,V.ADDRESS],[dt.ANNOTATION_XML,V.ANNOTATION_XML],[dt.APPLET,V.APPLET],[dt.AREA,V.AREA],[dt.ARTICLE,V.ARTICLE],[dt.ASIDE,V.ASIDE],[dt.B,V.B],[dt.BASE,V.BASE],[dt.BASEFONT,V.BASEFONT],[dt.BGSOUND,V.BGSOUND],[dt.BIG,V.BIG],[dt.BLOCKQUOTE,V.BLOCKQUOTE],[dt.BODY,V.BODY],[dt.BR,V.BR],[dt.BUTTON,V.BUTTON],[dt.CAPTION,V.CAPTION],[dt.CENTER,V.CENTER],[dt.CODE,V.CODE],[dt.COL,V.COL],[dt.COLGROUP,V.COLGROUP],[dt.DD,V.DD],[dt.DESC,V.DESC],[dt.DETAILS,V.DETAILS],[dt.DIALOG,V.DIALOG],[dt.DIR,V.DIR],[dt.DIV,V.DIV],[dt.DL,V.DL],[dt.DT,V.DT],[dt.EM,V.EM],[dt.EMBED,V.EMBED],[dt.FIELDSET,V.FIELDSET],[dt.FIGCAPTION,V.FIGCAPTION],[dt.FIGURE,V.FIGURE],[dt.FONT,V.FONT],[dt.FOOTER,V.FOOTER],[dt.FOREIGN_OBJECT,V.FOREIGN_OBJECT],[dt.FORM,V.FORM],[dt.FRAME,V.FRAME],[dt.FRAMESET,V.FRAMESET],[dt.H1,V.H1],[dt.H2,V.H2],[dt.H3,V.H3],[dt.H4,V.H4],[dt.H5,V.H5],[dt.H6,V.H6],[dt.HEAD,V.HEAD],[dt.HEADER,V.HEADER],[dt.HGROUP,V.HGROUP],[dt.HR,V.HR],[dt.HTML,V.HTML],[dt.I,V.I],[dt.IMG,V.IMG],[dt.IMAGE,V.IMAGE],[dt.INPUT,V.INPUT],[dt.IFRAME,V.IFRAME],[dt.KEYGEN,V.KEYGEN],[dt.LABEL,V.LABEL],[dt.LI,V.LI],[dt.LINK,V.LINK],[dt.LISTING,V.LISTING],[dt.MAIN,V.MAIN],[dt.MALIGNMARK,V.MALIGNMARK],[dt.MARQUEE,V.MARQUEE],[dt.MATH,V.MATH],[dt.MENU,V.MENU],[dt.META,V.META],[dt.MGLYPH,V.MGLYPH],[dt.MI,V.MI],[dt.MO,V.MO],[dt.MN,V.MN],[dt.MS,V.MS],[dt.MTEXT,V.MTEXT],[dt.NAV,V.NAV],[dt.NOBR,V.NOBR],[dt.NOFRAMES,V.NOFRAMES],[dt.NOEMBED,V.NOEMBED],[dt.NOSCRIPT,V.NOSCRIPT],[dt.OBJECT,V.OBJECT],[dt.OL,V.OL],[dt.OPTGROUP,V.OPTGROUP],[dt.OPTION,V.OPTION],[dt.P,V.P],[dt.PARAM,V.PARAM],[dt.PLAINTEXT,V.PLAINTEXT],[dt.PRE,V.PRE],[dt.RB,V.RB],[dt.RP,V.RP],[dt.RT,V.RT],[dt.RTC,V.RTC],[dt.RUBY,V.RUBY],[dt.S,V.S],[dt.SCRIPT,V.SCRIPT],[dt.SEARCH,V.SEARCH],[dt.SECTION,V.SECTION],[dt.SELECT,V.SELECT],[dt.SOURCE,V.SOURCE],[dt.SMALL,V.SMALL],[dt.SPAN,V.SPAN],[dt.STRIKE,V.STRIKE],[dt.STRONG,V.STRONG],[dt.STYLE,V.STYLE],[dt.SUB,V.SUB],[dt.SUMMARY,V.SUMMARY],[dt.SUP,V.SUP],[dt.TABLE,V.TABLE],[dt.TBODY,V.TBODY],[dt.TEMPLATE,V.TEMPLATE],[dt.TEXTAREA,V.TEXTAREA],[dt.TFOOT,V.TFOOT],[dt.TD,V.TD],[dt.TH,V.TH],[dt.THEAD,V.THEAD],[dt.TITLE,V.TITLE],[dt.TR,V.TR],[dt.TRACK,V.TRACK],[dt.TT,V.TT],[dt.U,V.U],[dt.UL,V.UL],[dt.SVG,V.SVG],[dt.VAR,V.VAR],[dt.WBR,V.WBR],[dt.XMP,V.XMP]]);function F1(t){var e;return(e=Mmt.get(t))!==null&&e!==void 0?e:V.UNKNOWN}const Pt=V,Lmt={[Ot.HTML]:new Set([Pt.ADDRESS,Pt.APPLET,Pt.AREA,Pt.ARTICLE,Pt.ASIDE,Pt.BASE,Pt.BASEFONT,Pt.BGSOUND,Pt.BLOCKQUOTE,Pt.BODY,Pt.BR,Pt.BUTTON,Pt.CAPTION,Pt.CENTER,Pt.COL,Pt.COLGROUP,Pt.DD,Pt.DETAILS,Pt.DIR,Pt.DIV,Pt.DL,Pt.DT,Pt.EMBED,Pt.FIELDSET,Pt.FIGCAPTION,Pt.FIGURE,Pt.FOOTER,Pt.FORM,Pt.FRAME,Pt.FRAMESET,Pt.H1,Pt.H2,Pt.H3,Pt.H4,Pt.H5,Pt.H6,Pt.HEAD,Pt.HEADER,Pt.HGROUP,Pt.HR,Pt.HTML,Pt.IFRAME,Pt.IMG,Pt.INPUT,Pt.LI,Pt.LINK,Pt.LISTING,Pt.MAIN,Pt.MARQUEE,Pt.MENU,Pt.META,Pt.NAV,Pt.NOEMBED,Pt.NOFRAMES,Pt.NOSCRIPT,Pt.OBJECT,Pt.OL,Pt.P,Pt.PARAM,Pt.PLAINTEXT,Pt.PRE,Pt.SCRIPT,Pt.SECTION,Pt.SELECT,Pt.SOURCE,Pt.STYLE,Pt.SUMMARY,Pt.TABLE,Pt.TBODY,Pt.TD,Pt.TEMPLATE,Pt.TEXTAREA,Pt.TFOOT,Pt.TH,Pt.THEAD,Pt.TITLE,Pt.TR,Pt.TRACK,Pt.UL,Pt.WBR,Pt.XMP]),[Ot.MATHML]:new Set([Pt.MI,Pt.MO,Pt.MN,Pt.MS,Pt.MTEXT,Pt.ANNOTATION_XML]),[Ot.SVG]:new Set([Pt.TITLE,Pt.FOREIGN_OBJECT,Pt.DESC]),[Ot.XLINK]:new Set,[Ot.XML]:new Set,[Ot.XMLNS]:new Set},Mj=new Set([Pt.H1,Pt.H2,Pt.H3,Pt.H4,Pt.H5,Pt.H6]);dt.STYLE,dt.SCRIPT,dt.XMP,dt.IFRAME,dt.NOEMBED,dt.NOFRAMES,dt.PLAINTEXT;var Re;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Re||(Re={}));const ti={DATA:Re.DATA,RCDATA:Re.RCDATA,RAWTEXT:Re.RAWTEXT,SCRIPT_DATA:Re.SCRIPT_DATA,PLAINTEXT:Re.PLAINTEXT,CDATA_SECTION:Re.CDATA_SECTION};function Omt(t){return t>=Ne.DIGIT_0&&t<=Ne.DIGIT_9}function jw(t){return t>=Ne.LATIN_CAPITAL_A&&t<=Ne.LATIN_CAPITAL_Z}function Gmt(t){return t>=Ne.LATIN_SMALL_A&&t<=Ne.LATIN_SMALL_Z}function tm(t){return Gmt(t)||jw(t)}function ZAe(t){return tm(t)||Omt(t)}function u_(t){return t+32}function u4e(t){return t===Ne.SPACE||t===Ne.LINE_FEED||t===Ne.TABULATION||t===Ne.FORM_FEED}function WAe(t){return u4e(t)||t===Ne.SOLIDUS||t===Ne.GREATER_THAN_SIGN}function Pmt(t){return t===Ne.NULL?Bt.nullCharacterReference:t>1114111?Bt.characterReferenceOutsideUnicodeRange:s4e(t)?Bt.surrogateCharacterReference:c4e(t)?Bt.noncharacterCharacterReference:A4e(t)||t===Ne.CARRIAGE_RETURN?Bt.controlCharacterReference:null}class qmt{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Re.DATA,this.returnState=Re.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Imt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Tmt(Qmt,(a,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(a)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Bt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:a=>{this._err(Bt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+a)},validateNumericCharacterReference:a=>{const r=Pmt(a);r&&this._err(r,1)}}:void 0)}_err(e,n=0){var a,r;(r=(a=this.handler).onParseError)===null||r===void 0||r.call(a,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,a){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||a?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:sa.START_TAG,tagName:"",tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:sa.END_TAG,tagName:"",tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:sa.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:sa.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const a=this.currentToken;if(l4e(a,this.currentAttr.name)===null){if(a.attrs.push(this.currentAttr),a.location&&this.currentLocation){const r=(e=(n=a.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Bt.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=F1(e.tagName),e.type===sa.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(Bt.endTagWithAttributes),e.selfClosing&&this._err(Bt.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case sa.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case sa.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case sa.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:sa.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=u4e(e)?sa.WHITESPACE_CHARACTER:e===Ne.NULL?sa.NULL_CHARACTER:sa.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(sa.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Re.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vd.Attribute:vd.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Re.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Re.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Re.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Re.DATA:{this._stateData(e);break}case Re.RCDATA:{this._stateRcdata(e);break}case Re.RAWTEXT:{this._stateRawtext(e);break}case Re.SCRIPT_DATA:{this._stateScriptData(e);break}case Re.PLAINTEXT:{this._statePlaintext(e);break}case Re.TAG_OPEN:{this._stateTagOpen(e);break}case Re.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Re.TAG_NAME:{this._stateTagName(e);break}case Re.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Re.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Re.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Re.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Re.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Re.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Re.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Re.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Re.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Re.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Re.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Re.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Re.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Re.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Re.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Re.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Re.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Re.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Re.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Re.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Re.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Re.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Re.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Re.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Re.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Re.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Re.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Re.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Re.COMMENT_START:{this._stateCommentStart(e);break}case Re.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Re.COMMENT:{this._stateComment(e);break}case Re.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Re.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Re.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Re.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Re.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Re.COMMENT_END:{this._stateCommentEnd(e);break}case Re.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Re.DOCTYPE:{this._stateDoctype(e);break}case Re.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Re.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Re.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Re.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Re.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Re.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Re.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Re.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Re.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Re.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Re.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Re.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Re.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Re.CDATA_SECTION:{this._stateCdataSection(e);break}case Re.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Re.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Re.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Re.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Ne.LESS_THAN_SIGN:{this.state=Re.TAG_OPEN;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitCodePoint(e);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.LESS_THAN_SIGN:{this.state=Re.RCDATA_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Ne.LESS_THAN_SIGN:{this.state=Re.RAWTEXT_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(tm(e))this._createStartTagToken(),this.state=Re.TAG_NAME,this._stateTagName(e);else switch(e){case Ne.EXCLAMATION_MARK:{this.state=Re.MARKUP_DECLARATION_OPEN;break}case Ne.SOLIDUS:{this.state=Re.END_TAG_OPEN;break}case Ne.QUESTION_MARK:{this._err(Bt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Re.BOGUS_COMMENT,this._stateBogusComment(e);break}case Ne.EOF:{this._err(Bt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Bt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Re.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(tm(e))this._createEndTagToken(),this.state=Re.TAG_NAME,this._stateTagName(e);else switch(e){case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingEndTagName),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Bt.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Re.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_ATTRIBUTE_NAME;break}case Ne.SOLIDUS:{this.state=Re.SELF_CLOSING_START_TAG;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.tagName+=vr;break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(jw(e)?u_(e):e)}}_stateRcdataLessThanSign(e){e===Ne.SOLIDUS?this.state=Re.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=Re.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){tm(e)?(this.state=Re.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=Re.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Re.BEFORE_ATTRIBUTE_NAME,!1;case Ne.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Re.SELF_CLOSING_START_TAG,!1;case Ne.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Re.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===Ne.SOLIDUS?this.state=Re.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=Re.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){tm(e)?(this.state=Re.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=Re.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case Ne.SOLIDUS:{this.state=Re.SCRIPT_DATA_END_TAG_OPEN;break}case Ne.EXCLAMATION_MARK:{this.state=Re.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=Re.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){tm(e)?(this.state=Re.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===Ne.HYPHEN_MINUS?(this.state=Re.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===Ne.HYPHEN_MINUS?(this.state=Re.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=Re.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case Ne.HYPHEN_MINUS:{this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.SCRIPT_DATA,this._emitChars(">");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Ne.SOLIDUS?this.state=Re.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:tm(e)?(this._emitChars("<"),this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){tm(e)?(this.state=Re.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Ps.SCRIPT,!1)&&WAe(this.preprocessor.peek(Ps.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ps.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Re.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case Ne.HYPHEN_MINUS:{this._emitChars("-");break}case Ne.LESS_THAN_SIGN:{this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case Ne.GREATER_THAN_SIGN:{this.state=Re.SCRIPT_DATA,this._emitChars(">");break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(vr);break}case Ne.EOF:{this._err(Bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Ne.SOLIDUS?(this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ps.SCRIPT,!1)&&WAe(this.preprocessor.peek(Ps.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Ps.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Re.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Re.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.SOLIDUS:case Ne.GREATER_THAN_SIGN:case Ne.EOF:{this.state=Re.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case Ne.EQUALS_SIGN:{this._err(Bt.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=Re.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=Re.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:case Ne.SOLIDUS:case Ne.GREATER_THAN_SIGN:case Ne.EOF:{this._leaveAttrName(),this.state=Re.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case Ne.EQUALS_SIGN:{this._leaveAttrName(),this.state=Re.BEFORE_ATTRIBUTE_VALUE;break}case Ne.QUOTATION_MARK:case Ne.APOSTROPHE:case Ne.LESS_THAN_SIGN:{this._err(Bt.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.name+=vr;break}default:this.currentAttr.name+=String.fromCodePoint(jw(e)?u_(e):e)}}_stateAfterAttributeName(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.SOLIDUS:{this.state=Re.SELF_CLOSING_START_TAG;break}case Ne.EQUALS_SIGN:{this.state=Re.BEFORE_ATTRIBUTE_VALUE;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=Re.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.QUOTATION_MARK:{this.state=Re.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this.state=Re.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingAttributeValue),this.state=Re.DATA,this.emitCurrentTagToken();break}default:this.state=Re.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case Ne.QUOTATION_MARK:{this.state=Re.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.value+=vr;break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case Ne.APOSTROPHE:{this.state=Re.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.value+=vr;break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this._leaveAttrValue(),this.state=Re.BEFORE_ATTRIBUTE_NAME;break}case Ne.AMPERSAND:{this._startCharacterReference();break}case Ne.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this.currentAttr.value+=vr;break}case Ne.QUOTATION_MARK:case Ne.APOSTROPHE:case Ne.LESS_THAN_SIGN:case Ne.EQUALS_SIGN:case Ne.GRAVE_ACCENT:{this._err(Bt.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this._leaveAttrValue(),this.state=Re.BEFORE_ATTRIBUTE_NAME;break}case Ne.SOLIDUS:{this._leaveAttrValue(),this.state=Re.SELF_CLOSING_START_TAG;break}case Ne.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this._err(Bt.missingWhitespaceBetweenAttributes),this.state=Re.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case Ne.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=Re.DATA,this.emitCurrentTagToken();break}case Ne.EOF:{this._err(Bt.eofInTag),this._emitEOFToken();break}default:this._err(Bt.unexpectedSolidusInTag),this.state=Re.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.data+=vr;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Ps.DASH_DASH,!0)?(this._createCommentToken(Ps.DASH_DASH.length+1),this.state=Re.COMMENT_START):this._consumeSequenceIfMatch(Ps.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ps.DOCTYPE.length+1),this.state=Re.DOCTYPE):this._consumeSequenceIfMatch(Ps.CDATA_START,!0)?this.inForeignNode?this.state=Re.CDATA_SECTION:(this._err(Bt.cdataInHtmlContent),this._createCommentToken(Ps.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=Re.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Bt.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Re.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_START_DASH;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptClosingOfEmptyComment),this.state=Re.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_END;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptClosingOfEmptyComment),this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Re.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_END_DASH;break}case Ne.LESS_THAN_SIGN:{n.data+="<",this.state=Re.COMMENT_LESS_THAN_SIGN;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.data+=vr;break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case Ne.EXCLAMATION_MARK:{n.data+="!",this.state=Re.COMMENT_LESS_THAN_SIGN_BANG;break}case Ne.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===Ne.HYPHEN_MINUS?this.state=Re.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Re.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===Ne.HYPHEN_MINUS?this.state=Re.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Re.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==Ne.GREATER_THAN_SIGN&&e!==Ne.EOF&&this._err(Bt.nestedComment),this.state=Re.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{this.state=Re.COMMENT_END;break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EXCLAMATION_MARK:{this.state=Re.COMMENT_END_BANG;break}case Ne.HYPHEN_MINUS:{n.data+="-";break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=Re.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case Ne.HYPHEN_MINUS:{n.data+="--!",this.state=Re.COMMENT_END_DASH;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.incorrectlyClosedComment),this.state=Re.DATA,this.emitCurrentComment(n);break}case Ne.EOF:{this._err(Bt.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=Re.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_DOCTYPE_NAME;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case Ne.EOF:{this._err(Bt.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingWhitespaceBeforeDoctypeName),this.state=Re.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(jw(e))this._createDoctypeToken(String.fromCharCode(u_(e))),this.state=Re.DOCTYPE_NAME;else switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),this._createDoctypeToken(vr),this.state=Re.DOCTYPE_NAME;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Re.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.AFTER_DOCTYPE_NAME;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.name+=vr;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(jw(e)?u_(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ps.PUBLIC,!1)?this.state=Re.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ps.SYSTEM,!1)?this.state=Re.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Bt.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case Ne.QUOTATION_MARK:{this._err(Bt.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this._err(Bt.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.QUOTATION_MARK:{n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{n.publicId="",this.state=Re.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case Ne.QUOTATION_MARK:{this.state=Re.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.publicId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case Ne.APOSTROPHE:{this.state=Re.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.publicId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.QUOTATION_MARK:{this._err(Bt.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this._err(Bt.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.QUOTATION_MARK:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:{this.state=Re.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case Ne.QUOTATION_MARK:{this._err(Bt.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{this._err(Bt.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.QUOTATION_MARK:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case Ne.APOSTROPHE:{n.systemId="",this.state=Re.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.DATA,this.emitCurrentDoctype(n);break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case Ne.QUOTATION_MARK:{this.state=Re.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.systemId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case Ne.APOSTROPHE:{this.state=Re.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter),n.systemId+=vr;break}case Ne.GREATER_THAN_SIGN:{this._err(Bt.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case Ne.SPACE:case Ne.LINE_FEED:case Ne.TABULATION:case Ne.FORM_FEED:break;case Ne.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.EOF:{this._err(Bt.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Bt.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Re.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case Ne.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Re.DATA;break}case Ne.NULL:{this._err(Bt.unexpectedNullCharacter);break}case Ne.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case Ne.RIGHT_SQUARE_BRACKET:{this.state=Re.CDATA_SECTION_BRACKET;break}case Ne.EOF:{this._err(Bt.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===Ne.RIGHT_SQUARE_BRACKET?this.state=Re.CDATA_SECTION_END:(this._emitChars("]"),this.state=Re.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case Ne.GREATER_THAN_SIGN:{this.state=Re.DATA;break}case Ne.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=Re.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(Ne.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ZAe(this.preprocessor.peek(1))?Re.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){ZAe(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===Ne.SEMICOLON&&this._err(Bt.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const d4e=new Set([V.DD,V.DT,V.LI,V.OPTGROUP,V.OPTION,V.P,V.RB,V.RP,V.RT,V.RTC]),VAe=new Set([...d4e,V.CAPTION,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]),WD=new Set([V.APPLET,V.CAPTION,V.HTML,V.MARQUEE,V.OBJECT,V.TABLE,V.TD,V.TEMPLATE,V.TH]),Umt=new Set([...WD,V.OL,V.UL]),$mt=new Set([...WD,V.BUTTON]),JAe=new Set([V.ANNOTATION_XML,V.MI,V.MN,V.MO,V.MS,V.MTEXT]),XAe=new Set([V.DESC,V.FOREIGN_OBJECT,V.TITLE]),jmt=new Set([V.TR,V.TEMPLATE,V.HTML]),Hmt=new Set([V.TBODY,V.TFOOT,V.THEAD,V.TEMPLATE,V.HTML]),zmt=new Set([V.TABLE,V.TEMPLATE,V.HTML]),Ymt=new Set([V.TD,V.TH]);class Kmt{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,a){this.treeAdapter=n,this.handler=a,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=V.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===V.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ot.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const a=this._indexOf(e);this.items[a]=n,a===this.stackTop&&(this.current=n)}insertAfter(e,n,a){const r=this._indexOf(e)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,a),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ot.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const a=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(a,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Mj,Ot.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ymt,Ot.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let a=this.stackTop;a>=0;a--)if(e.has(this.tagIDs[a])&&this.treeAdapter.getNamespaceURI(this.items[a])===n)return a;return-1}clearBackTo(e,n){const a=this._indexOfTagNames(e,n);this.shortenToLength(a+1)}clearBackToTableContext(){this.clearBackTo(zmt,Ot.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Hmt,Ot.HTML)}clearBackToTableRowContext(){this.clearBackTo(jmt,Ot.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===V.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===V.HTML}hasInDynamicScope(e,n){for(let a=this.stackTop;a>=0;a--){const r=this.tagIDs[a];switch(this.treeAdapter.getNamespaceURI(this.items[a])){case Ot.HTML:{if(r===e)return!0;if(n.has(r))return!1;break}case Ot.SVG:{if(XAe.has(r))return!1;break}case Ot.MATHML:{if(JAe.has(r))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,WD)}hasInListItemScope(e){return this.hasInDynamicScope(e,Umt)}hasInButtonScope(e){return this.hasInDynamicScope(e,$mt)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Ot.HTML:{if(Mj.has(n))return!0;if(WD.has(n))return!1;break}case Ot.SVG:{if(XAe.has(n))return!1;break}case Ot.MATHML:{if(JAe.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ot.HTML)switch(this.tagIDs[n]){case e:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Ot.HTML)switch(this.tagIDs[e]){case V.TBODY:case V.THEAD:case V.TFOOT:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ot.HTML)switch(this.tagIDs[n]){case e:return!0;case V.OPTION:case V.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&d4e.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&VAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&VAe.has(this.currentTagId);)this.pop()}}const z9=3;var Wl;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Wl||(Wl={}));const ece={type:Wl.Marker};class Zmt{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const a=[],r=n.length,i=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let s=0;s<this.entries.length;s++){const A=this.entries[s];if(A.type===Wl.Marker)break;const{element:l}=A;if(this.treeAdapter.getTagName(l)===i&&this.treeAdapter.getNamespaceURI(l)===o){const u=this.treeAdapter.getAttrList(l);u.length===r&&a.push({idx:s,attrs:u})}}return a}_ensureNoahArkCondition(e){if(this.entries.length<z9)return;const n=this.treeAdapter.getAttrList(e),a=this._getNoahArkConditionCandidates(e,n);if(a.length<z9)return;const r=new Map(n.map(o=>[o.name,o.value]));let i=0;for(let o=0;o<a.length;o++){const s=a[o];s.attrs.every(A=>r.get(A.name)===A.value)&&(i+=1,i>=z9&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(ece)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Wl.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const a=this.entries.indexOf(this.bookmark);this.entries.splice(a,0,{type:Wl.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(ece);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(a=>a.type===Wl.Marker||this.treeAdapter.getTagName(a.element)===e);return n&&n.type===Wl.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Wl.Element&&n.element===e)}}const nm={createDocument(){return{nodeName:"#document",mode:Ac.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const a=t.childNodes.indexOf(n);t.childNodes.splice(a,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,a){const r=t.childNodes.find(i=>i.nodeName==="#documentType");if(r)r.name=e,r.publicId=n,r.systemId=a;else{const i={nodeName:"#documentType",name:e,publicId:n,systemId:a,parentNode:null};nm.appendChild(t,i)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(nm.isTextNode(n)){n.value+=e;return}}nm.appendChild(t,nm.createTextNode(e))},insertTextBefore(t,e,n){const a=t.childNodes[t.childNodes.indexOf(n)-1];a&&nm.isTextNode(a)?a.value+=e:nm.insertBefore(t,nm.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(a=>a.name));for(let a=0;a<e.length;a++)n.has(e[a].name)||t.attrs.push(e[a])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},p4e="html",Wmt="about:legacy-compat",Vmt="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",m4e=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Jmt=[...m4e,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Xmt=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),g4e=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],egt=[...g4e,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function tce(t,e){return e.some(n=>t.startsWith(n))}function tgt(t){return t.name===p4e&&t.publicId===null&&(t.systemId===null||t.systemId===Wmt)}function ngt(t){if(t.name!==p4e)return Ac.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===Vmt)return Ac.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),Xmt.has(n))return Ac.QUIRKS;let a=e===null?Jmt:m4e;if(tce(n,a))return Ac.QUIRKS;if(a=e===null?g4e:egt,tce(n,a))return Ac.LIMITED_QUIRKS}return Ac.NO_QUIRKS}const nce={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},agt="definitionurl",rgt="definitionURL",igt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),ogt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ot.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ot.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ot.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ot.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ot.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ot.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ot.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ot.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ot.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ot.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ot.XMLNS}]]),sgt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),Agt=new Set([V.B,V.BIG,V.BLOCKQUOTE,V.BODY,V.BR,V.CENTER,V.CODE,V.DD,V.DIV,V.DL,V.DT,V.EM,V.EMBED,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,V.HEAD,V.HR,V.I,V.IMG,V.LI,V.LISTING,V.MENU,V.META,V.NOBR,V.OL,V.P,V.PRE,V.RUBY,V.S,V.SMALL,V.SPAN,V.STRONG,V.STRIKE,V.SUB,V.SUP,V.TABLE,V.TT,V.U,V.UL,V.VAR]);function cgt(t){const e=t.tagID;return e===V.FONT&&t.attrs.some(({name:a})=>a===Uf.COLOR||a===Uf.SIZE||a===Uf.FACE)||Agt.has(e)}function f4e(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===agt){t.attrs[e].name=rgt;break}}function h4e(t){for(let e=0;e<t.attrs.length;e++){const n=igt.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function BW(t){for(let e=0;e<t.attrs.length;e++){const n=ogt.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function lgt(t){const e=sgt.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=F1(t.tagName))}function ugt(t,e){return e===Ot.MATHML&&(t===V.MI||t===V.MO||t===V.MN||t===V.MS||t===V.MTEXT)}function dgt(t,e,n){if(e===Ot.MATHML&&t===V.ANNOTATION_XML){for(let a=0;a<n.length;a++)if(n[a].name===Uf.ENCODING){const r=n[a].value.toLowerCase();return r===nce.TEXT_HTML||r===nce.APPLICATION_XML}}return e===Ot.SVG&&(t===V.FOREIGN_OBJECT||t===V.DESC||t===V.TITLE)}function pgt(t,e,n,a){return(!a||a===Ot.HTML)&&dgt(t,e,n)||(!a||a===Ot.MATHML)&&ugt(t,e)}const mgt="hidden",ggt=8,fgt=3;var je;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(je||(je={}));const hgt={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},b4e=new Set([V.TABLE,V.TBODY,V.TFOOT,V.THEAD,V.TR]),ace={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:nm,onParseError:null};let rce=class{constructor(e,n,a=null,r=null){this.fragmentContext=a,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=je.INITIAL,this.originalInsertionMode=je.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...ace,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new qmt(this.options,this),this.activeFormattingElements=new Zmt(this.treeAdapter),this.fragmentContextID=a?F1(this.treeAdapter.getTagName(a)):V.UNKNOWN,this._setContextModes(a??this.document,this.fragmentContextID),this.openElements=new Kmt(this.document,this.treeAdapter,this)}static parse(e,n){const a=new this(n);return a.tokenizer.write(e,!0),a.document}static getFragmentParser(e,n){const a={...ace,...n};e??(e=a.treeAdapter.createElement(dt.TEMPLATE,Ot.HTML,[]));const r=a.treeAdapter.createElement("documentmock",Ot.HTML,[]),i=new this(a,r,e);return i.fragmentContextID===V.TEMPLATE&&i.tmplInsertionModeStack.unshift(je.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,a){var r;if(!this.onParseError)return;const i=(r=e.location)!==null&&r!==void 0?r:hgt,o={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:a?i.startLine:i.endLine,endCol:a?i.startCol:i.endCol,endOffset:a?i.startOffset:i.endOffset};this.onParseError(o)}onItemPush(e,n,a){var r,i;(i=(r=this.treeAdapter).onItemPush)===null||i===void 0||i.call(r,e),a&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var a,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(a=this.treeAdapter).onItemPop)===null||r===void 0||r.call(a,e,this.openElements.current),n){let i,o;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,o=this.fragmentContextID):{current:i,currentTagId:o}=this.openElements,this._setContextModes(i,o)}}_setContextModes(e,n){const a=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Ot.HTML;this.currentNotInHTML=!a,this.tokenizer.inForeignNode=!a&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,Ot.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=je.TEXT}switchToPlaintextParsing(){this.insertionMode=je.TEXT,this.originalInsertionMode=je.IN_BODY,this.tokenizer.state=ti.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===dt.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ot.HTML))switch(this.fragmentContextID){case V.TITLE:case V.TEXTAREA:{this.tokenizer.state=ti.RCDATA;break}case V.STYLE:case V.XMP:case V.IFRAME:case V.NOEMBED:case V.NOFRAMES:case V.NOSCRIPT:{this.tokenizer.state=ti.RAWTEXT;break}case V.SCRIPT:{this.tokenizer.state=ti.SCRIPT_DATA;break}case V.PLAINTEXT:{this.tokenizer.state=ti.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",a=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,a,r),e.location){const o=this.treeAdapter.getChildNodes(this.document).find(s=>this.treeAdapter.isDocumentTypeNode(s));o&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const a=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,a)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const a=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(a??this.document,e)}}_appendElement(e,n){const a=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(a,e.location)}_insertElement(e,n){const a=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(a,e.location),this.openElements.push(a,e.tagID)}_insertFakeElement(e,n){const a=this.treeAdapter.createElement(e,Ot.HTML,[]);this._attachElementToTree(a,null),this.openElements.push(a,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,Ot.HTML,e.attrs),a=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,a),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(dt.HTML,Ot.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,V.HTML)}_appendCommentNode(e,n){const a=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,a),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_insertCharacters(e){let n,a;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:a}=this._findFosterParentingLocation(),a?this.treeAdapter.insertTextBefore(n,e.chars,a):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(n),i=a?r.lastIndexOf(a):r.length,o=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:A,endCol:l,endOffset:u}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:A,endCol:l,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}_adoptNodes(e,n){for(let a=this.treeAdapter.getFirstChild(e);a;a=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(a),this.treeAdapter.appendChild(n,a)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const a=n.location,r=this.treeAdapter.getTagName(e),i=n.type===sa.END_TAG&&r===n.tagName?{endTag:{...a},endLine:a.endLine,endCol:a.endCol,endOffset:a.endOffset}:{endLine:a.startLine,endCol:a.startCol,endOffset:a.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,a;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,a=this.fragmentContextID):{current:n,currentTagId:a}=this.openElements,e.tagID===V.SVG&&this.treeAdapter.getTagName(n)===dt.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ot.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===V.MGLYPH||e.tagID===V.MALIGNMARK)&&a!==void 0&&!this._isIntegrationPoint(a,n,Ot.HTML)}_processToken(e){switch(e.type){case sa.CHARACTER:{this.onCharacter(e);break}case sa.NULL_CHARACTER:{this.onNullCharacter(e);break}case sa.COMMENT:{this.onComment(e);break}case sa.DOCTYPE:{this.onDoctype(e);break}case sa.START_TAG:{this._processStartTag(e);break}case sa.END_TAG:{this.onEndTag(e);break}case sa.EOF:{this.onEof(e);break}case sa.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,a){const r=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return pgt(e,r,i,a)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Wl.Marker||this.openElements.contains(r.element)),a=n===-1?e-1:n-1;for(let r=a;r>=0;r--){const i=this.activeFormattingElements.entries[r];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=je.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(V.P),this.openElements.popUntilTagNamePopped(V.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case V.TR:{this.insertionMode=je.IN_ROW;return}case V.TBODY:case V.THEAD:case V.TFOOT:{this.insertionMode=je.IN_TABLE_BODY;return}case V.CAPTION:{this.insertionMode=je.IN_CAPTION;return}case V.COLGROUP:{this.insertionMode=je.IN_COLUMN_GROUP;return}case V.TABLE:{this.insertionMode=je.IN_TABLE;return}case V.BODY:{this.insertionMode=je.IN_BODY;return}case V.FRAMESET:{this.insertionMode=je.IN_FRAMESET;return}case V.SELECT:{this._resetInsertionModeForSelect(e);return}case V.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case V.HTML:{this.insertionMode=this.headElement?je.AFTER_HEAD:je.BEFORE_HEAD;return}case V.TD:case V.TH:{if(e>0){this.insertionMode=je.IN_CELL;return}break}case V.HEAD:{if(e>0){this.insertionMode=je.IN_HEAD;return}break}}this.insertionMode=je.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const a=this.openElements.tagIDs[n];if(a===V.TEMPLATE)break;if(a===V.TABLE){this.insertionMode=je.IN_SELECT_IN_TABLE;return}}this.insertionMode=je.IN_SELECT}_isElementCausesFosterParenting(e){return b4e.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case V.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ot.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case V.TABLE:{const a=this.treeAdapter.getParentNode(n);return a?{parent:a,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const a=this.treeAdapter.getNamespaceURI(e);return Lmt[a].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Yft(this,e);return}switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{oB(this,e);break}case je.BEFORE_HEAD:{sB(this,e);break}case je.IN_HEAD:{AB(this,e);break}case je.IN_HEAD_NO_SCRIPT:{cB(this,e);break}case je.AFTER_HEAD:{lB(this,e);break}case je.IN_BODY:case je.IN_CAPTION:case je.IN_CELL:case je.IN_TEMPLATE:{C4e(this,e);break}case je.TEXT:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case je.IN_TABLE:case je.IN_TABLE_BODY:case je.IN_ROW:{Y9(this,e);break}case je.IN_TABLE_TEXT:{I4e(this,e);break}case je.IN_COLUMN_GROUP:{VD(this,e);break}case je.AFTER_BODY:{JD(this,e);break}case je.AFTER_AFTER_BODY:{Ox(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){zft(this,e);return}switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{oB(this,e);break}case je.BEFORE_HEAD:{sB(this,e);break}case je.IN_HEAD:{AB(this,e);break}case je.IN_HEAD_NO_SCRIPT:{cB(this,e);break}case je.AFTER_HEAD:{lB(this,e);break}case je.TEXT:{this._insertCharacters(e);break}case je.IN_TABLE:case je.IN_TABLE_BODY:case je.IN_ROW:{Y9(this,e);break}case je.IN_COLUMN_GROUP:{VD(this,e);break}case je.AFTER_BODY:{JD(this,e);break}case je.AFTER_AFTER_BODY:{Ox(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Lj(this,e);return}switch(this.insertionMode){case je.INITIAL:case je.BEFORE_HTML:case je.BEFORE_HEAD:case je.IN_HEAD:case je.IN_HEAD_NO_SCRIPT:case je.AFTER_HEAD:case je.IN_BODY:case je.IN_TABLE:case je.IN_CAPTION:case je.IN_COLUMN_GROUP:case je.IN_TABLE_BODY:case je.IN_ROW:case je.IN_CELL:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:case je.IN_TEMPLATE:case je.IN_FRAMESET:case je.AFTER_FRAMESET:{Lj(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.AFTER_BODY:{kgt(this,e);break}case je.AFTER_AFTER_BODY:case je.AFTER_AFTER_FRAMESET:{vgt(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case je.INITIAL:{Igt(this,e);break}case je.BEFORE_HEAD:case je.IN_HEAD:case je.IN_HEAD_NO_SCRIPT:case je.AFTER_HEAD:{this._err(e,Bt.misplacedDoctype);break}case je.IN_TABLE_TEXT:{aw(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,Bt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Kft(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{Qgt(this,e);break}case je.BEFORE_HEAD:{xgt(this,e);break}case je.IN_HEAD:{El(this,e);break}case je.IN_HEAD_NO_SCRIPT:{Ngt(this,e);break}case je.AFTER_HEAD:{Tgt(this,e);break}case je.IN_BODY:{es(this,e);break}case je.IN_TABLE:{D2(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.IN_CAPTION:{Dft(this,e);break}case je.IN_COLUMN_GROUP:{IW(this,e);break}case je.IN_TABLE_BODY:{XS(this,e);break}case je.IN_ROW:{e6(this,e);break}case je.IN_CELL:{Fft(this,e);break}case je.IN_SELECT:{x4e(this,e);break}case je.IN_SELECT_IN_TABLE:{Rft(this,e);break}case je.IN_TEMPLATE:{Lft(this,e);break}case je.AFTER_BODY:{Gft(this,e);break}case je.IN_FRAMESET:{Pft(this,e);break}case je.AFTER_FRAMESET:{Uft(this,e);break}case je.AFTER_AFTER_BODY:{jft(this,e);break}case je.AFTER_AFTER_FRAMESET:{Hft(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Zft(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{_gt(this,e);break}case je.BEFORE_HEAD:{Dgt(this,e);break}case je.IN_HEAD:{Sgt(this,e);break}case je.IN_HEAD_NO_SCRIPT:{Fgt(this,e);break}case je.AFTER_HEAD:{Rgt(this,e);break}case je.IN_BODY:{JS(this,e);break}case je.TEXT:{Cft(this,e);break}case je.IN_TABLE:{WB(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.IN_CAPTION:{Sft(this,e);break}case je.IN_COLUMN_GROUP:{Nft(this,e);break}case je.IN_TABLE_BODY:{Oj(this,e);break}case je.IN_ROW:{_4e(this,e);break}case je.IN_CELL:{Tft(this,e);break}case je.IN_SELECT:{D4e(this,e);break}case je.IN_SELECT_IN_TABLE:{Mft(this,e);break}case je.IN_TEMPLATE:{Oft(this,e);break}case je.AFTER_BODY:{N4e(this,e);break}case je.IN_FRAMESET:{qft(this,e);break}case je.AFTER_FRAMESET:{$ft(this,e);break}case je.AFTER_AFTER_BODY:{Ox(this,e);break}}}onEof(e){switch(this.insertionMode){case je.INITIAL:{nw(this,e);break}case je.BEFORE_HTML:{oB(this,e);break}case je.BEFORE_HEAD:{sB(this,e);break}case je.IN_HEAD:{AB(this,e);break}case je.IN_HEAD_NO_SCRIPT:{cB(this,e);break}case je.AFTER_HEAD:{lB(this,e);break}case je.IN_BODY:case je.IN_TABLE:case je.IN_CAPTION:case je.IN_COLUMN_GROUP:case je.IN_TABLE_BODY:case je.IN_ROW:case je.IN_CELL:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:{k4e(this,e);break}case je.TEXT:{wft(this,e);break}case je.IN_TABLE_TEXT:{aw(this,e);break}case je.IN_TEMPLATE:{S4e(this,e);break}case je.AFTER_BODY:case je.IN_FRAMESET:case je.AFTER_FRAMESET:case je.AFTER_AFTER_BODY:case je.AFTER_AFTER_FRAMESET:{vW(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Ne.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case je.IN_HEAD:case je.IN_HEAD_NO_SCRIPT:case je.AFTER_HEAD:case je.TEXT:case je.IN_COLUMN_GROUP:case je.IN_SELECT:case je.IN_SELECT_IN_TABLE:case je.IN_FRAMESET:case je.AFTER_FRAMESET:{this._insertCharacters(e);break}case je.IN_BODY:case je.IN_CAPTION:case je.IN_CELL:case je.IN_TEMPLATE:case je.AFTER_BODY:case je.AFTER_AFTER_BODY:case je.AFTER_AFTER_FRAMESET:{y4e(this,e);break}case je.IN_TABLE:case je.IN_TABLE_BODY:case je.IN_ROW:{Y9(this,e);break}case je.IN_TABLE_TEXT:{v4e(this,e);break}}}};function bgt(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):B4e(t,e),n}function ygt(t,e){let n=null,a=t.openElements.stackTop;for(;a>=0;a--){const r=t.openElements.items[a];if(r===e.element)break;t._isSpecialElement(r,t.openElements.tagIDs[a])&&(n=r)}return n||(t.openElements.shortenToLength(Math.max(a,0)),t.activeFormattingElements.removeEntry(e)),n}function Cgt(t,e,n){let a=e,r=t.openElements.getCommonAncestor(e);for(let i=0,o=r;o!==n;i++,o=r){r=t.openElements.getCommonAncestor(o);const s=t.activeFormattingElements.getElementEntry(o),A=s&&i>=fgt;!s||A?(A&&t.activeFormattingElements.removeEntry(s),t.openElements.remove(o)):(o=wgt(t,s),a===e&&(t.activeFormattingElements.bookmark=s),t.treeAdapter.detachNode(a),t.treeAdapter.appendChild(o,a),a=o)}return a}function wgt(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),a=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,a),e.element=a,a}function Egt(t,e,n){const a=t.treeAdapter.getTagName(e),r=F1(a);if(t._isElementCausesFosterParenting(r))t._fosterParentElement(n);else{const i=t.treeAdapter.getNamespaceURI(e);r===V.TEMPLATE&&i===Ot.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function Bgt(t,e,n){const a=t.treeAdapter.getNamespaceURI(n.element),{token:r}=n,i=t.treeAdapter.createElement(r.tagName,a,r.attrs);t._adoptNodes(e,i),t.treeAdapter.appendChild(e,i),t.activeFormattingElements.insertElementAfterBookmark(i,r),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,i,r.tagID)}function kW(t,e){for(let n=0;n<ggt;n++){const a=bgt(t,e);if(!a)break;const r=ygt(t,a);if(!r)break;t.activeFormattingElements.bookmark=a;const i=Cgt(t,r,a.element),o=t.openElements.getCommonAncestor(a.element);t.treeAdapter.detachNode(i),o&&Egt(t,o,i),Bgt(t,r,a)}}function Lj(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function kgt(t,e){t._appendCommentNode(e,t.openElements.items[0])}function vgt(t,e){t._appendCommentNode(e,t.document)}function vW(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let a=t.openElements.stackTop;a>=n;a--)t._setEndLocation(t.openElements.items[a],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const a=t.openElements.items[0],r=t.treeAdapter.getNodeSourceCodeLocation(a);if(r&&!r.endTag&&(t._setEndLocation(a,e),t.openElements.stackTop>=1)){const i=t.openElements.items[1],o=t.treeAdapter.getNodeSourceCodeLocation(i);o&&!o.endTag&&t._setEndLocation(i,e)}}}}function Igt(t,e){t._setDocumentType(e);const n=e.forceQuirks?Ac.QUIRKS:ngt(e);tgt(e)||t._err(e,Bt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=je.BEFORE_HTML}function nw(t,e){t._err(e,Bt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Ac.QUIRKS),t.insertionMode=je.BEFORE_HTML,t._processToken(e)}function Qgt(t,e){e.tagID===V.HTML?(t._insertElement(e,Ot.HTML),t.insertionMode=je.BEFORE_HEAD):oB(t,e)}function _gt(t,e){const n=e.tagID;(n===V.HTML||n===V.HEAD||n===V.BODY||n===V.BR)&&oB(t,e)}function oB(t,e){t._insertFakeRootElement(),t.insertionMode=je.BEFORE_HEAD,t._processToken(e)}function xgt(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.HEAD:{t._insertElement(e,Ot.HTML),t.headElement=t.openElements.current,t.insertionMode=je.IN_HEAD;break}default:sB(t,e)}}function Dgt(t,e){const n=e.tagID;n===V.HEAD||n===V.BODY||n===V.HTML||n===V.BR?sB(t,e):t._err(e,Bt.endTagWithoutMatchingOpenElement)}function sB(t,e){t._insertFakeElement(dt.HEAD,V.HEAD),t.headElement=t.openElements.current,t.insertionMode=je.IN_HEAD,t._processToken(e)}function El(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:{t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.TITLE:{t._switchToTextParsing(e,ti.RCDATA);break}case V.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,ti.RAWTEXT):(t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_HEAD_NO_SCRIPT);break}case V.NOFRAMES:case V.STYLE:{t._switchToTextParsing(e,ti.RAWTEXT);break}case V.SCRIPT:{t._switchToTextParsing(e,ti.SCRIPT_DATA);break}case V.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=je.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(je.IN_TEMPLATE);break}case V.HEAD:{t._err(e,Bt.misplacedStartTagForHeadElement);break}default:AB(t,e)}}function Sgt(t,e){switch(e.tagID){case V.HEAD:{t.openElements.pop(),t.insertionMode=je.AFTER_HEAD;break}case V.BODY:case V.BR:case V.HTML:{AB(t,e);break}case V.TEMPLATE:{R0(t,e);break}default:t._err(e,Bt.endTagWithoutMatchingOpenElement)}}function R0(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==V.TEMPLATE&&t._err(e,Bt.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(V.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,Bt.endTagWithoutMatchingOpenElement)}function AB(t,e){t.openElements.pop(),t.insertionMode=je.AFTER_HEAD,t._processToken(e)}function Ngt(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.BASEFONT:case V.BGSOUND:case V.HEAD:case V.LINK:case V.META:case V.NOFRAMES:case V.STYLE:{El(t,e);break}case V.NOSCRIPT:{t._err(e,Bt.nestedNoscriptInHead);break}default:cB(t,e)}}function Fgt(t,e){switch(e.tagID){case V.NOSCRIPT:{t.openElements.pop(),t.insertionMode=je.IN_HEAD;break}case V.BR:{cB(t,e);break}default:t._err(e,Bt.endTagWithoutMatchingOpenElement)}}function cB(t,e){const n=e.type===sa.EOF?Bt.openElementsLeftAfterEof:Bt.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=je.IN_HEAD,t._processToken(e)}function Tgt(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.BODY:{t._insertElement(e,Ot.HTML),t.framesetOk=!1,t.insertionMode=je.IN_BODY;break}case V.FRAMESET:{t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_FRAMESET;break}case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:{t._err(e,Bt.abandonedHeadElementChild),t.openElements.push(t.headElement,V.HEAD),El(t,e),t.openElements.remove(t.headElement);break}case V.HEAD:{t._err(e,Bt.misplacedStartTagForHeadElement);break}default:lB(t,e)}}function Rgt(t,e){switch(e.tagID){case V.BODY:case V.HTML:case V.BR:{lB(t,e);break}case V.TEMPLATE:{R0(t,e);break}default:t._err(e,Bt.endTagWithoutMatchingOpenElement)}}function lB(t,e){t._insertFakeElement(dt.BODY,V.BODY),t.insertionMode=je.IN_BODY,VS(t,e)}function VS(t,e){switch(e.type){case sa.CHARACTER:{C4e(t,e);break}case sa.WHITESPACE_CHARACTER:{y4e(t,e);break}case sa.COMMENT:{Lj(t,e);break}case sa.START_TAG:{es(t,e);break}case sa.END_TAG:{JS(t,e);break}case sa.EOF:{k4e(t,e);break}}}function y4e(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function C4e(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function Mgt(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function Lgt(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function Ogt(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_FRAMESET)}function Ggt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML)}function Pgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Mj.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ot.HTML)}function qgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function Ugt(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),n||(t.formElement=t.openElements.current))}function $gt(t,e){t.framesetOk=!1;const n=e.tagID;for(let a=t.openElements.stackTop;a>=0;a--){const r=t.openElements.tagIDs[a];if(n===V.LI&&r===V.LI||(n===V.DD||n===V.DT)&&(r===V.DD||r===V.DT)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r);break}if(r!==V.ADDRESS&&r!==V.DIV&&r!==V.P&&t._isSpecialElement(t.openElements.items[a],r))break}t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML)}function jgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),t.tokenizer.state=ti.PLAINTEXT}function Hgt(t,e){t.openElements.hasInScope(V.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(V.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.framesetOk=!1}function zgt(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(dt.A);n&&(kW(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Ygt(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Kgt(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(V.NOBR)&&(kW(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ot.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Zgt(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function Wgt(t,e){t.treeAdapter.getDocumentMode(t.document)!==Ac.QUIRKS&&t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._insertElement(e,Ot.HTML),t.framesetOk=!1,t.insertionMode=je.IN_TABLE}function w4e(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ot.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function E4e(t){const e=l4e(t,Uf.TYPE);return e!=null&&e.toLowerCase()===mgt}function Vgt(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ot.HTML),E4e(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function Jgt(t,e){t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0}function Xgt(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._appendElement(e,Ot.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function eft(t,e){e.tagName=dt.IMG,e.tagID=V.IMG,w4e(t,e)}function tft(t,e){t._insertElement(e,Ot.HTML),t.skipNextNewLine=!0,t.tokenizer.state=ti.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=je.TEXT}function nft(t,e){t.openElements.hasInButtonScope(V.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,ti.RAWTEXT)}function aft(t,e){t.framesetOk=!1,t._switchToTextParsing(e,ti.RAWTEXT)}function ice(t,e){t._switchToTextParsing(e,ti.RAWTEXT)}function rft(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===je.IN_TABLE||t.insertionMode===je.IN_CAPTION||t.insertionMode===je.IN_TABLE_BODY||t.insertionMode===je.IN_ROW||t.insertionMode===je.IN_CELL?je.IN_SELECT_IN_TABLE:je.IN_SELECT}function ift(t,e){t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML)}function oft(t,e){t.openElements.hasInScope(V.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ot.HTML)}function sft(t,e){t.openElements.hasInScope(V.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(V.RTC),t._insertElement(e,Ot.HTML)}function Aft(t,e){t._reconstructActiveFormattingElements(),f4e(e),BW(e),e.selfClosing?t._appendElement(e,Ot.MATHML):t._insertElement(e,Ot.MATHML),e.ackSelfClosing=!0}function cft(t,e){t._reconstructActiveFormattingElements(),h4e(e),BW(e),e.selfClosing?t._appendElement(e,Ot.SVG):t._insertElement(e,Ot.SVG),e.ackSelfClosing=!0}function oce(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ot.HTML)}function es(t,e){switch(e.tagID){case V.I:case V.S:case V.B:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.SMALL:case V.STRIKE:case V.STRONG:{Ygt(t,e);break}case V.A:{zgt(t,e);break}case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:{Pgt(t,e);break}case V.P:case V.DL:case V.OL:case V.UL:case V.DIV:case V.DIR:case V.NAV:case V.MAIN:case V.MENU:case V.ASIDE:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.DETAILS:case V.ADDRESS:case V.ARTICLE:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:{Ggt(t,e);break}case V.LI:case V.DD:case V.DT:{$gt(t,e);break}case V.BR:case V.IMG:case V.WBR:case V.AREA:case V.EMBED:case V.KEYGEN:{w4e(t,e);break}case V.HR:{Xgt(t,e);break}case V.RB:case V.RTC:{oft(t,e);break}case V.RT:case V.RP:{sft(t,e);break}case V.PRE:case V.LISTING:{qgt(t,e);break}case V.XMP:{nft(t,e);break}case V.SVG:{cft(t,e);break}case V.HTML:{Mgt(t,e);break}case V.BASE:case V.LINK:case V.META:case V.STYLE:case V.TITLE:case V.SCRIPT:case V.BGSOUND:case V.BASEFONT:case V.TEMPLATE:{El(t,e);break}case V.BODY:{Lgt(t,e);break}case V.FORM:{Ugt(t,e);break}case V.NOBR:{Kgt(t,e);break}case V.MATH:{Aft(t,e);break}case V.TABLE:{Wgt(t,e);break}case V.INPUT:{Vgt(t,e);break}case V.PARAM:case V.TRACK:case V.SOURCE:{Jgt(t,e);break}case V.IMAGE:{eft(t,e);break}case V.BUTTON:{Hgt(t,e);break}case V.APPLET:case V.OBJECT:case V.MARQUEE:{Zgt(t,e);break}case V.IFRAME:{aft(t,e);break}case V.SELECT:{rft(t,e);break}case V.OPTION:case V.OPTGROUP:{ift(t,e);break}case V.NOEMBED:case V.NOFRAMES:{ice(t,e);break}case V.FRAMESET:{Ogt(t,e);break}case V.TEXTAREA:{tft(t,e);break}case V.NOSCRIPT:{t.options.scriptingEnabled?ice(t,e):oce(t,e);break}case V.PLAINTEXT:{jgt(t,e);break}case V.COL:case V.TH:case V.TD:case V.TR:case V.HEAD:case V.FRAME:case V.TBODY:case V.TFOOT:case V.THEAD:case V.CAPTION:case V.COLGROUP:break;default:oce(t,e)}}function lft(t,e){if(t.openElements.hasInScope(V.BODY)&&(t.insertionMode=je.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function uft(t,e){t.openElements.hasInScope(V.BODY)&&(t.insertionMode=je.AFTER_BODY,N4e(t,e))}function dft(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function pft(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(V.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(V.FORM):n&&t.openElements.remove(n))}function mft(t){t.openElements.hasInButtonScope(V.P)||t._insertFakeElement(dt.P,V.P),t._closePElement()}function gft(t){t.openElements.hasInListItemScope(V.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(V.LI),t.openElements.popUntilTagNamePopped(V.LI))}function fft(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function hft(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function bft(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function yft(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(dt.BR,V.BR),t.openElements.pop(),t.framesetOk=!1}function B4e(t,e){const n=e.tagName,a=e.tagID;for(let r=t.openElements.stackTop;r>0;r--){const i=t.openElements.items[r],o=t.openElements.tagIDs[r];if(a===o&&(a!==V.UNKNOWN||t.treeAdapter.getTagName(i)===n)){t.openElements.generateImpliedEndTagsWithExclusion(a),t.openElements.stackTop>=r&&t.openElements.shortenToLength(r);break}if(t._isSpecialElement(i,o))break}}function JS(t,e){switch(e.tagID){case V.A:case V.B:case V.I:case V.S:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.NOBR:case V.SMALL:case V.STRIKE:case V.STRONG:{kW(t,e);break}case V.P:{mft(t);break}case V.DL:case V.UL:case V.OL:case V.DIR:case V.DIV:case V.NAV:case V.PRE:case V.MAIN:case V.MENU:case V.ASIDE:case V.BUTTON:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.ADDRESS:case V.ARTICLE:case V.DETAILS:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.LISTING:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:{dft(t,e);break}case V.LI:{gft(t);break}case V.DD:case V.DT:{fft(t,e);break}case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:{hft(t);break}case V.BR:{yft(t);break}case V.BODY:{lft(t,e);break}case V.HTML:{uft(t,e);break}case V.FORM:{pft(t);break}case V.APPLET:case V.OBJECT:case V.MARQUEE:{bft(t,e);break}case V.TEMPLATE:{R0(t,e);break}default:B4e(t,e)}}function k4e(t,e){t.tmplInsertionModeStack.length>0?S4e(t,e):vW(t,e)}function Cft(t,e){var n;e.tagID===V.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function wft(t,e){t._err(e,Bt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Y9(t,e){if(t.openElements.currentTagId!==void 0&&b4e.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=je.IN_TABLE_TEXT,e.type){case sa.CHARACTER:{I4e(t,e);break}case sa.WHITESPACE_CHARACTER:{v4e(t,e);break}}else Ev(t,e)}function Eft(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_CAPTION}function Bft(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_COLUMN_GROUP}function kft(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(dt.COLGROUP,V.COLGROUP),t.insertionMode=je.IN_COLUMN_GROUP,IW(t,e)}function vft(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_TABLE_BODY}function Ift(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(dt.TBODY,V.TBODY),t.insertionMode=je.IN_TABLE_BODY,XS(t,e)}function Qft(t,e){t.openElements.hasInTableScope(V.TABLE)&&(t.openElements.popUntilTagNamePopped(V.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function _ft(t,e){E4e(e)?t._appendElement(e,Ot.HTML):Ev(t,e),e.ackSelfClosing=!0}function xft(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ot.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function D2(t,e){switch(e.tagID){case V.TD:case V.TH:case V.TR:{Ift(t,e);break}case V.STYLE:case V.SCRIPT:case V.TEMPLATE:{El(t,e);break}case V.COL:{kft(t,e);break}case V.FORM:{xft(t,e);break}case V.TABLE:{Qft(t,e);break}case V.TBODY:case V.TFOOT:case V.THEAD:{vft(t,e);break}case V.INPUT:{_ft(t,e);break}case V.CAPTION:{Eft(t,e);break}case V.COLGROUP:{Bft(t,e);break}default:Ev(t,e)}}function WB(t,e){switch(e.tagID){case V.TABLE:{t.openElements.hasInTableScope(V.TABLE)&&(t.openElements.popUntilTagNamePopped(V.TABLE),t._resetInsertionMode());break}case V.TEMPLATE:{R0(t,e);break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:Ev(t,e)}}function Ev(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,VS(t,e),t.fosterParentingEnabled=n}function v4e(t,e){t.pendingCharacterTokens.push(e)}function I4e(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function aw(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Ev(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Q4e=new Set([V.CAPTION,V.COL,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]);function Dft(t,e){const n=e.tagID;Q4e.has(n)?t.openElements.hasInTableScope(V.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(V.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=je.IN_TABLE,D2(t,e)):es(t,e)}function Sft(t,e){const n=e.tagID;switch(n){case V.CAPTION:case V.TABLE:{t.openElements.hasInTableScope(V.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(V.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=je.IN_TABLE,n===V.TABLE&&WB(t,e));break}case V.BODY:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:JS(t,e)}}function IW(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.COL:{t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.TEMPLATE:{El(t,e);break}default:VD(t,e)}}function Nft(t,e){switch(e.tagID){case V.COLGROUP:{t.openElements.currentTagId===V.COLGROUP&&(t.openElements.pop(),t.insertionMode=je.IN_TABLE);break}case V.TEMPLATE:{R0(t,e);break}case V.COL:break;default:VD(t,e)}}function VD(t,e){t.openElements.currentTagId===V.COLGROUP&&(t.openElements.pop(),t.insertionMode=je.IN_TABLE,t._processToken(e))}function XS(t,e){switch(e.tagID){case V.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_ROW;break}case V.TH:case V.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(dt.TR,V.TR),t.insertionMode=je.IN_ROW,e6(t,e);break}case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE,D2(t,e));break}default:D2(t,e)}}function Oj(t,e){const n=e.tagID;switch(e.tagID){case V.TBODY:case V.TFOOT:case V.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE);break}case V.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE,WB(t,e));break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:case V.TR:break;default:WB(t,e)}}function e6(t,e){switch(e.tagID){case V.TH:case V.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,Ot.HTML),t.insertionMode=je.IN_CELL,t.activeFormattingElements.insertMarker();break}case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:{t.openElements.hasInTableScope(V.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY,XS(t,e));break}default:D2(t,e)}}function _4e(t,e){switch(e.tagID){case V.TR:{t.openElements.hasInTableScope(V.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY);break}case V.TABLE:{t.openElements.hasInTableScope(V.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY,Oj(t,e));break}case V.TBODY:case V.TFOOT:case V.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(V.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=je.IN_TABLE_BODY,Oj(t,e));break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:break;default:WB(t,e)}}function Fft(t,e){const n=e.tagID;Q4e.has(n)?(t.openElements.hasInTableScope(V.TD)||t.openElements.hasInTableScope(V.TH))&&(t._closeTableCell(),e6(t,e)):es(t,e)}function Tft(t,e){const n=e.tagID;switch(n){case V.TD:case V.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=je.IN_ROW);break}case V.TABLE:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),_4e(t,e));break}case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:break;default:JS(t,e)}}function x4e(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.OPTION:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t._insertElement(e,Ot.HTML);break}case V.OPTGROUP:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t.openElements.currentTagId===V.OPTGROUP&&t.openElements.pop(),t._insertElement(e,Ot.HTML);break}case V.HR:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop(),t.openElements.currentTagId===V.OPTGROUP&&t.openElements.pop(),t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.INPUT:case V.KEYGEN:case V.TEXTAREA:case V.SELECT:{t.openElements.hasInSelectScope(V.SELECT)&&(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode(),e.tagID!==V.SELECT&&t._processStartTag(e));break}case V.SCRIPT:case V.TEMPLATE:{El(t,e);break}}}function D4e(t,e){switch(e.tagID){case V.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===V.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===V.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===V.OPTGROUP&&t.openElements.pop();break}case V.OPTION:{t.openElements.currentTagId===V.OPTION&&t.openElements.pop();break}case V.SELECT:{t.openElements.hasInSelectScope(V.SELECT)&&(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode());break}case V.TEMPLATE:{R0(t,e);break}}}function Rft(t,e){const n=e.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode(),t._processStartTag(e)):x4e(t,e)}function Mft(t,e){const n=e.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(V.SELECT),t._resetInsertionMode(),t.onEndTag(e)):D4e(t,e)}function Lft(t,e){switch(e.tagID){case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:{El(t,e);break}case V.CAPTION:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:{t.tmplInsertionModeStack[0]=je.IN_TABLE,t.insertionMode=je.IN_TABLE,D2(t,e);break}case V.COL:{t.tmplInsertionModeStack[0]=je.IN_COLUMN_GROUP,t.insertionMode=je.IN_COLUMN_GROUP,IW(t,e);break}case V.TR:{t.tmplInsertionModeStack[0]=je.IN_TABLE_BODY,t.insertionMode=je.IN_TABLE_BODY,XS(t,e);break}case V.TD:case V.TH:{t.tmplInsertionModeStack[0]=je.IN_ROW,t.insertionMode=je.IN_ROW,e6(t,e);break}default:t.tmplInsertionModeStack[0]=je.IN_BODY,t.insertionMode=je.IN_BODY,es(t,e)}}function Oft(t,e){e.tagID===V.TEMPLATE&&R0(t,e)}function S4e(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(V.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):vW(t,e)}function Gft(t,e){e.tagID===V.HTML?es(t,e):JD(t,e)}function N4e(t,e){var n;if(e.tagID===V.HTML){if(t.fragmentContext||(t.insertionMode=je.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===V.HTML){t._setEndLocation(t.openElements.items[0],e);const a=t.openElements.items[1];a&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(a))===null||n===void 0)&&n.endTag)&&t._setEndLocation(a,e)}}else JD(t,e)}function JD(t,e){t.insertionMode=je.IN_BODY,VS(t,e)}function Pft(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.FRAMESET:{t._insertElement(e,Ot.HTML);break}case V.FRAME:{t._appendElement(e,Ot.HTML),e.ackSelfClosing=!0;break}case V.NOFRAMES:{El(t,e);break}}}function qft(t,e){e.tagID===V.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==V.FRAMESET&&(t.insertionMode=je.AFTER_FRAMESET))}function Uft(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.NOFRAMES:{El(t,e);break}}}function $ft(t,e){e.tagID===V.HTML&&(t.insertionMode=je.AFTER_AFTER_FRAMESET)}function jft(t,e){e.tagID===V.HTML?es(t,e):Ox(t,e)}function Ox(t,e){t.insertionMode=je.IN_BODY,VS(t,e)}function Hft(t,e){switch(e.tagID){case V.HTML:{es(t,e);break}case V.NOFRAMES:{El(t,e);break}}}function zft(t,e){e.chars=vr,t._insertCharacters(e)}function Yft(t,e){t._insertCharacters(e),t.framesetOk=!1}function F4e(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ot.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function Kft(t,e){if(cgt(e))F4e(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),a=t.treeAdapter.getNamespaceURI(n);a===Ot.MATHML?f4e(e):a===Ot.SVG&&(lgt(e),h4e(e)),BW(e),e.selfClosing?t._appendElement(e,a):t._insertElement(e,a),e.ackSelfClosing=!0}}function Zft(t,e){if(e.tagID===V.P||e.tagID===V.BR){F4e(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const a=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(a)===Ot.HTML){t._endTagOutsideForeignContent(e);break}const r=t.treeAdapter.getTagName(a);if(r.toLowerCase()===e.tagName){e.tagName=r,t.openElements.shortenToLength(n);break}}}dt.AREA,dt.BASE,dt.BASEFONT,dt.BGSOUND,dt.BR,dt.COL,dt.EMBED,dt.FRAME,dt.HR,dt.IMG,dt.INPUT,dt.KEYGEN,dt.LINK,dt.META,dt.PARAM,dt.SOURCE,dt.TRACK,dt.WBR;const t6=T4e("end"),Du=T4e("start");function T4e(t){return e;function e(n){const a=n&&n.position&&n.position[t]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Wft(t){const e=Du(t),n=t6(t);if(e&&n)return{start:e,end:n}}const Vft=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Jft=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),sce={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function R4e(t,e){const n=A0t(t),a=GK("type",{handlers:{root:Xft,element:e0t,text:t0t,comment:L4e,doctype:n0t,raw:r0t},unknown:i0t}),r={parser:n?new rce(sce):rce.getFragmentParser(void 0,sce),handle(s){a(s,r)},stitches:!1,options:e||{}};a(t,r),T1(r,Du());const i=n?r.parser.document:r.parser.getFragment(),o=cmt(i,{file:r.options.file});return r.stitches&&Q2(o,"comment",function(s,A,l){const u=s;if(u.value.stitch&&l&&A!==void 0){const d=l.children;return d[A]=u.value.stitch,A}}),o.type==="root"&&o.children.length===1&&o.children[0].type===t.type?o.children[0]:o}function M4e(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function Xft(t,e){M4e(t.children,e)}function e0t(t,e){o0t(t,e),M4e(t.children,e),s0t(t,e)}function t0t(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:sa.CHARACTER,chars:t.value,location:Bv(t)};T1(e,Du(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function n0t(t,e){const n={type:sa.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Bv(t)};T1(e,Du(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function a0t(t,e){e.stitches=!0;const n=c0t(t);if("children"in t&&"children"in n){const a=R4e({type:"root",children:t.children},e.options);n.children=a.children}L4e({type:"comment",value:{stitch:n}},e)}function L4e(t,e){const n=t.value,a={type:sa.COMMENT,data:n,location:Bv(t)};T1(e,Du(t)),e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken)}function r0t(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,O4e(e,Du(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(Vft,"&lt;$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function i0t(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))a0t(n,e);else{let a="";throw Jft.has(n.type)&&(a=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+a)}}function T1(t,e){O4e(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=ti.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function O4e(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function o0t(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===ti.PLAINTEXT)return;T1(e,Du(t));const a=e.parser.openElements.current;let r="namespaceURI"in a?a.namespaceURI:nu.html;r===nu.html&&n==="svg"&&(r=nu.svg);const i=mmt({...t,children:[]},{space:r===nu.svg?"svg":"html"}),o={type:sa.START_TAG,tagName:n,tagID:F1(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Bv(t)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function s0t(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&mke.includes(n)||e.parser.tokenizer.state===ti.PLAINTEXT)return;T1(e,t6(t));const a={type:sa.END_TAG,tagName:n,tagID:F1(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Bv(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===ti.RCDATA||e.parser.tokenizer.state===ti.RAWTEXT||e.parser.tokenizer.state===ti.SCRIPT_DATA)&&(e.parser.tokenizer.state=ti.DATA)}function A0t(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Bv(t){const e=Du(t)||{line:void 0,column:void 0,offset:void 0},n=t6(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function c0t(t){return"children"in t?x2({...t,children:[]}):x2(t)}function l0t(t){return function(e,n){return R4e(e,{...t,file:n})}}const _d={eof:null,asterisk:42,underscore:95,tilde:126},S2={attentionSideAfter:2,characterGroupPunctuation:2,characterGroupWhitespace:1},$l={data:"data",characterEscape:"characterEscape",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",strong:"strong",strongSequence:"strongSequence",strongText:"strongText"},us=lg(/[A-Za-z]/),zo=lg(/[\dA-Za-z]/),u0t=lg(/[#-'*+\--9=?A-Z^-~]/);function XD(t){return t!==null&&(t<32||t===127)}const Gj=lg(/\d/),d0t=lg(/[\dA-Fa-f]/),p0t=lg(/[!-/:-@[-`{-~]/);function wn(t){return t!==null&&t<-2}function ar(t){return t!==null&&(t<0||t===32)}function pa(t){return t===-2||t===-1||t===32}const n6=lg(new RegExp("\\p{P}|\\p{S}","u")),n0=lg(/\s/);function lg(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function m0t(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function g0t(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function f0t(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function h0t(t){return m0t(t)?"ambiguous":g0t(t)?"fullwidth":t===8361||t>=65377&&t<=65470||t>=65474&&t<=65479||t>=65482&&t<=65487||t>=65490&&t<=65495||t>=65498&&t<=65500||t>=65512&&t<=65518?"halfwidth":t>=32&&t<=126||t===162||t===163||t===165||t===166||t===172||t===175||t>=10214&&t<=10221||t===10629||t===10630?"narrow":f0t(t)?"wide":"neutral"}function b0t(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function y0t(t){return b0t(t),h0t(t)}var C0t=Object.defineProperty,w0t=(t,e,n)=>e in t?C0t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,E0t=(t,e,n)=>w0t(t,e+"",n);function B0t(t){return new RegExp("^\\p{Emoji_Presentation}","u").test(String.fromCodePoint(t))}function k0t(t){if(!t||t<4352)return!1;switch(y0t(t)){case"fullwidth":case"halfwidth":return!0;case"wide":return!B0t(t);case"narrow":return!1;case"ambiguous":return 917760<=t&&t<=917999?null:!1;case"neutral":return new RegExp("^\\p{sc=Hangul}","u").test(String.fromCodePoint(t))}}function v0t(t,e){return e!==65025||!t||t<8216?!1:t===8216||t===8217||t===8220||t===8221}function I0t(t){return t!==null&&t>=65024&&t<=65038}var Q0t=G4e(new RegExp("\\p{P}|\\p{S}","u")),_0t=G4e(/\s/);function G4e(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCodePoint(n))}}var NA;(t=>{t.spaceOrPunctuation=3,t.cjk=4096,t.cjkPunctuation=4098,t.ivs=8192,t.cjkOrIvs=12288,t.nonEmojiGeneralUseVS=16384,t.variationSelector=24576,t.ivsToCjkRightShift=1})(NA||(NA={}));function ny(t){if(t===_d.eof||ar(t)||_0t(t))return S2.characterGroupWhitespace;let e=0;if(t>=4352){if(I0t(t))return NA.nonEmojiGeneralUseVS;switch(k0t(t)){case null:return NA.ivs;case!0:e|=NA.cjk;break}}return Q0t(t)&&(e|=S2.characterGroupPunctuation),e}function P4e(t,e,n){if(!N0t(t))return t;const a=e(),r=ny(a);return!a||VB(r)?t:v0t(a,n)?NA.cjkPunctuation:x0t(r)}function x0t(t){return t&~NA.ivs}function VB(t){return!!(t&S2.characterGroupWhitespace)}function e3(t){return(t&NA.cjkPunctuation)===S2.characterGroupPunctuation}function Pj(t){return!!(t&NA.cjk)}function D0t(t){return t===NA.ivs}function S0t(t){return!!(t&NA.cjkOrIvs)}function N0t(t){return t===NA.nonEmojiGeneralUseVS}function Ace(t){return!!(t&NA.spaceOrPunctuation)}function q4e(t){return!!(t&&t>=55296&&t<=56319)}function U4e(t){return!!(t&&t>=56320&&t<=57343)}function $4e(t,e,n){if(e._bufferIndex<2)return t;const r=n({start:{...e,_bufferIndex:e._bufferIndex-2},end:e}).codePointAt(0);return r&&r>=65536?r:t}function F0t(t,e,n){const a=t>=65536?2:1;if(e._bufferIndex<1+a)return null;const r=e._bufferIndex-a-2,i=n({start:{...e,_bufferIndex:r>=0?r:0},end:{...e,_bufferIndex:e._bufferIndex-a}}),o=i.charCodeAt(i.length-1);if(Number.isNaN(o))return null;if(i.length<2||o<56320||57343<o)return o;const s=i.codePointAt(0);return s&&s>=65536?s:o}var j4e=class{constructor(t,e,n){this.previousCode=t,this.nowPoint=e,this.sliceSerialize=n,E0t(this,"cachedValue")}value(){return this.cachedValue===void 0&&(this.cachedValue=F0t(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function H4e(t,e,n){const a=n({start:e,end:{...e,_bufferIndex:e._bufferIndex+2}}).codePointAt(0);return a&&a>=65536?a:t}function Do(t,e,n,a){const r=t.length;let i=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,a.length<1e4)o=Array.from(a),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);i<a.length;)o=a.slice(i,i+1e4),o.unshift(e,0),t.splice(...o),i+=1e4,e+=1e4}function vo(t,e){return t.length>0?(Do(t,t.length,0,e),t):e}function R1(t,e,n){const a=[];let r=-1;for(;++r<t.length;){const i=t[r].resolveAll;i&&!a.includes(i)&&(e=i(e,n),a.push(i))}return e}var K9={name:"attention",resolveAll:T0t,tokenize:R0t};function T0t(t,e){let n=-1,a,r,i,o,s,A,l,u;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(a=n;a--;)if(t[a][0]==="exit"&&t[a][1].type==="attentionSequence"&&t[a][1]._open&&e.sliceSerialize(t[a][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[a][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[a][1].end.offset-t[a][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;A=t[a][1].end.offset-t[a][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const d={...t[a][1].end},p={...t[n][1].start};cce(d,-A),cce(p,A),o={type:A>1?$l.strongSequence:$l.emphasisSequence,start:d,end:{...t[a][1].end}},s={type:A>1?$l.strongSequence:$l.emphasisSequence,start:{...t[n][1].start},end:p},i={type:A>1?$l.strongText:$l.emphasisText,start:{...t[a][1].end},end:{...t[n][1].start}},r={type:A>1?$l.strong:$l.emphasis,start:{...o.start},end:{...s.end}},t[a][1].end={...o.start},t[n][1].start={...s.end},l=[],t[a][1].end.offset-t[a][1].start.offset&&(l=vo(l,[["enter",t[a][1],e],["exit",t[a][1],e]])),l=vo(l,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",i,e]]),e.parser.constructs.insideSpan.null,l=vo(l,R1(e.parser.constructs.insideSpan.null,t.slice(a+1,n),e)),l=vo(l,[["exit",i,e],["enter",s,e],["exit",s,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,l=vo(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Do(t,a-1,n-a+3,l),n=a+l.length-u-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function R0t(t,e){const n=this.parser.constructs.attentionMarkers.null,{now:a,sliceSerialize:r,previous:i}=this,o=U4e(i)?$4e(i,a(),r):i,s=ny(o),A=new j4e(o,a(),r),l=P4e(s,A.value.bind(A),o);let u;return d;function d(m){return u=m,t.enter("attentionSequence"),p(m)}function p(m){if(m===u)return t.consume(m),p;const g=t.exit("attentionSequence"),h=q4e(m)?H4e(m,a(),r):m,b=ny(h),y=e3(l),w=y||VB(l),E=e3(b),k=E||VB(b),v=S0t(l),_=!k||E&&(w||v)||n.includes(m),I=!w||y&&(k||Pj(b))||n.includes(o);return g._open=!!(u===_d.asterisk?_:_&&(Ace(l)||!I)),g._close=!!(u===_d.asterisk?I:I&&(Ace(b)||!_)),e(m)}}function cce(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}function M0t(){return{text:{[_d.asterisk]:K9,[_d.underscore]:K9},insideSpan:{null:[K9]}}}function L0t(){const t=this.data();(t.micromarkExtensions||(t.micromarkExtensions=[])).push(M0t())}function O0t(t){let n=(t||{}).singleTilde;const a={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{[_d.tilde]:a},insideSpan:{null:[a]},attentionMarkers:{null:[_d.tilde]}};function r(o,s){let A=-1;for(;++A<o.length;)if(o[A][0]==="enter"&&o[A][1].type==="strikethroughSequenceTemporary"&&o[A][1]._close){let l=A;for(;l--;)if(o[l][0]==="exit"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._open&&o[A][1].end.offset-o[A][1].start.offset===o[l][1].end.offset-o[l][1].start.offset){o[A][1].type="strikethroughSequence",o[l][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[l][1].start),end:Object.assign({},o[A][1].end)},d={type:"strikethroughText",start:Object.assign({},o[l][1].end),end:Object.assign({},o[A][1].start)},p=[["enter",u,s],["enter",o[l][1],s],["exit",o[l][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Do(p,p.length,0,R1(m,o.slice(l+1,A),s)),Do(p,p.length,0,[["exit",d,s],["enter",o[A][1],s],["exit",o[A][1],s],["exit",u,s]]),Do(o,l-1,A-l+3,p),A=l+p.length-2;break}}for(A=-1;++A<o.length;)o[A][1].type==="strikethroughSequenceTemporary"&&(o[A][1].type=$l.data);return o}function i(o,s,A){const{now:l,sliceSerialize:u,previous:d}=this,p=U4e(d)?$4e(d,l(),u):d,m=ny(p),g=new j4e(p,l(),u),h=P4e(m,g.value.bind(g),p),b=this.events;let y=0;return w;function w(k){return p===_d.tilde&&b[b.length-1][1].type!==$l.characterEscape?A(k):(o.enter("strikethroughSequenceTemporary"),E(k))}function E(k){const v=ny(p);if(k===_d.tilde)return y>1?A(k):(o.consume(k),y++,E);if(y<2&&!n)return A(k);const _=o.exit("strikethroughSequenceTemporary"),I=q4e(k)?H4e(k,l(),u):k,x=ny(I),R=e3(h)||VB(h),O=e3(x)||VB(x),$=Pj(h)||D0t(v);return _._open=!O||x===S2.attentionSideAfter&&(R||$),_._close=!R||v===S2.attentionSideAfter&&(O||Pj(x)),s(k)}}}function G0t(t){const e=this.data();(e.micromarkExtensions||(e.micromarkExtensions=[])).push(O0t(t))}function P0t(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function q0t(t,e,n){const r=bv((n||{}).ignore||[]),i=U0t(e);let o=-1;for(;++o<i.length;)ZZ(t,"text",s);function s(l,u){let d=-1,p;for(;++d<u.length;){const m=u[d],g=p?p.children:void 0;if(r(m,g?g.indexOf(m):void 0,p))return;p=m}if(p)return A(l,u)}function A(l,u){const d=u[u.length-1],p=i[o][0],m=i[o][1];let g=0;const b=d.children.indexOf(l);let y=!1,w=[];p.lastIndex=0;let E=p.exec(l.value);for(;E;){const k=E.index,v={index:E.index,input:E.input,stack:[...u,l]};let _=m(...E,v);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?p.lastIndex=k+1:(g!==k&&w.push({type:"text",value:l.value.slice(g,k)}),Array.isArray(_)?w.push(..._):_&&w.push(_),g=k+E[0].length,y=!0),!p.global)break;E=p.exec(l.value)}return y?(g<l.value.length&&w.push({type:"text",value:l.value.slice(g)}),d.children.splice(b,1,...w)):w=[l],b+w.length}}function U0t(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let a=-1;for(;++a<n.length;){const r=n[a];e.push([$0t(r[0]),j0t(r[1])])}return e}function $0t(t){return typeof t=="string"?new RegExp(P0t(t),"g"):t}function j0t(t){return typeof t=="function"?t:function(){return t}}const Z9="phrasing",W9=["autolink","link","image","label"];function H0t(){return{transforms:[J0t],enter:{literalAutolink:Y0t,literalAutolinkEmail:V9,literalAutolinkHttp:V9,literalAutolinkWww:V9},exit:{literalAutolink:V0t,literalAutolinkEmail:W0t,literalAutolinkHttp:K0t,literalAutolinkWww:Z0t}}}function z0t(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Z9,notInConstruct:W9},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Z9,notInConstruct:W9},{character:":",before:"[ps]",after:"\\/",inConstruct:Z9,notInConstruct:W9}]}}function Y0t(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function V9(t){this.config.enter.autolinkProtocol.call(this,t)}function K0t(t){this.config.exit.autolinkProtocol.call(this,t)}function Z0t(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function W0t(t){this.config.exit.autolinkEmail.call(this,t)}function V0t(t){this.exit(t)}function J0t(t){q0t(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,X0t],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),eht]],{ignore:["link","linkReference"]})}function X0t(t,e,n,a,r){let i="";if(!z4e(r)||(/^w/i.test(e)&&(n=e+n,e="",i="http://"),!tht(n)))return!1;const o=nht(n+a);if(!o[0])return!1;const s={type:"link",title:null,url:i+e+o[0],children:[{type:"text",value:e+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function eht(t,e,n,a){return!z4e(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function tht(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function nht(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],a=n.indexOf(")");const r=bD(t,"(");let i=bD(t,")");for(;a!==-1&&r>i;)t+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),i++;return[t,n]}function z4e(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||n0(n)||n6(n))&&(!e||n!==47)}function nl(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Y4e.peek=uht;function aht(){this.buffer()}function rht(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function iht(){this.buffer()}function oht(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function sht(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=nl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Aht(t){this.exit(t)}function cht(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=nl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function lht(t){this.exit(t)}function uht(){return"["}function Y4e(t,e,n,a){const r=n.createTracker(a);let i=r.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return i+=r.move(n.safe(n.associationId(t),{after:"]",before:i})),s(),o(),i+=r.move("]"),i}function dht(){return{enter:{gfmFootnoteCallString:aht,gfmFootnoteCall:rht,gfmFootnoteDefinitionLabelString:iht,gfmFootnoteDefinition:oht},exit:{gfmFootnoteCallString:sht,gfmFootnoteCall:Aht,gfmFootnoteDefinitionLabelString:cht,gfmFootnoteDefinition:lht}}}function pht(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Y4e},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,r,i,o){const s=i.createTracker(o);let A=s.move("[^");const l=i.enter("footnoteDefinition"),u=i.enter("label");return A+=s.move(i.safe(i.associationId(a),{before:A,after:"]"})),u(),A+=s.move("]:"),a.children&&a.children.length>0&&(s.shift(4),A+=s.move((e?`
1601
1602
  `:" ")+i.indentLines(i.containerFlow(a,s.current()),e?K4e:mht))),l(),A}}function mht(t,e,n){return e===0?t:K4e(t,e,n)}function K4e(t,e,n){return(n?"":" ")+t}const ght=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Z4e.peek=Cht;function fht(){return{canContainEols:["delete"],enter:{strikethrough:bht},exit:{strikethrough:yht}}}function hht(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ght}],handlers:{delete:Z4e}}}function bht(t){this.enter({type:"delete",children:[]},t)}function yht(t){this.exit(t)}function Z4e(t,e,n,a){const r=n.createTracker(a),i=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(t,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),i(),o}function Cht(){return"~"}function wht(t){return t.length}function Eht(t,e){const n=e||{},a=(n.align||[]).concat(),r=n.stringLength||wht,i=[],o=[],s=[],A=[];let l=0,u=-1;for(;++u<t.length;){const h=[],b=[];let y=-1;for(t[u].length>l&&(l=t[u].length);++y<t[u].length;){const w=Bht(t[u][y]);if(n.alignDelimiters!==!1){const E=r(w);b[y]=E,(A[y]===void 0||E>A[y])&&(A[y]=E)}h.push(w)}o[u]=h,s[u]=b}let d=-1;if(typeof a=="object"&&"length"in a)for(;++d<l;)i[d]=lce(a[d]);else{const h=lce(a);for(;++d<l;)i[d]=h}d=-1;const p=[],m=[];for(;++d<l;){const h=i[d];let b="",y="";h===99?(b=":",y=":"):h===108?b=":":h===114&&(y=":");let w=n.alignDelimiters===!1?1:Math.max(1,A[d]-b.length-y.length);const E=b+"-".repeat(w)+y;n.alignDelimiters!==!1&&(w=b.length+w+y.length,w>A[d]&&(A[d]=w),m[d]=w),p[d]=E}o.splice(1,0,p),s.splice(1,0,m),u=-1;const g=[];for(;++u<o.length;){const h=o[u],b=s[u];d=-1;const y=[];for(;++d<l;){const w=h[d]||"";let E="",k="";if(n.alignDelimiters!==!1){const v=A[d]-(b[d]||0),_=i[d];_===114?E=" ".repeat(v):_===99?v%2?(E=" ".repeat(v/2+.5),k=" ".repeat(v/2-.5)):(E=" ".repeat(v/2),k=E):k=" ".repeat(v)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(E),y.push(w),n.alignDelimiters!==!1&&y.push(k),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==l-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
1602
1603
  `)}function Bht(t){return t==null?"":String(t)}function lce(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function kht(t,e,n,a){const r=n.enter("blockquote"),i=n.createTracker(a);i.move("> "),i.shift(2);const o=n.indentLines(n.containerFlow(t,i.current()),vht);return r(),o}function vht(t,e,n){return">"+(n?"":" ")+t}function Iht(t,e){return uce(t,e.inConstruct,!0)&&!uce(t,e.notInConstruct,!1)}function uce(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let a=-1;for(;++a<e.length;)if(t.includes(e[a]))return!0;return!1}function dce(t,e,n,a){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
1603
1604
  `&&Iht(n.stack,n.unsafe[r]))return/[ \t]/.test(a.before)?"":" ";return`\\
@@ -1629,7 +1630,7 @@ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
1629
1630
  `,e)!==-1&&!t.endsWith(`
1630
1631
  `)?`${t}
1631
1632
  $$`:`${t}$$`},i1t=(t,e)=>{if(t.substring(e+2).includes(")"))return null;let n=M2t(t,e);if(n===-1||jj(t,n))return null;let a=n>0&&t[n-1]==="!",r=a?n-1:n,i=t.substring(0,r);if(a)return i;let o=t.substring(n+1,e);return`${i}[${o}](streamdown:incomplete-link)`},o1t=(t,e)=>{let n=e>0&&t[e-1]==="!",a=n?e-1:e;if(!t.substring(e+1).includes("]")){let r=t.substring(0,a);return n?r:`${t}](streamdown:incomplete-link)`}if(L2t(t,e)===-1){let r=t.substring(0,a);return n?r:`${t}](streamdown:incomplete-link)`}return null},s1t=t=>{let e=t.lastIndexOf("](");if(e!==-1&&!jj(t,e)){let n=i1t(t,e);if(n!==null)return n}for(let n=t.length-1;n>=0;n-=1)if(t[n]==="["&&!jj(t,n)){let a=o1t(t,n);if(a!==null)return a}return t},A1t=t=>{let e=t.match(N2t);if(e){let n=e[2];if(!n||M0.test(n))return t;if((t.match(/~~/g)||[]).length%2===1)return`${t}~~`}return t},c1t=t=>{if(!t||typeof t!="string")return t;let e=t,n=s1t(e);return n.endsWith("](streamdown:incomplete-link)")?n:(e=n,e=V2t(e),e=j2t(e),e=H2t(e),e=Y2t(e),e=W2t(e),e=a1t(e),e=A1t(e),e=r1t(e),e)},l1t=c1t;const u1t=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d1t=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,a)=>a?a.toUpperCase():n.toLowerCase()),vce=t=>{const e=d1t(t);return e.charAt(0).toUpperCase()+e.slice(1)},_De=(...t)=>t.filter((e,n,a)=>!!e&&e.trim()!==""&&a.indexOf(e)===n).join(" ").trim(),p1t=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var m1t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const g1t=K.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:i,iconNode:o,...s},A)=>K.createElement("svg",{ref:A,...m1t,width:e,height:e,stroke:t,strokeWidth:a?Number(n)*24/Number(e):n,className:_De("lucide",r),...!i&&!p1t(s)&&{"aria-hidden":"true"},...s},[...o.map(([l,u])=>K.createElement(l,u)),...Array.isArray(i)?i:[i]]));const cp=(t,e)=>{const n=K.forwardRef(({className:a,...r},i)=>K.createElement(g1t,{ref:i,iconNode:e,className:_De(`lucide-${u1t(vce(t))}`,`lucide-${t}`,a),...r}));return n.displayName=vce(t),n};const f1t=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xDe=cp("check",f1t);const h1t=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],DDe=cp("copy",h1t);const b1t=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],r6=cp("download",b1t);const y1t=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],C1t=cp("loader-circle",y1t);const w1t=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],E1t=cp("maximize-2",w1t);const B1t=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],k1t=cp("rotate-ccw",B1t);const v1t=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],I1t=cp("x",v1t);const Q1t=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],_1t=cp("zoom-in",Q1t);const x1t=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],D1t=cp("zoom-out",x1t),S1t=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N1t=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,F1t={};function Ice(t,e){return(F1t.jsx?N1t:S1t).test(t)}var ab={},tR,Qce;function T1t(){if(Qce)return tR;Qce=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,s=/^\s+|\s+$/g,A=`
1632
- `,l="/",u="*",d="",p="comment",m="declaration";function g(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var w=1,E=1;function k(F){var L=F.match(e);L&&(w+=L.length);var M=F.lastIndexOf(A);E=~M?F.length-M:E+F.length}function v(){var F={line:w,column:E};return function(L){return L.position=new _(F),N(),L}}function _(F){this.start=F,this.end={line:w,column:E},this.source=y.source}_.prototype.content=b;function I(F){var L=new Error(y.source+":"+w+":"+E+": "+F);if(L.reason=F,L.filename=y.source,L.line=w,L.column=E,L.source=b,!y.silent)throw L}function x(F){var L=F.exec(b);if(L){var M=L[0];return k(M),b=b.slice(M.length),L}}function N(){x(n)}function R(F){var L;for(F=F||[];L=T();)L!==!1&&F.push(L);return F}function T(){var F=v();if(!(l!=b.charAt(0)||u!=b.charAt(1))){for(var L=2;d!=b.charAt(L)&&(u!=b.charAt(L)||l!=b.charAt(L+1));)++L;if(L+=2,d===b.charAt(L-1))return I("End of comment missing");var M=b.slice(2,L-2);return E+=2,k(M),b=b.slice(L),E+=2,F({type:p,comment:M})}}function O(){var F=v(),L=x(a);if(L){if(T(),!x(r))return I("property missing ':'");var M=x(i),P=F({type:m,property:h(L[0].replace(t,d)),value:M?h(M[0].replace(t,d)):d});return x(o),P}}function $(){var F=[];R(F);for(var L;L=O();)L!==!1&&(F.push(L),R(F));return F}return N(),$()}function h(b){return b?b.replace(s,d):d}return tR=g,tR}var _ce;function R1t(){if(_ce)return ab;_ce=1;var t=ab&&ab.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(ab,"__esModule",{value:!0}),ab.default=n;const e=t(T1t());function n(a,r){let i=null;if(!a||typeof a!="string")return i;const o=(0,e.default)(a),s=typeof r=="function";return o.forEach(A=>{if(A.type!=="declaration")return;const{property:l,value:u}=A;s?r(l,u,A):u&&(i=i||{},i[l]=u)}),i}return ab}var iw={},xce;function M1t(){if(xce)return iw;xce=1,Object.defineProperty(iw,"__esModule",{value:!0}),iw.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,i=function(l){return!l||n.test(l)||t.test(l)},o=function(l,u){return u.toUpperCase()},s=function(l,u){return"".concat(u,"-")},A=function(l,u){return u===void 0&&(u={}),i(l)?l:(l=l.toLowerCase(),u.reactCompat?l=l.replace(r,s):l=l.replace(a,s),l.replace(e,o))};return iw.camelCase=A,iw}var ow,Dce;function L1t(){if(Dce)return ow;Dce=1;var t=ow&&ow.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(R1t()),n=M1t();function a(r,i){var o={};return!r||typeof r!="string"||(0,e.default)(r,function(s,A){s&&A&&(o[(0,n.camelCase)(s,i)]=A)}),o}return a.default=a,ow=a,ow}var O1t=L1t();const G1t=OA(O1t);function dB(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Sce(t.position):"start"in t||"end"in t?Sce(t):"line"in t||"column"in t?Hj(t):""}function Hj(t){return Nce(t&&t.line)+":"+Nce(t&&t.column)}function Sce(t){return Hj(t&&t.start)+"-"+Hj(t&&t.end)}function Nce(t){return t&&typeof t=="number"?t:1}class ts extends Error{constructor(e,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let r="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof a=="string"){const A=a.indexOf(":");A===-1?i.ruleId=a:(i.source=a.slice(0,A),i.ruleId=a.slice(A+1))}if(!i.place&&i.ancestors&&i.ancestors){const A=i.ancestors[i.ancestors.length-1];A&&(i.place=A.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=dB(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ts.prototype.file="";ts.prototype.name="";ts.prototype.reason="";ts.prototype.message="";ts.prototype.stack="";ts.prototype.column=void 0;ts.prototype.line=void 0;ts.prototype.ancestors=void 0;ts.prototype.cause=void 0;ts.prototype.fatal=void 0;ts.prototype.place=void 0;ts.prototype.ruleId=void 0;ts.prototype.source=void 0;const FW={}.hasOwnProperty,P1t=new Map,q1t=/[A-Z]/g,U1t=new Set(["table","tbody","thead","tfoot","tr"]),$1t=new Set(["td","th"]),SDe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function j1t(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let a;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=J1t(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=V1t(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:a,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?vu:y1,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=NDe(r,t,void 0);return i&&typeof i!="string"?i:r.create(t,r.Fragment,{children:i||void 0},void 0)}function NDe(t,e,n){if(e.type==="element")return H1t(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return z1t(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return K1t(t,e,n);if(e.type==="mdxjsEsm")return Y1t(t,e);if(e.type==="root")return Z1t(t,e,n);if(e.type==="text")return W1t(t,e)}function H1t(t,e,n){const a=t.schema;let r=a;e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(r=vu,t.schema=r),t.ancestors.push(e);const i=TDe(t,e.tagName,!1),o=X1t(t,e);let s=RW(t,e);return U1t.has(e.tagName)&&(s=s.filter(function(A){return typeof A=="string"?!mS(A):!0})),FDe(t,o,i,e),TW(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function z1t(t,e){if(e.data&&e.data.estree&&t.evaluater){const a=e.data.estree.body[0];return a.type,t.evaluater.evaluateExpression(a.expression)}XB(t,e.position)}function Y1t(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);XB(t,e.position)}function K1t(t,e,n){const a=t.schema;let r=a;e.name==="svg"&&a.space==="html"&&(r=vu,t.schema=r),t.ancestors.push(e);const i=e.name===null?t.Fragment:TDe(t,e.name,!0),o=eCt(t,e),s=RW(t,e);return FDe(t,o,i,e),TW(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function Z1t(t,e,n){const a={};return TW(a,RW(t,e)),t.create(e,t.Fragment,a,n)}function W1t(t,e){return e.value}function FDe(t,e,n,a){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=a)}function TW(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function V1t(t,e,n){return a;function a(r,i,o,s){const l=Array.isArray(o.children)?n:e;return s?l(i,o,s):l(i,o)}}function J1t(t,e){return n;function n(a,r,i,o){const s=Array.isArray(i.children),A=Du(a);return e(r,i,o,s,{columnNumber:A?A.column-1:void 0,fileName:t,lineNumber:A?A.line:void 0},void 0)}}function X1t(t,e){const n={};let a,r;for(r in e.properties)if(r!=="children"&&FW.call(e.properties,r)){const i=tCt(t,r,e.properties[r]);if(i){const[o,s]=i;t.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&$1t.has(e.tagName)?a=s:n[o]=s}}if(a){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function eCt(t,e){const n={};for(const a of e.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&t.evaluater){const i=a.data.estree.body[0];i.type;const o=i.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,t.evaluater.evaluateExpression(s.argument))}else XB(t,e.position);else{const r=a.name;let i;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&t.evaluater){const s=a.value.data.estree.body[0];s.type,i=t.evaluater.evaluateExpression(s.expression)}else XB(t,e.position);else i=a.value===null?!0:a.value;n[r]=i}return n}function RW(t,e){const n=[];let a=-1;const r=t.passKeys?new Map:P1t;for(;++a<e.children.length;){const i=e.children[a];let o;if(t.passKeys){const A=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(A){const l=r.get(A)||0;o=A+"-"+l,r.set(A,l+1)}}const s=NDe(t,i,o);s!==void 0&&n.push(s)}return n}function tCt(t,e,n){const a=sv(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?LK(n):OK(n)),a.property==="style"){let r=typeof n=="object"?n:nCt(t,String(n));return t.stylePropertyNameCase==="css"&&(r=aCt(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&a.space?PVe[a.property]||a.property:a.attribute,n]}}function nCt(t,e){try{return G1t(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const a=n,r=new ts("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=SDe+"#cannot-parse-style-attribute",r}}function TDe(t,e,n){let a;if(!n)a={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let i=-1,o;for(;++i<r.length;){const s=Ice(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}a=o}else a=Ice(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(a.type==="Literal"){const r=a.value;return FW.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(a);XB(t)}function XB(t,e){const n=new ts("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=SDe+"#cannot-handle-mdx-estrees-without-createevaluater",n}function aCt(t){const e={};let n;for(n in t)FW.call(t,n)&&(e[rCt(n)]=t[n]);return e}function rCt(t){let e=t.replace(q1t,iCt);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function iCt(t){return"-"+t.toLowerCase()}const oCt={tokenize:sCt};function sCt(t){const e=t.attempt(this.parser.constructs.contentInitial,a,r);let n;return e;function a(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Aa(t,e,"linePrefix")}function r(s){return t.enter("paragraph"),i(s)}function i(s){const A=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=A),n=A,o(s)}function o(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return wn(s)?(t.consume(s),t.exit("chunkText"),i):(t.consume(s),o)}}const ACt={tokenize:cCt},Fce={tokenize:lCt};function cCt(t){const e=this,n=[];let a=0,r,i,o;return s;function s(E){if(a<n.length){const k=n[a];return e.containerState=k[1],t.attempt(k[0].continuation,A,l)(E)}return l(E)}function A(E){if(a++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&w();const k=e.events.length;let v=k,_;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){_=e.events[v][1].end;break}y(a);let I=k;for(;I<e.events.length;)e.events[I][1].end={..._},I++;return Do(e.events,v+1,0,e.events.slice(k)),e.events.length=I,l(E)}return s(E)}function l(E){if(a===n.length){if(!r)return p(E);if(r.currentConstruct&&r.currentConstruct.concrete)return g(E);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Fce,u,d)(E)}function u(E){return r&&w(),y(a),p(E)}function d(E){return e.parser.lazy[e.now().line]=a!==n.length,o=e.now().offset,g(E)}function p(E){return e.containerState={},t.attempt(Fce,m,g)(E)}function m(E){return a++,n.push([e.currentConstruct,e.containerState]),p(E)}function g(E){if(E===null){r&&w(),y(0),t.consume(E);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),h(E)}function h(E){if(E===null){b(t.exit("chunkFlow"),!0),y(0),t.consume(E);return}return wn(E)?(t.consume(E),b(t.exit("chunkFlow")),a=0,e.interrupt=void 0,s):(t.consume(E),h)}function b(E,k){const v=e.sliceStream(E);if(k&&v.push(null),E.previous=i,i&&(i.next=E),i=E,r.defineSkip(E.start),r.write(v),e.parser.lazy[E.start.line]){let _=r.events.length;for(;_--;)if(r.events[_][1].start.offset<o&&(!r.events[_][1].end||r.events[_][1].end.offset>o))return;const I=e.events.length;let x=I,N,R;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){if(N){R=e.events[x][1].end;break}N=!0}for(y(a),_=I;_<e.events.length;)e.events[_][1].end={...R},_++;Do(e.events,x+1,0,e.events.slice(I)),e.events.length=_}}function y(E){let k=n.length;for(;k-- >E;){const v=n[k];e.containerState=v[1],v[0].exit.call(e,t)}n.length=E}function w(){r.write([null]),i=void 0,r=void 0,e.containerState._closeFlow=void 0}}function lCt(t,e,n){return Aa(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const uCt={tokenize:dCt};function dCt(t){const e=this,n=t.attempt(kv,a,t.attempt(this.parser.constructs.flowInitial,r,Aa(t,t.attempt(this.parser.constructs.flow,r,t.attempt(Xbt,r)),"linePrefix")));return n;function a(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const pCt={resolveAll:MDe()},mCt=RDe("string"),gCt=RDe("text");function RDe(t){return{resolveAll:MDe(t==="text"?fCt:void 0),tokenize:e};function e(n){const a=this,r=this.parser.constructs[t],i=n.attempt(r,o,s);return o;function o(u){return l(u)?i(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),A}function A(u){return l(u)?(n.exit("data"),i(u)):(n.consume(u),A)}function l(u){if(u===null)return!0;const d=r[u];let p=-1;if(d)for(;++p<d.length;){const m=d[p];if(!m.previous||m.previous.call(a,a.previous))return!0}return!1}}}function MDe(t){return e;function e(n,a){let r=-1,i;for(;++r<=n.length;)i===void 0?n[r]&&n[r][1].type==="data"&&(i=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),r=i+2),i=void 0);return t?t(n,a):n}}function fCt(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const a=t[n-1][1],r=e.sliceStream(a);let i=r.length,o=-1,s=0,A;for(;i--;){const l=r[i];if(typeof l=="string"){for(o=l.length;l.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(l===-2)A=!0,s++;else if(l!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(s=0),s){const l={type:n===t.length||A||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:a.start._bufferIndex+o,_index:a.start._index+i,line:a.end.line,column:a.end.column-s,offset:a.end.offset-s},end:{...a.end}};a.end={...l.start},a.start.offset===a.end.offset?Object.assign(a,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const hCt={42:Us,43:Us,45:Us,48:Us,49:Us,50:Us,51:Us,52:Us,53:Us,54:Us,55:Us,56:Us,57:Us,62:yDe},bCt={91:ryt},yCt={[-2]:X9,[-1]:X9,32:X9},CCt={35:lyt,42:Gx,45:[Ece,Gx],60:myt,61:Ece,95:Gx,96:Cce,126:Cce},wCt={38:wDe,92:CDe},ECt={[-5]:eR,[-4]:eR,[-3]:eR,33:Nyt,38:wDe,42:Uj,60:[Tbt,wyt],91:Tyt,92:[Ayt,CDe],93:NW,95:Uj,96:Ybt},BCt={null:[Uj,pCt]},kCt={null:[42,95]},vCt={null:[]},ICt=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kCt,contentInitial:bCt,disable:vCt,document:hCt,flow:CCt,flowInitial:yCt,insideSpan:BCt,string:wCt,text:ECt},Symbol.toStringTag,{value:"Module"}));function QCt(t,e,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},i=[];let o=[],s=[];const A={attempt:I(v),check:I(_),consume:w,enter:E,exit:k,interrupt:I(_,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:m,write:d};let u=e.tokenize.call(l,A);return e.resolveAll&&i.push(e),l;function d(T){return o=vo(o,T),b(),o[o.length-1]!==null?[]:(x(e,0),l.events=R1(i,l.events,l),l.events)}function p(T,O){return xCt(m(T),O)}function m(T){return _Ct(o,T)}function g(){const{_bufferIndex:T,_index:O,line:$,column:F,offset:L}=a;return{_bufferIndex:T,_index:O,line:$,column:F,offset:L}}function h(T){r[T.line]=T.column,R()}function b(){let T;for(;a._index<o.length;){const O=o[a._index];if(typeof O=="string")for(T=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===T&&a._bufferIndex<O.length;)y(O.charCodeAt(a._bufferIndex));else y(O)}}function y(T){u=u(T)}function w(T){wn(T)?(a.line++,a.column=1,a.offset+=T===-3?2:1,R()):T!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===o[a._index].length&&(a._bufferIndex=-1,a._index++)),l.previous=T}function E(T,O){const $=O||{};return $.type=T,$.start=g(),l.events.push(["enter",$,l]),s.push($),$}function k(T){const O=s.pop();return O.end=g(),l.events.push(["exit",O,l]),O}function v(T,O){x(T,O.from)}function _(T,O){O.restore()}function I(T,O){return $;function $(F,L,M){let P,D,q,U;return Array.isArray(F)?H(F):"tokenize"in F?H([F]):G(F);function G(ae){return ee;function ee(pe){const ie=pe!==null&&ae[pe],re=pe!==null&&ae.null,ne=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(re)?re:re?[re]:[]];return H(ne)(pe)}}function H(ae){return P=ae,D=0,ae.length===0?M:j(ae[D])}function j(ae){return ee;function ee(pe){return U=N(),q=ae,ae.partial||(l.currentConstruct=ae),ae.name&&l.parser.constructs.disable.null.includes(ae.name)?J():ae.tokenize.call(O?Object.assign(Object.create(l),O):l,A,Z,J)(pe)}}function Z(ae){return T(q,U),L}function J(ae){return U.restore(),++D<P.length?j(P[D]):M}}}function x(T,O){T.resolveAll&&!i.includes(T)&&i.push(T),T.resolve&&Do(l.events,O,l.events.length-O,T.resolve(l.events.slice(O),l)),T.resolveTo&&(l.events=T.resolveTo(l.events,l))}function N(){const T=g(),O=l.previous,$=l.currentConstruct,F=l.events.length,L=Array.from(s);return{from:F,restore:M};function M(){a=T,l.previous=O,l.currentConstruct=$,l.events.length=F,s=L,R()}}function R(){a.line in r&&a.column<2&&(a.column=r[a.line],a.offset+=r[a.line]-1)}}function _Ct(t,e){const n=e.start._index,a=e.start._bufferIndex,r=e.end._index,i=e.end._bufferIndex;let o;if(n===r)o=[t[n].slice(a,i)];else{if(o=t.slice(n,r),a>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(a):o.shift()}i>0&&o.push(t[r].slice(0,i))}return o}function xCt(t,e){let n=-1;const a=[];let r;for(;++n<t.length;){const i=t[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
1633
+ `,l="/",u="*",d="",p="comment",m="declaration";function g(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var w=1,E=1;function k(F){var L=F.match(e);L&&(w+=L.length);var M=F.lastIndexOf(A);E=~M?F.length-M:E+F.length}function v(){var F={line:w,column:E};return function(L){return L.position=new _(F),N(),L}}function _(F){this.start=F,this.end={line:w,column:E},this.source=y.source}_.prototype.content=b;function I(F){var L=new Error(y.source+":"+w+":"+E+": "+F);if(L.reason=F,L.filename=y.source,L.line=w,L.column=E,L.source=b,!y.silent)throw L}function x(F){var L=F.exec(b);if(L){var M=L[0];return k(M),b=b.slice(M.length),L}}function N(){x(n)}function R(F){var L;for(F=F||[];L=T();)L!==!1&&F.push(L);return F}function T(){var F=v();if(!(l!=b.charAt(0)||u!=b.charAt(1))){for(var L=2;d!=b.charAt(L)&&(u!=b.charAt(L)||l!=b.charAt(L+1));)++L;if(L+=2,d===b.charAt(L-1))return I("End of comment missing");var M=b.slice(2,L-2);return E+=2,k(M),b=b.slice(L),E+=2,F({type:p,comment:M})}}function O(){var F=v(),L=x(a);if(L){if(T(),!x(r))return I("property missing ':'");var M=x(i),P=F({type:m,property:h(L[0].replace(t,d)),value:M?h(M[0].replace(t,d)):d});return x(o),P}}function $(){var F=[];R(F);for(var L;L=O();)L!==!1&&(F.push(L),R(F));return F}return N(),$()}function h(b){return b?b.replace(s,d):d}return tR=g,tR}var _ce;function R1t(){if(_ce)return ab;_ce=1;var t=ab&&ab.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(ab,"__esModule",{value:!0}),ab.default=n;const e=t(T1t());function n(a,r){let i=null;if(!a||typeof a!="string")return i;const o=(0,e.default)(a),s=typeof r=="function";return o.forEach(A=>{if(A.type!=="declaration")return;const{property:l,value:u}=A;s?r(l,u,A):u&&(i=i||{},i[l]=u)}),i}return ab}var iw={},xce;function M1t(){if(xce)return iw;xce=1,Object.defineProperty(iw,"__esModule",{value:!0}),iw.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,i=function(l){return!l||n.test(l)||t.test(l)},o=function(l,u){return u.toUpperCase()},s=function(l,u){return"".concat(u,"-")},A=function(l,u){return u===void 0&&(u={}),i(l)?l:(l=l.toLowerCase(),u.reactCompat?l=l.replace(r,s):l=l.replace(a,s),l.replace(e,o))};return iw.camelCase=A,iw}var ow,Dce;function L1t(){if(Dce)return ow;Dce=1;var t=ow&&ow.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(R1t()),n=M1t();function a(r,i){var o={};return!r||typeof r!="string"||(0,e.default)(r,function(s,A){s&&A&&(o[(0,n.camelCase)(s,i)]=A)}),o}return a.default=a,ow=a,ow}var O1t=L1t();const G1t=OA(O1t);function dB(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Sce(t.position):"start"in t||"end"in t?Sce(t):"line"in t||"column"in t?Hj(t):""}function Hj(t){return Nce(t&&t.line)+":"+Nce(t&&t.column)}function Sce(t){return Hj(t&&t.start)+"-"+Hj(t&&t.end)}function Nce(t){return t&&typeof t=="number"?t:1}class ts extends Error{constructor(e,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let r="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof a=="string"){const A=a.indexOf(":");A===-1?i.ruleId=a:(i.source=a.slice(0,A),i.ruleId=a.slice(A+1))}if(!i.place&&i.ancestors&&i.ancestors){const A=i.ancestors[i.ancestors.length-1];A&&(i.place=A.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=dB(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ts.prototype.file="";ts.prototype.name="";ts.prototype.reason="";ts.prototype.message="";ts.prototype.stack="";ts.prototype.column=void 0;ts.prototype.line=void 0;ts.prototype.ancestors=void 0;ts.prototype.cause=void 0;ts.prototype.fatal=void 0;ts.prototype.place=void 0;ts.prototype.ruleId=void 0;ts.prototype.source=void 0;const FW={}.hasOwnProperty,P1t=new Map,q1t=/[A-Z]/g,U1t=new Set(["table","tbody","thead","tfoot","tr"]),$1t=new Set(["td","th"]),SDe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function j1t(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let a;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=J1t(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=V1t(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:a,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?vu:y1,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=NDe(r,t,void 0);return i&&typeof i!="string"?i:r.create(t,r.Fragment,{children:i||void 0},void 0)}function NDe(t,e,n){if(e.type==="element")return H1t(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return z1t(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return K1t(t,e,n);if(e.type==="mdxjsEsm")return Y1t(t,e);if(e.type==="root")return Z1t(t,e,n);if(e.type==="text")return W1t(t,e)}function H1t(t,e,n){const a=t.schema;let r=a;e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(r=vu,t.schema=r),t.ancestors.push(e);const i=TDe(t,e.tagName,!1),o=X1t(t,e);let s=RW(t,e);return U1t.has(e.tagName)&&(s=s.filter(function(A){return typeof A=="string"?!gS(A):!0})),FDe(t,o,i,e),TW(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function z1t(t,e){if(e.data&&e.data.estree&&t.evaluater){const a=e.data.estree.body[0];return a.type,t.evaluater.evaluateExpression(a.expression)}XB(t,e.position)}function Y1t(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);XB(t,e.position)}function K1t(t,e,n){const a=t.schema;let r=a;e.name==="svg"&&a.space==="html"&&(r=vu,t.schema=r),t.ancestors.push(e);const i=e.name===null?t.Fragment:TDe(t,e.name,!0),o=eCt(t,e),s=RW(t,e);return FDe(t,o,i,e),TW(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function Z1t(t,e,n){const a={};return TW(a,RW(t,e)),t.create(e,t.Fragment,a,n)}function W1t(t,e){return e.value}function FDe(t,e,n,a){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=a)}function TW(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function V1t(t,e,n){return a;function a(r,i,o,s){const l=Array.isArray(o.children)?n:e;return s?l(i,o,s):l(i,o)}}function J1t(t,e){return n;function n(a,r,i,o){const s=Array.isArray(i.children),A=Du(a);return e(r,i,o,s,{columnNumber:A?A.column-1:void 0,fileName:t,lineNumber:A?A.line:void 0},void 0)}}function X1t(t,e){const n={};let a,r;for(r in e.properties)if(r!=="children"&&FW.call(e.properties,r)){const i=tCt(t,r,e.properties[r]);if(i){const[o,s]=i;t.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&$1t.has(e.tagName)?a=s:n[o]=s}}if(a){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function eCt(t,e){const n={};for(const a of e.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&t.evaluater){const i=a.data.estree.body[0];i.type;const o=i.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,t.evaluater.evaluateExpression(s.argument))}else XB(t,e.position);else{const r=a.name;let i;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&t.evaluater){const s=a.value.data.estree.body[0];s.type,i=t.evaluater.evaluateExpression(s.expression)}else XB(t,e.position);else i=a.value===null?!0:a.value;n[r]=i}return n}function RW(t,e){const n=[];let a=-1;const r=t.passKeys?new Map:P1t;for(;++a<e.children.length;){const i=e.children[a];let o;if(t.passKeys){const A=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(A){const l=r.get(A)||0;o=A+"-"+l,r.set(A,l+1)}}const s=NDe(t,i,o);s!==void 0&&n.push(s)}return n}function tCt(t,e,n){const a=sv(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?PK(n):qK(n)),a.property==="style"){let r=typeof n=="object"?n:nCt(t,String(n));return t.stylePropertyNameCase==="css"&&(r=aCt(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&a.space?HVe[a.property]||a.property:a.attribute,n]}}function nCt(t,e){try{return G1t(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const a=n,r=new ts("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=SDe+"#cannot-parse-style-attribute",r}}function TDe(t,e,n){let a;if(!n)a={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let i=-1,o;for(;++i<r.length;){const s=Ice(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}a=o}else a=Ice(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(a.type==="Literal"){const r=a.value;return FW.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(a);XB(t)}function XB(t,e){const n=new ts("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=SDe+"#cannot-handle-mdx-estrees-without-createevaluater",n}function aCt(t){const e={};let n;for(n in t)FW.call(t,n)&&(e[rCt(n)]=t[n]);return e}function rCt(t){let e=t.replace(q1t,iCt);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function iCt(t){return"-"+t.toLowerCase()}const oCt={tokenize:sCt};function sCt(t){const e=t.attempt(this.parser.constructs.contentInitial,a,r);let n;return e;function a(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Aa(t,e,"linePrefix")}function r(s){return t.enter("paragraph"),i(s)}function i(s){const A=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=A),n=A,o(s)}function o(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return wn(s)?(t.consume(s),t.exit("chunkText"),i):(t.consume(s),o)}}const ACt={tokenize:cCt},Fce={tokenize:lCt};function cCt(t){const e=this,n=[];let a=0,r,i,o;return s;function s(E){if(a<n.length){const k=n[a];return e.containerState=k[1],t.attempt(k[0].continuation,A,l)(E)}return l(E)}function A(E){if(a++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&w();const k=e.events.length;let v=k,_;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){_=e.events[v][1].end;break}y(a);let I=k;for(;I<e.events.length;)e.events[I][1].end={..._},I++;return Do(e.events,v+1,0,e.events.slice(k)),e.events.length=I,l(E)}return s(E)}function l(E){if(a===n.length){if(!r)return p(E);if(r.currentConstruct&&r.currentConstruct.concrete)return g(E);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Fce,u,d)(E)}function u(E){return r&&w(),y(a),p(E)}function d(E){return e.parser.lazy[e.now().line]=a!==n.length,o=e.now().offset,g(E)}function p(E){return e.containerState={},t.attempt(Fce,m,g)(E)}function m(E){return a++,n.push([e.currentConstruct,e.containerState]),p(E)}function g(E){if(E===null){r&&w(),y(0),t.consume(E);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),h(E)}function h(E){if(E===null){b(t.exit("chunkFlow"),!0),y(0),t.consume(E);return}return wn(E)?(t.consume(E),b(t.exit("chunkFlow")),a=0,e.interrupt=void 0,s):(t.consume(E),h)}function b(E,k){const v=e.sliceStream(E);if(k&&v.push(null),E.previous=i,i&&(i.next=E),i=E,r.defineSkip(E.start),r.write(v),e.parser.lazy[E.start.line]){let _=r.events.length;for(;_--;)if(r.events[_][1].start.offset<o&&(!r.events[_][1].end||r.events[_][1].end.offset>o))return;const I=e.events.length;let x=I,N,R;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){if(N){R=e.events[x][1].end;break}N=!0}for(y(a),_=I;_<e.events.length;)e.events[_][1].end={...R},_++;Do(e.events,x+1,0,e.events.slice(I)),e.events.length=_}}function y(E){let k=n.length;for(;k-- >E;){const v=n[k];e.containerState=v[1],v[0].exit.call(e,t)}n.length=E}function w(){r.write([null]),i=void 0,r=void 0,e.containerState._closeFlow=void 0}}function lCt(t,e,n){return Aa(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const uCt={tokenize:dCt};function dCt(t){const e=this,n=t.attempt(kv,a,t.attempt(this.parser.constructs.flowInitial,r,Aa(t,t.attempt(this.parser.constructs.flow,r,t.attempt(Xbt,r)),"linePrefix")));return n;function a(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const pCt={resolveAll:MDe()},mCt=RDe("string"),gCt=RDe("text");function RDe(t){return{resolveAll:MDe(t==="text"?fCt:void 0),tokenize:e};function e(n){const a=this,r=this.parser.constructs[t],i=n.attempt(r,o,s);return o;function o(u){return l(u)?i(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),A}function A(u){return l(u)?(n.exit("data"),i(u)):(n.consume(u),A)}function l(u){if(u===null)return!0;const d=r[u];let p=-1;if(d)for(;++p<d.length;){const m=d[p];if(!m.previous||m.previous.call(a,a.previous))return!0}return!1}}}function MDe(t){return e;function e(n,a){let r=-1,i;for(;++r<=n.length;)i===void 0?n[r]&&n[r][1].type==="data"&&(i=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),r=i+2),i=void 0);return t?t(n,a):n}}function fCt(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const a=t[n-1][1],r=e.sliceStream(a);let i=r.length,o=-1,s=0,A;for(;i--;){const l=r[i];if(typeof l=="string"){for(o=l.length;l.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(l===-2)A=!0,s++;else if(l!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(s=0),s){const l={type:n===t.length||A||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:a.start._bufferIndex+o,_index:a.start._index+i,line:a.end.line,column:a.end.column-s,offset:a.end.offset-s},end:{...a.end}};a.end={...l.start},a.start.offset===a.end.offset?Object.assign(a,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const hCt={42:Us,43:Us,45:Us,48:Us,49:Us,50:Us,51:Us,52:Us,53:Us,54:Us,55:Us,56:Us,57:Us,62:yDe},bCt={91:ryt},yCt={[-2]:X9,[-1]:X9,32:X9},CCt={35:lyt,42:Gx,45:[Ece,Gx],60:myt,61:Ece,95:Gx,96:Cce,126:Cce},wCt={38:wDe,92:CDe},ECt={[-5]:eR,[-4]:eR,[-3]:eR,33:Nyt,38:wDe,42:Uj,60:[Tbt,wyt],91:Tyt,92:[Ayt,CDe],93:NW,95:Uj,96:Ybt},BCt={null:[Uj,pCt]},kCt={null:[42,95]},vCt={null:[]},ICt=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kCt,contentInitial:bCt,disable:vCt,document:hCt,flow:CCt,flowInitial:yCt,insideSpan:BCt,string:wCt,text:ECt},Symbol.toStringTag,{value:"Module"}));function QCt(t,e,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},i=[];let o=[],s=[];const A={attempt:I(v),check:I(_),consume:w,enter:E,exit:k,interrupt:I(_,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:m,write:d};let u=e.tokenize.call(l,A);return e.resolveAll&&i.push(e),l;function d(T){return o=vo(o,T),b(),o[o.length-1]!==null?[]:(x(e,0),l.events=R1(i,l.events,l),l.events)}function p(T,O){return xCt(m(T),O)}function m(T){return _Ct(o,T)}function g(){const{_bufferIndex:T,_index:O,line:$,column:F,offset:L}=a;return{_bufferIndex:T,_index:O,line:$,column:F,offset:L}}function h(T){r[T.line]=T.column,R()}function b(){let T;for(;a._index<o.length;){const O=o[a._index];if(typeof O=="string")for(T=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===T&&a._bufferIndex<O.length;)y(O.charCodeAt(a._bufferIndex));else y(O)}}function y(T){u=u(T)}function w(T){wn(T)?(a.line++,a.column=1,a.offset+=T===-3?2:1,R()):T!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===o[a._index].length&&(a._bufferIndex=-1,a._index++)),l.previous=T}function E(T,O){const $=O||{};return $.type=T,$.start=g(),l.events.push(["enter",$,l]),s.push($),$}function k(T){const O=s.pop();return O.end=g(),l.events.push(["exit",O,l]),O}function v(T,O){x(T,O.from)}function _(T,O){O.restore()}function I(T,O){return $;function $(F,L,M){let P,D,q,U;return Array.isArray(F)?H(F):"tokenize"in F?H([F]):G(F);function G(ae){return ee;function ee(pe){const ie=pe!==null&&ae[pe],re=pe!==null&&ae.null,ne=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(re)?re:re?[re]:[]];return H(ne)(pe)}}function H(ae){return P=ae,D=0,ae.length===0?M:j(ae[D])}function j(ae){return ee;function ee(pe){return U=N(),q=ae,ae.partial||(l.currentConstruct=ae),ae.name&&l.parser.constructs.disable.null.includes(ae.name)?J():ae.tokenize.call(O?Object.assign(Object.create(l),O):l,A,Z,J)(pe)}}function Z(ae){return T(q,U),L}function J(ae){return U.restore(),++D<P.length?j(P[D]):M}}}function x(T,O){T.resolveAll&&!i.includes(T)&&i.push(T),T.resolve&&Do(l.events,O,l.events.length-O,T.resolve(l.events.slice(O),l)),T.resolveTo&&(l.events=T.resolveTo(l.events,l))}function N(){const T=g(),O=l.previous,$=l.currentConstruct,F=l.events.length,L=Array.from(s);return{from:F,restore:M};function M(){a=T,l.previous=O,l.currentConstruct=$,l.events.length=F,s=L,R()}}function R(){a.line in r&&a.column<2&&(a.column=r[a.line],a.offset+=r[a.line]-1)}}function _Ct(t,e){const n=e.start._index,a=e.start._bufferIndex,r=e.end._index,i=e.end._bufferIndex;let o;if(n===r)o=[t[n].slice(a,i)];else{if(o=t.slice(n,r),a>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(a):o.shift()}i>0&&o.push(t[r].slice(0,i))}return o}function xCt(t,e){let n=-1;const a=[];let r;for(;++n<t.length;){const i=t[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
1633
1634
  `;break}case-3:{o=`\r
1634
1635
  `;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(i)}r=i===-2,a.push(o)}return a.join("")}function DCt(t){const a={constructs:lDe([ICt,...(t||{}).extensions||[]]),content:r(oCt),defined:[],document:r(ACt),flow:r(uCt),lazy:{},string:r(mCt),text:r(gCt)};return a;function r(i){return o;function o(s){return QCt(a,i,s)}}}function SCt(t){for(;!EDe(t););return t}const Tce=/[\0\t\n\r]/g;function NCt(){let t=1,e="",n=!0,a;return r;function r(i,o,s){const A=[];let l,u,d,p,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),d=0,e="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(Tce.lastIndex=d,l=Tce.exec(i),p=l&&l.index!==void 0?l.index:i.length,m=i.charCodeAt(p),!l){e=i.slice(d);break}if(m===10&&d===p&&a)A.push(-3),a=void 0;else switch(a&&(A.push(-5),a=void 0),d<p&&(A.push(i.slice(d,p)),t+=p-d),m){case 0:{A.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,A.push(-2);t++<u;)A.push(-1);break}case 10:{A.push(-4),t=1;break}default:a=!0,t=1}d=p+1}return s&&(a&&A.push(-5),e&&A.push(e),A.push(null)),A}}const LDe={}.hasOwnProperty;function FCt(t,e,n){return typeof e!="string"&&(n=e,e=void 0),TCt(n)(SCt(DCt(n).document().write(NCt()(t,e,!0))))}function TCt(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Je),autolinkProtocol:N,autolinkEmail:N,atxHeading:i(Be),blockQuote:i(re),characterEscape:N,characterReference:N,codeFenced:i(ne),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(ne,o),codeText:i(te,o),codeTextData:N,data:N,codeFlowValue:N,definition:i(le),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ae),hardBreakEscape:i(de),hardBreakTrailing:i(de),htmlFlow:i(Ge,o),htmlFlowData:N,htmlText:i(Ge,o),htmlTextData:N,image:i(oe),label:o,link:i(Je),listItem:i(st),listItemValue:p,listOrdered:i(Ee,d),listUnordered:i(Ee),paragraph:i(nt),reference:j,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Be),strong:i(lt),thematicBreak:i(tt)},exit:{atxHeading:A(),atxHeadingSequence:v,autolink:A(),autolinkEmail:ie,autolinkProtocol:pe,blockQuote:A(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ae,characterReference:ee,codeFenced:A(b),codeFencedFence:h,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:A(y),codeText:A(L),codeTextData:R,data:R,definition:A(),definitionDestinationString:k,definitionLabelString:w,definitionTitleString:E,emphasis:A(),hardBreakEscape:A(O),hardBreakTrailing:A(O),htmlFlow:A($),htmlFlowData:R,htmlText:A(F),htmlTextData:R,image:A(P),label:q,labelText:D,lineEnding:T,link:A(M),listItem:A(),listOrdered:A(),listUnordered:A(),paragraph:A(),referenceString:Z,resourceDestinationString:U,resourceTitleString:G,resource:H,setextHeading:A(x),setextHeadingLineSequence:I,setextHeadingText:_,strong:A(),thematicBreak:A()}};ODe(e,(t||{}).mdastExtensions||[]);const n={};return a;function a(ye){let De={type:"root",children:[]};const qe={stack:[De],tokenStack:[],config:e,enter:s,exit:l,buffer:o,resume:u,data:n},ke=[];let $e=-1;for(;++$e<ye.length;)if(ye[$e][1].type==="listOrdered"||ye[$e][1].type==="listUnordered")if(ye[$e][0]==="enter")ke.push($e);else{const ue=ke.pop();$e=r(ye,ue,$e)}for($e=-1;++$e<ye.length;){const ue=e[ye[$e][0]];LDe.call(ue,ye[$e][1].type)&&ue[ye[$e][1].type].call(Object.assign({sliceSerialize:ye[$e][2].sliceSerialize},qe),ye[$e][1])}if(qe.tokenStack.length>0){const ue=qe.tokenStack[qe.tokenStack.length-1];(ue[1]||Rce).call(qe,void 0,ue[0])}for(De.position={start:Kp(ye.length>0?ye[0][1].start:{line:1,column:1,offset:0}),end:Kp(ye.length>0?ye[ye.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<e.transforms.length;)De=e.transforms[$e](De)||De;return De}function r(ye,De,qe){let ke=De-1,$e=-1,ue=!1,we,W,he,me;for(;++ke<=qe;){const Qe=ye[ke];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?$e++:$e--,me=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(we&&!me&&!$e&&!he&&(he=ke),me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:me=void 0}if(!$e&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||$e===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(we){let xe=ke;for(W=void 0;xe--;){const Te=ye[xe];if(Te[1].type==="lineEnding"||Te[1].type==="lineEndingBlank"){if(Te[0]==="exit")continue;W&&(ye[W][1].type="lineEndingBlank",ue=!0),Te[1].type="lineEnding",W=xe}else if(!(Te[1].type==="linePrefix"||Te[1].type==="blockQuotePrefix"||Te[1].type==="blockQuotePrefixWhitespace"||Te[1].type==="blockQuoteMarker"||Te[1].type==="listItemIndent"))break}he&&(!W||he<W)&&(we._spread=!0),we.end=Object.assign({},W?ye[W][1].start:Qe[1].end),ye.splice(W||ke,0,["exit",we,Qe[2]]),ke++,qe++}if(Qe[1].type==="listItemPrefix"){const xe={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};we=xe,ye.splice(ke,0,["enter",xe,Qe[2]]),ke++,qe++,he=void 0,me=!0}}}return ye[De][1]._spread=ue,qe}function i(ye,De){return qe;function qe(ke){s.call(this,ye(ke),ke),De&&De.call(this,ke)}}function o(){this.stack.push({type:"fragment",children:[]})}function s(ye,De,qe){this.stack[this.stack.length-1].children.push(ye),this.stack.push(ye),this.tokenStack.push([De,qe||void 0]),ye.position={start:Kp(De.start),end:void 0}}function A(ye){return De;function De(qe){ye&&ye.call(this,qe),l.call(this,qe)}}function l(ye,De){const qe=this.stack.pop(),ke=this.tokenStack.pop();if(ke)ke[0].type!==ye.type&&(De?De.call(this,ye,ke[0]):(ke[1]||Rce).call(this,ye,ke[0]));else throw new Error("Cannot close `"+ye.type+"` ("+dB({start:ye.start,end:ye.end})+"): it’s not open");qe.position.end=Kp(ye.end)}function u(){return _W(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(ye){if(this.data.expectingFirstListItemValue){const De=this.stack[this.stack.length-2];De.start=Number.parseInt(this.sliceSerialize(ye),10),this.data.expectingFirstListItemValue=void 0}}function m(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.lang=ye}function g(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.meta=ye}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye.replace(/(\r?\n|\r)$/g,"")}function w(ye){const De=this.resume(),qe=this.stack[this.stack.length-1];qe.label=De,qe.identifier=nl(this.sliceSerialize(ye)).toLowerCase()}function E(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.title=ye}function k(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.url=ye}function v(ye){const De=this.stack[this.stack.length-1];if(!De.depth){const qe=this.sliceSerialize(ye).length;De.depth=qe}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function I(ye){const De=this.stack[this.stack.length-1];De.depth=this.sliceSerialize(ye).codePointAt(0)===61?1:2}function x(){this.data.setextHeadingSlurpLineEnding=void 0}function N(ye){const qe=this.stack[this.stack.length-1].children;let ke=qe[qe.length-1];(!ke||ke.type!=="text")&&(ke=Me(),ke.position={start:Kp(ye.start),end:void 0},qe.push(ke)),this.stack.push(ke)}function R(ye){const De=this.stack.pop();De.value+=this.sliceSerialize(ye),De.position.end=Kp(ye.end)}function T(ye){const De=this.stack[this.stack.length-1];if(this.data.atHardBreak){const qe=De.children[De.children.length-1];qe.position.end=Kp(ye.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(De.type)&&(N.call(this,ye),R.call(this,ye))}function O(){this.data.atHardBreak=!0}function $(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye}function F(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye}function L(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye}function M(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const De=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=De,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function P(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const De=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=De,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function D(ye){const De=this.sliceSerialize(ye),qe=this.stack[this.stack.length-2];qe.label=rbt(De),qe.identifier=nl(De).toLowerCase()}function q(){const ye=this.stack[this.stack.length-1],De=this.resume(),qe=this.stack[this.stack.length-1];if(this.data.inReference=!0,qe.type==="link"){const ke=ye.children;qe.children=ke}else qe.alt=De}function U(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.url=ye}function G(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.title=ye}function H(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function Z(ye){const De=this.resume(),qe=this.stack[this.stack.length-1];qe.label=De,qe.identifier=nl(this.sliceSerialize(ye)).toLowerCase(),this.data.referenceType="full"}function J(ye){this.data.characterReferenceType=ye.type}function ae(ye){const De=this.sliceSerialize(ye),qe=this.data.characterReferenceType;let ke;qe?(ke=cDe(De,qe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ke=DW(De);const $e=this.stack[this.stack.length-1];$e.value+=ke}function ee(ye){const De=this.stack.pop();De.position.end=Kp(ye.end)}function pe(ye){R.call(this,ye);const De=this.stack[this.stack.length-1];De.url=this.sliceSerialize(ye)}function ie(ye){R.call(this,ye);const De=this.stack[this.stack.length-1];De.url="mailto:"+this.sliceSerialize(ye)}function re(){return{type:"blockquote",children:[]}}function ne(){return{type:"code",lang:null,meta:null,value:""}}function te(){return{type:"inlineCode",value:""}}function le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function de(){return{type:"break"}}function Ge(){return{type:"html",value:""}}function oe(){return{type:"image",title:null,url:"",alt:null}}function Je(){return{type:"link",title:null,url:"",children:[]}}function Ee(ye){return{type:"list",ordered:ye.type==="listOrdered",start:null,spread:ye._spread,children:[]}}function st(ye){return{type:"listItem",spread:ye._spread,checked:null,children:[]}}function nt(){return{type:"paragraph",children:[]}}function lt(){return{type:"strong",children:[]}}function Me(){return{type:"text",value:""}}function tt(){return{type:"thematicBreak"}}}function Kp(t){return{line:t.line,column:t.column,offset:t.offset}}function ODe(t,e){let n=-1;for(;++n<e.length;){const a=e[n];Array.isArray(a)?ODe(t,a):RCt(t,a)}}function RCt(t,e){let n;for(n in e)if(LDe.call(e,n))switch(n){case"canContainEols":{const a=e[n];a&&t[n].push(...a);break}case"transforms":{const a=e[n];a&&t[n].push(...a);break}case"enter":case"exit":{const a=e[n];a&&Object.assign(t[n],a);break}}}function Rce(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+dB({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+dB({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+dB({start:e.start,end:e.end})+") is still open")}function MCt(t){const e=this;e.parser=n;function n(a){return FCt(a,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function LCt(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function OCt(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
1635
1636
  `}]}function GCt(t,e){const n=e.value?e.value+`
@@ -1982,7 +1983,7 @@ ${t.themeCSS}`),t.fontFamily!==void 0&&(n+=`
1982
1983
  :root { --mermaid-font-family: ${t.fontFamily}}`),t.altFontFamily!==void 0&&(n+=`
1983
1984
  :root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const o=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(s=>{wk(s.styles)||o.forEach(A=>{n+=U0e(s.id,A,s.styles)}),wk(s.textStyles)||(n+=U0e(s.id,"tspan",(s?.textStyles||[]).map(A=>A.replace("color","fill"))))})}return n},"createCssStyles"),ltn=Q((t,e,n,a)=>{const r=ctn(t,n),i=gPt(e,r,t.themeVariables);return iz(IJt(`${a}{${i}}`),_Jt)},"createUserStyles"),utn=Q((t="",e,n)=>{let a=t;return!n&&!e&&(a=a.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),a=Cu(a),a=a.replace(/<br>/g,"<br/>"),a},"cleanUpSvgCode"),dtn=Q((t="",e)=>{const n=e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":ntn,a=c9e(`<body style="${rtn}">${t}</body>`);return`<iframe style="width:${ttn};height:${n};${atn}" src="data:text/html;charset=UTF-8;base64,${a}" sandbox="${itn}">
1984
1985
  ${otn}
1985
- </iframe>`},"putIntoIFrame"),$0e=Q((t,e,n,a,r)=>{const i=t.append("div");i.attr("id",n),a&&i.attr("style",a);const o=i.append("svg").attr("id",e).attr("width","100%").attr("xmlns",Jen);return r&&o.attr("xmlns:xlink",r),o.append("g"),t},"appendDivSvgG");function lz(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}Q(lz,"sandboxedIframe");var ptn=Q((t,e,n,a)=>{t.getElementById(e)?.remove(),t.getElementById(n)?.remove(),t.getElementById(a)?.remove()},"removeExistingElements"),mtn=Q(async function(t,e,n){e5();const a=pJ(e);e=a.code;const r=va();fe.debug(r),e.length>(r?.maxTextSize??Ken)&&(e=Zen);const i="#"+t,o="i"+t,s="#"+o,A="d"+t,l="#"+A,u=Q(()=>{const $=Rt(p?s:l).node();$&&"remove"in $&&$.remove()},"removeTempElements");let d=Rt("body");const p=r.securityLevel===Wen,m=r.securityLevel===Ven,g=r.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=""),p){const O=lz(Rt(n),o);d=Rt(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Rt(n);$0e(d,t,A,`font-family: ${g}`,Xen)}else{if(ptn(document,t,A,o),p){const O=lz(Rt("body"),o);d=Rt(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Rt("body");$0e(d,t,A)}let h,b;try{h=await cz.fromText(e,{title:a.title})}catch(O){if(r.suppressErrorRendering)throw u(),O;h=await cz.fromText("error"),b=O}const y=d.select(l).node(),w=h.type,E=y.firstChild,k=E.firstChild,v=h.renderer.getClasses?.(e,h),_=ltn(r,w,v,i),I=document.createElement("style");I.innerHTML=_,E.insertBefore(I,k);try{await h.renderer.draw(e,t,sH.version,h)}catch(O){throw r.suppressErrorRendering?u():ten.draw(e,t,sH.version),O}const x=d.select(`${l} svg`),N=h.db.getAccTitle?.(),R=h.db.getAccDescription?.();p9e(w,x,N,R),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",etn);let T=d.select(l).node().innerHTML;if(fe.debug("config.arrowMarkerAbsolute",r.arrowMarkerAbsolute),T=utn(T,p,Za(r.arrowMarkerAbsolute)),p){const O=d.select(l+" svg").node();T=dtn(T,O)}else m||(T=F2.sanitize(T,{ADD_TAGS:stn,ADD_ATTR:Atn,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if($en(),b)throw b;return u(),{diagramType:w,svg:T,bindFunctions:h.db.bindFunctions}},"render");function u9e(t={}){const e=ni({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),KGt(e),e?.theme&&e.theme in Pd?e.themeVariables=Pd[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Pd.default.getThemeVariables(e.themeVariables));const n=typeof e=="object"?YGt(e):$8e();gV(n.logLevel),e5()}Q(u9e,"initialize");var d9e=Q((t,e={})=>{const{code:n}=dJ(t);return cz.fromText(n,e)},"getDiagramFromText");function p9e(t,e,n,a){o9e(e,t),s9e(e,n,a,e.attr("id"))}Q(p9e,"addA11yInfo");var p0=Object.freeze({render:mtn,parse:l9e,getDiagramFromText:d9e,initialize:u9e,getConfig:va,setConfig:j8e,getSiteConfig:$8e,updateSiteConfig:ZGt,reset:Q(()=>{c3()},"reset"),globalReset:Q(()=>{c3(T2)},"globalReset"),defaultConfig:T2});gV(va().logLevel);c3(va());var gtn=Q((t,e,n)=>{fe.warn(t),nJ(t)?(n&&n(t.str,t.hash),e.push({...t,message:t.str,error:t})):(n&&n(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),m9e=Q(async function(t={querySelector:".mermaid"}){try{await ftn(t)}catch(e){if(nJ(e)&&fe.error(e.str),tp.parseError&&tp.parseError(e),!t.suppressErrors)throw fe.error("Use the suppressErrors option to suppress these errors"),e}},"run"),ftn=Q(async function({postRenderCallback:t,querySelector:e,nodes:n}={querySelector:".mermaid"}){const a=p0.getConfig();fe.debug(`${t?"":"No "}Callback function found`);let r;if(n)r=n;else if(e)r=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");fe.debug(`Found ${r.length} diagrams`),a?.startOnLoad!==void 0&&(fe.debug("Start On Load: "+a?.startOnLoad),p0.updateSiteConfig({startOnLoad:a?.startOnLoad}));const i=new Hn.InitIDGenerator(a.deterministicIds,a.deterministicIDSeed);let o;const s=[];for(const A of Array.from(r)){if(fe.info("Rendering diagram: "+A.id),A.getAttribute("data-processed"))continue;A.setAttribute("data-processed","true");const l=`mermaid-${i.next()}`;o=A.innerHTML,o=_Ne(Hn.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");const u=Hn.detectInit(o);u&&fe.debug("Detected early reinit: ",u);try{const{svg:d,bindFunctions:p}=await b9e(l,o,A);A.innerHTML=d,t&&await t(l),p&&p(A)}catch(d){gtn(d,s,tp.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),g9e=Q(function(t){p0.initialize(t)},"initialize"),htn=Q(async function(t,e,n){fe.warn("mermaid.init is deprecated. Please use run instead."),t&&g9e(t);const a={postRenderCallback:n,querySelector:".mermaid"};typeof e=="string"?a.querySelector=e:e&&(e instanceof HTMLElement?a.nodes=[e]:a.nodes=e),await m9e(a)},"init"),btn=Q(async(t,{lazyLoad:e=!0}={})=>{e5(),uH(...t),e===!1&&await qen()},"registerExternalDiagrams"),f9e=Q(function(){if(tp.startOnLoad){const{startOnLoad:t}=p0.getConfig();t&&tp.run().catch(e=>fe.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",f9e,!1);var ytn=Q(function(t){tp.parseError=t},"setParseErrorHandler"),K3=[],_P=!1,h9e=Q(async()=>{if(!_P){for(_P=!0;K3.length>0;){const t=K3.shift();if(t)try{await t()}catch(e){fe.error("Error executing queue",e)}}_P=!1}},"executeQueue"),Ctn=Q(async(t,e)=>new Promise((n,a)=>{const r=Q(()=>new Promise((i,o)=>{p0.parse(t,e).then(s=>{i(s),n(s)},s=>{fe.error("Error parsing",s),tp.parseError?.(s),o(s),a(s)})}),"performCall");K3.push(r),h9e().catch(a)}),"parse"),b9e=Q((t,e,n)=>new Promise((a,r)=>{const i=Q(()=>new Promise((o,s)=>{p0.render(t,e,n).then(A=>{o(A),a(A)},A=>{fe.error("Error parsing",A),tp.parseError?.(A),s(A),r(A)})}),"performCall");K3.push(i),h9e().catch(r)}),"render"),wtn=Q(()=>Object.keys(r0).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),tp={startOnLoad:!0,mermaidAPI:p0,parse:Ctn,render:b9e,init:htn,run:m9e,registerExternalDiagrams:btn,registerLayoutLoaders:kTe,initialize:g9e,parseError:void 0,contentLoaded:f9e,setParseErrorHandler:ytn,detectType:hV,registerIconPacks:SNe,getRegisteredDiagramsMetadata:wtn},Etn=tp;const Btn=Object.freeze(Object.defineProperty({__proto__:null,default:Etn},Symbol.toStringTag,{value:"Module"}));var ktn=Kn("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-4","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),vtn=K.memo(({children:t,result:e,language:n,className:a,...r})=>{let i=K.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]);return be.jsx("pre",{className:Kn(a,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":n,"data-streamdown":"code-block-body",style:i,...r,children:be.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((o,s)=>be.jsx("span",{className:ktn,children:o.map((A,l)=>be.jsx("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:A.color,backgroundColor:A.bgColor,...A.htmlStyle},...A.htmlAttrs,children:A.content},l))},s))})})},(t,e)=>t.result===e.result&&t.language===e.language&&t.className===e.className),Itn=({className:t,language:e,style:n,...a})=>be.jsx("div",{className:Kn("my-4 w-full overflow-hidden rounded-xl border border-border",t),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...a}),Qtn=({language:t,children:e})=>be.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":t,"data-streamdown":"code-block-header",children:[be.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),be.jsx("div",{className:"flex items-center gap-2",children:e})]}),_tn=cve({forgiving:!0}),xP=new Map,DP=new Map,sb=new Map,xtn=(t,e)=>`${t}-${e[0]}-${e[1]}`,Dtn=(t,e,n)=>{let a=t.slice(0,100),r=t.length>100?t.slice(-100):"";return`${e}:${n[0]}:${n[1]}:${t.length}:${a}:${r}`},y9e=t=>Object.hasOwn(jK,t),Stn=(t,e)=>{let n=y9e(t)?t:"text",a=xtn(n,e);if(xP.has(a))return xP.get(a);let r=Oke({themes:e,langs:[n],engine:_tn});return xP.set(a,r),r},j0e=(t,e,n,a)=>{let r=y9e(e)?e:"text",i=Dtn(t,r,n);return DP.has(i)?DP.get(i):(a&&(sb.has(i)||sb.set(i,new Set),sb.get(i).add(a)),Stn(r,n).then(o=>{let s=o.codeToTokens(t,{lang:r,themes:{light:n[0],dark:n[1]}});DP.set(i,s);let A=sb.get(i);if(A){for(let l of A)l(s);sb.delete(i)}}).catch(o=>{console.error("Failed to highlight code:",o),sb.delete(i)}),null)},Ntn=({code:t,language:e,className:n,children:a,...r})=>{let{shikiTheme:i}=K.useContext(Qc),o=K.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:t.split(`
1986
+ </iframe>`},"putIntoIFrame"),$0e=Q((t,e,n,a,r)=>{const i=t.append("div");i.attr("id",n),a&&i.attr("style",a);const o=i.append("svg").attr("id",e).attr("width","100%").attr("xmlns",Jen);return r&&o.attr("xmlns:xlink",r),o.append("g"),t},"appendDivSvgG");function lz(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}Q(lz,"sandboxedIframe");var ptn=Q((t,e,n,a)=>{t.getElementById(e)?.remove(),t.getElementById(n)?.remove(),t.getElementById(a)?.remove()},"removeExistingElements"),mtn=Q(async function(t,e,n){e5();const a=pJ(e);e=a.code;const r=va();fe.debug(r),e.length>(r?.maxTextSize??Ken)&&(e=Zen);const i="#"+t,o="i"+t,s="#"+o,A="d"+t,l="#"+A,u=Q(()=>{const $=Rt(p?s:l).node();$&&"remove"in $&&$.remove()},"removeTempElements");let d=Rt("body");const p=r.securityLevel===Wen,m=r.securityLevel===Ven,g=r.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=""),p){const O=lz(Rt(n),o);d=Rt(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Rt(n);$0e(d,t,A,`font-family: ${g}`,Xen)}else{if(ptn(document,t,A,o),p){const O=lz(Rt("body"),o);d=Rt(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=Rt("body");$0e(d,t,A)}let h,b;try{h=await cz.fromText(e,{title:a.title})}catch(O){if(r.suppressErrorRendering)throw u(),O;h=await cz.fromText("error"),b=O}const y=d.select(l).node(),w=h.type,E=y.firstChild,k=E.firstChild,v=h.renderer.getClasses?.(e,h),_=ltn(r,w,v,i),I=document.createElement("style");I.innerHTML=_,E.insertBefore(I,k);try{await h.renderer.draw(e,t,sH.version,h)}catch(O){throw r.suppressErrorRendering?u():ten.draw(e,t,sH.version),O}const x=d.select(`${l} svg`),N=h.db.getAccTitle?.(),R=h.db.getAccDescription?.();p9e(w,x,N,R),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",etn);let T=d.select(l).node().innerHTML;if(fe.debug("config.arrowMarkerAbsolute",r.arrowMarkerAbsolute),T=utn(T,p,Za(r.arrowMarkerAbsolute)),p){const O=d.select(l+" svg").node();T=dtn(T,O)}else m||(T=F2.sanitize(T,{ADD_TAGS:stn,ADD_ATTR:Atn,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if($en(),b)throw b;return u(),{diagramType:w,svg:T,bindFunctions:h.db.bindFunctions}},"render");function u9e(t={}){const e=ni({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),KGt(e),e?.theme&&e.theme in Pd?e.themeVariables=Pd[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Pd.default.getThemeVariables(e.themeVariables));const n=typeof e=="object"?YGt(e):$8e();gV(n.logLevel),e5()}Q(u9e,"initialize");var d9e=Q((t,e={})=>{const{code:n}=dJ(t);return cz.fromText(n,e)},"getDiagramFromText");function p9e(t,e,n,a){o9e(e,t),s9e(e,n,a,e.attr("id"))}Q(p9e,"addA11yInfo");var p0=Object.freeze({render:mtn,parse:l9e,getDiagramFromText:d9e,initialize:u9e,getConfig:va,setConfig:j8e,getSiteConfig:$8e,updateSiteConfig:ZGt,reset:Q(()=>{c3()},"reset"),globalReset:Q(()=>{c3(T2)},"globalReset"),defaultConfig:T2});gV(va().logLevel);c3(va());var gtn=Q((t,e,n)=>{fe.warn(t),nJ(t)?(n&&n(t.str,t.hash),e.push({...t,message:t.str,error:t})):(n&&n(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),m9e=Q(async function(t={querySelector:".mermaid"}){try{await ftn(t)}catch(e){if(nJ(e)&&fe.error(e.str),tp.parseError&&tp.parseError(e),!t.suppressErrors)throw fe.error("Use the suppressErrors option to suppress these errors"),e}},"run"),ftn=Q(async function({postRenderCallback:t,querySelector:e,nodes:n}={querySelector:".mermaid"}){const a=p0.getConfig();fe.debug(`${t?"":"No "}Callback function found`);let r;if(n)r=n;else if(e)r=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");fe.debug(`Found ${r.length} diagrams`),a?.startOnLoad!==void 0&&(fe.debug("Start On Load: "+a?.startOnLoad),p0.updateSiteConfig({startOnLoad:a?.startOnLoad}));const i=new Hn.InitIDGenerator(a.deterministicIds,a.deterministicIDSeed);let o;const s=[];for(const A of Array.from(r)){if(fe.info("Rendering diagram: "+A.id),A.getAttribute("data-processed"))continue;A.setAttribute("data-processed","true");const l=`mermaid-${i.next()}`;o=A.innerHTML,o=_Ne(Hn.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");const u=Hn.detectInit(o);u&&fe.debug("Detected early reinit: ",u);try{const{svg:d,bindFunctions:p}=await b9e(l,o,A);A.innerHTML=d,t&&await t(l),p&&p(A)}catch(d){gtn(d,s,tp.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),g9e=Q(function(t){p0.initialize(t)},"initialize"),htn=Q(async function(t,e,n){fe.warn("mermaid.init is deprecated. Please use run instead."),t&&g9e(t);const a={postRenderCallback:n,querySelector:".mermaid"};typeof e=="string"?a.querySelector=e:e&&(e instanceof HTMLElement?a.nodes=[e]:a.nodes=e),await m9e(a)},"init"),btn=Q(async(t,{lazyLoad:e=!0}={})=>{e5(),uH(...t),e===!1&&await qen()},"registerExternalDiagrams"),f9e=Q(function(){if(tp.startOnLoad){const{startOnLoad:t}=p0.getConfig();t&&tp.run().catch(e=>fe.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",f9e,!1);var ytn=Q(function(t){tp.parseError=t},"setParseErrorHandler"),K3=[],_P=!1,h9e=Q(async()=>{if(!_P){for(_P=!0;K3.length>0;){const t=K3.shift();if(t)try{await t()}catch(e){fe.error("Error executing queue",e)}}_P=!1}},"executeQueue"),Ctn=Q(async(t,e)=>new Promise((n,a)=>{const r=Q(()=>new Promise((i,o)=>{p0.parse(t,e).then(s=>{i(s),n(s)},s=>{fe.error("Error parsing",s),tp.parseError?.(s),o(s),a(s)})}),"performCall");K3.push(r),h9e().catch(a)}),"parse"),b9e=Q((t,e,n)=>new Promise((a,r)=>{const i=Q(()=>new Promise((o,s)=>{p0.render(t,e,n).then(A=>{o(A),a(A)},A=>{fe.error("Error parsing",A),tp.parseError?.(A),s(A),r(A)})}),"performCall");K3.push(i),h9e().catch(r)}),"render"),wtn=Q(()=>Object.keys(r0).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),tp={startOnLoad:!0,mermaidAPI:p0,parse:Ctn,render:b9e,init:htn,run:m9e,registerExternalDiagrams:btn,registerLayoutLoaders:kTe,initialize:g9e,parseError:void 0,contentLoaded:f9e,setParseErrorHandler:ytn,detectType:hV,registerIconPacks:SNe,getRegisteredDiagramsMetadata:wtn},Etn=tp;const Btn=Object.freeze(Object.defineProperty({__proto__:null,default:Etn},Symbol.toStringTag,{value:"Module"}));var ktn=Kn("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-4","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),vtn=K.memo(({children:t,result:e,language:n,className:a,...r})=>{let i=K.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]);return be.jsx("pre",{className:Kn(a,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":n,"data-streamdown":"code-block-body",style:i,...r,children:be.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((o,s)=>be.jsx("span",{className:ktn,children:o.map((A,l)=>be.jsx("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:A.color,backgroundColor:A.bgColor,...A.htmlStyle},...A.htmlAttrs,children:A.content},l))},s))})})},(t,e)=>t.result===e.result&&t.language===e.language&&t.className===e.className),Itn=({className:t,language:e,style:n,...a})=>be.jsx("div",{className:Kn("my-4 w-full overflow-hidden rounded-xl border border-border",t),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...a}),Qtn=({language:t,children:e})=>be.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":t,"data-streamdown":"code-block-header",children:[be.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),be.jsx("div",{className:"flex items-center gap-2",children:e})]}),_tn=uve({forgiving:!0}),xP=new Map,DP=new Map,sb=new Map,xtn=(t,e)=>`${t}-${e[0]}-${e[1]}`,Dtn=(t,e,n)=>{let a=t.slice(0,100),r=t.length>100?t.slice(-100):"";return`${e}:${n[0]}:${n[1]}:${t.length}:${a}:${r}`},y9e=t=>Object.hasOwn(YK,t),Stn=(t,e)=>{let n=y9e(t)?t:"text",a=xtn(n,e);if(xP.has(a))return xP.get(a);let r=Pke({themes:e,langs:[n],engine:_tn});return xP.set(a,r),r},j0e=(t,e,n,a)=>{let r=y9e(e)?e:"text",i=Dtn(t,r,n);return DP.has(i)?DP.get(i):(a&&(sb.has(i)||sb.set(i,new Set),sb.get(i).add(a)),Stn(r,n).then(o=>{let s=o.codeToTokens(t,{lang:r,themes:{light:n[0],dark:n[1]}});DP.set(i,s);let A=sb.get(i);if(A){for(let l of A)l(s);sb.delete(i)}}).catch(o=>{console.error("Failed to highlight code:",o),sb.delete(i)}),null)},Ntn=({code:t,language:e,className:n,children:a,...r})=>{let{shikiTheme:i}=K.useContext(Qc),o=K.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:t.split(`
1986
1987
  `).map(l=>[{content:l,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[t]),[s,A]=K.useState(o);return K.useEffect(()=>{let l=j0e(t,e,i);if(l){A(l);return}j0e(t,e,i,u=>{A(u)})},[t,e,i]),be.jsx(JDe.Provider,{value:{code:t},children:be.jsxs(Itn,{language:e,children:[be.jsx(Qtn,{language:e,children:a}),be.jsx(vtn,{className:n,language:e,result:s,...r})]})})};const Ftn=Object.freeze(Object.defineProperty({__proto__:null,CodeBlock:Ntn},Symbol.toStringTag,{value:"Module"})),Ttn=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:x3e},Symbol.toStringTag,{value:"Module"})),Rtn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Mtn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var uz;(function(t){t.Nsis="nsis",t.Msi="msi",t.Deb="deb",t.Rpm="rpm",t.AppImage="appimage",t.App="app"})(uz||(uz={}));async function Ltn(){return Vt("plugin:app|version")}const VNn=Object.freeze(Object.defineProperty({__proto__:null,get BundleType(){return uz},getVersion:Ltn},Symbol.toStringTag,{value:"Module"}));var Otn="[object Symbol]";function m0(t){return typeof t=="symbol"||yu(t)&&j0(t)==Otn}function dy(t,e){for(var n=-1,a=t==null?0:t.length,r=Array(a);++n<a;)r[n]=e(t[n],n,t);return r}var H0e=Dc?Dc.prototype:void 0,z0e=H0e?H0e.toString:void 0;function C9e(t){if(typeof t=="string")return t;if(Ci(t))return dy(t,C9e)+"";if(m0(t))return z0e?z0e.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Gtn=/\s/;function Ptn(t){for(var e=t.length;e--&&Gtn.test(t.charAt(e)););return e}var qtn=/^\s+/;function Utn(t){return t&&t.slice(0,Ptn(t)+1).replace(qtn,"")}var Y0e=NaN,$tn=/^[-+]0x[0-9a-f]+$/i,jtn=/^0b[01]+$/i,Htn=/^0o[0-7]+$/i,ztn=parseInt;function Ytn(t){if(typeof t=="number")return t;if(m0(t))return Y0e;if(RA(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=RA(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Utn(t);var n=jtn.test(t);return n||Htn.test(t)?ztn(t.slice(2),n?2:8):$tn.test(t)?Y0e:+t}var K0e=1/0,Ktn=17976931348623157e292;function l4(t){if(!t)return t===0?t:0;if(t=Ytn(t),t===K0e||t===-K0e){var e=t<0?-1:1;return e*Ktn}return t===t?t:0}function Ztn(t){var e=l4(t),n=e%1;return e===e?n?e-n:e:0}function Wtn(){}function w9e(t,e){for(var n=-1,a=t==null?0:t.length;++n<a&&e(t[n],n,t)!==!1;);return t}function E9e(t,e,n,a){for(var r=t.length,i=n+-1;++i<r;)if(e(t[i],i,t))return i;return-1}function Vtn(t){return t!==t}function Jtn(t,e,n){for(var a=n-1,r=t.length;++a<r;)if(t[a]===e)return a;return-1}function Xtn(t,e,n){return e===e?Jtn(t,e,n):E9e(t,Vtn,n)}function enn(t,e){var n=t==null?0:t.length;return!!n&&Xtn(t,e,0)>-1}function QA(t){return pg(t)?dNe(t):STe(t)}var tnn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nnn=/^\w*$/;function mJ(t,e){if(Ci(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||m0(t)?!0:nnn.test(t)||!tnn.test(t)||e!=null&&t in Object(e)}var ann=500;function rnn(t){var e=$1(t,function(a){return n.size===ann&&n.clear(),a}),n=e.cache;return e}var inn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,onn=/\\(\\)?/g,snn=rnn(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(inn,function(n,a,r,i){e.push(r?i.replace(onn,"$1"):a||n)}),e});function B9e(t){return t==null?"":C9e(t)}function t5(t,e){return Ci(t)?t:mJ(t,e)?[t]:snn(B9e(t))}function jv(t){if(typeof t=="string"||m0(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function n5(t,e){e=t5(e,t);for(var n=0,a=e.length;t!=null&&n<a;)t=t[jv(e[n++])];return n&&n==a?t:void 0}function Ann(t,e,n){var a=t==null?void 0:n5(t,e);return a===void 0?n:a}function gJ(t,e){for(var n=-1,a=e.length,r=t.length;++n<a;)t[r+n]=e[n];return t}var Z0e=Dc?Dc.isConcatSpreadable:void 0;function cnn(t){return Ci(t)||j2(t)||!!(Z0e&&t&&t[Z0e])}function a5(t,e,n,a,r){var i=-1,o=t.length;for(n||(n=cnn),r||(r=[]);++i<o;){var s=t[i];n(s)?gJ(r,s):a||(r[r.length]=s)}return r}function W0(t){var e=t==null?0:t.length;return e?a5(t):[]}function lnn(t){return gNe(mNe(t,void 0,W0),t+"")}function unn(t,e,n,a){var r=-1,i=t==null?0:t.length;for(a&&i&&(n=t[++r]);++r<i;)n=e(n,t[r],r,t);return n}function dnn(t,e){return t&&qv(e,QA(e),t)}function pnn(t,e){return t&&qv(e,Y0(e),t)}function k9e(t,e){for(var n=-1,a=t==null?0:t.length,r=0,i=[];++n<a;){var o=t[n];e(o,n,t)&&(i[r++]=o)}return i}function v9e(){return[]}var mnn=Object.prototype,gnn=mnn.propertyIsEnumerable,W0e=Object.getOwnPropertySymbols,fJ=W0e?function(t){return t==null?[]:(t=Object(t),k9e(W0e(t),function(e){return gnn.call(t,e)}))}:v9e;function fnn(t,e){return qv(t,fJ(t),e)}var hnn=Object.getOwnPropertySymbols,I9e=hnn?function(t){for(var e=[];t;)gJ(e,fJ(t)),t=ZV(t);return e}:v9e;function bnn(t,e){return qv(t,I9e(t),e)}function Q9e(t,e,n){var a=e(t);return Ci(t)?a:gJ(a,n(t))}function dz(t){return Q9e(t,QA,fJ)}function ynn(t){return Q9e(t,Y0,I9e)}var Cnn=Object.prototype,wnn=Cnn.hasOwnProperty;function Enn(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&wnn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function Bnn(t,e){var n=e?KV(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var knn=/\w*$/;function vnn(t){var e=new t.constructor(t.source,knn.exec(t));return e.lastIndex=t.lastIndex,e}var V0e=Dc?Dc.prototype:void 0,J0e=V0e?V0e.valueOf:void 0;function Inn(t){return J0e?Object(J0e.call(t)):{}}var Qnn="[object Boolean]",_nn="[object Date]",xnn="[object Map]",Dnn="[object Number]",Snn="[object RegExp]",Nnn="[object Set]",Fnn="[object String]",Tnn="[object Symbol]",Rnn="[object ArrayBuffer]",Mnn="[object DataView]",Lnn="[object Float32Array]",Onn="[object Float64Array]",Gnn="[object Int8Array]",Pnn="[object Int16Array]",qnn="[object Int32Array]",Unn="[object Uint8Array]",$nn="[object Uint8ClampedArray]",jnn="[object Uint16Array]",Hnn="[object Uint32Array]";function znn(t,e,n){var a=t.constructor;switch(e){case Rnn:return KV(t);case Qnn:case _nn:return new a(+t);case Mnn:return Bnn(t,n);case Lnn:case Onn:case Gnn:case Pnn:case qnn:case Unn:case $nn:case jnn:case Hnn:return aNe(t,n);case xnn:return new a;case Dnn:case Fnn:return new a(t);case Snn:return vnn(t);case Nnn:return new a;case Tnn:return Inn(t)}}var Ynn="[object Map]";function Knn(t){return yu(t)&&lc(t)==Ynn}var X0e=z2&&z2.isMap,Znn=X0e?q6(X0e):Knn,Wnn="[object Set]";function Vnn(t){return yu(t)&&lc(t)==Wnn}var ehe=z2&&z2.isSet,Jnn=ehe?q6(ehe):Vnn,Xnn=1,ean=2,tan=4,_9e="[object Arguments]",nan="[object Array]",aan="[object Boolean]",ran="[object Date]",ian="[object Error]",x9e="[object Function]",oan="[object GeneratorFunction]",san="[object Map]",Aan="[object Number]",D9e="[object Object]",can="[object RegExp]",lan="[object Set]",uan="[object String]",dan="[object Symbol]",pan="[object WeakMap]",man="[object ArrayBuffer]",gan="[object DataView]",fan="[object Float32Array]",han="[object Float64Array]",ban="[object Int8Array]",yan="[object Int16Array]",Can="[object Int32Array]",wan="[object Uint8Array]",Ean="[object Uint8ClampedArray]",Ban="[object Uint16Array]",kan="[object Uint32Array]",lr={};lr[_9e]=lr[nan]=lr[man]=lr[gan]=lr[aan]=lr[ran]=lr[fan]=lr[han]=lr[ban]=lr[yan]=lr[Can]=lr[san]=lr[Aan]=lr[D9e]=lr[can]=lr[lan]=lr[uan]=lr[dan]=lr[wan]=lr[Ean]=lr[Ban]=lr[kan]=!0;lr[ian]=lr[x9e]=lr[pan]=!1;function CB(t,e,n,a,r,i){var o,s=e&Xnn,A=e&ean,l=e&tan;if(o!==void 0)return o;if(!RA(t))return t;var u=Ci(t);if(u){if(o=Enn(t),!s)return rNe(t,o)}else{var d=lc(t),p=d==x9e||d==oan;if(H2(t))return nNe(t,s);if(d==D9e||d==_9e||p&&!r){if(o=A||p?{}:oNe(t),!s)return A?bnn(t,pnn(o,t)):fnn(t,dnn(o,t))}else{if(!lr[d])return r?t:{};o=znn(t,d,s)}}i||(i=new rl);var m=i.get(t);if(m)return m;i.set(t,o),Jnn(t)?t.forEach(function(b){o.add(CB(b,e,n,b,t,i))}):Znn(t)&&t.forEach(function(b,y){o.set(y,CB(b,e,n,y,t,i))});var g=l?A?ynn:dz:A?Y0:QA,h=u?void 0:g(t);return w9e(h||t,function(b,y){h&&(y=b,b=t[y]),$6(o,y,CB(b,e,n,y,t,i))}),o}var van=4;function S9e(t){return CB(t,van)}var Ian=1,Qan=4;function _an(t){return CB(t,Ian|Qan)}var xan="__lodash_hash_undefined__";function Dan(t){return this.__data__.set(t,xan),this}function San(t){return this.__data__.has(t)}function Ek(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new dp;++e<n;)this.add(t[e])}Ek.prototype.add=Ek.prototype.push=Dan;Ek.prototype.has=San;function Nan(t,e){for(var n=-1,a=t==null?0:t.length;++n<a;)if(e(t[n],n,t))return!0;return!1}function N9e(t,e){return t.has(e)}var Fan=1,Tan=2;function F9e(t,e,n,a,r,i){var o=n&Fan,s=t.length,A=e.length;if(s!=A&&!(o&&A>s))return!1;var l=i.get(t),u=i.get(e);if(l&&u)return l==e&&u==t;var d=-1,p=!0,m=n&Tan?new Ek:void 0;for(i.set(t,e),i.set(e,t);++d<s;){var g=t[d],h=e[d];if(a)var b=o?a(h,g,d,e,t,i):a(g,h,d,t,e,i);if(b!==void 0){if(b)continue;p=!1;break}if(m){if(!Nan(e,function(y,w){if(!N9e(m,w)&&(g===y||r(g,y,n,a,i)))return m.push(w)})){p=!1;break}}else if(!(g===h||r(g,h,n,a,i))){p=!1;break}}return i.delete(t),i.delete(e),p}function Ran(t){var e=-1,n=Array(t.size);return t.forEach(function(a,r){n[++e]=[r,a]}),n}function hJ(t){var e=-1,n=Array(t.size);return t.forEach(function(a){n[++e]=a}),n}var Man=1,Lan=2,Oan="[object Boolean]",Gan="[object Date]",Pan="[object Error]",qan="[object Map]",Uan="[object Number]",$an="[object RegExp]",jan="[object Set]",Han="[object String]",zan="[object Symbol]",Yan="[object ArrayBuffer]",Kan="[object DataView]",the=Dc?Dc.prototype:void 0,SP=the?the.valueOf:void 0;function Zan(t,e,n,a,r,i,o){switch(n){case Kan:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Yan:return!(t.byteLength!=e.byteLength||!i(new O3(t),new O3(e)));case Oan:case Gan:case Uan:return U1(+t,+e);case Pan:return t.name==e.name&&t.message==e.message;case $an:case Han:return t==e+"";case qan:var s=Ran;case jan:var A=a&Man;if(s||(s=hJ),t.size!=e.size&&!A)return!1;var l=o.get(t);if(l)return l==e;a|=Lan,o.set(t,e);var u=F9e(s(t),s(e),a,r,i,o);return o.delete(t),u;case zan:if(SP)return SP.call(t)==SP.call(e)}return!1}var Wan=1,Van=Object.prototype,Jan=Van.hasOwnProperty;function Xan(t,e,n,a,r,i){var o=n&Wan,s=dz(t),A=s.length,l=dz(e),u=l.length;if(A!=u&&!o)return!1;for(var d=A;d--;){var p=s[d];if(!(o?p in e:Jan.call(e,p)))return!1}var m=i.get(t),g=i.get(e);if(m&&g)return m==e&&g==t;var h=!0;i.set(t,e),i.set(e,t);for(var b=o;++d<A;){p=s[d];var y=t[p],w=e[p];if(a)var E=o?a(w,y,p,e,t,i):a(y,w,p,t,e,i);if(!(E===void 0?y===w||r(y,w,n,a,i):E)){h=!1;break}b||(b=p=="constructor")}if(h&&!b){var k=t.constructor,v=e.constructor;k!=v&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof v=="function"&&v instanceof v)&&(h=!1)}return i.delete(t),i.delete(e),h}var ern=1,nhe="[object Arguments]",ahe="[object Array]",R_="[object Object]",trn=Object.prototype,rhe=trn.hasOwnProperty;function nrn(t,e,n,a,r,i){var o=Ci(t),s=Ci(e),A=o?ahe:lc(t),l=s?ahe:lc(e);A=A==nhe?R_:A,l=l==nhe?R_:l;var u=A==R_,d=l==R_,p=A==l;if(p&&H2(t)){if(!H2(e))return!1;o=!0,u=!1}if(p&&!u)return i||(i=new rl),o||U6(t)?F9e(t,e,n,a,r,i):Zan(t,e,A,n,a,r,i);if(!(n&ern)){var m=u&&rhe.call(t,"__wrapped__"),g=d&&rhe.call(e,"__wrapped__");if(m||g){var h=m?t.value():t,b=g?e.value():e;return i||(i=new rl),r(h,b,n,a,i)}}return p?(i||(i=new rl),Xan(t,e,n,a,r,i)):!1}function bJ(t,e,n,a,r){return t===e?!0:t==null||e==null||!yu(t)&&!yu(e)?t!==t&&e!==e:nrn(t,e,n,a,bJ,r)}var arn=1,rrn=2;function irn(t,e,n,a){var r=n.length,i=r;if(t==null)return!i;for(t=Object(t);r--;){var o=n[r];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++r<i;){o=n[r];var s=o[0],A=t[s],l=o[1];if(o[2]){if(A===void 0&&!(s in t))return!1}else{var u=new rl,d;if(!(d===void 0?bJ(l,A,arn|rrn,a,u):d))return!1}}return!0}function T9e(t){return t===t&&!RA(t)}function orn(t){for(var e=QA(t),n=e.length;n--;){var a=e[n],r=t[a];e[n]=[a,r,T9e(r)]}return e}function R9e(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function srn(t){var e=orn(t);return e.length==1&&e[0][2]?R9e(e[0][0],e[0][1]):function(n){return n===t||irn(n,t,e)}}function Arn(t,e){return t!=null&&e in Object(t)}function M9e(t,e,n){e=t5(e,t);for(var a=-1,r=e.length,i=!1;++a<r;){var o=jv(e[a]);if(!(i=t!=null&&n(t,o)))break;t=t[o]}return i||++a!=r?i:(r=t==null?0:t.length,!!r&&WV(r)&&j6(o,r)&&(Ci(t)||j2(t)))}function L9e(t,e){return t!=null&&M9e(t,e,Arn)}var crn=1,lrn=2;function urn(t,e){return mJ(t)&&T9e(e)?R9e(jv(t),e):function(n){var a=Ann(n,t);return a===void 0&&a===e?L9e(n,t):bJ(e,a,crn|lrn)}}function drn(t){return function(e){return e?.[t]}}function prn(t){return function(e){return n5(e,t)}}function mrn(t){return mJ(t)?drn(jv(t)):prn(t)}function pp(t){return typeof t=="function"?t:t==null?K0:typeof t=="object"?Ci(t)?urn(t[0],t[1]):srn(t):mrn(t)}function yJ(t,e){return t&&YV(t,e,QA)}function grn(t,e){return function(n,a){if(n==null)return n;if(!pg(n))return t(n,a);for(var r=n.length,i=-1,o=Object(n);++i<r&&a(o[i],i,o)!==!1;);return n}}var r5=grn(yJ),O9e=Object.prototype,frn=O9e.hasOwnProperty,hrn=H6(function(t,e){t=Object(t);var n=-1,a=e.length,r=a>2?e[2]:void 0;for(r&&hk(e[0],e[1],r)&&(a=1);++n<a;)for(var i=e[n],o=Y0(i),s=-1,A=o.length;++s<A;){var l=o[s],u=t[l];(u===void 0||U1(u,O9e[l])&&!frn.call(t,l))&&(t[l]=i[l])}return t});function Z3(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function CJ(t){return typeof t=="function"?t:K0}function Dt(t,e){var n=Ci(t)?w9e:r5;return n(t,CJ(e))}function brn(t,e){var n=[];return r5(t,function(a,r,i){e(a,r,i)&&n.push(a)}),n}function iu(t,e){var n=Ci(t)?k9e:brn;return n(t,pp(e))}function yrn(t){return function(e,n,a){var r=Object(e);if(!pg(e)){var i=pp(n);e=QA(e),n=function(s){return i(r[s],s,r)}}var o=t(e,n,a);return o>-1?r[i?e[o]:o]:void 0}}var Crn=Math.max;function wrn(t,e,n){var a=t==null?0:t.length;if(!a)return-1;var r=n==null?0:Ztn(n);return r<0&&(r=Crn(a+r,0)),E9e(t,pp(e),r)}var wJ=yrn(wrn);function G9e(t,e){var n=-1,a=pg(t)?Array(t.length):[];return r5(t,function(r,i,o){a[++n]=e(r,i,o)}),a}function Wa(t,e){var n=Ci(t)?dy:G9e;return n(t,pp(e))}function Ern(t,e){return a5(Wa(t,e))}function Brn(t,e){return t==null?t:YV(t,CJ(e),Y0)}function krn(t,e){return t&&yJ(t,CJ(e))}function vrn(t,e){return t>e}var Irn=Object.prototype,Qrn=Irn.hasOwnProperty;function _rn(t,e){return t!=null&&Qrn.call(t,e)}function P9e(t,e){return t!=null&&M9e(t,e,_rn)}function xrn(t,e){return dy(e,function(n){return t[n]})}function Ud(t){return t==null?[]:xrn(t,QA(t))}function ri(t){return t===void 0}function q9e(t,e){return t<e}function i5(t,e){var n={};return e=pp(e),yJ(t,function(a,r,i){G6(n,r,e(a,r,i))}),n}function EJ(t,e,n){for(var a=-1,r=t.length;++a<r;){var i=t[a],o=e(i);if(o!=null&&(s===void 0?o===o&&!m0(o):n(o,s)))var s=o,A=i}return A}function g0(t){return t&&t.length?EJ(t,K0,vrn):void 0}function Z2(t){return t&&t.length?EJ(t,K0,q9e):void 0}function BJ(t,e){return t&&t.length?EJ(t,pp(e),q9e):void 0}function Drn(t,e,n,a){if(!RA(t))return t;e=t5(e,t);for(var r=-1,i=e.length,o=i-1,s=t;s!=null&&++r<i;){var A=jv(e[r]),l=n;if(A==="__proto__"||A==="constructor"||A==="prototype")return t;if(r!=o){var u=s[A];l=void 0,l===void 0&&(l=RA(u)?u:j6(e[r+1])?[]:{})}$6(s,A,l),s=s[A]}return t}function Srn(t,e,n){for(var a=-1,r=e.length,i={};++a<r;){var o=e[a],s=n5(t,o);n(s,o)&&Drn(i,t5(o,t),s)}return i}function Nrn(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}function Frn(t,e){if(t!==e){var n=t!==void 0,a=t===null,r=t===t,i=m0(t),o=e!==void 0,s=e===null,A=e===e,l=m0(e);if(!s&&!l&&!i&&t>e||i&&o&&A&&!s&&!l||a&&o&&A||!n&&A||!r)return 1;if(!a&&!i&&!l&&t<e||l&&n&&r&&!a&&!i||s&&n&&r||!o&&r||!A)return-1}return 0}function Trn(t,e,n){for(var a=-1,r=t.criteria,i=e.criteria,o=r.length,s=n.length;++a<o;){var A=Frn(r[a],i[a]);if(A){if(a>=s)return A;var l=n[a];return A*(l=="desc"?-1:1)}}return t.index-e.index}function Rrn(t,e,n){e.length?e=dy(e,function(i){return Ci(i)?function(o){return n5(o,i.length===1?i[0]:i)}:i}):e=[K0];var a=-1;e=dy(e,q6(pp));var r=G9e(t,function(i,o,s){var A=dy(e,function(l){return l(i)});return{criteria:A,index:++a,value:i}});return Nrn(r,function(i,o){return Trn(i,o,n)})}function Mrn(t,e){return Srn(t,e,function(n,a){return L9e(t,a)})}var W3=lnn(function(t,e){return t==null?{}:Mrn(t,e)}),Lrn=Math.ceil,Orn=Math.max;function Grn(t,e,n,a){for(var r=-1,i=Orn(Lrn((e-t)/(n||1)),0),o=Array(i);i--;)o[++r]=t,t+=n;return o}function Prn(t){return function(e,n,a){return a&&typeof a!="number"&&hk(e,n,a)&&(n=a=void 0),e=l4(e),n===void 0?(n=e,e=0):n=l4(n),a=a===void 0?e<n?1:-1:l4(a),Grn(e,n,a)}}var W2=Prn();function qrn(t,e,n,a,r){return r(t,function(i,o,s){n=a?(a=!1,i):e(n,i,o,s)}),n}function f0(t,e,n){var a=Ci(t)?unn:qrn,r=arguments.length<3;return a(t,pp(e),n,r,r5)}var Hv=H6(function(t,e){if(t==null)return[];var n=e.length;return n>1&&hk(t,e[0],e[1])?e=[]:n>2&&hk(e[0],e[1],e[2])&&(e=[e[0]]),Rrn(t,a5(e),[])}),Urn=1/0,$rn=uy&&1/hJ(new uy([,-0]))[1]==Urn?function(t){return new uy(t)}:Wtn,jrn=200;function U9e(t,e,n){var a=-1,r=enn,i=t.length,o=!0,s=[],A=s;if(i>=jrn){var l=e?null:$rn(t);if(l)return hJ(l);o=!1,r=N9e,A=new Ek}else A=e?[]:s;e:for(;++a<i;){var u=t[a],d=e?e(u):u;if(u=u!==0?u:0,o&&d===d){for(var p=A.length;p--;)if(A[p]===d)continue e;e&&A.push(d),s.push(u)}else r(A,d,n)||(A!==s&&A.push(d),s.push(u))}return s}var Hrn=H6(function(t){return U9e(a5(t,1,ANe,!0))});function zrn(t,e){return t&&t.length?U9e(t,pp(e)):[]}var Yrn=0;function kJ(t){var e=++Yrn;return B9e(t)+e}function Krn(t,e,n){for(var a=-1,r=t.length,i=e.length,o={};++a<r;){var s=a<i?e[a]:void 0;n(o,t[a],s)}return o}function Zrn(t,e){return Krn(t||[],e||[],$6)}var Wrn="\0",rf="\0",ihe="";class AA{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=$b(void 0),this._defaultEdgeLabelFn=$b(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[rf]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return mk(e)||(e=$b(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return QA(this._nodes)}sources(){var e=this;return iu(this.nodes(),function(n){return wk(e._in[n])})}sinks(){var e=this;return iu(this.nodes(),function(n){return wk(e._out[n])})}setNodes(e,n){var a=arguments,r=this;return Dt(e,function(i){a.length>1?r.setNode(i,n):r.setNode(i)}),this}setNode(e,n){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=rf,this._children[e]={},this._children[rf][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var n=a=>this.removeEdge(this._edgeObjs[a]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Dt(this.children(e),a=>{this.setParent(a)}),delete this._children[e]),Dt(QA(this._in[e]),n),delete this._in[e],delete this._preds[e],Dt(QA(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ri(n))n=rf;else{n+="";for(var a=n;!ri(a);a=this.parent(a))if(a===e)throw new Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var n=this._parent[e];if(n!==rf)return n}}children(e){if(ri(e)&&(e=rf),this._isCompound){var n=this._children[e];if(n)return QA(n)}else{if(e===rf)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var n=this._preds[e];if(n)return QA(n)}successors(e){var n=this._sucs[e];if(n)return QA(n)}neighbors(e){var n=this.predecessors(e);if(n)return Hrn(n,this.successors(e))}isLeaf(e){var n;return this.isDirected()?n=this.successors(e):n=this.neighbors(e),n.length===0}filterNodes(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var a=this;Dt(this._nodes,function(o,s){e(s)&&n.setNode(s,o)}),Dt(this._edgeObjs,function(o){n.hasNode(o.v)&&n.hasNode(o.w)&&n.setEdge(o,a.edge(o))});var r={};function i(o){var s=a.parent(o);return s===void 0||n.hasNode(s)?(r[o]=s,s):s in r?r[s]:i(s)}return this._isCompound&&Dt(n.nodes(),function(o){n.setParent(o,i(o))}),n}setDefaultEdgeLabel(e){return mk(e)||(e=$b(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Ud(this._edgeObjs)}setPath(e,n){var a=this,r=arguments;return f0(e,function(i,o){return r.length>1?a.setEdge(i,o,n):a.setEdge(i,o),o}),this}setEdge(){var e,n,a,r,i=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,n=o.w,a=o.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=o,n=arguments[1],a=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=""+e,n=""+n,ri(a)||(a=""+a);var s=tE(this._isDirected,e,n,a);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return i&&(this._edgeLabels[s]=r),this;if(!ri(a)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(n),this._edgeLabels[s]=i?r:this._defaultEdgeLabelFn(e,n,a);var A=Vrn(this._isDirected,e,n,a);return e=A.v,n=A.w,Object.freeze(A),this._edgeObjs[s]=A,ohe(this._preds[n],e),ohe(this._sucs[e],n),this._in[n][s]=A,this._out[e][s]=A,this._edgeCount++,this}edge(e,n,a){var r=arguments.length===1?NP(this._isDirected,arguments[0]):tE(this._isDirected,e,n,a);return this._edgeLabels[r]}hasEdge(e,n,a){var r=arguments.length===1?NP(this._isDirected,arguments[0]):tE(this._isDirected,e,n,a);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,n,a){var r=arguments.length===1?NP(this._isDirected,arguments[0]):tE(this._isDirected,e,n,a),i=this._edgeObjs[r];return i&&(e=i.v,n=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],she(this._preds[n],e),she(this._sucs[e],n),delete this._in[n][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,n){var a=this._in[e];if(a){var r=Ud(a);return n?iu(r,function(i){return i.v===n}):r}}outEdges(e,n){var a=this._out[e];if(a){var r=Ud(a);return n?iu(r,function(i){return i.w===n}):r}}nodeEdges(e,n){var a=this.inEdges(e,n);if(a)return a.concat(this.outEdges(e,n))}}AA.prototype._nodeCount=0;AA.prototype._edgeCount=0;function ohe(t,e){t[e]?t[e]++:t[e]=1}function she(t,e){--t[e]||delete t[e]}function tE(t,e,n,a){var r=""+e,i=""+n;if(!t&&r>i){var o=r;r=i,i=o}return r+ihe+i+ihe+(ri(a)?Wrn:a)}function Vrn(t,e,n,a){var r=""+e,i=""+n;if(!t&&r>i){var o=r;r=i,i=o}var s={v:r,w:i};return a&&(s.name=a),s}function NP(t,e){return tE(t,e.v,e.w,e.name)}class Jrn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return Ahe(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&Ahe(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,a=n._prev;a!==n;)e.push(JSON.stringify(a,Xrn)),a=a._prev;return"["+e.join(", ")+"]"}}function Ahe(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Xrn(t,e){if(t!=="_next"&&t!=="_prev")return e}var ein=$b(1);function tin(t,e){if(t.nodeCount()<=1)return[];var n=ain(t,e||ein),a=nin(n.graph,n.buckets,n.zeroIdx);return W0(Wa(a,function(r){return t.outEdges(r.v,r.w)}))}function nin(t,e,n){for(var a=[],r=e[e.length-1],i=e[0],o;t.nodeCount();){for(;o=i.dequeue();)FP(t,e,n,o);for(;o=r.dequeue();)FP(t,e,n,o);if(t.nodeCount()){for(var s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){a=a.concat(FP(t,e,n,o,!0));break}}}return a}function FP(t,e,n,a,r){var i=r?[]:void 0;return Dt(t.inEdges(a.v),function(o){var s=t.edge(o),A=t.node(o.v);r&&i.push({v:o.v,w:o.w}),A.out-=s,pz(e,n,A)}),Dt(t.outEdges(a.v),function(o){var s=t.edge(o),A=o.w,l=t.node(A);l.in-=s,pz(e,n,l)}),t.removeNode(a.v),i}function ain(t,e){var n=new AA,a=0,r=0;Dt(t.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),Dt(t.edges(),function(s){var A=n.edge(s.v,s.w)||0,l=e(s),u=A+l;n.setEdge(s.v,s.w,u),r=Math.max(r,n.node(s.v).out+=l),a=Math.max(a,n.node(s.w).in+=l)});var i=W2(r+a+3).map(function(){return new Jrn}),o=a+1;return Dt(n.nodes(),function(s){pz(i,o,n.node(s))}),{graph:n,buckets:i,zeroIdx:o}}function pz(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}function rin(t){var e=t.graph().acyclicer==="greedy"?tin(t,n(t)):iin(t);Dt(e,function(a){var r=t.edge(a);t.removeEdge(a),r.forwardName=a.name,r.reversed=!0,t.setEdge(a.w,a.v,r,kJ("rev"))});function n(a){return function(r){return a.edge(r).weight}}}function iin(t){var e=[],n={},a={};function r(i){Object.prototype.hasOwnProperty.call(a,i)||(a[i]=!0,n[i]=!0,Dt(t.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(n,o.w)?e.push(o):r(o.w)}),delete n[i])}return Dt(t.nodes(),r),e}function oin(t){Dt(t.edges(),function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var a=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,a)}})}function Y1(t,e,n,a){var r;do r=kJ(a);while(t.hasNode(r));return n.dummy=e,t.setNode(r,n),r}function sin(t){var e=new AA().setGraph(t.graph());return Dt(t.nodes(),function(n){e.setNode(n,t.node(n))}),Dt(t.edges(),function(n){var a=e.edge(n.v,n.w)||{weight:0,minlen:1},r=t.edge(n);e.setEdge(n.v,n.w,{weight:a.weight+r.weight,minlen:Math.max(a.minlen,r.minlen)})}),e}function $9e(t){var e=new AA({multigraph:t.isMultigraph()}).setGraph(t.graph());return Dt(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),Dt(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function che(t,e){var n=t.x,a=t.y,r=e.x-n,i=e.y-a,o=t.width/2,s=t.height/2;if(!r&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var A,l;return Math.abs(i)*o>Math.abs(r)*s?(i<0&&(s=-s),A=s*r/i,l=s):(r<0&&(o=-o),A=o,l=o*i/r),{x:n+A,y:a+l}}function o5(t){var e=Wa(W2(j9e(t)+1),function(){return[]});return Dt(t.nodes(),function(n){var a=t.node(n),r=a.rank;ri(r)||(e[r][a.order]=n)}),e}function Ain(t){var e=Z2(Wa(t.nodes(),function(n){return t.node(n).rank}));Dt(t.nodes(),function(n){var a=t.node(n);P9e(a,"rank")&&(a.rank-=e)})}function cin(t){var e=Z2(Wa(t.nodes(),function(i){return t.node(i).rank})),n=[];Dt(t.nodes(),function(i){var o=t.node(i).rank-e;n[o]||(n[o]=[]),n[o].push(i)});var a=0,r=t.graph().nodeRankFactor;Dt(n,function(i,o){ri(i)&&o%r!==0?--a:a&&Dt(i,function(s){t.node(s).rank+=a})})}function lhe(t,e,n,a){var r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=a),Y1(t,"border",r,e)}function j9e(t){return g0(Wa(t.nodes(),function(e){var n=t.node(e).rank;if(!ri(n))return n}))}function lin(t,e){var n={lhs:[],rhs:[]};return Dt(t,function(a){e(a)?n.lhs.push(a):n.rhs.push(a)}),n}function uin(t,e){return e()}function din(t){function e(n){var a=t.children(n),r=t.node(n);if(a.length&&Dt(a,e),Object.prototype.hasOwnProperty.call(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(var i=r.minRank,o=r.maxRank+1;i<o;++i)uhe(t,"borderLeft","_bl",n,r,i),uhe(t,"borderRight","_br",n,r,i)}}Dt(t.children(),e)}function uhe(t,e,n,a,r,i){var o={width:0,height:0,rank:i,borderType:e},s=r[e][i-1],A=Y1(t,"border",o,n);r[e][i]=A,t.setParent(A,a),s&&t.setEdge(s,A,{weight:1})}function pin(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&H9e(t)}function min(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&gin(t),(e==="lr"||e==="rl")&&(fin(t),H9e(t))}function H9e(t){Dt(t.nodes(),function(e){dhe(t.node(e))}),Dt(t.edges(),function(e){dhe(t.edge(e))})}function dhe(t){var e=t.width;t.width=t.height,t.height=e}function gin(t){Dt(t.nodes(),function(e){TP(t.node(e))}),Dt(t.edges(),function(e){var n=t.edge(e);Dt(n.points,TP),Object.prototype.hasOwnProperty.call(n,"y")&&TP(n)})}function TP(t){t.y=-t.y}function fin(t){Dt(t.nodes(),function(e){RP(t.node(e))}),Dt(t.edges(),function(e){var n=t.edge(e);Dt(n.points,RP),Object.prototype.hasOwnProperty.call(n,"x")&&RP(n)})}function RP(t){var e=t.x;t.x=t.y,t.y=e}function hin(t){t.graph().dummyChains=[],Dt(t.edges(),function(e){bin(t,e)})}function bin(t,e){var n=e.v,a=t.node(n).rank,r=e.w,i=t.node(r).rank,o=e.name,s=t.edge(e),A=s.labelRank;if(i!==a+1){t.removeEdge(e);var l=void 0,u,d;for(d=0,++a;a<i;++d,++a)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:e,rank:a},u=Y1(t,"edge",l,"_d"),a===A&&(l.width=s.width,l.height=s.height,l.dummy="edge-label",l.labelpos=s.labelpos),t.setEdge(n,u,{weight:s.weight},o),d===0&&t.graph().dummyChains.push(u),n=u;t.setEdge(n,r,{weight:s.weight},o)}}function yin(t){Dt(t.graph().dummyChains,function(e){var n=t.node(e),a=n.edgeLabel,r;for(t.setEdge(n.edgeObj,a);n.dummy;)r=t.successors(e)[0],t.removeNode(e),a.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(a.x=n.x,a.y=n.y,a.width=n.width,a.height=n.height),e=r,n=t.node(e)})}function vJ(t){var e={};function n(a){var r=t.node(a);if(Object.prototype.hasOwnProperty.call(e,a))return r.rank;e[a]=!0;var i=Z2(Wa(t.outEdges(a),function(o){return n(o.w)-t.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),r.rank=i}Dt(t.sources(),n)}function Bk(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function z9e(t){var e=new AA({directed:!1}),n=t.nodes()[0],a=t.nodeCount();e.setNode(n,{});for(var r,i;Cin(e,t)<a;)r=win(e,t),i=e.hasNode(r.v)?Bk(t,r):-Bk(t,r),Ein(e,t,i);return e}function Cin(t,e){function n(a){Dt(e.nodeEdges(a),function(r){var i=r.v,o=a===i?r.w:i;!t.hasNode(o)&&!Bk(e,r)&&(t.setNode(o,{}),t.setEdge(a,o,{}),n(o))})}return Dt(t.nodes(),n),t.nodeCount()}function win(t,e){return BJ(e.edges(),function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Bk(e,n)})}function Ein(t,e,n){Dt(t.nodes(),function(a){e.node(a).rank+=n})}function Bin(){}Bin.prototype=new Error;function Y9e(t,e,n){Ci(e)||(e=[e]);var a=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],i={};return Dt(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);K9e(t,o,n==="post",i,a,r)}),r}function K9e(t,e,n,a,r,i){Object.prototype.hasOwnProperty.call(a,e)||(a[e]=!0,n||i.push(e),Dt(r(e),function(o){K9e(t,o,n,a,r,i)}),n&&i.push(e))}function kin(t,e){return Y9e(t,e,"post")}function vin(t,e){return Y9e(t,e,"pre")}V0.initLowLimValues=QJ;V0.initCutValues=IJ;V0.calcCutValue=Z9e;V0.leaveEdge=V9e;V0.enterEdge=J9e;V0.exchangeEdges=X9e;function V0(t){t=sin(t),vJ(t);var e=z9e(t);QJ(e),IJ(e,t);for(var n,a;n=V9e(e);)a=J9e(e,t,n),X9e(e,t,n,a)}function IJ(t,e){var n=kin(t,t.nodes());n=n.slice(0,n.length-1),Dt(n,function(a){Iin(t,e,a)})}function Iin(t,e,n){var a=t.node(n),r=a.parent;t.edge(n,r).cutvalue=Z9e(t,e,n)}function Z9e(t,e,n){var a=t.node(n),r=a.parent,i=!0,o=e.edge(n,r),s=0;return o||(i=!1,o=e.edge(r,n)),s=o.weight,Dt(e.nodeEdges(n),function(A){var l=A.v===n,u=l?A.w:A.v;if(u!==r){var d=l===i,p=e.edge(A).weight;if(s+=d?p:-p,_in(t,n,u)){var m=t.edge(n,u).cutvalue;s+=d?-m:m}}}),s}function QJ(t,e){arguments.length<2&&(e=t.nodes()[0]),W9e(t,{},1,e)}function W9e(t,e,n,a,r){var i=n,o=t.node(a);return e[a]=!0,Dt(t.neighbors(a),function(s){Object.prototype.hasOwnProperty.call(e,s)||(n=W9e(t,e,n,s,a))}),o.low=i,o.lim=n++,r?o.parent=r:delete o.parent,n}function V9e(t){return wJ(t.edges(),function(e){return t.edge(e).cutvalue<0})}function J9e(t,e,n){var a=n.v,r=n.w;e.hasEdge(a,r)||(a=n.w,r=n.v);var i=t.node(a),o=t.node(r),s=i,A=!1;i.lim>o.lim&&(s=o,A=!0);var l=iu(e.edges(),function(u){return A===phe(t,t.node(u.v),s)&&A!==phe(t,t.node(u.w),s)});return BJ(l,function(u){return Bk(e,u)})}function X9e(t,e,n,a){var r=n.v,i=n.w;t.removeEdge(r,i),t.setEdge(a.v,a.w,{}),QJ(t),IJ(t,e),Qin(t,e)}function Qin(t,e){var n=wJ(t.nodes(),function(r){return!e.node(r).parent}),a=vin(t,n);a=a.slice(1),Dt(a,function(r){var i=t.node(r).parent,o=e.edge(r,i),s=!1;o||(o=e.edge(i,r),s=!0),e.node(r).rank=e.node(i).rank+(s?o.minlen:-o.minlen)})}function _in(t,e,n){return t.hasEdge(e,n)}function phe(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}function xin(t){switch(t.graph().ranker){case"network-simplex":mhe(t);break;case"tight-tree":Sin(t);break;case"longest-path":Din(t);break;default:mhe(t)}}var Din=vJ;function Sin(t){vJ(t),z9e(t)}function mhe(t){V0(t)}function Nin(t){var e=Y1(t,"root",{},"_root"),n=Fin(t),a=g0(Ud(n))-1,r=2*a+1;t.graph().nestingRoot=e,Dt(t.edges(),function(o){t.edge(o).minlen*=r});var i=Tin(t)+1;Dt(t.children(),function(o){eRe(t,e,r,i,a,n,o)}),t.graph().nodeRankFactor=r}function eRe(t,e,n,a,r,i,o){var s=t.children(o);if(!s.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:n});return}var A=lhe(t,"_bt"),l=lhe(t,"_bb"),u=t.node(o);t.setParent(A,o),u.borderTop=A,t.setParent(l,o),u.borderBottom=l,Dt(s,function(d){eRe(t,e,n,a,r,i,d);var p=t.node(d),m=p.borderTop?p.borderTop:d,g=p.borderBottom?p.borderBottom:d,h=p.borderTop?a:2*a,b=m!==g?1:r-i[o]+1;t.setEdge(A,m,{weight:h,minlen:b,nestingEdge:!0}),t.setEdge(g,l,{weight:h,minlen:b,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,A,{weight:0,minlen:r+i[o]})}function Fin(t){var e={};function n(a,r){var i=t.children(a);i&&i.length&&Dt(i,function(o){n(o,r+1)}),e[a]=r}return Dt(t.children(),function(a){n(a,1)}),e}function Tin(t){return f0(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function Rin(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Dt(t.edges(),function(n){var a=t.edge(n);a.nestingEdge&&t.removeEdge(n)})}function Min(t,e,n){var a={},r;Dt(n,function(i){for(var o=t.parent(i),s,A;o;){if(s=t.parent(o),s?(A=a[s],a[s]=o):(A=r,r=o),A&&A!==o){e.setEdge(A,o);return}o=s}})}function Lin(t,e,n){var a=Oin(t),r=new AA({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(i){return t.node(i)});return Dt(t.nodes(),function(i){var o=t.node(i),s=t.parent(i);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(r.setNode(i),r.setParent(i,s||a),Dt(t[n](i),function(A){var l=A.v===i?A.w:A.v,u=r.edge(l,i),d=ri(u)?0:u.weight;r.setEdge(l,i,{weight:t.edge(A).weight+d})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&r.setNode(i,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),r}function Oin(t){for(var e;t.hasNode(e=kJ("_root")););return e}function Gin(t,e){for(var n=0,a=1;a<e.length;++a)n+=Pin(t,e[a-1],e[a]);return n}function Pin(t,e,n){for(var a=Zrn(n,Wa(n,function(l,u){return u})),r=W0(Wa(e,function(l){return Hv(Wa(t.outEdges(l),function(u){return{pos:a[u.w],weight:t.edge(u).weight}}),"pos")})),i=1;i<n.length;)i<<=1;var o=2*i-1;i-=1;var s=Wa(new Array(o),function(){return 0}),A=0;return Dt(r.forEach(function(l){var u=l.pos+i;s[u]+=l.weight;for(var d=0;u>0;)u%2&&(d+=s[u+1]),u=u-1>>1,s[u]+=l.weight;A+=l.weight*d})),A}function qin(t){var e={},n=iu(t.nodes(),function(s){return!t.children(s).length}),a=g0(Wa(n,function(s){return t.node(s).rank})),r=Wa(W2(a+1),function(){return[]});function i(s){if(!P9e(e,s)){e[s]=!0;var A=t.node(s);r[A.rank].push(s),Dt(t.successors(s),i)}}var o=Hv(n,function(s){return t.node(s).rank});return Dt(o,i),r}function Uin(t,e){return Wa(e,function(n){var a=t.inEdges(n);if(a.length){var r=f0(a,function(i,o){var s=t.edge(o),A=t.node(o.v);return{sum:i.sum+s.weight*A.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:n}})}function $in(t,e){var n={};Dt(t,function(r,i){var o=n[r.v]={indegree:0,in:[],out:[],vs:[r.v],i};ri(r.barycenter)||(o.barycenter=r.barycenter,o.weight=r.weight)}),Dt(e.edges(),function(r){var i=n[r.v],o=n[r.w];!ri(i)&&!ri(o)&&(o.indegree++,i.out.push(n[r.w]))});var a=iu(n,function(r){return!r.indegree});return jin(a)}function jin(t){var e=[];function n(i){return function(o){o.merged||(ri(o.barycenter)||ri(i.barycenter)||o.barycenter>=i.barycenter)&&Hin(i,o)}}function a(i){return function(o){o.in.push(i),--o.indegree===0&&t.push(o)}}for(;t.length;){var r=t.pop();e.push(r),Dt(r.in.reverse(),n(r)),Dt(r.out,a(r))}return Wa(iu(e,function(i){return!i.merged}),function(i){return W3(i,["vs","i","barycenter","weight"])})}function Hin(t,e){var n=0,a=0;t.weight&&(n+=t.barycenter*t.weight,a+=t.weight),e.weight&&(n+=e.barycenter*e.weight,a+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/a,t.weight=a,t.i=Math.min(e.i,t.i),e.merged=!0}function zin(t,e){var n=lin(t,function(u){return Object.prototype.hasOwnProperty.call(u,"barycenter")}),a=n.lhs,r=Hv(n.rhs,function(u){return-u.i}),i=[],o=0,s=0,A=0;a.sort(Yin(!!e)),A=ghe(i,r,A),Dt(a,function(u){A+=u.vs.length,i.push(u.vs),o+=u.barycenter*u.weight,s+=u.weight,A=ghe(i,r,A)});var l={vs:W0(i)};return s&&(l.barycenter=o/s,l.weight=s),l}function ghe(t,e,n){for(var a;e.length&&(a=Z3(e)).i<=n;)e.pop(),t.push(a.vs),n++;return n}function Yin(t){return function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i}}function tRe(t,e,n,a){var r=t.children(e),i=t.node(e),o=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,A={};o&&(r=iu(r,function(g){return g!==o&&g!==s}));var l=Uin(t,r);Dt(l,function(g){if(t.children(g.v).length){var h=tRe(t,g.v,n,a);A[g.v]=h,Object.prototype.hasOwnProperty.call(h,"barycenter")&&Zin(g,h)}});var u=$in(l,n);Kin(u,A);var d=zin(u,a);if(o&&(d.vs=W0([o,d.vs,s]),t.predecessors(o).length)){var p=t.node(t.predecessors(o)[0]),m=t.node(t.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+p.order+m.order)/(d.weight+2),d.weight+=2}return d}function Kin(t,e){Dt(t,function(n){n.vs=W0(n.vs.map(function(a){return e[a]?e[a].vs:a}))})}function Zin(t,e){ri(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function Win(t){var e=j9e(t),n=fhe(t,W2(1,e+1),"inEdges"),a=fhe(t,W2(e-1,-1,-1),"outEdges"),r=qin(t);hhe(t,r);for(var i=Number.POSITIVE_INFINITY,o,s=0,A=0;A<4;++s,++A){Vin(s%2?n:a,s%4>=2),r=o5(t);var l=Gin(t,r);l<i&&(A=0,o=_an(r),i=l)}hhe(t,o)}function fhe(t,e,n){return Wa(e,function(a){return Lin(t,a,n)})}function Vin(t,e){var n=new AA;Dt(t,function(a){var r=a.graph().root,i=tRe(a,r,n,e);Dt(i.vs,function(o,s){a.node(o).order=s}),Min(a,n,i.vs)})}function hhe(t,e){Dt(e,function(n){Dt(n,function(a,r){t.node(a).order=r})})}function Jin(t){var e=eon(t);Dt(t.graph().dummyChains,function(n){for(var a=t.node(n),r=a.edgeObj,i=Xin(t,e,r.v,r.w),o=i.path,s=i.lca,A=0,l=o[A],u=!0;n!==r.w;){if(a=t.node(n),u){for(;(l=o[A])!==s&&t.node(l).maxRank<a.rank;)A++;l===s&&(u=!1)}if(!u){for(;A<o.length-1&&t.node(l=o[A+1]).minRank<=a.rank;)A++;l=o[A]}t.setParent(n,l),n=t.successors(n)[0]}})}function Xin(t,e,n,a){var r=[],i=[],o=Math.min(e[n].low,e[a].low),s=Math.max(e[n].lim,e[a].lim),A,l;A=n;do A=t.parent(A),r.push(A);while(A&&(e[A].low>o||s>e[A].lim));for(l=A,A=a;(A=t.parent(A))!==l;)i.push(A);return{path:r.concat(i.reverse()),lca:l}}function eon(t){var e={},n=0;function a(r){var i=n;Dt(t.children(r),a),e[r]={low:i,lim:n++}}return Dt(t.children(),a),e}function ton(t,e){var n={};function a(r,i){var o=0,s=0,A=r.length,l=Z3(i);return Dt(i,function(u,d){var p=aon(t,u),m=p?t.node(p).order:A;(p||u===l)&&(Dt(i.slice(s,d+1),function(g){Dt(t.predecessors(g),function(h){var b=t.node(h),y=b.order;(y<o||m<y)&&!(b.dummy&&t.node(g).dummy)&&nRe(n,h,g)})}),s=d+1,o=m)}),i}return f0(e,a),n}function non(t,e){var n={};function a(i,o,s,A,l){var u;Dt(W2(o,s),function(d){u=i[d],t.node(u).dummy&&Dt(t.predecessors(u),function(p){var m=t.node(p);m.dummy&&(m.order<A||m.order>l)&&nRe(n,p,u)})})}function r(i,o){var s=-1,A,l=0;return Dt(o,function(u,d){if(t.node(u).dummy==="border"){var p=t.predecessors(u);p.length&&(A=t.node(p[0]).order,a(o,l,d,s,A),l=d,s=A)}a(o,l,o.length,A,i.length)}),o}return f0(e,r),n}function aon(t,e){if(t.node(e).dummy)return wJ(t.predecessors(e),function(n){return t.node(n).dummy})}function nRe(t,e,n){if(e>n){var a=e;e=n,n=a}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var r=t[e];Object.defineProperty(r,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function ron(t,e,n){if(e>n){var a=e;e=n,n=a}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],n)}function ion(t,e,n,a){var r={},i={},o={};return Dt(e,function(s){Dt(s,function(A,l){r[A]=A,i[A]=A,o[A]=l})}),Dt(e,function(s){var A=-1;Dt(s,function(l){var u=a(l);if(u.length){u=Hv(u,function(h){return o[h]});for(var d=(u.length-1)/2,p=Math.floor(d),m=Math.ceil(d);p<=m;++p){var g=u[p];i[l]===l&&A<o[g]&&!ron(n,l,g)&&(i[g]=l,i[l]=r[l]=r[g],A=o[g])}}})}),{root:r,align:i}}function oon(t,e,n,a,r){var i={},o=son(t,e,n,r),s=r?"borderLeft":"borderRight";function A(d,p){for(var m=o.nodes(),g=m.pop(),h={};g;)h[g]?d(g):(h[g]=!0,m.push(g),m=m.concat(p(g))),g=m.pop()}function l(d){i[d]=o.inEdges(d).reduce(function(p,m){return Math.max(p,i[m.v]+o.edge(m))},0)}function u(d){var p=o.outEdges(d).reduce(function(g,h){return Math.min(g,i[h.w]-o.edge(h))},Number.POSITIVE_INFINITY),m=t.node(d);p!==Number.POSITIVE_INFINITY&&m.borderType!==s&&(i[d]=Math.max(i[d],p))}return A(l,o.predecessors.bind(o)),A(u,o.successors.bind(o)),Dt(a,function(d){i[d]=i[n[d]]}),i}function son(t,e,n,a){var r=new AA,i=t.graph(),o=don(i.nodesep,i.edgesep,a);return Dt(e,function(s){var A;Dt(s,function(l){var u=n[l];if(r.setNode(u),A){var d=n[A],p=r.edge(d,u);r.setEdge(d,u,Math.max(o(t,l,A),p||0))}A=l})}),r}function Aon(t,e){return BJ(Ud(e),function(n){var a=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Brn(n,function(i,o){var s=pon(t,o)/2;a=Math.max(i+s,a),r=Math.min(i-s,r)}),a-r})}function con(t,e){var n=Ud(e),a=Z2(n),r=g0(n);Dt(["u","d"],function(i){Dt(["l","r"],function(o){var s=i+o,A=t[s],l;if(A!==e){var u=Ud(A);l=o==="l"?a-Z2(u):r-g0(u),l&&(t[s]=i5(A,function(d){return d+l}))}})})}function lon(t,e){return i5(t.ul,function(n,a){if(e)return t[e.toLowerCase()][a];var r=Hv(Wa(t,a));return(r[1]+r[2])/2})}function uon(t){var e=o5(t),n=G3(ton(t,e),non(t,e)),a={},r;Dt(["u","d"],function(o){r=o==="u"?e:Ud(e).reverse(),Dt(["l","r"],function(s){s==="r"&&(r=Wa(r,function(d){return Ud(d).reverse()}));var A=(o==="u"?t.predecessors:t.successors).bind(t),l=ion(t,r,n,A),u=oon(t,r,l.root,l.align,s==="r");s==="r"&&(u=i5(u,function(d){return-d})),a[o+s]=u})});var i=Aon(t,a);return con(a,i),lon(a,t.graph().align)}function don(t,e,n){return function(a,r,i){var o=a.node(r),s=a.node(i),A=0,l;if(A+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":l=-o.width/2;break;case"r":l=o.width/2;break}if(l&&(A+=n?l:-l),l=0,A+=(o.dummy?e:t)/2,A+=(s.dummy?e:t)/2,A+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":l=s.width/2;break;case"r":l=-s.width/2;break}return l&&(A+=n?l:-l),l=0,A}}function pon(t,e){return t.node(e).width}function mon(t){t=$9e(t),gon(t),krn(uon(t),function(e,n){t.node(n).x=e})}function gon(t){var e=o5(t),n=t.graph().ranksep,a=0;Dt(e,function(r){var i=g0(Wa(r,function(o){return t.node(o).height}));Dt(r,function(o){t.node(o).y=a+i/2}),a+=i+n})}function aRe(t,e){var n=uin;n("layout",()=>{var a=n(" buildLayoutGraph",()=>Ion(t));n(" runLayout",()=>fon(a,n)),n(" updateInputGraph",()=>hon(t,a))})}function fon(t,e){e(" makeSpaceForEdgeLabels",()=>Qon(t)),e(" removeSelfEdges",()=>Mon(t)),e(" acyclic",()=>rin(t)),e(" nestingGraph.run",()=>Nin(t)),e(" rank",()=>xin($9e(t))),e(" injectEdgeLabelProxies",()=>_on(t)),e(" removeEmptyRanks",()=>cin(t)),e(" nestingGraph.cleanup",()=>Rin(t)),e(" normalizeRanks",()=>Ain(t)),e(" assignRankMinMax",()=>xon(t)),e(" removeEdgeLabelProxies",()=>Don(t)),e(" normalize.run",()=>hin(t)),e(" parentDummyChains",()=>Jin(t)),e(" addBorderSegments",()=>din(t)),e(" order",()=>Win(t)),e(" insertSelfEdges",()=>Lon(t)),e(" adjustCoordinateSystem",()=>pin(t)),e(" position",()=>mon(t)),e(" positionSelfEdges",()=>Oon(t)),e(" removeBorderNodes",()=>Ron(t)),e(" normalize.undo",()=>yin(t)),e(" fixupEdgeLabelCoords",()=>Fon(t)),e(" undoCoordinateSystem",()=>min(t)),e(" translateGraph",()=>Son(t)),e(" assignNodeIntersects",()=>Non(t)),e(" reversePoints",()=>Ton(t)),e(" acyclic.undo",()=>oin(t))}function hon(t,e){Dt(t.nodes(),function(n){var a=t.node(n),r=e.node(n);a&&(a.x=r.x,a.y=r.y,e.children(n).length&&(a.width=r.width,a.height=r.height))}),Dt(t.edges(),function(n){var a=t.edge(n),r=e.edge(n);a.points=r.points,Object.prototype.hasOwnProperty.call(r,"x")&&(a.x=r.x,a.y=r.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var bon=["nodesep","edgesep","ranksep","marginx","marginy"],yon={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Con=["acyclicer","ranker","rankdir","align"],won=["width","height"],Eon={width:0,height:0},Bon=["minlen","weight","width","height","labeloffset"],kon={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},von=["labelpos"];function Ion(t){var e=new AA({multigraph:!0,compound:!0}),n=LP(t.graph());return e.setGraph(G3({},yon,MP(n,bon),W3(n,Con))),Dt(t.nodes(),function(a){var r=LP(t.node(a));e.setNode(a,hrn(MP(r,won),Eon)),e.setParent(a,t.parent(a))}),Dt(t.edges(),function(a){var r=LP(t.edge(a));e.setEdge(a,G3({},kon,MP(r,Bon),W3(r,von)))}),e}function Qon(t){var e=t.graph();e.ranksep/=2,Dt(t.edges(),function(n){var a=t.edge(n);a.minlen*=2,a.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?a.width+=a.labeloffset:a.height+=a.labeloffset)})}function _on(t){Dt(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var a=t.node(e.v),r=t.node(e.w),i={rank:(r.rank-a.rank)/2+a.rank,e};Y1(t,"edge-proxy",i,"_ep")}})}function xon(t){var e=0;Dt(t.nodes(),function(n){var a=t.node(n);a.borderTop&&(a.minRank=t.node(a.borderTop).rank,a.maxRank=t.node(a.borderBottom).rank,e=g0(e,a.maxRank))}),t.graph().maxRank=e}function Don(t){Dt(t.nodes(),function(e){var n=t.node(e);n.dummy==="edge-proxy"&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function Son(t){var e=Number.POSITIVE_INFINITY,n=0,a=Number.POSITIVE_INFINITY,r=0,i=t.graph(),o=i.marginx||0,s=i.marginy||0;function A(l){var u=l.x,d=l.y,p=l.width,m=l.height;e=Math.min(e,u-p/2),n=Math.max(n,u+p/2),a=Math.min(a,d-m/2),r=Math.max(r,d+m/2)}Dt(t.nodes(),function(l){A(t.node(l))}),Dt(t.edges(),function(l){var u=t.edge(l);Object.prototype.hasOwnProperty.call(u,"x")&&A(u)}),e-=o,a-=s,Dt(t.nodes(),function(l){var u=t.node(l);u.x-=e,u.y-=a}),Dt(t.edges(),function(l){var u=t.edge(l);Dt(u.points,function(d){d.x-=e,d.y-=a}),Object.prototype.hasOwnProperty.call(u,"x")&&(u.x-=e),Object.prototype.hasOwnProperty.call(u,"y")&&(u.y-=a)}),i.width=n-e+o,i.height=r-a+s}function Non(t){Dt(t.edges(),function(e){var n=t.edge(e),a=t.node(e.v),r=t.node(e.w),i,o;n.points?(i=n.points[0],o=n.points[n.points.length-1]):(n.points=[],i=r,o=a),n.points.unshift(che(a,i)),n.points.push(che(r,o))})}function Fon(t){Dt(t.edges(),function(e){var n=t.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function Ton(t){Dt(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function Ron(t){Dt(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),a=t.node(n.borderTop),r=t.node(n.borderBottom),i=t.node(Z3(n.borderLeft)),o=t.node(Z3(n.borderRight));n.width=Math.abs(o.x-i.x),n.height=Math.abs(r.y-a.y),n.x=i.x+n.width/2,n.y=a.y+n.height/2}}),Dt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function Mon(t){Dt(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function Lon(t){var e=o5(t);Dt(e,function(n){var a=0;Dt(n,function(r,i){var o=t.node(r);o.order=i+a,Dt(o.selfEdges,function(s){Y1(t,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:i+ ++a,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function Oon(t){Dt(t.nodes(),function(e){var n=t.node(e);if(n.dummy==="selfedge"){var a=t.node(n.e.v),r=a.x+a.width/2,i=a.y,o=n.x-r,s=a.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:r+2*o/3,y:i-s},{x:r+5*o/6,y:i-s},{x:r+o,y:i},{x:r+5*o/6,y:i+s},{x:r+2*o/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})}function MP(t,e){return i5(W3(t,e),Number)}function LP(t){var e={};return Dt(t,function(n,a){e[a.toLowerCase()]=n}),e}function ou(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Gon(t),edges:Pon(t)};return ri(t.graph())||(e.value=S9e(t.graph())),e}function Gon(t){return Wa(t.nodes(),function(e){var n=t.node(e),a=t.parent(e),r={v:e};return ri(n)||(r.value=n),ri(a)||(r.parent=a),r})}function Pon(t){return Wa(t.edges(),function(e){var n=t.edge(e),a={v:e.v,w:e.w};return ri(e.name)||(a.name=e.name),ri(n)||(a.value=n),a})}var ia=new Map,Mf=new Map,rRe=new Map,qon=Q(()=>{Mf.clear(),rRe.clear(),ia.clear()},"clear"),V3=Q((t,e)=>{const n=Mf.get(e)||[];return fe.trace("In isDescendant",e," ",t," = ",n.includes(t)),n.includes(t)},"isDescendant"),Uon=Q((t,e)=>{const n=Mf.get(e)||[];return fe.info("Descendants of ",e," is ",n),fe.info("Edge is ",t),t.v===e||t.w===e?!1:n?n.includes(t.v)||V3(t.v,e)||V3(t.w,e)||n.includes(t.w):(fe.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),iRe=Q((t,e,n,a)=>{fe.warn("Copying children of ",t,"root",a,"data",e.node(t),a);const r=e.children(t)||[];t!==a&&r.push(t),fe.warn("Copying (nodes) clusterId",t,"nodes",r),r.forEach(i=>{if(e.children(i).length>0)iRe(i,e,n,a);else{const o=e.node(i);fe.info("cp ",i," to ",a," with parent ",t),n.setNode(i,o),a!==e.parent(i)&&(fe.warn("Setting parent",i,e.parent(i)),n.setParent(i,e.parent(i))),t!==a&&i!==t?(fe.debug("Setting parent",i,t),n.setParent(i,t)):(fe.info("In copy ",t,"root",a,"data",e.node(t),a),fe.debug("Not Setting parent for node=",i,"cluster!==rootId",t!==a,"node!==clusterId",i!==t));const s=e.edges(i);fe.debug("Copying Edges",s),s.forEach(A=>{fe.info("Edge",A);const l=e.edge(A.v,A.w,A.name);fe.info("Edge data",l,a);try{Uon(A,a)?(fe.info("Copying as ",A.v,A.w,l,A.name),n.setEdge(A.v,A.w,l,A.name),fe.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):fe.info("Skipping copy of edge ",A.v,"-->",A.w," rootId: ",a," clusterId:",t)}catch(u){fe.error(u)}})}fe.debug("Removing node",i),e.removeNode(i)})},"copy"),oRe=Q((t,e)=>{const n=e.children(t);let a=[...n];for(const r of n)rRe.set(r,t),a=[...a,...oRe(r,e)];return a},"extractDescendants"),$on=Q((t,e,n)=>{const a=t.edges().filter(A=>A.v===e||A.w===e),r=t.edges().filter(A=>A.v===n||A.w===n),i=a.map(A=>({v:A.v===e?n:A.v,w:A.w===e?e:A.w})),o=r.map(A=>({v:A.v,w:A.w}));return i.filter(A=>o.some(l=>A.v===l.v&&A.w===l.w))},"findCommonEdges"),kk=Q((t,e,n)=>{const a=e.children(t);if(fe.trace("Searching children of id ",t,a),a.length<1)return t;let r;for(const i of a){const o=kk(i,e,n),s=$on(e,n,o);if(o)if(s.length>0)r=o;else return o}return r},"findNonClusterChild"),bhe=Q(t=>!ia.has(t)||!ia.get(t).externalConnections?t:ia.has(t)?ia.get(t).id:t,"getAnchorId"),jon=Q((t,e)=>{if(!t||e>10){fe.debug("Opting out, no graph ");return}else fe.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(fe.warn("Cluster identified",n," Replacement id in edges: ",kk(n,t,n)),Mf.set(n,oRe(n,t)),ia.set(n,{id:kk(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const a=t.children(n),r=t.edges();a.length>0?(fe.debug("Cluster identified",n,Mf),r.forEach(i=>{const o=V3(i.v,n),s=V3(i.w,n);o^s&&(fe.warn("Edge: ",i," leaves cluster ",n),fe.warn("Descendants of XXX ",n,": ",Mf.get(n)),ia.get(n).externalConnections=!0)})):fe.debug("Not a cluster ",n,Mf)});for(let n of ia.keys()){const a=ia.get(n).id,r=t.parent(a);r!==n&&ia.has(r)&&!ia.get(r).externalConnections&&(ia.get(n).id=r)}t.edges().forEach(function(n){const a=t.edge(n);fe.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),fe.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let r=n.v,i=n.w;if(fe.warn("Fix XXX",ia,"ids:",n.v,n.w,"Translating: ",ia.get(n.v)," --- ",ia.get(n.w)),ia.get(n.v)||ia.get(n.w)){if(fe.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=bhe(n.v),i=bhe(n.w),t.removeEdge(n.v,n.w,n.name),r!==n.v){const o=t.parent(r);ia.get(o).externalConnections=!0,a.fromCluster=n.v}if(i!==n.w){const o=t.parent(i);ia.get(o).externalConnections=!0,a.toCluster=n.w}fe.warn("Fix Replacing with XXX",r,i,n.name),t.setEdge(r,i,a,n.name)}}),fe.warn("Adjusted Graph",ou(t)),sRe(t,0),fe.trace(ia)},"adjustClustersAndEdges"),sRe=Q((t,e)=>{if(fe.warn("extractor - ",e,ou(t),t.children("D")),e>10){fe.error("Bailing out");return}let n=t.nodes(),a=!1;for(const r of n){const i=t.children(r);a=a||i.length>0}if(!a){fe.debug("Done, no node has children",t.nodes());return}fe.debug("Nodes = ",n,e);for(const r of n)if(fe.debug("Extracting node",r,ia,ia.has(r)&&!ia.get(r).externalConnections,!t.parent(r),t.node(r),t.children("D")," Depth ",e),!ia.has(r))fe.debug("Not a cluster",r,e);else if(!ia.get(r).externalConnections&&t.children(r)&&t.children(r).length>0){fe.warn("Cluster without external connections, without a parent and with children",r,e);let o=t.graph().rankdir==="TB"?"LR":"TB";ia.get(r)?.clusterData?.dir&&(o=ia.get(r).clusterData.dir,fe.warn("Fixing dir",ia.get(r).clusterData.dir,o));const s=new AA({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});fe.warn("Old graph before copy",ou(t)),iRe(r,t,s,r),t.setNode(r,{clusterNode:!0,id:r,clusterData:ia.get(r).clusterData,label:ia.get(r).label,graph:s}),fe.warn("New graph after copy node: (",r,")",ou(s)),fe.debug("Old graph after copy",ou(t))}else fe.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!ia.get(r).externalConnections," no parent: ",!t.parent(r)," children ",t.children(r)&&t.children(r).length>0,t.children("D"),e),fe.debug(ia);n=t.nodes(),fe.warn("New list of nodes",n);for(const r of n){const i=t.node(r);fe.warn(" Now next level",r,i),i?.clusterNode&&sRe(i.graph,e+1)}},"extractor"),ARe=Q((t,e)=>{if(e.length===0)return[];let n=Object.assign([],e);return e.forEach(a=>{const r=t.children(a),i=ARe(t,r);n=[...n,...i]}),n},"sorter"),Hon=Q(t=>ARe(t,t.children()),"sortNodesByHierarchy"),cRe=Q(async(t,e,n,a,r,i)=>{fe.warn("Graph in recursive render:XAX",ou(e),r);const o=e.graph().rankdir;fe.trace("Dir in recursive render - dir:",o);const s=t.insert("g").attr("class","root");e.nodes()?fe.info("Recursive render XXX",e.nodes()):fe.info("No nodes found for",e),e.edges().length>0&&fe.info("Recursive edges",e.edge(e.edges()[0]));const A=s.insert("g").attr("class","clusters"),l=s.insert("g").attr("class","edgePaths"),u=s.insert("g").attr("class","edgeLabels"),d=s.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(h){const b=e.node(h);if(r!==void 0){const y=JSON.parse(JSON.stringify(r.clusterData));fe.trace(`Setting data for parent cluster XXX
1987
1988
  Node.id = `,h,`
1988
1989
  data=`,y.height,`
@@ -4244,4 +4245,4 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[Z]||Z)+"'":le="Parse error
4244
4245
  fill: ${e.titleColor};
4245
4246
  font-size: ${e.titleFontSize};
4246
4247
  }
4247
- `},"getStyles"),Q8n=I8n,_8n={parser:vqe,get db(){return new Bqe},renderer:k8n,styles:Q8n};const x8n=Object.freeze(Object.defineProperty({__proto__:null,diagram:_8n},Symbol.toStringTag,{value:"Module"})),D8n=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:TOe,createInfoServices:ROe},Symbol.toStringTag,{value:"Module"})),S8n=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:MOe,createPacketServices:LOe},Symbol.toStringTag,{value:"Module"})),N8n=Object.freeze(Object.defineProperty({__proto__:null,PieModule:OOe,createPieServices:GOe},Symbol.toStringTag,{value:"Module"})),F8n=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:POe,createArchitectureServices:qOe},Symbol.toStringTag,{value:"Module"})),T8n=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:NOe,createGitGraphServices:FOe},Symbol.toStringTag,{value:"Module"})),R8n=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:UOe,createRadarServices:$Oe},Symbol.toStringTag,{value:"Module"})),M8n=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:HOe,createTreemapServices:zOe},Symbol.toStringTag,{value:"Module"}));export{B6n as $,$8n as A,K as B,U8n as C,mve as D,hoe as E,tv as F,T5n as G,Z8n as H,vSn as I,F6n as J,$Sn as K,f5n as L,R5n as M,M5n as N,f6n as O,q8n as P,S6n as Q,G8n as R,w5n as S,P8n as T,e6n as U,JSn as V,USn as W,u6n as X,ySn as Y,cSn as Z,_e as _,O8n as a,N5n as a$,CSn as a0,g6n as a1,xSn as a2,h6n as a3,$at as a4,qat as a5,jat as a6,q5n as a7,Uat as a8,G5n as a9,Z6n as aA,k6n as aB,s6n as aC,n5n as aD,SSn as aE,XSn as aF,BSn as aG,j5n as aH,$5n as aI,PSn as aJ,z5n as aK,H5n as aL,Z5n as aM,K5n as aN,Y5n as aO,V5n as aP,lIe as aQ,uIe as aR,W5n as aS,W6n as aT,p6n as aU,m6n as aV,qSn as aW,gSn as aX,dSn as aY,J5n as aZ,S5n as a_,P5n as aa,ISn as ab,t6n as ac,N6n as ad,fSn as ae,DSn as af,QSn as ag,yat as ah,ZSn as ai,w6n as aj,U5n as ak,nSn as al,H8n as am,R6n as an,x6n as ao,o6n as ap,wSn as aq,t5n as ar,X6n as as,V6n as at,e5n as au,T6n as av,hSn as aw,A6n as ax,aSn as ay,tSn as az,a5n as b,ASn as b$,X5n as b0,iot as b1,oot as b2,eNn as b3,tNn as b4,aNn as b5,nNn as b6,rNn as b7,iNn as b8,oNn as b9,M6n as bA,TSn as bB,H6n as bC,Q6n as bD,yNn as bE,E6n as bF,j8n as bG,OSn as bH,hNn as bI,L6n as bJ,rBt as bK,c6n as bL,NSn as bM,z6n as bN,MSn as bO,zSn as bP,U6n as bQ,iSn as bR,D6n as bS,$4t as bT,v6n as bU,lSn as bV,P6n as bW,pSn as bX,$6n as bY,_Sn as bZ,K8n as b_,sNn as ba,ANn as bb,cNn as bc,uNn as bd,lNn as be,dNn as bf,I6n as bg,rSn as bh,j6n as bi,FSn as bj,l6n as bk,q6n as bl,RSn as bm,i6n as bn,pNn as bo,GSn as bp,C6n as bq,V8n as br,W8n as bs,mNn as bt,gNn as bu,fNn as bv,Tot as bw,Pot as bx,LSn as by,mSn as bz,CEe as c,YSn as c0,O6n as c1,KSn as c2,sSn as c3,GNn as c4,PNn as c5,_Nn as c6,eSn as c7,J8n as c8,z8n as c9,Y6n as ca,b6n as cb,J6n as cc,_6n as cd,y6n as ce,oSn as cf,jSn as cg,n6n as ch,WSn as ci,HSn as cj,kSn as ck,K6n as cl,X8n as cm,G6n as cn,qNn as co,Dat as cp,ESn as cq,d6n as cr,a6n as cs,r6n as ct,L8n as cu,L5n as cv,jNn as cw,VNn as cx,r5n as d,vYe as e,l5n as f,Ce as g,UNn as h,bSn as i,be as j,d5n as k,p5n as l,m5n as m,g5n as n,b5n as o,i5n as p,y5n as q,Xl as r,C5n as s,Nze as t,uSn as u,h5n as v,E5n as w,B5n as x,Y8n as y,VSn as z};
4248
+ `},"getStyles"),Q8n=I8n,_8n={parser:vqe,get db(){return new Bqe},renderer:k8n,styles:Q8n};const x8n=Object.freeze(Object.defineProperty({__proto__:null,diagram:_8n},Symbol.toStringTag,{value:"Module"})),D8n=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:TOe,createInfoServices:ROe},Symbol.toStringTag,{value:"Module"})),S8n=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:MOe,createPacketServices:LOe},Symbol.toStringTag,{value:"Module"})),N8n=Object.freeze(Object.defineProperty({__proto__:null,PieModule:OOe,createPieServices:GOe},Symbol.toStringTag,{value:"Module"})),F8n=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:POe,createArchitectureServices:qOe},Symbol.toStringTag,{value:"Module"})),T8n=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:NOe,createGitGraphServices:FOe},Symbol.toStringTag,{value:"Module"})),R8n=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:UOe,createRadarServices:$Oe},Symbol.toStringTag,{value:"Module"})),M8n=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:HOe,createTreemapServices:zOe},Symbol.toStringTag,{value:"Module"}));export{S6n as $,$8n as A,HWe as B,U8n as C,Y8n as D,VSn as E,tv as F,K as G,fve as H,vSn as I,hoe as J,R5n as K,f5n as L,Z8n as M,tSn as N,$Sn as O,q8n as P,F6n as Q,G8n as R,w5n as S,P8n as T,e6n as U,M5n as V,L5n as W,f6n as X,ySn as Y,cSn as Z,_e as _,O8n as a,dSn as a$,USn as a0,JSn as a1,u6n as a2,B6n as a3,CSn as a4,g6n as a5,xSn as a6,h6n as a7,Kat as a8,zat as a9,hSn as aA,A6n as aB,aSn as aC,Z6n as aD,k6n as aE,s6n as aF,n5n as aG,SSn as aH,XSn as aI,BSn as aJ,H5n as aK,j5n as aL,PSn as aM,Y5n as aN,z5n as aO,W5n as aP,Z5n as aQ,K5n as aR,J5n as aS,dIe as aT,pIe as aU,V5n as aV,W6n as aW,p6n as aX,m6n as aY,qSn as aZ,gSn as a_,Zat as aa,U5n as ab,Yat as ac,P5n as ad,q5n as ae,ISn as af,t6n as ag,N6n as ah,fSn as ai,DSn as aj,QSn as ak,kat as al,ZSn as am,w6n as an,$5n as ao,nSn as ap,H8n as aq,R6n as ar,x6n as as,o6n as at,wSn as au,t5n as av,X6n as aw,V6n as ax,e5n as ay,T6n as az,a5n as b,ASn as b$,X5n as b0,N5n as b1,F5n as b2,eNn as b3,tNn as b4,aNn as b5,nNn as b6,rNn as b7,iNn as b8,oNn as b9,M6n as bA,TSn as bB,H6n as bC,Q6n as bD,yNn as bE,E6n as bF,j8n as bG,OSn as bH,hNn as bI,L6n as bJ,rBt as bK,c6n as bL,NSn as bM,z6n as bN,MSn as bO,zSn as bP,U6n as bQ,iSn as bR,D6n as bS,$4t as bT,v6n as bU,lSn as bV,P6n as bW,pSn as bX,$6n as bY,_Sn as bZ,K8n as b_,sNn as ba,ANn as bb,cNn as bc,uNn as bd,lNn as be,dNn as bf,I6n as bg,rSn as bh,j6n as bi,FSn as bj,l6n as bk,q6n as bl,RSn as bm,i6n as bn,pNn as bo,GSn as bp,C6n as bq,V8n as br,W8n as bs,mNn as bt,gNn as bu,fNn as bv,Tot as bw,Pot as bx,LSn as by,mSn as bz,CEe as c,YSn as c0,O6n as c1,KSn as c2,sSn as c3,GNn as c4,PNn as c5,_Nn as c6,eSn as c7,J8n as c8,z8n as c9,Y6n as ca,b6n as cb,J6n as cc,_6n as cd,y6n as ce,oSn as cf,jSn as cg,n6n as ch,WSn as ci,HSn as cj,kSn as ck,K6n as cl,X8n as cm,G6n as cn,qNn as co,Rat as cp,ESn as cq,d6n as cr,a6n as cs,r6n as ct,L8n as cu,O5n as cv,jNn as cw,VNn as cx,r5n as d,vYe as e,l5n as f,Ce as g,UNn as h,bSn as i,be as j,d5n as k,p5n as l,m5n as m,g5n as n,b5n as o,i5n as p,y5n as q,Xl as r,C5n as s,Nze as t,uSn as u,h5n as v,E5n as w,B5n as x,k5n as y,jWe as z};