You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/8275.e1948d09.async.js

3474 lines
1.9 MiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!(function(){var yo=Math.pow;var du=(Fr,Rt,J)=>new Promise((pe,Pe)=>{var rt=E=>{try{te(J.next(E))}catch(Me){Pe(Me)}},Le=E=>{try{te(J.throw(E))}catch(Me){Pe(Me)}},te=E=>E.done?pe(E.value):Promise.resolve(E.value).then(rt,Le);te((J=J.apply(Fr,Rt)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[8275],{70557:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return $}});var pe=J(72308),Pe=J(59301),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},Le=rt,te=J(7657),E=function(be,j){return Pe.createElement(te.Z,(0,pe.Z)({},be,{ref:j,icon:Le}))},Me=Pe.forwardRef(E),$=Me},84105:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return $}});var pe=J(72308),Pe=J(59301),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},Le=rt,te=J(7657),E=function(be,j){return Pe.createElement(te.Z,(0,pe.Z)({},be,{ref:j,icon:Le}))},Me=Pe.forwardRef(E),$=Me},18785:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return $}});var pe=J(72308),Pe=J(59301),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},Le=rt,te=J(7657),E=function(be,j){return Pe.createElement(te.Z,(0,pe.Z)({},be,{ref:j,icon:Le}))},Me=Pe.forwardRef(E),$=Me},62772:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return $}});var pe=J(72308),Pe=J(59301),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},Le=rt,te=J(7657),E=function(be,j){return Pe.createElement(te.Z,(0,pe.Z)({},be,{ref:j,icon:Le}))},Me=Pe.forwardRef(E),$=Me},87395:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return $}});var pe=J(72308),Pe=J(59301),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},Le=rt,te=J(7657),E=function(be,j){return Pe.createElement(te.Z,(0,pe.Z)({},be,{ref:j,icon:Le}))},Me=Pe.forwardRef(E),$=Me},35593:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return Gr}});var pe=J(77321),Pe=J(52487),rt=J(74416),Le=J(43403),te=J(92310),E=J.n(te),Me=J(29301),$=J(76846),d=J(96452),be=J(6089),j=J(80402),k=J(34280),M=J(49658),O=J(59301),K=J(72308),se=J(77900),ae=J(8654);function Z(Ze){var nt=Ze.prefixCls,Qe=Ze.align,Ct=Ze.arrow,Dt=Ze.arrowPos,ye=Ct||{},Oe=ye.className,et=ye.content,vt=Dt.x,wt=vt===void 0?0:vt,Ht=Dt.y,fr=Ht===void 0?0:Ht,Xt=O.useRef();if(!Qe||!Qe.points)return null;var Ue={position:"absolute"};if(Qe.autoArrow!==!1){var Ut=Qe.points[0],_r=Qe.points[1],Fe=Ut[0],Ge=Ut[1],it=_r[0],Pt=_r[1];Fe===it||!["t","b"].includes(Fe)?Ue.top=fr:Fe==="t"?Ue.top=0:Ue.bottom=0,Ge===Pt||!["l","r"].includes(Ge)?Ue.left=wt:Ge==="l"?Ue.left=0:Ue.right=0}return O.createElement("div",{ref:Xt,className:E()("".concat(nt,"-arrow"),Oe),style:Ue},et)}function q(Ze){var nt=Ze.prefixCls,Qe=Ze.open,Ct=Ze.zIndex,Dt=Ze.mask,ye=Ze.motion;return Dt?O.createElement(se.default,(0,K.Z)({},ye,{motionAppear:!0,visible:Qe,removeOnLeave:!0}),function(Oe){var et=Oe.className;return O.createElement("div",{style:{zIndex:Ct},className:E()("".concat(nt,"-mask"),et)})}):null}var Y=O.memo(function(Ze){var nt=Ze.children;return nt},function(Ze,nt){return nt.cache}),ue=Y,ee=O.forwardRef(function(Ze,nt){var Qe=Ze.popup,Ct=Ze.className,Dt=Ze.prefixCls,ye=Ze.style,Oe=Ze.target,et=Ze.onVisibleChanged,vt=Ze.open,wt=Ze.keepDom,Ht=Ze.fresh,fr=Ze.onClick,Xt=Ze.mask,Ue=Ze.arrow,Ut=Ze.arrowPos,_r=Ze.align,Fe=Ze.motion,Ge=Ze.maskMotion,it=Ze.forceRender,Pt=Ze.getPopupContainer,kt=Ze.autoDestroy,zt=Ze.portal,rr=Ze.zIndex,T=Ze.onMouseEnter,B=Ze.onMouseLeave,dt=Ze.onPointerEnter,G=Ze.ready,fe=Ze.offsetX,xr=Ze.offsetY,Ne=Ze.offsetR,He=Ze.offsetB,Je=Ze.onAlign,W=Ze.onPrepare,ge=Ze.stretch,Se=Ze.targetWidth,Ke=Ze.targetHeight,V=typeof Qe=="function"?Qe():Qe,qt=vt||wt,Ae=(Pt==null?void 0:Pt.length)>0,Yt=O.useState(!Pt||!Ae),vr=(0,Pe.Z)(Yt,2),ei=vr[0],Ri=vr[1];if((0,k.Z)(function(){!ei&&Ae&&Oe&&Ri(!0)},[ei,Ae,Oe]),!ei)return null;var ui="auto",wr={left:"-1000vw",top:"-1000vh",right:ui,bottom:ui};if(G||!vt){var bi,me=_r.points,Te=_r.dynamicInset||((bi=_r._experimental)===null||bi===void 0?void 0:bi.dynamicInset),Mt=Te&&me[0][1]==="r",ct=Te&&me[0][0]==="b";Mt?(wr.right=Ne,wr.left=ui):(wr.left=fe,wr.right=ui),ct?(wr.bottom=He,wr.top=ui):(wr.top=xr,wr.bottom=ui)}var Et={};return ge&&(ge.includes("height")&&Ke?Et.height=Ke:ge.includes("minHeight")&&Ke&&(Et.minHeight=Ke),ge.includes("width")&&Se?Et.width=Se:ge.includes("minWidth")&&Se&&(Et.minWidth=Se)),vt||(Et.pointerEvents="none"),O.createElement(zt,{open:it||qt,getContainer:Pt&&function(){return Pt(Oe)},autoDestroy:kt},O.createElement(q,{prefixCls:Dt,open:vt,zIndex:rr,mask:Xt,motion:Ge}),O.createElement(Me.Z,{onResize:Je,disabled:!vt},function(Ft){return O.createElement(se.default,(0,K.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:it,leavedClassName:"".concat(Dt,"-hidden")},Fe,{onAppearPrepare:W,onEnterPrepare:W,visible:vt,onVisibleChanged:function(Jt){var Rr;Fe==null||(Rr=Fe.onVisibleChanged)===null||Rr===void 0||Rr.call(Fe,Jt),et(Jt)}}),function(or,Jt){var Rr=or.className,Sr=or.style,oi=E()(Dt,Rr,Ct);return O.createElement("div",{ref:(0,ae.sQ)(Ft,nt,Jt),className:oi,style:(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({"--arrow-x":"".concat(Ut.x||0,"px"),"--arrow-y":"".concat(Ut.y||0,"px")},wr),Et),Sr),{},{boxSizing:"border-box",zIndex:rr},ye),onMouseEnter:T,onMouseLeave:B,onPointerEnter:dt,onClick:fr},Ue&&O.createElement(Z,{prefixCls:Dt,arrow:Ue,arrowPos:Ut,align:_r}),O.createElement(ue,{cache:!vt&&!Ht},V))})}))}),oe=ee,De=O.forwardRef(function(Ze,nt){var Qe=Ze.children,Ct=Ze.getTriggerDOMNode,Dt=(0,ae.Yr)(Qe),ye=O.useCallback(function(et){(0,ae.mH)(nt,Ct?Ct(et):et)},[Ct]),Oe=(0,ae.x1)(ye,Qe.ref);return Dt?O.cloneElement(Qe,{ref:Oe}):Qe}),ve=De,Ye=O.createContext(null),We=Ye;function ut(Ze){return Ze?Array.isArray(Ze)?Ze:[Ze]:[]}function pt(Ze,nt,Qe,Ct){return O.useMemo(function(){var Dt=ut(Qe!=null?Qe:nt),ye=ut(Ct!=null?Ct:nt),Oe=new Set(Dt),et=new Set(ye);return Ze&&(Oe.has("hover")&&(Oe.delete("hover"),Oe.add("click")),et.has("hover")&&(et.delete("hover"),et.add("click"))),[Oe,et]},[Ze,nt,Qe,Ct])}var de=J(29194);function re(){var Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Qe=arguments.length>2?arguments[2]:void 0;return Qe?Ze[0]===nt[0]:Ze[0]===nt[0]&&Ze[1]===nt[1]}function ce(Ze,nt,Qe,Ct){for(var Dt=Qe.points,ye=Object.keys(Ze),Oe=0;Oe<ye.length;Oe+=1){var et,vt=ye[Oe];if(re((et=Ze[vt])===null||et===void 0?void 0:et.points,Dt,Ct))return"".concat(nt,"-placement-").concat(vt)}return""}function he(Ze,nt,Qe,Ct){return nt||(Qe?{motionName:"".concat(Ze,"-").concat(Qe)}:Ct?{motionName:Ct}:null)}function Re(Ze){return Ze.ownerDocument.defaultView}function we(Ze){for(var nt=[],Qe=Ze==null?void 0:Ze.parentElement,Ct=["hidden","scroll","clip","auto"];Qe;){var Dt=Re(Qe).getComputedStyle(Qe),ye=Dt.overflowX,Oe=Dt.overflowY,et=Dt.overflow;[ye,Oe,et].some(function(vt){return Ct.includes(vt)})&&nt.push(Qe),Qe=Qe.parentElement}return nt}function D(Ze){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Ze)?nt:Ze}function L(Ze){return D(parseFloat(Ze),0)}function ie(Ze,nt){var Qe=(0,pe.Z)({},Ze);return(nt||[]).forEach(function(Ct){if(!(Ct instanceof HTMLBodyElement||Ct instanceof HTMLHtmlElement)){var Dt=Re(Ct).getComputedStyle(Ct),ye=Dt.overflow,Oe=Dt.overflowClipMargin,et=Dt.borderTopWidth,vt=Dt.borderBottomWidth,wt=Dt.borderLeftWidth,Ht=Dt.borderRightWidth,fr=Ct.getBoundingClientRect(),Xt=Ct.offsetHeight,Ue=Ct.clientHeight,Ut=Ct.offsetWidth,_r=Ct.clientWidth,Fe=L(et),Ge=L(vt),it=L(wt),Pt=L(Ht),kt=D(Math.round(fr.width/Ut*1e3)/1e3),zt=D(Math.round(fr.height/Xt*1e3)/1e3),rr=(Ut-_r-it-Pt)*kt,T=(Xt-Ue-Fe-Ge)*zt,B=Fe*zt,dt=Ge*zt,G=it*kt,fe=Pt*kt,xr=0,Ne=0;if(ye==="clip"){var He=L(Oe);xr=He*kt,Ne=He*zt}var Je=fr.x+G-xr,W=fr.y+B-Ne,ge=Je+fr.width+2*xr-G-fe-rr,Se=W+fr.height+2*Ne-B-dt-T;Qe.left=Math.max(Qe.left,Je),Qe.top=Math.max(Qe.top,W),Qe.right=Math.min(Qe.right,ge),Qe.bottom=Math.min(Qe.bottom,Se)}}),Qe}function xe(Ze){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Qe="".concat(nt),Ct=Qe.match(/^(.*)\%$/);return Ct?Ze*(parseFloat(Ct[1])/100):parseFloat(Qe)}function at(Ze,nt){var Qe=nt||[],Ct=(0,Pe.Z)(Qe,2),Dt=Ct[0],ye=Ct[1];return[xe(Ze.width,Dt),xe(Ze.height,ye)]}function ot(){var Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Ze[0],Ze[1]]}function At(Ze,nt){var Qe=nt[0],Ct=nt[1],Dt,ye;return Qe==="t"?ye=Ze.y:Qe==="b"?ye=Ze.y+Ze.height:ye=Ze.y+Ze.height/2,Ct==="l"?Dt=Ze.x:Ct==="r"?Dt=Ze.x+Ze.width:Dt=Ze.x+Ze.width/2,{x:Dt,y:ye}}function Xe(Ze,nt){var Qe={t:"b",b:"t",l:"r",r:"l"};return Ze.map(function(Ct,Dt){return Dt===nt?Qe[Ct]||"c":Ct}).join("")}function ar(Ze,nt,Qe,Ct,Dt,ye,Oe){var et=O.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Dt[Ct]||{}}),vt=(0,Pe.Z)(et,2),wt=vt[0],Ht=vt[1],fr=O.useRef(0),Xt=O.useMemo(function(){return nt?we(nt):[]},[nt]),Ue=O.useRef({}),Ut=function(){Ue.current={}};Ze||Ut();var _r=(0,be.Z)(function(){if(nt&&Qe&&Ze){let cn=function(rn,zn){var Wn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oi,Pn=V.x+rn,An=V.y+zn,Oi=Pn+bi,xi=An+wr,Mi=Math.max(Pn,Wn.left),sn=Math.max(An,Wn.top),kn=Math.min(Oi,Wn.right),Jn=Math.min(xi,Wn.bottom);return Math.max(0,(kn-Mi)*(Jn-sn))},Fi=function(){cr=V.y+Mr,yr=cr+wr,jr=V.x+Er,nn=jr+bi};var it,Pt,kt=nt,zt=kt.ownerDocument,rr=Re(kt),T=rr.getComputedStyle(kt),B=T.width,dt=T.height,G=T.position,fe=kt.style.left,xr=kt.style.top,Ne=kt.style.right,He=kt.style.bottom,Je=kt.style.overflow,W=(0,pe.Z)((0,pe.Z)({},Dt[Ct]),ye),ge=zt.createElement("div");(it=kt.parentElement)===null||it===void 0||it.appendChild(ge),ge.style.left="".concat(kt.offsetLeft,"px"),ge.style.top="".concat(kt.offsetTop,"px"),ge.style.position=G,ge.style.height="".concat(kt.offsetHeight,"px"),ge.style.width="".concat(kt.offsetWidth,"px"),kt.style.left="0",kt.style.top="0",kt.style.right="auto",kt.style.bottom="auto",kt.style.overflow="hidden";var Se;if(Array.isArray(Qe))Se={x:Qe[0],y:Qe[1],width:0,height:0};else{var Ke=Qe.getBoundingClientRect();Se={x:Ke.x,y:Ke.y,width:Ke.width,height:Ke.height}}var V=kt.getBoundingClientRect(),qt=zt.documentElement,Ae=qt.clientWidth,Yt=qt.clientHeight,vr=qt.scrollWidth,ei=qt.scrollHeight,Ri=qt.scrollTop,ui=qt.scrollLeft,wr=V.height,bi=V.width,me=Se.height,Te=Se.width,Mt={left:0,top:0,right:Ae,bottom:Yt},ct={left:-ui,top:-Ri,right:vr-ui,bottom:ei-Ri},Et=W.htmlRegion,Ft="visible",or="visibleFirst";Et!=="scroll"&&Et!==or&&(Et=Ft);var Jt=Et===or,Rr=ie(ct,Xt),Sr=ie(Mt,Xt),oi=Et===Ft?Sr:Rr,Dr=Jt?Sr:oi;kt.style.left="auto",kt.style.top="auto",kt.style.right="0",kt.style.bottom="0";var Br=kt.getBoundingClientRect();kt.style.left=fe,kt.style.top=xr,kt.style.right=Ne,kt.style.bottom=He,kt.style.overflow=Je,(Pt=kt.parentElement)===null||Pt===void 0||Pt.removeChild(ge);var ni=D(Math.round(bi/parseFloat(B)*1e3)/1e3),_i=D(Math.round(wr/parseFloat(dt)*1e3)/1e3);if(ni===0||_i===0||(0,$.Sh)(Qe)&&!(0,de.Z)(Qe))return;var Ni=W.offset,mi=W.targetOffset,Ur=at(V,Ni),Gi=(0,Pe.Z)(Ur,2),Yr=Gi[0],Or=Gi[1],lt=at(Se,mi),tt=(0,Pe.Z)(lt,2),_t=tt[0],Lt=tt[1];Se.x-=_t,Se.y-=Lt;var ft=W.points||[],Kt=(0,Pe.Z)(ft,2),Bt=Kt[0],lr=Kt[1],Tr=ot(lr),pr=ot(Bt),si=At(Se,Tr),ci=At(V,pr),gi=(0,pe.Z)({},W),Er=si.x-ci.x+Yr,Mr=si.y-ci.y+Or,Si=cn(Er,Mr),Ai=cn(Er,Mr,Sr),Xr=At(Se,["t","l"]),ri=At(V,["t","l"]),ii=At(Se,["b","r"]),ai=At(V,["b","r"]),Kr=W.overflow||{},fi=Kr.adjustX,Pi=Kr.adjustY,Di=Kr.shiftX,Ar=Kr.shiftY,je=function(zn){return typeof zn=="boolean"?zn:zn>=0},cr,yr,jr,nn;Fi();var vi=je(Pi),$i=pr[0]===Tr[0];if(vi&&pr[0]==="t"&&(yr>Dr.bottom||Ue.current.bt)){var Hr=Mr;$i?Hr-=wr-me:Hr=Xr.y-ai.y-Or;var pn=cn(Er,Hr),_n=cn(Er,Hr,Sr);pn>Si||pn===Si&&(!Jt||_n>=Ai)?(Ue.current.bt=!0,Mr=Hr,Or=-Or,gi.points=[Xe(pr,0),Xe(Tr,0)]):Ue.current.bt=!1}if(vi&&pr[0]==="b"&&(cr<Dr.top||Ue.current.tb)){var Vi=Mr;$i?Vi+=wr-me:Vi=ii.y-ri.y-Or;var ts=cn(Er,Vi),Yn=cn(Er,Vi,Sr);ts>Si||ts===Si&&(!Jt||Yn>=Ai)?(Ue.current.tb=!0,Mr=Vi,Or=-Or,gi.points=[Xe(pr,0),Xe(Tr,0)]):Ue.current.tb=!1}var $n=je(fi),Gn=pr[1]===Tr[1];if($n&&pr[1]==="l"&&(nn>Dr.right||Ue.current.rl)){var Pr=Er;Gn?Pr-=bi-Te:Pr=Xr.x-ai.x-Yr;var ki=cn(Pr,Mr),Ki=cn(Pr,Mr,Sr);ki>Si||ki===Si&&(!Jt||Ki>=Ai)?(Ue.current.rl=!0,Er=Pr,Yr=-Yr,gi.points=[Xe(pr,1),Xe(Tr,1)]):Ue.current.rl=!1}if($n&&pr[1]==="r"&&(jr<Dr.left||Ue.current.lr)){var Wi=Er;Gn?Wi+=bi-Te:Wi=ii.x-ri.x-Yr;var Vn=cn(Wi,Mr),vn=cn(Wi,Mr,Sr);Vn>Si||Vn===Si&&(!Jt||vn>=Ai)?(Ue.current.lr=!0,Er=Wi,Yr=-Yr,gi.points=[Xe(pr,1),Xe(Tr,1)]):Ue.current.lr=!1}Fi();var tn=Di===!0?0:Di;typeof tn=="number"&&(jr<Sr.left&&(Er-=jr-Sr.left-Yr,Se.x+Te<Sr.left+tn&&(Er+=Se.x-Sr.left+Te-tn)),nn>Sr.right&&(Er-=nn-Sr.right-Yr,Se.x>Sr.right-tn&&(Er+=Se.x-Sr.right+tn)));var In=Ar===!0?0:Ar;typeof In=="number"&&(cr<Sr.top&&(Mr-=cr-Sr.top-Or,Se.y+me<Sr.top+In&&(Mr+=Se.y-Sr.top+me-In)),yr>Sr.bottom&&(Mr-=yr-Sr.bottom-Or,Se.y>Sr.bottom-In&&(Mr+=Se.y-Sr.bottom+In)));var zi=V.x+Er,rs=zi+bi,Vr=V.y+Mr,ss=Vr+wr,Xn=Se.x,xn=Xn+Te,Ii=Se.y,vs=Ii+me,_s=Math.max(zi,Xn),ds=Math.min(rs,xn),pi=(_s+ds)/2,xs=pi-zi,ws=Math.max(Vr,Ii),nr=Math.min(ss,vs),mn=(ws+nr)/2,Ss=mn-Vr;Oe==null||Oe(nt,gi);var fs=Br.right-V.x-(Er+V.width),un=Br.bottom-V.y-(Mr+V.height);Ht({ready:!0,offsetX:Er/ni,offsetY:Mr/_i,offsetR:fs/ni,offsetB:un/_i,arrowX:xs/ni,arrowY:Ss/_i,scaleX:ni,scaleY:_i,align:gi})}}),Fe=function(){fr.current+=1;var Pt=fr.current;Promise.resolve().then(function(){fr.current===Pt&&_r()})},Ge=function(){Ht(function(Pt){return(0,pe.Z)((0,pe.Z)({},Pt),{},{ready:!1})})};return(0,k.Z)(Ge,[Ct]),(0,k.Z)(function(){Ze||Ge()},[Ze]),[wt.ready,wt.offsetX,wt.offsetY,wt.offsetR,wt.offsetB,wt.arrowX,wt.arrowY,wt.scaleX,wt.scaleY,wt.align,Fe]}var jt=J(80702);function Ot(Ze,nt,Qe,Ct,Dt){(0,k.Z)(function(){if(Ze&&nt&&Qe){let fr=function(){Ct(),Dt()};var ye=nt,Oe=Qe,et=we(ye),vt=we(Oe),wt=Re(Oe),Ht=new Set([wt].concat((0,jt.Z)(et),(0,jt.Z)(vt)));return Ht.forEach(function(Xt){Xt.addEventListener("scroll",fr,{passive:!0})}),wt.addEventListener("resize",fr,{passive:!0}),Ct(),function(){Ht.forEach(function(Xt){Xt.removeEventListener("scroll",fr),wt.removeEventListener("resize",fr)})}}},[Ze,nt,Qe])}var kr=J(48736),$r=J(16089);function ir(Ze,nt,Qe,Ct,Dt,ye,Oe,et){var vt=O.useRef(Ze),wt=O.useRef(!1);vt.current!==Ze&&(wt.current=!0,vt.current=Ze),O.useEffect(function(){var Ht=(0,$r.Z)(function(){wt.current=!1});return function(){$r.Z.cancel(Ht)}},[Ze]),O.useEffect(function(){if(nt&&Ct&&(!Dt||ye)){var Ht=function(){var G=!1,fe=function(He){var Je=He.target;G=Oe(Je)},xr=function(He){var Je=He.target;!wt.current&&vt.current&&!G&&!Oe(Je)&&et(!1)};return[fe,xr]},fr=Ht(),Xt=(0,Pe.Z)(fr,2),Ue=Xt[0],Ut=Xt[1],_r=Ht(),Fe=(0,Pe.Z)(_r,2),Ge=Fe[0],it=Fe[1],Pt=Re(Ct);Pt.addEventListener("mousedown",Ue,!0),Pt.addEventListener("click",Ut,!0),Pt.addEventListener("contextmenu",Ut,!0);var kt=(0,d.A)(Qe);if(kt&&(kt.addEventListener("mousedown",Ge,!0),kt.addEventListener("click",it,!0),kt.addEventListener("contextmenu",it,!0)),0)var zt,rr,T,B;return function(){Pt.removeEventListener("mousedown",Ue,!0),Pt.removeEventListener("click",Ut,!0),Pt.removeEventListener("contextmenu",Ut,!0),kt&&(kt.removeEventListener("mousedown",Ge,!0),kt.removeEventListener("click",it,!0),kt.removeEventListener("contextmenu",it,!0))}}},[nt,Qe,Ct,Dt,ye])}var zr=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function li(){var Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le.Z,nt=O.forwardRef(function(Qe,Ct){var Dt=Qe.prefixCls,ye=Dt===void 0?"rc-trigger-popup":Dt,Oe=Qe.children,et=Qe.action,vt=et===void 0?"hover":et,wt=Qe.showAction,Ht=Qe.hideAction,fr=Qe.popupVisible,Xt=Qe.defaultPopupVisible,Ue=Qe.onPopupVisibleChange,Ut=Qe.afterPopupVisibleChange,_r=Qe.mouseEnterDelay,Fe=Qe.mouseLeaveDelay,Ge=Fe===void 0?.1:Fe,it=Qe.focusDelay,Pt=Qe.blurDelay,kt=Qe.mask,zt=Qe.maskClosable,rr=zt===void 0?!0:zt,T=Qe.getPopupContainer,B=Qe.forceRender,dt=Qe.autoDestroy,G=Qe.destroyPopupOnHide,fe=Qe.popup,xr=Qe.popupClassName,Ne=Qe.popupStyle,He=Qe.popupPlacement,Je=Qe.builtinPlacements,W=Je===void 0?{}:Je,ge=Qe.popupAlign,Se=Qe.zIndex,Ke=Qe.stretch,V=Qe.getPopupClassNameFromAlign,qt=Qe.fresh,Ae=Qe.alignPoint,Yt=Qe.onPopupClick,vr=Qe.onPopupAlign,ei=Qe.arrow,Ri=Qe.popupMotion,ui=Qe.maskMotion,wr=Qe.popupTransitionName,bi=Qe.popupAnimation,me=Qe.maskTransitionName,Te=Qe.maskAnimation,Mt=Qe.className,ct=Qe.getTriggerDOMNode,Et=(0,rt.Z)(Qe,zr),Ft=dt||G||!1,or=O.useState(!1),Jt=(0,Pe.Z)(or,2),Rr=Jt[0],Sr=Jt[1];(0,k.Z)(function(){Sr((0,M.Z)())},[]);var oi=O.useRef({}),Dr=O.useContext(We),Br=O.useMemo(function(){return{registerSubPopup:function(Jr,yn){oi.current[Jr]=yn,Dr==null||Dr.registerSubPopup(Jr,yn)}}},[Dr]),ni=(0,j.Z)(),_i=O.useState(null),Ni=(0,Pe.Z)(_i,2),mi=Ni[0],Ur=Ni[1],Gi=(0,be.Z)(function(Lr){(0,$.Sh)(Lr)&&mi!==Lr&&Ur(Lr),Dr==null||Dr.registerSubPopup(ni,Lr)}),Yr=O.useState(null),Or=(0,Pe.Z)(Yr,2),lt=Or[0],tt=Or[1],_t=O.useRef(null),Lt=(0,be.Z)(function(Lr){(0,$.Sh)(Lr)&&lt!==Lr&&(tt(Lr),_t.current=Lr)}),ft=O.Children.only(Oe),Kt=(ft==null?void 0:ft.props)||{},Bt={},lr=(0,be.Z)(function(Lr){var Jr,yn,Ln=lt;return(Ln==null?void 0:Ln.contains(Lr))||((Jr=(0,d.A)(Ln))===null||Jr===void 0?void 0:Jr.host)===Lr||Lr===Ln||(mi==null?void 0:mi.contains(Lr))||((yn=(0,d.A)(mi))===null||yn===void 0?void 0:yn.host)===Lr||Lr===mi||Object.values(oi.current).some(function(Ji){return(Ji==null?void 0:Ji.contains(Lr))||Lr===Ji})}),Tr=he(ye,Ri,bi,wr),pr=he(ye,ui,Te,me),si=O.useState(Xt||!1),ci=(0,Pe.Z)(si,2),gi=ci[0],Er=ci[1],Mr=fr!=null?fr:gi,Si=(0,be.Z)(function(Lr){fr===void 0&&Er(Lr)});(0,k.Z)(function(){Er(fr||!1)},[fr]);var Ai=O.useRef(Mr);Ai.current=Mr;var Xr=O.useRef([]);Xr.current=[];var ri=(0,be.Z)(function(Lr){var Jr;Si(Lr),((Jr=Xr.current[Xr.current.length-1])!==null&&Jr!==void 0?Jr:Mr)!==Lr&&(Xr.current.push(Lr),Ue==null||Ue(Lr))}),ii=O.useRef(),ai=function(){clearTimeout(ii.current)},Kr=function(Jr){var yn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ai(),yn===0?ri(Jr):ii.current=setTimeout(function(){ri(Jr)},yn*1e3)};O.useEffect(function(){return ai},[]);var fi=O.useState(!1),Pi=(0,Pe.Z)(fi,2),Di=Pi[0],Ar=Pi[1];(0,k.Z)(function(Lr){(!Lr||Mr)&&Ar(!0)},[Mr]);var je=O.useState(null),cr=(0,Pe.Z)(je,2),yr=cr[0],jr=cr[1],nn=O.useState([0,0]),vi=(0,Pe.Z)(nn,2),$i=vi[0],Hr=vi[1],pn=function(Jr){Hr([Jr.clientX,Jr.clientY])},_n=ar(Mr,mi,Ae?$i:lt,He,W,ge,vr),Vi=(0,Pe.Z)(_n,11),ts=Vi[0],Yn=Vi[1],$n=Vi[2],Gn=Vi[3],Pr=Vi[4],ki=Vi[5],Ki=Vi[6],Wi=Vi[7],Vn=Vi[8],vn=Vi[9],tn=Vi[10],In=pt(Rr,vt,wt,Ht),zi=(0,Pe.Z)(In,2),rs=zi[0],Vr=zi[1],ss=rs.has("click"),Xn=Vr.has("click")||Vr.has("contextMenu"),xn=(0,be.Z)(function(){Di||tn()}),Ii=function(){Ai.current&&Ae&&Xn&&Kr(!1)};Ot(Mr,lt,mi,xn,Ii),(0,k.Z)(function(){xn()},[$i,He]),(0,k.Z)(function(){Mr&&!(W!=null&&W[He])&&xn()},[JSON.stringify(ge)]);var vs=O.useMemo(function(){var Lr=ce(W,ye,vn,Ae);return E()(Lr,V==null?void 0:V(vn))},[vn,V,W,ye,Ae]);O.useImperativeHandle(Ct,function(){return{nativeElement:_t.current,forceAlign:xn}});var _s=O.useState(0),ds=(0,Pe.Z)(_s,2),pi=ds[0],xs=ds[1],ws=O.useState(0),nr=(0,Pe.Z)(ws,2),mn=nr[0],Ss=nr[1],fs=function(){if(Ke&&lt){var Jr=lt.getBoundingClientRect();xs(Jr.width),Ss(Jr.height)}},un=function(){fs(),xn()},cn=function(Jr){Ar(!1),tn(),Ut==null||Ut(Jr)},Fi=function(){return new Promise(function(Jr){fs(),jr(function(){return Jr})})};(0,k.Z)(function(){yr&&(tn(),yr(),jr(null))},[yr]);function rn(Lr,Jr,yn,Ln){Bt[Lr]=function(Ji){var Is;Ln==null||Ln(Ji),Kr(Jr,yn);for(var as=arguments.length,Hs=new Array(as>1?as-1:0),Un=1;Un<as;Un++)Hs[Un-1]=arguments[Un];(Is=Kt[Lr])===null||Is===void 0||Is.call.apply(Is,[Kt,Ji].concat(Hs))}}(ss||Xn)&&(Bt.onClick=function(Lr){var Jr;Ai.current&&Xn?Kr(!1):!Ai.current&&ss&&(pn(Lr),Kr(!0));for(var yn=arguments.length,Ln=new Array(yn>1?yn-1:0),Ji=1;Ji<yn;Ji++)Ln[Ji-1]=arguments[Ji];(Jr=Kt.onClick)===null||Jr===void 0||Jr.call.apply(Jr,[Kt,Lr].concat(Ln))}),ir(Mr,Xn,lt,mi,kt,rr,lr,Kr);var zn=rs.has("hover"),Wn=Vr.has("hover"),Pn,An;zn&&(rn("onMouseEnter",!0,_r,function(Lr){pn(Lr)}),rn("onPointerEnter",!0,_r,function(Lr){pn(Lr)}),Pn=function(Jr){(Mr||Di)&&mi!==null&&mi!==void 0&&mi.contains(Jr.target)&&Kr(!0,_r)},Ae&&(Bt.onMouseMove=function(Lr){var Jr;(Jr=Kt.onMouseMove)===null||Jr===void 0||Jr.call(Kt,Lr)})),Wn&&(rn("onMouseLeave",!1,Ge),rn("onPointerLeave",!1,Ge),An=function(){Kr(!1,Ge)}),rs.has("focus")&&rn("onFocus",!0,it),Vr.has("focus")&&rn("onBlur",!1,Pt),rs.has("contextMenu")&&(Bt.onContextMenu=function(Lr){var Jr;Ai.current&&Vr.has("contextMenu")?Kr(!1):(pn(Lr),Kr(!0)),Lr.preventDefault();for(var yn=arguments.length,Ln=new Array(yn>1?yn-1:0),Ji=1;Ji<yn;Ji++)Ln[Ji-1]=arguments[Ji];(Jr=Kt.onContextMenu)===null||Jr===void 0||Jr.call.apply(Jr,[Kt,Lr].concat(Ln))}),Mt&&(Bt.className=E()(Kt.className,Mt));var Oi=(0,pe.Z)((0,pe.Z)({},Kt),Bt),xi={},Mi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Mi.forEach(function(Lr){Et[Lr]&&(xi[Lr]=function(){for(var Jr,yn=arguments.length,Ln=new Array(yn),Ji=0;Ji<yn;Ji++)Ln[Ji]=arguments[Ji];(Jr=Oi[Lr])===null||Jr===void 0||Jr.call.apply(Jr,[Oi].concat(Ln)),Et[Lr].apply(Et,Ln)})});var sn=O.cloneElement(ft,(0,pe.Z)((0,pe.Z)({},Oi),xi)),kn={x:ki,y:Ki},Jn=ei?(0,pe.Z)({},ei!==!0?ei:{}):null;return O.createElement(O.Fragment,null,O.createElement(Me.Z,{disabled:!Mr,ref:Lt,onResize:un},O.createElement(ve,{getTriggerDOMNode:ct},sn)),O.createElement(We.Provider,{value:Br},O.createElement(oe,{portal:Ze,ref:Gi,prefixCls:ye,popup:fe,className:E()(xr,vs),style:Ne,target:lt,onMouseEnter:Pn,onMouseLeave:An,onPointerEnter:Pn,zIndex:Se,open:Mr,keepDom:Di,fresh:qt,onClick:Yt,mask:kt,motion:Tr,maskMotion:pr,onVisibleChanged:cn,onPrepare:Fi,forceRender:B,autoDestroy:Ft,getPopupContainer:T,align:vn,arrow:Jn,arrowPos:kn,ready:ts,offsetX:Yn,offsetY:$n,offsetR:Gn,offsetB:Pr,onAlign:xn,stretch:Ke,targetWidth:pi/Wi,targetHeight:mn/Vn})))});return nt}var Gr=li(Le.Z)},50304:function(){"use strict"},36785:function(Fr,Rt,J){"use strict";J.d(Rt,{o2:function(){return te},yT:function(){return E}});var pe=J(80702),Pe=J(33166);const rt=Pe.i.map(Me=>`${Me}-inverse`),Le=["success","processing","error","default","warning"];function te(Me){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,pe.Z)(rt),(0,pe.Z)(Pe.i)).includes(Me):Pe.i.includes(Me)}function E(Me){return Le.includes(Me)}},79676:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return E}});var pe=J(19447);function Pe(Me,$,d,be){if(be===!1)return{adjustX:!1,adjustY:!1};const j=be&&typeof be=="object"?be:{},k={};switch(Me){case"top":case"bottom":k.shiftX=$.dropdownArrowOffset*2+d;break;case"left":case"right":k.shiftY=$.dropdownArrowOffsetVertical*2+d;break}const M=Object.assign(Object.assign({},k),j);return M.shiftX||(M.adjustX=!0),M.shiftY||(M.adjustY=!0),M}const rt={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},Le={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},te=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function E(Me){const{arrowWidth:$,autoAdjustOverflow:d,arrowPointAtCenter:be,offset:j,borderRadius:k,visibleFirst:M}=Me,O=$/2,K={};return Object.keys(rt).forEach(se=>{const ae=be&&Le[se]||rt[se],Z=Object.assign(Object.assign({},ae),{offset:[0,0]});switch(K[se]=Z,te.has(se)&&(Z.autoArrow=!1),se){case"top":case"topLeft":case"topRight":Z.offset[1]=-O-j;break;case"bottom":case"bottomLeft":case"bottomRight":Z.offset[1]=O+j;break;case"left":case"leftTop":case"leftBottom":Z.offset[0]=-O-j;break;case"right":case"rightTop":case"rightBottom":Z.offset[0]=O+j;break}const q=(0,pe.fS)({contentRadius:k,limitVerticalRadius:!0});if(be)switch(se){case"topLeft":case"bottomLeft":Z.offset[0]=-q.dropdownArrowOffset-O;break;case"topRight":case"bottomRight":Z.offset[0]=q.dropdownArrowOffset+O;break;case"leftTop":case"rightTop":Z.offset[1]=-q.dropdownArrowOffset-O;break;case"leftBottom":case"rightBottom":Z.offset[1]=q.dropdownArrowOffset+O;break}Z.overflow=Pe(se,q,$,d),M&&(Z.htmlRegion="visibleFirst")}),K}},19080:function(Fr,Rt,J){"use strict";J.d(Rt,{F:function(){return te},Z:function(){return Le}});var pe=J(92310),Pe=J.n(pe);const rt=null;function Le(E,Me,$){return Pe()({[`${E}-status-success`]:Me==="success",[`${E}-status-warning`]:Me==="warning",[`${E}-status-error`]:Me==="error",[`${E}-status-validating`]:Me==="validating",[`${E}-has-feedback`]:$})}const te=(E,Me)=>Me||E},5871:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return _r}});var pe=J(84105),Pe=J(87395),rt=J(92310),Le=J.n(rt),te=J(72308),E=J(49618),Me=J(62853),$=J(52487),d=J(74416),be=J(96949),j=J(55090);function k(){return typeof BigInt=="function"}function M(Fe){return!Fe&&Fe!==0&&!Number.isNaN(Fe)||!String(Fe).trim()}function O(Fe){var Ge=Fe.trim(),it=Ge.startsWith("-");it&&(Ge=Ge.slice(1)),Ge=Ge.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),Ge.startsWith(".")&&(Ge="0".concat(Ge));var Pt=Ge||"0",kt=Pt.split("."),zt=kt[0]||"0",rr=kt[1]||"0";zt==="0"&&rr==="0"&&(it=!1);var T=it?"-":"";return{negative:it,negativeStr:T,trimStr:Pt,integerStr:zt,decimalStr:rr,fullStr:"".concat(T).concat(Pt)}}function K(Fe){var Ge=String(Fe);return!Number.isNaN(Number(Ge))&&Ge.includes("e")}function se(Fe){var Ge=String(Fe);if(K(Fe)){var it=Number(Ge.slice(Ge.indexOf("e-")+2)),Pt=Ge.match(/\.(\d+)/);return Pt!=null&&Pt[1]&&(it+=Pt[1].length),it}return Ge.includes(".")&&Z(Ge)?Ge.length-Ge.indexOf(".")-1:0}function ae(Fe){var Ge=String(Fe);if(K(Fe)){if(Fe>Number.MAX_SAFE_INTEGER)return String(k()?BigInt(Fe).toString():Number.MAX_SAFE_INTEGER);if(Fe<Number.MIN_SAFE_INTEGER)return String(k()?BigInt(Fe).toString():Number.MIN_SAFE_INTEGER);Ge=Fe.toFixed(se(Ge))}return O(Ge).fullStr}function Z(Fe){return typeof Fe=="number"?!Number.isNaN(Fe):Fe?/^\s*-?\d+(\.\d+)?\s*$/.test(Fe)||/^\s*-?\d+\.\s*$/.test(Fe)||/^\s*-?\.\d+\s*$/.test(Fe):!1}var q=function(){function Fe(Ge){if((0,be.Z)(this,Fe),(0,E.Z)(this,"origin",""),(0,E.Z)(this,"negative",void 0),(0,E.Z)(this,"integer",void 0),(0,E.Z)(this,"decimal",void 0),(0,E.Z)(this,"decimalLen",void 0),(0,E.Z)(this,"empty",void 0),(0,E.Z)(this,"nan",void 0),M(Ge)){this.empty=!0;return}if(this.origin=String(Ge),Ge==="-"||Number.isNaN(Ge)){this.nan=!0;return}var it=Ge;if(K(it)&&(it=Number(it)),it=typeof it=="string"?it:ae(it),Z(it)){var Pt=O(it);this.negative=Pt.negative;var kt=Pt.trimStr.split(".");this.integer=BigInt(kt[0]);var zt=kt[1]||"0";this.decimal=BigInt(zt),this.decimalLen=zt.length}else this.nan=!0}return(0,j.Z)(Fe,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(it){var Pt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(it,"0"));return BigInt(Pt)}},{key:"negate",value:function(){var it=new Fe(this.toString());return it.negative=!it.negative,it}},{key:"cal",value:function(it,Pt,kt){var zt=Math.max(this.getDecimalStr().length,it.getDecimalStr().length),rr=this.alignDecimal(zt),T=it.alignDecimal(zt),B=Pt(rr,T).toString(),dt=kt(zt),G=O(B),fe=G.negativeStr,xr=G.trimStr,Ne="".concat(fe).concat(xr.padStart(dt+1,"0"));return new Fe("".concat(Ne.slice(0,-dt),".").concat(Ne.slice(-dt)))}},{key:"add",value:function(it){if(this.isInvalidate())return new Fe(it);var Pt=new Fe(it);return Pt.isInvalidate()?this:this.cal(Pt,function(kt,zt){return kt+zt},function(kt){return kt})}},{key:"multi",value:function(it){var Pt=new Fe(it);return this.isInvalidate()||Pt.isInvalidate()?new Fe(NaN):this.cal(Pt,function(kt,zt){return kt*zt},function(kt){return kt*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(it){return this.toString()===(it==null?void 0:it.toString())}},{key:"lessEquals",value:function(it){return this.add(it.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return it?this.isInvalidate()?"":O("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Fe}(),Y=function(){function Fe(Ge){if((0,be.Z)(this,Fe),(0,E.Z)(this,"origin",""),(0,E.Z)(this,"number",void 0),(0,E.Z)(this,"empty",void 0),M(Ge)){this.empty=!0;return}this.origin=String(Ge),this.number=Number(Ge)}return(0,j.Z)(Fe,[{key:"negate",value:function(){return new Fe(-this.toNumber())}},{key:"add",value:function(it){if(this.isInvalidate())return new Fe(it);var Pt=Number(it);if(Number.isNaN(Pt))return this;var kt=this.number+Pt;if(kt>Number.MAX_SAFE_INTEGER)return new Fe(Number.MAX_SAFE_INTEGER);if(kt<Number.MIN_SAFE_INTEGER)return new Fe(Number.MIN_SAFE_INTEGER);var zt=Math.max(se(this.number),se(Pt));return new Fe(kt.toFixed(zt))}},{key:"multi",value:function(it){var Pt=Number(it);if(this.isInvalidate()||Number.isNaN(Pt))return new Fe(NaN);var kt=this.number*Pt;if(kt>Number.MAX_SAFE_INTEGER)return new Fe(Number.MAX_SAFE_INTEGER);if(kt<Number.MIN_SAFE_INTEGER)return new Fe(Number.MIN_SAFE_INTEGER);var zt=Math.max(se(this.number),se(Pt));return new Fe(kt.toFixed(zt))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(it){return this.toNumber()===(it==null?void 0:it.toNumber())}},{key:"lessEquals",value:function(it){return this.add(it.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return it?this.isInvalidate()?"":ae(this.number):this.origin}}]),Fe}();function ue(Fe){return k()?new q(Fe):new Y(Fe)}function ee(Fe,Ge,it){var Pt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Fe==="")return"";var kt=O(Fe),zt=kt.negativeStr,rr=kt.integerStr,T=kt.decimalStr,B="".concat(Ge).concat(T),dt="".concat(zt).concat(rr);if(it>=0){var G=Number(T[it]);if(G>=5&&!Pt){var fe=ue(Fe).add("".concat(zt,"0.").concat("0".repeat(it)).concat(10-G));return ee(fe.toString(),Ge,it,Pt)}return it===0?dt:"".concat(dt).concat(Ge).concat(T.padEnd(it,"0").slice(0,it))}return B===".0"?dt:"".concat(dt).concat(B)}var oe=ue,De=J(93681),ve=J(34280),Ye=J(8654),We=J(59301),ut=J(48736);function pt(Fe,Ge){var it=(0,We.useRef)(null);function Pt(){try{var zt=Fe.selectionStart,rr=Fe.selectionEnd,T=Fe.value,B=T.substring(0,zt),dt=T.substring(rr);it.current={start:zt,end:rr,value:T,beforeTxt:B,afterTxt:dt}}catch(G){}}function kt(){if(Fe&&it.current&&Ge)try{var zt=Fe.value,rr=it.current,T=rr.beforeTxt,B=rr.afterTxt,dt=rr.start,G=zt.length;if(zt.endsWith(B))G=zt.length-it.current.afterTxt.length;else if(zt.startsWith(T))G=T.length;else{var fe=T[dt-1],xr=zt.indexOf(fe,dt-1);xr!==-1&&(G=xr+1)}Fe.setSelectionRange(G,G)}catch(Ne){(0,ut.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Ne.message))}}return[Pt,kt]}var de=J(49658),re=function(){var Ge=(0,We.useState)(!1),it=(0,$.Z)(Ge,2),Pt=it[0],kt=it[1];return(0,ve.Z)(function(){kt((0,de.Z)())},[]),Pt},ce=re,he=J(16089),Re=200,we=600;function D(Fe){var Ge=Fe.prefixCls,it=Fe.upNode,Pt=Fe.downNode,kt=Fe.upDisabled,zt=Fe.downDisabled,rr=Fe.onStep,T=We.useRef(),B=We.useRef([]),dt=We.useRef();dt.current=rr;var G=function(){clearTimeout(T.current)},fe=function(Ke,V){Ke.preventDefault(),G(),dt.current(V);function qt(){dt.current(V),T.current=setTimeout(qt,Re)}T.current=setTimeout(qt,we)};We.useEffect(function(){return function(){G(),B.current.forEach(function(Se){return he.Z.cancel(Se)})}},[]);var xr=ce();if(xr)return null;var Ne="".concat(Ge,"-handler"),He=Le()(Ne,"".concat(Ne,"-up"),(0,E.Z)({},"".concat(Ne,"-up-disabled"),kt)),Je=Le()(Ne,"".concat(Ne,"-down"),(0,E.Z)({},"".concat(Ne,"-down-disabled"),zt)),W=function(){return B.current.push((0,he.Z)(G))},ge={unselectable:"on",role:"button",onMouseUp:W,onMouseLeave:W};return We.createElement("div",{className:"".concat(Ne,"-wrap")},We.createElement("span",(0,te.Z)({},ge,{onMouseDown:function(Ke){fe(Ke,!0)},"aria-label":"Increase Value","aria-disabled":kt,className:He}),it||We.createElement("span",{unselectable:"on",className:"".concat(Ge,"-handler-up-inner")})),We.createElement("span",(0,te.Z)({},ge,{onMouseDown:function(Ke){fe(Ke,!1)},"aria-label":"Decrease Value","aria-disabled":zt,className:Je}),Pt||We.createElement("span",{unselectable:"on",className:"".concat(Ge,"-handler-down-inner")})))}function L(Fe){var Ge=typeof Fe=="number"?ae(Fe):O(Fe).fullStr,it=Ge.includes(".");return it?O(Ge.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Fe+"0"}var ie=J(5643),xe=function(){var Fe=(0,We.useRef)(0),Ge=function(){he.Z.cancel(Fe.current)};return(0,We.useEffect)(function(){return Ge},[]),function(it){Ge(),Fe.current=(0,he.Z)(function(){it()})}},at=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],ot=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],At=function(Ge,it){return Ge||it.isEmpty()?it.toString():it.toNumber()},Xe=function(Ge){var it=oe(Ge);return it.isInvalidate()?null:it},ar=We.forwardRef(function(Fe,Ge){var it,Pt=Fe.prefixCls,kt=Pt===void 0?"rc-input-number":Pt,zt=Fe.className,rr=Fe.style,T=Fe.min,B=Fe.max,dt=Fe.step,G=dt===void 0?1:dt,fe=Fe.defaultValue,xr=Fe.value,Ne=Fe.disabled,He=Fe.readOnly,Je=Fe.upHandler,W=Fe.downHandler,ge=Fe.keyboard,Se=Fe.controls,Ke=Se===void 0?!0:Se,V=Fe.classNames,qt=Fe.stringMode,Ae=Fe.parser,Yt=Fe.formatter,vr=Fe.precision,ei=Fe.decimalSeparator,Ri=Fe.onChange,ui=Fe.onInput,wr=Fe.onPressEnter,bi=Fe.onStep,me=(0,d.Z)(Fe,at),Te="".concat(kt,"-input"),Mt=We.useRef(null),ct=We.useState(!1),Et=(0,$.Z)(ct,2),Ft=Et[0],or=Et[1],Jt=We.useRef(!1),Rr=We.useRef(!1),Sr=We.useRef(!1),oi=We.useState(function(){return oe(xr!=null?xr:fe)}),Dr=(0,$.Z)(oi,2),Br=Dr[0],ni=Dr[1];function _i(Ar){xr===void 0&&ni(Ar)}var Ni=We.useCallback(function(Ar,je){if(!je)return vr>=0?vr:Math.max(se(Ar),se(G))},[vr,G]),mi=We.useCallback(function(Ar){var je=String(Ar);if(Ae)return Ae(je);var cr=je;return ei&&(cr=cr.replace(ei,".")),cr.replace(/[^\w.-]+/g,"")},[Ae,ei]),Ur=We.useRef(""),Gi=We.useCallback(function(Ar,je){if(Yt)return Yt(Ar,{userTyping:je,input:String(Ur.current)});var cr=typeof Ar=="number"?ae(Ar):Ar;if(!je){var yr=Ni(cr,je);if(Z(cr)&&(ei||yr>=0)){var jr=ei||".";cr=ee(cr,jr,yr)}}return cr},[Yt,Ni,ei]),Yr=We.useState(function(){var Ar=fe!=null?fe:xr;return Br.isInvalidate()&&["string","number"].includes((0,Me.Z)(Ar))?Number.isNaN(Ar)?"":Ar:Gi(Br.toString(),!1)}),Or=(0,$.Z)(Yr,2),lt=Or[0],tt=Or[1];Ur.current=lt;function _t(Ar,je){tt(Gi(Ar.isInvalidate()?Ar.toString(!1):Ar.toString(!je),je))}var Lt=We.useMemo(function(){return Xe(B)},[B,vr]),ft=We.useMemo(function(){return Xe(T)},[T,vr]),Kt=We.useMemo(function(){return!Lt||!Br||Br.isInvalidate()?!1:Lt.lessEquals(Br)},[Lt,Br]),Bt=We.useMemo(function(){return!ft||!Br||Br.isInvalidate()?!1:Br.lessEquals(ft)},[ft,Br]),lr=pt(Mt.current,Ft),Tr=(0,$.Z)(lr,2),pr=Tr[0],si=Tr[1],ci=function(je){return Lt&&!je.lessEquals(Lt)?Lt:ft&&!ft.lessEquals(je)?ft:null},gi=function(je){return!ci(je)},Er=function(je,cr){var yr=je,jr=gi(yr)||yr.isEmpty();if(!yr.isEmpty()&&!cr&&(yr=ci(yr)||yr,jr=!0),!He&&!Ne&&jr){var nn=yr.toString(),vi=Ni(nn,cr);return vi>=0&&(yr=oe(ee(nn,".",vi)),gi(yr)||(yr=oe(ee(nn,".",vi,!0)))),yr.equals(Br)||(_i(yr),Ri==null||Ri(yr.isEmpty()?null:At(qt,yr)),xr===void 0&&_t(yr,cr)),yr}return Br},Mr=xe(),Si=function Ar(je){if(pr(),Ur.current=je,tt(je),!Rr.current){var cr=mi(je),yr=oe(cr);yr.isNaN()||Er(yr,!0)}ui==null||ui(je),Mr(function(){var jr=je;Ae||(jr=je.replace(/。/g,".")),jr!==je&&Ar(jr)})},Ai=function(){Rr.current=!0},Xr=function(){Rr.current=!1,Si(Mt.current.value)},ri=function(je){Si(je.target.value)},ii=function(je){var cr;if(!(je&&Kt||!je&&Bt)){Jt.current=!1;var yr=oe(Sr.current?L(G):G);je||(yr=yr.negate());var jr=(Br||oe(0)).add(yr.toString()),nn=Er(jr,!1);bi==null||bi(At(qt,nn),{offset:Sr.current?L(G):G,type:je?"up":"down"}),(cr=Mt.current)===null||cr===void 0||cr.focus()}},ai=function(je){var cr=oe(mi(lt)),yr=cr;cr.isNaN()?yr=Er(Br,je):yr=Er(cr,je),xr!==void 0?_t(Br,!1):yr.isNaN()||_t(yr,!1)},Kr=function(){Jt.current=!0},fi=function(je){var cr=je.key,yr=je.shiftKey;Jt.current=!0,Sr.current=yr,cr==="Enter"&&(Rr.current||(Jt.current=!1),ai(!1),wr==null||wr(je)),ge!==!1&&!Rr.current&&["Up","ArrowUp","Down","ArrowDown"].includes(cr)&&(ii(cr==="Up"||cr==="ArrowUp"),je.preventDefault())},Pi=function(){Jt.current=!1,Sr.current=!1},Di=function(){ai(!1),or(!1),Jt.current=!1};return(0,ve.o)(function(){Br.isInvalidate()||_t(Br,!1)},[vr]),(0,ve.o)(function(){var Ar=oe(xr);ni(Ar);var je=oe(mi(lt));(!Ar.equals(je)||!Jt.current||Yt)&&_t(Ar,Jt.current)},[xr]),(0,ve.o)(function(){Yt&&si()},[lt]),We.createElement("div",{className:Le()(kt,V==null?void 0:V.input,zt,(it={},(0,E.Z)(it,"".concat(kt,"-focused"),Ft),(0,E.Z)(it,"".concat(kt,"-disabled"),Ne),(0,E.Z)(it,"".concat(kt,"-readonly"),He),(0,E.Z)(it,"".concat(kt,"-not-a-number"),Br.isNaN()),(0,E.Z)(it,"".concat(kt,"-out-of-range"),!Br.isInvalidate()&&!gi(Br)),it)),style:rr,onFocus:function(){or(!0)},onBlur:Di,onKeyDown:fi,onKeyUp:Pi,onCompositionStart:Ai,onCompositionEnd:Xr,onBeforeInput:Kr},Ke&&We.createElement(D,{prefixCls:kt,upNode:Je,downNode:W,upDisabled:Kt,downDisabled:Bt,onStep:ii}),We.createElement("div",{className:"".concat(Te,"-wrap")},We.createElement("input",(0,te.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":T,"aria-valuemax":B,"aria-valuenow":Br.isInvalidate()?null:Br.toString(),step:G},me,{ref:(0,Ye.sQ)(Mt,Ge),className:Te,value:lt,onChange:ri,disabled:Ne,readOnly:He}))))}),jt=We.forwardRef(function(Fe,Ge){var it=Fe.disabled,Pt=Fe.style,kt=Fe.prefixCls,zt=Fe.value,rr=Fe.prefix,T=Fe.suffix,B=Fe.addonBefore,dt=Fe.addonAfter,G=Fe.classes,fe=Fe.className,xr=Fe.classNames,Ne=(0,d.Z)(Fe,ot),He=We.useRef(null),Je=function(ge){He.current&&(0,ie.nH)(He.current,ge)};return We.createElement(De.BaseInput,{inputElement:We.createElement(ar,(0,te.Z)({prefixCls:kt,disabled:it,classNames:xr,ref:(0,Ye.sQ)(He,Ge)},Ne)),className:fe,triggerFocus:Je,prefixCls:kt,value:zt,disabled:it,style:Pt,prefix:rr,suffix:T,addonAfter:dt,addonBefore:B,classes:G,classNames:xr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});jt.displayName="InputNumber";var Ot=jt,kr=Ot,$r=J(19080),ir=J(36355),zr=J(92736),li=J(1684),Gr=J(19716),Ze=J(32441),nt=J(33234),Qe=J(9937),Ct=J(17313),Dt=J(74207),ye=J(83116),Oe=J(37613);const et=(Fe,Ge)=>{let{componentCls:it,borderRadiusSM:Pt,borderRadiusLG:kt}=Fe;const zt=Ge==="lg"?kt:Pt;return{[`&-${Ge}`]:{[`${it}-handler-wrap`]:{borderStartEndRadius:zt,borderEndEndRadius:zt},[`${it}-handler-up`]:{borderStartEndRadius:zt},[`${it}-handler-down`]:{borderEndEndRadius:zt}}}},vt=Fe=>{const{componentCls:Ge,lineWidth:it,lineType:Pt,colorBorder:kt,borderRadius:zt,fontSizeLG:rr,controlHeightLG:T,controlHeightSM:B,colorError:dt,paddingInlineSM:G,colorTextDescription:fe,motionDurationMid:xr,handleHoverColor:Ne,paddingInline:He,paddingBlock:Je,handleBg:W,handleActiveBg:ge,colorTextDisabled:Se,borderRadiusSM:Ke,borderRadiusLG:V,controlWidth:qt,handleVisible:Ae,handleBorderColor:Yt}=Fe;return[{[Ge]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ct.Wf)(Fe)),(0,Qe.ik)(Fe)),(0,Qe.bi)(Fe,Ge)),{display:"inline-block",width:qt,margin:0,padding:0,border:`${it}px ${Pt} ${kt}`,borderRadius:zt,"&-rtl":{direction:"rtl",[`${Ge}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:rr,borderRadius:V,[`input${Ge}-input`]:{height:T-2*it}},"&-sm":{padding:0,borderRadius:Ke,[`input${Ge}-input`]:{height:B-2*it,padding:`0 ${G}px`}},"&:hover":Object.assign({},(0,Qe.pU)(Fe)),"&-focused":Object.assign({},(0,Qe.M1)(Fe)),"&-out-of-range":{[`${Ge}-input-wrap`]:{input:{color:dt}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,Ct.Wf)(Fe)),(0,Qe.s7)(Fe)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${Ge}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${Ge}-group-addon`]:{borderRadius:V,fontSize:Fe.fontSizeLG}},"&-sm":{[`${Ge}-group-addon`]:{borderRadius:Ke}},[`${Ge}-wrapper-disabled > ${Ge}-group-addon`]:Object.assign({},(0,Qe.Xy)(Fe))}}),[`&-disabled ${Ge}-input`]:{cursor:"not-allowed"},[Ge]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ct.Wf)(Fe)),{width:"100%",padding:`${Je}px ${He}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:zt,outline:0,transition:`all ${xr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,Qe.nz)(Fe.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[Ge]:Object.assign(Object.assign(Object.assign({[`&:hover ${Ge}-handler-wrap, &-focused ${Ge}-handler-wrap`]:{opacity:1},[`${Ge}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:Fe.handleWidth,height:"100%",background:W,borderStartStartRadius:0,borderStartEndRadius:zt,borderEndEndRadius:zt,borderEndStartRadius:0,opacity:Ae===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${xr} linear ${xr}`,[`${Ge}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${Ge}-handler-up-inner,
${Ge}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:Fe.handleFontSize}}},[`${Ge}-handler`]:{height:"50%",overflow:"hidden",color:fe,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${it}px ${Pt} ${Yt}`,transition:`all ${xr} linear`,"&:active":{background:ge},"&:hover":{height:"60%",[`
${Ge}-handler-up-inner,
${Ge}-handler-down-inner
`]:{color:Ne}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,Ct.Ro)()),{color:fe,transition:`all ${xr} linear`,userSelect:"none"})},[`${Ge}-handler-up`]:{borderStartEndRadius:zt},[`${Ge}-handler-down`]:{borderBlockStart:`${it}px ${Pt} ${Yt}`,borderEndEndRadius:zt}},et(Fe,"lg")),et(Fe,"sm")),{"&-disabled, &-readonly":{[`${Ge}-handler-wrap`]:{display:"none"},[`${Ge}-input`]:{color:"inherit"}},[`
${Ge}-handler-up-disabled,
${Ge}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${Ge}-handler-up-disabled:hover &-handler-up-inner,
${Ge}-handler-down-disabled:hover &-handler-down-inner
`]:{color:Se}})},{[`${Ge}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${Ge}-handler-down`]:{borderBlockStartWidth:0}}}]},wt=Fe=>{const{componentCls:Ge,paddingBlock:it,paddingInline:Pt,inputAffixPadding:kt,controlWidth:zt,borderRadiusLG:rr,borderRadiusSM:T}=Fe;return{[`${Ge}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,Qe.ik)(Fe)),(0,Qe.bi)(Fe,`${Ge}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:zt,padding:0,paddingInlineStart:Pt,"&-lg":{borderRadius:rr},"&-sm":{borderRadius:T},[`&:not(${Ge}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,Qe.pU)(Fe)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${Ge}-disabled`]:{background:"transparent"},[`> div${Ge}`]:{width:"100%",border:"none",outline:"none",[`&${Ge}-focused`]:{boxShadow:"none !important"}},[`input${Ge}-input`]:{padding:`${it}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${Ge}-handler-wrap`]:{zIndex:2},[Ge]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:kt},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Pt,marginInlineStart:kt}}})}};var Ht=(0,ye.Z)("InputNumber",Fe=>{const Ge=(0,Oe.TS)(Fe,(0,Qe.e5)(Fe));return[vt(Ge),wt(Ge),(0,Dt.c)(Ge)]},Fe=>Object.assign(Object.assign({},(0,Qe.TM)(Fe)),{controlWidth:90,handleWidth:Fe.controlHeightSM-Fe.lineWidth*2,handleFontSize:Fe.fontSize/2,handleVisible:"auto",handleActiveBg:Fe.colorFillAlter,handleBg:Fe.colorBgContainer,handleHoverColor:Fe.colorPrimary,handleBorderColor:Fe.colorBorder})),fr=function(Fe,Ge){var it={};for(var Pt in Fe)Object.prototype.hasOwnProperty.call(Fe,Pt)&&Ge.indexOf(Pt)<0&&(it[Pt]=Fe[Pt]);if(Fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var kt=0,Pt=Object.getOwnPropertySymbols(Fe);kt<Pt.length;kt++)Ge.indexOf(Pt[kt])<0&&Object.prototype.propertyIsEnumerable.call(Fe,Pt[kt])&&(it[Pt[kt]]=Fe[Pt[kt]]);return it};const Xt=We.forwardRef((Fe,Ge)=>{const{getPrefixCls:it,direction:Pt}=We.useContext(ir.E_),kt=We.useRef(null);We.useImperativeHandle(Ge,()=>kt.current);const{className:zt,rootClassName:rr,size:T,disabled:B,prefixCls:dt,addonBefore:G,addonAfter:fe,prefix:xr,bordered:Ne=!0,readOnly:He,status:Je,controls:W}=Fe,ge=fr(Fe,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),Se=it("input-number",dt),[Ke,V]=Ht(Se),{compactSize:qt,compactItemClassnames:Ae}=(0,nt.ri)(Se,Pt);let Yt=We.createElement(Pe.Z,{className:`${Se}-handler-up-inner`}),vr=We.createElement(pe.Z,{className:`${Se}-handler-down-inner`});const ei=typeof W=="boolean"?W:void 0;typeof W=="object"&&(Yt=typeof W.upIcon=="undefined"?Yt:We.createElement("span",{className:`${Se}-handler-up-inner`},W.upIcon),vr=typeof W.downIcon=="undefined"?vr:We.createElement("span",{className:`${Se}-handler-down-inner`},W.downIcon));const{hasFeedback:Ri,status:ui,isFormItemInput:wr,feedbackIcon:bi}=We.useContext(Ze.aM),me=(0,$r.F)(ui,Je),Te=(0,Gr.Z)(Jt=>{var Rr;return(Rr=T!=null?T:qt)!==null&&Rr!==void 0?Rr:Jt}),Mt=We.useContext(li.Z),ct=B!=null?B:Mt,Et=Le()({[`${Se}-lg`]:Te==="large",[`${Se}-sm`]:Te==="small",[`${Se}-rtl`]:Pt==="rtl",[`${Se}-borderless`]:!Ne,[`${Se}-in-form-item`]:wr},(0,$r.Z)(Se,me),Ae,V),Ft=`${Se}-group`,or=We.createElement(kr,Object.assign({ref:kt,disabled:ct,className:Le()(zt,rr),upHandler:Yt,downHandler:vr,prefixCls:Se,readOnly:He,controls:ei,prefix:xr,suffix:Ri&&bi,addonAfter:fe&&We.createElement(nt.BR,null,We.createElement(Ze.Ux,{override:!0,status:!0},fe)),addonBefore:G&&We.createElement(nt.BR,null,We.createElement(Ze.Ux,{override:!0,status:!0},G)),classNames:{input:Et},classes:{affixWrapper:Le()((0,$r.Z)(`${Se}-affix-wrapper`,me,Ri),{[`${Se}-affix-wrapper-sm`]:Te==="small",[`${Se}-affix-wrapper-lg`]:Te==="large",[`${Se}-affix-wrapper-rtl`]:Pt==="rtl",[`${Se}-affix-wrapper-borderless`]:!Ne},V),wrapper:Le()({[`${Ft}-rtl`]:Pt==="rtl",[`${Se}-wrapper-disabled`]:ct},V),group:Le()({[`${Se}-group-wrapper-sm`]:Te==="small",[`${Se}-group-wrapper-lg`]:Te==="large",[`${Se}-group-wrapper-rtl`]:Pt==="rtl"},(0,$r.Z)(`${Se}-group-wrapper`,me,Ri),V)}},ge));return Ke(or)}),Ue=Xt,Ut=Fe=>We.createElement(zr.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},We.createElement(Xt,Object.assign({},Fe)));Ue._InternalPanelDoNotUseOrYouWillBeFired=Ut;var _r=Ue},9937:function(Fr,Rt,J){"use strict";J.d(Rt,{M1:function(){return Me},TM:function(){return ue},Xy:function(){return $},bi:function(){return j},e5:function(){return Y},ik:function(){return k},nz:function(){return te},pU:function(){return E},s7:function(){return M},x0:function(){return be}});var pe=J(17313),Pe=J(74207),rt=J(37613),Le=J(83116);const te=ee=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:ee,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),E=ee=>({borderColor:ee.hoverBorderColor}),Me=ee=>({borderColor:ee.activeBorderColor,boxShadow:ee.activeShadow,outline:0}),$=ee=>({color:ee.colorTextDisabled,backgroundColor:ee.colorBgContainerDisabled,borderColor:ee.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},E((0,rt.TS)(ee,{hoverBorderColor:ee.colorBorder})))}),d=ee=>{const{paddingBlockLG:oe,fontSizeLG:De,lineHeightLG:ve,borderRadiusLG:Ye,paddingInlineLG:We}=ee;return{padding:`${oe}px ${We}px`,fontSize:De,lineHeight:ve,borderRadius:Ye}},be=ee=>({padding:`${ee.paddingBlockSM}px ${ee.paddingInlineSM}px`,borderRadius:ee.borderRadiusSM}),j=(ee,oe)=>{const{componentCls:De,colorError:ve,colorWarning:Ye,errorActiveShadow:We,warningActiveShadow:ut,colorErrorBorderHover:pt,colorWarningBorderHover:de}=ee;return{[`&-status-error:not(${oe}-disabled):not(${oe}-borderless)${oe}`]:{borderColor:ve,"&:hover":{borderColor:pt},"&:focus, &-focused":Object.assign({},Me((0,rt.TS)(ee,{activeBorderColor:ve,activeShadow:We}))),[`${De}-prefix, ${De}-suffix`]:{color:ve}},[`&-status-warning:not(${oe}-disabled):not(${oe}-borderless)${oe}`]:{borderColor:Ye,"&:hover":{borderColor:de},"&:focus, &-focused":Object.assign({},Me((0,rt.TS)(ee,{activeBorderColor:Ye,activeShadow:ut}))),[`${De}-prefix, ${De}-suffix`]:{color:Ye}}}},k=ee=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${ee.paddingBlock}px ${ee.paddingInline}px`,color:ee.colorText,fontSize:ee.fontSize,lineHeight:ee.lineHeight,backgroundColor:ee.colorBgContainer,backgroundImage:"none",borderWidth:ee.lineWidth,borderStyle:ee.lineType,borderColor:ee.colorBorder,borderRadius:ee.borderRadius,transition:`all ${ee.motionDurationMid}`},te(ee.colorTextPlaceholder)),{"&:hover":Object.assign({},E(ee)),"&:focus, &-focused":Object.assign({},Me(ee)),"&-disabled, &[disabled]":Object.assign({},$(ee)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:ee.controlHeight,lineHeight:ee.lineHeight,verticalAlign:"bottom",transition:`all ${ee.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},d(ee)),"&-sm":Object.assign({},be(ee)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),M=ee=>{const{componentCls:oe,antCls:De}=ee;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:ee.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${oe}, &-lg > ${oe}-group-addon`]:Object.assign({},d(ee)),[`&-sm ${oe}, &-sm > ${oe}-group-addon`]:Object.assign({},be(ee)),[`&-lg ${De}-select-single ${De}-select-selector`]:{height:ee.controlHeightLG},[`&-sm ${De}-select-single ${De}-select-selector`]:{height:ee.controlHeightSM},[`> ${oe}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${oe}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${ee.paddingInline}px`,color:ee.colorText,fontWeight:"normal",fontSize:ee.fontSize,textAlign:"center",backgroundColor:ee.colorFillAlter,border:`${ee.lineWidth}px ${ee.lineType} ${ee.colorBorder}`,borderRadius:ee.borderRadius,transition:`all ${ee.motionDurationSlow}`,lineHeight:1,[`${De}-select`]:{margin:`-${ee.paddingBlock+1}px -${ee.paddingInline}px`,[`&${De}-select-single:not(${De}-select-customize-input)`]:{[`${De}-select-selector`]:{backgroundColor:"inherit",border:`${ee.lineWidth}px ${ee.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${De}-select-selector`]:{color:ee.colorPrimary}}},[`${De}-cascader-picker`]:{margin:`-9px -${ee.paddingInline}px`,backgroundColor:"transparent",[`${De}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${oe}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${oe}-search-with-button &`]:{zIndex:0}}},[`> ${oe}:first-child, ${oe}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${De}-select ${De}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${oe}-affix-wrapper`]:{[`&:not(:first-child) ${oe}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${oe}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${oe}:last-child, ${oe}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${De}-select ${De}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${oe}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${oe}-search &`]:{borderStartStartRadius:ee.borderRadius,borderEndStartRadius:ee.borderRadius}},[`&:not(:first-child), ${oe}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${oe}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,pe.dF)()),{[`${oe}-group-addon, ${oe}-group-wrap, > ${oe}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:ee.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${oe}-affix-wrapper,
& > ${oe}-number-affix-wrapper,
& > ${De}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-ee.lineWidth,borderInlineEndWidth:ee.lineWidth},[`${oe}`]:{float:"none"},[`& > ${De}-select > ${De}-select-selector,
& > ${De}-select-auto-complete ${oe},
& > ${De}-cascader-picker ${oe},
& > ${oe}-group-wrapper ${oe}`]:{borderInlineEndWidth:ee.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${De}-select-focused`]:{zIndex:1},[`& > ${De}-select > ${De}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${De}-select:first-child > ${De}-select-selector,
& > ${De}-select-auto-complete:first-child ${oe},
& > ${De}-cascader-picker:first-child ${oe}`]:{borderStartStartRadius:ee.borderRadius,borderEndStartRadius:ee.borderRadius},[`& > *:last-child,
& > ${De}-select:last-child > ${De}-select-selector,
& > ${De}-cascader-picker:last-child ${oe},
& > ${De}-cascader-picker-focused:last-child ${oe}`]:{borderInlineEndWidth:ee.lineWidth,borderStartEndRadius:ee.borderRadius,borderEndEndRadius:ee.borderRadius},[`& > ${De}-select-auto-complete ${oe}`]:{verticalAlign:"top"},[`${oe}-group-wrapper + ${oe}-group-wrapper`]:{marginInlineStart:-ee.lineWidth,[`${oe}-affix-wrapper`]:{borderRadius:0}},[`${oe}-group-wrapper:not(:last-child)`]:{[`&${oe}-search > ${oe}-group`]:{[`& > ${oe}-group-addon > ${oe}-search-button`]:{borderRadius:0},[`& > ${oe}`]:{borderStartStartRadius:ee.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:ee.borderRadius}}}})}},O=ee=>{const{componentCls:oe,controlHeightSM:De,lineWidth:ve}=ee,We=(De-ve*2-16)/2;return{[oe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(ee)),k(ee)),j(ee,oe)),{'&[type="color"]':{height:ee.controlHeight,[`&${oe}-lg`]:{height:ee.controlHeightLG},[`&${oe}-sm`]:{height:De,paddingTop:We,paddingBottom:We}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},K=ee=>{const{componentCls:oe}=ee;return{[`${oe}-clear-icon`]:{margin:0,color:ee.colorTextQuaternary,fontSize:ee.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${ee.motionDurationSlow}`,"&:hover":{color:ee.colorTextTertiary},"&:active":{color:ee.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${ee.inputAffixPadding}px`}}}},se=ee=>{const{componentCls:oe,inputAffixPadding:De,colorTextDescription:ve,motionDurationSlow:Ye,colorIcon:We,colorIconHover:ut,iconCls:pt}=ee;return{[`${oe}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k(ee)),{display:"inline-flex",[`&:not(${oe}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},E(ee)),{zIndex:1,[`${oe}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${oe}[disabled]`]:{background:"transparent"}},[`> input${oe}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${oe}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:ee.paddingXS}},"&-show-count-suffix":{color:ve},"&-show-count-has-suffix":{marginInlineEnd:ee.paddingXXS},"&-prefix":{marginInlineEnd:De},"&-suffix":{marginInlineStart:De}}}),K(ee)),{[`${pt}${oe}-password-icon`]:{color:We,cursor:"pointer",transition:`all ${Ye}`,"&:hover":{color:ut}}}),j(ee,`${oe}-affix-wrapper`))}},ae=ee=>{const{componentCls:oe,colorError:De,colorWarning:ve,borderRadiusLG:Ye,borderRadiusSM:We}=ee;return{[`${oe}-group`]:Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(ee)),M(ee)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${oe}-group-addon`]:{borderRadius:Ye,fontSize:ee.fontSizeLG}},"&-sm":{[`${oe}-group-addon`]:{borderRadius:We}},"&-status-error":{[`${oe}-group-addon`]:{color:De,borderColor:De}},"&-status-warning":{[`${oe}-group-addon`]:{color:ve,borderColor:ve}},"&-disabled":{[`${oe}-group-addon`]:Object.assign({},$(ee))},[`&:not(${oe}-compact-first-item):not(${oe}-compact-last-item)${oe}-compact-item`]:{[`${oe}, ${oe}-group-addon`]:{borderRadius:0}},[`&:not(${oe}-compact-last-item)${oe}-compact-first-item`]:{[`${oe}, ${oe}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${oe}-compact-first-item)${oe}-compact-last-item`]:{[`${oe}, ${oe}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Z=ee=>{const{componentCls:oe,antCls:De}=ee,ve=`${oe}-search`;return{[ve]:{[`${oe}`]:{"&:hover, &:focus":{borderColor:ee.colorPrimaryHover,[`+ ${oe}-group-addon ${ve}-button:not(${De}-btn-primary)`]:{borderInlineStartColor:ee.colorPrimaryHover}}},[`${oe}-affix-wrapper`]:{borderRadius:0},[`${oe}-lg`]:{lineHeight:ee.lineHeightLG-2e-4},[`> ${oe}-group`]:{[`> ${oe}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${ve}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:ee.borderRadius,borderEndEndRadius:ee.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${ve}-button:not(${De}-btn-primary)`]:{color:ee.colorTextDescription,"&:hover":{color:ee.colorPrimaryHover},"&:active":{color:ee.colorPrimaryActive},[`&${De}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${ve}-button`]:{height:ee.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${ve}-button`]:{height:ee.controlHeightLG},[`&-small ${ve}-button`]:{height:ee.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${oe}-compact-item`]:{[`&:not(${oe}-compact-last-item)`]:{[`${oe}-group-addon`]:{[`${oe}-search-button`]:{marginInlineEnd:-ee.lineWidth,borderRadius:0}}},[`&:not(${oe}-compact-first-item)`]:{[`${oe},${oe}-affix-wrapper`]:{borderRadius:0}},[`> ${oe}-group-addon ${oe}-search-button,
> ${oe},
${oe}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${oe}-affix-wrapper-focused`]:{zIndex:2}}}}},q=ee=>{const{componentCls:oe,paddingLG:De}=ee,ve=`${oe}-textarea`;return{[ve]:{position:"relative","&-show-count":{[`> ${oe}`]:{height:"100%"},[`${oe}-data-count`]:{position:"absolute",bottom:-ee.fontSize*ee.lineHeight,insetInlineEnd:0,color:ee.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${oe}`]:{paddingInlineEnd:De}},[`&-affix-wrapper${ve}-has-feedback`]:{[`${oe}`]:{paddingInlineEnd:De}},[`&-affix-wrapper${oe}-affix-wrapper`]:{padding:0,[`> textarea${oe}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${oe}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${oe}-clear-icon`]:{position:"absolute",insetInlineEnd:ee.paddingXS,insetBlockStart:ee.paddingXS},[`${ve}-suffix`]:{position:"absolute",top:0,insetInlineEnd:ee.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function Y(ee){return(0,rt.TS)(ee,{inputAffixPadding:ee.paddingXXS})}const ue=ee=>{const{controlHeight:oe,fontSize:De,lineHeight:ve,lineWidth:Ye,controlHeightSM:We,controlHeightLG:ut,fontSizeLG:pt,lineHeightLG:de,paddingSM:re,controlPaddingHorizontalSM:ce,controlPaddingHorizontal:he,colorFillAlter:Re,colorPrimaryHover:we,controlOutlineWidth:D,controlOutline:L,colorErrorOutline:ie,colorWarningOutline:xe}=ee;return{paddingBlock:Math.max(Math.round((oe-De*ve)/2*10)/10-Ye,3),paddingBlockSM:Math.max(Math.round((We-De*ve)/2*10)/10-Ye,0),paddingBlockLG:Math.ceil((ut-pt*de)/2*10)/10-Ye,paddingInline:re-Ye,paddingInlineSM:ce-Ye,paddingInlineLG:he-Ye,addonBg:Re,activeBorderColor:we,hoverBorderColor:we,activeShadow:`0 0 0 ${D}px ${L}`,errorActiveShadow:`0 0 0 ${D}px ${ie}`,warningActiveShadow:`0 0 0 ${D}px ${xe}`}};Rt.ZP=(0,Le.Z)("Input",ee=>{const oe=(0,rt.TS)(ee,Y(ee));return[O(oe),q(oe),se(oe),ae(oe),Z(oe),(0,Pe.c)(oe)]},ue)},5112:function(Fr,Rt,J){"use strict";J.d(Rt,{ZP:function(){return L}});var pe=J(92310),Pe=J.n(pe),rt=J(18929),Le=J(26112),te=J(59301),E=J(36355),Me=J(19716);const $=te.createContext(null),d=$.Provider;var be=$;const j=te.createContext(null),k=j.Provider;var M=J(5630),O=J(8654),K=J(1684),se=J(32441),ae=J(17313),Z=J(83116),q=J(37613);const Y=ie=>{const{componentCls:xe,antCls:at}=ie,ot=`${xe}-group`;return{[ot]:Object.assign(Object.assign({},(0,ae.Wf)(ie)),{display:"inline-block",fontSize:0,[`&${ot}-rtl`]:{direction:"rtl"},[`${at}-badge ${at}-badge-count`]:{zIndex:1},[`> ${at}-badge:not(:first-child) > ${at}-button-wrapper`]:{borderInlineStart:"none"}})}},ue=ie=>{const{componentCls:xe,wrapperMarginInlineEnd:at,colorPrimary:ot,radioSize:At,motionDurationSlow:Xe,motionDurationMid:ar,motionEaseInOutCirc:jt,colorBgContainer:Ot,colorBorder:kr,lineWidth:$r,dotSize:ir,colorBgContainerDisabled:zr,colorTextDisabled:li,paddingXS:Gr,dotColorDisabled:Ze,lineType:nt,radioDotDisabledSize:Qe,wireframe:Ct,colorWhite:Dt}=ie,ye=`${xe}-inner`;return{[`${xe}-wrapper`]:Object.assign(Object.assign({},(0,ae.Wf)(ie)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:at,cursor:"pointer",[`&${xe}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:ie.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${xe}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${$r}px ${nt} ${ot}`,borderRadius:"50%",visibility:"hidden",content:'""'},[xe]:Object.assign(Object.assign({},(0,ae.Wf)(ie)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${xe}-wrapper:hover &,
&:hover ${ye}`]:{borderColor:ot},[`${xe}-input:focus-visible + ${ye}`]:Object.assign({},(0,ae.oN)(ie)),[`${xe}:hover::after, ${xe}-wrapper:hover &::after`]:{visibility:"visible"},[`${xe}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:At,height:At,marginBlockStart:At/-2,marginInlineStart:At/-2,backgroundColor:Ct?ot:Dt,borderBlockStart:0,borderInlineStart:0,borderRadius:At,transform:"scale(0)",opacity:0,transition:`all ${Xe} ${jt}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:At,height:At,backgroundColor:Ot,borderColor:kr,borderStyle:"solid",borderWidth:$r,borderRadius:"50%",transition:`all ${ar}`},[`${xe}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${xe}-checked`]:{[ye]:{borderColor:ot,backgroundColor:Ct?Ot:ot,"&::after":{transform:`scale(${ir/At})`,opacity:1,transition:`all ${Xe} ${jt}`}}},[`${xe}-disabled`]:{cursor:"not-allowed",[ye]:{backgroundColor:zr,borderColor:kr,cursor:"not-allowed","&::after":{backgroundColor:Ze}},[`${xe}-input`]:{cursor:"not-allowed"},[`${xe}-disabled + span`]:{color:li,cursor:"not-allowed"},[`&${xe}-checked`]:{[ye]:{"&::after":{transform:`scale(${Qe/At})`}}}},[`span${xe} + *`]:{paddingInlineStart:Gr,paddingInlineEnd:Gr}})}},ee=ie=>{const{buttonColor:xe,controlHeight:at,componentCls:ot,lineWidth:At,lineType:Xe,colorBorder:ar,motionDurationSlow:jt,motionDurationMid:Ot,buttonPaddingInline:kr,fontSize:$r,buttonBg:ir,fontSizeLG:zr,controlHeightLG:li,controlHeightSM:Gr,paddingXS:Ze,borderRadius:nt,borderRadiusSM:Qe,borderRadiusLG:Ct,buttonCheckedBg:Dt,buttonSolidCheckedColor:ye,colorTextDisabled:Oe,colorBgContainerDisabled:et,buttonCheckedBgDisabled:vt,buttonCheckedColorDisabled:wt,colorPrimary:Ht,colorPrimaryHover:fr,colorPrimaryActive:Xt,buttonSolidCheckedBg:Ue,buttonSolidCheckedHoverBg:Ut,buttonSolidCheckedActiveBg:_r}=ie;return{[`${ot}-button-wrapper`]:{position:"relative",display:"inline-block",height:at,margin:0,paddingInline:kr,paddingBlock:0,color:xe,fontSize:$r,lineHeight:`${at-At*2}px`,background:ir,border:`${At}px ${Xe} ${ar}`,borderBlockStartWidth:At+.02,borderInlineStartWidth:0,borderInlineEndWidth:At,cursor:"pointer",transition:[`color ${Ot}`,`background ${Ot}`,`box-shadow ${Ot}`].join(","),a:{color:xe},[`> ${ot}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-At,insetInlineStart:-At,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:At,paddingInline:0,backgroundColor:ar,transition:`background-color ${jt}`,content:'""'}},"&:first-child":{borderInlineStart:`${At}px ${Xe} ${ar}`,borderStartStartRadius:nt,borderEndStartRadius:nt},"&:last-child":{borderStartEndRadius:nt,borderEndEndRadius:nt},"&:first-child:last-child":{borderRadius:nt},[`${ot}-group-large &`]:{height:li,fontSize:zr,lineHeight:`${li-At*2}px`,"&:first-child":{borderStartStartRadius:Ct,borderEndStartRadius:Ct},"&:last-child":{borderStartEndRadius:Ct,borderEndEndRadius:Ct}},[`${ot}-group-small &`]:{height:Gr,paddingInline:Ze-At,paddingBlock:0,lineHeight:`${Gr-At*2}px`,"&:first-child":{borderStartStartRadius:Qe,borderEndStartRadius:Qe},"&:last-child":{borderStartEndRadius:Qe,borderEndEndRadius:Qe}},"&:hover":{position:"relative",color:Ht},"&:has(:focus-visible)":Object.assign({},(0,ae.oN)(ie)),[`${ot}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${ot}-button-wrapper-disabled)`]:{zIndex:1,color:Ht,background:Dt,borderColor:Ht,"&::before":{backgroundColor:Ht},"&:first-child":{borderColor:Ht},"&:hover":{color:fr,borderColor:fr,"&::before":{backgroundColor:fr}},"&:active":{color:Xt,borderColor:Xt,"&::before":{backgroundColor:Xt}}},[`${ot}-group-solid &-checked:not(${ot}-button-wrapper-disabled)`]:{color:ye,background:Ue,borderColor:Ue,"&:hover":{color:ye,background:Ut,borderColor:Ut},"&:active":{color:ye,background:_r,borderColor:_r}},"&-disabled":{color:Oe,backgroundColor:et,borderColor:ar,cursor:"not-allowed","&:first-child, &:hover":{color:Oe,backgroundColor:et,borderColor:ar}},[`&-disabled${ot}-button-wrapper-checked`]:{color:wt,backgroundColor:vt,borderColor:ar,boxShadow:"none"}}}},oe=ie=>ie-4*2;var De=(0,Z.Z)("Radio",ie=>{const{controlOutline:xe,controlOutlineWidth:at,radioSize:ot}=ie,At=`0 0 0 ${at}px ${xe}`,Xe=At,ar=oe(ot),jt=(0,q.TS)(ie,{radioDotDisabledSize:ar,radioFocusShadow:At,radioButtonFocusShadow:Xe});return[Y(jt),ue(jt),ee(jt)]},ie=>{const{wireframe:xe,padding:at,marginXS:ot,lineWidth:At,fontSizeLG:Xe,colorText:ar,colorBgContainer:jt,colorTextDisabled:Ot,controlItemBgActiveDisabled:kr,colorTextLightSolid:$r,colorPrimary:ir,colorPrimaryHover:zr,colorPrimaryActive:li}=ie,Gr=4,Ze=Xe,nt=xe?oe(Ze):Ze-(Gr+At)*2;return{radioSize:Ze,dotSize:nt,dotColorDisabled:Ot,buttonSolidCheckedColor:$r,buttonSolidCheckedBg:ir,buttonSolidCheckedHoverBg:zr,buttonSolidCheckedActiveBg:li,buttonBg:jt,buttonCheckedBg:jt,buttonColor:ar,buttonCheckedBgDisabled:kr,buttonCheckedColorDisabled:Ot,buttonPaddingInline:at-At,wrapperMarginInlineEnd:ot}}),ve=J(14088),Ye=J(4572),We=function(ie,xe){var at={};for(var ot in ie)Object.prototype.hasOwnProperty.call(ie,ot)&&xe.indexOf(ot)<0&&(at[ot]=ie[ot]);if(ie!=null&&typeof Object.getOwnPropertySymbols=="function")for(var At=0,ot=Object.getOwnPropertySymbols(ie);At<ot.length;At++)xe.indexOf(ot[At])<0&&Object.prototype.propertyIsEnumerable.call(ie,ot[At])&&(at[ot[At]]=ie[ot[At]]);return at};const ut=(ie,xe)=>{var at,ot;const At=te.useContext(be),Xe=te.useContext(j),{getPrefixCls:ar,direction:jt,radio:Ot}=te.useContext(E.E_),kr=te.useRef(null),$r=(0,O.sQ)(xe,kr),{isFormItemInput:ir}=te.useContext(se.aM),zr=Xt=>{var Ue,Ut;(Ue=ie.onChange)===null||Ue===void 0||Ue.call(ie,Xt),(Ut=At==null?void 0:At.onChange)===null||Ut===void 0||Ut.call(At,Xt)},{prefixCls:li,className:Gr,rootClassName:Ze,children:nt,style:Qe}=ie,Ct=We(ie,["prefixCls","className","rootClassName","children","style"]),Dt=ar("radio",li),ye=((At==null?void 0:At.optionType)||Xe)==="button",Oe=ye?`${Dt}-button`:Dt,[et,vt]=De(Dt),wt=Object.assign({},Ct),Ht=te.useContext(K.Z);At&&(wt.name=At.name,wt.onChange=zr,wt.checked=ie.value===At.value,wt.disabled=(at=wt.disabled)!==null&&at!==void 0?at:At.disabled),wt.disabled=(ot=wt.disabled)!==null&&ot!==void 0?ot:Ht;const fr=Pe()(`${Oe}-wrapper`,{[`${Oe}-wrapper-checked`]:wt.checked,[`${Oe}-wrapper-disabled`]:wt.disabled,[`${Oe}-wrapper-rtl`]:jt==="rtl",[`${Oe}-wrapper-in-form-item`]:ir},Ot==null?void 0:Ot.className,Gr,Ze,vt);return et(te.createElement(ve.Z,{component:"Radio",disabled:wt.disabled},te.createElement("label",{className:fr,style:Object.assign(Object.assign({},Ot==null?void 0:Ot.style),Qe),onMouseEnter:ie.onMouseEnter,onMouseLeave:ie.onMouseLeave},te.createElement(M.Z,Object.assign({},wt,{className:Pe()(wt.className,!ye&&Ye.A),type:"radio",prefixCls:Oe,ref:$r})),nt!==void 0?te.createElement("span",null,nt):null)))};var de=te.forwardRef(ut);const re=te.forwardRef((ie,xe)=>{const{getPrefixCls:at,direction:ot}=te.useContext(E.E_),[At,Xe]=(0,rt.Z)(ie.defaultValue,{value:ie.value}),ar=Ue=>{const Ut=At,_r=Ue.target.value;"value"in ie||Xe(_r);const{onChange:Fe}=ie;Fe&&_r!==Ut&&Fe(Ue)},{prefixCls:jt,className:Ot,rootClassName:kr,options:$r,buttonStyle:ir="outline",disabled:zr,children:li,size:Gr,style:Ze,id:nt,onMouseEnter:Qe,onMouseLeave:Ct,onFocus:Dt,onBlur:ye}=ie,Oe=at("radio",jt),et=`${Oe}-group`,[vt,wt]=De(Oe);let Ht=li;$r&&$r.length>0&&(Ht=$r.map(Ue=>typeof Ue=="string"||typeof Ue=="number"?te.createElement(de,{key:Ue.toString(),prefixCls:Oe,disabled:zr,value:Ue,checked:At===Ue},Ue):te.createElement(de,{key:`radio-group-value-options-${Ue.value}`,prefixCls:Oe,disabled:Ue.disabled||zr,value:Ue.value,checked:At===Ue.value,title:Ue.title,style:Ue.style},Ue.label)));const fr=(0,Me.Z)(Gr),Xt=Pe()(et,`${et}-${ir}`,{[`${et}-${fr}`]:fr,[`${et}-rtl`]:ot==="rtl"},Ot,kr,wt);return vt(te.createElement("div",Object.assign({},(0,Le.Z)(ie,{aria:!0,data:!0}),{className:Xt,style:Ze,onMouseEnter:Qe,onMouseLeave:Ct,onFocus:Dt,onBlur:ye,id:nt,ref:xe}),te.createElement(d,{value:{onChange:ar,value:At,disabled:ie.disabled,name:ie.name,optionType:ie.optionType}},Ht)))});var ce=te.memo(re),he=function(ie,xe){var at={};for(var ot in ie)Object.prototype.hasOwnProperty.call(ie,ot)&&xe.indexOf(ot)<0&&(at[ot]=ie[ot]);if(ie!=null&&typeof Object.getOwnPropertySymbols=="function")for(var At=0,ot=Object.getOwnPropertySymbols(ie);At<ot.length;At++)xe.indexOf(ot[At])<0&&Object.prototype.propertyIsEnumerable.call(ie,ot[At])&&(at[ot[At]]=ie[ot[At]]);return at};const Re=(ie,xe)=>{const{getPrefixCls:at}=te.useContext(E.E_),{prefixCls:ot}=ie,At=he(ie,["prefixCls"]),Xe=at("radio",ot);return te.createElement(k,{value:"button"},te.createElement(de,Object.assign({prefixCls:Xe},At,{type:"radio",ref:xe})))};var we=te.forwardRef(Re);const D=de;D.Button=we,D.Group=ce,D.__ANT_RADIO=!0;var L=D},8378:function(Fr,Rt){"use strict";const J=pe=>({[pe.componentCls]:{[`${pe.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${pe.motionDurationMid} ${pe.motionEaseInOut},
opacity ${pe.motionDurationMid} ${pe.motionEaseInOut} !important`}},[`${pe.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${pe.motionDurationMid} ${pe.motionEaseInOut},
opacity ${pe.motionDurationMid} ${pe.motionEaseInOut} !important`}}});Rt.Z=J},92899:function(Fr,Rt,J){"use strict";J.d(Rt,{Fm:function(){return k}});var pe=J(93083),Pe=J(95406);const rt=new pe.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Le=new pe.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),te=new pe.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),E=new pe.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Me=new pe.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),$=new pe.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d=new pe.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),be=new pe.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),j={"move-up":{inKeyframes:d,outKeyframes:be},"move-down":{inKeyframes:rt,outKeyframes:Le},"move-left":{inKeyframes:te,outKeyframes:E},"move-right":{inKeyframes:Me,outKeyframes:$}},k=(M,O)=>{const{antCls:K}=M,se=`${K}-${O}`,{inKeyframes:ae,outKeyframes:Z}=j[O];return[(0,Pe.R)(se,ae,Z,M.motionDurationMid),{[`
${se}-enter,
${se}-appear
`]:{opacity:0,animationTimingFunction:M.motionEaseOutCirc},[`${se}-leave`]:{animationTimingFunction:M.motionEaseInOutCirc}}]}},13826:function(Fr,Rt,J){"use strict";J.d(Rt,{Qt:function(){return te},Uw:function(){return Le},fJ:function(){return rt},ly:function(){return E},oN:function(){return k}});var pe=J(93083),Pe=J(95406);const rt=new pe.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Le=new pe.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),te=new pe.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),E=new pe.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Me=new pe.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),$=new pe.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),d=new pe.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),be=new pe.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),j={"slide-up":{inKeyframes:rt,outKeyframes:Le},"slide-down":{inKeyframes:te,outKeyframes:E},"slide-left":{inKeyframes:Me,outKeyframes:$},"slide-right":{inKeyframes:d,outKeyframes:be}},k=(M,O)=>{const{antCls:K}=M,se=`${K}-${O}`,{inKeyframes:ae,outKeyframes:Z}=j[O];return[(0,Pe.R)(se,ae,Z,M.motionDurationMid),{[`
${se}-enter,
${se}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:M.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${se}-leave`]:{animationTimingFunction:M.motionEaseInQuint}}]}},19447:function(Fr,Rt,J){"use strict";J.d(Rt,{ZP:function(){return te},fS:function(){return rt},qN:function(){return Pe}});var pe=J(47585);const Pe=8;function rt(E){const Me=Pe,{contentRadius:$,limitVerticalRadius:d}=E,be=$>12?$+2:12;return{dropdownArrowOffset:be,dropdownArrowOffsetVertical:d?Me:be}}function Le(E,Me){return E?Me:{}}function te(E,Me){const{componentCls:$,sizePopupArrow:d,borderRadiusXS:be,borderRadiusOuter:j,boxShadowPopoverArrow:k}=E,{colorBg:M,contentRadius:O=E.borderRadiusLG,limitVerticalRadius:K,arrowDistance:se=0,arrowPlacement:ae={left:!0,right:!0,top:!0,bottom:!0}}=Me,{dropdownArrowOffsetVertical:Z,dropdownArrowOffset:q}=rt({contentRadius:O,limitVerticalRadius:K});return{[$]:Object.assign(Object.assign(Object.assign(Object.assign({[`${$}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,pe.r)(d,be,j,M,k)),{"&:before":{background:M}})]},Le(!!ae.top,{[[`&-placement-top ${$}-arrow`,`&-placement-topLeft ${$}-arrow`,`&-placement-topRight ${$}-arrow`].join(",")]:{bottom:se,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${$}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${$}-arrow`]:{left:{_skip_check_:!0,value:q}},[`&-placement-topRight ${$}-arrow`]:{right:{_skip_check_:!0,value:q}}})),Le(!!ae.bottom,{[[`&-placement-bottom ${$}-arrow`,`&-placement-bottomLeft ${$}-arrow`,`&-placement-bottomRight ${$}-arrow`].join(",")]:{top:se,transform:"translateY(-100%)"},[`&-placement-bottom ${$}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${$}-arrow`]:{left:{_skip_check_:!0,value:q}},[`&-placement-bottomRight ${$}-arrow`]:{right:{_skip_check_:!0,value:q}}})),Le(!!ae.left,{[[`&-placement-left ${$}-arrow`,`&-placement-leftTop ${$}-arrow`,`&-placement-leftBottom ${$}-arrow`].join(",")]:{right:{_skip_check_:!0,value:se},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${$}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${$}-arrow`]:{top:Z},[`&-placement-leftBottom ${$}-arrow`]:{bottom:Z}})),Le(!!ae.right,{[[`&-placement-right ${$}-arrow`,`&-placement-rightTop ${$}-arrow`,`&-placement-rightBottom ${$}-arrow`].join(",")]:{left:{_skip_check_:!0,value:se},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${$}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${$}-arrow`]:{top:Z},[`&-placement-rightBottom ${$}-arrow`]:{bottom:Z}}))}}},47585:function(Fr,Rt,J){"use strict";J.d(Rt,{r:function(){return pe}});const pe=(Pe,rt,Le,te,E)=>{const Me=Pe/2,$=0,d=Me,be=Le*1/Math.sqrt(2),j=Me-Le*(1-1/Math.sqrt(2)),k=Me-rt*(1/Math.sqrt(2)),M=Le*(Math.sqrt(2)-1)+rt*(1/Math.sqrt(2)),O=2*Me-k,K=M,se=2*Me-be,ae=j,Z=2*Me-$,q=d,Y=Me*Math.sqrt(2)+Le*(Math.sqrt(2)-2),ue=Le*(Math.sqrt(2)-1);return{pointerEvents:"none",width:Pe,height:Pe,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:Pe,height:Pe/2,background:te,clipPath:{_multi_value_:!0,value:[`polygon(${ue}px 100%, 50% ${ue}px, ${2*Me-ue}px 100%, ${ue}px 100%)`,`path('M ${$} ${d} A ${Le} ${Le} 0 0 0 ${be} ${j} L ${k} ${M} A ${rt} ${rt} 0 0 1 ${O} ${K} L ${se} ${ae} A ${Le} ${Le} 0 0 0 ${Z} ${q} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:Y,height:Y,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${rt}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:E,zIndex:0,background:"transparent"}}}},99313:function(Fr,Rt,J){"use strict";J.d(Rt,{default:function(){return bi}});var pe=J(99267),Pe=J(18785),rt=J(62772),Le=J(92310),te=J.n(Le),E=J(72308),Me=J(49618),$=J(77321),d=J(52487),be=J(62853),j=J(74416),k=J(59301),M=J(49658),O=J(18929),K=J(77900),se=(0,k.createContext)(null),ae=k.forwardRef(function(me,Te){var Mt=me.prefixCls,ct=me.className,Et=me.style,Ft=me.id,or=me.active,Jt=me.tabKey,Rr=me.children;return k.createElement("div",{id:Ft&&"".concat(Ft,"-panel-").concat(Jt),role:"tabpanel",tabIndex:or?0:-1,"aria-labelledby":Ft&&"".concat(Ft,"-tab-").concat(Jt),"aria-hidden":!or,style:Et,className:te()(Mt,or&&"".concat(Mt,"-active"),ct),ref:Te},Rr)}),Z=ae,q=["key","forceRender","style","className"];function Y(me){var Te=me.id,Mt=me.activeKey,ct=me.animated,Et=me.tabPosition,Ft=me.destroyInactiveTabPane,or=k.useContext(se),Jt=or.prefixCls,Rr=or.tabs,Sr=ct.tabPane,oi="".concat(Jt,"-tabpane");return k.createElement("div",{className:te()("".concat(Jt,"-content-holder"))},k.createElement("div",{className:te()("".concat(Jt,"-content"),"".concat(Jt,"-content-").concat(Et),(0,Me.Z)({},"".concat(Jt,"-content-animated"),Sr))},Rr.map(function(Dr){var Br=Dr.key,ni=Dr.forceRender,_i=Dr.style,Ni=Dr.className,mi=(0,j.Z)(Dr,q),Ur=Br===Mt;return k.createElement(K.default,(0,E.Z)({key:Br,visible:Ur,forceRender:ni,removeOnLeave:!!Ft,leavedClassName:"".concat(oi,"-hidden")},ct.tabPaneMotion),function(Gi,Yr){var Or=Gi.style,lt=Gi.className;return k.createElement(Z,(0,E.Z)({},mi,{prefixCls:oi,id:Te,tabKey:Br,animated:Sr,active:Ur,style:(0,$.Z)((0,$.Z)({},_i),Or),className:te()(Ni,lt),ref:Yr}))})})))}var ue=J(80702),ee=J(29301),oe=J(6089),De=J(8654),ve={width:0,height:0,left:0,top:0};function Ye(me,Te,Mt){return(0,k.useMemo)(function(){for(var ct,Et=new Map,Ft=Te.get((ct=me[0])===null||ct===void 0?void 0:ct.key)||ve,or=Ft.left+Ft.width,Jt=0;Jt<me.length;Jt+=1){var Rr=me[Jt].key,Sr=Te.get(Rr);if(!Sr){var oi;Sr=Te.get((oi=me[Jt-1])===null||oi===void 0?void 0:oi.key)||ve}var Dr=Et.get(Rr)||(0,$.Z)({},Sr);Dr.right=or-Dr.left-Dr.width,Et.set(Rr,Dr)}return Et},[me.map(function(ct){return ct.key}).join("_"),Te,Mt])}function We(me,Te){var Mt=k.useRef(me),ct=k.useState({}),Et=(0,d.Z)(ct,2),Ft=Et[1];function or(Jt){var Rr=typeof Jt=="function"?Jt(Mt.current):Jt;Rr!==Mt.current&&Te(Rr,Mt.current),Mt.current=Rr,Ft({})}return[Mt.current,or]}var ut=.1,pt=.01,de=20,re=Math.pow(.995,de);function ce(me,Te){var Mt=(0,k.useState)(),ct=(0,d.Z)(Mt,2),Et=ct[0],Ft=ct[1],or=(0,k.useState)(0),Jt=(0,d.Z)(or,2),Rr=Jt[0],Sr=Jt[1],oi=(0,k.useState)(0),Dr=(0,d.Z)(oi,2),Br=Dr[0],ni=Dr[1],_i=(0,k.useState)(),Ni=(0,d.Z)(_i,2),mi=Ni[0],Ur=Ni[1],Gi=(0,k.useRef)();function Yr(ft){var Kt=ft.touches[0],Bt=Kt.screenX,lr=Kt.screenY;Ft({x:Bt,y:lr}),window.clearInterval(Gi.current)}function Or(ft){if(Et){ft.preventDefault();var Kt=ft.touches[0],Bt=Kt.screenX,lr=Kt.screenY;Ft({x:Bt,y:lr});var Tr=Bt-Et.x,pr=lr-Et.y;Te(Tr,pr);var si=Date.now();Sr(si),ni(si-Rr),Ur({x:Tr,y:pr})}}function lt(){if(Et&&(Ft(null),Ur(null),mi)){var ft=mi.x/Br,Kt=mi.y/Br,Bt=Math.abs(ft),lr=Math.abs(Kt);if(Math.max(Bt,lr)<ut)return;var Tr=ft,pr=Kt;Gi.current=window.setInterval(function(){if(Math.abs(Tr)<pt&&Math.abs(pr)<pt){window.clearInterval(Gi.current);return}Tr*=re,pr*=re,Te(Tr*de,pr*de)},de)}}var tt=(0,k.useRef)();function _t(ft){var Kt=ft.deltaX,Bt=ft.deltaY,lr=0,Tr=Math.abs(Kt),pr=Math.abs(Bt);Tr===pr?lr=tt.current==="x"?Kt:Bt:Tr>pr?(lr=Kt,tt.current="x"):(lr=Bt,tt.current="y"),Te(-lr,-lr)&&ft.preventDefault()}var Lt=(0,k.useRef)(null);Lt.current={onTouchStart:Yr,onTouchMove:Or,onTouchEnd:lt,onWheel:_t},k.useEffect(function(){function ft(Tr){Lt.current.onTouchStart(Tr)}function Kt(Tr){Lt.current.onTouchMove(Tr)}function Bt(Tr){Lt.current.onTouchEnd(Tr)}function lr(Tr){Lt.current.onWheel(Tr)}return document.addEventListener("touchmove",Kt,{passive:!1}),document.addEventListener("touchend",Bt,{passive:!1}),me.current.addEventListener("touchstart",ft,{passive:!1}),me.current.addEventListener("wheel",lr),function(){document.removeEventListener("touchmove",Kt),document.removeEventListener("touchend",Bt)}},[])}var he=J(34280);function Re(me){var Te=(0,k.useState)(0),Mt=(0,d.Z)(Te,2),ct=Mt[0],Et=Mt[1],Ft=(0,k.useRef)(0),or=(0,k.useRef)();return or.current=me,(0,he.o)(function(){var Jt;(Jt=or.current)===null||Jt===void 0||Jt.call(or)},[ct]),function(){Ft.current===ct&&(Ft.current+=1,Et(Ft.current))}}function we(me){var Te=(0,k.useRef)([]),Mt=(0,k.useState)({}),ct=(0,d.Z)(Mt,2),Et=ct[1],Ft=(0,k.useRef)(typeof me=="function"?me():me),or=Re(function(){var Rr=Ft.current;Te.current.forEach(function(Sr){Rr=Sr(Rr)}),Te.current=[],Ft.current=Rr,Et({})});function Jt(Rr){Te.current.push(Rr),or()}return[Ft.current,Jt]}var D={width:0,height:0,left:0,top:0,right:0};function L(me,Te,Mt,ct,Et,Ft,or){var Jt=or.tabs,Rr=or.tabPosition,Sr=or.rtl,oi,Dr,Br;return["top","bottom"].includes(Rr)?(oi="width",Dr=Sr?"right":"left",Br=Math.abs(Mt)):(oi="height",Dr="top",Br=-Mt),(0,k.useMemo)(function(){if(!Jt.length)return[0,0];for(var ni=Jt.length,_i=ni,Ni=0;Ni<ni;Ni+=1){var mi=me.get(Jt[Ni].key)||D;if(mi[Dr]+mi[oi]>Br+Te){_i=Ni-1;break}}for(var Ur=0,Gi=ni-1;Gi>=0;Gi-=1){var Yr=me.get(Jt[Gi].key)||D;if(Yr[Dr]<Br){Ur=Gi+1;break}}return Ur>=_i?[0,0]:[Ur,_i]},[me,Te,ct,Et,Ft,Br,Rr,Jt.map(function(ni){return ni.key}).join("_"),Sr])}function ie(me){var Te;return me instanceof Map?(Te={},me.forEach(function(Mt,ct){Te[ct]=Mt})):Te=me,JSON.stringify(Te)}var xe="TABS_DQ";function at(me){return String(me).replace(/"/g,xe)}function ot(me,Te,Mt,ct){return!(!Mt||ct||me===!1||me===void 0&&(Te===!1||Te===null))}function At(me,Te){var Mt=me.prefixCls,ct=me.editable,Et=me.locale,Ft=me.style;return!ct||ct.showAdd===!1?null:k.createElement("button",{ref:Te,type:"button",className:"".concat(Mt,"-nav-add"),style:Ft,"aria-label":(Et==null?void 0:Et.addAriaLabel)||"Add tab",onClick:function(Jt){ct.onEdit("add",{event:Jt})}},ct.addIcon||"+")}var Xe=k.forwardRef(At),ar=k.forwardRef(function(me,Te){var Mt=me.position,ct=me.prefixCls,Et=me.extra;if(!Et)return null;var Ft,or={};return(0,be.Z)(Et)==="object"&&!k.isValidElement(Et)?or=Et:or.right=Et,Mt==="right"&&(Ft=or.right),Mt==="left"&&(Ft=or.left),Ft?k.createElement("div",{className:"".concat(ct,"-extra-content"),ref:Te},Ft):null}),jt=ar,Ot=J(31561),kr=J(15285),$r=J(10228);function ir(me,Te){var Mt=me.prefixCls,ct=me.id,Et=me.tabs,Ft=me.locale,or=me.mobile,Jt=me.moreIcon,Rr=Jt===void 0?"More":Jt,Sr=me.moreTransitionName,oi=me.style,Dr=me.className,Br=me.editable,ni=me.tabBarGutter,_i=me.rtl,Ni=me.removeAriaLabel,mi=me.onTabClick,Ur=me.getPopupContainer,Gi=me.popupClassName,Yr=(0,k.useState)(!1),Or=(0,d.Z)(Yr,2),lt=Or[0],tt=Or[1],_t=(0,k.useState)(null),Lt=(0,d.Z)(_t,2),ft=Lt[0],Kt=Lt[1],Bt="".concat(ct,"-more-popup"),lr="".concat(Mt,"-dropdown"),Tr=ft!==null?"".concat(Bt,"-").concat(ft):null,pr=Ft==null?void 0:Ft.dropdownAriaLabel;function si(Xr,ri){Xr.preventDefault(),Xr.stopPropagation(),Br.onEdit("remove",{key:ri,event:Xr})}var ci=k.createElement(kr.ZP,{onClick:function(ri){var ii=ri.key,ai=ri.domEvent;mi(ii,ai),tt(!1)},prefixCls:"".concat(lr,"-menu"),id:Bt,tabIndex:-1,role:"listbox","aria-activedescendant":Tr,selectedKeys:[ft],"aria-label":pr!==void 0?pr:"expanded dropdown"},Et.map(function(Xr){var ri=Xr.closable,ii=Xr.disabled,ai=Xr.closeIcon,Kr=Xr.key,fi=Xr.label,Pi=ot(ri,ai,Br,ii);return k.createElement(kr.sN,{key:Kr,id:"".concat(Bt,"-").concat(Kr),role:"option","aria-controls":ct&&"".concat(ct,"-panel-").concat(Kr),disabled:ii},k.createElement("span",null,fi),Pi&&k.createElement("button",{type:"button","aria-label":Ni||"remove",tabIndex:0,className:"".concat(lr,"-menu-item-remove"),onClick:function(Ar){Ar.stopPropagation(),si(Ar,Kr)}},ai||Br.removeIcon||"\xD7"))}));function gi(Xr){for(var ri=Et.filter(function(Pi){return!Pi.disabled}),ii=ri.findIndex(function(Pi){return Pi.key===ft})||0,ai=ri.length,Kr=0;Kr<ai;Kr+=1){ii=(ii+Xr+ai)%ai;var fi=ri[ii];if(!fi.disabled){Kt(fi.key);return}}}function Er(Xr){var ri=Xr.which;if(!lt){[$r.Z.DOWN,$r.Z.SPACE,$r.Z.ENTER].includes(ri)&&(tt(!0),Xr.preventDefault());return}switch(ri){case $r.Z.UP:gi(-1),Xr.preventDefault();break;case $r.Z.DOWN:gi(1),Xr.preventDefault();break;case $r.Z.ESC:tt(!1);break;case $r.Z.SPACE:case $r.Z.ENTER:ft!==null&&mi(ft,Xr);break}}(0,k.useEffect)(function(){var Xr=document.getElementById(Tr);Xr&&Xr.scrollIntoView&&Xr.scrollIntoView(!1)},[ft]),(0,k.useEffect)(function(){lt||Kt(null)},[lt]);var Mr=(0,Me.Z)({},_i?"marginRight":"marginLeft",ni);Et.length||(Mr.visibility="hidden",Mr.order=1);var Si=te()((0,Me.Z)({},"".concat(lr,"-rtl"),_i)),Ai=or?null:k.createElement(Ot.Z,{prefixCls:lr,overlay:ci,trigger:["hover"],visible:Et.length?lt:!1,transitionName:Sr,onVisibleChange:tt,overlayClassName:te()(Si,Gi),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Ur},k.createElement("button",{type:"button",className:"".concat(Mt,"-nav-more"),style:Mr,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Bt,id:"".concat(ct,"-more"),"aria-expanded":lt,onKeyDown:Er},Rr));return k.createElement("div",{className:te()("".concat(Mt,"-nav-operations"),Dr),style:oi,ref:Te},Ai,k.createElement(Xe,{prefixCls:Mt,locale:Ft,editable:Br}))}var zr=k.memo(k.forwardRef(ir),function(me,Te){return Te.tabMoving});function li(me){var Te,Mt=me.prefixCls,ct=me.id,Et=me.active,Ft=me.tab,or=Ft.key,Jt=Ft.label,Rr=Ft.disabled,Sr=Ft.closeIcon,oi=me.closable,Dr=me.renderWrapper,Br=me.removeAriaLabel,ni=me.editable,_i=me.onClick,Ni=me.onFocus,mi=me.style,Ur="".concat(Mt,"-tab"),Gi=ot(oi,Sr,ni,Rr);function Yr(tt){Rr||_i(tt)}function Or(tt){tt.preventDefault(),tt.stopPropagation(),ni.onEdit("remove",{key:or,event:tt})}var lt=k.createElement("div",{key:or,"data-node-key":at(or),className:te()(Ur,(Te={},(0,Me.Z)(Te,"".concat(Ur,"-with-remove"),Gi),(0,Me.Z)(Te,"".concat(Ur,"-active"),Et),(0,Me.Z)(Te,"".concat(Ur,"-disabled"),Rr),Te)),style:mi,onClick:Yr},k.createElement("div",{role:"tab","aria-selected":Et,id:ct&&"".concat(ct,"-tab-").concat(or),className:"".concat(Ur,"-btn"),"aria-controls":ct&&"".concat(ct,"-panel-").concat(or),"aria-disabled":Rr,tabIndex:Rr?null:0,onClick:function(_t){_t.stopPropagation(),Yr(_t)},onKeyDown:function(_t){[$r.Z.SPACE,$r.Z.ENTER].includes(_t.which)&&(_t.preventDefault(),Yr(_t))},onFocus:Ni},Jt),Gi&&k.createElement("button",{type:"button","aria-label":Br||"remove",tabIndex:0,className:"".concat(Ur,"-remove"),onClick:function(_t){_t.stopPropagation(),Or(_t)}},Sr||ni.removeIcon||"\xD7"));return Dr?Dr(lt):lt}var Gr=li,Ze=J(16089),nt=function(Te){var Mt=Te.activeTabOffset,ct=Te.horizontal,Et=Te.rtl,Ft=Te.indicatorSize,or=(0,k.useState)(),Jt=(0,d.Z)(or,2),Rr=Jt[0],Sr=Jt[1],oi=(0,k.useRef)(),Dr=function(_i){return typeof Ft=="function"?Ft(_i):typeof Ft=="number"?Ft:_i};function Br(){Ze.Z.cancel(oi.current)}return(0,k.useEffect)(function(){var ni={};return Mt&&(ct?(Et?(ni.right=Mt.right+Mt.width/2,ni.transform="translateX(50%)"):(ni.left=Mt.left+Mt.width/2,ni.transform="translateX(-50%)"),ni.width=Dr(Mt.width)):(ni.top=Mt.top+Mt.height/2,ni.transform="translateY(-50%)",ni.height=Dr(Mt.height))),Br(),oi.current=(0,Ze.Z)(function(){Sr(ni)}),Br},[Mt,ct,Et,Ft]),{style:Rr}},Qe=nt,Ct=function(Te){var Mt=Te.current||{},ct=Mt.offsetWidth,Et=ct===void 0?0:ct,Ft=Mt.offsetHeight,or=Ft===void 0?0:Ft;return[Et,or]},Dt=function(Te,Mt){return Te[Mt?0:1]};function ye(me,Te){var Mt,ct=k.useContext(se),Et=ct.prefixCls,Ft=ct.tabs,or=me.className,Jt=me.style,Rr=me.id,Sr=me.animated,oi=me.activeKey,Dr=me.rtl,Br=me.extra,ni=me.editable,_i=me.locale,Ni=me.tabPosition,mi=me.tabBarGutter,Ur=me.children,Gi=me.onTabClick,Yr=me.onTabScroll,Or=me.indicatorSize,lt=(0,k.useRef)(),tt=(0,k.useRef)(),_t=(0,k.useRef)(),Lt=(0,k.useRef)(),ft=(0,k.useRef)(),Kt=(0,k.useRef)(),Bt=(0,k.useRef)(),lr=Ni==="top"||Ni==="bottom",Tr=We(0,function(xi,Mi){lr&&Yr&&Yr({direction:xi>Mi?"left":"right"})}),pr=(0,d.Z)(Tr,2),si=pr[0],ci=pr[1],gi=We(0,function(xi,Mi){!lr&&Yr&&Yr({direction:xi>Mi?"top":"bottom"})}),Er=(0,d.Z)(gi,2),Mr=Er[0],Si=Er[1],Ai=(0,k.useState)([0,0]),Xr=(0,d.Z)(Ai,2),ri=Xr[0],ii=Xr[1],ai=(0,k.useState)([0,0]),Kr=(0,d.Z)(ai,2),fi=Kr[0],Pi=Kr[1],Di=(0,k.useState)([0,0]),Ar=(0,d.Z)(Di,2),je=Ar[0],cr=Ar[1],yr=(0,k.useState)([0,0]),jr=(0,d.Z)(yr,2),nn=jr[0],vi=jr[1],$i=we(new Map),Hr=(0,d.Z)($i,2),pn=Hr[0],_n=Hr[1],Vi=Ye(Ft,pn,fi[0]),ts=Dt(ri,lr),Yn=Dt(fi,lr),$n=Dt(je,lr),Gn=Dt(nn,lr),Pr=ts<Yn+$n,ki=Pr?ts-Gn:ts-$n,Ki="".concat(Et,"-nav-operations-hidden"),Wi=0,Vn=0;lr&&Dr?(Wi=0,Vn=Math.max(0,Yn-ki)):(Wi=Math.min(0,ki-Yn),Vn=0);function vn(xi){return xi<Wi?Wi:xi>Vn?Vn:xi}var tn=(0,k.useRef)(),In=(0,k.useState)(),zi=(0,d.Z)(In,2),rs=zi[0],Vr=zi[1];function ss(){Vr(Date.now())}function Xn(){window.clearTimeout(tn.current)}ce(Lt,function(xi,Mi){function sn(kn,Jn){kn(function(Lr){var Jr=vn(Lr+Jn);return Jr})}return Pr?(lr?sn(ci,xi):sn(Si,Mi),Xn(),ss(),!0):!1}),(0,k.useEffect)(function(){return Xn(),rs&&(tn.current=window.setTimeout(function(){Vr(0)},100)),Xn},[rs]);var xn=L(Vi,ki,lr?si:Mr,Yn,$n,Gn,(0,$.Z)((0,$.Z)({},me),{},{tabs:Ft})),Ii=(0,d.Z)(xn,2),vs=Ii[0],_s=Ii[1],ds=(0,oe.Z)(function(){var xi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oi,Mi=Vi.get(xi)||{width:0,height:0,left:0,right:0,top:0};if(lr){var sn=si;Dr?Mi.right<si?sn=Mi.right:Mi.right+Mi.width>si+ki&&(sn=Mi.right+Mi.width-ki):Mi.left<-si?sn=-Mi.left:Mi.left+Mi.width>-si+ki&&(sn=-(Mi.left+Mi.width-ki)),Si(0),ci(vn(sn))}else{var kn=Mr;Mi.top<-Mr?kn=-Mi.top:Mi.top+Mi.height>-Mr+ki&&(kn=-(Mi.top+Mi.height-ki)),ci(0),Si(vn(kn))}}),pi={};Ni==="top"||Ni==="bottom"?pi[Dr?"marginRight":"marginLeft"]=mi:pi.marginTop=mi;var xs=Ft.map(function(xi,Mi){var sn=xi.key;return k.createElement(Gr,{id:Rr,prefixCls:Et,key:sn,tab:xi,style:Mi===0?void 0:pi,closable:xi.closable,editable:ni,active:sn===oi,renderWrapper:Ur,removeAriaLabel:_i==null?void 0:_i.removeAriaLabel,onClick:function(Jn){Gi(sn,Jn)},onFocus:function(){ds(sn),ss(),Lt.current&&(Dr||(Lt.current.scrollLeft=0),Lt.current.scrollTop=0)}})}),ws=function(){return _n(function(){var Mi=new Map;return Ft.forEach(function(sn){var kn,Jn=sn.key,Lr=(kn=ft.current)===null||kn===void 0?void 0:kn.querySelector('[data-node-key="'.concat(at(Jn),'"]'));Lr&&Mi.set(Jn,{width:Lr.offsetWidth,height:Lr.offsetHeight,left:Lr.offsetLeft,top:Lr.offsetTop})}),Mi})};(0,k.useEffect)(function(){ws()},[Ft.map(function(xi){return xi.key}).join("_")]);var nr=Re(function(){var xi=Ct(lt),Mi=Ct(tt),sn=Ct(_t);ii([xi[0]-Mi[0]-sn[0],xi[1]-Mi[1]-sn[1]]);var kn=Ct(Bt);cr(kn);var Jn=Ct(Kt);vi(Jn);var Lr=Ct(ft);Pi([Lr[0]-kn[0],Lr[1]-kn[1]]),ws()}),mn=Ft.slice(0,vs),Ss=Ft.slice(_s+1),fs=[].concat((0,ue.Z)(mn),(0,ue.Z)(Ss)),un=Vi.get(oi),cn=Qe({activeTabOffset:un,horizontal:lr,rtl:Dr,indicatorSize:Or}),Fi=cn.style;(0,k.useEffect)(function(){ds()},[oi,Wi,Vn,ie(un),ie(Vi),lr]),(0,k.useEffect)(function(){nr()},[Dr]);var rn=!!fs.length,zn="".concat(Et,"-nav-wrap"),Wn,Pn,An,Oi;return lr?Dr?(Pn=si>0,Wn=si!==Vn):(Wn=si<0,Pn=si!==Wi):(An=Mr<0,Oi=Mr!==Wi),k.createElement(ee.Z,{onResize:nr},k.createElement("div",{ref:(0,De.x1)(Te,lt),role:"tablist",className:te()("".concat(Et,"-nav"),or),style:Jt,onKeyDown:function(){ss()}},k.createElement(jt,{ref:tt,position:"left",extra:Br,prefixCls:Et}),k.createElement(ee.Z,{onResize:nr},k.createElement("div",{className:te()(zn,(Mt={},(0,Me.Z)(Mt,"".concat(zn,"-ping-left"),Wn),(0,Me.Z)(Mt,"".concat(zn,"-ping-right"),Pn),(0,Me.Z)(Mt,"".concat(zn,"-ping-top"),An),(0,Me.Z)(Mt,"".concat(zn,"-ping-bottom"),Oi),Mt)),ref:Lt},k.createElement(ee.Z,{onResize:nr},k.createElement("div",{ref:ft,className:"".concat(Et,"-nav-list"),style:{transform:"translate(".concat(si,"px, ").concat(Mr,"px)"),transition:rs?"none":void 0}},xs,k.createElement(Xe,{ref:Bt,prefixCls:Et,locale:_i,editable:ni,style:(0,$.Z)((0,$.Z)({},xs.length===0?void 0:pi),{},{visibility:rn?"hidden":null})}),k.createElement("div",{className:te()("".concat(Et,"-ink-bar"),(0,Me.Z)({},"".concat(Et,"-ink-bar-animated"),Sr.inkBar)),style:Fi}))))),k.createElement(zr,(0,E.Z)({},me,{removeAriaLabel:_i==null?void 0:_i.removeAriaLabel,ref:Kt,prefixCls:Et,tabs:fs,className:!rn&&Ki,tabMoving:!!rs})),k.createElement(jt,{ref:_t,position:"right",extra:Br,prefixCls:Et})))}var Oe=k.forwardRef(ye),et=["renderTabBar"],vt=["label","key"];function wt(me){var Te=me.renderTabBar,Mt=(0,j.Z)(me,et),ct=k.useContext(se),Et=ct.tabs;if(Te){var Ft=(0,$.Z)((0,$.Z)({},Mt),{},{panes:Et.map(function(or){var Jt=or.label,Rr=or.key,Sr=(0,j.Z)(or,vt);return k.createElement(Z,(0,E.Z)({tab:Jt,key:Rr,tabKey:Rr},Sr))})});return Te(Ft,Oe)}return k.createElement(Oe,Mt)}var Ht=J(48736);function fr(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Te;return me===!1?Te={inkBar:!1,tabPane:!1}:me===!0?Te={inkBar:!0,tabPane:!1}:Te=(0,$.Z)({inkBar:!0},(0,be.Z)(me)==="object"?me:{}),Te.tabPaneMotion&&Te.tabPane===void 0&&(Te.tabPane=!0),!Te.tabPaneMotion&&Te.tabPane&&(Te.tabPane=!1),Te}var Xt=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Ue=0;function Ut(me,Te){var Mt,ct=me.id,Et=me.prefixCls,Ft=Et===void 0?"rc-tabs":Et,or=me.className,Jt=me.items,Rr=me.direction,Sr=me.activeKey,oi=me.defaultActiveKey,Dr=me.editable,Br=me.animated,ni=me.tabPosition,_i=ni===void 0?"top":ni,Ni=me.tabBarGutter,mi=me.tabBarStyle,Ur=me.tabBarExtraContent,Gi=me.locale,Yr=me.moreIcon,Or=me.moreTransitionName,lt=me.destroyInactiveTabPane,tt=me.renderTabBar,_t=me.onChange,Lt=me.onTabClick,ft=me.onTabScroll,Kt=me.getPopupContainer,Bt=me.popupClassName,lr=me.indicatorSize,Tr=(0,j.Z)(me,Xt),pr=k.useMemo(function(){return(Jt||[]).filter(function(vi){return vi&&(0,be.Z)(vi)==="object"&&"key"in vi})},[Jt]),si=Rr==="rtl",ci=fr(Br),gi=(0,k.useState)(!1),Er=(0,d.Z)(gi,2),Mr=Er[0],Si=Er[1];(0,k.useEffect)(function(){Si((0,M.Z)())},[]);var Ai=(0,O.Z)(function(){var vi;return(vi=pr[0])===null||vi===void 0?void 0:vi.key},{value:Sr,defaultValue:oi}),Xr=(0,d.Z)(Ai,2),ri=Xr[0],ii=Xr[1],ai=(0,k.useState)(function(){return pr.findIndex(function(vi){return vi.key===ri})}),Kr=(0,d.Z)(ai,2),fi=Kr[0],Pi=Kr[1];(0,k.useEffect)(function(){var vi=pr.findIndex(function(Hr){return Hr.key===ri});if(vi===-1){var $i;vi=Math.max(0,Math.min(fi,pr.length-1)),ii(($i=pr[vi])===null||$i===void 0?void 0:$i.key)}Pi(vi)},[pr.map(function(vi){return vi.key}).join("_"),ri,fi]);var Di=(0,O.Z)(null,{value:ct}),Ar=(0,d.Z)(Di,2),je=Ar[0],cr=Ar[1];(0,k.useEffect)(function(){ct||(cr("rc-tabs-".concat(Ue)),Ue+=1)},[]);function yr(vi,$i){Lt==null||Lt(vi,$i);var Hr=vi!==ri;ii(vi),Hr&&(_t==null||_t(vi))}var jr={id:je,activeKey:ri,animated:ci,tabPosition:_i,rtl:si,mobile:Mr},nn=(0,$.Z)((0,$.Z)({},jr),{},{editable:Dr,locale:Gi,moreIcon:Yr,moreTransitionName:Or,tabBarGutter:Ni,onTabClick:yr,onTabScroll:ft,extra:Ur,style:mi,panes:null,getPopupContainer:Kt,popupClassName:Bt,indicatorSize:lr});return k.createElement(se.Provider,{value:{tabs:pr,prefixCls:Ft}},k.createElement("div",(0,E.Z)({ref:Te,id:ct,className:te()(Ft,"".concat(Ft,"-").concat(_i),(Mt={},(0,Me.Z)(Mt,"".concat(Ft,"-mobile"),Mr),(0,Me.Z)(Mt,"".concat(Ft,"-editable"),Dr),(0,Me.Z)(Mt,"".concat(Ft,"-rtl"),si),Mt),or)},Tr),k.createElement(wt,(0,E.Z)({},nn,{renderTabBar:tt})),k.createElement(Y,(0,E.Z)({destroyInactiveTabPane:lt},jr,{animated:ci}))))}var _r=k.forwardRef(Ut),Fe=_r,Ge=Fe,it=J(36355),Pt=J(19716),zt=()=>null,rr=J(62892);const T={motionAppear:!1,motionEnter:!0,motionLeave:!0};function B(me){let Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Mt;return Te===!1?Mt={inkBar:!1,tabPane:!1}:Te===!0?Mt={inkBar:!0,tabPane:!0}:Mt=Object.assign({inkBar:!0},typeof Te=="object"?Te:{}),Mt.tabPane&&(Mt.tabPaneMotion=Object.assign(Object.assign({},T),{motionName:(0,rr.m)(me,"switch")})),Mt}var dt=J(11592),G=function(me,Te){var Mt={};for(var ct in me)Object.prototype.hasOwnProperty.call(me,ct)&&Te.indexOf(ct)<0&&(Mt[ct]=me[ct]);if(me!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Et=0,ct=Object.getOwnPropertySymbols(me);Et<ct.length;Et++)Te.indexOf(ct[Et])<0&&Object.prototype.propertyIsEnumerable.call(me,ct[Et])&&(Mt[ct[Et]]=me[ct[Et]]);return Mt};function fe(me){return me.filter(Te=>Te)}function xr(me,Te){if(me)return me;const Mt=(0,dt.Z)(Te).map(ct=>{if(k.isValidElement(ct)){const{key:Et,props:Ft}=ct,or=Ft||{},{tab:Jt}=or,Rr=G(or,["tab"]);return Object.assign(Object.assign({key:String(Et)},Rr),{label:Jt})}return null});return fe(Mt)}var Ne=J(17313),He=J(83116),Je=J(37613),W=J(13826),Se=me=>{const{componentCls:Te,motionDurationSlow:Mt}=me;return[{[Te]:{[`${Te}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Mt}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Mt}`}}}}},[(0,W.oN)(me,"slide-up"),(0,W.oN)(me,"slide-down")]]};const Ke=me=>{const{componentCls:Te,tabsCardPadding:Mt,cardBg:ct,cardGutter:Et,colorBorderSecondary:Ft,itemSelectedColor:or}=me;return{[`${Te}-card`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{margin:0,padding:Mt,background:ct,border:`${me.lineWidth}px ${me.lineType} ${Ft}`,transition:`all ${me.motionDurationSlow} ${me.motionEaseInOut}`},[`${Te}-tab-active`]:{color:or,background:me.colorBgContainer},[`${Te}-ink-bar`]:{visibility:"hidden"}},[`&${Te}-top, &${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab + ${Te}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Et}px`}}}},[`&${Te}-top`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:`${me.borderRadiusLG}px ${me.borderRadiusLG}px 0 0`},[`${Te}-tab-active`]:{borderBottomColor:me.colorBgContainer}}},[`&${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:`0 0 ${me.borderRadiusLG}px ${me.borderRadiusLG}px`},[`${Te}-tab-active`]:{borderTopColor:me.colorBgContainer}}},[`&${Te}-left, &${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab + ${Te}-tab`]:{marginTop:`${Et}px`}}},[`&${Te}-left`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`${me.borderRadiusLG}px 0 0 ${me.borderRadiusLG}px`}},[`${Te}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:me.colorBgContainer}}}},[`&${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${me.borderRadiusLG}px ${me.borderRadiusLG}px 0`}},[`${Te}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:me.colorBgContainer}}}}}}},V=me=>{const{componentCls:Te,itemHoverColor:Mt,dropdownEdgeChildVerticalPadding:ct}=me;return{[`${Te}-dropdown`]:Object.assign(Object.assign({},(0,Ne.Wf)(me)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:me.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Te}-dropdown-menu`]:{maxHeight:me.tabsDropdownHeight,margin:0,padding:`${ct}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:me.colorBgContainer,backgroundClip:"padding-box",borderRadius:me.borderRadiusLG,outline:"none",boxShadow:me.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Ne.vS),{display:"flex",alignItems:"center",minWidth:me.tabsDropdownWidth,margin:0,padding:`${me.paddingXXS}px ${me.paddingSM}px`,color:me.colorText,fontWeight:"normal",fontSize:me.fontSize,lineHeight:me.lineHeight,cursor:"pointer",transition:`all ${me.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:me.marginSM},color:me.colorTextDescription,fontSize:me.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Mt}},"&:hover":{background:me.controlItemBgHover},"&-disabled":{"&, &:hover":{color:me.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},qt=me=>{const{componentCls:Te,margin:Mt,colorBorderSecondary:ct,horizontalMargin:Et,verticalItemPadding:Ft,verticalItemMargin:or}=me;return{[`${Te}-top, ${Te}-bottom`]:{flexDirection:"column",[`> ${Te}-nav, > div > ${Te}-nav`]:{margin:Et,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${me.lineWidth}px ${me.lineType} ${ct}`,content:"''"},[`${Te}-ink-bar`]:{height:me.lineWidthBold,"&-animated":{transition:`width ${me.motionDurationSlow}, left ${me.motionDurationSlow},
right ${me.motionDurationSlow}`}},[`${Te}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:me.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:me.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:me.boxShadowTabsOverflowRight},[`&${Te}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Te}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Te}-top`]:{[`> ${Te}-nav,
> div > ${Te}-nav`]:{"&::before":{bottom:0},[`${Te}-ink-bar`]:{bottom:0}}},[`${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{order:1,marginTop:`${Mt}px`,marginBottom:0,"&::before":{top:0},[`${Te}-ink-bar`]:{top:0}},[`> ${Te}-content-holder, > div > ${Te}-content-holder`]:{order:0}},[`${Te}-left, ${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{flexDirection:"column",minWidth:me.controlHeight*1.25,[`${Te}-tab`]:{padding:Ft,textAlign:"center"},[`${Te}-tab + ${Te}-tab`]:{margin:or},[`${Te}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:me.controlHeight},"&::before":{top:0,boxShadow:me.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:me.boxShadowTabsOverflowBottom},[`&${Te}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Te}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Te}-ink-bar`]:{width:me.lineWidthBold,"&-animated":{transition:`height ${me.motionDurationSlow}, top ${me.motionDurationSlow}`}},[`${Te}-nav-list, ${Te}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Te}-left`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Te}-content-holder, > div > ${Te}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${me.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${me.lineWidth}px ${me.lineType} ${me.colorBorder}`},[`> ${Te}-content > ${Te}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:me.paddingLG}}}},[`${Te}-right`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{order:1,[`${Te}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Te}-content-holder, > div > ${Te}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-me.lineWidth},borderRight:{_skip_check_:!0,value:`${me.lineWidth}px ${me.lineType} ${me.colorBorder}`},[`> ${Te}-content > ${Te}-tabpane`]:{paddingRight:{_skip_check_:!0,value:me.paddingLG}}}}}},Ae=me=>{const{componentCls:Te,cardPaddingSM:Mt,cardPaddingLG:ct,horizontalItemPaddingSM:Et,horizontalItemPaddingLG:Ft}=me;return{[Te]:{"&-small":{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:Et,fontSize:me.titleFontSizeSM}}},"&-large":{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:Ft,fontSize:me.titleFontSizeLG}}}},[`${Te}-card`]:{[`&${Te}-small`]:{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:Mt}},[`&${Te}-bottom`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:`0 0 ${me.borderRadius}px ${me.borderRadius}px`}},[`&${Te}-top`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:`${me.borderRadius}px ${me.borderRadius}px 0 0`}},[`&${Te}-right`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${me.borderRadius}px ${me.borderRadius}px 0`}}},[`&${Te}-left`]:{[`> ${Te}-nav ${Te}-tab`]:{borderRadius:{_skip_check_:!0,value:`${me.borderRadius}px 0 0 ${me.borderRadius}px`}}}},[`&${Te}-large`]:{[`> ${Te}-nav`]:{[`${Te}-tab`]:{padding:ct}}}}}},Yt=me=>{const{componentCls:Te,itemActiveColor:Mt,itemHoverColor:ct,iconCls:Et,tabsHorizontalItemMargin:Ft,horizontalItemPadding:or,itemSelectedColor:Jt,itemColor:Rr}=me,Sr=`${Te}-tab`;return{[Sr]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:or,fontSize:me.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Rr,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Mt}},(0,Ne.Qy)(me)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-me.marginXXS},marginLeft:{_skip_check_:!0,value:me.marginXS},color:me.colorTextDescription,fontSize:me.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${me.motionDurationSlow}`,"&:hover":{color:me.colorTextHeading}},"&:hover":{color:ct},[`&${Sr}-active ${Sr}-btn`]:{color:Jt,textShadow:me.tabsActiveTextShadow},[`&${Sr}-disabled`]:{color:me.colorTextDisabled,cursor:"not-allowed"},[`&${Sr}-disabled ${Sr}-btn, &${Sr}-disabled ${Te}-remove`]:{"&:focus, &:active":{color:me.colorTextDisabled}},[`& ${Sr}-remove ${Et}`]:{margin:0},[Et]:{marginRight:{_skip_check_:!0,value:me.marginSM}}},[`${Sr} + ${Sr}`]:{margin:{_skip_check_:!0,value:Ft}}}},vr=me=>{const{componentCls:Te,tabsHorizontalItemMarginRTL:Mt,iconCls:ct,cardGutter:Et}=me;return{[`${Te}-rtl`]:{direction:"rtl",[`${Te}-nav`]:{[`${Te}-tab`]:{margin:{_skip_check_:!0,value:Mt},[`${Te}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[ct]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${me.marginSM}px`}},[`${Te}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${me.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${me.marginXXS}px`},[ct]:{margin:0}}}},[`&${Te}-left`]:{[`> ${Te}-nav`]:{order:1},[`> ${Te}-content-holder`]:{order:0}},[`&${Te}-right`]:{[`> ${Te}-nav`]:{order:0},[`> ${Te}-content-holder`]:{order:1}},[`&${Te}-card${Te}-top, &${Te}-card${Te}-bottom`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-tab + ${Te}-tab`]:{marginRight:{_skip_check_:!0,value:Et},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Te}-dropdown-rtl`]:{direction:"rtl"},[`${Te}-menu-item`]:{[`${Te}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},ei=me=>{const{componentCls:Te,tabsCardPadding:Mt,cardHeight:ct,cardGutter:Et,itemHoverColor:Ft,itemActiveColor:or,colorBorderSecondary:Jt}=me;return{[Te]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ne.Wf)(me)),{display:"flex",[`> ${Te}-nav, > div > ${Te}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Te}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${me.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Te}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${me.motionDurationSlow}`},[`${Te}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Te}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Te}-nav-more`]:{position:"relative",padding:Mt,background:"transparent",border:0,color:me.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:me.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Te}-nav-add`]:Object.assign({minWidth:ct,marginLeft:{_skip_check_:!0,value:Et},padding:`0 ${me.paddingXS}px`,background:"transparent",border:`${me.lineWidth}px ${me.lineType} ${Jt}`,borderRadius:`${me.borderRadiusLG}px ${me.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:me.colorText,transition:`all ${me.motionDurationSlow} ${me.motionEaseInOut}`,"&:hover":{color:Ft},"&:active, &:focus:not(:focus-visible)":{color:or}},(0,Ne.Qy)(me))},[`${Te}-extra-content`]:{flex:"none"},[`${Te}-ink-bar`]:{position:"absolute",background:me.inkBarColor,pointerEvents:"none"}}),Yt(me)),{[`${Te}-content`]:{position:"relative",width:"100%"},[`${Te}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Te}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Te}-centered`]:{[`> ${Te}-nav, > div > ${Te}-nav`]:{[`${Te}-nav-wrap`]:{[`&:not([class*='${Te}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Ri=(0,He.Z)("Tabs",me=>{const Te=(0,Je.TS)(me,{tabsCardPadding:me.cardPadding||`${(me.cardHeight-Math.round(me.fontSize*me.lineHeight))/2-me.lineWidth}px ${me.padding}px`,dropdownEdgeChildVerticalPadding:me.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${me.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${me.horizontalItemGutter}px`});return[Ae(Te),vr(Te),qt(Te),V(Te),Ke(Te),ei(Te),Se(Te)]},me=>{const Te=me.controlHeightLG;return{zIndexPopup:me.zIndexPopupBase+50,cardBg:me.colorFillAlter,cardHeight:Te,cardPadding:"",cardPaddingSM:`${me.paddingXXS*1.5}px ${me.padding}px`,cardPaddingLG:`${me.paddingXS}px ${me.padding}px ${me.paddingXXS*1.5}px`,titleFontSize:me.fontSize,titleFontSizeLG:me.fontSizeLG,titleFontSizeSM:me.fontSize,inkBarColor:me.colorPrimary,horizontalMargin:`0 0 ${me.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${me.paddingSM}px 0`,horizontalItemPaddingSM:`${me.paddingXS}px 0`,horizontalItemPaddingLG:`${me.padding}px 0`,verticalItemPadding:`${me.paddingXS}px ${me.paddingLG}px`,verticalItemMargin:`${me.margin}px 0 0 0`,itemColor:me.colorText,itemSelectedColor:me.colorPrimary,itemHoverColor:me.colorPrimaryHover,itemActiveColor:me.colorPrimaryActive,cardGutter:me.marginXXS/2}}),ui=function(me,Te){var Mt={};for(var ct in me)Object.prototype.hasOwnProperty.call(me,ct)&&Te.indexOf(ct)<0&&(Mt[ct]=me[ct]);if(me!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Et=0,ct=Object.getOwnPropertySymbols(me);Et<ct.length;Et++)Te.indexOf(ct[Et])<0&&Object.prototype.propertyIsEnumerable.call(me,ct[Et])&&(Mt[ct[Et]]=me[ct[Et]]);return Mt};const wr=me=>{const{type:Te,className:Mt,rootClassName:ct,size:Et,onEdit:Ft,hideAdd:or,centered:Jt,addIcon:Rr,popupClassName:Sr,children:oi,items:Dr,animated:Br,style:ni,indicatorSize:_i}=me,Ni=ui(me,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:mi,moreIcon:Ur=k.createElement(Pe.Z,null)}=Ni,{direction:Gi,tabs:Yr,getPrefixCls:Or,getPopupContainer:lt}=k.useContext(it.E_),tt=Or("tabs",mi),[_t,Lt]=Ri(tt);let ft;Te==="editable-card"&&(ft={onEdit:(si,ci)=>{let{key:gi,event:Er}=ci;Ft==null||Ft(si==="add"?Er:gi,si)},removeIcon:k.createElement(pe.Z,null),addIcon:Rr||k.createElement(rt.Z,null),showAdd:or!==!0});const Kt=Or(),Bt=xr(Dr,oi),lr=B(tt,Br),Tr=(0,Pt.Z)(Et),pr=Object.assign(Object.assign({},Yr==null?void 0:Yr.style),ni);return _t(k.createElement(Ge,Object.assign({direction:Gi,getPopupContainer:lt,moreTransitionName:`${Kt}-slide-up`},Ni,{items:Bt,className:te()({[`${tt}-${Tr}`]:Tr,[`${tt}-card`]:["card","editable-card"].includes(Te),[`${tt}-editable-card`]:Te==="editable-card",[`${tt}-centered`]:Jt},Yr==null?void 0:Yr.className,Mt,ct,Lt),popupClassName:te()(Sr,Lt),style:pr,editable:ft,moreIcon:Ur,prefixCls:tt,animated:lr,indicatorSize:_i!=null?_i:Yr==null?void 0:Yr.indicatorSize})))};wr.TabPane=zt;var bi=wr},33166:function(Fr,Rt,J){"use strict";J.d(Rt,{i:function(){return pe}});const pe=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return Pe}});var pe=J(33166);function Pe(rt,Le){return pe.i.reduce((te,E)=>{const Me=rt[`${E}1`],$=rt[`${E}3`],d=rt[`${E}6`],be=rt[`${E}7`];return Object.assign(Object.assign({},te),Le(E,{lightColor:Me,lightBorderColor:$,darkColor:d,textColor:be}))},{})}},6848:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return ut}});var pe=J(59301),Pe=J(92310),rt=J.n(Pe),Le=J(55477),te=J(18929),E=J(62892),Me=J(79676),$=J(92343),d=J(36355),be=J(33234),j=J(88088),k=J(17313),M=J(29878),O=J(19447),K=J(45157),se=J(37613),ae=J(83116);const Z=pt=>{const{componentCls:de,tooltipMaxWidth:re,tooltipColor:ce,tooltipBg:he,tooltipBorderRadius:Re,zIndexPopup:we,controlHeight:D,boxShadowSecondary:L,paddingSM:ie,paddingXS:xe,tooltipRadiusOuter:at}=pt;return[{[de]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,k.Wf)(pt)),{position:"absolute",zIndex:we,display:"block",width:"max-content",maxWidth:re,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":he,[`${de}-inner`]:{minWidth:D,minHeight:D,padding:`${ie/2}px ${xe}px`,color:ce,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:he,borderRadius:Re,boxShadow:L,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${de}-inner`]:{borderRadius:Math.min(Re,O.qN)}},[`${de}-content`]:{position:"relative"}}),(0,K.Z)(pt,(ot,At)=>{let{darkColor:Xe}=At;return{[`&${de}-${ot}`]:{[`${de}-inner`]:{backgroundColor:Xe},[`${de}-arrow`]:{"--antd-arrow-background-color":Xe}}}})),{"&-rtl":{direction:"rtl"}})},(0,O.ZP)((0,se.TS)(pt,{borderRadiusOuter:at}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:Re,limitVerticalRadius:!0}),{[`${de}-pure`]:{position:"relative",maxWidth:"none",margin:pt.sizePopupArrow}}]};var q=(pt,de)=>(0,ae.Z)("Tooltip",ce=>{if(de===!1)return[];const{borderRadius:he,colorTextLightSolid:Re,colorBgDefault:we,borderRadiusOuter:D}=ce,L=(0,se.TS)(ce,{tooltipMaxWidth:250,tooltipColor:Re,tooltipBorderRadius:he,tooltipBg:we,tooltipRadiusOuter:D>4?4:D});return[Z(L),(0,M._y)(ce,"zoom-big-fast")]},ce=>{let{zIndexPopupBase:he,colorBgSpotlight:Re}=ce;return{zIndexPopup:he+70,colorBgDefault:Re}},{resetStyle:!1})(pt),Y=J(36785);function ue(pt,de){const re=(0,Y.o2)(de),ce=rt()({[`${pt}-${de}`]:de&&re}),he={},Re={};return de&&!re&&(he.background=de,Re["--antd-arrow-background-color"]=de),{className:ce,overlayStyle:he,arrowStyle:Re}}var oe=pt=>{const{prefixCls:de,className:re,placement:ce="top",title:he,color:Re,overlayInnerStyle:we}=pt,{getPrefixCls:D}=pe.useContext(d.E_),L=D("tooltip",de),[ie,xe]=q(L,!0),at=ue(L,Re),ot=at.arrowStyle,At=Object.assign(Object.assign({},we),at.overlayStyle),Xe=rt()(xe,L,`${L}-pure`,`${L}-placement-${ce}`,re,at.className);return ie(pe.createElement("div",{className:Xe,style:ot},pe.createElement("div",{className:`${L}-arrow`}),pe.createElement(Le.G,Object.assign({},pt,{className:xe,prefixCls:L,overlayInnerStyle:At}),he)))},De=function(pt,de){var re={};for(var ce in pt)Object.prototype.hasOwnProperty.call(pt,ce)&&de.indexOf(ce)<0&&(re[ce]=pt[ce]);if(pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var he=0,ce=Object.getOwnPropertySymbols(pt);he<ce.length;he++)de.indexOf(ce[he])<0&&Object.prototype.propertyIsEnumerable.call(pt,ce[he])&&(re[ce[he]]=pt[ce[he]]);return re};const ve=(pt,de)=>{const re={},ce=Object.assign({},pt);return de.forEach(he=>{pt&&he in pt&&(re[he]=pt[he],delete ce[he])}),{picked:re,omitted:ce}};function Ye(pt,de){const re=pt.type;if((re.__ANT_BUTTON===!0||pt.type==="button")&&pt.props.disabled||re.__ANT_SWITCH===!0&&(pt.props.disabled||pt.props.loading)||re.__ANT_RADIO===!0&&pt.props.disabled){const{picked:ce,omitted:he}=ve(pt.props.style,["position","left","right","top","bottom","float","display","zIndex"]),Re=Object.assign(Object.assign({display:"inline-block"},ce),{cursor:"not-allowed",width:pt.props.block?"100%":void 0}),we=Object.assign(Object.assign({},he),{pointerEvents:"none"}),D=(0,$.Tm)(pt,{style:we,className:null});return pe.createElement("span",{style:Re,className:rt()(pt.props.className,`${de}-disabled-compatible-wrapper`)},D)}return pt}const We=pe.forwardRef((pt,de)=>{var re,ce;const{prefixCls:he,openClassName:Re,getTooltipContainer:we,overlayClassName:D,color:L,overlayInnerStyle:ie,children:xe,afterOpenChange:at,afterVisibleChange:ot,destroyTooltipOnHide:At,arrow:Xe=!0,title:ar,overlay:jt,builtinPlacements:Ot,arrowPointAtCenter:kr=!1,autoAdjustOverflow:$r=!0}=pt,ir=!!Xe,[,zr]=(0,j.Z)(),{getPopupContainer:li,getPrefixCls:Gr,direction:Ze}=pe.useContext(d.E_),nt=pe.useRef(null),Qe=()=>{var He;(He=nt.current)===null||He===void 0||He.forceAlign()};pe.useImperativeHandle(de,()=>({forceAlign:Qe,forcePopupAlign:()=>{Qe()}}));const[Ct,Dt]=(0,te.Z)(!1,{value:(re=pt.open)!==null&&re!==void 0?re:pt.visible,defaultValue:(ce=pt.defaultOpen)!==null&&ce!==void 0?ce:pt.defaultVisible}),ye=!ar&&!jt&&ar!==0,Oe=He=>{var Je,W;Dt(ye?!1:He),ye||((Je=pt.onOpenChange)===null||Je===void 0||Je.call(pt,He),(W=pt.onVisibleChange)===null||W===void 0||W.call(pt,He))},et=pe.useMemo(()=>{var He,Je;let W=kr;return typeof Xe=="object"&&(W=(Je=(He=Xe.pointAtCenter)!==null&&He!==void 0?He:Xe.arrowPointAtCenter)!==null&&Je!==void 0?Je:kr),Ot||(0,Me.Z)({arrowPointAtCenter:W,autoAdjustOverflow:$r,arrowWidth:ir?zr.sizePopupArrow:0,borderRadius:zr.borderRadius,offset:zr.marginXXS,visibleFirst:!0})},[kr,Xe,Ot,zr]),vt=pe.useMemo(()=>ar===0?ar:jt||ar||"",[jt,ar]),wt=pe.createElement(be.BR,null,typeof vt=="function"?vt():vt),{getPopupContainer:Ht,placement:fr="top",mouseEnterDelay:Xt=.1,mouseLeaveDelay:Ue=.1,overlayStyle:Ut,rootClassName:_r}=pt,Fe=De(pt,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),Ge=Gr("tooltip",he),it=Gr(),Pt=pt["data-popover-inject"];let kt=Ct;!("open"in pt)&&!("visible"in pt)&&ye&&(kt=!1);const zt=Ye((0,$.l$)(xe)&&!(0,$.M2)(xe)?xe:pe.createElement("span",null,xe),Ge),rr=zt.props,T=!rr.className||typeof rr.className=="string"?rt()(rr.className,Re||`${Ge}-open`):rr.className,[B,dt]=q(Ge,!Pt),G=ue(Ge,L),fe=G.arrowStyle,xr=Object.assign(Object.assign({},ie),G.overlayStyle),Ne=rt()(D,{[`${Ge}-rtl`]:Ze==="rtl"},G.className,_r,dt);return B(pe.createElement(Le.Z,Object.assign({},Fe,{showArrow:ir,placement:fr,mouseEnterDelay:Xt,mouseLeaveDelay:Ue,prefixCls:Ge,overlayClassName:Ne,overlayStyle:Object.assign(Object.assign({},fe),Ut),getTooltipContainer:Ht||we||li,ref:nt,builtinPlacements:et,overlay:wt,visible:kt,onVisibleChange:Oe,afterVisibleChange:at!=null?at:ot,overlayInnerStyle:xr,arrowContent:pe.createElement("span",{className:`${Ge}-arrow-content`}),motion:{motionName:(0,E.m)(it,"zoom-big-fast",pt.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!At}),kt?(0,$.Tm)(zt,{className:T}):zt))});We._InternalPanelDoNotUseOrYouWillBeFired=oe;var ut=We},64018:function(){var Fr,Rt,J,pe=!1,Pe,rt;window.PR_SHOULD_USE_CONTINUATION=!0;var Le,te;(function(){var E=window,Me=["break,continue,do,else,for,if,return,while"],$=[Me,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],d=[$,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],be=[d,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],j=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],k=[d,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],M="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",O=[d,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],K="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",se=[Me,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],ae=[Me,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],Z=[Me,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],q=[be,k,j,O,K,se,ae,Z],Y=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ue="str",ee="kwd",oe="com",De="typ",ve="lit",Ye="pun",We="pln",ut="tag",pt="dec",de="src",re="atn",ce="atv",he="nocode",Re="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function we(Ze){for(var nt=0,Qe=!1,Ct=!1,Dt=0,ye=Ze.length;Dt<ye;++Dt){var Oe=Ze[Dt];if(Oe.ignoreCase)Ct=!0;else if(/[a-z]/i.test(Oe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Qe=!0,Ct=!1;break}}var et={b:8,t:9,n:10,v:11,f:12,r:13};function vt(Ue){var Ut=Ue.charCodeAt(0);if(Ut!==92)return Ut;var _r=Ue.charAt(1);return Ut=et[_r],Ut||("0"<=_r&&_r<="7"?parseInt(Ue.substring(1),8):_r==="u"||_r==="x"?parseInt(Ue.substring(2),16):Ue.charCodeAt(1))}function wt(Ue){if(Ue<32)return(Ue<16?"\\x0":"\\x")+Ue.toString(16);var Ut=String.fromCharCode(Ue);return Ut==="\\"||Ut==="-"||Ut==="]"||Ut==="^"?"\\"+Ut:Ut}function Ht(Ue){var Ut=Ue.substring(1,Ue.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),_r=[],Fe=Ut[0]==="^",Ge=["["];Fe&&Ge.push("^");for(var it=Fe?1:0,Pt=Ut.length;it<Pt;++it){var kt=Ut[it];if(/\\[bdsw]/i.test(kt))Ge.push(kt);else{var zt=vt(kt),rr;it+2<Pt&&Ut[it+1]==="-"?(rr=vt(Ut[it+2]),it+=2):rr=zt,_r.push([zt,rr]),rr<65||zt>122||(rr<65||zt>90||_r.push([Math.max(65,zt)|32,Math.min(rr,90)|32]),rr<97||zt>122||_r.push([Math.max(97,zt)&-33,Math.min(rr,122)&-33]))}}_r.sort(function(G,fe){return G[0]-fe[0]||fe[1]-G[1]});for(var T=[],B=[],it=0;it<_r.length;++it){var dt=_r[it];dt[0]<=B[1]+1?B[1]=Math.max(B[1],dt[1]):T.push(B=dt)}for(var it=0;it<T.length;++it){var dt=T[it];Ge.push(wt(dt[0])),dt[1]>dt[0]&&(dt[1]+1>dt[0]&&Ge.push("-"),Ge.push(wt(dt[1])))}return Ge.push("]"),Ge.join("")}function fr(Ue){for(var Ut=Ue.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),_r=Ut.length,Fe=[],Ge=0,it=0;Ge<_r;++Ge){var Pt=Ut[Ge];if(Pt==="(")++it;else if(Pt.charAt(0)==="\\"){var kt=+Pt.substring(1);kt&&(kt<=it?Fe[kt]=-1:Ut[Ge]=wt(kt))}}for(var Ge=1;Ge<Fe.length;++Ge)Fe[Ge]===-1&&(Fe[Ge]=++nt);for(var Ge=0,it=0;Ge<_r;++Ge){var Pt=Ut[Ge];if(Pt==="(")++it,Fe[it]||(Ut[Ge]="(?:");else if(Pt.charAt(0)==="\\"){var kt=+Pt.substring(1);kt&&kt<=it&&(Ut[Ge]="\\"+Fe[kt])}}for(var Ge=0;Ge<_r;++Ge)Ut[Ge]==="^"&&Ut[Ge+1]!=="^"&&(Ut[Ge]="");if(Ue.ignoreCase&&Qe)for(var Ge=0;Ge<_r;++Ge){var Pt=Ut[Ge],zt=Pt.charAt(0);Pt.length>=2&&zt==="["?Ut[Ge]=Ht(Pt):zt!=="\\"&&(Ut[Ge]=Pt.replace(/[a-zA-Z]/g,function(B){var dt=B.charCodeAt(0);return"["+String.fromCharCode(dt&-33,dt|32)+"]"}))}return Ut.join("")}for(var Xt=[],Dt=0,ye=Ze.length;Dt<ye;++Dt){var Oe=Ze[Dt];if(Oe.global||Oe.multiline)throw new Error(""+Oe);Xt.push("(?:"+fr(Oe)+")")}return new RegExp(Xt.join("|"),Ct?"gi":"g")}function D(Ze,nt){var Qe=/(?:^|\s)nocode(?:\s|$)/,Ct=[],Dt=0,ye=[],Oe=0;function et(vt){var wt=vt.nodeType;if(wt==1){if(Qe.test(vt.className))return;for(var Ht=vt.firstChild;Ht;Ht=Ht.nextSibling)et(Ht);var fr=vt.nodeName.toLowerCase();(fr==="br"||fr==="li")&&(Ct[Oe]=`
`,ye[Oe<<1]=Dt++,ye[Oe++<<1|1]=vt)}else if(wt==3||wt==4){var Xt=vt.nodeValue;Xt.length&&(nt?Xt=Xt.replace(/\r\n?/g,`
`):Xt=Xt.replace(/[ \t\r\n]+/g," "),Ct[Oe]=Xt,ye[Oe<<1]=Dt,Dt+=Xt.length,ye[Oe++<<1|1]=vt)}}return et(Ze),{sourceCode:Ct.join("").replace(/\n$/,""),spans:ye}}function L(Ze,nt,Qe,Ct,Dt){if(Qe){var ye={sourceNode:Ze,pre:1,langExtension:null,numberLines:null,sourceCode:Qe,spans:null,basePos:nt,decorations:null};Ct(ye),Dt.push.apply(Dt,ye.decorations)}}var ie=/\S/;function xe(Ze){for(var nt=void 0,Qe=Ze.firstChild;Qe;Qe=Qe.nextSibling){var Ct=Qe.nodeType;nt=Ct===1?nt?Ze:Qe:Ct===3&&ie.test(Qe.nodeValue)?Ze:nt}return nt===Ze?void 0:nt}function at(Ze,nt){var Qe={},Ct;(function(){for(var Oe=Ze.concat(nt),et=[],vt={},wt=0,Ht=Oe.length;wt<Ht;++wt){var fr=Oe[wt],Xt=fr[3];if(Xt)for(var Ue=Xt.length;--Ue>=0;)Qe[Xt.charAt(Ue)]=fr;var Ut=fr[1],_r=""+Ut;vt.hasOwnProperty(_r)||(et.push(Ut),vt[_r]=null)}et.push(/[\0-\uffff]/),Ct=we(et)})();var Dt=nt.length,ye=function(Oe){for(var et=Oe.sourceCode,vt=Oe.basePos,wt=Oe.sourceNode,Ht=[vt,We],fr=0,Xt=et.match(Ct)||[],Ue={},Ut=0,_r=Xt.length;Ut<_r;++Ut){var Fe=Xt[Ut],Ge=Ue[Fe],it=void 0,Pt;if(typeof Ge=="string")Pt=!1;else{var kt=Qe[Fe.charAt(0)];if(kt)it=Fe.match(kt[1]),Ge=kt[0];else{for(var zt=0;zt<Dt;++zt)if(kt=nt[zt],it=Fe.match(kt[1]),it){Ge=kt[0];break}it||(Ge=We)}Pt=Ge.length>=5&&Ge.substring(0,5)==="lang-",Pt&&!(it&&typeof it[1]=="string")&&(Pt=!1,Ge=de),Pt||(Ue[Fe]=Ge)}var rr=fr;if(fr+=Fe.length,!Pt)Ht.push(vt+rr,Ge);else{var T=it[1],B=Fe.indexOf(T),dt=B+T.length;it[2]&&(dt=Fe.length-it[2].length,B=dt-T.length);var G=Ge.substring(5);L(wt,vt+rr,Fe.substring(0,B),ye,Ht),L(wt,vt+rr+B,T,kr(G,T),Ht),L(wt,vt+rr+dt,Fe.substring(dt),ye,Ht)}}Oe.decorations=Ht};return ye}function ot(Ze){var nt=[],Qe=[];Ze.tripleQuotedStrings?nt.push([ue,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ze.multiLineStrings?nt.push([ue,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):nt.push([ue,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ze.verbatimStrings&&Qe.push([ue,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ct=Ze.hashComments;Ct&&(Ze.cStyleComments?(Ct>1?nt.push([oe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):nt.push([oe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Qe.push([ue,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):nt.push([oe,/^#[^\r\n]*/,null,"#"])),Ze.cStyleComments&&(Qe.push([oe,/^\/\/[^\r\n]*/,null]),Qe.push([oe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Dt=Ze.regexLiterals;if(Dt){var ye=Dt>1?"":`
\r`,Oe=ye?".":"[\\S\\s]",et="/(?=[^/*"+ye+"])(?:[^/\\x5B\\x5C"+ye+"]|\\x5C"+Oe+"|\\x5B(?:[^\\x5C\\x5D"+ye+"]|\\x5C"+Oe+")*(?:\\x5D|$))+/";Qe.push(["lang-regex",RegExp("^"+Re+"("+et+")")])}var vt=Ze.types;vt&&Qe.push([De,vt]);var wt=(""+Ze.keywords).replace(/^ | $/g,"");wt.length&&Qe.push([ee,new RegExp("^(?:"+wt.replace(/[\s,]+/g,"|")+")\\b"),null]),nt.push([We,/^\s+/,null,` \r
\xA0`]);var Ht="^.[^\\s\\w.$@'\"`/\\\\]*";return Ze.regexLiterals&&(Ht+="(?!s*/)"),Qe.push([ve,/^@[a-z_$][a-z_$@0-9]*/i,null],[De,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[We,/^[a-z_$][a-z_$@0-9]*/i,null],[ve,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[We,/^\\[\s\S]?/,null],[Ye,new RegExp(Ht),null]),at(nt,Qe)}var At=ot({keywords:q,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Xe(Ze,nt,Qe){for(var Ct=/(?:^|\s)nocode(?:\s|$)/,Dt=/\r\n?|\n/,ye=Ze.ownerDocument,Oe=ye.createElement("li");Ze.firstChild;)Oe.appendChild(Ze.firstChild);var et=[Oe];function vt(Ut){var _r=Ut.nodeType;if(_r==1&&!Ct.test(Ut.className))if(Ut.nodeName==="br")wt(Ut),Ut.parentNode&&Ut.parentNode.removeChild(Ut);else for(var Fe=Ut.firstChild;Fe;Fe=Fe.nextSibling)vt(Fe);else if((_r==3||_r==4)&&Qe){var Ge=Ut.nodeValue,it=Ge.match(Dt);if(it){var Pt=Ge.substring(0,it.index);Ut.nodeValue=Pt;var kt=Ge.substring(it.index+it[0].length);if(kt){var zt=Ut.parentNode;zt.insertBefore(ye.createTextNode(kt),Ut.nextSibling)}wt(Ut),Pt||Ut.parentNode.removeChild(Ut)}}}function wt(Ut){for(;!Ut.nextSibling;)if(Ut=Ut.parentNode,!Ut)return;function _r(it,Pt){var kt=Pt?it.cloneNode(!1):it,zt=it.parentNode;if(zt){var rr=_r(zt,1),T=it.nextSibling;rr.appendChild(kt);for(var B=T;B;B=T)T=B.nextSibling,rr.appendChild(B)}return kt}for(var Fe=_r(Ut.nextSibling,0),Ge;(Ge=Fe.parentNode)&&Ge.nodeType===1;)Fe=Ge;et.push(Fe)}for(var Ht=0;Ht<et.length;++Ht)vt(et[Ht]);nt===(nt|0)&&et[0].setAttribute("value",nt);var fr=ye.createElement("ol");fr.className="linenums";for(var Xt=Math.max(0,nt-1|0)||0,Ht=0,Ue=et.length;Ht<Ue;++Ht)Oe=et[Ht],Oe.className="L"+(Ht+Xt)%10,Oe.firstChild||Oe.appendChild(ye.createTextNode("\xA0")),fr.appendChild(Oe);Ze.appendChild(fr)}function ar(Ze){var nt=/\bMSIE\s(\d+)/.exec(navigator.userAgent);nt=nt&&+nt[1]<=8;var Qe=/\n/g,Ct=Ze.sourceCode,Dt=Ct.length,ye=0,Oe=Ze.spans,et=Oe.length,vt=0,wt=Ze.decorations,Ht=wt.length,fr=0;wt[Ht]=Dt;var Xt,Ue;for(Ue=Xt=0;Ue<Ht;)wt[Ue]!==wt[Ue+2]?(wt[Xt++]=wt[Ue++],wt[Xt++]=wt[Ue++]):Ue+=2;for(Ht=Xt,Ue=Xt=0;Ue<Ht;){for(var Ut=wt[Ue],_r=wt[Ue+1],Fe=Ue+2;Fe+2<=Ht&&wt[Fe+1]===_r;)Fe+=2;wt[Xt++]=Ut,wt[Xt++]=_r,Ue=Fe}Ht=wt.length=Xt;var Ge=Ze.sourceNode,it="";Ge&&(it=Ge.style.display,Ge.style.display="none");try{for(var Pt=null;vt<et;){var kt=Oe[vt],zt=Oe[vt+2]||Dt,rr=wt[fr+2]||Dt,Fe=Math.min(zt,rr),T=Oe[vt+1],B;if(T.nodeType!==1&&(B=Ct.substring(ye,Fe))){nt&&(B=B.replace(Qe,"\r")),T.nodeValue=B;var dt=T.ownerDocument,G=dt.createElement("span");G.className=wt[fr+1];var fe=T.parentNode;fe.replaceChild(G,T),G.appendChild(T),ye<zt&&(Oe[vt+1]=T=dt.createTextNode(Ct.substring(Fe,zt)),fe.insertBefore(T,G.nextSibling))}ye=Fe,ye>=zt&&(vt+=2),ye>=rr&&(fr+=2)}}finally{Ge&&(Ge.style.display=it)}}var jt={};function Ot(Ze,nt){for(var Qe=nt.length;--Qe>=0;){var Ct=nt[Qe];jt.hasOwnProperty(Ct)?E.console&&console.warn("cannot override language handler %s",Ct):jt[Ct]=Ze}}function kr(Ze,nt){return Ze&&jt.hasOwnProperty(Ze)||(Ze=/^\s*</.test(nt)?"default-markup":"default-code"),jt[Ze]}Ot(At,["default-code"]),Ot(at([],[[We,/^[^<?]+/],[pt,/^<!\w[^>]*(?:>|$)/],[oe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[Ye,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ot(at([[We,/^[\s]+/,null,` \r
`],[ce,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ut,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[re,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Ye,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Ot(at([],[[ce,/^[\s\S]+/]]),["uq.val"]),Ot(ot({keywords:be,hashComments:!0,cStyleComments:!0,types:Y}),["c","cc","cpp","cxx","cyc","m"]),Ot(ot({keywords:"null,true,false"}),["json"]),Ot(ot({keywords:k,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Y}),["cs"]),Ot(ot({keywords:j,cStyleComments:!0}),["java"]),Ot(ot({keywords:Z,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ot(ot({keywords:se,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ot(ot({keywords:K,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ot(ot({keywords:ae,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ot(ot({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ot(ot({keywords:M,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ot(at([],[[ue,/^[\s\S]+/]]),["regex"]);function $r(Ze){var nt=Ze.langExtension;try{var Qe=D(Ze.sourceNode,Ze.pre),Ct=Qe.sourceCode;Ze.sourceCode=Ct,Ze.spans=Qe.spans,Ze.basePos=0,kr(nt,Ct)(Ze),ar(Ze)}catch(Dt){E.console&&console.log(Dt&&Dt.stack||Dt)}}function ir(Ze,nt,Qe){var Ct=Qe||!1,Dt=nt||null,ye=document.createElement("div");ye.innerHTML="<pre>"+Ze+"</pre>",ye=ye.firstChild,Ct&&Xe(ye,Ct,!0);var Oe={langExtension:Dt,numberLines:Ct,sourceNode:ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return $r(Oe),ye.innerHTML}function zr(Ze,nt){var Qe=nt||document.body,Ct=Qe.ownerDocument||document;function Dt(kt){return Qe.getElementsByTagName(kt)}for(var ye=[Dt("pre"),Dt("code"),Dt("xmp")],Oe=[],et=0;et<ye.length;++et)for(var vt=0,wt=ye[et].length;vt<wt;++vt)Oe.push(ye[et][vt]);ye=null;var Ht=Date;Ht.now||(Ht={now:function(){return+new Date}});var fr=0,Xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ue=/\bprettyprint\b/,Ut=/\bprettyprinted\b/,_r=/pre|xmp/i,Fe=/^code$/i,Ge=/^(?:pre|code|xmp)$/i,it={};function Pt(){for(var kt=E.PR_SHOULD_USE_CONTINUATION?Ht.now()+250:1/0;fr<Oe.length&&Ht.now()<kt;fr++){for(var zt=Oe[fr],rr=it,T=zt;T=T.previousSibling;){var B=T.nodeType,dt=(B===7||B===8)&&T.nodeValue;if(dt?!/^\??prettify\b/.test(dt):B!==3||/\S/.test(T.nodeValue))break;if(dt){rr={},dt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ae,Yt,vr){rr[Yt]=vr});break}}var G=zt.className;if((rr!==it||Ue.test(G))&&!Ut.test(G)){for(var fe=!1,xr=zt.parentNode;xr;xr=xr.parentNode){var Ne=xr.tagName;if(Ge.test(Ne)&&xr.className&&Ue.test(xr.className)){fe=!0;break}}if(!fe){zt.className+=" prettyprinted";var He=rr.lang;if(!He){He=G.match(Xt);var Je;!He&&(Je=xe(zt))&&Fe.test(Je.tagName)&&(He=Je.className.match(Xt)),He&&(He=He[1])}var W;if(_r.test(zt.tagName))W=1;else{var ge=zt.currentStyle,Se=Ct.defaultView,Ke=ge?ge.whiteSpace:Se&&Se.getComputedStyle?Se.getComputedStyle(zt,null).getPropertyValue("white-space"):0;W=Ke&&Ke.substring(0,3)==="pre"}var V=rr.linenums;(V=V==="true"||+V)||(V=G.match(/\blinenums\b(?::(\d+))?/),V=V?V[1]&&V[1].length?+V[1]:!0:!1),V&&Xe(zt,V,W);var qt={langExtension:He,sourceNode:zt,numberLines:V,pre:W,sourceCode:null,basePos:null,spans:null,decorations:null};$r(qt)}}}fr<Oe.length?E.setTimeout(Pt,250):typeof Ze=="function"&&Ze()}Pt()}var li=E.PR={createSimpleLexer:at,registerLangHandler:Ot,sourceDecorator:ot,PR_ATTRIB_NAME:re,PR_ATTRIB_VALUE:ce,PR_COMMENT:oe,PR_DECLARATION:pt,PR_KEYWORD:ee,PR_LITERAL:ve,PR_NOCODE:he,PR_PLAIN:We,PR_PUNCTUATION:Ye,PR_SOURCE:de,PR_STRING:ue,PR_TAG:ut,PR_TYPE:De,prettyPrintOne:pe?E.prettyPrintOne=ir:Le=ir,prettyPrint:te=pe?E.prettyPrint=zr:te=zr},Gr=E.define;typeof Gr=="function"&&Gr.amd&&Gr("google-code-prettify",[],function(){return li})})()},25769:function(Fr,Rt,J){"use strict";var pe=J(98040),Pe={"text/plain":"Text","text/html":"Url",default:"Text"},rt="Copy to clipboard: #{key}, Enter";function Le(E){var Me=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return E.replace(/#{\s*key\s*}/g,Me)}function te(E,Me){var $,d,be,j,k,M,O=!1;Me||(Me={}),$=Me.debug||!1;try{be=pe(),j=document.createRange(),k=document.getSelection(),M=document.createElement("span"),M.textContent=E,M.ariaHidden="true",M.style.all="unset",M.style.position="fixed",M.style.top=0,M.style.clip="rect(0, 0, 0, 0)",M.style.whiteSpace="pre",M.style.webkitUserSelect="text",M.style.MozUserSelect="text",M.style.msUserSelect="text",M.style.userSelect="text",M.addEventListener("copy",function(se){if(se.stopPropagation(),Me.format)if(se.preventDefault(),typeof se.clipboardData=="undefined"){$&&console.warn("unable to use e.clipboardData"),$&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var ae=Pe[Me.format]||Pe.default;window.clipboardData.setData(ae,E)}else se.clipboardData.clearData(),se.clipboardData.setData(Me.format,E);Me.onCopy&&(se.preventDefault(),Me.onCopy(se.clipboardData))}),document.body.appendChild(M),j.selectNodeContents(M),k.addRange(j);var K=document.execCommand("copy");if(!K)throw new Error("copy command was unsuccessful");O=!0}catch(se){$&&console.error("unable to copy using execCommand: ",se),$&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(Me.format||"text",E),Me.onCopy&&Me.onCopy(window.clipboardData),O=!0}catch(ae){$&&console.error("unable to copy using clipboardData: ",ae),$&&console.error("falling back to prompt"),d=Le("message"in Me?Me.message:rt),window.prompt(d,E)}}finally{k&&(typeof k.removeRange=="function"?k.removeRange(j):k.removeAllRanges()),M&&document.body.removeChild(M),be()}return O}Fr.exports=te},53184:function(Fr,Rt,J){"use strict";var pe,Pe;function rt(Le,te,E){var Me=function($,d){return Le.js_beautify($,d)};return Me.js=Le.js_beautify,Me.css=te.css_beautify,Me.html=E.html_beautify,Me.js_beautify=Le.js_beautify,Me.css_beautify=te.css_beautify,Me.html_beautify=E.html_beautify,Me}pe=[J(58553),J(87804),J(40998)],Pe=function(Le,te,E){return rt(Le,te,E)}.apply(Rt,pe),Pe!==void 0&&(Fr.exports=Pe)},87804:function(Fr,Rt){var J,pe;(function(){var Pe;(function(){"use strict";var Le=[,,function($){function d(k){this.__parent=k,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}d.prototype.clone_empty=function(){var k=new d(this.__parent);return k.set_indent(this.__indent_count,this.__alignment_count),k},d.prototype.item=function(k){return k<0?this.__items[this.__items.length+k]:this.__items[k]},d.prototype.has_match=function(k){for(var M=this.__items.length-1;M>=0;M--)if(this.__items[M].match(k))return!0;return!1},d.prototype.set_indent=function(k,M){this.is_empty()&&(this.__indent_count=k||0,this.__alignment_count=M||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},d.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var k=this.__parent.current_line;return k.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),k.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),k.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,k.__items[0]===" "&&(k.__items.splice(0,1),k.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(k){this.__items.push(k);var M=k.lastIndexOf(`
`);M!==-1?this.__character_count=k.length-M:this.__character_count+=k.length},d.prototype.pop=function(){var k=null;return this.is_empty()||(k=this.__items.pop(),this.__character_count-=k.length),k},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var k="";return this.is_empty()?this.__parent.indent_empty_lines&&(k=this.__parent.get_indent_string(this.__indent_count)):(k=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),k+=this.__items.join("")),k};function be(k,M){this.__cache=[""],this.__indent_size=k.indent_size,this.__indent_string=k.indent_char,k.indent_with_tabs||(this.__indent_string=new Array(k.indent_size+1).join(k.indent_char)),M=M||"",k.indent_level>0&&(M=new Array(k.indent_level+1).join(this.__indent_string)),this.__base_string=M,this.__base_string_length=M.length}be.prototype.get_indent_size=function(k,M){var O=this.__base_string_length;return M=M||0,k<0&&(O=0),O+=k*this.__indent_size,O+=M,O},be.prototype.get_indent_string=function(k,M){var O=this.__base_string;return M=M||0,k<0&&(k=0,O=""),M+=k*this.__indent_size,this.__ensure_cache(M),O+=this.__cache[M],O},be.prototype.__ensure_cache=function(k){for(;k>=this.__cache.length;)this.__add_column()},be.prototype.__add_column=function(){var k=this.__cache.length,M=0,O="";this.__indent_size&&k>=this.__indent_size&&(M=Math.floor(k/this.__indent_size),k-=M*this.__indent_size,O=new Array(M+1).join(this.__indent_string)),k&&(O+=new Array(k+1).join(" ")),this.__cache.push(O)};function j(k,M){this.__indent_cache=new be(k,M),this.raw=!1,this._end_with_newline=k.end_with_newline,this.indent_size=k.indent_size,this.wrap_line_length=k.wrap_line_length,this.indent_empty_lines=k.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}j.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},j.prototype.get_line_number=function(){return this.__lines.length},j.prototype.get_indent_string=function(k,M){return this.__indent_cache.get_indent_string(k,M)},j.prototype.get_indent_size=function(k,M){return this.__indent_cache.get_indent_size(k,M)},j.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},j.prototype.add_new_line=function(k){return this.is_empty()||!k&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},j.prototype.get_code=function(k){this.trim(!0);var M=this.current_line.pop();M&&(M[M.length-1]===`
`&&(M=M.replace(/\n+$/g,"")),this.current_line.push(M)),this._end_with_newline&&this.__add_outputline();var O=this.__lines.join(`
`);return k!==`
`&&(O=O.replace(/[\n]/g,k)),O},j.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},j.prototype.set_indent=function(k,M){return k=k||0,M=M||0,this.next_line.set_indent(k,M),this.__lines.length>1?(this.current_line.set_indent(k,M),!0):(this.current_line.set_indent(),!1)},j.prototype.add_raw_token=function(k){for(var M=0;M<k.newlines;M++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(k.whitespace_before),this.current_line.push(k.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},j.prototype.add_token=function(k){this.__add_space_before_token(),this.current_line.push(k),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},j.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},j.prototype.remove_indent=function(k){for(var M=this.__lines.length;k<M;)this.__lines[k]._remove_indent(),k++;this.current_line._remove_wrap_indent()},j.prototype.trim=function(k){for(k=k===void 0?!1:k,this.current_line.trim();k&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},j.prototype.just_added_newline=function(){return this.current_line.is_empty()},j.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},j.prototype.ensure_empty_line_above=function(k,M){for(var O=this.__lines.length-2;O>=0;){var K=this.__lines[O];if(K.is_empty())break;if(K.item(0).indexOf(k)!==0&&K.item(-1)!==M){this.__lines.splice(O+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}O--}},$.exports.Output=j},,,,function($){function d(k,M){this.raw_options=be(k,M),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(k,M){var O=this.raw_options[k],K=M||[];return typeof O=="object"?O!==null&&typeof O.concat=="function"&&(K=O.concat()):typeof O=="string"&&(K=O.split(/[^a-zA-Z0-9_\/\-]+/)),K},d.prototype._get_boolean=function(k,M){var O=this.raw_options[k],K=O===void 0?!!M:!!O;return K},d.prototype._get_characters=function(k,M){var O=this.raw_options[k],K=M||"";return typeof O=="string"&&(K=O.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),K},d.prototype._get_number=function(k,M){var O=this.raw_options[k];M=parseInt(M,10),isNaN(M)&&(M=0);var K=parseInt(O,10);return isNaN(K)&&(K=M),K},d.prototype._get_selection=function(k,M,O){var K=this._get_selection_list(k,M,O);if(K.length!==1)throw new Error("Invalid Option Value: The option '"+k+`' can only be one of the following values:
`+M+`
You passed in: '`+this.raw_options[k]+"'");return K[0]},d.prototype._get_selection_list=function(k,M,O){if(!M||M.length===0)throw new Error("Selection list cannot be empty.");if(O=O||[M[0]],!this._is_valid_selection(O,M))throw new Error("Invalid Default Value!");var K=this._get_array(k,O);if(!this._is_valid_selection(K,M))throw new Error("Invalid Option Value: The option '"+k+`' can contain only the following values:
`+M+`
You passed in: '`+this.raw_options[k]+"'");return K},d.prototype._is_valid_selection=function(k,M){return k.length&&M.length&&!k.some(function(O){return M.indexOf(O)===-1})};function be(k,M){var O={};k=j(k);var K;for(K in k)K!==M&&(O[K]=k[K]);if(M&&k[M])for(K in k[M])O[K]=k[M][K];return O}function j(k){var M={},O;for(O in k){var K=O.replace(/-/g,"_");M[K]=k[O]}return M}$.exports.Options=d,$.exports.normalizeOpts=j,$.exports.mergeOpts=be},,function($){var d=RegExp.prototype.hasOwnProperty("sticky");function be(j){this.__input=j||"",this.__input_length=this.__input.length,this.__position=0}be.prototype.restart=function(){this.__position=0},be.prototype.back=function(){this.__position>0&&(this.__position-=1)},be.prototype.hasNext=function(){return this.__position<this.__input_length},be.prototype.next=function(){var j=null;return this.hasNext()&&(j=this.__input.charAt(this.__position),this.__position+=1),j},be.prototype.peek=function(j){var k=null;return j=j||0,j+=this.__position,j>=0&&j<this.__input_length&&(k=this.__input.charAt(j)),k},be.prototype.__match=function(j,k){j.lastIndex=k;var M=j.exec(this.__input);return M&&!(d&&j.sticky)&&M.index!==k&&(M=null),M},be.prototype.test=function(j,k){return k=k||0,k+=this.__position,k>=0&&k<this.__input_length?!!this.__match(j,k):!1},be.prototype.testChar=function(j,k){var M=this.peek(k);return j.lastIndex=0,M!==null&&j.test(M)},be.prototype.match=function(j){var k=this.__match(j,this.__position);return k?this.__position+=k[0].length:k=null,k},be.prototype.read=function(j,k,M){var O="",K;return j&&(K=this.match(j),K&&(O+=K[0])),k&&(K||!j)&&(O+=this.readUntil(k,M)),O},be.prototype.readUntil=function(j,k){var M="",O=this.__position;j.lastIndex=this.__position;var K=j.exec(this.__input);return K?(O=K.index,k&&(O+=K[0].length)):O=this.__input_length,M=this.__input.substring(this.__position,O),this.__position=O,M},be.prototype.readUntilAfter=function(j){return this.readUntil(j,!0)},be.prototype.get_regexp=function(j,k){var M=null,O="g";return k&&d&&(O="y"),typeof j=="string"&&j!==""?M=new RegExp(j,O):j&&(M=new RegExp(j.source,O)),M},be.prototype.get_literal_regexp=function(j){return RegExp(j.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},be.prototype.peekUntilAfter=function(j){var k=this.__position,M=this.readUntilAfter(j);return this.__position=k,M},be.prototype.lookBack=function(j){var k=this.__position-1;return k>=j.length&&this.__input.substring(k-j.length,k).toLowerCase()===j},$.exports.InputScanner=be},,,,,function($){function d(be,j){be=typeof be=="string"?be:be.source,j=typeof j=="string"?j:j.source,this.__directives_block_pattern=new RegExp(be+/ beautify( \w+[:]\w+)+ /.source+j,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(be+/\sbeautify\signore:end\s/.source+j,"g")}d.prototype.get_directives=function(be){if(!be.match(this.__directives_block_pattern))return null;var j={};this.__directive_pattern.lastIndex=0;for(var k=this.__directive_pattern.exec(be);k;)j[k[1]]=k[2],k=this.__directive_pattern.exec(be);return j},d.prototype.readIgnored=function(be){return be.readUntilAfter(this.__directives_end_ignore_pattern)},$.exports.Directives=d},,function($,d,be){var j=be(16).Beautifier,k=be(17).Options;function M(O,K){var se=new j(O,K);return se.beautify()}$.exports=M,$.exports.defaultOptions=function(){return new k}},function($,d,be){var j=be(17).Options,k=be(2).Output,M=be(8).InputScanner,O=be(13).Directives,K=new O(/\/\*/,/\*\//),se=/\r\n|[\r\n]/,ae=/\r\n|[\r\n]/g,Z=/\s/,q=/(?:\s|\n)+/g,Y=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,ue=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ee(oe,De){this._source_text=oe||"",this._options=new j(De),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}ee.prototype.eatString=function(oe){var De="";for(this._ch=this._input.next();this._ch;){if(De+=this._ch,this._ch==="\\")De+=this._input.next();else if(oe.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return De},ee.prototype.eatWhitespace=function(oe){for(var De=Z.test(this._input.peek()),ve=0;Z.test(this._input.peek());)this._ch=this._input.next(),oe&&this._ch===`
`&&(ve===0||ve<this._options.max_preserve_newlines)&&(ve++,this._output.add_new_line(!0));return De},ee.prototype.foundNestedPseudoClass=function(){for(var oe=0,De=1,ve=this._input.peek(De);ve;){if(ve==="{")return!0;if(ve==="(")oe+=1;else if(ve===")"){if(oe===0)return!1;oe-=1}else if(ve===";"||ve==="}")return!1;De++,ve=this._input.peek(De)}return!1},ee.prototype.print_string=function(oe){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(oe)},ee.prototype.preserveSingleSpace=function(oe){oe&&(this._output.space_before_token=!0)},ee.prototype.indent=function(){this._indentLevel++},ee.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ee.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var oe=this._source_text,De=this._options.eol;De==="auto"&&(De=`
`,oe&&se.test(oe||"")&&(De=oe.match(se)[0])),oe=oe.replace(ae,`
`);var ve=oe.match(/^[\t ]*/)[0];this._output=new k(this._options,ve),this._input=new M(oe),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Ye=0,We=!1,ut=!1,pt=!1,de=!1,re=!1,ce=this._ch,he=!1,Re,we,D;Re=this._input.read(q),we=Re!=="",D=ce,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),ce=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var L=this._input.read(Y),ie=K.get_directives(L);ie&&ie.ignore==="start"&&(L+=K.readIgnored(this._input)),this.print_string(L),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(ue)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(we),this.print_string(this._ch);var xe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);xe.match(/[ :]$/)&&(xe=this.eatString(": ").replace(/\s+$/,""),this.print_string(xe),this._output.space_before_token=!0),Ye===0&&xe.indexOf(":")!==-1&&(ut=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(we),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var at=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);at.match(/[ :]$/)&&(at=this.eatString(": ").replace(/\s+$/,""),this.print_string(at),this._output.space_before_token=!0),Ye===0&&at.indexOf(":")!==-1?(ut=!0,this.indent()):at in this.NESTED_AT_RULE?(this._nestedLevel+=1,at in this.CONDITIONAL_GROUP_RULE&&(pt=!0)):Ye===0&&!ut&&(de=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(we),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")ut&&(ut=!1,this.outdent()),de=!1,pt?(pt=!1,We=this._indentLevel>=this._nestedLevel):We=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&We&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(D==="("?this._output.space_before_token=!1:D!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),D==="{"&&this._output.trim(!0),ut&&(this.outdent(),ut=!1),this.print_string(this._ch),We=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ot=0;ot<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ot++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ot])){he=!0;break}(We||pt)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!de&&Ye===0?(this.print_string(":"),ut||(ut=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var At=D==='"'||D==="'";this.preserveSingleSpace(At||we),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")he=!1,Ye===0?(ut&&(this.outdent(),ut=!1),de=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),Ye++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),Ye&&(Ye--,this.outdent()));else{var Xe=!1;this._input.lookBack("with")&&(Xe=!0),this.preserveSingleSpace(we||Xe),this.print_string(this._ch),ut&&D==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),re=!0):(this.eatWhitespace(),Ye++,this.indent())}else if(this._ch===")")Ye&&(Ye--,this.outdent()),re&&this._input.peek()===";"&&this._options.selector_separator_newline&&(re=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!ut||re)&&Ye===0&&!de?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!ut&&Ye===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Z.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(we),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),Z.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ar=D==='"'||D==="'";this.preserveSingleSpace(ar||we),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&he&&this._output.add_new_line()}var jt=this._output.get_code(De);return jt},$.exports.Beautifier=ee},function($,d,be){var j=be(6).Options;function k(M){j.call(this,M,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var O=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||O;var K=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var se=0;se<K.length;se++)K[se]!=="expand"?this.brace_style="collapse":this.brace_style=K[se]}k.prototype=new j,$.exports.Options=k}],te={};function E($){var d=te[$];if(d!==void 0)return d.exports;var be=te[$]={exports:{}};return Le[$](be,be.exports,E),be.exports}var Me=E(15);Pe=Me})();var rt=Pe;J=[],pe=function(){return{css_beautify:rt}}.apply(Rt,J),pe!==void 0&&(Fr.exports=pe)})()},40998:function(Fr,Rt,J){var pe,Pe;(function(){var rt;(function(){"use strict";var Me=[,,function(j){function k(K){this.__parent=K,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}k.prototype.clone_empty=function(){var K=new k(this.__parent);return K.set_indent(this.__indent_count,this.__alignment_count),K},k.prototype.item=function(K){return K<0?this.__items[this.__items.length+K]:this.__items[K]},k.prototype.has_match=function(K){for(var se=this.__items.length-1;se>=0;se--)if(this.__items[se].match(K))return!0;return!1},k.prototype.set_indent=function(K,se){this.is_empty()&&(this.__indent_count=K||0,this.__alignment_count=se||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},k.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},k.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},k.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var K=this.__parent.current_line;return K.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),K.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),K.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,K.__items[0]===" "&&(K.__items.splice(0,1),K.__character_count-=1),!0}return!1},k.prototype.is_empty=function(){return this.__items.length===0},k.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},k.prototype.push=function(K){this.__items.push(K);var se=K.lastIndexOf(`
`);se!==-1?this.__character_count=K.length-se:this.__character_count+=K.length},k.prototype.pop=function(){var K=null;return this.is_empty()||(K=this.__items.pop(),this.__character_count-=K.length),K},k.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},k.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},k.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},k.prototype.toString=function(){var K="";return this.is_empty()?this.__parent.indent_empty_lines&&(K=this.__parent.get_indent_string(this.__indent_count)):(K=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),K+=this.__items.join("")),K};function M(K,se){this.__cache=[""],this.__indent_size=K.indent_size,this.__indent_string=K.indent_char,K.indent_with_tabs||(this.__indent_string=new Array(K.indent_size+1).join(K.indent_char)),se=se||"",K.indent_level>0&&(se=new Array(K.indent_level+1).join(this.__indent_string)),this.__base_string=se,this.__base_string_length=se.length}M.prototype.get_indent_size=function(K,se){var ae=this.__base_string_length;return se=se||0,K<0&&(ae=0),ae+=K*this.__indent_size,ae+=se,ae},M.prototype.get_indent_string=function(K,se){var ae=this.__base_string;return se=se||0,K<0&&(K=0,ae=""),se+=K*this.__indent_size,this.__ensure_cache(se),ae+=this.__cache[se],ae},M.prototype.__ensure_cache=function(K){for(;K>=this.__cache.length;)this.__add_column()},M.prototype.__add_column=function(){var K=this.__cache.length,se=0,ae="";this.__indent_size&&K>=this.__indent_size&&(se=Math.floor(K/this.__indent_size),K-=se*this.__indent_size,ae=new Array(se+1).join(this.__indent_string)),K&&(ae+=new Array(K+1).join(" ")),this.__cache.push(ae)};function O(K,se){this.__indent_cache=new M(K,se),this.raw=!1,this._end_with_newline=K.end_with_newline,this.indent_size=K.indent_size,this.wrap_line_length=K.wrap_line_length,this.indent_empty_lines=K.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new k(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}O.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},O.prototype.get_line_number=function(){return this.__lines.length},O.prototype.get_indent_string=function(K,se){return this.__indent_cache.get_indent_string(K,se)},O.prototype.get_indent_size=function(K,se){return this.__indent_cache.get_indent_size(K,se)},O.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},O.prototype.add_new_line=function(K){return this.is_empty()||!K&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},O.prototype.get_code=function(K){this.trim(!0);var se=this.current_line.pop();se&&(se[se.length-1]===`
`&&(se=se.replace(/\n+$/g,"")),this.current_line.push(se)),this._end_with_newline&&this.__add_outputline();var ae=this.__lines.join(`
`);return K!==`
`&&(ae=ae.replace(/[\n]/g,K)),ae},O.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},O.prototype.set_indent=function(K,se){return K=K||0,se=se||0,this.next_line.set_indent(K,se),this.__lines.length>1?(this.current_line.set_indent(K,se),!0):(this.current_line.set_indent(),!1)},O.prototype.add_raw_token=function(K){for(var se=0;se<K.newlines;se++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(K.whitespace_before),this.current_line.push(K.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},O.prototype.add_token=function(K){this.__add_space_before_token(),this.current_line.push(K),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},O.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},O.prototype.remove_indent=function(K){for(var se=this.__lines.length;K<se;)this.__lines[K]._remove_indent(),K++;this.current_line._remove_wrap_indent()},O.prototype.trim=function(K){for(K=K===void 0?!1:K,this.current_line.trim();K&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},O.prototype.just_added_newline=function(){return this.current_line.is_empty()},O.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},O.prototype.ensure_empty_line_above=function(K,se){for(var ae=this.__lines.length-2;ae>=0;){var Z=this.__lines[ae];if(Z.is_empty())break;if(Z.item(0).indexOf(K)!==0&&Z.item(-1)!==se){this.__lines.splice(ae+1,0,new k(this)),this.previous_line=this.__lines[this.__lines.length-2];break}ae--}},j.exports.Output=O},function(j){function k(M,O,K,se){this.type=M,this.text=O,this.comments_before=null,this.newlines=K||0,this.whitespace_before=se||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}j.exports.Token=k},,,function(j){function k(K,se){this.raw_options=M(K,se),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}k.prototype._get_array=function(K,se){var ae=this.raw_options[K],Z=se||[];return typeof ae=="object"?ae!==null&&typeof ae.concat=="function"&&(Z=ae.concat()):typeof ae=="string"&&(Z=ae.split(/[^a-zA-Z0-9_\/\-]+/)),Z},k.prototype._get_boolean=function(K,se){var ae=this.raw_options[K],Z=ae===void 0?!!se:!!ae;return Z},k.prototype._get_characters=function(K,se){var ae=this.raw_options[K],Z=se||"";return typeof ae=="string"&&(Z=ae.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),Z},k.prototype._get_number=function(K,se){var ae=this.raw_options[K];se=parseInt(se,10),isNaN(se)&&(se=0);var Z=parseInt(ae,10);return isNaN(Z)&&(Z=se),Z},k.prototype._get_selection=function(K,se,ae){var Z=this._get_selection_list(K,se,ae);if(Z.length!==1)throw new Error("Invalid Option Value: The option '"+K+`' can only be one of the following values:
`+se+`
You passed in: '`+this.raw_options[K]+"'");return Z[0]},k.prototype._get_selection_list=function(K,se,ae){if(!se||se.length===0)throw new Error("Selection list cannot be empty.");if(ae=ae||[se[0]],!this._is_valid_selection(ae,se))throw new Error("Invalid Default Value!");var Z=this._get_array(K,ae);if(!this._is_valid_selection(Z,se))throw new Error("Invalid Option Value: The option '"+K+`' can contain only the following values:
`+se+`
You passed in: '`+this.raw_options[K]+"'");return Z},k.prototype._is_valid_selection=function(K,se){return K.length&&se.length&&!K.some(function(ae){return se.indexOf(ae)===-1})};function M(K,se){var ae={};K=O(K);var Z;for(Z in K)Z!==se&&(ae[Z]=K[Z]);if(se&&K[se])for(Z in K[se])ae[Z]=K[se][Z];return ae}function O(K){var se={},ae;for(ae in K){var Z=ae.replace(/-/g,"_");se[Z]=K[ae]}return se}j.exports.Options=k,j.exports.normalizeOpts=O,j.exports.mergeOpts=M},,function(j){var k=RegExp.prototype.hasOwnProperty("sticky");function M(O){this.__input=O||"",this.__input_length=this.__input.length,this.__position=0}M.prototype.restart=function(){this.__position=0},M.prototype.back=function(){this.__position>0&&(this.__position-=1)},M.prototype.hasNext=function(){return this.__position<this.__input_length},M.prototype.next=function(){var O=null;return this.hasNext()&&(O=this.__input.charAt(this.__position),this.__position+=1),O},M.prototype.peek=function(O){var K=null;return O=O||0,O+=this.__position,O>=0&&O<this.__input_length&&(K=this.__input.charAt(O)),K},M.prototype.__match=function(O,K){O.lastIndex=K;var se=O.exec(this.__input);return se&&!(k&&O.sticky)&&se.index!==K&&(se=null),se},M.prototype.test=function(O,K){return K=K||0,K+=this.__position,K>=0&&K<this.__input_length?!!this.__match(O,K):!1},M.prototype.testChar=function(O,K){var se=this.peek(K);return O.lastIndex=0,se!==null&&O.test(se)},M.prototype.match=function(O){var K=this.__match(O,this.__position);return K?this.__position+=K[0].length:K=null,K},M.prototype.read=function(O,K,se){var ae="",Z;return O&&(Z=this.match(O),Z&&(ae+=Z[0])),K&&(Z||!O)&&(ae+=this.readUntil(K,se)),ae},M.prototype.readUntil=function(O,K){var se="",ae=this.__position;O.lastIndex=this.__position;var Z=O.exec(this.__input);return Z?(ae=Z.index,K&&(ae+=Z[0].length)):ae=this.__input_length,se=this.__input.substring(this.__position,ae),this.__position=ae,se},M.prototype.readUntilAfter=function(O){return this.readUntil(O,!0)},M.prototype.get_regexp=function(O,K){var se=null,ae="g";return K&&k&&(ae="y"),typeof O=="string"&&O!==""?se=new RegExp(O,ae):O&&(se=new RegExp(O.source,ae)),se},M.prototype.get_literal_regexp=function(O){return RegExp(O.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},M.prototype.peekUntilAfter=function(O){var K=this.__position,se=this.readUntilAfter(O);return this.__position=K,se},M.prototype.lookBack=function(O){var K=this.__position-1;return K>=O.length&&this.__input.substring(K-O.length,K).toLowerCase()===O},j.exports.InputScanner=M},function(j,k,M){var O=M(8).InputScanner,K=M(3).Token,se=M(10).TokenStream,ae=M(11).WhitespacePattern,Z={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},q=function(Y,ue){this._input=new O(Y),this._options=ue||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new ae(this._input)};q.prototype.tokenize=function(){this._input.restart(),this.__tokens=new se,this._reset();for(var Y,ue=new K(Z.START,""),ee=null,oe=[],De=new se;ue.type!==Z.EOF;){for(Y=this._get_next_token(ue,ee);this._is_comment(Y);)De.add(Y),Y=this._get_next_token(ue,ee);De.isEmpty()||(Y.comments_before=De,De=new se),Y.parent=ee,this._is_opening(Y)?(oe.push(ee),ee=Y):ee&&this._is_closing(Y,ee)&&(Y.opened=ee,ee.closed=Y,ee=oe.pop(),Y.parent=ee),Y.previous=ue,ue.next=Y,this.__tokens.add(Y),ue=Y}return this.__tokens},q.prototype._is_first_token=function(){return this.__tokens.isEmpty()},q.prototype._reset=function(){},q.prototype._get_next_token=function(Y,ue){this._readWhitespace();var ee=this._input.read(/.+/g);return ee?this._create_token(Z.RAW,ee):this._create_token(Z.EOF,"")},q.prototype._is_comment=function(Y){return!1},q.prototype._is_opening=function(Y){return!1},q.prototype._is_closing=function(Y,ue){return!1},q.prototype._create_token=function(Y,ue){var ee=new K(Y,ue,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return ee},q.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},j.exports.Tokenizer=q,j.exports.TOKEN=Z},function(j){function k(M){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=M}k.prototype.restart=function(){this.__position=0},k.prototype.isEmpty=function(){return this.__tokens_length===0},k.prototype.hasNext=function(){return this.__position<this.__tokens_length},k.prototype.next=function(){var M=null;return this.hasNext()&&(M=this.__tokens[this.__position],this.__position+=1),M},k.prototype.peek=function(M){var O=null;return M=M||0,M+=this.__position,M>=0&&M<this.__tokens_length&&(O=this.__tokens[M]),O},k.prototype.add=function(M){this.__parent_token&&(M.parent=this.__parent_token),this.__tokens.push(M),this.__tokens_length+=1},j.exports.TokenStream=k},function(j,k,M){var O=M(12).Pattern;function K(se,ae){O.call(this,se,ae),ae?this._line_regexp=this._input.get_regexp(ae._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}K.prototype=new O,K.prototype.__set_whitespace_patterns=function(se,ae){se+="\\t ",ae+="\\n\\r",this._match_pattern=this._input.get_regexp("["+se+ae+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+ae+"]")},K.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var se=this._input.read(this._match_pattern);if(se===" ")this.whitespace_before_token=" ";else if(se){var ae=this.__split(this._newline_regexp,se);this.newline_count=ae.length-1,this.whitespace_before_token=ae[this.newline_count]}return se},K.prototype.matching=function(se,ae){var Z=this._create();return Z.__set_whitespace_patterns(se,ae),Z._update(),Z},K.prototype._create=function(){return new K(this._input,this)},K.prototype.__split=function(se,ae){se.lastIndex=0;for(var Z=0,q=[],Y=se.exec(ae);Y;)q.push(ae.substring(Z,Y.index)),Z=Y.index+Y[0].length,Y=se.exec(ae);return Z<ae.length?q.push(ae.substring(Z,ae.length)):q.push(""),q},j.exports.WhitespacePattern=K},function(j){function k(M,O){this._input=M,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,O&&(this._starting_pattern=this._input.get_regexp(O._starting_pattern,!0),this._match_pattern=this._input.get_regexp(O._match_pattern,!0),this._until_pattern=this._input.get_regexp(O._until_pattern),this._until_after=O._until_after)}k.prototype.read=function(){var M=this._input.read(this._starting_pattern);return(!this._starting_pattern||M)&&(M+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),M},k.prototype.read_match=function(){return this._input.match(this._match_pattern)},k.prototype.until_after=function(M){var O=this._create();return O._until_after=!0,O._until_pattern=this._input.get_regexp(M),O._update(),O},k.prototype.until=function(M){var O=this._create();return O._until_after=!1,O._until_pattern=this._input.get_regexp(M),O._update(),O},k.prototype.starting_with=function(M){var O=this._create();return O._starting_pattern=this._input.get_regexp(M,!0),O._update(),O},k.prototype.matching=function(M){var O=this._create();return O._match_pattern=this._input.get_regexp(M,!0),O._update(),O},k.prototype._create=function(){return new k(this._input,this)},k.prototype._update=function(){},j.exports.Pattern=k},function(j){function k(M,O){M=typeof M=="string"?M:M.source,O=typeof O=="string"?O:O.source,this.__directives_block_pattern=new RegExp(M+/ beautify( \w+[:]\w+)+ /.source+O,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(M+/\sbeautify\signore:end\s/.source+O,"g")}k.prototype.get_directives=function(M){if(!M.match(this.__directives_block_pattern))return null;var O={};this.__directive_pattern.lastIndex=0;for(var K=this.__directive_pattern.exec(M);K;)O[K[1]]=K[2],K=this.__directive_pattern.exec(M);return O},k.prototype.readIgnored=function(M){return M.readUntilAfter(this.__directives_end_ignore_pattern)},j.exports.Directives=k},function(j,k,M){var O=M(12).Pattern,K={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function se(ae,Z){O.call(this,ae,Z),this.__template_pattern=null,this._disabled=Object.assign({},K),this._excluded=Object.assign({},K),Z&&(this.__template_pattern=this._input.get_regexp(Z.__template_pattern),this._excluded=Object.assign(this._excluded,Z._excluded),this._disabled=Object.assign(this._disabled,Z._disabled));var q=new O(ae);this.__patterns={handlebars_comment:q.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:q.starting_with(/{{{/).until_after(/}}}/),handlebars:q.starting_with(/{{/).until_after(/}}/),php:q.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:q.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:q.starting_with(/{%/).until_after(/%}/),django_value:q.starting_with(/{{/).until_after(/}}/),django_comment:q.starting_with(/{#/).until_after(/#}/),smarty:q.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:q.starting_with(/{\*/).until_after(/\*}/),smarty_literal:q.starting_with(/{literal}/).until_after(/{\/literal}/)}}se.prototype=new O,se.prototype._create=function(){return new se(this._input,this)},se.prototype._update=function(){this.__set_templated_pattern()},se.prototype.disable=function(ae){var Z=this._create();return Z._disabled[ae]=!0,Z._update(),Z},se.prototype.read_options=function(ae){var Z=this._create();for(var q in K)Z._disabled[q]=ae.templating.indexOf(q)===-1;return Z._update(),Z},se.prototype.exclude=function(ae){var Z=this._create();return Z._excluded[ae]=!0,Z._update(),Z},se.prototype.read=function(){var ae="";this._match_pattern?ae=this._input.read(this._starting_pattern):ae=this._input.read(this._starting_pattern,this.__template_pattern);for(var Z=this._read_template();Z;)this._match_pattern?Z+=this._input.read(this._match_pattern):Z+=this._input.readUntil(this.__template_pattern),ae+=Z,Z=this._read_template();return this._until_after&&(ae+=this._input.readUntilAfter(this._until_pattern)),ae},se.prototype.__set_templated_pattern=function(){var ae=[];this._disabled.php||ae.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||ae.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||ae.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||ae.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(ae.push(this.__patterns.django._starting_pattern.source),ae.push(this.__patterns.django_value._starting_pattern.source),ae.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||ae.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&ae.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+ae.join("|")+")")},se.prototype._read_template=function(){var ae="",Z=this._input.peek();if(Z==="<"){var q=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&q==="?"&&(ae=ae||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&q==="%"&&(ae=ae||this.__patterns.erb.read())}else Z==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(ae=ae||this.__patterns.handlebars_comment.read(),ae=ae||this.__patterns.handlebars_unescaped.read(),ae=ae||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(ae=ae||this.__patterns.django_value.read()),this._excluded.django||(ae=ae||this.__patterns.django_comment.read(),ae=ae||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(ae=ae||this.__patterns.smarty_comment.read(),ae=ae||this.__patterns.smarty_literal.read(),ae=ae||this.__patterns.smarty.read()));return ae},j.exports.TemplatablePattern=se},,,,function(j,k,M){var O=M(19).Beautifier,K=M(20).Options;function se(ae,Z,q,Y){var ue=new O(ae,Z,q,Y);return ue.beautify()}j.exports=se,j.exports.defaultOptions=function(){return new K}},function(j,k,M){var O=M(20).Options,K=M(2).Output,se=M(21).Tokenizer,ae=M(21).TOKEN,Z=/\r\n|[\r\n]/,q=/\r\n|[\r\n]/g,Y=function(de,re){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=de.max_preserve_newlines,this.preserve_newlines=de.preserve_newlines,this._output=new K(de,re)};Y.prototype.current_line_has_match=function(de){return this._output.current_line.has_match(de)},Y.prototype.set_space_before_token=function(de,re){this._output.space_before_token=de,this._output.non_breaking_space=re},Y.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},Y.prototype.add_raw_token=function(de){this._output.add_raw_token(de)},Y.prototype.print_preserved_newlines=function(de){var re=0;de.type!==ae.TEXT&&de.previous.type!==ae.TEXT&&(re=de.newlines?1:0),this.preserve_newlines&&(re=de.newlines<this.max_preserve_newlines+1?de.newlines:this.max_preserve_newlines+1);for(var ce=0;ce<re;ce++)this.print_newline(ce>0);return re!==0},Y.prototype.traverse_whitespace=function(de){return de.whitespace_before||de.newlines?(this.print_preserved_newlines(de)||(this._output.space_before_token=!0),!0):!1},Y.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},Y.prototype.print_newline=function(de){this._output.add_new_line(de)},Y.prototype.print_token=function(de){de.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(de.text))},Y.prototype.indent=function(){this.indent_level++},Y.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},Y.prototype.get_full_indent=function(de){return de=this.indent_level+(de||0),de<1?"":this._output.get_indent_string(de)};var ue=function(de){for(var re=null,ce=de.next;ce.type!==ae.EOF&&de.closed!==ce;){if(ce.type===ae.ATTRIBUTE&&ce.text==="type"){ce.next&&ce.next.type===ae.EQUALS&&ce.next.next&&ce.next.next.type===ae.VALUE&&(re=ce.next.next.text);break}ce=ce.next}return re},ee=function(de,re){var ce=null,he=null;return re.closed?(de==="script"?ce="text/javascript":de==="style"&&(ce="text/css"),ce=ue(re)||ce,ce.search("text/css")>-1?he="css":ce.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?he="javascript":ce.search(/(text|application|dojo)\/(x-)?(html)/)>-1?he="html":ce.search(/test\/null/)>-1&&(he="null"),he):null};function oe(de,re){return re.indexOf(de)!==-1}function De(de,re,ce){this.parent=de||null,this.tag=re?re.tag_name:"",this.indent_level=ce||0,this.parser_token=re||null}function ve(de){this._printer=de,this._current_frame=null}ve.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ve.prototype.record_tag=function(de){var re=new De(this._current_frame,de,this._printer.indent_level);this._current_frame=re},ve.prototype._try_pop_frame=function(de){var re=null;return de&&(re=de.parser_token,this._printer.indent_level=de.indent_level,this._current_frame=de.parent),re},ve.prototype._get_frame=function(de,re){for(var ce=this._current_frame;ce&&de.indexOf(ce.tag)===-1;){if(re&&re.indexOf(ce.tag)!==-1){ce=null;break}ce=ce.parent}return ce},ve.prototype.try_pop=function(de,re){var ce=this._get_frame([de],re);return this._try_pop_frame(ce)},ve.prototype.indent_to_tag=function(de){var re=this._get_frame(de);re&&(this._printer.indent_level=re.indent_level)};function Ye(de,re,ce,he){this._source_text=de||"",re=re||{},this._js_beautify=ce,this._css_beautify=he,this._tag_stack=null;var Re=new O(re,"html");this._options=Re,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}Ye.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var de=this._source_text,re=this._options.eol;this._options.eol==="auto"&&(re=`
`,de&&Z.test(de)&&(re=de.match(Z)[0])),de=de.replace(q,`
`);var ce=de.match(/^[\t ]*/)[0],he={text:"",type:""},Re=new We(this._options),we=new Y(this._options,ce),D=new se(de,this._options).tokenize();this._tag_stack=new ve(we);for(var L=null,ie=D.next();ie.type!==ae.EOF;)ie.type===ae.TAG_OPEN||ie.type===ae.COMMENT?(L=this._handle_tag_open(we,ie,Re,he,D),Re=L):ie.type===ae.ATTRIBUTE||ie.type===ae.EQUALS||ie.type===ae.VALUE||ie.type===ae.TEXT&&!Re.tag_complete?L=this._handle_inside_tag(we,ie,Re,he):ie.type===ae.TAG_CLOSE?L=this._handle_tag_close(we,ie,Re):ie.type===ae.TEXT?L=this._handle_text(we,ie,Re):ie.type===ae.CONTROL_FLOW_OPEN?L=this._handle_control_flow_open(we,ie):ie.type===ae.CONTROL_FLOW_CLOSE?L=this._handle_control_flow_close(we,ie):we.add_raw_token(ie),he=L,ie=D.next();var xe=we._output.get_code(re);return xe},Ye.prototype._handle_control_flow_open=function(de,re){var ce={text:re.text,type:re.type};return de.set_space_before_token(re.newlines||re.whitespace_before!=="",!0),re.newlines?de.print_preserved_newlines(re):de.set_space_before_token(re.newlines||re.whitespace_before!=="",!0),de.print_token(re),de.indent(),ce},Ye.prototype._handle_control_flow_close=function(de,re){var ce={text:re.text,type:re.type};return de.deindent(),re.newlines?de.print_preserved_newlines(re):de.set_space_before_token(re.newlines||re.whitespace_before!=="",!0),de.print_token(re),ce},Ye.prototype._handle_tag_close=function(de,re,ce){var he={text:re.text,type:re.type};return de.alignment_size=0,ce.tag_complete=!0,de.set_space_before_token(re.newlines||re.whitespace_before!=="",!0),ce.is_unformatted?de.add_raw_token(re):(ce.tag_start_char==="<"&&(de.set_space_before_token(re.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&ce.has_wrapped_attrs&&de.print_newline(!1)),de.print_token(re)),ce.indent_content&&!(ce.is_unformatted||ce.is_content_unformatted)&&(de.indent(),ce.indent_content=!1),!ce.is_inline_element&&!(ce.is_unformatted||ce.is_content_unformatted)&&de.set_wrap_point(),he},Ye.prototype._handle_inside_tag=function(de,re,ce,he){var Re=ce.has_wrapped_attrs,we={text:re.text,type:re.type};return de.set_space_before_token(re.newlines||re.whitespace_before!=="",!0),ce.is_unformatted?de.add_raw_token(re):ce.tag_start_char==="{"&&re.type===ae.TEXT?de.print_preserved_newlines(re)?(re.newlines=0,de.add_raw_token(re)):de.print_token(re):(re.type===ae.ATTRIBUTE?de.set_space_before_token(!0):(re.type===ae.EQUALS||re.type===ae.VALUE&&re.previous.type===ae.EQUALS)&&de.set_space_before_token(!1),re.type===ae.ATTRIBUTE&&ce.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(de.traverse_whitespace(re),Re=Re||re.newlines!==0),this._is_wrap_attributes_force&&ce.attr_count>=this._options.wrap_attributes_min_attrs&&(he.type!==ae.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(de.print_newline(!1),Re=!0)),de.print_token(re),Re=Re||de.previous_token_wrapped(),ce.has_wrapped_attrs=Re),we},Ye.prototype._handle_text=function(de,re,ce){var he={text:re.text,type:"TK_CONTENT"};return ce.custom_beautifier_name?this._print_custom_beatifier_text(de,re,ce):ce.is_unformatted||ce.is_content_unformatted?de.add_raw_token(re):(de.traverse_whitespace(re),de.print_token(re)),he},Ye.prototype._print_custom_beatifier_text=function(de,re,ce){var he=this;if(re.text!==""){var Re=re.text,we,D=1,L="",ie="";ce.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?we=this._js_beautify:ce.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?we=this._css_beautify:ce.custom_beautifier_name==="html"&&(we=function(ar,jt){var Ot=new Ye(ar,jt,he._js_beautify,he._css_beautify);return Ot.beautify()}),this._options.indent_scripts==="keep"?D=0:this._options.indent_scripts==="separate"&&(D=-de.indent_level);var xe=de.get_full_indent(D);if(Re=Re.replace(/\n[ \t]*$/,""),ce.custom_beautifier_name!=="html"&&Re[0]==="<"&&Re.match(/^(<!--|<!\[CDATA\[)/)){var at=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(Re);if(!at){de.add_raw_token(re);return}L=xe+at[1]+`
`,Re=at[4],at[5]&&(ie=xe+at[5]),Re=Re.replace(/\n[ \t]*$/,""),(at[2]||at[3].indexOf(`
`)!==-1)&&(at=at[3].match(/[ \t]+$/),at&&(re.whitespace_before=at[0]))}if(Re)if(we){var ot=function(){this.eol=`
`};ot.prototype=this._options.raw_options;var At=new ot;Re=we(xe+Re,At)}else{var Xe=re.whitespace_before;Xe&&(Re=Re.replace(new RegExp(`
(`+Xe+")?","g"),`
`)),Re=xe+Re.replace(/\n/g,`
`+xe)}L&&(Re?Re=L+Re+`
`+ie:Re=L+ie),de.print_newline(!1),Re&&(re.text=Re,re.whitespace_before="",re.newlines=0,de.add_raw_token(re),de.print_newline(!0))}},Ye.prototype._handle_tag_open=function(de,re,ce,he,Re){var we=this._get_tag_open_token(re);if((ce.is_unformatted||ce.is_content_unformatted)&&!ce.is_empty_element&&re.type===ae.TAG_OPEN&&!we.is_start_tag?(de.add_raw_token(re),we.start_tag_token=this._tag_stack.try_pop(we.tag_name)):(de.traverse_whitespace(re),this._set_tag_position(de,re,we,ce,he),we.is_inline_element||de.set_wrap_point(),de.print_token(re)),we.is_start_tag&&this._is_wrap_attributes_force){var D=0,L;do L=Re.peek(D),L.type===ae.ATTRIBUTE&&(we.attr_count+=1),D+=1;while(L.type!==ae.EOF&&L.type!==ae.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(we.alignment_size=re.text.length+1),!we.tag_complete&&!we.is_unformatted&&(de.alignment_size=we.alignment_size),we};var We=function(de,re,ce){if(this.parent=re||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!ce)this.tag_complete=!0;else{var he;this.tag_start_char=ce.text[0],this.text=ce.text,this.tag_start_char==="<"?(he=ce.text.match(/^<([^\s>]*)/),this.tag_check=he?he[1]:""):(he=ce.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=he?he[1]:"",(ce.text.startsWith("{{#>")||ce.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&ce.next!==null?this.tag_check=ce.next.text.split(" ")[0]:this.tag_check=ce.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),ce.type===ae.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||ce.closed&&ce.closed.text==="/>";var Re=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(Re=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!de.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(Re)))}};Ye.prototype._get_tag_open_token=function(de){var re=new We(this._options,this._tag_stack.get_parser_token(),de);return re.alignment_size=this._options.wrap_attributes_indent_size,re.is_end_tag=re.is_end_tag||oe(re.tag_check,this._options.void_elements),re.is_empty_element=re.tag_complete||re.is_start_tag&&re.is_end_tag,re.is_unformatted=!re.tag_complete&&oe(re.tag_check,this._options.unformatted),re.is_content_unformatted=!re.is_empty_element&&oe(re.tag_check,this._options.content_unformatted),re.is_inline_element=oe(re.tag_name,this._options.inline)||this._options.inline_custom_elements&&re.tag_name.includes("-")||re.tag_start_char==="{",re},Ye.prototype._set_tag_position=function(de,re,ce,he,Re){if(ce.is_empty_element||(ce.is_end_tag?ce.start_tag_token=this._tag_stack.try_pop(ce.tag_name):(this._do_optional_end_element(ce)&&(ce.is_inline_element||de.print_newline(!1)),this._tag_stack.record_tag(ce),(ce.tag_name==="script"||ce.tag_name==="style")&&!(ce.is_unformatted||ce.is_content_unformatted)&&(ce.custom_beautifier_name=ee(ce.tag_check,re)))),oe(ce.tag_check,this._options.extra_liners)&&(de.print_newline(!1),de._output.just_added_blankline()||de.print_newline(!0)),ce.is_empty_element){if(ce.tag_start_char==="{"&&ce.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),ce.indent_content=!0;var we=de.current_line_has_match(/{{#if/);we||de.print_newline(!1)}ce.tag_name==="!--"&&Re.type===ae.TAG_CLOSE&&he.is_end_tag&&ce.text.indexOf(`
`)===-1||(ce.is_inline_element||ce.is_unformatted||de.print_newline(!1),this._calcluate_parent_multiline(de,ce))}else if(ce.is_end_tag){var D=!1;D=ce.start_tag_token&&ce.start_tag_token.multiline_content,D=D||!ce.is_inline_element&&!(he.is_inline_element||he.is_unformatted)&&!(Re.type===ae.TAG_CLOSE&&ce.start_tag_token===he)&&Re.type!=="TK_CONTENT",(ce.is_content_unformatted||ce.is_unformatted)&&(D=!1),D&&de.print_newline(!1)}else ce.indent_content=!ce.custom_beautifier_name,ce.tag_start_char==="<"&&(ce.tag_name==="html"?ce.indent_content=this._options.indent_inner_html:ce.tag_name==="head"?ce.indent_content=this._options.indent_head_inner_html:ce.tag_name==="body"&&(ce.indent_content=this._options.indent_body_inner_html)),!(ce.is_inline_element||ce.is_unformatted)&&(Re.type!=="TK_CONTENT"||ce.is_content_unformatted)&&de.print_newline(!1),this._calcluate_parent_multiline(de,ce)},Ye.prototype._calcluate_parent_multiline=function(de,re){re.parent&&de._output.just_added_newline()&&!((re.is_inline_element||re.is_unformatted)&&re.parent.is_inline_element)&&(re.parent.multiline_content=!0)};var ut=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],pt=["a","audio","del","ins","map","noscript","video"];Ye.prototype._do_optional_end_element=function(de){var re=null;if(!(de.is_empty_element||!de.is_start_tag||!de.parent)){if(de.tag_name==="body")re=re||this._tag_stack.try_pop("head");else if(de.tag_name==="li")re=re||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(de.tag_name==="dd"||de.tag_name==="dt")re=re||this._tag_stack.try_pop("dt",["dl"]),re=re||this._tag_stack.try_pop("dd",["dl"]);else if(de.parent.tag_name==="p"&&ut.indexOf(de.tag_name)!==-1){var ce=de.parent.parent;(!ce||pt.indexOf(ce.tag_name)===-1)&&(re=re||this._tag_stack.try_pop("p"))}else de.tag_name==="rp"||de.tag_name==="rt"?(re=re||this._tag_stack.try_pop("rt",["ruby","rtc"]),re=re||this._tag_stack.try_pop("rp",["ruby","rtc"])):de.tag_name==="optgroup"?re=re||this._tag_stack.try_pop("optgroup",["select"]):de.tag_name==="option"?re=re||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):de.tag_name==="colgroup"?re=re||this._tag_stack.try_pop("caption",["table"]):de.tag_name==="thead"?(re=re||this._tag_stack.try_pop("caption",["table"]),re=re||this._tag_stack.try_pop("colgroup",["table"])):de.tag_name==="tbody"||de.tag_name==="tfoot"?(re=re||this._tag_stack.try_pop("caption",["table"]),re=re||this._tag_stack.try_pop("colgroup",["table"]),re=re||this._tag_stack.try_pop("thead",["table"]),re=re||this._tag_stack.try_pop("tbody",["table"])):de.tag_name==="tr"?(re=re||this._tag_stack.try_pop("caption",["table"]),re=re||this._tag_stack.try_pop("colgroup",["table"]),re=re||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(de.tag_name==="th"||de.tag_name==="td")&&(re=re||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),re=re||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return de.parent=this._tag_stack.get_parser_token(),re}},j.exports.Beautifier=Ye},function(j,k,M){var O=M(6).Options;function K(se){O.call(this,se,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}K.prototype=new O,j.exports.Options=K},function(j,k,M){var O=M(9).Tokenizer,K=M(9).TOKEN,se=M(13).Directives,ae=M(14).TemplatablePattern,Z=M(12).Pattern,q={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:K.START,RAW:K.RAW,EOF:K.EOF},Y=new se(/<\!--/,/-->/),ue=function(ee,oe){O.call(this,ee,oe),this._current_tag_name="";var De=new ae(this._input).read_options(this._options),ve=new Z(this._input);if(this.__patterns={word:De.until(/[\n\r\t <]/),word_control_flow_close_excluded:De.until(/[\n\r\t <}]/),single_quote:De.until_after(/'/),double_quote:De.until_after(/"/),attribute:De.until(/[\n\r\t =>]|\/>/),element_name:De.until(/[\n\r\t >\/]/),angular_control_flow_start:ve.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ve.starting_with(/{{!--/).until_after(/--}}/),handlebars:ve.starting_with(/{{/).until_after(/}}/),handlebars_open:ve.until(/[\n\r\t }]/),handlebars_raw_close:ve.until(/}}/),comment:ve.starting_with(/<!--/).until_after(/-->/),cdata:ve.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ve.starting_with(/<!\[/).until_after(/]>/),processing:ve.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var Ye=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ve.matching(Ye).until_after(Ye)}};ue.prototype=new O,ue.prototype._is_comment=function(ee){return!1},ue.prototype._is_opening=function(ee){return ee.type===q.TAG_OPEN||ee.type===q.CONTROL_FLOW_OPEN},ue.prototype._is_closing=function(ee,oe){return ee.type===q.TAG_CLOSE&&oe&&((ee.text===">"||ee.text==="/>")&&oe.text[0]==="<"||ee.text==="}}"&&oe.text[0]==="{"&&oe.text[1]==="{")||ee.type===q.CONTROL_FLOW_CLOSE&&ee.text==="}"&&oe.text.endsWith("{")},ue.prototype._reset=function(){this._current_tag_name=""},ue.prototype._get_next_token=function(ee,oe){var De=null;this._readWhitespace();var ve=this._input.peek();return ve===null?this._create_token(q.EOF,""):(De=De||this._read_open_handlebars(ve,oe),De=De||this._read_attribute(ve,ee,oe),De=De||this._read_close(ve,oe),De=De||this._read_script_and_style(ve,ee),De=De||this._read_control_flows(ve,oe),De=De||this._read_raw_content(ve,ee,oe),De=De||this._read_content_word(ve,oe),De=De||this._read_comment_or_cdata(ve),De=De||this._read_processing(ve),De=De||this._read_open(ve,oe),De=De||this._create_token(q.UNKNOWN,this._input.next()),De)},ue.prototype._read_comment_or_cdata=function(ee){var oe=null,De=null,ve=null;if(ee==="<"){var Ye=this._input.peek(1);Ye==="!"&&(De=this.__patterns.comment.read(),De?(ve=Y.get_directives(De),ve&&ve.ignore==="start"&&(De+=Y.readIgnored(this._input))):De=this.__patterns.cdata.read()),De&&(oe=this._create_token(q.COMMENT,De),oe.directives=ve)}return oe},ue.prototype._read_processing=function(ee){var oe=null,De=null,ve=null;if(ee==="<"){var Ye=this._input.peek(1);(Ye==="!"||Ye==="?")&&(De=this.__patterns.conditional_comment.read(),De=De||this.__patterns.processing.read()),De&&(oe=this._create_token(q.COMMENT,De),oe.directives=ve)}return oe},ue.prototype._read_open=function(ee,oe){var De=null,ve=null;return(!oe||oe.type===q.CONTROL_FLOW_OPEN)&&ee==="<"&&(De=this._input.next(),this._input.peek()==="/"&&(De+=this._input.next()),De+=this.__patterns.element_name.read(),ve=this._create_token(q.TAG_OPEN,De)),ve},ue.prototype._read_open_handlebars=function(ee,oe){var De=null,ve=null;return(!oe||oe.type===q.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&ee==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(De=this.__patterns.handlebars_comment.read(),De=De||this.__patterns.handlebars.read(),ve=this._create_token(q.COMMENT,De)):(De=this.__patterns.handlebars_open.read(),ve=this._create_token(q.TAG_OPEN,De))),ve},ue.prototype._read_control_flows=function(ee,oe){var De="",ve=null;if(!this._options.templating.includes("angular"))return ve;if(ee==="@"){if(De=this.__patterns.angular_control_flow_start.read(),De==="")return ve;for(var Ye=De.endsWith("(")?1:0,We=0;!(De.endsWith("{")&&Ye===We);){var ut=this._input.next();if(ut===null)break;ut==="("?Ye++:ut===")"&&We++,De+=ut}ve=this._create_token(q.CONTROL_FLOW_OPEN,De)}else ee==="}"&&oe&&oe.type===q.CONTROL_FLOW_OPEN&&(De=this._input.next(),ve=this._create_token(q.CONTROL_FLOW_CLOSE,De));return ve},ue.prototype._read_close=function(ee,oe){var De=null,ve=null;return oe&&oe.type===q.TAG_OPEN&&(oe.text[0]==="<"&&(ee===">"||ee==="/"&&this._input.peek(1)===">")?(De=this._input.next(),ee==="/"&&(De+=this._input.next()),ve=this._create_token(q.TAG_CLOSE,De)):oe.text[0]==="{"&&ee==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ve=this._create_token(q.TAG_CLOSE,"}}"))),ve},ue.prototype._read_attribute=function(ee,oe,De){var ve=null,Ye="";if(De&&De.text[0]==="<")if(ee==="=")ve=this._create_token(q.EQUALS,this._input.next());else if(ee==='"'||ee==="'"){var We=this._input.next();ee==='"'?We+=this.__patterns.double_quote.read():We+=this.__patterns.single_quote.read(),ve=this._create_token(q.VALUE,We)}else Ye=this.__patterns.attribute.read(),Ye&&(oe.type===q.EQUALS?ve=this._create_token(q.VALUE,Ye):ve=this._create_token(q.ATTRIBUTE,Ye));return ve},ue.prototype._is_content_unformatted=function(ee){return this._options.void_elements.indexOf(ee)===-1&&(this._options.content_unformatted.indexOf(ee)!==-1||this._options.unformatted.indexOf(ee)!==-1)},ue.prototype._read_raw_content=function(ee,oe,De){var ve="";if(De&&De.text[0]==="{")ve=this.__patterns.handlebars_raw_close.read();else if(oe.type===q.TAG_CLOSE&&oe.opened.text[0]==="<"&&oe.text[0]!=="/"){var Ye=oe.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Ye)&&(ve=this._input.readUntil(new RegExp("</"+Ye+"[\\n\\r\\t ]*?>","ig")))}return ve?this._create_token(q.TEXT,ve):null},ue.prototype._read_script_and_style=function(ee,oe){if(oe.type===q.TAG_CLOSE&&oe.opened.text[0]==="<"&&oe.text[0]!=="/"){var De=oe.opened.text.substr(1).toLowerCase();if(De==="script"||De==="style"){var ve=this._read_comment_or_cdata(ee);if(ve)return ve.type=q.TEXT,ve;var Ye=this._input.readUntil(new RegExp("</"+De+"[\\n\\r\\t ]*?>","ig"));if(Ye)return this._create_token(q.TEXT,Ye)}}return null},ue.prototype._read_content_word=function(ee,oe){var De="";return this._options.unformatted_content_delimiter&&ee===this._options.unformatted_content_delimiter[0]&&(De=this.__patterns.unformatted_content_delimiter.read()),De||(De=oe&&oe.type===q.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),De?this._create_token(q.TEXT,De):null},j.exports.Tokenizer=ue,j.exports.TOKEN=q}],$={};function d(j){var k=$[j];if(k!==void 0)return k.exports;var M=$[j]={exports:{}};return Me[j](M,M.exports,d),M.exports}var be=d(18);rt=be})();var Le=rt;if(1)pe=[J,J(58553),J(87804)],Pe=function(Me){var $=J(58553),d=J(87804);return{html_beautify:function(be,j){return Le(be,j,$.js_beautify,d.css_beautify)}}}.apply(Rt,pe),Pe!==void 0&&(Fr.exports=Pe);else var te,E})()},58553:function(Fr,Rt){var J,pe;(function(){var Pe;(function(){"use strict";var Le=[function($,d,be){var j=be(1).Beautifier,k=be(5).Options;function M(O,K){var se=new j(O,K);return se.beautify()}$.exports=M,$.exports.defaultOptions=function(){return new k}},function($,d,be){var j=be(2).Output,k=be(3).Token,M=be(4),O=be(5).Options,K=be(7).Tokenizer,se=be(7).line_starters,ae=be(7).positionable_operators,Z=be(7).TOKEN;function q(L,ie){return ie.indexOf(L)!==-1}function Y(L){return L.replace(/^\s+/g,"")}function ue(L){for(var ie={},xe=0;xe<L.length;xe++)ie[L[xe].replace(/-/g,"_")]=L[xe];return ie}function ee(L,ie){return L&&L.type===Z.RESERVED&&L.text===ie}function oe(L,ie){return L&&L.type===Z.RESERVED&&q(L.text,ie)}var De=["case","return","do","if","throw","else","await","break","continue","async"],ve=["before-newline","after-newline","preserve-newline"],Ye=ue(ve),We=[Ye.before_newline,Ye.preserve_newline],ut={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function pt(L,ie){ie.multiline_frame||ie.mode===ut.ForInitializer||ie.mode===ut.Conditional||L.remove_indent(ie.start_line_index)}function de(L){L=L.replace(M.allLineBreaks,`
`);for(var ie=[],xe=L.indexOf(`
`);xe!==-1;)ie.push(L.substring(0,xe)),L=L.substring(xe+1),xe=L.indexOf(`
`);return L.length&&ie.push(L),ie}function re(L){return L===ut.ArrayLiteral}function ce(L){return q(L,[ut.Expression,ut.ForInitializer,ut.Conditional])}function he(L,ie){for(var xe=0;xe<L.length;xe++){var at=L[xe].trim();if(at.charAt(0)!==ie)return!1}return!0}function Re(L,ie){for(var xe=0,at=L.length,ot;xe<at;xe++)if(ot=L[xe],ot&&ot.indexOf(ie)!==0)return!1;return!0}function we(L,ie){ie=ie||{},this._source_text=L||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new O(ie)}we.prototype.create_flags=function(L,ie){var xe=0;L&&(xe=L.indentation_level,!this._output.just_added_newline()&&L.line_indent_level>xe&&(xe=L.line_indent_level));var at={mode:ie,parent:L,last_token:L?L.last_token:new k(Z.START_BLOCK,""),last_word:L?L.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:xe,alignment:0,line_indent_level:L?L.line_indent_level:xe,start_line_index:this._output.get_line_number(),ternary_depth:0};return at},we.prototype._reset=function(L){var ie=L.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new j(this._options,ie),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(ut.BlockStatement);var xe=new K(L,this._options);return this._tokens=xe.tokenize(),L},we.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L,ie=this._reset(this._source_text),xe=this._options.eol;this._options.eol==="auto"&&(xe=`
`,ie&&M.lineBreak.test(ie||"")&&(xe=ie.match(M.lineBreak)[0]));for(var at=this._tokens.next();at;)this.handle_token(at),this._last_last_text=this._flags.last_token.text,this._flags.last_token=at,at=this._tokens.next();return L=this._output.get_code(xe),L},we.prototype.handle_token=function(L,ie){L.type===Z.START_EXPR?this.handle_start_expr(L):L.type===Z.END_EXPR?this.handle_end_expr(L):L.type===Z.START_BLOCK?this.handle_start_block(L):L.type===Z.END_BLOCK?this.handle_end_block(L):L.type===Z.WORD?this.handle_word(L):L.type===Z.RESERVED?this.handle_word(L):L.type===Z.SEMICOLON?this.handle_semicolon(L):L.type===Z.STRING?this.handle_string(L):L.type===Z.EQUALS?this.handle_equals(L):L.type===Z.OPERATOR?this.handle_operator(L):L.type===Z.COMMA?this.handle_comma(L):L.type===Z.BLOCK_COMMENT?this.handle_block_comment(L,ie):L.type===Z.COMMENT?this.handle_comment(L,ie):L.type===Z.DOT?this.handle_dot(L):L.type===Z.EOF?this.handle_eof(L):L.type===Z.UNKNOWN?this.handle_unknown(L,ie):this.handle_unknown(L,ie)},we.prototype.handle_whitespace_and_comments=function(L,ie){var xe=L.newlines,at=this._options.keep_array_indentation&&re(this._flags.mode);if(L.comments_before)for(var ot=L.comments_before.next();ot;)this.handle_whitespace_and_comments(ot,ie),this.handle_token(ot,ie),ot=L.comments_before.next();if(at)for(var At=0;At<xe;At+=1)this.print_newline(At>0,ie);else if(this._options.max_preserve_newlines&&xe>this._options.max_preserve_newlines&&(xe=this._options.max_preserve_newlines),this._options.preserve_newlines&&xe>1){this.print_newline(!1,ie);for(var Xe=1;Xe<xe;Xe+=1)this.print_newline(!0,ie)}};var D=["async","break","continue","return","throw","yield"];we.prototype.allow_wrap_or_preserved_newline=function(L,ie){if(ie=ie===void 0?!1:ie,!this._output.just_added_newline()){var xe=this._options.preserve_newlines&&L.newlines||ie,at=q(this._flags.last_token.text,ae)||q(L.text,ae);if(at){var ot=q(this._flags.last_token.text,ae)&&q(this._options.operator_position,We)||q(L.text,ae);xe=xe&&ot}if(xe)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(oe(this._flags.last_token,D))return;this._output.set_wrap_point()}}},we.prototype.print_newline=function(L,ie){if(!ie&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==Z.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var xe=this._tokens.peek();this._flags.mode===ut.Statement&&!(this._flags.if_block&&ee(xe,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(L)&&(this._flags.multiline_frame=!0)},we.prototype.print_token_line_indentation=function(L){this._output.just_added_newline()&&(this._options.keep_array_indentation&&L.newlines&&(L.text==="["||re(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(L.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},we.prototype.print_token=function(L){if(this._output.raw){this._output.add_raw_token(L);return}if(this._options.comma_first&&L.previous&&L.previous.type===Z.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var ie=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(ie),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(L),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(L),this._output.non_breaking_space=!0,this._output.add_token(L.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},we.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},we.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},we.prototype.set_mode=function(L){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,L),this._flags=this.create_flags(this._previous_flags,L),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},we.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===ut.Statement&&pt(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},we.prototype.start_of_object_property=function(){return this._flags.parent.mode===ut.ObjectLiteral&&this._flags.mode===ut.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||oe(this._flags.last_token,["get","set"]))},we.prototype.start_of_statement=function(L){var ie=!1;return ie=ie||oe(this._flags.last_token,["var","let","const"])&&L.type===Z.WORD,ie=ie||ee(this._flags.last_token,"do"),ie=ie||!(this._flags.parent.mode===ut.ObjectLiteral&&this._flags.mode===ut.Statement)&&oe(this._flags.last_token,D)&&!L.newlines,ie=ie||ee(this._flags.last_token,"else")&&!(ee(L,"if")&&!L.comments_before),ie=ie||this._flags.last_token.type===Z.END_EXPR&&(this._previous_flags.mode===ut.ForInitializer||this._previous_flags.mode===ut.Conditional),ie=ie||this._flags.last_token.type===Z.WORD&&this._flags.mode===ut.BlockStatement&&!this._flags.in_case&&!(L.text==="--"||L.text==="++")&&this._last_last_text!=="function"&&L.type!==Z.WORD&&L.type!==Z.RESERVED,ie=ie||this._flags.mode===ut.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||oe(this._flags.last_token,["get","set"])),ie?(this.set_mode(ut.Statement),this.indent(),this.handle_whitespace_and_comments(L,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(L,oe(L,["do","for","if","while"])),!0):!1},we.prototype.handle_start_expr=function(L){this.start_of_statement(L)||this.handle_whitespace_and_comments(L);var ie=ut.Expression;if(L.text==="["){if(this._flags.last_token.type===Z.WORD||this._flags.last_token.text===")"){oe(this._flags.last_token,se)&&(this._output.space_before_token=!0),this.print_token(L),this.set_mode(ie),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}ie=ut.ArrayLiteral,re(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),q(this._flags.last_token.type,[Z.START_EXPR,Z.END_EXPR,Z.WORD,Z.OPERATOR,Z.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Z.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,ie=ut.ForInitializer):q(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,ie=ut.Conditional):q(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&L.whitespace_before===""?this._output.space_before_token=!1:(q(this._flags.last_token.text,se)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Z.EQUALS||this._flags.last_token.type===Z.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(L);else if(this._flags.last_token.type===Z.WORD){this._output.space_before_token=!1;var xe=this._tokens.peek(-3);if(this._options.space_after_named_function&&xe){var at=this._tokens.peek(-4);oe(xe,["async","function"])||xe.text==="*"&&oe(at,["async","function"])?this._output.space_before_token=!0:this._flags.mode===ut.ObjectLiteral?(xe.text==="{"||xe.text===","||xe.text==="*"&&(at.text==="{"||at.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(L);(this._flags.last_token.type===Z.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(q(this._last_last_text,["function","yield"])||this._flags.mode===ut.ObjectLiteral&&q(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===Z.START_BLOCK?this.print_newline():(this._flags.last_token.type===Z.END_EXPR||this._flags.last_token.type===Z.START_EXPR||this._flags.last_token.type===Z.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===Z.COMMA)&&this.allow_wrap_or_preserved_newline(L,L.newlines),this.print_token(L),this.set_mode(ie),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},we.prototype.handle_end_expr=function(L){for(;this._flags.mode===ut.Statement;)this.restore_mode();this.handle_whitespace_and_comments(L),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(L,L.text==="]"&&re(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===Z.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(L),this.restore_mode(),pt(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===ut.Conditional&&(this._previous_flags.mode=ut.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},we.prototype.handle_start_block=function(L){this.handle_whitespace_and_comments(L);var ie=this._tokens.peek(),xe=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===Z.END_EXPR?(this.set_mode(ut.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(ut.BlockStatement):xe&&(q(xe.text,[":",","])&&q(ie.type,[Z.STRING,Z.WORD,Z.RESERVED])||q(ie.text,["get","set","..."])&&q(xe.type,[Z.WORD,Z.RESERVED]))?q(this._last_last_text,["class","interface"])&&!q(xe.text,[":",","])?this.set_mode(ut.BlockStatement):this.set_mode(ut.ObjectLiteral):this._flags.last_token.type===Z.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(ut.BlockStatement):q(this._flags.last_token.type,[Z.EQUALS,Z.START_EXPR,Z.COMMA,Z.OPERATOR])||oe(this._flags.last_token,["return","throw","import","default"])?this.set_mode(ut.ObjectLiteral):this.set_mode(ut.BlockStatement),this._flags.last_token&&oe(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var at=!ie.comments_before&&ie.text==="}",ot=at&&this._flags.last_word==="function"&&this._flags.last_token.type===Z.END_EXPR;if(this._options.brace_preserve_inline){var At=0,Xe=null;this._flags.inline_frame=!0;do if(At+=1,Xe=this._tokens.peek(At-1),Xe.newlines){this._flags.inline_frame=!1;break}while(Xe.type!==Z.EOF&&!(Xe.type===Z.END_BLOCK&&Xe.opened===L))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&L.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Z.OPERATOR&&(ot||this._flags.last_token.type===Z.EQUALS||oe(this._flags.last_token,De)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(re(this._previous_flags.mode)&&(this._flags.last_token.type===Z.START_EXPR||this._flags.last_token.type===Z.COMMA)&&((this._flags.last_token.type===Z.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Z.COMMA||this._flags.last_token.type===Z.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(L),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Z.OPERATOR&&this._flags.last_token.type!==Z.START_EXPR&&(q(this._flags.last_token.type,[Z.START_BLOCK,Z.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(L),this.indent(),!at&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},we.prototype.handle_end_block=function(L){for(this.handle_whitespace_and_comments(L);this._flags.mode===ut.Statement;)this.restore_mode();var ie=this._flags.last_token.type===Z.START_BLOCK;this._flags.inline_frame&&!ie?this._output.space_before_token=!0:this._options.brace_style==="expand"?ie||this.print_newline():ie||(re(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(L)},we.prototype.handle_word=function(L){if(L.type===Z.RESERVED){if(q(L.text,["set","get"])&&this._flags.mode!==ut.ObjectLiteral)L.type=Z.WORD;else if(L.text==="import"&&q(this._tokens.peek().text,["(","."]))L.type=Z.WORD;else if(q(L.text,["as","from"])&&!this._flags.import_block)L.type=Z.WORD;else if(this._flags.mode===ut.ObjectLiteral){var ie=this._tokens.peek();ie.text===":"&&(L.type=Z.WORD)}}if(this.start_of_statement(L)?oe(this._flags.last_token,["var","let","const"])&&L.type===Z.WORD&&(this._flags.declaration_statement=!0):L.newlines&&!ce(this._flags.mode)&&(this._flags.last_token.type!==Z.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==Z.EQUALS&&(this._options.preserve_newlines||!oe(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(L),this.print_newline()):this.handle_whitespace_and_comments(L),this._flags.do_block&&!this._flags.do_while)if(ee(L,"while")){this._output.space_before_token=!0,this.print_token(L),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&ee(L,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===ut.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&oe(L,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(L),this._flags.in_case=!0;return}if((this._flags.last_token.type===Z.COMMA||this._flags.last_token.type===Z.START_EXPR||this._flags.last_token.type===Z.EQUALS||this._flags.last_token.type===Z.OPERATOR)&&!this.start_of_object_property()&&!(q(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===ut.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(L),ee(L,"function")){(q(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(q(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===Z.OPERATOR))&&!this._output.just_added_blankline()&&!L.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===Z.RESERVED||this._flags.last_token.type===Z.WORD?oe(this._flags.last_token,["get","set","new","export"])||oe(this._flags.last_token,D)?this._output.space_before_token=!0:ee(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Z.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(ce(this._flags.mode)||re(this._flags.mode))||this.print_newline(),this.print_token(L),this._flags.last_word=L.text;return}var xe="NONE";if(this._flags.last_token.type===Z.END_BLOCK?this._previous_flags.inline_frame?xe="SPACE":oe(L,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&L.newlines?xe="NEWLINE":(xe="SPACE",this._output.space_before_token=!0):xe="NEWLINE":this._flags.last_token.type===Z.SEMICOLON&&this._flags.mode===ut.BlockStatement?xe="NEWLINE":this._flags.last_token.type===Z.SEMICOLON&&ce(this._flags.mode)?xe="SPACE":this._flags.last_token.type===Z.STRING?xe="NEWLINE":this._flags.last_token.type===Z.RESERVED||this._flags.last_token.type===Z.WORD||this._flags.last_token.text==="*"&&(q(this._last_last_text,["function","yield"])||this._flags.mode===ut.ObjectLiteral&&q(this._last_last_text,["{",","]))?xe="SPACE":this._flags.last_token.type===Z.START_BLOCK?this._flags.inline_frame?xe="SPACE":xe="NEWLINE":this._flags.last_token.type===Z.END_EXPR&&(this._output.space_before_token=!0,xe="NEWLINE"),oe(L,se)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?xe="SPACE":xe="NEWLINE"),oe(L,["else","catch","finally"]))if((!(this._flags.last_token.type===Z.END_BLOCK&&this._previous_flags.mode===ut.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&L.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var at=this._output.current_line;at.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else xe==="NEWLINE"?oe(this._flags.last_token,De)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&oe(L,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Z.END_EXPR?(this._flags.last_token.type!==Z.START_EXPR||!oe(L,["var","let","const"]))&&this._flags.last_token.text!==":"&&(ee(L,"if")&&ee(L.previous,"else")?this._output.space_before_token=!0:this.print_newline()):oe(L,se)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&re(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():xe==="SPACE"&&(this._output.space_before_token=!0);L.previous&&(L.previous.type===Z.WORD||L.previous.type===Z.RESERVED)&&(this._output.space_before_token=!0),this.print_token(L),this._flags.last_word=L.text,L.type===Z.RESERVED&&(L.text==="do"?this._flags.do_block=!0:L.text==="if"?this._flags.if_block=!0:L.text==="import"?this._flags.import_block=!0:this._flags.import_block&&ee(L,"from")&&(this._flags.import_block=!1))},we.prototype.handle_semicolon=function(L){this.start_of_statement(L)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(L);for(var ie=this._tokens.peek();this._flags.mode===ut.Statement&&!(this._flags.if_block&&ee(ie,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(L)},we.prototype.handle_string=function(L){L.text.startsWith("`")&&L.newlines===0&&L.whitespace_before===""&&(L.previous.text===")"||this._flags.last_token.type===Z.WORD)||(this.start_of_statement(L)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(L),this._flags.last_token.type===Z.RESERVED||this._flags.last_token.type===Z.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Z.COMMA||this._flags.last_token.type===Z.START_EXPR||this._flags.last_token.type===Z.EQUALS||this._flags.last_token.type===Z.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(L):L.text.startsWith("`")&&this._flags.last_token.type===Z.END_EXPR&&(L.previous.text==="]"||L.previous.text===")")&&L.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(L)},we.prototype.handle_equals=function(L){this.start_of_statement(L)||this.handle_whitespace_and_comments(L),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(L),this._output.space_before_token=!0},we.prototype.handle_comma=function(L){this.handle_whitespace_and_comments(L,!0),this.print_token(L),this._output.space_before_token=!0,this._flags.declaration_statement?(ce(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(L)):this._flags.mode===ut.ObjectLiteral||this._flags.mode===ut.Statement&&this._flags.parent.mode===ut.ObjectLiteral?(this._flags.mode===ut.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(L)},we.prototype.handle_operator=function(L){var ie=L.text==="*"&&(oe(this._flags.last_token,["function","yield"])||q(this._flags.last_token.type,[Z.START_BLOCK,Z.COMMA,Z.END_BLOCK,Z.SEMICOLON])),xe=q(L.text,["-","+"])&&(q(this._flags.last_token.type,[Z.START_BLOCK,Z.START_EXPR,Z.EQUALS,Z.OPERATOR])||q(this._flags.last_token.text,se)||this._flags.last_token.text===",");if(!this.start_of_statement(L)){var at=!ie;this.handle_whitespace_and_comments(L,at)}if(L.text==="*"&&this._flags.last_token.type===Z.DOT){this.print_token(L);return}if(L.text==="::"){this.print_token(L);return}if(q(L.text,["-","+"])&&this.start_of_object_property()){this.print_token(L);return}if(this._flags.last_token.type===Z.OPERATOR&&q(this._options.operator_position,We)&&this.allow_wrap_or_preserved_newline(L),L.text===":"&&this._flags.in_case){this.print_token(L),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==Z.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ot=!0,At=!0,Xe=!1;if(L.text===":"?this._flags.ternary_depth===0?ot=!1:(this._flags.ternary_depth-=1,Xe=!0):L.text==="?"&&(this._flags.ternary_depth+=1),!xe&&!ie&&this._options.preserve_newlines&&q(L.text,ae)){var ar=L.text===":",jt=ar&&Xe,Ot=ar&&!Xe;switch(this._options.operator_position){case Ye.before_newline:this._output.space_before_token=!Ot,this.print_token(L),(!ar||jt)&&this.allow_wrap_or_preserved_newline(L),this._output.space_before_token=!0;return;case Ye.after_newline:this._output.space_before_token=!0,!ar||jt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(L):this._output.space_before_token=!1,this.print_token(L),this._output.space_before_token=!0;return;case Ye.preserve_newline:Ot||this.allow_wrap_or_preserved_newline(L),ot=!(this._output.just_added_newline()||Ot),this._output.space_before_token=ot,this.print_token(L),this._output.space_before_token=!0;return}}if(ie){this.allow_wrap_or_preserved_newline(L),ot=!1;var kr=this._tokens.peek();At=kr&&q(kr.type,[Z.WORD,Z.RESERVED])}else if(L.text==="...")this.allow_wrap_or_preserved_newline(L),ot=this._flags.last_token.type===Z.START_BLOCK,At=!1;else if(q(L.text,["--","++","!","~"])||xe){if((this._flags.last_token.type===Z.COMMA||this._flags.last_token.type===Z.START_EXPR)&&this.allow_wrap_or_preserved_newline(L),ot=!1,At=!1,L.newlines&&(L.text==="--"||L.text==="++"||L.text==="~")){var $r=oe(this._flags.last_token,De)&&L.newlines;$r&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline($r,!0)}this._flags.last_token.text===";"&&ce(this._flags.mode)&&(ot=!0),this._flags.last_token.type===Z.RESERVED?ot=!0:this._flags.last_token.type===Z.END_EXPR?ot=!(this._flags.last_token.text==="]"&&(L.text==="--"||L.text==="++")):this._flags.last_token.type===Z.OPERATOR&&(ot=q(L.text,["--","-","++","+"])&&q(this._flags.last_token.text,["--","-","++","+"]),q(L.text,["+","-"])&&q(this._flags.last_token.text,["--","++"])&&(At=!0)),(this._flags.mode===ut.BlockStatement&&!this._flags.inline_frame||this._flags.mode===ut.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ot,this.print_token(L),this._output.space_before_token=At},we.prototype.handle_block_comment=function(L,ie){if(this._output.raw){this._output.add_raw_token(L),L.directives&&L.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(L.directives){this.print_newline(!1,ie),this.print_token(L),L.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!M.newline.test(L.text)&&!L.newlines){this._output.space_before_token=!0,this.print_token(L),this._output.space_before_token=!0;return}else this.print_block_commment(L,ie)},we.prototype.print_block_commment=function(L,ie){var xe=de(L.text),at,ot=!1,At=!1,Xe=L.whitespace_before,ar=Xe.length;if(this.print_newline(!1,ie),this.print_token_line_indentation(L),this._output.add_token(xe[0]),this.print_newline(!1,ie),xe.length>1){for(xe=xe.slice(1),ot=he(xe,"*"),At=Re(xe,Xe),ot&&(this._flags.alignment=1),at=0;at<xe.length;at++)ot?(this.print_token_line_indentation(L),this._output.add_token(Y(xe[at]))):At&&xe[at]?(this.print_token_line_indentation(L),this._output.add_token(xe[at].substring(ar))):(this._output.current_line.set_indent(-1),this._output.add_token(xe[at])),this.print_newline(!1,ie);this._flags.alignment=0}},we.prototype.handle_comment=function(L,ie){L.newlines?this.print_newline(!1,ie):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(L),this.print_newline(!1,ie)},we.prototype.handle_dot=function(L){this.start_of_statement(L)||this.handle_whitespace_and_comments(L,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),oe(this._flags.last_token,De)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(L,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(L)},we.prototype.handle_unknown=function(L,ie){this.print_token(L),L.text[L.text.length-1]===`
`&&this.print_newline(!1,ie)},we.prototype.handle_eof=function(L){for(;this._flags.mode===ut.Statement;)this.restore_mode();this.handle_whitespace_and_comments(L)},$.exports.Beautifier=we},function($){function d(k){this.__parent=k,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}d.prototype.clone_empty=function(){var k=new d(this.__parent);return k.set_indent(this.__indent_count,this.__alignment_count),k},d.prototype.item=function(k){return k<0?this.__items[this.__items.length+k]:this.__items[k]},d.prototype.has_match=function(k){for(var M=this.__items.length-1;M>=0;M--)if(this.__items[M].match(k))return!0;return!1},d.prototype.set_indent=function(k,M){this.is_empty()&&(this.__indent_count=k||0,this.__alignment_count=M||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},d.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var k=this.__parent.current_line;return k.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),k.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),k.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,k.__items[0]===" "&&(k.__items.splice(0,1),k.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(k){this.__items.push(k);var M=k.lastIndexOf(`
`);M!==-1?this.__character_count=k.length-M:this.__character_count+=k.length},d.prototype.pop=function(){var k=null;return this.is_empty()||(k=this.__items.pop(),this.__character_count-=k.length),k},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var k="";return this.is_empty()?this.__parent.indent_empty_lines&&(k=this.__parent.get_indent_string(this.__indent_count)):(k=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),k+=this.__items.join("")),k};function be(k,M){this.__cache=[""],this.__indent_size=k.indent_size,this.__indent_string=k.indent_char,k.indent_with_tabs||(this.__indent_string=new Array(k.indent_size+1).join(k.indent_char)),M=M||"",k.indent_level>0&&(M=new Array(k.indent_level+1).join(this.__indent_string)),this.__base_string=M,this.__base_string_length=M.length}be.prototype.get_indent_size=function(k,M){var O=this.__base_string_length;return M=M||0,k<0&&(O=0),O+=k*this.__indent_size,O+=M,O},be.prototype.get_indent_string=function(k,M){var O=this.__base_string;return M=M||0,k<0&&(k=0,O=""),M+=k*this.__indent_size,this.__ensure_cache(M),O+=this.__cache[M],O},be.prototype.__ensure_cache=function(k){for(;k>=this.__cache.length;)this.__add_column()},be.prototype.__add_column=function(){var k=this.__cache.length,M=0,O="";this.__indent_size&&k>=this.__indent_size&&(M=Math.floor(k/this.__indent_size),k-=M*this.__indent_size,O=new Array(M+1).join(this.__indent_string)),k&&(O+=new Array(k+1).join(" ")),this.__cache.push(O)};function j(k,M){this.__indent_cache=new be(k,M),this.raw=!1,this._end_with_newline=k.end_with_newline,this.indent_size=k.indent_size,this.wrap_line_length=k.wrap_line_length,this.indent_empty_lines=k.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}j.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},j.prototype.get_line_number=function(){return this.__lines.length},j.prototype.get_indent_string=function(k,M){return this.__indent_cache.get_indent_string(k,M)},j.prototype.get_indent_size=function(k,M){return this.__indent_cache.get_indent_size(k,M)},j.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},j.prototype.add_new_line=function(k){return this.is_empty()||!k&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},j.prototype.get_code=function(k){this.trim(!0);var M=this.current_line.pop();M&&(M[M.length-1]===`
`&&(M=M.replace(/\n+$/g,"")),this.current_line.push(M)),this._end_with_newline&&this.__add_outputline();var O=this.__lines.join(`
`);return k!==`
`&&(O=O.replace(/[\n]/g,k)),O},j.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},j.prototype.set_indent=function(k,M){return k=k||0,M=M||0,this.next_line.set_indent(k,M),this.__lines.length>1?(this.current_line.set_indent(k,M),!0):(this.current_line.set_indent(),!1)},j.prototype.add_raw_token=function(k){for(var M=0;M<k.newlines;M++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(k.whitespace_before),this.current_line.push(k.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},j.prototype.add_token=function(k){this.__add_space_before_token(),this.current_line.push(k),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},j.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},j.prototype.remove_indent=function(k){for(var M=this.__lines.length;k<M;)this.__lines[k]._remove_indent(),k++;this.current_line._remove_wrap_indent()},j.prototype.trim=function(k){for(k=k===void 0?!1:k,this.current_line.trim();k&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},j.prototype.just_added_newline=function(){return this.current_line.is_empty()},j.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},j.prototype.ensure_empty_line_above=function(k,M){for(var O=this.__lines.length-2;O>=0;){var K=this.__lines[O];if(K.is_empty())break;if(K.item(0).indexOf(k)!==0&&K.item(-1)!==M){this.__lines.splice(O+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}O--}},$.exports.Output=j},function($){function d(be,j,k,M){this.type=be,this.text=j,this.comments_before=null,this.newlines=k||0,this.whitespace_before=M||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}$.exports.Token=d},function($,d){var be="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",j="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",k="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",M="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",O="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",K="(?:"+O+"|["+be+k+"])",se="(?:"+O+"|["+j+k+M+"])*";d.identifier=new RegExp(K+se,"g"),d.identifierStart=new RegExp(K),d.identifierMatch=new RegExp("(?:"+O+"|["+j+k+M+"])+");var ae=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;d.newline=/[\n\r\u2028\u2029]/,d.lineBreak=new RegExp(`\r
|`+d.newline.source),d.allLineBreaks=new RegExp(d.lineBreak.source,"g")},function($,d,be){var j=be(6).Options,k=["before-newline","after-newline","preserve-newline"];function M(O){j.call(this,O,"js");var K=this.raw_options.brace_style||null;K==="expand-strict"?this.raw_options.brace_style="expand":K==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var se=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var ae=0;ae<se.length;ae++)se[ae]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=se[ae];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",k),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}M.prototype=new j,$.exports.Options=M},function($){function d(k,M){this.raw_options=be(k,M),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(k,M){var O=this.raw_options[k],K=M||[];return typeof O=="object"?O!==null&&typeof O.concat=="function"&&(K=O.concat()):typeof O=="string"&&(K=O.split(/[^a-zA-Z0-9_\/\-]+/)),K},d.prototype._get_boolean=function(k,M){var O=this.raw_options[k],K=O===void 0?!!M:!!O;return K},d.prototype._get_characters=function(k,M){var O=this.raw_options[k],K=M||"";return typeof O=="string"&&(K=O.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),K},d.prototype._get_number=function(k,M){var O=this.raw_options[k];M=parseInt(M,10),isNaN(M)&&(M=0);var K=parseInt(O,10);return isNaN(K)&&(K=M),K},d.prototype._get_selection=function(k,M,O){var K=this._get_selection_list(k,M,O);if(K.length!==1)throw new Error("Invalid Option Value: The option '"+k+`' can only be one of the following values:
`+M+`
You passed in: '`+this.raw_options[k]+"'");return K[0]},d.prototype._get_selection_list=function(k,M,O){if(!M||M.length===0)throw new Error("Selection list cannot be empty.");if(O=O||[M[0]],!this._is_valid_selection(O,M))throw new Error("Invalid Default Value!");var K=this._get_array(k,O);if(!this._is_valid_selection(K,M))throw new Error("Invalid Option Value: The option '"+k+`' can contain only the following values:
`+M+`
You passed in: '`+this.raw_options[k]+"'");return K},d.prototype._is_valid_selection=function(k,M){return k.length&&M.length&&!k.some(function(O){return M.indexOf(O)===-1})};function be(k,M){var O={};k=j(k);var K;for(K in k)K!==M&&(O[K]=k[K]);if(M&&k[M])for(K in k[M])O[K]=k[M][K];return O}function j(k){var M={},O;for(O in k){var K=O.replace(/-/g,"_");M[K]=k[O]}return M}$.exports.Options=d,$.exports.normalizeOpts=j,$.exports.mergeOpts=be},function($,d,be){var j=be(8).InputScanner,k=be(9).Tokenizer,M=be(9).TOKEN,O=be(13).Directives,K=be(4),se=be(12).Pattern,ae=be(14).TemplatablePattern;function Z(he,Re){return Re.indexOf(he)!==-1}var q={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:M.START,RAW:M.RAW,EOF:M.EOF},Y=new O(/\/\*/,/\*\//),ue=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ee=/[0-9]/,oe=/[^\d\.]/,De=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ve=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ve=ve.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ve="\\?\\.(?!\\d) "+ve,ve=ve.replace(/ /g,"|");var Ye=new RegExp(ve),We="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),ut=We.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),pt=new RegExp("^(?:"+ut.join("|")+")$"),de,re=function(he,Re){k.call(this,he,Re),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var we=new se(this._input),D=new ae(this._input).read_options(this._options);this.__patterns={template:D,identifier:D.starting_with(K.identifier).matching(K.identifierMatch),number:we.matching(ue),punct:we.matching(Ye),comment:we.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:we.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:we.matching(/<!--/),html_comment_end:we.matching(/-->/),include:we.starting_with(/#include/).until_after(K.lineBreak),shebang:we.starting_with(/#!/).until_after(K.lineBreak),xml:we.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:D.until(/['\\\n\r\u2028\u2029]/),double_quote:D.until(/["\\\n\r\u2028\u2029]/),template_text:D.until(/[`\\$]/),template_expression:D.until(/[`}\\]/)}};re.prototype=new k,re.prototype._is_comment=function(he){return he.type===q.COMMENT||he.type===q.BLOCK_COMMENT||he.type===q.UNKNOWN},re.prototype._is_opening=function(he){return he.type===q.START_BLOCK||he.type===q.START_EXPR},re.prototype._is_closing=function(he,Re){return(he.type===q.END_BLOCK||he.type===q.END_EXPR)&&Re&&(he.text==="]"&&Re.text==="["||he.text===")"&&Re.text==="("||he.text==="}"&&Re.text==="{")},re.prototype._reset=function(){de=!1},re.prototype._get_next_token=function(he,Re){var we=null;this._readWhitespace();var D=this._input.peek();return D===null?this._create_token(q.EOF,""):(we=we||this._read_non_javascript(D),we=we||this._read_string(D),we=we||this._read_pair(D,this._input.peek(1)),we=we||this._read_word(he),we=we||this._read_singles(D),we=we||this._read_comment(D),we=we||this._read_regexp(D,he),we=we||this._read_xml(D,he),we=we||this._read_punctuation(),we=we||this._create_token(q.UNKNOWN,this._input.next()),we)},re.prototype._read_word=function(he){var Re;if(Re=this.__patterns.identifier.read(),Re!=="")return Re=Re.replace(K.allLineBreaks,`
`),!(he.type===q.DOT||he.type===q.RESERVED&&(he.text==="set"||he.text==="get"))&&pt.test(Re)?(Re==="in"||Re==="of")&&(he.type===q.WORD||he.type===q.STRING)?this._create_token(q.OPERATOR,Re):this._create_token(q.RESERVED,Re):this._create_token(q.WORD,Re);if(Re=this.__patterns.number.read(),Re!=="")return this._create_token(q.WORD,Re)},re.prototype._read_singles=function(he){var Re=null;return he==="("||he==="["?Re=this._create_token(q.START_EXPR,he):he===")"||he==="]"?Re=this._create_token(q.END_EXPR,he):he==="{"?Re=this._create_token(q.START_BLOCK,he):he==="}"?Re=this._create_token(q.END_BLOCK,he):he===";"?Re=this._create_token(q.SEMICOLON,he):he==="."&&oe.test(this._input.peek(1))?Re=this._create_token(q.DOT,he):he===","&&(Re=this._create_token(q.COMMA,he)),Re&&this._input.next(),Re},re.prototype._read_pair=function(he,Re){var we=null;return he==="#"&&Re==="{"&&(we=this._create_token(q.START_BLOCK,he+Re)),we&&(this._input.next(),this._input.next()),we},re.prototype._read_punctuation=function(){var he=this.__patterns.punct.read();if(he!=="")return he==="="?this._create_token(q.EQUALS,he):he==="?."?this._create_token(q.DOT,he):this._create_token(q.OPERATOR,he)},re.prototype._read_non_javascript=function(he){var Re="";if(he==="#"){if(this._is_first_token()&&(Re=this.__patterns.shebang.read(),Re))return this._create_token(q.UNKNOWN,Re.trim()+`
`);if(Re=this.__patterns.include.read(),Re)return this._create_token(q.UNKNOWN,Re.trim()+`
`);he=this._input.next();var we="#";if(this._input.hasNext()&&this._input.testChar(ee)){do he=this._input.next(),we+=he;while(this._input.hasNext()&&he!=="#"&&he!=="=");return he==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(we+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(we+="{}",this._input.next(),this._input.next())),this._create_token(q.WORD,we)}this._input.back()}else if(he==="<"&&this._is_first_token()){if(Re=this.__patterns.html_comment_start.read(),Re){for(;this._input.hasNext()&&!this._input.testChar(K.newline);)Re+=this._input.next();return de=!0,this._create_token(q.COMMENT,Re)}}else if(de&&he==="-"&&(Re=this.__patterns.html_comment_end.read(),Re))return de=!1,this._create_token(q.COMMENT,Re);return null},re.prototype._read_comment=function(he){var Re=null;if(he==="/"){var we="";if(this._input.peek(1)==="*"){we=this.__patterns.block_comment.read();var D=Y.get_directives(we);D&&D.ignore==="start"&&(we+=Y.readIgnored(this._input)),we=we.replace(K.allLineBreaks,`
`),Re=this._create_token(q.BLOCK_COMMENT,we),Re.directives=D}else this._input.peek(1)==="/"&&(we=this.__patterns.comment.read(),Re=this._create_token(q.COMMENT,we))}return Re},re.prototype._read_string=function(he){if(he==="`"||he==="'"||he==='"'){var Re=this._input.next();return this.has_char_escapes=!1,he==="`"?Re+=this._read_string_recursive("`",!0,"${"):Re+=this._read_string_recursive(he),this.has_char_escapes&&this._options.unescape_strings&&(Re=ce(Re)),this._input.peek()===he&&(Re+=this._input.next()),Re=Re.replace(K.allLineBreaks,`
`),this._create_token(q.STRING,Re)}return null},re.prototype._allow_regexp_or_xml=function(he){return he.type===q.RESERVED&&Z(he.text,["return","case","throw","else","do","typeof","yield"])||he.type===q.END_EXPR&&he.text===")"&&he.opened.previous.type===q.RESERVED&&Z(he.opened.previous.text,["if","while","for"])||Z(he.type,[q.COMMENT,q.START_EXPR,q.START_BLOCK,q.START,q.END_BLOCK,q.OPERATOR,q.EQUALS,q.EOF,q.SEMICOLON,q.COMMA])},re.prototype._read_regexp=function(he,Re){if(he==="/"&&this._allow_regexp_or_xml(Re)){for(var we=this._input.next(),D=!1,L=!1;this._input.hasNext()&&(D||L||this._input.peek()!==he)&&!this._input.testChar(K.newline);)we+=this._input.peek(),D?D=!1:(D=this._input.peek()==="\\",this._input.peek()==="["?L=!0:this._input.peek()==="]"&&(L=!1)),this._input.next();return this._input.peek()===he&&(we+=this._input.next(),we+=this._input.read(K.identifier)),this._create_token(q.STRING,we)}return null},re.prototype._read_xml=function(he,Re){if(this._options.e4x&&he==="<"&&this._allow_regexp_or_xml(Re)){var we="",D=this.__patterns.xml.read_match();if(D){for(var L=D[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),ie=L.indexOf("{")===0,xe=0;D;){var at=!!D[1],ot=D[2],At=!!D[D.length-1]||ot.slice(0,8)==="![CDATA[";if(!At&&(ot===L||ie&&ot.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(at?--xe:++xe),we+=D[0],xe<=0)break;D=this.__patterns.xml.read_match()}return D||(we+=this._input.match(/[\s\S]*/g)[0]),we=we.replace(K.allLineBreaks,`
`),this._create_token(q.STRING,we)}}return null};function ce(he){for(var Re="",we=0,D=new j(he),L=null;D.hasNext();)if(L=D.match(/([\s]|[^\\]|\\\\)+/g),L&&(Re+=L[0]),D.peek()==="\\"){if(D.next(),D.peek()==="x")L=D.match(/x([0-9A-Fa-f]{2})/g);else if(D.peek()==="u")L=D.match(/u([0-9A-Fa-f]{4})/g),L||(L=D.match(/u\{([0-9A-Fa-f]+)\}/g));else{Re+="\\",D.hasNext()&&(Re+=D.next());continue}if(!L||(we=parseInt(L[1],16),we>126&&we<=255&&L[0].indexOf("x")===0))return he;we>=0&&we<32||we>1114111?Re+="\\"+L[0]:we===34||we===39||we===92?Re+="\\"+String.fromCharCode(we):Re+=String.fromCharCode(we)}return Re}re.prototype._read_string_recursive=function(he,Re,we){var D,L;he==="'"?L=this.__patterns.single_quote:he==='"'?L=this.__patterns.double_quote:he==="`"?L=this.__patterns.template_text:he==="}"&&(L=this.__patterns.template_expression);for(var ie=L.read(),xe="";this._input.hasNext();){if(xe=this._input.next(),xe===he||!Re&&K.newline.test(xe)){this._input.back();break}else xe==="\\"&&this._input.hasNext()?(D=this._input.peek(),D==="x"||D==="u"?this.has_char_escapes=!0:D==="\r"&&this._input.peek(1)===`
`&&this._input.next(),xe+=this._input.next()):we&&(we==="${"&&xe==="$"&&this._input.peek()==="{"&&(xe+=this._input.next()),we===xe&&(he==="`"?xe+=this._read_string_recursive("}",Re,"`"):xe+=this._read_string_recursive("`",Re,"${"),this._input.hasNext()&&(xe+=this._input.next())));xe+=L.read(),ie+=xe}return ie},$.exports.Tokenizer=re,$.exports.TOKEN=q,$.exports.positionable_operators=De.slice(),$.exports.line_starters=We.slice()},function($){var d=RegExp.prototype.hasOwnProperty("sticky");function be(j){this.__input=j||"",this.__input_length=this.__input.length,this.__position=0}be.prototype.restart=function(){this.__position=0},be.prototype.back=function(){this.__position>0&&(this.__position-=1)},be.prototype.hasNext=function(){return this.__position<this.__input_length},be.prototype.next=function(){var j=null;return this.hasNext()&&(j=this.__input.charAt(this.__position),this.__position+=1),j},be.prototype.peek=function(j){var k=null;return j=j||0,j+=this.__position,j>=0&&j<this.__input_length&&(k=this.__input.charAt(j)),k},be.prototype.__match=function(j,k){j.lastIndex=k;var M=j.exec(this.__input);return M&&!(d&&j.sticky)&&M.index!==k&&(M=null),M},be.prototype.test=function(j,k){return k=k||0,k+=this.__position,k>=0&&k<this.__input_length?!!this.__match(j,k):!1},be.prototype.testChar=function(j,k){var M=this.peek(k);return j.lastIndex=0,M!==null&&j.test(M)},be.prototype.match=function(j){var k=this.__match(j,this.__position);return k?this.__position+=k[0].length:k=null,k},be.prototype.read=function(j,k,M){var O="",K;return j&&(K=this.match(j),K&&(O+=K[0])),k&&(K||!j)&&(O+=this.readUntil(k,M)),O},be.prototype.readUntil=function(j,k){var M="",O=this.__position;j.lastIndex=this.__position;var K=j.exec(this.__input);return K?(O=K.index,k&&(O+=K[0].length)):O=this.__input_length,M=this.__input.substring(this.__position,O),this.__position=O,M},be.prototype.readUntilAfter=function(j){return this.readUntil(j,!0)},be.prototype.get_regexp=function(j,k){var M=null,O="g";return k&&d&&(O="y"),typeof j=="string"&&j!==""?M=new RegExp(j,O):j&&(M=new RegExp(j.source,O)),M},be.prototype.get_literal_regexp=function(j){return RegExp(j.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},be.prototype.peekUntilAfter=function(j){var k=this.__position,M=this.readUntilAfter(j);return this.__position=k,M},be.prototype.lookBack=function(j){var k=this.__position-1;return k>=j.length&&this.__input.substring(k-j.length,k).toLowerCase()===j},$.exports.InputScanner=be},function($,d,be){var j=be(8).InputScanner,k=be(3).Token,M=be(10).TokenStream,O=be(11).WhitespacePattern,K={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},se=function(ae,Z){this._input=new j(ae),this._options=Z||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new O(this._input)};se.prototype.tokenize=function(){this._input.restart(),this.__tokens=new M,this._reset();for(var ae,Z=new k(K.START,""),q=null,Y=[],ue=new M;Z.type!==K.EOF;){for(ae=this._get_next_token(Z,q);this._is_comment(ae);)ue.add(ae),ae=this._get_next_token(Z,q);ue.isEmpty()||(ae.comments_before=ue,ue=new M),ae.parent=q,this._is_opening(ae)?(Y.push(q),q=ae):q&&this._is_closing(ae,q)&&(ae.opened=q,q.closed=ae,q=Y.pop(),ae.parent=q),ae.previous=Z,Z.next=ae,this.__tokens.add(ae),Z=ae}return this.__tokens},se.prototype._is_first_token=function(){return this.__tokens.isEmpty()},se.prototype._reset=function(){},se.prototype._get_next_token=function(ae,Z){this._readWhitespace();var q=this._input.read(/.+/g);return q?this._create_token(K.RAW,q):this._create_token(K.EOF,"")},se.prototype._is_comment=function(ae){return!1},se.prototype._is_opening=function(ae){return!1},se.prototype._is_closing=function(ae,Z){return!1},se.prototype._create_token=function(ae,Z){var q=new k(ae,Z,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return q},se.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},$.exports.Tokenizer=se,$.exports.TOKEN=K},function($){function d(be){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=be}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var be=null;return this.hasNext()&&(be=this.__tokens[this.__position],this.__position+=1),be},d.prototype.peek=function(be){var j=null;return be=be||0,be+=this.__position,be>=0&&be<this.__tokens_length&&(j=this.__tokens[be]),j},d.prototype.add=function(be){this.__parent_token&&(be.parent=this.__parent_token),this.__tokens.push(be),this.__tokens_length+=1},$.exports.TokenStream=d},function($,d,be){var j=be(12).Pattern;function k(M,O){j.call(this,M,O),O?this._line_regexp=this._input.get_regexp(O._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}k.prototype=new j,k.prototype.__set_whitespace_patterns=function(M,O){M+="\\t ",O+="\\n\\r",this._match_pattern=this._input.get_regexp("["+M+O+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+O+"]")},k.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var M=this._input.read(this._match_pattern);if(M===" ")this.whitespace_before_token=" ";else if(M){var O=this.__split(this._newline_regexp,M);this.newline_count=O.length-1,this.whitespace_before_token=O[this.newline_count]}return M},k.prototype.matching=function(M,O){var K=this._create();return K.__set_whitespace_patterns(M,O),K._update(),K},k.prototype._create=function(){return new k(this._input,this)},k.prototype.__split=function(M,O){M.lastIndex=0;for(var K=0,se=[],ae=M.exec(O);ae;)se.push(O.substring(K,ae.index)),K=ae.index+ae[0].length,ae=M.exec(O);return K<O.length?se.push(O.substring(K,O.length)):se.push(""),se},$.exports.WhitespacePattern=k},function($){function d(be,j){this._input=be,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,j&&(this._starting_pattern=this._input.get_regexp(j._starting_pattern,!0),this._match_pattern=this._input.get_regexp(j._match_pattern,!0),this._until_pattern=this._input.get_regexp(j._until_pattern),this._until_after=j._until_after)}d.prototype.read=function(){var be=this._input.read(this._starting_pattern);return(!this._starting_pattern||be)&&(be+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),be},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(be){var j=this._create();return j._until_after=!0,j._until_pattern=this._input.get_regexp(be),j._update(),j},d.prototype.until=function(be){var j=this._create();return j._until_after=!1,j._until_pattern=this._input.get_regexp(be),j._update(),j},d.prototype.starting_with=function(be){var j=this._create();return j._starting_pattern=this._input.get_regexp(be,!0),j._update(),j},d.prototype.matching=function(be){var j=this._create();return j._match_pattern=this._input.get_regexp(be,!0),j._update(),j},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},$.exports.Pattern=d},function($){function d(be,j){be=typeof be=="string"?be:be.source,j=typeof j=="string"?j:j.source,this.__directives_block_pattern=new RegExp(be+/ beautify( \w+[:]\w+)+ /.source+j,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(be+/\sbeautify\signore:end\s/.source+j,"g")}d.prototype.get_directives=function(be){if(!be.match(this.__directives_block_pattern))return null;var j={};this.__directive_pattern.lastIndex=0;for(var k=this.__directive_pattern.exec(be);k;)j[k[1]]=k[2],k=this.__directive_pattern.exec(be);return j},d.prototype.readIgnored=function(be){return be.readUntilAfter(this.__directives_end_ignore_pattern)},$.exports.Directives=d},function($,d,be){var j=be(12).Pattern,k={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function M(O,K){j.call(this,O,K),this.__template_pattern=null,this._disabled=Object.assign({},k),this._excluded=Object.assign({},k),K&&(this.__template_pattern=this._input.get_regexp(K.__template_pattern),this._excluded=Object.assign(this._excluded,K._excluded),this._disabled=Object.assign(this._disabled,K._disabled));var se=new j(O);this.__patterns={handlebars_comment:se.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:se.starting_with(/{{{/).until_after(/}}}/),handlebars:se.starting_with(/{{/).until_after(/}}/),php:se.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:se.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:se.starting_with(/{%/).until_after(/%}/),django_value:se.starting_with(/{{/).until_after(/}}/),django_comment:se.starting_with(/{#/).until_after(/#}/),smarty:se.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:se.starting_with(/{\*/).until_after(/\*}/),smarty_literal:se.starting_with(/{literal}/).until_after(/{\/literal}/)}}M.prototype=new j,M.prototype._create=function(){return new M(this._input,this)},M.prototype._update=function(){this.__set_templated_pattern()},M.prototype.disable=function(O){var K=this._create();return K._disabled[O]=!0,K._update(),K},M.prototype.read_options=function(O){var K=this._create();for(var se in k)K._disabled[se]=O.templating.indexOf(se)===-1;return K._update(),K},M.prototype.exclude=function(O){var K=this._create();return K._excluded[O]=!0,K._update(),K},M.prototype.read=function(){var O="";this._match_pattern?O=this._input.read(this._starting_pattern):O=this._input.read(this._starting_pattern,this.__template_pattern);for(var K=this._read_template();K;)this._match_pattern?K+=this._input.read(this._match_pattern):K+=this._input.readUntil(this.__template_pattern),O+=K,K=this._read_template();return this._until_after&&(O+=this._input.readUntilAfter(this._until_pattern)),O},M.prototype.__set_templated_pattern=function(){var O=[];this._disabled.php||O.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||O.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||O.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||O.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(O.push(this.__patterns.django._starting_pattern.source),O.push(this.__patterns.django_value._starting_pattern.source),O.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||O.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&O.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+O.join("|")+")")},M.prototype._read_template=function(){var O="",K=this._input.peek();if(K==="<"){var se=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&se==="?"&&(O=O||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&se==="%"&&(O=O||this.__patterns.erb.read())}else K==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(O=O||this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars_unescaped.read(),O=O||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(O=O||this.__patterns.django_value.read()),this._excluded.django||(O=O||this.__patterns.django_comment.read(),O=O||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(O=O||this.__patterns.smarty_comment.read(),O=O||this.__patterns.smarty_literal.read(),O=O||this.__patterns.smarty.read()));return O},$.exports.TemplatablePattern=M}],te={};function E($){var d=te[$];if(d!==void 0)return d.exports;var be=te[$]={exports:{}};return Le[$](be,be.exports,E),be.exports}var Me=E(0);Pe=Me})();var rt=Pe;J=[],pe=function(){return{js_beautify:rt}}.apply(Rt,J),pe!==void 0&&(Fr.exports=pe)})()},15342:function(Fr){(function(J,pe){Fr.exports=pe()})(typeof self!="undefined"?self:this,function(){return function(Rt){var J={};function pe(Pe){if(J[Pe])return J[Pe].exports;var rt=J[Pe]={i:Pe,l:!1,exports:{}};return Rt[Pe].call(rt.exports,rt,rt.exports,pe),rt.l=!0,rt.exports}return pe.m=Rt,pe.c=J,pe.d=function(Pe,rt,Le){pe.o(Pe,rt)||Object.defineProperty(Pe,rt,{enumerable:!0,get:Le})},pe.r=function(Pe){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Pe,"__esModule",{value:!0})},pe.t=function(Pe,rt){if(rt&1&&(Pe=pe(Pe)),rt&8||rt&4&&typeof Pe=="object"&&Pe&&Pe.__esModule)return Pe;var Le=Object.create(null);if(pe.r(Le),Object.defineProperty(Le,"default",{enumerable:!0,value:Pe}),rt&2&&typeof Pe!="string")for(var te in Pe)pe.d(Le,te,function(E){return Pe[E]}.bind(null,te));return Le},pe.n=function(Pe){var rt=Pe&&Pe.__esModule?function(){return Pe.default}:function(){return Pe};return pe.d(rt,"a",rt),rt},pe.o=function(Pe,rt){return Object.prototype.hasOwnProperty.call(Pe,rt)},pe.p="",pe(pe.s=1)}([function(Rt,J,pe){},function(Rt,J,pe){"use strict";pe.r(J);var Pe=pe(0),rt=function(){function H(m,b,_){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=m,this.start=b,this.end=_}return H.range=function(b,_){return _?!b||!b.loc||!_.loc||b.loc.lexer!==_.loc.lexer?null:new H(b.loc.lexer,b.loc.start,_.loc.end):b&&b.loc},H}(),Le=function(){function H(b,_){this.text=void 0,this.loc=void 0,this.text=b,this.loc=_}var m=H.prototype;return m.range=function(_,w){return new H(w,rt.range(this,_))},H}(),te=function H(m,b){this.position=void 0;var _="KaTeX parse error: "+m,w,I=b&&b.loc;if(I&&I.start<=I.end){var U=I.lexer.input;w=I.start;var le=I.end;w===U.length?_+=" at end of input: ":_+=" at position "+(w+1)+": ";var Ee=U.slice(w,le).replace(/[^]/g,"$&\u0332"),Be;w>15?Be="\u2026"+U.slice(w-15,w):Be=U.slice(0,w);var st;le+15<U.length?st=U.slice(le,le+15)+"\u2026":st=U.slice(le),_+=Be+Ee+st}var yt=new Error(_);return yt.name="ParseError",yt.__proto__=H.prototype,yt.position=w,yt};te.prototype.__proto__=Error.prototype;var E=te,Me=function(m,b){return m.indexOf(b)!==-1},$=function(m,b){return m===void 0?b:m},d=/([A-Z])/g,be=function(m){return m.replace(d,"-$1").toLowerCase()},j={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},k=/[&><"']/g;function M(H){return String(H).replace(k,function(m){return j[m]})}var O=function H(m){return m.type==="ordgroup"||m.type==="color"?m.body.length===1?H(m.body[0]):m:m.type==="font"?H(m.body):m},K=function(m){var b=O(m);return b.type==="mathord"||b.type==="textord"||b.type==="atom"},se=function(m){if(!m)throw new Error("Expected non-null, but got "+String(m));return m},ae=function(m){var b=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(m);return b!=null?b[1]:"_relative"},Z={contains:Me,deflt:$,escape:M,hyphenate:be,getBaseElem:O,isCharacterBox:K,protocolFromUrl:ae},q=function(){function H(b){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,b=b||{},this.displayMode=Z.deflt(b.displayMode,!1),this.output=Z.deflt(b.output,"htmlAndMathml"),this.leqno=Z.deflt(b.leqno,!1),this.fleqn=Z.deflt(b.fleqn,!1),this.throwOnError=Z.deflt(b.throwOnError,!0),this.errorColor=Z.deflt(b.errorColor,"#cc0000"),this.macros=b.macros||{},this.minRuleThickness=Math.max(0,Z.deflt(b.minRuleThickness,0)),this.colorIsTextColor=Z.deflt(b.colorIsTextColor,!1),this.strict=Z.deflt(b.strict,"warn"),this.trust=Z.deflt(b.trust,!1),this.maxSize=Math.max(0,Z.deflt(b.maxSize,1/0)),this.maxExpand=Math.max(0,Z.deflt(b.maxExpand,1e3))}var m=H.prototype;return m.reportNonstrict=function(_,w,I){var U=this.strict;if(typeof U=="function"&&(U=U(_,w,I)),!(!U||U==="ignore")){if(U===!0||U==="error")throw new E("LaTeX-incompatible input and strict mode is set to 'error': "+(w+" ["+_+"]"),I);U==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(w+" ["+_+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+U+"': "+w+" ["+_+"]"))}},m.useStrictBehavior=function(_,w,I){var U=this.strict;if(typeof U=="function")try{U=U(_,w,I)}catch(le){U="error"}return!U||U==="ignore"?!1:U===!0||U==="error"?!0:U==="warn"?(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(w+" ["+_+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+U+"': "+w+" ["+_+"]")),!1)},m.isTrusted=function(_){_.url&&!_.protocol&&(_.protocol=Z.protocolFromUrl(_.url));var w=typeof this.trust=="function"?this.trust(_):this.trust;return!!w},H}(),Y=function(){function H(b,_,w){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=b,this.size=_,this.cramped=w}var m=H.prototype;return m.sup=function(){return pt[de[this.id]]},m.sub=function(){return pt[re[this.id]]},m.fracNum=function(){return pt[ce[this.id]]},m.fracDen=function(){return pt[he[this.id]]},m.cramp=function(){return pt[Re[this.id]]},m.text=function(){return pt[we[this.id]]},m.isTight=function(){return this.size>=2},H}(),ue=0,ee=1,oe=2,De=3,ve=4,Ye=5,We=6,ut=7,pt=[new Y(ue,0,!1),new Y(ee,0,!0),new Y(oe,1,!1),new Y(De,1,!0),new Y(ve,2,!1),new Y(Ye,2,!0),new Y(We,3,!1),new Y(ut,3,!0)],de=[ve,Ye,ve,Ye,We,ut,We,ut],re=[Ye,Ye,Ye,Ye,ut,ut,ut,ut],ce=[oe,De,ve,Ye,We,ut,We,ut],he=[De,De,Ye,Ye,ut,ut,ut,ut],Re=[ee,ee,De,De,Ye,Ye,ut,ut],we=[ue,ee,oe,De,oe,De,oe,De],D={DISPLAY:pt[ue],TEXT:pt[oe],SCRIPT:pt[ve],SCRIPTSCRIPT:pt[We]},L=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function ie(H){for(var m=0;m<L.length;m++)for(var b=L[m],_=0;_<b.blocks.length;_++){var w=b.blocks[_];if(H>=w[0]&&H<=w[1])return b.name}return null}var xe=[];L.forEach(function(H){return H.blocks.forEach(function(m){return xe.push.apply(xe,m)})});function at(H){for(var m=0;m<xe.length;m+=2)if(H>=xe[m]&&H<=xe[m+1])return!0;return!1}var ot=80,At=function(m,b){return"M95,"+(622+m+b)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+m/2.075+" -"+m+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+m)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+m)+" "+b+"h400000v"+(40+m)+"h-400000z"},Xe=function(m,b){return"M263,"+(601+m+b)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+m/2.084+" -"+m+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+m)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+m)+" "+b+"h400000v"+(40+m)+"h-400000z"},ar=function(m,b){return"M983 "+(10+m+b)+`
l`+m/3.13+" -"+m+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+m)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+m)+" "+b+"h400000v"+(40+m)+"h-400000z"},jt=function(m,b){return"M424,"+(2398+m+b)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+m/4.223+" -"+m+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+m)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+m)+" "+b+`
h400000v`+(40+m)+"h-400000z"},Ot=function(m,b){return"M473,"+(2713+m+b)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+m/5.298+" -"+m+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+m)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+m)+" "+b+"h400000v"+(40+m)+"H1017.7z"},kr=function(m,b,_){var w=_-54-b-m;return"M702 "+(m+b)+"H400000"+(40+m)+`
H742v`+w+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+b+"H400000v"+(40+m)+"H742z"},$r=function(m,b,_){b=1e3*b;var w="";switch(m){case"sqrtMain":w=At(b,ot);break;case"sqrtSize1":w=Xe(b,ot);break;case"sqrtSize2":w=ar(b,ot);break;case"sqrtSize3":w=jt(b,ot);break;case"sqrtSize4":w=Ot(b,ot);break;case"sqrtTall":w=kr(b,ot,_)}return w},ir={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},zr=function(){function H(b){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=b,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var m=H.prototype;return m.hasClass=function(_){return Z.contains(this.classes,_)},m.toNode=function(){for(var _=document.createDocumentFragment(),w=0;w<this.children.length;w++)_.appendChild(this.children[w].toNode());return _},m.toMarkup=function(){for(var _="",w=0;w<this.children.length;w++)_+=this.children[w].toMarkup();return _},m.toText=function(){var _=function(I){return I.toText()};return this.children.map(_).join("")},H}(),li=function(m){return m.filter(function(b){return b}).join(" ")},Gr=function(m,b,_){if(this.classes=m||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=_||{},b){b.style.isTight()&&this.classes.push("mtight");var w=b.getColor();w&&(this.style.color=w)}},Ze=function(m){var b=document.createElement(m);b.className=li(this.classes);for(var _ in this.style)this.style.hasOwnProperty(_)&&(b.style[_]=this.style[_]);for(var w in this.attributes)this.attributes.hasOwnProperty(w)&&b.setAttribute(w,this.attributes[w]);for(var I=0;I<this.children.length;I++)b.appendChild(this.children[I].toNode());return b},nt=function(m){var b="<"+m;this.classes.length&&(b+=' class="'+Z.escape(li(this.classes))+'"');var _="";for(var w in this.style)this.style.hasOwnProperty(w)&&(_+=Z.hyphenate(w)+":"+this.style[w]+";");_&&(b+=' style="'+Z.escape(_)+'"');for(var I in this.attributes)this.attributes.hasOwnProperty(I)&&(b+=" "+I+'="'+Z.escape(this.attributes[I])+'"');b+=">";for(var U=0;U<this.children.length;U++)b+=this.children[U].toMarkup();return b+="</"+m+">",b},Qe=function(){function H(b,_,w,I){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Gr.call(this,b,w,I),this.children=_||[]}var m=H.prototype;return m.setAttribute=function(_,w){this.attributes[_]=w},m.hasClass=function(_){return Z.contains(this.classes,_)},m.toNode=function(){return Ze.call(this,"span")},m.toMarkup=function(){return nt.call(this,"span")},H}(),Ct=function(){function H(b,_,w,I){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Gr.call(this,_,I),this.children=w||[],this.setAttribute("href",b)}var m=H.prototype;return m.setAttribute=function(_,w){this.attributes[_]=w},m.hasClass=function(_){return Z.contains(this.classes,_)},m.toNode=function(){return Ze.call(this,"a")},m.toMarkup=function(){return nt.call(this,"a")},H}(),Dt=function(){function H(b,_,w){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=_,this.src=b,this.classes=["mord"],this.style=w}var m=H.prototype;return m.hasClass=function(_){return Z.contains(this.classes,_)},m.toNode=function(){var _=document.createElement("img");_.src=this.src,_.alt=this.alt,_.className="mord";for(var w in this.style)this.style.hasOwnProperty(w)&&(_.style[w]=this.style[w]);return _},m.toMarkup=function(){var _="<img src='"+this.src+" 'alt='"+this.alt+"' ",w="";for(var I in this.style)this.style.hasOwnProperty(I)&&(w+=Z.hyphenate(I)+":"+this.style[I]+";");return w&&(_+=' style="'+Z.escape(w)+'"'),_+="'/>",_},H}(),ye={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},Oe=function(){function H(b,_,w,I,U,le,Ee,Be){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=b,this.height=_||0,this.depth=w||0,this.italic=I||0,this.skew=U||0,this.width=le||0,this.classes=Ee||[],this.style=Be||{},this.maxFontSize=0;var st=ie(this.text.charCodeAt(0));st&&this.classes.push(st+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ye[this.text])}var m=H.prototype;return m.hasClass=function(_){return Z.contains(this.classes,_)},m.toNode=function(){var _=document.createTextNode(this.text),w=null;this.italic>0&&(w=document.createElement("span"),w.style.marginRight=this.italic+"em"),this.classes.length>0&&(w=w||document.createElement("span"),w.className=li(this.classes));for(var I in this.style)this.style.hasOwnProperty(I)&&(w=w||document.createElement("span"),w.style[I]=this.style[I]);return w?(w.appendChild(_),w):_},m.toMarkup=function(){var _=!1,w="<span";this.classes.length&&(_=!0,w+=' class="',w+=Z.escape(li(this.classes)),w+='"');var I="";this.italic>0&&(I+="margin-right:"+this.italic+"em;");for(var U in this.style)this.style.hasOwnProperty(U)&&(I+=Z.hyphenate(U)+":"+this.style[U]+";");I&&(_=!0,w+=' style="'+Z.escape(I)+'"');var le=Z.escape(this.text);return _?(w+=">",w+=le,w+="</span>",w):le},H}(),et=function(){function H(b,_){this.children=void 0,this.attributes=void 0,this.children=b||[],this.attributes=_||{}}var m=H.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",w=document.createElementNS(_,"svg");for(var I in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,I)&&w.setAttribute(I,this.attributes[I]);for(var U=0;U<this.children.length;U++)w.appendChild(this.children[U].toNode());return w},m.toMarkup=function(){var _="<svg";for(var w in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,w)&&(_+=" "+w+"='"+this.attributes[w]+"'");_+=">";for(var I=0;I<this.children.length;I++)_+=this.children[I].toMarkup();return _+="</svg>",_},H}(),vt=function(){function H(b,_){this.pathName=void 0,this.alternate=void 0,this.pathName=b,this.alternate=_}var m=H.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",w=document.createElementNS(_,"path");return this.alternate?w.setAttribute("d",this.alternate):w.setAttribute("d",ir[this.pathName]),w},m.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+ir[this.pathName]+"'/>"},H}(),wt=function(){function H(b){this.attributes=void 0,this.attributes=b||{}}var m=H.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",w=document.createElementNS(_,"line");for(var I in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,I)&&w.setAttribute(I,this.attributes[I]);return w},m.toMarkup=function(){var _="<line";for(var w in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,w)&&(_+=" "+w+"='"+this.attributes[w]+"'");return _+="/>",_},H}();function Ht(H){if(H instanceof Oe)return H;throw new Error("Expected symbolNode but got "+String(H)+".")}function fr(H){if(H instanceof Qe)return H;throw new Error("Expected span<HtmlDomNode> but got "+String(H)+".")}var Xt={"AMS-Regular":{65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473]},"Fraktur-Regular":{33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],163:[0,.69444,0,0,.86853],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],163:[0,.69444,0,0,.76909],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],305:[0,.43056,0,.02778,.32246],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],567:[.19444,.43056,0,.08334,.38403],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,1],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.67,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.744,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.744,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333]},"Math-Italic":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"Math-Regular":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"SansSerif-Bold":{33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212]},"Size1-Regular":{40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ue={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Ut={\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function _r(H,m){Xt[H]=m}function Fe(H,m,b){if(!Xt[m])throw new Error("Font metrics not found for font: "+m+".");var _=H.charCodeAt(0),w=Xt[m][_];if(!w&&H[0]in Ut&&(_=Ut[H[0]].charCodeAt(0),w=Xt[m][_]),!w&&b==="text"&&at(_)&&(w=Xt[m][77]),w)return{depth:w[0],height:w[1],italic:w[2],skew:w[3],width:w[4]}}var Ge={};function it(H){var m;if(H>=5?m=0:H>=3?m=1:m=2,!Ge[m]){var b=Ge[m]={cssEmPerMu:Ue.quad[m]/18};for(var _ in Ue)Ue.hasOwnProperty(_)&&(b[_]=Ue[_][m])}return Ge[m]}var Pt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},kt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},zt={math:{},text:{}},rr=zt;function T(H,m,b,_,w,I){zt[H][w]={font:m,group:b,replace:_},I&&_&&(zt[H][_]=zt[H][w])}var B="math",dt="text",G="main",fe="ams",xr="accent-token",Ne="bin",He="close",Je="inner",W="mathord",ge="op-token",Se="open",Ke="punct",V="rel",qt="spacing",Ae="textord";T(B,G,V,"\u2261","\\equiv",!0),T(B,G,V,"\u227A","\\prec",!0),T(B,G,V,"\u227B","\\succ",!0),T(B,G,V,"\u223C","\\sim",!0),T(B,G,V,"\u22A5","\\perp"),T(B,G,V,"\u2AAF","\\preceq",!0),T(B,G,V,"\u2AB0","\\succeq",!0),T(B,G,V,"\u2243","\\simeq",!0),T(B,G,V,"\u2223","\\mid",!0),T(B,G,V,"\u226A","\\ll",!0),T(B,G,V,"\u226B","\\gg",!0),T(B,G,V,"\u224D","\\asymp",!0),T(B,G,V,"\u2225","\\parallel"),T(B,G,V,"\u22C8","\\bowtie",!0),T(B,G,V,"\u2323","\\smile",!0),T(B,G,V,"\u2291","\\sqsubseteq",!0),T(B,G,V,"\u2292","\\sqsupseteq",!0),T(B,G,V,"\u2250","\\doteq",!0),T(B,G,V,"\u2322","\\frown",!0),T(B,G,V,"\u220B","\\ni",!0),T(B,G,V,"\u221D","\\propto",!0),T(B,G,V,"\u22A2","\\vdash",!0),T(B,G,V,"\u22A3","\\dashv",!0),T(B,G,V,"\u220B","\\owns"),T(B,G,Ke,".","\\ldotp"),T(B,G,Ke,"\u22C5","\\cdotp"),T(B,G,Ae,"#","\\#"),T(dt,G,Ae,"#","\\#"),T(B,G,Ae,"&","\\&"),T(dt,G,Ae,"&","\\&"),T(B,G,Ae,"\u2135","\\aleph",!0),T(B,G,Ae,"\u2200","\\forall",!0),T(B,G,Ae,"\u210F","\\hbar",!0),T(B,G,Ae,"\u2203","\\exists",!0),T(B,G,Ae,"\u2207","\\nabla",!0),T(B,G,Ae,"\u266D","\\flat",!0),T(B,G,Ae,"\u2113","\\ell",!0),T(B,G,Ae,"\u266E","\\natural",!0),T(B,G,Ae,"\u2663","\\clubsuit",!0),T(B,G,Ae,"\u2118","\\wp",!0),T(B,G,Ae,"\u266F","\\sharp",!0),T(B,G,Ae,"\u2662","\\diamondsuit",!0),T(B,G,Ae,"\u211C","\\Re",!0),T(B,G,Ae,"\u2661","\\heartsuit",!0),T(B,G,Ae,"\u2111","\\Im",!0),T(B,G,Ae,"\u2660","\\spadesuit",!0),T(dt,G,Ae,"\xA7","\\S",!0),T(dt,G,Ae,"\xB6","\\P",!0),T(B,G,Ae,"\u2020","\\dag"),T(dt,G,Ae,"\u2020","\\dag"),T(dt,G,Ae,"\u2020","\\textdagger"),T(B,G,Ae,"\u2021","\\ddag"),T(dt,G,Ae,"\u2021","\\ddag"),T(dt,G,Ae,"\u2021","\\textdaggerdbl"),T(B,G,He,"\u23B1","\\rmoustache",!0),T(B,G,Se,"\u23B0","\\lmoustache",!0),T(B,G,He,"\u27EF","\\rgroup",!0),T(B,G,Se,"\u27EE","\\lgroup",!0),T(B,G,Ne,"\u2213","\\mp",!0),T(B,G,Ne,"\u2296","\\ominus",!0),T(B,G,Ne,"\u228E","\\uplus",!0),T(B,G,Ne,"\u2293","\\sqcap",!0),T(B,G,Ne,"\u2217","\\ast"),T(B,G,Ne,"\u2294","\\sqcup",!0),T(B,G,Ne,"\u25EF","\\bigcirc"),T(B,G,Ne,"\u2219","\\bullet"),T(B,G,Ne,"\u2021","\\ddagger"),T(B,G,Ne,"\u2240","\\wr",!0),T(B,G,Ne,"\u2A3F","\\amalg"),T(B,G,Ne,"&","\\And"),T(B,G,V,"\u27F5","\\longleftarrow",!0),T(B,G,V,"\u21D0","\\Leftarrow",!0),T(B,G,V,"\u27F8","\\Longleftarrow",!0),T(B,G,V,"\u27F6","\\longrightarrow",!0),T(B,G,V,"\u21D2","\\Rightarrow",!0),T(B,G,V,"\u27F9","\\Longrightarrow",!0),T(B,G,V,"\u2194","\\leftrightarrow",!0),T(B,G,V,"\u27F7","\\longleftrightarrow",!0),T(B,G,V,"\u21D4","\\Leftrightarrow",!0),T(B,G,V,"\u27FA","\\Longleftrightarrow",!0),T(B,G,V,"\u21A6","\\mapsto",!0),T(B,G,V,"\u27FC","\\longmapsto",!0),T(B,G,V,"\u2197","\\nearrow",!0),T(B,G,V,"\u21A9","\\hookleftarrow",!0),T(B,G,V,"\u21AA","\\hookrightarrow",!0),T(B,G,V,"\u2198","\\searrow",!0),T(B,G,V,"\u21BC","\\leftharpoonup",!0),T(B,G,V,"\u21C0","\\rightharpoonup",!0),T(B,G,V,"\u2199","\\swarrow",!0),T(B,G,V,"\u21BD","\\leftharpoondown",!0),T(B,G,V,"\u21C1","\\rightharpoondown",!0),T(B,G,V,"\u2196","\\nwarrow",!0),T(B,G,V,"\u21CC","\\rightleftharpoons",!0),T(B,fe,V,"\u226E","\\nless",!0),T(B,fe,V,"\uE010","\\@nleqslant"),T(B,fe,V,"\uE011","\\@nleqq"),T(B,fe,V,"\u2A87","\\lneq",!0),T(B,fe,V,"\u2268","\\lneqq",!0),T(B,fe,V,"\uE00C","\\@lvertneqq"),T(B,fe,V,"\u22E6","\\lnsim",!0),T(B,fe,V,"\u2A89","\\lnapprox",!0),T(B,fe,V,"\u2280","\\nprec",!0),T(B,fe,V,"\u22E0","\\npreceq",!0),T(B,fe,V,"\u22E8","\\precnsim",!0),T(B,fe,V,"\u2AB9","\\precnapprox",!0),T(B,fe,V,"\u2241","\\nsim",!0),T(B,fe,V,"\uE006","\\@nshortmid"),T(B,fe,V,"\u2224","\\nmid",!0),T(B,fe,V,"\u22AC","\\nvdash",!0),T(B,fe,V,"\u22AD","\\nvDash",!0),T(B,fe,V,"\u22EA","\\ntriangleleft"),T(B,fe,V,"\u22EC","\\ntrianglelefteq",!0),T(B,fe,V,"\u228A","\\subsetneq",!0),T(B,fe,V,"\uE01A","\\@varsubsetneq"),T(B,fe,V,"\u2ACB","\\subsetneqq",!0),T(B,fe,V,"\uE017","\\@varsubsetneqq"),T(B,fe,V,"\u226F","\\ngtr",!0),T(B,fe,V,"\uE00F","\\@ngeqslant"),T(B,fe,V,"\uE00E","\\@ngeqq"),T(B,fe,V,"\u2A88","\\gneq",!0),T(B,fe,V,"\u2269","\\gneqq",!0),T(B,fe,V,"\uE00D","\\@gvertneqq"),T(B,fe,V,"\u22E7","\\gnsim",!0),T(B,fe,V,"\u2A8A","\\gnapprox",!0),T(B,fe,V,"\u2281","\\nsucc",!0),T(B,fe,V,"\u22E1","\\nsucceq",!0),T(B,fe,V,"\u22E9","\\succnsim",!0),T(B,fe,V,"\u2ABA","\\succnapprox",!0),T(B,fe,V,"\u2246","\\ncong",!0),T(B,fe,V,"\uE007","\\@nshortparallel"),T(B,fe,V,"\u2226","\\nparallel",!0),T(B,fe,V,"\u22AF","\\nVDash",!0),T(B,fe,V,"\u22EB","\\ntriangleright"),T(B,fe,V,"\u22ED","\\ntrianglerighteq",!0),T(B,fe,V,"\uE018","\\@nsupseteqq"),T(B,fe,V,"\u228B","\\supsetneq",!0),T(B,fe,V,"\uE01B","\\@varsupsetneq"),T(B,fe,V,"\u2ACC","\\supsetneqq",!0),T(B,fe,V,"\uE019","\\@varsupsetneqq"),T(B,fe,V,"\u22AE","\\nVdash",!0),T(B,fe,V,"\u2AB5","\\precneqq",!0),T(B,fe,V,"\u2AB6","\\succneqq",!0),T(B,fe,V,"\uE016","\\@nsubseteqq"),T(B,fe,Ne,"\u22B4","\\unlhd"),T(B,fe,Ne,"\u22B5","\\unrhd"),T(B,fe,V,"\u219A","\\nleftarrow",!0),T(B,fe,V,"\u219B","\\nrightarrow",!0),T(B,fe,V,"\u21CD","\\nLeftarrow",!0),T(B,fe,V,"\u21CF","\\nRightarrow",!0),T(B,fe,V,"\u21AE","\\nleftrightarrow",!0),T(B,fe,V,"\u21CE","\\nLeftrightarrow",!0),T(B,fe,V,"\u25B3","\\vartriangle"),T(B,fe,Ae,"\u210F","\\hslash"),T(B,fe,Ae,"\u25BD","\\triangledown"),T(B,fe,Ae,"\u25CA","\\lozenge"),T(B,fe,Ae,"\u24C8","\\circledS"),T(B,fe,Ae,"\xAE","\\circledR"),T(dt,fe,Ae,"\xAE","\\circledR"),T(B,fe,Ae,"\u2221","\\measuredangle",!0),T(B,fe,Ae,"\u2204","\\nexists"),T(B,fe,Ae,"\u2127","\\mho"),T(B,fe,Ae,"\u2132","\\Finv",!0),T(B,fe,Ae,"\u2141","\\Game",!0),T(B,fe,Ae,"\u2035","\\backprime"),T(B,fe,Ae,"\u25B2","\\blacktriangle"),T(B,fe,Ae,"\u25BC","\\blacktriangledown"),T(B,fe,Ae,"\u25A0","\\blacksquare"),T(B,fe,Ae,"\u29EB","\\blacklozenge"),T(B,fe,Ae,"\u2605","\\bigstar"),T(B,fe,Ae,"\u2222","\\sphericalangle",!0),T(B,fe,Ae,"\u2201","\\complement",!0),T(B,fe,Ae,"\xF0","\\eth",!0),T(B,fe,Ae,"\u2571","\\diagup"),T(B,fe,Ae,"\u2572","\\diagdown"),T(B,fe,Ae,"\u25A1","\\square"),T(B,fe,Ae,"\u25A1","\\Box"),T(B,fe,Ae,"\u25CA","\\Diamond"),T(B,fe,Ae,"\xA5","\\yen",!0),T(dt,fe,Ae,"\xA5","\\yen",!0),T(B,fe,Ae,"\u2713","\\checkmark",!0),T(dt,fe,Ae,"\u2713","\\checkmark"),T(B,fe,Ae,"\u2136","\\beth",!0),T(B,fe,Ae,"\u2138","\\daleth",!0),T(B,fe,Ae,"\u2137","\\gimel",!0),T(B,fe,Ae,"\u03DD","\\digamma",!0),T(B,fe,Ae,"\u03F0","\\varkappa"),T(B,fe,Se,"\u250C","\\ulcorner",!0),T(B,fe,He,"\u2510","\\urcorner",!0),T(B,fe,Se,"\u2514","\\llcorner",!0),T(B,fe,He,"\u2518","\\lrcorner",!0),T(B,fe,V,"\u2266","\\leqq",!0),T(B,fe,V,"\u2A7D","\\leqslant",!0),T(B,fe,V,"\u2A95","\\eqslantless",!0),T(B,fe,V,"\u2272","\\lesssim",!0),T(B,fe,V,"\u2A85","\\lessapprox",!0),T(B,fe,V,"\u224A","\\approxeq",!0),T(B,fe,Ne,"\u22D6","\\lessdot"),T(B,fe,V,"\u22D8","\\lll",!0),T(B,fe,V,"\u2276","\\lessgtr",!0),T(B,fe,V,"\u22DA","\\lesseqgtr",!0),T(B,fe,V,"\u2A8B","\\lesseqqgtr",!0),T(B,fe,V,"\u2251","\\doteqdot"),T(B,fe,V,"\u2253","\\risingdotseq",!0),T(B,fe,V,"\u2252","\\fallingdotseq",!0),T(B,fe,V,"\u223D","\\backsim",!0),T(B,fe,V,"\u22CD","\\backsimeq",!0),T(B,fe,V,"\u2AC5","\\subseteqq",!0),T(B,fe,V,"\u22D0","\\Subset",!0),T(B,fe,V,"\u228F","\\sqsubset",!0),T(B,fe,V,"\u227C","\\preccurlyeq",!0),T(B,fe,V,"\u22DE","\\curlyeqprec",!0),T(B,fe,V,"\u227E","\\precsim",!0),T(B,fe,V,"\u2AB7","\\precapprox",!0),T(B,fe,V,"\u22B2","\\vartriangleleft"),T(B,fe,V,"\u22B4","\\trianglelefteq"),T(B,fe,V,"\u22A8","\\vDash",!0),T(B,fe,V,"\u22AA","\\Vvdash",!0),T(B,fe,V,"\u2323","\\smallsmile"),T(B,fe,V,"\u2322","\\smallfrown"),T(B,fe,V,"\u224F","\\bumpeq",!0),T(B,fe,V,"\u224E","\\Bumpeq",!0),T(B,fe,V,"\u2267","\\geqq",!0),T(B,fe,V,"\u2A7E","\\geqslant",!0),T(B,fe,V,"\u2A96","\\eqslantgtr",!0),T(B,fe,V,"\u2273","\\gtrsim",!0),T(B,fe,V,"\u2A86","\\gtrapprox",!0),T(B,fe,Ne,"\u22D7","\\gtrdot"),T(B,fe,V,"\u22D9","\\ggg",!0),T(B,fe,V,"\u2277","\\gtrless",!0),T(B,fe,V,"\u22DB","\\gtreqless",!0),T(B,fe,V,"\u2A8C","\\gtreqqless",!0),T(B,fe,V,"\u2256","\\eqcirc",!0),T(B,fe,V,"\u2257","\\circeq",!0),T(B,fe,V,"\u225C","\\triangleq",!0),T(B,fe,V,"\u223C","\\thicksim"),T(B,fe,V,"\u2248","\\thickapprox"),T(B,fe,V,"\u2AC6","\\supseteqq",!0),T(B,fe,V,"\u22D1","\\Supset",!0),T(B,fe,V,"\u2290","\\sqsupset",!0),T(B,fe,V,"\u227D","\\succcurlyeq",!0),T(B,fe,V,"\u22DF","\\curlyeqsucc",!0),T(B,fe,V,"\u227F","\\succsim",!0),T(B,fe,V,"\u2AB8","\\succapprox",!0),T(B,fe,V,"\u22B3","\\vartriangleright"),T(B,fe,V,"\u22B5","\\trianglerighteq"),T(B,fe,V,"\u22A9","\\Vdash",!0),T(B,fe,V,"\u2223","\\shortmid"),T(B,fe,V,"\u2225","\\shortparallel"),T(B,fe,V,"\u226C","\\between",!0),T(B,fe,V,"\u22D4","\\pitchfork",!0),T(B,fe,V,"\u221D","\\varpropto"),T(B,fe,V,"\u25C0","\\blacktriangleleft"),T(B,fe,V,"\u2234","\\therefore",!0),T(B,fe,V,"\u220D","\\backepsilon"),T(B,fe,V,"\u25B6","\\blacktriangleright"),T(B,fe,V,"\u2235","\\because",!0),T(B,fe,V,"\u22D8","\\llless"),T(B,fe,V,"\u22D9","\\gggtr"),T(B,fe,Ne,"\u22B2","\\lhd"),T(B,fe,Ne,"\u22B3","\\rhd"),T(B,fe,V,"\u2242","\\eqsim",!0),T(B,G,V,"\u22C8","\\Join"),T(B,fe,V,"\u2251","\\Doteq",!0),T(B,fe,Ne,"\u2214","\\dotplus",!0),T(B,fe,Ne,"\u2216","\\smallsetminus"),T(B,fe,Ne,"\u22D2","\\Cap",!0),T(B,fe,Ne,"\u22D3","\\Cup",!0),T(B,fe,Ne,"\u2A5E","\\doublebarwedge",!0),T(B,fe,Ne,"\u229F","\\boxminus",!0),T(B,fe,Ne,"\u229E","\\boxplus",!0),T(B,fe,Ne,"\u22C7","\\divideontimes",!0),T(B,fe,Ne,"\u22C9","\\ltimes",!0),T(B,fe,Ne,"\u22CA","\\rtimes",!0),T(B,fe,Ne,"\u22CB","\\leftthreetimes",!0),T(B,fe,Ne,"\u22CC","\\rightthreetimes",!0),T(B,fe,Ne,"\u22CF","\\curlywedge",!0),T(B,fe,Ne,"\u22CE","\\curlyvee",!0),T(B,fe,Ne,"\u229D","\\circleddash",!0),T(B,fe,Ne,"\u229B","\\circledast",!0),T(B,fe,Ne,"\u22C5","\\centerdot"),T(B,fe,Ne,"\u22BA","\\intercal",!0),T(B,fe,Ne,"\u22D2","\\doublecap"),T(B,fe,Ne,"\u22D3","\\doublecup"),T(B,fe,Ne,"\u22A0","\\boxtimes",!0),T(B,fe,V,"\u21E2","\\dashrightarrow",!0),T(B,fe,V,"\u21E0","\\dashleftarrow",!0),T(B,fe,V,"\u21C7","\\leftleftarrows",!0),T(B,fe,V,"\u21C6","\\leftrightarrows",!0),T(B,fe,V,"\u21DA","\\Lleftarrow",!0),T(B,fe,V,"\u219E","\\twoheadleftarrow",!0),T(B,fe,V,"\u21A2","\\leftarrowtail",!0),T(B,fe,V,"\u21AB","\\looparrowleft",!0),T(B,fe,V,"\u21CB","\\leftrightharpoons",!0),T(B,fe,V,"\u21B6","\\curvearrowleft",!0),T(B,fe,V,"\u21BA","\\circlearrowleft",!0),T(B,fe,V,"\u21B0","\\Lsh",!0),T(B,fe,V,"\u21C8","\\upuparrows",!0),T(B,fe,V,"\u21BF","\\upharpoonleft",!0),T(B,fe,V,"\u21C3","\\downharpoonleft",!0),T(B,fe,V,"\u22B8","\\multimap",!0),T(B,fe,V,"\u21AD","\\leftrightsquigarrow",!0),T(B,fe,V,"\u21C9","\\rightrightarrows",!0),T(B,fe,V,"\u21C4","\\rightleftarrows",!0),T(B,fe,V,"\u21A0","\\twoheadrightarrow",!0),T(B,fe,V,"\u21A3","\\rightarrowtail",!0),T(B,fe,V,"\u21AC","\\looparrowright",!0),T(B,fe,V,"\u21B7","\\curvearrowright",!0),T(B,fe,V,"\u21BB","\\circlearrowright",!0),T(B,fe,V,"\u21B1","\\Rsh",!0),T(B,fe,V,"\u21CA","\\downdownarrows",!0),T(B,fe,V,"\u21BE","\\upharpoonright",!0),T(B,fe,V,"\u21C2","\\downharpoonright",!0),T(B,fe,V,"\u21DD","\\rightsquigarrow",!0),T(B,fe,V,"\u21DD","\\leadsto"),T(B,fe,V,"\u21DB","\\Rrightarrow",!0),T(B,fe,V,"\u21BE","\\restriction"),T(B,G,Ae,"\u2018","`"),T(B,G,Ae,"$","\\$"),T(dt,G,Ae,"$","\\$"),T(dt,G,Ae,"$","\\textdollar"),T(B,G,Ae,"%","\\%"),T(dt,G,Ae,"%","\\%"),T(B,G,Ae,"_","\\_"),T(dt,G,Ae,"_","\\_"),T(dt,G,Ae,"_","\\textunderscore"),T(B,G,Ae,"\u2220","\\angle",!0),T(B,G,Ae,"\u221E","\\infty",!0),T(B,G,Ae,"\u2032","\\prime"),T(B,G,Ae,"\u25B3","\\triangle"),T(B,G,Ae,"\u0393","\\Gamma",!0),T(B,G,Ae,"\u0394","\\Delta",!0),T(B,G,Ae,"\u0398","\\Theta",!0),T(B,G,Ae,"\u039B","\\Lambda",!0),T(B,G,Ae,"\u039E","\\Xi",!0),T(B,G,Ae,"\u03A0","\\Pi",!0),T(B,G,Ae,"\u03A3","\\Sigma",!0),T(B,G,Ae,"\u03A5","\\Upsilon",!0),T(B,G,Ae,"\u03A6","\\Phi",!0),T(B,G,Ae,"\u03A8","\\Psi",!0),T(B,G,Ae,"\u03A9","\\Omega",!0),T(B,G,Ae,"A","\u0391"),T(B,G,Ae,"B","\u0392"),T(B,G,Ae,"E","\u0395"),T(B,G,Ae,"Z","\u0396"),T(B,G,Ae,"H","\u0397"),T(B,G,Ae,"I","\u0399"),T(B,G,Ae,"K","\u039A"),T(B,G,Ae,"M","\u039C"),T(B,G,Ae,"N","\u039D"),T(B,G,Ae,"O","\u039F"),T(B,G,Ae,"P","\u03A1"),T(B,G,Ae,"T","\u03A4"),T(B,G,Ae,"X","\u03A7"),T(B,G,Ae,"\xAC","\\neg",!0),T(B,G,Ae,"\xAC","\\lnot"),T(B,G,Ae,"\u22A4","\\top"),T(B,G,Ae,"\u22A5","\\bot"),T(B,G,Ae,"\u2205","\\emptyset"),T(B,fe,Ae,"\u2205","\\varnothing"),T(B,G,W,"\u03B1","\\alpha",!0),T(B,G,W,"\u03B2","\\beta",!0),T(B,G,W,"\u03B3","\\gamma",!0),T(B,G,W,"\u03B4","\\delta",!0),T(B,G,W,"\u03F5","\\epsilon",!0),T(B,G,W,"\u03B6","\\zeta",!0),T(B,G,W,"\u03B7","\\eta",!0),T(B,G,W,"\u03B8","\\theta",!0),T(B,G,W,"\u03B9","\\iota",!0),T(B,G,W,"\u03BA","\\kappa",!0),T(B,G,W,"\u03BB","\\lambda",!0),T(B,G,W,"\u03BC","\\mu",!0),T(B,G,W,"\u03BD","\\nu",!0),T(B,G,W,"\u03BE","\\xi",!0),T(B,G,W,"\u03BF","\\omicron",!0),T(B,G,W,"\u03C0","\\pi",!0),T(B,G,W,"\u03C1","\\rho",!0),T(B,G,W,"\u03C3","\\sigma",!0),T(B,G,W,"\u03C4","\\tau",!0),T(B,G,W,"\u03C5","\\upsilon",!0),T(B,G,W,"\u03D5","\\phi",!0),T(B,G,W,"\u03C7","\\chi",!0),T(B,G,W,"\u03C8","\\psi",!0),T(B,G,W,"\u03C9","\\omega",!0),T(B,G,W,"\u03B5","\\varepsilon",!0),T(B,G,W,"\u03D1","\\vartheta",!0),T(B,G,W,"\u03D6","\\varpi",!0),T(B,G,W,"\u03F1","\\varrho",!0),T(B,G,W,"\u03C2","\\varsigma",!0),T(B,G,W,"\u03C6","\\varphi",!0),T(B,G,Ne,"\u2217","*"),T(B,G,Ne,"+","+"),T(B,G,Ne,"\u2212","-"),T(B,G,Ne,"\u22C5","\\cdot",!0),T(B,G,Ne,"\u2218","\\circ"),T(B,G,Ne,"\xF7","\\div",!0),T(B,G,Ne,"\xB1","\\pm",!0),T(B,G,Ne,"\xD7","\\times",!0),T(B,G,Ne,"\u2229","\\cap",!0),T(B,G,Ne,"\u222A","\\cup",!0),T(B,G,Ne,"\u2216","\\setminus"),T(B,G,Ne,"\u2227","\\land"),T(B,G,Ne,"\u2228","\\lor"),T(B,G,Ne,"\u2227","\\wedge",!0),T(B,G,Ne,"\u2228","\\vee",!0),T(B,G,Ae,"\u221A","\\surd"),T(B,G,Se,"(","("),T(B,G,Se,"[","["),T(B,G,Se,"\u27E8","\\langle",!0),T(B,G,Se,"\u2223","\\lvert"),T(B,G,Se,"\u2225","\\lVert"),T(B,G,He,")",")"),T(B,G,He,"]","]"),T(B,G,He,"?","?"),T(B,G,He,"!","!"),T(B,G,He,"\u27E9","\\rangle",!0),T(B,G,He,"\u2223","\\rvert"),T(B,G,He,"\u2225","\\rVert"),T(B,G,V,"=","="),T(B,G,V,"<","<"),T(B,G,V,">",">"),T(B,G,V,":",":"),T(B,G,V,"\u2248","\\approx",!0),T(B,G,V,"\u2245","\\cong",!0),T(B,G,V,"\u2265","\\ge"),T(B,G,V,"\u2265","\\geq",!0),T(B,G,V,"\u2190","\\gets"),T(B,G,V,">","\\gt"),T(B,G,V,"\u2208","\\in",!0),T(B,G,V,"\uE020","\\@not"),T(B,G,V,"\u2282","\\subset",!0),T(B,G,V,"\u2283","\\supset",!0),T(B,G,V,"\u2286","\\subseteq",!0),T(B,G,V,"\u2287","\\supseteq",!0),T(B,fe,V,"\u2288","\\nsubseteq",!0),T(B,fe,V,"\u2289","\\nsupseteq",!0),T(B,G,V,"\u22A8","\\models"),T(B,G,V,"\u2190","\\leftarrow",!0),T(B,G,V,"\u2264","\\le"),T(B,G,V,"\u2264","\\leq",!0),T(B,G,V,"<","\\lt"),T(B,G,V,"\u2192","\\rightarrow",!0),T(B,G,V,"\u2192","\\to"),T(B,fe,V,"\u2271","\\ngeq",!0),T(B,fe,V,"\u2270","\\nleq",!0),T(B,G,qt,"\xA0","\\ "),T(B,G,qt,"\xA0","~"),T(B,G,qt,"\xA0","\\space"),T(B,G,qt,"\xA0","\\nobreakspace"),T(dt,G,qt,"\xA0","\\ "),T(dt,G,qt,"\xA0","~"),T(dt,G,qt,"\xA0","\\space"),T(dt,G,qt,"\xA0","\\nobreakspace"),T(B,G,qt,null,"\\nobreak"),T(B,G,qt,null,"\\allowbreak"),T(B,G,Ke,",",","),T(B,G,Ke,";",";"),T(B,fe,Ne,"\u22BC","\\barwedge",!0),T(B,fe,Ne,"\u22BB","\\veebar",!0),T(B,G,Ne,"\u2299","\\odot",!0),T(B,G,Ne,"\u2295","\\oplus",!0),T(B,G,Ne,"\u2297","\\otimes",!0),T(B,G,Ae,"\u2202","\\partial",!0),T(B,G,Ne,"\u2298","\\oslash",!0),T(B,fe,Ne,"\u229A","\\circledcirc",!0),T(B,fe,Ne,"\u22A1","\\boxdot",!0),T(B,G,Ne,"\u25B3","\\bigtriangleup"),T(B,G,Ne,"\u25BD","\\bigtriangledown"),T(B,G,Ne,"\u2020","\\dagger"),T(B,G,Ne,"\u22C4","\\diamond"),T(B,G,Ne,"\u22C6","\\star"),T(B,G,Ne,"\u25C3","\\triangleleft"),T(B,G,Ne,"\u25B9","\\triangleright"),T(B,G,Se,"{","\\{"),T(dt,G,Ae,"{","\\{"),T(dt,G,Ae,"{","\\textbraceleft"),T(B,G,He,"}","\\}"),T(dt,G,Ae,"}","\\}"),T(dt,G,Ae,"}","\\textbraceright"),T(B,G,Se,"{","\\lbrace"),T(B,G,He,"}","\\rbrace"),T(B,G,Se,"[","\\lbrack"),T(dt,G,Ae,"[","\\lbrack"),T(B,G,He,"]","\\rbrack"),T(dt,G,Ae,"]","\\rbrack"),T(B,G,Se,"(","\\lparen"),T(B,G,He,")","\\rparen"),T(dt,G,Ae,"<","\\textless"),T(dt,G,Ae,">","\\textgreater"),T(B,G,Se,"\u230A","\\lfloor",!0),T(B,G,He,"\u230B","\\rfloor",!0),T(B,G,Se,"\u2308","\\lceil",!0),T(B,G,He,"\u2309","\\rceil",!0),T(B,G,Ae,"\\","\\backslash"),T(B,G,Ae,"\u2223","|"),T(B,G,Ae,"\u2223","\\vert"),T(dt,G,Ae,"|","\\textbar"),T(B,G,Ae,"\u2225","\\|"),T(B,G,Ae,"\u2225","\\Vert"),T(dt,G,Ae,"\u2225","\\textbardbl"),T(dt,G,Ae,"~","\\textasciitilde"),T(dt,G,Ae,"\\","\\textbackslash"),T(dt,G,Ae,"^","\\textasciicircum"),T(B,G,V,"\u2191","\\uparrow",!0),T(B,G,V,"\u21D1","\\Uparrow",!0),T(B,G,V,"\u2193","\\downarrow",!0),T(B,G,V,"\u21D3","\\Downarrow",!0),T(B,G,V,"\u2195","\\updownarrow",!0),T(B,G,V,"\u21D5","\\Updownarrow",!0),T(B,G,ge,"\u2210","\\coprod"),T(B,G,ge,"\u22C1","\\bigvee"),T(B,G,ge,"\u22C0","\\bigwedge"),T(B,G,ge,"\u2A04","\\biguplus"),T(B,G,ge,"\u22C2","\\bigcap"),T(B,G,ge,"\u22C3","\\bigcup"),T(B,G,ge,"\u222B","\\int"),T(B,G,ge,"\u222B","\\intop"),T(B,G,ge,"\u222C","\\iint"),T(B,G,ge,"\u222D","\\iiint"),T(B,G,ge,"\u220F","\\prod"),T(B,G,ge,"\u2211","\\sum"),T(B,G,ge,"\u2A02","\\bigotimes"),T(B,G,ge,"\u2A01","\\bigoplus"),T(B,G,ge,"\u2A00","\\bigodot"),T(B,G,ge,"\u222E","\\oint"),T(B,G,ge,"\u222F","\\oiint"),T(B,G,ge,"\u2230","\\oiiint"),T(B,G,ge,"\u2A06","\\bigsqcup"),T(B,G,ge,"\u222B","\\smallint"),T(dt,G,Je,"\u2026","\\textellipsis"),T(B,G,Je,"\u2026","\\mathellipsis"),T(dt,G,Je,"\u2026","\\ldots",!0),T(B,G,Je,"\u2026","\\ldots",!0),T(B,G,Je,"\u22EF","\\@cdots",!0),T(B,G,Je,"\u22F1","\\ddots",!0),T(B,G,Ae,"\u22EE","\\varvdots"),T(B,G,xr,"\u02CA","\\acute"),T(B,G,xr,"\u02CB","\\grave"),T(B,G,xr,"\xA8","\\ddot"),T(B,G,xr,"~","\\tilde"),T(B,G,xr,"\u02C9","\\bar"),T(B,G,xr,"\u02D8","\\breve"),T(B,G,xr,"\u02C7","\\check"),T(B,G,xr,"^","\\hat"),T(B,G,xr,"\u20D7","\\vec"),T(B,G,xr,"\u02D9","\\dot"),T(B,G,xr,"\u02DA","\\mathring"),T(B,G,W,"\u0131","\\imath",!0),T(B,G,W,"\u0237","\\jmath",!0),T(dt,G,Ae,"\u0131","\\i",!0),T(dt,G,Ae,"\u0237","\\j",!0),T(dt,G,Ae,"\xDF","\\ss",!0),T(dt,G,Ae,"\xE6","\\ae",!0),T(dt,G,Ae,"\xE6","\\ae",!0),T(dt,G,Ae,"\u0153","\\oe",!0),T(dt,G,Ae,"\xF8","\\o",!0),T(dt,G,Ae,"\xC6","\\AE",!0),T(dt,G,Ae,"\u0152","\\OE",!0),T(dt,G,Ae,"\xD8","\\O",!0),T(dt,G,xr,"\u02CA","\\'"),T(dt,G,xr,"\u02CB","\\`"),T(dt,G,xr,"\u02C6","\\^"),T(dt,G,xr,"\u02DC","\\~"),T(dt,G,xr,"\u02C9","\\="),T(dt,G,xr,"\u02D8","\\u"),T(dt,G,xr,"\u02D9","\\."),T(dt,G,xr,"\u02DA","\\r"),T(dt,G,xr,"\u02C7","\\v"),T(dt,G,xr,"\xA8",'\\"'),T(dt,G,xr,"\u02DD","\\H"),T(dt,G,xr,"\u25EF","\\textcircled");var Yt={"--":!0,"---":!0,"``":!0,"''":!0};T(dt,G,Ae,"\u2013","--"),T(dt,G,Ae,"\u2013","\\textendash"),T(dt,G,Ae,"\u2014","---"),T(dt,G,Ae,"\u2014","\\textemdash"),T(dt,G,Ae,"\u2018","`"),T(dt,G,Ae,"\u2018","\\textquoteleft"),T(dt,G,Ae,"\u2019","'"),T(dt,G,Ae,"\u2019","\\textquoteright"),T(dt,G,Ae,"\u201C","``"),T(dt,G,Ae,"\u201C","\\textquotedblleft"),T(dt,G,Ae,"\u201D","''"),T(dt,G,Ae,"\u201D","\\textquotedblright"),T(B,G,Ae,"\xB0","\\degree",!0),T(dt,G,Ae,"\xB0","\\degree"),T(dt,G,Ae,"\xB0","\\textdegree",!0),T(B,G,W,"\xA3","\\pounds"),T(B,G,W,"\xA3","\\mathsterling",!0),T(dt,G,W,"\xA3","\\pounds"),T(dt,G,W,"\xA3","\\textsterling",!0),T(B,fe,Ae,"\u2720","\\maltese"),T(dt,fe,Ae,"\u2720","\\maltese"),T(dt,G,qt,"\xA0","\\ "),T(dt,G,qt,"\xA0"," "),T(dt,G,qt,"\xA0","~");for(var vr='0123456789/@."',ei=0;ei<vr.length;ei++){var Ri=vr.charAt(ei);T(B,G,Ae,Ri,Ri)}for(var ui='0123456789!@*()-=+[]<>|";:?/.,',wr=0;wr<ui.length;wr++){var bi=ui.charAt(wr);T(dt,G,Ae,bi,bi)}for(var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Te=0;Te<me.length;Te++){var Mt=me.charAt(Te);T(B,G,W,Mt,Mt),T(dt,G,Ae,Mt,Mt)}T(B,fe,Ae,"C","\u2102"),T(dt,fe,Ae,"C","\u2102"),T(B,fe,Ae,"H","\u210D"),T(dt,fe,Ae,"H","\u210D"),T(B,fe,Ae,"N","\u2115"),T(dt,fe,Ae,"N","\u2115"),T(B,fe,Ae,"P","\u2119"),T(dt,fe,Ae,"P","\u2119"),T(B,fe,Ae,"Q","\u211A"),T(dt,fe,Ae,"Q","\u211A"),T(B,fe,Ae,"R","\u211D"),T(dt,fe,Ae,"R","\u211D"),T(B,fe,Ae,"Z","\u2124"),T(dt,fe,Ae,"Z","\u2124"),T(B,G,W,"h","\u210E"),T(dt,G,W,"h","\u210E");for(var ct="",Et=0;Et<me.length;Et++){var Ft=me.charAt(Et);ct=String.fromCharCode(55349,56320+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56372+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56424+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56580+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56736+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56788+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56840+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56944+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),Et<26&&(ct=String.fromCharCode(55349,56632+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct),ct=String.fromCharCode(55349,56476+Et),T(B,G,W,Ft,ct),T(dt,G,Ae,Ft,ct))}ct="\u{1D55C}",T(B,G,W,"k",ct),T(dt,G,Ae,"k",ct);for(var or=0;or<10;or++){var Jt=or.toString();ct=String.fromCharCode(55349,57294+or),T(B,G,W,Jt,ct),T(dt,G,Ae,Jt,ct),ct=String.fromCharCode(55349,57314+or),T(B,G,W,Jt,ct),T(dt,G,Ae,Jt,ct),ct=String.fromCharCode(55349,57324+or),T(B,G,W,Jt,ct),T(dt,G,Ae,Jt,ct),ct=String.fromCharCode(55349,57334+or),T(B,G,W,Jt,ct),T(dt,G,Ae,Jt,ct)}for(var Rr="\xC7\xD0\xDE\xE7\xFE",Sr=0;Sr<Rr.length;Sr++){var oi=Rr.charAt(Sr);T(B,G,W,oi,oi),T(dt,G,Ae,oi,oi)}T(dt,G,Ae,"\xF0","\xF0"),T(dt,G,Ae,"\u2013","\u2013"),T(dt,G,Ae,"\u2014","\u2014"),T(dt,G,Ae,"\u2018","\u2018"),T(dt,G,Ae,"\u2019","\u2019"),T(dt,G,Ae,"\u201C","\u201C"),T(dt,G,Ae,"\u201D","\u201D");var Dr=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathdefault","textit","Math-Italic"],["mathdefault","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Br=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],ni=function(m,b){var _=m.charCodeAt(0),w=m.charCodeAt(1),I=(_-55296)*1024+(w-56320)+65536,U=b==="math"?0:1;if(119808<=I&&I<120484){var le=Math.floor((I-119808)/26);return[Dr[le][2],Dr[le][U]]}else if(120782<=I&&I<=120831){var Ee=Math.floor((I-120782)/10);return[Br[Ee][2],Br[Ee][U]]}else{if(I===120485||I===120486)return[Dr[0][2],Dr[0][U]];if(120486<I&&I<120782)return["",""];throw new E("Unsupported character: "+m)}},_i=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ni=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],mi=function(m,b){return b.size<2?m:_i[m-1][b.size-1]},Ur=function(){function H(b){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=b.style,this.color=b.color,this.size=b.size||H.BASESIZE,this.textSize=b.textSize||this.size,this.phantom=!!b.phantom,this.font=b.font||"",this.fontFamily=b.fontFamily||"",this.fontWeight=b.fontWeight||"",this.fontShape=b.fontShape||"",this.sizeMultiplier=Ni[this.size-1],this.maxSize=b.maxSize,this.minRuleThickness=b.minRuleThickness,this._fontMetrics=void 0}var m=H.prototype;return m.extend=function(_){var w={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var I in _)_.hasOwnProperty(I)&&(w[I]=_[I]);return new H(w)},m.havingStyle=function(_){return this.style===_?this:this.extend({style:_,size:mi(this.textSize,_)})},m.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},m.havingSize=function(_){return this.size===_&&this.textSize===_?this:this.extend({style:this.style.text(),size:_,textSize:_,sizeMultiplier:Ni[_-1]})},m.havingBaseStyle=function(_){_=_||this.style.text();var w=mi(H.BASESIZE,_);return this.size===w&&this.textSize===H.BASESIZE&&this.style===_?this:this.extend({style:_,size:w})},m.havingBaseSizing=function(){var _;switch(this.style.id){case 4:case 5:_=3;break;case 6:case 7:_=1;break;default:_=6}return this.extend({style:this.style.text(),size:_})},m.withColor=function(_){return this.extend({color:_})},m.withPhantom=function(){return this.extend({phantom:!0})},m.withFont=function(_){return this.extend({font:_})},m.withTextFontFamily=function(_){return this.extend({fontFamily:_,font:""})},m.withTextFontWeight=function(_){return this.extend({fontWeight:_,font:""})},m.withTextFontShape=function(_){return this.extend({fontShape:_,font:""})},m.sizingClasses=function(_){return _.size!==this.size?["sizing","reset-size"+_.size,"size"+this.size]:[]},m.baseSizingClasses=function(){return this.size!==H.BASESIZE?["sizing","reset-size"+this.size,"size"+H.BASESIZE]:[]},m.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=it(this.size)),this._fontMetrics},m.getColor=function(){return this.phantom?"transparent":this.color},H}();Ur.BASESIZE=6;var Gi=Ur,Yr={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Or={ex:!0,em:!0,mu:!0},lt=function(m){return typeof m!="string"&&(m=m.unit),m in Yr||m in Or||m==="ex"},tt=function(m,b){var _;if(m.unit in Yr)_=Yr[m.unit]/b.fontMetrics().ptPerEm/b.sizeMultiplier;else if(m.unit==="mu")_=b.fontMetrics().cssEmPerMu;else{var w;if(b.style.isTight()?w=b.havingStyle(b.style.text()):w=b,m.unit==="ex")_=w.fontMetrics().xHeight;else if(m.unit==="em")_=w.fontMetrics().quad;else throw new E("Invalid unit: '"+m.unit+"'");w!==b&&(_*=w.sizeMultiplier/b.sizeMultiplier)}return Math.min(m.number*_,b.maxSize)},_t=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],Lt=function(m,b,_){return rr[_][m]&&rr[_][m].replace&&(m=rr[_][m].replace),{value:m,metrics:Fe(m,b,_)}},ft=function(m,b,_,w,I){var U=Lt(m,b,_),le=U.metrics;m=U.value;var Ee;if(le){var Be=le.italic;(_==="text"||w&&w.font==="mathit")&&(Be=0),Ee=new Oe(m,le.height,le.depth,Be,le.skew,le.width,I)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+m+"' in style '"+b+"' and mode '"+_+"'")),Ee=new Oe(m,0,0,0,0,0,I);if(w){Ee.maxFontSize=w.sizeMultiplier,w.style.isTight()&&Ee.classes.push("mtight");var st=w.getColor();st&&(Ee.style.color=st)}return Ee},Kt=function(m,b,_,w){return w===void 0&&(w=[]),_.font==="boldsymbol"&&Lt(m,"Main-Bold",b).metrics?ft(m,"Main-Bold",b,_,w.concat(["mathbf"])):m==="\\"||rr[b][m].font==="main"?ft(m,"Main-Regular",b,_,w):ft(m,"AMS-Regular",b,_,w.concat(["amsrm"]))},Bt=function(m,b,_,w){return/[0-9]/.test(m.charAt(0))||Z.contains(_t,m)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},lr=function(m,b,_,w){return Z.contains(_t,m)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(m.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},Tr=function(m,b,_,w){return Lt(m,"Math-BoldItalic",b).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},pr=function(m,b,_){var w=m.mode,I=m.text,U=["mord"],le=w==="math"||w==="text"&&b.font,Ee=le?b.font:b.fontFamily;if(I.charCodeAt(0)===55349){var Be=ni(I,w),st=Be[0],yt=Be[1];return ft(I,st,w,b,U.concat(yt))}else if(Ee){var It,Qt;if(Ee==="boldsymbol"||Ee==="mathnormal"){var tr=Ee==="boldsymbol"?Tr(I,w,b,U):lr(I,w,b,U);It=tr.fontName,Qt=[tr.fontClass]}else Z.contains(_t,I)?(It="Main-Italic",Qt=["mathit"]):le?(It=Pi[Ee].fontName,Qt=[Ee]):(It=fi(Ee,b.fontWeight,b.fontShape),Qt=[Ee,b.fontWeight,b.fontShape]);if(Lt(I,It,w).metrics)return ft(I,It,w,b,U.concat(Qt));if(Yt.hasOwnProperty(I)&&It.substr(0,10)==="Typewriter"){for(var Ve=[],qr=0;qr<I.length;qr++)Ve.push(ft(I[qr],It,w,b,U.concat(Qt)));return Xr(Ve)}}if(_==="mathord"){var Ti=Bt(I,w,b,U);return ft(I,Ti.fontName,w,b,U.concat([Ti.fontClass]))}else if(_==="textord"){var Bi=rr[w][I]&&rr[w][I].font;if(Bi==="ams"){var Li=fi("amsrm",b.fontWeight,b.fontShape);return ft(I,Li,w,b,U.concat("amsrm",b.fontWeight,b.fontShape))}else if(Bi==="main"||!Bi){var bn=fi("textrm",b.fontWeight,b.fontShape);return ft(I,bn,w,b,U.concat(b.fontWeight,b.fontShape))}else{var hn=fi(Bi,b.fontWeight,b.fontShape);return ft(I,hn,w,b,U.concat(hn,b.fontWeight,b.fontShape))}}else throw new Error("unexpected type: "+_+" in makeOrd")},si=function(m,b){if(li(m.classes)!==li(b.classes)||m.skew!==b.skew||m.maxFontSize!==b.maxFontSize)return!1;for(var _ in m.style)if(m.style.hasOwnProperty(_)&&m.style[_]!==b.style[_])return!1;for(var w in b.style)if(b.style.hasOwnProperty(w)&&m.style[w]!==b.style[w])return!1;return!0},ci=function(m){for(var b=0;b<m.length-1;b++){var _=m[b],w=m[b+1];_ instanceof Oe&&w instanceof Oe&&si(_,w)&&(_.text+=w.text,_.height=Math.max(_.height,w.height),_.depth=Math.max(_.depth,w.depth),_.italic=w.italic,m.splice(b+1,1),b--)}return m},gi=function(m){for(var b=0,_=0,w=0,I=0;I<m.children.length;I++){var U=m.children[I];U.height>b&&(b=U.height),U.depth>_&&(_=U.depth),U.maxFontSize>w&&(w=U.maxFontSize)}m.height=b,m.depth=_,m.maxFontSize=w},Er=function(m,b,_,w){var I=new Qe(m,b,_,w);return gi(I),I},Mr=function(m,b,_,w){return new Qe(m,b,_,w)},Si=function(m,b,_){var w=Er([m],[],b);return w.height=Math.max(_||b.fontMetrics().defaultRuleThickness,b.minRuleThickness),w.style.borderBottomWidth=w.height+"em",w.maxFontSize=1,w},Ai=function(m,b,_,w){var I=new Ct(m,b,_,w);return gi(I),I},Xr=function(m){var b=new zr(m);return gi(b),b},ri=function(m,b){return m instanceof zr?Er([],[m],b):m},ii=function(m){if(m.positionType==="individualShift"){for(var b=m.children,_=[b[0]],w=-b[0].shift-b[0].elem.depth,I=w,U=1;U<b.length;U++){var le=-b[U].shift-I-b[U].elem.depth,Ee=le-(b[U-1].elem.height+b[U-1].elem.depth);I=I+le,_.push({type:"kern",size:Ee}),_.push(b[U])}return{children:_,depth:w}}var Be;if(m.positionType==="top"){for(var st=m.positionData,yt=0;yt<m.children.length;yt++){var It=m.children[yt];st-=It.type==="kern"?It.size:It.elem.height+It.elem.depth}Be=st}else if(m.positionType==="bottom")Be=-m.positionData;else{var Qt=m.children[0];if(Qt.type!=="elem")throw new Error('First child must have type "elem".');if(m.positionType==="shift")Be=-Qt.elem.depth-m.positionData;else if(m.positionType==="firstBaseline")Be=-Qt.elem.depth;else throw new Error("Invalid positionType "+m.positionType+".")}return{children:m.children,depth:Be}},ai=function(m,b){for(var _=ii(m),w=_.children,I=_.depth,U=0,le=0;le<w.length;le++){var Ee=w[le];if(Ee.type==="elem"){var Be=Ee.elem;U=Math.max(U,Be.maxFontSize,Be.height)}}U+=2;var st=Er(["pstrut"],[]);st.style.height=U+"em";for(var yt=[],It=I,Qt=I,tr=I,Ve=0;Ve<w.length;Ve++){var qr=w[Ve];if(qr.type==="kern")tr+=qr.size;else{var Ti=qr.elem,Bi=qr.wrapperClasses||[],Li=qr.wrapperStyle||{},bn=Er(Bi,[st,Ti],void 0,Li);bn.style.top=-U-tr-Ti.depth+"em",qr.marginLeft&&(bn.style.marginLeft=qr.marginLeft),qr.marginRight&&(bn.style.marginRight=qr.marginRight),yt.push(bn),tr+=Ti.height+Ti.depth}It=Math.min(It,tr),Qt=Math.max(Qt,tr)}var hn=Er(["vlist"],yt);hn.style.height=Qt+"em";var Tn;if(It<0){var Cn=Er([],[]),jn=Er(["vlist"],[Cn]);jn.style.height=-It+"em";var qn=Er(["vlist-s"],[new Oe("\u200B")]);Tn=[Er(["vlist-r"],[hn,qn]),Er(["vlist-r"],[jn])]}else Tn=[Er(["vlist-r"],[hn])];var Qn=Er(["vlist-t"],Tn);return Tn.length===2&&Qn.classes.push("vlist-t2"),Qn.height=Qt,Qn.depth=-It,Qn},Kr=function(m,b){var _=Er(["mspace"],[],b),w=tt(m,b);return _.style.marginRight=w+"em",_},fi=function(m,b,_){var w="";switch(m){case"amsrm":w="AMS";break;case"textrm":w="Main";break;case"textsf":w="SansSerif";break;case"texttt":w="Typewriter";break;default:w=m}var I;return b==="textbf"&&_==="textit"?I="BoldItalic":b==="textbf"?I="Bold":b==="textit"?I="Italic":I="Regular",w+"-"+I},Pi={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Di={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ar=function(m,b){var _=Di[m],w=_[0],I=_[1],U=_[2],le=new vt(w),Ee=new et([le],{width:I+"em",height:U+"em",style:"width:"+I+"em",viewBox:"0 0 "+1e3*I+" "+1e3*U,preserveAspectRatio:"xMinYMin"}),Be=Mr(["overlay"],[Ee],b);return Be.height=U,Be.style.height=U+"em",Be.style.width=I+"em",Be},je={fontMap:Pi,makeSymbol:ft,mathsym:Kt,makeSpan:Er,makeSvgSpan:Mr,makeLineSpan:Si,makeAnchor:Ai,makeFragment:Xr,wrapFragment:ri,makeVList:ai,makeOrd:pr,makeGlue:Kr,staticSvg:Ar,svgData:Di,tryCombineChars:ci};function cr(H,m){var b=yr(H,m);if(!b)throw new Error("Expected node of type "+m+", but got "+(H?"node of type "+H.type:String(H)));return b}function yr(H,m){return H&&H.type===m?H:null}function jr(H,m){var b=nn(H,m);if(!b)throw new Error('Expected node of type "atom" and family "'+m+'", but got '+(H?H.type==="atom"?"atom of family "+H.family:"node of type "+H.type:String(H)));return b}function nn(H,m){return H&&H.type==="atom"&&H.family===m?H:null}function vi(H){var m=$i(H);if(!m)throw new Error("Expected node of symbol group type, but got "+(H?"node of type "+H.type:String(H)));return m}function $i(H){return H&&(H.type==="atom"||kt.hasOwnProperty(H.type))?H:null}var Hr={number:3,unit:"mu"},pn={number:4,unit:"mu"},_n={number:5,unit:"mu"},Vi={mord:{mop:Hr,mbin:pn,mrel:_n,minner:Hr},mop:{mord:Hr,mop:Hr,mrel:_n,minner:Hr},mbin:{mord:pn,mop:pn,mopen:pn,minner:pn},mrel:{mord:_n,mop:_n,mopen:_n,minner:_n},mopen:{},mclose:{mop:Hr,mbin:pn,mrel:_n,minner:Hr},mpunct:{mord:Hr,mop:Hr,mrel:_n,mopen:Hr,mclose:Hr,mpunct:Hr,minner:Hr},minner:{mord:Hr,mop:Hr,mbin:pn,mrel:_n,mopen:Hr,mpunct:Hr,minner:Hr}},ts={mord:{mop:Hr},mop:{mord:Hr,mop:Hr},mbin:{},mrel:{},mopen:{},mclose:{mop:Hr},mpunct:{},minner:{mop:Hr}},Yn={},$n={},Gn={};function Pr(H){for(var m=H.type,b=H.names,_=H.props,w=H.handler,I=H.htmlBuilder,U=H.mathmlBuilder,le={type:m,numArgs:_.numArgs,argTypes:_.argTypes,greediness:_.greediness===void 0?1:_.greediness,allowedInText:!!_.allowedInText,allowedInMath:_.allowedInMath===void 0?!0:_.allowedInMath,numOptionalArgs:_.numOptionalArgs||0,infix:!!_.infix,handler:w},Ee=0;Ee<b.length;++Ee)Yn[b[Ee]]=le;m&&(I&&($n[m]=I),U&&(Gn[m]=U))}function ki(H){var m=H.type,b=H.htmlBuilder,_=H.mathmlBuilder;Pr({type:m,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:b,mathmlBuilder:_})}var Ki=function(m){var b=yr(m,"ordgroup");return b?b.body:[m]},Wi=je.makeSpan,Vn=["leftmost","mbin","mopen","mrel","mop","mpunct"],vn=["rightmost","mrel","mclose","mpunct"],tn={display:D.DISPLAY,text:D.TEXT,script:D.SCRIPT,scriptscript:D.SCRIPTSCRIPT},In={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},zi=function(m,b,_,w){w===void 0&&(w=[null,null]);for(var I=[],U=0;U<m.length;U++){var le=Ii(m[U],b);if(le instanceof zr){var Ee=le.children;I.push.apply(I,Ee)}else I.push(le)}if(!_)return I;var Be=b;if(m.length===1){var st=yr(m[0],"sizing")||yr(m[0],"styling");st&&(st.type==="sizing"?Be=b.havingSize(st.size):st.type==="styling"&&(Be=b.havingStyle(tn[st.style])))}var yt=Wi([w[0]||"leftmost"],[],b),It=Wi([w[1]||"rightmost"],[],b);return rs(I,function(Qt,tr){var Ve=tr.classes[0],qr=Qt.classes[0];Ve==="mbin"&&Z.contains(vn,qr)?tr.classes[0]="mord":qr==="mbin"&&Z.contains(Vn,Ve)&&(Qt.classes[0]="mord")},{node:yt},It),rs(I,function(Qt,tr){var Ve=Xn(tr),qr=Xn(Qt),Ti=Ve&&qr?Qt.hasClass("mtight")?ts[Ve][qr]:Vi[Ve][qr]:null;if(Ti)return je.makeGlue(Ti,Be)},{node:yt},It),I},rs=function H(m,b,_,w){w&&m.push(w);for(var I=0;I<m.length;I++){var U=m[I],le=Vr(U);if(le){H(le.children,b,_);continue}if(U.classes[0]!=="mspace"){var Ee=b(U,_.node);Ee&&(_.insertAfter?_.insertAfter(Ee):(m.unshift(Ee),I++)),_.node=U,_.insertAfter=function(Be){return function(st){m.splice(Be+1,0,st),I++}}(I)}}w&&m.pop()},Vr=function(m){return m instanceof zr||m instanceof Ct?m:null},ss=function H(m,b){var _=Vr(m);if(_){var w=_.children;if(w.length){if(b==="right")return H(w[w.length-1],"right");if(b==="left")return H(w[0],"left")}}return m},Xn=function(m,b){return m?(b&&(m=ss(m,b)),In[m.classes[0]]||null):null},xn=function(m,b){var _=["nulldelimiter"].concat(m.baseSizingClasses());return Wi(b.concat(_))},Ii=function(m,b,_){if(!m)return Wi();if($n[m.type]){var w=$n[m.type](m,b);if(_&&b.size!==_.size){w=Wi(b.sizingClasses(_),[w],b);var I=b.sizeMultiplier/_.sizeMultiplier;w.height*=I,w.depth*=I}return w}else throw new E("Got group of unknown type: '"+m.type+"'")};function vs(H,m){var b=Wi(["base"],H,m),_=Wi(["strut"]);return _.style.height=b.height+b.depth+"em",_.style.verticalAlign=-b.depth+"em",b.children.unshift(_),b}function _s(H,m){var b=null;H.length===1&&H[0].type==="tag"&&(b=H[0].tag,H=H[0].body);for(var _=zi(H,m,!0),w=[],I=[],U=0;U<_.length;U++)if(I.push(_[U]),_[U].hasClass("mbin")||_[U].hasClass("mrel")||_[U].hasClass("allowbreak")){for(var le=!1;U<_.length-1&&_[U+1].hasClass("mspace")&&!_[U+1].hasClass("newline");)U++,I.push(_[U]),_[U].hasClass("nobreak")&&(le=!0);le||(w.push(vs(I,m)),I=[])}else _[U].hasClass("newline")&&(I.pop(),I.length>0&&(w.push(vs(I,m)),I=[]),w.push(_[U]));I.length>0&&w.push(vs(I,m));var Ee;b&&(Ee=vs(zi(b,m,!0)),Ee.classes=["tag"],w.push(Ee));var Be=Wi(["katex-html"],w);if(Be.setAttribute("aria-hidden","true"),Ee){var st=Ee.children[0];st.style.height=Be.height+Be.depth+"em",st.style.verticalAlign=-Be.depth+"em"}return Be}function ds(H){return new zr(H)}var pi=function(){function H(b,_){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=b,this.attributes={},this.children=_||[]}var m=H.prototype;return m.setAttribute=function(_,w){this.attributes[_]=w},m.getAttribute=function(_){return this.attributes[_]},m.toNode=function(){var _=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var w in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,w)&&_.setAttribute(w,this.attributes[w]);for(var I=0;I<this.children.length;I++)_.appendChild(this.children[I].toNode());return _},m.toMarkup=function(){var _="<"+this.type;for(var w in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,w)&&(_+=" "+w+'="',_+=Z.escape(this.attributes[w]),_+='"');_+=">";for(var I=0;I<this.children.length;I++)_+=this.children[I].toMarkup();return _+="</"+this.type+">",_},m.toText=function(){return this.children.map(function(_){return _.toText()}).join("")},H}(),xs=function(){function H(b){this.text=void 0,this.text=b}var m=H.prototype;return m.toNode=function(){return document.createTextNode(this.text)},m.toMarkup=function(){return Z.escape(this.toText())},m.toText=function(){return this.text},H}(),ws=function(){function H(b){this.width=void 0,this.character=void 0,this.width=b,b>=.05555&&b<=.05556?this.character="\u200A":b>=.1666&&b<=.1667?this.character="\u2009":b>=.2222&&b<=.2223?this.character="\u2005":b>=.2777&&b<=.2778?this.character="\u2005\u200A":b>=-.05556&&b<=-.05555?this.character="\u200A\u2063":b>=-.1667&&b<=-.1666?this.character="\u2009\u2063":b>=-.2223&&b<=-.2222?this.character="\u205F\u2063":b>=-.2778&&b<=-.2777?this.character="\u2005\u2063":this.character=null}var m=H.prototype;return m.toNode=function(){if(this.character)return document.createTextNode(this.character);var _=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return _.setAttribute("width",this.width+"em"),_},m.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},m.toText=function(){return this.character?this.character:" "},H}(),nr={MathNode:pi,TextNode:xs,SpaceNode:ws,newDocumentFragment:ds},mn=function(m,b,_){return rr[b][m]&&rr[b][m].replace&&m.charCodeAt(0)!==55349&&!(Yt.hasOwnProperty(m)&&_&&(_.fontFamily&&_.fontFamily.substr(4,2)==="tt"||_.font&&_.font.substr(4,2)==="tt"))&&(m=rr[b][m].replace),new nr.TextNode(m)},Ss=function(m){return m.length===1?m[0]:new nr.MathNode("mrow",m)},fs=function(m,b){if(b.fontFamily==="texttt")return"monospace";if(b.fontFamily==="textsf")return b.fontShape==="textit"&&b.fontWeight==="textbf"?"sans-serif-bold-italic":b.fontShape==="textit"?"sans-serif-italic":b.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(b.fontShape==="textit"&&b.fontWeight==="textbf")return"bold-italic";if(b.fontShape==="textit")return"italic";if(b.fontWeight==="textbf")return"bold";var _=b.font;if(!_||_==="mathnormal")return null;var w=m.mode;if(_==="mathit")return"italic";if(_==="boldsymbol")return"bold-italic";if(_==="mathbf")return"bold";if(_==="mathbb")return"double-struck";if(_==="mathfrak")return"fraktur";if(_==="mathscr"||_==="mathcal")return"script";if(_==="mathsf")return"sans-serif";if(_==="mathtt")return"monospace";var I=m.text;if(Z.contains(["\\imath","\\jmath"],I))return null;rr[w][I]&&rr[w][I].replace&&(I=rr[w][I].replace);var U=je.fontMap[_].fontName;return Fe(I,U,w)?je.fontMap[_].variant:null},un=function(m,b,_){if(m.length===1){var w=Fi(m[0],b);return _&&w instanceof pi&&w.type==="mo"&&(w.setAttribute("lspace","0em"),w.setAttribute("rspace","0em")),[w]}for(var I=[],U,le=0;le<m.length;le++){var Ee=Fi(m[le],b);if(Ee instanceof pi&&U instanceof pi){if(Ee.type==="mtext"&&U.type==="mtext"&&Ee.getAttribute("mathvariant")===U.getAttribute("mathvariant")){var Be;(Be=U.children).push.apply(Be,Ee.children);continue}else if(Ee.type==="mn"&&U.type==="mn"){var st;(st=U.children).push.apply(st,Ee.children);continue}else if(Ee.type==="mi"&&Ee.children.length===1&&U.type==="mn"){var yt=Ee.children[0];if(yt instanceof xs&&yt.text==="."){var It;(It=U.children).push.apply(It,Ee.children);continue}}else if(U.type==="mi"&&U.children.length===1){var Qt=U.children[0];if(Qt instanceof xs&&Qt.text==="\u0338"&&(Ee.type==="mo"||Ee.type==="mi"||Ee.type==="mn")){var tr=Ee.children[0];tr instanceof xs&&tr.text.length>0&&(tr.text=tr.text.slice(0,1)+"\u0338"+tr.text.slice(1),I.pop())}}}I.push(Ee),U=Ee}return I},cn=function(m,b,_){return Ss(un(m,b,_))},Fi=function(m,b){if(!m)return new nr.MathNode("mrow");if(Gn[m.type]){var _=Gn[m.type](m,b);return _}else throw new E("Got group of unknown type: '"+m.type+"'")};function rn(H,m,b,_){var w=un(H,b),I;w.length===1&&w[0]instanceof pi&&Z.contains(["mrow","mtable"],w[0].type)?I=w[0]:I=new nr.MathNode("mrow",w);var U=new nr.MathNode("annotation",[new nr.TextNode(m)]);U.setAttribute("encoding","application/x-tex");var le=new nr.MathNode("semantics",[I,U]),Ee=new nr.MathNode("math",[le]);Ee.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var Be=_?"katex":"katex-mathml";return je.makeSpan([Be],[Ee])}var zn=function(m){return new Gi({style:m.displayMode?D.DISPLAY:D.TEXT,maxSize:m.maxSize,minRuleThickness:m.minRuleThickness})},Wn=function(m,b){if(b.displayMode){var _=["katex-display"];b.leqno&&_.push("leqno"),b.fleqn&&_.push("fleqn"),m=je.makeSpan(_,[m])}return m},Pn=function(m,b,_){var w=zn(_),I;if(_.output==="mathml")return rn(m,b,w,!0);if(_.output==="html"){var U=_s(m,w);I=je.makeSpan(["katex"],[U])}else{var le=rn(m,b,w,!1),Ee=_s(m,w);I=je.makeSpan(["katex"],[le,Ee])}return Wn(I,_)},An=function(m,b,_){var w=zn(_),I=_s(m,w),U=je.makeSpan(["katex"],[I]);return Wn(U,_)},Oi=Pn,xi={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB"},Mi=function(m){var b=new nr.MathNode("mo",[new nr.TextNode(xi[m.substr(1)])]);return b.setAttribute("stretchy","true"),b},sn={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},kn=function(m){return m.type==="ordgroup"?m.body.length:1},Jn=function(m,b){function _(){var Ee=4e5,Be=m.label.substr(1);if(Z.contains(["widehat","widecheck","widetilde","utilde"],Be)){var st=m,yt=kn(st.base),It,Qt,tr;if(yt>5)Be==="widehat"||Be==="widecheck"?(It=420,Ee=2364,tr=.42,Qt=Be+"4"):(It=312,Ee=2340,tr=.34,Qt="tilde4");else{var Ve=[1,1,2,2,3,3][yt];Be==="widehat"||Be==="widecheck"?(Ee=[0,1062,2364,2364,2364][Ve],It=[0,239,300,360,420][Ve],tr=[0,.24,.3,.3,.36,.42][Ve],Qt=Be+Ve):(Ee=[0,600,1033,2339,2340][Ve],It=[0,260,286,306,312][Ve],tr=[0,.26,.286,.3,.306,.34][Ve],Qt="tilde"+Ve)}var qr=new vt(Qt),Ti=new et([qr],{width:"100%",height:tr+"em",viewBox:"0 0 "+Ee+" "+It,preserveAspectRatio:"none"});return{span:je.makeSvgSpan([],[Ti],b),minWidth:0,height:tr}}else{var Bi=[],Li=sn[Be],bn=Li[0],hn=Li[1],Tn=Li[2],Cn=Tn/1e3,jn=bn.length,qn,Qn;if(jn===1){var gn=Li[3];qn=["hide-tail"],Qn=[gn]}else if(jn===2)qn=["halfarrow-left","halfarrow-right"],Qn=["xMinYMin","xMaxYMin"];else if(jn===3)qn=["brace-left","brace-center","brace-right"],Qn=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+jn+" children.");for(var Ts=0;Ts<jn;Ts++){var os=new vt(bn[Ts]),ea=new et([os],{width:"400em",height:Cn+"em",viewBox:"0 0 "+Ee+" "+Tn,preserveAspectRatio:Qn[Ts]+" slice"}),ls=je.makeSvgSpan([qn[Ts]],[ea],b);if(jn===1)return{span:ls,minWidth:hn,height:Cn};ls.style.height=Cn+"em",Bi.push(ls)}return{span:je.makeSpan(["stretchy"],Bi,b),minWidth:hn,height:Cn}}}var w=_(),I=w.span,U=w.minWidth,le=w.height;return I.height=le,I.style.height=le+"em",U>0&&(I.style.minWidth=U+"em"),I},Lr=function(m,b,_,w){var I,U=m.height+m.depth+2*_;if(/fbox|color/.test(b)){if(I=je.makeSpan(["stretchy",b],[],w),b==="fbox"){var le=w.color&&w.getColor();le&&(I.style.borderColor=le)}}else{var Ee=[];/^[bx]cancel$/.test(b)&&Ee.push(new wt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(b)&&Ee.push(new wt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var Be=new et(Ee,{width:"100%",height:U+"em"});I=je.makeSvgSpan([],[Be],w)}return I.height=U,I.style.height=U+"em",I},Jr={encloseSpan:Lr,mathMLnode:Mi,svgSpan:Jn},yn=function(m,b){var _,w,I=yr(m,"supsub"),U;I?(w=cr(I.base,"accent"),_=w.base,I.base=_,U=fr(Ii(I,b)),I.base=w):(w=cr(m,"accent"),_=w.base);var le=Ii(_,b.havingCrampedStyle()),Ee=w.isShifty&&Z.isCharacterBox(_),Be=0;if(Ee){var st=Z.getBaseElem(_),yt=Ii(st,b.havingCrampedStyle());Be=Ht(yt).skew}var It=Math.min(le.height,b.fontMetrics().xHeight),Qt;if(w.isStretchy)Qt=Jr.svgSpan(w,b),Qt=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:le},{type:"elem",elem:Qt,wrapperClasses:["svg-align"],wrapperStyle:Be>0?{width:"calc(100% - "+2*Be+"em)",marginLeft:2*Be+"em"}:void 0}]},b);else{var tr,Ve;w.label==="\\vec"?(tr=je.staticSvg("vec",b),Ve=je.svgData.vec[1]):(tr=je.makeOrd({mode:w.mode,text:w.label},b,"textord"),tr=Ht(tr),tr.italic=0,Ve=tr.width),Qt=je.makeSpan(["accent-body"],[tr]);var qr=w.label==="\\textcircled";qr&&(Qt.classes.push("accent-full"),It=le.height);var Ti=Be;qr||(Ti-=Ve/2),Qt.style.left=Ti+"em",w.label==="\\textcircled"&&(Qt.style.top=".2em"),Qt=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:le},{type:"kern",size:-It},{type:"elem",elem:Qt}]},b)}var Bi=je.makeSpan(["mord","accent"],[Qt],b);return U?(U.children[0]=Bi,U.height=Math.max(Bi.height,U.height),U.classes[0]="mord",U):Bi},Ln=function(m,b){var _=m.isStretchy?Jr.mathMLnode(m.label):new nr.MathNode("mo",[mn(m.label,m.mode)]),w=new nr.MathNode("mover",[Fi(m.base,b),_]);return w.setAttribute("accent","true"),w},Ji=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(H){return"\\"+H}).join("|"));Pr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(m,b){var _=b[0],w=!Ji.test(m.funcName),I=!w||m.funcName==="\\widehat"||m.funcName==="\\widetilde"||m.funcName==="\\widecheck";return{type:"accent",mode:m.parser.mode,label:m.funcName,isStretchy:w,isShifty:I,base:_}},htmlBuilder:yn,mathmlBuilder:Ln}),Pr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(m,b){var _=b[0];return{type:"accent",mode:m.parser.mode,label:m.funcName,isStretchy:!1,isShifty:!0,base:_}},htmlBuilder:yn,mathmlBuilder:Ln}),Pr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0];return{type:"accentUnder",mode:_.mode,label:w,base:I}},htmlBuilder:function(m,b){var _=Ii(m.base,b),w=Jr.svgSpan(m,b),I=m.label==="\\utilde"?.12:0,U=je.makeVList({positionType:"bottom",positionData:w.height+I,children:[{type:"elem",elem:w,wrapperClasses:["svg-align"]},{type:"kern",size:I},{type:"elem",elem:_}]},b);return je.makeSpan(["mord","accentunder"],[U],b)},mathmlBuilder:function(m,b){var _=Jr.mathMLnode(m.label),w=new nr.MathNode("munder",[Fi(m.base,b),_]);return w.setAttribute("accentunder","true"),w}});var Is=function(m){var b=new nr.MathNode("mpadded",m?[m]:[]);return b.setAttribute("width","+0.6em"),b.setAttribute("lspace","0.3em"),b};Pr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],props:{numArgs:1,numOptionalArgs:1},handler:function(m,b,_){var w=m.parser,I=m.funcName;return{type:"xArrow",mode:w.mode,label:I,body:b[0],below:_[0]}},htmlBuilder:function(m,b){var _=b.style,w=b.havingStyle(_.sup()),I=je.wrapFragment(Ii(m.body,w,b),b);I.classes.push("x-arrow-pad");var U;m.below&&(w=b.havingStyle(_.sub()),U=je.wrapFragment(Ii(m.below,w,b),b),U.classes.push("x-arrow-pad"));var le=Jr.svgSpan(m,b),Ee=-b.fontMetrics().axisHeight+.5*le.height,Be=-b.fontMetrics().axisHeight-.5*le.height-.111;(I.depth>.25||m.label==="\\xleftequilibrium")&&(Be-=I.depth);var st;if(U){var yt=-b.fontMetrics().axisHeight+U.height+.5*le.height+.111;st=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:I,shift:Be},{type:"elem",elem:le,shift:Ee},{type:"elem",elem:U,shift:yt}]},b)}else st=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:I,shift:Be},{type:"elem",elem:le,shift:Ee}]},b);return st.children[0].children[0].children[1].classes.push("svg-align"),je.makeSpan(["mrel","x-arrow"],[st],b)},mathmlBuilder:function(m,b){var _=Jr.mathMLnode(m.label),w;if(m.body){var I=Is(Fi(m.body,b));if(m.below){var U=Is(Fi(m.below,b));w=new nr.MathNode("munderover",[_,U,I])}else w=new nr.MathNode("mover",[_,I])}else if(m.below){var le=Is(Fi(m.below,b));w=new nr.MathNode("munder",[_,le])}else w=Is(),w=new nr.MathNode("mover",[_,w]);return w}}),Pr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){for(var _=m.parser,w=cr(b[0],"ordgroup"),I=w.body,U="",le=0;le<I.length;le++){var Ee=cr(I[le],"textord");U+=Ee.text}var Be=parseInt(U);if(isNaN(Be))throw new E("\\@char has non-numeric argument "+U);return{type:"textord",mode:_.mode,text:String.fromCharCode(Be)}}});var as=function(m,b){var _=zi(m.body,b.withColor(m.color),!1);return je.makeFragment(_)},Hs=function(m,b){var _=un(m.body,b.withColor(m.color)),w=new nr.MathNode("mstyle",_);return w.setAttribute("mathcolor",m.color),w};Pr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(m,b){var _=m.parser,w=cr(b[0],"color-token").color,I=b[1];return{type:"color",mode:_.mode,color:w,body:Ki(I)}},htmlBuilder:as,mathmlBuilder:Hs}),Pr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(m,b){var _=m.parser,w=m.breakOnTokenText,I=cr(b[0],"color-token").color;_.gullet.macros.set("\\current@color",I);var U=_.parseExpression(!0,w);return{type:"color",mode:_.mode,color:I,body:U}},htmlBuilder:as,mathmlBuilder:Hs}),Pr({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(m,b,_){var w=m.parser,I=m.funcName,U=_[0],le=I==="\\cr",Ee=!1;return le||(w.settings.displayMode&&w.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?Ee=!1:Ee=!0),{type:"cr",mode:w.mode,newLine:Ee,newRow:le,size:U&&cr(U,"size").value}},htmlBuilder:function(m,b){if(m.newRow)throw new E("\\cr valid only within a tabular/array environment");var _=je.makeSpan(["mspace"],[],b);return m.newLine&&(_.classes.push("newline"),m.size&&(_.style.marginTop=tt(m.size,b)+"em")),_},mathmlBuilder:function(m,b){var _=new nr.MathNode("mspace");return m.newLine&&(_.setAttribute("linebreak","newline"),m.size&&_.setAttribute("height",tt(m.size,b)+"em")),_}});var Un=function(m,b,_){var w=rr.math[m]&&rr.math[m].replace,I=Fe(w||m,b,_);if(!I)throw new Error("Unsupported symbol "+m+" and font size "+b+".");return I},Ys=function(m,b,_,w){var I=_.havingBaseStyle(b),U=je.makeSpan(w.concat(I.sizingClasses(_)),[m],_),le=I.sizeMultiplier/_.sizeMultiplier;return U.height*=le,U.depth*=le,U.maxFontSize=I.sizeMultiplier,U},ya=function(m,b,_){var w=b.havingBaseStyle(_),I=(1-b.sizeMultiplier/w.sizeMultiplier)*b.fontMetrics().axisHeight;m.classes.push("delimcenter"),m.style.top=I+"em",m.height-=I,m.depth+=I},ba=function(m,b,_,w,I,U){var le=je.makeSymbol(m,"Main-Regular",I,w),Ee=Ys(le,b,w,U);return _&&ya(Ee,w,b),Ee},eo=function(m,b,_,w){return je.makeSymbol(m,"Size"+b+"-Regular",_,w)},Es=function(m,b,_,w,I,U){var le=eo(m,b,I,w),Ee=Ys(je.makeSpan(["delimsizing","size"+b],[le],w),D.TEXT,w,U);return _&&ya(Ee,w,D.TEXT),Ee},is=function(m,b,_){var w;b==="Size1-Regular"?w="delim-size1":w="delim-size4";var I=je.makeSpan(["delimsizinginner",w],[je.makeSpan([],[je.makeSymbol(m,b,_)])]);return{type:"elem",elem:I}},As={type:"kern",size:-.005},On=function(m,b,_,w,I,U){var le,Ee,Be,st;le=Be=st=m,Ee=null;var yt="Size1-Regular";m==="\\uparrow"?Be=st="\u23D0":m==="\\Uparrow"?Be=st="\u2016":m==="\\downarrow"?le=Be="\u23D0":m==="\\Downarrow"?le=Be="\u2016":m==="\\updownarrow"?(le="\\uparrow",Be="\u23D0",st="\\downarrow"):m==="\\Updownarrow"?(le="\\Uparrow",Be="\u2016",st="\\Downarrow"):m==="["||m==="\\lbrack"?(le="\u23A1",Be="\u23A2",st="\u23A3",yt="Size4-Regular"):m==="]"||m==="\\rbrack"?(le="\u23A4",Be="\u23A5",st="\u23A6",yt="Size4-Regular"):m==="\\lfloor"||m==="\u230A"?(Be=le="\u23A2",st="\u23A3",yt="Size4-Regular"):m==="\\lceil"||m==="\u2308"?(le="\u23A1",Be=st="\u23A2",yt="Size4-Regular"):m==="\\rfloor"||m==="\u230B"?(Be=le="\u23A5",st="\u23A6",yt="Size4-Regular"):m==="\\rceil"||m==="\u2309"?(le="\u23A4",Be=st="\u23A5",yt="Size4-Regular"):m==="("||m==="\\lparen"?(le="\u239B",Be="\u239C",st="\u239D",yt="Size4-Regular"):m===")"||m==="\\rparen"?(le="\u239E",Be="\u239F",st="\u23A0",yt="Size4-Regular"):m==="\\{"||m==="\\lbrace"?(le="\u23A7",Ee="\u23A8",st="\u23A9",Be="\u23AA",yt="Size4-Regular"):m==="\\}"||m==="\\rbrace"?(le="\u23AB",Ee="\u23AC",st="\u23AD",Be="\u23AA",yt="Size4-Regular"):m==="\\lgroup"||m==="\u27EE"?(le="\u23A7",st="\u23A9",Be="\u23AA",yt="Size4-Regular"):m==="\\rgroup"||m==="\u27EF"?(le="\u23AB",st="\u23AD",Be="\u23AA",yt="Size4-Regular"):m==="\\lmoustache"||m==="\u23B0"?(le="\u23A7",st="\u23AD",Be="\u23AA",yt="Size4-Regular"):(m==="\\rmoustache"||m==="\u23B1")&&(le="\u23AB",st="\u23A9",Be="\u23AA",yt="Size4-Regular");var It=Un(le,yt,I),Qt=It.height+It.depth,tr=Un(Be,yt,I),Ve=tr.height+tr.depth,qr=Un(st,yt,I),Ti=qr.height+qr.depth,Bi=0,Li=1;if(Ee!==null){var bn=Un(Ee,yt,I);Bi=bn.height+bn.depth,Li=2}var hn=Qt+Ti+Bi,Tn=Math.max(0,Math.ceil((b-hn)/(Li*Ve))),Cn=hn+Tn*Li*Ve,jn=w.fontMetrics().axisHeight;_&&(jn*=w.sizeMultiplier);var qn=Cn/2-jn,Qn=(Tn+1)*.005-Ve,gn=[];if(gn.push(is(st,yt,I)),Ee===null)for(var Ts=0;Ts<Tn;Ts++)gn.push(As),gn.push(is(Be,yt,I));else{for(var os=0;os<Tn;os++)gn.push(As),gn.push(is(Be,yt,I));gn.push({type:"kern",size:Qn}),gn.push(is(Be,yt,I)),gn.push(As),gn.push(is(Ee,yt,I));for(var ea=0;ea<Tn;ea++)gn.push(As),gn.push(is(Be,yt,I))}gn.push({type:"kern",size:Qn}),gn.push(is(Be,yt,I)),gn.push(As),gn.push(is(le,yt,I));var ls=w.havingBaseStyle(D.TEXT),Cr=je.makeVList({positionType:"bottom",positionData:qn,children:gn},ls);return Ys(je.makeSpan(["delimsizing","mult"],[Cr],ls),D.TEXT,w,U)},Xs=80,Fa=.08,sa=function(m,b,_,w,I){var U=$r(m,w,_),le=new vt(m,U),Ee=new et([le],{width:"400em",height:b+"em",viewBox:"0 0 400000 "+_,preserveAspectRatio:"xMinYMin slice"});return je.makeSvgSpan(["hide-tail"],[Ee],I)},Il=function(m,b){var _=b.havingBaseSizing(),w=el("\\surd",m*_.sizeMultiplier,$a,_),I=_.sizeMultiplier,U=Math.max(0,b.minRuleThickness-b.fontMetrics().sqrtRuleThickness),le,Ee=0,Be=0,st=0,yt;return w.type==="small"?(st=1e3+1e3*U+Xs,m<1?I=1:m<1.4&&(I=.7),Ee=(1+U+Fa)/I,Be=(1+U)/I,le=sa("sqrtMain",Ee,st,U,b),le.style.minWidth="0.853em",yt=.833/I):w.type==="large"?(st=(1e3+Xs)*Os[w.size],Be=(Os[w.size]+U)/I,Ee=(Os[w.size]+U+Fa)/I,le=sa("sqrtSize"+w.size,Ee,st,U,b),le.style.minWidth="1.02em",yt=1/I):(Ee=m+U+Fa,Be=m+U,st=Math.floor(1e3*m+U)+Xs,le=sa("sqrtTall",Ee,st,U,b),le.style.minWidth="0.742em",yt=1.056),le.height=Be,le.style.height=Ee+"em",{span:le,advanceWidth:yt,ruleWidth:(b.fontMetrics().sqrtRuleThickness+U)*I}},Na=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],Ps=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],bo=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Os=[0,1.2,1.8,2.4,3],Qo=function(m,b,_,w,I){if(m==="<"||m==="\\lt"||m==="\u27E8"?m="\\langle":(m===">"||m==="\\gt"||m==="\u27E9")&&(m="\\rangle"),Z.contains(Na,m)||Z.contains(bo,m))return Es(m,b,!1,_,w,I);if(Z.contains(Ps,m))return On(m,Os[b],!1,_,w,I);throw new E("Illegal delimiter: '"+m+"'")},to=[{type:"small",style:D.SCRIPTSCRIPT},{type:"small",style:D.SCRIPT},{type:"small",style:D.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ca=[{type:"small",style:D.SCRIPTSCRIPT},{type:"small",style:D.SCRIPT},{type:"small",style:D.TEXT},{type:"stack"}],$a=[{type:"small",style:D.SCRIPTSCRIPT},{type:"small",style:D.SCRIPT},{type:"small",style:D.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],ro=function(m){if(m.type==="small")return"Main-Regular";if(m.type==="large")return"Size"+m.size+"-Regular";if(m.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+m.type+"' here.")},el=function(m,b,_,w){for(var I=Math.min(2,3-w.style.size),U=I;U<_.length&&_[U].type!=="stack";U++){var le=Un(m,ro(_[U]),"math"),Ee=le.height+le.depth;if(_[U].type==="small"){var Be=w.havingBaseStyle(_[U].style);Ee*=Be.sizeMultiplier}if(Ee>b)return _[U]}return _[_.length-1]},za=function(m,b,_,w,I,U){m==="<"||m==="\\lt"||m==="\u27E8"?m="\\langle":(m===">"||m==="\\gt"||m==="\u27E9")&&(m="\\rangle");var le;Z.contains(bo,m)?le=to:Z.contains(Na,m)?le=$a:le=Ca;var Ee=el(m,b,le,w);return Ee.type==="small"?ba(m,Ee.style,_,w,I,U):Ee.type==="large"?Es(m,Ee.size,_,w,I,U):On(m,b,_,w,I,U)},_o=function(m,b,_,w,I,U){var le=w.fontMetrics().axisHeight*w.sizeMultiplier,Ee=901,Be=5/w.fontMetrics().ptPerEm,st=Math.max(b-le,_+le),yt=Math.max(st/500*Ee,2*st-Be);return za(m,yt,!0,w,I,U)},ks={sqrtImage:Il,sizedDelim:Qo,customSizedDelim:za,leftRightDelim:_o},Ua={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},tl=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function io(H,m){var b=$i(H);if(b&&Z.contains(tl,b.text))return b;throw new E("Invalid delimiter: '"+(b?b.text:JSON.stringify(H))+"' after '"+m.funcName+"'",H)}Pr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(m,b){var _=io(b[0],m);return{type:"delimsizing",mode:m.parser.mode,size:Ua[m.funcName].size,mclass:Ua[m.funcName].mclass,delim:_.text}},htmlBuilder:function(m,b){return m.delim==="."?je.makeSpan([m.mclass]):ks.sizedDelim(m.delim,m.size,b,m.mode,[m.mclass])},mathmlBuilder:function(m){var b=[];m.delim!=="."&&b.push(mn(m.delim,m.mode));var _=new nr.MathNode("mo",b);return m.mclass==="mopen"||m.mclass==="mclose"?_.setAttribute("fence","true"):_.setAttribute("fence","false"),_}});function Ka(H){if(!H.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Pr({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(m,b){var _=m.parser.gullet.macros.get("\\current@color");if(_&&typeof _!="string")throw new E("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:m.parser.mode,delim:io(b[0],m).text,color:_}}}),Pr({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(m,b){var _=io(b[0],m),w=m.parser;++w.leftrightDepth;var I=w.parseExpression(!1);--w.leftrightDepth,w.expect("\\right",!1);var U=cr(w.parseFunction(),"leftright-right");return{type:"leftright",mode:w.mode,body:I,left:_.text,right:U.delim,rightColor:U.color}},htmlBuilder:function(m,b){Ka(m);for(var _=zi(m.body,b,!0,["mopen","mclose"]),w=0,I=0,U=!1,le=0;le<_.length;le++)_[le].isMiddle?U=!0:(w=Math.max(_[le].height,w),I=Math.max(_[le].depth,I));w*=b.sizeMultiplier,I*=b.sizeMultiplier;var Ee;if(m.left==="."?Ee=xn(b,["mopen"]):Ee=ks.leftRightDelim(m.left,w,I,b,m.mode,["mopen"]),_.unshift(Ee),U)for(var Be=1;Be<_.length;Be++){var st=_[Be],yt=st.isMiddle;yt&&(_[Be]=ks.leftRightDelim(yt.delim,w,I,yt.options,m.mode,[]))}var It;if(m.right===".")It=xn(b,["mclose"]);else{var Qt=m.rightColor?b.withColor(m.rightColor):b;It=ks.leftRightDelim(m.right,w,I,Qt,m.mode,["mclose"])}return _.push(It),je.makeSpan(["minner"],_,b)},mathmlBuilder:function(m,b){Ka(m);var _=un(m.body,b);if(m.left!=="."){var w=new nr.MathNode("mo",[mn(m.left,m.mode)]);w.setAttribute("fence","true"),_.unshift(w)}if(m.right!=="."){var I=new nr.MathNode("mo",[mn(m.right,m.mode)]);I.setAttribute("fence","true"),m.rightColor&&I.setAttribute("mathcolor",m.rightColor),_.push(I)}return Ss(_)}}),Pr({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(m,b){var _=io(b[0],m);if(!m.parser.leftrightDepth)throw new E("\\middle without preceding \\left",_);return{type:"middle",mode:m.parser.mode,delim:_.text}},htmlBuilder:function(m,b){var _;if(m.delim===".")_=xn(b,[]);else{_=ks.sizedDelim(m.delim,1,b,m.mode,[]);var w={delim:m.delim,options:b};_.isMiddle=w}return _},mathmlBuilder:function(m,b){var _=m.delim==="\\vert"||m.delim==="|"?mn("|","text"):mn(m.delim,m.mode),w=new nr.MathNode("mo",[_]);return w.setAttribute("fence","true"),w.setAttribute("lspace","0.05em"),w.setAttribute("rspace","0.05em"),w}});var no=function(m,b){var _=je.wrapFragment(Ii(m.body,b),b),w=m.label.substr(1),I=b.sizeMultiplier,U,le=0,Ee=Z.isCharacterBox(m.body);if(w==="sout")U=je.makeSpan(["stretchy","sout"]),U.height=b.fontMetrics().defaultRuleThickness/I,le=-.5*b.fontMetrics().xHeight;else{/cancel/.test(w)?Ee||_.classes.push("cancel-pad"):_.classes.push("boxpad");var Be=0,st=0;/box/.test(w)?(st=Math.max(b.fontMetrics().fboxrule,b.minRuleThickness),Be=b.fontMetrics().fboxsep+(w==="colorbox"?0:st)):Be=Ee?.2:0,U=Jr.encloseSpan(_,w,Be,b),/fbox|boxed|fcolorbox/.test(w)&&(U.style.borderStyle="solid",U.style.borderWidth=st+"em"),le=_.depth+Be,m.backgroundColor&&(U.style.backgroundColor=m.backgroundColor,m.borderColor&&(U.style.borderColor=m.borderColor))}var yt;return m.backgroundColor?yt=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:U,shift:le},{type:"elem",elem:_,shift:0}]},b):yt=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:0},{type:"elem",elem:U,shift:le,wrapperClasses:/cancel/.test(w)?["svg-align"]:[]}]},b),/cancel/.test(w)&&(yt.height=_.height,yt.depth=_.depth),/cancel/.test(w)&&!Ee?je.makeSpan(["mord","cancel-lap"],[yt],b):je.makeSpan(["mord"],[yt],b)},Js=function(m,b){var _=0,w=new nr.MathNode(m.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Fi(m.body,b)]);switch(m.label){case"\\cancel":w.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":w.setAttribute("notation","downdiagonalstrike");break;case"\\sout":w.setAttribute("notation","horizontalstrike");break;case"\\fbox":w.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(_=b.fontMetrics().fboxsep*b.fontMetrics().ptPerEm,w.setAttribute("width","+"+2*_+"pt"),w.setAttribute("height","+"+2*_+"pt"),w.setAttribute("lspace",_+"pt"),w.setAttribute("voffset",_+"pt"),m.label==="\\fcolorbox"){var I=Math.max(b.fontMetrics().fboxrule,b.minRuleThickness);w.setAttribute("style","border: "+I+"em solid "+String(m.borderColor))}break;case"\\xcancel":w.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return m.backgroundColor&&w.setAttribute("mathbackground",m.backgroundColor),w};Pr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(m,b,_){var w=m.parser,I=m.funcName,U=cr(b[0],"color-token").color,le=b[1];return{type:"enclose",mode:w.mode,label:I,backgroundColor:U,body:le}},htmlBuilder:no,mathmlBuilder:Js}),Pr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(m,b,_){var w=m.parser,I=m.funcName,U=cr(b[0],"color-token").color,le=cr(b[1],"color-token").color,Ee=b[2];return{type:"enclose",mode:w.mode,label:I,backgroundColor:le,borderColor:U,body:Ee}},htmlBuilder:no,mathmlBuilder:Js}),Pr({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(m,b){var _=m.parser;return{type:"enclose",mode:_.mode,label:"\\fbox",body:b[0]}}}),Pr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(m,b,_){var w=m.parser,I=m.funcName,U=b[0];return{type:"enclose",mode:w.mode,label:I,body:U}},htmlBuilder:no,mathmlBuilder:Js});var aa={};function oa(H){for(var m=H.type,b=H.names,_=H.props,w=H.handler,I=H.htmlBuilder,U=H.mathmlBuilder,le={type:m,numArgs:_.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:w},Ee=0;Ee<b.length;++Ee)aa[b[Ee]]=le;I&&($n[m]=I),U&&(Gn[m]=U)}function xo(H){var m=[];H.consumeSpaces();for(var b=H.fetch().text;b==="\\hline"||b==="\\hdashline";)H.consume(),m.push(b==="\\hdashline"),H.consumeSpaces(),b=H.fetch().text;return m}function Hi(H,m,b){var _=m.hskipBeforeAndAfter,w=m.addJot,I=m.cols,U=m.arraystretch,le=m.colSeparationType;if(H.gullet.beginGroup(),H.gullet.macros.set("\\\\","\\cr"),!U){var Ee=H.gullet.expandMacroAsText("\\arraystretch");if(Ee==null)U=1;else if(U=parseFloat(Ee),!U||U<0)throw new E("Invalid \\arraystretch: "+Ee)}H.gullet.beginGroup();var Be=[],st=[Be],yt=[],It=[];for(It.push(xo(H));;){var Qt=H.parseExpression(!1,"\\cr");H.gullet.endGroup(),H.gullet.beginGroup(),Qt={type:"ordgroup",mode:H.mode,body:Qt},b&&(Qt={type:"styling",mode:H.mode,style:b,body:[Qt]}),Be.push(Qt);var tr=H.fetch().text;if(tr==="&")H.consume();else if(tr==="\\end"){Be.length===1&&Qt.type==="styling"&&Qt.body[0].body.length===0&&st.pop(),It.length<st.length+1&&It.push([]);break}else if(tr==="\\cr"){var Ve=cr(H.parseFunction(),"cr");yt.push(Ve.size),It.push(xo(H)),Be=[],st.push(Be)}else throw new E("Expected & or \\\\ or \\cr or \\end",H.nextToken)}return H.gullet.endGroup(),H.gullet.endGroup(),{type:"array",mode:H.mode,addJot:w,arraystretch:U,body:st,cols:I,rowGaps:yt,hskipBeforeAndAfter:_,hLinesBeforeRow:It,colSeparationType:le}}function Qi(H){return H.substr(0,1)==="d"?"display":"text"}var ji=function(m,b){var _,w,I=m.body.length,U=m.hLinesBeforeRow,le=0,Ee=new Array(I),Be=[],st=Math.max(b.fontMetrics().arrayRuleWidth,b.minRuleThickness),yt=1/b.fontMetrics().ptPerEm,It=5*yt;if(m.colSeparationType&&m.colSeparationType==="small"){var Qt=b.havingStyle(D.SCRIPT).sizeMultiplier;It=.2778*(Qt/b.sizeMultiplier)}var tr=12*yt,Ve=3*yt,qr=m.arraystretch*tr,Ti=.7*qr,Bi=.3*qr,Li=0;function bn(jl){for(var uo=0;uo<jl.length;++uo)uo>0&&(Li+=.25),Be.push({pos:Li,isDashed:jl[uo]})}for(bn(U[0]),_=0;_<m.body.length;++_){var hn=m.body[_],Tn=Ti,Cn=Bi;le<hn.length&&(le=hn.length);var jn=new Array(hn.length);for(w=0;w<hn.length;++w){var qn=Ii(hn[w],b);Cn<qn.depth&&(Cn=qn.depth),Tn<qn.height&&(Tn=qn.height),jn[w]=qn}var Qn=m.rowGaps[_],gn=0;Qn&&(gn=tt(Qn,b),gn>0&&(gn+=Bi,Cn<gn&&(Cn=gn),gn=0)),m.addJot&&(Cn+=Ve),jn.height=Tn,jn.depth=Cn,Li+=Tn,jn.pos=Li,Li+=Cn+gn,Ee[_]=jn,bn(U[_+1])}var Ts=Li/2+b.fontMetrics().axisHeight,os=m.cols||[],ea=[],ls,Cr;for(w=0,Cr=0;w<le||Cr<os.length;++w,++Cr){for(var ms=os[Cr]||{},Ru=!0;ms.type==="separator";){if(Ru||(ls=je.makeSpan(["arraycolsep"],[]),ls.style.width=b.fontMetrics().doubleRuleSep+"em",ea.push(ls)),ms.separator==="|"||ms.separator===":"){var Iu=ms.separator==="|"?"solid":"dashed",wn=je.makeSpan(["vertical-separator"],[],b);wn.style.height=Li+"em",wn.style.borderRightWidth=st+"em",wn.style.borderRightStyle=Iu,wn.style.margin="0 -"+st/2+"em",wn.style.verticalAlign=-(Li-Ts)+"em",ea.push(wn)}else throw new E("Invalid separator type: "+ms.separator);Cr++,ms=os[Cr]||{},Ru=!1}if(!(w>=le)){var Ws=void 0;(w>0||m.hskipBeforeAndAfter)&&(Ws=Z.deflt(ms.pregap,It),Ws!==0&&(ls=je.makeSpan(["arraycolsep"],[]),ls.style.width=Ws+"em",ea.push(ls)));var Ga=[];for(_=0;_<I;++_){var Vl=Ee[_],Ro=Vl[w];if(Ro){var xa=Vl.pos-Ts;Ro.depth=Vl.depth,Ro.height=Vl.height,Ga.push({type:"elem",elem:Ro,shift:xa})}}Ga=je.makeVList({positionType:"individualShift",children:Ga},b),Ga=je.makeSpan(["col-align-"+(ms.align||"c")],[Ga]),ea.push(Ga),(w<le-1||m.hskipBeforeAndAfter)&&(Ws=Z.deflt(ms.postgap,It),Ws!==0&&(ls=je.makeSpan(["arraycolsep"],[]),ls.style.width=Ws+"em",ea.push(ls)))}}if(Ee=je.makeSpan(["mtable"],ea),Be.length>0){for(var ca=je.makeLineSpan("hline",b,st),X0=je.makeLineSpan("hdashline",b,st),ha=[{type:"elem",elem:Ee,shift:0}];Be.length>0;){var Wl=Be.pop(),pl=Wl.pos-Ts;Wl.isDashed?ha.push({type:"elem",elem:X0,shift:pl}):ha.push({type:"elem",elem:ca,shift:pl})}Ee=je.makeVList({positionType:"individualShift",children:ha},b)}return je.makeSpan(["mord"],[Ee],b)},ps={c:"center ",l:"left ",r:"right "},Bn=function(m,b){var _=new nr.MathNode("mtable",m.body.map(function(Li){return new nr.MathNode("mtr",Li.map(function(bn){return new nr.MathNode("mtd",[Fi(bn,b)])}))})),w=m.arraystretch===.5?.1:.16+m.arraystretch-1+(m.addJot?.09:0);_.setAttribute("rowspacing",w+"em");var I="",U="";if(m.cols){var le=m.cols,Ee="",Be=!1,st=0,yt=le.length;le[0].type==="separator"&&(I+="top ",st=1),le[le.length-1].type==="separator"&&(I+="bottom ",yt-=1);for(var It=st;It<yt;It++)le[It].type==="align"?(U+=ps[le[It].align],Be&&(Ee+="none "),Be=!0):le[It].type==="separator"&&Be&&(Ee+=le[It].separator==="|"?"solid ":"dashed ",Be=!1);_.setAttribute("columnalign",U.trim()),/[sd]/.test(Ee)&&_.setAttribute("columnlines",Ee.trim())}if(m.colSeparationType==="align"){for(var Qt=m.cols||[],tr="",Ve=1;Ve<Qt.length;Ve++)tr+=Ve%2?"0em ":"1em ";_.setAttribute("columnspacing",tr.trim())}else m.colSeparationType==="alignat"?_.setAttribute("columnspacing","0em"):m.colSeparationType==="small"?_.setAttribute("columnspacing","0.2778em"):_.setAttribute("columnspacing","1em");var qr="",Ti=m.hLinesBeforeRow;I+=Ti[0].length>0?"left ":"",I+=Ti[Ti.length-1].length>0?"right ":"";for(var Bi=1;Bi<Ti.length-1;Bi++)qr+=Ti[Bi].length===0?"none ":Ti[Bi][0]?"dashed ":"solid ";return/[sd]/.test(qr)&&_.setAttribute("rowlines",qr.trim()),I!==""&&(_=new nr.MathNode("menclose",[_]),_.setAttribute("notation",I.trim())),m.arraystretch&&m.arraystretch<1&&(_=new nr.MathNode("mstyle",[_]),_.setAttribute("scriptlevel","1")),_},Gt=function(m,b){var _=[],w=Hi(m.parser,{cols:_,addJot:!0},"display"),I,U=0,le={type:"ordgroup",mode:m.mode,body:[]},Ee=yr(b[0],"ordgroup");if(Ee){for(var Be="",st=0;st<Ee.body.length;st++){var yt=cr(Ee.body[st],"textord");Be+=yt.text}I=Number(Be),U=I*2}var It=!U;w.body.forEach(function(qr){for(var Ti=1;Ti<qr.length;Ti+=2){var Bi=cr(qr[Ti],"styling"),Li=cr(Bi.body[0],"ordgroup");Li.body.unshift(le)}if(It)U<qr.length&&(U=qr.length);else{var bn=qr.length/2;if(I<bn)throw new E("Too many math in a row: "+("expected "+I+", but got "+bn),qr[0])}});for(var Qt=0;Qt<U;++Qt){var tr="r",Ve=0;Qt%2===1?tr="l":Qt>0&&It&&(Ve=1),_[Qt]={type:"align",align:tr,pregap:Ve,postgap:0}}return w.colSeparationType=It?"align":"alignat",w};oa({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(m,b){var _=$i(b[0]),w=_?[b[0]]:cr(b[0],"ordgroup").body,I=w.map(function(le){var Ee=vi(le),Be=Ee.text;if("lcr".indexOf(Be)!==-1)return{type:"align",align:Be};if(Be==="|")return{type:"separator",separator:"|"};if(Be===":")return{type:"separator",separator:":"};throw new E("Unknown column alignment: "+Be,le)}),U={cols:I,hskipBeforeAndAfter:!0};return Hi(m.parser,U,Qi(m.envName))},htmlBuilder:ji,mathmlBuilder:Bn}),oa({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(m){var b={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[m.envName],_={hskipBeforeAndAfter:!1},w=Hi(m.parser,_,Qi(m.envName));return b?{type:"leftright",mode:m.mode,body:[w],left:b[0],right:b[1],rightColor:void 0}:w},htmlBuilder:ji,mathmlBuilder:Bn}),oa({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(m){var b={arraystretch:.5},_=Hi(m.parser,b,"script");return _.colSeparationType="small",_},htmlBuilder:ji,mathmlBuilder:Bn}),oa({type:"array",names:["subarray"],props:{numArgs:1},handler:function(m,b){var _=$i(b[0]),w=_?[b[0]]:cr(b[0],"ordgroup").body,I=w.map(function(le){var Ee=vi(le),Be=Ee.text;if("lc".indexOf(Be)!==-1)return{type:"align",align:Be};throw new E("Unknown column alignment: "+Be,le)});if(I.length>1)throw new E("{subarray} can contain only one column");var U={cols:I,hskipBeforeAndAfter:!1,arraystretch:.5};if(U=Hi(m.parser,U,"script"),U.body[0].length>1)throw new E("{subarray} can contain only one column");return U},htmlBuilder:ji,mathmlBuilder:Bn}),oa({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(m){var b={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},_=Hi(m.parser,b,Qi(m.envName));return{type:"leftright",mode:m.mode,body:[_],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:ji,mathmlBuilder:Bn}),oa({type:"array",names:["aligned"],props:{numArgs:0},handler:Gt,htmlBuilder:ji,mathmlBuilder:Bn}),oa({type:"array",names:["gathered"],props:{numArgs:0},handler:function(m){var b={cols:[{type:"align",align:"c"}],addJot:!0};return Hi(m.parser,b,"display")},htmlBuilder:ji,mathmlBuilder:Bn}),oa({type:"array",names:["alignedat"],props:{numArgs:1},handler:Gt,htmlBuilder:ji,mathmlBuilder:Bn}),Pr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(m,b){throw new E(m.funcName+" valid only within array environment")}});var _a=aa,wo=_a;Pr({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0];if(I.type!=="ordgroup")throw new E("Invalid environment name",I);for(var U="",le=0;le<I.body.length;++le)U+=cr(I.body[le],"textord").text;if(w==="\\begin"){if(!wo.hasOwnProperty(U))throw new E("No such environment: "+U,I);var Ee=wo[U],Be=_.parseArguments("\\begin{"+U+"}",Ee),st=Be.args,yt=Be.optArgs,It={mode:_.mode,envName:U,parser:_},Qt=Ee.handler(It,st,yt);_.expect("\\end",!1);var tr=_.nextToken,Ve=cr(_.parseFunction(),"environment");if(Ve.name!==U)throw new E("Mismatch: \\begin{"+U+"} matched by \\end{"+Ve.name+"}",tr);return Qt}return{type:"environment",mode:_.mode,name:U,nameGroup:I}}});var So=je.makeSpan;function Eo(H,m){var b=zi(H.body,m,!0);return So([H.mclass],b,m)}function Gs(H,m){var b,_=un(H.body,m);return H.mclass==="minner"?nr.newDocumentFragment(_):(H.mclass==="mord"?H.isCharacterBox?(b=_[0],b.type="mi"):b=new nr.MathNode("mi",_):(H.isCharacterBox?(b=_[0],b.type="mo"):b=new nr.MathNode("mo",_),H.mclass==="mbin"?(b.attributes.lspace="0.22em",b.attributes.rspace="0.22em"):H.mclass==="mpunct"?(b.attributes.lspace="0em",b.attributes.rspace="0.17em"):(H.mclass==="mopen"||H.mclass==="mclose")&&(b.attributes.lspace="0em",b.attributes.rspace="0em")),b)}Pr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0];return{type:"mclass",mode:_.mode,mclass:"m"+w.substr(5),body:Ki(I),isCharacterBox:Z.isCharacterBox(I)}},htmlBuilder:Eo,mathmlBuilder:Gs});var Qs=function(m){var b=m.type==="ordgroup"&&m.body.length?m.body[0]:m;return b.type==="atom"&&(b.family==="bin"||b.family==="rel")?"m"+b.family:"mord"};Pr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(m,b){var _=m.parser;return{type:"mclass",mode:_.mode,mclass:Qs(b[0]),body:[b[1]],isCharacterBox:Z.isCharacterBox(b[1])}}}),Pr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[1],U=b[0],le;w!=="\\stackrel"?le=Qs(I):le="mrel";var Ee={type:"op",mode:I.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:w!=="\\stackrel",body:Ki(I)},Be={type:"supsub",mode:U.mode,base:Ee,sup:w==="\\underset"?null:U,sub:w==="\\underset"?U:null};return{type:"mclass",mode:_.mode,mclass:le,body:[Be],isCharacterBox:Z.isCharacterBox(Be)}},htmlBuilder:Eo,mathmlBuilder:Gs});var rl=function(m,b){var _=m.font,w=b.withFont(_);return Ii(m.body,w)},fu=function(m,b){var _=m.font,w=b.withFont(_);return Fi(m.body,w)},il={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Pr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0],U=w;return U in il&&(U=il[U]),{type:"font",mode:_.mode,font:U.slice(1),body:I}},htmlBuilder:rl,mathmlBuilder:fu}),Pr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(m,b){var _=m.parser,w=b[0],I=Z.isCharacterBox(w);return{type:"mclass",mode:_.mode,mclass:Qs(w),body:[{type:"font",mode:_.mode,font:"boldsymbol",body:w}],isCharacterBox:I}}}),Pr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.parser,w=m.funcName,I=m.breakOnTokenText,U=_.mode,le=_.parseExpression(!0,I),Ee="math"+w.slice(1);return{type:"font",mode:U,font:Ee,body:{type:"ordgroup",mode:_.mode,body:le}}},htmlBuilder:rl,mathmlBuilder:fu});var so=function(m,b){var _=b;return m==="display"?_=_.id>=D.SCRIPT.id?_.text():D.DISPLAY:m==="text"&&_.size===D.DISPLAY.size?_=D.TEXT:m==="script"?_=D.SCRIPT:m==="scriptscript"&&(_=D.SCRIPTSCRIPT),_},Da=function(m,b){var _=so(m.size,b.style),w=_.fracNum(),I=_.fracDen(),U;U=b.havingStyle(w);var le=Ii(m.numer,U,b);if(m.continued){var Ee=8.5/b.fontMetrics().ptPerEm,Be=3.5/b.fontMetrics().ptPerEm;le.height=le.height<Ee?Ee:le.height,le.depth=le.depth<Be?Be:le.depth}U=b.havingStyle(I);var st=Ii(m.denom,U,b),yt,It,Qt;m.hasBarLine?(m.barSize?(It=tt(m.barSize,b),yt=je.makeLineSpan("frac-line",b,It)):yt=je.makeLineSpan("frac-line",b),It=yt.height,Qt=yt.height):(yt=null,It=0,Qt=b.fontMetrics().defaultRuleThickness);var tr,Ve,qr;_.size===D.DISPLAY.size||m.size==="display"?(tr=b.fontMetrics().num1,It>0?Ve=3*Qt:Ve=7*Qt,qr=b.fontMetrics().denom1):(It>0?(tr=b.fontMetrics().num2,Ve=Qt):(tr=b.fontMetrics().num3,Ve=3*Qt),qr=b.fontMetrics().denom2);var Ti;if(yt){var Li=b.fontMetrics().axisHeight;tr-le.depth-(Li+.5*It)<Ve&&(tr+=Ve-(tr-le.depth-(Li+.5*It))),Li-.5*It-(st.height-qr)<Ve&&(qr+=Ve-(Li-.5*It-(st.height-qr)));var bn=-(Li-.5*It);Ti=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:st,shift:qr},{type:"elem",elem:yt,shift:bn},{type:"elem",elem:le,shift:-tr}]},b)}else{var Bi=tr-le.depth-(st.height-qr);Bi<Ve&&(tr+=.5*(Ve-Bi),qr+=.5*(Ve-Bi)),Ti=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:st,shift:qr},{type:"elem",elem:le,shift:-tr}]},b)}U=b.havingStyle(_),Ti.height*=U.sizeMultiplier/b.sizeMultiplier,Ti.depth*=U.sizeMultiplier/b.sizeMultiplier;var hn;_.size===D.DISPLAY.size?hn=b.fontMetrics().delim1:hn=b.fontMetrics().delim2;var Tn,Cn;return m.leftDelim==null?Tn=xn(b,["mopen"]):Tn=ks.customSizedDelim(m.leftDelim,hn,!0,b.havingStyle(_),m.mode,["mopen"]),m.continued?Cn=je.makeSpan([]):m.rightDelim==null?Cn=xn(b,["mclose"]):Cn=ks.customSizedDelim(m.rightDelim,hn,!0,b.havingStyle(_),m.mode,["mclose"]),je.makeSpan(["mord"].concat(U.sizingClasses(b)),[Tn,je.makeSpan(["mfrac"],[Ti]),Cn],b)},Pl=function(m,b){var _=new nr.MathNode("mfrac",[Fi(m.numer,b),Fi(m.denom,b)]);if(!m.hasBarLine)_.setAttribute("linethickness","0px");else if(m.barSize){var w=tt(m.barSize,b);_.setAttribute("linethickness",w+"em")}var I=so(m.size,b.style);if(I.size!==b.style.size){_=new nr.MathNode("mstyle",[_]);var U=I.size===D.DISPLAY.size?"true":"false";_.setAttribute("displaystyle",U),_.setAttribute("scriptlevel","0")}if(m.leftDelim!=null||m.rightDelim!=null){var le=[];if(m.leftDelim!=null){var Ee=new nr.MathNode("mo",[new nr.TextNode(m.leftDelim.replace("\\",""))]);Ee.setAttribute("fence","true"),le.push(Ee)}if(le.push(_),m.rightDelim!=null){var Be=new nr.MathNode("mo",[new nr.TextNode(m.rightDelim.replace("\\",""))]);Be.setAttribute("fence","true"),le.push(Be)}return Ss(le)}return _};Pr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0],U=b[1],le,Ee=null,Be=null,st="auto";switch(w){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":le=!0;break;case"\\\\atopfrac":le=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":le=!1,Ee="(",Be=")";break;case"\\\\bracefrac":le=!1,Ee="\\{",Be="\\}";break;case"\\\\brackfrac":le=!1,Ee="[",Be="]";break;default:throw new Error("Unrecognized genfrac command")}switch(w){case"\\cfrac":case"\\dfrac":case"\\dbinom":st="display";break;case"\\tfrac":case"\\tbinom":st="text";break}return{type:"genfrac",mode:_.mode,continued:w==="\\cfrac",numer:I,denom:U,hasBarLine:le,leftDelim:Ee,rightDelim:Be,size:st,barSize:null}},htmlBuilder:Da,mathmlBuilder:Pl}),Pr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(m){var b=m.parser,_=m.funcName,w=m.token,I;switch(_){case"\\over":I="\\frac";break;case"\\choose":I="\\binom";break;case"\\atop":I="\\\\atopfrac";break;case"\\brace":I="\\\\bracefrac";break;case"\\brack":I="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:b.mode,replaceWith:I,token:w}}});var pu=["display","text","script","scriptscript"],Ao=function(m){var b=null;return m.length>0&&(b=m,b=b==="."?null:b),b};Pr({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(m,b){var _=m.parser,w=b[4],I=b[5],U=yr(b[0],"atom");U&&(U=jr(b[0],"open"));var le=U?Ao(U.text):null,Ee=yr(b[1],"atom");Ee&&(Ee=jr(b[1],"close"));var Be=Ee?Ao(Ee.text):null,st=cr(b[2],"size"),yt,It=null;st.isBlank?yt=!0:(It=st.value,yt=It.number>0);var Qt="auto",tr=yr(b[3],"ordgroup");if(tr){if(tr.body.length>0){var Ve=cr(tr.body[0],"textord");Qt=pu[Number(Ve.text)]}}else tr=cr(b[3],"textord"),Qt=pu[Number(tr.text)];return{type:"genfrac",mode:_.mode,numer:w,denom:I,continued:!1,hasBarLine:yt,barSize:It,leftDelim:le,rightDelim:Be,size:Qt}},htmlBuilder:Da,mathmlBuilder:Pl}),Pr({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(m,b){var _=m.parser,w=m.funcName,I=m.token;return{type:"infix",mode:_.mode,replaceWith:"\\\\abovefrac",size:cr(b[0],"size").value,token:I}}}),Pr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0],U=se(cr(b[1],"infix").size),le=b[2],Ee=U.number>0;return{type:"genfrac",mode:_.mode,numer:I,denom:le,continued:!1,hasBarLine:Ee,barSize:U,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Da,mathmlBuilder:Pl});var mu=function(m,b){var _=b.style,w,I,U=yr(m,"supsub");U?(w=U.sup?Ii(U.sup,b.havingStyle(_.sup()),b):Ii(U.sub,b.havingStyle(_.sub()),b),I=cr(U.base,"horizBrace")):I=cr(m,"horizBrace");var le=Ii(I.base,b.havingBaseStyle(D.DISPLAY)),Ee=Jr.svgSpan(I,b),Be;if(I.isOver?(Be=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:le},{type:"kern",size:.1},{type:"elem",elem:Ee}]},b),Be.children[0].children[0].children[1].classes.push("svg-align")):(Be=je.makeVList({positionType:"bottom",positionData:le.depth+.1+Ee.height,children:[{type:"elem",elem:Ee},{type:"kern",size:.1},{type:"elem",elem:le}]},b),Be.children[0].children[0].children[0].classes.push("svg-align")),w){var st=je.makeSpan(["mord",I.isOver?"mover":"munder"],[Be],b);I.isOver?Be=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:st},{type:"kern",size:.2},{type:"elem",elem:w}]},b):Be=je.makeVList({positionType:"bottom",positionData:st.depth+.2+w.height+w.depth,children:[{type:"elem",elem:w},{type:"kern",size:.2},{type:"elem",elem:st}]},b)}return je.makeSpan(["mord",I.isOver?"mover":"munder"],[Be],b)},gu=function(m,b){var _=Jr.mathMLnode(m.label);return new nr.MathNode(m.isOver?"mover":"munder",[Fi(m.base,b),_])};Pr({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=m.funcName;return{type:"horizBrace",mode:_.mode,label:w,isOver:/^\\over/.test(w),base:b[0]}},htmlBuilder:mu,mathmlBuilder:gu}),Pr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=b[1],I=cr(b[0],"url").url;return _.settings.isTrusted({command:"\\href",url:I})?{type:"href",mode:_.mode,href:I,body:Ki(w)}:_.formatUnsupportedCmd("\\href")},htmlBuilder:function(m,b){var _=zi(m.body,b,!1);return je.makeAnchor(m.href,[],_,b)},mathmlBuilder:function(m,b){var _=cn(m.body,b);return _ instanceof pi||(_=new pi("mrow",[_])),_.setAttribute("href",m.href),_}}),Pr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=cr(b[0],"url").url;if(!_.settings.isTrusted({command:"\\url",url:w}))return _.formatUnsupportedCmd("\\url");for(var I=[],U=0;U<w.length;U++){var le=w[U];le==="~"&&(le="\\textasciitilde"),I.push({type:"textord",mode:"text",text:le})}var Ee={type:"text",mode:_.mode,font:"\\texttt",body:I};return{type:"href",mode:_.mode,href:w,body:Ki(Ee)}}}),Pr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(m,b){var _=m.parser;return{type:"htmlmathml",mode:_.mode,html:Ki(b[0]),mathml:Ki(b[1])}},htmlBuilder:function(m,b){var _=zi(m.html,b,!1);return je.makeFragment(_)},mathmlBuilder:function(m,b){return cn(m.mathml,b)}});var ko=function(m){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(m))return{number:+m,unit:"bp"};var b=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(m);if(!b)throw new E("Invalid size: '"+m+"' in \\includegraphics");var _={number:+(b[1]+b[2]),unit:b[3]};if(!lt(_))throw new E("Invalid unit: '"+_.unit+"' in \\includegraphics.");return _};Pr({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(m,b,_){var w=m.parser,I={number:0,unit:"em"},U={number:.9,unit:"em"},le={number:0,unit:"em"},Ee="";if(_[0])for(var Be=cr(_[0],"raw").string,st=Be.split(","),yt=0;yt<st.length;yt++){var It=st[yt].split("=");if(It.length===2){var Qt=It[1].trim();switch(It[0].trim()){case"alt":Ee=Qt;break;case"width":I=ko(Qt);break;case"height":U=ko(Qt);break;case"totalheight":le=ko(Qt);break;default:throw new E("Invalid key: '"+It[0]+"' in \\includegraphics.")}}}var tr=cr(b[0],"url").url;return Ee===""&&(Ee=tr,Ee=Ee.replace(/^.*[\\/]/,""),Ee=Ee.substring(0,Ee.lastIndexOf("."))),w.settings.isTrusted({command:"\\includegraphics",url:tr})?{type:"includegraphics",mode:w.mode,alt:Ee,width:I,height:U,totalheight:le,src:tr}:w.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(m,b){var _=tt(m.height,b),w=0;m.totalheight.number>0&&(w=tt(m.totalheight,b)-_,w=Number(w.toFixed(2)));var I=0;m.width.number>0&&(I=tt(m.width,b));var U={height:_+w+"em"};I>0&&(U.width=I+"em"),w>0&&(U.verticalAlign=-w+"em");var le=new Dt(m.src,m.alt,U);return le.height=_,le.depth=w,le},mathmlBuilder:function(m,b){var _=new nr.MathNode("mglyph",[]);_.setAttribute("alt",m.alt);var w=tt(m.height,b),I=0;if(m.totalheight.number>0&&(I=tt(m.totalheight,b)-w,I=I.toFixed(2),_.setAttribute("valign","-"+I+"em")),_.setAttribute("height",w+I+"em"),m.width.number>0){var U=tt(m.width,b);_.setAttribute("width",U+"em")}return _.setAttribute("src",m.src),_}}),Pr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=m.funcName,I=cr(b[0],"size");if(_.settings.strict){var U=w[1]==="m",le=I.value.unit==="mu";U?(le||_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+w+" supports only mu units, "+("not "+I.value.unit+" units")),_.mode!=="math"&&_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+w+" works only in math mode")):le&&_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+w+" doesn't support mu units")}return{type:"kern",mode:_.mode,dimension:I.value}},htmlBuilder:function(m,b){return je.makeGlue(m.dimension,b)},mathmlBuilder:function(m,b){var _=tt(m.dimension,b);return new nr.SpaceNode(_)}}),Pr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0];return{type:"lap",mode:_.mode,alignment:w.slice(5),body:I}},htmlBuilder:function(m,b){var _;m.alignment==="clap"?(_=je.makeSpan([],[Ii(m.body,b)]),_=je.makeSpan(["inner"],[_],b)):_=je.makeSpan(["inner"],[Ii(m.body,b)]);var w=je.makeSpan(["fix"],[]),I=je.makeSpan([m.alignment],[_,w],b),U=je.makeSpan(["strut"]);return U.style.height=I.height+I.depth+"em",U.style.verticalAlign=-I.depth+"em",I.children.unshift(U),I=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:I}]},b),je.makeSpan(["mord"],[I],b)},mathmlBuilder:function(m,b){var _=new nr.MathNode("mpadded",[Fi(m.body,b)]);if(m.alignment!=="rlap"){var w=m.alignment==="llap"?"-1":"-0.5";_.setAttribute("lspace",w+"width")}return _.setAttribute("width","0px"),_}}),Pr({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(m,b){var _=m.funcName,w=m.parser,I=w.mode;w.switchMode("math");var U=_==="\\("?"\\)":"$",le=w.parseExpression(!1,U);return w.expect(U),w.switchMode(I),{type:"styling",mode:w.mode,style:"text",body:le}}}),Pr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(m,b){throw new E("Mismatched "+m.funcName)}});var To=function(m,b){switch(b.style.size){case D.DISPLAY.size:return m.display;case D.TEXT.size:return m.text;case D.SCRIPT.size:return m.script;case D.SCRIPTSCRIPT.size:return m.scriptscript;default:return m.text}};Pr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(m,b){var _=m.parser;return{type:"mathchoice",mode:_.mode,display:Ki(b[0]),text:Ki(b[1]),script:Ki(b[2]),scriptscript:Ki(b[3])}},htmlBuilder:function(m,b){var _=To(m,b),w=zi(_,b,!1);return je.makeFragment(w)},mathmlBuilder:function(m,b){var _=To(m,b);return cn(_,b)}});var ao=function(m,b,_,w,I,U,le){m=je.makeSpan([],[m]);var Ee,Be;if(b){var st=Ii(b,w.havingStyle(I.sup()),w);Be={elem:st,kern:Math.max(w.fontMetrics().bigOpSpacing1,w.fontMetrics().bigOpSpacing3-st.depth)}}if(_){var yt=Ii(_,w.havingStyle(I.sub()),w);Ee={elem:yt,kern:Math.max(w.fontMetrics().bigOpSpacing2,w.fontMetrics().bigOpSpacing4-yt.height)}}var It;if(Be&&Ee){var Qt=w.fontMetrics().bigOpSpacing5+Ee.elem.height+Ee.elem.depth+Ee.kern+m.depth+le;It=je.makeVList({positionType:"bottom",positionData:Qt,children:[{type:"kern",size:w.fontMetrics().bigOpSpacing5},{type:"elem",elem:Ee.elem,marginLeft:-U+"em"},{type:"kern",size:Ee.kern},{type:"elem",elem:m},{type:"kern",size:Be.kern},{type:"elem",elem:Be.elem,marginLeft:U+"em"},{type:"kern",size:w.fontMetrics().bigOpSpacing5}]},w)}else if(Ee){var tr=m.height-le;It=je.makeVList({positionType:"top",positionData:tr,children:[{type:"kern",size:w.fontMetrics().bigOpSpacing5},{type:"elem",elem:Ee.elem,marginLeft:-U+"em"},{type:"kern",size:Ee.kern},{type:"elem",elem:m}]},w)}else if(Be){var Ve=m.depth+le;It=je.makeVList({positionType:"bottom",positionData:Ve,children:[{type:"elem",elem:m},{type:"kern",size:Be.kern},{type:"elem",elem:Be.elem,marginLeft:U+"em"},{type:"kern",size:w.fontMetrics().bigOpSpacing5}]},w)}else return m;return je.makeSpan(["mop","op-limits"],[It],w)},ys=["\\smallint"],Bs=function(m,b){var _,w,I=!1,U,le=yr(m,"supsub");le?(_=le.sup,w=le.sub,U=cr(le.base,"op"),I=!0):U=cr(m,"op");var Ee=b.style,Be=!1;Ee.size===D.DISPLAY.size&&U.symbol&&!Z.contains(ys,U.name)&&(Be=!0);var st;if(U.symbol){var yt=Be?"Size2-Regular":"Size1-Regular",It="";if((U.name==="\\oiint"||U.name==="\\oiiint")&&(It=U.name.substr(1),U.name=It==="oiint"?"\\iint":"\\iiint"),st=je.makeSymbol(U.name,yt,"math",b,["mop","op-symbol",Be?"large-op":"small-op"]),It.length>0){var Qt=st.italic,tr=je.staticSvg(It+"Size"+(Be?"2":"1"),b);st=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:st,shift:0},{type:"elem",elem:tr,shift:Be?.08:0}]},b),U.name="\\"+It,st.classes.unshift("mop"),st.italic=Qt}}else if(U.body){var Ve=zi(U.body,b,!0);Ve.length===1&&Ve[0]instanceof Oe?(st=Ve[0],st.classes[0]="mop"):st=je.makeSpan(["mop"],je.tryCombineChars(Ve),b)}else{for(var qr=[],Ti=1;Ti<U.name.length;Ti++)qr.push(je.mathsym(U.name[Ti],U.mode,b));st=je.makeSpan(["mop"],qr,b)}var Bi=0,Li=0;return(st instanceof Oe||U.name==="\\oiint"||U.name==="\\oiiint")&&!U.suppressBaseShift&&(Bi=(st.height-st.depth)/2-b.fontMetrics().axisHeight,Li=st.italic),I?ao(st,_,w,b,Ee,Li,Bi):(Bi&&(st.style.position="relative",st.style.top=Bi+"em"),st)},Vs=function(m,b){var _;if(m.symbol)_=new pi("mo",[mn(m.name,m.mode)]),Z.contains(ys,m.name)&&_.setAttribute("largeop","false");else if(m.body)_=new pi("mo",un(m.body,b));else{_=new pi("mi",[new xs(m.name.slice(1))]);var w=new pi("mo",[mn("\u2061","text")]);m.parentIsSupSub?_=new pi("mo",[_,w]):_=ds([_,w])}return _},Ol={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Pr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:function(m,b){var _=m.parser,w=m.funcName,I=w;return I.length===1&&(I=Ol[I]),{type:"op",mode:_.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:I}},htmlBuilder:Bs,mathmlBuilder:Vs}),Pr({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=b[0];return{type:"op",mode:_.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ki(w)}},htmlBuilder:Bs,mathmlBuilder:Vs});var vu={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Pr({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(m){var b=m.parser,_=m.funcName;return{type:"op",mode:b.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:_}},htmlBuilder:Bs,mathmlBuilder:Vs}),Pr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(m){var b=m.parser,_=m.funcName;return{type:"op",mode:b.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:_}},htmlBuilder:Bs,mathmlBuilder:Vs}),Pr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler:function(m){var b=m.parser,_=m.funcName,w=_;return w.length===1&&(w=vu[w]),{type:"op",mode:b.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:w}},htmlBuilder:Bs,mathmlBuilder:Vs});var Co=function(m,b){var _,w,I=!1,U,le=yr(m,"supsub");le?(_=le.sup,w=le.sub,U=cr(le.base,"operatorname"),I=!0):U=cr(m,"operatorname");var Ee;if(U.body.length>0){for(var Be=U.body.map(function(Qt){var tr=Qt.text;return typeof tr=="string"?{type:"textord",mode:Qt.mode,text:tr}:Qt}),st=zi(Be,b.withFont("mathrm"),!0),yt=0;yt<st.length;yt++){var It=st[yt];It instanceof Oe&&(It.text=It.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}Ee=je.makeSpan(["mop"],st,b)}else Ee=je.makeSpan(["mop"],[],b);return I?ao(Ee,_,w,b,b.style,0,0):Ee},n0=function(m,b){for(var _=un(m.body,b.withFont("mathrm")),w=!0,I=0;I<_.length;I++){var U=_[I];if(!(U instanceof nr.SpaceNode))if(U instanceof nr.MathNode)switch(U.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var le=U.children[0];U.children.length===1&&le instanceof nr.TextNode?le.text=le.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):w=!1;break}default:w=!1}else w=!1}if(w){var Ee=_.map(function(yt){return yt.toText()}).join("");_=[new nr.TextNode(Ee)]}var Be=new nr.MathNode("mi",_);Be.setAttribute("mathvariant","normal");var st=new nr.MathNode("mo",[mn("\u2061","text")]);return m.parentIsSupSub?new nr.MathNode("mo",[Be,st]):nr.newDocumentFragment([Be,st])};Pr({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0];return{type:"operatorname",mode:_.mode,body:Ki(I),alwaysHandleSupSub:w==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:Co,mathmlBuilder:n0}),ki({type:"ordgroup",htmlBuilder:function(m,b){return m.semisimple?je.makeFragment(zi(m.body,b,!1)):je.makeSpan(["mord"],zi(m.body,b,!0),b)},mathmlBuilder:function(m,b){return cn(m.body,b,!0)}}),Pr({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=b[0];return{type:"overline",mode:_.mode,body:w}},htmlBuilder:function(m,b){var _=Ii(m.body,b.havingCrampedStyle()),w=je.makeLineSpan("overline-line",b),I=b.fontMetrics().defaultRuleThickness,U=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_},{type:"kern",size:3*I},{type:"elem",elem:w},{type:"kern",size:I}]},b);return je.makeSpan(["mord","overline"],[U],b)},mathmlBuilder:function(m,b){var _=new nr.MathNode("mo",[new nr.TextNode("\u203E")]);_.setAttribute("stretchy","true");var w=new nr.MathNode("mover",[Fi(m.body,b),_]);return w.setAttribute("accent","true"),w}}),Pr({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,w=b[0];return{type:"phantom",mode:_.mode,body:Ki(w)}},htmlBuilder:function(m,b){var _=zi(m.body,b.withPhantom(),!1);return je.makeFragment(_)},mathmlBuilder:function(m,b){var _=un(m.body,b);return new nr.MathNode("mphantom",_)}}),Pr({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,w=b[0];return{type:"hphantom",mode:_.mode,body:w}},htmlBuilder:function(m,b){var _=je.makeSpan([],[Ii(m.body,b.withPhantom())]);if(_.height=0,_.depth=0,_.children)for(var w=0;w<_.children.length;w++)_.children[w].height=0,_.children[w].depth=0;return _=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_}]},b),je.makeSpan(["mord"],[_],b)},mathmlBuilder:function(m,b){var _=un(Ki(m.body),b),w=new nr.MathNode("mphantom",_),I=new nr.MathNode("mpadded",[w]);return I.setAttribute("height","0px"),I.setAttribute("depth","0px"),I}}),Pr({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,w=b[0];return{type:"vphantom",mode:_.mode,body:w}},htmlBuilder:function(m,b){var _=je.makeSpan(["inner"],[Ii(m.body,b.withPhantom())]),w=je.makeSpan(["fix"],[]);return je.makeSpan(["mord","rlap"],[_,w],b)},mathmlBuilder:function(m,b){var _=un(Ki(m.body),b),w=new nr.MathNode("mphantom",_),I=new nr.MathNode("mpadded",[w]);return I.setAttribute("width","0px"),I}}),Pr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=cr(b[0],"size").value,I=b[1];return{type:"raisebox",mode:_.mode,dy:w,body:I}},htmlBuilder:function(m,b){var _=Ii(m.body,b),w=tt(m.dy,b);return je.makeVList({positionType:"shift",positionData:-w,children:[{type:"elem",elem:_}]},b)},mathmlBuilder:function(m,b){var _=new nr.MathNode("mpadded",[Fi(m.body,b)]),w=m.dy.number+m.dy.unit;return _.setAttribute("voffset",w),_}}),Pr({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(m,b,_){var w=m.parser,I=_[0],U=cr(b[0],"size"),le=cr(b[1],"size");return{type:"rule",mode:w.mode,shift:I&&cr(I,"size").value,width:U.value,height:le.value}},htmlBuilder:function(m,b){var _=je.makeSpan(["mord","rule"],[],b),w=tt(m.width,b),I=tt(m.height,b),U=m.shift?tt(m.shift,b):0;return _.style.borderRightWidth=w+"em",_.style.borderTopWidth=I+"em",_.style.bottom=U+"em",_.width=w,_.height=I+U,_.depth=-U,_.maxFontSize=I*1.125*b.sizeMultiplier,_},mathmlBuilder:function(m,b){var _=tt(m.width,b),w=tt(m.height,b),I=m.shift?tt(m.shift,b):0,U=b.color&&b.getColor()||"black",le=new nr.MathNode("mspace");le.setAttribute("mathbackground",U),le.setAttribute("width",_+"em"),le.setAttribute("height",w+"em");var Ee=new nr.MathNode("mpadded",[le]);return I>=0?Ee.setAttribute("height","+"+I+"em"):(Ee.setAttribute("height",I+"em"),Ee.setAttribute("depth","+"+-I+"em")),Ee.setAttribute("voffset",I+"em"),Ee}});function Bl(H,m,b){for(var _=zi(H,m,!1),w=m.sizeMultiplier/b.sizeMultiplier,I=0;I<_.length;I++){var U=_[I].classes.indexOf("sizing");U<0?Array.prototype.push.apply(_[I].classes,m.sizingClasses(b)):_[I].classes[U+1]==="reset-size"+m.size&&(_[I].classes[U+1]="reset-size"+b.size),_[I].height*=w,_[I].depth*=w}return je.makeFragment(_)}var Fl=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],yu=function(m,b){var _=b.havingSize(m.size);return Bl(m.body,_,b)};Pr({type:"sizing",names:Fl,props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.breakOnTokenText,w=m.funcName,I=m.parser,U=I.parseExpression(!1,_);return{type:"sizing",mode:I.mode,size:Fl.indexOf(w)+1,body:U}},htmlBuilder:yu,mathmlBuilder:function(m,b){var _=b.havingSize(m.size),w=un(m.body,_),I=new nr.MathNode("mstyle",w);return I.setAttribute("mathsize",_.sizeMultiplier+"em"),I}}),Pr({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(m,b,_){var w=m.parser,I=!1,U=!1,le=_[0]&&cr(_[0],"ordgroup");if(le)for(var Ee="",Be=0;Be<le.body.length;++Be){var st=le.body[Be];if(Ee=st.text,Ee==="t")I=!0;else if(Ee==="b")U=!0;else{I=!1,U=!1;break}}else I=!0,U=!0;var yt=b[0];return{type:"smash",mode:w.mode,body:yt,smashHeight:I,smashDepth:U}},htmlBuilder:function(m,b){var _=je.makeSpan([],[Ii(m.body,b)]);if(!m.smashHeight&&!m.smashDepth)return _;if(m.smashHeight&&(_.height=0,_.children))for(var w=0;w<_.children.length;w++)_.children[w].height=0;if(m.smashDepth&&(_.depth=0,_.children))for(var I=0;I<_.children.length;I++)_.children[I].depth=0;var U=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_}]},b);return je.makeSpan(["mord"],[U],b)},mathmlBuilder:function(m,b){var _=new nr.MathNode("mpadded",[Fi(m.body,b)]);return m.smashHeight&&_.setAttribute("height","0px"),m.smashDepth&&_.setAttribute("depth","0px"),_}}),Pr({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(m,b,_){var w=m.parser,I=_[0],U=b[0];return{type:"sqrt",mode:w.mode,body:U,index:I}},htmlBuilder:function(m,b){var _=Ii(m.body,b.havingCrampedStyle());_.height===0&&(_.height=b.fontMetrics().xHeight),_=je.wrapFragment(_,b);var w=b.fontMetrics(),I=w.defaultRuleThickness,U=I;b.style.id<D.TEXT.id&&(U=b.fontMetrics().xHeight);var le=I+U/4,Ee=_.height+_.depth+le+I,Be=ks.sqrtImage(Ee,b),st=Be.span,yt=Be.ruleWidth,It=Be.advanceWidth,Qt=st.height-yt;Qt>_.height+_.depth+le&&(le=(le+Qt-_.height-_.depth)/2);var tr=st.height-_.height-le-yt;_.style.paddingLeft=It+"em";var Ve=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_,wrapperClasses:["svg-align"]},{type:"kern",size:-(_.height+tr)},{type:"elem",elem:st},{type:"kern",size:yt}]},b);if(m.index){var qr=b.havingStyle(D.SCRIPTSCRIPT),Ti=Ii(m.index,qr,b),Bi=.6*(Ve.height-Ve.depth),Li=je.makeVList({positionType:"shift",positionData:-Bi,children:[{type:"elem",elem:Ti}]},b),bn=je.makeSpan(["root"],[Li]);return je.makeSpan(["mord","sqrt"],[bn,Ve],b)}else return je.makeSpan(["mord","sqrt"],[Ve],b)},mathmlBuilder:function(m,b){var _=m.body,w=m.index;return w?new nr.MathNode("mroot",[Fi(_,b),Fi(w,b)]):new nr.MathNode("msqrt",[Fi(_,b)])}});var bu={display:D.DISPLAY,text:D.TEXT,script:D.SCRIPT,scriptscript:D.SCRIPTSCRIPT};Pr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.breakOnTokenText,w=m.funcName,I=m.parser,U=I.parseExpression(!0,_),le=w.slice(1,w.length-5);return{type:"styling",mode:I.mode,style:le,body:U}},htmlBuilder:function(m,b){var _=bu[m.style],w=b.havingStyle(_).withFont("");return Bl(m.body,w,b)},mathmlBuilder:function(m,b){var _=bu[m.style],w=b.havingStyle(_),I=un(m.body,w),U=new nr.MathNode("mstyle",I),le={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},Ee=le[m.style];return U.setAttribute("scriptlevel",Ee[0]),U.setAttribute("displaystyle",Ee[1]),U}});var nl=function(m,b){var _=m.base;if(_)if(_.type==="op"){var w=_.limits&&(b.style.size===D.DISPLAY.size||_.alwaysHandleSupSub);return w?Bs:null}else if(_.type==="operatorname"){var I=_.alwaysHandleSupSub&&(b.style.size===D.DISPLAY.size||_.limits);return I?Co:null}else{if(_.type==="accent")return Z.isCharacterBox(_.base)?yn:null;if(_.type==="horizBrace"){var U=!m.sub;return U===_.isOver?mu:null}else return null}else return null};ki({type:"supsub",htmlBuilder:function(m,b){var _=nl(m,b);if(_)return _(m,b);var w=m.base,I=m.sup,U=m.sub,le=Ii(w,b),Ee,Be,st=b.fontMetrics(),yt=0,It=0,Qt=w&&Z.isCharacterBox(w);if(I){var tr=b.havingStyle(b.style.sup());Ee=Ii(I,tr,b),Qt||(yt=le.height-tr.fontMetrics().supDrop*tr.sizeMultiplier/b.sizeMultiplier)}if(U){var Ve=b.havingStyle(b.style.sub());Be=Ii(U,Ve,b),Qt||(It=le.depth+Ve.fontMetrics().subDrop*Ve.sizeMultiplier/b.sizeMultiplier)}var qr;b.style===D.DISPLAY?qr=st.sup1:b.style.cramped?qr=st.sup3:qr=st.sup2;var Ti=b.sizeMultiplier,Bi=.5/st.ptPerEm/Ti+"em",Li=null;if(Be){var bn=m.base&&m.base.type==="op"&&m.base.name&&(m.base.name==="\\oiint"||m.base.name==="\\oiiint");(le instanceof Oe||bn)&&(Li=-le.italic+"em")}var hn;if(Ee&&Be){yt=Math.max(yt,qr,Ee.depth+.25*st.xHeight),It=Math.max(It,st.sub2);var Tn=st.defaultRuleThickness,Cn=4*Tn;if(yt-Ee.depth-(Be.height-It)<Cn){It=Cn-(yt-Ee.depth)+Be.height;var jn=.8*st.xHeight-(yt-Ee.depth);jn>0&&(yt+=jn,It-=jn)}var qn=[{type:"elem",elem:Be,shift:It,marginRight:Bi,marginLeft:Li},{type:"elem",elem:Ee,shift:-yt,marginRight:Bi}];hn=je.makeVList({positionType:"individualShift",children:qn},b)}else if(Be){It=Math.max(It,st.sub1,Be.height-.8*st.xHeight);var Qn=[{type:"elem",elem:Be,marginLeft:Li,marginRight:Bi}];hn=je.makeVList({positionType:"shift",positionData:It,children:Qn},b)}else if(Ee)yt=Math.max(yt,qr,Ee.depth+.25*st.xHeight),hn=je.makeVList({positionType:"shift",positionData:-yt,children:[{type:"elem",elem:Ee,marginRight:Bi}]},b);else throw new Error("supsub must have either sup or sub.");var gn=Xn(le,"right")||"mord";return je.makeSpan([gn],[le,je.makeSpan(["msupsub"],[hn])],b)},mathmlBuilder:function(m,b){var _=!1,w,I,U=yr(m.base,"horizBrace");U&&(I=!!m.sup,I===U.isOver&&(_=!0,w=U.isOver)),m.base&&(m.base.type==="op"||m.base.type==="operatorname")&&(m.base.parentIsSupSub=!0);var le=[Fi(m.base,b)];m.sub&&le.push(Fi(m.sub,b)),m.sup&&le.push(Fi(m.sup,b));var Ee;if(_)Ee=w?"mover":"munder";else if(m.sub)if(m.sup){var yt=m.base;yt&&yt.type==="op"&&yt.limits&&b.style===D.DISPLAY||yt&&yt.type==="operatorname"&&yt.alwaysHandleSupSub&&(b.style===D.DISPLAY||yt.limits)?Ee="munderover":Ee="msubsup"}else{var st=m.base;st&&st.type==="op"&&st.limits&&(b.style===D.DISPLAY||st.alwaysHandleSupSub)||st&&st.type==="operatorname"&&st.alwaysHandleSupSub&&(st.limits||b.style===D.DISPLAY)?Ee="munder":Ee="msub"}else{var Be=m.base;Be&&Be.type==="op"&&Be.limits&&(b.style===D.DISPLAY||Be.alwaysHandleSupSub)||Be&&Be.type==="operatorname"&&Be.alwaysHandleSupSub&&(Be.limits||b.style===D.DISPLAY)?Ee="mover":Ee="msup"}var It=new nr.MathNode(Ee,le);return It}}),ki({type:"atom",htmlBuilder:function(m,b){return je.mathsym(m.text,m.mode,b,["m"+m.family])},mathmlBuilder:function(m,b){var _=new nr.MathNode("mo",[mn(m.text,m.mode)]);if(m.family==="bin"){var w=fs(m,b);w==="bold-italic"&&_.setAttribute("mathvariant",w)}else m.family==="punct"?_.setAttribute("separator","true"):(m.family==="open"||m.family==="close")&&_.setAttribute("stretchy","false");return _}});var _u={mi:"italic",mn:"normal",mtext:"normal"};ki({type:"mathord",htmlBuilder:function(m,b){return je.makeOrd(m,b,"mathord")},mathmlBuilder:function(m,b){var _=new nr.MathNode("mi",[mn(m.text,m.mode,b)]),w=fs(m,b)||"italic";return w!==_u[_.type]&&_.setAttribute("mathvariant",w),_}}),ki({type:"textord",htmlBuilder:function(m,b){return je.makeOrd(m,b,"textord")},mathmlBuilder:function(m,b){var _=mn(m.text,m.mode,b),w=fs(m,b)||"normal",I;return m.mode==="text"?I=new nr.MathNode("mtext",[_]):/[0-9]/.test(m.text)?I=new nr.MathNode("mn",[_]):m.text==="\\prime"?I=new nr.MathNode("mo",[_]):I=new nr.MathNode("mi",[_]),w!==_u[I.type]&&I.setAttribute("mathvariant",w),I}});var Nl={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},sl={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ki({type:"spacing",htmlBuilder:function(m,b){if(sl.hasOwnProperty(m.text)){var _=sl[m.text].className||"";if(m.mode==="text"){var w=je.makeOrd(m,b,"textord");return w.classes.push(_),w}else return je.makeSpan(["mspace",_],[je.mathsym(m.text,m.mode,b)],b)}else{if(Nl.hasOwnProperty(m.text))return je.makeSpan(["mspace",Nl[m.text]],[],b);throw new E('Unknown type of space "'+m.text+'"')}},mathmlBuilder:function(m,b){var _;if(sl.hasOwnProperty(m.text))_=new nr.MathNode("mtext",[new nr.TextNode("\xA0")]);else{if(Nl.hasOwnProperty(m.text))return new nr.MathNode("mspace");throw new E('Unknown type of space "'+m.text+'"')}return _}});var $l=function(){var m=new nr.MathNode("mtd",[]);return m.setAttribute("width","50%"),m};ki({type:"tag",mathmlBuilder:function(m,b){var _=new nr.MathNode("mtable",[new nr.MathNode("mtr",[$l(),new nr.MathNode("mtd",[cn(m.body,b)]),$l(),new nr.MathNode("mtd",[cn(m.tag,b)])])]);return _.setAttribute("width","100%"),_}});var la={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},al={"\\textbf":"textbf","\\textmd":"textmd"},xu={"\\textit":"textit","\\textup":"textup"},wu=function(m,b){var _=m.font;return _?la[_]?b.withTextFontFamily(la[_]):al[_]?b.withTextFontWeight(al[_]):b.withTextFontShape(xu[_]):b};Pr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(m,b){var _=m.parser,w=m.funcName,I=b[0];return{type:"text",mode:_.mode,body:Ki(I),font:w}},htmlBuilder:function(m,b){var _=wu(m,b),w=zi(m.body,_,!0);return je.makeSpan(["mord","text"],je.tryCombineChars(w),_)},mathmlBuilder:function(m,b){var _=wu(m,b);return cn(m.body,_)}}),Pr({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser;return{type:"underline",mode:_.mode,body:b[0]}},htmlBuilder:function(m,b){var _=Ii(m.body,b),w=je.makeLineSpan("underline-line",b),I=b.fontMetrics().defaultRuleThickness,U=je.makeVList({positionType:"top",positionData:_.height,children:[{type:"kern",size:I},{type:"elem",elem:w},{type:"kern",size:3*I},{type:"elem",elem:_}]},b);return je.makeSpan(["mord","underline"],[U],b)},mathmlBuilder:function(m,b){var _=new nr.MathNode("mo",[new nr.TextNode("\u203E")]);_.setAttribute("stretchy","true");var w=new nr.MathNode("munder",[Fi(m.body,b),_]);return w.setAttribute("accentunder","true"),w}}),Pr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(m,b,_){throw new E("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(m,b){for(var _=Su(m),w=[],I=b.havingStyle(b.style.text()),U=0;U<_.length;U++){var le=_[U];le==="~"&&(le="\\textasciitilde"),w.push(je.makeSymbol(le,"Typewriter-Regular",m.mode,I,["mord","texttt"]))}return je.makeSpan(["mord","text"].concat(I.sizingClasses(b)),je.tryCombineChars(w),I)},mathmlBuilder:function(m,b){var _=new nr.TextNode(Su(m)),w=new nr.MathNode("mtext",[_]);return w.setAttribute("mathvariant","monospace"),w}});var Su=function(m){return m.body.replace(/ /g,m.star?"\u2423":"\xA0")},zl=Yn,Do=zl,ol=`[ \r
]`,Eu="\\\\[a-zA-Z@]+",s0="\\\\[^\uD800-\uDFFF]",a0=""+Eu+ol+"*",o0=new RegExp("^("+Eu+")"+ol+"*$"),oo="[\u0300-\u036F]",l0=new RegExp(oo+"+$"),ua="("+ol+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(oo+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(oo+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+a0)+("|"+s0+")"),ll=function(){function H(b,_){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=b,this.settings=_,this.tokenRegex=new RegExp(ua,"g"),this.catcodes={"%":14}}var m=H.prototype;return m.setCatcode=function(_,w){this.catcodes[_]=w},m.lex=function(){var _=this.input,w=this.tokenRegex.lastIndex;if(w===_.length)return new Le("EOF",new rt(this,w,w));var I=this.tokenRegex.exec(_);if(I===null||I.index!==w)throw new E("Unexpected character: '"+_[w]+"'",new Le(_[w],new rt(this,w,w+1)));var U=I[2]||" ";if(this.catcodes[U]===14){var le=_.indexOf(`
`,this.tokenRegex.lastIndex);return le===-1?(this.tokenRegex.lastIndex=_.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=le+1,this.lex()}var Ee=U.match(o0);return Ee&&(U=Ee[1]),new Le(U,new rt(this,w,this.tokenRegex.lastIndex))},H}(),Ma=function(){function H(b,_){b===void 0&&(b={}),_===void 0&&(_={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=_,this.builtins=b,this.undefStack=[]}var m=H.prototype;return m.beginGroup=function(){this.undefStack.push({})},m.endGroup=function(){if(this.undefStack.length===0)throw new E("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var _=this.undefStack.pop();for(var w in _)_.hasOwnProperty(w)&&(_[w]===void 0?delete this.current[w]:this.current[w]=_[w])},m.has=function(_){return this.current.hasOwnProperty(_)||this.builtins.hasOwnProperty(_)},m.get=function(_){return this.current.hasOwnProperty(_)?this.current[_]:this.builtins[_]},m.set=function(_,w,I){if(I===void 0&&(I=!1),I){for(var U=0;U<this.undefStack.length;U++)delete this.undefStack[U][_];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][_]=w)}else{var le=this.undefStack[this.undefStack.length-1];le&&!le.hasOwnProperty(_)&&(le[_]=this.current[_])}this.current[_]=w},H}(),ul={},Fs=ul;function ke(H,m){ul[H]=m}ke("\\@firstoftwo",function(H){var m=H.consumeArgs(2);return{tokens:m[0],numArgs:0}}),ke("\\@secondoftwo",function(H){var m=H.consumeArgs(2);return{tokens:m[1],numArgs:0}}),ke("\\@ifnextchar",function(H){var m=H.consumeArgs(3),b=H.future();return m[0].length===1&&m[0][0].text===b.text?{tokens:m[1],numArgs:0}:{tokens:m[2],numArgs:0}}),ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ke("\\TextOrMath",function(H){var m=H.consumeArgs(2);return H.mode==="text"?{tokens:m[0],numArgs:0}:{tokens:m[1],numArgs:0}});var cl={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};ke("\\char",function(H){var m=H.popToken(),b,_="";if(m.text==="'")b=8,m=H.popToken();else if(m.text==='"')b=16,m=H.popToken();else if(m.text==="`")if(m=H.popToken(),m.text[0]==="\\")_=m.text.charCodeAt(1);else{if(m.text==="EOF")throw new E("\\char` missing argument");_=m.text.charCodeAt(0)}else b=10;if(b){if(_=cl[m.text],_==null||_>=b)throw new E("Invalid base-"+b+" digit "+m.text);for(var w;(w=cl[H.future().text])!=null&&w<b;)_*=b,_+=w,H.popToken()}return"\\@char{"+_+"}"});var hl=function(m,b){var _=m.consumeArgs(1)[0];if(_.length!==1)throw new E("\\gdef's first argument must be a macro name");var w=_[0].text,I=0;for(_=m.consumeArgs(1)[0];_.length===1&&_[0].text==="#";){if(_=m.consumeArgs(1)[0],_.length!==1)throw new E('Invalid argument number length "'+_.length+'"');if(!/^[1-9]$/.test(_[0].text))throw new E('Invalid argument number "'+_[0].text+'"');if(I++,parseInt(_[0].text)!==I)throw new E('Argument number "'+_[0].text+'" out of order');_=m.consumeArgs(1)[0]}return m.macros.set(w,{tokens:_,numArgs:I},b),""};ke("\\gdef",function(H){return hl(H,!0)}),ke("\\def",function(H){return hl(H,!1)}),ke("\\global",function(H){var m=H.consumeArgs(1)[0];if(m.length!==1)throw new E("Invalid command after \\global");var b=m[0].text;if(b==="\\def")return hl(H,!0);throw new E("Invalid command '"+b+"' after \\global")});var lo=function(m,b,_){var w=m.consumeArgs(1)[0];if(w.length!==1)throw new E("\\newcommand's first argument must be a macro name");var I=w[0].text,U=m.isDefined(I);if(U&&!b)throw new E("\\newcommand{"+I+"} attempting to redefine "+(I+"; use \\renewcommand"));if(!U&&!_)throw new E("\\renewcommand{"+I+"} when command "+I+" does not yet exist; use \\newcommand");var le=0;if(w=m.consumeArgs(1)[0],w.length===1&&w[0].text==="["){for(var Ee="",Be=m.expandNextToken();Be.text!=="]"&&Be.text!=="EOF";)Ee+=Be.text,Be=m.expandNextToken();if(!Ee.match(/^\s*[0-9]+\s*$/))throw new E("Invalid number of arguments: "+Ee);le=parseInt(Ee),w=m.consumeArgs(1)[0]}return m.macros.set(I,{tokens:w,numArgs:le}),""};ke("\\newcommand",function(H){return lo(H,!1,!0)}),ke("\\renewcommand",function(H){return lo(H,!0,!1)}),ke("\\providecommand",function(H){return lo(H,!0,!0)}),ke("\\bgroup","{"),ke("\\egroup","}"),ke("\\lq","`"),ke("\\rq","'"),ke("\\aa","\\r a"),ke("\\AA","\\r A"),ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),ke("\u212C","\\mathscr{B}"),ke("\u2130","\\mathscr{E}"),ke("\u2131","\\mathscr{F}"),ke("\u210B","\\mathscr{H}"),ke("\u2110","\\mathscr{I}"),ke("\u2112","\\mathscr{L}"),ke("\u2133","\\mathscr{M}"),ke("\u211B","\\mathscr{R}"),ke("\u212D","\\mathfrak{C}"),ke("\u210C","\\mathfrak{H}"),ke("\u2128","\\mathfrak{Z}"),ke("\\Bbbk","\\Bbb{k}"),ke("\xB7","\\cdotp"),ke("\\llap","\\mathllap{\\textrm{#1}}"),ke("\\rlap","\\mathrlap{\\textrm{#1}}"),ke("\\clap","\\mathclap{\\textrm{#1}}"),ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),ke("\\ne","\\neq"),ke("\u2260","\\neq"),ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),ke("\u2209","\\notin"),ke("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),ke("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),ke("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),ke("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),ke("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),ke("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),ke("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),ke("\u27C2","\\perp"),ke("\u203C","\\mathclose{!\\mkern-0.8mu!}"),ke("\u220C","\\notni"),ke("\u231C","\\ulcorner"),ke("\u231D","\\urcorner"),ke("\u231E","\\llcorner"),ke("\u231F","\\lrcorner"),ke("\xA9","\\copyright"),ke("\xAE","\\textregistered"),ke("\uFE0F","\\textregistered"),ke("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),ke("\u22EE","\\vdots"),ke("\\varGamma","\\mathit{\\Gamma}"),ke("\\varDelta","\\mathit{\\Delta}"),ke("\\varTheta","\\mathit{\\Theta}"),ke("\\varLambda","\\mathit{\\Lambda}"),ke("\\varXi","\\mathit{\\Xi}"),ke("\\varPi","\\mathit{\\Pi}"),ke("\\varSigma","\\mathit{\\Sigma}"),ke("\\varUpsilon","\\mathit{\\Upsilon}"),ke("\\varPhi","\\mathit{\\Phi}"),ke("\\varPsi","\\mathit{\\Psi}"),ke("\\varOmega","\\mathit{\\Omega}"),ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),ke("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Au={",":"\\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"};ke("\\dots",function(H){var m="\\dotso",b=H.expandAfterFuture().text;return b in Au?m=Au[b]:(b.substr(0,4)==="\\not"||b in rr.math&&Z.contains(["bin","rel"],rr.math[b].group))&&(m="\\dotsb"),m});var Ul={")":!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};ke("\\dotso",function(H){var m=H.future().text;return m in Ul?"\\ldots\\,":"\\ldots"}),ke("\\dotsc",function(H){var m=H.future().text;return m in Ul&&m!==","?"\\ldots\\,":"\\ldots"}),ke("\\cdots",function(H){var m=H.future().text;return m in Ul?"\\@cdots\\,":"\\@cdots"}),ke("\\dotsb","\\cdots"),ke("\\dotsm","\\cdots"),ke("\\dotsi","\\!\\cdots"),ke("\\dotsx","\\ldots\\,"),ke("\\DOTSI","\\relax"),ke("\\DOTSB","\\relax"),ke("\\DOTSX","\\relax"),ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ke("\\,","\\tmspace+{3mu}{.1667em}"),ke("\\thinspace","\\,"),ke("\\>","\\mskip{4mu}"),ke("\\:","\\tmspace+{4mu}{.2222em}"),ke("\\medspace","\\:"),ke("\\;","\\tmspace+{5mu}{.2777em}"),ke("\\thickspace","\\;"),ke("\\!","\\tmspace-{3mu}{.1667em}"),ke("\\negthinspace","\\!"),ke("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ke("\\negthickspace","\\tmspace-{5mu}{.277em}"),ke("\\enspace","\\kern.5em "),ke("\\enskip","\\hskip.5em\\relax"),ke("\\quad","\\hskip1em\\relax"),ke("\\qquad","\\hskip2em\\relax"),ke("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ke("\\tag@paren","\\tag@literal{({#1})}"),ke("\\tag@literal",function(H){if(H.macros.get("\\df@tag"))throw new E("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ke("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),ke("\\\\","\\newline"),ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var ku=Xt["Main-Regular"][84][1]-.7*Xt["Main-Regular"][65][1]+"em";ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+ku+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+ku+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ke("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ke("\\@hspace","\\hskip #1\\relax"),ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ke("\\ordinarycolon",":"),ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ke("\u2237","\\dblcolon"),ke("\u2239","\\eqcolon"),ke("\u2254","\\coloneqq"),ke("\u2255","\\eqqcolon"),ke("\u2A74","\\Coloneqq"),ke("\\ratio","\\vcentcolon"),ke("\\coloncolon","\\dblcolon"),ke("\\colonequals","\\coloneqq"),ke("\\coloncolonequals","\\Coloneqq"),ke("\\equalscolon","\\eqqcolon"),ke("\\equalscoloncolon","\\Eqqcolon"),ke("\\colonminus","\\coloneq"),ke("\\coloncolonminus","\\Coloneq"),ke("\\minuscolon","\\eqcolon"),ke("\\minuscoloncolon","\\Eqcolon"),ke("\\coloncolonapprox","\\Colonapprox"),ke("\\coloncolonsim","\\Colonsim"),ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),ke("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),ke("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),ke("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),ke("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),ke("\u27E6","\\llbracket"),ke("\u27E7","\\rrbracket"),ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),ke("\u2983","\\lBrace"),ke("\u2984","\\rBrace"),ke("\\darr","\\downarrow"),ke("\\dArr","\\Downarrow"),ke("\\Darr","\\Downarrow"),ke("\\lang","\\langle"),ke("\\rang","\\rangle"),ke("\\uarr","\\uparrow"),ke("\\uArr","\\Uparrow"),ke("\\Uarr","\\Uparrow"),ke("\\N","\\mathbb{N}"),ke("\\R","\\mathbb{R}"),ke("\\Z","\\mathbb{Z}"),ke("\\alef","\\aleph"),ke("\\alefsym","\\aleph"),ke("\\Alpha","\\mathrm{A}"),ke("\\Beta","\\mathrm{B}"),ke("\\bull","\\bullet"),ke("\\Chi","\\mathrm{X}"),ke("\\clubs","\\clubsuit"),ke("\\cnums","\\mathbb{C}"),ke("\\Complex","\\mathbb{C}"),ke("\\Dagger","\\ddagger"),ke("\\diamonds","\\diamondsuit"),ke("\\empty","\\emptyset"),ke("\\Epsilon","\\mathrm{E}"),ke("\\Eta","\\mathrm{H}"),ke("\\exist","\\exists"),ke("\\harr","\\leftrightarrow"),ke("\\hArr","\\Leftrightarrow"),ke("\\Harr","\\Leftrightarrow"),ke("\\hearts","\\heartsuit"),ke("\\image","\\Im"),ke("\\infin","\\infty"),ke("\\Iota","\\mathrm{I}"),ke("\\isin","\\in"),ke("\\Kappa","\\mathrm{K}"),ke("\\larr","\\leftarrow"),ke("\\lArr","\\Leftarrow"),ke("\\Larr","\\Leftarrow"),ke("\\lrarr","\\leftrightarrow"),ke("\\lrArr","\\Leftrightarrow"),ke("\\Lrarr","\\Leftrightarrow"),ke("\\Mu","\\mathrm{M}"),ke("\\natnums","\\mathbb{N}"),ke("\\Nu","\\mathrm{N}"),ke("\\Omicron","\\mathrm{O}"),ke("\\plusmn","\\pm"),ke("\\rarr","\\rightarrow"),ke("\\rArr","\\Rightarrow"),ke("\\Rarr","\\Rightarrow"),ke("\\real","\\Re"),ke("\\reals","\\mathbb{R}"),ke("\\Reals","\\mathbb{R}"),ke("\\Rho","\\mathrm{P}"),ke("\\sdot","\\cdot"),ke("\\sect","\\S"),ke("\\spades","\\spadesuit"),ke("\\sub","\\subset"),ke("\\sube","\\subseteq"),ke("\\supe","\\supseteq"),ke("\\Tau","\\mathrm{T}"),ke("\\thetasym","\\vartheta"),ke("\\weierp","\\wp"),ke("\\Zeta","\\mathrm{Z}"),ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ke("\\blue","\\textcolor{##6495ed}{#1}"),ke("\\orange","\\textcolor{##ffa500}{#1}"),ke("\\pink","\\textcolor{##ff00af}{#1}"),ke("\\red","\\textcolor{##df0030}{#1}"),ke("\\green","\\textcolor{##28ae7b}{#1}"),ke("\\gray","\\textcolor{gray}{#1}"),ke("\\purple","\\textcolor{##9d38bd}{#1}"),ke("\\blueA","\\textcolor{##ccfaff}{#1}"),ke("\\blueB","\\textcolor{##80f6ff}{#1}"),ke("\\blueC","\\textcolor{##63d9ea}{#1}"),ke("\\blueD","\\textcolor{##11accd}{#1}"),ke("\\blueE","\\textcolor{##0c7f99}{#1}"),ke("\\tealA","\\textcolor{##94fff5}{#1}"),ke("\\tealB","\\textcolor{##26edd5}{#1}"),ke("\\tealC","\\textcolor{##01d1c1}{#1}"),ke("\\tealD","\\textcolor{##01a995}{#1}"),ke("\\tealE","\\textcolor{##208170}{#1}"),ke("\\greenA","\\textcolor{##b6ffb0}{#1}"),ke("\\greenB","\\textcolor{##8af281}{#1}"),ke("\\greenC","\\textcolor{##74cf70}{#1}"),ke("\\greenD","\\textcolor{##1fab54}{#1}"),ke("\\greenE","\\textcolor{##0d923f}{#1}"),ke("\\goldA","\\textcolor{##ffd0a9}{#1}"),ke("\\goldB","\\textcolor{##ffbb71}{#1}"),ke("\\goldC","\\textcolor{##ff9c39}{#1}"),ke("\\goldD","\\textcolor{##e07d10}{#1}"),ke("\\goldE","\\textcolor{##a75a05}{#1}"),ke("\\redA","\\textcolor{##fca9a9}{#1}"),ke("\\redB","\\textcolor{##ff8482}{#1}"),ke("\\redC","\\textcolor{##f9685d}{#1}"),ke("\\redD","\\textcolor{##e84d39}{#1}"),ke("\\redE","\\textcolor{##bc2612}{#1}"),ke("\\maroonA","\\textcolor{##ffbde0}{#1}"),ke("\\maroonB","\\textcolor{##ff92c6}{#1}"),ke("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ke("\\maroonD","\\textcolor{##ca337c}{#1}"),ke("\\maroonE","\\textcolor{##9e034e}{#1}"),ke("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ke("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ke("\\purpleC","\\textcolor{##aa87ff}{#1}"),ke("\\purpleD","\\textcolor{##7854ab}{#1}"),ke("\\purpleE","\\textcolor{##543b78}{#1}"),ke("\\mintA","\\textcolor{##f5f9e8}{#1}"),ke("\\mintB","\\textcolor{##edf2df}{#1}"),ke("\\mintC","\\textcolor{##e0e5cc}{#1}"),ke("\\grayA","\\textcolor{##f6f7f7}{#1}"),ke("\\grayB","\\textcolor{##f0f1f2}{#1}"),ke("\\grayC","\\textcolor{##e3e5e6}{#1}"),ke("\\grayD","\\textcolor{##d6d8da}{#1}"),ke("\\grayE","\\textcolor{##babec2}{#1}"),ke("\\grayF","\\textcolor{##888d93}{#1}"),ke("\\grayG","\\textcolor{##626569}{#1}"),ke("\\grayH","\\textcolor{##3b3e40}{#1}"),ke("\\grayI","\\textcolor{##21242c}{#1}"),ke("\\kaBlue","\\textcolor{##314453}{#1}"),ke("\\kaGreen","\\textcolor{##71B307}{#1}");var Tu={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Cu=function(){function H(b,_,w){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=_,this.expansionCount=0,this.feed(b),this.macros=new Ma(Fs,_.macros),this.mode=w,this.stack=[]}var m=H.prototype;return m.feed=function(_){this.lexer=new ll(_,this.settings)},m.switchMode=function(_){this.mode=_},m.beginGroup=function(){this.macros.beginGroup()},m.endGroup=function(){this.macros.endGroup()},m.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},m.popToken=function(){return this.future(),this.stack.pop()},m.pushToken=function(_){this.stack.push(_)},m.pushTokens=function(_){var w;(w=this.stack).push.apply(w,_)},m.consumeSpaces=function(){for(;;){var _=this.future();if(_.text===" ")this.stack.pop();else break}},m.consumeArgs=function(_){for(var w=[],I=0;I<_;++I){this.consumeSpaces();var U=this.popToken();if(U.text==="{"){for(var le=[],Ee=1;Ee!==0;){var Be=this.popToken();if(le.push(Be),Be.text==="{")++Ee;else if(Be.text==="}")--Ee;else if(Be.text==="EOF")throw new E("End of input in macro argument",U)}le.pop(),le.reverse(),w[I]=le}else{if(U.text==="EOF")throw new E("End of input expecting macro argument");w[I]=[U]}}return w},m.expandOnce=function(){var _=this.popToken(),w=_.text,I=this._getExpansion(w);if(I==null)return this.pushToken(_),_;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new E("Too many expansions: infinite loop or need to increase maxExpand setting");var U=I.tokens;if(I.numArgs){var le=this.consumeArgs(I.numArgs);U=U.slice();for(var Ee=U.length-1;Ee>=0;--Ee){var Be=U[Ee];if(Be.text==="#"){if(Ee===0)throw new E("Incomplete placeholder at end of macro body",Be);if(Be=U[--Ee],Be.text==="#")U.splice(Ee+1,1);else if(/^[1-9]$/.test(Be.text)){var st;(st=U).splice.apply(st,[Ee,2].concat(le[+Be.text-1]))}else throw new E("Not a valid argument number",Be)}}}return this.pushTokens(U),U},m.expandAfterFuture=function(){return this.expandOnce(),this.future()},m.expandNextToken=function(){for(;;){var _=this.expandOnce();if(_ instanceof Le)if(_.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},m.expandMacro=function(_){if(this.macros.get(_)){var w=[],I=this.stack.length;for(this.pushToken(new Le(_));this.stack.length>I;){var U=this.expandOnce();U instanceof Le&&w.push(this.stack.pop())}return w}},m.expandMacroAsText=function(_){var w=this.expandMacro(_);return w&&w.map(function(I){return I.text}).join("")},m._getExpansion=function(_){var w=this.macros.get(_);if(w==null)return w;var I=typeof w=="function"?w(this):w;if(typeof I=="string"){var U=0;if(I.indexOf("#")!==-1)for(var le=I.replace(/##/g,"");le.indexOf("#"+(U+1))!==-1;)++U;for(var Ee=new ll(I,this.settings),Be=[],st=Ee.lex();st.text!=="EOF";)Be.push(st),st=Ee.lex();Be.reverse();var yt={tokens:Be,numArgs:U};return yt}return I},m.isDefined=function(_){return this.macros.has(_)||Do.hasOwnProperty(_)||rr.math.hasOwnProperty(_)||rr.text.hasOwnProperty(_)||Tu.hasOwnProperty(_)},H}(),Kl={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"}},dl={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u010F:"d\u030C",\u1E0B:"d\u0307",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u013A:"l\u0301",\u013E:"l\u030C",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u010E:"D\u030C",\u1E0A:"D\u0307",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0139:"L\u0301",\u013D:"L\u030C",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u0164:"T\u030C",\u1E6A:"T\u0307",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},Mo=function(){function H(b,_){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 Cu(b,_,this.mode),this.settings=_,this.leftrightDepth=0}var m=H.prototype;return m.expect=function(_,w){if(w===void 0&&(w=!0),this.fetch().text!==_)throw new E("Expected '"+_+"', got '"+this.fetch().text+"'",this.fetch());w&&this.consume()},m.consume=function(){this.nextToken=null},m.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},m.switchMode=function(_){this.mode=_,this.gullet.switchMode(_)},m.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var _=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),_},m.parseExpression=function(_,w){for(var I=[];;){this.mode==="math"&&this.consumeSpaces();var U=this.fetch();if(H.endOfExpression.indexOf(U.text)!==-1||w&&U.text===w||_&&Do[U.text]&&Do[U.text].infix)break;var le=this.parseAtom(w);if(!le)break;I.push(le)}return this.mode==="text"&&this.formLigatures(I),this.handleInfixNodes(I)},m.handleInfixNodes=function(_){for(var w=-1,I,U=0;U<_.length;U++){var le=yr(_[U],"infix");if(le){if(w!==-1)throw new E("only one infix operator per group",le.token);w=U,I=le.replaceWith}}if(w!==-1&&I){var Ee,Be,st=_.slice(0,w),yt=_.slice(w+1);st.length===1&&st[0].type==="ordgroup"?Ee=st[0]:Ee={type:"ordgroup",mode:this.mode,body:st},yt.length===1&&yt[0].type==="ordgroup"?Be=yt[0]:Be={type:"ordgroup",mode:this.mode,body:yt};var It;return I==="\\\\abovefrac"?It=this.callFunction(I,[Ee,_[w],Be],[]):It=this.callFunction(I,[Ee,Be],[]),[It]}else return _},m.handleSupSubscript=function(_){var w=this.fetch(),I=w.text;this.consume();var U=this.parseGroup(_,!1,H.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!U)throw new E("Expected group after '"+I+"'",w);return U},m.formatUnsupportedCmd=function(_){for(var w=[],I=0;I<_.length;I++)w.push({type:"textord",mode:"text",text:_[I]});var U={type:"text",mode:this.mode,body:w},le={type:"color",mode:this.mode,color:this.settings.errorColor,body:[U]};return le},m.parseAtom=function(_){var w=this.parseGroup("atom",!1,null,_);if(this.mode==="text")return w;for(var I,U;;){this.consumeSpaces();var le=this.fetch();if(le.text==="\\limits"||le.text==="\\nolimits"){var Ee=yr(w,"op");if(Ee){var Be=le.text==="\\limits";Ee.limits=Be,Ee.alwaysHandleSupSub=!0}else if(Ee=yr(w,"operatorname"),Ee&&Ee.alwaysHandleSupSub){var st=le.text==="\\limits";Ee.limits=st}else throw new E("Limit controls must follow a math operator",le);this.consume()}else if(le.text==="^"){if(I)throw new E("Double superscript",le);I=this.handleSupSubscript("superscript")}else if(le.text==="_"){if(U)throw new E("Double subscript",le);U=this.handleSupSubscript("subscript")}else if(le.text==="'"){if(I)throw new E("Double superscript",le);var yt={type:"textord",mode:this.mode,text:"\\prime"},It=[yt];for(this.consume();this.fetch().text==="'";)It.push(yt),this.consume();this.fetch().text==="^"&&It.push(this.handleSupSubscript("superscript")),I={type:"ordgroup",mode:this.mode,body:It}}else break}return I||U?{type:"supsub",mode:this.mode,base:w,sup:I,sub:U}:w},m.parseFunction=function(_,w,I){var U=this.fetch(),le=U.text,Ee=Do[le];if(!Ee)return null;if(this.consume(),I!=null&&Ee.greediness<=I)throw new E("Got function '"+le+"' with no arguments"+(w?" as "+w:""),U);if(this.mode==="text"&&!Ee.allowedInText)throw new E("Can't use function '"+le+"' in text mode",U);if(this.mode==="math"&&Ee.allowedInMath===!1)throw new E("Can't use function '"+le+"' in math mode",U);var Be=this.parseArguments(le,Ee),st=Be.args,yt=Be.optArgs;return this.callFunction(le,st,yt,U,_)},m.callFunction=function(_,w,I,U,le){var Ee={funcName:_,parser:this,token:U,breakOnTokenText:le},Be=Do[_];if(Be&&Be.handler)return Be.handler(Ee,w,I);throw new E("No function handler for "+_)},m.parseArguments=function(_,w){var I=w.numArgs+w.numOptionalArgs;if(I===0)return{args:[],optArgs:[]};for(var U=w.greediness,le=[],Ee=[],Be=0;Be<I;Be++){var st=w.argTypes&&w.argTypes[Be],yt=Be<w.numOptionalArgs,It=Be>0&&!yt||Be===0&&!yt&&this.mode==="math",Qt=this.parseGroupOfType("argument to '"+_+"'",st,yt,U,It);if(!Qt){if(yt){Ee.push(null);continue}throw new E("Expected group after '"+_+"'",this.fetch())}(yt?Ee:le).push(Qt)}return{args:le,optArgs:Ee}},m.parseGroupOfType=function(_,w,I,U,le){switch(w){case"color":return le&&this.consumeSpaces(),this.parseColorGroup(I);case"size":return le&&this.consumeSpaces(),this.parseSizeGroup(I);case"url":return this.parseUrlGroup(I,le);case"math":case"text":return this.parseGroup(_,I,U,void 0,w,le);case"hbox":{var Ee=this.parseGroup(_,I,U,void 0,"text",le);if(!Ee)return Ee;var Be={type:"styling",mode:Ee.mode,body:[Ee],style:"text"};return Be}case"raw":{if(le&&this.consumeSpaces(),I&&this.fetch().text==="{")return null;var st=this.parseStringGroup("raw",I,!0);if(st)return{type:"raw",mode:"text",string:st.text};throw new E("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(_,I,U,void 0,void 0,le);default:throw new E("Unknown group type as "+_,this.fetch())}},m.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},m.parseStringGroup=function(_,w,I){var U=w?"[":"{",le=w?"]":"}",Ee=this.fetch();if(Ee.text!==U){if(w)return null;if(I&&Ee.text!=="EOF"&&/[^{}[\]]/.test(Ee.text))return this.consume(),Ee}var Be=this.mode;this.mode="text",this.expect(U);for(var st="",yt=this.fetch(),It=0,Qt=yt,tr;(tr=this.fetch()).text!==le||I&&It>0;){switch(tr.text){case"EOF":throw new E("Unexpected end of input in "+_,yt.range(Qt,st));case U:It++;break;case le:It--;break}Qt=tr,st+=Qt.text,this.consume()}return this.expect(le),this.mode=Be,yt.range(Qt,st)},m.parseRegexGroup=function(_,w){var I=this.mode;this.mode="text";for(var U=this.fetch(),le=U,Ee="",Be;(Be=this.fetch()).text!=="EOF"&&_.test(Ee+Be.text);)le=Be,Ee+=le.text,this.consume();if(Ee==="")throw new E("Invalid "+w+": '"+U.text+"'",U);return this.mode=I,U.range(le,Ee)},m.parseColorGroup=function(_){var w=this.parseStringGroup("color",_);if(!w)return null;var I=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(w.text);if(!I)throw new E("Invalid color: '"+w.text+"'",w);var U=I[0];return/^[0-9a-f]{6}$/i.test(U)&&(U="#"+U),{type:"color-token",mode:this.mode,color:U}},m.parseSizeGroup=function(_){var w,I=!1;if(!_&&this.fetch().text!=="{"?w=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):w=this.parseStringGroup("size",_),!w)return null;!_&&w.text.length===0&&(w.text="0pt",I=!0);var U=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(w.text);if(!U)throw new E("Invalid size: '"+w.text+"'",w);var le={number:+(U[1]+U[2]),unit:U[3]};if(!lt(le))throw new E("Invalid unit: '"+le.unit+"'",w);return{type:"size",mode:this.mode,value:le,isBlank:I}},m.parseUrlGroup=function(_,w){this.gullet.lexer.setCatcode("%",13);var I=this.parseStringGroup("url",_,!0);if(this.gullet.lexer.setCatcode("%",14),!I)return null;var U=I.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:U}},m.parseGroup=function(_,w,I,U,le,Ee){var Be=this.mode;le&&this.switchMode(le),Ee&&this.consumeSpaces();var st=this.fetch(),yt=st.text,It;if(w?yt==="[":yt==="{"||yt==="\\begingroup"){this.consume();var Qt=H.endOfGroup[yt];this.gullet.beginGroup();var tr=this.parseExpression(!1,Qt),Ve=this.fetch();this.expect(Qt),this.gullet.endGroup(),It={type:"ordgroup",mode:this.mode,loc:rt.range(st,Ve),body:tr,semisimple:yt==="\\begingroup"||void 0}}else if(w)It=null;else if(It=this.parseFunction(U,_,I)||this.parseSymbol(),It==null&&yt[0]==="\\"&&!Tu.hasOwnProperty(yt)){if(this.settings.throwOnError)throw new E("Undefined control sequence: "+yt,st);It=this.formatUnsupportedCmd(yt),this.consume()}return le&&this.switchMode(Be),It},m.formLigatures=function(_){for(var w=_.length-1,I=0;I<w;++I){var U=_[I],le=U.text;le==="-"&&_[I+1].text==="-"&&(I+1<w&&_[I+2].text==="-"?(_.splice(I,3,{type:"textord",mode:"text",loc:rt.range(U,_[I+2]),text:"---"}),w-=2):(_.splice(I,2,{type:"textord",mode:"text",loc:rt.range(U,_[I+1]),text:"--"}),w-=1)),(le==="'"||le==="`")&&_[I+1].text===le&&(_.splice(I,2,{type:"textord",mode:"text",loc:rt.range(U,_[I+1]),text:le+le}),w-=1)}},m.parseSymbol=function(){var _=this.fetch(),w=_.text;if(/^\\verb[^a-zA-Z]/.test(w)){this.consume();var I=w.slice(5),U=I.charAt(0)==="*";if(U&&(I=I.slice(1)),I.length<2||I.charAt(0)!==I.slice(-1))throw new E(`\\verb assertion failed --
please report what input caused this bug`);return I=I.slice(1,-1),{type:"verb",mode:"text",body:I,star:U}}dl.hasOwnProperty(w[0])&&!rr[this.mode][w[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+w[0]+'" used in math mode',_),w=dl[w[0]]+w.substr(1));var le=l0.exec(w);le&&(w=w.substring(0,le.index),w==="i"?w="\u0131":w==="j"&&(w="\u0237"));var Ee;if(rr[this.mode][w]){this.settings.strict&&this.mode==="math"&&Rr.indexOf(w)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+w[0]+'" used in math mode',_);var Be=rr[this.mode][w].group,st=rt.range(_),yt;if(Pt.hasOwnProperty(Be)){var It=Be;yt={type:"atom",mode:this.mode,family:It,loc:st,text:w}}else yt={type:Be,mode:this.mode,loc:st,text:w};Ee=yt}else if(w.charCodeAt(0)>=128)this.settings.strict&&(at(w.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+w[0]+'" used in math mode',_):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+w[0]+'"'+(" ("+w.charCodeAt(0)+")"),_)),Ee={type:"textord",mode:"text",loc:rt.range(_),text:w};else return null;if(this.consume(),le)for(var Qt=0;Qt<le[0].length;Qt++){var tr=le[0][Qt];if(!Kl[tr])throw new E("Unknown accent ' "+tr+"'",_);var Ve=Kl[tr][this.mode];if(!Ve)throw new E("Accent "+tr+" unsupported in "+this.mode+" mode",_);Ee={type:"accent",mode:this.mode,loc:rt.range(_),label:Ve,isStretchy:!1,isShifty:!0,base:Ee}}return Ee},H}();Mo.endOfExpression=["}","\\endgroup","\\end","\\right","&"],Mo.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},Mo.SUPSUB_GREEDINESS=1;var Hl=function(m,b){if(!(typeof m=="string"||m instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var _=new Mo(m,b);delete _.gullet.macros.current["\\df@tag"];var w=_.parse();if(_.gullet.macros.get("\\df@tag")){if(!b.displayMode)throw new E("\\tag works only in display equations");_.gullet.feed("\\df@tag"),w=[{type:"tag",mode:"text",body:w,tag:_.parse()}]}return w},fl=Hl,Du=function(m,b,_){b.textContent="";var w=Ha(m,_).toNode();b.appendChild(w)};typeof document!="undefined"&&document.compatMode!=="CSS1Compat"&&(typeof console!="undefined"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Du=function(){throw new E("KaTeX doesn't work in quirks mode.")});var Mu=function(m,b){var _=Ha(m,b).toMarkup();return _},u0=function(m,b){var _=new q(b);return fl(m,_)},Gl=function(m,b,_){if(_.throwOnError||!(m instanceof E))throw m;var w=je.makeSpan(["katex-error"],[new Oe(b)]);return w.setAttribute("title",m.toString()),w.setAttribute("style","color:"+_.errorColor),w},Ha=function(m,b){var _=new q(b);try{var w=fl(m,_);return Pn(w,m,_)}catch(I){return Gl(I,m,_)}},Lo=function(m,b){var _=new q(b);try{var w=fl(m,_);return An(w,m,_)}catch(I){return Gl(I,m,_)}},Lu={version:"0.11.1",render:Du,renderToString:Mu,ParseError:E,__parse:u0,__renderToDomTree:Ha,__renderToHTMLTree:Lo,__setFontMetrics:_r,__defineSymbol:T,__defineMacro:ke,__domTree:{Span:Qe,Anchor:Ct,SymbolNode:Oe,SvgNode:et,PathNode:vt,LineNode:wt}},c0=J.default=Lu}]).default})},32834:function(Fr){(function(Rt,J){Fr.exports=J()})(this,function(){"use strict";function Rt(Ne,He){for(var Je=0;Je<He.length;Je++){var W=He[Je];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(Ne,W.key,W)}}function J(Ne,He,Je){return He&&Rt(Ne.prototype,He),Je&&Rt(Ne,Je),Ne}function pe(Ne,He){if(Ne){if(typeof Ne=="string")return Pe(Ne,He);var Je=Object.prototype.toString.call(Ne).slice(8,-1);if(Je==="Object"&&Ne.constructor&&(Je=Ne.constructor.name),Je==="Map"||Je==="Set")return Array.from(Ne);if(Je==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Je))return Pe(Ne,He)}}function Pe(Ne,He){(He==null||He>Ne.length)&&(He=Ne.length);for(var Je=0,W=new Array(He);Je<He;Je++)W[Je]=Ne[Je];return W}function rt(Ne,He){var Je=typeof Symbol!="undefined"&&Ne[Symbol.iterator]||Ne["@@iterator"];if(Je)return(Je=Je.call(Ne)).next.bind(Je);if(Array.isArray(Ne)||(Je=pe(Ne))||He&&Ne&&typeof Ne.length=="number"){Je&&(Ne=Je);var W=0;return function(){return W>=Ne.length?{done:!0}:{done:!1,value:Ne[W++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Le={exports:{}};function te(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function E(Ne){Le.exports.defaults=Ne}Le.exports={defaults:te(),getDefaults:te,changeDefaults:E};var Me=/[&<>"']/,$=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,be=/[<>"']|&(?!#?\w+;)/g,j={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},k=function(He){return j[He]};function M(Ne,He){if(He){if(Me.test(Ne))return Ne.replace($,k)}else if(d.test(Ne))return Ne.replace(be,k);return Ne}var O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function K(Ne){return Ne.replace(O,function(He,Je){return Je=Je.toLowerCase(),Je==="colon"?":":Je.charAt(0)==="#"?Je.charAt(1)==="x"?String.fromCharCode(parseInt(Je.substring(2),16)):String.fromCharCode(+Je.substring(1)):""})}var se=/(^|[^\[])\^/g;function ae(Ne,He){Ne=Ne.source||Ne,He=He||"";var Je={replace:function(ge,Se){return Se=Se.source||Se,Se=Se.replace(se,"$1"),Ne=Ne.replace(ge,Se),Je},getRegex:function(){return new RegExp(Ne,He)}};return Je}var Z=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Y(Ne,He,Je){if(Ne){var W;try{W=decodeURIComponent(K(Je)).replace(Z,"").toLowerCase()}catch(ge){return null}if(W.indexOf("javascript:")===0||W.indexOf("vbscript:")===0||W.indexOf("data:")===0)return null}He&&!q.test(Je)&&(Je=ve(He,Je));try{Je=encodeURI(Je).replace(/%25/g,"%")}catch(ge){return null}return Je}var ue={},ee=/^[^:]+:\/*[^/]*$/,oe=/^([^:]+:)[\s\S]*$/,De=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ve(Ne,He){ue[" "+Ne]||(ee.test(Ne)?ue[" "+Ne]=Ne+"/":ue[" "+Ne]=pt(Ne,"/",!0)),Ne=ue[" "+Ne];var Je=Ne.indexOf(":")===-1;return He.substring(0,2)==="//"?Je?He:Ne.replace(oe,"$1")+He:He.charAt(0)==="/"?Je?He:Ne.replace(De,"$1")+He:Ne+He}var Ye={exec:function(){}};function We(Ne){for(var He=1,Je,W;He<arguments.length;He++){Je=arguments[He];for(W in Je)Object.prototype.hasOwnProperty.call(Je,W)&&(Ne[W]=Je[W])}return Ne}function ut(Ne,He){var Je=Ne.replace(/\|/g,function(Se,Ke,V){for(var qt=!1,Ae=Ke;--Ae>=0&&V[Ae]==="\\";)qt=!qt;return qt?"|":" |"}),W=Je.split(/ \|/),ge=0;if(W.length>He)W.splice(He);else for(;W.length<He;)W.push("");for(;ge<W.length;ge++)W[ge]=W[ge].trim().replace(/\\\|/g,"|");return W}function pt(Ne,He,Je){var W=Ne.length;if(W===0)return"";for(var ge=0;ge<W;){var Se=Ne.charAt(W-ge-1);if(Se===He&&!Je)ge++;else if(Se!==He&&Je)ge++;else break}return Ne.substr(0,W-ge)}function de(Ne,He){if(Ne.indexOf(He[1])===-1)return-1;for(var Je=Ne.length,W=0,ge=0;ge<Je;ge++)if(Ne[ge]==="\\")ge++;else if(Ne[ge]===He[0])W++;else if(Ne[ge]===He[1]&&(W--,W<0))return ge;return-1}function re(Ne){Ne&&Ne.sanitize&&!Ne.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ce(Ne,He){if(He<1)return"";for(var Je="";He>1;)He&1&&(Je+=Ne),He>>=1,Ne+=Ne;return Je+Ne}var he={escape:M,unescape:K,edit:ae,cleanUrl:Y,resolveUrl:ve,noopTest:Ye,merge:We,splitCells:ut,rtrim:pt,findClosingBracket:de,checkSanitizeDeprecation:re,repeatString:ce},Re=Le.exports.defaults,we=he.rtrim,D=he.splitCells,L=he.escape,ie=he.findClosingBracket;function xe(Ne,He,Je){var W=He.href,ge=He.title?L(He.title):null,Se=Ne[1].replace(/\\([\[\]])/g,"$1");return Ne[0].charAt(0)!=="!"?{type:"link",raw:Je,href:W,title:ge,text:Se}:{type:"image",raw:Je,href:W,title:ge,text:L(Se)}}function at(Ne,He){var Je=Ne.match(/^(\s+)(?:```)/);if(Je===null)return He;var W=Je[1];return He.split(`
`).map(function(ge){var Se=ge.match(/^\s+/);if(Se===null)return ge;var Ke=Se[0];return Ke.length>=W.length?ge.slice(W.length):ge}).join(`
`)}var ot=function(){function Ne(Je){this.options=Je||Re}var He=Ne.prototype;return He.space=function(W){var ge=this.rules.block.newline.exec(W);if(ge)return ge[0].length>1?{type:"space",raw:ge[0]}:{raw:`
`}},He.code=function(W){var ge=this.rules.block.code.exec(W);if(ge){var Se=ge[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ge[0],codeBlockStyle:"indented",text:this.options.pedantic?Se:we(Se,`
`)}}},He.fences=function(W){var ge=this.rules.block.fences.exec(W);if(ge){var Se=ge[0],Ke=at(Se,ge[3]||"");return{type:"code",raw:Se,lang:ge[2]?ge[2].trim():ge[2],text:Ke}}},He.heading=function(W){var ge=this.rules.block.heading.exec(W);if(ge){var Se=ge[2].trim();if(/#$/.test(Se)){var Ke=we(Se,"#");(this.options.pedantic||!Ke||/ $/.test(Ke))&&(Se=Ke.trim())}return{type:"heading",raw:ge[0],depth:ge[1].length,text:Se}}},He.nptable=function(W){var ge=this.rules.block.nptable.exec(W);if(ge){var Se={type:"table",header:D(ge[1].replace(/^ *| *\| *$/g,"")),align:ge[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ge[3]?ge[3].replace(/\n$/,"").split(`
`):[],raw:ge[0]};if(Se.header.length===Se.align.length){var Ke=Se.align.length,V;for(V=0;V<Ke;V++)/^ *-+: *$/.test(Se.align[V])?Se.align[V]="right":/^ *:-+: *$/.test(Se.align[V])?Se.align[V]="center":/^ *:-+ *$/.test(Se.align[V])?Se.align[V]="left":Se.align[V]=null;for(Ke=Se.cells.length,V=0;V<Ke;V++)Se.cells[V]=D(Se.cells[V],Se.header.length);return Se}}},He.hr=function(W){var ge=this.rules.block.hr.exec(W);if(ge)return{type:"hr",raw:ge[0]}},He.blockquote=function(W){var ge=this.rules.block.blockquote.exec(W);if(ge){var Se=ge[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ge[0],text:Se}}},He.list=function(W){var ge=this.rules.block.list.exec(W);if(ge){var Se=ge[0],Ke=ge[2],V=Ke.length>1,qt={type:"list",raw:Se,ordered:V,start:V?+Ke.slice(0,-1):"",loose:!1,items:[]},Ae=ge[0].match(this.rules.block.item),Yt=!1,vr,ei,Ri,ui,wr,bi,me,Te,Mt,ct=Ae.length;Ri=this.rules.block.listItemStart.exec(Ae[0]);for(var Et=0;Et<ct;Et++){if(vr=Ae[Et],Se=vr,this.options.pedantic||(Mt=vr.match(new RegExp("\\n\\s*\\n {0,"+(Ri[0].length-1)+"}\\S")),Mt&&(wr=vr.length-Mt.index+Ae.slice(Et+1).join(`
`).length,qt.raw=qt.raw.substring(0,qt.raw.length-wr),vr=vr.substring(0,Mt.index),Se=vr,ct=Et+1)),Et!==ct-1){if(ui=this.rules.block.listItemStart.exec(Ae[Et+1]),this.options.pedantic?ui[1].length>Ri[1].length:ui[1].length>=Ri[0].length||ui[1].length>3){Ae.splice(Et,2,Ae[Et]+(!this.options.pedantic&&ui[1].length<Ri[0].length&&!Ae[Et].match(/\n$/)?"":`
`)+Ae[Et+1]),Et--,ct--;continue}else(!this.options.pedantic||this.options.smartLists?ui[2][ui[2].length-1]!==Ke[Ke.length-1]:V===(ui[2].length===1))&&(wr=Ae.slice(Et+1).join(`
`).length,qt.raw=qt.raw.substring(0,qt.raw.length-wr),Et=ct-1);Ri=ui}ei=vr.length,vr=vr.replace(/^ *([*+-]|\d+[.)]) ?/,""),~vr.indexOf(`
`)&&(ei-=vr.length,vr=this.options.pedantic?vr.replace(/^ {1,4}/gm,""):vr.replace(new RegExp("^ {1,"+ei+"}","gm"),"")),vr=we(vr,`
`),Et!==ct-1&&(Se=Se+`
`),bi=Yt||/\n\n(?!\s*$)/.test(Se),Et!==ct-1&&(Yt=Se.slice(-2)===`
`,bi||(bi=Yt)),bi&&(qt.loose=!0),this.options.gfm&&(me=/^\[[ xX]\] /.test(vr),Te=void 0,me&&(Te=vr[1]!==" ",vr=vr.replace(/^\[[ xX]\] +/,""))),qt.items.push({type:"list_item",raw:Se,task:me,checked:Te,loose:bi,text:vr})}return qt}},He.html=function(W){var ge=this.rules.block.html.exec(W);if(ge)return{type:this.options.sanitize?"paragraph":"html",raw:ge[0],pre:!this.options.sanitizer&&(ge[1]==="pre"||ge[1]==="script"||ge[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):L(ge[0]):ge[0]}},He.def=function(W){var ge=this.rules.block.def.exec(W);if(ge){ge[3]&&(ge[3]=ge[3].substring(1,ge[3].length-1));var Se=ge[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:Se,raw:ge[0],href:ge[2],title:ge[3]}}},He.table=function(W){var ge=this.rules.block.table.exec(W);if(ge){var Se={type:"table",header:D(ge[1].replace(/^ *| *\| *$/g,"")),align:ge[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ge[3]?ge[3].replace(/\n$/,"").split(`
`):[]};if(Se.header.length===Se.align.length){Se.raw=ge[0];var Ke=Se.align.length,V;for(V=0;V<Ke;V++)/^ *-+: *$/.test(Se.align[V])?Se.align[V]="right":/^ *:-+: *$/.test(Se.align[V])?Se.align[V]="center":/^ *:-+ *$/.test(Se.align[V])?Se.align[V]="left":Se.align[V]=null;for(Ke=Se.cells.length,V=0;V<Ke;V++)Se.cells[V]=D(Se.cells[V].replace(/^ *\| *| *\| *$/g,""),Se.header.length);return Se}}},He.lheading=function(W){var ge=this.rules.block.lheading.exec(W);if(ge)return{type:"heading",raw:ge[0],depth:ge[2].charAt(0)==="="?1:2,text:ge[1]}},He.paragraph=function(W){var ge=this.rules.block.paragraph.exec(W);if(ge)return{type:"paragraph",raw:ge[0],text:ge[1].charAt(ge[1].length-1)===`
`?ge[1].slice(0,-1):ge[1]}},He.text=function(W){var ge=this.rules.block.text.exec(W);if(ge)return{type:"text",raw:ge[0],text:ge[0]}},He.escape=function(W){var ge=this.rules.inline.escape.exec(W);if(ge)return{type:"escape",raw:ge[0],text:L(ge[1])}},He.tag=function(W,ge,Se){var Ke=this.rules.inline.tag.exec(W);if(Ke)return!ge&&/^<a /i.test(Ke[0])?ge=!0:ge&&/^<\/a>/i.test(Ke[0])&&(ge=!1),!Se&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ke[0])?Se=!0:Se&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ke[0])&&(Se=!1),{type:this.options.sanitize?"text":"html",raw:Ke[0],inLink:ge,inRawBlock:Se,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ke[0]):L(Ke[0]):Ke[0]}},He.link=function(W){var ge=this.rules.inline.link.exec(W);if(ge){var Se=ge[2].trim();if(!this.options.pedantic&&/^</.test(Se)){if(!/>$/.test(Se))return;var Ke=we(Se.slice(0,-1),"\\");if((Se.length-Ke.length)%2===0)return}else{var V=ie(ge[2],"()");if(V>-1){var qt=ge[0].indexOf("!")===0?5:4,Ae=qt+ge[1].length+V;ge[2]=ge[2].substring(0,V),ge[0]=ge[0].substring(0,Ae).trim(),ge[3]=""}}var Yt=ge[2],vr="";if(this.options.pedantic){var ei=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Yt);ei&&(Yt=ei[1],vr=ei[3])}else vr=ge[3]?ge[3].slice(1,-1):"";return Yt=Yt.trim(),/^</.test(Yt)&&(this.options.pedantic&&!/>$/.test(Se)?Yt=Yt.slice(1):Yt=Yt.slice(1,-1)),xe(ge,{href:Yt&&Yt.replace(this.rules.inline._escapes,"$1"),title:vr&&vr.replace(this.rules.inline._escapes,"$1")},ge[0])}},He.reflink=function(W,ge){var Se;if((Se=this.rules.inline.reflink.exec(W))||(Se=this.rules.inline.nolink.exec(W))){var Ke=(Se[2]||Se[1]).replace(/\s+/g," ");if(Ke=ge[Ke.toLowerCase()],!Ke||!Ke.href){var V=Se[0].charAt(0);return{type:"text",raw:V,text:V}}return xe(Se,Ke,Se[0])}},He.emStrong=function(W,ge,Se){Se===void 0&&(Se="");var Ke=this.rules.inline.emStrong.lDelim.exec(W);if(Ke&&!(Ke[3]&&Se.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var V=Ke[1]||Ke[2]||"";if(!V||V&&(Se===""||this.rules.inline.punctuation.exec(Se))){var qt=Ke[0].length-1,Ae,Yt,vr=qt,ei=0,Ri=Ke[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Ri.lastIndex=0,ge=ge.slice(-1*W.length+qt);(Ke=Ri.exec(ge))!=null;)if(Ae=Ke[1]||Ke[2]||Ke[3]||Ke[4]||Ke[5]||Ke[6],!!Ae){if(Yt=Ae.length,Ke[3]||Ke[4]){vr+=Yt;continue}else if((Ke[5]||Ke[6])&&qt%3&&!((qt+Yt)%3)){ei+=Yt;continue}if(vr-=Yt,!(vr>0))return Yt=Math.min(Yt,Yt+vr+ei),Math.min(qt,Yt)%2?{type:"em",raw:W.slice(0,qt+Ke.index+Yt+1),text:W.slice(1,qt+Ke.index+Yt)}:{type:"strong",raw:W.slice(0,qt+Ke.index+Yt+1),text:W.slice(2,qt+Ke.index+Yt-1)}}}}},He.codespan=function(W){var ge=this.rules.inline.code.exec(W);if(ge){var Se=ge[2].replace(/\n/g," "),Ke=/[^ ]/.test(Se),V=/^ /.test(Se)&&/ $/.test(Se);return Ke&&V&&(Se=Se.substring(1,Se.length-1)),Se=L(Se,!0),{type:"codespan",raw:ge[0],text:Se}}},He.br=function(W){var ge=this.rules.inline.br.exec(W);if(ge)return{type:"br",raw:ge[0]}},He.del=function(W){var ge=this.rules.inline.del.exec(W);if(ge)return{type:"del",raw:ge[0],text:ge[2]}},He.autolink=function(W,ge){var Se=this.rules.inline.autolink.exec(W);if(Se){var Ke,V;return Se[2]==="@"?(Ke=L(this.options.mangle?ge(Se[1]):Se[1]),V="mailto:"+Ke):(Ke=L(Se[1]),V=Ke),{type:"link",raw:Se[0],text:Ke,href:V,tokens:[{type:"text",raw:Ke,text:Ke}]}}},He.url=function(W,ge){var Se;if(Se=this.rules.inline.url.exec(W)){var Ke,V;if(Se[2]==="@")Ke=L(this.options.mangle?ge(Se[0]):Se[0]),V="mailto:"+Ke;else{var qt;do qt=Se[0],Se[0]=this.rules.inline._backpedal.exec(Se[0])[0];while(qt!==Se[0]);Ke=L(Se[0]),Se[1]==="www."?V="http://"+Ke:V=Ke}return{type:"link",raw:Se[0],text:Ke,href:V,tokens:[{type:"text",raw:Ke,text:Ke}]}}},He.inlineText=function(W,ge,Se){var Ke=this.rules.inline.text.exec(W);if(Ke){var V;return ge?V=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ke[0]):L(Ke[0]):Ke[0]:V=L(this.options.smartypants?Se(Ke[0]):Ke[0]),{type:"text",raw:Ke[0],text:V}}},Ne}(),At=he.noopTest,Xe=he.edit,ar=he.merge,jt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:At,table:At,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};jt._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,jt._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,jt.def=Xe(jt.def).replace("label",jt._label).replace("title",jt._title).getRegex(),jt.bullet=/(?:[*+-]|\d{1,9}[.)])/,jt.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,jt.item=Xe(jt.item,"gm").replace(/bull/g,jt.bullet).getRegex(),jt.listItemStart=Xe(/^( *)(bull) */).replace("bull",jt.bullet).getRegex(),jt.list=Xe(jt.list).replace(/bull/g,jt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+jt.def.source+")").getRegex(),jt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",jt._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,jt.html=Xe(jt.html,"i").replace("comment",jt._comment).replace("tag",jt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jt.paragraph=Xe(jt._paragraph).replace("hr",jt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",jt._tag).getRegex(),jt.blockquote=Xe(jt.blockquote).replace("paragraph",jt.paragraph).getRegex(),jt.normal=ar({},jt),jt.gfm=ar({},jt.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),jt.gfm.nptable=Xe(jt.gfm.nptable).replace("hr",jt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",jt._tag).getRegex(),jt.gfm.table=Xe(jt.gfm.table).replace("hr",jt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",jt._tag).getRegex(),jt.pedantic=ar({},jt.normal,{html:Xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:At,paragraph:Xe(jt.normal._paragraph).replace("hr",jt.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",jt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ot={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:At,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:At,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Ot._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Ot.punctuation=Xe(Ot.punctuation).replace(/punctuation/g,Ot._punctuation).getRegex(),Ot.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ot.escapedEmSt=/\\\*|\\_/g,Ot._comment=Xe(jt._comment).replace("(?:-->|$)","-->").getRegex(),Ot.emStrong.lDelim=Xe(Ot.emStrong.lDelim).replace(/punct/g,Ot._punctuation).getRegex(),Ot.emStrong.rDelimAst=Xe(Ot.emStrong.rDelimAst,"g").replace(/punct/g,Ot._punctuation).getRegex(),Ot.emStrong.rDelimUnd=Xe(Ot.emStrong.rDelimUnd,"g").replace(/punct/g,Ot._punctuation).getRegex(),Ot._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ot._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ot._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ot.autolink=Xe(Ot.autolink).replace("scheme",Ot._scheme).replace("email",Ot._email).getRegex(),Ot._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ot.tag=Xe(Ot.tag).replace("comment",Ot._comment).replace("attribute",Ot._attribute).getRegex(),Ot._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ot._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ot._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ot.link=Xe(Ot.link).replace("label",Ot._label).replace("href",Ot._href).replace("title",Ot._title).getRegex(),Ot.reflink=Xe(Ot.reflink).replace("label",Ot._label).getRegex(),Ot.reflinkSearch=Xe(Ot.reflinkSearch,"g").replace("reflink",Ot.reflink).replace("nolink",Ot.nolink).getRegex(),Ot.normal=ar({},Ot),Ot.pedantic=ar({},Ot.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Ot._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ot._label).getRegex()}),Ot.gfm=ar({},Ot.normal,{escape:Xe(Ot.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Ot.gfm.url=Xe(Ot.gfm.url,"i").replace("email",Ot.gfm._extended_email).getRegex(),Ot.breaks=ar({},Ot.gfm,{br:Xe(Ot.br).replace("{2,}","*").getRegex(),text:Xe(Ot.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var kr={block:jt,inline:Ot},$r=ot,ir=Le.exports.defaults,zr=kr.block,li=kr.inline,Gr=he.repeatString;function Ze(Ne){return Ne.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function nt(Ne){var He="",Je,W,ge=Ne.length;for(Je=0;Je<ge;Je++)W=Ne.charCodeAt(Je),Math.random()>.5&&(W="x"+W.toString(16)),He+="&#"+W+";";return He}var Qe=function(){function Ne(Je){this.tokens=[],this.tokens.links=Object.create(null),this.options=Je||ir,this.options.tokenizer=this.options.tokenizer||new $r,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var W={block:zr.normal,inline:li.normal};this.options.pedantic?(W.block=zr.pedantic,W.inline=li.pedantic):this.options.gfm&&(W.block=zr.gfm,this.options.breaks?W.inline=li.breaks:W.inline=li.gfm),this.tokenizer.rules=W}Ne.lex=function(W,ge){var Se=new Ne(ge);return Se.lex(W)},Ne.lexInline=function(W,ge){var Se=new Ne(ge);return Se.inlineTokens(W)};var He=Ne.prototype;return He.lex=function(W){return W=W.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(W,this.tokens,!0),this.inline(this.tokens),this.tokens},He.blockTokens=function(W,ge,Se){ge===void 0&&(ge=[]),Se===void 0&&(Se=!0),this.options.pedantic&&(W=W.replace(/^ +$/gm,""));for(var Ke,V,qt,Ae;W;){if(Ke=this.tokenizer.space(W)){W=W.substring(Ke.raw.length),Ke.type&&ge.push(Ke);continue}if(Ke=this.tokenizer.code(W)){W=W.substring(Ke.raw.length),Ae=ge[ge.length-1],Ae&&Ae.type==="paragraph"?(Ae.raw+=`
`+Ke.raw,Ae.text+=`
`+Ke.text):ge.push(Ke);continue}if(Ke=this.tokenizer.fences(W)){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Ke=this.tokenizer.heading(W)){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Ke=this.tokenizer.nptable(W)){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Ke=this.tokenizer.hr(W)){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Ke=this.tokenizer.blockquote(W)){W=W.substring(Ke.raw.length),Ke.tokens=this.blockTokens(Ke.text,[],Se),ge.push(Ke);continue}if(Ke=this.tokenizer.list(W)){for(W=W.substring(Ke.raw.length),qt=Ke.items.length,V=0;V<qt;V++)Ke.items[V].tokens=this.blockTokens(Ke.items[V].text,[],!1);ge.push(Ke);continue}if(Ke=this.tokenizer.html(W)){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Se&&(Ke=this.tokenizer.def(W))){W=W.substring(Ke.raw.length),this.tokens.links[Ke.tag]||(this.tokens.links[Ke.tag]={href:Ke.href,title:Ke.title});continue}if(Ke=this.tokenizer.table(W)){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Ke=this.tokenizer.lheading(W)){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Se&&(Ke=this.tokenizer.paragraph(W))){W=W.substring(Ke.raw.length),ge.push(Ke);continue}if(Ke=this.tokenizer.text(W)){W=W.substring(Ke.raw.length),Ae=ge[ge.length-1],Ae&&Ae.type==="text"?(Ae.raw+=`
`+Ke.raw,Ae.text+=`
`+Ke.text):ge.push(Ke);continue}if(W){var Yt="Infinite loop on byte: "+W.charCodeAt(0);if(this.options.silent){console.error(Yt);break}else throw new Error(Yt)}}return ge},He.inline=function(W){var ge,Se,Ke,V,qt,Ae,Yt=W.length;for(ge=0;ge<Yt;ge++)switch(Ae=W[ge],Ae.type){case"paragraph":case"text":case"heading":{Ae.tokens=[],this.inlineTokens(Ae.text,Ae.tokens);break}case"table":{for(Ae.tokens={header:[],cells:[]},V=Ae.header.length,Se=0;Se<V;Se++)Ae.tokens.header[Se]=[],this.inlineTokens(Ae.header[Se],Ae.tokens.header[Se]);for(V=Ae.cells.length,Se=0;Se<V;Se++)for(qt=Ae.cells[Se],Ae.tokens.cells[Se]=[],Ke=0;Ke<qt.length;Ke++)Ae.tokens.cells[Se][Ke]=[],this.inlineTokens(qt[Ke],Ae.tokens.cells[Se][Ke]);break}case"blockquote":{this.inline(Ae.tokens);break}case"list":{for(V=Ae.items.length,Se=0;Se<V;Se++)this.inline(Ae.items[Se].tokens);break}}return W},He.inlineTokens=function(W,ge,Se,Ke){ge===void 0&&(ge=[]),Se===void 0&&(Se=!1),Ke===void 0&&(Ke=!1);var V,qt,Ae=W,Yt,vr,ei;if(this.tokens.links){var Ri=Object.keys(this.tokens.links);if(Ri.length>0)for(;(Yt=this.tokenizer.rules.inline.reflinkSearch.exec(Ae))!=null;)Ri.includes(Yt[0].slice(Yt[0].lastIndexOf("[")+1,-1))&&(Ae=Ae.slice(0,Yt.index)+"["+Gr("a",Yt[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Yt=this.tokenizer.rules.inline.blockSkip.exec(Ae))!=null;)Ae=Ae.slice(0,Yt.index)+"["+Gr("a",Yt[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Yt=this.tokenizer.rules.inline.escapedEmSt.exec(Ae))!=null;)Ae=Ae.slice(0,Yt.index)+"++"+Ae.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;W;){if(vr||(ei=""),vr=!1,V=this.tokenizer.escape(W)){W=W.substring(V.raw.length),ge.push(V);continue}if(V=this.tokenizer.tag(W,Se,Ke)){W=W.substring(V.raw.length),Se=V.inLink,Ke=V.inRawBlock;var ui=ge[ge.length-1];ui&&V.type==="text"&&ui.type==="text"?(ui.raw+=V.raw,ui.text+=V.text):ge.push(V);continue}if(V=this.tokenizer.link(W)){W=W.substring(V.raw.length),V.type==="link"&&(V.tokens=this.inlineTokens(V.text,[],!0,Ke)),ge.push(V);continue}if(V=this.tokenizer.reflink(W,this.tokens.links)){W=W.substring(V.raw.length);var wr=ge[ge.length-1];V.type==="link"?(V.tokens=this.inlineTokens(V.text,[],!0,Ke),ge.push(V)):wr&&V.type==="text"&&wr.type==="text"?(wr.raw+=V.raw,wr.text+=V.text):ge.push(V);continue}if(V=this.tokenizer.emStrong(W,Ae,ei)){W=W.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],Se,Ke),ge.push(V);continue}if(V=this.tokenizer.codespan(W)){W=W.substring(V.raw.length),ge.push(V);continue}if(V=this.tokenizer.br(W)){W=W.substring(V.raw.length),ge.push(V);continue}if(V=this.tokenizer.del(W)){W=W.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],Se,Ke),ge.push(V);continue}if(V=this.tokenizer.autolink(W,nt)){W=W.substring(V.raw.length),ge.push(V);continue}if(!Se&&(V=this.tokenizer.url(W,nt))){W=W.substring(V.raw.length),ge.push(V);continue}if(V=this.tokenizer.inlineText(W,Ke,Ze)){W=W.substring(V.raw.length),V.raw.slice(-1)!=="_"&&(ei=V.raw.slice(-1)),vr=!0,qt=ge[ge.length-1],qt&&qt.type==="text"?(qt.raw+=V.raw,qt.text+=V.text):ge.push(V);continue}if(W){var bi="Infinite loop on byte: "+W.charCodeAt(0);if(this.options.silent){console.error(bi);break}else throw new Error(bi)}}return ge},J(Ne,null,[{key:"rules",get:function(){return{block:zr,inline:li}}}]),Ne}(),Ct=Le.exports.defaults,Dt=he.cleanUrl,ye=he.escape,Oe=function(){function Ne(Je){this.options=Je||Ct}var He=Ne.prototype;return He.code=function(W,ge,Se){var Ke=(ge||"").match(/\S*/)[0];if(this.options.highlight){var V=this.options.highlight(W,Ke);V!=null&&V!==W&&(Se=!0,W=V)}return W=W.replace(/\n$/,"")+`
`,Ke?'<pre><code class="'+this.options.langPrefix+ye(Ke,!0)+'">'+(Se?W:ye(W,!0))+`</code></pre>
`:"<pre><code>"+(Se?W:ye(W,!0))+`</code></pre>
`},He.blockquote=function(W){return`<blockquote>
`+W+`</blockquote>
`},He.html=function(W){return W},He.heading=function(W,ge,Se,Ke){return this.options.headerIds?"<h"+ge+' id="'+this.options.headerPrefix+Ke.slug(Se)+'">'+W+"</h"+ge+`>
`:"<h"+ge+">"+W+"</h"+ge+`>
`},He.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},He.list=function(W,ge,Se){var Ke=ge?"ol":"ul",V=ge&&Se!==1?' start="'+Se+'"':"";return"<"+Ke+V+`>
`+W+"</"+Ke+`>
`},He.listitem=function(W){return"<li>"+W+`</li>
`},He.checkbox=function(W){return"<input "+(W?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},He.paragraph=function(W){return"<p>"+W+`</p>
`},He.table=function(W,ge){return ge&&(ge="<tbody>"+ge+"</tbody>"),`<table>
<thead>
`+W+`</thead>
`+ge+`</table>
`},He.tablerow=function(W){return`<tr>
`+W+`</tr>
`},He.tablecell=function(W,ge){var Se=ge.header?"th":"td",Ke=ge.align?"<"+Se+' align="'+ge.align+'">':"<"+Se+">";return Ke+W+"</"+Se+`>
`},He.strong=function(W){return"<strong>"+W+"</strong>"},He.em=function(W){return"<em>"+W+"</em>"},He.codespan=function(W){return"<code>"+W+"</code>"},He.br=function(){return this.options.xhtml?"<br/>":"<br>"},He.del=function(W){return"<del>"+W+"</del>"},He.link=function(W,ge,Se){if(W=Dt(this.options.sanitize,this.options.baseUrl,W),W===null)return Se;var Ke='<a href="'+ye(W)+'"';return ge&&(Ke+=' title="'+ge+'"'),Ke+=">"+Se+"</a>",Ke},He.image=function(W,ge,Se){if(W=Dt(this.options.sanitize,this.options.baseUrl,W),W===null)return Se;var Ke='<img src="'+W+'" alt="'+Se+'"';return ge&&(Ke+=' title="'+ge+'"'),Ke+=this.options.xhtml?"/>":">",Ke},He.text=function(W){return W},Ne}(),et=function(){function Ne(){}var He=Ne.prototype;return He.strong=function(W){return W},He.em=function(W){return W},He.codespan=function(W){return W},He.del=function(W){return W},He.html=function(W){return W},He.text=function(W){return W},He.link=function(W,ge,Se){return""+Se},He.image=function(W,ge,Se){return""+Se},He.br=function(){return""},Ne}(),vt=function(){function Ne(){this.seen={}}var He=Ne.prototype;return He.serialize=function(W){return W.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},He.getNextSafeSlug=function(W,ge){var Se=W,Ke=0;if(this.seen.hasOwnProperty(Se)){Ke=this.seen[W];do Ke++,Se=W+"-"+Ke;while(this.seen.hasOwnProperty(Se))}return ge||(this.seen[W]=Ke,this.seen[Se]=0),Se},He.slug=function(W,ge){ge===void 0&&(ge={});var Se=this.serialize(W);return this.getNextSafeSlug(Se,ge.dryrun)},Ne}(),wt=Oe,Ht=et,fr=vt,Xt=Le.exports.defaults,Ue=he.unescape,Ut=function(){function Ne(Je){this.options=Je||Xt,this.options.renderer=this.options.renderer||new wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ht,this.slugger=new fr}Ne.parse=function(W,ge){var Se=new Ne(ge);return Se.parse(W)},Ne.parseInline=function(W,ge){var Se=new Ne(ge);return Se.parseInline(W)};var He=Ne.prototype;return He.parse=function(W,ge){ge===void 0&&(ge=!0);var Se="",Ke,V,qt,Ae,Yt,vr,ei,Ri,ui,wr,bi,me,Te,Mt,ct,Et,Ft,or,Jt=W.length;for(Ke=0;Ke<Jt;Ke++)switch(wr=W[Ke],wr.type){case"space":continue;case"hr":{Se+=this.renderer.hr();continue}case"heading":{Se+=this.renderer.heading(this.parseInline(wr.tokens),wr.depth,Ue(this.parseInline(wr.tokens,this.textRenderer)),this.slugger);continue}case"code":{Se+=this.renderer.code(wr.text,wr.lang,wr.escaped);continue}case"table":{for(Ri="",ei="",Ae=wr.header.length,V=0;V<Ae;V++)ei+=this.renderer.tablecell(this.parseInline(wr.tokens.header[V]),{header:!0,align:wr.align[V]});for(Ri+=this.renderer.tablerow(ei),ui="",Ae=wr.cells.length,V=0;V<Ae;V++){for(vr=wr.tokens.cells[V],ei="",Yt=vr.length,qt=0;qt<Yt;qt++)ei+=this.renderer.tablecell(this.parseInline(vr[qt]),{header:!1,align:wr.align[qt]});ui+=this.renderer.tablerow(ei)}Se+=this.renderer.table(Ri,ui);continue}case"blockquote":{ui=this.parse(wr.tokens),Se+=this.renderer.blockquote(ui);continue}case"list":{for(bi=wr.ordered,me=wr.start,Te=wr.loose,Ae=wr.items.length,ui="",V=0;V<Ae;V++)ct=wr.items[V],Et=ct.checked,Ft=ct.task,Mt="",ct.task&&(or=this.renderer.checkbox(Et),Te?ct.tokens.length>0&&ct.tokens[0].type==="text"?(ct.tokens[0].text=or+" "+ct.tokens[0].text,ct.tokens[0].tokens&&ct.tokens[0].tokens.length>0&&ct.tokens[0].tokens[0].type==="text"&&(ct.tokens[0].tokens[0].text=or+" "+ct.tokens[0].tokens[0].text)):ct.tokens.unshift({type:"text",text:or}):Mt+=or),Mt+=this.parse(ct.tokens,Te),ui+=this.renderer.listitem(Mt,Ft,Et);Se+=this.renderer.list(ui,bi,me);continue}case"html":{Se+=this.renderer.html(wr.text);continue}case"paragraph":{Se+=this.renderer.paragraph(this.parseInline(wr.tokens));continue}case"text":{for(ui=wr.tokens?this.parseInline(wr.tokens):wr.text;Ke+1<Jt&&W[Ke+1].type==="text";)wr=W[++Ke],ui+=`
`+(wr.tokens?this.parseInline(wr.tokens):wr.text);Se+=ge?this.renderer.paragraph(ui):ui;continue}default:{var Rr='Token with "'+wr.type+'" type was not found.';if(this.options.silent){console.error(Rr);return}else throw new Error(Rr)}}return Se},He.parseInline=function(W,ge){ge=ge||this.renderer;var Se="",Ke,V,qt=W.length;for(Ke=0;Ke<qt;Ke++)switch(V=W[Ke],V.type){case"escape":{Se+=ge.text(V.text);break}case"html":{Se+=ge.html(V.text);break}case"link":{Se+=ge.link(V.href,V.title,this.parseInline(V.tokens,ge));break}case"image":{Se+=ge.image(V.href,V.title,V.text);break}case"strong":{Se+=ge.strong(this.parseInline(V.tokens,ge));break}case"em":{Se+=ge.em(this.parseInline(V.tokens,ge));break}case"codespan":{Se+=ge.codespan(V.text);break}case"br":{Se+=ge.br();break}case"del":{Se+=ge.del(this.parseInline(V.tokens,ge));break}case"text":{Se+=ge.text(V.text);break}default:{var Ae='Token with "'+V.type+'" type was not found.';if(this.options.silent){console.error(Ae);return}else throw new Error(Ae)}}return Se},Ne}(),_r=Qe,Fe=Ut,Ge=ot,it=Oe,Pt=et,kt=vt,zt=he.merge,rr=he.checkSanitizeDeprecation,T=he.escape,B=Le.exports.getDefaults,dt=Le.exports.changeDefaults,G=Le.exports.defaults;function fe(Ne,He,Je){if(typeof Ne=="undefined"||Ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ne)+", string expected");if(typeof He=="function"&&(Je=He,He=null),He=zt({},fe.defaults,He||{}),rr(He),Je){var W=He.highlight,ge;try{ge=_r.lex(Ne,He)}catch(qt){return Je(qt)}var Se=function(Ae){var Yt;if(!Ae)try{He.walkTokens&&fe.walkTokens(ge,He.walkTokens),Yt=Fe.parse(ge,He)}catch(vr){Ae=vr}return He.highlight=W,Ae?Je(Ae):Je(null,Yt)};if(!W||W.length<3||(delete He.highlight,!ge.length))return Se();var Ke=0;fe.walkTokens(ge,function(qt){qt.type==="code"&&(Ke++,setTimeout(function(){W(qt.text,qt.lang,function(Ae,Yt){if(Ae)return Se(Ae);Yt!=null&&Yt!==qt.text&&(qt.text=Yt,qt.escaped=!0),Ke--,Ke===0&&Se()})},0))}),Ke===0&&Se();return}try{var V=_r.lex(Ne,He);return He.walkTokens&&fe.walkTokens(V,He.walkTokens),Fe.parse(V,He)}catch(qt){if(qt.message+=`
Please report this to https://github.com/markedjs/marked.`,He.silent)return"<p>An error occurred:</p><pre>"+T(qt.message+"",!0)+"</pre>";throw qt}}fe.options=fe.setOptions=function(Ne){return zt(fe.defaults,Ne),dt(fe.defaults),fe},fe.getDefaults=B,fe.defaults=G,fe.use=function(Ne){var He=zt({},Ne);if(Ne.renderer&&function(){var W=fe.defaults.renderer||new it,ge=function(V){var qt=W[V];W[V]=function(){for(var Ae=arguments.length,Yt=new Array(Ae),vr=0;vr<Ae;vr++)Yt[vr]=arguments[vr];var ei=Ne.renderer[V].apply(W,Yt);return ei===!1&&(ei=qt.apply(W,Yt)),ei}};for(var Se in Ne.renderer)ge(Se);He.renderer=W}(),Ne.tokenizer&&function(){var W=fe.defaults.tokenizer||new Ge,ge=function(V){var qt=W[V];W[V]=function(){for(var Ae=arguments.length,Yt=new Array(Ae),vr=0;vr<Ae;vr++)Yt[vr]=arguments[vr];var ei=Ne.tokenizer[V].apply(W,Yt);return ei===!1&&(ei=qt.apply(W,Yt)),ei}};for(var Se in Ne.tokenizer)ge(Se);He.tokenizer=W}(),Ne.walkTokens){var Je=fe.defaults.walkTokens;He.walkTokens=function(W){Ne.walkTokens(W),Je&&Je(W)}}fe.setOptions(He)},fe.walkTokens=function(Ne,He){for(var Je=rt(Ne),W;!(W=Je()).done;){var ge=W.value;switch(He(ge),ge.type){case"table":{for(var Se=rt(ge.tokens.header),Ke;!(Ke=Se()).done;){var V=Ke.value;fe.walkTokens(V,He)}for(var qt=rt(ge.tokens.cells),Ae;!(Ae=qt()).done;)for(var Yt=Ae.value,vr=rt(Yt),ei;!(ei=vr()).done;){var Ri=ei.value;fe.walkTokens(Ri,He)}break}case"list":{fe.walkTokens(ge.items,He);break}default:ge.tokens&&fe.walkTokens(ge.tokens,He)}}},fe.parseInline=function(Ne,He){if(typeof Ne=="undefined"||Ne===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Ne!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Ne)+", string expected");He=zt({},fe.defaults,He||{}),rr(He);try{var Je=_r.lexInline(Ne,He);return He.walkTokens&&fe.walkTokens(Je,He.walkTokens),Fe.parseInline(Je,He)}catch(W){if(W.message+=`
Please report this to https://github.com/markedjs/marked.`,He.silent)return"<p>An error occurred:</p><pre>"+T(W.message+"",!0)+"</pre>";throw W}},fe.Parser=Fe,fe.parser=Fe.parse,fe.Renderer=it,fe.TextRenderer=Pt,fe.Lexer=_r,fe.lexer=_r.lex,fe.Tokenizer=Ge,fe.Slugger=kt,fe.parse=fe;var xr=fe;return xr})},11690:function(Fr){const Rt=/[&<>"']/,J=/[&<>"']/g,pe=/[<>"']|&(?!#?\w+;)/,Pe=/[<>"']|&(?!#?\w+;)/g,rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Le=ve=>rt[ve];function te(ve,Ye){if(Ye){if(Rt.test(ve))return ve.replace(J,Le)}else if(pe.test(ve))return ve.replace(Pe,Le);return ve}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Me(ve){return ve.replace(E,(Ye,We)=>(We=We.toLowerCase(),We==="colon"?":":We.charAt(0)==="#"?We.charAt(1)==="x"?String.fromCharCode(parseInt(We.substring(2),16)):String.fromCharCode(+We.substring(1)):""))}const $=/(^|[^\[])\^/g;function d(ve,Ye){ve=ve.source||ve,Ye=Ye||"";const We={replace:(ut,pt)=>(pt=pt.source||pt,pt=pt.replace($,"$1"),ve=ve.replace(ut,pt),We),getRegex:()=>new RegExp(ve,Ye)};return We}const be=/[^\w:]/g,j=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(ve,Ye,We){if(ve){let ut;try{ut=decodeURIComponent(Me(We)).replace(be,"").toLowerCase()}catch(pt){return null}if(ut.indexOf("javascript:")===0||ut.indexOf("vbscript:")===0||ut.indexOf("data:")===0)return null}Ye&&!j.test(We)&&(We=ae(Ye,We));try{We=encodeURI(We).replace(/%25/g,"%")}catch(ut){return null}return We}const M={},O=/^[^:]+:\/*[^/]*$/,K=/^([^:]+:)[\s\S]*$/,se=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ae(ve,Ye){M[" "+ve]||(O.test(ve)?M[" "+ve]=ve+"/":M[" "+ve]=ue(ve,"/",!0)),ve=M[" "+ve];const We=ve.indexOf(":")===-1;return Ye.substring(0,2)==="//"?We?Ye:ve.replace(K,"$1")+Ye:Ye.charAt(0)==="/"?We?Ye:ve.replace(se,"$1")+Ye:ve+Ye}const Z={exec:function(){}};function q(ve){let Ye=1,We,ut;for(;Ye<arguments.length;Ye++){We=arguments[Ye];for(ut in We)Object.prototype.hasOwnProperty.call(We,ut)&&(ve[ut]=We[ut])}return ve}function Y(ve,Ye){const We=ve.replace(/\|/g,(de,re,ce)=>{let he=!1,Re=re;for(;--Re>=0&&ce[Re]==="\\";)he=!he;return he?"|":" |"}),ut=We.split(/ \|/);let pt=0;if(ut.length>Ye)ut.splice(Ye);else for(;ut.length<Ye;)ut.push("");for(;pt<ut.length;pt++)ut[pt]=ut[pt].trim().replace(/\\\|/g,"|");return ut}function ue(ve,Ye,We){const ut=ve.length;if(ut===0)return"";let pt=0;for(;pt<ut;){const de=ve.charAt(ut-pt-1);if(de===Ye&&!We)pt++;else if(de!==Ye&&We)pt++;else break}return ve.substr(0,ut-pt)}function ee(ve,Ye){if(ve.indexOf(Ye[1])===-1)return-1;const We=ve.length;let ut=0,pt=0;for(;pt<We;pt++)if(ve[pt]==="\\")pt++;else if(ve[pt]===Ye[0])ut++;else if(ve[pt]===Ye[1]&&(ut--,ut<0))return pt;return-1}function oe(ve){ve&&ve.sanitize&&!ve.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function De(ve,Ye){if(Ye<1)return"";let We="";for(;Ye>1;)Ye&1&&(We+=ve),Ye>>=1,ve+=ve;return We+ve}Fr.exports={escape:te,unescape:Me,edit:d,cleanUrl:k,resolveUrl:ae,noopTest:Z,merge:q,splitCells:Y,rtrim:ue,findClosingBracket:ee,checkSanitizeDeprecation:oe,repeatString:De}},75918:function(Fr,Rt,J){"use strict";J.d(Rt,{Wi:function(){return E},Z0:function(){return Me},aU:function(){return te},eZ:function(){return d},wY:function(){return $}});var pe=J(4348),Pe=J(69323),rt=J(13268),Le=function(be,j,k,M){function O(K){return K instanceof k?K:new k(function(se){se(K)})}return new(k||(k=Promise))(function(K,se){function ae(Y){try{q(M.next(Y))}catch(ue){se(ue)}}function Z(Y){try{q(M.throw(Y))}catch(ue){se(ue)}}function q(Y){Y.done?K(Y.value):O(Y.value).then(ae,Z)}q((M=M.apply(be,j||[])).next())})};class te extends Pe.JT{constructor(j,k="",M="",O=!0,K){super(),this._onDidChange=this._register(new pe.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=j,this._label=k,this._cssClass=M,this._enabled=O,this._actionCallback=K}get id(){return this._id}get label(){return this._label}set label(j){this._setLabel(j)}_setLabel(j){this._label!==j&&(this._label=j,this._onDidChange.fire({label:j}))}get tooltip(){return this._tooltip||""}set tooltip(j){this._setTooltip(j)}_setTooltip(j){this._tooltip!==j&&(this._tooltip=j,this._onDidChange.fire({tooltip:j}))}get class(){return this._cssClass}set class(j){this._setClass(j)}_setClass(j){this._cssClass!==j&&(this._cssClass=j,this._onDidChange.fire({class:j}))}get enabled(){return this._enabled}set enabled(j){this._setEnabled(j)}_setEnabled(j){this._enabled!==j&&(this._enabled=j,this._onDidChange.fire({enabled:j}))}get checked(){return this._checked}set checked(j){this._setChecked(j)}_setChecked(j){this._checked!==j&&(this._checked=j,this._onDidChange.fire({checked:j}))}run(j,k){return Le(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(j))})}}class E extends Pe.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new pe.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new pe.Q5),this.onDidRun=this._onDidRun.event}run(j,k){return Le(this,void 0,void 0,function*(){if(!j.enabled)return;this._onBeforeRun.fire({action:j});let M;try{yield this.runAction(j,k)}catch(O){M=O}this._onDidRun.fire({action:j,error:M})})}runAction(j,k){return Le(this,void 0,void 0,function*(){yield j.run(k)})}}class Me extends te{constructor(j){super(Me.ID,j,j?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Me.ID="vs.actions.separator";class ${constructor(j,k,M,O){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=j,this.label=k,this.class=O,this._actions=M}get actions(){return this._actions}dispose(){}run(){return Le(this,void 0,void 0,function*(){})}}class d extends te{constructor(){super(d.ID,rt.N("submenu.empty","(empty)"),void 0,!1)}}d.ID="vs.actions.empty"},76068:function(Fr,Rt,J){"use strict";J.d(Rt,{ok:function(){return pe}});function pe(Pe,rt){if(!Pe)throw new Error(rt?`Assertion failed (${rt})`:"Assertion Failed")}},52615:function(Fr,Rt,J){"use strict";J.d(Rt,{CM:function(){return te},JL:function(){return E},dT:function(){return $},fK:function(){return Le},lA:function(){return Me}});var pe=J(4348);class Pe{constructor(){this._icons=new Map,this._onDidRegister=new pe.Q5}add(be){const j=this._icons.get(be.id);j?be.description?j.description=be.description:console.error(`Duplicate registration of codicon ${be.id}`):(this._icons.set(be.id,be),this._onDidRegister.fire(be))}get(be){return this._icons.get(be)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const rt=new Pe,Le=rt;function te(d,be){return new Me(d,be)}function E(d){return d?d.replace(/\$\((.*?)\)/g,(be,j)=>` ${j} `).trim():""}class Me{constructor(be,j,k){this.id=be,this.definition=j,this.description=k,rt.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var $;(function(d){d.iconNameSegment="[A-Za-z0-9]+",d.iconNameExpression="[A-Za-z0-9\\-]+",d.iconModifierExpression="~[A-Za-z]+";const be=new RegExp(`^(${d.iconNameExpression})(${d.iconModifierExpression})?$`);function j(O){if(O instanceof Me)return["codicon","codicon-"+O.id];const K=be.exec(O.id);if(!K)return j(Me.error);let[,se,ae]=K;const Z=["codicon","codicon-"+se];return ae&&Z.push("codicon-modifier-"+ae.substr(1)),Z}d.asClassNameArray=j;function k(O){return j(O).join(" ")}d.asClassName=k;function M(O){return"."+j(O).join(".")}d.asCSSSelector=M})($||($={})),function(d){d.add=new d("add",{fontCharacter:"\\ea60"}),d.plus=new d("plus",d.add.definition),d.gistNew=new d("gist-new",d.add.definition),d.repoCreate=new d("repo-create",d.add.definition),d.lightbulb=new d("lightbulb",{fontCharacter:"\\ea61"}),d.lightBulb=new d("light-bulb",{fontCharacter:"\\ea61"}),d.repo=new d("repo",{fontCharacter:"\\ea62"}),d.repoDelete=new d("repo-delete",{fontCharacter:"\\ea62"}),d.gistFork=new d("gist-fork",{fontCharacter:"\\ea63"}),d.repoForked=new d("repo-forked",{fontCharacter:"\\ea63"}),d.gitPullRequest=new d("git-pull-request",{fontCharacter:"\\ea64"}),d.gitPullRequestAbandoned=new d("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),d.recordKeys=new d("record-keys",{fontCharacter:"\\ea65"}),d.keyboard=new d("keyboard",{fontCharacter:"\\ea65"}),d.tag=new d("tag",{fontCharacter:"\\ea66"}),d.tagAdd=new d("tag-add",{fontCharacter:"\\ea66"}),d.tagRemove=new d("tag-remove",{fontCharacter:"\\ea66"}),d.person=new d("person",{fontCharacter:"\\ea67"}),d.personFollow=new d("person-follow",{fontCharacter:"\\ea67"}),d.personOutline=new d("person-outline",{fontCharacter:"\\ea67"}),d.personFilled=new d("person-filled",{fontCharacter:"\\ea67"}),d.gitBranch=new d("git-branch",{fontCharacter:"\\ea68"}),d.gitBranchCreate=new d("git-branch-create",{fontCharacter:"\\ea68"}),d.gitBranchDelete=new d("git-branch-delete",{fontCharacter:"\\ea68"}),d.sourceControl=new d("source-control",{fontCharacter:"\\ea68"}),d.mirror=new d("mirror",{fontCharacter:"\\ea69"}),d.mirrorPublic=new d("mirror-public",{fontCharacter:"\\ea69"}),d.star=new d("star",{fontCharacter:"\\ea6a"}),d.starAdd=new d("star-add",{fontCharacter:"\\ea6a"}),d.starDelete=new d("star-delete",{fontCharacter:"\\ea6a"}),d.starEmpty=new d("star-empty",{fontCharacter:"\\ea6a"}),d.comment=new d("comment",{fontCharacter:"\\ea6b"}),d.commentAdd=new d("comment-add",{fontCharacter:"\\ea6b"}),d.alert=new d("alert",{fontCharacter:"\\ea6c"}),d.warning=new d("warning",{fontCharacter:"\\ea6c"}),d.search=new d("search",{fontCharacter:"\\ea6d"}),d.searchSave=new d("search-save",{fontCharacter:"\\ea6d"}),d.logOut=new d("log-out",{fontCharacter:"\\ea6e"}),d.signOut=new d("sign-out",{fontCharacter:"\\ea6e"}),d.logIn=new d("log-in",{fontCharacter:"\\ea6f"}),d.signIn=new d("sign-in",{fontCharacter:"\\ea6f"}),d.eye=new d("eye",{fontCharacter:"\\ea70"}),d.eyeUnwatch=new d("eye-unwatch",{fontCharacter:"\\ea70"}),d.eyeWatch=new d("eye-watch",{fontCharacter:"\\ea70"}),d.circleFilled=new d("circle-filled",{fontCharacter:"\\ea71"}),d.primitiveDot=new d("primitive-dot",{fontCharacter:"\\ea71"}),d.closeDirty=new d("close-dirty",{fontCharacter:"\\ea71"}),d.debugBreakpoint=new d("debug-breakpoint",{fontCharacter:"\\ea71"}),d.debugBreakpointDisabled=new d("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),d.debugHint=new d("debug-hint",{fontCharacter:"\\ea71"}),d.primitiveSquare=new d("primitive-square",{fontCharacter:"\\ea72"}),d.edit=new d("edit",{fontCharacter:"\\ea73"}),d.pencil=new d("pencil",{fontCharacter:"\\ea73"}),d.info=new d("info",{fontCharacter:"\\ea74"}),d.issueOpened=new d("issue-opened",{fontCharacter:"\\ea74"}),d.gistPrivate=new d("gist-private",{fontCharacter:"\\ea75"}),d.gitForkPrivate=new d("git-fork-private",{fontCharacter:"\\ea75"}),d.lock=new d("lock",{fontCharacter:"\\ea75"}),d.mirrorPrivate=new d("mirror-private",{fontCharacter:"\\ea75"}),d.close=new d("close",{fontCharacter:"\\ea76"}),d.removeClose=new d("remove-close",{fontCharacter:"\\ea76"}),d.x=new d("x",{fontCharacter:"\\ea76"}),d.repoSync=new d("repo-sync",{fontCharacter:"\\ea77"}),d.sync=new d("sync",{fontCharacter:"\\ea77"}),d.clone=new d("clone",{fontCharacter:"\\ea78"}),d.desktopDownload=new d("desktop-download",{fontCharacter:"\\ea78"}),d.beaker=new d("beaker",{fontCharacter:"\\ea79"}),d.microscope=new d("microscope",{fontCharacter:"\\ea79"}),d.vm=new d("vm",{fontCharacter:"\\ea7a"}),d.deviceDesktop=new d("device-desktop",{fontCharacter:"\\ea7a"}),d.file=new d("file",{fontCharacter:"\\ea7b"}),d.fileText=new d("file-text",{fontCharacter:"\\ea7b"}),d.more=new d("more",{fontCharacter:"\\ea7c"}),d.ellipsis=new d("ellipsis",{fontCharacter:"\\ea7c"}),d.kebabHorizontal=new d("kebab-horizontal",{fontCharacter:"\\ea7c"}),d.mailReply=new d("mail-reply",{fontCharacter:"\\ea7d"}),d.reply=new d("reply",{fontCharacter:"\\ea7d"}),d.organization=new d("organization",{fontCharacter:"\\ea7e"}),d.organizationFilled=new d("organization-filled",{fontCharacter:"\\ea7e"}),d.organizationOutline=new d("organization-outline",{fontCharacter:"\\ea7e"}),d.newFile=new d("new-file",{fontCharacter:"\\ea7f"}),d.fileAdd=new d("file-add",{fontCharacter:"\\ea7f"}),d.newFolder=new d("new-folder",{fontCharacter:"\\ea80"}),d.fileDirectoryCreate=new d("file-directory-create",{fontCharacter:"\\ea80"}),d.trash=new d("trash",{fontCharacter:"\\ea81"}),d.trashcan=new d("trashcan",{fontCharacter:"\\ea81"}),d.history=new d("history",{fontCharacter:"\\ea82"}),d.clock=new d("clock",{fontCharacter:"\\ea82"}),d.folder=new d("folder",{fontCharacter:"\\ea83"}),d.fileDirectory=new d("file-directory",{fontCharacter:"\\ea83"}),d.symbolFolder=new d("symbol-folder",{fontCharacter:"\\ea83"}),d.logoGithub=new d("logo-github",{fontCharacter:"\\ea84"}),d.markGithub=new d("mark-github",{fontCharacter:"\\ea84"}),d.github=new d("github",{fontCharacter:"\\ea84"}),d.terminal=new d("terminal",{fontCharacter:"\\ea85"}),d.console=new d("console",{fontCharacter:"\\ea85"}),d.repl=new d("repl",{fontCharacter:"\\ea85"}),d.zap=new d("zap",{fontCharacter:"\\ea86"}),d.symbolEvent=new d("symbol-event",{fontCharacter:"\\ea86"}),d.error=new d("error",{fontCharacter:"\\ea87"}),d.stop=new d("stop",{fontCharacter:"\\ea87"}),d.variable=new d("variable",{fontCharacter:"\\ea88"}),d.symbolVariable=new d("symbol-variable",{fontCharacter:"\\ea88"}),d.array=new d("array",{fontCharacter:"\\ea8a"}),d.symbolArray=new d("symbol-array",{fontCharacter:"\\ea8a"}),d.symbolModule=new d("symbol-module",{fontCharacter:"\\ea8b"}),d.symbolPackage=new d("symbol-package",{fontCharacter:"\\ea8b"}),d.symbolNamespace=new d("symbol-namespace",{fontCharacter:"\\ea8b"}),d.symbolObject=new d("symbol-object",{fontCharacter:"\\ea8b"}),d.symbolMethod=new d("symbol-method",{fontCharacter:"\\ea8c"}),d.symbolFunction=new d("symbol-function",{fontCharacter:"\\ea8c"}),d.symbolConstructor=new d("symbol-constructor",{fontCharacter:"\\ea8c"}),d.symbolBoolean=new d("symbol-boolean",{fontCharacter:"\\ea8f"}),d.symbolNull=new d("symbol-null",{fontCharacter:"\\ea8f"}),d.symbolNumeric=new d("symbol-numeric",{fontCharacter:"\\ea90"}),d.symbolNumber=new d("symbol-number",{fontCharacter:"\\ea90"}),d.symbolStructure=new d("symbol-structure",{fontCharacter:"\\ea91"}),d.symbolStruct=new d("symbol-struct",{fontCharacter:"\\ea91"}),d.symbolParameter=new d("symbol-parameter",{fontCharacter:"\\ea92"}),d.symbolTypeParameter=new d("symbol-type-parameter",{fontCharacter:"\\ea92"}),d.symbolKey=new d("symbol-key",{fontCharacter:"\\ea93"}),d.symbolText=new d("symbol-text",{fontCharacter:"\\ea93"}),d.symbolReference=new d("symbol-reference",{fontCharacter:"\\ea94"}),d.goToFile=new d("go-to-file",{fontCharacter:"\\ea94"}),d.symbolEnum=new d("symbol-enum",{fontCharacter:"\\ea95"}),d.symbolValue=new d("symbol-value",{fontCharacter:"\\ea95"}),d.symbolRuler=new d("symbol-ruler",{fontCharacter:"\\ea96"}),d.symbolUnit=new d("symbol-unit",{fontCharacter:"\\ea96"}),d.activateBreakpoints=new d("activate-breakpoints",{fontCharacter:"\\ea97"}),d.archive=new d("archive",{fontCharacter:"\\ea98"}),d.arrowBoth=new d("arrow-both",{fontCharacter:"\\ea99"}),d.arrowDown=new d("arrow-down",{fontCharacter:"\\ea9a"}),d.arrowLeft=new d("arrow-left",{fontCharacter:"\\ea9b"}),d.arrowRight=new d("arrow-right",{fontCharacter:"\\ea9c"}),d.arrowSmallDown=new d("arrow-small-down",{fontCharacter:"\\ea9d"}),d.arrowSmallLeft=new d("arrow-small-left",{fontCharacter:"\\ea9e"}),d.arrowSmallRight=new d("arrow-small-right",{fontCharacter:"\\ea9f"}),d.arrowSmallUp=new d("arrow-small-up",{fontCharacter:"\\eaa0"}),d.arrowUp=new d("arrow-up",{fontCharacter:"\\eaa1"}),d.bell=new d("bell",{fontCharacter:"\\eaa2"}),d.bold=new d("bold",{fontCharacter:"\\eaa3"}),d.book=new d("book",{fontCharacter:"\\eaa4"}),d.bookmark=new d("bookmark",{fontCharacter:"\\eaa5"}),d.debugBreakpointConditionalUnverified=new d("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),d.debugBreakpointConditional=new d("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),d.debugBreakpointConditionalDisabled=new d("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),d.debugBreakpointDataUnverified=new d("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),d.debugBreakpointData=new d("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),d.debugBreakpointDataDisabled=new d("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),d.debugBreakpointLogUnverified=new d("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),d.debugBreakpointLog=new d("debug-breakpoint-log",{fontCharacter:"\\eaab"}),d.debugBreakpointLogDisabled=new d("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),d.briefcase=new d("briefcase",{fontCharacter:"\\eaac"}),d.broadcast=new d("broadcast",{fontCharacter:"\\eaad"}),d.browser=new d("browser",{fontCharacter:"\\eaae"}),d.bug=new d("bug",{fontCharacter:"\\eaaf"}),d.calendar=new d("calendar",{fontCharacter:"\\eab0"}),d.caseSensitive=new d("case-sensitive",{fontCharacter:"\\eab1"}),d.check=new d("check",{fontCharacter:"\\eab2"}),d.checklist=new d("checklist",{fontCharacter:"\\eab3"}),d.chevronDown=new d("chevron-down",{fontCharacter:"\\eab4"}),d.dropDownButton=new d("drop-down-button",d.chevronDown.definition),d.chevronLeft=new d("chevron-left",{fontCharacter:"\\eab5"}),d.chevronRight=new d("chevron-right",{fontCharacter:"\\eab6"}),d.chevronUp=new d("chevron-up",{fontCharacter:"\\eab7"}),d.chromeClose=new d("chrome-close",{fontCharacter:"\\eab8"}),d.chromeMaximize=new d("chrome-maximize",{fontCharacter:"\\eab9"}),d.chromeMinimize=new d("chrome-minimize",{fontCharacter:"\\eaba"}),d.chromeRestore=new d("chrome-restore",{fontCharacter:"\\eabb"}),d.circleOutline=new d("circle-outline",{fontCharacter:"\\eabc"}),d.debugBreakpointUnverified=new d("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),d.circleSlash=new d("circle-slash",{fontCharacter:"\\eabd"}),d.circuitBoard=new d("circuit-board",{fontCharacter:"\\eabe"}),d.clearAll=new d("clear-all",{fontCharacter:"\\eabf"}),d.clippy=new d("clippy",{fontCharacter:"\\eac0"}),d.closeAll=new d("close-all",{fontCharacter:"\\eac1"}),d.cloudDownload=new d("cloud-download",{fontCharacter:"\\eac2"}),d.cloudUpload=new d("cloud-upload",{fontCharacter:"\\eac3"}),d.code=new d("code",{fontCharacter:"\\eac4"}),d.collapseAll=new d("collapse-all",{fontCharacter:"\\eac5"}),d.colorMode=new d("color-mode",{fontCharacter:"\\eac6"}),d.commentDiscussion=new d("comment-discussion",{fontCharacter:"\\eac7"}),d.compareChanges=new d("compare-changes",{fontCharacter:"\\eafd"}),d.creditCard=new d("credit-card",{fontCharacter:"\\eac9"}),d.dash=new d("dash",{fontCharacter:"\\eacc"}),d.dashboard=new d("dashboard",{fontCharacter:"\\eacd"}),d.database=new d("database",{fontCharacter:"\\eace"}),d.debugContinue=new d("debug-continue",{fontCharacter:"\\eacf"}),d.debugDisconnect=new d("debug-disconnect",{fontCharacter:"\\ead0"}),d.debugPause=new d("debug-pause",{fontCharacter:"\\ead1"}),d.debugRestart=new d("debug-restart",{fontCharacter:"\\ead2"}),d.debugStart=new d("debug-start",{fontCharacter:"\\ead3"}),d.debugStepInto=new d("debug-step-into",{fontCharacter:"\\ead4"}),d.debugStepOut=new d("debug-step-out",{fontCharacter:"\\ead5"}),d.debugStepOver=new d("debug-step-over",{fontCharacter:"\\ead6"}),d.debugStop=new d("debug-stop",{fontCharacter:"\\ead7"}),d.debug=new d("debug",{fontCharacter:"\\ead8"}),d.deviceCameraVideo=new d("device-camera-video",{fontCharacter:"\\ead9"}),d.deviceCamera=new d("device-camera",{fontCharacter:"\\eada"}),d.deviceMobile=new d("device-mobile",{fontCharacter:"\\eadb"}),d.diffAdded=new d("diff-added",{fontCharacter:"\\eadc"}),d.diffIgnored=new d("diff-ignored",{fontCharacter:"\\eadd"}),d.diffModified=new d("diff-modified",{fontCharacter:"\\eade"}),d.diffRemoved=new d("diff-removed",{fontCharacter:"\\eadf"}),d.diffRenamed=new d("diff-renamed",{fontCharacter:"\\eae0"}),d.diff=new d("diff",{fontCharacter:"\\eae1"}),d.discard=new d("discard",{fontCharacter:"\\eae2"}),d.editorLayout=new d("editor-layout",{fontCharacter:"\\eae3"}),d.emptyWindow=new d("empty-window",{fontCharacter:"\\eae4"}),d.exclude=new d("exclude",{fontCharacter:"\\eae5"}),d.extensions=new d("extensions",{fontCharacter:"\\eae6"}),d.eyeClosed=new d("eye-closed",{fontCharacter:"\\eae7"}),d.fileBinary=new d("file-binary",{fontCharacter:"\\eae8"}),d.fileCode=new d("file-code",{fontCharacter:"\\eae9"}),d.fileMedia=new d("file-media",{fontCharacter:"\\eaea"}),d.filePdf=new d("file-pdf",{fontCharacter:"\\eaeb"}),d.fileSubmodule=new d("file-submodule",{fontCharacter:"\\eaec"}),d.fileSymlinkDirectory=new d("file-symlink-directory",{fontCharacter:"\\eaed"}),d.fileSymlinkFile=new d("file-symlink-file",{fontCharacter:"\\eaee"}),d.fileZip=new d("file-zip",{fontCharacter:"\\eaef"}),d.files=new d("files",{fontCharacter:"\\eaf0"}),d.filter=new d("filter",{fontCharacter:"\\eaf1"}),d.flame=new d("flame",{fontCharacter:"\\eaf2"}),d.foldDown=new d("fold-down",{fontCharacter:"\\eaf3"}),d.foldUp=new d("fold-up",{fontCharacter:"\\eaf4"}),d.fold=new d("fold",{fontCharacter:"\\eaf5"}),d.folderActive=new d("folder-active",{fontCharacter:"\\eaf6"}),d.folderOpened=new d("folder-opened",{fontCharacter:"\\eaf7"}),d.gear=new d("gear",{fontCharacter:"\\eaf8"}),d.gift=new d("gift",{fontCharacter:"\\eaf9"}),d.gistSecret=new d("gist-secret",{fontCharacter:"\\eafa"}),d.gist=new d("gist",{fontCharacter:"\\eafb"}),d.gitCommit=new d("git-commit",{fontCharacter:"\\eafc"}),d.gitCompare=new d("git-compare",{fontCharacter:"\\eafd"}),d.gitMerge=new d("git-merge",{fontCharacter:"\\eafe"}),d.githubAction=new d("github-action",{fontCharacter:"\\eaff"}),d.githubAlt=new d("github-alt",{fontCharacter:"\\eb00"}),d.globe=new d("globe",{fontCharacter:"\\eb01"}),d.grabber=new d("grabber",{fontCharacter:"\\eb02"}),d.graph=new d("graph",{fontCharacter:"\\eb03"}),d.gripper=new d("gripper",{fontCharacter:"\\eb04"}),d.heart=new d("heart",{fontCharacter:"\\eb05"}),d.home=new d("home",{fontCharacter:"\\eb06"}),d.horizontalRule=new d("horizontal-rule",{fontCharacter:"\\eb07"}),d.hubot=new d("hubot",{fontCharacter:"\\eb08"}),d.inbox=new d("inbox",{fontCharacter:"\\eb09"}),d.issueClosed=new d("issue-closed",{fontCharacter:"\\eba4"}),d.issueReopened=new d("issue-reopened",{fontCharacter:"\\eb0b"}),d.issues=new d("issues",{fontCharacter:"\\eb0c"}),d.italic=new d("italic",{fontCharacter:"\\eb0d"}),d.jersey=new d("jersey",{fontCharacter:"\\eb0e"}),d.json=new d("json",{fontCharacter:"\\eb0f"}),d.kebabVertical=new d("kebab-vertical",{fontCharacter:"\\eb10"}),d.key=new d("key",{fontCharacter:"\\eb11"}),d.law=new d("law",{fontCharacter:"\\eb12"}),d.lightbulbAutofix=new d("lightbulb-autofix",{fontCharacter:"\\eb13"}),d.linkExternal=new d("link-external",{fontCharacter:"\\eb14"}),d.link=new d("link",{fontCharacter:"\\eb15"}),d.listOrdered=new d("list-ordered",{fontCharacter:"\\eb16"}),d.listUnordered=new d("list-unordered",{fontCharacter:"\\eb17"}),d.liveShare=new d("live-share",{fontCharacter:"\\eb18"}),d.loading=new d("loading",{fontCharacter:"\\eb19"}),d.location=new d("location",{fontCharacter:"\\eb1a"}),d.mailRead=new d("mail-read",{fontCharacter:"\\eb1b"}),d.mail=new d("mail",{fontCharacter:"\\eb1c"}),d.markdown=new d("markdown",{fontCharacter:"\\eb1d"}),d.megaphone=new d("megaphone",{fontCharacter:"\\eb1e"}),d.mention=new d("mention",{fontCharacter:"\\eb1f"}),d.milestone=new d("milestone",{fontCharacter:"\\eb20"}),d.mortarBoard=new d("mortar-board",{fontCharacter:"\\eb21"}),d.move=new d("move",{fontCharacter:"\\eb22"}),d.multipleWindows=new d("multiple-windows",{fontCharacter:"\\eb23"}),d.mute=new d("mute",{fontCharacter:"\\eb24"}),d.noNewline=new d("no-newline",{fontCharacter:"\\eb25"}),d.note=new d("note",{fontCharacter:"\\eb26"}),d.octoface=new d("octoface",{fontCharacter:"\\eb27"}),d.openPreview=new d("open-preview",{fontCharacter:"\\eb28"}),d.package_=new d("package",{fontCharacter:"\\eb29"}),d.paintcan=new d("paintcan",{fontCharacter:"\\eb2a"}),d.pin=new d("pin",{fontCharacter:"\\eb2b"}),d.play=new d("play",{fontCharacter:"\\eb2c"}),d.run=new d("run",{fontCharacter:"\\eb2c"}),d.plug=new d("plug",{fontCharacter:"\\eb2d"}),d.preserveCase=new d("preserve-case",{fontCharacter:"\\eb2e"}),d.preview=new d("preview",{fontCharacter:"\\eb2f"}),d.project=new d("project",{fontCharacter:"\\eb30"}),d.pulse=new d("pulse",{fontCharacter:"\\eb31"}),d.question=new d("question",{fontCharacter:"\\eb32"}),d.quote=new d("quote",{fontCharacter:"\\eb33"}),d.radioTower=new d("radio-tower",{fontCharacter:"\\eb34"}),d.reactions=new d("reactions",{fontCharacter:"\\eb35"}),d.references=new d("references",{fontCharacter:"\\eb36"}),d.refresh=new d("refresh",{fontCharacter:"\\eb37"}),d.regex=new d("regex",{fontCharacter:"\\eb38"}),d.remoteExplorer=new d("remote-explorer",{fontCharacter:"\\eb39"}),d.remote=new d("remote",{fontCharacter:"\\eb3a"}),d.remove=new d("remove",{fontCharacter:"\\eb3b"}),d.replaceAll=new d("replace-all",{fontCharacter:"\\eb3c"}),d.replace=new d("replace",{fontCharacter:"\\eb3d"}),d.repoClone=new d("repo-clone",{fontCharacter:"\\eb3e"}),d.repoForcePush=new d("repo-force-push",{fontCharacter:"\\eb3f"}),d.repoPull=new d("repo-pull",{fontCharacter:"\\eb40"}),d.repoPush=new d("repo-push",{fontCharacter:"\\eb41"}),d.report=new d("report",{fontCharacter:"\\eb42"}),d.requestChanges=new d("request-changes",{fontCharacter:"\\eb43"}),d.rocket=new d("rocket",{fontCharacter:"\\eb44"}),d.rootFolderOpened=new d("root-folder-opened",{fontCharacter:"\\eb45"}),d.rootFolder=new d("root-folder",{fontCharacter:"\\eb46"}),d.rss=new d("rss",{fontCharacter:"\\eb47"}),d.ruby=new d("ruby",{fontCharacter:"\\eb48"}),d.saveAll=new d("save-all",{fontCharacter:"\\eb49"}),d.saveAs=new d("save-as",{fontCharacter:"\\eb4a"}),d.save=new d("save",{fontCharacter:"\\eb4b"}),d.screenFull=new d("screen-full",{fontCharacter:"\\eb4c"}),d.screenNormal=new d("screen-normal",{fontCharacter:"\\eb4d"}),d.searchStop=new d("search-stop",{fontCharacter:"\\eb4e"}),d.server=new d("server",{fontCharacter:"\\eb50"}),d.settingsGear=new d("settings-gear",{fontCharacter:"\\eb51"}),d.settings=new d("settings",{fontCharacter:"\\eb52"}),d.shield=new d("shield",{fontCharacter:"\\eb53"}),d.smiley=new d("smiley",{fontCharacter:"\\eb54"}),d.sortPrecedence=new d("sort-precedence",{fontCharacter:"\\eb55"}),d.splitHorizontal=new d("split-horizontal",{fontCharacter:"\\eb56"}),d.splitVertical=new d("split-vertical",{fontCharacter:"\\eb57"}),d.squirrel=new d("squirrel",{fontCharacter:"\\eb58"}),d.starFull=new d("star-full",{fontCharacter:"\\eb59"}),d.starHalf=new d("star-half",{fontCharacter:"\\eb5a"}),d.symbolClass=new d("symbol-class",{fontCharacter:"\\eb5b"}),d.symbolColor=new d("symbol-color",{fontCharacter:"\\eb5c"}),d.symbolConstant=new d("symbol-constant",{fontCharacter:"\\eb5d"}),d.symbolEnumMember=new d("symbol-enum-member",{fontCharacter:"\\eb5e"}),d.symbolField=new d("symbol-field",{fontCharacter:"\\eb5f"}),d.symbolFile=new d("symbol-file",{fontCharacter:"\\eb60"}),d.symbolInterface=new d("symbol-interface",{fontCharacter:"\\eb61"}),d.symbolKeyword=new d("symbol-keyword",{fontCharacter:"\\eb62"}),d.symbolMisc=new d("symbol-misc",{fontCharacter:"\\eb63"}),d.symbolOperator=new d("symbol-operator",{fontCharacter:"\\eb64"}),d.symbolProperty=new d("symbol-property",{fontCharacter:"\\eb65"}),d.wrench=new d("wrench",{fontCharacter:"\\eb65"}),d.wrenchSubaction=new d("wrench-subaction",{fontCharacter:"\\eb65"}),d.symbolSnippet=new d("symbol-snippet",{fontCharacter:"\\eb66"}),d.tasklist=new d("tasklist",{fontCharacter:"\\eb67"}),d.telescope=new d("telescope",{fontCharacter:"\\eb68"}),d.textSize=new d("text-size",{fontCharacter:"\\eb69"}),d.threeBars=new d("three-bars",{fontCharacter:"\\eb6a"}),d.thumbsdown=new d("thumbsdown",{fontCharacter:"\\eb6b"}),d.thumbsup=new d("thumbsup",{fontCharacter:"\\eb6c"}),d.tools=new d("tools",{fontCharacter:"\\eb6d"}),d.triangleDown=new d("triangle-down",{fontCharacter:"\\eb6e"}),d.triangleLeft=new d("triangle-left",{fontCharacter:"\\eb6f"}),d.triangleRight=new d("triangle-right",{fontCharacter:"\\eb70"}),d.triangleUp=new d("triangle-up",{fontCharacter:"\\eb71"}),d.twitter=new d("twitter",{fontCharacter:"\\eb72"}),d.unfold=new d("unfold",{fontCharacter:"\\eb73"}),d.unlock=new d("unlock",{fontCharacter:"\\eb74"}),d.unmute=new d("unmute",{fontCharacter:"\\eb75"}),d.unverified=new d("unverified",{fontCharacter:"\\eb76"}),d.verified=new d("verified",{fontCharacter:"\\eb77"}),d.versions=new d("versions",{fontCharacter:"\\eb78"}),d.vmActive=new d("vm-active",{fontCharacter:"\\eb79"}),d.vmOutline=new d("vm-outline",{fontCharacter:"\\eb7a"}),d.vmRunning=new d("vm-running",{fontCharacter:"\\eb7b"}),d.watch=new d("watch",{fontCharacter:"\\eb7c"}),d.whitespace=new d("whitespace",{fontCharacter:"\\eb7d"}),d.wholeWord=new d("whole-word",{fontCharacter:"\\eb7e"}),d.window=new d("window",{fontCharacter:"\\eb7f"}),d.wordWrap=new d("word-wrap",{fontCharacter:"\\eb80"}),d.zoomIn=new d("zoom-in",{fontCharacter:"\\eb81"}),d.zoomOut=new d("zoom-out",{fontCharacter:"\\eb82"}),d.listFilter=new d("list-filter",{fontCharacter:"\\eb83"}),d.listFlat=new d("list-flat",{fontCharacter:"\\eb84"}),d.listSelection=new d("list-selection",{fontCharacter:"\\eb85"}),d.selection=new d("selection",{fontCharacter:"\\eb85"}),d.listTree=new d("list-tree",{fontCharacter:"\\eb86"}),d.debugBreakpointFunctionUnverified=new d("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),d.debugBreakpointFunction=new d("debug-breakpoint-function",{fontCharacter:"\\eb88"}),d.debugBreakpointFunctionDisabled=new d("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),d.debugStackframeActive=new d("debug-stackframe-active",{fontCharacter:"\\eb89"}),d.debugStackframeDot=new d("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),d.debugStackframe=new d("debug-stackframe",{fontCharacter:"\\eb8b"}),d.debugStackframeFocused=new d("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),d.debugBreakpointUnsupported=new d("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),d.symbolString=new d("symbol-string",{fontCharacter:"\\eb8d"}),d.debugReverseContinue=new d("debug-reverse-continue",{fontCharacter:"\\eb8e"}),d.debugStepBack=new d("debug-step-back",{fontCharacter:"\\eb8f"}),d.debugRestartFrame=new d("debug-restart-frame",{fontCharacter:"\\eb90"}),d.callIncoming=new d("call-incoming",{fontCharacter:"\\eb92"}),d.callOutgoing=new d("call-outgoing",{fontCharacter:"\\eb93"}),d.menu=new d("menu",{fontCharacter:"\\eb94"}),d.expandAll=new d("expand-all",{fontCharacter:"\\eb95"}),d.feedback=new d("feedback",{fontCharacter:"\\eb96"}),d.groupByRefType=new d("group-by-ref-type",{fontCharacter:"\\eb97"}),d.ungroupByRefType=new d("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),d.account=new d("account",{fontCharacter:"\\eb99"}),d.bellDot=new d("bell-dot",{fontCharacter:"\\eb9a"}),d.debugConsole=new d("debug-console",{fontCharacter:"\\eb9b"}),d.library=new d("library",{fontCharacter:"\\eb9c"}),d.output=new d("output",{fontCharacter:"\\eb9d"}),d.runAll=new d("run-all",{fontCharacter:"\\eb9e"}),d.syncIgnored=new d("sync-ignored",{fontCharacter:"\\eb9f"}),d.pinned=new d("pinned",{fontCharacter:"\\eba0"}),d.githubInverted=new d("github-inverted",{fontCharacter:"\\eba1"}),d.debugAlt=new d("debug-alt",{fontCharacter:"\\eb91"}),d.serverProcess=new d("server-process",{fontCharacter:"\\eba2"}),d.serverEnvironment=new d("server-environment",{fontCharacter:"\\eba3"}),d.pass=new d("pass",{fontCharacter:"\\eba4"}),d.stopCircle=new d("stop-circle",{fontCharacter:"\\eba5"}),d.playCircle=new d("play-circle",{fontCharacter:"\\eba6"}),d.record=new d("record",{fontCharacter:"\\eba7"}),d.debugAltSmall=new d("debug-alt-small",{fontCharacter:"\\eba8"}),d.vmConnect=new d("vm-connect",{fontCharacter:"\\eba9"}),d.cloud=new d("cloud",{fontCharacter:"\\ebaa"}),d.merge=new d("merge",{fontCharacter:"\\ebab"}),d.exportIcon=new d("export",{fontCharacter:"\\ebac"}),d.graphLeft=new d("graph-left",{fontCharacter:"\\ebad"}),d.magnet=new d("magnet",{fontCharacter:"\\ebae"}),d.notebook=new d("notebook",{fontCharacter:"\\ebaf"}),d.redo=new d("redo",{fontCharacter:"\\ebb0"}),d.checkAll=new d("check-all",{fontCharacter:"\\ebb1"}),d.pinnedDirty=new d("pinned-dirty",{fontCharacter:"\\ebb2"}),d.passFilled=new d("pass-filled",{fontCharacter:"\\ebb3"}),d.circleLargeFilled=new d("circle-large-filled",{fontCharacter:"\\ebb4"}),d.circleLargeOutline=new d("circle-large-outline",{fontCharacter:"\\ebb5"}),d.combine=new d("combine",{fontCharacter:"\\ebb6"}),d.gather=new d("gather",{fontCharacter:"\\ebb6"}),d.table=new d("table",{fontCharacter:"\\ebb7"}),d.variableGroup=new d("variable-group",{fontCharacter:"\\ebb8"}),d.typeHierarchy=new d("type-hierarchy",{fontCharacter:"\\ebb9"}),d.typeHierarchySub=new d("type-hierarchy-sub",{fontCharacter:"\\ebba"}),d.typeHierarchySuper=new d("type-hierarchy-super",{fontCharacter:"\\ebbb"}),d.gitPullRequestCreate=new d("git-pull-request-create",{fontCharacter:"\\ebbc"}),d.runAbove=new d("run-above",{fontCharacter:"\\ebbd"}),d.runBelow=new d("run-below",{fontCharacter:"\\ebbe"}),d.notebookTemplate=new d("notebook-template",{fontCharacter:"\\ebbf"}),d.debugRerun=new d("debug-rerun",{fontCharacter:"\\ebc0"}),d.workspaceTrusted=new d("workspace-trusted",{fontCharacter:"\\ebc1"}),d.workspaceUntrusted=new d("workspace-untrusted",{fontCharacter:"\\ebc2"}),d.workspaceUnspecified=new d("workspace-unspecified",{fontCharacter:"\\ebc3"}),d.terminalCmd=new d("terminal-cmd",{fontCharacter:"\\ebc4"}),d.terminalDebian=new d("terminal-debian",{fontCharacter:"\\ebc5"}),d.terminalLinux=new d("terminal-linux",{fontCharacter:"\\ebc6"}),d.terminalPowershell=new d("terminal-powershell",{fontCharacter:"\\ebc7"}),d.terminalTmux=new d("terminal-tmux",{fontCharacter:"\\ebc8"}),d.terminalUbuntu=new d("terminal-ubuntu",{fontCharacter:"\\ebc9"}),d.terminalBash=new d("terminal-bash",{fontCharacter:"\\ebca"}),d.arrowSwap=new d("arrow-swap",{fontCharacter:"\\ebcb"}),d.copy=new d("copy",{fontCharacter:"\\ebcc"}),d.personAdd=new d("person-add",{fontCharacter:"\\ebcd"}),d.filterFilled=new d("filter-filled",{fontCharacter:"\\ebce"}),d.wand=new d("wand",{fontCharacter:"\\ebcf"}),d.debugLineByLine=new d("debug-line-by-line",{fontCharacter:"\\ebd0"}),d.inspect=new d("inspect",{fontCharacter:"\\ebd1"}),d.layers=new d("layers",{fontCharacter:"\\ebd2"}),d.layersDot=new d("layers-dot",{fontCharacter:"\\ebd3"}),d.layersActive=new d("layers-active",{fontCharacter:"\\ebd4"}),d.compass=new d("compass",{fontCharacter:"\\ebd5"}),d.compassDot=new d("compass-dot",{fontCharacter:"\\ebd6"}),d.compassActive=new d("compass-active",{fontCharacter:"\\ebd7"}),d.azure=new d("azure",{fontCharacter:"\\ebd8"}),d.issueDraft=new d("issue-draft",{fontCharacter:"\\ebd9"}),d.gitPullRequestClosed=new d("git-pull-request-closed",{fontCharacter:"\\ebda"}),d.gitPullRequestDraft=new d("git-pull-request-draft",{fontCharacter:"\\ebdb"}),d.debugAll=new d("debug-all",{fontCharacter:"\\ebdc"}),d.debugCoverage=new d("debug-coverage",{fontCharacter:"\\ebdd"}),d.runErrors=new d("run-errors",{fontCharacter:"\\ebde"}),d.folderLibrary=new d("folder-library",{fontCharacter:"\\ebdf"}),d.debugContinueSmall=new d("debug-continue-small",{fontCharacter:"\\ebe0"}),d.beakerStop=new d("beaker-stop",{fontCharacter:"\\ebe1"}),d.graphLine=new d("graph-line",{fontCharacter:"\\ebe2"}),d.graphScatter=new d("graph-scatter",{fontCharacter:"\\ebe3"}),d.pieChart=new d("pie-chart",{fontCharacter:"\\ebe4"}),d.bracket=new d("bracket",d.json.definition),d.bracketDot=new d("bracket-dot",{fontCharacter:"\\ebe5"}),d.bracketError=new d("bracket-error",{fontCharacter:"\\ebe6"}),d.lockSmall=new d("lock-small",{fontCharacter:"\\ebe7"}),d.azureDevops=new d("azure-devops",{fontCharacter:"\\ebe8"}),d.verifiedFilled=new d("verified-filled",{fontCharacter:"\\ebe9"})}(Me||(Me={}))},79881:function(Fr,Rt,J){"use strict";J.d(Rt,{B8:function(){return j},Cp:function(){return Le},F0:function(){return $},L6:function(){return be},VV:function(){return Me},b1:function(){return d},dL:function(){return rt},ri:function(){return te}});class pe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(M){setTimeout(()=>{throw M.stack?new Error(M.message+`
`+M.stack):M},0)}}emit(M){this.listeners.forEach(O=>{O(M)})}onUnexpectedError(M){this.unexpectedErrorHandler(M),this.emit(M)}onUnexpectedExternalError(M){this.unexpectedErrorHandler(M)}}const Pe=new pe;function rt(k){Me(k)||Pe.onUnexpectedError(k)}function Le(k){Me(k)||Pe.onUnexpectedExternalError(k)}function te(k){if(k instanceof Error){let{name:M,message:O}=k;const K=k.stacktrace||k.stack;return{$isError:!0,name:M,message:O,stack:K}}return k}const E="Canceled";function Me(k){return k instanceof Error&&k.name===E&&k.message===E}function $(){const k=new Error(E);return k.name=k.message,k}function d(k){return k?new Error(`Illegal argument: ${k}`):new Error("Illegal argument")}function be(k){return k?new Error(`Illegal state: ${k}`):new Error("Illegal state")}class j extends Error{constructor(M){super("NotSupported"),M&&(this.message=M)}}},4348:function(Fr,Rt,J){"use strict";J.d(Rt,{D0:function(){return j},E7:function(){return k},K3:function(){return be},Q5:function(){return d},ZD:function(){return M},ju:function(){return te}});var pe=J(79881),Pe=J(69323),rt=J(34502),Le=J(95830),te;(function(O){O.None=()=>Pe.JT.None;function K(ce){return(he,Re=null,we)=>{let D=!1,L;return L=ce(ie=>{if(!D)return L?L.dispose():D=!0,he.call(Re,ie)},null,we),D&&L.dispose(),L}}O.once=K;function se(ce,he){return ee((Re,we=null,D)=>ce(L=>Re.call(we,he(L)),null,D))}O.map=se;function ae(ce,he){return ee((Re,we=null,D)=>ce(L=>{he(L),Re.call(we,L)},null,D))}O.forEach=ae;function Z(ce,he){return ee((Re,we=null,D)=>ce(L=>he(L)&&Re.call(we,L),null,D))}O.filter=Z;function q(ce){return ce}O.signal=q;function Y(...ce){return(he,Re=null,we)=>(0,Pe.F8)(...ce.map(D=>D(L=>he.call(Re,L),null,we)))}O.any=Y;function ue(ce,he,Re){let we=Re;return se(ce,D=>(we=he(we,D),we))}O.reduce=ue;function ee(ce){let he;const Re=new d({onFirstListenerAdd(){he=ce(Re.fire,Re)},onLastListenerRemove(){he.dispose()}});return Re.event}function oe(ce,he,Re=100,we=!1,D){let L,ie,xe,at=0;const ot=new d({leakWarningThreshold:D,onFirstListenerAdd(){L=ce(At=>{at++,ie=he(ie,At),we&&!xe&&(ot.fire(ie),ie=void 0),clearTimeout(xe),xe=setTimeout(()=>{const Xe=ie;ie=void 0,xe=void 0,(!we||at>1)&&ot.fire(Xe),at=0},Re)})},onLastListenerRemove(){L.dispose()}});return ot.event}O.debounce=oe;function De(ce,he=(Re,we)=>Re===we){let Re=!0,we;return Z(ce,D=>{const L=Re||!he(D,we);return Re=!1,we=D,L})}O.latch=De;function ve(ce,he){return[O.filter(ce,he),O.filter(ce,Re=>!he(Re))]}O.split=ve;function Ye(ce,he=!1,Re=[]){let we=Re.slice(),D=ce(xe=>{we?we.push(xe):ie.fire(xe)});const L=()=>{we&&we.forEach(xe=>ie.fire(xe)),we=null},ie=new d({onFirstListenerAdd(){D||(D=ce(xe=>ie.fire(xe)))},onFirstListenerDidAdd(){we&&(he?setTimeout(L):L())},onLastListenerRemove(){D&&D.dispose(),D=null}});return ie.event}O.buffer=Ye;class We{constructor(he){this.event=he}map(he){return new We(se(this.event,he))}forEach(he){return new We(ae(this.event,he))}filter(he){return new We(Z(this.event,he))}reduce(he,Re){return new We(ue(this.event,he,Re))}latch(){return new We(De(this.event))}debounce(he,Re=100,we=!1,D){return new We(oe(this.event,he,Re,we,D))}on(he,Re,we){return this.event(he,Re,we)}once(he,Re,we){return K(this.event)(he,Re,we)}}function ut(ce){return new We(ce)}O.chain=ut;function pt(ce,he,Re=we=>we){const we=(...xe)=>ie.fire(Re(...xe)),D=()=>ce.on(he,we),L=()=>ce.removeListener(he,we),ie=new d({onFirstListenerAdd:D,onLastListenerRemove:L});return ie.event}O.fromNodeEventEmitter=pt;function de(ce,he,Re=we=>we){const we=(...xe)=>ie.fire(Re(...xe)),D=()=>ce.addEventListener(he,we),L=()=>ce.removeEventListener(he,we),ie=new d({onFirstListenerAdd:D,onLastListenerRemove:L});return ie.event}O.fromDOMEventEmitter=de;function re(ce){return new Promise(he=>K(ce)(he))}O.toPromise=re})(te||(te={}));class E{constructor(K){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${K}_${E._idPool++}`}start(K){this._stopWatch=new Le.G(!0),this._listenerCount=K}stop(){if(this._stopWatch){const K=this._stopWatch.elapsed();this._elapsedOverall+=K,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${K.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}E._idPool=0;let Me=-1;class ${constructor(K,se=Math.random().toString(18).slice(2,5)){this.customThreshold=K,this.name=se,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(K){let se=Me;if(typeof this.customThreshold=="number"&&(se=this.customThreshold),se<=0||K<se)return;this._stacks||(this._stacks=new Map);const ae=new Error().stack.split(`
`).slice(3).join(`
`),Z=this._stacks.get(ae)||0;if(this._stacks.set(ae,Z+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=se*.5;let q,Y=0;for(const[ue,ee]of this._stacks)(!q||Y<ee)&&(q=ue,Y=ee);console.warn(`[${this.name}] potential listener LEAK detected, having ${K} listeners already. MOST frequent listener (${Y}):`),console.warn(q)}return()=>{const q=this._stacks.get(ae)||0;this._stacks.set(ae,q-1)}}}class d{constructor(K){var se;this._disposed=!1,this._options=K,this._leakageMon=Me>0?new $(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((se=this._options)===null||se===void 0)&&se._profName?new E(this._options._profName):void 0}get event(){return this._event||(this._event=(K,se,ae)=>{var Z;this._listeners||(this._listeners=new rt.S);const q=this._listeners.isEmpty();q&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const Y=this._listeners.push(se?[K,se]:K);q&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,K,se);const ue=(Z=this._leakageMon)===null||Z===void 0?void 0:Z.check(this._listeners.size),ee=(0,Pe.OF)(()=>{ue&&ue(),this._disposed||(Y(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return ae instanceof Pe.SL?ae.add(ee):Array.isArray(ae)&&ae.push(ee),ee}),this._event}fire(K){var se,ae;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new rt.S);for(let Z of this._listeners)this._deliveryQueue.push([Z,K]);for((se=this._perfMon)===null||se===void 0||se.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[Z,q]=this._deliveryQueue.shift();try{typeof Z=="function"?Z.call(void 0,q):Z[0].call(Z[1],q)}catch(Y){(0,pe.dL)(Y)}}(ae=this._perfMon)===null||ae===void 0||ae.stop()}}dispose(){var K,se,ae,Z,q;this._disposed||(this._disposed=!0,(K=this._listeners)===null||K===void 0||K.clear(),(se=this._deliveryQueue)===null||se===void 0||se.clear(),(Z=(ae=this._options)===null||ae===void 0?void 0:ae.onLastListenerRemove)===null||Z===void 0||Z.call(ae),(q=this._leakageMon)===null||q===void 0||q.dispose())}}class be extends d{constructor(K){super(K),this._isPaused=0,this._eventQueue=new rt.S,this._mergeFn=K==null?void 0:K.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const K=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(K))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(K){this._listeners&&(this._isPaused!==0?this._eventQueue.push(K):super.fire(K))}}class j extends be{constructor(K){var se;super(K),this._delay=(se=K.delay)!==null&&se!==void 0?se:100}fire(K){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(K)}}class k{constructor(){this.buffers=[]}wrapEvent(K){return(se,ae,Z)=>K(q=>{const Y=this.buffers[this.buffers.length-1];Y?Y.push(()=>se.call(ae,q)):se.call(ae,q)},void 0,Z)}bufferEvents(K){const se=[];this.buffers.push(se);const ae=K();return this.buffers.pop(),se.forEach(Z=>Z()),ae}}class M{constructor(){this.listening=!1,this.inputEvent=te.None,this.inputEventListener=Pe.JT.None,this.emitter=new d({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(K){this.inputEvent=K,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=K(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Fr,Rt,J){"use strict";J.d(Rt,{I:function(){return pe}});function pe(Pe){const rt=this;let Le=!1,te;return function(){return Le||(Le=!0,te=Pe.apply(rt,arguments)),te}}},88226:function(Fr,Rt,J){"use strict";J.d(Rt,{$:function(){return pe}});var pe;(function(Pe){function rt(Y){return Y&&typeof Y=="object"&&typeof Y[Symbol.iterator]=="function"}Pe.is=rt;const Le=Object.freeze([]);function te(){return Le}Pe.empty=te;function*E(Y){yield Y}Pe.single=E;function Me(Y){return Y||Le}Pe.from=Me;function $(Y){return!Y||Y[Symbol.iterator]().next().done===!0}Pe.isEmpty=$;function d(Y){return Y[Symbol.iterator]().next().value}Pe.first=d;function be(Y,ue){for(const ee of Y)if(ue(ee))return!0;return!1}Pe.some=be;function j(Y,ue){for(const ee of Y)if(ue(ee))return ee}Pe.find=j;function*k(Y,ue){for(const ee of Y)ue(ee)&&(yield ee)}Pe.filter=k;function*M(Y,ue){let ee=0;for(const oe of Y)yield ue(oe,ee++)}Pe.map=M;function*O(...Y){for(const ue of Y)for(const ee of ue)yield ee}Pe.concat=O;function*K(Y){for(const ue of Y)for(const ee of ue)yield ee}Pe.concatNested=K;function se(Y,ue,ee){let oe=ee;for(const De of Y)oe=ue(oe,De);return oe}Pe.reduce=se;function*ae(Y,ue,ee=Y.length){for(ue<0&&(ue+=Y.length),ee<0?ee+=Y.length:ee>Y.length&&(ee=Y.length);ue<ee;ue++)yield Y[ue]}Pe.slice=ae;function Z(Y,ue=Number.POSITIVE_INFINITY){const ee=[];if(ue===0)return[ee,Y];const oe=Y[Symbol.iterator]();for(let De=0;De<ue;De++){const ve=oe.next();if(ve.done)return[ee,Pe.empty()];ee.push(ve.value)}return[ee,{[Symbol.iterator](){return oe}}]}Pe.consume=Z;function q(Y,ue,ee=(oe,De)=>oe===De){const oe=Y[Symbol.iterator](),De=ue[Symbol.iterator]();for(;;){const ve=oe.next(),Ye=De.next();if(ve.done!==Ye.done)return!1;if(ve.done)return!0;if(!ee(ve.value,Ye.value))return!1}}Pe.equals=q})(pe||(pe={}))},69323:function(Fr,Rt,J){"use strict";J.d(Rt,{B9:function(){return M},F8:function(){return O},JT:function(){return ae},Jz:function(){return q},OF:function(){return K},SL:function(){return se},Wf:function(){return k},XK:function(){return Z},dk:function(){return be}});var pe=J(17845),Pe=J(88226);const rt=!1;let Le=null;function te(Y){Le=Y}if(rt){const Y="__is_disposable_tracked__";te(new class{trackDisposable(ue){const ee=new Error("Potentially leaked disposable").stack;setTimeout(()=>{ue[Y]||console.log(ee)},3e3)}setParent(ue,ee){if(ue&&ue!==ae.None)try{ue[Y]=!0}catch(oe){}}markAsDisposed(ue){if(ue&&ue!==ae.None)try{ue[Y]=!0}catch(ee){}}markAsSingleton(ue){}})}function E(Y){return Le==null||Le.trackDisposable(Y),Y}function Me(Y){Le==null||Le.markAsDisposed(Y)}function $(Y,ue){Le==null||Le.setParent(Y,ue)}function d(Y,ue){if(Le)for(const ee of Y)Le.setParent(ee,ue)}function be(Y){return Le==null||Le.markAsSingleton(Y),Y}class j extends Error{constructor(ue){super(`Encountered errors while disposing of store. Errors: [${ue.join(", ")}]`),this.errors=ue}}function k(Y){return typeof Y.dispose=="function"&&Y.dispose.length===0}function M(Y){if(Pe.$.is(Y)){let ue=[];for(const ee of Y)if(ee)try{ee.dispose()}catch(oe){ue.push(oe)}if(ue.length===1)throw ue[0];if(ue.length>1)throw new j(ue);return Array.isArray(Y)?[]:Y}else if(Y)return Y.dispose(),Y}function O(...Y){const ue=K(()=>M(Y));return d(Y,ue),ue}function K(Y){const ue=E({dispose:(0,pe.I)(()=>{Me(ue),Y()})});return ue}class se{constructor(){this._toDispose=new Set,this._isDisposed=!1,E(this)}dispose(){this._isDisposed||(Me(this),this._isDisposed=!0,this.clear())}clear(){try{M(this._toDispose.values())}finally{this._toDispose.clear()}}add(ue){if(!ue)return ue;if(ue===this)throw new Error("Cannot register a disposable on itself!");return $(ue,this),this._isDisposed?se.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(ue),ue}}se.DISABLE_DISPOSED_WARNING=!1;class ae{constructor(){this._store=new se,E(this),$(this._store,this)}dispose(){Me(this),this._store.dispose()}_register(ue){if(ue===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(ue)}}ae.None=Object.freeze({dispose(){}});class Z{constructor(){this._isDisposed=!1,E(this)}get value(){return this._isDisposed?void 0:this._value}set value(ue){var ee;this._isDisposed||ue===this._value||((ee=this._value)===null||ee===void 0||ee.dispose(),ue&&$(ue,this),this._value=ue)}clear(){this.value=void 0}dispose(){var ue;this._isDisposed=!0,Me(this),(ue=this._value)===null||ue===void 0||ue.dispose(),this._value=void 0}clearAndLeak(){const ue=this._value;return this._value=void 0,ue&&$(ue,null),ue}}class q{constructor(ue){this.object=ue}dispose(){}}},34502:function(Fr,Rt,J){"use strict";J.d(Rt,{S:function(){return Pe}});class pe{constructor(Le){this.element=Le,this.next=pe.Undefined,this.prev=pe.Undefined}}pe.Undefined=new pe(void 0);class Pe{constructor(){this._first=pe.Undefined,this._last=pe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===pe.Undefined}clear(){let Le=this._first;for(;Le!==pe.Undefined;){const te=Le.next;Le.prev=pe.Undefined,Le.next=pe.Undefined,Le=te}this._first=pe.Undefined,this._last=pe.Undefined,this._size=0}unshift(Le){return this._insert(Le,!1)}push(Le){return this._insert(Le,!0)}_insert(Le,te){const E=new pe(Le);if(this._first===pe.Undefined)this._first=E,this._last=E;else if(te){const $=this._last;this._last=E,E.prev=$,$.next=E}else{const $=this._first;this._first=E,E.next=$,$.prev=E}this._size+=1;let Me=!1;return()=>{Me||(Me=!0,this._remove(E))}}shift(){if(this._first!==pe.Undefined){const Le=this._first.element;return this._remove(this._first),Le}}pop(){if(this._last!==pe.Undefined){const Le=this._last.element;return this._remove(this._last),Le}}_remove(Le){if(Le.prev!==pe.Undefined&&Le.next!==pe.Undefined){const te=Le.prev;te.next=Le.next,Le.next.prev=te}else Le.prev===pe.Undefined&&Le.next===pe.Undefined?(this._first=pe.Undefined,this._last=pe.Undefined):Le.next===pe.Undefined?(this._last=this._last.prev,this._last.next=pe.Undefined):Le.prev===pe.Undefined&&(this._first=this._first.next,this._first.prev=pe.Undefined);this._size-=1}*[Symbol.iterator](){let Le=this._first;for(;Le!==pe.Undefined;)yield Le.element,Le=Le.next}}},23345:function(Fr,Rt,J){"use strict";J.d(Rt,{$L:function(){return oe},ED:function(){return q},IJ:function(){return ue},OS:function(){return We},WE:function(){return ve},dz:function(){return Y},gn:function(){return De},li:function(){return K},r:function(){return de},tY:function(){return ee},xS:function(){return Ye}});var pe=J(97671),Pe;const rt="en";let Le=!1,te=!1,E=!1,Me=!1,$=!1,d=!1,be=!1,j,k=null,M=null,O;const K=typeof self=="object"?self:typeof J.g=="object"?J.g:{};let se;typeof K.vscode!="undefined"&&typeof K.vscode.process!="undefined"?se=K.vscode.process:typeof pe!="undefined"&&(se=pe);const ae=typeof((Pe=se==null?void 0:se.versions)===null||Pe===void 0?void 0:Pe.electron)=="string"&&se.type==="renderer";if(typeof navigator=="object"&&!ae)O=navigator.userAgent,Le=O.indexOf("Windows")>=0,te=O.indexOf("Macintosh")>=0,be=(O.indexOf("Macintosh")>=0||O.indexOf("iPad")>=0||O.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,E=O.indexOf("Linux")>=0,d=!0,j=navigator.language,k=j;else if(typeof se=="object"){Le=se.platform==="win32",te=se.platform==="darwin",E=se.platform==="linux",Me=E&&!!se.env.SNAP&&!!se.env.SNAP_REVISION,j=rt,k=rt;const re=se.env.VSCODE_NLS_CONFIG;if(re)try{const ce=JSON.parse(re),he=ce.availableLanguages["*"];j=ce.locale,k=he||rt,M=ce._translationsConfigFile}catch(ce){}$=!0}else console.error("Unable to resolve platform.");let Z=0;te?Z=1:Le?Z=3:E&&(Z=2);const q=Le,Y=te,ue=E,ee=$,oe=d,De=be,ve=O,Ye=function(){if(K.setImmediate)return K.setImmediate.bind(K);if(typeof K.postMessage=="function"&&!K.importScripts){let he=[];K.addEventListener("message",we=>{if(we.data&&we.data.vscodeSetImmediateId)for(let D=0,L=he.length;D<L;D++){const ie=he[D];if(ie.id===we.data.vscodeSetImmediateId){he.splice(D,1),ie.callback();return}}});let Re=0;return we=>{const D=++Re;he.push({id:D,callback:we}),K.postMessage({vscodeSetImmediateId:D},"*")}}if(typeof(se==null?void 0:se.nextTick)=="function")return se.nextTick.bind(se);const ce=Promise.resolve();return he=>ce.then(he)}(),We=te||be?2:Le?1:3;let ut=!0,pt=!1;function de(){if(!pt){pt=!0;const re=new Uint8Array(2);re[0]=1,re[1]=2,ut=new Uint16Array(re.buffer)[0]===513}return ut}},95830:function(Fr,Rt,J){"use strict";J.d(Rt,{G:function(){return rt}});var pe=J(23345);const Pe=pe.li.performance&&typeof pe.li.performance.now=="function";class rt{constructor(te){this._highResolution=Pe&&te,this._startTime=this._now(),this._stopTime=-1}static create(te=!0){return new rt(te)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?pe.li.performance.now():Date.now()}}},82983:function(Fr,Rt,J){"use strict";J.d(Rt,{$i:function(){return at},C8:function(){return jt},GF:function(){return j},HO:function(){return Re},IO:function(){return k},K7:function(){return ar},Kw:function(){return $r},LC:function(){return K},Mh:function(){return Ye},P1:function(){return We},PJ:function(){return ir},Qe:function(){return ot},R1:function(){return be},RP:function(){return ie},S6:function(){return zr},TT:function(){return q},Ut:function(){return D},V8:function(){return se},WU:function(){return rt},YK:function(){return pt},YU:function(){return Le},ZG:function(){return ut},ZH:function(){return re},ab:function(){return At},c1:function(){return Ot},df:function(){return oe},ec:function(){return te},fi:function(){return li},fy:function(){return E},j3:function(){return Me},j_:function(){return ue},m5:function(){return pe},mK:function(){return ee},mr:function(){return M},oH:function(){return nt},oL:function(){return $},ok:function(){return ve},ow:function(){return ae},qq:function(){return De},qu:function(){return Z},rL:function(){return de},uS:function(){return kr},un:function(){return d},uq:function(){return O},vH:function(){return he},xe:function(){return Xe},zY:function(){return Y}});function pe(ye){return!ye||typeof ye!="string"?!0:ye.trim().length===0}const Pe=/{(\d+)}/g;function rt(ye,...Oe){return Oe.length===0?ye:ye.replace(Pe,function(et,vt){const wt=parseInt(vt,10);return isNaN(wt)||wt<0||wt>=Oe.length?et:Oe[wt]})}function Le(ye){return ye.replace(/[<>&]/g,function(Oe){switch(Oe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Oe}})}function te(ye){return ye.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function E(ye,Oe=" "){const et=Me(ye,Oe);return $(et,Oe)}function Me(ye,Oe){if(!ye||!Oe)return ye;const et=Oe.length;if(et===0||ye.length===0)return ye;let vt=0;for(;ye.indexOf(Oe,vt)===vt;)vt=vt+et;return ye.substring(vt)}function $(ye,Oe){if(!ye||!Oe)return ye;const et=Oe.length,vt=ye.length;if(et===0||vt===0)return ye;let wt=vt,Ht=-1;for(;Ht=ye.lastIndexOf(Oe,wt-1),!(Ht===-1||Ht+et!==wt);){if(Ht===0)return"";wt=Ht}return ye.substring(0,wt)}function d(ye){return ye.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function be(ye){return ye.replace(/\*/g,"")}function j(ye,Oe,et={}){if(!ye)throw new Error("Cannot create regex from empty string");Oe||(ye=te(ye)),et.wholeWord&&(/\B/.test(ye.charAt(0))||(ye="\\b"+ye),/\B/.test(ye.charAt(ye.length-1))||(ye=ye+"\\b"));let vt="";return et.global&&(vt+="g"),et.matchCase||(vt+="i"),et.multiline&&(vt+="m"),et.unicode&&(vt+="u"),new RegExp(ye,vt)}function k(ye){return ye.source==="^"||ye.source==="^$"||ye.source==="$"||ye.source==="^\\s*$"?!1:!!(ye.exec("")&&ye.lastIndex===0)}function M(ye){return(ye.global?"g":"")+(ye.ignoreCase?"i":"")+(ye.multiline?"m":"")+(ye.unicode?"u":"")}function O(ye){return ye.split(/\r\n|\r|\n/)}function K(ye){for(let Oe=0,et=ye.length;Oe<et;Oe++){const vt=ye.charCodeAt(Oe);if(vt!==32&&vt!==9)return Oe}return-1}function se(ye,Oe=0,et=ye.length){for(let vt=Oe;vt<et;vt++){const wt=ye.charCodeAt(vt);if(wt!==32&&wt!==9)return ye.substring(Oe,vt)}return ye.substring(Oe,et)}function ae(ye,Oe=ye.length-1){for(let et=Oe;et>=0;et--){const vt=ye.charCodeAt(et);if(vt!==32&&vt!==9)return et}return-1}function Z(ye,Oe){return ye<Oe?-1:ye>Oe?1:0}function q(ye,Oe,et=0,vt=ye.length,wt=0,Ht=Oe.length){for(;et<vt&&wt<Ht;et++,wt++){let Ue=ye.charCodeAt(et),Ut=Oe.charCodeAt(wt);if(Ue<Ut)return-1;if(Ue>Ut)return 1}const fr=vt-et,Xt=Ht-wt;return fr<Xt?-1:fr>Xt?1:0}function Y(ye,Oe){return ue(ye,Oe,0,ye.length,0,Oe.length)}function ue(ye,Oe,et=0,vt=ye.length,wt=0,Ht=Oe.length){for(;et<vt&&wt<Ht;et++,wt++){let Ue=ye.charCodeAt(et),Ut=Oe.charCodeAt(wt);if(Ue===Ut)continue;if(Ue>=128||Ut>=128)return q(ye.toLowerCase(),Oe.toLowerCase(),et,vt,wt,Ht);ee(Ue)&&(Ue-=32),ee(Ut)&&(Ut-=32);const _r=Ue-Ut;if(_r!==0)return _r}const fr=vt-et,Xt=Ht-wt;return fr<Xt?-1:fr>Xt?1:0}function ee(ye){return ye>=97&&ye<=122}function oe(ye){return ye>=65&&ye<=90}function De(ye,Oe){return ye.length===Oe.length&&ue(ye,Oe)===0}function ve(ye,Oe){const et=Oe.length;return Oe.length>ye.length?!1:ue(ye,Oe,0,et)===0}function Ye(ye,Oe){let et,vt=Math.min(ye.length,Oe.length);for(et=0;et<vt;et++)if(ye.charCodeAt(et)!==Oe.charCodeAt(et))return et;return vt}function We(ye,Oe){let et,vt=Math.min(ye.length,Oe.length);const wt=ye.length-1,Ht=Oe.length-1;for(et=0;et<vt;et++)if(ye.charCodeAt(wt-et)!==Oe.charCodeAt(Ht-et))return et;return vt}function ut(ye){return 55296<=ye&&ye<=56319}function pt(ye){return 56320<=ye&&ye<=57343}function de(ye,Oe){return(ye-55296<<10)+(Oe-56320)+65536}function re(ye,Oe,et){const vt=ye.charCodeAt(et);if(ut(vt)&&et+1<Oe){const wt=ye.charCodeAt(et+1);if(pt(wt))return de(vt,wt)}return vt}function ce(ye,Oe){const et=ye.charCodeAt(Oe-1);if(pt(et)&&Oe>1){const vt=ye.charCodeAt(Oe-2);if(ut(vt))return de(vt,et)}return et}function he(ye,Oe){const et=Gr.getInstance(),vt=Oe,wt=ye.length,Ht=re(ye,wt,Oe);Oe+=Ht>=65536?2:1;let fr=et.getGraphemeBreakType(Ht);for(;Oe<wt;){const Xt=re(ye,wt,Oe),Ue=et.getGraphemeBreakType(Xt);if(li(fr,Ue))break;Oe+=Xt>=65536?2:1,fr=Ue}return Oe-vt}function Re(ye,Oe){const et=Gr.getInstance(),vt=Oe,wt=ce(ye,Oe);Oe-=wt>=65536?2:1;let Ht=et.getGraphemeBreakType(wt);for(;Oe>0;){const fr=ce(ye,Oe),Xt=et.getGraphemeBreakType(fr);if(li(Xt,Ht))break;Oe-=fr>=65536?2:1,Ht=Xt}return vt-Oe}const we=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function D(ye){return we.test(ye)}const L=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function ie(ye){return L.test(ye)}const xe=/^[\t\n\r\x20-\x7E]*$/;function at(ye){return xe.test(ye)}const ot=/[\u2028\u2029]/;function At(ye){return ot.test(ye)}function Xe(ye){for(let Oe=0,et=ye.length;Oe<et;Oe++)if(ar(ye.charCodeAt(Oe)))return!0;return!1}function ar(ye){return ye=+ye,ye>=11904&&ye<=55215||ye>=63744&&ye<=64255||ye>=65281&&ye<=65374}function jt(ye){return ye>=127462&&ye<=127487||ye===8986||ye===8987||ye===9200||ye===9203||ye>=9728&&ye<=10175||ye===11088||ye===11093||ye>=127744&&ye<=128591||ye>=128640&&ye<=128764||ye>=128992&&ye<=129003||ye>=129280&&ye<=129535||ye>=129648&&ye<=129750}const Ot="\uFEFF";function kr(ye){return!!(ye&&ye.length>0&&ye.charCodeAt(0)===65279)}function $r(ye,Oe=!1){return ye?(Oe&&(ye=ye.replace(/\\./g,"")),ye.toLowerCase()!==ye):!1}function ir(ye){return ye=ye%(2*26),ye<26?String.fromCharCode(97+ye):String.fromCharCode(65+ye-26)}function zr(ye){return Gr.getInstance().getGraphemeBreakType(ye)}function li(ye,Oe){return ye===0?Oe!==5&&Oe!==7:ye===2&&Oe===3?!1:ye===4||ye===2||ye===3||Oe===4||Oe===2||Oe===3?!0:!(ye===8&&(Oe===8||Oe===9||Oe===11||Oe===12)||(ye===11||ye===9)&&(Oe===9||Oe===10)||(ye===12||ye===10)&&Oe===10||Oe===5||Oe===13||Oe===7||ye===1||ye===13&&Oe===14||ye===6&&Oe===6)}class Gr{constructor(){this._data=Ze()}static getInstance(){return Gr._INSTANCE||(Gr._INSTANCE=new Gr),Gr._INSTANCE}getGraphemeBreakType(Oe){if(Oe<32)return Oe===10?3:Oe===13?2:4;if(Oe<127)return 0;const et=this._data,vt=et.length/3;let wt=1;for(;wt<=vt;)if(Oe<et[3*wt])wt=2*wt;else if(Oe>et[3*wt+1])wt=2*wt+1;else return et[3*wt+2];return 0}}Gr._INSTANCE=null;function Ze(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function nt(ye,Oe){if(ye===0)return 0;const et=Qe(ye,Oe);if(et!==void 0)return et;const vt=ce(Oe,ye);return ye-=Ct(vt),ye}function Qe(ye,Oe){let et=ce(Oe,ye);for(ye-=Ct(et);Dt(et)||et===65039||et===8419;){if(ye===0)return;et=ce(Oe,ye),ye-=Ct(et)}if(jt(et)){if(ye>=0){const vt=ce(Oe,ye);vt===8205&&(ye-=Ct(vt))}return ye}}function Ct(ye){return ye>=65536?2:1}function Dt(ye){return 127995<=ye&&ye<=127999}},72999:function(Fr,Rt,J){"use strict";J.d(Rt,{$E:function(){return K},$K:function(){return Me},D8:function(){return k},HD:function(){return Pe},IU:function(){return se},Jp:function(){return $},Kn:function(){return rt},cW:function(){return be},f6:function(){return ae},hj:function(){return Le},jn:function(){return te},kJ:function(){return pe},mf:function(){return j},o8:function(){return E},p_:function(){return d},vE:function(){return Z}});function pe(q){return Array.isArray(q)}function Pe(q){return typeof q=="string"}function rt(q){return typeof q=="object"&&q!==null&&!Array.isArray(q)&&!(q instanceof RegExp)&&!(q instanceof Date)}function Le(q){return typeof q=="number"&&!isNaN(q)}function te(q){return q===!0||q===!1}function E(q){return typeof q=="undefined"}function Me(q){return!$(q)}function $(q){return E(q)||q===null}function d(q,Y){if(!q)throw new Error(Y?`Unexpected type, expected '${Y}'`:"Unexpected type")}function be(q){if($(q))throw new Error("Assertion Failed: argument is undefined or null");return q}function j(q){return typeof q=="function"}function k(q,Y){const ue=Math.min(q.length,Y.length);for(let ee=0;ee<ue;ee++)M(q[ee],Y[ee])}function M(q,Y){if(Pe(Y)){if(typeof q!==Y)throw new Error(`argument does not match constraint: typeof ${Y}`)}else if(j(Y)){try{if(q instanceof Y)return}catch(ue){}if(!$(q)&&q.constructor===Y||Y.length===1&&Y.call(void 0,q)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function O(q){let Y=[],ue=Object.getPrototypeOf(q);for(;Object.prototype!==ue;)Y=Y.concat(Object.getOwnPropertyNames(ue)),ue=Object.getPrototypeOf(ue);return Y}function K(q){const Y=[];for(const ue of O(q))typeof q[ue]=="function"&&Y.push(ue);return Y}function se(q,Y){const ue=oe=>function(){const De=Array.prototype.slice.call(arguments,0);return Y(oe,De)};let ee={};for(const oe of q)ee[oe]=ue(oe);return ee}function ae(q){return q===null?void 0:q}function Z(q,Y="Unreachable"){throw new Error(Y)}},13268:function(Fr,Rt,J){"use strict";J.d(Rt,{N:function(){return Pe}});function pe(rt,Le){let te;return Le.length===0?te=rt:te=rt.replace(/\{(\d+)\}/g,function(E,Me){const $=Me[0];return typeof Le[$]!="undefined"?Le[$]:E}),te}function Pe(rt,Le,...te){return pe(Le,te)}},96236:function(Fr,Rt,J){"use strict";J.d(Rt,{BH:function(){return se},NZ:function(){return ae},U8:function(){return Z},co:function(){return K},eH:function(){return O},vr:function(){return M}});var pe=J(75918),Pe=J(52615),rt=J(4348),Le=J(88226),te=J(69323),E=J(34502),Me=J(35884),$=J(90689),d=J(16925),be=J(49055),j=function(q,Y,ue,ee){var oe=arguments.length,De=oe<3?Y:ee===null?ee=Object.getOwnPropertyDescriptor(Y,ue):ee,ve;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")De=Reflect.decorate(q,Y,ue,ee);else for(var Ye=q.length-1;Ye>=0;Ye--)(ve=q[Ye])&&(De=(oe<3?ve(De):oe>3?ve(Y,ue,De):ve(Y,ue))||De);return oe>3&&De&&Object.defineProperty(Y,ue,De),De},k=function(q,Y){return function(ue,ee){Y(ue,ee,q)}};function M(q){return q.command!==void 0}class O{constructor(Y){this.id=O._idPool++,this._debugName=Y}}O._idPool=0,O.CommandPalette=new O("CommandPalette"),O.EditorContext=new O("EditorContext"),O.SimpleEditorContext=new O("SimpleEditorContext"),O.EditorContextCopy=new O("EditorContextCopy"),O.EditorContextPeek=new O("EditorContextPeek"),O.MenubarEditMenu=new O("MenubarEditMenu"),O.MenubarCopy=new O("MenubarCopy"),O.MenubarGoMenu=new O("MenubarGoMenu"),O.MenubarSelectionMenu=new O("MenubarSelectionMenu"),O.InlineCompletionsActions=new O("InlineCompletionsActions");const K=(0,d.yh)("menuService"),se=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new rt.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:q=>q===O.CommandPalette}}addCommand(q){return this.addCommands(Le.$.single(q))}addCommands(q){for(const Y of q)this._commands.set(Y.id,Y);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,te.OF)(()=>{let Y=!1;for(const ue of q)Y=this._commands.delete(ue.id)||Y;Y&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(q){return this._commands.get(q)}getCommands(){const q=new Map;return this._commands.forEach((Y,ue)=>q.set(ue,Y)),q}appendMenuItem(q,Y){return this.appendMenuItems(Le.$.single({id:q,item:Y}))}appendMenuItems(q){const Y=new Set,ue=new E.S;for(const{id:ee,item:oe}of q){let De=this._menuItems.get(ee);De||(De=new E.S,this._menuItems.set(ee,De)),ue.push(De.push(oe)),Y.add(ee)}return this._onDidChangeMenu.fire(Y),(0,te.OF)(()=>{if(ue.size>0){for(let ee of ue)ee();this._onDidChangeMenu.fire(Y),ue.clear()}})}getMenuItems(q){let Y;return this._menuItems.has(q)?Y=[...this._menuItems.get(q)]:Y=[],q===O.CommandPalette&&this._appendImplicitItems(Y),Y}_appendImplicitItems(q){const Y=new Set;for(const ue of q)M(ue)&&(Y.add(ue.command.id),ue.alt&&Y.add(ue.alt.id));this._commands.forEach((ue,ee)=>{Y.has(ee)||q.push({command:ue})})}};class ae extends pe.wY{constructor(Y,ue,ee,oe){super(`submenuitem.${Y.submenu.id}`,typeof Y.title=="string"?Y.title:Y.title.value,[],"submenu"),this.item=Y,this._menuService=ue,this._contextKeyService=ee,this._options=oe}get actions(){const Y=[],ue=this._menuService.createMenu(this.item.submenu,this._contextKeyService),ee=ue.getActions(this._options);ue.dispose();for(const[,oe]of ee)oe.length>0&&(Y.push(...oe),Y.push(new pe.Z0));return Y.length&&Y.pop(),Y}}let Z=class kp{constructor(Y,ue,ee,oe,De){var ve,Ye;if(this._commandService=De,this.id=Y.id,this.label=ee!=null&&ee.renderShortTitle&&Y.shortTitle?typeof Y.shortTitle=="string"?Y.shortTitle:Y.shortTitle.value:typeof Y.title=="string"?Y.title:Y.title.value,this.tooltip=(Ye=typeof Y.tooltip=="string"?Y.tooltip:(ve=Y.tooltip)===null||ve===void 0?void 0:ve.value)!==null&&Ye!==void 0?Ye:"",this.enabled=!Y.precondition||oe.contextMatchesRules(Y.precondition),this.checked=void 0,Y.toggled){const We=Y.toggled.condition?Y.toggled:{condition:Y.toggled};this.checked=oe.contextMatchesRules(We.condition),this.checked&&We.tooltip&&(this.tooltip=typeof We.tooltip=="string"?We.tooltip:We.tooltip.value),We.title&&(this.label=typeof We.title=="string"?We.title:We.title.value)}this.item=Y,this.alt=ue?new kp(ue,void 0,ee,oe,De):void 0,this._options=ee,be.kS.isThemeIcon(Y.icon)&&(this.class=Pe.dT.asClassName(Y.icon))}dispose(){}run(...Y){var ue,ee;let oe=[];return!((ue=this._options)===null||ue===void 0)&&ue.arg&&(oe=[...oe,this._options.arg]),!((ee=this._options)===null||ee===void 0)&&ee.shouldForwardArgs&&(oe=[...oe,...Y]),this._commandService.executeCommand(this.id,...oe)}};Z=j([k(3,$.i6),k(4,Me.H)],Z)},35884:function(Fr,Rt,J){"use strict";J.d(Rt,{H:function(){return Me},P:function(){return $}});var pe=J(4348),Pe=J(88226),rt=J(69323),Le=J(34502),te=J(72999),E=J(16925);const Me=(0,E.yh)("commandService"),$=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new pe.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(d,be){if(!d)throw new Error("invalid command");if(typeof d=="string"){if(!be)throw new Error("invalid command");return this.registerCommand({id:d,handler:be})}if(d.description){const K=[];for(let ae of d.description.args)K.push(ae.constraint);const se=d.handler;d.handler=function(ae,...Z){return(0,te.D8)(Z,K),se(ae,...Z)}}const{id:j}=d;let k=this._commands.get(j);k||(k=new Le.S,this._commands.set(j,k));let M=k.unshift(d),O=(0,rt.OF)(()=>{M();const K=this._commands.get(j);K!=null&&K.isEmpty()&&this._commands.delete(j)});return this._onDidRegisterCommand.fire(j),O}registerCommandAlias(d,be){return $.registerCommand(d,(j,...k)=>j.get(Me).executeCommand(be,...k))}getCommand(d){const be=this._commands.get(d);if(!(!be||be.isEmpty()))return Pe.$.first(be)}getCommands(){const d=new Map;for(const be of this._commands.keys()){const j=this.getCommand(be);j&&d.set(be,j)}return d}};$.registerCommand("noop",()=>{})},90689:function(Fr,Rt,J){"use strict";J.d(Rt,{Ao:function(){return Me},Eq:function(){return de},Fb:function(){return $},K8:function(){return he},i6:function(){return pt},uy:function(){return ut}});var pe=J(23345),Pe=J(82983),rt=J(16925);let Le=pe.WE||"";const te=new Map;te.set("false",!1),te.set("true",!0),te.set("isMac",pe.dz),te.set("isLinux",pe.IJ),te.set("isWindows",pe.ED),te.set("isWeb",pe.$L),te.set("isMacNative",pe.dz&&!pe.$L),te.set("isEdge",Le.indexOf("Edg/")>=0),te.set("isFirefox",Le.indexOf("Firefox")>=0),te.set("isChrome",Le.indexOf("Chrome")>=0),te.set("isSafari",Le.indexOf("Safari")>=0);const E=Object.prototype.hasOwnProperty;class Me{static has(D){return k.create(D)}static equals(D,L){return M.create(D,L)}static regex(D,L){return oe.create(D,L)}static not(D){return ae.create(D)}static and(...D){return Ye.create(D,null)}static or(...D){return We.create(D,null,!0)}static deserialize(D,L=!1){if(D)return this._deserializeOrExpression(D,L)}static _deserializeOrExpression(D,L){let ie=D.split("||");return We.create(ie.map(xe=>this._deserializeAndExpression(xe,L)),null,!0)}static _deserializeAndExpression(D,L){let ie=D.split("&&");return Ye.create(ie.map(xe=>this._deserializeOne(xe,L)),null)}static _deserializeOne(D,L){if(D=D.trim(),D.indexOf("!=")>=0){let ie=D.split("!=");return se.create(ie[0].trim(),this._deserializeValue(ie[1],L))}if(D.indexOf("==")>=0){let ie=D.split("==");return M.create(ie[0].trim(),this._deserializeValue(ie[1],L))}if(D.indexOf("=~")>=0){let ie=D.split("=~");return oe.create(ie[0].trim(),this._deserializeRegexValue(ie[1],L))}if(D.indexOf(" in ")>=0){let ie=D.split(" in ");return O.create(ie[0].trim(),ie[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(D)){const ie=D.split(">=");return Y.create(ie[0].trim(),ie[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(D)){const ie=D.split(">");return q.create(ie[0].trim(),ie[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(D)){const ie=D.split("<=");return ee.create(ie[0].trim(),ie[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(D)){const ie=D.split("<");return ue.create(ie[0].trim(),ie[1].trim())}return/^\!\s*/.test(D)?ae.create(D.substr(1).trim()):k.create(D)}static _deserializeValue(D,L){if(D=D.trim(),D==="true")return!0;if(D==="false")return!1;let ie=/^'([^']*)'$/.exec(D);return ie?ie[1].trim():D}static _deserializeRegexValue(D,L){if((0,Pe.m5)(D)){if(L)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let ie=D.indexOf("/"),xe=D.lastIndexOf("/");if(ie===xe||ie<0){if(L)throw new Error(`bad regexp-value '${D}', missing /-enclosure`);return console.warn(`bad regexp-value '${D}', missing /-enclosure`),null}let at=D.slice(ie+1,xe),ot=D[xe+1]==="i"?"i":"";try{return new RegExp(at,ot)}catch(At){if(L)throw new Error(`bad regexp-value '${D}', parse error: ${At}`);return console.warn(`bad regexp-value '${D}', parse error: ${At}`),null}}}function $(we,D){const L=we?we.substituteConstants():void 0,ie=D?D.substituteConstants():void 0;return!L&&!ie?!0:!L||!ie?!1:L.equals(ie)}function d(we,D){return we.cmp(D)}class be{constructor(){this.type=0}cmp(D){return this.type-D.type}equals(D){return D.type===this.type}substituteConstants(){return this}evaluate(D){return!1}serialize(){return"false"}keys(){return[]}negate(){return j.INSTANCE}}be.INSTANCE=new be;class j{constructor(){this.type=1}cmp(D){return this.type-D.type}equals(D){return D.type===this.type}substituteConstants(){return this}evaluate(D){return!0}serialize(){return"true"}keys(){return[]}negate(){return be.INSTANCE}}j.INSTANCE=new j;class k{constructor(D,L){this.key=D,this.negated=L,this.type=2}static create(D,L=null){const ie=te.get(D);return typeof ie=="boolean"?ie?j.INSTANCE:be.INSTANCE:new k(D,L)}cmp(D){return D.type!==this.type?this.type-D.type:re(this.key,D.key)}equals(D){return D.type===this.type?this.key===D.key:!1}substituteConstants(){const D=te.get(this.key);return typeof D=="boolean"?D?j.INSTANCE:be.INSTANCE:this}evaluate(D){return!!D.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=ae.create(this.key,this)),this.negated}}class M{constructor(D,L,ie){this.key=D,this.value=L,this.negated=ie,this.type=4}static create(D,L,ie=null){if(typeof L=="boolean")return L?k.create(D,ie):ae.create(D,ie);const xe=te.get(D);return typeof xe=="boolean"?L===(xe?"true":"false")?j.INSTANCE:be.INSTANCE:new M(D,L,ie)}cmp(D){return D.type!==this.type?this.type-D.type:ce(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){const D=te.get(this.key);if(typeof D=="boolean"){const L=D?"true":"false";return this.value===L?j.INSTANCE:be.INSTANCE}return this}evaluate(D){return D.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=se.create(this.key,this.value,this)),this.negated}}class O{constructor(D,L){this.key=D,this.valueKey=L,this.type=10,this.negated=null}static create(D,L){return new O(D,L)}cmp(D){return D.type!==this.type?this.type-D.type:ce(this.key,this.valueKey,D.key,D.valueKey)}equals(D){return D.type===this.type?this.key===D.key&&this.valueKey===D.valueKey:!1}substituteConstants(){return this}evaluate(D){const L=D.getValue(this.valueKey),ie=D.getValue(this.key);return Array.isArray(L)?L.indexOf(ie)>=0:typeof ie=="string"&&typeof L=="object"&&L!==null?E.call(L,ie):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=K.create(this)),this.negated}}class K{constructor(D){this._actual=D,this.type=11}static create(D){return new K(D)}cmp(D){return D.type!==this.type?this.type-D.type:this._actual.cmp(D._actual)}equals(D){return D.type===this.type?this._actual.equals(D._actual):!1}substituteConstants(){return this}evaluate(D){return!this._actual.evaluate(D)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class se{constructor(D,L,ie){this.key=D,this.value=L,this.negated=ie,this.type=5}static create(D,L,ie=null){if(typeof L=="boolean")return L?ae.create(D,ie):k.create(D,ie);const xe=te.get(D);return typeof xe=="boolean"?L===(xe?"true":"false")?be.INSTANCE:j.INSTANCE:new se(D,L,ie)}cmp(D){return D.type!==this.type?this.type-D.type:ce(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){const D=te.get(this.key);if(typeof D=="boolean"){const L=D?"true":"false";return this.value===L?be.INSTANCE:j.INSTANCE}return this}evaluate(D){return D.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=M.create(this.key,this.value,this)),this.negated}}class ae{constructor(D,L){this.key=D,this.negated=L,this.type=3}static create(D,L=null){const ie=te.get(D);return typeof ie=="boolean"?ie?be.INSTANCE:j.INSTANCE:new ae(D,L)}cmp(D){return D.type!==this.type?this.type-D.type:re(this.key,D.key)}equals(D){return D.type===this.type?this.key===D.key:!1}substituteConstants(){const D=te.get(this.key);return typeof D=="boolean"?D?be.INSTANCE:j.INSTANCE:this}evaluate(D){return!D.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this)),this.negated}}function Z(we,D){if(typeof we=="string"){const L=parseFloat(we);isNaN(L)||(we=L)}return typeof we=="string"||typeof we=="number"?D(we):be.INSTANCE}class q{constructor(D,L,ie){this.key=D,this.value=L,this.negated=ie,this.type=12}static create(D,L,ie=null){return Z(L,xe=>new q(D,xe,ie))}cmp(D){return D.type!==this.type?this.type-D.type:ce(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ee.create(this.key,this.value,this)),this.negated}}class Y{constructor(D,L,ie){this.key=D,this.value=L,this.negated=ie,this.type=13}static create(D,L,ie=null){return Z(L,xe=>new Y(D,xe,ie))}cmp(D){return D.type!==this.type?this.type-D.type:ce(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ue.create(this.key,this.value,this)),this.negated}}class ue{constructor(D,L,ie){this.key=D,this.value=L,this.negated=ie,this.type=14}static create(D,L,ie=null){return Z(L,xe=>new ue(D,xe,ie))}cmp(D){return D.type!==this.type?this.type-D.type:ce(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Y.create(this.key,this.value,this)),this.negated}}class ee{constructor(D,L,ie){this.key=D,this.value=L,this.negated=ie,this.type=15}static create(D,L,ie=null){return Z(L,xe=>new ee(D,xe,ie))}cmp(D){return D.type!==this.type?this.type-D.type:ce(this.key,this.value,D.key,D.value)}equals(D){return D.type===this.type?this.key===D.key&&this.value===D.value:!1}substituteConstants(){return this}evaluate(D){return typeof this.value=="string"?!1:parseFloat(D.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=q.create(this.key,this.value,this)),this.negated}}class oe{constructor(D,L){this.key=D,this.regexp=L,this.type=7,this.negated=null}static create(D,L){return new oe(D,L)}cmp(D){if(D.type!==this.type)return this.type-D.type;if(this.key<D.key)return-1;if(this.key>D.key)return 1;const L=this.regexp?this.regexp.source:"",ie=D.regexp?D.regexp.source:"";return L<ie?-1:L>ie?1:0}equals(D){if(D.type===this.type){const L=this.regexp?this.regexp.source:"",ie=D.regexp?D.regexp.source:"";return this.key===D.key&&L===ie}return!1}substituteConstants(){return this}evaluate(D){let L=D.getValue(this.key);return this.regexp?this.regexp.test(L):!1}serialize(){const D=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${D}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=De.create(this)),this.negated}}class De{constructor(D){this._actual=D,this.type=8}static create(D){return new De(D)}cmp(D){return D.type!==this.type?this.type-D.type:this._actual.cmp(D._actual)}equals(D){return D.type===this.type?this._actual.equals(D._actual):!1}substituteConstants(){return this}evaluate(D){return!this._actual.evaluate(D)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ve(we){let D=null;for(let L=0,ie=we.length;L<ie;L++){const xe=we[L].substituteConstants();if(we[L]!==xe&&D===null){D=[];for(let at=0;at<L;at++)D[at]=we[at]}D!==null&&(D[L]=xe)}return D===null?we:D}class Ye{constructor(D,L){this.expr=D,this.negated=L,this.type=6}static create(D,L){return Ye._normalizeArr(D,L)}cmp(D){if(D.type!==this.type)return this.type-D.type;if(this.expr.length<D.expr.length)return-1;if(this.expr.length>D.expr.length)return 1;for(let L=0,ie=this.expr.length;L<ie;L++){const xe=d(this.expr[L],D.expr[L]);if(xe!==0)return xe}return 0}equals(D){if(D.type===this.type){if(this.expr.length!==D.expr.length)return!1;for(let L=0,ie=this.expr.length;L<ie;L++)if(!this.expr[L].equals(D.expr[L]))return!1;return!0}return!1}substituteConstants(){const D=ve(this.expr);return D===this.expr?this:Ye.create(D,this.negated)}evaluate(D){for(let L=0,ie=this.expr.length;L<ie;L++)if(!this.expr[L].evaluate(D))return!1;return!0}static _normalizeArr(D,L){const ie=[];let xe=!1;for(const at of D)if(at){if(at.type===1){xe=!0;continue}if(at.type===0)return be.INSTANCE;if(at.type===6){ie.push(...at.expr);continue}ie.push(at)}if(ie.length===0&&xe)return j.INSTANCE;if(ie.length!==0){if(ie.length===1)return ie[0];ie.sort(d);for(let at=1;at<ie.length;at++)ie[at-1].equals(ie[at])&&(ie.splice(at,1),at--);if(ie.length===1)return ie[0];for(;ie.length>1;){const at=ie[ie.length-1];if(at.type!==9)break;ie.pop();const ot=ie.pop(),At=ie.length===0,Xe=We.create(at.expr.map(ar=>Ye.create([ar,ot],null)),null,At);Xe&&(ie.push(Xe),ie.sort(d))}return ie.length===1?ie[0]:new Ye(ie,L)}}serialize(){return this.expr.map(D=>D.serialize()).join(" && ")}keys(){const D=[];for(let L of this.expr)D.push(...L.keys());return D}negate(){if(!this.negated){const D=[];for(let L of this.expr)D.push(L.negate());this.negated=We.create(D,this,!0)}return this.negated}}class We{constructor(D,L){this.expr=D,this.negated=L,this.type=9}static create(D,L,ie){return We._normalizeArr(D,L,ie)}cmp(D){if(D.type!==this.type)return this.type-D.type;if(this.expr.length<D.expr.length)return-1;if(this.expr.length>D.expr.length)return 1;for(let L=0,ie=this.expr.length;L<ie;L++){const xe=d(this.expr[L],D.expr[L]);if(xe!==0)return xe}return 0}equals(D){if(D.type===this.type){if(this.expr.length!==D.expr.length)return!1;for(let L=0,ie=this.expr.length;L<ie;L++)if(!this.expr[L].equals(D.expr[L]))return!1;return!0}return!1}substituteConstants(){const D=ve(this.expr);return D===this.expr?this:We.create(D,this.negated,!1)}evaluate(D){for(let L=0,ie=this.expr.length;L<ie;L++)if(this.expr[L].evaluate(D))return!0;return!1}static _normalizeArr(D,L,ie){let xe=[],at=!1;if(D){for(let ot=0,At=D.length;ot<At;ot++){const Xe=D[ot];if(Xe){if(Xe.type===0){at=!0;continue}if(Xe.type===1)return j.INSTANCE;if(Xe.type===9){xe=xe.concat(Xe.expr);continue}xe.push(Xe)}}if(xe.length===0&&at)return be.INSTANCE;xe.sort(d)}if(xe.length!==0){if(xe.length===1)return xe[0];for(let ot=1;ot<xe.length;ot++)xe[ot-1].equals(xe[ot])&&(xe.splice(ot,1),ot--);if(xe.length===1)return xe[0];if(ie){for(let ot=0;ot<xe.length;ot++)for(let At=ot+1;At<xe.length;At++)he(xe[ot],xe[At])&&(xe.splice(At,1),At--);if(xe.length===1)return xe[0]}return new We(xe,L)}}serialize(){return this.expr.map(D=>D.serialize()).join(" || ")}keys(){const D=[];for(let L of this.expr)D.push(...L.keys());return D}negate(){if(!this.negated){let D=[];for(let L of this.expr)D.push(L.negate());for(;D.length>1;){const L=D.shift(),ie=D.shift(),xe=[];for(const ot of Re(L))for(const At of Re(ie))xe.push(Ye.create([ot,At],null));const at=D.length===0;D.unshift(We.create(xe,null,at))}this.negated=D[0]}return this.negated}}class ut extends k{constructor(D,L,ie){super(D,null),this._defaultValue=L,typeof ie=="object"?ut._info.push(Object.assign(Object.assign({},ie),{key:D})):ie!==!0&&ut._info.push({key:D,description:ie,type:L!=null?typeof L:void 0})}static all(){return ut._info.values()}bindTo(D){return D.createKey(this.key,this._defaultValue)}getValue(D){return D.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(D){return M.create(this.key,D)}}ut._info=[];const pt=(0,rt.yh)("contextKeyService"),de="setContext";function re(we,D){return we<D?-1:we>D?1:0}function ce(we,D,L,ie){return we<L?-1:we>L?1:D<ie?-1:D>ie?1:0}function he(we,D){if(D.type===6&&we.type!==9&&we.type!==6){for(const xe of D.expr)if(we.equals(xe))return!0}const L=we.negate(),ie=Re(L).concat(Re(D));ie.sort(d);for(let xe=0;xe<ie.length;xe++){const ot=ie[xe].negate();for(let At=xe+1;At<ie.length;At++){const Xe=ie[At];if(ot.equals(Xe))return!0}}return!1}function Re(we){return we.type===9?we.expr:[we]}},16925:function(Fr,Rt,J){"use strict";J.d(Rt,{I8:function(){return pe},TG:function(){return Pe},jt:function(){return te},yh:function(){return Le}});var pe;(function(E){E.serviceIds=new Map,E.DI_TARGET="$di$target",E.DI_DEPENDENCIES="$di$dependencies";function Me($){return $[E.DI_DEPENDENCIES]||[]}E.getServiceDependencies=Me})(pe||(pe={}));const Pe=Le("instantiationService");function rt(E,Me,$,d){Me[pe.DI_TARGET]===Me?Me[pe.DI_DEPENDENCIES].push({id:E,index:$,optional:d}):(Me[pe.DI_DEPENDENCIES]=[{id:E,index:$,optional:d}],Me[pe.DI_TARGET]=Me)}function Le(E){if(pe.serviceIds.has(E))return pe.serviceIds.get(E);const Me=function($,d,be){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");rt(Me,$,be,!1)};return Me.toString=()=>E,pe.serviceIds.set(E,Me),Me}function te(E){return function(Me,$,d){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");rt(E,Me,d,!0)}}},44650:function(Fr,Rt,J){"use strict";J.d(Rt,{B:function(){return Le}});var pe=J(76068),Pe=J(72999);class rt{constructor(){this.data=new Map}add(E,Me){pe.ok(Pe.HD(E)),pe.ok(Pe.Kn(Me)),pe.ok(!this.data.has(E),"There is already an extension with this id"),this.data.set(E,Me)}as(E){return this.data.get(E)||null}}const Le=new rt},66213:function(Fr,Rt,J){"use strict";J.d(Rt,{e:function(){return pe}});var pe;(function(Pe){Pe.DARK="dark",Pe.LIGHT="light",Pe.HIGH_CONTRAST="hc"})(pe||(pe={}))},49055:function(Fr,Rt,J){"use strict";J.d(Rt,{EN:function(){return d},IP:function(){return k},Ic:function(){return K},XE:function(){return Me},bB:function(){return se},kS:function(){return be},m6:function(){return j}});var pe=J(52615),Pe=J(4348),rt=J(69323),Le=J(16925),te=J(44650),E=J(66213);const Me=(0,Le.yh)("themeService");var $;(function(ae){function Z(q){return q&&typeof q=="object"&&typeof q.id=="string"}ae.isThemeColor=Z})($||($={}));function d(ae){return{id:ae}}var be;(function(ae){function Z(De){return De&&typeof De=="object"&&typeof De.id=="string"&&(typeof De.color=="undefined"||$.isThemeColor(De.color))}ae.isThemeIcon=Z;const q=new RegExp(`^\\$\\((${pe.dT.iconNameExpression}(?:${pe.dT.iconModifierExpression})?)\\)$`);function Y(De){const ve=q.exec(De);if(!ve)return;let[,Ye]=ve;return{id:Ye}}ae.fromString=Y;function ue(De,ve){let Ye=De.id;const We=Ye.lastIndexOf("~");return We!==-1&&(Ye=Ye.substring(0,We)),ve&&(Ye=`${Ye}~${ve}`),{id:Ye}}ae.modify=ue;function ee(De,ve){var Ye,We;return De.id===ve.id&&((Ye=De.color)===null||Ye===void 0?void 0:Ye.id)===((We=ve.color)===null||We===void 0?void 0:We.id)}ae.isEqual=ee;function oe(De,ve){return{id:De.id,color:ve?d(ve):void 0}}ae.asThemeIcon=oe,ae.asClassNameArray=pe.dT.asClassNameArray,ae.asClassName=pe.dT.asClassName,ae.asCSSSelector=pe.dT.asCSSSelector})(be||(be={}));function j(ae){switch(ae){case E.e.DARK:return"vs-dark";case E.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const k={ThemingContribution:"base.contributions.theming"};class M{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Pe.Q5}onColorThemeChange(Z){return this.themingParticipants.push(Z),this.onThemingParticipantAddedEmitter.fire(Z),(0,rt.OF)(()=>{const q=this.themingParticipants.indexOf(Z);this.themingParticipants.splice(q,1)})}getThemingParticipants(){return this.themingParticipants}}let O=new M;te.B.add(k.ThemingContribution,O);function K(ae){return O.onColorThemeChange(ae)}class se extends rt.JT{constructor(Z){super(),this.themeService=Z,this.theme=Z.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(q=>this.onThemeChange(q)))}onThemeChange(Z){this.theme=Z,this.updateStyles()}updateStyles(){}}},5630:function(Fr,Rt,J){"use strict";var pe=J(72308),Pe=J(77321),rt=J(49618),Le=J(52487),te=J(74416),E=J(92310),Me=J.n(E),$=J(18929),d=J(59301),be=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],j=(0,d.forwardRef)(function(k,M){var O,K=k.prefixCls,se=K===void 0?"rc-checkbox":K,ae=k.className,Z=k.style,q=k.checked,Y=k.disabled,ue=k.defaultChecked,ee=ue===void 0?!1:ue,oe=k.type,De=oe===void 0?"checkbox":oe,ve=k.title,Ye=k.onChange,We=(0,te.Z)(k,be),ut=(0,d.useRef)(null),pt=(0,$.Z)(ee,{value:q}),de=(0,Le.Z)(pt,2),re=de[0],ce=de[1];(0,d.useImperativeHandle)(M,function(){return{focus:function(){var D;(D=ut.current)===null||D===void 0||D.focus()},blur:function(){var D;(D=ut.current)===null||D===void 0||D.blur()},input:ut.current}});var he=Me()(se,ae,(O={},(0,rt.Z)(O,"".concat(se,"-checked"),re),(0,rt.Z)(O,"".concat(se,"-disabled"),Y),O)),Re=function(D){Y||("checked"in k||ce(D.target.checked),Ye==null||Ye({target:(0,Pe.Z)((0,Pe.Z)({},k),{},{type:De,checked:D.target.checked}),stopPropagation:function(){D.stopPropagation()},preventDefault:function(){D.preventDefault()},nativeEvent:D.nativeEvent}))};return d.createElement("span",{className:he,title:ve,style:Z},d.createElement("input",(0,pe.Z)({},We,{className:"".concat(se,"-input"),ref:ut,onChange:Re,disabled:Y,checked:!!re,type:De})),d.createElement("span",{className:"".concat(se,"-inner")}))});Rt.Z=j},31561:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return De}});var pe=J(72308),Pe=J(49618),rt=J(52487),Le=J(74416),te=J(35593),E=J(92310),Me=J.n(E),$=J(8654),d=J(59301),be=J(10228),j=J(16089),k=be.Z.ESC,M=be.Z.TAB;function O(ve){var Ye=ve.visible,We=ve.triggerRef,ut=ve.onVisibleChange,pt=ve.autoFocus,de=ve.overlayRef,re=d.useRef(!1),ce=function(){if(Ye){var D,L;(D=We.current)===null||D===void 0||(L=D.focus)===null||L===void 0||L.call(D),ut==null||ut(!1)}},he=function(){var D;return(D=de.current)!==null&&D!==void 0&&D.focus?(de.current.focus(),re.current=!0,!0):!1},Re=function(D){switch(D.keyCode){case k:ce();break;case M:{var L=!1;re.current||(L=he()),L?D.preventDefault():ce();break}}};d.useEffect(function(){return Ye?(window.addEventListener("keydown",Re),pt&&(0,j.Z)(he,3),function(){window.removeEventListener("keydown",Re),re.current=!1}):function(){re.current=!1}},[Ye])}var K=(0,d.forwardRef)(function(ve,Ye){var We=ve.overlay,ut=ve.arrow,pt=ve.prefixCls,de=(0,d.useMemo)(function(){var ce;return typeof We=="function"?ce=We():ce=We,ce},[We]),re=(0,$.sQ)(Ye,de==null?void 0:de.ref);return d.createElement(d.Fragment,null,ut&&d.createElement("div",{className:"".concat(pt,"-arrow")}),d.cloneElement(de,{ref:(0,$.Yr)(de)?re:void 0}))}),se=K,ae={adjustX:1,adjustY:1},Z=[0,0],q={topLeft:{points:["bl","tl"],overflow:ae,offset:[0,-4],targetOffset:Z},top:{points:["bc","tc"],overflow:ae,offset:[0,-4],targetOffset:Z},topRight:{points:["br","tr"],overflow:ae,offset:[0,-4],targetOffset:Z},bottomLeft:{points:["tl","bl"],overflow:ae,offset:[0,4],targetOffset:Z},bottom:{points:["tc","bc"],overflow:ae,offset:[0,4],targetOffset:Z},bottomRight:{points:["tr","br"],overflow:ae,offset:[0,4],targetOffset:Z}},Y=q,ue=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function ee(ve,Ye){var We,ut=ve.arrow,pt=ut===void 0?!1:ut,de=ve.prefixCls,re=de===void 0?"rc-dropdown":de,ce=ve.transitionName,he=ve.animation,Re=ve.align,we=ve.placement,D=we===void 0?"bottomLeft":we,L=ve.placements,ie=L===void 0?Y:L,xe=ve.getPopupContainer,at=ve.showAction,ot=ve.hideAction,At=ve.overlayClassName,Xe=ve.overlayStyle,ar=ve.visible,jt=ve.trigger,Ot=jt===void 0?["hover"]:jt,kr=ve.autoFocus,$r=ve.overlay,ir=ve.children,zr=ve.onVisibleChange,li=(0,Le.Z)(ve,ue),Gr=d.useState(),Ze=(0,rt.Z)(Gr,2),nt=Ze[0],Qe=Ze[1],Ct="visible"in ve?ar:nt,Dt=d.useRef(null),ye=d.useRef(null),Oe=d.useRef(null);d.useImperativeHandle(Ye,function(){return Dt.current});var et=function(Fe){Qe(Fe),zr==null||zr(Fe)};O({visible:Ct,triggerRef:Oe,onVisibleChange:et,autoFocus:kr,overlayRef:ye});var vt=function(Fe){var Ge=ve.onOverlayClick;Qe(!1),Ge&&Ge(Fe)},wt=function(){return d.createElement(se,{ref:ye,overlay:$r,prefixCls:re,arrow:pt})},Ht=function(){return typeof $r=="function"?wt:wt()},fr=function(){var Fe=ve.minOverlayWidthMatchTrigger,Ge=ve.alignPoint;return"minOverlayWidthMatchTrigger"in ve?Fe:!Ge},Xt=function(){var Fe=ve.openClassName;return Fe!==void 0?Fe:"".concat(re,"-open")},Ue=d.cloneElement(ir,{className:Me()((We=ir.props)===null||We===void 0?void 0:We.className,Ct&&Xt()),ref:(0,$.Yr)(ir)?(0,$.sQ)(Oe,ir.ref):void 0}),Ut=ot;return!Ut&&Ot.indexOf("contextMenu")!==-1&&(Ut=["click"]),d.createElement(te.Z,(0,pe.Z)({builtinPlacements:ie},li,{prefixCls:re,ref:Dt,popupClassName:Me()(At,(0,Pe.Z)({},"".concat(re,"-show-arrow"),pt)),popupStyle:Xe,action:Ot,showAction:at,hideAction:Ut,popupPlacement:D,popupAlign:Re,popupTransitionName:ce,popupAnimation:he,popupVisible:Ct,stretch:fr()?"minWidth":"",popup:Ht(),onPopupVisibleChange:et,onPopupClick:vt,getPopupContainer:xe}),Ue)}var oe=d.forwardRef(ee),De=oe},93681:function(Fr,Rt,J){"use strict";J.r(Rt),J.d(Rt,{BaseInput:function(){return be},default:function(){return q}});var pe=J(72308),Pe=J(77321),rt=J(49618),Le=J(62853),te=J(92310),E=J.n(te),Me=J(59301),$=J(5643),d=function(ue){var ee,oe,De=ue.inputElement,ve=ue.prefixCls,Ye=ue.prefix,We=ue.suffix,ut=ue.addonBefore,pt=ue.addonAfter,de=ue.className,re=ue.style,ce=ue.disabled,he=ue.readOnly,Re=ue.focused,we=ue.triggerFocus,D=ue.allowClear,L=ue.value,ie=ue.handleReset,xe=ue.hidden,at=ue.classes,ot=ue.classNames,At=ue.dataAttrs,Xe=ue.styles,ar=ue.components,jt=(ar==null?void 0:ar.affixWrapper)||"span",Ot=(ar==null?void 0:ar.groupWrapper)||"span",kr=(ar==null?void 0:ar.wrapper)||"span",$r=(ar==null?void 0:ar.groupAddon)||"span",ir=(0,Me.useRef)(null),zr=function(wt){var Ht;(Ht=ir.current)!==null&&Ht!==void 0&&Ht.contains(wt.target)&&(we==null||we())},li=function(){var wt;if(!D)return null;var Ht=!ce&&!he&&L,fr="".concat(ve,"-clear-icon"),Xt=(0,Le.Z)(D)==="object"&&D!==null&&D!==void 0&&D.clearIcon?D.clearIcon:"\u2716";return Me.createElement("span",{onClick:ie,onMouseDown:function(Ut){return Ut.preventDefault()},className:E()(fr,(wt={},(0,rt.Z)(wt,"".concat(fr,"-hidden"),!Ht),(0,rt.Z)(wt,"".concat(fr,"-has-suffix"),!!We),wt)),role:"button",tabIndex:-1},Xt)},Gr=(0,Me.cloneElement)(De,{value:L,hidden:xe,className:E()((ee=De.props)===null||ee===void 0?void 0:ee.className,!(0,$.X3)(ue)&&!(0,$.He)(ue)&&de)||null,style:(0,Pe.Z)((0,Pe.Z)({},(oe=De.props)===null||oe===void 0?void 0:oe.style),!(0,$.X3)(ue)&&!(0,$.He)(ue)?re:{})});if((0,$.X3)(ue)){var Ze,nt="".concat(ve,"-affix-wrapper"),Qe=E()(nt,(Ze={},(0,rt.Z)(Ze,"".concat(nt,"-disabled"),ce),(0,rt.Z)(Ze,"".concat(nt,"-focused"),Re),(0,rt.Z)(Ze,"".concat(nt,"-readonly"),he),(0,rt.Z)(Ze,"".concat(nt,"-input-with-clear-btn"),We&&D&&L),Ze),!(0,$.He)(ue)&&de,at==null?void 0:at.affixWrapper,ot==null?void 0:ot.affixWrapper),Ct=(We||D)&&Me.createElement("span",{className:E()("".concat(ve,"-suffix"),ot==null?void 0:ot.suffix),style:Xe==null?void 0:Xe.suffix},li(),We);Gr=Me.createElement(jt,(0,pe.Z)({className:Qe,style:(0,Pe.Z)((0,Pe.Z)({},(0,$.He)(ue)?void 0:re),Xe==null?void 0:Xe.affixWrapper),hidden:!(0,$.He)(ue)&&xe,onClick:zr},At==null?void 0:At.affixWrapper,{ref:ir}),Ye&&Me.createElement("span",{className:E()("".concat(ve,"-prefix"),ot==null?void 0:ot.prefix),style:Xe==null?void 0:Xe.prefix},Ye),(0,Me.cloneElement)(De,{value:L,hidden:null}),Ct)}if((0,$.He)(ue)){var Dt="".concat(ve,"-group"),ye="".concat(Dt,"-addon"),Oe=E()("".concat(ve,"-wrapper"),Dt,at==null?void 0:at.wrapper),et=E()("".concat(ve,"-group-wrapper"),de,at==null?void 0:at.group);return Me.createElement(Ot,{className:et,style:re,hidden:xe},Me.createElement(kr,{className:Oe},ut&&Me.createElement($r,{className:ye},ut),(0,Me.cloneElement)(Gr,{hidden:null}),pt&&Me.createElement($r,{className:ye},pt)))}return Gr},be=d,j=J(80702),k=J(52487),M=J(74416),O=J(18929),K=J(2738),se=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],ae=(0,Me.forwardRef)(function(Y,ue){var ee=Y.autoComplete,oe=Y.onChange,De=Y.onFocus,ve=Y.onBlur,Ye=Y.onPressEnter,We=Y.onKeyDown,ut=Y.prefixCls,pt=ut===void 0?"rc-input":ut,de=Y.disabled,re=Y.htmlSize,ce=Y.className,he=Y.maxLength,Re=Y.suffix,we=Y.showCount,D=Y.type,L=D===void 0?"text":D,ie=Y.classes,xe=Y.classNames,at=Y.styles,ot=(0,M.Z)(Y,se),At=(0,O.Z)(Y.defaultValue,{value:Y.value}),Xe=(0,k.Z)(At,2),ar=Xe[0],jt=Xe[1],Ot=(0,Me.useState)(!1),kr=(0,k.Z)(Ot,2),$r=kr[0],ir=kr[1],zr=(0,Me.useRef)(null),li=function(et){zr.current&&(0,$.nH)(zr.current,et)};(0,Me.useImperativeHandle)(ue,function(){return{focus:li,blur:function(){var et;(et=zr.current)===null||et===void 0||et.blur()},setSelectionRange:function(et,vt,wt){var Ht;(Ht=zr.current)===null||Ht===void 0||Ht.setSelectionRange(et,vt,wt)},select:function(){var et;(et=zr.current)===null||et===void 0||et.select()},input:zr.current}}),(0,Me.useEffect)(function(){ir(function(Oe){return Oe&&de?!1:Oe})},[de]);var Gr=function(et){Y.value===void 0&&jt(et.target.value),zr.current&&(0,$.rJ)(zr.current,et,oe)},Ze=function(et){Ye&&et.key==="Enter"&&Ye(et),We==null||We(et)},nt=function(et){ir(!0),De==null||De(et)},Qe=function(et){ir(!1),ve==null||ve(et)},Ct=function(et){jt(""),li(),zr.current&&(0,$.rJ)(zr.current,et,oe)},Dt=function(){var et=(0,K.Z)(Y,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Me.createElement("input",(0,pe.Z)({autoComplete:ee},et,{onChange:Gr,onFocus:nt,onBlur:Qe,onKeyDown:Ze,className:E()(pt,(0,rt.Z)({},"".concat(pt,"-disabled"),de),xe==null?void 0:xe.input),style:at==null?void 0:at.input,ref:zr,size:re,type:L}))},ye=function(){var et=Number(he)>0;if(Re||we){var vt=(0,$.D7)(ar),wt=(0,j.Z)(vt).length,Ht=(0,Le.Z)(we)==="object"?we.formatter({value:vt,count:wt,maxLength:he}):"".concat(wt).concat(et?" / ".concat(he):"");return Me.createElement(Me.Fragment,null,!!we&&Me.createElement("span",{className:E()("".concat(pt,"-show-count-suffix"),(0,rt.Z)({},"".concat(pt,"-show-count-has-suffix"),!!Re),xe==null?void 0:xe.count),style:(0,Pe.Z)({},at==null?void 0:at.count)},Ht),Re)}return null};return Me.createElement(be,(0,pe.Z)({},ot,{prefixCls:pt,className:ce,inputElement:Dt(),handleReset:Ct,value:(0,$.D7)(ar),focused:$r,triggerFocus:li,suffix:ye(),disabled:de,classes:ie,classNames:xe,styles:at}))}),Z=ae,q=Z},5643:function(Fr,Rt,J){"use strict";J.d(Rt,{D7:function(){return te},He:function(){return pe},X3:function(){return Pe},nH:function(){return Le},rJ:function(){return rt}});function pe(E){return!!(E.addonBefore||E.addonAfter)}function Pe(E){return!!(E.prefix||E.suffix||E.allowClear)}function rt(E,Me,$,d){if($){var be=Me;if(Me.type==="click"){var j=E.cloneNode(!0);be=Object.create(Me,{target:{value:j},currentTarget:{value:j}}),j.value="",$(be);return}if(d!==void 0){be=Object.create(Me,{target:{value:E},currentTarget:{value:E}}),E.value=d,$(be);return}$(be)}}function Le(E,Me){if(E){E.focus(Me);var $=Me||{},d=$.cursor;if(d){var be=E.value.length;switch(d){case"start":E.setSelectionRange(0,0);break;case"end":E.setSelectionRange(be,be);break;default:E.setSelectionRange(0,be)}}}}function te(E){return typeof E=="undefined"||E===null?"":String(E)}},15285:function(Fr,Rt,J){"use strict";J.d(Rt,{iz:function(){return Dr},ck:function(){return Je},BW:function(){return oi},sN:function(){return Je},Wd:function(){return Ft},ZP:function(){return Or},Xl:function(){return We}});var pe=J(72308),Pe=J(49618),rt=J(77321),Le=J(80702),te=J(52487),E=J(74416),Me=J(92310),$=J.n(Me),d=J(11780),be=J(18929),j=J(13697),k=J(48736),M=J(59301),O=J(4676),K=M.createContext(null);function se(lt,tt){return lt===void 0?null:"".concat(lt,"-").concat(tt)}function ae(lt){var tt=M.useContext(K);return se(tt,lt)}var Z=J(80547),q=["children","locked"],Y=M.createContext(null);function ue(lt,tt){var _t=(0,rt.Z)({},lt);return Object.keys(tt).forEach(function(Lt){var ft=tt[Lt];ft!==void 0&&(_t[Lt]=ft)}),_t}function ee(lt){var tt=lt.children,_t=lt.locked,Lt=(0,E.Z)(lt,q),ft=M.useContext(Y),Kt=(0,Z.Z)(function(){return ue(ft,Lt)},[ft,Lt],function(Bt,lr){return!_t&&(Bt[0]!==lr[0]||!(0,j.Z)(Bt[1],lr[1],!0))});return M.createElement(Y.Provider,{value:Kt},tt)}var oe=[],De=M.createContext(null);function ve(){return M.useContext(De)}var Ye=M.createContext(oe);function We(lt){var tt=M.useContext(Ye);return M.useMemo(function(){return lt!==void 0?[].concat((0,Le.Z)(tt),[lt]):tt},[tt,lt])}var ut=M.createContext(null),pt=M.createContext({}),de=pt,re=J(29194);function ce(lt){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,re.Z)(lt)){var _t=lt.nodeName.toLowerCase(),Lt=["input","select","textarea","button"].includes(_t)||lt.isContentEditable||_t==="a"&&!!lt.getAttribute("href"),ft=lt.getAttribute("tabindex"),Kt=Number(ft),Bt=null;return ft&&!Number.isNaN(Kt)?Bt=Kt:Lt&&Bt===null&&(Bt=0),Lt&&lt.disabled&&(Bt=null),Bt!==null&&(Bt>=0||tt&&Bt<0)}return!1}function he(lt){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_t=(0,Le.Z)(lt.querySelectorAll("*")).filter(function(Lt){return ce(Lt,tt)});return ce(lt,tt)&&_t.unshift(lt),_t}var Re=null;function we(){Re=document.activeElement}function D(){Re=null}function L(){if(Re)try{Re.focus()}catch(lt){}}function ie(lt,tt){if(tt.keyCode===9){var _t=he(lt),Lt=_t[tt.shiftKey?0:_t.length-1],ft=Lt===document.activeElement||lt===document.activeElement;if(ft){var Kt=_t[tt.shiftKey?_t.length-1:0];Kt.focus(),tt.preventDefault()}}}var xe=J(10228),at=J(16089),ot=xe.Z.LEFT,At=xe.Z.RIGHT,Xe=xe.Z.UP,ar=xe.Z.DOWN,jt=xe.Z.ENTER,Ot=xe.Z.ESC,kr=xe.Z.HOME,$r=xe.Z.END,ir=[Xe,ar,ot,At];function zr(lt,tt,_t,Lt){var ft,Kt,Bt,lr,Tr="prev",pr="next",si="children",ci="parent";if(lt==="inline"&&Lt===jt)return{inlineTrigger:!0};var gi=(ft={},(0,Pe.Z)(ft,Xe,Tr),(0,Pe.Z)(ft,ar,pr),ft),Er=(Kt={},(0,Pe.Z)(Kt,ot,_t?pr:Tr),(0,Pe.Z)(Kt,At,_t?Tr:pr),(0,Pe.Z)(Kt,ar,si),(0,Pe.Z)(Kt,jt,si),Kt),Mr=(Bt={},(0,Pe.Z)(Bt,Xe,Tr),(0,Pe.Z)(Bt,ar,pr),(0,Pe.Z)(Bt,jt,si),(0,Pe.Z)(Bt,Ot,ci),(0,Pe.Z)(Bt,ot,_t?si:ci),(0,Pe.Z)(Bt,At,_t?ci:si),Bt),Si={inline:gi,horizontal:Er,vertical:Mr,inlineSub:gi,horizontalSub:Mr,verticalSub:Mr},Ai=(lr=Si["".concat(lt).concat(tt?"":"Sub")])===null||lr===void 0?void 0:lr[Lt];switch(Ai){case Tr:return{offset:-1,sibling:!0};case pr:return{offset:1,sibling:!0};case ci:return{offset:-1,sibling:!1};case si:return{offset:1,sibling:!1};default:return null}}function li(lt){for(var tt=lt;tt;){if(tt.getAttribute("data-menu-list"))return tt;tt=tt.parentElement}return null}function Gr(lt,tt){for(var _t=lt||document.activeElement;_t;){if(tt.has(_t))return _t;_t=_t.parentElement}return null}function Ze(lt,tt){var _t=he(lt,!0);return _t.filter(function(Lt){return tt.has(Lt)})}function nt(lt,tt,_t){var Lt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!lt)return null;var ft=Ze(lt,tt),Kt=ft.length,Bt=ft.findIndex(function(lr){return _t===lr});return Lt<0?Bt===-1?Bt=Kt-1:Bt-=1:Lt>0&&(Bt+=1),Bt=(Bt+Kt)%Kt,ft[Bt]}var Qe=function(tt,_t){var Lt=new Set,ft=new Map,Kt=new Map;return tt.forEach(function(Bt){var lr=document.querySelector("[data-menu-id='".concat(se(_t,Bt),"']"));lr&&(Lt.add(lr),Kt.set(lr,Bt),ft.set(Bt,lr))}),{elements:Lt,key2element:ft,element2key:Kt}};function Ct(lt,tt,_t,Lt,ft,Kt,Bt,lr,Tr,pr){var si=M.useRef(),ci=M.useRef();ci.current=tt;var gi=function(){at.Z.cancel(si.current)};return M.useEffect(function(){return function(){gi()}},[]),function(Er){var Mr=Er.which;if([].concat(ir,[jt,Ot,kr,$r]).includes(Mr)){var Si=Kt(),Ai=Qe(Si,Lt),Xr=Ai,ri=Xr.elements,ii=Xr.key2element,ai=Xr.element2key,Kr=ii.get(tt),fi=Gr(Kr,ri),Pi=ai.get(fi),Di=zr(lt,Bt(Pi,!0).length===1,_t,Mr);if(!Di&&Mr!==kr&&Mr!==$r)return;(ir.includes(Mr)||[kr,$r].includes(Mr))&&Er.preventDefault();var Ar=function(Hr){if(Hr){var pn=Hr,_n=Hr.querySelector("a");_n!=null&&_n.getAttribute("href")&&(pn=_n);var Vi=ai.get(Hr);lr(Vi),gi(),si.current=(0,at.Z)(function(){ci.current===Vi&&pn.focus()})}};if([kr,$r].includes(Mr)||Di.sibling||!fi){var je;!fi||lt==="inline"?je=ft.current:je=li(fi);var cr,yr=Ze(je,ri);Mr===kr?cr=yr[0]:Mr===$r?cr=yr[yr.length-1]:cr=nt(je,ri,fi,Di.offset),Ar(cr)}else if(Di.inlineTrigger)Tr(Pi);else if(Di.offset>0)Tr(Pi,!0),gi(),si.current=(0,at.Z)(function(){Ai=Qe(Si,Lt);var $i=fi.getAttribute("aria-controls"),Hr=document.getElementById($i),pn=nt(Hr,Ai.elements);Ar(pn)},5);else if(Di.offset<0){var jr=Bt(Pi,!0),nn=jr[jr.length-2],vi=ii.get(nn);Tr(nn,!1),Ar(vi)}}pr==null||pr(Er)}}function Dt(lt){Promise.resolve().then(lt)}var ye="__RC_UTIL_PATH_SPLIT__",Oe=function(tt){return tt.join(ye)},et=function(tt){return tt.split(ye)},vt="rc-menu-more";function wt(){var lt=M.useState({}),tt=(0,te.Z)(lt,2),_t=tt[1],Lt=(0,M.useRef)(new Map),ft=(0,M.useRef)(new Map),Kt=M.useState([]),Bt=(0,te.Z)(Kt,2),lr=Bt[0],Tr=Bt[1],pr=(0,M.useRef)(0),si=(0,M.useRef)(!1),ci=function(){si.current||_t({})},gi=(0,M.useCallback)(function(ii,ai){var Kr=Oe(ai);ft.current.set(Kr,ii),Lt.current.set(ii,Kr),pr.current+=1;var fi=pr.current;Dt(function(){fi===pr.current&&ci()})},[]),Er=(0,M.useCallback)(function(ii,ai){var Kr=Oe(ai);ft.current.delete(Kr),Lt.current.delete(ii)},[]),Mr=(0,M.useCallback)(function(ii){Tr(ii)},[]),Si=(0,M.useCallback)(function(ii,ai){var Kr=Lt.current.get(ii)||"",fi=et(Kr);return ai&&lr.includes(fi[0])&&fi.unshift(vt),fi},[lr]),Ai=(0,M.useCallback)(function(ii,ai){return ii.some(function(Kr){var fi=Si(Kr,!0);return fi.includes(ai)})},[Si]),Xr=function(){var ai=(0,Le.Z)(Lt.current.keys());return lr.length&&ai.push(vt),ai},ri=(0,M.useCallback)(function(ii){var ai="".concat(Lt.current.get(ii)).concat(ye),Kr=new Set;return(0,Le.Z)(ft.current.keys()).forEach(function(fi){fi.startsWith(ai)&&Kr.add(ft.current.get(fi))}),Kr},[]);return M.useEffect(function(){return function(){si.current=!0}},[]),{registerPath:gi,unregisterPath:Er,refreshOverflowKeys:Mr,isSubPathKey:Ai,getKeyPath:Si,getKeys:Xr,getSubPathKeys:ri}}function Ht(lt){var tt=M.useRef(lt);tt.current=lt;var _t=M.useCallback(function(){for(var Lt,ft=arguments.length,Kt=new Array(ft),Bt=0;Bt<ft;Bt++)Kt[Bt]=arguments[Bt];return(Lt=tt.current)===null||Lt===void 0?void 0:Lt.call.apply(Lt,[tt].concat(Kt))},[]);return lt?_t:void 0}var fr=Math.random().toFixed(5).toString().slice(2),Xt=0;function Ue(lt){var tt=(0,be.Z)(lt,{value:lt}),_t=(0,te.Z)(tt,2),Lt=_t[0],ft=_t[1];return M.useEffect(function(){Xt+=1;var Kt="".concat(fr,"-").concat(Xt);ft("rc-menu-uuid-".concat(Kt))},[]),Lt}var Ut=J(96949),_r=J(55090),Fe=J(77205),Ge=J(38793),it=J(2738),Pt=J(8654);function kt(lt,tt,_t,Lt){var ft=M.useContext(Y),Kt=ft.activeKey,Bt=ft.onActive,lr=ft.onInactive,Tr={active:Kt===lt};return tt||(Tr.onMouseEnter=function(pr){_t==null||_t({key:lt,domEvent:pr}),Bt(lt)},Tr.onMouseLeave=function(pr){Lt==null||Lt({key:lt,domEvent:pr}),lr(lt)}),Tr}function zt(lt){var tt=M.useContext(Y),_t=tt.mode,Lt=tt.rtl,ft=tt.inlineIndent;if(_t!=="inline")return null;var Kt=lt;return Lt?{paddingRight:Kt*ft}:{paddingLeft:Kt*ft}}function rr(lt){var tt=lt.icon,_t=lt.props,Lt=lt.children,ft;return tt===null||tt===!1?null:(typeof tt=="function"?ft=M.createElement(tt,(0,rt.Z)({},_t)):typeof tt!="boolean"&&(ft=tt),ft||Lt||null)}var T=["item"];function B(lt){var tt=lt.item,_t=(0,E.Z)(lt,T);return Object.defineProperty(_t,"item",{get:function(){return(0,k.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),tt}}),_t}var dt=["title","attribute","elementRef"],G=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],fe=["active"],xr=function(lt){(0,Fe.Z)(_t,lt);var tt=(0,Ge.Z)(_t);function _t(){return(0,Ut.Z)(this,_t),tt.apply(this,arguments)}return(0,_r.Z)(_t,[{key:"render",value:function(){var ft=this.props,Kt=ft.title,Bt=ft.attribute,lr=ft.elementRef,Tr=(0,E.Z)(ft,dt),pr=(0,it.Z)(Tr,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,k.ZP)(!Bt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),M.createElement(d.Z.Item,(0,pe.Z)({},Bt,{title:typeof Kt=="string"?Kt:void 0},pr,{ref:lr}))}}]),_t}(M.Component),Ne=M.forwardRef(function(lt,tt){var _t,Lt=lt.style,ft=lt.className,Kt=lt.eventKey,Bt=lt.warnKey,lr=lt.disabled,Tr=lt.itemIcon,pr=lt.children,si=lt.role,ci=lt.onMouseEnter,gi=lt.onMouseLeave,Er=lt.onClick,Mr=lt.onKeyDown,Si=lt.onFocus,Ai=(0,E.Z)(lt,G),Xr=ae(Kt),ri=M.useContext(Y),ii=ri.prefixCls,ai=ri.onItemClick,Kr=ri.disabled,fi=ri.overflowDisabled,Pi=ri.itemIcon,Di=ri.selectedKeys,Ar=ri.onActive,je=M.useContext(de),cr=je._internalRenderMenuItem,yr="".concat(ii,"-item"),jr=M.useRef(),nn=M.useRef(),vi=Kr||lr,$i=(0,Pt.x1)(tt,nn),Hr=We(Kt),pn=function(tn){return{key:Kt,keyPath:(0,Le.Z)(Hr).reverse(),item:jr.current,domEvent:tn}},_n=Tr||Pi,Vi=kt(Kt,vi,ci,gi),ts=Vi.active,Yn=(0,E.Z)(Vi,fe),$n=Di.includes(Kt),Gn=zt(Hr.length),Pr=function(tn){if(!vi){var In=pn(tn);Er==null||Er(B(In)),ai(In)}},ki=function(tn){if(Mr==null||Mr(tn),tn.which===xe.Z.ENTER){var In=pn(tn);Er==null||Er(B(In)),ai(In)}},Ki=function(tn){Ar(Kt),Si==null||Si(tn)},Wi={};lt.role==="option"&&(Wi["aria-selected"]=$n);var Vn=M.createElement(xr,(0,pe.Z)({ref:jr,elementRef:$i,role:si===null?"none":si||"menuitem",tabIndex:lr?null:-1,"data-menu-id":fi&&Xr?null:Xr},Ai,Yn,Wi,{component:"li","aria-disabled":lr,style:(0,rt.Z)((0,rt.Z)({},Gn),Lt),className:$()(yr,(_t={},(0,Pe.Z)(_t,"".concat(yr,"-active"),ts),(0,Pe.Z)(_t,"".concat(yr,"-selected"),$n),(0,Pe.Z)(_t,"".concat(yr,"-disabled"),vi),_t),ft),onClick:Pr,onKeyDown:ki,onFocus:Ki}),pr,M.createElement(rr,{props:(0,rt.Z)((0,rt.Z)({},lt),{},{isSelected:$n}),icon:_n}));return cr&&(Vn=cr(Vn,lt,{selected:$n})),Vn});function He(lt,tt){var _t=lt.eventKey,Lt=ve(),ft=We(_t);return M.useEffect(function(){if(Lt)return Lt.registerPath(_t,ft),function(){Lt.unregisterPath(_t,ft)}},[ft]),Lt?null:M.createElement(Ne,(0,pe.Z)({},lt,{ref:tt}))}var Je=M.forwardRef(He),W=["className","children"],ge=function(tt,_t){var Lt=tt.className,ft=tt.children,Kt=(0,E.Z)(tt,W),Bt=M.useContext(Y),lr=Bt.prefixCls,Tr=Bt.mode,pr=Bt.rtl;return M.createElement("ul",(0,pe.Z)({className:$()(lr,pr&&"".concat(lr,"-rtl"),"".concat(lr,"-sub"),"".concat(lr,"-").concat(Tr==="inline"?"inline":"vertical"),Lt),role:"menu"},Kt,{"data-menu-list":!0,ref:_t}),ft)},Se=M.forwardRef(ge);Se.displayName="SubMenuList";var Ke=Se,V=J(11592);function qt(lt,tt){return(0,V.Z)(lt).map(function(_t,Lt){if(M.isValidElement(_t)){var ft,Kt,Bt=_t.key,lr=(ft=(Kt=_t.props)===null||Kt===void 0?void 0:Kt.eventKey)!==null&&ft!==void 0?ft:Bt,Tr=lr==null;Tr&&(lr="tmp_key-".concat([].concat((0,Le.Z)(tt),[Lt]).join("-")));var pr={key:lr,eventKey:lr};return M.cloneElement(_t,pr)}return _t})}var Ae=J(35593),Yt={adjustX:1,adjustY:1},vr={topLeft:{points:["bl","tl"],overflow:Yt},topRight:{points:["br","tr"],overflow:Yt},bottomLeft:{points:["tl","bl"],overflow:Yt},bottomRight:{points:["tr","br"],overflow:Yt},leftTop:{points:["tr","tl"],overflow:Yt},leftBottom:{points:["br","bl"],overflow:Yt},rightTop:{points:["tl","tr"],overflow:Yt},rightBottom:{points:["bl","br"],overflow:Yt}},ei={topLeft:{points:["bl","tl"],overflow:Yt},topRight:{points:["br","tr"],overflow:Yt},bottomLeft:{points:["tl","bl"],overflow:Yt},bottomRight:{points:["tr","br"],overflow:Yt},rightTop:{points:["tr","tl"],overflow:Yt},rightBottom:{points:["br","bl"],overflow:Yt},leftTop:{points:["tl","tr"],overflow:Yt},leftBottom:{points:["bl","br"],overflow:Yt}},Ri=null;function ui(lt,tt,_t){if(tt)return tt;if(_t)return _t[lt]||_t.other}var wr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function bi(lt){var tt=lt.prefixCls,_t=lt.visible,Lt=lt.children,ft=lt.popup,Kt=lt.popupStyle,Bt=lt.popupClassName,lr=lt.popupOffset,Tr=lt.disabled,pr=lt.mode,si=lt.onVisibleChange,ci=M.useContext(Y),gi=ci.getPopupContainer,Er=ci.rtl,Mr=ci.subMenuOpenDelay,Si=ci.subMenuCloseDelay,Ai=ci.builtinPlacements,Xr=ci.triggerSubMenuAction,ri=ci.forceSubMenuRender,ii=ci.rootClassName,ai=ci.motion,Kr=ci.defaultMotions,fi=M.useState(!1),Pi=(0,te.Z)(fi,2),Di=Pi[0],Ar=Pi[1],je=Er?(0,rt.Z)((0,rt.Z)({},ei),Ai):(0,rt.Z)((0,rt.Z)({},vr),Ai),cr=wr[pr],yr=ui(pr,ai,Kr),jr=M.useRef(yr);pr!=="inline"&&(jr.current=yr);var nn=(0,rt.Z)((0,rt.Z)({},jr.current),{},{leavedClassName:"".concat(tt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),vi=M.useRef();return M.useEffect(function(){return vi.current=(0,at.Z)(function(){Ar(_t)}),function(){at.Z.cancel(vi.current)}},[_t]),M.createElement(Ae.Z,{prefixCls:tt,popupClassName:$()("".concat(tt,"-popup"),(0,Pe.Z)({},"".concat(tt,"-rtl"),Er),Bt,ii),stretch:pr==="horizontal"?"minWidth":null,getPopupContainer:gi,builtinPlacements:je,popupPlacement:cr,popupVisible:Di,popup:ft,popupStyle:Kt,popupAlign:lr&&{offset:lr},action:Tr?[]:[Xr],mouseEnterDelay:Mr,mouseLeaveDelay:Si,onPopupVisibleChange:si,forceRender:ri,popupMotion:nn,fresh:!0},Lt)}var me=J(77900);function Te(lt){var tt=lt.id,_t=lt.open,Lt=lt.keyPath,ft=lt.children,Kt="inline",Bt=M.useContext(Y),lr=Bt.prefixCls,Tr=Bt.forceSubMenuRender,pr=Bt.motion,si=Bt.defaultMotions,ci=Bt.mode,gi=M.useRef(!1);gi.current=ci===Kt;var Er=M.useState(!gi.current),Mr=(0,te.Z)(Er,2),Si=Mr[0],Ai=Mr[1],Xr=gi.current?_t:!1;M.useEffect(function(){gi.current&&Ai(!1)},[ci]);var ri=(0,rt.Z)({},ui(Kt,pr,si));Lt.length>1&&(ri.motionAppear=!1);var ii=ri.onVisibleChanged;return ri.onVisibleChanged=function(ai){return!gi.current&&!ai&&Ai(!0),ii==null?void 0:ii(ai)},Si?null:M.createElement(ee,{mode:Kt,locked:!gi.current},M.createElement(me.default,(0,pe.Z)({visible:Xr},ri,{forceRender:Tr,removeOnLeave:!1,leavedClassName:"".concat(lr,"-hidden")}),function(ai){var Kr=ai.className,fi=ai.style;return M.createElement(Ke,{id:tt,className:Kr,style:fi},ft)}))}var Mt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],ct=["active"],Et=function(tt){var _t,Lt=tt.style,ft=tt.className,Kt=tt.title,Bt=tt.eventKey,lr=tt.warnKey,Tr=tt.disabled,pr=tt.internalPopupClose,si=tt.children,ci=tt.itemIcon,gi=tt.expandIcon,Er=tt.popupClassName,Mr=tt.popupOffset,Si=tt.popupStyle,Ai=tt.onClick,Xr=tt.onMouseEnter,ri=tt.onMouseLeave,ii=tt.onTitleClick,ai=tt.onTitleMouseEnter,Kr=tt.onTitleMouseLeave,fi=(0,E.Z)(tt,Mt),Pi=ae(Bt),Di=M.useContext(Y),Ar=Di.prefixCls,je=Di.mode,cr=Di.openKeys,yr=Di.disabled,jr=Di.overflowDisabled,nn=Di.activeKey,vi=Di.selectedKeys,$i=Di.itemIcon,Hr=Di.expandIcon,pn=Di.onItemClick,_n=Di.onOpenChange,Vi=Di.onActive,ts=M.useContext(de),Yn=ts._internalRenderSubMenuItem,$n=M.useContext(ut),Gn=$n.isSubPathKey,Pr=We(),ki="".concat(Ar,"-submenu"),Ki=yr||Tr,Wi=M.useRef(),Vn=M.useRef(),vn=ci!=null?ci:$i,tn=gi!=null?gi:Hr,In=cr.includes(Bt),zi=!jr&&In,rs=Gn(vi,Bt),Vr=kt(Bt,Ki,ai,Kr),ss=Vr.active,Xn=(0,E.Z)(Vr,ct),xn=M.useState(!1),Ii=(0,te.Z)(xn,2),vs=Ii[0],_s=Ii[1],ds=function(An){Ki||_s(An)},pi=function(An){ds(!0),Xr==null||Xr({key:Bt,domEvent:An})},xs=function(An){ds(!1),ri==null||ri({key:Bt,domEvent:An})},ws=M.useMemo(function(){return ss||(je!=="inline"?vs||Gn([nn],Bt):!1)},[je,ss,nn,vs,Bt,Gn]),nr=zt(Pr.length),mn=function(An){Ki||(ii==null||ii({key:Bt,domEvent:An}),je==="inline"&&_n(Bt,!In))},Ss=Ht(function(Pn){Ai==null||Ai(B(Pn)),pn(Pn)}),fs=function(An){je!=="inline"&&_n(Bt,An)},un=function(){Vi(Bt)},cn=Pi&&"".concat(Pi,"-popup"),Fi=M.createElement("div",(0,pe.Z)({role:"menuitem",style:nr,className:"".concat(ki,"-title"),tabIndex:Ki?null:-1,ref:Wi,title:typeof Kt=="string"?Kt:null,"data-menu-id":jr&&Pi?null:Pi,"aria-expanded":zi,"aria-haspopup":!0,"aria-controls":cn,"aria-disabled":Ki,onClick:mn,onFocus:un},Xn),Kt,M.createElement(rr,{icon:je!=="horizontal"?tn:void 0,props:(0,rt.Z)((0,rt.Z)({},tt),{},{isOpen:zi,isSubMenu:!0})},M.createElement("i",{className:"".concat(ki,"-arrow")}))),rn=M.useRef(je);if(je!=="inline"&&Pr.length>1?rn.current="vertical":rn.current=je,!jr){var zn=rn.current;Fi=M.createElement(bi,{mode:zn,prefixCls:ki,visible:!pr&&zi&&je!=="inline",popupClassName:Er,popupOffset:Mr,popupStyle:Si,popup:M.createElement(ee,{mode:zn==="horizontal"?"vertical":zn},M.createElement(Ke,{id:cn,ref:Vn},si)),disabled:Ki,onVisibleChange:fs},Fi)}var Wn=M.createElement(d.Z.Item,(0,pe.Z)({role:"none"},fi,{component:"li",style:Lt,className:$()(ki,"".concat(ki,"-").concat(je),ft,(_t={},(0,Pe.Z)(_t,"".concat(ki,"-open"),zi),(0,Pe.Z)(_t,"".concat(ki,"-active"),ws),(0,Pe.Z)(_t,"".concat(ki,"-selected"),rs),(0,Pe.Z)(_t,"".concat(ki,"-disabled"),Ki),_t)),onMouseEnter:pi,onMouseLeave:xs}),Fi,!jr&&M.createElement(Te,{id:cn,open:zi,keyPath:Pr},si));return Yn&&(Wn=Yn(Wn,tt,{selected:rs,active:ws,open:zi,disabled:Ki})),M.createElement(ee,{onItemClick:Ss,mode:je==="horizontal"?"vertical":je,itemIcon:vn,expandIcon:tn},Wn)};function Ft(lt){var tt=lt.eventKey,_t=lt.children,Lt=We(tt),ft=qt(_t,Lt),Kt=ve();M.useEffect(function(){if(Kt)return Kt.registerPath(tt,Lt),function(){Kt.unregisterPath(tt,Lt)}},[Lt]);var Bt;return Kt?Bt=ft:Bt=M.createElement(Et,lt,ft),M.createElement(Ye.Provider,{value:Lt},Bt)}var or=J(62853),Jt=["className","title","eventKey","children"],Rr=["children"],Sr=function(tt){var _t=tt.className,Lt=tt.title,ft=tt.eventKey,Kt=tt.children,Bt=(0,E.Z)(tt,Jt),lr=M.useContext(Y),Tr=lr.prefixCls,pr="".concat(Tr,"-item-group");return M.createElement("li",(0,pe.Z)({role:"presentation"},Bt,{onClick:function(ci){return ci.stopPropagation()},className:$()(pr,_t)}),M.createElement("div",{role:"presentation",className:"".concat(pr,"-title"),title:typeof Lt=="string"?Lt:void 0},Lt),M.createElement("ul",{role:"group",className:"".concat(pr,"-list")},Kt))};function oi(lt){var tt=lt.children,_t=(0,E.Z)(lt,Rr),Lt=We(_t.eventKey),ft=qt(tt,Lt),Kt=ve();return Kt?ft:M.createElement(Sr,(0,it.Z)(_t,["warnKey"]),ft)}function Dr(lt){var tt=lt.className,_t=lt.style,Lt=M.useContext(Y),ft=Lt.prefixCls,Kt=ve();return Kt?null:M.createElement("li",{role:"separator",className:$()("".concat(ft,"-item-divider"),tt),style:_t})}var Br=["label","children","key","type"];function ni(lt){return(lt||[]).map(function(tt,_t){if(tt&&(0,or.Z)(tt)==="object"){var Lt=tt,ft=Lt.label,Kt=Lt.children,Bt=Lt.key,lr=Lt.type,Tr=(0,E.Z)(Lt,Br),pr=Bt!=null?Bt:"tmp-".concat(_t);return Kt||lr==="group"?lr==="group"?M.createElement(oi,(0,pe.Z)({key:pr},Tr,{title:ft}),ni(Kt)):M.createElement(Ft,(0,pe.Z)({key:pr},Tr,{title:ft}),ni(Kt)):lr==="divider"?M.createElement(Dr,(0,pe.Z)({key:pr},Tr)):M.createElement(Je,(0,pe.Z)({key:pr},Tr),ft)}return null}).filter(function(tt){return tt})}function _i(lt,tt,_t){var Lt=lt;return tt&&(Lt=ni(tt)),qt(Lt,_t)}var Ni=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],mi=[],Ur=M.forwardRef(function(lt,tt){var _t,Lt,ft=lt,Kt=ft.prefixCls,Bt=Kt===void 0?"rc-menu":Kt,lr=ft.rootClassName,Tr=ft.style,pr=ft.className,si=ft.tabIndex,ci=si===void 0?0:si,gi=ft.items,Er=ft.children,Mr=ft.direction,Si=ft.id,Ai=ft.mode,Xr=Ai===void 0?"vertical":Ai,ri=ft.inlineCollapsed,ii=ft.disabled,ai=ft.disabledOverflow,Kr=ft.subMenuOpenDelay,fi=Kr===void 0?.1:Kr,Pi=ft.subMenuCloseDelay,Di=Pi===void 0?.1:Pi,Ar=ft.forceSubMenuRender,je=ft.defaultOpenKeys,cr=ft.openKeys,yr=ft.activeKey,jr=ft.defaultActiveFirst,nn=ft.selectable,vi=nn===void 0?!0:nn,$i=ft.multiple,Hr=$i===void 0?!1:$i,pn=ft.defaultSelectedKeys,_n=ft.selectedKeys,Vi=ft.onSelect,ts=ft.onDeselect,Yn=ft.inlineIndent,$n=Yn===void 0?24:Yn,Gn=ft.motion,Pr=ft.defaultMotions,ki=ft.triggerSubMenuAction,Ki=ki===void 0?"hover":ki,Wi=ft.builtinPlacements,Vn=ft.itemIcon,vn=ft.expandIcon,tn=ft.overflowedIndicator,In=tn===void 0?"...":tn,zi=ft.overflowedIndicatorPopupClassName,rs=ft.getPopupContainer,Vr=ft.onClick,ss=ft.onOpenChange,Xn=ft.onKeyDown,xn=ft.openAnimation,Ii=ft.openTransitionName,vs=ft._internalRenderMenuItem,_s=ft._internalRenderSubMenuItem,ds=(0,E.Z)(ft,Ni),pi=M.useMemo(function(){return _i(Er,gi,mi)},[Er,gi]),xs=M.useState(!1),ws=(0,te.Z)(xs,2),nr=ws[0],mn=ws[1],Ss=M.useRef(),fs=Ue(Si),un=Mr==="rtl",cn=(0,be.Z)(je,{value:cr,postState:function(Qi){return Qi||mi}}),Fi=(0,te.Z)(cn,2),rn=Fi[0],zn=Fi[1],Wn=function(Qi){var ji=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function ps(){zn(Qi),ss==null||ss(Qi)}ji?(0,O.flushSync)(ps):ps()},Pn=M.useState(rn),An=(0,te.Z)(Pn,2),Oi=An[0],xi=An[1],Mi=M.useRef(!1),sn=M.useMemo(function(){return(Xr==="inline"||Xr==="vertical")&&ri?["vertical",ri]:[Xr,!1]},[Xr,ri]),kn=(0,te.Z)(sn,2),Jn=kn[0],Lr=kn[1],Jr=Jn==="inline",yn=M.useState(Jn),Ln=(0,te.Z)(yn,2),Ji=Ln[0],Is=Ln[1],as=M.useState(Lr),Hs=(0,te.Z)(as,2),Un=Hs[0],Ys=Hs[1];M.useEffect(function(){Is(Jn),Ys(Lr),Mi.current&&(Jr?zn(Oi):Wn(mi))},[Jn,Lr]);var ya=M.useState(0),ba=(0,te.Z)(ya,2),eo=ba[0],Es=ba[1],is=eo>=pi.length-1||Ji!=="horizontal"||ai;M.useEffect(function(){Jr&&xi(rn)},[rn]),M.useEffect(function(){return Mi.current=!0,function(){Mi.current=!1}},[]);var As=wt(),On=As.registerPath,Xs=As.unregisterPath,Fa=As.refreshOverflowKeys,sa=As.isSubPathKey,Il=As.getKeyPath,Na=As.getKeys,Ps=As.getSubPathKeys,bo=M.useMemo(function(){return{registerPath:On,unregisterPath:Xs}},[On,Xs]),Os=M.useMemo(function(){return{isSubPathKey:sa}},[sa]);M.useEffect(function(){Fa(is?mi:pi.slice(eo+1).map(function(Hi){return Hi.key}))},[eo,is]);var Qo=(0,be.Z)(yr||jr&&((_t=pi[0])===null||_t===void 0?void 0:_t.key),{value:yr}),to=(0,te.Z)(Qo,2),Ca=to[0],$a=to[1],ro=Ht(function(Hi){$a(Hi)}),el=Ht(function(){$a(void 0)});(0,M.useImperativeHandle)(tt,function(){return{list:Ss.current,focus:function(Qi){var ji,ps=Na(),Bn=Qe(ps,fs),Gt=Bn.elements,_a=Bn.key2element,wo=Bn.element2key,So=Ze(Ss.current,Gt),Eo=Ca!=null?Ca:So[0]?wo.get(So[0]):(ji=pi.find(function(rl){return!rl.props.disabled}))===null||ji===void 0?void 0:ji.key,Gs=_a.get(Eo);if(Eo&&Gs){var Qs;Gs==null||(Qs=Gs.focus)===null||Qs===void 0||Qs.call(Gs,Qi)}}}});var za=(0,be.Z)(pn||[],{value:_n,postState:function(Qi){return Array.isArray(Qi)?Qi:Qi==null?mi:[Qi]}}),_o=(0,te.Z)(za,2),ks=_o[0],Ua=_o[1],tl=function(Qi){if(vi){var ji=Qi.key,ps=ks.includes(ji),Bn;Hr?ps?Bn=ks.filter(function(_a){return _a!==ji}):Bn=[].concat((0,Le.Z)(ks),[ji]):Bn=[ji],Ua(Bn);var Gt=(0,rt.Z)((0,rt.Z)({},Qi),{},{selectedKeys:Bn});ps?ts==null||ts(Gt):Vi==null||Vi(Gt)}!Hr&&rn.length&&Ji!=="inline"&&Wn(mi)},io=Ht(function(Hi){Vr==null||Vr(B(Hi)),tl(Hi)}),Ka=Ht(function(Hi,Qi){var ji=rn.filter(function(Bn){return Bn!==Hi});if(Qi)ji.push(Hi);else if(Ji!=="inline"){var ps=Ps(Hi);ji=ji.filter(function(Bn){return!ps.has(Bn)})}(0,j.Z)(rn,ji,!0)||Wn(ji,!0)}),no=function(Qi,ji){var ps=ji!=null?ji:!rn.includes(Qi);Ka(Qi,ps)},Js=Ct(Ji,Ca,un,fs,Ss,Na,Il,$a,no,Xn);M.useEffect(function(){mn(!0)},[]);var aa=M.useMemo(function(){return{_internalRenderMenuItem:vs,_internalRenderSubMenuItem:_s}},[vs,_s]),oa=Ji!=="horizontal"||ai?pi:pi.map(function(Hi,Qi){return M.createElement(ee,{key:Hi.key,overflowDisabled:Qi>eo},Hi)}),xo=M.createElement(d.Z,(0,pe.Z)({id:Si,ref:Ss,prefixCls:"".concat(Bt,"-overflow"),component:"ul",itemComponent:Je,className:$()(Bt,"".concat(Bt,"-root"),"".concat(Bt,"-").concat(Ji),pr,(Lt={},(0,Pe.Z)(Lt,"".concat(Bt,"-inline-collapsed"),Un),(0,Pe.Z)(Lt,"".concat(Bt,"-rtl"),un),Lt),lr),dir:Mr,style:Tr,role:"menu",tabIndex:ci,data:oa,renderRawItem:function(Qi){return Qi},renderRawRest:function(Qi){var ji=Qi.length,ps=ji?pi.slice(-ji):null;return M.createElement(Ft,{eventKey:vt,title:In,disabled:is,internalPopupClose:ji===0,popupClassName:zi},ps)},maxCount:Ji!=="horizontal"||ai?d.Z.INVALIDATE:d.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Qi){Es(Qi)},onKeyDown:Js},ds));return M.createElement(de.Provider,{value:aa},M.createElement(K.Provider,{value:fs},M.createElement(ee,{prefixCls:Bt,rootClassName:lr,mode:Ji,openKeys:rn,rtl:un,disabled:ii,motion:nr?Gn:null,defaultMotions:nr?Pr:null,activeKey:Ca,onActive:ro,onInactive:el,selectedKeys:ks,inlineIndent:$n,subMenuOpenDelay:fi,subMenuCloseDelay:Di,forceSubMenuRender:Ar,builtinPlacements:Wi,triggerSubMenuAction:Ki,getPopupContainer:rs,itemIcon:Vn,expandIcon:vn,onItemClick:io,onOpenChange:Ka},M.createElement(ut.Provider,{value:Os},xo),M.createElement("div",{style:{display:"none"},"aria-hidden":!0},M.createElement(De.Provider,{value:bo},pi)))))}),Gi=Ur,Yr=Gi;Yr.Item=Je,Yr.SubMenu=Ft,Yr.ItemGroup=oi,Yr.Divider=Dr;var Or=Yr},11780:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return we}});var pe=J(72308),Pe=J(77321),rt=J(52487),Le=J(74416),te=J(59301),E=J(92310),Me=J.n(E),$=J(29301),d=J(34280),be=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],j=void 0;function k(D,L){var ie=D.prefixCls,xe=D.invalidate,at=D.item,ot=D.renderItem,At=D.responsive,Xe=D.responsiveDisabled,ar=D.registerSize,jt=D.itemKey,Ot=D.className,kr=D.style,$r=D.children,ir=D.display,zr=D.order,li=D.component,Gr=li===void 0?"div":li,Ze=(0,Le.Z)(D,be),nt=At&&!ir;function Qe(et){ar(jt,et)}te.useEffect(function(){return function(){Qe(null)}},[]);var Ct=ot&&at!==j?ot(at,{index:zr}):$r,Dt;xe||(Dt={opacity:nt?0:1,height:nt?0:j,overflowY:nt?"hidden":j,order:At?zr:j,pointerEvents:nt?"none":j,position:nt?"absolute":j});var ye={};nt&&(ye["aria-hidden"]=!0);var Oe=te.createElement(Gr,(0,pe.Z)({className:Me()(!xe&&ie,Ot),style:(0,Pe.Z)((0,Pe.Z)({},Dt),kr)},ye,Ze,{ref:L}),Ct);return At&&(Oe=te.createElement($.Z,{onResize:function(vt){var wt=vt.offsetWidth;Qe(wt)},disabled:Xe},Oe)),Oe}var M=te.forwardRef(k);M.displayName="Item";var O=M,K=J(6089),se=J(4676),ae=J(16089);function Z(D){if(typeof MessageChannel=="undefined")(0,ae.Z)(D);else{var L=new MessageChannel;L.port1.onmessage=function(){return D()},L.port2.postMessage(void 0)}}function q(){var D=te.useRef(null),L=function(xe){D.current||(D.current=[],Z(function(){(0,se.unstable_batchedUpdates)(function(){D.current.forEach(function(at){at()}),D.current=null})})),D.current.push(xe)};return L}function Y(D,L){var ie=te.useState(L),xe=(0,rt.Z)(ie,2),at=xe[0],ot=xe[1],At=(0,K.Z)(function(Xe){D(function(){ot(Xe)})});return[at,At]}var ue=te.createContext(null),ee=["component"],oe=["className"],De=["className"],ve=function(L,ie){var xe=te.useContext(ue);if(!xe){var at=L.component,ot=at===void 0?"div":at,At=(0,Le.Z)(L,ee);return te.createElement(ot,(0,pe.Z)({},At,{ref:ie}))}var Xe=xe.className,ar=(0,Le.Z)(xe,oe),jt=L.className,Ot=(0,Le.Z)(L,De);return te.createElement(ue.Provider,{value:null},te.createElement(O,(0,pe.Z)({ref:ie,className:Me()(Xe,jt)},ar,Ot)))},Ye=te.forwardRef(ve);Ye.displayName="RawItem";var We=Ye,ut=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],pt="responsive",de="invalidate";function re(D){return"+ ".concat(D.length," ...")}function ce(D,L){var ie=D.prefixCls,xe=ie===void 0?"rc-overflow":ie,at=D.data,ot=at===void 0?[]:at,At=D.renderItem,Xe=D.renderRawItem,ar=D.itemKey,jt=D.itemWidth,Ot=jt===void 0?10:jt,kr=D.ssr,$r=D.style,ir=D.className,zr=D.maxCount,li=D.renderRest,Gr=D.renderRawRest,Ze=D.suffix,nt=D.component,Qe=nt===void 0?"div":nt,Ct=D.itemComponent,Dt=D.onVisibleChange,ye=(0,Le.Z)(D,ut),Oe=kr==="full",et=q(),vt=Y(et,null),wt=(0,rt.Z)(vt,2),Ht=wt[0],fr=wt[1],Xt=Ht||0,Ue=Y(et,new Map),Ut=(0,rt.Z)(Ue,2),_r=Ut[0],Fe=Ut[1],Ge=Y(et,0),it=(0,rt.Z)(Ge,2),Pt=it[0],kt=it[1],zt=Y(et,0),rr=(0,rt.Z)(zt,2),T=rr[0],B=rr[1],dt=Y(et,0),G=(0,rt.Z)(dt,2),fe=G[0],xr=G[1],Ne=(0,te.useState)(null),He=(0,rt.Z)(Ne,2),Je=He[0],W=He[1],ge=(0,te.useState)(null),Se=(0,rt.Z)(ge,2),Ke=Se[0],V=Se[1],qt=te.useMemo(function(){return Ke===null&&Oe?Number.MAX_SAFE_INTEGER:Ke||0},[Ke,Ht]),Ae=(0,te.useState)(!1),Yt=(0,rt.Z)(Ae,2),vr=Yt[0],ei=Yt[1],Ri="".concat(xe,"-item"),ui=Math.max(Pt,T),wr=zr===pt,bi=ot.length&&wr,me=zr===de,Te=bi||typeof zr=="number"&&ot.length>zr,Mt=(0,te.useMemo)(function(){var Or=ot;return bi?Ht===null&&Oe?Or=ot:Or=ot.slice(0,Math.min(ot.length,Xt/Ot)):typeof zr=="number"&&(Or=ot.slice(0,zr)),Or},[ot,Ot,Ht,zr,bi]),ct=(0,te.useMemo)(function(){return bi?ot.slice(qt+1):ot.slice(Mt.length)},[ot,Mt,bi,qt]),Et=(0,te.useCallback)(function(Or,lt){var tt;return typeof ar=="function"?ar(Or):(tt=ar&&(Or==null?void 0:Or[ar]))!==null&&tt!==void 0?tt:lt},[ar]),Ft=(0,te.useCallback)(At||function(Or){return Or},[At]);function or(Or,lt,tt){Ke===Or&&(lt===void 0||lt===Je)||(V(Or),tt||(ei(Or<ot.length-1),Dt==null||Dt(Or)),lt!==void 0&&W(lt))}function Jt(Or,lt){fr(lt.clientWidth)}function Rr(Or,lt){Fe(function(tt){var _t=new Map(tt);return lt===null?_t.delete(Or):_t.set(Or,lt),_t})}function Sr(Or,lt){B(lt),kt(T)}function oi(Or,lt){xr(lt)}function Dr(Or){return _r.get(Et(Mt[Or],Or))}(0,d.Z)(function(){if(Xt&&typeof ui=="number"&&Mt){var Or=fe,lt=Mt.length,tt=lt-1;if(!lt){or(0,null);return}for(var _t=0;_t<lt;_t+=1){var Lt=Dr(_t);if(Oe&&(Lt=Lt||0),Lt===void 0){or(_t-1,void 0,!0);break}if(Or+=Lt,tt===0&&Or<=Xt||_t===tt-1&&Or+Dr(tt)<=Xt){or(tt,null);break}else if(Or+ui>Xt){or(_t-1,Or-Lt-fe+T);break}}Ze&&Dr(0)+fe>Xt&&W(null)}},[Xt,_r,T,fe,Et,Mt]);var Br=vr&&!!ct.length,ni={};Je!==null&&bi&&(ni={position:"absolute",left:Je,top:0});var _i={prefixCls:Ri,responsive:bi,component:Ct,invalidate:me},Ni=Xe?function(Or,lt){var tt=Et(Or,lt);return te.createElement(ue.Provider,{key:tt,value:(0,Pe.Z)((0,Pe.Z)({},_i),{},{order:lt,item:Or,itemKey:tt,registerSize:Rr,display:lt<=qt})},Xe(Or,lt))}:function(Or,lt){var tt=Et(Or,lt);return te.createElement(O,(0,pe.Z)({},_i,{order:lt,key:tt,item:Or,renderItem:Ft,itemKey:tt,registerSize:Rr,display:lt<=qt}))},mi={order:Br?qt:Number.MAX_SAFE_INTEGER,className:"".concat(Ri,"-rest"),registerSize:Sr,display:Br},Ur=li||re,Gi=Gr?te.createElement(ue.Provider,{value:(0,Pe.Z)((0,Pe.Z)({},_i),mi)},Gr(ct)):te.createElement(O,(0,pe.Z)({},_i,mi),typeof Ur=="function"?Ur(ct):Ur),Yr=te.createElement(Qe,(0,pe.Z)({className:Me()(!me&&xe,ir),style:$r,ref:L},ye),Mt.map(Ni),Te?Gi:null,Ze&&te.createElement(O,(0,pe.Z)({},_i,{responsive:wr,responsiveDisabled:!bi,order:qt,className:"".concat(Ri,"-suffix"),registerSize:oi,display:!0,style:ni}),Ze));return wr?te.createElement($.Z,{onResize:Jt,disabled:!bi},Yr):Yr}var he=te.forwardRef(ce);he.displayName="Overflow",he.Item=We,he.RESPONSIVE=pt,he.INVALIDATE=de;var Re=he,we=Re},29301:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return de}});var pe=J(72308),Pe=J(59301),rt=J(11592),Le=J(48736),te=J(77321),E=J(62853),Me=J(76846),$=J(8654),d=Pe.createContext(null);function be(re){var ce=re.children,he=re.onBatchResize,Re=Pe.useRef(0),we=Pe.useRef([]),D=Pe.useContext(d),L=Pe.useCallback(function(ie,xe,at){Re.current+=1;var ot=Re.current;we.current.push({size:ie,element:xe,data:at}),Promise.resolve().then(function(){ot===Re.current&&(he==null||he(we.current),we.current=[])}),D==null||D(ie,xe,at)},[he,D]);return Pe.createElement(d.Provider,{value:L},ce)}var j=J(76374),k=new Map;function M(re){re.forEach(function(ce){var he,Re=ce.target;(he=k.get(Re))===null||he===void 0||he.forEach(function(we){return we(Re)})})}var O=new j.Z(M),K=null,se=null;function ae(re,ce){k.has(re)||(k.set(re,new Set),O.observe(re)),k.get(re).add(ce)}function Z(re,ce){k.has(re)&&(k.get(re).delete(ce),k.get(re).size||(O.unobserve(re),k.delete(re)))}var q=J(96949),Y=J(55090),ue=J(77205),ee=J(38793),oe=function(re){(0,ue.Z)(he,re);var ce=(0,ee.Z)(he);function he(){return(0,q.Z)(this,he),ce.apply(this,arguments)}return(0,Y.Z)(he,[{key:"render",value:function(){return this.props.children}}]),he}(Pe.Component);function De(re,ce){var he=re.children,Re=re.disabled,we=Pe.useRef(null),D=Pe.useRef(null),L=Pe.useContext(d),ie=typeof he=="function",xe=ie?he(we):he,at=Pe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ot=!ie&&Pe.isValidElement(xe)&&(0,$.Yr)(xe),At=ot?(0,$.C4)(xe):null,Xe=(0,$.x1)(At,we),ar=function(){var $r;return(0,Me.ZP)(we.current)||(we.current&&(0,E.Z)(we.current)==="object"?(0,Me.ZP)(($r=we.current)===null||$r===void 0?void 0:$r.nativeElement):null)||(0,Me.ZP)(D.current)};Pe.useImperativeHandle(ce,function(){return ar()});var jt=Pe.useRef(re);jt.current=re;var Ot=Pe.useCallback(function(kr){var $r=jt.current,ir=$r.onResize,zr=$r.data,li=kr.getBoundingClientRect(),Gr=li.width,Ze=li.height,nt=kr.offsetWidth,Qe=kr.offsetHeight,Ct=Math.floor(Gr),Dt=Math.floor(Ze);if(at.current.width!==Ct||at.current.height!==Dt||at.current.offsetWidth!==nt||at.current.offsetHeight!==Qe){var ye={width:Ct,height:Dt,offsetWidth:nt,offsetHeight:Qe};at.current=ye;var Oe=nt===Math.round(Gr)?Gr:nt,et=Qe===Math.round(Ze)?Ze:Qe,vt=(0,te.Z)((0,te.Z)({},ye),{},{offsetWidth:Oe,offsetHeight:et});L==null||L(vt,kr,zr),ir&&Promise.resolve().then(function(){ir(vt,kr)})}},[]);return Pe.useEffect(function(){var kr=ar();return kr&&!Re&&ae(kr,Ot),function(){return Z(kr,Ot)}},[we.current,Re]),Pe.createElement(oe,{ref:D},ot?Pe.cloneElement(xe,{ref:Xe}):xe)}var ve=Pe.forwardRef(De),Ye=ve,We="rc-observer-key";function ut(re,ce){var he=re.children,Re=typeof he=="function"?[he]:(0,rt.Z)(he);return Re.map(function(we,D){var L=(we==null?void 0:we.key)||"".concat(We,"-").concat(D);return Pe.createElement(Ye,(0,pe.Z)({},re,{key:L,ref:D===0?ce:void 0}),we)})}var pt=Pe.forwardRef(ut);pt.Collection=be;var de=pt},55477:function(Fr,Rt,J){"use strict";J.d(Rt,{G:function(){return M},Z:function(){return ae}});var pe=J(72308),Pe=J(77321),rt=J(74416),Le=J(35593),te=J(59301),E={shiftX:64,adjustY:1},Me={adjustX:1,shiftY:!0},$=[0,0],d={left:{points:["cr","cl"],overflow:Me,offset:[-4,0],targetOffset:$},right:{points:["cl","cr"],overflow:Me,offset:[4,0],targetOffset:$},top:{points:["bc","tc"],overflow:E,offset:[0,-4],targetOffset:$},bottom:{points:["tc","bc"],overflow:E,offset:[0,4],targetOffset:$},topLeft:{points:["bl","tl"],overflow:E,offset:[0,-4],targetOffset:$},leftTop:{points:["tr","tl"],overflow:Me,offset:[-4,0],targetOffset:$},topRight:{points:["br","tr"],overflow:E,offset:[0,-4],targetOffset:$},rightTop:{points:["tl","tr"],overflow:Me,offset:[4,0],targetOffset:$},bottomRight:{points:["tr","br"],overflow:E,offset:[0,4],targetOffset:$},rightBottom:{points:["bl","br"],overflow:Me,offset:[4,0],targetOffset:$},bottomLeft:{points:["tl","bl"],overflow:E,offset:[0,4],targetOffset:$},leftBottom:{points:["br","bl"],overflow:Me,offset:[-4,0],targetOffset:$}},be=null,j=J(92310),k=J.n(j);function M(Z){var q=Z.children,Y=Z.prefixCls,ue=Z.id,ee=Z.overlayInnerStyle,oe=Z.className,De=Z.style;return te.createElement("div",{className:k()("".concat(Y,"-content"),oe),style:De},te.createElement("div",{className:"".concat(Y,"-inner"),id:ue,role:"tooltip",style:ee},typeof q=="function"?q():q))}var O=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],K=function(q,Y){var ue=q.overlayClassName,ee=q.trigger,oe=ee===void 0?["hover"]:ee,De=q.mouseEnterDelay,ve=De===void 0?0:De,Ye=q.mouseLeaveDelay,We=Ye===void 0?.1:Ye,ut=q.overlayStyle,pt=q.prefixCls,de=pt===void 0?"rc-tooltip":pt,re=q.children,ce=q.onVisibleChange,he=q.afterVisibleChange,Re=q.transitionName,we=q.animation,D=q.motion,L=q.placement,ie=L===void 0?"right":L,xe=q.align,at=xe===void 0?{}:xe,ot=q.destroyTooltipOnHide,At=ot===void 0?!1:ot,Xe=q.defaultVisible,ar=q.getTooltipContainer,jt=q.overlayInnerStyle,Ot=q.arrowContent,kr=q.overlay,$r=q.id,ir=q.showArrow,zr=ir===void 0?!0:ir,li=(0,rt.Z)(q,O),Gr=(0,te.useRef)(null);(0,te.useImperativeHandle)(Y,function(){return Gr.current});var Ze=(0,Pe.Z)({},li);"visible"in q&&(Ze.popupVisible=q.visible);var nt=function(){return te.createElement(M,{key:"content",prefixCls:de,id:$r,overlayInnerStyle:jt},kr)};return te.createElement(Le.Z,(0,pe.Z)({popupClassName:ue,prefixCls:de,popup:nt,action:oe,builtinPlacements:d,popupPlacement:ie,ref:Gr,popupAlign:at,getPopupContainer:ar,onPopupVisibleChange:ce,afterPopupVisibleChange:he,popupTransitionName:Re,popupAnimation:we,popupMotion:D,defaultPopupVisible:Xe,autoDestroy:At,mouseLeaveDelay:We,popupStyle:ut,mouseEnterDelay:ve,arrow:zr},Ze),re)},se=(0,te.forwardRef)(K),ae=se},49658:function(Fr,Rt){"use strict";Rt.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var J=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(J)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(J==null?void 0:J.substr(0,4))}},83145:function(Fr,Rt,J){"use strict";Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.CopyToClipboard=void 0;var pe=rt(J(59301)),Pe=rt(J(25769));function rt(q){return q&&q.__esModule?q:{default:q}}function Le(q){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Le=function(ue){return typeof ue}:Le=function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},Le(q)}function te(q,Y){var ue=Object.keys(q);if(Object.getOwnPropertySymbols){var ee=Object.getOwnPropertySymbols(q);Y&&(ee=ee.filter(function(oe){return Object.getOwnPropertyDescriptor(q,oe).enumerable})),ue.push.apply(ue,ee)}return ue}function E(q){for(var Y=1;Y<arguments.length;Y++){var ue=arguments[Y]!=null?arguments[Y]:{};Y%2?te(ue,!0).forEach(function(ee){ae(q,ee,ue[ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors(ue)):te(ue).forEach(function(ee){Object.defineProperty(q,ee,Object.getOwnPropertyDescriptor(ue,ee))})}return q}function Me(q,Y){if(q==null)return{};var ue=$(q,Y),ee,oe;if(Object.getOwnPropertySymbols){var De=Object.getOwnPropertySymbols(q);for(oe=0;oe<De.length;oe++)ee=De[oe],!(Y.indexOf(ee)>=0)&&Object.prototype.propertyIsEnumerable.call(q,ee)&&(ue[ee]=q[ee])}return ue}function $(q,Y){if(q==null)return{};var ue={},ee=Object.keys(q),oe,De;for(De=0;De<ee.length;De++)oe=ee[De],!(Y.indexOf(oe)>=0)&&(ue[oe]=q[oe]);return ue}function d(q,Y){if(!(q instanceof Y))throw new TypeError("Cannot call a class as a function")}function be(q,Y){for(var ue=0;ue<Y.length;ue++){var ee=Y[ue];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(q,ee.key,ee)}}function j(q,Y,ue){return Y&&be(q.prototype,Y),ue&&be(q,ue),q}function k(q,Y){return Y&&(Le(Y)==="object"||typeof Y=="function")?Y:O(q)}function M(q){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(ue){return ue.__proto__||Object.getPrototypeOf(ue)},M(q)}function O(q){if(q===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q}function K(q,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(Y&&Y.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),Y&&se(q,Y)}function se(q,Y){return se=Object.setPrototypeOf||function(ee,oe){return ee.__proto__=oe,ee},se(q,Y)}function ae(q,Y,ue){return Y in q?Object.defineProperty(q,Y,{value:ue,enumerable:!0,configurable:!0,writable:!0}):q[Y]=ue,q}var Z=function(q){K(Y,q);function Y(){var ue,ee;d(this,Y);for(var oe=arguments.length,De=new Array(oe),ve=0;ve<oe;ve++)De[ve]=arguments[ve];return ee=k(this,(ue=M(Y)).call.apply(ue,[this].concat(De))),ae(O(ee),"onClick",function(Ye){var We=ee.props,ut=We.text,pt=We.onCopy,de=We.children,re=We.options,ce=pe.default.Children.only(de),he=(0,Pe.default)(ut,re);pt&&pt(ut,he),ce&&ce.props&&typeof ce.props.onClick=="function"&&ce.props.onClick(Ye)}),ee}return j(Y,[{key:"render",value:function(){var ee=this.props,oe=ee.text,De=ee.onCopy,ve=ee.options,Ye=ee.children,We=Me(ee,["text","onCopy","options","children"]),ut=pe.default.Children.only(Ye);return pe.default.cloneElement(ut,E({},We,{onClick:this.onClick}))}}]),Y}(pe.default.PureComponent);Rt.CopyToClipboard=Z,ae(Z,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Fr,Rt,J){"use strict";var pe=J(83145),Pe=pe.CopyToClipboard;Pe.CopyToClipboard=Pe,Fr.exports=Pe},76374:function(Fr,Rt,J){"use strict";var pe=function(){if(typeof Map!="undefined")return Map;function de(re,ce){var he=-1;return re.some(function(Re,we){return Re[0]===ce?(he=we,!0):!1}),he}return function(){function re(){this.__entries__=[]}return Object.defineProperty(re.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),re.prototype.get=function(ce){var he=de(this.__entries__,ce),Re=this.__entries__[he];return Re&&Re[1]},re.prototype.set=function(ce,he){var Re=de(this.__entries__,ce);~Re?this.__entries__[Re][1]=he:this.__entries__.push([ce,he])},re.prototype.delete=function(ce){var he=this.__entries__,Re=de(he,ce);~Re&&he.splice(Re,1)},re.prototype.has=function(ce){return!!~de(this.__entries__,ce)},re.prototype.clear=function(){this.__entries__.splice(0)},re.prototype.forEach=function(ce,he){he===void 0&&(he=null);for(var Re=0,we=this.__entries__;Re<we.length;Re++){var D=we[Re];ce.call(he,D[1],D[0])}},re}()}(),Pe=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,rt=function(){return typeof J.g!="undefined"&&J.g.Math===Math?J.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Le=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(rt):function(de){return setTimeout(function(){return de(Date.now())},1e3/60)}}(),te=2;function E(de,re){var ce=!1,he=!1,Re=0;function we(){ce&&(ce=!1,de()),he&&L()}function D(){Le(we)}function L(){var ie=Date.now();if(ce){if(ie-Re<te)return;he=!0}else ce=!0,he=!1,setTimeout(D,re);Re=ie}return L}var Me=20,$=["top","right","bottom","left","width","height","size","weight"],d=typeof MutationObserver!="undefined",be=function(){function de(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=E(this.refresh.bind(this),Me)}return de.prototype.addObserver=function(re){~this.observers_.indexOf(re)||this.observers_.push(re),this.connected_||this.connect_()},de.prototype.removeObserver=function(re){var ce=this.observers_,he=ce.indexOf(re);~he&&ce.splice(he,1),!ce.length&&this.connected_&&this.disconnect_()},de.prototype.refresh=function(){var re=this.updateObservers_();re&&this.refresh()},de.prototype.updateObservers_=function(){var re=this.observers_.filter(function(ce){return ce.gatherActive(),ce.hasActive()});return re.forEach(function(ce){return ce.broadcastActive()}),re.length>0},de.prototype.connect_=function(){!Pe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),d?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},de.prototype.disconnect_=function(){!Pe||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},de.prototype.onTransitionEnd_=function(re){var ce=re.propertyName,he=ce===void 0?"":ce,Re=$.some(function(we){return!!~he.indexOf(we)});Re&&this.refresh()},de.getInstance=function(){return this.instance_||(this.instance_=new de),this.instance_},de.instance_=null,de}(),j=function(de,re){for(var ce=0,he=Object.keys(re);ce<he.length;ce++){var Re=he[ce];Object.defineProperty(de,Re,{value:re[Re],enumerable:!1,writable:!1,configurable:!0})}return de},k=function(de){var re=de&&de.ownerDocument&&de.ownerDocument.defaultView;return re||rt},M=oe(0,0,0,0);function O(de){return parseFloat(de)||0}function K(de){for(var re=[],ce=1;ce<arguments.length;ce++)re[ce-1]=arguments[ce];return re.reduce(function(he,Re){var we=de["border-"+Re+"-width"];return he+O(we)},0)}function se(de){for(var re=["top","right","bottom","left"],ce={},he=0,Re=re;he<Re.length;he++){var we=Re[he],D=de["padding-"+we];ce[we]=O(D)}return ce}function ae(de){var re=de.getBBox();return oe(0,0,re.width,re.height)}function Z(de){var re=de.clientWidth,ce=de.clientHeight;if(!re&&!ce)return M;var he=k(de).getComputedStyle(de),Re=se(he),we=Re.left+Re.right,D=Re.top+Re.bottom,L=O(he.width),ie=O(he.height);if(he.boxSizing==="border-box"&&(Math.round(L+we)!==re&&(L-=K(he,"left","right")+we),Math.round(ie+D)!==ce&&(ie-=K(he,"top","bottom")+D)),!Y(de)){var xe=Math.round(L+we)-re,at=Math.round(ie+D)-ce;Math.abs(xe)!==1&&(L-=xe),Math.abs(at)!==1&&(ie-=at)}return oe(Re.left,Re.top,L,ie)}var q=function(){return typeof SVGGraphicsElement!="undefined"?function(de){return de instanceof k(de).SVGGraphicsElement}:function(de){return de instanceof k(de).SVGElement&&typeof de.getBBox=="function"}}();function Y(de){return de===k(de).document.documentElement}function ue(de){return Pe?q(de)?ae(de):Z(de):M}function ee(de){var re=de.x,ce=de.y,he=de.width,Re=de.height,we=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,D=Object.create(we.prototype);return j(D,{x:re,y:ce,width:he,height:Re,top:ce,right:re+he,bottom:Re+ce,left:re}),D}function oe(de,re,ce,he){return{x:de,y:re,width:ce,height:he}}var De=function(){function de(re){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=oe(0,0,0,0),this.target=re}return de.prototype.isActive=function(){var re=ue(this.target);return this.contentRect_=re,re.width!==this.broadcastWidth||re.height!==this.broadcastHeight},de.prototype.broadcastRect=function(){var re=this.contentRect_;return this.broadcastWidth=re.width,this.broadcastHeight=re.height,re},de}(),ve=function(){function de(re,ce){var he=ee(ce);j(this,{target:re,contentRect:he})}return de}(),Ye=function(){function de(re,ce,he){if(this.activeObservations_=[],this.observations_=new pe,typeof re!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=re,this.controller_=ce,this.callbackCtx_=he}return de.prototype.observe=function(re){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(re instanceof k(re).Element))throw new TypeError('parameter 1 is not of type "Element".');var ce=this.observations_;ce.has(re)||(ce.set(re,new De(re)),this.controller_.addObserver(this),this.controller_.refresh())}},de.prototype.unobserve=function(re){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(re instanceof k(re).Element))throw new TypeError('parameter 1 is not of type "Element".');var ce=this.observations_;ce.has(re)&&(ce.delete(re),ce.size||this.controller_.removeObserver(this))}},de.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},de.prototype.gatherActive=function(){var re=this;this.clearActive(),this.observations_.forEach(function(ce){ce.isActive()&&re.activeObservations_.push(ce)})},de.prototype.broadcastActive=function(){if(this.hasActive()){var re=this.callbackCtx_,ce=this.activeObservations_.map(function(he){return new ve(he.target,he.broadcastRect())});this.callback_.call(re,ce,re),this.clearActive()}},de.prototype.clearActive=function(){this.activeObservations_.splice(0)},de.prototype.hasActive=function(){return this.activeObservations_.length>0},de}(),We=typeof WeakMap!="undefined"?new WeakMap:new pe,ut=function(){function de(re){if(!(this instanceof de))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var ce=be.getInstance(),he=new Ye(re,ce,this);We.set(this,he)}return de}();["observe","unobserve","disconnect"].forEach(function(de){ut.prototype[de]=function(){var re;return(re=We.get(this))[de].apply(re,arguments)}});var pt=function(){return typeof rt.ResizeObserver!="undefined"?rt.ResizeObserver:ut}();Rt.Z=pt},98040:function(Fr){Fr.exports=function(){var Rt=document.getSelection();if(!Rt.rangeCount)return function(){};for(var J=document.activeElement,pe=[],Pe=0;Pe<Rt.rangeCount;Pe++)pe.push(Rt.getRangeAt(Pe));switch(J.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":J.blur();break;default:J=null;break}return Rt.removeAllRanges(),function(){Rt.type==="Caret"&&Rt.removeAllRanges(),Rt.rangeCount||pe.forEach(function(rt){Rt.addRange(rt)}),J&&J.focus()}}},1012:function(Fr,Rt,J){"use strict";J.d(Rt,{Z:function(){return k}});var pe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Pe=new Uint8Array(16);function rt(){if(!pe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pe(Pe)}var Le=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function te(M){return typeof M=="string"&&Le.test(M)}for(var E=te,Me=[],$=0;$<256;++$)Me.push(($+256).toString(16).substr(1));function d(M){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,K=(Me[M[O+0]]+Me[M[O+1]]+Me[M[O+2]]+Me[M[O+3]]+"-"+Me[M[O+4]]+Me[M[O+5]]+"-"+Me[M[O+6]]+Me[M[O+7]]+"-"+Me[M[O+8]]+Me[M[O+9]]+"-"+Me[M[O+10]]+Me[M[O+11]]+Me[M[O+12]]+Me[M[O+13]]+Me[M[O+14]]+Me[M[O+15]]).toLowerCase();if(!E(K))throw TypeError("Stringified UUID is invalid");return K}var be=d;function j(M,O,K){M=M||{};var se=M.random||(M.rng||rt)();if(se[6]=se[6]&15|64,se[8]=se[8]&63|128,O){K=K||0;for(var ae=0;ae<16;++ae)O[K+ae]=se[ae];return O}return be(se)}var k=j},65157:function(Fr,Rt,J){"use strict";J.d(Rt,{ZP:function(){return zo}});const pe=Number.isFinite||function(h){return typeof h=="number"&&isFinite(h)},Pe=Number.isSafeInteger||function(h){return typeof h=="number"&&Math.abs(h)<=rt},rt=Number.MAX_SAFE_INTEGER||9007199254740991;let Le=function(h){return h.NETWORK_ERROR="networkError",h.MEDIA_ERROR="mediaError",h.KEY_SYSTEM_ERROR="keySystemError",h.MUX_ERROR="muxError",h.OTHER_ERROR="otherError",h}({}),te=function(h){return h.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",h.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",h.KEY_SYSTEM_NO_SESSION="keySystemNoSession",h.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",h.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",h.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",h.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",h.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",h.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",h.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",h.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",h.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",h.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",h.MANIFEST_LOAD_ERROR="manifestLoadError",h.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",h.MANIFEST_PARSING_ERROR="manifestParsingError",h.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",h.LEVEL_EMPTY_ERROR="levelEmptyError",h.LEVEL_LOAD_ERROR="levelLoadError",h.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",h.LEVEL_PARSING_ERROR="levelParsingError",h.LEVEL_SWITCH_ERROR="levelSwitchError",h.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",h.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",h.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",h.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",h.FRAG_LOAD_ERROR="fragLoadError",h.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",h.FRAG_DECRYPT_ERROR="fragDecryptError",h.FRAG_PARSING_ERROR="fragParsingError",h.FRAG_GAP="fragGap",h.REMUX_ALLOC_ERROR="remuxAllocError",h.KEY_LOAD_ERROR="keyLoadError",h.KEY_LOAD_TIMEOUT="keyLoadTimeOut",h.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",h.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",h.BUFFER_APPEND_ERROR="bufferAppendError",h.BUFFER_APPENDING_ERROR="bufferAppendingError",h.BUFFER_STALLED_ERROR="bufferStalledError",h.BUFFER_FULL_ERROR="bufferFullError",h.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",h.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",h.ASSET_LIST_LOAD_ERROR="assetListLoadError",h.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",h.ASSET_LIST_PARSING_ERROR="assetListParsingError",h.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",h.INTERNAL_EXCEPTION="internalException",h.INTERNAL_ABORTED="aborted",h.ATTACH_MEDIA_ERROR="attachMediaError",h.UNKNOWN="unknown",h}({}),E=function(h){return h.MEDIA_ATTACHING="hlsMediaAttaching",h.MEDIA_ATTACHED="hlsMediaAttached",h.MEDIA_DETACHING="hlsMediaDetaching",h.MEDIA_DETACHED="hlsMediaDetached",h.MEDIA_ENDED="hlsMediaEnded",h.STALL_RESOLVED="hlsStallResolved",h.BUFFER_RESET="hlsBufferReset",h.BUFFER_CODECS="hlsBufferCodecs",h.BUFFER_CREATED="hlsBufferCreated",h.BUFFER_APPENDING="hlsBufferAppending",h.BUFFER_APPENDED="hlsBufferAppended",h.BUFFER_EOS="hlsBufferEos",h.BUFFERED_TO_END="hlsBufferedToEnd",h.BUFFER_FLUSHING="hlsBufferFlushing",h.BUFFER_FLUSHED="hlsBufferFlushed",h.MANIFEST_LOADING="hlsManifestLoading",h.MANIFEST_LOADED="hlsManifestLoaded",h.MANIFEST_PARSED="hlsManifestParsed",h.LEVEL_SWITCHING="hlsLevelSwitching",h.LEVEL_SWITCHED="hlsLevelSwitched",h.LEVEL_LOADING="hlsLevelLoading",h.LEVEL_LOADED="hlsLevelLoaded",h.LEVEL_UPDATED="hlsLevelUpdated",h.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",h.LEVELS_UPDATED="hlsLevelsUpdated",h.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",h.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",h.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",h.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",h.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",h.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",h.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",h.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",h.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",h.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",h.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",h.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",h.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",h.CUES_PARSED="hlsCuesParsed",h.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",h.INIT_PTS_FOUND="hlsInitPtsFound",h.FRAG_LOADING="hlsFragLoading",h.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",h.FRAG_LOADED="hlsFragLoaded",h.FRAG_DECRYPTED="hlsFragDecrypted",h.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",h.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",h.FRAG_PARSING_METADATA="hlsFragParsingMetadata",h.FRAG_PARSED="hlsFragParsed",h.FRAG_BUFFERED="hlsFragBuffered",h.FRAG_CHANGED="hlsFragChanged",h.FPS_DROP="hlsFpsDrop",h.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",h.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",h.ERROR="hlsError",h.DESTROYING="hlsDestroying",h.KEY_LOADING="hlsKeyLoading",h.KEY_LOADED="hlsKeyLoaded",h.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",h.BACK_BUFFER_REACHED="hlsBackBufferReached",h.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",h.ASSET_LIST_LOADING="hlsAssetListLoading",h.ASSET_LIST_LOADED="hlsAssetListLoaded",h.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",h.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",h.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",h.INTERSTITIAL_STARTED="hlsInterstitialStarted",h.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",h.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",h.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",h.INTERSTITIAL_ENDED="hlsInterstitialEnded",h.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",h.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",h.EVENT_CUE_ENTER="hlsEventCueEnter",h}({});var Me={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},$={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class d{constructor(t,i=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=i,this.totalWeight_=s}sample(t,i){const s=Math.pow(this.alpha_,t);this.estimate_=i*(1-s)+s*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class be{constructor(t,i,s,o=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new d(t),this.fast_=new d(i),this.defaultTTFB_=o,this.ttfb_=new d(t)}update(t,i){const{slow_:s,fast_:o,ttfb_:l}=this;s.halfLife!==t&&(this.slow_=new d(t,s.getEstimate(),s.getTotalWeight())),o.halfLife!==i&&(this.fast_=new d(i,o.getEstimate(),o.getTotalWeight())),l.halfLife!==t&&(this.ttfb_=new d(t,l.getEstimate(),l.getTotalWeight()))}sample(t,i){t=Math.max(t,this.minDelayMs_);const s=8*i,o=t/1e3,l=s/o;this.fast_.sample(o,l),this.slow_.sample(o,l)}sampleTTFB(t){const i=t/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(i,2)/2);this.ttfb_.sample(s,Math.max(t,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function j(h,t,i){return(t=se(t))in h?Object.defineProperty(h,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):h[t]=i,h}function k(){return k=Object.assign?Object.assign.bind():function(h){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(h[s]=i[s])}return h},k.apply(null,arguments)}function M(h,t){var i=Object.keys(h);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(h);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(h,o).enumerable})),i.push.apply(i,s)}return i}function O(h){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?M(Object(i),!0).forEach(function(s){j(h,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(i)):M(Object(i)).forEach(function(s){Object.defineProperty(h,s,Object.getOwnPropertyDescriptor(i,s))})}return h}function K(h,t){if(typeof h!="object"||!h)return h;var i=h[Symbol.toPrimitive];if(i!==void 0){var s=i.call(h,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(h)}function se(h){var t=K(h,"string");return typeof t=="symbol"?t:t+""}class ae{constructor(t,i){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const s=`[${t}]:`;this.trace=Z,this.debug=i.debug.bind(null,s),this.log=i.log.bind(null,s),this.warn=i.warn.bind(null,s),this.info=i.info.bind(null,s),this.error=i.error.bind(null,s)}}const Z=function(){},q={trace:Z,debug:Z,log:Z,warn:Z,info:Z,error:Z};function Y(){return k({},q)}function ue(h,t){const i=self.console[h];return i?i.bind(self.console,`${t?"["+t+"] ":""}[${h}] >`):Z}function ee(h,t,i){return t[h]?t[h].bind(t):ue(h,i)}const oe=Y();function De(h,t,i){const s=Y();if(typeof console=="object"&&h===!0||typeof h=="object"){const o=["debug","log","info","warn","error"];o.forEach(l=>{s[l]=ee(l,h,i)});try{s.log(`Debug logs enabled for "${t}" in hls.js version 1.6.0`)}catch(l){return Y()}o.forEach(l=>{oe[l]=ee(l,h)})}else k(oe,s);return s}const ve=oe;function Ye(h=!0){return typeof self=="undefined"?void 0:(h||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function We(h){return typeof self!="undefined"&&h===self.ManagedMediaSource}function ut(h,t){const i=Object.keys(h),s=Object.keys(t),o=i.length,l=s.length;return!o||!l||o===l&&!i.some(c=>s.indexOf(c)===-1)}function pt(h,t=!1){if(typeof TextDecoder!="undefined"){const g=new TextDecoder("utf-8").decode(h);if(t){const x=g.indexOf("\0");return x!==-1?g.substring(0,x):g}return g.replace(/\0/g,"")}const i=h.length;let s,o,l,c="",p=0;for(;p<i;){if(s=h[p++],s===0&&t)return c;if(s===0||s===3)continue;switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(s);break;case 12:case 13:o=h[p++],c+=String.fromCharCode((s&31)<<6|o&63);break;case 14:o=h[p++],l=h[p++],c+=String.fromCharCode((s&15)<<12|(o&63)<<6|(l&63)<<0);break}}return c}const de={hexDump:function(h){let t="";for(let i=0;i<h.length;i++){let s=h[i].toString(16);s.length<2&&(s="0"+s),t+=s}return t}};function re(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var ce={exports:{}},he;function Re(){return he||(he=1,function(h,t){(function(i){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,o=/^(?=([^\/?#]*))\1([^]*)$/,l=/(?:\/|^)\.(?=\/)/g,c=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,p={buildAbsoluteURL:function(y,g,x){if(x=x||{},y=y.trim(),g=g.trim(),!g){if(!x.alwaysNormalize)return y;var S=p.parseURL(y);if(!S)throw new Error("Error trying to parse base URL.");return S.path=p.normalizePath(S.path),p.buildURLFromParts(S)}var R=p.parseURL(g);if(!R)throw new Error("Error trying to parse relative URL.");if(R.scheme)return x.alwaysNormalize?(R.path=p.normalizePath(R.path),p.buildURLFromParts(R)):g;var N=p.parseURL(y);if(!N)throw new Error("Error trying to parse base URL.");if(!N.netLoc&&N.path&&N.path[0]!=="/"){var F=o.exec(N.path);N.netLoc=F[1],N.path=F[2]}N.netLoc&&!N.path&&(N.path="/");var X={scheme:N.scheme,netLoc:R.netLoc,path:null,params:R.params,query:R.query,fragment:R.fragment};if(!R.netLoc&&(X.netLoc=N.netLoc,R.path[0]!=="/"))if(!R.path)X.path=N.path,R.params||(X.params=N.params,R.query||(X.query=N.query));else{var ne=N.path,Ce=ne.substring(0,ne.lastIndexOf("/")+1)+R.path;X.path=p.normalizePath(Ce)}return X.path===null&&(X.path=x.alwaysNormalize?p.normalizePath(R.path):R.path),p.buildURLFromParts(X)},parseURL:function(y){var g=s.exec(y);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(y){for(y=y.split("").reverse().join("").replace(l,"");y.length!==(y=y.replace(c,"")).length;);return y.split("").reverse().join("")},buildURLFromParts:function(y){return y.scheme+y.netLoc+y.path+y.params+y.query+y.fragment}};h.exports=p})()}(ce)),ce.exports}var we=Re();class D{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var L={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ie{constructor(t){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof t=="string"&&(t={url:t}),this.base=t,Xe(this,"stats")}setByteRange(t,i){const s=t.split("@",2);let o;s.length===1?o=(i==null?void 0:i.byteRangeEndOffset)||0:o=parseInt(s[1]),this._byteRange=[o,parseInt(s[0])+o]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[L.AUDIO]:null,[L.VIDEO]:null,[L.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(t){this._streams=t}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new D),this._stats}set stats(t){this._stats=t}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=we.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[L.AUDIO]=null,t[L.VIDEO]=null,t[L.AUDIOVIDEO]=null}}function xe(h){return h.sn!=="initSegment"}class at extends ie{constructor(t,i){super(i),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=t}get byteLength(){if(this.hasStats){const t=this.stats.total;if(t)return t}if(this.byteRange){const t=this.byteRange[0],i=this.byteRange[1];if(pe(t)&&pe(i))return i-t}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(t){this._bitrate=t}get decryptdata(){const{levelkeys:t}=this;if(!t&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const i=this.levelkeys.identity;if(i)this._decryptdata=i.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const t=pe(this.duration)?this.duration:0;return this.programDateTime+t*1e3}get encrypted(){var t;if((t=this._decryptdata)!=null&&t.encrypted)return!0;if(this.levelkeys){const i=Object.keys(this.levelkeys),s=i.length;if(s>1||s===1&&this.levelkeys[i[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(t){if(!pe(t)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=t}get ref(){return xe(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(t){this.setStart(this.start+t)}setStart(t){this.start=t,this._ref&&(this._ref.start=t)}setDuration(t){this.duration=t,this._ref&&(this._ref.duration=t)}setKeyFormat(t){if(this.levelkeys){const i=this.levelkeys[t];i&&!this._decryptdata&&(this._decryptdata=i.getDecryptData(this.sn))}}abortRequests(){var t,i;(t=this.loader)==null||t.abort(),(i=this.keyLoader)==null||i.abort()}setElementaryStreamInfo(t,i,s,o,l,c=!1){const{elementaryStreams:p}=this,y=p[t];if(!y){p[t]={startPTS:i,endPTS:s,startDTS:o,endDTS:l,partial:c};return}y.startPTS=Math.min(y.startPTS,i),y.endPTS=Math.max(y.endPTS,s),y.startDTS=Math.min(y.startDTS,o),y.endDTS=Math.max(y.endDTS,l)}}class ot extends ie{constructor(t,i,s,o,l){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=i,this.index=o;const c=t.enumeratedString("BYTERANGE");c&&this.setByteRange(c,l),l&&(this.fragOffset=l.fragOffset+l.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}function At(h,t){const i=Object.getPrototypeOf(h);if(i){const s=Object.getOwnPropertyDescriptor(i,t);return s||At(i,t)}}function Xe(h,t){const i=At(h,t);i&&(i.enumerable=!0,Object.defineProperty(h,t,i))}const ar=Math.pow(2,32)-1,jt=[].push,Ot={video:1,audio:2,id3:3,text:4};function kr(h){return String.fromCharCode.apply(null,h)}function $r(h,t){const i=h[t]<<8|h[t+1];return i<0?65536+i:i}function ir(h,t){const i=li(h,t);return i<0?4294967296+i:i}function zr(h,t){let i=ir(h,t);return i*=Math.pow(2,32),i+=ir(h,t+4),i}function li(h,t){return h[t]<<24|h[t+1]<<16|h[t+2]<<8|h[t+3]}function Gr(h,t,i){h[t]=i>>24,h[t+1]=i>>16&255,h[t+2]=i>>8&255,h[t+3]=i&255}function Ze(h){const t=h.byteLength;for(let i=0;i<t;){const s=ir(h,i);if(s>8&&h[i+4]===109&&h[i+5]===111&&h[i+6]===111&&h[i+7]===102)return!0;i=s>1?i+s:t}return!1}function nt(h,t){const i=[];if(!t.length)return i;const s=h.byteLength;for(let o=0;o<s;){const l=ir(h,o),c=kr(h.subarray(o+4,o+8)),p=l>1?o+l:s;if(c===t[0])if(t.length===1)i.push(h.subarray(o+8,p));else{const y=nt(h.subarray(o+8,p),t.slice(1));y.length&&jt.apply(i,y)}o=p}return i}function Qe(h){const t=[],i=h[0];let s=8;const o=ir(h,s);s+=4;let l=0,c=0;i===0?(l=ir(h,s),c=ir(h,s+4),s+=8):(l=zr(h,s),c=zr(h,s+8),s+=16),s+=2;let p=h.length+c;const y=$r(h,s);s+=2;for(let g=0;g<y;g++){let x=s;const S=ir(h,x);x+=4;const R=S&2147483647;if((S&2147483648)>>>31===1)return ve.warn("SIDX has hierarchical references (not supported)"),null;const F=ir(h,x);x+=4,t.push({referenceSize:R,subsegmentDuration:F,info:{duration:F/o,start:p,end:p+R-1}}),p+=R,x+=4,s=x}return{earliestPresentationTime:l,timescale:o,version:i,referencesCount:y,references:t}}function Ct(h){const t=[],i=nt(h,["moov","trak"]);for(let o=0;o<i.length;o++){const l=i[o],c=nt(l,["tkhd"])[0];if(c){let p=c[0];const y=ir(c,p===0?12:20),g=nt(l,["mdia","mdhd"])[0];if(g){p=g[0];const x=ir(g,p===0?12:20),S=nt(l,["mdia","hdlr"])[0];if(S){const R=kr(S.subarray(8,12)),N={soun:L.AUDIO,vide:L.VIDEO}[R],F=nt(l,["mdia","minf","stbl","stsd"])[0],X=Dt(F);N?(t[y]={timescale:x,type:N,stsd:X},t[N]=O({timescale:x,id:y},X)):t[y]={timescale:x,type:R,stsd:X}}}}}return nt(h,["moov","mvex","trex"]).forEach(o=>{const l=ir(o,4),c=t[l];c&&(c.default={duration:ir(o,12),flags:ir(o,20)})}),t}function Dt(h){const t=h.subarray(8),i=t.subarray(86),s=kr(t.subarray(4,8));let o=s,l;const c=s==="enca"||s==="encv";if(c){const g=nt(t,[s])[0].subarray(s==="enca"?28:78);nt(g,["sinf"]).forEach(S=>{const R=nt(S,["schm"])[0];if(R){const N=kr(R.subarray(4,8));if(N==="cbcs"||N==="cenc"){const F=nt(S,["frma"])[0];F&&(o=kr(F))}}})}const p=o;switch(o){case"avc1":case"avc2":case"avc3":case"avc4":{const y=nt(i,["avcC"])[0];o+="."+et(y[1])+et(y[2])+et(y[3]),l=ye(p==="avc1"?"dva1":"dvav",i);break}case"mp4a":{const y=nt(t,[s])[0],g=nt(y.subarray(28),["esds"])[0];if(g&&g.length>7){let x=4;if(g[x++]!==3)break;x=Oe(g,x),x+=2;const S=g[x++];if(S&128&&(x+=2),S&64&&(x+=g[x++]),g[x++]!==4)break;x=Oe(g,x);const R=g[x++];if(R===64)o+="."+et(R);else break;if(x+=12,g[x++]!==5)break;x=Oe(g,x);const N=g[x++];let F=(N&248)>>3;F===31&&(F+=1+((N&7)<<3)+((g[x]&224)>>5)),o+="."+F}break}case"hvc1":case"hev1":{const y=nt(i,["hvcC"]);if(y){const g=y[0],x=g[1],S=["","A","B","C"][x>>6],R=x&31,N=ir(g,2),F=(x&32)>>5?"H":"L",X=g[12],ne=g.subarray(6,12);o+="."+S+R,o+="."+N.toString(16).toUpperCase(),o+="."+F+X;let Ce="";for(let qe=ne.length;qe--;){const $e=ne[qe];($e||Ce)&&(Ce="."+$e.toString(16).toUpperCase()+Ce)}o+=Ce}l=ye(p=="hev1"?"dvhe":"dvh1",i);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{o=ye(o,i)||o;break}case"vp09":{const y=nt(i,["vpcC"])[0],g=y[4],x=y[5],S=y[6]>>4&15;o+="."+vt(g)+"."+vt(x)+"."+vt(S);break}case"av01":{const y=nt(i,["av1C"])[0],g=y[1]>>>5,x=y[1]&31,S=y[2]>>>7?"H":"M",R=(y[2]&64)>>6,N=(y[2]&32)>>5,F=g===2&&R?N?12:10:R?10:8,X=(y[2]&16)>>4,ne=(y[2]&8)>>3,Ce=(y[2]&4)>>2,qe=y[2]&3;o+="."+g+"."+vt(x)+S+"."+vt(F)+"."+X+"."+ne+Ce+qe+"."+vt(1)+"."+vt(1)+"."+vt(1)+"."+0,l=ye("dav1",i);break}}return{codec:o,encrypted:c,supplemental:l}}function ye(h,t){const i=nt(t,["dvvC"]),s=i.length?i[0]:nt(t,["dvcC"])[0];if(s){const o=s[2]>>1&127,l=s[2]<<5&32|s[3]>>3&31;return h+"."+vt(o)+"."+vt(l)}}function Oe(h,t){const i=t+5;for(;h[t++]&128&&t<i;);return t}function et(h){return("0"+h.toString(16).toUpperCase()).slice(-2)}function vt(h){return(h<10?"0":"")+h}function wt(h,t){if(!h||!t)return h;const i=t.keyId;return i&&t.isCommonEncryption&&nt(h,["moov","trak"]).forEach(o=>{const c=nt(o,["mdia","minf","stbl","stsd"])[0].subarray(8);let p=nt(c,["enca"]);const y=p.length>0;y||(p=nt(c,["encv"])),p.forEach(g=>{const x=y?g.subarray(28):g.subarray(78);nt(x,["sinf"]).forEach(R=>{const N=Ht(R);if(N){const F=N.subarray(8,24);F.some(X=>X!==0)||(ve.log(`[eme] Patching keyId in 'enc${y?"a":"v"}>sinf>>tenc' box: ${de.hexDump(F)} -> ${de.hexDump(i)}`),N.set(i,8))}})})}),h}function Ht(h){const t=nt(h,["schm"])[0];if(t){const i=kr(t.subarray(4,8));if(i==="cbcs"||i==="cenc")return nt(h,["schi","tenc"])[0]}return null}function fr(h,t){return nt(t,["moof","traf"]).reduce((i,s)=>{const o=nt(s,["tfdt"])[0],l=o[0],c=nt(s,["tfhd"]).reduce((p,y)=>{const g=ir(y,4),x=h[g];if(x){let S=ir(o,4);if(l===1){if(S===ar)return ve.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),p;S*=ar+1,S+=ir(o,8)}const R=x.timescale||9e4,N=S/R;if(pe(N)&&(p===null||N<p))return N}return p},null);return c!==null&&pe(c)&&(i===null||c<i)?c:i},null)}function Xt(h,t){let i=0,s=0,o=0;const l=nt(h,["moof","traf"]);for(let c=0;c<l.length;c++){const p=l[c],y=nt(p,["tfhd"])[0],g=ir(y,4),x=t[g];if(!x)continue;const S=x.default,R=ir(y,0)|(S==null?void 0:S.flags);let N=S==null?void 0:S.duration;R&8&&(R&2?N=ir(y,12):N=ir(y,8));const F=x.timescale||9e4,X=nt(p,["trun"]);for(let ne=0;ne<X.length;ne++){if(i=Ue(X[ne]),!i&&N){const Ce=ir(X[ne],4);i=N*Ce}x.type===L.VIDEO?s+=i/F:x.type===L.AUDIO&&(o+=i/F)}}if(s===0&&o===0){let c=1/0,p=0,y=0;const g=nt(h,["sidx"]);for(let x=0;x<g.length;x++){const S=Qe(g[x]);if(S!=null&&S.references){c=Math.min(c,S.earliestPresentationTime/S.timescale);const R=S.references.reduce((N,F)=>N+F.info.duration||0,0);p=Math.max(p,R+S.earliestPresentationTime/S.timescale),y=p-c}}if(y&&pe(y))return y}return s||o}function Ue(h){const t=ir(h,0);let i=8;t&1&&(i+=4),t&4&&(i+=4);let s=0;const o=ir(h,4);for(let l=0;l<o;l++){if(t&256){const c=ir(h,i);s+=c,i+=4}t&512&&(i+=4),t&1024&&(i+=4),t&2048&&(i+=4)}return s}function Ut(h,t,i){nt(t,["moof","traf"]).forEach(s=>{nt(s,["tfhd"]).forEach(o=>{const l=ir(o,4),c=h[l];if(!c)return;const p=c.timescale||9e4;nt(s,["tfdt"]).forEach(y=>{const g=y[0],x=i*p;if(x){let S=ir(y,4);if(g===0)S-=x,S=Math.max(S,0),Gr(y,4,S);else{S*=Math.pow(2,32),S+=ir(y,8),S-=x,S=Math.max(S,0);const R=Math.floor(S/(ar+1)),N=Math.floor(S%(ar+1));Gr(y,4,R),Gr(y,8,N)}}})})})}function _r(h){const t={valid:null,remainder:null},i=nt(h,["moof"]);if(i.length<2)return t.remainder=h,t;const s=i[i.length-1];return t.valid=h.slice(0,s.byteOffset-8),t.remainder=h.slice(s.byteOffset-8),t}function Fe(h,t){const i=new Uint8Array(h.length+t.length);return i.set(h),i.set(t,h.length),i}function Ge(h,t){const i=[],s=t.samples,o=t.timescale,l=t.id;let c=!1;return nt(s,["moof"]).map(y=>{const g=y.byteOffset-8;nt(y,["traf"]).map(S=>{const R=nt(S,["tfdt"]).map(N=>{const F=N[0];let X=ir(N,4);return F===1&&(X*=Math.pow(2,32),X+=ir(N,8)),X/o})[0];return R!==void 0&&(h=R),nt(S,["tfhd"]).map(N=>{const F=ir(N,4),X=ir(N,0)&16777215,ne=(X&1)!==0,Ce=(X&2)!==0,qe=(X&8)!==0;let $e=0;const ht=(X&16)!==0;let mt=0;const Nt=(X&32)!==0;let gt=8;F===l&&(ne&&(gt+=8),Ce&&(gt+=4),qe&&($e=ir(N,gt),gt+=4),ht&&(mt=ir(N,gt),gt+=4),Nt&&(gt+=4),t.type==="video"&&(c=it(t.codec)),nt(S,["trun"]).map(Tt=>{const Vt=Tt[0],bt=ir(Tt,0)&16777215,dr=(bt&1)!==0;let Ir=0;const Ei=(bt&4)!==0,wi=(bt&256)!==0;let hi=0;const Zr=(bt&512)!==0;let di=0;const ti=(bt&1024)!==0,mr=(bt&2048)!==0;let br=0;const Ci=ir(Tt,4);let yi=8;dr&&(Ir=ir(Tt,yi),yi+=4),Ei&&(yi+=4);let Zi=Ir+g;for(let dn=0;dn<Ci;dn++){if(wi?(hi=ir(Tt,yi),yi+=4):hi=$e,Zr?(di=ir(Tt,yi),yi+=4):di=mt,ti&&(yi+=4),mr&&(Vt===0?br=ir(Tt,yi):br=li(Tt,yi),yi+=4),t.type===L.VIDEO){let fn=0;for(;fn<di;){const Sn=ir(s,Zi);if(Zi+=4,Pt(c,s[Zi])){const es=s.subarray(Zi,Zi+Sn);kt(es,c?2:1,h+br/o,i)}Zi+=Sn,fn+=Sn+4}}h+=hi/o}}))})})}),i}function it(h){if(!h)return!1;const t=h.substring(0,4);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function Pt(h,t){if(h){const i=t>>1&63;return i===39||i===40}else return(t&31)===6}function kt(h,t,i,s){const o=zt(h);let l=0;l+=t;let c=0,p=0,y=0;for(;l<o.length;){c=0;do{if(l>=o.length)break;y=o[l++],c+=y}while(y===255);p=0;do{if(l>=o.length)break;y=o[l++],p+=y}while(y===255);const g=o.length-l;let x=l;if(p<g)l+=p;else if(p>g){ve.error(`Malformed SEI payload. ${p} is too small, only ${g} bytes left to parse.`);break}if(c===4){if(o[x++]===181){const R=$r(o,x);if(x+=2,R===49){const N=ir(o,x);if(x+=4,N===1195456820){const F=o[x++];if(F===3){const X=o[x++],ne=31&X,Ce=64&X,qe=Ce?2+ne*3:0,$e=new Uint8Array(qe);if(Ce){$e[0]=X;for(let ht=1;ht<qe;ht++)$e[ht]=o[x++]}s.push({type:F,payloadType:c,pts:i,bytes:$e})}}}}}else if(c===5&&p>16){const S=[];for(let F=0;F<16;F++){const X=o[x++].toString(16);S.push(X.length==1?"0"+X:X),(F===3||F===5||F===7||F===9)&&S.push("-")}const R=p-16,N=new Uint8Array(R);for(let F=0;F<R;F++)N[F]=o[x++];s.push({payloadType:c,pts:i,uuid:S.join(""),userData:pt(N),userDataBytes:N})}}}function zt(h){const t=h.byteLength,i=[];let s=1;for(;s<t-2;)h[s]===0&&h[s+1]===0&&h[s+2]===3?(i.push(s+2),s+=2):s++;if(i.length===0)return h;const o=t-i.length,l=new Uint8Array(o);let c=0;for(s=0;s<o;c++,s++)c===i[0]&&(c++,i.shift()),l[s]=h[c];return l}function rr(h){const t=h[0];let i="",s="",o=0,l=0,c=0,p=0,y=0,g=0;if(t===0){for(;kr(h.subarray(g,g+1))!=="\0";)i+=kr(h.subarray(g,g+1)),g+=1;for(i+=kr(h.subarray(g,g+1)),g+=1;kr(h.subarray(g,g+1))!=="\0";)s+=kr(h.subarray(g,g+1)),g+=1;s+=kr(h.subarray(g,g+1)),g+=1,o=ir(h,12),l=ir(h,16),p=ir(h,20),y=ir(h,24),g=28}else if(t===1){g+=4,o=ir(h,g),g+=4;const S=ir(h,g);g+=4;const R=ir(h,g);for(g+=4,c=yo(2,32)*S+R,Pe(c)||(c=Number.MAX_SAFE_INTEGER,ve.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),p=ir(h,g),g+=4,y=ir(h,g),g+=4;kr(h.subarray(g,g+1))!=="\0";)i+=kr(h.subarray(g,g+1)),g+=1;for(i+=kr(h.subarray(g,g+1)),g+=1;kr(h.subarray(g,g+1))!=="\0";)s+=kr(h.subarray(g,g+1)),g+=1;s+=kr(h.subarray(g,g+1)),g+=1}const x=h.subarray(g,h.byteLength);return{schemeIdUri:i,value:s,timeScale:o,presentationTime:c,presentationTimeDelta:l,eventDuration:p,id:y,payload:x}}function T(h,...t){const i=t.length;let s=8,o=i;for(;o--;)s+=t[o].byteLength;const l=new Uint8Array(s);for(l[0]=s>>24&255,l[1]=s>>16&255,l[2]=s>>8&255,l[3]=s&255,l.set(h,4),o=0,s=8;o<i;o++)l.set(t[o],s),s+=t[o].byteLength;return l}function B(h,t,i){if(h.byteLength!==16)throw new RangeError("Invalid system id");let s,o;s=0,o=new Uint8Array;let l;s>0?(l=new Uint8Array(4),t.length>0&&new DataView(l.buffer).setUint32(0,t.length,!1)):l=new Uint8Array;const c=new Uint8Array(4);return i&&i.byteLength>0&&new DataView(c.buffer).setUint32(0,i.byteLength,!1),T([112,115,115,104],new Uint8Array([s,0,0,0]),h,l,o,c,i||new Uint8Array)}function dt(h){const t=[];if(h instanceof ArrayBuffer){const i=h.byteLength;let s=0;for(;s+32<i;){const o=new DataView(h,s),l=G(o);t.push(l),s+=l.size}}return t}function G(h){const t=h.getUint32(0),i=h.byteOffset,s=h.byteLength;if(s<t)return{offset:i,size:s};if(h.getUint32(4)!==1886614376)return{offset:i,size:t};const l=h.getUint32(8)>>>24;if(l!==0&&l!==1)return{offset:i,size:t};const c=h.buffer,p=de.hexDump(new Uint8Array(c,i+12,16)),y=h.getUint32(28);let g=null,x=null;if(l===0){if(t-32<y||y<22)return{offset:i,size:t};x=new Uint8Array(c,i+32,y)}else if(l===1){if(!y||s<i+32+y*16+16)return{offset:i,size:t};g=[];for(let S=0;S<y;S++)g.push(new Uint8Array(c,i+32+S*16,16))}return{version:l,systemId:p,kids:g,data:x,offset:i,size:t}}const fe=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),xr={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Ne(h,t){const i=xr[t];return!!i&&!!i[h.slice(0,4)]}function He(h,t,i=!0){return!h.split(",").some(s=>!Je(s,t,i))}function Je(h,t,i=!0){var s;const o=Ye(i);return(s=o==null?void 0:o.isTypeSupported(W(h,t)))!=null?s:!1}function W(h,t){return`${t}/mp4;codecs=${h}`}function ge(h){if(h){const t=h.substring(0,4);return xr.video[t]}return 2}function Se(h){const t=fe();return h.split(",").reduce((i,s)=>{const l=t&&it(s)?9:xr.video[s];return l?(l*2+i)/(i?3:2):(xr.audio[s]+i)/(i?2:1)},0)}const Ke={};function V(h,t=!0){if(Ke[h])return Ke[h];const i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[h];for(let o=0;o<i.length;o++){var s;if(Je(i[o],"audio",t))return Ke[h]=i[o],i[o];if(i[o]==="mp3"&&(s=Ye(t))!=null&&s.isTypeSupported("audio/mpeg"))return""}return h}const qt=/flac|opus|mp4a\.40\.34/i;function Ae(h,t=!0){return h.replace(qt,i=>V(i.toLowerCase(),t))}function Yt(h,t){const i=[];if(h){const s=h.split(",");for(let o=0;o<s.length;o++)Ne(s[o],"video")||i.push(s[o])}return t&&i.push(t),i.join(",")}function vr(h,t){if(h&&(h.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(h)!==-1))return h;if(t){const i=t.split(",");if(i.length>1){if(h){for(let s=i.length;s--;)if(i[s].substring(0,4)===h.substring(0,4))return i[s]}return i[0]}}return t||h}function ei(h){const t=h.split(",");for(let i=0;i<t.length;i++){const s=t[i].split(".");if(s.length>2){let o=s.shift()+".";o+=parseInt(s.shift()).toString(16),o+=("000"+parseInt(s.shift()).toString(16)).slice(-4),t[i]=o}}return t.join(",")}function Ri(h){if(h.startsWith("av01.")){const t=h.split("."),i=["0","111","01","01","01","0"];for(let s=t.length;s>4&&s<10;s++)t[s]=i[s-4];return t.join(".")}return h}function ui(h){const t=Ye(h)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs="ac-3"')}}function wr(h){return h.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const bi={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function me(h,t){return{supported:!1,configurations:t,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:h}}const Te={};function Mt(h,t,i,s,o,l){const c=h.audioCodec?h.audioGroups:null,p=l==null?void 0:l.audioCodec,y=l==null?void 0:l.channels,g=y?parseInt(y):p?1/0:2;let x=null;if(c!=null&&c.length)try{c.length===1&&c[0]?x=t.groups[c[0]].channels:x=c.reduce((S,R)=>{if(R){const N=t.groups[R];if(!N)throw new Error(`Audio track group ${R} not found`);Object.keys(N.channels).forEach(F=>{S[F]=(S[F]||0)+N.channels[F]})}return S},{2:0})}catch(S){return!0}return h.videoCodec!==void 0&&(h.width>1920&&h.height>1088||h.height>1920&&h.width>1088||h.frameRate>Math.max(s,30)||h.videoRange!=="SDR"&&h.videoRange!==i||h.bitrate>Math.max(o,8e6))||!!x&&pe(g)&&Object.keys(x).some(S=>parseInt(S)>g)}function ct(h,t,i){const s=h.videoCodec,o=h.audioCodec;if(!s&&!o||!i)return Promise.resolve(bi);const l=[];if(s){const c={width:h.width,height:h.height,bitrate:Math.ceil(Math.max(h.bitrate*.9,h.averageBitrate)),framerate:h.frameRate||30},p=h.videoRange;p!=="SDR"&&(c.transferFunction=p.toLowerCase());const y=s.split(","),g=navigator.userAgent;if(y.some(x=>it(x))&&fe())return Promise.resolve(me(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${g})`),l));l.push.apply(l,y.map(x=>({type:"media-source",video:O(O({},c),{},{contentType:W(Ri(x),"video")})})))}return o&&h.audioGroups&&h.audioGroups.forEach(c=>{var p;c&&((p=t.groups[c])==null||p.tracks.forEach(y=>{if(y.groupId===c){const g=y.channels||"",x=parseFloat(g);pe(x)&&x>2&&l.push.apply(l,o.split(",").map(S=>({type:"media-source",audio:{contentType:W(S,"audio"),channels:""+x}})))}}))}),Promise.all(l.map(c=>{const p=Et(c);return Te[p]||(Te[p]=i.decodingInfo(c))})).then(c=>({supported:!c.some(p=>!p.supported),configurations:l,decodingInfoResults:c})).catch(c=>({supported:!1,configurations:l,decodingInfoResults:[],error:c}))}function Et(h){const{audio:t,video:i}=h,s=i||t;if(s){const o=wr(s.contentType);if(i)return`r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${o}_${Math.ceil(i.bitrate/1e5)}`;if(t)return`c${t.channels}${t.spatialRendering?"s":"n"}_${o}`}return""}const Ft=["NONE","TYPE-0","TYPE-1",null];function or(h){return Ft.indexOf(h)>-1}const Jt=["SDR","PQ","HLG"];function Rr(h){return!!h&&Jt.indexOf(h)>-1}var Sr={No:"",Yes:"YES",v2:"v2"};function oi(h){const{canSkipUntil:t,canSkipDateRanges:i,age:s}=h,o=s<t/2;return t&&o?i?Sr.v2:Sr.Yes:Sr.No}class Dr{constructor(t,i,s){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=i,this.skip=s}addDirectives(t){const i=new self.URL(t);return this.msn!==void 0&&i.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&i.searchParams.set("_HLS_part",this.part.toString()),this.skip&&i.searchParams.set("_HLS_skip",this.skip),i.href}}class Br{constructor(t){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.frameRate=t.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=t.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.codecSet=[t.videoCodec,t.audioCodec].filter(s=>!!s).map(s=>s.substring(0,4)).join(","),"supplemental"in t){var i;this.supplemental=t.supplemental;const s=(i=t.supplemental)==null?void 0:i.videoCodec;s&&s!==t.videoCodec&&(this.codecSet+=`,${s.substring(0,4)}`)}this.addGroupId("audio",t.attrs.AUDIO),this.addGroupId("text",t.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(t){return ni(this._audioGroups,t)}hasSubtitleGroup(t){return ni(this._subtitleGroups,t)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(t,i){if(i){if(t==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(i)===-1&&s.push(i)}else if(t==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(i)===-1&&s.push(i)}}}get urlId(){return 0}set urlId(t){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var t;return(t=this.audioGroups)==null?void 0:t[0]}get textGroupId(){var t;return(t=this.subtitleGroups)==null?void 0:t[0]}addFallback(){}}function ni(h,t){return!t||!h?!1:h.indexOf(t)!==-1}function _i(){if(typeof matchMedia=="function"){const h=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(h.media!==t.media)return h.matches===!0}return!1}function Ni(h,t){let i=!1,s=[];if(h&&(i=h!=="SDR",s=[h]),t){s=t.allowedVideoRanges||Jt.slice(0);const o=s.join("")!=="SDR"&&!t.videoCodec;i=t.preferHDR!==void 0?t.preferHDR:o&&_i(),i||(s=["SDR"])}return{preferHDR:i,allowedVideoRanges:s}}const mi=h=>{const t=new WeakSet;return(i,s)=>{if(h&&(s=h(i,s)),typeof s=="object"&&s!==null){if(t.has(s))return;t.add(s)}return s}},Ur=(h,t)=>JSON.stringify(h,mi(t));function Gi(h,t,i,s,o){const l=Object.keys(h),c=s==null?void 0:s.channels,p=s==null?void 0:s.audioCodec,y=o==null?void 0:o.videoCodec,g=c&&parseInt(c)===2;let x=!1,S=!1,R=1/0,N=1/0,F=1/0,X=1/0,ne=0,Ce=[];const{preferHDR:qe,allowedVideoRanges:$e}=Ni(t,o);for(let Tt=l.length;Tt--;){const Vt=h[l[Tt]];x||(x=Vt.channels[2]>0),R=Math.min(R,Vt.minHeight),N=Math.min(N,Vt.minFramerate),F=Math.min(F,Vt.minBitrate),$e.filter(dr=>Vt.videoRanges[dr]>0).length>0&&(S=!0)}R=pe(R)?R:0,N=pe(N)?N:0;const ht=Math.max(1080,R),mt=Math.max(30,N);F=pe(F)?F:i,i=Math.max(F,i),S||(t=void 0);const Nt=l.length>1;return{codecSet:l.reduce((Tt,Vt)=>{const bt=h[Vt];if(Vt===Tt)return Tt;if(Ce=S?$e.filter(dr=>bt.videoRanges[dr]>0):[],Nt){if(bt.minBitrate>i)return Yr(Vt,`min bitrate of ${bt.minBitrate} > current estimate of ${i}`),Tt;if(!bt.hasDefaultAudio)return Yr(Vt,"no renditions with default or auto-select sound found"),Tt;if(p&&Vt.indexOf(p.substring(0,4))%5!==0)return Yr(Vt,`audio codec preference "${p}" not found`),Tt;if(c&&!g){if(!bt.channels[c])return Yr(Vt,`no renditions with ${c} channel sound found (channels options: ${Object.keys(bt.channels)})`),Tt}else if((!p||g)&&x&&bt.channels[2]===0)return Yr(Vt,"no renditions with stereo sound found"),Tt;if(bt.minHeight>ht)return Yr(Vt,`min resolution of ${bt.minHeight} > maximum of ${ht}`),Tt;if(bt.minFramerate>mt)return Yr(Vt,`min framerate of ${bt.minFramerate} > maximum of ${mt}`),Tt;if(!Ce.some(dr=>bt.videoRanges[dr]>0))return Yr(Vt,`no variants with VIDEO-RANGE of ${Ur(Ce)} found`),Tt;if(y&&Vt.indexOf(y.substring(0,4))%5!==0)return Yr(Vt,`video codec preference "${y}" not found`),Tt;if(bt.maxScore<ne)return Yr(Vt,`max score of ${bt.maxScore} < selected max of ${ne}`),Tt}return Tt&&(Se(Vt)>=Se(Tt)||bt.fragmentError>h[Tt].fragmentError)?Tt:(X=bt.minIndex,ne=bt.maxScore,Vt)},void 0),videoRanges:Ce,preferHDR:qe,minFramerate:N,minBitrate:F,minIndex:X}}function Yr(h,t){ve.log(`[abr] start candidates with "${h}" ignored because ${t}`)}function Or(h){return h.reduce((t,i)=>{let s=t.groups[i.groupId];s||(s=t.groups[i.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(i);const o=i.channels||"2";return s.channels[o]=(s.channels[o]||0)+1,s.hasDefault=s.hasDefault||i.default,s.hasAutoSelect=s.hasAutoSelect||i.autoselect,s.hasDefault&&(t.hasDefaultAudio=!0),s.hasAutoSelect&&(t.hasAutoSelectAudio=!0),t},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function lt(h,t,i,s){return h.slice(i,s+1).reduce((o,l,c)=>{if(!l.codecSet)return o;const p=l.audioGroups;let y=o[l.codecSet];y||(o[l.codecSet]=y={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:c,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!p,fragmentError:0}),y.minBitrate=Math.min(y.minBitrate,l.bitrate);const g=Math.min(l.height,l.width);return y.minHeight=Math.min(y.minHeight,g),y.minFramerate=Math.min(y.minFramerate,l.frameRate),y.minIndex=Math.min(y.minIndex,c),y.maxScore=Math.max(y.maxScore,l.score),y.fragmentError+=l.fragmentError,y.videoRanges[l.videoRange]=(y.videoRanges[l.videoRange]||0)+1,p&&p.forEach(x=>{if(!x)return;const S=t.groups[x];S&&(y.hasDefaultAudio=y.hasDefaultAudio||t.hasDefaultAudio?S.hasDefault:S.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(S.channels).forEach(R=>{y.channels[R]=(y.channels[R]||0)+S.channels[R]}))}),o},{})}function tt(h){if(!h)return h;const{lang:t,assocLang:i,characteristics:s,channels:o,audioCodec:l}=h;return{lang:t,assocLang:i,characteristics:s,channels:o,audioCodec:l}}function _t(h,t,i){if("attrs"in h){const s=t.indexOf(h);if(s!==-1)return s}for(let s=0;s<t.length;s++){const o=t[s];if(Lt(h,o,i))return s}return-1}function Lt(h,t,i){const{groupId:s,name:o,lang:l,assocLang:c,default:p}=h,y=h.forced;return(s===void 0||t.groupId===s)&&(o===void 0||t.name===o)&&(l===void 0||ft(l,t.lang))&&(l===void 0||t.assocLang===c)&&(p===void 0||t.default===p)&&(y===void 0||t.forced===y)&&(!("characteristics"in h)||Kt(h.characteristics||"",t.characteristics))&&(i===void 0||i(h,t))}function ft(h,t="--"){return h.length===t.length?h===t:h.startsWith(t)||t.startsWith(h)}function Kt(h,t=""){const i=h.split(","),s=t.split(",");return i.length===s.length&&!i.some(o=>s.indexOf(o)===-1)}function Bt(h,t){const{audioCodec:i,channels:s}=h;return(i===void 0||(t.audioCodec||"").substring(0,4)===i.substring(0,4))&&(s===void 0||s===(t.channels||"2"))}function lr(h,t,i,s,o){const l=t[s],p=t.reduce((R,N,F)=>{const X=N.uri;return(R[X]||(R[X]=[])).push(F),R},{})[l.uri];p.length>1&&(s=Math.max.apply(Math,p));const y=l.videoRange,g=l.frameRate,x=l.codecSet.substring(0,4),S=Tr(t,s,R=>{if(R.videoRange!==y||R.frameRate!==g||R.codecSet.substring(0,4)!==x)return!1;const N=R.audioGroups,F=i.filter(X=>!N||N.indexOf(X.groupId)!==-1);return _t(h,F,o)>-1});return S>-1?S:Tr(t,s,R=>{const N=R.audioGroups,F=i.filter(X=>!N||N.indexOf(X.groupId)!==-1);return _t(h,F,o)>-1})}function Tr(h,t,i){for(let s=t;s>-1;s--)if(i(h[s]))return s;for(let s=t+1;s<h.length;s++)if(i(h[s]))return s;return-1}function pr(h,t){var i;return!!h&&h!==((i=t.loadLevelObj)==null?void 0:i.uri)}class si extends ae{constructor(t){super("abr",t.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=i=>{var s;const{fragCurrent:o,partCurrent:l,hls:c}=this,{autoLevelEnabled:p,media:y}=c;if(!o||!y)return;const g=performance.now(),x=l?l.stats:o.stats,S=l?l.duration:o.duration,R=g-x.loading.start,N=c.minAutoLevel,F=o.level,X=this._nextAutoLevel;if(x.aborted||x.loaded&&x.loaded===x.total||F<=N){this.clearTimer(),this._nextAutoLevel=-1;return}if(!p)return;const ne=X>-1&&X!==F,Ce=!!i||ne;if(!Ce&&(y.paused||!y.playbackRate||!y.readyState))return;const qe=c.mainForwardBufferInfo;if(!Ce&&qe===null)return;const $e=this.bwEstimator.getEstimateTTFB(),ht=Math.abs(y.playbackRate);if(R<=Math.max($e,1e3*(S/(ht*2))))return;const mt=qe?qe.len/ht:0,Nt=x.loading.first?x.loading.first-x.loading.start:-1,gt=x.loaded&&Nt>-1,Tt=this.getBwEstimate(),Vt=c.levels,bt=Vt[F],dr=Math.max(x.loaded,Math.round(S*(o.bitrate||bt.averageBitrate)/8));let Ir=gt?R-Nt:R;Ir<1&&gt&&(Ir=Math.min(R,x.loaded*8/Tt));const Ei=gt?x.loaded*1e3/Ir:0,wi=$e/1e3,hi=Ei?(dr-x.loaded)/Ei:dr*8/Tt+wi;if(hi<=mt)return;const Zr=Ei?Ei*8:Tt,di=((s=(i==null?void 0:i.details)||this.hls.latestLevelDetails)==null?void 0:s.live)===!0,ti=this.hls.config.abrBandWidthUpFactor;let mr=Number.POSITIVE_INFINITY,br;for(br=F-1;br>N;br--){const dn=Vt[br].maxBitrate,fn=!Vt[br].details||di;if(mr=this.getTimeToLoadFrag(wi,Zr,S*dn,fn),mr<Math.min(mt,S+wi))break}if(mr>=hi||mr>S*10)return;gt?this.bwEstimator.sample(R-Math.min($e,Nt),x.loaded):this.bwEstimator.sampleTTFB(R);const Ci=Vt[br].maxBitrate;this.getBwEstimate()*ti>Ci&&this.resetEstimator(Ci);const yi=this.findBestLevel(Ci,N,br,0,mt,1,1);yi>-1&&(br=yi),this.warn(`Fragment ${o.sn}${l?" part "+l.index:""} of level ${F} is loading too slowly;
Fragment duration: ${o.duration.toFixed(3)}
Time to underbuffer: ${mt.toFixed(3)} s
Estimated load time for current fragment: ${hi.toFixed(3)} s
Estimated load time for down switch fragment: ${mr.toFixed(3)} s
TTFB estimate: ${Nt|0} ms
Current BW estimate: ${pe(Tt)?Tt|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${br} @ ${Ci|0} bps`),c.nextLoadLevel=c.nextAutoLevel=br,this.clearTimer();const Zi=()=>{if(this.clearTimer(),this.fragCurrent===o&&this.hls.loadLevel===br&&br>0){const dn=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${br>0?"and switching down":""}
Fragment duration: ${o.duration.toFixed(3)} s
Time to underbuffer: ${dn.toFixed(3)} s`),o.abortRequests(),this.fragCurrent=this.partCurrent=null,br>N){let fn=this.findBestLevel(this.hls.levels[N].bitrate,N,br,0,dn,1,1);fn===-1&&(fn=N),this.hls.nextLoadLevel=this.hls.nextAutoLevel=fn,this.resetEstimator(this.hls.levels[fn].bitrate)}}};ne||hi>mr*2?Zi():this.timer=self.setInterval(Zi,mr*1e3),c.trigger(E.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:l,stats:x})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(this.log(`setting initial bwe to ${t}`),this.hls.config.abrEwmaDefaultEstimate=t),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const t=this.hls.config;return new be(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.FRAG_LOADING,this.onFragLoading,this),t.on(E.FRAG_LOADED,this.onFragLoaded,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this),t.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.FRAG_LOADING,this.onFragLoading,this),t.off(E.FRAG_LOADED,this.onFragLoaded,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this),t.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(E.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,i){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(t,i){const s=i.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var o;this.fragCurrent=s,this.partCurrent=(o=i.part)!=null?o:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(t,i){this.clearTimer()}onError(t,i){if(!i.fatal)switch(i.details){case te.BUFFER_ADD_CODEC_ERROR:case te.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case te.FRAG_LOAD_TIMEOUT:{const s=i.frag,{fragCurrent:o,partCurrent:l}=this;if(s&&o&&s.sn===o.sn&&s.level===o.level){const c=performance.now(),p=l?l.stats:s.stats,y=c-p.loading.start,g=p.loading.first?p.loading.first-p.loading.start:-1;if(p.loaded&&g>-1){const S=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(y-Math.min(S,g),p.loaded)}else this.bwEstimator.sampleTTFB(y)}break}}}getTimeToLoadFrag(t,i,s,o){const l=t+s/i,c=o?t+this.lastLevelLoadSec:0;return l+c}onLevelLoaded(t,i){const s=this.hls.config,{loading:o}=i.stats,l=o.end-o.first;pe(l)&&(this.lastLevelLoadSec=l/1e3),i.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(i.levelInfo)}onFragLoaded(t,{frag:i,part:s}){const o=s?s.stats:i.stats;if(i.type===$.MAIN&&this.bwEstimator.sampleTTFB(o.loading.first-o.loading.start),!this.ignoreFragment(i)){if(this.clearTimer(),i.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const l=s?s.duration:i.duration,c=this.hls.levels[i.level],p=(c.loaded?c.loaded.bytes:0)+o.loaded,y=(c.loaded?c.loaded.duration:0)+l;c.loaded={bytes:p,duration:y},c.realBitrate=Math.round(8*p/y)}if(i.bitrateTest){const l={stats:o,frag:i,part:s,id:i.type};this.onFragBuffered(E.FRAG_BUFFERED,l),i.bitrateTest=!1}else this.lastLoadedFragLevel=i.level}}onFragBuffered(t,i){const{frag:s,part:o}=i,l=o!=null&&o.stats.loaded?o.stats:s.stats;if(l.aborted||this.ignoreFragment(s))return;const c=l.parsing.end-l.loading.start-Math.min(l.loading.first-l.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(c,l.loaded),l.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=c/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==$.MAIN||t.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:t,minAutoLevel:i}=this.hls,s=this.getBwEstimate(),o=this.hls.config.maxStarvationDelay,l=this.findBestLevel(s,i,t,0,o,1,1);if(l>-1)return l;const c=this.hls.firstLevel,p=Math.min(Math.max(c,i),t);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${c} clamped to ${p}`),p}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const t=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),o=this.lastLoadedFragLevel>-1;if(t!==-1&&(!s||!o||this.nextAutoLevelKey===this.getAutoLevelKey()))return t;const l=s&&o?this.getNextABRAutoLevel():this.firstAutoLevel;if(t!==-1){const c=this.hls.levels;if(c.length>Math.max(t,l)&&c[t].loadError<=c[l].loadError)return t}return this._nextAutoLevel=l,this.nextAutoLevelKey=this.getAutoLevelKey(),l}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:i,hls:s}=this;if(s.levels.length<=1)return s.loadLevel;const{maxAutoLevel:o,config:l,minAutoLevel:c}=s,p=i?i.duration:t?t.duration:0,y=this.getBwEstimate(),g=this.getStarvationDelay();let x=l.abrBandWidthFactor,S=l.abrBandWidthUpFactor;if(g){const ne=this.findBestLevel(y,c,o,g,0,x,S);if(ne>=0)return this.rebufferNotice=-1,ne}let R=p?Math.min(p,l.maxStarvationDelay):l.maxStarvationDelay;if(!g){const ne=this.bitrateTestDelay;ne&&(R=(p?Math.min(p,l.maxLoadingDelay):l.maxLoadingDelay)-ne,this.info(`bitrate test took ${Math.round(1e3*ne)}ms, set first fragment max fetchDuration to ${Math.round(1e3*R)} ms`),x=S=1)}const N=this.findBestLevel(y,c,o,g,R,x,S);if(this.rebufferNotice!==N&&(this.rebufferNotice=N,this.info(`${g?"rebuffering expected":"buffer is empty"}, optimal quality level ${N}`)),N>-1)return N;const F=s.levels[c],X=s.loadLevelObj;return X&&(F==null?void 0:F.bitrate)<X.bitrate?c:s.loadLevel}getStarvationDelay(){const t=this.hls,i=t.media;if(!i)return 1/0;const s=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,o=t.mainForwardBufferInfo;return(o?o.len:0)/s}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(t,i,s,o,l,c,p){var y;const g=o+l,x=this.lastLoadedFragLevel,S=x===-1?this.hls.firstLevel:x,{fragCurrent:R,partCurrent:N}=this,{levels:F,allAudioTracks:X,loadLevel:ne,config:Ce}=this.hls;if(F.length===1)return 0;const qe=F[S],$e=!!((y=this.hls.latestLevelDetails)!=null&&y.live),ht=ne===-1||x===-1;let mt,Nt="SDR",gt=(qe==null?void 0:qe.frameRate)||0;const{audioPreference:Tt,videoPreference:Vt}=Ce,bt=this.audioTracksByGroup||(this.audioTracksByGroup=Or(X));let dr=-1;if(ht){if(this.firstSelection!==-1)return this.firstSelection;const Zr=this.codecTiers||(this.codecTiers=lt(F,bt,i,s)),di=Gi(Zr,Nt,t,Tt,Vt),{codecSet:ti,videoRanges:mr,minFramerate:br,minBitrate:Ci,minIndex:yi,preferHDR:Zi}=di;dr=yi,mt=ti,Nt=Zi?mr[mr.length-1]:mr[0],gt=br,t=Math.max(t,Ci),this.log(`picked start tier ${Ur(di)}`)}else mt=qe==null?void 0:qe.codecSet,Nt=qe==null?void 0:qe.videoRange;const Ir=N?N.duration:R?R.duration:0,Ei=this.bwEstimator.getEstimateTTFB()/1e3,wi=[];for(let Zr=s;Zr>=i;Zr--){var hi;const di=F[Zr],ti=Zr>S;if(!di)continue;if(Ce.useMediaCapabilities&&!di.supportedResult&&!di.supportedPromise){const fn=navigator.mediaCapabilities;typeof(fn==null?void 0:fn.decodingInfo)=="function"&&(Mt(di,bt,Nt,gt,t,Tt)||it(di.videoCodec))?(di.supportedPromise=ct(di,bt,fn),di.supportedPromise.then(Sn=>{if(!this.hls)return;di.supportedResult=Sn;const es=this.hls.levels,ia=es.indexOf(di);Sn.error?this.warn(`MediaCapabilities decodingInfo error: "${Sn.error}" for level ${ia} ${Ur(Sn)}`):Sn.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${ia} ${Ur(Sn)}`),ia>-1&&es.length>1&&(this.log(`Removing unsupported level ${ia}`),this.hls.removeLevel(ia),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):di.supportedResult=bi}if((mt&&di.codecSet!==mt||Nt&&di.videoRange!==Nt||ti&&gt>di.frameRate||!ti&&gt>0&&gt<di.frameRate||di.supportedResult&&!((hi=di.supportedResult.decodingInfoResults)!=null&&hi[0].smooth))&&(!ht||Zr!==dr)){wi.push(Zr);continue}const mr=di.details,br=(N?mr==null?void 0:mr.partTarget:mr==null?void 0:mr.averagetargetduration)||Ir;let Ci;ti?Ci=p*t:Ci=c*t;const yi=Ir&&o>=Ir*2&&l===0?di.averageBitrate:di.maxBitrate,Zi=this.getTimeToLoadFrag(Ei,Ci,yi*br,mr===void 0);if(Ci>=yi&&(Zr===x||di.loadError===0&&di.fragmentError===0)&&(Zi<=Ei||!pe(Zi)||$e&&!this.bitrateTestDelay||Zi<g)){const fn=this.forcedAutoLevel;return Zr!==ne&&(fn===-1||fn!==ne)&&(wi.length&&this.trace(`Skipped level(s) ${wi.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${F[wi[0]].codecs}" ${F[wi[0]].videoRange}; not compatible with "${mt}" ${Nt}`),this.info(`switch candidate:${S}->${Zr} adjustedbw(${Math.round(Ci)})-bitrate=${Math.round(Ci-yi)} ttfb:${Ei.toFixed(1)} avgDuration:${br.toFixed(1)} maxFetchDuration:${g.toFixed(1)} fetchDuration:${Zi.toFixed(1)} firstSelection:${ht} codecSet:${di.codecSet} videoRange:${di.videoRange} hls.loadLevel:${ne}`)),ht&&(this.firstSelection=Zr),Zr}}return-1}set nextAutoLevel(t){const i=this.deriveNextAutoLevel(t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}deriveNextAutoLevel(t){const{maxAutoLevel:i,minAutoLevel:s}=this.hls;return Math.min(Math.max(t,s),i)}}const ci={search:function(h,t){let i=0,s=h.length-1,o=null,l=null;for(;i<=s;){o=(i+s)/2|0,l=h[o];const c=t(l);if(c>0)i=o+1;else if(c<0)s=o-1;else return l}return null}};function gi(h,t,i){if(t===null||!Array.isArray(h)||!h.length||!pe(t))return null;const s=h[0].programDateTime;if(t<(s||0))return null;const o=h[h.length-1].endProgramDateTime;if(t>=(o||0))return null;i=i||0;for(let l=0;l<h.length;++l){const c=h[l];if(Ai(t,i,c))return c}return null}function Er(h,t,i=0,s=0,o=.005){let l=null;if(h){l=t[1+h.sn-t[0].sn]||null;const p=h.endDTS-i;p>0&&p<15e-7&&(i+=15e-7),l&&h.level!==l.level&&l.end<=h.end&&(l=t[2+h.sn-t[0].sn]||null)}else i===0&&t[0].start===0&&(l=t[0]);if(l&&((!h||h.level===l.level)&&Si(i,s,l)===0||Mr(l,h,Math.min(o,s))))return l;const c=ci.search(t,Si.bind(null,i,s));return c&&(c!==h||!l)?c:l}function Mr(h,t,i){if(t&&t.start===0&&t.level<h.level&&(t.endPTS||0)>0){const s=t.tagList.reduce((o,l)=>(l[0]==="INF"&&(o+=parseFloat(l[1])),o),i);return h.start<=s}return!1}function Si(h=0,t=0,i){if(i.start<=h&&i.start+i.duration>h)return 0;const s=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-s<=h?1:i.start-s>h&&i.start?-1:0}function Ai(h,t,i){const s=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3;return(i.endProgramDateTime||0)-s>h}function Xr(h,t){return ci.search(h,i=>i.cc<t?1:i.cc>t?-1:0)}function ri(h,t,i){if(h&&h.startCC<=t&&h.endCC>=t){const s=i.start,o=i.end;let l=h.fragments;if(!i.relurl){const{fragmentHint:c}=h;c&&(l=l.concat(c))}return ci.search(l,c=>c.cc<t||c.end<=s?1:c.cc>t||c.start>=o?-1:0)}return null}function ii(h){switch(h.details){case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_TIMEOUT:case te.LEVEL_LOAD_TIMEOUT:case te.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ai(h,t){const i=ii(t);return h.default[`${i?"timeout":"error"}Retry`]}function Kr(h,t){const i=h.backoff==="linear"?1:Math.pow(2,t);return Math.min(i*h.retryDelayMs,h.maxRetryDelayMs)}function fi(h){return O(O({},h),{errorRetry:null,timeoutRetry:null})}function Pi(h,t,i,s){if(!h)return!1;const o=s==null?void 0:s.code,l=t<h.maxNumRetry&&(Di(o)||!!i);return h.shouldRetry?h.shouldRetry(h,t,i,s,l):l}function Di(h){return h===0&&navigator.onLine===!1||!!h&&(h<400||h>499)}var Ar={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},je={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class cr extends ae{constructor(t){super("error-controller",t.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(E.ERROR,this.onError,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(E.ERROR,this.onError,this),t.off(E.ERROR,this.onErrorOut,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(t){}stopLoad(){this.playlistError=0}getVariantLevelIndex(t){return(t==null?void 0:t.type)===$.MAIN?t.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(t,i){var s;if(i.fatal)return;const o=this.hls,l=i.context;switch(i.details){case te.FRAG_LOAD_ERROR:case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_ERROR:case te.KEY_LOAD_TIMEOUT:i.errorAction=this.getFragRetryOrSwitchAction(i);return;case te.FRAG_PARSING_ERROR:if((s=i.frag)!=null&&s.gap){i.errorAction=yr();return}case te.FRAG_GAP:case te.FRAG_DECRYPT_ERROR:{i.errorAction=this.getFragRetryOrSwitchAction(i),i.errorAction.action=Ar.SendAlternateToPenaltyBox;return}case te.LEVEL_EMPTY_ERROR:case te.LEVEL_PARSING_ERROR:{var c,p;const g=i.parent===$.MAIN?i.level:o.loadLevel;i.details===te.LEVEL_EMPTY_ERROR&&((c=i.context)!=null&&(p=c.levelDetails)!=null&&p.live)?i.errorAction=this.getPlaylistRetryOrSwitchAction(i,g):(i.levelRetry=!1,i.errorAction=this.getLevelSwitchAction(i,g))}return;case te.LEVEL_LOAD_ERROR:case te.LEVEL_LOAD_TIMEOUT:typeof(l==null?void 0:l.level)=="number"&&(i.errorAction=this.getPlaylistRetryOrSwitchAction(i,l.level));return;case te.AUDIO_TRACK_LOAD_ERROR:case te.AUDIO_TRACK_LOAD_TIMEOUT:case te.SUBTITLE_LOAD_ERROR:case te.SUBTITLE_TRACK_LOAD_TIMEOUT:if(l){const g=o.loadLevelObj;if(g&&(l.type===Me.AUDIO_TRACK&&g.hasAudioGroup(l.groupId)||l.type===Me.SUBTITLE_TRACK&&g.hasSubtitleGroup(l.groupId))){i.errorAction=this.getPlaylistRetryOrSwitchAction(i,o.loadLevel),i.errorAction.action=Ar.SendAlternateToPenaltyBox,i.errorAction.flags=je.MoveAllAlternatesMatchingHost;return}}return;case te.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const g=o.loadLevelObj,x=g==null?void 0:g.attrs["HDCP-LEVEL"];x?i.errorAction={action:Ar.SendAlternateToPenaltyBox,flags:je.MoveAllAlternatesMatchingHDCP,hdcpLevel:x}:this.keySystemError(i)}return;case te.BUFFER_ADD_CODEC_ERROR:case te.REMUX_ALLOC_ERROR:case te.BUFFER_APPEND_ERROR:if(!i.errorAction){var y;i.errorAction=this.getLevelSwitchAction(i,(y=i.level)!=null?y:o.loadLevel)}return;case te.INTERNAL_EXCEPTION:case te.BUFFER_APPENDING_ERROR:case te.BUFFER_FULL_ERROR:case te.LEVEL_SWITCH_ERROR:case te.BUFFER_STALLED_ERROR:case te.BUFFER_SEEK_OVER_HOLE:case te.BUFFER_NUDGE_ON_STALL:i.errorAction=yr();return}i.type===Le.KEY_SYSTEM_ERROR&&this.keySystemError(i)}keySystemError(t){const i=this.getVariantLevelIndex(t.frag);t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,i)}getPlaylistRetryOrSwitchAction(t,i){const s=this.hls,o=ai(s.config.playlistLoadPolicy,t),l=this.playlistError++;if(Pi(o,l,ii(t),t.response))return{action:Ar.RetryRequest,flags:je.None,retryConfig:o,retryCount:l};const p=this.getLevelSwitchAction(t,i);return o&&(p.retryConfig=o,p.retryCount=l),p}getFragRetryOrSwitchAction(t){const i=this.hls,s=this.getVariantLevelIndex(t.frag),o=i.levels[s],{fragLoadPolicy:l,keyLoadPolicy:c}=i.config,p=ai(t.details.startsWith("key")?c:l,t),y=i.levels.reduce((x,S)=>x+S.fragmentError,0);if(o&&(t.details!==te.FRAG_GAP&&o.fragmentError++,Pi(p,y,ii(t),t.response)))return{action:Ar.RetryRequest,flags:je.None,retryConfig:p,retryCount:y};const g=this.getLevelSwitchAction(t,s);return p&&(g.retryConfig=p,g.retryCount=y),g}getLevelSwitchAction(t,i){const s=this.hls;i==null&&(i=s.loadLevel);const o=this.hls.levels[i];if(o){var l,c;const g=t.details;o.loadError++,g===te.BUFFER_APPEND_ERROR&&o.fragmentError++;let x=-1;const{levels:S,loadLevel:R,minAutoLevel:N,maxAutoLevel:F}=s;s.autoLevelEnabled||(s.loadLevel=-1);const X=(l=t.frag)==null?void 0:l.type,Ce=(X===$.AUDIO&&g===te.FRAG_PARSING_ERROR||t.sourceBufferName==="audio"&&(g===te.BUFFER_ADD_CODEC_ERROR||g===te.BUFFER_APPEND_ERROR))&&S.some(({audioCodec:Nt})=>o.audioCodec!==Nt),$e=t.sourceBufferName==="video"&&(g===te.BUFFER_ADD_CODEC_ERROR||g===te.BUFFER_APPEND_ERROR)&&S.some(({codecSet:Nt,audioCodec:gt})=>o.codecSet!==Nt&&o.audioCodec===gt),{type:ht,groupId:mt}=(c=t.context)!=null?c:{};for(let Nt=S.length;Nt--;){const gt=(Nt+R)%S.length;if(gt!==R&&gt>=N&&gt<=F&&S[gt].loadError===0){var p,y;const Tt=S[gt];if(g===te.FRAG_GAP&&X===$.MAIN&&t.frag){const Vt=S[gt].details;if(Vt){const bt=Er(t.frag,Vt.fragments,t.frag.start);if(bt!=null&&bt.gap)continue}}else{if(ht===Me.AUDIO_TRACK&&Tt.hasAudioGroup(mt)||ht===Me.SUBTITLE_TRACK&&Tt.hasSubtitleGroup(mt))continue;if(X===$.AUDIO&&(p=o.audioGroups)!=null&&p.some(Vt=>Tt.hasAudioGroup(Vt))||X===$.SUBTITLE&&(y=o.subtitleGroups)!=null&&y.some(Vt=>Tt.hasSubtitleGroup(Vt))||Ce&&o.audioCodec===Tt.audioCodec||!Ce&&o.audioCodec!==Tt.audioCodec||$e&&o.codecSet===Tt.codecSet)continue}x=gt;break}}if(x>-1&&s.loadLevel!==x)return t.levelRetry=!0,this.playlistError=0,{action:Ar.SendAlternateToPenaltyBox,flags:je.None,nextAutoLevel:x}}return{action:Ar.SendAlternateToPenaltyBox,flags:je.MoveAllAlternatesMatchingHost}}onErrorOut(t,i){var s;switch((s=i.errorAction)==null?void 0:s.action){case Ar.DoNothing:break;case Ar.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(i),!i.errorAction.resolved&&i.details!==te.FRAG_GAP?i.fatal=!0:/MediaSource readyState: ended/.test(i.error.message)&&(this.warn(`MediaSource ended after "${i.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case Ar.RetryRequest:break}if(i.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(t){const i=this.hls,s=t.errorAction;if(!s)return;const{flags:o,hdcpLevel:l,nextAutoLevel:c}=s;switch(o){case je.None:this.switchLevel(t,c);break;case je.MoveAllAlternatesMatchingHDCP:l&&(i.maxHdcpLevel=Ft[Ft.indexOf(l)-1],s.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${i.maxHdcpLevel}" or lower`);break}s.resolved||this.switchLevel(t,c)}switchLevel(t,i){if(i!==void 0&&t.errorAction&&(this.warn(`switching to level ${i} after ${t.details}`),this.hls.nextAutoLevel=i,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,t.details===te.BUFFER_ADD_CODEC_ERROR&&t.mimeType&&t.sourceBufferName!=="audiovideo")){const s=wr(t.mimeType),o=this.hls.levels;for(let l=o.length;l--;)o[l][`${t.sourceBufferName}Codec`]===s&&this.hls.removeLevel(l)}}}function yr(h){const t={action:Ar.DoNothing,flags:je.None};return h&&(t.resolved=!0),t}var jr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class nn{constructor(t){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.BUFFER_APPENDED,this.onBufferAppended,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this),t.on(E.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:t}=this;t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.BUFFER_APPENDED,this.onBufferAppended,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this),t.off(E.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,i){const s=this.activePartLists[i];if(s)for(let o=s.length;o--;){const l=s[o];if(!l)break;const c=l.end;if(l.start<=t&&c!==null&&t<=c)return l}return this.getBufferedFrag(t,i)}getBufferedFrag(t,i){return this.getFragAtPos(t,i,!0)}getFragAtPos(t,i,s){const{fragments:o}=this,l=Object.keys(o);for(let c=l.length;c--;){const p=o[l[c]];if((p==null?void 0:p.body.type)===i&&(!s||p.buffered)){const y=p.body;if(y.start<=t&&t<=y.end)return y}}return null}detectEvictedFragments(t,i,s,o,l){this.timeRanges&&(this.timeRanges[t]=i);const c=(o==null?void 0:o.fragment.sn)||-1;Object.keys(this.fragments).forEach(p=>{const y=this.fragments[p];if(!y||c>=y.body.sn)return;if(!y.buffered&&(!y.loaded||l)){y.body.type===s&&this.removeFragment(y.body);return}const g=y.range[t];if(g){if(g.time.length===0){this.removeFragment(y.body);return}g.time.some(x=>{const S=!this.isTimeBuffered(x.startPTS,x.endPTS,i);return S&&this.removeFragment(y.body),S})}})}detectPartialFragments(t){const i=this.timeRanges;if(!i||t.frag.sn==="initSegment")return;const s=t.frag,o=$i(s),l=this.fragments[o];if(!l||l.buffered&&s.gap)return;const c=!s.relurl;Object.keys(i).forEach(p=>{const y=s.elementaryStreams[p];if(!y)return;const g=i[p],x=c||y.partial===!0;l.range[p]=this.getBufferedTimes(s,t.part,x,g)}),l.loaded=null,Object.keys(l.range).length?(l.buffered=!0,(l.body.endList=s.endList||l.body.endList)&&(this.endListFragments[l.body.type]=l),vi(l)||this.removeParts(s.sn-1,s.type)):this.removeFragment(l.body)}removeParts(t,i){const s=this.activePartLists[i];s&&(this.activePartLists[i]=s.filter(o=>o.fragment.sn>=t))}fragBuffered(t,i){const s=$i(t);let o=this.fragments[s];!o&&i&&(o=this.fragments[s]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),o&&(o.loaded=null,o.buffered=!0)}getBufferedTimes(t,i,s,o){const l={time:[],partial:s},c=t.start,p=t.end,y=t.minEndPTS||p,g=t.maxStartPTS||c;for(let x=0;x<o.length;x++){const S=o.start(x)-this.bufferPadding,R=o.end(x)+this.bufferPadding;if(g>=S&&y<=R){l.time.push({startPTS:Math.max(c,o.start(x)),endPTS:Math.min(p,o.end(x))});break}else if(c<R&&p>S){const N=Math.max(c,o.start(x)),F=Math.min(p,o.end(x));F>N&&(l.partial=!0,l.time.push({startPTS:N,endPTS:F}))}else if(p<=S)break}return l}getPartialFragment(t){let i=null,s,o,l,c=0;const{bufferPadding:p,fragments:y}=this;return Object.keys(y).forEach(g=>{const x=y[g];x&&vi(x)&&(o=x.body.start-p,l=x.body.end+p,t>=o&&t<=l&&(s=Math.min(t-o,l-t),c<=s&&(i=x.body,c=s)))}),i}isEndListAppended(t){const i=this.endListFragments[t];return i!==void 0&&(i.buffered||vi(i))}getState(t){const i=$i(t),s=this.fragments[i];return s?s.buffered?vi(s)?jr.PARTIAL:jr.OK:jr.APPENDING:jr.NOT_LOADED}isTimeBuffered(t,i,s){let o,l;for(let c=0;c<s.length;c++){if(o=s.start(c)-this.bufferPadding,l=s.end(c)+this.bufferPadding,t>=o&&i<=l)return!0;if(i<=o)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(t,i){if(i.frag.sn==="initSegment"||i.frag.bitrateTest)return;const s=i.frag,o=i.part?null:i,l=$i(s);this.fragments[l]={body:s,appendedPTS:null,loaded:o,buffered:!1,range:Object.create(null)}}onBufferAppended(t,i){const{frag:s,part:o,timeRanges:l,type:c}=i;if(s.sn==="initSegment")return;const p=s.type;if(o){let g=this.activePartLists[p];g||(this.activePartLists[p]=g=[]),g.push(o)}this.timeRanges=l;const y=l[c];this.detectEvictedFragments(c,y,p,o)}onFragBuffered(t,i){this.detectPartialFragments(i)}hasFragment(t){const i=$i(t);return!!this.fragments[i]}hasFragments(t){const{fragments:i}=this,s=Object.keys(i);if(!t)return s.length>0;for(let o=s.length;o--;){const l=i[s[o]];if((l==null?void 0:l.body.type)===t)return!0}return!1}hasParts(t){var i;return!!((i=this.activePartLists[t])!=null&&i.length)}removeFragmentsInRange(t,i,s,o,l){o&&!this.hasGaps||Object.keys(this.fragments).forEach(c=>{const p=this.fragments[c];if(!p)return;const y=p.body;y.type!==s||o&&!y.gap||y.start<i&&y.end>t&&(p.buffered||l)&&this.removeFragment(y)})}removeFragment(t){const i=$i(t);t.clearElementaryStreamInfo();const s=this.activePartLists[t.type];if(s){const o=t.sn;this.activePartLists[t.type]=s.filter(l=>l.fragment.sn!==o)}delete this.fragments[i],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){var t,i;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const s=(t=this.hls)==null||(i=t.latestLevelDetails)==null?void 0:i.partList;s&&s.forEach(o=>o.clearElementaryStreamInfo())}}function vi(h){var t,i,s;return h.buffered&&(h.body.gap||((t=h.range.video)==null?void 0:t.partial)||((i=h.range.audio)==null?void 0:i.partial)||((s=h.range.audiovideo)==null?void 0:s.partial))}function $i(h){return`${h.type}_${h.level}_${h.sn}`}var Hr={cbc:0,ctr:1};class pn{constructor(t,i,s){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=t,this.aesIV=i,this.aesMode=s}decrypt(t,i){switch(this.aesMode){case Hr.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,t);case Hr.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},i,t);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function _n(h){const t=h.byteLength,i=t&&new DataView(h.buffer).getUint8(t-1);return i?h.slice(0,t-i):h}class Vi{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(t){const i=new DataView(t),s=new Uint32Array(4);for(let o=0;o<4;o++)s[o]=i.getUint32(o*4);return s}initTable(){const t=this.sBox,i=this.invSBox,s=this.subMix,o=s[0],l=s[1],c=s[2],p=s[3],y=this.invSubMix,g=y[0],x=y[1],S=y[2],R=y[3],N=new Uint32Array(256);let F=0,X=0,ne=0;for(ne=0;ne<256;ne++)ne<128?N[ne]=ne<<1:N[ne]=ne<<1^283;for(ne=0;ne<256;ne++){let Ce=X^X<<1^X<<2^X<<3^X<<4;Ce=Ce>>>8^Ce&255^99,t[F]=Ce,i[Ce]=F;const qe=N[F],$e=N[qe],ht=N[$e];let mt=N[Ce]*257^Ce*16843008;o[F]=mt<<24|mt>>>8,l[F]=mt<<16|mt>>>16,c[F]=mt<<8|mt>>>24,p[F]=mt,mt=ht*16843009^$e*65537^qe*257^F*16843008,g[Ce]=mt<<24|mt>>>8,x[Ce]=mt<<16|mt>>>16,S[Ce]=mt<<8|mt>>>24,R[Ce]=mt,F?(F=qe^N[N[N[ht^qe]]],X^=N[N[X]]):F=X=1}}expandKey(t){const i=this.uint8ArrayToUint32Array_(t);let s=!0,o=0;for(;o<i.length&&s;)s=i[o]===this.key[o],o++;if(s)return;this.key=i;const l=this.keySize=i.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);const c=this.ksRows=(l+6+1)*4;let p,y;const g=this.keySchedule=new Uint32Array(c),x=this.invKeySchedule=new Uint32Array(c),S=this.sBox,R=this.rcon,N=this.invSubMix,F=N[0],X=N[1],ne=N[2],Ce=N[3];let qe,$e;for(p=0;p<c;p++){if(p<l){qe=g[p]=i[p];continue}$e=qe,p%l===0?($e=$e<<8|$e>>>24,$e=S[$e>>>24]<<24|S[$e>>>16&255]<<16|S[$e>>>8&255]<<8|S[$e&255],$e^=R[p/l|0]<<24):l>6&&p%l===4&&($e=S[$e>>>24]<<24|S[$e>>>16&255]<<16|S[$e>>>8&255]<<8|S[$e&255]),g[p]=qe=(g[p-l]^$e)>>>0}for(y=0;y<c;y++)p=c-y,y&3?$e=g[p]:$e=g[p-4],y<4||p<=4?x[y]=$e:x[y]=F[S[$e>>>24]]^X[S[$e>>>16&255]]^ne[S[$e>>>8&255]]^Ce[S[$e&255]],x[y]=x[y]>>>0}networkToHostOrderSwap(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24}decrypt(t,i,s){const o=this.keySize+6,l=this.invKeySchedule,c=this.invSBox,p=this.invSubMix,y=p[0],g=p[1],x=p[2],S=p[3],R=this.uint8ArrayToUint32Array_(s);let N=R[0],F=R[1],X=R[2],ne=R[3];const Ce=new Int32Array(t),qe=new Int32Array(Ce.length);let $e,ht,mt,Nt,gt,Tt,Vt,bt,dr,Ir,Ei,wi,hi,Zr;const di=this.networkToHostOrderSwap;for(;i<Ce.length;){for(dr=di(Ce[i]),Ir=di(Ce[i+1]),Ei=di(Ce[i+2]),wi=di(Ce[i+3]),gt=dr^l[0],Tt=wi^l[1],Vt=Ei^l[2],bt=Ir^l[3],hi=4,Zr=1;Zr<o;Zr++)$e=y[gt>>>24]^g[Tt>>16&255]^x[Vt>>8&255]^S[bt&255]^l[hi],ht=y[Tt>>>24]^g[Vt>>16&255]^x[bt>>8&255]^S[gt&255]^l[hi+1],mt=y[Vt>>>24]^g[bt>>16&255]^x[gt>>8&255]^S[Tt&255]^l[hi+2],Nt=y[bt>>>24]^g[gt>>16&255]^x[Tt>>8&255]^S[Vt&255]^l[hi+3],gt=$e,Tt=ht,Vt=mt,bt=Nt,hi=hi+4;$e=c[gt>>>24]<<24^c[Tt>>16&255]<<16^c[Vt>>8&255]<<8^c[bt&255]^l[hi],ht=c[Tt>>>24]<<24^c[Vt>>16&255]<<16^c[bt>>8&255]<<8^c[gt&255]^l[hi+1],mt=c[Vt>>>24]<<24^c[bt>>16&255]<<16^c[gt>>8&255]<<8^c[Tt&255]^l[hi+2],Nt=c[bt>>>24]<<24^c[gt>>16&255]<<16^c[Tt>>8&255]<<8^c[Vt&255]^l[hi+3],qe[i]=di($e^N),qe[i+1]=di(Nt^F),qe[i+2]=di(mt^X),qe[i+3]=di(ht^ne),N=dr,F=Ir,X=Ei,ne=wi,i=i+4}return qe.buffer}}class ts{constructor(t,i,s){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=t,this.key=i,this.aesMode=s}expandKey(){const t=Yn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}function Yn(h){switch(h){case Hr.cbc:return"AES-CBC";case Hr.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${h}`)}}const $n=16;class Gn{constructor(t,{removePKCS7Padding:i=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=t.enableSoftwareAES,this.removePKCS7Padding=i,i)try{const s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(s){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:t,remainderData:i}=this;if(!t||i)return this.reset(),null;const s=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?_n(s):s}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(t,i,s,o){return this.useSoftware?new Promise((l,c)=>{const p=ArrayBuffer.isView(t)?t:new Uint8Array(t);this.softwareDecrypt(p,i,s,o);const y=this.flush();y?l(y.buffer):c(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(t),i,s,o)}softwareDecrypt(t,i,s,o){const{currentIV:l,currentResult:c,remainderData:p}=this;if(o!==Hr.cbc||i.byteLength!==16)return ve.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),p&&(t=Fe(p,t),this.remainderData=null);const y=this.getValidChunk(t);if(!y.length)return null;l&&(s=l);let g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new Vi),g.expandKey(i);const x=c;return this.currentResult=g.decrypt(y.buffer,0,s),this.currentIV=y.slice(-16).buffer,x||null}webCryptoDecrypt(t,i,s,o){if(this.key!==i||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(t,i,s,o));this.key=i,this.fastAesKey=new ts(this.subtle,i,o)}return this.fastAesKey.expandKey().then(l=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new pn(this.subtle,new Uint8Array(s),o).decrypt(t.buffer,l)):Promise.reject(new Error("web crypto not initialized"))).catch(l=>(ve.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${l.name}: ${l.message}`),this.onWebCryptoError(t,i,s,o)))}onWebCryptoError(t,i,s,o){const l=this.enableSoftwareAES;if(l){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,i,s,o);const c=this.flush();if(c)return c.buffer}throw new Error("WebCrypto"+(l?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(t){let i=t;const s=t.length-t.length%$n;return s!==t.length&&(i=t.slice(0,s),this.remainderData=t.slice(s)),i}logOnce(t){this.logEnabled&&(ve.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const Pr=Math.pow(2,17);class ki{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,i){const s=t.url;if(!s)return Promise.reject(new vn({type:Le.NETWORK_ERROR,details:te.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error(`Fragment does not have a ${s?"part list":"url"}`),networkDetails:null}));this.abort();const o=this.config,l=o.fLoader,c=o.loader;return new Promise((p,y)=>{if(this.loader&&this.loader.destroy(),t.gap)if(t.tagList.some(F=>F[0]==="GAP")){y(Wi(t));return}else t.gap=!1;const g=this.loader=l?new l(o):new c(o),x=Ki(t);t.loader=g;const S=fi(o.fragLoadPolicy.default),R={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:t.sn==="initSegment"?1/0:Pr};t.stats=g.stats;const N={onSuccess:(F,X,ne,Ce)=>{this.resetLoader(t,g);let qe=F.data;ne.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(qe.slice(0,16)),qe=qe.slice(16)),p({frag:t,part:null,payload:qe,networkDetails:Ce})},onError:(F,X,ne,Ce)=>{this.resetLoader(t,g),y(new vn({type:Le.NETWORK_ERROR,details:te.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:O({url:s,data:void 0},F),error:new Error(`HTTP Error ${F.code} ${F.text}`),networkDetails:ne,stats:Ce}))},onAbort:(F,X,ne)=>{this.resetLoader(t,g),y(new vn({type:Le.NETWORK_ERROR,details:te.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:ne,stats:F}))},onTimeout:(F,X,ne)=>{this.resetLoader(t,g),y(new vn({type:Le.NETWORK_ERROR,details:te.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${R.timeout}ms`),networkDetails:ne,stats:F}))}};i&&(N.onProgress=(F,X,ne,Ce)=>i({frag:t,part:null,payload:ne,networkDetails:Ce})),g.load(x,R,N)})}loadPart(t,i,s){this.abort();const o=this.config,l=o.fLoader,c=o.loader;return new Promise((p,y)=>{if(this.loader&&this.loader.destroy(),t.gap||i.gap){y(Wi(t,i));return}const g=this.loader=l?new l(o):new c(o),x=Ki(t,i);t.loader=g;const S=fi(o.fragLoadPolicy.default),R={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Pr};i.stats=g.stats,g.load(x,R,{onSuccess:(N,F,X,ne)=>{this.resetLoader(t,g),this.updateStatsFromPart(t,i);const Ce={frag:t,part:i,payload:N.data,networkDetails:ne};s(Ce),p(Ce)},onError:(N,F,X,ne)=>{this.resetLoader(t,g),y(new vn({type:Le.NETWORK_ERROR,details:te.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:i,response:O({url:x.url,data:void 0},N),error:new Error(`HTTP Error ${N.code} ${N.text}`),networkDetails:X,stats:ne}))},onAbort:(N,F,X)=>{t.stats.aborted=i.stats.aborted,this.resetLoader(t,g),y(new vn({type:Le.NETWORK_ERROR,details:te.INTERNAL_ABORTED,fatal:!1,frag:t,part:i,error:new Error("Aborted"),networkDetails:X,stats:N}))},onTimeout:(N,F,X)=>{this.resetLoader(t,g),y(new vn({type:Le.NETWORK_ERROR,details:te.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:i,error:new Error(`Timeout after ${R.timeout}ms`),networkDetails:X,stats:N}))}})})}updateStatsFromPart(t,i){const s=t.stats,o=i.stats,l=o.total;if(s.loaded+=o.loaded,l){const y=Math.round(t.duration/i.duration),g=Math.min(Math.round(s.loaded/l),y),S=(y-g)*Math.round(s.loaded/g);s.total=s.loaded+S}else s.total=Math.max(s.loaded,s.total);const c=s.loading,p=o.loading;c.start?c.first+=p.first-p.start:(c.start=p.start,c.first=p.first),c.end=p.end}resetLoader(t,i){t.loader=null,this.loader===i&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),i.destroy()}}function Ki(h,t=null){const i=t||h,s={frag:h,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},o=i.byteRangeStartOffset,l=i.byteRangeEndOffset;if(pe(o)&&pe(l)){var c;let p=o,y=l;if(h.sn==="initSegment"&&Vn((c=h.decryptdata)==null?void 0:c.method)){const g=l-o;g%16&&(y=l+(16-g%16)),o!==0&&(s.resetIV=!0,p=o-16)}s.rangeStart=p,s.rangeEnd=y}return s}function Wi(h,t){const i=new Error(`GAP ${h.gap?"tag":"attribute"} found`),s={type:Le.MEDIA_ERROR,details:te.FRAG_GAP,fatal:!1,frag:h,error:i,networkDetails:null};return t&&(s.part=t),(t||h).stats.aborted=!0,new vn(s)}function Vn(h){return h==="AES-128"||h==="AES-256"}class vn extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class tn extends ae{constructor(t,i){super(t,i),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(t){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class In{constructor(t,i,s,o=0,l=-1,c=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=zi(),this.buffering={audio:zi(),video:zi(),audiovideo:zi()},this.level=t,this.sn=i,this.id=s,this.size=o,this.part=l,this.partial=c}}function zi(){return{start:0,executeStart:0,executeEnd:0,end:0}}const rs={length:0,start:()=>0,end:()=>0};class Vr{static isBuffered(t,i){if(t){const s=Vr.getBuffered(t);for(let o=s.length;o--;)if(i>=s.start(o)&&i<=s.end(o))return!0}return!1}static bufferedRanges(t){if(t){const i=Vr.getBuffered(t);return Vr.timeRangesToArray(i)}return[]}static timeRangesToArray(t){const i=[];for(let s=0;s<t.length;s++)i.push({start:t.start(s),end:t.end(s)});return i}static bufferInfo(t,i,s){if(t){const o=Vr.bufferedRanges(t);if(o.length)return Vr.bufferedInfo(o,i,s)}return{len:0,start:i,end:i,bufferedIndex:-1}}static bufferedInfo(t,i,s){i=Math.max(0,i),t.length>1&&t.sort((x,S)=>x.start-S.start||S.end-x.end);let o=-1,l=[];if(s)for(let x=0;x<t.length;x++){i>=t[x].start&&i<=t[x].end&&(o=x);const S=l.length;if(S){const R=l[S-1].end;t[x].start-R<s?t[x].end>R&&(l[S-1].end=t[x].end):l.push(t[x])}else l.push(t[x])}else l=t;let c=0,p,y=i,g=i;for(let x=0;x<l.length;x++){const S=l[x].start,R=l[x].end;if(o===-1&&i>=S&&i<=R&&(o=x),i+s>=S&&i<R)y=S,g=R,c=g-i;else if(i+s<S){p=S;break}}return{len:c,start:y||0,end:g||0,nextStart:p,buffered:t,bufferedIndex:o}}static getBuffered(t){try{return t.buffered||rs}catch(i){return ve.log("failed to get media.buffered",i),rs}}}const ss=/\{\$([a-zA-Z0-9-_]+)\}/g;function Xn(h){return ss.test(h)}function xn(h,t){if(h.variableList!==null||h.hasVariableRefs){const i=h.variableList;return t.replace(ss,s=>{const o=s.substring(2,s.length-1),l=i==null?void 0:i[o];return l===void 0?(h.playlistParsingError||(h.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${o}"`)),s):l})}return t}function Ii(h,t,i){let s=h.variableList;s||(h.variableList=s={});let o,l;if("QUERYPARAM"in t){o=t.QUERYPARAM;try{const c=new self.URL(i).searchParams;if(c.has(o))l=c.get(o);else throw new Error(`"${o}" does not match any query parameter in URI: "${i}"`)}catch(c){h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${c.message}`))}}else o=t.NAME,l=t.VALUE;o in s?h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${o}"`)):s[o]=l||""}function vs(h,t,i){const s=t.IMPORT;if(i&&s in i){let o=h.variableList;o||(h.variableList=o={}),o[s]=i[s]}else h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}const _s=/^(\d+)x(\d+)$/,ds=/(.+?)=(".*?"|.*?)(?:,|$)/g;class pi{constructor(t,i){typeof t=="string"&&(t=pi.parseAttrList(t,i)),k(this,t)}get clientAttrs(){return Object.keys(this).filter(t=>t.substring(0,2)==="X-")}decimalInteger(t){const i=parseInt(this[t],10);return i>Number.MAX_SAFE_INTEGER?1/0:i}hexadecimalInteger(t){if(this[t]){let i=(this[t]||"0x").slice(2);i=(i.length&1?"0":"")+i;const s=new Uint8Array(i.length/2);for(let o=0;o<i.length/2;o++)s[o]=parseInt(i.slice(o*2,o*2+2),16);return s}return null}hexadecimalIntegerAsNumber(t){const i=parseInt(this[t],16);return i>Number.MAX_SAFE_INTEGER?1/0:i}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,i){const s=this[t];return s?parseFloat(s):i}enumeratedString(t){return this[t]}enumeratedStringList(t,i){const s=this[t];return(s?s.split(/[ ,]+/):[]).reduce((o,l)=>(o[l.toLowerCase()]=!0,o),i)}bool(t){return this[t]==="YES"}decimalResolution(t){const i=_s.exec(this[t]);if(i!==null)return{width:parseInt(i[1],10),height:parseInt(i[2],10)}}static parseAttrList(t,i){let s;const o={},l='"';for(ds.lastIndex=0;(s=ds.exec(t))!==null;){const c=s[1].trim();let p=s[2];const y=p.indexOf(l)===0&&p.lastIndexOf(l)===p.length-1;let g=!1;if(y)p=p.slice(1,-1);else switch(c){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":g=!0}if(i&&(y||g))p=xn(i,p);else if(!g&&!y)switch(c){case"CLOSED-CAPTIONS":if(p==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":ve.warn(`${t}: attribute ${c} is missing quotes`)}o[c]=p}return o}}const xs="com.apple.hls.interstitial";function ws(h){return h!=="ID"&&h!=="CLASS"&&h!=="CUE"&&h!=="START-DATE"&&h!=="DURATION"&&h!=="END-DATE"&&h!=="END-ON-NEXT"}function nr(h){return h==="SCTE35-OUT"||h==="SCTE35-IN"||h==="SCTE35-CMD"}class mn{constructor(t,i,s=0){var o;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(i==null?void 0:i.tagAnchor)||null,this.tagOrder=(o=i==null?void 0:i.tagOrder)!=null?o:s,i){const l=i.attr;for(const c in l)if(Object.prototype.hasOwnProperty.call(t,c)&&t[c]!==l[c]){ve.warn(`DATERANGE tag attribute: "${c}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=c;break}t=k(new pi({}),l,t)}if(this.attr=t,i?(this._startDate=i._startDate,this._cue=i._cue,this._endDate=i._endDate,this._dateAtEnd=i._dateAtEnd):this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const l=(i==null?void 0:i.endDate)||new Date(this.attr["END-DATE"]);pe(l.getTime())&&(this._endDate=l)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const t=this._cue;return t===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):t}get startTime(){const{tagAnchor:t}=this;return t===null||t.programDateTime===null?(ve.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${t}`),NaN):t.start+(this.startDate.getTime()-t.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const t=this._endDate||this._dateAtEnd;if(t)return t;const i=this.duration;return i!==null?this._dateAtEnd=new Date(this._startDate.getTime()+i*1e3):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(pe(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===xs}get isValid(){return!!this.id&&!this._badValueForSameId&&pe(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const Ss=10;class fs{constructor(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t){this.advanced=!0,this.updated=!0;return}const i=this.lastPartSn-t.lastPartSn,s=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!s||!!i||!this.live,this.advanced=this.endSN>t.endSN||i>0||i===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(t.misses*.6):this.misses=t.misses+1}get hasProgramDateTime(){return this.fragments.length?pe(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Ss}get drift(){const t=this.driftEndTime-this.driftStartTime;return t>0?(this.driftEnd-this.driftStart)*1e3/t:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var t;return(t=this.fragments)!=null&&t.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var t;return(t=this.fragments)!=null&&t.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const t=this.partList;if(t){const i=this.lastPartIndex;if(i!==-1){for(let s=t.length;s--;)if(t[s].index>i)return t[s].index;return i}}return 0}get lastPartSn(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const t=this.partEnd-this.fragmentStart;return this.age>Math.max(t,this.totalduration)+this.levelTargetDuration}return!1}}function un(h){return h==="AES-128"||h==="AES-256"||h==="AES-256-CTR"}function cn(h){switch(h){case"AES-128":case"AES-256":return Hr.cbc;case"AES-256-CTR":return Hr.ctr;default:throw new Error(`invalid full segment method ${h}`)}}function Fi(h){return Uint8Array.from(atob(h),t=>t.charCodeAt(0))}function rn(h){return Uint8Array.from(unescape(encodeURIComponent(h)),t=>t.charCodeAt(0))}function zn(h){const t=rn(h).subarray(0,16),i=new Uint8Array(16);return i.set(t,16-t.length),i}function Wn(h){const t=function(s,o,l){const c=s[o];s[o]=s[l],s[l]=c};t(h,0,3),t(h,1,2),t(h,4,5),t(h,6,7)}function Pn(h){const t=h.split(":");let i=null;if(t[0]==="data"&&t.length===2){const s=t[1].split(";"),o=s[s.length-1].split(",");if(o.length===2){const l=o[0]==="base64",c=o[1];l?(s.splice(-1,1),i=Fi(c)):i=zn(c)}}return i}const An=typeof self!="undefined"?self:void 0;var Oi={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},xi={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Mi(h){switch(h){case xi.FAIRPLAY:return Oi.FAIRPLAY;case xi.PLAYREADY:return Oi.PLAYREADY;case xi.WIDEVINE:return Oi.WIDEVINE;case xi.CLEARKEY:return Oi.CLEARKEY}}var sn={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function kn(h){if(h===sn.WIDEVINE)return Oi.WIDEVINE;if(h===sn.PLAYREADY)return Oi.PLAYREADY;if(h===sn.CENC||h===sn.CLEARKEY)return Oi.CLEARKEY}function Jn(h){switch(h){case Oi.FAIRPLAY:return xi.FAIRPLAY;case Oi.PLAYREADY:return xi.PLAYREADY;case Oi.WIDEVINE:return xi.WIDEVINE;case Oi.CLEARKEY:return xi.CLEARKEY}}function Lr(h){const{drmSystems:t,widevineLicenseUrl:i}=h,s=t?[Oi.FAIRPLAY,Oi.WIDEVINE,Oi.PLAYREADY,Oi.CLEARKEY].filter(o=>!!t[o]):[];return!s[Oi.WIDEVINE]&&i&&s.push(Oi.WIDEVINE),s}const Jr=function(h){return An!=null&&(h=An.navigator)!=null&&h.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function yn(h,t,i,s){let o;switch(h){case Oi.FAIRPLAY:o=["cenc","sinf"];break;case Oi.WIDEVINE:case Oi.PLAYREADY:o=["cenc"];break;case Oi.CLEARKEY:o=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${h}`)}return Ln(o,t,i,s)}function Ln(h,t,i,s){return[{initDataTypes:h,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:t.map(l=>({contentType:`audio/mp4; codecs=${l}`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:i.map(l=>({contentType:`video/mp4; codecs=${l}`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function Ji(h){const t=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/2),i=String.fromCharCode.apply(null,Array.from(t)),s=i.substring(i.indexOf("<"),i.length),c=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(c){const p=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(p){const y=Fi(p).subarray(0,16);return Wn(y),y}}return null}let Is={};class as{static clearKeyUriToKeyIdMap(){Is={}}constructor(t,i,s,o=[1],l=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=i,this.keyFormat=s,this.keyFormatVersions=o,this.iv=l,this.encrypted=t?t!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!un(t)}isSupported(){if(this.method){if(un(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case xi.FAIRPLAY:case xi.WIDEVINE:case xi.PLAYREADY:case xi.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(t){if(!this.encrypted||!this.uri)return null;if(un(this.method)&&this.uri&&!this.iv){typeof t!="number"&&(ve.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0);const s=Hs(t);return new as(this.method,this.uri,"identity",this.keyFormatVersions,s)}const i=Pn(this.uri);if(i)switch(this.keyFormat){case xi.WIDEVINE:this.pssh=i,i.length>=22&&(this.keyId=i.subarray(i.length-22,i.length-6));break;case xi.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=B(s,null,i),this.keyId=Ji(i);break}default:{let s=i.subarray(0,16);if(s.length!==16){const o=new Uint8Array(16);o.set(s,16-s.length),s=o}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=Is[this.uri];if(!s){const o=Object.keys(Is).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,o),Is[this.uri]=s}this.keyId=s}return this}}function Hs(h){const t=new Uint8Array(16);for(let i=12;i<16;i++)t[i]=h>>8*(15-i)&255;return t}const Un=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Ys=/#EXT-X-MEDIA:(.*)/g,ya=/^#EXT(?:INF|-X-TARGETDURATION):/m,ba=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),eo=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Es{static findGroup(t,i){for(let s=0;s<t.length;s++){const o=t[s];if(o.id===i)return o}}static resolve(t,i){return we.buildAbsoluteURL(i,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return ya.test(t)}static parseMasterPlaylist(t,i){const s=Xn(t),o={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:s},l=[];Un.lastIndex=0;let c;for(;(c=Un.exec(t))!=null;)if(c[1]){var p;const g=new pi(c[1],o),x=xn(o,c[2]),S={attrs:g,bitrate:g.decimalInteger("BANDWIDTH")||g.decimalInteger("AVERAGE-BANDWIDTH"),name:g.NAME,url:Es.resolve(x,i)},R=g.decimalResolution("RESOLUTION");R&&(S.width=R.width,S.height=R.height),Fa(g.CODECS,S);const N=g["SUPPLEMENTAL-CODECS"];N&&(S.supplemental={},Fa(N,S.supplemental)),(p=S.unknownCodecs)!=null&&p.length||l.push(S),o.levels.push(S)}else if(c[3]){const g=c[3],x=c[4];switch(g){case"SESSION-DATA":{const S=new pi(x,o),R=S["DATA-ID"];R&&(o.sessionData===null&&(o.sessionData={}),o.sessionData[R]=S);break}case"SESSION-KEY":{const S=On(x,i,o);S.encrypted&&S.isSupported()?(o.sessionKeys===null&&(o.sessionKeys=[]),o.sessionKeys.push(S)):ve.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${x}"`);break}case"DEFINE":{{const S=new pi(x,o);Ii(o,S,i)}break}case"CONTENT-STEERING":{const S=new pi(x,o);o.contentSteering={uri:Es.resolve(S["SERVER-URI"],i),pathwayId:S["PATHWAY-ID"]||"."};break}case"START":{o.startTimeOffset=Xs(x);break}}}const y=l.length>0&&l.length<o.levels.length;return o.levels=y?l:o.levels,o.levels.length===0&&(o.playlistParsingError=new Error("no levels found in manifest")),o}static parseMasterPlaylistMedia(t,i,s){let o;const l={},c=s.levels,p={AUDIO:c.map(g=>({id:g.attrs.AUDIO,audioCodec:g.audioCodec})),SUBTITLES:c.map(g=>({id:g.attrs.SUBTITLES,textCodec:g.textCodec})),"CLOSED-CAPTIONS":[]};let y=0;for(Ys.lastIndex=0;(o=Ys.exec(t))!==null;){const g=new pi(o[1],s),x=g.TYPE;if(x){const S=p[x],R=l[x]||[];l[x]=R;const N=g.LANGUAGE,F=g["ASSOC-LANGUAGE"],X=g.CHANNELS,ne=g.CHARACTERISTICS,Ce=g["INSTREAM-ID"],qe={attrs:g,bitrate:0,id:y++,groupId:g["GROUP-ID"]||"",name:g.NAME||N||"",type:x,default:g.bool("DEFAULT"),autoselect:g.bool("AUTOSELECT"),forced:g.bool("FORCED"),lang:N,url:g.URI?Es.resolve(g.URI,i):""};if(F&&(qe.assocLang=F),X&&(qe.channels=X),ne&&(qe.characteristics=ne),Ce&&(qe.instreamId=Ce),S!=null&&S.length){const $e=Es.findGroup(S,qe.groupId)||S[0];sa(qe,$e,"audioCodec"),sa(qe,$e,"textCodec")}R.push(qe)}}return l}static parseLevelPlaylist(t,i,s,o,l,c){var p;const y={url:i},g=new fs(i),x=g.fragments,S=[];let R=null,N=0,F=0,X=0,ne=0,Ce=0,qe=null,$e=new at(o,y),ht,mt,Nt,gt=-1,Tt=!1,Vt=null,bt;if(ba.lastIndex=0,g.m3u8=t,g.hasVariableRefs=Xn(t),((p=ba.exec(t))==null?void 0:p[0])!=="#EXTM3U")return g.playlistParsingError=new Error("Missing format identifier #EXTM3U"),g;for(;(ht=ba.exec(t))!==null;){Tt&&(Tt=!1,$e=new at(o,y),$e.playlistOffset=X,$e.start=X,$e.sn=N,$e.cc=ne,Ce&&($e.bitrate=Ce),$e.level=s,R&&($e.initSegment=R,R.rawProgramDateTime&&($e.rawProgramDateTime=R.rawProgramDateTime,R.rawProgramDateTime=null),Vt&&($e.setByteRange(Vt),Vt=null)));const wi=ht[1];if(wi){$e.duration=parseFloat(wi);const hi=(" "+ht[2]).slice(1);$e.title=hi||null,$e.tagList.push(hi?["INF",wi,hi]:["INF",wi])}else if(ht[3]){if(pe($e.duration)){$e.playlistOffset=X,$e.start=X,Nt&&bo($e,Nt,g),$e.sn=N,$e.level=s,$e.cc=ne,x.push($e);const hi=(" "+ht[3]).slice(1);$e.relurl=xn(g,hi),Na($e,qe,S),qe=$e,X+=$e.duration,N++,F=0,Tt=!0}}else{if(ht=ht[0].match(eo),!ht){ve.warn("No matches on slow regex match for level playlist!");continue}for(mt=1;mt<ht.length&&ht[mt]===void 0;mt++);const hi=(" "+ht[mt]).slice(1),Zr=(" "+ht[mt+1]).slice(1),di=ht[mt+2]?(" "+ht[mt+2]).slice(1):null;switch(hi){case"BYTERANGE":qe?$e.setByteRange(Zr,qe):$e.setByteRange(Zr);break;case"PROGRAM-DATE-TIME":$e.rawProgramDateTime=Zr,$e.tagList.push(["PROGRAM-DATE-TIME",Zr]),gt===-1&&(gt=x.length);break;case"PLAYLIST-TYPE":g.type&&Os(g,hi,ht),g.type=Zr.toUpperCase();break;case"MEDIA-SEQUENCE":g.startSN!==0?Os(g,hi,ht):x.length>0&&Qo(g,hi,ht),N=g.startSN=parseInt(Zr);break;case"SKIP":{g.skippedSegments&&Os(g,hi,ht);const ti=new pi(Zr,g),mr=ti.decimalInteger("SKIPPED-SEGMENTS");if(pe(mr)){g.skippedSegments+=mr;for(let Ci=mr;Ci--;)x.push(null);N+=mr}const br=ti.enumeratedString("RECENTLY-REMOVED-DATERANGES");br&&(g.recentlyRemovedDateranges=(g.recentlyRemovedDateranges||[]).concat(br.split(" ")));break}case"TARGETDURATION":g.targetduration!==0&&Os(g,hi,ht),g.targetduration=Math.max(parseInt(Zr),1);break;case"VERSION":g.version!==null&&Os(g,hi,ht),g.version=parseInt(Zr);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":g.live||Os(g,hi,ht),g.live=!1;break;case"#":(Zr||di)&&$e.tagList.push(di?[Zr,di]:[Zr]);break;case"DISCONTINUITY":ne++,$e.tagList.push(["DIS"]);break;case"GAP":$e.gap=!0,$e.tagList.push([hi]);break;case"BITRATE":$e.tagList.push([hi,Zr]),Ce=parseInt(Zr)*1e3,pe(Ce)?$e.bitrate=Ce:Ce=0;break;case"DATERANGE":{const ti=new pi(Zr,g),mr=new mn(ti,g.dateRanges[ti.ID],g.dateRangeTagCount);g.dateRangeTagCount++,mr.isValid||g.skippedSegments?g.dateRanges[mr.id]=mr:ve.warn(`Ignoring invalid DATERANGE tag: "${Zr}"`),$e.tagList.push(["EXT-X-DATERANGE",Zr]);break}case"DEFINE":{{const ti=new pi(Zr,g);"IMPORT"in ti?vs(g,ti,c):Ii(g,ti,i)}break}case"DISCONTINUITY-SEQUENCE":g.startCC!==0?Os(g,hi,ht):x.length>0&&Qo(g,hi,ht),g.startCC=ne=parseInt(Zr);break;case"KEY":{const ti=On(Zr,i,g);if(ti.isSupported()){if(ti.method==="NONE"){Nt=void 0;break}Nt||(Nt={}),Nt[ti.keyFormat]&&(Nt=k({},Nt)),Nt[ti.keyFormat]=ti}else ve.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Zr}"`);break}case"START":g.startTimeOffset=Xs(Zr);break;case"MAP":{const ti=new pi(Zr,g);if($e.duration){const mr=new at(o,y);Ps(mr,ti,s,Nt),R=mr,$e.initSegment=R,R.rawProgramDateTime&&!$e.rawProgramDateTime&&($e.rawProgramDateTime=R.rawProgramDateTime)}else{const mr=$e.byteRangeEndOffset;if(mr){const br=$e.byteRangeStartOffset;Vt=`${mr-br}@${br}`}else Vt=null;Ps($e,ti,s,Nt),R=$e,Tt=!0}R.cc=ne;break}case"SERVER-CONTROL":{bt&&Os(g,hi,ht),bt=new pi(Zr),g.canBlockReload=bt.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=bt.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&bt.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=bt.optionalFloat("PART-HOLD-BACK",0),g.holdBack=bt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{g.partTarget&&Os(g,hi,ht);const ti=new pi(Zr);g.partTarget=ti.decimalFloatingPoint("PART-TARGET");break}case"PART":{let ti=g.partList;ti||(ti=g.partList=[]);const mr=F>0?ti[ti.length-1]:void 0,br=F++,Ci=new pi(Zr,g),yi=new ot(Ci,$e,y,br,mr);ti.push(yi),$e.duration+=yi.duration;break}case"PRELOAD-HINT":{const ti=new pi(Zr,g);g.preloadHint=ti;break}case"RENDITION-REPORT":{const ti=new pi(Zr,g);g.renditionReports=g.renditionReports||[],g.renditionReports.push(ti);break}default:ve.warn(`line parsed but not handled: ${ht}`);break}}}qe&&!qe.relurl?(x.pop(),X-=qe.duration,g.partList&&(g.fragmentHint=qe)):g.partList&&(Na($e,qe,S),$e.cc=ne,g.fragmentHint=$e,Nt&&bo($e,Nt,g)),g.targetduration||(g.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const dr=x.length,Ir=x[0],Ei=x[dr-1];if(X+=g.skippedSegments*g.targetduration,X>0&&dr&&Ei){g.averagetargetduration=X/dr;const wi=Ei.sn;g.endSN=wi!=="initSegment"?wi:0,g.live||(Ei.endList=!0),Ir&&g.startCC===void 0&&(g.startCC=Ir.cc),gt>0&&(Il(x,gt),Ir&&S.unshift(Ir))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(X+=g.fragmentHint.duration),g.totalduration=X,S.length&&g.dateRangeTagCount&&Ir&&is(S,g),g.endCC=ne,g}}function is(h,t){const i=h.length,s=h[i-1],o=t.live?1/0:t.totalduration,l=Object.keys(t.dateRanges);for(let c=l.length;c--;){const p=t.dateRanges[l[c]],y=p.startDate.getTime();p.tagAnchor=s.ref;for(let g=i;g--;){const x=As(t,y,h,g,o);if(x!==-1){p.tagAnchor=t.fragments[x].ref;break}}}}function As(h,t,i,s,o){const l=i[s];if(l){const p=l.programDateTime;if(t>=p||s===0){var c;const y=(((c=i[s+1])==null?void 0:c.start)||o)-l.start;if(t<=p+y*1e3){const g=i[s].sn-h.startSN,x=h.fragments;if(x.length>i.length){const R=(i[s+1]||x[x.length-1]).sn-h.startSN;for(let N=R;N>g;N--){const F=x[N].programDateTime;if(t>=F&&t<F+x[N].duration*1e3)return N}}return g}}}return-1}function On(h,t,i){var s,o;const l=new pi(h,i),c=(s=l.METHOD)!=null?s:"",p=l.URI,y=l.hexadecimalInteger("IV"),g=l.KEYFORMATVERSIONS,x=(o=l.KEYFORMAT)!=null?o:"identity";p&&l.IV&&!y&&ve.error(`Invalid IV: ${l.IV}`);const S=p?Es.resolve(p,t):"",R=(g||"1").split("/").map(Number).filter(Number.isFinite);return new as(c,S,x,R,y)}function Xs(h){const i=new pi(h).decimalFloatingPoint("TIME-OFFSET");return pe(i)?i:null}function Fa(h,t){let i=(h||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const o=i.filter(l=>Ne(l,s));o.length&&(t[`${s}Codec`]=o.map(l=>l.split("/")[0]).join(","),i=i.filter(l=>o.indexOf(l)===-1))}),t.unknownCodecs=i}function sa(h,t,i){const s=t[i];s&&(h[i]=s)}function Il(h,t){let i=h[t];for(let s=t;s--;){const o=h[s];if(!o)return;o.programDateTime=i.programDateTime-o.duration*1e3,i=o}}function Na(h,t,i){h.rawProgramDateTime?i.push(h):t!=null&&t.programDateTime&&(h.programDateTime=t.endProgramDateTime)}function Ps(h,t,i,s){h.relurl=t.URI,t.BYTERANGE&&h.setByteRange(t.BYTERANGE),h.level=i,h.sn="initSegment",s&&(h.levelkeys=s),h.initSegment=null}function bo(h,t,i){h.levelkeys=t;const{encryptedFragments:s}=i;(!s.length||s[s.length-1].levelkeys!==t)&&Object.keys(t).some(o=>t[o].isCommonEncryption)&&s.push(h)}function Os(h,t,i){h.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${i[0]})`)}function Qo(h,t,i){h.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${i[0]})`)}function to(h,t){const i=t.startPTS;if(pe(i)){let s=0,o;t.sn>h.sn?(s=i-h.start,o=h):(s=h.start-i,o=t),o.duration!==s&&o.setDuration(s)}else t.sn>h.sn?h.cc===t.cc&&h.minEndPTS?t.setStart(h.start+(h.minEndPTS-h.start)):t.setStart(h.start+h.duration):t.setStart(Math.max(h.start-t.duration,0))}function Ca(h,t,i,s,o,l){s-i<=0&&(ve.warn("Fragment should have a positive duration",t),s=i+t.duration,l=o+t.duration);let p=i,y=s;const g=t.startPTS,x=t.endPTS;if(pe(g)){const ne=Math.abs(g-i);pe(t.deltaPTS)?t.deltaPTS=Math.max(ne,t.deltaPTS):t.deltaPTS=ne,p=Math.max(i,g),i=Math.min(i,g),o=Math.min(o,t.startDTS),y=Math.min(s,x),s=Math.max(s,x),l=Math.max(l,t.endDTS)}const S=i-t.start;t.start!==0&&t.setStart(i),t.setDuration(s-t.start),t.startPTS=i,t.maxStartPTS=p,t.startDTS=o,t.endPTS=s,t.minEndPTS=y,t.endDTS=l;const R=t.sn;if(!h||R<h.startSN||R>h.endSN)return 0;let N;const F=R-h.startSN,X=h.fragments;for(X[F]=t,N=F;N>0;N--)to(X[N],X[N-1]);for(N=F;N<X.length-1;N++)to(X[N],X[N+1]);return h.fragmentHint&&to(X[X.length-1],h.fragmentHint),h.PTSKnown=h.alignedSliding=!0,S}function $a(h,t){if(h===t)return;let i=null;const s=h.fragments;for(let y=s.length-1;y>=0;y--){const g=s[y].initSegment;if(g){i=g;break}}h.fragmentHint&&delete h.fragmentHint.endPTS;let o;za(h,t,(y,g,x,S)=>{if(t.skippedSegments&&g.cc!==y.cc){const R=y.cc-g.cc;for(let N=x;N<S.length;N++)S[N].cc+=R}pe(y.startPTS)&&pe(y.endPTS)&&(g.setStart(g.startPTS=y.startPTS),g.startDTS=y.startDTS,g.maxStartPTS=y.maxStartPTS,g.endPTS=y.endPTS,g.endDTS=y.endDTS,g.minEndPTS=y.minEndPTS,g.setDuration(y.endPTS-y.startPTS),g.duration&&(o=g),t.PTSKnown=t.alignedSliding=!0),y.hasStreams&&(g.elementaryStreams=y.elementaryStreams),g.loader=y.loader,y.hasStats&&(g.stats=y.stats),y.initSegment&&(g.initSegment=y.initSegment,i=y.initSegment)});const l=t.fragments,c=t.fragmentHint?l.concat(t.fragmentHint):l;if(i&&c.forEach(y=>{var g;y&&(!y.initSegment||y.initSegment.relurl===((g=i)==null?void 0:g.relurl))&&(y.initSegment=i)}),t.skippedSegments)if(t.deltaUpdateFailed=l.some(y=>!y),t.deltaUpdateFailed){ve.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let y=t.skippedSegments;y--;)l.shift();t.startSN=l[0].sn}else{t.endCC=l[l.length-1].cc,t.canSkipDateRanges&&(t.dateRanges=ro(h.dateRanges,t));const y=h.fragments.filter(g=>g.rawProgramDateTime);if(h.hasProgramDateTime&&!t.hasProgramDateTime)for(let g=1;g<c.length;g++)c[g].programDateTime===null&&Na(c[g],c[g-1],y);is(y,t)}el(h.partList,t.partList,(y,g)=>{g.elementaryStreams=y.elementaryStreams,g.stats=y.stats}),o?Ca(t,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):ks(h,t),l.length&&(t.totalduration=t.edge-l[0].start),t.driftStartTime=h.driftStartTime,t.driftStart=h.driftStart;const p=t.advancedDateTime;if(t.advanced&&p){const y=t.edge;t.driftStart||(t.driftStartTime=p,t.driftStart=y),t.driftEndTime=p,t.driftEnd=y}else t.driftEndTime=h.driftEndTime,t.driftEnd=h.driftEnd,t.advancedDateTime=h.advancedDateTime;t.requestScheduled===-1&&(t.requestScheduled=h.requestScheduled)}function ro(h,t){const{dateRanges:i,recentlyRemovedDateranges:s}=t,o=k({},h);s&&s.forEach(p=>{delete o[p]});const c=Object.keys(o).length;return c&&Object.keys(i).forEach(p=>{const y=o[p],g=new mn(i[p].attr,y);g.isValid?(o[p]=g,y||(g.tagOrder+=c)):ve.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Ur(i[p].attr)}"`)}),o}function el(h,t,i){if(h&&t){let s=0;for(let o=0,l=h.length;o<=l;o++){const c=h[o],p=t[o+s];c&&p&&c.index===p.index&&c.fragment.sn===p.fragment.sn?i(c,p):s--}}}function za(h,t,i){const s=t.skippedSegments,o=Math.max(h.startSN,t.startSN)-t.startSN,l=(h.fragmentHint?1:0)+(s?t.endSN:Math.min(h.endSN,t.endSN))-t.startSN,c=t.startSN-h.startSN,p=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,y=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;for(let g=o;g<=l;g++){const x=y[c+g];let S=p[g];if(s&&!S&&x&&(S=t.fragments[g]=x),x&&S){if(i(x,S,g,p),x.url&&x.url!==S.url){t.playlistParsingError=_o(`media sequence mismatch ${S.sn}:`,h,t,x,S);return}else if(x.cc!==S.cc){t.playlistParsingError=_o(`discontinuity sequence mismatch (${x.cc}!=${S.cc})`,h,t,x,S);return}}}}function _o(h,t,i,s,o){return new Error(`${h} ${o.url}
Playlist starting @${t.startSN}
${t.m3u8}
Playlist starting @${i.startSN}
${i.m3u8}`)}function ks(h,t,i=!0){const s=t.startSN+t.skippedSegments-h.startSN,o=h.fragments,l=s>=0;let c=0;if(l&&s<o.length)c=o[s].start;else if(l&&t.startSN===h.endSN+1)c=h.fragmentEnd;else if(l&&i)c=h.fragmentStart+s*t.levelTargetDuration;else if(!t.skippedSegments&&t.fragmentStart===0)c=h.fragmentStart;else return;Ua(t,c)}function Ua(h,t){if(t){const i=h.fragments;for(let s=h.skippedSegments;s<i.length;s++)i[s].addStart(t);h.fragmentHint&&h.fragmentHint.addStart(t)}}function tl(h,t=1/0){let i=1e3*h.targetduration;if(h.updated){const s=h.fragments;if(s.length&&i*4>t){const l=s[s.length-1].duration*1e3;l<i&&(i=l)}}else i/=2;return Math.round(i)}function io(h,t,i){if(!h)return null;let s=h.fragments[t-h.startSN];return s||(s=h.fragmentHint,s&&s.sn===t)?s:t<h.startSN&&i&&i.sn===t?i:null}function Ka(h,t,i){return h?no(h.partList,t,i):null}function no(h,t,i){if(h)for(let s=h.length;s--;){const o=h[s];if(o.index===i&&o.fragment.sn===t)return o}return null}function Js(h){h.forEach((t,i)=>{var s;(s=t.details)==null||s.fragments.forEach(o=>{o.level=i,o.initSegment&&(o.initSegment.level=i)})})}function aa(h,t){for(let s=0,o=h.length;s<o;s++){var i;if(((i=h[s])==null?void 0:i.cc)===t)return h[s]}return null}function oa(h,t){return!!(h&&t.startCC<h.endCC&&t.endCC>h.startCC)}function xo(h,t){if(h){const i=h.start+t;h.start=h.startPTS=i,h.endPTS=i+h.duration}}function Hi(h,t){const i=t.fragments;for(let s=0,o=i.length;s<o;s++)xo(i[s],h);t.fragmentHint&&xo(t.fragmentHint,h),t.alignedSliding=!0}function Qi(h,t){h&&(ji(t,h),!t.alignedSliding&&h&&ps(t,h),!t.alignedSliding&&h&&!t.skippedSegments&&ks(h,t,!1))}function ji(h,t){if(!oa(t,h))return;const i=Math.min(t.endCC,h.endCC),s=aa(t.fragments,i),o=aa(h.fragments,i);if(!s||!o)return;ve.log(`Aligning playlist at start of dicontinuity sequence ${i}`);const l=s.start-o.start;Hi(l,h)}function ps(h,t){if(!h.hasProgramDateTime||!t.hasProgramDateTime)return;const i=h.fragments,s=t.fragments;if(!i.length||!s.length)return;let o,l;const c=Math.min(t.endCC,h.endCC);t.startCC<c&&h.startCC<c&&(o=aa(s,c),l=aa(i,c)),(!o||!l)&&(o=s[Math.floor(s.length/2)],l=aa(i,o.cc)||i[Math.floor(i.length/2)]);const p=o.programDateTime,y=l.programDateTime;if(!p||!y)return;const g=(y-p)/1e3-(l.start-o.start);Hi(g,h)}const Bn={toString:function(h){let t="";const i=h.length;for(let s=0;s<i;s++)t+=`[${h.start(s).toFixed(3)}-${h.end(s).toFixed(3)}]`;return t}},Gt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class _a extends tn{constructor(t,i,s,o,l){super(o,t.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Gt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:c,fragCurrent:p,media:y,mediaBuffer:g,state:x}=this,S=y?y.currentTime:0,R=Vr.bufferInfo(g||y,S,c.maxBufferHole);if(this.log(`media seeking to ${pe(S)?S.toFixed(3):S}, state: ${x}`),this.state===Gt.ENDED)this.resetLoadingState();else if(p){const N=c.maxFragLookUpTolerance,F=p.start-N,X=p.start+p.duration+N;if(!R.len||X<R.start||F>R.end){const ne=S>X;(S<F||ne)&&(ne&&p.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),p.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(y){this.fragmentTracker.removeFragmentsInRange(S,1/0,this.playlistType,!0);const N=this.lastCurrentTime;if(S>N&&(this.lastCurrentTime=S),!this.loadingParts){const F=Math.max(R.end,S),X=this.shouldLoadParts(this.getLevelDetails(),F);X&&(this.log(`LL-Part loading ON after seeking to ${S.toFixed(2)} with buffer @${F.toFixed(2)}`),this.loadingParts=X)}}!this.hls.hasEnoughToStart&&!R.len&&(this.log(`setting startPosition to ${S} because of seek before start`),this.nextLoadPosition=this.startPosition=S),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=l,this.hls=t,this.fragmentLoader=new ki(t.config),this.keyLoader=s,this.fragmentTracker=i,this.config=t.config,this.decrypter=new Gn(t.config)}registerListeners(){const{hls:t}=this;t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){if(this.state===Gt.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const t=this.fragCurrent;t!=null&&t.loader&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Gt.STOPPED}get startPositionValue(){const{nextLoadPosition:t,startPosition:i}=this;return i===-1&&t?t:i}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(t,i){if(i.live||!this.media)return!1;const s=t.end||0,o=this.config.timelineOffset||0;if(s<=o)return!1;const l=t.nextStart;if(l&&l>o&&l<i.edge||this.media.currentTime<t.start)return!1;const p=i.partList;if(p!=null&&p.length){const g=p[p.length-1];return Vr.isBuffered(this.media,g.start+g.duration/2)}const y=i.fragments[i.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(y)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var t;return(t=this.levelLastLoaded)==null?void 0:t.details}}get timelineOffset(){const t=this.config.timelineOffset;if(t){var i;return((i=this.getLevelDetails())==null?void 0:i.appliedTimelineOffset)||t}return 0}onMediaAttached(t,i){const s=this.media=this.mediaBuffer=i.media;s.removeEventListener("seeking",this.onMediaSeeking),s.removeEventListener("ended",this.onMediaEnded),s.addEventListener("seeking",this.onMediaSeeking),s.addEventListener("ended",this.onMediaEnded);const o=this.config;this.levels&&o.autoStartLoad&&this.state===Gt.STOPPED&&this.startLoad(o.startPosition)}onMediaDetaching(t,i){const s=!!i.transferMedia,o=this.media;if(o!==null){if(o.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),o.removeEventListener("seeking",this.onMediaSeeking),o.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!s&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,s){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(t,i){}onManifestLoaded(t,i){this.startTimeOffset=i.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=Gt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(t,i,s){this.startFragRequested=!0,this._loadFragForPlayback(t,i,s)}_loadFragForPlayback(t,i,s){const o=l=>{const c=l.frag;if(this.fragContextChanged(c)){this.warn(`${c.type} sn: ${c.sn}${l.part?" part: "+l.part.index:""} of ${this.fragInfo(c,!1,l.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(c);return}c.stats.chunkCount++,this._handleFragmentLoadProgress(l)};this._doFragLoad(t,i,s,o).then(l=>{if(!l)return;const c=this.state,p=l.frag;if(this.fragContextChanged(p)){(c===Gt.FRAG_LOADING||!this.fragCurrent&&c===Gt.PARSING)&&(this.fragmentTracker.removeFragment(p),this.state=Gt.IDLE);return}"payload"in l&&(this.log(`Loaded ${p.type} sn: ${p.sn} of ${this.playlistLabel()} ${p.level}`),this.hls.trigger(E.FRAG_LOADED,l)),this._handleFragmentLoadComplete(l)}).catch(l=>{this.state===Gt.STOPPED||this.state===Gt.ERROR||(this.warn(`Frag error: ${(l==null?void 0:l.message)||l}`),this.resetFragmentLoading(t))})}clearTrackerIfNeeded(t){var i;const{fragmentTracker:s}=this;if(s.getState(t)===jr.APPENDING){const l=t.type,c=this.getFwdBufferInfo(this.mediaBuffer,l),p=Math.max(t.duration,c?c.len:this.config.maxBufferLength),y=this.backtrackFragment;((y?t.sn-y.sn:0)===1||this.reduceMaxBufferLength(p,t.duration))&&s.removeFragment(t)}else((i=this.mediaBuffer)==null?void 0:i.buffered.length)===0?s.removeAllFragments():s.hasParts(t.type)&&(s.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),s.getState(t)===jr.PARTIAL&&s.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const i=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:i,part:null,stats:i.stats,id:i.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}waitForLive(t){const i=t.details;return(i==null?void 0:i.live)&&i.type!=="EVENT"&&(this.levelLastLoaded!==t||i.expired)}flushMainBuffer(t,i,s=null){if(!(t-i))return;const o={startOffset:t,endOffset:i,type:s};this.hls.trigger(E.BUFFER_FLUSHING,o)}_loadInitSegment(t,i){this._doFragLoad(t,i).then(s=>{const o=s==null?void 0:s.frag;if(!o||this.fragContextChanged(o)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:o}=this,{frag:l,payload:c}=s,p=l.decryptdata;if(c&&c.byteLength>0&&p!=null&&p.key&&p.iv&&un(p.method)){const y=self.performance.now();return this.decrypter.decrypt(new Uint8Array(c),p.key.buffer,p.iv.buffer,cn(p.method)).catch(g=>{throw o.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.FRAG_DECRYPT_ERROR,fatal:!1,error:g,reason:g.message,frag:l}),g}).then(g=>{const x=self.performance.now();return o.trigger(E.FRAG_DECRYPTED,{frag:l,payload:g,stats:{tstart:y,tdecrypt:x}}),s.payload=g,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===Gt.STOPPED||this.state===Gt.ERROR||(this.warn(s),this.resetFragmentLoading(t))})}completeInitSegmentLoad(t){const{levels:i}=this;if(!i)throw new Error("init load aborted, missing levels");const s=t.frag.stats;this.state!==Gt.STOPPED&&(this.state=Gt.IDLE),t.frag.data=new Uint8Array(t.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}fragContextChanged(t){const{fragCurrent:i}=this;return!t||!i||t.sn!==i.sn||t.level!==i.level}fragBufferedComplete(t,i){const s=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${i?" part: "+i.index:""} of ${this.fragInfo(t,!1,i)} > buffer:${s?Bn.toString(Vr.getBuffered(s)):"(detached)"})`),xe(t)){var o;if(t.type!==$.SUBTITLE){const c=t.elementaryStreams;if(!Object.keys(c).some(p=>!!c[p])){this.state=Gt.IDLE;return}}const l=(o=this.levels)==null?void 0:o[t.level];l!=null&&l.fragmentError&&(this.log(`Resetting level fragment error count of ${l.fragmentError} on frag buffered`),l.fragmentError=0)}this.state=Gt.IDLE}_handleFragmentLoadComplete(t){const{transmuxer:i}=this;if(!i)return;const{frag:s,part:o,partsLoaded:l}=t,c=!l||l.length===0||l.some(y=>!y),p=new In(s.level,s.sn,s.stats.chunkCount+1,0,o?o.index:-1,!c);i.flush(p)}_handleFragmentLoadProgress(t){}_doFragLoad(t,i,s=null,o){var l;this.fragCurrent=t;const c=i==null?void 0:i.details;if(!this.levels||!c)throw new Error(`frag load aborted, missing level${c?"":" detail"}s`);let p=null;t.encrypted&&!((l=t.decryptdata)!=null&&l.key)?(this.log(`Loading key for ${t.sn} of [${c.startSN}-${c.endSN}], ${this.playlistLabel()} ${t.level}`),this.state=Gt.KEY_LOADING,this.fragCurrent=t,p=this.keyLoader.load(t).then(S=>{if(!this.fragContextChanged(S.frag))return this.hls.trigger(E.KEY_LOADED,S),this.state===Gt.KEY_LOADING&&(this.state=Gt.IDLE),S}),this.hls.trigger(E.KEY_LOADING,{frag:t}),this.fragCurrent===null&&(p=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!t.encrypted&&c.encryptedFragments.length&&this.keyLoader.loadClear(t,c.encryptedFragments);const y=this.fragPrevious;if(xe(t)&&(!y||t.sn!==y.sn)){const S=this.shouldLoadParts(i.details,t.end);S!==this.loadingParts&&(this.log(`LL-Part loading ${S?"ON":"OFF"} loading sn ${y==null?void 0:y.sn}->${t.sn}`),this.loadingParts=S)}if(s=Math.max(t.start,s||0),this.loadingParts&&xe(t)){const S=c.partList;if(S&&o){s>t.end&&c.fragmentHint&&(t=c.fragmentHint);const R=this.getNextPart(S,t,s);if(R>-1){const N=S[R];t=this.fragCurrent=N.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${N.index} (${R}/${S.length-1}) of ${this.fragInfo(t,!1,N)}) cc: ${t.cc} [${c.startSN}-${c.endSN}], target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=N.start+N.duration,this.state=Gt.FRAG_LOADING;let F;return p?F=p.then(X=>!X||this.fragContextChanged(X.frag)?null:this.doFragPartsLoad(t,N,i,o)).catch(X=>this.handleFragLoadError(X)):F=this.doFragPartsLoad(t,N,i,o).catch(X=>this.handleFragLoadError(X)),this.hls.trigger(E.FRAG_LOADING,{frag:t,part:N,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):F}else if(!t.url||this.loadedEndOfParts(S,s))return Promise.resolve(null)}}if(xe(t)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${s.toFixed(2)}`),this.loadingParts=!1;else if(!t.url)return Promise.resolve(null);this.log(`Loading ${t.type} sn: ${t.sn} of ${this.fragInfo(t,!1)}) cc: ${t.cc} ${c?"["+c.startSN+"-"+c.endSN+"]":""}, target: ${parseFloat(s.toFixed(3))}`),pe(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Gt.FRAG_LOADING;const g=this.config.progressive;let x;return g&&p?x=p.then(S=>!S||this.fragContextChanged(S==null?void 0:S.frag)?null:this.fragmentLoader.load(t,o)).catch(S=>this.handleFragLoadError(S)):x=Promise.all([this.fragmentLoader.load(t,g?o:void 0),p]).then(([S])=>(!g&&S&&o&&o(S),S)).catch(S=>this.handleFragLoadError(S)),this.hls.trigger(E.FRAG_LOADING,{frag:t,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):x}doFragPartsLoad(t,i,s,o){return new Promise((l,c)=>{var p;const y=[],g=(p=s.details)==null?void 0:p.partList,x=S=>{this.fragmentLoader.loadPart(t,S,o).then(R=>{y[S.index]=R;const N=R.part;this.hls.trigger(E.FRAG_LOADED,R);const F=Ka(s.details,t.sn,S.index+1)||no(g,t.sn,S.index+1);if(F)x(F);else return l({frag:t,part:N,partsLoaded:y})}).catch(c)};x(i)})}handleFragLoadError(t){if("data"in t){const i=t.data;t.data&&i.details===te.INTERNAL_ABORTED?this.handleFragLoadAborted(i.frag,i.part):this.hls.trigger(E.ERROR,i)}else this.hls.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const i=this.getCurrentContext(t);if(!i||this.state!==Gt.PARSING){!this.fragCurrent&&this.state!==Gt.STOPPED&&this.state!==Gt.ERROR&&(this.state=Gt.IDLE);return}const{frag:s,part:o,level:l}=i,c=self.performance.now();s.stats.parsing.end=c,o&&(o.stats.parsing.end=c);const p=this.getLevelDetails(),g=p&&s.sn>p.endSN||this.shouldLoadParts(p,s.end);g!==this.loadingParts&&(this.log(`LL-Part loading ${g?"ON":"OFF"} after parsing segment ending @${s.end.toFixed(2)}`),this.loadingParts=g),this.updateLevelTiming(s,o,l,t.partial)}shouldLoadParts(t,i){if(this.config.lowLatencyMode){if(!t)return this.loadingParts;if(t!=null&&t.partList){var s;const l=t.partList[0],c=l.end+(((s=t.fragmentHint)==null?void 0:s.duration)||0);if(i>=c){var o;if((this.hls.hasEnoughToStart?((o=this.media)==null?void 0:o.currentTime)||this.lastCurrentTime:this.getLoadPosition())>l.start-l.fragment.duration)return!0}}}return!1}getCurrentContext(t){const{levels:i,fragCurrent:s}=this,{level:o,sn:l,part:c}=t;if(!(i!=null&&i[o]))return this.warn(`Levels object was unset while buffering fragment ${l} of ${this.playlistLabel()} ${o}. The current chunk will not be buffered.`),null;const p=i[o],y=p.details,g=c>-1?Ka(y,l,c):null,x=g?g.fragment:io(y,l,s);return x?(s&&s!==x&&(x.stats=s.stats),{frag:x,part:g,level:p}):null}bufferFragmentData(t,i,s,o,l){var c;if(!t||this.state!==Gt.PARSING)return;const{data1:p,data2:y}=t;let g=p;if(p&&y&&(g=Fe(p,y)),!((c=g)!=null&&c.length))return;const x={type:t.type,frag:i,part:s,chunkMeta:o,parent:i.type,data:g};if(this.hls.trigger(E.BUFFER_APPENDING,x),t.dropped&&t.independent&&!s){if(l)return;this.flushBufferGap(i)}}flushBufferGap(t){const i=this.media;if(!i)return;if(!Vr.isBuffered(i,i.currentTime)){this.flushMainBuffer(0,t.start);return}const s=i.currentTime,o=Vr.bufferInfo(i,s,0),l=t.duration,c=Math.min(this.config.maxFragLookUpTolerance*2,l*.25),p=Math.max(Math.min(t.start-c,o.end-c),s+c);t.start-p>c&&this.flushMainBuffer(p,t.start)}getFwdBufferInfo(t,i){var s;const o=this.getLoadPosition();if(!pe(o))return null;const c=this.lastCurrentTime>o||(s=this.media)!=null&&s.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(t,o,i,c)}getFwdBufferInfoAtPos(t,i,s,o){const l=Vr.bufferInfo(t,i,o);if(l.len===0&&l.nextStart!==void 0){const c=this.fragmentTracker.getBufferedFrag(i,s);if(c&&(l.nextStart<=c.end||c.gap)){const p=Math.max(Math.min(l.nextStart,c.end)-i,o);return Vr.bufferInfo(t,i,p)}}return l}getMaxBufferLength(t){const{config:i}=this;let s;return t?s=Math.max(8*i.maxBufferSize/t,i.maxBufferLength):s=i.maxBufferLength,Math.min(s,i.maxMaxBufferLength)}reduceMaxBufferLength(t,i){const s=this.config,o=Math.max(Math.min(t-i,s.maxBufferLength),i),l=Math.max(t-i*3,s.maxMaxBufferLength/2,o);return l>=o?(s.maxMaxBufferLength=l,this.warn(`Reduce max buffer length to ${l}s`),!0):!1}getAppendedFrag(t,i=$.MAIN){var s;const o=(s=this.fragmentTracker)==null?void 0:s.getAppendedFrag(t,i);return o&&"fragment"in o?o.fragment:o}getNextFragment(t,i){const s=i.fragments,o=s.length;if(!o)return null;const{config:l}=this,c=s[0].start,p=l.lowLatencyMode&&!!i.partList;let y=null;if(i.live){const S=l.initialLiveManifestSize;if(o<S)return this.warn(`Not enough fragments to start playback (have: ${o}, need: ${S})`),null;if(!i.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||t<c){var g;p&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),y=this.getInitialLiveFragment(i,s);const R=this.hls.startPosition,N=this.hls.liveSyncPosition,F=y?(R!==-1&&R>=c?R:N)||y.start:t;this.log(`Setting startPosition to ${F} to match start frag at live edge. mainStart: ${R} liveSyncPosition: ${N} frag.start: ${(g=y)==null?void 0:g.start}`),this.startPosition=this.nextLoadPosition=F}}else t<=c&&(y=s[0]);if(!y){const S=this.loadingParts?i.partEnd:i.fragmentEnd;y=this.getFragmentAtPosition(t,S,i)}let x=this.filterReplacedPrimary(y,i);if(!x&&y){const S=y.sn-i.startSN;x=this.filterReplacedPrimary(s[S+1]||null,i)}return this.mapToInitFragWhenRequired(x)}isLoopLoading(t,i){const s=this.fragmentTracker.getState(t);return(s===jr.OK||s===jr.PARTIAL&&!!t.gap)&&this.nextLoadPosition>i}getNextFragmentLoopLoading(t,i,s,o,l){let c=null;if(t.gap&&(c=this.getNextFragment(this.nextLoadPosition,i),c&&!c.gap&&s.nextStart)){const p=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,o,0);if(p!==null&&s.len+p.len>=l){const y=c.sn;return this.loopSn!==y&&(this.log(`buffer full after gaps in "${o}" playlist starting at sn: ${y}`),this.loopSn=y),null}}return this.loopSn=void 0,c}get primaryPrefetch(){if(wo(this.hls.config)){var t,i;if((t=this.hls.interstitialsManager)==null||(i=t.playingItem)==null?void 0:i.event)return!0}return!1}filterReplacedPrimary(t,i){if(!t)return t;if(wo(this.hls.config)&&t.type!==$.SUBTITLE){const s=this.hls.interstitialsManager,o=s==null?void 0:s.bufferingItem;if(o){const c=o.event;if(c){if(c.appendInPlace||Math.abs(t.start-o.start)>1||o.start===0)return null}else if(t.end<=o.start&&(i==null?void 0:i.live)===!1||t.start>o.end&&o.nextEvent&&(o.nextEvent.appendInPlace||t.start-o.end>1))return null}const l=s==null?void 0:s.playerQueue;if(l)for(let c=l.length;c--;){const p=l[c].interstitial;if(p.appendInPlace&&t.start>=p.startTime&&t.end<=p.resumeTime)return null}}return t}mapToInitFragWhenRequired(t){return t!=null&&t.initSegment&&!(t!=null&&t.initSegment.data)&&!this.bitrateTest?t.initSegment:t}getNextPart(t,i,s){let o=-1,l=!1,c=!0;for(let p=0,y=t.length;p<y;p++){const g=t[p];if(c=c&&!g.independent,o>-1&&s<g.start)break;const x=g.loaded;x?o=-1:(l||g.independent||c)&&g.fragment===i&&(o=p),l=x}return o}loadedEndOfParts(t,i){const s=t[t.length-1];return s&&i>s.start&&s.loaded}getInitialLiveFragment(t,i){const s=this.fragPrevious;let o=null;if(s){if(t.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),o=gi(i,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!o){const l=s.sn+1;if(l>=t.startSN&&l<=t.endSN){const c=i[l-t.startSN];s.cc===c.cc&&(o=c,this.log(`Live playlist, switching playlist, load frag with next SN: ${o.sn}`))}o||(o=Xr(i,s.cc),o&&this.log(`Live playlist, switching playlist, load frag with same CC: ${o.sn}`))}}else{const l=this.hls.liveSyncPosition;l!==null&&(o=this.getFragmentAtPosition(l,this.bitrateTest?t.fragmentEnd:t.edge,t))}return o}getFragmentAtPosition(t,i,s){const{config:o}=this;let{fragPrevious:l}=this,{fragments:c,endSN:p}=s;const{fragmentHint:y}=s,{maxFragLookUpTolerance:g}=o,x=s.partList,S=!!(this.loadingParts&&x!=null&&x.length&&y);S&&y&&!this.bitrateTest&&x[x.length-1].fragment.sn===y.sn&&(c=c.concat(y),p=y.sn);let R;if(t<i){var N;const X=t<this.lastCurrentTime||t>i-g||(N=this.media)!=null&&N.paused||!this.startFragRequested?0:g;R=Er(l,c,t,X)}else R=c[c.length-1];if(R){const F=R.sn-s.startSN,X=this.fragmentTracker.getState(R);if((X===jr.OK||X===jr.PARTIAL&&R.gap)&&(l=R),l&&R.sn===l.sn&&(!S||x[0].fragment.sn>R.sn||!s.live&&!S)&&l&&R.level===l.level){const Ce=c[F+1];R.sn<p&&this.fragmentTracker.getState(Ce)!==jr.OK?R=Ce:R=null}}return R}alignPlaylists(t,i,s){const o=t.fragments.length;if(!o)return this.warn("No fragments in live playlist"),0;const l=t.fragmentStart,c=!i,p=t.alignedSliding&&pe(l);if(c||!p&&!l){Qi(s,t);const y=t.fragmentStart;return this.log(`Live playlist sliding: ${y.toFixed(2)} start-sn: ${i?i.startSN:"na"}->${t.startSN} fragments: ${o}`),y}return l}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,t.partTarget*3)}setStartPosition(t,i){let s=this.startPosition;s<i&&(s=-1);const o=this.timelineOffset;if(s===-1){const l=this.startTimeOffset!==null,c=l?this.startTimeOffset:t.startTimeOffset;c!==null&&pe(c)?(s=i+c,c<0&&(s+=t.edge),s=Math.min(Math.max(i,s),i+t.totalduration),this.log(`Setting startPosition to ${s} for start time offset ${c} found in ${l?"multivariant":"media"} playlist`),this.startPosition=s):t.live?(s=this.hls.liveSyncPosition||i,this.log(`Setting startPosition to -1 to start at live edge ${s}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=s=0),this.lastCurrentTime=s+o}this.nextLoadPosition=s+o}getLoadPosition(){var t;const{media:i}=this;let s=0;return(t=this.hls)!=null&&t.hasEnoughToStart&&i?s=i.currentTime:this.nextLoadPosition>=0&&(s=this.nextLoadPosition),s}handleFragLoadAborted(t,i){this.transmuxer&&t.type===this.playlistType&&xe(t)&&t.stats.aborted&&(this.warn(`Fragment ${t.sn}${i?" part "+i.index:""} of ${this.playlistLabel()} ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){(!this.fragCurrent||!this.fragContextChanged(t)&&this.state!==Gt.FRAG_LOADING_WAITING_RETRY)&&(this.state=Gt.IDLE)}onFragmentOrKeyLoadError(t,i){if(i.chunkMeta&&!i.frag){const F=this.getCurrentContext(i.chunkMeta);F&&(i.frag=F.frag)}const s=i.frag;if(!s||s.type!==t||!this.levels)return;if(this.fragContextChanged(s)){var o;this.warn(`Frag load error must match current frag to retry ${s.url} > ${(o=this.fragCurrent)==null?void 0:o.url}`);return}const l=i.details===te.FRAG_GAP;l&&this.fragmentTracker.fragBuffered(s,!0);const c=i.errorAction,{action:p,flags:y,retryCount:g=0,retryConfig:x}=c||{},S=!!c&&!!x,R=S&&p===Ar.RetryRequest,N=S&&!c.resolved&&y===je.MoveAllAlternatesMatchingHost;if(!R&&N&&xe(s)&&!s.endList)this.resetFragmentErrors(t),this.treatAsGap(s),c.resolved=!0;else if((R||N)&&g<x.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const F=Kr(x,g);this.warn(`Fragment ${s.sn} of ${t} ${s.level} errored with ${i.details}, retrying loading ${g+1}/${x.maxNumRetry} in ${F}ms`),c.resolved=!0,this.retryDate=self.performance.now()+F,this.state=Gt.FRAG_LOADING_WAITING_RETRY}else if(x&&c)if(this.resetFragmentErrors(t),g<x.maxNumRetry)!l&&p!==Ar.RemoveAlternatePermanently&&(c.resolved=!0);else{this.warn(`${i.details} reached or exceeded max retry (${g})`);return}else p===Ar.SendAlternateToPenaltyBox?this.state=Gt.WAITING_LEVEL:this.state=Gt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(t){if(this.state===Gt.PARSING||this.state===Gt.PARSED){const i=t.frag,s=t.parent,o=this.getFwdBufferInfo(this.mediaBuffer,s),l=o&&o.len>.5;l&&this.reduceMaxBufferLength(o.len,(i==null?void 0:i.duration)||10);const c=!l;return c&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),i&&(this.fragmentTracker.removeFragment(i),this.nextLoadPosition=i.start),this.resetLoadingState(),c}return!1}resetFragmentErrors(t){t===$.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Gt.STOPPED&&(this.state=Gt.IDLE)}afterBufferFlushed(t,i,s){if(!t)return;const o=Vr.getBuffered(t);this.fragmentTracker.detectEvictedFragments(i,o,s),this.state===Gt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Gt.STOPPED&&(this.state=Gt.IDLE)}resetStartWhenNotLoaded(t){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const i=t?t.details:null;i!=null&&i.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(i,i.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.warn(`The loading context changed while buffering fragment ${t.sn} of ${this.playlistLabel()} ${t.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,i,s,o){const l=s.details;if(!l){this.warn("level.details undefined");return}if(!Object.keys(t.elementaryStreams).reduce((y,g)=>{const x=t.elementaryStreams[g];if(x){const S=x.endPTS-x.startPTS;if(S<=0)return this.warn(`Could not parse fragment ${t.sn} ${g} duration reliably (${S})`),y||!1;const R=o?0:Ca(l,t,x.startPTS,x.endPTS,x.startDTS,x.endDTS);return this.hls.trigger(E.LEVEL_PTS_UPDATED,{details:l,level:s,drift:R,type:g,frag:t,start:x.startPTS,end:x.endPTS}),!0}return y},!1)){var p;if(s.fragmentError===0&&this.treatAsGap(t,s),((p=this.transmuxer)==null?void 0:p.error)===null){const y=new Error(`Found no media in fragment ${t.sn} of ${this.playlistLabel()} ${t.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(y.message),this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!1,error:y,frag:t,reason:`Found no media in msn ${t.sn} of ${this.playlistLabel()} "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Gt.PARSED,this.log(`Parsed ${t.type} sn: ${t.sn}${i?" part: "+i.index:""} of ${this.fragInfo(t,!1,i)})`),this.hls.trigger(E.FRAG_PARSED,{frag:t,part:i})}playlistLabel(){return this.playlistType===$.MAIN?"level":"track"}fragInfo(t,i=!0,s){var o,l;return`${this.playlistLabel()} ${t.level} (${s?"part":"frag"}:[${((o=i&&!s?t.startPTS:(s||t).start)!=null?o:NaN).toFixed(3)}-${((l=i&&!s?t.endPTS:(s||t).end)!=null?l:NaN).toFixed(3)}]${s&&t.type==="main"?"INDEPENDENT="+(s.independent?"YES":"NO"):""}`}treatAsGap(t,i){i&&i.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)}resetTransmuxer(){var t;(t=this.transmuxer)==null||t.reset()}recoverWorkerError(t){t.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(t){const i=this._state;i!==t&&(this._state=t,this.log(`${i}->${t}`))}get state(){return this._state}}function wo(h){return!!h.interstitialsController&&h.enableInterstitialPlayback!==!1}class So{constructor(){this.chunks=[],this.dataLength=0}push(t){this.chunks.push(t),this.dataLength+=t.length}flush(){const{chunks:t,dataLength:i}=this;let s;if(t.length)t.length===1?s=t[0]:s=Eo(t,i);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function Eo(h,t){const i=new Uint8Array(t);let s=0;for(let o=0;o<h.length;o++){const l=h[o];i.set(l,s),s+=l.length}return i}var Gs={exports:{}},Qs;function rl(){return Qs||(Qs=1,function(h){var t=Object.prototype.hasOwnProperty,i="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1));function o(y,g,x){this.fn=y,this.context=g,this.once=x||!1}function l(y,g,x,S,R){if(typeof x!="function")throw new TypeError("The listener must be a function");var N=new o(x,S||y,R),F=i?i+g:g;return y._events[F]?y._events[F].fn?y._events[F]=[y._events[F],N]:y._events[F].push(N):(y._events[F]=N,y._eventsCount++),y}function c(y,g){--y._eventsCount===0?y._events=new s:delete y._events[g]}function p(){this._events=new s,this._eventsCount=0}p.prototype.eventNames=function(){var g=[],x,S;if(this._eventsCount===0)return g;for(S in x=this._events)t.call(x,S)&&g.push(i?S.slice(1):S);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(x)):g},p.prototype.listeners=function(g){var x=i?i+g:g,S=this._events[x];if(!S)return[];if(S.fn)return[S.fn];for(var R=0,N=S.length,F=new Array(N);R<N;R++)F[R]=S[R].fn;return F},p.prototype.listenerCount=function(g){var x=i?i+g:g,S=this._events[x];return S?S.fn?1:S.length:0},p.prototype.emit=function(g,x,S,R,N,F){var X=i?i+g:g;if(!this._events[X])return!1;var ne=this._events[X],Ce=arguments.length,qe,$e;if(ne.fn){switch(ne.once&&this.removeListener(g,ne.fn,void 0,!0),Ce){case 1:return ne.fn.call(ne.context),!0;case 2:return ne.fn.call(ne.context,x),!0;case 3:return ne.fn.call(ne.context,x,S),!0;case 4:return ne.fn.call(ne.context,x,S,R),!0;case 5:return ne.fn.call(ne.context,x,S,R,N),!0;case 6:return ne.fn.call(ne.context,x,S,R,N,F),!0}for($e=1,qe=new Array(Ce-1);$e<Ce;$e++)qe[$e-1]=arguments[$e];ne.fn.apply(ne.context,qe)}else{var ht=ne.length,mt;for($e=0;$e<ht;$e++)switch(ne[$e].once&&this.removeListener(g,ne[$e].fn,void 0,!0),Ce){case 1:ne[$e].fn.call(ne[$e].context);break;case 2:ne[$e].fn.call(ne[$e].context,x);break;case 3:ne[$e].fn.call(ne[$e].context,x,S);break;case 4:ne[$e].fn.call(ne[$e].context,x,S,R);break;default:if(!qe)for(mt=1,qe=new Array(Ce-1);mt<Ce;mt++)qe[mt-1]=arguments[mt];ne[$e].fn.apply(ne[$e].context,qe)}}return!0},p.prototype.on=function(g,x,S){return l(this,g,x,S,!1)},p.prototype.once=function(g,x,S){return l(this,g,x,S,!0)},p.prototype.removeListener=function(g,x,S,R){var N=i?i+g:g;if(!this._events[N])return this;if(!x)return c(this,N),this;var F=this._events[N];if(F.fn)F.fn===x&&(!R||F.once)&&(!S||F.context===S)&&c(this,N);else{for(var X=0,ne=[],Ce=F.length;X<Ce;X++)(F[X].fn!==x||R&&!F[X].once||S&&F[X].context!==S)&&ne.push(F[X]);ne.length?this._events[N]=ne.length===1?ne[0]:ne:c(this,N)}return this},p.prototype.removeAllListeners=function(g){var x;return g?(x=i?i+g:g,this._events[x]&&c(this,x)):(this._events=new s,this._eventsCount=0),this},p.prototype.off=p.prototype.removeListener,p.prototype.addListener=p.prototype.on,p.prefixed=i,p.EventEmitter=p,h.exports=p}(Gs)),Gs.exports}var fu=rl(),il=re(fu);const so="1.6.0",Da={};function Pl(){return typeof __HLS_WORKER_BUNDLE__=="function"}function pu(){const h=Da[so];if(h)return h.clientCount++,h;const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),i=self.URL.createObjectURL(t),o={worker:new self.Worker(i),objectURL:i,clientCount:1};return Da[so]=o,o}function Ao(h){const t=Da[h];if(t)return t.clientCount++,t;const i=new self.URL(h,self.location.href).href,o={worker:new self.Worker(i),scriptURL:i,clientCount:1};return Da[h]=o,o}function mu(h){const t=Da[h||so];if(t&&t.clientCount--===1){const{worker:s,objectURL:o}=t;delete Da[h||so],o&&self.URL.revokeObjectURL(o),s.terminate()}}function gu(h,t){return t+10<=h.length&&h[t]===51&&h[t+1]===68&&h[t+2]===73&&h[t+3]<255&&h[t+4]<255&&h[t+6]<128&&h[t+7]<128&&h[t+8]<128&&h[t+9]<128}function ko(h,t){return t+10<=h.length&&h[t]===73&&h[t+1]===68&&h[t+2]===51&&h[t+3]<255&&h[t+4]<255&&h[t+6]<128&&h[t+7]<128&&h[t+8]<128&&h[t+9]<128}function To(h,t){let i=0;return i=(h[t]&127)<<21,i|=(h[t+1]&127)<<14,i|=(h[t+2]&127)<<7,i|=h[t+3]&127,i}function ao(h,t){const i=t;let s=0;for(;ko(h,t);){s+=10;const o=To(h,t+6);s+=o,gu(h,t+10)&&(s+=10),t+=s}if(s>0)return h.subarray(i,i+s)}function ys(h,t,i,s){const o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],l=t[i+2],c=l>>2&15;if(c>12){const N=new Error(`invalid ADTS sampling index:${c}`);h.emit(E.ERROR,E.ERROR,{type:Le.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!0,error:N,reason:N.message});return}const p=(l>>6&3)+1,y=t[i+3]>>6&3|(l&1)<<2,g="mp4a.40."+p,x=o[c];let S=c;(p===5||p===29)&&(S-=3);const R=[p<<3|(S&14)>>1,(S&1)<<7|y<<3];return ve.log(`manifest codec:${s}, parsed codec:${g}, channels:${y}, rate:${x} (ADTS object type:${p} sampling index:${c})`),{config:R,samplerate:x,channelCount:y,codec:g,parsedCodec:g,manifestCodec:s}}function Bs(h,t){return h[t]===255&&(h[t+1]&246)===240}function Vs(h,t){return h[t+1]&1?7:9}function Ol(h,t){return(h[t+3]&3)<<11|h[t+4]<<3|(h[t+5]&224)>>>5}function vu(h,t){return t+5<h.length}function Co(h,t){return t+1<h.length&&Bs(h,t)}function n0(h,t){return vu(h,t)&&Bs(h,t)&&Ol(h,t)<=h.length-t}function Bl(h,t){if(Co(h,t)){const i=Vs(h,t);if(t+i>=h.length)return!1;const s=Ol(h,t);if(s<=i)return!1;const o=t+s;return o===h.length||Co(h,o)}return!1}function Fl(h,t,i,s,o){if(!h.samplerate){const l=ys(t,i,s,o);if(!l)return;k(h,l)}}function yu(h){return 1024*9e4/h}function bu(h,t){const i=Vs(h,t);if(t+i<=h.length){const s=Ol(h,t)-i;if(s>0)return{headerLength:i,frameLength:s}}}function nl(h,t,i,s,o){const l=yu(h.samplerate),c=s+o*l,p=bu(t,i);let y;if(p){const{frameLength:S,headerLength:R}=p,N=R+S,F=Math.max(0,i+N-t.length);F?(y=new Uint8Array(N-R),y.set(t.subarray(i+R,t.length),0)):y=t.subarray(i+R,i+N);const X={unit:y,pts:c};return F||h.samples.push(X),{sample:X,length:N,missing:F}}const g=t.length-i;return y=new Uint8Array(g),y.set(t.subarray(i,t.length),0),{sample:{unit:y,pts:c},length:g,missing:-1}}function _u(h,t){return ko(h,t)&&To(h,t+6)+10<=h.length-t}function Nl(h){if(h.size<2)return;const t=pt(h.data,!0),i=new Uint8Array(h.data.subarray(t.length+1));return{key:h.type,info:t,data:i.buffer}}function sl(h){if(h.size<2)return;if(h.type==="TXXX"){let i=1;const s=pt(h.data.subarray(i),!0);i+=s.length+1;const o=pt(h.data.subarray(i));return{key:h.type,info:s,data:o}}const t=pt(h.data.subarray(1));return{key:h.type,info:"",data:t}}function $l(h){if(h.type==="WXXX"){if(h.size<2)return;let i=1;const s=pt(h.data.subarray(i),!0);i+=s.length+1;const o=pt(h.data.subarray(i));return{key:h.type,info:s,data:o}}const t=pt(h.data);return{key:h.type,info:"",data:t}}function la(h){return btoa(String.fromCharCode(...h))}function al(h,t){if(h<0)return-al(-h,t);const i=Math.pow(10,t);if(Math.abs(h*i%1-.5)<Number.EPSILON){const o=Math.floor(h*i);return(o%2===0?o:o+1)/i}else return Math.round(h*i)/i}function xu(h,t){const i=new URL(h),s=new URL(t);if(i.origin!==s.origin)return h;const o=i.pathname.split("/").slice(1),l=s.pathname.split("/").slice(1,-1);for(;o[0]===l[0];)o.shift(),l.shift();for(;l.length;)l.shift(),o.unshift("..");return o.join("/")}function wu(){try{return crypto.randomUUID()}catch(h){try{const t=URL.createObjectURL(new Blob),i=t.toString();return URL.revokeObjectURL(t),i.slice(i.lastIndexOf("/")+1)}catch(t){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const l=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(o=="x"?l:l&3|8).toString(16)})}}}function Su(h){return h instanceof ArrayBuffer?h:h.byteOffset==0&&h.byteLength==h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer}function zl(h,t=0,i=1/0){return Do(h,t,i,Uint8Array)}function Do(h,t,i,s){const o=ol(h);let l=1;"BYTES_PER_ELEMENT"in s&&(l=s.BYTES_PER_ELEMENT);const c=Eu(h)?h.byteOffset:0,p=(c+h.byteLength)/l,y=(c+t)/l,g=Math.floor(Math.max(0,Math.min(y,p))),x=Math.floor(Math.min(g+Math.max(i,0),p));return new s(o,g,x-g)}function ol(h){return h instanceof ArrayBuffer?h:h.buffer}function Eu(h){return h&&h.buffer instanceof ArrayBuffer&&h.byteLength!==void 0&&h.byteOffset!==void 0}function s0(h){const t={key:h.type,description:"",data:"",mimeType:null,pictureType:null},i=3;if(h.size<2)return;if(h.data[0]!==i){console.log("Ignore frame with unrecognized character encoding");return}const s=h.data.subarray(1).indexOf(0);if(s===-1)return;const o=pt(zl(h.data,1,s)),l=h.data[2+s],c=h.data.subarray(3+s).indexOf(0);if(c===-1)return;const p=pt(zl(h.data,3+s,c));let y;return o==="-->"?y=pt(zl(h.data,4+s+c)):y=Su(h.data.subarray(4+s+c)),t.mimeType=o,t.pictureType=l,t.description=p,t.data=y,t}function a0(h){return h.type==="PRIV"?Nl(h):h.type[0]==="W"?$l(h):h.type==="APIC"?s0(h):sl(h)}function o0(h){const t=String.fromCharCode(h[0],h[1],h[2],h[3]),i=To(h,4),s=10;return{type:t,size:i,data:h.subarray(s,s+i)}}const oo=10,l0=10;function ua(h){let t=0;const i=[];for(;ko(h,t);){const s=To(h,t+6);h[t+5]>>6&1&&(t+=oo),t+=oo;const o=t+s;for(;t+l0<o;){const l=o0(h.subarray(t)),c=a0(l);c&&i.push(c),t+=l.size+oo}gu(h,t)&&(t+=oo)}return i}function ll(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"}function Ma(h){if(h.data.byteLength===8){const t=new Uint8Array(h.data),i=t[3]&1;let s=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return s/=45,i&&(s+=4772185884e-2),Math.round(s)}}function ul(h){const t=ua(h);for(let i=0;i<t.length;i++){const s=t[i];if(ll(s))return Ma(s)}}let Fs=function(h){return h.audioId3="org.id3",h.dateRange="com.apple.quicktime.HLS",h.emsg="https://aomedia.org/emsg/ID3",h.misbklv="urn:misb:KLV:bin:1910.1",h}({});function ke(h="",t=9e4){return{type:h,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class cl{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(t,i,s,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,i){return!1}appendFrame(t,i,s){}demux(t,i){this.cachedData&&(t=Fe(this.cachedData,t),this.cachedData=null);let s=ao(t,0),o=s?s.length:0,l;const c=this._audioTrack,p=this._id3Track,y=s?ul(s):void 0,g=t.length;for((this.basePTS===null||this.frameIndex===0&&pe(y))&&(this.basePTS=hl(y,i,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),s&&s.length>0&&p.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Fs.audioId3,duration:Number.POSITIVE_INFINITY});o<g;){if(this.canParse(t,o)){const x=this.appendFrame(c,t,o);x?(this.frameIndex++,this.lastPTS=x.sample.pts,o+=x.length,l=o):o=g}else _u(t,o)?(s=ao(t,o),p.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Fs.audioId3,duration:Number.POSITIVE_INFINITY}),o+=s.length,l=o):o++;if(o===g&&l!==g){const x=t.slice(l);this.cachedData?this.cachedData=Fe(this.cachedData,x):this.cachedData=x}}return{audioTrack:c,videoTrack:ke(),id3Track:p,textTrack:ke()}}demuxSampleAes(t,i,s){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(t){const i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),{audioTrack:this._audioTrack,videoTrack:ke(),id3Track:this._id3Track,textTrack:ke()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const hl=(h,t,i)=>{if(pe(h))return h*90;const s=i?i.baseTime*9e4/i.timescale:0;return t*9e4+s};let lo=null;const Au=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Ul=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],ku=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Tu=[0,1,1,4];function Cu(h,t,i,s,o){if(i+24>t.length)return;const l=Kl(t,i);if(l&&i+l.frameLength<=t.length){const c=l.samplesPerFrame*9e4/l.sampleRate,p=s+o*c,y={unit:t.subarray(i,i+l.frameLength),pts:p,dts:p};return h.config=[],h.channelCount=l.channelCount,h.samplerate=l.sampleRate,h.samples.push(y),{sample:y,length:l.frameLength,missing:0}}}function Kl(h,t){const i=h[t+1]>>3&3,s=h[t+1]>>1&3,o=h[t+2]>>4&15,l=h[t+2]>>2&3;if(i!==1&&o!==0&&o!==15&&l!==3){const c=h[t+2]>>1&1,p=h[t+3]>>6,y=i===3?3-s:s===3?3:4,g=Au[y*14+o-1]*1e3,S=Ul[(i===3?0:i===2?1:2)*3+l],R=p===3?1:2,N=ku[i][s],F=Tu[s],X=N*8*F,ne=Math.floor(N*g/S+c)*F;if(lo===null){const $e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);lo=$e?parseInt($e[1]):0}return!!lo&&lo<=87&&s===2&&g>=224e3&&p===0&&(h[t+3]=h[t+3]|128),{sampleRate:S,channelCount:R,frameLength:ne,samplesPerFrame:X}}}function dl(h,t){return h[t]===255&&(h[t+1]&224)===224&&(h[t+1]&6)!==0}function Mo(h,t){return t+1<h.length&&dl(h,t)}function Hl(h,t){return dl(h,t)&&4<=h.length-t}function fl(h,t){if(t+1<h.length&&dl(h,t)){const s=Kl(h,t);let o=4;s!=null&&s.frameLength&&(o=s.frameLength);const l=t+o;return l===h.length||Mo(h,l)}return!1}class Du extends cl{constructor(t,i){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=i}resetInitSegment(t,i,s,o){super.resetInitSegment(t,i,s,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}static probe(t,i){if(!t)return!1;const s=ao(t,0);let o=(s==null?void 0:s.length)||0;if(fl(t,o))return!1;for(let l=t.length;o<l;o++)if(Bl(t,o))return i.log("ADTS sync word found !"),!0;return!1}canParse(t,i){return n0(t,i)}appendFrame(t,i,s){Fl(t,this.observer,i,s,t.manifestCodec);const o=nl(t,i,s,this.basePTS,this.frameIndex);if(o&&o.missing===0)return o}}const Mu=(h,t)=>{let i=0,s=5;t+=s;const o=new Uint32Array(1),l=new Uint32Array(1),c=new Uint8Array(1);for(;s>0;){c[0]=h[t];const p=Math.min(s,8),y=8-p;l[0]=4278190080>>>24+y<<y,o[0]=(c[0]&l[0])>>y,i=i?i<<p|o[0]:o[0],t+=1,s-=p}return i};class u0 extends cl{constructor(t){super(),this.observer=void 0,this.observer=t}resetInitSegment(t,i,s,o){super.resetInitSegment(t,i,s,o),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}canParse(t,i){return i+64<t.length}appendFrame(t,i,s){const o=Gl(t,i,s,this.basePTS,this.frameIndex);if(o!==-1)return{sample:t.samples[t.samples.length-1],length:o,missing:0}}static probe(t){if(!t)return!1;const i=ao(t,0);if(!i)return!1;const s=i.length;return t[s]===11&&t[s+1]===119&&ul(i)!==void 0&&Mu(t,s)<16}}function Gl(h,t,i,s,o){if(i+8>t.length||t[i]!==11||t[i+1]!==119)return-1;const l=t[i+4]>>6;if(l>=3)return-1;const p=[48e3,44100,32e3][l],y=t[i+4]&63,x=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][y*3+l]*2;if(i+x>t.length)return-1;const S=t[i+6]>>5;let R=0;S===2?R+=2:(S&1&&S!==1&&(R+=2),S&4&&(R+=2));const N=(t[i+6]<<8|t[i+7])>>12-R&1,X=[2,1,2,3,3,4,4,5][S]+N,ne=t[i+5]>>3,Ce=t[i+5]&7,qe=new Uint8Array([l<<6|ne<<1|Ce>>2,(Ce&3)<<6|S<<3|N<<2|y>>4,y<<4&224]),$e=1536/p*9e4,ht=s+o*$e,mt=t.subarray(i,i+x);return h.config=qe,h.channelCount=X,h.samplerate=p,h.samples.push({unit:mt,pts:ht}),x}class Ha extends cl{resetInitSegment(t,i,s,o){super.resetInitSegment(t,i,s,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;const i=ao(t,0);let s=(i==null?void 0:i.length)||0;if(i&&t[s]===11&&t[s+1]===119&&ul(i)!==void 0&&Mu(t,s)<=16)return!1;for(let o=t.length;s<o;s++)if(fl(t,s))return ve.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,i){return Hl(t,i)}appendFrame(t,i,s){if(this.basePTS!==null)return Cu(t,i,s,this.basePTS,this.frameIndex)}}const Lo=/\/emsg[-/]ID3/i;class Lu{constructor(t,i){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=i}resetTimeStamp(){}resetInitSegment(t,i,s,o){const l=this.videoTrack=ke("video",1),c=this.audioTrack=ke("audio",1),p=this.txtTrack=ke("text",1);if(this.id3Track=ke("id3",1),this.timeOffset=0,!(t!=null&&t.byteLength))return;const y=Ct(t);if(y.video){const{id:g,timescale:x,codec:S,supplemental:R}=y.video;l.id=g,l.timescale=p.timescale=x,l.codec=S,l.supplemental=R}if(y.audio){const{id:g,timescale:x,codec:S}=y.audio;c.id=g,c.timescale=x,c.codec=S}p.id=Ot.text,l.sampleDuration=0,l.duration=c.duration=o}resetContiguity(){this.remainderData=null}static probe(t){return Ze(t)}demux(t,i){this.timeOffset=i;let s=t;const o=this.videoTrack,l=this.txtTrack;if(this.config.progressive){this.remainderData&&(s=Fe(this.remainderData,t));const p=_r(s);this.remainderData=p.remainder,o.samples=p.valid||new Uint8Array}else o.samples=s;const c=this.extractID3Track(o,i);return l.samples=Ge(i,o),{videoTrack:o,audioTrack:this.audioTrack,id3Track:c,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,i=this.videoTrack,s=this.txtTrack;i.samples=this.remainderData||new Uint8Array,this.remainderData=null;const o=this.extractID3Track(i,this.timeOffset);return s.samples=Ge(t,i),{videoTrack:i,audioTrack:ke(),id3Track:o,textTrack:ke()}}extractID3Track(t,i){const s=this.id3Track;if(t.samples.length){const o=nt(t.samples,["emsg"]);o&&o.forEach(l=>{const c=rr(l);if(Lo.test(c.schemeIdUri)){const p=c0(c,i);let y=c.eventDuration===4294967295?Number.POSITIVE_INFINITY:c.eventDuration/c.timeScale;y<=.001&&(y=Number.POSITIVE_INFINITY);const g=c.payload;s.samples.push({data:g,len:g.byteLength,dts:p,pts:p,type:Fs.emsg,duration:y})}else if(this.config.enableEmsgKLVMetadata&&c.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const p=c0(c,i);s.samples.push({data:c.payload,len:c.payload.byteLength,dts:p,pts:p,type:Fs.misbklv,duration:Number.POSITIVE_INFINITY})}})}return s}demuxSampleAes(t,i,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function c0(h,t){return pe(h.presentationTime)?h.presentationTime/h.timeScale:t+h.presentationTimeDelta/h.timeScale}class H{constructor(t,i,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new Gn(i,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,Hr.cbc)}decryptAacSample(t,i,s){const o=t[i].unit;if(o.length<=16)return;const l=o.subarray(16,o.length-o.length%16),c=l.buffer.slice(l.byteOffset,l.byteOffset+l.length);this.decryptBuffer(c).then(p=>{const y=new Uint8Array(p);o.set(y,16),this.decrypter.isSync()||this.decryptAacSamples(t,i+1,s)})}decryptAacSamples(t,i,s){for(;;i++){if(i>=t.length){s();return}if(!(t[i].unit.length<32)&&(this.decryptAacSample(t,i,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const i=Math.floor((t.length-48)/160)*16+16,s=new Int8Array(i);let o=0;for(let l=32;l<t.length-16;l+=160,o+=16)s.set(t.subarray(l,l+16),o);return s}getAvcDecryptedUnit(t,i){const s=new Uint8Array(i);let o=0;for(let l=32;l<t.length-16;l+=160,o+=16)t.set(s.subarray(o,o+16),l);return t}decryptAvcSample(t,i,s,o,l){const c=zt(l.data),p=this.getAvcEncryptedData(c);this.decryptBuffer(p.buffer).then(y=>{l.data=this.getAvcDecryptedUnit(c,y),this.decrypter.isSync()||this.decryptAvcSamples(t,i,s+1,o)})}decryptAvcSamples(t,i,s,o){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;i++,s=0){if(i>=t.length){o();return}const l=t[i].units;for(;!(s>=l.length);s++){const c=l[s];if(!(c.data.length<=48||c.type!==1&&c.type!==5)&&(this.decryptAvcSample(t,i,s,o,c),!this.decrypter.isSync()))return}}}}class m{constructor(){this.VideoSample=null}createVideoSample(t,i,s){return{key:t,frame:!1,pts:i,dts:s,units:[],length:0}}getLastNalUnit(t){var i;let s=this.VideoSample,o;if((!s||s.units.length===0)&&(s=t[t.length-1]),(i=s)!=null&&i.units){const l=s.units;o=l[l.length-1]}return o}pushAccessUnit(t,i){if(t.units.length&&t.frame){if(t.pts===void 0){const s=i.samples,o=s.length;if(o){const l=s[o-1];t.pts=l.pts,t.dts=l.dts}else{i.dropped++;return}}i.samples.push(t)}}parseNALu(t,i,s){const o=i.byteLength;let l=t.naluState||0;const c=l,p=[];let y=0,g,x,S,R=-1,N=0;for(l===-1&&(R=0,N=this.getNALuType(i,0),l=0,y=1);y<o;){if(g=i[y++],!l){l=g?0:1;continue}if(l===1){l=g?0:2;continue}if(!g)l=3;else if(g===1){if(x=y-l-1,R>=0){const F={data:i.subarray(R,x),type:N};p.push(F)}else{const F=this.getLastNalUnit(t.samples);F&&(c&&y<=4-c&&F.state&&(F.data=F.data.subarray(0,F.data.byteLength-c)),x>0&&(F.data=Fe(F.data,i.subarray(0,x)),F.state=0))}y<o?(S=this.getNALuType(i,y),R=y,N=S,l=0):l=-1}else l=0}if(R>=0&&l>=0){const F={data:i.subarray(R,o),type:N,state:l};p.push(F)}if(p.length===0){const F=this.getLastNalUnit(t.samples);F&&(F.data=Fe(F.data,i))}return t.naluState=l,p}}class b{constructor(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const t=this.data,i=this.bytesAvailable,s=t.byteLength-i,o=new Uint8Array(4),l=Math.min(4,i);if(l===0)throw new Error("no bytes available");o.set(t.subarray(s,s+l)),this.word=new DataView(o.buffer).getUint32(0),this.bitsAvailable=l*8,this.bytesAvailable-=l}skipBits(t){let i;t=Math.min(t,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,i=t>>3,t-=i<<3,this.bytesAvailable-=i,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let i=Math.min(this.bitsAvailable,t);const s=this.word>>>32-i;if(t>32&&ve.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=i,this.bitsAvailable>0)this.word<<=i;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return i=t-i,i>0&&this.bitsAvailable?s<<i|this.readBits(i):s}skipLZ(){let t;for(t=0;t<this.bitsAvailable;++t)if(this.word&2147483648>>>t)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class _ extends m{parsePES(t,i,s,o){const l=this.parseNALu(t,s.data,o);let c=this.VideoSample,p,y=!1;s.data=null,c&&l.length&&!t.audFound&&(this.pushAccessUnit(c,t),c=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),l.forEach(g=>{var x,S;switch(g.type){case 1:{let X=!1;p=!0;const ne=g.data;if(y&&ne.length>4){const Ce=this.readSliceType(ne);(Ce===2||Ce===4||Ce===7||Ce===9)&&(X=!0)}if(X){var R;(R=c)!=null&&R.frame&&!c.key&&(this.pushAccessUnit(c,t),c=this.VideoSample=null)}c||(c=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),c.frame=!0,c.key=X;break}case 5:p=!0,(x=c)!=null&&x.frame&&!c.key&&(this.pushAccessUnit(c,t),c=this.VideoSample=null),c||(c=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),c.key=!0,c.frame=!0;break;case 6:{p=!0,kt(g.data,1,s.pts,i.samples);break}case 7:{var N,F;p=!0,y=!0;const X=g.data,ne=this.readSPS(X);if(!t.sps||t.width!==ne.width||t.height!==ne.height||((N=t.pixelRatio)==null?void 0:N[0])!==ne.pixelRatio[0]||((F=t.pixelRatio)==null?void 0:F[1])!==ne.pixelRatio[1]){t.width=ne.width,t.height=ne.height,t.pixelRatio=ne.pixelRatio,t.sps=[X];const Ce=X.subarray(1,4);let qe="avc1.";for(let $e=0;$e<3;$e++){let ht=Ce[$e].toString(16);ht.length<2&&(ht="0"+ht),qe+=ht}t.codec=qe}break}case 8:p=!0,t.pps=[g.data];break;case 9:p=!0,t.audFound=!0,(S=c)!=null&&S.frame&&(this.pushAccessUnit(c,t),c=null),c||(c=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;case 12:p=!0;break;default:p=!1;break}c&&p&&c.units.push(g)}),o&&c&&(this.pushAccessUnit(c,t),this.VideoSample=null)}getNALuType(t,i){return t[i]&31}readSliceType(t){const i=new b(t);return i.readUByte(),i.readUEG(),i.readUEG()}skipScalingList(t,i){let s=8,o=8,l;for(let c=0;c<t;c++)o!==0&&(l=i.readEG(),o=(s+l+256)%256),s=o===0?s:o}readSPS(t){const i=new b(t);let s=0,o=0,l=0,c=0,p,y,g;const x=i.readUByte.bind(i),S=i.readBits.bind(i),R=i.readUEG.bind(i),N=i.readBoolean.bind(i),F=i.skipBits.bind(i),X=i.skipEG.bind(i),ne=i.skipUEG.bind(i),Ce=this.skipScalingList.bind(this);x();const qe=x();if(S(5),F(3),x(),ne(),qe===100||qe===110||qe===122||qe===244||qe===44||qe===83||qe===86||qe===118||qe===128){const Tt=R();if(Tt===3&&F(1),ne(),ne(),F(1),N())for(y=Tt!==3?8:12,g=0;g<y;g++)N()&&(g<6?Ce(16,i):Ce(64,i))}ne();const $e=R();if($e===0)R();else if($e===1)for(F(1),X(),X(),p=R(),g=0;g<p;g++)X();ne(),F(1);const ht=R(),mt=R(),Nt=S(1);Nt===0&&F(1),F(1),N()&&(s=R(),o=R(),l=R(),c=R());let gt=[1,1];if(N()&&N())switch(x()){case 1:gt=[1,1];break;case 2:gt=[12,11];break;case 3:gt=[10,11];break;case 4:gt=[16,11];break;case 5:gt=[40,33];break;case 6:gt=[24,11];break;case 7:gt=[20,11];break;case 8:gt=[32,11];break;case 9:gt=[80,33];break;case 10:gt=[18,11];break;case 11:gt=[15,11];break;case 12:gt=[64,33];break;case 13:gt=[160,99];break;case 14:gt=[4,3];break;case 15:gt=[3,2];break;case 16:gt=[2,1];break;case 255:{gt=[x()<<8|x(),x()<<8|x()];break}}return{width:Math.ceil((ht+1)*16-s*2-o*2),height:(2-Nt)*(mt+1)*16-(Nt?2:4)*(l+c),pixelRatio:gt}}}class w extends m{constructor(...t){super(...t),this.initVPS=null}parsePES(t,i,s,o){const l=this.parseNALu(t,s.data,o);let c=this.VideoSample,p,y=!1;s.data=null,c&&l.length&&!t.audFound&&(this.pushAccessUnit(c,t),c=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),l.forEach(g=>{var x,S;switch(g.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:c||(c=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),c.frame=!0,p=!0;break;case 16:case 17:case 18:case 21:if(p=!0,y){var R;(R=c)!=null&&R.frame&&!c.key&&(this.pushAccessUnit(c,t),c=this.VideoSample=null)}c||(c=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),c.key=!0,c.frame=!0;break;case 19:case 20:p=!0,(x=c)!=null&&x.frame&&!c.key&&(this.pushAccessUnit(c,t),c=this.VideoSample=null),c||(c=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),c.key=!0,c.frame=!0;break;case 39:p=!0,kt(g.data,2,s.pts,i.samples);break;case 32:p=!0,t.vps||(typeof t.params!="object"&&(t.params={}),t.params=k(t.params,this.readVPS(g.data)),this.initVPS=g.data),t.vps=[g.data];break;case 33:if(p=!0,y=!0,t.vps!==void 0&&t.vps[0]!==this.initVPS&&t.sps!==void 0&&!this.matchSPS(t.sps[0],g.data)&&(this.initVPS=t.vps[0],t.sps=t.pps=void 0),!t.sps){const N=this.readSPS(g.data);t.width=N.width,t.height=N.height,t.pixelRatio=N.pixelRatio,t.codec=N.codecString,t.sps=[],typeof t.params!="object"&&(t.params={});for(const F in N.params)t.params[F]=N.params[F]}this.pushParameterSet(t.sps,g.data,t.vps),c||(c=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),c.key=!0;break;case 34:if(p=!0,typeof t.params=="object"){if(!t.pps){t.pps=[];const N=this.readPPS(g.data);for(const F in N)t.params[F]=N[F]}this.pushParameterSet(t.pps,g.data,t.vps)}break;case 35:p=!0,t.audFound=!0,(S=c)!=null&&S.frame&&(this.pushAccessUnit(c,t),c=null),c||(c=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;default:p=!1;break}c&&p&&c.units.push(g)}),o&&c&&(this.pushAccessUnit(c,t),this.VideoSample=null)}pushParameterSet(t,i,s){(s&&s[0]===this.initVPS||!s&&!t.length)&&t.push(i)}getNALuType(t,i){return(t[i]&126)>>>1}ebsp2rbsp(t){const i=new Uint8Array(t.byteLength);let s=0;for(let o=0;o<t.byteLength;o++)o>=2&&t[o]===3&&t[o-1]===0&&t[o-2]===0||(i[s]=t[o],s++);return new Uint8Array(i.buffer,0,s)}pushAccessUnit(t,i){super.pushAccessUnit(t,i),this.initVPS&&(this.initVPS=null)}readVPS(t){const i=new b(t);i.readUByte(),i.readUByte(),i.readBits(4),i.skipBits(2),i.readBits(6);const s=i.readBits(3),o=i.readBoolean();return{numTemporalLayers:s+1,temporalIdNested:o}}readSPS(t){const i=new b(this.ebsp2rbsp(t));i.readUByte(),i.readUByte(),i.readBits(4);const s=i.readBits(3);i.readBoolean();const o=i.readBits(2),l=i.readBoolean(),c=i.readBits(5),p=i.readUByte(),y=i.readUByte(),g=i.readUByte(),x=i.readUByte(),S=i.readUByte(),R=i.readUByte(),N=i.readUByte(),F=i.readUByte(),X=i.readUByte(),ne=i.readUByte(),Ce=i.readUByte(),qe=[],$e=[];for(let on=0;on<s;on++)qe.push(i.readBoolean()),$e.push(i.readBoolean());if(s>0)for(let on=s;on<8;on++)i.readBits(2);for(let on=0;on<s;on++)qe[on]&&(i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte()),$e[on]&&i.readUByte();i.readUEG();const ht=i.readUEG();ht==3&&i.skipBits(1);const mt=i.readUEG(),Nt=i.readUEG(),gt=i.readBoolean();let Tt=0,Vt=0,bt=0,dr=0;gt&&(Tt+=i.readUEG(),Vt+=i.readUEG(),bt+=i.readUEG(),dr+=i.readUEG());const Ir=i.readUEG(),Ei=i.readUEG(),wi=i.readUEG(),hi=i.readBoolean();for(let on=hi?0:s;on<=s;on++)i.skipUEG(),i.skipUEG(),i.skipUEG();if(i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.readBoolean()&&i.readBoolean())for(let Ks=0;Ks<4;Ks++)for(let ka=0;ka<(Ks===3?2:6);ka++)if(!i.readBoolean())i.readUEG();else{const Zs=Math.min(64,1<<4+(Ks<<1));Ks>1&&i.readEG();for(let Tl=0;Tl<Zs;Tl++)i.readEG()}i.readBoolean(),i.readBoolean(),i.readBoolean()&&(i.readUByte(),i.skipUEG(),i.skipUEG(),i.readBoolean());const ti=i.readUEG();let mr=0;for(let on=0;on<ti;on++){let Ks=!1;if(on!==0&&(Ks=i.readBoolean()),Ks){on===ti&&i.readUEG(),i.readBoolean(),i.readUEG();let ka=0;for(let kl=0;kl<=mr;kl++){const Zs=i.readBoolean();let Tl=!1;Zs||(Tl=i.readBoolean()),(Zs||Tl)&&ka++}mr=ka}else{const ka=i.readUEG(),kl=i.readUEG();mr=ka+kl;for(let Zs=0;Zs<ka;Zs++)i.readUEG(),i.readBoolean();for(let Zs=0;Zs<kl;Zs++)i.readUEG(),i.readBoolean()}}if(i.readBoolean()){const on=i.readUEG();for(let Ks=0;Ks<on;Ks++){for(let ka=0;ka<wi+4;ka++)i.readBits(1);i.readBits(1)}}let Ci=0,yi=1,Zi=1,dn=!0,fn=1,Sn=0;i.readBoolean(),i.readBoolean();let es=!1;if(i.readBoolean()){if(i.readBoolean()){const Ya=i.readUByte(),ou=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Wu=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Ya>0&&Ya<16?(yi=ou[Ya-1],Zi=Wu[Ya-1]):Ya===255&&(yi=i.readBits(16),Zi=i.readBits(16))}if(i.readBoolean()&&i.readBoolean(),i.readBoolean()&&(i.readBits(3),i.readBoolean(),i.readBoolean()&&(i.readUByte(),i.readUByte(),i.readUByte())),i.readBoolean()&&(i.readUEG(),i.readUEG()),i.readBoolean(),i.readBoolean(),i.readBoolean(),es=i.readBoolean(),es&&(Tt+=i.readUEG(),Vt+=i.readUEG(),bt+=i.readUEG(),dr+=i.readUEG()),i.readBoolean()&&(fn=i.readBits(32),Sn=i.readBits(32),i.readBoolean()&&i.readUEG(),i.readBoolean())){const Wu=i.readBoolean(),Cl=i.readBoolean();let Uo=!1;(Wu||Cl)&&(Uo=i.readBoolean(),Uo&&(i.readUByte(),i.readBits(5),i.readBoolean(),i.readBits(5)),i.readBits(4),i.readBits(4),Uo&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5));for(let P0=0;P0<=s;P0++){dn=i.readBoolean();const Pd=dn||i.readBoolean();let bh=!1;Pd?i.readEG():bh=i.readBoolean();const O0=bh?1:i.readUEG()+1;if(Wu)for(let Ko=0;Ko<O0;Ko++)i.readUEG(),i.readUEG(),Uo&&(i.readUEG(),i.readUEG()),i.skipBits(1);if(Cl)for(let Ko=0;Ko<O0;Ko++)i.readUEG(),i.readUEG(),Uo&&(i.readUEG(),i.readUEG()),i.skipBits(1)}}i.readBoolean()&&(i.readBoolean(),i.readBoolean(),i.readBoolean(),Ci=i.readUEG())}let ma=mt,xc=Nt;if(gt||es){let on=1,Ks=1;ht===1?on=Ks=2:ht==2&&(on=2),ma=mt-on*Vt-on*Tt,xc=Nt-Ks*dr-Ks*bt}const Rd=o?["A","B","C"][o]:"",Id=p<<24|y<<16|g<<8|x;let I0=0;for(let on=0;on<32;on++)I0=(I0|(Id>>on&1)<<31-on)>>>0;let wc=I0.toString(16);return c===1&&wc==="2"&&(wc="6"),{codecString:`hvc1.${Rd}${c}.${wc}.${l?"H":"L"}${Ce}.B0`,params:{general_tier_flag:l,general_profile_idc:c,general_profile_space:o,general_profile_compatibility_flags:[p,y,g,x],general_constraint_indicator_flags:[S,R,N,F,X,ne],general_level_idc:Ce,bit_depth:Ir+8,bit_depth_luma_minus8:Ir,bit_depth_chroma_minus8:Ei,min_spatial_segmentation_idc:Ci,chroma_format_idc:ht,frame_rate:{fixed:dn,fps:Sn/fn}},width:ma,height:xc,pixelRatio:[yi,Zi]}}readPPS(t){const i=new b(this.ebsp2rbsp(t));i.readUByte(),i.readUByte(),i.skipUEG(),i.skipUEG(),i.skipBits(2),i.skipBits(3),i.skipBits(2),i.skipUEG(),i.skipUEG(),i.skipEG(),i.skipBits(2),i.readBoolean()&&i.skipUEG(),i.skipEG(),i.skipEG(),i.skipBits(4);const o=i.readBoolean(),l=i.readBoolean();let c=1;return l&&o?c=0:l?c=3:o&&(c=2),{parallelismType:c}}matchSPS(t,i){return String.fromCharCode.apply(null,t).substr(3)===String.fromCharCode.apply(null,i).substr(3)}}const I=188;class U{constructor(t,i,s,o){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=t,this.config=i,this.typeSupported=s,this.logger=o,this.videoParser=null}static probe(t,i){const s=U.syncOffset(t);return s>0&&i.warn(`MPEG2-TS detected but first sync word found @ offset ${s}`),s!==-1}static syncOffset(t){const i=t.length;let s=Math.min(I*5,i-I)+1,o=0;for(;o<s;){let l=!1,c=-1,p=0;for(let y=o;y<i;y+=I)if(t[y]===71&&(i-y===I||t[y+I]===71)){if(p++,c===-1&&(c=y,c!==0&&(s=Math.min(c+I*99,t.length-I)+1)),l||(l=le(t,y)===0),l&&p>1&&(c===0&&p>2||y+I>s))return c}else{if(p)return-1;break}o++}return-1}static createTrack(t,i){return{container:t==="video"||t==="audio"?"video/mp2t":void 0,type:t,id:Ot[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:t==="audio"?i:void 0}}resetInitSegment(t,i,s,o){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=U.createTrack("video"),this._videoTrack.duration=o,this._audioTrack=U.createTrack("audio",o),this._id3Track=U.createTrack("id3"),this._txtTrack=U.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=i,this.videoCodec=s}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_videoTrack:i,_id3Track:s}=this;t&&(t.pesData=null),i&&(i.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(t,i,s=!1,o=!1){s||(this.sampleAes=null);let l;const c=this._videoTrack,p=this._audioTrack,y=this._id3Track,g=this._txtTrack;let x=c.pid,S=c.pesData,R=p.pid,N=y.pid,F=p.pesData,X=y.pesData,ne=null,Ce=this.pmtParsed,qe=this._pmtId,$e=t.length;if(this.remainderData&&(t=Fe(this.remainderData,t),$e=t.length,this.remainderData=null),$e<I&&!o)return this.remainderData=t,{audioTrack:p,videoTrack:c,id3Track:y,textTrack:g};const ht=Math.max(0,U.syncOffset(t));$e-=($e-ht)%I,$e<t.byteLength&&!o&&(this.remainderData=new Uint8Array(t.buffer,$e,t.buffer.byteLength-$e));let mt=0;for(let gt=ht;gt<$e;gt+=I)if(t[gt]===71){const Tt=!!(t[gt+1]&64),Vt=le(t,gt),bt=(t[gt+3]&48)>>4;let dr;if(bt>1){if(dr=gt+5+t[gt+4],dr===gt+I)continue}else dr=gt+4;switch(Vt){case x:if(Tt){if(S&&(l=It(S,this.logger))){if(this.videoParser===null)switch(c.segmentCodec){case"avc":this.videoParser=new _;break;case"hevc":this.videoParser=new w;break}this.videoParser!==null&&this.videoParser.parsePES(c,g,l,!1)}S={data:[],size:0}}S&&(S.data.push(t.subarray(dr,gt+I)),S.size+=gt+I-dr);break;case R:if(Tt){if(F&&(l=It(F,this.logger)))switch(p.segmentCodec){case"aac":this.parseAACPES(p,l);break;case"mp3":this.parseMPEGPES(p,l);break;case"ac3":this.parseAC3PES(p,l);break}F={data:[],size:0}}F&&(F.data.push(t.subarray(dr,gt+I)),F.size+=gt+I-dr);break;case N:Tt&&(X&&(l=It(X,this.logger))&&this.parseID3PES(y,l),X={data:[],size:0}),X&&(X.data.push(t.subarray(dr,gt+I)),X.size+=gt+I-dr);break;case 0:Tt&&(dr+=t[dr]+1),qe=this._pmtId=Ee(t,dr);break;case qe:{Tt&&(dr+=t[dr]+1);const Ir=Be(t,dr,this.typeSupported,s,this.observer,this.logger);x=Ir.videoPid,x>0&&(c.pid=x,c.segmentCodec=Ir.segmentVideoCodec),R=Ir.audioPid,R>0&&(p.pid=R,p.segmentCodec=Ir.segmentAudioCodec),N=Ir.id3Pid,N>0&&(y.pid=N),ne!==null&&!Ce&&(this.logger.warn(`MPEG-TS PMT found at ${gt} after unknown PID '${ne}'. Backtracking to sync byte @${ht} to parse all TS packets.`),ne=null,gt=ht-188),Ce=this.pmtParsed=!0;break}case 17:case 8191:break;default:ne=Vt;break}}else mt++;mt>0&&st(this.observer,new Error(`Found ${mt} TS packet/s that do not start with 0x47`),void 0,this.logger),c.pesData=S,p.pesData=F,y.pesData=X;const Nt={audioTrack:p,videoTrack:c,id3Track:y,textTrack:g};return o&&this.extractRemainingSamples(Nt),Nt}flush(){const{remainderData:t}=this;this.remainderData=null;let i;return t?i=this.demux(t,-1,!1,!0):i={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(i),this.sampleAes?this.decrypt(i,this.sampleAes):i}extractRemainingSamples(t){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:l}=t,c=s.pesData,p=i.pesData,y=o.pesData;let g;if(c&&(g=It(c,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new _;break;case"hevc":this.videoParser=new w;break}this.videoParser!==null&&(this.videoParser.parsePES(s,l,g,!0),s.pesData=null)}else s.pesData=c;if(p&&(g=It(p,this.logger))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,g);break;case"mp3":this.parseMPEGPES(i,g);break;case"ac3":this.parseAC3PES(i,g);break}i.pesData=null}else p!=null&&p.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=p;y&&(g=It(y,this.logger))?(this.parseID3PES(o,g),o.pesData=null):o.pesData=y}demuxSampleAes(t,i,s){const o=this.demux(t,s,!0,!this.config.progressive),l=this.sampleAes=new H(this.observer,this.config,i);return this.decrypt(o,l)}decrypt(t,i){return new Promise(s=>{const{audioTrack:o,videoTrack:l}=t;o.samples&&o.segmentCodec==="aac"?i.decryptAacSamples(o.samples,0,()=>{l.samples?i.decryptAvcSamples(l.samples,0,0,()=>{s(t)}):s(t)}):l.samples&&i.decryptAvcSamples(l.samples,0,0,()=>{s(t)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(t,i){let s=0;const o=this.aacOverFlow;let l=i.data;if(o){this.aacOverFlow=null;const S=o.missing,R=o.sample.unit.byteLength;if(S===-1)l=Fe(o.sample.unit,l);else{const N=R-S;o.sample.unit.set(l.subarray(0,S),N),t.samples.push(o.sample),s=o.missing}}let c,p;for(c=s,p=l.length;c<p-1&&!Co(l,c);c++);if(c!==s){let S;const R=c<p-1;if(R?S=`AAC PES did not start with ADTS header,offset:${c}`:S="No ADTS header found in AAC PES",st(this.observer,new Error(S),R,this.logger),!R)return}Fl(t,this.observer,l,c,this.audioCodec);let y;if(i.pts!==void 0)y=i.pts;else if(o){const S=yu(t.samplerate);y=o.sample.pts+S}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let g=0,x;for(;c<p;)if(x=nl(t,l,c,y,g),c+=x.length,x.missing){this.aacOverFlow=x;break}else for(g++;c<p-1&&!Co(l,c);c++);}parseMPEGPES(t,i){const s=i.data,o=s.length;let l=0,c=0;const p=i.pts;if(p===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<o;)if(Mo(s,c)){const y=Cu(t,s,c,p,l);if(y)c+=y.length,l++;else break}else c++}parseAC3PES(t,i){{const s=i.data,o=i.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const l=s.length;let c=0,p=0,y;for(;p<l&&(y=Gl(t,s,p,o,c++))>0;)p+=y}}parseID3PES(t,i){if(i.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=k({},i,{type:this._videoTrack?Fs.emsg:Fs.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(s)}}function le(h,t){return((h[t+1]&31)<<8)+h[t+2]}function Ee(h,t){return(h[t+10]&31)<<8|h[t+11]}function Be(h,t,i,s,o,l){const c={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},p=(h[t+1]&15)<<8|h[t+2],y=t+3+p-4,g=(h[t+10]&15)<<8|h[t+11];for(t+=12+g;t<y;){const x=le(h,t),S=(h[t+3]&15)<<8|h[t+4];switch(h[t]){case 207:if(!s){yt("ADTS AAC",l);break}case 15:c.audioPid===-1&&(c.audioPid=x);break;case 21:c.id3Pid===-1&&(c.id3Pid=x);break;case 219:if(!s){yt("H.264",l);break}case 27:c.videoPid===-1&&(c.videoPid=x);break;case 3:case 4:!i.mpeg&&!i.mp3?l.log("MPEG audio found, not supported in this browser"):c.audioPid===-1&&(c.audioPid=x,c.segmentAudioCodec="mp3");break;case 193:if(!s){yt("AC-3",l);break}case 129:i.ac3?c.audioPid===-1&&(c.audioPid=x,c.segmentAudioCodec="ac3"):l.log("AC-3 audio found, not supported in this browser");break;case 6:if(c.audioPid===-1&&S>0){let R=t+5,N=S;for(;N>2;){switch(h[R]){case 106:i.ac3!==!0?l.log("AC-3 audio found, not supported in this browser for now"):(c.audioPid=x,c.segmentAudioCodec="ac3");break}const X=h[R+1]+2;R+=X,N-=X}}break;case 194:case 135:return st(o,new Error("Unsupported EC-3 in M2TS found"),void 0,l),c;case 36:c.videoPid===-1&&(c.videoPid=x,c.segmentVideoCodec="hevc",l.log("HEVC in M2TS found"));break}t+=S+5}return c}function st(h,t,i,s){s.warn(`parsing error: ${t.message}`),h.emit(E.ERROR,E.ERROR,{type:Le.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:t,reason:t.message})}function yt(h,t){t.log(`${h} with AES-128-CBC encryption found in unencrypted stream`)}function It(h,t){let i=0,s,o,l,c,p;const y=h.data;if(!h||h.size===0)return null;for(;y[0].length<19&&y.length>1;)y[0]=Fe(y[0],y[1]),y.splice(1,1);if(s=y[0],(s[0]<<16)+(s[1]<<8)+s[2]===1){if(o=(s[4]<<8)+s[5],o&&o>h.size-6)return null;const x=s[7];x&192&&(c=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,x&64?(p=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,c-p>60*9e4&&(t.warn(`${Math.round((c-p)/9e4)}s delta between PTS and DTS, align them`),c=p)):p=c),l=s[8];let S=l+9;if(h.size<=S)return null;h.size-=S;const R=new Uint8Array(h.size);for(let N=0,F=y.length;N<F;N++){s=y[N];let X=s.byteLength;if(S)if(S>X){S-=X;continue}else s=s.subarray(S),X-=S,S=0;R.set(s,i),i+=X}return o&&(o-=l+3),{data:R,pts:c,dts:p,len:o}}return null}class Qt{static getSilentFrame(t,i){switch(t){case"mp4a.40.2":if(i===1)return new Uint8Array([0,200,0,128,35,128]);if(i===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(i===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(i===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(i===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(i===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(i===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(i===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(i===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const tr=Math.pow(2,32)-1;class Ve{static init(){Ve.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let t;for(t in Ve.types)Ve.types.hasOwnProperty(t)&&(Ve.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);const i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),s=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);Ve.HDLR_TYPES={video:i,audio:s};const o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),l=new Uint8Array([0,0,0,0,0,0,0,0]);Ve.STTS=Ve.STSC=Ve.STCO=l,Ve.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ve.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ve.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Ve.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const c=new Uint8Array([105,115,111,109]),p=new Uint8Array([97,118,99,49]),y=new Uint8Array([0,0,0,1]);Ve.FTYP=Ve.box(Ve.types.ftyp,c,y,c,p),Ve.DINF=Ve.box(Ve.types.dinf,Ve.box(Ve.types.dref,o))}static box(t,...i){let s=8,o=i.length;const l=o;for(;o--;)s+=i[o].byteLength;const c=new Uint8Array(s);for(c[0]=s>>24&255,c[1]=s>>16&255,c[2]=s>>8&255,c[3]=s&255,c.set(t,4),o=0,s=8;o<l;o++)c.set(i[o],s),s+=i[o].byteLength;return c}static hdlr(t){return Ve.box(Ve.types.hdlr,Ve.HDLR_TYPES[t])}static mdat(t){return Ve.box(Ve.types.mdat,t)}static mdhd(t,i){i*=t;const s=Math.floor(i/(tr+1)),o=Math.floor(i%(tr+1));return Ve.box(Ve.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))}static mdia(t){return Ve.box(Ve.types.mdia,Ve.mdhd(t.timescale||0,t.duration||0),Ve.hdlr(t.type),Ve.minf(t))}static mfhd(t){return Ve.box(Ve.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255]))}static minf(t){return t.type==="audio"?Ve.box(Ve.types.minf,Ve.box(Ve.types.smhd,Ve.SMHD),Ve.DINF,Ve.stbl(t)):Ve.box(Ve.types.minf,Ve.box(Ve.types.vmhd,Ve.VMHD),Ve.DINF,Ve.stbl(t))}static moof(t,i,s){return Ve.box(Ve.types.moof,Ve.mfhd(t),Ve.traf(s,i))}static moov(t){let i=t.length;const s=[];for(;i--;)s[i]=Ve.trak(t[i]);return Ve.box.apply(null,[Ve.types.moov,Ve.mvhd(t[0].timescale||0,t[0].duration||0)].concat(s).concat(Ve.mvex(t)))}static mvex(t){let i=t.length;const s=[];for(;i--;)s[i]=Ve.trex(t[i]);return Ve.box.apply(null,[Ve.types.mvex,...s])}static mvhd(t,i){i*=t;const s=Math.floor(i/(tr+1)),o=Math.floor(i%(tr+1)),l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return Ve.box(Ve.types.mvhd,l)}static sdtp(t){const i=t.samples||[],s=new Uint8Array(4+i.length);let o,l;for(o=0;o<i.length;o++)l=i[o].flags,s[o+4]=l.dependsOn<<4|l.isDependedOn<<2|l.hasRedundancy;return Ve.box(Ve.types.sdtp,s)}static stbl(t){return Ve.box(Ve.types.stbl,Ve.stsd(t),Ve.box(Ve.types.stts,Ve.STTS),Ve.box(Ve.types.stsc,Ve.STSC),Ve.box(Ve.types.stsz,Ve.STSZ),Ve.box(Ve.types.stco,Ve.STCO))}static avc1(t){let i=[],s=[],o,l,c;for(o=0;o<t.sps.length;o++)l=t.sps[o],c=l.byteLength,i.push(c>>>8&255),i.push(c&255),i=i.concat(Array.prototype.slice.call(l));for(o=0;o<t.pps.length;o++)l=t.pps[o],c=l.byteLength,s.push(c>>>8&255),s.push(c&255),s=s.concat(Array.prototype.slice.call(l));const p=Ve.box(Ve.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(s))),y=t.width,g=t.height,x=t.pixelRatio[0],S=t.pixelRatio[1];return Ve.box(Ve.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,y>>8&255,y&255,g>>8&255,g&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),p,Ve.box(Ve.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ve.box(Ve.types.pasp,new Uint8Array([x>>24,x>>16&255,x>>8&255,x&255,S>>24,S>>16&255,S>>8&255,S&255])))}static esds(t){const i=t.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...i,6,1,2])}static audioStsd(t){const i=t.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount||0,0,16,0,0,0,0,i>>8&255,i&255,0,0])}static mp4a(t){return Ve.box(Ve.types.mp4a,Ve.audioStsd(t),Ve.box(Ve.types.esds,Ve.esds(t)))}static mp3(t){return Ve.box(Ve.types[".mp3"],Ve.audioStsd(t))}static ac3(t){return Ve.box(Ve.types["ac-3"],Ve.audioStsd(t),Ve.box(Ve.types.dac3,t.config))}static stsd(t){const{segmentCodec:i}=t;if(t.type==="audio"){if(i==="aac")return Ve.box(Ve.types.stsd,Ve.STSD,Ve.mp4a(t));if(i==="ac3"&&t.config)return Ve.box(Ve.types.stsd,Ve.STSD,Ve.ac3(t));if(i==="mp3"&&t.codec==="mp3")return Ve.box(Ve.types.stsd,Ve.STSD,Ve.mp3(t))}else if(t.pps&&t.sps){if(i==="avc")return Ve.box(Ve.types.stsd,Ve.STSD,Ve.avc1(t));if(i==="hevc"&&t.vps)return Ve.box(Ve.types.stsd,Ve.STSD,Ve.hvc1(t))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${t.type} segment codec (${i}/${t.codec})`)}static tkhd(t){const i=t.id,s=(t.duration||0)*(t.timescale||0),o=t.width||0,l=t.height||0,c=Math.floor(s/(tr+1)),p=Math.floor(s%(tr+1));return Ve.box(Ve.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,p>>24,p>>16&255,p>>8&255,p&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,o>>8&255,o&255,0,0,l>>8&255,l&255,0,0]))}static traf(t,i){const s=Ve.sdtp(t),o=t.id,l=Math.floor(i/(tr+1)),c=Math.floor(i%(tr+1));return Ve.box(Ve.types.traf,Ve.box(Ve.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),Ve.box(Ve.types.tfdt,new Uint8Array([1,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,c>>24,c>>16&255,c>>8&255,c&255])),Ve.trun(t,s.length+16+20+8+16+8+8),s)}static trak(t){return t.duration=t.duration||4294967295,Ve.box(Ve.types.trak,Ve.tkhd(t),Ve.mdia(t))}static trex(t){const i=t.id;return Ve.box(Ve.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,i){const s=t.samples||[],o=s.length,l=12+16*o,c=new Uint8Array(l);let p,y,g,x,S,R;for(i+=8+l,c.set([t.type==="video"?1:0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),p=0;p<o;p++)y=s[p],g=y.duration,x=y.size,S=y.flags,R=y.cts,c.set([g>>>24&255,g>>>16&255,g>>>8&255,g&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,S.isLeading<<2|S.dependsOn,S.isDependedOn<<6|S.hasRedundancy<<4|S.paddingValue<<1|S.isNonSync,S.degradPrio&61440,S.degradPrio&15,R>>>24&255,R>>>16&255,R>>>8&255,R&255],12+16*p);return Ve.box(Ve.types.trun,c)}static initSegment(t){Ve.types||Ve.init();const i=Ve.moov(t);return Fe(Ve.FTYP,i)}static hvc1(t){const i=t.params,s=[t.vps,t.sps,t.pps],o=4,l=new Uint8Array([1,i.general_profile_space<<6|(i.general_tier_flag?32:0)|i.general_profile_idc,i.general_profile_compatibility_flags[0],i.general_profile_compatibility_flags[1],i.general_profile_compatibility_flags[2],i.general_profile_compatibility_flags[3],i.general_constraint_indicator_flags[0],i.general_constraint_indicator_flags[1],i.general_constraint_indicator_flags[2],i.general_constraint_indicator_flags[3],i.general_constraint_indicator_flags[4],i.general_constraint_indicator_flags[5],i.general_level_idc,240|i.min_spatial_segmentation_idc>>8,255&i.min_spatial_segmentation_idc,252|i.parallelismType,252|i.chroma_format_idc,248|i.bit_depth_luma_minus8,248|i.bit_depth_chroma_minus8,0,parseInt(i.frame_rate.fps),o-1|i.temporal_id_nested<<2|i.num_temporal_layers<<3|(i.frame_rate.fixed?64:0),s.length]);let c=l.length;for(let F=0;F<s.length;F+=1){c+=3;for(let X=0;X<s[F].length;X+=1)c+=2+s[F][X].length}const p=new Uint8Array(c);p.set(l,0),c=l.length;const y=s.length-1;for(let F=0;F<s.length;F+=1){p.set(new Uint8Array([32+F|(F===y?128:0),0,s[F].length]),c),c+=3;for(let X=0;X<s[F].length;X+=1)p.set(new Uint8Array([s[F][X].length>>8,s[F][X].length&255]),c),c+=2,p.set(s[F][X],c),c+=s[F][X].length}const g=Ve.box(Ve.types.hvcC,p),x=t.width,S=t.height,R=t.pixelRatio[0],N=t.pixelRatio[1];return Ve.box(Ve.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,x>>8&255,x&255,S>>8&255,S&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),g,Ve.box(Ve.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ve.box(Ve.types.pasp,new Uint8Array([R>>24,R>>16&255,R>>8&255,R&255,N>>24,N>>16&255,N>>8&255,N&255])))}}Ve.types=void 0,Ve.HDLR_TYPES=void 0,Ve.STTS=void 0,Ve.STSC=void 0,Ve.STCO=void 0,Ve.STSZ=void 0,Ve.VMHD=void 0,Ve.SMHD=void 0,Ve.STSD=void 0,Ve.FTYP=void 0,Ve.DINF=void 0;const qr=9e4;function Ti(h,t,i=1,s=!1){const o=h*t*i;return s?Math.round(o):o}function Bi(h,t,i=1,s=!1){return Ti(h,t,1/i,s)}function Li(h,t=!1){return Ti(h,1e3,1/qr,t)}function bn(h,t=1){return Ti(h,qr,1/t)}const hn=10*1e3,Tn=1024,Cn=1152,jn=1536;let qn=null,Qn=null;function gn(h,t,i,s){return{duration:t,size:i,cts:s,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:h?2:1,isNonSync:h?0:1}}}class Ts{constructor(t,i,s,o){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=t,this.config=i,this.typeSupported=s,this.logger=o,this.ISGenerated=!1,qn===null){const c=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);qn=c?parseInt(c[1]):0}if(Qn===null){const l=navigator.userAgent.match(/Safari\/(\d+)/i);Qn=l?parseInt(l[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(t){let i=!1;const s=t[0].pts,o=t.reduce((l,c)=>{let p=c.pts,y=p-l;return y<-4294967296&&(i=!0,p=os(p,s),y=p-l),y>0?l:p},s);return i&&this.logger.debug("PTS rollover detected"),o}remux(t,i,s,o,l,c,p,y){let g,x,S,R,N,F,X=l,ne=l;const Ce=t.pid>-1,qe=i.pid>-1,$e=i.samples.length,ht=t.samples.length>0,mt=p&&$e>0||$e>1;if((!Ce||ht)&&(!qe||mt)||this.ISGenerated||p){if(this.ISGenerated){var gt,Tt,Vt,bt;const wi=this.videoTrackConfig;(wi&&(i.width!==wi.width||i.height!==wi.height||((gt=i.pixelRatio)==null?void 0:gt[0])!==((Tt=wi.pixelRatio)==null?void 0:Tt[0])||((Vt=i.pixelRatio)==null?void 0:Vt[1])!==((bt=wi.pixelRatio)==null?void 0:bt[1]))||!wi&&mt||this.nextAudioPts===null&&ht)&&this.resetInitSegment()}this.ISGenerated||(S=this.generateIS(t,i,l,c));const dr=this.isVideoContiguous;let Ir=-1,Ei;if(mt&&(Ir=ea(i.samples),!dr&&this.config.forceKeyFrameOnDiscontinuity))if(F=!0,Ir>0){this.logger.warn(`[mp4-remuxer]: Dropped ${Ir} out of ${$e} video samples due to a missing keyframe`);const wi=this.getVideoStartPts(i.samples);i.samples=i.samples.slice(Ir),i.dropped+=Ir,ne+=(i.samples[0].pts-wi)/i.inputTimeScale,Ei=ne}else Ir===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${$e} video samples`),F=!1);if(this.ISGenerated){if(ht&&mt){const wi=this.getVideoStartPts(i.samples),Zr=(os(t.samples[0].pts,wi)-wi)/i.inputTimeScale;X+=Math.max(0,Zr),ne+=Math.max(0,-Zr)}if(ht){if(t.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),S=this.generateIS(t,i,l,c)),x=this.remuxAudio(t,X,this.isAudioContiguous,c,qe||mt||y===$.AUDIO?ne:void 0),mt){const wi=x?x.endPTS-x.startPTS:0;i.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),S=this.generateIS(t,i,l,c)),g=this.remuxVideo(i,ne,dr,wi)}}else mt&&(g=this.remuxVideo(i,ne,dr,0));g&&(g.firstKeyFrame=Ir,g.independent=Ir!==-1,g.firstKeyFramePTS=Ei)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(N=ls(s,l,this._initPTS,this._initDTS)),o.samples.length&&(R=Cr(o,l,this._initPTS))),{audio:x,video:g,initSegment:S,independent:F,text:R,id3:N}}generateIS(t,i,s,o){const l=t.samples,c=i.samples,p=this.typeSupported,y={},g=this._initPTS;let x=!g||o,S="audio/mp4",R,N,F;if(x&&(R=N=1/0),t.config&&l.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":p.mpeg?(S="audio/mpeg",t.codec=""):p.mp3&&(t.codec="mp3");break;case"ac3":t.codec="ac-3";break}y.audio={id:"audio",container:S,codec:t.codec,initSegment:t.segmentCodec==="mp3"&&p.mpeg?new Uint8Array(0):Ve.initSegment([t]),metadata:{channelCount:t.channelCount}},x&&(F=t.inputTimeScale,!g||F!==g.timescale?R=N=l[0].pts-Math.round(F*s):x=!1)}if(i.sps&&i.pps&&c.length){if(i.timescale=i.inputTimeScale,y.video={id:"main",container:"video/mp4",codec:i.codec,initSegment:Ve.initSegment([i]),metadata:{width:i.width,height:i.height}},x)if(F=i.inputTimeScale,!g||F!==g.timescale){const X=this.getVideoStartPts(c),ne=Math.round(F*s);N=Math.min(N,os(c[0].dts,X)-ne),R=Math.min(R,X-ne)}else x=!1;this.videoTrackConfig={width:i.width,height:i.height,pixelRatio:i.pixelRatio}}if(Object.keys(y).length)return this.ISGenerated=!0,x?(this._initPTS={baseTime:R,timescale:F},this._initDTS={baseTime:N,timescale:F}):R=F=void 0,{tracks:y,initPTS:R,timescale:F}}remuxVideo(t,i,s,o){const l=t.inputTimeScale,c=t.samples,p=[],y=c.length,g=this._initPTS;let x=this.nextAvcDts,S=8,R=this.videoSampleDuration,N,F,X=Number.POSITIVE_INFINITY,ne=Number.NEGATIVE_INFINITY,Ce=!1;if(!s||x===null){const mr=i*l,br=c[0].pts-os(c[0].dts,c[0].pts);qn&&x!==null&&Math.abs(mr-br-x)<15e3?s=!0:x=mr-br}const qe=g.baseTime*l/g.timescale;for(let mr=0;mr<y;mr++){const br=c[mr];br.pts=os(br.pts-qe,x),br.dts=os(br.dts-qe,x),br.dts<c[mr>0?mr-1:mr].dts&&(Ce=!0)}Ce&&c.sort(function(mr,br){const Ci=mr.dts-br.dts,yi=mr.pts-br.pts;return Ci||yi}),N=c[0].dts,F=c[c.length-1].dts;const $e=F-N,ht=$e?Math.round($e/(y-1)):R||t.inputTimeScale/30;if(s){const mr=N-x,br=mr>ht,Ci=mr<-1;if((br||Ci)&&(br?this.logger.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Li(mr,!0)} ms (${mr}dts) hole between fragments detected at ${i.toFixed(3)}`):this.logger.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Li(-mr,!0)} ms (${mr}dts) overlapping between fragments detected at ${i.toFixed(3)}`),!Ci||x>=c[0].pts||qn)){N=x;const yi=c[0].pts-mr;if(br)c[0].dts=N,c[0].pts=yi;else{let Zi=!0;for(let dn=0;dn<c.length&&!(c[dn].dts>yi&&Zi);dn++){const fn=c[dn].pts;if(c[dn].dts-=mr,c[dn].pts-=mr,dn<c.length-1){const Sn=c[dn+1].pts,es=c[dn].pts,ia=Sn<=es,ma=Sn<=fn;Zi=ia==ma}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${Li(yi,!0)}/${Li(N,!0)}, delta: ${Li(mr,!0)} ms`)}}N=Math.max(0,N);let mt=0,Nt=0,gt=N;for(let mr=0;mr<y;mr++){const br=c[mr],Ci=br.units,yi=Ci.length;let Zi=0;for(let dn=0;dn<yi;dn++)Zi+=Ci[dn].data.length;Nt+=Zi,mt+=yi,br.length=Zi,br.dts<gt?(br.dts=gt,gt+=ht/4|0||1):gt=br.dts,X=Math.min(br.pts,X),ne=Math.max(br.pts,ne)}F=c[y-1].dts;const Tt=Nt+4*mt+8;let Vt;try{Vt=new Uint8Array(Tt)}catch(mr){this.observer.emit(E.ERROR,E.ERROR,{type:Le.MUX_ERROR,details:te.REMUX_ALLOC_ERROR,fatal:!1,error:mr,bytes:Tt,reason:`fail allocating video mdat ${Tt}`});return}const bt=new DataView(Vt.buffer);bt.setUint32(0,Tt),Vt.set(Ve.types.mdat,4);let dr=!1,Ir=Number.POSITIVE_INFINITY,Ei=Number.POSITIVE_INFINITY,wi=Number.NEGATIVE_INFINITY,hi=Number.NEGATIVE_INFINITY;for(let mr=0;mr<y;mr++){const br=c[mr],Ci=br.units;let yi=0;for(let fn=0,Sn=Ci.length;fn<Sn;fn++){const es=Ci[fn],ia=es.data,ma=es.data.byteLength;bt.setUint32(S,ma),S+=4,Vt.set(ia,S),S+=ma,yi+=4+ma}let Zi;if(mr<y-1)R=c[mr+1].dts-br.dts,Zi=c[mr+1].pts-br.pts;else{const fn=this.config,Sn=mr>0?br.dts-c[mr-1].dts:ht;if(Zi=mr>0?br.pts-c[mr-1].pts:ht,fn.stretchShortVideoTrack&&this.nextAudioPts!==null){const es=Math.floor(fn.maxBufferHole*l),ia=(o?X+o*l:this.nextAudioPts)-br.pts;ia>es?(R=ia-Sn,R<0?R=Sn:dr=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${ia/90} ms to the next segment; using duration ${R/90} ms for the last video frame.`)):R=Sn}else R=Sn}const dn=Math.round(br.pts-br.dts);Ir=Math.min(Ir,R),wi=Math.max(wi,R),Ei=Math.min(Ei,Zi),hi=Math.max(hi,Zi),p.push(gn(br.key,R,yi,dn))}if(p.length){if(qn){if(qn<70){const mr=p[0].flags;mr.dependsOn=2,mr.isNonSync=0}}else if(Qn&&hi-Ei<wi-Ir&&ht/wi<.025&&p[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let mr=N;for(let br=0,Ci=p.length;br<Ci;br++){const yi=mr+p[br].duration,Zi=mr+p[br].cts;if(br<Ci-1){const dn=yi+p[br+1].cts;p[br].duration=dn-Zi}else p[br].duration=br?p[br-1].duration:ht;p[br].cts=0,mr=yi}}}R=dr||!R?ht:R,this.nextAvcDts=x=F+R,this.videoSampleDuration=R,this.isVideoContiguous=!0;const ti={data1:Ve.moof(t.sequenceNumber++,N,k(t,{samples:p})),data2:Vt,startPTS:X/l,endPTS:(ne+R)/l,startDTS:N/l,endDTS:x/l,type:"video",hasAudio:!1,hasVideo:!0,nb:p.length,dropped:t.dropped};return t.samples=[],t.dropped=0,ti}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return Cn;case"ac3":return jn;default:return Tn}}remuxAudio(t,i,s,o,l){const c=t.inputTimeScale,p=t.samplerate?t.samplerate:c,y=c/p,g=this.getSamplesPerFrame(t),x=g*y,S=this._initPTS,R=t.segmentCodec==="mp3"&&this.typeSupported.mpeg,N=[],F=l!==void 0;let X=t.samples,ne=R?0:8,Ce=this.nextAudioPts||-1;const qe=i*c,$e=S.baseTime*c/S.timescale;if(this.isAudioContiguous=s=s||X.length&&Ce>0&&(o&&Math.abs(qe-Ce)<9e3||Math.abs(os(X[0].pts-$e,qe)-Ce)<20*x),X.forEach(function(Zr){Zr.pts=os(Zr.pts-$e,qe)}),!s||Ce<0){if(X=X.filter(Zr=>Zr.pts>=0),!X.length)return;l===0?Ce=0:o&&!F?Ce=Math.max(0,qe):Ce=X[0].pts}if(t.segmentCodec==="aac"){const Zr=this.config.maxAudioFramesDrift;for(let di=0,ti=Ce;di<X.length;di++){const mr=X[di],br=mr.pts,Ci=br-ti,yi=Math.abs(1e3*Ci/c);if(Ci<=-Zr*x&&F)di===0&&(this.logger.warn(`Audio frame @ ${(br/c).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*Ci/c)} ms.`),this.nextAudioPts=Ce=ti=br);else if(Ci>=Zr*x&&yi<hn&&F){let Zi=Math.round(Ci/x);ti=br-Zi*x,ti<0&&(Zi--,ti+=x),di===0&&(this.nextAudioPts=Ce=ti),this.logger.warn(`[mp4-remuxer]: Injecting ${Zi} audio frame @ ${(ti/c).toFixed(3)}s due to ${Math.round(1e3*Ci/c)} ms gap.`);for(let dn=0;dn<Zi;dn++){const fn=Math.max(ti,0);let Sn=Qt.getSilentFrame(t.parsedCodec||t.manifestCodec||t.codec,t.channelCount);Sn||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Sn=mr.unit.subarray()),X.splice(di,0,{unit:Sn,pts:fn}),ti+=x,di++}}mr.pts=ti,ti+=x}}let ht=null,mt=null,Nt,gt=0,Tt=X.length;for(;Tt--;)gt+=X[Tt].unit.byteLength;for(let Zr=0,di=X.length;Zr<di;Zr++){const ti=X[Zr],mr=ti.unit;let br=ti.pts;if(mt!==null){const yi=N[Zr-1];yi.duration=Math.round((br-mt)/y)}else if(s&&t.segmentCodec==="aac"&&(br=Ce),ht=br,gt>0){gt+=ne;try{Nt=new Uint8Array(gt)}catch(yi){this.observer.emit(E.ERROR,E.ERROR,{type:Le.MUX_ERROR,details:te.REMUX_ALLOC_ERROR,fatal:!1,error:yi,bytes:gt,reason:`fail allocating audio mdat ${gt}`});return}R||(new DataView(Nt.buffer).setUint32(0,gt),Nt.set(Ve.types.mdat,4))}else return;Nt.set(mr,ne);const Ci=mr.byteLength;ne+=Ci,N.push(gn(!0,g,Ci,0)),mt=br}const Vt=N.length;if(!Vt)return;const bt=N[N.length-1];this.nextAudioPts=Ce=mt+y*bt.duration;const dr=R?new Uint8Array(0):Ve.moof(t.sequenceNumber++,ht/y,k({},t,{samples:N}));t.samples=[];const Ir=ht/c,Ei=Ce/c,hi={data1:dr,data2:Nt,startPTS:Ir,endPTS:Ei,startDTS:Ir,endDTS:Ei,type:"audio",hasAudio:!0,hasVideo:!1,nb:Vt};return this.isAudioContiguous=!0,hi}}function os(h,t){let i;if(t===null)return h;for(t<h?i=-8589934592:i=8589934592;Math.abs(h-t)>4294967296;)h+=i;return h}function ea(h){for(let t=0;t<h.length;t++)if(h[t].key)return t;return-1}function ls(h,t,i,s){const o=h.samples.length;if(!o)return;const l=h.inputTimeScale;for(let p=0;p<o;p++){const y=h.samples[p];y.pts=os(y.pts-i.baseTime*l/i.timescale,t*l)/l,y.dts=os(y.dts-s.baseTime*l/s.timescale,t*l)/l}const c=h.samples;return h.samples=[],{samples:c}}function Cr(h,t,i){const s=h.samples.length;if(!s)return;const o=h.inputTimeScale;for(let c=0;c<s;c++){const p=h.samples[c];p.pts=os(p.pts-i.baseTime*o/i.timescale,t*o)/o}h.samples.sort((c,p)=>c.pts-p.pts);const l=h.samples;return h.samples=[],{samples:l}}class ms{constructor(t,i,s,o){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.logger=o}destroy(){}resetTimeStamp(t){this.initPTS=t,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(t,i,s,o){this.audioCodec=i,this.videoCodec=s,this.generateInitSegment(wt(t,o)),this.emitInitSegment=!0}generateInitSegment(t){let{audioCodec:i,videoCodec:s}=this;if(!(t!=null&&t.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const o=this.initData=Ct(t);o.audio&&(i=Iu(o.audio,L.AUDIO)),o.video&&(s=Iu(o.video,L.VIDEO));const l={};o.audio&&o.video?l.audiovideo={container:"video/mp4",codec:i+","+s,supplemental:o.video.supplemental,initSegment:t,id:"main"}:o.audio?l.audio={container:"audio/mp4",codec:i,initSegment:t,id:"audio"}:o.video?l.video={container:"video/mp4",codec:s,supplemental:o.video.supplemental,initSegment:t,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=l}remux(t,i,s,o,l,c){var p,y;let{initPTS:g,lastEndTime:x}=this;const S={audio:void 0,video:void 0,text:o,id3:s,initSegment:void 0};pe(x)||(x=this.lastEndTime=l||0);const R=i.samples;if(!(R!=null&&R.length))return S;const N={initPTS:void 0,timescale:1};let F=this.initData;if((p=F)!=null&&p.length||(this.generateInitSegment(R),F=this.initData),!((y=F)!=null&&y.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(N.tracks=this.initTracks,this.emitInitSegment=!1);const X=Xt(R,F),ne=fr(F,R),Ce=ne===null?l:ne;(c||!g)&&(Ru(g,Ce,l,X)||N.timescale!==g.timescale)&&(N.initPTS=Ce-l,g&&g.timescale===1&&this.logger.warn(`Adjusting initPTS @${l} from ${g.baseTime/g.timescale} to ${N.initPTS}`),this.initPTS=g={baseTime:N.initPTS,timescale:1});const qe=t?Ce-g.baseTime/g.timescale:x,$e=qe+X;Ut(F,R,g.baseTime/g.timescale),X>0?this.lastEndTime=$e:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const ht=!!F.audio,mt=!!F.video;let Nt="";ht&&(Nt+="audio"),mt&&(Nt+="video");const gt={data1:R,startPTS:qe,startDTS:qe,endPTS:$e,endDTS:$e,type:Nt,hasAudio:ht,hasVideo:mt,nb:1,dropped:0};return S.audio=gt.type==="audio"?gt:void 0,S.video=gt.type!=="audio"?gt:void 0,S.initSegment=N,S.id3=ls(s,l,g,g),o.samples.length&&(S.text=Cr(o,l,g)),S}}function Ru(h,t,i,s){if(h===null)return!0;const o=Math.max(s,1),l=t-h.baseTime/h.timescale;return Math.abs(l-i)>o}function Iu(h,t){const i=h==null?void 0:h.codec;return i&&i.length>4?i:t===L.AUDIO?i==="ec-3"||i==="ac-3"||i==="alac"?i:i==="fLaC"||i==="Opus"?Ae(i,!1):(ve.warn(`Unhandled audio codec "${i}" in mp4 MAP`),i||"mp4a"):(ve.warn(`Unhandled video codec "${i}" in mp4 MAP`),i||"avc1")}let wn;try{wn=self.performance.now.bind(self.performance)}catch(h){wn=Date.now}const Ws=[{demux:Lu,remux:ms},{demux:U,remux:Ts},{demux:Du,remux:Ts},{demux:Ha,remux:Ts}];Ws.splice(2,0,{demux:u0,remux:Ts});class Ga{constructor(t,i,s,o,l,c){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=i,this.config=s,this.id=l,this.logger=c}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,i,s,o){const l=s.transmuxing;l.executeStart=wn();let c=new Uint8Array(t);const{currentTransmuxState:p,transmuxConfig:y}=this;o&&(this.currentTransmuxState=o);const{contiguous:g,discontinuity:x,trackSwitch:S,accurateTimeOffset:R,timeOffset:N,initSegmentChange:F}=o||p,{audioCodec:X,videoCodec:ne,defaultInitPts:Ce,duration:qe,initSegmentData:$e}=y,ht=Vl(c,i);if(ht&&un(ht.method)){const Tt=this.getDecrypter(),Vt=cn(ht.method);if(Tt.isSync()){let bt=Tt.softwareDecrypt(c,ht.key.buffer,ht.iv.buffer,Vt);if(s.part>-1){const Ir=Tt.flush();bt=Ir&&Ir.buffer}if(!bt)return l.executeEnd=wn(),Ro(s);c=new Uint8Array(bt)}else return this.asyncResult=!0,this.decryptionPromise=Tt.webCryptoDecrypt(c,ht.key.buffer,ht.iv.buffer,Vt).then(bt=>{const dr=this.push(bt,null,s);return this.decryptionPromise=null,dr}),this.decryptionPromise}const mt=this.needsProbing(x,S);if(mt){const Tt=this.configureTransmuxer(c);if(Tt)return this.logger.warn(`[transmuxer] ${Tt.message}`),this.observer.emit(E.ERROR,E.ERROR,{type:Le.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,fatal:!1,error:Tt,reason:Tt.message}),l.executeEnd=wn(),Ro(s)}(x||S||F||mt)&&this.resetInitSegment($e,X,ne,qe,i),(x||F||mt)&&this.resetInitialTimestamp(Ce),g||this.resetContiguity();const Nt=this.transmux(c,ht,N,R,s);this.asyncResult=xa(Nt);const gt=this.currentTransmuxState;return gt.contiguous=!0,gt.discontinuity=!1,gt.trackSwitch=!1,l.executeEnd=wn(),Nt}flush(t){const i=t.transmuxing;i.executeStart=wn();const{decrypter:s,currentTransmuxState:o,decryptionPromise:l}=this;if(l)return this.asyncResult=!0,l.then(()=>this.flush(t));const c=[],{timeOffset:p}=o;if(s){const S=s.flush();S&&c.push(this.push(S.buffer,null,t))}const{demuxer:y,remuxer:g}=this;if(!y||!g){i.executeEnd=wn();const S=[Ro(t)];return this.asyncResult?Promise.resolve(S):S}const x=y.flush(p);return xa(x)?(this.asyncResult=!0,x.then(S=>(this.flushRemux(c,S,t),c))):(this.flushRemux(c,x,t),this.asyncResult?Promise.resolve(c):c)}flushRemux(t,i,s){const{audioTrack:o,videoTrack:l,id3Track:c,textTrack:p}=i,{accurateTimeOffset:y,timeOffset:g}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${s.sn}${s.part>-1?" part: "+s.part:""} of ${this.id===$.MAIN?"level":"track"} ${s.level}`);const x=this.remuxer.remux(o,l,c,p,g,y,!0,this.id);t.push({remuxResult:x,chunkMeta:s}),s.transmuxing.executeEnd=wn()}resetInitialTimestamp(t){const{demuxer:i,remuxer:s}=this;!i||!s||(i.resetTimeStamp(t),s.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetContiguity(),i.resetNextTimestamp())}resetInitSegment(t,i,s,o,l){const{demuxer:c,remuxer:p}=this;!c||!p||(c.resetInitSegment(t,i,s,o),p.resetInitSegment(t,i,s,l))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,i,s,o,l){let c;return i&&i.method==="SAMPLE-AES"?c=this.transmuxSampleAes(t,i,s,o,l):c=this.transmuxUnencrypted(t,s,o,l),c}transmuxUnencrypted(t,i,s,o){const{audioTrack:l,videoTrack:c,id3Track:p,textTrack:y}=this.demuxer.demux(t,i,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(l,c,p,y,i,s,!1,this.id),chunkMeta:o}}transmuxSampleAes(t,i,s,o,l){return this.demuxer.demuxSampleAes(t,i,s).then(c=>({remuxResult:this.remuxer.remux(c.audioTrack,c.videoTrack,c.id3Track,c.textTrack,s,o,!1,this.id),chunkMeta:l}))}configureTransmuxer(t){const{config:i,observer:s,typeSupported:o}=this;let l;for(let S=0,R=Ws.length;S<R;S++){var c;if((c=Ws[S].demux)!=null&&c.probe(t,this.logger)){l=Ws[S];break}}if(!l)return new Error("Failed to find demuxer by probing fragment data");const p=this.demuxer,y=this.remuxer,g=l.remux,x=l.demux;(!y||!(y instanceof g))&&(this.remuxer=new g(s,i,o,this.logger)),(!p||!(p instanceof x))&&(this.demuxer=new x(s,i,o,this.logger),this.probe=x.probe)}needsProbing(t,i){return!this.demuxer||!this.remuxer||t||i}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new Gn(this.config)),t}}function Vl(h,t){let i=null;return h.byteLength>0&&(t==null?void 0:t.key)!=null&&t.iv!==null&&t.method!=null&&(i=t),i}const Ro=h=>({remuxResult:{},chunkMeta:h});function xa(h){return"then"in h&&h.then instanceof Function}class ca{constructor(t,i,s,o,l){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=i,this.initSegmentData=s,this.duration=o,this.defaultInitPts=l||null}}class X0{constructor(t,i,s,o,l,c){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=i,this.accurateTimeOffset=s,this.trackSwitch=o,this.timeOffset=l,this.initSegmentChange=c}}let ha=0;class Wl{constructor(t,i,s,o){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=ha++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=y=>{const g=y.data,x=this.hls;if(!(!x||!(g!=null&&g.event)||g.instanceNo!==this.instanceNo))switch(g.event){case"init":{var S;const R=(S=this.workerContext)==null?void 0:S.objectURL;R&&self.URL.revokeObjectURL(R);break}case"transmuxComplete":{this.handleTransmuxComplete(g.data);break}case"flush":{this.onFlush(g.data);break}case"workerLog":{x.logger[g.data.logType]&&x.logger[g.data.logType](g.data.message);break}default:{g.data=g.data||{},g.data.frag=this.frag,g.data.part=this.part,g.data.id=this.id,x.trigger(g.event,g.data);break}}},this.onWorkerError=y=>{if(!this.hls)return;const g=new Error(`${y.message} (${y.filename}:${y.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:g})};const l=t.config;this.hls=t,this.id=i,this.useWorker=!!l.enableWorker,this.onTransmuxComplete=s,this.onFlush=o;const c=(y,g)=>{g=g||{},g.frag=this.frag||void 0,y===E.ERROR&&(g=g,g.parent=this.id,g.part=this.part,this.error=g.error),this.hls.trigger(y,g)};this.observer=new il,this.observer.on(E.FRAG_DECRYPTED,c),this.observer.on(E.ERROR,c);const p=ui(l.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const y=this.hls.logger;if(l.workerPath||Pl()){try{l.workerPath?(y.log(`loading Web Worker ${l.workerPath} for "${i}"`),this.workerContext=Ao(l.workerPath)):(y.log(`injecting Web Worker for "${i}"`),this.workerContext=pu());const{worker:x}=this.workerContext;x.addEventListener("message",this.onWorkerMessage),x.addEventListener("error",this.onWorkerError),x.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:p,id:i,config:Ur(l)})}catch(x){y.warn(`Error setting up "${i}" Web Worker, fallback to inline`,x),this.terminateWorker(),this.error=null,this.transmuxer=new Ga(this.observer,p,l,"",i,t.logger)}return}}this.transmuxer=new Ga(this.observer,p,l,"",i,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=ha++;const i=this.hls.config,s=ui(i.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:t,typeSupported:s,id:this.id,config:Ur(i)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),mu(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(t,i,s,o,l,c,p,y,g,x){var S,R;g.transmuxing.start=self.performance.now();const{instanceNo:N,transmuxer:F}=this,X=c?c.start:l.start,ne=l.decryptdata,Ce=this.frag,qe=!(Ce&&l.cc===Ce.cc),$e=!(Ce&&g.level===Ce.level),ht=Ce?g.sn-Ce.sn:-1,mt=this.part?g.part-this.part.index:-1,Nt=ht===0&&g.id>1&&g.id===(Ce==null?void 0:Ce.stats.chunkCount),gt=!$e&&(ht===1||ht===0&&(mt===1||Nt&&mt<=0)),Tt=self.performance.now();($e||ht||l.stats.parsing.start===0)&&(l.stats.parsing.start=Tt),c&&(mt||!gt)&&(c.stats.parsing.start=Tt);const Vt=!(Ce&&((S=l.initSegment)==null?void 0:S.url)===((R=Ce.initSegment)==null?void 0:R.url)),bt=new X0(qe,gt,y,$e,X,Vt);if(!gt||qe||Vt){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${l.type} sn: ${g.sn}${g.part>-1?" part: "+g.part:""} ${this.id===$.MAIN?"level":"track"}: ${g.level} id: ${g.id}
discontinuity: ${qe}
trackSwitch: ${$e}
contiguous: ${gt}
accurateTimeOffset: ${y}
timeOffset: ${X}
initSegmentChange: ${Vt}`);const dr=new ca(s,o,i,p,x);this.configureTransmuxer(dr)}if(this.frag=l,this.part=c,this.workerContext)this.workerContext.worker.postMessage({instanceNo:N,cmd:"demux",data:t,decryptdata:ne,chunkMeta:g,state:bt},t instanceof ArrayBuffer?[t]:[]);else if(F){const dr=F.push(t,ne,g,bt);xa(dr)?dr.then(Ir=>{this.handleTransmuxComplete(Ir)}).catch(Ir=>{this.transmuxerError(Ir,g,"transmuxer-interface push error")}):this.handleTransmuxComplete(dr)}}flush(t){t.transmuxing.start=self.performance.now();const{instanceNo:i,transmuxer:s}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:i,cmd:"flush",chunkMeta:t});else if(s){const o=s.flush(t);xa(o)?o.then(l=>{this.handleFlushResult(l,t)}).catch(l=>{this.transmuxerError(l,t,"transmuxer-interface flush error")}):this.handleFlushResult(o,t)}}transmuxerError(t,i,s){this.hls&&(this.error=t,this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.FRAG_PARSING_ERROR,chunkMeta:i,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:t,err:t,reason:s}))}handleFlushResult(t,i){t.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(i)}configureTransmuxer(t){const{instanceNo:i,transmuxer:s}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:i,cmd:"configure",config:t}):s&&s.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}const pl=100;class jl extends _a{constructor(t,i,s){super(t,i,s,"audio-stream-controller",$.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(E.BUFFER_RESET,this.onBufferReset,this),t.on(E.BUFFER_CREATED,this.onBufferCreated,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(E.FRAG_LOADING,this.onFragLoading,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:t}=this;t&&(super.unregisterListeners(),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(E.BUFFER_RESET,this.onBufferReset,this),t.off(E.BUFFER_CREATED,this.onBufferCreated,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(E.FRAG_LOADING,this.onFragLoading,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(t,{frag:i,id:s,initPTS:o,timescale:l}){if(s===$.MAIN){const c=i.cc,p=this.fragCurrent;if(this.initPTS[c]={baseTime:o,timescale:l},this.log(`InitPTS for cc: ${c} found from main: ${o}/${l}`),this.mainAnchor=i,this.state===Gt.WAITING_INIT_PTS){const y=this.waitingData;(!y&&!this.loadingParts||y&&y.frag.cc!==c)&&(this.nextLoadPosition=this.findSyncFrag(i).start),this.tick()}else!this.hls.hasEnoughToStart&&p&&p.cc!==c?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(i).start,p.abortRequests(),this.resetLoadingState()):this.state===Gt.IDLE&&this.tick()}}findSyncFrag(t){const i=this.getLevelDetails(),s=t.cc;return ri(i,s,t)||i&&Xr(i.fragments,s)||t}startLoad(t,i){if(!this.levels){this.startPosition=t,this.state=Gt.STOPPED;return}const s=this.lastCurrentTime;this.stopLoad(),this.setInterval(pl),s>0&&t===-1?(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),t=s,this.state=Gt.IDLE):this.state=Gt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}doTick(){switch(this.state){case Gt.IDLE:this.doTickIdle();break;case Gt.WAITING_TRACK:{const{levels:i,trackId:s}=this,o=i==null?void 0:i[s],l=o==null?void 0:o.details;if(l&&!this.waitForLive(o)){if(this.waitForCdnTuneIn(l))break;this.state=Gt.WAITING_INIT_PTS}break}case Gt.FRAG_LOADING_WAITING_RETRY:{var t;const i=performance.now(),s=this.retryDate;if(!s||i>=s||(t=this.media)!=null&&t.seeking){const{levels:o,trackId:l}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((o==null?void 0:o[l])||null),this.state=Gt.IDLE}break}case Gt.WAITING_INIT_PTS:{const i=this.waitingData;if(i){const{frag:s,part:o,cache:l,complete:c}=i,p=this.mainAnchor;if(this.initPTS[s.cc]!==void 0){this.waitingData=null,this.state=Gt.FRAG_LOADING;const y=l.flush().buffer,g={frag:s,part:o,payload:y,networkDetails:null};this._handleFragmentLoadProgress(g),c&&super._handleFragmentLoadComplete(g)}else p&&p.cc!==i.frag.cc&&(this.log(`Waiting fragment cc (${s.cc}) cancelled because video is at cc ${p.cc}`),this.nextLoadPosition=this.findSyncFrag(p).start,this.clearWaitingFragment())}else this.state=Gt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const t=this.waitingData;t&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.state!==Gt.STOPPED&&(this.state=Gt.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:t}=this;t!=null&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){var t;const{hls:i,levels:s,media:o,trackId:l}=this,c=i.config;if(!this.buffering||!o&&!this.primaryPrefetch&&(this.startFragRequested||!c.startFragPrefetch)||!(s!=null&&s[l]))return;const p=s[l],y=p.details;if(!y||this.waitForLive(p)||this.waitForCdnTuneIn(y)){this.state=Gt.WAITING_TRACK,this.startFragRequested=!1;return}const g=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&g&&(this.bufferFlushed=!1,this.afterBufferFlushed(g,L.AUDIO,$.AUDIO));const x=this.getFwdBufferInfo(g,$.AUDIO);if(x===null)return;if(!this.switchingTrack&&this._streamEnded(x,y)){i.trigger(E.BUFFER_EOS,{type:"audio"}),this.state=Gt.ENDED;return}const S=x.len,R=i.maxBufferLength,N=y.fragments,F=N[0].start,X=this.getLoadPosition(),ne=this.flushing?X:x.end;if(this.switchingTrack&&o){const $e=X;y.PTSKnown&&$e<F&&(x.end>F||x.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=F+.05)}if(S>=R&&!this.switchingTrack&&ne<N[N.length-1].start)return;let Ce=this.getNextFragment(ne,y);if(Ce&&this.isLoopLoading(Ce,ne)&&(Ce=this.getNextFragmentLoopLoading(Ce,y,x,$.MAIN,R)),!Ce){this.bufferFlushed=!0;return}let qe=((t=this.mainFragLoading)==null?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&qe&&xe(Ce)&&!Ce.endList&&(!y.live||!this.loadingParts&&ne<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(qe)===jr.OK&&(this.mainFragLoading=qe=null),qe&&xe(qe))){if(Ce.start>qe.end){const ht=this.fragmentTracker.getFragAtPos(ne,$.MAIN);ht&&ht.end>qe.end&&(qe=ht,this.mainFragLoading={frag:ht,targetBufferTime:null})}if(Ce.start>qe.end)return}this.loadFragment(Ce,p,ne)}onMediaDetaching(t,i){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,i)}onAudioTracksUpdated(t,{audioTracks:i}){this.resetTransmuxer(),this.levels=i.map(s=>new Br(s))}onAudioTrackSwitching(t,i){const s=!!i.url;this.trackId=i.id;const{fragCurrent:o}=this;o&&(o.abortRequests(),this.removeUnbufferedFrags(o.start)),this.resetLoadingState(),s?(this.switchingTrack=i,this.flushAudioIfNeeded(i),this.state!==Gt.STOPPED&&(this.setInterval(pl),this.state=Gt.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=i,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(t,i){this.mainDetails=i.details;const s=this.cachedTrackLoadedData;s&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(E.AUDIO_TRACK_LOADED,s))}onAudioTrackLoaded(t,i){var s;const{levels:o}=this,{details:l,id:c,groupId:p,track:y}=i;if(!o){this.warn(`Audio tracks reset while loading track ${c} "${y.name}" of "${p}"`);return}const g=this.mainDetails;if(!g||l.endCC>g.endCC||g.expired){this.cachedTrackLoadedData=i,this.state!==Gt.STOPPED&&(this.state=Gt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${c} "${y.name}" of "${p}" loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""},duration:${l.totalduration}`);const x=o[c];let S=0;if(l.live||(s=x.details)!=null&&s.live){if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;if(x.details){var R;S=this.alignPlaylists(l,x.details,(R=this.levelLastLoaded)==null?void 0:R.details)}l.alignedSliding||(ji(l,g),l.alignedSliding||ps(l,g),S=l.fragmentStart)}x.details=l,this.levelLastLoaded=x,this.startFragRequested||this.setStartPosition(g,S),this.hls.trigger(E.AUDIO_TRACK_UPDATED,{details:l,id:c,groupId:i.groupId}),this.state===Gt.WAITING_TRACK&&!this.waitForCdnTuneIn(l)&&(this.state=Gt.IDLE),this.tick()}_handleFragmentLoadProgress(t){var i;const s=t.frag,{part:o,payload:l}=t,{config:c,trackId:p,levels:y}=this;if(!y){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const g=y[p];if(!g){this.warn("Audio track is undefined on fragment load progress");return}const x=g.details;if(!x){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const S=c.defaultAudioCodec||g.audioCodec||"mp4a.40.2";let R=this.transmuxer;R||(R=this.transmuxer=new Wl(this.hls,$.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const N=this.initPTS[s.cc],F=(i=s.initSegment)==null?void 0:i.data;if(N!==void 0){const ne=o?o.index:-1,Ce=ne!==-1,qe=new In(s.level,s.sn,s.stats.chunkCount,l.byteLength,ne,Ce);R.push(l,F,S,"",s,o,x.totalduration,!1,qe,N)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${x.startSN} ,${x.endSN}],track ${p}`);const{cache:X}=this.waitingData=this.waitingData||{frag:s,part:o,cache:new So,complete:!1};X.push(new Uint8Array(l)),this.state!==Gt.STOPPED&&(this.state=Gt.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(t){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(t,i){this.bufferFlushed=this.flushing=!1;const s=i.tracks.audio;s&&(this.mediaBuffer=s.buffer||null)}onFragLoading(t,i){!this.audioOnly&&i.frag.type===$.MAIN&&xe(i.frag)&&(this.mainFragLoading=i,this.state===Gt.IDLE&&this.tick())}onFragBuffered(t,i){const{frag:s,part:o}=i;if(s.type!==$.AUDIO){!this.audioOnly&&s.type===$.MAIN&&!s.elementaryStreams.video&&!s.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${o?" p: "+o.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(xe(s)){this.fragPrevious=s;const l=this.switchingTrack;l&&(this.bufferedTrack=l,this.switchingTrack=null,this.hls.trigger(E.AUDIO_TRACK_SWITCHED,O({},l)))}this.fragBufferedComplete(s,o),this.media&&this.tick()}onError(t,i){var s;if(i.fatal){this.state=Gt.ERROR;return}switch(i.details){case te.FRAG_GAP:case te.FRAG_PARSING_ERROR:case te.FRAG_DECRYPT_ERROR:case te.FRAG_LOAD_ERROR:case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_ERROR:case te.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($.AUDIO,i);break;case te.AUDIO_TRACK_LOAD_ERROR:case te.AUDIO_TRACK_LOAD_TIMEOUT:case te.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Gt.WAITING_TRACK&&((s=i.context)==null?void 0:s.type)===Me.AUDIO_TRACK&&(this.state=Gt.IDLE);break;case te.BUFFER_ADD_CODEC_ERROR:case te.BUFFER_APPEND_ERROR:if(i.parent!=="audio")return;this.resetLoadingState();break;case te.BUFFER_FULL_ERROR:if(i.parent!=="audio")return;this.reduceLengthAndFlushBuffer(i)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case te.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onBufferFlushing(t,{type:i}){i!==L.VIDEO&&(this.flushing=!0)}onBufferFlushed(t,{type:i}){if(i!==L.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Gt.ENDED&&(this.state=Gt.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,i,$.AUDIO),this.tick())}}_handleTransmuxComplete(t){var i;const s="audio",{hls:o}=this,{remuxResult:l,chunkMeta:c}=t,p=this.getCurrentContext(c);if(!p){this.resetWhenMissingContext(c);return}const{frag:y,part:g,level:x}=p,{details:S}=x,{audio:R,text:N,id3:F,initSegment:X}=l;if(this.fragContextChanged(y)||!S){this.fragmentTracker.removeFragment(y);return}if(this.state=Gt.PARSING,this.switchingTrack&&R&&this.completeAudioSwitch(this.switchingTrack),X!=null&&X.tracks){const ne=y.initSegment||y;this._bufferInitSegment(x,X.tracks,ne,c),o.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:ne,id:s,tracks:X.tracks})}if(R){const{startPTS:ne,endPTS:Ce,startDTS:qe,endDTS:$e}=R;g&&(g.elementaryStreams[L.AUDIO]={startPTS:ne,endPTS:Ce,startDTS:qe,endDTS:$e}),y.setElementaryStreamInfo(L.AUDIO,ne,Ce,qe,$e),this.bufferFragmentData(R,y,g,c)}if(F!=null&&(i=F.samples)!=null&&i.length){const ne=k({id:s,frag:y,details:S},F);o.trigger(E.FRAG_PARSING_METADATA,ne)}if(N){const ne=k({id:s,frag:y,details:S},N);o.trigger(E.FRAG_PARSING_USERDATA,ne)}}_bufferInitSegment(t,i,s,o){if(this.state!==Gt.PARSING||(i.video&&delete i.video,i.audiovideo&&delete i.audiovideo,!i.audio))return;const l=i.audio;l.id=$.AUDIO;const c=t.audioCodec;this.log(`Init audio buffer, container:${l.container}, codecs[level/parsed]=[${c}/${l.codec}]`),c&&c.split(",").length===1&&(l.levelCodec=c),this.hls.trigger(E.BUFFER_CODECS,i);const p=l.initSegment;if(p!=null&&p.byteLength){const y={type:"audio",frag:s,part:null,chunkMeta:o,parent:s.type,data:p};this.hls.trigger(E.BUFFER_APPENDING,y)}this.tickImmediate()}loadFragment(t,i,s){const o=this.fragmentTracker.getState(t);if(this.switchingTrack||o===jr.NOT_LOADED||o===jr.PARTIAL){var l;if(!xe(t))this._loadInitSegment(t,i);else if((l=i.details)!=null&&l.live&&!this.initPTS[t.cc]){this.log(`Waiting for video PTS in continuity counter ${t.cc} of live stream before loading audio fragment ${t.sn} of level ${this.trackId}`),this.state=Gt.WAITING_INIT_PTS;const c=this.mainDetails;c&&c.fragmentStart!==i.details.fragmentStart&&ps(i.details,c)}else super.loadFragment(t,i,s)}else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:i,lang:s,assocLang:o,characteristics:l,audioCodec:c,channels:p}=this.bufferedTrack;Lt({name:i,lang:s,assocLang:o,characteristics:l,audioCodec:c,channels:p},t,Bt)||(pr(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}}completeAudioSwitch(t){const{hls:i}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,i.trigger(E.AUDIO_TRACK_SWITCHED,O({},t))}}class uo extends ae{constructor(t,i){super(i,t.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,i,s){const o=i==null?void 0:i.renditionReports;if(o){let l=-1;for(let c=0;c<o.length;c++){const p=o[c];let y;try{y=new self.URL(p.URI,i.url).href}catch(g){this.warn(`Could not construct new URL for Rendition Report: ${g}`),y=p.URI||""}if(y===t){l=c;break}else y===t.substring(0,y.length)&&(l=c)}if(l!==-1){const c=o[l],p=parseInt(c["LAST-MSN"])||(i==null?void 0:i.lastPartSn);let y=parseInt(c["LAST-PART"])||(i==null?void 0:i.lastPartIndex);if(this.hls.config.lowLatencyMode){const x=Math.min(i.age-i.partTarget,i.targetduration);y>=0&&x>i.partTarget&&(y+=1)}const g=s&&oi(s);return new Dr(p,y>=0?y:void 0,g)}}}loadPlaylist(t){this.clearTimer()}loadingPlaylist(t,i){this.clearTimer()}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}getUrlWithDirectives(t,i){if(i)try{return i.addDirectives(t)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}return t}playlistLoaded(t,i,s){const{details:o,stats:l}=i,c=self.performance.now(),p=l.loading.first?Math.max(0,c-l.loading.first):0;o.advancedDateTime=Date.now()-p;const y=this.hls.config.timelineOffset;if(y!==o.appliedTimelineOffset){const x=Math.max(y||0,0);o.appliedTimelineOffset=x,o.fragments.forEach(S=>{S.start=S.playlistOffset+x})}if(o.live||s!=null&&s.live){const x="levelInfo"in i?i.levelInfo:i.track;if(o.reloaded(s),s&&o.fragments.length>0){$a(s,o);const qe=o.playlistParsingError;if(qe){this.warn(qe);const $e=this.hls;if(!$e.config.ignorePlaylistParsingErrors){var g;const{networkDetails:ht}=i;$e.trigger(E.ERROR,{type:Le.NETWORK_ERROR,details:te.LEVEL_PARSING_ERROR,fatal:!1,url:o.url,error:qe,reason:qe.message,level:i.level||void 0,parent:(g=o.fragments[0])==null?void 0:g.type,networkDetails:ht,stats:l});return}o.playlistParsingError=null}}o.requestScheduled===-1&&(o.requestScheduled=l.loading.start);const S=this.hls.mainForwardBufferInfo,R=S?S.end-S.len:0,N=(o.edge-R)*1e3,F=tl(o,N);if(o.requestScheduled+F<c?o.requestScheduled=c:o.requestScheduled+=F,this.log(`live playlist ${t} ${o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:o.updated?"UPDATED":"MISSED"}`),!this.canLoad||!o.live)return;let X,ne,Ce;if(o.canBlockReload&&o.endSN&&o.advanced){const qe=this.hls.config.lowLatencyMode,$e=o.lastPartSn,ht=o.endSN,mt=o.lastPartIndex,Nt=mt!==-1,gt=$e===ht;Nt?gt?(ne=ht+1,Ce=qe?0:mt):(ne=$e,Ce=qe?mt+1:o.maxPartIndex):ne=ht+1;const Tt=o.age,Vt=Tt+o.ageHeader;let bt=Math.min(Vt-o.partTarget,o.targetduration*1.5);if(bt>0){if(Vt>o.targetduration*3)this.log(`Playlist last advanced ${Tt.toFixed(2)}s ago. Omitting segment and part directives.`),ne=void 0,Ce=void 0;else if(s!=null&&s.tuneInGoal&&Vt-o.partTarget>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${bt} with playlist age: ${o.age}`),bt=0;else{const dr=Math.floor(bt/o.targetduration);if(ne+=dr,Ce!==void 0){const Ir=Math.round(bt%o.targetduration/o.partTarget);Ce+=Ir}this.log(`CDN Tune-in age: ${o.ageHeader}s last advanced ${Tt.toFixed(2)}s goal: ${bt} skip sn ${dr} to part ${Ce}`)}o.tuneInGoal=bt}if(X=this.getDeliveryDirectives(o,i.deliveryDirectives,ne,Ce),qe||!gt){o.requestScheduled=c,this.loadingPlaylist(x,X);return}}else(o.canBlockReload||o.canSkipUntil)&&(X=this.getDeliveryDirectives(o,i.deliveryDirectives,ne,Ce));X&&ne!==void 0&&o.canBlockReload&&(o.requestScheduled=l.loading.first+Math.max(F-p*2,F/2)),this.scheduleLoading(x,X,o)}else this.clearTimer()}scheduleLoading(t,i,s){const o=s||t.details;if(!o){this.loadingPlaylist(t,i);return}const l=self.performance.now(),c=o.requestScheduled;if(l>=c){this.loadingPlaylist(t,i);return}const p=c-l;this.log(`reload live playlist ${t.name||t.bitrate+"bps"} in ${Math.round(p)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(t,i),p)}getDeliveryDirectives(t,i,s,o){let l=oi(t);return i!=null&&i.skip&&t.deltaUpdateFailed&&(s=i.msn,o=i.part,l=Sr.No),new Dr(s,o,l)}checkRetry(t){const i=t.details,s=ii(t),o=t.errorAction,{action:l,retryCount:c=0,retryConfig:p}=o||{},y=!!o&&!!p&&(l===Ar.RetryRequest||!o.resolved&&l===Ar.SendAlternateToPenaltyBox);if(y){var g;if(c>=p.maxNumRetry)return!1;if(s&&(g=t.context)!=null&&g.deliveryDirectives)this.warn(`Retrying playlist loading ${c+1}/${p.maxNumRetry} after "${i}" without delivery-directives`),this.loadPlaylist();else{const x=Kr(p,c);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),x),this.warn(`Retrying playlist loading ${c+1}/${p.maxNumRetry} after "${i}" in ${x}ms`)}t.levelRetry=!0,o.resolved=!0}return y}}function ml(h,t){if(h.length!==t.length)return!1;for(let i=0;i<h.length;i++)if(!gl(h[i].attrs,t[i].attrs))return!1;return!0}function gl(h,t,i){const s=h["STABLE-RENDITION-ID"];return s&&!i?s===t["STABLE-RENDITION-ID"]:!(i||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(o=>h[o]!==t[o])}function Pu(h,t){return t.label.toLowerCase()===h.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(h.lang||"").toLowerCase())}class Nc extends uo{constructor(t){super(t,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVEL_LOADING,this.onLevelLoading,this),t.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(E.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(E.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(t,i){this.tracks=i.audioTracks||[]}onAudioTrackLoaded(t,i){const{id:s,groupId:o,details:l}=i,c=this.tracksInGroup[s];if(!c||c.groupId!==o){this.warn(`Audio track with id:${s} and group:${o} not found in active group ${c==null?void 0:c.groupId}`);return}const p=c.details;c.details=i.details,this.log(`Audio track ${s} "${c.name}" lang:${c.lang} group:${o} loaded [${l.startSN}-${l.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,p)}onLevelLoading(t,i){this.switchLevel(i.level)}onLevelSwitching(t,i){this.switchLevel(i.level)}switchLevel(t){const i=this.hls.levels[t];if(!i)return;const s=i.audioGroups||null,o=this.groupIds;let l=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(p=>(o==null?void 0:o.indexOf(p))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const p=this.tracks.filter(R=>!s||s.indexOf(R.groupId)!==-1);if(p.length)this.selectDefaultTrack&&!p.some(R=>R.default)&&(this.selectDefaultTrack=!1),p.forEach((R,N)=>{R.id=N});else if(!l&&!this.tracksInGroup.length)return;this.tracksInGroup=p;const y=this.hls.config.audioPreference;if(!l&&y){const R=_t(y,p,Bt);if(R>-1)l=p[R];else{const N=_t(y,this.tracks);l=this.tracks[N]}}let g=this.findTrackId(l);g===-1&&l&&(g=this.findTrackId(null));const x={audioTracks:p};this.log(`Updating audio tracks, ${p.length} track(s) found in group(s): ${s==null?void 0:s.join(",")}`),this.hls.trigger(E.AUDIO_TRACKS_UPDATED,x);const S=this.trackId;if(g!==-1&&S===-1)this.setAudioTrack(g);else if(p.length&&S===-1){var c;const R=new Error(`No audio track selected for current audio group-ID(s): ${(c=this.groupIds)==null?void 0:c.join(",")} track count: ${p.length}`);this.warn(R.message),this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:R})}}}onError(t,i){i.fatal||!i.context||i.context.type===Me.AUDIO_TRACK&&i.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(i.context.groupId)!==-1)&&this.checkRetry(i)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioOption(t){const i=this.hls;if(i.config.audioPreference=t,t){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const o=this.currentTrack;if(o&&Lt(t,o,Bt))return o;const l=_t(t,this.tracksInGroup,Bt);if(l>-1){const c=this.tracksInGroup[l];return this.setAudioTrack(l),c}else if(o){let c=i.loadLevel;c===-1&&(c=i.firstAutoLevel);const p=lr(t,i.levels,s,c,Bt);if(p===-1)return null;i.nextLoadLevel=p}if(t.channels||t.audioCodec){const c=_t(t,s);if(c>-1)return s[c]}}}return null}setAudioTrack(t){const i=this.tracksInGroup;if(t<0||t>=i.length){this.warn(`Invalid audio track id: ${t}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[t],l=o.details&&!o.details.live;if(t===this.trackId&&o===s&&l||(this.log(`Switching to audio-track ${t} "${o.name}" lang:${o.lang} group:${o.groupId} channels:${o.channels}`),this.trackId=t,this.currentTrack=o,this.hls.trigger(E.AUDIO_TRACK_SWITCHING,O({},o)),l))return;const c=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(c)}findTrackId(t){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(!(this.selectDefaultTrack&&!o.default)&&(!t||Lt(t,o,Bt)))return s}if(t){const{name:s,lang:o,assocLang:l,characteristics:c,audioCodec:p,channels:y}=t;for(let g=0;g<i.length;g++){const x=i[g];if(Lt({name:s,lang:o,assocLang:l,characteristics:c,audioCodec:p,channels:y},x,Bt))return g}for(let g=0;g<i.length;g++){const x=i[g];if(gl(t.attrs,x.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return g}for(let g=0;g<i.length;g++){const x=i[g];if(gl(t.attrs,x.attrs,["LANGUAGE"]))return g}}return-1}loadPlaylist(t){super.loadPlaylist();const i=this.currentTrack;this.shouldLoadPlaylist(i)&&pr(i.url,this.hls)&&this.scheduleLoading(i,t)}loadingPlaylist(t,i){super.loadingPlaylist(t,i);const s=t.id,o=t.groupId,l=this.getUrlWithDirectives(t.url,i),c=t.details,p=c==null?void 0:c.age;this.log(`Loading audio-track ${s} "${t.name}" lang:${t.lang} group:${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${p&&c.live?" age "+p.toFixed(1)+(c.type?" "+c.type||0:""):""} ${l}`),this.hls.trigger(E.AUDIO_TRACK_LOADING,{url:l,id:s,groupId:o,deliveryDirectives:i||null,track:t})}}class jh{constructor(t){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=t}destroy(){this.tracks=this.queues=null}append(t,i,s){if(this.queues===null||this.tracks===null)return;const o=this.queues[i];o.push(t),o.length===1&&!s&&this.executeNext(i)}appendBlocker(t){return new Promise(i=>{const s={label:"async-blocker",execute:i,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(s,t)})}prependBlocker(t){return new Promise(i=>{if(this.queues){const s={label:"async-blocker-prepend",execute:i,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[t].unshift(s)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(t=>{var i;const s=(i=t[0])==null?void 0:i.label;(s==="async-blocker"||s==="async-blocker-prepend")&&(t[0].execute(),t.splice(0,1))})}unblockAudio(t){if(this.queues===null)return;this.queues.audio[0]===t&&this.shiftAndExecuteNext("audio")}executeNext(t){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];if(i.length){const o=i[0];try{o.execute()}catch(l){var s;if(o.onError(l),this.queues===null||this.tracks===null)return;const c=(s=this.tracks[t])==null?void 0:s.buffer;c!=null&&c.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){this.queues!==null&&(this.queues[t].shift(),this.executeNext(t))}current(t){var i;return((i=this.queues)==null?void 0:i[t][0])||null}toString(){const{queues:t,tracks:i}=this;return t===null||i===null?"<destroyed>":`
${this.list("video")}
${this.list("audio")}
${this.list("audiovideo")}}`}list(t){var i,s;return(i=this.queues)!=null&&i[t]||(s=this.tracks)!=null&&s[t]?`${t}: (${this.listSbInfo(t)}) ${this.listOps(t)}`:""}listSbInfo(t){var i;const s=(i=this.tracks)==null?void 0:i[t],o=s==null?void 0:s.buffer;return o?`SourceBuffer${o.updating?" updating":""}${s.ended?" ended":""}${s.ending?" ending":""}`:"none"}listOps(t){var i;return((i=this.queues)==null?void 0:i[t].map(s=>s.label).join(", "))||""}}const $c=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,zc="HlsJsTrackRemovedError";class h0 extends Error{constructor(t){super(t),this.name=zc}}class qh extends ae{constructor(t,i){super("buffer-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=s=>{var o;this.hls&&((o=this.mediaSource)==null?void 0:o.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=s=>{const{media:o,mediaSource:l}=this;s&&this.log("Media source opened"),!(!o||!l)&&(l.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(E.MEDIA_ATTACHED,{media:o,mediaSource:l}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:o}=this;s!==o&&this.error(`Media element src was set while attaching MediaSource (${o} > ${s})`)},this.hls=t,this.fragmentTracker=i,this.appendSource=We(Ye(t.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:t}=this;t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.BUFFER_RESET,this.onBufferReset,this),t.on(E.BUFFER_APPENDING,this.onBufferAppending,this),t.on(E.BUFFER_CODECS,this.onBufferCodecs,this),t.on(E.BUFFER_EOS,this.onBufferEos,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.FRAG_PARSED,this.onFragParsed,this),t.on(E.FRAG_CHANGED,this.onFragChanged,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.BUFFER_RESET,this.onBufferReset,this),t.off(E.BUFFER_APPENDING,this.onBufferAppending,this),t.off(E.BUFFER_CODECS,this.onBufferCodecs,this),t.off(E.BUFFER_EOS,this.onBufferEos,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.FRAG_PARSED,this.onFragParsed,this),t.off(E.FRAG_CHANGED,this.onFragChanged,this),t.off(E.ERROR,this.onError,this)}transferMedia(){const{media:t,mediaSource:i}=this;if(!t)return null;const s={};if(this.operationQueue){const l=this.isUpdating();l||this.operationQueue.removeBlockers();const c=this.isQueued();(l||c)&&this.warn(`Transfering MediaSource with${c?" operations in queue":""}${l?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const o=this.transferData;return!this.sourceBufferCount&&o&&o.mediaSource===i?k(s,o.tracks):this.sourceBuffers.forEach(l=>{const[c]=l;c&&(s[c]=k({},this.tracks[c]),this.removeBuffer(c)),l[0]=l[1]=null}),{media:t,mediaSource:i,tracks:s}}initTracks(){const t={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=t,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,i){var s;let o=2;(i.audio&&!i.video||!i.altAudio)&&(o=1),this.bufferCodecEventsTotal=o,this.log(`${o} bufferCodec event(s) expected.`),(s=this.transferData)!=null&&s.mediaSource&&this.sourceBufferCount&&o&&this.bufferCreated()}onMediaAttaching(t,i){const s=this.media=i.media,o=Ye(this.appendSource);if(this.transferData=this.overrides=void 0,s&&o){const l=!!i.mediaSource;(l||i.overrides)&&(this.transferData=i,this.overrides=i.overrides);const c=this.mediaSource=i.mediaSource||new o;if(this.assignMediaSource(c),l)this._objectUrl=s.src,this.attachTransferred();else{const p=this._objectUrl=self.URL.createObjectURL(c);if(this.appendSource)try{s.removeAttribute("src");const y=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||y&&c instanceof y,Ou(s),Uc(s,p),s.load()}catch(y){s.src=p}else s.src=p}s.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(t){var i,s;this.log(`${((i=this.transferData)==null?void 0:i.mediaSource)===t?"transferred":"created"} media source: ${(s=t.constructor)==null?void 0:s.name}`),t.addEventListener("sourceopen",this._onMediaSourceOpen),t.addEventListener("sourceended",this._onMediaSourceEnded),t.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.addEventListener("startstreaming",this._onStartStreaming),t.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const t=this.media,i=this.transferData;if(!i||!t)return;const s=this.tracks,o=i.tracks,l=o?Object.keys(o):null,c=l?l.length:0,p=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(o&&l&&c){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
required tracks: ${Ur(s,(y,g)=>y==="initSegment"?void 0:g)};
transfer tracks: ${Ur(o,(y,g)=>y==="initSegment"?void 0:g)}}`),!ut(o,s)){i.mediaSource=null,i.tracks=void 0;const y=t.currentTime,g=this.details,x=Math.max(y,(g==null?void 0:g.fragments[0].start)||0);if(x-y>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${y} -> ${x}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(o)}"->"${Object.keys(s)}") start time: ${x} currentTime: ${y}`),this.onMediaDetaching(E.MEDIA_DETACHING,{}),this.onMediaAttaching(E.MEDIA_ATTACHING,i),t.currentTime=x;return}this.transferData=void 0,l.forEach(y=>{const g=y,x=o[g];if(x){const S=x.buffer;if(S){const R=this.fragmentTracker,N=x.id;if(R.hasFragments(N)||R.hasParts(N)){const ne=Vr.getBuffered(S);R.detectEvictedFragments(g,ne,N,null,!0)}const F=d0(g),X=[g,S];this.sourceBuffers[F]=X,S.updating&&this.operationQueue&&this.operationQueue.prependBlocker(g),this.trackSourceBuffer(g,x)}}}),p(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),p()}get mediaSourceOpenOrEnded(){var t;const i=(t=this.mediaSource)==null?void 0:t.readyState;return i==="open"||i==="ended"}onMediaDetaching(t,i){const s=!!i.transferMedia;this.transferData=this.overrides=void 0;const{media:o,mediaSource:l,_objectUrl:c}=this;if(l){if(this.log(`media source ${s?"transferring":"detaching"}`),s)this.sourceBuffers.forEach(([p])=>{p&&this.removeBuffer(p)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const p=l.readyState==="open";try{const y=l.sourceBuffers;for(let g=y.length;g--;)p&&y[g].abort(),l.removeSourceBuffer(y[g]);p&&l.endOfStream()}catch(y){this.warn(`onMediaDetaching: ${y.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(l.removeEventListener("startstreaming",this._onStartStreaming),l.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}o&&(o.removeEventListener("emptied",this._onMediaEmptied),s||(c&&self.URL.revokeObjectURL(c),this.mediaSrc===c?(o.removeAttribute("src"),this.appendSource&&Ou(o),o.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(E.MEDIA_DETACHED,i)}onBufferReset(){this.sourceBuffers.forEach(([t])=>{t&&this.resetBuffer(t)}),this.initTracks()}resetBuffer(t){var i;const s=(i=this.tracks[t])==null?void 0:i.buffer;if(this.removeBuffer(t),s)try{var o;(o=this.mediaSource)!=null&&o.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(s)}catch(l){this.warn(`onBufferReset ${t}`,l)}delete this.tracks[t]}removeBuffer(t){this.removeBufferListeners(t),this.sourceBuffers[d0(t)]=[null,null];const i=this.tracks[t];i&&(i.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new jh(this.tracks)}onBufferCodecs(t,i){const s=this.tracks,o=Object.keys(i);this.log(`BUFFER_CODECS: "${o}" (current SB count ${this.sourceBufferCount})`);const l="audiovideo"in i&&(s.audio||s.video)||s.audiovideo&&("audio"in i||"video"in i),c=!l&&this.sourceBufferCount&&this.media&&o.some(p=>!s[p]);if(l||c){this.warn(`Unsupported transition between "${Object.keys(s)}" and "${o}" SourceBuffers`);return}o.forEach(p=>{var y,g,x;const S=i[p],{id:R,codec:N,levelCodec:F,container:X,metadata:ne,supplemental:Ce}=S;let qe=s[p];const $e=(y=this.transferData)==null||(g=y.tracks)==null?void 0:g[p],ht=$e!=null&&$e.buffer?$e:qe,mt=(ht==null?void 0:ht.pendingCodec)||(ht==null?void 0:ht.codec),Nt=ht==null?void 0:ht.levelCodec;qe||(qe=s[p]={buffer:void 0,listeners:[],codec:N,supplemental:Ce,container:X,levelCodec:F,metadata:ne,id:R});const gt=vr(mt,Nt),Tt=gt==null?void 0:gt.replace($c,"$1");let Vt=vr(N,F);const bt=(x=Vt)==null?void 0:x.replace($c,"$1");Vt&&gt&&Tt!==bt&&(p.slice(0,5)==="audio"&&(Vt=Ae(Vt,this.appendSource)),this.log(`switching codec ${mt} to ${Vt}`),Vt!==(qe.pendingCodec||qe.codec)&&(qe.pendingCodec=Vt),qe.container=X,this.appendChangeType(p,X,Vt))}),(this.tracksReady||this.sourceBufferCount)&&(i.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((t,i)=>{const s=this.tracks[i];return t[i]={id:s.id,container:s.container,codec:s.codec,levelCodec:s.levelCodec},t},{})}appendChangeType(t,i,s){const o=`${i};codecs=${s}`,l={label:`change-type=${o}`,execute:()=>{const c=this.tracks[t];if(c){const p=c.buffer;p!=null&&p.changeType&&(this.log(`changing ${t} sourceBuffer type to ${o}`),p.changeType(o),c.codec=s,c.container=i)}this.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:c=>{this.warn(`Failed to change ${t} SourceBuffer type`,c)}};this.append(l,t,this.isPending(this.tracks[t]))}blockAudio(t){var i;const s=t.start,o=s+t.duration*.05;if(((i=this.fragmentTracker.getAppendedFrag(s,$.MAIN))==null?void 0:i.gap)===!0)return;const c={label:"block-audio",execute:()=>{var p;const y=this.tracks.video;(this.lastVideoAppendEnd>o||y!=null&&y.buffer&&Vr.isBuffered(y.buffer,o)||((p=this.fragmentTracker.getAppendedFrag(o,$.MAIN))==null?void 0:p.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:p=>{this.warn("Error executing block-audio operation",p)}};this.blockedAudioAppend={op:c,frag:t},this.append(c,"audio",!0)}unblockAudio(){const{blockedAudioAppend:t,operationQueue:i}=this;t&&i&&(this.blockedAudioAppend=null,i.unblockAudio(t.op))}onBufferAppending(t,i){const{tracks:s}=this,{data:o,type:l,parent:c,frag:p,part:y,chunkMeta:g}=i,x=g.buffering[l],S=p.sn,R=self.performance.now();x.start=R;const N=p.stats.buffering,F=y?y.stats.buffering:null;N.start===0&&(N.start=R),F&&F.start===0&&(F.start=R);const X=s.audio;let ne=!1;l==="audio"&&(X==null?void 0:X.container)==="audio/mpeg"&&(ne=!this.lastMpegAudioChunk||g.id===1||this.lastMpegAudioChunk.sn!==g.sn,this.lastMpegAudioChunk=g);const Ce=this.tracks.video,qe=Ce==null?void 0:Ce.buffer;if(qe&&S!=="initSegment"){const mt=y||p,Nt=this.blockedAudioAppend;if(l==="audio"&&c!=="main"&&!this.blockedAudioAppend){const Tt=mt.start+mt.duration*.05,Vt=qe.buffered,bt=this.currentOp("video");!Vt.length&&!bt?this.blockAudio(mt):!bt&&!Vr.isBuffered(qe,Tt)&&this.lastVideoAppendEnd<Tt&&this.blockAudio(mt)}else if(l==="video"){const gt=mt.end;if(Nt){const Tt=Nt.frag.start;(gt>Tt||gt<this.lastVideoAppendEnd||Vr.isBuffered(qe,Tt))&&this.unblockAudio()}this.lastVideoAppendEnd=gt}}const $e=(y||p).start,ht={label:`append-${l}`,execute:()=>{if(x.executeStart=self.performance.now(),ne){const mt=this.tracks[l];if(mt){const Nt=mt.buffer;if(Nt){const gt=$e-Nt.timestampOffset;Math.abs(gt)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${$e} (delta: ${gt}) sn: ${S})`),Nt.timestampOffset=$e)}}}this.appendExecutor(o,l)},onStart:()=>{},onComplete:()=>{const mt=self.performance.now();x.executeEnd=x.end=mt,N.first===0&&(N.first=mt),F&&F.first===0&&(F.first=mt);const Nt={};this.sourceBuffers.forEach(([gt,Tt])=>{gt&&(Nt[gt]=Vr.getBuffered(Tt))}),this.appendErrors[l]=0,l==="audio"||l==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(E.BUFFER_APPENDED,{type:l,frag:p,part:y,chunkMeta:g,parent:p.type,timeRanges:Nt})},onError:mt=>{var Nt;const gt={type:Le.MEDIA_ERROR,parent:p.type,details:te.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:p,part:y,chunkMeta:g,error:mt,err:mt,fatal:!1};if(mt.code===DOMException.QUOTA_EXCEEDED_ERR)gt.details=te.BUFFER_FULL_ERROR;else if(mt.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!((Nt=this.media)!=null&&Nt.error))gt.errorAction=yr(!0);else if(mt.name===zc)this.sourceBufferCount===0?gt.errorAction=yr(!0):++this.appendErrors[l];else{const Tt=++this.appendErrors[l];this.warn(`Failed ${Tt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer`),Tt>=this.hls.config.appendErrorMaxRetry&&(gt.fatal=!0)}this.hls.trigger(E.ERROR,gt)}};this.append(ht,l,this.isPending(this.tracks[l]))}getFlushOp(t,i,s){return this.log(`queuing "${t}" remove ${i}-${s}`),{label:"remove",execute:()=>{this.removeExecutor(t,i,s)},onStart:()=>{},onComplete:()=>{this.hls.trigger(E.BUFFER_FLUSHED,{type:t})},onError:o=>{this.warn(`Failed to remove ${i}-${s} from "${t}" SourceBuffer`,o)}}}onBufferFlushing(t,i){const{type:s,startOffset:o,endOffset:l}=i;s?this.append(this.getFlushOp(s,o,l),s):this.sourceBuffers.forEach(([c])=>{c&&this.append(this.getFlushOp(c,o,l),c)})}onFragParsed(t,i){const{frag:s,part:o}=i,l=[],c=o?o.elementaryStreams:s.elementaryStreams;c[L.AUDIOVIDEO]?l.push("audiovideo"):(c[L.AUDIO]&&l.push("audio"),c[L.VIDEO]&&l.push("video"));const p=()=>{const y=self.performance.now();s.stats.buffering.end=y,o&&(o.stats.buffering.end=y);const g=o?o.stats:s.stats;this.hls.trigger(E.FRAG_BUFFERED,{frag:s,part:o,stats:g,id:s.type})};l.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(p,l)}onFragChanged(t,i){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([t])=>{var i,s;return t&&(!((i=this.tracks[t])!=null&&i.ended)||((s=this.tracks[t])==null?void 0:s.ending))})}onBufferEos(t,i){var s;this.sourceBuffers.forEach(([c])=>{if(c){const p=this.tracks[c];(!i.type||i.type===c)&&(p.ending=!0,p.ended||(p.ended=!0,this.log(`${c} buffer reached EOS`)))}});const o=((s=this.overrides)==null?void 0:s.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([c])=>{var p;return c&&!((p=this.tracks[c])!=null&&p.ended)})&&(o?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:c}=this;if(!c||c.readyState!=="open"){c&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${c.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),c.endOfStream(),this.hls.trigger(E.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(E.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([t])=>{if(t!==null){const i=this.tracks[t];i&&(i.ending=!1)}})}onLevelUpdated(t,{details:i}){i.fragments.length&&(this.details=i,this.updateDuration())}updateDuration(){const t=this.getDurationAndRange();t&&this.blockUntilOpen(()=>this.updateMediaSource(t))}onError(t,i){if(i.details===te.BUFFER_APPEND_ERROR&&i.frag){var s;const o=(s=i.errorAction)==null?void 0:s.nextAutoLevel;pe(o)&&o!==i.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:t,details:i,media:s}=this;if(!s||i===null||!this.sourceBufferCount)return;const o=t.config,l=s.currentTime,c=i.levelTargetDuration,p=i.live&&o.liveBackBufferLength!==null?o.liveBackBufferLength:o.backBufferLength;if(pe(p)&&p>=0){const y=Math.max(p,c),g=Math.floor(l/c)*c-y;this.flushBackBuffer(l,c,g)}if(pe(o.frontBufferFlushThreshold)&&o.frontBufferFlushThreshold>0){const y=Math.max(o.maxBufferLength,o.frontBufferFlushThreshold),g=Math.max(y,c),x=Math.floor(l/c)*c+g;this.flushFrontBuffer(l,c,x)}}flushBackBuffer(t,i,s){this.sourceBuffers.forEach(([o,l])=>{if(l){const p=Vr.getBuffered(l);if(p.length>0&&s>p.start(0)){var c;this.hls.trigger(E.BACK_BUFFER_REACHED,{bufferEnd:s});const y=this.tracks[o];if((c=this.details)!=null&&c.live)this.hls.trigger(E.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(y!=null&&y.ended){this.log(`Cannot flush ${o} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:s,type:o})}}})}flushFrontBuffer(t,i,s){this.sourceBuffers.forEach(([o,l])=>{if(l){const c=Vr.getBuffered(l),p=c.length;if(p<2)return;const y=c.start(p-1),g=c.end(p-1);if(s>y||t>=y&&t<=g)return;this.hls.trigger(E.BUFFER_FLUSHING,{startOffset:y,endOffset:1/0,type:o})}})}getDurationAndRange(){var t;const{details:i,mediaSource:s}=this;if(!i||!this.media||(s==null?void 0:s.readyState)!=="open")return null;const o=i.edge;if(i.live&&this.hls.config.liveDurationInfinity){if(i.fragments.length&&i.live&&s.setLiveSeekableRange){const g=Math.max(0,i.fragmentStart),x=Math.max(g,o);return{duration:1/0,start:g,end:x}}return{duration:1/0}}const l=(t=this.overrides)==null?void 0:t.duration;if(l)return pe(l)?{duration:l}:null;const c=this.media.duration,p=pe(s.duration)?s.duration:0;return o>p&&o>c||!pe(c)?{duration:o}:null}updateMediaSource({duration:t,start:i,end:s}){const o=this.mediaSource;!this.media||!o||o.readyState!=="open"||(o.duration!==t&&(pe(t)&&this.log(`Updating MediaSource duration to ${t.toFixed(3)}`),o.duration=t),i!==void 0&&s!==void 0&&(this.log(`MediaSource duration is set to ${o.duration}. Setting seekable range to ${i}-${s}.`),o.setLiveSeekableRange(i,s)))}get tracksReady(){const t=this.pendingTrackCount;return t>0&&(t>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:t,pendingTrackCount:i,tracks:s}=this;if(this.log(`checkPendingTracks (pending: ${i} codec events expected: ${t}) ${Ur(s)}`),this.tracksReady){var o;const l=(o=this.transferData)==null?void 0:o.tracks;l&&Object.keys(l).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const t={};this.sourceBuffers.forEach(([i,s])=>{if(i){const o=this.tracks[i];t[i]={buffer:s,container:o.container,codec:o.codec,supplemental:o.supplemental,levelCodec:o.levelCodec,id:o.id,metadata:o.metadata}}}),this.hls.trigger(E.BUFFER_CREATED,{tracks:t}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([i])=>{this.executeNext(i)})}else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}createSourceBuffers(){const{tracks:t,sourceBuffers:i,mediaSource:s}=this;if(!s)throw new Error("createSourceBuffers called when mediaSource was null");for(const l in t){const c=l,p=t[c];if(this.isPending(p)){const y=this.getTrackCodec(p,c),g=`${p.container};codecs=${y}`;p.codec=y,this.log(`creating sourceBuffer(${g})${this.currentOp(c)?" Queued":""} ${Ur(p)}`);try{const x=s.addSourceBuffer(g),S=d0(c),R=[c,x];i[S]=R,p.buffer=x}catch(x){var o;this.error(`error while trying to add sourceBuffer: ${x.message}`),this.shiftAndExecuteNext(c),(o=this.operationQueue)==null||o.removeBlockers(),delete this.tracks[c],this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,sourceBufferName:c,mimeType:g,parent:p.id});return}this.trackSourceBuffer(c,p)}}this.bufferCreated()}getTrackCodec(t,i){const s=t.supplemental;let o=t.codec;s&&(i==="video"||i==="audiovideo")&&He(s,"video")&&(o=Yt(o,s));const l=vr(o,t.levelCodec);return l?i.slice(0,5)==="audio"?Ae(l,this.appendSource):l:""}trackSourceBuffer(t,i){const s=i.buffer;if(!s)return;const o=this.getTrackCodec(i,t);this.tracks[t]={buffer:s,codec:o,container:i.container,levelCodec:i.levelCodec,supplemental:i.supplemental,metadata:i.metadata,id:i.id,listeners:[]},this.removeBufferListeners(t),this.addBufferListener(t,"updatestart",this.onSBUpdateStart),this.addBufferListener(t,"updateend",this.onSBUpdateEnd),this.addBufferListener(t,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(t,"bufferedchange",(l,c)=>{const p=c.removedRanges;p!=null&&p.length&&this.hls.trigger(E.BUFFER_FLUSHED,{type:l})})}get mediaSrc(){var t,i;const s=((t=this.media)==null||(i=t.querySelector)==null?void 0:i.call(t,"source"))||this.media;return s==null?void 0:s.src}onSBUpdateStart(t){const i=this.currentOp(t);i&&i.onStart()}onSBUpdateEnd(t){var i;if(((i=this.mediaSource)==null?void 0:i.readyState)==="closed"){this.resetBuffer(t);return}const s=this.currentOp(t);s&&(s.onComplete(),this.shiftAndExecuteNext(t))}onSBUpdateError(t,i){var s;const o=new Error(`${t} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${o}`,i),this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:o,fatal:!1});const l=this.currentOp(t);l&&l.onError(o)}removeExecutor(t,i,s){const{media:o,mediaSource:l}=this,c=this.tracks[t],p=c==null?void 0:c.buffer;if(!o||!l||!p){this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(t);return}const y=pe(o.duration)?o.duration:1/0,g=pe(l.duration)?l.duration:1/0,x=Math.max(0,i),S=Math.min(s,y,g);S>x&&(!c.ending||c.ended)?(c.ended=!1,this.log(`Removing [${x},${S}] from the ${t} SourceBuffer`),p.remove(x,S)):this.shiftAndExecuteNext(t)}appendExecutor(t,i){const s=this.tracks[i],o=s==null?void 0:s.buffer;if(!o)throw new h0(`Attempting to append to the ${i} SourceBuffer, but it does not exist`);s.ending=!1,s.ended=!1,o.appendBuffer(t)}blockUntilOpen(t){this.isUpdating()||this.isQueued()?this.blockBuffers(t):t()}isUpdating(){return this.sourceBuffers.some(([t,i])=>t&&i.updating)}isQueued(){return this.sourceBuffers.some(([t])=>t&&!!this.currentOp(t))}isPending(t){return!!t&&!t.buffer}blockBuffers(t,i=this.sourceBufferTypes){if(!i.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);return}const{operationQueue:s}=this,o=i.map(c=>this.appendBlocker(c));i.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(o).then(c=>{s===this.operationQueue&&(t(),this.stepOperationQueue(i))})}stepOperationQueue(t){t.forEach(i=>{var s;const o=(s=this.tracks[i])==null?void 0:s.buffer;!o||o.updating||this.shiftAndExecuteNext(i)})}append(t,i,s){this.operationQueue&&this.operationQueue.append(t,i,s)}appendBlocker(t){if(this.operationQueue)return this.operationQueue.appendBlocker(t)}currentOp(t){return this.operationQueue?this.operationQueue.current(t):null}executeNext(t){t&&this.operationQueue&&this.operationQueue.executeNext(t)}shiftAndExecuteNext(t){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(t)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((t,i)=>t+(this.isPending(this.tracks[i])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((t,[i])=>t+(i?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([t])=>t).filter(t=>!!t)}addBufferListener(t,i,s){const o=this.tracks[t];if(!o)return;const l=o.buffer;if(!l)return;const c=s.bind(this,t);o.listeners.push({event:i,listener:c}),l.addEventListener(i,c)}removeBufferListeners(t){const i=this.tracks[t];if(!i)return;const s=i.buffer;s&&(i.listeners.forEach(o=>{s.removeEventListener(o.event,o.listener)}),i.listeners.length=0)}}function Ou(h){const t=h.querySelectorAll("source");[].slice.call(t).forEach(i=>{h.removeChild(i)})}function Uc(h,t){const i=self.document.createElement("source");i.type="video/mp4",i.src=t,h.appendChild(i)}function d0(h){return h==="audio"?1:0}class J0{constructor(t){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(t){this.streamController=t}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:t}=this;t.on(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.BUFFER_CODECS,this.onBufferCodecs,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(E.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.BUFFER_CODECS,this.onBufferCodecs,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(t,i){const s=this.hls.levels[i.droppedLevel];this.isLevelAllowed(s)&&this.restrictedLevels.push({bitrate:s.bitrate,height:s.height,width:s.width})}onMediaAttaching(t,i){this.media=i.media instanceof HTMLVideoElement?i.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(t,i){const s=this.hls;this.restrictedLevels=[],this.firstLevel=i.firstLevel,s.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onLevelsUpdated(t,i){this.timer&&pe(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,i){this.hls.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const t=this.hls.levels;if(t.length){const i=this.hls,s=this.getMaxLevel(t.length-1);s!==this.autoLevelCapping&&i.logger.log(`Setting autoLevelCapping to ${s}: ${t[s].height}p@${t[s].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),i.autoLevelCapping=s,i.autoLevelEnabled&&i.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=i.autoLevelCapping}}}getMaxLevel(t){const i=this.hls.levels;if(!i.length)return-1;const s=i.filter((o,l)=>this.isLevelAllowed(o)&&l<=t);return this.clientRect=null,J0.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const t=this.media,i={width:0,height:0};if(t){const s=t.getBoundingClientRect();i.width=s.width,i.height=s.height,!i.width&&!i.height&&(i.width=s.right-s.left||t.width||0,i.height=s.bottom-s.top||t.height||0)}return this.clientRect=i,i}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(i){}return Math.min(t,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(t){return!this.restrictedLevels.some(s=>t.bitrate===s.bitrate&&t.width===s.width&&t.height===s.height)}static getMaxLevelByMediaSize(t,i,s){if(!(t!=null&&t.length))return-1;const o=(p,y)=>y?p.width!==y.width||p.height!==y.height:!0;let l=t.length-1;const c=Math.max(i,s);for(let p=0;p<t.length;p+=1){const y=t[p];if((y.width>=c||y.height>=c)&&o(y,t[p+1])){l=p;break}}return l}}const ta={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},f0={HLS:"h"},Ns={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},Kc={[Ns.OBJECT]:["br","d","ot","tb"],[Ns.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Ns.SESSION]:["cid","pr","sf","sid","st","v"],[Ns.STATUS]:["bs","rtp"]};class da{constructor(t,i){Array.isArray(t)&&(t=t.map(s=>s instanceof da?s:new da(s))),this.value=t,this.params=i}}const Hc="Dict";function Xh(h){return Array.isArray(h)?JSON.stringify(h):h instanceof Map?"Map{}":h instanceof Set?"Set{}":typeof h=="object"?JSON.stringify(h):String(h)}function Jh(h,t,i,s){return new Error(`failed to ${h} "${Xh(t)}" as ${i}`,{cause:s})}function wa(h,t,i){return Jh("serialize",h,t,i)}class Zl{constructor(t){this.description=t}}const Yl="Bare Item",ur="Boolean";function Q0(h){if(typeof h!="boolean")throw wa(h,ur);return h?"?1":"?0"}const p0="Byte Sequence";function m0(h){if(ArrayBuffer.isView(h)===!1)throw wa(h,p0);return`:${la(h)}:`}const g0="Integer";function Qh(h){return h<-999999999999999||999999999999999<h}function Gc(h){if(Qh(h))throw wa(h,g0);return h.toString()}function ed(h){return`@${Gc(h.getTime()/1e3)}`}const gs="Decimal";function td(h){const t=al(h,3);if(Math.floor(Math.abs(t)).toString().length>12)throw wa(h,gs);const i=t.toString();return i.includes(".")?i:`${i}.0`}const ec="String",v0=/[\x00-\x1f\x7f]+/;function y0(h){if(v0.test(h))throw wa(h,ec);return`"${h.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function vl(h){return h.description||h.toString().slice(7,-1)}const Xl="Token";function ra(h){const t=vl(h);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t)===!1)throw wa(t,Xl);return t}function co(h){switch(typeof h){case"number":if(!pe(h))throw wa(h,Yl);return Number.isInteger(h)?Gc(h):td(h);case"string":return y0(h);case"symbol":return ra(h);case"boolean":return Q0(h);case"object":if(h instanceof Date)return ed(h);if(h instanceof Uint8Array)return m0(h);if(h instanceof Zl)return ra(h);default:throw wa(h,Yl)}}const zs="Key";function Va(h){if(/^[a-z*][a-z0-9\-_.*]*$/.test(h)===!1)throw wa(h,zs);return h}function yl(h){return h==null?"":Object.entries(h).map(([t,i])=>i===!0?`;${Va(t)}`:`;${Va(t)}=${co(i)}`).join("")}function La(h){return h instanceof da?`${co(h.value)}${yl(h.params)}`:co(h)}function Vc(h){return`(${h.value.map(La).join(" ")})${yl(h.params)}`}function Wc(h,t={whitespace:!0}){if(typeof h!="object")throw wa(h,Hc);const i=h instanceof Map?h.entries():Object.entries(h),s=t!=null&&t.whitespace?" ":"";return Array.from(i).map(([o,l])=>{l instanceof da||(l=new da(l));let c=Va(o);return l.value===!0?c+=yl(l.params):(c+="=",Array.isArray(l.value)?c+=Vc(l):c+=La(l)),c}).join(`,${s}`)}function tc(h,t){return Wc(h,t)}function rd(h){return h==="ot"||h==="sf"||h==="st"}function Cs(h){return typeof h=="number"?pe(h):h!=null&&h!==""&&h!==!1}const fa=h=>Math.round(h),id=(h,t)=>(t!=null&&t.baseUrl&&(h=xu(h,t.baseUrl)),encodeURIComponent(h)),Bu=h=>fa(h/100)*100,rc={br:fa,d:fa,bl:Bu,dl:Bu,mtp:Bu,nor:id,rtp:Bu,tb:fa};function qi(h,t){const i={};if(h==null||typeof h!="object")return i;const s=Object.keys(h).sort(),o=k({},rc,t==null?void 0:t.formatters),l=t==null?void 0:t.filter;return s.forEach(c=>{if(l!=null&&l(c))return;let p=h[c];const y=o[c];y&&(p=y(p,t)),!(c==="v"&&p===1)&&(c=="pr"&&p===1||Cs(p)&&(rd(c)&&typeof p=="string"&&(p=new Zl(p)),i[c]=p))}),i}function bl(h,t={}){return h?tc(qi(h,t),k({whitespace:!1},t)):""}function _l(h,t={}){const i={};if(!h)return i;const s=Object.entries(h),o=Object.entries(Kc).concat(Object.entries((t==null?void 0:t.customHeaderMap)||{})),l=s.reduce((c,p)=>{var y,g;const[x,S]=p,R=((y=o.find(N=>N[1].includes(x)))===null||y===void 0?void 0:y[0])||Ns.REQUEST;return(g=c[R])!==null&&g!==void 0||(c[R]={}),c[R][x]=S,c},{});return Object.entries(l).reduce((c,[p,y])=>(c[p]=bl(y,t),c),i)}function b0(h,t,i){return k(h,_l(t,i))}const $t="CMCD";function nd(h,t={}){if(!h)return"";const i=bl(h,t);return`${$t}=${encodeURIComponent(i)}`}const jc=/CMCD=[^&#]+/;function ic(h,t,i){const s=nd(t,i);if(!s)return h;if(jc.test(h))return h.replace(jc,s);const o=h.includes("?")?"&":"?";return`${h}${o}${s}`}class sd{constructor(t){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=o=>{try{this.apply(o,{ot:ta.MANIFEST,su:!this.initialized})}catch(l){this.hls.logger.warn("Could not generate manifest CMCD data.",l)}},this.applyFragmentData=o=>{try{const{frag:l,part:c}=o,p=this.hls.levels[l.level],y=this.getObjectType(l),g={d:(c||l).duration*1e3,ot:y};(y===ta.VIDEO||y===ta.AUDIO||y==ta.MUXED)&&(g.br=p.bitrate/1e3,g.tb=this.getTopBandwidth(y)/1e3,g.bl=this.getBufferLength(y));const x=c?this.getNextPart(c):this.getNextFrag(l);x!=null&&x.url&&x.url!==l.url&&(g.nor=x.url),this.apply(o,g)}catch(l){this.hls.logger.warn("Could not generate segment CMCD data.",l)}},this.hls=t;const i=this.config=t.config,{cmcd:s}=i;s!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||t.sessionId,this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHED,this.onMediaDetached,this),t.on(E.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHED,this.onMediaDetached,this),t.off(E.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(t,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(t,i){var s,o;this.audioBuffer=(s=i.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(o=i.tracks.video)==null?void 0:o.buffer}createData(){var t;return{v:1,sf:f0.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)==null?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,i={}){k(i,this.createData());const s=i.ot===ta.INIT||i.ot===ta.VIDEO||i.ot===ta.MUXED;this.starved&&s&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering);const{includeKeys:o}=this;o&&(i=Object.keys(i).reduce((c,p)=>(o.includes(p)&&(c[p]=i[p]),c),{}));const l={baseUrl:t.url};this.useHeaders?(t.headers||(t.headers={}),b0(t.headers,i,l)):t.url=ic(t.url,i,l)}getNextFrag(t){var i;const s=(i=this.hls.levels[t.level])==null?void 0:i.details;if(s){const o=t.sn-s.startSN;return s.fragments[o+1]}}getNextPart(t){var i,s;const{index:o,fragment:l}=t,c=(i=this.hls.levels[l.level])==null||(s=i.details)==null?void 0:s.partList;if(c){const{sn:p}=l;for(let y=c.length-1;y>=0;y--){const g=c[y];if(g.index===o&&g.fragment.sn===p)return c[y+1]}}}getObjectType(t){const{type:i}=t;if(i==="subtitle")return ta.TIMED_TEXT;if(t.sn==="initSegment")return ta.INIT;if(i==="audio")return ta.AUDIO;if(i==="main")return this.hls.audioTracks.length?ta.VIDEO:ta.MUXED}getTopBandwidth(t){let i=0,s;const o=this.hls;if(t===ta.AUDIO)s=o.audioTracks;else{const l=o.maxAutoLevel,c=l>-1?l+1:o.levels.length;s=o.levels.slice(0,c)}for(const l of s)l.bitrate>i&&(i=l.bitrate);return i>0?i:NaN}getBufferLength(t){const i=this.media,s=t===ta.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!i?NaN:Vr.bufferInfo(s,i.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:t}=this.config,i=this.applyPlaylistData,s=t||this.config.loader;return class{constructor(l){this.loader=void 0,this.loader=new s(l)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(l,c,p){i(l),this.loader.load(l,c,p)}}}createFragmentLoader(){const{fLoader:t}=this.config,i=this.applyFragmentData,s=t||this.config.loader;return class{constructor(l){this.loader=void 0,this.loader=new s(l)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(l,c,p){i(l),this.loader.load(l,c,p)}}}}const Fu=3e5;class ad extends ae{constructor(t){super("content-steering",t.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((t,i)=>(t.indexOf(i.pathwayId)===-1&&t.push(i.pathwayId),t),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(t){this.updatePathwayPriority(t)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const t=this.timeToLoad*1e3-(performance.now()-this.updated);if(t>0){this.scheduleRefresh(this.uri,t);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(t){const i=this.levels;i&&(this.levels=i.filter(s=>s!==t))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(t,i){const{contentSteering:s}=i;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(t,i){this.audioTracks=i.audioTracks,this.subtitleTracks=i.subtitleTracks}onError(t,i){const{errorAction:s}=i;if((s==null?void 0:s.action)===Ar.SendAlternateToPenaltyBox&&s.flags===je.MoveAllAlternatesMatchingHost){const o=this.levels;let l=this._pathwayPriority,c=this.pathwayId;if(i.context){const{groupId:p,pathwayId:y,type:g}=i.context;p&&o?c=this.getPathwayForGroupId(p,g,c):y&&(c=y)}c in this.penalizedPathways||(this.penalizedPathways[c]=performance.now()),!l&&o&&(l=this.pathways()),l&&l.length>1&&(this.updatePathwayPriority(l),s.resolved=this.pathwayId!==c),s.resolved||this.warn(`Could not resolve ${i.details} ("${i.error.message}") with content-steering for Pathway: ${c} levels: ${o&&o.length} priorities: ${Ur(l)} penalized: ${Ur(this.penalizedPathways)}`)}}filterParsedLevels(t){this.levels=t;let i=this.getLevelsForPathway(this.pathwayId);if(i.length===0){const s=t[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),i=this.getLevelsForPathway(s),this.pathwayId=s}return i.length!==t.length&&this.log(`Found ${i.length}/${t.length} levels in Pathway "${this.pathwayId}"`),i}getLevelsForPathway(t){return this.levels===null?[]:this.levels.filter(i=>t===i.pathwayId)}updatePathwayPriority(t){this._pathwayPriority=t;let i;const s=this.penalizedPathways,o=performance.now();Object.keys(s).forEach(l=>{o-s[l]>Fu&&delete s[l]});for(let l=0;l<t.length;l++){const c=t[l];if(c in s)continue;if(c===this.pathwayId)return;const p=this.hls.nextLoadLevel,y=this.hls.levels[p];if(i=this.getLevelsForPathway(c),i.length>0){this.log(`Setting Pathway to "${c}"`),this.pathwayId=c,Js(i),this.hls.trigger(E.LEVELS_UPDATED,{levels:i});const g=this.hls.levels[p];y&&g&&this.levels&&(g.attrs["STABLE-VARIANT-ID"]!==y.attrs["STABLE-VARIANT-ID"]&&g.bitrate!==y.bitrate&&this.log(`Unstable Pathways change from bitrate ${y.bitrate} to ${g.bitrate}`),this.hls.nextLoadLevel=p);break}}}getPathwayForGroupId(t,i,s){const o=this.getLevelsForPathway(s).concat(this.levels||[]);for(let l=0;l<o.length;l++)if(i===Me.AUDIO_TRACK&&o[l].hasAudioGroup(t)||i===Me.SUBTITLE_TRACK&&o[l].hasSubtitleGroup(t))return o[l].pathwayId;return s}clonePathways(t){const i=this.levels;if(!i)return;const s={},o={};t.forEach(l=>{const{ID:c,"BASE-ID":p,"URI-REPLACEMENT":y}=l;if(i.some(x=>x.pathwayId===c))return;const g=this.getLevelsForPathway(p).map(x=>{const S=new pi(x.attrs);S["PATHWAY-ID"]=c;const R=S.AUDIO&&`${S.AUDIO}_clone_${c}`,N=S.SUBTITLES&&`${S.SUBTITLES}_clone_${c}`;R&&(s[S.AUDIO]=R,S.AUDIO=R),N&&(o[S.SUBTITLES]=N,S.SUBTITLES=N);const F=Ds(x.uri,S["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",y),X=new Br({attrs:S,audioCodec:x.audioCodec,bitrate:x.bitrate,height:x.height,name:x.name,url:F,videoCodec:x.videoCodec,width:x.width});if(x.audioGroups)for(let ne=1;ne<x.audioGroups.length;ne++)X.addGroupId("audio",`${x.audioGroups[ne]}_clone_${c}`);if(x.subtitleGroups)for(let ne=1;ne<x.subtitleGroups.length;ne++)X.addGroupId("text",`${x.subtitleGroups[ne]}_clone_${c}`);return X});i.push(...g),qc(this.audioTracks,s,y,c),qc(this.subtitleTracks,o,y,c)})}loadSteeringManifest(t){const i=this.hls.config,s=i.loader;this.loader&&this.loader.destroy(),this.loader=new s(i);let o;try{o=new self.URL(t)}catch(x){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${t}`);return}if(o.protocol!=="data:"){const x=(this.hls.bandwidthEstimate||i.abrEwmaDefaultEstimate)|0;o.searchParams.set("_HLS_pathway",this.pathwayId),o.searchParams.set("_HLS_throughput",""+x)}const l={responseType:"json",url:o.href},c=i.steeringManifestLoadPolicy.default,p=c.errorRetry||c.timeoutRetry||{},y={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:p.maxNumRetry||0,retryDelay:p.retryDelayMs||0,maxRetryDelay:p.maxRetryDelayMs||0},g={onSuccess:(x,S,R,N)=>{this.log(`Loaded steering manifest: "${o}"`);const F=x.data;if((F==null?void 0:F.VERSION)!==1){this.log(`Steering VERSION ${F.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=F.TTL;const{"RELOAD-URI":X,"PATHWAY-CLONES":ne,"PATHWAY-PRIORITY":Ce}=F;if(X)try{this.uri=new self.URL(X,o).href}catch($e){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${X}`);return}this.scheduleRefresh(this.uri||R.url),ne&&this.clonePathways(ne);const qe={steeringManifest:F,url:o.toString()};this.hls.trigger(E.STEERING_MANIFEST_LOADED,qe),Ce&&this.updatePathwayPriority(Ce)},onError:(x,S,R,N)=>{if(this.log(`Error loading steering manifest: ${x.code} ${x.text} (${S.url})`),this.stopLoad(),x.code===410){this.enabled=!1,this.log(`Steering manifest ${S.url} no longer available`);return}let F=this.timeToLoad*1e3;if(x.code===429){const X=this.loader;if(typeof(X==null?void 0:X.getResponseHeader)=="function"){const ne=X.getResponseHeader("Retry-After");ne&&(F=parseFloat(ne)*1e3)}this.log(`Steering manifest ${S.url} rate limited`);return}this.scheduleRefresh(this.uri||S.url,F)},onTimeout:(x,S,R)=>{this.log(`Timeout loading steering manifest (${S.url})`),this.scheduleRefresh(this.uri||S.url)}};this.log(`Requesting steering manifest: ${o}`),this.loader.load(l,y,g)}scheduleRefresh(t,i=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const o=(s=this.hls)==null?void 0:s.media;if(o&&!o.ended){this.loadSteeringManifest(t);return}this.scheduleRefresh(t,this.timeToLoad*1e3)},i)}}function qc(h,t,i,s){h&&Object.keys(t).forEach(o=>{const l=h.filter(c=>c.groupId===o).map(c=>{const p=k({},c);return p.details=void 0,p.attrs=new pi(p.attrs),p.url=p.attrs.URI=Ds(c.url,c.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),p.groupId=p.attrs["GROUP-ID"]=t[o],p.attrs["PATHWAY-ID"]=s,p});h.push(...l)})}function Ds(h,t,i,s){const{HOST:o,PARAMS:l,[i]:c}=s;let p;t&&(p=c==null?void 0:c[t],p&&(h=p));const y=new self.URL(h);return o&&!p&&(y.host=o),l&&Object.keys(l).sort().forEach(g=>{g&&y.searchParams.set(g,l[g])}),y.href}class pa extends ae{constructor(t){super("eme",t.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=pa.CDMCleanupPromise?[pa.CDMCleanupPromise]:[],this.onMediaEncrypted=i=>{const{initDataType:s,initData:o}=i,l=`"${i.type}" event: init data type: "${s}"`;if(this.debug(l),o!==null){if(!this.keyFormatPromise){let c=Object.keys(this.keySystemAccessPromises);c.length||(c=Lr(this.config));const p=c.map(Jn).filter(y=>!!y);this.keyFormatPromise=this.getKeyFormatPromise(p)}this.keyFormatPromise.then(c=>{const p=Mi(c);let y,g;if(s==="sinf"){if(p!==Oi.FAIRPLAY){this.warn(`Ignoring unexpected "${i.type}" event with init data type: "${s}" for selected key-system ${p}`);return}const F=kr(new Uint8Array(o));try{const X=Fi(JSON.parse(F).sinf),ne=Ht(X);if(!ne)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");y=new Uint8Array(ne.subarray(8,24)),g=Oi.FAIRPLAY}catch(X){this.warn(`${l} Failed to parse sinf: ${X}`);return}}else{if(p!==Oi.WIDEVINE&&p!==Oi.PLAYREADY){this.warn(`Ignoring unexpected "${i.type}" event with init data type: "${s}" for selected key-system ${p}`);return}const F=dt(o),X=F.filter(Ce=>!!Ce.systemId&&kn(Ce.systemId)===p);X.length>1&&this.warn(`${l} Using first of ${X.length} pssh found for selected key-system ${p}`);const ne=X[0];if(!ne){F.length===0||F.some(Ce=>!Ce.systemId)?this.warn(`${l} contains incomplete or invalid pssh data`):this.log(`ignoring ${l} for ${F.map(Ce=>kn(Ce.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(g=kn(ne.systemId),ne.version===0&&ne.data)if(g===Oi.WIDEVINE){const Ce=ne.data.length-22;y=new Uint8Array(ne.data.subarray(Ce,Ce+16))}else g===Oi.PLAYREADY&&(y=Ji(ne.data))}if(!g||!y)return;const x=de.hexDump(y),{keyIdToKeySessionPromise:S,mediaKeySessions:R}=this;let N=S[x];for(let F=0;F<R.length;F++){const X=R[F],ne=X.decryptdata;if(!ne.keyId)continue;const Ce=de.hexDump(ne.keyId);if(x===Ce||ne.uri.replace(/-/g,"").indexOf(x)!==-1){if(N=S[Ce],ne.pssh)break;delete S[Ce],ne.pssh=new Uint8Array(o),ne.keyId=y,N=S[x]=N.then(()=>this.generateRequestWithPreferredKeySession(X,s,o,"encrypted-event-key-match")),N.catch(qe=>this.handleError(qe));break}}if(!N){if(g!==p){this.log(`Ignoring "${i.type}" event with ${g} init data for selected key-system ${p}`);return}N=S[x]=this.getKeySystemSelectionPromise([g]).then(({keySystem:F,mediaKeys:X})=>{var ne;this.throwIfDestroyed();const Ce=new as("ISO-23001-7",x,(ne=Jn(F))!=null?ne:"");return Ce.pssh=new Uint8Array(o),Ce.keyId=y,this.attemptSetMediaKeys(F,X).then(()=>{this.throwIfDestroyed();const qe=this.createMediaKeySessionContext({decryptdata:Ce,keySystem:F,mediaKeys:X});return this.generateRequestWithPreferredKeySession(qe,s,o,"encrypted-event-no-match")})}),N.catch(F=>this.handleError(F))}})}},this.onWaitingForKey=i=>{this.log(`"${i.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){const t=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(t);const i=this.config;i.requestMediaKeySystemAccessFunc=null,i.licenseXhrSetup=i.licenseResponseCallback=void 0,i.drmSystems=i.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(E.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(E.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(E.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(E.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(t){const{drmSystems:i,widevineLicenseUrl:s}=this.config,o=i[t];if(o)return o.licenseUrl;if(t===Oi.WIDEVINE&&s)return s}getLicenseServerUrlOrThrow(t){const i=this.getLicenseServerUrl(t);if(i===void 0)throw new Error(`no license server URL configured for key-system "${t}"`);return i}getServerCertificateUrl(t){const{drmSystems:i}=this.config,s=i[t];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${t}"]`)}attemptKeySystemAccess(t){const i=this.hls.levels,s=(c,p,y)=>!!c&&y.indexOf(c)===p,o=i.map(c=>c.audioCodec).filter(s),l=i.map(c=>c.videoCodec).filter(s);return o.length+l.length===0&&l.push("avc1.42e01e"),new Promise((c,p)=>{const y=g=>{const x=g.shift();this.getMediaKeysPromise(x,o,l).then(S=>c({keySystem:x,mediaKeys:S})).catch(S=>{g.length?y(g):S instanceof js?p(S):p(new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_ACCESS,error:S,fatal:!0},S.message))})};y(t)})}requestMediaKeySystemAccess(t,i){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let o=`Configured requestMediaKeySystemAccess is not a function ${s}`;return Jr===null&&self.location.protocol==="http:"&&(o=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(o))}return s(t,i)}getMediaKeysPromise(t,i,s){const o=yn(t,i,s,this.config.drmSystemOptions),l=this.keySystemAccessPromises[t];let c=l==null?void 0:l.keySystemAccess;if(!c){this.log(`Requesting encrypted media "${t}" key-system access with config: ${Ur(o)}`),c=this.requestMediaKeySystemAccess(t,o);const p=this.keySystemAccessPromises[t]={keySystemAccess:c};return c.catch(y=>{this.log(`Failed to obtain access to key-system "${t}": ${y}`)}),c.then(y=>{this.log(`Access for key-system "${y.keySystem}" obtained`);const g=this.fetchServerCertificate(t);return this.log(`Create media-keys for "${t}"`),p.mediaKeys=y.createMediaKeys().then(x=>(this.log(`Media-keys created for "${t}"`),g.then(S=>S?this.setMediaKeysServerCertificate(x,t,S):x))),p.mediaKeys.catch(x=>{this.error(`Failed to create media-keys for "${t}"}: ${x}`)}),p.mediaKeys})}return c.then(()=>l.mediaKeys)}createMediaKeySessionContext({decryptdata:t,keySystem:i,mediaKeys:s}){this.log(`Creating key-system session "${i}" keyId: ${de.hexDump(t.keyId||[])}`);const o=s.createSession(),l={decryptdata:t,keySystem:i,mediaKeys:s,mediaKeysSession:o,keyStatus:"status-pending"};return this.mediaKeySessions.push(l),l}renewKeySession(t){const i=t.decryptdata;if(i.pssh){const s=this.createMediaKeySessionContext(t),o=this.getKeyIdString(i),l="cenc";this.keyIdToKeySessionPromise[o]=this.generateRequestWithPreferredKeySession(s,l,i.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}getKeyIdString(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(t.keyId===null)throw new Error("keyId is null");return de.hexDump(t.keyId)}updateKeySession(t,i){var s;const o=t.mediaKeysSession;return this.log(`Updating key-session "${o.sessionId}" for keyID ${de.hexDump(((s=t.decryptdata)==null?void 0:s.keyId)||[])}
} (data length: ${i&&i.byteLength})`),o.update(i)}selectKeySystemFormat(t){const i=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${t.sn} ${t.type}: ${t.level}) key formats ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)),this.keyFormatPromise}getKeyFormatPromise(t){return new Promise((i,s)=>{const o=Lr(this.config),l=t.map(Mi).filter(c=>!!c&&o.indexOf(c)!==-1);return this.getKeySystemSelectionPromise(l).then(({keySystem:c})=>{const p=Jn(c);p?i(p):s(new Error(`Unable to find format for key-system "${c}"`))}).catch(s)})}loadKey(t){const i=t.keyInfo.decryptdata,s=this.getKeyIdString(i),o=`(keyId: ${s} format: "${i.keyFormat}" method: ${i.method} uri: ${i.uri})`;this.log(`Starting session for key ${o}`);let l=this.keyIdToKeySessionPromise[s];return l||(l=this.getKeySystemForKeyPromise(i).then(({keySystem:p,mediaKeys:y})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${t.frag.sn} ${t.frag.type}: ${t.frag.level} using key ${o}`),this.attemptSetMediaKeys(p,y).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:p,mediaKeys:y,decryptdata:i}))))),(this.keyIdToKeySessionPromise[s]=l.then(p=>{const y="cenc",g=i.pssh?i.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(p,y,g,"playlist-key")})).catch(p=>this.handleError(p))),l}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t){this.hls&&(this.error(t.message),t instanceof js?this.hls.trigger(E.ERROR,t.data):this.hls.trigger(E.ERROR,{type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))}getKeySystemForKeyPromise(t){const i=this.getKeyIdString(t),s=this.keyIdToKeySessionPromise[i];if(!s){const o=Mi(t.keyFormat),l=o?[o]:Lr(this.config);return this.attemptKeySystemAccess(l)}return s}getKeySystemSelectionPromise(t){if(t.length||(t=Lr(this.config)),t.length===0)throw new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Ur({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,i){const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const o=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(i)});return this.setMediaKeysQueue.push(o),o.then(()=>{this.log(`Media-keys set for "${t}"`),s.push(o),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(l=>s.indexOf(l)===-1)})}generateRequestWithPreferredKeySession(t,i,s,o){var l,c;const p=(l=this.config.drmSystems)==null||(c=l[t.keySystem])==null?void 0:c.generateRequest;if(p)try{const F=p.call(this.hls,i,s,t);if(!F)throw new Error("Invalid response from configured generateRequest filter");i=F.initDataType,s=F.initData?F.initData:null,t.decryptdata.pssh=s?new Uint8Array(s):null}catch(F){var y;if(this.warn(F.message),(y=this.hls)!=null&&y.config.debug)throw F}if(s===null)return this.log(`Skipping key-session request for "${o}" (no initData)`),Promise.resolve(t);const g=this.getKeyIdString(t.decryptdata);this.log(`Generating key-session request for "${o}": ${g} (init data type: ${i} length: ${s?s.byteLength:null})`);const x=new il,S=t._onmessage=F=>{const X=t.mediaKeysSession;if(!X){x.emit("error",new Error("invalid state"));return}const{messageType:ne,message:Ce}=F;this.log(`"${ne}" message event for session "${X.sessionId}" message size: ${Ce.byteLength}`),ne==="license-request"||ne==="license-renewal"?this.renewLicense(t,Ce).catch(qe=>{x.eventNames().length?x.emit("error",qe):this.handleError(qe)}):ne==="license-release"?t.keySystem===Oi.FAIRPLAY&&(this.updateKeySession(t,rn("acknowledged")),this.removeSession(t)):this.warn(`unhandled media key message type "${ne}"`)},R=t._onkeystatuseschange=F=>{if(!t.mediaKeysSession){x.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(t);const ne=t.keyStatus;x.emit("keyStatus",ne),ne==="expired"&&(this.warn(`${t.keySystem} expired for key ${g}`),this.renewKeySession(t))};t.mediaKeysSession.addEventListener("message",S),t.mediaKeysSession.addEventListener("keystatuseschange",R);const N=new Promise((F,X)=>{x.on("error",X),x.on("keyStatus",ne=>{ne.startsWith("usable")?F():ne==="output-restricted"?X(new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ne==="internal-error"?X(new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${ne}"`)):ne==="expired"?X(new Error("key expired while generating request")):this.warn(`unhandled key status change "${ne}"`)})});return t.mediaKeysSession.generateRequest(i,s).then(()=>{var F;this.log(`Request generated for key-session "${(F=t.mediaKeysSession)==null?void 0:F.sessionId}" keyId: ${g}`)}).catch(F=>{throw new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_NO_SESSION,error:F,fatal:!1},`Error generating key-session request: ${F}`)}).then(()=>N).catch(F=>{throw x.removeAllListeners(),this.removeSession(t),F}).then(()=>(x.removeAllListeners(),t))}onKeyStatusChange(t){t.mediaKeysSession.keyStatuses.forEach((i,s)=>{this.log(`key status change "${i}" for keyStatuses keyId: ${de.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))} session keyId: ${de.hexDump(new Uint8Array(t.decryptdata.keyId||[]))} uri: ${t.decryptdata.uri}`),t.keyStatus=i})}fetchServerCertificate(t){const i=this.config,s=i.loader,o=new s(i),l=this.getServerCertificateUrl(t);return l?(this.log(`Fetching server certificate for "${t}"`),new Promise((c,p)=>{const y={responseType:"arraybuffer",url:l},g=i.certLoadPolicy.default,x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(R,N,F,X)=>{c(R.data)},onError:(R,N,F,X)=>{p(new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:F,response:O({url:y.url,data:void 0},R)},`"${t}" certificate request failed (${l}). Status: ${R.code} (${R.text})`))},onTimeout:(R,N,F)=>{p(new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:F,response:{url:y.url,data:void 0}},`"${t}" certificate request timed out (${l})`))},onAbort:(R,N,F)=>{p(new Error("aborted"))}};o.load(y,x,S)})):Promise.resolve()}setMediaKeysServerCertificate(t,i,s){return new Promise((o,l)=>{t.setServerCertificate(s).then(c=>{this.log(`setServerCertificate ${c?"success":"not supported by CDM"} (${s==null?void 0:s.byteLength}) on "${i}"`),o(t)}).catch(c=>{l(new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:c,fatal:!0},c.message))})})}renewLicense(t,i){return this.requestLicense(t,new Uint8Array(i)).then(s=>this.updateKeySession(t,new Uint8Array(s)).catch(o=>{throw new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:o,fatal:!0},o.message)}))}unpackPlayReadyKeyMessage(t,i){const s=String.fromCharCode.apply(null,new Uint16Array(i.buffer));if(!s.includes("PlayReadyKeyMessage"))return t.setRequestHeader("Content-Type","text/xml; charset=utf-8"),i;const o=new DOMParser().parseFromString(s,"application/xml"),l=o.querySelectorAll("HttpHeader");if(l.length>0){let x;for(let S=0,R=l.length;S<R;S++){var c,p;x=l[S];const N=(c=x.querySelector("name"))==null?void 0:c.textContent,F=(p=x.querySelector("value"))==null?void 0:p.textContent;N&&F&&t.setRequestHeader(N,F)}}const y=o.querySelector("Challenge"),g=y==null?void 0:y.textContent;if(!g)throw new Error("Cannot find <Challenge> in key message");return rn(atob(g))}setupLicenseXHR(t,i,s,o){const l=this.config.licenseXhrSetup;return l?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return l.call(this.hls,t,i,s,o)}).catch(c=>{if(!s.decryptdata)throw c;return t.open("POST",i,!0),l.call(this.hls,t,i,s,o)}).then(c=>(t.readyState||t.open("POST",i,!0),{xhr:t,licenseChallenge:c||o})):(t.open("POST",i,!0),Promise.resolve({xhr:t,licenseChallenge:o}))}requestLicense(t,i){const s=this.config.keyLoadPolicy.default;return new Promise((o,l)=>{const c=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${c}`);const p=new XMLHttpRequest;p.responseType="arraybuffer",p.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return l(new Error("invalid state"));if(p.readyState===4)if(p.status===200){this._requestLicenseFailureCount=0;let y=p.response;this.log(`License received ${y instanceof ArrayBuffer?y.byteLength:y}`);const g=this.config.licenseResponseCallback;if(g)try{y=g.call(this.hls,p,c,t)}catch(x){this.error(x)}o(y)}else{const y=s.errorRetry,g=y?y.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>g||p.status>=400&&p.status<500)l(new js({type:Le.KEY_SYSTEM_ERROR,details:te.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:{url:c,data:void 0,code:p.status,text:p.statusText}},`License Request XHR failed (${c}). Status: ${p.status} (${p.statusText})`));else{const x=g-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${x} attempts left`),this.requestLicense(t,i).then(o,l)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=p,this.setupLicenseXHR(p,c,t,i).then(({xhr:y,licenseChallenge:g})=>{t.keySystem==Oi.PLAYREADY&&(g=this.unpackPlayReadyKeyMessage(y,g)),y.send(g)})})}onMediaAttached(t,i){if(!this.config.emeEnabled)return;const s=i.media;this.media=s,s.removeEventListener("encrypted",this.onMediaEncrypted),s.removeEventListener("waitingforkey",this.onWaitingForKey),s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const t=this.media;t&&(t.removeEventListener("encrypted",this.onMediaEncrypted),t.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(t){var i;const s=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},as.clearKeyUriToKeyIdMap();const o=s.length;pa.CDMCleanupPromise=Promise.all(s.map(l=>this.removeSession(l)).concat(t==null||(i=t.setMediaKeys(null))==null?void 0:i.catch(l=>{var c;this.log(`Could not clear media keys: ${l}`),(c=this.hls)==null||c.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${l}`)})}))).then(()=>{o&&(this.log("finished closing key sessions and clearing media keys"),s.length=0)}).catch(l=>{var c;this.log(`Could not close sessions and clear media keys: ${l}`),(c=this.hls)==null||c.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${l}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(t,{sessionKeys:i}){if(!(!i||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=i.reduce((o,l)=>(o.indexOf(l.keyFormat)===-1&&o.push(l.keyFormat),o),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(t){const{mediaKeysSession:i,licenseXhr:s}=t;if(i){this.log(`Remove licenses and keys and close session ${i.sessionId}`),t._onmessage&&(i.removeEventListener("message",t._onmessage),t._onmessage=void 0),t._onkeystatuseschange&&(i.removeEventListener("keystatuseschange",t._onkeystatuseschange),t._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const o=this.mediaKeySessions.indexOf(t);return o>-1&&this.mediaKeySessions.splice(o,1),i.remove().catch(l=>{var c;this.log(`Could not remove session: ${l}`),(c=this.hls)==null||c.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${l}`)})}).then(()=>i.close()).catch(l=>{var c;this.log(`Could not close session: ${l}`),(c=this.hls)==null||c.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${l}`)})})}}}pa.CDMCleanupPromise=void 0;class js extends Error{constructor(t,i){super(i),this.data=void 0,t.error||(t.error=new Error(i)),this.data=t,t.err=t.error}}class _0{constructor(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(E.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(E.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,i){const s=this.hls.config;if(s.capLevelOnFPSDrop){const o=i.media instanceof self.HTMLVideoElement?i.media:null;this.media=o,o&&typeof o.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(t,i,s){const o=performance.now();if(i){if(this.lastTime){const l=o-this.lastTime,c=s-this.lastDroppedFrames,p=i-this.lastDecodedFrames,y=1e3*c/l,g=this.hls;if(g.trigger(E.FPS_DROP,{currentDropped:c,currentDecoded:p,totalDroppedFrames:s}),y>0&&c>g.config.fpsDroppedMonitoringThreshold*p){let x=g.currentLevel;g.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+x),x>0&&(g.autoLevelCapping===-1||g.autoLevelCapping>=x)&&(x=x-1,g.trigger(E.FPS_DROP_LEVEL_CAPPING,{level:x,droppedLevel:g.currentLevel}),g.autoLevelCapping=x,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=s,this.lastDecodedFrames=i}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const i=t.getVideoPlaybackQuality();this.checkFPS(t,i.totalVideoFrames,i.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}}function Zc(h,t){let i;try{i=new Event("addtrack")}catch(s){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=h,t.dispatchEvent(i)}function Yc(h,t){const i=h.mode;if(i==="disabled"&&(h.mode="hidden"),h.cues&&!h.cues.getCueById(t.id))try{if(h.addCue(t),!h.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(s){ve.debug(`[texttrack-utils]: ${s}`);try{const o=new self.TextTrackCue(t.startTime,t.endTime,t.text);o.id=t.id,h.addCue(o)}catch(o){ve.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${o}`)}}i==="disabled"&&(h.mode=i)}function Io(h,t){const i=h.mode;if(i==="disabled"&&(h.mode="hidden"),h.cues)for(let s=h.cues.length;s--;)t&&h.cues[s].removeEventListener("enter",t),h.removeCue(h.cues[s]);i==="disabled"&&(h.mode=i)}function x0(h,t,i,s){const o=h.mode;if(o==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0){const l=qs(h.cues,t,i);for(let c=0;c<l.length;c++)(!s||s(l[c]))&&h.removeCue(l[c])}o==="disabled"&&(h.mode=o)}function w0(h,t){if(t<=h[0].startTime)return 0;const i=h.length-1;if(t>h[i].endTime)return-1;let s=0,o=i,l;for(;s<=o;)if(l=Math.floor((o+s)/2),t<h[l].startTime)o=l-1;else if(t>h[l].startTime&&s<i)s=l+1;else return l;return h[s].startTime-t<t-h[o].startTime?s:o}function qs(h,t,i){const s=[],o=w0(h,t);if(o>-1)for(let l=o,c=h.length;l<c;l++){const p=h[l];if(p.startTime>=t&&p.endTime<=i)s.push(p);else if(p.startTime>i)return s}return s}function Wa(h){const t=[];for(let i=0;i<h.length;i++){const s=h[i];(s.kind==="subtitles"||s.kind==="captions")&&s.label&&t.push(h[i])}return t}class Xc extends uo{constructor(t){super(t,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let i=null;const s=Wa(this.media.textTracks);for(let l=0;l<s.length;l++)if(s[l].mode==="hidden")i=s[l];else if(s[l].mode==="showing"){i=s[l];break}const o=this.findTrackForTextTrack(i);this.subtitleTrack!==o&&this.setSubtitleTrack(o)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:t}=this;t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(E.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVEL_LOADING,this.onLevelLoading,this),t.off(E.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(E.ERROR,this.onError,this)}onMediaAttached(t,i){this.media=i.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,t)}onMediaDetaching(t,i){const s=this.media;if(!s)return;const o=!!i.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||s.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,o)return;Wa(s.textTracks).forEach(c=>{Io(c)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,i){this.tracks=i.subtitleTracks}onSubtitleTrackLoaded(t,i){const{id:s,groupId:o,details:l}=i,c=this.tracksInGroup[s];if(!c||c.groupId!==o){this.warn(`Subtitle track with id:${s} and group:${o} not found in active group ${c==null?void 0:c.groupId}`);return}const p=c.details;c.details=i.details,this.log(`Subtitle track ${s} "${c.name}" lang:${c.lang} group:${o} loaded [${l.startSN}-${l.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,p)}onLevelLoading(t,i){this.switchLevel(i.level)}onLevelSwitching(t,i){this.switchLevel(i.level)}switchLevel(t){const i=this.hls.levels[t];if(!i)return;const s=i.subtitleGroups||null,o=this.groupIds;let l=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(c=>(o==null?void 0:o.indexOf(c))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const c=this.tracks.filter(x=>!s||s.indexOf(x.groupId)!==-1);if(c.length)this.selectDefaultTrack&&!c.some(x=>x.default)&&(this.selectDefaultTrack=!1),c.forEach((x,S)=>{x.id=S});else if(!l&&!this.tracksInGroup.length)return;this.tracksInGroup=c;const p=this.hls.config.subtitlePreference;if(!l&&p){this.selectDefaultTrack=!1;const x=_t(p,c);if(x>-1)l=c[x];else{const S=_t(p,this.tracks);l=this.tracks[S]}}let y=this.findTrackId(l);y===-1&&l&&(y=this.findTrackId(null));const g={subtitleTracks:c};this.log(`Updating subtitle tracks, ${c.length} track(s) found in "${s==null?void 0:s.join(",")}" group-id`),this.hls.trigger(E.SUBTITLE_TRACKS_UPDATED,g),y!==-1&&this.trackId===-1&&this.setSubtitleTrack(y)}}findTrackId(t){const i=this.tracksInGroup,s=this.selectDefaultTrack;for(let o=0;o<i.length;o++){const l=i[o];if(!(s&&!l.default||!s&&!t)&&(!t||Lt(l,t)))return o}if(t){for(let o=0;o<i.length;o++){const l=i[o];if(gl(t.attrs,l.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return o}for(let o=0;o<i.length;o++){const l=i[o];if(gl(t.attrs,l.attrs,["LANGUAGE"]))return o}}return-1}findTrackForTextTrack(t){if(t){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(Pu(o,t))return s}}return-1}onError(t,i){i.fatal||!i.context||i.context.type===Me.SUBTITLE_TRACK&&i.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(i.context.groupId)!==-1)&&this.checkRetry(i)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(t){this.selectDefaultTrack=!1,this.setSubtitleTrack(t)}setSubtitleOption(t){if(this.hls.config.subtitlePreference=t,t){if(t.id===-1)return this.setSubtitleTrack(-1),null;const i=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,i.length){const s=this.currentTrack;if(s&&Lt(t,s))return s;const o=_t(t,this.tracksInGroup);if(o>-1){const l=this.tracksInGroup[o];return this.setSubtitleTrack(o),l}else{if(s)return null;{const l=_t(t,i);if(l>-1)return i[l]}}}}return null}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,t)}loadingPlaylist(t,i){super.loadingPlaylist(t,i);const s=t.id,o=t.groupId,l=this.getUrlWithDirectives(t.url,i),c=t.details,p=c==null?void 0:c.age;this.log(`Loading subtitle ${s} "${t.name}" lang:${t.lang} group:${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${p&&c.live?" age "+p.toFixed(1)+(c.type?" "+c.type||0:""):""} ${l}`),this.hls.trigger(E.SUBTITLE_TRACK_LOADING,{url:l,id:s,groupId:o,deliveryDirectives:i||null,track:t})}toggleTrackModes(){const{media:t}=this;if(!t)return;const i=Wa(t.textTracks),s=this.currentTrack;let o;if(s&&(o=i.filter(l=>Pu(s,l))[0],o||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(i).forEach(l=>{l.mode!=="disabled"&&l!==o&&(l.mode="disabled")}),o){const l=this.subtitleDisplay?"showing":"hidden";o.mode!==l&&(o.mode=l)}}setSubtitleTrack(t){const i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(t<-1||t>=i.length||!pe(t)){this.warn(`Invalid subtitle track id: ${t}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[t]||null;if(this.trackId=t,this.currentTrack=o,this.toggleTrackModes(),!o){this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:t});return}const l=!!o.details&&!o.details.live;if(t===this.trackId&&o===s&&l)return;this.log(`Switching to subtitle-track ${t}`+(o?` "${o.name}" lang:${o.lang} group:${o.groupId}`:""));const{id:c,groupId:p="",name:y,type:g,url:x}=o;this.hls.trigger(E.SUBTITLE_TRACK_SWITCH,{id:c,groupId:p,name:y,type:g,url:x});const S=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(S)}}function Jl(h){let t=5381,i=h.length;for(;i;)t=t*33^h.charCodeAt(--i);return(t>>>0).toString()}const Po=.025;let S0=function(h){return h[h.Point=0]="Point",h[h.Range=1]="Range",h}({});function od(h,t,i){return`${h.identifier}-${i+1}-${Jl(t)}`}class ld{constructor(t,i){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=i,this.dateRange=t,this.setDateRange(t)}setDateRange(t){this.dateRange=t,this.resumeOffset=t.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=t.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=t.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=t.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var t;this.appendInPlaceStarted=!1,(t=this.assetListLoader)==null||t.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(t){if(t>=this.assetList.length)return!0;const i=this.playoutLimit;return t<=0||isNaN(i)?!1:this.assetList[t].startOffset>i}findAssetIndex(t){return this.assetList.indexOf(t)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const t=this.dateRange.startTime;if(this.snapOptions.out){const i=this.dateRange.tagAnchor;if(i)return nc(t,i)}return t}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const t=this.dateRange.tagAnchor;if(t){const i=this.dateRange.startTime,s=nc(i,t);return i-s<.1}return!1}get resumptionOffset(){const t=this.resumeOffset,i=pe(t)?t:this.duration;return this.cumulativeDuration+i}get resumeTime(){const t=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const i=this.resumeAnchor;if(i)return nc(t,i)}return t}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Po))}set appendInPlace(t){if(this.appendInPlaceStarted){this.resetOnResume=!t;return}this.appendInPlaceDisabled=!t}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(t){this._timelineStart=t}get duration(){const t=this.playoutLimit;let i;return this._duration!==null?i=this._duration:this.dateRange.duration?i=this.dateRange.duration:i=this.dateRange.plannedDuration||0,!isNaN(t)&&t<i&&(i=t),i}set duration(t){this._duration=t}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?S0.Range:S0.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return Rn(this)}}function nc(h,t){return h-t.start<t.duration/2&&!(Math.abs(h-(t.start+t.duration))<Po)?t.start:t.start+t.duration}function sc(h,t,i){const s=new self.URL(h,i);return s.protocol!=="data:"&&s.searchParams.set("_HLS_primary_id",t),s}function Rn(h){return`["${h.identifier}" ${h.cue.pre?"<pre>":h.cue.post?"<post>":""}${h.timelineStart.toFixed(2)}-${h.resumeTime.toFixed(2)}]`}function ac(h){const t=h.timelineStart,i=h.duration||0;return`["${h.identifier}" ${t.toFixed(2)}-${(t+i).toFixed(2)}]`}class ud{constructor(t,i,s,o){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{const g=this.interstitial.playoutLimit,x=this.currentTime;this.startOffset+x>=g&&this.hls.trigger(E.PLAYOUT_LIMIT_REACHED,{})};const l=this.hls=new t(i);this.interstitial=s,this.assetItem=o;let c=o.uri;try{c=sc(c,l.sessionId).href}catch(y){}l.loadSource(c);const p=()=>{this.hasDetails=!0};l.once(E.LEVEL_LOADED,p),l.once(E.AUDIO_TRACK_LOADED,p),l.once(E.SUBTITLE_TRACK_LOADED,p),l.on(E.MEDIA_ATTACHING,(y,{media:g})=>{this.removeMediaListeners(),this.mediaAttached=g,this.interstitial.playoutLimit&&g.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(t){var i;if(!this.interstitial.appendInPlace)return!1;if((i=this.hls)!=null&&i.bufferedToEnd)return!0;if(!t||!this._bufferedEosTime)return!1;const s=this.timelineOffset,o=Vr.bufferInfo(t,s,0);return this.getAssetTime(o.end)>=this._bufferedEosTime-.02}get destroyed(){var t;return!((t=this.hls)!=null&&t.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var t;return((t=this.hls)==null?void 0:t.media)||null}get bufferedEnd(){const t=this.media||this.mediaAttached;if(!t)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const i=Vr.bufferInfo(t,t.currentTime,.001);return this.getAssetTime(i.end)}get currentTime(){const t=this.media||this.mediaAttached;return t?this.getAssetTime(t.currentTime):this._currentTime||0}get duration(){const t=this.assetItem.duration;return t||0}get remaining(){const t=this.duration;return t?Math.max(0,t-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var t;return((t=this.hls)==null?void 0:t.config.timelineOffset)||0}set timelineOffset(t){const i=this.timelineOffset;if(t!==i){const s=t-i;if(Math.abs(s)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=t}}}getAssetTime(t){const i=this.timelineOffset,s=this.duration;return Math.min(Math.max(0,t-i),s)}removeMediaListeners(){const t=this.mediaAttached;t&&(this._currentTime=t.currentTime,this.bufferSnapShot(),t.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var t;(t=this.hls)!=null&&t.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(t){this.hls.attachMedia(t)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(t,i,s){this.hls.on(t,i)}once(t,i,s){this.hls.once(t,i)}off(t,i,s){this.hls.off(t,i)}toString(){var t,i;return`HlsAssetPlayer: ${ac(this.assetItem)} ${(t=this.hls)==null?void 0:t.sessionId} ${(i=this.interstitial)!=null&&i.appendInPlace?"append-in-place":""}`}}const Oo=.033;class cd extends ae{constructor(t,i){super("interstitials-sched",i),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=t}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(t=>t.reset()),this.events=this.items=null}resetErrorsInRange(t,i){return this.events?this.events.reduce((s,o)=>t<=o.startOffset&&i>o.startOffset?(delete o.error,s+1):s,0):0}get duration(){const t=this.items;return t?t[t.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(t){return t&&this.eventMap[t]||null}hasEvent(t){return t in this.eventMap}findItemIndex(t,i){if(t.event)return this.findEventIndex(t.event.identifier);let s=-1;t.nextEvent?s=this.findEventIndex(t.nextEvent.identifier)-1:t.previousEvent&&(s=this.findEventIndex(t.previousEvent.identifier)+1);const o=this.items;if(o)for(o[s]||(i===void 0&&(i=t.start),s=this.findItemIndexAtTime(i));s>=0&&(l=o[s])!=null&&l.event;){var l;s--}return s}findItemIndexAtTime(t,i){const s=this.items;if(s)for(let o=0;o<s.length;o++){let l=s[o];if(i&&i!=="primary"&&(l=l[i]),t===l.start||t>l.start&&t<l.end)return o}return-1}findJumpRestrictedIndex(t,i){const s=this.items;if(s)for(let o=t;o<=i&&s[o];o++){const l=s[o].event;if(l!=null&&l.restrictions.jump&&!l.appendInPlace)return o}return-1}findEventIndex(t){const i=this.items;if(i)for(let o=i.length;o--;){var s;if(((s=i[o].event)==null?void 0:s.identifier)===t)return o}return-1}findAssetIndex(t,i){const s=t.assetList,o=s.length;if(o>1)for(let l=0;l<o;l++){const c=s[l];if(!c.error){const p=c.timelineStart;if(i===p||i>p&&i<p+(c.duration||0))return l}}return 0}get assetIdAtEnd(){var t,i;const s=(t=this.items)==null||(i=t[this.length-1])==null?void 0:i.event;if(s){const o=s.assetList,l=o[o.length-1];if(l)return l.identifier}return null}parseInterstitialDateRanges(t,i){const s=t.main.details,{dateRanges:o}=s,l=this.events,c=this.parseDateRanges(o,{url:s.url},i),p=Object.keys(o),y=l?l.filter(g=>!p.includes(g.identifier)):[];c.length&&c.sort((g,x)=>{const S=g.cue.pre,R=g.cue.post,N=x.cue.pre,F=x.cue.post;if(S&&!N)return-1;if(N&&!S||R&&!F)return 1;if(F&&!R)return-1;if(!S&&!N&&!R&&!F){const X=g.startTime,ne=x.startTime;if(X!==ne)return X-ne}return g.dateRange.tagOrder-x.dateRange.tagOrder}),this.events=c,y.forEach(g=>{this.removeEvent(g)}),this.updateSchedule(t,y)}updateSchedule(t,i=[]){const s=this.events||[];if(s.length||i.length||this.length<2){const o=this.items,l=this.parseSchedule(s,t);(i.length||(o==null?void 0:o.length)!==l.length||l.some((p,y)=>Math.abs(p.playout.start-o[y].playout.start)>.005||Math.abs(p.playout.end-o[y].playout.end)>.005))&&(this.items=l,this.onScheduleUpdate(i,o))}}parseDateRanges(t,i,s){const o=[],l=Object.keys(t);for(let c=0;c<l.length;c++){const p=l[c],y=t[p];if(y.isInterstitial){let g=this.eventMap[p];g?g.setDateRange(y):(g=new ld(y,i),this.eventMap[p]=g,s===!1&&(g.appendInPlace=s)),o.push(g)}}return o}parseSchedule(t,i){const s=[],o=i.main.details,l=o.live?1/0:o.edge;let c=0;if(t=t.filter(y=>!y.error&&!(y.cue.once&&y.hasPlayed)),t.length){this.resolveOffsets(t,i);let y=0,g=0;if(t.forEach((x,S)=>{const R=x.cue.pre,N=x.cue.post,F=t[S-1]||null,X=x.appendInPlace,ne=N?l:x.startOffset,Ce=x.duration,qe=x.timelineOccupancy===S0.Range?Ce:0,$e=x.resumptionOffset,ht=(F==null?void 0:F.startTime)===ne,mt=ne+x.cumulativeDuration;let Nt=X?mt+Ce:ne+$e;if(R||!N&&ne<=0){const Tt=g;g+=qe,x.timelineStart=mt;const Vt=c;c+=Ce,s.push({event:x,start:mt,end:Nt,playout:{start:Vt,end:c},integrated:{start:Tt,end:g}})}else if(ne<=l){if(!ht){const bt=ne-y;if(bt>Oo){const dr=y,Ir=g;g+=bt;const Ei=c;c+=bt;const wi={previousEvent:t[S-1]||null,nextEvent:x,start:dr,end:dr+bt,playout:{start:Ei,end:c},integrated:{start:Ir,end:g}};s.push(wi)}else bt>0&&F&&(F.cumulativeDuration+=bt,s[s.length-1].end=ne)}N&&(Nt=mt),x.timelineStart=mt;const Tt=g;g+=qe;const Vt=c;c+=Ce,s.push({event:x,start:mt,end:Nt,playout:{start:Vt,end:c},integrated:{start:Tt,end:g}})}else return;const gt=x.resumeTime;N||gt>l?y=l:y=gt}),y<l){var p;const x=y,S=g,R=l-y;g+=R;const N=c;c+=R,s.push({previousEvent:((p=s[s.length-1])==null?void 0:p.event)||null,nextEvent:null,start:y,end:x+R,playout:{start:N,end:c},integrated:{start:S,end:g}})}this.setDurations(l,c,g)}else s.push({previousEvent:null,nextEvent:null,start:0,end:l,playout:{start:0,end:l},integrated:{start:0,end:l}}),this.setDurations(l,l,l);return s}setDurations(t,i,s){this.durations={primary:t,playout:i,integrated:s}}resolveOffsets(t,i){const s=i.main.details,o=s.live?1/0:s.edge;let l=0,c=-1;t.forEach((p,y)=>{const g=p.cue.pre,x=p.cue.post,S=g?0:x?o:p.startTime;this.updateAssetDurations(p),c===S?p.cumulativeDuration=l:(l=0,c=S),!x&&p.snapOptions.in&&(p.resumeAnchor=Er(null,s.fragments,p.startOffset+p.resumptionOffset,0,0)||void 0),p.appendInPlace&&!p.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(p,i)||(p.appendInPlace=!1)),!p.appendInPlace&&y+1<t.length&&t[y+1].startTime-t[y].resumeTime<Oo&&(t[y+1].appendInPlace=!1,t[y+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${p}`));const N=pe(p.resumeOffset)?p.resumeOffset:p.duration;l+=N})}primaryCanResumeInPlaceAt(t,i){const s=t.resumeTime,o=t.startTime+t.resumptionOffset;return Math.abs(s-o)>Po?(this.log(`"${t.identifier}" resumption ${s} not aligned with estimated timeline end ${o}`),!1):i?!Object.keys(i).some(c=>{const p=i[c].details,y=p.edge;if(s>=y)return this.log(`"${t.identifier}" resumption ${s} past ${c} playlist end ${y}`),!1;const g=Er(null,p.fragments,s);if(!g)return this.log(`"${t.identifier}" resumption ${s} does not align with any fragments in ${c} playlist (${p.fragStart}-${p.fragmentEnd})`),!0;const x=c==="audio"?.175:0;return Math.abs(g.start-s)<Po+x||Math.abs(g.end-s)<Po+x?!1:(this.log(`"${t.identifier}" resumption ${s} not aligned with ${c} fragment bounds (${g.start}-${g.end} sn: ${g.sn} cc: ${g.cc})`),!0)}):(this.log(`"${t.identifier}" resumption ${s} can not be aligned with media (none selected)`),!1)}updateAssetDurations(t){if(!t.assetListLoaded)return;const i=t.timelineStart;let s=0,o=!1,l=!1;t.assetList.forEach((c,p)=>{const y=i+s;c.startOffset=s,c.timelineStart=y,o||(o=c.duration===null),l||(l=!!c.error);const g=c.error?0:c.duration||0;s+=g}),o&&!l?t.duration=Math.max(s,t.duration):t.duration=s}removeEvent(t){t.reset(),delete this.eventMap[t.identifier]}}function Sa(h){return`[${h.event?'"'+h.event.identifier+'"':"primary"}: ${h.start.toFixed(2)}-${h.end.toFixed(2)}]`}class hd{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,i){const s=t.assetListUrl;let o;try{o=sc(s,this.hls.sessionId,t.baseUrl)}catch(R){const N=this.assignAssetListError(t,te.ASSET_LIST_LOAD_ERROR,R,s);this.hls.trigger(E.ERROR,N);return}i&&o.protocol!=="data:"&&o.searchParams.set("_HLS_start_offset",""+i);const l=this.hls.config,c=l.loader,p=new c(l),y={responseType:"json",url:o.href},g=l.interstitialAssetListLoadPolicy.default,x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(R,N,F,X)=>{const ne=R.data,Ce=ne==null?void 0:ne.ASSETS;if(!Array.isArray(Ce)){const qe=this.assignAssetListError(t,te.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),F.url,N,X);this.hls.trigger(E.ERROR,qe);return}t.assetListResponse=ne,this.hls.trigger(E.ASSET_LIST_LOADED,{event:t,assetListResponse:ne,networkDetails:X})},onError:(R,N,F,X)=>{const ne=this.assignAssetListError(t,te.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${R.code} ${R.text} (${N.url})`),N.url,X,F);this.hls.trigger(E.ERROR,ne)},onTimeout:(R,N,F)=>{const X=this.assignAssetListError(t,te.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${N.url})`),N.url,R,F);this.hls.trigger(E.ERROR,X)}};return p.load(y,x,S),this.hls.trigger(E.ASSET_LIST_LOADING,{event:t}),p}assignAssetListError(t,i,s,o,l,c){return t.error=s,{type:Le.NETWORK_ERROR,details:i,fatal:!1,interstitial:t,url:o,error:s,networkDetails:c,stats:l}}}function ja(h,t,i){Ra(h,t,i),h.addEventListener(t,i)}function Ra(h,t,i){h.removeEventListener(t,i)}function Ql(h){h==null||h.play().catch(()=>{})}class dd extends ae{constructor(t,i){super("interstitials",t.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled)return;const o=s-this.timelinePos;if(Math.abs(o)<1/7056e5)return;const c=o<=-.01;this.timelinePos=s,this.bufferedPos=s;const p=this.playingItem;if(!p){this.checkBuffer();return}if(c&&this.schedule.resetErrorsInRange(s,s-o)&&this.updateSchedule(),this.checkBuffer(),c&&s<p.start||s>=p.end){var y;const R=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(p)&&(y=this.media)!=null&&y.paused&&(this.shouldPlay=!1),!c){const N=this.findItemIndex(p);if(R>N){const F=this.schedule.findJumpRestrictedIndex(N+1,R);if(F>N){this.setSchedulePosition(F);return}}}this.setSchedulePosition(R);return}const g=this.playingAsset;if(!g){if(this.playingLastItem&&this.isInterstitial(p)){const R=p.event.assetList[0];R&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(s,R))}return}const x=g.timelineStart,S=g.duration||0;(c&&s<x||s>=x+S)&&this.setScheduleToAssetAtTime(s,g)},this.onTimeupdate=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled)return;if(s>this.timelinePos)this.timelinePos=s,s>this.bufferedPos&&this.checkBuffer();else return;const o=this.playingItem;if(!o||this.playingLastItem)return;if(s>=o.end){this.timelinePos=o.end;const p=this.findItemIndex(o);this.setSchedulePosition(p+1)}const l=this.playingAsset;if(!l)return;const c=l.timelineStart+(l.duration||0);s>=c&&this.setScheduleToAssetAtTime(s,l)},this.onScheduleUpdate=(s,o)=>{const l=this.schedule,c=this.playingItem,p=l.events||[],y=l.items||[],g=l.durations,x=s.map(N=>N.identifier),S=!!(p.length||x.length);if(S&&this.log(`INTERSTITIALS_UPDATED (${p.length}): ${p}
Schedule: ${y.map(N=>Sa(N))}`),x.length&&this.log(`Removed events ${x}`),this.playerQueue.forEach(N=>{if(N.interstitial.appendInPlace){const F=N.assetItem.timelineStart,X=N.timelineOffset-F;if(X)try{N.timelineOffset=F}catch(ne){Math.abs(X)>Po&&this.warn(`${ne} ("${N.assetId}" ${N.timelineOffset}->${F})`)}}}),c){const N=this.updateItem(c,this.timelinePos);this.itemsMatch(c,N)&&(this.playingItem=N,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const R=this.bufferingItem;if(R){const N=this.updateItem(R,this.bufferedPos);this.itemsMatch(R,N)?this.bufferingItem=N:R.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(R.event,null))}if(s.forEach(N=>{N.assetList.forEach(F=>{this.clearAssetPlayer(F.identifier,null)})}),S||o){if(this.hls.trigger(E.INTERSTITIALS_UPDATED,{events:p.slice(0),schedule:y.slice(0),durations:g,removedIds:x}),this.isInterstitial(c)&&x.includes(c.event.identifier)){this.warn(`Interstitial "${c.event.identifier}" removed while playing`),this.primaryFallback(c.event);return}this.checkBuffer()}},this.hls=t,this.HlsPlayerClass=i,this.assetListLoader=new hd(t),this.schedule=new cd(this.onScheduleUpdate,t.logger),this.registerListeners()}registerListeners(){const t=this.hls;t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(E.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.on(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(E.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.on(E.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.on(E.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.on(E.BUFFER_APPENDED,this.onBufferAppended,this),t.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(E.BUFFERED_TO_END,this.onBufferedToEnd,this),t.on(E.MEDIA_ENDED,this.onMediaEnded,this),t.on(E.ERROR,this.onError,this),t.on(E.DESTROYING,this.onDestroying,this)}unregisterListeners(){const t=this.hls;t&&(t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(E.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.off(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(E.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.off(E.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.off(E.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.off(E.BUFFER_CODECS,this.onBufferCodecs,this),t.off(E.BUFFER_APPENDED,this.onBufferAppended,this),t.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(E.BUFFERED_TO_END,this.onBufferedToEnd,this),t.off(E.MEDIA_ENDED,this.onMediaEnded,this),t.off(E.ERROR,this.onError,this),t.off(E.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var t;(t=this.getBufferingPlayer())==null||t.resumeBuffering()}pauseBuffering(){var t;(t=this.getBufferingPlayer())==null||t.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const t=this.primaryMedia||this.media;t&&this.removeMediaListeners(t)}removeMediaListeners(t){Ra(t,"play",this.onPlay),Ra(t,"pause",this.onPause),Ra(t,"seeking",this.onSeeking),Ra(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,i){const s=this.media=i.media;ja(s,"seeking",this.onSeeking),ja(s,"timeupdate",this.onTimeupdate),ja(s,"play",this.onPlay),ja(s,"pause",this.onPause)}onMediaAttached(t,i){const s=this.effectivePlayingItem,o=this.detachedData;if(this.detachedData=null,s===null)this.checkStart();else if(!o){this.clearScheduleState();const l=this.findItemIndex(s);this.setSchedulePosition(l)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(t,i){const s=!!i.transferMedia,o=this.media;if(this.media=null,!s&&(o&&this.removeMediaListeners(o),this.detachedData)){const l=this.getBufferingPlayer();l&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,l.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const t=this,i=()=>t.bufferingItem||t.waitingItem,s=S=>S&&t.getAssetPlayer(S.identifier),o=(S,R,N,F,X)=>{if(S){let ne=S[R].start;const Ce=S.event;if(Ce){if(R==="playout"||Ce.timelineOccupancy!==S0.Point){const qe=s(N);(qe==null?void 0:qe.interstitial)===Ce&&(ne+=qe.assetItem.startOffset+qe[X])}}else{const qe=F==="bufferedPos"?c():t[F];ne+=qe-S.start}return ne}return 0},l=(S,R)=>{if(S!==0&&R!=="primary"&&t.schedule.length){var N;const F=t.schedule.findItemIndexAtTime(S),X=(N=t.schedule.items)==null?void 0:N[F];if(X){const ne=X[R].start-X.start;return S+ne}}return S},c=()=>{const S=t.bufferedPos;return S===Number.MAX_VALUE?p("primary"):Math.max(S,0)},p=S=>{var R;return(R=t.primaryDetails)!=null&&R.live?t.primaryDetails.edge:t.schedule.durations[S]},y=(S,R)=>{var N,F;const X=t.effectivePlayingItem;if(X!=null&&(N=X.event)!=null&&N.restrictions.skip)return;t.log(`seek to ${S} "${R}"`);const ne=t.effectivePlayingItem,Ce=t.schedule.findItemIndexAtTime(S,R),qe=(F=t.schedule.items)==null?void 0:F[Ce],$e=t.getBufferingPlayer(),ht=$e==null?void 0:$e.interstitial,mt=ht==null?void 0:ht.appendInPlace,Nt=ne&&t.itemsMatch(ne,qe);if(ne&&(mt||Nt)){const Tt=s(t.playingAsset),Vt=(Tt==null?void 0:Tt.media)||t.primaryMedia;if(Vt){const bt=R==="primary"?Vt.currentTime:o(ne,R,t.playingAsset,"timelinePos","currentTime"),dr=S-bt,Ir=(mt?bt:Vt.currentTime)+dr;if(Ir>=0&&(!Tt||mt||Ir<=Tt.duration)){Vt.currentTime=Ir;return}}}if(qe){let Tt=S;if(R!=="primary"){const bt=qe[R].start,dr=S-bt;Tt=qe.start+dr}const Vt=!t.isInterstitial(qe);if((!t.isInterstitial(ne)||ne.event.appendInPlace)&&(Vt||qe.event.appendInPlace)){const bt=t.media||(mt?$e==null?void 0:$e.media:null);bt&&(bt.currentTime=Tt)}else if(ne){const bt=t.findItemIndex(ne);if(Ce>bt){const Ir=t.schedule.findJumpRestrictedIndex(bt+1,Ce);if(Ir>bt){t.setSchedulePosition(Ir);return}}let dr=0;if(Vt)t.timelinePos=Tt,t.checkBuffer();else{var gt;const Ir=qe==null||(gt=qe.event)==null?void 0:gt.assetList;if(Ir){const Ei=S-(qe[R]||qe).start;for(let wi=Ir.length;wi--;){const hi=Ir[wi];if(hi.duration&&Ei>=hi.startOffset&&Ei<hi.startOffset+hi.duration){dr=wi;break}}}}t.setSchedulePosition(Ce,dr)}}},g=()=>{const S=t.effectivePlayingItem;if(t.isInterstitial(S))return S;const R=i();return t.isInterstitial(R)?R:null},x={get currentTime(){const S=g(),R=t.effectivePlayingItem;return R&&R===S?o(R,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-R.playout.start:0},set currentTime(S){const R=g(),N=t.effectivePlayingItem;N&&N===R&&y(S+N.playout.start,"playout")},get duration(){const S=g();return S?S.playout.end-S.playout.start:0},get assetPlayers(){var S;const R=(S=g())==null?void 0:S.event.assetList;return R?R.map(N=>t.getAssetPlayer(N.identifier)):[]},get playingIndex(){var S;const R=(S=g())==null?void 0:S.event;return R&&t.effectivePlayingAsset?R.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return g()}};this.manager={get events(){var S,R;return((S=t.schedule)==null||(R=S.events)==null?void 0:R.slice(0))||[]},get schedule(){var S,R;return((S=t.schedule)==null||(R=S.items)==null?void 0:R.slice(0))||[]},get interstitialPlayer(){return g()?x:null},get playerQueue(){return t.playerQueue.slice(0)},get bufferingAsset(){return t.bufferingAsset},get bufferingItem(){return i()},get bufferingIndex(){const S=i();return t.findItemIndex(S)},get playingAsset(){return t.effectivePlayingAsset},get playingItem(){return t.effectivePlayingItem},get playingIndex(){const S=t.effectivePlayingItem;return t.findItemIndex(S)},primary:{get bufferedEnd(){return c()},get currentTime(){const S=t.timelinePos;return S>0?S:0},set currentTime(S){y(S,"primary")},get duration(){return p("primary")},get seekableStart(){var S;return((S=t.primaryDetails)==null?void 0:S.fragmentStart)||0}},integrated:{get bufferedEnd(){return o(i(),"integrated",t.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return o(t.effectivePlayingItem,"integrated",t.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(S){y(S,"integrated")},get duration(){return p("integrated")},get seekableStart(){var S;return l(((S=t.primaryDetails)==null?void 0:S.fragmentStart)||0,"integrated")}},skip:()=>{const S=t.effectivePlayingItem,R=S==null?void 0:S.event;if(R&&!R.restrictions.skip){const N=t.findItemIndex(S);if(R.appendInPlace){const F=S.playout.start+S.event.duration;y(F+.001,"playout")}else t.advanceAfterAssetEnded(R,N,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var t;const i=this.playingItem,s=(t=this.schedule)==null?void 0:t.items;return!this.playbackStarted||!i||!s?!1:this.findItemIndex(i)===s.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var t,i,s;if(this.mediaSelection===null)return;const o=this.waitingItem||this.playingItem;if(this.isInterstitial(o)&&!o.event.appendInPlace)return;let l=this.media;!l&&(t=this.bufferingItem)!=null&&(i=t.event)!=null&&i.appendInPlace&&(l=this.primaryMedia);const c=(s=l)==null?void 0:s.currentTime;if(!(c===void 0||!pe(c)))return c}get primaryMedia(){var t;return this.media||((t=this.detachedData)==null?void 0:t.media)||null}isInterstitial(t){return!!(t!=null&&t.event)}retreiveMediaSource(t,i){const s=this.getAssetPlayer(t);s&&this.transferMediaFromPlayer(s,i)}transferMediaFromPlayer(t,i){const s=t.interstitial.appendInPlace,o=t.media;if(s&&o===this.primaryMedia){if(this.bufferingAsset=null,(!i||this.isInterstitial(i)&&!i.event.appendInPlace)&&i&&o){this.detachedData={media:o};return}const l=t.transferMedia();this.log(`transfer MediaSource from ${t} ${Ur(l)}`),this.detachedData=l}else i&&o&&(this.shouldPlay||(this.shouldPlay=!o.paused))}transferMediaTo(t,i){var s,o;if(t.media===i)return;let l=null;const c=this.hls,p=t!==c,y=p&&t.interstitial.appendInPlace,g=(s=this.detachedData)==null?void 0:s.mediaSource;let x;if(c.media)y&&(l=c.transferMedia(),this.detachedData=l),x="Primary";else if(g){const N=this.getBufferingPlayer();N?(l=N.transferMedia(),x=`${N}`):x="detached MediaSource"}else x="detached media";if(!l){if(g)l=this.detachedData,this.log(`using detachedData: MediaSource ${Ur(l)}`);else if(!this.detachedData||c.media===i){const N=this.playerQueue;N.length>1&&N.forEach(F=>{if(p&&F.interstitial.appendInPlace!==y){const X=F.interstitial;this.clearInterstitial(F.interstitial,null),X.appendInPlace=!1,X.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${X}`)}}),this.hls.detachMedia(),this.detachedData={media:i}}}const S=l&&"mediaSource"in l&&((o=l.mediaSource)==null?void 0:o.readyState)!=="closed",R=S&&l?l:i;if(this.log(`${S?"transfering MediaSource":"attaching media"} to ${p?t:"Primary"} from ${x}`),R===l){const N=p&&t.assetId===this.schedule.assetIdAtEnd;R.overrides={duration:this.schedule.duration,endOfStream:!p||N,cueRemoval:!p}}t.attachMedia(R)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const t=this.schedule,i=t.events;if(!i||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const s=this.timelinePos,o=this.effectivePlayingItem;if(s===-1){const l=this.hls.startPosition;if(this.timelinePos=l,i.length&&i[0].cue.pre){const c=t.findEventIndex(i[0].identifier);this.setSchedulePosition(c)}else if(l>=0||!this.primaryLive){const c=this.timelinePos=l>0?l:0,p=t.findItemIndexAtTime(c);this.setSchedulePosition(p)}}else if(o&&!this.playingItem){const l=t.findItemIndex(o);this.setSchedulePosition(l)}}advanceAfterAssetEnded(t,i,s){const o=s+1;if(!t.isAssetPastPlayoutLimit(o)&&!t.assetList[o].error)this.setSchedulePosition(i,o);else{const l=this.schedule.items;if(l){const c=i+1,p=l.length;if(c>=p){this.setSchedulePosition(-1);return}const y=t.resumeTime;this.timelinePos<y&&(this.timelinePos=y,this.checkBuffer()),this.setSchedulePosition(c)}}}setScheduleToAssetAtTime(t,i){const s=this.schedule,o=i.parentIdentifier,l=s.getEvent(o);if(l){const c=s.findEventIndex(o),p=s.findAssetIndex(l,t);this.setSchedulePosition(c,p)}}setSchedulePosition(t,i){const s=this.schedule.items;if(!s||this.playbackDisabled)return;this.log(`setSchedulePosition ${t}, ${i}`);const o=t>=0?s[t]:null,l=this.playingItem,c=this.playingLastItem;if(this.isInterstitial(l)){var p;const g=l.event,x=this.playingAsset,S=x==null?void 0:x.identifier,R=S?this.getAssetPlayer(S):null;if(R&&S&&(!this.eventItemsMatch(l,o)||i!==void 0&&S!==((p=g.assetList)==null?void 0:p[i].identifier))){var y;const N=g.findAssetIndex(x);this.log(`INTERSTITIAL_ASSET_ENDED ${N+1}/${g.assetList.length} ${ac(x)}`),this.endedAsset=x,this.playingAsset=null,this.hls.trigger(E.INTERSTITIAL_ASSET_ENDED,{asset:x,assetListIndex:N,event:g,schedule:s.slice(0),scheduleIndex:t,player:R}),this.retreiveMediaSource(S,o),R.media&&!((y=this.detachedData)!=null&&y.mediaSource)&&R.detachMedia()}if(!this.eventItemsMatch(l,o)&&(this.endedItem=l,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${g} ${Sa(l)}`),g.hasPlayed=!0,this.hls.trigger(E.INTERSTITIAL_ENDED,{event:g,schedule:s.slice(0),scheduleIndex:t}),g.cue.once)){this.updateSchedule();const N=this.schedule.items;if(o&&N){const F=this.schedule.findItemIndex(o);this.advanceSchedule(F,N,i,l,c)}return}}this.advanceSchedule(t,s,i,l,c)}advanceSchedule(t,i,s,o,l){const c=t>=0?i[t]:null,p=this.primaryMedia,y=this.playerQueue;if(y.length&&y.forEach(g=>{const x=g.interstitial,S=this.schedule.findEventIndex(x.identifier);(S<t||S>t+1)&&this.clearInterstitial(x,c)}),this.isInterstitial(c)){this.timelinePos=Math.min(Math.max(this.timelinePos,c.start),c.end);const g=c.event;s===void 0&&(s=this.schedule.findAssetIndex(g,this.timelinePos));const x=this.waitingItem;this.assetsBuffered(c,p)||this.setBufferingItem(c);let S=this.preloadAssets(g,s);if(this.eventItemsMatch(c,x||o)||(this.waitingItem=c,this.log(`INTERSTITIAL_STARTED ${Sa(c)} ${g.appendInPlace?"append in place":""}`),this.hls.trigger(E.INTERSTITIAL_STARTED,{event:g,schedule:i.slice(0),scheduleIndex:t})),!g.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${g}`);return}if(g.assetListLoader&&(g.assetListLoader.destroy(),g.assetListLoader=void 0),!p){this.log(`Waiting for attachMedia to start Interstitial ${g}`);return}this.waitingItem=this.endedItem=null,this.playingItem=c;const R=g.assetList[s];if(!R){const N=i[t+1],F=this.media;N&&F&&!this.isInterstitial(N)&&F.currentTime<N.start&&(F.currentTime=this.timelinePos=N.start),this.advanceAfterAssetEnded(g,t,s||0);return}if(S||(S=this.getAssetPlayer(R.identifier)),S===null||S.destroyed){const N=g.assetList.length;this.warn(`asset ${s+1}/${N} player destroyed ${g}`),S=this.createAssetPlayer(g,R,s)}if(!this.eventItemsMatch(c,this.bufferingItem)&&g.appendInPlace&&this.isAssetBuffered(R))return;this.startAssetPlayer(S,s,i,t,p),this.shouldPlay&&Ql(S.media)}else c!==null?(this.resumePrimary(c,t,o),this.shouldPlay&&Ql(this.hls.media)):l&&this.isInterstitial(o)&&(this.endedItem=null,this.playingItem=o,o.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var t,i;return(t=this.mediaSelection)==null||(i=t.main)==null?void 0:i.details}get primaryLive(){var t;return!!((t=this.primaryDetails)!=null&&t.live)}resumePrimary(t,i,s){var o;if(this.playingItem=t,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(t),this.log(`resuming ${Sa(t)}`),!((o=this.detachedData)!=null&&o.mediaSource)){let c=this.timelinePos;(c<t.start||c>=t.end)&&(c=this.getPrimaryResumption(t,i),this.timelinePos=c),this.attachPrimary(c,t)}if(!s)return;const l=this.schedule.items;l&&(this.log(`resumed ${Sa(t)}`),this.hls.trigger(E.INTERSTITIALS_PRIMARY_RESUMED,{schedule:l.slice(0),scheduleIndex:i}),this.checkBuffer())}getPrimaryResumption(t,i){const s=t.start;if(this.primaryLive){const o=this.primaryDetails;if(i===0)return this.hls.startPosition;if(o&&(s<o.fragmentStart||s>o.edge))return this.hls.liveSyncPosition||-1}return s}isAssetBuffered(t){const i=this.getAssetPlayer(t.identifier);return i!=null&&i.hls?i.hls.bufferedToEnd:Vr.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=t.timelineStart+(t.duration||0)}attachPrimary(t,i,s){i?this.setBufferingItem(i):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const o=this.primaryMedia;if(!o)return;const l=this.hls;l.media?this.checkBuffer():(this.transferMediaTo(l,o),s&&this.startLoadingPrimaryAt(t,s)),s||(this.timelinePos=t,this.startLoadingPrimaryAt(t,s))}startLoadingPrimaryAt(t,i){var s;const o=this.hls;!o.loadingEnabled||!o.media||Math.abs((((s=o.mainForwardBufferInfo)==null?void 0:s.start)||o.media.currentTime)-t)>.5?o.startLoad(t,i):o.bufferingEnabled||o.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(E.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(E.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(t,i){if(i.level===-1)return;const s=this.hls.levels[i.level],o=O(O({},this.mediaSelection||this.altSelection),{},{main:s});this.mediaSelection=o,this.schedule.parseInterstitialDateRanges(o,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(t,i){const s=this.hls.audioTracks[i.id],o=this.mediaSelection;if(!o){this.altSelection=O(O({},this.altSelection),{},{audio:s});return}const l=O(O({},o),{},{audio:s});this.mediaSelection=l}onSubtitleTrackUpdated(t,i){const s=this.hls.subtitleTracks[i.id],o=this.mediaSelection;if(!o){this.altSelection=O(O({},this.altSelection),{},{subtitles:s});return}const l=O(O({},o),{},{subtitles:s});this.mediaSelection=l}onAudioTrackSwitching(t,i){const s=tt(i);this.playerQueue.forEach(o=>o.hls.setAudioOption(i)||o.hls.setAudioOption(s))}onSubtitleTrackSwitch(t,i){const s=tt(i);this.playerQueue.forEach(o=>o.hls.setSubtitleOption(i)||i.id!==-1&&o.hls.setSubtitleOption(s))}onBufferCodecs(t,i){const s=i.tracks;s&&(this.requiredTracks=s)}onBufferAppended(t,i){this.checkBuffer()}onBufferFlushed(t,i){const s=this.playingItem;if(s&&!this.itemsMatch(s,this.bufferingItem)&&!this.isInterstitial(s)){const o=this.timelinePos;this.bufferedPos=o,this.checkBuffer()}}onBufferedToEnd(t){const i=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&i){for(let o=0;o<i.length;o++){const l=i[o];if(l.cue.post){var s;const c=this.schedule.findEventIndex(l.identifier),p=(s=this.schedule.items)==null?void 0:s[c];this.isInterstitial(p)&&this.eventItemsMatch(p,this.bufferingItem)&&this.bufferedToItem(p,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(t){const i=this.playingItem;if(!this.playingLastItem&&i){const s=this.findItemIndex(i);this.setSchedulePosition(s+1)}else this.shouldPlay=!1}updateItem(t,i){const s=this.schedule.items;if(t&&s){const o=this.findItemIndex(t,i);return s[o]||null}return null}itemsMatch(t,i){return!!i&&(t===i||t.event&&i.event&&this.eventItemsMatch(t,i)||!t.event&&!i.event&&this.findItemIndex(t)===this.findItemIndex(i))}eventItemsMatch(t,i){var s;return!!i&&(t===i||t.event.identifier===((s=i.event)==null?void 0:s.identifier))}findItemIndex(t,i){return t?this.schedule.findItemIndex(t,i):-1}updateSchedule(){const t=this.mediaSelection;t&&this.schedule.updateSchedule(t,[])}checkBuffer(t){const i=this.schedule.items;if(!i)return;const s=Vr.bufferInfo(this.primaryMedia,this.timelinePos,0);t&&(this.bufferedPos=this.timelinePos),t||(t=s.len<1),this.updateBufferedPos(s.end,i,t)}updateBufferedPos(t,i,s){const o=this.schedule,l=this.bufferingItem;if(this.bufferedPos>t)return;if(i.length===1&&this.itemsMatch(i[0],l)){this.bufferedPos=t;return}const c=this.playingItem,p=this.findItemIndex(c);let y=o.findItemIndexAtTime(t);if(this.bufferedPos<t){var g,x;const S=this.findItemIndex(l),R=Math.min(S+1,i.length-1),N=i[R];if((y===-1&&l&&t>=l.end||(g=N.event)!=null&&g.appendInPlace&&t+.01>=N.start)&&(y=R),R-p>1&&(l==null||(x=l.event)==null?void 0:x.appendInPlace)===!1)return;if(this.bufferedPos=t,y>S&&y>p)this.bufferedToItem(N);else{const F=this.primaryDetails;this.primaryLive&&F&&t>F.edge-F.targetduration&&N.start<F.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(N)&&this.preloadAssets(N.event,0)}}else s&&c&&!this.itemsMatch(c,l)&&(y===p?this.bufferedToItem(c):y===p+1&&this.bufferedToItem(i[y]))}assetsBuffered(t,i){return t.event.assetList.length===0?!1:!t.event.assetList.some(o=>{const l=this.getAssetPlayer(o.identifier);return!(l!=null&&l.bufferedInPlaceToEnd(i))})}setBufferingItem(t){const i=this.bufferingItem,s=this.schedule;if(this.itemsMatch(t,i))this.bufferingItem!==t&&(this.bufferingItem=t);else{const{items:o,events:l}=s;if(!o||!l)return i;const c=this.isInterstitial(t),p=this.getBufferingPlayer();if(this.bufferingItem=t,this.bufferedPos=Math.max(t.start,Math.min(t.end,this.timelinePos)),!this.playbackDisabled){const y=p?p.remaining:i?i.end-this.timelinePos:0;this.log(`buffered to boundary ${Sa(t)}`+(i?` (${y.toFixed(2)} remaining)`:"")),c?t.event.assetList.forEach(g=>{const x=this.getAssetPlayer(g.identifier);x&&x.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(g=>g.pauseBuffering()))}this.hls.trigger(E.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:l.slice(0),schedule:o.slice(0),bufferingIndex:this.findItemIndex(t),playingIndex:this.findItemIndex(this.playingItem)})}return i}bufferedToItem(t,i=0){const s=this.setBufferingItem(t);if(!this.playbackDisabled){if(this.isInterstitial(t))this.bufferedToEvent(t,i);else if(s!==null){this.bufferingAsset=null;const o=this.detachedData;o?o.mediaSource?this.attachPrimary(t.start,t,!0):this.preloadPrimary(t):this.preloadPrimary(t)}}}preloadPrimary(t){const i=this.findItemIndex(t),s=this.getPrimaryResumption(t,i);this.startLoadingPrimaryAt(s)}bufferedToEvent(t,i){const s=t.event,o=s.assetList.length===0&&!s.assetListLoader,l=s.cue.once;if(o||!l){const c=this.preloadAssets(s,i);if(c!=null&&c.interstitial.appendInPlace){const p=s.assetList[i],y=this.primaryMedia;p&&y&&this.bufferAssetPlayer(c,y)}}}preloadAssets(t,i){const s=t.assetUrl,o=t.assetList.length,l=o===0&&!t.assetListLoader,c=t.cue.once;if(l){const y=t.timelineStart;if(t.appendInPlace){var p;const R=this.playingItem;!this.isInterstitial(R)&&(R==null||(p=R.nextEvent)==null?void 0:p.identifier)===t.identifier&&this.flushFrontBuffer(y+.25)}let g,x=0;if(!this.playingItem&&this.primaryLive&&(x=this.hls.startPosition,x===-1&&(x=this.hls.liveSyncPosition||0)),x&&!(t.cue.pre||t.cue.post)){const R=x-y;R>0&&(g=Math.round(R*1e3)/1e3)}if(this.log(`Load interstitial asset ${i+1}/${s?1:o} ${t}${g?` live-start: ${x} start-offset: ${g}`:""}`),s)return this.createAsset(t,0,0,y,t.duration,s);const S=this.assetListLoader.loadAssetList(t,g);S&&(t.assetListLoader=S)}else if(!c&&o){for(let y=i;y<o;y++){const g=t.assetList[y],x=this.getAssetPlayerQueueIndex(g.identifier);(x===-1||this.playerQueue[x].destroyed)&&!g.error&&this.createAssetPlayer(t,g,y)}return this.getAssetPlayer(t.assetList[i].identifier)}return null}flushFrontBuffer(t){const i=this.requiredTracks;if(!i)return;this.log(`Removing front buffer starting at ${t}`),Object.keys(i).forEach(o=>{this.hls.trigger(E.BUFFER_FLUSHING,{startOffset:t,endOffset:1/0,type:o})})}getAssetPlayerQueueIndex(t){const i=this.playerQueue;for(let s=0;s<i.length;s++)if(t===i[s].assetId)return s;return-1}getAssetPlayer(t){const i=this.getAssetPlayerQueueIndex(t);return this.playerQueue[i]||null}getBufferingPlayer(){const{playerQueue:t,primaryMedia:i}=this;if(i){for(let s=0;s<t.length;s++)if(t[s].media===i)return t[s]}return null}createAsset(t,i,s,o,l,c){const p={parentIdentifier:t.identifier,identifier:od(t,c,i),duration:l,startOffset:s,timelineStart:o,uri:c};return this.createAssetPlayer(t,p,i)}createAssetPlayer(t,i,s){this.log(`create HLSAssetPlayer for ${ac(i)}`);const o=this.hls,l=o.userConfig;let c=l.videoPreference;const p=o.loadLevelObj||o.levels[o.currentLevel];(c||p)&&(c=k({},c),p.videoCodec&&(c.videoCodec=p.videoCodec),p.videoRange&&(c.allowedVideoRanges=[p.videoRange]));const y=o.audioTracks[o.audioTrack],g=o.subtitleTracks[o.subtitleTrack];let x=0;if(this.primaryLive||t.appendInPlace){const $e=this.timelinePos-i.timelineStart;if($e>1){const ht=i.duration;ht&&$e<ht&&(x=$e)}}const S=i.identifier,R=O(O({},l),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:o.sessionId,assetPlayerId:S,abrEwmaDefaultEstimate:o.bandwidthEstimate,interstitialsController:void 0,startPosition:x,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:c,audioPreference:y||l.audioPreference,subtitlePreference:g||l.subtitlePreference});t.appendInPlace&&(t.appendInPlaceStarted=!0,i.timelineStart&&(R.timelineOffset=i.timelineStart));const N=R.cmcd;N!=null&&N.sessionId&&N.contentId&&(R.cmcd=k({},N,{contentId:Jl(i.uri)})),this.getAssetPlayer(S)&&this.warn(`Duplicate date range identifier ${t} and asset ${S}`);const F=new ud(this.HlsPlayerClass,R,t,i);this.playerQueue.push(F),t.assetList[s]=i;const X=$e=>{if($e.live){const Nt=new Error(`Interstitials MUST be VOD assets ${t}`),gt={fatal:!0,type:Le.OTHER_ERROR,details:te.INTERSTITIAL_ASSET_ITEM_ERROR,error:Nt};this.handleAssetItemError(gt,t,this.schedule.findEventIndex(t.identifier),s,Nt.message);return}const ht=$e.edge-$e.fragmentStart,mt=i.duration;(mt===null||ht>mt)&&(this.log(`Interstitial asset "${S}" duration change ${mt} > ${ht}`),i.duration=ht,this.updateSchedule())};F.on(E.LEVEL_UPDATED,($e,{details:ht})=>X(ht)),F.on(E.LEVEL_PTS_UPDATED,($e,{details:ht})=>X(ht));const ne=($e,ht)=>{const mt=this.getAssetPlayer(S);if(mt&&ht.tracks){mt.off(E.BUFFER_CODECS,ne),mt.tracks=ht.tracks;const Nt=this.primaryMedia;this.bufferingAsset===mt.assetItem&&Nt&&!mt.media&&this.bufferAssetPlayer(mt,Nt)}};F.on(E.BUFFER_CODECS,ne);const Ce=()=>{var $e;const ht=this.getAssetPlayer(S);if(this.log(`buffered to end of asset ${ht}`),!ht)return;const mt=this.schedule.findEventIndex(t.identifier),Nt=t.findAssetIndex(i),gt=Nt+1,Tt=($e=this.schedule.items)==null?void 0:$e[mt];if(this.isInterstitial(Tt))if(Nt!==-1&&!t.isAssetPastPlayoutLimit(gt)&&!t.assetList[gt].error)this.bufferedToItem(Tt,gt);else{var Vt;const bt=(Vt=this.schedule.items)==null?void 0:Vt[mt+1];bt&&this.bufferedToItem(bt)}};F.on(E.BUFFERED_TO_END,Ce);const qe=$e=>()=>{if(!this.getAssetPlayer(S))return;this.shouldPlay=!0;const mt=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,mt,$e)};return F.once(E.MEDIA_ENDED,qe(s)),F.once(E.PLAYOUT_LIMIT_REACHED,qe(1/0)),F.on(E.ERROR,($e,ht)=>{const mt=this.getAssetPlayer(S);if(ht.details===te.BUFFER_STALLED_ERROR){if(mt!=null&&mt.media){const Nt=mt.currentTime,gt=mt.duration-Nt;Nt&&t.appendInPlace&&gt/mt.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${S} ${t} at ${mt.media.currentTime}`),Ce()):(this.warn(`Stalled at ${Nt} of ${Nt+gt} in asset ${S} ${t}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(ht,t,this.schedule.findEventIndex(t.identifier),s,`Asset player error ${ht.error} ${t}`)}),F.on(E.DESTROYING,()=>{if(!this.getAssetPlayer(S))return;const ht=new Error(`Asset player destroyed unexpectedly ${S}`),mt={fatal:!0,type:Le.OTHER_ERROR,details:te.INTERSTITIAL_ASSET_ITEM_ERROR,error:ht};this.handleAssetItemError(mt,t,this.schedule.findEventIndex(t.identifier),s,ht.message)}),this.hls.trigger(E.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:i,assetListIndex:s,event:t,player:F}),F}clearInterstitial(t,i){t.assetList.forEach(s=>{this.clearAssetPlayer(s.identifier,i)}),t.reset()}clearAssetPlayer(t,i){const s=this.getAssetPlayerQueueIndex(t);if(s!==-1){this.log(`clearAssetPlayer "${t}" toSegment: ${i&&Sa(i)}`);const o=this.playerQueue[s];this.transferMediaFromPlayer(o,i),this.playerQueue.splice(s,1),o.destroy()}}emptyPlayerQueue(){let t;for(;t=this.playerQueue.pop();)t.destroy();this.playerQueue=[]}startAssetPlayer(t,i,s,o,l){const{interstitial:c,assetItem:p,assetId:y}=t,g=c.assetList.length,x=this.playingAsset;this.endedAsset=null,this.playingAsset=p,(!x||x.identifier!==y)&&(x&&(this.clearAssetPlayer(x.identifier,s[o]),delete x.error),this.log(`INTERSTITIAL_ASSET_STARTED ${i+1}/${g} ${t}`),this.hls.trigger(E.INTERSTITIAL_ASSET_STARTED,{asset:p,assetListIndex:i,event:c,schedule:s.slice(0),scheduleIndex:o,player:t})),this.bufferAssetPlayer(t,l)}bufferAssetPlayer(t,i){var s,o;const{interstitial:l,assetItem:c,assetId:p}=t,y=this.schedule.findEventIndex(l.identifier),g=(s=this.schedule.items)==null?void 0:s[y];if(!g)return;this.setBufferingItem(g),this.bufferingAsset=c;const x=this.getBufferingPlayer();if(x===t)return;const S=l.appendInPlace;if(S&&(x==null?void 0:x.interstitial.appendInPlace)===!1)return;const R=(x==null?void 0:x.tracks)||((o=this.detachedData)==null?void 0:o.tracks)||this.requiredTracks;if(S&&c!==this.playingAsset){if(!t.tracks)return;if(R&&!ut(R,t.tracks)){const N=new Error(`Asset "${p}" SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(R)}')`),F={fatal:!0,type:Le.OTHER_ERROR,details:te.INTERSTITIAL_ASSET_ITEM_ERROR,error:N},X=l.findAssetIndex(c);this.handleAssetItemError(F,l,y,X,N.message);return}}this.transferMediaTo(t,i)}handleAssetItemError(t,i,s,o,l){if(t.details===te.BUFFER_STALLED_ERROR)return;const c=i.assetList[o]||null;let p=null;if(c){const S=this.getAssetPlayerQueueIndex(c.identifier);p=this.playerQueue[S]||null}const y=this.schedule.items,g=k({},t,{fatal:!1,errorAction:yr(!0),asset:c,assetListIndex:o,event:i,schedule:y,scheduleIndex:s,player:p});if(this.warn(`Asset item error: ${t.error}`),this.hls.trigger(E.INTERSTITIAL_ASSET_ERROR,g),!t.fatal)return;const x=new Error(l);c&&(this.playingAsset!==c&&this.clearAssetPlayer(c.identifier,null),c.error=x),i.assetList.some(S=>!S.error)?i.appendInPlace&&(i.error=x):i.error=x,this.primaryFallback(i)}primaryFallback(t){const i=t.timelineStart,s=this.effectivePlayingItem;if(this.updateSchedule(),s){this.log(`Fallback to primary from event "${t.identifier}" start: ${i} pos: ${this.timelinePos} playing: ${s?Sa(s):"<none>"} error: ${t.error}`),t.appendInPlace&&(this.attachPrimary(i,null),this.flushFrontBuffer(i));let o=this.timelinePos;o===-1&&(o=this.hls.startPosition);const l=this.updateItem(s,o);if(this.itemsMatch(s,l))this.clearInterstitial(t,null);else{const c=this.schedule.findItemIndexAtTime(o);this.setSchedulePosition(c)}}else this.checkStart()}onAssetListLoaded(t,i){var s;const o=i.event,l=o.identifier,c=i.assetListResponse.ASSETS;if(!this.schedule.hasEvent(l))return;const p=o.timelineStart,y=o.duration;let g=0;c.forEach((F,X)=>{const ne=parseFloat(F.DURATION);this.createAsset(o,X,g,p+g,ne,F.URI),g+=ne}),o.duration=g,this.log(`Loaded asset-list with duration: ${g} (was: ${y}) ${o}`);const x=this.waitingItem,S=(x==null?void 0:x.event.identifier)===l;this.updateSchedule();const R=(s=this.bufferingItem)==null?void 0:s.event;if(S){var N;const F=this.schedule.findEventIndex(l),X=(N=this.schedule.items)==null?void 0:N[F];if(X){if(!this.playingItem&&this.timelinePos>X.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==F){o.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${o}`),this.primaryFallback(o);return}this.setBufferingItem(X)}this.setSchedulePosition(F)}else if((R==null?void 0:R.identifier)===l&&R.appendInPlace){const F=o.assetList[0],X=this.getAssetPlayer(F.identifier),ne=this.primaryMedia;F&&X&&ne&&this.bufferAssetPlayer(X,ne)}}onError(t,i){switch(i.details){case te.ASSET_LIST_PARSING_ERROR:case te.ASSET_LIST_LOAD_ERROR:case te.ASSET_LIST_LOAD_TIMEOUT:{const s=i.interstitial;s&&this.primaryFallback(s);break}case te.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const oc=500;class lc extends _a{constructor(t,i,s){super(t,i,s,"subtitle-stream-controller",$.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(E.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(E.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(E.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(t,i){this.stopLoad(),this.state=Gt.IDLE,this.setInterval(oc),this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(t,i){this.tracksBuffered=[],super.onMediaDetaching(t,i)}onLevelLoaded(t,i){this.mainDetails=i.details}onSubtitleFragProcessed(t,i){const{frag:s,success:o}=i;if(xe(s)&&(this.fragPrevious=s),this.state=Gt.IDLE,!o)return;const l=this.tracksBuffered[this.currentTrackId];if(!l)return;let c;const p=s.start;for(let g=0;g<l.length;g++)if(p>=l[g].start&&p<=l[g].end){c=l[g];break}const y=s.start+s.duration;c?c.end=y:(c={start:p,end:y},l.push(c)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null),this.media&&this.tick()}onBufferFlushing(t,i){const{startOffset:s,endOffset:o}=i;if(s===0&&o!==Number.POSITIVE_INFINITY){const l=o-1;if(l<=0)return;i.endOffsetSubtitles=Math.max(0,l),this.tracksBuffered.forEach(c=>{for(let p=0;p<c.length;){if(c[p].end<=l){c.shift();continue}else if(c[p].start<l)c[p].start=l;else break;p++}}),this.fragmentTracker.removeFragmentsInRange(s,l,$.SUBTITLE)}}onError(t,i){const s=i.frag;(s==null?void 0:s.type)===$.SUBTITLE&&(i.details===te.FRAG_GAP&&this.fragmentTracker.fragBuffered(s,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Gt.STOPPED&&(this.state=Gt.IDLE))}onSubtitleTracksUpdated(t,{subtitleTracks:i}){if(this.levels&&ml(this.levels,i)){this.levels=i.map(s=>new Br(s));return}this.tracksBuffered=[],this.levels=i.map(s=>{const o=new Br(s);return this.tracksBuffered[o.id]=[],o}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,$.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(t,i){var s;if(this.currentTrackId=i.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const o=this.levels[this.currentTrackId];o!=null&&o.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,o&&this.state!==Gt.STOPPED&&this.setInterval(oc)}onSubtitleTrackLoaded(t,i){var s;const{currentTrackId:o,levels:l}=this,{details:c,id:p}=i;if(!l){this.warn(`Subtitle tracks were reset while loading level ${p}`);return}const y=l[p];if(p>=l.length||!y)return;this.log(`Subtitle track ${p} loaded [${c.startSN},${c.endSN}]${c.lastPartSn?`[part-${c.lastPartSn}-${c.lastPartIndex}]`:""},duration:${c.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let g=0;if(c.live||(s=y.details)!=null&&s.live){const S=this.mainDetails;if(c.deltaUpdateFailed||!S)return;const R=S.fragments[0];if(!y.details)c.hasProgramDateTime&&S.hasProgramDateTime?(ps(c,S),g=c.fragmentStart):R&&(g=R.start,Ua(c,g));else{var x;g=this.alignPlaylists(c,y.details,(x=this.levelLastLoaded)==null?void 0:x.details),g===0&&R&&(g=R.start,Ua(c,g))}}y.details=c,this.levelLastLoaded=y,p===o&&(this.hls.trigger(E.SUBTITLE_TRACK_UPDATED,{details:c,id:p,groupId:i.groupId}),this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===Gt.IDLE&&(Er(null,c.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)))}_handleFragmentLoadComplete(t){const{frag:i,payload:s}=t,o=i.decryptdata,l=this.hls;if(!this.fragContextChanged(i)&&s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&un(o.method)){const c=performance.now();this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,cn(o.method)).catch(p=>{throw l.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.FRAG_DECRYPT_ERROR,fatal:!1,error:p,reason:p.message,frag:i}),p}).then(p=>{const y=performance.now();l.trigger(E.FRAG_DECRYPTED,{frag:i,payload:p,stats:{tstart:c,tdecrypt:y}})}).catch(p=>{this.warn(`${p.name}: ${p.message}`),this.state=Gt.IDLE})}}doTick(){if(!this.media){this.state=Gt.IDLE;return}if(this.state===Gt.IDLE){const{currentTrackId:t,levels:i}=this,s=i==null?void 0:i[t];if(!s||!i.length||!s.details||this.waitForLive(s))return;const{config:o}=this,l=this.getLoadPosition(),c=Vr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],l,o.maxBufferHole),{end:p,len:y}=c,g=s.details,x=this.hls.maxBufferLength+g.levelTargetDuration;if(y>x)return;const S=g.fragments,R=S.length,N=g.edge;let F=null;const X=this.fragPrevious;if(p<N){const qe=o.maxFragLookUpTolerance,$e=p>N-qe?0:qe;F=Er(X,S,Math.max(S[0].start,p),$e),!F&&X&&X.start<S[0].start&&(F=S[0])}else F=S[R-1];if(F=this.filterReplacedPrimary(F,s.details),!F)return;const ne=F.sn-g.startSN,Ce=S[ne-1];if(Ce&&Ce.cc===F.cc&&this.fragmentTracker.getState(Ce)===jr.NOT_LOADED&&(F=Ce),this.fragmentTracker.getState(F)===jr.NOT_LOADED){const qe=this.mapToInitFragWhenRequired(F);qe&&this.loadFragment(qe,s,p)}}}loadFragment(t,i,s){xe(t)?super.loadFragment(t,i,s):this._loadInitSegment(t,i)}get mediaBufferTimeRanges(){return new Jc(this.tracksBuffered[this.currentTrackId]||[])}}class Jc{constructor(t){this.buffered=void 0;const i=(s,o,l)=>{if(o=o>>>0,o>l-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${o}) is greater than the maximum bound (${l})`);return t[o][s]};this.buffered={get length(){return t.length},end(s){return i("end",s,t.length)},start(s){return i("start",s,t.length)}}}}const fd={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Qc=h=>String.fromCharCode(fd[h]||h),Ia=15,ho=100,pd={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},md={17:2,18:4,21:6,22:8,23:10,19:13,20:15},gd={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},vd={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Bo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class xl{constructor(){this.time=null,this.verboseLevel=0}log(t,i){if(this.verboseLevel>=t){const s=typeof i=="function"?i():i;ve.log(`${this.time} [${t}] ${s}`)}}}const Ea=function(t){const i=[];for(let s=0;s<t.length;s++)i.push(t[s].toString(16));return i};class qa{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(t){const i=["foreground","underline","italics","background","flash"];for(let s=0;s<i.length;s++){const o=i[s];t.hasOwnProperty(o)&&(this[o]=t[o])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}copy(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class fo{constructor(){this.uchar=" ",this.penState=new qa}reset(){this.uchar=" ",this.penState.reset()}setChar(t,i){this.uchar=t,this.penState.copy(i)}setPenState(t){this.penState.copy(t)}equals(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}copy(t){this.uchar=t.uchar,this.penState.copy(t.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class Fo{constructor(t){this.chars=[],this.pos=0,this.currPenState=new qa,this.cueStartTime=null,this.logger=void 0;for(let i=0;i<ho;i++)this.chars.push(new fo);this.logger=t}equals(t){for(let i=0;i<ho;i++)if(!this.chars[i].equals(t.chars[i]))return!1;return!0}copy(t){for(let i=0;i<ho;i++)this.chars[i].copy(t.chars[i])}isEmpty(){let t=!0;for(let i=0;i<ho;i++)if(!this.chars[i].isEmpty()){t=!1;break}return t}setCursor(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>ho&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=ho)}moveCursor(t){const i=this.pos+t;if(t>1)for(let s=this.pos+1;s<i+1;s++)this.chars[s].setPenState(this.currPenState);this.setCursor(i)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(t){t>=144&&this.backSpace();const i=Qc(t);if(this.pos>=ho){this.logger.log(0,()=>"Cannot insert "+t.toString(16)+" ("+i+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(i,this.currPenState),this.moveCursor(1)}clearFromPos(t){let i;for(i=t;i<ho;i++)this.chars[i].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const t=[];let i=!0;for(let s=0;s<ho;s++){const o=this.chars[s].uchar;o!==" "&&(i=!1),t.push(o)}return i?"":t.join("")}setPenStyles(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)}}class eu{constructor(t){this.rows=[],this.currRow=Ia-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let i=0;i<Ia;i++)this.rows.push(new Fo(t));this.logger=t}reset(){for(let t=0;t<Ia;t++)this.rows[t].clear();this.currRow=Ia-1}equals(t){let i=!0;for(let s=0;s<Ia;s++)if(!this.rows[s].equals(t.rows[s])){i=!1;break}return i}copy(t){for(let i=0;i<Ia;i++)this.rows[i].copy(t.rows[i])}isEmpty(){let t=!0;for(let i=0;i<Ia;i++)if(!this.rows[i].isEmpty()){t=!1;break}return t}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(t){this.rows[this.currRow].insertChar(t)}setPen(t){this.rows[this.currRow].setPenStyles(t)}moveCursor(t){this.rows[this.currRow].moveCursor(t)}setCursor(t){this.logger.log(2,"setCursor: "+t),this.rows[this.currRow].setCursor(t)}setPAC(t){this.logger.log(2,()=>"pacData = "+Ur(t));let i=t.row-1;if(this.nrRollUpRows&&i<this.nrRollUpRows-1&&(i=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==i){for(let p=0;p<Ia;p++)this.rows[p].clear();const l=this.currRow+1-this.nrRollUpRows,c=this.lastOutputScreen;if(c){const p=c.rows[l].cueStartTime,y=this.logger.time;if(p!==null&&y!==null&&p<y)for(let g=0;g<this.nrRollUpRows;g++)this.rows[i-this.nrRollUpRows+g+1].copy(c.rows[l+g])}}this.currRow=i;const s=this.rows[this.currRow];if(t.indent!==null){const l=t.indent,c=Math.max(l-1,0);s.setCursor(t.indent),t.color=s.chars[c].penState.foreground}const o={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(o)}setBkgData(t){this.logger.log(2,()=>"bkgData = "+Ur(t)),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const t=this.currRow+1-this.nrRollUpRows,i=this.rows.splice(t,1)[0];i.clear(),this.rows.splice(this.currRow,0,i),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const i=[];let s="",o=-1;for(let l=0;l<Ia;l++){const c=this.rows[l].getTextString();c&&(o=l+1,t?i.push("Row "+o+": '"+c+"'"):i.push(c.trim()))}return i.length>0&&(t?s="["+i.join(" | ")+"]":s=i.join(`
`)),s}getTextAndFormat(){return this.rows}}class Nu{constructor(t,i,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new eu(s),this.nonDisplayedMemory=new eu(s),this.lastOutputScreen=new eu(s),this.currRollUpRow=this.displayedMemory.rows[Ia-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Ia-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,()=>"MODE="+t),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let s=0;s<t.length;s++)this.writeScreen.insertChar(t[s]);const i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>i+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const i={flash:!1};if(i.underline=t%2===1,i.italics=t>=46,i.italics)i.foreground="white";else{const s=Math.floor(t/2)-16,o=["white","green","blue","cyan","red","yellow","magenta"];i.foreground=o[s]}this.logger.log(2,"MIDROW: "+Ur(i)),this.writeScreen.setPen(i)}outputDataUpdate(t=!1){const i=this.logger.time;i!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=i:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,i,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:i),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class $u{constructor(t,i,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=eh(),this.logger=void 0;const o=this.logger=new xl;this.channels=[null,new Nu(t,i,o),new Nu(t+1,s,o)]}getHandler(t){return this.channels[t].getHandler()}setHandler(t,i){this.channels[t].setHandler(i)}addData(t,i){this.logger.time=t;for(let s=0;s<i.length;s+=2){const o=i[s]&127,l=i[s+1]&127;let c=!1,p=null;if(o===0&&l===0)continue;this.logger.log(3,()=>"["+Ea([i[s],i[s+1]])+"] -> ("+Ea([o,l])+")");const y=this.cmdHistory;if(o>=16&&o<=31){if(yd(o,l,y)){wl(null,null,y),this.logger.log(3,()=>"Repeated command ("+Ea([o,l])+") is dropped");continue}wl(o,l,this.cmdHistory),c=this.parseCmd(o,l),c||(c=this.parseMidrow(o,l)),c||(c=this.parsePAC(o,l)),c||(c=this.parseBackgroundAttributes(o,l))}else wl(null,null,y);if(!c&&(p=this.parseChars(o,l),p)){const x=this.currentChannel;x&&x>0?this.channels[x].insertChars(p):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!c&&!p&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Ea([o,l])+" orig: "+Ea([i[s],i[s+1]]))}}parseCmd(t,i){const s=(t===20||t===28||t===21||t===29)&&i>=32&&i<=47,o=(t===23||t===31)&&i>=33&&i<=35;if(!(s||o))return!1;const l=t===20||t===21||t===23?1:2,c=this.channels[l];return t===20||t===21||t===28||t===29?i===32?c.ccRCL():i===33?c.ccBS():i===34?c.ccAOF():i===35?c.ccAON():i===36?c.ccDER():i===37?c.ccRU(2):i===38?c.ccRU(3):i===39?c.ccRU(4):i===40?c.ccFON():i===41?c.ccRDC():i===42?c.ccTR():i===43?c.ccRTD():i===44?c.ccEDM():i===45?c.ccCR():i===46?c.ccENM():i===47&&c.ccEOC():c.ccTO(i-32),this.currentChannel=l,!0}parseMidrow(t,i){let s=0;if((t===17||t===25)&&i>=32&&i<=47){if(t===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const o=this.channels[s];return o?(o.ccMIDROW(i),this.logger.log(3,()=>"MIDROW ("+Ea([t,i])+")"),!0):!1}return!1}parsePAC(t,i){let s;const o=(t>=17&&t<=23||t>=25&&t<=31)&&i>=64&&i<=127,l=(t===16||t===24)&&i>=64&&i<=95;if(!(o||l))return!1;const c=t<=23?1:2;i>=64&&i<=95?s=c===1?pd[t]:gd[t]:s=c===1?md[t]:vd[t];const p=this.channels[c];return p?(p.setPAC(this.interpretPAC(s,i)),this.currentChannel=c,!0):!1}interpretPAC(t,i){let s;const o={color:null,italics:!1,indent:null,underline:!1,row:t};return i>95?s=i-96:s=i-64,o.underline=(s&1)===1,s<=13?o.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(o.italics=!0,o.color="white"):o.indent=Math.floor((s-16)/2)*4,o}parseChars(t,i){let s,o=null,l=null;if(t>=25?(s=2,l=t-8):(s=1,l=t),l>=17&&l<=19){let c;l===17?c=i+80:l===18?c=i+112:c=i+144,this.logger.log(2,()=>"Special char '"+Qc(c)+"' in channel "+s),o=[c]}else t>=32&&t<=127&&(o=i===0?[t]:[t,i]);return o&&this.logger.log(3,()=>"Char codes = "+Ea(o).join(",")),o}parseBackgroundAttributes(t,i){const s=(t===16||t===24)&&i>=32&&i<=47,o=(t===23||t===31)&&i>=45&&i<=47;if(!(s||o))return!1;let l;const c={};t===16||t===24?(l=Math.floor((i-32)/2),c.background=Bo[l],i%2===1&&(c.background=c.background+"_semi")):i===45?c.background="transparent":(c.foreground="black",i===47&&(c.underline=!0));const p=t<=23?1:2;return this.channels[p].setBkgData(c),!0}reset(){for(let t=0;t<Object.keys(this.channels).length;t++){const i=this.channels[t];i&&i.reset()}wl(null,null,this.cmdHistory)}cueSplitAtTime(t){for(let i=0;i<this.channels.length;i++){const s=this.channels[i];s&&s.cueSplitAtTime(t)}}}function wl(h,t,i){i.a=h,i.b=t}function yd(h,t,i){return i.a===h&&i.b===t}function eh(){return{a:null,b:null}}var E0=function(){if(An!=null&&An.VTTCue)return self.VTTCue;const h=["","lr","rl"],t=["start","middle","end","left","right"];function i(p,y){if(typeof y!="string"||!Array.isArray(p))return!1;const g=y.toLowerCase();return~p.indexOf(g)?g:!1}function s(p){return i(h,p)}function o(p){return i(t,p)}function l(p,...y){let g=1;for(;g<arguments.length;g++){const x=arguments[g];for(const S in x)p[S]=x[S]}return p}function c(p,y,g){const x=this,S={enumerable:!0};x.hasBeenReset=!1;let R="",N=!1,F=p,X=y,ne=g,Ce=null,qe="",$e=!0,ht="auto",mt="start",Nt=50,gt="middle",Tt=50,Vt="middle";Object.defineProperty(x,"id",l({},S,{get:function(){return R},set:function(bt){R=""+bt}})),Object.defineProperty(x,"pauseOnExit",l({},S,{get:function(){return N},set:function(bt){N=!!bt}})),Object.defineProperty(x,"startTime",l({},S,{get:function(){return F},set:function(bt){if(typeof bt!="number")throw new TypeError("Start time must be set to a number.");F=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"endTime",l({},S,{get:function(){return X},set:function(bt){if(typeof bt!="number")throw new TypeError("End time must be set to a number.");X=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"text",l({},S,{get:function(){return ne},set:function(bt){ne=""+bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"region",l({},S,{get:function(){return Ce},set:function(bt){Ce=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"vertical",l({},S,{get:function(){return qe},set:function(bt){const dr=s(bt);if(dr===!1)throw new SyntaxError("An invalid or illegal string was specified.");qe=dr,this.hasBeenReset=!0}})),Object.defineProperty(x,"snapToLines",l({},S,{get:function(){return $e},set:function(bt){$e=!!bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"line",l({},S,{get:function(){return ht},set:function(bt){if(typeof bt!="number"&&bt!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");ht=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"lineAlign",l({},S,{get:function(){return mt},set:function(bt){const dr=o(bt);if(!dr)throw new SyntaxError("An invalid or illegal string was specified.");mt=dr,this.hasBeenReset=!0}})),Object.defineProperty(x,"position",l({},S,{get:function(){return Nt},set:function(bt){if(bt<0||bt>100)throw new Error("Position must be between 0 and 100.");Nt=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"positionAlign",l({},S,{get:function(){return gt},set:function(bt){const dr=o(bt);if(!dr)throw new SyntaxError("An invalid or illegal string was specified.");gt=dr,this.hasBeenReset=!0}})),Object.defineProperty(x,"size",l({},S,{get:function(){return Tt},set:function(bt){if(bt<0||bt>100)throw new Error("Size must be between 0 and 100.");Tt=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"align",l({},S,{get:function(){return Vt},set:function(bt){const dr=o(bt);if(!dr)throw new SyntaxError("An invalid or illegal string was specified.");Vt=dr,this.hasBeenReset=!0}})),x.displayState=void 0}return c.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},c}();class th{decode(t,i){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function rh(h){function t(s,o,l,c){return(s|0)*3600+(o|0)*60+(l|0)+parseFloat(c||0)}const i=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}class ih{constructor(){this.values=Object.create(null)}set(t,i){!this.get(t)&&i!==""&&(this.values[t]=i)}get(t,i,s){return s?this.has(t)?this.values[t]:i[s]:this.has(t)?this.values[t]:i}has(t){return t in this.values}alt(t,i,s){for(let o=0;o<s.length;++o)if(i===s[o]){this.set(t,i);break}}integer(t,i){/^-?\d+$/.test(i)&&this.set(t,parseInt(i,10))}percent(t,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){const s=parseFloat(i);if(s>=0&&s<=100)return this.set(t,s),!0}return!1}}function nh(h,t,i,s){const o=s?h.split(s):[h];for(const l in o){if(typeof o[l]!="string")continue;const c=o[l].split(i);if(c.length!==2)continue;const p=c[0],y=c[1];t(p,y)}}const uc=new E0(0,0,""),A0=uc.align==="middle"?"middle":"center";function bd(h,t,i){const s=h;function o(){const p=rh(h);if(p===null)throw new Error("Malformed timestamp: "+s);return h=h.replace(/^[^\sa-zA-Z-]+/,""),p}function l(p,y){const g=new ih;nh(p,function(R,N){let F;switch(R){case"region":for(let X=i.length-1;X>=0;X--)if(i[X].id===N){g.set(R,i[X].region);break}break;case"vertical":g.alt(R,N,["rl","lr"]);break;case"line":F=N.split(","),g.integer(R,F[0]),g.percent(R,F[0])&&g.set("snapToLines",!1),g.alt(R,F[0],["auto"]),F.length===2&&g.alt("lineAlign",F[1],["start",A0,"end"]);break;case"position":F=N.split(","),g.percent(R,F[0]),F.length===2&&g.alt("positionAlign",F[1],["start",A0,"end","line-left","line-right","auto"]);break;case"size":g.percent(R,N);break;case"align":g.alt(R,N,["start",A0,"end","left","right"]);break}},/:/,/\s/),y.region=g.get("region",null),y.vertical=g.get("vertical","");let x=g.get("line","auto");x==="auto"&&uc.line===-1&&(x=-1),y.line=x,y.lineAlign=g.get("lineAlign","start"),y.snapToLines=g.get("snapToLines",!0),y.size=g.get("size",100),y.align=g.get("align",A0);let S=g.get("position","auto");S==="auto"&&uc.position===50&&(S=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=S}function c(){h=h.replace(/^\s+/,"")}if(c(),t.startTime=o(),c(),h.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);h=h.slice(3),c(),t.endTime=o(),c(),l(h,t)}function sh(h){return h.replace(/<br(?: \/)?>/gi,`
`)}class _d{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new th,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const i=this;t&&(i.buffer+=i.decoder.decode(t,{stream:!0}));function s(){let l=i.buffer,c=0;for(l=sh(l);c<l.length&&l[c]!=="\r"&&l[c]!==`
`;)++c;const p=l.slice(0,c);return l[c]==="\r"&&++c,l[c]===`
`&&++c,i.buffer=l.slice(c),p}function o(l){nh(l,function(c,p){},/:/)}try{let l="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;l=s();const p=l.match(/^()?WEBVTT([ \t].*)?$/);if(!(p!=null&&p[0]))throw new Error("Malformed WebVTT signature.");i.state="HEADER"}let c=!1;for(;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(c?c=!1:l=s(),i.state){case"HEADER":/:/.test(l)?o(l):l||(i.state="ID");continue;case"NOTE":l||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(l)){i.state="NOTE";break}if(!l)continue;if(i.cue=new E0(0,0,""),i.state="CUE",l.indexOf("-->")===-1){i.cue.id=l;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{bd(l,i.cue,i.regionList)}catch(p){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{const p=l.indexOf("-->")!==-1;if(!l||p&&(c=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
`),i.cue.text+=l}continue;case"BADCUE":l||(i.state="ID")}}}catch(l){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||t.state==="HEADER")&&(t.buffer+=`
`,t.parse()),t.state==="INITIAL"||t.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){t.onparsingerror&&t.onparsingerror(i)}return t.onflush&&t.onflush(),this}}const xd=/\r\n|\n\r|\n|\r/g,tu=function(t,i,s=0){return t.slice(s,s+i.length)===i},zu=function(t){let i=parseInt(t.slice(-3));const s=parseInt(t.slice(-6,-4)),o=parseInt(t.slice(-9,-7)),l=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!pe(i)||!pe(s)||!pe(o)||!pe(l))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return i+=1e3*s,i+=60*1e3*o,i+=60*60*1e3*l,i};function po(h,t,i){return Jl(h.toString())+Jl(t.toString())+Jl(i)}const mo=function(t,i,s){let o=t[i],l=t[o.prevCC];if(!l||!l.new&&o.new){t.ccOffset=t.presentationOffset=o.start,o.new=!1;return}for(;(c=l)!=null&&c.new;){var c;t.ccOffset+=o.start-l.start,o.new=!1,o=l,l=t[o.prevCC]}t.presentationOffset=s};function ah(h,t,i,s,o,l,c){const p=new _d,y=pt(new Uint8Array(h)).trim().replace(xd,`
`).split(`
`),g=[],x=t?bn(t.baseTime,t.timescale):0;let S="00:00.000",R=0,N=0,F,X=!0;p.oncue=function(ne){const Ce=i[s];let qe=i.ccOffset;const $e=(R-x)/9e4;if(Ce!=null&&Ce.new&&(N!==void 0?qe=i.ccOffset=Ce.start:mo(i,s,$e)),$e){if(!t){F=new Error("Missing initPTS for VTT MPEGTS");return}qe=$e-i.presentationOffset}const ht=ne.endTime-ne.startTime,mt=os((ne.startTime+qe-N)*9e4,o*9e4)/9e4;ne.startTime=Math.max(mt,0),ne.endTime=Math.max(mt+ht,0);const Nt=ne.text.trim();ne.text=decodeURIComponent(encodeURIComponent(Nt)),ne.id||(ne.id=po(ne.startTime,ne.endTime,Nt)),ne.endTime>0&&g.push(ne)},p.onparsingerror=function(ne){F=ne},p.onflush=function(){if(F){c(F);return}l(g)},y.forEach(ne=>{if(X)if(tu(ne,"X-TIMESTAMP-MAP=")){X=!1,ne.slice(16).split(",").forEach(Ce=>{tu(Ce,"LOCAL:")?S=Ce.slice(6):tu(Ce,"MPEGTS:")&&(R=parseInt(Ce.slice(7)))});try{N=zu(S)/1e3}catch(Ce){F=Ce}return}else ne===""&&(X=!1);p.parse(ne+`
`)}),p.flush()}const k0="stpp.ttml.im1t",cc=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,oh=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,wd={left:"start",center:"center",right:"end",start:"start",end:"end"};function hc(h,t,i,s){const o=nt(new Uint8Array(h),["mdat"]);if(o.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const l=o.map(p=>pt(p)),c=Bi(t.baseTime,1,t.timescale);try{l.forEach(p=>i(Sd(p,c)))}catch(p){s(p)}}function Sd(h,t){const o=new DOMParser().parseFromString(h,"text/xml").getElementsByTagName("tt")[0];if(!o)throw new Error("Invalid ttml");const l={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},c=Object.keys(l).reduce((S,R)=>(S[R]=o.getAttribute(`ttp:${R}`)||l[R],S),{}),p=o.getAttribute("xml:space")!=="preserve",y=lh(dc(o,"styling","style")),g=lh(dc(o,"layout","region")),x=dc(o,"body","[begin]");return[].map.call(x,S=>{const R=an(S,p);if(!R||!S.hasAttribute("begin"))return null;const N=Za(S.getAttribute("begin"),c),F=Za(S.getAttribute("dur"),c);let X=Za(S.getAttribute("end"),c);if(N===null)throw uh(S);if(X===null){if(F===null)throw uh(S);X=N+F}const ne=new E0(N-t,X-t,R);ne.id=po(ne.startTime,ne.endTime,ne.text);const Ce=g[S.getAttribute("region")],qe=y[S.getAttribute("style")],$e=T0(Ce,qe,y),{textAlign:ht}=$e;if(ht){const mt=wd[ht];mt&&(ne.lineAlign=mt),ne.align=ht}return k(ne,$e),ne}).filter(S=>S!==null)}function dc(h,t,i){const s=h.getElementsByTagName(t)[0];return s?[].slice.call(s.querySelectorAll(i)):[]}function lh(h){return h.reduce((t,i)=>{const s=i.getAttribute("xml:id");return s&&(t[s]=i),t},{})}function an(h,t){return[].slice.call(h.childNodes).reduce((i,s,o)=>{var l;return s.nodeName==="br"&&o?i+`
`:(l=s.childNodes)!=null&&l.length?an(s,t):t?i+s.textContent.trim().replace(/\s+/g," "):i+s.textContent},"")}function T0(h,t,i){const s="http://www.w3.org/ns/ttml#styling";let o=null;const l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],c=h!=null&&h.hasAttribute("style")?h.getAttribute("style"):null;return c&&i.hasOwnProperty(c)&&(o=i[c]),l.reduce((p,y)=>{const g=ru(t,s,y)||ru(h,s,y)||ru(o,s,y);return g&&(p[y]=g),p},{})}function ru(h,t,i){return h&&h.hasAttributeNS(t,i)?h.getAttributeNS(t,i):null}function uh(h){return new Error(`Could not parse ttml timestamp ${h}`)}function Za(h,t){if(!h)return null;let i=rh(h);return i===null&&(cc.test(h)?i=ch(h,t):oh.test(h)&&(i=Sl(h,t))),i}function ch(h,t){const i=cc.exec(h),s=(i[4]|0)+(i[5]|0)/t.subFrameRate;return(i[1]|0)*3600+(i[2]|0)*60+(i[3]|0)+s/t.frameRate}function Sl(h,t){const i=oh.exec(h),s=Number(i[1]);switch(i[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/t.frameRate;case"t":return s/t.tickRate}return s}class Uu{constructor(t,i){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=i}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(t,i,s){(this.startTime===null||this.startTime>t)&&(this.startTime=t),this.endTime=i,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class Zn{constructor(t){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=mc(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(E.FRAG_LOADING,this.onFragLoading,this),t.on(E.FRAG_LOADED,this.onFragLoaded,this),t.on(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(E.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(E.FRAG_LOADING,this.onFragLoading,this),t.off(E.FRAG_LOADED,this.onFragLoaded,this),t.off(E.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(E.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(E.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(E.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const t=new Uu(this,"textTrack1"),i=new Uu(this,"textTrack2"),s=new Uu(this,"textTrack3"),o=new Uu(this,"textTrack4");this.cea608Parser1=new $u(1,t,i),this.cea608Parser2=new $u(3,s,o)}addCues(t,i,s,o,l){let c=!1;for(let p=l.length;p--;){const y=l[p],g=Ed(y[0],y[1],i,s);if(g>=0&&(y[0]=Math.min(y[0],i),y[1]=Math.max(y[1],s),c=!0,g/(s-i)>.5))return}if(c||l.push([i,s]),this.config.renderTextTracksNatively){const p=this.captionsTracks[t];this.Cues.newCue(p,i,s,o)}else{const p=this.Cues.newCue(null,i,s,o);this.hls.trigger(E.CUES_PARSED,{type:"captions",cues:p,track:t})}}onInitPtsFound(t,{frag:i,id:s,initPTS:o,timescale:l}){const{unparsedVttFrags:c}=this;s===$.MAIN&&(this.initPTS[i.cc]={baseTime:o,timescale:l}),c.length&&(this.unparsedVttFrags=[],c.forEach(p=>{this.onFragLoaded(E.FRAG_LOADED,p)}))}getExistingTrack(t,i){const{media:s}=this;if(s)for(let o=0;o<s.textTracks.length;o++){const l=s.textTracks[o];if(pc(l,{name:t,lang:i,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return l}return null}createCaptionsTrack(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)}createNativeTrack(t){if(this.captionsTracks[t])return;const{captionsProperties:i,captionsTracks:s,media:o}=this,{label:l,languageCode:c}=i[t],p=this.getExistingTrack(l,c);if(p)s[t]=p,Io(s[t]),Zc(s[t],o);else{const y=this.createTextTrack("captions",l,c);y&&(y[t]=!0,s[t]=y)}}createNonNativeTrack(t){if(this.nonNativeCaptionsTracks[t])return;const i=this.captionsProperties[t];if(!i)return;const s=i.label,o={_id:t,label:s,kind:"captions",default:i.media?!!i.media.default:!1,closedCaptions:i.media};this.nonNativeCaptionsTracks[t]=o,this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[o]})}createTextTrack(t,i,s){const o=this.media;if(o)return o.addTextTrack(t,i,s)}onMediaAttaching(t,i){this.media=i.media,i.mediaSource||this._cleanTracks()}onMediaDetaching(t,i){const s=!!i.transferMedia;if(this.media=null,s)return;const{captionsTracks:o}=this;Object.keys(o).forEach(l=>{Io(o[l]),delete o[l]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=mc(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:t}=this;if(!t)return;const i=t.textTracks;if(i)for(let s=0;s<i.length;s++)Io(i[s])}onSubtitleTracksUpdated(t,i){const s=i.subtitleTracks||[],o=s.some(l=>l.textCodec===k0);if(this.config.enableWebVTT||o&&this.config.enableIMSC1){if(ml(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const c=this.media,p=c?Wa(c.textTracks):null;if(this.tracks.forEach((y,g)=>{let x;if(p){let S=null;for(let R=0;R<p.length;R++)if(p[R]&&pc(p[R],y)){S=p[R],p[R]=null;break}S&&(x=S)}if(x)Io(x);else{const S=fc(y);x=this.createTextTrack(S,y.name,y.lang),x&&(x.mode="disabled")}x&&this.textTracks.push(x)}),p!=null&&p.length){const y=p.filter(g=>g!==null).map(g=>g.label);y.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${y.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const c=this.tracks.map(p=>({label:p.name,kind:p.type.toLowerCase(),default:p.default,subtitleTrack:p}));this.hls.trigger(E.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}}onManifestLoaded(t,i){this.config.enableCEA708Captions&&i.captions&&i.captions.forEach(s=>{const o=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!o)return;const l=`textTrack${o[1]}`,c=this.captionsProperties[l];c&&(c.label=s.name,s.lang&&(c.languageCode=s.lang),c.media=s)})}closedCaptionsForLevel(t){const i=this.hls.levels[t.level];return i==null?void 0:i.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,i){if(this.enabled&&i.frag.type===$.MAIN){var s,o;const{cea608Parser1:l,cea608Parser2:c,lastSn:p}=this,{cc:y,sn:g}=i.frag,x=(s=(o=i.part)==null?void 0:o.index)!=null?s:-1;l&&c&&(g!==p+1||g===p&&x!==this.lastPartIndex+1||y!==this.lastCc)&&(l.reset(),c.reset()),this.lastCc=y,this.lastSn=g,this.lastPartIndex=x}}onFragLoaded(t,i){const{frag:s,payload:o}=i;if(s.type===$.SUBTITLE)if(o.byteLength){const l=s.decryptdata,c="stats"in i;if(l==null||!l.encrypted||c){const p=this.tracks[s.level],y=this.vttCCs;y[s.cc]||(y[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),p&&p.textCodec===k0?this._parseIMSC1(s,o):this._parseVTTs(i)}}else this.hls.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,i){const s=this.hls;hc(i,this.initPTS[t.cc],o=>{this._appendCues(o,t.level),s.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},o=>{s.logger.log(`Failed to parse IMSC1: ${o}`),s.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:o})})}_parseVTTs(t){var i;const{frag:s,payload:o}=t,{initPTS:l,unparsedVttFrags:c}=this,p=l.length-1;if(!l[s.cc]&&p===-1){c.push(t);return}const y=this.hls,g=(i=s.initSegment)!=null&&i.data?Fe(s.initSegment.data,new Uint8Array(o)).buffer:o;ah(g,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,x=>{this._appendCues(x,s.level),y.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},x=>{const S=x.message==="Missing initPTS for VTT MPEGTS";S?c.push(t):this._fallbackToIMSC1(s,o),y.logger.log(`Failed to parse VTT cue: ${x}`),!(S&&p>s.cc)&&y.trigger(E.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:x})})}_fallbackToIMSC1(t,i){const s=this.tracks[t.level];s.textCodec||hc(i,this.initPTS[t.cc],()=>{s.textCodec=k0,this._parseIMSC1(t,i)},()=>{s.textCodec="wvtt"})}_appendCues(t,i){const s=this.hls;if(this.config.renderTextTracksNatively){const o=this.textTracks[i];if(!o||o.mode==="disabled")return;t.forEach(l=>Yc(o,l))}else{const o=this.tracks[i];if(!o)return;const l=o.default?"default":"subtitles"+i;s.trigger(E.CUES_PARSED,{type:"subtitles",cues:t,track:l})}}onFragDecrypted(t,i){const{frag:s}=i;s.type===$.SUBTITLE&&this.onFragLoaded(E.FRAG_LOADED,i)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,i){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:s,samples:o}=i;if(!(s.type===$.MAIN&&this.closedCaptionsForLevel(s)==="NONE"))for(let l=0;l<o.length;l++){const c=o[l].bytes;if(c){this.cea608Parser1||this.initCea608Parsers();const p=this.extractCea608Data(c);this.cea608Parser1.addData(o[l].pts,p[0]),this.cea608Parser2.addData(o[l].pts,p[1])}}}onBufferFlushing(t,{startOffset:i,endOffset:s,endOffsetSubtitles:o,type:l}){const{media:c}=this;if(!(!c||c.currentTime<s)){if(!l||l==="video"){const{captionsTracks:p}=this;Object.keys(p).forEach(y=>x0(p[y],i,s))}if(this.config.renderTextTracksNatively&&i===0&&o!==void 0){const{textTracks:p}=this;Object.keys(p).forEach(y=>x0(p[y],i,o))}}}extractCea608Data(t){const i=[[],[]],s=t[0]&31;let o=2;for(let l=0;l<s;l++){const c=t[o++],p=127&t[o++],y=127&t[o++];if(p===0&&y===0)continue;if((4&c)!==0){const x=3&c;(x===0||x===1)&&(i[x].push(p),i[x].push(y))}}return i}}function fc(h){return h.characteristics&&/transcribes-spoken-dialog/gi.test(h.characteristics)&&/describes-music-and-sound/gi.test(h.characteristics)?"captions":"subtitles"}function pc(h,t){return!!h&&h.kind===fc(t)&&Pu(t,h)}function Ed(h,t,i,s){return Math.min(t,s)-Math.max(h,i)}function mc(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const C0=/\s/,iu={newCue(h,t,i,s){const o=[];let l,c,p,y,g;const x=self.VTTCue||self.TextTrackCue;for(let R=0;R<s.rows.length;R++)if(l=s.rows[R],p=!0,y=0,g="",!l.isEmpty()){var S;for(let X=0;X<l.chars.length;X++)C0.test(l.chars[X].uchar)&&p?y++:(g+=l.chars[X].uchar,p=!1);l.cueStartTime=t,t===i&&(i+=1e-4),y>=16?y--:y++;const N=sh(g.trim()),F=po(t,i,N);h!=null&&(S=h.cues)!=null&&S.getCueById(F)||(c=new x(t,i,N),c.id=F,c.line=R+1,c.align="left",c.position=10+Math.min(80,Math.floor(y*8/32)*10),o.push(c))}return h&&o.length&&(o.sort((R,N)=>R.line==="auto"||N.line==="auto"?0:R.line>8&&N.line>8?N.line-R.line:R.line-N.line),o.forEach(R=>Yc(h,R))),o}};function hh(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}const Us=/(\d+)-(\d+)\/(\d+)/;class gc{constructor(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||vf,this.controller=new self.AbortController,this.stats=new D}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,i,s){const o=this.stats;if(o.loading.start)throw new Error("Loader can only be used once.");o.loading.start=self.performance.now();const l=dh(t,this.controller.signal),c=t.responseType==="arraybuffer",p=c?"byteLength":"length",{maxTimeToFirstByteMs:y,maxLoadTimeMs:g}=i.loadPolicy;this.context=t,this.config=i,this.callbacks=s,this.request=this.fetchSetup(t,l),self.clearTimeout(this.requestTimeout),i.timeout=y&&pe(y)?y:g,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,t,this.response))},i.timeout),(xa(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(S=>{var R;this.response=this.loader=S;const N=Math.max(self.performance.now(),o.loading.start);if(self.clearTimeout(this.requestTimeout),i.timeout=g,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,t,this.response))},g-(N-o.loading.start)),!S.ok){const{status:X,statusText:ne}=S;throw new yf(ne||"fetch, bad network response",X,S)}o.loading.first=N,o.total=Fn(S.headers)||o.total;const F=(R=this.callbacks)==null?void 0:R.onProgress;return F&&pe(i.highWaterMark)?this.loadProgressively(S,o,t,i.highWaterMark,F):c?S.arrayBuffer():t.responseType==="json"?S.json():S.text()}).then(S=>{var R,N;const F=this.response;if(!F)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first);const X=S[p];X&&(o.loaded=o.total=X);const ne={url:F.url,data:S,code:F.status},Ce=(R=this.callbacks)==null?void 0:R.onProgress;Ce&&!pe(i.highWaterMark)&&Ce(o,t,S,F),(N=this.callbacks)==null||N.onSuccess(ne,o,t,F)}).catch(S=>{var R;if(self.clearTimeout(this.requestTimeout),o.aborted)return;const N=S&&S.code||0,F=S?S.message:null;(R=this.callbacks)==null||R.onError({code:N,text:F},t,S?S.details:null,o)})}getCacheAge(){let t=null;if(this.response){const i=this.response.headers.get("age");t=i?parseFloat(i):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,i,s,o=0,l){const c=new So,p=t.body.getReader(),y=()=>p.read().then(g=>{if(g.done)return c.dataLength&&l(i,s,c.flush().buffer,t),Promise.resolve(new ArrayBuffer(0));const x=g.value,S=x.length;return i.loaded+=S,S<o||c.dataLength?(c.push(x),c.dataLength>=o&&l(i,s,c.flush().buffer,t)):l(i,s,x.buffer,t),y()}).catch(()=>Promise.reject());return y()}}function dh(h,t){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(k({},h.headers))};return h.rangeEnd&&i.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),i}function er(h){const t=Us.exec(h);if(t)return parseInt(t[2])-parseInt(t[1])+1}function Fn(h){const t=h.get("Content-Range");if(t){const s=er(t);if(pe(s))return s}const i=h.get("Content-Length");if(i)return parseInt(i)}function vf(h,t){return new self.Request(h.url,t)}class yf extends Error{constructor(t,i,s){super(t),this.code=void 0,this.details=void 0,this.code=i,this.details=s}}const fh=/^age:\s*[\d.]+\s*$/im;class vc{constructor(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new D,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,t.readyState!==4&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,i,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=i,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:t,context:i}=this;if(!t||!i)return;const s=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0,o.aborted=!1;const l=this.xhrSetup;l?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return l(s,i.url)}).catch(c=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",i.url,!0),l(s,i.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,i,t)}).catch(c=>{var p;(p=this.callbacks)==null||p.onError({code:s.status,text:c.message},i,s,o)}):this.openAndSendXhr(s,i,t)}openAndSendXhr(t,i,s){t.readyState||t.open("GET",i.url,!0);const o=i.headers,{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=s.loadPolicy;if(o)for(const p in o)t.setRequestHeader(p,o[p]);i.rangeEnd&&t.setRequestHeader("Range","bytes="+i.rangeStart+"-"+(i.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=i.responseType,self.clearTimeout(this.requestTimeout),s.timeout=l&&pe(l)?l:c,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),t.send()}readystatechange(){const{context:t,loader:i,stats:s}=this;if(!t||!i)return;const o=i.readyState,l=this.config;if(!s.aborted&&o>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),l.timeout!==l.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),l.timeout=l.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),o===4)){self.clearTimeout(this.requestTimeout),i.onreadystatechange=null,i.onprogress=null;const g=i.status,x=i.responseType==="text"?i.responseText:null;if(g>=200&&g<300){const F=x!=null?x:i.response;if(F!=null){var c,p;s.loading.end=Math.max(self.performance.now(),s.loading.first);const X=i.responseType==="arraybuffer"?F.byteLength:F.length;s.loaded=s.total=X,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first);const ne=(c=this.callbacks)==null?void 0:c.onProgress;ne&&ne(s,t,F,i);const Ce={url:i.responseURL,data:F,code:g};(p=this.callbacks)==null||p.onSuccess(Ce,s,t,i);return}}const S=l.loadPolicy.errorRetry,R=s.retry,N={url:t.url,data:void 0,code:g};if(Pi(S,R,!1,N))this.retry(S);else{var y;ve.error(`${g} while loading ${t.url}`),(y=this.callbacks)==null||y.onError({code:g,text:i.statusText},t,i,s)}}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry,i=this.stats.retry;if(Pi(t,i,!0))this.retry(t);else{var s;ve.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:i,stats:s}=this;this.retryDelay=Kr(t,s.retry),s.retry++,ve.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${i==null?void 0:i.url}, retrying ${s.retry}/${t.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(t){const i=this.stats;i.loaded=t.loaded,t.lengthComputable&&(i.total=t.total)}getCacheAge(){let t=null;if(this.loader&&fh.test(this.loader.getAllResponseHeaders())){const i=this.loader.getResponseHeader("age");t=i?parseFloat(i):null}return t}getResponseHeader(t){return this.loader&&new RegExp(`^${t}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}const Ku={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},D0=O(O({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:vc,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:si,bufferController:qh,capLevelController:J0,errorController:cr,fpsController:_0,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Jr,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,certLoadPolicy:{default:Ku},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Ad()),{},{subtitleStreamController:lc,subtitleTrackController:Xc,timelineController:Zn,audioStreamController:jl,audioTrackController:Nc,emeController:pa,cmcdController:sd,contentSteeringController:ad,interstitialsController:dd});function Ad(){return{cueHandler:iu,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function kd(h,t,i){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const s=M0(h),o=["manifest","level","frag"],l=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return o.forEach(c=>{const p=`${c==="level"?"playlist":c}LoadPolicy`,y=t[p]===void 0,g=[];l.forEach(x=>{const S=`${c}Loading${x}`,R=t[S];if(R!==void 0&&y){g.push(S);const N=s[p].default;switch(t[p]={default:N},x){case"TimeOut":N.maxLoadTimeMs=R,N.maxTimeToFirstByteMs=R;break;case"MaxRetry":N.errorRetry.maxNumRetry=R,N.timeoutRetry.maxNumRetry=R;break;case"RetryDelay":N.errorRetry.retryDelayMs=R,N.timeoutRetry.retryDelayMs=R;break;case"MaxRetryTimeout":N.errorRetry.maxRetryDelayMs=R,N.timeoutRetry.maxRetryDelayMs=R;break}}}),g.length&&i.warn(`hls.js config: "${g.join('", "')}" setting(s) are deprecated, use "${p}": ${Ur(t[p])}`)}),O(O({},s),t)}function M0(h){return h&&typeof h=="object"?Array.isArray(h)?h.map(M0):Object.keys(h).reduce((t,i)=>(t[i]=M0(h[i]),t),{}):h}function nu(h,t){const i=h.loader;i!==gc&&i!==vc?(t.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1):hh()&&(h.loader=gc,h.progressive=!0,h.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}const us=2,Hu=.1,yc=.05,El=100;class Aa extends tn{constructor(t,i){super("gap-controller",t.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var s;(s=this.media)!=null&&s.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var s;this.ended=((s=this.media)==null?void 0:s.currentTime)||1,this.hls.trigger(E.MEDIA_ENDED,{stalled:!1})}},this.hls=t,this.fragmentTracker=i,this.registerListeners()}registerListeners(){const{hls:t}=this;t&&(t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(t,i){this.setInterval(El),this.mediaSource=i.mediaSource;const s=this.media=i.media;ja(s,"playing",this.onMediaPlaying),ja(s,"waiting",this.onMediaWaiting),ja(s,"ended",this.onMediaEnded)}onMediaDetaching(t,i){this.clearInterval();const{media:s}=this;s&&(Ra(s,"playing",this.onMediaPlaying),Ra(s,"waiting",this.onMediaWaiting),Ra(s,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(t,i){this.buffered=i.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var t;if(!((t=this.media)!=null&&t.readyState)||!this.hasBuffered)return;const i=this.media.currentTime;this.poll(i,this.lastCurrentTime),this.lastCurrentTime=i}poll(t,i){var s,o;const l=(s=this.hls)==null?void 0:s.config;if(!l)return;const{media:c,stalled:p}=this;if(!c)return;const{seeking:y}=c,g=this.seeking&&!y,x=!this.seeking&&y,S=c.paused&&!y||c.ended||c.playbackRate===0;if(this.seeking=y,t!==i){i&&(this.ended=0),this.moved=!0,y||(this.nudgeRetry=0,l.nudgeOnVideoHole&&!S&&t>i&&this.nudgeOnVideoHole(t,i)),this.waiting===0&&this.stallResolved(t);return}if(x||g){g&&this.stallResolved(t);return}if(S){this.nudgeRetry=0,this.stallResolved(t),!this.ended&&c.ended&&this.hls&&(this.ended=t||1,this.hls.trigger(E.MEDIA_ENDED,{stalled:!1}));return}if(!Vr.getBuffered(c).length){this.nudgeRetry=0;return}const R=Vr.bufferInfo(c,t,0),N=R.nextStart||0,F=this.fragmentTracker;if(y&&F&&this.hls){const Nt=ph(this.hls.inFlightFragments,t),gt=R.len>us,Tt=!N||Nt||N-t>us&&!F.getPartialFragment(t);if(gt||Tt)return;this.moved=!1}const X=(o=this.hls)==null?void 0:o.latestLevelDetails;if(!this.moved&&this.stalled!==null&&F){if(!(R.len>0)&&!N)return;const gt=Math.max(N,R.start||0)-t,Vt=!!(X!=null&&X.live)?X.targetduration*2:us,bt=F.getPartialFragment(t);if(gt>0&&(gt<=Vt||bt)){c.paused||this._trySkipBufferHole(bt);return}}const ne=l.detectStallWithCurrentTimeMs,Ce=self.performance.now(),qe=this.waiting;if(p===null){qe>0&&Ce-qe<ne?this.stalled=qe:this.stalled=Ce;return}const $e=Ce-p;if(!y&&($e>=ne||qe)&&this.hls){var ht;if(((ht=this.mediaSource)==null?void 0:ht.readyState)==="ended"&&!(X!=null&&X.live)&&Math.abs(t-((X==null?void 0:X.edge)||0))<1){if(this.ended)return;this.ended=t||1,this.hls.trigger(E.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(R),!this.media||!this.hls)return}const mt=Vr.bufferInfo(c,t,l.maxBufferHole);this._tryFixBufferStall(mt,$e)}stallResolved(t){const i=this.stalled;if(i&&this.hls&&(this.stalled=null,this.stallReported)){const s=self.performance.now()-i;this.log(`playback not stuck anymore @${t}, after ${Math.round(s)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(E.STALL_RESOLVED,{})}}nudgeOnVideoHole(t,i){var s;const o=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(s=this.buffered.audio)!=null&&s.length&&o&&o.length>1&&t>o.end(0)){const l=Vr.bufferedInfo(Vr.timeRangesToArray(this.buffered.audio),t,0);if(l.len>1&&i>=l.start){const c=Vr.timeRangesToArray(o),p=Vr.bufferedInfo(c,i,0).bufferedIndex;if(p>-1&&p<c.length-1){const y=Vr.bufferedInfo(c,t,0).bufferedIndex,g=c[p].end,x=c[p+1].start;if((y===-1||y>p)&&x-g<1&&t-g<2){const S=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${t} hole: ${g} -> ${x} buffered index: ${y}`);this.warn(S.message),this.media.currentTime+=1e-6;const R=this.fragmentTracker.getPartialFragment(t)||void 0,N=Vr.bufferInfo(this.media,t,0);this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:S,reason:S.message,frag:R,buffer:N.len,bufferInfo:N})}}}}}_tryFixBufferStall(t,i){var s,o;const{fragmentTracker:l,media:c}=this,p=(s=this.hls)==null?void 0:s.config;if(!c||!l||!p)return;const y=c.currentTime,g=(o=this.hls)==null?void 0:o.latestLevelDetails,x=l.getPartialFragment(y);if((x||g!=null&&g.live&&y<g.fragmentStart)&&(this._trySkipBufferHole(x)||!this.media))return;const S=t.buffered;(S&&S.length>1&&t.len>p.maxBufferHole||t.nextStart&&t.nextStart-y<p.maxBufferHole)&&(i>p.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(t))}_reportStall(t){const{hls:i,media:s,stallReported:o,stalled:l}=this;if(!o&&l!==null&&s&&i){this.stallReported=!0;const c=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${Ur(t)})`);this.warn(c.message),i.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_STALLED_ERROR,fatal:!1,error:c,buffer:t.len,bufferInfo:t,stalled:{start:l}})}}_trySkipBufferHole(t){var i;const{fragmentTracker:s,media:o}=this,l=(i=this.hls)==null?void 0:i.config;if(!o||!s||!l)return 0;const c=o.currentTime,p=Vr.bufferInfo(o,c,0),y=c<p.start?p.start:p.nextStart;if(y&&this.hls){const x=p.len<=l.maxBufferHole,S=p.len>0&&p.len<1&&o.readyState<3,R=y-c;if(R>0&&(x||S)){if(R>l.maxBufferHole){let F=!1;if(c===0){const X=s.getAppendedFrag(0,$.MAIN);X&&y<X.end&&(F=!0)}if(!F){const X=t||s.getAppendedFrag(c,$.MAIN);if(X){var g;if(!((g=this.hls.loadLevelObj)!=null&&g.details)||ph(this.hls.inFlightFragments,y))return 0;let Ce=!1,qe=X.end;for(;qe<y;){const $e=s.getPartialFragment(qe);if($e)qe+=$e.duration;else{Ce=!0;break}}if(Ce)return 0}}}const N=Math.max(y+yc,c+Hu);if(this.warn(`skipping hole, adjusting currentTime from ${c} to ${N}`),this.moved=!0,o.currentTime=N,!(t!=null&&t.gap)){const F=new Error(`fragment loaded with buffer holes, seeking from ${c} to ${N}`);this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:F,reason:F.message,frag:t||void 0,buffer:p.len,bufferInfo:p})}return N}}return 0}_tryNudgeBuffer(t){const{hls:i,media:s,nudgeRetry:o}=this,l=i==null?void 0:i.config;if(!s||!l)return 0;const c=s.currentTime;if(this.nudgeRetry++,o<l.nudgeMaxRetry){const p=c+(o+1)*l.nudgeOffset,y=new Error(`Nudging 'currentTime' from ${c} to ${p}`);this.warn(y.message),s.currentTime=p,i.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_NUDGE_ON_STALL,error:y,fatal:!1,buffer:t.len,bufferInfo:t})}else{const p=new Error(`Playhead still not moving while enough data buffered @${c} after ${l.nudgeMaxRetry} nudges`);this.error(p.message),i.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.BUFFER_STALLED_ERROR,error:p,fatal:!0,buffer:t.len,bufferInfo:t})}}}function ph(h,t){const i=su(h.main);if(i&&i.start<=t)return i;const s=su(h.audio);return s&&s.start<=t?s:null}function su(h){if(!h)return null;switch(h.state){case Gt.IDLE:case Gt.STOPPED:case Gt.ENDED:case Gt.ERROR:return null}return h.frag}const Gu=.25;function L0(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function mh(h,t,i,s,o){let l=new h(t,i,"");try{l.value=s,o&&(l.type=o)}catch(c){l=new h(t,i,Ur(o?O({type:o},s):s))}return l}const Al=(()=>{const h=L0();try{h&&new h(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Td(h){return Uint8Array.from(h.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Cd{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(E.EVENT_CUE_ENTER,{})},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:t}=this;t.on(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:t}=this;t.off(E.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(E.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(t,i){var s;this.media=i.media,((s=i.overrides)==null?void 0:s.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const t=this.hls.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(t,i){this.media=null,!i.transferMedia&&(this.id3Track&&(this.removeCues&&Io(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const i=this.getID3Track(t.textTracks);return i.mode="hidden",i}getID3Track(t){if(this.media){for(let i=0;i<t.length;i++){const s=t[i];if(s.kind==="metadata"&&s.label==="id3")return Zc(s,this.media),s}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(t,i){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:s,enableID3MetadataCues:o}}}=this;if(!s&&!o)return;const{samples:l}=i;this.id3Track||(this.id3Track=this.createTrack(this.media));const c=L0();if(c)for(let p=0;p<l.length;p++){const y=l[p].type;if(y===Fs.emsg&&!s||!o)continue;const g=ua(l[p].data);if(g){const x=l[p].pts;let S=x+l[p].duration;S>Al&&(S=Al),S-x<=0&&(S=x+Gu);for(let N=0;N<g.length;N++){const F=g[N];if(!ll(F)){this.updateId3CueEnds(x,y);const X=mh(c,x,S,F,y);X&&this.id3Track.addCue(X)}}}}}updateId3CueEnds(t,i){var s;const o=(s=this.id3Track)==null?void 0:s.cues;if(o)for(let l=o.length;l--;){const c=o[l];c.type===i&&c.startTime<t&&c.endTime===Al&&(c.endTime=t)}}onBufferFlushing(t,{startOffset:i,endOffset:s,type:o}){const{id3Track:l,hls:c}=this;if(!c)return;const{config:{enableEmsgMetadataCues:p,enableID3MetadataCues:y}}=c;if(l&&(p||y)){let g;o==="audio"?g=x=>x.type===Fs.audioId3&&y:o==="video"?g=x=>x.type===Fs.emsg&&p:g=x=>x.type===Fs.audioId3&&y||x.type===Fs.emsg&&p,x0(l,i,s,g)}}onLevelUpdated(t,{details:i}){this.updateDateRangeCues(i,!0)}onLevelPtsUpdated(t,i){Math.abs(i.drift)>.01&&this.updateDateRangeCues(i.details)}updateDateRangeCues(t,i){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:s}=this,{dateRanges:o}=t,l=Object.keys(o);let c=this.dateRangeCuesAppended;if(s&&i){var p;if((p=s.cues)!=null&&p.length){const x=Object.keys(c).filter(S=>!l.includes(S));for(let S=x.length;S--;){const R=x[S],N=c[R].cues;delete c[R],Object.keys(N).forEach(F=>{try{const X=N[F];X.removeEventListener("enter",this.onEventCueEnter),s.removeCue(X)}catch(X){}})}}else c=this.dateRangeCuesAppended={}}const y=t.fragments[t.fragments.length-1];if(l.length===0||!pe(y==null?void 0:y.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const g=L0();for(let x=0;x<l.length;x++){const S=l[x],R=o[S],N=R.startTime,F=c[S],X=(F==null?void 0:F.cues)||{};let ne=(F==null?void 0:F.durationKnown)||!1,Ce=Al;const{duration:qe,endDate:$e}=R;if($e&&qe!==null)Ce=N+qe,ne=!0;else if(R.endOnNext&&!ne){const mt=l.reduce((Nt,gt)=>{if(gt!==R.id){const Tt=o[gt];if(Tt.class===R.class&&Tt.startDate>R.startDate&&(!Nt||R.startDate<Nt.startDate))return Tt}return Nt},null);mt&&(Ce=mt.startTime,ne=!0)}const ht=Object.keys(R.attr);for(let mt=0;mt<ht.length;mt++){const Nt=ht[mt];if(!ws(Nt))continue;const gt=X[Nt];if(gt)ne&&!F.durationKnown?gt.endTime=Ce:Math.abs(gt.startTime-N)>.01&&(gt.startTime=N,gt.endTime=Ce);else if(g){let Tt=R.attr[Nt];nr(Nt)&&(Tt=Td(Tt));const bt=mh(g,N,Ce,{key:Nt,data:Tt},Fs.dateRange);bt&&(bt.id=S,this.id3Track.addCue(bt),X[Nt]=bt,this.hls.config.interstitialsController&&(Nt==="X-ASSET-LIST"||Nt==="X-ASSET-URL")&&bt.addEventListener("enter",this.onEventCueEnter))}}c[S]={cues:X,dateRange:R,durationKnown:ne}}}}class Dd{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:i}=this,s=this.levelDetails;if(!i||!s)return;this.currentTime=i.currentTime;const o=this.computeLatency();if(o===null)return;this._latency=o;const{lowLatencyMode:l,maxLiveSyncPlaybackRate:c}=this.config;if(!l||c===1||!s.live)return;const p=this.targetLatency;if(p===null)return;const y=o-p,g=Math.min(this.maxLatency,p+s.targetduration);if(y<g&&y>.05&&this.forwardBufferLength>1){const S=Math.min(2,Math.max(1,c)),R=Math.round(2/(1+Math.exp(-.75*y-this.edgeStalled))*20)/20,N=Math.min(S,Math.max(1,R));this.changeMediaPlaybackRate(i,N)}else i.playbackRate!==1&&i.playbackRate!==0&&this.changeMediaPlaybackRate(i,1)},this.hls=t,this.config=t.config,this.registerListeners()}get levelDetails(){var t;return((t=this.hls)==null?void 0:t.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:t}=this;if(t.liveMaxLatencyDuration!==void 0)return t.liveMaxLatencyDuration;const i=this.levelDetails;return i?t.liveMaxLatencyDurationCount*i.targetduration:0}get targetLatency(){const t=this.levelDetails;if(t===null||this.hls===null)return null;const{holdBack:i,partHoldBack:s,targetduration:o}=t,{liveSyncDuration:l,liveSyncDurationCount:c,lowLatencyMode:p}=this.config,y=this.hls.userConfig;let g=p&&s||i;(this._targetLatencyUpdated||y.liveSyncDuration||y.liveSyncDurationCount||g===0)&&(g=l!==void 0?l:c*o);const x=o;return g+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,x)}set targetLatency(t){this.stallCount=0,this.config.liveSyncDuration=t,this._targetLatencyUpdated=!0}get liveSyncPosition(){const t=this.estimateLiveEdge(),i=this.targetLatency;if(t===null||i===null)return null;const s=this.levelDetails;if(s===null)return null;const o=s.edge,l=t-i-this.edgeStalled,c=o-s.totalduration,p=o-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(c,l),p)}get drift(){const t=this.levelDetails;return t===null?1:t.drift}get edgeStalled(){const t=this.levelDetails;if(t===null)return 0;const i=(this.config.lowLatencyMode&&t.partTarget||t.targetduration)*3;return Math.max(t.age-i,0)}get forwardBufferLength(){const{media:t}=this,i=this.levelDetails;if(!t||!i)return 0;const s=t.buffered.length;return(s?t.buffered.end(s-1):i.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:t}=this;t&&(t.on(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(E.ERROR,this.onError,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(E.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(E.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(E.ERROR,this.onError,this))}onMediaAttached(t,i){this.media=i.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:i}){i.advanced&&this.onTimeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(t,i){var s;i.details===te.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(s=this.levelDetails)!=null&&s.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(t,i){var s,o;t.playbackRate!==i&&((s=this.hls)==null||s.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(o=this.targetLatency)==null?void 0:o.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${t.playbackRate} to ${i}`),t.playbackRate=i)}estimateLiveEdge(){const t=this.levelDetails;return t===null?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return t===null?null:t-this.currentTime}}class Vu extends uo{constructor(t,i){super(t,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=i,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this),t.on(E.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this),t.off(E.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(i=>{i.loadError=0,i.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(t,i){this.resetLevels()}onManifestLoaded(t,i){const s=this.hls.config.preferManagedMediaSource,o=[],l={},c={};let p=!1,y=!1,g=!1;i.levels.forEach(x=>{var S;const R=x.attrs;let{audioCodec:N,videoCodec:F}=x;N&&(x.audioCodec=N=Ae(N,s)||void 0),((S=F)==null?void 0:S.indexOf("avc1"))===0&&(F=x.videoCodec=ei(F));const{width:X,height:ne,unknownCodecs:Ce}=x;let qe=Ce?Ce.length:0;if(Ce)for(let dr=qe;dr--;){const Ir=Ce[dr];this.isAudioSupported(Ir)?(x.audioCodec=N=N?`${N},${Ir}`:Ir,qe--,xr.audio[N.substring(0,4)]=2):this.isVideoSupported(Ir)&&(x.videoCodec=F=F?`${F},${Ir}`:Ir,qe--,xr.video[F.substring(0,4)]=2)}if(p||(p=!!(X&&ne)),y||(y=!!F),g||(g=!!N),qe||N&&!this.isAudioSupported(N)||F&&!this.isVideoSupported(F)){this.log(`Some or all CODECS not supported "${R.CODECS}"`);return}const{CODECS:$e,"FRAME-RATE":ht,"HDCP-LEVEL":mt,"PATHWAY-ID":Nt,RESOLUTION:gt,"VIDEO-RANGE":Tt}=R,bt=`${`${Nt||"."}-`}${x.bitrate}-${gt}-${ht}-${$e}-${Tt}-${mt}`;if(l[bt])if(l[bt].uri!==x.url&&!x.attrs["PATHWAY-ID"]){const dr=c[bt]+=1;x.attrs["PATHWAY-ID"]=new Array(dr+1).join(".");const Ir=this.createLevel(x);l[bt]=Ir,o.push(Ir)}else l[bt].addGroupId("audio",R.AUDIO),l[bt].addGroupId("text",R.SUBTITLES);else{const dr=this.createLevel(x);l[bt]=dr,c[bt]=1,o.push(dr)}}),this.filterAndSortMediaOptions(o,i,p,y,g)}createLevel(t){const i=new Br(t),s=t.supplemental;if(s!=null&&s.videoCodec&&!this.isVideoSupported(s.videoCodec)){const o=new Error(`SUPPLEMENTAL-CODECS not supported "${s.videoCodec}"`);this.log(o.message),i.supportedResult=me(o,[])}return i}isAudioSupported(t){return He(t,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(t){return He(t,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(t,i,s,o,l){let c=[],p=[],y=t;if((s||o)&&l&&(y=y.filter(({videoCodec:F,videoRange:X,width:ne,height:Ce})=>(!!F||!!(ne&&Ce))&&Rr(X))),y.length===0){Promise.resolve().then(()=>{if(this.hls){let F="no level with compatible codecs found in manifest",X=F;i.levels.length&&(X=`one or more CODECS in variant not supported: ${Ur(i.levels.map(Ce=>Ce.attrs.CODECS).filter((Ce,qe,$e)=>$e.indexOf(Ce)===qe))}`,this.warn(X),F+=` (${X})`);const ne=new Error(F);this.hls.trigger(E.ERROR,{type:Le.MEDIA_ERROR,details:te.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,error:ne,reason:X})}});return}i.audioTracks&&(c=i.audioTracks.filter(F=>!F.audioCodec||this.isAudioSupported(F.audioCodec)),au(c)),i.subtitles&&(p=i.subtitles,au(p));const g=y.slice(0);y.sort((F,X)=>{if(F.attrs["HDCP-LEVEL"]!==X.attrs["HDCP-LEVEL"])return(F.attrs["HDCP-LEVEL"]||"")>(X.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&F.height!==X.height)return F.height-X.height;if(F.frameRate!==X.frameRate)return F.frameRate-X.frameRate;if(F.videoRange!==X.videoRange)return Jt.indexOf(F.videoRange)-Jt.indexOf(X.videoRange);if(F.videoCodec!==X.videoCodec){const ne=ge(F.videoCodec),Ce=ge(X.videoCodec);if(ne!==Ce)return Ce-ne}if(F.uri===X.uri&&F.codecSet!==X.codecSet){const ne=Se(F.codecSet),Ce=Se(X.codecSet);if(ne!==Ce)return Ce-ne}return F.averageBitrate!==X.averageBitrate?F.averageBitrate-X.averageBitrate:0});let x=g[0];if(this.steering&&(y=this.steering.filterParsedLevels(y),y.length!==g.length)){for(let F=0;F<g.length;F++)if(g[F].pathwayId===y[0].pathwayId){x=g[F];break}}this._levels=y;for(let F=0;F<y.length;F++)if(y[F]===x){var S;this._firstLevel=F;const X=x.bitrate,ne=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${y.length} level(s) found, first bitrate: ${X}`),((S=this.hls.userConfig)==null?void 0:S.abrEwmaDefaultEstimate)===void 0){const Ce=Math.min(X,this.hls.config.abrEwmaDefaultEstimateMax);Ce>ne&&ne===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Ce)}break}const R=l&&!o,N={levels:y,audioTracks:c,subtitleTracks:p,sessionData:i.sessionData,sessionKeys:i.sessionKeys,firstLevel:this._firstLevel,stats:i.stats,audio:l,video:o,altAudio:!R&&c.some(F=>!!F.url)};this.hls.trigger(E.MANIFEST_PARSED,N)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(t){const i=this._levels;if(i.length===0)return;if(t<0||t>=i.length){const x=new Error("invalid level idx"),S=t<0;if(this.hls.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.LEVEL_SWITCH_ERROR,level:t,fatal:S,error:x,reason:x.message}),S)return;t=Math.min(t,i.length-1)}const s=this.currentLevelIndex,o=this.currentLevel,l=o?o.attrs["PATHWAY-ID"]:void 0,c=i[t],p=c.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=c,s===t&&o&&l===p)return;this.log(`Switching to level ${t} (${c.height?c.height+"p ":""}${c.videoRange?c.videoRange+" ":""}${c.codecSet?c.codecSet+" ":""}@${c.bitrate})${p?" with Pathway "+p:""} from level ${s}${l?" with Pathway "+l:""}`);const y={level:t,attrs:c.attrs,details:c.details,bitrate:c.bitrate,averageBitrate:c.averageBitrate,maxBitrate:c.maxBitrate,realBitrate:c.realBitrate,width:c.width,height:c.height,codecSet:c.codecSet,audioCodec:c.audioCodec,videoCodec:c.videoCodec,audioGroups:c.audioGroups,subtitleGroups:c.subtitleGroups,loaded:c.loaded,loadError:c.loadError,fragmentError:c.fragmentError,name:c.name,id:c.id,uri:c.uri,url:c.url,urlId:0,audioGroupIds:c.audioGroupIds,textGroupIds:c.textGroupIds};this.hls.trigger(E.LEVEL_SWITCHING,y);const g=c.details;if(!g||g.live){const x=this.switchParams(c.uri,o==null?void 0:o.details,g);this.loadPlaylist(x)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(this._startLevel===void 0){const t=this.hls.config.startLevel;return t!==void 0?t:this.hls.firstAutoLevel}return this._startLevel}set startLevel(t){this._startLevel=t}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(t){if(this.steering){const i=this.steering.pathways(),s=t.filter(o=>i.indexOf(o)!==-1);if(t.length<1){this.warn(`pathwayPriority ${t} should contain at least one pathway from list: ${i}`);return}this.steering.pathwayPriority=s}}onError(t,i){i.fatal||!i.context||i.context.type===Me.LEVEL&&i.context.level===this.level&&this.checkRetry(i)}onFragBuffered(t,{frag:i}){if(i!==void 0&&i.type===$.MAIN){const s=i.elementaryStreams;if(!Object.keys(s).some(l=>!!s[l]))return;const o=this._levels[i.level];o!=null&&o.loadError&&(this.log(`Resetting level error count of ${o.loadError} on frag buffered`),o.loadError=0)}}onLevelLoaded(t,i){var s;const{level:o,details:l}=i,c=i.levelInfo;if(!c){var p;this.warn(`Invalid level index ${o}`),(p=i.deliveryDirectives)!=null&&p.skip&&(l.deltaUpdateFailed=!0);return}if(c===this.currentLevel||i.withoutMultiVariant){c.fragmentError===0&&(c.loadError=0);let y=c.details;y===i.details&&y.advanced&&(y=void 0),this.playlistLoaded(o,i,y)}else(s=i.deliveryDirectives)!=null&&s.skip&&(l.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,t)}loadingPlaylist(t,i){super.loadingPlaylist(t,i);const s=this.getUrlWithDirectives(t.uri,i),o=this.currentLevelIndex,l=t.attrs["PATHWAY-ID"],c=t.details,p=c==null?void 0:c.age;this.log(`Loading level index ${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${l?" Pathway "+l:""}${p&&c.live?" age "+p.toFixed(1)+(c.type?" "+c.type||0:""):""} ${s}`),this.hls.trigger(E.LEVEL_LOADING,{url:s,level:o,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"],id:0,deliveryDirectives:i||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}removeLevel(t){var i;if(this._levels.length===1)return;const s=this._levels.filter((l,c)=>c!==t?!0:(this.steering&&this.steering.removeLevel(l),l===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,l.details&&l.details.fragments.forEach(p=>p.level=-1)),!1));Js(s),this._levels=s,this.currentLevelIndex>-1&&(i=this.currentLevel)!=null&&i.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const o=s.length-1;this._firstLevel=Math.min(this._firstLevel,o),this._startLevel&&(this._startLevel=Math.min(this._startLevel,o)),this.hls.trigger(E.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(t,{levels:i}){this._levels=i}checkMaxAutoUpdated(){const{autoLevelCapping:t,maxAutoLevel:i,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==i&&(this._maxAutoLevel=i,this.hls.trigger(E.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:i,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function au(h){const t={};h.forEach(i=>{const s=i.groupId||"";i.id=t[s]=t[s]||0,t[s]++})}function R0(){return self.SourceBuffer||self.WebKitSourceBuffer}function No(){if(!Ye())return!1;const t=R0();return!t||t.prototype&&typeof t.prototype.appendBuffer=="function"&&typeof t.prototype.remove=="function"}function $o(){if(!No())return!1;const h=Ye();return typeof(h==null?void 0:h.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(t=>h.isTypeSupported(W(t,"video")))||["mp4a.40.2","fLaC"].some(t=>h.isTypeSupported(W(t,"audio"))))}function Md(){var h;const t=R0();return typeof(t==null||(h=t.prototype)==null?void 0:h.changeType)=="function"}const gh=100;class bc extends _a{constructor(t,i,s){super(t,i,s,"stream-controller",$.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const o=this.media,l=o?o.currentTime:null;if(l===null||!pe(l)||(this.log(`Media seeked to ${l.toFixed(3)}`),!this.getBufferedFrag(l)))return;const c=this.getFwdBufferInfoAtPos(o,l,$.MAIN,0);if(c===null||c.len===0){this.warn(`Main forward buffer length at ${l} on "seeked" event ${c?c.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(E.MANIFEST_PARSED,this.onManifestParsed,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.LEVEL_LOADED,this.onLevelLoaded,this),t.on(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(E.BUFFER_CREATED,this.onBufferCreated,this),t.on(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(E.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(E.MANIFEST_PARSED,this.onManifestParsed,this),t.off(E.LEVEL_LOADED,this.onLevelLoaded,this),t.off(E.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(E.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(E.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(E.BUFFER_CREATED,this.onBufferCreated,this),t.off(E.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(E.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(t,i){if(this.levels){const{lastCurrentTime:s,hls:o}=this;if(this.stopLoad(),this.setInterval(gh),this.level=-1,!this.startFragRequested){let l=o.startLevel;l===-1&&(o.config.testBandwidth&&this.levels.length>1?(l=0,this.bitrateTest=!0):l=o.firstAutoLevel),o.nextLoadLevel=l,this.level=o.loadLevel,this._hasEnoughToStart=!!i}s>0&&t===-1&&!i&&(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),t=s),this.state=Gt.IDLE,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=Gt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Gt.WAITING_LEVEL:{const{levels:i,level:s}=this,o=i==null?void 0:i[s],l=o==null?void 0:o.details;if(l&&(!l.live||this.levelLastLoaded===o&&!this.waitForLive(o))){if(this.waitForCdnTuneIn(l))break;this.state=Gt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Gt.IDLE;break}break}case Gt.FRAG_LOADING_WAITING_RETRY:{var t;const i=self.performance.now(),s=this.retryDate;if(!s||i>=s||(t=this.media)!=null&&t.seeking){const{levels:o,level:l}=this,c=o==null?void 0:o[l];this.resetStartWhenNotLoaded(c||null),this.state=Gt.IDLE}}break}this.state===Gt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var t;super.onTickEnd(),(t=this.media)!=null&&t.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:i,levels:s,media:o}=this;if(i===null||!o&&!this.primaryPrefetch&&(this.startFragRequested||!t.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const l=this.buffering?t.nextLoadLevel:t.loadLevel;if(!(s!=null&&s[l]))return;const c=s[l],p=this.getMainFwdBufferInfo();if(p===null)return;const y=this.getLevelDetails();if(y&&this._streamEnded(p,y)){const X={};this.altAudio===2&&(X.type="video"),this.hls.trigger(E.BUFFER_EOS,X),this.state=Gt.ENDED;return}if(!this.buffering)return;t.loadLevel!==l&&t.manualLevel===-1&&this.log(`Adapting to level ${l} from level ${this.level}`),this.level=t.nextLoadLevel=l;const g=c.details;if(!g||this.state===Gt.WAITING_LEVEL||this.waitForLive(c)){this.level=l,this.state=Gt.WAITING_LEVEL,this.startFragRequested=!1;return}const x=p.len,S=this.getMaxBufferLength(c.maxBitrate);if(x>=S)return;this.backtrackFragment&&this.backtrackFragment.start>p.end&&(this.backtrackFragment=null);const R=this.backtrackFragment?this.backtrackFragment.start:p.end;let N=this.getNextFragment(R,g);if(this.couldBacktrack&&!this.fragPrevious&&N&&xe(N)&&this.fragmentTracker.getState(N)!==jr.OK){var F;const ne=((F=this.backtrackFragment)!=null?F:N).sn-g.startSN,Ce=g.fragments[ne-1];Ce&&N.cc===Ce.cc&&(N=Ce,this.fragmentTracker.removeFragment(Ce))}else this.backtrackFragment&&p.len&&(this.backtrackFragment=null);if(N&&this.isLoopLoading(N,R)){if(!N.gap){const ne=this.audioOnly&&!this.altAudio?L.AUDIO:L.VIDEO,Ce=(ne===L.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Ce&&this.afterBufferFlushed(Ce,ne,$.MAIN)}N=this.getNextFragmentLoopLoading(N,g,p,$.MAIN,S)}N&&(N.initSegment&&!N.initSegment.data&&!this.bitrateTest&&(N=N.initSegment),this.loadFragment(N,c,R))}loadFragment(t,i,s){const o=this.fragmentTracker.getState(t);o===jr.NOT_LOADED||o===jr.PARTIAL?xe(t)?this.bitrateTest?(this.log(`Fragment ${t.sn} of level ${t.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(t,i)):super.loadFragment(t,i,s):this._loadInitSegment(t,i):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,$.MAIN)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:t,media:i}=this;if(i!=null&&i.readyState){let s;const o=this.getAppendedFrag(i.currentTime);o&&o.start>1&&this.flushMainBuffer(0,o.start-1);const l=this.getLevelDetails();if(l!=null&&l.live){const p=this.getMainFwdBufferInfo();if(!p||p.len<l.targetduration*2)return}if(!i.paused&&t){const p=this.hls.nextLoadLevel,y=t[p],g=this.fragLastKbps;g&&this.fragCurrent?s=this.fragCurrent.duration*y.maxBitrate/(1e3*g)+1:s=0}else s=0;const c=this.getBufferedFrag(i.currentTime+s);if(c){const p=this.followingBufferedFrag(c);if(p){this.abortCurrentFrag();const y=p.maxStartPTS?p.maxStartPTS:p.start,g=p.duration,x=Math.max(c.end,y+Math.min(Math.max(g-this.config.maxFragLookUpTolerance,g*(this.couldBacktrack?.5:.125)),g*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.state){case Gt.KEY_LOADING:case Gt.FRAG_LOADING:case Gt.FRAG_LOADING_WAITING_RETRY:case Gt.PARSING:case Gt.PARSED:this.state=Gt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,i){super.flushMainBuffer(t,i,this.altAudio===2?"video":null)}onMediaAttached(t,i){super.onMediaAttached(t,i);const s=i.media;ja(s,"playing",this.onMediaPlaying),ja(s,"seeked",this.onMediaSeeked)}onMediaDetaching(t,i){const{media:s}=this;s&&(Ra(s,"playing",this.onMediaPlaying),Ra(s,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(t,i),!i.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(E.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(t,i){let s=!1,o=!1;i.levels.forEach(l=>{const c=l.audioCodec;c&&(s=s||c.indexOf("mp4a.40.2")!==-1,o=o||c.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=s&&o&&!Md(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=i.levels,this.startFragRequested=!1}onLevelLoading(t,i){const{levels:s}=this;if(!s||this.state!==Gt.IDLE)return;const o=i.levelInfo;(!o.details||o.details.live&&(this.levelLastLoaded!==o||o.details.expired)||this.waitForCdnTuneIn(o.details))&&(this.state=Gt.WAITING_LEVEL)}onLevelLoaded(t,i){var s;const{levels:o,startFragRequested:l}=this,c=i.level,p=i.details,y=p.totalduration;if(!o){this.warn(`Levels were reset while loading level ${c}`);return}this.log(`Level ${c} loaded [${p.startSN},${p.endSN}]${p.lastPartSn?`[part-${p.lastPartSn}-${p.lastPartIndex}]`:""}, cc [${p.startCC}, ${p.endCC}] duration:${y}`);const g=i.levelInfo,x=this.fragCurrent;x&&(this.state===Gt.FRAG_LOADING||this.state===Gt.FRAG_LOADING_WAITING_RETRY)&&x.level!==i.level&&x.loader&&this.abortCurrentFrag();let S=0;if(p.live||(s=g.details)!=null&&s.live){var R;if(this.checkLiveUpdate(p),p.deltaUpdateFailed)return;S=this.alignPlaylists(p,g.details,(R=this.levelLastLoaded)==null?void 0:R.details)}if(g.details=p,this.levelLastLoaded=g,l||this.setStartPosition(p,S),this.hls.trigger(E.LEVEL_UPDATED,{details:p,level:c}),this.state===Gt.WAITING_LEVEL){if(this.waitForCdnTuneIn(p))return;this.state=Gt.IDLE}l&&p.live&&this.synchronizeToLiveEdge(p),this.tick()}synchronizeToLiveEdge(t){const{config:i,media:s}=this;if(!s)return;const o=this.hls.liveSyncPosition,l=this.getLoadPosition(),c=t.fragmentStart,p=t.edge,y=l>=c-i.maxFragLookUpTolerance&&l<=p;if(o!==null&&s.duration>o&&(l<o||!y)){const g=i.liveMaxLatencyDuration!==void 0?i.liveMaxLatencyDuration:i.liveMaxLatencyDurationCount*t.targetduration;(!y&&s.readyState<4||l<p-g)&&(this._hasEnoughToStart||(this.nextLoadPosition=o),s.readyState&&(this.warn(`Playback: ${l.toFixed(3)} is located too far from the end of live sliding playlist: ${p}, reset currentTime to : ${o.toFixed(3)}`),s.currentTime=o))}}_handleFragmentLoadProgress(t){var i;const s=t.frag,{part:o,payload:l}=t,{levels:c}=this;if(!c){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const p=c[s.level];if(!p){this.warn(`Level ${s.level} not found on progress`);return}const y=p.details;if(!y){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const g=p.videoCodec,x=y.PTSKnown||!y.live,S=(i=s.initSegment)==null?void 0:i.data,R=this._getAudioCodec(p),N=this.transmuxer=this.transmuxer||new Wl(this.hls,$.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),F=o?o.index:-1,X=F!==-1,ne=new In(s.level,s.sn,s.stats.chunkCount,l.byteLength,F,X),Ce=this.initPTS[s.cc];N.push(l,S,R,g,s,o,y.totalduration,x,ne,Ce)}onAudioTrackSwitching(t,i){const s=this.hls,o=this.altAudio===2;if(pr(i.url,s))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const c=this.fragCurrent;c&&(this.log("Switching to main audio track, cancel main fragment load"),c.abortRequests(),this.fragmentTracker.removeFragment(c)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(o){this.fragmentTracker.removeAllFragments(),s.once(E.BUFFER_FLUSHED,()=>{var c;(c=this.hls)==null||c.trigger(E.AUDIO_TRACK_SWITCHED,i)}),s.trigger(E.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}s.trigger(E.AUDIO_TRACK_SWITCHED,i)}}onAudioTrackSwitched(t,i){const s=pr(i.url,this.hls);if(s){const o=this.videoBuffer;o&&this.mediaBuffer!==o&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=o)}this.altAudio=s?2:0,this.tick()}onBufferCreated(t,i){const s=i.tracks;let o,l,c=!1;for(const p in s){const y=s[p];if(y.id==="main"){if(l=p,o=y,p==="video"){const g=s[p];g&&(this.videoBuffer=g.buffer)}}else c=!0}c&&o?(this.log(`Alternate track found, use ${l}.buffered to schedule main fragment loading`),this.mediaBuffer=o.buffer):this.mediaBuffer=this.media}onFragBuffered(t,i){const{frag:s,part:o}=i,l=s.type===$.MAIN;if(l){if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${o?" p: "+o.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===Gt.PARSED&&(this.state=Gt.IDLE);return}const p=o?o.stats:s.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),xe(s)&&(this.fragPrevious=s),this.fragBufferedComplete(s,o)}const c=this.media;c&&(!this._hasEnoughToStart&&Vr.getBuffered(c).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),l&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(t,i){var s;if(i.fatal){this.state=Gt.ERROR;return}switch(i.details){case te.FRAG_GAP:case te.FRAG_PARSING_ERROR:case te.FRAG_DECRYPT_ERROR:case te.FRAG_LOAD_ERROR:case te.FRAG_LOAD_TIMEOUT:case te.KEY_LOAD_ERROR:case te.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($.MAIN,i);break;case te.LEVEL_LOAD_ERROR:case te.LEVEL_LOAD_TIMEOUT:case te.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Gt.WAITING_LEVEL&&((s=i.context)==null?void 0:s.type)===Me.LEVEL&&(this.state=Gt.IDLE);break;case te.BUFFER_ADD_CODEC_ERROR:case te.BUFFER_APPEND_ERROR:if(i.parent!=="main")return;this.resetLoadingState();break;case te.BUFFER_FULL_ERROR:if(i.parent!=="main")return;this.reduceLengthAndFlushBuffer(i)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case te.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onFragLoadEmergencyAborted(){this.state=Gt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:i}){if(i!==L.AUDIO||!this.altAudio){const s=(i===L.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;s&&(this.afterBufferFlushed(s,i,$.MAIN),this.tick())}}onLevelsUpdated(t,i){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=i.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const i=t.currentTime;let s=this.startPosition;if(s>=0&&i<s){if(t.seeking){this.log(`could not seek to ${s}, already seeking at ${i}`);return}const o=this.timelineOffset;o&&s&&(s+=o);const l=this.getLevelDetails(),c=Vr.getBuffered(t),p=c.length?c.start(0):0,y=p-s,g=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);y>0&&(y<g||this.loadingParts&&y<2*((l==null?void 0:l.partTarget)||0))&&(this.log(`adjusting start position by ${y} to match buffer start`),s+=y,this.startPosition=s),i<s&&(this.log(`seek to target start position ${s} from current time ${i} buffer start ${p}`),t.currentTime=s)}}_getAudioCodec(t){let i=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&i&&(this.log("Swapping audio codec"),i.indexOf("mp4a.40.5")!==-1?i="mp4a.40.2":i="mp4a.40.5"),i}_loadBitrateTestFrag(t,i){t.bitrateTest=!0,this._doFragLoad(t,i).then(s=>{const{hls:o}=this,l=s==null?void 0:s.frag;if(!l||this.fragContextChanged(l))return;i.fragmentError=0,this.state=Gt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const c=l.stats;c.parsing.start=c.parsing.end=c.buffering.start=c.buffering.end=self.performance.now(),o.trigger(E.FRAG_LOADED,s),l.bitrateTest=!1})}_handleTransmuxComplete(t){var i;const s=this.playlistType,{hls:o}=this,{remuxResult:l,chunkMeta:c}=t,p=this.getCurrentContext(c);if(!p){this.resetWhenMissingContext(c);return}const{frag:y,part:g,level:x}=p,{video:S,text:R,id3:N,initSegment:F}=l,{details:X}=x,ne=this.altAudio?void 0:l.audio;if(this.fragContextChanged(y)){this.fragmentTracker.removeFragment(y);return}if(this.state=Gt.PARSING,F){if(F!=null&&F.tracks){const $e=y.initSegment||y;this._bufferInitSegment(x,F.tracks,$e,c),o.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:$e,id:s,tracks:F.tracks})}const Ce=F.initPTS,qe=F.timescale;pe(Ce)&&(this.initPTS[y.cc]={baseTime:Ce,timescale:qe},o.trigger(E.INIT_PTS_FOUND,{frag:y,id:s,initPTS:Ce,timescale:qe}))}if(S&&X){const Ce=X.fragments[y.sn-1-X.startSN],qe=y.sn===X.startSN,$e=!Ce||y.cc>Ce.cc;if(l.independent!==!1){const{startPTS:ht,endPTS:mt,startDTS:Nt,endDTS:gt}=S;if(g)g.elementaryStreams[S.type]={startPTS:ht,endPTS:mt,startDTS:Nt,endDTS:gt};else if(S.firstKeyFrame&&S.independent&&c.id===1&&!$e&&(this.couldBacktrack=!0),S.dropped&&S.independent){const Tt=this.getMainFwdBufferInfo(),Vt=(Tt?Tt.end:this.getLoadPosition())+this.config.maxBufferHole,bt=S.firstKeyFramePTS?S.firstKeyFramePTS:ht;if(!qe&&Vt<bt-this.config.maxBufferHole&&!$e){this.backtrack(y);return}else $e&&(y.gap=!0);y.setElementaryStreamInfo(S.type,y.start,mt,y.start,gt,!0)}else qe&&ht-(X.appliedTimelineOffset||0)>us&&(y.gap=!0);y.setElementaryStreamInfo(S.type,ht,mt,Nt,gt),this.backtrackFragment&&(this.backtrackFragment=y),this.bufferFragmentData(S,y,g,c,qe||$e)}else if(qe||$e)y.gap=!0;else{this.backtrack(y);return}}if(ne){const{startPTS:Ce,endPTS:qe,startDTS:$e,endDTS:ht}=ne;g&&(g.elementaryStreams[L.AUDIO]={startPTS:Ce,endPTS:qe,startDTS:$e,endDTS:ht}),y.setElementaryStreamInfo(L.AUDIO,Ce,qe,$e,ht),this.bufferFragmentData(ne,y,g,c)}if(X&&N!=null&&(i=N.samples)!=null&&i.length){const Ce={id:s,frag:y,details:X,samples:N.samples};o.trigger(E.FRAG_PARSING_METADATA,Ce)}if(X&&R){const Ce={id:s,frag:y,details:X,samples:R.samples};o.trigger(E.FRAG_PARSING_USERDATA,Ce)}}_bufferInitSegment(t,i,s,o){if(this.state!==Gt.PARSING)return;this.audioOnly=!!i.audio&&!i.video,this.altAudio&&!this.audioOnly&&delete i.audio;const{audio:l,video:c,audiovideo:p}=i;if(l){let g=vr(l.codec,t.audioCodec);g==="mp4a"&&(g="mp4a.40.5");const x=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){g&&(g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5");const S=l.metadata;S&&"channelCount"in S&&(S.channelCount||1)!==1&&x.indexOf("firefox")===-1&&(g="mp4a.40.5")}g&&g.indexOf("mp4a.40.5")!==-1&&x.indexOf("android")!==-1&&l.container!=="audio/mpeg"&&(g="mp4a.40.2",this.log(`Android: force audio codec to ${g}`)),t.audioCodec&&t.audioCodec!==g&&this.log(`Swapping manifest audio codec "${t.audioCodec}" for "${g}"`),l.levelCodec=g,l.id=$.MAIN,this.log(`Init audio buffer, container:${l.container}, codecs[selected/level/parsed]=[${g||""}/${t.audioCodec||""}/${l.codec}]`),delete i.audiovideo}if(c){c.levelCodec=t.videoCodec,c.id=$.MAIN;const g=c.codec;if((g==null?void 0:g.length)===4)switch(g){case"hvc1":case"hev1":c.codec="hvc1.1.6.L120.90";break;case"av01":c.codec="av01.0.04M.08";break;case"avc1":c.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${c.container}, codecs[level/parsed]=[${t.videoCodec||""}/${g}]${c.codec!==g?" parsed-corrected="+c.codec:""}${c.supplemental?" supplemental="+c.supplemental:""}`),delete i.audiovideo}p&&(this.log(`Init audiovideo buffer, container:${p.container}, codecs[level/parsed]=[${t.codecs}/${p.codec}]`),delete i.video,delete i.audio);const y=Object.keys(i);if(y.length){if(this.hls.trigger(E.BUFFER_CODECS,i),!this.hls)return;y.forEach(g=>{const S=i[g].initSegment;S!=null&&S.byteLength&&this.hls.trigger(E.BUFFER_APPENDING,{type:g,data:S,frag:s,part:null,chunkMeta:o,parent:s.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const t=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(t,$.MAIN)}get maxBufferLength(){const{levels:t,level:i}=this,s=t==null?void 0:t[i];return s?this.getMaxBufferLength(s.maxBitrate):this.config.maxBufferLength}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=Gt.IDLE}checkFragmentChanged(){const t=this.media;let i=null;if(t&&t.readyState>1&&t.seeking===!1){const s=t.currentTime;if(Vr.isBuffered(t,s)?i=this.getAppendedFrag(s):Vr.isBuffered(t,s+.1)&&(i=this.getAppendedFrag(s+.1)),i){this.backtrackFragment=null;const o=this.fragPlaying,l=i.level;(!o||i.sn!==o.sn||o.level!==l)&&(this.fragPlaying=i,this.hls.trigger(E.FRAG_CHANGED,{frag:i}),(!o||o.level!==l)&&this.hls.trigger(E.LEVEL_SWITCHED,{level:l}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){var t;if(this.fragPlaying)return this.fragPlaying;const i=((t=this.media)==null?void 0:t.currentTime)||this.lastCurrentTime;return pe(i)?this.getAppendedFrag(i):null}get currentProgramDateTime(){var t;const i=((t=this.media)==null?void 0:t.currentTime)||this.lastCurrentTime;if(pe(i)){const s=this.getLevelDetails(),o=this.currentFrag||(s?Er(null,s.fragments,i):null);if(o){const l=o.programDateTime;if(l!==null){const c=l+(i-o.start)*1e3;return new Date(c)}}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class vh{constructor(t){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const s in this.keyUriToKeyInfo){const o=this.keyUriToKeyInfo[s].loader;if(o){var i;if(t&&t!==((i=o.context)==null?void 0:i.frag.type))return;o.abort()}}}detach(){for(const t in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[t];(i.mediaKeySessionContext||i.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[t].loader;i&&i.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(t,i=te.KEY_LOAD_ERROR,s,o,l){return new vn({type:Le.NETWORK_ERROR,details:i,fatal:!1,frag:t,response:l,error:s,networkDetails:o})}loadClear(t,i){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:o}=t;for(let l=0;l<i.length;l++){const c=i[l];if(o<=c.cc&&(s==="initSegment"||c.sn==="initSegment"||s<c.sn)){this.emeController.selectKeySystemFormat(c).then(p=>{c.setKeyFormat(p)});break}}}}load(t){return!t.decryptdata&&t.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(t).then(i=>this.loadInternal(t,i)):this.loadInternal(t)}loadInternal(t,i){var s,o;i&&t.setKeyFormat(i);const l=t.decryptdata;if(!l){const g=new Error(i?`Expected frag.decryptdata to be defined after setting format ${i}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(t,te.KEY_LOAD_ERROR,g))}const c=l.uri;if(!c)return Promise.reject(this.createKeyLoadError(t,te.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${c}"`)));let p=this.keyUriToKeyInfo[c];if((s=p)!=null&&s.decryptdata.key)return l.key=p.decryptdata.key,Promise.resolve({frag:t,keyInfo:p});if((o=p)!=null&&o.keyLoadPromise){var y;switch((y=p.mediaKeySessionContext)==null?void 0:y.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return p.keyLoadPromise.then(g=>(l.key=g.keyInfo.decryptdata.key,{frag:t,keyInfo:p}))}}switch(p=this.keyUriToKeyInfo[c]={decryptdata:l,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},l.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return l.keyFormat==="identity"?this.loadKeyHTTP(p,t):this.loadKeyEME(p,t);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(p,t);default:return Promise.reject(this.createKeyLoadError(t,te.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${l.method}"`)))}}loadKeyEME(t,i){const s={frag:i,keyInfo:t};if(this.emeController&&this.config.emeEnabled){const o=this.emeController.loadKey(s);if(o)return(t.keyLoadPromise=o.then(l=>(t.mediaKeySessionContext=l,s))).catch(l=>{throw t.keyLoadPromise=null,l})}return Promise.resolve(s)}loadKeyHTTP(t,i){const s=this.config,o=s.loader,l=new o(s);return i.keyLoader=t.loader=l,t.keyLoadPromise=new Promise((c,p)=>{const y={keyInfo:t,frag:i,responseType:"arraybuffer",url:t.decryptdata.uri},g=s.keyLoadPolicy.default,x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(R,N,F,X)=>{const{frag:ne,keyInfo:Ce,url:qe}=F;if(!ne.decryptdata||Ce!==this.keyUriToKeyInfo[qe])return p(this.createKeyLoadError(ne,te.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),X));Ce.decryptdata.key=ne.decryptdata.key=new Uint8Array(R.data),ne.keyLoader=null,Ce.loader=null,c({frag:ne,keyInfo:Ce})},onError:(R,N,F,X)=>{this.resetLoader(N),p(this.createKeyLoadError(i,te.KEY_LOAD_ERROR,new Error(`HTTP Error ${R.code} loading key ${R.text}`),F,O({url:y.url,data:void 0},R)))},onTimeout:(R,N,F)=>{this.resetLoader(N),p(this.createKeyLoadError(i,te.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),F))},onAbort:(R,N,F)=>{this.resetLoader(N),p(this.createKeyLoadError(i,te.INTERNAL_ABORTED,new Error("key loading aborted"),F))}};l.load(y,x,S)})}resetLoader(t){const{frag:i,keyInfo:s,url:o}=t,l=s.loader;i.keyLoader===l&&(i.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[o],l&&l.destroy()}}function yh(h){const{type:t}=h;switch(t){case Me.AUDIO_TRACK:return $.AUDIO;case Me.SUBTITLE_TRACK:return $.SUBTITLE;default:return $.MAIN}}function _c(h,t){let i=h.url;return(i===void 0||i.indexOf("data:")===0)&&(i=t.url),i}class Ld{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(E.MANIFEST_LOADING,this.onManifestLoading,this),t.on(E.LEVEL_LOADING,this.onLevelLoading,this),t.on(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.on(E.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:t}=this;t.off(E.MANIFEST_LOADING,this.onManifestLoading,this),t.off(E.LEVEL_LOADING,this.onLevelLoading,this),t.off(E.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(E.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.off(E.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(t){const i=this.hls.config,s=i.pLoader,o=i.loader,l=s||o,c=new l(i);return this.loaders[t.type]=c,c}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const i=this.loaders[t];i&&i.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,i){const{url:s}=i;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Me.MANIFEST,url:s,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(t,i){const{id:s,level:o,pathwayId:l,url:c,deliveryDirectives:p,levelInfo:y}=i;this.load({id:s,level:o,pathwayId:l,responseType:"text",type:Me.LEVEL,url:c,deliveryDirectives:p,levelOrTrack:y})}onAudioTrackLoading(t,i){const{id:s,groupId:o,url:l,deliveryDirectives:c,track:p}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:Me.AUDIO_TRACK,url:l,deliveryDirectives:c,levelOrTrack:p})}onSubtitleTrackLoading(t,i){const{id:s,groupId:o,url:l,deliveryDirectives:c,track:p}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:Me.SUBTITLE_TRACK,url:l,deliveryDirectives:c,levelOrTrack:p})}onLevelsUpdated(t,i){const s=this.loaders[Me.LEVEL];if(s){const o=s.context;o&&!i.levels.some(l=>l===o.levelOrTrack)&&(s.abort(),delete this.loaders[Me.LEVEL])}}load(t){var i;const s=this.hls.config;let o=this.getInternalLoader(t);if(o){const g=this.hls.logger,x=o.context;if(x&&x.levelOrTrack===t.levelOrTrack&&(x.url===t.url||x.deliveryDirectives&&!t.deliveryDirectives)){x.url===t.url?g.log(`[playlist-loader]: ignore ${t.url} ongoing request`):g.log(`[playlist-loader]: ignore ${t.url} in favor of ${x.url}`);return}g.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),o.abort()}let l;if(t.type===Me.MANIFEST?l=s.manifestLoadPolicy.default:l=k({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),o=this.createInternalLoader(t),pe((i=t.deliveryDirectives)==null?void 0:i.part)){let g;if(t.type===Me.LEVEL&&t.level!==null?g=this.hls.levels[t.level].details:t.type===Me.AUDIO_TRACK&&t.id!==null?g=this.hls.audioTracks[t.id].details:t.type===Me.SUBTITLE_TRACK&&t.id!==null&&(g=this.hls.subtitleTracks[t.id].details),g){const x=g.partTarget,S=g.targetduration;if(x&&S){const R=Math.max(x*3,S*.8)*1e3;l=k({},l,{maxTimeToFirstByteMs:Math.min(R,l.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(R,l.maxTimeToFirstByteMs)})}}}const c=l.errorRetry||l.timeoutRetry||{},p={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:c.maxNumRetry||0,retryDelay:c.retryDelayMs||0,maxRetryDelay:c.maxRetryDelayMs||0},y={onSuccess:(g,x,S,R)=>{const N=this.getInternalLoader(S);this.resetInternalLoader(S.type);const F=g.data;if(F.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(g,S,new Error("no EXTM3U delimiter"),R||null,x);return}x.parsing.start=performance.now(),Es.isMediaPlaylist(F)||S.type!==Me.MANIFEST?this.handleTrackOrLevelPlaylist(g,x,S,R||null,N):this.handleMasterPlaylist(g,x,S,R)},onError:(g,x,S,R)=>{this.handleNetworkError(x,S,!1,g,R)},onTimeout:(g,x,S)=>{this.handleNetworkError(x,S,!0,void 0,g)}};o.load(t,p,y)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:t,startPosition:i},forceStartLoad:s}=this.hls;(t||s)&&(this.hls.logger.log(`${t?"auto":"force"} startLoad with configured startPosition ${i}`),this.hls.startLoad(i))}handleMasterPlaylist(t,i,s,o){const l=this.hls,c=t.data,p=_c(t,s),y=Es.parseMasterPlaylist(c,p);if(y.playlistParsingError){this.handleManifestParsingError(t,s,y.playlistParsingError,o,i);return}const{contentSteering:g,levels:x,sessionData:S,sessionKeys:R,startTimeOffset:N,variableList:F}=y;this.variableList=F;const{AUDIO:X=[],SUBTITLES:ne,"CLOSED-CAPTIONS":Ce}=Es.parseMasterPlaylistMedia(c,p,y);X.length&&!X.some($e=>!$e.url)&&x[0].audioCodec&&!x[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),X.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new pi({}),bitrate:0,url:""})),l.trigger(E.MANIFEST_LOADED,{levels:x,audioTracks:X,subtitles:ne,captions:Ce,contentSteering:g,url:p,stats:i,networkDetails:o,sessionData:S,sessionKeys:R,startTimeOffset:N,variableList:F})}handleTrackOrLevelPlaylist(t,i,s,o,l){const c=this.hls,{id:p,level:y,type:g}=s,x=_c(t,s),S=pe(y)?y:pe(p)?p:0,R=yh(s),N=Es.parseLevelPlaylist(t.data,x,S,R,0,this.variableList);if(g===Me.MANIFEST){const F={attrs:new pi({}),bitrate:0,details:N,name:"",url:x};N.requestScheduled=i.loading.start+tl(N,0),c.trigger(E.MANIFEST_LOADED,{levels:[F],audioTracks:[],url:x,stats:i,networkDetails:o,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}i.parsing.end=performance.now(),s.levelDetails=N,this.handlePlaylistLoaded(N,t,i,s,o,l)}handleManifestParsingError(t,i,s,o,l){this.hls.trigger(E.ERROR,{type:Le.NETWORK_ERROR,details:te.MANIFEST_PARSING_ERROR,fatal:i.type===Me.MANIFEST,url:t.url,err:s,error:s,reason:s.message,response:t,context:i,networkDetails:o,stats:l})}handleNetworkError(t,i,s=!1,o,l){let c=`A network ${s?"timeout":"error"+(o?" (status "+o.code+")":"")} occurred while loading ${t.type}`;t.type===Me.LEVEL?c+=`: ${t.level} id: ${t.id}`:(t.type===Me.AUDIO_TRACK||t.type===Me.SUBTITLE_TRACK)&&(c+=` id: ${t.id} group-id: "${t.groupId}"`);const p=new Error(c);this.hls.logger.warn(`[playlist-loader]: ${c}`);let y=te.UNKNOWN,g=!1;const x=this.getInternalLoader(t);switch(t.type){case Me.MANIFEST:y=s?te.MANIFEST_LOAD_TIMEOUT:te.MANIFEST_LOAD_ERROR,g=!0;break;case Me.LEVEL:y=s?te.LEVEL_LOAD_TIMEOUT:te.LEVEL_LOAD_ERROR,g=!1;break;case Me.AUDIO_TRACK:y=s?te.AUDIO_TRACK_LOAD_TIMEOUT:te.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case Me.SUBTITLE_TRACK:y=s?te.SUBTITLE_TRACK_LOAD_TIMEOUT:te.SUBTITLE_LOAD_ERROR,g=!1;break}x&&this.resetInternalLoader(t.type);const S={type:Le.NETWORK_ERROR,details:y,fatal:g,url:t.url,loader:x,context:t,error:p,networkDetails:i,stats:l};if(o){const R=(i==null?void 0:i.url)||t.url;S.response=O({url:R,data:void 0},o)}this.hls.trigger(E.ERROR,S)}handlePlaylistLoaded(t,i,s,o,l,c){const p=this.hls,{type:y,level:g,id:x,groupId:S,deliveryDirectives:R}=o,N=_c(i,o),F=yh(o),X=typeof o.level=="number"&&F===$.MAIN?g:void 0;if(!t.fragments.length){const Ce=t.playlistParsingError=new Error("No Segments found in Playlist");p.trigger(E.ERROR,{type:Le.NETWORK_ERROR,details:te.LEVEL_EMPTY_ERROR,fatal:!1,url:N,error:Ce,reason:Ce.message,response:i,context:o,level:X,parent:F,networkDetails:l,stats:s});return}t.targetduration||(t.playlistParsingError=new Error("Missing Target Duration"));const ne=t.playlistParsingError;if(ne){if(this.hls.logger.warn(ne),!p.config.ignorePlaylistParsingErrors){p.trigger(E.ERROR,{type:Le.NETWORK_ERROR,details:te.LEVEL_PARSING_ERROR,fatal:!1,url:N,error:ne,reason:ne.message,response:i,context:o,level:X,parent:F,networkDetails:l,stats:s});return}t.playlistParsingError=null}switch(t.live&&c&&(c.getCacheAge&&(t.ageHeader=c.getCacheAge()||0),(!c.getCacheAge||isNaN(t.ageHeader))&&(t.ageHeader=0)),y){case Me.MANIFEST:case Me.LEVEL:p.trigger(E.LEVEL_LOADED,{details:t,levelInfo:o.levelOrTrack||p.levels[0],level:X||0,id:x||0,stats:s,networkDetails:l,deliveryDirectives:R,withoutMultiVariant:y===Me.MANIFEST});break;case Me.AUDIO_TRACK:p.trigger(E.AUDIO_TRACK_LOADED,{details:t,track:o.levelOrTrack,id:x||0,groupId:S||"",stats:s,networkDetails:l,deliveryDirectives:R});break;case Me.SUBTITLE_TRACK:p.trigger(E.SUBTITLE_TRACK_LOADED,{details:t,track:o.levelOrTrack,id:x||0,groupId:S||"",stats:s,networkDetails:l,deliveryDirectives:R});break}}}class zo{static get version(){return so}static isMSESupported(){return No()}static isSupported(){return $o()}static getMediaSource(){return Ye()}static get Events(){return E}static get MetadataSchema(){return Fs}static get ErrorTypes(){return Le}static get ErrorDetails(){return te}static get DefaultConfig(){return zo.defaultConfig?zo.defaultConfig:D0}static set DefaultConfig(t){zo.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new il,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const i=this.logger=De(t.debug||!1,"Hls instance",t.assetPlayerId),s=this.config=kd(zo.DefaultConfig,t,i);this.userConfig=t,s.progressive&&nu(s,i);const{abrController:o,bufferController:l,capLevelController:c,errorController:p,fpsController:y}=s,g=new p(this),x=this.abrController=new o(this),S=new nn(this),R=s.interstitialsController,N=R?this.interstitialsController=new R(this,zo):null,F=this.bufferController=new l(this,S),X=this.capLevelController=new c(this),ne=new y(this),Ce=new Ld(this),qe=s.contentSteeringController,$e=qe?new qe(this):null,ht=this.levelController=new Vu(this,$e),mt=new Cd(this),Nt=new vh(this.config),gt=this.streamController=new bc(this,S,Nt),Tt=this.gapController=new Aa(this,S);X.setStreamController(gt),ne.setStreamController(gt);const Vt=[Ce,ht,gt];N&&Vt.splice(1,0,N),$e&&Vt.splice(1,0,$e),this.networkControllers=Vt;const bt=[x,F,Tt,X,ne,mt,S];this.audioTrackController=this.createController(s.audioTrackController,Vt);const dr=s.audioStreamController;dr&&Vt.push(this.audioStreamController=new dr(this,S,Nt)),this.subtitleTrackController=this.createController(s.subtitleTrackController,Vt);const Ir=s.subtitleStreamController;Ir&&Vt.push(this.subtititleStreamController=new Ir(this,S,Nt)),this.createController(s.timelineController,bt),Nt.emeController=this.emeController=this.createController(s.emeController,bt),this.cmcdController=this.createController(s.cmcdController,bt),this.latencyController=this.createController(Dd,bt),this.coreComponents=bt,Vt.push(g);const Ei=g.onErrorOut;typeof Ei=="function"&&this.on(E.ERROR,Ei,g),this.on(E.MANIFEST_LOADED,Ce.onManifestLoaded,Ce)}createController(t,i){if(t){const s=new t(this);return i&&i.push(s),s}return null}on(t,i,s=this){this._emitter.on(t,i,s)}once(t,i,s=this){this._emitter.once(t,i,s)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,i,s=this,o){this._emitter.off(t,i,s,o)}listeners(t){return this._emitter.listeners(t)}emit(t,i,s){return this._emitter.emit(t,i,s)}trigger(t,i){if(this.config.debug)return this.emit(t,t,i);try{return this.emit(t,t,i)}catch(s){if(this.logger.error("An internal error happened while handling event "+t+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const o=t===E.ERROR;this.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.INTERNAL_EXCEPTION,fatal:o,event:t,error:s}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){this.logger.log("destroy"),this.trigger(E.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(i=>i.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(i=>i.destroy()),this.coreComponents.length=0;const t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){if(!t||"media"in t&&!t.media){const l=new Error(`attachMedia failed: invalid argument (${t})`);this.trigger(E.ERROR,{type:Le.OTHER_ERROR,details:te.ATTACH_MEDIA_ERROR,fatal:!0,error:l});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const i="media"in t,s=i?t.media:t,o=i?t:{media:s};this._media=s,this.trigger(E.MEDIA_ATTACHING,o)}detachMedia(){this.logger.log("detachMedia"),this.trigger(E.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const t=this.bufferController.transferMedia();return this.trigger(E.MEDIA_DETACHING,{transferMedia:t}),t}loadSource(t){this.stopLoad();const i=this.media,s=this._url,o=this._url=we.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${o}`),i&&s&&(s!==o||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(i)),this.trigger(E.MANIFEST_LOADING,{url:t})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(t=-1,i){this.logger.log(`startLoad(${t+(i?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let s=0;s<this.networkControllers.length&&(this.networkControllers[s].startLoad(t,i),!(!this.started||!this.networkControllers));s++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].stopLoad(),!(this.started||!this.networkControllers));t++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(t=>{t.resumeBuffering&&t.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(t=>{t.pauseBuffering&&t.pauseBuffering()}))}get inFlightFragments(){const t={[$.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[$.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[$.SUBTITLE]=this.subtititleStreamController.inFlightFrag),t}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const t=this._media,i=t==null?void 0:t.currentTime;this.detachMedia(),t&&(this.attachMedia(t),i&&this.startLoad(i))}removeLevel(t){this.levelController.removeLevel(t)}get sessionId(){let t=this._sessionId;return t||(t=this._sessionId=wu()),t}get levels(){const t=this.levelController.levels;return t||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){this.logger.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){this.logger.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){this.logger.log(`set loadLevel:${t}`),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){this.logger.log(`set firstLevel:${t}`),this.levelController.firstLevel=t}get startLevel(){const t=this.levelController.startLevel;return t===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:t}set startLevel(t){this.logger.log(`set startLevel:${t}`),t!==-1&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const i=!!t;i!==this.config.capLevelToPlayerSize&&(i?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=i)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}set bandwidthEstimate(t){this.abrController.resetEstimator(t)}get abrEwmaDefaultEstimate(){const{bwEstimator:t}=this.abrController;return t?t.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(this.logger.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){or(t)&&this._maxHdcpLevel!==t&&(this._maxHdcpLevel=t,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:i}}=this;if(!t)return 0;const s=t.length;for(let o=0;o<s;o++)if(t[o].maxBitrate>=i)return o;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:i,maxHdcpLevel:s}=this;let o;if(i===-1&&t!=null&&t.length?o=t.length-1:o=i,s)for(let l=o;l--;){const c=t[l].attrs["HDCP-LEVEL"];if(c&&c<=s)return l}return o}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(t){this.abrController.nextAutoLevel=t}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(t){var i;return((i=this.audioTrackController)==null?void 0:i.setAudioOption(t))||null}setSubtitleOption(t){var i;return((i=this.subtitleTrackController)==null?void 0:i.setSubtitleOption(t))||null}get allAudioTracks(){const t=this.audioTrackController;return t?t.allAudioTracks:[]}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const i=this.audioTrackController;i&&(i.audioTrack=t)}get allSubtitleTracks(){const t=this.subtitleTrackController;return t?t.allSubtitleTracks:[]}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const i=this.subtitleTrackController;i&&(i.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return t?t.subtitleDisplay:!1}set subtitleDisplay(t){const i=this.subtitleTrackController;i&&(i.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(t){this.latencyController.targetLatency=t}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(t){this.levelController.pathwayPriority=t}get bufferedToEnd(){var t;return!!((t=this.bufferController)!=null&&t.bufferedToEnd)}get interstitialsManager(){var t;return((t=this.interstitialsController)==null?void 0:t.interstitialsManager)||null}getMediaDecodingInfo(t,i=this.allAudioTracks){const s=Or(i);return ct(t,s,navigator.mediaCapabilities)}}zo.defaultConfig=void 0},48136:function(Fr,Rt,J){"use strict";var pe=Object.defineProperty,Pe=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,Me=(e,r,n)=>r in e?pe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,$=(e,r)=>{for(var n in r||(r={}))te.call(r,n)&&Me(e,n,r[n]);if(Le)for(var n of Le(r))E.call(r,n)&&Me(e,n,r[n]);return e},d=(e,r)=>Pe(e,rt(r)),be=e=>typeof e=="symbol"?e:e+"",j=(e,r)=>{var n={};for(var a in e)te.call(e,a)&&r.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&Le)for(var a of Le(e))r.indexOf(a)<0&&E.call(e,a)&&(n[a]=e[a]);return n};function k(e){return Array.isArray(e)}var M={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function O(){return"window"in globalThis&&"document"in globalThis}function K(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function se(){return typeof navigator.vibrate=="function"}function ae(){var e,r;if(!O())return"other";const n=(r=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?r:navigator.platform;return/^mac/i.test(n)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(n)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function Z(){if(!O())return!0;if(/firefox/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/firefox\/(\d+)/i);return e?parseInt(e[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/edg\/(\d+)/i);return e?parseInt(e[1])>=79:!1}return!0}function q(){return HTMLElement.prototype.hasOwnProperty("popover")}var Y={strings:M,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return Y._locale||(Y._locale=O()?navigator.language.slice(0,5):"en-US"),Y._locale},set locale(e){Y._locale=e,Y._numberFormatter=void 0,Y.dirty=!0},get numberFormatter(){return Y._numberFormatter||(Y._numberFormatter=new Intl.NumberFormat(Y.locale)),Y._numberFormatter},merge(e,r){if(typeof e=="string"&&r)Y.strings[e]=$($({},Y.strings[e]),r),Y.dirty=!0;else for(const n of Object.keys(e))Y.merge(n,e[n])},get dirty(){return Y._dirty},set dirty(e){Y._dirty||Y._dirty===e||(Y._dirty=!0,setTimeout(()=>{Y._dirty=!1,this._subscribers.forEach(r=>r==null?void 0:r())},0))},subscribe(e){return Y._subscribers.push(e),Y._subscribers.length-1},unsubscribe(e){e<0||e>=Y._subscribers.length||(Y._subscribers[e]=void 0)},update(e){let r=e.querySelectorAll("[data-l10n-tooltip]");for(const n of r){const a=n.getAttribute("data-l10n-tooltip");if(a){const u=ue(a);u&&n.setAttribute("data-tooltip",u)}}r=e.querySelectorAll("[data-l10n-arial-label]");for(const n of r){const a=n.getAttribute("data-l10n-arial-label");if(a){const u=ue(a);u&&n.setAttribute("aria-label",u)}}}};function ue(e,...r){if(e===void 0)return;let n="";const a=Y.locale;Y.strings[a]&&(n=Y.strings[a][e]);const u=a.slice(0,2);if(!n&&Y.strings[u]&&(n=Y.strings[u][e]),n||(n=Y.strings.en[e]),!n)return;const f=/(%@|%([0-9]+)\$@)/g;let v=f.exec(n),A=0;for(;v;){if(r[A++]){const P=v[2]?parseInt(v[2],10)-1:A-1;let z=r[P];typeof z=="number"&&(z=Y.numberFormatter.format(z)),n=n.replace(v[1],z)}v=f.exec(n)}return n=n.replace(/%%/g,"%"),n}var ee={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},oe={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},De={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},ve={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},Ye={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},We={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function ut(e){var r,n,a,u,f,v;const A=e.split("!");let C,P,z,Q=255,_e=255,Ie=255,ze=-1;const St=A.length>0&&A[0].startsWith("-");St&&(A[0]=A[0].slice(1));for(let sr=0;sr<A.length;sr++){C=Q,P=_e,z=Ie;const xt=(r=A[sr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:r[1],Wt=xt==null?void 0:xt.toLowerCase(),hr=xt&&(v=(f=(u=(a=(n=ve[Wt])!=null?n:ve[Ye[xt]])!=null?a:oe[xt])!=null?u:We[xt])!=null?f:ee[xt])!=null?v:A[sr].trim();let Zt=hr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Zt!=null&&Zt[1]&&Zt[2]&&Zt[3])Q=Math.max(0,Math.min(255,Number.parseInt(Zt[1],16))),_e=Math.max(0,Math.min(255,Number.parseInt(Zt[2],16))),Ie=Math.max(0,Math.min(255,Number.parseInt(Zt[3],16)));else if(Zt=hr.match(/^#([\da-f]{3})$/i),Zt!=null&&Zt[1]){const Nr=Number.parseInt(Zt[1][0],16),Qr=Number.parseInt(Zt[1][1],16),Wr=Number.parseInt(Zt[1][2],16);Q=Math.max(0,Math.min(255,Nr*16+Nr)),_e=Math.max(0,Math.min(255,Qr*16+Qr)),Ie=Math.max(0,Math.min(255,Wr*16+Wr))}else if(Zt=hr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),Zt!=null&&Zt[1]&&Zt[2]&&Zt[3])Q=Math.max(0,Math.min(255,Number.parseInt(Zt[1]))),_e=Math.max(0,Math.min(255,Number.parseInt(Zt[2]))),Ie=Math.max(0,Math.min(255,Number.parseInt(Zt[3])));else return;ze>=0&&(Q=(1-ze)*Q+ze*C,_e=(1-ze)*_e+ze*P,Ie=(1-ze)*Ie+ze*z,ze=-1),sr+1<A.length&&(ze=Math.max(0,Math.min(100,Number.parseInt(A[++sr])))/100)}return ze>=0&&(Q=ze*Q+(1-ze)*C,_e=ze*_e+(1-ze)*P,Ie=ze*Ie+(1-ze)*z),St&&(Q=255-Q,_e=255-_e,Ie=255-Ie),"#"+("00"+Math.round(Q).toString(16)).slice(-2)+("00"+Math.round(_e).toString(16)).slice(-2)+("00"+Math.round(Ie).toString(16)).slice(-2)}function pt(e){var r,n;return e=e.trim(),(n=(r=De[e.toLowerCase()])!=null?r:De[Ye[e]])!=null?n:ut(e)}function de(e){if(!e||e[0]!=="#")return;e=e.slice(1);let r;return e.length<=4?(r={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(r.a=parseInt(e[3]+e[3],16)/255)):(r={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(r.a=parseInt(e[6]+e[7],16)/255)),r&&r.a===void 0&&(r.a=1),r}function re(e,r,n){return n<0&&(n+=6),n>=6&&(n-=6),n<1?(r-e)*n+e:n<3?r:n<4?(r-e)*(4-n)+e:e}function ce(e){let[r,n,a]=[e.h,e.s,e.l];r=(r+360)%360/60,a=Math.max(0,Math.min(a,1)),n=Math.max(0,Math.min(n,1));const u=a<=.5?a*(n+1):a+n-a*n,f=a*2-u;return{r:Math.round(255*re(f,u,r+2)),g:Math.round(255*re(f,u,r)),b:Math.round(255*re(f,u,r-2))}}function he(e){return e<0?0:e>255?255:Math.round(e)}function Re(e){const{r,g:n,b:a}=e;let u=((1<<24)+(he(r)<<16)+(he(n)<<8)+he(a)).toString(16).slice(1);return u[0]===u[1]&&u[2]===u[3]&&u[4]===u[5]&&u[6]===u[7]&&(u=u[0]+u[2]+u[4]),"#"+u}function we(e){let{r,g:n,b:a}=e;r=r/255,n=n/255,a=a/255;const u=Math.min(r,n,a),f=Math.max(r,n,a),v=f-u;let A,C;f===u?A=0:r===f?A=(n-a)/v:n===f?A=2+(a-r)/v:a===f&&(A=4+(r-n)/v),A=Math.min(A*60,360),A<0&&(A+=360);const P=(u+f)/2;return f===u?C=0:P<=.5?C=v/(f+u):C=v/(2-f-u),{h:A,s:C,l:P}}function D(e){let r=de(e);if(!r)return e;let{h:n,s:a,l:u}=we(r);return a+=.1,u-=.1,Re(ce({h:n,s:a,l:u}))}var L={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},ie={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},xe=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function at(e,r,n){if(!/[A-Za-z\d]/.test(e)||(n==="up"&&(n=void 0),!r&&!n))return e;const a=e.codePointAt(0);if(a===void 0)return e;for(const u of xe)if((!r||u.variant===r)&&(!n||u.style===n)&&a>=u.offset&&a<u.offset+u.len){const f=u.start+a-u.offset;return String.fromCodePoint(ie[f]||f)}return e}function ot(e){var r;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const n in ie)if(ie[n]===e){e=(r=n.codePointAt(0))!=null?r:0;break}for(const n of xe)if(e>=n.start&&e<n.start+n.len)return{char:String.fromCodePoint(e-n.start+n.offset),variant:n.variant,style:n.style};return{char:String.fromCodePoint(e)}}function At(e){var r;let n="";for(const a of e){if("{}<>[]$&#^_%:'\u02DC".includes(a)){n+=a;continue}const u=(r=a.codePointAt(0))!=null?r:0;let f=L[u];if(f)f.startsWith("\\")?n+=f+" ":n+=f;else{const{char:v,variant:A,style:C}=ot(u);switch(f=v,A){case"double-struck":f=`\\mathbb{${f}}`;break;case"fraktur":f=`\\mathfrak{${f}}`;break;case"script":f=`\\mathscr{${f}}`;break;case"sans-serif":f=`\\mathsf{${f}}`;break;case"monospace":f=`\\mathtt{${f}}`;break;case"calligraphic":f=`\\mathcal{${f}}`;break}switch(C){case"bold":f=`\\mathbf{${f}}`;break;case"italic":f=`\\mathit{${f}}`;break;case"bolditalic":f=`\\mathbfit{${f}}`;break}n+=f}}return n}function Xe(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var ar={},jt=$({},L),Ot={},kr={},$r={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},ir={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},zr={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},li={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:zr},"amsmath.sty":{package:ir,primitive:!0},"texvc.sty":{package:$r,primitive:!1}},Gr={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},Ze=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,nt,Qe;Z()?(nt=new RegExp("\\p{Letter}","u"),Qe=new RegExp("[0-9\\p{Letter}]","u")):(nt=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,Qe=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function Ct(e,r,n="mord",a){r!==void 0&&(ar[e]={definitionType:"symbol",type:n,variant:a,codepoint:r},jt[r]||(jt[r]=e))}function Dt(e,r,n){if(typeof e=="string"){for(let a=0;a<e.length;a++){const u=e.charAt(a);Ct(u,u.codePointAt(0))}return}for(const[a,u,f,v]of e)Ct(a,u,f!=null?f:r,v!=null?v:n)}function ye(e,r){for(let n=e;n<=r;n++)Ct(String.fromCodePoint(n),n)}function Oe(e){var r;return(r=kr[e])!=null?r:null}function et(e,r){var n,a;if(r.length===0||r==="\\"||!r.startsWith("\\"))return[];const u=[];for(const v in Ot)v.startsWith(r)&&!Ot[v].infix&&u.push({match:v,frequency:(n=Ot[v].frequency)!=null?n:0});for(const v in ar)v.startsWith(r)&&u.push({match:v,frequency:(a=ar[v].frequency)!=null?a:0});const f=r.substring(1);for(const v of Object.keys(e.options.macros))v.startsWith(f)&&u.push({match:"\\"+v,frequency:0});return u.sort((v,A)=>{var C,P;return v.frequency===A.frequency?v.match.length===A.match.length?v.match<A.match?-1:1:v.match.length-A.match.length:((C=A.frequency)!=null?C:0)-((P=v.frequency)!=null?P:0)}),u.map(v=>v.match)}function vt(e){let r="auto";const n=e.match(/:([^=]+)/);return n&&(r=n[1].trim()),r}function wt(e){if(!e)return[];const r=[];let n=e.split("]");if(n[0].startsWith("[")){r.push({isOptional:!0,type:vt(n[0].slice(1))});for(let a=1;a<=n.length;a++)r.push(...wt(n[a]))}else if(n=e.split("}"),n[0].startsWith("{")){r.push({isOptional:!1,type:vt(n[0].slice(1))});for(let a=1;a<=n.length;a++)r.push(...wt(n[a]))}return r}function Ht(e){if(!e)return"";let r="",n=!0;for(const a of e)typeof a.value=="string"?r+=a.value:n=!1;return n?r:""}function fr(e,r){typeof e=="string"&&(e=[e]);const n={tabular:!1,params:[],createAtom:r};for(const a of e)kr[a]=n}function Xt(e,r,n){typeof e=="string"&&(e=[e]);const u={tabular:!0,params:wt(r),createAtom:n};for(const f of e)kr[f]=u}function Ue(e,r,n){var a,u;n||(n={});const f={definitionType:"function",params:wt(r),ifMode:n.ifMode,isFunction:(a=n.isFunction)!=null?a:!1,applyMode:n.applyMode,infix:(u=n.infix)!=null?u:!1,parse:n.parse,createAtom:n.createAtom,applyStyle:n.applyStyle,serialize:n.serialize,render:n.render};if(typeof e=="string")Ot["\\"+e]=f;else for(const v of e)Ot["\\"+v]=f}var Ut;function _r(e){return Ut||(Ut=Ge(li)),e?Ge($($({},Ut),e)):Ut}function Fe(e,r){var n,a,u,f;if(typeof e=="string"){let v=0;const A=e;return/(^|[^\\])#1/.test(A)&&(v=1),/(^|[^\\])#2/.test(A)&&(v=2),/(^|[^\\])#3/.test(A)&&(v=3),/(^|[^\\])#4/.test(A)&&(v=4),/(^|[^\\])#5/.test(A)&&(v=5),/(^|[^\\])#6/.test(A)&&(v=6),/(^|[^\\])#7/.test(A)&&(v=7),/(^|[^\\])#8/.test(A)&&(v=8),/(^|[^\\])#9/.test(A)&&(v=9),{expand:(n=r==null?void 0:r.expand)!=null?n:!0,captureSelection:(a=r==null?void 0:r.captureSelection)!=null?a:!0,args:v,def:A}}return $({expand:(u=r==null?void 0:r.expand)!=null?u:!0,captureSelection:(f=r==null?void 0:r.captureSelection)!=null?f:!0,args:0},e)}function Ge(e){if(!e)return{};const r={};for(const n of Object.keys(e)){const a=e[n];if(a==null)delete r[n];else if(typeof a=="object"&&"package"in a)for(const u of Object.keys(a.package))r[u]=Fe(a.package[u],{expand:!a.primitive,captureSelection:a.captureSelection});else r[n]=Fe(a)}return r}function it(e,r="math"){if(!e||e.length===0)return null;let n=null;if(e.startsWith("\\")){if(n=Ot[e],n)return!n.ifMode||n.ifMode===r?n:null;r==="math"?n=ar[e]:Gr[e]&&(n={definitionType:"symbol",type:"mord",codepoint:Gr[e]})}else if(r==="math"){if(n=ar[e],!n&&e.length===1){const a=kt("math",e.codePointAt(0));return a.startsWith("\\")?d($({},it(a,"math")),{command:a}):null}}else Gr[e]?n={definitionType:"symbol",type:"mord",codepoint:Gr[e]}:r==="text"&&(n={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return n!=null?n:null}function Pt(e,r){if(!e.startsWith("\\"))return null;const n=e.slice(1);return r[n]}function kt(e,r){if(r===void 0)return"";if(e==="math"&&jt[r])return jt[r];if(e==="text"){const n=Object.keys(Gr).find(a=>Gr[a]===r);return n||String.fromCodePoint(r)}return String.fromCodePoint(r)}var zt=[0,.68889,0,0,.72222],rr=[0,.68889,0,0,.66667],T=[0,.68889,0,0,.77778],B=[0,.68889,0,0,.61111],dt=[.16667,.68889,0,0,.77778],G=[0,.68889,0,0,.55556],fe=[0,0,0,0,.25],xr=[0,.825,0,0,2.33334],Ne=[0,.9,0,0,2.33334],He=[0,.68889,0,0,.54028],Je=[-.03598,.46402,0,0,.5],W=[-.13313,.36687,0,0,1],ge=[.01354,.52239,0,0,1],Se=[.01354,.52239,0,0,1.11111],Ke=[0,.54986,0,0,1],V=[0,.69224,0,0,.5],qt=[0,.43056,0,0,1],Ae=[.08198,.58198,0,0,.77778],Yt=[.19444,.69224,0,0,.41667],vr=[.1808,.675,0,0,1],ei=[.19444,.69224,0,0,.83334],Ri=[.13667,.63667,0,0,1],ui=[-.064,.437,0,0,1.334],wr=[.08167,.58167,0,0,.77778],bi=[0,.69224,0,0,.72222],me=[0,.69224,0,0,.66667],Te=[-.13313,.36687,0,0,.77778],Mt=[.06062,.54986,0,0,.77778],ct=[0,.69224,0,0,.77778],Et=[.25583,.75583,0,0,.77778],Ft=[.25142,.75726,0,0,.77778],or=[.20576,.70576,0,0,.77778],Jt=[.30274,.79383,0,0,.77778],Rr=[.22958,.72958,0,0,.77778],Sr=[.1808,.675,0,0,.77778],oi=[.13667,.63667,0,0,.77778],Dr=[.13597,.63597,0,0,.77778],Br=[.03517,.54986,0,0,.77778],ni=[0,.675,0,0,.77778],_i=[.19444,.69224,0,0,.61111],Ni=[0,.54986,0,0,.76042],mi=[0,.54986,0,0,.66667],Ur=[.0391,.5391,0,0,.77778],Gi=[.03517,.54986,0,0,1.33334],Yr=[.38569,.88569,0,0,.77778],Or=[.23222,.74111,0,0,.77778],lt=[.19444,.69224,0,0,.77778],tt=[0,.37788,0,0,.5],_t=[0,.54986,0,0,.72222],Lt=[0,.69224,0,0,.83334],ft=[.11111,.69224,0,0,.66667],Kt=[.26167,.75726,0,0,.77778],Bt=[.48256,.98256,0,0,.77778],lr=[.28481,.79383,0,0,.77778],Tr=[.08167,.58167,0,0,.22222],pr=[.08167,.58167,0,0,.38889],si=[0,.43056,.04028,0,.66667],ci=[.41951,.91951,0,0,.77778],gi=[.24982,.74947,0,0,.38865],Er=[.08319,.58283,0,0,.75623],Mr=[0,.10803,0,0,.27764],Si=[0,.47534,0,0,.50181],Ai=[.18906,.47534,0,0,.50181],Xr=[0,.69141,0,0,.50181],ri=[.24982,.74947,0,0,.27764],ii=[0,.69141,0,0,.21471],ai=[.25,.75,0,0,.44722],Kr=[0,.64444,0,0,.575],fi=[.08556,.58556,0,0,.89444],Pi=[0,.69444,0,0,.89444],Di=[0,.68611,0,0,.9],Ar=[0,.68611,0,0,.86944],je=[.25,.75,0,0,.575],cr=[.25,.75,0,0,.31944],yr=[0,.69444,0,0,.63889],jr=[0,.69444,0,0,.31944],nn=[0,.44444,0,0,.63889],vi=[0,.44444,0,0,.51111],$i=[0,.69444,0,0,.575],Hr=[.13333,.63333,0,0,.89444],pn=[0,.44444,0,0,.31944],_n=[0,.69444,0,0,.86944],Vi=[0,.68611,0,0,.69166],ts=[0,.68611,0,0,.83055],Yn=[0,.68611,0,0,.89444],$n=[0,.69444,0,0,.60278],Gn=[.19444,.69444,0,0,.51111],Pr=[0,.69444,0,0,.83055],ki=[-.10889,.39111,0,0,1.14999],Ki=[.19444,.69444,0,0,.575],Wi=[.19444,.69444,0,0,1.14999],Vn=[.19444,.69444,0,0,.70277],vn=[.05556,.75,0,0,.575],tn=[0,.68611,0,0,.95833],In=[.08556,.58556,0,0,.76666],zi=[-.02639,.47361,0,0,.575],rs=[0,.44444,0,0,.89444],Vr=[0,.55556,0,0,.76666],ss=[-.10889,.39111,0,0,.89444],Xn=[.00222,.50222,0,0,.89444],xn=[.19667,.69667,0,0,.89444],Ii=[.08556,.58556,0,0,1.14999],vs=[0,.69444,0,0,.70277],_s=[-.02778,.47222,0,0,.575],ds=[.25,.75,0,0,.51111],pi=[-.13889,.36111,0,0,1.14999],xs=[.19444,.69444,0,0,1.02222],ws=[.12963,.69444,0,0,.89444],nr=[.19444,.69444,0,0,.44722],mn=[0,.64444,.13167,0,.59111],Ss=[.19444,.64444,.13167,0,.59111],fs=[0,.68611,.17208,0,.8961],un=[.19444,.44444,.105,0,.53222],cn=[0,.44444,.085,0,.82666],Fi=[0,.69444,.06709,0,.59111],rn=[0,.69444,.12945,0,.35555],zn=[0,.69444,0,0,.94888],Wn=[0,.69444,.11472,0,.59111],Pn=[0,.68611,.10778,0,.88555],An=[0,.69444,.07939,0,.62055],Oi=[0,.69444,.12417,0,.30667],xi=[0,.64444,.13556,0,.51111],Mi=[.19444,.64444,.13556,0,.51111],sn=[0,.68333,.16389,0,.74333],kn=[.19444,.43056,.08847,0,.46],Jn=[0,.43056,.07514,0,.71555],Lr=[0,.69444,.06646,0,.51111],Jr=[0,.69444,0,0,.83129],yn=[0,.69444,.1225,0,.51111],Ln=[0,.68333,.09403,0,.76666],Ji=[0,.68333,.11111,0,.76666],Is=[0,.69444,.06961,0,.51444],as=[0,.69444,0,0,.27778],Hs=[.25,.75,0,0,.38889],Un=[0,.64444,0,0,.5],Ys=[0,.69444,0,0,.77778],ya=[0,.68333,0,0,.75],ba=[0,.68333,0,0,.77778],eo=[0,.68333,0,0,.68056],Es=[0,.68333,0,0,.72222],is=[.25,.75,0,0,.5],As=[.25,.75,0,0,.27778],On=[0,.69444,0,0,.5],Xs=[0,.69444,0,0,.55556],Fa=[0,.43056,0,0,.44445],sa=[0,.43056,0,0,.5],Il=[.19444,.43056,0,0,.55556],Na=[0,.43056,0,0,.55556],Ps=[.08333,.58333,0,0,.77778],bo=[0,.43056,0,0,.27778],Os=[0,.66786,0,0,.27778],Qo=[0,.69444,0,0,.75],to=[0,.66786,0,0,.5],Ca=[0,.68333,0,0,.625],$a=[.19444,.69444,0,0,.44445],ro=[0,.69444,0,0,.72222],el=[.19444,.69444,0,0,.5],za=[.19444,.69444,0,0,1],_o=[.011,.511,0,0,1.126],ks=[.19444,.69444,0,0,.61111],Ua=[.05556,.75,0,0,.5],tl=[0,.68333,0,0,.83334],io=[.0391,.5391,0,0,.66667],Ka=[-.05555,.44445,0,0,.5],no=[0,.43056,0,0,.77778],Js=[0,.55556,0,0,.66667],aa=[-.03625,.46375,0,0,.77778],oa=[-.01688,.48312,0,0,.77778],xo=[.0391,.5391,0,0,1],Hi=[0,.69444,0,0,.61111],Qi=[-.03472,.46528,0,0,.5],ji=[.25,.75,0,0,.44445],ps=[-.14236,.35764,0,0,1],Bn=[.244,.744,0,0,.412],Gt=[.19444,.69444,0,0,.88889],_a=[.12963,.69444,0,0,.77778],wo=[.19444,.69444,0,0,.38889],So=[.011,.511,0,0,1.638],Eo=[.19444,.69444,0,0,0],Gs=[0,.44444,0,0,.575],Qs=[.19444,.44444,0,0,.575],rl=[0,.68611,0,0,.75555],fu=[0,.69444,0,0,.66759],il=[0,.68611,0,0,.80555],so=[0,.68611,.08229,0,.98229],Da=[0,.68611,0,0,.76666],Pl=[0,.44444,0,0,.58472],pu=[.19444,.44444,0,0,.6118],Ao=[.19444,.43056,0,0,.5],mu=[0,.68333,.02778,.08334,.76278],gu=[0,.68333,.08125,.05556,.83125],ko=[0,.43056,0,.05556,.48472],To=[.19444,.43056,0,.08334,.51702],ao=[.25,.75,0,0,.42778],ys=[0,.69444,0,0,.55],Bs=[0,.69444,0,0,.73334],Vs=[0,.69444,0,0,.79445],Ol=[0,.69444,0,0,.51945],vu=[0,.69444,0,0,.70278],Co=[0,.69444,0,0,.76389],n0=[.25,.75,0,0,.34306],Bl=[0,.69444,0,0,.56111],Fl=[0,.69444,0,0,.25556],yu=[.19444,.45833,0,0,.56111],bu=[0,.45833,0,0,.56111],nl=[0,.69444,0,0,.30556],_u=[0,.69444,0,0,.58056],Nl=[0,.69444,0,0,.67223],sl=[0,.69444,0,0,.85556],$l=[0,.69444,0,0,.55834],la=[0,.65556,.11156,0,.5],al=[0,.69444,.08094,0,.70834],xu=[.17014,0,0,0,.44445],wu=[0,.69444,.0799,0,.5],Su=[0,.69444,0,0,.73752],zl=[0,.69444,.09205,0,.5],Do=[0,.69444,.09031,0,.77778],ol=[0,.69444,.07816,0,.27778],Eu=[0,.69444,.00316,0,.5],s0=[.19444,.69444,0,0,.83334],a0=[.05556,.75,0,0,.83334],o0=[0,.75,0,0,.5],oo=[.125,.08333,0,0,.27778],l0=[0,.08333,0,0,.27778],ua=[0,.65556,0,0,.5],ll=[0,.69444,0,0,.47222],Ma=[0,.69444,0,0,.66667],ul=[0,.69444,0,0,.59722],Fs=[0,.69444,0,0,.54167],ke=[0,.69444,0,0,.70834],cl=[.25,.75,0,0,.28889],hl=[0,.69444,0,0,.51667],lo=[0,.44444,0,0,.44445],Au=[.19444,.44444,0,0,.51667],Ul=[0,.44444,0,0,.38333],ku=[0,.44444,0,0,.51667],Tu=[0,.69444,0,0,.83334],Cu=[.35001,.85,0,0,.45834],Kl=[.35001,.85,0,0,.57778],dl=[.35001,.85,0,0,.41667],Mo=[.35001,.85,0,0,.58334],Hl=[0,.72222,0,0,.55556],fl=[1e-5,.6,0,0,.66667],Du=[1e-5,.6,0,0,.77778],Mu=[.25001,.75,0,0,.94445],u0=[.306,.805,.19445,0,.47222],Gl=[.30612,.805,.19445,0,.47222],Ha=[.25001,.75,0,0,.83334],Lo=[.35001,.85,0,0,.47222],Lu=[.25001,.75,0,0,1.11111],c0=[.65002,1.15,0,0,.59722],H=[.65002,1.15,0,0,.81111],m=[.65002,1.15,0,0,.47222],b=[.65002,1.15,0,0,.66667],_=[0,.75,0,0,1],w=[.55001,1.05,0,0,1.27778],I=[.862,1.36,.44445,0,.55556],U=[.86225,1.36,.44445,0,.55556],le=[.55001,1.05,0,0,1.11111],Ee=[.65002,1.15,0,0,.52778],Be=[.65002,1.15,0,0,.61111],st=[.55001,1.05,0,0,1.51112],yt=[.95003,1.45,0,0,.73611],It=[.95003,1.45,0,0,1.04445],Qt=[.95003,1.45,0,0,.52778],tr=[.95003,1.45,0,0,.75],Ve=[0,.75,0,0,1.44445],qr=[.95003,1.45,0,0,.58334],Ti=[1.25003,1.75,0,0,.79167],Bi=[1.25003,1.75,0,0,1.27778],Li=[1.25003,1.75,0,0,.58334],bn=[1.25003,1.75,0,0,.80556],hn=[0,.825,0,0,1.8889],Tn=[1.25003,1.75,0,0,.63889],Cn=[.64502,1.155,0,0,.875],jn=[1e-5,.6,0,0,.875],qn=[-99e-5,.601,0,0,.66667],Qn=[.64502,1.155,0,0,.66667],gn=[1e-5,.9,0,0,.88889],Ts=[.65002,1.15,0,0,.88889],os=[.90001,0,0,0,.88889],ea=[-.00499,.605,0,0,1.05556],ls=[0,.12,0,0,.45],Cr=[0,.61111,0,0,.525],ms=[.08333,.69444,0,0,.525],Ru=[-.08056,.53055,0,0,.525],Iu=[-.05556,.55556,0,0,.525],wn=[0,.43056,0,0,.525],Ws=[.22222,.43056,0,0,.525],Ga=[0,0,0,0,.525],Vl={"AMS-Regular":{32:fe,65:zt,66:rr,67:zt,68:zt,69:rr,70:B,71:T,72:T,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:T,76:rr,77:[0,.68889,0,0,.94445],78:zt,79:dt,80:B,81:dt,82:zt,83:G,84:rr,85:zt,86:zt,87:[0,.68889,0,0,1],88:zt,89:zt,90:rr,107:G,160:fe,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:G,295:He,710:xr,732:Ne,770:xr,771:Ne,989:wr,1008:si,8245:[0,.54986,0,0,.275],8463:He,8487:zt,8498:G,8502:rr,8503:[0,.68889,0,0,.44445],8504:rr,8513:[0,.68889,0,0,.63889],8592:Je,8594:Je,8602:W,8603:W,8606:ge,8608:ge,8610:Se,8611:Se,8619:Ke,8620:Ke,8621:[-.13313,.37788,0,0,1.38889],8622:W,8624:V,8625:V,8630:qt,8631:qt,8634:Ae,8635:Ae,8638:Yt,8639:Yt,8642:Yt,8643:Yt,8644:vr,8646:vr,8647:vr,8648:ei,8649:vr,8650:ei,8651:ge,8652:ge,8653:W,8654:W,8655:W,8666:Ri,8667:Ri,8669:[-.13313,.37788,0,0,1],8672:ui,8674:ui,8705:[0,.825,0,0,.5],8708:G,8709:wr,8717:[0,.43056,0,0,.42917],8722:Je,8724:[.08198,.69224,0,0,.77778],8726:wr,8733:ct,8736:bi,8737:bi,8738:[.03517,.52239,0,0,.72222],8739:Tr,8740:[.25142,.74111,0,0,.27778],8741:pr,8742:[.25142,.74111,0,0,.5],8756:me,8757:me,8764:Te,8765:[-.13313,.37788,0,0,.77778],8769:Te,8770:aa,8774:Jt,8776:oa,8778:wr,8782:Mt,8783:Mt,8785:Ae,8786:Ae,8787:Ae,8790:ct,8791:Rr,8796:[.08198,.91667,0,0,.77778],8806:Et,8807:Et,8808:Ft,8809:Ft,8812:[.25583,.75583,0,0,.5],8814:or,8815:or,8816:Jt,8817:Jt,8818:Rr,8819:Rr,8822:Sr,8823:Sr,8828:oi,8829:oi,8830:Rr,8831:Rr,8832:or,8833:or,8840:Jt,8841:Jt,8842:Dr,8843:Dr,8847:Br,8848:Br,8858:Ae,8859:Ae,8861:Ae,8862:ni,8863:ni,8864:ni,8865:ni,8872:[0,.69224,0,0,.61111],8873:bi,8874:[0,.69224,0,0,.88889],8876:B,8877:B,8878:zt,8879:zt,8882:Br,8883:Br,8884:oi,8885:oi,8888:[0,.54986,0,0,1.11111],8890:Il,8891:_i,8892:_i,8901:[0,.54986,0,0,.27778],8903:wr,8905:wr,8906:wr,8907:ct,8908:ct,8909:[-.03598,.46402,0,0,.77778],8910:Ni,8911:Ni,8912:Br,8913:Br,8914:mi,8915:mi,8916:me,8918:Ur,8919:Ur,8920:Gi,8921:Gi,8922:Yr,8923:Yr,8926:oi,8927:oi,8928:Jt,8929:Jt,8934:Or,8935:Or,8936:Or,8937:Or,8938:or,8939:or,8940:Jt,8941:Jt,8994:lt,8995:lt,9416:[.15559,.69224,0,0,.90222],9484:V,9488:V,9492:tt,9496:tt,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:ni,9633:ni,9650:_t,9651:_t,9654:Br,9660:_t,9661:_t,9664:Br,9674:ft,9733:[.19444,.69224,0,0,.94445],10003:Lt,10016:Lt,10731:ft,10846:[.19444,.75583,0,0,.61111],10877:oi,10878:oi,10885:Et,10886:Et,10887:Dr,10888:Dr,10889:Kt,10890:Kt,10891:Bt,10892:Bt,10901:oi,10902:oi,10933:Ft,10934:Ft,10935:Kt,10936:Kt,10937:Kt,10938:Kt,10949:Et,10950:Et,10955:lr,10956:lr,57350:Tr,57351:pr,57352:wr,57353:si,57356:Ft,57357:Ft,57358:ci,57359:Jt,57360:Jt,57361:ci,57366:Ft,57367:Ft,57368:Ft,57369:Ft,57370:Dr,57371:Dr},"Caligraphic-Regular":{32:fe,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:fe},"Fraktur-Regular":{32:fe,33:[0,.69141,0,0,.29574],34:ii,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:gi,41:gi,42:[0,.62119,0,0,.27764],43:Er,44:Mr,45:Er,46:Mr,47:[.24982,.74947,0,0,.50181],48:Si,49:Si,50:Si,51:Ai,52:Ai,53:Ai,54:Xr,55:Ai,56:Xr,57:Ai,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:ri,93:ri,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:fe,8216:ii,8217:ii,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:fe,33:[0,.69444,0,0,.35],34:$n,35:[.19444,.69444,0,0,.95833],36:vn,37:[.05556,.75,0,0,.95833],38:Pi,39:jr,40:ai,41:ai,42:[0,.75,0,0,.575],43:Hr,44:[.19444,.15556,0,0,.31944],45:Ul,46:[0,.15556,0,0,.31944],47:je,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,58:pn,59:[.19444,.44444,0,0,.31944],60:fi,61:ss,62:fi,63:[0,.69444,0,0,.54305],64:Pi,65:Ar,66:[0,.68611,0,0,.81805],67:ts,68:[0,.68611,0,0,.88194],69:rl,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Di,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Vi,77:[0,.68611,0,0,1.09166],78:Di,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:Ar,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:cr,92:je,93:cr,94:$i,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:yr,99:vi,100:yr,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:yr,105:jr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:jr,109:[0,.44444,0,0,.95833],110:nn,111:Gs,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:nn,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:vi,123:je,124:cr,125:je,126:[.35,.34444,0,0,.575],160:fe,163:[0,.69444,0,0,.86853],168:$i,172:[0,.44444,0,0,.76666],176:_n,177:Hr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Hr,216:[.04861,.73472,0,0,.89444],223:ul,230:[0,.44444,0,0,.83055],247:Hr,248:[.09722,.54167,0,0,.575],305:pn,338:[0,.68611,0,0,1.16944],339:rs,567:[.19444,.44444,0,0,.35139],710:$i,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:$i,715:$i,728:$i,729:jr,730:_n,732:$i,733:$i,915:Vi,916:tn,920:Yn,923:il,926:Da,928:Di,931:ts,933:Yn,934:ts,936:Yn,937:ts,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:jr,8217:jr,8220:$n,8221:$n,8224:Gn,8225:Gn,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:fu,8465:Pr,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Pr,8501:vs,8592:ki,8593:Ki,8594:ki,8595:Ki,8596:ki,8597:je,8598:Wi,8599:Wi,8600:Wi,8601:Wi,8636:ki,8637:ki,8640:ki,8641:ki,8656:ki,8657:Vn,8658:ki,8659:Vn,8660:ki,8661:[.25,.75,0,0,.70277],8704:yr,8706:[0,.69444,.06389,0,.62847],8707:yr,8709:vn,8711:tn,8712:In,8715:In,8722:Hr,8723:Hr,8725:je,8726:je,8727:_s,8728:zi,8729:zi,8730:[.18,.82,0,0,.95833],8733:rs,8734:[0,.44444,0,0,1.14999],8736:bi,8739:cr,8741:je,8743:Vr,8744:Vr,8745:Vr,8746:Vr,8747:[.19444,.69444,.12778,0,.56875],8764:ss,8768:[.19444,.69444,0,0,.31944],8771:Xn,8776:[.02444,.52444,0,0,.89444],8781:Xn,8801:Xn,8804:xn,8805:xn,8810:Ii,8811:Ii,8826:fi,8827:fi,8834:fi,8835:fi,8838:xn,8839:xn,8846:Vr,8849:xn,8850:xn,8851:Vr,8852:Vr,8853:Hr,8854:Hr,8855:Hr,8856:Hr,8857:Hr,8866:vs,8867:vs,8868:Pi,8869:Pi,8900:zi,8901:[-.02639,.47361,0,0,.31944],8902:_s,8968:ds,8969:ds,8970:ds,8971:ds,8994:pi,8995:pi,9651:xs,9657:_s,9661:xs,9667:_s,9711:Wi,9824:ws,9825:ws,9826:ws,9827:ws,9837:[0,.75,0,0,.44722],9838:nr,9839:nr,10216:ai,10217:ai,10815:Di,10927:xn,10928:xn,57376:Eo},"Main-BoldItalic":{32:fe,33:[0,.69444,.11417,0,.38611],34:An,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:rn,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:mn,49:mn,50:mn,51:mn,52:Ss,53:mn,54:mn,55:Ss,56:mn,57:mn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Wn,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:fs,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:fs,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:Fi,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:un,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:un,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:fe,168:[0,.69444,.11473,0,.59111],176:zn,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:cn,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:cn,567:[.19444,.44444,.04611,0,.385],710:Fi,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:rn,730:zn,732:Wn,733:Wn,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:fs,931:[0,.68611,.11431,0,.82666],933:Pn,934:[0,.68611,.05632,0,.82666],936:Pn,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:rn,8217:rn,8220:[0,.69444,.16772,0,.62055],8221:An},"Main-Italic":{32:fe,33:Oi,34:Is,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Oi,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:xi,49:xi,50:xi,51:xi,52:Mi,53:xi,54:xi,55:Mi,56:xi,57:xi,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:yn,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:sn,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:sn,79:Ln,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:sn,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:Lr,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:kn,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:kn,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:fe,168:[0,.66786,.10474,0,.51111],176:Jr,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:Jn,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Jn,710:Lr,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Jr,732:[0,.66786,.11585,0,.51111],733:yn,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Ln,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:sn,931:[0,.68333,.12028,0,.71555],933:Ji,934:[0,.68333,.05986,0,.71555],936:Ji,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Oi,8217:Oi,8220:[0,.69444,.1685,0,.51444],8221:Is,8463:He},"Main-Regular":{32:fe,33:as,34:On,35:s0,36:Ua,37:a0,38:Ys,39:as,40:Hs,41:Hs,42:o0,43:Ps,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:is,48:Un,49:Un,50:Un,51:Un,52:Un,53:Un,54:Un,55:Un,56:Un,57:Un,58:bo,59:[.19444,.43056,0,0,.27778],60:Ur,61:Te,62:Ur,63:ll,64:Ys,65:ya,66:[0,.68333,0,0,.70834],67:Es,68:[0,.68333,0,0,.76389],69:eo,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:ya,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:ba,76:Ca,77:[0,.68333,0,0,.91667],78:ya,79:ba,80:eo,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Es,85:ya,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:ya,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:As,92:is,93:As,94:On,95:[.31,.12056,.02778,0,.5],97:sa,98:Xs,99:Fa,100:Xs,101:Fa,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Xs,105:Os,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:as,109:[0,.43056,0,0,.83334],110:Na,111:sa,112:Il,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:Na,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:Fa,123:is,124:As,125:is,126:[.35,.31786,0,0,.5],160:fe,163:[0,.69444,0,0,.76909],167:$a,168:to,172:[0,.43056,0,0,.66667],176:Qo,177:Ps,182:ks,184:xu,198:[0,.68333,0,0,.90278],215:Ps,216:[.04861,.73194,0,0,.77778],223:On,230:[0,.43056,0,0,.72222],247:Ps,248:[.09722,.52778,0,0,.5],305:bo,338:[0,.68333,0,0,1.01389],339:no,567:[.19444,.43056,0,0,.30556],710:On,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:On,715:On,728:On,729:Os,730:Qo,732:to,733:On,915:Ca,916:tl,920:ba,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:ya,931:Es,933:ba,934:Es,936:ba,937:Es,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:as,8217:as,8220:On,8221:On,8224:$a,8225:$a,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:He,8465:ro,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:ro,8501:Hi,8592:W,8593:el,8594:W,8595:el,8596:W,8597:is,8598:za,8599:za,8600:za,8601:za,8614:[.011,.511,0,0,1],8617:_o,8618:_o,8636:W,8637:W,8640:W,8641:W,8652:[.011,.671,0,0,1],8656:W,8657:ks,8658:W,8659:ks,8660:W,8661:[.25,.75,0,0,.61111],8704:Xs,8706:[0,.69444,.05556,.08334,.5309],8707:Xs,8709:Ua,8711:tl,8712:io,8715:io,8722:Ps,8723:Ps,8725:is,8726:is,8727:Qi,8728:Ka,8729:Ka,8730:[.2,.8,0,0,.83334],8733:no,8734:qt,8736:bi,8739:As,8741:is,8743:Js,8744:Js,8745:Js,8746:Js,8747:[.19444,.69444,.11111,0,.41667],8764:Te,8768:[.19444,.69444,0,0,.27778],8771:aa,8773:[-.022,.589,0,0,1],8776:oa,8781:aa,8784:[-.133,.67,0,0,.778],8801:aa,8804:Dr,8805:Dr,8810:xo,8811:xo,8826:Ur,8827:Ur,8834:Ur,8835:Ur,8838:Dr,8839:Dr,8846:Js,8849:Dr,8850:Dr,8851:Js,8852:Js,8853:Ps,8854:Ps,8855:Ps,8856:Ps,8857:Ps,8866:Hi,8867:Hi,8868:Ys,8869:Ys,8872:[.249,.75,0,0,.867],8900:Ka,8901:[-.05555,.44445,0,0,.27778],8902:Qi,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:ji,8969:ji,8970:ji,8971:ji,8994:ps,8995:ps,9136:Bn,9137:Bn,9651:Gt,9657:Qi,9661:Gt,9667:Qi,9711:za,9824:_a,9825:_a,9826:_a,9827:_a,9837:[0,.75,0,0,.38889],9838:wo,9839:wo,10216:Hs,10217:Hs,10222:Bn,10223:Bn,10229:[.011,.511,0,0,1.609],10230:So,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:So,10815:ya,10927:Dr,10928:Dr,57376:Eo},"Math-BoldItalic":{32:fe,48:Gs,49:Gs,50:Gs,51:Qs,52:Qs,53:Qs,54:Kr,55:Qs,56:Kr,57:Qs,65:Ar,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:so,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:rl,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:fu,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:Pl,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:fe,915:[0,.68611,.15972,0,.65694],916:tn,920:[0,.68611,.03194,0,.86722],923:il,926:[0,.68611,.07458,0,.84125],928:so,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Da,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:Pl,960:[0,.44444,.03704,0,.68241],961:pu,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:pu,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:fe,48:sa,49:sa,50:sa,51:Ao,52:Ao,53:Ao,54:Un,55:Ao,56:Un,57:Ao,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:gu,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:mu,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:ko,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:fe,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:mu,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:gu,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:ko,960:[0,.43056,.03588,0,.57003],961:To,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:To,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:fe,33:[0,.69444,0,0,.36667],34:$l,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:nl,40:ao,41:ao,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:ys,49:ys,50:ys,51:ys,52:ys,53:ys,54:ys,55:ys,56:ys,57:ys,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:Ol,64:Bs,65:Bs,66:Bs,67:vu,68:Vs,69:[0,.69444,0,0,.64167],70:Hi,71:Bs,72:Vs,73:[0,.69444,0,0,.33056],74:Ol,75:Co,76:_u,77:[0,.69444,0,0,.97778],78:Vs,79:Vs,80:vu,81:[.10556,.69444,0,0,.79445],82:vu,83:Hi,84:Bs,85:Co,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Bs,89:[0,.69444,.0275,0,.73334],90:Nl,91:n0,93:n0,94:ys,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Bl,99:[0,.45833,0,0,.48889],100:Bl,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Bl,105:Fl,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Fl,109:[0,.45833,0,0,.86667],110:bu,111:[0,.45833,0,0,.55],112:yu,113:yu,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:bu,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:fe,168:ys,176:Bs,180:ys,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:ys,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:ys,729:nl,730:Bs,732:ys,733:ys,915:_u,916:[0,.69444,0,0,.91667],920:sl,923:Nl,926:Bs,928:Vs,931:Vs,933:sl,934:Vs,936:sl,937:Vs,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:nl,8217:nl,8220:$l,8221:$l},"SansSerif-Italic":{32:fe,33:[0,.69444,.05733,0,.31945],34:Eu,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:ol,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:oo,45:[0,.44444,.01946,0,.33333],46:l0,47:[.25,.75,.13164,0,.5],48:la,49:la,50:la,51:la,52:la,53:la,54:la,55:la,56:la,57:la,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:Ma,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:al,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:Fs,77:[0,.69444,.08094,0,.875],78:al,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:wu,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:fe,168:[0,.67937,.06385,0,.5],176:Su,184:xu,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:wu,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:zl,715:On,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Su,732:[0,.67659,.08826,0,.5],733:zl,915:[0,.69444,.13372,0,.54167],916:Tu,920:[0,.69444,.07555,0,.77778],923:Hi,926:[0,.69444,.12816,0,.66667],928:al,931:[0,.69444,.11983,0,.72222],933:Do,934:[0,.69444,.04603,0,.72222],936:Do,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:ol,8217:ol,8220:[0,.69444,.14205,0,.5],8221:Eu},"SansSerif-Regular":{32:fe,33:[0,.69444,0,0,.31945],34:On,35:s0,36:Ua,37:a0,38:[0,.69444,0,0,.75834],39:as,40:Hs,41:Hs,42:o0,43:Ps,44:oo,45:[0,.44444,0,0,.33333],46:l0,47:is,48:ua,49:ua,50:ua,51:ua,52:ua,53:ua,54:ua,55:ua,56:ua,57:ua,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:ll,64:Ma,65:Ma,66:Ma,67:yr,68:[0,.69444,0,0,.72223],69:ul,70:[0,.69444,0,0,.56945],71:Ma,72:ke,73:as,74:ll,75:[0,.69444,0,0,.69445],76:Fs,77:[0,.69444,0,0,.875],78:ke,79:[0,.69444,0,0,.73611],80:yr,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Xs,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:Ma,89:[0,.69444,.025,0,.66667],90:Hi,91:cl,93:cl,94:On,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:hl,99:lo,100:hl,101:lo,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:hl,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:ku,111:[0,.44444,0,0,.5],112:Au,113:Au,114:[0,.44444,.01389,0,.34167],115:Ul,116:[0,.57143,0,0,.36111],117:ku,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:fe,168:[0,.67937,0,0,.5],176:Ma,184:xu,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:On,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:On,715:On,728:On,729:[0,.67937,0,0,.27778],730:Ma,732:[0,.67659,0,0,.5],733:On,915:Fs,916:Tu,920:Ys,923:Hi,926:Ma,928:ke,931:ro,933:Ys,934:ro,936:Ys,937:ro,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:as,8217:as,8220:On,8221:On},"Script-Regular":{32:fe,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:fe},"Size1-Regular":{32:fe,40:Cu,41:Cu,47:Kl,91:dl,92:Kl,93:dl,123:Mo,125:Mo,160:fe,710:Hl,732:Hl,770:Hl,771:Hl,8214:[-99e-5,.601,0,0,.77778],8593:fl,8595:fl,8657:Du,8659:Du,8719:Mu,8720:Mu,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:Gl,8748:u0,8749:u0,8750:Gl,8896:Ha,8897:Ha,8898:Ha,8899:Ha,8968:Lo,8969:Lo,8970:Lo,8971:Lo,9168:qn,10216:Lo,10217:Lo,10752:Lu,10753:Lu,10754:Lu,10756:Ha,10758:Ha},"Size2-Regular":{32:fe,40:c0,41:c0,47:H,91:m,92:H,93:m,123:b,125:b,160:fe,710:_,732:_,770:_,771:_,8719:w,8720:w,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:U,8748:I,8749:I,8750:U,8896:le,8897:le,8898:le,8899:le,8968:Ee,8969:Ee,8970:Ee,8971:Ee,10216:Be,10217:Be,10752:st,10753:st,10754:st,10756:le,10758:le},"Size3-Regular":{32:fe,40:yt,41:yt,47:It,91:Qt,92:It,93:Qt,123:tr,125:tr,160:fe,710:Ve,732:Ve,770:Ve,771:Ve,8730:[.95003,1.45,0,0,1],8968:qr,8969:qr,8970:qr,8971:qr,10216:tr,10217:tr},"Size4-Regular":{32:fe,40:Ti,41:Ti,47:Bi,91:Li,92:Bi,93:Li,123:bn,125:bn,160:fe,710:hn,732:hn,770:hn,771:hn,8730:[1.25003,1.75,0,0,1],8968:Tn,8969:Tn,8970:Tn,8971:Tn,9115:Cn,9116:jn,9117:Cn,9118:Cn,9119:jn,9120:Cn,9121:Qn,9122:qn,9123:Qn,9124:Qn,9125:qn,9126:Qn,9127:gn,9128:Ts,9129:os,9130:[0,.3,0,0,.88889],9131:gn,9132:Ts,9133:os,9143:[.88502,.915,0,0,1.05556],10216:bn,10217:bn,57344:ea,57345:ea,57680:ls,57681:ls,57682:ls,57683:ls},"Typewriter-Regular":{32:Ga,33:Cr,34:Cr,35:Cr,36:ms,37:ms,38:Cr,39:Cr,40:ms,41:ms,42:[0,.52083,0,0,.525],43:Ru,44:[.13889,.125,0,0,.525],45:Ru,46:[0,.125,0,0,.525],47:ms,48:Cr,49:Cr,50:Cr,51:Cr,52:Cr,53:Cr,54:Cr,55:Cr,56:Cr,57:Cr,58:wn,59:[.13889,.43056,0,0,.525],60:Iu,61:[-.19549,.41562,0,0,.525],62:Iu,63:Cr,64:Cr,65:Cr,66:Cr,67:Cr,68:Cr,69:Cr,70:Cr,71:Cr,72:Cr,73:Cr,74:Cr,75:Cr,76:Cr,77:Cr,78:Cr,79:Cr,80:Cr,81:[.13889,.61111,0,0,.525],82:Cr,83:Cr,84:Cr,85:Cr,86:Cr,87:Cr,88:Cr,89:Cr,90:Cr,91:ms,92:ms,93:ms,94:Cr,95:[.09514,0,0,0,.525],96:Cr,97:wn,98:Cr,99:wn,100:Cr,101:wn,102:Cr,103:Ws,104:Cr,105:Cr,106:[.22222,.61111,0,0,.525],107:Cr,108:Cr,109:wn,110:wn,111:wn,112:Ws,113:Ws,114:wn,115:wn,116:[0,.55358,0,0,.525],117:wn,118:wn,119:wn,120:wn,121:Ws,122:wn,123:ms,124:ms,125:ms,126:Cr,127:Cr,160:Ga,176:Cr,184:[.19445,0,0,0,.525],305:wn,567:Ws,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Cr,715:Cr,728:Cr,730:Cr,770:Cr,771:Cr,776:Cr,915:Cr,916:Cr,920:Cr,923:Cr,926:Cr,928:Cr,931:Cr,933:Cr,934:Cr,936:Cr,937:Cr,8216:Cr,8217:Cr,8242:Cr,9251:[.11111,.21944,0,0,.525]}},Ro=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,xa=10,ca=.25,X0=1.2,ha=.431,Wl={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[ha,ha,ha],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[ca,ca,ca],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},pl=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],jl=5,uo={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function ml(e,r){e===void 0&&(e=77);const n=Vl[r][e];if(n)return{defaultMetrics:!1,depth:n[0],height:n[1],italic:n[2],skew:n[3],width:n[4]};if(e===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const a=String.fromCodePoint(e);if(a in uo)e=uo[a].codePointAt(0);else if(Ro.test(a))return e=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var gl={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Pu={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},Nc={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
c -179 0 -524 -115 -524 -115
c -5 -1 -9 -5 -9 -10
c 0 -1 1 -2 1 -3
l 4 -22
c 1 -5 5 -9 11 -9
h 2
s 338 93 512 92
c 174 0 513 -92 513 -92
h 2
c 5 0 9 4 11 9
l 5 22
c 1 6 -2 12 -8 13
c 0 0 -342 115 -520 115
z
`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function jh(e){if(Pu[e]){const[P,z,Q]=Pu[e],_e=`<span class="stretchy" style="height:${Q}em"><svg width="100%" height="${Q}em" viewBox="0 0 ${P} ${z}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Nc[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*Q/2)/100}em;min-width:0">${_e}</span>`}const[r,n,a,u]=gl[e];let f,v;const A=a/1e3;r.length===3?(f=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],v=["xMinYMin","xMidYMin","xMaxYMin"]):r.length===2?(f=["slice-1-of-2","slice-2-of-2"],v=["xMinYMin","xMaxYMin"]):(f=["slice-1-of-1"],v=[u]);const C=r.map((P,z)=>`<span class="${f[z]}" style=height:${A}em><svg width=400em height=${A}em viewBox="0 0 400000 ${a}" preserveAspectRatio="${v[z]} slice"><path fill="currentcolor" d="${Nc[P]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${A}em;min-width:${n}em;">${C}</span>`}function $c(e){return gl[e]?gl[e][2]/1e3:Pu[e][2]}function zc(e){const r=[];for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);if(a===13&&e.charCodeAt(n+1)===10&&(a=10,n++),(a===13||a===12)&&(a=10),a===0&&(a=65533),a>=55296&&a<=56319){const u=e.charCodeAt(n+1);if(u>=56320&&u<=57343){const f=a-55296,v=u-56320;a=yo(2,16)+f*yo(2,10)+v,n++}}r.push(a)}return r}var h0=8205,qh=[[h0,1],[65038,2],[127995,5],[129456,4],[917536,96]],Ou,Uc=[127462,127487];function d0(e){var r;if(Ou===void 0){Ou={};for(const n of qh)for(let a=n[0];a<=n[0]+n[1]-1;a++)Ou[a]=!0}return(r=Ou[e])!=null?r:!1}function J0(e){return e>=Uc[0]&&e<=Uc[1]}function Zh(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const r=[],n=zc(e);let a=0;for(;a<n.length;){const u=n[a++],f=n[a];if(f===h0){const v=a-1;for(a+=2;n[a]===h0;)a+=2;r.push(String.fromCodePoint(...n.slice(v,a-v+1)))}else if(d0(f)){const v=a-1;for(;d0(n[a]);)a+=n[a]===h0?2:1;r.push(String.fromCodePoint(...n.slice(v,2*a-v-1)))}else J0(u)?(a+=1,r.push(String.fromCodePoint(...n.slice(a-2,2)))):r.push(String.fromCodePoint(u))}return r}var ta=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=Zh(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){const r=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return r!=null&&r[0]?(this.pos+=r[0].length,r[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const e=this.get();if(e==="\\"){if(!this.end()){let r=this.match(/^[a-zA-Z\*]+/);return r?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):r=this.get(),"\\"+r}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();const r=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(r)return String.fromCodePoint(Number.parseInt(r.slice(r.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let r=!1;if(/[\d?@]/.test(this.peek())&&(r=!0,this.pos+1<this.s.length)){const n=this.s[this.pos+1];r=/[^\dA-Za-z]/.test(n)}return r?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function gf(e,r){var n,a,u,f;const v=[];let A=e.next();if(A&&A!=="\\relax"){if(A==="\\noexpand")A=e.next(),A&&v.push(A);else if(A==="\\obeyspaces")e.obeyspaces=!0;else if(A==="\\bgroup")v.push("<{>");else if(A==="\\egroup")v.push("<}>");else if(A==="\\string"){if(A=e.next(),A)if(A.startsWith("\\"))for(const C of A)v.push(C==="\\"?"\\backslash":C);else A==="<{>"?v.push("\\{"):A==="<space>"?v.push("~"):A==="<}>"&&v.push("\\}")}else if(A==="\\csname"){for(;e.peek()==="<space>";)e.next();let C="",P=!1,z=[];do{if(z.length===0)if(/^#[\d?@]$/.test(e.peek())){const Q=e.get().slice(1);z=f0((a=(n=r==null?void 0:r(Q))!=null?n:r==null?void 0:r("?"))!=null?a:"\\placeholder{}",r),A=z[0]}else A=e.next(),z=A?[A]:[];P=z.length===0,!P&&A==="\\endcsname"&&(P=!0,z.shift()),P||(P=A==="<$>"||A==="<$$>"||A==="<{>"||A==="<}>"||typeof A=="string"&&A.length>1&&A.startsWith("\\")),P||(C+=z.shift())}while(!P);C&&v.push("\\"+C),v.push(...z)}else if(A!=="\\endcsname")if(A.length>1&&A.startsWith("#")){const C=A.slice(1);v.push(...f0((f=(u=r==null?void 0:r(C))!=null?u:r==null?void 0:r("?"))!=null?f:"\\placeholder{}",r))}else v.push(A)}return v}function f0(e,r=null){const n=[];let a="";for(const v of e.toString().split(/\r?\n/)){a&&n.push(a),a=" ";const A=v.match(/((?:\\%)|[^%])*/);A!==null&&n.push(A[0])}const u=new ta(At(n.join(""))),f=[];do f.push(...gf(u,r));while(!u.end());return f}function Xi(e){let r="";const n=[];for(const a of e)a&&(r&&/^[a-zA-Z\*]/.test(a)&&n.push(r),n.push(a),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(a)&&n.push(" "),r=/\\[a-zA-Z]+\*?$/.test(a)?" ":"");return n.join("")}function Kn(e,...r){return console.assert(e.startsWith("\\")),r.length===0?e:Xi([e,...r.map(n=>`{${n}}`)])}function ql(e){return Xi(e.map(r=>{var n;return(n={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[r])!=null?n:r}))}var Yh=class Fc{constructor(r){Fc._registry[r]=this}static createAtom(r,n,a){return Fc._registry[r].createAtom(n,it(n,r),a)}static serialize(r,n){var a;if(!r||r.length===0)return"";if((a=n.skipStyles)!=null&&a){const u=[];for(const f of Kc(r)){const v=Fc._registry[f[0].mode];u.push(...v.serialize(f,n))}return Xi(u)}return Xi(Jh(r,n))}static getFont(r,n,a){return Fc._registry[r].getFont(n,a)}};Yh._registry={};var Ns=Yh;function Kc(e){const r=[];let n=[],a="NONE";for(const u of e)u.type!=="first"&&(u.mode!==a?(n.length>0&&r.push(n),n=[u],a=u.mode):n.push(u));return n.length>0&&r.push(n),r}function da(e,r){const n=[];let a=[],u;for(const f of e)if(f.type!=="first"&&f.style){let v;r==="variant"?(v=f.style.variant,f.style.variantStyle&&f.style.variantStyle!=="up"&&(v+="-"+f.style.variantStyle)):v=f.style[r],v===u?a.push(f):(a.length>0&&n.push(a),a=[f],u=v)}return a.length>0&&n.push(a),n}function Hc(e,r){var n;const{parent:a}=e[0],u=a==null?void 0:a.computedStyle.color,f=[];for(const v of Kc(e)){const A=r.defaultMode;for(const C of da(v,"color")){const P=C[0].computedStyle,z=Ns._registry[C[0].mode].serialize(C,d($({},r),{defaultMode:A==="text"?"text":"math"}));!r.skipStyles&&P.color&&P.color!=="none"&&(!a||u!==P.color)?f.push(Kn("\\textcolor",(n=P.verbatimColor)!=null?n:P.color,Xi(z))):f.push(Xi(z))}}return f}function Xh(e,r){const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.backgroundColor;return da(e,"backgroundColor").map(u=>{var f;if(u.length>0||u[0].type!=="box"){const v=u[0].computedStyle;if(v.backgroundColor&&v.backgroundColor!=="none"&&(!n||a!==v.backgroundColor))return Kn("\\colorbox",(f=v.verbatimBackgroundColor)!=null?f:v.backgroundColor,Xi(Hc(u,d($({},r),{defaultMode:"text"}))))}return Xi(Hc(u,r))})}function Jh(e,r){if(e.length===0)return[];const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.fontSize,u=[];for(const f of da(e,"fontSize")){const v=f[0].computedStyle.fontSize,A=Xh(f,r);A&&(v&&v!=="auto"&&(!n||a!==v)?u.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][v],...A):u.push(...A))}return u}function wa(e){return e?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[e]:void 0}function Zl(e){if(e.length===0)return"ord";const r=wa(e[0].type),n=wa(e[e.length-1].type);return r&&r===n?r:"ord"}function Yl(e,r){if(typeof e=="string")return e;if(typeof e=="number"){console.assert(Number.isFinite(e));const n=Math.ceil(100*e)/100;return n===0?"0":n.toString()+(r!=null?r:"")}return""}var ur=class Tp{constructor(r,n){var a,u,f,v,A;if(typeof r=="number"?this.value=String.fromCodePoint(r):typeof r=="string"?this.value=r:k(r)?this.children=r.filter(P=>P!==null):r&&r instanceof Tp&&(this.children=[r]),this.children)for(const P of this.children)P.parent=this;this.type=(a=n==null?void 0:n.type)!=null?a:"ignore",this.isSelected=(n==null?void 0:n.isSelected)===!0,n!=null&&n.caret&&(this.caret=n.caret),this.classes=(u=n==null?void 0:n.classes)!=null?u:"",this.isTight=(f=n==null?void 0:n.isTight)!=null?f:!1,n!=null&&n.attributes&&(this.attributes=n.attributes);let C=n==null?void 0:n.fontFamily;n!=null&&n.style&&this.value&&(C=(A=Ns.getFont((v=n.mode)!=null?v:"math",this,d($({variant:"normal"},n.style),{letterShapeStyle:n.letterShapeStyle})))!=null?A:void 0),C||(C="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(n==null?void 0:n.maxFontSize)!==void 0&&(this.maxFontSize=n.maxFontSize),Qh(this,C)}set atomID(r){r===void 0||r.length===0||(this.id=r)}selected(r){if(this.isSelected!==r&&(this.isSelected=r,this.children))for(const n of this.children)n.selected(r)}setStyle(r,n,a){if(n===void 0)return;const u=Yl(n,a);u.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[r]=u)}setTop(r){Number.isFinite(r)&&Math.abs(r)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=Yl(r,"em"),this.height-=r,this.depth+=r)}get left(){var r;return(r=this.cssProperties)!=null&&r["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(r){Number.isFinite(r)&&(r===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=Yl(r,"em")))}set right(r){Number.isFinite(r)&&(r===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=Yl(r,"em")))}set bottom(r){Number.isFinite(r)&&(r===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=Yl(r,"em")))}get width(){return this._width*this.scale}set width(r){this._width=r,this.hasExplicitWidth=!0}set softWidth(r){}get height(){return this._height*this.scale}set height(r){this._height=r}get depth(){return this._depth*this.scale}set depth(r){this._depth=r}wrap(r){const n=r.parent;if(!n)return this;r.isPhantom&&this.setStyle("opacity",0);const a=r.color;a&&a!==n.color&&this.setStyle("color",a);let u=r.backgroundColor;this.isSelected&&(u=D(u)),u&&u!==n.backgroundColor&&(this.setStyle("background-color",u),this.setStyle("display","inline-block"));const f=r.scalingFactor;return this.scale=f,this.skew*=f,this.italic*=f,this}toMarkup(){var r,n,a,u;let f=(r=this.value)!=null?r:"";if(this.children)for(const Ie of this.children)f+=Ie.toMarkup();let v="";if(this.svgBody)v=jh(this.svgBody);else if(this.svgOverlay){v='<span style="',v+="display: inline-block;",v+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,v+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,v+='">',v+=f,v+="</span>",v+='<svg style="position:absolute;overflow:visible;',v+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const Ie=(n=this.cssProperties)==null?void 0:n.padding;Ie?(v+=`top:${Ie};`,v+=`left:${Ie};`,v+=`width:calc(100% - 2 * ${Ie} );`):v+="top:0;left:0;width:100%;",v+="z-index:2;",v+='"',this.svgStyle&&(v+=this.svgStyle),v+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,v+=`>${this.svgOverlay}</svg>`}let A="";const C=this.classes.split(" ");C.push((a={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?a:""),this.caret==="latex"&&C.push("ML__latex-caret"),this.isSelected&&C.push("ML__selected");const P=C.length===1?C[0]:C.filter((Ie,ze,St)=>Ie.length>0&&St.indexOf(Ie)===ze).join(" ");if(P.length>0&&(A+=` class="${P}"`),this.id&&(A+=` data-atom-id=${this.id}`),this.cssId&&(A+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(A+=" "+Object.keys(this.attributes).map(Ie=>`${Ie}="${this.attributes[Ie]}"`).join(" ")),this.htmlData){const Ie=this.htmlData.split(",");for(const ze of Ie){const St=ze.match(/([^=]+)=(.+$)/);if(St){const sr=St[1].trim().replace(/ /g,"-");sr&&(A+=` data-${sr}="${St[2]}" `)}else{const sr=ze.trim().replace(/ /g,"-");sr&&(A+=` data-${sr} `)}}}const z=(u=this.cssProperties)!=null?u:{};this.hasExplicitWidth&&z.width===void 0&&(z.width=`${Math.ceil(this._width*100)/100}em`);const Q=Object.keys(z).map(Ie=>`${Ie}:${z[Ie]}`);if(this.scale!==void 0&&this.scale!==1&&(f.length>0||v.length>0)&&Q.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const Ie=this.htmlStyle.split(";");let ze="";for(const St of Ie){const sr=St.match(/([^=]+):(.+$)/);if(sr){const xt=sr[1].trim().replace(/ /g,"-");xt&&(ze+=`${xt}:${sr[2]};`)}}ze&&(A+=` style="${ze}"`)}Q.length>0&&(A+=` style="${Q.join(";")}"`);let _e="";return A.length>0||v.length>0?_e=`<span${A}>${f}${v}</span>`:_e=f,this.caret==="text"?_e+='<span class="ML__text-caret"></span>':this.caret==="math"&&(_e+='<span class="ML__caret"></span>'),_e}tryCoalesceWith(r){if(this.svgBody||!this.value||r.svgBody||!r.value)return!1;const n=this.children&&this.children.length>0,a=r.children&&r.children.length>0;if(n||a)return!1;if(r.cssProperties||this.cssProperties){for(const C of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(r.cssProperties&&C in r.cssProperties||this.cssProperties&&C in this.cssProperties)return!1}const u=this.cssProperties?Object.keys(this.cssProperties).length:0,f=r.cssProperties?Object.keys(r.cssProperties).length:0;if(u!==f)return!1;if(u>0){for(const C of Object.keys(this.cssProperties))if(this.cssProperties[C]!==r.cssProperties[C])return!1}const v=this.classes.trim().replace(/\s+/g," ").split(" "),A=r.classes.trim().replace(/\s+/g," ").split(" ");if(v.length!==A.length)return!1;v.sort(),A.sort();for(const[C,P]of v.entries())if(P==="vertical-separator"||P!==A[C])return!1;return this.value+=r.value,this.height=Math.max(this.height,r.height),this.depth=Math.max(this.depth,r.depth),this._width=this._width+r._width,this.maxFontSize=Math.max(this.maxFontSize,r.maxFontSize),this.italic=r.italic,!0}};function Q0(e){if(!e||e.length===0)return[];e[0].children=Q0(e[0].children);const r=[e[0]];for(let n=1;n<e.length;n++)r[r.length-1].tryCoalesceWith(e[n])||(e[n].children=Q0(e[n].children),r.push(e[n]));return r}function p0(e){return e.children&&(e.children=Q0(e.children)),e}function m0(e,r){if(!e)return new ur(null,r);const n=new ur(null,{classes:"ML__strut",type:"ignore"});n.setStyle("height",Math.max(0,e.height),"em");const a=[n];if(e.depth!==0){const u=new ur(null,{classes:"ML__strut--bottom",type:"ignore"});u.setStyle("height",e.height+e.depth,"em"),u.setStyle("vertical-align",-e.depth,"em"),a.push(u)}return a.push(e),new ur(a,d($({},r),{type:"lift"}))}function g0(e){const r=$c(e)/2,n=new ur(null,{maxFontSize:0});return n.height=r+.166,n.depth=r-.166,n.svgBody=e,n}function Qh(e,r){var n;if(e.type==="latex"){e.height=.9,e.depth=.2,e._width=1;return}if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let a=0;a<e.value.length;a++){const u=ml(e.value.codePointAt(a),r);e.height=Math.max(e.height,u.height),e.depth=Math.max(e.depth,u.depth),e._width+=u.width,e.skew=u.skew,e.italic=u.italic}return}if(e.children&&e.children.length>0){let a=-1/0,u=-1/0,f=0;for(const v of e.children)v.height>a&&(a=v.height),v.depth>u&&(u=v.depth),f=Math.max(f,(n=v.maxFontSize)!=null?n:0);e.height=a,e.depth=u,e._width=e.children.reduce((v,A)=>v+A.width,0),e.maxFontSize=f}}function Gc(e){if("individualShift"in e){const r=e.individualShift;let n=r[0];const a=[n],u=-n.shift-n.box.depth;let f=u;for(let v=1;v<r.length;v++){const A=r[v],C=-A.shift-f-A.box.depth,P=C-(n.box.height+n.box.depth);f=f+C,a.push(P),a.push(A),n=A}return[a,u]}if("top"in e){let r=e.top;for(const n of e.children)r-=typeof n=="number"?n:n.box.height+n.box.depth;return[e.children,r]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const r=e.firstBaseline[0];if(typeof r=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-r.box.depth]}else if("shift"in e){const r=e.children[0];if(typeof r=="number")throw new Error("First child must be an element.");return[e.children,-r.box.depth-e.shift]}}return[null,0]}function ed(e){var r;const[n,a]=Gc(e);if(!n)return[[],0,0];const u=new ur(null,{classes:"pstrut"});let f=0;for(const ze of n)if(typeof ze!="number"){const St=ze.box;f=Math.max(f,St.maxFontSize,St.height)}f+=2,u.height=f,u.setStyle("height",f,"em");const v=[];let A=a,C=a,P=a,z=0;for(const ze of n){if(typeof ze=="number")P+=ze;else{const St=ze.box,sr=(r=ze.classes)!=null?r:[],xt=new ur([u,St],{classes:sr.join(" "),style:ze.style});St.setStyle("height",St.height+St.depth,"em"),St.setStyle("display","inline-block"),xt.setStyle("top",-f-P-St.depth,"em"),ze.marginLeft&&xt.setStyle("margin-left",ze.marginLeft,"em"),ze.marginRight&&xt.setStyle("margin-right",ze.marginRight,"em"),v.push(xt),P+=St.height+St.depth,z=Math.max(z,xt.width)}A=Math.min(A,P),C=Math.max(C,P)}v.forEach(ze=>{ze.softWidth=z});const Q=new ur(v,{classes:"vlist"});if(Q.softWidth=z,Q.height=C,Q.setStyle("height",C,"em"),A>=0)return[[new ur(Q,{classes:"vlist-r"})],C,-A];const _e=new ur(new ur(null),{classes:"vlist"});_e.height=-A,_e.setStyle("height",-A,"em");const Ie=new ur(8203,{classes:"vlist-s",maxFontSize:0});return Ie.softWidth=0,Ie.height=0,Ie.depth=0,[[new ur([Q,Ie],{classes:"vlist-r"}),new ur(_e,{classes:"vlist-r"})],C,-A]}var gs=class extends ur{constructor(e,r){var n;const[a,u,f]=ed(e);super(a.length===1?a[0]:a,{type:r==null?void 0:r.type,classes:((n=r==null?void 0:r.classes)!=null?n:"")+" vlist-t"+(a.length===2?" vlist-t2":"")}),this.height=u,this.depth=f,this.softWidth=a.reduce((v,A)=>Math.max(v,A.width),0)}};function td(e,r){var n,a,u,f,v;const A=e.metrics,C=new ur(r.base),P=(n=r.baseShift)!=null?n:0,z=(a=r.slant)!=null?a:0;let Q=0,_e=0;r.above&&(Q=(u=r.aboveShift)!=null?u:Math.max(A.bigOpSpacing1,A.bigOpSpacing3-r.above.depth)),r.below&&(_e=(f=r.belowShift)!=null?f:Math.max(A.bigOpSpacing2,A.bigOpSpacing4-r.below.height));let Ie=null;if(r.below&&r.above){const ze=A.bigOpSpacing5+r.below.height+r.below.depth+_e+C.depth+P;Ie=new gs({bottom:ze,children:[A.bigOpSpacing5,{box:r.below,marginLeft:-z,classes:["ML__center"]},_e,{box:C,classes:["ML__center"]},Q,{box:r.above,marginLeft:z,classes:["ML__center"]},A.bigOpSpacing5]}).wrap(e)}else if(r.below&&!r.above)Ie=new gs({top:C.height-P,children:[A.bigOpSpacing5,{box:r.below,marginLeft:-z,classes:["ML__center"]},_e,{box:C,classes:["ML__center"]}]}).wrap(e);else if(!r.below&&r.above){const ze=C.depth+P;Ie=new gs({bottom:ze,children:[{box:C,classes:["ML__center"]},Q,{box:r.above,marginLeft:z,classes:["ML__center"]},A.bigOpSpacing5]}).wrap(e)}else{const ze=C.depth+P;Ie=new gs({bottom:ze,children:[{box:C},A.bigOpSpacing5]}).wrap(e)}return new ur(Ie,{type:(v=r.type)!=null?v:"op"})}var ec=7,v0=6,y0=5,vl=4,Xl=3,ra=2,co=1,zs=0,Va=class{constructor(e,r,n){this.id=e,this.sizeDelta=r,this.cramped=n;const a={"-4":2,"-3":1,0:0}[r];this.metrics=Object.keys(Wl).reduce((u,f)=>d($({},u),{[f]:Wl[f][a]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return La[[zs,co,zs,co,ra,Xl,ra,Xl][this.id]]}get sub(){return La[[zs,zs,zs,zs,ra,ra,ra,ra][this.id]]}get fracNum(){return La[[zs,co,zs,co,ra,Xl,vl,y0][this.id]]}get fracDen(){return La[[zs,zs,zs,zs,ra,ra,vl,vl][this.id]]}get cramp(){return La[[zs,zs,ra,ra,vl,vl,v0,v0][this.id]]}get isTight(){return this.sizeDelta<0}},yl={7:new Va(ec,0,!1),6:new Va(v0,0,!0),5:new Va(y0,0,!1),4:new Va(vl,0,!0),3:new Va(Xl,-3,!1),2:new Va(ra,-3,!0),1:new Va(co,-4,!1),0:new Va(zs,-4,!0)},La=d($({},yl),{displaystyle:yl[ec],textstyle:yl[y0],scriptstyle:yl[Xl],scriptscriptstyle:yl[co]});function Vc(e,r){var n;if(!e)return 0;const a={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:xa,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(n=e.unit)!=null?n:"pt"];if(Number.isFinite(r)){const u=yo(10,r);return Math.round(e.dimension/xa*a*u)/u}return e.dimension*a}function Wc(e,r){if(e===null)return 0;const n=Vc(e)/xa;if(Number.isFinite(r)){const a=yo(10,r);return Math.round(n*a)/a}return n}function tc(e){var r;return`${e.dimension}${(r=e.unit)!=null?r:"pt"}`}function rd(e){let r=tc(e.glue);return e.grow&&e.grow.dimension!==0&&(r+=` plus ${tc(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(r+=` minus ${tc(e.shrink)}`),r}function Cs(e){var r,n;if(e==null)return null;let a="";if("dimension"in e&&(a=`${e.dimension}${(r=e.unit)!=null?r:"pt"}`),"glue"in e&&(a=rd(e)),"number"in e)if(!("base"in e)||e.base==="decimal")a=Number(e.number).toString();else if(e.base==="alpha")a=`\`${String.fromCodePoint(e.number)}`;else{const u=Math.round(e.number)>>>0;e.base==="hexadecimal"?(a=Number(u).toString(16).toUpperCase(),u<=255?a=a.padStart(2,"0"):u<=65535?a=a.padStart(4,"0"):u<=16777215?a=a.padStart(6,"0"):a=a.padStart(8,"0"),a=`"${a}`):e.base==="octal"&&(a=Number(u).toString(8),u<=63?a=a.padStart(2,"0"):u<=30583?a=a.padStart(4,"0"):a=a.padStart(8,"0"),a=`'${a}`)}return"register"in e&&("factor"in e&&(e.factor===-1?a="-":e.factor!==1&&(a=Number(e.factor).toString())),"global"in e&&e.global&&(a+="\\global"),a+=`\\${e.register}`),"string"in e&&(a=e.string),(n=e.relax)!=null&&n&&(a+="\\relax"),a}function fa(e,r){return e==null?null:"number"in e?d($({},e),{number:e.number*r}):"register"in e?"factor"in e&&e.factor?d($({},e),{factor:e.factor*r}):d($({},e),{factor:r}):"dimension"in e?d($({},e),{dimension:e.dimension*r}):"glue"in e?e.shrink&&e.grow?{glue:fa(e.glue,r),shrink:fa(e.shrink,r),grow:fa(e.grow,r)}:e.shrink?{glue:fa(e.glue,r),shrink:fa(e.shrink,r)}:e.grow?{glue:fa(e.glue,r),grow:fa(e.grow,r)}:{glue:fa(e.glue,r)}:null}var id={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function Bu(){return $({},id)}function rc(){return{registers:Bu(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Y.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:ut,backgroundColorMap:pt,getMacro:e=>Pt(e,_r())}}var qi=class Cp{constructor(r,n){var a,u,f,v,A,C,P,z,Q,_e,Ie,ze,St,sr,xt;let Wt;r!=null&&r.parent?(this.parent=r.parent,Wt=r.parent,this.registers={}):(Wt=$($({},rc()),(a=r==null?void 0:r.from)!=null?a:{}),this.registers=Wt.registers),Wt.atomIdsSettings&&(this.atomIdsSettings=$({},Wt.atomIdsSettings)),this.renderPlaceholder=Wt.renderPlaceholder,this.isPhantom=(v=(f=r==null?void 0:r.isPhantom)!=null?f:(u=this.parent)==null?void 0:u.isPhantom)!=null?v:!1,this.letterShapeStyle=Wt.letterShapeStyle,this.minFontScale=Wt.minFontScale,n!=null&&n.color&&n.color!=="none"?this.color=n.color:this.color=(C=(A=this.parent)==null?void 0:A.color)!=null?C:"",n!=null&&n.backgroundColor&&n.backgroundColor!=="none"?this.backgroundColor=n.backgroundColor:this.backgroundColor=(z=(P=this.parent)==null?void 0:P.backgroundColor)!=null?z:"",n!=null&&n.fontSize&&n.fontSize!=="auto"&&n.fontSize!==((Q=this.parent)==null?void 0:Q.size)?this.size=n.fontSize:this.size=(Ie=(_e=this.parent)==null?void 0:_e.size)!=null?Ie:jl;let hr=(St=(ze=this.parent)==null?void 0:ze.mathstyle)!=null?St:La.displaystyle;if(typeof(r==null?void 0:r.mathstyle)=="string"){if(Wt instanceof Cp)switch(r.mathstyle){case"cramp":hr=hr.cramp;break;case"superscript":hr=hr.sup;break;case"subscript":hr=hr.sub;break;case"numerator":hr=hr.fracNum;break;case"denominator":hr=hr.fracDen;break}switch(r.mathstyle){case"textstyle":hr=La.textstyle;break;case"displaystyle":hr=La.displaystyle;break;case"scriptstyle":hr=La.scriptstyle;break;case"scriptscriptstyle":hr=La.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=hr,this.smartFence=Wt.smartFence,this.placeholderSymbol=Wt.placeholderSymbol,this.colorMap=(sr=Wt.colorMap)!=null?sr:Zt=>Zt,this.backgroundColorMap=(xt=Wt.backgroundColorMap)!=null?xt:Zt=>Zt,this.getMacro=Wt.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const r=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,r}scale(r){return r*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===ec||this.mathstyle.id===v0}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(pl[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(r){var n;if((n=this.registers)!=null&&n[r])return this.registers[r];if(this.parent)return this.parent.getRegister(r)}getRegisterAsNumber(r){const n=this.getRegister(r);if(typeof n=="number")return n;if(typeof n=="string")return Number(n)}getRegisterAsGlue(r){var n;if((n=this.registers)!=null&&n[r]){const a=this.registers[r];return typeof a=="object"&&"glue"in a?a:typeof a=="object"&&"dimension"in a?{glue:{dimension:a.dimension}}:typeof a=="number"?{glue:{dimension:a}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(r)}getRegisterAsEm(r,n){return Wc(this.getRegisterAsDimension(r),n)}getRegisterAsDimension(r){var n;if((n=this.registers)!=null&&n[r]){const a=this.registers[r];return typeof a=="object"&&"glue"in a?a.glue:typeof a=="object"&&"dimension"in a?a:typeof a=="number"?{dimension:a}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(r)}setRegister(r,n){if(n===void 0){delete this.registers[r];return}this.registers[r]=n}evaluate(r){if(!r||!("register"in r))return r;let n=this;if("global"in r&&r.global)for(;n.parent;)n=n.parent;let a=1;"factor"in r&&r.factor!==1&&r.factor!==void 0&&(a=r.factor);const u=n.getRegister(r.register);if(u===void 0)return;if(typeof u=="string")return{string:Number(u).toString()+u};if(typeof u=="number")return{number:a*u};const f=n.evaluate(u);if(f!==void 0)return"string"in f?{string:Number(u).toString()+f.string}:"number"in f?{number:a*f.number}:"dimension"in f?d($({},f),{dimension:a*f.dimension}):"glue"in f?d($({},f),{glue:d($({},f.glue),{dimension:a*f.glue.dimension}),shrink:f.shrink?d($({},f.shrink),{dimension:a*f.shrink.dimension}):void 0,grow:f.grow?d($({},f.grow),{dimension:a*f.grow.dimension}):void 0}):r}toDimension(r){const n=this.evaluate(r);return n===void 0?null:"dimension"in n?n:"glue"in n?n.glue:"number"in n?{dimension:n.number}:null}toEm(r,n){if(r===null)return 0;const a=this.toDimension(r);return a===null?0:Vc(a,n)/xa}toNumber(r){if(r===null)return null;const n=this.evaluate(r);return n===void 0?null:"number"in n?n.number:"dimension"in n?n.dimension:"glue"in n?n.glue.dimension:"string"in n?Number(n.string):null}toColor(r){var n,a;if(r===null)return null;const u=this.evaluate(r);return u===void 0?null:"string"in u?(a=(n=this.colorMap)==null?void 0:n.call(this,u.string))!=null?a:u.string:null}toBackgroundColor(r){var n,a;if(r===null)return null;const u=this.evaluate(r);return u===void 0?null:"string"in u?(a=(n=this.backgroundColorMap)==null?void 0:n.call(this,u.string))!=null?a:u.string:null}},bl=["body","above","below","superscript","subscript"];function _l(e){return typeof e=="string"&&bl.includes(e)}function b0(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var $t=class Ll{constructor(r){var n,a,u,f,v,A;this.type=r.type,typeof r.value=="string"&&(this.value=r.value),this.command=(a=(n=r.command)!=null?n:this.value)!=null?a:"",this.mode=(u=r.mode)!=null?u:"math",r.isFunction&&(this.isFunction=!0),r.limits&&(this.subsupPlacement=r.limits),this.style=$({},r.style),this.displayContainsHighlight=(f=r.displayContainsHighlight)!=null?f:!1,this.captureSelection=(v=r.captureSelection)!=null?v:!1,this.skipBoundary=(A=r.skipBoundary)!=null?A:!1,r.verbatimLatex!==void 0&&r.verbatimLatex!==null&&(this.verbatimLatex=r.verbatimLatex),r.args&&(this.args=r.args),r.body&&(this.body=r.body),this._changeCounter=0}static createBox(r,n,a){var u;if(!n)return null;const f=nd(n),v=[];for(const C of f){const P=C[0].style,z=jc(r,C,{style:{color:P.color,backgroundColor:P.backgroundColor,fontSize:P.fontSize}});z&&v.push(z)}if(v.length===0)return null;const A=((u=a==null?void 0:a.classes)!=null?u:"").trim();return v.length===1&&!A&&!(a!=null&&a.type)?v[0].wrap(r):new ur(v,{classes:A,type:a==null?void 0:a.type}).wrap(r)}static serialize(r,n){return Ns.serialize(r,n)}static commonAncestor(r,n){if(r===n||r.parent===n.parent)return r.parent;const a=new WeakSet;let{parent:u}=r;for(;u;)a.add(u),u=u.parent;for(u=n.parent;u;){if(a.has(u))return u;u=u.parent}console.assert(!!u)}static fromJson(r){return typeof r=="string"?new Ll({type:"mord",value:r,mode:"math"}):new Ll(r)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const r={};if(this.type&&(r.type=this.type),this.mode!=="math"&&(r.mode=this.mode),this.command&&this.command!==this.value&&(r.command=this.command),this.value!==void 0&&(r.value=this.value),this.style&&Object.keys(this.style).length>0&&(r.style=$({},this.style)),this.verbatimLatex!==void 0&&(r.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(r.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(r.explicitSubsupPlacement=!0),this.isFunction&&(r.isFunction=!0),this.displayContainsHighlight&&(r.displayContainsHighlight=!0),this.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),this.skipBoundary&&(r.skipBoundary=!0),this.captureSelection&&(r.captureSelection=!0),this.args&&(r.args=sd(this.args)),this._branches)for(const n of Object.keys(this._branches))this._branches[n]&&(r[n]=this._branches[n].filter(a=>a.type!=="first").map(a=>a.toJson()));return r.type==="mord"&&Object.keys(r).length===2&&"value"in r?r.value:r}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(r){if(r){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:n}=this;for(;n;)n.parent||n._changeCounter++,"verbatimLatex"in n&&(n.verbatimLatex=void 0),n._children=void 0,n=n.parent}}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=it(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):this.body&&this.command?Xi([Kn(this.command,this.bodyToLatex(r)),this.supsubToLatex(r)]):this.body?Xi([this.bodyToLatex(r),this.supsubToLatex(r)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(r){var n;return Ns.serialize(this.body,d($({},r),{defaultMode:(n=r.defaultMode)!=null?n:this.latexMode}))}aboveToLatex(r){return Ns.serialize(this.above,r)}belowToLatex(r){return Ns.serialize(this.below,r)}supsubToLatex(r){let n="";if(r=d($({},r),{defaultMode:"math"}),this.branch("subscript")!==void 0){const a=Ns.serialize(this.subscript,r);a.length===0?n+="_{}":a.length===1?/^[0-9]$/.test(a)?n+=`_${a}`:n+=`_{${a}}`:n+=`_{${a}}`}if(this.branch("superscript")!==void 0){const a=Ns.serialize(this.superscript,r);a.length===0?n+="^{}":a.length===1?a==="\u2032"?n+="^\\prime ":a==="\u2033"?n+="^\\doubleprime ":/^[0-9]$/.test(a)?n+=`^${a}`:n+=`^{${a}}`:n+=`^{${a}}`}return n}get treeDepth(){let r=1,n=this.parent;for(;n;)n=n.parent,r+=1;return r}get inCaptureSelection(){let r=this;for(;r;){if(r.captureSelection)return!0;r=r.parent}return!1}get parentPrompt(){let r=this.parent;for(;r;){if(r.type==="prompt"&&!r.captureSelection)return r;r=r.parent}return null}branch(r){if(_l(r)&&this._branches)return this._branches[r]}get branches(){if(!this._branches)return[];const r=[];for(const n of bl)this._branches[n]&&r.push(n);return r}createBranch(r){return console.assert(_l(r)),_l(r)?(this._branches?this._branches[r]||(this._branches[r]=[this.makeFirstAtom(r)]):this._branches={[r]:[this.makeFirstAtom(r)]},this.isDirty=!0,this._branches[r]):[]}get row(){return b0(this.parentBranch)?this.parentBranch[0]:-1}get col(){return b0(this.parentBranch)?this.parentBranch[1]:-1}get body(){var r;return(r=this._branches)==null?void 0:r.body}set body(r){this.setChildren(r,"body")}get superscript(){var r;return(r=this._branches)==null?void 0:r.superscript}set superscript(r){this.setChildren(r,"superscript")}get subscript(){var r;return(r=this._branches)==null?void 0:r.subscript}set subscript(r){this.setChildren(r,"subscript")}get above(){var r;return(r=this._branches)==null?void 0:r.above}set above(r){this.setChildren(r,"above")}get below(){var r;return(r=this._branches)==null?void 0:r.below}set below(r){this.setChildren(r,"below")}get computedStyle(){var r,n;const a=typeof this.style.verbatimColor=="string",u=typeof this.style.verbatimBackgroundColor=="string",f=$($({},(n=(r=this.parent)==null?void 0:r.computedStyle)!=null?n:{}),this.style);return delete f.variant,delete f.variantStyle,u||delete f.verbatimBackgroundColor,a||delete f.verbatimColor,f}applyStyle(r){this.isDirty=!0,this.style=$($({},this.style),r),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const n of this.children)n.applyStyle(r)}getInitialBaseElement(){var r,n,a;return this.hasEmptyBranch("body")?this:(console.assert(((r=this.body)==null?void 0:r[0].type)==="first"),(a=(n=this.body[1])==null?void 0:n.getInitialBaseElement())!=null?a:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(r){const n=this.branch(r);return n?(console.assert(n.length>0),console.assert(n[0].type==="first"),n.length===1):!0}setChildren(r,n){var a;if(!r||(console.assert(_l(n)),!_l(n)))return;console.assert(((a=r[0])==null?void 0:a.type)!=="first");const u=[this.makeFirstAtom(n),...r];this._branches?this._branches[n]=u:this._branches={[n]:u};for(const f of r)f.parent=this,f.parentBranch=n;this.isDirty=!0}makeFirstAtom(r){const n=new Ll({type:"first",mode:this.mode});return n.parent=this,n.parentBranch=r,n}addChild(r,n){console.assert(r.type!=="first"),this.createBranch(n).push(r),this.isDirty=!0,r.parent=this,r.parentBranch=n}addChildBefore(r,n){console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n),0,r),this.isDirty=!0,r.parent=this,r.parentBranch=n.parentBranch}addChildAfter(r,n){console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n)+1,0,r),this.isDirty=!0,r.parent=this,r.parentBranch=n.parentBranch}addChildren(r,n){const a=this.createBranch(n);for(const u of r)u.parent=this,u.parentBranch=n,a.push(u);this.isDirty=!0}addChildrenAfter(r,n){console.assert(r.length===0||r[0].type!=="first"),console.assert(n.parentBranch!==void 0);const a=this.createBranch(n.parentBranch);a.splice(a.indexOf(n)+1,0,...r),this.isDirty=!0;for(const u of r)u.parent=this,u.parentBranch=n.parentBranch;return r[r.length-1]}removeBranch(r){const n=this.branch(r);if(_l(r)&&(this._branches[r]=void 0),!n)return[];for(const a of n)a.parent=void 0,a.parentBranch=void 0;return console.assert(n[0].type==="first"),n.shift(),this.isDirty=!0,n}removeChild(r){if(console.assert(r.parent===this),r.type==="first")return;const n=this.branch(r.parentBranch),a=n.indexOf(r);console.assert(a>=0),n.splice(a,1),this.isDirty=!0,r.parent=void 0,r.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:r}=this;return r[r.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const r=this.parent.branch(this.parentBranch);return r[r.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const r=this.parent.branch(this.parentBranch);return r[r.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:r}=this;return r[r.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const r=[];for(const n of bl)if(this._branches[n])for(const a of this._branches[n])r.push(...a.children),r.push(a);return this._children=r,r}render(r){if(this.type==="first"&&!r.atomIdsSettings)return null;const n=it(this.command,this.mode);if(n!=null&&n.render)return n.render(this,r);const a=new qi({parent:r},this.style);let u=this.createBox(a,{classes:this.parent?"":"ML__base"});return u?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(u=this.attachSupsub(a,{base:u})),u.wrap(a)):null}attachSupsub(r,n){var a;const u=n.base,f=this.superscript,v=this.subscript;if(!f&&!v)return u;let A=null,C=null;const P=(a=n.isCharacterBox)!=null?a:this.isCharacterBox();let z=0;if(f){const St=new qi({parent:r,mathstyle:"superscript"});A=Ll.createBox(St,f),P||(z=u.height-r.metrics.supDrop*St.scalingFactor)}let Q=0;if(v){const St=new qi({parent:r,mathstyle:"subscript"});C=Ll.createBox(St,v),P||(Q=u.depth+r.metrics.subDrop*St.scalingFactor)}let _e;r.isDisplayStyle?_e=r.metrics.sup1:r.isCramped?_e=r.metrics.sup3:_e=r.metrics.sup2;const Ie=.5/xa/r.scalingFactor;let ze=null;if(C&&A){z=Math.max(z,_e,A.depth+.25*r.metrics.xHeight),Q=Math.max(Q,r.metrics.sub2);const St=r.metrics.defaultRuleThickness;if(z-A.depth-(C.height-Q)<4*St){Q=4*St-(z-A.depth)+C.height;const xt=.8*r.metrics.xHeight-(z-A.depth);xt>0&&(z+=xt,Q-=xt)}const sr=this.isExtensibleSymbol&&u.italic?-u.italic:0;ze=new gs({individualShift:[{box:C,shift:Q,marginLeft:sr},{box:A,shift:-z}]}).wrap(r)}else C&&!A?(Q=Math.max(Q,r.metrics.sub1,C.height-.8*ha),ze=new gs({shift:Q,children:[{box:C,marginRight:Ie,marginLeft:this.isCharacterBox()?-u.italic:0}]})):!C&&A&&(z=Math.max(z,_e,A.depth+.25*ha),ze=new gs({shift:-z,children:[{box:A,marginRight:Ie}]}));return new ur([u,new ur(ze,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:n.type})}attachLimits(r,n){const a=this.superscript?Ll.createBox(new qi({parent:r,mathstyle:"superscript"},this.style),this.superscript):null,u=this.subscript?Ll.createBox(new qi({parent:r,mathstyle:"subscript"},this.style),this.subscript):null;return!a&&!u?n.base.wrap(r):td(r,d($({},n),{above:a,below:u}))}bind(r,n){if(!n||r.isPhantom||this.value==="\u200B")return n;let a=this.parent;for(;a&&!a.captureSelection;)a=a.parent;return a!=null&&a.captureSelection||(this.id||(this.id=r.makeID()),n.atomID=this.id),n}createBox(r,n){var a,u,f,v;const A=(a=this.value)!=null?a:this.body,C=(u=n==null?void 0:n.boxType)!=null?u:wa(this.type);let P=(f=n==null?void 0:n.classes)!=null?f:"";this.mode==="text"&&(P+=" ML__text");const z=typeof A=="string"||A===void 0?new ur(A!=null?A:null,{type:C,isSelected:this.isSelected,mode:this.mode,maxFontSize:r.scalingFactor,style:d($({variant:"normal"},this.style),{fontSize:Math.max(1,r.size+r.mathstyle.sizeDelta)}),letterShapeStyle:r.letterShapeStyle,classes:P}):(v=Ll.createBox(r,A,{type:C,classes:P}))!=null?v:new ur(null);return r.isTight&&(z.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(z.italic=0),z.right=z.italic,this.bind(r,z),this.caret&&!this.superscript&&!this.subscript&&(z.caret=this.caret),z}isDigit(){var r;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((r=this.body)==null?void 0:r.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var r;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((r=this.body)==null?void 0:r.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function nd(e){let r;const n=[];let a=[];for(const u of e)if(!r&&!u.style)a.push(u);else{const f=u.computedStyle;r&&f.color===r.color&&f.backgroundColor===r.backgroundColor&&f.fontSize===r.fontSize?a.push(u):(a.length>0&&n.push(a),a=[u],r=f)}return a.length>0&&n.push(a),n}function jc(e,r,n){var a,u,f,v,A;if(!r||r.length===0)return null;const C=new qi({parent:e},n.style),P=!((a=C.atomIdsSettings)!=null&&a.groupNumbers);let z=[];if(r.length===1){const _e=r[0],Ie=_e.render(C);Ie&&(P&&_e.isSelected&&Ie.selected(!0),z=[Ie])}else{let _e="",Ie=!0;for(const ze of r){(u=C.atomIdsSettings)!=null&&u.groupNumbers&&_e&&(Ie&&ze.isDigit()||!Ie&&ic(ze))&&(C.atomIdsSettings.overrideID=_e);const St=ze.render(C);C.atomIdsSettings&&(C.atomIdsSettings.overrideID=void 0),St&&((f=C.atomIdsSettings)!=null&&f.groupNumbers&&((ze.isDigit()||ic(ze))&&(!_e||Ie!==ze.isDigit())&&(Ie=ze.isDigit(),_e=(v=ze.id)!=null?v:""),_e&&(!(ze.isDigit()||ic(ze))||!ze.hasEmptyBranch("superscript")||!ze.hasEmptyBranch("subscript"))&&(_e="")),P&&ze.isSelected&&St.selected(!0),z.push(St))}}if(z.length===0)return null;const Q=new ur(z,d($({isTight:C.isTight},n),{type:(A=n.type)!=null?A:"lift"}));return Q.isSelected=z.every(_e=>_e.isSelected),Q.wrap(C)}function ic(e){return e.mode==="text"}function sd(e){return e.map(r=>r===null?"<null>":Array.isArray(r)&&r[0]instanceof $t?{atoms:r.map(n=>n.toJson())}:typeof r=="object"&&"group"in r?{group:r.group.map(n=>n.toJson())}:r)}var Fu=class Dp extends $t{constructor(r,n,a){super({type:"text",command:r,mode:"text",displayContainsHighlight:!0}),this.value=n,this.verbatimLatex=n,this.applyStyle(a)}static fromJson(r){return new Dp(r.command,r.value,r.style)}render(r){const n=this.createBox(r);return this.caret&&(n.caret=this.caret),n}_serialize(r){var n;return(n=this.verbatimLatex)!=null?n:kt("text",this.value.codePointAt(0))}};function ad(e,r){if(e.direction===r.direction){const n=e.ranges.length;if(r.ranges.length===n){let a=0;for(;a<n&&qc(e.ranges[a],r.ranges[a])==="equal";)a++;return a===n?"equal":"different"}}return"different"}function qc(e,r){return e[0]===r[0]&&e[1]===r[1]?"equal":"different"}function Ds(e){let r=1/0,n=-1/0;for(const a of e.ranges)r=Math.min(r,a[0],a[1]),n=Math.max(n,a[0],a[1]);return[r,n]}function pa(e){return typeof e=="number"&&!Number.isNaN(e)}function js(e){return Array.isArray(e)&&e.length===2}function _0(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function Zc(e,r){const n=e.at(r);let a;if(n){a=n.mode;let u=n.parent;for(;!a&&u;)u&&(a=u.mode),u=u.parent}return a}function Yc(e,r){if(!r)return"";if(typeof r=="string")return r;if(!e||r.after===void 0)return r.value;let n=!1,a=!1,u=!1,f=!1,v=!1,A=!1,C=!1,P=!1,z=!1,Q=!1,_e=!1,Ie=!1,ze=!1,St=!1,sr=!1,xt=e[0],Wt=0;for(;xt!=null&&xt.type&&/^(subsup|placeholder)$/.test(xt.type);)Wt+=1,xt=e[Wt];return n=!xt||xt.type==="first",xt&&(St=xt.mode==="text",a=!St&&xt.type==="mord"&&nt.test(xt.value),u=!St&&xt.type==="mord"&&/\d+$/.test(xt.value),f=!St&&xt.isFunction,v=xt.type==="genfrac",A=xt.type==="surd",C=xt.type==="mbin",P=xt.type==="mrel",z=xt.type==="mop"||xt.type==="operator"||xt.type==="extensible-symbol",Q=xt.type==="mpunct"||xt.type==="minner",_e=xt.type==="array",Ie=xt.type==="mopen",ze=xt.type==="mclose"||xt.type==="leftright",sr=xt.type==="space"),r.after.includes("nothing")&&n||r.after.includes("letter")&&a||r.after.includes("digit")&&u||r.after.includes("function")&&f||r.after.includes("frac")&&v||r.after.includes("surd")&&A||r.after.includes("binop")&&C||r.after.includes("relop")&&P||r.after.includes("operator")&&z||r.after.includes("punct")&&Q||r.after.includes("array")&&_e||r.after.includes("openfence")&&Ie||r.after.includes("closefence")&&ze||r.after.includes("text")&&St||r.after.includes("space")&&sr?r.value:""}function Io(e,r,n){return n?Yc(e,n[r]):""}var x0={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function w0(e,r){var n;let a=(n=r==null?void 0:r.format)!=null?n:"auto";return a==="auto"&&([a,e]=S0(e)),a==="ascii-math"?(e=e.replace(/\u2061/gu,""),e=e.replace(/\u3016/gu,"{"),e=e.replace(/\u3017/gu,"}"),e=e.replace(/([^\\])sinx/g,"$1\\sin x"),e=e.replace(/([^\\])cosx/g,"$1\\cos x "),e=e.replace(/\u2013/g,"-"),["ascii-math",qs(e,{inlineShortcuts:r==null?void 0:r.inlineShortcuts})]):["latex",e]}function qs(e,r){var n,a,u;if(!e)return"";let f=!1,v;const A=(n=r.inlineShortcuts)!=null?n:x0;if(!f&&(e.startsWith("^")||e.startsWith("_"))&&(v=Wa(e.slice(1),{inlineShortcuts:A,noWrap:!0}),e=e[0]+"{"+v.match+"}",e+=qs(v.rest,r),f=!0),f||(v=e.match(/^(sqrt|\u221A)(.*)/),v&&(v=Wa(v[2],{inlineShortcuts:A,noWrap:!0}),e="\\sqrt{"+((a=v.match)!=null?a:"\\placeholder{}")+"}",e+=qs(v.rest,r),f=!0)),f||(v=e.match(/^(\\cbrt|\u221B)(.*)/),v&&(v=Wa(v[2],{inlineShortcuts:A,noWrap:!0}),e="\\sqrt[3]{"+((u=v.match)!=null?u:"\\placeholder{}")+"}",e+=qs(v.rest,r),f=!0)),f||(v=e.match(/^abs(.*)/),v&&(v=Wa(v[1],{inlineShortcuts:A,noWrap:!0}),e="\\left|"+v.match+"\\right|",e+=qs(v.rest,r),f=!0)),f||(v=e.match(/^["”“](.*?)["”“](.*)/),v&&(e="\\text{"+v[1]+"}",e+=qs(v[2],r),f=!0)),f||(v=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),v&&(e=Xc(v[1],A),e+=qs(v[2],r),f=!0)),!f&&/^([fgh])[^a-zA-Z]/.test(e)&&(v=Wa(e.slice(1),{inlineShortcuts:A,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+v.match+"\\right)":e[0]+v.match,e+=qs(v.rest,r),f=!0),f||(v=e.match(/^([a-zA-Z]+)(.*)/),v&&(e=Xc(v[1],A),e+=qs(v[2],r),f=!0)),!f)if(v=Wa(e,{inlineShortcuts:A,noWrap:!0}),v.match&&v.rest[0]==="/"){const C=Wa(v.rest.slice(1),{inlineShortcuts:A,noWrap:!0});C.match&&(e="\\frac{"+v.match+"}{"+C.match+"}"+qs(C.rest,r)),f=!0}else v.match&&(e=e.startsWith("(")?"\\left("+v.match+"\\right)"+qs(v.rest,r):v.match+qs(v.rest,r),f=!0);return f||(v=e.match(/^(\s+)(.*)$/),v&&(e=" "+qs(v[2],r),f=!0)),e}function Wa(e,r){let n="";e=e.trim();let a=e,u=e.charAt(0),f={"(":")","{":"}","[":"]"}[u];if(f){let v=1,A=1;for(;A<e.length&&v>0;)e[A]===u&&v++,e[A]===f&&v--,A++;v===0?(r.noWrap&&u==="("?n=qs(e.substring(1,A-1),r):(u==="{"&&f==="}"&&(u="\\{",f="\\}"),n="\\left"+u+qs(e.substring(1,A-1),r)+"\\right"+f),a=e.slice(Math.max(0,A))):(n=e.substring(1,A),a="")}else{let v=e.match(/^([a-zA-Z]+)/);if(v){let A=Io(null,e,r.inlineShortcuts);if(A)return A=A.replace("_{#?}",""),A=A.replace("^{#?}",""),{match:A,rest:e.slice(A.length)}}if(v=e.match(/^([a-zA-Z])/),v)return{match:v[1],rest:e.slice(1)};if(v=e.match(/^(-)?\d+(\.\d*)?/),v)return{match:v[0],rest:e.slice(v[0].length)};/^\\(left|right)/.test(e)||(v=e.match(/^(\\[a-zA-Z]+)/),v&&(a=e.slice(v[1].length),n=v[1]))}return{match:n,rest:a}}function Xc(e,r){let n=Io(null,e,r);return n?(n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),n+=" "):n=e,n}var Jl=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function Po(e){const r=e.trim();for(const n of Jl)if(r.startsWith(n[0])&&r.endsWith(n[1]))return[!0,r.substring(n[0].length,r.length-n[1].length)];return[!1,e]}function S0(e){if(e=e.trim(),e.length<=1)return["latex",e];let r;return[r,e]=Po(e),r?["latex",e]:e.startsWith("`")&&e.endsWith("`")?(e=e.substring(1,e.length-1),["ascii-math",e]):e.includes("\\")?["latex",e]:/\$.+\$/.test(e)?["latex",`\\text{${e}}`]:[void 0,e]}var od="$$",ld="$$",nc=(e,r,n)=>(Jl.some(a=>r.startsWith(a[0])&&r.endsWith(a[1]))||(r=`${od} ${r} ${ld}`),r),sc=class Wh{constructor(r){Wh._modes[r]=this}static onPaste(r,n,a){var u;if(!n.contentEditable&&n.userSelect==="none")return n.model.announce("plonk"),!1;if(typeof a=="string"){const v=new DataTransfer;v.setData("text/plain",a),a=v}const f=new ClipboardEvent("paste",{clipboardData:a,cancelable:!0});return(u=n.host)!=null&&u.dispatchEvent(f)?Wh._modes[r].onPaste(n,a):!1}static copyToClipboard(r,n){if(!r.contentEditable&&r.userSelect==="none"){r.model.announce("plonk");return}const a=r.model,u=a.selectionIsCollapsed?[0,a.lastOffset]:Ds(a.selection),f=a.getValue(u,n);navigator.clipboard.writeText(f).then(()=>{},()=>r.model.announce("plonk"))}static onCopy(r,n){var a;if(!n.clipboardData)return;if(!r.contentEditable&&r.userSelect==="none"){r.model.announce("plonk");return}const u=r.model,f=u.selectionIsCollapsed?[0,u.lastOffset]:Ds(u.selection);let v=u.getAtoms(f);if(v.every(A=>A.mode==="text"||!A.mode))n.clipboardData.setData("text/plain",v.filter(A=>A instanceof Fu).map(A=>A.value).join(""));else if(v.every(A=>A.mode==="latex"))n.clipboardData.setData("text/plain",u.getAtoms(f,{includeChildren:!0}).map(A=>{var C;return(C=A.value)!=null?C:""}).join(""));else{let A;v.length===1&&v[0].verbatimLatex!==void 0?A=v[0].verbatimLatex:A=u.getValue(f,"latex-expanded"),n.clipboardData.setData("application/x-latex",A);try{n.clipboardData.setData("text/plain",r.options.onExport(r,A,f))}catch(C){}if(v.length===1){const C=v[0];(C.type==="root"||C.type==="group")&&(v=C.body.filter(P=>P.type!=="first"))}try{n.clipboardData.setData("application/json+mathlive",JSON.stringify(v.map(C=>C.toJson())))}catch(C){}if((a=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&a.ComputeEngine){const C=window.MathfieldElement.computeEngine;if(C)try{const P=C.jsonSerializationOptions;C.jsonSerializationOptions={metadata:["latex"]};const z=C.parse(u.getValue(f,"latex-unstyled"));C.jsonSerializationOptions=P;const Q=JSON.stringify(z.json);Q&&n.clipboardData.setData("application/json",Q)}catch(P){}}}n.preventDefault()}static insert(r,n,a={}){var u;const f=a.mode==="auto"?r.mode:(u=a.mode)!=null?u:r.mode;return Wh._modes[f].insert(r,n,a)}onPaste(r,n){return!1}insert(r,n,a){return!1}};sc._modes={};var Rn=sc,ac=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],ud={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Oo(e){var r;return((r=e.element)==null?void 0:r.mathfield)===e}function cd(e){var r,n;return(n=(r=e.querySelector(".ML__caret"))!=null?r:e.querySelector(".ML__text-caret"))!=null?n:e.querySelector(".ML__latex-caret")}function Sa(e){const r=cd(e);if(!r)return null;const n=r.getBoundingClientRect();return{x:n.right,y:n.bottom,height:n.height}}function hd(e){var r;if(!e.parent)return"root";let n=(r=e.parent.id)!=null?r:"";return n+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,n}function ja(e,r,n){if(!r)return null;const a=e.field.getBoundingClientRect(),u=r.right-r.left,f=r.bottom-r.top,v=Math.ceil(r.left-a.left+e.field.scrollLeft*n),A=Math.ceil(r.top-a.top);return{left:v,right:v+u,top:A,bottom:A+f}}function Ra(e){const r=e.getBoundingClientRect(),n=parseInt(getComputedStyle(e).marginRight),a={top:r.top-1,bottom:r.bottom,left:r.left,right:r.right-1+n};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return a;for(const u of e.children)if(u.nodeType===1&&"atomId"in u.dataset&&!u.classList.contains("pstrut")){const f=Ra(u);a.left=Math.min(a.left,f.left),a.right=Math.max(a.right,f.right),a.top=Math.min(a.top,f.top),a.bottom=Math.max(a.bottom,f.bottom)}return a}function Ql(e,r){var n,a;if(!r.id)return null;let u=(a=(n=e.atomBoundsCache)==null?void 0:n.get(r.id))!=null?a:null;if(u!==null)return u;const f=e.field.querySelector(`[data-atom-id="${r.id}"]`);return u=f?Ra(f):null,e.atomBoundsCache&&(u?e.atomBoundsCache.set(r.id,u):e.atomBoundsCache.delete(r.id)),u!=null?u:null}function dd(e,r,n){const a=new Map;for(const u of e.model.getAtoms(r,{includeChildren:!0})){if(n!=null&&n.excludeAtomsWithBackground&&u.style.backgroundColor)continue;const f=e.field,v=f.offsetWidth;let C=Math.floor(f.getBoundingClientRect().width)/v;C=isNaN(C)?1:C;const P=ja(e,Ql(e,u),C);if(P){const z=hd(u);if(a.has(z)){const Q=a.get(z);a.set(z,{left:Math.min(Q.left,P.left),right:Math.max(Q.right,P.right),top:Math.min(Q.top,P.top),bottom:Math.max(Q.bottom,P.bottom)})}else a.set(z,P)}}return[...a.values()]}function oc(e,r){return e.model.selection.ranges.reduce((n,a)=>n.concat(...dd(e,a,r)),[])}function lc(e,r){return e==="*"||r==="none"?!0:r==="same-origin"?!window.origin||e===window.origin:typeof r=="function"?r(e):!1}function Jc(e){let r=0,n=0;const a=e.offsetWidth,u=e.offsetHeight;for(;e instanceof HTMLElement;)r+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return new DOMRect(n,r,a,u)}var fd=`@keyframes ML__caret-blink {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.ML__container {
display: inline-flex;
flex-flow: row;
justify-content: space-between;
align-items: flex-end;
min-height: 39px;
/* Need some room for the virtual keyboard toggle */
width: 100%;
/* Encourage browsers to consider allocating a hardware accelerated
layer for this element. */
isolation: isolate;
/* Prevent the browser from trying to interpret touch gestures in the field */
/* "Disabling double-tap to zoom removes the need for browsers to
delay the generation of click events when the user taps the screen." */
touch-action: none;
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
--_selection-color: var(--selection-color, #000);
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
--_smart-fence-color: var(--smart-fence-color, currentColor);
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
--_correct-color: var(--correct-color, #10a000);
--_incorrect-color: var(--incorrect-color, #a01b00);
--_composition-background-color: var(--composition-background-color, #fff1c2);
--_composition-text-color: var(--composition-text-color, black);
--_composition-underline-color: var(--composition-underline-color, transparent);
}
/* This is the actual field content (formula) */
.ML__content {
display: flex;
align-items: center;
align-self: center;
position: relative;
overflow: hidden;
padding: 2px 3px 2px 1px;
width: 100%;
}
.ML__virtual-keyboard-toggle,
.ML__menu-toggle {
box-sizing: border-box;
display: flex;
align-self: center;
align-items: center;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
margin-right: 4px;
cursor: pointer;
/* Avoid some weird blinking with :hover */
border-radius: 8px;
border: 1px solid transparent;
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
color: hsl(var(--_hue), 40%, 50%);
fill: currentColor;
background: transparent;
}
.ML__virtual-keyboard-toggle:hover,
.ML__menu-toggle:hover {
background: hsla(0, 0%, 70%, 0.3);
color: #333;
fill: currentColor;
}
.ML__virtual-keyboard-toggle > span,
.ML__menu-toggle > span {
display: flex;
align-self: center;
align-items: center;
}
/* The invisible element used to capture keyboard events. We're just trying
really hard to make sure it doesn't show. */
.ML__keyboard-sink {
display: inline-block;
resize: none;
outline: none;
border: none;
/* Need these for Microsoft Edge */
position: fixed;
clip: rect(0 0 0 0);
/* Need this to prevent iOS Safari from auto-zooming */
font-size: 1em;
font-family: KaTeX_Main;
line-height: 0.5;
/* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
color: var(--neutral-400);
}
.ML__composition {
background: var(--_composition-background-color);
color: var(--_composition-text-color);
text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
content: '';
visibility: hidden;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_latex-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.019em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
visibility: visible;
}
.ML__focused .ML__text {
background: var(--_text-highlight-background-color);
}
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: var(--_smart-fence-opacity);
color: var(--_smart-fence-color);
}
.ML__selected,
.ML__focused .ML__selected .ML__contains-caret,
.ML__focused .ML__selected .ML__smart-fence__close,
.ML__focused .ML__selected .ML__placeholder {
color: var(--_selection-color);
opacity: 1;
}
.ML__selection {
box-sizing: border-box;
background: var(--_selection-background-color) !important;
}
.ML__contains-caret.ML__close,
.ML__contains-caret.ML__open,
.ML__contains-caret > .ML__close,
.ML__contains-caret > .ML__open,
.ML__contains-caret .ML__sqrt-sign,
.ML__contains-caret .ML__sqrt-line {
color: var(--_caret-color);
}
.ML__contains-highlight {
box-sizing: border-box;
background: transparent;
}
.ML__focused .ML__contains-highlight {
background: var(--_contains-highlight-background-color);
}
.ML__raw-latex {
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-weight: 400;
font-size: 0.8em;
letter-spacing: -0.05em;
color: var(--_latex-color);
}
.ML__suggestion {
color: var(--neutral-500);
}
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
.ML__virtual-keyboard-toggle:focus {
outline: none;
border-radius: 8px;
border: 2px solid hsl(var(--_hue), 40%, 50%);
}
.ML__virtual-keyboard-toggle.is-pressed,
.ML__virtual-keyboard-toggle.is-active:hover,
.ML__virtual-keyboard-toggle.is-active {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
*/
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
display: block;
z-index: 2;
pointer-events: none;
right: auto;
top: calc(-100% - 4px);
width: max-content;
max-width: 200px;
padding: 8px 8px;
border-radius: 4px;
background: #616161;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-align: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 13px;
/* Phone */
opacity: 0;
transform: scale(0.5);
}
@media only screen and (max-width: 767px) {
[data-tooltip]::after {
padding: 8px 16px;
font-size: 16px;
}
}
menu [data-tooltip]::after {
left: 100%;
top: 0%;
}
menu .ML__base {
cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
visibility: visible;
opacity: 1;
transform: scale(1);
transition-property: opacity, scale;
transition-duration: 0.15s;
transition-delay: 1s;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__prompt {
border-radius: 2px;
}
.ML__editablePromptBox {
outline: 1px solid #acacac;
border-radius: 2px;
z-index: -1;
}
.ML__focusedPromptBox {
outline: highlight auto 1px;
}
.ML__lockedPromptBox {
background-color: rgba(142, 142, 141, 0.4);
z-index: -1;
}
.ML__correctPromptBox {
outline: 1px solid var(--_correct-color);
box-shadow: 0 0 5px var(--_correct-color);
}
.ML__incorrectPromptBox {
outline: 1px solid var(--_incorrect-color);
box-shadow: 0 0 5px var(--_incorrect-color);
}
.variant-submenu {
display: flex;
flex-direction: column;
padding: 8px;
}
.variant-submenu [part=menu-item] {
font-size: 2rem;
text-align: center;
margin: 0;
}
.insert-matrix-submenu {
display: grid;
padding: 8px;
align-content: center;
justify-content: center;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
font-size: 21px;
border: none;
border-radius: 0;
line-height: 21px;
text-align: center;
padding: 0;
margin: 0;
}
.border-submenu [part=menu-item] {
font-size: 2rem;
line-height: 1.2;
text-align: center;
}
.swatches-submenu {
--_swatch-size: 2rem;
--_columns: 4;
display: flex;
flex-flow: wrap;
padding: 8px;
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
box-sizing: border-box;
}
.menu-swatch {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: fit-content;
height: fit-content;
margin: 2px;
padding: 0;
background: var(--neutral-200);
}
.menu-swatch > .label {
padding: 0;
margin: 0;
line-height: 0;
}
.menu-swatch > .label > span {
display: inline-block;
margin: 6px;
min-width: var(--_swatch-size);
min-height: var(--_swatch-size);
border-radius: 50%;
}
.menu-swatch.active {
background: var(--neutral-100);
scale: 1.4;
}
.menu-swatch.active > .label > span {
border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
position: absolute;
margin: 0;
padding: 0;
color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
color: #000;
}
`,Qc=`.ML__container {
min-height: auto !important;
--_hue: var(--hue, 212);
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
}
.ML__sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.ML__is-inline {
display: inline-block;
}
.ML__base {
visibility: inherit;
display: inline-block;
position: relative;
cursor: text;
padding: 0;
margin: 0;
box-sizing: content-box;
border: 0;
outline: 0;
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
text-decoration: none;
width: min-content;
}
.ML__strut,
.ML__strut--bottom {
display: inline-block;
min-height: 0.5em;
}
.ML__small-delim {
font-family: KaTeX_Main;
}
/* Text mode */
.ML__text {
font-family: var(--_text-font-family);
white-space: pre;
}
/* Use cmr for 'math upright' */
.ML__cmr {
font-family: KaTeX_Main;
font-style: normal;
}
.ML__mathit {
font-family: KaTeX_Math;
/* The KaTeX_Math font is italic by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
}
.ML__mathbf {
font-family: KaTeX_Main;
font-weight: bold;
}
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: KaTeX_Math;
font-weight: normal;
}
.ML__mathbfit {
font-family: KaTeX_Math;
font-weight: bold;
font-style: italic;
}
.ML__ams {
font-family: KaTeX_AMS;
}
/* Blackboard */
.ML__bb {
font-family: KaTeX_AMS;
}
.ML__cal {
font-family: KaTeX_Caligraphic;
}
.ML__frak {
font-family: KaTeX_Fraktur;
}
.ML__tt {
font-family: KaTeX_Typewriter;
}
.ML__script {
font-family: KaTeX_Script;
}
.ML__sans {
font-family: KaTeX_SansSerif;
}
.ML__series_ul {
font-weight: 100;
}
.ML__series_el {
font-weight: 100;
}
.ML__series_l {
font-weight: 200;
}
.ML__series_sl {
font-weight: 300;
}
.ML__series_sb {
font-weight: 500;
}
.ML__bold,
.ML__boldsymbol {
font-weight: 700;
}
.ML__series_eb {
font-weight: 800;
}
.ML__series_ub {
font-weight: 900;
}
.ML__series_uc {
font-stretch: ultra-condensed;
}
.ML__series_ec {
font-stretch: extra-condensed;
}
.ML__series_c {
font-stretch: condensed;
}
.ML__series_sc {
font-stretch: semi-condensed;
}
.ML__series_sx {
font-stretch: semi-expanded;
}
.ML__series_x {
font-stretch: expanded;
}
.ML__series_ex {
font-stretch: extra-expanded;
}
.ML__series_ux {
font-stretch: ultra-expanded;
}
.ML__it {
font-style: italic;
}
.ML__shape_ol {
-webkit-text-stroke: 1px black;
text-stroke: 1px black;
color: transparent;
}
.ML__shape_sc {
font-variant: small-caps;
}
.ML__shape_sl {
font-style: oblique;
}
/* First level emphasis */
.ML__emph {
color: #bc2612;
}
/* Second level emphasis */
.ML__emph .ML__emph {
color: #0c7f99;
}
.ML__highlight {
color: #007cb2;
background: #edd1b0;
}
.ML__center {
text-align: center;
}
.ML__label_padding {
padding: 0 0.5em;
}
.ML__frac-line {
width: 100%;
min-height: 1px;
}
.ML__frac-line:after {
content: '';
display: block;
margin-top: max(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but that workaround
broke in Chrome 84 or so.
Setting the background (and the min-height) seems to work for now.
*/
background: currentColor;
box-sizing: content-box;
/* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt {
display: inline-block;
}
.ML__sqrt-sign {
display: inline-block;
position: relative;
}
.ML__sqrt-line {
display: inline-block;
height: max(1px, 0.04em);
width: 100%;
}
.ML__sqrt-line:before {
content: '';
display: block;
margin-top: min(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background: currentColor;
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt-line:after {
border-bottom-width: 1px;
content: ' ';
display: block;
margin-top: -0.1em;
}
.ML__sqrt-index {
margin-left: 0.27777778em;
margin-right: -0.55555556em;
}
.ML__delim-size1 {
font-family: KaTeX_Size1;
}
.ML__delim-size2 {
font-family: KaTeX_Size2;
}
.ML__delim-size3 {
font-family: KaTeX_Size3;
}
.ML__delim-size4 {
font-family: KaTeX_Size4;
}
.ML__delim-mult .delim-size1 > span {
font-family: KaTeX_Size1;
}
.ML__delim-mult .delim-size4 > span {
font-family: KaTeX_Size4;
}
.ML__accent-body > span {
font-family: KaTeX_Main;
width: 0;
}
.ML__accent-vec {
position: relative;
left: 0.24em;
}
/** The markup for a LaTeX formula, either in an editable mathfield or
in a static display.
*/
.ML__latex {
display: inline-block;
direction: ltr;
text-align: left;
text-indent: 0;
text-rendering: auto;
font-family: KaTeX_Main, 'Times New Roman', serif;
font-style: normal;
font-size-adjust: none;
font-stretch: normal;
font-variant-caps: normal;
letter-spacing: normal;
line-height: 1.2;
word-wrap: normal;
word-spacing: normal;
white-space: nowrap;
text-shadow: none;
-webkit-user-select: none;
user-select: none;
width: min-content;
}
.ML__latex .style-wrap {
position: relative;
}
.ML__latex .mfrac {
display: inline-block;
}
.ML__latex .left-right {
display: inline-block;
}
.ML__latex .vlist-t {
display: inline-table;
table-layout: fixed;
border-collapse: collapse;
}
.ML__latex .vlist-r {
display: table-row;
}
.ML__latex .vlist {
display: table-cell;
vertical-align: bottom;
position: relative;
}
.ML__latex .vlist > span {
display: block;
height: 0;
position: relative;
}
.ML__latex .vlist > span > span {
display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
overflow: hidden;
width: 0;
}
.ML__latex .vlist-t2 {
margin-right: -2px;
}
.ML__latex .vlist-s {
display: table-cell;
vertical-align: bottom;
font-size: 1px;
width: 2px;
min-width: 2px;
}
.ML__latex .msubsup {
text-align: left;
}
.ML__latex .negativethinspace {
display: inline-block;
margin-left: -0.16667em;
height: 0.71em;
}
.ML__latex .thinspace {
display: inline-block;
width: 0.16667em;
height: 0.71em;
}
.ML__latex .mediumspace {
display: inline-block;
width: 0.22222em;
height: 0.71em;
}
.ML__latex .thickspace {
display: inline-block;
width: 0.27778em;
height: 0.71em;
}
.ML__latex .enspace {
display: inline-block;
width: 0.5em;
height: 0.71em;
}
.ML__latex .quad {
display: inline-block;
width: 1em;
height: 0.71em;
}
.ML__latex .qquad {
display: inline-block;
width: 2em;
height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
width: 0;
position: relative;
display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
display: inline-block;
}
.ML__latex .llap > .inner {
right: 0;
}
.ML__latex .rlap > .inner {
left: 0;
}
.ML__latex .rule {
display: inline-block;
border: solid 0;
position: relative;
box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .underline .underline-line:before {
content: '';
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: block;
}
.ML__latex .overline .overline-line:after,
.ML__latex .underline .underline-line:after {
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
content: '';
display: block;
margin-top: -1px;
}
.ML__latex .stretchy {
display: block;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
content: '';
}
.ML__latex .stretchy svg {
display: block;
position: absolute;
width: 100%;
height: inherit;
fill: currentColor;
stroke: currentColor;
fill-rule: nonzero;
fill-opacity: 1;
stroke-width: 1;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-opacity: 1;
}
.ML__latex .slice-1-of-2 {
display: inline-flex;
position: absolute;
left: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-2-of-2 {
display: inline-flex;
position: absolute;
right: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-1-of-3 {
display: inline-flex;
position: absolute;
left: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-2-of-3 {
display: inline-flex;
position: absolute;
left: 25%;
width: 50%;
overflow: hidden;
}
.ML__latex .slice-3-of-3 {
display: inline-flex;
position: absolute;
right: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-1-of-1 {
display: inline-flex;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .nulldelimiter {
display: inline-block;
}
.ML__latex .op-group {
display: inline-block;
}
.ML__latex .op-symbol {
position: relative;
}
.ML__latex .op-symbol.small-op {
font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
display: inline-block;
min-width: 1px;
box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
text-align: left;
}
.ML__latex .mtable .col-align-r > .vlist-t {
text-align: right;
}
.ML__error {
display: inline-block;
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
background-color: hsla(341, 100%, 40%, 0.1);
background-repeat: repeat-x;
background-size: 3px 3px;
padding-bottom: 3px;
background-position: 0 100%;
}
.ML__error > .ML__error {
background: transparent;
padding: 0;
}
.ML__placeholder {
color: var(--_placeholder-color);
opacity: var(--_placeholder-opacity);
padding-left: 0.4ex;
padding-right: 0.4ex;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.ML__notation {
position: absolute;
box-sizing: border-box;
line-height: 0;
}
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
For UI elements, see \`[data-ML__tooltip]\`
*/
.ML__tooltip-container {
position: relative;
transform: scale(0);
}
.ML__tooltip-container .ML__tooltip-content {
position: fixed;
display: inline-table;
visibility: hidden;
z-index: 2;
width: max-content;
max-width: 400px;
padding: 12px 12px;
border-radius: 8px;
background: #616161;
--_selection-color: #fff;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
}
.ML__tooltip-container .ML__tooltip-content .ML__text {
white-space: normal;
}
.ML__tooltip-container .ML__tooltip-content .ML__base {
display: contents;
}
.ML__tooltip-container:hover .ML__tooltip-content {
visibility: visible;
opacity: 1;
font-size: 0.75em;
transform: scale(1) translate(0, 3em);
}
`,Ia=`#mathlive-environment-popover.is-visible {
visibility: visible;
}
#mathlive-environment-popover {
--_environment-panel-height: var(--environment-panel-height, 70px);
--_accent-color: var(--accent-color, #aaa);
--_background: var(--environment-panel-background, #fff);
--_button-background: var(--environment-panel-button-background, white);
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
--_button-text: var(--environment-panel-button-text, #e3e4e8);
position: absolute;
width: calc(var(--_environment-panel-height) * 2);
height: var(--_environment-panel-height);
border-radius: 4px;
border: 1.5px solid var(--_accent-color);
background-color: var(--_background);
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
pointer-events: all;
visibility: hidden;
}
#mathlive-environment-popover .MLEP__array-buttons {
height: calc(var(--_environment-panel-height) * 5/4);
width: calc(var(--_environment-panel-height) * 5/4);
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
}
#mathlive-environment-popover .MLEP__array-buttons .font {
fill: white;
}
#mathlive-environment-popover .MLEP__array-buttons circle {
fill: #7f7f7f;
transition: fill 300ms;
}
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
fill-opacity: 1;
fill: var(--_background);
stroke: var(--_accent-color);
stroke-width: 3px;
}
#mathlive-environment-popover .MLEP__array-buttons line {
stroke: var(--_accent-color);
stroke-opacity: 0;
stroke-width: 40;
pointer-events: none;
transition: stroke-opacity 300ms;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
fill: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
stroke-opacity: 1;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
height: 100%;
width: 50%;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
width: var(--_environment-panel-height);
height: var(--_environment-panel-height);
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
pointer-events: all;
margin-top: 2px;
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
height: calc(var(--_environment-panel-height) / 3 - 2px);
border-radius: calc(var(--_environment-panel-height) / 25);
background-color: var(--_button-background);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
background-color: var(--_button-background-hover);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
stroke: var(--_button-text);
stroke-width: 2;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
fill-opacity: 0;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
pointer-events: none;
background-color: var(--_button-background-active);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
stroke: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
fill: var(--_accent-color);
}
`,ho=`/* The element that display info while in latex mode */
#mathlive-suggestion-popover {
background-color: rgba(97, 97, 97);
color: #fff;
text-align: center;
border-radius: 8px;
position: fixed;
z-index: 1;
display: none;
flex-direction: column;
justify-content: center;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
#mathlive-suggestion-popover.top-tip::after {
content: '';
position: absolute;
top: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.bottom-tip::after {
content: '';
position: absolute;
bottom: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.is-animated {
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
}
#mathlive-suggestion-popover.is-visible {
display: flex;
}
@keyframes ML__fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The wrapper class for the entire content of the popover panel */
#mathlive-suggestion-popover ul {
display: flex;
flex-flow: column;
list-style: none;
margin: 0;
padding: 0;
align-items: flex-start;
max-height: 400px;
overflow-y: auto;
}
#mathlive-suggestion-popover li {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 8px;
padding: 8px;
width: calc(100% - 16px - 16px);
column-gap: 1em;
border-radius: 8px;
cursor: pointer;
/* Since the content can be clicked on, provide feedback on hover */
}
#mathlive-suggestion-popover li a {
color: #5ea6fd;
padding-top: 0.3em;
margin-top: 0.4em;
display: block;
}
#mathlive-suggestion-popover li a:hover {
color: #5ea6fd;
text-decoration: underline;
}
#mathlive-suggestion-popover li:hover,
#mathlive-suggestion-popover li.is-pressed,
#mathlive-suggestion-popover li.is-active {
background: rgba(255, 255, 255, 0.1);
}
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
.ML__popover__command {
font-size: 1.6rem;
font-family: KaTeX_Main;
}
.ML__popover__current {
background: #5ea6fd;
color: #fff;
}
.ML__popover__latex {
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
align-self: center;
}
/* The keyboard shortcuts for a symbol as displayed in the popover */
.ML__popover__keybinding {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 0.8em;
opacity: 0.7;
}
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}
`,pd=`/* The element that displays the keys as the user type them */
#mathlive-keystroke-caption-panel {
visibility: hidden;
/*min-width: 160px;*/
/*background-color: rgba(97, 97, 200, .95);*/
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
border-color: var(--secondary-border, hsl(0, 0%, 91%));
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
border-radius: 6px;
padding: 16px;
position: absolute;
z-index: 1;
display: flex;
flex-direction: row-reverse;
justify-content: center;
--keystroke: white;
--on-keystroke: #555;
--keystroke-border: #f7f7f7;
}
@media (prefers-color-scheme: dark) {
body:not([theme='light']) #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
}
body[theme='dark'] #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
#mathlive-keystroke-caption-panel > span {
min-width: 14px;
/*height: 8px;*/
margin: 0 8px 0 0;
padding: 4px;
background-color: var(--keystroke);
color: var(--on-keystroke);
fill: currentColor;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 1em;
border-radius: 6px;
border: 2px solid var(--keystroke-border);
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
}
`,md=`.ML__keyboard {
--_keyboard-height: 0;
--_keyboard-zindex: var(--keyboard-zindex, 105);
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
--_padding-top: var(--keyboard-padding-top, 5px);
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_keycap-height: var(--keycap-height, 60px);
/* Keycap width (incl. margin) */
--_keycap-max-width: var(--keycap-max-width, 100px);
--_keycap-gap: var(--keycap-gap, 8px);
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
--_variant-keycap-length: var(--variant-keycap-length, 70px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
}
.is-math-mode .MLK__rows .if-text-mode,
.is-text-mode .MLK__rows .if-math-mode {
display: none;
}
.if-can-undo,
.if-can-redo,
.if-can-copy,
.if-can-cut,
.if-can-paste {
opacity: 0.4;
pointer-events: none;
}
.can-undo .if-can-undo,
.can-redo .if-can-redo,
.can-copy .if-can-copy,
.can-cut .if-can-cut,
.can-paste .if-can-paste {
opacity: 1;
pointer-events: all;
}
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
}
body > .ML__keyboard.is-visible > .MLK__backdrop {
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
border-top: 1px solid var(--_border);
}
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
box-shadow: none;
border: none;
}
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
transition-property: transform, opacity;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__keyboard {
position: relative;
overflow: hidden;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: var(--_keyboard-zindex);
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
opacity: 1;
transform: none;
pointer-events: none;
}
.ML__keyboard :where(div) {
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
transform: none;
}
.MLK__backdrop {
position: absolute;
bottom: calc(-1 * var(--_keyboard-height));
width: 100%;
height: var(--_keyboard-height);
box-sizing: border-box;
padding-top: var(--_padding-top);
padding-bottom: var(--_padding-bottom);
padding-left: var(--_padding-horizontal);
padding-right: var(--_padding-horizontal);
opacity: 0;
visibility: hidden;
transform: translate(0, 0);
background: var(--_background);
}
.backdrop-is-transparent .MLK__backdrop {
background: transparent;
}
/* If a custom layout has a custom container/backdrop
(backdrop-is-transparent), make sure to let pointer event go through. */
.backdrop-is-transparent .MLK__plate {
background: transparent;
pointer-events: none;
}
/* If a custom layout has a custom container/backdrop, make sure to
allow pointer events on it. */
.backdrop-is-transparent .MLK__layer > div > div {
pointer-events: all;
}
.ML__keyboard.is-visible > .MLK__backdrop {
transform: translate(0, calc(-1 * var(--_keyboard-height)));
opacity: 1;
visibility: visible;
}
.caps-lock-indicator {
display: none;
width: 8px;
height: 8px;
background: #0cbc0c;
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
border-radius: 8px;
right: 8px;
top: 8px;
position: absolute;
}
.ML__keyboard.is-caps-lock .caps-lock-indicator {
display: block;
}
.ML__keyboard.is-caps-lock .shift {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
}
.MLK__plate {
position: absolute;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
padding: 0;
box-sizing: border-box;
container-type: inline-size;
touch-action: none;
-webkit-user-select: none;
user-select: none;
pointer-events: all;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
/* Size of toolbar labels */
font-weight: 400;
text-shadow: none;
}
.ML__box-placeholder {
color: var(--_box-placeholder-color);
}
.MLK__tex {
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__tex-math {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
font-style: italic;
}
.MLK__layer {
display: none;
outline: none;
}
.MLK__layer.is-visible {
display: flex;
flex-flow: column;
}
/* Keyboard layouts are made or rows of keys... */
.MLK__rows {
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
display: flex;
flex-flow: column;
align-items: center;
border-collapse: separate;
clear: both;
border: 0;
margin: 0;
margin-bottom: var(--_keycap-gap);
gap: var(--_keycap-gap);
/* If the styling include, e.g., some shadows, they will be
cut off by the overflow. In that case, set the padding to
compensate. */
padding-left: var(--_row-padding-left);
padding-right: var(--_row-padding-right);
overflow: visible;
touch-action: none;
}
.MLK__rows > .MLK__row {
display: flex;
flex-flow: row;
justify-content: center;
width: 100%;
gap: var(--_keycap-gap);
margin: 0;
padding: 0;
/* For the alignment of the text on some modifiers (e.g. shift) */
/* Extra spacing between two adjacent keys */
}
.MLK__rows > .MLK__row .tex {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
align-items: flex-start;
padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
align-items: flex-end;
padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
width: 0;
}
.MLK__rows > .MLK__row .w5 {
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
font-size: 80%;
padding-top: 10px;
font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
background: transparent;
border: none;
pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
height: 6px;
margin-top: 3px;
margin-bottom: 0;
width: 100%;
border-radius: 0;
border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
background: var(--_toolbar-background);
border: none;
color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__row .action {
color: var(--_keycap-secondary-text);
background: var(--_keycap-secondary-background);
border-color: var(--_keycap-secondary-border);
border-bottom-color: var(--_keycap-secondary-border-bottom);
line-height: 0.8;
font-size: min(1rem, var(--_keycap-small-font-size));
font-weight: 600;
padding: 8px 12px 8px 12px;
}
.MLK__rows > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
background: var(--_keycap-primary-background);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
background: var(--_keycap-primary-background-hover);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
color: white;
}
.MLK__rows > .MLK__row .warning {
background: #cd0030;
color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
width: 24px;
height: 24px;
min-height: 24px;
}
/** A regular keycap
* Use the :where() pseudo-class to give it a very low specifity,
* so that it can be overriden by custom style.
*/
:where(.MLK__rows > .MLK__row div) {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-evenly;
width: calc(var(--_keycap-width) - var(--_keycap-gap));
height: var(--_keycap-height);
box-sizing: border-box;
padding: 0;
vertical-align: top;
text-align: center;
float: left;
color: var(--_keycap-text);
fill: currentColor;
font-size: var(--_keycap-font-size);
background: var(--_keycap-background);
border: 1px solid var(--_keycap-border);
border-bottom-color: var(--_keycap-border-bottom);
border-radius: 6px;
cursor: pointer;
touch-action: none;
/* Keys with a variants panel */
position: relative;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:where(.MLK__rows > .MLK__row div):hover {
overflow: visible;
background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row div) .ML__latex {
pointer-events: none;
touch-action: none;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
margin: 8px 0;
width: 20px;
height: 20px;
min-height: 20px;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
margin: 8px 0;
width: 24px;
height: 24px;
min-height: 24px;
}
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
font-size: 25px;
}
:where(.MLK__rows > .MLK__row div).is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row div).action.is-active aside,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
display: none;
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
display: none;
}
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row div).shift.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div) small {
color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__row div) aside {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 10px;
line-height: 10px;
color: var(--_keycap-secondary-text);
}
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
Note there are a different set of tooltip rules for the keyboard toggle
(it's in a different CSS tree) */
.ML__keyboard [data-tooltip] {
position: relative;
}
.ML__keyboard [data-tooltip]::after {
position: absolute;
display: inline-table;
content: attr(data-tooltip);
top: inherit;
bottom: 100%;
width: max-content;
max-width: 200px;
padding: 8px 8px;
background: #616161;
color: #fff;
text-align: center;
z-index: 2;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
border-radius: 2px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
font-size: 12px;
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
opacity: 0;
transform: scale(0.5);
}
.ML__keyboard [data-tooltip]:hover {
position: relative;
}
.ML__keyboard [data-tooltip]:hover::after {
opacity: 1;
transform: scale(1);
}
.MLK__toolbar {
align-self: center;
display: flex;
flex-flow: row;
justify-content: space-between;
width: 100%;
max-width: 996px;
min-height: 32px;
/* Icons for undo/redo, etc. */
}
.MLK__toolbar svg {
height: 20px;
width: 20px;
}
.MLK__toolbar > .left {
position: relative;
display: flex;
justify-content: flex-start;
flex-flow: row;
}
.MLK__toolbar > .right {
display: flex;
justify-content: flex-end;
flex-flow: row;
}
.MLK__toolbar > div > div {
/* "button" in the toolbar */
display: flex;
align-items: center;
justify-content: center;
color: var(--_toolbar-text);
fill: currentColor;
background: var(--_toolbar-background);
font-size: var(--_toolbar-font-size);
padding: 4px 15px;
cursor: pointer;
width: max-content;
min-width: 42px;
min-height: 34px;
border: none;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 8px;
padding-top: 8px;
margin-top: 0;
margin-bottom: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 8px;
box-shadow: none;
border-bottom: 2px solid transparent;
}
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
background: var(--_toolbar-background-hover);
}
.MLK__toolbar > div > div.disabled svg,
.MLK__toolbar > div > div.disabled:hover svg,
.MLK__toolbar > div > div.disabled.is-pressed svg {
color: var(--_toolbar-text);
opacity: 0.2;
}
.MLK__toolbar > div > div:hover,
.MLK__toolbar > div > div:active,
.MLK__toolbar > div > div.is-pressed,
.MLK__toolbar > div > div.is-active {
color: var(--_toolbar-text-active);
}
.MLK__toolbar > div > div.selected {
color: var(--_toolbar-text-active);
background: var(--_toolbar-background-selected);
border-radius: 0;
border-bottom-color: var(--_toolbar-text-active);
padding-bottom: 4px;
margin-bottom: 8px;
}
/* This is the element that displays variants on press+hold */
.MLK__variant-panel {
visibility: hidden;
position: fixed;
display: flex;
flex-flow: row wrap-reverse;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
bottom: auto;
top: 0;
box-sizing: content-box;
transform: none;
z-index: calc(var(--_keyboard-zindex) + 1);
touch-action: none;
max-width: 350px;
background: var(--_variant-panel-background);
text-align: center;
border-radius: 6px;
padding: 6px;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
transition: none;
}
.MLK__variant-panel.is-visible {
visibility: visible;
}
.MLK__variant-panel.compact {
--_variant-keycap-length: var(--variant-keycap-length, 50px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
}
.MLK__variant-panel .item {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--_variant-keycap-font-size);
height: var(--_variant-keycap-length);
width: var(--_variant-keycap-length);
margin: 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
pointer-events: all;
cursor: pointer;
color: var(--_variant-keycap-text);
fill: currentColor;
}
@media (max-height: 412px) {
.MLK__variant-panel .item {
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
.MLK__variant-panel .item .ML__latex {
pointer-events: none;
}
.MLK__variant-panel .item.is-active {
background: var(--_variant-keycap-background-active);
color: var(--_variant-keycap-text-active);
}
.MLK__variant-panel .item.is-pressed {
background: var(--_variant-keycap-background-pressed);
color: var(--_variant-keycap-text-pressed);
}
.MLK__variant-panel .item.small {
font-size: var(--_keycap-small-font-size);
}
.MLK__variant-panel .item.swatch-button {
box-sizing: border-box;
background: #fbfbfb;
}
.MLK__variant-panel .item.swatch-button > span {
display: inline-block;
margin: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 50%;
}
.MLK__variant-panel .item.swatch-button:hover {
background: #f0f0f0;
}
.MLK__variant-panel .item.swatch-button:hover > span {
border-radius: 2px;
}
.MLK__variant-panel .item.box > div,
.MLK__variant-panel .item.box > span {
border: 1px dashed rgba(0, 0, 0, 0.24);
}
.MLK__variant-panel .item .warning {
min-height: 60px;
min-width: 60px;
background: #cd0030;
color: white;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.MLK__variant-panel .item .warning.is-pressed,
.MLK__variant-panel .item .warning.is-active {
background: red;
}
.MLK__variant-panel .item .warning svg.svg-glyph {
width: 50px;
height: 50px;
}
.MLK__variant-panel .item aside {
font-size: var(--_variant-keycap-aside-font-size);
line-height: 12px;
opacity: 0.78;
padding-top: 2px;
}
.MLK__keycap {
position: relative;
}
.MLK__shift {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-size: var(--_keycap-shift-font-size);
color: var(--_keycap-shift-color);
}
.hide-shift .MLK__shift {
display: none;
}
@media (max-width: 414px) {
.MLK__variant-panel {
max-width: 350px;
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
/* @xs breakpoint: iPhone 5 */
@container (max-width: 414px) {
.MLK__rows {
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
--_keycap-height: max(var(--_keycap-height), 42px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
font-size: 100%;
margin-left: 2px;
margin-right: 2px;
}
.MLK__rows .shift,
.MLK__rows .action {
font-size: 65%;
}
.MLK__rows .warning svg.svg-glyph {
width: 14px;
height: 14px;
min-height: 14px;
}
}
@container (max-width: 744px) {
.MLK__rows {
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
--_keycap-height: max(var(--keycap-height, 52px), 52px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
padding-left: 0;
padding-right: 0;
}
.MLK__tooltip::after {
padding: 8px 16px;
font-size: 16px;
}
.MLK__rows > .MLK__row > div.fnbutton {
font-size: 16px;
}
.MLK__rows > .MLK__row > div.bigfnbutton {
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
}
.MLK__rows > .MLK__row > div.small {
font-size: 13px;
}
.MLK__rows > .MLK__row > div > aside {
display: none;
}
.MLK__shift {
display: none;
}
}
/* Medium breakpoint: larger phones */
@container (max-width: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@media (max-height: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@container (max-width: 1444px) {
.MLK__rows .if-wide {
display: none;
}
}
@media (prefers-color-scheme: dark) {
.ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
}
/* Same as the media query, but with a class */
[theme='dark'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
[theme='light'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--_keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
}
`,gd=`:host {
--primary-color: #5898ff;
--primary-color-dimmed: #c0c0f0;
--primary-color-dark: var(--blue-500);
--primary-color-light: var(--blue-100);
--primary-color-reverse: #ffffff;
--secondary-color: #ff8a65;
--secondary-color-dimmed: #f0d5c5;
--secondary-color-dark: var(--orange-500);
--secondary-color-light: var(--orange-100);
--secondary-color-reverse: #ffffff;
--link-color: #5898ff;
--link-color-dimmed: #c5c5c5;
--link-color-dark: #121212;
--link-color-light: #e2e2e2;
--link-color-reverse: #ffffff;
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--neutral-100: #f5f5f5;
--neutral-200: #eeeeee;
--neutral-300: #e0e0e0;
--neutral-400: #bdbdbd;
--neutral-500: #9e9e9e;
--neutral-600: #757575;
--neutral-700: #616161;
--neutral-800: #424242;
--neutral-900: #212121;
--red-25: #fff8f7;
--red-50: #fff1ef;
--red-100: #ffeae6;
--red-200: #ffcac1;
--red-300: #ffa495;
--red-400: #ff7865;
--red-500: #f21c0d;
--red-600: #e50018;
--red-700: #d30024;
--red-800: #bd002c;
--red-900: #a1002f;
--orange-25: #fffbf8;
--orange-50: #fff7f1;
--orange-100: #fff3ea;
--orange-200: #ffe1c9;
--orange-300: #ffcca2;
--orange-400: #ffb677;
--orange-500: #fe9310;
--orange-600: #f58700;
--orange-700: #ea7c00;
--orange-800: #dc6d00;
--orange-900: #ca5b00;
--brown-25: #fff8ef;
--brown-50: #fff1df;
--brown-100: #ffe9ce;
--brown-200: #ebcca6;
--brown-300: #cdaf8a;
--brown-400: #af936f;
--brown-500: #856a47;
--brown-600: #7f5e34;
--brown-700: #78511f;
--brown-800: #6e4200;
--brown-900: #593200;
--yellow-25: #fffdf9;
--yellow-50: #fffcf2;
--yellow-100: #fffaec;
--yellow-200: #fff2ce;
--yellow-300: #ffe8ab;
--yellow-400: #ffdf85;
--yellow-500: #ffcf33;
--yellow-600: #f1c000;
--yellow-700: #dfb200;
--yellow-800: #c9a000;
--yellow-900: #ad8a00;
--lime-25: #f4ffee;
--lime-50: #e9ffdd;
--lime-100: #ddffca;
--lime-200: #a8fb6f;
--lime-300: #94e659;
--lime-400: #80d142;
--lime-500: #63b215;
--lime-600: #45a000;
--lime-700: #268e00;
--lime-800: #007417;
--lime-900: #005321;
--green-25: #f5fff5;
--green-50: #ebffea;
--green-100: #e0ffdf;
--green-200: #a7ffa7;
--green-300: #5afa65;
--green-400: #45e953;
--green-500: #17cf36;
--green-600: #00b944;
--green-700: #00a34a;
--green-800: #008749;
--green-900: #00653e;
--teal-25: #f3ffff;
--teal-50: #e6fffe;
--teal-100: #d9fffe;
--teal-200: #8dfffe;
--teal-300: #57f4f4;
--teal-400: #43e5e5;
--teal-500: #17cfcf;
--teal-600: #00c2c0;
--teal-700: #00b5b1;
--teal-800: #00a49e;
--teal-900: #009087;
--cyan-25: #f7fcff;
--cyan-50: #eff8ff;
--cyan-100: #e7f5ff;
--cyan-200: #c2e6ff;
--cyan-300: #95d5ff;
--cyan-400: #61c4ff;
--cyan-500: #13a7ec;
--cyan-600: #069eda;
--cyan-700: #0095c9;
--cyan-800: #0088b2;
--cyan-900: #0a7897;
--blue-25: #f7faff;
--blue-50: #eef5ff;
--blue-100: #e5f1ff;
--blue-200: #bfdbff;
--blue-300: #92c2ff;
--blue-400: #63a8ff;
--blue-500: #0d80f2;
--blue-600: #0077db;
--blue-700: #006dc4;
--blue-800: #0060a7;
--blue-900: #005086;
--indigo-25: #f8f7ff;
--indigo-50: #f1efff;
--indigo-100: #eae7ff;
--indigo-200: #ccc3ff;
--indigo-300: #ac99ff;
--indigo-400: #916aff;
--indigo-500: #63c;
--indigo-600: #5a21b2;
--indigo-700: #4e0b99;
--indigo-800: #3b0071;
--indigo-900: #220040;
--purple-25: #fbf7ff;
--purple-50: #f8f0ff;
--purple-100: #f4e8ff;
--purple-200: #e4c4ff;
--purple-300: #d49aff;
--purple-400: #c36aff;
--purple-500: #a219e6;
--purple-600: #9000c4;
--purple-700: #7c009f;
--purple-800: #600073;
--purple-900: #3d0043;
--magenta-25: #fff8fb;
--magenta-50: #fff2f6;
--magenta-100: #ffebf2;
--magenta-200: #ffcddf;
--magenta-300: #ffa8cb;
--magenta-400: #ff7fb7;
--magenta-500: #eb4799;
--magenta-600: #da3689;
--magenta-700: #c82179;
--magenta-800: #b00065;
--magenta-900: #8a004c;
}
@media (prefers-color-scheme: dark) {
:host {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
}
:host([theme='dark']) {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
/* @media (prefers-color-scheme: dark) {
:host {
--label-color: #fff;
--active-label-color: #000;
--menu-bg: #525252;
--active-bg: #5898ff;
--active-bg-dimmed: #5c5c5c;
}
} */
:host {
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--ui-font-size: 14px;
--ui-line-height: 1.5;
--ui-letter-spacing: 0.007em;
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
--ui-layer-1: var(--neutral-100);
--ui-layer-2: var(--neutral-200);
--ui-layer-3: var(--neutral-300);
--ui-layer-4: var(--neutral-400);
--ui-layer-5: var(--neutral-500);
--ui-layer-6: var(--neutral-600);
--ui-border-color: var(--primary-color);
--ui-border-radius: 4px;
--ui-text: var(--neutral-900);
--ui-text-secondary: var(--neutral-700);
--ui-text-placeholder: var(--neutral-500);
--ui-text-muted: var(--neutral-300);
/** A field is a UI element in which a user can type data, for
* example an input or textarea element.
*/
--ui-field-bg: var(--neutral-100);
--ui-field-bg-hover: var(--neutral-100);
--ui-field-bg-disabled: var(--neutral-300);
--ui-field-bg-invalid: var(--red-100);
--ui-field-bg-focus: var(--neutral-100);
--ui-field-border: 0.5px solid var(--border-color);
--ui-field-border-hover: 0.5px solid var(--border-color);
--ui-field-border-disabled: 0.5px solid var(--border-color);
--ui-field-border-invalid: 0.5px solid var(--border-color);
--ui-field-border-focus: 0.5px solid var(--border-color);
--ui-menu-bg: var(--neutral-100);
--ui-menu-text: var(--neutral-900);
--ui-menu-bg-hover: var(--neutral-200);
--ui-menu-text-hover: var(--neutral-900);
/** The \`active\` state is used for the state of menu items
* when they are selected.
*/
--ui-menu-bg-active: var(--primary-color);
--ui-menu-text-active: var(--primary-color-reverse);
/** The \`active-muted\` set is used for the state of
* submenus when they are open.
*/
--ui-menu-bg-active-muted: var(--neutral-300);
--ui-menu-text-active-muted: var(--neutral-900);
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
--ui-menu-divider: 0.5px solid #c7c7c7;
/* var(--neutral-300); */
--ui-menu-z-index: 10000;
--page-bg: var(--neutral-100);
--content-bg: var(--neutral-200);
}
@media (prefers-color-scheme: dark) {
:host {
--ui-menu-bg: var(--neutral-200);
}
}
:host([theme='dark']) {
--ui-menu-bg: var(--neutral-200);
}
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
Noto is a Linux/Android font.
*/
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh) {
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
}
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac) {
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
--ui-font-size: 1rem;
--ui-line-height: 1.7;
--ui-letter-spacing: 0;
}
:dir(rtl) {
--ui-line-height: auto;
--ui-letter-spacing: 0;
}
`,vd=`.ui-menu *,
.ui-menu ::before,
.ui-menu ::after {
box-sizing: border-box;
}
.ui-menu {
display: none;
color-scheme: light dark;
-webkit-user-select: none;
/* Important: Safari iOS doesn't respect user-select */
user-select: none;
cursor: default;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0 0 0 0);
--active-label-color: #fff;
/* ui-menu-text-active */
--label-color: #121212;
/* ui-menu-text */
--menu-bg: #e2e2e2;
/* ui-menu-background */
--active-bg: #5898ff;
/* ui-menu-background-active */
--active-bg-dimmed: #c5c5c5;
/* ui-menu-background-active-muted */
}
/** Use the :where pseudo selector to make the specificity of the
* selector 0, so that it can be overridden by the user.
*/
:where(.ui-menu-container) {
position: absolute;
overflow: visible;
width: auto;
height: auto;
z-index: 10000;
border-radius: 8px;
background: var(--ui-menu-bg);
box-shadow: var(--ui-menu-shadow);
list-style: none;
padding: 6px 0 6px 0;
margin: 0;
user-select: none;
cursor: default;
color: var(--ui-menu-text);
font-weight: normal;
font-style: normal;
text-shadow: none;
text-transform: none;
letter-spacing: 0;
outline: none;
opacity: 1;
/* The [popover] elements have a 1px solid black border. Ugh. */
border: none;
width: fit-content;
height: fit-content;
}
:where(.ui-menu-container > li) {
display: flex;
flex-flow: row;
align-items: center;
padding: 1px 7px 1px 7px;
margin-top: 0;
margin-left: 6px;
margin-right: 6px;
border-radius: 4px;
white-space: nowrap;
position: relative;
outline: none;
fill: currentColor;
user-select: none;
cursor: default;
text-align: left;
color: inherit;
font-family: var(--ui-font-family);
font-size: var(--ui-font-size);
line-height: var(--ui-line-height);
letter-spacing: var(--ui-letter-spacing);
}
:where(.ui-menu-container > li > .label) {
appearance: none;
background: none;
outline: none;
width: 100%;
margin: 0;
padding: 1px 2px 1px 1px;
overflow: visible;
border: 1px solid transparent;
white-space: nowrap;
text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
font-weight: bold;
opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li[role='divider']) {
border-bottom: 1px solid var(--ui-menu-divider);
border-radius: 0;
padding: 0;
margin-left: 15px;
margin-right: 15px;
padding-top: 5px;
margin-bottom: 5px;
width: calc(100% - 30px);
/** 100% - (margin-left + margin-right) */
}
:where(.ui-menu-container > li[aria-disabled='true']) {
opacity: 0.5;
}
:where(.ui-menu-container > li.active) {
background: var(--ui-menu-bg-active);
background: -apple-system-control-accent;
color: var(--ui-menu-text-active);
}
:where(.ui-menu-container > li.active.is-submenu-open) {
background: var(--ui-menu-bg-active-muted);
color: inherit;
}
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
padding-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
font-family: var(--ui-font-family);
margin-inline-start: 12px;
opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
opacity: 0.85;
}
.ui-trailing-chevron {
display: flex;
margin-inline-start: 24px;
width: 10px;
height: 10px;
margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
transform: scaleX(-1);
}
.ui-checkmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
.ui-mixedmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
`,Bo;function xl(e){let r="";switch(e){case"mathfield-element":r=`
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
:host([hidden]) { display: none; }
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
:host(:focus), :host(:focus-within) {
outline: Highlight auto 1px; /* For Firefox */
outline: -webkit-focus-ring-color auto 1px;
}
:host([readonly]:focus), :host([readonly]:focus-within),
:host([read-only]:focus), :host([read-only]:focus-within) {
outline: none;
}
@media (hover: none) and (pointer: coarse) {
:host(:not(:focus)) :first-child { pointer-events: none !important; }
}`;break;case"core":r=Qc;break;case"mathfield":r=fd;break;case"environment-popover":r=Ia;break;case"suggestion-popover":r=ho;break;case"keystroke-caption":r=pd;break;case"virtual-keyboard":r=md;break;case"ui":r=gd;break;case"menu":r=vd;break;default:debugger}return r}function Ea(e){return Bo||(Bo={}),Bo[e]||(Bo[e]=new CSSStyleSheet,Bo[e].replaceSync(xl(e))),Bo[e]}var qa;function fo(e){var r;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;const n=window.document.createElement("style");n.id=`mathlive-style-${e}`,n.append(window.document.createTextNode(xl(e))),window.document.head.appendChild(n);return}if(qa||(qa={}),((r=qa[e])!=null?r:0)!==0)qa[e]+=1;else{const n=Ea(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],qa[e]=1}}function Fo(e){if("adoptedStyleSheets"in document&&qa!=null&&qa[e]&&(qa[e]-=1,qa[e]<=0)){const r=Bo[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n!==r)}}var eu=class Mp extends $t{constructor(r){var n;super(d($({},r),{type:"accent",body:(n=r.body)!=null?n:void 0})),r.accentChar?this.accent=r.accentChar:this.svgAccent=r==null?void 0:r.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(r){return new Mp(r)}toJson(){return d($({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(r){var n;const a=new qi({parent:r,mathstyle:"cramp"},this.style),u=(n=$t.createBox(a,this.body))!=null?n:new ur("\u25A2",{style:this.style});let f=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(f=u.skew);let v=Math.min(u.height,ha),A;if(this.svgAccent)A=g0(this.svgAccent),v=a.metrics.bigOpSpacing1-v;else if(this.accent){const P=new ur(this.accent,{fontFamily:"Main-Regular"});P.italic=0;const z=this.accent===8407?" ML__accent-vec":"";A=new ur(new ur(P),{classes:"ML__accent-body"+z})}A=new gs({shift:0,children:[{box:new ur(u)},-v,{box:A,marginLeft:u.left+2*f,classes:["ML__center"]}]});const C=new ur(A,{type:"lift"});return this.caret&&(C.caret=this.caret),this.bind(a,C.wrap(a)),this.attachSupsub(a,{base:C})}},Nu={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},$u=Object.fromEntries(Object.entries(Nu).map(([e,r])=>[r,e]));function wl(e){var r;return(r={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[e])!=null?r:e.codePointAt(0)}function yd(e,r,n,a){var u;const v=new ur(wl(e),{fontFamily:"Main-Regular",isSelected:a.isSelected,classes:"ML__small-delim "+((u=a.classes)!=null?u:"")}).wrap(r);return n&&v.setTop((1-r.scalingFactor)*ca),v}function eh(e,r,n,a,u){var f,v;const A=new qi({parent:a,mathstyle:"textstyle"},u==null?void 0:u.style),C=new ur(wl(e),{fontFamily:`Size${r}-Regular`,isSelected:u.isSelected,classes:((f=u.classes)!=null?f:"")+` ML__delim-size${r}`,type:(v=u.type)!=null?v:"ignore"}).wrap(A);return n&&C.setTop((1-A.scalingFactor)*ca),C}function E0(e,r,n,a,u){var f;let v,A,C,P;v=C=P=wl(e),A=null;let z="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?C=v=P=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?C=v=P=8741:e==="\\uparrow"?C=P=9168:e==="\\Uparrow"?C=P=8214:e==="\\downarrow"?v=C=9168:e==="\\Downarrow"?v=C=8214:e==="\\updownarrow"?(v=8593,C=9168,P=8595):e==="\\Updownarrow"?(v=8657,C=8214,P=8659):e==="["||e==="\\lbrack"?(v=9121,C=9122,P=9123,z="Size4-Regular"):e==="]"||e==="\\rbrack"?(v=9124,C=9125,P=9126,z="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(C=v=9122,P=9123,z="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(v=9121,C=P=9122,z="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(C=v=9125,P=9126,z="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(v=9124,C=P=9125,z="Size4-Regular"):e==="("||e==="\\lparen"?(v=9115,C=9116,P=9117,z="Size4-Regular"):e===")"||e==="\\rparen"?(v=9118,C=9119,P=9120,z="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(v=9127,A=9128,P=9129,C=9130,z="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(v=9131,A=9132,P=9133,C=9130,z="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(v=9127,P=9129,C=9130,z="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(v=9131,P=9133,C=9130,z="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(v=9127,P=9133,C=9130,z="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(v=9131,P=9129,C=9130,z="Size4-Regular"):e==="\\surd"?(v=57345,P=9143,C=57344,z="Size4-Regular"):e==="\\ulcorner"?(v=9484,C=P=32):e==="\\urcorner"?(v=9488,C=P=32):e==="\\llcorner"?(P=9492,C=v=32):e==="\\lrcorner"&&(v=9496,C=v=32);const Q=ml(v,z),_e=Q.height+Q.depth,Ie=ml(C,z),ze=Ie.height+Ie.depth,St=ml(P,z),sr=St.height+St.depth;let xt=0,Wt=1;if(A!==null){const Ls=ml(A,z);xt=Ls.height+Ls.depth,Wt=2}const hr=_e+sr+xt,Zt=Math.max(0,Math.ceil((r-hr)/(Wt*ze))),Nr=hr+Zt*Wt*ze;let Qr=ca;n&&(Qr=Qr*a.scalingFactor);const Wr=Nr/2-Qr,Yi=.008,En=[];En.push({box:new ur(P,{fontFamily:z})}),En.push(-Yi);const gr=new ur(C,{fontFamily:z});if(A===null)for(let Ls=0;Ls<Zt;Ls++)En.push({box:gr});else{for(let Ls=0;Ls<Zt;Ls++)En.push({box:gr});En.push(-Yi),En.push({box:new ur(A,{fontFamily:z})}),En.push(-Yi);for(let Ls=0;Ls<Zt;Ls++)En.push({box:gr})}En.push(-Yi),En.push({box:new ur(v,{fontFamily:z})});let Oa="";z==="Size1-Regular"?Oa=" delim-size1":z==="Size4-Regular"&&(Oa=" delim-size4");const qo=new gs({bottom:Wr,children:En},{classes:Oa});return new ur(qo,d($({},u!=null?u:{}),{classes:((f=u==null?void 0:u.classes)!=null?f:"")+" ML__delim-mult"}))}var th=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),rh=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),ih=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),nh=[0,1.2,1.8,2.4,3];function uc(e,r,n,a){return e===void 0||e==="."?po(n,a.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),th.has(e)||ih.has(e)?eh(e,r,!1,n,a):rh.has(e)?E0(e,nh[r],!1,n,a):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var A0=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],bd=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],sh=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function _d(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function xd(e,r,n,a){const u={"-4":0,"-3":1,0:2}[a.mathstyle.sizeDelta];for(let f=u;f<n.length&&n[f].type!=="stack";f++){const v=ml(e,_d(n[f]));if(v.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let A=v.height+v.depth;if(n[f].type==="small"&&(n[f].mathstyle==="scriptscriptstyle"?A*=Math.max(pl[Math.max(1,a.size-2)],a.minFontScale):n[f].mathstyle==="scriptstyle"&&(A*=Math.max(pl[Math.max(1,a.size-1)],a.minFontScale))),A>r)return n[f]}return n[n.length-1]}function tu(e,r,n,a,u,f){if(!r||r.length===0||r===".")return po(u);r==="<"||r==="\\lt"?r="\\langle":(r===">"||r==="\\gt")&&(r="\\rangle");let v;ih.has(r)?v=A0:th.has(r)?v=sh:v=bd;const A=xd(wl(r),n,v,u),C=new qi({parent:u,mathstyle:A.mathstyle},f==null?void 0:f.style);return A.type==="small"?yd(r,C,a,d($({},f),{type:e})):A.type==="large"?eh(r,A.size,a,C,d($({},f),{type:e})):(console.assert(A.type==="stack"),E0(r,n,a,C,d($({},f),{type:e})))}function zu(e,r,n,a,u,f){if(r===".")return po(u,f==null?void 0:f.classes);const v=ca*u.scalingFactor,A=901,C=5/xa,P=Math.max(n-v,a+v),z=Math.max(P/500*A,2*P-C);return tu(e,r,z,!0,u,f)}function po(e,r){const n=new ur(null,{classes:" nulldelimiter "+(r!=null?r:""),type:"ignore"});return n.width=e.getRegisterAsEm("nulldelimiterspace"),n.wrap(new qi({parent:e,mathstyle:"textstyle"}))}var mo=class Lp extends $t{constructor(r){var n;super({type:"placeholder",command:"\\placeholder",mode:(n=r==null?void 0:r.mode)!=null?n:"math",style:r==null?void 0:r.style}),this.captureSelection=!0}static fromJson(r){return new Lp(r)}toJson(){return super.toJson()}render(r){let n;return this.value=r.placeholderSymbol,typeof r.renderPlaceholder=="function"?n=r.renderPlaceholder(r):n=this.createBox(r),this.caret&&(n.classes+=" ML__placeholder-selected"),n}_serialize(r){return r.skipPlaceholders?"":"\\placeholder{}"}},ah=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],k0=["cases","dcases","rcases"],cc=["align","align*","aligned","gather","gathered","split"],oh=["array","subequations","eqnarray"];function wd(e){return oh.concat(cc).concat(k0).concat(ah).includes(e)}function hc(e){return ah.includes(e)}function Sd(e){return k0.includes(e)}function dc(e){return cc.includes(e)}function lh(e,r,n){let a=0;for(const P of n)"align"in P&&(a+=1);let u=0;const f=[];for(const P of r){let z=0;for(u=Math.max(u,Math.min(P.length,a));z<P.length;){const Q=[],_e=Math.min(P.length,z+a);for(;z<_e;){const Ie=P[z];Ie.length===0?Q.push([new $t({type:"first",mode:e.mode})]):Ie[0].type!=="first"?Q.push([new $t({type:"first",mode:e.mode}),...Ie]):(console.assert(!Ie.slice(1).some(ze=>ze.type==="first")),Q.push(Ie)),z+=1}f.push(Q)}}f.length>0&&f[f.length-1].length===1&&f[f.length-1][0].length===1&&f[f.length-1][0][0].type==="first"&&f.pop();const v=[];for(const P of f){if(P.length!==u)for(let z=P.length;z<u;z++)P.push([new $t({type:"first",mode:e.mode}),new mo]);v.push(P)}let A=0,C=0;for(const P of v){C=0;for(const z of P){for(const Q of z)Q.parent=e,Q.parentBranch=[A,C];C+=1}A+=1}return e.isDirty=!0,v}var an=class Rp extends $t{constructor(r,n,a,u={}){var f;super({type:"array"}),this.environmentName=r,this.rowGaps=a,u.mathstyleName&&(this.mathstyleName=u.mathstyleName),u.columns&&(u.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=u.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=lh(this,n,this.colFormat),u.leftDelim&&(this.leftDelim=u.leftDelim),u.rightDelim&&(this.rightDelim=u.rightDelim),u.arraycolsep!==void 0&&(this.arraycolsep=u.arraycolsep),this.colSeparationType=u.colSeparationType,u.arraystretch!==void 0&&(this.arraystretch=u.arraystretch),this.minColumns=(f=u.minColumns)!=null?f:1}static fromJson(r){return new Rp(r.environmentName,r.array,r.rowGaps,r)}toJson(){const r=d($({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(n=>n.map(a=>a.map(u=>u.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(r.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(r.arraycolsep=this.arraycolsep),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),r}branch(r){var n;if(b0(r))return(n=this.array[r[0]][r[1]])!=null?n:void 0}createBranch(r){var n;return b0(r)?(this.isDirty=!0,(n=this.branch(r))!=null?n:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(r=>!!r.align).length}removeBranch(r){if(_l(r))return super.removeBranch(r);const n=this.branch(r);return this.array[r[0]][r[1]]=void 0,n.forEach(a=>{a.parent=void 0,a.parentBranch=void 0}),console.assert(n[0].type==="first"),n.shift(),this.isDirty=!0,n}get hasChildren(){return this.children.length>0}get children(){const r=[];for(const n of this.array)for(const a of n)if(a)for(const u of a)r.push(...u.children),r.push(u);return[...r,...super.children]}render(r){var n,a,u,f,v,A;const C=new qi({parent:r,mathstyle:this.mathstyleName},this.style),P=C.getRegisterAsEm("arrayrulewidth"),z=C.getRegisterAsEm("arraycolsep"),Q=C.getRegisterAsEm("doublerulesep"),_e=(a=(n=this.arraystretch)!=null?n:C.getRegisterAsNumber("arraystretch"))!=null?a:1;let Ie=typeof this.arraycolsep=="number"?this.arraycolsep:z;this.colSeparationType==="small"&&(Ie=.2778*(new qi({parent:r,mathstyle:"scriptstyle"}).scalingFactor/r.scalingFactor));const ze=_e*X0,St=.7*ze,sr=.3*ze;let xt=0;const Wt=[];let hr=0;const Zt=this.array.length;for(let Mn=0;Mn<Zt;++Mn){const hs=this.array[Mn];hr=Math.max(hr,hs.length);const Rs=new qi({parent:C,mathstyle:this.mathstyleName},this.style);let Zo=St/Rs.scalingFactor,Yo=sr/Rs.scalingFactor;const Xo={cells:[],height:0,depth:0,pos:0};for(const vo of hs){const mf=(u=$t.createBox(Rs,vo,{type:"ignore"}))!=null?u:new ur(null,{type:"ignore"});Yo=Math.max(Yo,mf.depth),Zo=Math.max(Zo,mf.height),Xo.cells.push(mf)}let Jo=(f=Wc(this.rowGaps[Mn]))!=null?f:0;Jo>0&&(Jo+=sr,Yo=Math.max(Yo,Jo),Jo=0),Mn<Zt-1&&!hc(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Yo+=C.getRegisterAsEm("jot")),Xo.height=Zo,Xo.depth=Yo,xt+=Zo,Xo.pos=xt,xt+=Yo+Jo,Wt.push(Xo)}const Nr=xt/2+ca,Qr=[];for(let Mn=0;Mn<hr;Mn++){const hs=[];for(const Rs of Wt){const Zo=Rs.cells[Mn];Zo.depth=Rs.depth,Zo.height=Rs.height,hs.push({box:Zo,shift:Rs.pos-Nr})}hs.length>0&&Qr.push(new gs({individualShift:hs}))}const Wr=[];let Yi=!1,En=!1,gr=0,Oa=!this.leftDelim;const{colFormat:qo}=this;for(const Mn of qo){if("align"in Mn&&gr>=Qr.length)break;if("align"in Mn)Yi?Wr.push(ru(2*Ie)):(En||Oa)&&Wr.push(ru(Ie)),Wr.push(new ur(Qr[gr],{classes:"col-align-"+Mn.align})),gr++,Yi=!0,En=!1,Oa=!1;else if("gap"in Mn){if(typeof Mn.gap=="number")Wr.push(ru(Mn.gap));else{const hs=uh(r,Wt,Nr,Mn.gap);hs&&Wr.push(hs)}Yi=!1,En=!1,Oa=!1}else if("separator"in Mn){const hs=new ur(null,{classes:"vertical-separator"});hs.height=xt,hs.setStyle("height",xt,"em"),hs.setStyle("border-right",`${P}em ${Mn.separator} currentColor`),hs.setStyle("vertical-align",-(xt-Nr),"em");let Rs=0;En?Rs=Q-P:Yi&&(Rs=Ie-P),hs.left=Rs,Wr.push(hs),Yi=!1,En=!0,Oa=!1}}Yi&&!this.rightDelim&&Wr.push(ru(Ie));const Ja=new ur(Wr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Ja.caret=this.caret),this.bind(r,Ja);const Ls=Ja.height,Ba=Ja.depth,va=this.bind(r,new ur([this.bind(r,zu("open",(v=this.leftDelim)!=null?v:".",Ls,Ba,C,{isSelected:this.isSelected})),Ja,this.bind(r,zu("close",(A=this.rightDelim)!=null?A:".",Ls,Ba,C,{isSelected:this.isSelected}))],{type:"ord"}));return va?(va.setStyle("display","inline-block"),this.caret&&(va.caret=this.caret),this.bind(r,this.attachSupsub(r,{base:va}))):null}_serialize(r){var n;const a=[];if(this.environmentName==="lines"?a.push("{\\displaylines"):a.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(a.push("{"),this.colFormat!==void 0)for(const u of this.colFormat)"align"in u&&typeof u.align=="string"?a.push(u.align):"separator"in u&&u.separator==="solid"?a.push("|"):"separator"in u&&u.separator==="dashed"&&a.push(":");a.push("}")}for(let u=0;u<this.array.length;u++){for(let f=0;f<this.array[u].length;f++)f>0&&a.push(" & "),a.push($t.serialize(this.array[u][f],r));if(u<this.array.length-1){const f=this.rowGaps[u];f!=null&&f.dimension?a.push(`\\\\[${f.dimension} ${(n=f.unit)!=null?n:"pt"}] `):a.push("\\\\ ")}}return this.environmentName==="lines"?a.push("}"):a.push(`\\end{${this.environmentName}}`),Xi(a)}getCell(r,n){return this.array[r][n]}setCell(r,n,a){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[r][n]!==void 0);for(const f of this.array[r][n])f.parent=void 0,f.parentBranch=void 0;let u=a;(a.length===0||a[0].type!=="first")&&(u=[new $t({type:"first",mode:this.mode}),...a]),this.array[r][n]=u;for(const f of u)f.parent=this,f.parentBranch=[r,n];this.isDirty=!0}addRowBefore(r){console.assert(this.type==="array"&&Array.isArray(this.array));const n=[];for(let a=0;a<this.colCount;a++)n.push(T0(this));this.array.splice(r,0,n);for(let a=r;a<this.rowCount;a++)for(let u=0;u<this.colCount;u++){const f=this.array[a][u];if(f)for(const v of f)v.parentBranch=[a,u]}this.isDirty=!0}addRowAfter(r){console.assert(this.type==="array"&&Array.isArray(this.array));const n=[];for(let a=0;a<this.colCount;a++)n.push(T0(this));this.array.splice(r+1,0,n);for(let a=r+1;a<this.rowCount;a++)for(let u=0;u<this.colCount;u++){const f=this.array[a][u];if(f)for(const v of f)v.parentBranch=[a,u]}this.isDirty=!0}removeRow(r){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>r);const n=this.array.splice(r,1);for(const a of n)for(const u of a)if(u)for(const f of u)f.parent=void 0,f.parentBranch=void 0;for(let a=r;a<this.rowCount;a++)for(let u=0;u<this.colCount;u++){const f=this.array[a][u];if(f)for(const v of f)v.parentBranch=[a,u]}this.isDirty=!0}addColumnBefore(r){console.assert(this.type==="array"&&Array.isArray(this.array));for(const n of this.array)n.splice(r,0,T0(this));for(let n=0;n<this.rowCount;n++)for(let a=r;a<this.colCount;a++){const u=this.array[n][a];if(u)for(const f of u)f.parentBranch=[n,a]}this.isDirty=!0}addColumnAfter(r){console.assert(this.type==="array"&&Array.isArray(this.array));for(const n of this.array)n.splice(r+1,0,T0(this));for(let n=0;n<this.rowCount;n++)for(let a=r+1;a<this.colCount;a++){const u=this.array[n][a];if(u)for(const f of u)f.parentBranch=[n,a]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(r){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>r);for(const n of this.array){const a=n.splice(r,1);for(const u of a)if(u)for(const f of u)f.parent=void 0,f.parentBranch=void 0}for(let n=0;n<this.rowCount;n++)for(let a=r;a<this.colCount;a++){const u=this.array[n][a];if(u)for(const f of u)f.parentBranch=[n,a]}this.isDirty=!0}get cells(){const r=[];for(const n of this.array)for(const a of n)a&&r.push(a.filter(u=>u.type!=="first"));return r}};function T0(e){const r=new $t({type:"first",mode:e.mode});r.parent=e;const n=new mo;return n.parent=e,[r,n]}function ru(e){const r=new ur(null,{classes:"arraycolsep"});return r.width=e,r}function uh(e,r,n,a){if(!a)return null;const u=[];for(const f of r){const v=$t.createBox(e,a,{type:"ignore"});v&&(v.depth=f.depth,v.height=f.height,u.push({box:v,shift:f.pos-n}))}return new gs({individualShift:u}).wrap(e)}var Za=class Ip extends $t{constructor(r){super({mode:r.mode,command:r.command,style:r.style,body:r.body,type:"box"}),this.framecolor=r.framecolor,this.backgroundcolor=r.backgroundcolor,this.padding=r.padding,this.offset=r.offset,this.border=r.border}static fromJson(r){return new Ip(r)}toJson(){return d($({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(r){var n,a,u,f;const v=$t.createBox(r,this.body,{type:"lift"});if(!v)return null;const A=r.toEm((n=this.offset)!=null?n:{dimension:0});v.depth+=A,v.setStyle("display","inline-block"),v.setStyle("position","relative"),v.setStyle("height",Math.floor(100*v.height+v.depth)/100,"em"),v.setStyle("vertical-align",-Math.floor(100*v.height)/100,"em");const C=new qi({parent:r},this.style),P=C.toEm((a=this.padding)!=null?a:{register:"fboxsep"}),z=new ur(null,{classes:"ML__box"});z.height=v.height+P,z.depth=v.depth+P,z.setStyle("box-sizing","border-box"),z.setStyle("position","absolute"),z.setStyle("top",-P+.3,"em"),z.setStyle("left",0),z.setStyle("height",z.height+z.depth,"em"),z.setStyle("width","100%"),this.backgroundcolor&&z.setStyle("background-color",(u=C.toColor(this.backgroundcolor))!=null?u:"transparent"),this.framecolor&&z.setStyle("border",`${C.getRegisterAsEm("fboxrule",2)}em solid ${(f=C.toColor(this.framecolor))!=null?f:"black"}`),this.border&&z.setStyle("border",this.border);const Q=new ur([z,v],{type:"lift"});return Q.setStyle("display","inline-block"),Q.setStyle("position","relative"),Q.setStyle("line-height",0),Q.height=v.height+P+(A>0?A:0),Q.depth=v.depth+P+(A<0?-A:0),Q.setStyle("padding-left",P,"em"),Q.setStyle("padding-right",P,"em"),Q.setStyle("height",Math.floor(100*(v.height+v.depth+2*P+Math.abs(A)))/100,"em"),Q.setStyle("margin-top",-P,"em"),Q.setStyle("top",Math.floor(100*(v.depth-v.height+2*P-A))/100,"em"),Q.setStyle("vertical-align",Math.floor(100*(v.depth+2*P))/100,"em"),this.caret&&(Q.caret=this.caret),this.attachSupsub(r,{base:Q})}_serialize(r){return r.skipStyles?Xi([this.bodyToLatex(r),this.supsubToLatex(r)]):super._serialize(r)}},ch=class Pp extends $t{constructor(r,n){var a;super({type:"composition",mode:(a=n==null?void 0:n.mode)!=null?a:"math",value:r})}static fromJson(r){return new Pp(r.value,r)}toJson(){return super.toJson()}get computedStyle(){return{}}render(r){const n=new ur(this.value,{classes:"ML__composition",type:"composition"});return this.bind(r,n),this.caret&&(n.caret=this.caret),n}_serialize(r){return""}},Sl=class Op extends $t{constructor(r){super({type:"error",value:r,command:r,mode:"math"}),this.verbatimLatex=r}static fromJson(r){return new Op(r.command)}toJson(){return super.toJson()}render(r){const n=this.createBox(r,{classes:"ML__error"});return this.caret&&(n.caret=this.caret),n}},Uu=class Bp extends $t{constructor(r,n,a){super({type:"group",mode:n,style:a}),this.body=r,this.boxType=r.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,r&&r.length===1&&r[0].command===","&&(this.captureSelection=!0)}static fromJson(r){return new Bp(r.body,r.mode,r.style)}render(r){const n=$t.createBox(r,this.body,{type:this.boxType});return n?(this.caret&&(n.caret=this.caret),this.bind(r,n)):null}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=it(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):`{${this.bodyToLatex(r)}}`}},Zn=class Fp extends $t{constructor(r,n,a){super({type:"leftright",style:a.style,displayContainsHighlight:!0}),this.variant=r,this.body=n,this.leftDelim=a.leftDelim,this.rightDelim=a.rightDelim}static fromJson(r){var n;return new Fp((n=r.variant)!=null?n:"",r.body,r)}toJson(){const r=super.toJson();return this.variant&&(r.variant=this.variant),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),r}_serialize(r){var n,a;const u=this.matchingRightDelim();return this.variant==="left...right"?Xi(["\\left",(n=this.leftDelim)!=null?n:".",this.bodyToLatex(r),"\\right",u]):this.variant==="mleft...mright"?Xi(["\\mleft",(a=this.leftDelim)!=null?a:".",this.bodyToLatex(r),"\\mright",u]):Xi([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(r),u])}matchingRightDelim(){var r,n;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const a=(r=this.leftDelim)!=null?r:".";return(n=Nu[a])!=null?n:a}render(r){var n,a;const u=new qi({parent:r},this.style);console.assert(this.body!==void 0);const f=new qi({parent:r,mathstyle:"textstyle"},this.style),v=(n=$t.createBox(u,this.body,{type:"inner"}))!=null?n:new ur(null,{type:"inner"}),A=v.height/f.scalingFactor,C=v.depth/f.scalingFactor,P=[];if(this.leftDelim&&P.push(this.bind(f,zu("open",this.leftDelim,A,C,f,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),v&&(fc(v.children,this,u,A,C),P.push(v)),this.rightDelim){let Ie=this.containsCaret?" ML__contains-caret":"",ze=this.rightDelim;ze==="?"&&(u.smartFence?(ze=this.matchingRightDelim(),Ie+=" ML__smart-fence__close"):ze="."),P.push(this.bind(f,zu("close",ze,A,C,f,{isSelected:this.isSelected,classes:Ie+" ML__close",mode:this.mode,style:this.style})))}let z=this.variant==="mleft...mright";const Q=this.leftSibling;Q&&(!z&&Q.isFunction&&(z=!0),!z&&Q.type==="subsup"&&((a=Q.leftSibling)!=null&&a.isFunction)&&(z=!0));const _e=new ur(P,{type:z?"close":"inner",classes:"left-right"});return _e.setStyle("margin-top",`${-v.depth}em`),_e.setStyle("height",`${v.height+v.depth}em`),this.caret&&(_e.caret=this.caret),this.bind(u,_e.wrap(u))}};function fc(e,r,n,a,u){if(e)for(let f=0;f<e.length;f++){const v=e[f];v.type==="middle"?(e[f]=r.bind(n,zu("inner",v.value,a,u,n,{isSelected:r.isSelected})),e[f].caret=v.caret,e[f].isSelected=v.isSelected,e[f].cssId=v.cssId,e[f].htmlData=v.htmlData,e[f].htmlStyle=v.htmlStyle,e[f].attributes=v.attributes,e[f].cssProperties=v.cssProperties):v.children&&fc(v.children,r,n,a,u)}}var pc=class Np extends $t{constructor(r,n){var a;super({type:"macro",command:r,style:n.style}),this.body=n.body,n.captureSelection===void 0?n.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=n.captureSelection,this.macroArgs=n.args,this.expand=(a=n.expand)!=null?a:!1}static fromJson(r){return new Np(r.command,r)}toJson(){const r=super.toJson();return this.expand&&(r.expand=!0),this.captureSelection!==void 0&&(r.captureSelection=this.captureSelection),this.macroArgs&&(r.args=this.macroArgs),r}_serialize(r){var n;return r.expandMacro&&this.expand?this.bodyToLatex(r):this.command+((n=this.macroArgs)!=null?n:"")}render(r){const n=$t.createBox(r,this.body);return n?(this.caret&&(n.caret=this.caret),this.bind(r,n)):null}},Ed=class $p extends $t{constructor(){super({type:"macro-argument"})}static fromJson(r){return new $p}toJson(){return super.toJson()}_serialize(r){return""}render(r){return null}},mc=class zp extends $t{constructor(r,n,a=!1,u,f){var v;super({type:"prompt",mode:(v=f==null?void 0:f.mode)!=null?v:"math",style:f==null?void 0:f.style,command:"\\placeholder"}),this.body=u,this.correctness=n,this.placeholderId=r,this.locked=a,this.captureSelection=this.locked}static fromJson(r){return new zp(r.placeholderId,r.correctness,r.locked,r.body,r)}toJson(){const r=super.toJson();return this.placeholderId&&(r.placeholderId=this.placeholderId),this.body||delete r.body,this.body&&(r.body=this.body.filter(n=>n.type!=="first").map(n=>n.toJson())),this.correctness&&(r.correctness=this.correctness),r.locked=this.locked,r}render(r){const n=new qi({parent:r}),a=n.getRegisterAsEm("fboxsep"),u=a,f=a,v=$t.createBox(r,this.body);if(!v)return null;v.height||(v.height=n.metrics.xHeight),v.setStyle("vertical-align",-v.height,"em"),this.correctness==="correct"?v.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&v.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const A=new ur(v,{type:"ord"});A.setStyle("display","inline-block"),A.setStyle("height",v.height+v.depth,"em"),A.setStyle("vertical-align",-f,"em");let C="ML__prompt ";this.locked?C+=" ML__lockedPromptBox ":C+=" ML__editablePromptBox ",this.correctness==="correct"?C+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(C+=" ML__incorrectPromptBox "),this.containsCaret&&(C+=" ML__focusedPromptBox ");const P=new ur(null,{classes:C,attributes:{part:"prompt"}});P.height=A.height+f,P.depth=A.depth+f,P.width=A.width+2*u,P.setStyle("box-sizing","border-box"),P.setStyle("position","absolute"),P.setStyle("height",A.height+A.depth+2*f,"em"),u===0&&P.setStyle("width","100%"),u!==0&&(P.setStyle("width",`calc(100% + ${2*u}em)`),P.setStyle("top",a,"em"),P.setStyle("left",-u,"em")),(!this.body||this.body.length===1)&&(P.width=3*u,P.setStyle("width",`calc(100% + ${3*u}em)`),P.setStyle("left",-1.5*u,"em"));let z="";this.correctness==="incorrect"&&(z+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),z&&(P.svgOverlay=z);const Q=new ur([P,A],{classes:"ML__prompt-atom"});return Q.setStyle("position","relative"),Q.setStyle("display","inline-block"),Q.setStyle("line-height",0),Q.height=A.height+f+.2,Q.depth=A.depth+f,Q.left=u,Q.right=u,Q.setStyle("height",A.height+f,"em"),Q.setStyle("top",A.depth-A.height,"em"),Q.setStyle("vertical-align",A.depth+f,"em"),Q.setStyle("margin-left",.5,"em"),Q.setStyle("margin-right",.5,"em"),this.caret&&(Q.caret=this.caret),this.bind(n,this.attachSupsub(r,{base:Q}))}_serialize(r){var n;const a=(n=this.bodyToLatex(r))!=null?n:"";if(r.skipPlaceholders)return a;let u="\\placeholder";return this.placeholderId&&(u+=`[${this.placeholderId}]`),this.correctness==="correct"?u+="[correct]":this.correctness==="incorrect"&&(u+="[incorrect]"),this.locked&&(u+="[locked]"),Kn(u,a)}},C0=class Up extends $t{constructor(r){super({type:"subsup",style:r==null?void 0:r.style}),this.subsupPlacement="auto"}static fromJson(r){const n=new Up(r);for(const a of bl)r[a]&&n.setChildren(r[a],a);return n}render(r){var n;const a=new qi({parent:r,isPhantom:!0}),u=this.leftSibling,f=(n=u.render(a))!=null?n:new ur(null),v=new ur(null);return v.height=f.height,v.depth=f.depth,this.attachSupsub(r,{base:v,isCharacterBox:u.isCharacterBox(),type:"ignore"})}_serialize(r){return this.supsubToLatex(r)}};function iu(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var hh=class{constructor(e,r,n){this.errors=[],this.index=0,this.endCount=0;var a,u,f,v;n!=null||(n={}),this.tokens=e,this.context=r instanceof qi&&!(n!=null&&n.parseMode)&&!n.mathstyle?r:new qi({from:r,mathstyle:n.mathstyle},n.style),this.args=(a=n.args)!=null?a:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(u=n.style)!=null?u:{},parseMode:(f=n.parseMode)!=null?f:"math",mathstyle:(v=n.mathstyle)!=null?v:"displaystyle",tabular:!1}}beginContext(e){var r,n,a;const u=this.parsingContext,f={parent:u,mathlist:[],style:$({},u.style),parseMode:(r=e==null?void 0:e.mode)!=null?r:u.parseMode,mathstyle:(n=e==null?void 0:e.mathstyle)!=null?n:u.mathstyle,tabular:(a=e==null?void 0:e.tabular)!=null?a:!1};this.parsingContext=f}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push($({before:ql(this.tokens.slice(this.index,this.index+10)),after:ql(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return $({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e?(this.index++,!0):!1}lastSubsupAtom(){let e;return this.mathlist.length>0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new C0({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:r}=this;if(r<this.tokens.length&&this.tokens[r].startsWith("\\")){const n=it(this.tokens[r],this.parseMode);return!n||n.definitionType==="symbol"||n.ifMode&&!n.ifMode.includes(this.parseMode)?!1:(e=n.infix)!=null?e:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const e=this.peek();return e!=="\\\\"&&e!=="\\cr"&&e!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var e;const r=(e=this.args)==null?void 0:e.call(this,"?");return r?Us(r,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new mo({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let r=this.tokens[this.index];for(;r&&r!==e;)r=this.tokens[++this.index];r===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const r=this.index;let n=this.end(),a="";for(;!n;){const f=this.get();iu(f)?(a+=f,n=this.end()||a.length>=e.length):n=!0}const u=e.toUpperCase()===a.toUpperCase();return u||(this.index=r),u}scanString(){let e="";for(;!this.end();){const r=this.peek();if(r==="]")return e;if(r==="<space>")e+=" ";else if(r.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=r.substring(1);else if(iu(r))e+=r;else return e;this.next()}return e}scanBalancedString(){let e="",r=this.end(),n=1;for(;!r;){const a=this.get();a==="<space>"?e+=" ":a==="<{>"?(e+="{",n+=1):a==="<}>"?(n-=1,n>0?e+="}":this.index-=1):a==="<$>"?e+="$":a==="<$$>"?e+="$$":e+=a,r=n===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let r="",n=1;for(;n>0&&!this.end();){const a=this.get();a==="<}>"?(n-=1,n>0&&(r+="}")):a==="<{>"?(n+=1,r+="{"):(/\\[a-zA-Z]+$/.test(r)&&/^[a-zA-Z]/.test(a)&&(r+=" "),r+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[a])!=null?e:a)}return r}scanNumber(e=!0){var r,n;let a=!1,u=this.peek();for(;u==="<space>"||u==="+"||u==="-";)this.get(),u==="-"&&(a=!a),u=this.peek();e=!!e;let f=10,v=/\d/;if(this.match("'"))f=8,v=/[0-7]/,e=!0;else if(this.match('"'))f=16,v=/[\dA-F]/,e=!0;else if(this.match("x"))f=16,v=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return u=this.get(),u?u.length===2&&u.startsWith("\\")?{number:(a?-1:1)*((r=u.codePointAt(1))!=null?r:0),base:"alpha"}:{number:(a?-1:1)*((n=u.codePointAt(0))!=null?n:0),base:"alpha"}:null;let A="";for(;this.hasPattern(v);)A+=this.get();if(!e&&(this.match(".")||this.match(",")))for(A+=".";this.hasPattern(v);)A+=this.get();const C=e?Number.parseInt(A,f):Number.parseFloat(A);return Number.isNaN(C)?null:{number:a?-C:C,base:f===16?"hexadecimal":f===8?"octal":"decimal"}}scanRegister(){var e;const r=this.index,n=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return n;let a=!1;if(n===null)for(;;){const f=this.peek();if(f==="-")a=!a;else if(f!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const f=this.get();return f.startsWith("\\")?n?{register:f,global:!0,factor:(a?-1:1)*n.number}:a?{register:f,global:!0,factor:-1}:{register:f,global:!0}:(this.index=r,null)}let u=this.get();return u!=null&&u.startsWith("\\")?(u=u.substring(1),this.context.registers[u]?!a||n!==null?{register:u,factor:(a?-1:1)*((e=n==null?void 0:n.number)!=null?e:1)}:{register:u}:(this.index=r,null)):(this.index=r,null)}scanValue(){const e=this.scanRegister();if(e)return e;const r=this.index,n=this.scanGlueOrDimen();if(n&&("unit"in n||"glue"in n&&"unit"in n.glue))return n;this.index=r;const a=this.scanNumber();if(a)return a;if(this.end()||!iu(this.peek()))return null;const u=this.scanString();return u.length>0?{string:u}:null}scanDimen(){const e=this.scanNumber(!1);if(e===null)return null;const r=e.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let n;return this.matchKeyword("pt")?n="pt":this.matchKeyword("mm")?n="mm":this.matchKeyword("cm")?n="cm":this.matchKeyword("ex")?n="ex":this.matchKeyword("px")?n="px":this.matchKeyword("em")?n="em":this.matchKeyword("bp")?n="bp":this.matchKeyword("dd")?n="dd":this.matchKeyword("pc")?n="pc":this.matchKeyword("in")?n="in":this.matchKeyword("mu")&&(n="mu"),n?{dimension:r,unit:n}:{dimension:r}}scanGlueOrDimen(){const e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const r={glue:e};if(this.matchKeyword("plus")){const n=this.scanDimen();if(n)r.grow=n;else return r}if(this.skipWhitespace(),this.match("\\relax"))return r;if(this.skipWhitespace(),this.matchKeyword("minus")){const n=this.scanDimen();if(n)r.shrink=n;else return r}return!r.grow&&!r.shrink?e:r}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const r=this.get();r==="c"||r==="r"||r==="l"?e.push({align:r}):r==="|"?e.push({separator:"solid"}):r===":"?e.push({separator:"dashed"}):r==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan(n=>n==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});const r=this.scan(n=>n===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),r}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const r=this.scan(n=>n===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),r}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const r=Oe(e);if(!r)return this.onError({code:"unknown-environment",arg:e}),null;const n=[];if(r.params)for(const A of r.params)if(A.isOptional)n.push(this.scanOptionalArgument(A.type));else{const C=this.scanArgument(A.type);C||this.onError({code:"missing-argument",arg:e}),n.push(C)}this.beginContext({tabular:r.tabular});const a=[],u=[];let f=[],v=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),v=!0),!v&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),v=!0),!v)if(this.matchColumnSeparator())f.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){f.push(this.mathlist),this.mathlist=[];let A=null;this.skipWhitespace(),this.match("[")&&(A=this.scanDimen(),this.skipWhitespace(),this.match("]")),u.push(A!=null?A:{dimension:0}),a.push(f),f=[]}else this.mathlist.push(...this.scan(A=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(A)));while(!v);return f.push(this.mathlist),f.length>0&&a.push(f),this.endContext(),r.createAtom(e,a,u,n)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const r=this.mathlist;return this.mathlist=e,r}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=v=>v==="<}>");let r="",n=null,a=[],u=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!r?(r=this.get(),n=it(r,"math"),n&&(a=this.scanArguments(n)[1]),u=this.mathlist,this.mathlist=[]):this.parseExpression();let f;return r?(console.assert(!!n),a.unshift(this.mathlist),u&&a.unshift(u),f=[n.createAtom({command:r,args:a,style:this.style,mode:this.parseMode})]):f=this.mathlist,this.endContext(),f}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const r=this.scan(a=>a==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const n=new Uu(r,this.parseMode,this.style);return n.verbatimLatex=ql(this.tokens.slice(e,this.index)),n}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&e!==0;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),e!==0&&this.parseExpression();const r=new Zn("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),r}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!iu(e)&&!e.startsWith("\\"))return null;this.next();const r=it(e,"math");return r?r.definitionType==="function"&&r.ifMode&&!r.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):r.definitionType==="symbol"&&(r.type==="mopen"||r.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new Sl("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new Sl("\\mright");let r="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;r="\\mright"}const n=this.scanDelim();if(!n)return this.onError({code:"unexpected-delimiter"}),new Sl(r==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(r);)this.parseExpression();const a=this.mathlist;this.endContext();const u=(e=this.scanDelim())!=null?e:".";return new Zn(r==="\\right"?"left...right":"mleft...mright",a,{leftDelim:n,rightDelim:u,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;const r=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?r.addChild(new $t({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):r.addChild(new $t({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&r.addChildren(Xe(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const e=this.match("\\limits"),r=!e&&this.match("\\nolimits"),n=!r&&!e&&this.match("\\displaylimits");if(!e&&!r&&!n)return!1;const a=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return a===null?!1:(a.explicitSubsupPlacement=!0,e&&(a.subsupPlacement="over-under"),r&&(a.subsupPlacement="adjacent"),n&&(a.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let r;const n=[];let a=e.infix?2:0;for(;a<e.params.length;){const u=e.params[a];u.type==="rest"?n.push(this.scan(f=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(f))):u.isOptional?n.push(this.scanOptionalArgument(u.type)):u.type.endsWith("*")?r=u.type.slice(0,-1):n.push(this.scanArgument(u.type)),a+=1}return[r,n]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;this.next();let r;if(iu(e)){const n=Ns.createAtom(this.parseMode,e,$({},this.style));return n?[n]:null}if(r=this.scanMacro(e),r)return[r];if(e.startsWith("\\")){const n=it(e,this.parseMode);if(!n)return this.onError({code:"unknown-command",arg:e}),[new Sl(e)];if(n.definitionType==="symbol"){const a=$({},this.style);n.variant&&(a.variant=n.variant),r=new $t({type:n.type,command:e,style:a,value:String.fromCodePoint(n.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(n.applyMode||n.applyStyle||n.infix)return this.onError({code:"invalid-command",arg:e}),[new Sl(e)];n.createAtom&&(r=n.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return r?[r]:null}scanArgument(e){var r;this.skipFiller();const n=this.parseMode;if(e==="auto"&&(e=n),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(r=this.scanDelim())!=null?r:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==n&&this.beginContext({mode:"math"});const u=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),u}if(e==="text"){e!==n&&this.beginContext({mode:"text"});const u=this.scanSymbolOrLiteral();return e!==n&&this.endContext(),u}return e==="balanced-string"||console.assert(!1),null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const u=this.mathlist;return this.endContext(),{group:u}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const u=this.mathlist;return this.endContext(),{group:u}}let a=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const u=this.mathlist;return this.endContext(),{group:u}}return e==="string"?a=this.scanString():e==="balanced-string"?a=this.scanBalancedString():e==="colspec"?a=this.scanColspec():e==="value"&&(a=this.scanValue()),this.skipUntilToken("<}>"),a}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let r=null;for(;!this.end()&&!this.match("]");)if(e==="string")r=this.scanString();else if(e==="value")r=this.scanValue();else if(e==="colspec")r=this.scanColspec();else if(e==="bbox"){const n={},a=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const u of a){const f=u.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(f)n.padding={dimension:parseInt(f[1]),unit:f[2]};else{const v=u.match(/^\s*border\s*:\s*(.*)/);v?n.border=v[1]:n.backgroundcolor={string:u}}}r=n}else e==="math"&&(this.beginContext({mode:"math"}),r=this.mathlist.concat(this.scan(n=>n==="]")),this.endContext());return r}scanSymbolOrCommand(e){var r,n,a;if(e==="\\placeholder"){const A=this.scanOptionalArgument("string"),C=this.scanOptionalArgument("math"),P=$t.serialize(C,{defaultMode:"math"});let z=[],Q;!Q&&P==="correct"?Q="correct":!Q&&P==="incorrect"?Q="incorrect":P!==""&&(z=C);const _e=this.scanOptionalArgument("string")==="locked",Ie=this.scanArgument("auto");let ze;return Ie&&Array.isArray(Ie)&&Ie.length>0?ze=Ie:Ie&&typeof Ie=="object"&&"group"in Ie?ze=Ie.group:ze=z,A?[new mc(A,Q,_e,ze!=null?ze:z,{mode:this.parseMode,style:this.style})]:[new mo({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){const A=this.index,C=this.scanLiteralGroup()||this.next();if(!C)return null;if(this.context.registers[C.substring(1)]){const P=this.scanArgument("string");P!==null&&(this.context.registers[C.substring(1)]=P);const z=Xi([e,ql(this.tokens.slice(A,this.index))]);return[new $t({type:"text",value:"",verbatimLatex:z})]}}let u=this.scanMacro(e);if(u)return[u];const f=it(e,this.parseMode);if(!f)return this.parseMode==="text"?(/[a-zA-Z]/.test((r=this.peek())!=null?r:"")&&(e+=" "),[...e].map(A=>new $t({type:"text",value:A,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new Sl(e)]);const v=this.index;if(f.definitionType==="symbol"){const A=$({},this.style);f.variant&&(A.variant=f.variant),u=new $t({type:f.type,command:e,style:A,value:String.fromCodePoint(f.codepoint),mode:this.parseMode})}else{if(f.ifMode&&!f.ifMode.includes(this.parseMode))return[];const A=this.parseMode;f.applyMode&&(this.parseMode=f.applyMode);let C,P=[];if(f.parse?P=f.parse(this):[C,P]=this.scanArguments(f),this.parseMode=A,f.applyMode&&!f.applyStyle&&!f.createAtom)return Xe(P[0]);if(f.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof f.createAtom=="function")u=f.createAtom({command:e,args:P,style:this.style,mode:this.parseMode}),C&&(u.body=Xe(this.scanArgument(C)));else if(typeof f.applyStyle=="function"){const z=$($({},this.style),f.applyStyle(e,P,this.context)),Q=this.parseMode;if(f.applyMode&&(this.parseMode=f.applyMode),C){const _e=this.style;this.style=z;const Ie=this.scanArgument(C);return this.style=_e,this.parseMode=Q,Xe(Ie)}this.style=z}else u=new $t({type:"mord",command:(n=f.command)!=null?n:e,style:$({},this.style),value:e,mode:(a=f.applyMode)!=null?a:this.parseMode})}if(!u)return null;if(u instanceof $t&&u.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const A=Xi([e,ql(this.tokens.slice(v,this.index))]);A&&(u.verbatimLatex=A)}if(u.verbatimLatex===null&&(u.verbatimLatex=void 0),u.isFunction&&this.smartFence){const A=this.scanSmartFence();if(A)return[u,A]}return[u]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(iu(e)){const r=Ns.createAtom(this.parseMode,e,$({},this.style));if(!r)return null;if(r.isFunction&&this.smartFence){const n=this.scanSmartFence();if(n)return[r,n]}return[r]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new Fu(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var r;const n=this.context.getMacro(e);if(!n)return null;const a=this.index,u=n.args,f={"?":(r=this.args)==null?void 0:r.call(this,"?")};for(let v=1;v<=u;v++){let A=this.scanLiteralGroup();if(!A){const C=this.index;this.scanExpression(),A=ql(this.tokens.slice(C,this.index))}f[v]=A}return new pc(e,{expand:n.expand,captureSelection:n.captureSelection,args:a===this.index?null:ql(this.tokens.slice(a,this.index)),style:this.parsingContext.style,body:Us(n.def,{context:this.context,parseMode:this.parseMode,args:v=>f[v],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,r,n,a;let u=(a=(n=(r=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?r:this.scanModeSet())!=null?n:this.scanGroup())!=null?a:this.scanLeftRight();if(u===null){if(this.parseSupSub()||this.parseLimits())return!0;u=this.scanSymbolCommandOrLiteral()}return u?(Array.isArray(u)?this.mathlist.push(...u):this.mathlist.push(u),!0):!1}};function Us(e,r){var n,a,u,f;const v=(n=r==null?void 0:r.args)!=null?n:void 0,A=new hh(f0(e,v),r==null?void 0:r.context,{args:v,mathstyle:(a=r==null?void 0:r.mathstyle)!=null?a:"displaystyle",parseMode:(u=r==null?void 0:r.parseMode)!=null?u:"math",style:(f=r==null?void 0:r.style)!=null?f:{}}),C=[];for(;!A.end();)C.push(...A.scan(()=>!1));return C}function gc(e,r){var n;const a=new hh(f0(e,null),r==null?void 0:r.context,{mathstyle:"displaystyle",parseMode:(n=r==null?void 0:r.parseMode)!=null?n:"math"});for(;!a.end();)a.scan();return a.errors}var dh=class Kp extends $t{constructor(r,n){super({type:"chem"},{command:r,mode:"math"});const a=Fn.go(er.go(n,r==="\\pu"?"pu":"ce"),!1);this.body=Us(a),this._verbatimLatex=r+"{"+n+"}",this.arg=n,this.captureSelection=!0}static fromJson(r){return new Kp(r.command,r.arg)}set verbatimLatex(r){}get verbatimLatex(){return this._verbatimLatex}toJson(){return d($({},super.toJson()),{arg:this.arg})}render(r){const n=$t.createBox(r,this.body,{type:"inner"});return this.caret&&(n.caret=this.caret),this.bind(r,n)}_serialize(r){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};Ue(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var r;return new dh(e.command,(r=e.args[0])!=null?r:"")}});var er={go:function(e,r){if(!e)return[];r===void 0&&(r="ce");var n="0",a={};a.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var u,f=10,v=[];;){u!==e?(f=10,u=e):f--;var A=er.stateMachines[r],C=A.transitions[n]||A.transitions["*"];e:for(var P=0;P<C.length;P++){var z=er.patterns.match_(C[P].pattern,e);if(z){for(var Q=C[P].task,_e=0;_e<Q.action_.length;_e++){var Ie;if(A.actions[Q.action_[_e].type_])Ie=A.actions[Q.action_[_e].type_](a,z.match_,Q.action_[_e].option);else if(er.actions[Q.action_[_e].type_])Ie=er.actions[Q.action_[_e].type_](a,z.match_,Q.action_[_e].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Q.action_[_e].type_+")"];er.concatArray(v,Ie)}if(n=Q.nextState||n,e.length>0){if(Q.revisit||(e=z.remainder),!Q.toContinue)break e}else return v}}if(f<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,r){if(r)if(Object.prototype.toString.call(r)==="[object Array]")for(var n=0;n<r.length;n++)e.push(r[n]);else e.push(r)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var r=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return r&&r[0]?{match_:r.slice(1),remainder:e.substr(r[0].length)}:null},"(-)(9)^(-9)":function(e){var r=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return r&&r[0]?{match_:r.slice(1),remainder:e.substr(r[0].length)}:null},"state of aggregation $":function(e){var r=er.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(r&&r.remainder.match(/^($|[\s,;\)\]\}])/))return r;var n=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return n?{match_:n[0],remainder:e.substr(n[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return er.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return er.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return er.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return er.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return er.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return er.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return er.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return er.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return er.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return er.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return er.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return er.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return er.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return er.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return er.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return er.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return er.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return er.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return er.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return er.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var r;if(r=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),r)return{match_:r[0],remainder:e.substr(r[0].length)};var n=er.patterns.findObserveGroups(e,"","$","$","");return n&&(r=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),r)?{match_:r[0],remainder:e.substr(r[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var r=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,r,n,a,u,f,v,A,C,P){var z=function(xt,Wt){if(typeof Wt=="string")return xt.indexOf(Wt)!==0?null:Wt;var hr=xt.match(Wt);return hr?hr[0]:null},Q=function(xt,Wt,hr){for(var Zt=0;Wt<xt.length;){var Nr=xt.charAt(Wt),Qr=z(xt.substr(Wt),hr);if(Qr!==null&&Zt===0)return{endMatchBegin:Wt,endMatchEnd:Wt+Qr.length};if(Nr==="{")Zt++;else if(Nr==="}"){if(Zt===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];Zt--}Wt++}return Zt>0,null},_e=z(e,r);if(_e===null||(e=e.substr(_e.length),_e=z(e,n),_e===null))return null;var Ie=Q(e,_e.length,a||u);if(Ie===null)return null;var ze=e.substring(0,a?Ie.endMatchEnd:Ie.endMatchBegin);if(f||v){var St=this.findObserveGroups(e.substr(Ie.endMatchEnd),f,v,A,C);if(St===null)return null;var sr=[ze,St.match_];return{match_:P?sr.join(""):sr,remainder:St.remainder}}else return{match_:ze,remainder:e.substr(Ie.endMatchEnd)}},match_:function(e,r){var n=er.patterns.patterns[e];if(n===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof n=="function")return er.patterns.patterns[e](r);var a=r.match(n);if(a){var u;return a[2]?u=[a[1],a[2]]:a[1]?u=a[1]:u=a[0],{match_:u,remainder:r.substr(a[0].length)}}return null}},actions:{"a=":function(e,r){e.a=(e.a||"")+r},"b=":function(e,r){e.b=(e.b||"")+r},"p=":function(e,r){e.p=(e.p||"")+r},"o=":function(e,r){e.o=(e.o||"")+r},"q=":function(e,r){e.q=(e.q||"")+r},"d=":function(e,r){e.d=(e.d||"")+r},"rm=":function(e,r){e.rm=(e.rm||"")+r},"text=":function(e,r){e.text_=(e.text_||"")+r},insert:function(e,r,n){return{type_:n}},"insert+p1":function(e,r,n){return{type_:n,p1:r}},"insert+p1+p2":function(e,r,n){return{type_:n,p1:r[0],p2:r[1]}},copy:function(e,r){return r},rm:function(e,r){return{type_:"rm",p1:r||""}},text:function(e,r){return er.go(r,"text")},"{text}":function(e,r){var n=["{"];return er.concatArray(n,er.go(r,"text")),n.push("}"),n},"tex-math":function(e,r){return er.go(r,"tex-math")},"tex-math tight":function(e,r){return er.go(r,"tex-math tight")},bond:function(e,r,n){return{type_:"bond",kind_:n||r}},"color0-output":function(e,r){return{type_:"color0",color:r[0]}},ce:function(e,r){return er.go(r)},"1/2":function(e,r){var n=[];r.match(/^[+\-]/)&&(n.push(r.substr(0,1)),r=r.substr(1));var a=r.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return a[1]=a[1].replace(/\$/g,""),n.push({type_:"frac",p1:a[1],p2:a[2]}),a[3]&&(a[3]=a[3].replace(/\$/g,""),n.push({type_:"tex-math",p1:a[3]})),n},"9,9":function(e,r){return er.go(r,"9,9")}},createTransitions:function(e){var r,n,a,u,f={};for(r in e)for(n in e[r])for(a=n.split("|"),e[r][n].stateArray=a,u=0;u<a.length;u++)f[a[u]]=[];for(r in e)for(n in e[r])for(a=e[r][n].stateArray||[],u=0;u<a.length;u++){var v=e[r][n];if(v.action_){v.action_=[].concat(v.action_);for(var A=0;A<v.action_.length;A++)typeof v.action_[A]=="string"&&(v.action_[A]={type_:v.action_[A]})}else v.action_=[];for(var C=r.split("|"),P=0;P<C.length;P++)if(a[u]==="*")for(var z in f)f[z].push({pattern:C[P],task:v});else f[a[u]].push({pattern:C[P],task:v})}return f},stateMachines:{}};er.stateMachines={ce:{transitions:er.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,r){var n;if((e.d||"").match(/^[0-9]+$/)){var a=e.d;e.d=void 0,n=this.output(e),e.b=a}else n=this.output(e);return er.actions["o="](e,r),n},"d= kv":function(e,r){e.d=r,e.dType="kv"},"charge or bond":function(e,r){if(e.beginsWithBond){var n=[];return er.concatArray(n,this.output(e)),er.concatArray(n,er.actions.bond(e,r,"-")),n}else e.d=r},"- after o/d":function(e,r,n){var a=er.patterns.match_("orbital",e.o||""),u=er.patterns.match_("one lowercase greek letter $",e.o||""),f=er.patterns.match_("one lowercase latin letter $",e.o||""),v=er.patterns.match_("$one lowercase latin letter$ $",e.o||""),A=r==="-"&&(a&&a.remainder===""||u||f||v);A&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!a&&f&&(e.o="$"+e.o+"$");var C=[];return A?(er.concatArray(C,this.output(e)),C.push({type_:"hyphen"})):(a=er.patterns.match_("digits",e.d||""),n&&a&&a.remainder===""?(er.concatArray(C,er.actions["d="](e,r)),er.concatArray(C,this.output(e))):(er.concatArray(C,this.output(e)),er.concatArray(C,er.actions.bond(e,r,"-")))),C},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,r){return{type_:"state of aggregation",p1:er.go(r,"o")}},comma:function(e,r){var n=r.replace(/\s*$/,""),a=n!==r;return a&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(e,r,n){var a;if(!e.r)a=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!n||(e.sb&&a.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&n!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType==="kv"&&er.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),a.push({type_:"chemfive",a:er.go(e.a,"a"),b:er.go(e.b,"bd"),p:er.go(e.p,"pq"),o:er.go(e.o,"o"),q:er.go(e.q,"pq"),d:er.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var u;e.rdt==="M"?u=er.go(e.rd,"tex-math"):e.rdt==="T"?u=[{type_:"text",p1:e.rd||""}]:u=er.go(e.rd);var f;e.rqt==="M"?f=er.go(e.rq,"tex-math"):e.rqt==="T"?f=[{type_:"text",p1:e.rq||""}]:f=er.go(e.rq),a={type_:"arrow",r:e.r,rd:u,rq:f}}for(var v in e)v!=="parenthesisLevel"&&v!=="beginsWithBond"&&delete e[v];return a},"oxidation-output":function(e,r){var n=["{"];return er.concatArray(n,er.go(r,"oxidation")),n.push("}"),n},"frac-output":function(e,r){return{type_:"frac-ce",p1:er.go(r[0]),p2:er.go(r[1])}},"overset-output":function(e,r){return{type_:"overset",p1:er.go(r[0]),p2:er.go(r[1])}},"underset-output":function(e,r){return{type_:"underset",p1:er.go(r[0]),p2:er.go(r[1])}},"underbrace-output":function(e,r){return{type_:"underbrace",p1:er.go(r[0]),p2:er.go(r[1])}},"color-output":function(e,r){return{type_:"color",color1:r[0],color2:er.go(r[1])}},"r=":function(e,r){e.r=r},"rdt=":function(e,r){e.rdt=r},"rd=":function(e,r){e.rd=r},"rqt=":function(e,r){e.rqt=r},"rq=":function(e,r){e.rq=r},operator:function(e,r,n){return{type_:"operator",kind_:n||r}}}},a:{transitions:er.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:er.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:er.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var r={type_:"text",p1:e.text_};for(var n in e)delete e[n];return r}}}},pq:{transitions:er.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,r){return{type_:"state of aggregation subscript",p1:er.go(r,"o")}},"color-output":function(e,r){return{type_:"color",color1:r[0],color2:er.go(r[1],"pq")}}}},bd:{transitions:er.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,r){return{type_:"color",color1:r[0],color2:er.go(r[1],"bd")}}}},oxidation:{transitions:er.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,r){return{type_:"roman numeral",p1:r||""}}}},"tex-math":{transitions:er.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var r={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return r}}}},"tex-math tight":{transitions:er.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,r){e.o=(e.o||"")+"{"+r+"}"},output:function(e){if(e.o){var r={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return r}}}},"9,9":{transitions:er.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:er.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,r){var n=[];return r[0]==="+-"||r[0]==="+/-"?n.push("\\pm "):r[0]&&n.push(r[0]),r[1]&&(er.concatArray(n,er.go(r[1],"pu-9,9")),r[2]&&(r[2].match(/[,.]/)?er.concatArray(n,er.go(r[2],"pu-9,9")):n.push(r[2])),(r[3]||r[4])&&(r[3]==="e"||r[4]==="*"?n.push({type_:"cdot"}):n.push({type_:"times"}))),r[5]&&n.push("10^{"+r[5]+"}"),n},"number^":function(e,r){var n=[];return r[0]==="+-"||r[0]==="+/-"?n.push("\\pm "):r[0]&&n.push(r[0]),er.concatArray(n,er.go(r[1],"pu-9,9")),n.push("^{"+r[2]+"}"),n},operator:function(e,r,n){return{type_:"operator",kind_:n||r}},space:function(){return{type_:"pu-space-1"}},output:function(e){var r,n=er.patterns.match_("{(...)}",e.d||"");n&&n.remainder===""&&(e.d=n.match_);var a=er.patterns.match_("{(...)}",e.q||"");if(a&&a.remainder===""&&(e.q=a.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var u={d:er.go(e.d,"pu"),q:er.go(e.q,"pu")};e.o==="//"?r={type_:"pu-frac",p1:u.d,p2:u.q}:(r=u.d,u.d.length>1||u.q.length>1?r.push({type_:" / "}):r.push({type_:"/"}),er.concatArray(r,u.q))}else r=er.go(e.d,"pu-2");for(var f in e)delete e[f];return r}}},"pu-2":{transitions:er.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,r){e.rm+="^{"+r+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var r=[];if(e.rm){var n=er.patterns.match_("{(...)}",e.rm||"");n&&n.remainder===""?r=er.go(n.match_,"pu"):r={type_:"rm",p1:e.rm}}for(var a in e)delete e[a];return r}}},"pu-9,9":{transitions:er.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var r=[];if(e.text_=e.text_||"",e.text_.length>4){var n=e.text_.length%3;n===0&&(n=3);for(var a=e.text_.length-3;a>0;a-=3)r.push(e.text_.substr(a,3)),r.push({type_:"1000 separator"});r.push(e.text_.substr(0,n)),r.reverse()}else r.push(e.text_);for(var u in e)delete e[u];return r},"output-o":function(e){var r=[];if(e.text_=e.text_||"",e.text_.length>4){for(var n=e.text_.length-3,a=0;a<n;a+=3)r.push(e.text_.substr(a,3)),r.push({type_:"1000 separator"});r.push(e.text_.substr(a))}else r.push(e.text_);for(var u in e)delete e[u];return r}}}};var Fn={go:function(e,r){if(!e)return"";for(var n="",a=!1,u=0;u<e.length;u++){var f=e[u];typeof f=="string"?n+=f:(n+=Fn._go2(f),f.type_==="1st-level escape"&&(a=!0))}return!r&&!a&&n&&(n="{"+n+"}"),n},_goInner:function(e){return e&&Fn.go(e,!0)},_go2:function(e){var r;switch(e.type_){case"chemfive":r="";var n={a:Fn._goInner(e.a),b:Fn._goInner(e.b),p:Fn._goInner(e.p),o:Fn._goInner(e.o),q:Fn._goInner(e.q),d:Fn._goInner(e.d)};n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),r+=n.a+"\\,"),(n.b||n.p)&&(r+="{\\vphantom{X}}",r+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",r+="{\\vphantom{X}}",r+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(n.b||"")+"}}",r+="_{\\vphantom{2}\\llap{\\smash[t]{"+(n.p||"")+"}}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),r+=n.o),e.dType==="kv"?((n.d||n.q)&&(r+="{\\vphantom{X}}"),n.d&&(r+="^{"+n.d+"}"),n.q&&(r+="_{\\smash[t]{"+n.q+"}}")):e.dType==="oxidation"?(n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}"),n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}")):(n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}"),n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}"));break;case"rm":r="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),r="\\mathrm{"+e.p1+"}"):r="\\text{"+e.p1+"}";break;case"roman numeral":r="\\mathrm{"+e.p1+"}";break;case"state of aggregation":r="\\mskip2mu "+Fn._goInner(e.p1);break;case"state of aggregation subscript":r="\\mskip1mu "+Fn._goInner(e.p1);break;case"bond":if(r=Fn._getBond(e.kind_),!r)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var a="\\frac{"+e.p1+"}{"+e.p2+"}";r="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"pu-frac":var u="\\frac{"+Fn._goInner(e.p1)+"}{"+Fn._goInner(e.p2)+"}";r="\\mathchoice{\\textstyle"+u+"}{"+u+"}{"+u+"}{"+u+"}";break;case"tex-math":r=e.p1+" ";break;case"frac-ce":r="\\frac{"+Fn._goInner(e.p1)+"}{"+Fn._goInner(e.p2)+"}";break;case"overset":r="\\overset{"+Fn._goInner(e.p1)+"}{"+Fn._goInner(e.p2)+"}";break;case"underset":r="\\underset{"+Fn._goInner(e.p1)+"}{"+Fn._goInner(e.p2)+"}";break;case"underbrace":r="\\underbrace{"+Fn._goInner(e.p1)+"}_{"+Fn._goInner(e.p2)+"}";break;case"color":r="{\\color{"+e.color1+"}{"+Fn._goInner(e.color2)+"}}";break;case"color0":r="\\color{"+e.color+"}";break;case"arrow":var f={rd:Fn._goInner(e.rd),rq:Fn._goInner(e.rq)},v=Fn._getArrow(e.r);f.rd||f.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(v="\\long"+v,f.rd&&(v="\\overset{"+f.rd+"}{"+v+"}"),f.rq&&(e.r==="<-->"?v="\\underset{\\lower2mu{"+f.rq+"}}{"+v+"}":v="\\underset{\\lower6mu{"+f.rq+"}}{"+v+"}"),v=" {}\\mathrel{"+v+"}{} "):(f.rq&&(v+="[{"+f.rq+"}]"),v+="{"+f.rd+"}",v=" {}\\mathrel{\\x"+v+"}{} "):v=" {}\\mathrel{\\long"+v+"}{} ",r=v;break;case"operator":r=Fn._getOperator(e.kind_);break;case"1st-level escape":r=e.p1+" ";break;case"space":r=" ";break;case"entitySkip":r="~";break;case"pu-space-1":r="~";break;case"pu-space-2":r="\\mkern3mu ";break;case"1000 separator":r="\\mkern2mu ";break;case"commaDecimal":r="{,}";break;case"comma enumeration L":r="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":r="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":r="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":r="\\text{-}";break;case"addition compound":r="\\,{\\cdot}\\,";break;case"electron dot":r="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":r="{\\times}";break;case"prime":r="\\prime ";break;case"cdot":r="\\cdot ";break;case"tight cdot":r="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":r="\\times ";break;case"circa":r="{\\sim}";break;case"^":r="uparrow";break;case"v":r="downarrow";break;case"ellipsis":r="\\ldots ";break;case"/":r="/";break;case" / ":r="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return r},_getArrow:function(e){switch(e){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function vf(e){}function yf(e){}var fh=class Hp extends $t{constructor(r){super(d($({},r),{type:"delim"})),this.value=r.delim,this.size=r.size}static fromJson(r){return new Hp(r)}toJson(){return d($({},super.toJson()),{delim:this.value,size:this.size})}render(r){return new ur(this.value,{type:"middle"})}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=it(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):Kn(this.command,this.value)}},vc=class Gp extends $t{constructor(r){super(d($({},r),{type:"sizeddelim",value:r.delim})),this.delimType=r.delimType,this.size=r.size}static fromJson(r){return new Gp(r)}toJson(){return d($({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(r){let n=uc(this.value,this.size,r,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return n?(n=this.bind(r,n),this.caret&&(n.caret=this.caret),n):null}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=it(this.command,this.mode);return n!=null&&n.serialize?n.serialize(this,r):Kn(this.command,this.value)}},Ku=class Vp extends $t{constructor(r,n,a,u){var f,v;super({type:"enclose",command:r,style:u.style}),this.body=n,this.backgroundcolor=u.backgroundcolor,a.updiagonalarrow&&(a.updiagonalstrike=!1),a.box&&(a.left=!1,a.right=!1,a.bottom=!1,a.top=!1),this.notation=a,this.shadow=(f=u.shadow)!=null?f:"none",this.strokeWidth=(v=u.strokeWidth)!=null?v:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=u.strokeStyle,this.svgStrokeStyle=u.svgStrokeStyle,this.strokeColor=u.strokeColor,this.borderStyle=u.borderStyle,this.padding=u.padding,this.captureSelection=!1}static fromJson(r){return new Vp(r.command,r.body,r.notation,r)}toJson(){return d($({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(r){var n;if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=it(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,r);let u=(n=this.command)!=null?n:"";if(this.command==="\\enclose"){u+="{"+Object.keys(this.notation).join(" ")+"}";let f="",v="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(f+=v+'mathbackground="'+this.backgroundcolor+'"',v=","),this.shadow&&this.shadow!=="auto"&&(f+=v+'shadow="'+this.shadow+'"',v=","),this.strokeWidth||this.strokeStyle!=="solid"?(f+=v+this.borderStyle,v=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(f+=v+'mathcolor="'+this.strokeColor+'"',v=","),f&&(u+=`[${f}]`)}return Kn(u,this.bodyToLatex(r))}render(r){const n=new qi({parent:r},this.style),a=$t.createBox(n,this.body);if(!a)return null;const u=Ad(this.borderStyle),f=n.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});a.setStyle("position","relative"),a.setStyle("display","inline-block"),a.setStyle("top",f,"em"),a.setStyle("height",a.height+a.depth,"em"),a.setStyle("width",a.width,"em");const v=new ur(null,{classes:"ML__notation"});let A=a.height+a.depth+2*f;const C=a.width+2*f;let P="";if(this.notation.horizontalstrike&&(P+=this.line(3,50,97,50)),this.notation.verticalstrike&&(P+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(P+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(P+=this.line(3,3,97,97)),this.notation.updiagonalarrow){P+=this.line(f.toString(),(f+a.depth+a.height).toString(),(f+a.width).toString(),f.toString());const ze=.03*Math.sqrt(C*C+A*A)*1,St=a.width*ze,sr=(a.depth+a.height)*ze,xt=f+a.width;let Wt=f;Wt+sr-.4*St<0&&(Wt=.4*St-sr),P+='<polygon points="',P+=`${xt},${Wt} ${xt-St-.4*sr},${Wt+sr-.4*St} `,P+=`${xt-.7*St},${Wt+.7*sr} ${xt-St+.4*sr},${Wt+sr+.4*St} `,P+=`${xt},${Wt}`,P+=`" stroke='none' fill="${this.strokeColor}"`,P+="/>"}let z=0;if(this.notation.phasorangle){const _e=M0(n),Ie=(a.height+a.depth+2*_e+f).toString(),ze=(a.height+a.depth)/2;P+=this.line(f.toString(),Ie,(f+ze+a.width).toString(),Ie),P+=this.line(f.toString(),Ie,(f+ze).toString(),(f-_e).toString()),A+=_e,z=ze,a.left+=A/2-f}if(this.notation.longdiv){const _e=M0(n);A+=_e,P+=this.line(f.toString(),f.toString(),(f+a.width).toString(),f.toString());const Ie=.3;z=Ie+_e,a.left+=Ie+_e,a.setTop(f+_e),P+='<path d="',P+=`M ${f} ${f} a${Ie} ${(a.depth+a.height+2*_e)/2}, 0, 1, 1, 0 ${a.depth+a.height+2*_e} "`,P+=` stroke-width="${kd(n)}" stroke="${this.strokeColor}" fill="none"`,P+="/>"}if(v.width=a.width+2*f+z,v.height=a.height+f,v.depth=a.depth+f,v.setStyle("box-sizing","border-box"),v.setStyle("left",`calc(-${u} / 2 )`),v.setStyle("height",`${Math.floor(100*A)/100}em`),v.setStyle("top",`calc(${u} / 2 )`),this.backgroundcolor&&v.setStyle("background-color",this.backgroundcolor),this.notation.box&&v.setStyle("border","1px solid red"),this.notation.actuarial&&(v.setStyle("border-top",this.borderStyle),v.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(v.setStyle("border-bottom",this.borderStyle),v.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(v.setStyle("border-radius","8px"),v.setStyle("border",this.borderStyle)),this.notation.circle&&(v.setStyle("border-radius","50%"),v.setStyle("border",this.borderStyle)),this.notation.top&&v.setStyle("border-top",this.borderStyle),this.notation.left&&v.setStyle("border-left",this.borderStyle),this.notation.right&&v.setStyle("border-right",this.borderStyle),this.notation.bottom&&v.setStyle("border-bottom",this.borderStyle),P){let _e="";this.shadow==="auto"&&(_e+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(_e+=`filter: drop-shadow(${this.shadow})`),_e+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,_e+=' stroke-linecap="round"',this.svgStrokeStyle&&(_e+=` stroke-dasharray="${this.svgStrokeStyle}"`),v.svgStyle=_e,v.svgOverlay=P}const Q=new ur([v,a]);return Q.setStyle("position","relative"),Q.setStyle("vertical-align",f,"em"),Q.setStyle("height",`${Math.floor(100*(a.height+a.depth+2*f))/100}em`),Q.setStyle("display","inline-block"),Q.height=v.height,Q.depth=v.depth,Q.width=v.width-2*f,Q.left=f,Q.right=f,this.caret&&(Q.caret=this.caret),Q.wrap(n)}line(r,n,a,u){return`<line x1="${D0(r)}" y1="${D0(n)}" x2="${D0(a)}" y2="${D0(u)}" vector-effect="non-scaling-stroke"></line>`}};function D0(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function Ad(e){if(!e)return"1px";const r=e.match(/([0-9][a-zA-Z\%]+)/);return r===null?"1px":r[1]}function kd(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function M0(e){const r=e.isDisplayStyle?ha:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*r/4}var nu=class Wp extends $t{constructor(r,n,a){var u,f;super(d($({},a),{type:"genfrac",displayContainsHighlight:!0})),this.above=r,this.below=n,this.hasBarLine=(u=a==null?void 0:a.hasBarLine)!=null?u:!0,this.continuousFraction=(f=a==null?void 0:a.continuousFraction)!=null?f:!1,this.numerPrefix=a==null?void 0:a.numerPrefix,this.denomPrefix=a==null?void 0:a.denomPrefix,this.mathstyleName=a==null?void 0:a.mathstyleName,this.leftDelim=a==null?void 0:a.leftDelim,this.rightDelim=a==null?void 0:a.rightDelim,this.fractionNavigationOrder=a==null?void 0:a.fractionNavigationOrder}static fromJson(r){return new Wp(r.above,r.below,r)}toJson(){const r={};return this.continuousFraction&&(r.continuousFraction=!0),this.numerPrefix&&(r.numerPrefix=this.numerPrefix),this.denomPrefix&&(r.denomPrefix=this.denomPrefix),this.leftDelim&&(r.leftDelim=this.leftDelim),this.rightDelim&&(r.rightDelim=this.rightDelim),this.hasBarLine||(r.hasBarLine=!1),this.mathstyleName&&(r.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(r.fractionNavigationOrder=this.fractionNavigationOrder),$($({},super.toJson()),r)}get children(){if(this._children)return this._children;const r=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const n of this.below)r.push(...n.children),r.push(n);for(const n of this.above)r.push(...n.children),r.push(n)}else{for(const n of this.above)r.push(...n.children),r.push(n);for(const n of this.below)r.push(...n.children),r.push(n)}return this._children=r,r}render(r){var n,a;const u=new qi({parent:r,mathstyle:this.mathstyleName},this.style),f=u.metrics,v=new qi({parent:u,mathstyle:this.continuousFraction?"":"numerator"},this.style),A=this.numerPrefix?new ur([new ur(this.numerPrefix),$t.createBox(v,this.above)],{isTight:v.isTight,type:"ignore"}):(n=$t.createBox(v,this.above,{type:"ignore"}))!=null?n:new ur(null,{type:"ignore"}),C=new qi({parent:u,mathstyle:this.continuousFraction?"":"denominator"},this.style),P=this.denomPrefix?new ur([new ur(this.denomPrefix),$t.createBox(C,this.below,{type:"ignore"})]):(a=$t.createBox(C,this.below,{type:"ignore"}))!=null?a:new ur(null,{type:"ignore"}),z=this.hasBarLine?f.defaultRuleThickness:0;let Q,_e=0,Ie;u.isDisplayStyle?(Q=v.metrics.num1,_e=z>0?3*z:7*z,Ie=C.metrics.denom1):(z>0?(Q=v.metrics.num2,_e=z):(Q=v.metrics.num3,_e=3*f.defaultRuleThickness),Ie=C.metrics.denom2);const ze=[];this.isSelected&&ze.push("ML__selected");const St=A.depth,sr=P.height;let xt;if(z<=0){const Wr=Q-St-(sr-Ie);Wr<_e&&(Q+=(_e-Wr)/2,Ie+=(_e-Wr)/2),xt=new gs({individualShift:[{box:A,shift:-Q,classes:[...ze,"ML__center"]},{box:P,shift:Ie,classes:[...ze,"ML__center"]}]}).wrap(u)}else{const Wr=new ur(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Wr.softWidth=Math.max(A.width,P.width),Wr.height=z/2,Wr.depth=z/2;const Yi=ca+z/2;Q<_e+St+Yi&&(Q=_e+St+Yi);const En=ca-z/2;Ie<_e+sr-En&&(Ie=_e+sr-En),xt=new gs({individualShift:[{box:P,shift:Ie,classes:[...ze,"ML__center"]},{box:Wr,shift:-En,classes:ze},{box:A,shift:-Q,classes:[...ze,"ML__center"]}]}).wrap(u)}const Wt=u.isDisplayStyle?f.delim1:f.delim2,hr=this.leftDelim?this.bind(r,tu("open",this.leftDelim,Wt,!0,r,{style:this.style,mode:this.mode,isSelected:this.isSelected})):po(u,"open");let Zt=null;this.continuousFraction?Zt=new ur(null,{type:"close"}):this.rightDelim?Zt=this.bind(r,tu("close",this.rightDelim,Wt,!0,r,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Zt=po(u,"close");const Nr=new ur([hr,xt,Zt],{isTight:u.isTight,type:"inner",classes:"mfrac"}),Qr=this.bind(r,Nr);return this.caret&&(Qr.caret=this.caret),this.attachSupsub(r,{base:Qr})}},us=class jp extends $t{constructor(r,n){var a;super({type:"latex",value:r,mode:"latex"}),this.isSuggestion=(a=n==null?void 0:n.isSuggestion)!=null?a:!1,this.isError=!1}static fromJson(r){const n=new jp(r.value);return r.isSuggestion&&(n.isSuggestion=!0),r.isError&&(n.isError=!0),n}toJson(){const r={};return this.isSuggestion&&(r.isSuggestion=!0),this.isError&&(r.isError=!0),$({type:"latex",value:this.value},r)}get computedStyle(){return{}}render(r){const n=new ur(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return n?(this.caret&&(n.caret=this.caret),this.bind(r,n)):null}},Hu=class qp extends $t{constructor(r){super({type:"latexgroup",mode:"latex"}),this.body=[...r].map(n=>new us(n)),this.skipBoundary=!1}static fromJson(r){return new qp("")}toJson(){return super.toJson()}render(r){const n=$t.createBox(r,this.body);return n?(this.caret&&(n.caret=this.caret),this.bind(r,n)):null}_serialize(r){var n,a;return(a=(n=this.body)==null?void 0:n.map(u=>u.value).join(""))!=null?a:""}},yc=class Zp extends $t{constructor(r,n){super(d($({},n),{type:"extensible-symbol",isFunction:n==null?void 0:n.isFunction})),this.value=r,this.variant=n==null?void 0:n.variant,this.subsupPlacement=n==null?void 0:n.limits}static fromJson(r){return new Zp(r.symbol,r)}toJson(){const r=super.toJson();return this.variant&&(r.variant=this.variant),this.subsupPlacement&&(r.limits=this.subsupPlacement),this.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),this.value&&(r.symbol=this.value),r}render(r){var n;const a=r.isDisplayStyle&&this.value!=="\\smallint",u=new ur(this.value,{fontFamily:a?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(a?"large-op":"small-op"),type:"op",maxFontSize:r.scalingFactor,isSelected:this.isSelected});if(!u)return null;u.right=u.italic;const f=(u.height-u.depth)/2-ca*r.scalingFactor,v=u.italic;u.setTop(f);let A=u;if(this.superscript||this.subscript){const C=(n=this.subsupPlacement)!=null?n:"auto";A=C==="over-under"||C==="auto"&&r.isDisplayStyle?this.attachLimits(r,{base:u,baseShift:f,slant:v}):this.attachSupsub(r,{base:u})}return new ur(this.bind(r,A),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(r)}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=it(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,r);const a=[];return a.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&a.push("\\limits"),this.subsupPlacement==="adjacent"&&a.push("\\nolimits"),this.subsupPlacement==="auto"&&a.push("\\displaylimits")),a.push(this.supsubToLatex(r)),Xi(a)}},El=class Yp extends $t{constructor(r){const n=r.body;super(d($({},r),{type:"overlap",body:typeof n=="string"?[new $t({value:n})]:n,style:r==null?void 0:r.style})),this.skipBoundary=!0,this.align=r==null?void 0:r.align,this.boxType=r==null?void 0:r.boxType}static fromJson(r){return new Yp(r)}toJson(){const r={};return this.align&&(r.align=this.align),this.boxType&&(r.boxType=this.boxType),$($({},super.toJson()),r)}render(r){const n=$t.createBox(r,this.body,{classes:"inner"});return n?(this.caret&&(n.caret=this.caret),this.bind(r,new ur([n,new ur(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Aa=class Xp extends $t{constructor(r){var n,a,u,f;super({type:"overunder",command:r.command,style:r.style,mode:r.mode,body:r.body,skipBoundary:(n=r.skipBoundary)!=null?n:!0}),this.subsupPlacement=r.supsubPlacement,this.svgAbove=r.svgAbove,this.svgBelow=r.svgBelow,this.svgBody=r.svgBody,this.above=r.above,this.below=r.below,this.boxType=(a=r.boxType)!=null?a:"ord",this.paddedBody=(u=r.paddedBody)!=null?u:!1,this.paddedLabels=(f=r.paddedLabels)!=null?f:!1}static fromJson(r){return new Xp(r)}toJson(){const r=super.toJson();return this.skipBoundary||(r.skipBoundary=!1),this.subsupPlacement&&(r.subsupPlacement=this.subsupPlacement),this.svgAbove&&(r.svgAbove=this.svgAbove),this.svgBelow&&(r.svgBelow=this.svgBelow),this.svgBody&&(r.svgBody=this.svgBody),this.boxType!=="ord"&&(r.boxType=this.boxType),this.paddedBody&&(r.paddedBody=!0),this.paddedLabels&&(r.paddedLabels=!0),r}render(r){let n=this.svgBody?g0(this.svgBody):$t.createBox(r,this.body,{type:"ignore"});const a=new qi({parent:r,mathstyle:"scriptstyle"},this.style);let u=null;this.svgAbove?u=g0(this.svgAbove):this.above&&(u=$t.createBox(a,this.above,{type:"ignore"}));let f=null;this.svgBelow?f=g0(this.svgBelow):this.below&&(f=$t.createBox(a,this.below,{type:"ignore"})),this.paddedBody&&(n=new ur([po(r,"open"),n,po(r,"close")],{type:"ignore"}));let v=ph(r,{base:n,above:u,below:f,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return v?(this.subsupPlacement==="over-under"?v=this.attachLimits(r,{base:v,type:v.type}):v=this.attachSupsub(r,{base:v}),this.caret&&(v.caret=this.caret),this.bind(r,v)):null}};function ph(e,r){if(!r.base)return null;if(!r.above&&!r.below){const A=new ur(r.base,{type:r.type});return A.setStyle("position","relative"),A}let n=0;r.above&&(n=e.metrics.bigOpSpacing5);let a=null;const u=r.base,f=0,v=["ML__center"];if(r.paddedAboveBelow&&v.push("ML__label_padding"),r.below&&r.above){const A=e.metrics.bigOpSpacing5+r.below.height+r.below.depth+u.depth+f;a=new gs({bottom:A,children:[e.metrics.bigOpSpacing5,{box:r.below,classes:v},{box:u,classes:["ML__center"]},n,{box:r.above,classes:v},e.metrics.bigOpSpacing5]})}else r.below?a=new gs({top:u.height-f,children:[e.metrics.bigOpSpacing5,{box:r.below,classes:v},{box:u,classes:["ML__center"]}]}):r.above&&(a=new gs({bottom:u.depth+f,children:[{box:u,classes:["ML__center"]},n,{box:r.above,classes:v},e.metrics.bigOpSpacing5]}));return new ur(a,{type:r.type})}var su=class Jp extends $t{constructor(r){var n,a,u,f;super(d($({},r),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(n=r.isInvisible)!=null?n:!1,this.smashDepth=(a=r.smashDepth)!=null?a:!1,this.smashHeight=(u=r.smashHeight)!=null?u:!1,this.smashWidth=(f=r.smashWidth)!=null?f:!1}static fromJson(r){return new Jp(r)}toJson(){const r={};return this.isInvisible&&(r.isInvisible=!0),this.smashDepth&&(r.smashDepth=!0),this.smashHeight&&(r.smashHeight=!0),this.smashWidth&&(r.smashWidth=!0),$($({},super.toJson()),r)}render(r){const n=new qi({parent:r,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),$t.createBox(n,this.body,{classes:"inner"});const a=$t.createBox(this.isInvisible?n:r,this.body);if(!a)return null;if(this.smashWidth){const u=new ur(null,{classes:"fix"});return new ur([a,u],{classes:"rlap"}).wrap(r)}if(!this.smashHeight&&!this.smashDepth)return a;if(this.smashHeight&&(a.height=0),this.smashDepth&&(a.depth=0),a.children)for(const u of a.children)this.smashHeight&&(u.height=0),this.smashDepth&&(u.depth=0);return new gs({firstBaseline:[{box:a}]},{type:a.type}).wrap(r)}},Gu=class Qp extends $t{constructor(r){var n;super($({type:"spacing"},r)),this.width=r==null?void 0:r.width,this._braced=(n=r==null?void 0:r.braced)!=null?n:!1}static fromJson(r){return new Qp(r)}toJson(){const r=super.toJson();return this.width!==void 0&&(r.width=this.width),this._braced&&(r.braced=!0),r}render(r){var n;if(this.command==="space")return new ur(this.mode==="math"?null:" ");let a;if(this.width!==void 0)a=new ur(null,{classes:"mspace"}),a.left=r.toEm(this.width);else{const u=(n={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?n:"mediumspace";a=new ur(null,{classes:u})}return a=this.bind(r,a),this.caret&&(a.caret=this.caret),a}_serialize(r){var n;if(!r.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=it(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,r);const u=(n=this.command)!=null?n:"";return this.width===void 0?u:this._braced&&!("register"in this.width)?`${u}{${Cs(this.width)}}`:`${u}${Cs(this.width)}`}},L0=class e1 extends $t{constructor(r){var n;super(d($({},r),{type:"surd",mode:(n=r.mode)!=null?n:"math",style:r.style,displayContainsHighlight:!0,body:r.body})),this.above=r.index}static fromJson(r){return new e1(d($({},r),{index:r.above}))}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=it(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,r);const a=this.command,u=this.bodyToLatex(r);return this.above&&!this.hasEmptyBranch("above")?Kn(`${a}[${this.aboveToLatex(r)}]`,u):/^[0-9]$/.test(u)?`${a}${u}`:Kn(a,u)}get children(){if(this._children)return this._children;const r=[];if(this.above)for(const n of this.above)r.push(...n.children),r.push(n);if(this.body)for(const n of this.body)r.push(...n.children),r.push(n);return this._children=r,r}render(r){var n;const a=new qi({parent:r,mathstyle:"cramp"},this.style),u=(n=$t.createBox(a,this.body,{type:"inner"}))!=null?n:new ur(null),f=a.scalingFactor,v=a.metrics.defaultRuleThickness/f,A=r.isDisplayStyle?ha:v,C=new ur(null,{classes:"ML__sqrt-line",style:this.style});C.height=v,C.softWidth=u.width;let P=f*(v+A/4);const Q=Math.max(f*2*A,u.height+u.depth)+P+v,_e=new qi({parent:r},this.style),Ie=this.bind(_e,new ur(tu("inner","\\surd",Q,!1,_e,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!Ie)return null;const ze=Ie.height+Ie.depth-v;ze>u.height+u.depth+P&&(P=(P+ze-(u.height+u.depth))/2),Ie.setTop(Ie.height-u.height-P);const St=this.bind(r,new gs({firstBaseline:[{box:new ur(u)},P-2*v,{box:C},v]})),sr=$t.createBox(new qi({parent:r,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!sr){const hr=new ur([Ie,St],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return hr.setStyle("display","inline-block"),hr.setStyle("height",hr.height+hr.depth,"em"),this.caret&&(hr.caret=this.caret),this.bind(r,hr)}const xt=new gs({shift:-.6*(Math.max(Ie.height,St.height)-Math.max(Ie.depth,St.depth)),children:[{box:sr}]}),Wt=new ur([new ur(xt,{classes:"ML__sqrt-index",type:"ignore"}),Ie,St],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Wt.height=Ie.height,Wt.depth=Ie.depth,this.caret&&(Wt.caret=this.caret),this.bind(r,Wt)}},mh=class extends ur{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function Al(e,r){if(!e.parent)return;const n=e.parent.children,a=n.indexOf(e);let u=a-1;for(;u>=0&&n[u].type==="ignore";)u-=1;if(u<0&&e.parent.parent&&e.parent.type==="lift"){Al(e.parent,r);return}a>0&&n[a-1].type==="skip"?n[a-1].width+=r:n.splice(a,0,new mh(r))}var Td={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},Cd={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function Dd(e){au(e,(r,n)=>{n.type==="bin"&&(!r||/^(middle|bin|op|rel|open|punct)$/.test(r.type))&&(n.type="ord"),(r==null?void 0:r.type)==="bin"&&/^(rel|close|punct)$/.test(n.type)&&(r.type="ord"),n.type!=="ignore"&&(r=n)})}function Vu(e,r){if(!e.children)return e;const n=e.children;Dd(n);const a=r.getRegisterAsEm("thinmuskip"),u=r.getRegisterAsEm("medmuskip"),f=r.getRegisterAsEm("thickmuskip");return au(n,(v,A)=>{var C,P,z;if(!v)return;const Q=v.type,_e=A.isTight?(C=Cd[Q])!=null?C:null:(P=Td[Q])!=null?P:null,Ie=(z=_e==null?void 0:_e[A.type])!=null?z:null;Ie===3&&Al(A,a),Ie===4&&Al(A,u),Ie===5&&Al(A,f)}),e}function au(e,r,n=void 0){if(!e)return n;e=[...e];for(const a of e)a.type==="lift"?n=au(a.children,r,n):a.type==="ignore"?au(a.children,r):(r(n,a),au(a.children,r),n=a);return n}var R0=class t1 extends $t{constructor(r){super({type:"tooltip",command:r.command,mode:r.mode,style:r.style,body:r.body,displayContainsHighlight:!0}),this.tooltip=new $t({type:"root",mode:r.content,body:r.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(r){return new t1(d($({},r),{tooltip:$o(r.tooltip)}))}toJson(){var r;const n=(r=this.tooltip.body)==null?void 0:r.filter(a=>a.type!=="first").map(a=>a.toJson());return d($({},super.toJson()),{tooltip:n})}render(r){const n=$t.createBox(new qi,this.body);if(!n)return null;const a=new qi({parent:r,mathstyle:"displaystyle"},{fontSize:jl}),u=p0(Vu(new ur(this.tooltip.render(a),{classes:"ML__tooltip-content"}),a)),f=new ur([u,n],{classes:"ML__tooltip-container"});return this.caret&&(f.caret=this.caret),this.bind(r,f)}},No=class r1 extends $t{constructor(r,n){super(d($({},n),{type:"operator",isFunction:n==null?void 0:n.isFunction})),this.value=r,this.variant=n==null?void 0:n.variant,this.variantStyle=n==null?void 0:n.variantStyle,this.subsupPlacement=n==null?void 0:n.limits}static fromJson(r){return new r1(r.symbol,r)}toJson(){const r=super.toJson();return this.variant&&(r.variant=this.variant),this.variantStyle&&(r.variantStyle=this.variantStyle),this.subsupPlacement&&(r.limits=this.subsupPlacement),this.value&&(r.symbol=this.value),r}render(r){var n;const a=new ur(this.value,{type:"op",mode:"math",maxFontSize:r.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:r.letterShapeStyle});let u=a;if(this.superscript||this.subscript){const f=(n=this.subsupPlacement)!=null?n:"auto";u=f==="over-under"||f==="auto"&&r.isDisplayStyle?this.attachLimits(r,{base:a}):this.attachSupsub(r,{base:a})}return new ur(this.bind(r,u),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(r)}_serialize(r){if(!(r.expandMacro||r.skipStyles||r.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=it(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,r);const a=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&a.push("\\limits"),this.subsupPlacement==="adjacent"&&a.push("\\nolimits"),this.subsupPlacement==="auto"&&a.push("\\displaylimits")),a.push(this.supsubToLatex(r)),Xi(a)}};function $o(e){if(k(e))return e.map(a=>$o(a));if(typeof e=="string")return $t.fromJson(e);e=$({},e);for(const a of bl)e[a]&&(e[a]=$o(e[a]));e.args&&(e.args=Md(e.args)),e.array&&(e.array=$o(e.array));const r=e.type;let n;r==="accent"&&(n=eu.fromJson(e)),r==="array"&&(n=an.fromJson(e)),r==="box"&&(n=Za.fromJson(e)),r==="chem"&&(n=dh.fromJson(e)),r==="composition"&&(n=ch.fromJson(e)),r==="delim"&&(n=fh.fromJson(e)),r==="enclose"&&(n=Ku.fromJson(e)),r==="error"&&(n=Sl.fromJson(e)),r==="extensible-symbol"&&(n=yc.fromJson(e)),r==="genfrac"&&(n=nu.fromJson(e)),r==="group"&&(n=Uu.fromJson(e)),r==="latex"&&(n=us.fromJson(e)),r==="latexgroup"&&(n=Hu.fromJson(e)),r==="leftright"&&(n=Zn.fromJson(e)),r==="macro"&&(n=pc.fromJson(e)),r==="macro-argument"&&(n=Ed.fromJson(e)),r==="operator"&&(n=No.fromJson(e)),r==="overlap"&&(n=El.fromJson(e)),r==="overunder"&&(n=Aa.fromJson(e)),r==="placeholder"&&(n=mo.fromJson(e)),r==="prompt"&&(n=mc.fromJson(e)),r==="phantom"&&(n=su.fromJson(e)),r==="sizeddelim"&&(n=vc.fromJson(e)),r==="spacing"&&(n=Gu.fromJson(e)),r==="subsup"&&(n=C0.fromJson(e)),r==="surd"&&(n=L0.fromJson(e)),r==="text"&&(n=Fu.fromJson(e)),r==="tooltip"&&(n=R0.fromJson(e)),n||(console.assert(!r||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(r),`MathLive 0.98.5: an unexpected atom type "${r}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),n=$t.fromJson(e));for(const a of bl)e[a]&&n.setChildren(e[a],a);return e.verbatimLatex!==void 0&&(n.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(n.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(n.explicitSubsupPlacement=!0),e.isFunction&&(n.isFunction=!0),e.isExtensibleSymbol&&(n.isExtensibleSymbol=!0),e.skipBoundary&&(n.skipBoundary=!0),e.captureSelection&&(n.captureSelection=!0),n}function Md(e){if(e&&Array.isArray(e))return e.map(r=>r==="<null>"?null:typeof r=="object"&&"group"in r?{group:r.group.map(n=>$o(n))}:typeof r=="object"&&"atoms"in r?r.atoms.map(n=>$o(n)):r)}var gh={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},bc={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},vh=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,yh=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,_c=[/^[a-z]$/,/^[A-Z]$/,vh,yh],Ld={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},zo=class extends Ns{constructor(){super("math")}createAtom(e,r,n){var a,u,f,v;if(r===null)return new $t({type:"mord",mode:"math",command:e,value:e,style:n});const A=window.MathfieldElement.isFunction((a=r.command)!=null?a:e);if(r.definitionType==="symbol"){const P=new $t({type:(u=r.type)!=null?u:"mord",mode:"math",command:(f=r.command)!=null?f:e,value:String.fromCodePoint(r.codepoint),style:n});return A&&(P.isFunction=!0),e.startsWith("\\")&&(P.verbatimLatex=e),P}const C=new $t({type:"mord",mode:"math",command:(v=r.command)!=null?v:e,value:e,style:n});return A&&(C.isFunction=!0),e.startsWith("\\")&&(C.verbatimLatex=e),C}serialize(e,r){const n=h(e,d($({},r),{defaultMode:"math"}));return n.length===0||r.defaultMode!=="text"?n:["$ ",...n," $"]}getFont(e,r){console.assert(r.variant!==void 0);let{variant:n}=r,{variantStyle:a}=r;n==="normal"&&!a&&/[\u00A3\u0131\u0237]/.test(e.value)&&(n="main",a="italic"),n==="normal"&&!a&&e.value.length===1&&_c.forEach((A,C)=>{var P;A.test(e.value)&&Ld[(P=r.letterShapeStyle)!=null?P:"tex"][C]==="it"&&(a="italic")}),a==="up"&&(a=void 0);const u=a?n+"-"+a:n;console.assert(gh[u]!==void 0);const[f,v]=gh[u];return bc[n]&&!bc[n].test(e.value)?(e.value=at(e.value,n,a),null):(vh.test(e.value)&&(e.classes+=" lcGreek"),v&&(e.classes+=" "+v),f)}};function h(e,r){const{parent:n}=e[0],a=t(n);return da(e,"variant").map(u=>{const f=t(u[0]);let v="";f&&f!==a&&(v={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[f],console.assert(v!==void 0));const A=Xi(u.map(C=>C._serialize(r)));return v?Kn(v,A):A})}function t(e){if(!e)return"";const{style:r}=e;if(r.variant===void 0)return"";let n=r.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(r.variant)&&r.variantStyle&&r.variantStyle!=="up"&&(n+="-"+r.variantStyle),n}new zo;function i(e,r){return e.map(n=>n._serialize(r))}function s(e,r){return da(e,"fontShape").map(n=>{const a=i(n,r),{fontShape:u}=n[0].style;let f="";return u==="it"&&(f="\\textit"),u==="sl"&&(f="\\textsl"),u==="sc"&&(f="\\textsc"),u==="n"&&(f="\\textup"),!f&&u?`{${Kn("\\fontshape",u)}${Xi(a)}}`:f?Kn(f,Xi(a)):Xi(a)})}function o(e,r){return da(e,"fontSeries").map(n=>{const a=s(n,r),{fontSeries:u}=n[0].style;let f="";return u==="b"&&(f="\\textbf"),u==="l"&&(f="\\textlf"),u==="m"&&(f="\\textmd"),u&&!f?`{${Kn("\\fontseries",u)}${Xi(a)}}`:f?Kn(f,Xi(a)):Xi(a)})}function l(e,r){return da(e,"fontSize").map(n=>{var a,u;const f=o(n,r),v=(u=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(a=n[0].style.fontSize)!=null?a:""])!=null?u:"";return v?`${v} ${Xi(f)}`:Xi(f)})}function c(e,r,n){return da(e,"fontFamily").map(a=>{var u,f;const v=l(a,r),A=(f={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(u=a[0].style.fontFamily)!=null?u:""])!=null?f:"";return A?`\\${A}{${Xi(v)}}`:a[0].style.fontFamily?`{\\fontfamily{${a[0].style.fontFamily}} ${Xi(v)}}`:n?`\\text{${Xi(v)}}`:Xi(v)})}var p={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},y=class extends Ns{constructor(){super("text")}createAtom(e,r,n){return r&&r.definitionType==="symbol"?new Fu(e,String.fromCodePoint(r.codepoint),n!=null?n:{}):null}serialize(e,r){return c(e,d($({},r),{defaultMode:"text"}),r.defaultMode!=="text")}getFont(e,r){var n,a,u,f,v;const{fontFamily:A}=r;if(p[A]?e.classes+=" "+p[A]:A&&e.setStyle("font-family",A),r.fontShape&&(e.classes+=" ",e.classes+=(n={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[r.fontShape])!=null?n:""),r.fontSeries){const C=r.fontSeries.match(/(.?[lbm])?(.?[cx])?/);C&&(e.classes+=" ",e.classes+=(u={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(a=C[1])!=null?a:""])!=null?u:"",e.classes+=" ",e.classes+=(v={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(f=C[2])!=null?f:""])!=null?v:"")}return"Main-Regular"}};new y;var g=class extends Ns{constructor(){super("latex")}createAtom(e){return new us(e)}serialize(e,r){return e.filter(n=>n instanceof us&&!n.isSuggestion).map(n=>n.value)}getFont(){return null}};new g;var x={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},S={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},R={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},N={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},F={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},X={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},ne={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Ce={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},qe={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},$e={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},ht={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},mt={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Nt={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function gt(e){const r=e.split("+"),n={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:r.pop()};return r.includes("shift")&&(n.shift=!0),r.includes("alt")&&(n.alt=!0),r.includes("ctrl")&&(n.ctrl=!0),r.includes("cmd")&&(n.cmd=!0),r.includes("win")&&(n.win=!0),r.includes("meta")&&(n.meta=!0),n}function Tt(e){let r="";return e.shift&&(r+="shift+"),e.alt&&(r+="alt+"),e.ctrl&&(r+="ctrl+"),e.cmd&&(r+="cmd+"),e.win&&(r+="win+"),e.meta&&(r+="meta+"),r+e.key}var Vt={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},bt=[],dr;function Ir(){switch(ae()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ei(e){(!e.platform||e.platform===Ir())&&bt.push(e)}function wi(e,r){var n;const a={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return a;for(const[u,f]of Object.entries(r.mapping)){if(f[0]===e)return a.key=`[${u}]`,a;if(f[1]===e)return a.shift=!0,a.key=`[${u}]`,a;if(f[2]===e)return a.alt=!0,a.key=`[${u}]`,a;if(f[3]===e)return a.shift=!0,a.alt=!0,a.key=`[${u}]`,a}return a.key=(n=Vt[e])!=null?n:"",a}function hi(e){if(e.code)return e;const r=Object.entries(ti().mapping);let n=!1,a=!1,u="";for(let f=0;f<4;f++){for(const[v,A]of r)if(A[f]===e.key){u=v,f===3?(n=!0,a=!0):f===2?n=!0:f===1&&(a=!0);break}if(u)break}return new KeyboardEvent(e.type,d($({},e),{altKey:n,shiftKey:a,code:u}))}function Zr(e){var r,n;if(!e||e.key==="Unidentified"||e.key==="Dead")return;const a=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(const u of bt)((r=u.mapping[e.code])==null?void 0:r[a])===e.key?u.score+=1:(n=u.mapping[e.code])!=null&&n[a]&&(u.score=0);bt.sort((u,f)=>f.score-u.score)}function di(e){dr=bt.find(r=>e.startsWith(r.locale))}function ti(){return dr!=null?dr:bt[0]}function mr(){switch(Ir()){case"apple":return S;case"windows":return R;case"linux":return N}return S}switch(Ir()){case"apple":Ei(S),Ei(F),Ei(ht),Ei(Ce);break;case"windows":Ei(R),Ei(X),Ei(mt),Ei(qe);break;case"linux":Ei(N),Ei(ne),Ei(Nt),Ei($e);break}Ei(x);function br(e){var r;const n=/macos|ios/.test(ae()),a=e.split("+");let u="";for(const f of a)u&&(u+=n?"\u2009":'<span class="ML__shortcut-join">+</span>'),f.startsWith("[Key")?u+=f.slice(4,5):f.startsWith("Key")?u+=f.slice(3,4):f.startsWith("[Digit")?u+=f.slice(6,7):f.startsWith("Digit")?u+=f.slice(5,6):u+=(r={cmd:"\u2318",meta:n?"\u2318":"Ctrl",shift:n?"\u21E7":"Shift",alt:n?"\u2325":"Alt",ctrl:n?"\u2303":"Ctrl","\n":n?"\u23CE":"Return","[return]":n?"\u23CE":"Return","[enter]":n?"\u2324":"Enter","[tab]":n?"\u21E5":"Tab","[escape]":"Esc","[backspace]":n?"\u232B":"Backspace","[delete]":n?"\u2326":"Del","[pageup]":n?"\u21DE":"Page Up","[pagedown]":n?"\u21DF":"Page Down","[home]":n?"\u2912":"Home","[end]":n?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[f.toLowerCase()])!=null?r:f.toUpperCase();return u}function Ci(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const r=[...e.touches].reduce((a,u)=>({x:a.x+u.clientX,y:a.y+u.clientY}),{x:0,y:0}),n=e.touches.length;return{x:r.x/n,y:r.y/n}}}function yi(e){const r={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(r.alt=!0),e.ctrlKey&&(r.control=!0),e.metaKey&&(r.meta=!0),e.shiftKey&&(r.shift=!0)),r}function Zi(e,r){return!e&&r||e&&!r?!1:!e||!r?!0:e.alt===r.alt&&e.control===r.control&&e.shift===r.shift&&e.meta===r.meta}var dn=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function fn(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:dn.has(e.code)}function Sn(){var e;let r=document.activeElement;for(;(e=r==null?void 0:r.shadowRoot)!=null&&e.activeElement;)r=r.shadowRoot.activeElement;return r}var es=class Rl{static get scrim(){return Rl._scrim||(Rl._scrim=new Rl),Rl._scrim}static open(r){Rl.scrim.open(r)}static close(){Rl.scrim.close()}static get state(){return Rl.scrim.state}static get element(){return Rl.scrim.element}constructor(r){var n,a;this.lightDismiss=(n=r==null?void 0:r.lightDismiss)!=null?n:!0,this.translucent=(a=r==null?void 0:r.translucent)!=null?a:!1,this.state="closed"}get element(){if(this._element)return this._element;const r=document.createElement("div");return r.setAttribute("role","presentation"),r.style.position="fixed",r.style.contain="content",r.style.top="0",r.style.left="0",r.style.right="0",r.style.bottom="0",r.style.zIndex="var(--scrim-zindex, 10099)",r.style.outline="none",this.translucent?(r.style.background="rgba(255, 255, 255, .2)",r.style.backdropFilter="contrast(40%)"):r.style.background="transparent",this._element=r,r}open(r){var n;if(this.state!=="closed")return;this.state="opening",this.onDismiss=r==null?void 0:r.onDismiss,this.savedActiveElement=Sn();const{element:a}=this;((n=r==null?void 0:r.root)!=null?n:document.body).appendChild(a),a.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const u=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const f=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${f+u}px`,r!=null&&r.child&&a.append(r.child),this.state="open"}close(){var r,n,a,u;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:f}=this;f.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),f.remove(),document.body.style.overflow=(r=this.savedOverflow)!=null?r:"",document.body.style.marginRight=(n=this.savedMarginRight)!=null?n:"",Sn()!==this.savedActiveElement&&((u=(a=this.savedActiveElement)==null?void 0:a.focus)==null||u.call(a)),f.innerHTML="",this.state="closed"}handleEvent(r){this.lightDismiss&&(r.target===this._element&&r.type==="click"?(this.close(),r.preventDefault(),r.stopPropagation()):r.target===document&&(r.type==="touchmove"||r.type==="scroll")&&(this.close(),r.preventDefault(),r.stopPropagation()))}};function ia(e,r,n){let a=null,u=null,f=!1,v=!1,A=!1;const C=new AbortController,P=C.signal;return e.addEventListener("keydown",z=>{if(f||z.key==="Process"||z.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(z.code)){a=null;return}a=z,u=null,n.onKeystroke(z)?e.textContent="":a=null},{capture:!0,signal:P}),e.addEventListener("keypress",z=>{f||(a&&u&&n.onKeystroke(a),u=z)},{capture:!0,signal:P}),e.addEventListener("compositionstart",z=>{e.textContent="",f=!0,n.onCompositionStart(z.data)},{capture:!0,signal:P}),e.addEventListener("compositionupdate",z=>{f&&n.onCompositionUpdate(z.data)},{capture:!0,signal:P}),e.addEventListener("compositionend",z=>{e.textContent="",f&&(f=!1,n.onCompositionEnd(z.data))},{capture:!0,signal:P}),e.addEventListener("beforeinput",z=>z.stopImmediatePropagation(),{signal:P}),e.addEventListener("input",z=>{var Q;if(!f&&(e.textContent="",z.inputType!=="insertCompositionText")){if(z.inputType==="insertFromPaste"){z.preventDefault(),z.stopPropagation();return}n.onInput((Q=z.data)!=null?Q:""),z.preventDefault(),z.stopPropagation()}},{signal:P}),e.addEventListener("paste",z=>{e.focus({preventScroll:!0}),e.textContent="",n.onPaste(z)||z.preventDefault(),z.stopImmediatePropagation()},{signal:P}),e.addEventListener("cut",z=>n.onCut(z),{capture:!0,signal:P}),e.addEventListener("copy",z=>n.onCopy(z),{capture:!0,signal:P}),e.addEventListener("blur",z=>{var Q,_e;if(((_e=(Q=z.relatedTarget)==null?void 0:Q._mathfield)==null?void 0:_e.element)===r){e.focus({preventScroll:!0}),z.preventDefault(),z.stopPropagation();return}const Ie=es.state;if(Ie==="open"||Ie==="opening"){z.preventDefault(),z.stopPropagation();return}if(z.relatedTarget===z.target.getRootNode().host){z.preventDefault(),z.stopPropagation();return}A||v||(A=!0,a=null,u=null,n.onBlur(),A=!1)},{capture:!0,signal:P}),e.addEventListener("focus",z=>{A||v||(v=!0,n.onFocus(),v=!1)},{capture:!0,signal:P}),{dispose:()=>C.abort(),cancelComposition:()=>{f&&(e.blur(),requestAnimationFrame(()=>e.focus({preventScroll:!0})))},blur:()=>{typeof e.blur=="function"&&e.blur()},focus:()=>{!v&&typeof e.focus=="function"&&e.focus({preventScroll:!0})},hasFocus:()=>Sn()===e,setAriaLabel:z=>e.setAttribute("aria-label",z),setValue:z=>{var Q;e.textContent=z,e.style.left="-1000px",(Q=window.getSelection())==null||Q.selectAllChildren(e)},moveTo:(z,Q)=>{e.style.top=`${Q}px`,e.style.left=`${z}px`}}}function ma(e){var r;if(!e||!fn(e))return"";let n;return e.key==="Unidentified"&&e.target&&(n=e.target.value),n=(r=n!=null?n:e.key)!=null?r:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(n)&&(n=""),n}function xc(e){e=hi(e);const r=[];return e.ctrlKey&&r.push("ctrl"),e.metaKey&&r.push("meta"),e.altKey&&r.push("alt"),e.shiftKey&&r.push("shift"),r.length===0?`[${e.code}]`:(r.push(`[${e.code}]`),r.join("+"))}function Rd(e){if(O()){const r=ae(),n=e.startsWith("!"),a=e.endsWith(r);if(n&&!a||!n&&a)return!0}return e==="!other"?!1:e==="other"}function Id(e,r,n){if(e.length===0)return"";const a=Tt(gt(xc(n))),u=Tt({key:n.key,shift:n.shiftKey,alt:n.altKey,ctrl:n.ctrlKey,meta:n.metaKey||n.ctrlKey&&/macos|ios/.test(ae()),cmd:!1,win:!1});for(let f=e.length-1;f>=0;f--)if((e[f].key===a||e[f].key===u)&&(!e[f].ifMode||e[f].ifMode===r))return e[f].command;return""}function I0(e){let r=e;return k(r)&&(r=r.length>0?r[0]+"("+r.slice(1).join("")+")":""),r}function wc(e,r){let n=[];if(typeof r=="string"){const f=ud[r];k(f)?n=f.slice():f&&n.push(f)}const a=I0(r),u=new RegExp("^"+a.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const f of e)u.test(I0(f.command))&&n.push(f.key);return n.map(br)}function bf(e,r){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(e.ifLayout!==void 0&&(r.score===0||!e.ifLayout.includes(r.id)))return;const n=gt(e.key);let a=e.ifPlatform;if(n.cmd){if(a&&a!=="macos"&&a!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+a+`"
"cmd" modifier can only be used with macOS or iOS platform.`);a||(a=ae()==="ios"?"ios":"macos"),n.win=!1,n.cmd=!1,n.meta=!0}if(n.win){if(a&&a!=="windows")throw new Error('Unexpected "win" modifier with platform "'+a+`"
"win" modifier can only be used with Windows platform.`);a="windows",n.win=!1,n.cmd=!1,n.meta=!0}if(a&&!Rd(a))return;if(/^\[.+\]$/.test(n.key))return d($({},e),{key:Tt(n)});const u=wi(n.key,r);if(!u)return d($({},e),{key:Tt(n)});if(u.shift&&n.shift||u.alt&&n.alt)throw new Error(`The keybinding ${e.key} (${on(e.command)}) is conflicting with the key combination ${Tt(u)} using the ${r.displayName} keyboard layout`);return u.shift=u.shift||n.shift,u.alt=u.alt||n.alt,u.meta=n.meta,u.ctrl=n.ctrl,d($({},e),{key:Tt(u)})}function on(e){if(Array.isArray(e)){const r=[...e];return r.shift()+"("+r.map(n=>typeof n=="string"?`"${n}"`:n.toString()).join(", ")+")"}return e}function Ks(e,r){const n=[],a=[];for(const u of e)try{const f=bf(u,r);if(!f)continue;const v=a.find(A=>A.key===f.key&&A.ifMode===f.ifMode);if(v)throw new Error(`Ambiguous key binding ${u.key} (${on(u.command)}) matches ${v.key} (${on(v.command)}) with the ${r.displayName} keyboard layout`);a.push(f)}catch(f){f instanceof Error&&n.push(f.message)}return[a,n]}var ka=class extends Rn{constructor(){super("latex")}createAtom(e){return new us(e)}onPaste(e,r){if(!r)return!1;const n=typeof r=="string"?r:r.getData("application/x-latex")||r.getData("text/plain");return n&&e.model.contentWillChange({inputType:"insertFromPaste",data:n})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),ns(e)),e.startRecording(),!0):!1}insert(e,r,n){if(!e.contentWillChange({data:r,inputType:"insertText"}))return!1;n||(n={}),n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder");const{silenceNotifications:a}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const u=e.silenceNotifications;e.silenceNotifications=!0,n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ds(e.selection)):n.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):n.insertionMode==="insertBefore"?e.collapseSelection("backward"):n.insertionMode==="insertAfter"&&e.collapseSelection("forward");const f=[];for(const C of r)Ze.test(C)&&f.push(new us(C));let v=e.at(e.position);if(v instanceof Hu&&(v=v.lastChild),!(v.parent instanceof Hu)){const C=new Hu("");v.parent.addChildAfter(C,v),v=C.firstChild}const A=v.parent.addChildrenAfter(f,v);return e.silenceNotifications=u,n.selectionMode==="before"||(n.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(A)):A&&(e.position=e.offsetOf(A))),e.contentDidChange({data:r,inputType:"insertText"}),e.silenceNotifications=a,!0}};function kl(e){return e.atoms.find(r=>r.type==="latexgroup")}function Zs(e){var r,n;const a=e.atoms.find(u=>u.type==="latexgroup");return a?(n=(r=a.body)==null?void 0:r.filter(u=>u.type==="latex"))!=null?n:[]:[]}function Tl(e,r){var n;let a=0,u=!1;const f=Number.isFinite(r==null?void 0:r.before)?(n=r==null?void 0:r.before)!=null?n:0:e.lastOffset;for(;a<=f&&!u;){const C=e.at(a);u=C instanceof us&&C.isSuggestion,u||a++}if(!u)return[void 0,void 0];let v=a,A=!1;for(;v<=f&&!A;){const C=e.at(v);A=!(C instanceof us&&C.isSuggestion),A||v++}return[a-1,v-1]}new ka;function Ya(e){const r=Zs(e.model).filter(n=>n.isSuggestion);if(r.length!==0){e.model.position=e.model.offsetOf(r[0].leftSibling);for(const n of r)n.parent.removeChild(n)}}function ou(e,r){var n;const{model:a}=e;Ya(e);for(const z of Zs(a))z.isError=!1;if(!a.selectionIsCollapsed||e.options.popoverPolicy==="off"){B0(e);return}const u=[];let f=a.at(a.position);for(;f&&f instanceof us&&/^[a-zA-Z\*]$/.test(f.value);)f=f.leftSibling;if(f&&f instanceof us&&f.value==="\\")for(u.push(f),f=f.rightSibling;f&&f instanceof us&&/^[a-zA-Z\*]$/.test(f.value);)u.push(f),f=f.rightSibling;const v=u.map(z=>z.value).join(""),A=et(e,v);if(A.length===0){if(/^\\[a-zA-Z\*]+$/.test(v))for(const z of u)z.isError=!0;B0(e);return}const C=(n=r==null?void 0:r.atIndex)!=null?n:0;e.suggestionIndex=C<0?A.length-1:C%A.length;const P=A[e.suggestionIndex];if(P!==v){const z=u[u.length-1];z.parent.addChildrenAfter([...P.slice(v.length-P.length)].map(Q=>new us(Q,{isSuggestion:!0})),z),ju(e,{interactive:!0})}bh(e,A)}function Wu(e){const[r,n]=Tl(e,{before:e.position});if(r===void 0||n===void 0)return!1;let a=!1;return e.getAtoms([r,n]).forEach(u=>{u.isSuggestion&&(u.isSuggestion=!1,a=!0)}),a}function Cl(e,r="accept",n){var a,u;B0(e);const f=kl(e.model);if(!f)return!1;if(r==="accept-suggestion"||r==="accept-all"){const P=Zs(e.model).filter(z=>z.isSuggestion);if(P.length!==0){for(const z of P)z.isSuggestion=!1;e.model.position=e.model.offsetOf(P[P.length-1])}if(r==="accept-suggestion")return P.length!==0}const A=Zs(e.model).filter(P=>!P.isSuggestion).map(P=>P.value).join(""),C=f.leftSibling;return f.parent.removeChild(f),e.model.position=e.model.offsetOf(C),e.switchMode((a=n==null?void 0:n.mode)!=null?a:"math"),r==="reject"||(Rn.insert(e.model,A,{selectionMode:(u=n==null?void 0:n.selectItem)!=null&&u?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function Uo(e){var r;let n=document.getElementById(e);return n?n.dataset.refcount=Number(Number.parseInt((r=n.dataset.refcount)!=null?r:"0")+1).toString():(n=document.createElement("div"),n.setAttribute("aria-hidden","true"),n.dataset.refcount="1",n.id=e,document.body.append(n)),n}function P0(e){var r;const n=document.getElementById(e);if(!n)return;const a=Number.parseInt((r=n.getAttribute("data-refcount"))!=null?r:"0");a<=1?n.remove():n.dataset.refcount=Number(a-1).toString()}function Pd(e,r){const n=new qi({from:e.context}),a=new $t({mode:"math",type:"root",body:Us(r,{context:n})}),u=p0(Vu(new ur(a.render(n),{classes:"ML__base"}),n));return m0(u,{classes:"ML__latex"}).toMarkup()}function bh(e,r){var n;if(r.length===0){B0(e);return}let a="";for(const[f,v]of r.entries()){const A=v,C=Pd(e,v),P=wc(e.keybindings,A).join("<br>");a+=`<li role="button" data-command="${A}" ${f===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${A}</span><span class="ML__popover__command">${C}</span>`,P&&(a+=`<span class="ML__popover__keybinding">${P}</span>`),a+="</li>"}const u=o1(e,`<ul>${a}</ul>`);O0()&&((n=u.querySelector(".ML__popover__current"))==null||n.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var f;u&&!O0()&&(u.classList.add("is-visible"),Ko(e),(f=u.querySelector(".ML__popover__current"))==null||f.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function O0(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function Ko(e,r){var n;if(!e.element||e.element.mathfield!==e||!O0())return;if(((n=e.model.at(e.model.position))==null?void 0:n.type)!=="latex"){B0(e);return}if(r!=null&&r.deferred){setTimeout(()=>Ko(e),32);return}const a=Sa(e.field);if(!a)return;const u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,v=window.innerWidth-document.documentElement.clientWidth,A=window.innerHeight-document.documentElement.clientHeight,C=window.mathVirtualKeyboard.boundingRect.height,P=document.getElementById("mathlive-suggestion-popover");a.x+P.offsetWidth/2>f-v?P.style.left=`${f-P.offsetWidth-v}px`:a.x-P.offsetWidth/2<0?P.style.left="0":P.style.left=`${a.x-P.offsetWidth/2}px`;const z=a.y-a.height;u-A-C-a.y<z?(P.classList.add("ML__popover--reverse-direction"),P.classList.remove("top-tip"),P.classList.add("bottom-tip"),P.style.top=`${a.y-a.height-P.offsetHeight-15}px`):(P.classList.remove("ML__popover--reverse-direction"),P.classList.add("top-tip"),P.classList.remove("bottom-tip"),P.style.top=`${a.y+15}px`)}function B0(e){e.suggestionIndex=0;const r=document.getElementById("mathlive-suggestion-popover");r&&(r.classList.remove("is-visible"),r.innerHTML="")}function o1(e,r){let n=document.getElementById("mathlive-suggestion-popover");return n||(n=Uo("mathlive-suggestion-popover"),fo("suggestion-popover"),fo("core"),n.addEventListener("pointerdown",a=>a.preventDefault()),n.addEventListener("click",a=>{let u=a.target;for(;u&&!u.dataset.command;)u=u.parentElement;u&&(Cl(e,"reject"),Rn.insert(e.model,u.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),n.innerHTML=window.MathfieldElement.createHTML(r),n}function l1(){document.getElementById("mathlive-suggestion-popover")&&(P0("mathlive-suggestion-popover"),Fo("suggestion-popover"),Fo("core"))}function u1(){const e=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(e.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let r=e[1],n=r.match(/http.*\.ts[\?:]/);return n&&(r=e[2]),n=r.match(/(https?:.*):[0-9]+:[0-9]+/),n||(n=r.match(/at (.*(\.ts))[\?:]/),n||(n=r.match(/at (.*(\.mjs|\.js))[\?:]/))),n?n[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${r}").`),"")}var _h=null,_f,xf,Od=((xf=(_f=globalThis==null?void 0:globalThis.document)==null?void 0:_f.currentScript)==null?void 0:xf.src)||u1();function wf(e){return du(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(_h===null)try{const r=yield fetch(Od,{method:"HEAD"});r.status===200&&(_h=r.url)}catch(r){console.error(`Invalid URL "${e}" (relative to "${Od}")`)}return new URL(e,_h!=null?_h:Od).href})}function c1(e,r,n={}){return new FontFace(e,`url(${r}.woff2) format('woff2')`,n)}var Pa="not-loaded";function h1(){return du(this,null,function*(){return Pa="not-loaded",xh()})}function xh(){return du(this,null,function*(){var e;if(Pa!=="not-loaded")return;if(Pa="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){Pa="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const n=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],a=Array.from(document.fonts).map(v=>v.family);if(n.every(v=>a.includes(v))){Pa="ready";return}if(!window.MathfieldElement.fontsDirectory){Pa="not-loaded";return}const u=yield wf(window.MathfieldElement.fontsDirectory);if(!u){document.body.classList.add("ML__fonts-did-not-load"),Pa="error";return}const f=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(v=>c1(v[0].replace(/-[a-zA-Z]+$/,""),`${u}/${v[0]}`,v[1]));try{(yield Promise.all(f.map(A=>{try{return A.load()}catch(C){}}))).forEach(A=>document.fonts.add(A)),Pa="ready";return}catch(v){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${u}"`,{cause:v}),document.body.classList.add("ML__fonts-did-not-load")}Pa="error"}})}function d1(e){let r=0;for(let n=0;n<e.length;n++)r=r*31+e.charCodeAt(n),r=r|0;return Math.abs(r)}function ns(e,r){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{Oo(e)&&e.dirty&&(e.atomBoundsCache=new Map,ju(e,r),e.atomBoundsCache=void 0)})))}function f1(e,r){var n;r=r!=null?r:{};const a=new qi({from:d($({},e.context),{atomIdsSettings:{seed:r.forHighlighting?d1($t.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(n=r.forHighlighting)!=null?n:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),u=e.model.root.render(a);return m0(Vu(u,a),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function Sf(e,r){const{model:n}=e;n.root.caret=void 0,n.root.isSelected=!1,n.root.containsCaret=!0;for(const u of n.atoms)u.caret=void 0,u.isSelected=!1,u.containsCaret=!1;if(n.selectionIsCollapsed){const u=n.at(n.position);u.caret=e.model.mode;let f=u.parent;for(;f;)f.containsCaret=!0,f=f.parent}else{const u=n.getAtoms(n.selection,{includeChildren:!0});for(const f of u)f.isSelected=!0}return f1(e,r).toMarkup()}function ju(e,r){if(!Oo(e))return;r!=null||(r={});const n=e.element.querySelector("[part=virtual-keyboard-toggle]");n&&(n.style.display=e.hasEditableContent?"":"none");const a=e.field;if(!a)return;const u=e.isSelectionEditable&&e.hasFocus(),f=a.classList.contains("ML__focused");f&&!u?a.classList.remove("ML__focused"):!f&&u&&a.classList.add("ML__focused");let v=Sf(e,r);const A=e.element.querySelector("[part=menu-toggle]");if(A&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?A.style.display="none":A.style.display=""),e.model.atoms.length<=1){const C=e.options.contentPlaceholder;C&&(v+=`<span part=placeholder class="ML__content-placeholder">${Ms(C)}</span>`)}a.innerHTML=window.MathfieldElement.createHTML(v),wh(e,r.interactive),e.dirty=!1}function wh(e,r){const n=e.field;if(!n)return;for(const A of n.querySelectorAll(".ML__selection, .ML__contains-highlight"))A.remove();!(r!=null&&r)&&Pa!=="error"&&Pa!=="ready"&&setTimeout(()=>{Pa==="ready"?wh(e):setTimeout(()=>wh(e),128)},32);const a=e.model,u=n.offsetWidth,f=n.getBoundingClientRect().width;let v=Math.floor(f)/u;if(v=isNaN(v)?1:v,a.selectionIsCollapsed){Ko(e,{deferred:!0});let A=a.at(a.position);for(;A&&A.type!=="prompt"&&!(A.containsCaret&&A.displayContainsHighlight);)A=A.parent;if(A!=null&&A.containsCaret&&A.displayContainsHighlight){const C=ja(e,Ql(e,A),v);if(C){C.left/=v,C.right/=v,C.top/=v,C.bottom/=v;const P=document.createElement("div");P.classList.add("ML__contains-highlight"),P.style.position="absolute",P.style.left=`${C.left+1}px`,P.style.top=`${Math.ceil(C.top)}px`,P.style.width=`${Math.ceil(C.right-C.left)}px`,P.style.height=`${Math.ceil(C.bottom-C.top)}px`,n.insertBefore(P,n.childNodes[0])}}return}for(const A of p1(oc(e,{excludeAtomsWithBackground:!0}))){A.left/=v,A.right/=v,A.top/=v,A.bottom/=v;const C=document.createElement("div");C.classList.add("ML__selection"),C.style.position="absolute",C.style.left=`${A.left}px`,C.style.top=`${A.top}px`,C.style.width=`${Math.ceil(A.right-A.left)}px`,C.style.height=`${Math.ceil(A.bottom-A.top-1)}px`,n.insertBefore(C,n.childNodes[0])}}function p1(e){let r=[];for(const n of e){let a=!1;for(const u of r)if(n.left===u.left&&n.right===u.right&&n.top===u.top&&n.bottom===u.bottom){a=!0;break}a||r.push(n)}e=r,r=[];for(const n of e){let a=0;for(const u of e)if(n.left>=u.left&&n.right<=u.right&&n.top>=u.top&&n.bottom<=u.bottom&&(a+=1,a>1))break;a===1&&r.push(n)}return r}var Ef=3,Ho;function Ta(e,r){r=$({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},r!=null?r:{}),Ho||(Ho={});for(const n of Object.keys(e))console.assert(!Ho[n],"Selector already defined: ",n),Ho[n]=d($({},r),{fn:e[n]})}function Bd(e){let r;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return Bd(e[1]);r=e[0]}else r=e;return r=r.replace(/-\w/g,n=>n[1].toUpperCase()),Ho[r]}function F0(e){var r;return(r=Bd(e))==null?void 0:r.target}function m1(e,r){var n;if(!r)return!1;let a,u=[],f=!1,v=!1;k(r)?(a=r[0],u=r.slice(1)):a=r,a=a.replace(/-\w/g,P=>P[1].toUpperCase());const A=Ho[a],C=A==null?void 0:A.target;if(C==="model"){if(!e.isSelectionEditable&&(A!=null&&A.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(a)&&(a!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(a)),/^complete/.test(a)||Ya(e),Ho[a].fn(e.model,...u),ou(e),v=!0,f=!0}else if(C==="virtual-keyboard")v=(n=window.mathVirtualKeyboard.executeCommand(r))!=null?n:!1,f=!0;else if(Ho[a]){if(!e.isSelectionEditable&&(A!=null&&A.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(a)&&e.flushInlineShortcutBuffer(),v=Ho[a].fn(e,...u),f=!0}else throw new Error(`Unknown command "${a}"`);return C!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||A!=null&&A.changeSelection&&r!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),A!=null&&A.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),v&&ns(e),f}function g1(e,r){var n;if(!e)return!1;e.focus(),bp.keypressVibration&&se()&&navigator.vibrate(Ef);const a=Bd(r);window.MathfieldElement.playSound((n=a==null?void 0:a.audioFeedback)!=null?n:"keypress");const u=e.executeCommand(r);return e.scrollIntoView(),u}Ta({performWithFeedback:(e,r)=>g1(e,r)});function v1(e){return ou(e,{atIndex:e.suggestionIndex+1}),!1}function y1(e){return ou(e,{atIndex:e.suggestionIndex-1}),!1}Ta({complete:Cl},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Ta({nextSuggestion:v1,previousSuggestion:y1},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Sh="mathlive#virtual-keyboard-message";function Fd(e){var r;return e.type!=="message"?!1:((r=e.data)==null?void 0:r.type)===Sh}var b1=class i1{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new i1),this._singleton}set alphabeticLayout(r){this.sendMessage("update-setting",{alphabeticLayout:r})}set layouts(r){this.sendMessage("update-setting",{layouts:r})}get normalizedLayouts(){return[]}set editToolbar(r){this.sendMessage("update-setting",{editToolbar:r})}set actionKeycap(r){this.sendMessage("update-setting",{actionKeycap:r})}set shiftKeycap(r){this.sendMessage("update-setting",{shiftKeycap:r})}set backspaceKeycap(r){this.sendMessage("update-setting",{backspaceKeycap:r})}set tabKeycap(r){this.sendMessage("update-setting",{tabKeycap:r})}set container(r){throw new Error("Container inside an iframe cannot be changed")}show(r){this.sendMessage("show",r)}hide(r){this.sendMessage("hide",r)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(r){r?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(r){return this.sendMessage("execute-command",{command:r}),!0}updateToolbar(r){this.sendMessage("update-toolbar",r)}update(r){this.sendMessage("update-setting",r)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(r,n,a){this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].has(n)||this.listeners[r].add(n)}dispatchEvent(r){return!this.listeners[r.type]||this.listeners[r.type].size===0?!0:(this.listeners[r.type].forEach(n=>{typeof n=="function"?n(r):n==null||n.handleEvent(r)}),!r.defaultPrevented)}removeEventListener(r,n,a){this.listeners[r]&&this.listeners[r].delete(n)}handleEvent(r){if(Fd(r)){if(!lc(r.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${r.origin}) cannot be handled`,"SecurityError");this.handleMessage(r.data)}}handleMessage(r){const{action:n}=r;if(n==="execute-command"){const{command:a}=r;F0(a)==="virtual-keyboard"&&this.executeCommand(a);return}if(n==="synchronize-proxy"){this._boundingRect=r.boundingRect,this._isShifted=r.isShifted;return}if(n==="geometry-changed"){this._boundingRect=r.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(r,n={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage($({type:Sh,action:r},n),this.targetOrigin)}},Af={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Eh={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Sc;function kf(e,r){var n,a,u;const f=lu.singleton;if(!f)return;const v=N0(e),A=(a=(n=f.getKeycap(v==null?void 0:v.id))==null?void 0:n.variants)!=null?a:"";if(typeof A=="string"&&!Tf(A)||Array.isArray(A)&&A.length===0){r==null||r();return}const C={};let P="";for(const St of x1(A)){const sr=Df(St),xt=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);C[xt]=sr;const[Wt,hr]=Ah(sr);P+=`<div id=${xt} class="item ${hr}">${Wt}</div>`}const z=document.createElement("div");z.setAttribute("aria-hidden","true"),z.className="MLK__variant-panel",z.style.height="auto";const Q=Object.keys(C).length;let _e=5;Q===1?_e=1:Q===2||Q===4?_e=2:Q===3||Q===5||Q===6?_e=3:Q>=7&&Q<14&&(_e=4),z.style.width=`calc(var(--variant-keycap-length) * ${_e} + 12px)`,z.innerHTML=bp.createHTML(P),es.open({root:(u=f==null?void 0:f.container)==null?void 0:u.querySelector(".ML__keyboard"),child:z}),Sc=new AbortController;const{signal:Ie}=Sc,ze=e==null?void 0:e.getBoundingClientRect();if(ze){ze.top-z.clientHeight<0&&(z.style.width="auto",Q<=6?z.style.height="56px":Q<=12?z.style.height="108px":Q<=18?z.style.height="205px":z.classList.add("compact"));const St=Math.max(0,Math.min(window.innerWidth-z.offsetWidth,(ze.left+ze.right-z.offsetWidth)/2)),sr=ze.top-z.clientHeight+5;z.style.transform=`translate(${St}px, ${sr}px)`,z.classList.add("is-visible"),requestAnimationFrame(()=>{z.addEventListener("pointerup",xt=>{const Wt=N0(xt.target);!(Wt!=null&&Wt.id)||!C[Wt.id]||(Nd(C[Wt.id]),Ec(),r==null||r(),xt.preventDefault())},{capture:!0,passive:!1,signal:Ie}),z.addEventListener("pointerenter",xt=>{const Wt=N0(xt.target);!(Wt!=null&&Wt.id)||!C[Wt.id]||Wt.classList.add("is-active")},{capture:!0,signal:Ie}),z.addEventListener("pointerleave",xt=>{const Wt=N0(xt.target);!(Wt!=null&&Wt.id)||!C[Wt.id]||Wt.classList.remove("is-active")},{capture:!0,signal:Ie}),window.addEventListener("pointercancel",()=>{Ec(),r==null||r()},{signal:Ie}),window.addEventListener("pointerup",()=>{Ec(),r==null||r()},{signal:Ie})})}}function Ec(){Sc==null||Sc.abort(),Sc=null,es.state==="open"&&es.close()}function _1(e){if(e==="foreground-color"){const r=[];for(const n of Object.keys(ve))r.push({class:"swatch-button",label:'<span style="border: 3px solid '+ve[n]+'"></span>',command:["applyStyle",{color:n}]});return r}if(e==="background-color"){const r=[];for(const n of Object.keys(De))r.push({class:"swatch-button",label:'<span style="background:'+De[n]+'"></span>',command:["applyStyle",{backgroundColor:n}]});return r}}function Tf(e){return Eh[e]!==void 0}function x1(e){var r;return typeof e!="string"?e:(Eh[e]||(Eh[e]=(r=_1(e))!=null?r:[]),Eh[e])}function w1(e){return typeof e=="string"?e:Object.entries(e).map(([r,n])=>`${r}:${n} !important`).join(";")}function S1(e){return Object.keys(e).map(r=>`${r} {${w1(e[r])}}`).join("")}function Ac(e){if(!e)return"";const r=new qi,n=new $t({mode:"math",type:"root",body:Us(e,{context:r,args:u=>u==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),a=p0(Vu(new ur(n.render(r),{classes:"ML__base"}),r));return m0(a,{classes:"ML__latex"}).toMarkup()}function kc(e){var r;if(Array.isArray(e))return e.map(a=>kc(a)).flat();const n=typeof e=="string"?{markup:e}:e;return"rows"in n&&Array.isArray(n.rows)&&(n.rows=n.rows.map(a=>a.map(u=>Df(u)))),(r=n.id)!=null||(n.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[n]}function E1(){var e,r;let a=window.mathVirtualKeyboard.alphabeticLayout;if(a==="auto"){const A=ti();A&&(a=A.virtualLayout),(!a||a==="auto")&&(a=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[Y.locale.slice(0,2)])!=null?e:"qwerty")}const u={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},f=(r=u[a])!=null?r:u.qwerty,v=a==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const A of f){const C=[];for(const P of A)/[a-z]/.test(P)?C.push({label:P,class:"hide-shift",shift:{label:P.toUpperCase()},variants:Tf(P)?P:void 0}):P==="~"?a!=="dvorak"?C.push("[backspace]"):C.push({label:"[backspace]",width:1}):P==="^"?C.push("[shift]"):P===" "&&C.push("[separator-5]");v.push(C)}return v.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:kc({rows:v})}}function Cf(e){if(e==="alphabetic")return E1();if(typeof e=="string")return console.assert(Af[e]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${e}"`),Cf(Af[e]);let r;if("rows"in e&&Array.isArray(e.rows)){console.assert(!("layers"in e||"markup"in e),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const u=e,{rows:f}=u,v=j(u,["rows"]);r=d($({},v),{layers:kc({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const u=e,{markup:f}=u,v=j(u,["markup"]);r=d($({},v),{layers:kc(e.markup)})}else r=$({},e),"layers"in e?r.layers=kc(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let n=!1,a=!1;for(const u of r.layers)if(u.rows)for(const f of u.rows.flat()){$0(f)&&(n=!0);const v=f.command;typeof v=="string"&&["undo","redo","cut","copy","paste"].includes(v)&&(a=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(r.displayShiftedKeycaps=n),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(r.displayEditToolbar=!a),r}function A1(e,r){var n,a;let u='<div class="left">';if(e.normalizedLayouts.length>1)for(const[f,v]of e.normalizedLayouts.entries()){const A=v,C=[f===r?"selected":"layer-switch"];A.tooltip&&C.push("MLK__tooltip"),A.labelClass&&C.push(...A.labelClass.split(" ")),u+=`<div class="${C.join(" ")}"`,A.tooltip&&(u+=" data-tooltip='"+((n=ue(A.tooltip))!=null?n:A.tooltip)+"' "),f!==r&&(u+=`data-layer="${A.layers[0].id}"`),u+=`>${(a=A.label)!=null?a:"untitled"}</div>`}return u+="</div>",u}function k1(e,r){let n="";if(e.editToolbar==="none")return"";const u=[];r.selectionIsCollapsed?u.push("undo","redo","pasteFromClipboard"):u.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const f={undo:`<div class='action ${r.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${ue("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${r.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${ue("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${ue("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${ue("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${ue("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return n+=u.map(v=>f[v]).join(""),n}function T1(e){for(const r of e)C1(r)}function C1(e){const r=lu.singleton;if(!r)return;const n={};if(!e.id){if(e.hasAttribute("data-label")&&(n.label=e.dataset.label),e.hasAttribute("data-latex")&&(n.latex=e.dataset.latex),e.hasAttribute("data-key")&&(n.key=e.dataset.key),e.hasAttribute("data-insert")&&(n.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(n.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(n.aside=e.dataset.aside),e.className&&(n.class=e.className),!n.label&&!n.latex&&!n.key&&!n.insert&&(n.latex=e.innerText,n.label=e.innerHTML),e.hasAttribute("data-command"))try{n.command=JSON.parse(e.dataset.command)}catch(a){}e.id=r.registerKeycap(n)}if(!e.innerHTML){const[a,u]=Ah(n);e.innerHTML=window.MathfieldElement.createHTML(a)}}function D1(){fo("virtual-keyboard"),fo("core"),xh()}function M1(){Fo("core"),Fo("virtual-keyboard")}var L1=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>
<symbol id="svg-shift" viewBox="0 0 384 512">
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>
<symbol id="svg-commit" viewBox="0 0 512 512">
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
<symbol id="svg-undo" viewBox="0 0 512 512">
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function R1(e){e.resetKeycapRegistry(),D1();const r=document.createElement("div");r.className="ML__keyboard";const n=document.createElement("div");n.className="MLK__plate",n.innerHTML=window.MathfieldElement.createHTML(L1+e.normalizedLayouts.map((v,A)=>I1(e,v,A)).join(""));const a=document.createElement("div");a.className="MLK__backdrop",a.appendChild(n),r.appendChild(a),r.addEventListener("pointerdown",O1,{passive:!1});const u=r.querySelectorAll(".ML__edit-toolbar");if(u)for(const v of u)v.addEventListener("click",A=>{var C,P;let z=A.target,Q="";for(;z&&!Q;)Q=(C=z==null?void 0:z.getAttribute("data-command"))!=null?C:"",z=(P=z==null?void 0:z.parentElement)!=null?P:null;Q&&e.executeCommand(JSON.parse(Q))});T1(r.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const f=r.querySelectorAll(".MLK__layer");console.assert(f.length>0,"No virtual keyboards available");for(const v of f)v.addEventListener("pointerdown",A=>A.preventDefault());return e.currentLayer=e.latentLayer,r}function I1(e,r,n){const a=[];if(!("layers"in r))return"";for(const u of r.layers)a.push(`<div tabindex="-1" class="MLK__layer" id="${u.id}">`),(e.normalizedLayouts.length>1||r.displayEditToolbar)&&(a.push("<div class='MLK__toolbar' role='toolbar'>"),a.push(A1(e,n)),r.displayEditToolbar&&a.push('<div class="ML__edit-toolbar right"></div>'),a.push("</div>")),a.push(P1(e,u)),a.push("</div>");return a.join("")}function P1(e,r){if(typeof r=="string")return r;let n="";if(typeof r.style=="string"?n+=`<style>${r.style}</style>`:typeof r.style=="object"&&(n+=`<style>${S1(r.style)}</style>`),r.backdrop&&(n+=`<div class='${r.backdrop}'>`),r.container&&(n+=`<div class='${r.container}'>`),r.rows){n+="<div class=MLK__rows>";for(const a of r.rows){n+="<div dir='ltr' class=MLK__row>";for(const u of a)if(u){const f=e.registerKeycap(u),[v,A]=Ah(u);/(^|\s)separator/.test(A)?n+=`<div class="${A}"`:n+=`<div tabindex="-1" id="${f}" class="${A}"`,u.tooltip&&(n+=` data-tooltip="${u.tooltip}"`),n+=`>${v}</div>`}n+="</div>"}n+="</div>"}else r.markup&&(n+=r.markup);return r.container&&(n+="</div>"),r.backdrop&&(n+="</div>"),n}function Ah(e,r={shifted:!1}){var n,a,u,f,v,A,C;let P="",z=(n=e.class)!=null?n:"";if(r.shifted&&$0(e)&&(z+=" is-active"),r.shifted&&"shift"in e)typeof e.shift=="string"?P=Ac(e.shift):typeof e.shift=="object"&&(P=e.shift.label?e.shift.label:(a=Ac(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?a:""),typeof e.shift=="object"&&(z=(f=(u=e.shift.class)!=null?u:e.class)!=null?f:"");else{if(P=e.label?e.label:(v=Ac(e.latex||e.insert||"")||e.key)!=null?v:"",e.shift){let Q;typeof e.shift=="string"?Q=Ac(e.shift):e.shift.label?Q=e.shift.label:Q=(A=Ac(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?A:"",P+=`<span class="MLK__shift">${Q}</span>`}e.aside&&(P+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(z)&&(z+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(z)||(z+=" MLK__keycap"),!/\bw[0-9]+\b/.test(z)&&e.width&&(z+=(C={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?C:""),[P,z||"MLK__keycap"]}var qu={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function Df(e){var r;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!qu[e])return{latex:e};e={label:e}}let n;return"label"in e&&e.label&&qu[e.label]&&(n=d($($({},qu[e.label]),e),{label:qu[e.label].label})),"key"in e&&e.key&&qu[e.key]&&(n=d($($({},qu[e.key]),e),{key:qu[e.key].key})),n?(n.command==="insertDecimalSeparator"&&(n.label=(r=window.MathfieldElement.decimalSeparator)!=null?r:"."),e.label==="[action]"&&(n=$($({},n),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(n=$($({},n),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(n=$($({},n),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(n=$($({},n),window.mathVirtualKeyboard.tabKeycap)),n):e}var Tc;function O1(e){var r;if(e.button!==0)return;const n=lu.singleton;if(!n)return;let a=e.target;for(;a&&!a.getAttribute("data-layer");)a=a.parentElement;if(a){n.currentLayer=(r=a.getAttribute("data-layer"))!=null?r:"",e.preventDefault();return}const u=N0(e.target);if(!(u!=null&&u.id))return;const f=n.getKeycap(u.id);if(!f)return;console.assert(e.type==="pointerdown");const v=new AbortController,A=v.signal;u.classList.add("is-pressed"),u.addEventListener("pointerenter",kh(v),{capture:!0,signal:A}),u.addEventListener("pointerleave",kh(v),{capture:!0,signal:A}),u.addEventListener("pointercancel",kh(v),{signal:A}),u.addEventListener("pointerup",kh(v),{signal:A}),$0(f)&&(u.classList.add("is-active"),n.shiftPressCount++),f.variants&&(Tc&&clearTimeout(Tc),Tc=setTimeout(()=>{u.classList.contains("is-pressed")&&(u.classList.remove("is-pressed"),u.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),kf(u,()=>{v.abort(),u==null||u.classList.remove("is-active")}))},300)),e.preventDefault()}function kh(e){return r=>{const n=N0(r.target);if(!(n!=null&&n.id))return;const a=lu.singleton;if(!a)return;const u=a.getKeycap(n.id);if(u){if(r.type==="pointerenter"&&r.target===n&&r.isPrimary&&n.classList.add("is-pressed"),r.type==="pointercancel"){n.classList.remove("is-pressed"),$0(u)&&(a.shiftPressCount--,n.classList.toggle("is-active",a.isShifted)),e.abort();return}if(r.type==="pointerleave"&&r.target===n){n.classList.remove("is-pressed"),$0(u)&&(a.shiftPressCount--,n.classList.toggle("is-active",a.isShifted));return}if(r.type==="pointerup"){Tc&&clearTimeout(Tc),$0(u)?n.classList.toggle("is-active",a.isShifted):n.classList.contains("is-pressed")&&(n.classList.remove("is-pressed"),a.isShifted&&u.shift?typeof u.shift=="string"?a.executeCommand(["insert",u.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):Nd(u.shift):Nd(u),a.shiftPressCount===1&&!r.shiftKey&&(a.shiftPressCount=0)),e.abort(),r.preventDefault();return}}}}function Nd(e){var r;let n=e.command;!n&&e.insert&&(n=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!n&&e.key&&(n=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!n&&e.latex&&(n=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),n||(n=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(r=lu.singleton)==null||r.executeCommand(n)}function B1(e){if(e.nodeType!==1)return!1;const r=e.classList;return r.contains("MLK__keycap")||r.contains("shift")||r.contains("action")||r.contains("fnbutton")||r.contains("bigfnbutton")}function N0(e){if(!e)return;let r=e;for(;r&&!B1(r);)r=r.parentElement;return r!=null?r:void 0}function $0(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var lu=class n1{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var r,n,a;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(n=(r=window.document)==null?void 0:r.body)!=null?n:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(u=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(a=window.top)==null||a.addEventListener("message",this)}catch(u){window.addEventListener("message",this)}document.body.addEventListener("focusin",u=>{const f=u.target;f!=null&&f.isConnected&&setTimeout(()=>{const v=Mf();v&&!v.readOnly&&v.mathVirtualKeyboardPolicy==="auto"&&K()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",u=>{u.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{Mf()||this.hide()},300)})}get currentLayer(){var r,n,a;return(a=(n=(r=this._element)==null?void 0:r.querySelector(".MLK__layer.is-visible"))==null?void 0:n.id)!=null?a:""}set currentLayer(r){var n;if(!this._element){this.latentLayer=r;return}let a=r?this._element.querySelector(`#${r}.MLK__layer`):null;a||(a=this._element.querySelector(".MLK__layer")),a&&((n=this._element.querySelector(".MLK__layer.is-visible"))==null||n.classList.remove("is-visible"),a.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(r){var n;this._shiftPressCount=r>2||r<0?0:r,(n=this._element)==null||n.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(r){const n="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[n]=r,n}getKeycap(r){return r?this.keycapRegistry[r]:void 0}getLayer(r){const n=this.normalizedLayouts;for(const a of n)for(const u of a.layers)if(u.id===r)return u}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(r){this._alphabeticLayout=r,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(r){this._actionKeycap=typeof r=="string"?{label:r}:r}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(r){this._shiftKeycap=typeof r=="string"?{label:r}:r}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(r){this._backspaceKeycap=typeof r=="string"?{label:r}:r}get tabKeycap(){return this._tabKeycap}set tabKeycap(r){this._tabKeycap=typeof r=="string"?{label:r}:r}get layouts(){return this._layouts}set layouts(r){this.updateNormalizedLayouts(r),this.rebuild()}updateNormalizedLayouts(r){const n=Array.isArray(r)?[...r]:[r],a=n.findIndex(u=>u==="default");a>=0&&n.splice(a,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(n),this._normalizedLayouts=n.map(u=>Cf(u))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(r){this._editToolbar=r,this.rebuild()}get container(){return this._container}set container(r){this._container=r,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new n1}catch(r){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(r,n,a){this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].has(n)||this.listeners[r].add(n)}dispatchEvent(r){return!this.listeners[r.type]||this.listeners[r.type].size===0?!0:(this.listeners[r.type].forEach(n=>{typeof n=="function"?n(r):n==null||n.handleEvent(r)}),!r.defaultPrevented)}removeEventListener(r,n,a){this.listeners[r]&&this.listeners[r].delete(n)}get element(){return this._element}set element(r){var n;this._element!==r&&((n=this._element)==null||n.remove(),this._element=r)}get visible(){return this._visible}set visible(r){r?this.show():this.hide()}get boundingRect(){var r;if(!this._visible)return new DOMRect;const n=(r=this._element)==null?void 0:r.getElementsByClassName("MLK__plate")[0];return n?n.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var r,n;const a=this.boundingRect.height;if(this.container===document.body){(r=this._element)==null||r.style.setProperty("--_keyboard-height",`calc(${a}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const u=a-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${u}px)`:`${u}px`}else(n=this._element)==null||n.style.setProperty("--_keyboard-height",`${a}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const r=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=r,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const r=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(r&&(r.backdrop||r.container)));const n=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(n)for(const a of n){const u=this.getKeycap(a.id);if(u){const[f,v]=Ah(u,{shifted:this.isShifted});a.innerHTML=window.MathfieldElement.createHTML(f),a.className=v}}}show(r){var n;if(this._visible)return;const a=this.container;if(a&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const u=this._element.getElementsByClassName("MLK__plate")[0];if(u&&this.observer.observe(u),a===window.document.body){const f=a.style.paddingBottom;this.originalContainerBottomPadding=f;const v=u.offsetHeight-1;a.style.paddingBottom=f?`calc(${f} + ${v}px)`:`${v}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(n=this._element)==null||n.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,r!=null&&r.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var u;return(u=this._element)==null?void 0:u.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(r){var n;const a=this.container;if(a&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const u=this._element.getElementsByClassName("MLK__plate")[0];u&&this.observer.unobserve(u),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),Ec(),M1(),(n=this._element)==null||n.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(a.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var r,n;return(n=(r=this.element)==null?void 0:r.offsetHeight)!=null?n:0}buildAndAttachElement(){var r;console.assert(!this.element),this.element=R1(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",n=>{n.shiftKey||((n.ctrlKey||n.button===2)&&kf(n.target),n.preventDefault(),n.stopPropagation())},{capture:!0}),(r=this.container)==null||r.appendChild(this.element)}handleEvent(r){if(Fd(r)){if(!lc(r.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${r.origin}) cannot be handled`,"SecurityError");r.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:r.data.action!=="update-setting"&&r.data.action!=="proxy-created"&&r.data.action!=="execute-command"&&(console.assert(r.source!==void 0),this.connectedMathfieldWindow=r.source),this.handleMessage(r.data,r.source)}if(this._element)switch(r.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":r.button!==2&&r.preventDefault();break;case"keydown":{r.key==="Shift"&&!r.repeat&&(this.shiftPressCount=1);break}case"keyup":{(r.key==="Shift"||!r.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(r,n){const{action:a}=r;if(a==="execute-command"){const{command:u}=r,f=F0(u);if(window.top!==void 0&&f!=="virtual-keyboard")return;this.executeCommand(u);return}if((a==="connect"||a==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},n),a!=="disconnect"&&window===window.top){if(a==="show"){typeof r.animate!="undefined"?this.show({animate:r.animate}):this.show();return}if(a==="hide"){typeof r.animate!="undefined"?this.hide({animate:r.animate}):this.hide();return}if(a==="update-setting"){r.alphabeticLayout&&(this.alphabeticLayout=r.alphabeticLayout),r.layouts&&(this.layouts=r.layouts),r.editToolbar&&(this.editToolbar=r.editToolbar);return}if(a==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},n);return}}}sendMessage(r,n,a){if(a||(a=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||a===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:$({type:Sh,action:r},n)}));return}if(a)a.postMessage($({type:Sh,action:r},n),{targetOrigin:this.targetOrigin});else if(n.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:n.command})),r==="execute-command"&&Array.isArray(n.command)&&n.command[0]==="insert"){const u=n.command[1].split("");for(const f of u)this.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:f,bubbles:!0}))}}stateWillChange(r){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:r},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(r){const n=this._element;if(!n)return;n.classList.toggle("is-math-mode",r.mode==="math"),n.classList.toggle("is-text-mode",r.mode==="text"),n.classList.toggle("can-undo",r.canUndo),n.classList.toggle("can-redo",r.canRedo),n.classList.toggle("can-copy",!r.selectionIsCollapsed),n.classList.toggle("can-copy",!r.selectionIsCollapsed),n.classList.toggle("can-paste",!0);const a=n.querySelectorAll(".ML__edit-toolbar");if(a)for(const u of a)u.innerHTML=k1(this,r)}update(r){this._style=r.style,this.updateToolbar(r)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(r){let n,a=[],u=F0(r);return k(r)?(n=r[0],n==="performWithFeedback"&&(r=r.slice(1),u=F0(r)),a=r.slice(1)):n=r,n=n.replace(/-\w/g,f=>f[1].toUpperCase()),u==="virtual-keyboard"?Ho[n].fn(void 0,...a):(this.sendMessage("execute-command",{command:r}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function Mf(){var e,r;let n=Sn(),a=null;for(;n;){if("host"in n&&((r=(e=n.host)==null?void 0:e.tagName)==null?void 0:r.toLowerCase())==="math-field"){a=n.host;break}n=n.parentNode}return a}if(O()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=lu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>b1.singleton,configurable:!0});function Th(e){const r={};for(const n of Object.keys(e))switch(n){case"scriptDepth":const a=e.scriptDepth;if(k(a))r.scriptDepth=[a[0],a[1]];else if(typeof a=="number")r.scriptDepth=[a,a];else if(typeof a=="string"){const[f,v]=a.split(",").map(A=>parseInt(A.trim()));r.scriptDepth=[f,v]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let u=e.mathVirtualKeyboardPolicy.toLowerCase();if(u==="sandboxed"){if(window!==window.top){const f=lu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>f})}u="manual"}r.mathVirtualKeyboardPolicy=u;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?Y.locale.startsWith("fr")?r.letterShapeStyle="french":r.letterShapeStyle="tex":r.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?r.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),r.defaultMode="math");break;case"macros":r.macros=Ge(e.macros);break;default:k(e[n])?r[n]=[...e[n]]:typeof e[n]=="object"&&!(e[n]instanceof Element)&&n!=="computeEngine"?r[n]=$({},e[n]):r[n]=e[n]}return r}function Zu(e,r){let n;typeof r=="string"?n=[r]:r===void 0?n=Object.keys(e):n=r;const a={};for(const u of n)e[u]===null?a[u]=null:k(e[u])?a[u]=[...e[u]]:typeof e[u]=="object"&&!(e[u]instanceof Element)&&u!=="computeEngine"?a[u]=$({},e[u]):a[u]=e[u];return typeof r=="string"?a[r]:a}function Ch(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:ut,backgroundColorMap:pt,letterShapeStyle:Y.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:ac,inlineShortcuts:x0,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:nc,value:""}}function Lf(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function uu(e,r){!e||!r||(k(e)?e.forEach(n=>uu(n,r)):typeof e=="object"&&!e.style.color&&!e.style.backgroundColor&&!e.style.fontFamily&&!e.style.fontShape&&!e.style.fontSeries&&!e.style.fontSize&&!e.style.variant&&!e.style.variantStyle&&(e.applyStyle(r),uu(e.body,r),uu(e.above,r),uu(e.below,r),uu(e.subscript,r),uu(e.superscript,r)))}function $d(e,r,n,a){function u(v,A){for(const C of f)if(C.style[v]!==A)return!1;return!0}if(r=e.normalizeRange(r),r[0]===r[1])return!1;const f=e.getAtoms(r,{includeChildren:!0});a.operation==="toggle"&&(n.color&&u("color",n.color)&&(n.color="none",delete n.verbatimColor),n.backgroundColor&&u("backgroundColor",n.backgroundColor)&&(n.backgroundColor="none",delete n.verbatimBackgroundColor),n.fontFamily&&u("fontFamily",n.fontFamily)&&(n.fontFamily="none"),n.fontSeries&&u("fontSeries",n.fontSeries)&&(n.fontSeries="auto"),n.fontShape&&u("fontShape",n.fontShape)&&(n.fontShape="auto"),n.fontSize&&u("fontSize",n.fontSize)&&(n.fontSize=jl),n.variant&&u("variant",n.variant)&&(n.variant="normal"),n.variantStyle&&u("variantStyle",n.variantStyle)&&(n.variantStyle=""));for(const v of f)v.applyStyle(n);return!0}function F1(e,r){const n=e.at(e.position);if(n.type==="composition")n.value=r;else{const{caret:a}=n;n.caret=void 0;const u=new ch(r,{mode:n.mode});u.caret=a,n.parent.addChildAfter(u,n),e.position+=1}}function N1(e){const r=e.at(e.position);r.type==="composition"&&(r.parent.removeChild(r),e.position-=1)}fr(["math","displaymath"],Xa),fr("center",Xa),Ue("displaylines","",{parse:e=>{const r=[];let n=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(r.push([n]),n=[]):n.push(...e.scan(a=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(a)))}while(!0);return e.endContext(),r.push([n]),r},createAtom:e=>new an("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Xt("array","{columns:colspec}",(e,r,n,a)=>new an(e,zd(r),n,{columns:a[0],mathstyleName:"textstyle"})),Xt(["equation","equation*","subequations"],"",(e,r,n)=>new an(e,zd(r),n,{columns:[{align:"c"}]})),Xt(["multline","multline*"],"",Xa),Xt(["align","align*","aligned","eqnarray"],"",Xa),Xt("split","",Xa),Xt(["gather","gathered"],"",Xa),Xt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Xa),Xt(["smallmatrix","smallmatrix*"],"[columns:colspec]",Xa),Xt(["cases","dcases","rcases"],"",Xa);function $1(e){for(const r of e)for(const n of r)if(n.length>0)return!1;return!0}function zd(e,r=1){return $1(e)?Array(r).fill([[new $t({type:"first"}),new mo]]):e.map(n=>n.length===0?[[new $t({type:"first"})]]:n.map(a=>a.length===0?[new $t({type:"first"})]:(a[0].type!=="first"&&a.unshift(new $t({type:"first"})),a)))}function Xa(e,r=[[[]]],n=[],a=[]){switch(r=zd(r,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new an(e,r,n,{mathstyleName:"textstyle"});case"displaymath":return new an(e,r,n,{mathstyleName:"textstyle"});case"center":return new an(e,r,n,{columns:[{align:"c"}]});case"multline":case"multline*":return new an(e,r,n,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new an(e,r,n,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new an(e,r,n,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new an(e,r,n,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Yu(a[0])});case"bmatrix":case"bmatrix*":return new an(e,r,n,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Yu(a[0])});case"Bmatrix":case"Bmatrix*":return new an(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Yu(a[0])});case"vmatrix":case"vmatrix*":return new an(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Yu(a[0])});case"Vmatrix":case"Vmatrix*":return new an(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Yu(a[0])});case"matrix":case"matrix*":return new an(e,r,n,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Yu(a==null?void 0:a[0])});case"smallmatrix":case"smallmatrix*":return new an(e,r,n,{mathstyleName:"scriptstyle",columns:Yu(a==null?void 0:a[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new an(e,r,n,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new an(e,r,n,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new an(e,r,n,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let u=0;for(const A of r)u=Math.max(u,A.length);const f=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let v=2;for(;v<u;)f.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),v+=2;return f.push({gap:0}),new an(e,r,n,{arraycolsep:0,columns:f,minColumns:2})}}return new an(e,r,n,{mathstyleName:"textstyle"})}function Yu(e){return e!=null?e:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function z1(e,r){let n=e.at(e.position);for(;n&&!(n.parent instanceof an);)n=n.parent;if(n&&n.type==="array"&&n.environmentName,!n||!(n.parent instanceof an)){const a=e.at(e.position);if(n=a,!n.parent.parent){let u=e.extractAtoms([e.position,e.lastOffset]),f=e.extractAtoms([0,e.position]);f.length===0&&(f=Lh()),u.length===0&&(u=Lh());let v;return r.endsWith("column")?(v=Xa("split",[[f,u]]),e.root=v,Xu(v,0,0)?Ju(e,v,0,0):Xu(v,0,1)?Ju(e,v,0,1):e.position=e.offsetOf(a)):(v=Xa("lines",[[f],[u]]),e.root=v,Xu(v,0,0)?Ju(e,v,0,0):Xu(v,1,0)?Ju(e,v,1,0):e.position=e.offsetOf(a)),[void 0,[0,0]]}if(n.parent instanceof Zn){const u=n.parent;let f=e.extractAtoms([e.position,e.offsetOf(u.lastChild)]),v=e.extractAtoms([e.offsetOf(u.firstChild),e.position]);v.length===0&&(v=Lh()),f.length===0&&(f=Lh());let A="pmatrix";const C=u.leftDelim,P=u.rightDelim;C==="("&&(P===")"||P==="?")?A="pmatrix":(C==="["||C==="\\lbrack")&&(P==="]"||P==="\\rbrack"||P==="?")?A="bmatrix":C==="\\vert"&&P==="\\vert"?A="vmatrix":C==="\\Vert"&&P==="\\Vert"?A="Vmatrix":(C==="{"||C==="\\lbrace")&&(P==="."||P==="?")&&(A="cases");const z=Xa(A,r.endsWith("column")?[[v,f]]:[[v],[f]]);return u.parent.addChildBefore(z,u),u.parent.removeChild(u),Xu(z,0,0)?Ju(e,z,0,0):r.endsWith("column")?Xu(z,0,1)?Ju(e,z,0,1):e.position=e.offsetOf(n):Xu(z,1,0)?Ju(e,z,1,0):e.position=e.offsetOf(n),[void 0,[0,0]]}}return n&&n.parent instanceof an?[n.parent,n.parentBranch]:[void 0,[0,0]]}function Xu(e,r,n){const a=e.getCell(r,n);return!a||a.length!==2?!1:a[1].type==="placeholder"}function U1(e,r,n,a){const u=r.getCell(n,a);return u?[e.offsetOf(u[0]),e.offsetOf(u[u.length-1])]:-1}function Ju(e,r,n,a){const u=U1(e,r,n,a);typeof u!="number"&&e.setSelection(u)}function Dh(e,r,n,a,u){const f=r.getCell(n,a);f&&e.setPositionHandlingPlaceholder(e.offsetOf(f[u==="start"?0:f.length-1]))}function Mh(e,r){const[n,[a,u]]=z1(e,r);if(n)switch(r){case"after row":n.addRowAfter(a),Dh(e,n,a+1,0,"end");break;case"after column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnAfter(u),Dh(e,n,a,u+1,"end");break;case"before row":n.addRowBefore(a),Dh(e,n,a,0,"start");break;case"before column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnBefore(u),Dh(e,n,a,u,"start");break}}function Rf(e){return e.contentWillChange({inputType:"insertText"})?(Mh(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function K1(e){return e.contentWillChange({inputType:"insertText"})?(Mh(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function If(e){return e.contentWillChange({inputType:"insertText"})?(Mh(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function H1(e){return e.contentWillChange({inputType:"insertText"})?(Mh(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Pf(e,r){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let n=".",a=".";switch(r){case"pmatrix":case"pmatrix*":n="(",a=")";break;case"bmatrix":case"bmatrix*":n="[",a="]";break;case"Bmatrix":case"Bmatrix*":n="\\lbrace",a="\\rbrace";break;case"vmatrix":case"vmatrix*":n="\\vert",a="\\vert";break;case"Vmatrix":case"Vmatrix*":n="\\Vert",a="\\Vert";break;case"matrix":case"matrix*":n=".",a=".";break;case"cases":case"dcases":n="\\lbrace";break;case"rcases":a="\\rbrace";break}const u=e.at(e.position),f=u.type==="array"?u:e.parentEnvironment;return f.environmentName=r,f.leftDelim=n,f.rightDelim=a,e.contentDidChange({}),!0}function Of(e,r){let n=e.at(e.position);for(;n&&!(Array.isArray(n.parentBranch)&&n.parent instanceof an);)n=n.parent;if(Array.isArray(n==null?void 0:n.parentBranch)&&(n==null?void 0:n.parent)instanceof an){const a=n.parent,u=n.parentBranch;let f;switch(r){case"row":if(a.rowCount>1){a.removeRow(u[0]);const v=a.getCell(Math.max(0,u[0]-1),u[1]);f=e.offsetOf(v[v.length-1])}break;case"column":if(a.colCount>a.minColumns){a.removeColumn(u[1]);const v=a.getCell(u[0],Math.max(0,u[1]-1));f=e.offsetOf(v[v.length-1])}break}f&&e.setPositionHandlingPlaceholder(f)}}function G1(e){return e.contentWillChange({inputType:"deleteContent"})?(Of(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function V1(e){return e.contentWillChange({inputType:"deleteContent"})?(Of(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}Ta({addRowAfter:Rf,addColumnAfter:If,addRowBefore:K1,addColumnBefore:H1,removeRow:G1,removeColumn:V1,setEnvironment:Pf},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Lh(){return[new mo]}var Bf=class s1{constructor(r){this.recording=!1,this.model=r,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(r){r&&this.index>=0&&(this.stack[this.index].selection=r),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(r){return this.recording?(r&&r===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>s1.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=r!=null?r:"",!0):!1}};Bf.maximumDepth=1e3;var W1=Bf;function Ud(e,r,n){if(e.at(r).mode!=="text")return r;const a=n==="backward"?-1:1;let u;if(Qe.test(e.at(r).value)){let f=r,v;do v=e.at(f).mode==="text"&&Qe.test(e.at(f).value),f+=a;while(e.at(f)&&v);u=e.at(f)?f-2*a:f-a}else if(/\s/.test(e.at(r).value)){let f=r;for(;e.at(f)&&e.at(f).mode==="text"&&/\s/.test(e.at(f).value);)f+=a;if(!e.at(f))u=f-a;else{let v=!0;do v=e.at(f).mode==="text"&&!/\s/.test(e.at(f).value),f+=a;while(e.at(f)&&v);u=e.at(f)?f-2*a:f-a}}else{let f=r;for(;e.at(f)&&e.at(f).mode==="text"&&!/\s/.test(e.at(f).value);)f+=a;u=e.at(f)?f:f-a;let v=!0;for(;e.at(f)&&v;)v=e.at(f).mode==="text"&&/\s/.test(e.at(f).value),v&&(u=f),f+=a;u=e.at(f)?f-2*a:f-a}return u-(a>0?0:1)}function z0(e,r,n){var a,u,f,v,A,C,P;const z=e.position;(a=n==null?void 0:n.extend)!=null&&a||e.collapseSelection(r);let Q=e.at(e.position);if(r==="forward"&&(Q.type==="subsup"?(Q=Q.rightSibling,Q||(Q=e.at(e.position+1))):Q=e.at(e.position+1)),!Q)return e.announce("plonk"),!1;let _e=e.offsetOf(Q);if(Q instanceof Fu)_e=Ud(e,_e,r);else if(Q instanceof us)if(Q.isSuggestion)for(console.assert(r==="forward");Q&&Q instanceof us;)Q.isSuggestion=!1,_e=e.offsetOf(Q),Q=Q.rightSibling;else if(r==="forward"){if(Q=Q.rightSibling,!Q||!(Q instanceof us))return e.announce("plonk"),!1;for(;Q&&Q instanceof us&&/[a-zA-Z\*]/.test(Q.value);)_e=e.offsetOf(Q),Q=Q.rightSibling}else{if(Q=Q.leftSibling,!Q||!(Q instanceof us))return e.announce("plonk"),!1;for(;Q&&Q instanceof us&&/[a-zA-Z\*]/.test(Q.value);)_e=e.offsetOf(Q),Q=Q.leftSibling}else if(r==="forward"&&Q.type==="mopen"){let Ie=0;do Q.type==="mopen"?Ie+=1:Q.type==="mclose"&&(Ie-=1),Q=Q.rightSibling;while(!Q.isLastSibling&&Ie!==0);_e=e.offsetOf(Q.leftSibling)}else if(r==="backward"&&Q.type==="mclose"){let Ie=0;do Q.type==="mopen"?Ie+=1:Q.type==="mclose"&&(Ie-=1),Q=Q.leftSibling;while(!Q.isFirstSibling&&Ie!==0);_e=e.offsetOf(Q)}else if(r==="backward")if(Q.type==="first")for(;_e>0&&Q.type==="first";)_e-=1,Q=e.at(_e);else{const Ie=Q.type;Q.type==="subsup"&&(_e=e.offsetOf(e.at(_e).leftSibling)),_e-=1;let ze=(u=e.at(_e))==null?void 0:u.type;for(;_e>=0&&ze===Ie;)((f=e.at(_e))==null?void 0:f.type)==="subsup"?_e=e.offsetOf(e.at(_e).leftSibling):_e-=1,ze=e.at(_e).type}else{const{type:Ie}=Q;let ze=(v=e.at(_e))==null?void 0:v.type;const{lastOffset:St}=e;for(;_e<=St&&(ze===Ie||ze==="subsup");){for(;((A=e.at(_e).rightSibling)==null?void 0:A.type)==="subsup";)_e=e.offsetOf(e.at(_e).rightSibling);_e+=1,ze=(C=e.at(_e))==null?void 0:C.type}_e-=1}if((P=n==null?void 0:n.extend)!=null&&P){if(!e.setSelection(e.anchor,_e))return e.announce("plonk"),!1}else{if(_e===e.position)return e.announce("plonk"),!1;e.position=_e}return e.announce("move",z),e.mathfield.stopCoalescingUndo(),!0}function Go(e,r,n){var a,u;if(n=n!=null?n:{extend:!1},e.mathfield.adoptStyle=r==="backward"?"right":"left",r!=="forward"){const[A,C]=Tl(e);A!==void 0&&C!==void 0&&e.deleteAtoms([A,C])}if(r==="upward")return q1(e,n);if(r==="downward")return Z1(e,n);if(n.extend){let A=Rh(e,e.position,r);A<0&&(A=0),A>e.lastOffset&&(A=e.lastOffset);const C=e.setSelection(e.anchor,A);return e.mathfield.stopCoalescingUndo(),C}if(e.selectionIsPlaceholder){e.collapseSelection(r);const A=Go(e,r);return e.mathfield.stopCoalescingUndo(),A}let f=e.position;const v=f;if(e.collapseSelection(r)?(f=e.position,Ff(e,f)||(f=Rh(e,f,r))):f=Rh(e,f,r),f<0||f>e.lastOffset){let A=!0;return e.silenceNotifications||(A=(u=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:r},cancelable:!0,bubbles:!0,composed:!0})))!=null?u:!0),A&&e.announce("plonk"),A}return e.setPositionHandlingPlaceholder(f),e.mathfield.stopCoalescingUndo(),e.announce("move",v),!0}function Rh(e,r,n){return r=r+(n==="forward"?1:-1),r<0||r>e.lastOffset||Ff(e,r)?r:Rh(e,r,n)}function Ff(e,r){var n;const a=e.at(r);let u=a.parent;for(;u&&!u.inCaptureSelection;)u=u.parent;return!(u!=null&&u.inCaptureSelection||(n=a.parent)!=null&&n.skipBoundary&&(!a.isFirstSibling&&a.isLastSibling||a.type==="first")||e.mathfield.hasEditablePrompts&&!a.parentPrompt)}function j1(e,r,n){let a=1/0,u=0;for(;u<r.length;u++){const f=Jc(e.getHTMLElement(r[u])).right,v=Math.abs(n-f);if(v<=a)a=v;else break}return r[u-1]}function Ih(e,r,n,a,u){const f=e.mathfield.hasEditablePrompts,v=f?n.filter(P=>P.type==="prompt"&&!P.captureSelection):n,A=Jc(e.mathfield.getHTMLElement(r)).right,C=e.offsetOf(j1(e.mathfield,v,A))-(f?1:0);if(a){const[P,z]=e.selection.ranges[0];let Q;C<(u==="up"?P:z)?Q={ranges:[[C,z]],direction:"backward"}:Q={ranges:[[P,C]],direction:"forward"},e.setSelection(Q)}else e.setPositionHandlingPlaceholder(C);e.announce(`move ${u}`)}function q1(e,r){var n,a;const u=(n=r==null?void 0:r.extend)!=null?n:!1;u||e.collapseSelection("backward");const f=()=>{var C,P;let z=!0;return e.silenceNotifications||(z=(P=(C=e.mathfield.host)==null?void 0:C.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?P:!0),e.announce(z?"plonk":"line"),z},v=e.at(e.position);let A=v;for(;A&&A.parentBranch!=="below"&&!(Array.isArray(A.parentBranch)&&A.parent instanceof an);)A=A.parent;if(Array.isArray(A==null?void 0:A.parentBranch)&&A.parent instanceof an){const C=A.parent;if(A.parentBranch[0]<1)return f();const P=A.parentBranch[0]-1,z=C.array[P][A.parentBranch[1]];if(!z.some(_e=>_e.type==="prompt"&&!_e.captureSelection)&&e.mathfield.hasEditablePrompts)return f();Ih(e,v,z,u,"up")}else if(A){const C=(a=A.parent.branch("above"))!=null?a:A.parent.createBranch("above");if(!C.some(z=>z.type==="prompt"&&z.placeholderId)&&e.mathfield.hasEditablePrompts)return f();Ih(e,v,C,u,"up")}else return f();return e.mathfield.stopCoalescingUndo(),!0}function Z1(e,r){var n,a;const u=(n=r==null?void 0:r.extend)!=null?n:!1;u||e.collapseSelection("forward");const f=()=>{var C,P;let z=!0;return e.silenceNotifications||(z=(P=(C=e.mathfield.host)==null?void 0:C.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?P:!0),e.announce(z?"plonk":"line"),z},v=e.at(e.position);let A=v;for(;A&&A.parentBranch!=="above"&&!(Array.isArray(A.parentBranch)&&A.parent instanceof an);)A=A.parent;if(Array.isArray(A==null?void 0:A.parentBranch)&&A.parent instanceof an){const C=A.parent;if(A.parentBranch[0]+1>C.array.length-1)return f();const P=A.parentBranch[0]+1,z=C.array[P][A.parentBranch[1]];if(!z.some(_e=>_e.type==="prompt"&&!_e.captureSelection)&&e.mathfield.hasEditablePrompts)return f();Ih(e,v,z,u,"down")}else if(A){const C=(a=A.parent.branch("below"))!=null?a:A.parent.createBranch("below");if(!C.some(z=>z.type==="prompt")&&e.mathfield.hasEditablePrompts)return f();Ih(e,v,C,u,"down")}else return f();return!0}function Nf(e){const r=e.position,n=e.at(r).parent;return n!=null&&n.parent?(e.position=e.offsetOf(n),e.mathfield.stopCoalescingUndo(),e.announce("move",r),!0):(e.announce("plonk"),!1)}function Y1(e){let r=0,n=e.at(e.position),a=!1;for(;n;)(!n.hasEmptyBranch("superscript")||!n.hasEmptyBranch("subscript"))&&(r+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(a=!1):a=!0,n=n.parent;return a?r:0}function X1(e){let r=0,n=e.at(e.position),a=!1;for(;n;)(!n.hasEmptyBranch("superscript")||!n.hasEmptyBranch("subscript"))&&(r+=1),n.hasEmptyBranch("superscript")?n.hasEmptyBranch("subscript")||(a=!0):a=!1,n=n.parent;return a?r:0}function $f(e){var r;if(e.collapseSelection(),Y1(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let n=e.at(e.position);return n.subsupPlacement===void 0&&(((r=n.rightSibling)==null?void 0:r.type)!=="subsup"&&n.parent.addChildAfter(new C0({style:n.computedStyle}),n),n=n.rightSibling),n.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(n.superscript[0]))),!0}function zf(e){var r;if(e.collapseSelection(),X1(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let n=e.at(e.position);return n.subsupPlacement===void 0&&(((r=e.at(e.position+1))==null?void 0:r.type)!=="subsup"&&n.parent.addChildAfter(new C0({style:e.at(e.position).computedStyle}),n),n=e.at(e.position+1)),n.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(n.subscript[0]))),!0}function J1(){function e(C){const P=[],z=[];return[...C.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(r).forEach((_e,Ie)=>{const ze=a(_e);ze===0?P.push(_e):z.push({documentOrder:Ie,tabIndex:ze,node:_e})}),z.sort((_e,Ie)=>_e.tabIndex===Ie.tabIndex?_e.documentOrder-Ie.documentOrder:_e.tabIndex-Ie.tabIndex).map(_e=>_e.node).concat(P)}function r(C){return!(!n(C)||u(C)||a(C)<0)}function n(C){return!(C.disabled||C.type==="hidden"&&C.tagName.toUpperCase()==="INPUT"||A(C))}function a(C){var P;const z=Number.parseInt((P=C.getAttribute("tabindex"))!=null?P:"NaN",10);return Number.isNaN(z)?C.contentEditable==="true"||(C.nodeName==="AUDIO"||C.nodeName==="VIDEO")&&C.getAttribute("tabindex")===null?0:C.tabIndex:z}function u(C){return C.tagName.toUpperCase()==="INPUT"&&C.type==="radio"&&!v(C)}function f(C,P){for(const z of C)if(z.checked&&z.form===P)return z;return null}function v(C){var P;if(!C.name)return!0;const Q=((P=C.form)!=null?P:C.ownerDocument).querySelectorAll('input[type="radio"][name="'+C.name+'"]'),_e=f(Q,C.form);return!_e||_e===C}function A(C){if(!O()||C===document.activeElement||C.contains(document.activeElement))return!1;if(getComputedStyle(C).visibility==="hidden")return!0;const P=C.getBoundingClientRect();if(P.width===0||P.height===0)return!0;for(;C;){if(getComputedStyle(C).display==="none")return!0;C=C.parentElement}return!1}return O()?e(document.body):[]}function na(e,r,n="forward"){const a=e.position;if(Array.isArray(r)){const u=e.offsetOf(r[0]),f=e.offsetOf(r[r.length-1]);return n==="forward"?e.setSelection(u,f):e.setSelection(f,u),e.announce("move",a),e.mathfield.stopCoalescingUndo(),!0}return n==="forward"?na(e,[r.leftSibling,r]):na(e,[r,r.leftSibling])}function go(e,r){const n=e.position;if(typeof r=="number"&&(r=e.at(r)),r.type==="prompt")e.setSelection(e.offsetOf(r.firstChild),e.offsetOf(r.lastChild));else{const a=e.offsetOf(r);r.type==="placeholder"?e.setSelection(a-1,a):e.position=a}return e.announce("move",n),e.mathfield.stopCoalescingUndo(),!0}function Ph(e,r,n=!0){var a,u;const f=r==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&Go(e,r);let v;const A=e.at(e.anchor).parentPrompt;A?r==="forward"?v=e.offsetOf(A)+1:v=e.offsetOf(A.leftSibling):v=Math.max(e.position+f,0);const C=Kd(e,v,r);if(!C||r==="forward"&&e.offsetOf(C)<v||r==="backward"&&e.offsetOf(C)>v){if(!n||!((u=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:r},cancelable:!0,bubbles:!0,composed:!0})))==null||u))return e.announce("plonk"),!1;const z=J1();if(!document.activeElement||z.length<=1)return e.announce("plonk"),!1;let Q=z.indexOf(document.activeElement)+f;return Q<0&&(Q=z.length-1),Q>=z.length&&(Q=0),z[Q].focus(),e.mathfield.stopCoalescingUndo(),!0}return go(e,C),!0}function Kd(e,r=0,n="forward"){return e.findAtom(a=>a.type==="placeholder"||a.type==="prompt"||!e.mathfield.readOnly&&a.treeDepth>2&&a.isFirstSibling&&a.isLastSibling,r,n)}Ta({moveToOpposite:e=>{const r={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},n=e.at(e.position),{parent:a}=n;if(!a)return e.announce("plonk"),!1;const u=n.parentBranch;let f;if(typeof u=="string"&&(f=r[u]),!f){const A=n.subsupPlacement?zf(e):$f(e);return e.mathfield.stopCoalescingUndo(),A}a.branch(f)||a.createBranch(f);const v=e.setSelection(e.getBranchRange(e.offsetOf(a),f));return e.mathfield.stopCoalescingUndo(),v},moveBeforeParent:e=>{const{parent:r}=e.at(e.position);return r?(e.position=e.offsetOf(r),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>Nf(e),moveToNextChar:e=>Go(e,"forward"),moveToPreviousChar:e=>Go(e,"backward"),moveUp:e=>Go(e,"upward"),moveDown:e=>Go(e,"downward"),moveToNextWord:e=>z0(e,"forward"),moveToPreviousWord:e=>z0(e,"backward"),moveToGroupStart:e=>{const r=e.offsetOf(e.at(e.position).firstSibling);return r===e.position?(e.announce("plonk"),!1):(e.position=r,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const r=e.offsetOf(e.at(e.position).lastSibling);return r===e.position?(e.announce("plonk"),!1):(e.position=r,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var r,n,a,u;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return Ph(e,"forward");const f=e.at(e.position);if(f.mode==="text"){if(e.selectionIsCollapsed){let _e=f;for(;_e&&_e.mode==="text";)_e=_e.leftSibling;let Ie=f;for(;((r=Ie.rightSibling)==null?void 0:r.mode)==="text";)Ie=Ie.rightSibling;if(_e&&Ie)return na(e,[_e,Ie])}if(f.rightSibling.mode==="text"){let _e=f;for(;_e&&_e.mode==="text";)_e=_e.rightSibling;return _e?(go(e,(n=_e.leftSibling)!=null?n:_e),e.mathfield.switchMode("math"),!0):go(e,e.lastOffset)}}const A=e.at(e.anchor).parentPrompt,C=A?e.offsetOf(A)+1:Math.max(e.position+1,0),P=Kd(e,C,"forward");if(P)return go(e,P);const z=Uf(e,f,_e=>_e.type==="leftright"||_e.type==="text","forward");if(z){if(z.mode==="text"){let _e=z;for(;_e&&_e.mode==="text";)_e=_e.rightSibling;return na(e,[(a=z.leftSibling)!=null?a:z,(u=_e.leftSibling)!=null?u:_e])}return na(e,z)}const Q=f.parent;if(Q){if(Q.type==="leftright"||Q.type==="surd")return na(e,Q);if(f.parentBranch==="superscript"&&Q.subscript)return na(e,Q.subscript);if(f.parentBranch==="above"&&Q.below)return na(e,Q.below);if(f.parentBranch==="superscript"||f.parentBranch==="subscript")return go(e,Q);if(f.parentBranch==="above"||f.parentBranch==="below")return na(e,Q)}return go(e,e.lastOffset)},moveToPreviousGroup:e=>{var r;if(e.position===0&&e.anchor===0)return Ph(e,"backward");let n=e.at(e.position);const a=n.mode;if(a==="text"){if(e.selectionIsCollapsed){let A=n;for(;A&&A.mode==="text";)A=A.leftSibling;let C=n;for(;((r=C.rightSibling)==null?void 0:r.mode)==="text";)C=C.rightSibling;if(A&&C)return na(e,[A,C])}for(;n&&n.mode==="text";)n=n.leftSibling;return n?go(e,n):go(e,0)}const u=e.at(e.anchor).parentPrompt,f=u?e.offsetOf(u.leftSibling):Math.max(e.position-1,0),v=Kd(e,f,"backward");if(v)return go(e,v);if(a==="math"){const A=Uf(e,n,P=>P.type==="leftright"||P.type==="text","backward");if(A){if(A.mode==="text"){let P=A;for(;P&&P.mode==="text";)P=P.leftSibling;return na(e,[A,P])}return na(e,A)}const C=n.parent;if(C){if(C.type==="leftright"||C.type==="surd")return na(e,C);if(n.parentBranch==="subscript"&&C.superscript)return na(e,C.superscript);if(n.parentBranch==="below"&&C.above)return na(e,C.above);if(n.parentBranch==="superscript"||n.parentBranch==="subscript")return go(e,C);if(n.parentBranch==="above"||n.parentBranch==="below")return na(e,C)}return go(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&e.position===0?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:$f,moveToSubscript:zf},{target:"model",changeSelection:!0}),Ta({moveToNextPlaceholder:e=>Ph(e,"forward"),moveToPreviousPlaceholder:e=>Ph(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function Uf(e,r,n,a){if(a==="forward"){let f=r.rightSibling;for(;f&&!n(f);)f=f.rightSibling;return f}let u=r.leftSibling;for(;u&&!n(u);)u=u.leftSibling;return u}function Oh(e,r,n){typeof r=="function"&&(n=r,r=1/0),r===void 0&&(r=1/0);let a=e.position,u=!1,f="";for(;!u;){const v=e.at(a);u=r===0||v===void 0||v.type==="first"||v.mode!=="math"||!(v.type&&/mord|mpunct|operator/.test(v.type)||v.type==="mop"&&/[a-zA-Z ]+/.test(v.value))||!v.hasEmptyBranch("superscript")||!v.hasEmptyBranch("subscript")||typeof n=="function"&&!n(v),u||(v.mode="text",v.command=v.value,v.verbatimLatex=void 0,f+=v.value),a-=1,r-=1}e.contentDidChange({data:f,inputType:"insertText"})}function Qu(e,r,n){typeof r=="function"&&(n=r,r=1/0),r===void 0&&(r=1/0);let a=e.position,u=!1;const f=[];for(;!u;){const v=e.at(a);u=r===0||!v||v.type==="first"||v.isFirstSibling||v.mode!=="text"||v.value===" "||typeof n=="function"&&!n(v),u||(f.push($t.serialize([v],{defaultMode:"math"})),v.mode="math"),a-=1,r-=1}Hd(e),e.contentDidChange({data:Xi(f),inputType:"insertText"})}function Hd(e){var r;let n=e.position-1;for(;n>=0&&((r=e.at(n))==null?void 0:r.mode)==="math";)n-=1;if(!(n<0)&&e.at(n).mode==="text"&&e.at(n).value===" "&&e.at(n-1).mode==="math"){e.at(n-1).parent.removeChild(e.at(n-1));const a=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=a,e.contentDidChange({inputType:"deleteContent"})}}function Q1(e){let r="",n=e.position,a=!1;for(;!a;){const u=e.at(n);a=!(u&&(u.mode==="text"||u.mode==="math"&&u.type&&/mord|mpunct/.test(u.type))),a||(r=u.value+r),n-=1}return r}function em(e,r,n){const{model:a}=e;if(a.mode==="latex"||!a.at(a.position).isLastSibling||!n||!fn(n))return!1;const u=ma(n);if(!a.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(u));const f=Q1(a)+u;if(e.model.mode==="text"){if(r==="Esc"||/[/\\]/.test(u))return!0;if(/[\^_]/.test(u))return/(^|\s)[a-zA-Z][^_]$/.test(f)&&Qu(a,1),!0;const v={")":"(","}":"{","]":"["}[u],{parent:A}=a.at(a.position);if(v&&A instanceof Zn&&A.leftDelim===v)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(f))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(u))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(f))return Qu(a,1),!1;if(/\D\.[^\d\s]$/.test(f)){Qu(a,1);const C=a.at(a.position);return C.value="\u22C5",C.style.variant="normal",C.command="\\cdot",C.verbatimLatex=void 0,a.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(f)||/\.\d$/.test(f)||/\([\d+\-.]$/.test(f))return Qu(a,1),!0;if(/\([a-z][,;]$/.test(f))return Qu(a,2),!0;if(/[\d+\-=><*|]$/.test(u))return Hd(a),!0}else{if(r==="[Space]")return Oh(a,void 0,v=>/[a-z][:,;.]$/.test(v.value)),!0;if(/[a-zA-Z]{3,}$/.test(f)&&!/(dxd|abc|xyz|uvw)$/.test(f))return Oh(a,void 0,v=>/[a-zA-Z]/.test(v.value)),!0;if(/(^|\W)(if)$/i.test(f))return Oh(a,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(f)&&!/(αβγ)$/.test(f))return Oh(a,void 0,v=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(v.value)),!0;if(u==="?"||u==="."&&!/[\d-+]\.$/.test(f))return!0}return!1}function tm(e,r){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const n=Kf(),a=e.element.getBoundingClientRect();n.style.left=`${a.left}px`,n.style.top=`${a.top-64}px`,n.innerHTML=window.MathfieldElement.createHTML("<span>"+(br(r)||r)+"</span>"+n.innerHTML),n.style.visibility="visible",setTimeout(()=>{n.childNodes.length>0&&n.childNodes[n.childNodes.length-1].remove(),n.childNodes.length===0&&(n.style.visibility="hidden")},3e3)}function rm(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){const r=Kf();r.innerHTML=""}else{const r=Uo("mathlive-keystroke-caption-panel");r.style.visibility="hidden"}return!1}function Kf(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(fo("keystroke-caption"),fo("core"),Uo("mathlive-keystroke-caption-panel"))}function im(){document.getElementById("mathlive-keystroke-caption-panel")&&(P0("mathlive-keystroke-caption-panel"),Fo("core"),Fo("keystroke-caption"))}function Hf(e,r){var n,a,u;const{model:f}=e,v=xc(r);if(r.isTrusted){Zr(r);const Ie=ti();e.keyboardLayout!==Ie.id&&(e.keyboardLayout=Ie.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,tm(e,v),r.isTrusted&&r.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let A,C="",P;const z=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(f.mode==="math")if(v==="[Backspace]")z.pop();else if(!fn(r))e.flushInlineShortcutBuffer();else{const Ie=ma(r),ze=[...(a=(n=z[z.length-1])==null?void 0:n.keystrokes)!=null?a:[],Ie];z.push({state:f.getState(),keystrokes:ze,leftSiblings:nm(e)});let St=0,sr="";for(;!A&&St<ze.length;)P=z.length-(ze.length-St),sr=ze.slice(St).join(""),A=Io(z[P].leftSiblings,sr,e.options.inlineShortcuts),!A&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(sr)&&(A=e.options.onInlineShortcut(e,sr)),St+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(A?e.switchMode("math"):em(e,v,r)&&(e.switchMode({math:"text",text:"math"}[f.mode]),C=""))}if(!A){if(C||(C=Id(e.keybindings,f.mode,r)),!C&&(v==="[Enter]"||v==="[Return]")){let Ie=!1;return f.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(Ie=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),Ie||r.preventDefault&&(r.preventDefault(),r.stopPropagation()),f.contentDidChange({inputType:"insertLineBreak"})),Ie}if((!C||v==="[Space]")&&f.mode==="math"){if(v==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return Rn.insert(f,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),C="",e.dirty=!0,e.scrollIntoView(),r.preventDefault&&(r.preventDefault(),r.stopPropagation()),!1;const Ie=f.at(f.position+1),ze=f.at(f.position-1);if((Ie==null?void 0:Ie.mode)==="text"||(ze==null?void 0:ze.mode)==="text")return Rn.insert(f," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(u=f.at(f.position))!=null&&u.isDigit()&&window.MathfieldElement.decimalSeparator===","&&ma(r)===","&&(C="insertDecimalSeparator")}}if(!A&&!C){if(f.mathfield.smartFence){if(Vd(f,ma(r),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1}else{const{parent:Ie}=f.at(f.position);if(Ie instanceof Zn&&Ie.rightDelim==="?"&&f.at(f.position).isLastSibling&&/^[)}\]|]$/.test(v))return e.snapshot(),Ie.isDirty=!0,Ie.rightDelim=v,f.position+=1,f.selectionDidChange(),f.contentDidChange({data:ma(r),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1;if(!f.selectionIsCollapsed){const ze=ma(r);if(ze==="("||ze==="{"||ze==="["){const St={"(":"(","{":"\\lbrace","[":"\\lbrack"}[ze],sr={"(":")","{":"\\rbrace","[":"\\rbrack"}[ze],[xt,Wt]=Ds(f.selection);return e.snapshot(),f.position=Wt,Rn.insert(f,sr,{format:"latex"}),f.position=xt,Rn.insert(f,St,{format:"latex"}),f.setSelection(xt+1,Wt+1),f.contentDidChange({data:ze,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1}}}return!0}const Q=f.at(Math.max(f.position,f.anchor)),{parent:_e}=Q;if(C==="moveAfterParent"&&(_e==null?void 0:_e.type)==="leftright"&&Q.isLastSibling&&e.options.smartFence&&Vd(f,".",e.defaultStyle)&&(C="",ns(e)),e.keyboardDelegate.cancelComposition(),C)e.executeCommand(C);else if(A){const Ie=e.effectiveStyle;f.setState(z[P].state);const ze=z[z.length-1].keystrokes;for(const St of ze)Rn.insert(f,St,{silenceNotifications:!0,style:Ie});e.snapshot("insert-shortcut"),f.setState(z[P].state),f.deferNotifications({content:!0,selection:!0,data:A,type:"insertText"},()=>(Rn.insert(f,A,{format:"latex",style:Ie}),Hd(e.model),A.endsWith(" ")&&(e.switchMode("text"),Rn.insert(f," ",{style:Ie,mode:"text"})),e.snapshot(),f.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,f.announce("replacement")}return e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1}function Gd(e,r,n){const{model:a}=e;if(!e.isSelectionEditable){a.announce("plonk");return}n!=null||(n={}),n.focus&&e.focus(),n.feedback&&window.MathfieldElement.playSound("keypress"),typeof n.mode=="string"&&(e.switchMode(n.mode),e.snapshot());let u=Zh(r);const f=window.mathVirtualKeyboard;if(f!=null&&f.isShifted&&(u=typeof u=="string"?u.toUpperCase():u.map(C=>C.toUpperCase())),n.simulateKeystroke){let C=!0;for(const P of u)Hf(e,new KeyboardEvent("keypress",{key:P}))&&(C=!1);if(C)return}const v=a.at(a.position),A=$($({},v.computedStyle),e.defaultStyle);if(a.selectionIsCollapsed||(a.deleteAtoms(Ds(a.selection)),e.snapshot("delete")),a.mode==="latex")a.deferNotifications({content:!0,selection:!0,data:r,type:"insertText"},()=>{Ya(e);for(const C of u)Rn.insert(a,C);e.snapshot("insert-latex"),ou(e)});else if(a.mode==="text"){for(const C of u)Rn.insert(a,C,{style:A});e.snapshot("insert-text")}else if(a.mode==="math")for(const C of u)sm(e,C,A,v);e.dirty=!0,e.scrollIntoView()}function nm(e){const r=e.model,n=[];let a=r.at(Math.min(r.position,r.anchor));for(;a.type!=="first";)n.push(a),a=a.leftSibling;return n}function sm(e,r,n,a){const u=e.model;let f={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[r];if(r===" "&&e.options.mathModeSpace&&(f=["insert",e.options.mathModeSpace]),f){e.executeCommand(f);return}if(/\d/.test(r)&&e.options.smartSuperscript&&a.parentBranch==="superscript"&&a.parent.type!=="mop"&&a.parent.type!=="operator"&&a.parent.type!=="extensible-symbol"&&a.hasNoSiblings){am(u),Rn.insert(u,r,{style:n}),e.snapshot(),Nf(u),e.snapshot();return}if(/[a-zA-Z0-9]/.test(r)&&e.adoptStyle!=="none"){const v=e.adoptStyle==="left"?a:a.parent?a.rightSibling:null;(v==null?void 0:v.type)==="mord"&&/[a-zA-Z0-9]/.test(v.value)&&(n=$({},n),v.style.variant&&(n.variant=v.style.variant),v.style.variantStyle&&(n.variantStyle=v.style.variantStyle))}Rn.insert(u,r,{style:n}),e.snapshot(`insert-${u.at(u.position).type}`)}function am(e){e.selectionIsCollapsed||(e.deleteAtoms(Ds(e.selection)),e.mathfield.snapshot("delete"))}function Vd(e,r,n){if(!r||e.mode!=="math")return!1;const a=e.at(e.position),{parent:u}=a,f={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[r];if(!f)return!1;const v=$u[f],A=Nu[f];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[C,P]=Ds(e.selection),z=e.extractAtoms([C,P]),Q=u.addChildrenAfter([new Zn("left...right",z,{leftDelim:f,rightDelim:A})],e.at(C));return e.setSelection(e.offsetOf(Q.firstChild),e.offsetOf(Q.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:f,inputType:"insertText"}),!0}if(f==="|"){const C=u instanceof Zn?u.leftDelim+u.rightDelim:"";if(C==="\\lbrace\\rbrace"||C==="\\{\\}"||C==="\\lbrace?")return e.mathfield.snapshot(),Rn.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:n}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:f,inputType:"insertText"}),!0}if(A){if(u instanceof Zn&&u.firstChild===a&&(u.leftDelim==="?"||u.leftDelim==="."))return u.leftDelim=f,u.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(u instanceof Zn)){let Q=a;for(;Q&&!(Q.type==="mclose"&&Q.value===A);)Q=Q.rightSibling;if(Q){e.mathfield.snapshot();const _e=e.extractAtoms([e.offsetOf(a),e.offsetOf(Q)]);return _e.pop(),u.addChildrenAfter([new Zn("left...right",_e,{leftDelim:f,rightDelim:A})],a),e.position=e.offsetOf(u.firstChild)+1,e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const C=e.offsetOf(a.lastSibling);let P;for(P=e.position;P<=C;P++){const Q=e.at(P);if(Q instanceof Zn&&(Q.leftDelim==="?"||Q.leftDelim===".")&&Gf(f,Q.rightDelim))break}const z=e.at(P);if(P<=C&&z instanceof Zn){z.leftDelim=f,e.mathfield.snapshot();let Q=e.extractAtoms([e.position,P-1]);return Q=Q.filter(_e=>_e.type!=="first"),z.addChildren(Q,z.parentBranch),e.position+=1,e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(u instanceof Zn&&(u.leftDelim==="?"||u.leftDelim===".")&&Gf(f,u.rightDelim)){u.isDirty=!0,u.leftDelim=f,e.mathfield.snapshot();const Q=e.extractAtoms([e.offsetOf(a.firstSibling),e.position]);for(const _e of Q)u.parent.addChildBefore(_e,u);return e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(u instanceof Zn&&u.leftDelim==="|")){if(e.mathfield.snapshot(),Rn.insert(e,`\\left${f}\\right?`,{format:"latex",style:n}),a.lastSibling.type!=="first"){const Q=e.offsetOf(a.lastSibling),_e=e.extractAtoms([e.position,Q]);e.at(e.position).body=_e,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(v){let C=a;for(;C;){if(C.type==="mopen"&&C.value===v){e.mathfield.snapshot();const Ie=C.leftSibling,ze=e.extractAtoms([e.offsetOf(C.leftSibling),e.offsetOf(a)]);ze.shift();const St=new Zn("left...right",ze,{leftDelim:v,rightDelim:f});return u.addChildrenAfter([St],Ie),e.position=e.offsetOf(St),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}C=C.leftSibling}if(u instanceof Zn&&a.isLastSibling&&Wd(u.leftDelim,f))return e.mathfield.snapshot(),u.isDirty=!0,u.rightDelim=f,e.position+=1,e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const P=e.offsetOf(a.firstSibling);let z;for(z=e.position;z>=P;z--){const Ie=e.at(z);if(Ie instanceof Zn&&(Ie.rightDelim==="?"||Ie.rightDelim===".")&&Wd(Ie.leftDelim,f))break}const Q=e.at(z);if(z>=P&&Q instanceof Zn)return e.mathfield.snapshot(),Q.rightDelim=f,Q.addChildren(e.extractAtoms([z,e.position]),Q.parentBranch),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(u instanceof Zn&&(u.rightDelim==="?"||u.rightDelim===".")&&Wd(u.leftDelim,f))return e.mathfield.snapshot(),u.isDirty=!0,u.rightDelim=f,u.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(a.lastSibling)]),u.parentBranch),e.position=e.offsetOf(u),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const _e=u.parent;return _e instanceof Zn&&(_e.rightDelim==="?"||_e.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(_e),Vd(e,f,n)):!1}return!1}function Wd(e,r){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(r):Nu[e]===r:!0}function Gf(e,r){return r?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(r)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):$u[r]===e:!0}Ta({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const r=e.field.getBoundingClientRect();return e.field.scroll(r.left-window.scrollX,0),!0},toggleKeystrokeCaption:rm,toggleContextMenu:e=>{const r=e.toggleContextMenu();return r||e.model.announce("plonk"),r},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,r,n,a)=>(e.switchMode(r,n,a),!0),insert:(e,r,n)=>e.insert(r,n),typedText:(e,r,n)=>(Gd(e,r,n),!0),insertDecimalSeparator:e=>{const r=e.model;return r.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&r.at(Math.max(r.position,r.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var r;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((r=e.host)==null||r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,r,n)=>{const a=e.getPrompts();let u="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),f=0;for(;a.includes(u)&&f<100;){if(f===99)return console.error("could not find a unique ID after 100 tries"),!1;u="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),f++}return e.insert(`\\placeholder[${r!=null?r:u}]{}`,n),!0}}),Ta({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),Ta({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(r=>{r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(r,{mode:e.model.mode})&&(ou(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),ns(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function om(e,r){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const n=jd(e,r),{model:a}=e;return a.selectionIsCollapsed?(e.defaultStyle.fontSeries&&n.fontSeries===e.defaultStyle.fontSeries&&(n.fontSeries="auto"),n.fontShape&&n.fontShape===e.defaultStyle.fontShape&&(n.fontShape="auto"),n.color&&n.color===e.defaultStyle.color&&(n.color="none"),n.backgroundColor&&n.backgroundColor===e.defaultStyle.backgroundColor&&(n.backgroundColor="none"),n.fontSize&&n.fontSize===e.defaultStyle.fontSize&&(n.fontSize="auto"),e.defaultStyle=$($({},e.defaultStyle),n)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{a.selection.ranges.forEach(u=>$d(a,u,n,{operation:"toggle"})),e.snapshot("style-change")}),!0}Ta({applyStyle:om},{target:"mathfield",canUndo:!0,changeContent:!0});function jd(e,r){var n,a,u,f,v,A,C,P,z,Q;const _e={};if(typeof r.color=="string"){const ze=(a=e.colorMap((n=r.color)!=null?n:r.verbatimColor))!=null?a:"none";ze!==r.color&&(_e.verbatimColor=(u=r.verbatimColor)!=null?u:r.color),_e.color=ze}if(typeof r.backgroundColor=="string"){const ze=(v=e.backgroundColorMap((f=r.backgroundColor)!=null?f:r.verbatimBackgroundColor))!=null?v:"none";ze!==r.backgroundColor&&(_e.verbatimBackgroundColor=(A=r.verbatimBackgroundColor)!=null?A:r.backgroundColor),_e.backgroundColor=ze}typeof r.fontFamily=="string"&&(_e.fontFamily=r.fontFamily),typeof r.series=="string"&&(_e.fontSeries=r.series),typeof r.fontSeries=="string"&&(_e.fontSeries=r.fontSeries.toLowerCase()),_e.fontSeries&&(_e.fontSeries=(C={bold:"b",medium:"m",normal:"m"}[_e.fontSeries])!=null?C:_e.fontSeries),typeof r.shape=="string"&&(_e.fontShape=r.shape),typeof r.fontShape=="string"&&(_e.fontShape=r.fontShape.toLowerCase()),_e.fontShape&&(_e.fontShape=(P={italic:"it",up:"n",upright:"n",normal:"n"}[_e.fontShape])!=null?P:_e.fontShape),r.variant&&(_e.variant=r.variant.toLowerCase()),r.variantStyle&&(_e.variantStyle=r.variantStyle.toLowerCase());const Ie=(z=r.size)!=null?z:r.fontSize;return typeof Ie=="number"?_e.fontSize=Math.max(1,Math.min(10,Ie)):typeof Ie=="string"&&(_e.fontSize=(Q={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[Ie.toLowerCase()])!=null?Q:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[Ie]),_e}function qd(e){let[r,n]=Ds(e.selection);if(r=Vf(e,r,"backward"),n=Vf(e,n,"forward"),r===n){const a=e.at(r);if(a.type==="leftright")return e.setSelection(e.offsetOf(a.firstChild)-1,n);if(a.type==="first"&&(a.parent.type==="leftright"||a.parent.type==="surd"))return e.setSelection(r-1,e.offsetOf(a.parent.lastChild)+1);e.setSelection(r-1,n)}else e.setSelection(r,n);return!0}function Vf(e,r,n){var a,u,f;let v=e.at(r);if(!v)return r;const A=n==="forward"?1:-1;if(v.mode==="text"){for(;v&&!(v.mode!=="text"||!Qe.test(v.value));)r+=A,v=e.at(r);return n==="backward"?r-1:r}if(v.mode==="latex"){if(/[a-zA-Z\*]/.test(v.value))if(n==="backward")for(;v&&v.mode==="latex"&&v.value!=="\\"&&/[a-zA-Z]/.test(v.value);)r+=A,v=e.at(r);else for(;v&&v.mode==="latex"&&/[a-zA-Z\*]/.test(v.value);)r+=A,v=e.at(r);else if(v.value==="{"){if(n==="forward"){for(;v&&v.mode==="latex"&&v.value!=="}";)r+=A,v=e.at(r);return r}return r-1}else if(v.value==="}"){if(n==="backward"){for(;v&&v.mode==="latex"&&v.value!=="{";)r+=A,v=e.at(r);return r-1}return r}return r-1}if(v.mode==="math"){if(v.isDigit()){for(;(a=e.at(r+A))!=null&&a.isDigit();)r+=A;return n==="backward"?r-1:r}if(v.style.variant||v.style.variantStyle){let C=(u=e.at(r))==null?void 0:u.style;for(;C&&C.variant===v.style.variant&&C.variantStyle===v.style.variantStyle;)C=(f=e.at(r+A))==null?void 0:f.style,r+=A;return n==="backward"?r-1:r}return r}return r}Ta({selectGroup:e=>{const r=qd(e);return r||e.announce("plonk"),r},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>Go(e,"forward",{extend:!0}),extendSelectionBackward:e=>Go(e,"backward",{extend:!0}),extendToNextWord:e=>z0(e,"forward",{extend:!0}),extendToPreviousWord:e=>z0(e,"backward",{extend:!0}),extendSelectionUpward:e=>Go(e,"upward",{extend:!0}),extendSelectionDownward:e=>Go(e,"downward",{extend:!0}),extendToNextBoundary:e=>z0(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>z0(e,"backward",{extend:!0}),extendToGroupStart:e=>{const r=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return r||e.announce("plonk"),r},extendToGroupEnd:e=>{const r=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return r||e.announce("plonk"),r},extendToMathFieldStart:e=>{const r=e.setSelection(e.anchor,0);return r||e.announce("plonk"),r},extendToMathFieldEnd:e=>{const r=e.setSelection(e.anchor,e.lastOffset);return r||e.announce("plonk"),r}},{target:"model",changeSelection:!0});var e0=null,Cc=0,Bh=class Qa{static start(r,n,a,u){var f;Qa.element=r,(f=Qa.controller)==null||f.abort(),Qa.controller=new AbortController;const v={signal:Qa.controller.signal};"PointerEvent"in window?(r.addEventListener("pointermove",a,v),r.addEventListener("pointerup",u,v),r.addEventListener("pointercancel",u,v),Zd(n)&&(Qa.pointerId=n.pointerId,r.setPointerCapture(n.pointerId))):(window.addEventListener("mousemove",a,v),window.addEventListener("blur",u,v),window.addEventListener("mouseup",u,v))}static stop(){var r;(r=Qa.controller)==null||r.abort(),Qa.controller=void 0,typeof Qa.pointerId=="number"&&(Qa.element.releasePointerCapture(Qa.pointerId),Qa.pointerId=void 0)}};function Zd(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function Wf(e,r){var n;if(r.buttons>1)return;e.atomBoundsCache=new Map;const a=e;let u,f=!1,v=!1,A="none",C=!1,P=!1;const z=r.clientX,Q=r.clientY,_e=Date.now(),Ie=a.field,ze=setInterval(()=>{C?Ie.scroll({top:0,left:Ie.scrollLeft-16}):P&&Ie.scroll({top:0,left:Ie.scrollLeft+16})},32);function St(){Bh.stop(),f=!1,clearInterval(ze),e.element.classList.remove("tracking"),r&&r.preventDefault()}function sr(Wt){if(!a.hasFocus()){St();return}const hr=Wt.clientX,Zt=Wt.clientY,Nr=Zd(Wt)&&Wt.pointerType==="touch"?20:5;if(Date.now()<_e+500&&Math.abs(z-hr)<Nr&&Math.abs(Q-Zt)<Nr){Wt.preventDefault(),Wt.stopPropagation();return}const Qr=Ie.getBoundingClientRect();P=hr>Qr.right,C=hr<Qr.left;let Wr=u;Zd(Wt)&&(Wt.isPrimary||(Wr=Dc(a,Wt.clientX,Wt.clientY,{bias:0})));const Yi=Dc(a,hr,Zt,{bias:hr<=z?hr===z?0:-1:1});Wr>=0&&Yi>=0&&(a.model.extendSelectionTo(Wr,Yi),ns(e)),v&&qd(a.model)}e0&&Math.abs(e0.x-z)<5&&Math.abs(e0.y-Q)<5&&Date.now()<e0.time+500?(Cc+=1,e0.time=_e):(e0={x:z,y:Q,time:_e},Cc=1);const xt=Ie.getBoundingClientRect();if(z>=xt.left&&z<=xt.right&&Q>=xt.top&&Q<=xt.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",u=Dc(e,z,Q,{bias:0}),u>=0){if(e.element.classList.add("tracking"),r.shiftKey){const Wt=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,u),Wu(e.model)||Wt?A="all":A="selection"}else e.model.at(u).type==="placeholder"?(e.model.setSelection(u-1,u),A="selection"):((n=e.model.at(u).rightSibling)==null?void 0:n.type)==="placeholder"?(e.model.setSelection(u,u+1),A="selection"):(e.model.position=u,Wu(e.model)?A="all":A="selection");e.defaultStyle={},r.detail===3||Cc>2?(St(),(r.detail===3||Cc===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},A="all")):f||(f=!0,Bh.start(Ie,r,sr,St),(r.detail===2||Cc===2)&&(v=!0,qd(e.model),A="all"))}e.hasFocus()||(A="none",e.focus({preventScroll:!0}))}else e0=null;e.stopCoalescingUndo(),A!=="none"&&(e.model.selectionIsCollapsed&&(A="all"),ns(e)),r.preventDefault()}function lm(e,r,n){if(e>=n.left&&e<=n.right&&r>=n.top&&r<=n.bottom)return 0;const a=e-(n.left+n.right)/2,u=r-(n.top+n.bottom)/2;return a*a+u*u}function jf(e,r,n,a,u){if(!n.id)return[1/0,null];if(r.has(n.id))return r.get(n.id);const f=Ql(e,n);if(!f)return[1/0,null];let v=[1/0,null];if(n.hasChildren&&!n.captureSelection&&a>=f.left&&a<=f.right)for(const A of n.children){const C=jf(e,r,A,a,u);C[0]<=v[0]&&(v=C)}return v[1]||(v=[lm(a,u,f),n]),r.set(n.id,v),v}function um(e,r,n){const[,a]=jf(e,new Map,e.model.root,r,n);return a}function Dc(e,r,n,a){var u;const f=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!f)return 0;if(r>f.right||n>f.bottom+8)return e.model.lastOffset;if(r<f.left||n<f.top-8)return 0;a=a!=null?a:{},a.bias=(u=a.bias)!=null?u:0;let v=um(e,r,n);const A=[];let C=v;for(;C;)A.unshift(C),C=C.parent;for(const z of A)if(z.captureSelection){v=z;break}let P=e.model.offsetOf(v);if(P<0)return-1;if(v.leftSibling)if(a.bias===0&&v.type!=="placeholder"){const z=Ql(e,v);z&&r<(z.left+z.right)/2&&(P=e.model.offsetOf(v.leftSibling))}else a.bias<0&&(P=e.model.offsetOf(v.leftSibling));return P}var cm=class extends Rn{constructor(){super("math")}onPaste(e,r){if(!r||!e.model.contentWillChange({data:typeof r=="string"?r:null,dataTransfer:typeof r=="string"?null:r,inputType:"insertFromPaste"}))return!1;let n="",a="auto",u=typeof r!="string"?r.getData("application/json+mathlive"):"";if(u)try{const f=JSON.parse(u);if(f&&Array.isArray(f)){e.snapshot();const v=$o(f),{model:A}=e;A.selectionIsCollapsed||A.deleteAtoms(Ds(A.selection));const C=A.at(A.position);if(C.parent instanceof an){console.assert(C.parentBranch!==void 0);const P=[];let z=[];v[0].type==="first"&&v.shift(),v[v.length-1].type==="first"&&v.pop();for(const ze of v)ze.type==="first"&&z.length>0?(P.push(z),z=[ze]):z.push(ze);z.length>0&&P.push(z);let Q=Number(C.parentBranch[0]),_e=Number(C.parentBranch[1]);const Ie=C.parent.maxColumns;for(;C.parent.colCount-_e<P.length&&C.parent.colCount<Ie;)C.parent.addColumn();C.parent.addChildrenAfter(P[0],C);for(let ze=1;ze<P.length;ze++)_e++,_e>=Ie&&(_e=0,C.parent.addRowAfter(Q),Q++),C.parent.setCell(Q,_e,P[ze])}else C.parent.addChildrenAfter(v.filter(P=>P.type!=="first"),C);return A.position=A.offsetOf(v[v.length-1]),A.contentDidChange({inputType:"insertFromPaste"}),ns(e),!0}}catch(f){}if(u=typeof r!="string"?r.getData("application/json"):"",u&&window.MathfieldElement.computeEngine)try{const f=JSON.parse(u);if(typeof f=="object"&&"latex"in f&&f.latex&&(n=f.latex),!n){const v=window.MathfieldElement.computeEngine.box(f);v&&!v.has("Error")&&(n=v.latex)}n||(a="latex")}catch(f){}if(!n&&typeof r!="string"&&(n=r.getData("application/x-latex"),n&&(a="latex")),n||(n=typeof r=="string"?r:r.getData("text/plain")),n){let f;return[f,n]=Po(n),a==="auto"&&f&&(a="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n,{format:a})&&(e.startRecording(),e.snapshot("paste"),ns(e)),e.startRecording(),!0}return!1}insert(e,r,n){var a,u;const f=typeof r=="string"?r:(u=(a=window.MathfieldElement.computeEngine)==null?void 0:a.box(r).latex)!=null?u:"";if(!n.silenceNotifications&&!e.contentWillChange({data:f,inputType:"insertText"}))return!1;n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder"),n.format||(n.format="auto");const{silenceNotifications:v}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const A=e.silenceNotifications;e.silenceNotifications=!0;const C={"?":"\\placeholder{}","@":"\\placeholder{}"};C[0]=n.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ds(e.selection)):n.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):n.insertionMode==="insertBefore"?e.collapseSelection("backward"):n.insertionMode==="insertAfter"&&e.collapseSelection("forward"),!e.at(e.position).isLastSibling&&e.at(e.position+1).type==="placeholder"?e.deleteAtoms([e.position,e.position+1]):e.at(e.position).type==="placeholder"&&e.deleteAtoms([e.position-1,e.position]);let P=-1;C[0]?C["@"]=C[0]:typeof r=="string"&&/(^|[^\\])#@/.test(r)&&(P=dm(e),P>=0&&(C["@"]=e.getValue(P,e.position,"latex"))),C[0]||(C[0]=C["?"]);let z=!1;const Q=hr=>(z=!0,C[hr]);let[_e,Ie]=qf(e,r,Q,n);if(!Ie)return!1;const ze=Ie.length===1&&Ie[0].type==="genfrac";ze&&P>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(C["@"]=C["?"],z=!1,[_e,Ie]=qf(e,r,Q,n)):P>=0&&e.deleteAtoms([P,e.position]);const{parent:St}=e.at(e.position),sr=St.hasEmptyBranch("body");if(ze&&_e!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&St instanceof Zn&&St.leftDelim==="("&&sr){const hr=St.parent,Zt=St.parentBranch;hr.removeChild(St),hr.setChildren(Ie,Zt)}const xt=e.at(e.position);xt.parent.addChildrenAfter(Ie,xt),_e==="latex"&&typeof r=="string"&&(St==null?void 0:St.type)==="root"&&sr&&!z&&(St.verbatimLatex=r),e.silenceNotifications=A;const Wt=Ie[Ie.length-1];if(n.selectionMode==="placeholder"){const hr=Ie.flatMap(Zt=>[Zt,...Zt.children]).find(Zt=>Zt.type==="placeholder");if(hr){const Zt=e.offsetOf(hr);e.setSelection(Zt-1,Zt),e.announce("move")}else Wt&&(e.position=e.offsetOf(Wt))}else n.selectionMode==="before"||(n.selectionMode==="after"?Wt&&(e.position=e.offsetOf(Wt)):n.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(Wt)));return e.contentDidChange({data:f,inputType:"insertText"}),e.silenceNotifications=v,!0}};function qf(e,r,n,a){var u;let f,v=[];if(typeof r!="string"||a.format==="math-json"){const A=window.MathfieldElement.computeEngine;if(!A)return["math-json",[]];[f,r]=["latex",A.box(r).latex],v=Us(r,{context:e.mathfield.context})}else typeof r=="string"&&a.format==="ascii-math"?([f,r]=w0(r,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),v=Us(r,{context:e.mathfield.context}),f!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Fh(v)):(a.format==="auto"||(u=a.format)!=null&&u.startsWith("latex"))&&(a.format==="auto"&&([f,r]=w0(r,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),a.format==="latex"&&([,r]=Po(r)),v=Us(r,{context:e.mathfield.context,args:n}),a.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Fh(v));return uu(v,a.style),[f!=null?f:"latex",v]}function hm(e){if(!e||(console.assert(e[0].type==="first"),e.length>1))return null;const r=e[0];return r instanceof Zn&&r.leftDelim==="("&&r.rightDelim===")"?r.removeBranch("body"):null}function Fh(e){if(e){for(let r=0;e[r];r++){const n=e[r];if(n instanceof Zn&&n.leftDelim==="("){let a=0,u=0,f=0;for(let v=0;n.body[v];v++)n.body[v].type==="genfrac"&&(a++,u=v),f++;f===0&&a===1&&(e[r]=n.body[u])}}for(const r of e){for(const n of r.branches)if(!r.hasEmptyBranch(n)){Fh(r.branch(n));const a=hm(r.branch(n));a&&r.setChildren(a,n)}if(r instanceof an)for(const n of r.cells)Fh(n)}}}function dm(e){let r=e.at(e.position);if(r.mode==="text"){for(;!r.isFirstSibling&&r.mode==="text";)r=r.leftSibling;return e.offsetOf(r)}const n=r;let a=!1;if(r.type==="mclose"){const u=$u[r.value];for(;!r.isFirstSibling&&!(r.type==="mopen"&&r.value===u);)r=r.leftSibling;r.isFirstSibling||(r=r.leftSibling),a=!0}else r.type==="leftright"&&(r=r.leftSibling,a=!0);if(a)for(;!r.isFirstSibling&&(r.isFunction||Zf(r));)r=r.leftSibling;else{const u=[];for(;!r.isFirstSibling&&(Zf(r)||u.length>0);)r.type==="mclose"&&u.unshift(r.value),r.type==="mopen"&&u.length>0&&r.value===$u[u[0]]&&u.shift(),r=r.leftSibling}return n===r?-1:e.offsetOf(r)}function Zf(e){return e.isDigit()?!0:e.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type)?!e.isExtensibleSymbol:!1}new cm;var fm=class extends Rn{constructor(){super("text")}onPaste(e,r){if(!r)return!1;const n=typeof r=="string"?r:r.getData("text/plain");return n&&e.model.contentWillChange({inputType:"insertFromPaste",data:n})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,n)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),ns(e)),e.startRecording(),!0):!1}insert(e,r,n={}){if(!e.contentWillChange({data:r,inputType:"insertText"}))return!1;n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder"),n.format||(n.format="auto");const{silenceNotifications:a}=e;n.silenceNotifications&&(e.silenceNotifications=!0);const u=e.silenceNotifications;e.silenceNotifications=!0,n.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Ds(e.selection)):n.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):n.insertionMode==="insertBefore"?e.collapseSelection("backward"):n.insertionMode==="insertAfter"&&e.collapseSelection("forward");const f=pm(r,e.mathfield.context);if(uu(f,n.style),!f)return!1;const v=e.at(e.position),A=v.parent.addChildrenAfter(f,v);return e.silenceNotifications=u,n.selectionMode==="before"||(n.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(A)):A&&(e.position=e.offsetOf(A))),e.contentDidChange({data:r,inputType:"insertText"}),e.silenceNotifications=a,!0}};function pm(e,r){return e=e.replace(/\\/g,"\\textbackslash "),e=e.replace(/#/g,"\\#"),e=e.replace(/\$/g,"\\$"),e=e.replace(/%/g,"\\%"),e=e.replace(/&/g,"\\&"),e=e.replace(/_/g,"\\_"),e=e.replace(/{/g,"\\textbraceleft "),e=e.replace(/}/g,"\\textbraceright "),e=e.replace(/lbrace/g,"\\textbraceleft "),e=e.replace(/rbrace/g,"\\textbraceright "),e=e.replace(/\^/g,"\\textasciicircum "),e=e.replace(/~/g,"\\textasciitilde "),e=e.replace(/£/g,"\\textsterling "),Us(e,{context:r,parseMode:"text"})}new fm;function Vo(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var Nn=4,ga=20,bs=2*(ga+Nn),Nh=(e,r)=>`
<line x1="${e+ga}" y1="${r+ga}"
x2="${e>r?e+ga:7*ga+10*Nn}"
y2="${e<r?r+ga:7*ga+10*Nn}"/>
<svg id="plus" viewBox="0 0 40 40" x="${e}" y="${r}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,Yf=(e,r)=>`
<line x1="${e+ga}" y1="${r+ga}"
x2="${e>r?e+ga:7*ga+10*Nn}"
y2="${e<r?r+ga:7*ga+10*Nn}"/>
<svg id="minus" viewBox="0 0 40 40" x="${e}" y="${r}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
</svg>`,$h=(e,r,n)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${r}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${n})" transform-origin="20 20">
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
</g>
</svg>`,mm=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*ga+10*Nn+5} ${8*ga+10*Nn+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${bs+Nn}"
height="${3*bs}"
width="${bs}"
rx="${bs/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${bs+Nn}"
y="0"
height="${bs}"
width="${3*bs}"
rx="${bs/2}"/>
<g data-command='"moveDown"'>
${$h(2*(Nn+bs),2*Nn+3*bs,0)}
</g>
<g data-command='"moveUp"'>
${$h(2*(Nn+bs),2*Nn+bs,180)}
</g>
<g data-command='"moveToNextWord"'>
${$h(2*Nn+3*bs,2*(Nn+bs),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${$h(2*Nn+bs,2*(Nn+bs),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Nh(2*Nn+bs,Nn)}
</g>
<g data-command='"removeColumn"'>
${Yf(2*Nn+2*bs,Nn)}
</g>
<g data-command='"addColumnAfter"'>
${Nh(2*Nn+3*bs,Nn)}
</g>
<g data-command='"addRowBefore"'>
${Nh(Nn,2*Nn+bs)}
</g>
<g data-command='"removeRow"'>
${Yf(Nn,2*Nn+2*bs)}
</g>
<g data-command='"addRowAfter"'>
${Nh(Nn,2*Nn+3*bs)}
</g>
</svg>`,gm=e=>`
<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","matrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,vm=e=>`
<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","pmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,Xf=e=>`
<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","Bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,ym=e=>`
<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4h-3v16h3"/>
<path class="cls-2" d="m22,4h3v16h-3"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,bm=e=>`
<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,_m=e=>`
<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
data-command='["setEnvironment","Vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,xm=e=>`
<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","cases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<circle cx="13" cy="8" r="1"/>
<circle cx="13" cy="16" r="1"/>
<circle cx="21" cy="8" r="1"/>
<circle cx="21" cy="16" r="1"/>
</svg>`,wm=e=>`
<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","rcases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
<circle cx="15" cy="8" r="1"/>
<circle cx="15" cy="16" r="1"/>
<circle cx="7" cy="8" r="1"/>
<circle cx="7" cy="16" r="1"/>
</svg>`,Yd={matrix:gm,pmatrix:vm,bmatrix:ym,Bmatrix:Xf,vmatrix:bm,Vmatrix:_m},Xd={cases:xm,rcases:wm,Bmatrix:Xf};function Sm(e){var r,n;const a=(r=e.model.parentEnvironment)==null?void 0:r.array;if(!a)return;let u=0;a.forEach(ze=>{(!u||ze.length>u)&&(u=ze.length)});let f=document.getElementById("mathlive-environment-popover");f||(f=Uo("mathlive-environment-popover"),fo("environment-popover"),fo("core"),f.setAttribute("aria-hidden","true"));let v;const A=f.querySelector(".MLEP__environment-controls");A?v=A:(v=document.createElement("div"),f.innerHTML="",f.appendChild(v)),v.className="MLEP__environment-controls",v.style.display="flex",v.style.width="100%",v.style.height="100%",v.style.boxSizing="border-box",v.innerHTML=mm;let C=[],P="";const z=e.model.parentEnvironment.environmentName;if(hc(z)){const ze=Am(z);P=Yd[ze]("active");const St=Yd,{[ze]:sr}=St,xt=j(St,[be(ze)]);C=Object.values(xt).map(Wt=>Wt("inactive"))}else if(Sd(z)){const ze=km(z);P=Xd[ze]("active");const St=Xd,{[ze]:sr}=St,xt=j(St,[be(ze)]);C=Object.values(xt).map(Wt=>Wt("inactive"))}else dc(z)&&(P=Yd.matrix("active"),C=Object.values(Xd).map(ze=>ze("inactive")));const Q=document.createElement("div");Q.className="MLEP__environment-delimiter-controls",Q.style.display="flex",Q.style.flexDirection="column",Q.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${P}
${C.join("")}
</div>`,P&&v.appendChild(Q),v.querySelectorAll("[data-command]").forEach(ze=>{const St=ze.dataset.command;let sr=St;try{sr=JSON.parse(St)}catch(xt){}ze.addEventListener("mousedown",xt=>xt.preventDefault()),sr&&ze.addEventListener("click",()=>e.executeCommand(sr))});const Ie=(n=e.field)==null?void 0:n.getBoundingClientRect();Ie&&(f.style.top=`${window.scrollY+(Ie.top-f.clientHeight-15)}px`,f.style.left=`${Ie.left+20}px`,f.classList.add("is-visible"))}function Jd(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function Em(){document.getElementById("mathlive-environment-popover")&&(P0("mathlive-environment-popover"),Fo("environment-popover"),Fo("core"))}function zh(e){if(!e.hasFocus())return;let r=!1;if(e.model.mode==="math"){const n=e.model.parentEnvironment;if(n!=null&&n.array&&wd(n.environmentName)){const a=e.options.environmentPopoverPolicy;r=a==="auto"||a==="on"}}r?Sm(e):Jd()}function Am(e){return e.replace("*","")}function km(e){return e==="dcases"?"cases":e}function Jf(e){const r=getComputedStyle(e).direction;return r==="ltr"||r==="rtl"?r:"ltr"}function Qf(e,r,n){return r==="left"||r==="leading"&&n==="ltr"||r==="trailing"&&n==="rtl"?e.left:e.right}function Qd(e,r,n,a){return n==="middle"?e-r/2:n==="start"&&a==="rtl"||n==="end"&&a==="ltr"||n==="top"||n==="right"?Math.max(0,e-r):e}function Tm(e,r,n,a){return n==="middle"?e-r/2:n==="start"&&a==="ltr"||n==="end"&&a==="rtl"||n==="top"||n==="right"?e:e-r}function Cm(e,r){var n,a,u;const f=(n=Jf(e))!=null?n:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";const v=e.getBoundingClientRect(),A=Number.isFinite(r.maxHeight)?Math.min(r.maxHeight,window.innerHeight):window.innerHeight;let C=Math.min(A,(a=r.height)!=null?a:v.height),P=Qd(r.location.y,C,r.verticalPos,f);P+C>window.innerHeight-8&&(r.alternateLocation?(P=Qd(r.alternateLocation.y,C,r.verticalPos,f),P+C>window.innerHeight-8&&(P=void 0)):P=void 0),Number.isFinite(P)||(P=Math.max(8,window.innerHeight-8-C),8+C>window.innerHeight-8&&(e.style.bottom="8px")),C=Math.min(P+C,window.innerHeight-8)-P;const z=Number.isFinite(r.maxWidth)?Math.min(r.maxWidth,window.innerWidth):window.innerWidth;let Q=Math.min(z,(u=r.width)!=null?u:v.width),_e=Qd(r.location.x,Q,r.horizontalPos,f);_e+Q>window.innerWidth-8&&(r.alternateLocation?(_e=Tm(r.alternateLocation.x,Q,r.verticalPos,f),_e+Q>window.innerWidth-8&&(_e=void 0)):_e=void 0),Number.isFinite(_e)||(_e=Math.max(8,window.innerWidth-8-Q),8+Q>window.innerWidth-8&&(e.style.right="8px")),Q=Math.min(_e+Q,window.innerWidth-8)-_e,f==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-_e-Q).toString()}px`:e.style.left=`${Math.ceil(_e).toString()}px`,e.style.top=`${Math.ceil(P).toString()}px`,C!==v.height&&(e.style.height=`${Math.ceil(C).toString()}px`),Q!==v.width&&(e.style.width=`${Math.ceil(Q).toString()}px`)}function Dm(e,r){return Math.hypot(r.x-e.x,r.y-e.y)}function U0(e){return"submenu"in e}function Wo(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function ef(e){return"type"in e&&e.type==="divider"}function tf(e){return"type"in e&&e.type==="heading"}var ep={};function rf(e){let r=ep[e];if(!r){let n;switch(e){case"checkmark":n=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
</span>`;break;case"trailing-chevron":n='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":n='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(n){const a=document.createElement("template");a.innerHTML=n,ep[e]=a,r=a}}if(r){if("content"in r)return r.content.cloneNode(!0);const n=document.createElement("svg");return n.innerHTML=r.innerHTML,n}}var tp=80,rp=class{constructor(e,r){this._element=null;var n;this.parentMenu=r,this._declaration=e,U0(e)?(this.type="submenu",this.submenu=new ip(e.submenu,{parentMenu:r,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(n=e.type)!=null?n:"command",this.hasCheck=Wo(e)&&e.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,r;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(r=this._element)==null||r.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return(e=this._label)!=null?e:""}set label(e){e===void 0&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,r;return(r=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?r:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var r,n,a;const u=this._declaration;if(ef(u)){this.enabled=!1,this.checked=!1;return}tf(u)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Wo(u)&&(this.checked=Wo(u)&&((r=K0(u.checked,e))!=null?r:!1)),(Wo(u)||U0(u))&&(this.enabled=(n=K0(u.enabled,e))!=null?n:!0,this.visible=(a=K0(u.visible,e))!=null?a:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(Wo(u)||tf(u)||U0(u))&&(this.label=K0(u.label,e),this.tooltip=K0(u.tooltip,e),this.ariaLabel=K0(u.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){console.assert(e===!0),e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),this.checked===!0?(e.setAttribute("aria-checked","true"),e.append(rf("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(rf("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const r=document.createElement("span");if(r.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&r.classList.add("heading"),r.innerHTML=this.label,e.append(r),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),Wo(this._declaration)&&this._declaration.keyboardShortcut){const n=document.createElement("kbd");n.innerHTML=br(this._declaration.keyboardShortcut),e.append(n)}this.type==="submenu"&&e.append(rf("trailing-chevron"))}get element(){if(this._element)return this._element;if(ef(this._declaration)){const n=document.createElement("li");return n.setAttribute("part","menu-divider"),n.setAttribute("role","divider"),this._element=n,n}const e=document.createElement("li");this._element=e,(Wo(this._declaration)||tf(this._declaration)||U0(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.type==="submenu"&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const r=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:r}),e.addEventListener("pointerleave",this,{signal:r}),e.addEventListener("pointerup",this,{signal:r}),e.addEventListener("click",this,{signal:r}),this._element}dispatchSelect(){if(!Wo(this._declaration))return;const e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var r;if(!(!this.visible||!this.enabled)){if(e.type==="click"){this.rootMenu.state==="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}if(e.type==="pointerenter"){const n=e;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((r=this.parentMenu.activeMenuItem)!=null&&r.movingTowardSubmenu(n))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(e.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(e.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},tp)},tp)}openSubmenu(e){var r;if(this.type!=="submenu"||!this.element)return;if((r=e==null?void 0:e.withDelay)!=null&&r){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const n=this.element.getBoundingClientRect(),a=Jf(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Qf(n,"trailing",a),y:n.top-4},alternateLocation:{x:Qf(n,"leading",a),y:n.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;const r=this.rootMenu.lastMoveEvent;if(!r)return!1;const n=e.timeStamp-r.timeStamp;if(n>500)return!1;const a=e.clientX-r.clientX;if(Mm(a,r.clientY-e.clientY,n)<=.2)return!1;let f="right";if(this.submenu.element){const v=this.submenu.element.getBoundingClientRect(),A=this.element.getBoundingClientRect();v.left<A.left+A.width/2&&(f="left")}return f==="right"?a>0:a<0}};function Mm(e,r,n){return Math.hypot(e,r)/n}function K0(e,r){return e===void 0||typeof e!="function"?e:(r!=null||(r={alt:!1,control:!1,shift:!1,meta:!1}),e(r))}var ip=class Y0{constructor(r,n){this._element=null,this._activeMenuItem=null,this._dirty=!0;var a,u;this.parentMenu=(a=n==null?void 0:n.parentMenu)!=null?a:null,this._submenuClass=n==null?void 0:n.submenuClass,this.columnCount=(u=n==null?void 0:n.columnCount)!=null?u:1,this.isSubmenuOpen=!1,this.menuItems=r}get children(){return this._menuItems}set menuItems(r){const n=this.parentMenu;this.dispose(),this.parentMenu=n,r=[...r],this._menuItems=r.map(a=>a.onCreate?a.onCreate(a,this):new rp(a,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var r;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(r=this._menuItems)==null||r.forEach(n=>n.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(r){if(r.type==="wheel"&&this._element){const n=r;this._element.scrollBy(0,n.deltaY),r.stopPropagation()}}dispatchEvent(r){return this.rootMenu.dispatchEvent(r)}get rootMenu(){return this.parentMenu.rootMenu}updateState(r){var n,a,u;this._menuItems.forEach(P=>P.updateState(r));const f=this.hasCheck;this.hasCheck=this._menuItems.some(P=>P.visible&&P.hasCheck),this.hasCheck!==f&&this._menuItems.forEach(P=>P.updateState(r));let v,A=0;for(const P of this._menuItems)P.type==="heading"?(v&&A===0&&(v.visible=!1),v=P,A=0):P.type==="divider"&&v?(v.visible=A>0,v=void 0,A=0):v&&P.visible&&(A+=1);v&&(v.visible=A>0);let C=!0;for(const P of this._menuItems)P.type==="divider"?(P.visible=!C,C=!0):P.visible&&(C=!1);(n=this.activeMenuItem)!=null&&n.visible||(this.activeMenuItem=null),!((a=this.activeMenuItem)!=null&&a.enabled)&&((u=this.activeMenuItem)==null?void 0:u.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(r=>r.type!=="divider"&&r.visible&&r.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(r=>r.type!=="divider"&&r.visible)}set dirty(r){console.assert(r===!0),this._dirty!==r&&r&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var r;if(this._element){this._element.textContent="";for(const{element:n,visible:a}of this._menuItems)n&&a&&this._element.append(n);(r=this._element.querySelector("li:first-of-type"))==null||r.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const r=document.createElement("menu");r.setAttribute("role","menu"),r.setAttribute("tabindex","-1"),r.setAttribute("aria-orientation","vertical"),r.setAttribute("part","ui-menu-container"),this._submenuClass&&r.classList.add(this._submenuClass),r.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const n=this._abortController.signal;return r.addEventListener("focus",this,{signal:n}),r.addEventListener("wheel",this,{passive:!0,signal:n}),this._element=r,this.updateElement(),r}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(r){var n,a,u,f;if(this.rootMenu.cancelDelayedOperation(),r!==this._activeMenuItem){if(this.activeMenuItem){const v=this.activeMenuItem;v.active=!1,(n=v.submenu)==null||n.hide()}if(!((a=r==null?void 0:r.visible)==null||a)){this._activeMenuItem=null;return}this._activeMenuItem=r,r&&(r.active=!0)}r?(u=r.element)==null||u.focus({preventScroll:!0}):(f=this._element)==null||f.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let r=0,n=!1;const a=this._menuItems;for(;!n&&r<=a.length-1;){const u=a[r];n=u.type!=="divider"&&u.visible&&u.enabled,r+=1}return n?a[r-1]:null}get lastMenuItem(){this.updateIfDirty();const r=this._menuItems;let n=r.length-1,a=!1;for(;!a&&n>=0;){const u=r[n];a=u.type!=="divider"&&u.visible&&u.enabled,n-=1}return a?r[n+1]:null}nextMenuItem(r){if(r===0)return this._activeMenuItem;if(!this._activeMenuItem)return r>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const n=this._menuItems.indexOf(this.firstMenuItem),a=this._menuItems.indexOf(this.lastMenuItem);let u=this._menuItems.indexOf(this._activeMenuItem),f=1;for(;u>=n&&u<=a;){u+=r>0?1:-1;const v=this._menuItems[u];if(!v)break;if(v.visible&&v.enabled){if(f===Math.abs(r))return this._menuItems[u];f+=1}}return r>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(r){this.updateIfDirty();const a=this._menuItems.filter(u=>u.visible&&u.enabled).indexOf(r);return a<0?-1:a%this.columnCount}static get collator(){return Y0._collator||(Y0._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Y0._collator}findMenuItem(r){var n;this.updateIfDirty();const a=this._menuItems.filter(A=>A.type!=="divider"&&A.visible&&A.enabled);if(a.length===0)return null;const u=Math.max(...a.map(A=>A.label.length))-r.length;if(u<0)return null;let f=null,v=0;for(;v<u&&!f;)f=(n=a.find(A=>Y0.collator.compare(r,A.label.substring(v,r.length))===0))!=null?n:null,v++;return f}show(r){return!this.visible||!r.container?!1:(this.updateElement(),r.container.appendChild(this.element),q()&&(this.element.popover="manual",this.element.showPopover()),r.location&&Cm(this.element,{location:r.location,alternateLocation:r.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var r,n,a,u,f;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),q()&&((r=this._element)!=null&&r.popover)&&this.element.hidePopover(),(a=(n=this.parentMenu)==null?void 0:n.element)==null||a.focus(),(f=(u=this._element)==null?void 0:u.parentNode)==null||f.removeChild(this._element)}set openSubmenu(r){var n,a,u,f;const v=r!==null;((n=this.activeMenuItem)==null?void 0:n.type)==="submenu"&&((a=this.activeMenuItem.element)==null||a.setAttribute("aria-expanded",v.toString())),(f=(u=this.activeMenuItem)==null?void 0:u.element)==null||f.classList.toggle("is-submenu-open",v),this.isSubmenuOpen=v}},np=class a1 extends ip{constructor(r,n){var a;super(r),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(a=n==null?void 0:n.host)!=null?a:null,this.isDynamic=r.some(sp),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(r){Zi(this._modifiers,r)||(this._modifiers=r,this.dirty=!0)}get activeSubmenu(){let r=this;for(;r.isSubmenuOpen;)r=r.activeMenuItem.submenu;return r}set dirty(r){this._updating||(console.assert(r===!0),this._dirty!==r&&(this._dirty=!0,r&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(r){this._updating=!0,this.modifiers=r!=null?r:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(r){this.isDynamic&&(this.modifiers=yi(r)),r.stopImmediatePropagation()}handleKeydownEvent(r){var n,a,u;if(r.key==="Tab"||r.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=yi(r));let f=!0;const v=this.activeSubmenu,A=v.activeMenuItem;switch(r.key){case" ":case"Space":case"Return":case"Enter":A==null||A.select(yi(r));break;case"ArrowRight":if((A==null?void 0:A.type)==="submenu")A.select(yi(r)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!A)v.activeMenuItem=v.firstMenuItem;else{const C=(n=v.getMenuItemColumn(A))!=null?n:-1;if(C>=0&&C<((a=v.columnCount)!=null?a:1)-1){const P=v.nextMenuItem(1);P&&(v.activeMenuItem=P)}}break;case"ArrowLeft":if(v===this.rootMenu)A||(v.activeMenuItem=v.firstMenuItem);else if((A&&(u=v.getMenuItemColumn(A))!=null?u:-1)<=0||!A){v.hide();const P=v.parentMenu.activeMenuItem;if(P){const{element:z}=P;z==null||z.focus(),z==null||z.classList.remove("is-submenu-open")}}else{const P=v.nextMenuItem(-1);P&&(v.activeMenuItem=P)}break;case"ArrowDown":v.activeMenuItem=v.nextMenuItem(v.columnCount);break;case"ArrowUp":v.activeMenuItem=v.nextMenuItem(-v.columnCount);break;case"Home":case"PageUp":v.activeMenuItem=v.firstMenuItem;break;case"End":case"PageDown":v.activeMenuItem=v.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const C=v.findMenuItem(this.typingBuffer);C&&(v.activeMenuItem=C),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(fn(r)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=r.key;const C=v.findMenuItem(this.typingBuffer);C&&(v.activeMenuItem=C),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else f=!1}f&&(r.preventDefault(),r.stopPropagation())}handleEvent(r){if(r.type==="keydown")this.handleKeydownEvent(r);else if(r.type==="keyup")this.handleKeyupEvent(r);else if(r.type==="pointermove")this.lastMoveEvent=r;else if(r.type==="pointerup"&&r.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(r.type==="contextmenu"){r.preventDefault(),r.stopPropagation();return}super.handleEvent(r)}dispatchEvent(r){return this._host?this._host.dispatchEvent(r):!0}get scrim(){return es.element}connectScrim(r){const n=this.scrim;n.addEventListener("pointerup",this),n.addEventListener("contextmenu",this),n.addEventListener("keydown",this),n.addEventListener("keyup",this),n.addEventListener("pointermove",this),es.open({root:r,onDismiss:()=>this.hide()})}disconnectScrim(){const r=this.scrim;r.removeEventListener("pointerup",this),r.removeEventListener("contextmenu",this),r.removeEventListener("keydown",this),r.removeEventListener("keyup",this),r.removeEventListener("pointermove",this),es.state==="open"&&es.scrim.close()}get rootMenu(){return this}show(r){return this._onDismiss=r==null?void 0:r.onDismiss,r!=null&&r.modifiers&&(this.modifiers=r.modifiers),this.updateState(),this.connectScrim(r==null?void 0:r.target),super.show(d($({},r),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,es.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(r){this.cancelDelayedOperation();const n=a1.SUBMENU_DELAY;if(n<=0){r();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,r()},n)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};np.SUBMENU_DELAY=120;var Lm=np;function sp(e){return ef(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(Wo(e)||U0(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||Wo(e)&&typeof e.checked=="function"?!0:U0(e)?e.submenu.some(sp):!1}var Uh=class{};Uh.DELAY=300,Uh.MAX_DISTANCE=10;function Rm(e){return new Promise((r,n)=>{const a=Ci(e);a||r(!1);let u=a;const f=setTimeout(()=>{v.abort(),r(Dm(u,a)<Uh.MAX_DISTANCE)},Uh.DELAY),v=new AbortController,A=v.signal;for(const C of["pointermove","pointerup","pointercancel"])window.addEventListener(C,P=>{if(P.type==="pointerup"||P.type==="pointercancel")clearTimeout(f),v.abort(),r(!1);else if(P.type==="pointermove"){const z=Ci(P);z&&(u=z)}},{passive:!0,signal:A})})}function ap(e,r,n){return du(this,null,function*(){if(e.type==="contextmenu"){const a=e;if(n.show({target:r,location:Ci(a),modifiers:yi(a)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){const a=e;if(a.code==="ContextMenu"||a.code==="F10"&&a.shiftKey){const u=r==null?void 0:r.getBoundingClientRect();if(u&&n.show({target:r,location:{x:Math.ceil(u.left+u.width/2),y:Math.ceil(u.top+u.height/2)},modifiers:yi(a)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let a=e.target;for(;a&&r!==a;)a=a.parentNode;if(!a||!n.visible)return!1;const u=Ci(e);if(yield Rm(e))return n.state!=="closed"?!1:(n.show({target:r,location:u}),!0)}return!1})}var op={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};Ue(Object.keys(op),"{body:auto}",{createAtom:e=>new eu(d($({},e),{body:Xe(e.args[0]),accentChar:op[e.command.slice(1)]}))}),Ue(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const r=Ht(Xe(e.args[0]));return new eu(d($({},e),{body:Xe(e.args[0]),svgAccent:e.command.slice(1)+(r.length>5?"4":["1","1","2","2","3","3"][r.length])}))}}),Ue(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new eu(d($({},e),{body:Xe(e.args[0]),svgAccent:"overarc"}))}),Ue(["underarc","underparen"],"{body:auto}",{createAtom:e=>new Aa(d($({},e),{body:Xe(e.args[0]),svgBelow:"underarc"}))}),Ue("utilde","{body:auto}",{createAtom:e=>{const r=Xe(e.args[0]),n=Ht(r),a="widetilde"+(n.length>5?"4":["1","1","2","2","3","3"][n.length]);return new Aa(d($({},e),{body:r,svgBelow:a,boxType:Zl(r)}))}}),Ue("^","{:string}",{createAtom:e=>{var r;return new $t(d($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[e.args[0]])!=null?r:"^"}))}}),Ue("`","{:string}",{createAtom:e=>{var r;return new $t(d($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[e.args[0]])!=null?r:"`"}))}}),Ue("'","{:string}",{createAtom:e=>{var r;return new $t(d($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[e.args[0]])!=null?r:"'"}))}}),Ue('"',"{:string}",{createAtom:e=>{var r,n;return new $t(d($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(r=e.args)!=null&&r[0]?(n={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[e.args[0]])!=null?n:'"'+e.args[0]:'"'}))}}),Ue(".","{:string}",{createAtom:e=>{var r,n;return new $t(d($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(r=e.args)!=null&&r[0]?(n={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[e.args[0]])!=null?n:"."+e.args[0]:"."}))}}),Ue("=","{:string}",{createAtom:e=>{var r,n;return new $t(d($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(r=e.args)!=null&&r[0]?(n={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[e.args[0]])!=null?n:"="+e.args[0]:"="}))}}),Ue("~","{:string}",{createAtom:e=>{var r;return new $t(d($({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[e.args[0]])!=null?r:"\xB4"}))}}),Ue("c","{:string}",{createAtom:e=>{var r;return new $t(d($({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(r={c:"\xE7",C:"\xC7"}[e.args[0]])!=null?r:""}))}}),Ue("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var r,n;const a=e.args,u={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(r=e.style)!=null?r:{}};if(a[1]){const v=a[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const A of v){const C=A.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(C)u.strokeWidth=C[1],u.strokeStyle=C[2],u.strokeColor=C[3];else{const P=A.match(/\s*([a-z]*)\s*=\s*"(.*)"/);P&&(P[1]==="mathbackground"?u.backgroundcolor=P[2]:P[1]==="mathcolor"?u.strokeColor=P[2]:P[1]==="padding"?u.padding=P[2]:P[1]==="shadow"&&(u.shadow=P[2]))}}u.strokeStyle==="dashed"?u.svgStrokeStyle="5,5":u.strokeStyle==="dotted"&&(u.svgStrokeStyle="1,5")}u.borderStyle=`${u.strokeWidth} ${u.strokeStyle} ${u.strokeColor}`;const f={};return((n=a[0])!=null?n:"").split(/[, ]/).filter(v=>v.length>0).forEach(v=>{f[v.toLowerCase()]=!0}),new Ku(e.command,Xe(a[2]),f,u)}}),Ue("cancel","{body:auto}",{createAtom:e=>{var r;return new Ku(e.command,Xe(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(r=e.style)!=null?r:{}})}}),Ue("bcancel","{body:auto}",{createAtom:e=>{var r;return new Ku(e.command,Xe(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(r=e.style)!=null?r:{}})}}),Ue("xcancel","{body:auto}",{createAtom:e=>{var r;return new Ku(e.command,Xe(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(r=e.style)!=null?r:{}})}}),Ue(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var r;return new Aa(d($({},e),{body:Xe((r=e.args)==null?void 0:r[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),Ue("overbrace","{:auto}",{createAtom:e=>new Aa(d($({},e),{body:Xe(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),Ue(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new Aa(d($({},e),{body:Xe(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),Ue(["underbrace"],"{:auto}",{createAtom:e=>new Aa(d($({},e),{body:Xe(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),Ue(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:e=>{var r,n,a,u,f;return new Aa(d($({},e),{svgBody:e.command.slice(1),above:((n=Xe((r=e.args)==null?void 0:r[1]))==null?void 0:n.length)===0?void 0:Xe((a=e.args)==null?void 0:a[1]),below:(f=Xe((u=e.args)==null?void 0:u[0]))!=null?f:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,r)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(r)}]`)+`{${e.aboveToLatex(r)}}${e.supsubToLatex(r)}`}),Ue(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:e=>new No(e.command.slice(1),d($({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Ue(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new No({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],d($({},e),{limits:"over-under",variant:"main"}))}),Ue(["lim","mod"],"",{ifMode:"math",createAtom:e=>new No(e.command.slice(1),d($({},e),{limits:"over-under",variant:"main"}))}),Ue(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new No(e.command.slice(1),d($({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),Ue(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new $t(d($({},e),{body:Xe(e.args[0])})),serialize:(e,r)=>`\\ang{${e.bodyToLatex(r)}}`,render:(e,r)=>{const n=e.createBox(r),a=n.caret;n.caret=void 0;const u=new ur("\xB0",{style:d($({},e.style),{variant:"normal",variantStyle:"up"})});return new ur([n,u],{type:"inner",isSelected:e.isSelected,caret:a})}}),Ue("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new L0(d($({},e),{body:Xe(e.args[1]),index:e.args[0]?Xe(e.args[0]):void 0}))}),Ue(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const r=$({},e),n=e.command,a=e.args;switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":r.hasBarLine=!0;break;case"\\atopfrac":r.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":r.hasBarLine=!1,r.leftDelim="(",r.rightDelim=")";break;case"\\cfrac":r.hasBarLine=!0,r.continuousFraction=!0;break;default:}switch(n){case"\\dfrac":case"\\dbinom":r.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":r.mathstyleName="textstyle";break;default:}return new nu(a[0]?Xe(a[0]):[new mo],a[1]?Xe(a[1]):[new mo],r)},serialize:(e,r)=>{const n=e.aboveToLatex(r),a=e.belowToLatex(r);return/^[0-9]$/.test(n)&&/^[0-9]$/.test(a)?`${e.command}${n}${a}`:Kn(e.command,n,a)}}),Ue(["brace","brack"],"",{infix:!0,createAtom:e=>new nu(Xe(e.args[0]),Xe(e.args[1]),d($({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,r)=>Xi([e.aboveToLatex(r),e.command,e.belowToLatex(r)])}),Ue(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let r,n;const a=e.args;return e.command==="\\choose"&&(r="(",n=")"),new nu(Xe(a[0]),Xe(a[1]),d($({},e),{hasBarLine:e.command==="\\over",leftDelim:r,rightDelim:n}))},serialize:(e,r)=>Xi([e.aboveToLatex(r),e.command,e.belowToLatex(r)])}),Ue(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var r,n;const a=e.args;return new nu(Xe(a[0]),Xe(a[1]),d($({},e),{leftDelim:(r=a[2])!=null?r:".",rightDelim:(n=a[3])!=null?n:".",hasBarLine:!1}))},serialize:(e,r)=>`${e.aboveToLatex(r)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(r)}`}),Ue("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new nu(Xe(e.args[0]),Xe(e.args[1]),d($({},e),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Ue(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new yc({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[e.command.slice(1)],d($({},e),{limits:"auto",variant:"main"}))}),Ue("smallint","",{ifMode:"math",createAtom:e=>new No("\u222B",d($({},e),{limits:"adjacent",variant:"main"}))});var lp={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};Ue(Object.keys(lp),"",{ifMode:"math",createAtom:e=>{const r=e.command,n=lp[r.slice(1)];return new yc(n,d($({},e),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[n]}))}}),Ue(["Re","Im"],"",{ifMode:"math",createAtom:e=>new No({"\\Re":"\u211C","\\Im":"\u2111"}[e.command],d($({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Ue("middle","{:delim}",{ifMode:"math",createAtom:e=>{var r;return new fh(d($({},e),{delim:(r=e.args[0])!=null?r:"|",size:1}))}}),Ue("the","{:value}",{createAtom:e=>new $t(d($({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,r)=>{var n;const a=new qi({parent:r},e.style);let u="";e.isSelected&&(u+=" ML__selected");const f=a.evaluate(e.args[0]);return new ur(((n=Cs(f))!=null?n:"").split("").map(v=>new ur(v,{type:"ord",classes:u,mode:e.mode,isSelected:e.isSelected,style:$({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:u}).wrap(a)},serialize:e=>{var r;return`\\the${(r=Cs(e.args[0]))!=null?r:"\\relax"}`}}),Ue("mathtip","{:auto}{:math}",{createAtom:e=>new R0(d($({},e),{body:Xe(e.args[0]),tooltip:Xe(e.args[1]),content:"math"})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`\\texttip{${e.bodyToLatex(r)}}{${$t.serialize([e.tooltip],d($({},r),{defaultMode:"math"}))}}`}),Ue("texttip","{:auto}{:text}",{createAtom:e=>new R0(d($({},e),{body:Xe(e.args[0]),tooltip:Xe(e.args[1]),content:"text"})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`\\texttip{${e.bodyToLatex(r)}}{${$t.serialize([e.tooltip],d($({},r),{defaultMode:"text"}))}}`}),Ue("error","{:math}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[0])})),serialize:(e,r)=>`\\error{${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__error"})}),Ue("ensuremath","{:math}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[0])})),serialize:(e,r)=>`${e.command}{${e.bodyToLatex(d($({},r),{defaultMode:"math"}))}}`}),Ue("color","{:value}",{applyStyle:(e,r,n)=>{var a,u;return{verbatimColor:(a=Cs(r[0]))!=null?a:void 0,color:n.toColor((u=r[0])!=null?u:{string:"red"})}}}),Ue("textcolor","{:value}{content:auto*}",{applyStyle:(e,r,n)=>{var a,u;return{verbatimColor:(a=Cs(r[0]))!=null?a:void 0,color:n.toColor((u=r[0])!=null?u:{string:"red"})}}}),Ue("boxed","{content:math}",{createAtom:e=>new Za(d($({},e),{body:Xe(e.args[0]),framecolor:{string:"black"}}))}),Ue("colorbox","{:value}{:text*}",{applyStyle:(e,r,n)=>{var a,u;return{verbatimBackgroundColor:(a=Cs(r[0]))!=null?a:void 0,backgroundColor:n.toBackgroundColor((u=r[0])!=null?u:{string:"yellow"})}}}),Ue("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var r,n;return new Za(d($({},e),{body:Xe(e.args[2]),framecolor:(r=e.args[0])!=null?r:{string:"blue"},backgroundcolor:(n=e.args[1])!=null?n:{string:"yellow"}}))},serialize:(e,r)=>{var n,a;return r.skipStyles?e.bodyToLatex(d($({},r),{defaultMode:"text"})):Kn(e.command,(n=Cs(e.framecolor))!=null?n:"",(a=Cs(e.backgroundcolor))!=null?a:"",e.bodyToLatex(d($({},r),{defaultMode:"text"})))}}),Ue("bbox","[:bbox]{body:auto}",{createAtom:e=>{var r;const n=e.args[0],a=Xe(e.args[1]);return n?new Za(d($({},e),{body:a,padding:n.padding,border:n.border,backgroundcolor:(r=n.backgroundcolor)!=null?r:void 0})):new Za(d($({},e),{body:a}))},serialize:(e,r)=>{var n,a;if(r.skipStyles)return e.bodyToLatex(r);let u=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){const f=[];e.padding&&f.push((n=Cs(e.padding))!=null?n:""),e.border&&f.push(`border: ${e.border}`),e.backgroundcolor&&f.push((a=Cs(e.backgroundcolor))!=null?a:""),u+=`[${f.join(",")}]`}return Kn(u,e.bodyToLatex(r))}}),Ue(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[0])})),render:(e,r)=>{const n=new qi({parent:r,mathstyle:e.command.slice(1)},e.style),a=$t.createBox(n,e.body,{type:"lift"});return e.caret&&(a.caret=e.caret),e.bind(r,a)},serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`{${Xi([e.command,e.bodyToLatex(r)])}}`}),Ue(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})}),Ue("fontseries","{:string}",{ifMode:"text",applyStyle:(e,r)=>{var n;return{fontSeries:(n=r[0])!=null?n:"auto"}}}),Ue("fontshape","{:string}",{ifMode:"text",applyStyle:(e,r)=>{var n;return{fontShape:(n=r[0])!=null?n:"auto"}}}),Ue("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,r)=>{var n;return{fontFamily:(n=r[0])!=null?n:"roman"}}}),Ue("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Ue("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Ue(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new $t(d($({},e),{body:Xe(e.args[0])})),serialize:(e,r)=>`${e.command}{${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__boldsymbol"})}),Ue("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Ue("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ue("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ue("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ue("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ue("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ue("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ue("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ue("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ue("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Ue("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ue("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Ue("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ue("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Ue("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Ue("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Ue("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Ue("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Ue("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Ue("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Ue("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Ue("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Ue("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Ue("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Ue("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Ue("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Ue("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Ue(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Ue(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Ue("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Ue("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Ue("mbox","{:text}",{ifMode:"math",createAtom:e=>new $t(d($({},e),{type:"mord",body:Xe(e.args[0]),mode:"math"})),serialize:(e,r)=>Kn("\\mbox",e.bodyToLatex(d($({},r),{defaultMode:"text"})))}),Ue("text","{:text}",{ifMode:"math",applyMode:"text"}),Ue(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[1])})),serialize:(e,r)=>!e.args[0]||r.skipStyles?e.bodyToLatex(r):`${e.command}{${e.args[0]}}{${e.bodyToLatex(r)}}`,render:(e,r)=>{var n;return e.createBox(r,{classes:(n=e.args[0])!=null?n:""})}}),Ue(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[1])})),serialize:(e,r)=>{var n;return!((n=e.args)!=null&&n[0])||r.skipStyles?e.bodyToLatex(r):`${e.command}{${e.args[0]}}{${e.bodyToLatex(r)}}`},render:(e,r)=>{var n;const a=e.createBox(r);return a.cssId=(n=e.args[0])!=null?n:"",a}}),Ue("htmlData","{data:string}{content:auto}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[1])})),serialize:(e,r)=>{var n;return!((n=e.args)!=null&&n[0])||r.skipStyles?e.bodyToLatex(r):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(r)}}`},render:(e,r)=>{var n;const a=e.createBox(r);return a.htmlData=(n=e.args[0])!=null?n:"",a}}),Ue(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[1])})),serialize:(e,r)=>{var n;return!((n=e.args)!=null&&n[0])||r.skipStyles?e.bodyToLatex(r):`${e.command}{${e.args[0]}}{${e.bodyToLatex(r)}}`},render:(e,r)=>{var n;const a=e.createBox(r);return a.htmlStyle=(n=e.args[0])!=null?n:"",a}}),Ue("em","{:rest}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[0])})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`{\\em ${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__emph",boxType:"lift"})}),Ue("emph","{:auto}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[1])})),serialize:(e,r)=>r.skipStyles?e.bodyToLatex(r):`\\emph{${e.bodyToLatex(r)}}`,render:(e,r)=>e.createBox(r,{classes:"ML__emph",boxType:"lift"})});var up={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};Ue(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var r;return new vc(d($({},e),{delim:(r=e.args[0])!=null?r:".",size:up[e.command].size,delimType:up[e.command].mclass}))}}),Ue(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var r;return new Gu(d($({},e),{width:(r=e.args[0])!=null?r:{dimension:0}}))}}),Ue(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var r;return new Gu(d($({},e),{width:(r=e.args[0])!=null?r:{dimension:0}}))}}),Ue("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new $t(e),render:(e,r)=>{let n=0;const a=r.mathstyle.id;(a===y0||a===vl)&&(n=1),(a===Xl||a===ra)&&(n=2),(a===co||a===zs)&&(n=3);const u=Xe(e.args[n]);return $t.createBox(r,u)},serialize:(e,r)=>`\\mathchoice{${$t.serialize(e.args[0],r)}}{${$t.serialize(e.args[1],r)}}{${$t.serialize(e.args[2],r)}}{${$t.serialize(e.args[3],r)}}`}),Ue("mathop","{:auto}",{createAtom:e=>new $t(d($({},e),{type:"mop",body:Xe(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,r)=>{var n;let a=$t.createBox(r,e.body);if(e.superscript||e.subscript){const u=(n=e.subsupPlacement)!=null?n:"auto";a=u==="over-under"||u==="auto"&&r.isDisplayStyle?e.attachLimits(r,{base:a}):e.attachSupsub(r,{base:a})}return new ur(e.bind(r,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,r)=>{const n=[Kn(e.command,e.bodyToLatex(r))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&n.push("\\limits"),e.subsupPlacement==="adjacent"&&n.push("\\nolimits"),e.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(e.supsubToLatex(r)),Xi(n)}}),Ue(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new $t(d($({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:Xe(e.args[0])}))}),Ue(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const r=Xe(e.args[0]).map(n=>{var a;return n.type!=="first"&&(n.type="mord",n.value=(a={"\u2217":"*","\u2212":"-"}[n.value])!=null?a:n.value,n.isFunction=!1,!n.style.variant&&!n.style.variantStyle&&(n.style.variant="main",n.style.variantStyle="up")),n});return new $t(d($({},e),{type:"mop",body:r,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,r)=>{var n;let a=$t.createBox(r,e.body);if(e.superscript||e.subscript){const u=(n=e.subsupPlacement)!=null?n:"auto";a=u==="over-under"||u==="auto"&&r.isDisplayStyle?e.attachLimits(r,{base:a}):e.attachSupsub(r,{base:a})}return e.caret&&(a.caret=e.caret),new ur(e.bind(r,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,r)=>{const n=[Kn(e.command,e.bodyToLatex(r))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&n.push("\\limits"),e.subsupPlacement==="adjacent"&&n.push("\\nolimits"),e.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(e.supsubToLatex(r)),Xi(n)}}),Ue(["char","unicode"],"{charcode:value}",{createAtom:e=>new $t(d($({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var r;return`${e.command}${Cs((r=e.args[0])!=null?r:{number:10067,base:"hexadecimal"})}`},render:(e,r)=>{let n=r.evaluate(e.args[0]);return(!n||!("number"in n))&&(n={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(n.number),e.createBox(r)}}),Ue("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new $t(e),render:(e,r)=>{var n,a,u;const f=new qi({parent:r,mathstyle:"textstyle"},e.style),v=f.toEm((n=e.args[0])!=null?n:{dimension:0}),A=f.toEm((a=e.args[1])!=null?a:{dimension:10}),C=f.toEm((u=e.args[2])!=null?u:{dimension:10}),P=new ur(null,{classes:"rule",type:"ord"});return P.width=A,P.height=C+v,P.depth=-v,P.setStyle("border-right-width",A,"em"),P.setStyle("border-top-width",C,"em"),P.setStyle("border-color",e.style.color),P.setStyle("vertical-align",v,"em"),e.isSelected&&P.setStyle("opacity","50%"),e.bind(f,P),e.caret&&(P.caret=e.caret),P.wrap(r)},serialize:e=>`\\rule${e.args[0]?`[${Cs(e.args[0])}]`:""}{${Cs(e.args[1])}}{${Cs(e.args[2])}}`}),Ue(["overline","underline"],"{:auto}",{createAtom:e=>new $t(d($({},e),{body:Xe(e.args[0])})),render:(e,r)=>{const n=e.command.substring(1),a=new qi({parent:r,mathstyle:"cramp"},e.style),u=$t.createBox(a,e.body);if(!u)return null;const f=a.metrics.defaultRuleThickness/a.scalingFactor,v=new ur(null,{classes:n+"-line"});v.height=f,v.maxFontSize=f*1.125*a.scalingFactor;let A;return n==="overline"?A=new gs({shift:0,children:[{box:u},3*f,{box:v},f]}):A=new gs({top:u.height,children:[f,{box:v},3*f,{box:u}]}),e.caret&&(A.caret=e.caret),new ur(A,{classes:n,type:"ignore"})}}),Ue("overset","{:auto}{base:auto}",{createAtom:e=>{const r=Xe(e.args[1]);return new Aa(d($({},e),{above:Xe(e.args[0]),body:r,skipBoundary:!1,boxType:Zl(r)}))},serialize:(e,r)=>Kn(e.command,e.aboveToLatex(r),e.bodyToLatex(r))}),Ue("underset","{:auto}{base:auto}",{createAtom:e=>{const r=Xe(e.args[1]);return new Aa(d($({},e),{below:Xe(e.args[0]),body:r,skipBoundary:!1,boxType:Zl(r)}))},serialize:(e,r)=>Kn(e.command,e.belowToLatex(r),e.bodyToLatex(r))}),Ue("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const r=Xe(e.args[2]);return new Aa(d($({},e),{above:Xe(e.args[0]),below:Xe(e.args[1]),body:r,skipBoundary:!1,boxType:Zl(r)}))},serialize:(e,r)=>Kn(e.command,e.belowToLatex(r),e.bodyToLatex(r))}),Ue(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new Aa(d($({},e),{body:Xe(e.args[2]),above:Xe(e.args[1]),below:Xe(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,r)=>Kn(e.command,e.aboveToLatex(r),e.bodyToLatex(r))}),Ue("smash","[:string]{:auto}",{createAtom:e=>{var r,n,a,u;return new su(d($({},e),{body:Xe(e.args[1]),smashHeight:(n=(r=e.args[0])==null?void 0:r.includes("t"))!=null?n:!0,smashDepth:(u=(a=e.args[0])==null?void 0:a.includes("b"))!=null?u:!0}))}}),Ue(["vphantom"],"{:auto}",{createAtom:e=>new su(d($({},e),{body:Xe(e.args[0]),isInvisible:!0,smashWidth:!0}))}),Ue(["hphantom"],"{:auto}",{createAtom:e=>new su(d($({},e),{body:Xe(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Ue(["phantom"],"{:auto}",{createAtom:e=>new su(d($({},e),{body:Xe(e.args[0]),isInvisible:!0}))}),Ue("not","{:math}",{createAtom:e=>{const r=Xe(e.args[0]);return r.length===0?new $t(d($({},e),{type:"mrel",value:"\uE020"})):new $t(d($({},e),{body:[new El(d($({},e),{body:"\uE020",align:"right"})),...r],captureSelection:!0}))},serialize:(e,r)=>{const n=e.args[0],a=n&&typeof n=="object"&&"group"in n;return e.value!=="\uE020"?a?`\\not{${$t.serialize(n.group,r)}}`:`\\not${$t.serialize(n,r)}`:a?"\\not{}":"\\not"},render:(e,r)=>{if(e.value)return e.createBox(r);const a=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":Zl(Xe(e.args[0])),u=$t.createBox(r,e.body,{type:a});return e.caret&&(u.caret=e.caret),e.bind(r,u)}}),Ue(["ne","neq"],"",{createAtom:e=>new $t(d($({},e),{type:"mrel",body:[new El(d($({},e),{body:"\uE020",align:"right",boxType:"rel"})),new $t(d($({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),Ue("rlap","{:auto}",{createAtom:e=>new El(d($({},e),{body:Xe(e.args[0]),align:"right"}))}),Ue("llap","{:auto}",{createAtom:e=>new El(d($({},e),{body:Xe(e.args[0]),align:"left"}))}),Ue("mathrlap","{:math}",{createAtom:e=>new El(d($({},e),{body:Xe(e.args[0]),align:"left"}))}),Ue("mathllap","{:math}",{createAtom:e=>new El(d($({},e),{body:Xe(e.args[0]),align:"left"}))}),Ue("raisebox","{:value}{:text}",{createAtom:e=>{var r;return new Za(d($({},e),{body:Xe(e.args[1]),padding:{dimension:0},offset:(r=e.args[0])!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n;return Kn("\\raisebox",(n=Cs(e.offset))!=null?n:"0pt",e.bodyToLatex(r))}}),Ue("raise","{:value}{:auto}",{createAtom:e=>{var r;return new Za(d($({},e),{body:Xe(e.args[1]),padding:{dimension:0},offset:(r=e.args[0])!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n;return Kn("\\raise",(n=Cs(e.offset))!=null?n:"0pt",e.bodyToLatex(r))}}),Ue("lower","{:value}{:auto}",{createAtom:e=>{var r;return new Za(d($({},e),{body:Xe(e.args[1]),padding:{dimension:0},offset:(r=fa(e.args[0],-1))!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n,a;return Kn("\\lower",(a=Cs(fa((n=e.offset)!=null?n:{dimension:0},-1)))!=null?a:"0pt",e.bodyToLatex(r))}}),Dt("0123456789/@.?!"),ye(65,90),ye(97,122),Dt([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Dt([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Dt([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),Dt([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),Dt([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),Dt([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),Dt([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),Dt([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),Dt([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),Dt([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),Dt([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),Dt([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Dt([["\\wp",8472],["\\aleph",8501]]),Dt([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),Dt([["\\ ",160],["~",160]],"space"),Ue(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new Gu(e)}),Ue("space","",{createAtom:e=>new Gu(e)}),Dt([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Dt([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Dt([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var cp="<mo>&#x2061;</mo>",Kh="<mo>&#8290;</mo>";function Hh(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Dn(e,r){return!e||!r.generateID?"":` extid="${e}"`}function Im(e,r,n){var a,u,f,v,A,C,P,z,Q,_e,Ie;let ze=!1;r=r!=null?r:e.atoms.length;let St="",sr="",xt=e.atoms[e.index];const Wt=(u=(a=xt.style)==null?void 0:a.variant)!=null?u:"",hr=(v=(f=xt.style)==null?void 0:f.variantStyle)!=null?v:"";let Zt="";if(Wt||hr){const Qr=at(xt.value,(A=xt.style)==null?void 0:A.variant,(C=xt.style)==null?void 0:C.variantStyle);if(Qr!==xt.value)return e.index+=1,St=`<mi${Dn(xt.id,n)}>${Qr}</mi>`,Dl(St,e,n)||(e.mathML+=St,e.lastType="mi"),!0;Zt=(P={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[hr+Wt])!=null?P:"",Zt=` mathvariant="${Zt}"`}const Nr={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(xt.command==="!")return e.index+=1,St="<mo>!</mo>",Dl(St,e,n)||(e.mathML+=St,e.lastType="mo"),!0;if(Nr[xt.command]){e.index+=1;let Qr=`<mi${Dn(xt.id,n)}${Zt}>${Nr[xt.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(Qr=Kh+Qr),Dl(Qr,e,n)||(e.mathML+=Qr,e.lastType="mi"),!0}if(xt.command==="\\operatorname")sr=H0(xt.body),e.index+=1;else if(Wt||hr)for(;e.index<r&&(xt.type==="mord"||xt.type==="macro")&&!xt.isDigit()&&Wt===((Q=(z=xt.style)==null?void 0:z.variant)!=null?Q:"")&&hr===((Ie=(_e=xt.style)==null?void 0:_e.variantStyle)!=null?Ie:"");)sr+=H0([xt]),e.index+=1,xt=e.atoms[e.index];else(xt.type==="mord"||xt.type==="macro")&&!xt.isDigit()&&(sr+=H0([xt]),e.index+=1);if(sr.length>0){ze=!0,St=`<mi${Zt}>${sr}</mi>`;const Qr=e.lastType;St.endsWith(">f</mi>")||St.endsWith(">g</mi>")?(St+=cp,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(St)?"mo":"mi",Dl(St,e,n)||((Qr==="mi"||Qr==="mn"||Qr==="mtext"||Qr==="fence")&&(St=Kh+St),e.mathML+=St)}return ze}function Pm(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function Om(e){let r=-1,n=e.index,a=!1,u=!1;for(;n<e.atoms.length&&!a&&!u;){const f=e.atoms[n];a=!f.isDigit(),u=!a&&f.superscript!==void 0,n++}return u&&(r=n-1),r}function Dl(e,r,n){var a;let u=r.atoms[r.index-1];if(!u)return!1;if(!u.superscript&&!u.subscript)if(((a=r.atoms[r.index])==null?void 0:a.type)==="subsup")u=r.atoms[r.index],r.index+=1;else return!1;const f=r.lastType;r.lastType="";const v=ln(u.superscript,n);r.lastType="";const A=ln(u.subscript,n);if(r.lastType=f,!v&&!A)return!1;let C="";return v&&A?C=`<msubsup>${e}${A}${v}</msubsup>`:v?C=`<msup>${e}${v}</msup>`:A&&(C=`<msub>${e}${A}</msub>`),r.mathML+=C,r.lastType="",!0}function Bm(e,r,n){r=r!=null?r:e.atoms.length;const a=e.index;let u="";for(;e.index<r&&e.atoms[e.index].mode==="text";)u+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return u.length>0?(e.mathML+=`<mtext ${Dn(e.atoms[a].id,n)}>${u}</mtext>`,e.lastType="mtext",!0):!1}function Fm(e,r,n){r=r!=null?r:e.atoms.length;const a=e.index;let u="",f=Om(e);for(f>=0&&f<r&&(r=f);e.index<r&&e.atoms[e.index].isDigit();)u+=e.atoms[e.index].asDigit(),e.index+=1;return u.length<=0?!1:(u="<mn"+Dn(e.atoms[a].id,n)+">"+u+"</mn>",f<0&&Pm(e)&&(f=e.index,e.index+=1),Dl(u,e,n)||(e.mathML+=u,e.lastType="mn"),!0)}function Nm(e,r,n){let a=!1;r=r!=null?r:e.atoms.length;let u="",f="";if(e.index<r&&e.atoms[e.index].type==="mopen"){let v=!1,A=0;const C=e.index;let P=-1,z=C+1;for(;z<r&&!v;)e.atoms[z].type==="mopen"?A+=1:e.atoms[z].type==="mclose"&&(A-=1),A===-1&&(v=!0,P=z),z+=1;v&&(u="<mrow>",u+=t0(e.atoms[C],n),u+=ln(e.atoms,n,C+1,P),u+=t0(e.atoms[P],n),u+="</mrow>",e.index=P+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=Kh),Dl(u,e,n)&&(a=!0,e.lastType="",u=""),f="fence")}return u.length>0&&(a=!0,e.mathML+=u,e.lastType=f),a}function $m(e,r,n){let a=!1;r=r!=null?r:e.atoms.length;let u="",f="";const v=e.atoms[e.index];if(!v)return!1;const A={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(A[v.command]){e.index+=1;const C=`<mo${Dn(v.id,n)}>${A[v.command]}</mo>`;return Dl(C,e,n)||(e.mathML+=C,e.lastType="mo"),!0}if(e.index<r&&(v.type==="mbin"||v.type==="mrel"))u+=nf(e.atoms[e.index],n),e.index+=1,f="mo";else if(e.index<r&&(v.type==="mop"||v.type==="operator"||v.type==="extensible-symbol")){if(v.subsupPlacement==="over-under"&&(v.superscript||v.subscript)){const C=t0(v,n);return v.superscript&&v.subscript?(u+="<munderover>"+C,u+=ln(v.subscript,n),u+=ln(v.superscript,n),u+="</munderover>"):v.superscript?(u+="<mover>"+C,u+=ln(v.superscript,n),u+="</mover>"):v.subscript&&(u+="<munder>"+C,u+=ln(v.subscript,n),u+="</munder>"),e.mathML+=u,e.lastType="mo",e.index+=1,!0}{const C=e.atoms[e.index],P=C.value==="\\operatorname",z=P?'<mi class="MathML-Unit"'+Dn(C.id,n)+">"+H0(C.value)+"</mi>":t0(C,n);u+=z,!P&&!/^<mo>(.*)<\/mo>$/.test(z)?(u+=cp,f="applyfunction"):f=P?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(u)&&(u=Kh+u),e.index+=1}return u.length>0&&(a=!0,Dl(u,e,n)||(e.mathML+=u,e.lastType=f)),a}function ln(e,r,n,a){r!=null||(r={});const u={atoms:[],index:n!=null?n:0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")u.mathML=e.toString();else if(typeof e=="string")u.mathML=e;else if(e instanceof $t)u.mathML=nf(e,r);else if(Array.isArray(e)){u.atoms=e;let f=0;for(a=a||(e?e.length:0);u.index<a;)if(Bm(u,a,r)||Fm(u,a,r)||Im(u,a,r)||$m(u,a,r)||Nm(u,a,r))f+=1;else if(u.index<a){let v=nf(u.atoms[u.index],r);u.lastType==="mn"&&v.length>0&&u.atoms[u.index].type==="genfrac"&&(v="<mo>&#x2064;</mo>"+v),u.atoms[u.index].type==="genfrac"?u.lastType="mfrac":u.lastType="",u.index+=1,Dl(v,u,r)?f+=1:v.length>0&&(u.mathML+=v,f+=1)}f>1&&(u.mathML="<mrow>"+u.mathML+"</mrow>")}return u.mathML}function t0(e,r){let n="";const a=H0(e.value);return a&&(n="<mo"+Dn(e.id,r)+">"+a+"</mo>"),n}function H0(e){if(!e)return"";if(typeof e=="string")return Hh(e);if(!Array.isArray(e)&&typeof e.body=="string")return Hh(e.body);let r="";for(const n of e)typeof n.value=="string"&&(r+=n.value);return Hh(r)}function nf(e,r){var n,a,u,f,v,A,C,P,z,Q,_e,Ie,ze,St,sr,xt,Wt,hr,Zt,Nr,Qr,Wr;if(e.mode==="text")return`<mi${Dn(e.id,r)}>${e.value}</mi>`;const Yi={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},En={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let gr="",Oa="",qo,Ja,Ls,Ba,va,Mn;const{command:hs}=e;if(e.command==="\\error")return`<merror${Dn(e.id,r)}>${ln(e.body,r)}</merror>`;const Rs={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Zo={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(e.type){case"first":break;case"group":case"root":gr=ln(e.body,r);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(gr+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(gr+="<mo>"+(Rs[e.leftDelim]||e.leftDelim)+"</mo>")),gr+="<mtable",e.colFormat){for(gr+=' columnalign="',Ls=0;Ls<e.colFormat.length;Ls++)e.colFormat[Ls].align&&(gr+={l:"left",c:"center",r:"right"}[e.colFormat[Ls].align]+" ");gr+='"'}for(gr+=">",Ja=0;Ja<e.array.length;Ja++){for(gr+="<mtr>",qo=0;qo<e.array[Ja].length;qo++)gr+="<mtd>"+ln(e.array[Ja][qo],r)+"</mtd>";gr+="</mtr>"}gr+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(gr+="<mo>"+(Rs[e.leftDelim]||e.rightDelim)+"</mo>"),gr+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(gr+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(gr+="<mo"+Dn(e.id,r)+">"+(Rs[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(gr+="<mfrac>",gr+=ln(e.above,r)||"<mi>&nbsp;</mi>",gr+=ln(e.below,r)||"<mi>&nbsp;</mi>",gr+="</mfrac>"):(gr+="<mtable"+Dn(e.id,r)+">",gr+="<mtr>"+ln(e.above,r)+"</mtr>",gr+="<mtr>"+ln(e.below,r)+"</mtr>",gr+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(gr+="<mo"+Dn(e.id,r)+">"+(Rs[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(gr+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(gr+="<msqrt"+Dn(e.id,r)+">",gr+=ln(e.body,r),gr+="</msqrt>"):(gr+="<mroot"+Dn(e.id,r)+">",gr+=ln(e.body,r),gr+=ln(e.above,r),gr+="</mroot>");break;case"leftright":const Yo=e,Xo=Yo.leftDelim;gr="<mrow>",Xo&&Xo!=="."&&(gr+=`<mo${Dn(e.id,r)}>${(n=Rs[Xo])!=null?n:Xo}</mo>`),e.body&&(gr+=ln(e.body,r));const Jo=Yo.matchingRightDelim();Jo&&Jo!=="."&&(gr+=`<mo${Dn(e.id,r)}>${(a=Rs[Jo])!=null?a:Jo}</mo>`),gr+="</mrow>";break;case"sizeddelim":case"delim":gr+=`<mo${Dn(e.id,r)}>${Rs[e.value]||e.value}</mo>`;break;case"accent":gr+='<mover accent="true"'+Dn(e.id,r)+">",gr+=ln(e.body,r),gr+="<mo>"+(Zo[hs]||e.accent)+"</mo>",gr+="</mover>";break;case"line":case"overlap":break;case"overunder":va=e.above,Ba=e.below,(e.svgAbove||va)&&(e.svgBelow||Ba)?Mn=e.body:va&&va.length>0?(Mn=e.body,(f=(u=e.body)==null?void 0:u[0])!=null&&f.below?(Ba=e.body[0].below,Mn=e.body[0].body):((A=(v=e.body)==null?void 0:v[0])==null?void 0:A.type)==="first"&&((P=(C=e.body)==null?void 0:C[1])!=null&&P.below)&&(Ba=e.body[1].below,Mn=e.body[1].body)):Ba&&Ba.length>0&&(Mn=e.body,(Q=(z=e.body)==null?void 0:z[0])!=null&&Q.above?(va=e.body[0].above,Mn=e.body[0].body):((Ie=(_e=e.body)==null?void 0:_e[0])==null?void 0:Ie.type)==="first"&&((St=(ze=e.body)==null?void 0:ze[1])!=null&&St.above)&&(va=e.body[1].overscript,Mn=e.body[1].body)),(e.svgAbove||va)&&(e.svgBelow||Ba)?(gr+=`<munderover ${Dn(e.id,r)}>`,gr+=(sr=Yi[e.svgBody])!=null?sr:ln(Mn,r),gr+=(xt=Yi[e.svgBelow])!=null?xt:ln(Ba,r),gr+=(Wt=Yi[e.svgAbove])!=null?Wt:ln(va,r),gr+="</munderover>"):e.svgAbove||va?(gr+=`<mover ${Dn(e.id,r)}>`+((hr=Yi[e.svgBody])!=null?hr:ln(Mn,r)),gr+=(Zt=Yi[e.svgAbove])!=null?Zt:ln(va,r),gr+="</mover>"):(e.svgBelow||Ba)&&(gr+=`<munder ${Dn(e.id,r)}>`+((Nr=Yi[e.svgBody])!=null?Nr:ln(Mn,r)),gr+=(Qr=Yi[e.svgBelow])!=null?Qr:ln(Ba,r),gr+="</munder>");break;case"placeholder":gr+="?";break;case"mord":{gr=typeof e.value=="string"?e.value:hs,hs==="\\char"?gr="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":gr.length>0&&gr.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?gr="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?gr=e.value.charAt(0):(console.error("Did not expect this"),gr=""));const vo=/\d/.test(gr)?"mn":"mi";gr=`<${vo}${Dn(e.id,r)}>${Hh(gr)}</${vo}>`;break}case"mbin":case"mrel":case"minner":gr=t0(e,r);break;case"mpunct":gr='<mo separator="true"'+Dn(e.id,r)+">"+hs+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(gr="<mo"+Dn(e.id,r)+">",gr+=hs==="\\operatorname"?e.body:hs||e.body,gr+="</mo>");break;case"box":gr='<menclose notation="box"',e.backgroundcolor&&(gr+=' mathbackground="'+e.backgroundcolor+'"'),gr+=Dn(e.id,r)+">"+ln(e.body,r)+"</menclose>";break;case"spacing":gr+='<mspace width="'+((Wr=En[hs])!=null?Wr:0)+'em"/>';break;case"enclose":gr='<menclose notation="';for(const vo in e.notation)Object.prototype.hasOwnProperty.call(e.notation,vo)&&e.notation[vo]&&(gr+=Oa+vo,Oa=" ");gr+=Dn(e.id,r)+'">'+ln(e.body,r)+"</menclose>";break;case"prompt":gr='<menclose notation="roundexbox""">'+ln(e.body,r)+"</menclose>";break;case"space":gr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":gr+=t0(e,r);break;case"mclose":gr+=t0(e,r);break;case"macro":{const vo=e.command+H0(e.macroArgs);vo&&(gr+=`<mo ${Dn(e.id,r)}>${vo}</mo>`)}break;case"latexgroup":gr+=ln(e.body,r);break;case"latex":gr+="<mtext"+Dn(e.id,r)+">"+e.value+"</mtext>";break;case"tooltip":gr+=ln(e.body,r);break;case"text":gr+=`<mtext ${Dn(e.id,r)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${Dn(e.id,r)} displaystyle="true">${ln(e.body,r)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${Dn(e.id,r)} displaystyle="false">${ln(e.body,r)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return gr}var G0={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},sf={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function zm(e){let r="";return e.startsWith("\\")&&(r=" "+e.replace("\\","")+" "),r}function Mc(e){let r=0;if(k(e))for(const n of e)n.type!=="first"&&(r+=1);return r===1}function Um(e){if(k(e)){for(const r of e)if(r.type!=="first"&&r.id)return r.id.toString()}return""}function hp(e){let r="";if(k(e))for(const n of e)n.type!=="first"&&typeof n.value=="string"&&(r+=n.value);return r}function Km(e){return e?e.map(r=>r.value).join(""):""}function Ui(e,r){var n,a,u,f,v;function A(z){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(z)?` <say-as interpret-as="character">${z}</say-as>`:/[A-Z]/.test(z)?`capital <say-as interpret-as="character">${z.toLowerCase()}</say-as>`:z:/[a-z]/.test(z)?" '"+z.toUpperCase()+"'":/[A-Z]/.test(z)?" 'capital "+z.toUpperCase()+"'":z}function C(z){return"<emphasis>"+z+"</emphasis>"}if(!r)return"";let P="";if(k(r)){let z=!1,Q=!1;for(let _e=0;_e<r.length;_e++)r[_e].type!=="first"&&(r[_e].mode!=="text"&&(Q=!1),_e<r.length-2&&r[_e].type==="mopen"&&r[_e+2].type==="mclose"&&r[_e+1].type==="mord"?(P+=" of ",P+=C(Ui(e,r[_e+1])),_e+=2):r[_e].mode==="text"?Q?P+=(n=r[_e].value)!=null?n:" ":(Q=!0,P+=Ui("text",r[_e])):r[_e].isDigit()?z?P+=r[_e].asDigit():(z=!0,P+=Ui(e,r[_e])):(z=!1,P+=Ui(e,r[_e])))}else if(r.mode==="text")r.id&&e==="math"&&(P+='<mark name="'+r.id.toString()+'"/>'),P+=r.value;else{r.id&&e==="math"&&(P+='<mark name="'+r.id.toString()+'"/>');let z="",Q="",_e="",Ie=!1;const{command:ze}=r;switch(ze){case"\\vec":return"vector "+Ui(e,r.body);case"\\acute":return Ui(e,r.body)+" acute";case"\\grave":return Ui(e,r.body)+" grave";case"\\dot":return"dot over"+Ui(e,r.body);case"\\ddot":return"double dot over"+Ui(e,r.body);case"\\mathring":return"ring over"+Ui(e,r.body);case"\\tilde":case"\\widetilde":return"tilde over"+Ui(e,r.body);case"\\bar":return Ui(e,r.body)+" bar";case"\\breve":return Ui(e,r.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Ui(e,r.body);case"\\hat":case"\\widehat":return"hat over"+Ui(e,r.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Ui(e,r.body);case"\\underarc":case"\\underparen":return"arc under "+Ui(e,r.body)}switch(r.type){case"prompt":const St=r.body.length>1?'start input . <break time="500ms"/> '+Ui(e,r.body)+'. <break time="500ms"/> end input':"blank";P+=' <break time="300ms"/> '+St+'. <break time="700ms"/>'+((a=r.correctness)!=null?a:"")+' . <break time="700ms"/> ';break;case"array":const sr=r.array,xt=r.environmentName;if(Object.keys(sf).includes(xt)){P+=` begin ${sf[xt]} `;for(let Zt=0;Zt<sr.length;Zt++){Zt>0&&(P+=","),P+=` row ${Zt+1} `;for(let Nr=0;Nr<sr[Zt].length;Nr++)Nr>0&&(P+=","),P+=` column ${Nr+1}: `,P+=Ui("math",sr[Zt][Nr])}P+=` end ${sf[xt]} `}break;case"group":ze==="\\ne"?P+=" not equal ":(ze==="\\not"&&(P+=" not "),P+=Ui("math",r.body));break;case"root":P+=Ui("math",r.body);break;case"genfrac":if(z=Ui("math",r.above),Q=Ui("math",r.below),Mc(r.above)&&Mc(r.below)){const Nr={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[hp(r.above)+"/"+hp(r.below)];Nr?P=Nr:P+=z+" over "+Q}else P+=' the fraction <break time="150ms"/>'+z+' over <break time="150ms"/>'+Q+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(_e=Ui("math",r.body),r.hasEmptyBranch("above"))P+=Mc(r.body)?" the square root of "+_e+" , ":' the square root of <break time="200ms"/>'+_e+'. <break time="200ms"/> End square root';else{let Zt=Ui("math",r.above);Zt=Zt.trim();const Nr=Zt.replace(/<mark([^/]*)\/>/g,"");Nr==="3"?P+=' the cube root of <break time="200ms"/>'+_e+'. <break time="200ms"/> End cube root':Nr==="n"?P+=' the nth root of <break time="200ms"/>'+_e+'. <break time="200ms"/> End root':P+=' the root with index: <break time="200ms"/>'+Zt+', of <break time="200ms"/>'+_e+'. <break time="200ms"/> End root'}break;case"leftright":{const Zt=r;P+=(u=Zt.leftDelim?G0[Zt.leftDelim]:void 0)!=null?u:Zt.leftDelim,P+=Ui("math",r.body),P+=(f=Zt.rightDelim?G0[Zt.rightDelim]:void 0)!=null?f:Zt.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const Wt=ze.replace(/^\\/g,""),hr=_r()[Wt];hr&&(hr!=null&&hr.expand?P+=Ui("math",r.body):P+=`${Wt} `);break;case"placeholder":P+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(ze==="\\mathbin"||ze==="\\mathrel"||ze==="\\mathopen"||ze==="\\mathclose"||ze==="\\mathpunct"||ze==="\\mathord"||ze==="\\mathinner"){P=Ui(e,r.body);break}let Zt=r.isDigit()?r.asDigit():r.value,Nr=r.command;if((r.type==="delim"||r.type==="sizeddelim")&&(Nr=r.value,Zt=Nr),e==="text")P+=Zt;else{if(r.type==="mbin"&&(P+='<break time="150ms"/>'),Zt){const Qr=G0[Zt]||(Nr?G0[Nr.trim()]:"");if(Qr)P+=" "+Qr;else{const Wr=Nr?zm(Nr.trim()):"";P+=Wr||A(Zt)}}else P+=Ui("math",r.body);r.type==="mbin"&&(P+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(r.value!=="\u200B"){const Zt=r.command;if(Zt==="\\sum")if(!r.hasEmptyBranch("superscript")&&!r.hasEmptyBranch("subscript")){let Nr=Ui("math",r.superscript);Nr=Nr.trim();let Qr=Ui("math",r.subscript);Qr=Qr.trim(),P+=' the summation from <break time="200ms"/>'+Qr+'<break time="200ms"/> to <break time="200ms"/>'+Nr+'<break time="200ms"/> of <break time="150ms"/>',Ie=!0}else if(r.hasEmptyBranch("subscript"))P+=" the summation of";else{let Nr=Ui("math",r.subscript);Nr=Nr.trim(),P+=' the summation from <break time="200ms"/>'+Nr+'<break time="200ms"/> of <break time="150ms"/>',Ie=!0}else if(Zt==="\\prod")if(!r.hasEmptyBranch("superscript")&&!r.hasEmptyBranch("subscript")){let Nr=Ui("math",r.superscript);Nr=Nr.trim();let Qr=Ui("math",r.subscript);Qr=Qr.trim(),P+=' the product from <break time="200ms"/>'+Qr+'<break time="200ms"/> to <break time="200ms"/>'+Nr+'<break time="200ms"/> of <break time="150ms"/>',Ie=!0}else if(r.hasEmptyBranch("subscript"))P+=" the product of ";else{let Nr=Ui("math",r.subscript);Nr=Nr.trim(),P+=' the product from <break time="200ms"/>'+Nr+'<break time="200ms"/> of <break time="150ms"/>',Ie=!0}else if(Zt==="\\int")if(!r.hasEmptyBranch("superscript")&&!r.hasEmptyBranch("subscript")){let Nr=Ui("math",r.superscript);Nr=Nr.trim();let Qr=Ui("math",r.subscript);Qr=Qr.trim(),P+=' the integral from <break time="200ms"/>'+C(Qr)+'<break time="200ms"/> to <break time="200ms"/>'+C(Nr)+' <break time="200ms"/> of ',Ie=!0}else P+=' the integral of <break time="200ms"/> ';else if(typeof r.value=="string"){const Nr=(v=G0[r.value])!=null?v:r.command?G0[r.command]:void 0;P+=Nr||" "+r.value}else r.command&&(r.command==="\\mathop"?P+=Ui("math",r.body):r.command==="\\operatorname"?P+=Km(r.body):P+=r.command.startsWith("\\")?" "+r.command.slice(1):" "+r.command)}break;case"enclose":_e=Ui("math",r.body),P+=" crossed out "+_e+". End crossed out.";break;case"space":case"spacing":break}if(!Ie&&!r.hasEmptyBranch("superscript")){let St=Ui(e,r.superscript);St=St.trim();const sr=St.replace(/<[^>]*>/g,"");if(Mc(r.superscript)){if(e==="math"){const xt=Um(r.superscript);xt&&(P+='<mark name="'+xt+'"/>')}sr==="\u2032"?P+=" prime ":sr==="2"?P+=" squared ":sr==="3"?P+=" cubed ":Number.isNaN(Number.parseInt(sr))?P+=" to the "+St+"; ":P+=' to the <say-as interpret-as="ordinal">'+sr+"</say-as> power; "}else Number.isNaN(Number.parseInt(sr))?P+=" raised to the "+St+"; ":P+=' raised to the <say-as interpret-as="ordinal">'+sr+"</say-as> power; "}if(!Ie&&!r.hasEmptyBranch("subscript")){let St=Ui("math",r.subscript);St=St.trim(),P+=Mc(r.subscript)?" sub "+St:" subscript "+St+". End subscript. "}}return P}function V0(e){var r,n;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const u=ln(e);if(u){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(r=window.MathfieldElement.textToSpeechRulesOptions)!=null?r:{},window.MathfieldElement.textToSpeechRulesOptions=d($({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=d($({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=d($({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const f=(n=window.SRE)!=null?n:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&f.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let v="";try{v=f.toSpeech(u)}catch(A){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",A)}return v}return""}let a=Ui("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let u="";window.MathfieldElement.speechEngineRate&&(u='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),a='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+u+"<p><s>"+a+"</s></p>"+(u?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&ae()==="macos"?a=a.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):a=a.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return a}var Lc={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},Rc={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function Hm(e){let r="";for(const n of e){const a=r[r.length-1];a!==void 0&&/\d/.test(a)&&/^\d/.test(n)&&(r+=" "),r+=n}return r}function cs(e){var r,n,a,u,f,v,A,C,P,z,Q,_e,Ie;if(!e)return"";if(k(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(cs).join("");if(e[0].mode==="text"){let hr=0,Zt="";for(;((r=e[hr])==null?void 0:r.mode)==="text";)Zt+=e[hr].body?cs(e[hr].body):e[hr].value,hr++;return`"${Zt}" ${cs(e.slice(hr))}`}let xt=0;const Wt=[];for(;e[xt]&&e[xt].mode==="math";){let hr="";for(;e[xt]&&e[xt].type==="mord"&&/\d/.test(e[xt].value);)hr+=e[xt++].value;hr?Wt.push(hr):Wt.push(cs(e[xt++]))}return Wt.push(cs(e.slice(xt))),Hm(Wt)}if(e.mode==="text")return`"${e.value}"`;let ze="";const{command:St}=e;let sr;if(St==="\\placeholder")return`(${cs(e.body)})`;switch(e.type){case"accent":const xt={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[St];ze=`${xt!=null?xt:""} ${cs(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(Wr=>Wr.value).join("");case"group":case"root":ze=(n=Lc[St])!=null?n:cs(e.body);break;case"genfrac":{const Wr=e;(Wr.leftDelim||Wr.rightDelim)&&(ze=Wr.leftDelim==="."||!Wr.leftDelim?"{:":Wr.leftDelim),Wr.hasBarLine?(ze+="(",ze+=cs(Wr.above),ze+=")/(",ze+=cs(Wr.below),ze+=")"):(ze+="("+cs(Wr.above)+"),",ze+="("+cs(Wr.below)+")"),(Wr.leftDelim||Wr.rightDelim)&&(ze+=Wr.rightDelim==="."||!Wr.rightDelim?"{:":Wr.rightDelim)}break;case"surd":ze+=e.hasEmptyBranch("above")?"sqrt("+cs(e.body)+")":"root("+cs(e.above)+")("+cs(e.body)+")";break;case"latex":ze=e.value;break;case"leftright":{const Wr=e,Yi=Wr.leftDelim;ze+=Yi==="."||!Yi?"{:":Yi,ze+=cs(Wr.body);const En=Wr.matchingRightDelim();ze+=En==="."||!En?":}":En}break;case"sizeddelim":case"delim":ze=e.value;break;case"overlap":break;case"overunder":break;case"mord":ze=(u=(a=Lc[St])!=null?a:St)!=null?u:typeof e.value=="string"?e.value:"",ze.startsWith("\\")&&(ze+=" "),sr=St?St.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,sr?ze=String.fromCodePoint(Number.parseInt("0x"+sr[1])):ze.length>0&&ze.startsWith("\\")&&(ze=typeof e.value=="string"?e.value.charAt(0):e.command),ze=Gm(ze,e.style);break;case"mbin":case"mrel":case"minner":ze=(v=(f=Lc[St])!=null?f:Rc[St])!=null?v:e.value;break;case"mopen":case"mclose":ze=e.value;break;case"mpunct":ze=(A=Rc[St])!=null?A:St;break;case"mop":case"operator":case"extensible-symbol":e.value!=="\u200B"&&(Rc[St]?ze=Rc[St]:ze=St==="\\operatorname"?cs(e.body):(C=e.value)!=null?C:St,ze+=" ");break;case"array":const Wt=e.array,hr=e.environmentName,Zt=(P={bmatrix:["[","]"],"bmatrix*":["[","]"]}[hr])!=null?P:["(",")"],Nr=[];for(const Wr of Wt){const Yi=[];for(const En of Wr)Yi.push(Zt[0]+cs(En)+Zt[1]);Nr.push(Yi.join(","))}const Qr=(z={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[hr])!=null?z:["(",")"];ze=Qr[0]+Nr.join(",")+Qr[1];break;case"box":break;case"spacing":ze=(Q=Lc[St])!=null?Q:" ";break;case"enclose":ze="("+cs(e.body)+")";break;case"space":ze=" ";break;case"subsup":ze="";break;case"macro":ze=(Ie=(_e=Lc[St])!=null?_e:Rc[St])!=null?Ie:cs(e.body);break}if(!e.hasEmptyBranch("subscript")){ze+="_";const xt=cs(e.subscript);ze+=xt.length!==1?`(${xt})`:xt}if(!e.hasEmptyBranch("superscript")){ze+="^";const xt=cs(e.superscript);ze+=xt.length!==1?`(${xt})`:xt}return ze}function Gm(e,r){if(!r)return e;let n=e;return r.variant==="double-struck"&&(n=`bbb "${n}"`),r.variant==="script"&&(n=`cc "${n}"`),r.variant==="fraktur"&&(n=`fr "${n}"`),r.variant==="sans-serif"&&(n=`sf "${n}"`),r.variant==="monospace"&&(n=`tt "${n}"`),r.variantStyle==="bold"&&(n=`bb "${n}"`),r.color?`color({${r.color}})(${n})`:n}function Ms(e,r){var n,a;r!=null||(r={}),r.mathstyle=(n=r.mathstyle)!=null?n:"displaystyle";const u=new qi({from:d($({},rc()),{renderPlaceholder:()=>new ur(160,{maxFontSize:1}),letterShapeStyle:(a=r==null?void 0:r.letterShapeStyle)!=null?a:"tex"}),mathstyle:r.mathstyle}),v=new $t({mode:"math",type:"root",body:Us(e,{context:u,parseMode:"math",mathstyle:r.mathstyle})}).render(u);return v?(p0(Vu(v,u)),m0(v,{classes:"ML__latex"}).toMarkup()):""}function Pg(e){return gc(e,{context:rc()})}function Vm(e,r={}){return ln(Us(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),r)}function Wm(e){const r=Us(e,{parseMode:"math",mathstyle:"displaystyle"});return V0(r)}var Gh;function jm(e){var r,n;if(!Gh){const a=(r=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:r.ComputeEngine;a?Gh=new a:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(n=Gh==null?void 0:Gh.box(e).latex)!=null?n:""}function Og(e,r="math"){return cs(new $t({type:"root",body:Us(e,{parseMode:r})}))}function Bg(e){return w0(e,{format:"ascii-math"})[1]}function af(e){if(typeof e=="string"){const r=qm(e);if(!r)throw new Error(`Invalid color: ${e}`);return r}return"C"in e?Ym(e):"a"in e?dp(e):e}function W0(e){return e<0?0:e>255?255:Math.round(e)}function qm(e){if(!e||e[0]!=="#")return;e=e.slice(1);let r;return e.length<=4?(r={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(r.a=parseInt(e[3]+e[3],16)/255)):(r={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(r.a=parseInt(e[6]+e[7],16)/255)),r&&typeof r.a=="undefined"&&(r.a=1),r}function of(e){const[r,n,a]=[e.L,e.C,e.H],u=a*Math.PI/180,f={L:r,a:n*Math.cos(u),b:n*Math.sin(u)};return e.alpha!==void 0&&(f.alpha=e.alpha),f}function Zm(e){const[r,n,a]=[e.L,e.a,e.b],u=Math.sqrt(n*n+a*a),v=Math.atan2(a,n)*180/Math.PI,A={L:r,C:u,H:v};return e.alpha!==void 0&&(A.alpha=e.alpha),A}function lf(e){const[r,n,a]=[e.L,e.a,e.b],u=Math.pow(.9999999984505198*r+.39633779217376786*n+.2158037580607588*a,3),f=Math.pow(1.00000000888176*r-.10556134232365635*n-.0638541747717059*a,3),v=Math.pow(r*1.000000054672411-.0894841820949657*n-1.2914855378640917*a,3),A=4.076741661347994*u-3.307711590408193*f+.230969928729428*v,C=-1.2684380040921763*u+2.6097574006633715*f-.3413193963102197*v,P=-.004196086541837188*u-.7034186144594493*f+1.7076147009309444*v,z=Q=>{const _e=Math.abs(Q);return _e<=.0031308?Q*12.92:(Math.sign(Q)||1)*(1.055*Math.pow(_e,1/2.4)-.055)};return[z(A),z(C),z(P)]}function uf(e){const[r,n,a]=e;return r>=0&&r<=1&&n>=0&&n<=1&&a>=0&&a<=1}function cf(e,r){let[n,a,u]=e;return n=W0(n*255),a=W0(a*255),u=W0(u*255),r!==void 0?{r:n,g:a,b:u,alpha:r}:{r:n,g:a,b:u}}function dp(e){let[r,n,a]=lf(e);if(uf([r,n,a]))return cf([r,n,a],e.alpha);const u=Zm(e);if(u.C=0,[r,n,a]=lf(of(u)),!uf([r,n,a]))return cf([r,n,a],e.alpha);let f=0,v=e.L,A=(f+v)/2;u.C=A;const C=.36/Math.pow(2,12);for(;v-f>C;)A=(f+v)/2,u.C=A,[r,n,a]=lf(of(u)),uf([r,n,a])?f=A:v=A;return cf([r,n,a],e.alpha)}function Ym(e){return dp(of(e))}function fp(e,r){const n=af(e),a=af(r),u=.56,f=.57,v=.62,A=.65,C=.022,P=1.414,z=.1,Q=5e-4,_e=1.14,Ie=.027,ze=1.14,St=.027;function sr(Wr){return Wr>=C?Wr:Wr+yo(C-Wr,P)}function xt(Wr){return(Wr<0?-1:1)*Math.pow(Math.abs(Wr),2.4)}const Wt=sr(xt(a.r/255)*.2126729+xt(a.g/255)*.7151522+xt(a.b/255)*.072175),hr=sr(xt(n.r/255)*.2126729+xt(n.g/255)*.7151522+xt(n.b/255)*.072175);let Zt,Nr,Qr;return Math.abs(hr-Wt)<Q?Nr=0:hr>Wt?(Zt=yo(hr,u)-yo(Wt,f),Nr=Zt*_e):(Zt=yo(hr,A)-yo(Wt,v),Nr=Zt*ze),Math.abs(Nr)<z?Qr=0:Nr>0?Qr=Nr-St:Qr=Nr+Ie,Qr*100}function pp(e,r,n){n!=null||(n="#fff"),r!=null||(r="#000");const a=fp(e,n),u=fp(e,r);return Math.abs(a)>Math.abs(u)?n:r}function Xm(e){const r=af(e);let n=((1<<24)+(W0(r.r)<<16)+(W0(r.g)<<8)+W0(r.b)).toString(16).slice(1);return r.alpha!==void 0&&r.alpha<1&&(n+=("00"+Math.round(r.alpha*255).toString(16)).slice(-2)),n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&n[6]===n[7]&&(n=n[0]+n[2]+n[4]+(r.alpha!==void 0&&r.alpha<1?n[6]:"")),"#"+n}function Hn(e){const r=mp(e);let n="";for(const a of r){if(typeof a.value!="string")return"";n+=a.value}return n}function mp(e){const n=e.model.selection.ranges;return n.length!==1?[]:e.model.getAtoms(n[0])}function Jm(e,r){const n=mp(e);if(n.length!==1)return!1;const a=bc[r];return a?!!a.test(n[0].value):!1}function Qm(e,r){return Hn(e).length>0}function eg(e){return[hf(e,"double-struck","mathbb","tooltip.blackboard"),hf(e,"fraktur","mathfrak","tooltip.fraktur"),hf(e,"calligraphic","mathcal","tooltip.caligraphic"),df(e,"up","mathrm","tooltip.roman-upright"),df(e,"bold","mathbf","tooltip.bold"),df(e,"italic","mathit","tooltip.italic")]}function tg(e){return[{label:()=>Ms(`\\vec{${Hn(e)}}`),visible:()=>Hn(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\overrightarrow{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\overleftarrow{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\dot{${Hn(e)}}`),visible:()=>Hn(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\ddot{${Hn(e)}}`),visible:()=>Hn(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\bar{${Hn(e)}}`),visible:()=>Hn(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\overline{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\overgroup{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\overbrace{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\underline{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\undergroup{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\underbrace{${Hn(e)}}`),visible:()=>Hn(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function rg(e){return[{label:()=>Ms(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Ms(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function ig(e){const r=[];for(const n of Object.keys(De))r.push({class:(Xm(pp(De[n]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${De[n]} "></span>`,ariaLabel:()=>{var a;return(a=ue(n))!=null?a:n},checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({backgroundColor:n}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({backgroundColor:n},{operation:"toggle"}),e.adoptStyle="none"}});return r}function ng(e){const r=[];for(const n of Object.keys(ve))r.push({class:(pp(ve[n])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${ve[n]} "></span>`,ariaLabel:()=>{var a;return(a=ue(n))!=null?a:n},checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({color:n}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({color:n},{operation:"toggle"}),e.adoptStyle="none"}});return r}var sg=class extends rp{constructor(e,r,n,a){super(e,r),this.row=n,this.col=a}set active(e){const r=this.parentMenu.children;if(e)for(const n of r)n.element.classList.toggle("active",n.row<=this.row&&n.col<=this.col);else for(const n of r)n.element.classList.remove("active")}};function ag(e){const r=[];for(let n=1;n<=5;n++)for(let a=1;a<=5;a++)r.push({onCreate:(u,f)=>new sg(u,f,n,a),label:"\u2610",tooltip:()=>ue("tooltip.row-by-col",n,a),data:{row:n,col:a},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(n).fill(Array(a).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return r}function og(e){return[{label:()=>ue("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>r0(e)},{label:()=>ue("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>r0(e)},{label:()=>ue("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>r0(e),enabled:()=>{const r=e.model.parentEnvironment;if(!r)return!1;const[n,a]=ug(e);return n<r.maxColumns}},{label:()=>ue("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>r0(e)},{type:"divider"},{label:()=>ue("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>r0(e)},{label:()=>ue("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>r0(e)},{type:"divider"},{label:()=>ue("menu.borders"),visible:()=>(lg(e)||r0(e))&&e.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Ic(e,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Ic(e,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Ic(e,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Ic(e,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Ic(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>ue("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:ag(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>ue("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>ue("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Cl(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>ue("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Cl(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>ue("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>ue("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:eg(e),submenuClass:"variant-submenu"},{label:()=>ue("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:ng(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ue("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:ig(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ue("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:tg(e),submenuClass:"variant-submenu"},{label:()=>ue("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&Hn(e).length>0,submenu:rg(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>ue("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const r=cg(e);if(!r){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${r}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(r,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>ue("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var r,n;if(e.model.selectionIsCollapsed){const a=(r=e.expression)==null?void 0:r.simplify();if(e.model.position=e.model.lastOffset,!a){e.model.announce("plonk");return}e.insert(`=${a.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const a=(n=window.MathfieldElement.computeEngine)==null?void 0:n.parse(e.getValue(e.model.selection)).simplify();if(!a){e.model.announce("plonk");return}e.insert(a.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var r;if(window.MathfieldElement.computeEngine===null)return"";const n=(r=e.expression)==null?void 0:r.unknowns[0];return n?ue("menu.solve-for",Ms(n)):ue("menu.solve")},id:"ce-solve",visible:()=>{var r;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((r=e.expression)==null?void 0:r.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var r;const n=e.expression,a=n==null?void 0:n.unknowns[0],u=(r=n.solve(a))==null?void 0:r.map(f=>{var v;return(v=f.simplify().latex)!=null?v:""});if(!u){e.model.announce("plonk");return}e.insert(`${a}=${u.length===1?u[0]:"\\left\\lbrace"+(u==null?void 0:u.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>ue("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>ue("menu.copy"),id:"copy",submenu:[{label:()=>ue("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>Rn.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>ue("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Rn.copyToClipboard(e,"ascii-math")},{label:()=>ue("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Rn.copyToClipboard(e,"math-ml")}]},{label:()=>ue("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>ue("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function r0(e){var r;return!!((r=e.model.parentEnvironment)!=null&&r.array)}function lg(e){return e.model.at(e.model.position).type==="array"}function ug(e){var r;const n=(r=e.model.parentEnvironment)==null?void 0:r.array;return n?[n.length,n.reduce((a,u)=>Math.max(a,u.length),0)]:[0,0]}function Ic(e,r){Ya(e),e.flushInlineShortcutBuffer(),Pf(e.model,r),ns(e)}function cg(e){var r,n;let a;if(e.model.selectionIsCollapsed?a=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(),{canonical:!1}):a=(n=window.MathfieldElement.computeEngine)==null?void 0:n.parse(e.getValue(e.model.selection),{canonical:!1}),!a)return"";let u=a.evaluate();return u.isSame(a)&&(u=a.N()),u.latex}function hf(e,r,n,a){return{label:()=>Ms(`\\${n}{${Hn(e)}}`),tooltip:()=>{var u;return(u=ue(a))!=null?u:a},visible:()=>Jm(e,r),checked:()=>{var u;return{some:"mixed",all:!0}[(u=e.queryStyle({variant:r}))!=null?u:!1]},onMenuSelect:()=>{e.applyStyle({variant:r},{operation:"toggle"}),e.adoptStyle="none"}}}function df(e,r,n,a){return{label:()=>Ms(`\\${n}{${Hn(e)}}`),tooltip:()=>{var u;return(u=ue(a))!=null?u:a},visible:()=>Qm(e,r),checked:()=>{var u;return{some:"mixed",all:!0}[(u=e.queryStyle({variantStyle:r}))!=null?u:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:r},{operation:"toggle"}),e.adoptStyle="none"}}}function j0(e,r){return e+V0(r)}Ta({speak:(e,r,n)=>hg(e,r,n)},{target:"mathfield"});function hg(e,r,n){var a,u;n=n!=null?n:{withHighlighting:!1};const{model:f}=e;function v(z){let Q=null;switch(z){case"all":Q=f.root;break;case"selection":Q=f.getAtoms(f.selection);break;case"left":{Q=f.getAtoms(f.offsetOf(f.at(f.position).leftSibling),f.position);break}case"right":{Q=f.getAtoms(f.position,f.offsetOf(f.at(f.position).rightSibling));break}case"group":Q=f.getAtoms(f.getSiblingsRange(f.position));break;case"parent":{const{parent:_e}=f.at(f.position);_e!=null&&_e.parent?Q=_e:Q=f.root;break}default:Q=f.root}return Q}function A(z){let Q="";switch(z){case"all":console.log("Internal failure: speak all failed");break;case"selection":Q="no selection";break;case"left":Q="at start";break;case"right":Q="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Q="no parent";break;default:console.log('unknown speak_ param value: "'+z+'"');break}return Q}const C=v(r);if(C===null)return(u=(a=window.MathfieldElement).speakHook)==null||u.call(a,A(r)),!1;(n.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const P=V0(C);return O()&&n.withHighlighting?(hu().readAloudMathfield=e,ju(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,P)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(P),!1}function dg(e){var r,n;if(!O()){console.log("Speak:",e);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const a=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(a)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),u={OutputFormat:"mp3",VoiceId:(r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((n=window.MathfieldElement.speechEngineVoice)!=null?n:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};a.synthesizeSpeech(u,(f,v)=>{if(f)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${f}`);else if(v!=null&&v.AudioStream){const A=new Uint8Array(v.AudioStream),C=new Blob([A.buffer],{type:"audio/mpeg"}),P=URL.createObjectURL(C);new Audio(P).play().catch(Q=>console.log(Q))}else console.log("polly.synthesizeSpeech():",v)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function gp(e){var r;let n;if(e.parent.type==="prompt")e.parentBranch==="body"&&(n="prompt");else if(e.parentBranch==="body")n=e.type&&(r={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?r:"parent";else if(e.parent.type==="genfrac"){if(e.parentBranch==="above")return"numerator";if(e.parentBranch==="below")return"denominator"}else e.parent.type==="surd"?e.parentBranch==="above"&&(n="index"):e.parentBranch==="superscript"?n="superscript":e.parentBranch==="subscript"&&(n="subscript");return n||console.log("unknown relationship"),n!=null?n:"parent"}function fg(e,r,n,a){let u="";if(r==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(r==="delete")u=j0("deleted: ",a);else if(r==="focus"||r.includes("move"))u=pg(e.model,n)+(e.model.selectionIsCollapsed?"":"selected: ")+mg(e.model);else if(r==="replacement")u=j0("",e.model.at(e.model.position));else if(r==="line"){const f=j0("",e.model.root);e.keyboardDelegate.setAriaLabel(f)}else u=a?j0(r+" ",a):r;if(u){const f=e.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";e.ariaLiveText.textContent=u+f}}function pg(e,r){if(Number.isNaN(r))return"";const n=e.at(r);if(!n||n.treeDepth<=e.at(e.position).treeDepth)return"";let a="",u=n.parent;const f=e.at(e.position).parent;for(;u!==e.root&&u!==f;)a+=`out of ${gp(u)};`,u=u.parent;return a}function mg(e){if(!e.selectionIsCollapsed)return j0("",e.getAtoms(e.selection));let r="";const n=e.at(e.position),a=gp(n);return n.isFirstSibling&&(r=(a?"start of "+a:"unknown")+": "),n.isLastSibling?n.isFirstSibling||(r+=a?"end of "+a:"unknown"):r+=j0("",n),r}var gg=class{constructor(e,r,n){this.mathfield=e,this.mode=r,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=n}dispose(){this.mathfield=void 0}getState(){const e={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,r){var n;const a=this.silenceNotifications;this.silenceNotifications=(n=r==null?void 0:r.silenceNotifications)!=null?n:!0;let u={};if((r==null?void 0:r.type)==="undo"&&(u={inputType:"historyUndo"}),(r==null?void 0:r.type)==="redo"&&(u={inputType:"historyRedo"}),this.contentWillChange(u)){const f=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=$o(e.content),this.selection=e.selection,this.silenceNotifications=f,this.contentDidChange(u)}this.silenceNotifications=a}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,r){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var n,a,u;const f=this.normalizeSelection(e,r);if(f===void 0)throw new TypeError("Invalid selection");if(f.ranges.length===1&&f.ranges[0][0]===f.ranges[0][1]){const z=f.ranges[0][0];if(!this.mathfield.dirty&&!((n=this.at(z))!=null&&n.parentPrompt)&&this.mathfield.hasEditablePrompts){if((a=this.at(z-1))!=null&&a.parentPrompt){this._anchor=this.normalizeOffset(z-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((u=this.at(z+1))!=null&&u.parentPrompt){this._anchor=this.normalizeOffset(z+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=z,this._position=z,this._selection=f;return}const v=Ds(f);f.direction==="backward"?[this._position,this._anchor]=v:[this._anchor,this._position]=v;const A=this.at(v[0]+1),C=this.at(v[1]),P=$t.commonAncestor(A,C);(P==null?void 0:P.type)==="array"&&A.parent===P&&C.parent===P?this._selection={ranges:[v],direction:f.direction}:this._selection={ranges:[v],direction:f.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(e){var r;const n=this.at(e);(n==null?void 0:n.type)==="placeholder"?this.setSelection(e-1,e):((r=n==null?void 0:n.rightSibling)==null?void 0:r.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,n instanceof us&&n.isSuggestion&&(n.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(e="forward"){return this._anchor===this._position?!1:(e==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){const r=this.at(e),{parent:n}=r;if(!n)return[0,this.lastOffset];const a=r.parent.branch(r.parentBranch);return[this.offsetOf(a[0]),this.offsetOf(a[a.length-1])]}getBranchRange(e,r){const n=this.at(e).branch(r);return[this.offsetOf(n[0]),this.offsetOf(n[n.length-1])]}getAtoms(e,r,n){let a=n!=null?n:{};if(_0(e)){if(a=r!=null?r:{},e.ranges.length>1)return e.ranges.reduce((P,z)=>[...P,...this.getAtoms(z,a)],[]);e=e.ranges[0]}let u,f;if(pa(e)){if(u=e,!pa(r))return[];f=r}else[u,f]=e,a=r!=null?r:{};if(!Number.isFinite(u))return[];a.includeChildren===void 0&&(a.includeChildren=!1),u<0&&(u=this.lastOffset-u+1),f<0&&(f=this.lastOffset-f+1);const v=Math.min(u,f)+1,A=Math.max(u,f);if(!a.includeChildren&&v===1&&A===this.lastOffset)return[this.root];let C=[];for(let P=v;P<=A;P++){const z=this.atoms[P];vp(this,z,v,A)&&C.push(z)}return a.includeChildren||(C=C.filter(P=>{let z=!1,{parent:Q}=P;for(;Q&&!z;)z=vp(this,Q,v,A),Q=Q.parent;return!z})),C}getAllAtoms(e=0){const r=[],n=this.lastOffset;for(let a=e;a<=n;a++)r.push(this.atoms[a]);for(let a=0;a<e;a++)r.push(this.atoms[a]);return r}findAtom(e,r=0,n="forward"){let a;const u=this.lastOffset;if(n==="forward"){for(let f=r;f<=u;f++)if(a=this.atoms[f],e(a))return a;for(let f=0;f<r;f++)if(a=this.atoms[f],e(a))return a;return}for(let f=r;f>=0;f--)if(a=this.atoms[f],e(a))return a;for(let f=u;f>r;f--)if(a=this.atoms[f],e(a))return a}extractAtoms(e){let r=this.getAtoms(e);if(r.length===1&&!r[0].parent)if(r[0].type==="root")r=[...r[0].body],r.shift();else return r=this.root.cells.flat(),this.root=new $t({type:"root",body:[]}),r;for(const n of r)n.parent.removeChild(n);return r}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,r){const n=r!=null?r:"latex";if(n.startsWith("latex"))return $t.serialize([e],{expandMacro:n==="latex-expanded",skipStyles:n==="latex-unstyled",skipPlaceholders:n==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(n==="math-ml")return ln(e);if(n==="spoken")return V0(e);if(n==="spoken-text"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const u=V0(e);return window.MathfieldElement.textToSpeechMarkup=a,u}if(n==="spoken-ssml"||n==="spoken-ssml-with-highlighting"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const u=V0(e);return window.MathfieldElement.textToSpeechMarkup=a,u}return n==="ascii-math"?cs(e):(console.error(`MathLive 0.98.5: Unexpected format "${n}`),"")}getValue(e,r,n){if(e===void 0)return this.atomToString(this.root,"latex");if(typeof e=="string"&&e!=="math-json")return this.atomToString(this.root,e);let a,u;if(pa(e)&&pa(r)?(a=[this.normalizeRange([e,r])],u=n):js(e)?(a=[this.normalizeRange(e)],u=r):_0(e)?(a=e.ranges,u=r):(a=[this.normalizeRange([0,-1])],u=e),u!=null||(u="latex"),u==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const f=this.getValue({ranges:a},"latex-unstyled");try{const v=window.MathfieldElement.computeEngine.parse(f);return JSON.stringify(v.json)}catch(v){return JSON.stringify(["Error",`'${v.toString()}'`])}}if(u.startsWith("latex")){const f={expandMacro:u==="latex-expanded",skipStyles:u==="latex-unstyled",skipPlaceholders:u==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return Xi(a.map(v=>$t.serialize(this.getAtoms(v),f)))}return a.map(f=>this.getAtoms(f).map(v=>this.atomToString(v,u)).join("")).join("")}extendSelectionTo(e,r){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const n=this.normalizeRange([e,r]);let[a,u]=n,{parent:f}=this.at(u);if(f&&(f.type==="genfrac"||f.type==="subsup"))for(;f!==this.root&&ff(this,f,[a,u]);)u=this.offsetOf(f),f=f.parent;for(f=this.at(a).parent;f!==this.root&&ff(this,f,[a,u]);)a=this.offsetOf(f.leftSibling),f=f.parent;if(f=this.at(u).parent,(f==null?void 0:f.type)==="genfrac")for(;f!==this.root&&ff(this,f,[a,u]);)u=this.offsetOf(f),console.assert(u>=0),f=f.parent;this._position=this.normalizeOffset(r),this._selection={ranges:[[a,u]],direction:"none"}})}announce(e,r,n=[]){var a,u;((u=(a=this.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:r,atoms:n},cancelable:!0,bubbles:!0,composed:!0})))!=null?u:!0)&&fg(this.mathfield,e,r,n)}deferNotifications(e,r){const n=this._selection,a=this._anchor,u=this._position,f=this.silenceNotifications;this.silenceNotifications=!0;const v=this.root.changeCounter;r();const A=this.root.changeCounter!==v,C=a!==this._anchor||u!==this._position||ad(this._selection,n)==="different";return this.silenceNotifications=f,e.content&&A&&this.contentDidChange({inputType:e.type}),e.selection&&C&&this.selectionDidChange(),A||C}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[r,n]=e;return r=this.normalizeOffset(r),n=this.normalizeOffset(n),r<n?[r,n]:[n,r]}normalizeSelection(e,r){var n;let a;if(pa(e)){const u=this.normalizeOffset(e);if(pa(r)){const f=this.normalizeOffset(r);a=u<=f?{ranges:[[u,f]],direction:"none"}:{ranges:[[f,u]],direction:"backward"}}else a={ranges:[[u,u]],direction:"none"}}else if(js(e)){const u=this.normalizeOffset(e[0]),f=this.normalizeOffset(e[1]);a=u<=f?{ranges:[[u,f]],direction:"none"}:{ranges:[[f,u]],direction:"backward"}}else _0(e)&&(a={ranges:e.ranges.map(u=>this.normalizeRange(u)),direction:(n=e.direction)!=null?n:"none"});return console.assert(a!==void 0),a}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&e.type!=="array";)e=e.parent;if(e.type==="array")return e}}get cell(){var e;let r=this.at(this.position);if(r){for(;r&&((e=r.parent)==null?void 0:e.type)!=="array";)r=r.parent;if(!(!(r!=null&&r.parent)||r.parent.type!=="array"))return r.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const r=this.silenceNotifications;this.silenceNotifications=!0;const n=this.mathfield.onContentWillChange(e);return this.silenceNotifications=r,n}contentDidChange(e){var r;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Vo(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const n=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",d($({},e),{data:e.data?e.data:(r=e.inputType)!=null?r:"",bubbles:!0,composed:!0}))),this.silenceNotifications=n}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Vo(this.mathfield)),this.silenceNotifications))return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function vp(e,r,n,a){const u=e.offsetOf(r);if(u<n||u>a)return!1;if(!r.hasChildren)return!0;const f=e.offsetOf(r.firstChild);if(f>=n&&f<=a){const v=e.offsetOf(r.lastChild);if(v>=n&&v<=a)return!0}return!1}function ff(e,r,n){if(!(r!=null&&r.hasChildren))return!1;const[a,u]=n,f=e.offsetOf(r.firstChild),v=e.offsetOf(r.lastChild);return f>=a&&f<=u&&v>=f&&v<=u}function Pc(e,r,n,a){var u,f,v,A,C,P;const z=n.parent;if(z&&n instanceof Zn){const Q=!a&&r==="forward"||a==="body"&&r==="backward";let _e=Q?e.offsetOf(n.firstChild):e.offsetOf(n.lastChild);return Q?n.rightDelim!=="?"&&n.rightDelim!=="."?(n.leftDelim=".",n.isDirty=!0):(z.addChildrenAfter(n.removeBranch("body"),n),z.removeChild(n),_e--):n.leftDelim!=="?"&&n.leftDelim!=="."?(n.rightDelim=".",n.isDirty=!0):(z.addChildrenAfter(n.removeBranch("body"),n),z.removeChild(n),_e--),e.position=_e,!0}if(z&&n.type==="surd"){if(r==="forward"&&!a||r==="backward"&&a==="body"){const Q=n.leftSibling;n.hasChildren&&z.addChildrenAfter(n.removeBranch("body"),n),z.removeChild(n),e.position=e.offsetOf(Q)}else r==="forward"&&a==="body"?e.position=e.offsetOf(n):!a&&r==="backward"?n.hasChildren?e.position=e.offsetOf(n.lastChild):(e.position=Math.max(0,e.offsetOf(n)-1),z.removeChild(n)):a==="above"&&(n.hasEmptyBranch("above")&&n.removeBranch("above"),r==="backward"?e.position=e.offsetOf(n.leftSibling):e.position=e.offsetOf(n.body[0]));return!0}if(z&&(n.type==="box"||n.type==="enclose")){const Q=a&&r==="backward"||!a&&r==="forward"?n.leftSibling:n.lastChild;return z.addChildrenAfter(n.removeBranch("body"),n),z.removeChild(n),e.position=e.offsetOf(Q),!0}if(n.type==="genfrac"||n.type==="overunder"){if(!a)return n.type==="overunder"&&n.hasEmptyBranch("body")||n.type==="genfrac"&&n.hasEmptyBranch("below")&&n.hasEmptyBranch("above")?!1:(e.position=e.offsetOf(r==="forward"?n.firstChild:n.lastChild),!0);const Q=Oc.fractionNavigationOrder==="numerator-denominator"?"above":"below",_e=Q==="above"?"below":"above";if(z&&(r==="forward"&&a===Q||r==="backward"&&a===_e)){const Ie=n.removeBranch(Q),ze=n.removeBranch(_e);return z.addChildrenAfter([...Ie,...ze],n),z.removeChild(n),e.position=e.offsetOf(Ie.length>0?Ie[Ie.length-1]:ze[0]),!0}return r==="backward"?e.position=e.offsetOf(n.leftSibling):e.position=e.offsetOf(n),!0}if(n.isExtensibleSymbol||n.type==="subsup"){if(!a&&r==="forward")return!1;if(!a){if(n.subscript||n.superscript){const Q=r==="forward"?(v=(u=n.superscript)==null?void 0:u[0])!=null?v:(f=n.subscript)==null?void 0:f[0]:(P=(A=n.subscript)==null?void 0:A[0].lastSibling)!=null?P:(C=n.superscript)==null?void 0:C[0].lastSibling;return Q&&(e.position=e.offsetOf(Q)),!0}return!1}if(!n.hasChildren&&n.type==="subsup"){const Q=r==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);return n.parent.removeChild(n),e.position=Q,!0}if(a==="superscript")if(r==="backward"){const Q=e.offsetOf(n.firstChild)-1;console.assert(Q>=0),e.position=Q}else n.subscript?e.position=e.offsetOf(n.subscript[0]):e.position=e.offsetOf(n);else a==="subscript"&&(r==="backward"&&n.superscript?e.position=e.offsetOf(n.superscript[0].lastSibling):r==="backward"?e.position=e.offsetOf(n.firstChild)-1:e.position=e.offsetOf(n));if(a&&n.hasEmptyBranch(a)&&(n.removeBranch(a),n.type==="subsup"&&!n.subscript&&!n.superscript)){const Q=r==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);n.parent.removeChild(n),e.position=Q}return!0}if((z==null?void 0:z.type)==="genfrac"&&!a&&n.type!=="first"){let Q=e.offsetOf(n.leftSibling);return z.removeChild(n),z.hasEmptyBranch("above")&&z.hasEmptyBranch("below")?(Q=e.offsetOf(z.leftSibling),z.parent.removeChild(z),e.announce("delete",void 0,[z]),e.position=Q,!0):(e.announce("delete",void 0,[n]),e.position=Q,!0)}if(r==="backward"&&((z==null?void 0:z.command)==="\\ln"||(z==null?void 0:z.command)==="\\log")&&n.parentBranch!=="body"){const Q=e.offsetOf(z.leftSibling);return z.parent.removeChild(z),e.announce("delete",void 0,[z]),e.position=Q,!0}return!1}function vg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentBackward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let r=e.at(e.position);if(!(r&&Pc(e,"backward",r))){if(r!=null&&r.isFirstSibling){if(Pc(e,"backward",r.parent,r.parentBranch))return;r=null}if(!r){e.announce("plonk");return}e.position=e.offsetOf(r.leftSibling),r.parent.removeChild(r),e.announce("delete",void 0,[r])}}):jo(e,Ds(e.selection),"deleteContentBackward")}function yg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentForward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var r,n;let a=e.at(e.position).rightSibling;if(a&&Pc(e,"forward",a))return;if(a){if(e.at(e.position).isLastSibling&&Pc(e,"forward",a.parent,a.parentBranch))return}else{if(a=e.at(e.position),a.isLastSibling&&Pc(e,"forward",a.parent,a.parentBranch))return;a=void 0}if(e.position===e.lastOffset||!a){e.announce("plonk");return}a.parent.removeChild(a);let u=(r=e.at(e.position))==null?void 0:r.rightSibling;for(;(u==null?void 0:u.type)==="subsup";)u.parent.removeChild(u),u=(n=e.at(e.position))==null?void 0:n.rightSibling;e.announce("delete",void 0,[a])}):jo(e,Ds(e.selection),"deleteContentForward")}function jo(e,r,n){const a=e.getAtoms(r);if(a.length>0&&a[0].parent){let u=a[0].parent.firstChild;u.type==="first"&&(u=u.rightSibling);const f=a[a.length-1].parent.lastChild;let v=a[0];v.type==="first"&&(v=v.rightSibling);const A=a[a.length-1];if(v===u&&A===f){const C=a[0].parent;C.parent&&C.type!=="prompt"&&(r=[e.offsetOf(C.leftSibling),e.offsetOf(C)])}if(a.length===1&&a[0].type==="placeholder"&&a[0].parent.type==="genfrac"){const C=a[0].parent,P=a[0].parentBranch==="below"?"above":"below",z=e.offsetOf(C.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:n},()=>{var Q,_e;const Ie=C.removeBranch(P);if(Ie.length===1&&Ie[0].type==="placeholder")(_e=C.parent)==null||_e.removeChild(C),e.position=Math.max(0,z);else{const ze=C.parent.addChildrenAfter(Ie,C);(Q=C.parent)==null||Q.removeChild(C),e.position=e.offsetOf(ze)}})}}return e.deferNotifications({content:!0,selection:!0,type:n},()=>e.deleteAtoms(r))}Ta({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&jo(e,[0,-1],"deleteContent"),deleteForward:e=>yg(e),deleteBackward:e=>vg(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&jo(e,[e.anchor,Ud(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&jo(e,[e.anchor,Ud(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&jo(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&jo(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&jo(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&jo(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var bg=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${ue("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,_g=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${ue("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,xg=class{constructor(e,r){this.focusBlurInProgress=!1;var n,a,u;this.options=$(d($({},Ch()),{macros:_r(),registers:Bu()}),Th(r)),this.eventController=new AbortController;const f=this.eventController.signal;r.eventSink&&(this.host=r.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let v=(a=(n=r.value)!=null?n:this.element.textContent)!=null?a:"";v=v.trim();const A=Lf(this.options),C=new $t({type:"root",mode:A,body:Us(v,{context:this.context})});this.model=new gg(this,A,C),this.undoManager=new W1(this.model);const P=[];if(P.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),P.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),P.push("<span part=content class=ML__content>"),P.push(Sf(this)),P.push("</span>"),window.mathVirtualKeyboard&&(P.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),P.push(bg),P.push("</div>")),P.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),P.push(_g),P.push("</div>"),P.push("</span>"),P.push("<span class=ML__sr-only>"),P.push("<span role=status aria-live=assertive aria-atomic=true></span>"),P.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(P.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=Y.subscribe(()=>Y.update(this.element)),Y.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Q=>Q.stopImmediatePropagation(),{capture:!1,signal:f}),this.field.addEventListener("wheel",this,{passive:!1,signal:f}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:f}):this.field.addEventListener("mousedown",this,{signal:f}),(u=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||u.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Vo(this)))},{signal:f}),this._menu=new Lm(og(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:f});const z=this.element.querySelector("[part=menu-toggle]");z==null||z.addEventListener("pointerdown",Q=>{if(Q.currentTarget!==z||this._menu.state!=="closed")return;this.element.classList.add("tracking");const _e=z.getBoundingClientRect();this._menu.modifiers=yi(Q),this._menu.show({target:z,location:{x:_e.left,y:_e.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Q.preventDefault(),Q.stopPropagation()},{signal:f}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(z.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=ia(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:f}),document.addEventListener("scroll",this,{signal:f}),this.resizeObserver=new ResizeObserver(()=>ns(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:f}),dr&&!Y.locale.startsWith(dr.locale)&&di(Y.locale),Pa!=="ready"&&document.fonts.ready.then(()=>wh(this)),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const e=this.model.at(this.model.position),r=this.adoptStyle==="right"?e.rightSibling:e;if(!r)return this.defaultStyle;if(r.type==="group"){const n=r.branch("body");return!n||n.length<2?{}:this.adoptStyle==="right"?n[1].computedStyle:n[n.length-1].computedStyle}return r.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Vo(this)),zh(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Jd())}showMenu(e){var r,n;const a=(n=(r=e==null?void 0:e.location)!=null?r:Sa(this.field))!=null?n:void 0,u=e==null?void 0:e.modifiers,f=this.element.querySelector("[part=container]");return this._menu.show({target:f,location:a,modifiers:u})}get colorMap(){return e=>{var r,n,a;return(a=(n=(r=this.options).colorMap)==null?void 0:n.call(r,e))!=null?a:ut(e)}}get backgroundColorMap(){return e=>{var r,n,a,u,f,v;return(v=(f=(n=(r=this.options).backgroundColorMap)==null?void 0:n.call(r,e))!=null?f:(u=(a=this.options).colorMap)==null?void 0:u.call(a,e))!=null?v:pt(e)}}get smartFence(){var e;return(e=this.options.smartFence)!=null?e:!1}get readOnly(){var e;return(e=this.options.readOnly)!=null?e:!1}get disabled(){var e,r;return(r=(e=this.host)==null?void 0:e.disabled)!=null?r:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(e=>e.type==="prompt"&&!e.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const e=this.model.at(this.model.anchor),r=this.model.at(this.model.position),n=$t.commonAncestor(e,r);return!!((n==null?void 0:n.type)==="prompt"||n!=null&&n.parentPrompt)}get letterShapeStyle(){var e;return(e=this.options.letterShapeStyle)!=null?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};const r=$({},e[0].style);for(const n of e)for(const[a,u]of Object.entries(n.style))r[a]!==u&&delete r[a];return r}queryStyle(e){const r=jd(this,e);"verbatimColor"in r&&delete r.verbatimColor,"verbatimBackgroundColor"in r&&delete r.verbatimBackgroundColor;const n=Object.keys(r).length;if(n===0)return"all";if(n>1){for(const C of Object.keys(r)){const P=this.queryStyle({[C]:r[C]});if(P==="none")return"none";if(P==="some")return"some"}return"all"}const a=Object.keys(r)[0],u=r[a];if(this.model.selectionIsCollapsed)return this.effectiveStyle[a]===u?"all":"none";const f=this.model.getAtoms(this.model.selection,{includeChildren:!0});let v=f.length;if(v===0)return"none";let A=0;for(const C of f){if(C.type==="first"){v-=1;continue}C.style[a]===u&&(A+=1)}return A===0?"none":A===v?"all":"some"}get keybindings(){var e,r;if(this._keybindings)return this._keybindings;const[n,a]=Ks(this.options.keybindings,(e=ti())!=null?e:mr());return((r=ti())==null?void 0:r.score)>0&&(this._keybindings=n,a.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",a)),n}get menu(){return this._menu}setOptions(e){var r;this.options=$($({},this.options),Th(e)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let n=this.options.defaultMode;n==="inline-math"&&(n="math"),((r=this.model.root.firstChild)==null?void 0:r.mode)!==n&&(this.model.root.firstChild.mode=n),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const a=$t.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==a)&&Rn.insert(this.model,a,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&ns(this)}getOptions(e){return Zu(this.options,e)}getOption(e){return Zu(this.options,e)}handleEvent(e){return du(this,null,function*(){var r;if(Oo(this)){if(Fd(e)){if(!lc(e.origin,(r=this.options.originValidator)!=null?r:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");const{action:n}=e.data;if(n==="execute-command"){const a=e.data.command;if(F0(a)==="virtual-keyboard")return;this.executeCommand(a)}else n==="update-state"||(n==="focus"?this.focus({preventScroll:!0}):n==="blur"&&this.blur());return}switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Wf(this,e);break;case"pointerdown":this.userSelect!=="none"&&(Wf(this,e),e.shiftKey===!1&&(yield ap(e,this.element.querySelector("[part=container]"),this._menu))&&Bh.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield ap(e,this.element.querySelector("[part=container]"),this._menu))&&Bh.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&zh(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Oo(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Oo(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!Oo(this))return;Y.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const e=this.element;delete e.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,im(),l1(),Em()}flushInlineShortcutBuffer(e){if(e!=null||(e={defer:!1}),!e.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(e){return F0(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Vo(this))),!1):m1(this,e)}get errors(){return gc(this.model.getValue(),{context:this.context})}getValue(e,r,n){return this.model.getValue(e,r,n)}setValue(e,r){var n;r=r!=null?r:{mode:"math"},r.insertionMode===void 0&&(r.insertionMode="replaceAll"),(r.format===void 0||r.format==="auto")&&(r.format="latex"),(r.mode===void 0||r.mode==="auto")&&(r.mode=(n=Zc(this.model,this.model.position))!=null?n:"math");const a=this.undoManager.canUndo();Rn.insert(this.model,e,r)&&(ns(this),a||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const a=window.mathVirtualKeyboard.boundingRect,u=this.host.getBoundingClientRect();u.bottom>a.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,u.bottom-a.top+8))}}this.dirty&&ju(this,{interactive:!0});const r=this.field.getBoundingClientRect();let n=null;if(this.model.selectionIsCollapsed)n=Sa(this.field);else{const a=oc(this);if(a.length>0){let u=-1/0,f=-1/0;for(const v of a)v.right>u&&(u=v.right),v.top<f&&(f=v.top);n={x:u+r.left-this.field.scrollLeft,y:f+r.top-this.field.scrollTop,height:0}}}if(this.host&&n){const a=this.host.getBoundingClientRect(),u=n.y;let f=this.host.scrollTop;u<a.top?f=u-a.top+this.host.scrollTop:u>a.bottom&&(f=u-a.bottom+this.host.scrollTop+n.height),this.host.scroll({top:f,left:0})}if(n){const a=n.x-window.scrollX;let u=this.field.scrollLeft;a<r.left?u=a-r.left+this.field.scrollLeft-20:a>r.right&&(u=a-r.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:u})}}insert(e,r){return typeof e!="string"||e.length===0&&((r==null?void 0:r.insertionMode)==="insertBefore"||(r==null?void 0:r.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),r=r!=null?r:{mode:"math"},r.focus&&this.focus(),r.feedback&&(window.MathfieldElement.keypressVibration&&se()&&navigator.vibrate(Ef),window.MathfieldElement.playSound("keypress")),e==="\\\\"?Rf(this.model):e==="&"?If(this.model):this.model.selectionIsCollapsed?Rn.insert(this.model,e,$({style:this.model.at(this.model.position).computedStyle},r)):Rn.insert(this.model,e,r),this.snapshot(`insert-${this.model.at(this.model.position).type}`),ns(this),r.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,r="",n=""){var a;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const u=this.model.mode;if(this.model.mode=e,!((a=this.host)!=null&&a.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=u;return}const f=this.model.mode,{model:v}=this;v.deferNotifications({content:!!n||!!r,selection:!0,type:"insertText"},()=>{let A=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),r&&e!=="latex"){const C=Us(r,{context:this.context,parseMode:e});v.collapseSelection("forward");const P=v.at(v.position);v.position=v.offsetOf(P.parent.addChildrenAfter(C,P)),A=!0}if(this.model.mode=e,e==="latex"){let C=v.selectionIsCollapsed;Cl(this,"accept");let P,z=v.at(v.position);if(C)P="\\";else{const _e=Ds(v.selection);P=this.model.getValue(_e,"latex");const Ie=this.model.extractAtoms(_e);Ie.length===1&&Ie[0].type==="placeholder"&&(P=r,C=!0),z=v.at(_e[0])}const Q=new Hu(P);z.parent.addChildAfter(Q,z),C?v.position=v.offsetOf(Q.lastChild):v.setSelection(v.offsetOf(Q.firstChild),v.offsetOf(Q.lastChild))}else Zs(v).forEach(C=>{C.isError=!1});if(n){const C=Us(n,{context:this.context,parseMode:f});v.collapseSelection("forward");const P=v.at(v.position);v.position=v.offsetOf(P.parent.addChildrenAfter(C,P)),A=!0}return ns(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),A}),this.model.mode=e,window.mathVirtualKeyboard.update(Vo(this))}hasFocus(){return!this.blurred}focus(e){var r;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(r=e==null?void 0:e.preventScroll)!=null&&r||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,r={}){var n,a;const u={operation:"set",silenceNotifications:!1};js(r)?u.range=r:(r.operation==="toggle"&&(u.operation="toggle"),u.range=r.range,u.silenceNotifications=(n=r.silenceNotifications)!=null?n:!1);const f=jd(this,e),v=(a=u.operation)!=null?a:"set";if(u.range===void 0&&this.model.selectionIsCollapsed){if(v==="set"){this.defaultStyle=$($({},this.defaultStyle),f);return}const A=$({},this.defaultStyle);for(const C of Object.keys(f))A[C]===f[C]?(C==="color"&&delete A.verbatimColor,C==="backgroundColor"&&delete A.verbatimBackgroundColor,delete A[C]):A[C]=f[C];this.defaultStyle=A;return}this.model.deferNotifications({content:!u.silenceNotifications,type:"insertText"},()=>{if(u.range===void 0)for(const A of this.model.selection.ranges)$d(this.model,A,f,{operation:v});else $d(this.model,u.range,f,{operation:v})}),ns(this)}toggleContextMenu(){var e;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var r;return(r=this.element)==null?void 0:r.focus()}}),!0):!1}getCaretPoint(){const e=Sa(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,r){const n=Dc(this,e,r,{bias:0});if(n<0)return!1;const a=this.model.position;return this.model.position=n,this.model.announce("move",a),ns(this),!0}getPrompt(e){const r=this.model.findAtom(n=>n.type==="prompt"&&n.placeholderId===e);return console.assert(r!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),r}getPromptValue(e,r){const n=this.getPrompt(e);if(!n)return"";const a=this.model.offsetOf(n.firstChild),u=this.model.offsetOf(n.lastChild);return this.model.getValue(a,u,r)}getPrompts(e){return this.model.getAllAtoms().filter(r=>r.type!=="prompt"?!1:e?!(e.id&&r.placeholderId!==e.id||e.locked&&r.locked!==e.locked||e.correctness==="undefined"&&r.correctness||e.correctness&&r.correctness!==e.correctness):!0).map(r=>r.placeholderId)}setPromptValue(e,r,n){if(r!==void 0){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}const u=this.model.getBranchRange(this.model.offsetOf(a),"body");this.model.setSelection(u),this.insert(r,d($({},n),{insertionMode:"replaceSelection"}))}n!=null&&n.silenceNotifications&&(this.valueOnFocus=this.getValue()),ns(this)}setPromptState(e,r,n){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}r==="undefined"?a.correctness=void 0:typeof r=="string"&&(a.correctness=r),typeof n=="boolean"&&(a.locked=n,a.captureSelection=n),ns(this)}getPromptState(e){const r=this.getPrompt(e);return r?[r.correctness,r.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const r=this.getPrompt(e);return r?this.model.getBranchRange(this.model.offsetOf(r),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var r;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Vo(this)),(r=this.host)==null||r.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Vo(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Vo(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;(e=this.undoManager)==null||e.reset()}onSelectionDidChange(){var e,r;const n=this.model;this.keyboardDelegate.setValue(n.getValue(this.model.selection,"latex-expanded"));{const a=n.at(n.position),u=(e=a.mode)!=null?e:Lf(this.options);this.model.mode!==u&&(this.model.mode==="latex"?(Cl(this,"accept",{mode:u}),n.position=n.offsetOf(a)):this.switchMode(u))}(r=this.host)==null||r.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Vo(this)),zh(this)}onContentWillChange(e){var r,n,a;return(a=(n=this.host)==null?void 0:n.dispatchEvent(new InputEvent("beforeinput",d($({},e),{data:e.data?e.data:(r=e.inputType)!=null?r:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?a:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),ju(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var e,r,n;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",B0(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(r=this.host)==null||r.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(n=this.host)==null||n.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),ns(this),this.focusBlurInProgress=!1,Jd();const a=new AbortController,u=a.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Oo(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:u})},{once:!0,signal:u}),setTimeout(()=>a.abort(),100)}onInput(e){Gd(this,e)}onKeystroke(e){return Hf(this,e)}onCompositionStart(e){this.model.deleteAtoms(Ds(this.model.selection));const r=Sa(this.field);r&&requestAnimationFrame(()=>{ju(this),this.keyboardDelegate.moveTo(r.x,r.y-r.height)})}onCompositionUpdate(e){F1(this.model,e),ns(this)}onCompositionEnd(e){N1(this.model),Gd(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Rn.onCopy(this,e),jo(this.model,Ds(this.model.selection),"deleteByCut"),this.snapshot("cut"),ns(this))}onCopy(e){Rn.onCopy(this,e)}onPaste(e){let r=this.isSelectionEditable;return r&&(r=Rn.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),r||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),r}onGeometryChange(){this._menu.hide(),Ko(this),zh(this)}onWheel(e){const r=5*e.deltaX;if(!Number.isFinite(r)||r===0)return;const n=this.field;r<0&&n.scrollLeft===0||r>0&&n.offsetWidth+n.scrollLeft>=n.scrollWidth||(n.scrollBy({top:0,left:r}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let r=e;for(;!r.id&&r.hasChildren;)r=e.children[0];return this.field.querySelector(`[data-atom-id="${r.id}"]`)}get context(){var e,r;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(r=this.options.placeholderSymbol)!=null?r:"\u25A2",colorMap:n=>this.colorMap(n),backgroundColorMap:n=>this.backgroundColorMap(n),getMacro:n=>Pt(n,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function yp(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const r of e.children)yp(r)}function pf(e,r){var n;e&&(!r||((n=e.dataset)==null?void 0:n.atomId)===r?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&pf(a)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&pf(a,r)})))}function wg(e,r){var n;if(!O())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(r);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),u={OutputFormat:"json",VoiceId:(n=window.MathfieldElement.speechEngineVoice)!=null?n:"Joanna",Engine:"standard",Text:r,TextType:"ssml",SpeechMarkTypes:["ssml"]};hu().readAloudElement=e,a.synthesizeSpeech(u,(f,v)=>{if(f){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${f}`);return}if(!(v!=null&&v.AudioStream)){console.log("polly.synthesizeSpeech():",v);return}const A=new TextDecoder("utf-8").decode(new Uint8Array(v.AudioStream));hu().readAloudMarks=A.split(`
`).map(C=>C?JSON.parse(C):{}),hu().readAloudTokens=[];for(const C of hu().readAloudMarks)C.value&&hu().readAloudTokens.push(C.value);hu().readAloudCurrentMark="",u.OutputFormat="mp3",u.SpeechMarkTypes=[],a.synthesizeSpeech(u,(C,P)=>{if(C){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${r}") error:${C}`);return}if(!(P!=null&&P.AudioStream))return;const z=new Uint8Array(P.AudioStream),Q=new Blob([z.buffer],{type:"audio/mpeg"}),_e=URL.createObjectURL(Q),Ie=hu();Ie.readAloudAudio?Ie.readAloudAudio.pause():(Ie.readAloudAudio=new Audio,Ie.readAloudAudio.addEventListener("ended",()=>{const ze=Ie.readAloudMathfield;Ie.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),ze?(ju(ze),Ie.readAloudElement=null,Ie.readAloudMathfield=null,Ie.readAloudTokens=[],Ie.readAloudMarks=[],Ie.readAloudCurrentMark=""):yp(Ie.readAloudElement)}),Ie.readAloudAudio.addEventListener("timeupdate",()=>{let ze="";const St=Ie.readAloudAudio.currentTime*1e3+100;for(const sr of Ie.readAloudMarks)sr.time<St&&(ze=sr.value);Ie.readAloudCurrentMark!==ze&&(Ie.readAloudCurrentToken=ze,ze&&ze===Ie.readAloudFinalToken?Ie.readAloudAudio.pause():(Ie.readAloudCurrentMark=ze,pf(Ie.readAloudElement,Ie.readAloudCurrentMark)))})),Ie.readAloudAudio.src=_e,Ie.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Ie.readAloudAudio.play()})})}O()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var en=new WeakMap,Sg=.5,cu={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},$s=class i0 extends HTMLElement{static get formAssociated(){return q0()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(r){r!==this._fontsDirectory&&(this._fontsDirectory=r,h1())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(r){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(r){this._soundsDirectory=r,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(r){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(r){var n,a,u;this.audioBuffers={},r===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof r=="string"?this._keypressSound={spacebar:r,return:r,delete:r,default:r}:typeof r=="object"&&"default"in r&&(this._keypressSound={spacebar:(n=r.spacebar)!=null?n:r.default,return:(a=r.return)!=null?a:r.default,delete:(u=r.delete)!=null?u:r.default,default:r.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(r){this.audioBuffers={},this._plonkSound=r}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(r){this._speechEngine=r}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(r){this._speechEngineRate=r}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(r){this._speechEngineVoice=r}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(r){this._textToSpeechMarkup=r}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(r){this._textToSpeechRules=r}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(r){this._textToSpeechRulesOptions=r}static get locale(){return Y.locale}static set locale(r){r==="auto"&&(r=navigator.language.slice(0,5)),Y.locale=r}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(r){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return Y.strings}static set strings(r){Y.merge(r)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(r){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(r){this._decimalSeparator=r,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(r){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var r,n;if(this._computeEngine===void 0){const a=(r=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:r.ComputeEngine;if(!a)return null;this._computeEngine=new a,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(n=this._computeEngine)!=null?n:null}static set computeEngine(r){this._computeEngine=r}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(r){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(r){this._isFunction=r}static loadSound(r){return du(this,null,function*(){delete this.audioBuffers[r];let n="";switch(r){case"keypress":n=this._keypressSound.default;break;case"return":n=this._keypressSound.return;break;case"spacebar":n=this._keypressSound.spacebar;break;case"delete":n=this._keypressSound.delete;break;case"plonk":n=this.plonkSound;break}if(typeof n!="string")return;n=n.trim();const a=this.soundsDirectory;if(!(a==null||a==="null"||n==="none"||n==="null"))try{const f=yield(yield fetch(yield wf(`${a}/${n}`))).arrayBuffer(),v=yield this.audioContext.decodeAudioData(f);this.audioBuffers[r]=v}catch(u){}})}static playSound(r){return du(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[r]||(yield this.loadSound(r)),!this.audioBuffers[r])return;const n=this.audioContext.createBufferSource();n.buffer=this.audioBuffers[r];const a=this.audioContext.createGain();a.gain.value=Sg,n.connect(a).connect(this.audioContext.destination),n.start()})}constructor(r){if(super(),r){const n=[];for(const a of Object.keys(r))if(cu[a])if(cu[a].startsWith("mf."))if(cu[a].startsWith(`mf.${a}`))n.push(`Option \`${a}\` cannot be used as a constructor option. Use ${cu[a]}`);else{const u=cu[a].match(/([a-zA-Z]+) =/);n.push(`Option \`${a}\` has been renamed \`${u[1]}\``)}else n.push(`Option \`${a}\` cannot be used as a constructor option. Use ${cu[a]}`);if(n.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const a of n)console.warn(a);console.groupEnd()}}if(q0()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[Ea("core"),Ea("mathfield"),Ea("mathfield-element"),Ea("ui"),Ea("menu")],this.shadowRoot.appendChild(document.createElement("span"));const n=document.createElement("slot");n.style.display="none",this.shadowRoot.appendChild(n)}else this.shadowRoot.innerHTML="<style>"+xl("core")+xl("mathfield")+xl("mathfield-element")+xl("ui")+xl("menu")+'</style><span></span><slot style="display:none"></slot>';r&&this._setOptions(r),this.shadowRoot.addEventListener("slotchange",()=>{var n;const a=this.shadowRoot.querySelector("slot:not([name])");this.value=(n=a==null?void 0:a.assignedNodes().map(u=>u.nodeType===3?u.textContent:"").join("").trim())!=null?n:""})}showMenu(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.showMenu(r))!=null?a:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",r=>{var n;r.target===this&&!((n=this._mathfield)!=null&&n.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:r.altKey,button:r.button,buttons:r.buttons,clientX:r.clientX,clientY:r.clientY,ctrlKey:r.ctrlKey,metaKey:r.metaKey,movementX:r.movementX,movementY:r.movementY,relatedTarget:r.relatedTarget,screenX:r.screenX,screenY:r.screenY,shiftKey:r.shiftKey}))},{once:!0})}getPromptValue(r,n){var a,u;return(u=(a=this._mathfield)==null?void 0:a.getPromptValue(r,n))!=null?u:""}setPromptValue(r,n,a){var u;(u=this._mathfield)==null||u.setPromptValue(r,n,a)}getPromptRange(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPromptRange(r))!=null?a:null}getPrompts(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPrompts(r))!=null?a:[]}get form(){var r;return(r=this._internals)==null?void 0:r.form}get name(){var r;return(r=this.getAttribute("name"))!=null?r:""}get type(){return this.localName}get mode(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.model.mode)!=null?n:this.defaultMode==="text"?"text":"math"}set mode(r){var n;(n=this._mathfield)==null||n.switchMode(r)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(r){var n,a;if(!this._mathfield)return;const u=(a=(n=i0.computeEngine)==null?void 0:n.box(r).latex)!=null?a:null;u!==null&&this._mathfield.setValue(u),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.errors)!=null?n:[]}_getOptions(r){return this._mathfield?Zu(this._mathfield.options,r):en.has(this)?$({},Zu($($({},Ch()),Th(en.get(this).options)),r)):null}getOptions(r){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?Zu(this._mathfield.options,r):en.has(this)?Zu($($({},Ch()),Th(en.get(this).options)),r):null}reflectAttributes(){const r=Ch(),n=this._getOptions();Object.keys(i0.optionsAttributes).forEach(a=>{const u=Ml(a);i0.optionsAttributes[a]==="on/off"?r[u]!==n[u]?this.setAttribute(a,n[u]?"on":"off"):this.removeAttribute(a):r[u]!==n[u]&&(i0.optionsAttributes[a]==="boolean"?n[u]?this.setAttribute(a,""):this.removeAttribute(a):(typeof n[u]=="string"||typeof n[u]=="number")&&this.setAttribute(a,n[u].toString()))})}getOption(r){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([r])[r]}_getOption(r){return this._getOptions([r])[r]}_setOptions(r){if(this._mathfield)this._mathfield.setOptions(r);else if(en.has(this)){const n=$($({},en.get(this).options),r);en.set(this,d($({},en.get(this)),{selection:{ranges:n.readOnly?[[0,0]]:[[0,-1]]},options:n}))}else en.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:r,menuItems:void 0});this.reflectAttributes()}setOptions(r){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const n of Object.keys(r))cu[n]&&console.warn(`\`mf.setOptions({${n}:...})\` -> ${cu[n]}`);console.groupEnd(),this._setOptions(r)}executeCommand(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.executeCommand(r))!=null?a:!1}getValue(r,n,a){var u,f;if(this._mathfield)return this._mathfield.model.getValue(r,n,a);if(en.has(this)){let v,A,C;if(_0(r)?([v,A]=r.ranges[0],C=n):js(r)?([v,A]=r,C=n):pa(r)&&pa(n)?(v=r,A=n,C=a):(v=0,A=-1,C=r),(C===void 0||C==="latex")&&v===0&&A===-1)return(f=(u=en.get(this).value)!=null?u:this.textContent)!=null?f:""}return""}setValue(r,n){if(this._mathfield&&r!==void 0){n!=null||(n={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(r,n);return}if(en.has(this)){const u=en.get(this).options;en.set(this,{value:r,selection:{ranges:[[-1,-1]],direction:"forward"},options:u,menuItems:void 0});return}const a=Bc(this);en.set(this,{value:r,selection:{ranges:[[-1,-1]],direction:"forward"},options:a,menuItems:void 0})}hasFocus(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.hasFocus())!=null?n:!1}focus(){var r;(r=this._mathfield)==null||r.focus()}blur(){var r;(r=this._mathfield)==null||r.blur()}select(){var r;(r=this._mathfield)==null||r.select()}insert(r,n){var a,u;return(u=(a=this._mathfield)==null?void 0:a.insert(r,n))!=null?u:!1}applyStyle(r,n){var a;return(a=this._mathfield)==null?void 0:a.applyStyle(r,n)}queryStyle(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.queryStyle(r))!=null?a:"none"}get caretPoint(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getCaretPoint())!=null?n:null}set caretPoint(r){var n;r&&((n=this._mathfield)==null||n.setCaretPoint(r.x,r.y))}setCaretPoint(r,n){var a,u;return(u=(a=this._mathfield)==null?void 0:a.setCaretPoint(r,n))!=null?u:!1}offsetFromPoint(r,n,a){return this._mathfield?Dc(this._mathfield,r,n,a):-1}hitboxFromOffset(r){if(!this._mathfield)return null;const n=this._mathfield.model.at(r);if(!n)return null;const a=Ql(this._mathfield,n);return a?new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top):null}resetUndo(){var r;(r=this._mathfield)==null||r.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(r){var n,a,u,f;es.state==="closed"&&((a=(n=this._mathfield)==null?void 0:n.menu)==null?void 0:a.state)==="closed"&&(r.type==="pointerdown"&&this.onPointerDown(),r.type==="focus"&&((u=this._mathfield)==null||u.focus()),r.type==="blur"&&((f=this._mathfield)==null||f.blur()))}connectedCallback(){var r,n,a,u;const f=window.getComputedStyle(this),v=this.shadowRoot,A=f.userSelect!=="none";if(A)v.host.addEventListener("pointerdown",this,!0);else{const z=v.querySelector("span");z.style.pointerEvents="none"}v.host.addEventListener("focus",this,!0),v.host.addEventListener("blur",this,!0),q0()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),A&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const C=v.querySelector("slot:not([name])");if(C)try{this._style=C.assignedElements().filter(z=>z.tagName.toLowerCase()==="style").map(z=>z.textContent).join("")}catch(z){console.error(z)}if(this._style){const z=document.createElement("style");z.textContent=this._style,v.appendChild(z)}let P="";if(this.hasAttribute("value")?P=this.getAttribute("value"):P=(r=C==null?void 0:C.assignedNodes().map(z=>z.nodeType===3?z.textContent:"").join("").trim())!=null?r:"",this._mathfield=new xg(v.querySelector(":host > span"),d($({},(a=(n=en.get(this))==null?void 0:n.options)!=null?a:Bc(this)),{eventSink:this,value:P})),!en.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const z of Object.keys(i0.optionsAttributes))this.upgradeProperty(Ml(z))}if(!((u=this._mathfield)!=null&&u.model)){this._mathfield=null;return}if(en.has(this)){const z=this._mathfield,Q=en.get(this),_e=Q.menuItems;z.model.deferNotifications({content:!1,selection:!1},()=>{const Ie=Q.value;Ie!==void 0&&z.setValue(Ie),z.model.selection=Q.selection,en.delete(this)}),_e&&(this.menuItems=_e)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),xh()}disconnectedCallback(){var r,n;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const a=Zu(this._mathfield.options,Object.keys(i0.optionsAttributes).map(u=>Ml(u)));en.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(n=(r=this._mathfield.menu)==null?void 0:r.menuItems)!=null?n:void 0,options:a}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(r){if(this.hasOwnProperty(r)){const n=this[r];delete this[r],(r==="readonly"||r==="read-only")&&(r="readOnly"),this[r]=n}}attributeChangedCallback(r,n,a){if(n===a)return;const u=a!==null;switch(r){case"contenteditable":ns(this._mathfield);break;case"disabled":this.disabled=u;break;case"read-only":case"readonly":this.readOnly=u;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(r){const n=!!r;n?(this.setAttribute("readonly",""),q0()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(q0()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:n})}get disabled(){return this.hasAttribute("disabled")}set disabled(r){var n;const a=!!r;a?this.setAttribute("disabled",""):this.removeAttribute("disabled"),q0()?this._internals.ariaDisabled=a?"true":"false":this.setAttribute("aria-disabled",a?"true":"false"),a&&((n=this._mathfield)!=null&&n.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(r){this.setValue(r)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(r){this._setOptions({defaultMode:r})}get macros(){return this._getOption("macros")}set macros(r){this._setOptions({macros:r})}get registers(){const r=this;return new Proxy({},{get:(n,a)=>{if(typeof a=="string")return r._getOption("registers")[a]},set(n,a,u){return typeof a!="string"?!1:(r._setOptions({registers:d($({},r._getOption("registers")),{[a]:u})}),!0)}})}set registers(r){this._setOptions({registers:r})}get colorMap(){return this._getOption("colorMap")}set colorMap(r){this._setOptions({colorMap:r})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(r){this._setOptions({backgroundColorMap:r})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(r){this._setOptions({letterShapeStyle:r})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(r){this._setOptions({minFontScale:r})}get smartMode(){return this._getOption("smartMode")}set smartMode(r){this._setOptions({smartMode:r})}get smartFence(){return this._getOption("smartFence")}set smartFence(r){this._setOptions({smartFence:r})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(r){this._setOptions({smartSuperscript:r})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(r){this._setOptions({scriptDepth:r})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(r){this._setOptions({removeExtraneousParentheses:r})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(r){this._setOptions({mathModeSpace:r})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(r){this._setOptions({placeholderSymbol:r})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(r){this._setOptions({popoverPolicy:r})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(r){this._setOptions({environmentPopoverPolicy:r})}get menuItems(){var r,n,a;return this._mathfield?(r=this._mathfield.menu._menuItems.map(u=>u.menuItem))!=null?r:[]:(a=(n=en.get(this))==null?void 0:n.menuItems)!=null?a:[]}set menuItems(r){var n;if(this._mathfield){const a=(n=this._mathfield.element)==null?void 0:n.querySelector("[part=menu-toggle]");a&&(a.style.display=r.length===0?"none":""),this._mathfield.menu.menuItems=r}en.has(this)?en.set(this,d($({},en.get(this)),{menuItems:r})):en.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Bc(this),menuItems:r})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(r){this._setOptions({mathVirtualKeyboardPolicy:r})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(r){this._setOptions({inlineShortcuts:r})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(r){this._setOptions({inlineShortcutTimeout:r})}get keybindings(){return this._getOption("keybindings")}set keybindings(r){this._setOptions({keybindings:r})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(r){this._setOptions({onInlineShortcut:r})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(r){this._setOptions({onScrollIntoView:r})}get onExport(){return this._getOption("onExport")}set onExport(r){this._setOptions({onExport:r})}get readOnly(){return this._getOption("readOnly")}set readOnly(r){this._setOptions({readOnly:r})}get isSelectionEditable(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.isSelectionEditable)!=null?n:!1}setPromptState(r,n,a){var u;(u=this._mathfield)==null||u.setPromptState(r,n,a)}getPromptState(r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPromptState(r))!=null?a:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(r){this._setOptions({virtualKeyboardTargetOrigin:r})}get selection(){return this._mathfield?this._mathfield.model.selection:en.has(this)?en.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(r){if(typeof r=="number"&&(r={ranges:[[r,r]]}),this._mathfield){this._mathfield.model.selection=r,ns(this._mathfield);return}if(en.has(this)){en.set(this,d($({},en.get(this)),{selection:r}));return}en.set(this,{value:void 0,selection:r,options:Bc(this),menuItems:void 0})}get selectionIsCollapsed(){const r=this.selection;return r.ranges.length===1&&r.ranges[0][0]===r.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:en.has(this)?en.get(this).selection.ranges[0][0]:0}set position(r){if(this._mathfield&&(this._mathfield.model.position=r,ns(this._mathfield)),en.has(this)){en.set(this,d($({},en.get(this)),{selection:{ranges:[[r,r]]}}));return}en.set(this,{value:void 0,selection:{ranges:[[r,r]]},options:Bc(this),menuItems:void 0})}getOffsetDepth(r){var n,a;return this._mathfield?((a=(n=this._mathfield.model.at(r))==null?void 0:n.treeDepth)!=null?a:2)-2:0}get lastOffset(){var r,n;return(n=(r=this._mathfield)==null?void 0:r.model.lastOffset)!=null?n:-1}};$s.version="0.98.5",$s._fontsDirectory="./fonts",$s._soundsDirectory="./sounds",$s.keypressVibration=!0,$s._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},$s._plonkSound="plonk.wav",$s.audioBuffers={},$s.createHTML=e=>e,$s._speechEngineRate="100%",$s._speechEngineVoice="Joanna",$s._textToSpeechMarkup="",$s._textToSpeechRules="mathlive",$s._textToSpeechRulesOptions={},$s.speakHook=dg,$s.readAloudHook=wg,$s._decimalSeparator=".",$s.fractionNavigationOrder="numerator-denominator",$s._isFunction=e=>{var r,n;const a=window.MathfieldElement.computeEngine;return(n=(r=a==null?void 0:a.parse(e).domain)==null?void 0:r.isFunction)!=null?n:!1};var Oc=$s;function Ml(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(r,n)=>n.toUpperCase())}function Bc(e){const r={readOnly:!1},n=Oc.optionsAttributes;return Object.keys(n).forEach(a=>{if(e.hasAttribute(a)){const u=e.getAttribute(a);a==="placeholder"?r.contentPlaceholder=u!=null?u:"":n[a]==="boolean"?r[Ml(a)]=!0:n[a]==="on/off"?u==="on"?r[Ml(a)]=!0:u==="off"?r[Ml(a)]=!1:r[Ml(a)]=void 0:n[a]==="number"?r[Ml(a)]=Number.parseFloat(u!=null?u:"0"):r[Ml(a)]=u}}),r}function q0(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var bp=Oc,_p,xp,wp,Sp;if(O()&&!((_p=window.customElements)!=null&&_p.get("math-field"))){(wp=window[xp=Symbol.for("io.cortexjs.mathlive")])!=null||(window[xp]={});const e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=Oc,(Sp=window.customElements)==null||Sp.define("math-field",Oc)}function Eg(e,r,n){let a=n,u=0;const f=e.length;for(;a<r.length;){const v=r[a];if(u<=0&&r.slice(a,a+f)===e)return a;v==="\\"?a++:v==="{"?u++:v==="}"&&u--,a++}return-1}function Vh(e,r,n,a,u="latex"){const f=[];for(const v of e)if(v.type==="text"){const A=v.data;let C=!0,P=0,z;z=A.indexOf(r),z!==-1&&(P=z,P>0&&f.push({type:"text",data:A.slice(0,P)}),C=!1);let Q=!1;for(;!Q;){if(C){if(z=A.indexOf(r,P),z===-1){Q=!0;break}P!==z&&f.push({type:"text",data:A.slice(P,z)}),P=z}else{if(z=Eg(n,A,P+r.length),z===-1){Q=!0;break}let _e=A.slice(P+r.length,z);u==="ascii-math"&&([,_e]=w0(_e,{format:"ascii-math"})),f.push({type:"math",data:_e,rawData:A.slice(P,z+n.length),mathstyle:a}),P=z+n.length}C=!C}P<A.length&&f.push({type:"text",data:A.slice(P)})}else f.push(v);return f}function Ep(e,r,n){let a=[{type:"text",data:e}];return r!=null&&r.inline&&r.inline.forEach(([u,f])=>{a=Vh(a,u,f,"textstyle")}),r!=null&&r.display&&r.display.forEach(([u,f])=>{a=Vh(a,u,f,"displaystyle")}),n!=null&&n.inline&&n.inline.forEach(([u,f])=>{a=Vh(a,u,f,"textstyle","ascii-math")}),n!=null&&n.display&&n.display.forEach(([u,f])=>{a=Vh(a,u,f,"displaystyle","ascii-math")}),a}function Ag(e,r){const n=document.createElement("span");n.setAttribute("translate","no");try{const a="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+r.renderToMathML(e)+"</math>";n.innerHTML=window.MathfieldElement.createHTML(a)}catch(a){console.error(`MathLive 0.98.5: Could not convert "${e}"' to MathML with ${a}`),n.textContent=e}return n.className="ML__sr-only",n}function kg(e,r,n,a){try{const u=r.renderToMarkup(e,{mathstyle:n,format:"html"}),f=document.createElement("span");return f.dataset.latex=e,f.style.display=n==="displaystyle"?"flex":"inline-flex",f.setAttribute("aria-hidden","true"),f.setAttribute("translate","no"),f.innerHTML=window.MathfieldElement.createHTML(u),f}catch(u){if(console.error("Could not parse'"+e+"' with ",u),a)return document.createTextNode(e)}return null}function Z0(e,r,n,a){var u;const f=kg(e,n,r||"textstyle",a),v=(u=n.renderAccessibleContent)!=null?u:"";if(f&&/\b(mathml|speakable-text)\b/i.test(v)){const A=document.createElement("span");if(/\bmathml\b/i.test(v)&&n.renderToMathML&&A.append(Ag(e,n)),/\bspeakable-text\b/i.test(v)&&n.renderToSpeakableText){const C=document.createElement("span");C.setAttribute("translate","no");const P=n.renderToSpeakableText(e);C.innerHTML=window.MathfieldElement.createHTML(P),C.className="ML__sr-only",A.append(C)}return A.append(f),A}return f}function Tg(e,r){var n,a,u;let f=null;if((n=r.TeX)!=null&&n.processEnvironments&&/^\s*\\begin/.test(e)){f=document.createDocumentFragment();const v=Z0(e,"",r,!0);v&&f.appendChild(v)}else{if(!e.trim())return null;const v=Ep(e,(a=r.TeX)==null?void 0:a.delimiters,(u=r.asciiMath)==null?void 0:u.delimiters);if(v.length===1&&v[0].type==="text")return null;f=document.createDocumentFragment();for(const A of v)if(A.type==="text")f.appendChild(document.createTextNode(A.data));else{const C=Z0(A.data,A.mathstyle==="textstyle"?"textstyle":"displaystyle",r,!0);C&&f.appendChild(C)}}return f}function Ap(e,r){var n,a,u,f,v,A,C,P,z,Q,_e,Ie,ze,St,sr,xt;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Wt=(n=e.childNodes[0].textContent)!=null?n:"";if((a=r.TeX)!=null&&a.processEnvironments&&/^\s*\\begin/.test(Wt)){e.textContent="";const Zt=Z0(Wt,"",r,!0);Zt&&e.append(Zt);return}const hr=Ep(Wt,(u=r.TeX)==null?void 0:u.delimiters,(f=r.asciiMath)==null?void 0:f.delimiters);if(hr.length===1&&hr[0].type==="math"){e.textContent="";const Zt=Z0(hr[0].data,hr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",r,!0);Zt&&e.append(Zt);return}if(hr.length===1&&hr[0].type==="text")return}for(let Wt=e.childNodes.length-1;Wt>=0;Wt--){const hr=e.childNodes[Wt];if(hr.nodeType===3){const Zt=Tg((v=hr.textContent)!=null?v:"",r);Zt&&(Wt+=Zt.childNodes.length-1,hr.replaceWith(Zt))}else if(hr.nodeType===1){const Zt=hr,Nr=hr.nodeName.toLowerCase();if(Nr==="script"){const Qr=hr;let Wr;if((A=r.processScriptTypePattern)!=null&&A.test(Qr.type))Wr=(C=Qr.textContent)!=null?C:"";else if((P=r.processMathJSONScriptTypePattern)!=null&&P.test(Qr.type))try{Wr=(Q=r.serializeToLatex)==null?void 0:Q.call(r,JSON.parse((z=Qr.textContent)!=null?z:""))}catch(Yi){console.error(Yi)}if(Wr){let Yi="textstyle";for(const gr of Qr.type.split(";")){const[Oa,qo]=gr.toLowerCase().split("=");Oa.trim()==="mode"&&(Yi=qo.trim()==="display"?"displaystyle":"textstyle")}const En=Z0(Wr,Yi,r,!0);En&&Qr.parentNode.replaceChild(En,Qr)}}else if(((Ie=(_e=r.processClassPattern)==null?void 0:_e.test(Zt.className))!=null?Ie:!1)||!((St=(ze=r.skipTags)==null?void 0:ze.includes(Nr))!=null&&St||(xt=(sr=r.ignoreClassPattern)==null?void 0:sr.test(Zt.className))!=null&&xt))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Wr=e.textContent;e.textContent="";const Yi=Z0(Wr!=null?Wr:"","displaystyle",r,!0);Yi&&e.append(Yi)}else Ap(Zt,r)}}}var Cg={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function Dg(e,r){var n,a,u,f;try{const v=$($({},Cg),r);v.ignoreClassPattern=new RegExp((n=v.ignoreClass)!=null?n:""),v.processClassPattern=new RegExp((a=v.processClass)!=null?a:""),v.processScriptTypePattern=new RegExp((u=v.processScriptType)!=null?u:""),v.processMathJSONScriptTypePattern=new RegExp((f=v.processMathJSONScriptType)!=null?f:""),xh(),fo("core"),Ap(e,v)}catch(v){v instanceof Error?console.error("renderMathInElement(): "+v.message):console.error("renderMathInElement(): Could not render math for element",e)}}function Mg(e,r){const n=lu.singleton;return n?(n.show(),Ec(),n.currentLayer=r,n.render(),n.focus(),!0):!1}function Lg(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}Ta({switchKeyboardLayer:Mg,toggleVirtualKeyboard:Lg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function hu(){var e,r;return(r=globalThis[e=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Fg(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function Ng(e){Ig(document.body,e)}function Rg(e){if(typeof e=="string"){const r=document.getElementById(e);if(r===null)throw new Error(`The element with ID "${e}" could not be found.`);return r}return typeof e=="string"?null:e}function Ig(e,r){var n,a,u,f;const v=Rg(e);if(!v)return;const A=r!=null?r:{};(n=A.renderToMarkup)!=null||(A.renderToMarkup=Ms),(a=A.renderToMathML)!=null||(A.renderToMathML=Vm),(u=A.renderToSpeakableText)!=null||(A.renderToSpeakableText=Wm),(f=A.serializeToLatex)!=null||(A.serializeToLatex=jm),Dg(v,A)}var $g={mathlive:"0.98.5"}}}]);
}());