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/5613.2fd75233.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 vo=Math.pow;var pu=($r,It,X)=>new Promise((pe,Pe)=>{var rt=E=>{try{re(X.next(E))}catch(Re){Pe(Re)}},Me=E=>{try{re(X.throw(E))}catch(Re){Pe(Re)}},re=E=>E.done?pe(E.value):Promise.resolve(E.value).then(rt,Me);re((X=X.apply($r,It)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[5613],{70557:function($r,It,X){"use strict";X.d(It,{Z:function(){return N}});var pe=X(72308),Pe=X(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"},Me=rt,re=X(7657),E=function(xe,q){return Pe.createElement(re.Z,(0,pe.Z)({},xe,{ref:q,icon:Me}))},Re=Pe.forwardRef(E),N=Re},84105:function($r,It,X){"use strict";X.d(It,{Z:function(){return N}});var pe=X(72308),Pe=X(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"},Me=rt,re=X(7657),E=function(xe,q){return Pe.createElement(re.Z,(0,pe.Z)({},xe,{ref:q,icon:Me}))},Re=Pe.forwardRef(E),N=Re},18785:function($r,It,X){"use strict";X.d(It,{Z:function(){return N}});var pe=X(72308),Pe=X(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"},Me=rt,re=X(7657),E=function(xe,q){return Pe.createElement(re.Z,(0,pe.Z)({},xe,{ref:q,icon:Me}))},Re=Pe.forwardRef(E),N=Re},62772:function($r,It,X){"use strict";X.d(It,{Z:function(){return N}});var pe=X(72308),Pe=X(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"},Me=rt,re=X(7657),E=function(xe,q){return Pe.createElement(re.Z,(0,pe.Z)({},xe,{ref:q,icon:Me}))},Re=Pe.forwardRef(E),N=Re},87395:function($r,It,X){"use strict";X.d(It,{Z:function(){return N}});var pe=X(72308),Pe=X(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"},Me=rt,re=X(7657),E=function(xe,q){return Pe.createElement(re.Z,(0,pe.Z)({},xe,{ref:q,icon:Me}))},Re=Pe.forwardRef(E),N=Re},35593:function($r,It,X){"use strict";X.d(It,{Z:function(){return Vr}});var pe=X(77321),Pe=X(52487),rt=X(74416),Me=X(43403),re=X(92310),E=X.n(re),Re=X(29301),N=X(76846),d=X(96452),xe=X(6089),q=X(80402),k=X(34280),I=X(49658),O=X(59301),H=X(72308),se=X(77900),ae=X(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,Gt=Dt.y,dr=Gt===void 0?0:Gt,Jt=O.useRef();if(!Qe||!Qe.points)return null;var Ue={position:"absolute"};if(Qe.autoArrow!==!1){var Kt=Qe.points[0],wr=Qe.points[1],Fe=Kt[0],Ge=Kt[1],it=wr[0],Rt=wr[1];Fe===it||!["t","b"].includes(Fe)?Ue.top=dr:Fe==="t"?Ue.top=0:Ue.bottom=0,Ge===Rt||!["l","r"].includes(Ge)?Ue.left=wt:Ge==="l"?Ue.left=0:Ue.right=0}return O.createElement("div",{ref:Jt,className:E()("".concat(nt,"-arrow"),Oe),style:Ue},et)}function j(Ze){var nt=Ze.prefixCls,Qe=Ze.open,Ct=Ze.zIndex,Dt=Ze.mask,ye=Ze.motion;return Dt?O.createElement(se.default,(0,H.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,Gt=Ze.fresh,dr=Ze.onClick,Jt=Ze.mask,Ue=Ze.arrow,Kt=Ze.arrowPos,wr=Ze.align,Fe=Ze.motion,Ge=Ze.maskMotion,it=Ze.forceRender,Rt=Ze.getPopupContainer,kt=Ze.autoDestroy,zt=Ze.portal,tr=Ze.zIndex,T=Ze.onMouseEnter,B=Ze.onMouseLeave,ft=Ze.onPointerEnter,G=Ze.ready,fe=Ze.offsetX,Sr=Ze.offsetY,Ne=Ze.offsetR,He=Ze.offsetB,Je=Ze.onAlign,W=Ze.onPrepare,ge=Ze.stretch,Ee=Ze.targetWidth,Ke=Ze.targetHeight,V=typeof Qe=="function"?Qe():Qe,qt=vt||wt,Ae=(Rt==null?void 0:Rt.length)>0,Xt=O.useState(!Rt||!Ae),yr=(0,Pe.Z)(Xt,2),ei=yr[0],Li=yr[1];if((0,k.Z)(function(){!ei&&Ae&&Oe&&Li(!0)},[ei,Ae,Oe]),!ei)return null;var ui="auto",Er={left:"-1000vw",top:"-1000vh",right:ui,bottom:ui};if(G||!vt){var yi,me=wr.points,Ce=wr.dynamicInset||((yi=wr._experimental)===null||yi===void 0?void 0:yi.dynamicInset),Mt=Ce&&me[0][1]==="r",ct=Ce&&me[0][0]==="b";Mt?(Er.right=Ne,Er.left=ui):(Er.left=fe,Er.right=ui),ct?(Er.bottom=He,Er.top=ui):(Er.top=Sr,Er.bottom=ui)}var Et={};return ge&&(ge.includes("height")&&Ke?Et.height=Ke:ge.includes("minHeight")&&Ke&&(Et.minHeight=Ke),ge.includes("width")&&Ee?Et.width=Ee:ge.includes("minWidth")&&Ee&&(Et.minWidth=Ee)),vt||(Et.pointerEvents="none"),O.createElement(zt,{open:it||qt,getContainer:Rt&&function(){return Rt(Oe)},autoDestroy:kt},O.createElement(j,{prefixCls:Dt,open:vt,zIndex:tr,mask:Jt,motion:Ge}),O.createElement(Re.Z,{onResize:Je,disabled:!vt},function(Nt){return O.createElement(se.default,(0,H.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:it,leavedClassName:"".concat(Dt,"-hidden")},Fe,{onAppearPrepare:W,onEnterPrepare:W,visible:vt,onVisibleChanged:function(Qt){var Pr;Fe==null||(Pr=Fe.onVisibleChanged)===null||Pr===void 0||Pr.call(Fe,Qt),et(Qt)}}),function(ar,Qt){var Pr=ar.className,Ar=ar.style,oi=E()(Dt,Pr,Ct);return O.createElement("div",{ref:(0,ae.sQ)(Nt,nt,Qt),className:oi,style:(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({"--arrow-x":"".concat(Kt.x||0,"px"),"--arrow-y":"".concat(Kt.y||0,"px")},Er),Et),Ar),{},{boxSizing:"border-box",zIndex:tr},ye),onMouseEnter:T,onMouseLeave:B,onPointerEnter:ft,onClick:dr},Ue&&O.createElement(Z,{prefixCls:Dt,arrow:Ue,arrowPos:Kt,align:wr}),O.createElement(ue,{cache:!vt&&!Gt},V))})}))}),le=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 gt(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=X(29194);function ie(){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(ie((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 Le(Ze){return Ze.ownerDocument.defaultView}function Se(Ze){for(var nt=[],Qe=Ze==null?void 0:Ze.parentElement,Ct=["hidden","scroll","clip","auto"];Qe;){var Dt=Le(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 M(Ze){return D(parseFloat(Ze),0)}function ne(Ze,nt){var Qe=(0,pe.Z)({},Ze);return(nt||[]).forEach(function(Ct){if(!(Ct instanceof HTMLBodyElement||Ct instanceof HTMLHtmlElement)){var Dt=Le(Ct).getComputedStyle(Ct),ye=Dt.overflow,Oe=Dt.overflowClipMargin,et=Dt.borderTopWidth,vt=Dt.borderBottomWidth,wt=Dt.borderLeftWidth,Gt=Dt.borderRightWidth,dr=Ct.getBoundingClientRect(),Jt=Ct.offsetHeight,Ue=Ct.clientHeight,Kt=Ct.offsetWidth,wr=Ct.clientWidth,Fe=M(et),Ge=M(vt),it=M(wt),Rt=M(Gt),kt=D(Math.round(dr.width/Kt*1e3)/1e3),zt=D(Math.round(dr.height/Jt*1e3)/1e3),tr=(Kt-wr-it-Rt)*kt,T=(Jt-Ue-Fe-Ge)*zt,B=Fe*zt,ft=Ge*zt,G=it*kt,fe=Rt*kt,Sr=0,Ne=0;if(ye==="clip"){var He=M(Oe);Sr=He*kt,Ne=He*zt}var Je=dr.x+G-Sr,W=dr.y+B-Ne,ge=Je+dr.width+2*Sr-G-fe-tr,Ee=W+dr.height+2*Ne-B-ft-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,Ee)}}),Qe}function be(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 st(Ze,nt){var Qe=nt||[],Ct=(0,Pe.Z)(Qe,2),Dt=Ct[0],ye=Ct[1];return[be(Ze.width,Dt),be(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 sr(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],Gt=vt[1],dr=O.useRef(0),Jt=O.useMemo(function(){return nt?Se(nt):[]},[nt]),Ue=O.useRef({}),Kt=function(){Ue.current={}};Ze||Kt();var wr=(0,xe.Z)(function(){if(nt&&Qe&&Ze){let dn=function(sn,Un){var jn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oi,Bn=V.x+sn,kn=V.y+Un,Pi=Bn+yi,_i=kn+Er,Di=Math.max(Bn,jn.left),ln=Math.max(kn,jn.top),Tn=Math.min(Pi,jn.right),Qn=Math.min(_i,jn.bottom);return Math.max(0,(Tn-Di)*(Qn-ln))},Oi=function(){ur=V.y+Rr,br=ur+Er,qr=V.x+kr,on=qr+yi};var it,Rt,kt=nt,zt=kt.ownerDocument,tr=Le(kt),T=tr.getComputedStyle(kt),B=T.width,ft=T.height,G=T.position,fe=kt.style.left,Sr=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 Ee;if(Array.isArray(Qe))Ee={x:Qe[0],y:Qe[1],width:0,height:0};else{var Ke=Qe.getBoundingClientRect();Ee={x:Ke.x,y:Ke.y,width:Ke.width,height:Ke.height}}var V=kt.getBoundingClientRect(),qt=zt.documentElement,Ae=qt.clientWidth,Xt=qt.clientHeight,yr=qt.scrollWidth,ei=qt.scrollHeight,Li=qt.scrollTop,ui=qt.scrollLeft,Er=V.height,yi=V.width,me=Ee.height,Ce=Ee.width,Mt={left:0,top:0,right:Ae,bottom:Xt},ct={left:-ui,top:-Li,right:yr-ui,bottom:ei-Li},Et=W.htmlRegion,Nt="visible",ar="visibleFirst";Et!=="scroll"&&Et!==ar&&(Et=Nt);var Qt=Et===ar,Pr=ne(ct,Jt),Ar=ne(Mt,Jt),oi=Et===Nt?Ar:Pr,Lr=Qt?Ar:oi;kt.style.left="auto",kt.style.top="auto",kt.style.right="0",kt.style.bottom="0";var Fr=kt.getBoundingClientRect();kt.style.left=fe,kt.style.top=Sr,kt.style.right=Ne,kt.style.bottom=He,kt.style.overflow=Je,(Rt=kt.parentElement)===null||Rt===void 0||Rt.removeChild(ge);var ii=D(Math.round(yi/parseFloat(B)*1e3)/1e3),bi=D(Math.round(Er/parseFloat(ft)*1e3)/1e3);if(ii===0||bi===0||(0,N.Sh)(Qe)&&!(0,de.Z)(Qe))return;var Fi=W.offset,mi=W.targetOffset,Kr=st(V,Fi),Hi=(0,Pe.Z)(Kr,2),Yr=Hi[0],Br=Hi[1],lt=st(Ee,mi),tt=(0,Pe.Z)(lt,2),_t=tt[0],Lt=tt[1];Ee.x-=_t,Ee.y-=Lt;var pt=W.points||[],Ht=(0,Pe.Z)(pt,2),Bt=Ht[0],lr=Ht[1],Dr=ot(lr),mr=ot(Bt),ni=At(Ee,Dr),ci=At(V,mr),gi=(0,pe.Z)({},W),kr=ni.x-ci.x+Yr,Rr=ni.y-ci.y+Br,Si=dn(kr,Rr),Ei=dn(kr,Rr,Ar),Xr=At(Ee,["t","l"]),ti=At(V,["t","l"]),ri=At(Ee,["b","r"]),si=At(V,["b","r"]),Hr=W.overflow||{},fi=Hr.adjustX,Ii=Hr.adjustY,Ci=Hr.shiftX,Tr=Hr.shiftY,je=function(Un){return typeof Un=="boolean"?Un:Un>=0},ur,br,qr,on;Oi();var vi=je(Ii),Ni=mr[0]===Dr[0];if(vi&&mr[0]==="t"&&(br>Lr.bottom||Ue.current.bt)){var Gr=Rr;Ni?Gr-=Er-me:Gr=Xr.y-si.y-Br;var gn=dn(kr,Gr),wn=dn(kr,Gr,Ar);gn>Si||gn===Si&&(!Qt||wn>=Ei)?(Ue.current.bt=!0,Rr=Gr,Br=-Br,gi.points=[Xe(mr,0),Xe(Dr,0)]):Ue.current.bt=!1}if(vi&&mr[0]==="b"&&(ur<Lr.top||Ue.current.tb)){var Gi=Rr;Ni?Gi+=Er-me:Gi=ri.y-ti.y-Br;var ts=dn(kr,Gi),Xn=dn(kr,Gi,Ar);ts>Si||ts===Si&&(!Qt||Xn>=Ei)?(Ue.current.tb=!0,Rr=Gi,Br=-Br,gi.points=[Xe(mr,0),Xe(Dr,0)]):Ue.current.tb=!1}var zn=je(fi),Vn=mr[1]===Dr[1];if(zn&&mr[1]==="l"&&(on>Lr.right||Ue.current.rl)){var Or=kr;Vn?Or-=yi-Ce:Or=Xr.x-si.x-Yr;var Ai=dn(Or,Rr),Ui=dn(Or,Rr,Ar);Ai>Si||Ai===Si&&(!Qt||Ui>=Ei)?(Ue.current.rl=!0,kr=Or,Yr=-Yr,gi.points=[Xe(mr,1),Xe(Dr,1)]):Ue.current.rl=!1}if(zn&&mr[1]==="r"&&(qr<Lr.left||Ue.current.lr)){var Vi=kr;Vn?Vi+=yi-Ce:Vi=ri.x-ti.x-Yr;var Wn=dn(Vi,Rr),bn=dn(Vi,Rr,Ar);Wn>Si||Wn===Si&&(!Qt||bn>=Ei)?(Ue.current.lr=!0,kr=Vi,Yr=-Yr,gi.points=[Xe(mr,1),Xe(Dr,1)]):Ue.current.lr=!1}Oi();var nn=Ci===!0?0:Ci;typeof nn=="number"&&(qr<Ar.left&&(kr-=qr-Ar.left-Yr,Ee.x+Ce<Ar.left+nn&&(kr+=Ee.x-Ar.left+Ce-nn)),on>Ar.right&&(kr-=on-Ar.right-Yr,Ee.x>Ar.right-nn&&(kr+=Ee.x-Ar.right+nn)));var On=Tr===!0?0:Tr;typeof On=="number"&&(ur<Ar.top&&(Rr-=ur-Ar.top-Br,Ee.y+me<Ar.top+On&&(Rr+=Ee.y-Ar.top+me-On)),br>Ar.bottom&&(Rr-=br-Ar.bottom-Br,Ee.y>Ar.bottom-On&&(Rr+=Ee.y-Ar.bottom+On)));var $i=V.x+kr,rs=$i+yi,Wr=V.y+Rr,ss=Wr+Er,Jn=Ee.x,Sn=Jn+Ce,Ri=Ee.y,ps=Ri+me,ys=Math.max($i,Jn),us=Math.min(rs,Sn),pi=(ys+us)/2,bs=pi-$i,_s=Math.max(Wr,Ri),ir=Math.min(ss,ps),vn=(_s+ir)/2,xs=vn-Wr;Oe==null||Oe(nt,gi);var cs=Fr.right-V.x-(kr+V.width),hn=Fr.bottom-V.y-(Rr+V.height);Gt({ready:!0,offsetX:kr/ii,offsetY:Rr/bi,offsetR:cs/ii,offsetB:hn/bi,arrowX:bs/ii,arrowY:xs/bi,scaleX:ii,scaleY:bi,align:gi})}}),Fe=function(){dr.current+=1;var Rt=dr.current;Promise.resolve().then(function(){dr.current===Rt&&wr()})},Ge=function(){Gt(function(Rt){return(0,pe.Z)((0,pe.Z)({},Rt),{},{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=X(80702);function Pt(Ze,nt,Qe,Ct,Dt){(0,k.Z)(function(){if(Ze&&nt&&Qe){let dr=function(){Ct(),Dt()};var ye=nt,Oe=Qe,et=Se(ye),vt=Se(Oe),wt=Le(Oe),Gt=new Set([wt].concat((0,jt.Z)(et),(0,jt.Z)(vt)));return Gt.forEach(function(Jt){Jt.addEventListener("scroll",dr,{passive:!0})}),wt.addEventListener("resize",dr,{passive:!0}),Ct(),function(){Gt.forEach(function(Jt){Jt.removeEventListener("scroll",dr),wt.removeEventListener("resize",dr)})}}},[Ze,nt,Qe])}var Cr=X(48736),zr=X(16089);function rr(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 Gt=(0,zr.Z)(function(){wt.current=!1});return function(){zr.Z.cancel(Gt)}},[Ze]),O.useEffect(function(){if(nt&&Ct&&(!Dt||ye)){var Gt=function(){var G=!1,fe=function(He){var Je=He.target;G=Oe(Je)},Sr=function(He){var Je=He.target;!wt.current&&vt.current&&!G&&!Oe(Je)&&et(!1)};return[fe,Sr]},dr=Gt(),Jt=(0,Pe.Z)(dr,2),Ue=Jt[0],Kt=Jt[1],wr=Gt(),Fe=(0,Pe.Z)(wr,2),Ge=Fe[0],it=Fe[1],Rt=Le(Ct);Rt.addEventListener("mousedown",Ue,!0),Rt.addEventListener("click",Kt,!0),Rt.addEventListener("contextmenu",Kt,!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,tr,T,B;return function(){Rt.removeEventListener("mousedown",Ue,!0),Rt.removeEventListener("click",Kt,!0),Rt.removeEventListener("contextmenu",Kt,!0),kt&&(kt.removeEventListener("mousedown",Ge,!0),kt.removeEventListener("click",it,!0),kt.removeEventListener("contextmenu",it,!0))}}},[nt,Qe,Ct,Dt,ye])}var Ur=["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]:Me.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,Gt=Qe.hideAction,dr=Qe.popupVisible,Jt=Qe.defaultPopupVisible,Ue=Qe.onPopupVisibleChange,Kt=Qe.afterPopupVisibleChange,wr=Qe.mouseEnterDelay,Fe=Qe.mouseLeaveDelay,Ge=Fe===void 0?.1:Fe,it=Qe.focusDelay,Rt=Qe.blurDelay,kt=Qe.mask,zt=Qe.maskClosable,tr=zt===void 0?!0:zt,T=Qe.getPopupContainer,B=Qe.forceRender,ft=Qe.autoDestroy,G=Qe.destroyPopupOnHide,fe=Qe.popup,Sr=Qe.popupClassName,Ne=Qe.popupStyle,He=Qe.popupPlacement,Je=Qe.builtinPlacements,W=Je===void 0?{}:Je,ge=Qe.popupAlign,Ee=Qe.zIndex,Ke=Qe.stretch,V=Qe.getPopupClassNameFromAlign,qt=Qe.fresh,Ae=Qe.alignPoint,Xt=Qe.onPopupClick,yr=Qe.onPopupAlign,ei=Qe.arrow,Li=Qe.popupMotion,ui=Qe.maskMotion,Er=Qe.popupTransitionName,yi=Qe.popupAnimation,me=Qe.maskTransitionName,Ce=Qe.maskAnimation,Mt=Qe.className,ct=Qe.getTriggerDOMNode,Et=(0,rt.Z)(Qe,Ur),Nt=ft||G||!1,ar=O.useState(!1),Qt=(0,Pe.Z)(ar,2),Pr=Qt[0],Ar=Qt[1];(0,k.Z)(function(){Ar((0,I.Z)())},[]);var oi=O.useRef({}),Lr=O.useContext(We),Fr=O.useMemo(function(){return{registerSubPopup:function(Jr,_n){oi.current[Jr]=_n,Lr==null||Lr.registerSubPopup(Jr,_n)}}},[Lr]),ii=(0,q.Z)(),bi=O.useState(null),Fi=(0,Pe.Z)(bi,2),mi=Fi[0],Kr=Fi[1],Hi=(0,xe.Z)(function(Ir){(0,N.Sh)(Ir)&&mi!==Ir&&Kr(Ir),Lr==null||Lr.registerSubPopup(ii,Ir)}),Yr=O.useState(null),Br=(0,Pe.Z)(Yr,2),lt=Br[0],tt=Br[1],_t=O.useRef(null),Lt=(0,xe.Z)(function(Ir){(0,N.Sh)(Ir)&&lt!==Ir&&(tt(Ir),_t.current=Ir)}),pt=O.Children.only(Oe),Ht=(pt==null?void 0:pt.props)||{},Bt={},lr=(0,xe.Z)(function(Ir){var Jr,_n,In=lt;return(In==null?void 0:In.contains(Ir))||((Jr=(0,d.A)(In))===null||Jr===void 0?void 0:Jr.host)===Ir||Ir===In||(mi==null?void 0:mi.contains(Ir))||((_n=(0,d.A)(mi))===null||_n===void 0?void 0:_n.host)===Ir||Ir===mi||Object.values(oi.current).some(function(Qi){return(Qi==null?void 0:Qi.contains(Ir))||Ir===Qi})}),Dr=he(ye,Li,yi,Er),mr=he(ye,ui,Ce,me),ni=O.useState(Jt||!1),ci=(0,Pe.Z)(ni,2),gi=ci[0],kr=ci[1],Rr=dr!=null?dr:gi,Si=(0,xe.Z)(function(Ir){dr===void 0&&kr(Ir)});(0,k.Z)(function(){kr(dr||!1)},[dr]);var Ei=O.useRef(Rr);Ei.current=Rr;var Xr=O.useRef([]);Xr.current=[];var ti=(0,xe.Z)(function(Ir){var Jr;Si(Ir),((Jr=Xr.current[Xr.current.length-1])!==null&&Jr!==void 0?Jr:Rr)!==Ir&&(Xr.current.push(Ir),Ue==null||Ue(Ir))}),ri=O.useRef(),si=function(){clearTimeout(ri.current)},Hr=function(Jr){var _n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;si(),_n===0?ti(Jr):ri.current=setTimeout(function(){ti(Jr)},_n*1e3)};O.useEffect(function(){return si},[]);var fi=O.useState(!1),Ii=(0,Pe.Z)(fi,2),Ci=Ii[0],Tr=Ii[1];(0,k.Z)(function(Ir){(!Ir||Rr)&&Tr(!0)},[Rr]);var je=O.useState(null),ur=(0,Pe.Z)(je,2),br=ur[0],qr=ur[1],on=O.useState([0,0]),vi=(0,Pe.Z)(on,2),Ni=vi[0],Gr=vi[1],gn=function(Jr){Gr([Jr.clientX,Jr.clientY])},wn=sr(Rr,mi,Ae?Ni:lt,He,W,ge,yr),Gi=(0,Pe.Z)(wn,11),ts=Gi[0],Xn=Gi[1],zn=Gi[2],Vn=Gi[3],Or=Gi[4],Ai=Gi[5],Ui=Gi[6],Vi=Gi[7],Wn=Gi[8],bn=Gi[9],nn=Gi[10],On=gt(Pr,vt,wt,Gt),$i=(0,Pe.Z)(On,2),rs=$i[0],Wr=$i[1],ss=rs.has("click"),Jn=Wr.has("click")||Wr.has("contextMenu"),Sn=(0,xe.Z)(function(){Ci||nn()}),Ri=function(){Ei.current&&Ae&&Jn&&Hr(!1)};Pt(Rr,lt,mi,Sn,Ri),(0,k.Z)(function(){Sn()},[Ni,He]),(0,k.Z)(function(){Rr&&!(W!=null&&W[He])&&Sn()},[JSON.stringify(ge)]);var ps=O.useMemo(function(){var Ir=ce(W,ye,bn,Ae);return E()(Ir,V==null?void 0:V(bn))},[bn,V,W,ye,Ae]);O.useImperativeHandle(Ct,function(){return{nativeElement:_t.current,forceAlign:Sn}});var ys=O.useState(0),us=(0,Pe.Z)(ys,2),pi=us[0],bs=us[1],_s=O.useState(0),ir=(0,Pe.Z)(_s,2),vn=ir[0],xs=ir[1],cs=function(){if(Ke&&lt){var Jr=lt.getBoundingClientRect();bs(Jr.width),xs(Jr.height)}},hn=function(){cs(),Sn()},dn=function(Jr){Tr(!1),nn(),Kt==null||Kt(Jr)},Oi=function(){return new Promise(function(Jr){cs(),qr(function(){return Jr})})};(0,k.Z)(function(){br&&(nn(),br(),qr(null))},[br]);function sn(Ir,Jr,_n,In){Bt[Ir]=function(Qi){var Ks;In==null||In(Qi),Hr(Jr,_n);for(var hs=arguments.length,ws=new Array(hs>1?hs-1:0),qn=1;qn<hs;qn++)ws[qn-1]=arguments[qn];(Ks=Ht[Ir])===null||Ks===void 0||Ks.call.apply(Ks,[Ht,Qi].concat(ws))}}(ss||Jn)&&(Bt.onClick=function(Ir){var Jr;Ei.current&&Jn?Hr(!1):!Ei.current&&ss&&(gn(Ir),Hr(!0));for(var _n=arguments.length,In=new Array(_n>1?_n-1:0),Qi=1;Qi<_n;Qi++)In[Qi-1]=arguments[Qi];(Jr=Ht.onClick)===null||Jr===void 0||Jr.call.apply(Jr,[Ht,Ir].concat(In))}),rr(Rr,Jn,lt,mi,kt,tr,lr,Hr);var Un=rs.has("hover"),jn=Wr.has("hover"),Bn,kn;Un&&(sn("onMouseEnter",!0,wr,function(Ir){gn(Ir)}),sn("onPointerEnter",!0,wr,function(Ir){gn(Ir)}),Bn=function(Jr){(Rr||Ci)&&mi!==null&&mi!==void 0&&mi.contains(Jr.target)&&Hr(!0,wr)},Ae&&(Bt.onMouseMove=function(Ir){var Jr;(Jr=Ht.onMouseMove)===null||Jr===void 0||Jr.call(Ht,Ir)})),jn&&(sn("onMouseLeave",!1,Ge),sn("onPointerLeave",!1,Ge),kn=function(){Hr(!1,Ge)}),rs.has("focus")&&sn("onFocus",!0,it),Wr.has("focus")&&sn("onBlur",!1,Rt),rs.has("contextMenu")&&(Bt.onContextMenu=function(Ir){var Jr;Ei.current&&Wr.has("contextMenu")?Hr(!1):(gn(Ir),Hr(!0)),Ir.preventDefault();for(var _n=arguments.length,In=new Array(_n>1?_n-1:0),Qi=1;Qi<_n;Qi++)In[Qi-1]=arguments[Qi];(Jr=Ht.onContextMenu)===null||Jr===void 0||Jr.call.apply(Jr,[Ht,Ir].concat(In))}),Mt&&(Bt.className=E()(Ht.className,Mt));var Pi=(0,pe.Z)((0,pe.Z)({},Ht),Bt),_i={},Di=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Di.forEach(function(Ir){Et[Ir]&&(_i[Ir]=function(){for(var Jr,_n=arguments.length,In=new Array(_n),Qi=0;Qi<_n;Qi++)In[Qi]=arguments[Qi];(Jr=Pi[Ir])===null||Jr===void 0||Jr.call.apply(Jr,[Pi].concat(In)),Et[Ir].apply(Et,In)})});var ln=O.cloneElement(pt,(0,pe.Z)((0,pe.Z)({},Pi),_i)),Tn={x:Ai,y:Ui},Qn=ei?(0,pe.Z)({},ei!==!0?ei:{}):null;return O.createElement(O.Fragment,null,O.createElement(Re.Z,{disabled:!Rr,ref:Lt,onResize:hn},O.createElement(ve,{getTriggerDOMNode:ct},ln)),O.createElement(We.Provider,{value:Fr},O.createElement(le,{portal:Ze,ref:Hi,prefixCls:ye,popup:fe,className:E()(Sr,ps),style:Ne,target:lt,onMouseEnter:Bn,onMouseLeave:kn,onPointerEnter:Bn,zIndex:Ee,open:Rr,keepDom:Ci,fresh:qt,onClick:Xt,mask:kt,motion:Dr,maskMotion:mr,onVisibleChanged:dn,onPrepare:Oi,forceRender:B,autoDestroy:Nt,getPopupContainer:T,align:bn,arrow:Qn,arrowPos:Tn,ready:ts,offsetX:Xn,offsetY:zn,offsetR:Vn,offsetB:Or,onAlign:Sn,stretch:Ke,targetWidth:pi/Vi,targetHeight:vn/Wn})))});return nt}var Vr=li(Me.Z)},50304:function(){"use strict"},36785:function($r,It,X){"use strict";X.d(It,{o2:function(){return re},yT:function(){return E}});var pe=X(80702),Pe=X(33166);const rt=Pe.i.map(Re=>`${Re}-inverse`),Me=["success","processing","error","default","warning"];function re(Re){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,pe.Z)(rt),(0,pe.Z)(Pe.i)).includes(Re):Pe.i.includes(Re)}function E(Re){return Me.includes(Re)}},79676:function($r,It,X){"use strict";X.d(It,{Z:function(){return E}});var pe=X(19447);function Pe(Re,N,d,xe){if(xe===!1)return{adjustX:!1,adjustY:!1};const q=xe&&typeof xe=="object"?xe:{},k={};switch(Re){case"top":case"bottom":k.shiftX=N.dropdownArrowOffset*2+d;break;case"left":case"right":k.shiftY=N.dropdownArrowOffsetVertical*2+d;break}const I=Object.assign(Object.assign({},k),q);return I.shiftX||(I.adjustX=!0),I.shiftY||(I.adjustY=!0),I}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"]}},Me={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"]}},re=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function E(Re){const{arrowWidth:N,autoAdjustOverflow:d,arrowPointAtCenter:xe,offset:q,borderRadius:k,visibleFirst:I}=Re,O=N/2,H={};return Object.keys(rt).forEach(se=>{const ae=xe&&Me[se]||rt[se],Z=Object.assign(Object.assign({},ae),{offset:[0,0]});switch(H[se]=Z,re.has(se)&&(Z.autoArrow=!1),se){case"top":case"topLeft":case"topRight":Z.offset[1]=-O-q;break;case"bottom":case"bottomLeft":case"bottomRight":Z.offset[1]=O+q;break;case"left":case"leftTop":case"leftBottom":Z.offset[0]=-O-q;break;case"right":case"rightTop":case"rightBottom":Z.offset[0]=O+q;break}const j=(0,pe.fS)({contentRadius:k,limitVerticalRadius:!0});if(xe)switch(se){case"topLeft":case"bottomLeft":Z.offset[0]=-j.dropdownArrowOffset-O;break;case"topRight":case"bottomRight":Z.offset[0]=j.dropdownArrowOffset+O;break;case"leftTop":case"rightTop":Z.offset[1]=-j.dropdownArrowOffset-O;break;case"leftBottom":case"rightBottom":Z.offset[1]=j.dropdownArrowOffset+O;break}Z.overflow=Pe(se,j,N,d),I&&(Z.htmlRegion="visibleFirst")}),H}},19080:function($r,It,X){"use strict";X.d(It,{F:function(){return re},Z:function(){return Me}});var pe=X(92310),Pe=X.n(pe);const rt=null;function Me(E,Re,N){return Pe()({[`${E}-status-success`]:Re==="success",[`${E}-status-warning`]:Re==="warning",[`${E}-status-error`]:Re==="error",[`${E}-status-validating`]:Re==="validating",[`${E}-has-feedback`]:N})}const re=(E,Re)=>Re||E},5871:function($r,It,X){"use strict";X.d(It,{Z:function(){return wr}});var pe=X(84105),Pe=X(87395),rt=X(92310),Me=X.n(rt),re=X(72308),E=X(49618),Re=X(62853),N=X(52487),d=X(74416),xe=X(96949),q=X(55090);function k(){return typeof BigInt=="function"}function I(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 Rt=Ge||"0",kt=Rt.split("."),zt=kt[0]||"0",tr=kt[1]||"0";zt==="0"&&tr==="0"&&(it=!1);var T=it?"-":"";return{negative:it,negativeStr:T,trimStr:Rt,integerStr:zt,decimalStr:tr,fullStr:"".concat(T).concat(Rt)}}function H(Fe){var Ge=String(Fe);return!Number.isNaN(Number(Ge))&&Ge.includes("e")}function se(Fe){var Ge=String(Fe);if(H(Fe)){var it=Number(Ge.slice(Ge.indexOf("e-")+2)),Rt=Ge.match(/\.(\d+)/);return Rt!=null&&Rt[1]&&(it+=Rt[1].length),it}return Ge.includes(".")&&Z(Ge)?Ge.length-Ge.indexOf(".")-1:0}function ae(Fe){var Ge=String(Fe);if(H(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 j=function(){function Fe(Ge){if((0,xe.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),I(Ge)){this.empty=!0;return}if(this.origin=String(Ge),Ge==="-"||Number.isNaN(Ge)){this.nan=!0;return}var it=Ge;if(H(it)&&(it=Number(it)),it=typeof it=="string"?it:ae(it),Z(it)){var Rt=O(it);this.negative=Rt.negative;var kt=Rt.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,q.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 Rt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(it,"0"));return BigInt(Rt)}},{key:"negate",value:function(){var it=new Fe(this.toString());return it.negative=!it.negative,it}},{key:"cal",value:function(it,Rt,kt){var zt=Math.max(this.getDecimalStr().length,it.getDecimalStr().length),tr=this.alignDecimal(zt),T=it.alignDecimal(zt),B=Rt(tr,T).toString(),ft=kt(zt),G=O(B),fe=G.negativeStr,Sr=G.trimStr,Ne="".concat(fe).concat(Sr.padStart(ft+1,"0"));return new Fe("".concat(Ne.slice(0,-ft),".").concat(Ne.slice(-ft)))}},{key:"add",value:function(it){if(this.isInvalidate())return new Fe(it);var Rt=new Fe(it);return Rt.isInvalidate()?this:this.cal(Rt,function(kt,zt){return kt+zt},function(kt){return kt})}},{key:"multi",value:function(it){var Rt=new Fe(it);return this.isInvalidate()||Rt.isInvalidate()?new Fe(NaN):this.cal(Rt,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,xe.Z)(this,Fe),(0,E.Z)(this,"origin",""),(0,E.Z)(this,"number",void 0),(0,E.Z)(this,"empty",void 0),I(Ge)){this.empty=!0;return}this.origin=String(Ge),this.number=Number(Ge)}return(0,q.Z)(Fe,[{key:"negate",value:function(){return new Fe(-this.toNumber())}},{key:"add",value:function(it){if(this.isInvalidate())return new Fe(it);var Rt=Number(it);if(Number.isNaN(Rt))return this;var kt=this.number+Rt;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(Rt));return new Fe(kt.toFixed(zt))}},{key:"multi",value:function(it){var Rt=Number(it);if(this.isInvalidate()||Number.isNaN(Rt))return new Fe(NaN);var kt=this.number*Rt;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(Rt));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 j(Fe):new Y(Fe)}function ee(Fe,Ge,it){var Rt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Fe==="")return"";var kt=O(Fe),zt=kt.negativeStr,tr=kt.integerStr,T=kt.decimalStr,B="".concat(Ge).concat(T),ft="".concat(zt).concat(tr);if(it>=0){var G=Number(T[it]);if(G>=5&&!Rt){var fe=ue(Fe).add("".concat(zt,"0.").concat("0".repeat(it)).concat(10-G));return ee(fe.toString(),Ge,it,Rt)}return it===0?ft:"".concat(ft).concat(Ge).concat(T.padEnd(it,"0").slice(0,it))}return B===".0"?ft:"".concat(ft).concat(B)}var le=ue,De=X(93681),ve=X(34280),Ye=X(8654),We=X(59301),ut=X(48736);function gt(Fe,Ge){var it=(0,We.useRef)(null);function Rt(){try{var zt=Fe.selectionStart,tr=Fe.selectionEnd,T=Fe.value,B=T.substring(0,zt),ft=T.substring(tr);it.current={start:zt,end:tr,value:T,beforeTxt:B,afterTxt:ft}}catch(G){}}function kt(){if(Fe&&it.current&&Ge)try{var zt=Fe.value,tr=it.current,T=tr.beforeTxt,B=tr.afterTxt,ft=tr.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[ft-1],Sr=zt.indexOf(fe,ft-1);Sr!==-1&&(G=Sr+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[Rt,kt]}var de=X(49658),ie=function(){var Ge=(0,We.useState)(!1),it=(0,N.Z)(Ge,2),Rt=it[0],kt=it[1];return(0,ve.Z)(function(){kt((0,de.Z)())},[]),Rt},ce=ie,he=X(16089),Le=200,Se=600;function D(Fe){var Ge=Fe.prefixCls,it=Fe.upNode,Rt=Fe.downNode,kt=Fe.upDisabled,zt=Fe.downDisabled,tr=Fe.onStep,T=We.useRef(),B=We.useRef([]),ft=We.useRef();ft.current=tr;var G=function(){clearTimeout(T.current)},fe=function(Ke,V){Ke.preventDefault(),G(),ft.current(V);function qt(){ft.current(V),T.current=setTimeout(qt,Le)}T.current=setTimeout(qt,Se)};We.useEffect(function(){return function(){G(),B.current.forEach(function(Ee){return he.Z.cancel(Ee)})}},[]);var Sr=ce();if(Sr)return null;var Ne="".concat(Ge,"-handler"),He=Me()(Ne,"".concat(Ne,"-up"),(0,E.Z)({},"".concat(Ne,"-up-disabled"),kt)),Je=Me()(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,re.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,re.Z)({},ge,{onMouseDown:function(Ke){fe(Ke,!1)},"aria-label":"Decrease Value","aria-disabled":zt,className:Je}),Rt||We.createElement("span",{unselectable:"on",className:"".concat(Ge,"-handler-down-inner")})))}function M(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 ne=X(5643),be=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()})}},st=["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=le(Ge);return it.isInvalidate()?null:it},sr=We.forwardRef(function(Fe,Ge){var it,Rt=Fe.prefixCls,kt=Rt===void 0?"rc-input-number":Rt,zt=Fe.className,tr=Fe.style,T=Fe.min,B=Fe.max,ft=Fe.step,G=ft===void 0?1:ft,fe=Fe.defaultValue,Sr=Fe.value,Ne=Fe.disabled,He=Fe.readOnly,Je=Fe.upHandler,W=Fe.downHandler,ge=Fe.keyboard,Ee=Fe.controls,Ke=Ee===void 0?!0:Ee,V=Fe.classNames,qt=Fe.stringMode,Ae=Fe.parser,Xt=Fe.formatter,yr=Fe.precision,ei=Fe.decimalSeparator,Li=Fe.onChange,ui=Fe.onInput,Er=Fe.onPressEnter,yi=Fe.onStep,me=(0,d.Z)(Fe,st),Ce="".concat(kt,"-input"),Mt=We.useRef(null),ct=We.useState(!1),Et=(0,N.Z)(ct,2),Nt=Et[0],ar=Et[1],Qt=We.useRef(!1),Pr=We.useRef(!1),Ar=We.useRef(!1),oi=We.useState(function(){return le(Sr!=null?Sr:fe)}),Lr=(0,N.Z)(oi,2),Fr=Lr[0],ii=Lr[1];function bi(Tr){Sr===void 0&&ii(Tr)}var Fi=We.useCallback(function(Tr,je){if(!je)return yr>=0?yr:Math.max(se(Tr),se(G))},[yr,G]),mi=We.useCallback(function(Tr){var je=String(Tr);if(Ae)return Ae(je);var ur=je;return ei&&(ur=ur.replace(ei,".")),ur.replace(/[^\w.-]+/g,"")},[Ae,ei]),Kr=We.useRef(""),Hi=We.useCallback(function(Tr,je){if(Xt)return Xt(Tr,{userTyping:je,input:String(Kr.current)});var ur=typeof Tr=="number"?ae(Tr):Tr;if(!je){var br=Fi(ur,je);if(Z(ur)&&(ei||br>=0)){var qr=ei||".";ur=ee(ur,qr,br)}}return ur},[Xt,Fi,ei]),Yr=We.useState(function(){var Tr=fe!=null?fe:Sr;return Fr.isInvalidate()&&["string","number"].includes((0,Re.Z)(Tr))?Number.isNaN(Tr)?"":Tr:Hi(Fr.toString(),!1)}),Br=(0,N.Z)(Yr,2),lt=Br[0],tt=Br[1];Kr.current=lt;function _t(Tr,je){tt(Hi(Tr.isInvalidate()?Tr.toString(!1):Tr.toString(!je),je))}var Lt=We.useMemo(function(){return Xe(B)},[B,yr]),pt=We.useMemo(function(){return Xe(T)},[T,yr]),Ht=We.useMemo(function(){return!Lt||!Fr||Fr.isInvalidate()?!1:Lt.lessEquals(Fr)},[Lt,Fr]),Bt=We.useMemo(function(){return!pt||!Fr||Fr.isInvalidate()?!1:Fr.lessEquals(pt)},[pt,Fr]),lr=gt(Mt.current,Nt),Dr=(0,N.Z)(lr,2),mr=Dr[0],ni=Dr[1],ci=function(je){return Lt&&!je.lessEquals(Lt)?Lt:pt&&!pt.lessEquals(je)?pt:null},gi=function(je){return!ci(je)},kr=function(je,ur){var br=je,qr=gi(br)||br.isEmpty();if(!br.isEmpty()&&!ur&&(br=ci(br)||br,qr=!0),!He&&!Ne&&qr){var on=br.toString(),vi=Fi(on,ur);return vi>=0&&(br=le(ee(on,".",vi)),gi(br)||(br=le(ee(on,".",vi,!0)))),br.equals(Fr)||(bi(br),Li==null||Li(br.isEmpty()?null:At(qt,br)),Sr===void 0&&_t(br,ur)),br}return Fr},Rr=be(),Si=function Tr(je){if(mr(),Kr.current=je,tt(je),!Pr.current){var ur=mi(je),br=le(ur);br.isNaN()||kr(br,!0)}ui==null||ui(je),Rr(function(){var qr=je;Ae||(qr=je.replace(/。/g,".")),qr!==je&&Tr(qr)})},Ei=function(){Pr.current=!0},Xr=function(){Pr.current=!1,Si(Mt.current.value)},ti=function(je){Si(je.target.value)},ri=function(je){var ur;if(!(je&&Ht||!je&&Bt)){Qt.current=!1;var br=le(Ar.current?M(G):G);je||(br=br.negate());var qr=(Fr||le(0)).add(br.toString()),on=kr(qr,!1);yi==null||yi(At(qt,on),{offset:Ar.current?M(G):G,type:je?"up":"down"}),(ur=Mt.current)===null||ur===void 0||ur.focus()}},si=function(je){var ur=le(mi(lt)),br=ur;ur.isNaN()?br=kr(Fr,je):br=kr(ur,je),Sr!==void 0?_t(Fr,!1):br.isNaN()||_t(br,!1)},Hr=function(){Qt.current=!0},fi=function(je){var ur=je.key,br=je.shiftKey;Qt.current=!0,Ar.current=br,ur==="Enter"&&(Pr.current||(Qt.current=!1),si(!1),Er==null||Er(je)),ge!==!1&&!Pr.current&&["Up","ArrowUp","Down","ArrowDown"].includes(ur)&&(ri(ur==="Up"||ur==="ArrowUp"),je.preventDefault())},Ii=function(){Qt.current=!1,Ar.current=!1},Ci=function(){si(!1),ar(!1),Qt.current=!1};return(0,ve.o)(function(){Fr.isInvalidate()||_t(Fr,!1)},[yr]),(0,ve.o)(function(){var Tr=le(Sr);ii(Tr);var je=le(mi(lt));(!Tr.equals(je)||!Qt.current||Xt)&&_t(Tr,Qt.current)},[Sr]),(0,ve.o)(function(){Xt&&ni()},[lt]),We.createElement("div",{className:Me()(kt,V==null?void 0:V.input,zt,(it={},(0,E.Z)(it,"".concat(kt,"-focused"),Nt),(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"),Fr.isNaN()),(0,E.Z)(it,"".concat(kt,"-out-of-range"),!Fr.isInvalidate()&&!gi(Fr)),it)),style:tr,onFocus:function(){ar(!0)},onBlur:Ci,onKeyDown:fi,onKeyUp:Ii,onCompositionStart:Ei,onCompositionEnd:Xr,onBeforeInput:Hr},Ke&&We.createElement(D,{prefixCls:kt,upNode:Je,downNode:W,upDisabled:Ht,downDisabled:Bt,onStep:ri}),We.createElement("div",{className:"".concat(Ce,"-wrap")},We.createElement("input",(0,re.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":T,"aria-valuemax":B,"aria-valuenow":Fr.isInvalidate()?null:Fr.toString(),step:G},me,{ref:(0,Ye.sQ)(Mt,Ge),className:Ce,value:lt,onChange:ti,disabled:Ne,readOnly:He}))))}),jt=We.forwardRef(function(Fe,Ge){var it=Fe.disabled,Rt=Fe.style,kt=Fe.prefixCls,zt=Fe.value,tr=Fe.prefix,T=Fe.suffix,B=Fe.addonBefore,ft=Fe.addonAfter,G=Fe.classes,fe=Fe.className,Sr=Fe.classNames,Ne=(0,d.Z)(Fe,ot),He=We.useRef(null),Je=function(ge){He.current&&(0,ne.nH)(He.current,ge)};return We.createElement(De.BaseInput,{inputElement:We.createElement(sr,(0,re.Z)({prefixCls:kt,disabled:it,classNames:Sr,ref:(0,Ye.sQ)(He,Ge)},Ne)),className:fe,triggerFocus:Je,prefixCls:kt,value:zt,disabled:it,style:Rt,prefix:tr,suffix:T,addonAfter:ft,addonBefore:B,classes:G,classNames:Sr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});jt.displayName="InputNumber";var Pt=jt,Cr=Pt,zr=X(19080),rr=X(36355),Ur=X(92736),li=X(1684),Vr=X(19716),Ze=X(32441),nt=X(33234),Qe=X(9937),Ct=X(17313),Dt=X(74207),ye=X(83116),Oe=X(37613);const et=(Fe,Ge)=>{let{componentCls:it,borderRadiusSM:Rt,borderRadiusLG:kt}=Fe;const zt=Ge==="lg"?kt:Rt;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:Rt,colorBorder:kt,borderRadius:zt,fontSizeLG:tr,controlHeightLG:T,controlHeightSM:B,colorError:ft,paddingInlineSM:G,colorTextDescription:fe,motionDurationMid:Sr,handleHoverColor:Ne,paddingInline:He,paddingBlock:Je,handleBg:W,handleActiveBg:ge,colorTextDisabled:Ee,borderRadiusSM:Ke,borderRadiusLG:V,controlWidth:qt,handleVisible:Ae,handleBorderColor:Xt}=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 ${Rt} ${kt}`,borderRadius:zt,"&-rtl":{direction:"rtl",[`${Ge}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:tr,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:ft}}},"&-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 ${Sr} 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 ${Sr} linear ${Sr}`,[`${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 ${Rt} ${Xt}`,transition:`all ${Sr} 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 ${Sr} linear`,userSelect:"none"})},[`${Ge}-handler-up`]:{borderStartEndRadius:zt},[`${Ge}-handler-down`]:{borderBlockStart:`${it}px ${Rt} ${Xt}`,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:Ee}})},{[`${Ge}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${Ge}-handler-down`]:{borderBlockStartWidth:0}}}]},wt=Fe=>{const{componentCls:Ge,paddingBlock:it,paddingInline:Rt,inputAffixPadding:kt,controlWidth:zt,borderRadiusLG:tr,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:Rt,"&-lg":{borderRadius:tr},"&-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:Rt,marginInlineStart:kt}}})}};var Gt=(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})),dr=function(Fe,Ge){var it={};for(var Rt in Fe)Object.prototype.hasOwnProperty.call(Fe,Rt)&&Ge.indexOf(Rt)<0&&(it[Rt]=Fe[Rt]);if(Fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var kt=0,Rt=Object.getOwnPropertySymbols(Fe);kt<Rt.length;kt++)Ge.indexOf(Rt[kt])<0&&Object.prototype.propertyIsEnumerable.call(Fe,Rt[kt])&&(it[Rt[kt]]=Fe[Rt[kt]]);return it};const Jt=We.forwardRef((Fe,Ge)=>{const{getPrefixCls:it,direction:Rt}=We.useContext(rr.E_),kt=We.useRef(null);We.useImperativeHandle(Ge,()=>kt.current);const{className:zt,rootClassName:tr,size:T,disabled:B,prefixCls:ft,addonBefore:G,addonAfter:fe,prefix:Sr,bordered:Ne=!0,readOnly:He,status:Je,controls:W}=Fe,ge=dr(Fe,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),Ee=it("input-number",ft),[Ke,V]=Gt(Ee),{compactSize:qt,compactItemClassnames:Ae}=(0,nt.ri)(Ee,Rt);let Xt=We.createElement(Pe.Z,{className:`${Ee}-handler-up-inner`}),yr=We.createElement(pe.Z,{className:`${Ee}-handler-down-inner`});const ei=typeof W=="boolean"?W:void 0;typeof W=="object"&&(Xt=typeof W.upIcon=="undefined"?Xt:We.createElement("span",{className:`${Ee}-handler-up-inner`},W.upIcon),yr=typeof W.downIcon=="undefined"?yr:We.createElement("span",{className:`${Ee}-handler-down-inner`},W.downIcon));const{hasFeedback:Li,status:ui,isFormItemInput:Er,feedbackIcon:yi}=We.useContext(Ze.aM),me=(0,zr.F)(ui,Je),Ce=(0,Vr.Z)(Qt=>{var Pr;return(Pr=T!=null?T:qt)!==null&&Pr!==void 0?Pr:Qt}),Mt=We.useContext(li.Z),ct=B!=null?B:Mt,Et=Me()({[`${Ee}-lg`]:Ce==="large",[`${Ee}-sm`]:Ce==="small",[`${Ee}-rtl`]:Rt==="rtl",[`${Ee}-borderless`]:!Ne,[`${Ee}-in-form-item`]:Er},(0,zr.Z)(Ee,me),Ae,V),Nt=`${Ee}-group`,ar=We.createElement(Cr,Object.assign({ref:kt,disabled:ct,className:Me()(zt,tr),upHandler:Xt,downHandler:yr,prefixCls:Ee,readOnly:He,controls:ei,prefix:Sr,suffix:Li&&yi,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:Me()((0,zr.Z)(`${Ee}-affix-wrapper`,me,Li),{[`${Ee}-affix-wrapper-sm`]:Ce==="small",[`${Ee}-affix-wrapper-lg`]:Ce==="large",[`${Ee}-affix-wrapper-rtl`]:Rt==="rtl",[`${Ee}-affix-wrapper-borderless`]:!Ne},V),wrapper:Me()({[`${Nt}-rtl`]:Rt==="rtl",[`${Ee}-wrapper-disabled`]:ct},V),group:Me()({[`${Ee}-group-wrapper-sm`]:Ce==="small",[`${Ee}-group-wrapper-lg`]:Ce==="large",[`${Ee}-group-wrapper-rtl`]:Rt==="rtl"},(0,zr.Z)(`${Ee}-group-wrapper`,me,Li),V)}},ge));return Ke(ar)}),Ue=Jt,Kt=Fe=>We.createElement(Ur.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},We.createElement(Jt,Object.assign({},Fe)));Ue._InternalPanelDoNotUseOrYouWillBeFired=Kt;var wr=Ue},9937:function($r,It,X){"use strict";X.d(It,{M1:function(){return Re},TM:function(){return ue},Xy:function(){return N},bi:function(){return q},e5:function(){return Y},ik:function(){return k},nz:function(){return re},pU:function(){return E},s7:function(){return I},x0:function(){return xe}});var pe=X(17313),Pe=X(74207),rt=X(37613),Me=X(83116);const re=ee=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:ee,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),E=ee=>({borderColor:ee.hoverBorderColor}),Re=ee=>({borderColor:ee.activeBorderColor,boxShadow:ee.activeShadow,outline:0}),N=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:le,fontSizeLG:De,lineHeightLG:ve,borderRadiusLG:Ye,paddingInlineLG:We}=ee;return{padding:`${le}px ${We}px`,fontSize:De,lineHeight:ve,borderRadius:Ye}},xe=ee=>({padding:`${ee.paddingBlockSM}px ${ee.paddingInlineSM}px`,borderRadius:ee.borderRadiusSM}),q=(ee,le)=>{const{componentCls:De,colorError:ve,colorWarning:Ye,errorActiveShadow:We,warningActiveShadow:ut,colorErrorBorderHover:gt,colorWarningBorderHover:de}=ee;return{[`&-status-error:not(${le}-disabled):not(${le}-borderless)${le}`]:{borderColor:ve,"&:hover":{borderColor:gt},"&:focus, &-focused":Object.assign({},Re((0,rt.TS)(ee,{activeBorderColor:ve,activeShadow:We}))),[`${De}-prefix, ${De}-suffix`]:{color:ve}},[`&-status-warning:not(${le}-disabled):not(${le}-borderless)${le}`]:{borderColor:Ye,"&:hover":{borderColor:de},"&:focus, &-focused":Object.assign({},Re((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}`},re(ee.colorTextPlaceholder)),{"&:hover":Object.assign({},E(ee)),"&:focus, &-focused":Object.assign({},Re(ee)),"&-disabled, &[disabled]":Object.assign({},N(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({},xe(ee)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),I=ee=>{const{componentCls:le,antCls:De}=ee;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:ee.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${le}, &-lg > ${le}-group-addon`]:Object.assign({},d(ee)),[`&-sm ${le}, &-sm > ${le}-group-addon`]:Object.assign({},xe(ee)),[`&-lg ${De}-select-single ${De}-select-selector`]:{height:ee.controlHeightLG},[`&-sm ${De}-select-single ${De}-select-selector`]:{height:ee.controlHeightSM},[`> ${le}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${le}-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}},[`${le}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${le}-search-with-button &`]:{zIndex:0}}},[`> ${le}:first-child, ${le}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${De}-select ${De}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${le}-affix-wrapper`]:{[`&:not(:first-child) ${le}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${le}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${le}:last-child, ${le}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${De}-select ${De}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${le}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${le}-search &`]:{borderStartStartRadius:ee.borderRadius,borderEndStartRadius:ee.borderRadius}},[`&:not(:first-child), ${le}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${le}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,pe.dF)()),{[`${le}-group-addon, ${le}-group-wrap, > ${le}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:ee.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${le}-affix-wrapper,
& > ${le}-number-affix-wrapper,
& > ${De}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-ee.lineWidth,borderInlineEndWidth:ee.lineWidth},[`${le}`]:{float:"none"},[`& > ${De}-select > ${De}-select-selector,
& > ${De}-select-auto-complete ${le},
& > ${De}-cascader-picker ${le},
& > ${le}-group-wrapper ${le}`]:{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 ${le},
& > ${De}-cascader-picker:first-child ${le}`]:{borderStartStartRadius:ee.borderRadius,borderEndStartRadius:ee.borderRadius},[`& > *:last-child,
& > ${De}-select:last-child > ${De}-select-selector,
& > ${De}-cascader-picker:last-child ${le},
& > ${De}-cascader-picker-focused:last-child ${le}`]:{borderInlineEndWidth:ee.lineWidth,borderStartEndRadius:ee.borderRadius,borderEndEndRadius:ee.borderRadius},[`& > ${De}-select-auto-complete ${le}`]:{verticalAlign:"top"},[`${le}-group-wrapper + ${le}-group-wrapper`]:{marginInlineStart:-ee.lineWidth,[`${le}-affix-wrapper`]:{borderRadius:0}},[`${le}-group-wrapper:not(:last-child)`]:{[`&${le}-search > ${le}-group`]:{[`& > ${le}-group-addon > ${le}-search-button`]:{borderRadius:0},[`& > ${le}`]:{borderStartStartRadius:ee.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:ee.borderRadius}}}})}},O=ee=>{const{componentCls:le,controlHeightSM:De,lineWidth:ve}=ee,We=(De-ve*2-16)/2;return{[le]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(ee)),k(ee)),q(ee,le)),{'&[type="color"]':{height:ee.controlHeight,[`&${le}-lg`]:{height:ee.controlHeightLG},[`&${le}-sm`]:{height:De,paddingTop:We,paddingBottom:We}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},H=ee=>{const{componentCls:le}=ee;return{[`${le}-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:le,inputAffixPadding:De,colorTextDescription:ve,motionDurationSlow:Ye,colorIcon:We,colorIconHover:ut,iconCls:gt}=ee;return{[`${le}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k(ee)),{display:"inline-flex",[`&:not(${le}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},E(ee)),{zIndex:1,[`${le}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${le}[disabled]`]:{background:"transparent"}},[`> input${le}`]:{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"'},[`${le}`]:{"&-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}}}),H(ee)),{[`${gt}${le}-password-icon`]:{color:We,cursor:"pointer",transition:`all ${Ye}`,"&:hover":{color:ut}}}),q(ee,`${le}-affix-wrapper`))}},ae=ee=>{const{componentCls:le,colorError:De,colorWarning:ve,borderRadiusLG:Ye,borderRadiusSM:We}=ee;return{[`${le}-group`]:Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(ee)),I(ee)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${le}-group-addon`]:{borderRadius:Ye,fontSize:ee.fontSizeLG}},"&-sm":{[`${le}-group-addon`]:{borderRadius:We}},"&-status-error":{[`${le}-group-addon`]:{color:De,borderColor:De}},"&-status-warning":{[`${le}-group-addon`]:{color:ve,borderColor:ve}},"&-disabled":{[`${le}-group-addon`]:Object.assign({},N(ee))},[`&:not(${le}-compact-first-item):not(${le}-compact-last-item)${le}-compact-item`]:{[`${le}, ${le}-group-addon`]:{borderRadius:0}},[`&:not(${le}-compact-last-item)${le}-compact-first-item`]:{[`${le}, ${le}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${le}-compact-first-item)${le}-compact-last-item`]:{[`${le}, ${le}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Z=ee=>{const{componentCls:le,antCls:De}=ee,ve=`${le}-search`;return{[ve]:{[`${le}`]:{"&:hover, &:focus":{borderColor:ee.colorPrimaryHover,[`+ ${le}-group-addon ${ve}-button:not(${De}-btn-primary)`]:{borderInlineStartColor:ee.colorPrimaryHover}}},[`${le}-affix-wrapper`]:{borderRadius:0},[`${le}-lg`]:{lineHeight:ee.lineHeightLG-2e-4},[`> ${le}-group`]:{[`> ${le}-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"},[`&${le}-compact-item`]:{[`&:not(${le}-compact-last-item)`]:{[`${le}-group-addon`]:{[`${le}-search-button`]:{marginInlineEnd:-ee.lineWidth,borderRadius:0}}},[`&:not(${le}-compact-first-item)`]:{[`${le},${le}-affix-wrapper`]:{borderRadius:0}},[`> ${le}-group-addon ${le}-search-button,
> ${le},
${le}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${le}-affix-wrapper-focused`]:{zIndex:2}}}}},j=ee=>{const{componentCls:le,paddingLG:De}=ee,ve=`${le}-textarea`;return{[ve]:{position:"relative","&-show-count":{[`> ${le}`]:{height:"100%"},[`${le}-data-count`]:{position:"absolute",bottom:-ee.fontSize*ee.lineHeight,insetInlineEnd:0,color:ee.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${le}`]:{paddingInlineEnd:De}},[`&-affix-wrapper${ve}-has-feedback`]:{[`${le}`]:{paddingInlineEnd:De}},[`&-affix-wrapper${le}-affix-wrapper`]:{padding:0,[`> textarea${le}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${le}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${le}-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:le,fontSize:De,lineHeight:ve,lineWidth:Ye,controlHeightSM:We,controlHeightLG:ut,fontSizeLG:gt,lineHeightLG:de,paddingSM:ie,controlPaddingHorizontalSM:ce,controlPaddingHorizontal:he,colorFillAlter:Le,colorPrimaryHover:Se,controlOutlineWidth:D,controlOutline:M,colorErrorOutline:ne,colorWarningOutline:be}=ee;return{paddingBlock:Math.max(Math.round((le-De*ve)/2*10)/10-Ye,3),paddingBlockSM:Math.max(Math.round((We-De*ve)/2*10)/10-Ye,0),paddingBlockLG:Math.ceil((ut-gt*de)/2*10)/10-Ye,paddingInline:ie-Ye,paddingInlineSM:ce-Ye,paddingInlineLG:he-Ye,addonBg:Le,activeBorderColor:Se,hoverBorderColor:Se,activeShadow:`0 0 0 ${D}px ${M}`,errorActiveShadow:`0 0 0 ${D}px ${ne}`,warningActiveShadow:`0 0 0 ${D}px ${be}`}};It.ZP=(0,Me.Z)("Input",ee=>{const le=(0,rt.TS)(ee,Y(ee));return[O(le),j(le),se(le),ae(le),Z(le),(0,Pe.c)(le)]},ue)},5112:function($r,It,X){"use strict";X.d(It,{ZP:function(){return M}});var pe=X(92310),Pe=X.n(pe),rt=X(18929),Me=X(26112),re=X(59301),E=X(36355),Re=X(19716);const N=re.createContext(null),d=N.Provider;var xe=N;const q=re.createContext(null),k=q.Provider;var I=X(5630),O=X(8654),H=X(1684),se=X(32441),ae=X(17313),Z=X(83116),j=X(37613);const Y=ne=>{const{componentCls:be,antCls:st}=ne,ot=`${be}-group`;return{[ot]:Object.assign(Object.assign({},(0,ae.Wf)(ne)),{display:"inline-block",fontSize:0,[`&${ot}-rtl`]:{direction:"rtl"},[`${st}-badge ${st}-badge-count`]:{zIndex:1},[`> ${st}-badge:not(:first-child) > ${st}-button-wrapper`]:{borderInlineStart:"none"}})}},ue=ne=>{const{componentCls:be,wrapperMarginInlineEnd:st,colorPrimary:ot,radioSize:At,motionDurationSlow:Xe,motionDurationMid:sr,motionEaseInOutCirc:jt,colorBgContainer:Pt,colorBorder:Cr,lineWidth:zr,dotSize:rr,colorBgContainerDisabled:Ur,colorTextDisabled:li,paddingXS:Vr,dotColorDisabled:Ze,lineType:nt,radioDotDisabledSize:Qe,wireframe:Ct,colorWhite:Dt}=ne,ye=`${be}-inner`;return{[`${be}-wrapper`]:Object.assign(Object.assign({},(0,ae.Wf)(ne)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:st,cursor:"pointer",[`&${be}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:ne.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${be}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${zr}px ${nt} ${ot}`,borderRadius:"50%",visibility:"hidden",content:'""'},[be]:Object.assign(Object.assign({},(0,ae.Wf)(ne)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${be}-wrapper:hover &,
&:hover ${ye}`]:{borderColor:ot},[`${be}-input:focus-visible + ${ye}`]:Object.assign({},(0,ae.oN)(ne)),[`${be}:hover::after, ${be}-wrapper:hover &::after`]:{visibility:"visible"},[`${be}-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:Pt,borderColor:Cr,borderStyle:"solid",borderWidth:zr,borderRadius:"50%",transition:`all ${sr}`},[`${be}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${be}-checked`]:{[ye]:{borderColor:ot,backgroundColor:Ct?Pt:ot,"&::after":{transform:`scale(${rr/At})`,opacity:1,transition:`all ${Xe} ${jt}`}}},[`${be}-disabled`]:{cursor:"not-allowed",[ye]:{backgroundColor:Ur,borderColor:Cr,cursor:"not-allowed","&::after":{backgroundColor:Ze}},[`${be}-input`]:{cursor:"not-allowed"},[`${be}-disabled + span`]:{color:li,cursor:"not-allowed"},[`&${be}-checked`]:{[ye]:{"&::after":{transform:`scale(${Qe/At})`}}}},[`span${be} + *`]:{paddingInlineStart:Vr,paddingInlineEnd:Vr}})}},ee=ne=>{const{buttonColor:be,controlHeight:st,componentCls:ot,lineWidth:At,lineType:Xe,colorBorder:sr,motionDurationSlow:jt,motionDurationMid:Pt,buttonPaddingInline:Cr,fontSize:zr,buttonBg:rr,fontSizeLG:Ur,controlHeightLG:li,controlHeightSM:Vr,paddingXS:Ze,borderRadius:nt,borderRadiusSM:Qe,borderRadiusLG:Ct,buttonCheckedBg:Dt,buttonSolidCheckedColor:ye,colorTextDisabled:Oe,colorBgContainerDisabled:et,buttonCheckedBgDisabled:vt,buttonCheckedColorDisabled:wt,colorPrimary:Gt,colorPrimaryHover:dr,colorPrimaryActive:Jt,buttonSolidCheckedBg:Ue,buttonSolidCheckedHoverBg:Kt,buttonSolidCheckedActiveBg:wr}=ne;return{[`${ot}-button-wrapper`]:{position:"relative",display:"inline-block",height:st,margin:0,paddingInline:Cr,paddingBlock:0,color:be,fontSize:zr,lineHeight:`${st-At*2}px`,background:rr,border:`${At}px ${Xe} ${sr}`,borderBlockStartWidth:At+.02,borderInlineStartWidth:0,borderInlineEndWidth:At,cursor:"pointer",transition:[`color ${Pt}`,`background ${Pt}`,`box-shadow ${Pt}`].join(","),a:{color:be},[`> ${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:sr,transition:`background-color ${jt}`,content:'""'}},"&:first-child":{borderInlineStart:`${At}px ${Xe} ${sr}`,borderStartStartRadius:nt,borderEndStartRadius:nt},"&:last-child":{borderStartEndRadius:nt,borderEndEndRadius:nt},"&:first-child:last-child":{borderRadius:nt},[`${ot}-group-large &`]:{height:li,fontSize:Ur,lineHeight:`${li-At*2}px`,"&:first-child":{borderStartStartRadius:Ct,borderEndStartRadius:Ct},"&:last-child":{borderStartEndRadius:Ct,borderEndEndRadius:Ct}},[`${ot}-group-small &`]:{height:Vr,paddingInline:Ze-At,paddingBlock:0,lineHeight:`${Vr-At*2}px`,"&:first-child":{borderStartStartRadius:Qe,borderEndStartRadius:Qe},"&:last-child":{borderStartEndRadius:Qe,borderEndEndRadius:Qe}},"&:hover":{position:"relative",color:Gt},"&:has(:focus-visible)":Object.assign({},(0,ae.oN)(ne)),[`${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:Gt,background:Dt,borderColor:Gt,"&::before":{backgroundColor:Gt},"&:first-child":{borderColor:Gt},"&:hover":{color:dr,borderColor:dr,"&::before":{backgroundColor:dr}},"&:active":{color:Jt,borderColor:Jt,"&::before":{backgroundColor:Jt}}},[`${ot}-group-solid &-checked:not(${ot}-button-wrapper-disabled)`]:{color:ye,background:Ue,borderColor:Ue,"&:hover":{color:ye,background:Kt,borderColor:Kt},"&:active":{color:ye,background:wr,borderColor:wr}},"&-disabled":{color:Oe,backgroundColor:et,borderColor:sr,cursor:"not-allowed","&:first-child, &:hover":{color:Oe,backgroundColor:et,borderColor:sr}},[`&-disabled${ot}-button-wrapper-checked`]:{color:wt,backgroundColor:vt,borderColor:sr,boxShadow:"none"}}}},le=ne=>ne-4*2;var De=(0,Z.Z)("Radio",ne=>{const{controlOutline:be,controlOutlineWidth:st,radioSize:ot}=ne,At=`0 0 0 ${st}px ${be}`,Xe=At,sr=le(ot),jt=(0,j.TS)(ne,{radioDotDisabledSize:sr,radioFocusShadow:At,radioButtonFocusShadow:Xe});return[Y(jt),ue(jt),ee(jt)]},ne=>{const{wireframe:be,padding:st,marginXS:ot,lineWidth:At,fontSizeLG:Xe,colorText:sr,colorBgContainer:jt,colorTextDisabled:Pt,controlItemBgActiveDisabled:Cr,colorTextLightSolid:zr,colorPrimary:rr,colorPrimaryHover:Ur,colorPrimaryActive:li}=ne,Vr=4,Ze=Xe,nt=be?le(Ze):Ze-(Vr+At)*2;return{radioSize:Ze,dotSize:nt,dotColorDisabled:Pt,buttonSolidCheckedColor:zr,buttonSolidCheckedBg:rr,buttonSolidCheckedHoverBg:Ur,buttonSolidCheckedActiveBg:li,buttonBg:jt,buttonCheckedBg:jt,buttonColor:sr,buttonCheckedBgDisabled:Cr,buttonCheckedColorDisabled:Pt,buttonPaddingInline:st-At,wrapperMarginInlineEnd:ot}}),ve=X(14088),Ye=X(4572),We=function(ne,be){var st={};for(var ot in ne)Object.prototype.hasOwnProperty.call(ne,ot)&&be.indexOf(ot)<0&&(st[ot]=ne[ot]);if(ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var At=0,ot=Object.getOwnPropertySymbols(ne);At<ot.length;At++)be.indexOf(ot[At])<0&&Object.prototype.propertyIsEnumerable.call(ne,ot[At])&&(st[ot[At]]=ne[ot[At]]);return st};const ut=(ne,be)=>{var st,ot;const At=re.useContext(xe),Xe=re.useContext(q),{getPrefixCls:sr,direction:jt,radio:Pt}=re.useContext(E.E_),Cr=re.useRef(null),zr=(0,O.sQ)(be,Cr),{isFormItemInput:rr}=re.useContext(se.aM),Ur=Jt=>{var Ue,Kt;(Ue=ne.onChange)===null||Ue===void 0||Ue.call(ne,Jt),(Kt=At==null?void 0:At.onChange)===null||Kt===void 0||Kt.call(At,Jt)},{prefixCls:li,className:Vr,rootClassName:Ze,children:nt,style:Qe}=ne,Ct=We(ne,["prefixCls","className","rootClassName","children","style"]),Dt=sr("radio",li),ye=((At==null?void 0:At.optionType)||Xe)==="button",Oe=ye?`${Dt}-button`:Dt,[et,vt]=De(Dt),wt=Object.assign({},Ct),Gt=re.useContext(H.Z);At&&(wt.name=At.name,wt.onChange=Ur,wt.checked=ne.value===At.value,wt.disabled=(st=wt.disabled)!==null&&st!==void 0?st:At.disabled),wt.disabled=(ot=wt.disabled)!==null&&ot!==void 0?ot:Gt;const dr=Pe()(`${Oe}-wrapper`,{[`${Oe}-wrapper-checked`]:wt.checked,[`${Oe}-wrapper-disabled`]:wt.disabled,[`${Oe}-wrapper-rtl`]:jt==="rtl",[`${Oe}-wrapper-in-form-item`]:rr},Pt==null?void 0:Pt.className,Vr,Ze,vt);return et(re.createElement(ve.Z,{component:"Radio",disabled:wt.disabled},re.createElement("label",{className:dr,style:Object.assign(Object.assign({},Pt==null?void 0:Pt.style),Qe),onMouseEnter:ne.onMouseEnter,onMouseLeave:ne.onMouseLeave},re.createElement(I.Z,Object.assign({},wt,{className:Pe()(wt.className,!ye&&Ye.A),type:"radio",prefixCls:Oe,ref:zr})),nt!==void 0?re.createElement("span",null,nt):null)))};var de=re.forwardRef(ut);const ie=re.forwardRef((ne,be)=>{const{getPrefixCls:st,direction:ot}=re.useContext(E.E_),[At,Xe]=(0,rt.Z)(ne.defaultValue,{value:ne.value}),sr=Ue=>{const Kt=At,wr=Ue.target.value;"value"in ne||Xe(wr);const{onChange:Fe}=ne;Fe&&wr!==Kt&&Fe(Ue)},{prefixCls:jt,className:Pt,rootClassName:Cr,options:zr,buttonStyle:rr="outline",disabled:Ur,children:li,size:Vr,style:Ze,id:nt,onMouseEnter:Qe,onMouseLeave:Ct,onFocus:Dt,onBlur:ye}=ne,Oe=st("radio",jt),et=`${Oe}-group`,[vt,wt]=De(Oe);let Gt=li;zr&&zr.length>0&&(Gt=zr.map(Ue=>typeof Ue=="string"||typeof Ue=="number"?re.createElement(de,{key:Ue.toString(),prefixCls:Oe,disabled:Ur,value:Ue,checked:At===Ue},Ue):re.createElement(de,{key:`radio-group-value-options-${Ue.value}`,prefixCls:Oe,disabled:Ue.disabled||Ur,value:Ue.value,checked:At===Ue.value,title:Ue.title,style:Ue.style},Ue.label)));const dr=(0,Re.Z)(Vr),Jt=Pe()(et,`${et}-${rr}`,{[`${et}-${dr}`]:dr,[`${et}-rtl`]:ot==="rtl"},Pt,Cr,wt);return vt(re.createElement("div",Object.assign({},(0,Me.Z)(ne,{aria:!0,data:!0}),{className:Jt,style:Ze,onMouseEnter:Qe,onMouseLeave:Ct,onFocus:Dt,onBlur:ye,id:nt,ref:be}),re.createElement(d,{value:{onChange:sr,value:At,disabled:ne.disabled,name:ne.name,optionType:ne.optionType}},Gt)))});var ce=re.memo(ie),he=function(ne,be){var st={};for(var ot in ne)Object.prototype.hasOwnProperty.call(ne,ot)&&be.indexOf(ot)<0&&(st[ot]=ne[ot]);if(ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var At=0,ot=Object.getOwnPropertySymbols(ne);At<ot.length;At++)be.indexOf(ot[At])<0&&Object.prototype.propertyIsEnumerable.call(ne,ot[At])&&(st[ot[At]]=ne[ot[At]]);return st};const Le=(ne,be)=>{const{getPrefixCls:st}=re.useContext(E.E_),{prefixCls:ot}=ne,At=he(ne,["prefixCls"]),Xe=st("radio",ot);return re.createElement(k,{value:"button"},re.createElement(de,Object.assign({prefixCls:Xe},At,{type:"radio",ref:be})))};var Se=re.forwardRef(Le);const D=de;D.Button=Se,D.Group=ce,D.__ANT_RADIO=!0;var M=D},8378:function($r,It){"use strict";const X=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`}}});It.Z=X},92899:function($r,It,X){"use strict";X.d(It,{Fm:function(){return k}});var pe=X(93083),Pe=X(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}}),Me=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}}),re=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}}),Re=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}}),N=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}}),xe=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}}),q={"move-up":{inKeyframes:d,outKeyframes:xe},"move-down":{inKeyframes:rt,outKeyframes:Me},"move-left":{inKeyframes:re,outKeyframes:E},"move-right":{inKeyframes:Re,outKeyframes:N}},k=(I,O)=>{const{antCls:H}=I,se=`${H}-${O}`,{inKeyframes:ae,outKeyframes:Z}=q[O];return[(0,Pe.R)(se,ae,Z,I.motionDurationMid),{[`
${se}-enter,
${se}-appear
`]:{opacity:0,animationTimingFunction:I.motionEaseOutCirc},[`${se}-leave`]:{animationTimingFunction:I.motionEaseInOutCirc}}]}},13826:function($r,It,X){"use strict";X.d(It,{Qt:function(){return re},Uw:function(){return Me},fJ:function(){return rt},ly:function(){return E},oN:function(){return k}});var pe=X(93083),Pe=X(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}}),Me=new pe.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),re=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}}),Re=new pe.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),N=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}}),xe=new pe.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),q={"slide-up":{inKeyframes:rt,outKeyframes:Me},"slide-down":{inKeyframes:re,outKeyframes:E},"slide-left":{inKeyframes:Re,outKeyframes:N},"slide-right":{inKeyframes:d,outKeyframes:xe}},k=(I,O)=>{const{antCls:H}=I,se=`${H}-${O}`,{inKeyframes:ae,outKeyframes:Z}=q[O];return[(0,Pe.R)(se,ae,Z,I.motionDurationMid),{[`
${se}-enter,
${se}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:I.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${se}-leave`]:{animationTimingFunction:I.motionEaseInQuint}}]}},19447:function($r,It,X){"use strict";X.d(It,{ZP:function(){return re},fS:function(){return rt},qN:function(){return Pe}});var pe=X(47585);const Pe=8;function rt(E){const Re=Pe,{contentRadius:N,limitVerticalRadius:d}=E,xe=N>12?N+2:12;return{dropdownArrowOffset:xe,dropdownArrowOffsetVertical:d?Re:xe}}function Me(E,Re){return E?Re:{}}function re(E,Re){const{componentCls:N,sizePopupArrow:d,borderRadiusXS:xe,borderRadiusOuter:q,boxShadowPopoverArrow:k}=E,{colorBg:I,contentRadius:O=E.borderRadiusLG,limitVerticalRadius:H,arrowDistance:se=0,arrowPlacement:ae={left:!0,right:!0,top:!0,bottom:!0}}=Re,{dropdownArrowOffsetVertical:Z,dropdownArrowOffset:j}=rt({contentRadius:O,limitVerticalRadius:H});return{[N]:Object.assign(Object.assign(Object.assign(Object.assign({[`${N}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,pe.r)(d,xe,q,I,k)),{"&:before":{background:I}})]},Me(!!ae.top,{[[`&-placement-top ${N}-arrow`,`&-placement-topLeft ${N}-arrow`,`&-placement-topRight ${N}-arrow`].join(",")]:{bottom:se,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${N}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${N}-arrow`]:{left:{_skip_check_:!0,value:j}},[`&-placement-topRight ${N}-arrow`]:{right:{_skip_check_:!0,value:j}}})),Me(!!ae.bottom,{[[`&-placement-bottom ${N}-arrow`,`&-placement-bottomLeft ${N}-arrow`,`&-placement-bottomRight ${N}-arrow`].join(",")]:{top:se,transform:"translateY(-100%)"},[`&-placement-bottom ${N}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${N}-arrow`]:{left:{_skip_check_:!0,value:j}},[`&-placement-bottomRight ${N}-arrow`]:{right:{_skip_check_:!0,value:j}}})),Me(!!ae.left,{[[`&-placement-left ${N}-arrow`,`&-placement-leftTop ${N}-arrow`,`&-placement-leftBottom ${N}-arrow`].join(",")]:{right:{_skip_check_:!0,value:se},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${N}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${N}-arrow`]:{top:Z},[`&-placement-leftBottom ${N}-arrow`]:{bottom:Z}})),Me(!!ae.right,{[[`&-placement-right ${N}-arrow`,`&-placement-rightTop ${N}-arrow`,`&-placement-rightBottom ${N}-arrow`].join(",")]:{left:{_skip_check_:!0,value:se},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${N}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${N}-arrow`]:{top:Z},[`&-placement-rightBottom ${N}-arrow`]:{bottom:Z}}))}}},47585:function($r,It,X){"use strict";X.d(It,{r:function(){return pe}});const pe=(Pe,rt,Me,re,E)=>{const Re=Pe/2,N=0,d=Re,xe=Me*1/Math.sqrt(2),q=Re-Me*(1-1/Math.sqrt(2)),k=Re-rt*(1/Math.sqrt(2)),I=Me*(Math.sqrt(2)-1)+rt*(1/Math.sqrt(2)),O=2*Re-k,H=I,se=2*Re-xe,ae=q,Z=2*Re-N,j=d,Y=Re*Math.sqrt(2)+Me*(Math.sqrt(2)-2),ue=Me*(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:re,clipPath:{_multi_value_:!0,value:[`polygon(${ue}px 100%, 50% ${ue}px, ${2*Re-ue}px 100%, ${ue}px 100%)`,`path('M ${N} ${d} A ${Me} ${Me} 0 0 0 ${xe} ${q} L ${k} ${I} A ${rt} ${rt} 0 0 1 ${O} ${H} L ${se} ${ae} A ${Me} ${Me} 0 0 0 ${Z} ${j} 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($r,It,X){"use strict";X.d(It,{default:function(){return yi}});var pe=X(99267),Pe=X(18785),rt=X(62772),Me=X(92310),re=X.n(Me),E=X(72308),Re=X(49618),N=X(77321),d=X(52487),xe=X(62853),q=X(74416),k=X(59301),I=X(49658),O=X(18929),H=X(77900),se=(0,k.createContext)(null),ae=k.forwardRef(function(me,Ce){var Mt=me.prefixCls,ct=me.className,Et=me.style,Nt=me.id,ar=me.active,Qt=me.tabKey,Pr=me.children;return k.createElement("div",{id:Nt&&"".concat(Nt,"-panel-").concat(Qt),role:"tabpanel",tabIndex:ar?0:-1,"aria-labelledby":Nt&&"".concat(Nt,"-tab-").concat(Qt),"aria-hidden":!ar,style:Et,className:re()(Mt,ar&&"".concat(Mt,"-active"),ct),ref:Ce},Pr)}),Z=ae,j=["key","forceRender","style","className"];function Y(me){var Ce=me.id,Mt=me.activeKey,ct=me.animated,Et=me.tabPosition,Nt=me.destroyInactiveTabPane,ar=k.useContext(se),Qt=ar.prefixCls,Pr=ar.tabs,Ar=ct.tabPane,oi="".concat(Qt,"-tabpane");return k.createElement("div",{className:re()("".concat(Qt,"-content-holder"))},k.createElement("div",{className:re()("".concat(Qt,"-content"),"".concat(Qt,"-content-").concat(Et),(0,Re.Z)({},"".concat(Qt,"-content-animated"),Ar))},Pr.map(function(Lr){var Fr=Lr.key,ii=Lr.forceRender,bi=Lr.style,Fi=Lr.className,mi=(0,q.Z)(Lr,j),Kr=Fr===Mt;return k.createElement(H.default,(0,E.Z)({key:Fr,visible:Kr,forceRender:ii,removeOnLeave:!!Nt,leavedClassName:"".concat(oi,"-hidden")},ct.tabPaneMotion),function(Hi,Yr){var Br=Hi.style,lt=Hi.className;return k.createElement(Z,(0,E.Z)({},mi,{prefixCls:oi,id:Ce,tabKey:Fr,animated:Ar,active:Kr,style:(0,N.Z)((0,N.Z)({},bi),Br),className:re()(Fi,lt),ref:Yr}))})})))}var ue=X(80702),ee=X(29301),le=X(6089),De=X(8654),ve={width:0,height:0,left:0,top:0};function Ye(me,Ce,Mt){return(0,k.useMemo)(function(){for(var ct,Et=new Map,Nt=Ce.get((ct=me[0])===null||ct===void 0?void 0:ct.key)||ve,ar=Nt.left+Nt.width,Qt=0;Qt<me.length;Qt+=1){var Pr=me[Qt].key,Ar=Ce.get(Pr);if(!Ar){var oi;Ar=Ce.get((oi=me[Qt-1])===null||oi===void 0?void 0:oi.key)||ve}var Lr=Et.get(Pr)||(0,N.Z)({},Ar);Lr.right=ar-Lr.left-Lr.width,Et.set(Pr,Lr)}return Et},[me.map(function(ct){return ct.key}).join("_"),Ce,Mt])}function We(me,Ce){var Mt=k.useRef(me),ct=k.useState({}),Et=(0,d.Z)(ct,2),Nt=Et[1];function ar(Qt){var Pr=typeof Qt=="function"?Qt(Mt.current):Qt;Pr!==Mt.current&&Ce(Pr,Mt.current),Mt.current=Pr,Nt({})}return[Mt.current,ar]}var ut=.1,gt=.01,de=20,ie=Math.pow(.995,de);function ce(me,Ce){var Mt=(0,k.useState)(),ct=(0,d.Z)(Mt,2),Et=ct[0],Nt=ct[1],ar=(0,k.useState)(0),Qt=(0,d.Z)(ar,2),Pr=Qt[0],Ar=Qt[1],oi=(0,k.useState)(0),Lr=(0,d.Z)(oi,2),Fr=Lr[0],ii=Lr[1],bi=(0,k.useState)(),Fi=(0,d.Z)(bi,2),mi=Fi[0],Kr=Fi[1],Hi=(0,k.useRef)();function Yr(pt){var Ht=pt.touches[0],Bt=Ht.screenX,lr=Ht.screenY;Nt({x:Bt,y:lr}),window.clearInterval(Hi.current)}function Br(pt){if(Et){pt.preventDefault();var Ht=pt.touches[0],Bt=Ht.screenX,lr=Ht.screenY;Nt({x:Bt,y:lr});var Dr=Bt-Et.x,mr=lr-Et.y;Ce(Dr,mr);var ni=Date.now();Ar(ni),ii(ni-Pr),Kr({x:Dr,y:mr})}}function lt(){if(Et&&(Nt(null),Kr(null),mi)){var pt=mi.x/Fr,Ht=mi.y/Fr,Bt=Math.abs(pt),lr=Math.abs(Ht);if(Math.max(Bt,lr)<ut)return;var Dr=pt,mr=Ht;Hi.current=window.setInterval(function(){if(Math.abs(Dr)<gt&&Math.abs(mr)<gt){window.clearInterval(Hi.current);return}Dr*=ie,mr*=ie,Ce(Dr*de,mr*de)},de)}}var tt=(0,k.useRef)();function _t(pt){var Ht=pt.deltaX,Bt=pt.deltaY,lr=0,Dr=Math.abs(Ht),mr=Math.abs(Bt);Dr===mr?lr=tt.current==="x"?Ht:Bt:Dr>mr?(lr=Ht,tt.current="x"):(lr=Bt,tt.current="y"),Ce(-lr,-lr)&&pt.preventDefault()}var Lt=(0,k.useRef)(null);Lt.current={onTouchStart:Yr,onTouchMove:Br,onTouchEnd:lt,onWheel:_t},k.useEffect(function(){function pt(Dr){Lt.current.onTouchStart(Dr)}function Ht(Dr){Lt.current.onTouchMove(Dr)}function Bt(Dr){Lt.current.onTouchEnd(Dr)}function lr(Dr){Lt.current.onWheel(Dr)}return document.addEventListener("touchmove",Ht,{passive:!1}),document.addEventListener("touchend",Bt,{passive:!1}),me.current.addEventListener("touchstart",pt,{passive:!1}),me.current.addEventListener("wheel",lr),function(){document.removeEventListener("touchmove",Ht),document.removeEventListener("touchend",Bt)}},[])}var he=X(34280);function Le(me){var Ce=(0,k.useState)(0),Mt=(0,d.Z)(Ce,2),ct=Mt[0],Et=Mt[1],Nt=(0,k.useRef)(0),ar=(0,k.useRef)();return ar.current=me,(0,he.o)(function(){var Qt;(Qt=ar.current)===null||Qt===void 0||Qt.call(ar)},[ct]),function(){Nt.current===ct&&(Nt.current+=1,Et(Nt.current))}}function Se(me){var Ce=(0,k.useRef)([]),Mt=(0,k.useState)({}),ct=(0,d.Z)(Mt,2),Et=ct[1],Nt=(0,k.useRef)(typeof me=="function"?me():me),ar=Le(function(){var Pr=Nt.current;Ce.current.forEach(function(Ar){Pr=Ar(Pr)}),Ce.current=[],Nt.current=Pr,Et({})});function Qt(Pr){Ce.current.push(Pr),ar()}return[Nt.current,Qt]}var D={width:0,height:0,left:0,top:0,right:0};function M(me,Ce,Mt,ct,Et,Nt,ar){var Qt=ar.tabs,Pr=ar.tabPosition,Ar=ar.rtl,oi,Lr,Fr;return["top","bottom"].includes(Pr)?(oi="width",Lr=Ar?"right":"left",Fr=Math.abs(Mt)):(oi="height",Lr="top",Fr=-Mt),(0,k.useMemo)(function(){if(!Qt.length)return[0,0];for(var ii=Qt.length,bi=ii,Fi=0;Fi<ii;Fi+=1){var mi=me.get(Qt[Fi].key)||D;if(mi[Lr]+mi[oi]>Fr+Ce){bi=Fi-1;break}}for(var Kr=0,Hi=ii-1;Hi>=0;Hi-=1){var Yr=me.get(Qt[Hi].key)||D;if(Yr[Lr]<Fr){Kr=Hi+1;break}}return Kr>=bi?[0,0]:[Kr,bi]},[me,Ce,ct,Et,Nt,Fr,Pr,Qt.map(function(ii){return ii.key}).join("_"),Ar])}function ne(me){var Ce;return me instanceof Map?(Ce={},me.forEach(function(Mt,ct){Ce[ct]=Mt})):Ce=me,JSON.stringify(Ce)}var be="TABS_DQ";function st(me){return String(me).replace(/"/g,be)}function ot(me,Ce,Mt,ct){return!(!Mt||ct||me===!1||me===void 0&&(Ce===!1||Ce===null))}function At(me,Ce){var Mt=me.prefixCls,ct=me.editable,Et=me.locale,Nt=me.style;return!ct||ct.showAdd===!1?null:k.createElement("button",{ref:Ce,type:"button",className:"".concat(Mt,"-nav-add"),style:Nt,"aria-label":(Et==null?void 0:Et.addAriaLabel)||"Add tab",onClick:function(Qt){ct.onEdit("add",{event:Qt})}},ct.addIcon||"+")}var Xe=k.forwardRef(At),sr=k.forwardRef(function(me,Ce){var Mt=me.position,ct=me.prefixCls,Et=me.extra;if(!Et)return null;var Nt,ar={};return(0,xe.Z)(Et)==="object"&&!k.isValidElement(Et)?ar=Et:ar.right=Et,Mt==="right"&&(Nt=ar.right),Mt==="left"&&(Nt=ar.left),Nt?k.createElement("div",{className:"".concat(ct,"-extra-content"),ref:Ce},Nt):null}),jt=sr,Pt=X(31561),Cr=X(15285),zr=X(10228);function rr(me,Ce){var Mt=me.prefixCls,ct=me.id,Et=me.tabs,Nt=me.locale,ar=me.mobile,Qt=me.moreIcon,Pr=Qt===void 0?"More":Qt,Ar=me.moreTransitionName,oi=me.style,Lr=me.className,Fr=me.editable,ii=me.tabBarGutter,bi=me.rtl,Fi=me.removeAriaLabel,mi=me.onTabClick,Kr=me.getPopupContainer,Hi=me.popupClassName,Yr=(0,k.useState)(!1),Br=(0,d.Z)(Yr,2),lt=Br[0],tt=Br[1],_t=(0,k.useState)(null),Lt=(0,d.Z)(_t,2),pt=Lt[0],Ht=Lt[1],Bt="".concat(ct,"-more-popup"),lr="".concat(Mt,"-dropdown"),Dr=pt!==null?"".concat(Bt,"-").concat(pt):null,mr=Nt==null?void 0:Nt.dropdownAriaLabel;function ni(Xr,ti){Xr.preventDefault(),Xr.stopPropagation(),Fr.onEdit("remove",{key:ti,event:Xr})}var ci=k.createElement(Cr.ZP,{onClick:function(ti){var ri=ti.key,si=ti.domEvent;mi(ri,si),tt(!1)},prefixCls:"".concat(lr,"-menu"),id:Bt,tabIndex:-1,role:"listbox","aria-activedescendant":Dr,selectedKeys:[pt],"aria-label":mr!==void 0?mr:"expanded dropdown"},Et.map(function(Xr){var ti=Xr.closable,ri=Xr.disabled,si=Xr.closeIcon,Hr=Xr.key,fi=Xr.label,Ii=ot(ti,si,Fr,ri);return k.createElement(Cr.sN,{key:Hr,id:"".concat(Bt,"-").concat(Hr),role:"option","aria-controls":ct&&"".concat(ct,"-panel-").concat(Hr),disabled:ri},k.createElement("span",null,fi),Ii&&k.createElement("button",{type:"button","aria-label":Fi||"remove",tabIndex:0,className:"".concat(lr,"-menu-item-remove"),onClick:function(Tr){Tr.stopPropagation(),ni(Tr,Hr)}},si||Fr.removeIcon||"\xD7"))}));function gi(Xr){for(var ti=Et.filter(function(Ii){return!Ii.disabled}),ri=ti.findIndex(function(Ii){return Ii.key===pt})||0,si=ti.length,Hr=0;Hr<si;Hr+=1){ri=(ri+Xr+si)%si;var fi=ti[ri];if(!fi.disabled){Ht(fi.key);return}}}function kr(Xr){var ti=Xr.which;if(!lt){[zr.Z.DOWN,zr.Z.SPACE,zr.Z.ENTER].includes(ti)&&(tt(!0),Xr.preventDefault());return}switch(ti){case zr.Z.UP:gi(-1),Xr.preventDefault();break;case zr.Z.DOWN:gi(1),Xr.preventDefault();break;case zr.Z.ESC:tt(!1);break;case zr.Z.SPACE:case zr.Z.ENTER:pt!==null&&mi(pt,Xr);break}}(0,k.useEffect)(function(){var Xr=document.getElementById(Dr);Xr&&Xr.scrollIntoView&&Xr.scrollIntoView(!1)},[pt]),(0,k.useEffect)(function(){lt||Ht(null)},[lt]);var Rr=(0,Re.Z)({},bi?"marginRight":"marginLeft",ii);Et.length||(Rr.visibility="hidden",Rr.order=1);var Si=re()((0,Re.Z)({},"".concat(lr,"-rtl"),bi)),Ei=ar?null:k.createElement(Pt.Z,{prefixCls:lr,overlay:ci,trigger:["hover"],visible:Et.length?lt:!1,transitionName:Ar,onVisibleChange:tt,overlayClassName:re()(Si,Hi),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Kr},k.createElement("button",{type:"button",className:"".concat(Mt,"-nav-more"),style:Rr,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Bt,id:"".concat(ct,"-more"),"aria-expanded":lt,onKeyDown:kr},Pr));return k.createElement("div",{className:re()("".concat(Mt,"-nav-operations"),Lr),style:oi,ref:Ce},Ei,k.createElement(Xe,{prefixCls:Mt,locale:Nt,editable:Fr}))}var Ur=k.memo(k.forwardRef(rr),function(me,Ce){return Ce.tabMoving});function li(me){var Ce,Mt=me.prefixCls,ct=me.id,Et=me.active,Nt=me.tab,ar=Nt.key,Qt=Nt.label,Pr=Nt.disabled,Ar=Nt.closeIcon,oi=me.closable,Lr=me.renderWrapper,Fr=me.removeAriaLabel,ii=me.editable,bi=me.onClick,Fi=me.onFocus,mi=me.style,Kr="".concat(Mt,"-tab"),Hi=ot(oi,Ar,ii,Pr);function Yr(tt){Pr||bi(tt)}function Br(tt){tt.preventDefault(),tt.stopPropagation(),ii.onEdit("remove",{key:ar,event:tt})}var lt=k.createElement("div",{key:ar,"data-node-key":st(ar),className:re()(Kr,(Ce={},(0,Re.Z)(Ce,"".concat(Kr,"-with-remove"),Hi),(0,Re.Z)(Ce,"".concat(Kr,"-active"),Et),(0,Re.Z)(Ce,"".concat(Kr,"-disabled"),Pr),Ce)),style:mi,onClick:Yr},k.createElement("div",{role:"tab","aria-selected":Et,id:ct&&"".concat(ct,"-tab-").concat(ar),className:"".concat(Kr,"-btn"),"aria-controls":ct&&"".concat(ct,"-panel-").concat(ar),"aria-disabled":Pr,tabIndex:Pr?null:0,onClick:function(_t){_t.stopPropagation(),Yr(_t)},onKeyDown:function(_t){[zr.Z.SPACE,zr.Z.ENTER].includes(_t.which)&&(_t.preventDefault(),Yr(_t))},onFocus:Fi},Qt),Hi&&k.createElement("button",{type:"button","aria-label":Fr||"remove",tabIndex:0,className:"".concat(Kr,"-remove"),onClick:function(_t){_t.stopPropagation(),Br(_t)}},Ar||ii.removeIcon||"\xD7"));return Lr?Lr(lt):lt}var Vr=li,Ze=X(16089),nt=function(Ce){var Mt=Ce.activeTabOffset,ct=Ce.horizontal,Et=Ce.rtl,Nt=Ce.indicatorSize,ar=(0,k.useState)(),Qt=(0,d.Z)(ar,2),Pr=Qt[0],Ar=Qt[1],oi=(0,k.useRef)(),Lr=function(bi){return typeof Nt=="function"?Nt(bi):typeof Nt=="number"?Nt:bi};function Fr(){Ze.Z.cancel(oi.current)}return(0,k.useEffect)(function(){var ii={};return Mt&&(ct?(Et?(ii.right=Mt.right+Mt.width/2,ii.transform="translateX(50%)"):(ii.left=Mt.left+Mt.width/2,ii.transform="translateX(-50%)"),ii.width=Lr(Mt.width)):(ii.top=Mt.top+Mt.height/2,ii.transform="translateY(-50%)",ii.height=Lr(Mt.height))),Fr(),oi.current=(0,Ze.Z)(function(){Ar(ii)}),Fr},[Mt,ct,Et,Nt]),{style:Pr}},Qe=nt,Ct=function(Ce){var Mt=Ce.current||{},ct=Mt.offsetWidth,Et=ct===void 0?0:ct,Nt=Mt.offsetHeight,ar=Nt===void 0?0:Nt;return[Et,ar]},Dt=function(Ce,Mt){return Ce[Mt?0:1]};function ye(me,Ce){var Mt,ct=k.useContext(se),Et=ct.prefixCls,Nt=ct.tabs,ar=me.className,Qt=me.style,Pr=me.id,Ar=me.animated,oi=me.activeKey,Lr=me.rtl,Fr=me.extra,ii=me.editable,bi=me.locale,Fi=me.tabPosition,mi=me.tabBarGutter,Kr=me.children,Hi=me.onTabClick,Yr=me.onTabScroll,Br=me.indicatorSize,lt=(0,k.useRef)(),tt=(0,k.useRef)(),_t=(0,k.useRef)(),Lt=(0,k.useRef)(),pt=(0,k.useRef)(),Ht=(0,k.useRef)(),Bt=(0,k.useRef)(),lr=Fi==="top"||Fi==="bottom",Dr=We(0,function(_i,Di){lr&&Yr&&Yr({direction:_i>Di?"left":"right"})}),mr=(0,d.Z)(Dr,2),ni=mr[0],ci=mr[1],gi=We(0,function(_i,Di){!lr&&Yr&&Yr({direction:_i>Di?"top":"bottom"})}),kr=(0,d.Z)(gi,2),Rr=kr[0],Si=kr[1],Ei=(0,k.useState)([0,0]),Xr=(0,d.Z)(Ei,2),ti=Xr[0],ri=Xr[1],si=(0,k.useState)([0,0]),Hr=(0,d.Z)(si,2),fi=Hr[0],Ii=Hr[1],Ci=(0,k.useState)([0,0]),Tr=(0,d.Z)(Ci,2),je=Tr[0],ur=Tr[1],br=(0,k.useState)([0,0]),qr=(0,d.Z)(br,2),on=qr[0],vi=qr[1],Ni=Se(new Map),Gr=(0,d.Z)(Ni,2),gn=Gr[0],wn=Gr[1],Gi=Ye(Nt,gn,fi[0]),ts=Dt(ti,lr),Xn=Dt(fi,lr),zn=Dt(je,lr),Vn=Dt(on,lr),Or=ts<Xn+zn,Ai=Or?ts-Vn:ts-zn,Ui="".concat(Et,"-nav-operations-hidden"),Vi=0,Wn=0;lr&&Lr?(Vi=0,Wn=Math.max(0,Xn-Ai)):(Vi=Math.min(0,Ai-Xn),Wn=0);function bn(_i){return _i<Vi?Vi:_i>Wn?Wn:_i}var nn=(0,k.useRef)(),On=(0,k.useState)(),$i=(0,d.Z)(On,2),rs=$i[0],Wr=$i[1];function ss(){Wr(Date.now())}function Jn(){window.clearTimeout(nn.current)}ce(Lt,function(_i,Di){function ln(Tn,Qn){Tn(function(Ir){var Jr=bn(Ir+Qn);return Jr})}return Or?(lr?ln(ci,_i):ln(Si,Di),Jn(),ss(),!0):!1}),(0,k.useEffect)(function(){return Jn(),rs&&(nn.current=window.setTimeout(function(){Wr(0)},100)),Jn},[rs]);var Sn=M(Gi,Ai,lr?ni:Rr,Xn,zn,Vn,(0,N.Z)((0,N.Z)({},me),{},{tabs:Nt})),Ri=(0,d.Z)(Sn,2),ps=Ri[0],ys=Ri[1],us=(0,le.Z)(function(){var _i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oi,Di=Gi.get(_i)||{width:0,height:0,left:0,right:0,top:0};if(lr){var ln=ni;Lr?Di.right<ni?ln=Di.right:Di.right+Di.width>ni+Ai&&(ln=Di.right+Di.width-Ai):Di.left<-ni?ln=-Di.left:Di.left+Di.width>-ni+Ai&&(ln=-(Di.left+Di.width-Ai)),Si(0),ci(bn(ln))}else{var Tn=Rr;Di.top<-Rr?Tn=-Di.top:Di.top+Di.height>-Rr+Ai&&(Tn=-(Di.top+Di.height-Ai)),ci(0),Si(bn(Tn))}}),pi={};Fi==="top"||Fi==="bottom"?pi[Lr?"marginRight":"marginLeft"]=mi:pi.marginTop=mi;var bs=Nt.map(function(_i,Di){var ln=_i.key;return k.createElement(Vr,{id:Pr,prefixCls:Et,key:ln,tab:_i,style:Di===0?void 0:pi,closable:_i.closable,editable:ii,active:ln===oi,renderWrapper:Kr,removeAriaLabel:bi==null?void 0:bi.removeAriaLabel,onClick:function(Qn){Hi(ln,Qn)},onFocus:function(){us(ln),ss(),Lt.current&&(Lr||(Lt.current.scrollLeft=0),Lt.current.scrollTop=0)}})}),_s=function(){return wn(function(){var Di=new Map;return Nt.forEach(function(ln){var Tn,Qn=ln.key,Ir=(Tn=pt.current)===null||Tn===void 0?void 0:Tn.querySelector('[data-node-key="'.concat(st(Qn),'"]'));Ir&&Di.set(Qn,{width:Ir.offsetWidth,height:Ir.offsetHeight,left:Ir.offsetLeft,top:Ir.offsetTop})}),Di})};(0,k.useEffect)(function(){_s()},[Nt.map(function(_i){return _i.key}).join("_")]);var ir=Le(function(){var _i=Ct(lt),Di=Ct(tt),ln=Ct(_t);ri([_i[0]-Di[0]-ln[0],_i[1]-Di[1]-ln[1]]);var Tn=Ct(Bt);ur(Tn);var Qn=Ct(Ht);vi(Qn);var Ir=Ct(pt);Ii([Ir[0]-Tn[0],Ir[1]-Tn[1]]),_s()}),vn=Nt.slice(0,ps),xs=Nt.slice(ys+1),cs=[].concat((0,ue.Z)(vn),(0,ue.Z)(xs)),hn=Gi.get(oi),dn=Qe({activeTabOffset:hn,horizontal:lr,rtl:Lr,indicatorSize:Br}),Oi=dn.style;(0,k.useEffect)(function(){us()},[oi,Vi,Wn,ne(hn),ne(Gi),lr]),(0,k.useEffect)(function(){ir()},[Lr]);var sn=!!cs.length,Un="".concat(Et,"-nav-wrap"),jn,Bn,kn,Pi;return lr?Lr?(Bn=ni>0,jn=ni!==Wn):(jn=ni<0,Bn=ni!==Vi):(kn=Rr<0,Pi=Rr!==Vi),k.createElement(ee.Z,{onResize:ir},k.createElement("div",{ref:(0,De.x1)(Ce,lt),role:"tablist",className:re()("".concat(Et,"-nav"),ar),style:Qt,onKeyDown:function(){ss()}},k.createElement(jt,{ref:tt,position:"left",extra:Fr,prefixCls:Et}),k.createElement(ee.Z,{onResize:ir},k.createElement("div",{className:re()(Un,(Mt={},(0,Re.Z)(Mt,"".concat(Un,"-ping-left"),jn),(0,Re.Z)(Mt,"".concat(Un,"-ping-right"),Bn),(0,Re.Z)(Mt,"".concat(Un,"-ping-top"),kn),(0,Re.Z)(Mt,"".concat(Un,"-ping-bottom"),Pi),Mt)),ref:Lt},k.createElement(ee.Z,{onResize:ir},k.createElement("div",{ref:pt,className:"".concat(Et,"-nav-list"),style:{transform:"translate(".concat(ni,"px, ").concat(Rr,"px)"),transition:rs?"none":void 0}},bs,k.createElement(Xe,{ref:Bt,prefixCls:Et,locale:bi,editable:ii,style:(0,N.Z)((0,N.Z)({},bs.length===0?void 0:pi),{},{visibility:sn?"hidden":null})}),k.createElement("div",{className:re()("".concat(Et,"-ink-bar"),(0,Re.Z)({},"".concat(Et,"-ink-bar-animated"),Ar.inkBar)),style:Oi}))))),k.createElement(Ur,(0,E.Z)({},me,{removeAriaLabel:bi==null?void 0:bi.removeAriaLabel,ref:Ht,prefixCls:Et,tabs:cs,className:!sn&&Ui,tabMoving:!!rs})),k.createElement(jt,{ref:_t,position:"right",extra:Fr,prefixCls:Et})))}var Oe=k.forwardRef(ye),et=["renderTabBar"],vt=["label","key"];function wt(me){var Ce=me.renderTabBar,Mt=(0,q.Z)(me,et),ct=k.useContext(se),Et=ct.tabs;if(Ce){var Nt=(0,N.Z)((0,N.Z)({},Mt),{},{panes:Et.map(function(ar){var Qt=ar.label,Pr=ar.key,Ar=(0,q.Z)(ar,vt);return k.createElement(Z,(0,E.Z)({tab:Qt,key:Pr,tabKey:Pr},Ar))})});return Ce(Nt,Oe)}return k.createElement(Oe,Mt)}var Gt=X(48736);function dr(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Ce;return me===!1?Ce={inkBar:!1,tabPane:!1}:me===!0?Ce={inkBar:!0,tabPane:!1}:Ce=(0,N.Z)({inkBar:!0},(0,xe.Z)(me)==="object"?me:{}),Ce.tabPaneMotion&&Ce.tabPane===void 0&&(Ce.tabPane=!0),!Ce.tabPaneMotion&&Ce.tabPane&&(Ce.tabPane=!1),Ce}var Jt=["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 Kt(me,Ce){var Mt,ct=me.id,Et=me.prefixCls,Nt=Et===void 0?"rc-tabs":Et,ar=me.className,Qt=me.items,Pr=me.direction,Ar=me.activeKey,oi=me.defaultActiveKey,Lr=me.editable,Fr=me.animated,ii=me.tabPosition,bi=ii===void 0?"top":ii,Fi=me.tabBarGutter,mi=me.tabBarStyle,Kr=me.tabBarExtraContent,Hi=me.locale,Yr=me.moreIcon,Br=me.moreTransitionName,lt=me.destroyInactiveTabPane,tt=me.renderTabBar,_t=me.onChange,Lt=me.onTabClick,pt=me.onTabScroll,Ht=me.getPopupContainer,Bt=me.popupClassName,lr=me.indicatorSize,Dr=(0,q.Z)(me,Jt),mr=k.useMemo(function(){return(Qt||[]).filter(function(vi){return vi&&(0,xe.Z)(vi)==="object"&&"key"in vi})},[Qt]),ni=Pr==="rtl",ci=dr(Fr),gi=(0,k.useState)(!1),kr=(0,d.Z)(gi,2),Rr=kr[0],Si=kr[1];(0,k.useEffect)(function(){Si((0,I.Z)())},[]);var Ei=(0,O.Z)(function(){var vi;return(vi=mr[0])===null||vi===void 0?void 0:vi.key},{value:Ar,defaultValue:oi}),Xr=(0,d.Z)(Ei,2),ti=Xr[0],ri=Xr[1],si=(0,k.useState)(function(){return mr.findIndex(function(vi){return vi.key===ti})}),Hr=(0,d.Z)(si,2),fi=Hr[0],Ii=Hr[1];(0,k.useEffect)(function(){var vi=mr.findIndex(function(Gr){return Gr.key===ti});if(vi===-1){var Ni;vi=Math.max(0,Math.min(fi,mr.length-1)),ri((Ni=mr[vi])===null||Ni===void 0?void 0:Ni.key)}Ii(vi)},[mr.map(function(vi){return vi.key}).join("_"),ti,fi]);var Ci=(0,O.Z)(null,{value:ct}),Tr=(0,d.Z)(Ci,2),je=Tr[0],ur=Tr[1];(0,k.useEffect)(function(){ct||(ur("rc-tabs-".concat(Ue)),Ue+=1)},[]);function br(vi,Ni){Lt==null||Lt(vi,Ni);var Gr=vi!==ti;ri(vi),Gr&&(_t==null||_t(vi))}var qr={id:je,activeKey:ti,animated:ci,tabPosition:bi,rtl:ni,mobile:Rr},on=(0,N.Z)((0,N.Z)({},qr),{},{editable:Lr,locale:Hi,moreIcon:Yr,moreTransitionName:Br,tabBarGutter:Fi,onTabClick:br,onTabScroll:pt,extra:Kr,style:mi,panes:null,getPopupContainer:Ht,popupClassName:Bt,indicatorSize:lr});return k.createElement(se.Provider,{value:{tabs:mr,prefixCls:Nt}},k.createElement("div",(0,E.Z)({ref:Ce,id:ct,className:re()(Nt,"".concat(Nt,"-").concat(bi),(Mt={},(0,Re.Z)(Mt,"".concat(Nt,"-mobile"),Rr),(0,Re.Z)(Mt,"".concat(Nt,"-editable"),Lr),(0,Re.Z)(Mt,"".concat(Nt,"-rtl"),ni),Mt),ar)},Dr),k.createElement(wt,(0,E.Z)({},on,{renderTabBar:tt})),k.createElement(Y,(0,E.Z)({destroyInactiveTabPane:lt},qr,{animated:ci}))))}var wr=k.forwardRef(Kt),Fe=wr,Ge=Fe,it=X(36355),Rt=X(19716),zt=()=>null,tr=X(62892);const T={motionAppear:!1,motionEnter:!0,motionLeave:!0};function B(me){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Mt;return Ce===!1?Mt={inkBar:!1,tabPane:!1}:Ce===!0?Mt={inkBar:!0,tabPane:!0}:Mt=Object.assign({inkBar:!0},typeof Ce=="object"?Ce:{}),Mt.tabPane&&(Mt.tabPaneMotion=Object.assign(Object.assign({},T),{motionName:(0,tr.m)(me,"switch")})),Mt}var ft=X(11592),G=function(me,Ce){var Mt={};for(var ct in me)Object.prototype.hasOwnProperty.call(me,ct)&&Ce.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++)Ce.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(Ce=>Ce)}function Sr(me,Ce){if(me)return me;const Mt=(0,ft.Z)(Ce).map(ct=>{if(k.isValidElement(ct)){const{key:Et,props:Nt}=ct,ar=Nt||{},{tab:Qt}=ar,Pr=G(ar,["tab"]);return Object.assign(Object.assign({key:String(Et)},Pr),{label:Qt})}return null});return fe(Mt)}var Ne=X(17313),He=X(83116),Je=X(37613),W=X(13826),Ee=me=>{const{componentCls:Ce,motionDurationSlow:Mt}=me;return[{[Ce]:{[`${Ce}-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:Ce,tabsCardPadding:Mt,cardBg:ct,cardGutter:Et,colorBorderSecondary:Nt,itemSelectedColor:ar}=me;return{[`${Ce}-card`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab`]:{margin:0,padding:Mt,background:ct,border:`${me.lineWidth}px ${me.lineType} ${Nt}`,transition:`all ${me.motionDurationSlow} ${me.motionEaseInOut}`},[`${Ce}-tab-active`]:{color:ar,background:me.colorBgContainer},[`${Ce}-ink-bar`]:{visibility:"hidden"}},[`&${Ce}-top, &${Ce}-bottom`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab + ${Ce}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Et}px`}}}},[`&${Ce}-top`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab`]:{borderRadius:`${me.borderRadiusLG}px ${me.borderRadiusLG}px 0 0`},[`${Ce}-tab-active`]:{borderBottomColor:me.colorBgContainer}}},[`&${Ce}-bottom`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab`]:{borderRadius:`0 0 ${me.borderRadiusLG}px ${me.borderRadiusLG}px`},[`${Ce}-tab-active`]:{borderTopColor:me.colorBgContainer}}},[`&${Ce}-left, &${Ce}-right`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab + ${Ce}-tab`]:{marginTop:`${Et}px`}}},[`&${Ce}-left`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab`]:{borderRadius:{_skip_check_:!0,value:`${me.borderRadiusLG}px 0 0 ${me.borderRadiusLG}px`}},[`${Ce}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:me.colorBgContainer}}}},[`&${Ce}-right`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${me.borderRadiusLG}px ${me.borderRadiusLG}px 0`}},[`${Ce}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:me.colorBgContainer}}}}}}},V=me=>{const{componentCls:Ce,itemHoverColor:Mt,dropdownEdgeChildVerticalPadding:ct}=me;return{[`${Ce}-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"},[`${Ce}-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:Ce,margin:Mt,colorBorderSecondary:ct,horizontalMargin:Et,verticalItemPadding:Nt,verticalItemMargin:ar}=me;return{[`${Ce}-top, ${Ce}-bottom`]:{flexDirection:"column",[`> ${Ce}-nav, > div > ${Ce}-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:"''"},[`${Ce}-ink-bar`]:{height:me.lineWidthBold,"&-animated":{transition:`width ${me.motionDurationSlow}, left ${me.motionDurationSlow},
right ${me.motionDurationSlow}`}},[`${Ce}-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},[`&${Ce}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Ce}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Ce}-top`]:{[`> ${Ce}-nav,
> div > ${Ce}-nav`]:{"&::before":{bottom:0},[`${Ce}-ink-bar`]:{bottom:0}}},[`${Ce}-bottom`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{order:1,marginTop:`${Mt}px`,marginBottom:0,"&::before":{top:0},[`${Ce}-ink-bar`]:{top:0}},[`> ${Ce}-content-holder, > div > ${Ce}-content-holder`]:{order:0}},[`${Ce}-left, ${Ce}-right`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{flexDirection:"column",minWidth:me.controlHeight*1.25,[`${Ce}-tab`]:{padding:Nt,textAlign:"center"},[`${Ce}-tab + ${Ce}-tab`]:{margin:ar},[`${Ce}-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},[`&${Ce}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Ce}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Ce}-ink-bar`]:{width:me.lineWidthBold,"&-animated":{transition:`height ${me.motionDurationSlow}, top ${me.motionDurationSlow}`}},[`${Ce}-nav-list, ${Ce}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Ce}-left`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Ce}-content-holder, > div > ${Ce}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${me.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${me.lineWidth}px ${me.lineType} ${me.colorBorder}`},[`> ${Ce}-content > ${Ce}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:me.paddingLG}}}},[`${Ce}-right`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{order:1,[`${Ce}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Ce}-content-holder, > div > ${Ce}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-me.lineWidth},borderRight:{_skip_check_:!0,value:`${me.lineWidth}px ${me.lineType} ${me.colorBorder}`},[`> ${Ce}-content > ${Ce}-tabpane`]:{paddingRight:{_skip_check_:!0,value:me.paddingLG}}}}}},Ae=me=>{const{componentCls:Ce,cardPaddingSM:Mt,cardPaddingLG:ct,horizontalItemPaddingSM:Et,horizontalItemPaddingLG:Nt}=me;return{[Ce]:{"&-small":{[`> ${Ce}-nav`]:{[`${Ce}-tab`]:{padding:Et,fontSize:me.titleFontSizeSM}}},"&-large":{[`> ${Ce}-nav`]:{[`${Ce}-tab`]:{padding:Nt,fontSize:me.titleFontSizeLG}}}},[`${Ce}-card`]:{[`&${Ce}-small`]:{[`> ${Ce}-nav`]:{[`${Ce}-tab`]:{padding:Mt}},[`&${Ce}-bottom`]:{[`> ${Ce}-nav ${Ce}-tab`]:{borderRadius:`0 0 ${me.borderRadius}px ${me.borderRadius}px`}},[`&${Ce}-top`]:{[`> ${Ce}-nav ${Ce}-tab`]:{borderRadius:`${me.borderRadius}px ${me.borderRadius}px 0 0`}},[`&${Ce}-right`]:{[`> ${Ce}-nav ${Ce}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${me.borderRadius}px ${me.borderRadius}px 0`}}},[`&${Ce}-left`]:{[`> ${Ce}-nav ${Ce}-tab`]:{borderRadius:{_skip_check_:!0,value:`${me.borderRadius}px 0 0 ${me.borderRadius}px`}}}},[`&${Ce}-large`]:{[`> ${Ce}-nav`]:{[`${Ce}-tab`]:{padding:ct}}}}}},Xt=me=>{const{componentCls:Ce,itemActiveColor:Mt,itemHoverColor:ct,iconCls:Et,tabsHorizontalItemMargin:Nt,horizontalItemPadding:ar,itemSelectedColor:Qt,itemColor:Pr}=me,Ar=`${Ce}-tab`;return{[Ar]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:ar,fontSize:me.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Pr,"&-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},[`&${Ar}-active ${Ar}-btn`]:{color:Qt,textShadow:me.tabsActiveTextShadow},[`&${Ar}-disabled`]:{color:me.colorTextDisabled,cursor:"not-allowed"},[`&${Ar}-disabled ${Ar}-btn, &${Ar}-disabled ${Ce}-remove`]:{"&:focus, &:active":{color:me.colorTextDisabled}},[`& ${Ar}-remove ${Et}`]:{margin:0},[Et]:{marginRight:{_skip_check_:!0,value:me.marginSM}}},[`${Ar} + ${Ar}`]:{margin:{_skip_check_:!0,value:Nt}}}},yr=me=>{const{componentCls:Ce,tabsHorizontalItemMarginRTL:Mt,iconCls:ct,cardGutter:Et}=me;return{[`${Ce}-rtl`]:{direction:"rtl",[`${Ce}-nav`]:{[`${Ce}-tab`]:{margin:{_skip_check_:!0,value:Mt},[`${Ce}-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`}},[`${Ce}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${me.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${me.marginXXS}px`},[ct]:{margin:0}}}},[`&${Ce}-left`]:{[`> ${Ce}-nav`]:{order:1},[`> ${Ce}-content-holder`]:{order:0}},[`&${Ce}-right`]:{[`> ${Ce}-nav`]:{order:0},[`> ${Ce}-content-holder`]:{order:1}},[`&${Ce}-card${Ce}-top, &${Ce}-card${Ce}-bottom`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-tab + ${Ce}-tab`]:{marginRight:{_skip_check_:!0,value:Et},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Ce}-dropdown-rtl`]:{direction:"rtl"},[`${Ce}-menu-item`]:{[`${Ce}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},ei=me=>{const{componentCls:Ce,tabsCardPadding:Mt,cardHeight:ct,cardGutter:Et,itemHoverColor:Nt,itemActiveColor:ar,colorBorderSecondary:Qt}=me;return{[Ce]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ne.Wf)(me)),{display:"flex",[`> ${Ce}-nav, > div > ${Ce}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Ce}-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"}},[`${Ce}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${me.motionDurationSlow}`},[`${Ce}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Ce}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Ce}-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:"''"}},[`${Ce}-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} ${Qt}`,borderRadius:`${me.borderRadiusLG}px ${me.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:me.colorText,transition:`all ${me.motionDurationSlow} ${me.motionEaseInOut}`,"&:hover":{color:Nt},"&:active, &:focus:not(:focus-visible)":{color:ar}},(0,Ne.Qy)(me))},[`${Ce}-extra-content`]:{flex:"none"},[`${Ce}-ink-bar`]:{position:"absolute",background:me.inkBarColor,pointerEvents:"none"}}),Xt(me)),{[`${Ce}-content`]:{position:"relative",width:"100%"},[`${Ce}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Ce}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Ce}-centered`]:{[`> ${Ce}-nav, > div > ${Ce}-nav`]:{[`${Ce}-nav-wrap`]:{[`&:not([class*='${Ce}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Li=(0,He.Z)("Tabs",me=>{const Ce=(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(Ce),yr(Ce),qt(Ce),V(Ce),Ke(Ce),ei(Ce),Ee(Ce)]},me=>{const Ce=me.controlHeightLG;return{zIndexPopup:me.zIndexPopupBase+50,cardBg:me.colorFillAlter,cardHeight:Ce,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,Ce){var Mt={};for(var ct in me)Object.prototype.hasOwnProperty.call(me,ct)&&Ce.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++)Ce.indexOf(ct[Et])<0&&Object.prototype.propertyIsEnumerable.call(me,ct[Et])&&(Mt[ct[Et]]=me[ct[Et]]);return Mt};const Er=me=>{const{type:Ce,className:Mt,rootClassName:ct,size:Et,onEdit:Nt,hideAdd:ar,centered:Qt,addIcon:Pr,popupClassName:Ar,children:oi,items:Lr,animated:Fr,style:ii,indicatorSize:bi}=me,Fi=ui(me,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:mi,moreIcon:Kr=k.createElement(Pe.Z,null)}=Fi,{direction:Hi,tabs:Yr,getPrefixCls:Br,getPopupContainer:lt}=k.useContext(it.E_),tt=Br("tabs",mi),[_t,Lt]=Li(tt);let pt;Ce==="editable-card"&&(pt={onEdit:(ni,ci)=>{let{key:gi,event:kr}=ci;Nt==null||Nt(ni==="add"?kr:gi,ni)},removeIcon:k.createElement(pe.Z,null),addIcon:Pr||k.createElement(rt.Z,null),showAdd:ar!==!0});const Ht=Br(),Bt=Sr(Lr,oi),lr=B(tt,Fr),Dr=(0,Rt.Z)(Et),mr=Object.assign(Object.assign({},Yr==null?void 0:Yr.style),ii);return _t(k.createElement(Ge,Object.assign({direction:Hi,getPopupContainer:lt,moreTransitionName:`${Ht}-slide-up`},Fi,{items:Bt,className:re()({[`${tt}-${Dr}`]:Dr,[`${tt}-card`]:["card","editable-card"].includes(Ce),[`${tt}-editable-card`]:Ce==="editable-card",[`${tt}-centered`]:Qt},Yr==null?void 0:Yr.className,Mt,ct,Lt),popupClassName:re()(Ar,Lt),style:mr,editable:pt,moreIcon:Kr,prefixCls:tt,animated:lr,indicatorSize:bi!=null?bi:Yr==null?void 0:Yr.indicatorSize})))};Er.TabPane=zt;var yi=Er},33166:function($r,It,X){"use strict";X.d(It,{i:function(){return pe}});const pe=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function($r,It,X){"use strict";X.d(It,{Z:function(){return Pe}});var pe=X(33166);function Pe(rt,Me){return pe.i.reduce((re,E)=>{const Re=rt[`${E}1`],N=rt[`${E}3`],d=rt[`${E}6`],xe=rt[`${E}7`];return Object.assign(Object.assign({},re),Me(E,{lightColor:Re,lightBorderColor:N,darkColor:d,textColor:xe}))},{})}},6848:function($r,It,X){"use strict";X.d(It,{Z:function(){return ut}});var pe=X(59301),Pe=X(92310),rt=X.n(Pe),Me=X(55477),re=X(18929),E=X(62892),Re=X(79676),N=X(92343),d=X(36355),xe=X(33234),q=X(88088),k=X(17313),I=X(29878),O=X(19447),H=X(45157),se=X(37613),ae=X(83116);const Z=gt=>{const{componentCls:de,tooltipMaxWidth:ie,tooltipColor:ce,tooltipBg:he,tooltipBorderRadius:Le,zIndexPopup:Se,controlHeight:D,boxShadowSecondary:M,paddingSM:ne,paddingXS:be,tooltipRadiusOuter:st}=gt;return[{[de]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,k.Wf)(gt)),{position:"absolute",zIndex:Se,display:"block",width:"max-content",maxWidth:ie,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:`${ne/2}px ${be}px`,color:ce,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:he,borderRadius:Le,boxShadow:M,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${de}-inner`]:{borderRadius:Math.min(Le,O.qN)}},[`${de}-content`]:{position:"relative"}}),(0,H.Z)(gt,(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)(gt,{borderRadiusOuter:st}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:Le,limitVerticalRadius:!0}),{[`${de}-pure`]:{position:"relative",maxWidth:"none",margin:gt.sizePopupArrow}}]};var j=(gt,de)=>(0,ae.Z)("Tooltip",ce=>{if(de===!1)return[];const{borderRadius:he,colorTextLightSolid:Le,colorBgDefault:Se,borderRadiusOuter:D}=ce,M=(0,se.TS)(ce,{tooltipMaxWidth:250,tooltipColor:Le,tooltipBorderRadius:he,tooltipBg:Se,tooltipRadiusOuter:D>4?4:D});return[Z(M),(0,I._y)(ce,"zoom-big-fast")]},ce=>{let{zIndexPopupBase:he,colorBgSpotlight:Le}=ce;return{zIndexPopup:he+70,colorBgDefault:Le}},{resetStyle:!1})(gt),Y=X(36785);function ue(gt,de){const ie=(0,Y.o2)(de),ce=rt()({[`${gt}-${de}`]:de&&ie}),he={},Le={};return de&&!ie&&(he.background=de,Le["--antd-arrow-background-color"]=de),{className:ce,overlayStyle:he,arrowStyle:Le}}var le=gt=>{const{prefixCls:de,className:ie,placement:ce="top",title:he,color:Le,overlayInnerStyle:Se}=gt,{getPrefixCls:D}=pe.useContext(d.E_),M=D("tooltip",de),[ne,be]=j(M,!0),st=ue(M,Le),ot=st.arrowStyle,At=Object.assign(Object.assign({},Se),st.overlayStyle),Xe=rt()(be,M,`${M}-pure`,`${M}-placement-${ce}`,ie,st.className);return ne(pe.createElement("div",{className:Xe,style:ot},pe.createElement("div",{className:`${M}-arrow`}),pe.createElement(Me.G,Object.assign({},gt,{className:be,prefixCls:M,overlayInnerStyle:At}),he)))},De=function(gt,de){var ie={};for(var ce in gt)Object.prototype.hasOwnProperty.call(gt,ce)&&de.indexOf(ce)<0&&(ie[ce]=gt[ce]);if(gt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var he=0,ce=Object.getOwnPropertySymbols(gt);he<ce.length;he++)de.indexOf(ce[he])<0&&Object.prototype.propertyIsEnumerable.call(gt,ce[he])&&(ie[ce[he]]=gt[ce[he]]);return ie};const ve=(gt,de)=>{const ie={},ce=Object.assign({},gt);return de.forEach(he=>{gt&&he in gt&&(ie[he]=gt[he],delete ce[he])}),{picked:ie,omitted:ce}};function Ye(gt,de){const ie=gt.type;if((ie.__ANT_BUTTON===!0||gt.type==="button")&&gt.props.disabled||ie.__ANT_SWITCH===!0&&(gt.props.disabled||gt.props.loading)||ie.__ANT_RADIO===!0&&gt.props.disabled){const{picked:ce,omitted:he}=ve(gt.props.style,["position","left","right","top","bottom","float","display","zIndex"]),Le=Object.assign(Object.assign({display:"inline-block"},ce),{cursor:"not-allowed",width:gt.props.block?"100%":void 0}),Se=Object.assign(Object.assign({},he),{pointerEvents:"none"}),D=(0,N.Tm)(gt,{style:Se,className:null});return pe.createElement("span",{style:Le,className:rt()(gt.props.className,`${de}-disabled-compatible-wrapper`)},D)}return gt}const We=pe.forwardRef((gt,de)=>{var ie,ce;const{prefixCls:he,openClassName:Le,getTooltipContainer:Se,overlayClassName:D,color:M,overlayInnerStyle:ne,children:be,afterOpenChange:st,afterVisibleChange:ot,destroyTooltipOnHide:At,arrow:Xe=!0,title:sr,overlay:jt,builtinPlacements:Pt,arrowPointAtCenter:Cr=!1,autoAdjustOverflow:zr=!0}=gt,rr=!!Xe,[,Ur]=(0,q.Z)(),{getPopupContainer:li,getPrefixCls:Vr,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,re.Z)(!1,{value:(ie=gt.open)!==null&&ie!==void 0?ie:gt.visible,defaultValue:(ce=gt.defaultOpen)!==null&&ce!==void 0?ce:gt.defaultVisible}),ye=!sr&&!jt&&sr!==0,Oe=He=>{var Je,W;Dt(ye?!1:He),ye||((Je=gt.onOpenChange)===null||Je===void 0||Je.call(gt,He),(W=gt.onVisibleChange)===null||W===void 0||W.call(gt,He))},et=pe.useMemo(()=>{var He,Je;let W=Cr;return typeof Xe=="object"&&(W=(Je=(He=Xe.pointAtCenter)!==null&&He!==void 0?He:Xe.arrowPointAtCenter)!==null&&Je!==void 0?Je:Cr),Pt||(0,Re.Z)({arrowPointAtCenter:W,autoAdjustOverflow:zr,arrowWidth:rr?Ur.sizePopupArrow:0,borderRadius:Ur.borderRadius,offset:Ur.marginXXS,visibleFirst:!0})},[Cr,Xe,Pt,Ur]),vt=pe.useMemo(()=>sr===0?sr:jt||sr||"",[jt,sr]),wt=pe.createElement(xe.BR,null,typeof vt=="function"?vt():vt),{getPopupContainer:Gt,placement:dr="top",mouseEnterDelay:Jt=.1,mouseLeaveDelay:Ue=.1,overlayStyle:Kt,rootClassName:wr}=gt,Fe=De(gt,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),Ge=Vr("tooltip",he),it=Vr(),Rt=gt["data-popover-inject"];let kt=Ct;!("open"in gt)&&!("visible"in gt)&&ye&&(kt=!1);const zt=Ye((0,N.l$)(be)&&!(0,N.M2)(be)?be:pe.createElement("span",null,be),Ge),tr=zt.props,T=!tr.className||typeof tr.className=="string"?rt()(tr.className,Le||`${Ge}-open`):tr.className,[B,ft]=j(Ge,!Rt),G=ue(Ge,M),fe=G.arrowStyle,Sr=Object.assign(Object.assign({},ne),G.overlayStyle),Ne=rt()(D,{[`${Ge}-rtl`]:Ze==="rtl"},G.className,wr,ft);return B(pe.createElement(Me.Z,Object.assign({},Fe,{showArrow:rr,placement:dr,mouseEnterDelay:Jt,mouseLeaveDelay:Ue,prefixCls:Ge,overlayClassName:Ne,overlayStyle:Object.assign(Object.assign({},fe),Kt),getTooltipContainer:Gt||Se||li,ref:nt,builtinPlacements:et,overlay:wt,visible:kt,onVisibleChange:Oe,afterVisibleChange:st!=null?st:ot,overlayInnerStyle:Sr,arrowContent:pe.createElement("span",{className:`${Ge}-arrow-content`}),motion:{motionName:(0,E.m)(it,"zoom-big-fast",gt.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!At}),kt?(0,N.Tm)(zt,{className:T}):zt))});We._InternalPanelDoNotUseOrYouWillBeFired=le;var ut=We},64018:function(){var $r,It,X,pe=!1,Pe,rt;window.PR_SHOULD_USE_CONTINUATION=!0;var Me,re;(function(){var E=window,Re=["break,continue,do,else,for,if,return,while"],N=[Re,"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=[N,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],xe=[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"],q=[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"],I="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"],H="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=[Re,"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=[Re,"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=[Re,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],j=[xe,k,q,O,H,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",le="com",De="typ",ve="lit",Ye="pun",We="pln",ut="tag",gt="dec",de="src",ie="atn",ce="atv",he="nocode",Le="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function Se(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 Kt=Ue.charCodeAt(0);if(Kt!==92)return Kt;var wr=Ue.charAt(1);return Kt=et[wr],Kt||("0"<=wr&&wr<="7"?parseInt(Ue.substring(1),8):wr==="u"||wr==="x"?parseInt(Ue.substring(2),16):Ue.charCodeAt(1))}function wt(Ue){if(Ue<32)return(Ue<16?"\\x0":"\\x")+Ue.toString(16);var Kt=String.fromCharCode(Ue);return Kt==="\\"||Kt==="-"||Kt==="]"||Kt==="^"?"\\"+Kt:Kt}function Gt(Ue){var Kt=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")),wr=[],Fe=Kt[0]==="^",Ge=["["];Fe&&Ge.push("^");for(var it=Fe?1:0,Rt=Kt.length;it<Rt;++it){var kt=Kt[it];if(/\\[bdsw]/i.test(kt))Ge.push(kt);else{var zt=vt(kt),tr;it+2<Rt&&Kt[it+1]==="-"?(tr=vt(Kt[it+2]),it+=2):tr=zt,wr.push([zt,tr]),tr<65||zt>122||(tr<65||zt>90||wr.push([Math.max(65,zt)|32,Math.min(tr,90)|32]),tr<97||zt>122||wr.push([Math.max(97,zt)&-33,Math.min(tr,122)&-33]))}}wr.sort(function(G,fe){return G[0]-fe[0]||fe[1]-G[1]});for(var T=[],B=[],it=0;it<wr.length;++it){var ft=wr[it];ft[0]<=B[1]+1?B[1]=Math.max(B[1],ft[1]):T.push(B=ft)}for(var it=0;it<T.length;++it){var ft=T[it];Ge.push(wt(ft[0])),ft[1]>ft[0]&&(ft[1]+1>ft[0]&&Ge.push("-"),Ge.push(wt(ft[1])))}return Ge.push("]"),Ge.join("")}function dr(Ue){for(var Kt=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")),wr=Kt.length,Fe=[],Ge=0,it=0;Ge<wr;++Ge){var Rt=Kt[Ge];if(Rt==="(")++it;else if(Rt.charAt(0)==="\\"){var kt=+Rt.substring(1);kt&&(kt<=it?Fe[kt]=-1:Kt[Ge]=wt(kt))}}for(var Ge=1;Ge<Fe.length;++Ge)Fe[Ge]===-1&&(Fe[Ge]=++nt);for(var Ge=0,it=0;Ge<wr;++Ge){var Rt=Kt[Ge];if(Rt==="(")++it,Fe[it]||(Kt[Ge]="(?:");else if(Rt.charAt(0)==="\\"){var kt=+Rt.substring(1);kt&&kt<=it&&(Kt[Ge]="\\"+Fe[kt])}}for(var Ge=0;Ge<wr;++Ge)Kt[Ge]==="^"&&Kt[Ge+1]!=="^"&&(Kt[Ge]="");if(Ue.ignoreCase&&Qe)for(var Ge=0;Ge<wr;++Ge){var Rt=Kt[Ge],zt=Rt.charAt(0);Rt.length>=2&&zt==="["?Kt[Ge]=Gt(Rt):zt!=="\\"&&(Kt[Ge]=Rt.replace(/[a-zA-Z]/g,function(B){var ft=B.charCodeAt(0);return"["+String.fromCharCode(ft&-33,ft|32)+"]"}))}return Kt.join("")}for(var Jt=[],Dt=0,ye=Ze.length;Dt<ye;++Dt){var Oe=Ze[Dt];if(Oe.global||Oe.multiline)throw new Error(""+Oe);Jt.push("(?:"+dr(Oe)+")")}return new RegExp(Jt.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 Gt=vt.firstChild;Gt;Gt=Gt.nextSibling)et(Gt);var dr=vt.nodeName.toLowerCase();(dr==="br"||dr==="li")&&(Ct[Oe]=`
`,ye[Oe<<1]=Dt++,ye[Oe++<<1|1]=vt)}else if(wt==3||wt==4){var Jt=vt.nodeValue;Jt.length&&(nt?Jt=Jt.replace(/\r\n?/g,`
`):Jt=Jt.replace(/[ \t\r\n]+/g," "),Ct[Oe]=Jt,ye[Oe<<1]=Dt,Dt+=Jt.length,ye[Oe++<<1|1]=vt)}}return et(Ze),{sourceCode:Ct.join("").replace(/\n$/,""),spans:ye}}function M(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 ne=/\S/;function be(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&&ne.test(Qe.nodeValue)?Ze:nt}return nt===Ze?void 0:nt}function st(Ze,nt){var Qe={},Ct;(function(){for(var Oe=Ze.concat(nt),et=[],vt={},wt=0,Gt=Oe.length;wt<Gt;++wt){var dr=Oe[wt],Jt=dr[3];if(Jt)for(var Ue=Jt.length;--Ue>=0;)Qe[Jt.charAt(Ue)]=dr;var Kt=dr[1],wr=""+Kt;vt.hasOwnProperty(wr)||(et.push(Kt),vt[wr]=null)}et.push(/[\0-\uffff]/),Ct=Se(et)})();var Dt=nt.length,ye=function(Oe){for(var et=Oe.sourceCode,vt=Oe.basePos,wt=Oe.sourceNode,Gt=[vt,We],dr=0,Jt=et.match(Ct)||[],Ue={},Kt=0,wr=Jt.length;Kt<wr;++Kt){var Fe=Jt[Kt],Ge=Ue[Fe],it=void 0,Rt;if(typeof Ge=="string")Rt=!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)}Rt=Ge.length>=5&&Ge.substring(0,5)==="lang-",Rt&&!(it&&typeof it[1]=="string")&&(Rt=!1,Ge=de),Rt||(Ue[Fe]=Ge)}var tr=dr;if(dr+=Fe.length,!Rt)Gt.push(vt+tr,Ge);else{var T=it[1],B=Fe.indexOf(T),ft=B+T.length;it[2]&&(ft=Fe.length-it[2].length,B=ft-T.length);var G=Ge.substring(5);M(wt,vt+tr,Fe.substring(0,B),ye,Gt),M(wt,vt+tr+B,T,Cr(G,T),Gt),M(wt,vt+tr+ft,Fe.substring(ft),ye,Gt)}}Oe.decorations=Gt};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([le,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):nt.push([le,/^#(?:(?: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([le,/^#[^\r\n]*/,null,"#"])),Ze.cStyleComments&&(Qe.push([le,/^\/\/[^\r\n]*/,null]),Qe.push([le,/^\/\*[\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("^"+Le+"("+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 Gt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ze.regexLiterals&&(Gt+="(?!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(Gt),null]),st(nt,Qe)}var At=ot({keywords:j,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(Kt){var wr=Kt.nodeType;if(wr==1&&!Ct.test(Kt.className))if(Kt.nodeName==="br")wt(Kt),Kt.parentNode&&Kt.parentNode.removeChild(Kt);else for(var Fe=Kt.firstChild;Fe;Fe=Fe.nextSibling)vt(Fe);else if((wr==3||wr==4)&&Qe){var Ge=Kt.nodeValue,it=Ge.match(Dt);if(it){var Rt=Ge.substring(0,it.index);Kt.nodeValue=Rt;var kt=Ge.substring(it.index+it[0].length);if(kt){var zt=Kt.parentNode;zt.insertBefore(ye.createTextNode(kt),Kt.nextSibling)}wt(Kt),Rt||Kt.parentNode.removeChild(Kt)}}}function wt(Kt){for(;!Kt.nextSibling;)if(Kt=Kt.parentNode,!Kt)return;function wr(it,Rt){var kt=Rt?it.cloneNode(!1):it,zt=it.parentNode;if(zt){var tr=wr(zt,1),T=it.nextSibling;tr.appendChild(kt);for(var B=T;B;B=T)T=B.nextSibling,tr.appendChild(B)}return kt}for(var Fe=wr(Kt.nextSibling,0),Ge;(Ge=Fe.parentNode)&&Ge.nodeType===1;)Fe=Ge;et.push(Fe)}for(var Gt=0;Gt<et.length;++Gt)vt(et[Gt]);nt===(nt|0)&&et[0].setAttribute("value",nt);var dr=ye.createElement("ol");dr.className="linenums";for(var Jt=Math.max(0,nt-1|0)||0,Gt=0,Ue=et.length;Gt<Ue;++Gt)Oe=et[Gt],Oe.className="L"+(Gt+Jt)%10,Oe.firstChild||Oe.appendChild(ye.createTextNode("\xA0")),dr.appendChild(Oe);Ze.appendChild(dr)}function sr(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,Gt=wt.length,dr=0;wt[Gt]=Dt;var Jt,Ue;for(Ue=Jt=0;Ue<Gt;)wt[Ue]!==wt[Ue+2]?(wt[Jt++]=wt[Ue++],wt[Jt++]=wt[Ue++]):Ue+=2;for(Gt=Jt,Ue=Jt=0;Ue<Gt;){for(var Kt=wt[Ue],wr=wt[Ue+1],Fe=Ue+2;Fe+2<=Gt&&wt[Fe+1]===wr;)Fe+=2;wt[Jt++]=Kt,wt[Jt++]=wr,Ue=Fe}Gt=wt.length=Jt;var Ge=Ze.sourceNode,it="";Ge&&(it=Ge.style.display,Ge.style.display="none");try{for(var Rt=null;vt<et;){var kt=Oe[vt],zt=Oe[vt+2]||Dt,tr=wt[dr+2]||Dt,Fe=Math.min(zt,tr),T=Oe[vt+1],B;if(T.nodeType!==1&&(B=Ct.substring(ye,Fe))){nt&&(B=B.replace(Qe,"\r")),T.nodeValue=B;var ft=T.ownerDocument,G=ft.createElement("span");G.className=wt[dr+1];var fe=T.parentNode;fe.replaceChild(G,T),G.appendChild(T),ye<zt&&(Oe[vt+1]=T=ft.createTextNode(Ct.substring(Fe,zt)),fe.insertBefore(T,G.nextSibling))}ye=Fe,ye>=zt&&(vt+=2),ye>=tr&&(dr+=2)}}finally{Ge&&(Ge.style.display=it)}}var jt={};function Pt(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 Cr(Ze,nt){return Ze&&jt.hasOwnProperty(Ze)||(Ze=/^\s*</.test(nt)?"default-markup":"default-code"),jt[Ze]}Pt(At,["default-code"]),Pt(st([],[[We,/^[^<?]+/],[gt,/^<!\w[^>]*(?:>|$)/],[le,/^<\!--[\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"]),Pt(st([[We,/^[\s]+/,null,` \r
`],[ce,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ut,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[ie,/^(?!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"]),Pt(st([],[[ce,/^[\s\S]+/]]),["uq.val"]),Pt(ot({keywords:xe,hashComments:!0,cStyleComments:!0,types:Y}),["c","cc","cpp","cxx","cyc","m"]),Pt(ot({keywords:"null,true,false"}),["json"]),Pt(ot({keywords:k,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Y}),["cs"]),Pt(ot({keywords:q,cStyleComments:!0}),["java"]),Pt(ot({keywords:Z,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Pt(ot({keywords:se,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Pt(ot({keywords:H,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Pt(ot({keywords:ae,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Pt(ot({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Pt(ot({keywords:I,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Pt(st([],[[ue,/^[\s\S]+/]]),["regex"]);function zr(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,Cr(nt,Ct)(Ze),sr(Ze)}catch(Dt){E.console&&console.log(Dt&&Dt.stack||Dt)}}function rr(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 zr(Oe),ye.innerHTML}function Ur(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 Gt=Date;Gt.now||(Gt={now:function(){return+new Date}});var dr=0,Jt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ue=/\bprettyprint\b/,Kt=/\bprettyprinted\b/,wr=/pre|xmp/i,Fe=/^code$/i,Ge=/^(?:pre|code|xmp)$/i,it={};function Rt(){for(var kt=E.PR_SHOULD_USE_CONTINUATION?Gt.now()+250:1/0;dr<Oe.length&&Gt.now()<kt;dr++){for(var zt=Oe[dr],tr=it,T=zt;T=T.previousSibling;){var B=T.nodeType,ft=(B===7||B===8)&&T.nodeValue;if(ft?!/^\??prettify\b/.test(ft):B!==3||/\S/.test(T.nodeValue))break;if(ft){tr={},ft.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ae,Xt,yr){tr[Xt]=yr});break}}var G=zt.className;if((tr!==it||Ue.test(G))&&!Kt.test(G)){for(var fe=!1,Sr=zt.parentNode;Sr;Sr=Sr.parentNode){var Ne=Sr.tagName;if(Ge.test(Ne)&&Sr.className&&Ue.test(Sr.className)){fe=!0;break}}if(!fe){zt.className+=" prettyprinted";var He=tr.lang;if(!He){He=G.match(Jt);var Je;!He&&(Je=be(zt))&&Fe.test(Je.tagName)&&(He=Je.className.match(Jt)),He&&(He=He[1])}var W;if(wr.test(zt.tagName))W=1;else{var ge=zt.currentStyle,Ee=Ct.defaultView,Ke=ge?ge.whiteSpace:Ee&&Ee.getComputedStyle?Ee.getComputedStyle(zt,null).getPropertyValue("white-space"):0;W=Ke&&Ke.substring(0,3)==="pre"}var V=tr.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};zr(qt)}}}dr<Oe.length?E.setTimeout(Rt,250):typeof Ze=="function"&&Ze()}Rt()}var li=E.PR={createSimpleLexer:st,registerLangHandler:Pt,sourceDecorator:ot,PR_ATTRIB_NAME:ie,PR_ATTRIB_VALUE:ce,PR_COMMENT:le,PR_DECLARATION:gt,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=rr:Me=rr,prettyPrint:re=pe?E.prettyPrint=Ur:re=Ur},Vr=E.define;typeof Vr=="function"&&Vr.amd&&Vr("google-code-prettify",[],function(){return li})})()},25769:function($r,It,X){"use strict";var pe=X(98040),Pe={"text/plain":"Text","text/html":"Url",default:"Text"},rt="Copy to clipboard: #{key}, Enter";function Me(E){var Re=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return E.replace(/#{\s*key\s*}/g,Re)}function re(E,Re){var N,d,xe,q,k,I,O=!1;Re||(Re={}),N=Re.debug||!1;try{xe=pe(),q=document.createRange(),k=document.getSelection(),I=document.createElement("span"),I.textContent=E,I.ariaHidden="true",I.style.all="unset",I.style.position="fixed",I.style.top=0,I.style.clip="rect(0, 0, 0, 0)",I.style.whiteSpace="pre",I.style.webkitUserSelect="text",I.style.MozUserSelect="text",I.style.msUserSelect="text",I.style.userSelect="text",I.addEventListener("copy",function(se){if(se.stopPropagation(),Re.format)if(se.preventDefault(),typeof se.clipboardData=="undefined"){N&&console.warn("unable to use e.clipboardData"),N&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var ae=Pe[Re.format]||Pe.default;window.clipboardData.setData(ae,E)}else se.clipboardData.clearData(),se.clipboardData.setData(Re.format,E);Re.onCopy&&(se.preventDefault(),Re.onCopy(se.clipboardData))}),document.body.appendChild(I),q.selectNodeContents(I),k.addRange(q);var H=document.execCommand("copy");if(!H)throw new Error("copy command was unsuccessful");O=!0}catch(se){N&&console.error("unable to copy using execCommand: ",se),N&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(Re.format||"text",E),Re.onCopy&&Re.onCopy(window.clipboardData),O=!0}catch(ae){N&&console.error("unable to copy using clipboardData: ",ae),N&&console.error("falling back to prompt"),d=Me("message"in Re?Re.message:rt),window.prompt(d,E)}}finally{k&&(typeof k.removeRange=="function"?k.removeRange(q):k.removeAllRanges()),I&&document.body.removeChild(I),xe()}return O}$r.exports=re},53184:function($r,It,X){"use strict";var pe,Pe;function rt(Me,re,E){var Re=function(N,d){return Me.js_beautify(N,d)};return Re.js=Me.js_beautify,Re.css=re.css_beautify,Re.html=E.html_beautify,Re.js_beautify=Me.js_beautify,Re.css_beautify=re.css_beautify,Re.html_beautify=E.html_beautify,Re}pe=[X(58553),X(87804),X(40998)],Pe=function(Me,re,E){return rt(Me,re,E)}.apply(It,pe),Pe!==void 0&&($r.exports=Pe)},87804:function($r,It){var X,pe;(function(){var Pe;(function(){"use strict";var Me=[,,function(N){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 I=this.__items.length-1;I>=0;I--)if(this.__items[I].match(k))return!0;return!1},d.prototype.set_indent=function(k,I){this.is_empty()&&(this.__indent_count=k||0,this.__alignment_count=I||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 I=k.lastIndexOf(`
`);I!==-1?this.__character_count=k.length-I: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 xe(k,I){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)),I=I||"",k.indent_level>0&&(I=new Array(k.indent_level+1).join(this.__indent_string)),this.__base_string=I,this.__base_string_length=I.length}xe.prototype.get_indent_size=function(k,I){var O=this.__base_string_length;return I=I||0,k<0&&(O=0),O+=k*this.__indent_size,O+=I,O},xe.prototype.get_indent_string=function(k,I){var O=this.__base_string;return I=I||0,k<0&&(k=0,O=""),I+=k*this.__indent_size,this.__ensure_cache(I),O+=this.__cache[I],O},xe.prototype.__ensure_cache=function(k){for(;k>=this.__cache.length;)this.__add_column()},xe.prototype.__add_column=function(){var k=this.__cache.length,I=0,O="";this.__indent_size&&k>=this.__indent_size&&(I=Math.floor(k/this.__indent_size),k-=I*this.__indent_size,O=new Array(I+1).join(this.__indent_string)),k&&(O+=new Array(k+1).join(" ")),this.__cache.push(O)};function q(k,I){this.__indent_cache=new xe(k,I),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()}q.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},q.prototype.get_line_number=function(){return this.__lines.length},q.prototype.get_indent_string=function(k,I){return this.__indent_cache.get_indent_string(k,I)},q.prototype.get_indent_size=function(k,I){return this.__indent_cache.get_indent_size(k,I)},q.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},q.prototype.add_new_line=function(k){return this.is_empty()||!k&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},q.prototype.get_code=function(k){this.trim(!0);var I=this.current_line.pop();I&&(I[I.length-1]===`
`&&(I=I.replace(/\n+$/g,"")),this.current_line.push(I)),this._end_with_newline&&this.__add_outputline();var O=this.__lines.join(`
`);return k!==`
`&&(O=O.replace(/[\n]/g,k)),O},q.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},q.prototype.set_indent=function(k,I){return k=k||0,I=I||0,this.next_line.set_indent(k,I),this.__lines.length>1?(this.current_line.set_indent(k,I),!0):(this.current_line.set_indent(),!1)},q.prototype.add_raw_token=function(k){for(var I=0;I<k.newlines;I++)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},q.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()},q.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(" "))},q.prototype.remove_indent=function(k){for(var I=this.__lines.length;k<I;)this.__lines[k]._remove_indent(),k++;this.current_line._remove_wrap_indent()},q.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},q.prototype.just_added_newline=function(){return this.current_line.is_empty()},q.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},q.prototype.ensure_empty_line_above=function(k,I){for(var O=this.__lines.length-2;O>=0;){var H=this.__lines[O];if(H.is_empty())break;if(H.item(0).indexOf(k)!==0&&H.item(-1)!==I){this.__lines.splice(O+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}O--}},N.exports.Output=q},,,,function(N){function d(k,I){this.raw_options=xe(k,I),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,I){var O=this.raw_options[k],H=I||[];return typeof O=="object"?O!==null&&typeof O.concat=="function"&&(H=O.concat()):typeof O=="string"&&(H=O.split(/[^a-zA-Z0-9_\/\-]+/)),H},d.prototype._get_boolean=function(k,I){var O=this.raw_options[k],H=O===void 0?!!I:!!O;return H},d.prototype._get_characters=function(k,I){var O=this.raw_options[k],H=I||"";return typeof O=="string"&&(H=O.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),H},d.prototype._get_number=function(k,I){var O=this.raw_options[k];I=parseInt(I,10),isNaN(I)&&(I=0);var H=parseInt(O,10);return isNaN(H)&&(H=I),H},d.prototype._get_selection=function(k,I,O){var H=this._get_selection_list(k,I,O);if(H.length!==1)throw new Error("Invalid Option Value: The option '"+k+`' can only be one of the following values:
`+I+`
You passed in: '`+this.raw_options[k]+"'");return H[0]},d.prototype._get_selection_list=function(k,I,O){if(!I||I.length===0)throw new Error("Selection list cannot be empty.");if(O=O||[I[0]],!this._is_valid_selection(O,I))throw new Error("Invalid Default Value!");var H=this._get_array(k,O);if(!this._is_valid_selection(H,I))throw new Error("Invalid Option Value: The option '"+k+`' can contain only the following values:
`+I+`
You passed in: '`+this.raw_options[k]+"'");return H},d.prototype._is_valid_selection=function(k,I){return k.length&&I.length&&!k.some(function(O){return I.indexOf(O)===-1})};function xe(k,I){var O={};k=q(k);var H;for(H in k)H!==I&&(O[H]=k[H]);if(I&&k[I])for(H in k[I])O[H]=k[I][H];return O}function q(k){var I={},O;for(O in k){var H=O.replace(/-/g,"_");I[H]=k[O]}return I}N.exports.Options=d,N.exports.normalizeOpts=q,N.exports.mergeOpts=xe},,function(N){var d=RegExp.prototype.hasOwnProperty("sticky");function xe(q){this.__input=q||"",this.__input_length=this.__input.length,this.__position=0}xe.prototype.restart=function(){this.__position=0},xe.prototype.back=function(){this.__position>0&&(this.__position-=1)},xe.prototype.hasNext=function(){return this.__position<this.__input_length},xe.prototype.next=function(){var q=null;return this.hasNext()&&(q=this.__input.charAt(this.__position),this.__position+=1),q},xe.prototype.peek=function(q){var k=null;return q=q||0,q+=this.__position,q>=0&&q<this.__input_length&&(k=this.__input.charAt(q)),k},xe.prototype.__match=function(q,k){q.lastIndex=k;var I=q.exec(this.__input);return I&&!(d&&q.sticky)&&I.index!==k&&(I=null),I},xe.prototype.test=function(q,k){return k=k||0,k+=this.__position,k>=0&&k<this.__input_length?!!this.__match(q,k):!1},xe.prototype.testChar=function(q,k){var I=this.peek(k);return q.lastIndex=0,I!==null&&q.test(I)},xe.prototype.match=function(q){var k=this.__match(q,this.__position);return k?this.__position+=k[0].length:k=null,k},xe.prototype.read=function(q,k,I){var O="",H;return q&&(H=this.match(q),H&&(O+=H[0])),k&&(H||!q)&&(O+=this.readUntil(k,I)),O},xe.prototype.readUntil=function(q,k){var I="",O=this.__position;q.lastIndex=this.__position;var H=q.exec(this.__input);return H?(O=H.index,k&&(O+=H[0].length)):O=this.__input_length,I=this.__input.substring(this.__position,O),this.__position=O,I},xe.prototype.readUntilAfter=function(q){return this.readUntil(q,!0)},xe.prototype.get_regexp=function(q,k){var I=null,O="g";return k&&d&&(O="y"),typeof q=="string"&&q!==""?I=new RegExp(q,O):q&&(I=new RegExp(q.source,O)),I},xe.prototype.get_literal_regexp=function(q){return RegExp(q.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},xe.prototype.peekUntilAfter=function(q){var k=this.__position,I=this.readUntilAfter(q);return this.__position=k,I},xe.prototype.lookBack=function(q){var k=this.__position-1;return k>=q.length&&this.__input.substring(k-q.length,k).toLowerCase()===q},N.exports.InputScanner=xe},,,,,function(N){function d(xe,q){xe=typeof xe=="string"?xe:xe.source,q=typeof q=="string"?q:q.source,this.__directives_block_pattern=new RegExp(xe+/ beautify( \w+[:]\w+)+ /.source+q,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(xe+/\sbeautify\signore:end\s/.source+q,"g")}d.prototype.get_directives=function(xe){if(!xe.match(this.__directives_block_pattern))return null;var q={};this.__directive_pattern.lastIndex=0;for(var k=this.__directive_pattern.exec(xe);k;)q[k[1]]=k[2],k=this.__directive_pattern.exec(xe);return q},d.prototype.readIgnored=function(xe){return xe.readUntilAfter(this.__directives_end_ignore_pattern)},N.exports.Directives=d},,function(N,d,xe){var q=xe(16).Beautifier,k=xe(17).Options;function I(O,H){var se=new q(O,H);return se.beautify()}N.exports=I,N.exports.defaultOptions=function(){return new k}},function(N,d,xe){var q=xe(17).Options,k=xe(2).Output,I=xe(8).InputScanner,O=xe(13).Directives,H=new O(/\/\*/,/\*\//),se=/\r\n|[\r\n]/,ae=/\r\n|[\r\n]/g,Z=/\s/,j=/(?:\s|\n)+/g,Y=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,ue=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ee(le,De){this._source_text=le||"",this._options=new q(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(le){var De="";for(this._ch=this._input.next();this._ch;){if(De+=this._ch,this._ch==="\\")De+=this._input.next();else if(le.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return De},ee.prototype.eatWhitespace=function(le){for(var De=Z.test(this._input.peek()),ve=0;Z.test(this._input.peek());)this._ch=this._input.next(),le&&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 le=0,De=1,ve=this._input.peek(De);ve;){if(ve==="{")return!0;if(ve==="(")le+=1;else if(ve===")"){if(le===0)return!1;le-=1}else if(ve===";"||ve==="}")return!1;De++,ve=this._input.peek(De)}return!1},ee.prototype.print_string=function(le){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(le)},ee.prototype.preserveSingleSpace=function(le){le&&(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 le=this._source_text,De=this._options.eol;De==="auto"&&(De=`
`,le&&se.test(le||"")&&(De=le.match(se)[0])),le=le.replace(ae,`
`);var ve=le.match(/^[\t ]*/)[0];this._output=new k(this._options,ve),this._input=new I(le),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Ye=0,We=!1,ut=!1,gt=!1,de=!1,ie=!1,ce=this._ch,he=!1,Le,Se,D;Le=this._input.read(j),Se=Le!=="",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 M=this._input.read(Y),ne=H.get_directives(M);ne&&ne.ignore==="start"&&(M+=H.readIgnored(this._input)),this.print_string(M),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(Se),this.print_string(this._ch);var be=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);be.match(/[ :]$/)&&(be=this.eatString(": ").replace(/\s+$/,""),this.print_string(be),this._output.space_before_token=!0),Ye===0&&be.indexOf(":")!==-1&&(ut=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(Se),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var st=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);st.match(/[ :]$/)&&(st=this.eatString(": ").replace(/\s+$/,""),this.print_string(st),this._output.space_before_token=!0),Ye===0&&st.indexOf(":")!==-1?(ut=!0,this.indent()):st in this.NESTED_AT_RULE?(this._nestedLevel+=1,st in this.CONDITIONAL_GROUP_RULE&&(gt=!0)):Ye===0&&!ut&&(de=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Se),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")ut&&(ut=!1,this.outdent()),de=!1,gt?(gt=!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||gt)&&!(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||Se),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(Se||Xe),this.print_string(this._ch),ut&&D==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),ie=!0):(this.eatWhitespace(),Ye++,this.indent())}else if(this._ch===")")Ye&&(Ye--,this.outdent()),ie&&this._input.peek()===";"&&this._options.selector_separator_newline&&(ie=!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||ie)&&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(Se),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 sr=D==='"'||D==="'";this.preserveSingleSpace(sr||Se),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},N.exports.Beautifier=ee},function(N,d,xe){var q=xe(6).Options;function k(I){q.call(this,I,"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 H=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var se=0;se<H.length;se++)H[se]!=="expand"?this.brace_style="collapse":this.brace_style=H[se]}k.prototype=new q,N.exports.Options=k}],re={};function E(N){var d=re[N];if(d!==void 0)return d.exports;var xe=re[N]={exports:{}};return Me[N](xe,xe.exports,E),xe.exports}var Re=E(15);Pe=Re})();var rt=Pe;X=[],pe=function(){return{css_beautify:rt}}.apply(It,X),pe!==void 0&&($r.exports=pe)})()},40998:function($r,It,X){var pe,Pe;(function(){var rt;(function(){"use strict";var Re=[,,function(q){function k(H){this.__parent=H,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 H=new k(this.__parent);return H.set_indent(this.__indent_count,this.__alignment_count),H},k.prototype.item=function(H){return H<0?this.__items[this.__items.length+H]:this.__items[H]},k.prototype.has_match=function(H){for(var se=this.__items.length-1;se>=0;se--)if(this.__items[se].match(H))return!0;return!1},k.prototype.set_indent=function(H,se){this.is_empty()&&(this.__indent_count=H||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 H=this.__parent.current_line;return H.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),H.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),H.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,H.__items[0]===" "&&(H.__items.splice(0,1),H.__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(H){this.__items.push(H);var se=H.lastIndexOf(`
`);se!==-1?this.__character_count=H.length-se:this.__character_count+=H.length},k.prototype.pop=function(){var H=null;return this.is_empty()||(H=this.__items.pop(),this.__character_count-=H.length),H},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 H="";return this.is_empty()?this.__parent.indent_empty_lines&&(H=this.__parent.get_indent_string(this.__indent_count)):(H=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),H+=this.__items.join("")),H};function I(H,se){this.__cache=[""],this.__indent_size=H.indent_size,this.__indent_string=H.indent_char,H.indent_with_tabs||(this.__indent_string=new Array(H.indent_size+1).join(H.indent_char)),se=se||"",H.indent_level>0&&(se=new Array(H.indent_level+1).join(this.__indent_string)),this.__base_string=se,this.__base_string_length=se.length}I.prototype.get_indent_size=function(H,se){var ae=this.__base_string_length;return se=se||0,H<0&&(ae=0),ae+=H*this.__indent_size,ae+=se,ae},I.prototype.get_indent_string=function(H,se){var ae=this.__base_string;return se=se||0,H<0&&(H=0,ae=""),se+=H*this.__indent_size,this.__ensure_cache(se),ae+=this.__cache[se],ae},I.prototype.__ensure_cache=function(H){for(;H>=this.__cache.length;)this.__add_column()},I.prototype.__add_column=function(){var H=this.__cache.length,se=0,ae="";this.__indent_size&&H>=this.__indent_size&&(se=Math.floor(H/this.__indent_size),H-=se*this.__indent_size,ae=new Array(se+1).join(this.__indent_string)),H&&(ae+=new Array(H+1).join(" ")),this.__cache.push(ae)};function O(H,se){this.__indent_cache=new I(H,se),this.raw=!1,this._end_with_newline=H.end_with_newline,this.indent_size=H.indent_size,this.wrap_line_length=H.wrap_line_length,this.indent_empty_lines=H.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(H,se){return this.__indent_cache.get_indent_string(H,se)},O.prototype.get_indent_size=function(H,se){return this.__indent_cache.get_indent_size(H,se)},O.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},O.prototype.add_new_line=function(H){return this.is_empty()||!H&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},O.prototype.get_code=function(H){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 H!==`
`&&(ae=ae.replace(/[\n]/g,H)),ae},O.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},O.prototype.set_indent=function(H,se){return H=H||0,se=se||0,this.next_line.set_indent(H,se),this.__lines.length>1?(this.current_line.set_indent(H,se),!0):(this.current_line.set_indent(),!1)},O.prototype.add_raw_token=function(H){for(var se=0;se<H.newlines;se++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(H.whitespace_before),this.current_line.push(H.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},O.prototype.add_token=function(H){this.__add_space_before_token(),this.current_line.push(H),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(H){for(var se=this.__lines.length;H<se;)this.__lines[H]._remove_indent(),H++;this.current_line._remove_wrap_indent()},O.prototype.trim=function(H){for(H=H===void 0?!1:H,this.current_line.trim();H&&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(H,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(H)!==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--}},q.exports.Output=O},function(q){function k(I,O,H,se){this.type=I,this.text=O,this.comments_before=null,this.newlines=H||0,this.whitespace_before=se||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}q.exports.Token=k},,,function(q){function k(H,se){this.raw_options=I(H,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(H,se){var ae=this.raw_options[H],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(H,se){var ae=this.raw_options[H],Z=ae===void 0?!!se:!!ae;return Z},k.prototype._get_characters=function(H,se){var ae=this.raw_options[H],Z=se||"";return typeof ae=="string"&&(Z=ae.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),Z},k.prototype._get_number=function(H,se){var ae=this.raw_options[H];se=parseInt(se,10),isNaN(se)&&(se=0);var Z=parseInt(ae,10);return isNaN(Z)&&(Z=se),Z},k.prototype._get_selection=function(H,se,ae){var Z=this._get_selection_list(H,se,ae);if(Z.length!==1)throw new Error("Invalid Option Value: The option '"+H+`' can only be one of the following values:
`+se+`
You passed in: '`+this.raw_options[H]+"'");return Z[0]},k.prototype._get_selection_list=function(H,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(H,ae);if(!this._is_valid_selection(Z,se))throw new Error("Invalid Option Value: The option '"+H+`' can contain only the following values:
`+se+`
You passed in: '`+this.raw_options[H]+"'");return Z},k.prototype._is_valid_selection=function(H,se){return H.length&&se.length&&!H.some(function(ae){return se.indexOf(ae)===-1})};function I(H,se){var ae={};H=O(H);var Z;for(Z in H)Z!==se&&(ae[Z]=H[Z]);if(se&&H[se])for(Z in H[se])ae[Z]=H[se][Z];return ae}function O(H){var se={},ae;for(ae in H){var Z=ae.replace(/-/g,"_");se[Z]=H[ae]}return se}q.exports.Options=k,q.exports.normalizeOpts=O,q.exports.mergeOpts=I},,function(q){var k=RegExp.prototype.hasOwnProperty("sticky");function I(O){this.__input=O||"",this.__input_length=this.__input.length,this.__position=0}I.prototype.restart=function(){this.__position=0},I.prototype.back=function(){this.__position>0&&(this.__position-=1)},I.prototype.hasNext=function(){return this.__position<this.__input_length},I.prototype.next=function(){var O=null;return this.hasNext()&&(O=this.__input.charAt(this.__position),this.__position+=1),O},I.prototype.peek=function(O){var H=null;return O=O||0,O+=this.__position,O>=0&&O<this.__input_length&&(H=this.__input.charAt(O)),H},I.prototype.__match=function(O,H){O.lastIndex=H;var se=O.exec(this.__input);return se&&!(k&&O.sticky)&&se.index!==H&&(se=null),se},I.prototype.test=function(O,H){return H=H||0,H+=this.__position,H>=0&&H<this.__input_length?!!this.__match(O,H):!1},I.prototype.testChar=function(O,H){var se=this.peek(H);return O.lastIndex=0,se!==null&&O.test(se)},I.prototype.match=function(O){var H=this.__match(O,this.__position);return H?this.__position+=H[0].length:H=null,H},I.prototype.read=function(O,H,se){var ae="",Z;return O&&(Z=this.match(O),Z&&(ae+=Z[0])),H&&(Z||!O)&&(ae+=this.readUntil(H,se)),ae},I.prototype.readUntil=function(O,H){var se="",ae=this.__position;O.lastIndex=this.__position;var Z=O.exec(this.__input);return Z?(ae=Z.index,H&&(ae+=Z[0].length)):ae=this.__input_length,se=this.__input.substring(this.__position,ae),this.__position=ae,se},I.prototype.readUntilAfter=function(O){return this.readUntil(O,!0)},I.prototype.get_regexp=function(O,H){var se=null,ae="g";return H&&k&&(ae="y"),typeof O=="string"&&O!==""?se=new RegExp(O,ae):O&&(se=new RegExp(O.source,ae)),se},I.prototype.get_literal_regexp=function(O){return RegExp(O.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},I.prototype.peekUntilAfter=function(O){var H=this.__position,se=this.readUntilAfter(O);return this.__position=H,se},I.prototype.lookBack=function(O){var H=this.__position-1;return H>=O.length&&this.__input.substring(H-O.length,H).toLowerCase()===O},q.exports.InputScanner=I},function(q,k,I){var O=I(8).InputScanner,H=I(3).Token,se=I(10).TokenStream,ae=I(11).WhitespacePattern,Z={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},j=function(Y,ue){this._input=new O(Y),this._options=ue||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new ae(this._input)};j.prototype.tokenize=function(){this._input.restart(),this.__tokens=new se,this._reset();for(var Y,ue=new H(Z.START,""),ee=null,le=[],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)?(le.push(ee),ee=Y):ee&&this._is_closing(Y,ee)&&(Y.opened=ee,ee.closed=Y,ee=le.pop(),Y.parent=ee),Y.previous=ue,ue.next=Y,this.__tokens.add(Y),ue=Y}return this.__tokens},j.prototype._is_first_token=function(){return this.__tokens.isEmpty()},j.prototype._reset=function(){},j.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,"")},j.prototype._is_comment=function(Y){return!1},j.prototype._is_opening=function(Y){return!1},j.prototype._is_closing=function(Y,ue){return!1},j.prototype._create_token=function(Y,ue){var ee=new H(Y,ue,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return ee},j.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},q.exports.Tokenizer=j,q.exports.TOKEN=Z},function(q){function k(I){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=I}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 I=null;return this.hasNext()&&(I=this.__tokens[this.__position],this.__position+=1),I},k.prototype.peek=function(I){var O=null;return I=I||0,I+=this.__position,I>=0&&I<this.__tokens_length&&(O=this.__tokens[I]),O},k.prototype.add=function(I){this.__parent_token&&(I.parent=this.__parent_token),this.__tokens.push(I),this.__tokens_length+=1},q.exports.TokenStream=k},function(q,k,I){var O=I(12).Pattern;function H(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=""}H.prototype=new O,H.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+"]")},H.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},H.prototype.matching=function(se,ae){var Z=this._create();return Z.__set_whitespace_patterns(se,ae),Z._update(),Z},H.prototype._create=function(){return new H(this._input,this)},H.prototype.__split=function(se,ae){se.lastIndex=0;for(var Z=0,j=[],Y=se.exec(ae);Y;)j.push(ae.substring(Z,Y.index)),Z=Y.index+Y[0].length,Y=se.exec(ae);return Z<ae.length?j.push(ae.substring(Z,ae.length)):j.push(""),j},q.exports.WhitespacePattern=H},function(q){function k(I,O){this._input=I,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 I=this._input.read(this._starting_pattern);return(!this._starting_pattern||I)&&(I+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),I},k.prototype.read_match=function(){return this._input.match(this._match_pattern)},k.prototype.until_after=function(I){var O=this._create();return O._until_after=!0,O._until_pattern=this._input.get_regexp(I),O._update(),O},k.prototype.until=function(I){var O=this._create();return O._until_after=!1,O._until_pattern=this._input.get_regexp(I),O._update(),O},k.prototype.starting_with=function(I){var O=this._create();return O._starting_pattern=this._input.get_regexp(I,!0),O._update(),O},k.prototype.matching=function(I){var O=this._create();return O._match_pattern=this._input.get_regexp(I,!0),O._update(),O},k.prototype._create=function(){return new k(this._input,this)},k.prototype._update=function(){},q.exports.Pattern=k},function(q){function k(I,O){I=typeof I=="string"?I:I.source,O=typeof O=="string"?O:O.source,this.__directives_block_pattern=new RegExp(I+/ beautify( \w+[:]\w+)+ /.source+O,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(I+/\sbeautify\signore:end\s/.source+O,"g")}k.prototype.get_directives=function(I){if(!I.match(this.__directives_block_pattern))return null;var O={};this.__directive_pattern.lastIndex=0;for(var H=this.__directive_pattern.exec(I);H;)O[H[1]]=H[2],H=this.__directive_pattern.exec(I);return O},k.prototype.readIgnored=function(I){return I.readUntilAfter(this.__directives_end_ignore_pattern)},q.exports.Directives=k},function(q,k,I){var O=I(12).Pattern,H={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({},H),this._excluded=Object.assign({},H),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 j=new O(ae);this.__patterns={handlebars_comment:j.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:j.starting_with(/{{{/).until_after(/}}}/),handlebars:j.starting_with(/{{/).until_after(/}}/),php:j.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:j.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:j.starting_with(/{%/).until_after(/%}/),django_value:j.starting_with(/{{/).until_after(/}}/),django_comment:j.starting_with(/{#/).until_after(/#}/),smarty:j.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:j.starting_with(/{\*/).until_after(/\*}/),smarty_literal:j.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 j in H)Z._disabled[j]=ae.templating.indexOf(j)===-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 j=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&j==="?"&&(ae=ae||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&j==="%"&&(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},q.exports.TemplatablePattern=se},,,,function(q,k,I){var O=I(19).Beautifier,H=I(20).Options;function se(ae,Z,j,Y){var ue=new O(ae,Z,j,Y);return ue.beautify()}q.exports=se,q.exports.defaultOptions=function(){return new H}},function(q,k,I){var O=I(20).Options,H=I(2).Output,se=I(21).Tokenizer,ae=I(21).TOKEN,Z=/\r\n|[\r\n]/,j=/\r\n|[\r\n]/g,Y=function(de,ie){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 H(de,ie)};Y.prototype.current_line_has_match=function(de){return this._output.current_line.has_match(de)},Y.prototype.set_space_before_token=function(de,ie){this._output.space_before_token=de,this._output.non_breaking_space=ie},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 ie=0;de.type!==ae.TEXT&&de.previous.type!==ae.TEXT&&(ie=de.newlines?1:0),this.preserve_newlines&&(ie=de.newlines<this.max_preserve_newlines+1?de.newlines:this.max_preserve_newlines+1);for(var ce=0;ce<ie;ce++)this.print_newline(ce>0);return ie!==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 ie=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&&(ie=ce.next.next.text);break}ce=ce.next}return ie},ee=function(de,ie){var ce=null,he=null;return ie.closed?(de==="script"?ce="text/javascript":de==="style"&&(ce="text/css"),ce=ue(ie)||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 le(de,ie){return ie.indexOf(de)!==-1}function De(de,ie,ce){this.parent=de||null,this.tag=ie?ie.tag_name:"",this.indent_level=ce||0,this.parser_token=ie||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 ie=new De(this._current_frame,de,this._printer.indent_level);this._current_frame=ie},ve.prototype._try_pop_frame=function(de){var ie=null;return de&&(ie=de.parser_token,this._printer.indent_level=de.indent_level,this._current_frame=de.parent),ie},ve.prototype._get_frame=function(de,ie){for(var ce=this._current_frame;ce&&de.indexOf(ce.tag)===-1;){if(ie&&ie.indexOf(ce.tag)!==-1){ce=null;break}ce=ce.parent}return ce},ve.prototype.try_pop=function(de,ie){var ce=this._get_frame([de],ie);return this._try_pop_frame(ce)},ve.prototype.indent_to_tag=function(de){var ie=this._get_frame(de);ie&&(this._printer.indent_level=ie.indent_level)};function Ye(de,ie,ce,he){this._source_text=de||"",ie=ie||{},this._js_beautify=ce,this._css_beautify=he,this._tag_stack=null;var Le=new O(ie,"html");this._options=Le,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,ie=this._options.eol;this._options.eol==="auto"&&(ie=`
`,de&&Z.test(de)&&(ie=de.match(Z)[0])),de=de.replace(j,`
`);var ce=de.match(/^[\t ]*/)[0],he={text:"",type:""},Le=new We(this._options),Se=new Y(this._options,ce),D=new se(de,this._options).tokenize();this._tag_stack=new ve(Se);for(var M=null,ne=D.next();ne.type!==ae.EOF;)ne.type===ae.TAG_OPEN||ne.type===ae.COMMENT?(M=this._handle_tag_open(Se,ne,Le,he,D),Le=M):ne.type===ae.ATTRIBUTE||ne.type===ae.EQUALS||ne.type===ae.VALUE||ne.type===ae.TEXT&&!Le.tag_complete?M=this._handle_inside_tag(Se,ne,Le,he):ne.type===ae.TAG_CLOSE?M=this._handle_tag_close(Se,ne,Le):ne.type===ae.TEXT?M=this._handle_text(Se,ne,Le):ne.type===ae.CONTROL_FLOW_OPEN?M=this._handle_control_flow_open(Se,ne):ne.type===ae.CONTROL_FLOW_CLOSE?M=this._handle_control_flow_close(Se,ne):Se.add_raw_token(ne),he=M,ne=D.next();var be=Se._output.get_code(ie);return be},Ye.prototype._handle_control_flow_open=function(de,ie){var ce={text:ie.text,type:ie.type};return de.set_space_before_token(ie.newlines||ie.whitespace_before!=="",!0),ie.newlines?de.print_preserved_newlines(ie):de.set_space_before_token(ie.newlines||ie.whitespace_before!=="",!0),de.print_token(ie),de.indent(),ce},Ye.prototype._handle_control_flow_close=function(de,ie){var ce={text:ie.text,type:ie.type};return de.deindent(),ie.newlines?de.print_preserved_newlines(ie):de.set_space_before_token(ie.newlines||ie.whitespace_before!=="",!0),de.print_token(ie),ce},Ye.prototype._handle_tag_close=function(de,ie,ce){var he={text:ie.text,type:ie.type};return de.alignment_size=0,ce.tag_complete=!0,de.set_space_before_token(ie.newlines||ie.whitespace_before!=="",!0),ce.is_unformatted?de.add_raw_token(ie):(ce.tag_start_char==="<"&&(de.set_space_before_token(ie.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&ce.has_wrapped_attrs&&de.print_newline(!1)),de.print_token(ie)),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,ie,ce,he){var Le=ce.has_wrapped_attrs,Se={text:ie.text,type:ie.type};return de.set_space_before_token(ie.newlines||ie.whitespace_before!=="",!0),ce.is_unformatted?de.add_raw_token(ie):ce.tag_start_char==="{"&&ie.type===ae.TEXT?de.print_preserved_newlines(ie)?(ie.newlines=0,de.add_raw_token(ie)):de.print_token(ie):(ie.type===ae.ATTRIBUTE?de.set_space_before_token(!0):(ie.type===ae.EQUALS||ie.type===ae.VALUE&&ie.previous.type===ae.EQUALS)&&de.set_space_before_token(!1),ie.type===ae.ATTRIBUTE&&ce.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(de.traverse_whitespace(ie),Le=Le||ie.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),Le=!0)),de.print_token(ie),Le=Le||de.previous_token_wrapped(),ce.has_wrapped_attrs=Le),Se},Ye.prototype._handle_text=function(de,ie,ce){var he={text:ie.text,type:"TK_CONTENT"};return ce.custom_beautifier_name?this._print_custom_beatifier_text(de,ie,ce):ce.is_unformatted||ce.is_content_unformatted?de.add_raw_token(ie):(de.traverse_whitespace(ie),de.print_token(ie)),he},Ye.prototype._print_custom_beatifier_text=function(de,ie,ce){var he=this;if(ie.text!==""){var Le=ie.text,Se,D=1,M="",ne="";ce.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Se=this._js_beautify:ce.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Se=this._css_beautify:ce.custom_beautifier_name==="html"&&(Se=function(sr,jt){var Pt=new Ye(sr,jt,he._js_beautify,he._css_beautify);return Pt.beautify()}),this._options.indent_scripts==="keep"?D=0:this._options.indent_scripts==="separate"&&(D=-de.indent_level);var be=de.get_full_indent(D);if(Le=Le.replace(/\n[ \t]*$/,""),ce.custom_beautifier_name!=="html"&&Le[0]==="<"&&Le.match(/^(<!--|<!\[CDATA\[)/)){var st=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(Le);if(!st){de.add_raw_token(ie);return}M=be+st[1]+`
`,Le=st[4],st[5]&&(ne=be+st[5]),Le=Le.replace(/\n[ \t]*$/,""),(st[2]||st[3].indexOf(`
`)!==-1)&&(st=st[3].match(/[ \t]+$/),st&&(ie.whitespace_before=st[0]))}if(Le)if(Se){var ot=function(){this.eol=`
`};ot.prototype=this._options.raw_options;var At=new ot;Le=Se(be+Le,At)}else{var Xe=ie.whitespace_before;Xe&&(Le=Le.replace(new RegExp(`
(`+Xe+")?","g"),`
`)),Le=be+Le.replace(/\n/g,`
`+be)}M&&(Le?Le=M+Le+`
`+ne:Le=M+ne),de.print_newline(!1),Le&&(ie.text=Le,ie.whitespace_before="",ie.newlines=0,de.add_raw_token(ie),de.print_newline(!0))}},Ye.prototype._handle_tag_open=function(de,ie,ce,he,Le){var Se=this._get_tag_open_token(ie);if((ce.is_unformatted||ce.is_content_unformatted)&&!ce.is_empty_element&&ie.type===ae.TAG_OPEN&&!Se.is_start_tag?(de.add_raw_token(ie),Se.start_tag_token=this._tag_stack.try_pop(Se.tag_name)):(de.traverse_whitespace(ie),this._set_tag_position(de,ie,Se,ce,he),Se.is_inline_element||de.set_wrap_point(),de.print_token(ie)),Se.is_start_tag&&this._is_wrap_attributes_force){var D=0,M;do M=Le.peek(D),M.type===ae.ATTRIBUTE&&(Se.attr_count+=1),D+=1;while(M.type!==ae.EOF&&M.type!==ae.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Se.alignment_size=ie.text.length+1),!Se.tag_complete&&!Se.is_unformatted&&(de.alignment_size=Se.alignment_size),Se};var We=function(de,ie,ce){if(this.parent=ie||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 Le=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(Le=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!de.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(Le)))}};Ye.prototype._get_tag_open_token=function(de){var ie=new We(this._options,this._tag_stack.get_parser_token(),de);return ie.alignment_size=this._options.wrap_attributes_indent_size,ie.is_end_tag=ie.is_end_tag||le(ie.tag_check,this._options.void_elements),ie.is_empty_element=ie.tag_complete||ie.is_start_tag&&ie.is_end_tag,ie.is_unformatted=!ie.tag_complete&&le(ie.tag_check,this._options.unformatted),ie.is_content_unformatted=!ie.is_empty_element&&le(ie.tag_check,this._options.content_unformatted),ie.is_inline_element=le(ie.tag_name,this._options.inline)||this._options.inline_custom_elements&&ie.tag_name.includes("-")||ie.tag_start_char==="{",ie},Ye.prototype._set_tag_position=function(de,ie,ce,he,Le){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,ie)))),le(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 Se=de.current_line_has_match(/{{#if/);Se||de.print_newline(!1)}ce.tag_name==="!--"&&Le.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)&&!(Le.type===ae.TAG_CLOSE&&ce.start_tag_token===he)&&Le.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)&&(Le.type!=="TK_CONTENT"||ce.is_content_unformatted)&&de.print_newline(!1),this._calcluate_parent_multiline(de,ce)},Ye.prototype._calcluate_parent_multiline=function(de,ie){ie.parent&&de._output.just_added_newline()&&!((ie.is_inline_element||ie.is_unformatted)&&ie.parent.is_inline_element)&&(ie.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"],gt=["a","audio","del","ins","map","noscript","video"];Ye.prototype._do_optional_end_element=function(de){var ie=null;if(!(de.is_empty_element||!de.is_start_tag||!de.parent)){if(de.tag_name==="body")ie=ie||this._tag_stack.try_pop("head");else if(de.tag_name==="li")ie=ie||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(de.tag_name==="dd"||de.tag_name==="dt")ie=ie||this._tag_stack.try_pop("dt",["dl"]),ie=ie||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||gt.indexOf(ce.tag_name)===-1)&&(ie=ie||this._tag_stack.try_pop("p"))}else de.tag_name==="rp"||de.tag_name==="rt"?(ie=ie||this._tag_stack.try_pop("rt",["ruby","rtc"]),ie=ie||this._tag_stack.try_pop("rp",["ruby","rtc"])):de.tag_name==="optgroup"?ie=ie||this._tag_stack.try_pop("optgroup",["select"]):de.tag_name==="option"?ie=ie||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):de.tag_name==="colgroup"?ie=ie||this._tag_stack.try_pop("caption",["table"]):de.tag_name==="thead"?(ie=ie||this._tag_stack.try_pop("caption",["table"]),ie=ie||this._tag_stack.try_pop("colgroup",["table"])):de.tag_name==="tbody"||de.tag_name==="tfoot"?(ie=ie||this._tag_stack.try_pop("caption",["table"]),ie=ie||this._tag_stack.try_pop("colgroup",["table"]),ie=ie||this._tag_stack.try_pop("thead",["table"]),ie=ie||this._tag_stack.try_pop("tbody",["table"])):de.tag_name==="tr"?(ie=ie||this._tag_stack.try_pop("caption",["table"]),ie=ie||this._tag_stack.try_pop("colgroup",["table"]),ie=ie||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(de.tag_name==="th"||de.tag_name==="td")&&(ie=ie||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),ie=ie||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return de.parent=this._tag_stack.get_parser_token(),ie}},q.exports.Beautifier=Ye},function(q,k,I){var O=I(6).Options;function H(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"])}H.prototype=new O,q.exports.Options=H},function(q,k,I){var O=I(9).Tokenizer,H=I(9).TOKEN,se=I(13).Directives,ae=I(14).TemplatablePattern,Z=I(12).Pattern,j={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:H.START,RAW:H.RAW,EOF:H.EOF},Y=new se(/<\!--/,/-->/),ue=function(ee,le){O.call(this,ee,le),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===j.TAG_OPEN||ee.type===j.CONTROL_FLOW_OPEN},ue.prototype._is_closing=function(ee,le){return ee.type===j.TAG_CLOSE&&le&&((ee.text===">"||ee.text==="/>")&&le.text[0]==="<"||ee.text==="}}"&&le.text[0]==="{"&&le.text[1]==="{")||ee.type===j.CONTROL_FLOW_CLOSE&&ee.text==="}"&&le.text.endsWith("{")},ue.prototype._reset=function(){this._current_tag_name=""},ue.prototype._get_next_token=function(ee,le){var De=null;this._readWhitespace();var ve=this._input.peek();return ve===null?this._create_token(j.EOF,""):(De=De||this._read_open_handlebars(ve,le),De=De||this._read_attribute(ve,ee,le),De=De||this._read_close(ve,le),De=De||this._read_script_and_style(ve,ee),De=De||this._read_control_flows(ve,le),De=De||this._read_raw_content(ve,ee,le),De=De||this._read_content_word(ve,le),De=De||this._read_comment_or_cdata(ve),De=De||this._read_processing(ve),De=De||this._read_open(ve,le),De=De||this._create_token(j.UNKNOWN,this._input.next()),De)},ue.prototype._read_comment_or_cdata=function(ee){var le=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&&(le=this._create_token(j.COMMENT,De),le.directives=ve)}return le},ue.prototype._read_processing=function(ee){var le=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&&(le=this._create_token(j.COMMENT,De),le.directives=ve)}return le},ue.prototype._read_open=function(ee,le){var De=null,ve=null;return(!le||le.type===j.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(j.TAG_OPEN,De)),ve},ue.prototype._read_open_handlebars=function(ee,le){var De=null,ve=null;return(!le||le.type===j.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(j.COMMENT,De)):(De=this.__patterns.handlebars_open.read(),ve=this._create_token(j.TAG_OPEN,De))),ve},ue.prototype._read_control_flows=function(ee,le){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(j.CONTROL_FLOW_OPEN,De)}else ee==="}"&&le&&le.type===j.CONTROL_FLOW_OPEN&&(De=this._input.next(),ve=this._create_token(j.CONTROL_FLOW_CLOSE,De));return ve},ue.prototype._read_close=function(ee,le){var De=null,ve=null;return le&&le.type===j.TAG_OPEN&&(le.text[0]==="<"&&(ee===">"||ee==="/"&&this._input.peek(1)===">")?(De=this._input.next(),ee==="/"&&(De+=this._input.next()),ve=this._create_token(j.TAG_CLOSE,De)):le.text[0]==="{"&&ee==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ve=this._create_token(j.TAG_CLOSE,"}}"))),ve},ue.prototype._read_attribute=function(ee,le,De){var ve=null,Ye="";if(De&&De.text[0]==="<")if(ee==="=")ve=this._create_token(j.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(j.VALUE,We)}else Ye=this.__patterns.attribute.read(),Ye&&(le.type===j.EQUALS?ve=this._create_token(j.VALUE,Ye):ve=this._create_token(j.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,le,De){var ve="";if(De&&De.text[0]==="{")ve=this.__patterns.handlebars_raw_close.read();else if(le.type===j.TAG_CLOSE&&le.opened.text[0]==="<"&&le.text[0]!=="/"){var Ye=le.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(j.TEXT,ve):null},ue.prototype._read_script_and_style=function(ee,le){if(le.type===j.TAG_CLOSE&&le.opened.text[0]==="<"&&le.text[0]!=="/"){var De=le.opened.text.substr(1).toLowerCase();if(De==="script"||De==="style"){var ve=this._read_comment_or_cdata(ee);if(ve)return ve.type=j.TEXT,ve;var Ye=this._input.readUntil(new RegExp("</"+De+"[\\n\\r\\t ]*?>","ig"));if(Ye)return this._create_token(j.TEXT,Ye)}}return null},ue.prototype._read_content_word=function(ee,le){var De="";return this._options.unformatted_content_delimiter&&ee===this._options.unformatted_content_delimiter[0]&&(De=this.__patterns.unformatted_content_delimiter.read()),De||(De=le&&le.type===j.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),De?this._create_token(j.TEXT,De):null},q.exports.Tokenizer=ue,q.exports.TOKEN=j}],N={};function d(q){var k=N[q];if(k!==void 0)return k.exports;var I=N[q]={exports:{}};return Re[q](I,I.exports,d),I.exports}var xe=d(18);rt=xe})();var Me=rt;if(1)pe=[X,X(58553),X(87804)],Pe=function(Re){var N=X(58553),d=X(87804);return{html_beautify:function(xe,q){return Me(xe,q,N.js_beautify,d.css_beautify)}}}.apply(It,pe),Pe!==void 0&&($r.exports=Pe);else var re,E})()},58553:function($r,It){var X,pe;(function(){var Pe;(function(){"use strict";var Me=[function(N,d,xe){var q=xe(1).Beautifier,k=xe(5).Options;function I(O,H){var se=new q(O,H);return se.beautify()}N.exports=I,N.exports.defaultOptions=function(){return new k}},function(N,d,xe){var q=xe(2).Output,k=xe(3).Token,I=xe(4),O=xe(5).Options,H=xe(7).Tokenizer,se=xe(7).line_starters,ae=xe(7).positionable_operators,Z=xe(7).TOKEN;function j(M,ne){return ne.indexOf(M)!==-1}function Y(M){return M.replace(/^\s+/g,"")}function ue(M){for(var ne={},be=0;be<M.length;be++)ne[M[be].replace(/-/g,"_")]=M[be];return ne}function ee(M,ne){return M&&M.type===Z.RESERVED&&M.text===ne}function le(M,ne){return M&&M.type===Z.RESERVED&&j(M.text,ne)}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 gt(M,ne){ne.multiline_frame||ne.mode===ut.ForInitializer||ne.mode===ut.Conditional||M.remove_indent(ne.start_line_index)}function de(M){M=M.replace(I.allLineBreaks,`
`);for(var ne=[],be=M.indexOf(`
`);be!==-1;)ne.push(M.substring(0,be)),M=M.substring(be+1),be=M.indexOf(`
`);return M.length&&ne.push(M),ne}function ie(M){return M===ut.ArrayLiteral}function ce(M){return j(M,[ut.Expression,ut.ForInitializer,ut.Conditional])}function he(M,ne){for(var be=0;be<M.length;be++){var st=M[be].trim();if(st.charAt(0)!==ne)return!1}return!0}function Le(M,ne){for(var be=0,st=M.length,ot;be<st;be++)if(ot=M[be],ot&&ot.indexOf(ne)!==0)return!1;return!0}function Se(M,ne){ne=ne||{},this._source_text=M||"",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(ne)}Se.prototype.create_flags=function(M,ne){var be=0;M&&(be=M.indentation_level,!this._output.just_added_newline()&&M.line_indent_level>be&&(be=M.line_indent_level));var st={mode:ne,parent:M,last_token:M?M.last_token:new k(Z.START_BLOCK,""),last_word:M?M.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:be,alignment:0,line_indent_level:M?M.line_indent_level:be,start_line_index:this._output.get_line_number(),ternary_depth:0};return st},Se.prototype._reset=function(M){var ne=M.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new q(this._options,ne),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(ut.BlockStatement);var be=new H(M,this._options);return this._tokens=be.tokenize(),M},Se.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var M,ne=this._reset(this._source_text),be=this._options.eol;this._options.eol==="auto"&&(be=`
`,ne&&I.lineBreak.test(ne||"")&&(be=ne.match(I.lineBreak)[0]));for(var st=this._tokens.next();st;)this.handle_token(st),this._last_last_text=this._flags.last_token.text,this._flags.last_token=st,st=this._tokens.next();return M=this._output.get_code(be),M},Se.prototype.handle_token=function(M,ne){M.type===Z.START_EXPR?this.handle_start_expr(M):M.type===Z.END_EXPR?this.handle_end_expr(M):M.type===Z.START_BLOCK?this.handle_start_block(M):M.type===Z.END_BLOCK?this.handle_end_block(M):M.type===Z.WORD?this.handle_word(M):M.type===Z.RESERVED?this.handle_word(M):M.type===Z.SEMICOLON?this.handle_semicolon(M):M.type===Z.STRING?this.handle_string(M):M.type===Z.EQUALS?this.handle_equals(M):M.type===Z.OPERATOR?this.handle_operator(M):M.type===Z.COMMA?this.handle_comma(M):M.type===Z.BLOCK_COMMENT?this.handle_block_comment(M,ne):M.type===Z.COMMENT?this.handle_comment(M,ne):M.type===Z.DOT?this.handle_dot(M):M.type===Z.EOF?this.handle_eof(M):M.type===Z.UNKNOWN?this.handle_unknown(M,ne):this.handle_unknown(M,ne)},Se.prototype.handle_whitespace_and_comments=function(M,ne){var be=M.newlines,st=this._options.keep_array_indentation&&ie(this._flags.mode);if(M.comments_before)for(var ot=M.comments_before.next();ot;)this.handle_whitespace_and_comments(ot,ne),this.handle_token(ot,ne),ot=M.comments_before.next();if(st)for(var At=0;At<be;At+=1)this.print_newline(At>0,ne);else if(this._options.max_preserve_newlines&&be>this._options.max_preserve_newlines&&(be=this._options.max_preserve_newlines),this._options.preserve_newlines&&be>1){this.print_newline(!1,ne);for(var Xe=1;Xe<be;Xe+=1)this.print_newline(!0,ne)}};var D=["async","break","continue","return","throw","yield"];Se.prototype.allow_wrap_or_preserved_newline=function(M,ne){if(ne=ne===void 0?!1:ne,!this._output.just_added_newline()){var be=this._options.preserve_newlines&&M.newlines||ne,st=j(this._flags.last_token.text,ae)||j(M.text,ae);if(st){var ot=j(this._flags.last_token.text,ae)&&j(this._options.operator_position,We)||j(M.text,ae);be=be&&ot}if(be)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(le(this._flags.last_token,D))return;this._output.set_wrap_point()}}},Se.prototype.print_newline=function(M,ne){if(!ne&&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 be=this._tokens.peek();this._flags.mode===ut.Statement&&!(this._flags.if_block&&ee(be,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(M)&&(this._flags.multiline_frame=!0)},Se.prototype.print_token_line_indentation=function(M){this._output.just_added_newline()&&(this._options.keep_array_indentation&&M.newlines&&(M.text==="["||ie(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(M.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))},Se.prototype.print_token=function(M){if(this._output.raw){this._output.add_raw_token(M);return}if(this._options.comma_first&&M.previous&&M.previous.type===Z.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var ne=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(ne),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(M),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(M),this._output.non_breaking_space=!0,this._output.add_token(M.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Se.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Se.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))},Se.prototype.set_mode=function(M){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,M),this._flags=this.create_flags(this._previous_flags,M),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Se.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&&gt(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Se.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||le(this._flags.last_token,["get","set"]))},Se.prototype.start_of_statement=function(M){var ne=!1;return ne=ne||le(this._flags.last_token,["var","let","const"])&&M.type===Z.WORD,ne=ne||ee(this._flags.last_token,"do"),ne=ne||!(this._flags.parent.mode===ut.ObjectLiteral&&this._flags.mode===ut.Statement)&&le(this._flags.last_token,D)&&!M.newlines,ne=ne||ee(this._flags.last_token,"else")&&!(ee(M,"if")&&!M.comments_before),ne=ne||this._flags.last_token.type===Z.END_EXPR&&(this._previous_flags.mode===ut.ForInitializer||this._previous_flags.mode===ut.Conditional),ne=ne||this._flags.last_token.type===Z.WORD&&this._flags.mode===ut.BlockStatement&&!this._flags.in_case&&!(M.text==="--"||M.text==="++")&&this._last_last_text!=="function"&&M.type!==Z.WORD&&M.type!==Z.RESERVED,ne=ne||this._flags.mode===ut.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||le(this._flags.last_token,["get","set"])),ne?(this.set_mode(ut.Statement),this.indent(),this.handle_whitespace_and_comments(M,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M,le(M,["do","for","if","while"])),!0):!1},Se.prototype.handle_start_expr=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M);var ne=ut.Expression;if(M.text==="["){if(this._flags.last_token.type===Z.WORD||this._flags.last_token.text===")"){le(this._flags.last_token,se)&&(this._output.space_before_token=!0),this.print_token(M),this.set_mode(ne),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}ne=ut.ArrayLiteral,ie(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()),j(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,ne=ut.ForInitializer):j(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,ne=ut.Conditional):j(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&M.whitespace_before===""?this._output.space_before_token=!1:(j(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(M);else if(this._flags.last_token.type===Z.WORD){this._output.space_before_token=!1;var be=this._tokens.peek(-3);if(this._options.space_after_named_function&&be){var st=this._tokens.peek(-4);le(be,["async","function"])||be.text==="*"&&le(st,["async","function"])?this._output.space_before_token=!0:this._flags.mode===ut.ObjectLiteral?(be.text==="{"||be.text===","||be.text==="*"&&(st.text==="{"||st.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(M);(this._flags.last_token.type===Z.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(j(this._last_last_text,["function","yield"])||this._flags.mode===ut.ObjectLiteral&&j(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(M,M.newlines),this.print_token(M),this.set_mode(ne),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Se.prototype.handle_end_expr=function(M){for(;this._flags.mode===ut.Statement;)this.restore_mode();this.handle_whitespace_and_comments(M),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(M,M.text==="]"&&ie(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(M),this.restore_mode(),gt(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)},Se.prototype.handle_start_block=function(M){this.handle_whitespace_and_comments(M);var ne=this._tokens.peek(),be=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):be&&(j(be.text,[":",","])&&j(ne.type,[Z.STRING,Z.WORD,Z.RESERVED])||j(ne.text,["get","set","..."])&&j(be.type,[Z.WORD,Z.RESERVED]))?j(this._last_last_text,["class","interface"])&&!j(be.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):j(this._flags.last_token.type,[Z.EQUALS,Z.START_EXPR,Z.COMMA,Z.OPERATOR])||le(this._flags.last_token,["return","throw","import","default"])?this.set_mode(ut.ObjectLiteral):this.set_mode(ut.BlockStatement),this._flags.last_token&&le(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var st=!ne.comments_before&&ne.text==="}",ot=st&&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===M))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&M.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Z.OPERATOR&&(ot||this._flags.last_token.type===Z.EQUALS||le(this._flags.last_token,De)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(ie(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(M),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&&(j(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(M),this.indent(),!st&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Se.prototype.handle_end_block=function(M){for(this.handle_whitespace_and_comments(M);this._flags.mode===ut.Statement;)this.restore_mode();var ne=this._flags.last_token.type===Z.START_BLOCK;this._flags.inline_frame&&!ne?this._output.space_before_token=!0:this._options.brace_style==="expand"?ne||this.print_newline():ne||(ie(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(M)},Se.prototype.handle_word=function(M){if(M.type===Z.RESERVED){if(j(M.text,["set","get"])&&this._flags.mode!==ut.ObjectLiteral)M.type=Z.WORD;else if(M.text==="import"&&j(this._tokens.peek().text,["(","."]))M.type=Z.WORD;else if(j(M.text,["as","from"])&&!this._flags.import_block)M.type=Z.WORD;else if(this._flags.mode===ut.ObjectLiteral){var ne=this._tokens.peek();ne.text===":"&&(M.type=Z.WORD)}}if(this.start_of_statement(M)?le(this._flags.last_token,["var","let","const"])&&M.type===Z.WORD&&(this._flags.declaration_statement=!0):M.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||!le(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(M),this.print_newline()):this.handle_whitespace_and_comments(M),this._flags.do_block&&!this._flags.do_while)if(ee(M,"while")){this._output.space_before_token=!0,this.print_token(M),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(M,"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&&le(M,["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(M),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()&&!(j(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===ut.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(M),ee(M,"function")){(j(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(j(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===Z.OPERATOR))&&!this._output.just_added_blankline()&&!M.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===Z.RESERVED||this._flags.last_token.type===Z.WORD?le(this._flags.last_token,["get","set","new","export"])||le(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)||ie(this._flags.mode))||this.print_newline(),this.print_token(M),this._flags.last_word=M.text;return}var be="NONE";if(this._flags.last_token.type===Z.END_BLOCK?this._previous_flags.inline_frame?be="SPACE":le(M,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&M.newlines?be="NEWLINE":(be="SPACE",this._output.space_before_token=!0):be="NEWLINE":this._flags.last_token.type===Z.SEMICOLON&&this._flags.mode===ut.BlockStatement?be="NEWLINE":this._flags.last_token.type===Z.SEMICOLON&&ce(this._flags.mode)?be="SPACE":this._flags.last_token.type===Z.STRING?be="NEWLINE":this._flags.last_token.type===Z.RESERVED||this._flags.last_token.type===Z.WORD||this._flags.last_token.text==="*"&&(j(this._last_last_text,["function","yield"])||this._flags.mode===ut.ObjectLiteral&&j(this._last_last_text,["{",","]))?be="SPACE":this._flags.last_token.type===Z.START_BLOCK?this._flags.inline_frame?be="SPACE":be="NEWLINE":this._flags.last_token.type===Z.END_EXPR&&(this._output.space_before_token=!0,be="NEWLINE"),le(M,se)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?be="SPACE":be="NEWLINE"),le(M,["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"&&M.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var st=this._output.current_line;st.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else be==="NEWLINE"?le(this._flags.last_token,De)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&le(M,["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||!le(M,["var","let","const"]))&&this._flags.last_token.text!==":"&&(ee(M,"if")&&ee(M.previous,"else")?this._output.space_before_token=!0:this.print_newline()):le(M,se)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&ie(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():be==="SPACE"&&(this._output.space_before_token=!0);M.previous&&(M.previous.type===Z.WORD||M.previous.type===Z.RESERVED)&&(this._output.space_before_token=!0),this.print_token(M),this._flags.last_word=M.text,M.type===Z.RESERVED&&(M.text==="do"?this._flags.do_block=!0:M.text==="if"?this._flags.if_block=!0:M.text==="import"?this._flags.import_block=!0:this._flags.import_block&&ee(M,"from")&&(this._flags.import_block=!1))},Se.prototype.handle_semicolon=function(M){this.start_of_statement(M)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(M);for(var ne=this._tokens.peek();this._flags.mode===ut.Statement&&!(this._flags.if_block&&ee(ne,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(M)},Se.prototype.handle_string=function(M){M.text.startsWith("`")&&M.newlines===0&&M.whitespace_before===""&&(M.previous.text===")"||this._flags.last_token.type===Z.WORD)||(this.start_of_statement(M)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(M),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(M):M.text.startsWith("`")&&this._flags.last_token.type===Z.END_EXPR&&(M.previous.text==="]"||M.previous.text===")")&&M.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(M)},Se.prototype.handle_equals=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0},Se.prototype.handle_comma=function(M){this.handle_whitespace_and_comments(M,!0),this.print_token(M),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(M)):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(M)},Se.prototype.handle_operator=function(M){var ne=M.text==="*"&&(le(this._flags.last_token,["function","yield"])||j(this._flags.last_token.type,[Z.START_BLOCK,Z.COMMA,Z.END_BLOCK,Z.SEMICOLON])),be=j(M.text,["-","+"])&&(j(this._flags.last_token.type,[Z.START_BLOCK,Z.START_EXPR,Z.EQUALS,Z.OPERATOR])||j(this._flags.last_token.text,se)||this._flags.last_token.text===",");if(!this.start_of_statement(M)){var st=!ne;this.handle_whitespace_and_comments(M,st)}if(M.text==="*"&&this._flags.last_token.type===Z.DOT){this.print_token(M);return}if(M.text==="::"){this.print_token(M);return}if(j(M.text,["-","+"])&&this.start_of_object_property()){this.print_token(M);return}if(this._flags.last_token.type===Z.OPERATOR&&j(this._options.operator_position,We)&&this.allow_wrap_or_preserved_newline(M),M.text===":"&&this._flags.in_case){this.print_token(M),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(M.text===":"?this._flags.ternary_depth===0?ot=!1:(this._flags.ternary_depth-=1,Xe=!0):M.text==="?"&&(this._flags.ternary_depth+=1),!be&&!ne&&this._options.preserve_newlines&&j(M.text,ae)){var sr=M.text===":",jt=sr&&Xe,Pt=sr&&!Xe;switch(this._options.operator_position){case Ye.before_newline:this._output.space_before_token=!Pt,this.print_token(M),(!sr||jt)&&this.allow_wrap_or_preserved_newline(M),this._output.space_before_token=!0;return;case Ye.after_newline:this._output.space_before_token=!0,!sr||jt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(M):this._output.space_before_token=!1,this.print_token(M),this._output.space_before_token=!0;return;case Ye.preserve_newline:Pt||this.allow_wrap_or_preserved_newline(M),ot=!(this._output.just_added_newline()||Pt),this._output.space_before_token=ot,this.print_token(M),this._output.space_before_token=!0;return}}if(ne){this.allow_wrap_or_preserved_newline(M),ot=!1;var Cr=this._tokens.peek();At=Cr&&j(Cr.type,[Z.WORD,Z.RESERVED])}else if(M.text==="...")this.allow_wrap_or_preserved_newline(M),ot=this._flags.last_token.type===Z.START_BLOCK,At=!1;else if(j(M.text,["--","++","!","~"])||be){if((this._flags.last_token.type===Z.COMMA||this._flags.last_token.type===Z.START_EXPR)&&this.allow_wrap_or_preserved_newline(M),ot=!1,At=!1,M.newlines&&(M.text==="--"||M.text==="++"||M.text==="~")){var zr=le(this._flags.last_token,De)&&M.newlines;zr&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(zr,!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==="]"&&(M.text==="--"||M.text==="++")):this._flags.last_token.type===Z.OPERATOR&&(ot=j(M.text,["--","-","++","+"])&&j(this._flags.last_token.text,["--","-","++","+"]),j(M.text,["+","-"])&&j(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(M),this._output.space_before_token=At},Se.prototype.handle_block_comment=function(M,ne){if(this._output.raw){this._output.add_raw_token(M),M.directives&&M.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(M.directives){this.print_newline(!1,ne),this.print_token(M),M.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!I.newline.test(M.text)&&!M.newlines){this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0;return}else this.print_block_commment(M,ne)},Se.prototype.print_block_commment=function(M,ne){var be=de(M.text),st,ot=!1,At=!1,Xe=M.whitespace_before,sr=Xe.length;if(this.print_newline(!1,ne),this.print_token_line_indentation(M),this._output.add_token(be[0]),this.print_newline(!1,ne),be.length>1){for(be=be.slice(1),ot=he(be,"*"),At=Le(be,Xe),ot&&(this._flags.alignment=1),st=0;st<be.length;st++)ot?(this.print_token_line_indentation(M),this._output.add_token(Y(be[st]))):At&&be[st]?(this.print_token_line_indentation(M),this._output.add_token(be[st].substring(sr))):(this._output.current_line.set_indent(-1),this._output.add_token(be[st])),this.print_newline(!1,ne);this._flags.alignment=0}},Se.prototype.handle_comment=function(M,ne){M.newlines?this.print_newline(!1,ne):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(M),this.print_newline(!1,ne)},Se.prototype.handle_dot=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),le(this._flags.last_token,De)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(M,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(M)},Se.prototype.handle_unknown=function(M,ne){this.print_token(M),M.text[M.text.length-1]===`
`&&this.print_newline(!1,ne)},Se.prototype.handle_eof=function(M){for(;this._flags.mode===ut.Statement;)this.restore_mode();this.handle_whitespace_and_comments(M)},N.exports.Beautifier=Se},function(N){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 I=this.__items.length-1;I>=0;I--)if(this.__items[I].match(k))return!0;return!1},d.prototype.set_indent=function(k,I){this.is_empty()&&(this.__indent_count=k||0,this.__alignment_count=I||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 I=k.lastIndexOf(`
`);I!==-1?this.__character_count=k.length-I: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 xe(k,I){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)),I=I||"",k.indent_level>0&&(I=new Array(k.indent_level+1).join(this.__indent_string)),this.__base_string=I,this.__base_string_length=I.length}xe.prototype.get_indent_size=function(k,I){var O=this.__base_string_length;return I=I||0,k<0&&(O=0),O+=k*this.__indent_size,O+=I,O},xe.prototype.get_indent_string=function(k,I){var O=this.__base_string;return I=I||0,k<0&&(k=0,O=""),I+=k*this.__indent_size,this.__ensure_cache(I),O+=this.__cache[I],O},xe.prototype.__ensure_cache=function(k){for(;k>=this.__cache.length;)this.__add_column()},xe.prototype.__add_column=function(){var k=this.__cache.length,I=0,O="";this.__indent_size&&k>=this.__indent_size&&(I=Math.floor(k/this.__indent_size),k-=I*this.__indent_size,O=new Array(I+1).join(this.__indent_string)),k&&(O+=new Array(k+1).join(" ")),this.__cache.push(O)};function q(k,I){this.__indent_cache=new xe(k,I),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()}q.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},q.prototype.get_line_number=function(){return this.__lines.length},q.prototype.get_indent_string=function(k,I){return this.__indent_cache.get_indent_string(k,I)},q.prototype.get_indent_size=function(k,I){return this.__indent_cache.get_indent_size(k,I)},q.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},q.prototype.add_new_line=function(k){return this.is_empty()||!k&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},q.prototype.get_code=function(k){this.trim(!0);var I=this.current_line.pop();I&&(I[I.length-1]===`
`&&(I=I.replace(/\n+$/g,"")),this.current_line.push(I)),this._end_with_newline&&this.__add_outputline();var O=this.__lines.join(`
`);return k!==`
`&&(O=O.replace(/[\n]/g,k)),O},q.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},q.prototype.set_indent=function(k,I){return k=k||0,I=I||0,this.next_line.set_indent(k,I),this.__lines.length>1?(this.current_line.set_indent(k,I),!0):(this.current_line.set_indent(),!1)},q.prototype.add_raw_token=function(k){for(var I=0;I<k.newlines;I++)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},q.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()},q.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(" "))},q.prototype.remove_indent=function(k){for(var I=this.__lines.length;k<I;)this.__lines[k]._remove_indent(),k++;this.current_line._remove_wrap_indent()},q.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},q.prototype.just_added_newline=function(){return this.current_line.is_empty()},q.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},q.prototype.ensure_empty_line_above=function(k,I){for(var O=this.__lines.length-2;O>=0;){var H=this.__lines[O];if(H.is_empty())break;if(H.item(0).indexOf(k)!==0&&H.item(-1)!==I){this.__lines.splice(O+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}O--}},N.exports.Output=q},function(N){function d(xe,q,k,I){this.type=xe,this.text=q,this.comments_before=null,this.newlines=k||0,this.whitespace_before=I||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}N.exports.Token=d},function(N,d){var xe="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",q="\\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",I="\\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]+\\}",H="(?:"+O+"|["+xe+k+"])",se="(?:"+O+"|["+q+k+I+"])*";d.identifier=new RegExp(H+se,"g"),d.identifierStart=new RegExp(H),d.identifierMatch=new RegExp("(?:"+O+"|["+q+k+I+"])+");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(N,d,xe){var q=xe(6).Options,k=["before-newline","after-newline","preserve-newline"];function I(O){q.call(this,O,"js");var H=this.raw_options.brace_style||null;H==="expand-strict"?this.raw_options.brace_style="expand":H==="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)}I.prototype=new q,N.exports.Options=I},function(N){function d(k,I){this.raw_options=xe(k,I),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,I){var O=this.raw_options[k],H=I||[];return typeof O=="object"?O!==null&&typeof O.concat=="function"&&(H=O.concat()):typeof O=="string"&&(H=O.split(/[^a-zA-Z0-9_\/\-]+/)),H},d.prototype._get_boolean=function(k,I){var O=this.raw_options[k],H=O===void 0?!!I:!!O;return H},d.prototype._get_characters=function(k,I){var O=this.raw_options[k],H=I||"";return typeof O=="string"&&(H=O.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),H},d.prototype._get_number=function(k,I){var O=this.raw_options[k];I=parseInt(I,10),isNaN(I)&&(I=0);var H=parseInt(O,10);return isNaN(H)&&(H=I),H},d.prototype._get_selection=function(k,I,O){var H=this._get_selection_list(k,I,O);if(H.length!==1)throw new Error("Invalid Option Value: The option '"+k+`' can only be one of the following values:
`+I+`
You passed in: '`+this.raw_options[k]+"'");return H[0]},d.prototype._get_selection_list=function(k,I,O){if(!I||I.length===0)throw new Error("Selection list cannot be empty.");if(O=O||[I[0]],!this._is_valid_selection(O,I))throw new Error("Invalid Default Value!");var H=this._get_array(k,O);if(!this._is_valid_selection(H,I))throw new Error("Invalid Option Value: The option '"+k+`' can contain only the following values:
`+I+`
You passed in: '`+this.raw_options[k]+"'");return H},d.prototype._is_valid_selection=function(k,I){return k.length&&I.length&&!k.some(function(O){return I.indexOf(O)===-1})};function xe(k,I){var O={};k=q(k);var H;for(H in k)H!==I&&(O[H]=k[H]);if(I&&k[I])for(H in k[I])O[H]=k[I][H];return O}function q(k){var I={},O;for(O in k){var H=O.replace(/-/g,"_");I[H]=k[O]}return I}N.exports.Options=d,N.exports.normalizeOpts=q,N.exports.mergeOpts=xe},function(N,d,xe){var q=xe(8).InputScanner,k=xe(9).Tokenizer,I=xe(9).TOKEN,O=xe(13).Directives,H=xe(4),se=xe(12).Pattern,ae=xe(14).TemplatablePattern;function Z(he,Le){return Le.indexOf(he)!==-1}var j={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:I.START,RAW:I.RAW,EOF:I.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]/,le=/[^\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"]),gt=new RegExp("^(?:"+ut.join("|")+")$"),de,ie=function(he,Le){k.call(this,he,Le),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Se=new se(this._input),D=new ae(this._input).read_options(this._options);this.__patterns={template:D,identifier:D.starting_with(H.identifier).matching(H.identifierMatch),number:Se.matching(ue),punct:Se.matching(Ye),comment:Se.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Se.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Se.matching(/<!--/),html_comment_end:Se.matching(/-->/),include:Se.starting_with(/#include/).until_after(H.lineBreak),shebang:Se.starting_with(/#!/).until_after(H.lineBreak),xml:Se.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(/[`}\\]/)}};ie.prototype=new k,ie.prototype._is_comment=function(he){return he.type===j.COMMENT||he.type===j.BLOCK_COMMENT||he.type===j.UNKNOWN},ie.prototype._is_opening=function(he){return he.type===j.START_BLOCK||he.type===j.START_EXPR},ie.prototype._is_closing=function(he,Le){return(he.type===j.END_BLOCK||he.type===j.END_EXPR)&&Le&&(he.text==="]"&&Le.text==="["||he.text===")"&&Le.text==="("||he.text==="}"&&Le.text==="{")},ie.prototype._reset=function(){de=!1},ie.prototype._get_next_token=function(he,Le){var Se=null;this._readWhitespace();var D=this._input.peek();return D===null?this._create_token(j.EOF,""):(Se=Se||this._read_non_javascript(D),Se=Se||this._read_string(D),Se=Se||this._read_pair(D,this._input.peek(1)),Se=Se||this._read_word(he),Se=Se||this._read_singles(D),Se=Se||this._read_comment(D),Se=Se||this._read_regexp(D,he),Se=Se||this._read_xml(D,he),Se=Se||this._read_punctuation(),Se=Se||this._create_token(j.UNKNOWN,this._input.next()),Se)},ie.prototype._read_word=function(he){var Le;if(Le=this.__patterns.identifier.read(),Le!=="")return Le=Le.replace(H.allLineBreaks,`
`),!(he.type===j.DOT||he.type===j.RESERVED&&(he.text==="set"||he.text==="get"))&&gt.test(Le)?(Le==="in"||Le==="of")&&(he.type===j.WORD||he.type===j.STRING)?this._create_token(j.OPERATOR,Le):this._create_token(j.RESERVED,Le):this._create_token(j.WORD,Le);if(Le=this.__patterns.number.read(),Le!=="")return this._create_token(j.WORD,Le)},ie.prototype._read_singles=function(he){var Le=null;return he==="("||he==="["?Le=this._create_token(j.START_EXPR,he):he===")"||he==="]"?Le=this._create_token(j.END_EXPR,he):he==="{"?Le=this._create_token(j.START_BLOCK,he):he==="}"?Le=this._create_token(j.END_BLOCK,he):he===";"?Le=this._create_token(j.SEMICOLON,he):he==="."&&le.test(this._input.peek(1))?Le=this._create_token(j.DOT,he):he===","&&(Le=this._create_token(j.COMMA,he)),Le&&this._input.next(),Le},ie.prototype._read_pair=function(he,Le){var Se=null;return he==="#"&&Le==="{"&&(Se=this._create_token(j.START_BLOCK,he+Le)),Se&&(this._input.next(),this._input.next()),Se},ie.prototype._read_punctuation=function(){var he=this.__patterns.punct.read();if(he!=="")return he==="="?this._create_token(j.EQUALS,he):he==="?."?this._create_token(j.DOT,he):this._create_token(j.OPERATOR,he)},ie.prototype._read_non_javascript=function(he){var Le="";if(he==="#"){if(this._is_first_token()&&(Le=this.__patterns.shebang.read(),Le))return this._create_token(j.UNKNOWN,Le.trim()+`
`);if(Le=this.__patterns.include.read(),Le)return this._create_token(j.UNKNOWN,Le.trim()+`
`);he=this._input.next();var Se="#";if(this._input.hasNext()&&this._input.testChar(ee)){do he=this._input.next(),Se+=he;while(this._input.hasNext()&&he!=="#"&&he!=="=");return he==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Se+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Se+="{}",this._input.next(),this._input.next())),this._create_token(j.WORD,Se)}this._input.back()}else if(he==="<"&&this._is_first_token()){if(Le=this.__patterns.html_comment_start.read(),Le){for(;this._input.hasNext()&&!this._input.testChar(H.newline);)Le+=this._input.next();return de=!0,this._create_token(j.COMMENT,Le)}}else if(de&&he==="-"&&(Le=this.__patterns.html_comment_end.read(),Le))return de=!1,this._create_token(j.COMMENT,Le);return null},ie.prototype._read_comment=function(he){var Le=null;if(he==="/"){var Se="";if(this._input.peek(1)==="*"){Se=this.__patterns.block_comment.read();var D=Y.get_directives(Se);D&&D.ignore==="start"&&(Se+=Y.readIgnored(this._input)),Se=Se.replace(H.allLineBreaks,`
`),Le=this._create_token(j.BLOCK_COMMENT,Se),Le.directives=D}else this._input.peek(1)==="/"&&(Se=this.__patterns.comment.read(),Le=this._create_token(j.COMMENT,Se))}return Le},ie.prototype._read_string=function(he){if(he==="`"||he==="'"||he==='"'){var Le=this._input.next();return this.has_char_escapes=!1,he==="`"?Le+=this._read_string_recursive("`",!0,"${"):Le+=this._read_string_recursive(he),this.has_char_escapes&&this._options.unescape_strings&&(Le=ce(Le)),this._input.peek()===he&&(Le+=this._input.next()),Le=Le.replace(H.allLineBreaks,`
`),this._create_token(j.STRING,Le)}return null},ie.prototype._allow_regexp_or_xml=function(he){return he.type===j.RESERVED&&Z(he.text,["return","case","throw","else","do","typeof","yield"])||he.type===j.END_EXPR&&he.text===")"&&he.opened.previous.type===j.RESERVED&&Z(he.opened.previous.text,["if","while","for"])||Z(he.type,[j.COMMENT,j.START_EXPR,j.START_BLOCK,j.START,j.END_BLOCK,j.OPERATOR,j.EQUALS,j.EOF,j.SEMICOLON,j.COMMA])},ie.prototype._read_regexp=function(he,Le){if(he==="/"&&this._allow_regexp_or_xml(Le)){for(var Se=this._input.next(),D=!1,M=!1;this._input.hasNext()&&(D||M||this._input.peek()!==he)&&!this._input.testChar(H.newline);)Se+=this._input.peek(),D?D=!1:(D=this._input.peek()==="\\",this._input.peek()==="["?M=!0:this._input.peek()==="]"&&(M=!1)),this._input.next();return this._input.peek()===he&&(Se+=this._input.next(),Se+=this._input.read(H.identifier)),this._create_token(j.STRING,Se)}return null},ie.prototype._read_xml=function(he,Le){if(this._options.e4x&&he==="<"&&this._allow_regexp_or_xml(Le)){var Se="",D=this.__patterns.xml.read_match();if(D){for(var M=D[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),ne=M.indexOf("{")===0,be=0;D;){var st=!!D[1],ot=D[2],At=!!D[D.length-1]||ot.slice(0,8)==="![CDATA[";if(!At&&(ot===M||ne&&ot.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(st?--be:++be),Se+=D[0],be<=0)break;D=this.__patterns.xml.read_match()}return D||(Se+=this._input.match(/[\s\S]*/g)[0]),Se=Se.replace(H.allLineBreaks,`
`),this._create_token(j.STRING,Se)}}return null};function ce(he){for(var Le="",Se=0,D=new q(he),M=null;D.hasNext();)if(M=D.match(/([\s]|[^\\]|\\\\)+/g),M&&(Le+=M[0]),D.peek()==="\\"){if(D.next(),D.peek()==="x")M=D.match(/x([0-9A-Fa-f]{2})/g);else if(D.peek()==="u")M=D.match(/u([0-9A-Fa-f]{4})/g),M||(M=D.match(/u\{([0-9A-Fa-f]+)\}/g));else{Le+="\\",D.hasNext()&&(Le+=D.next());continue}if(!M||(Se=parseInt(M[1],16),Se>126&&Se<=255&&M[0].indexOf("x")===0))return he;Se>=0&&Se<32||Se>1114111?Le+="\\"+M[0]:Se===34||Se===39||Se===92?Le+="\\"+String.fromCharCode(Se):Le+=String.fromCharCode(Se)}return Le}ie.prototype._read_string_recursive=function(he,Le,Se){var D,M;he==="'"?M=this.__patterns.single_quote:he==='"'?M=this.__patterns.double_quote:he==="`"?M=this.__patterns.template_text:he==="}"&&(M=this.__patterns.template_expression);for(var ne=M.read(),be="";this._input.hasNext();){if(be=this._input.next(),be===he||!Le&&H.newline.test(be)){this._input.back();break}else be==="\\"&&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(),be+=this._input.next()):Se&&(Se==="${"&&be==="$"&&this._input.peek()==="{"&&(be+=this._input.next()),Se===be&&(he==="`"?be+=this._read_string_recursive("}",Le,"`"):be+=this._read_string_recursive("`",Le,"${"),this._input.hasNext()&&(be+=this._input.next())));be+=M.read(),ne+=be}return ne},N.exports.Tokenizer=ie,N.exports.TOKEN=j,N.exports.positionable_operators=De.slice(),N.exports.line_starters=We.slice()},function(N){var d=RegExp.prototype.hasOwnProperty("sticky");function xe(q){this.__input=q||"",this.__input_length=this.__input.length,this.__position=0}xe.prototype.restart=function(){this.__position=0},xe.prototype.back=function(){this.__position>0&&(this.__position-=1)},xe.prototype.hasNext=function(){return this.__position<this.__input_length},xe.prototype.next=function(){var q=null;return this.hasNext()&&(q=this.__input.charAt(this.__position),this.__position+=1),q},xe.prototype.peek=function(q){var k=null;return q=q||0,q+=this.__position,q>=0&&q<this.__input_length&&(k=this.__input.charAt(q)),k},xe.prototype.__match=function(q,k){q.lastIndex=k;var I=q.exec(this.__input);return I&&!(d&&q.sticky)&&I.index!==k&&(I=null),I},xe.prototype.test=function(q,k){return k=k||0,k+=this.__position,k>=0&&k<this.__input_length?!!this.__match(q,k):!1},xe.prototype.testChar=function(q,k){var I=this.peek(k);return q.lastIndex=0,I!==null&&q.test(I)},xe.prototype.match=function(q){var k=this.__match(q,this.__position);return k?this.__position+=k[0].length:k=null,k},xe.prototype.read=function(q,k,I){var O="",H;return q&&(H=this.match(q),H&&(O+=H[0])),k&&(H||!q)&&(O+=this.readUntil(k,I)),O},xe.prototype.readUntil=function(q,k){var I="",O=this.__position;q.lastIndex=this.__position;var H=q.exec(this.__input);return H?(O=H.index,k&&(O+=H[0].length)):O=this.__input_length,I=this.__input.substring(this.__position,O),this.__position=O,I},xe.prototype.readUntilAfter=function(q){return this.readUntil(q,!0)},xe.prototype.get_regexp=function(q,k){var I=null,O="g";return k&&d&&(O="y"),typeof q=="string"&&q!==""?I=new RegExp(q,O):q&&(I=new RegExp(q.source,O)),I},xe.prototype.get_literal_regexp=function(q){return RegExp(q.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},xe.prototype.peekUntilAfter=function(q){var k=this.__position,I=this.readUntilAfter(q);return this.__position=k,I},xe.prototype.lookBack=function(q){var k=this.__position-1;return k>=q.length&&this.__input.substring(k-q.length,k).toLowerCase()===q},N.exports.InputScanner=xe},function(N,d,xe){var q=xe(8).InputScanner,k=xe(3).Token,I=xe(10).TokenStream,O=xe(11).WhitespacePattern,H={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},se=function(ae,Z){this._input=new q(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 I,this._reset();for(var ae,Z=new k(H.START,""),j=null,Y=[],ue=new I;Z.type!==H.EOF;){for(ae=this._get_next_token(Z,j);this._is_comment(ae);)ue.add(ae),ae=this._get_next_token(Z,j);ue.isEmpty()||(ae.comments_before=ue,ue=new I),ae.parent=j,this._is_opening(ae)?(Y.push(j),j=ae):j&&this._is_closing(ae,j)&&(ae.opened=j,j.closed=ae,j=Y.pop(),ae.parent=j),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 j=this._input.read(/.+/g);return j?this._create_token(H.RAW,j):this._create_token(H.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 j=new k(ae,Z,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return j},se.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},N.exports.Tokenizer=se,N.exports.TOKEN=H},function(N){function d(xe){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=xe}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 xe=null;return this.hasNext()&&(xe=this.__tokens[this.__position],this.__position+=1),xe},d.prototype.peek=function(xe){var q=null;return xe=xe||0,xe+=this.__position,xe>=0&&xe<this.__tokens_length&&(q=this.__tokens[xe]),q},d.prototype.add=function(xe){this.__parent_token&&(xe.parent=this.__parent_token),this.__tokens.push(xe),this.__tokens_length+=1},N.exports.TokenStream=d},function(N,d,xe){var q=xe(12).Pattern;function k(I,O){q.call(this,I,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 q,k.prototype.__set_whitespace_patterns=function(I,O){I+="\\t ",O+="\\n\\r",this._match_pattern=this._input.get_regexp("["+I+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 I=this._input.read(this._match_pattern);if(I===" ")this.whitespace_before_token=" ";else if(I){var O=this.__split(this._newline_regexp,I);this.newline_count=O.length-1,this.whitespace_before_token=O[this.newline_count]}return I},k.prototype.matching=function(I,O){var H=this._create();return H.__set_whitespace_patterns(I,O),H._update(),H},k.prototype._create=function(){return new k(this._input,this)},k.prototype.__split=function(I,O){I.lastIndex=0;for(var H=0,se=[],ae=I.exec(O);ae;)se.push(O.substring(H,ae.index)),H=ae.index+ae[0].length,ae=I.exec(O);return H<O.length?se.push(O.substring(H,O.length)):se.push(""),se},N.exports.WhitespacePattern=k},function(N){function d(xe,q){this._input=xe,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,q&&(this._starting_pattern=this._input.get_regexp(q._starting_pattern,!0),this._match_pattern=this._input.get_regexp(q._match_pattern,!0),this._until_pattern=this._input.get_regexp(q._until_pattern),this._until_after=q._until_after)}d.prototype.read=function(){var xe=this._input.read(this._starting_pattern);return(!this._starting_pattern||xe)&&(xe+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),xe},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(xe){var q=this._create();return q._until_after=!0,q._until_pattern=this._input.get_regexp(xe),q._update(),q},d.prototype.until=function(xe){var q=this._create();return q._until_after=!1,q._until_pattern=this._input.get_regexp(xe),q._update(),q},d.prototype.starting_with=function(xe){var q=this._create();return q._starting_pattern=this._input.get_regexp(xe,!0),q._update(),q},d.prototype.matching=function(xe){var q=this._create();return q._match_pattern=this._input.get_regexp(xe,!0),q._update(),q},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},N.exports.Pattern=d},function(N){function d(xe,q){xe=typeof xe=="string"?xe:xe.source,q=typeof q=="string"?q:q.source,this.__directives_block_pattern=new RegExp(xe+/ beautify( \w+[:]\w+)+ /.source+q,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(xe+/\sbeautify\signore:end\s/.source+q,"g")}d.prototype.get_directives=function(xe){if(!xe.match(this.__directives_block_pattern))return null;var q={};this.__directive_pattern.lastIndex=0;for(var k=this.__directive_pattern.exec(xe);k;)q[k[1]]=k[2],k=this.__directive_pattern.exec(xe);return q},d.prototype.readIgnored=function(xe){return xe.readUntilAfter(this.__directives_end_ignore_pattern)},N.exports.Directives=d},function(N,d,xe){var q=xe(12).Pattern,k={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function I(O,H){q.call(this,O,H),this.__template_pattern=null,this._disabled=Object.assign({},k),this._excluded=Object.assign({},k),H&&(this.__template_pattern=this._input.get_regexp(H.__template_pattern),this._excluded=Object.assign(this._excluded,H._excluded),this._disabled=Object.assign(this._disabled,H._disabled));var se=new q(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}/)}}I.prototype=new q,I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){this.__set_templated_pattern()},I.prototype.disable=function(O){var H=this._create();return H._disabled[O]=!0,H._update(),H},I.prototype.read_options=function(O){var H=this._create();for(var se in k)H._disabled[se]=O.templating.indexOf(se)===-1;return H._update(),H},I.prototype.exclude=function(O){var H=this._create();return H._excluded[O]=!0,H._update(),H},I.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 H=this._read_template();H;)this._match_pattern?H+=this._input.read(this._match_pattern):H+=this._input.readUntil(this.__template_pattern),O+=H,H=this._read_template();return this._until_after&&(O+=this._input.readUntilAfter(this._until_pattern)),O},I.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("|")+")")},I.prototype._read_template=function(){var O="",H=this._input.peek();if(H==="<"){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 H==="{"&&(!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},N.exports.TemplatablePattern=I}],re={};function E(N){var d=re[N];if(d!==void 0)return d.exports;var xe=re[N]={exports:{}};return Me[N](xe,xe.exports,E),xe.exports}var Re=E(0);Pe=Re})();var rt=Pe;X=[],pe=function(){return{js_beautify:rt}}.apply(It,X),pe!==void 0&&($r.exports=pe)})()},15342:function($r){(function(X,pe){$r.exports=pe()})(typeof self!="undefined"?self:this,function(){return function(It){var X={};function pe(Pe){if(X[Pe])return X[Pe].exports;var rt=X[Pe]={i:Pe,l:!1,exports:{}};return It[Pe].call(rt.exports,rt,rt.exports,pe),rt.l=!0,rt.exports}return pe.m=It,pe.c=X,pe.d=function(Pe,rt,Me){pe.o(Pe,rt)||Object.defineProperty(Pe,rt,{enumerable:!0,get:Me})},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 Me=Object.create(null);if(pe.r(Me),Object.defineProperty(Me,"default",{enumerable:!0,value:Pe}),rt&2&&typeof Pe!="string")for(var re in Pe)pe.d(Me,re,function(E){return Pe[E]}.bind(null,re));return Me},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(It,X,pe){},function(It,X,pe){"use strict";pe.r(X);var Pe=pe(0),rt=function(){function K(m,b,_){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=m,this.start=b,this.end=_}return K.range=function(b,_){return _?!b||!b.loc||!_.loc||b.loc.lexer!==_.loc.lexer?null:new K(b.loc.lexer,b.loc.start,_.loc.end):b&&b.loc},K}(),Me=function(){function K(b,_){this.text=void 0,this.loc=void 0,this.text=b,this.loc=_}var m=K.prototype;return m.range=function(_,w){return new K(w,rt.range(this,_))},K}(),re=function K(m,b){this.position=void 0;var _="KaTeX parse error: "+m,w,P=b&&b.loc;if(P&&P.start<=P.end){var U=P.lexer.input;w=P.start;var oe=P.end;w===U.length?_+=" at end of input: ":_+=" at position "+(w+1)+": ";var we=U.slice(w,oe).replace(/[^]/g,"$&\u0332"),Be;w>15?Be="\u2026"+U.slice(w-15,w):Be=U.slice(0,w);var at;oe+15<U.length?at=U.slice(oe,oe+15)+"\u2026":at=U.slice(oe),_+=Be+we+at}var yt=new Error(_);return yt.name="ParseError",yt.__proto__=K.prototype,yt.position=w,yt};re.prototype.__proto__=Error.prototype;var E=re,Re=function(m,b){return m.indexOf(b)!==-1},N=function(m,b){return m===void 0?b:m},d=/([A-Z])/g,xe=function(m){return m.replace(d,"-$1").toLowerCase()},q={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},k=/[&><"']/g;function I(K){return String(K).replace(k,function(m){return q[m]})}var O=function K(m){return m.type==="ordgroup"||m.type==="color"?m.body.length===1?K(m.body[0]):m:m.type==="font"?K(m.body):m},H=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:Re,deflt:N,escape:I,hyphenate:xe,getBaseElem:O,isCharacterBox:H,protocolFromUrl:ae},j=function(){function K(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=K.prototype;return m.reportNonstrict=function(_,w,P){var U=this.strict;if(typeof U=="function"&&(U=U(_,w,P)),!(!U||U==="ignore")){if(U===!0||U==="error")throw new E("LaTeX-incompatible input and strict mode is set to 'error': "+(w+" ["+_+"]"),P);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,P){var U=this.strict;if(typeof U=="function")try{U=U(_,w,P)}catch(oe){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},K}(),Y=function(){function K(b,_,w){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=b,this.size=_,this.cramped=w}var m=K.prototype;return m.sup=function(){return gt[de[this.id]]},m.sub=function(){return gt[ie[this.id]]},m.fracNum=function(){return gt[ce[this.id]]},m.fracDen=function(){return gt[he[this.id]]},m.cramp=function(){return gt[Le[this.id]]},m.text=function(){return gt[Se[this.id]]},m.isTight=function(){return this.size>=2},K}(),ue=0,ee=1,le=2,De=3,ve=4,Ye=5,We=6,ut=7,gt=[new Y(ue,0,!1),new Y(ee,0,!0),new Y(le,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],ie=[Ye,Ye,Ye,Ye,ut,ut,ut,ut],ce=[le,De,ve,Ye,We,ut,We,ut],he=[De,De,Ye,Ye,ut,ut,ut,ut],Le=[ee,ee,De,De,Ye,Ye,ut,ut],Se=[ue,ee,le,De,le,De,le,De],D={DISPLAY:gt[ue],TEXT:gt[le],SCRIPT:gt[ve],SCRIPTSCRIPT:gt[We]},M=[{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 ne(K){for(var m=0;m<M.length;m++)for(var b=M[m],_=0;_<b.blocks.length;_++){var w=b.blocks[_];if(K>=w[0]&&K<=w[1])return b.name}return null}var be=[];M.forEach(function(K){return K.blocks.forEach(function(m){return be.push.apply(be,m)})});function st(K){for(var m=0;m<be.length;m+=2)if(K>=be[m]&&K<=be[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"},sr=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"},Pt=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"},Cr=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"},zr=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=sr(b,ot);break;case"sqrtSize3":w=jt(b,ot);break;case"sqrtSize4":w=Pt(b,ot);break;case"sqrtTall":w=Cr(b,ot,_)}return w},rr={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`},Ur=function(){function K(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=K.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(P){return P.toText()};return this.children.map(_).join("")},K}(),li=function(m){return m.filter(function(b){return b}).join(" ")},Vr=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 P=0;P<this.children.length;P++)b.appendChild(this.children[P].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 P in this.attributes)this.attributes.hasOwnProperty(P)&&(b+=" "+P+'="'+Z.escape(this.attributes[P])+'"');b+=">";for(var U=0;U<this.children.length;U++)b+=this.children[U].toMarkup();return b+="</"+m+">",b},Qe=function(){function K(b,_,w,P){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,Vr.call(this,b,w,P),this.children=_||[]}var m=K.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")},K}(),Ct=function(){function K(b,_,w,P){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,Vr.call(this,_,P),this.children=w||[],this.setAttribute("href",b)}var m=K.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")},K}(),Dt=function(){function K(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=K.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 P in this.style)this.style.hasOwnProperty(P)&&(w+=Z.hyphenate(P)+":"+this.style[P]+";");return w&&(_+=' style="'+Z.escape(w)+'"'),_+="'/>",_},K}(),ye={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},Oe=function(){function K(b,_,w,P,U,oe,we,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=P||0,this.skew=U||0,this.width=oe||0,this.classes=we||[],this.style=Be||{},this.maxFontSize=0;var at=ne(this.text.charCodeAt(0));at&&this.classes.push(at+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ye[this.text])}var m=K.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 P in this.style)this.style.hasOwnProperty(P)&&(w=w||document.createElement("span"),w.style[P]=this.style[P]);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 P="";this.italic>0&&(P+="margin-right:"+this.italic+"em;");for(var U in this.style)this.style.hasOwnProperty(U)&&(P+=Z.hyphenate(U)+":"+this.style[U]+";");P&&(_=!0,w+=' style="'+Z.escape(P)+'"');var oe=Z.escape(this.text);return _?(w+=">",w+=oe,w+="</span>",w):oe},K}(),et=function(){function K(b,_){this.children=void 0,this.attributes=void 0,this.children=b||[],this.attributes=_||{}}var m=K.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",w=document.createElementNS(_,"svg");for(var P in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,P)&&w.setAttribute(P,this.attributes[P]);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 P=0;P<this.children.length;P++)_+=this.children[P].toMarkup();return _+="</svg>",_},K}(),vt=function(){function K(b,_){this.pathName=void 0,this.alternate=void 0,this.pathName=b,this.alternate=_}var m=K.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",rr[this.pathName]),w},m.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+rr[this.pathName]+"'/>"},K}(),wt=function(){function K(b){this.attributes=void 0,this.attributes=b||{}}var m=K.prototype;return m.toNode=function(){var _="http://www.w3.org/2000/svg",w=document.createElementNS(_,"line");for(var P in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,P)&&w.setAttribute(P,this.attributes[P]);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 _+="/>",_},K}();function Gt(K){if(K instanceof Oe)return K;throw new Error("Expected symbolNode but got "+String(K)+".")}function dr(K){if(K instanceof Qe)return K;throw new Error("Expected span<HtmlDomNode> but got "+String(K)+".")}var Jt={"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]},Kt={\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 wr(K,m){Jt[K]=m}function Fe(K,m,b){if(!Jt[m])throw new Error("Font metrics not found for font: "+m+".");var _=K.charCodeAt(0),w=Jt[m][_];if(!w&&K[0]in Kt&&(_=Kt[K[0]].charCodeAt(0),w=Jt[m][_]),!w&&b==="text"&&st(_)&&(w=Jt[m][77]),w)return{depth:w[0],height:w[1],italic:w[2],skew:w[3],width:w[4]}}var Ge={};function it(K){var m;if(K>=5?m=0:K>=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 Rt={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:{}},tr=zt;function T(K,m,b,_,w,P){zt[K][w]={font:m,group:b,replace:_},P&&_&&(zt[K][_]=zt[K][w])}var B="math",ft="text",G="main",fe="ams",Sr="accent-token",Ne="bin",He="close",Je="inner",W="mathord",ge="op-token",Ee="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(ft,G,Ae,"#","\\#"),T(B,G,Ae,"&","\\&"),T(ft,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(ft,G,Ae,"\xA7","\\S",!0),T(ft,G,Ae,"\xB6","\\P",!0),T(B,G,Ae,"\u2020","\\dag"),T(ft,G,Ae,"\u2020","\\dag"),T(ft,G,Ae,"\u2020","\\textdagger"),T(B,G,Ae,"\u2021","\\ddag"),T(ft,G,Ae,"\u2021","\\ddag"),T(ft,G,Ae,"\u2021","\\textdaggerdbl"),T(B,G,He,"\u23B1","\\rmoustache",!0),T(B,G,Ee,"\u23B0","\\lmoustache",!0),T(B,G,He,"\u27EF","\\rgroup",!0),T(B,G,Ee,"\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(ft,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(ft,fe,Ae,"\xA5","\\yen",!0),T(B,fe,Ae,"\u2713","\\checkmark",!0),T(ft,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,Ee,"\u250C","\\ulcorner",!0),T(B,fe,He,"\u2510","\\urcorner",!0),T(B,fe,Ee,"\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(ft,G,Ae,"$","\\$"),T(ft,G,Ae,"$","\\textdollar"),T(B,G,Ae,"%","\\%"),T(ft,G,Ae,"%","\\%"),T(B,G,Ae,"_","\\_"),T(ft,G,Ae,"_","\\_"),T(ft,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,Ee,"(","("),T(B,G,Ee,"[","["),T(B,G,Ee,"\u27E8","\\langle",!0),T(B,G,Ee,"\u2223","\\lvert"),T(B,G,Ee,"\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(ft,G,qt,"\xA0","\\ "),T(ft,G,qt,"\xA0","~"),T(ft,G,qt,"\xA0","\\space"),T(ft,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,Ee,"{","\\{"),T(ft,G,Ae,"{","\\{"),T(ft,G,Ae,"{","\\textbraceleft"),T(B,G,He,"}","\\}"),T(ft,G,Ae,"}","\\}"),T(ft,G,Ae,"}","\\textbraceright"),T(B,G,Ee,"{","\\lbrace"),T(B,G,He,"}","\\rbrace"),T(B,G,Ee,"[","\\lbrack"),T(ft,G,Ae,"[","\\lbrack"),T(B,G,He,"]","\\rbrack"),T(ft,G,Ae,"]","\\rbrack"),T(B,G,Ee,"(","\\lparen"),T(B,G,He,")","\\rparen"),T(ft,G,Ae,"<","\\textless"),T(ft,G,Ae,">","\\textgreater"),T(B,G,Ee,"\u230A","\\lfloor",!0),T(B,G,He,"\u230B","\\rfloor",!0),T(B,G,Ee,"\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(ft,G,Ae,"|","\\textbar"),T(B,G,Ae,"\u2225","\\|"),T(B,G,Ae,"\u2225","\\Vert"),T(ft,G,Ae,"\u2225","\\textbardbl"),T(ft,G,Ae,"~","\\textasciitilde"),T(ft,G,Ae,"\\","\\textbackslash"),T(ft,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(ft,G,Je,"\u2026","\\textellipsis"),T(B,G,Je,"\u2026","\\mathellipsis"),T(ft,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,Sr,"\u02CA","\\acute"),T(B,G,Sr,"\u02CB","\\grave"),T(B,G,Sr,"\xA8","\\ddot"),T(B,G,Sr,"~","\\tilde"),T(B,G,Sr,"\u02C9","\\bar"),T(B,G,Sr,"\u02D8","\\breve"),T(B,G,Sr,"\u02C7","\\check"),T(B,G,Sr,"^","\\hat"),T(B,G,Sr,"\u20D7","\\vec"),T(B,G,Sr,"\u02D9","\\dot"),T(B,G,Sr,"\u02DA","\\mathring"),T(B,G,W,"\u0131","\\imath",!0),T(B,G,W,"\u0237","\\jmath",!0),T(ft,G,Ae,"\u0131","\\i",!0),T(ft,G,Ae,"\u0237","\\j",!0),T(ft,G,Ae,"\xDF","\\ss",!0),T(ft,G,Ae,"\xE6","\\ae",!0),T(ft,G,Ae,"\xE6","\\ae",!0),T(ft,G,Ae,"\u0153","\\oe",!0),T(ft,G,Ae,"\xF8","\\o",!0),T(ft,G,Ae,"\xC6","\\AE",!0),T(ft,G,Ae,"\u0152","\\OE",!0),T(ft,G,Ae,"\xD8","\\O",!0),T(ft,G,Sr,"\u02CA","\\'"),T(ft,G,Sr,"\u02CB","\\`"),T(ft,G,Sr,"\u02C6","\\^"),T(ft,G,Sr,"\u02DC","\\~"),T(ft,G,Sr,"\u02C9","\\="),T(ft,G,Sr,"\u02D8","\\u"),T(ft,G,Sr,"\u02D9","\\."),T(ft,G,Sr,"\u02DA","\\r"),T(ft,G,Sr,"\u02C7","\\v"),T(ft,G,Sr,"\xA8",'\\"'),T(ft,G,Sr,"\u02DD","\\H"),T(ft,G,Sr,"\u25EF","\\textcircled");var Xt={"--":!0,"---":!0,"``":!0,"''":!0};T(ft,G,Ae,"\u2013","--"),T(ft,G,Ae,"\u2013","\\textendash"),T(ft,G,Ae,"\u2014","---"),T(ft,G,Ae,"\u2014","\\textemdash"),T(ft,G,Ae,"\u2018","`"),T(ft,G,Ae,"\u2018","\\textquoteleft"),T(ft,G,Ae,"\u2019","'"),T(ft,G,Ae,"\u2019","\\textquoteright"),T(ft,G,Ae,"\u201C","``"),T(ft,G,Ae,"\u201C","\\textquotedblleft"),T(ft,G,Ae,"\u201D","''"),T(ft,G,Ae,"\u201D","\\textquotedblright"),T(B,G,Ae,"\xB0","\\degree",!0),T(ft,G,Ae,"\xB0","\\degree"),T(ft,G,Ae,"\xB0","\\textdegree",!0),T(B,G,W,"\xA3","\\pounds"),T(B,G,W,"\xA3","\\mathsterling",!0),T(ft,G,W,"\xA3","\\pounds"),T(ft,G,W,"\xA3","\\textsterling",!0),T(B,fe,Ae,"\u2720","\\maltese"),T(ft,fe,Ae,"\u2720","\\maltese"),T(ft,G,qt,"\xA0","\\ "),T(ft,G,qt,"\xA0"," "),T(ft,G,qt,"\xA0","~");for(var yr='0123456789/@."',ei=0;ei<yr.length;ei++){var Li=yr.charAt(ei);T(B,G,Ae,Li,Li)}for(var ui='0123456789!@*()-=+[]<>|";:?/.,',Er=0;Er<ui.length;Er++){var yi=ui.charAt(Er);T(ft,G,Ae,yi,yi)}for(var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ce=0;Ce<me.length;Ce++){var Mt=me.charAt(Ce);T(B,G,W,Mt,Mt),T(ft,G,Ae,Mt,Mt)}T(B,fe,Ae,"C","\u2102"),T(ft,fe,Ae,"C","\u2102"),T(B,fe,Ae,"H","\u210D"),T(ft,fe,Ae,"H","\u210D"),T(B,fe,Ae,"N","\u2115"),T(ft,fe,Ae,"N","\u2115"),T(B,fe,Ae,"P","\u2119"),T(ft,fe,Ae,"P","\u2119"),T(B,fe,Ae,"Q","\u211A"),T(ft,fe,Ae,"Q","\u211A"),T(B,fe,Ae,"R","\u211D"),T(ft,fe,Ae,"R","\u211D"),T(B,fe,Ae,"Z","\u2124"),T(ft,fe,Ae,"Z","\u2124"),T(B,G,W,"h","\u210E"),T(ft,G,W,"h","\u210E");for(var ct="",Et=0;Et<me.length;Et++){var Nt=me.charAt(Et);ct=String.fromCharCode(55349,56320+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56372+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56424+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56580+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56736+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56788+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56840+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56944+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),Et<26&&(ct=String.fromCharCode(55349,56632+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct),ct=String.fromCharCode(55349,56476+Et),T(B,G,W,Nt,ct),T(ft,G,Ae,Nt,ct))}ct="\u{1D55C}",T(B,G,W,"k",ct),T(ft,G,Ae,"k",ct);for(var ar=0;ar<10;ar++){var Qt=ar.toString();ct=String.fromCharCode(55349,57294+ar),T(B,G,W,Qt,ct),T(ft,G,Ae,Qt,ct),ct=String.fromCharCode(55349,57314+ar),T(B,G,W,Qt,ct),T(ft,G,Ae,Qt,ct),ct=String.fromCharCode(55349,57324+ar),T(B,G,W,Qt,ct),T(ft,G,Ae,Qt,ct),ct=String.fromCharCode(55349,57334+ar),T(B,G,W,Qt,ct),T(ft,G,Ae,Qt,ct)}for(var Pr="\xC7\xD0\xDE\xE7\xFE",Ar=0;Ar<Pr.length;Ar++){var oi=Pr.charAt(Ar);T(B,G,W,oi,oi),T(ft,G,Ae,oi,oi)}T(ft,G,Ae,"\xF0","\xF0"),T(ft,G,Ae,"\u2013","\u2013"),T(ft,G,Ae,"\u2014","\u2014"),T(ft,G,Ae,"\u2018","\u2018"),T(ft,G,Ae,"\u2019","\u2019"),T(ft,G,Ae,"\u201C","\u201C"),T(ft,G,Ae,"\u201D","\u201D");var Lr=[["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"]],Fr=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],ii=function(m,b){var _=m.charCodeAt(0),w=m.charCodeAt(1),P=(_-55296)*1024+(w-56320)+65536,U=b==="math"?0:1;if(119808<=P&&P<120484){var oe=Math.floor((P-119808)/26);return[Lr[oe][2],Lr[oe][U]]}else if(120782<=P&&P<=120831){var we=Math.floor((P-120782)/10);return[Fr[we][2],Fr[we][U]]}else{if(P===120485||P===120486)return[Lr[0][2],Lr[0][U]];if(120486<P&&P<120782)return["",""];throw new E("Unsupported character: "+m)}},bi=[[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]],Fi=[.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:bi[m-1][b.size-1]},Kr=function(){function K(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||K.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=Fi[this.size-1],this.maxSize=b.maxSize,this.minRuleThickness=b.minRuleThickness,this._fontMetrics=void 0}var m=K.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 P in _)_.hasOwnProperty(P)&&(w[P]=_[P]);return new K(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:Fi[_-1]})},m.havingBaseStyle=function(_){_=_||this.style.text();var w=mi(K.BASESIZE,_);return this.size===w&&this.textSize===K.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!==K.BASESIZE?["sizing","reset-size"+this.size,"size"+K.BASESIZE]:[]},m.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=it(this.size)),this._fontMetrics},m.getColor=function(){return this.phantom?"transparent":this.color},K}();Kr.BASESIZE=6;var Hi=Kr,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},Br={ex:!0,em:!0,mu:!0},lt=function(m){return typeof m!="string"&&(m=m.unit),m in Yr||m in Br||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 tr[_][m]&&tr[_][m].replace&&(m=tr[_][m].replace),{value:m,metrics:Fe(m,b,_)}},pt=function(m,b,_,w,P){var U=Lt(m,b,_),oe=U.metrics;m=U.value;var we;if(oe){var Be=oe.italic;(_==="text"||w&&w.font==="mathit")&&(Be=0),we=new Oe(m,oe.height,oe.depth,Be,oe.skew,oe.width,P)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+m+"' in style '"+b+"' and mode '"+_+"'")),we=new Oe(m,0,0,0,0,0,P);if(w){we.maxFontSize=w.sizeMultiplier,w.style.isTight()&&we.classes.push("mtight");var at=w.getColor();at&&(we.style.color=at)}return we},Ht=function(m,b,_,w){return w===void 0&&(w=[]),_.font==="boldsymbol"&&Lt(m,"Main-Bold",b).metrics?pt(m,"Main-Bold",b,_,w.concat(["mathbf"])):m==="\\"||tr[b][m].font==="main"?pt(m,"Main-Regular",b,_,w):pt(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"}},Dr=function(m,b,_,w){return Lt(m,"Math-BoldItalic",b).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},mr=function(m,b,_){var w=m.mode,P=m.text,U=["mord"],oe=w==="math"||w==="text"&&b.font,we=oe?b.font:b.fontFamily;if(P.charCodeAt(0)===55349){var Be=ii(P,w),at=Be[0],yt=Be[1];return pt(P,at,w,b,U.concat(yt))}else if(we){var Ot,Yt;if(we==="boldsymbol"||we==="mathnormal"){var cr=we==="boldsymbol"?Dr(P,w,b,U):lr(P,w,b,U);Ot=cr.fontName,Yt=[cr.fontClass]}else Z.contains(_t,P)?(Ot="Main-Italic",Yt=["mathit"]):oe?(Ot=Ii[we].fontName,Yt=[we]):(Ot=fi(we,b.fontWeight,b.fontShape),Yt=[we,b.fontWeight,b.fontShape]);if(Lt(P,Ot,w).metrics)return pt(P,Ot,w,b,U.concat(Yt));if(Xt.hasOwnProperty(P)&&Ot.substr(0,10)==="Typewriter"){for(var xr=[],qe=0;qe<P.length;qe++)xr.push(pt(P[qe],Ot,w,b,U.concat(Yt)));return Xr(xr)}}if(_==="mathord"){var Ti=Bt(P,w,b,U);return pt(P,Ti.fontName,w,b,U.concat([Ti.fontClass]))}else if(_==="textord"){var Mi=tr[w][P]&&tr[w][P].font;if(Mi==="ams"){var Bi=fi("amsrm",b.fontWeight,b.fontShape);return pt(P,Bi,w,b,U.concat("amsrm",b.fontWeight,b.fontShape))}else if(Mi==="main"||!Mi){var an=fi("textrm",b.fontWeight,b.fontShape);return pt(P,an,w,b,U.concat(b.fontWeight,b.fontShape))}else{var fn=fi(Mi,b.fontWeight,b.fontShape);return pt(P,fn,w,b,U.concat(fn,b.fontWeight,b.fontShape))}}else throw new Error("unexpected type: "+_+" in makeOrd")},ni=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&&ni(_,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,P=0;P<m.children.length;P++){var U=m.children[P];U.height>b&&(b=U.height),U.depth>_&&(_=U.depth),U.maxFontSize>w&&(w=U.maxFontSize)}m.height=b,m.depth=_,m.maxFontSize=w},kr=function(m,b,_,w){var P=new Qe(m,b,_,w);return gi(P),P},Rr=function(m,b,_,w){return new Qe(m,b,_,w)},Si=function(m,b,_){var w=kr([m],[],b);return w.height=Math.max(_||b.fontMetrics().defaultRuleThickness,b.minRuleThickness),w.style.borderBottomWidth=w.height+"em",w.maxFontSize=1,w},Ei=function(m,b,_,w){var P=new Ct(m,b,_,w);return gi(P),P},Xr=function(m){var b=new Ur(m);return gi(b),b},ti=function(m,b){return m instanceof Ur?kr([],[m],b):m},ri=function(m){if(m.positionType==="individualShift"){for(var b=m.children,_=[b[0]],w=-b[0].shift-b[0].elem.depth,P=w,U=1;U<b.length;U++){var oe=-b[U].shift-P-b[U].elem.depth,we=oe-(b[U-1].elem.height+b[U-1].elem.depth);P=P+oe,_.push({type:"kern",size:we}),_.push(b[U])}return{children:_,depth:w}}var Be;if(m.positionType==="top"){for(var at=m.positionData,yt=0;yt<m.children.length;yt++){var Ot=m.children[yt];at-=Ot.type==="kern"?Ot.size:Ot.elem.height+Ot.elem.depth}Be=at}else if(m.positionType==="bottom")Be=-m.positionData;else{var Yt=m.children[0];if(Yt.type!=="elem")throw new Error('First child must have type "elem".');if(m.positionType==="shift")Be=-Yt.elem.depth-m.positionData;else if(m.positionType==="firstBaseline")Be=-Yt.elem.depth;else throw new Error("Invalid positionType "+m.positionType+".")}return{children:m.children,depth:Be}},si=function(m,b){for(var _=ri(m),w=_.children,P=_.depth,U=0,oe=0;oe<w.length;oe++){var we=w[oe];if(we.type==="elem"){var Be=we.elem;U=Math.max(U,Be.maxFontSize,Be.height)}}U+=2;var at=kr(["pstrut"],[]);at.style.height=U+"em";for(var yt=[],Ot=P,Yt=P,cr=P,xr=0;xr<w.length;xr++){var qe=w[xr];if(qe.type==="kern")cr+=qe.size;else{var Ti=qe.elem,Mi=qe.wrapperClasses||[],Bi=qe.wrapperStyle||{},an=kr(Mi,[at,Ti],void 0,Bi);an.style.top=-U-cr-Ti.depth+"em",qe.marginLeft&&(an.style.marginLeft=qe.marginLeft),qe.marginRight&&(an.style.marginRight=qe.marginRight),yt.push(an),cr+=Ti.height+Ti.depth}Ot=Math.min(Ot,cr),Yt=Math.max(Yt,cr)}var fn=kr(["vlist"],yt);fn.style.height=Yt+"em";var Cn;if(Ot<0){var Dn=kr([],[]),Zn=kr(["vlist"],[Dn]);Zn.style.height=-Ot+"em";var ms=kr(["vlist-s"],[new Oe("\u200B")]);Cn=[kr(["vlist-r"],[fn,ms]),kr(["vlist-r"],[Zn])]}else Cn=[kr(["vlist-r"],[fn])];var Fn=kr(["vlist-t"],Cn);return Cn.length===2&&Fn.classes.push("vlist-t2"),Fn.height=Yt,Fn.depth=-Ot,Fn},Hr=function(m,b){var _=kr(["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 P;return b==="textbf"&&_==="textit"?P="BoldItalic":b==="textbf"?P="Bold":b==="textit"?P="Italic":P="Regular",w+"-"+P},Ii={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"}},Ci={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Tr=function(m,b){var _=Ci[m],w=_[0],P=_[1],U=_[2],oe=new vt(w),we=new et([oe],{width:P+"em",height:U+"em",style:"width:"+P+"em",viewBox:"0 0 "+1e3*P+" "+1e3*U,preserveAspectRatio:"xMinYMin"}),Be=Rr(["overlay"],[we],b);return Be.height=U,Be.style.height=U+"em",Be.style.width=P+"em",Be},je={fontMap:Ii,makeSymbol:pt,mathsym:Ht,makeSpan:kr,makeSvgSpan:Rr,makeLineSpan:Si,makeAnchor:Ei,makeFragment:Xr,wrapFragment:ti,makeVList:si,makeOrd:mr,makeGlue:Hr,staticSvg:Tr,svgData:Ci,tryCombineChars:ci};function ur(K,m){var b=br(K,m);if(!b)throw new Error("Expected node of type "+m+", but got "+(K?"node of type "+K.type:String(K)));return b}function br(K,m){return K&&K.type===m?K:null}function qr(K,m){var b=on(K,m);if(!b)throw new Error('Expected node of type "atom" and family "'+m+'", but got '+(K?K.type==="atom"?"atom of family "+K.family:"node of type "+K.type:String(K)));return b}function on(K,m){return K&&K.type==="atom"&&K.family===m?K:null}function vi(K){var m=Ni(K);if(!m)throw new Error("Expected node of symbol group type, but got "+(K?"node of type "+K.type:String(K)));return m}function Ni(K){return K&&(K.type==="atom"||kt.hasOwnProperty(K.type))?K:null}var Gr={number:3,unit:"mu"},gn={number:4,unit:"mu"},wn={number:5,unit:"mu"},Gi={mord:{mop:Gr,mbin:gn,mrel:wn,minner:Gr},mop:{mord:Gr,mop:Gr,mrel:wn,minner:Gr},mbin:{mord:gn,mop:gn,mopen:gn,minner:gn},mrel:{mord:wn,mop:wn,mopen:wn,minner:wn},mopen:{},mclose:{mop:Gr,mbin:gn,mrel:wn,minner:Gr},mpunct:{mord:Gr,mop:Gr,mrel:wn,mopen:Gr,mclose:Gr,mpunct:Gr,minner:Gr},minner:{mord:Gr,mop:Gr,mbin:gn,mrel:wn,mopen:Gr,mpunct:Gr,minner:Gr}},ts={mord:{mop:Gr},mop:{mord:Gr,mop:Gr},mbin:{},mrel:{},mopen:{},mclose:{mop:Gr},mpunct:{},minner:{mop:Gr}},Xn={},zn={},Vn={};function Or(K){for(var m=K.type,b=K.names,_=K.props,w=K.handler,P=K.htmlBuilder,U=K.mathmlBuilder,oe={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},we=0;we<b.length;++we)Xn[b[we]]=oe;m&&(P&&(zn[m]=P),U&&(Vn[m]=U))}function Ai(K){var m=K.type,b=K.htmlBuilder,_=K.mathmlBuilder;Or({type:m,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:b,mathmlBuilder:_})}var Ui=function(m){var b=br(m,"ordgroup");return b?b.body:[m]},Vi=je.makeSpan,Wn=["leftmost","mbin","mopen","mrel","mop","mpunct"],bn=["rightmost","mrel","mclose","mpunct"],nn={display:D.DISPLAY,text:D.TEXT,script:D.SCRIPT,scriptscript:D.SCRIPTSCRIPT},On={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},$i=function(m,b,_,w){w===void 0&&(w=[null,null]);for(var P=[],U=0;U<m.length;U++){var oe=Ri(m[U],b);if(oe instanceof Ur){var we=oe.children;P.push.apply(P,we)}else P.push(oe)}if(!_)return P;var Be=b;if(m.length===1){var at=br(m[0],"sizing")||br(m[0],"styling");at&&(at.type==="sizing"?Be=b.havingSize(at.size):at.type==="styling"&&(Be=b.havingStyle(nn[at.style])))}var yt=Vi([w[0]||"leftmost"],[],b),Ot=Vi([w[1]||"rightmost"],[],b);return rs(P,function(Yt,cr){var xr=cr.classes[0],qe=Yt.classes[0];xr==="mbin"&&Z.contains(bn,qe)?cr.classes[0]="mord":qe==="mbin"&&Z.contains(Wn,xr)&&(Yt.classes[0]="mord")},{node:yt},Ot),rs(P,function(Yt,cr){var xr=Jn(cr),qe=Jn(Yt),Ti=xr&&qe?Yt.hasClass("mtight")?ts[xr][qe]:Gi[xr][qe]:null;if(Ti)return je.makeGlue(Ti,Be)},{node:yt},Ot),P},rs=function K(m,b,_,w){w&&m.push(w);for(var P=0;P<m.length;P++){var U=m[P],oe=Wr(U);if(oe){K(oe.children,b,_);continue}if(U.classes[0]!=="mspace"){var we=b(U,_.node);we&&(_.insertAfter?_.insertAfter(we):(m.unshift(we),P++)),_.node=U,_.insertAfter=function(Be){return function(at){m.splice(Be+1,0,at),P++}}(P)}}w&&m.pop()},Wr=function(m){return m instanceof Ur||m instanceof Ct?m:null},ss=function K(m,b){var _=Wr(m);if(_){var w=_.children;if(w.length){if(b==="right")return K(w[w.length-1],"right");if(b==="left")return K(w[0],"left")}}return m},Jn=function(m,b){return m?(b&&(m=ss(m,b)),On[m.classes[0]]||null):null},Sn=function(m,b){var _=["nulldelimiter"].concat(m.baseSizingClasses());return Vi(b.concat(_))},Ri=function(m,b,_){if(!m)return Vi();if(zn[m.type]){var w=zn[m.type](m,b);if(_&&b.size!==_.size){w=Vi(b.sizingClasses(_),[w],b);var P=b.sizeMultiplier/_.sizeMultiplier;w.height*=P,w.depth*=P}return w}else throw new E("Got group of unknown type: '"+m.type+"'")};function ps(K,m){var b=Vi(["base"],K,m),_=Vi(["strut"]);return _.style.height=b.height+b.depth+"em",_.style.verticalAlign=-b.depth+"em",b.children.unshift(_),b}function ys(K,m){var b=null;K.length===1&&K[0].type==="tag"&&(b=K[0].tag,K=K[0].body);for(var _=$i(K,m,!0),w=[],P=[],U=0;U<_.length;U++)if(P.push(_[U]),_[U].hasClass("mbin")||_[U].hasClass("mrel")||_[U].hasClass("allowbreak")){for(var oe=!1;U<_.length-1&&_[U+1].hasClass("mspace")&&!_[U+1].hasClass("newline");)U++,P.push(_[U]),_[U].hasClass("nobreak")&&(oe=!0);oe||(w.push(ps(P,m)),P=[])}else _[U].hasClass("newline")&&(P.pop(),P.length>0&&(w.push(ps(P,m)),P=[]),w.push(_[U]));P.length>0&&w.push(ps(P,m));var we;b&&(we=ps($i(b,m,!0)),we.classes=["tag"],w.push(we));var Be=Vi(["katex-html"],w);if(Be.setAttribute("aria-hidden","true"),we){var at=we.children[0];at.style.height=Be.height+Be.depth+"em",at.style.verticalAlign=-Be.depth+"em"}return Be}function us(K){return new Ur(K)}var pi=function(){function K(b,_){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=b,this.attributes={},this.children=_||[]}var m=K.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 P=0;P<this.children.length;P++)_.appendChild(this.children[P].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 P=0;P<this.children.length;P++)_+=this.children[P].toMarkup();return _+="</"+this.type+">",_},m.toText=function(){return this.children.map(function(_){return _.toText()}).join("")},K}(),bs=function(){function K(b){this.text=void 0,this.text=b}var m=K.prototype;return m.toNode=function(){return document.createTextNode(this.text)},m.toMarkup=function(){return Z.escape(this.toText())},m.toText=function(){return this.text},K}(),_s=function(){function K(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=K.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:" "},K}(),ir={MathNode:pi,TextNode:bs,SpaceNode:_s,newDocumentFragment:us},vn=function(m,b,_){return tr[b][m]&&tr[b][m].replace&&m.charCodeAt(0)!==55349&&!(Xt.hasOwnProperty(m)&&_&&(_.fontFamily&&_.fontFamily.substr(4,2)==="tt"||_.font&&_.font.substr(4,2)==="tt"))&&(m=tr[b][m].replace),new ir.TextNode(m)},xs=function(m){return m.length===1?m[0]:new ir.MathNode("mrow",m)},cs=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 P=m.text;if(Z.contains(["\\imath","\\jmath"],P))return null;tr[w][P]&&tr[w][P].replace&&(P=tr[w][P].replace);var U=je.fontMap[_].fontName;return Fe(P,U,w)?je.fontMap[_].variant:null},hn=function(m,b,_){if(m.length===1){var w=Oi(m[0],b);return _&&w instanceof pi&&w.type==="mo"&&(w.setAttribute("lspace","0em"),w.setAttribute("rspace","0em")),[w]}for(var P=[],U,oe=0;oe<m.length;oe++){var we=Oi(m[oe],b);if(we instanceof pi&&U instanceof pi){if(we.type==="mtext"&&U.type==="mtext"&&we.getAttribute("mathvariant")===U.getAttribute("mathvariant")){var Be;(Be=U.children).push.apply(Be,we.children);continue}else if(we.type==="mn"&&U.type==="mn"){var at;(at=U.children).push.apply(at,we.children);continue}else if(we.type==="mi"&&we.children.length===1&&U.type==="mn"){var yt=we.children[0];if(yt instanceof bs&&yt.text==="."){var Ot;(Ot=U.children).push.apply(Ot,we.children);continue}}else if(U.type==="mi"&&U.children.length===1){var Yt=U.children[0];if(Yt instanceof bs&&Yt.text==="\u0338"&&(we.type==="mo"||we.type==="mi"||we.type==="mn")){var cr=we.children[0];cr instanceof bs&&cr.text.length>0&&(cr.text=cr.text.slice(0,1)+"\u0338"+cr.text.slice(1),P.pop())}}}P.push(we),U=we}return P},dn=function(m,b,_){return xs(hn(m,b,_))},Oi=function(m,b){if(!m)return new ir.MathNode("mrow");if(Vn[m.type]){var _=Vn[m.type](m,b);return _}else throw new E("Got group of unknown type: '"+m.type+"'")};function sn(K,m,b,_){var w=hn(K,b),P;w.length===1&&w[0]instanceof pi&&Z.contains(["mrow","mtable"],w[0].type)?P=w[0]:P=new ir.MathNode("mrow",w);var U=new ir.MathNode("annotation",[new ir.TextNode(m)]);U.setAttribute("encoding","application/x-tex");var oe=new ir.MathNode("semantics",[P,U]),we=new ir.MathNode("math",[oe]);we.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var Be=_?"katex":"katex-mathml";return je.makeSpan([Be],[we])}var Un=function(m){return new Hi({style:m.displayMode?D.DISPLAY:D.TEXT,maxSize:m.maxSize,minRuleThickness:m.minRuleThickness})},jn=function(m,b){if(b.displayMode){var _=["katex-display"];b.leqno&&_.push("leqno"),b.fleqn&&_.push("fleqn"),m=je.makeSpan(_,[m])}return m},Bn=function(m,b,_){var w=Un(_),P;if(_.output==="mathml")return sn(m,b,w,!0);if(_.output==="html"){var U=ys(m,w);P=je.makeSpan(["katex"],[U])}else{var oe=sn(m,b,w,!1),we=ys(m,w);P=je.makeSpan(["katex"],[oe,we])}return jn(P,_)},kn=function(m,b,_){var w=Un(_),P=ys(m,w),U=je.makeSpan(["katex"],[P]);return jn(U,_)},Pi=Bn,_i={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"},Di=function(m){var b=new ir.MathNode("mo",[new ir.TextNode(_i[m.substr(1)])]);return b.setAttribute("stretchy","true"),b},ln={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]},Tn=function(m){return m.type==="ordgroup"?m.body.length:1},Qn=function(m,b){function _(){var we=4e5,Be=m.label.substr(1);if(Z.contains(["widehat","widecheck","widetilde","utilde"],Be)){var at=m,yt=Tn(at.base),Ot,Yt,cr;if(yt>5)Be==="widehat"||Be==="widecheck"?(Ot=420,we=2364,cr=.42,Yt=Be+"4"):(Ot=312,we=2340,cr=.34,Yt="tilde4");else{var xr=[1,1,2,2,3,3][yt];Be==="widehat"||Be==="widecheck"?(we=[0,1062,2364,2364,2364][xr],Ot=[0,239,300,360,420][xr],cr=[0,.24,.3,.3,.36,.42][xr],Yt=Be+xr):(we=[0,600,1033,2339,2340][xr],Ot=[0,260,286,306,312][xr],cr=[0,.26,.286,.3,.306,.34][xr],Yt="tilde"+xr)}var qe=new vt(Yt),Ti=new et([qe],{width:"100%",height:cr+"em",viewBox:"0 0 "+we+" "+Ot,preserveAspectRatio:"none"});return{span:je.makeSvgSpan([],[Ti],b),minWidth:0,height:cr}}else{var Mi=[],Bi=ln[Be],an=Bi[0],fn=Bi[1],Cn=Bi[2],Dn=Cn/1e3,Zn=an.length,ms,Fn;if(Zn===1){var pn=Bi[3];ms=["hide-tail"],Fn=[pn]}else if(Zn===2)ms=["halfarrow-left","halfarrow-right"],Fn=["xMinYMin","xMaxYMin"];else if(Zn===3)ms=["brace-left","brace-center","brace-right"],Fn=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+Zn+" children.");for(var $s=0;$s<Zn;$s++){var ea=new vt(an[$s]),Yn=new et([ea],{width:"400em",height:Dn+"em",viewBox:"0 0 "+we+" "+Cn,preserveAspectRatio:Fn[$s]+" slice"}),ds=je.makeSvgSpan([ms[$s]],[Yn],b);if(Zn===1)return{span:ds,minWidth:fn,height:Dn};ds.style.height=Dn+"em",Mi.push(ds)}return{span:je.makeSpan(["stretchy"],Mi,b),minWidth:fn,height:Dn}}}var w=_(),P=w.span,U=w.minWidth,oe=w.height;return P.height=oe,P.style.height=oe+"em",U>0&&(P.style.minWidth=U+"em"),P},Ir=function(m,b,_,w){var P,U=m.height+m.depth+2*_;if(/fbox|color/.test(b)){if(P=je.makeSpan(["stretchy",b],[],w),b==="fbox"){var oe=w.color&&w.getColor();oe&&(P.style.borderColor=oe)}}else{var we=[];/^[bx]cancel$/.test(b)&&we.push(new wt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(b)&&we.push(new wt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var Be=new et(we,{width:"100%",height:U+"em"});P=je.makeSvgSpan([],[Be],w)}return P.height=U,P.style.height=U+"em",P},Jr={encloseSpan:Ir,mathMLnode:Di,svgSpan:Qn},_n=function(m,b){var _,w,P=br(m,"supsub"),U;P?(w=ur(P.base,"accent"),_=w.base,P.base=_,U=dr(Ri(P,b)),P.base=w):(w=ur(m,"accent"),_=w.base);var oe=Ri(_,b.havingCrampedStyle()),we=w.isShifty&&Z.isCharacterBox(_),Be=0;if(we){var at=Z.getBaseElem(_),yt=Ri(at,b.havingCrampedStyle());Be=Gt(yt).skew}var Ot=Math.min(oe.height,b.fontMetrics().xHeight),Yt;if(w.isStretchy)Yt=Jr.svgSpan(w,b),Yt=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:oe},{type:"elem",elem:Yt,wrapperClasses:["svg-align"],wrapperStyle:Be>0?{width:"calc(100% - "+2*Be+"em)",marginLeft:2*Be+"em"}:void 0}]},b);else{var cr,xr;w.label==="\\vec"?(cr=je.staticSvg("vec",b),xr=je.svgData.vec[1]):(cr=je.makeOrd({mode:w.mode,text:w.label},b,"textord"),cr=Gt(cr),cr.italic=0,xr=cr.width),Yt=je.makeSpan(["accent-body"],[cr]);var qe=w.label==="\\textcircled";qe&&(Yt.classes.push("accent-full"),Ot=oe.height);var Ti=Be;qe||(Ti-=xr/2),Yt.style.left=Ti+"em",w.label==="\\textcircled"&&(Yt.style.top=".2em"),Yt=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:oe},{type:"kern",size:-Ot},{type:"elem",elem:Yt}]},b)}var Mi=je.makeSpan(["mord","accent"],[Yt],b);return U?(U.children[0]=Mi,U.height=Math.max(Mi.height,U.height),U.classes[0]="mord",U):Mi},In=function(m,b){var _=m.isStretchy?Jr.mathMLnode(m.label):new ir.MathNode("mo",[vn(m.label,m.mode)]),w=new ir.MathNode("mover",[Oi(m.base,b),_]);return w.setAttribute("accent","true"),w},Qi=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(K){return"\\"+K}).join("|"));Or({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=!Qi.test(m.funcName),P=!w||m.funcName==="\\widehat"||m.funcName==="\\widetilde"||m.funcName==="\\widecheck";return{type:"accent",mode:m.parser.mode,label:m.funcName,isStretchy:w,isShifty:P,base:_}},htmlBuilder:_n,mathmlBuilder:In}),Or({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:_n,mathmlBuilder:In}),Or({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=m.funcName,P=b[0];return{type:"accentUnder",mode:_.mode,label:w,base:P}},htmlBuilder:function(m,b){var _=Ri(m.base,b),w=Jr.svgSpan(m,b),P=m.label==="\\utilde"?.12:0,U=je.makeVList({positionType:"bottom",positionData:w.height+P,children:[{type:"elem",elem:w,wrapperClasses:["svg-align"]},{type:"kern",size:P},{type:"elem",elem:_}]},b);return je.makeSpan(["mord","accentunder"],[U],b)},mathmlBuilder:function(m,b){var _=Jr.mathMLnode(m.label),w=new ir.MathNode("munder",[Oi(m.base,b),_]);return w.setAttribute("accentunder","true"),w}});var Ks=function(m){var b=new ir.MathNode("mpadded",m?[m]:[]);return b.setAttribute("width","+0.6em"),b.setAttribute("lspace","0.3em"),b};Or({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,P=m.funcName;return{type:"xArrow",mode:w.mode,label:P,body:b[0],below:_[0]}},htmlBuilder:function(m,b){var _=b.style,w=b.havingStyle(_.sup()),P=je.wrapFragment(Ri(m.body,w,b),b);P.classes.push("x-arrow-pad");var U;m.below&&(w=b.havingStyle(_.sub()),U=je.wrapFragment(Ri(m.below,w,b),b),U.classes.push("x-arrow-pad"));var oe=Jr.svgSpan(m,b),we=-b.fontMetrics().axisHeight+.5*oe.height,Be=-b.fontMetrics().axisHeight-.5*oe.height-.111;(P.depth>.25||m.label==="\\xleftequilibrium")&&(Be-=P.depth);var at;if(U){var yt=-b.fontMetrics().axisHeight+U.height+.5*oe.height+.111;at=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:P,shift:Be},{type:"elem",elem:oe,shift:we},{type:"elem",elem:U,shift:yt}]},b)}else at=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:P,shift:Be},{type:"elem",elem:oe,shift:we}]},b);return at.children[0].children[0].children[1].classes.push("svg-align"),je.makeSpan(["mrel","x-arrow"],[at],b)},mathmlBuilder:function(m,b){var _=Jr.mathMLnode(m.label),w;if(m.body){var P=Ks(Oi(m.body,b));if(m.below){var U=Ks(Oi(m.below,b));w=new ir.MathNode("munderover",[_,U,P])}else w=new ir.MathNode("mover",[_,P])}else if(m.below){var oe=Ks(Oi(m.below,b));w=new ir.MathNode("munder",[_,oe])}else w=Ks(),w=new ir.MathNode("mover",[_,w]);return w}}),Or({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){for(var _=m.parser,w=ur(b[0],"ordgroup"),P=w.body,U="",oe=0;oe<P.length;oe++){var we=ur(P[oe],"textord");U+=we.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 hs=function(m,b){var _=$i(m.body,b.withColor(m.color),!1);return je.makeFragment(_)},ws=function(m,b){var _=hn(m.body,b.withColor(m.color)),w=new ir.MathNode("mstyle",_);return w.setAttribute("mathcolor",m.color),w};Or({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(m,b){var _=m.parser,w=ur(b[0],"color-token").color,P=b[1];return{type:"color",mode:_.mode,color:w,body:Ui(P)}},htmlBuilder:hs,mathmlBuilder:ws}),Or({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(m,b){var _=m.parser,w=m.breakOnTokenText,P=ur(b[0],"color-token").color;_.gullet.macros.set("\\current@color",P);var U=_.parseExpression(!0,w);return{type:"color",mode:_.mode,color:P,body:U}},htmlBuilder:hs,mathmlBuilder:ws}),Or({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(m,b,_){var w=m.parser,P=m.funcName,U=_[0],oe=P==="\\cr",we=!1;return oe||(w.settings.displayMode&&w.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?we=!1:we=!0),{type:"cr",mode:w.mode,newLine:we,newRow:oe,size:U&&ur(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 ir.MathNode("mspace");return m.newLine&&(_.setAttribute("linebreak","newline"),m.size&&_.setAttribute("height",tt(m.size,b)+"em")),_}});var qn=function(m,b,_){var w=tr.math[m]&&tr.math[m].replace,P=Fe(w||m,b,_);if(!P)throw new Error("Unsupported symbol "+m+" and font size "+b+".");return P},Zs=function(m,b,_,w){var P=_.havingBaseStyle(b),U=je.makeSpan(w.concat(P.sizingClasses(_)),[m],_),oe=P.sizeMultiplier/_.sizeMultiplier;return U.height*=oe,U.depth*=oe,U.maxFontSize=P.sizeMultiplier,U},sa=function(m,b,_){var w=b.havingBaseStyle(_),P=(1-b.sizeMultiplier/w.sizeMultiplier)*b.fontMetrics().axisHeight;m.classes.push("delimcenter"),m.style.top=P+"em",m.height-=P,m.depth+=P},Pa=function(m,b,_,w,P,U){var oe=je.makeSymbol(m,"Main-Regular",P,w),we=Zs(oe,b,w,U);return _&&sa(we,w,b),we},Sa=function(m,b,_,w){return je.makeSymbol(m,"Size"+b+"-Regular",_,w)},Oa=function(m,b,_,w,P,U){var oe=Sa(m,b,P,w),we=Zs(je.makeSpan(["delimsizing","size"+b],[oe],w),D.TEXT,w,U);return _&&sa(we,w,D.TEXT),we},xn=function(m,b,_){var w;b==="Size1-Regular"?w="delim-size1":w="delim-size4";var P=je.makeSpan(["delimsizinginner",w],[je.makeSpan([],[je.makeSymbol(m,b,_)])]);return{type:"elem",elem:P}},Ss={type:"kern",size:-.005},Kn=function(m,b,_,w,P,U){var oe,we,Be,at;oe=Be=at=m,we=null;var yt="Size1-Regular";m==="\\uparrow"?Be=at="\u23D0":m==="\\Uparrow"?Be=at="\u2016":m==="\\downarrow"?oe=Be="\u23D0":m==="\\Downarrow"?oe=Be="\u2016":m==="\\updownarrow"?(oe="\\uparrow",Be="\u23D0",at="\\downarrow"):m==="\\Updownarrow"?(oe="\\Uparrow",Be="\u2016",at="\\Downarrow"):m==="["||m==="\\lbrack"?(oe="\u23A1",Be="\u23A2",at="\u23A3",yt="Size4-Regular"):m==="]"||m==="\\rbrack"?(oe="\u23A4",Be="\u23A5",at="\u23A6",yt="Size4-Regular"):m==="\\lfloor"||m==="\u230A"?(Be=oe="\u23A2",at="\u23A3",yt="Size4-Regular"):m==="\\lceil"||m==="\u2308"?(oe="\u23A1",Be=at="\u23A2",yt="Size4-Regular"):m==="\\rfloor"||m==="\u230B"?(Be=oe="\u23A5",at="\u23A6",yt="Size4-Regular"):m==="\\rceil"||m==="\u2309"?(oe="\u23A4",Be=at="\u23A5",yt="Size4-Regular"):m==="("||m==="\\lparen"?(oe="\u239B",Be="\u239C",at="\u239D",yt="Size4-Regular"):m===")"||m==="\\rparen"?(oe="\u239E",Be="\u239F",at="\u23A0",yt="Size4-Regular"):m==="\\{"||m==="\\lbrace"?(oe="\u23A7",we="\u23A8",at="\u23A9",Be="\u23AA",yt="Size4-Regular"):m==="\\}"||m==="\\rbrace"?(oe="\u23AB",we="\u23AC",at="\u23AD",Be="\u23AA",yt="Size4-Regular"):m==="\\lgroup"||m==="\u27EE"?(oe="\u23A7",at="\u23A9",Be="\u23AA",yt="Size4-Regular"):m==="\\rgroup"||m==="\u27EF"?(oe="\u23AB",at="\u23AD",Be="\u23AA",yt="Size4-Regular"):m==="\\lmoustache"||m==="\u23B0"?(oe="\u23A7",at="\u23AD",Be="\u23AA",yt="Size4-Regular"):(m==="\\rmoustache"||m==="\u23B1")&&(oe="\u23AB",at="\u23A9",Be="\u23AA",yt="Size4-Regular");var Ot=qn(oe,yt,P),Yt=Ot.height+Ot.depth,cr=qn(Be,yt,P),xr=cr.height+cr.depth,qe=qn(at,yt,P),Ti=qe.height+qe.depth,Mi=0,Bi=1;if(we!==null){var an=qn(we,yt,P);Mi=an.height+an.depth,Bi=2}var fn=Yt+Ti+Mi,Cn=Math.max(0,Math.ceil((b-fn)/(Bi*xr))),Dn=fn+Cn*Bi*xr,Zn=w.fontMetrics().axisHeight;_&&(Zn*=w.sizeMultiplier);var ms=Dn/2-Zn,Fn=(Cn+1)*.005-xr,pn=[];if(pn.push(xn(at,yt,P)),we===null)for(var $s=0;$s<Cn;$s++)pn.push(Ss),pn.push(xn(Be,yt,P));else{for(var ea=0;ea<Cn;ea++)pn.push(Ss),pn.push(xn(Be,yt,P));pn.push({type:"kern",size:Fn}),pn.push(xn(Be,yt,P)),pn.push(Ss),pn.push(xn(we,yt,P));for(var Yn=0;Yn<Cn;Yn++)pn.push(Ss),pn.push(xn(Be,yt,P))}pn.push({type:"kern",size:Fn}),pn.push(xn(Be,yt,P)),pn.push(Ss),pn.push(xn(oe,yt,P));var ds=w.havingBaseStyle(D.TEXT),Mr=je.makeVList({positionType:"bottom",positionData:ms,children:pn},ds);return Zs(je.makeSpan(["delimsizing","mult"],[Mr],ds),D.TEXT,w,U)},Ys=80,Ba=.08,aa=function(m,b,_,w,P){var U=zr(m,w,_),oe=new vt(m,U),we=new et([oe],{width:"400em",height:b+"em",viewBox:"0 0 400000 "+_,preserveAspectRatio:"xMinYMin slice"});return je.makeSvgSpan(["hide-tail"],[we],P)},Yo=function(m,b){var _=b.havingBaseSizing(),w=Xo("\\surd",m*_.sizeMultiplier,Ea,_),P=_.sizeMultiplier,U=Math.max(0,b.minRuleThickness-b.fontMetrics().sqrtRuleThickness),oe,we=0,Be=0,at=0,yt;return w.type==="small"?(at=1e3+1e3*U+Ys,m<1?P=1:m<1.4&&(P=.7),we=(1+U+Ba)/P,Be=(1+U)/P,oe=aa("sqrtMain",we,at,U,b),oe.style.minWidth="0.853em",yt=.833/P):w.type==="large"?(at=(1e3+Ys)*Fa[w.size],Be=(Fa[w.size]+U)/P,we=(Fa[w.size]+U+Ba)/P,oe=aa("sqrtSize"+w.size,we,at,U,b),oe.style.minWidth="1.02em",yt=1/P):(we=m+U+Ba,Be=m+U,at=Math.floor(1e3*m+U)+Ys,oe=aa("sqrtTall",we,at,U,b),oe.style.minWidth="0.742em",yt=1.056),oe.height=Be,oe.style.height=we+"em",{span:oe,advanceWidth:yt,ruleWidth:(b.fontMetrics().sqrtRuleThickness+U)*P}},yo=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],Ts=["\\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"],Fa=[0,1.2,1.8,2.4,3],Xs=function(m,b,_,w,P){if(m==="<"||m==="\\lt"||m==="\u27E8"?m="\\langle":(m===">"||m==="\\gt"||m==="\u27E9")&&(m="\\rangle"),Z.contains(yo,m)||Z.contains(bo,m))return Oa(m,b,!1,_,w,P);if(Z.contains(Ts,m))return Kn(m,Fa[b],!1,_,w,P);throw new E("Illegal delimiter: '"+m+"'")},_o=[{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}],da=[{type:"small",style:D.SCRIPTSCRIPT},{type:"small",style:D.SCRIPT},{type:"small",style:D.TEXT},{type:"stack"}],Ea=[{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"}],Ja=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.")},Xo=function(m,b,_,w){for(var P=Math.min(2,3-w.style.size),U=P;U<_.length&&_[U].type!=="stack";U++){var oe=qn(m,Ja(_[U]),"math"),we=oe.height+oe.depth;if(_[U].type==="small"){var Be=w.havingBaseStyle(_[U].style);we*=Be.sizeMultiplier}if(we>b)return _[U]}return _[_.length-1]},Na=function(m,b,_,w,P,U){m==="<"||m==="\\lt"||m==="\u27E8"?m="\\langle":(m===">"||m==="\\gt"||m==="\u27E9")&&(m="\\rangle");var oe;Z.contains(bo,m)?oe=_o:Z.contains(yo,m)?oe=Ea:oe=da;var we=Xo(m,b,oe,w);return we.type==="small"?Pa(m,we.style,_,w,P,U):we.type==="large"?Oa(m,we.size,_,w,P,U):Kn(m,b,_,w,P,U)},Jo=function(m,b,_,w,P,U){var oe=w.fontMetrics().axisHeight*w.sizeMultiplier,we=901,Be=5/w.fontMetrics().ptPerEm,at=Math.max(b-oe,_+oe),yt=Math.max(at/500*we,2*at-Be);return Na(m,yt,!0,w,P,U)},Cs={sqrtImage:Yo,sizedDelim:Xs,customSizedDelim:Na,leftRightDelim:Jo},Qa={"\\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}},xo=["(","\\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 $a(K,m){var b=Ni(K);if(b&&Z.contains(xo,b.text))return b;throw new E("Invalid delimiter: '"+(b?b.text:JSON.stringify(K))+"' after '"+m.funcName+"'",K)}Or({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 _=$a(b[0],m);return{type:"delimsizing",mode:m.parser.mode,size:Qa[m.funcName].size,mclass:Qa[m.funcName].mclass,delim:_.text}},htmlBuilder:function(m,b){return m.delim==="."?je.makeSpan([m.mclass]):Cs.sizedDelim(m.delim,m.size,b,m.mode,[m.mclass])},mathmlBuilder:function(m){var b=[];m.delim!=="."&&b.push(vn(m.delim,m.mode));var _=new ir.MathNode("mo",b);return m.mclass==="mopen"||m.mclass==="mclose"?_.setAttribute("fence","true"):_.setAttribute("fence","false"),_}});function eo(K){if(!K.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Or({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:$a(b[0],m).text,color:_}}}),Or({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(m,b){var _=$a(b[0],m),w=m.parser;++w.leftrightDepth;var P=w.parseExpression(!1);--w.leftrightDepth,w.expect("\\right",!1);var U=ur(w.parseFunction(),"leftright-right");return{type:"leftright",mode:w.mode,body:P,left:_.text,right:U.delim,rightColor:U.color}},htmlBuilder:function(m,b){eo(m);for(var _=$i(m.body,b,!0,["mopen","mclose"]),w=0,P=0,U=!1,oe=0;oe<_.length;oe++)_[oe].isMiddle?U=!0:(w=Math.max(_[oe].height,w),P=Math.max(_[oe].depth,P));w*=b.sizeMultiplier,P*=b.sizeMultiplier;var we;if(m.left==="."?we=Sn(b,["mopen"]):we=Cs.leftRightDelim(m.left,w,P,b,m.mode,["mopen"]),_.unshift(we),U)for(var Be=1;Be<_.length;Be++){var at=_[Be],yt=at.isMiddle;yt&&(_[Be]=Cs.leftRightDelim(yt.delim,w,P,yt.options,m.mode,[]))}var Ot;if(m.right===".")Ot=Sn(b,["mclose"]);else{var Yt=m.rightColor?b.withColor(m.rightColor):b;Ot=Cs.leftRightDelim(m.right,w,P,Yt,m.mode,["mclose"])}return _.push(Ot),je.makeSpan(["minner"],_,b)},mathmlBuilder:function(m,b){eo(m);var _=hn(m.body,b);if(m.left!=="."){var w=new ir.MathNode("mo",[vn(m.left,m.mode)]);w.setAttribute("fence","true"),_.unshift(w)}if(m.right!=="."){var P=new ir.MathNode("mo",[vn(m.right,m.mode)]);P.setAttribute("fence","true"),m.rightColor&&P.setAttribute("mathcolor",m.rightColor),_.push(P)}return xs(_)}}),Or({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(m,b){var _=$a(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===".")_=Sn(b,[]);else{_=Cs.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==="|"?vn("|","text"):vn(m.delim,m.mode),w=new ir.MathNode("mo",[_]);return w.setAttribute("fence","true"),w.setAttribute("lspace","0.05em"),w.setAttribute("rspace","0.05em"),w}});var to=function(m,b){var _=je.wrapFragment(Ri(m.body,b),b),w=m.label.substr(1),P=b.sizeMultiplier,U,oe=0,we=Z.isCharacterBox(m.body);if(w==="sout")U=je.makeSpan(["stretchy","sout"]),U.height=b.fontMetrics().defaultRuleThickness/P,oe=-.5*b.fontMetrics().xHeight;else{/cancel/.test(w)?we||_.classes.push("cancel-pad"):_.classes.push("boxpad");var Be=0,at=0;/box/.test(w)?(at=Math.max(b.fontMetrics().fboxrule,b.minRuleThickness),Be=b.fontMetrics().fboxsep+(w==="colorbox"?0:at)):Be=we?.2:0,U=Jr.encloseSpan(_,w,Be,b),/fbox|boxed|fcolorbox/.test(w)&&(U.style.borderStyle="solid",U.style.borderWidth=at+"em"),oe=_.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:oe},{type:"elem",elem:_,shift:0}]},b):yt=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:0},{type:"elem",elem:U,shift:oe,wrapperClasses:/cancel/.test(w)?["svg-align"]:[]}]},b),/cancel/.test(w)&&(yt.height=_.height,yt.depth=_.depth),/cancel/.test(w)&&!we?je.makeSpan(["mord","cancel-lap"],[yt],b):je.makeSpan(["mord"],[yt],b)},Js=function(m,b){var _=0,w=new ir.MathNode(m.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Oi(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 P=Math.max(b.fontMetrics().fboxrule,b.minRuleThickness);w.setAttribute("style","border: "+P+"em solid "+String(m.borderColor))}break;case"\\xcancel":w.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return m.backgroundColor&&w.setAttribute("mathbackground",m.backgroundColor),w};Or({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(m,b,_){var w=m.parser,P=m.funcName,U=ur(b[0],"color-token").color,oe=b[1];return{type:"enclose",mode:w.mode,label:P,backgroundColor:U,body:oe}},htmlBuilder:to,mathmlBuilder:Js}),Or({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(m,b,_){var w=m.parser,P=m.funcName,U=ur(b[0],"color-token").color,oe=ur(b[1],"color-token").color,we=b[2];return{type:"enclose",mode:w.mode,label:P,backgroundColor:oe,borderColor:U,body:we}},htmlBuilder:to,mathmlBuilder:Js}),Or({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]}}}),Or({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(m,b,_){var w=m.parser,P=m.funcName,U=b[0];return{type:"enclose",mode:w.mode,label:P,body:U}},htmlBuilder:to,mathmlBuilder:Js});var za={};function Os(K){for(var m=K.type,b=K.names,_=K.props,w=K.handler,P=K.htmlBuilder,U=K.mathmlBuilder,oe={type:m,numArgs:_.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:w},we=0;we<b.length;++we)za[b[we]]=oe;P&&(zn[m]=P),U&&(Vn[m]=U)}function Qo(K){var m=[];K.consumeSpaces();for(var b=K.fetch().text;b==="\\hline"||b==="\\hdashline";)K.consume(),m.push(b==="\\hdashline"),K.consumeSpaces(),b=K.fetch().text;return m}function Ki(K,m,b){var _=m.hskipBeforeAndAfter,w=m.addJot,P=m.cols,U=m.arraystretch,oe=m.colSeparationType;if(K.gullet.beginGroup(),K.gullet.macros.set("\\\\","\\cr"),!U){var we=K.gullet.expandMacroAsText("\\arraystretch");if(we==null)U=1;else if(U=parseFloat(we),!U||U<0)throw new E("Invalid \\arraystretch: "+we)}K.gullet.beginGroup();var Be=[],at=[Be],yt=[],Ot=[];for(Ot.push(Qo(K));;){var Yt=K.parseExpression(!1,"\\cr");K.gullet.endGroup(),K.gullet.beginGroup(),Yt={type:"ordgroup",mode:K.mode,body:Yt},b&&(Yt={type:"styling",mode:K.mode,style:b,body:[Yt]}),Be.push(Yt);var cr=K.fetch().text;if(cr==="&")K.consume();else if(cr==="\\end"){Be.length===1&&Yt.type==="styling"&&Yt.body[0].body.length===0&&at.pop(),Ot.length<at.length+1&&Ot.push([]);break}else if(cr==="\\cr"){var xr=ur(K.parseFunction(),"cr");yt.push(xr.size),Ot.push(Qo(K)),Be=[],at.push(Be)}else throw new E("Expected & or \\\\ or \\cr or \\end",K.nextToken)}return K.gullet.endGroup(),K.gullet.endGroup(),{type:"array",mode:K.mode,addJot:w,arraystretch:U,body:at,cols:P,rowGaps:yt,hskipBeforeAndAfter:_,hLinesBeforeRow:Ot,colSeparationType:oe}}function Yi(K){return K.substr(0,1)==="d"?"display":"text"}var Xi=function(m,b){var _,w,P=m.body.length,U=m.hLinesBeforeRow,oe=0,we=new Array(P),Be=[],at=Math.max(b.fontMetrics().arrayRuleWidth,b.minRuleThickness),yt=1/b.fontMetrics().ptPerEm,Ot=5*yt;if(m.colSeparationType&&m.colSeparationType==="small"){var Yt=b.havingStyle(D.SCRIPT).sizeMultiplier;Ot=.2778*(Yt/b.sizeMultiplier)}var cr=12*yt,xr=3*yt,qe=m.arraystretch*cr,Ti=.7*qe,Mi=.3*qe,Bi=0;function an(fl){for(var pl=0;pl<fl.length;++pl)pl>0&&(Bi+=.25),Be.push({pos:Bi,isDashed:fl[pl]})}for(an(U[0]),_=0;_<m.body.length;++_){var fn=m.body[_],Cn=Ti,Dn=Mi;oe<fn.length&&(oe=fn.length);var Zn=new Array(fn.length);for(w=0;w<fn.length;++w){var ms=Ri(fn[w],b);Dn<ms.depth&&(Dn=ms.depth),Cn<ms.height&&(Cn=ms.height),Zn[w]=ms}var Fn=m.rowGaps[_],pn=0;Fn&&(pn=tt(Fn,b),pn>0&&(pn+=Mi,Dn<pn&&(Dn=pn),pn=0)),m.addJot&&(Dn+=xr),Zn.height=Cn,Zn.depth=Dn,Bi+=Cn,Zn.pos=Bi,Bi+=Dn+pn,we[_]=Zn,an(U[_+1])}var $s=Bi/2+b.fontMetrics().axisHeight,ea=m.cols||[],Yn=[],ds,Mr;for(w=0,Mr=0;w<oe||Mr<ea.length;++w,++Mr){for(var as=ea[Mr]||{},Ru=!0;as.type==="separator";){if(Ru||(ds=je.makeSpan(["arraycolsep"],[]),ds.style.width=b.fontMetrics().doubleRuleSep+"em",Yn.push(ds)),as.separator==="|"||as.separator===":"){var c0=as.separator==="|"?"solid":"dashed",is=je.makeSpan(["vertical-separator"],[],b);is.style.height=Bi+"em",is.style.borderRightWidth=at+"em",is.style.borderRightStyle=c0,is.style.margin="0 -"+at/2+"em",is.style.verticalAlign=-(Bi-$s)+"em",Yn.push(is)}else throw new E("Invalid separator type: "+as.separator);Mr++,as=ea[Mr]||{},Ru=!1}if(!(w>=oe)){var gs=void 0;(w>0||m.hskipBeforeAndAfter)&&(gs=Z.deflt(as.pregap,Ot),gs!==0&&(ds=je.makeSpan(["arraycolsep"],[]),ds.style.width=gs+"em",Yn.push(ds)));var ma=[];for(_=0;_<P;++_){var hl=we[_],ql=hl[w];if(ql){var Ga=hl.pos-$s;ql.depth=hl.depth,ql.height=hl.height,ma.push({type:"elem",elem:ql,shift:Ga})}}ma=je.makeVList({positionType:"individualShift",children:ma},b),ma=je.makeSpan(["col-align-"+(as.align||"c")],[ma]),Yn.push(ma),(w<oe-1||m.hskipBeforeAndAfter)&&(gs=Z.deflt(as.postgap,Ot),gs!==0&&(ds=je.makeSpan(["arraycolsep"],[]),ds.style.width=gs+"em",Yn.push(ds)))}}if(we=je.makeSpan(["mtable"],Yn),Be.length>0){for(var Bs=je.makeLineSpan("hline",b,at),ec=je.makeLineSpan("hdashline",b,at),ga=[{type:"elem",elem:we,shift:0}];Be.length>0;){var Zl=Be.pop(),dl=Zl.pos-$s;Zl.isDashed?ga.push({type:"elem",elem:ec,shift:dl}):ga.push({type:"elem",elem:Bs,shift:dl})}we=je.makeVList({positionType:"individualShift",children:ga},b)}return je.makeSpan(["mord"],[we],b)},Es={c:"center ",l:"left ",r:"right "},En=function(m,b){var _=new ir.MathNode("mtable",m.body.map(function(Bi){return new ir.MathNode("mtr",Bi.map(function(an){return new ir.MathNode("mtd",[Oi(an,b)])}))})),w=m.arraystretch===.5?.1:.16+m.arraystretch-1+(m.addJot?.09:0);_.setAttribute("rowspacing",w+"em");var P="",U="";if(m.cols){var oe=m.cols,we="",Be=!1,at=0,yt=oe.length;oe[0].type==="separator"&&(P+="top ",at=1),oe[oe.length-1].type==="separator"&&(P+="bottom ",yt-=1);for(var Ot=at;Ot<yt;Ot++)oe[Ot].type==="align"?(U+=Es[oe[Ot].align],Be&&(we+="none "),Be=!0):oe[Ot].type==="separator"&&Be&&(we+=oe[Ot].separator==="|"?"solid ":"dashed ",Be=!1);_.setAttribute("columnalign",U.trim()),/[sd]/.test(we)&&_.setAttribute("columnlines",we.trim())}if(m.colSeparationType==="align"){for(var Yt=m.cols||[],cr="",xr=1;xr<Yt.length;xr++)cr+=xr%2?"0em ":"1em ";_.setAttribute("columnspacing",cr.trim())}else m.colSeparationType==="alignat"?_.setAttribute("columnspacing","0em"):m.colSeparationType==="small"?_.setAttribute("columnspacing","0.2778em"):_.setAttribute("columnspacing","1em");var qe="",Ti=m.hLinesBeforeRow;P+=Ti[0].length>0?"left ":"",P+=Ti[Ti.length-1].length>0?"right ":"";for(var Mi=1;Mi<Ti.length-1;Mi++)qe+=Ti[Mi].length===0?"none ":Ti[Mi][0]?"dashed ":"solid ";return/[sd]/.test(qe)&&_.setAttribute("rowlines",qe.trim()),P!==""&&(_=new ir.MathNode("menclose",[_]),_.setAttribute("notation",P.trim())),m.arraystretch&&m.arraystretch<1&&(_=new ir.MathNode("mstyle",[_]),_.setAttribute("scriptlevel","1")),_},Ua=function(m,b){var _=[],w=Ki(m.parser,{cols:_,addJot:!0},"display"),P,U=0,oe={type:"ordgroup",mode:m.mode,body:[]},we=br(b[0],"ordgroup");if(we){for(var Be="",at=0;at<we.body.length;at++){var yt=ur(we.body[at],"textord");Be+=yt.text}P=Number(Be),U=P*2}var Ot=!U;w.body.forEach(function(qe){for(var Ti=1;Ti<qe.length;Ti+=2){var Mi=ur(qe[Ti],"styling"),Bi=ur(Mi.body[0],"ordgroup");Bi.body.unshift(oe)}if(Ot)U<qe.length&&(U=qe.length);else{var an=qe.length/2;if(P<an)throw new E("Too many math in a row: "+("expected "+P+", but got "+an),qe[0])}});for(var Yt=0;Yt<U;++Yt){var cr="r",xr=0;Yt%2===1?cr="l":Yt>0&&Ot&&(xr=1),_[Yt]={type:"align",align:cr,pregap:xr,postgap:0}}return w.colSeparationType=Ot?"align":"alignat",w};Os({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(m,b){var _=Ni(b[0]),w=_?[b[0]]:ur(b[0],"ordgroup").body,P=w.map(function(oe){var we=vi(oe),Be=we.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,oe)}),U={cols:P,hskipBeforeAndAfter:!0};return Ki(m.parser,U,Yi(m.envName))},htmlBuilder:Xi,mathmlBuilder:En}),Os({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=Ki(m.parser,_,Yi(m.envName));return b?{type:"leftright",mode:m.mode,body:[w],left:b[0],right:b[1],rightColor:void 0}:w},htmlBuilder:Xi,mathmlBuilder:En}),Os({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(m){var b={arraystretch:.5},_=Ki(m.parser,b,"script");return _.colSeparationType="small",_},htmlBuilder:Xi,mathmlBuilder:En}),Os({type:"array",names:["subarray"],props:{numArgs:1},handler:function(m,b){var _=Ni(b[0]),w=_?[b[0]]:ur(b[0],"ordgroup").body,P=w.map(function(oe){var we=vi(oe),Be=we.text;if("lc".indexOf(Be)!==-1)return{type:"align",align:Be};throw new E("Unknown column alignment: "+Be,oe)});if(P.length>1)throw new E("{subarray} can contain only one column");var U={cols:P,hskipBeforeAndAfter:!1,arraystretch:.5};if(U=Ki(m.parser,U,"script"),U.body[0].length>1)throw new E("{subarray} can contain only one column");return U},htmlBuilder:Xi,mathmlBuilder:En}),Os({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}]},_=Ki(m.parser,b,Yi(m.envName));return{type:"leftright",mode:m.mode,body:[_],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:Xi,mathmlBuilder:En}),Os({type:"array",names:["aligned"],props:{numArgs:0},handler:Ua,htmlBuilder:Xi,mathmlBuilder:En}),Os({type:"array",names:["gathered"],props:{numArgs:0},handler:function(m){var b={cols:[{type:"align",align:"c"}],addJot:!0};return Ki(m.parser,b,"display")},htmlBuilder:Xi,mathmlBuilder:En}),Os({type:"array",names:["alignedat"],props:{numArgs:1},handler:Ua,htmlBuilder:Xi,mathmlBuilder:En}),Or({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 Vt=za,ro=Vt;Or({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(m,b){var _=m.parser,w=m.funcName,P=b[0];if(P.type!=="ordgroup")throw new E("Invalid environment name",P);for(var U="",oe=0;oe<P.body.length;++oe)U+=ur(P.body[oe],"textord").text;if(w==="\\begin"){if(!ro.hasOwnProperty(U))throw new E("No such environment: "+U,P);var we=ro[U],Be=_.parseArguments("\\begin{"+U+"}",we),at=Be.args,yt=Be.optArgs,Ot={mode:_.mode,envName:U,parser:_},Yt=we.handler(Ot,at,yt);_.expect("\\end",!1);var cr=_.nextToken,xr=ur(_.parseFunction(),"environment");if(xr.name!==U)throw new E("Mismatch: \\begin{"+U+"} matched by \\end{"+xr.name+"}",cr);return Yt}return{type:"environment",mode:_.mode,name:U,nameGroup:P}}});var wo=je.makeSpan;function io(K,m){var b=$i(K.body,m,!0);return wo([K.mclass],b,m)}function oa(K,m){var b,_=hn(K.body,m);return K.mclass==="minner"?ir.newDocumentFragment(_):(K.mclass==="mord"?K.isCharacterBox?(b=_[0],b.type="mi"):b=new ir.MathNode("mi",_):(K.isCharacterBox?(b=_[0],b.type="mo"):b=new ir.MathNode("mo",_),K.mclass==="mbin"?(b.attributes.lspace="0.22em",b.attributes.rspace="0.22em"):K.mclass==="mpunct"?(b.attributes.lspace="0em",b.attributes.rspace="0.17em"):(K.mclass==="mopen"||K.mclass==="mclose")&&(b.attributes.lspace="0em",b.attributes.rspace="0em")),b)}Or({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=m.funcName,P=b[0];return{type:"mclass",mode:_.mode,mclass:"m"+w.substr(5),body:Ui(P),isCharacterBox:Z.isCharacterBox(P)}},htmlBuilder:io,mathmlBuilder:oa});var Hs=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"};Or({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(m,b){var _=m.parser;return{type:"mclass",mode:_.mode,mclass:Hs(b[0]),body:[b[1]],isCharacterBox:Z.isCharacterBox(b[1])}}}),Or({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(m,b){var _=m.parser,w=m.funcName,P=b[1],U=b[0],oe;w!=="\\stackrel"?oe=Hs(P):oe="mrel";var we={type:"op",mode:P.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:w!=="\\stackrel",body:Ui(P)},Be={type:"supsub",mode:U.mode,base:we,sup:w==="\\underset"?null:U,sub:w==="\\underset"?U:null};return{type:"mclass",mode:_.mode,mclass:oe,body:[Be],isCharacterBox:Z.isCharacterBox(Be)}},htmlBuilder:io,mathmlBuilder:oa});var So=function(m,b){var _=m.font,w=b.withFont(_);return Ri(m.body,w)},mu=function(m,b){var _=m.font,w=b.withFont(_);return Oi(m.body,w)},gu={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Or({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,P=b[0],U=w;return U in gu&&(U=gu[U]),{type:"font",mode:_.mode,font:U.slice(1),body:P}},htmlBuilder:So,mathmlBuilder:mu}),Or({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(m,b){var _=m.parser,w=b[0],P=Z.isCharacterBox(w);return{type:"mclass",mode:_.mode,mclass:Hs(w),body:[{type:"font",mode:_.mode,font:"boldsymbol",body:w}],isCharacterBox:P}}}),Or({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.parser,w=m.funcName,P=m.breakOnTokenText,U=_.mode,oe=_.parseExpression(!0,P),we="math"+w.slice(1);return{type:"font",mode:U,font:we,body:{type:"ordgroup",mode:_.mode,body:oe}}},htmlBuilder:So,mathmlBuilder:mu});var el=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),_},Ka=function(m,b){var _=el(m.size,b.style),w=_.fracNum(),P=_.fracDen(),U;U=b.havingStyle(w);var oe=Ri(m.numer,U,b);if(m.continued){var we=8.5/b.fontMetrics().ptPerEm,Be=3.5/b.fontMetrics().ptPerEm;oe.height=oe.height<we?we:oe.height,oe.depth=oe.depth<Be?Be:oe.depth}U=b.havingStyle(P);var at=Ri(m.denom,U,b),yt,Ot,Yt;m.hasBarLine?(m.barSize?(Ot=tt(m.barSize,b),yt=je.makeLineSpan("frac-line",b,Ot)):yt=je.makeLineSpan("frac-line",b),Ot=yt.height,Yt=yt.height):(yt=null,Ot=0,Yt=b.fontMetrics().defaultRuleThickness);var cr,xr,qe;_.size===D.DISPLAY.size||m.size==="display"?(cr=b.fontMetrics().num1,Ot>0?xr=3*Yt:xr=7*Yt,qe=b.fontMetrics().denom1):(Ot>0?(cr=b.fontMetrics().num2,xr=Yt):(cr=b.fontMetrics().num3,xr=3*Yt),qe=b.fontMetrics().denom2);var Ti;if(yt){var Bi=b.fontMetrics().axisHeight;cr-oe.depth-(Bi+.5*Ot)<xr&&(cr+=xr-(cr-oe.depth-(Bi+.5*Ot))),Bi-.5*Ot-(at.height-qe)<xr&&(qe+=xr-(Bi-.5*Ot-(at.height-qe)));var an=-(Bi-.5*Ot);Ti=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:at,shift:qe},{type:"elem",elem:yt,shift:an},{type:"elem",elem:oe,shift:-cr}]},b)}else{var Mi=cr-oe.depth-(at.height-qe);Mi<xr&&(cr+=.5*(xr-Mi),qe+=.5*(xr-Mi)),Ti=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:at,shift:qe},{type:"elem",elem:oe,shift:-cr}]},b)}U=b.havingStyle(_),Ti.height*=U.sizeMultiplier/b.sizeMultiplier,Ti.depth*=U.sizeMultiplier/b.sizeMultiplier;var fn;_.size===D.DISPLAY.size?fn=b.fontMetrics().delim1:fn=b.fontMetrics().delim2;var Cn,Dn;return m.leftDelim==null?Cn=Sn(b,["mopen"]):Cn=Cs.customSizedDelim(m.leftDelim,fn,!0,b.havingStyle(_),m.mode,["mopen"]),m.continued?Dn=je.makeSpan([]):m.rightDelim==null?Dn=Sn(b,["mclose"]):Dn=Cs.customSizedDelim(m.rightDelim,fn,!0,b.havingStyle(_),m.mode,["mclose"]),je.makeSpan(["mord"].concat(U.sizingClasses(b)),[Cn,je.makeSpan(["mfrac"],[Ti]),Dn],b)},Aa=function(m,b){var _=new ir.MathNode("mfrac",[Oi(m.numer,b),Oi(m.denom,b)]);if(!m.hasBarLine)_.setAttribute("linethickness","0px");else if(m.barSize){var w=tt(m.barSize,b);_.setAttribute("linethickness",w+"em")}var P=el(m.size,b.style);if(P.size!==b.style.size){_=new ir.MathNode("mstyle",[_]);var U=P.size===D.DISPLAY.size?"true":"false";_.setAttribute("displaystyle",U),_.setAttribute("scriptlevel","0")}if(m.leftDelim!=null||m.rightDelim!=null){var oe=[];if(m.leftDelim!=null){var we=new ir.MathNode("mo",[new ir.TextNode(m.leftDelim.replace("\\",""))]);we.setAttribute("fence","true"),oe.push(we)}if(oe.push(_),m.rightDelim!=null){var Be=new ir.MathNode("mo",[new ir.TextNode(m.rightDelim.replace("\\",""))]);Be.setAttribute("fence","true"),oe.push(Be)}return xs(oe)}return _};Or({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,P=b[0],U=b[1],oe,we=null,Be=null,at="auto";switch(w){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":oe=!0;break;case"\\\\atopfrac":oe=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":oe=!1,we="(",Be=")";break;case"\\\\bracefrac":oe=!1,we="\\{",Be="\\}";break;case"\\\\brackfrac":oe=!1,we="[",Be="]";break;default:throw new Error("Unrecognized genfrac command")}switch(w){case"\\cfrac":case"\\dfrac":case"\\dbinom":at="display";break;case"\\tfrac":case"\\tbinom":at="text";break}return{type:"genfrac",mode:_.mode,continued:w==="\\cfrac",numer:P,denom:U,hasBarLine:oe,leftDelim:we,rightDelim:Be,size:at,barSize:null}},htmlBuilder:Ka,mathmlBuilder:Aa}),Or({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,P;switch(_){case"\\over":P="\\frac";break;case"\\choose":P="\\binom";break;case"\\atop":P="\\\\atopfrac";break;case"\\brace":P="\\\\bracefrac";break;case"\\brack":P="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:b.mode,replaceWith:P,token:w}}});var vu=["display","text","script","scriptscript"],Eo=function(m){var b=null;return m.length>0&&(b=m,b=b==="."?null:b),b};Or({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],P=b[5],U=br(b[0],"atom");U&&(U=qr(b[0],"open"));var oe=U?Eo(U.text):null,we=br(b[1],"atom");we&&(we=qr(b[1],"close"));var Be=we?Eo(we.text):null,at=ur(b[2],"size"),yt,Ot=null;at.isBlank?yt=!0:(Ot=at.value,yt=Ot.number>0);var Yt="auto",cr=br(b[3],"ordgroup");if(cr){if(cr.body.length>0){var xr=ur(cr.body[0],"textord");Yt=vu[Number(xr.text)]}}else cr=ur(b[3],"textord"),Yt=vu[Number(cr.text)];return{type:"genfrac",mode:_.mode,numer:w,denom:P,continued:!1,hasBarLine:yt,barSize:Ot,leftDelim:oe,rightDelim:Be,size:Yt}},htmlBuilder:Ka,mathmlBuilder:Aa}),Or({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(m,b){var _=m.parser,w=m.funcName,P=m.token;return{type:"infix",mode:_.mode,replaceWith:"\\\\abovefrac",size:ur(b[0],"size").value,token:P}}}),Or({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(m,b){var _=m.parser,w=m.funcName,P=b[0],U=se(ur(b[1],"infix").size),oe=b[2],we=U.number>0;return{type:"genfrac",mode:_.mode,numer:P,denom:oe,continued:!1,hasBarLine:we,barSize:U,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Ka,mathmlBuilder:Aa});var yu=function(m,b){var _=b.style,w,P,U=br(m,"supsub");U?(w=U.sup?Ri(U.sup,b.havingStyle(_.sup()),b):Ri(U.sub,b.havingStyle(_.sub()),b),P=ur(U.base,"horizBrace")):P=ur(m,"horizBrace");var oe=Ri(P.base,b.havingBaseStyle(D.DISPLAY)),we=Jr.svgSpan(P,b),Be;if(P.isOver?(Be=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:oe},{type:"kern",size:.1},{type:"elem",elem:we}]},b),Be.children[0].children[0].children[1].classes.push("svg-align")):(Be=je.makeVList({positionType:"bottom",positionData:oe.depth+.1+we.height,children:[{type:"elem",elem:we},{type:"kern",size:.1},{type:"elem",elem:oe}]},b),Be.children[0].children[0].children[0].classes.push("svg-align")),w){var at=je.makeSpan(["mord",P.isOver?"mover":"munder"],[Be],b);P.isOver?Be=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:at},{type:"kern",size:.2},{type:"elem",elem:w}]},b):Be=je.makeVList({positionType:"bottom",positionData:at.depth+.2+w.height+w.depth,children:[{type:"elem",elem:w},{type:"kern",size:.2},{type:"elem",elem:at}]},b)}return je.makeSpan(["mord",P.isOver?"mover":"munder"],[Be],b)},i0=function(m,b){var _=Jr.mathMLnode(m.label);return new ir.MathNode(m.isOver?"mover":"munder",[Oi(m.base,b),_])};Or({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:yu,mathmlBuilder:i0}),Or({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=b[1],P=ur(b[0],"url").url;return _.settings.isTrusted({command:"\\href",url:P})?{type:"href",mode:_.mode,href:P,body:Ui(w)}:_.formatUnsupportedCmd("\\href")},htmlBuilder:function(m,b){var _=$i(m.body,b,!1);return je.makeAnchor(m.href,[],_,b)},mathmlBuilder:function(m,b){var _=dn(m.body,b);return _ instanceof pi||(_=new pi("mrow",[_])),_.setAttribute("href",m.href),_}}),Or({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=ur(b[0],"url").url;if(!_.settings.isTrusted({command:"\\url",url:w}))return _.formatUnsupportedCmd("\\url");for(var P=[],U=0;U<w.length;U++){var oe=w[U];oe==="~"&&(oe="\\textasciitilde"),P.push({type:"textord",mode:"text",text:oe})}var we={type:"text",mode:_.mode,font:"\\texttt",body:P};return{type:"href",mode:_.mode,href:w,body:Ui(we)}}}),Or({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(m,b){var _=m.parser;return{type:"htmlmathml",mode:_.mode,html:Ui(b[0]),mathml:Ui(b[1])}},htmlBuilder:function(m,b){var _=$i(m.html,b,!1);return je.makeFragment(_)},mathmlBuilder:function(m,b){return dn(m.mathml,b)}});var tl=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 _};Or({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(m,b,_){var w=m.parser,P={number:0,unit:"em"},U={number:.9,unit:"em"},oe={number:0,unit:"em"},we="";if(_[0])for(var Be=ur(_[0],"raw").string,at=Be.split(","),yt=0;yt<at.length;yt++){var Ot=at[yt].split("=");if(Ot.length===2){var Yt=Ot[1].trim();switch(Ot[0].trim()){case"alt":we=Yt;break;case"width":P=tl(Yt);break;case"height":U=tl(Yt);break;case"totalheight":oe=tl(Yt);break;default:throw new E("Invalid key: '"+Ot[0]+"' in \\includegraphics.")}}}var cr=ur(b[0],"url").url;return we===""&&(we=cr,we=we.replace(/^.*[\\/]/,""),we=we.substring(0,we.lastIndexOf("."))),w.settings.isTrusted({command:"\\includegraphics",url:cr})?{type:"includegraphics",mode:w.mode,alt:we,width:P,height:U,totalheight:oe,src:cr}: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 P=0;m.width.number>0&&(P=tt(m.width,b));var U={height:_+w+"em"};P>0&&(U.width=P+"em"),w>0&&(U.verticalAlign=-w+"em");var oe=new Dt(m.src,m.alt,U);return oe.height=_,oe.depth=w,oe},mathmlBuilder:function(m,b){var _=new ir.MathNode("mglyph",[]);_.setAttribute("alt",m.alt);var w=tt(m.height,b),P=0;if(m.totalheight.number>0&&(P=tt(m.totalheight,b)-w,P=P.toFixed(2),_.setAttribute("valign","-"+P+"em")),_.setAttribute("height",w+P+"em"),m.width.number>0){var U=tt(m.width,b);_.setAttribute("width",U+"em")}return _.setAttribute("src",m.src),_}}),Or({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=m.funcName,P=ur(b[0],"size");if(_.settings.strict){var U=w[1]==="m",oe=P.value.unit==="mu";U?(oe||_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+w+" supports only mu units, "+("not "+P.value.unit+" units")),_.mode!=="math"&&_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+w+" works only in math mode")):oe&&_.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+w+" doesn't support mu units")}return{type:"kern",mode:_.mode,dimension:P.value}},htmlBuilder:function(m,b){return je.makeGlue(m.dimension,b)},mathmlBuilder:function(m,b){var _=tt(m.dimension,b);return new ir.SpaceNode(_)}}),Or({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(m,b){var _=m.parser,w=m.funcName,P=b[0];return{type:"lap",mode:_.mode,alignment:w.slice(5),body:P}},htmlBuilder:function(m,b){var _;m.alignment==="clap"?(_=je.makeSpan([],[Ri(m.body,b)]),_=je.makeSpan(["inner"],[_],b)):_=je.makeSpan(["inner"],[Ri(m.body,b)]);var w=je.makeSpan(["fix"],[]),P=je.makeSpan([m.alignment],[_,w],b),U=je.makeSpan(["strut"]);return U.style.height=P.height+P.depth+"em",U.style.verticalAlign=-P.depth+"em",P.children.unshift(U),P=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:P}]},b),je.makeSpan(["mord"],[P],b)},mathmlBuilder:function(m,b){var _=new ir.MathNode("mpadded",[Oi(m.body,b)]);if(m.alignment!=="rlap"){var w=m.alignment==="llap"?"-1":"-0.5";_.setAttribute("lspace",w+"width")}return _.setAttribute("width","0px"),_}}),Or({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(m,b){var _=m.funcName,w=m.parser,P=w.mode;w.switchMode("math");var U=_==="\\("?"\\)":"$",oe=w.parseExpression(!1,U);return w.expect(U),w.switchMode(P),{type:"styling",mode:w.mode,style:"text",body:oe}}}),Or({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(m,b){throw new E("Mismatched "+m.funcName)}});var rl=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}};Or({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(m,b){var _=m.parser;return{type:"mathchoice",mode:_.mode,display:Ui(b[0]),text:Ui(b[1]),script:Ui(b[2]),scriptscript:Ui(b[3])}},htmlBuilder:function(m,b){var _=rl(m,b),w=$i(_,b,!1);return je.makeFragment(w)},mathmlBuilder:function(m,b){var _=rl(m,b);return dn(_,b)}});var Ao=function(m,b,_,w,P,U,oe){m=je.makeSpan([],[m]);var we,Be;if(b){var at=Ri(b,w.havingStyle(P.sup()),w);Be={elem:at,kern:Math.max(w.fontMetrics().bigOpSpacing1,w.fontMetrics().bigOpSpacing3-at.depth)}}if(_){var yt=Ri(_,w.havingStyle(P.sub()),w);we={elem:yt,kern:Math.max(w.fontMetrics().bigOpSpacing2,w.fontMetrics().bigOpSpacing4-yt.height)}}var Ot;if(Be&&we){var Yt=w.fontMetrics().bigOpSpacing5+we.elem.height+we.elem.depth+we.kern+m.depth+oe;Ot=je.makeVList({positionType:"bottom",positionData:Yt,children:[{type:"kern",size:w.fontMetrics().bigOpSpacing5},{type:"elem",elem:we.elem,marginLeft:-U+"em"},{type:"kern",size:we.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(we){var cr=m.height-oe;Ot=je.makeVList({positionType:"top",positionData:cr,children:[{type:"kern",size:w.fontMetrics().bigOpSpacing5},{type:"elem",elem:we.elem,marginLeft:-U+"em"},{type:"kern",size:we.kern},{type:"elem",elem:m}]},w)}else if(Be){var xr=m.depth+oe;Ot=je.makeVList({positionType:"bottom",positionData:xr,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"],[Ot],w)},es=["\\smallint"],Ns=function(m,b){var _,w,P=!1,U,oe=br(m,"supsub");oe?(_=oe.sup,w=oe.sub,U=ur(oe.base,"op"),P=!0):U=ur(m,"op");var we=b.style,Be=!1;we.size===D.DISPLAY.size&&U.symbol&&!Z.contains(es,U.name)&&(Be=!0);var at;if(U.symbol){var yt=Be?"Size2-Regular":"Size1-Regular",Ot="";if((U.name==="\\oiint"||U.name==="\\oiiint")&&(Ot=U.name.substr(1),U.name=Ot==="oiint"?"\\iint":"\\iiint"),at=je.makeSymbol(U.name,yt,"math",b,["mop","op-symbol",Be?"large-op":"small-op"]),Ot.length>0){var Yt=at.italic,cr=je.staticSvg(Ot+"Size"+(Be?"2":"1"),b);at=je.makeVList({positionType:"individualShift",children:[{type:"elem",elem:at,shift:0},{type:"elem",elem:cr,shift:Be?.08:0}]},b),U.name="\\"+Ot,at.classes.unshift("mop"),at.italic=Yt}}else if(U.body){var xr=$i(U.body,b,!0);xr.length===1&&xr[0]instanceof Oe?(at=xr[0],at.classes[0]="mop"):at=je.makeSpan(["mop"],je.tryCombineChars(xr),b)}else{for(var qe=[],Ti=1;Ti<U.name.length;Ti++)qe.push(je.mathsym(U.name[Ti],U.mode,b));at=je.makeSpan(["mop"],qe,b)}var Mi=0,Bi=0;return(at instanceof Oe||U.name==="\\oiint"||U.name==="\\oiiint")&&!U.suppressBaseShift&&(Mi=(at.height-at.depth)/2-b.fontMetrics().axisHeight,Bi=at.italic),P?Ao(at,_,w,b,we,Bi,Mi):(Mi&&(at.style.position="relative",at.style.top=Mi+"em"),at)},Gs=function(m,b){var _;if(m.symbol)_=new pi("mo",[vn(m.name,m.mode)]),Z.contains(es,m.name)&&_.setAttribute("largeop","false");else if(m.body)_=new pi("mo",hn(m.body,b));else{_=new pi("mi",[new bs(m.name.slice(1))]);var w=new pi("mo",[vn("\u2061","text")]);m.parentIsSupSub?_=new pi("mo",[_,w]):_=us([_,w])}return _},bu={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Or({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,P=w;return P.length===1&&(P=bu[P]),{type:"op",mode:_.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:P}},htmlBuilder:Ns,mathmlBuilder:Gs}),Or({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:Ui(w)}},htmlBuilder:Ns,mathmlBuilder:Gs});var il={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Or({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:Ns,mathmlBuilder:Gs}),Or({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:Ns,mathmlBuilder:Gs}),Or({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=il[w]),{type:"op",mode:b.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:w}},htmlBuilder:Ns,mathmlBuilder:Gs});var _u=function(m,b){var _,w,P=!1,U,oe=br(m,"supsub");oe?(_=oe.sup,w=oe.sub,U=ur(oe.base,"operatorname"),P=!0):U=ur(m,"operatorname");var we;if(U.body.length>0){for(var Be=U.body.map(function(Yt){var cr=Yt.text;return typeof cr=="string"?{type:"textord",mode:Yt.mode,text:cr}:Yt}),at=$i(Be,b.withFont("mathrm"),!0),yt=0;yt<at.length;yt++){var Ot=at[yt];Ot instanceof Oe&&(Ot.text=Ot.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}we=je.makeSpan(["mop"],at,b)}else we=je.makeSpan(["mop"],[],b);return P?Ao(we,_,w,b,b.style,0,0):we},nl=function(m,b){for(var _=hn(m.body,b.withFont("mathrm")),w=!0,P=0;P<_.length;P++){var U=_[P];if(!(U instanceof ir.SpaceNode))if(U instanceof ir.MathNode)switch(U.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var oe=U.children[0];U.children.length===1&&oe instanceof ir.TextNode?oe.text=oe.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):w=!1;break}default:w=!1}else w=!1}if(w){var we=_.map(function(yt){return yt.toText()}).join("");_=[new ir.TextNode(we)]}var Be=new ir.MathNode("mi",_);Be.setAttribute("mathvariant","normal");var at=new ir.MathNode("mo",[vn("\u2061","text")]);return m.parentIsSupSub?new ir.MathNode("mo",[Be,at]):ir.newDocumentFragment([Be,at])};Or({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(m,b){var _=m.parser,w=m.funcName,P=b[0];return{type:"operatorname",mode:_.mode,body:Ui(P),alwaysHandleSupSub:w==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:_u,mathmlBuilder:nl}),Ai({type:"ordgroup",htmlBuilder:function(m,b){return m.semisimple?je.makeFragment($i(m.body,b,!1)):je.makeSpan(["mord"],$i(m.body,b,!0),b)},mathmlBuilder:function(m,b){return dn(m.body,b,!0)}}),Or({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 _=Ri(m.body,b.havingCrampedStyle()),w=je.makeLineSpan("overline-line",b),P=b.fontMetrics().defaultRuleThickness,U=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_},{type:"kern",size:3*P},{type:"elem",elem:w},{type:"kern",size:P}]},b);return je.makeSpan(["mord","overline"],[U],b)},mathmlBuilder:function(m,b){var _=new ir.MathNode("mo",[new ir.TextNode("\u203E")]);_.setAttribute("stretchy","true");var w=new ir.MathNode("mover",[Oi(m.body,b),_]);return w.setAttribute("accent","true"),w}}),Or({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:Ui(w)}},htmlBuilder:function(m,b){var _=$i(m.body,b.withPhantom(),!1);return je.makeFragment(_)},mathmlBuilder:function(m,b){var _=hn(m.body,b);return new ir.MathNode("mphantom",_)}}),Or({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([],[Ri(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 _=hn(Ui(m.body),b),w=new ir.MathNode("mphantom",_),P=new ir.MathNode("mpadded",[w]);return P.setAttribute("height","0px"),P.setAttribute("depth","0px"),P}}),Or({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"],[Ri(m.body,b.withPhantom())]),w=je.makeSpan(["fix"],[]);return je.makeSpan(["mord","rlap"],[_,w],b)},mathmlBuilder:function(m,b){var _=hn(Ui(m.body),b),w=new ir.MathNode("mphantom",_),P=new ir.MathNode("mpadded",[w]);return P.setAttribute("width","0px"),P}}),Or({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(m,b){var _=m.parser,w=ur(b[0],"size").value,P=b[1];return{type:"raisebox",mode:_.mode,dy:w,body:P}},htmlBuilder:function(m,b){var _=Ri(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 ir.MathNode("mpadded",[Oi(m.body,b)]),w=m.dy.number+m.dy.unit;return _.setAttribute("voffset",w),_}}),Or({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(m,b,_){var w=m.parser,P=_[0],U=ur(b[0],"size"),oe=ur(b[1],"size");return{type:"rule",mode:w.mode,shift:P&&ur(P,"size").value,width:U.value,height:oe.value}},htmlBuilder:function(m,b){var _=je.makeSpan(["mord","rule"],[],b),w=tt(m.width,b),P=tt(m.height,b),U=m.shift?tt(m.shift,b):0;return _.style.borderRightWidth=w+"em",_.style.borderTopWidth=P+"em",_.style.bottom=U+"em",_.width=w,_.height=P+U,_.depth=-U,_.maxFontSize=P*1.125*b.sizeMultiplier,_},mathmlBuilder:function(m,b){var _=tt(m.width,b),w=tt(m.height,b),P=m.shift?tt(m.shift,b):0,U=b.color&&b.getColor()||"black",oe=new ir.MathNode("mspace");oe.setAttribute("mathbackground",U),oe.setAttribute("width",_+"em"),oe.setAttribute("height",w+"em");var we=new ir.MathNode("mpadded",[oe]);return P>=0?we.setAttribute("height","+"+P+"em"):(we.setAttribute("height",P+"em"),we.setAttribute("depth","+"+-P+"em")),we.setAttribute("voffset",P+"em"),we}});function Il(K,m,b){for(var _=$i(K,m,!1),w=m.sizeMultiplier/b.sizeMultiplier,P=0;P<_.length;P++){var U=_[P].classes.indexOf("sizing");U<0?Array.prototype.push.apply(_[P].classes,m.sizingClasses(b)):_[P].classes[U+1]==="reset-size"+m.size&&(_[P].classes[U+1]="reset-size"+b.size),_[P].height*=w,_[P].depth*=w}return je.makeFragment(_)}var xu=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],wu=function(m,b){var _=b.havingSize(m.size);return Il(m.body,_,b)};Or({type:"sizing",names:xu,props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.breakOnTokenText,w=m.funcName,P=m.parser,U=P.parseExpression(!1,_);return{type:"sizing",mode:P.mode,size:xu.indexOf(w)+1,body:U}},htmlBuilder:wu,mathmlBuilder:function(m,b){var _=b.havingSize(m.size),w=hn(m.body,_),P=new ir.MathNode("mstyle",w);return P.setAttribute("mathsize",_.sizeMultiplier+"em"),P}}),Or({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(m,b,_){var w=m.parser,P=!1,U=!1,oe=_[0]&&ur(_[0],"ordgroup");if(oe)for(var we="",Be=0;Be<oe.body.length;++Be){var at=oe.body[Be];if(we=at.text,we==="t")P=!0;else if(we==="b")U=!0;else{P=!1,U=!1;break}}else P=!0,U=!0;var yt=b[0];return{type:"smash",mode:w.mode,body:yt,smashHeight:P,smashDepth:U}},htmlBuilder:function(m,b){var _=je.makeSpan([],[Ri(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 P=0;P<_.children.length;P++)_.children[P].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 ir.MathNode("mpadded",[Oi(m.body,b)]);return m.smashHeight&&_.setAttribute("height","0px"),m.smashDepth&&_.setAttribute("depth","0px"),_}}),Or({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(m,b,_){var w=m.parser,P=_[0],U=b[0];return{type:"sqrt",mode:w.mode,body:U,index:P}},htmlBuilder:function(m,b){var _=Ri(m.body,b.havingCrampedStyle());_.height===0&&(_.height=b.fontMetrics().xHeight),_=je.wrapFragment(_,b);var w=b.fontMetrics(),P=w.defaultRuleThickness,U=P;b.style.id<D.TEXT.id&&(U=b.fontMetrics().xHeight);var oe=P+U/4,we=_.height+_.depth+oe+P,Be=Cs.sqrtImage(we,b),at=Be.span,yt=Be.ruleWidth,Ot=Be.advanceWidth,Yt=at.height-yt;Yt>_.height+_.depth+oe&&(oe=(oe+Yt-_.height-_.depth)/2);var cr=at.height-_.height-oe-yt;_.style.paddingLeft=Ot+"em";var xr=je.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:_,wrapperClasses:["svg-align"]},{type:"kern",size:-(_.height+cr)},{type:"elem",elem:at},{type:"kern",size:yt}]},b);if(m.index){var qe=b.havingStyle(D.SCRIPTSCRIPT),Ti=Ri(m.index,qe,b),Mi=.6*(xr.height-xr.depth),Bi=je.makeVList({positionType:"shift",positionData:-Mi,children:[{type:"elem",elem:Ti}]},b),an=je.makeSpan(["root"],[Bi]);return je.makeSpan(["mord","sqrt"],[an,xr],b)}else return je.makeSpan(["mord","sqrt"],[xr],b)},mathmlBuilder:function(m,b){var _=m.body,w=m.index;return w?new ir.MathNode("mroot",[Oi(_,b),Oi(w,b)]):new ir.MathNode("msqrt",[Oi(_,b)])}});var Pl={display:D.DISPLAY,text:D.TEXT,script:D.SCRIPT,scriptscript:D.SCRIPTSCRIPT};Or({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(m,b){var _=m.breakOnTokenText,w=m.funcName,P=m.parser,U=P.parseExpression(!0,_),oe=w.slice(1,w.length-5);return{type:"styling",mode:P.mode,style:oe,body:U}},htmlBuilder:function(m,b){var _=Pl[m.style],w=b.havingStyle(_).withFont("");return Il(m.body,w,b)},mathmlBuilder:function(m,b){var _=Pl[m.style],w=b.havingStyle(_),P=hn(m.body,w),U=new ir.MathNode("mstyle",P),oe={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},we=oe[m.style];return U.setAttribute("scriptlevel",we[0]),U.setAttribute("displaystyle",we[1]),U}});var Ol=function(m,b){var _=m.base;if(_)if(_.type==="op"){var w=_.limits&&(b.style.size===D.DISPLAY.size||_.alwaysHandleSupSub);return w?Ns:null}else if(_.type==="operatorname"){var P=_.alwaysHandleSupSub&&(b.style.size===D.DISPLAY.size||_.limits);return P?_u:null}else{if(_.type==="accent")return Z.isCharacterBox(_.base)?_n:null;if(_.type==="horizBrace"){var U=!m.sub;return U===_.isOver?yu:null}else return null}else return null};Ai({type:"supsub",htmlBuilder:function(m,b){var _=Ol(m,b);if(_)return _(m,b);var w=m.base,P=m.sup,U=m.sub,oe=Ri(w,b),we,Be,at=b.fontMetrics(),yt=0,Ot=0,Yt=w&&Z.isCharacterBox(w);if(P){var cr=b.havingStyle(b.style.sup());we=Ri(P,cr,b),Yt||(yt=oe.height-cr.fontMetrics().supDrop*cr.sizeMultiplier/b.sizeMultiplier)}if(U){var xr=b.havingStyle(b.style.sub());Be=Ri(U,xr,b),Yt||(Ot=oe.depth+xr.fontMetrics().subDrop*xr.sizeMultiplier/b.sizeMultiplier)}var qe;b.style===D.DISPLAY?qe=at.sup1:b.style.cramped?qe=at.sup3:qe=at.sup2;var Ti=b.sizeMultiplier,Mi=.5/at.ptPerEm/Ti+"em",Bi=null;if(Be){var an=m.base&&m.base.type==="op"&&m.base.name&&(m.base.name==="\\oiint"||m.base.name==="\\oiiint");(oe instanceof Oe||an)&&(Bi=-oe.italic+"em")}var fn;if(we&&Be){yt=Math.max(yt,qe,we.depth+.25*at.xHeight),Ot=Math.max(Ot,at.sub2);var Cn=at.defaultRuleThickness,Dn=4*Cn;if(yt-we.depth-(Be.height-Ot)<Dn){Ot=Dn-(yt-we.depth)+Be.height;var Zn=.8*at.xHeight-(yt-we.depth);Zn>0&&(yt+=Zn,Ot-=Zn)}var ms=[{type:"elem",elem:Be,shift:Ot,marginRight:Mi,marginLeft:Bi},{type:"elem",elem:we,shift:-yt,marginRight:Mi}];fn=je.makeVList({positionType:"individualShift",children:ms},b)}else if(Be){Ot=Math.max(Ot,at.sub1,Be.height-.8*at.xHeight);var Fn=[{type:"elem",elem:Be,marginLeft:Bi,marginRight:Mi}];fn=je.makeVList({positionType:"shift",positionData:Ot,children:Fn},b)}else if(we)yt=Math.max(yt,qe,we.depth+.25*at.xHeight),fn=je.makeVList({positionType:"shift",positionData:-yt,children:[{type:"elem",elem:we,marginRight:Mi}]},b);else throw new Error("supsub must have either sup or sub.");var pn=Jn(oe,"right")||"mord";return je.makeSpan([pn],[oe,je.makeSpan(["msupsub"],[fn])],b)},mathmlBuilder:function(m,b){var _=!1,w,P,U=br(m.base,"horizBrace");U&&(P=!!m.sup,P===U.isOver&&(_=!0,w=U.isOver)),m.base&&(m.base.type==="op"||m.base.type==="operatorname")&&(m.base.parentIsSupSub=!0);var oe=[Oi(m.base,b)];m.sub&&oe.push(Oi(m.sub,b)),m.sup&&oe.push(Oi(m.sup,b));var we;if(_)we=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)?we="munderover":we="msubsup"}else{var at=m.base;at&&at.type==="op"&&at.limits&&(b.style===D.DISPLAY||at.alwaysHandleSupSub)||at&&at.type==="operatorname"&&at.alwaysHandleSupSub&&(at.limits||b.style===D.DISPLAY)?we="munder":we="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)?we="mover":we="msup"}var Ot=new ir.MathNode(we,oe);return Ot}}),Ai({type:"atom",htmlBuilder:function(m,b){return je.mathsym(m.text,m.mode,b,["m"+m.family])},mathmlBuilder:function(m,b){var _=new ir.MathNode("mo",[vn(m.text,m.mode)]);if(m.family==="bin"){var w=cs(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 Bl={mi:"italic",mn:"normal",mtext:"normal"};Ai({type:"mathord",htmlBuilder:function(m,b){return je.makeOrd(m,b,"mathord")},mathmlBuilder:function(m,b){var _=new ir.MathNode("mi",[vn(m.text,m.mode,b)]),w=cs(m,b)||"italic";return w!==Bl[_.type]&&_.setAttribute("mathvariant",w),_}}),Ai({type:"textord",htmlBuilder:function(m,b){return je.makeOrd(m,b,"textord")},mathmlBuilder:function(m,b){var _=vn(m.text,m.mode,b),w=cs(m,b)||"normal",P;return m.mode==="text"?P=new ir.MathNode("mtext",[_]):/[0-9]/.test(m.text)?P=new ir.MathNode("mn",[_]):m.text==="\\prime"?P=new ir.MathNode("mo",[_]):P=new ir.MathNode("mi",[_]),w!==Bl[P.type]&&P.setAttribute("mathvariant",w),P}});var Fl={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},sl={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ai({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(Fl.hasOwnProperty(m.text))return je.makeSpan(["mspace",Fl[m.text]],[],b);throw new E('Unknown type of space "'+m.text+'"')}},mathmlBuilder:function(m,b){var _;if(sl.hasOwnProperty(m.text))_=new ir.MathNode("mtext",[new ir.TextNode("\xA0")]);else{if(Fl.hasOwnProperty(m.text))return new ir.MathNode("mspace");throw new E('Unknown type of space "'+m.text+'"')}return _}});var Nl=function(){var m=new ir.MathNode("mtd",[]);return m.setAttribute("width","50%"),m};Ai({type:"tag",mathmlBuilder:function(m,b){var _=new ir.MathNode("mtable",[new ir.MathNode("mtr",[Nl(),new ir.MathNode("mtd",[dn(m.body,b)]),Nl(),new ir.MathNode("mtd",[dn(m.tag,b)])])]);return _.setAttribute("width","100%"),_}});var la={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$l={"\\textbf":"textbf","\\textmd":"textmd"},zl={"\\textit":"textit","\\textup":"textup"},Su=function(m,b){var _=m.font;return _?la[_]?b.withTextFontFamily(la[_]):$l[_]?b.withTextFontWeight($l[_]):b.withTextFontShape(zl[_]):b};Or({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,P=b[0];return{type:"text",mode:_.mode,body:Ui(P),font:w}},htmlBuilder:function(m,b){var _=Su(m,b),w=$i(m.body,_,!0);return je.makeSpan(["mord","text"],je.tryCombineChars(w),_)},mathmlBuilder:function(m,b){var _=Su(m,b);return dn(m.body,_)}}),Or({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 _=Ri(m.body,b),w=je.makeLineSpan("underline-line",b),P=b.fontMetrics().defaultRuleThickness,U=je.makeVList({positionType:"top",positionData:_.height,children:[{type:"kern",size:P},{type:"elem",elem:w},{type:"kern",size:3*P},{type:"elem",elem:_}]},b);return je.makeSpan(["mord","underline"],[U],b)},mathmlBuilder:function(m,b){var _=new ir.MathNode("mo",[new ir.TextNode("\u203E")]);_.setAttribute("stretchy","true");var w=new ir.MathNode("munder",[Oi(m.body,b),_]);return w.setAttribute("accentunder","true"),w}}),Or({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 _=Eu(m),w=[],P=b.havingStyle(b.style.text()),U=0;U<_.length;U++){var oe=_[U];oe==="~"&&(oe="\\textasciitilde"),w.push(je.makeSymbol(oe,"Typewriter-Regular",m.mode,P,["mord","texttt"]))}return je.makeSpan(["mord","text"].concat(P.sizingClasses(b)),je.tryCombineChars(w),P)},mathmlBuilder:function(m,b){var _=new ir.TextNode(Eu(m)),w=new ir.MathNode("mtext",[_]);return w.setAttribute("mathvariant","monospace"),w}});var Eu=function(m){return m.body.replace(/ /g,m.star?"\u2423":"\xA0")},n0=Xn,Ha=n0,al=`[ \r
]`,Au="\\\\[a-zA-Z@]+",s0="\\\\[^\uD800-\uDFFF]",a0=""+Au+al+"*",o0=new RegExp("^("+Au+")"+al+"*$"),Ul="[\u0300-\u036F]",ol=new RegExp(Ul+"+$"),fa="("+al+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(Ul+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Ul+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+a0)+("|"+s0+")"),ll=function(){function K(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(fa,"g"),this.catcodes={"%":14}}var m=K.prototype;return m.setCatcode=function(_,w){this.catcodes[_]=w},m.lex=function(){var _=this.input,w=this.tokenRegex.lastIndex;if(w===_.length)return new Me("EOF",new rt(this,w,w));var P=this.tokenRegex.exec(_);if(P===null||P.index!==w)throw new E("Unexpected character: '"+_[w]+"'",new Me(_[w],new rt(this,w,w+1)));var U=P[2]||" ";if(this.catcodes[U]===14){var oe=_.indexOf(`
`,this.tokenRegex.lastIndex);return oe===-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=oe+1,this.lex()}var we=U.match(o0);return we&&(U=we[1]),new Me(U,new rt(this,w,this.tokenRegex.lastIndex))},K}(),pa=function(){function K(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=K.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,P){if(P===void 0&&(P=!1),P){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 oe=this.undefStack[this.undefStack.length-1];oe&&!oe.hasOwnProperty(_)&&(oe[_]=this.current[_])}this.current[_]=w},K}(),ku={},ul=ku;function ke(K,m){ku[K]=m}ke("\\@firstoftwo",function(K){var m=K.consumeArgs(2);return{tokens:m[0],numArgs:0}}),ke("\\@secondoftwo",function(K){var m=K.consumeArgs(2);return{tokens:m[1],numArgs:0}}),ke("\\@ifnextchar",function(K){var m=K.consumeArgs(3),b=K.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(K){var m=K.consumeArgs(2);return K.mode==="text"?{tokens:m[0],numArgs:0}:{tokens:m[1],numArgs:0}});var Qs={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(K){var m=K.popToken(),b,_="";if(m.text==="'")b=8,m=K.popToken();else if(m.text==='"')b=16,m=K.popToken();else if(m.text==="`")if(m=K.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(_=Qs[m.text],_==null||_>=b)throw new E("Invalid base-"+b+" digit "+m.text);for(var w;(w=Qs[K.future().text])!=null&&w<b;)_*=b,_+=w,K.popToken()}return"\\@char{"+_+"}"});var no=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,P=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(P++,parseInt(_[0].text)!==P)throw new E('Argument number "'+_[0].text+'" out of order');_=m.consumeArgs(1)[0]}return m.macros.set(w,{tokens:_,numArgs:P},b),""};ke("\\gdef",function(K){return no(K,!0)}),ke("\\def",function(K){return no(K,!1)}),ke("\\global",function(K){var m=K.consumeArgs(1)[0];if(m.length!==1)throw new E("Invalid command after \\global");var b=m[0].text;if(b==="\\def")return no(K,!0);throw new E("Invalid command '"+b+"' after \\global")});var Kl=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 P=w[0].text,U=m.isDefined(P);if(U&&!b)throw new E("\\newcommand{"+P+"} attempting to redefine "+(P+"; use \\renewcommand"));if(!U&&!_)throw new E("\\renewcommand{"+P+"} when command "+P+" does not yet exist; use \\newcommand");var oe=0;if(w=m.consumeArgs(1)[0],w.length===1&&w[0].text==="["){for(var we="",Be=m.expandNextToken();Be.text!=="]"&&Be.text!=="EOF";)we+=Be.text,Be=m.expandNextToken();if(!we.match(/^\s*[0-9]+\s*$/))throw new E("Invalid number of arguments: "+we);oe=parseInt(we),w=m.consumeArgs(1)[0]}return m.macros.set(P,{tokens:w,numArgs:oe}),""};ke("\\newcommand",function(K){return Kl(K,!1,!0)}),ke("\\renewcommand",function(K){return Kl(K,!0,!1)}),ke("\\providecommand",function(K){return Kl(K,!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 ko={",":"\\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(K){var m="\\dotso",b=K.expandAfterFuture().text;return b in ko?m=ko[b]:(b.substr(0,4)==="\\not"||b in tr.math&&Z.contains(["bin","rel"],tr.math[b].group))&&(m="\\dotsb"),m});var Hl={")":!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(K){var m=K.future().text;return m in Hl?"\\ldots\\,":"\\ldots"}),ke("\\dotsc",function(K){var m=K.future().text;return m in Hl&&m!==","?"\\ldots\\,":"\\ldots"}),ke("\\cdots",function(K){var m=K.future().text;return m in Hl?"\\@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(K){if(K.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 Tu=Jt["Main-Regular"][84][1]-.7*Jt["Main-Regular"][65][1]+"em";ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Tu+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Tu+"}{\\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 Cu={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},l0=function(){function K(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 pa(ul,_.macros),this.mode=w,this.stack=[]}var m=K.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=[],P=0;P<_;++P){this.consumeSpaces();var U=this.popToken();if(U.text==="{"){for(var oe=[],we=1;we!==0;){var Be=this.popToken();if(oe.push(Be),Be.text==="{")++we;else if(Be.text==="}")--we;else if(Be.text==="EOF")throw new E("End of input in macro argument",U)}oe.pop(),oe.reverse(),w[P]=oe}else{if(U.text==="EOF")throw new E("End of input expecting macro argument");w[P]=[U]}}return w},m.expandOnce=function(){var _=this.popToken(),w=_.text,P=this._getExpansion(w);if(P==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=P.tokens;if(P.numArgs){var oe=this.consumeArgs(P.numArgs);U=U.slice();for(var we=U.length-1;we>=0;--we){var Be=U[we];if(Be.text==="#"){if(we===0)throw new E("Incomplete placeholder at end of macro body",Be);if(Be=U[--we],Be.text==="#")U.splice(we+1,1);else if(/^[1-9]$/.test(Be.text)){var at;(at=U).splice.apply(at,[we,2].concat(oe[+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 Me)if(_.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},m.expandMacro=function(_){if(this.macros.get(_)){var w=[],P=this.stack.length;for(this.pushToken(new Me(_));this.stack.length>P;){var U=this.expandOnce();U instanceof Me&&w.push(this.stack.pop())}return w}},m.expandMacroAsText=function(_){var w=this.expandMacro(_);return w&&w.map(function(P){return P.text}).join("")},m._getExpansion=function(_){var w=this.macros.get(_);if(w==null)return w;var P=typeof w=="function"?w(this):w;if(typeof P=="string"){var U=0;if(P.indexOf("#")!==-1)for(var oe=P.replace(/##/g,"");oe.indexOf("#"+(U+1))!==-1;)++U;for(var we=new ll(P,this.settings),Be=[],at=we.lex();at.text!=="EOF";)Be.push(at),at=we.lex();Be.reverse();var yt={tokens:Be,numArgs:U};return yt}return P},m.isDefined=function(_){return this.macros.has(_)||Ha.hasOwnProperty(_)||tr.math.hasOwnProperty(_)||tr.text.hasOwnProperty(_)||Cu.hasOwnProperty(_)},K}(),Gl={"\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"}},Vl={\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"},so=function(){function K(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 l0(b,_,this.mode),this.settings=_,this.leftrightDepth=0}var m=K.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 P=[];;){this.mode==="math"&&this.consumeSpaces();var U=this.fetch();if(K.endOfExpression.indexOf(U.text)!==-1||w&&U.text===w||_&&Ha[U.text]&&Ha[U.text].infix)break;var oe=this.parseAtom(w);if(!oe)break;P.push(oe)}return this.mode==="text"&&this.formLigatures(P),this.handleInfixNodes(P)},m.handleInfixNodes=function(_){for(var w=-1,P,U=0;U<_.length;U++){var oe=br(_[U],"infix");if(oe){if(w!==-1)throw new E("only one infix operator per group",oe.token);w=U,P=oe.replaceWith}}if(w!==-1&&P){var we,Be,at=_.slice(0,w),yt=_.slice(w+1);at.length===1&&at[0].type==="ordgroup"?we=at[0]:we={type:"ordgroup",mode:this.mode,body:at},yt.length===1&&yt[0].type==="ordgroup"?Be=yt[0]:Be={type:"ordgroup",mode:this.mode,body:yt};var Ot;return P==="\\\\abovefrac"?Ot=this.callFunction(P,[we,_[w],Be],[]):Ot=this.callFunction(P,[we,Be],[]),[Ot]}else return _},m.handleSupSubscript=function(_){var w=this.fetch(),P=w.text;this.consume();var U=this.parseGroup(_,!1,K.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!U)throw new E("Expected group after '"+P+"'",w);return U},m.formatUnsupportedCmd=function(_){for(var w=[],P=0;P<_.length;P++)w.push({type:"textord",mode:"text",text:_[P]});var U={type:"text",mode:this.mode,body:w},oe={type:"color",mode:this.mode,color:this.settings.errorColor,body:[U]};return oe},m.parseAtom=function(_){var w=this.parseGroup("atom",!1,null,_);if(this.mode==="text")return w;for(var P,U;;){this.consumeSpaces();var oe=this.fetch();if(oe.text==="\\limits"||oe.text==="\\nolimits"){var we=br(w,"op");if(we){var Be=oe.text==="\\limits";we.limits=Be,we.alwaysHandleSupSub=!0}else if(we=br(w,"operatorname"),we&&we.alwaysHandleSupSub){var at=oe.text==="\\limits";we.limits=at}else throw new E("Limit controls must follow a math operator",oe);this.consume()}else if(oe.text==="^"){if(P)throw new E("Double superscript",oe);P=this.handleSupSubscript("superscript")}else if(oe.text==="_"){if(U)throw new E("Double subscript",oe);U=this.handleSupSubscript("subscript")}else if(oe.text==="'"){if(P)throw new E("Double superscript",oe);var yt={type:"textord",mode:this.mode,text:"\\prime"},Ot=[yt];for(this.consume();this.fetch().text==="'";)Ot.push(yt),this.consume();this.fetch().text==="^"&&Ot.push(this.handleSupSubscript("superscript")),P={type:"ordgroup",mode:this.mode,body:Ot}}else break}return P||U?{type:"supsub",mode:this.mode,base:w,sup:P,sub:U}:w},m.parseFunction=function(_,w,P){var U=this.fetch(),oe=U.text,we=Ha[oe];if(!we)return null;if(this.consume(),P!=null&&we.greediness<=P)throw new E("Got function '"+oe+"' with no arguments"+(w?" as "+w:""),U);if(this.mode==="text"&&!we.allowedInText)throw new E("Can't use function '"+oe+"' in text mode",U);if(this.mode==="math"&&we.allowedInMath===!1)throw new E("Can't use function '"+oe+"' in math mode",U);var Be=this.parseArguments(oe,we),at=Be.args,yt=Be.optArgs;return this.callFunction(oe,at,yt,U,_)},m.callFunction=function(_,w,P,U,oe){var we={funcName:_,parser:this,token:U,breakOnTokenText:oe},Be=Ha[_];if(Be&&Be.handler)return Be.handler(we,w,P);throw new E("No function handler for "+_)},m.parseArguments=function(_,w){var P=w.numArgs+w.numOptionalArgs;if(P===0)return{args:[],optArgs:[]};for(var U=w.greediness,oe=[],we=[],Be=0;Be<P;Be++){var at=w.argTypes&&w.argTypes[Be],yt=Be<w.numOptionalArgs,Ot=Be>0&&!yt||Be===0&&!yt&&this.mode==="math",Yt=this.parseGroupOfType("argument to '"+_+"'",at,yt,U,Ot);if(!Yt){if(yt){we.push(null);continue}throw new E("Expected group after '"+_+"'",this.fetch())}(yt?we:oe).push(Yt)}return{args:oe,optArgs:we}},m.parseGroupOfType=function(_,w,P,U,oe){switch(w){case"color":return oe&&this.consumeSpaces(),this.parseColorGroup(P);case"size":return oe&&this.consumeSpaces(),this.parseSizeGroup(P);case"url":return this.parseUrlGroup(P,oe);case"math":case"text":return this.parseGroup(_,P,U,void 0,w,oe);case"hbox":{var we=this.parseGroup(_,P,U,void 0,"text",oe);if(!we)return we;var Be={type:"styling",mode:we.mode,body:[we],style:"text"};return Be}case"raw":{if(oe&&this.consumeSpaces(),P&&this.fetch().text==="{")return null;var at=this.parseStringGroup("raw",P,!0);if(at)return{type:"raw",mode:"text",string:at.text};throw new E("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(_,P,U,void 0,void 0,oe);default:throw new E("Unknown group type as "+_,this.fetch())}},m.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},m.parseStringGroup=function(_,w,P){var U=w?"[":"{",oe=w?"]":"}",we=this.fetch();if(we.text!==U){if(w)return null;if(P&&we.text!=="EOF"&&/[^{}[\]]/.test(we.text))return this.consume(),we}var Be=this.mode;this.mode="text",this.expect(U);for(var at="",yt=this.fetch(),Ot=0,Yt=yt,cr;(cr=this.fetch()).text!==oe||P&&Ot>0;){switch(cr.text){case"EOF":throw new E("Unexpected end of input in "+_,yt.range(Yt,at));case U:Ot++;break;case oe:Ot--;break}Yt=cr,at+=Yt.text,this.consume()}return this.expect(oe),this.mode=Be,yt.range(Yt,at)},m.parseRegexGroup=function(_,w){var P=this.mode;this.mode="text";for(var U=this.fetch(),oe=U,we="",Be;(Be=this.fetch()).text!=="EOF"&&_.test(we+Be.text);)oe=Be,we+=oe.text,this.consume();if(we==="")throw new E("Invalid "+w+": '"+U.text+"'",U);return this.mode=P,U.range(oe,we)},m.parseColorGroup=function(_){var w=this.parseStringGroup("color",_);if(!w)return null;var P=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(w.text);if(!P)throw new E("Invalid color: '"+w.text+"'",w);var U=P[0];return/^[0-9a-f]{6}$/i.test(U)&&(U="#"+U),{type:"color-token",mode:this.mode,color:U}},m.parseSizeGroup=function(_){var w,P=!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",P=!0);var U=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(w.text);if(!U)throw new E("Invalid size: '"+w.text+"'",w);var oe={number:+(U[1]+U[2]),unit:U[3]};if(!lt(oe))throw new E("Invalid unit: '"+oe.unit+"'",w);return{type:"size",mode:this.mode,value:oe,isBlank:P}},m.parseUrlGroup=function(_,w){this.gullet.lexer.setCatcode("%",13);var P=this.parseStringGroup("url",_,!0);if(this.gullet.lexer.setCatcode("%",14),!P)return null;var U=P.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:U}},m.parseGroup=function(_,w,P,U,oe,we){var Be=this.mode;oe&&this.switchMode(oe),we&&this.consumeSpaces();var at=this.fetch(),yt=at.text,Ot;if(w?yt==="[":yt==="{"||yt==="\\begingroup"){this.consume();var Yt=K.endOfGroup[yt];this.gullet.beginGroup();var cr=this.parseExpression(!1,Yt),xr=this.fetch();this.expect(Yt),this.gullet.endGroup(),Ot={type:"ordgroup",mode:this.mode,loc:rt.range(at,xr),body:cr,semisimple:yt==="\\begingroup"||void 0}}else if(w)Ot=null;else if(Ot=this.parseFunction(U,_,P)||this.parseSymbol(),Ot==null&&yt[0]==="\\"&&!Cu.hasOwnProperty(yt)){if(this.settings.throwOnError)throw new E("Undefined control sequence: "+yt,at);Ot=this.formatUnsupportedCmd(yt),this.consume()}return oe&&this.switchMode(Be),Ot},m.formLigatures=function(_){for(var w=_.length-1,P=0;P<w;++P){var U=_[P],oe=U.text;oe==="-"&&_[P+1].text==="-"&&(P+1<w&&_[P+2].text==="-"?(_.splice(P,3,{type:"textord",mode:"text",loc:rt.range(U,_[P+2]),text:"---"}),w-=2):(_.splice(P,2,{type:"textord",mode:"text",loc:rt.range(U,_[P+1]),text:"--"}),w-=1)),(oe==="'"||oe==="`")&&_[P+1].text===oe&&(_.splice(P,2,{type:"textord",mode:"text",loc:rt.range(U,_[P+1]),text:oe+oe}),w-=1)}},m.parseSymbol=function(){var _=this.fetch(),w=_.text;if(/^\\verb[^a-zA-Z]/.test(w)){this.consume();var P=w.slice(5),U=P.charAt(0)==="*";if(U&&(P=P.slice(1)),P.length<2||P.charAt(0)!==P.slice(-1))throw new E(`\\verb assertion failed --
please report what input caused this bug`);return P=P.slice(1,-1),{type:"verb",mode:"text",body:P,star:U}}Vl.hasOwnProperty(w[0])&&!tr[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=Vl[w[0]]+w.substr(1));var oe=ol.exec(w);oe&&(w=w.substring(0,oe.index),w==="i"?w="\u0131":w==="j"&&(w="\u0237"));var we;if(tr[this.mode][w]){this.settings.strict&&this.mode==="math"&&Pr.indexOf(w)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+w[0]+'" used in math mode',_);var Be=tr[this.mode][w].group,at=rt.range(_),yt;if(Rt.hasOwnProperty(Be)){var Ot=Be;yt={type:"atom",mode:this.mode,family:Ot,loc:at,text:w}}else yt={type:Be,mode:this.mode,loc:at,text:w};we=yt}else if(w.charCodeAt(0)>=128)this.settings.strict&&(st(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)+")"),_)),we={type:"textord",mode:"text",loc:rt.range(_),text:w};else return null;if(this.consume(),oe)for(var Yt=0;Yt<oe[0].length;Yt++){var cr=oe[0][Yt];if(!Gl[cr])throw new E("Unknown accent ' "+cr+"'",_);var xr=Gl[cr][this.mode];if(!xr)throw new E("Accent "+cr+" unsupported in "+this.mode+" mode",_);we={type:"accent",mode:this.mode,loc:rt.range(_),label:xr,isStretchy:!1,isShifty:!0,base:we}}return we},K}();so.endOfExpression=["}","\\endgroup","\\end","\\right","&"],so.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},so.SUPSUB_GREEDINESS=1;var cl=function(m,b){if(!(typeof m=="string"||m instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var _=new so(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},Wl=cl,jl=function(m,b,_){b.textContent="";var w=ka(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."),jl=function(){throw new E("KaTeX doesn't work in quirks mode.")});var u0=function(m,b){var _=ka(m,b).toMarkup();return _},Du=function(m,b){var _=new j(b);return Wl(m,_)},Mu=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},ka=function(m,b){var _=new j(b);try{var w=Wl(m,_);return Bn(w,m,_)}catch(P){return Mu(P,m,_)}},To=function(m,b){var _=new j(b);try{var w=Wl(m,_);return kn(w,m,_)}catch(P){return Mu(P,m,_)}},Lu={version:"0.11.1",render:jl,renderToString:u0,ParseError:E,__parse:Du,__renderToDomTree:ka,__renderToHTMLTree:To,__setFontMetrics:wr,__defineSymbol:T,__defineMacro:ke,__domTree:{Span:Qe,Anchor:Ct,SymbolNode:Oe,SvgNode:et,PathNode:vt,LineNode:wt}},Q0=X.default=Lu}]).default})},32834:function($r){(function(It,X){$r.exports=X()})(this,function(){"use strict";function It(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 X(Ne,He,Je){return He&&It(Ne.prototype,He),Je&&It(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 Me={exports:{}};function re(){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){Me.exports.defaults=Ne}Me.exports={defaults:re(),getDefaults:re,changeDefaults:E};var Re=/[&<>"']/,N=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,xe=/[<>"']|&(?!#?\w+;)/g,q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},k=function(He){return q[He]};function I(Ne,He){if(He){if(Re.test(Ne))return Ne.replace(N,k)}else if(d.test(Ne))return Ne.replace(xe,k);return Ne}var O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(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,Ee){return Ee=Ee.source||Ee,Ee=Ee.replace(se,"$1"),Ne=Ne.replace(ge,Ee),Je},getRegex:function(){return new RegExp(Ne,He)}};return Je}var Z=/[^\w:]/g,j=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Y(Ne,He,Je){if(Ne){var W;try{W=decodeURIComponent(H(Je)).replace(Z,"").toLowerCase()}catch(ge){return null}if(W.indexOf("javascript:")===0||W.indexOf("vbscript:")===0||W.indexOf("data:")===0)return null}He&&!j.test(Je)&&(Je=ve(He,Je));try{Je=encodeURI(Je).replace(/%25/g,"%")}catch(ge){return null}return Je}var ue={},ee=/^[^:]+:\/*[^/]*$/,le=/^([^:]+:)[\s\S]*$/,De=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ve(Ne,He){ue[" "+Ne]||(ee.test(Ne)?ue[" "+Ne]=Ne+"/":ue[" "+Ne]=gt(Ne,"/",!0)),Ne=ue[" "+Ne];var Je=Ne.indexOf(":")===-1;return He.substring(0,2)==="//"?Je?He:Ne.replace(le,"$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(Ee,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 gt(Ne,He,Je){var W=Ne.length;if(W===0)return"";for(var ge=0;ge<W;){var Ee=Ne.charAt(W-ge-1);if(Ee===He&&!Je)ge++;else if(Ee!==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 ie(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:I,unescape:H,edit:ae,cleanUrl:Y,resolveUrl:ve,noopTest:Ye,merge:We,splitCells:ut,rtrim:gt,findClosingBracket:de,checkSanitizeDeprecation:ie,repeatString:ce},Le=Me.exports.defaults,Se=he.rtrim,D=he.splitCells,M=he.escape,ne=he.findClosingBracket;function be(Ne,He,Je){var W=He.href,ge=He.title?M(He.title):null,Ee=Ne[1].replace(/\\([\[\]])/g,"$1");return Ne[0].charAt(0)!=="!"?{type:"link",raw:Je,href:W,title:ge,text:Ee}:{type:"image",raw:Je,href:W,title:ge,text:M(Ee)}}function st(Ne,He){var Je=Ne.match(/^(\s+)(?:```)/);if(Je===null)return He;var W=Je[1];return He.split(`
`).map(function(ge){var Ee=ge.match(/^\s+/);if(Ee===null)return ge;var Ke=Ee[0];return Ke.length>=W.length?ge.slice(W.length):ge}).join(`
`)}var ot=function(){function Ne(Je){this.options=Je||Le}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 Ee=ge[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ge[0],codeBlockStyle:"indented",text:this.options.pedantic?Ee:Se(Ee,`
`)}}},He.fences=function(W){var ge=this.rules.block.fences.exec(W);if(ge){var Ee=ge[0],Ke=st(Ee,ge[3]||"");return{type:"code",raw:Ee,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 Ee=ge[2].trim();if(/#$/.test(Ee)){var Ke=Se(Ee,"#");(this.options.pedantic||!Ke||/ $/.test(Ke))&&(Ee=Ke.trim())}return{type:"heading",raw:ge[0],depth:ge[1].length,text:Ee}}},He.nptable=function(W){var ge=this.rules.block.nptable.exec(W);if(ge){var Ee={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(Ee.header.length===Ee.align.length){var Ke=Ee.align.length,V;for(V=0;V<Ke;V++)/^ *-+: *$/.test(Ee.align[V])?Ee.align[V]="right":/^ *:-+: *$/.test(Ee.align[V])?Ee.align[V]="center":/^ *:-+ *$/.test(Ee.align[V])?Ee.align[V]="left":Ee.align[V]=null;for(Ke=Ee.cells.length,V=0;V<Ke;V++)Ee.cells[V]=D(Ee.cells[V],Ee.header.length);return Ee}}},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 Ee=ge[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ge[0],text:Ee}}},He.list=function(W){var ge=this.rules.block.list.exec(W);if(ge){var Ee=ge[0],Ke=ge[2],V=Ke.length>1,qt={type:"list",raw:Ee,ordered:V,start:V?+Ke.slice(0,-1):"",loose:!1,items:[]},Ae=ge[0].match(this.rules.block.item),Xt=!1,yr,ei,Li,ui,Er,yi,me,Ce,Mt,ct=Ae.length;Li=this.rules.block.listItemStart.exec(Ae[0]);for(var Et=0;Et<ct;Et++){if(yr=Ae[Et],Ee=yr,this.options.pedantic||(Mt=yr.match(new RegExp("\\n\\s*\\n {0,"+(Li[0].length-1)+"}\\S")),Mt&&(Er=yr.length-Mt.index+Ae.slice(Et+1).join(`
`).length,qt.raw=qt.raw.substring(0,qt.raw.length-Er),yr=yr.substring(0,Mt.index),Ee=yr,ct=Et+1)),Et!==ct-1){if(ui=this.rules.block.listItemStart.exec(Ae[Et+1]),this.options.pedantic?ui[1].length>Li[1].length:ui[1].length>=Li[0].length||ui[1].length>3){Ae.splice(Et,2,Ae[Et]+(!this.options.pedantic&&ui[1].length<Li[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))&&(Er=Ae.slice(Et+1).join(`
`).length,qt.raw=qt.raw.substring(0,qt.raw.length-Er),Et=ct-1);Li=ui}ei=yr.length,yr=yr.replace(/^ *([*+-]|\d+[.)]) ?/,""),~yr.indexOf(`
`)&&(ei-=yr.length,yr=this.options.pedantic?yr.replace(/^ {1,4}/gm,""):yr.replace(new RegExp("^ {1,"+ei+"}","gm"),"")),yr=Se(yr,`
`),Et!==ct-1&&(Ee=Ee+`
`),yi=Xt||/\n\n(?!\s*$)/.test(Ee),Et!==ct-1&&(Xt=Ee.slice(-2)===`
`,yi||(yi=Xt)),yi&&(qt.loose=!0),this.options.gfm&&(me=/^\[[ xX]\] /.test(yr),Ce=void 0,me&&(Ce=yr[1]!==" ",yr=yr.replace(/^\[[ xX]\] +/,""))),qt.items.push({type:"list_item",raw:Ee,task:me,checked:Ce,loose:yi,text:yr})}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]):M(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 Ee=ge[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:Ee,raw:ge[0],href:ge[2],title:ge[3]}}},He.table=function(W){var ge=this.rules.block.table.exec(W);if(ge){var Ee={type:"table",header:D(ge[1].replace(/^ *| *\| *$/g,"")),align:ge[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ge[3]?ge[3].replace(/\n$/,"").split(`
`):[]};if(Ee.header.length===Ee.align.length){Ee.raw=ge[0];var Ke=Ee.align.length,V;for(V=0;V<Ke;V++)/^ *-+: *$/.test(Ee.align[V])?Ee.align[V]="right":/^ *:-+: *$/.test(Ee.align[V])?Ee.align[V]="center":/^ *:-+ *$/.test(Ee.align[V])?Ee.align[V]="left":Ee.align[V]=null;for(Ke=Ee.cells.length,V=0;V<Ke;V++)Ee.cells[V]=D(Ee.cells[V].replace(/^ *\| *| *\| *$/g,""),Ee.header.length);return Ee}}},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:M(ge[1])}},He.tag=function(W,ge,Ee){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),!Ee&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ke[0])?Ee=!0:Ee&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ke[0])&&(Ee=!1),{type:this.options.sanitize?"text":"html",raw:Ke[0],inLink:ge,inRawBlock:Ee,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ke[0]):M(Ke[0]):Ke[0]}},He.link=function(W){var ge=this.rules.inline.link.exec(W);if(ge){var Ee=ge[2].trim();if(!this.options.pedantic&&/^</.test(Ee)){if(!/>$/.test(Ee))return;var Ke=Se(Ee.slice(0,-1),"\\");if((Ee.length-Ke.length)%2===0)return}else{var V=ne(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 Xt=ge[2],yr="";if(this.options.pedantic){var ei=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Xt);ei&&(Xt=ei[1],yr=ei[3])}else yr=ge[3]?ge[3].slice(1,-1):"";return Xt=Xt.trim(),/^</.test(Xt)&&(this.options.pedantic&&!/>$/.test(Ee)?Xt=Xt.slice(1):Xt=Xt.slice(1,-1)),be(ge,{href:Xt&&Xt.replace(this.rules.inline._escapes,"$1"),title:yr&&yr.replace(this.rules.inline._escapes,"$1")},ge[0])}},He.reflink=function(W,ge){var Ee;if((Ee=this.rules.inline.reflink.exec(W))||(Ee=this.rules.inline.nolink.exec(W))){var Ke=(Ee[2]||Ee[1]).replace(/\s+/g," ");if(Ke=ge[Ke.toLowerCase()],!Ke||!Ke.href){var V=Ee[0].charAt(0);return{type:"text",raw:V,text:V}}return be(Ee,Ke,Ee[0])}},He.emStrong=function(W,ge,Ee){Ee===void 0&&(Ee="");var Ke=this.rules.inline.emStrong.lDelim.exec(W);if(Ke&&!(Ke[3]&&Ee.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&&(Ee===""||this.rules.inline.punctuation.exec(Ee))){var qt=Ke[0].length-1,Ae,Xt,yr=qt,ei=0,Li=Ke[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Li.lastIndex=0,ge=ge.slice(-1*W.length+qt);(Ke=Li.exec(ge))!=null;)if(Ae=Ke[1]||Ke[2]||Ke[3]||Ke[4]||Ke[5]||Ke[6],!!Ae){if(Xt=Ae.length,Ke[3]||Ke[4]){yr+=Xt;continue}else if((Ke[5]||Ke[6])&&qt%3&&!((qt+Xt)%3)){ei+=Xt;continue}if(yr-=Xt,!(yr>0))return Xt=Math.min(Xt,Xt+yr+ei),Math.min(qt,Xt)%2?{type:"em",raw:W.slice(0,qt+Ke.index+Xt+1),text:W.slice(1,qt+Ke.index+Xt)}:{type:"strong",raw:W.slice(0,qt+Ke.index+Xt+1),text:W.slice(2,qt+Ke.index+Xt-1)}}}}},He.codespan=function(W){var ge=this.rules.inline.code.exec(W);if(ge){var Ee=ge[2].replace(/\n/g," "),Ke=/[^ ]/.test(Ee),V=/^ /.test(Ee)&&/ $/.test(Ee);return Ke&&V&&(Ee=Ee.substring(1,Ee.length-1)),Ee=M(Ee,!0),{type:"codespan",raw:ge[0],text:Ee}}},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 Ee=this.rules.inline.autolink.exec(W);if(Ee){var Ke,V;return Ee[2]==="@"?(Ke=M(this.options.mangle?ge(Ee[1]):Ee[1]),V="mailto:"+Ke):(Ke=M(Ee[1]),V=Ke),{type:"link",raw:Ee[0],text:Ke,href:V,tokens:[{type:"text",raw:Ke,text:Ke}]}}},He.url=function(W,ge){var Ee;if(Ee=this.rules.inline.url.exec(W)){var Ke,V;if(Ee[2]==="@")Ke=M(this.options.mangle?ge(Ee[0]):Ee[0]),V="mailto:"+Ke;else{var qt;do qt=Ee[0],Ee[0]=this.rules.inline._backpedal.exec(Ee[0])[0];while(qt!==Ee[0]);Ke=M(Ee[0]),Ee[1]==="www."?V="http://"+Ke:V=Ke}return{type:"link",raw:Ee[0],text:Ke,href:V,tokens:[{type:"text",raw:Ke,text:Ke}]}}},He.inlineText=function(W,ge,Ee){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]):M(Ke[0]):Ke[0]:V=M(this.options.smartypants?Ee(Ke[0]):Ke[0]),{type:"text",raw:Ke[0],text:V}}},Ne}(),At=he.noopTest,Xe=he.edit,sr=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=sr({},jt),jt.gfm=sr({},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=sr({},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 Pt={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])/};Pt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Pt.punctuation=Xe(Pt.punctuation).replace(/punctuation/g,Pt._punctuation).getRegex(),Pt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Pt.escapedEmSt=/\\\*|\\_/g,Pt._comment=Xe(jt._comment).replace("(?:-->|$)","-->").getRegex(),Pt.emStrong.lDelim=Xe(Pt.emStrong.lDelim).replace(/punct/g,Pt._punctuation).getRegex(),Pt.emStrong.rDelimAst=Xe(Pt.emStrong.rDelimAst,"g").replace(/punct/g,Pt._punctuation).getRegex(),Pt.emStrong.rDelimUnd=Xe(Pt.emStrong.rDelimUnd,"g").replace(/punct/g,Pt._punctuation).getRegex(),Pt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Pt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Pt._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])?)+(?![-_])/,Pt.autolink=Xe(Pt.autolink).replace("scheme",Pt._scheme).replace("email",Pt._email).getRegex(),Pt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Pt.tag=Xe(Pt.tag).replace("comment",Pt._comment).replace("attribute",Pt._attribute).getRegex(),Pt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Pt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Pt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Pt.link=Xe(Pt.link).replace("label",Pt._label).replace("href",Pt._href).replace("title",Pt._title).getRegex(),Pt.reflink=Xe(Pt.reflink).replace("label",Pt._label).getRegex(),Pt.reflinkSearch=Xe(Pt.reflinkSearch,"g").replace("reflink",Pt.reflink).replace("nolink",Pt.nolink).getRegex(),Pt.normal=sr({},Pt),Pt.pedantic=sr({},Pt.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",Pt._label).getRegex(),reflink:Xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pt._label).getRegex()}),Pt.gfm=sr({},Pt.normal,{escape:Xe(Pt.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Pt.gfm.url=Xe(Pt.gfm.url,"i").replace("email",Pt.gfm._extended_email).getRegex(),Pt.breaks=sr({},Pt.gfm,{br:Xe(Pt.br).replace("{2,}","*").getRegex(),text:Xe(Pt.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Cr={block:jt,inline:Pt},zr=ot,rr=Me.exports.defaults,Ur=Cr.block,li=Cr.inline,Vr=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||rr,this.options.tokenizer=this.options.tokenizer||new zr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var W={block:Ur.normal,inline:li.normal};this.options.pedantic?(W.block=Ur.pedantic,W.inline=li.pedantic):this.options.gfm&&(W.block=Ur.gfm,this.options.breaks?W.inline=li.breaks:W.inline=li.gfm),this.tokenizer.rules=W}Ne.lex=function(W,ge){var Ee=new Ne(ge);return Ee.lex(W)},Ne.lexInline=function(W,ge){var Ee=new Ne(ge);return Ee.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,Ee){ge===void 0&&(ge=[]),Ee===void 0&&(Ee=!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,[],Ee),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(Ee&&(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(Ee&&(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 Xt="Infinite loop on byte: "+W.charCodeAt(0);if(this.options.silent){console.error(Xt);break}else throw new Error(Xt)}}return ge},He.inline=function(W){var ge,Ee,Ke,V,qt,Ae,Xt=W.length;for(ge=0;ge<Xt;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,Ee=0;Ee<V;Ee++)Ae.tokens.header[Ee]=[],this.inlineTokens(Ae.header[Ee],Ae.tokens.header[Ee]);for(V=Ae.cells.length,Ee=0;Ee<V;Ee++)for(qt=Ae.cells[Ee],Ae.tokens.cells[Ee]=[],Ke=0;Ke<qt.length;Ke++)Ae.tokens.cells[Ee][Ke]=[],this.inlineTokens(qt[Ke],Ae.tokens.cells[Ee][Ke]);break}case"blockquote":{this.inline(Ae.tokens);break}case"list":{for(V=Ae.items.length,Ee=0;Ee<V;Ee++)this.inline(Ae.items[Ee].tokens);break}}return W},He.inlineTokens=function(W,ge,Ee,Ke){ge===void 0&&(ge=[]),Ee===void 0&&(Ee=!1),Ke===void 0&&(Ke=!1);var V,qt,Ae=W,Xt,yr,ei;if(this.tokens.links){var Li=Object.keys(this.tokens.links);if(Li.length>0)for(;(Xt=this.tokenizer.rules.inline.reflinkSearch.exec(Ae))!=null;)Li.includes(Xt[0].slice(Xt[0].lastIndexOf("[")+1,-1))&&(Ae=Ae.slice(0,Xt.index)+"["+Vr("a",Xt[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Xt=this.tokenizer.rules.inline.blockSkip.exec(Ae))!=null;)Ae=Ae.slice(0,Xt.index)+"["+Vr("a",Xt[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Xt=this.tokenizer.rules.inline.escapedEmSt.exec(Ae))!=null;)Ae=Ae.slice(0,Xt.index)+"++"+Ae.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;W;){if(yr||(ei=""),yr=!1,V=this.tokenizer.escape(W)){W=W.substring(V.raw.length),ge.push(V);continue}if(V=this.tokenizer.tag(W,Ee,Ke)){W=W.substring(V.raw.length),Ee=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 Er=ge[ge.length-1];V.type==="link"?(V.tokens=this.inlineTokens(V.text,[],!0,Ke),ge.push(V)):Er&&V.type==="text"&&Er.type==="text"?(Er.raw+=V.raw,Er.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,[],Ee,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,[],Ee,Ke),ge.push(V);continue}if(V=this.tokenizer.autolink(W,nt)){W=W.substring(V.raw.length),ge.push(V);continue}if(!Ee&&(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)),yr=!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 yi="Infinite loop on byte: "+W.charCodeAt(0);if(this.options.silent){console.error(yi);break}else throw new Error(yi)}}return ge},X(Ne,null,[{key:"rules",get:function(){return{block:Ur,inline:li}}}]),Ne}(),Ct=Me.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,Ee){var Ke=(ge||"").match(/\S*/)[0];if(this.options.highlight){var V=this.options.highlight(W,Ke);V!=null&&V!==W&&(Ee=!0,W=V)}return W=W.replace(/\n$/,"")+`
`,Ke?'<pre><code class="'+this.options.langPrefix+ye(Ke,!0)+'">'+(Ee?W:ye(W,!0))+`</code></pre>
`:"<pre><code>"+(Ee?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,Ee,Ke){return this.options.headerIds?"<h"+ge+' id="'+this.options.headerPrefix+Ke.slug(Ee)+'">'+W+"</h"+ge+`>
`:"<h"+ge+">"+W+"</h"+ge+`>
`},He.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},He.list=function(W,ge,Ee){var Ke=ge?"ol":"ul",V=ge&&Ee!==1?' start="'+Ee+'"':"";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 Ee=ge.header?"th":"td",Ke=ge.align?"<"+Ee+' align="'+ge.align+'">':"<"+Ee+">";return Ke+W+"</"+Ee+`>
`},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,Ee){if(W=Dt(this.options.sanitize,this.options.baseUrl,W),W===null)return Ee;var Ke='<a href="'+ye(W)+'"';return ge&&(Ke+=' title="'+ge+'"'),Ke+=">"+Ee+"</a>",Ke},He.image=function(W,ge,Ee){if(W=Dt(this.options.sanitize,this.options.baseUrl,W),W===null)return Ee;var Ke='<img src="'+W+'" alt="'+Ee+'"';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,Ee){return""+Ee},He.image=function(W,ge,Ee){return""+Ee},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 Ee=W,Ke=0;if(this.seen.hasOwnProperty(Ee)){Ke=this.seen[W];do Ke++,Ee=W+"-"+Ke;while(this.seen.hasOwnProperty(Ee))}return ge||(this.seen[W]=Ke,this.seen[Ee]=0),Ee},He.slug=function(W,ge){ge===void 0&&(ge={});var Ee=this.serialize(W);return this.getNextSafeSlug(Ee,ge.dryrun)},Ne}(),wt=Oe,Gt=et,dr=vt,Jt=Me.exports.defaults,Ue=he.unescape,Kt=function(){function Ne(Je){this.options=Je||Jt,this.options.renderer=this.options.renderer||new wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Gt,this.slugger=new dr}Ne.parse=function(W,ge){var Ee=new Ne(ge);return Ee.parse(W)},Ne.parseInline=function(W,ge){var Ee=new Ne(ge);return Ee.parseInline(W)};var He=Ne.prototype;return He.parse=function(W,ge){ge===void 0&&(ge=!0);var Ee="",Ke,V,qt,Ae,Xt,yr,ei,Li,ui,Er,yi,me,Ce,Mt,ct,Et,Nt,ar,Qt=W.length;for(Ke=0;Ke<Qt;Ke++)switch(Er=W[Ke],Er.type){case"space":continue;case"hr":{Ee+=this.renderer.hr();continue}case"heading":{Ee+=this.renderer.heading(this.parseInline(Er.tokens),Er.depth,Ue(this.parseInline(Er.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ee+=this.renderer.code(Er.text,Er.lang,Er.escaped);continue}case"table":{for(Li="",ei="",Ae=Er.header.length,V=0;V<Ae;V++)ei+=this.renderer.tablecell(this.parseInline(Er.tokens.header[V]),{header:!0,align:Er.align[V]});for(Li+=this.renderer.tablerow(ei),ui="",Ae=Er.cells.length,V=0;V<Ae;V++){for(yr=Er.tokens.cells[V],ei="",Xt=yr.length,qt=0;qt<Xt;qt++)ei+=this.renderer.tablecell(this.parseInline(yr[qt]),{header:!1,align:Er.align[qt]});ui+=this.renderer.tablerow(ei)}Ee+=this.renderer.table(Li,ui);continue}case"blockquote":{ui=this.parse(Er.tokens),Ee+=this.renderer.blockquote(ui);continue}case"list":{for(yi=Er.ordered,me=Er.start,Ce=Er.loose,Ae=Er.items.length,ui="",V=0;V<Ae;V++)ct=Er.items[V],Et=ct.checked,Nt=ct.task,Mt="",ct.task&&(ar=this.renderer.checkbox(Et),Ce?ct.tokens.length>0&&ct.tokens[0].type==="text"?(ct.tokens[0].text=ar+" "+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=ar+" "+ct.tokens[0].tokens[0].text)):ct.tokens.unshift({type:"text",text:ar}):Mt+=ar),Mt+=this.parse(ct.tokens,Ce),ui+=this.renderer.listitem(Mt,Nt,Et);Ee+=this.renderer.list(ui,yi,me);continue}case"html":{Ee+=this.renderer.html(Er.text);continue}case"paragraph":{Ee+=this.renderer.paragraph(this.parseInline(Er.tokens));continue}case"text":{for(ui=Er.tokens?this.parseInline(Er.tokens):Er.text;Ke+1<Qt&&W[Ke+1].type==="text";)Er=W[++Ke],ui+=`
`+(Er.tokens?this.parseInline(Er.tokens):Er.text);Ee+=ge?this.renderer.paragraph(ui):ui;continue}default:{var Pr='Token with "'+Er.type+'" type was not found.';if(this.options.silent){console.error(Pr);return}else throw new Error(Pr)}}return Ee},He.parseInline=function(W,ge){ge=ge||this.renderer;var Ee="",Ke,V,qt=W.length;for(Ke=0;Ke<qt;Ke++)switch(V=W[Ke],V.type){case"escape":{Ee+=ge.text(V.text);break}case"html":{Ee+=ge.html(V.text);break}case"link":{Ee+=ge.link(V.href,V.title,this.parseInline(V.tokens,ge));break}case"image":{Ee+=ge.image(V.href,V.title,V.text);break}case"strong":{Ee+=ge.strong(this.parseInline(V.tokens,ge));break}case"em":{Ee+=ge.em(this.parseInline(V.tokens,ge));break}case"codespan":{Ee+=ge.codespan(V.text);break}case"br":{Ee+=ge.br();break}case"del":{Ee+=ge.del(this.parseInline(V.tokens,ge));break}case"text":{Ee+=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 Ee},Ne}(),wr=Qe,Fe=Kt,Ge=ot,it=Oe,Rt=et,kt=vt,zt=he.merge,tr=he.checkSanitizeDeprecation,T=he.escape,B=Me.exports.getDefaults,ft=Me.exports.changeDefaults,G=Me.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||{}),tr(He),Je){var W=He.highlight,ge;try{ge=wr.lex(Ne,He)}catch(qt){return Je(qt)}var Ee=function(Ae){var Xt;if(!Ae)try{He.walkTokens&&fe.walkTokens(ge,He.walkTokens),Xt=Fe.parse(ge,He)}catch(yr){Ae=yr}return He.highlight=W,Ae?Je(Ae):Je(null,Xt)};if(!W||W.length<3||(delete He.highlight,!ge.length))return Ee();var Ke=0;fe.walkTokens(ge,function(qt){qt.type==="code"&&(Ke++,setTimeout(function(){W(qt.text,qt.lang,function(Ae,Xt){if(Ae)return Ee(Ae);Xt!=null&&Xt!==qt.text&&(qt.text=Xt,qt.escaped=!0),Ke--,Ke===0&&Ee()})},0))}),Ke===0&&Ee();return}try{var V=wr.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),ft(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,Xt=new Array(Ae),yr=0;yr<Ae;yr++)Xt[yr]=arguments[yr];var ei=Ne.renderer[V].apply(W,Xt);return ei===!1&&(ei=qt.apply(W,Xt)),ei}};for(var Ee in Ne.renderer)ge(Ee);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,Xt=new Array(Ae),yr=0;yr<Ae;yr++)Xt[yr]=arguments[yr];var ei=Ne.tokenizer[V].apply(W,Xt);return ei===!1&&(ei=qt.apply(W,Xt)),ei}};for(var Ee in Ne.tokenizer)ge(Ee);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 Ee=rt(ge.tokens.header),Ke;!(Ke=Ee()).done;){var V=Ke.value;fe.walkTokens(V,He)}for(var qt=rt(ge.tokens.cells),Ae;!(Ae=qt()).done;)for(var Xt=Ae.value,yr=rt(Xt),ei;!(ei=yr()).done;){var Li=ei.value;fe.walkTokens(Li,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||{}),tr(He);try{var Je=wr.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=Rt,fe.Lexer=wr,fe.lexer=wr.lex,fe.Tokenizer=Ge,fe.Slugger=kt,fe.parse=fe;var Sr=fe;return Sr})},11690:function($r){const It=/[&<>"']/,X=/[&<>"']/g,pe=/[<>"']|&(?!#?\w+;)/,Pe=/[<>"']|&(?!#?\w+;)/g,rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Me=ve=>rt[ve];function re(ve,Ye){if(Ye){if(It.test(ve))return ve.replace(X,Me)}else if(pe.test(ve))return ve.replace(Pe,Me);return ve}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Re(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 N=/(^|[^\[])\^/g;function d(ve,Ye){ve=ve.source||ve,Ye=Ye||"";const We={replace:(ut,gt)=>(gt=gt.source||gt,gt=gt.replace(N,"$1"),ve=ve.replace(ut,gt),We),getRegex:()=>new RegExp(ve,Ye)};return We}const xe=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(ve,Ye,We){if(ve){let ut;try{ut=decodeURIComponent(Re(We)).replace(xe,"").toLowerCase()}catch(gt){return null}if(ut.indexOf("javascript:")===0||ut.indexOf("vbscript:")===0||ut.indexOf("data:")===0)return null}Ye&&!q.test(We)&&(We=ae(Ye,We));try{We=encodeURI(We).replace(/%25/g,"%")}catch(ut){return null}return We}const I={},O=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,se=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ae(ve,Ye){I[" "+ve]||(O.test(ve)?I[" "+ve]=ve+"/":I[" "+ve]=ue(ve,"/",!0)),ve=I[" "+ve];const We=ve.indexOf(":")===-1;return Ye.substring(0,2)==="//"?We?Ye:ve.replace(H,"$1")+Ye:Ye.charAt(0)==="/"?We?Ye:ve.replace(se,"$1")+Ye:ve+Ye}const Z={exec:function(){}};function j(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,ie,ce)=>{let he=!1,Le=ie;for(;--Le>=0&&ce[Le]==="\\";)he=!he;return he?"|":" |"}),ut=We.split(/ \|/);let gt=0;if(ut.length>Ye)ut.splice(Ye);else for(;ut.length<Ye;)ut.push("");for(;gt<ut.length;gt++)ut[gt]=ut[gt].trim().replace(/\\\|/g,"|");return ut}function ue(ve,Ye,We){const ut=ve.length;if(ut===0)return"";let gt=0;for(;gt<ut;){const de=ve.charAt(ut-gt-1);if(de===Ye&&!We)gt++;else if(de!==Ye&&We)gt++;else break}return ve.substr(0,ut-gt)}function ee(ve,Ye){if(ve.indexOf(Ye[1])===-1)return-1;const We=ve.length;let ut=0,gt=0;for(;gt<We;gt++)if(ve[gt]==="\\")gt++;else if(ve[gt]===Ye[0])ut++;else if(ve[gt]===Ye[1]&&(ut--,ut<0))return gt;return-1}function le(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}$r.exports={escape:re,unescape:Re,edit:d,cleanUrl:k,resolveUrl:ae,noopTest:Z,merge:j,splitCells:Y,rtrim:ue,findClosingBracket:ee,checkSanitizeDeprecation:le,repeatString:De}},75918:function($r,It,X){"use strict";X.d(It,{Wi:function(){return E},Z0:function(){return Re},aU:function(){return re},eZ:function(){return d},wY:function(){return N}});var pe=X(4348),Pe=X(69323),rt=X(13268),Me=function(xe,q,k,I){function O(H){return H instanceof k?H:new k(function(se){se(H)})}return new(k||(k=Promise))(function(H,se){function ae(Y){try{j(I.next(Y))}catch(ue){se(ue)}}function Z(Y){try{j(I.throw(Y))}catch(ue){se(ue)}}function j(Y){Y.done?H(Y.value):O(Y.value).then(ae,Z)}j((I=I.apply(xe,q||[])).next())})};class re extends Pe.JT{constructor(q,k="",I="",O=!0,H){super(),this._onDidChange=this._register(new pe.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=q,this._label=k,this._cssClass=I,this._enabled=O,this._actionCallback=H}get id(){return this._id}get label(){return this._label}set label(q){this._setLabel(q)}_setLabel(q){this._label!==q&&(this._label=q,this._onDidChange.fire({label:q}))}get tooltip(){return this._tooltip||""}set tooltip(q){this._setTooltip(q)}_setTooltip(q){this._tooltip!==q&&(this._tooltip=q,this._onDidChange.fire({tooltip:q}))}get class(){return this._cssClass}set class(q){this._setClass(q)}_setClass(q){this._cssClass!==q&&(this._cssClass=q,this._onDidChange.fire({class:q}))}get enabled(){return this._enabled}set enabled(q){this._setEnabled(q)}_setEnabled(q){this._enabled!==q&&(this._enabled=q,this._onDidChange.fire({enabled:q}))}get checked(){return this._checked}set checked(q){this._setChecked(q)}_setChecked(q){this._checked!==q&&(this._checked=q,this._onDidChange.fire({checked:q}))}run(q,k){return Me(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(q))})}}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(q,k){return Me(this,void 0,void 0,function*(){if(!q.enabled)return;this._onBeforeRun.fire({action:q});let I;try{yield this.runAction(q,k)}catch(O){I=O}this._onDidRun.fire({action:q,error:I})})}runAction(q,k){return Me(this,void 0,void 0,function*(){yield q.run(k)})}}class Re extends re{constructor(q){super(Re.ID,q,q?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Re.ID="vs.actions.separator";class N{constructor(q,k,I,O){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=q,this.label=k,this.class=O,this._actions=I}get actions(){return this._actions}dispose(){}run(){return Me(this,void 0,void 0,function*(){})}}class d extends re{constructor(){super(d.ID,rt.N("submenu.empty","(empty)"),void 0,!1)}}d.ID="vs.actions.empty"},76068:function($r,It,X){"use strict";X.d(It,{ok:function(){return pe}});function pe(Pe,rt){if(!Pe)throw new Error(rt?`Assertion failed (${rt})`:"Assertion Failed")}},52615:function($r,It,X){"use strict";X.d(It,{CM:function(){return re},JL:function(){return E},dT:function(){return N},fK:function(){return Me},lA:function(){return Re}});var pe=X(4348);class Pe{constructor(){this._icons=new Map,this._onDidRegister=new pe.Q5}add(xe){const q=this._icons.get(xe.id);q?xe.description?q.description=xe.description:console.error(`Duplicate registration of codicon ${xe.id}`):(this._icons.set(xe.id,xe),this._onDidRegister.fire(xe))}get(xe){return this._icons.get(xe)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const rt=new Pe,Me=rt;function re(d,xe){return new Re(d,xe)}function E(d){return d?d.replace(/\$\((.*?)\)/g,(xe,q)=>` ${q} `).trim():""}class Re{constructor(xe,q,k){this.id=xe,this.definition=q,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 N;(function(d){d.iconNameSegment="[A-Za-z0-9]+",d.iconNameExpression="[A-Za-z0-9\\-]+",d.iconModifierExpression="~[A-Za-z]+";const xe=new RegExp(`^(${d.iconNameExpression})(${d.iconModifierExpression})?$`);function q(O){if(O instanceof Re)return["codicon","codicon-"+O.id];const H=xe.exec(O.id);if(!H)return q(Re.error);let[,se,ae]=H;const Z=["codicon","codicon-"+se];return ae&&Z.push("codicon-modifier-"+ae.substr(1)),Z}d.asClassNameArray=q;function k(O){return q(O).join(" ")}d.asClassName=k;function I(O){return"."+q(O).join(".")}d.asCSSSelector=I})(N||(N={})),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"})}(Re||(Re={}))},79881:function($r,It,X){"use strict";X.d(It,{B8:function(){return q},Cp:function(){return Me},F0:function(){return N},L6:function(){return xe},VV:function(){return Re},b1:function(){return d},dL:function(){return rt},ri:function(){return re}});class pe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(I){setTimeout(()=>{throw I.stack?new Error(I.message+`
`+I.stack):I},0)}}emit(I){this.listeners.forEach(O=>{O(I)})}onUnexpectedError(I){this.unexpectedErrorHandler(I),this.emit(I)}onUnexpectedExternalError(I){this.unexpectedErrorHandler(I)}}const Pe=new pe;function rt(k){Re(k)||Pe.onUnexpectedError(k)}function Me(k){Re(k)||Pe.onUnexpectedExternalError(k)}function re(k){if(k instanceof Error){let{name:I,message:O}=k;const H=k.stacktrace||k.stack;return{$isError:!0,name:I,message:O,stack:H}}return k}const E="Canceled";function Re(k){return k instanceof Error&&k.name===E&&k.message===E}function N(){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 xe(k){return k?new Error(`Illegal state: ${k}`):new Error("Illegal state")}class q extends Error{constructor(I){super("NotSupported"),I&&(this.message=I)}}},4348:function($r,It,X){"use strict";X.d(It,{D0:function(){return q},E7:function(){return k},K3:function(){return xe},Q5:function(){return d},ZD:function(){return I},ju:function(){return re}});var pe=X(79881),Pe=X(69323),rt=X(34502),Me=X(95830),re;(function(O){O.None=()=>Pe.JT.None;function H(ce){return(he,Le=null,Se)=>{let D=!1,M;return M=ce(ne=>{if(!D)return M?M.dispose():D=!0,he.call(Le,ne)},null,Se),D&&M.dispose(),M}}O.once=H;function se(ce,he){return ee((Le,Se=null,D)=>ce(M=>Le.call(Se,he(M)),null,D))}O.map=se;function ae(ce,he){return ee((Le,Se=null,D)=>ce(M=>{he(M),Le.call(Se,M)},null,D))}O.forEach=ae;function Z(ce,he){return ee((Le,Se=null,D)=>ce(M=>he(M)&&Le.call(Se,M),null,D))}O.filter=Z;function j(ce){return ce}O.signal=j;function Y(...ce){return(he,Le=null,Se)=>(0,Pe.F8)(...ce.map(D=>D(M=>he.call(Le,M),null,Se)))}O.any=Y;function ue(ce,he,Le){let Se=Le;return se(ce,D=>(Se=he(Se,D),Se))}O.reduce=ue;function ee(ce){let he;const Le=new d({onFirstListenerAdd(){he=ce(Le.fire,Le)},onLastListenerRemove(){he.dispose()}});return Le.event}function le(ce,he,Le=100,Se=!1,D){let M,ne,be,st=0;const ot=new d({leakWarningThreshold:D,onFirstListenerAdd(){M=ce(At=>{st++,ne=he(ne,At),Se&&!be&&(ot.fire(ne),ne=void 0),clearTimeout(be),be=setTimeout(()=>{const Xe=ne;ne=void 0,be=void 0,(!Se||st>1)&&ot.fire(Xe),st=0},Le)})},onLastListenerRemove(){M.dispose()}});return ot.event}O.debounce=le;function De(ce,he=(Le,Se)=>Le===Se){let Le=!0,Se;return Z(ce,D=>{const M=Le||!he(D,Se);return Le=!1,Se=D,M})}O.latch=De;function ve(ce,he){return[O.filter(ce,he),O.filter(ce,Le=>!he(Le))]}O.split=ve;function Ye(ce,he=!1,Le=[]){let Se=Le.slice(),D=ce(be=>{Se?Se.push(be):ne.fire(be)});const M=()=>{Se&&Se.forEach(be=>ne.fire(be)),Se=null},ne=new d({onFirstListenerAdd(){D||(D=ce(be=>ne.fire(be)))},onFirstListenerDidAdd(){Se&&(he?setTimeout(M):M())},onLastListenerRemove(){D&&D.dispose(),D=null}});return ne.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,Le){return new We(ue(this.event,he,Le))}latch(){return new We(De(this.event))}debounce(he,Le=100,Se=!1,D){return new We(le(this.event,he,Le,Se,D))}on(he,Le,Se){return this.event(he,Le,Se)}once(he,Le,Se){return H(this.event)(he,Le,Se)}}function ut(ce){return new We(ce)}O.chain=ut;function gt(ce,he,Le=Se=>Se){const Se=(...be)=>ne.fire(Le(...be)),D=()=>ce.on(he,Se),M=()=>ce.removeListener(he,Se),ne=new d({onFirstListenerAdd:D,onLastListenerRemove:M});return ne.event}O.fromNodeEventEmitter=gt;function de(ce,he,Le=Se=>Se){const Se=(...be)=>ne.fire(Le(...be)),D=()=>ce.addEventListener(he,Se),M=()=>ce.removeEventListener(he,Se),ne=new d({onFirstListenerAdd:D,onLastListenerRemove:M});return ne.event}O.fromDOMEventEmitter=de;function ie(ce){return new Promise(he=>H(ce)(he))}O.toPromise=ie})(re||(re={}));class E{constructor(H){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${H}_${E._idPool++}`}start(H){this._stopWatch=new Me.G(!0),this._listenerCount=H}stop(){if(this._stopWatch){const H=this._stopWatch.elapsed();this._elapsedOverall+=H,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${H.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}E._idPool=0;let Re=-1;class N{constructor(H,se=Math.random().toString(18).slice(2,5)){this.customThreshold=H,this.name=se,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(H){let se=Re;if(typeof this.customThreshold=="number"&&(se=this.customThreshold),se<=0||H<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 j,Y=0;for(const[ue,ee]of this._stacks)(!j||Y<ee)&&(j=ue,Y=ee);console.warn(`[${this.name}] potential listener LEAK detected, having ${H} listeners already. MOST frequent listener (${Y}):`),console.warn(j)}return()=>{const j=this._stacks.get(ae)||0;this._stacks.set(ae,j-1)}}}class d{constructor(H){var se;this._disposed=!1,this._options=H,this._leakageMon=Re>0?new N(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=(H,se,ae)=>{var Z;this._listeners||(this._listeners=new rt.S);const j=this._listeners.isEmpty();j&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const Y=this._listeners.push(se?[H,se]:H);j&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,H,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(H){var se,ae;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new rt.S);for(let Z of this._listeners)this._deliveryQueue.push([Z,H]);for((se=this._perfMon)===null||se===void 0||se.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[Z,j]=this._deliveryQueue.shift();try{typeof Z=="function"?Z.call(void 0,j):Z[0].call(Z[1],j)}catch(Y){(0,pe.dL)(Y)}}(ae=this._perfMon)===null||ae===void 0||ae.stop()}}dispose(){var H,se,ae,Z,j;this._disposed||(this._disposed=!0,(H=this._listeners)===null||H===void 0||H.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),(j=this._leakageMon)===null||j===void 0||j.dispose())}}class xe extends d{constructor(H){super(H),this._isPaused=0,this._eventQueue=new rt.S,this._mergeFn=H==null?void 0:H.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const H=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(H))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(H){this._listeners&&(this._isPaused!==0?this._eventQueue.push(H):super.fire(H))}}class q extends xe{constructor(H){var se;super(H),this._delay=(se=H.delay)!==null&&se!==void 0?se:100}fire(H){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(H)}}class k{constructor(){this.buffers=[]}wrapEvent(H){return(se,ae,Z)=>H(j=>{const Y=this.buffers[this.buffers.length-1];Y?Y.push(()=>se.call(ae,j)):se.call(ae,j)},void 0,Z)}bufferEvents(H){const se=[];this.buffers.push(se);const ae=H();return this.buffers.pop(),se.forEach(Z=>Z()),ae}}class I{constructor(){this.listening=!1,this.inputEvent=re.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(H){this.inputEvent=H,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=H(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function($r,It,X){"use strict";X.d(It,{I:function(){return pe}});function pe(Pe){const rt=this;let Me=!1,re;return function(){return Me||(Me=!0,re=Pe.apply(rt,arguments)),re}}},88226:function($r,It,X){"use strict";X.d(It,{$:function(){return pe}});var pe;(function(Pe){function rt(Y){return Y&&typeof Y=="object"&&typeof Y[Symbol.iterator]=="function"}Pe.is=rt;const Me=Object.freeze([]);function re(){return Me}Pe.empty=re;function*E(Y){yield Y}Pe.single=E;function Re(Y){return Y||Me}Pe.from=Re;function N(Y){return!Y||Y[Symbol.iterator]().next().done===!0}Pe.isEmpty=N;function d(Y){return Y[Symbol.iterator]().next().value}Pe.first=d;function xe(Y,ue){for(const ee of Y)if(ue(ee))return!0;return!1}Pe.some=xe;function q(Y,ue){for(const ee of Y)if(ue(ee))return ee}Pe.find=q;function*k(Y,ue){for(const ee of Y)ue(ee)&&(yield ee)}Pe.filter=k;function*I(Y,ue){let ee=0;for(const le of Y)yield ue(le,ee++)}Pe.map=I;function*O(...Y){for(const ue of Y)for(const ee of ue)yield ee}Pe.concat=O;function*H(Y){for(const ue of Y)for(const ee of ue)yield ee}Pe.concatNested=H;function se(Y,ue,ee){let le=ee;for(const De of Y)le=ue(le,De);return le}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 le=Y[Symbol.iterator]();for(let De=0;De<ue;De++){const ve=le.next();if(ve.done)return[ee,Pe.empty()];ee.push(ve.value)}return[ee,{[Symbol.iterator](){return le}}]}Pe.consume=Z;function j(Y,ue,ee=(le,De)=>le===De){const le=Y[Symbol.iterator](),De=ue[Symbol.iterator]();for(;;){const ve=le.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=j})(pe||(pe={}))},69323:function($r,It,X){"use strict";X.d(It,{B9:function(){return I},F8:function(){return O},JT:function(){return ae},Jz:function(){return j},OF:function(){return H},SL:function(){return se},Wf:function(){return k},XK:function(){return Z},dk:function(){return xe}});var pe=X(17845),Pe=X(88226);const rt=!1;let Me=null;function re(Y){Me=Y}if(rt){const Y="__is_disposable_tracked__";re(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(le){}}markAsDisposed(ue){if(ue&&ue!==ae.None)try{ue[Y]=!0}catch(ee){}}markAsSingleton(ue){}})}function E(Y){return Me==null||Me.trackDisposable(Y),Y}function Re(Y){Me==null||Me.markAsDisposed(Y)}function N(Y,ue){Me==null||Me.setParent(Y,ue)}function d(Y,ue){if(Me)for(const ee of Y)Me.setParent(ee,ue)}function xe(Y){return Me==null||Me.markAsSingleton(Y),Y}class q 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 I(Y){if(Pe.$.is(Y)){let ue=[];for(const ee of Y)if(ee)try{ee.dispose()}catch(le){ue.push(le)}if(ue.length===1)throw ue[0];if(ue.length>1)throw new q(ue);return Array.isArray(Y)?[]:Y}else if(Y)return Y.dispose(),Y}function O(...Y){const ue=H(()=>I(Y));return d(Y,ue),ue}function H(Y){const ue=E({dispose:(0,pe.I)(()=>{Re(ue),Y()})});return ue}class se{constructor(){this._toDispose=new Set,this._isDisposed=!1,E(this)}dispose(){this._isDisposed||(Re(this),this._isDisposed=!0,this.clear())}clear(){try{I(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 N(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),N(this._store,this)}dispose(){Re(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&&N(ue,this),this._value=ue)}clear(){this.value=void 0}dispose(){var ue;this._isDisposed=!0,Re(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&&N(ue,null),ue}}class j{constructor(ue){this.object=ue}dispose(){}}},34502:function($r,It,X){"use strict";X.d(It,{S:function(){return Pe}});class pe{constructor(Me){this.element=Me,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 Me=this._first;for(;Me!==pe.Undefined;){const re=Me.next;Me.prev=pe.Undefined,Me.next=pe.Undefined,Me=re}this._first=pe.Undefined,this._last=pe.Undefined,this._size=0}unshift(Me){return this._insert(Me,!1)}push(Me){return this._insert(Me,!0)}_insert(Me,re){const E=new pe(Me);if(this._first===pe.Undefined)this._first=E,this._last=E;else if(re){const N=this._last;this._last=E,E.prev=N,N.next=E}else{const N=this._first;this._first=E,E.next=N,N.prev=E}this._size+=1;let Re=!1;return()=>{Re||(Re=!0,this._remove(E))}}shift(){if(this._first!==pe.Undefined){const Me=this._first.element;return this._remove(this._first),Me}}pop(){if(this._last!==pe.Undefined){const Me=this._last.element;return this._remove(this._last),Me}}_remove(Me){if(Me.prev!==pe.Undefined&&Me.next!==pe.Undefined){const re=Me.prev;re.next=Me.next,Me.next.prev=re}else Me.prev===pe.Undefined&&Me.next===pe.Undefined?(this._first=pe.Undefined,this._last=pe.Undefined):Me.next===pe.Undefined?(this._last=this._last.prev,this._last.next=pe.Undefined):Me.prev===pe.Undefined&&(this._first=this._first.next,this._first.prev=pe.Undefined);this._size-=1}*[Symbol.iterator](){let Me=this._first;for(;Me!==pe.Undefined;)yield Me.element,Me=Me.next}}},23345:function($r,It,X){"use strict";X.d(It,{$L:function(){return le},ED:function(){return j},IJ:function(){return ue},OS:function(){return We},WE:function(){return ve},dz:function(){return Y},gn:function(){return De},li:function(){return H},r:function(){return de},tY:function(){return ee},xS:function(){return Ye}});var pe=X(97671),Pe;const rt="en";let Me=!1,re=!1,E=!1,Re=!1,N=!1,d=!1,xe=!1,q,k=null,I=null,O;const H=typeof self=="object"?self:typeof X.g=="object"?X.g:{};let se;typeof H.vscode!="undefined"&&typeof H.vscode.process!="undefined"?se=H.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,Me=O.indexOf("Windows")>=0,re=O.indexOf("Macintosh")>=0,xe=(O.indexOf("Macintosh")>=0||O.indexOf("iPad")>=0||O.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,E=O.indexOf("Linux")>=0,d=!0,q=navigator.language,k=q;else if(typeof se=="object"){Me=se.platform==="win32",re=se.platform==="darwin",E=se.platform==="linux",Re=E&&!!se.env.SNAP&&!!se.env.SNAP_REVISION,q=rt,k=rt;const ie=se.env.VSCODE_NLS_CONFIG;if(ie)try{const ce=JSON.parse(ie),he=ce.availableLanguages["*"];q=ce.locale,k=he||rt,I=ce._translationsConfigFile}catch(ce){}N=!0}else console.error("Unable to resolve platform.");let Z=0;re?Z=1:Me?Z=3:E&&(Z=2);const j=Me,Y=re,ue=E,ee=N,le=d,De=xe,ve=O,Ye=function(){if(H.setImmediate)return H.setImmediate.bind(H);if(typeof H.postMessage=="function"&&!H.importScripts){let he=[];H.addEventListener("message",Se=>{if(Se.data&&Se.data.vscodeSetImmediateId)for(let D=0,M=he.length;D<M;D++){const ne=he[D];if(ne.id===Se.data.vscodeSetImmediateId){he.splice(D,1),ne.callback();return}}});let Le=0;return Se=>{const D=++Le;he.push({id:D,callback:Se}),H.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=re||xe?2:Me?1:3;let ut=!0,gt=!1;function de(){if(!gt){gt=!0;const ie=new Uint8Array(2);ie[0]=1,ie[1]=2,ut=new Uint16Array(ie.buffer)[0]===513}return ut}},95830:function($r,It,X){"use strict";X.d(It,{G:function(){return rt}});var pe=X(23345);const Pe=pe.li.performance&&typeof pe.li.performance.now=="function";class rt{constructor(re){this._highResolution=Pe&&re,this._startTime=this._now(),this._stopTime=-1}static create(re=!0){return new rt(re)}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($r,It,X){"use strict";X.d(It,{$i:function(){return st},C8:function(){return jt},GF:function(){return q},HO:function(){return Le},IO:function(){return k},K7:function(){return sr},Kw:function(){return zr},LC:function(){return H},Mh:function(){return Ye},P1:function(){return We},PJ:function(){return rr},Qe:function(){return ot},R1:function(){return xe},RP:function(){return ne},S6:function(){return Ur},TT:function(){return j},Ut:function(){return D},V8:function(){return se},WU:function(){return rt},YK:function(){return gt},YU:function(){return Me},ZG:function(){return ut},ZH:function(){return ie},ab:function(){return At},c1:function(){return Pt},df:function(){return le},ec:function(){return re},fi:function(){return li},fy:function(){return E},j3:function(){return Re},j_:function(){return ue},m5:function(){return pe},mK:function(){return ee},mr:function(){return I},oH:function(){return nt},oL:function(){return N},ok:function(){return ve},ow:function(){return ae},qq:function(){return De},qu:function(){return Z},rL:function(){return de},uS:function(){return Cr},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 Me(ye){return ye.replace(/[<>&]/g,function(Oe){switch(Oe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Oe}})}function re(ye){return ye.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function E(ye,Oe=" "){const et=Re(ye,Oe);return N(et,Oe)}function Re(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 N(ye,Oe){if(!ye||!Oe)return ye;const et=Oe.length,vt=ye.length;if(et===0||vt===0)return ye;let wt=vt,Gt=-1;for(;Gt=ye.lastIndexOf(Oe,wt-1),!(Gt===-1||Gt+et!==wt);){if(Gt===0)return"";wt=Gt}return ye.substring(0,wt)}function d(ye){return ye.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function xe(ye){return ye.replace(/\*/g,"")}function q(ye,Oe,et={}){if(!ye)throw new Error("Cannot create regex from empty string");Oe||(ye=re(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 I(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 H(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 j(ye,Oe,et=0,vt=ye.length,wt=0,Gt=Oe.length){for(;et<vt&&wt<Gt;et++,wt++){let Ue=ye.charCodeAt(et),Kt=Oe.charCodeAt(wt);if(Ue<Kt)return-1;if(Ue>Kt)return 1}const dr=vt-et,Jt=Gt-wt;return dr<Jt?-1:dr>Jt?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,Gt=Oe.length){for(;et<vt&&wt<Gt;et++,wt++){let Ue=ye.charCodeAt(et),Kt=Oe.charCodeAt(wt);if(Ue===Kt)continue;if(Ue>=128||Kt>=128)return j(ye.toLowerCase(),Oe.toLowerCase(),et,vt,wt,Gt);ee(Ue)&&(Ue-=32),ee(Kt)&&(Kt-=32);const wr=Ue-Kt;if(wr!==0)return wr}const dr=vt-et,Jt=Gt-wt;return dr<Jt?-1:dr>Jt?1:0}function ee(ye){return ye>=97&&ye<=122}function le(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,Gt=Oe.length-1;for(et=0;et<vt;et++)if(ye.charCodeAt(wt-et)!==Oe.charCodeAt(Gt-et))return et;return vt}function ut(ye){return 55296<=ye&&ye<=56319}function gt(ye){return 56320<=ye&&ye<=57343}function de(ye,Oe){return(ye-55296<<10)+(Oe-56320)+65536}function ie(ye,Oe,et){const vt=ye.charCodeAt(et);if(ut(vt)&&et+1<Oe){const wt=ye.charCodeAt(et+1);if(gt(wt))return de(vt,wt)}return vt}function ce(ye,Oe){const et=ye.charCodeAt(Oe-1);if(gt(et)&&Oe>1){const vt=ye.charCodeAt(Oe-2);if(ut(vt))return de(vt,et)}return et}function he(ye,Oe){const et=Vr.getInstance(),vt=Oe,wt=ye.length,Gt=ie(ye,wt,Oe);Oe+=Gt>=65536?2:1;let dr=et.getGraphemeBreakType(Gt);for(;Oe<wt;){const Jt=ie(ye,wt,Oe),Ue=et.getGraphemeBreakType(Jt);if(li(dr,Ue))break;Oe+=Jt>=65536?2:1,dr=Ue}return Oe-vt}function Le(ye,Oe){const et=Vr.getInstance(),vt=Oe,wt=ce(ye,Oe);Oe-=wt>=65536?2:1;let Gt=et.getGraphemeBreakType(wt);for(;Oe>0;){const dr=ce(ye,Oe),Jt=et.getGraphemeBreakType(dr);if(li(Jt,Gt))break;Oe-=dr>=65536?2:1,Gt=Jt}return vt-Oe}const Se=/(?:[\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 Se.test(ye)}const M=/(?:[\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 ne(ye){return M.test(ye)}const be=/^[\t\n\r\x20-\x7E]*$/;function st(ye){return be.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(sr(ye.charCodeAt(Oe)))return!0;return!1}function sr(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 Pt="\uFEFF";function Cr(ye){return!!(ye&&ye.length>0&&ye.charCodeAt(0)===65279)}function zr(ye,Oe=!1){return ye?(Oe&&(ye=ye.replace(/\\./g,"")),ye.toLowerCase()!==ye):!1}function rr(ye){return ye=ye%(2*26),ye<26?String.fromCharCode(97+ye):String.fromCharCode(65+ye-26)}function Ur(ye){return Vr.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 Vr{constructor(){this._data=Ze()}static getInstance(){return Vr._INSTANCE||(Vr._INSTANCE=new Vr),Vr._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}}Vr._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($r,It,X){"use strict";X.d(It,{$E:function(){return H},$K:function(){return Re},D8:function(){return k},HD:function(){return Pe},IU:function(){return se},Jp:function(){return N},Kn:function(){return rt},cW:function(){return xe},f6:function(){return ae},hj:function(){return Me},jn:function(){return re},kJ:function(){return pe},mf:function(){return q},o8:function(){return E},p_:function(){return d},vE:function(){return Z}});function pe(j){return Array.isArray(j)}function Pe(j){return typeof j=="string"}function rt(j){return typeof j=="object"&&j!==null&&!Array.isArray(j)&&!(j instanceof RegExp)&&!(j instanceof Date)}function Me(j){return typeof j=="number"&&!isNaN(j)}function re(j){return j===!0||j===!1}function E(j){return typeof j=="undefined"}function Re(j){return!N(j)}function N(j){return E(j)||j===null}function d(j,Y){if(!j)throw new Error(Y?`Unexpected type, expected '${Y}'`:"Unexpected type")}function xe(j){if(N(j))throw new Error("Assertion Failed: argument is undefined or null");return j}function q(j){return typeof j=="function"}function k(j,Y){const ue=Math.min(j.length,Y.length);for(let ee=0;ee<ue;ee++)I(j[ee],Y[ee])}function I(j,Y){if(Pe(Y)){if(typeof j!==Y)throw new Error(`argument does not match constraint: typeof ${Y}`)}else if(q(Y)){try{if(j instanceof Y)return}catch(ue){}if(!N(j)&&j.constructor===Y||Y.length===1&&Y.call(void 0,j)===!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(j){let Y=[],ue=Object.getPrototypeOf(j);for(;Object.prototype!==ue;)Y=Y.concat(Object.getOwnPropertyNames(ue)),ue=Object.getPrototypeOf(ue);return Y}function H(j){const Y=[];for(const ue of O(j))typeof j[ue]=="function"&&Y.push(ue);return Y}function se(j,Y){const ue=le=>function(){const De=Array.prototype.slice.call(arguments,0);return Y(le,De)};let ee={};for(const le of j)ee[le]=ue(le);return ee}function ae(j){return j===null?void 0:j}function Z(j,Y="Unreachable"){throw new Error(Y)}},13268:function($r,It,X){"use strict";X.d(It,{N:function(){return Pe}});function pe(rt,Me){let re;return Me.length===0?re=rt:re=rt.replace(/\{(\d+)\}/g,function(E,Re){const N=Re[0];return typeof Me[N]!="undefined"?Me[N]:E}),re}function Pe(rt,Me,...re){return pe(Me,re)}},96236:function($r,It,X){"use strict";X.d(It,{BH:function(){return se},NZ:function(){return ae},U8:function(){return Z},co:function(){return H},eH:function(){return O},vr:function(){return I}});var pe=X(75918),Pe=X(52615),rt=X(4348),Me=X(88226),re=X(69323),E=X(34502),Re=X(35884),N=X(90689),d=X(16925),xe=X(49055),q=function(j,Y,ue,ee){var le=arguments.length,De=le<3?Y:ee===null?ee=Object.getOwnPropertyDescriptor(Y,ue):ee,ve;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")De=Reflect.decorate(j,Y,ue,ee);else for(var Ye=j.length-1;Ye>=0;Ye--)(ve=j[Ye])&&(De=(le<3?ve(De):le>3?ve(Y,ue,De):ve(Y,ue))||De);return le>3&&De&&Object.defineProperty(Y,ue,De),De},k=function(j,Y){return function(ue,ee){Y(ue,ee,j)}};function I(j){return j.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 H=(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:j=>j===O.CommandPalette}}addCommand(j){return this.addCommands(Me.$.single(j))}addCommands(j){for(const Y of j)this._commands.set(Y.id,Y);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,re.OF)(()=>{let Y=!1;for(const ue of j)Y=this._commands.delete(ue.id)||Y;Y&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(j){return this._commands.get(j)}getCommands(){const j=new Map;return this._commands.forEach((Y,ue)=>j.set(ue,Y)),j}appendMenuItem(j,Y){return this.appendMenuItems(Me.$.single({id:j,item:Y}))}appendMenuItems(j){const Y=new Set,ue=new E.S;for(const{id:ee,item:le}of j){let De=this._menuItems.get(ee);De||(De=new E.S,this._menuItems.set(ee,De)),ue.push(De.push(le)),Y.add(ee)}return this._onDidChangeMenu.fire(Y),(0,re.OF)(()=>{if(ue.size>0){for(let ee of ue)ee();this._onDidChangeMenu.fire(Y),ue.clear()}})}getMenuItems(j){let Y;return this._menuItems.has(j)?Y=[...this._menuItems.get(j)]:Y=[],j===O.CommandPalette&&this._appendImplicitItems(Y),Y}_appendImplicitItems(j){const Y=new Set;for(const ue of j)I(ue)&&(Y.add(ue.command.id),ue.alt&&Y.add(ue.alt.id));this._commands.forEach((ue,ee)=>{Y.has(ee)||j.push({command:ue})})}};class ae extends pe.wY{constructor(Y,ue,ee,le){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=le}get actions(){const Y=[],ue=this._menuService.createMenu(this.item.submenu,this._contextKeyService),ee=ue.getActions(this._options);ue.dispose();for(const[,le]of ee)le.length>0&&(Y.push(...le),Y.push(new pe.Z0));return Y.length&&Y.pop(),Y}}let Z=class kp{constructor(Y,ue,ee,le,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||le.contextMatchesRules(Y.precondition),this.checked=void 0,Y.toggled){const We=Y.toggled.condition?Y.toggled:{condition:Y.toggled};this.checked=le.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,le,De):void 0,this._options=ee,xe.kS.isThemeIcon(Y.icon)&&(this.class=Pe.dT.asClassName(Y.icon))}dispose(){}run(...Y){var ue,ee;let le=[];return!((ue=this._options)===null||ue===void 0)&&ue.arg&&(le=[...le,this._options.arg]),!((ee=this._options)===null||ee===void 0)&&ee.shouldForwardArgs&&(le=[...le,...Y]),this._commandService.executeCommand(this.id,...le)}};Z=q([k(3,N.i6),k(4,Re.H)],Z)},35884:function($r,It,X){"use strict";X.d(It,{H:function(){return Re},P:function(){return N}});var pe=X(4348),Pe=X(88226),rt=X(69323),Me=X(34502),re=X(72999),E=X(16925);const Re=(0,E.yh)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new pe.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(d,xe){if(!d)throw new Error("invalid command");if(typeof d=="string"){if(!xe)throw new Error("invalid command");return this.registerCommand({id:d,handler:xe})}if(d.description){const H=[];for(let ae of d.description.args)H.push(ae.constraint);const se=d.handler;d.handler=function(ae,...Z){return(0,re.D8)(Z,H),se(ae,...Z)}}const{id:q}=d;let k=this._commands.get(q);k||(k=new Me.S,this._commands.set(q,k));let I=k.unshift(d),O=(0,rt.OF)(()=>{I();const H=this._commands.get(q);H!=null&&H.isEmpty()&&this._commands.delete(q)});return this._onDidRegisterCommand.fire(q),O}registerCommandAlias(d,xe){return N.registerCommand(d,(q,...k)=>q.get(Re).executeCommand(xe,...k))}getCommand(d){const xe=this._commands.get(d);if(!(!xe||xe.isEmpty()))return Pe.$.first(xe)}getCommands(){const d=new Map;for(const xe of this._commands.keys()){const q=this.getCommand(xe);q&&d.set(xe,q)}return d}};N.registerCommand("noop",()=>{})},90689:function($r,It,X){"use strict";X.d(It,{Ao:function(){return Re},Eq:function(){return de},Fb:function(){return N},K8:function(){return he},i6:function(){return gt},uy:function(){return ut}});var pe=X(23345),Pe=X(82983),rt=X(16925);let Me=pe.WE||"";const re=new Map;re.set("false",!1),re.set("true",!0),re.set("isMac",pe.dz),re.set("isLinux",pe.IJ),re.set("isWindows",pe.ED),re.set("isWeb",pe.$L),re.set("isMacNative",pe.dz&&!pe.$L),re.set("isEdge",Me.indexOf("Edg/")>=0),re.set("isFirefox",Me.indexOf("Firefox")>=0),re.set("isChrome",Me.indexOf("Chrome")>=0),re.set("isSafari",Me.indexOf("Safari")>=0);const E=Object.prototype.hasOwnProperty;class Re{static has(D){return k.create(D)}static equals(D,M){return I.create(D,M)}static regex(D,M){return le.create(D,M)}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,M=!1){if(D)return this._deserializeOrExpression(D,M)}static _deserializeOrExpression(D,M){let ne=D.split("||");return We.create(ne.map(be=>this._deserializeAndExpression(be,M)),null,!0)}static _deserializeAndExpression(D,M){let ne=D.split("&&");return Ye.create(ne.map(be=>this._deserializeOne(be,M)),null)}static _deserializeOne(D,M){if(D=D.trim(),D.indexOf("!=")>=0){let ne=D.split("!=");return se.create(ne[0].trim(),this._deserializeValue(ne[1],M))}if(D.indexOf("==")>=0){let ne=D.split("==");return I.create(ne[0].trim(),this._deserializeValue(ne[1],M))}if(D.indexOf("=~")>=0){let ne=D.split("=~");return le.create(ne[0].trim(),this._deserializeRegexValue(ne[1],M))}if(D.indexOf(" in ")>=0){let ne=D.split(" in ");return O.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(D)){const ne=D.split(">=");return Y.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(D)){const ne=D.split(">");return j.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(D)){const ne=D.split("<=");return ee.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(D)){const ne=D.split("<");return ue.create(ne[0].trim(),ne[1].trim())}return/^\!\s*/.test(D)?ae.create(D.substr(1).trim()):k.create(D)}static _deserializeValue(D,M){if(D=D.trim(),D==="true")return!0;if(D==="false")return!1;let ne=/^'([^']*)'$/.exec(D);return ne?ne[1].trim():D}static _deserializeRegexValue(D,M){if((0,Pe.m5)(D)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let ne=D.indexOf("/"),be=D.lastIndexOf("/");if(ne===be||ne<0){if(M)throw new Error(`bad regexp-value '${D}', missing /-enclosure`);return console.warn(`bad regexp-value '${D}', missing /-enclosure`),null}let st=D.slice(ne+1,be),ot=D[be+1]==="i"?"i":"";try{return new RegExp(st,ot)}catch(At){if(M)throw new Error(`bad regexp-value '${D}', parse error: ${At}`);return console.warn(`bad regexp-value '${D}', parse error: ${At}`),null}}}function N(Se,D){const M=Se?Se.substituteConstants():void 0,ne=D?D.substituteConstants():void 0;return!M&&!ne?!0:!M||!ne?!1:M.equals(ne)}function d(Se,D){return Se.cmp(D)}class xe{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 q.INSTANCE}}xe.INSTANCE=new xe;class q{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 xe.INSTANCE}}q.INSTANCE=new q;class k{constructor(D,M){this.key=D,this.negated=M,this.type=2}static create(D,M=null){const ne=re.get(D);return typeof ne=="boolean"?ne?q.INSTANCE:xe.INSTANCE:new k(D,M)}cmp(D){return D.type!==this.type?this.type-D.type:ie(this.key,D.key)}equals(D){return D.type===this.type?this.key===D.key:!1}substituteConstants(){const D=re.get(this.key);return typeof D=="boolean"?D?q.INSTANCE:xe.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 I{constructor(D,M,ne){this.key=D,this.value=M,this.negated=ne,this.type=4}static create(D,M,ne=null){if(typeof M=="boolean")return M?k.create(D,ne):ae.create(D,ne);const be=re.get(D);return typeof be=="boolean"?M===(be?"true":"false")?q.INSTANCE:xe.INSTANCE:new I(D,M,ne)}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=re.get(this.key);if(typeof D=="boolean"){const M=D?"true":"false";return this.value===M?q.INSTANCE:xe.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,M){this.key=D,this.valueKey=M,this.type=10,this.negated=null}static create(D,M){return new O(D,M)}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 M=D.getValue(this.valueKey),ne=D.getValue(this.key);return Array.isArray(M)?M.indexOf(ne)>=0:typeof ne=="string"&&typeof M=="object"&&M!==null?E.call(M,ne):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=H.create(this)),this.negated}}class H{constructor(D){this._actual=D,this.type=11}static create(D){return new H(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,M,ne){this.key=D,this.value=M,this.negated=ne,this.type=5}static create(D,M,ne=null){if(typeof M=="boolean")return M?ae.create(D,ne):k.create(D,ne);const be=re.get(D);return typeof be=="boolean"?M===(be?"true":"false")?xe.INSTANCE:q.INSTANCE:new se(D,M,ne)}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=re.get(this.key);if(typeof D=="boolean"){const M=D?"true":"false";return this.value===M?xe.INSTANCE:q.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=I.create(this.key,this.value,this)),this.negated}}class ae{constructor(D,M){this.key=D,this.negated=M,this.type=3}static create(D,M=null){const ne=re.get(D);return typeof ne=="boolean"?ne?xe.INSTANCE:q.INSTANCE:new ae(D,M)}cmp(D){return D.type!==this.type?this.type-D.type:ie(this.key,D.key)}equals(D){return D.type===this.type?this.key===D.key:!1}substituteConstants(){const D=re.get(this.key);return typeof D=="boolean"?D?xe.INSTANCE:q.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(Se,D){if(typeof Se=="string"){const M=parseFloat(Se);isNaN(M)||(Se=M)}return typeof Se=="string"||typeof Se=="number"?D(Se):xe.INSTANCE}class j{constructor(D,M,ne){this.key=D,this.value=M,this.negated=ne,this.type=12}static create(D,M,ne=null){return Z(M,be=>new j(D,be,ne))}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,M,ne){this.key=D,this.value=M,this.negated=ne,this.type=13}static create(D,M,ne=null){return Z(M,be=>new Y(D,be,ne))}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,M,ne){this.key=D,this.value=M,this.negated=ne,this.type=14}static create(D,M,ne=null){return Z(M,be=>new ue(D,be,ne))}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,M,ne){this.key=D,this.value=M,this.negated=ne,this.type=15}static create(D,M,ne=null){return Z(M,be=>new ee(D,be,ne))}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=j.create(this.key,this.value,this)),this.negated}}class le{constructor(D,M){this.key=D,this.regexp=M,this.type=7,this.negated=null}static create(D,M){return new le(D,M)}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 M=this.regexp?this.regexp.source:"",ne=D.regexp?D.regexp.source:"";return M<ne?-1:M>ne?1:0}equals(D){if(D.type===this.type){const M=this.regexp?this.regexp.source:"",ne=D.regexp?D.regexp.source:"";return this.key===D.key&&M===ne}return!1}substituteConstants(){return this}evaluate(D){let M=D.getValue(this.key);return this.regexp?this.regexp.test(M):!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(Se){let D=null;for(let M=0,ne=Se.length;M<ne;M++){const be=Se[M].substituteConstants();if(Se[M]!==be&&D===null){D=[];for(let st=0;st<M;st++)D[st]=Se[st]}D!==null&&(D[M]=be)}return D===null?Se:D}class Ye{constructor(D,M){this.expr=D,this.negated=M,this.type=6}static create(D,M){return Ye._normalizeArr(D,M)}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 M=0,ne=this.expr.length;M<ne;M++){const be=d(this.expr[M],D.expr[M]);if(be!==0)return be}return 0}equals(D){if(D.type===this.type){if(this.expr.length!==D.expr.length)return!1;for(let M=0,ne=this.expr.length;M<ne;M++)if(!this.expr[M].equals(D.expr[M]))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 M=0,ne=this.expr.length;M<ne;M++)if(!this.expr[M].evaluate(D))return!1;return!0}static _normalizeArr(D,M){const ne=[];let be=!1;for(const st of D)if(st){if(st.type===1){be=!0;continue}if(st.type===0)return xe.INSTANCE;if(st.type===6){ne.push(...st.expr);continue}ne.push(st)}if(ne.length===0&&be)return q.INSTANCE;if(ne.length!==0){if(ne.length===1)return ne[0];ne.sort(d);for(let st=1;st<ne.length;st++)ne[st-1].equals(ne[st])&&(ne.splice(st,1),st--);if(ne.length===1)return ne[0];for(;ne.length>1;){const st=ne[ne.length-1];if(st.type!==9)break;ne.pop();const ot=ne.pop(),At=ne.length===0,Xe=We.create(st.expr.map(sr=>Ye.create([sr,ot],null)),null,At);Xe&&(ne.push(Xe),ne.sort(d))}return ne.length===1?ne[0]:new Ye(ne,M)}}serialize(){return this.expr.map(D=>D.serialize()).join(" && ")}keys(){const D=[];for(let M of this.expr)D.push(...M.keys());return D}negate(){if(!this.negated){const D=[];for(let M of this.expr)D.push(M.negate());this.negated=We.create(D,this,!0)}return this.negated}}class We{constructor(D,M){this.expr=D,this.negated=M,this.type=9}static create(D,M,ne){return We._normalizeArr(D,M,ne)}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 M=0,ne=this.expr.length;M<ne;M++){const be=d(this.expr[M],D.expr[M]);if(be!==0)return be}return 0}equals(D){if(D.type===this.type){if(this.expr.length!==D.expr.length)return!1;for(let M=0,ne=this.expr.length;M<ne;M++)if(!this.expr[M].equals(D.expr[M]))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 M=0,ne=this.expr.length;M<ne;M++)if(this.expr[M].evaluate(D))return!0;return!1}static _normalizeArr(D,M,ne){let be=[],st=!1;if(D){for(let ot=0,At=D.length;ot<At;ot++){const Xe=D[ot];if(Xe){if(Xe.type===0){st=!0;continue}if(Xe.type===1)return q.INSTANCE;if(Xe.type===9){be=be.concat(Xe.expr);continue}be.push(Xe)}}if(be.length===0&&st)return xe.INSTANCE;be.sort(d)}if(be.length!==0){if(be.length===1)return be[0];for(let ot=1;ot<be.length;ot++)be[ot-1].equals(be[ot])&&(be.splice(ot,1),ot--);if(be.length===1)return be[0];if(ne){for(let ot=0;ot<be.length;ot++)for(let At=ot+1;At<be.length;At++)he(be[ot],be[At])&&(be.splice(At,1),At--);if(be.length===1)return be[0]}return new We(be,M)}}serialize(){return this.expr.map(D=>D.serialize()).join(" || ")}keys(){const D=[];for(let M of this.expr)D.push(...M.keys());return D}negate(){if(!this.negated){let D=[];for(let M of this.expr)D.push(M.negate());for(;D.length>1;){const M=D.shift(),ne=D.shift(),be=[];for(const ot of Le(M))for(const At of Le(ne))be.push(Ye.create([ot,At],null));const st=D.length===0;D.unshift(We.create(be,null,st))}this.negated=D[0]}return this.negated}}class ut extends k{constructor(D,M,ne){super(D,null),this._defaultValue=M,typeof ne=="object"?ut._info.push(Object.assign(Object.assign({},ne),{key:D})):ne!==!0&&ut._info.push({key:D,description:ne,type:M!=null?typeof M: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 I.create(this.key,D)}}ut._info=[];const gt=(0,rt.yh)("contextKeyService"),de="setContext";function ie(Se,D){return Se<D?-1:Se>D?1:0}function ce(Se,D,M,ne){return Se<M?-1:Se>M?1:D<ne?-1:D>ne?1:0}function he(Se,D){if(D.type===6&&Se.type!==9&&Se.type!==6){for(const be of D.expr)if(Se.equals(be))return!0}const M=Se.negate(),ne=Le(M).concat(Le(D));ne.sort(d);for(let be=0;be<ne.length;be++){const ot=ne[be].negate();for(let At=be+1;At<ne.length;At++){const Xe=ne[At];if(ot.equals(Xe))return!0}}return!1}function Le(Se){return Se.type===9?Se.expr:[Se]}},16925:function($r,It,X){"use strict";X.d(It,{I8:function(){return pe},TG:function(){return Pe},jt:function(){return re},yh:function(){return Me}});var pe;(function(E){E.serviceIds=new Map,E.DI_TARGET="$di$target",E.DI_DEPENDENCIES="$di$dependencies";function Re(N){return N[E.DI_DEPENDENCIES]||[]}E.getServiceDependencies=Re})(pe||(pe={}));const Pe=Me("instantiationService");function rt(E,Re,N,d){Re[pe.DI_TARGET]===Re?Re[pe.DI_DEPENDENCIES].push({id:E,index:N,optional:d}):(Re[pe.DI_DEPENDENCIES]=[{id:E,index:N,optional:d}],Re[pe.DI_TARGET]=Re)}function Me(E){if(pe.serviceIds.has(E))return pe.serviceIds.get(E);const Re=function(N,d,xe){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");rt(Re,N,xe,!1)};return Re.toString=()=>E,pe.serviceIds.set(E,Re),Re}function re(E){return function(Re,N,d){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");rt(E,Re,d,!0)}}},44650:function($r,It,X){"use strict";X.d(It,{B:function(){return Me}});var pe=X(76068),Pe=X(72999);class rt{constructor(){this.data=new Map}add(E,Re){pe.ok(Pe.HD(E)),pe.ok(Pe.Kn(Re)),pe.ok(!this.data.has(E),"There is already an extension with this id"),this.data.set(E,Re)}as(E){return this.data.get(E)||null}}const Me=new rt},66213:function($r,It,X){"use strict";X.d(It,{e:function(){return pe}});var pe;(function(Pe){Pe.DARK="dark",Pe.LIGHT="light",Pe.HIGH_CONTRAST="hc"})(pe||(pe={}))},49055:function($r,It,X){"use strict";X.d(It,{EN:function(){return d},IP:function(){return k},Ic:function(){return H},XE:function(){return Re},bB:function(){return se},kS:function(){return xe},m6:function(){return q}});var pe=X(52615),Pe=X(4348),rt=X(69323),Me=X(16925),re=X(44650),E=X(66213);const Re=(0,Me.yh)("themeService");var N;(function(ae){function Z(j){return j&&typeof j=="object"&&typeof j.id=="string"}ae.isThemeColor=Z})(N||(N={}));function d(ae){return{id:ae}}var xe;(function(ae){function Z(De){return De&&typeof De=="object"&&typeof De.id=="string"&&(typeof De.color=="undefined"||N.isThemeColor(De.color))}ae.isThemeIcon=Z;const j=new RegExp(`^\\$\\((${pe.dT.iconNameExpression}(?:${pe.dT.iconModifierExpression})?)\\)$`);function Y(De){const ve=j.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 le(De,ve){return{id:De.id,color:ve?d(ve):void 0}}ae.asThemeIcon=le,ae.asClassNameArray=pe.dT.asClassNameArray,ae.asClassName=pe.dT.asClassName,ae.asCSSSelector=pe.dT.asCSSSelector})(xe||(xe={}));function q(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 I{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 j=this.themingParticipants.indexOf(Z);this.themingParticipants.splice(j,1)})}getThemingParticipants(){return this.themingParticipants}}let O=new I;re.B.add(k.ThemingContribution,O);function H(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(j=>this.onThemeChange(j)))}onThemeChange(Z){this.theme=Z,this.updateStyles()}updateStyles(){}}},5630:function($r,It,X){"use strict";var pe=X(72308),Pe=X(77321),rt=X(49618),Me=X(52487),re=X(74416),E=X(92310),Re=X.n(E),N=X(18929),d=X(59301),xe=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],q=(0,d.forwardRef)(function(k,I){var O,H=k.prefixCls,se=H===void 0?"rc-checkbox":H,ae=k.className,Z=k.style,j=k.checked,Y=k.disabled,ue=k.defaultChecked,ee=ue===void 0?!1:ue,le=k.type,De=le===void 0?"checkbox":le,ve=k.title,Ye=k.onChange,We=(0,re.Z)(k,xe),ut=(0,d.useRef)(null),gt=(0,N.Z)(ee,{value:j}),de=(0,Me.Z)(gt,2),ie=de[0],ce=de[1];(0,d.useImperativeHandle)(I,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=Re()(se,ae,(O={},(0,rt.Z)(O,"".concat(se,"-checked"),ie),(0,rt.Z)(O,"".concat(se,"-disabled"),Y),O)),Le=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:Le,disabled:Y,checked:!!ie,type:De})),d.createElement("span",{className:"".concat(se,"-inner")}))});It.Z=q},31561:function($r,It,X){"use strict";X.d(It,{Z:function(){return De}});var pe=X(72308),Pe=X(49618),rt=X(52487),Me=X(74416),re=X(35593),E=X(92310),Re=X.n(E),N=X(8654),d=X(59301),xe=X(10228),q=X(16089),k=xe.Z.ESC,I=xe.Z.TAB;function O(ve){var Ye=ve.visible,We=ve.triggerRef,ut=ve.onVisibleChange,gt=ve.autoFocus,de=ve.overlayRef,ie=d.useRef(!1),ce=function(){if(Ye){var D,M;(D=We.current)===null||D===void 0||(M=D.focus)===null||M===void 0||M.call(D),ut==null||ut(!1)}},he=function(){var D;return(D=de.current)!==null&&D!==void 0&&D.focus?(de.current.focus(),ie.current=!0,!0):!1},Le=function(D){switch(D.keyCode){case k:ce();break;case I:{var M=!1;ie.current||(M=he()),M?D.preventDefault():ce();break}}};d.useEffect(function(){return Ye?(window.addEventListener("keydown",Le),gt&&(0,q.Z)(he,3),function(){window.removeEventListener("keydown",Le),ie.current=!1}):function(){ie.current=!1}},[Ye])}var H=(0,d.forwardRef)(function(ve,Ye){var We=ve.overlay,ut=ve.arrow,gt=ve.prefixCls,de=(0,d.useMemo)(function(){var ce;return typeof We=="function"?ce=We():ce=We,ce},[We]),ie=(0,N.sQ)(Ye,de==null?void 0:de.ref);return d.createElement(d.Fragment,null,ut&&d.createElement("div",{className:"".concat(gt,"-arrow")}),d.cloneElement(de,{ref:(0,N.Yr)(de)?ie:void 0}))}),se=H,ae={adjustX:1,adjustY:1},Z=[0,0],j={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=j,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,gt=ut===void 0?!1:ut,de=ve.prefixCls,ie=de===void 0?"rc-dropdown":de,ce=ve.transitionName,he=ve.animation,Le=ve.align,Se=ve.placement,D=Se===void 0?"bottomLeft":Se,M=ve.placements,ne=M===void 0?Y:M,be=ve.getPopupContainer,st=ve.showAction,ot=ve.hideAction,At=ve.overlayClassName,Xe=ve.overlayStyle,sr=ve.visible,jt=ve.trigger,Pt=jt===void 0?["hover"]:jt,Cr=ve.autoFocus,zr=ve.overlay,rr=ve.children,Ur=ve.onVisibleChange,li=(0,Me.Z)(ve,ue),Vr=d.useState(),Ze=(0,rt.Z)(Vr,2),nt=Ze[0],Qe=Ze[1],Ct="visible"in ve?sr: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),Ur==null||Ur(Fe)};O({visible:Ct,triggerRef:Oe,onVisibleChange:et,autoFocus:Cr,overlayRef:ye});var vt=function(Fe){var Ge=ve.onOverlayClick;Qe(!1),Ge&&Ge(Fe)},wt=function(){return d.createElement(se,{ref:ye,overlay:zr,prefixCls:ie,arrow:gt})},Gt=function(){return typeof zr=="function"?wt:wt()},dr=function(){var Fe=ve.minOverlayWidthMatchTrigger,Ge=ve.alignPoint;return"minOverlayWidthMatchTrigger"in ve?Fe:!Ge},Jt=function(){var Fe=ve.openClassName;return Fe!==void 0?Fe:"".concat(ie,"-open")},Ue=d.cloneElement(rr,{className:Re()((We=rr.props)===null||We===void 0?void 0:We.className,Ct&&Jt()),ref:(0,N.Yr)(rr)?(0,N.sQ)(Oe,rr.ref):void 0}),Kt=ot;return!Kt&&Pt.indexOf("contextMenu")!==-1&&(Kt=["click"]),d.createElement(re.Z,(0,pe.Z)({builtinPlacements:ne},li,{prefixCls:ie,ref:Dt,popupClassName:Re()(At,(0,Pe.Z)({},"".concat(ie,"-show-arrow"),gt)),popupStyle:Xe,action:Pt,showAction:st,hideAction:Kt,popupPlacement:D,popupAlign:Le,popupTransitionName:ce,popupAnimation:he,popupVisible:Ct,stretch:dr()?"minWidth":"",popup:Gt(),onPopupVisibleChange:et,onPopupClick:vt,getPopupContainer:be}),Ue)}var le=d.forwardRef(ee),De=le},93681:function($r,It,X){"use strict";X.r(It),X.d(It,{BaseInput:function(){return xe},default:function(){return j}});var pe=X(72308),Pe=X(77321),rt=X(49618),Me=X(62853),re=X(92310),E=X.n(re),Re=X(59301),N=X(5643),d=function(ue){var ee,le,De=ue.inputElement,ve=ue.prefixCls,Ye=ue.prefix,We=ue.suffix,ut=ue.addonBefore,gt=ue.addonAfter,de=ue.className,ie=ue.style,ce=ue.disabled,he=ue.readOnly,Le=ue.focused,Se=ue.triggerFocus,D=ue.allowClear,M=ue.value,ne=ue.handleReset,be=ue.hidden,st=ue.classes,ot=ue.classNames,At=ue.dataAttrs,Xe=ue.styles,sr=ue.components,jt=(sr==null?void 0:sr.affixWrapper)||"span",Pt=(sr==null?void 0:sr.groupWrapper)||"span",Cr=(sr==null?void 0:sr.wrapper)||"span",zr=(sr==null?void 0:sr.groupAddon)||"span",rr=(0,Re.useRef)(null),Ur=function(wt){var Gt;(Gt=rr.current)!==null&&Gt!==void 0&&Gt.contains(wt.target)&&(Se==null||Se())},li=function(){var wt;if(!D)return null;var Gt=!ce&&!he&&M,dr="".concat(ve,"-clear-icon"),Jt=(0,Me.Z)(D)==="object"&&D!==null&&D!==void 0&&D.clearIcon?D.clearIcon:"\u2716";return Re.createElement("span",{onClick:ne,onMouseDown:function(Kt){return Kt.preventDefault()},className:E()(dr,(wt={},(0,rt.Z)(wt,"".concat(dr,"-hidden"),!Gt),(0,rt.Z)(wt,"".concat(dr,"-has-suffix"),!!We),wt)),role:"button",tabIndex:-1},Jt)},Vr=(0,Re.cloneElement)(De,{value:M,hidden:be,className:E()((ee=De.props)===null||ee===void 0?void 0:ee.className,!(0,N.X3)(ue)&&!(0,N.He)(ue)&&de)||null,style:(0,Pe.Z)((0,Pe.Z)({},(le=De.props)===null||le===void 0?void 0:le.style),!(0,N.X3)(ue)&&!(0,N.He)(ue)?ie:{})});if((0,N.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"),Le),(0,rt.Z)(Ze,"".concat(nt,"-readonly"),he),(0,rt.Z)(Ze,"".concat(nt,"-input-with-clear-btn"),We&&D&&M),Ze),!(0,N.He)(ue)&&de,st==null?void 0:st.affixWrapper,ot==null?void 0:ot.affixWrapper),Ct=(We||D)&&Re.createElement("span",{className:E()("".concat(ve,"-suffix"),ot==null?void 0:ot.suffix),style:Xe==null?void 0:Xe.suffix},li(),We);Vr=Re.createElement(jt,(0,pe.Z)({className:Qe,style:(0,Pe.Z)((0,Pe.Z)({},(0,N.He)(ue)?void 0:ie),Xe==null?void 0:Xe.affixWrapper),hidden:!(0,N.He)(ue)&&be,onClick:Ur},At==null?void 0:At.affixWrapper,{ref:rr}),Ye&&Re.createElement("span",{className:E()("".concat(ve,"-prefix"),ot==null?void 0:ot.prefix),style:Xe==null?void 0:Xe.prefix},Ye),(0,Re.cloneElement)(De,{value:M,hidden:null}),Ct)}if((0,N.He)(ue)){var Dt="".concat(ve,"-group"),ye="".concat(Dt,"-addon"),Oe=E()("".concat(ve,"-wrapper"),Dt,st==null?void 0:st.wrapper),et=E()("".concat(ve,"-group-wrapper"),de,st==null?void 0:st.group);return Re.createElement(Pt,{className:et,style:ie,hidden:be},Re.createElement(Cr,{className:Oe},ut&&Re.createElement(zr,{className:ye},ut),(0,Re.cloneElement)(Vr,{hidden:null}),gt&&Re.createElement(zr,{className:ye},gt)))}return Vr},xe=d,q=X(80702),k=X(52487),I=X(74416),O=X(18929),H=X(2738),se=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],ae=(0,Re.forwardRef)(function(Y,ue){var ee=Y.autoComplete,le=Y.onChange,De=Y.onFocus,ve=Y.onBlur,Ye=Y.onPressEnter,We=Y.onKeyDown,ut=Y.prefixCls,gt=ut===void 0?"rc-input":ut,de=Y.disabled,ie=Y.htmlSize,ce=Y.className,he=Y.maxLength,Le=Y.suffix,Se=Y.showCount,D=Y.type,M=D===void 0?"text":D,ne=Y.classes,be=Y.classNames,st=Y.styles,ot=(0,I.Z)(Y,se),At=(0,O.Z)(Y.defaultValue,{value:Y.value}),Xe=(0,k.Z)(At,2),sr=Xe[0],jt=Xe[1],Pt=(0,Re.useState)(!1),Cr=(0,k.Z)(Pt,2),zr=Cr[0],rr=Cr[1],Ur=(0,Re.useRef)(null),li=function(et){Ur.current&&(0,N.nH)(Ur.current,et)};(0,Re.useImperativeHandle)(ue,function(){return{focus:li,blur:function(){var et;(et=Ur.current)===null||et===void 0||et.blur()},setSelectionRange:function(et,vt,wt){var Gt;(Gt=Ur.current)===null||Gt===void 0||Gt.setSelectionRange(et,vt,wt)},select:function(){var et;(et=Ur.current)===null||et===void 0||et.select()},input:Ur.current}}),(0,Re.useEffect)(function(){rr(function(Oe){return Oe&&de?!1:Oe})},[de]);var Vr=function(et){Y.value===void 0&&jt(et.target.value),Ur.current&&(0,N.rJ)(Ur.current,et,le)},Ze=function(et){Ye&&et.key==="Enter"&&Ye(et),We==null||We(et)},nt=function(et){rr(!0),De==null||De(et)},Qe=function(et){rr(!1),ve==null||ve(et)},Ct=function(et){jt(""),li(),Ur.current&&(0,N.rJ)(Ur.current,et,le)},Dt=function(){var et=(0,H.Z)(Y,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Re.createElement("input",(0,pe.Z)({autoComplete:ee},et,{onChange:Vr,onFocus:nt,onBlur:Qe,onKeyDown:Ze,className:E()(gt,(0,rt.Z)({},"".concat(gt,"-disabled"),de),be==null?void 0:be.input),style:st==null?void 0:st.input,ref:Ur,size:ie,type:M}))},ye=function(){var et=Number(he)>0;if(Le||Se){var vt=(0,N.D7)(sr),wt=(0,q.Z)(vt).length,Gt=(0,Me.Z)(Se)==="object"?Se.formatter({value:vt,count:wt,maxLength:he}):"".concat(wt).concat(et?" / ".concat(he):"");return Re.createElement(Re.Fragment,null,!!Se&&Re.createElement("span",{className:E()("".concat(gt,"-show-count-suffix"),(0,rt.Z)({},"".concat(gt,"-show-count-has-suffix"),!!Le),be==null?void 0:be.count),style:(0,Pe.Z)({},st==null?void 0:st.count)},Gt),Le)}return null};return Re.createElement(xe,(0,pe.Z)({},ot,{prefixCls:gt,className:ce,inputElement:Dt(),handleReset:Ct,value:(0,N.D7)(sr),focused:zr,triggerFocus:li,suffix:ye(),disabled:de,classes:ne,classNames:be,styles:st}))}),Z=ae,j=Z},5643:function($r,It,X){"use strict";X.d(It,{D7:function(){return re},He:function(){return pe},X3:function(){return Pe},nH:function(){return Me},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,Re,N,d){if(N){var xe=Re;if(Re.type==="click"){var q=E.cloneNode(!0);xe=Object.create(Re,{target:{value:q},currentTarget:{value:q}}),q.value="",N(xe);return}if(d!==void 0){xe=Object.create(Re,{target:{value:E},currentTarget:{value:E}}),E.value=d,N(xe);return}N(xe)}}function Me(E,Re){if(E){E.focus(Re);var N=Re||{},d=N.cursor;if(d){var xe=E.value.length;switch(d){case"start":E.setSelectionRange(0,0);break;case"end":E.setSelectionRange(xe,xe);break;default:E.setSelectionRange(0,xe)}}}}function re(E){return typeof E=="undefined"||E===null?"":String(E)}},15285:function($r,It,X){"use strict";X.d(It,{iz:function(){return Lr},ck:function(){return Je},BW:function(){return oi},sN:function(){return Je},Wd:function(){return Nt},ZP:function(){return Br},Xl:function(){return We}});var pe=X(72308),Pe=X(49618),rt=X(77321),Me=X(80702),re=X(52487),E=X(74416),Re=X(92310),N=X.n(Re),d=X(11780),xe=X(18929),q=X(13697),k=X(48736),I=X(59301),O=X(4676),H=I.createContext(null);function se(lt,tt){return lt===void 0?null:"".concat(lt,"-").concat(tt)}function ae(lt){var tt=I.useContext(H);return se(tt,lt)}var Z=X(80547),j=["children","locked"],Y=I.createContext(null);function ue(lt,tt){var _t=(0,rt.Z)({},lt);return Object.keys(tt).forEach(function(Lt){var pt=tt[Lt];pt!==void 0&&(_t[Lt]=pt)}),_t}function ee(lt){var tt=lt.children,_t=lt.locked,Lt=(0,E.Z)(lt,j),pt=I.useContext(Y),Ht=(0,Z.Z)(function(){return ue(pt,Lt)},[pt,Lt],function(Bt,lr){return!_t&&(Bt[0]!==lr[0]||!(0,q.Z)(Bt[1],lr[1],!0))});return I.createElement(Y.Provider,{value:Ht},tt)}var le=[],De=I.createContext(null);function ve(){return I.useContext(De)}var Ye=I.createContext(le);function We(lt){var tt=I.useContext(Ye);return I.useMemo(function(){return lt!==void 0?[].concat((0,Me.Z)(tt),[lt]):tt},[tt,lt])}var ut=I.createContext(null),gt=I.createContext({}),de=gt,ie=X(29194);function ce(lt){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,ie.Z)(lt)){var _t=lt.nodeName.toLowerCase(),Lt=["input","select","textarea","button"].includes(_t)||lt.isContentEditable||_t==="a"&&!!lt.getAttribute("href"),pt=lt.getAttribute("tabindex"),Ht=Number(pt),Bt=null;return pt&&!Number.isNaN(Ht)?Bt=Ht: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,Me.Z)(lt.querySelectorAll("*")).filter(function(Lt){return ce(Lt,tt)});return ce(lt,tt)&&_t.unshift(lt),_t}var Le=null;function Se(){Le=document.activeElement}function D(){Le=null}function M(){if(Le)try{Le.focus()}catch(lt){}}function ne(lt,tt){if(tt.keyCode===9){var _t=he(lt),Lt=_t[tt.shiftKey?0:_t.length-1],pt=Lt===document.activeElement||lt===document.activeElement;if(pt){var Ht=_t[tt.shiftKey?_t.length-1:0];Ht.focus(),tt.preventDefault()}}}var be=X(10228),st=X(16089),ot=be.Z.LEFT,At=be.Z.RIGHT,Xe=be.Z.UP,sr=be.Z.DOWN,jt=be.Z.ENTER,Pt=be.Z.ESC,Cr=be.Z.HOME,zr=be.Z.END,rr=[Xe,sr,ot,At];function Ur(lt,tt,_t,Lt){var pt,Ht,Bt,lr,Dr="prev",mr="next",ni="children",ci="parent";if(lt==="inline"&&Lt===jt)return{inlineTrigger:!0};var gi=(pt={},(0,Pe.Z)(pt,Xe,Dr),(0,Pe.Z)(pt,sr,mr),pt),kr=(Ht={},(0,Pe.Z)(Ht,ot,_t?mr:Dr),(0,Pe.Z)(Ht,At,_t?Dr:mr),(0,Pe.Z)(Ht,sr,ni),(0,Pe.Z)(Ht,jt,ni),Ht),Rr=(Bt={},(0,Pe.Z)(Bt,Xe,Dr),(0,Pe.Z)(Bt,sr,mr),(0,Pe.Z)(Bt,jt,ni),(0,Pe.Z)(Bt,Pt,ci),(0,Pe.Z)(Bt,ot,_t?ni:ci),(0,Pe.Z)(Bt,At,_t?ci:ni),Bt),Si={inline:gi,horizontal:kr,vertical:Rr,inlineSub:gi,horizontalSub:Rr,verticalSub:Rr},Ei=(lr=Si["".concat(lt).concat(tt?"":"Sub")])===null||lr===void 0?void 0:lr[Lt];switch(Ei){case Dr:return{offset:-1,sibling:!0};case mr:return{offset:1,sibling:!0};case ci:return{offset:-1,sibling:!1};case ni: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 Vr(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 pt=Ze(lt,tt),Ht=pt.length,Bt=pt.findIndex(function(lr){return _t===lr});return Lt<0?Bt===-1?Bt=Ht-1:Bt-=1:Lt>0&&(Bt+=1),Bt=(Bt+Ht)%Ht,pt[Bt]}var Qe=function(tt,_t){var Lt=new Set,pt=new Map,Ht=new Map;return tt.forEach(function(Bt){var lr=document.querySelector("[data-menu-id='".concat(se(_t,Bt),"']"));lr&&(Lt.add(lr),Ht.set(lr,Bt),pt.set(Bt,lr))}),{elements:Lt,key2element:pt,element2key:Ht}};function Ct(lt,tt,_t,Lt,pt,Ht,Bt,lr,Dr,mr){var ni=I.useRef(),ci=I.useRef();ci.current=tt;var gi=function(){st.Z.cancel(ni.current)};return I.useEffect(function(){return function(){gi()}},[]),function(kr){var Rr=kr.which;if([].concat(rr,[jt,Pt,Cr,zr]).includes(Rr)){var Si=Ht(),Ei=Qe(Si,Lt),Xr=Ei,ti=Xr.elements,ri=Xr.key2element,si=Xr.element2key,Hr=ri.get(tt),fi=Vr(Hr,ti),Ii=si.get(fi),Ci=Ur(lt,Bt(Ii,!0).length===1,_t,Rr);if(!Ci&&Rr!==Cr&&Rr!==zr)return;(rr.includes(Rr)||[Cr,zr].includes(Rr))&&kr.preventDefault();var Tr=function(Gr){if(Gr){var gn=Gr,wn=Gr.querySelector("a");wn!=null&&wn.getAttribute("href")&&(gn=wn);var Gi=si.get(Gr);lr(Gi),gi(),ni.current=(0,st.Z)(function(){ci.current===Gi&&gn.focus()})}};if([Cr,zr].includes(Rr)||Ci.sibling||!fi){var je;!fi||lt==="inline"?je=pt.current:je=li(fi);var ur,br=Ze(je,ti);Rr===Cr?ur=br[0]:Rr===zr?ur=br[br.length-1]:ur=nt(je,ti,fi,Ci.offset),Tr(ur)}else if(Ci.inlineTrigger)Dr(Ii);else if(Ci.offset>0)Dr(Ii,!0),gi(),ni.current=(0,st.Z)(function(){Ei=Qe(Si,Lt);var Ni=fi.getAttribute("aria-controls"),Gr=document.getElementById(Ni),gn=nt(Gr,Ei.elements);Tr(gn)},5);else if(Ci.offset<0){var qr=Bt(Ii,!0),on=qr[qr.length-2],vi=ri.get(on);Dr(on,!1),Tr(vi)}}mr==null||mr(kr)}}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=I.useState({}),tt=(0,re.Z)(lt,2),_t=tt[1],Lt=(0,I.useRef)(new Map),pt=(0,I.useRef)(new Map),Ht=I.useState([]),Bt=(0,re.Z)(Ht,2),lr=Bt[0],Dr=Bt[1],mr=(0,I.useRef)(0),ni=(0,I.useRef)(!1),ci=function(){ni.current||_t({})},gi=(0,I.useCallback)(function(ri,si){var Hr=Oe(si);pt.current.set(Hr,ri),Lt.current.set(ri,Hr),mr.current+=1;var fi=mr.current;Dt(function(){fi===mr.current&&ci()})},[]),kr=(0,I.useCallback)(function(ri,si){var Hr=Oe(si);pt.current.delete(Hr),Lt.current.delete(ri)},[]),Rr=(0,I.useCallback)(function(ri){Dr(ri)},[]),Si=(0,I.useCallback)(function(ri,si){var Hr=Lt.current.get(ri)||"",fi=et(Hr);return si&&lr.includes(fi[0])&&fi.unshift(vt),fi},[lr]),Ei=(0,I.useCallback)(function(ri,si){return ri.some(function(Hr){var fi=Si(Hr,!0);return fi.includes(si)})},[Si]),Xr=function(){var si=(0,Me.Z)(Lt.current.keys());return lr.length&&si.push(vt),si},ti=(0,I.useCallback)(function(ri){var si="".concat(Lt.current.get(ri)).concat(ye),Hr=new Set;return(0,Me.Z)(pt.current.keys()).forEach(function(fi){fi.startsWith(si)&&Hr.add(pt.current.get(fi))}),Hr},[]);return I.useEffect(function(){return function(){ni.current=!0}},[]),{registerPath:gi,unregisterPath:kr,refreshOverflowKeys:Rr,isSubPathKey:Ei,getKeyPath:Si,getKeys:Xr,getSubPathKeys:ti}}function Gt(lt){var tt=I.useRef(lt);tt.current=lt;var _t=I.useCallback(function(){for(var Lt,pt=arguments.length,Ht=new Array(pt),Bt=0;Bt<pt;Bt++)Ht[Bt]=arguments[Bt];return(Lt=tt.current)===null||Lt===void 0?void 0:Lt.call.apply(Lt,[tt].concat(Ht))},[]);return lt?_t:void 0}var dr=Math.random().toFixed(5).toString().slice(2),Jt=0;function Ue(lt){var tt=(0,xe.Z)(lt,{value:lt}),_t=(0,re.Z)(tt,2),Lt=_t[0],pt=_t[1];return I.useEffect(function(){Jt+=1;var Ht="".concat(dr,"-").concat(Jt);pt("rc-menu-uuid-".concat(Ht))},[]),Lt}var Kt=X(96949),wr=X(55090),Fe=X(77205),Ge=X(38793),it=X(2738),Rt=X(8654);function kt(lt,tt,_t,Lt){var pt=I.useContext(Y),Ht=pt.activeKey,Bt=pt.onActive,lr=pt.onInactive,Dr={active:Ht===lt};return tt||(Dr.onMouseEnter=function(mr){_t==null||_t({key:lt,domEvent:mr}),Bt(lt)},Dr.onMouseLeave=function(mr){Lt==null||Lt({key:lt,domEvent:mr}),lr(lt)}),Dr}function zt(lt){var tt=I.useContext(Y),_t=tt.mode,Lt=tt.rtl,pt=tt.inlineIndent;if(_t!=="inline")return null;var Ht=lt;return Lt?{paddingRight:Ht*pt}:{paddingLeft:Ht*pt}}function tr(lt){var tt=lt.icon,_t=lt.props,Lt=lt.children,pt;return tt===null||tt===!1?null:(typeof tt=="function"?pt=I.createElement(tt,(0,rt.Z)({},_t)):typeof tt!="boolean"&&(pt=tt),pt||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 ft=["title","attribute","elementRef"],G=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],fe=["active"],Sr=function(lt){(0,Fe.Z)(_t,lt);var tt=(0,Ge.Z)(_t);function _t(){return(0,Kt.Z)(this,_t),tt.apply(this,arguments)}return(0,wr.Z)(_t,[{key:"render",value:function(){var pt=this.props,Ht=pt.title,Bt=pt.attribute,lr=pt.elementRef,Dr=(0,E.Z)(pt,ft),mr=(0,it.Z)(Dr,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,k.ZP)(!Bt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),I.createElement(d.Z.Item,(0,pe.Z)({},Bt,{title:typeof Ht=="string"?Ht:void 0},mr,{ref:lr}))}}]),_t}(I.Component),Ne=I.forwardRef(function(lt,tt){var _t,Lt=lt.style,pt=lt.className,Ht=lt.eventKey,Bt=lt.warnKey,lr=lt.disabled,Dr=lt.itemIcon,mr=lt.children,ni=lt.role,ci=lt.onMouseEnter,gi=lt.onMouseLeave,kr=lt.onClick,Rr=lt.onKeyDown,Si=lt.onFocus,Ei=(0,E.Z)(lt,G),Xr=ae(Ht),ti=I.useContext(Y),ri=ti.prefixCls,si=ti.onItemClick,Hr=ti.disabled,fi=ti.overflowDisabled,Ii=ti.itemIcon,Ci=ti.selectedKeys,Tr=ti.onActive,je=I.useContext(de),ur=je._internalRenderMenuItem,br="".concat(ri,"-item"),qr=I.useRef(),on=I.useRef(),vi=Hr||lr,Ni=(0,Rt.x1)(tt,on),Gr=We(Ht),gn=function(nn){return{key:Ht,keyPath:(0,Me.Z)(Gr).reverse(),item:qr.current,domEvent:nn}},wn=Dr||Ii,Gi=kt(Ht,vi,ci,gi),ts=Gi.active,Xn=(0,E.Z)(Gi,fe),zn=Ci.includes(Ht),Vn=zt(Gr.length),Or=function(nn){if(!vi){var On=gn(nn);kr==null||kr(B(On)),si(On)}},Ai=function(nn){if(Rr==null||Rr(nn),nn.which===be.Z.ENTER){var On=gn(nn);kr==null||kr(B(On)),si(On)}},Ui=function(nn){Tr(Ht),Si==null||Si(nn)},Vi={};lt.role==="option"&&(Vi["aria-selected"]=zn);var Wn=I.createElement(Sr,(0,pe.Z)({ref:qr,elementRef:Ni,role:ni===null?"none":ni||"menuitem",tabIndex:lr?null:-1,"data-menu-id":fi&&Xr?null:Xr},Ei,Xn,Vi,{component:"li","aria-disabled":lr,style:(0,rt.Z)((0,rt.Z)({},Vn),Lt),className:N()(br,(_t={},(0,Pe.Z)(_t,"".concat(br,"-active"),ts),(0,Pe.Z)(_t,"".concat(br,"-selected"),zn),(0,Pe.Z)(_t,"".concat(br,"-disabled"),vi),_t),pt),onClick:Or,onKeyDown:Ai,onFocus:Ui}),mr,I.createElement(tr,{props:(0,rt.Z)((0,rt.Z)({},lt),{},{isSelected:zn}),icon:wn}));return ur&&(Wn=ur(Wn,lt,{selected:zn})),Wn});function He(lt,tt){var _t=lt.eventKey,Lt=ve(),pt=We(_t);return I.useEffect(function(){if(Lt)return Lt.registerPath(_t,pt),function(){Lt.unregisterPath(_t,pt)}},[pt]),Lt?null:I.createElement(Ne,(0,pe.Z)({},lt,{ref:tt}))}var Je=I.forwardRef(He),W=["className","children"],ge=function(tt,_t){var Lt=tt.className,pt=tt.children,Ht=(0,E.Z)(tt,W),Bt=I.useContext(Y),lr=Bt.prefixCls,Dr=Bt.mode,mr=Bt.rtl;return I.createElement("ul",(0,pe.Z)({className:N()(lr,mr&&"".concat(lr,"-rtl"),"".concat(lr,"-sub"),"".concat(lr,"-").concat(Dr==="inline"?"inline":"vertical"),Lt),role:"menu"},Ht,{"data-menu-list":!0,ref:_t}),pt)},Ee=I.forwardRef(ge);Ee.displayName="SubMenuList";var Ke=Ee,V=X(11592);function qt(lt,tt){return(0,V.Z)(lt).map(function(_t,Lt){if(I.isValidElement(_t)){var pt,Ht,Bt=_t.key,lr=(pt=(Ht=_t.props)===null||Ht===void 0?void 0:Ht.eventKey)!==null&&pt!==void 0?pt:Bt,Dr=lr==null;Dr&&(lr="tmp_key-".concat([].concat((0,Me.Z)(tt),[Lt]).join("-")));var mr={key:lr,eventKey:lr};return I.cloneElement(_t,mr)}return _t})}var Ae=X(35593),Xt={adjustX:1,adjustY:1},yr={topLeft:{points:["bl","tl"],overflow:Xt},topRight:{points:["br","tr"],overflow:Xt},bottomLeft:{points:["tl","bl"],overflow:Xt},bottomRight:{points:["tr","br"],overflow:Xt},leftTop:{points:["tr","tl"],overflow:Xt},leftBottom:{points:["br","bl"],overflow:Xt},rightTop:{points:["tl","tr"],overflow:Xt},rightBottom:{points:["bl","br"],overflow:Xt}},ei={topLeft:{points:["bl","tl"],overflow:Xt},topRight:{points:["br","tr"],overflow:Xt},bottomLeft:{points:["tl","bl"],overflow:Xt},bottomRight:{points:["tr","br"],overflow:Xt},rightTop:{points:["tr","tl"],overflow:Xt},rightBottom:{points:["br","bl"],overflow:Xt},leftTop:{points:["tl","tr"],overflow:Xt},leftBottom:{points:["bl","br"],overflow:Xt}},Li=null;function ui(lt,tt,_t){if(tt)return tt;if(_t)return _t[lt]||_t.other}var Er={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function yi(lt){var tt=lt.prefixCls,_t=lt.visible,Lt=lt.children,pt=lt.popup,Ht=lt.popupStyle,Bt=lt.popupClassName,lr=lt.popupOffset,Dr=lt.disabled,mr=lt.mode,ni=lt.onVisibleChange,ci=I.useContext(Y),gi=ci.getPopupContainer,kr=ci.rtl,Rr=ci.subMenuOpenDelay,Si=ci.subMenuCloseDelay,Ei=ci.builtinPlacements,Xr=ci.triggerSubMenuAction,ti=ci.forceSubMenuRender,ri=ci.rootClassName,si=ci.motion,Hr=ci.defaultMotions,fi=I.useState(!1),Ii=(0,re.Z)(fi,2),Ci=Ii[0],Tr=Ii[1],je=kr?(0,rt.Z)((0,rt.Z)({},ei),Ei):(0,rt.Z)((0,rt.Z)({},yr),Ei),ur=Er[mr],br=ui(mr,si,Hr),qr=I.useRef(br);mr!=="inline"&&(qr.current=br);var on=(0,rt.Z)((0,rt.Z)({},qr.current),{},{leavedClassName:"".concat(tt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),vi=I.useRef();return I.useEffect(function(){return vi.current=(0,st.Z)(function(){Tr(_t)}),function(){st.Z.cancel(vi.current)}},[_t]),I.createElement(Ae.Z,{prefixCls:tt,popupClassName:N()("".concat(tt,"-popup"),(0,Pe.Z)({},"".concat(tt,"-rtl"),kr),Bt,ri),stretch:mr==="horizontal"?"minWidth":null,getPopupContainer:gi,builtinPlacements:je,popupPlacement:ur,popupVisible:Ci,popup:pt,popupStyle:Ht,popupAlign:lr&&{offset:lr},action:Dr?[]:[Xr],mouseEnterDelay:Rr,mouseLeaveDelay:Si,onPopupVisibleChange:ni,forceRender:ti,popupMotion:on,fresh:!0},Lt)}var me=X(77900);function Ce(lt){var tt=lt.id,_t=lt.open,Lt=lt.keyPath,pt=lt.children,Ht="inline",Bt=I.useContext(Y),lr=Bt.prefixCls,Dr=Bt.forceSubMenuRender,mr=Bt.motion,ni=Bt.defaultMotions,ci=Bt.mode,gi=I.useRef(!1);gi.current=ci===Ht;var kr=I.useState(!gi.current),Rr=(0,re.Z)(kr,2),Si=Rr[0],Ei=Rr[1],Xr=gi.current?_t:!1;I.useEffect(function(){gi.current&&Ei(!1)},[ci]);var ti=(0,rt.Z)({},ui(Ht,mr,ni));Lt.length>1&&(ti.motionAppear=!1);var ri=ti.onVisibleChanged;return ti.onVisibleChanged=function(si){return!gi.current&&!si&&Ei(!0),ri==null?void 0:ri(si)},Si?null:I.createElement(ee,{mode:Ht,locked:!gi.current},I.createElement(me.default,(0,pe.Z)({visible:Xr},ti,{forceRender:Dr,removeOnLeave:!1,leavedClassName:"".concat(lr,"-hidden")}),function(si){var Hr=si.className,fi=si.style;return I.createElement(Ke,{id:tt,className:Hr,style:fi},pt)}))}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,pt=tt.className,Ht=tt.title,Bt=tt.eventKey,lr=tt.warnKey,Dr=tt.disabled,mr=tt.internalPopupClose,ni=tt.children,ci=tt.itemIcon,gi=tt.expandIcon,kr=tt.popupClassName,Rr=tt.popupOffset,Si=tt.popupStyle,Ei=tt.onClick,Xr=tt.onMouseEnter,ti=tt.onMouseLeave,ri=tt.onTitleClick,si=tt.onTitleMouseEnter,Hr=tt.onTitleMouseLeave,fi=(0,E.Z)(tt,Mt),Ii=ae(Bt),Ci=I.useContext(Y),Tr=Ci.prefixCls,je=Ci.mode,ur=Ci.openKeys,br=Ci.disabled,qr=Ci.overflowDisabled,on=Ci.activeKey,vi=Ci.selectedKeys,Ni=Ci.itemIcon,Gr=Ci.expandIcon,gn=Ci.onItemClick,wn=Ci.onOpenChange,Gi=Ci.onActive,ts=I.useContext(de),Xn=ts._internalRenderSubMenuItem,zn=I.useContext(ut),Vn=zn.isSubPathKey,Or=We(),Ai="".concat(Tr,"-submenu"),Ui=br||Dr,Vi=I.useRef(),Wn=I.useRef(),bn=ci!=null?ci:Ni,nn=gi!=null?gi:Gr,On=ur.includes(Bt),$i=!qr&&On,rs=Vn(vi,Bt),Wr=kt(Bt,Ui,si,Hr),ss=Wr.active,Jn=(0,E.Z)(Wr,ct),Sn=I.useState(!1),Ri=(0,re.Z)(Sn,2),ps=Ri[0],ys=Ri[1],us=function(kn){Ui||ys(kn)},pi=function(kn){us(!0),Xr==null||Xr({key:Bt,domEvent:kn})},bs=function(kn){us(!1),ti==null||ti({key:Bt,domEvent:kn})},_s=I.useMemo(function(){return ss||(je!=="inline"?ps||Vn([on],Bt):!1)},[je,ss,on,ps,Bt,Vn]),ir=zt(Or.length),vn=function(kn){Ui||(ri==null||ri({key:Bt,domEvent:kn}),je==="inline"&&wn(Bt,!On))},xs=Gt(function(Bn){Ei==null||Ei(B(Bn)),gn(Bn)}),cs=function(kn){je!=="inline"&&wn(Bt,kn)},hn=function(){Gi(Bt)},dn=Ii&&"".concat(Ii,"-popup"),Oi=I.createElement("div",(0,pe.Z)({role:"menuitem",style:ir,className:"".concat(Ai,"-title"),tabIndex:Ui?null:-1,ref:Vi,title:typeof Ht=="string"?Ht:null,"data-menu-id":qr&&Ii?null:Ii,"aria-expanded":$i,"aria-haspopup":!0,"aria-controls":dn,"aria-disabled":Ui,onClick:vn,onFocus:hn},Jn),Ht,I.createElement(tr,{icon:je!=="horizontal"?nn:void 0,props:(0,rt.Z)((0,rt.Z)({},tt),{},{isOpen:$i,isSubMenu:!0})},I.createElement("i",{className:"".concat(Ai,"-arrow")}))),sn=I.useRef(je);if(je!=="inline"&&Or.length>1?sn.current="vertical":sn.current=je,!qr){var Un=sn.current;Oi=I.createElement(yi,{mode:Un,prefixCls:Ai,visible:!mr&&$i&&je!=="inline",popupClassName:kr,popupOffset:Rr,popupStyle:Si,popup:I.createElement(ee,{mode:Un==="horizontal"?"vertical":Un},I.createElement(Ke,{id:dn,ref:Wn},ni)),disabled:Ui,onVisibleChange:cs},Oi)}var jn=I.createElement(d.Z.Item,(0,pe.Z)({role:"none"},fi,{component:"li",style:Lt,className:N()(Ai,"".concat(Ai,"-").concat(je),pt,(_t={},(0,Pe.Z)(_t,"".concat(Ai,"-open"),$i),(0,Pe.Z)(_t,"".concat(Ai,"-active"),_s),(0,Pe.Z)(_t,"".concat(Ai,"-selected"),rs),(0,Pe.Z)(_t,"".concat(Ai,"-disabled"),Ui),_t)),onMouseEnter:pi,onMouseLeave:bs}),Oi,!qr&&I.createElement(Ce,{id:dn,open:$i,keyPath:Or},ni));return Xn&&(jn=Xn(jn,tt,{selected:rs,active:_s,open:$i,disabled:Ui})),I.createElement(ee,{onItemClick:xs,mode:je==="horizontal"?"vertical":je,itemIcon:bn,expandIcon:nn},jn)};function Nt(lt){var tt=lt.eventKey,_t=lt.children,Lt=We(tt),pt=qt(_t,Lt),Ht=ve();I.useEffect(function(){if(Ht)return Ht.registerPath(tt,Lt),function(){Ht.unregisterPath(tt,Lt)}},[Lt]);var Bt;return Ht?Bt=pt:Bt=I.createElement(Et,lt,pt),I.createElement(Ye.Provider,{value:Lt},Bt)}var ar=X(62853),Qt=["className","title","eventKey","children"],Pr=["children"],Ar=function(tt){var _t=tt.className,Lt=tt.title,pt=tt.eventKey,Ht=tt.children,Bt=(0,E.Z)(tt,Qt),lr=I.useContext(Y),Dr=lr.prefixCls,mr="".concat(Dr,"-item-group");return I.createElement("li",(0,pe.Z)({role:"presentation"},Bt,{onClick:function(ci){return ci.stopPropagation()},className:N()(mr,_t)}),I.createElement("div",{role:"presentation",className:"".concat(mr,"-title"),title:typeof Lt=="string"?Lt:void 0},Lt),I.createElement("ul",{role:"group",className:"".concat(mr,"-list")},Ht))};function oi(lt){var tt=lt.children,_t=(0,E.Z)(lt,Pr),Lt=We(_t.eventKey),pt=qt(tt,Lt),Ht=ve();return Ht?pt:I.createElement(Ar,(0,it.Z)(_t,["warnKey"]),pt)}function Lr(lt){var tt=lt.className,_t=lt.style,Lt=I.useContext(Y),pt=Lt.prefixCls,Ht=ve();return Ht?null:I.createElement("li",{role:"separator",className:N()("".concat(pt,"-item-divider"),tt),style:_t})}var Fr=["label","children","key","type"];function ii(lt){return(lt||[]).map(function(tt,_t){if(tt&&(0,ar.Z)(tt)==="object"){var Lt=tt,pt=Lt.label,Ht=Lt.children,Bt=Lt.key,lr=Lt.type,Dr=(0,E.Z)(Lt,Fr),mr=Bt!=null?Bt:"tmp-".concat(_t);return Ht||lr==="group"?lr==="group"?I.createElement(oi,(0,pe.Z)({key:mr},Dr,{title:pt}),ii(Ht)):I.createElement(Nt,(0,pe.Z)({key:mr},Dr,{title:pt}),ii(Ht)):lr==="divider"?I.createElement(Lr,(0,pe.Z)({key:mr},Dr)):I.createElement(Je,(0,pe.Z)({key:mr},Dr),pt)}return null}).filter(function(tt){return tt})}function bi(lt,tt,_t){var Lt=lt;return tt&&(Lt=ii(tt)),qt(Lt,_t)}var Fi=["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=[],Kr=I.forwardRef(function(lt,tt){var _t,Lt,pt=lt,Ht=pt.prefixCls,Bt=Ht===void 0?"rc-menu":Ht,lr=pt.rootClassName,Dr=pt.style,mr=pt.className,ni=pt.tabIndex,ci=ni===void 0?0:ni,gi=pt.items,kr=pt.children,Rr=pt.direction,Si=pt.id,Ei=pt.mode,Xr=Ei===void 0?"vertical":Ei,ti=pt.inlineCollapsed,ri=pt.disabled,si=pt.disabledOverflow,Hr=pt.subMenuOpenDelay,fi=Hr===void 0?.1:Hr,Ii=pt.subMenuCloseDelay,Ci=Ii===void 0?.1:Ii,Tr=pt.forceSubMenuRender,je=pt.defaultOpenKeys,ur=pt.openKeys,br=pt.activeKey,qr=pt.defaultActiveFirst,on=pt.selectable,vi=on===void 0?!0:on,Ni=pt.multiple,Gr=Ni===void 0?!1:Ni,gn=pt.defaultSelectedKeys,wn=pt.selectedKeys,Gi=pt.onSelect,ts=pt.onDeselect,Xn=pt.inlineIndent,zn=Xn===void 0?24:Xn,Vn=pt.motion,Or=pt.defaultMotions,Ai=pt.triggerSubMenuAction,Ui=Ai===void 0?"hover":Ai,Vi=pt.builtinPlacements,Wn=pt.itemIcon,bn=pt.expandIcon,nn=pt.overflowedIndicator,On=nn===void 0?"...":nn,$i=pt.overflowedIndicatorPopupClassName,rs=pt.getPopupContainer,Wr=pt.onClick,ss=pt.onOpenChange,Jn=pt.onKeyDown,Sn=pt.openAnimation,Ri=pt.openTransitionName,ps=pt._internalRenderMenuItem,ys=pt._internalRenderSubMenuItem,us=(0,E.Z)(pt,Fi),pi=I.useMemo(function(){return bi(kr,gi,mi)},[kr,gi]),bs=I.useState(!1),_s=(0,re.Z)(bs,2),ir=_s[0],vn=_s[1],xs=I.useRef(),cs=Ue(Si),hn=Rr==="rtl",dn=(0,xe.Z)(je,{value:ur,postState:function(Yi){return Yi||mi}}),Oi=(0,re.Z)(dn,2),sn=Oi[0],Un=Oi[1],jn=function(Yi){var Xi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Es(){Un(Yi),ss==null||ss(Yi)}Xi?(0,O.flushSync)(Es):Es()},Bn=I.useState(sn),kn=(0,re.Z)(Bn,2),Pi=kn[0],_i=kn[1],Di=I.useRef(!1),ln=I.useMemo(function(){return(Xr==="inline"||Xr==="vertical")&&ti?["vertical",ti]:[Xr,!1]},[Xr,ti]),Tn=(0,re.Z)(ln,2),Qn=Tn[0],Ir=Tn[1],Jr=Qn==="inline",_n=I.useState(Qn),In=(0,re.Z)(_n,2),Qi=In[0],Ks=In[1],hs=I.useState(Ir),ws=(0,re.Z)(hs,2),qn=ws[0],Zs=ws[1];I.useEffect(function(){Ks(Qn),Zs(Ir),Di.current&&(Jr?Un(Pi):jn(mi))},[Qn,Ir]);var sa=I.useState(0),Pa=(0,re.Z)(sa,2),Sa=Pa[0],Oa=Pa[1],xn=Sa>=pi.length-1||Qi!=="horizontal"||si;I.useEffect(function(){Jr&&_i(sn)},[sn]),I.useEffect(function(){return Di.current=!0,function(){Di.current=!1}},[]);var Ss=wt(),Kn=Ss.registerPath,Ys=Ss.unregisterPath,Ba=Ss.refreshOverflowKeys,aa=Ss.isSubPathKey,Yo=Ss.getKeyPath,yo=Ss.getKeys,Ts=Ss.getSubPathKeys,bo=I.useMemo(function(){return{registerPath:Kn,unregisterPath:Ys}},[Kn,Ys]),Fa=I.useMemo(function(){return{isSubPathKey:aa}},[aa]);I.useEffect(function(){Ba(xn?mi:pi.slice(Sa+1).map(function(Ki){return Ki.key}))},[Sa,xn]);var Xs=(0,xe.Z)(br||qr&&((_t=pi[0])===null||_t===void 0?void 0:_t.key),{value:br}),_o=(0,re.Z)(Xs,2),da=_o[0],Ea=_o[1],Ja=Gt(function(Ki){Ea(Ki)}),Xo=Gt(function(){Ea(void 0)});(0,I.useImperativeHandle)(tt,function(){return{list:xs.current,focus:function(Yi){var Xi,Es=yo(),En=Qe(Es,cs),Ua=En.elements,Vt=En.key2element,ro=En.element2key,wo=Ze(xs.current,Ua),io=da!=null?da:wo[0]?ro.get(wo[0]):(Xi=pi.find(function(So){return!So.props.disabled}))===null||Xi===void 0?void 0:Xi.key,oa=Vt.get(io);if(io&&oa){var Hs;oa==null||(Hs=oa.focus)===null||Hs===void 0||Hs.call(oa,Yi)}}}});var Na=(0,xe.Z)(gn||[],{value:wn,postState:function(Yi){return Array.isArray(Yi)?Yi:Yi==null?mi:[Yi]}}),Jo=(0,re.Z)(Na,2),Cs=Jo[0],Qa=Jo[1],xo=function(Yi){if(vi){var Xi=Yi.key,Es=Cs.includes(Xi),En;Gr?Es?En=Cs.filter(function(Vt){return Vt!==Xi}):En=[].concat((0,Me.Z)(Cs),[Xi]):En=[Xi],Qa(En);var Ua=(0,rt.Z)((0,rt.Z)({},Yi),{},{selectedKeys:En});Es?ts==null||ts(Ua):Gi==null||Gi(Ua)}!Gr&&sn.length&&Qi!=="inline"&&jn(mi)},$a=Gt(function(Ki){Wr==null||Wr(B(Ki)),xo(Ki)}),eo=Gt(function(Ki,Yi){var Xi=sn.filter(function(En){return En!==Ki});if(Yi)Xi.push(Ki);else if(Qi!=="inline"){var Es=Ts(Ki);Xi=Xi.filter(function(En){return!Es.has(En)})}(0,q.Z)(sn,Xi,!0)||jn(Xi,!0)}),to=function(Yi,Xi){var Es=Xi!=null?Xi:!sn.includes(Yi);eo(Yi,Es)},Js=Ct(Qi,da,hn,cs,xs,yo,Yo,Ea,to,Jn);I.useEffect(function(){vn(!0)},[]);var za=I.useMemo(function(){return{_internalRenderMenuItem:ps,_internalRenderSubMenuItem:ys}},[ps,ys]),Os=Qi!=="horizontal"||si?pi:pi.map(function(Ki,Yi){return I.createElement(ee,{key:Ki.key,overflowDisabled:Yi>Sa},Ki)}),Qo=I.createElement(d.Z,(0,pe.Z)({id:Si,ref:xs,prefixCls:"".concat(Bt,"-overflow"),component:"ul",itemComponent:Je,className:N()(Bt,"".concat(Bt,"-root"),"".concat(Bt,"-").concat(Qi),mr,(Lt={},(0,Pe.Z)(Lt,"".concat(Bt,"-inline-collapsed"),qn),(0,Pe.Z)(Lt,"".concat(Bt,"-rtl"),hn),Lt),lr),dir:Rr,style:Dr,role:"menu",tabIndex:ci,data:Os,renderRawItem:function(Yi){return Yi},renderRawRest:function(Yi){var Xi=Yi.length,Es=Xi?pi.slice(-Xi):null;return I.createElement(Nt,{eventKey:vt,title:On,disabled:xn,internalPopupClose:Xi===0,popupClassName:$i},Es)},maxCount:Qi!=="horizontal"||si?d.Z.INVALIDATE:d.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Yi){Oa(Yi)},onKeyDown:Js},us));return I.createElement(de.Provider,{value:za},I.createElement(H.Provider,{value:cs},I.createElement(ee,{prefixCls:Bt,rootClassName:lr,mode:Qi,openKeys:sn,rtl:hn,disabled:ri,motion:ir?Vn:null,defaultMotions:ir?Or:null,activeKey:da,onActive:Ja,onInactive:Xo,selectedKeys:Cs,inlineIndent:zn,subMenuOpenDelay:fi,subMenuCloseDelay:Ci,forceSubMenuRender:Tr,builtinPlacements:Vi,triggerSubMenuAction:Ui,getPopupContainer:rs,itemIcon:Wn,expandIcon:bn,onItemClick:$a,onOpenChange:eo},I.createElement(ut.Provider,{value:Fa},Qo),I.createElement("div",{style:{display:"none"},"aria-hidden":!0},I.createElement(De.Provider,{value:bo},pi)))))}),Hi=Kr,Yr=Hi;Yr.Item=Je,Yr.SubMenu=Nt,Yr.ItemGroup=oi,Yr.Divider=Lr;var Br=Yr},11780:function($r,It,X){"use strict";X.d(It,{Z:function(){return Se}});var pe=X(72308),Pe=X(77321),rt=X(52487),Me=X(74416),re=X(59301),E=X(92310),Re=X.n(E),N=X(29301),d=X(34280),xe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],q=void 0;function k(D,M){var ne=D.prefixCls,be=D.invalidate,st=D.item,ot=D.renderItem,At=D.responsive,Xe=D.responsiveDisabled,sr=D.registerSize,jt=D.itemKey,Pt=D.className,Cr=D.style,zr=D.children,rr=D.display,Ur=D.order,li=D.component,Vr=li===void 0?"div":li,Ze=(0,Me.Z)(D,xe),nt=At&&!rr;function Qe(et){sr(jt,et)}re.useEffect(function(){return function(){Qe(null)}},[]);var Ct=ot&&st!==q?ot(st,{index:Ur}):zr,Dt;be||(Dt={opacity:nt?0:1,height:nt?0:q,overflowY:nt?"hidden":q,order:At?Ur:q,pointerEvents:nt?"none":q,position:nt?"absolute":q});var ye={};nt&&(ye["aria-hidden"]=!0);var Oe=re.createElement(Vr,(0,pe.Z)({className:Re()(!be&&ne,Pt),style:(0,Pe.Z)((0,Pe.Z)({},Dt),Cr)},ye,Ze,{ref:M}),Ct);return At&&(Oe=re.createElement(N.Z,{onResize:function(vt){var wt=vt.offsetWidth;Qe(wt)},disabled:Xe},Oe)),Oe}var I=re.forwardRef(k);I.displayName="Item";var O=I,H=X(6089),se=X(4676),ae=X(16089);function Z(D){if(typeof MessageChannel=="undefined")(0,ae.Z)(D);else{var M=new MessageChannel;M.port1.onmessage=function(){return D()},M.port2.postMessage(void 0)}}function j(){var D=re.useRef(null),M=function(be){D.current||(D.current=[],Z(function(){(0,se.unstable_batchedUpdates)(function(){D.current.forEach(function(st){st()}),D.current=null})})),D.current.push(be)};return M}function Y(D,M){var ne=re.useState(M),be=(0,rt.Z)(ne,2),st=be[0],ot=be[1],At=(0,H.Z)(function(Xe){D(function(){ot(Xe)})});return[st,At]}var ue=re.createContext(null),ee=["component"],le=["className"],De=["className"],ve=function(M,ne){var be=re.useContext(ue);if(!be){var st=M.component,ot=st===void 0?"div":st,At=(0,Me.Z)(M,ee);return re.createElement(ot,(0,pe.Z)({},At,{ref:ne}))}var Xe=be.className,sr=(0,Me.Z)(be,le),jt=M.className,Pt=(0,Me.Z)(M,De);return re.createElement(ue.Provider,{value:null},re.createElement(O,(0,pe.Z)({ref:ne,className:Re()(Xe,jt)},sr,Pt)))},Ye=re.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"],gt="responsive",de="invalidate";function ie(D){return"+ ".concat(D.length," ...")}function ce(D,M){var ne=D.prefixCls,be=ne===void 0?"rc-overflow":ne,st=D.data,ot=st===void 0?[]:st,At=D.renderItem,Xe=D.renderRawItem,sr=D.itemKey,jt=D.itemWidth,Pt=jt===void 0?10:jt,Cr=D.ssr,zr=D.style,rr=D.className,Ur=D.maxCount,li=D.renderRest,Vr=D.renderRawRest,Ze=D.suffix,nt=D.component,Qe=nt===void 0?"div":nt,Ct=D.itemComponent,Dt=D.onVisibleChange,ye=(0,Me.Z)(D,ut),Oe=Cr==="full",et=j(),vt=Y(et,null),wt=(0,rt.Z)(vt,2),Gt=wt[0],dr=wt[1],Jt=Gt||0,Ue=Y(et,new Map),Kt=(0,rt.Z)(Ue,2),wr=Kt[0],Fe=Kt[1],Ge=Y(et,0),it=(0,rt.Z)(Ge,2),Rt=it[0],kt=it[1],zt=Y(et,0),tr=(0,rt.Z)(zt,2),T=tr[0],B=tr[1],ft=Y(et,0),G=(0,rt.Z)(ft,2),fe=G[0],Sr=G[1],Ne=(0,re.useState)(null),He=(0,rt.Z)(Ne,2),Je=He[0],W=He[1],ge=(0,re.useState)(null),Ee=(0,rt.Z)(ge,2),Ke=Ee[0],V=Ee[1],qt=re.useMemo(function(){return Ke===null&&Oe?Number.MAX_SAFE_INTEGER:Ke||0},[Ke,Gt]),Ae=(0,re.useState)(!1),Xt=(0,rt.Z)(Ae,2),yr=Xt[0],ei=Xt[1],Li="".concat(be,"-item"),ui=Math.max(Rt,T),Er=Ur===gt,yi=ot.length&&Er,me=Ur===de,Ce=yi||typeof Ur=="number"&&ot.length>Ur,Mt=(0,re.useMemo)(function(){var Br=ot;return yi?Gt===null&&Oe?Br=ot:Br=ot.slice(0,Math.min(ot.length,Jt/Pt)):typeof Ur=="number"&&(Br=ot.slice(0,Ur)),Br},[ot,Pt,Gt,Ur,yi]),ct=(0,re.useMemo)(function(){return yi?ot.slice(qt+1):ot.slice(Mt.length)},[ot,Mt,yi,qt]),Et=(0,re.useCallback)(function(Br,lt){var tt;return typeof sr=="function"?sr(Br):(tt=sr&&(Br==null?void 0:Br[sr]))!==null&&tt!==void 0?tt:lt},[sr]),Nt=(0,re.useCallback)(At||function(Br){return Br},[At]);function ar(Br,lt,tt){Ke===Br&&(lt===void 0||lt===Je)||(V(Br),tt||(ei(Br<ot.length-1),Dt==null||Dt(Br)),lt!==void 0&&W(lt))}function Qt(Br,lt){dr(lt.clientWidth)}function Pr(Br,lt){Fe(function(tt){var _t=new Map(tt);return lt===null?_t.delete(Br):_t.set(Br,lt),_t})}function Ar(Br,lt){B(lt),kt(T)}function oi(Br,lt){Sr(lt)}function Lr(Br){return wr.get(Et(Mt[Br],Br))}(0,d.Z)(function(){if(Jt&&typeof ui=="number"&&Mt){var Br=fe,lt=Mt.length,tt=lt-1;if(!lt){ar(0,null);return}for(var _t=0;_t<lt;_t+=1){var Lt=Lr(_t);if(Oe&&(Lt=Lt||0),Lt===void 0){ar(_t-1,void 0,!0);break}if(Br+=Lt,tt===0&&Br<=Jt||_t===tt-1&&Br+Lr(tt)<=Jt){ar(tt,null);break}else if(Br+ui>Jt){ar(_t-1,Br-Lt-fe+T);break}}Ze&&Lr(0)+fe>Jt&&W(null)}},[Jt,wr,T,fe,Et,Mt]);var Fr=yr&&!!ct.length,ii={};Je!==null&&yi&&(ii={position:"absolute",left:Je,top:0});var bi={prefixCls:Li,responsive:yi,component:Ct,invalidate:me},Fi=Xe?function(Br,lt){var tt=Et(Br,lt);return re.createElement(ue.Provider,{key:tt,value:(0,Pe.Z)((0,Pe.Z)({},bi),{},{order:lt,item:Br,itemKey:tt,registerSize:Pr,display:lt<=qt})},Xe(Br,lt))}:function(Br,lt){var tt=Et(Br,lt);return re.createElement(O,(0,pe.Z)({},bi,{order:lt,key:tt,item:Br,renderItem:Nt,itemKey:tt,registerSize:Pr,display:lt<=qt}))},mi={order:Fr?qt:Number.MAX_SAFE_INTEGER,className:"".concat(Li,"-rest"),registerSize:Ar,display:Fr},Kr=li||ie,Hi=Vr?re.createElement(ue.Provider,{value:(0,Pe.Z)((0,Pe.Z)({},bi),mi)},Vr(ct)):re.createElement(O,(0,pe.Z)({},bi,mi),typeof Kr=="function"?Kr(ct):Kr),Yr=re.createElement(Qe,(0,pe.Z)({className:Re()(!me&&be,rr),style:zr,ref:M},ye),Mt.map(Fi),Ce?Hi:null,Ze&&re.createElement(O,(0,pe.Z)({},bi,{responsive:Er,responsiveDisabled:!yi,order:qt,className:"".concat(Li,"-suffix"),registerSize:oi,display:!0,style:ii}),Ze));return Er?re.createElement(N.Z,{onResize:Qt,disabled:!yi},Yr):Yr}var he=re.forwardRef(ce);he.displayName="Overflow",he.Item=We,he.RESPONSIVE=gt,he.INVALIDATE=de;var Le=he,Se=Le},29301:function($r,It,X){"use strict";X.d(It,{Z:function(){return de}});var pe=X(72308),Pe=X(59301),rt=X(11592),Me=X(48736),re=X(77321),E=X(62853),Re=X(76846),N=X(8654),d=Pe.createContext(null);function xe(ie){var ce=ie.children,he=ie.onBatchResize,Le=Pe.useRef(0),Se=Pe.useRef([]),D=Pe.useContext(d),M=Pe.useCallback(function(ne,be,st){Le.current+=1;var ot=Le.current;Se.current.push({size:ne,element:be,data:st}),Promise.resolve().then(function(){ot===Le.current&&(he==null||he(Se.current),Se.current=[])}),D==null||D(ne,be,st)},[he,D]);return Pe.createElement(d.Provider,{value:M},ce)}var q=X(76374),k=new Map;function I(ie){ie.forEach(function(ce){var he,Le=ce.target;(he=k.get(Le))===null||he===void 0||he.forEach(function(Se){return Se(Le)})})}var O=new q.Z(I),H=null,se=null;function ae(ie,ce){k.has(ie)||(k.set(ie,new Set),O.observe(ie)),k.get(ie).add(ce)}function Z(ie,ce){k.has(ie)&&(k.get(ie).delete(ce),k.get(ie).size||(O.unobserve(ie),k.delete(ie)))}var j=X(96949),Y=X(55090),ue=X(77205),ee=X(38793),le=function(ie){(0,ue.Z)(he,ie);var ce=(0,ee.Z)(he);function he(){return(0,j.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(ie,ce){var he=ie.children,Le=ie.disabled,Se=Pe.useRef(null),D=Pe.useRef(null),M=Pe.useContext(d),ne=typeof he=="function",be=ne?he(Se):he,st=Pe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ot=!ne&&Pe.isValidElement(be)&&(0,N.Yr)(be),At=ot?(0,N.C4)(be):null,Xe=(0,N.x1)(At,Se),sr=function(){var zr;return(0,Re.ZP)(Se.current)||(Se.current&&(0,E.Z)(Se.current)==="object"?(0,Re.ZP)((zr=Se.current)===null||zr===void 0?void 0:zr.nativeElement):null)||(0,Re.ZP)(D.current)};Pe.useImperativeHandle(ce,function(){return sr()});var jt=Pe.useRef(ie);jt.current=ie;var Pt=Pe.useCallback(function(Cr){var zr=jt.current,rr=zr.onResize,Ur=zr.data,li=Cr.getBoundingClientRect(),Vr=li.width,Ze=li.height,nt=Cr.offsetWidth,Qe=Cr.offsetHeight,Ct=Math.floor(Vr),Dt=Math.floor(Ze);if(st.current.width!==Ct||st.current.height!==Dt||st.current.offsetWidth!==nt||st.current.offsetHeight!==Qe){var ye={width:Ct,height:Dt,offsetWidth:nt,offsetHeight:Qe};st.current=ye;var Oe=nt===Math.round(Vr)?Vr:nt,et=Qe===Math.round(Ze)?Ze:Qe,vt=(0,re.Z)((0,re.Z)({},ye),{},{offsetWidth:Oe,offsetHeight:et});M==null||M(vt,Cr,Ur),rr&&Promise.resolve().then(function(){rr(vt,Cr)})}},[]);return Pe.useEffect(function(){var Cr=sr();return Cr&&!Le&&ae(Cr,Pt),function(){return Z(Cr,Pt)}},[Se.current,Le]),Pe.createElement(le,{ref:D},ot?Pe.cloneElement(be,{ref:Xe}):be)}var ve=Pe.forwardRef(De),Ye=ve,We="rc-observer-key";function ut(ie,ce){var he=ie.children,Le=typeof he=="function"?[he]:(0,rt.Z)(he);return Le.map(function(Se,D){var M=(Se==null?void 0:Se.key)||"".concat(We,"-").concat(D);return Pe.createElement(Ye,(0,pe.Z)({},ie,{key:M,ref:D===0?ce:void 0}),Se)})}var gt=Pe.forwardRef(ut);gt.Collection=xe;var de=gt},55477:function($r,It,X){"use strict";X.d(It,{G:function(){return I},Z:function(){return ae}});var pe=X(72308),Pe=X(77321),rt=X(74416),Me=X(35593),re=X(59301),E={shiftX:64,adjustY:1},Re={adjustX:1,shiftY:!0},N=[0,0],d={left:{points:["cr","cl"],overflow:Re,offset:[-4,0],targetOffset:N},right:{points:["cl","cr"],overflow:Re,offset:[4,0],targetOffset:N},top:{points:["bc","tc"],overflow:E,offset:[0,-4],targetOffset:N},bottom:{points:["tc","bc"],overflow:E,offset:[0,4],targetOffset:N},topLeft:{points:["bl","tl"],overflow:E,offset:[0,-4],targetOffset:N},leftTop:{points:["tr","tl"],overflow:Re,offset:[-4,0],targetOffset:N},topRight:{points:["br","tr"],overflow:E,offset:[0,-4],targetOffset:N},rightTop:{points:["tl","tr"],overflow:Re,offset:[4,0],targetOffset:N},bottomRight:{points:["tr","br"],overflow:E,offset:[0,4],targetOffset:N},rightBottom:{points:["bl","br"],overflow:Re,offset:[4,0],targetOffset:N},bottomLeft:{points:["tl","bl"],overflow:E,offset:[0,4],targetOffset:N},leftBottom:{points:["br","bl"],overflow:Re,offset:[-4,0],targetOffset:N}},xe=null,q=X(92310),k=X.n(q);function I(Z){var j=Z.children,Y=Z.prefixCls,ue=Z.id,ee=Z.overlayInnerStyle,le=Z.className,De=Z.style;return re.createElement("div",{className:k()("".concat(Y,"-content"),le),style:De},re.createElement("div",{className:"".concat(Y,"-inner"),id:ue,role:"tooltip",style:ee},typeof j=="function"?j():j))}var O=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],H=function(j,Y){var ue=j.overlayClassName,ee=j.trigger,le=ee===void 0?["hover"]:ee,De=j.mouseEnterDelay,ve=De===void 0?0:De,Ye=j.mouseLeaveDelay,We=Ye===void 0?.1:Ye,ut=j.overlayStyle,gt=j.prefixCls,de=gt===void 0?"rc-tooltip":gt,ie=j.children,ce=j.onVisibleChange,he=j.afterVisibleChange,Le=j.transitionName,Se=j.animation,D=j.motion,M=j.placement,ne=M===void 0?"right":M,be=j.align,st=be===void 0?{}:be,ot=j.destroyTooltipOnHide,At=ot===void 0?!1:ot,Xe=j.defaultVisible,sr=j.getTooltipContainer,jt=j.overlayInnerStyle,Pt=j.arrowContent,Cr=j.overlay,zr=j.id,rr=j.showArrow,Ur=rr===void 0?!0:rr,li=(0,rt.Z)(j,O),Vr=(0,re.useRef)(null);(0,re.useImperativeHandle)(Y,function(){return Vr.current});var Ze=(0,Pe.Z)({},li);"visible"in j&&(Ze.popupVisible=j.visible);var nt=function(){return re.createElement(I,{key:"content",prefixCls:de,id:zr,overlayInnerStyle:jt},Cr)};return re.createElement(Me.Z,(0,pe.Z)({popupClassName:ue,prefixCls:de,popup:nt,action:le,builtinPlacements:d,popupPlacement:ne,ref:Vr,popupAlign:st,getPopupContainer:sr,onPopupVisibleChange:ce,afterPopupVisibleChange:he,popupTransitionName:Le,popupAnimation:Se,popupMotion:D,defaultPopupVisible:Xe,autoDestroy:At,mouseLeaveDelay:We,popupStyle:ut,mouseEnterDelay:ve,arrow:Ur},Ze),ie)},se=(0,re.forwardRef)(H),ae=se},49658:function($r,It){"use strict";It.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var X=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(X)||/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(X==null?void 0:X.substr(0,4))}},83145:function($r,It,X){"use strict";Object.defineProperty(It,"__esModule",{value:!0}),It.CopyToClipboard=void 0;var pe=rt(X(59301)),Pe=rt(X(25769));function rt(j){return j&&j.__esModule?j:{default:j}}function Me(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Me=function(ue){return typeof ue}:Me=function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},Me(j)}function re(j,Y){var ue=Object.keys(j);if(Object.getOwnPropertySymbols){var ee=Object.getOwnPropertySymbols(j);Y&&(ee=ee.filter(function(le){return Object.getOwnPropertyDescriptor(j,le).enumerable})),ue.push.apply(ue,ee)}return ue}function E(j){for(var Y=1;Y<arguments.length;Y++){var ue=arguments[Y]!=null?arguments[Y]:{};Y%2?re(ue,!0).forEach(function(ee){ae(j,ee,ue[ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(ue)):re(ue).forEach(function(ee){Object.defineProperty(j,ee,Object.getOwnPropertyDescriptor(ue,ee))})}return j}function Re(j,Y){if(j==null)return{};var ue=N(j,Y),ee,le;if(Object.getOwnPropertySymbols){var De=Object.getOwnPropertySymbols(j);for(le=0;le<De.length;le++)ee=De[le],!(Y.indexOf(ee)>=0)&&Object.prototype.propertyIsEnumerable.call(j,ee)&&(ue[ee]=j[ee])}return ue}function N(j,Y){if(j==null)return{};var ue={},ee=Object.keys(j),le,De;for(De=0;De<ee.length;De++)le=ee[De],!(Y.indexOf(le)>=0)&&(ue[le]=j[le]);return ue}function d(j,Y){if(!(j instanceof Y))throw new TypeError("Cannot call a class as a function")}function xe(j,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(j,ee.key,ee)}}function q(j,Y,ue){return Y&&xe(j.prototype,Y),ue&&xe(j,ue),j}function k(j,Y){return Y&&(Me(Y)==="object"||typeof Y=="function")?Y:O(j)}function I(j){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(ue){return ue.__proto__||Object.getPrototypeOf(ue)},I(j)}function O(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function H(j,Y){if(typeof Y!="function"&&Y!==null)throw new TypeError("Super expression must either be null or a function");j.prototype=Object.create(Y&&Y.prototype,{constructor:{value:j,writable:!0,configurable:!0}}),Y&&se(j,Y)}function se(j,Y){return se=Object.setPrototypeOf||function(ee,le){return ee.__proto__=le,ee},se(j,Y)}function ae(j,Y,ue){return Y in j?Object.defineProperty(j,Y,{value:ue,enumerable:!0,configurable:!0,writable:!0}):j[Y]=ue,j}var Z=function(j){H(Y,j);function Y(){var ue,ee;d(this,Y);for(var le=arguments.length,De=new Array(le),ve=0;ve<le;ve++)De[ve]=arguments[ve];return ee=k(this,(ue=I(Y)).call.apply(ue,[this].concat(De))),ae(O(ee),"onClick",function(Ye){var We=ee.props,ut=We.text,gt=We.onCopy,de=We.children,ie=We.options,ce=pe.default.Children.only(de),he=(0,Pe.default)(ut,ie);gt&&gt(ut,he),ce&&ce.props&&typeof ce.props.onClick=="function"&&ce.props.onClick(Ye)}),ee}return q(Y,[{key:"render",value:function(){var ee=this.props,le=ee.text,De=ee.onCopy,ve=ee.options,Ye=ee.children,We=Re(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);It.CopyToClipboard=Z,ae(Z,"defaultProps",{onCopy:void 0,options:void 0})},56102:function($r,It,X){"use strict";var pe=X(83145),Pe=pe.CopyToClipboard;Pe.CopyToClipboard=Pe,$r.exports=Pe},76374:function($r,It,X){"use strict";var pe=function(){if(typeof Map!="undefined")return Map;function de(ie,ce){var he=-1;return ie.some(function(Le,Se){return Le[0]===ce?(he=Se,!0):!1}),he}return function(){function ie(){this.__entries__=[]}return Object.defineProperty(ie.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),ie.prototype.get=function(ce){var he=de(this.__entries__,ce),Le=this.__entries__[he];return Le&&Le[1]},ie.prototype.set=function(ce,he){var Le=de(this.__entries__,ce);~Le?this.__entries__[Le][1]=he:this.__entries__.push([ce,he])},ie.prototype.delete=function(ce){var he=this.__entries__,Le=de(he,ce);~Le&&he.splice(Le,1)},ie.prototype.has=function(ce){return!!~de(this.__entries__,ce)},ie.prototype.clear=function(){this.__entries__.splice(0)},ie.prototype.forEach=function(ce,he){he===void 0&&(he=null);for(var Le=0,Se=this.__entries__;Le<Se.length;Le++){var D=Se[Le];ce.call(he,D[1],D[0])}},ie}()}(),Pe=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,rt=function(){return typeof X.g!="undefined"&&X.g.Math===Math?X.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Me=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(rt):function(de){return setTimeout(function(){return de(Date.now())},1e3/60)}}(),re=2;function E(de,ie){var ce=!1,he=!1,Le=0;function Se(){ce&&(ce=!1,de()),he&&M()}function D(){Me(Se)}function M(){var ne=Date.now();if(ce){if(ne-Le<re)return;he=!0}else ce=!0,he=!1,setTimeout(D,ie);Le=ne}return M}var Re=20,N=["top","right","bottom","left","width","height","size","weight"],d=typeof MutationObserver!="undefined",xe=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),Re)}return de.prototype.addObserver=function(ie){~this.observers_.indexOf(ie)||this.observers_.push(ie),this.connected_||this.connect_()},de.prototype.removeObserver=function(ie){var ce=this.observers_,he=ce.indexOf(ie);~he&&ce.splice(he,1),!ce.length&&this.connected_&&this.disconnect_()},de.prototype.refresh=function(){var ie=this.updateObservers_();ie&&this.refresh()},de.prototype.updateObservers_=function(){var ie=this.observers_.filter(function(ce){return ce.gatherActive(),ce.hasActive()});return ie.forEach(function(ce){return ce.broadcastActive()}),ie.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(ie){var ce=ie.propertyName,he=ce===void 0?"":ce,Le=N.some(function(Se){return!!~he.indexOf(Se)});Le&&this.refresh()},de.getInstance=function(){return this.instance_||(this.instance_=new de),this.instance_},de.instance_=null,de}(),q=function(de,ie){for(var ce=0,he=Object.keys(ie);ce<he.length;ce++){var Le=he[ce];Object.defineProperty(de,Le,{value:ie[Le],enumerable:!1,writable:!1,configurable:!0})}return de},k=function(de){var ie=de&&de.ownerDocument&&de.ownerDocument.defaultView;return ie||rt},I=le(0,0,0,0);function O(de){return parseFloat(de)||0}function H(de){for(var ie=[],ce=1;ce<arguments.length;ce++)ie[ce-1]=arguments[ce];return ie.reduce(function(he,Le){var Se=de["border-"+Le+"-width"];return he+O(Se)},0)}function se(de){for(var ie=["top","right","bottom","left"],ce={},he=0,Le=ie;he<Le.length;he++){var Se=Le[he],D=de["padding-"+Se];ce[Se]=O(D)}return ce}function ae(de){var ie=de.getBBox();return le(0,0,ie.width,ie.height)}function Z(de){var ie=de.clientWidth,ce=de.clientHeight;if(!ie&&!ce)return I;var he=k(de).getComputedStyle(de),Le=se(he),Se=Le.left+Le.right,D=Le.top+Le.bottom,M=O(he.width),ne=O(he.height);if(he.boxSizing==="border-box"&&(Math.round(M+Se)!==ie&&(M-=H(he,"left","right")+Se),Math.round(ne+D)!==ce&&(ne-=H(he,"top","bottom")+D)),!Y(de)){var be=Math.round(M+Se)-ie,st=Math.round(ne+D)-ce;Math.abs(be)!==1&&(M-=be),Math.abs(st)!==1&&(ne-=st)}return le(Le.left,Le.top,M,ne)}var j=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?j(de)?ae(de):Z(de):I}function ee(de){var ie=de.x,ce=de.y,he=de.width,Le=de.height,Se=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,D=Object.create(Se.prototype);return q(D,{x:ie,y:ce,width:he,height:Le,top:ce,right:ie+he,bottom:Le+ce,left:ie}),D}function le(de,ie,ce,he){return{x:de,y:ie,width:ce,height:he}}var De=function(){function de(ie){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=le(0,0,0,0),this.target=ie}return de.prototype.isActive=function(){var ie=ue(this.target);return this.contentRect_=ie,ie.width!==this.broadcastWidth||ie.height!==this.broadcastHeight},de.prototype.broadcastRect=function(){var ie=this.contentRect_;return this.broadcastWidth=ie.width,this.broadcastHeight=ie.height,ie},de}(),ve=function(){function de(ie,ce){var he=ee(ce);q(this,{target:ie,contentRect:he})}return de}(),Ye=function(){function de(ie,ce,he){if(this.activeObservations_=[],this.observations_=new pe,typeof ie!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=ie,this.controller_=ce,this.callbackCtx_=he}return de.prototype.observe=function(ie){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(ie instanceof k(ie).Element))throw new TypeError('parameter 1 is not of type "Element".');var ce=this.observations_;ce.has(ie)||(ce.set(ie,new De(ie)),this.controller_.addObserver(this),this.controller_.refresh())}},de.prototype.unobserve=function(ie){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(ie instanceof k(ie).Element))throw new TypeError('parameter 1 is not of type "Element".');var ce=this.observations_;ce.has(ie)&&(ce.delete(ie),ce.size||this.controller_.removeObserver(this))}},de.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},de.prototype.gatherActive=function(){var ie=this;this.clearActive(),this.observations_.forEach(function(ce){ce.isActive()&&ie.activeObservations_.push(ce)})},de.prototype.broadcastActive=function(){if(this.hasActive()){var ie=this.callbackCtx_,ce=this.activeObservations_.map(function(he){return new ve(he.target,he.broadcastRect())});this.callback_.call(ie,ce,ie),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(ie){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=xe.getInstance(),he=new Ye(ie,ce,this);We.set(this,he)}return de}();["observe","unobserve","disconnect"].forEach(function(de){ut.prototype[de]=function(){var ie;return(ie=We.get(this))[de].apply(ie,arguments)}});var gt=function(){return typeof rt.ResizeObserver!="undefined"?rt.ResizeObserver:ut}();It.Z=gt},98040:function($r){$r.exports=function(){var It=document.getSelection();if(!It.rangeCount)return function(){};for(var X=document.activeElement,pe=[],Pe=0;Pe<It.rangeCount;Pe++)pe.push(It.getRangeAt(Pe));switch(X.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":X.blur();break;default:X=null;break}return It.removeAllRanges(),function(){It.type==="Caret"&&It.removeAllRanges(),It.rangeCount||pe.forEach(function(rt){It.addRange(rt)}),X&&X.focus()}}},46284:function($r,It,X){"use strict";X.d(It,{ZP:function(){return $o}});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 Me=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}({}),re=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 Re={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},N={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 xe{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 q(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 I(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?I(Object(i),!0).forEach(function(s){q(h,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach(function(s){Object.defineProperty(h,s,Object.getOwnPropertyDescriptor(i,s))})}return h}function H(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=H(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(){},j={trace:Z,debug:Z,log:Z,warn:Z,info:Z,error:Z};function Y(){return k({},j)}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 le=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.1`)}catch(l){return Y()}o.forEach(l=>{le[l]=ee(l,h)})}else k(le,s);return s}const ve=le;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 gt(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 ie(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var ce={exports:{}},he;function Le(){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 L=p.parseURL(g);if(!L)throw new Error("Error trying to parse relative URL.");if(L.scheme)return x.alwaysNormalize?(L.path=p.normalizePath(L.path),p.buildURLFromParts(L)):g;var F=p.parseURL(y);if(!F)throw new Error("Error trying to parse base URL.");if(!F.netLoc&&F.path&&F.path[0]!=="/"){var $=o.exec(F.path);F.netLoc=$[1],F.path=$[2]}F.netLoc&&!F.path&&(F.path="/");var te={scheme:F.scheme,netLoc:L.netLoc,path:null,params:L.params,query:L.query,fragment:L.fragment};if(!L.netLoc&&(te.netLoc=F.netLoc,L.path[0]!=="/"))if(!L.path)te.path=F.path,L.params||(te.params=F.params,L.query||(te.query=F.query));else{var Q=F.path,Te=Q.substring(0,Q.lastIndexOf("/")+1)+L.path;te.path=p.normalizePath(Te)}return te.path===null&&(te.path=x.alwaysNormalize?p.normalizePath(L.path):L.path),p.buildURLFromParts(te)},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 Se=Le();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 M={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ne{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={[M.AUDIO]:null,[M.VIDEO]:null,[M.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=Se.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[M.AUDIO]=null,t[M.VIDEO]=null,t[M.AUDIOVIDEO]=null}}function be(h){return h.sn!=="initSegment"}class st extends ne{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 be(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 ne{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 sr=Math.pow(2,32)-1,jt=[].push,Pt={video:1,audio:2,id3:3,text:4};function Cr(h){return String.fromCharCode.apply(null,h)}function zr(h,t){const i=h[t]<<8|h[t+1];return i<0?65536+i:i}function rr(h,t){const i=li(h,t);return i<0?4294967296+i:i}function Ur(h,t){let i=rr(h,t);return i*=Math.pow(2,32),i+=rr(h,t+4),i}function li(h,t){return h[t]<<24|h[t+1]<<16|h[t+2]<<8|h[t+3]}function Vr(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=rr(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=rr(h,o),c=Cr(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=rr(h,s);s+=4;let l=0,c=0;i===0?(l=rr(h,s),c=rr(h,s+4),s+=8):(l=Ur(h,s),c=Ur(h,s+8),s+=16),s+=2;let p=h.length+c;const y=zr(h,s);s+=2;for(let g=0;g<y;g++){let x=s;const S=rr(h,x);x+=4;const L=S&2147483647;if((S&2147483648)>>>31===1)return ve.warn("SIDX has hierarchical references (not supported)"),null;const $=rr(h,x);x+=4,t.push({referenceSize:L,subsegmentDuration:$,info:{duration:$/o,start:p,end:p+L-1}}),p+=L,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=rr(c,p===0?12:20),g=nt(l,["mdia","mdhd"])[0];if(g){p=g[0];const x=rr(g,p===0?12:20),S=nt(l,["mdia","hdlr"])[0];if(S){const L=Cr(S.subarray(8,12)),F={soun:M.AUDIO,vide:M.VIDEO}[L],$=nt(l,["mdia","minf","stbl","stsd"])[0],te=Dt($);F?(t[y]={timescale:x,type:F,stsd:te},t[F]=O({timescale:x,id:y},te)):t[y]={timescale:x,type:L,stsd:te}}}}}return nt(h,["moov","mvex","trex"]).forEach(o=>{const l=rr(o,4),c=t[l];c&&(c.default={duration:rr(o,12),flags:rr(o,20)})}),t}function Dt(h){const t=h.subarray(8),i=t.subarray(86),s=Cr(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 L=nt(S,["schm"])[0];if(L){const F=Cr(L.subarray(4,8));if(F==="cbcs"||F==="cenc"){const $=nt(S,["frma"])[0];$&&(o=Cr($))}}})}const p=o;switch(o){case"avc1":case"avc2":case"avc3":case"avc4":{const y=nt(i,["avcC"])[0];y&&y.length>3&&(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 L=g[x++];if(L===64)o+="."+et(L);else break;if(x+=12,g[x++]!==5)break;x=Oe(g,x);const F=g[x++];let $=(F&248)>>3;$===31&&($+=1+((F&7)<<3)+((g[x]&224)>>5)),o+="."+$}break}case"hvc1":case"hev1":{const y=nt(i,["hvcC"])[0];if(y&&y.length>12){const g=y[1],x=["","A","B","C"][g>>6],S=g&31,L=rr(y,2),F=(g&32)>>5?"H":"L",$=y[12],te=y.subarray(6,12);o+="."+x+S,o+="."+L.toString(16).toUpperCase(),o+="."+F+$;let Q="";for(let Te=te.length;Te--;){const Ve=te[Te];(Ve||Q)&&(Q="."+Ve.toString(16).toUpperCase()+Q)}o+=Q}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];if(y&&y.length>6){const 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];if(y&&y.length>2){const g=y[1]>>>5,x=y[1]&31,S=y[2]>>>7?"H":"M",L=(y[2]&64)>>6,F=(y[2]&32)>>5,$=g===2&&L?F?12:10:L?10:8,te=(y[2]&16)>>4,Q=(y[2]&8)>>3,Te=(y[2]&4)>>2,Ve=y[2]&3;o+="."+g+"."+vt(x)+S+"."+vt($)+"."+te+"."+Q+Te+Ve+"."+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(L=>{const F=Gt(L);if(F){const $=F.subarray(8,24);$.some(te=>te!==0)||(ve.log(`[eme] Patching keyId in 'enc${y?"a":"v"}>sinf>>tenc' box: ${de.hexDump($)} -> ${de.hexDump(i)}`),F.set(i,8))}})})}),h}function Gt(h){const t=nt(h,["schm"])[0];if(t){const i=Cr(t.subarray(4,8));if(i==="cbcs"||i==="cenc")return nt(h,["schi","tenc"])[0]}return null}function dr(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=rr(y,4),x=h[g];if(x){let S=rr(o,4);if(l===1){if(S===sr)return ve.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),p;S*=sr+1,S+=rr(o,8)}const L=x.timescale||9e4,F=S/L;if(pe(F)&&(p===null||F<p))return F}return p},null);return c!==null&&pe(c)&&(i===null||c<i)?c:i},null)}function Jt(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=rr(y,4),x=t[g];if(!x)continue;const S=x.default,L=rr(y,0)|(S==null?void 0:S.flags);let F=S==null?void 0:S.duration;L&8&&(L&2?F=rr(y,12):F=rr(y,8));const $=x.timescale||9e4,te=nt(p,["trun"]);for(let Q=0;Q<te.length;Q++){if(i=Ue(te[Q]),!i&&F){const Te=rr(te[Q],4);i=F*Te}x.type===M.VIDEO?s+=i/$:x.type===M.AUDIO&&(o+=i/$)}}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 L=S.references.reduce((F,$)=>F+$.info.duration||0,0);p=Math.max(p,L+S.earliestPresentationTime/S.timescale),y=p-c}}if(y&&pe(y))return y}return s||o}function Ue(h){const t=rr(h,0);let i=8;t&1&&(i+=4),t&4&&(i+=4);let s=0;const o=rr(h,4);for(let l=0;l<o;l++){if(t&256){const c=rr(h,i);s+=c,i+=4}t&512&&(i+=4),t&1024&&(i+=4),t&2048&&(i+=4)}return s}function Kt(h,t,i){nt(t,["moof","traf"]).forEach(s=>{nt(s,["tfhd"]).forEach(o=>{const l=rr(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=rr(y,4);if(g===0)S-=x,S=Math.max(S,0),Vr(y,4,S);else{S*=Math.pow(2,32),S+=rr(y,8),S-=x,S=Math.max(S,0);const L=Math.floor(S/(sr+1)),F=Math.floor(S%(sr+1));Vr(y,4,L),Vr(y,8,F)}}})})})}function wr(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 L=nt(S,["tfdt"]).map(F=>{const $=F[0];let te=rr(F,4);return $===1&&(te*=Math.pow(2,32),te+=rr(F,8)),te/o})[0];return L!==void 0&&(h=L),nt(S,["tfhd"]).map(F=>{const $=rr(F,4),te=rr(F,0)&16777215,Q=(te&1)!==0,Te=(te&2)!==0,Ve=(te&8)!==0;let $e=0;const ht=(te&16)!==0;let mt=0;const Ft=(te&32)!==0;let dt=8;$===l&&(Q&&(dt+=8),Te&&(dt+=4),Ve&&($e=rr(F,dt),dt+=4),ht&&(mt=rr(F,dt),dt+=4),Ft&&(dt+=4),t.type==="video"&&(c=it(t.codec)),nt(S,["trun"]).map(Tt=>{const Ut=Tt[0],bt=rr(Tt,0)&16777215,fr=(bt&1)!==0;let vr=0;const Ji=(bt&4)!==0,wi=(bt&256)!==0;let di=0;const Zr=(bt&512)!==0;let ai=0;const hi=(bt&1024)!==0,pr=(bt&2048)!==0;let _r=0;const xi=rr(Tt,4);let ki=8;fr&&(vr=rr(Tt,ki),ki+=4),Ji&&(ki+=4);let qi=vr+g;for(let en=0;en<xi;en++){if(wi?(di=rr(Tt,ki),ki+=4):di=$e,Zr?(ai=rr(Tt,ki),ki+=4):ai=mt,hi&&(ki+=4),pr&&(Ut===0?_r=rr(Tt,ki):_r=li(Tt,ki),ki+=4),t.type===M.VIDEO){let mn=0;for(;mn<ai;){const tn=rr(s,qi);if(qi+=4,Rt(c,s[qi])){const qs=s.subarray(qi,qi+tn);kt(qs,c?2:1,h+_r/o,i)}qi+=tn,mn+=tn+4}}h+=di/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 Rt(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 L=zr(o,x);if(x+=2,L===49){const F=rr(o,x);if(x+=4,F===1195456820){const $=o[x++];if($===3){const te=o[x++],Q=31&te,Te=64&te,Ve=Te?2+Q*3:0,$e=new Uint8Array(Ve);if(Te){$e[0]=te;for(let ht=1;ht<Ve;ht++)$e[ht]=o[x++]}s.push({type:$,payloadType:c,pts:i,bytes:$e})}}}}}else if(c===5&&p>16){const S=[];for(let $=0;$<16;$++){const te=o[x++].toString(16);S.push(te.length==1?"0"+te:te),($===3||$===5||$===7||$===9)&&S.push("-")}const L=p-16,F=new Uint8Array(L);for(let $=0;$<L;$++)F[$]=o[x++];s.push({payloadType:c,pts:i,uuid:S.join(""),userData:gt(F),userDataBytes:F})}}}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 tr(h){const t=h[0];let i="",s="",o=0,l=0,c=0,p=0,y=0,g=0;if(t===0){for(;Cr(h.subarray(g,g+1))!=="\0";)i+=Cr(h.subarray(g,g+1)),g+=1;for(i+=Cr(h.subarray(g,g+1)),g+=1;Cr(h.subarray(g,g+1))!=="\0";)s+=Cr(h.subarray(g,g+1)),g+=1;s+=Cr(h.subarray(g,g+1)),g+=1,o=rr(h,12),l=rr(h,16),p=rr(h,20),y=rr(h,24),g=28}else if(t===1){g+=4,o=rr(h,g),g+=4;const S=rr(h,g);g+=4;const L=rr(h,g);for(g+=4,c=vo(2,32)*S+L,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=rr(h,g),g+=4,y=rr(h,g),g+=4;Cr(h.subarray(g,g+1))!=="\0";)i+=Cr(h.subarray(g,g+1)),g+=1;for(i+=Cr(h.subarray(g,g+1)),g+=1;Cr(h.subarray(g,g+1))!=="\0";)s+=Cr(h.subarray(g,g+1)),g+=1;s+=Cr(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 ft(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),Sr={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=Sr[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 Sr.video[t]}return 2}function Ee(h){const t=fe();return h.split(",").reduce((i,s)=>{const l=t&&it(s)?9:Sr.video[s];return l?(l*2+i)/(i?3:2):(Sr.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 Xt(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 yr(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 Li(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 Er(h){return h.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const yi={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 Ce={};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,L)=>{if(L){const F=t.groups[L];if(!F)throw new Error(`Audio track group ${L} not found`);Object.keys(F.channels).forEach($=>{S[$]=(S[$]||0)+F.channels[$]})}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(yi);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(Li(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 Ce[p]||(Ce[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=Er(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 Nt=["NONE","TYPE-0","TYPE-1",null];function ar(h){return Nt.indexOf(h)>-1}const Qt=["SDR","PQ","HLG"];function Pr(h){return!!h&&Qt.indexOf(h)>-1}var Ar={No:"",Yes:"YES",v2:"v2"};function oi(h){const{canSkipUntil:t,canSkipDateRanges:i,age:s}=h,o=s<t/2;return t&&o?i?Ar.v2:Ar.Yes:Ar.No}class Lr{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 Fr{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 ii(this._audioGroups,t)}hasSubtitleGroup(t){return ii(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 ii(h,t){return!t||!h?!1:h.indexOf(t)!==-1}function bi(){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 Fi(h,t){let i=!1,s=[];if(h&&(i=h!=="SDR",s=[h]),t){s=t.allowedVideoRanges||Qt.slice(0);const o=s.join("")!=="SDR"&&!t.videoCodec;i=t.preferHDR!==void 0?t.preferHDR:o&&bi(),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}},Kr=(h,t)=>JSON.stringify(h,mi(t));function Hi(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,L=1/0,F=1/0,$=1/0,te=1/0,Q=0,Te=[];const{preferHDR:Ve,allowedVideoRanges:$e}=Fi(t,o);for(let Tt=l.length;Tt--;){const Ut=h[l[Tt]];x||(x=Ut.channels[2]>0),L=Math.min(L,Ut.minHeight),F=Math.min(F,Ut.minFramerate),$=Math.min($,Ut.minBitrate),$e.filter(fr=>Ut.videoRanges[fr]>0).length>0&&(S=!0)}L=pe(L)?L:0,F=pe(F)?F:0;const ht=Math.max(1080,L),mt=Math.max(30,F);$=pe($)?$:i,i=Math.max($,i),S||(t=void 0);const Ft=l.length>1;return{codecSet:l.reduce((Tt,Ut)=>{const bt=h[Ut];if(Ut===Tt)return Tt;if(Te=S?$e.filter(fr=>bt.videoRanges[fr]>0):[],Ft){if(bt.minBitrate>i)return Yr(Ut,`min bitrate of ${bt.minBitrate} > current estimate of ${i}`),Tt;if(!bt.hasDefaultAudio)return Yr(Ut,"no renditions with default or auto-select sound found"),Tt;if(p&&Ut.indexOf(p.substring(0,4))%5!==0)return Yr(Ut,`audio codec preference "${p}" not found`),Tt;if(c&&!g){if(!bt.channels[c])return Yr(Ut,`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(Ut,"no renditions with stereo sound found"),Tt;if(bt.minHeight>ht)return Yr(Ut,`min resolution of ${bt.minHeight} > maximum of ${ht}`),Tt;if(bt.minFramerate>mt)return Yr(Ut,`min framerate of ${bt.minFramerate} > maximum of ${mt}`),Tt;if(!Te.some(fr=>bt.videoRanges[fr]>0))return Yr(Ut,`no variants with VIDEO-RANGE of ${Kr(Te)} found`),Tt;if(y&&Ut.indexOf(y.substring(0,4))%5!==0)return Yr(Ut,`video codec preference "${y}" not found`),Tt;if(bt.maxScore<Q)return Yr(Ut,`max score of ${bt.maxScore} < selected max of ${Q}`),Tt}return Tt&&(Ee(Ut)>=Ee(Tt)||bt.fragmentError>h[Tt].fragmentError)?Tt:(te=bt.minIndex,Q=bt.maxScore,Ut)},void 0),videoRanges:Te,preferHDR:Ve,minFramerate:F,minBitrate:$,minIndex:te}}function Yr(h,t){ve.log(`[abr] start candidates with "${h}" ignored because ${t}`)}function Br(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(L=>{y.channels[L]=(y.channels[L]||0)+S.channels[L]}))}),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||pt(l,t.lang))&&(l===void 0||t.assocLang===c)&&(p===void 0||t.default===p)&&(y===void 0||t.forced===y)&&(!("characteristics"in h)||Ht(h.characteristics||"",t.characteristics))&&(i===void 0||i(h,t))}function pt(h,t="--"){return h.length===t.length?h===t:h.startsWith(t)||t.startsWith(h)}function Ht(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((L,F,$)=>{const te=F.uri;return(L[te]||(L[te]=[])).push($),L},{})[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=Dr(t,s,L=>{if(L.videoRange!==y||L.frameRate!==g||L.codecSet.substring(0,4)!==x)return!1;const F=L.audioGroups,$=i.filter(te=>!F||F.indexOf(te.groupId)!==-1);return _t(h,$,o)>-1});return S>-1?S:Dr(t,s,L=>{const F=L.audioGroups,$=i.filter(te=>!F||F.indexOf(te.groupId)!==-1);return _t(h,$,o)>-1})}function Dr(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 mr(h,t){var i;return!!h&&h!==((i=t.loadLevelObj)==null?void 0:i.uri)}class ni 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,L=g-x.loading.start,F=c.minAutoLevel,$=o.level,te=this._nextAutoLevel;if(x.aborted||x.loaded&&x.loaded===x.total||$<=F){this.clearTimer(),this._nextAutoLevel=-1;return}if(!p)return;const Q=te>-1&&te!==$,Te=!!i||Q;if(!Te&&(y.paused||!y.playbackRate||!y.readyState))return;const Ve=c.mainForwardBufferInfo;if(!Te&&Ve===null)return;const $e=this.bwEstimator.getEstimateTTFB(),ht=Math.abs(y.playbackRate);if(L<=Math.max($e,1e3*(S/(ht*2))))return;const mt=Ve?Ve.len/ht:0,Ft=x.loading.first?x.loading.first-x.loading.start:-1,dt=x.loaded&&Ft>-1,Tt=this.getBwEstimate(),Ut=c.levels,bt=Ut[$],fr=Math.max(x.loaded,Math.round(S*(o.bitrate||bt.averageBitrate)/8));let vr=dt?L-Ft:L;vr<1&&dt&&(vr=Math.min(L,x.loaded*8/Tt));const Ji=dt?x.loaded*1e3/vr:0,wi=$e/1e3,di=Ji?(fr-x.loaded)/Ji:fr*8/Tt+wi;if(di<=mt)return;const Zr=Ji?Ji*8:Tt,ai=((s=(i==null?void 0:i.details)||this.hls.latestLevelDetails)==null?void 0:s.live)===!0,hi=this.hls.config.abrBandWidthUpFactor;let pr=Number.POSITIVE_INFINITY,_r;for(_r=$-1;_r>F;_r--){const en=Ut[_r].maxBitrate,mn=!Ut[_r].details||ai;if(pr=this.getTimeToLoadFrag(wi,Zr,S*en,mn),pr<Math.min(mt,S+wi))break}if(pr>=di||pr>S*10)return;dt?this.bwEstimator.sample(L-Math.min($e,Ft),x.loaded):this.bwEstimator.sampleTTFB(L);const xi=Ut[_r].maxBitrate;this.getBwEstimate()*hi>xi&&this.resetEstimator(xi);const ki=this.findBestLevel(xi,F,_r,0,mt,1,1);ki>-1&&(_r=ki),this.warn(`Fragment ${o.sn}${l?" part "+l.index:""} of level ${$} is loading too slowly;
Fragment duration: ${o.duration.toFixed(3)}
Time to underbuffer: ${mt.toFixed(3)} s
Estimated load time for current fragment: ${di.toFixed(3)} s
Estimated load time for down switch fragment: ${pr.toFixed(3)} s
TTFB estimate: ${Ft|0} ms
Current BW estimate: ${pe(Tt)?Tt|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${_r} @ ${xi|0} bps`),c.nextLoadLevel=c.nextAutoLevel=_r,this.clearTimer();const qi=()=>{if(this.clearTimer(),this.fragCurrent===o&&this.hls.loadLevel===_r&&_r>0){const en=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${_r>0?"and switching down":""}
Fragment duration: ${o.duration.toFixed(3)} s
Time to underbuffer: ${en.toFixed(3)} s`),o.abortRequests(),this.fragCurrent=this.partCurrent=null,_r>F){let mn=this.findBestLevel(this.hls.levels[F].bitrate,F,_r,0,en,1,1);mn===-1&&(mn=F),this.hls.nextLoadLevel=this.hls.nextAutoLevel=mn,this.resetEstimator(this.hls.levels[mn].bitrate)}}};Q||di>pr*2?qi():this.timer=self.setInterval(qi,pr*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 xe(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 re.BUFFER_ADD_CODEC_ERROR:case re.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case re.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===N.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!==N.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 Q=this.findBestLevel(y,c,o,g,0,x,S);if(Q>=0)return this.rebufferNotice=-1,Q}let L=p?Math.min(p,l.maxStarvationDelay):l.maxStarvationDelay;if(!g){const Q=this.bitrateTestDelay;Q&&(L=(p?Math.min(p,l.maxLoadingDelay):l.maxLoadingDelay)-Q,this.info(`bitrate test took ${Math.round(1e3*Q)}ms, set first fragment max fetchDuration to ${Math.round(1e3*L)} ms`),x=S=1)}const F=this.findBestLevel(y,c,o,g,L,x,S);if(this.rebufferNotice!==F&&(this.rebufferNotice=F,this.info(`${g?"rebuffering expected":"buffer is empty"}, optimal quality level ${F}`)),F>-1)return F;const $=s.levels[c],te=s.loadLevelObj;return te&&($==null?void 0:$.bitrate)<te.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:L,partCurrent:F}=this,{levels:$,allAudioTracks:te,loadLevel:Q,config:Te}=this.hls;if($.length===1)return 0;const Ve=$[S],$e=!!((y=this.hls.latestLevelDetails)!=null&&y.live),ht=Q===-1||x===-1;let mt,Ft="SDR",dt=(Ve==null?void 0:Ve.frameRate)||0;const{audioPreference:Tt,videoPreference:Ut}=Te,bt=this.audioTracksByGroup||(this.audioTracksByGroup=Br(te));let fr=-1;if(ht){if(this.firstSelection!==-1)return this.firstSelection;const Zr=this.codecTiers||(this.codecTiers=lt($,bt,i,s)),ai=Hi(Zr,Ft,t,Tt,Ut),{codecSet:hi,videoRanges:pr,minFramerate:_r,minBitrate:xi,minIndex:ki,preferHDR:qi}=ai;fr=ki,mt=hi,Ft=qi?pr[pr.length-1]:pr[0],dt=_r,t=Math.max(t,xi),this.log(`picked start tier ${Kr(ai)}`)}else mt=Ve==null?void 0:Ve.codecSet,Ft=Ve==null?void 0:Ve.videoRange;const vr=F?F.duration:L?L.duration:0,Ji=this.bwEstimator.getEstimateTTFB()/1e3,wi=[];for(let Zr=s;Zr>=i;Zr--){var di;const ai=$[Zr],hi=Zr>S;if(!ai)continue;if(Te.useMediaCapabilities&&!ai.supportedResult&&!ai.supportedPromise){const mn=navigator.mediaCapabilities;typeof(mn==null?void 0:mn.decodingInfo)=="function"&&(Mt(ai,bt,Ft,dt,t,Tt)||it(ai.videoCodec))?(ai.supportedPromise=ct(ai,bt,mn),ai.supportedPromise.then(tn=>{if(!this.hls)return;ai.supportedResult=tn;const qs=this.hls.levels,ks=qs.indexOf(ai);tn.error?this.warn(`MediaCapabilities decodingInfo error: "${tn.error}" for level ${ks} ${Kr(tn)}`):tn.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${ks} ${Kr(tn)}`),ks>-1&&qs.length>1&&(this.log(`Removing unsupported level ${ks}`),this.hls.removeLevel(ks),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):ai.supportedResult=yi}if((mt&&ai.codecSet!==mt||Ft&&ai.videoRange!==Ft||hi&&dt>ai.frameRate||!hi&&dt>0&&dt<ai.frameRate||ai.supportedResult&&!((di=ai.supportedResult.decodingInfoResults)!=null&&di[0].smooth))&&(!ht||Zr!==fr)){wi.push(Zr);continue}const pr=ai.details,_r=(F?pr==null?void 0:pr.partTarget:pr==null?void 0:pr.averagetargetduration)||vr;let xi;hi?xi=p*t:xi=c*t;const ki=vr&&o>=vr*2&&l===0?ai.averageBitrate:ai.maxBitrate,qi=this.getTimeToLoadFrag(Ji,xi,ki*_r,pr===void 0);if(xi>=ki&&(Zr===x||ai.loadError===0&&ai.fragmentError===0)&&(qi<=Ji||!pe(qi)||$e&&!this.bitrateTestDelay||qi<g)){const mn=this.forcedAutoLevel;return Zr!==Q&&(mn===-1||mn!==Q)&&(wi.length&&this.trace(`Skipped level(s) ${wi.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${$[wi[0]].codecs}" ${$[wi[0]].videoRange}; not compatible with "${mt}" ${Ft}`),this.info(`switch candidate:${S}->${Zr} adjustedbw(${Math.round(xi)})-bitrate=${Math.round(xi-ki)} ttfb:${Ji.toFixed(1)} avgDuration:${_r.toFixed(1)} maxFetchDuration:${g.toFixed(1)} fetchDuration:${qi.toFixed(1)} firstSelection:${ht} codecSet:${ai.codecSet} videoRange:${ai.videoRange} hls.loadLevel:${Q}`)),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(Ei(t,i,c))return c}return null}function kr(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||Rr(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 Rr(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 Ei(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 ti(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 ri(h){switch(h.details){case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_TIMEOUT:case re.LEVEL_LOAD_TIMEOUT:case re.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function si(h,t){const i=ri(t);return h.default[`${i?"timeout":"error"}Retry`]}function Hr(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 Ii(h,t,i,s){if(!h)return!1;const o=s==null?void 0:s.code,l=t<h.maxNumRetry&&(Ci(o)||!!i);return h.shouldRetry?h.shouldRetry(h,t,i,s,l):l}function Ci(h){return h===0&&navigator.onLine===!1||!!h&&(h<400||h>499)}var Tr={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},je={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class ur 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)===N.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 re.FRAG_LOAD_ERROR:case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_ERROR:case re.KEY_LOAD_TIMEOUT:i.errorAction=this.getFragRetryOrSwitchAction(i);return;case re.FRAG_PARSING_ERROR:if((s=i.frag)!=null&&s.gap){i.errorAction=br();return}case re.FRAG_GAP:case re.FRAG_DECRYPT_ERROR:{i.errorAction=this.getFragRetryOrSwitchAction(i),i.errorAction.action=Tr.SendAlternateToPenaltyBox;return}case re.LEVEL_EMPTY_ERROR:case re.LEVEL_PARSING_ERROR:{var c,p;const g=i.parent===N.MAIN?i.level:o.loadLevel;i.details===re.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 re.LEVEL_LOAD_ERROR:case re.LEVEL_LOAD_TIMEOUT:typeof(l==null?void 0:l.level)=="number"&&(i.errorAction=this.getPlaylistRetryOrSwitchAction(i,l.level));return;case re.AUDIO_TRACK_LOAD_ERROR:case re.AUDIO_TRACK_LOAD_TIMEOUT:case re.SUBTITLE_LOAD_ERROR:case re.SUBTITLE_TRACK_LOAD_TIMEOUT:if(l){const g=o.loadLevelObj;if(g&&(l.type===Re.AUDIO_TRACK&&g.hasAudioGroup(l.groupId)||l.type===Re.SUBTITLE_TRACK&&g.hasSubtitleGroup(l.groupId))){i.errorAction=this.getPlaylistRetryOrSwitchAction(i,o.loadLevel),i.errorAction.action=Tr.SendAlternateToPenaltyBox,i.errorAction.flags=je.MoveAllAlternatesMatchingHost;return}}return;case re.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const g=o.loadLevelObj,x=g==null?void 0:g.attrs["HDCP-LEVEL"];x?i.errorAction={action:Tr.SendAlternateToPenaltyBox,flags:je.MoveAllAlternatesMatchingHDCP,hdcpLevel:x}:this.keySystemError(i)}return;case re.BUFFER_ADD_CODEC_ERROR:case re.REMUX_ALLOC_ERROR:case re.BUFFER_APPEND_ERROR:if(!i.errorAction){var y;i.errorAction=this.getLevelSwitchAction(i,(y=i.level)!=null?y:o.loadLevel)}return;case re.INTERNAL_EXCEPTION:case re.BUFFER_APPENDING_ERROR:case re.BUFFER_FULL_ERROR:case re.LEVEL_SWITCH_ERROR:case re.BUFFER_STALLED_ERROR:case re.BUFFER_SEEK_OVER_HOLE:case re.BUFFER_NUDGE_ON_STALL:i.errorAction=br();return}i.type===Me.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=si(s.config.playlistLoadPolicy,t),l=this.playlistError++;if(Ii(o,l,ri(t),t.response))return{action:Tr.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=si(t.details.startsWith("key")?c:l,t),y=i.levels.reduce((x,S)=>x+S.fragmentError,0);if(o&&(t.details!==re.FRAG_GAP&&o.fragmentError++,Ii(p,y,ri(t),t.response)))return{action:Tr.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===re.BUFFER_APPEND_ERROR&&o.fragmentError++;let x=-1;const{levels:S,loadLevel:L,minAutoLevel:F,maxAutoLevel:$}=s;s.autoLevelEnabled||(s.loadLevel=-1);const te=(l=t.frag)==null?void 0:l.type,Te=(te===N.AUDIO&&g===re.FRAG_PARSING_ERROR||t.sourceBufferName==="audio"&&(g===re.BUFFER_ADD_CODEC_ERROR||g===re.BUFFER_APPEND_ERROR))&&S.some(({audioCodec:Ft})=>o.audioCodec!==Ft),$e=t.sourceBufferName==="video"&&(g===re.BUFFER_ADD_CODEC_ERROR||g===re.BUFFER_APPEND_ERROR)&&S.some(({codecSet:Ft,audioCodec:dt})=>o.codecSet!==Ft&&o.audioCodec===dt),{type:ht,groupId:mt}=(c=t.context)!=null?c:{};for(let Ft=S.length;Ft--;){const dt=(Ft+L)%S.length;if(dt!==L&&dt>=F&&dt<=$&&S[dt].loadError===0){var p,y;const Tt=S[dt];if(g===re.FRAG_GAP&&te===N.MAIN&&t.frag){const Ut=S[dt].details;if(Ut){const bt=kr(t.frag,Ut.fragments,t.frag.start);if(bt!=null&&bt.gap)continue}}else{if(ht===Re.AUDIO_TRACK&&Tt.hasAudioGroup(mt)||ht===Re.SUBTITLE_TRACK&&Tt.hasSubtitleGroup(mt))continue;if(te===N.AUDIO&&(p=o.audioGroups)!=null&&p.some(Ut=>Tt.hasAudioGroup(Ut))||te===N.SUBTITLE&&(y=o.subtitleGroups)!=null&&y.some(Ut=>Tt.hasSubtitleGroup(Ut))||Te&&o.audioCodec===Tt.audioCodec||!Te&&o.audioCodec!==Tt.audioCodec||$e&&o.codecSet===Tt.codecSet)continue}x=dt;break}}if(x>-1&&s.loadLevel!==x)return t.levelRetry=!0,this.playlistError=0,{action:Tr.SendAlternateToPenaltyBox,flags:je.None,nextAutoLevel:x}}return{action:Tr.SendAlternateToPenaltyBox,flags:je.MoveAllAlternatesMatchingHost}}onErrorOut(t,i){var s;switch((s=i.errorAction)==null?void 0:s.action){case Tr.DoNothing:break;case Tr.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(i),!i.errorAction.resolved&&i.details!==re.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 Tr.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=Nt[Nt.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===re.BUFFER_ADD_CODEC_ERROR&&t.mimeType&&t.sourceBufferName!=="audiovideo")){const s=Er(t.mimeType),o=this.hls.levels;for(let l=o.length;l--;)o[l][`${t.sourceBufferName}Codec`]===s&&this.hls.removeLevel(l)}}}function br(h){const t={action:Tr.DoNothing,flags:je.None};return h&&(t.resolved=!0),t}var qr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class on{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=Ni(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=Ni(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,L=o.end(x)+this.bufferPadding;if(g>=S&&y<=L){l.time.push({startPTS:Math.max(c,o.start(x)),endPTS:Math.min(p,o.end(x))});break}else if(c<L&&p>S){const F=Math.max(c,o.start(x)),$=Math.min(p,o.end(x));$>F&&(l.partial=!0,l.time.push({startPTS:F,endPTS:$}))}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=Ni(t),s=this.fragments[i];return s?s.buffered?vi(s)?qr.PARTIAL:qr.OK:qr.APPENDING:qr.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=Ni(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=Ni(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=Ni(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 Ni(h){return`${h.type}_${h.level}_${h.sn}`}var Gr={cbc:0,ctr:1};class gn{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 Gr.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,t);case Gr.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 wn(h){const t=h.byteLength,i=t&&new DataView(h.buffer).getUint8(t-1);return i?h.slice(0,t-i):h}class Gi{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],L=y[3],F=new Uint32Array(256);let $=0,te=0,Q=0;for(Q=0;Q<256;Q++)Q<128?F[Q]=Q<<1:F[Q]=Q<<1^283;for(Q=0;Q<256;Q++){let Te=te^te<<1^te<<2^te<<3^te<<4;Te=Te>>>8^Te&255^99,t[$]=Te,i[Te]=$;const Ve=F[$],$e=F[Ve],ht=F[$e];let mt=F[Te]*257^Te*16843008;o[$]=mt<<24|mt>>>8,l[$]=mt<<16|mt>>>16,c[$]=mt<<8|mt>>>24,p[$]=mt,mt=ht*16843009^$e*65537^Ve*257^$*16843008,g[Te]=mt<<24|mt>>>8,x[Te]=mt<<16|mt>>>16,S[Te]=mt<<8|mt>>>24,L[Te]=mt,$?($=Ve^F[F[F[ht^Ve]]],te^=F[F[te]]):$=te=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,L=this.rcon,F=this.invSubMix,$=F[0],te=F[1],Q=F[2],Te=F[3];let Ve,$e;for(p=0;p<c;p++){if(p<l){Ve=g[p]=i[p];continue}$e=Ve,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^=L[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]=Ve=(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]=$[S[$e>>>24]]^te[S[$e>>>16&255]]^Q[S[$e>>>8&255]]^Te[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],L=this.uint8ArrayToUint32Array_(s);let F=L[0],$=L[1],te=L[2],Q=L[3];const Te=new Int32Array(t),Ve=new Int32Array(Te.length);let $e,ht,mt,Ft,dt,Tt,Ut,bt,fr,vr,Ji,wi,di,Zr;const ai=this.networkToHostOrderSwap;for(;i<Te.length;){for(fr=ai(Te[i]),vr=ai(Te[i+1]),Ji=ai(Te[i+2]),wi=ai(Te[i+3]),dt=fr^l[0],Tt=wi^l[1],Ut=Ji^l[2],bt=vr^l[3],di=4,Zr=1;Zr<o;Zr++)$e=y[dt>>>24]^g[Tt>>16&255]^x[Ut>>8&255]^S[bt&255]^l[di],ht=y[Tt>>>24]^g[Ut>>16&255]^x[bt>>8&255]^S[dt&255]^l[di+1],mt=y[Ut>>>24]^g[bt>>16&255]^x[dt>>8&255]^S[Tt&255]^l[di+2],Ft=y[bt>>>24]^g[dt>>16&255]^x[Tt>>8&255]^S[Ut&255]^l[di+3],dt=$e,Tt=ht,Ut=mt,bt=Ft,di=di+4;$e=c[dt>>>24]<<24^c[Tt>>16&255]<<16^c[Ut>>8&255]<<8^c[bt&255]^l[di],ht=c[Tt>>>24]<<24^c[Ut>>16&255]<<16^c[bt>>8&255]<<8^c[dt&255]^l[di+1],mt=c[Ut>>>24]<<24^c[bt>>16&255]<<16^c[dt>>8&255]<<8^c[Tt&255]^l[di+2],Ft=c[bt>>>24]<<24^c[dt>>16&255]<<16^c[Tt>>8&255]<<8^c[Ut&255]^l[di+3],Ve[i]=ai($e^F),Ve[i+1]=ai(Ft^$),Ve[i+2]=ai(mt^te),Ve[i+3]=ai(ht^Q),F=fr,$=vr,te=Ji,Q=wi,i=i+4}return Ve.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=Xn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}function Xn(h){switch(h){case Gr.cbc:return"AES-CBC";case Gr.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${h}`)}}const zn=16;class Vn{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?wn(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!==Gr.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 Gi),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 gn(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%zn;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 Or=Math.pow(2,17);class Ai{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 bn({type:Me.NETWORK_ERROR,details:re.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($=>$[0]==="GAP")){y(Vi(t));return}else t.gap=!1;const g=this.loader=l?new l(o):new c(o),x=Ui(t);t.loader=g;const S=fi(o.fragLoadPolicy.default),L={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:t.sn==="initSegment"?1/0:Or};t.stats=g.stats;const F={onSuccess:($,te,Q,Te)=>{this.resetLoader(t,g);let Ve=$.data;Q.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(Ve.slice(0,16)),Ve=Ve.slice(16)),p({frag:t,part:null,payload:Ve,networkDetails:Te})},onError:($,te,Q,Te)=>{this.resetLoader(t,g),y(new bn({type:Me.NETWORK_ERROR,details:re.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:O({url:s,data:void 0},$),error:new Error(`HTTP Error ${$.code} ${$.text}`),networkDetails:Q,stats:Te}))},onAbort:($,te,Q)=>{this.resetLoader(t,g),y(new bn({type:Me.NETWORK_ERROR,details:re.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:Q,stats:$}))},onTimeout:($,te,Q)=>{this.resetLoader(t,g),y(new bn({type:Me.NETWORK_ERROR,details:re.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${L.timeout}ms`),networkDetails:Q,stats:$}))}};i&&(F.onProgress=($,te,Q,Te)=>i({frag:t,part:null,payload:Q,networkDetails:Te})),g.load(x,L,F)})}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(Vi(t,i));return}const g=this.loader=l?new l(o):new c(o),x=Ui(t,i);t.loader=g;const S=fi(o.fragLoadPolicy.default),L={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Or};i.stats=g.stats,g.load(x,L,{onSuccess:(F,$,te,Q)=>{this.resetLoader(t,g),this.updateStatsFromPart(t,i);const Te={frag:t,part:i,payload:F.data,networkDetails:Q};s(Te),p(Te)},onError:(F,$,te,Q)=>{this.resetLoader(t,g),y(new bn({type:Me.NETWORK_ERROR,details:re.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:i,response:O({url:x.url,data:void 0},F),error:new Error(`HTTP Error ${F.code} ${F.text}`),networkDetails:te,stats:Q}))},onAbort:(F,$,te)=>{t.stats.aborted=i.stats.aborted,this.resetLoader(t,g),y(new bn({type:Me.NETWORK_ERROR,details:re.INTERNAL_ABORTED,fatal:!1,frag:t,part:i,error:new Error("Aborted"),networkDetails:te,stats:F}))},onTimeout:(F,$,te)=>{this.resetLoader(t,g),y(new bn({type:Me.NETWORK_ERROR,details:re.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:i,error:new Error(`Timeout after ${L.timeout}ms`),networkDetails:te,stats:F}))}})})}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 Ui(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"&&Wn((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 Vi(h,t){const i=new Error(`GAP ${h.gap?"tag":"attribute"} found`),s={type:Me.MEDIA_ERROR,details:re.FRAG_GAP,fatal:!1,frag:h,error:i,networkDetails:null};return t&&(s.part=t),(t||h).stats.aborted=!0,new bn(s)}function Wn(h){return h==="AES-128"||h==="AES-256"}class bn extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class nn 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 On{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=$i(),this.buffering={audio:$i(),video:$i(),audiovideo:$i()},this.level=t,this.sn=i,this.id=s,this.size=o,this.part=l,this.partial=c}}function $i(){return{start:0,executeStart:0,executeEnd:0,end:0}}const rs={length:0,start:()=>0,end:()=>0};class Wr{static isBuffered(t,i){if(t){const s=Wr.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=Wr.getBuffered(t);return Wr.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=Wr.bufferedRanges(t);if(o.length)return Wr.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 L=l[S-1].end;t[x].start-L<s?t[x].end>L&&(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,L=l[x].end;if(o===-1&&i>=S&&i<=L&&(o=x),i+s>=S&&i<L)y=S,g=L,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 Jn(h){return ss.test(h)}function Sn(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 Ri(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 ps(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 ys=/^(\d+)x(\d+)$/,us=/(.+?)=(".*?"|.*?)(?:,|$)/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=ys.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(us.lastIndex=0;(s=us.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=Sn(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 bs="com.apple.hls.interstitial";function _s(h){return h!=="ID"&&h!=="CLASS"&&h!=="CUE"&&h!=="START-DATE"&&h!=="DURATION"&&h!=="END-DATE"&&h!=="END-ON-NEXT"}function ir(h){return h==="SCTE35-OUT"||h==="SCTE35-IN"||h==="SCTE35-CMD"}class vn{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===bs}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 xs=10;class cs{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||xs}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 hn(h){return h==="AES-128"||h==="AES-256"||h==="AES-256-CTR"}function dn(h){switch(h){case"AES-128":case"AES-256":return Gr.cbc;case"AES-256-CTR":return Gr.ctr;default:throw new Error(`invalid full segment method ${h}`)}}function Oi(h){return Uint8Array.from(atob(h),t=>t.charCodeAt(0))}function sn(h){return Uint8Array.from(unescape(encodeURIComponent(h)),t=>t.charCodeAt(0))}function Un(h){const t=sn(h).subarray(0,16),i=new Uint8Array(16);return i.set(t,16-t.length),i}function jn(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 Bn(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=Oi(c)):i=Un(c)}}return i}const kn=typeof self!="undefined"?self:void 0;var Pi={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},_i={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Di(h){switch(h){case _i.FAIRPLAY:return Pi.FAIRPLAY;case _i.PLAYREADY:return Pi.PLAYREADY;case _i.WIDEVINE:return Pi.WIDEVINE;case _i.CLEARKEY:return Pi.CLEARKEY}}var ln={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Tn(h){if(h===ln.WIDEVINE)return Pi.WIDEVINE;if(h===ln.PLAYREADY)return Pi.PLAYREADY;if(h===ln.CENC||h===ln.CLEARKEY)return Pi.CLEARKEY}function Qn(h){switch(h){case Pi.FAIRPLAY:return _i.FAIRPLAY;case Pi.PLAYREADY:return _i.PLAYREADY;case Pi.WIDEVINE:return _i.WIDEVINE;case Pi.CLEARKEY:return _i.CLEARKEY}}function Ir(h){const{drmSystems:t,widevineLicenseUrl:i}=h,s=t?[Pi.FAIRPLAY,Pi.WIDEVINE,Pi.PLAYREADY,Pi.CLEARKEY].filter(o=>!!t[o]):[];return!s[Pi.WIDEVINE]&&i&&s.push(Pi.WIDEVINE),s}const Jr=function(h){return kn!=null&&(h=kn.navigator)!=null&&h.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function _n(h,t,i,s){let o;switch(h){case Pi.FAIRPLAY:o=["cenc","sinf"];break;case Pi.WIDEVINE:case Pi.PLAYREADY:o=["cenc"];break;case Pi.CLEARKEY:o=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${h}`)}return In(o,t,i,s)}function In(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 Qi(h){var t;return h.sessionType==="persistent-license"||!!((t=h.sessionTypes)!=null&&t.some(i=>i==="persistent-license"))}function Ks(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=Oi(p).subarray(0,16);return jn(y),y}}return null}let hs={};class ws{static clearKeyUriToKeyIdMap(){hs={}}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&&!hn(t)}isSupported(){if(this.method){if(hn(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case _i.FAIRPLAY:case _i.WIDEVINE:case _i.PLAYREADY:case _i.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(hn(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=qn(t);return new ws(this.method,this.uri,"identity",this.keyFormatVersions,s)}const i=Bn(this.uri);if(i)switch(this.keyFormat){case _i.WIDEVINE:this.pssh=i,i.length>=22&&(this.keyId=i.subarray(i.length-22,i.length-6));break;case _i.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=Ks(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=hs[this.uri];if(!s){const o=Object.keys(hs).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,o),hs[this.uri]=s}this.keyId=s}return this}}function qn(h){const t=new Uint8Array(16);for(let i=12;i<16;i++)t[i]=h>>8*(15-i)&255;return t}const Zs=/#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,sa=/#EXT-X-MEDIA:(.*)/g,Pa=/^#EXT(?:INF|-X-TARGETDURATION):/m,Sa=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Oa=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 xn{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 Se.buildAbsoluteURL(i,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return Pa.test(t)}static parseMasterPlaylist(t,i){const s=Jn(t),o={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:s},l=[];Zs.lastIndex=0;let c;for(;(c=Zs.exec(t))!=null;)if(c[1]){var p;const g=new pi(c[1],o),x=Sn(o,c[2]),S={attrs:g,bitrate:g.decimalInteger("BANDWIDTH")||g.decimalInteger("AVERAGE-BANDWIDTH"),name:g.NAME,url:xn.resolve(x,i)},L=g.decimalResolution("RESOLUTION");L&&(S.width=L.width,S.height=L.height),aa(g.CODECS,S);const F=g["SUPPLEMENTAL-CODECS"];F&&(S.supplemental={},aa(F,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),L=S["DATA-ID"];L&&(o.sessionData===null&&(o.sessionData={}),o.sessionData[L]=S);break}case"SESSION-KEY":{const S=Ys(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);Ri(o,S,i)}break}case"CONTENT-STEERING":{const S=new pi(x,o);o.contentSteering={uri:xn.resolve(S["SERVER-URI"],i),pathwayId:S["PATHWAY-ID"]||"."};break}case"START":{o.startTimeOffset=Ba(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(sa.lastIndex=0;(o=sa.exec(t))!==null;){const g=new pi(o[1],s),x=g.TYPE;if(x){const S=p[x],L=l[x]||[];l[x]=L;const F=g.LANGUAGE,$=g["ASSOC-LANGUAGE"],te=g.CHANNELS,Q=g.CHARACTERISTICS,Te=g["INSTREAM-ID"],Ve={attrs:g,bitrate:0,id:y++,groupId:g["GROUP-ID"]||"",name:g.NAME||F||"",type:x,default:g.bool("DEFAULT"),autoselect:g.bool("AUTOSELECT"),forced:g.bool("FORCED"),lang:F,url:g.URI?xn.resolve(g.URI,i):""};if($&&(Ve.assocLang=$),te&&(Ve.channels=te),Q&&(Ve.characteristics=Q),Te&&(Ve.instreamId=Te),S!=null&&S.length){const $e=xn.findGroup(S,Ve.groupId)||S[0];Yo(Ve,$e,"audioCodec"),Yo(Ve,$e,"textCodec")}L.push(Ve)}}return l}static parseLevelPlaylist(t,i,s,o,l,c){var p;const y={url:i},g=new cs(i),x=g.fragments,S=[];let L=null,F=0,$=0,te=0,Q=0,Te=0,Ve=null,$e=new st(o,y),ht,mt,Ft,dt=-1,Tt=!1,Ut=null,bt;if(Sa.lastIndex=0,g.m3u8=t,g.hasVariableRefs=Jn(t),((p=Sa.exec(t))==null?void 0:p[0])!=="#EXTM3U")return g.playlistParsingError=new Error("Missing format identifier #EXTM3U"),g;for(;(ht=Sa.exec(t))!==null;){Tt&&(Tt=!1,$e=new st(o,y),$e.playlistOffset=te,$e.start=te,$e.sn=F,$e.cc=Q,Te&&($e.bitrate=Te),$e.level=s,L&&($e.initSegment=L,L.rawProgramDateTime&&($e.rawProgramDateTime=L.rawProgramDateTime,L.rawProgramDateTime=null),Ut&&($e.setByteRange(Ut),Ut=null)));const wi=ht[1];if(wi){$e.duration=parseFloat(wi);const di=(" "+ht[2]).slice(1);$e.title=di||null,$e.tagList.push(di?["INF",wi,di]:["INF",wi])}else if(ht[3]){if(pe($e.duration)){$e.playlistOffset=te,$e.start=te,Ft&&Fa($e,Ft,g),$e.sn=F,$e.level=s,$e.cc=Q,x.push($e);const di=(" "+ht[3]).slice(1);$e.relurl=Sn(g,di),Ts($e,Ve,S),Ve=$e,te+=$e.duration,F++,$=0,Tt=!0}}else{if(ht=ht[0].match(Oa),!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 di=(" "+ht[mt]).slice(1),Zr=(" "+ht[mt+1]).slice(1),ai=ht[mt+2]?(" "+ht[mt+2]).slice(1):null;switch(di){case"BYTERANGE":Ve?$e.setByteRange(Zr,Ve):$e.setByteRange(Zr);break;case"PROGRAM-DATE-TIME":$e.rawProgramDateTime=Zr,$e.tagList.push(["PROGRAM-DATE-TIME",Zr]),dt===-1&&(dt=x.length);break;case"PLAYLIST-TYPE":g.type&&Xs(g,di,ht),g.type=Zr.toUpperCase();break;case"MEDIA-SEQUENCE":g.startSN!==0?Xs(g,di,ht):x.length>0&&_o(g,di,ht),F=g.startSN=parseInt(Zr);break;case"SKIP":{g.skippedSegments&&Xs(g,di,ht);const hi=new pi(Zr,g),pr=hi.decimalInteger("SKIPPED-SEGMENTS");if(pe(pr)){g.skippedSegments+=pr;for(let xi=pr;xi--;)x.push(null);F+=pr}const _r=hi.enumeratedString("RECENTLY-REMOVED-DATERANGES");_r&&(g.recentlyRemovedDateranges=(g.recentlyRemovedDateranges||[]).concat(_r.split(" ")));break}case"TARGETDURATION":g.targetduration!==0&&Xs(g,di,ht),g.targetduration=Math.max(parseInt(Zr),1);break;case"VERSION":g.version!==null&&Xs(g,di,ht),g.version=parseInt(Zr);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":g.live||Xs(g,di,ht),g.live=!1;break;case"#":(Zr||ai)&&$e.tagList.push(ai?[Zr,ai]:[Zr]);break;case"DISCONTINUITY":Q++,$e.tagList.push(["DIS"]);break;case"GAP":$e.gap=!0,$e.tagList.push([di]);break;case"BITRATE":$e.tagList.push([di,Zr]),Te=parseInt(Zr)*1e3,pe(Te)?$e.bitrate=Te:Te=0;break;case"DATERANGE":{const hi=new pi(Zr,g),pr=new vn(hi,g.dateRanges[hi.ID],g.dateRangeTagCount);g.dateRangeTagCount++,pr.isValid||g.skippedSegments?g.dateRanges[pr.id]=pr:ve.warn(`Ignoring invalid DATERANGE tag: "${Zr}"`),$e.tagList.push(["EXT-X-DATERANGE",Zr]);break}case"DEFINE":{{const hi=new pi(Zr,g);"IMPORT"in hi?ps(g,hi,c):Ri(g,hi,i)}break}case"DISCONTINUITY-SEQUENCE":g.startCC!==0?Xs(g,di,ht):x.length>0&&_o(g,di,ht),g.startCC=Q=parseInt(Zr);break;case"KEY":{const hi=Ys(Zr,i,g);if(hi.isSupported()){if(hi.method==="NONE"){Ft=void 0;break}Ft||(Ft={}),Ft[hi.keyFormat]&&(Ft=k({},Ft)),Ft[hi.keyFormat]=hi}else ve.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Zr}"`);break}case"START":g.startTimeOffset=Ba(Zr);break;case"MAP":{const hi=new pi(Zr,g);if($e.duration){const pr=new st(o,y);bo(pr,hi,s,Ft),L=pr,$e.initSegment=L,L.rawProgramDateTime&&!$e.rawProgramDateTime&&($e.rawProgramDateTime=L.rawProgramDateTime)}else{const pr=$e.byteRangeEndOffset;if(pr){const _r=$e.byteRangeStartOffset;Ut=`${pr-_r}@${_r}`}else Ut=null;bo($e,hi,s,Ft),L=$e,Tt=!0}L.cc=Q;break}case"SERVER-CONTROL":{bt&&Xs(g,di,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&&Xs(g,di,ht);const hi=new pi(Zr);g.partTarget=hi.decimalFloatingPoint("PART-TARGET");break}case"PART":{let hi=g.partList;hi||(hi=g.partList=[]);const pr=$>0?hi[hi.length-1]:void 0,_r=$++,xi=new pi(Zr,g),ki=new ot(xi,$e,y,_r,pr);hi.push(ki),$e.duration+=ki.duration;break}case"PRELOAD-HINT":{const hi=new pi(Zr,g);g.preloadHint=hi;break}case"RENDITION-REPORT":{const hi=new pi(Zr,g);g.renditionReports=g.renditionReports||[],g.renditionReports.push(hi);break}default:ve.warn(`line parsed but not handled: ${ht}`);break}}}Ve&&!Ve.relurl?(x.pop(),te-=Ve.duration,g.partList&&(g.fragmentHint=Ve)):g.partList&&(Ts($e,Ve,S),$e.cc=Q,g.fragmentHint=$e,Ft&&Fa($e,Ft,g)),g.targetduration||(g.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const fr=x.length,vr=x[0],Ji=x[fr-1];if(te+=g.skippedSegments*g.targetduration,te>0&&fr&&Ji){g.averagetargetduration=te/fr;const wi=Ji.sn;g.endSN=wi!=="initSegment"?wi:0,g.live||(Ji.endList=!0),vr&&g.startCC===void 0&&(g.startCC=vr.cc),dt>0&&(yo(x,dt),vr&&S.unshift(vr))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(te+=g.fragmentHint.duration),g.totalduration=te,S.length&&g.dateRangeTagCount&&vr&&Ss(S,g),g.endCC=Q,g}}function Ss(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=Kn(t,y,h,g,o);if(x!==-1){p.tagAnchor=t.fragments[x].ref;break}}}}function Kn(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 L=(i[s+1]||x[x.length-1]).sn-h.startSN;for(let F=L;F>g;F--){const $=x[F].programDateTime;if(t>=$&&t<$+x[F].duration*1e3)return F}}return g}}}return-1}function Ys(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?xn.resolve(p,t):"",L=(g||"1").split("/").map(Number).filter(Number.isFinite);return new ws(c,S,x,L,y)}function Ba(h){const i=new pi(h).decimalFloatingPoint("TIME-OFFSET");return pe(i)?i:null}function aa(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 Yo(h,t,i){const s=t[i];s&&(h[i]=s)}function yo(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 Ts(h,t,i){h.rawProgramDateTime?i.push(h):t!=null&&t.programDateTime&&(h.programDateTime=t.endProgramDateTime)}function bo(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 Fa(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 Xs(h,t,i){h.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${i[0]})`)}function _o(h,t,i){h.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${i[0]})`)}function da(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 Ea(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 Q=Math.abs(g-i);pe(t.deltaPTS)?t.deltaPTS=Math.max(Q,t.deltaPTS):t.deltaPTS=Q,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 L=t.sn;if(!h||L<h.startSN||L>h.endSN)return 0;let F;const $=L-h.startSN,te=h.fragments;for(te[$]=t,F=$;F>0;F--)da(te[F],te[F-1]);for(F=$;F<te.length-1;F++)da(te[F],te[F+1]);return h.fragmentHint&&da(te[te.length-1],h.fragmentHint),h.PTSKnown=h.alignedSliding=!0,S}function Ja(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;Jo(h,t,(y,g,x,S)=>{if(t.skippedSegments&&g.cc!==y.cc){const L=y.cc-g.cc;for(let F=x;F<S.length;F++)S[F].cc+=L}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=Xo(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&&Ts(c[g],c[g-1],y);Ss(y,t)}Na(h.partList,t.partList,(y,g)=>{g.elementaryStreams=y.elementaryStreams,g.stats=y.stats}),o?Ea(t,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):Qa(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 Xo(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 vn(i[p].attr,y);g.isValid?(o[p]=g,y||(g.tagOrder+=c)):ve.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Kr(i[p].attr)}"`)}),o}function Na(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 Jo(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=Cs(`media sequence mismatch ${S.sn}:`,h,t,x,S);return}else if(x.cc!==S.cc){t.playlistParsingError=Cs(`discontinuity sequence mismatch (${x.cc}!=${S.cc})`,h,t,x,S);return}}}}function Cs(h,t,i,s,o){return new Error(`${h} ${o.url}
Playlist starting @${t.startSN}
${t.m3u8}
Playlist starting @${i.startSN}
${i.m3u8}`)}function Qa(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;xo(t,c)}function xo(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 $a(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 eo(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 to(h,t,i){return h?Js(h.partList,t,i):null}function Js(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 za(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 Os(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 Qo(h,t){return!!(h&&t.startCC<h.endCC&&t.endCC>h.startCC)}function Ki(h,t){if(h){const i=h.start+t;h.start=h.startPTS=i,h.endPTS=i+h.duration}}function Yi(h,t){const i=t.fragments;for(let s=0,o=i.length;s<o;s++)Ki(i[s],h);t.fragmentHint&&Ki(t.fragmentHint,h),t.alignedSliding=!0}function Xi(h,t){h&&(Es(t,h),!t.alignedSliding&&h&&En(t,h),!t.alignedSliding&&h&&!t.skippedSegments&&Qa(h,t,!1))}function Es(h,t){if(!Qo(t,h))return;const i=Math.min(t.endCC,h.endCC),s=Os(t.fragments,i),o=Os(h.fragments,i);if(!s||!o)return;ve.log(`Aligning playlist at start of dicontinuity sequence ${i}`);const l=s.start-o.start;Yi(l,h)}function En(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=Os(s,c),l=Os(i,c)),(!o||!l)&&(o=s[Math.floor(s.length/2)],l=Os(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);Yi(g,h)}const Ua={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}},Vt={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 ro extends nn{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=Vt.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,L=Wr.bufferInfo(g||y,S,c.maxBufferHole);if(this.log(`media seeking to ${pe(S)?S.toFixed(3):S}, state: ${x}`),this.state===Vt.ENDED)this.resetLoadingState();else if(p){const F=c.maxFragLookUpTolerance,$=p.start-F,te=p.start+p.duration+F;if(!L.len||te<L.start||$>L.end){const Q=S>te;(S<$||Q)&&(Q&&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 F=this.lastCurrentTime;if(S>F&&(this.lastCurrentTime=S),!this.loadingParts){const $=Math.max(L.end,S),te=this.shouldLoadParts(this.getLevelDetails(),$);te&&(this.log(`LL-Part loading ON after seeking to ${S.toFixed(2)} with buffer @${$.toFixed(2)}`),this.loadingParts=te)}}!this.hls.hasEnoughToStart&&!L.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 Ai(t.config),this.keyLoader=s,this.fragmentTracker=i,this.config=t.config,this.decrypter=new Vn(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===Vt.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=Vt.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 Wr.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===Vt.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=Vt.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===Vt.FRAG_LOADING||!this.fragCurrent&&c===Vt.PARSING)&&(this.fragmentTracker.removeFragment(p),this.state=Vt.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===Vt.STOPPED||this.state===Vt.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)===qr.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)===qr.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&&hn(p.method)){const y=self.performance.now();return this.decrypter.decrypt(new Uint8Array(c),p.key.buffer,p.iv.buffer,dn(p.method)).catch(g=>{throw o.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:re.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===Vt.STOPPED||this.state===Vt.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!==Vt.STOPPED&&(this.state=Vt.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?Ua.toString(Wr.getBuffered(s)):"(detached)"})`),be(t)){var o;if(t.type!==N.SUBTITLE){const c=t.elementaryStreams;if(!Object.keys(c).some(p=>!!c[p])){this.state=Vt.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=Vt.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 On(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=Vt.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===Vt.KEY_LOADING&&(this.state=Vt.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(be(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&&be(t)){const S=c.partList;if(S&&o){s>t.end&&c.fragmentHint&&(t=c.fragmentHint);const L=this.getNextPart(S,t,s);if(L>-1){const F=S[L];t=this.fragCurrent=F.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${F.index} (${L}/${S.length-1}) of ${this.fragInfo(t,!1,F)}) cc: ${t.cc} [${c.startSN}-${c.endSN}], target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=F.start+F.duration,this.state=Vt.FRAG_LOADING;let $;return p?$=p.then(te=>!te||this.fragContextChanged(te.frag)?null:this.doFragPartsLoad(t,F,i,o)).catch(te=>this.handleFragLoadError(te)):$=this.doFragPartsLoad(t,F,i,o).catch(te=>this.handleFragLoadError(te)),this.hls.trigger(E.FRAG_LOADING,{frag:t,part:F,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):$}else if(!t.url||this.loadedEndOfParts(S,s))return Promise.resolve(null)}}if(be(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=Vt.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(L=>{y[S.index]=L;const F=L.part;this.hls.trigger(E.FRAG_LOADED,L);const $=to(s.details,t.sn,S.index+1)||Js(g,t.sn,S.index+1);if($)x($);else return l({frag:t,part:F,partsLoaded:y})}).catch(c)};x(i)})}handleFragLoadError(t){if("data"in t){const i=t.data;t.data&&i.details===re.INTERNAL_ABORTED?this.handleFragLoadAborted(i.frag,i.part):this.hls.trigger(E.ERROR,i)}else this.hls.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:re.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const i=this.getCurrentContext(t);if(!i||this.state!==Vt.PARSING){!this.fragCurrent&&this.state!==Vt.STOPPED&&this.state!==Vt.ERROR&&(this.state=Vt.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?to(y,l,c):null,x=g?g.fragment:eo(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!==Vt.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(!Wr.isBuffered(i,i.currentTime)){this.flushMainBuffer(0,t.start);return}const s=i.currentTime,o=Wr.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=Wr.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 Wr.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=N.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 L=this.hls.startPosition,F=this.hls.liveSyncPosition,$=y?(L!==-1&&L>=c?L:F)||y.start:t;this.log(`Setting startPosition to ${$} to match start frag at live edge. mainStart: ${L} liveSyncPosition: ${F} frag.start: ${(g=y)==null?void 0:g.start}`),this.startPosition=this.nextLoadPosition=$}}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===qr.OK||s===qr.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!==N.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 L;if(t<i){var F;const te=t<this.lastCurrentTime||t>i-g||(F=this.media)!=null&&F.paused||!this.startFragRequested?0:g;L=kr(l,c,t,te)}else L=c[c.length-1];if(L){const $=L.sn-s.startSN,te=this.fragmentTracker.getState(L);if((te===qr.OK||te===qr.PARTIAL&&L.gap)&&(l=L),l&&L.sn===l.sn&&(!S||x[0].fragment.sn>L.sn||!s.live&&!S)&&l&&L.level===l.level){const Te=c[$+1];L.sn<p&&this.fragmentTracker.getState(Te)!==qr.OK?L=Te:L=null}}return L}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){Xi(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&&be(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!==Vt.FRAG_LOADING_WAITING_RETRY)&&(this.state=Vt.IDLE)}onFragmentOrKeyLoadError(t,i){if(i.chunkMeta&&!i.frag){const $=this.getCurrentContext(i.chunkMeta);$&&(i.frag=$.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===re.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,L=S&&p===Tr.RetryRequest,F=S&&!c.resolved&&y===je.MoveAllAlternatesMatchingHost;if(!L&&F&&be(s)&&!s.endList)this.resetFragmentErrors(t),this.treatAsGap(s),c.resolved=!0;else if((L||F)&&g<x.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const $=Hr(x,g);this.warn(`Fragment ${s.sn} of ${t} ${s.level} errored with ${i.details}, retrying loading ${g+1}/${x.maxNumRetry} in ${$}ms`),c.resolved=!0,this.retryDate=self.performance.now()+$,this.state=Vt.FRAG_LOADING_WAITING_RETRY}else if(x&&c)if(this.resetFragmentErrors(t),g<x.maxNumRetry)!l&&p!==Tr.RemoveAlternatePermanently&&(c.resolved=!0);else{this.warn(`${i.details} reached or exceeded max retry (${g})`);return}else p===Tr.SendAlternateToPenaltyBox?this.state=Vt.WAITING_LEVEL:this.state=Vt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(t){if(this.state===Vt.PARSING||this.state===Vt.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===N.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Vt.STOPPED&&(this.state=Vt.IDLE)}afterBufferFlushed(t,i,s){if(!t)return;const o=Wr.getBuffered(t);this.fragmentTracker.detectEvictedFragments(i,o,s),this.state===Vt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Vt.STOPPED&&(this.state=Vt.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 L=o?0:Ea(l,t,x.startPTS,x.endPTS,x.startDTS,x.endDTS);return this.hls.trigger(E.LEVEL_PTS_UPDATED,{details:l,level:s,drift:L,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:Me.MEDIA_ERROR,details:re.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=Vt.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===N.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 io{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=oa(t,i);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function oa(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 Hs={exports:{}},So;function mu(){return So||(So=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,L){if(typeof x!="function")throw new TypeError("The listener must be a function");var F=new o(x,S||y,L),$=i?i+g:g;return y._events[$]?y._events[$].fn?y._events[$]=[y._events[$],F]:y._events[$].push(F):(y._events[$]=F,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 L=0,F=S.length,$=new Array(F);L<F;L++)$[L]=S[L].fn;return $},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,L,F,$){var te=i?i+g:g;if(!this._events[te])return!1;var Q=this._events[te],Te=arguments.length,Ve,$e;if(Q.fn){switch(Q.once&&this.removeListener(g,Q.fn,void 0,!0),Te){case 1:return Q.fn.call(Q.context),!0;case 2:return Q.fn.call(Q.context,x),!0;case 3:return Q.fn.call(Q.context,x,S),!0;case 4:return Q.fn.call(Q.context,x,S,L),!0;case 5:return Q.fn.call(Q.context,x,S,L,F),!0;case 6:return Q.fn.call(Q.context,x,S,L,F,$),!0}for($e=1,Ve=new Array(Te-1);$e<Te;$e++)Ve[$e-1]=arguments[$e];Q.fn.apply(Q.context,Ve)}else{var ht=Q.length,mt;for($e=0;$e<ht;$e++)switch(Q[$e].once&&this.removeListener(g,Q[$e].fn,void 0,!0),Te){case 1:Q[$e].fn.call(Q[$e].context);break;case 2:Q[$e].fn.call(Q[$e].context,x);break;case 3:Q[$e].fn.call(Q[$e].context,x,S);break;case 4:Q[$e].fn.call(Q[$e].context,x,S,L);break;default:if(!Ve)for(mt=1,Ve=new Array(Te-1);mt<Te;mt++)Ve[mt-1]=arguments[mt];Q[$e].fn.apply(Q[$e].context,Ve)}}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,L){var F=i?i+g:g;if(!this._events[F])return this;if(!x)return c(this,F),this;var $=this._events[F];if($.fn)$.fn===x&&(!L||$.once)&&(!S||$.context===S)&&c(this,F);else{for(var te=0,Q=[],Te=$.length;te<Te;te++)($[te].fn!==x||L&&!$[te].once||S&&$[te].context!==S)&&Q.push($[te]);Q.length?this._events[F]=Q.length===1?Q[0]:Q:c(this,F)}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}(Hs)),Hs.exports}var gu=mu(),el=ie(gu);const Ka="1.6.1",Aa={};function vu(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Eo(){const h=Aa[Ka];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 Aa[Ka]=o,o}function yu(h){const t=Aa[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 Aa[h]=o,o}function i0(h){const t=Aa[h||Ka];if(t&&t.clientCount--===1){const{worker:s,objectURL:o}=t;delete Aa[h||Ka],o&&self.URL.revokeObjectURL(o),s.terminate()}}function tl(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 rl(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 Ao(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 es(h,t){const i=t;let s=0;for(;rl(h,t);){s+=10;const o=Ao(h,t+6);s+=o,tl(h,t+10)&&(s+=10),t+=s}if(s>0)return h.subarray(i,i+s)}function Ns(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 F=new Error(`invalid ADTS sampling index:${c}`);h.emit(E.ERROR,E.ERROR,{type:Me.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,fatal:!0,error:F,reason:F.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 L=[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:L,samplerate:x,channelCount:y,codec:g,parsedCodec:g,manifestCodec:s}}function Gs(h,t){return h[t]===255&&(h[t+1]&246)===240}function bu(h,t){return h[t+1]&1?7:9}function il(h,t){return(h[t+3]&3)<<11|h[t+4]<<3|(h[t+5]&224)>>>5}function _u(h,t){return t+5<h.length}function nl(h,t){return t+1<h.length&&Gs(h,t)}function Il(h,t){return _u(h,t)&&Gs(h,t)&&il(h,t)<=h.length-t}function xu(h,t){if(nl(h,t)){const i=bu(h,t);if(t+i>=h.length)return!1;const s=il(h,t);if(s<=i)return!1;const o=t+s;return o===h.length||nl(h,o)}return!1}function wu(h,t,i,s,o){if(!h.samplerate){const l=Ns(t,i,s,o);if(!l)return;k(h,l)}}function Pl(h){return 1024*9e4/h}function Ol(h,t){const i=bu(h,t);if(t+i<=h.length){const s=il(h,t)-i;if(s>0)return{headerLength:i,frameLength:s}}}function Bl(h,t,i,s,o){const l=Pl(h.samplerate),c=s+o*l,p=Ol(t,i);let y;if(p){const{frameLength:S,headerLength:L}=p,F=L+S,$=Math.max(0,i+F-t.length);$?(y=new Uint8Array(F-L),y.set(t.subarray(i+L,t.length),0)):y=t.subarray(i+L,i+F);const te={unit:y,pts:c};return $||h.samples.push(te),{sample:te,length:F,missing:$}}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 Fl(h,t){return rl(h,t)&&Ao(h,t+6)+10<=h.length-t}function sl(h){if(h.size<2)return;const t=gt(h.data,!0),i=new Uint8Array(h.data.subarray(t.length+1));return{key:h.type,info:t,data:i.buffer}}function Nl(h){if(h.size<2)return;if(h.type==="TXXX"){let i=1;const s=gt(h.data.subarray(i),!0);i+=s.length+1;const o=gt(h.data.subarray(i));return{key:h.type,info:s,data:o}}const t=gt(h.data.subarray(1));return{key:h.type,info:"",data:t}}function la(h){if(h.type==="WXXX"){if(h.size<2)return;let i=1;const s=gt(h.data.subarray(i),!0);i+=s.length+1;const o=gt(h.data.subarray(i));return{key:h.type,info:s,data:o}}const t=gt(h.data);return{key:h.type,info:"",data:t}}function $l(h){return btoa(String.fromCharCode(...h))}function zl(h,t){if(h<0)return-zl(-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 Su(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 Eu(){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 n0(h){return h instanceof ArrayBuffer?h:h.byteOffset==0&&h.byteLength==h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer}function Ha(h,t=0,i=1/0){return al(h,t,i,Uint8Array)}function al(h,t,i,s){const o=Au(h);let l=1;"BYTES_PER_ELEMENT"in s&&(l=s.BYTES_PER_ELEMENT);const c=s0(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 Au(h){return h instanceof ArrayBuffer?h:h.buffer}function s0(h){return h&&h.buffer instanceof ArrayBuffer&&h.byteLength!==void 0&&h.byteOffset!==void 0}function a0(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=gt(Ha(h.data,1,s)),l=h.data[2+s],c=h.data.subarray(3+s).indexOf(0);if(c===-1)return;const p=gt(Ha(h.data,3+s,c));let y;return o==="-->"?y=gt(Ha(h.data,4+s+c)):y=n0(h.data.subarray(4+s+c)),t.mimeType=o,t.pictureType=l,t.description=p,t.data=y,t}function o0(h){return h.type==="PRIV"?sl(h):h.type[0]==="W"?la(h):h.type==="APIC"?a0(h):Nl(h)}function Ul(h){const t=String.fromCharCode(h[0],h[1],h[2],h[3]),i=Ao(h,4),s=10;return{type:t,size:i,data:h.subarray(s,s+i)}}const ol=10,fa=10;function ll(h){let t=0;const i=[];for(;rl(h,t);){const s=Ao(h,t+6);h[t+5]>>6&1&&(t+=ol),t+=ol;const o=t+s;for(;t+fa<o;){const l=Ul(h.subarray(t)),c=o0(l);c&&i.push(c),t+=l.size+ol}tl(h,t)&&(t+=ol)}return i}function pa(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"}function ku(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=ll(h);for(let i=0;i<t.length;i++){const s=t[i];if(pa(s))return ku(s)}}let ke=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 Qs(h="",t=9e4){return{type:h,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class no{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=es(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=Kl(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:ke.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 Fl(t,o)?(s=es(t,o),p.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ke.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:Qs(),id3Track:p,textTrack:Qs()}}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:Qs(),id3Track:this._id3Track,textTrack:Qs()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Kl=(h,t,i)=>{if(pe(h))return h*90;const s=i?i.baseTime*9e4/i.timescale:0;return t*9e4+s};let ko=null;const Hl=[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],Tu=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Cu=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],l0=[0,1,1,4];function Gl(h,t,i,s,o){if(i+24>t.length)return;const l=Vl(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 Vl(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=Hl[y*14+o-1]*1e3,S=Tu[(i===3?0:i===2?1:2)*3+l],L=p===3?1:2,F=Cu[i][s],$=l0[s],te=F*8*$,Q=Math.floor(F*g/S+c)*$;if(ko===null){const $e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ko=$e?parseInt($e[1]):0}return!!ko&&ko<=87&&s===2&&g>=224e3&&p===0&&(h[t+3]=h[t+3]|128),{sampleRate:S,channelCount:L,frameLength:Q,samplesPerFrame:te}}}function so(h,t){return h[t]===255&&(h[t+1]&224)===224&&(h[t+1]&6)!==0}function cl(h,t){return t+1<h.length&&so(h,t)}function Wl(h,t){return so(h,t)&&4<=h.length-t}function jl(h,t){if(t+1<h.length&&so(h,t)){const s=Vl(h,t);let o=4;s!=null&&s.frameLength&&(o=s.frameLength);const l=t+o;return l===h.length||cl(h,l)}return!1}class u0 extends no{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=es(t,0);let o=(s==null?void 0:s.length)||0;if(jl(t,o))return!1;for(let l=t.length;o<l;o++)if(xu(t,o))return i.log("ADTS sync word found !"),!0;return!1}canParse(t,i){return Il(t,i)}appendFrame(t,i,s){wu(t,this.observer,i,s,t.manifestCodec);const o=Bl(t,i,s,this.basePTS,this.frameIndex);if(o&&o.missing===0)return o}}const Du=(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 Mu extends no{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=ka(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=es(t,0);if(!i)return!1;const s=i.length;return t[s]===11&&t[s+1]===119&&ul(i)!==void 0&&Du(t,s)<16}}function ka(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 L=0;S===2?L+=2:(S&1&&S!==1&&(L+=2),S&4&&(L+=2));const F=(t[i+6]<<8|t[i+7])>>12-L&1,te=[2,1,2,3,3,4,4,5][S]+F,Q=t[i+5]>>3,Te=t[i+5]&7,Ve=new Uint8Array([l<<6|Q<<1|Te>>2,(Te&3)<<6|S<<3|F<<2|y>>4,y<<4&224]),$e=1536/p*9e4,ht=s+o*$e,mt=t.subarray(i,i+x);return h.config=Ve,h.channelCount=te,h.samplerate=p,h.samples.push({unit:mt,pts:ht}),x}class To extends no{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=es(t,0);let s=(i==null?void 0:i.length)||0;if(i&&t[s]===11&&t[s+1]===119&&ul(i)!==void 0&&Du(t,s)<=16)return!1;for(let o=t.length;s<o;s++)if(jl(t,s))return ve.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,i){return Wl(t,i)}appendFrame(t,i,s){if(this.basePTS!==null)return Gl(t,i,s,this.basePTS,this.frameIndex)}}const Lu=/\/emsg[-/]ID3/i;class Q0{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=Qs("video",1),c=this.audioTrack=Qs("audio",1),p=this.txtTrack=Qs("text",1);if(this.id3Track=Qs("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:L}=y.video;l.id=g,l.timescale=p.timescale=x,l.codec=S,l.supplemental=L}if(y.audio){const{id:g,timescale:x,codec:S}=y.audio;c.id=g,c.timescale=x,c.codec=S}p.id=Pt.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=wr(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:Qs(),id3Track:o,textTrack:Qs()}}extractID3Track(t,i){const s=this.id3Track;if(t.samples.length){const o=nt(t.samples,["emsg"]);o&&o.forEach(l=>{const c=tr(l);if(Lu.test(c.schemeIdUri)){const p=K(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:ke.emsg,duration:y})}else if(this.config.enableEmsgKLVMetadata&&c.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const p=K(c,i);s.samples.push({data:c.payload,len:c.payload.byteLength,dts:p,pts:p,type:ke.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 K(h,t){return pe(h.presentationTime)?h.presentationTime/h.timeScale:t+h.presentationTimeDelta/h.timeScale}class m{constructor(t,i,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new Vn(i,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,Gr.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 b{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,L=-1,F=0;for(l===-1&&(L=0,F=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,L>=0){const $={data:i.subarray(L,x),type:F};p.push($)}else{const $=this.getLastNalUnit(t.samples);$&&(c&&y<=4-c&&$.state&&($.data=$.data.subarray(0,$.data.byteLength-c)),x>0&&($.data=Fe($.data,i.subarray(0,x)),$.state=0))}y<o?(S=this.getNALuType(i,y),L=y,F=S,l=0):l=-1}else l=0}if(L>=0&&l>=0){const $={data:i.subarray(L,o),type:F,state:l};p.push($)}if(p.length===0){const $=this.getLastNalUnit(t.samples);$&&($.data=Fe($.data,i))}return t.naluState=l,p}}class _{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 w extends b{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 te=!1;p=!0;const Q=g.data;if(y&&Q.length>4){const Te=this.readSliceType(Q);(Te===2||Te===4||Te===7||Te===9)&&(te=!0)}if(te){var L;(L=c)!=null&&L.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=te;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 F,$;p=!0,y=!0;const te=g.data,Q=this.readSPS(te);if(!t.sps||t.width!==Q.width||t.height!==Q.height||((F=t.pixelRatio)==null?void 0:F[0])!==Q.pixelRatio[0]||(($=t.pixelRatio)==null?void 0:$[1])!==Q.pixelRatio[1]){t.width=Q.width,t.height=Q.height,t.pixelRatio=Q.pixelRatio,t.sps=[te];const Te=te.subarray(1,4);let Ve="avc1.";for(let $e=0;$e<3;$e++){let ht=Te[$e].toString(16);ht.length<2&&(ht="0"+ht),Ve+=ht}t.codec=Ve}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 _(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 _(t);let s=0,o=0,l=0,c=0,p,y,g;const x=i.readUByte.bind(i),S=i.readBits.bind(i),L=i.readUEG.bind(i),F=i.readBoolean.bind(i),$=i.skipBits.bind(i),te=i.skipEG.bind(i),Q=i.skipUEG.bind(i),Te=this.skipScalingList.bind(this);x();const Ve=x();if(S(5),$(3),x(),Q(),Ve===100||Ve===110||Ve===122||Ve===244||Ve===44||Ve===83||Ve===86||Ve===118||Ve===128){const Tt=L();if(Tt===3&&$(1),Q(),Q(),$(1),F())for(y=Tt!==3?8:12,g=0;g<y;g++)F()&&(g<6?Te(16,i):Te(64,i))}Q();const $e=L();if($e===0)L();else if($e===1)for($(1),te(),te(),p=L(),g=0;g<p;g++)te();Q(),$(1);const ht=L(),mt=L(),Ft=S(1);Ft===0&&$(1),$(1),F()&&(s=L(),o=L(),l=L(),c=L());let dt=[1,1];if(F()&&F())switch(x()){case 1:dt=[1,1];break;case 2:dt=[12,11];break;case 3:dt=[10,11];break;case 4:dt=[16,11];break;case 5:dt=[40,33];break;case 6:dt=[24,11];break;case 7:dt=[20,11];break;case 8:dt=[32,11];break;case 9:dt=[80,33];break;case 10:dt=[18,11];break;case 11:dt=[15,11];break;case 12:dt=[64,33];break;case 13:dt=[160,99];break;case 14:dt=[4,3];break;case 15:dt=[3,2];break;case 16:dt=[2,1];break;case 255:{dt=[x()<<8|x(),x()<<8|x()];break}}return{width:Math.ceil((ht+1)*16-s*2-o*2),height:(2-Ft)*(mt+1)*16-(Ft?2:4)*(l+c),pixelRatio:dt}}}class P extends b{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 L;(L=c)!=null&&L.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 F=this.readSPS(g.data);t.width=F.width,t.height=F.height,t.pixelRatio=F.pixelRatio,t.codec=F.codecString,t.sps=[],typeof t.params!="object"&&(t.params={});for(const $ in F.params)t.params[$]=F.params[$]}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 F=this.readPPS(g.data);for(const $ in F)t.params[$]=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 _(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 _(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(),L=i.readUByte(),F=i.readUByte(),$=i.readUByte(),te=i.readUByte(),Q=i.readUByte(),Te=i.readUByte(),Ve=[],$e=[];for(let yn=0;yn<s;yn++)Ve.push(i.readBoolean()),$e.push(i.readBoolean());if(s>0)for(let yn=s;yn<8;yn++)i.readBits(2);for(let yn=0;yn<s;yn++)Ve[yn]&&(i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte()),$e[yn]&&i.readUByte();i.readUEG();const ht=i.readUEG();ht==3&&i.skipBits(1);const mt=i.readUEG(),Ft=i.readUEG(),dt=i.readBoolean();let Tt=0,Ut=0,bt=0,fr=0;dt&&(Tt+=i.readUEG(),Ut+=i.readUEG(),bt+=i.readUEG(),fr+=i.readUEG());const vr=i.readUEG(),Ji=i.readUEG(),wi=i.readUEG(),di=i.readBoolean();for(let yn=di?0:s;yn<=s;yn++)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 Us=0;Us<4;Us++)for(let _a=0;_a<(Us===3?2:6);_a++)if(!i.readBoolean())i.readUEG();else{const xa=Math.min(64,1<<4+(Us<<1));Us>1&&i.readEG();for(let fo=0;fo<xa;fo++)i.readEG()}i.readBoolean(),i.readBoolean(),i.readBoolean()&&(i.readUByte(),i.skipUEG(),i.skipUEG(),i.readBoolean());const hi=i.readUEG();let pr=0;for(let yn=0;yn<hi;yn++){let Us=!1;if(yn!==0&&(Us=i.readBoolean()),Us){yn===hi&&i.readUEG(),i.readBoolean(),i.readUEG();let _a=0;for(let Da=0;Da<=pr;Da++){const xa=i.readBoolean();let fo=!1;xa||(fo=i.readBoolean()),(xa||fo)&&_a++}pr=_a}else{const _a=i.readUEG(),Da=i.readUEG();pr=_a+Da;for(let xa=0;xa<_a;xa++)i.readUEG(),i.readBoolean();for(let xa=0;xa<Da;xa++)i.readUEG(),i.readBoolean()}}if(i.readBoolean()){const yn=i.readUEG();for(let Us=0;Us<yn;Us++){for(let _a=0;_a<wi+4;_a++)i.readBits(1);i.readBits(1)}}let xi=0,ki=1,qi=1,en=!0,mn=1,tn=0;i.readBoolean(),i.readBoolean();let qs=!1;if(i.readBoolean()){if(i.readBoolean()){const Ma=i.readUByte(),wc=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],po=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Ma>0&&Ma<16?(ki=wc[Ma-1],qi=po[Ma-1]):Ma===255&&(ki=i.readBits(16),qi=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(),qs=i.readBoolean(),qs&&(Tt+=i.readUEG(),Ut+=i.readUEG(),bt+=i.readUEG(),fr+=i.readUEG()),i.readBoolean()&&(mn=i.readBits(32),tn=i.readBits(32),i.readBoolean()&&i.readUEG(),i.readBoolean())){const po=i.readBoolean(),Gu=i.readBoolean();let Cl=!1;(po||Gu)&&(Cl=i.readBoolean(),Cl&&(i.readUByte(),i.readBits(5),i.readBoolean(),i.readBits(5)),i.readBits(4),i.readBits(4),Cl&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5));for(let Sh=0;Sh<=s;Sh++){en=i.readBoolean();const Od=en||i.readBoolean();let N0=!1;Od?i.readEG():N0=i.readBoolean();const Vu=N0?1:i.readUEG()+1;if(po)for(let qa=0;qa<Vu;qa++)i.readUEG(),i.readUEG(),Cl&&(i.readUEG(),i.readUEG()),i.skipBits(1);if(Gu)for(let qa=0;qa<Vu;qa++)i.readUEG(),i.readUEG(),Cl&&(i.readUEG(),i.readUEG()),i.skipBits(1)}}i.readBoolean()&&(i.readBoolean(),i.readBoolean(),i.readBoolean(),xi=i.readUEG())}let ho=mt,_h=Ft;if(dt||qs){let yn=1,Us=1;ht===1?yn=Us=2:ht==2&&(yn=2),ho=mt-yn*Ut-yn*Tt,_h=Ft-Us*fr-Us*bt}const Pd=o?["A","B","C"][o]:"",xh=p<<24|y<<16|g<<8|x;let _c=0;for(let yn=0;yn<32;yn++)_c=(_c|(xh>>yn&1)<<31-yn)>>>0;let xc=_c.toString(16);return c===1&&xc==="2"&&(xc="6"),{codecString:`hvc1.${Pd}${c}.${xc}.${l?"H":"L"}${Te}.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,L,F,$,te,Q],general_level_idc:Te,bit_depth:vr+8,bit_depth_luma_minus8:vr,bit_depth_chroma_minus8:Ji,min_spatial_segmentation_idc:xi,chroma_format_idc:ht,frame_rate:{fixed:en,fps:tn/mn}},width:ho,height:_h,pixelRatio:[ki,qi]}}readPPS(t){const i=new _(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 U=188;class oe{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=oe.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(U*5,i-U)+1,o=0;for(;o<s;){let l=!1,c=-1,p=0;for(let y=o;y<i;y+=U)if(t[y]===71&&(i-y===U||t[y+U]===71)){if(p++,c===-1&&(c=y,c!==0&&(s=Math.min(c+U*99,t.length-U)+1)),l||(l=we(t,y)===0),l&&p>1&&(c===0&&p>2||y+U>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:Pt[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=oe.createTrack("video"),this._videoTrack.duration=o,this._audioTrack=oe.createTrack("audio",o),this._id3Track=oe.createTrack("id3"),this._txtTrack=oe.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,L=p.pid,F=y.pid,$=p.pesData,te=y.pesData,Q=null,Te=this.pmtParsed,Ve=this._pmtId,$e=t.length;if(this.remainderData&&(t=Fe(this.remainderData,t),$e=t.length,this.remainderData=null),$e<U&&!o)return this.remainderData=t,{audioTrack:p,videoTrack:c,id3Track:y,textTrack:g};const ht=Math.max(0,oe.syncOffset(t));$e-=($e-ht)%U,$e<t.byteLength&&!o&&(this.remainderData=new Uint8Array(t.buffer,$e,t.buffer.byteLength-$e));let mt=0;for(let dt=ht;dt<$e;dt+=U)if(t[dt]===71){const Tt=!!(t[dt+1]&64),Ut=we(t,dt),bt=(t[dt+3]&48)>>4;let fr;if(bt>1){if(fr=dt+5+t[dt+4],fr===dt+U)continue}else fr=dt+4;switch(Ut){case x:if(Tt){if(S&&(l=Yt(S,this.logger))){if(this.videoParser===null)switch(c.segmentCodec){case"avc":this.videoParser=new w;break;case"hevc":this.videoParser=new P;break}this.videoParser!==null&&this.videoParser.parsePES(c,g,l,!1)}S={data:[],size:0}}S&&(S.data.push(t.subarray(fr,dt+U)),S.size+=dt+U-fr);break;case L:if(Tt){if($&&(l=Yt($,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}$={data:[],size:0}}$&&($.data.push(t.subarray(fr,dt+U)),$.size+=dt+U-fr);break;case F:Tt&&(te&&(l=Yt(te,this.logger))&&this.parseID3PES(y,l),te={data:[],size:0}),te&&(te.data.push(t.subarray(fr,dt+U)),te.size+=dt+U-fr);break;case 0:Tt&&(fr+=t[fr]+1),Ve=this._pmtId=Be(t,fr);break;case Ve:{Tt&&(fr+=t[fr]+1);const vr=at(t,fr,this.typeSupported,s,this.observer,this.logger);x=vr.videoPid,x>0&&(c.pid=x,c.segmentCodec=vr.segmentVideoCodec),L=vr.audioPid,L>0&&(p.pid=L,p.segmentCodec=vr.segmentAudioCodec),F=vr.id3Pid,F>0&&(y.pid=F),Q!==null&&!Te&&(this.logger.warn(`MPEG-TS PMT found at ${dt} after unknown PID '${Q}'. Backtracking to sync byte @${ht} to parse all TS packets.`),Q=null,dt=ht-188),Te=this.pmtParsed=!0;break}case 17:case 8191:break;default:Q=Ut;break}}else mt++;mt>0&&yt(this.observer,new Error(`Found ${mt} TS packet/s that do not start with 0x47`),void 0,this.logger),c.pesData=S,p.pesData=$,y.pesData=te;const Ft={audioTrack:p,videoTrack:c,id3Track:y,textTrack:g};return o&&this.extractRemainingSamples(Ft),Ft}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=Yt(c,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new w;break;case"hevc":this.videoParser=new P;break}this.videoParser!==null&&(this.videoParser.parsePES(s,l,g,!0),s.pesData=null)}else s.pesData=c;if(p&&(g=Yt(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=Yt(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 m(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,L=o.sample.unit.byteLength;if(S===-1)l=Fe(o.sample.unit,l);else{const F=L-S;o.sample.unit.set(l.subarray(0,S),F),t.samples.push(o.sample),s=o.missing}}let c,p;for(c=s,p=l.length;c<p-1&&!nl(l,c);c++);if(c!==s){let S;const L=c<p-1;if(L?S=`AAC PES did not start with ADTS header,offset:${c}`:S="No ADTS header found in AAC PES",yt(this.observer,new Error(S),L,this.logger),!L)return}wu(t,this.observer,l,c,this.audioCodec);let y;if(i.pts!==void 0)y=i.pts;else if(o){const S=Pl(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=Bl(t,l,c,y,g),c+=x.length,x.missing){this.aacOverFlow=x;break}else for(g++;c<p-1&&!nl(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(cl(s,c)){const y=Gl(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=ka(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?ke.emsg:ke.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(s)}}function we(h,t){return((h[t+1]&31)<<8)+h[t+2]}function Be(h,t){return(h[t+10]&31)<<8|h[t+11]}function at(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=we(h,t),S=(h[t+3]&15)<<8|h[t+4];switch(h[t]){case 207:if(!s){Ot("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){Ot("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){Ot("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 L=t+5,F=S;for(;F>2;){switch(h[L]){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 te=h[L+1]+2;L+=te,F-=te}}break;case 194:case 135:return yt(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 yt(h,t,i,s){s.warn(`parsing error: ${t.message}`),h.emit(E.ERROR,E.ERROR,{type:Me.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:t,reason:t.message})}function Ot(h,t){t.log(`${h} with AES-128-CBC encryption found in unencrypted stream`)}function Yt(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 L=new Uint8Array(h.size);for(let F=0,$=y.length;F<$;F++){s=y[F];let te=s.byteLength;if(S)if(S>te){S-=te;continue}else s=s.subarray(S),te-=S,S=0;L.set(s,i),i+=te}return o&&(o-=l+3),{data:L,pts:c,dts:p,len:o}}return null}class cr{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 xr=Math.pow(2,32)-1;class qe{static init(){qe.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 qe.types)qe.types.hasOwnProperty(t)&&(qe.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]);qe.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]);qe.STTS=qe.STSC=qe.STCO=l,qe.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),qe.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),qe.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),qe.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]);qe.FTYP=qe.box(qe.types.ftyp,c,y,c,p),qe.DINF=qe.box(qe.types.dinf,qe.box(qe.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 qe.box(qe.types.hdlr,qe.HDLR_TYPES[t])}static mdat(t){return qe.box(qe.types.mdat,t)}static mdhd(t,i){i*=t;const s=Math.floor(i/(xr+1)),o=Math.floor(i%(xr+1));return qe.box(qe.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 qe.box(qe.types.mdia,qe.mdhd(t.timescale||0,t.duration||0),qe.hdlr(t.type),qe.minf(t))}static mfhd(t){return qe.box(qe.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"?qe.box(qe.types.minf,qe.box(qe.types.smhd,qe.SMHD),qe.DINF,qe.stbl(t)):qe.box(qe.types.minf,qe.box(qe.types.vmhd,qe.VMHD),qe.DINF,qe.stbl(t))}static moof(t,i,s){return qe.box(qe.types.moof,qe.mfhd(t),qe.traf(s,i))}static moov(t){let i=t.length;const s=[];for(;i--;)s[i]=qe.trak(t[i]);return qe.box.apply(null,[qe.types.moov,qe.mvhd(t[0].timescale||0,t[0].duration||0)].concat(s).concat(qe.mvex(t)))}static mvex(t){let i=t.length;const s=[];for(;i--;)s[i]=qe.trex(t[i]);return qe.box.apply(null,[qe.types.mvex,...s])}static mvhd(t,i){i*=t;const s=Math.floor(i/(xr+1)),o=Math.floor(i%(xr+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 qe.box(qe.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 qe.box(qe.types.sdtp,s)}static stbl(t){return qe.box(qe.types.stbl,qe.stsd(t),qe.box(qe.types.stts,qe.STTS),qe.box(qe.types.stsc,qe.STSC),qe.box(qe.types.stsz,qe.STSZ),qe.box(qe.types.stco,qe.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=qe.box(qe.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 qe.box(qe.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,qe.box(qe.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),qe.box(qe.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 qe.box(qe.types.mp4a,qe.audioStsd(t),qe.box(qe.types.esds,qe.esds(t)))}static mp3(t){return qe.box(qe.types[".mp3"],qe.audioStsd(t))}static ac3(t){return qe.box(qe.types["ac-3"],qe.audioStsd(t),qe.box(qe.types.dac3,t.config))}static stsd(t){const{segmentCodec:i}=t;if(t.type==="audio"){if(i==="aac")return qe.box(qe.types.stsd,qe.STSD,qe.mp4a(t));if(i==="ac3"&&t.config)return qe.box(qe.types.stsd,qe.STSD,qe.ac3(t));if(i==="mp3"&&t.codec==="mp3")return qe.box(qe.types.stsd,qe.STSD,qe.mp3(t))}else if(t.pps&&t.sps){if(i==="avc")return qe.box(qe.types.stsd,qe.STSD,qe.avc1(t));if(i==="hevc"&&t.vps)return qe.box(qe.types.stsd,qe.STSD,qe.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/(xr+1)),p=Math.floor(s%(xr+1));return qe.box(qe.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=qe.sdtp(t),o=t.id,l=Math.floor(i/(xr+1)),c=Math.floor(i%(xr+1));return qe.box(qe.types.traf,qe.box(qe.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),qe.box(qe.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])),qe.trun(t,s.length+16+20+8+16+8+8),s)}static trak(t){return t.duration=t.duration||4294967295,qe.box(qe.types.trak,qe.tkhd(t),qe.mdia(t))}static trex(t){const i=t.id;return qe.box(qe.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,L;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,L=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,L>>>24&255,L>>>16&255,L>>>8&255,L&255],12+16*p);return qe.box(qe.types.trun,c)}static initSegment(t){qe.types||qe.init();const i=qe.moov(t);return Fe(qe.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 $=0;$<s.length;$+=1){c+=3;for(let te=0;te<s[$].length;te+=1)c+=2+s[$][te].length}const p=new Uint8Array(c);p.set(l,0),c=l.length;const y=s.length-1;for(let $=0;$<s.length;$+=1){p.set(new Uint8Array([32+$|($===y?128:0),0,s[$].length]),c),c+=3;for(let te=0;te<s[$].length;te+=1)p.set(new Uint8Array([s[$][te].length>>8,s[$][te].length&255]),c),c+=2,p.set(s[$][te],c),c+=s[$][te].length}const g=qe.box(qe.types.hvcC,p),x=t.width,S=t.height,L=t.pixelRatio[0],F=t.pixelRatio[1];return qe.box(qe.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,qe.box(qe.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),qe.box(qe.types.pasp,new Uint8Array([L>>24,L>>16&255,L>>8&255,L&255,F>>24,F>>16&255,F>>8&255,F&255])))}}qe.types=void 0,qe.HDLR_TYPES=void 0,qe.STTS=void 0,qe.STSC=void 0,qe.STCO=void 0,qe.STSZ=void 0,qe.VMHD=void 0,qe.SMHD=void 0,qe.STSD=void 0,qe.FTYP=void 0,qe.DINF=void 0;const Ti=9e4;function Mi(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 Mi(h,t,1/i,s)}function an(h,t=!1){return Mi(h,1e3,1/Ti,t)}function fn(h,t=1){return Mi(h,Ti,1/t)}const Cn=10*1e3,Dn=1024,Zn=1152,ms=1536;let Fn=null,pn=null;function $s(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 ea{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,Fn===null){const c=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Fn=c?parseInt(c[1]):0}if(pn===null){const l=navigator.userAgent.match(/Safari\/(\d+)/i);pn=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=Yn(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,L,F,$,te=l,Q=l;const Te=t.pid>-1,Ve=i.pid>-1,$e=i.samples.length,ht=t.samples.length>0,mt=p&&$e>0||$e>1;if((!Te||ht)&&(!Ve||mt)||this.ISGenerated||p){if(this.ISGenerated){var dt,Tt,Ut,bt;const wi=this.videoTrackConfig;(wi&&(i.width!==wi.width||i.height!==wi.height||((dt=i.pixelRatio)==null?void 0:dt[0])!==((Tt=wi.pixelRatio)==null?void 0:Tt[0])||((Ut=i.pixelRatio)==null?void 0:Ut[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 fr=this.isVideoContiguous;let vr=-1,Ji;if(mt&&(vr=ds(i.samples),!fr&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,vr>0){this.logger.warn(`[mp4-remuxer]: Dropped ${vr} out of ${$e} video samples due to a missing keyframe`);const wi=this.getVideoStartPts(i.samples);i.samples=i.samples.slice(vr),i.dropped+=vr,Q+=(i.samples[0].pts-wi)/i.inputTimeScale,Ji=Q}else vr===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${$e} video samples`),$=!1);if(this.ISGenerated){if(ht&&mt){const wi=this.getVideoStartPts(i.samples),Zr=(Yn(t.samples[0].pts,wi)-wi)/i.inputTimeScale;te+=Math.max(0,Zr),Q+=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,te,this.isAudioContiguous,c,Ve||mt||y===N.AUDIO?Q: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,Q,fr,wi)}}else mt&&(g=this.remuxVideo(i,Q,fr,0));g&&(g.firstKeyFrame=vr,g.independent=vr!==-1,g.firstKeyFramePTS=Ji)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(F=Mr(s,l,this._initPTS,this._initDTS)),o.samples.length&&(L=as(o,l,this._initPTS))),{audio:x,video:g,initSegment:S,independent:$,text:L,id3:F}}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",L,F,$;if(x&&(L=F=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):qe.initSegment([t]),metadata:{channelCount:t.channelCount}},x&&($=t.inputTimeScale,!g||$!==g.timescale?L=F=l[0].pts-Math.round($*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:qe.initSegment([i]),metadata:{width:i.width,height:i.height}},x)if($=i.inputTimeScale,!g||$!==g.timescale){const te=this.getVideoStartPts(c),Q=Math.round($*s);F=Math.min(F,Yn(c[0].dts,te)-Q),L=Math.min(L,te-Q)}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:L,timescale:$},this._initDTS={baseTime:F,timescale:$}):L=$=void 0,{tracks:y,initPTS:L,timescale:$}}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,L=this.videoSampleDuration,F,$,te=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,Te=!1;if(!s||x===null){const pr=i*l,_r=c[0].pts-Yn(c[0].dts,c[0].pts);Fn&&x!==null&&Math.abs(pr-_r-x)<15e3?s=!0:x=pr-_r}const Ve=g.baseTime*l/g.timescale;for(let pr=0;pr<y;pr++){const _r=c[pr];_r.pts=Yn(_r.pts-Ve,x),_r.dts=Yn(_r.dts-Ve,x),_r.dts<c[pr>0?pr-1:pr].dts&&(Te=!0)}Te&&c.sort(function(pr,_r){const xi=pr.dts-_r.dts,ki=pr.pts-_r.pts;return xi||ki}),F=c[0].dts,$=c[c.length-1].dts;const $e=$-F,ht=$e?Math.round($e/(y-1)):L||t.inputTimeScale/30;if(s){const pr=F-x,_r=pr>ht,xi=pr<-1;if((_r||xi)&&(_r?this.logger.warn(`${(t.segmentCodec||"").toUpperCase()}: ${an(pr,!0)} ms (${pr}dts) hole between fragments detected at ${i.toFixed(3)}`):this.logger.warn(`${(t.segmentCodec||"").toUpperCase()}: ${an(-pr,!0)} ms (${pr}dts) overlapping between fragments detected at ${i.toFixed(3)}`),!xi||x>=c[0].pts||Fn)){F=x;const ki=c[0].pts-pr;if(_r)c[0].dts=F,c[0].pts=ki;else{let qi=!0;for(let en=0;en<c.length&&!(c[en].dts>ki&&qi);en++){const mn=c[en].pts;if(c[en].dts-=pr,c[en].pts-=pr,en<c.length-1){const tn=c[en+1].pts,qs=c[en].pts,ks=tn<=qs,ho=tn<=mn;qi=ks==ho}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${an(ki,!0)}/${an(F,!0)}, delta: ${an(pr,!0)} ms`)}}F=Math.max(0,F);let mt=0,Ft=0,dt=F;for(let pr=0;pr<y;pr++){const _r=c[pr],xi=_r.units,ki=xi.length;let qi=0;for(let en=0;en<ki;en++)qi+=xi[en].data.length;Ft+=qi,mt+=ki,_r.length=qi,_r.dts<dt?(_r.dts=dt,dt+=ht/4|0||1):dt=_r.dts,te=Math.min(_r.pts,te),Q=Math.max(_r.pts,Q)}$=c[y-1].dts;const Tt=Ft+4*mt+8;let Ut;try{Ut=new Uint8Array(Tt)}catch(pr){this.observer.emit(E.ERROR,E.ERROR,{type:Me.MUX_ERROR,details:re.REMUX_ALLOC_ERROR,fatal:!1,error:pr,bytes:Tt,reason:`fail allocating video mdat ${Tt}`});return}const bt=new DataView(Ut.buffer);bt.setUint32(0,Tt),Ut.set(qe.types.mdat,4);let fr=!1,vr=Number.POSITIVE_INFINITY,Ji=Number.POSITIVE_INFINITY,wi=Number.NEGATIVE_INFINITY,di=Number.NEGATIVE_INFINITY;for(let pr=0;pr<y;pr++){const _r=c[pr],xi=_r.units;let ki=0;for(let mn=0,tn=xi.length;mn<tn;mn++){const qs=xi[mn],ks=qs.data,ho=qs.data.byteLength;bt.setUint32(S,ho),S+=4,Ut.set(ks,S),S+=ho,ki+=4+ho}let qi;if(pr<y-1)L=c[pr+1].dts-_r.dts,qi=c[pr+1].pts-_r.pts;else{const mn=this.config,tn=pr>0?_r.dts-c[pr-1].dts:ht;if(qi=pr>0?_r.pts-c[pr-1].pts:ht,mn.stretchShortVideoTrack&&this.nextAudioPts!==null){const qs=Math.floor(mn.maxBufferHole*l),ks=(o?te+o*l:this.nextAudioPts)-_r.pts;ks>qs?(L=ks-tn,L<0?L=tn:fr=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${ks/90} ms to the next segment; using duration ${L/90} ms for the last video frame.`)):L=tn}else L=tn}const en=Math.round(_r.pts-_r.dts);vr=Math.min(vr,L),wi=Math.max(wi,L),Ji=Math.min(Ji,qi),di=Math.max(di,qi),p.push($s(_r.key,L,ki,en))}if(p.length){if(Fn){if(Fn<70){const pr=p[0].flags;pr.dependsOn=2,pr.isNonSync=0}}else if(pn&&di-Ji<wi-vr&&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 pr=F;for(let _r=0,xi=p.length;_r<xi;_r++){const ki=pr+p[_r].duration,qi=pr+p[_r].cts;if(_r<xi-1){const en=ki+p[_r+1].cts;p[_r].duration=en-qi}else p[_r].duration=_r?p[_r-1].duration:ht;p[_r].cts=0,pr=ki}}}L=fr||!L?ht:L,this.nextAvcDts=x=$+L,this.videoSampleDuration=L,this.isVideoContiguous=!0;const hi={data1:qe.moof(t.sequenceNumber++,F,k(t,{samples:p})),data2:Ut,startPTS:te/l,endPTS:(Q+L)/l,startDTS:F/l,endDTS:x/l,type:"video",hasAudio:!1,hasVideo:!0,nb:p.length,dropped:t.dropped};return t.samples=[],t.dropped=0,hi}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return Zn;case"ac3":return ms;default:return Dn}}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,L=t.segmentCodec==="mp3"&&this.typeSupported.mpeg,F=[],$=l!==void 0;let te=t.samples,Q=L?0:8,Te=this.nextAudioPts||-1;const Ve=i*c,$e=S.baseTime*c/S.timescale;if(this.isAudioContiguous=s=s||te.length&&Te>0&&(o&&Math.abs(Ve-Te)<9e3||Math.abs(Yn(te[0].pts-$e,Ve)-Te)<20*x),te.forEach(function(Zr){Zr.pts=Yn(Zr.pts-$e,Ve)}),!s||Te<0){if(te=te.filter(Zr=>Zr.pts>=0),!te.length)return;l===0?Te=0:o&&!$?Te=Math.max(0,Ve):Te=te[0].pts}if(t.segmentCodec==="aac"){const Zr=this.config.maxAudioFramesDrift;for(let ai=0,hi=Te;ai<te.length;ai++){const pr=te[ai],_r=pr.pts,xi=_r-hi,ki=Math.abs(1e3*xi/c);if(xi<=-Zr*x&&$)ai===0&&(this.logger.warn(`Audio frame @ ${(_r/c).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*xi/c)} ms.`),this.nextAudioPts=Te=hi=_r);else if(xi>=Zr*x&&ki<Cn&&$){let qi=Math.round(xi/x);hi=_r-qi*x,hi<0&&(qi--,hi+=x),ai===0&&(this.nextAudioPts=Te=hi),this.logger.warn(`[mp4-remuxer]: Injecting ${qi} audio frame @ ${(hi/c).toFixed(3)}s due to ${Math.round(1e3*xi/c)} ms gap.`);for(let en=0;en<qi;en++){const mn=Math.max(hi,0);let tn=cr.getSilentFrame(t.parsedCodec||t.manifestCodec||t.codec,t.channelCount);tn||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),tn=pr.unit.subarray()),te.splice(ai,0,{unit:tn,pts:mn}),hi+=x,ai++}}pr.pts=hi,hi+=x}}let ht=null,mt=null,Ft,dt=0,Tt=te.length;for(;Tt--;)dt+=te[Tt].unit.byteLength;for(let Zr=0,ai=te.length;Zr<ai;Zr++){const hi=te[Zr],pr=hi.unit;let _r=hi.pts;if(mt!==null){const ki=F[Zr-1];ki.duration=Math.round((_r-mt)/y)}else if(s&&t.segmentCodec==="aac"&&(_r=Te),ht=_r,dt>0){dt+=Q;try{Ft=new Uint8Array(dt)}catch(ki){this.observer.emit(E.ERROR,E.ERROR,{type:Me.MUX_ERROR,details:re.REMUX_ALLOC_ERROR,fatal:!1,error:ki,bytes:dt,reason:`fail allocating audio mdat ${dt}`});return}L||(new DataView(Ft.buffer).setUint32(0,dt),Ft.set(qe.types.mdat,4))}else return;Ft.set(pr,Q);const xi=pr.byteLength;Q+=xi,F.push($s(!0,g,xi,0)),mt=_r}const Ut=F.length;if(!Ut)return;const bt=F[F.length-1];this.nextAudioPts=Te=mt+y*bt.duration;const fr=L?new Uint8Array(0):qe.moof(t.sequenceNumber++,ht/y,k({},t,{samples:F}));t.samples=[];const vr=ht/c,Ji=Te/c,di={data1:fr,data2:Ft,startPTS:vr,endPTS:Ji,startDTS:vr,endDTS:Ji,type:"audio",hasAudio:!0,hasVideo:!1,nb:Ut};return this.isAudioContiguous=!0,di}}function Yn(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 ds(h){for(let t=0;t<h.length;t++)if(h[t].key)return t;return-1}function Mr(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=Yn(y.pts-i.baseTime*l/i.timescale,t*l)/l,y.dts=Yn(y.dts-s.baseTime*l/s.timescale,t*l)/l}const c=h.samples;return h.samples=[],{samples:c}}function as(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=Yn(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 Ru{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=is(o.audio,M.AUDIO)),o.video&&(s=is(o.video,M.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 L=i.samples;if(!(L!=null&&L.length))return S;const F={initPTS:void 0,timescale:1};let $=this.initData;if((p=$)!=null&&p.length||(this.generateInitSegment(L),$=this.initData),!((y=$)!=null&&y.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(F.tracks=this.initTracks,this.emitInitSegment=!1);const te=Jt(L,$),Q=dr($,L),Te=Q===null?l:Q;(c||!g)&&(c0(g,Te,l,te)||F.timescale!==g.timescale)&&(F.initPTS=Te-l,g&&g.timescale===1&&this.logger.warn(`Adjusting initPTS @${l} from ${g.baseTime/g.timescale} to ${F.initPTS}`),this.initPTS=g={baseTime:F.initPTS,timescale:1});const Ve=t?Te-g.baseTime/g.timescale:x,$e=Ve+te;Kt($,L,g.baseTime/g.timescale),te>0?this.lastEndTime=$e:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const ht=!!$.audio,mt=!!$.video;let Ft="";ht&&(Ft+="audio"),mt&&(Ft+="video");const dt={data1:L,startPTS:Ve,startDTS:Ve,endPTS:$e,endDTS:$e,type:Ft,hasAudio:ht,hasVideo:mt,nb:1,dropped:0};return S.audio=dt.type==="audio"?dt:void 0,S.video=dt.type!=="audio"?dt:void 0,S.initSegment=F,S.id3=Mr(s,l,g,g),o.samples.length&&(S.text=as(o,l,g)),S}}function c0(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 is(h,t){const i=h==null?void 0:h.codec;return i&&i.length>4?i:t===M.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 gs;try{gs=self.performance.now.bind(self.performance)}catch(h){gs=Date.now}const ma=[{demux:Q0,remux:Ru},{demux:oe,remux:ea},{demux:u0,remux:ea},{demux:To,remux:ea}];ma.splice(2,0,{demux:Mu,remux:ea});class hl{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=gs();let c=new Uint8Array(t);const{currentTransmuxState:p,transmuxConfig:y}=this;o&&(this.currentTransmuxState=o);const{contiguous:g,discontinuity:x,trackSwitch:S,accurateTimeOffset:L,timeOffset:F,initSegmentChange:$}=o||p,{audioCodec:te,videoCodec:Q,defaultInitPts:Te,duration:Ve,initSegmentData:$e}=y,ht=ql(c,i);if(ht&&hn(ht.method)){const Tt=this.getDecrypter(),Ut=dn(ht.method);if(Tt.isSync()){let bt=Tt.softwareDecrypt(c,ht.key.buffer,ht.iv.buffer,Ut);if(s.part>-1){const vr=Tt.flush();bt=vr&&vr.buffer}if(!bt)return l.executeEnd=gs(),Ga(s);c=new Uint8Array(bt)}else return this.asyncResult=!0,this.decryptionPromise=Tt.webCryptoDecrypt(c,ht.key.buffer,ht.iv.buffer,Ut).then(bt=>{const fr=this.push(bt,null,s);return this.decryptionPromise=null,fr}),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:Me.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,fatal:!1,error:Tt,reason:Tt.message}),l.executeEnd=gs(),Ga(s)}(x||S||$||mt)&&this.resetInitSegment($e,te,Q,Ve,i),(x||$||mt)&&this.resetInitialTimestamp(Te),g||this.resetContiguity();const Ft=this.transmux(c,ht,F,L,s);this.asyncResult=Bs(Ft);const dt=this.currentTransmuxState;return dt.contiguous=!0,dt.discontinuity=!1,dt.trackSwitch=!1,l.executeEnd=gs(),Ft}flush(t){const i=t.transmuxing;i.executeStart=gs();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=gs();const S=[Ga(t)];return this.asyncResult?Promise.resolve(S):S}const x=y.flush(p);return Bs(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===N.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=gs()}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,L=ma.length;S<L;S++){var c;if((c=ma[S].demux)!=null&&c.probe(t,this.logger)){l=ma[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 Vn(this.config)),t}}function ql(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 Ga=h=>({remuxResult:{},chunkMeta:h});function Bs(h){return"then"in h&&h.then instanceof Function}class ec{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 ga{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 Zl=0;class dl{constructor(t,i,s,o){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Zl++,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 L=(S=this.workerContext)==null?void 0:S.objectURL;L&&self.URL.revokeObjectURL(L);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:Me.OTHER_ERROR,details:re.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 el,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||vu()){try{l.workerPath?(y.log(`loading Web Worker ${l.workerPath} for "${i}"`),this.workerContext=yu(l.workerPath)):(y.log(`injecting Web Worker for "${i}"`),this.workerContext=Eo());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:Kr(l)})}catch(x){y.warn(`Error setting up "${i}" Web Worker, fallback to inline`,x),this.terminateWorker(),this.error=null,this.transmuxer=new hl(this.observer,p,l,"",i,t.logger)}return}}this.transmuxer=new hl(this.observer,p,l,"",i,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=Zl++;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:Kr(i)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),i0(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,L;g.transmuxing.start=self.performance.now();const{instanceNo:F,transmuxer:$}=this,te=c?c.start:l.start,Q=l.decryptdata,Te=this.frag,Ve=!(Te&&l.cc===Te.cc),$e=!(Te&&g.level===Te.level),ht=Te?g.sn-Te.sn:-1,mt=this.part?g.part-this.part.index:-1,Ft=ht===0&&g.id>1&&g.id===(Te==null?void 0:Te.stats.chunkCount),dt=!$e&&(ht===1||ht===0&&(mt===1||Ft&&mt<=0)),Tt=self.performance.now();($e||ht||l.stats.parsing.start===0)&&(l.stats.parsing.start=Tt),c&&(mt||!dt)&&(c.stats.parsing.start=Tt);const Ut=!(Te&&((S=l.initSegment)==null?void 0:S.url)===((L=Te.initSegment)==null?void 0:L.url)),bt=new ga(Ve,dt,y,$e,te,Ut);if(!dt||Ve||Ut){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${l.type} sn: ${g.sn}${g.part>-1?" part: "+g.part:""} ${this.id===N.MAIN?"level":"track"}: ${g.level} id: ${g.id}
discontinuity: ${Ve}
trackSwitch: ${$e}
contiguous: ${dt}
accurateTimeOffset: ${y}
timeOffset: ${te}
initSegmentChange: ${Ut}`);const fr=new ec(s,o,i,p,x);this.configureTransmuxer(fr)}if(this.frag=l,this.part=c,this.workerContext)this.workerContext.worker.postMessage({instanceNo:F,cmd:"demux",data:t,decryptdata:Q,chunkMeta:g,state:bt},t instanceof ArrayBuffer?[t]:[]);else if($){const fr=$.push(t,Q,g,bt);Bs(fr)?fr.then(vr=>{this.handleTransmuxComplete(vr)}).catch(vr=>{this.transmuxerError(vr,g,"transmuxer-interface push error")}):this.handleTransmuxComplete(fr)}}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);Bs(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:Me.MEDIA_ERROR,details:re.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 fl=100;class pl extends ro{constructor(t,i,s){super(t,i,s,"audio-stream-controller",N.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===N.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===Vt.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===Vt.IDLE&&this.tick()}}findSyncFrag(t){const i=this.getLevelDetails(),s=t.cc;return ti(i,s,t)||i&&Xr(i.fragments,s)||t}startLoad(t,i){if(!this.levels){this.startPosition=t,this.state=Vt.STOPPED;return}const s=this.lastCurrentTime;this.stopLoad(),this.setInterval(fl),s>0&&t===-1?(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),t=s,this.state=Vt.IDLE):this.state=Vt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}doTick(){switch(this.state){case Vt.IDLE:this.doTickIdle();break;case Vt.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=Vt.WAITING_INIT_PTS}break}case Vt.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=Vt.IDLE}break}case Vt.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=Vt.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=Vt.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!==Vt.STOPPED&&(this.state=Vt.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=Vt.WAITING_TRACK,this.startFragRequested=!1;return}const g=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&g&&(this.bufferFlushed=!1,this.afterBufferFlushed(g,M.AUDIO,N.AUDIO));const x=this.getFwdBufferInfo(g,N.AUDIO);if(x===null)return;if(!this.switchingTrack&&this._streamEnded(x,y)){i.trigger(E.BUFFER_EOS,{type:"audio"}),this.state=Vt.ENDED;return}const S=x.len,L=i.maxBufferLength,F=y.fragments,$=F[0].start,te=this.getLoadPosition(),Q=this.flushing?te:x.end;if(this.switchingTrack&&o){const $e=te;y.PTSKnown&&$e<$&&(x.end>$||x.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=$+.05)}if(S>=L&&!this.switchingTrack&&Q<F[F.length-1].start)return;let Te=this.getNextFragment(Q,y);if(Te&&this.isLoopLoading(Te,Q)&&(Te=this.getNextFragmentLoopLoading(Te,y,x,N.MAIN,L)),!Te){this.bufferFlushed=!0;return}let Ve=((t=this.mainFragLoading)==null?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&Ve&&be(Te)&&!Te.endList&&(!y.live||!this.loadingParts&&Q<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(Ve)===qr.OK&&(this.mainFragLoading=Ve=null),Ve&&be(Ve))){if(Te.start>Ve.end){const ht=this.fragmentTracker.getFragAtPos(Q,N.MAIN);ht&&ht.end>Ve.end&&(Ve=ht,this.mainFragLoading={frag:ht,targetBufferTime:null})}if(Te.start>Ve.end)return}this.loadFragment(Te,p,Q)}onMediaDetaching(t,i){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,i)}onAudioTracksUpdated(t,{audioTracks:i}){this.resetTransmuxer(),this.levels=i.map(s=>new Fr(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!==Vt.STOPPED&&(this.setInterval(fl),this.state=Vt.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!==Vt.STOPPED&&(this.state=Vt.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 L;S=this.alignPlaylists(l,x.details,(L=this.levelLastLoaded)==null?void 0:L.details)}l.alignedSliding||(Es(l,g),l.alignedSliding||En(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===Vt.WAITING_TRACK&&!this.waitForCdnTuneIn(l)&&(this.state=Vt.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 L=this.transmuxer;L||(L=this.transmuxer=new dl(this.hls,N.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const F=this.initPTS[s.cc],$=(i=s.initSegment)==null?void 0:i.data;if(F!==void 0){const Q=o?o.index:-1,Te=Q!==-1,Ve=new On(s.level,s.sn,s.stats.chunkCount,l.byteLength,Q,Te);L.push(l,$,S,"",s,o,x.totalduration,!1,Ve,F)}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:te}=this.waitingData=this.waitingData||{frag:s,part:o,cache:new io,complete:!1};te.push(new Uint8Array(l)),this.state!==Vt.STOPPED&&(this.state=Vt.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===N.MAIN&&be(i.frag)&&(this.mainFragLoading=i,this.state===Vt.IDLE&&this.tick())}onFragBuffered(t,i){const{frag:s,part:o}=i;if(s.type!==N.AUDIO){!this.audioOnly&&s.type===N.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(be(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=Vt.ERROR;return}switch(i.details){case re.FRAG_GAP:case re.FRAG_PARSING_ERROR:case re.FRAG_DECRYPT_ERROR:case re.FRAG_LOAD_ERROR:case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_ERROR:case re.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(N.AUDIO,i);break;case re.AUDIO_TRACK_LOAD_ERROR:case re.AUDIO_TRACK_LOAD_TIMEOUT:case re.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Vt.WAITING_TRACK&&((s=i.context)==null?void 0:s.type)===Re.AUDIO_TRACK&&(this.state=Vt.IDLE);break;case re.BUFFER_ADD_CODEC_ERROR:case re.BUFFER_APPEND_ERROR:if(i.parent!=="audio")return;this.resetLoadingState();break;case re.BUFFER_FULL_ERROR:if(i.parent!=="audio")return;this.reduceLengthAndFlushBuffer(i)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case re.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onBufferFlushing(t,{type:i}){i!==M.VIDEO&&(this.flushing=!0)}onBufferFlushed(t,{type:i}){if(i!==M.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Vt.ENDED&&(this.state=Vt.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,i,N.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:L,text:F,id3:$,initSegment:te}=l;if(this.fragContextChanged(y)||!S){this.fragmentTracker.removeFragment(y);return}if(this.state=Vt.PARSING,this.switchingTrack&&L&&this.completeAudioSwitch(this.switchingTrack),te!=null&&te.tracks){const Q=y.initSegment||y;this._bufferInitSegment(x,te.tracks,Q,c),o.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:Q,id:s,tracks:te.tracks})}if(L){const{startPTS:Q,endPTS:Te,startDTS:Ve,endDTS:$e}=L;g&&(g.elementaryStreams[M.AUDIO]={startPTS:Q,endPTS:Te,startDTS:Ve,endDTS:$e}),y.setElementaryStreamInfo(M.AUDIO,Q,Te,Ve,$e),this.bufferFragmentData(L,y,g,c)}if($!=null&&(i=$.samples)!=null&&i.length){const Q=k({id:s,frag:y,details:S},$);o.trigger(E.FRAG_PARSING_METADATA,Q)}if(F){const Q=k({id:s,frag:y,details:S},F);o.trigger(E.FRAG_PARSING_USERDATA,Q)}}_bufferInitSegment(t,i,s,o){if(this.state!==Vt.PARSING||(i.video&&delete i.video,i.audiovideo&&delete i.audiovideo,!i.audio))return;const l=i.audio;l.id=N.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===qr.NOT_LOADED||o===qr.PARTIAL){var l;if(!be(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=Vt.WAITING_INIT_PTS;const c=this.mainDetails;c&&c.fragmentStart!==i.details.fragmentStart&&En(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)||(mr(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 Co 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 Lr(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){Ja(s,o);const Ve=o.playlistParsingError;if(Ve){this.warn(Ve);const $e=this.hls;if(!$e.config.ignorePlaylistParsingErrors){var g;const{networkDetails:ht}=i;$e.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:re.LEVEL_PARSING_ERROR,fatal:!1,url:o.url,error:Ve,reason:Ve.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,L=S?S.end-S.len:0,F=(o.edge-L)*1e3,$=$a(o,F);if(o.requestScheduled+$<c?o.requestScheduled=c:o.requestScheduled+=$,this.log(`live playlist ${t} ${o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:o.updated?"UPDATED":"MISSED"}`),!this.canLoad||!o.live)return;let te,Q,Te;if(o.canBlockReload&&o.endSN&&o.advanced){const Ve=this.hls.config.lowLatencyMode,$e=o.lastPartSn,ht=o.endSN,mt=o.lastPartIndex,Ft=mt!==-1,dt=$e===ht;Ft?dt?(Q=ht+1,Te=Ve?0:mt):(Q=$e,Te=Ve?mt+1:o.maxPartIndex):Q=ht+1;const Tt=o.age,Ut=Tt+o.ageHeader;let bt=Math.min(Ut-o.partTarget,o.targetduration*1.5);if(bt>0){if(Ut>o.targetduration*3)this.log(`Playlist last advanced ${Tt.toFixed(2)}s ago. Omitting segment and part directives.`),Q=void 0,Te=void 0;else if(s!=null&&s.tuneInGoal&&Ut-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 fr=Math.floor(bt/o.targetduration);if(Q+=fr,Te!==void 0){const vr=Math.round(bt%o.targetduration/o.partTarget);Te+=vr}this.log(`CDN Tune-in age: ${o.ageHeader}s last advanced ${Tt.toFixed(2)}s goal: ${bt} skip sn ${fr} to part ${Te}`)}o.tuneInGoal=bt}if(te=this.getDeliveryDirectives(o,i.deliveryDirectives,Q,Te),Ve||!dt){o.requestScheduled=c,this.loadingPlaylist(x,te);return}}else(o.canBlockReload||o.canSkipUntil)&&(te=this.getDeliveryDirectives(o,i.deliveryDirectives,Q,Te));te&&Q!==void 0&&o.canBlockReload&&(o.requestScheduled=l.loading.first+Math.max($-p*2,$/2)),this.scheduleLoading(x,te,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=Ar.No),new Lr(s,o,l)}checkRetry(t){const i=t.details,s=ri(t),o=t.errorAction,{action:l,retryCount:c=0,retryConfig:p}=o||{},y=!!o&&!!p&&(l===Tr.RetryRequest||!o.resolved&&l===Tr.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=Hr(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 h0(h,t){if(h.length!==t.length)return!1;for(let i=0;i<h.length;i++)if(!ml(h[i].attrs,t[i].attrs))return!1;return!0}function ml(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 d0(h,t){return t.label.toLowerCase()===h.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(h.lang||"").toLowerCase())}class Xh extends Co{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(L=>!s||s.indexOf(L.groupId)!==-1);if(p.length)this.selectDefaultTrack&&!p.some(L=>L.default)&&(this.selectDefaultTrack=!1),p.forEach((L,F)=>{L.id=F});else if(!l&&!this.tracksInGroup.length)return;this.tracksInGroup=p;const y=this.hls.config.audioPreference;if(!l&&y){const L=_t(y,p,Bt);if(L>-1)l=p[L];else{const F=_t(y,this.tracks);l=this.tracks[F]}}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 L=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(L.message),this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:re.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:L})}}}onError(t,i){i.fatal||!i.context||i.context.type===Re.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(ml(t.attrs,x.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return g}for(let g=0;g<i.length;g++){const x=i[g];if(ml(t.attrs,x.attrs,["LANGUAGE"]))return g}}return-1}loadPlaylist(t){super.loadPlaylist();const i=this.currentTrack;this.shouldLoadPlaylist(i)&&mr(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 Nc=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Iu="HlsJsTrackRemovedError";class Qh extends Error{constructor(t){super(t),this.name=Iu}}class f0 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,tc(s),$c(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: ${Kr(s,(y,g)=>y==="initSegment"?void 0:g)};
transfer tracks: ${Kr(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 L=this.fragmentTracker,F=x.id;if(L.hasFragments(F)||L.hasParts(F)){const Q=Wr.getBuffered(S);L.detectEvictedFragments(g,Q,F,null,!0)}const $=rc(g),te=[g,S];this.sourceBuffers[$]=te,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&&tc(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[rc(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:L,codec:F,levelCodec:$,container:te,metadata:Q,supplemental:Te}=S;let Ve=s[p];const $e=(y=this.transferData)==null||(g=y.tracks)==null?void 0:g[p],ht=$e!=null&&$e.buffer?$e:Ve,mt=(ht==null?void 0:ht.pendingCodec)||(ht==null?void 0:ht.codec),Ft=ht==null?void 0:ht.levelCodec;Ve||(Ve=s[p]={buffer:void 0,listeners:[],codec:F,supplemental:Te,container:te,levelCodec:$,metadata:Q,id:L});const dt=yr(mt,Ft),Tt=dt==null?void 0:dt.replace(Nc,"$1");let Ut=yr(F,$);const bt=(x=Ut)==null?void 0:x.replace(Nc,"$1");Ut&&dt&&Tt!==bt&&(p.slice(0,5)==="audio"&&(Ut=Ae(Ut,this.appendSource)),this.log(`switching codec ${mt} to ${Ut}`),Ut!==(Ve.pendingCodec||Ve.codec)&&(Ve.pendingCodec=Ut),Ve.container=te,this.appendChangeType(p,te,Ut))}),(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,N.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&&Wr.isBuffered(y.buffer,o)||((p=this.fragmentTracker.getAppendedFrag(o,N.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,L=self.performance.now();x.start=L;const F=p.stats.buffering,$=y?y.stats.buffering:null;F.start===0&&(F.start=L),$&&$.start===0&&($.start=L);const te=s.audio;let Q=!1;l==="audio"&&(te==null?void 0:te.container)==="audio/mpeg"&&(Q=!this.lastMpegAudioChunk||g.id===1||this.lastMpegAudioChunk.sn!==g.sn,this.lastMpegAudioChunk=g);const Te=this.tracks.video,Ve=Te==null?void 0:Te.buffer;if(Ve&&S!=="initSegment"){const mt=y||p,Ft=this.blockedAudioAppend;if(l==="audio"&&c!=="main"&&!this.blockedAudioAppend){const Tt=mt.start+mt.duration*.05,Ut=Ve.buffered,bt=this.currentOp("video");!Ut.length&&!bt?this.blockAudio(mt):!bt&&!Wr.isBuffered(Ve,Tt)&&this.lastVideoAppendEnd<Tt&&this.blockAudio(mt)}else if(l==="video"){const dt=mt.end;if(Ft){const Tt=Ft.frag.start;(dt>Tt||dt<this.lastVideoAppendEnd||Wr.isBuffered(Ve,Tt))&&this.unblockAudio()}this.lastVideoAppendEnd=dt}}const $e=(y||p).start,ht={label:`append-${l}`,execute:()=>{if(x.executeStart=self.performance.now(),Q){const mt=this.tracks[l];if(mt){const Ft=mt.buffer;if(Ft){const dt=$e-Ft.timestampOffset;Math.abs(dt)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${$e} (delta: ${dt}) sn: ${S})`),Ft.timestampOffset=$e)}}}this.appendExecutor(o,l)},onStart:()=>{},onComplete:()=>{const mt=self.performance.now();x.executeEnd=x.end=mt,F.first===0&&(F.first=mt),$&&$.first===0&&($.first=mt);const Ft={};this.sourceBuffers.forEach(([dt,Tt])=>{dt&&(Ft[dt]=Wr.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:Ft})},onError:mt=>{var Ft;const dt={type:Me.MEDIA_ERROR,parent:p.type,details:re.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:p,part:y,chunkMeta:g,error:mt,err:mt,fatal:!1},Tt=(Ft=this.media)==null?void 0:Ft.error;if(mt.code===DOMException.QUOTA_EXCEEDED_ERR)dt.details=re.BUFFER_FULL_ERROR;else if(mt.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Tt)dt.errorAction=br(!0);else if(mt.name===Iu&&this.sourceBufferCount===0)dt.errorAction=br(!0);else{const Ut=++this.appendErrors[l];this.warn(`Failed ${Ut}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer (${Tt||"no media error"})`),(Ut>=this.hls.config.appendErrorMaxRetry||Tt)&&(dt.fatal=!0)}this.hls.trigger(E.ERROR,dt)}};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[M.AUDIOVIDEO]?l.push("audiovideo"):(c[M.AUDIO]&&l.push("audio"),c[M.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).catch(y=>{this.warn(`Fragment buffered callback ${y}`),this.stepOperationQueue(this.sourceBufferTypes)})}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===re.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=Wr.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=Wr.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}) ${Kr(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:Me.MEDIA_ERROR,details:re.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":""} ${Kr(p)}`);try{const x=s.addSourceBuffer(g),S=rc(c),L=[c,x];i[S]=L,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:Me.MEDIA_ERROR,details:re.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=Xt(o,s));const l=yr(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:Me.MEDIA_ERROR,details:re.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 Qh(`Attempting to append to the ${i} SourceBuffer, but it does not exist`);s.ending=!1,s.ended=!1,o.appendBuffer(t)}blockUntilOpen(t){if(this.isUpdating()||this.isQueued())this.blockBuffers(t).catch(i=>{this.warn(`SourceBuffer blocked callback ${i}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{t()}catch(i){this.warn(`Callback run without blocking ${this.operationQueue} ${i}`)}}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)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);const{operationQueue:s}=this,o=i.map(c=>this.appendBlocker(c));return i.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(o).then(c=>{s===this.operationQueue&&(t(),this.stepOperationQueue(this.sourceBufferTypes))})}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 tc(h){const t=h.querySelectorAll("source");[].slice.call(t).forEach(i=>{h.removeChild(i)})}function $c(h,t){const i=self.document.createElement("source");i.type="video/mp4",i.src=t,h.appendChild(i)}function rc(h){return h==="audio"?1:0}class p0{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,p0.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"},Wi={HLS:"h"},Xl={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},Do={[Xl.OBJECT]:["br","d","ot","tb"],[Xl.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Xl.SESSION]:["cid","pr","sf","sid","st","v"],[Xl.STATUS]:["bs","rtp"]};class gl{constructor(t,i){Array.isArray(t)&&(t=t.map(s=>s instanceof gl?s:new gl(s))),this.value=t,this.params=i}}const td="Dict";function rd(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 nc(h,t,i,s){return new Error(`failed to ${h} "${rd(t)}" as ${i}`,{cause:s})}function ra(h,t,i){return nc("serialize",h,t,i)}class Jl{constructor(t){this.description=t}}const or="Bare Item",sc="Boolean";function m0(h){if(typeof h!="boolean")throw ra(h,sc);return h?"?1":"?0"}const g0="Byte Sequence";function v0(h){if(ArrayBuffer.isView(h)===!1)throw ra(h,g0);return`:${$l(h)}:`}const id="Integer";function nd(h){return h<-999999999999999||999999999999999<h}function zc(h){if(nd(h))throw ra(h,id);return h.toString()}function fs(h){return`@${zc(h.getTime()/1e3)}`}const sd="Decimal";function ac(h){const t=zl(h,3);if(Math.floor(Math.abs(t)).toString().length>12)throw ra(h,sd);const i=t.toString();return i.includes(".")?i:`${i}.0`}const y0="String",b0=/[\x00-\x1f\x7f]+/;function vl(h){if(b0.test(h))throw ra(h,y0);return`"${h.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ql(h){return h.description||h.toString().slice(7,-1)}const ua="Token";function Mo(h){const t=Ql(h);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t)===!1)throw ra(t,ua);return t}function Ds(h){switch(typeof h){case"number":if(!pe(h))throw ra(h,or);return Number.isInteger(h)?zc(h):ac(h);case"string":return vl(h);case"symbol":return Mo(h);case"boolean":return m0(h);case"object":if(h instanceof Date)return fs(h);if(h instanceof Uint8Array)return v0(h);if(h instanceof Jl)return Mo(h);default:throw ra(h,or)}}const Lo="Key";function yl(h){if(/^[a-z*][a-z0-9\-_.*]*$/.test(h)===!1)throw ra(h,Lo);return h}function ya(h){return h==null?"":Object.entries(h).map(([t,i])=>i===!0?`;${yl(t)}`:`;${yl(t)}=${Ds(i)}`).join("")}function oc(h){return h instanceof gl?`${Ds(h.value)}${ya(h.params)}`:Ds(h)}function Uc(h){return`(${h.value.map(oc).join(" ")})${ya(h.params)}`}function lc(h,t={whitespace:!0}){if(typeof h!="object")throw ra(h,td);const i=h instanceof Map?h.entries():Object.entries(h),s=t!=null&&t.whitespace?" ":"";return Array.from(i).map(([o,l])=>{l instanceof gl||(l=new gl(l));let c=yl(o);return l.value===!0?c+=ya(l.params):(c+="=",Array.isArray(l.value)?c+=Uc(l):c+=oc(l)),c}).join(`,${s}`)}function ad(h,t){return lc(h,t)}function Ms(h){return h==="ot"||h==="sf"||h==="st"}function Va(h){return typeof h=="number"?pe(h):h!=null&&h!==""&&h!==!1}const _0=h=>Math.round(h),Kc=(h,t)=>(t!=null&&t.baseUrl&&(h=Su(h,t.baseUrl)),encodeURIComponent(h)),eu=h=>_0(h/100)*100,ji={br:_0,d:_0,bl:eu,dl:eu,mtp:eu,nor:Kc,rtp:eu,tb:_0};function tu(h,t){const i={};if(h==null||typeof h!="object")return i;const s=Object.keys(h).sort(),o=k({},ji,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||Va(p)&&(Ms(c)&&typeof p=="string"&&(p=new Jl(p)),i[c]=p))}),i}function Ro(h,t={}){return h?ad(tu(h,t),k({whitespace:!1},t)):""}function x0(h,t={}){const i={};if(!h)return i;const s=Object.entries(h),o=Object.entries(Do).concat(Object.entries((t==null?void 0:t.customHeaderMap)||{})),l=s.reduce((c,p)=>{var y,g;const[x,S]=p,L=((y=o.find(F=>F[1].includes(x)))===null||y===void 0?void 0:y[0])||Xl.REQUEST;return(g=c[L])!==null&&g!==void 0||(c[L]={}),c[L][x]=S,c},{});return Object.entries(l).reduce((c,[p,y])=>(c[p]=Ro(y,t),c),i)}function $t(h,t,i){return k(h,x0(t,i))}const od="CMCD";function ld(h,t={}){if(!h)return"";const i=Ro(h,t);return`${od}=${encodeURIComponent(i)}`}const w0=/CMCD=[^&#]+/;function ud(h,t,i){const s=ld(t,i);if(!s)return h;if(w0.test(h))return h.replace(w0,s);const o=h.includes("?")?"&":"?";return`${h}${o}${s}`}class Pu{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:Wi.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={}),$t(t.headers,i,l)):t.url=ud(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:Wr.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 cd=3e5;class hd 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)===Tr.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: ${Kr(l)} penalized: ${Kr(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]>cd&&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,za(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===Re.AUDIO_TRACK&&o[l].hasAudioGroup(t)||i===Re.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 L=S.AUDIO&&`${S.AUDIO}_clone_${c}`,F=S.SUBTITLES&&`${S.SUBTITLES}_clone_${c}`;L&&(s[S.AUDIO]=L,S.AUDIO=L),F&&(o[S.SUBTITLES]=F,S.SUBTITLES=F);const $=ao(x.uri,S["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",y),te=new Fr({attrs:S,audioCodec:x.audioCodec,bitrate:x.bitrate,height:x.height,name:x.name,url:$,videoCodec:x.videoCodec,width:x.width});if(x.audioGroups)for(let Q=1;Q<x.audioGroups.length;Q++)te.addGroupId("audio",`${x.audioGroups[Q]}_clone_${c}`);if(x.subtitleGroups)for(let Q=1;Q<x.subtitleGroups.length;Q++)te.addGroupId("text",`${x.subtitleGroups[Q]}_clone_${c}`);return te});i.push(...g),Ls(this.audioTracks,s,y,c),Ls(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,L,F)=>{this.log(`Loaded steering manifest: "${o}"`);const $=x.data;if(($==null?void 0:$.VERSION)!==1){this.log(`Steering VERSION ${$.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=$.TTL;const{"RELOAD-URI":te,"PATHWAY-CLONES":Q,"PATHWAY-PRIORITY":Te}=$;if(te)try{this.uri=new self.URL(te,o).href}catch($e){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${te}`);return}this.scheduleRefresh(this.uri||L.url),Q&&this.clonePathways(Q);const Ve={steeringManifest:$,url:o.toString()};this.hls.trigger(E.STEERING_MANIFEST_LOADED,Ve),Te&&this.updatePathwayPriority(Te)},onError:(x,S,L,F)=>{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 $=this.timeToLoad*1e3;if(x.code===429){const te=this.loader;if(typeof(te==null?void 0:te.getResponseHeader)=="function"){const Q=te.getResponseHeader("Retry-After");Q&&($=parseFloat(Q)*1e3)}this.log(`Steering manifest ${S.url} rate limited`);return}this.scheduleRefresh(this.uri||S.url,$)},onTimeout:(x,S,L)=>{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 Ls(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=ao(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 ao(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 oo 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=oo.CDMCleanupPromise?[oo.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=Ir(this.config));const p=c.map(Qn).filter(y=>!!y);this.keyFormatPromise=this.getKeyFormatPromise(p)}this.keyFormatPromise.then(c=>{const p=Di(c);let y,g;if(s==="sinf"){if(p!==Pi.FAIRPLAY){this.warn(`Ignoring unexpected "${i.type}" event with init data type: "${s}" for selected key-system ${p}`);return}const $=Cr(new Uint8Array(o));try{const te=Oi(JSON.parse($).sinf),Q=Gt(te);if(!Q)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");y=new Uint8Array(Q.subarray(8,24)),g=Pi.FAIRPLAY}catch(te){this.warn(`${l} Failed to parse sinf: ${te}`);return}}else{if(p!==Pi.WIDEVINE&&p!==Pi.PLAYREADY){this.warn(`Ignoring unexpected "${i.type}" event with init data type: "${s}" for selected key-system ${p}`);return}const $=ft(o),te=$.filter(Te=>!!Te.systemId&&Tn(Te.systemId)===p);te.length>1&&this.warn(`${l} Using first of ${te.length} pssh found for selected key-system ${p}`);const Q=te[0];if(!Q){$.length===0||$.some(Te=>!Te.systemId)?this.warn(`${l} contains incomplete or invalid pssh data`):this.log(`ignoring ${l} for ${$.map(Te=>Tn(Te.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(g=Tn(Q.systemId),Q.version===0&&Q.data)if(g===Pi.WIDEVINE){const Te=Q.data.length-22;y=new Uint8Array(Q.data.subarray(Te,Te+16))}else g===Pi.PLAYREADY&&(y=Ks(Q.data))}if(!g||!y)return;const x=de.hexDump(y),{keyIdToKeySessionPromise:S,mediaKeySessions:L}=this;let F=S[x];for(let $=0;$<L.length;$++){const te=L[$],Q=te.decryptdata;if(!Q.keyId)continue;const Te=de.hexDump(Q.keyId);if(x===Te||Q.uri.replace(/-/g,"").indexOf(x)!==-1){if(F=S[Te],Q.pssh)break;delete S[Te],Q.pssh=new Uint8Array(o),Q.keyId=y,F=S[x]=F.then(()=>this.generateRequestWithPreferredKeySession(te,s,o,"encrypted-event-key-match")),F.catch(Ve=>this.handleError(Ve));break}}if(!F){if(g!==p){this.log(`Ignoring "${i.type}" event with ${g} init data for selected key-system ${p}`);return}F=S[x]=this.getKeySystemSelectionPromise([g]).then(({keySystem:$,mediaKeys:te})=>{var Q;this.throwIfDestroyed();const Te=new ws("ISO-23001-7",x,(Q=Qn($))!=null?Q:"");return Te.pssh=new Uint8Array(o),Te.keyId=y,this.attemptSetMediaKeys($,te).then(()=>{this.throwIfDestroyed();const Ve=this.createMediaKeySessionContext({decryptdata:Te,keySystem:$,mediaKeys:te});return this.generateRequestWithPreferredKeySession(Ve,s,o,"encrypted-event-no-match")})}),F.catch($=>this.handleError($))}})}},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===Pi.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 Vs?p(S):p(new Vs({type:Me.KEY_SYSTEM_ERROR,details:re.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=_n(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: ${Kr(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=Ir(this.config),l=t.map(Di).filter(c=>!!c&&o.indexOf(c)!==-1);return this.getKeySystemSelectionPromise(l).then(({keySystem:c})=>{const p=Qn(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 Vs?this.hls.trigger(E.ERROR,t.data):this.hls.trigger(E.ERROR,{type:Me.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))}getKeySystemForKeyPromise(t){const i=this.getKeyIdString(t),s=this.keyIdToKeySessionPromise[i];if(!s){const o=Di(t.keyFormat),l=o?[o]:Ir(this.config);return this.attemptKeySystemAccess(l)}return s}getKeySystemSelectionPromise(t){if(t.length||(t=Ir(this.config)),t.length===0)throw new Vs({type:Me.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Kr({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 $=p.call(this.hls,i,s,t);if(!$)throw new Error("Invalid response from configured generateRequest filter");i=$.initDataType,s=$.initData?$.initData:null,t.decryptdata.pssh=s?new Uint8Array(s):null}catch($){var y;if(this.warn($.message),(y=this.hls)!=null&&y.config.debug)throw $}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 el,S=t._onmessage=$=>{const te=t.mediaKeysSession;if(!te){x.emit("error",new Error("invalid state"));return}const{messageType:Q,message:Te}=$;this.log(`"${Q}" message event for session "${te.sessionId}" message size: ${Te.byteLength}`),Q==="license-request"||Q==="license-renewal"?this.renewLicense(t,Te).catch(Ve=>{x.eventNames().length?x.emit("error",Ve):this.handleError(Ve)}):Q==="license-release"?t.keySystem===Pi.FAIRPLAY&&(this.updateKeySession(t,sn("acknowledged")),this.removeSession(t)):this.warn(`unhandled media key message type "${Q}"`)},L=t._onkeystatuseschange=$=>{if(!t.mediaKeysSession){x.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(t);const Q=t.keyStatus;x.emit("keyStatus",Q),Q==="expired"&&(this.warn(`${t.keySystem} expired for key ${g}`),this.renewKeySession(t))};t.mediaKeysSession.addEventListener("message",S),t.mediaKeysSession.addEventListener("keystatuseschange",L);const F=new Promise(($,te)=>{x.on("error",te),x.on("keyStatus",Q=>{Q.startsWith("usable")?$():Q==="output-restricted"?te(new Vs({type:Me.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):Q==="internal-error"?te(new Vs({type:Me.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${Q}"`)):Q==="expired"?te(new Error("key expired while generating request")):this.warn(`unhandled key status change "${Q}"`)})});return t.mediaKeysSession.generateRequest(i,s).then(()=>{var $;this.log(`Request generated for key-session "${($=t.mediaKeysSession)==null?void 0:$.sessionId}" keyId: ${g}`)}).catch($=>{throw new Vs({type:Me.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_SESSION,error:$,fatal:!1},`Error generating key-session request: ${$}`)}).then(()=>F).catch($=>{throw x.removeAllListeners(),this.removeSession(t),$}).then(()=>(x.removeAllListeners(),t))}onKeyStatusChange(t){t.mediaKeysSession.keyStatuses.forEach((i,s)=>{if(typeof s=="string"&&typeof i=="object"){const o=s;s=i,i=o}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:(L,F,$,te)=>{c(L.data)},onError:(L,F,$,te)=>{p(new Vs({type:Me.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:$,response:O({url:y.url,data:void 0},L)},`"${t}" certificate request failed (${l}). Status: ${L.code} (${L.text})`))},onTimeout:(L,F,$)=>{p(new Vs({type:Me.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:$,response:{url:y.url,data:void 0}},`"${t}" certificate request timed out (${l})`))},onAbort:(L,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 Vs({type:Me.KEY_SYSTEM_ERROR,details:re.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 Vs({type:Me.KEY_SYSTEM_ERROR,details:re.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,L=l.length;S<L;S++){var c,p;x=l[S];const F=(c=x.querySelector("name"))==null?void 0:c.textContent,$=(p=x.querySelector("value"))==null?void 0:p.textContent;F&&$&&t.setRequestHeader(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 sn(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 Vs({type:Me.KEY_SYSTEM_ERROR,details:re.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==Pi.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={},ws.clearKeyUriToKeyIdMap();const o=s.length;oo.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:Me.OTHER_ERROR,details:re.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:Me.OTHER_ERROR,details:re.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);o>-1&&this.mediaKeySessions.splice(o,1);const{drmSystemOptions:l}=this.config;return(Qi(l)?new Promise((p,y)=>{self.setTimeout(()=>y(new Error("MediaKeySession.remove() timeout")),8e3),i.remove().then(p)}):Promise.resolve()).catch(p=>{var y;this.log(`Could not remove session: ${p}`),(y=this.hls)==null||y.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:re.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${p}`)})}).then(()=>i.close()).catch(p=>{var y;this.log(`Could not close session: ${p}`),(y=this.hls)==null||y.trigger(E.ERROR,{type:Me.OTHER_ERROR,details:re.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${p}`)})})}}}oo.CDMCleanupPromise=void 0;class Vs 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 dd{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 Hc(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 S0(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 bl(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 ru(h,t,i,s){const o=h.mode;if(o==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0){const l=_l(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 Ws(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 _l(h,t,i){const s=[],o=Ws(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 Ou(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 Gc extends Co{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=Ou(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;Ou(s.textTracks).forEach(c=>{bl(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(ml(t.attrs,l.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return o}for(let o=0;o<i.length;o++){const l=i[o];if(ml(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(d0(o,t))return s}}return-1}onError(t,i){i.fatal||!i.context||i.context.type===Re.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=Ou(t.textTracks),s=this.currentTrack;let o;if(s&&(o=i.filter(l=>d0(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 xl(h){let t=5381,i=h.length;for(;i;)t=t*33^h.charCodeAt(--i);return(t>>>0).toString()}const iu=.025;let E0=function(h){return h[h.Point=0]="Point",h[h.Range=1]="Range",h}({});function fd(h,t,i){return`${h.identifier}-${i+1}-${xl(t)}`}class pd{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 A0(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=A0(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 A0(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)<iu))}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"?E0.Range:E0.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 md(this)}}function A0(h,t){return h-t.start<t.duration/2&&!(Math.abs(h-(t.start+t.duration))<iu)?t.start:t.start+t.duration}function Mn(h,t,i){const s=new self.URL(h,i);return s.protocol!=="data:"&&s.searchParams.set("_HLS_primary_id",t),s}function md(h){return`["${h.identifier}" ${h.cue.pre?"<pre>":h.cue.post?"<post>":""}${h.timelineStart.toFixed(2)}-${h.resumeTime.toFixed(2)}]`}function uc(h){const t=h.timelineStart,i=h.duration||0;return`["${h.identifier}" ${t.toFixed(2)}-${(t+i).toFixed(2)}]`}class wl{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=Mn(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=Wr.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=Wr.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: ${uc(this.assetItem)} ${(t=this.hls)==null?void 0:t.sessionId} ${(i=this.interstitial)!=null&&i.appendInPlace?"append-in-place":""}`}}const Vc=.033;class Bu 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,L=g.cue.post,F=x.cue.pre,$=x.cue.post;if(S&&!F)return-1;if(F&&!S||L&&!$)return 1;if($&&!L)return-1;if(!S&&!F&&!L&&!$){const te=g.startTime,Q=x.startTime;if(te!==Q)return te-Q}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 pd(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 L=x.cue.pre,F=x.cue.post,$=t[S-1]||null,te=x.appendInPlace,Q=F?l:x.startOffset,Te=x.duration,Ve=x.timelineOccupancy===E0.Range?Te:0,$e=x.resumptionOffset,ht=($==null?void 0:$.startTime)===Q,mt=Q+x.cumulativeDuration;let Ft=te?mt+Te:Q+$e;if(L||!F&&Q<=0){const Tt=g;g+=Ve,x.timelineStart=mt;const Ut=c;c+=Te,s.push({event:x,start:mt,end:Ft,playout:{start:Ut,end:c},integrated:{start:Tt,end:g}})}else if(Q<=l){if(!ht){const bt=Q-y;if(bt>Vc){const fr=y,vr=g;g+=bt;const Ji=c;c+=bt;const wi={previousEvent:t[S-1]||null,nextEvent:x,start:fr,end:fr+bt,playout:{start:Ji,end:c},integrated:{start:vr,end:g}};s.push(wi)}else bt>0&&$&&($.cumulativeDuration+=bt,s[s.length-1].end=Q)}F&&(Ft=mt),x.timelineStart=mt;const Tt=g;g+=Ve;const Ut=c;c+=Te,s.push({event:x,start:mt,end:Ft,playout:{start:Ut,end:c},integrated:{start:Tt,end:g}})}else return;const dt=x.resumeTime;F||dt>l?y=l:y=dt}),y<l){var p;const x=y,S=g,L=l-y;g+=L;const F=c;c+=L,s.push({previousEvent:((p=s[s.length-1])==null?void 0:p.event)||null,nextEvent:null,start:y,end:x+L,playout:{start:F,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=kr(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<Vc&&(t[y+1].appendInPlace=!1,t[y+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${p}`));const F=pe(p.resumeOffset)?p.resumeOffset:p.duration;l+=F})}primaryCanResumeInPlaceAt(t,i){const s=t.resumeTime,o=t.startTime+t.resumptionOffset;return Math.abs(s-o)>iu?(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=kr(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)<iu+x||Math.abs(g.end-s)<iu+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 Io(h){return`[${h.event?'"'+h.event.identifier+'"':"primary"}: ${h.start.toFixed(2)}-${h.end.toFixed(2)}]`}class Wc{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,i){const s=t.assetListUrl;let o;try{o=Mn(s,this.hls.sessionId,t.baseUrl)}catch(L){const F=this.assignAssetListError(t,re.ASSET_LIST_LOAD_ERROR,L,s);this.hls.trigger(E.ERROR,F);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:(L,F,$,te)=>{const Q=L.data,Te=Q==null?void 0:Q.ASSETS;if(!Array.isArray(Te)){const Ve=this.assignAssetListError(t,re.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),$.url,F,te);this.hls.trigger(E.ERROR,Ve);return}t.assetListResponse=Q,this.hls.trigger(E.ASSET_LIST_LOADED,{event:t,assetListResponse:Q,networkDetails:te})},onError:(L,F,$,te)=>{const Q=this.assignAssetListError(t,re.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${L.code} ${L.text} (${F.url})`),F.url,te,$);this.hls.trigger(E.ERROR,Q)},onTimeout:(L,F,$)=>{const te=this.assignAssetListError(t,re.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${F.url})`),F.url,L,$);this.hls.trigger(E.ERROR,te)}};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:Me.NETWORK_ERROR,details:i,fatal:!1,interstitial:t,url:o,error:s,networkDetails:c,stats:l}}}function Wa(h,t,i){ia(h,t,i),h.addEventListener(t,i)}function ia(h,t,i){h.removeEventListener(t,i)}function jc(h){h==null||h.play().catch(()=>{})}class qc 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 L=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(p)&&(y=this.media)!=null&&y.paused&&(this.shouldPlay=!1),!c){const F=this.findItemIndex(p);if(L>F){const $=this.schedule.findJumpRestrictedIndex(F+1,L);if($>F){this.setSchedulePosition($);return}}}this.setSchedulePosition(L);return}const g=this.playingAsset;if(!g){if(this.playingLastItem&&this.isInterstitial(p)){const L=p.event.assetList[0];L&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(s,L))}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(F=>F.identifier),S=!!(p.length||x.length);if(S&&this.log(`INTERSTITIALS_UPDATED (${p.length}): ${p}
Schedule: ${y.map(F=>Io(F))}`),x.length&&this.log(`Removed events ${x}`),this.playerQueue.forEach(F=>{if(F.interstitial.appendInPlace){const $=F.assetItem.timelineStart,te=F.timelineOffset-$;if(te)try{F.timelineOffset=$}catch(Q){Math.abs(te)>iu&&this.warn(`${Q} ("${F.assetId}" ${F.timelineOffset}->${$})`)}}}),c){const F=this.updateItem(c,this.timelinePos);this.itemsMatch(c,F)&&(this.playingItem=F,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const L=this.bufferingItem;if(L){const F=this.updateItem(L,this.bufferedPos);this.itemsMatch(L,F)?this.bufferingItem=F:L.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(L.event,null))}if(s.forEach(F=>{F.assetList.forEach($=>{this.clearAssetPlayer($.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 Wc(t),this.schedule=new Bu(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){ia(t,"play",this.onPlay),ia(t,"pause",this.onPause),ia(t,"seeking",this.onSeeking),ia(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,i){const s=this.media=i.media;Wa(s,"seeking",this.onSeeking),Wa(s,"timeupdate",this.onTimeupdate),Wa(s,"play",this.onPlay),Wa(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,L,F,$,te)=>{if(S){let Q=S[L].start;const Te=S.event;if(Te){if(L==="playout"||Te.timelineOccupancy!==E0.Point){const Ve=s(F);(Ve==null?void 0:Ve.interstitial)===Te&&(Q+=Ve.assetItem.startOffset+Ve[te])}}else{const Ve=$==="bufferedPos"?c():t[$];Q+=Ve-S.start}return Q}return 0},l=(S,L)=>{if(S!==0&&L!=="primary"&&t.schedule.length){var F;const $=t.schedule.findItemIndexAtTime(S),te=(F=t.schedule.items)==null?void 0:F[$];if(te){const Q=te[L].start-te.start;return S+Q}}return S},c=()=>{const S=t.bufferedPos;return S===Number.MAX_VALUE?p("primary"):Math.max(S,0)},p=S=>{var L;return(L=t.primaryDetails)!=null&&L.live?t.primaryDetails.edge:t.schedule.durations[S]},y=(S,L)=>{var F,$;const te=t.effectivePlayingItem;if(te!=null&&(F=te.event)!=null&&F.restrictions.skip)return;t.log(`seek to ${S} "${L}"`);const Q=t.effectivePlayingItem,Te=t.schedule.findItemIndexAtTime(S,L),Ve=($=t.schedule.items)==null?void 0:$[Te],$e=t.getBufferingPlayer(),ht=$e==null?void 0:$e.interstitial,mt=ht==null?void 0:ht.appendInPlace,Ft=Q&&t.itemsMatch(Q,Ve);if(Q&&(mt||Ft)){const Tt=s(t.playingAsset),Ut=(Tt==null?void 0:Tt.media)||t.primaryMedia;if(Ut){const bt=L==="primary"?Ut.currentTime:o(Q,L,t.playingAsset,"timelinePos","currentTime"),fr=S-bt,vr=(mt?bt:Ut.currentTime)+fr;if(vr>=0&&(!Tt||mt||vr<=Tt.duration)){Ut.currentTime=vr;return}}}if(Ve){let Tt=S;if(L!=="primary"){const bt=Ve[L].start,fr=S-bt;Tt=Ve.start+fr}const Ut=!t.isInterstitial(Ve);if((!t.isInterstitial(Q)||Q.event.appendInPlace)&&(Ut||Ve.event.appendInPlace)){const bt=t.media||(mt?$e==null?void 0:$e.media:null);bt&&(bt.currentTime=Tt)}else if(Q){const bt=t.findItemIndex(Q);if(Te>bt){const vr=t.schedule.findJumpRestrictedIndex(bt+1,Te);if(vr>bt){t.setSchedulePosition(vr);return}}let fr=0;if(Ut)t.timelinePos=Tt,t.checkBuffer();else{var dt;const vr=Ve==null||(dt=Ve.event)==null?void 0:dt.assetList;if(vr){const Ji=S-(Ve[L]||Ve).start;for(let wi=vr.length;wi--;){const di=vr[wi];if(di.duration&&Ji>=di.startOffset&&Ji<di.startOffset+di.duration){fr=wi;break}}}}t.setSchedulePosition(Te,fr)}}},g=()=>{const S=t.effectivePlayingItem;if(t.isInterstitial(S))return S;const L=i();return t.isInterstitial(L)?L:null},x={get currentTime(){const S=g(),L=t.effectivePlayingItem;return L&&L===S?o(L,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-L.playout.start:0},set currentTime(S){const L=g(),F=t.effectivePlayingItem;F&&F===L&&y(S+F.playout.start,"playout")},get duration(){const S=g();return S?S.playout.end-S.playout.start:0},get assetPlayers(){var S;const L=(S=g())==null?void 0:S.event.assetList;return L?L.map(F=>t.getAssetPlayer(F.identifier)):[]},get playingIndex(){var S;const L=(S=g())==null?void 0:S.event;return L&&t.effectivePlayingAsset?L.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return g()}};this.manager={get events(){var S,L;return((S=t.schedule)==null||(L=S.events)==null?void 0:L.slice(0))||[]},get schedule(){var S,L;return((S=t.schedule)==null||(L=S.items)==null?void 0:L.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,L=S==null?void 0:S.event;if(L&&!L.restrictions.skip){const F=t.findItemIndex(S);if(L.appendInPlace){const $=S.playout.start+S.event.duration;y($+.001,"playout")}else t.advanceAfterAssetEnded(L,F,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} ${Kr(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 F=this.getBufferingPlayer();F?(l=F.transferMedia(),x=`${F}`):x="detached MediaSource"}else x="detached media";if(!l){if(g)l=this.detachedData,this.log(`using detachedData: MediaSource ${Kr(l)}`);else if(!this.detachedData||c.media===i){const F=this.playerQueue;F.length>1&&F.forEach($=>{if(p&&$.interstitial.appendInPlace!==y){const te=$.interstitial;this.clearInterstitial($.interstitial,null),te.appendInPlace=!1,te.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${te}`)}}),this.hls.detachMedia(),this.detachedData={media:i}}}const S=l&&"mediaSource"in l&&((o=l.mediaSource)==null?void 0:o.readyState)!=="closed",L=S&&l?l:i;if(this.log(`${S?"transfering MediaSource":"attaching media"} to ${p?t:"Primary"} from ${x}`),L===l){const F=p&&t.assetId===this.schedule.assetIdAtEnd;L.overrides={duration:this.schedule.duration,endOfStream:!p||F,cueRemoval:!p}}t.attachMedia(L)}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,L=S?this.getAssetPlayer(S):null;if(L&&S&&(!this.eventItemsMatch(l,o)||i!==void 0&&S!==((p=g.assetList)==null?void 0:p[i].identifier))){var y;const F=g.findAssetIndex(x);this.log(`INTERSTITIAL_ASSET_ENDED ${F+1}/${g.assetList.length} ${uc(x)}`),this.endedAsset=x,this.playingAsset=null,this.hls.trigger(E.INTERSTITIAL_ASSET_ENDED,{asset:x,assetListIndex:F,event:g,schedule:s.slice(0),scheduleIndex:t,player:L}),this.retreiveMediaSource(S,o),L.media&&!((y=this.detachedData)!=null&&y.mediaSource)&&L.detachMedia()}if(!this.eventItemsMatch(l,o)&&(this.endedItem=l,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${g} ${Io(l)}`),g.hasPlayed=!0,this.hls.trigger(E.INTERSTITIAL_ENDED,{event:g,schedule:s.slice(0),scheduleIndex:t}),g.cue.once)){this.updateSchedule();const F=this.schedule.items;if(o&&F){const $=this.schedule.findItemIndex(o);this.advanceSchedule($,F,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 ${Io(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 L=g.assetList[s];if(!L){const F=i[t+1],$=this.media;F&&$&&!this.isInterstitial(F)&&$.currentTime<F.start&&($.currentTime=this.timelinePos=F.start),this.advanceAfterAssetEnded(g,t,s||0);return}if(S||(S=this.getAssetPlayer(L.identifier)),S===null||S.destroyed){const F=g.assetList.length;this.warn(`asset ${s+1}/${F} player destroyed ${g}`),S=this.createAssetPlayer(g,L,s)}if(!this.eventItemsMatch(c,this.bufferingItem)&&g.appendInPlace&&this.isAssetBuffered(L))return;this.startAssetPlayer(S,s,i,t,p),this.shouldPlay&&jc(S.media)}else c!==null?(this.resumePrimary(c,t,o),this.shouldPlay&&jc(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 ${Io(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 ${Io(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:Wr.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=Wr.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),L=Math.min(S+1,i.length-1),F=i[L];if((y===-1&&l&&t>=l.end||(g=F.event)!=null&&g.appendInPlace&&t+.01>=F.start)&&(y=L),L-p>1&&(l==null||(x=l.event)==null?void 0:x.appendInPlace)===!1)return;if(this.bufferedPos=t,y>S&&y>p)this.bufferedToItem(F);else{const $=this.primaryDetails;this.primaryLive&&$&&t>$.edge-$.targetduration&&F.start<$.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(F)&&this.preloadAssets(F.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 ${Io(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 L=this.playingItem;!this.isInterstitial(L)&&(L==null||(p=L.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 L=x-y;L>0&&(g=Math.round(L*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:fd(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 ${uc(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,L=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&&(L.timelineOffset=i.timelineStart));const F=L.cmcd;F!=null&&F.sessionId&&F.contentId&&(L.cmcd=k({},F,{contentId:xl(i.uri)})),this.getAssetPlayer(S)&&this.warn(`Duplicate date range identifier ${t} and asset ${S}`);const $=new wl(this.HlsPlayerClass,L,t,i);this.playerQueue.push($),t.assetList[s]=i;const te=$e=>{if($e.live){const Ft=new Error(`Interstitials MUST be VOD assets ${t}`),dt={fatal:!0,type:Me.OTHER_ERROR,details:re.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ft};this.handleAssetItemError(dt,t,this.schedule.findEventIndex(t.identifier),s,Ft.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())};$.on(E.LEVEL_UPDATED,($e,{details:ht})=>te(ht)),$.on(E.LEVEL_PTS_UPDATED,($e,{details:ht})=>te(ht));const Q=($e,ht)=>{const mt=this.getAssetPlayer(S);if(mt&&ht.tracks){mt.off(E.BUFFER_CODECS,Q),mt.tracks=ht.tracks;const Ft=this.primaryMedia;this.bufferingAsset===mt.assetItem&&Ft&&!mt.media&&this.bufferAssetPlayer(mt,Ft)}};$.on(E.BUFFER_CODECS,Q);const Te=()=>{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),Ft=t.findAssetIndex(i),dt=Ft+1,Tt=($e=this.schedule.items)==null?void 0:$e[mt];if(this.isInterstitial(Tt))if(Ft!==-1&&!t.isAssetPastPlayoutLimit(dt)&&!t.assetList[dt].error)this.bufferedToItem(Tt,dt);else{var Ut;const bt=(Ut=this.schedule.items)==null?void 0:Ut[mt+1];bt&&this.bufferedToItem(bt)}};$.on(E.BUFFERED_TO_END,Te);const Ve=$e=>()=>{if(!this.getAssetPlayer(S))return;this.shouldPlay=!0;const mt=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,mt,$e)};return $.once(E.MEDIA_ENDED,Ve(s)),$.once(E.PLAYOUT_LIMIT_REACHED,Ve(1/0)),$.on(E.ERROR,($e,ht)=>{const mt=this.getAssetPlayer(S);if(ht.details===re.BUFFER_STALLED_ERROR){if(mt!=null&&mt.media){const Ft=mt.currentTime,dt=mt.duration-Ft;Ft&&t.appendInPlace&&dt/mt.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${S} ${t} at ${mt.media.currentTime}`),Te()):(this.warn(`Stalled at ${Ft} of ${Ft+dt} 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}`)}),$.on(E.DESTROYING,()=>{if(!this.getAssetPlayer(S))return;const ht=new Error(`Asset player destroyed unexpectedly ${S}`),mt={fatal:!0,type:Me.OTHER_ERROR,details:re.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:$}),$}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&&Io(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 L=(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(L&&!ut(L,t.tracks)){const F=new Error(`Asset "${p}" SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(L)}')`),$={fatal:!0,type:Me.OTHER_ERROR,details:re.INTERSTITIAL_ASSET_ITEM_ERROR,error:F},te=l.findAssetIndex(c);this.handleAssetItemError($,l,y,te,F.message);return}}this.transferMediaTo(t,i)}handleAssetItemError(t,i,s,o,l){if(t.details===re.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:br(!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?Io(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(($,te)=>{const Q=parseFloat($.DURATION);this.createAsset(o,te,g,p+g,Q,$.URI),g+=Q}),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 L=(s=this.bufferingItem)==null?void 0:s.event;if(S){var F;const $=this.schedule.findEventIndex(l),te=(F=this.schedule.items)==null?void 0:F[$];if(te){if(!this.playingItem&&this.timelinePos>te.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==$){o.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${o}`),this.primaryFallback(o);return}this.setBufferingItem(te)}this.setSchedulePosition($)}else if((L==null?void 0:L.identifier)===l&&L.appendInPlace){const $=o.assetList[0],te=this.getAssetPlayer($.identifier),Q=this.primaryMedia;$&&te&&Q&&this.bufferAssetPlayer(te,Q)}}onError(t,i){switch(i.details){case re.ASSET_LIST_PARSING_ERROR:case re.ASSET_LIST_LOAD_ERROR:case re.ASSET_LIST_LOAD_TIMEOUT:{const s=i.interstitial;s&&this.primaryFallback(s);break}case re.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const k0=500;class Zc extends ro{constructor(t,i,s){super(t,i,s,"subtitle-stream-controller",N.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=Vt.IDLE,this.setInterval(k0),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(be(s)&&(this.fragPrevious=s),this.state=Vt.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,N.SUBTITLE)}}onError(t,i){const s=i.frag;(s==null?void 0:s.type)===N.SUBTITLE&&(i.details===re.FRAG_GAP&&this.fragmentTracker.fragBuffered(s,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Vt.STOPPED&&(this.state=Vt.IDLE))}onSubtitleTracksUpdated(t,{subtitleTracks:i}){if(this.levels&&h0(this.levels,i)){this.levels=i.map(s=>new Fr(s));return}this.tracksBuffered=[],this.levels=i.map(s=>{const o=new Fr(s);return this.tracksBuffered[o.id]=[],o}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,N.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!==Vt.STOPPED&&this.setInterval(k0)}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 L=S.fragments[0];if(!y.details)c.hasProgramDateTime&&S.hasProgramDateTime?(En(c,S),g=c.fragmentStart):L&&(g=L.start,xo(c,g));else{var x;g=this.alignPlaylists(c,y.details,(x=this.levelLastLoaded)==null?void 0:x.details),g===0&&L&&(g=L.start,xo(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===Vt.IDLE&&(kr(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&&hn(o.method)){const c=performance.now();this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,dn(o.method)).catch(p=>{throw l.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:re.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=Vt.IDLE})}}doTick(){if(!this.media){this.state=Vt.IDLE;return}if(this.state===Vt.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=Wr.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,L=S.length,F=g.edge;let $=null;const te=this.fragPrevious;if(p<F){const Ve=o.maxFragLookUpTolerance,$e=p>F-Ve?0:Ve;$=kr(te,S,Math.max(S[0].start,p),$e),!$&&te&&te.start<S[0].start&&($=S[0])}else $=S[L-1];if($=this.filterReplacedPrimary($,s.details),!$)return;const Q=$.sn-g.startSN,Te=S[Q-1];if(Te&&Te.cc===$.cc&&this.fragmentTracker.getState(Te)===qr.NOT_LOADED&&($=Te),this.fragmentTracker.getState($)===qr.NOT_LOADED){const Ve=this.mapToInitFragWhenRequired($);Ve&&this.loadFragment(Ve,s,p)}}}loadFragment(t,i,s){be(t)?super.loadFragment(t,i,s):this._loadInitSegment(t,i)}get mediaBufferTimeRanges(){return new gd(this.tracksBuffered[this.currentTrackId]||[])}}class gd{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 vd={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},Yc=h=>String.fromCharCode(vd[h]||h),Ta=15,lo=100,yd={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},bd={17:2,18:4,21:6,22:8,23:10,19:13,20:15},_d={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Po={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Sl=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class nu{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 js=function(t){const i=[];for(let s=0;s<t.length;s++)i.push(t[s].toString(16));return i};class ja{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 Oo{constructor(){this.uchar=" ",this.penState=new ja}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 T0{constructor(t){this.chars=[],this.pos=0,this.currPenState=new ja,this.cueStartTime=null,this.logger=void 0;for(let i=0;i<lo;i++)this.chars.push(new Oo);this.logger=t}equals(t){for(let i=0;i<lo;i++)if(!this.chars[i].equals(t.chars[i]))return!1;return!0}copy(t){for(let i=0;i<lo;i++)this.chars[i].copy(t.chars[i])}isEmpty(){let t=!0;for(let i=0;i<lo;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>lo&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=lo)}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=Yc(t);if(this.pos>=lo){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<lo;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<lo;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 su{constructor(t){this.rows=[],this.currRow=Ta-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let i=0;i<Ta;i++)this.rows.push(new T0(t));this.logger=t}reset(){for(let t=0;t<Ta;t++)this.rows[t].clear();this.currRow=Ta-1}equals(t){let i=!0;for(let s=0;s<Ta;s++)if(!this.rows[s].equals(t.rows[s])){i=!1;break}return i}copy(t){for(let i=0;i<Ta;i++)this.rows[i].copy(t.rows[i])}isEmpty(){let t=!0;for(let i=0;i<Ta;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 = "+Kr(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<Ta;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 = "+Kr(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<Ta;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 Fu{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 su(s),this.nonDisplayedMemory=new su(s),this.lastOutputScreen=new su(s),this.currRollUpRow=this.displayedMemory.rows[Ta-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[Ta-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: "+Kr(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 Nu{constructor(t,i,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Jc(),this.logger=void 0;const o=this.logger=new nu;this.channels=[null,new Fu(t,i,o),new Fu(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,()=>"["+js([i[s],i[s+1]])+"] -> ("+js([o,l])+")");const y=this.cmdHistory;if(o>=16&&o<=31){if(Xc(o,l,y)){C0(null,null,y),this.logger.log(3,()=>"Repeated command ("+js([o,l])+") is dropped");continue}C0(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 C0(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 "+js([o,l])+" orig: "+js([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 ("+js([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?yd[t]:_d[t]:s=c===1?bd[t]:Po[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 '"+Yc(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 = "+js(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=Sl[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()}C0(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 C0(h,t,i){i.a=h,i.b=t}function Xc(h,t,i){return i.a===h&&i.b===t}function Jc(){return{a:null,b:null}}var D0=function(){if(kn!=null&&kn.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 L="",F=!1,$=p,te=y,Q=g,Te=null,Ve="",$e=!0,ht="auto",mt="start",Ft=50,dt="middle",Tt=50,Ut="middle";Object.defineProperty(x,"id",l({},S,{get:function(){return L},set:function(bt){L=""+bt}})),Object.defineProperty(x,"pauseOnExit",l({},S,{get:function(){return F},set:function(bt){F=!!bt}})),Object.defineProperty(x,"startTime",l({},S,{get:function(){return $},set:function(bt){if(typeof bt!="number")throw new TypeError("Start time must be set to a number.");$=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"endTime",l({},S,{get:function(){return te},set:function(bt){if(typeof bt!="number")throw new TypeError("End time must be set to a number.");te=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"text",l({},S,{get:function(){return Q},set:function(bt){Q=""+bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"region",l({},S,{get:function(){return Te},set:function(bt){Te=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"vertical",l({},S,{get:function(){return Ve},set:function(bt){const fr=s(bt);if(fr===!1)throw new SyntaxError("An invalid or illegal string was specified.");Ve=fr,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 fr=o(bt);if(!fr)throw new SyntaxError("An invalid or illegal string was specified.");mt=fr,this.hasBeenReset=!0}})),Object.defineProperty(x,"position",l({},S,{get:function(){return Ft},set:function(bt){if(bt<0||bt>100)throw new Error("Position must be between 0 and 100.");Ft=bt,this.hasBeenReset=!0}})),Object.defineProperty(x,"positionAlign",l({},S,{get:function(){return dt},set:function(bt){const fr=o(bt);if(!fr)throw new SyntaxError("An invalid or illegal string was specified.");dt=fr,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 Ut},set:function(bt){const fr=o(bt);if(!fr)throw new SyntaxError("An invalid or illegal string was specified.");Ut=fr,this.hasBeenReset=!0}})),x.displayState=void 0}return c.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},c}();class xd{decode(t,i){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function cc(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 wd{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 Qc(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 hc=new D0(0,0,""),M0=hc.align==="middle"?"middle":"center";function Sd(h,t,i){const s=h;function o(){const p=cc(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 wd;Qc(p,function(L,F){let $;switch(L){case"region":for(let te=i.length-1;te>=0;te--)if(i[te].id===F){g.set(L,i[te].region);break}break;case"vertical":g.alt(L,F,["rl","lr"]);break;case"line":$=F.split(","),g.integer(L,$[0]),g.percent(L,$[0])&&g.set("snapToLines",!1),g.alt(L,$[0],["auto"]),$.length===2&&g.alt("lineAlign",$[1],["start",M0,"end"]);break;case"position":$=F.split(","),g.percent(L,$[0]),$.length===2&&g.alt("positionAlign",$[1],["start",M0,"end","line-left","line-right","auto"]);break;case"size":g.percent(L,F);break;case"align":g.alt(L,F,["start",M0,"end","left","right"]);break}},/:/,/\s/),y.region=g.get("region",null),y.vertical=g.get("vertical","");let x=g.get("line","auto");x==="auto"&&hc.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",M0);let S=g.get("position","auto");S==="auto"&&hc.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 eh(h){return h.replace(/<br(?: \/)?>/gi,`
`)}class Ed{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new xd,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=eh(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){Qc(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 D0(0,0,""),i.state="CUE",l.indexOf("-->")===-1){i.cue.id=l;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{Sd(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 L0=/\r\n|\n\r|\n|\r/g,El=function(t,i,s=0){return t.slice(s,s+i.length)===i},Al=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 Ca(h,t,i){return xl(h.toString())+xl(t.toString())+xl(i)}const th=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 rh(h,t,i,s,o,l,c){const p=new Ed,y=gt(new Uint8Array(h)).trim().replace(L0,`
`).split(`
`),g=[],x=t?fn(t.baseTime,t.timescale):0;let S="00:00.000",L=0,F=0,$,te=!0;p.oncue=function(Q){const Te=i[s];let Ve=i.ccOffset;const $e=(L-x)/9e4;if(Te!=null&&Te.new&&(F!==void 0?Ve=i.ccOffset=Te.start:th(i,s,$e)),$e){if(!t){$=new Error("Missing initPTS for VTT MPEGTS");return}Ve=$e-i.presentationOffset}const ht=Q.endTime-Q.startTime,mt=Yn((Q.startTime+Ve-F)*9e4,o*9e4)/9e4;Q.startTime=Math.max(mt,0),Q.endTime=Math.max(mt+ht,0);const Ft=Q.text.trim();Q.text=decodeURIComponent(encodeURIComponent(Ft)),Q.id||(Q.id=Ca(Q.startTime,Q.endTime,Ft)),Q.endTime>0&&g.push(Q)},p.onparsingerror=function(Q){$=Q},p.onflush=function(){if($){c($);return}l(g)},y.forEach(Q=>{if(te)if(El(Q,"X-TIMESTAMP-MAP=")){te=!1,Q.slice(16).split(",").forEach(Te=>{El(Te,"LOCAL:")?S=Te.slice(6):El(Te,"MPEGTS:")&&(L=parseInt(Te.slice(7)))});try{F=Al(S)/1e3}catch(Te){$=Te}return}else Q===""&&(te=!1);p.parse(Q+`
`)}),p.flush()}const R0="stpp.ttml.im1t",ih=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,nh=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,sh={left:"start",center:"center",right:"end",start:"start",end:"end"};function ah(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=>gt(p)),c=Bi(t.baseTime,1,t.timescale);try{l.forEach(p=>i(Ad(p,c)))}catch(p){s(p)}}function Ad(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,L)=>(S[L]=o.getAttribute(`ttp:${L}`)||l[L],S),{}),p=o.getAttribute("xml:space")!=="preserve",y=un(dc(o,"styling","style")),g=un(dc(o,"layout","region")),x=dc(o,"body","[begin]");return[].map.call(x,S=>{const L=$u(S,p);if(!L||!S.hasAttribute("begin"))return null;const F=P0(S.getAttribute("begin"),c),$=P0(S.getAttribute("dur"),c);let te=P0(S.getAttribute("end"),c);if(F===null)throw uo(S);if(te===null){if($===null)throw uo(S);te=F+$}const Q=new D0(F-t,te-t,L);Q.id=Ca(Q.startTime,Q.endTime,Q.text);const Te=g[S.getAttribute("region")],Ve=y[S.getAttribute("style")],$e=I0(Te,Ve,y),{textAlign:ht}=$e;if(ht){const mt=sh[ht];mt&&(Q.lineAlign=mt),Q.align=ht}return k(Q,$e),Q}).filter(S=>S!==null)}function dc(h,t,i){const s=h.getElementsByTagName(t)[0];return s?[].slice.call(s.querySelectorAll(i)):[]}function un(h){return h.reduce((t,i)=>{const s=i.getAttribute("xml:id");return s&&(t[s]=i),t},{})}function $u(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?$u(s,t):t?i+s.textContent.trim().replace(/\s+/g," "):i+s.textContent},"")}function I0(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=fc(t,s,y)||fc(h,s,y)||fc(o,s,y);return g&&(p[y]=g),p},{})}function fc(h,t,i){return h&&h.hasAttributeNS(t,i)?h.getAttributeNS(t,i):null}function uo(h){return new Error(`Could not parse ttml timestamp ${h}`)}function P0(h,t){if(!h)return null;let i=cc(h);return i===null&&(ih.test(h)?i=kl(h,t):nh.test(h)&&(i=oh(h,t))),i}function kl(h,t){const i=ih.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 oh(h,t){const i=nh.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 Pn{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 lh{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=zu(),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 Pn(this,"textTrack1"),i=new Pn(this,"textTrack2"),s=new Pn(this,"textTrack3"),o=new Pn(this,"textTrack4");this.cea608Parser1=new Nu(1,t,i),this.cea608Parser2=new Nu(3,s,o)}addCues(t,i,s,o,l){let c=!1;for(let p=l.length;p--;){const y=l[p],g=ch(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===N.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(uh(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,bl(s[t]),Hc(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=>{bl(o[l]),delete o[l]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=zu(),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++)bl(i[s])}onSubtitleTracksUpdated(t,i){const s=i.subtitleTracks||[],o=s.some(l=>l.textCodec===R0);if(this.config.enableWebVTT||o&&this.config.enableIMSC1){if(h0(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const c=this.media,p=c?Ou(c.textTracks):null;if(this.tracks.forEach((y,g)=>{let x;if(p){let S=null;for(let L=0;L<p.length;L++)if(p[L]&&uh(p[L],y)){S=p[L],p[L]=null;break}S&&(x=S)}if(x)bl(x);else{const S=pc(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===N.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===N.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===R0?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;ah(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;rh(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||ah(i,this.initPTS[t.cc],()=>{s.textCodec=R0,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=>S0(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===N.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===N.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=>ru(p[y],i,s))}if(this.config.renderTextTracksNatively&&i===0&&o!==void 0){const{textTracks:p}=this;Object.keys(p).forEach(y=>ru(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 pc(h){return h.characteristics&&/transcribes-spoken-dialog/gi.test(h.characteristics)&&/describes-music-and-sound/gi.test(h.characteristics)?"captions":"subtitles"}function uh(h,t){return!!h&&h.kind===pc(t)&&d0(t,h)}function ch(h,t,i,s){return Math.min(t,s)-Math.max(h,i)}function zu(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const au=/\s/,hh={newCue(h,t,i,s){const o=[];let l,c,p,y,g;const x=self.VTTCue||self.TextTrackCue;for(let L=0;L<s.rows.length;L++)if(l=s.rows[L],p=!0,y=0,g="",!l.isEmpty()){var S;for(let te=0;te<l.chars.length;te++)au.test(l.chars[te].uchar)&&p?y++:(g+=l.chars[te].uchar,p=!1);l.cueStartTime=t,t===i&&(i+=1e-4),y>=16?y--:y++;const F=eh(g.trim()),$=Ca(t,i,F);h!=null&&(S=h.cues)!=null&&S.getCueById($)||(c=new x(t,i,F),c.id=$,c.line=L+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((L,F)=>L.line==="auto"||F.line==="auto"?0:L.line>8&&F.line>8?F.line-L.line:L.line-F.line),o.forEach(L=>S0(h,L))),o}};function zs(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}const dh=/(\d+)-(\d+)\/(\d+)/;class mc{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||bf,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=er(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),(Bs(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(S=>{var L;this.response=this.loader=S;const F=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-(F-o.loading.start)),!S.ok){const{status:te,statusText:Q}=S;throw new fh(Q||"fetch, bad network response",te,S)}o.loading.first=F,o.total=yf(S.headers)||o.total;const $=(L=this.callbacks)==null?void 0:L.onProgress;return $&&pe(i.highWaterMark)?this.loadProgressively(S,o,t,i.highWaterMark,$):c?S.arrayBuffer():t.responseType==="json"?S.json():S.text()}).then(S=>{var L,F;const $=this.response;if(!$)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first);const te=S[p];te&&(o.loaded=o.total=te);const Q={url:$.url,data:S,code:$.status},Te=(L=this.callbacks)==null?void 0:L.onProgress;Te&&!pe(i.highWaterMark)&&Te(o,t,S,$),(F=this.callbacks)==null||F.onSuccess(Q,o,t,$)}).catch(S=>{var L;if(self.clearTimeout(this.requestTimeout),o.aborted)return;const F=S&&S.code||0,$=S?S.message:null;(L=this.callbacks)==null||L.onError({code:F,text:$},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 io,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 er(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 Nn(h){const t=dh.exec(h);if(t)return parseInt(t[2])-parseInt(t[1])+1}function yf(h){const t=h.get("Content-Range");if(t){const s=Nn(t);if(pe(s))return s}const i=h.get("Content-Length");if(i)return parseInt(i)}function bf(h,t){return new self.Request(h.url,t)}class fh extends Error{constructor(t,i,s){super(t),this.code=void 0,this.details=void 0,this.code=i,this.details=s}}const ph=/^age:\s*[\d.]+\s*$/im;class ou{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 $=x!=null?x:i.response;if($!=null){var c,p;s.loading.end=Math.max(self.performance.now(),s.loading.first);const te=i.responseType==="arraybuffer"?$.byteLength:$.length;s.loaded=s.total=te,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first);const Q=(c=this.callbacks)==null?void 0:c.onProgress;Q&&Q(s,t,$,i);const Te={url:i.responseURL,data:$,code:g};(p=this.callbacks)==null||p.onSuccess(Te,s,t,i);return}}const S=l.loadPolicy.errorRetry,L=s.retry,F={url:t.url,data:void 0,code:g};if(Ii(S,L,!1,F))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(Ii(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=Hr(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&&ph.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 O0={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},kd=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:ou,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ni,bufferController:f0,capLevelController:p0,errorController:ur,fpsController:dd,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:O0},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},Td()),{},{subtitleStreamController:Zc,subtitleTrackController:Gc,timelineController:lh,audioStreamController:pl,audioTrackController:Xh,emeController:oo,cmcdController:Pu,contentSteeringController:hd,interstitialsController:qc});function Td(){return{cueHandler:hh,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 mh(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=Bo(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}`,L=t[S];if(L!==void 0&&y){g.push(S);const F=s[p].default;switch(t[p]={default:F},x){case"TimeOut":F.maxLoadTimeMs=L,F.maxTimeToFirstByteMs=L;break;case"MaxRetry":F.errorRetry.maxNumRetry=L,F.timeoutRetry.maxNumRetry=L;break;case"RetryDelay":F.errorRetry.retryDelayMs=L,F.timeoutRetry.retryDelayMs=L;break;case"MaxRetryTimeout":F.errorRetry.maxRetryDelayMs=L,F.timeoutRetry.maxRetryDelayMs=L;break}}}),g.length&&i.warn(`hls.js config: "${g.join('", "')}" setting(s) are deprecated, use "${p}": ${Kr(t[p])}`)}),O(O({},s),t)}function Bo(h){return h&&typeof h=="object"?Array.isArray(h)?h.map(Bo):Object.keys(h).reduce((t,i)=>(t[i]=Bo(h[i]),t),{}):h}function As(h,t){const i=h.loader;i!==mc&&i!==ou?(t.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1):zs()&&(h.loader=mc,h.progressive=!0,h.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Fo=2,gc=.1,Tl=.05,ba=100;class Cd extends nn{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(ba),this.mediaSource=i.mediaSource;const s=this.media=i.media;Wa(s,"playing",this.onMediaPlaying),Wa(s,"waiting",this.onMediaWaiting),Wa(s,"ended",this.onMediaEnded)}onMediaDetaching(t,i){this.clearInterval();const{media:s}=this;s&&(ia(s,"playing",this.onMediaPlaying),ia(s,"waiting",this.onMediaWaiting),ia(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(!Wr.getBuffered(c).length){this.nudgeRetry=0;return}const L=Wr.bufferInfo(c,t,0),F=L.nextStart||0,$=this.fragmentTracker;if(y&&$&&this.hls){const Ft=lu(this.hls.inFlightFragments,t),dt=L.len>Fo,Tt=!F||Ft||F-t>Fo&&!$.getPartialFragment(t);if(dt||Tt)return;this.moved=!1}const te=(o=this.hls)==null?void 0:o.latestLevelDetails;if(!this.moved&&this.stalled!==null&&$){if(!(L.len>0)&&!F)return;const dt=Math.max(F,L.start||0)-t,Ut=!!(te!=null&&te.live)?te.targetduration*2:Fo,bt=$.getPartialFragment(t);if(dt>0&&(dt<=Ut||bt)){c.paused||this._trySkipBufferHole(bt);return}}const Q=l.detectStallWithCurrentTimeMs,Te=self.performance.now(),Ve=this.waiting;if(p===null){Ve>0&&Te-Ve<Q?this.stalled=Ve:this.stalled=Te;return}const $e=Te-p;if(!y&&($e>=Q||Ve)&&this.hls){var ht;if(((ht=this.mediaSource)==null?void 0:ht.readyState)==="ended"&&!(te!=null&&te.live)&&Math.abs(t-((te==null?void 0:te.edge)||0))<1){if(this.ended)return;this.ended=t||1,this.hls.trigger(E.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(L),!this.media||!this.hls)return}const mt=Wr.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=Wr.bufferedInfo(Wr.timeRangesToArray(this.buffered.audio),t,0);if(l.len>1&&i>=l.start){const c=Wr.timeRangesToArray(o),p=Wr.bufferedInfo(c,i,0).bufferedIndex;if(p>-1&&p<c.length-1){const y=Wr.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 L=this.fragmentTracker.getPartialFragment(t)||void 0,F=Wr.bufferInfo(this.media,t,0);this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:re.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:S,reason:S.message,frag:L,buffer:F.len,bufferInfo:F})}}}}}_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 (${Kr(t)})`);this.warn(c.message),i.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:re.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=Wr.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,L=y-c;if(L>0&&(x||S)){if(L>l.maxBufferHole){let $=!1;if(c===0){const te=s.getAppendedFrag(0,N.MAIN);te&&y<te.end&&($=!0)}if(!$){const te=t||s.getAppendedFrag(c,N.MAIN);if(te){var g;if(!((g=this.hls.loadLevelObj)!=null&&g.details)||lu(this.hls.inFlightFragments,y))return 0;let Te=!1,Ve=te.end;for(;Ve<y;){const $e=s.getPartialFragment(Ve);if($e)Ve+=$e.duration;else{Te=!0;break}}if(Te)return 0}}}const F=Math.max(y+Tl,c+gc);if(this.warn(`skipping hole, adjusting currentTime from ${c} to ${F}`),this.moved=!0,o.currentTime=F,!(t!=null&&t.gap)){const $=new Error(`fragment loaded with buffer holes, seeking from ${c} to ${F}`);this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:re.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:$,reason:$.message,frag:t||void 0,buffer:p.len,bufferInfo:p})}return F}}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:Me.MEDIA_ERROR,details:re.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:Me.MEDIA_ERROR,details:re.BUFFER_STALLED_ERROR,error:p,fatal:!0,buffer:t.len,bufferInfo:t})}}}function lu(h,t){const i=uu(h.main);if(i&&i.start<=t)return i;const s=uu(h.audio);return s&&s.start<=t?s:null}function uu(h){if(!h)return null;switch(h.state){case Vt.IDLE:case Vt.STOPPED:case Vt.ENDED:case Vt.ERROR:return null}return h.frag}const gh=.25;function vc(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Uu(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,Kr(o?O({type:o},s):s))}return l}const B0=(()=>{const h=vc();try{h&&new h(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Dd(h){return Uint8Array.from(h.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Md{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&&bl(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 Hc(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=vc();if(c)for(let p=0;p<l.length;p++){const y=l[p].type;if(y===ke.emsg&&!s||!o)continue;const g=ll(l[p].data);if(g){const x=l[p].pts;let S=x+l[p].duration;S>B0&&(S=B0),S-x<=0&&(S=x+gh);for(let F=0;F<g.length;F++){const $=g[F];if(!pa($)){this.updateId3CueEnds(x,y);const te=Uu(c,x,S,$,y);te&&this.id3Track.addCue(te)}}}}}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===B0&&(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===ke.audioId3&&y:o==="video"?g=x=>x.type===ke.emsg&&p:g=x=>x.type===ke.audioId3&&y||x.type===ke.emsg&&p,ru(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 L=x[S],F=c[L].cues;delete c[L],Object.keys(F).forEach($=>{try{const te=F[$];te.removeEventListener("enter",this.onEventCueEnter),s.removeCue(te)}catch(te){}})}}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=vc();for(let x=0;x<l.length;x++){const S=l[x],L=o[S],F=L.startTime,$=c[S],te=($==null?void 0:$.cues)||{};let Q=($==null?void 0:$.durationKnown)||!1,Te=B0;const{duration:Ve,endDate:$e}=L;if($e&&Ve!==null)Te=F+Ve,Q=!0;else if(L.endOnNext&&!Q){const mt=l.reduce((Ft,dt)=>{if(dt!==L.id){const Tt=o[dt];if(Tt.class===L.class&&Tt.startDate>L.startDate&&(!Ft||L.startDate<Ft.startDate))return Tt}return Ft},null);mt&&(Te=mt.startTime,Q=!0)}const ht=Object.keys(L.attr);for(let mt=0;mt<ht.length;mt++){const Ft=ht[mt];if(!_s(Ft))continue;const dt=te[Ft];if(dt)Q&&!$.durationKnown?dt.endTime=Te:Math.abs(dt.startTime-F)>.01&&(dt.startTime=F,dt.endTime=Te);else if(g){let Tt=L.attr[Ft];ir(Ft)&&(Tt=Dd(Tt));const bt=Uu(g,F,Te,{key:Ft,data:Tt},ke.dateRange);bt&&(bt.id=S,this.id3Track.addCue(bt),te[Ft]=bt,this.hls.config.interstitialsController&&(Ft==="X-ASSET-LIST"||Ft==="X-ASSET-URL")&&bt.addEventListener("enter",this.onEventCueEnter))}}c[S]={cues:te,dateRange:L,durationKnown:Q}}}}class Ku{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)),L=Math.round(2/(1+Math.exp(-.75*y-this.edgeStalled))*20)/20,F=Math.min(S,Math.max(1,L));this.changeMediaPlaybackRate(i,F)}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===re.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 Hu extends Co{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 L=x.attrs;let{audioCodec:F,videoCodec:$}=x;F&&(x.audioCodec=F=Ae(F,s)||void 0),((S=$)==null?void 0:S.indexOf("avc1"))===0&&($=x.videoCodec=ei($));const{width:te,height:Q,unknownCodecs:Te}=x;let Ve=Te?Te.length:0;if(Te)for(let fr=Ve;fr--;){const vr=Te[fr];this.isAudioSupported(vr)?(x.audioCodec=F=F?`${F},${vr}`:vr,Ve--,Sr.audio[F.substring(0,4)]=2):this.isVideoSupported(vr)&&(x.videoCodec=$=$?`${$},${vr}`:vr,Ve--,Sr.video[$.substring(0,4)]=2)}if(p||(p=!!(te&&Q)),y||(y=!!$),g||(g=!!F),Ve||F&&!this.isAudioSupported(F)||$&&!this.isVideoSupported($)){this.log(`Some or all CODECS not supported "${L.CODECS}"`);return}const{CODECS:$e,"FRAME-RATE":ht,"HDCP-LEVEL":mt,"PATHWAY-ID":Ft,RESOLUTION:dt,"VIDEO-RANGE":Tt}=L,bt=`${`${Ft||"."}-`}${x.bitrate}-${dt}-${ht}-${$e}-${Tt}-${mt}`;if(l[bt])if(l[bt].uri!==x.url&&!x.attrs["PATHWAY-ID"]){const fr=c[bt]+=1;x.attrs["PATHWAY-ID"]=new Array(fr+1).join(".");const vr=this.createLevel(x);l[bt]=vr,o.push(vr)}else l[bt].addGroupId("audio",L.AUDIO),l[bt].addGroupId("text",L.SUBTITLES);else{const fr=this.createLevel(x);l[bt]=fr,c[bt]=1,o.push(fr)}}),this.filterAndSortMediaOptions(o,i,p,y,g)}createLevel(t){const i=new Fr(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:Q,videoRange:Te,width:Ve,height:$e})=>(!!Q||!!(Ve&&$e))&&Pr(Te))),y.length===0){Promise.resolve().then(()=>{if(this.hls){let Q="no level with compatible codecs found in manifest",Te=Q;i.levels.length&&(Te=`one or more CODECS in variant not supported: ${Kr(i.levels.map($e=>$e.attrs.CODECS).filter(($e,ht,mt)=>mt.indexOf($e)===ht))}`,this.warn(Te),Q+=` (${Te})`);const Ve=new Error(Q);this.hls.trigger(E.ERROR,{type:Me.MEDIA_ERROR,details:re.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,error:Ve,reason:Te})}});return}i.audioTracks&&(c=i.audioTracks.filter(Q=>!Q.audioCodec||this.isAudioSupported(Q.audioCodec)),F0(c)),i.subtitles&&(p=i.subtitles,F0(p));const g=y.slice(0);y.sort((Q,Te)=>{if(Q.attrs["HDCP-LEVEL"]!==Te.attrs["HDCP-LEVEL"])return(Q.attrs["HDCP-LEVEL"]||"")>(Te.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&Q.height!==Te.height)return Q.height-Te.height;if(Q.frameRate!==Te.frameRate)return Q.frameRate-Te.frameRate;if(Q.videoRange!==Te.videoRange)return Qt.indexOf(Q.videoRange)-Qt.indexOf(Te.videoRange);if(Q.videoCodec!==Te.videoCodec){const Ve=ge(Q.videoCodec),$e=ge(Te.videoCodec);if(Ve!==$e)return $e-Ve}if(Q.uri===Te.uri&&Q.codecSet!==Te.codecSet){const Ve=Ee(Q.codecSet),$e=Ee(Te.codecSet);if(Ve!==$e)return $e-Ve}return Q.averageBitrate!==Te.averageBitrate?Q.averageBitrate-Te.averageBitrate:0});let x=g[0];if(this.steering&&(y=this.steering.filterParsedLevels(y),y.length!==g.length)){for(let Q=0;Q<g.length;Q++)if(g[Q].pathwayId===y[0].pathwayId){x=g[Q];break}}this._levels=y;for(let Q=0;Q<y.length;Q++)if(y[Q]===x){var S;this._firstLevel=Q;const Te=x.bitrate,Ve=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${y.length} level(s) found, first bitrate: ${Te}`),((S=this.hls.userConfig)==null?void 0:S.abrEwmaDefaultEstimate)===void 0){const $e=Math.min(Te,this.hls.config.abrEwmaDefaultEstimateMax);$e>Ve&&Ve===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=$e)}break}const L=l&&!o,F=this.hls.config,$=!!(F.audioStreamController&&F.audioTrackController),te={levels:y,audioTracks:c,subtitleTracks:p,sessionData:i.sessionData,sessionKeys:i.sessionKeys,firstLevel:this._firstLevel,stats:i.stats,audio:l,video:o,altAudio:$&&!L&&c.some(Q=>!!Q.url)};this.hls.trigger(E.MANIFEST_PARSED,te)}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:Me.OTHER_ERROR,details:re.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===Re.LEVEL&&i.context.level===this.level&&this.checkRetry(i)}onFragBuffered(t,{frag:i}){if(i!==void 0&&i.type===N.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));za(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 F0(h){const t={};h.forEach(i=>{const s=i.groupId||"";i.id=t[s]=t[s]||0,t[s]++})}function No(){return self.SourceBuffer||self.WebKitSourceBuffer}function co(){if(!Ye())return!1;const t=No();return!t||t.prototype&&typeof t.prototype.appendBuffer=="function"&&typeof t.prototype.remove=="function"}function Ld(){if(!co())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 vh(){var h;const t=No();return typeof(t==null||(h=t.prototype)==null?void 0:h.changeType)=="function"}const yc=100;class yh extends ro{constructor(t,i,s){super(t,i,s,"stream-controller",N.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,N.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(yc),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=Vt.IDLE,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=i?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=Vt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Vt.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=Vt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Vt.IDLE;break}break}case Vt.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=Vt.IDLE}}break}this.state===Vt.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 te={};this.altAudio===2&&(te.type="video"),this.hls.trigger(E.BUFFER_EOS,te),this.state=Vt.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===Vt.WAITING_LEVEL||this.waitForLive(c)){this.level=l,this.state=Vt.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 L=this.backtrackFragment?this.backtrackFragment.start:p.end;let F=this.getNextFragment(L,g);if(this.couldBacktrack&&!this.fragPrevious&&F&&be(F)&&this.fragmentTracker.getState(F)!==qr.OK){var $;const Q=(($=this.backtrackFragment)!=null?$:F).sn-g.startSN,Te=g.fragments[Q-1];Te&&F.cc===Te.cc&&(F=Te,this.fragmentTracker.removeFragment(Te))}else this.backtrackFragment&&p.len&&(this.backtrackFragment=null);if(F&&this.isLoopLoading(F,L)){if(!F.gap){const Q=this.audioOnly&&!this.altAudio?M.AUDIO:M.VIDEO,Te=(Q===M.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Te&&this.afterBufferFlushed(Te,Q,N.MAIN)}F=this.getNextFragmentLoopLoading(F,g,p,N.MAIN,S)}F&&(F.initSegment&&!F.initSegment.data&&!this.bitrateTest&&(F=F.initSegment),this.loadFragment(F,c,L))}loadFragment(t,i,s){const o=this.fragmentTracker.getState(t);o===qr.NOT_LOADED||o===qr.PARTIAL?be(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,N.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 Vt.KEY_LOADING:case Vt.FRAG_LOADING:case Vt.FRAG_LOADING_WAITING_RETRY:case Vt.PARSING:case Vt.PARSED:this.state=Vt.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;Wa(s,"playing",this.onMediaPlaying),Wa(s,"seeked",this.onMediaSeeked)}onMediaDetaching(t,i){const{media:s}=this;s&&(ia(s,"playing",this.onMediaPlaying),ia(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&&!vh(),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!==Vt.IDLE)return;const o=i.levelInfo;(!o.details||o.details.live&&(this.levelLastLoaded!==o||o.details.expired)||this.waitForCdnTuneIn(o.details))&&(this.state=Vt.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===Vt.FRAG_LOADING||this.state===Vt.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 L;if(this.checkLiveUpdate(p),p.deltaUpdateFailed)return;S=this.alignPlaylists(p,g.details,(L=this.levelLastLoaded)==null?void 0:L.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===Vt.WAITING_LEVEL){if(this.waitForCdnTuneIn(p))return;this.state=Vt.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,L=this._getAudioCodec(p),F=this.transmuxer=this.transmuxer||new dl(this.hls,N.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=o?o.index:-1,te=$!==-1,Q=new On(s.level,s.sn,s.stats.chunkCount,l.byteLength,$,te),Te=this.initPTS[s.cc];F.push(l,S,L,g,s,o,y.totalduration,x,Q,Te)}onAudioTrackSwitching(t,i){const s=this.hls,o=this.altAudio===2;if(mr(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=mr(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===N.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===Vt.PARSED&&(this.state=Vt.IDLE);return}const p=o?o.stats:s.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),be(s)&&(this.fragPrevious=s),this.fragBufferedComplete(s,o)}const c=this.media;c&&(!this._hasEnoughToStart&&Wr.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=Vt.ERROR;return}switch(i.details){case re.FRAG_GAP:case re.FRAG_PARSING_ERROR:case re.FRAG_DECRYPT_ERROR:case re.FRAG_LOAD_ERROR:case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_ERROR:case re.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(N.MAIN,i);break;case re.LEVEL_LOAD_ERROR:case re.LEVEL_LOAD_TIMEOUT:case re.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===Vt.WAITING_LEVEL&&((s=i.context)==null?void 0:s.type)===Re.LEVEL&&(this.state=Vt.IDLE);break;case re.BUFFER_ADD_CODEC_ERROR:case re.BUFFER_APPEND_ERROR:if(i.parent!=="main")return;this.resetLoadingState();break;case re.BUFFER_FULL_ERROR:if(i.parent!=="main")return;this.reduceLengthAndFlushBuffer(i)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case re.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onFragLoadEmergencyAborted(){this.state=Vt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:i}){if(i!==M.AUDIO||!this.altAudio){const s=(i===M.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;s&&(this.afterBufferFlushed(s,i,N.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=Wr.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=Vt.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:L,id3:F,initSegment:$}=l,{details:te}=x,Q=this.altAudio?void 0:l.audio;if(this.fragContextChanged(y)){this.fragmentTracker.removeFragment(y);return}if(this.state=Vt.PARSING,$){if($!=null&&$.tracks){const $e=y.initSegment||y;this._bufferInitSegment(x,$.tracks,$e,c),o.trigger(E.FRAG_PARSING_INIT_SEGMENT,{frag:$e,id:s,tracks:$.tracks})}const Te=$.initPTS,Ve=$.timescale;pe(Te)&&(this.initPTS[y.cc]={baseTime:Te,timescale:Ve},o.trigger(E.INIT_PTS_FOUND,{frag:y,id:s,initPTS:Te,timescale:Ve}))}if(S&&te){!Q&&S.type==="audiovideo"&&this.logMuxedErr(y);const Te=te.fragments[y.sn-1-te.startSN],Ve=y.sn===te.startSN,$e=!Te||y.cc>Te.cc;if(l.independent!==!1){const{startPTS:ht,endPTS:mt,startDTS:Ft,endDTS:dt}=S;if(g)g.elementaryStreams[S.type]={startPTS:ht,endPTS:mt,startDTS:Ft,endDTS:dt};else if(S.firstKeyFrame&&S.independent&&c.id===1&&!$e&&(this.couldBacktrack=!0),S.dropped&&S.independent){const Tt=this.getMainFwdBufferInfo(),Ut=(Tt?Tt.end:this.getLoadPosition())+this.config.maxBufferHole,bt=S.firstKeyFramePTS?S.firstKeyFramePTS:ht;if(!Ve&&Ut<bt-this.config.maxBufferHole&&!$e){this.backtrack(y);return}else $e&&(y.gap=!0);y.setElementaryStreamInfo(S.type,y.start,mt,y.start,dt,!0)}else Ve&&ht-(te.appliedTimelineOffset||0)>Fo&&(y.gap=!0);y.setElementaryStreamInfo(S.type,ht,mt,Ft,dt),this.backtrackFragment&&(this.backtrackFragment=y),this.bufferFragmentData(S,y,g,c,Ve||$e)}else if(Ve||$e)y.gap=!0;else{this.backtrack(y);return}}if(Q){const{startPTS:Te,endPTS:Ve,startDTS:$e,endDTS:ht}=Q;g&&(g.elementaryStreams[M.AUDIO]={startPTS:Te,endPTS:Ve,startDTS:$e,endDTS:ht}),y.setElementaryStreamInfo(M.AUDIO,Te,Ve,$e,ht),this.bufferFragmentData(Q,y,g,c)}if(te&&F!=null&&(i=F.samples)!=null&&i.length){const Te={id:s,frag:y,details:te,samples:F.samples};o.trigger(E.FRAG_PARSING_METADATA,Te)}if(te&&L){const Te={id:s,frag:y,details:te,samples:L.samples};o.trigger(E.FRAG_PARSING_USERDATA,Te)}}logMuxedErr(t){this.warn(`${be(t)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${t.url}`)}_bufferInitSegment(t,i,s,o){if(this.state!==Vt.PARSING)return;this.audioOnly=!!i.audio&&!i.video,this.altAudio&&!this.audioOnly&&(delete i.audio,i.audiovideo&&this.logMuxedErr(s));const{audio:l,video:c,audiovideo:p}=i;if(l){let g=yr(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=N.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=N.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,N.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=Vt.IDLE}checkFragmentChanged(){const t=this.media;let i=null;if(t&&t.readyState>1&&t.seeking===!1){const s=t.currentTime;if(Wr.isBuffered(t,s)?i=this.getAppendedFrag(s):Wr.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?kr(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 Rd{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=re.KEY_LOAD_ERROR,s,o,l){return new bn({type:Me.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,re.KEY_LOAD_ERROR,g))}const c=l.uri;if(!c)return Promise.reject(this.createKeyLoadError(t,re.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,re.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:(L,F,$,te)=>{const{frag:Q,keyInfo:Te,url:Ve}=$;if(!Q.decryptdata||Te!==this.keyUriToKeyInfo[Ve])return p(this.createKeyLoadError(Q,re.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),te));Te.decryptdata.key=Q.decryptdata.key=new Uint8Array(L.data),Q.keyLoader=null,Te.loader=null,c({frag:Q,keyInfo:Te})},onError:(L,F,$,te)=>{this.resetLoader(F),p(this.createKeyLoadError(i,re.KEY_LOAD_ERROR,new Error(`HTTP Error ${L.code} loading key ${L.text}`),$,O({url:y.url,data:void 0},L)))},onTimeout:(L,F,$)=>{this.resetLoader(F),p(this.createKeyLoadError(i,re.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),$))},onAbort:(L,F,$)=>{this.resetLoader(F),p(this.createKeyLoadError(i,re.INTERNAL_ABORTED,new Error("key loading aborted"),$))}};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 bh(h){const{type:t}=h;switch(t){case Re.AUDIO_TRACK:return N.AUDIO;case Re.SUBTITLE_TRACK:return N.SUBTITLE;default:return N.MAIN}}function bc(h,t){let i=h.url;return(i===void 0||i.indexOf("data:")===0)&&(i=t.url),i}class Id{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:Re.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:Re.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:Re.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:Re.SUBTITLE_TRACK,url:l,deliveryDirectives:c,levelOrTrack:p})}onLevelsUpdated(t,i){const s=this.loaders[Re.LEVEL];if(s){const o=s.context;o&&!i.levels.some(l=>l===o.levelOrTrack)&&(s.abort(),delete this.loaders[Re.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===Re.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===Re.LEVEL&&t.level!==null?g=this.hls.levels[t.level].details:t.type===Re.AUDIO_TRACK&&t.id!==null?g=this.hls.audioTracks[t.id].details:t.type===Re.SUBTITLE_TRACK&&t.id!==null&&(g=this.hls.subtitleTracks[t.id].details),g){const x=g.partTarget,S=g.targetduration;if(x&&S){const L=Math.max(x*3,S*.8)*1e3;l=k({},l,{maxTimeToFirstByteMs:Math.min(L,l.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(L,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,L)=>{const F=this.getInternalLoader(S);this.resetInternalLoader(S.type);const $=g.data;if($.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(g,S,new Error("no EXTM3U delimiter"),L||null,x);return}x.parsing.start=performance.now(),xn.isMediaPlaylist($)||S.type!==Re.MANIFEST?this.handleTrackOrLevelPlaylist(g,x,S,L||null,F):this.handleMasterPlaylist(g,x,S,L)},onError:(g,x,S,L)=>{this.handleNetworkError(x,S,!1,g,L)},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=bc(t,s),y=xn.parseMasterPlaylist(c,p);if(y.playlistParsingError){this.handleManifestParsingError(t,s,y.playlistParsingError,o,i);return}const{contentSteering:g,levels:x,sessionData:S,sessionKeys:L,startTimeOffset:F,variableList:$}=y;this.variableList=$;const{AUDIO:te=[],SUBTITLES:Q,"CLOSED-CAPTIONS":Te}=xn.parseMasterPlaylistMedia(c,p,y);te.length&&!te.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"),te.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:te,subtitles:Q,captions:Te,contentSteering:g,url:p,stats:i,networkDetails:o,sessionData:S,sessionKeys:L,startTimeOffset:F,variableList:$})}handleTrackOrLevelPlaylist(t,i,s,o,l){const c=this.hls,{id:p,level:y,type:g}=s,x=bc(t,s),S=pe(y)?y:pe(p)?p:0,L=bh(s),F=xn.parseLevelPlaylist(t.data,x,S,L,0,this.variableList);if(g===Re.MANIFEST){const $={attrs:new pi({}),bitrate:0,details:F,name:"",url:x};F.requestScheduled=i.loading.start+$a(F,0),c.trigger(E.MANIFEST_LOADED,{levels:[$],audioTracks:[],url:x,stats:i,networkDetails:o,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}i.parsing.end=performance.now(),s.levelDetails=F,this.handlePlaylistLoaded(F,t,i,s,o,l)}handleManifestParsingError(t,i,s,o,l){this.hls.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:re.MANIFEST_PARSING_ERROR,fatal:i.type===Re.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===Re.LEVEL?c+=`: ${t.level} id: ${t.id}`:(t.type===Re.AUDIO_TRACK||t.type===Re.SUBTITLE_TRACK)&&(c+=` id: ${t.id} group-id: "${t.groupId}"`);const p=new Error(c);this.hls.logger.warn(`[playlist-loader]: ${c}`);let y=re.UNKNOWN,g=!1;const x=this.getInternalLoader(t);switch(t.type){case Re.MANIFEST:y=s?re.MANIFEST_LOAD_TIMEOUT:re.MANIFEST_LOAD_ERROR,g=!0;break;case Re.LEVEL:y=s?re.LEVEL_LOAD_TIMEOUT:re.LEVEL_LOAD_ERROR,g=!1;break;case Re.AUDIO_TRACK:y=s?re.AUDIO_TRACK_LOAD_TIMEOUT:re.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case Re.SUBTITLE_TRACK:y=s?re.SUBTITLE_TRACK_LOAD_TIMEOUT:re.SUBTITLE_LOAD_ERROR,g=!1;break}x&&this.resetInternalLoader(t.type);const S={type:Me.NETWORK_ERROR,details:y,fatal:g,url:t.url,loader:x,context:t,error:p,networkDetails:i,stats:l};if(o){const L=(i==null?void 0:i.url)||t.url;S.response=O({url:L,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:L}=o,F=bc(i,o),$=bh(o),te=typeof o.level=="number"&&$===N.MAIN?g:void 0;if(!t.fragments.length){const Te=t.playlistParsingError=new Error("No Segments found in Playlist");p.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:re.LEVEL_EMPTY_ERROR,fatal:!1,url:F,error:Te,reason:Te.message,response:i,context:o,level:te,parent:$,networkDetails:l,stats:s});return}t.targetduration||(t.playlistParsingError=new Error("Missing Target Duration"));const Q=t.playlistParsingError;if(Q){if(this.hls.logger.warn(Q),!p.config.ignorePlaylistParsingErrors){p.trigger(E.ERROR,{type:Me.NETWORK_ERROR,details:re.LEVEL_PARSING_ERROR,fatal:!1,url:F,error:Q,reason:Q.message,response:i,context:o,level:te,parent:$,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 Re.MANIFEST:case Re.LEVEL:p.trigger(E.LEVEL_LOADED,{details:t,levelInfo:o.levelOrTrack||p.levels[0],level:te||0,id:x||0,stats:s,networkDetails:l,deliveryDirectives:L,withoutMultiVariant:y===Re.MANIFEST});break;case Re.AUDIO_TRACK:p.trigger(E.AUDIO_TRACK_LOADED,{details:t,track:o.levelOrTrack,id:x||0,groupId:S||"",stats:s,networkDetails:l,deliveryDirectives:L});break;case Re.SUBTITLE_TRACK:p.trigger(E.SUBTITLE_TRACK_LOADED,{details:t,track:o.levelOrTrack,id:x||0,groupId:S||"",stats:s,networkDetails:l,deliveryDirectives:L});break}}}class $o{static get version(){return Ka}static isMSESupported(){return co()}static isSupported(){return Ld()}static getMediaSource(){return Ye()}static get Events(){return E}static get MetadataSchema(){return ke}static get ErrorTypes(){return Me}static get ErrorDetails(){return re}static get DefaultConfig(){return $o.defaultConfig?$o.defaultConfig:kd}static set DefaultConfig(t){$o.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 el,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=mh($o.DefaultConfig,t,i);this.userConfig=t,s.progressive&&As(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 on(this),L=s.interstitialsController,F=L?this.interstitialsController=new L(this,$o):null,$=this.bufferController=new l(this,S),te=this.capLevelController=new c(this),Q=new y(this),Te=new Id(this),Ve=s.contentSteeringController,$e=Ve?new Ve(this):null,ht=this.levelController=new Hu(this,$e),mt=new Md(this),Ft=new Rd(this.config),dt=this.streamController=new yh(this,S,Ft),Tt=this.gapController=new Cd(this,S);te.setStreamController(dt),Q.setStreamController(dt);const Ut=[Te,ht,dt];F&&Ut.splice(1,0,F),$e&&Ut.splice(1,0,$e),this.networkControllers=Ut;const bt=[x,$,Tt,te,Q,mt,S];this.audioTrackController=this.createController(s.audioTrackController,Ut);const fr=s.audioStreamController;fr&&Ut.push(this.audioStreamController=new fr(this,S,Ft)),this.subtitleTrackController=this.createController(s.subtitleTrackController,Ut);const vr=s.subtitleStreamController;vr&&Ut.push(this.subtititleStreamController=new vr(this,S,Ft)),this.createController(s.timelineController,bt),Ft.emeController=this.emeController=this.createController(s.emeController,bt),this.cmcdController=this.createController(s.cmcdController,bt),this.latencyController=this.createController(Ku,bt),this.coreComponents=bt,Ut.push(g);const Ji=g.onErrorOut;typeof Ji=="function"&&this.on(E.ERROR,Ji,g),this.on(E.MANIFEST_LOADED,Te.onManifestLoaded,Te)}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:Me.OTHER_ERROR,details:re.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:Me.OTHER_ERROR,details:re.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=Se.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={[N.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[N.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[N.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=Eu()),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){ar(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=Br(i);return ct(t,s,navigator.mediaCapabilities)}}$o.defaultConfig=void 0},48136:function($r,It,X){"use strict";var pe=Object.defineProperty,Pe=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,re=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,Re=(e,r,n)=>r in e?pe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,N=(e,r)=>{for(var n in r||(r={}))re.call(r,n)&&Re(e,n,r[n]);if(Me)for(var n of Me(r))E.call(r,n)&&Re(e,n,r[n]);return e},d=(e,r)=>Pe(e,rt(r)),xe=e=>typeof e=="symbol"?e:e+"",q=(e,r)=>{var n={};for(var a in e)re.call(e,a)&&r.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&Me)for(var a of Me(e))r.indexOf(a)<0&&E.call(e,a)&&(n[a]=e[a]);return n};function k(e){return Array.isArray(e)}var I={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 H(){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 j(){return HTMLElement.prototype.hasOwnProperty("popover")}var Y={strings:I,_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]=N(N({},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 R=v[2]?parseInt(v[2],10)-1:A-1;let z=r[R];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"},le={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,R,z,J=255,_e=255,Ie=255,ze=-1;const St=A.length>0&&A[0].startsWith("-");St&&(A[0]=A[0].slice(1));for(let nr=0;nr<A.length;nr++){C=J,R=_e,z=Ie;const xt=(r=A[nr].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:le[xt])!=null?u:We[xt])!=null?f:ee[xt])!=null?v:A[nr].trim();let Zt=hr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Zt!=null&&Zt[1]&&Zt[2]&&Zt[3])J=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),jr=Number.parseInt(Zt[1][2],16);J=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,jr*16+jr))}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])J=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&&(J=(1-ze)*J+ze*C,_e=(1-ze)*_e+ze*R,Ie=(1-ze)*Ie+ze*z,ze=-1),nr+1<A.length&&(ze=Math.max(0,Math.min(100,Number.parseInt(A[++nr])))/100)}return ze>=0&&(J=ze*J+(1-ze)*C,_e=ze*_e+(1-ze)*R,Ie=ze*Ie+(1-ze)*z),St&&(J=255-J,_e=255-_e,Ie=255-Ie),"#"+("00"+Math.round(J).toString(16)).slice(-2)+("00"+Math.round(_e).toString(16)).slice(-2)+("00"+Math.round(Ie).toString(16)).slice(-2)}function gt(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 ie(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*ie(f,u,r+2)),g:Math.round(255*ie(f,u,r)),b:Math.round(255*ie(f,u,r-2))}}function he(e){return e<0?0:e>255?255:Math.round(e)}function Le(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 Se(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 R=(u+f)/2;return f===u?C=0:R<=.5?C=v/(f+u):C=v/(2-f-u),{h:A,s:C,l:R}}function D(e){let r=de(e);if(!r)return e;let{h:n,s:a,l:u}=Se(r);return a+=.1,u-=.1,Le(ce({h:n,s:a,l:u}))}var M={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"},ne={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},be=[{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 st(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 be)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(ne[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 ne)if(ne[n]===e){e=(r=n.codePointAt(0))!=null?r:0;break}for(const n of be)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=M[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 sr={},jt=N({},M),Pt={},Cr={},zr={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}"},rr={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}},Ur={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:Ur},"amsmath.sty":{package:rr,primitive:!0},"texvc.sty":{package:zr,primitive:!1}},Vr={" ":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&&(sr[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=Cr[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 Pt)v.startsWith(r)&&!Pt[v].infix&&u.push({match:v,frequency:(n=Pt[v].frequency)!=null?n:0});for(const v in sr)v.startsWith(r)&&u.push({match:v,frequency:(a=sr[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,R;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)-((R=v.frequency)!=null?R: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 Gt(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 dr(e,r){typeof e=="string"&&(e=[e]);const n={tabular:!1,params:[],createAtom:r};for(const a of e)Cr[a]=n}function Jt(e,r,n){typeof e=="string"&&(e=[e]);const u={tabular:!0,params:wt(r),createAtom:n};for(const f of e)Cr[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")Pt["\\"+e]=f;else for(const v of e)Pt["\\"+v]=f}var Kt;function wr(e){return Kt||(Kt=Ge(li)),e?Ge(N(N({},Kt),e)):Kt}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 N({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=Pt[e],n)return!n.ifMode||n.ifMode===r?n:null;r==="math"?n=sr[e]:Vr[e]&&(n={definitionType:"symbol",type:"mord",codepoint:Vr[e]})}else if(r==="math"){if(n=sr[e],!n&&e.length===1){const a=kt("math",e.codePointAt(0));return a.startsWith("\\")?d(N({},it(a,"math")),{command:a}):null}}else Vr[e]?n={definitionType:"symbol",type:"mord",codepoint:Vr[e]}:r==="text"&&(n={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return n!=null?n:null}function Rt(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(Vr).find(a=>Vr[a]===r);return n||String.fromCodePoint(r)}return String.fromCodePoint(r)}var zt=[0,.68889,0,0,.72222],tr=[0,.68889,0,0,.66667],T=[0,.68889,0,0,.77778],B=[0,.68889,0,0,.61111],ft=[.16667,.68889,0,0,.77778],G=[0,.68889,0,0,.55556],fe=[0,0,0,0,.25],Sr=[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],Ee=[.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],Xt=[.19444,.69224,0,0,.41667],yr=[.1808,.675,0,0,1],ei=[.19444,.69224,0,0,.83334],Li=[.13667,.63667,0,0,1],ui=[-.064,.437,0,0,1.334],Er=[.08167,.58167,0,0,.77778],yi=[0,.69224,0,0,.72222],me=[0,.69224,0,0,.66667],Ce=[-.13313,.36687,0,0,.77778],Mt=[.06062,.54986,0,0,.77778],ct=[0,.69224,0,0,.77778],Et=[.25583,.75583,0,0,.77778],Nt=[.25142,.75726,0,0,.77778],ar=[.20576,.70576,0,0,.77778],Qt=[.30274,.79383,0,0,.77778],Pr=[.22958,.72958,0,0,.77778],Ar=[.1808,.675,0,0,.77778],oi=[.13667,.63667,0,0,.77778],Lr=[.13597,.63597,0,0,.77778],Fr=[.03517,.54986,0,0,.77778],ii=[0,.675,0,0,.77778],bi=[.19444,.69224,0,0,.61111],Fi=[0,.54986,0,0,.76042],mi=[0,.54986,0,0,.66667],Kr=[.0391,.5391,0,0,.77778],Hi=[.03517,.54986,0,0,1.33334],Yr=[.38569,.88569,0,0,.77778],Br=[.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],pt=[.11111,.69224,0,0,.66667],Ht=[.26167,.75726,0,0,.77778],Bt=[.48256,.98256,0,0,.77778],lr=[.28481,.79383,0,0,.77778],Dr=[.08167,.58167,0,0,.22222],mr=[.08167,.58167,0,0,.38889],ni=[0,.43056,.04028,0,.66667],ci=[.41951,.91951,0,0,.77778],gi=[.24982,.74947,0,0,.38865],kr=[.08319,.58283,0,0,.75623],Rr=[0,.10803,0,0,.27764],Si=[0,.47534,0,0,.50181],Ei=[.18906,.47534,0,0,.50181],Xr=[0,.69141,0,0,.50181],ti=[.24982,.74947,0,0,.27764],ri=[0,.69141,0,0,.21471],si=[.25,.75,0,0,.44722],Hr=[0,.64444,0,0,.575],fi=[.08556,.58556,0,0,.89444],Ii=[0,.69444,0,0,.89444],Ci=[0,.68611,0,0,.9],Tr=[0,.68611,0,0,.86944],je=[.25,.75,0,0,.575],ur=[.25,.75,0,0,.31944],br=[0,.69444,0,0,.63889],qr=[0,.69444,0,0,.31944],on=[0,.44444,0,0,.63889],vi=[0,.44444,0,0,.51111],Ni=[0,.69444,0,0,.575],Gr=[.13333,.63333,0,0,.89444],gn=[0,.44444,0,0,.31944],wn=[0,.69444,0,0,.86944],Gi=[0,.68611,0,0,.69166],ts=[0,.68611,0,0,.83055],Xn=[0,.68611,0,0,.89444],zn=[0,.69444,0,0,.60278],Vn=[.19444,.69444,0,0,.51111],Or=[0,.69444,0,0,.83055],Ai=[-.10889,.39111,0,0,1.14999],Ui=[.19444,.69444,0,0,.575],Vi=[.19444,.69444,0,0,1.14999],Wn=[.19444,.69444,0,0,.70277],bn=[.05556,.75,0,0,.575],nn=[0,.68611,0,0,.95833],On=[.08556,.58556,0,0,.76666],$i=[-.02639,.47361,0,0,.575],rs=[0,.44444,0,0,.89444],Wr=[0,.55556,0,0,.76666],ss=[-.10889,.39111,0,0,.89444],Jn=[.00222,.50222,0,0,.89444],Sn=[.19667,.69667,0,0,.89444],Ri=[.08556,.58556,0,0,1.14999],ps=[0,.69444,0,0,.70277],ys=[-.02778,.47222,0,0,.575],us=[.25,.75,0,0,.51111],pi=[-.13889,.36111,0,0,1.14999],bs=[.19444,.69444,0,0,1.02222],_s=[.12963,.69444,0,0,.89444],ir=[.19444,.69444,0,0,.44722],vn=[0,.64444,.13167,0,.59111],xs=[.19444,.64444,.13167,0,.59111],cs=[0,.68611,.17208,0,.8961],hn=[.19444,.44444,.105,0,.53222],dn=[0,.44444,.085,0,.82666],Oi=[0,.69444,.06709,0,.59111],sn=[0,.69444,.12945,0,.35555],Un=[0,.69444,0,0,.94888],jn=[0,.69444,.11472,0,.59111],Bn=[0,.68611,.10778,0,.88555],kn=[0,.69444,.07939,0,.62055],Pi=[0,.69444,.12417,0,.30667],_i=[0,.64444,.13556,0,.51111],Di=[.19444,.64444,.13556,0,.51111],ln=[0,.68333,.16389,0,.74333],Tn=[.19444,.43056,.08847,0,.46],Qn=[0,.43056,.07514,0,.71555],Ir=[0,.69444,.06646,0,.51111],Jr=[0,.69444,0,0,.83129],_n=[0,.69444,.1225,0,.51111],In=[0,.68333,.09403,0,.76666],Qi=[0,.68333,.11111,0,.76666],Ks=[0,.69444,.06961,0,.51444],hs=[0,.69444,0,0,.27778],ws=[.25,.75,0,0,.38889],qn=[0,.64444,0,0,.5],Zs=[0,.69444,0,0,.77778],sa=[0,.68333,0,0,.75],Pa=[0,.68333,0,0,.77778],Sa=[0,.68333,0,0,.68056],Oa=[0,.68333,0,0,.72222],xn=[.25,.75,0,0,.5],Ss=[.25,.75,0,0,.27778],Kn=[0,.69444,0,0,.5],Ys=[0,.69444,0,0,.55556],Ba=[0,.43056,0,0,.44445],aa=[0,.43056,0,0,.5],Yo=[.19444,.43056,0,0,.55556],yo=[0,.43056,0,0,.55556],Ts=[.08333,.58333,0,0,.77778],bo=[0,.43056,0,0,.27778],Fa=[0,.66786,0,0,.27778],Xs=[0,.69444,0,0,.75],_o=[0,.66786,0,0,.5],da=[0,.68333,0,0,.625],Ea=[.19444,.69444,0,0,.44445],Ja=[0,.69444,0,0,.72222],Xo=[.19444,.69444,0,0,.5],Na=[.19444,.69444,0,0,1],Jo=[.011,.511,0,0,1.126],Cs=[.19444,.69444,0,0,.61111],Qa=[.05556,.75,0,0,.5],xo=[0,.68333,0,0,.83334],$a=[.0391,.5391,0,0,.66667],eo=[-.05555,.44445,0,0,.5],to=[0,.43056,0,0,.77778],Js=[0,.55556,0,0,.66667],za=[-.03625,.46375,0,0,.77778],Os=[-.01688,.48312,0,0,.77778],Qo=[.0391,.5391,0,0,1],Ki=[0,.69444,0,0,.61111],Yi=[-.03472,.46528,0,0,.5],Xi=[.25,.75,0,0,.44445],Es=[-.14236,.35764,0,0,1],En=[.244,.744,0,0,.412],Ua=[.19444,.69444,0,0,.88889],Vt=[.12963,.69444,0,0,.77778],ro=[.19444,.69444,0,0,.38889],wo=[.011,.511,0,0,1.638],io=[.19444,.69444,0,0,0],oa=[0,.44444,0,0,.575],Hs=[.19444,.44444,0,0,.575],So=[0,.68611,0,0,.75555],mu=[0,.69444,0,0,.66759],gu=[0,.68611,0,0,.80555],el=[0,.68611,.08229,0,.98229],Ka=[0,.68611,0,0,.76666],Aa=[0,.44444,0,0,.58472],vu=[.19444,.44444,0,0,.6118],Eo=[.19444,.43056,0,0,.5],yu=[0,.68333,.02778,.08334,.76278],i0=[0,.68333,.08125,.05556,.83125],tl=[0,.43056,0,.05556,.48472],rl=[.19444,.43056,0,.08334,.51702],Ao=[.25,.75,0,0,.42778],es=[0,.69444,0,0,.55],Ns=[0,.69444,0,0,.73334],Gs=[0,.69444,0,0,.79445],bu=[0,.69444,0,0,.51945],il=[0,.69444,0,0,.70278],_u=[0,.69444,0,0,.76389],nl=[.25,.75,0,0,.34306],Il=[0,.69444,0,0,.56111],xu=[0,.69444,0,0,.25556],wu=[.19444,.45833,0,0,.56111],Pl=[0,.45833,0,0,.56111],Ol=[0,.69444,0,0,.30556],Bl=[0,.69444,0,0,.58056],Fl=[0,.69444,0,0,.67223],sl=[0,.69444,0,0,.85556],Nl=[0,.69444,0,0,.55834],la=[0,.65556,.11156,0,.5],$l=[0,.69444,.08094,0,.70834],zl=[.17014,0,0,0,.44445],Su=[0,.69444,.0799,0,.5],Eu=[0,.69444,0,0,.73752],n0=[0,.69444,.09205,0,.5],Ha=[0,.69444,.09031,0,.77778],al=[0,.69444,.07816,0,.27778],Au=[0,.69444,.00316,0,.5],s0=[.19444,.69444,0,0,.83334],a0=[.05556,.75,0,0,.83334],o0=[0,.75,0,0,.5],Ul=[.125,.08333,0,0,.27778],ol=[0,.08333,0,0,.27778],fa=[0,.65556,0,0,.5],ll=[0,.69444,0,0,.47222],pa=[0,.69444,0,0,.66667],ku=[0,.69444,0,0,.59722],ul=[0,.69444,0,0,.54167],ke=[0,.69444,0,0,.70834],Qs=[.25,.75,0,0,.28889],no=[0,.69444,0,0,.51667],Kl=[0,.44444,0,0,.44445],ko=[.19444,.44444,0,0,.51667],Hl=[0,.44444,0,0,.38333],Tu=[0,.44444,0,0,.51667],Cu=[0,.69444,0,0,.83334],l0=[.35001,.85,0,0,.45834],Gl=[.35001,.85,0,0,.57778],Vl=[.35001,.85,0,0,.41667],so=[.35001,.85,0,0,.58334],cl=[0,.72222,0,0,.55556],Wl=[1e-5,.6,0,0,.66667],jl=[1e-5,.6,0,0,.77778],u0=[.25001,.75,0,0,.94445],Du=[.306,.805,.19445,0,.47222],Mu=[.30612,.805,.19445,0,.47222],ka=[.25001,.75,0,0,.83334],To=[.35001,.85,0,0,.47222],Lu=[.25001,.75,0,0,1.11111],Q0=[.65002,1.15,0,0,.59722],K=[.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],P=[.862,1.36,.44445,0,.55556],U=[.86225,1.36,.44445,0,.55556],oe=[.55001,1.05,0,0,1.11111],we=[.65002,1.15,0,0,.52778],Be=[.65002,1.15,0,0,.61111],at=[.55001,1.05,0,0,1.51112],yt=[.95003,1.45,0,0,.73611],Ot=[.95003,1.45,0,0,1.04445],Yt=[.95003,1.45,0,0,.52778],cr=[.95003,1.45,0,0,.75],xr=[0,.75,0,0,1.44445],qe=[.95003,1.45,0,0,.58334],Ti=[1.25003,1.75,0,0,.79167],Mi=[1.25003,1.75,0,0,1.27778],Bi=[1.25003,1.75,0,0,.58334],an=[1.25003,1.75,0,0,.80556],fn=[0,.825,0,0,1.8889],Cn=[1.25003,1.75,0,0,.63889],Dn=[.64502,1.155,0,0,.875],Zn=[1e-5,.6,0,0,.875],ms=[-99e-5,.601,0,0,.66667],Fn=[.64502,1.155,0,0,.66667],pn=[1e-5,.9,0,0,.88889],$s=[.65002,1.15,0,0,.88889],ea=[.90001,0,0,0,.88889],Yn=[-.00499,.605,0,0,1.05556],ds=[0,.12,0,0,.45],Mr=[0,.61111,0,0,.525],as=[.08333,.69444,0,0,.525],Ru=[-.08056,.53055,0,0,.525],c0=[-.05556,.55556,0,0,.525],is=[0,.43056,0,0,.525],gs=[.22222,.43056,0,0,.525],ma=[0,0,0,0,.525],hl={"AMS-Regular":{32:fe,65:zt,66:tr,67:zt,68:zt,69:tr,70:B,71:T,72:T,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:T,76:tr,77:[0,.68889,0,0,.94445],78:zt,79:ft,80:B,81:ft,82:zt,83:G,84:tr,85:zt,86:zt,87:[0,.68889,0,0,1],88:zt,89:zt,90:tr,107:G,160:fe,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:G,295:He,710:Sr,732:Ne,770:Sr,771:Ne,989:Er,1008:ni,8245:[0,.54986,0,0,.275],8463:He,8487:zt,8498:G,8502:tr,8503:[0,.68889,0,0,.44445],8504:tr,8513:[0,.68889,0,0,.63889],8592:Je,8594:Je,8602:W,8603:W,8606:ge,8608:ge,8610:Ee,8611:Ee,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:Xt,8639:Xt,8642:Xt,8643:Xt,8644:yr,8646:yr,8647:yr,8648:ei,8649:yr,8650:ei,8651:ge,8652:ge,8653:W,8654:W,8655:W,8666:Li,8667:Li,8669:[-.13313,.37788,0,0,1],8672:ui,8674:ui,8705:[0,.825,0,0,.5],8708:G,8709:Er,8717:[0,.43056,0,0,.42917],8722:Je,8724:[.08198,.69224,0,0,.77778],8726:Er,8733:ct,8736:yi,8737:yi,8738:[.03517,.52239,0,0,.72222],8739:Dr,8740:[.25142,.74111,0,0,.27778],8741:mr,8742:[.25142,.74111,0,0,.5],8756:me,8757:me,8764:Ce,8765:[-.13313,.37788,0,0,.77778],8769:Ce,8770:za,8774:Qt,8776:Os,8778:Er,8782:Mt,8783:Mt,8785:Ae,8786:Ae,8787:Ae,8790:ct,8791:Pr,8796:[.08198,.91667,0,0,.77778],8806:Et,8807:Et,8808:Nt,8809:Nt,8812:[.25583,.75583,0,0,.5],8814:ar,8815:ar,8816:Qt,8817:Qt,8818:Pr,8819:Pr,8822:Ar,8823:Ar,8828:oi,8829:oi,8830:Pr,8831:Pr,8832:ar,8833:ar,8840:Qt,8841:Qt,8842:Lr,8843:Lr,8847:Fr,8848:Fr,8858:Ae,8859:Ae,8861:Ae,8862:ii,8863:ii,8864:ii,8865:ii,8872:[0,.69224,0,0,.61111],8873:yi,8874:[0,.69224,0,0,.88889],8876:B,8877:B,8878:zt,8879:zt,8882:Fr,8883:Fr,8884:oi,8885:oi,8888:[0,.54986,0,0,1.11111],8890:Yo,8891:bi,8892:bi,8901:[0,.54986,0,0,.27778],8903:Er,8905:Er,8906:Er,8907:ct,8908:ct,8909:[-.03598,.46402,0,0,.77778],8910:Fi,8911:Fi,8912:Fr,8913:Fr,8914:mi,8915:mi,8916:me,8918:Kr,8919:Kr,8920:Hi,8921:Hi,8922:Yr,8923:Yr,8926:oi,8927:oi,8928:Qt,8929:Qt,8934:Br,8935:Br,8936:Br,8937:Br,8938:ar,8939:ar,8940:Qt,8941:Qt,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:ii,9633:ii,9650:_t,9651:_t,9654:Fr,9660:_t,9661:_t,9664:Fr,9674:pt,9733:[.19444,.69224,0,0,.94445],10003:Lt,10016:Lt,10731:pt,10846:[.19444,.75583,0,0,.61111],10877:oi,10878:oi,10885:Et,10886:Et,10887:Lr,10888:Lr,10889:Ht,10890:Ht,10891:Bt,10892:Bt,10901:oi,10902:oi,10933:Nt,10934:Nt,10935:Ht,10936:Ht,10937:Ht,10938:Ht,10949:Et,10950:Et,10955:lr,10956:lr,57350:Dr,57351:mr,57352:Er,57353:ni,57356:Nt,57357:Nt,57358:ci,57359:Qt,57360:Qt,57361:ci,57366:Nt,57367:Nt,57368:Nt,57369:Nt,57370:Lr,57371:Lr},"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:ri,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:gi,41:gi,42:[0,.62119,0,0,.27764],43:kr,44:Rr,45:kr,46:Rr,47:[.24982,.74947,0,0,.50181],48:Si,49:Si,50:Si,51:Ei,52:Ei,53:Ei,54:Xr,55:Ei,56:Xr,57:Ei,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:ti,93:ti,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:ri,8217:ri,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:zn,35:[.19444,.69444,0,0,.95833],36:bn,37:[.05556,.75,0,0,.95833],38:Ii,39:qr,40:si,41:si,42:[0,.75,0,0,.575],43:Gr,44:[.19444,.15556,0,0,.31944],45:Hl,46:[0,.15556,0,0,.31944],47:je,48:Hr,49:Hr,50:Hr,51:Hr,52:Hr,53:Hr,54:Hr,55:Hr,56:Hr,57:Hr,58:gn,59:[.19444,.44444,0,0,.31944],60:fi,61:ss,62:fi,63:[0,.69444,0,0,.54305],64:Ii,65:Tr,66:[0,.68611,0,0,.81805],67:ts,68:[0,.68611,0,0,.88194],69:So,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Ci,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Gi,77:[0,.68611,0,0,1.09166],78:Ci,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:Tr,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:ur,92:je,93:ur,94:Ni,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:br,99:vi,100:br,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:br,105:qr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:qr,109:[0,.44444,0,0,.95833],110:on,111:oa,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:on,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:ur,125:je,126:[.35,.34444,0,0,.575],160:fe,163:[0,.69444,0,0,.86853],168:Ni,172:[0,.44444,0,0,.76666],176:wn,177:Gr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Gr,216:[.04861,.73472,0,0,.89444],223:ku,230:[0,.44444,0,0,.83055],247:Gr,248:[.09722,.54167,0,0,.575],305:gn,338:[0,.68611,0,0,1.16944],339:rs,567:[.19444,.44444,0,0,.35139],710:Ni,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Ni,715:Ni,728:Ni,729:qr,730:wn,732:Ni,733:Ni,915:Gi,916:nn,920:Xn,923:gu,926:Ka,928:Ci,931:ts,933:Xn,934:ts,936:Xn,937:ts,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:qr,8217:qr,8220:zn,8221:zn,8224:Vn,8225:Vn,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:mu,8465:Or,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Or,8501:ps,8592:Ai,8593:Ui,8594:Ai,8595:Ui,8596:Ai,8597:je,8598:Vi,8599:Vi,8600:Vi,8601:Vi,8636:Ai,8637:Ai,8640:Ai,8641:Ai,8656:Ai,8657:Wn,8658:Ai,8659:Wn,8660:Ai,8661:[.25,.75,0,0,.70277],8704:br,8706:[0,.69444,.06389,0,.62847],8707:br,8709:bn,8711:nn,8712:On,8715:On,8722:Gr,8723:Gr,8725:je,8726:je,8727:ys,8728:$i,8729:$i,8730:[.18,.82,0,0,.95833],8733:rs,8734:[0,.44444,0,0,1.14999],8736:yi,8739:ur,8741:je,8743:Wr,8744:Wr,8745:Wr,8746:Wr,8747:[.19444,.69444,.12778,0,.56875],8764:ss,8768:[.19444,.69444,0,0,.31944],8771:Jn,8776:[.02444,.52444,0,0,.89444],8781:Jn,8801:Jn,8804:Sn,8805:Sn,8810:Ri,8811:Ri,8826:fi,8827:fi,8834:fi,8835:fi,8838:Sn,8839:Sn,8846:Wr,8849:Sn,8850:Sn,8851:Wr,8852:Wr,8853:Gr,8854:Gr,8855:Gr,8856:Gr,8857:Gr,8866:ps,8867:ps,8868:Ii,8869:Ii,8900:$i,8901:[-.02639,.47361,0,0,.31944],8902:ys,8968:us,8969:us,8970:us,8971:us,8994:pi,8995:pi,9651:bs,9657:ys,9661:bs,9667:ys,9711:Vi,9824:_s,9825:_s,9826:_s,9827:_s,9837:[0,.75,0,0,.44722],9838:ir,9839:ir,10216:si,10217:si,10815:Ci,10927:Sn,10928:Sn,57376:io},"Main-BoldItalic":{32:fe,33:[0,.69444,.11417,0,.38611],34:kn,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:sn,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:vn,49:vn,50:vn,51:vn,52:xs,53:vn,54:vn,55:xs,56:vn,57:vn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:jn,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:cs,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:cs,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:Oi,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:hn,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:hn,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:Un,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:dn,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:dn,567:[.19444,.44444,.04611,0,.385],710:Oi,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:sn,730:Un,732:jn,733:jn,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:cs,931:[0,.68611,.11431,0,.82666],933:Bn,934:[0,.68611,.05632,0,.82666],936:Bn,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:sn,8217:sn,8220:[0,.69444,.16772,0,.62055],8221:kn},"Main-Italic":{32:fe,33:Pi,34:Ks,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Pi,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:_i,49:_i,50:_i,51:_i,52:Di,53:_i,54:_i,55:Di,56:_i,57:_i,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:_n,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:ln,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:ln,79:In,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:ln,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:Ir,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:Tn,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:Tn,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:Qn,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Qn,710:Ir,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:_n,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:In,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:ln,931:[0,.68333,.12028,0,.71555],933:Qi,934:[0,.68333,.05986,0,.71555],936:Qi,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Pi,8217:Pi,8220:[0,.69444,.1685,0,.51444],8221:Ks,8463:He},"Main-Regular":{32:fe,33:hs,34:Kn,35:s0,36:Qa,37:a0,38:Zs,39:hs,40:ws,41:ws,42:o0,43:Ts,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:xn,48:qn,49:qn,50:qn,51:qn,52:qn,53:qn,54:qn,55:qn,56:qn,57:qn,58:bo,59:[.19444,.43056,0,0,.27778],60:Kr,61:Ce,62:Kr,63:ll,64:Zs,65:sa,66:[0,.68333,0,0,.70834],67:Oa,68:[0,.68333,0,0,.76389],69:Sa,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:sa,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Pa,76:da,77:[0,.68333,0,0,.91667],78:sa,79:Pa,80:Sa,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Oa,85:sa,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:sa,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Ss,92:xn,93:Ss,94:Kn,95:[.31,.12056,.02778,0,.5],97:aa,98:Ys,99:Ba,100:Ys,101:Ba,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Ys,105:Fa,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:hs,109:[0,.43056,0,0,.83334],110:yo,111:aa,112:Yo,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:yo,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:Ba,123:xn,124:Ss,125:xn,126:[.35,.31786,0,0,.5],160:fe,163:[0,.69444,0,0,.76909],167:Ea,168:_o,172:[0,.43056,0,0,.66667],176:Xs,177:Ts,182:Cs,184:zl,198:[0,.68333,0,0,.90278],215:Ts,216:[.04861,.73194,0,0,.77778],223:Kn,230:[0,.43056,0,0,.72222],247:Ts,248:[.09722,.52778,0,0,.5],305:bo,338:[0,.68333,0,0,1.01389],339:to,567:[.19444,.43056,0,0,.30556],710:Kn,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Kn,715:Kn,728:Kn,729:Fa,730:Xs,732:_o,733:Kn,915:da,916:xo,920:Pa,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:sa,931:Oa,933:Pa,934:Oa,936:Pa,937:Oa,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:hs,8217:hs,8220:Kn,8221:Kn,8224:Ea,8225:Ea,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:He,8465:Ja,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:Ja,8501:Ki,8592:W,8593:Xo,8594:W,8595:Xo,8596:W,8597:xn,8598:Na,8599:Na,8600:Na,8601:Na,8614:[.011,.511,0,0,1],8617:Jo,8618:Jo,8636:W,8637:W,8640:W,8641:W,8652:[.011,.671,0,0,1],8656:W,8657:Cs,8658:W,8659:Cs,8660:W,8661:[.25,.75,0,0,.61111],8704:Ys,8706:[0,.69444,.05556,.08334,.5309],8707:Ys,8709:Qa,8711:xo,8712:$a,8715:$a,8722:Ts,8723:Ts,8725:xn,8726:xn,8727:Yi,8728:eo,8729:eo,8730:[.2,.8,0,0,.83334],8733:to,8734:qt,8736:yi,8739:Ss,8741:xn,8743:Js,8744:Js,8745:Js,8746:Js,8747:[.19444,.69444,.11111,0,.41667],8764:Ce,8768:[.19444,.69444,0,0,.27778],8771:za,8773:[-.022,.589,0,0,1],8776:Os,8781:za,8784:[-.133,.67,0,0,.778],8801:za,8804:Lr,8805:Lr,8810:Qo,8811:Qo,8826:Kr,8827:Kr,8834:Kr,8835:Kr,8838:Lr,8839:Lr,8846:Js,8849:Lr,8850:Lr,8851:Js,8852:Js,8853:Ts,8854:Ts,8855:Ts,8856:Ts,8857:Ts,8866:Ki,8867:Ki,8868:Zs,8869:Zs,8872:[.249,.75,0,0,.867],8900:eo,8901:[-.05555,.44445,0,0,.27778],8902:Yi,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:Xi,8969:Xi,8970:Xi,8971:Xi,8994:Es,8995:Es,9136:En,9137:En,9651:Ua,9657:Yi,9661:Ua,9667:Yi,9711:Na,9824:Vt,9825:Vt,9826:Vt,9827:Vt,9837:[0,.75,0,0,.38889],9838:ro,9839:ro,10216:ws,10217:ws,10222:En,10223:En,10229:[.011,.511,0,0,1.609],10230:wo,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:wo,10815:sa,10927:Lr,10928:Lr,57376:io},"Math-BoldItalic":{32:fe,48:oa,49:oa,50:oa,51:Hs,52:Hs,53:Hs,54:Hr,55:Hs,56:Hr,57:Hs,65:Tr,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:el,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:So,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:mu,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:Aa,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:nn,920:[0,.68611,.03194,0,.86722],923:gu,926:[0,.68611,.07458,0,.84125],928:el,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Ka,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:Aa,960:[0,.44444,.03704,0,.68241],961:vu,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:vu,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:fe,48:aa,49:aa,50:aa,51:Eo,52:Eo,53:Eo,54:qn,55:Eo,56:qn,57:Eo,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:i0,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:yu,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:tl,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:yu,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:i0,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:tl,960:[0,.43056,.03588,0,.57003],961:rl,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:rl,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:Nl,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:Ol,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:es,49:es,50:es,51:es,52:es,53:es,54:es,55:es,56:es,57:es,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:bu,64:Ns,65:Ns,66:Ns,67:il,68:Gs,69:[0,.69444,0,0,.64167],70:Ki,71:Ns,72:Gs,73:[0,.69444,0,0,.33056],74:bu,75:_u,76:Bl,77:[0,.69444,0,0,.97778],78:Gs,79:Gs,80:il,81:[.10556,.69444,0,0,.79445],82:il,83:Ki,84:Ns,85:_u,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Ns,89:[0,.69444,.0275,0,.73334],90:Fl,91:nl,93:nl,94:es,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Il,99:[0,.45833,0,0,.48889],100:Il,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Il,105:xu,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:xu,109:[0,.45833,0,0,.86667],110:Pl,111:[0,.45833,0,0,.55],112:wu,113:wu,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Pl,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:es,176:Ns,180:es,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:es,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:es,729:Ol,730:Ns,732:es,733:es,915:Bl,916:[0,.69444,0,0,.91667],920:sl,923:Fl,926:Ns,928:Gs,931:Gs,933:sl,934:Gs,936:sl,937:Gs,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Ol,8217:Ol,8220:Nl,8221:Nl},"SansSerif-Italic":{32:fe,33:[0,.69444,.05733,0,.31945],34:Au,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:al,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:Ul,45:[0,.44444,.01946,0,.33333],46:ol,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:pa,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:$l,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:ul,77:[0,.69444,.08094,0,.875],78:$l,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:Su,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:Eu,184:zl,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Su,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:n0,715:Kn,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Eu,732:[0,.67659,.08826,0,.5],733:n0,915:[0,.69444,.13372,0,.54167],916:Cu,920:[0,.69444,.07555,0,.77778],923:Ki,926:[0,.69444,.12816,0,.66667],928:$l,931:[0,.69444,.11983,0,.72222],933:Ha,934:[0,.69444,.04603,0,.72222],936:Ha,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:al,8217:al,8220:[0,.69444,.14205,0,.5],8221:Au},"SansSerif-Regular":{32:fe,33:[0,.69444,0,0,.31945],34:Kn,35:s0,36:Qa,37:a0,38:[0,.69444,0,0,.75834],39:hs,40:ws,41:ws,42:o0,43:Ts,44:Ul,45:[0,.44444,0,0,.33333],46:ol,47:xn,48:fa,49:fa,50:fa,51:fa,52:fa,53:fa,54:fa,55:fa,56:fa,57:fa,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:ll,64:pa,65:pa,66:pa,67:br,68:[0,.69444,0,0,.72223],69:ku,70:[0,.69444,0,0,.56945],71:pa,72:ke,73:hs,74:ll,75:[0,.69444,0,0,.69445],76:ul,77:[0,.69444,0,0,.875],78:ke,79:[0,.69444,0,0,.73611],80:br,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Ys,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:pa,89:[0,.69444,.025,0,.66667],90:Ki,91:Qs,93:Qs,94:Kn,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:no,99:Kl,100:no,101:Kl,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:no,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:Tu,111:[0,.44444,0,0,.5],112:ko,113:ko,114:[0,.44444,.01389,0,.34167],115:Hl,116:[0,.57143,0,0,.36111],117:Tu,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:pa,184:zl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Kn,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Kn,715:Kn,728:Kn,729:[0,.67937,0,0,.27778],730:pa,732:[0,.67659,0,0,.5],733:Kn,915:ul,916:Cu,920:Zs,923:Ki,926:pa,928:ke,931:Ja,933:Zs,934:Ja,936:Zs,937:Ja,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:hs,8217:hs,8220:Kn,8221:Kn},"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:l0,41:l0,47:Gl,91:Vl,92:Gl,93:Vl,123:so,125:so,160:fe,710:cl,732:cl,770:cl,771:cl,8214:[-99e-5,.601,0,0,.77778],8593:Wl,8595:Wl,8657:jl,8659:jl,8719:u0,8720:u0,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:Mu,8748:Du,8749:Du,8750:Mu,8896:ka,8897:ka,8898:ka,8899:ka,8968:To,8969:To,8970:To,8971:To,9168:ms,10216:To,10217:To,10752:Lu,10753:Lu,10754:Lu,10756:ka,10758:ka},"Size2-Regular":{32:fe,40:Q0,41:Q0,47:K,91:m,92:K,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:P,8749:P,8750:U,8896:oe,8897:oe,8898:oe,8899:oe,8968:we,8969:we,8970:we,8971:we,10216:Be,10217:Be,10752:at,10753:at,10754:at,10756:oe,10758:oe},"Size3-Regular":{32:fe,40:yt,41:yt,47:Ot,91:Yt,92:Ot,93:Yt,123:cr,125:cr,160:fe,710:xr,732:xr,770:xr,771:xr,8730:[.95003,1.45,0,0,1],8968:qe,8969:qe,8970:qe,8971:qe,10216:cr,10217:cr},"Size4-Regular":{32:fe,40:Ti,41:Ti,47:Mi,91:Bi,92:Mi,93:Bi,123:an,125:an,160:fe,710:fn,732:fn,770:fn,771:fn,8730:[1.25003,1.75,0,0,1],8968:Cn,8969:Cn,8970:Cn,8971:Cn,9115:Dn,9116:Zn,9117:Dn,9118:Dn,9119:Zn,9120:Dn,9121:Fn,9122:ms,9123:Fn,9124:Fn,9125:ms,9126:Fn,9127:pn,9128:$s,9129:ea,9130:[0,.3,0,0,.88889],9131:pn,9132:$s,9133:ea,9143:[.88502,.915,0,0,1.05556],10216:an,10217:an,57344:Yn,57345:Yn,57680:ds,57681:ds,57682:ds,57683:ds},"Typewriter-Regular":{32:ma,33:Mr,34:Mr,35:Mr,36:as,37:as,38:Mr,39:Mr,40:as,41:as,42:[0,.52083,0,0,.525],43:Ru,44:[.13889,.125,0,0,.525],45:Ru,46:[0,.125,0,0,.525],47:as,48:Mr,49:Mr,50:Mr,51:Mr,52:Mr,53:Mr,54:Mr,55:Mr,56:Mr,57:Mr,58:is,59:[.13889,.43056,0,0,.525],60:c0,61:[-.19549,.41562,0,0,.525],62:c0,63:Mr,64:Mr,65:Mr,66:Mr,67:Mr,68:Mr,69:Mr,70:Mr,71:Mr,72:Mr,73:Mr,74:Mr,75:Mr,76:Mr,77:Mr,78:Mr,79:Mr,80:Mr,81:[.13889,.61111,0,0,.525],82:Mr,83:Mr,84:Mr,85:Mr,86:Mr,87:Mr,88:Mr,89:Mr,90:Mr,91:as,92:as,93:as,94:Mr,95:[.09514,0,0,0,.525],96:Mr,97:is,98:Mr,99:is,100:Mr,101:is,102:Mr,103:gs,104:Mr,105:Mr,106:[.22222,.61111,0,0,.525],107:Mr,108:Mr,109:is,110:is,111:is,112:gs,113:gs,114:is,115:is,116:[0,.55358,0,0,.525],117:is,118:is,119:is,120:is,121:gs,122:is,123:as,124:as,125:as,126:Mr,127:Mr,160:ma,176:Mr,184:[.19445,0,0,0,.525],305:is,567:gs,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Mr,715:Mr,728:Mr,730:Mr,770:Mr,771:Mr,776:Mr,915:Mr,916:Mr,920:Mr,923:Mr,926:Mr,928:Mr,931:Mr,933:Mr,934:Mr,936:Mr,937:Mr,8216:Mr,8217:Mr,8242:Mr,9251:[.11111,.21944,0,0,.525]}},ql=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Ga=10,Bs=.25,ec=1.2,ga=.431,Zl={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[ga,ga,ga],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:[Bs,Bs,Bs],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]},dl=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],fl=5,pl={"\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 Co(e,r){e===void 0&&(e=77);const n=hl[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 pl)e=pl[a].codePointAt(0);else if(ql.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 h0={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]},ml={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]},d0={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 Xh(e){if(ml[e]){const[R,z,J]=ml[e],_e=`<span class="stretchy" style="height:${J}em"><svg width="100%" height="${J}em" viewBox="0 0 ${R} ${z}" preserveAspectRatio="none" ><path fill="currentcolor" d="${d0[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*J/2)/100}em;min-width:0">${_e}</span>`}const[r,n,a,u]=h0[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((R,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="${d0[R]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${A}em;min-width:${n}em;">${C}</span>`}function Jh(e){return h0[e]?h0[e][2]/1e3:ml[e][2]}function Nc(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=vo(2,16)+f*vo(2,10)+v,n++}}r.push(a)}return r}var Iu=8205,Qh=[[Iu,1],[65038,2],[127995,5],[129456,4],[917536,96]],f0,tc=[127462,127487];function $c(e){var r;if(f0===void 0){f0={};for(const n of Qh)for(let a=n[0];a<=n[0]+n[1]-1;a++)f0[a]=!0}return(r=f0[e])!=null?r:!1}function rc(e){return e>=tc[0]&&e<=tc[1]}function p0(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const r=[],n=Nc(e);let a=0;for(;a<n.length;){const u=n[a++],f=n[a];if(f===Iu){const v=a-1;for(a+=2;n[a]===Iu;)a+=2;r.push(String.fromCodePoint(...n.slice(v,a-v+1)))}else if($c(f)){const v=a-1;for(;$c(n[a]);)a+=n[a]===Iu?2:1;r.push(String.fromCodePoint(...n.slice(v,2*a-v-1)))}else rc(u)?(a+=1,r.push(String.fromCodePoint(...n.slice(a-2,2)))):r.push(String.fromCodePoint(u))}return r}var vf=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=p0(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 ta(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="",R=!1,z=[];do{if(z.length===0)if(/^#[\d?@]$/.test(e.peek())){const J=e.get().slice(1);z=ic((a=(n=r==null?void 0:r(J))!=null?n:r==null?void 0:r("?"))!=null?a:"\\placeholder{}",r),A=z[0]}else A=e.next(),z=A?[A]:[];R=z.length===0,!R&&A==="\\endcsname"&&(R=!0,z.shift()),R||(R=A==="<$>"||A==="<$$>"||A==="<{>"||A==="<}>"||typeof A=="string"&&A.length>1&&A.startsWith("\\")),R||(C+=z.shift())}while(!R);C&&v.push("\\"+C),v.push(...z)}else if(A!=="\\endcsname")if(A.length>1&&A.startsWith("#")){const C=A.slice(1);v.push(...ic((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 ic(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 vf(At(n.join(""))),f=[];do f.push(...ta(u,r));while(!u.end());return f}function Wi(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 Hn(e,...r){return console.assert(e.startsWith("\\")),r.length===0?e:Wi([e,...r.map(n=>`{${n}}`)])}function Yl(e){return Wi(e.map(r=>{var n;return(n={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[r])!=null?n:r}))}var ed=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 Xl(r)){const v=Fc._registry[f[0].mode];u.push(...v.serialize(f,n))}return Wi(u)}return Wi(rd(r,n))}static getFont(r,n,a){return Fc._registry[r].getFont(n,a)}};ed._registry={};var va=ed;function Xl(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 Do(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 gl(e,r){var n;const{parent:a}=e[0],u=a==null?void 0:a.computedStyle.color,f=[];for(const v of Xl(e)){const A=r.defaultMode;for(const C of Do(v,"color")){const R=C[0].computedStyle,z=va._registry[C[0].mode].serialize(C,d(N({},r),{defaultMode:A==="text"?"text":"math"}));!r.skipStyles&&R.color&&R.color!=="none"&&(!a||u!==R.color)?f.push(Hn("\\textcolor",(n=R.verbatimColor)!=null?n:R.color,Wi(z))):f.push(Wi(z))}}return f}function td(e,r){const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.backgroundColor;return Do(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 Hn("\\colorbox",(f=v.verbatimBackgroundColor)!=null?f:v.backgroundColor,Wi(gl(u,d(N({},r),{defaultMode:"text"}))))}return Wi(gl(u,r))})}function rd(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 Do(e,"fontSize")){const v=f[0].computedStyle.fontSize,A=td(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 nc(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 ra(e){if(e.length===0)return"ord";const r=nc(e[0].type),n=nc(e[e.length-1].type);return r&&r===n?r:"ord"}function Jl(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 or=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(R=>R!==null):r&&r instanceof Tp&&(this.children=[r]),this.children)for(const R of this.children)R.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=va.getFont((v=n.mode)!=null?v:"math",this,d(N({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),id(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=Jl(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=Jl(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"]=Jl(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"]=Jl(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"]=Jl(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=Xh(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 R=C.length===1?C[0]:C.filter((Ie,ze,St)=>Ie.length>0&&St.indexOf(Ie)===ze).join(" ");if(R.length>0&&(A+=` class="${R}"`),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 nr=St[1].trim().replace(/ /g,"-");nr&&(A+=` data-${nr}="${St[2]}" `)}else{const nr=ze.trim().replace(/ /g,"-");nr&&(A+=` data-${nr} `)}}}const z=(u=this.cssProperties)!=null?u:{};this.hasExplicitWidth&&z.width===void 0&&(z.width=`${Math.ceil(this._width*100)/100}em`);const J=Object.keys(z).map(Ie=>`${Ie}:${z[Ie]}`);if(this.scale!==void 0&&this.scale!==1&&(f.length>0||v.length>0)&&J.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const Ie=this.htmlStyle.split(";");let ze="";for(const St of Ie){const nr=St.match(/([^=]+):(.+$)/);if(nr){const xt=nr[1].trim().replace(/ /g,"-");xt&&(ze+=`${xt}:${nr[2]};`)}}ze&&(A+=` style="${ze}"`)}J.length>0&&(A+=` style="${J.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,R]of v.entries())if(R==="vertical-separator"||R!==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 sc(e){if(!e||e.length===0)return[];e[0].children=sc(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=sc(e[n].children),r.push(e[n]));return r}function m0(e){return e.children&&(e.children=sc(e.children)),e}function g0(e,r){if(!e)return new or(null,r);const n=new or(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 or(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 or(a,d(N({},r),{type:"lift"}))}function v0(e){const r=Jh(e)/2,n=new or(null,{maxFontSize:0});return n.height=r+.166,n.depth=r-.166,n.svgBody=e,n}function id(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=Co(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 nd(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,R=C-(n.box.height+n.box.depth);f=f+C,a.push(R),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 zc(e){var r;const[n,a]=nd(e);if(!n)return[[],0,0];const u=new or(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,R=a,z=0;for(const ze of n){if(typeof ze=="number")R+=ze;else{const St=ze.box,nr=(r=ze.classes)!=null?r:[],xt=new or([u,St],{classes:nr.join(" "),style:ze.style});St.setStyle("height",St.height+St.depth,"em"),St.setStyle("display","inline-block"),xt.setStyle("top",-f-R-St.depth,"em"),ze.marginLeft&&xt.setStyle("margin-left",ze.marginLeft,"em"),ze.marginRight&&xt.setStyle("margin-right",ze.marginRight,"em"),v.push(xt),R+=St.height+St.depth,z=Math.max(z,xt.width)}A=Math.min(A,R),C=Math.max(C,R)}v.forEach(ze=>{ze.softWidth=z});const J=new or(v,{classes:"vlist"});if(J.softWidth=z,J.height=C,J.setStyle("height",C,"em"),A>=0)return[[new or(J,{classes:"vlist-r"})],C,-A];const _e=new or(new or(null),{classes:"vlist"});_e.height=-A,_e.setStyle("height",-A,"em");const Ie=new or(8203,{classes:"vlist-s",maxFontSize:0});return Ie.softWidth=0,Ie.height=0,Ie.depth=0,[[new or([J,Ie],{classes:"vlist-r"}),new or(_e,{classes:"vlist-r"})],C,-A]}var fs=class extends or{constructor(e,r){var n;const[a,u,f]=zc(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 sd(e,r){var n,a,u,f,v;const A=e.metrics,C=new or(r.base),R=(n=r.baseShift)!=null?n:0,z=(a=r.slant)!=null?a:0;let J=0,_e=0;r.above&&(J=(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+R;Ie=new fs({bottom:ze,children:[A.bigOpSpacing5,{box:r.below,marginLeft:-z,classes:["ML__center"]},_e,{box:C,classes:["ML__center"]},J,{box:r.above,marginLeft:z,classes:["ML__center"]},A.bigOpSpacing5]}).wrap(e)}else if(r.below&&!r.above)Ie=new fs({top:C.height-R,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+R;Ie=new fs({bottom:ze,children:[{box:C,classes:["ML__center"]},J,{box:r.above,marginLeft:z,classes:["ML__center"]},A.bigOpSpacing5]}).wrap(e)}else{const ze=C.depth+R;Ie=new fs({bottom:ze,children:[{box:C},A.bigOpSpacing5]}).wrap(e)}return new or(Ie,{type:(v=r.type)!=null?v:"op"})}var ac=7,y0=6,b0=5,vl=4,Ql=3,ua=2,Mo=1,Ds=0,Lo=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(Zl).reduce((u,f)=>d(N({},u),{[f]:Zl[f][a]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return ya[[Ds,Mo,Ds,Mo,ua,Ql,ua,Ql][this.id]]}get sub(){return ya[[Ds,Ds,Ds,Ds,ua,ua,ua,ua][this.id]]}get fracNum(){return ya[[Ds,Mo,Ds,Mo,ua,Ql,vl,b0][this.id]]}get fracDen(){return ya[[Ds,Ds,Ds,Ds,ua,ua,vl,vl][this.id]]}get cramp(){return ya[[Ds,Ds,ua,ua,vl,vl,y0,y0][this.id]]}get isTight(){return this.sizeDelta<0}},yl={7:new Lo(ac,0,!1),6:new Lo(y0,0,!0),5:new Lo(b0,0,!1),4:new Lo(vl,0,!0),3:new Lo(Ql,-3,!1),2:new Lo(ua,-3,!0),1:new Lo(Mo,-4,!1),0:new Lo(Ds,-4,!0)},ya=d(N({},yl),{displaystyle:yl[ac],textstyle:yl[b0],scriptstyle:yl[Ql],scriptscriptstyle:yl[Mo]});function oc(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:Ga,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=vo(10,r);return Math.round(e.dimension/Ga*a*u)/u}return e.dimension*a}function Uc(e,r){if(e===null)return 0;const n=oc(e)/Ga;if(Number.isFinite(r)){const a=vo(10,r);return Math.round(n*a)/a}return n}function lc(e){var r;return`${e.dimension}${(r=e.unit)!=null?r:"pt"}`}function ad(e){let r=lc(e.glue);return e.grow&&e.grow.dimension!==0&&(r+=` plus ${lc(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(r+=` minus ${lc(e.shrink)}`),r}function Ms(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=ad(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 Va(e,r){return e==null?null:"number"in e?d(N({},e),{number:e.number*r}):"register"in e?"factor"in e&&e.factor?d(N({},e),{factor:e.factor*r}):d(N({},e),{factor:r}):"dimension"in e?d(N({},e),{dimension:e.dimension*r}):"glue"in e?e.shrink&&e.grow?{glue:Va(e.glue,r),shrink:Va(e.shrink,r),grow:Va(e.grow,r)}:e.shrink?{glue:Va(e.glue,r),shrink:Va(e.shrink,r)}:e.grow?{glue:Va(e.glue,r),grow:Va(e.grow,r)}:{glue:Va(e.glue,r)}:null}var _0={"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 Kc(){return N({},_0)}function eu(){return{registers:Kc(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Y.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:ut,backgroundColorMap:gt,getMacro:e=>Rt(e,wr())}}var ji=class Cp{constructor(r,n){var a,u,f,v,A,C,R,z,J,_e,Ie,ze,St,nr,xt;let Wt;r!=null&&r.parent?(this.parent=r.parent,Wt=r.parent,this.registers={}):(Wt=N(N({},eu()),(a=r==null?void 0:r.from)!=null?a:{}),this.registers=Wt.registers),Wt.atomIdsSettings&&(this.atomIdsSettings=N({},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=(R=this.parent)==null?void 0:R.backgroundColor)!=null?z:"",n!=null&&n.fontSize&&n.fontSize!=="auto"&&n.fontSize!==((J=this.parent)==null?void 0:J.size)?this.size=n.fontSize:this.size=(Ie=(_e=this.parent)==null?void 0:_e.size)!=null?Ie:fl;let hr=(St=(ze=this.parent)==null?void 0:ze.mathstyle)!=null?St:ya.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=ya.textstyle;break;case"displaystyle":hr=ya.displaystyle;break;case"scriptstyle":hr=ya.scriptstyle;break;case"scriptscriptstyle":hr=ya.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=hr,this.smartFence=Wt.smartFence,this.placeholderSymbol=Wt.placeholderSymbol,this.colorMap=(nr=Wt.colorMap)!=null?nr: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===ac||this.mathstyle.id===y0}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(dl[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 Uc(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(N({},f),{dimension:a*f.dimension}):"glue"in f?d(N({},f),{glue:d(N({},f.glue),{dimension:a*f.glue.dimension}),shrink:f.shrink?d(N({},f.shrink),{dimension:a*f.shrink.dimension}):void 0,grow:f.grow?d(N({},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:oc(a,n)/Ga}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}},tu=["body","above","below","superscript","subscript"];function Ro(e){return typeof e=="string"&&tu.includes(e)}function x0(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=N({},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=od(n),v=[];for(const C of f){const R=C[0].style,z=ld(r,C,{style:{color:R.color,backgroundColor:R.backgroundColor,fontSize:R.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 or(v,{classes:A,type:a==null?void 0:a.type}).wrap(r)}static serialize(r,n){return va.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=N({},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=ud(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?Wi([Hn(this.command,this.bodyToLatex(r)),this.supsubToLatex(r)]):this.body?Wi([this.bodyToLatex(r),this.supsubToLatex(r)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(r){var n;return va.serialize(this.body,d(N({},r),{defaultMode:(n=r.defaultMode)!=null?n:this.latexMode}))}aboveToLatex(r){return va.serialize(this.above,r)}belowToLatex(r){return va.serialize(this.below,r)}supsubToLatex(r){let n="";if(r=d(N({},r),{defaultMode:"math"}),this.branch("subscript")!==void 0){const a=va.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=va.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(Ro(r)&&this._branches)return this._branches[r]}get branches(){if(!this._branches)return[];const r=[];for(const n of tu)this._branches[n]&&r.push(n);return r}createBranch(r){return console.assert(Ro(r)),Ro(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 x0(this.parentBranch)?this.parentBranch[0]:-1}get col(){return x0(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(N({},(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=N(N({},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(Ro(n)),!Ro(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(Ro(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 tu)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 ji({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 R=(a=n.isCharacterBox)!=null?a:this.isCharacterBox();let z=0;if(f){const St=new ji({parent:r,mathstyle:"superscript"});A=Ll.createBox(St,f),R||(z=u.height-r.metrics.supDrop*St.scalingFactor)}let J=0;if(v){const St=new ji({parent:r,mathstyle:"subscript"});C=Ll.createBox(St,v),R||(J=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/Ga/r.scalingFactor;let ze=null;if(C&&A){z=Math.max(z,_e,A.depth+.25*r.metrics.xHeight),J=Math.max(J,r.metrics.sub2);const St=r.metrics.defaultRuleThickness;if(z-A.depth-(C.height-J)<4*St){J=4*St-(z-A.depth)+C.height;const xt=.8*r.metrics.xHeight-(z-A.depth);xt>0&&(z+=xt,J-=xt)}const nr=this.isExtensibleSymbol&&u.italic?-u.italic:0;ze=new fs({individualShift:[{box:C,shift:J,marginLeft:nr},{box:A,shift:-z}]}).wrap(r)}else C&&!A?(J=Math.max(J,r.metrics.sub1,C.height-.8*ga),ze=new fs({shift:J,children:[{box:C,marginRight:Ie,marginLeft:this.isCharacterBox()?-u.italic:0}]})):!C&&A&&(z=Math.max(z,_e,A.depth+.25*ga),ze=new fs({shift:-z,children:[{box:A,marginRight:Ie}]}));return new or([u,new or(ze,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:n.type})}attachLimits(r,n){const a=this.superscript?Ll.createBox(new ji({parent:r,mathstyle:"superscript"},this.style),this.superscript):null,u=this.subscript?Ll.createBox(new ji({parent:r,mathstyle:"subscript"},this.style),this.subscript):null;return!a&&!u?n.base.wrap(r):sd(r,d(N({},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:nc(this.type);let R=(f=n==null?void 0:n.classes)!=null?f:"";this.mode==="text"&&(R+=" ML__text");const z=typeof A=="string"||A===void 0?new or(A!=null?A:null,{type:C,isSelected:this.isSelected,mode:this.mode,maxFontSize:r.scalingFactor,style:d(N({variant:"normal"},this.style),{fontSize:Math.max(1,r.size+r.mathstyle.sizeDelta)}),letterShapeStyle:r.letterShapeStyle,classes:R}):(v=Ll.createBox(r,A,{type:C,classes:R}))!=null?v:new or(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 od(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 ld(e,r,n){var a,u,f,v,A;if(!r||r.length===0)return null;const C=new ji({parent:e},n.style),R=!((a=C.atomIdsSettings)!=null&&a.groupNumbers);let z=[];if(r.length===1){const _e=r[0],Ie=_e.render(C);Ie&&(R&&_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&&w0(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()||w0(ze))&&(!_e||Ie!==ze.isDigit())&&(Ie=ze.isDigit(),_e=(v=ze.id)!=null?v:""),_e&&(!(ze.isDigit()||w0(ze))||!ze.hasEmptyBranch("superscript")||!ze.hasEmptyBranch("subscript"))&&(_e="")),R&&ze.isSelected&&St.selected(!0),z.push(St))}}if(z.length===0)return null;const J=new or(z,d(N({isTight:C.isTight},n),{type:(A=n.type)!=null?A:"lift"}));return J.isSelected=z.every(_e=>_e.isSelected),J.wrap(C)}function w0(e){return e.mode==="text"}function ud(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 Pu=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 cd(e,r){if(e.direction===r.direction){const n=e.ranges.length;if(r.ranges.length===n){let a=0;for(;a<n&&hd(e.ranges[a],r.ranges[a])==="equal";)a++;return a===n?"equal":"different"}}return"different"}function hd(e,r){return e[0]===r[0]&&e[1]===r[1]?"equal":"different"}function Ls(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 ao(e){return typeof e=="number"&&!Number.isNaN(e)}function oo(e){return Array.isArray(e)&&e.length===2}function Vs(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function dd(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 Hc(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,R=!1,z=!1,J=!1,_e=!1,Ie=!1,ze=!1,St=!1,nr=!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",R=xt.type==="mrel",z=xt.type==="mop"||xt.type==="operator"||xt.type==="extensible-symbol",J=xt.type==="mpunct"||xt.type==="minner",_e=xt.type==="array",Ie=xt.type==="mopen",ze=xt.type==="mclose"||xt.type==="leftright",nr=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")&&R||r.after.includes("operator")&&z||r.after.includes("punct")&&J||r.after.includes("array")&&_e||r.after.includes("openfence")&&Ie||r.after.includes("closefence")&&ze||r.after.includes("text")&&St||r.after.includes("space")&&nr?r.value:""}function S0(e,r,n){return n?Hc(e,n[r]):""}var bl={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\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 ru(e,r){var n;let a=(n=r==null?void 0:r.format)!=null?n:"auto";return a==="auto"&&([a,e]=iu(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",Ws(e,{inlineShortcuts:r==null?void 0:r.inlineShortcuts})]):["latex",e]}function Ws(e,r){var n,a,u;if(!e)return"";let f=!1,v;const A=(n=r.inlineShortcuts)!=null?n:bl;if(!f&&(e.startsWith("^")||e.startsWith("_"))&&(v=_l(e.slice(1),{inlineShortcuts:A,noWrap:!0}),e=e[0]+"{"+v.match+"}",e+=Ws(v.rest,r),f=!0),f||(v=e.match(/^(sqrt|\u221A)(.*)/),v&&(v=_l(v[2],{inlineShortcuts:A,noWrap:!0}),e="\\sqrt{"+((a=v.match)!=null?a:"\\placeholder{}")+"}",e+=Ws(v.rest,r),f=!0)),f||(v=e.match(/^(\\cbrt|\u221B)(.*)/),v&&(v=_l(v[2],{inlineShortcuts:A,noWrap:!0}),e="\\sqrt[3]{"+((u=v.match)!=null?u:"\\placeholder{}")+"}",e+=Ws(v.rest,r),f=!0)),f||(v=e.match(/^abs(.*)/),v&&(v=_l(v[1],{inlineShortcuts:A,noWrap:!0}),e="\\left|"+v.match+"\\right|",e+=Ws(v.rest,r),f=!0)),f||(v=e.match(/^["”“](.*?)["”“](.*)/),v&&(e="\\text{"+v[1]+"}",e+=Ws(v[2],r),f=!0)),f||(v=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),v&&(e=Ou(v[1],A),e+=Ws(v[2],r),f=!0)),!f&&/^([fgh])[^a-zA-Z]/.test(e)&&(v=_l(e.slice(1),{inlineShortcuts:A,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+v.match+"\\right)":e[0]+v.match,e+=Ws(v.rest,r),f=!0),f||(v=e.match(/^([a-zA-Z]+)(.*)/),v&&(e=Ou(v[1],A),e+=Ws(v[2],r),f=!0)),!f)if(v=_l(e,{inlineShortcuts:A,noWrap:!0}),v.match&&v.rest[0]==="/"){const C=_l(v.rest.slice(1),{inlineShortcuts:A,noWrap:!0});C.match&&(e="\\frac{"+v.match+"}{"+C.match+"}"+Ws(C.rest,r)),f=!0}else v.match&&(e=e.startsWith("(")?"\\left("+v.match+"\\right)"+Ws(v.rest,r):v.match+Ws(v.rest,r),f=!0);return f||(v=e.match(/^(\s+)(.*)$/),v&&(e=" "+Ws(v[2],r),f=!0)),e}function _l(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=Ws(e.substring(1,A-1),r):(u==="{"&&f==="}"&&(u="\\{",f="\\}"),n="\\left"+u+Ws(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=S0(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 Ou(e,r){let n=S0(null,e,r);return n?(n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),n+=" "):n=e,n}var Gc=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function xl(e){const r=e.trim();for(const n of Gc)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 iu(e){if(e=e.trim(),e.length<=1)return["latex",e];let r;return[r,e]=xl(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 E0="$$",fd="$$",pd=(e,r,n)=>(Gc.some(a=>r.startsWith(a[0])&&r.endsWith(a[1]))||(r=`${E0} ${r} ${fd}`),r),A0=class Yh{constructor(r){Yh._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)?Yh._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]:Ls(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]:Ls(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 Pu).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(R=>R.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 R=C.jsonSerializationOptions;C.jsonSerializationOptions={metadata:["latex"]};const z=C.parse(u.getValue(f,"latex-unstyled"));C.jsonSerializationOptions=R;const J=JSON.stringify(z.json);J&&n.clipboardData.setData("application/json",J)}catch(R){}}}n.preventDefault()}static insert(r,n,a={}){var u;const f=a.mode==="auto"?r.mode:(u=a.mode)!=null?u:r.mode;return Yh._modes[f].insert(r,n,a)}onPaste(r,n){return!1}insert(r,n,a){return!1}};A0._modes={};var Mn=A0,md=[{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","^"]}],uc={"\\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 wl(e){var r;return((r=e.element)==null?void 0:r.mathfield)===e}function Vc(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 Bu(e){const r=Vc(e);if(!r)return null;const n=r.getBoundingClientRect();return{x:n.right,y:n.bottom,height:n.height}}function Io(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 Wc(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 Wa(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=Wa(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 ia(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?Wa(f):null,e.atomBoundsCache&&(u?e.atomBoundsCache.set(r.id,u):e.atomBoundsCache.delete(r.id)),u!=null?u:null}function jc(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 R=Wc(e,ia(e,u),C);if(R){const z=Io(u);if(a.has(z)){const J=a.get(z);a.set(z,{left:Math.min(J.left,R.left),right:Math.max(J.right,R.right),top:Math.min(J.top,R.top),bottom:Math.max(J.bottom,R.bottom)})}else a.set(z,R)}}return[...a.values()]}function qc(e,r){return e.model.selection.ranges.reduce((n,a)=>n.concat(...jc(e,a,r)),[])}function k0(e,r){return e==="*"||r==="none"?!0:r==="same-origin"?!window.origin||e===window.origin:typeof r=="function"?r(e):!1}function Zc(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 gd=`@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;
}
`,vd=`.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);
}
`,Yc=`#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);
}
`,Ta=`/* 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;
}
`,lo=`/* 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);*/
}
`,yd=`.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));
}
`,bd=`: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;
}
`,_d=`.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;
}
`,Po;function Sl(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=vd;break;case"mathfield":r=gd;break;case"environment-popover":r=Yc;break;case"suggestion-popover":r=Ta;break;case"keystroke-caption":r=lo;break;case"virtual-keyboard":r=yd;break;case"ui":r=bd;break;case"menu":r=_d;break;default:debugger}return r}function nu(e){return Po||(Po={}),Po[e]||(Po[e]=new CSSStyleSheet,Po[e].replaceSync(Sl(e))),Po[e]}var js;function ja(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(Sl(e))),window.document.head.appendChild(n);return}if(js||(js={}),((r=js[e])!=null?r:0)!==0)js[e]+=1;else{const n=nu(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],js[e]=1}}function Oo(e){if("adoptedStyleSheets"in document&&js!=null&&js[e]&&(js[e]-=1,js[e]<=0)){const r=Po[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n!==r)}}var T0=class Mp extends $t{constructor(r){var n;super(d(N({},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(N({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(r){var n;const a=new ji({parent:r,mathstyle:"cramp"},this.style),u=(n=$t.createBox(a,this.body))!=null?n:new or("\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,ga),A;if(this.svgAccent)A=v0(this.svgAccent),v=a.metrics.bigOpSpacing1-v;else if(this.accent){const R=new or(this.accent,{fontFamily:"Main-Regular"});R.italic=0;const z=this.accent===8407?" ML__accent-vec":"";A=new or(new or(R),{classes:"ML__accent-body"+z})}A=new fs({shift:0,children:[{box:new or(u)},-v,{box:A,marginLeft:u.left+2*f,classes:["ML__center"]}]});const C=new or(A,{type:"lift"});return this.caret&&(C.caret=this.caret),this.bind(a,C.wrap(a)),this.attachSupsub(a,{base:C})}},su={"(":")","{":"}","[":"]","|":"|","\\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"},Fu=Object.fromEntries(Object.entries(su).map(([e,r])=>[r,e]));function Nu(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 C0(e,r,n,a){var u;const v=new or(Nu(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)*Bs),v}function Xc(e,r,n,a,u){var f,v;const A=new ji({parent:a,mathstyle:"textstyle"},u==null?void 0:u.style),C=new or(Nu(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)*Bs),C}function Jc(e,r,n,a,u){var f;let v,A,C,R;v=C=R=Nu(e),A=null;let z="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?C=v=R=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?C=v=R=8741:e==="\\uparrow"?C=R=9168:e==="\\Uparrow"?C=R=8214:e==="\\downarrow"?v=C=9168:e==="\\Downarrow"?v=C=8214:e==="\\updownarrow"?(v=8593,C=9168,R=8595):e==="\\Updownarrow"?(v=8657,C=8214,R=8659):e==="["||e==="\\lbrack"?(v=9121,C=9122,R=9123,z="Size4-Regular"):e==="]"||e==="\\rbrack"?(v=9124,C=9125,R=9126,z="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(C=v=9122,R=9123,z="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(v=9121,C=R=9122,z="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(C=v=9125,R=9126,z="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(v=9124,C=R=9125,z="Size4-Regular"):e==="("||e==="\\lparen"?(v=9115,C=9116,R=9117,z="Size4-Regular"):e===")"||e==="\\rparen"?(v=9118,C=9119,R=9120,z="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(v=9127,A=9128,R=9129,C=9130,z="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(v=9131,A=9132,R=9133,C=9130,z="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(v=9127,R=9129,C=9130,z="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(v=9131,R=9133,C=9130,z="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(v=9127,R=9133,C=9130,z="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(v=9131,R=9129,C=9130,z="Size4-Regular"):e==="\\surd"?(v=57345,R=9143,C=57344,z="Size4-Regular"):e==="\\ulcorner"?(v=9484,C=R=32):e==="\\urcorner"?(v=9488,C=R=32):e==="\\llcorner"?(R=9492,C=v=32):e==="\\lrcorner"&&(v=9496,C=v=32);const J=Co(v,z),_e=J.height+J.depth,Ie=Co(C,z),ze=Ie.height+Ie.depth,St=Co(R,z),nr=St.height+St.depth;let xt=0,Wt=1;if(A!==null){const Is=Co(A,z);xt=Is.height+Is.depth,Wt=2}const hr=_e+nr+xt,Zt=Math.max(0,Math.ceil((r-hr)/(Wt*ze))),Nr=hr+Zt*Wt*ze;let Qr=Bs;n&&(Qr=Qr*a.scalingFactor);const jr=Nr/2-Qr,Zi=.008,An=[];An.push({box:new or(R,{fontFamily:z})}),An.push(-Zi);const gr=new or(C,{fontFamily:z});if(A===null)for(let Is=0;Is<Zt;Is++)An.push({box:gr});else{for(let Is=0;Is<Zt;Is++)An.push({box:gr});An.push(-Zi),An.push({box:new or(A,{fontFamily:z})}),An.push(-Zi);for(let Is=0;Is<Zt;Is++)An.push({box:gr})}An.push(-Zi),An.push({box:new or(v,{fontFamily:z})});let Ra="";z==="Size1-Regular"?Ra=" delim-size1":z==="Size4-Regular"&&(Ra=" delim-size4");const Vo=new fs({bottom:jr,children:An},{classes:Ra});return new or(Vo,d(N({},u!=null?u:{}),{classes:((f=u==null?void 0:u.classes)!=null?f:"")+" ML__delim-mult"}))}var D0=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),xd=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),cc=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),wd=[0,1.2,1.8,2.4,3];function Qc(e,r,n,a){return e===void 0||e==="."?Al(n,a.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),D0.has(e)||cc.has(e)?Xc(e,r,!1,n,a):xd.has(e)?Jc(e,wd[r],!1,n,a):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var hc=[{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}],M0=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],Sd=[{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 eh(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function Ed(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=Co(e,eh(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(dl[Math.max(1,a.size-2)],a.minFontScale):n[f].mathstyle==="scriptstyle"&&(A*=Math.max(dl[Math.max(1,a.size-1)],a.minFontScale))),A>r)return n[f]}return n[n.length-1]}function L0(e,r,n,a,u,f){if(!r||r.length===0||r===".")return Al(u);r==="<"||r==="\\lt"?r="\\langle":(r===">"||r==="\\gt")&&(r="\\rangle");let v;cc.has(r)?v=hc:D0.has(r)?v=Sd:v=M0;const A=Ed(Nu(r),n,v,u),C=new ji({parent:u,mathstyle:A.mathstyle},f==null?void 0:f.style);return A.type==="small"?C0(r,C,a,d(N({},f),{type:e})):A.type==="large"?Xc(r,A.size,a,C,d(N({},f),{type:e})):(console.assert(A.type==="stack"),Jc(r,n,a,C,d(N({},f),{type:e})))}function El(e,r,n,a,u,f){if(r===".")return Al(u,f==null?void 0:f.classes);const v=Bs*u.scalingFactor,A=901,C=5/Ga,R=Math.max(n-v,a+v),z=Math.max(R/500*A,2*R-C);return L0(e,r,z,!0,u,f)}function Al(e,r){const n=new or(null,{classes:" nulldelimiter "+(r!=null?r:""),type:"ignore"});return n.width=e.getRegisterAsEm("nulldelimiterspace"),n.wrap(new ji({parent:e,mathstyle:"textstyle"}))}var Ca=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{}"}},th=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],rh=["cases","dcases","rcases"],R0=["align","align*","aligned","gather","gathered","split"],ih=["array","subequations","eqnarray"];function nh(e){return ih.concat(R0).concat(rh).concat(th).includes(e)}function sh(e){return th.includes(e)}function ah(e){return rh.includes(e)}function Ad(e){return R0.includes(e)}function dc(e,r,n){let a=0;for(const R of n)"align"in R&&(a+=1);let u=0;const f=[];for(const R of r){let z=0;for(u=Math.max(u,Math.min(R.length,a));z<R.length;){const J=[],_e=Math.min(R.length,z+a);for(;z<_e;){const Ie=R[z];Ie.length===0?J.push([new $t({type:"first",mode:e.mode})]):Ie[0].type!=="first"?J.push([new $t({type:"first",mode:e.mode}),...Ie]):(console.assert(!Ie.slice(1).some(ze=>ze.type==="first")),J.push(Ie)),z+=1}f.push(J)}}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 R of f){if(R.length!==u)for(let z=R.length;z<u;z++)R.push([new $t({type:"first",mode:e.mode}),new Ca]);v.push(R)}let A=0,C=0;for(const R of v){C=0;for(const z of R){for(const J of z)J.parent=e,J.parentBranch=[A,C];C+=1}A+=1}return e.isDirty=!0,v}var un=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=dc(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(N({},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(x0(r))return(n=this.array[r[0]][r[1]])!=null?n:void 0}createBranch(r){var n;return x0(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(Ro(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 ji({parent:r,mathstyle:this.mathstyleName},this.style),R=C.getRegisterAsEm("arrayrulewidth"),z=C.getRegisterAsEm("arraycolsep"),J=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 ji({parent:r,mathstyle:"scriptstyle"}).scalingFactor/r.scalingFactor));const ze=_e*ec,St=.7*ze,nr=.3*ze;let xt=0;const Wt=[];let hr=0;const Zt=this.array.length;for(let Rn=0;Rn<Zt;++Rn){const ls=this.array[Rn];hr=Math.max(hr,ls.length);const Ps=new ji({parent:C,mathstyle:this.mathstyleName},this.style);let Wo=St/Ps.scalingFactor,jo=nr/Ps.scalingFactor;const qo={cells:[],height:0,depth:0,pos:0};for(const go of ls){const gf=(u=$t.createBox(Ps,go,{type:"ignore"}))!=null?u:new or(null,{type:"ignore"});jo=Math.max(jo,gf.depth),Wo=Math.max(Wo,gf.height),qo.cells.push(gf)}let Zo=(f=Uc(this.rowGaps[Rn]))!=null?f:0;Zo>0&&(Zo+=nr,jo=Math.max(jo,Zo),Zo=0),Rn<Zt-1&&!sh(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(jo+=C.getRegisterAsEm("jot")),qo.height=Wo,qo.depth=jo,xt+=Wo,qo.pos=xt,xt+=jo+Zo,Wt.push(qo)}const Nr=xt/2+Bs,Qr=[];for(let Rn=0;Rn<hr;Rn++){const ls=[];for(const Ps of Wt){const Wo=Ps.cells[Rn];Wo.depth=Ps.depth,Wo.height=Ps.height,ls.push({box:Wo,shift:Ps.pos-Nr})}ls.length>0&&Qr.push(new fs({individualShift:ls}))}const jr=[];let Zi=!1,An=!1,gr=0,Ra=!this.leftDelim;const{colFormat:Vo}=this;for(const Rn of Vo){if("align"in Rn&&gr>=Qr.length)break;if("align"in Rn)Zi?jr.push(I0(2*Ie)):(An||Ra)&&jr.push(I0(Ie)),jr.push(new or(Qr[gr],{classes:"col-align-"+Rn.align})),gr++,Zi=!0,An=!1,Ra=!1;else if("gap"in Rn){if(typeof Rn.gap=="number")jr.push(I0(Rn.gap));else{const ls=fc(r,Wt,Nr,Rn.gap);ls&&jr.push(ls)}Zi=!1,An=!1,Ra=!1}else if("separator"in Rn){const ls=new or(null,{classes:"vertical-separator"});ls.height=xt,ls.setStyle("height",xt,"em"),ls.setStyle("border-right",`${R}em ${Rn.separator} currentColor`),ls.setStyle("vertical-align",-(xt-Nr),"em");let Ps=0;An?Ps=J-R:Zi&&(Ps=Ie-R),ls.left=Ps,jr.push(ls),Zi=!1,An=!0,Ra=!1}}Zi&&!this.rightDelim&&jr.push(I0(Ie));const Ya=new or(jr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Ya.caret=this.caret),this.bind(r,Ya);const Is=Ya.height,Ia=Ya.depth,ha=this.bind(r,new or([this.bind(r,El("open",(v=this.leftDelim)!=null?v:".",Is,Ia,C,{isSelected:this.isSelected})),Ya,this.bind(r,El("close",(A=this.rightDelim)!=null?A:".",Is,Ia,C,{isSelected:this.isSelected}))],{type:"ord"}));return ha?(ha.setStyle("display","inline-block"),this.caret&&(ha.caret=this.caret),this.bind(r,this.attachSupsub(r,{base:ha}))):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}}`),Wi(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($u(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($u(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,$u(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,$u(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 $u(e){const r=new $t({type:"first",mode:e.mode});r.parent=e;const n=new Ca;return n.parent=e,[r,n]}function I0(e){const r=new or(null,{classes:"arraycolsep"});return r.width=e,r}function fc(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 fs({individualShift:u}).wrap(e)}var uo=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(N({},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 ji({parent:r},this.style),R=C.toEm((a=this.padding)!=null?a:{register:"fboxsep"}),z=new or(null,{classes:"ML__box"});z.height=v.height+R,z.depth=v.depth+R,z.setStyle("box-sizing","border-box"),z.setStyle("position","absolute"),z.setStyle("top",-R+.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 J=new or([z,v],{type:"lift"});return J.setStyle("display","inline-block"),J.setStyle("position","relative"),J.setStyle("line-height",0),J.height=v.height+R+(A>0?A:0),J.depth=v.depth+R+(A<0?-A:0),J.setStyle("padding-left",R,"em"),J.setStyle("padding-right",R,"em"),J.setStyle("height",Math.floor(100*(v.height+v.depth+2*R+Math.abs(A)))/100,"em"),J.setStyle("margin-top",-R,"em"),J.setStyle("top",Math.floor(100*(v.depth-v.height+2*R-A))/100,"em"),J.setStyle("vertical-align",Math.floor(100*(v.depth+2*R))/100,"em"),this.caret&&(J.caret=this.caret),this.attachSupsub(r,{base:J})}_serialize(r){return r.skipStyles?Wi([this.bodyToLatex(r),this.supsubToLatex(r)]):super._serialize(r)}},P0=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 or(this.value,{classes:"ML__composition",type:"composition"});return this.bind(r,n),this.caret&&(n.caret=this.caret),n}_serialize(r){return""}},kl=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}},oh=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)}}`}},Pn=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"?Wi(["\\left",(n=this.leftDelim)!=null?n:".",this.bodyToLatex(r),"\\right",u]):this.variant==="mleft...mright"?Wi(["\\mleft",(a=this.leftDelim)!=null?a:".",this.bodyToLatex(r),"\\mright",u]):Wi([!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=su[a])!=null?n:a}render(r){var n,a;const u=new ji({parent:r},this.style);console.assert(this.body!==void 0);const f=new ji({parent:r,mathstyle:"textstyle"},this.style),v=(n=$t.createBox(u,this.body,{type:"inner"}))!=null?n:new or(null,{type:"inner"}),A=v.height/f.scalingFactor,C=v.depth/f.scalingFactor,R=[];if(this.leftDelim&&R.push(this.bind(f,El("open",this.leftDelim,A,C,f,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),v&&(lh(v.children,this,u,A,C),R.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="."),R.push(this.bind(f,El("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 J=this.leftSibling;J&&(!z&&J.isFunction&&(z=!0),!z&&J.type==="subsup"&&((a=J.leftSibling)!=null&&a.isFunction)&&(z=!0));const _e=new or(R,{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 lh(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,El("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&&lh(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}},uh=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}},ch=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 ji({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 or(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 R=new or(null,{classes:C,attributes:{part:"prompt"}});R.height=A.height+f,R.depth=A.depth+f,R.width=A.width+2*u,R.setStyle("box-sizing","border-box"),R.setStyle("position","absolute"),R.setStyle("height",A.height+A.depth+2*f,"em"),u===0&&R.setStyle("width","100%"),u!==0&&(R.setStyle("width",`calc(100% + ${2*u}em)`),R.setStyle("top",a,"em"),R.setStyle("left",-u,"em")),(!this.body||this.body.length===1)&&(R.width=3*u,R.setStyle("width",`calc(100% + ${3*u}em)`),R.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&&(R.svgOverlay=z);const J=new or([R,A],{classes:"ML__prompt-atom"});return J.setStyle("position","relative"),J.setStyle("display","inline-block"),J.setStyle("line-height",0),J.height=A.height+f+.2,J.depth=A.depth+f,J.left=u,J.right=u,J.setStyle("height",A.height+f,"em"),J.setStyle("top",A.depth-A.height,"em"),J.setStyle("vertical-align",A.depth+f,"em"),J.setStyle("margin-left",.5,"em"),J.setStyle("margin-right",.5,"em"),this.caret&&(J.caret=this.caret),this.bind(n,this.attachSupsub(r,{base:J}))}_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]"),Hn(u,a)}},zu=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 tu)r[a]&&n.setChildren(r[a],a);return n}render(r){var n;const a=new ji({parent:r,isPhantom:!0}),u=this.leftSibling,f=(n=u.render(a))!=null?n:new or(null),v=new or(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 au(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 ji&&!(n!=null&&n.parseMode)&&!n.mathstyle?r:new ji({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:N({},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(N({before:Yl(this.tokens.slice(this.index,this.index+10)),after:Yl(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 N({},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 zu({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?zs(r,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Ca({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();au(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(au(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()||!au(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 oh(r,this.parseMode,this.style);return n.verbatimLatex=Yl(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 Pn("",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(!au(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 kl("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new kl("\\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 kl(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 Pn(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(au(e)){const n=va.createAtom(this.parseMode,e,N({},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 kl(e)];if(n.definitionType==="symbol"){const a=N({},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 kl(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"),R=$t.serialize(C,{defaultMode:"math"});let z=[],J;!J&&R==="correct"?J="correct":!J&&R==="incorrect"?J="incorrect":R!==""&&(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 ch(A,J,_e,ze!=null?ze:z,{mode:this.parseMode,style:this.style})]:[new Ca({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 R=this.scanArgument("string");R!==null&&(this.context.registers[C.substring(1)]=R);const z=Wi([e,Yl(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 kl(e)]);const v=this.index;if(f.definitionType==="symbol"){const A=N({},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,R=[];if(f.parse?R=f.parse(this):[C,R]=this.scanArguments(f),this.parseMode=A,f.applyMode&&!f.applyStyle&&!f.createAtom)return Xe(R[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:R,style:this.style,mode:this.parseMode}),C&&(u.body=Xe(this.scanArgument(C)));else if(typeof f.applyStyle=="function"){const z=N(N({},this.style),f.applyStyle(e,R,this.context)),J=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=J,Xe(Ie)}this.style=z}else u=new $t({type:"mord",command:(n=f.command)!=null?n:e,style:N({},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=Wi([e,Yl(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(au(e)){const r=va.createAtom(this.parseMode,e,N({},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 Pu(" "," ",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=Yl(this.tokens.slice(C,this.index))}f[v]=A}return new pc(e,{expand:n.expand,captureSelection:n.captureSelection,args:a===this.index?null:Yl(this.tokens.slice(a,this.index)),style:this.parsingContext.style,body:zs(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 zs(e,r){var n,a,u,f;const v=(n=r==null?void 0:r.args)!=null?n:void 0,A=new hh(ic(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 dh(e,r){var n;const a=new hh(ic(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 mc=class Kp extends $t{constructor(r,n){super({type:"chem"},{command:r,mode:"math"});const a=Nn.go(er.go(n,r==="\\pu"?"pu":"ce"),!1);this.body=zs(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(N({},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 mc(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 R=0;R<C.length;R++){var z=er.patterns.match_(C[R].pattern,e);if(z){for(var J=C[R].task,_e=0;_e<J.action_.length;_e++){var Ie;if(A.actions[J.action_[_e].type_])Ie=A.actions[J.action_[_e].type_](a,z.match_,J.action_[_e].option);else if(er.actions[J.action_[_e].type_])Ie=er.actions[J.action_[_e].type_](a,z.match_,J.action_[_e].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+J.action_[_e].type_+")"];er.concatArray(v,Ie)}if(n=J.nextState||n,e.length>0){if(J.revisit||(e=z.remainder),!J.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,R){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},J=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=J(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 nr=[ze,St.match_];return{match_:R?nr.join(""):nr,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("|"),R=0;R<C.length;R++)if(a[u]==="*")for(var z in f)f[z].push({pattern:C[R],task:v});else f[a[u]].push({pattern:C[R],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 Nn={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+=Nn._go2(f),f.type_==="1st-level escape"&&(a=!0))}return!r&&!a&&n&&(n="{"+n+"}"),n},_goInner:function(e){return e&&Nn.go(e,!0)},_go2:function(e){var r;switch(e.type_){case"chemfive":r="";var n={a:Nn._goInner(e.a),b:Nn._goInner(e.b),p:Nn._goInner(e.p),o:Nn._goInner(e.o),q:Nn._goInner(e.q),d:Nn._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 "+Nn._goInner(e.p1);break;case"state of aggregation subscript":r="\\mskip1mu "+Nn._goInner(e.p1);break;case"bond":if(r=Nn._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{"+Nn._goInner(e.p1)+"}{"+Nn._goInner(e.p2)+"}";r="\\mathchoice{\\textstyle"+u+"}{"+u+"}{"+u+"}{"+u+"}";break;case"tex-math":r=e.p1+" ";break;case"frac-ce":r="\\frac{"+Nn._goInner(e.p1)+"}{"+Nn._goInner(e.p2)+"}";break;case"overset":r="\\overset{"+Nn._goInner(e.p1)+"}{"+Nn._goInner(e.p2)+"}";break;case"underset":r="\\underset{"+Nn._goInner(e.p1)+"}{"+Nn._goInner(e.p2)+"}";break;case"underbrace":r="\\underbrace{"+Nn._goInner(e.p1)+"}_{"+Nn._goInner(e.p2)+"}";break;case"color":r="{\\color{"+e.color1+"}{"+Nn._goInner(e.color2)+"}}";break;case"color0":r="\\color{"+e.color+"}";break;case"arrow":var f={rd:Nn._goInner(e.rd),rq:Nn._goInner(e.rq)},v=Nn._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=Nn._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 yf(e){}function bf(e){}var fh=class Hp extends $t{constructor(r){super(d(N({},r),{type:"delim"})),this.value=r.delim,this.size=r.size}static fromJson(r){return new Hp(r)}toJson(){return d(N({},super.toJson()),{delim:this.value,size:this.size})}render(r){return new or(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):Hn(this.command,this.value)}},ph=class Gp extends $t{constructor(r){super(d(N({},r),{type:"sizeddelim",value:r.delim})),this.delimType=r.delimType,this.size=r.size}static fromJson(r){return new Gp(r)}toJson(){return d(N({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(r){let n=Qc(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):Hn(this.command,this.value)}},ou=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(N({},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 Hn(u,this.bodyToLatex(r))}render(r){const n=new ji({parent:r},this.style),a=$t.createBox(n,this.body);if(!a)return null;const u=kd(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 or(null,{classes:"ML__notation"});let A=a.height+a.depth+2*f;const C=a.width+2*f;let R="";if(this.notation.horizontalstrike&&(R+=this.line(3,50,97,50)),this.notation.verticalstrike&&(R+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(R+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(R+=this.line(3,3,97,97)),this.notation.updiagonalarrow){R+=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,nr=(a.depth+a.height)*ze,xt=f+a.width;let Wt=f;Wt+nr-.4*St<0&&(Wt=.4*St-nr),R+='<polygon points="',R+=`${xt},${Wt} ${xt-St-.4*nr},${Wt+nr-.4*St} `,R+=`${xt-.7*St},${Wt+.7*nr} ${xt-St+.4*nr},${Wt+nr+.4*St} `,R+=`${xt},${Wt}`,R+=`" stroke='none' fill="${this.strokeColor}"`,R+="/>"}let z=0;if(this.notation.phasorangle){const _e=mh(n),Ie=(a.height+a.depth+2*_e+f).toString(),ze=(a.height+a.depth)/2;R+=this.line(f.toString(),Ie,(f+ze+a.width).toString(),Ie),R+=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=mh(n);A+=_e,R+=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),R+='<path d="',R+=`M ${f} ${f} a${Ie} ${(a.depth+a.height+2*_e)/2}, 0, 1, 1, 0 ${a.depth+a.height+2*_e} "`,R+=` stroke-width="${Td(n)}" stroke="${this.strokeColor}" fill="none"`,R+="/>"}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),R){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=R}const J=new or([v,a]);return J.setStyle("position","relative"),J.setStyle("vertical-align",f,"em"),J.setStyle("height",`${Math.floor(100*(a.height+a.depth+2*f))/100}em`),J.setStyle("display","inline-block"),J.height=v.height,J.depth=v.depth,J.width=v.width-2*f,J.left=f,J.right=f,this.caret&&(J.caret=this.caret),J.wrap(n)}line(r,n,a,u){return`<line x1="${O0(r)}" y1="${O0(n)}" x2="${O0(a)}" y2="${O0(u)}" vector-effect="non-scaling-stroke"></line>`}};function O0(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function kd(e){if(!e)return"1px";const r=e.match(/([0-9][a-zA-Z\%]+)/);return r===null?"1px":r[1]}function Td(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function mh(e){const r=e.isDisplayStyle?ga:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*r/4}var Bo=class Wp extends $t{constructor(r,n,a){var u,f;super(d(N({},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),N(N({},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 ji({parent:r,mathstyle:this.mathstyleName},this.style),f=u.metrics,v=new ji({parent:u,mathstyle:this.continuousFraction?"":"numerator"},this.style),A=this.numerPrefix?new or([new or(this.numerPrefix),$t.createBox(v,this.above)],{isTight:v.isTight,type:"ignore"}):(n=$t.createBox(v,this.above,{type:"ignore"}))!=null?n:new or(null,{type:"ignore"}),C=new ji({parent:u,mathstyle:this.continuousFraction?"":"denominator"},this.style),R=this.denomPrefix?new or([new or(this.denomPrefix),$t.createBox(C,this.below,{type:"ignore"})]):(a=$t.createBox(C,this.below,{type:"ignore"}))!=null?a:new or(null,{type:"ignore"}),z=this.hasBarLine?f.defaultRuleThickness:0;let J,_e=0,Ie;u.isDisplayStyle?(J=v.metrics.num1,_e=z>0?3*z:7*z,Ie=C.metrics.denom1):(z>0?(J=v.metrics.num2,_e=z):(J=v.metrics.num3,_e=3*f.defaultRuleThickness),Ie=C.metrics.denom2);const ze=[];this.isSelected&&ze.push("ML__selected");const St=A.depth,nr=R.height;let xt;if(z<=0){const jr=J-St-(nr-Ie);jr<_e&&(J+=(_e-jr)/2,Ie+=(_e-jr)/2),xt=new fs({individualShift:[{box:A,shift:-J,classes:[...ze,"ML__center"]},{box:R,shift:Ie,classes:[...ze,"ML__center"]}]}).wrap(u)}else{const jr=new or(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});jr.softWidth=Math.max(A.width,R.width),jr.height=z/2,jr.depth=z/2;const Zi=Bs+z/2;J<_e+St+Zi&&(J=_e+St+Zi);const An=Bs-z/2;Ie<_e+nr-An&&(Ie=_e+nr-An),xt=new fs({individualShift:[{box:R,shift:Ie,classes:[...ze,"ML__center"]},{box:jr,shift:-An,classes:ze},{box:A,shift:-J,classes:[...ze,"ML__center"]}]}).wrap(u)}const Wt=u.isDisplayStyle?f.delim1:f.delim2,hr=this.leftDelim?this.bind(r,L0("open",this.leftDelim,Wt,!0,r,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Al(u,"open");let Zt=null;this.continuousFraction?Zt=new or(null,{type:"close"}):this.rightDelim?Zt=this.bind(r,L0("close",this.rightDelim,Wt,!0,r,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Zt=Al(u,"close");const Nr=new or([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})}},As=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),N({type:"latex",value:this.value},r)}get computedStyle(){return{}}render(r){const n=new or(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}},Fo=class qp extends $t{constructor(r){super({type:"latexgroup",mode:"latex"}),this.body=[...r].map(n=>new As(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:""}},gc=class Zp extends $t{constructor(r,n){super(d(N({},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 or(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-Bs*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 or(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)),Wi(a)}},Tl=class Yp extends $t{constructor(r){const n=r.body;super(d(N({},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),N(N({},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 or([n,new or(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},ba=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?v0(this.svgBody):$t.createBox(r,this.body,{type:"ignore"});const a=new ji({parent:r,mathstyle:"scriptstyle"},this.style);let u=null;this.svgAbove?u=v0(this.svgAbove):this.above&&(u=$t.createBox(a,this.above,{type:"ignore"}));let f=null;this.svgBelow?f=v0(this.svgBelow):this.below&&(f=$t.createBox(a,this.below,{type:"ignore"})),this.paddedBody&&(n=new or([Al(r,"open"),n,Al(r,"close")],{type:"ignore"}));let v=Cd(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 Cd(e,r){if(!r.base)return null;if(!r.above&&!r.below){const A=new or(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 fs({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 fs({top:u.height-f,children:[e.metrics.bigOpSpacing5,{box:r.below,classes:v},{box:u,classes:["ML__center"]}]}):r.above&&(a=new fs({bottom:u.depth+f,children:[{box:u,classes:["ML__center"]},n,{box:r.above,classes:v},e.metrics.bigOpSpacing5]}));return new or(a,{type:r.type})}var lu=class Jp extends $t{constructor(r){var n,a,u,f;super(d(N({},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),N(N({},super.toJson()),r)}render(r){const n=new ji({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 or(null,{classes:"fix"});return new or([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 fs({firstBaseline:[{box:a}]},{type:a.type}).wrap(r)}},uu=class Qp extends $t{constructor(r){var n;super(N({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 or(this.mode==="math"?null:" ");let a;if(this.width!==void 0)a=new or(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 or(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}{${Ms(this.width)}}`:`${u}${Ms(this.width)}`}},gh=class e1 extends $t{constructor(r){var n;super(d(N({},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(N({},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")?Hn(`${a}[${this.aboveToLatex(r)}]`,u):/^[0-9]$/.test(u)?`${a}${u}`:Hn(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 ji({parent:r,mathstyle:"cramp"},this.style),u=(n=$t.createBox(a,this.body,{type:"inner"}))!=null?n:new or(null),f=a.scalingFactor,v=a.metrics.defaultRuleThickness/f,A=r.isDisplayStyle?ga:v,C=new or(null,{classes:"ML__sqrt-line",style:this.style});C.height=v,C.softWidth=u.width;let R=f*(v+A/4);const J=Math.max(f*2*A,u.height+u.depth)+R+v,_e=new ji({parent:r},this.style),Ie=this.bind(_e,new or(L0("inner","\\surd",J,!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+R&&(R=(R+ze-(u.height+u.depth))/2),Ie.setTop(Ie.height-u.height-R);const St=this.bind(r,new fs({firstBaseline:[{box:new or(u)},R-2*v,{box:C},v]})),nr=$t.createBox(new ji({parent:r,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!nr){const hr=new or([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 fs({shift:-.6*(Math.max(Ie.height,St.height)-Math.max(Ie.depth,St.depth)),children:[{box:nr}]}),Wt=new or([new or(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)}},vc=class extends or{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 Uu(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"){Uu(e.parent,r);return}a>0&&n[a-1].type==="skip"?n[a-1].width+=r:n.splice(a,0,new vc(r))}var B0={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}},Dd={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function Md(e){Hu(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 Ku(e,r){if(!e.children)return e;const n=e.children;Md(n);const a=r.getRegisterAsEm("thinmuskip"),u=r.getRegisterAsEm("medmuskip"),f=r.getRegisterAsEm("thickmuskip");return Hu(n,(v,A)=>{var C,R,z;if(!v)return;const J=v.type,_e=A.isTight?(C=Dd[J])!=null?C:null:(R=B0[J])!=null?R:null,Ie=(z=_e==null?void 0:_e[A.type])!=null?z:null;Ie===3&&Uu(A,a),Ie===4&&Uu(A,u),Ie===5&&Uu(A,f)}),e}function Hu(e,r,n=void 0){if(!e)return n;e=[...e];for(const a of e)a.type==="lift"?n=Hu(a.children,r,n):a.type==="ignore"?Hu(a.children,r):(r(n,a),Hu(a.children,r),n=a);return n}var F0=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(N({},r),{tooltip:co(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(N({},super.toJson()),{tooltip:n})}render(r){const n=$t.createBox(new ji,this.body);if(!n)return null;const a=new ji({parent:r,mathstyle:"displaystyle"},{fontSize:fl}),u=m0(Ku(new or(this.tooltip.render(a),{classes:"ML__tooltip-content"}),a)),f=new or([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({},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 or(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 or(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)),Wi(a)}};function co(e){if(k(e))return e.map(a=>co(a));if(typeof e=="string")return $t.fromJson(e);e=N({},e);for(const a of tu)e[a]&&(e[a]=co(e[a]));e.args&&(e.args=Ld(e.args)),e.array&&(e.array=co(e.array));const r=e.type;let n;r==="accent"&&(n=T0.fromJson(e)),r==="array"&&(n=un.fromJson(e)),r==="box"&&(n=uo.fromJson(e)),r==="chem"&&(n=mc.fromJson(e)),r==="composition"&&(n=P0.fromJson(e)),r==="delim"&&(n=fh.fromJson(e)),r==="enclose"&&(n=ou.fromJson(e)),r==="error"&&(n=kl.fromJson(e)),r==="extensible-symbol"&&(n=gc.fromJson(e)),r==="genfrac"&&(n=Bo.fromJson(e)),r==="group"&&(n=oh.fromJson(e)),r==="latex"&&(n=As.fromJson(e)),r==="latexgroup"&&(n=Fo.fromJson(e)),r==="leftright"&&(n=Pn.fromJson(e)),r==="macro"&&(n=pc.fromJson(e)),r==="macro-argument"&&(n=uh.fromJson(e)),r==="operator"&&(n=No.fromJson(e)),r==="overlap"&&(n=Tl.fromJson(e)),r==="overunder"&&(n=ba.fromJson(e)),r==="placeholder"&&(n=Ca.fromJson(e)),r==="prompt"&&(n=ch.fromJson(e)),r==="phantom"&&(n=lu.fromJson(e)),r==="sizeddelim"&&(n=ph.fromJson(e)),r==="spacing"&&(n=uu.fromJson(e)),r==="subsup"&&(n=zu.fromJson(e)),r==="surd"&&(n=gh.fromJson(e)),r==="text"&&(n=Pu.fromJson(e)),r==="tooltip"&&(n=F0.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 tu)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 Ld(e){if(e&&Array.isArray(e))return e.map(r=>r==="<null>"?null:typeof r=="object"&&"group"in r?{group:r.group.map(n=>co(n))}:typeof r=="object"&&"atoms"in r?r.atoms.map(n=>co(n)):r)}var vh={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"]},yc={"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]$/},yh=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,Rd=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,bh=[/^[a-z]$/,/^[A-Z]$/,yh,Rd],bc={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},Id=class extends va{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 R=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&&(R.isFunction=!0),e.startsWith("\\")&&(R.verbatimLatex=e),R}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=$o(e,d(N({},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&&bh.forEach((A,C)=>{var R;A.test(e.value)&&bc[(R=r.letterShapeStyle)!=null?R:"tex"][C]==="it"&&(a="italic")}),a==="up"&&(a=void 0);const u=a?n+"-"+a:n;console.assert(vh[u]!==void 0);const[f,v]=vh[u];return yc[n]&&!yc[n].test(e.value)?(e.value=st(e.value,n,a),null):(yh.test(e.value)&&(e.classes+=" lcGreek"),v&&(e.classes+=" "+v),f)}};function $o(e,r){const{parent:n}=e[0],a=h(n);return Do(e,"variant").map(u=>{const f=h(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=Wi(u.map(C=>C._serialize(r)));return v?Hn(v,A):A})}function h(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 Id;function t(e,r){return e.map(n=>n._serialize(r))}function i(e,r){return Do(e,"fontShape").map(n=>{const a=t(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?`{${Hn("\\fontshape",u)}${Wi(a)}}`:f?Hn(f,Wi(a)):Wi(a)})}function s(e,r){return Do(e,"fontSeries").map(n=>{const a=i(n,r),{fontSeries:u}=n[0].style;let f="";return u==="b"&&(f="\\textbf"),u==="l"&&(f="\\textlf"),u==="m"&&(f="\\textmd"),u&&!f?`{${Hn("\\fontseries",u)}${Wi(a)}}`:f?Hn(f,Wi(a)):Wi(a)})}function o(e,r){return Do(e,"fontSize").map(n=>{var a,u;const f=s(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} ${Wi(f)}`:Wi(f)})}function l(e,r,n){return Do(e,"fontFamily").map(a=>{var u,f;const v=o(a,r),A=(f={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(u=a[0].style.fontFamily)!=null?u:""])!=null?f:"";return A?`\\${A}{${Wi(v)}}`:a[0].style.fontFamily?`{\\fontfamily{${a[0].style.fontFamily}} ${Wi(v)}}`:n?`\\text{${Wi(v)}}`:Wi(v)})}var c={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},p=class extends va{constructor(){super("text")}createAtom(e,r,n){return r&&r.definitionType==="symbol"?new Pu(e,String.fromCodePoint(r.codepoint),n!=null?n:{}):null}serialize(e,r){return l(e,d(N({},r),{defaultMode:"text"}),r.defaultMode!=="text")}getFont(e,r){var n,a,u,f,v;const{fontFamily:A}=r;if(c[A]?e.classes+=" "+c[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 p;var y=class extends va{constructor(){super("latex")}createAtom(e){return new As(e)}serialize(e,r){return e.filter(n=>n instanceof As&&!n.isSuggestion).map(n=>n.value)}getFont(){return null}};new y;var g={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:["","=","","="]}},x={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:["","=","","="]}},S={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:["\\","|","",""]}},L={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:["=","=","=","="]}},$={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:["<",">","",""]}},te={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"]}},Q={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:["=","=","=","="]}},Te={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:["<",">","|",""]}},Ve={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:[".",".",".","."]}},$e={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"]}},ht={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:["<",">","",""]}},mt={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 Ft(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 dt(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 Tt={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]"},Ut=[],bt;function fr(){switch(ae()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function vr(e){(!e.platform||e.platform===fr())&&Ut.push(e)}function Ji(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=Tt[e])!=null?n:"",a}function wi(e){if(e.code)return e;const r=Object.entries(ai().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(N({},e),{altKey:n,shiftKey:a,code:u}))}function di(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 Ut)((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);Ut.sort((u,f)=>f.score-u.score)}function Zr(e){bt=Ut.find(r=>e.startsWith(r.locale))}function ai(){return bt!=null?bt:Ut[0]}function hi(){switch(fr()){case"apple":return x;case"windows":return S;case"linux":return L}return x}switch(fr()){case"apple":vr(x),vr(F),vr($e),vr(Q);break;case"windows":vr(S),vr($),vr(ht),vr(Te);break;case"linux":vr(L),vr(te),vr(mt),vr(Ve);break}vr(g);function pr(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 _r(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 xi(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 ki(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 qi=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 en(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:qi.has(e.code)}function mn(){var e;let r=document.activeElement;for(;(e=r==null?void 0:r.shadowRoot)!=null&&e.activeElement;)r=r.shadowRoot.activeElement;return r}var tn=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=mn();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:"",mn()!==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 qs(e,r,n){let a=null,u=null,f=!1,v=!1,A=!1;const C=new AbortController,R=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:R}),e.addEventListener("keypress",z=>{f||(a&&u&&n.onKeystroke(a),u=z)},{capture:!0,signal:R}),e.addEventListener("compositionstart",z=>{e.textContent="",f=!0,n.onCompositionStart(z.data)},{capture:!0,signal:R}),e.addEventListener("compositionupdate",z=>{f&&n.onCompositionUpdate(z.data)},{capture:!0,signal:R}),e.addEventListener("compositionend",z=>{e.textContent="",f&&(f=!1,n.onCompositionEnd(z.data))},{capture:!0,signal:R}),e.addEventListener("beforeinput",z=>z.stopImmediatePropagation(),{signal:R}),e.addEventListener("input",z=>{var J;if(!f&&(e.textContent="",z.inputType!=="insertCompositionText")){if(z.inputType==="insertFromPaste"){z.preventDefault(),z.stopPropagation();return}n.onInput((J=z.data)!=null?J:""),z.preventDefault(),z.stopPropagation()}},{signal:R}),e.addEventListener("paste",z=>{e.focus({preventScroll:!0}),e.textContent="",n.onPaste(z)||z.preventDefault(),z.stopImmediatePropagation()},{signal:R}),e.addEventListener("cut",z=>n.onCut(z),{capture:!0,signal:R}),e.addEventListener("copy",z=>n.onCopy(z),{capture:!0,signal:R}),e.addEventListener("blur",z=>{var J,_e;if(((_e=(J=z.relatedTarget)==null?void 0:J._mathfield)==null?void 0:_e.element)===r){e.focus({preventScroll:!0}),z.preventDefault(),z.stopPropagation();return}const Ie=tn.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:R}),e.addEventListener("focus",z=>{A||v||(v=!0,n.onFocus(),v=!1)},{capture:!0,signal:R}),{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:()=>mn()===e,setAriaLabel:z=>e.setAttribute("aria-label",z),setValue:z=>{var J;e.textContent=z,e.style.left="-1000px",(J=window.getSelection())==null||J.selectAllChildren(e)},moveTo:(z,J)=>{e.style.top=`${J}px`,e.style.left=`${z}px`}}}function ks(e){var r;if(!e||!en(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 ho(e){e=wi(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 _h(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 Pd(e,r,n){if(e.length===0)return"";const a=dt(Ft(ho(n))),u=dt({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 xh(e){let r=e;return k(r)&&(r=r.length>0?r[0]+"("+r.slice(1).join("")+")":""),r}function _c(e,r){let n=[];if(typeof r=="string"){const f=uc[r];k(f)?n=f.slice():f&&n.push(f)}const a=xh(r),u=new RegExp("^"+a.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const f of e)u.test(xh(f.command))&&n.push(f.key);return n.map(pr)}function xc(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=Ft(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&&!_h(a))return;if(/^\[.+\]$/.test(n.key))return d(N({},e),{key:dt(n)});const u=Ji(n.key,r);if(!u)return d(N({},e),{key:dt(n)});if(u.shift&&n.shift||u.alt&&n.alt)throw new Error(`The keybinding ${e.key} (${wh(e.command)}) is conflicting with the key combination ${dt(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(N({},e),{key:dt(u)})}function wh(e){if(Array.isArray(e)){const r=[...e];return r.shift()+"("+r.map(n=>typeof n=="string"?`"${n}"`:n.toString()).join(", ")+")"}return e}function yn(e,r){const n=[],a=[];for(const u of e)try{const f=xc(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} (${wh(u.command)}) matches ${v.key} (${wh(v.command)}) with the ${r.displayName} keyboard layout`);a.push(f)}catch(f){f instanceof Error&&n.push(f.message)}return[a,n]}var Us=class extends Mn{constructor(){super("latex")}createAtom(e){return new As(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(Ls(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 As(C));let v=e.at(e.position);if(v instanceof Fo&&(v=v.lastChild),!(v.parent instanceof Fo)){const C=new Fo("");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 _a(e){return e.atoms.find(r=>r.type==="latexgroup")}function Da(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 xa(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 As&&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 As&&C.isSuggestion),A||v++}return[a-1,v-1]}new Us;function fo(e){const r=Da(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 Ma(e,r){var n;const{model:a}=e;fo(e);for(const z of Da(a))z.isError=!1;if(!a.selectionIsCollapsed||e.options.popoverPolicy==="off"){qa(e);return}const u=[];let f=a.at(a.position);for(;f&&f instanceof As&&/^[a-zA-Z\*]$/.test(f.value);)f=f.leftSibling;if(f&&f instanceof As&&f.value==="\\")for(u.push(f),f=f.rightSibling;f&&f instanceof As&&/^[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;qa(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 R=A[e.suggestionIndex];if(R!==v){const z=u[u.length-1];z.parent.addChildrenAfter([...R.slice(v.length-R.length)].map(J=>new As(J,{isSuggestion:!0})),z),Wu(e,{interactive:!0})}Od(e,A)}function wc(e){const[r,n]=xa(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 po(e,r="accept",n){var a,u;qa(e);const f=_a(e.model);if(!f)return!1;if(r==="accept-suggestion"||r==="accept-all"){const R=Da(e.model).filter(z=>z.isSuggestion);if(R.length!==0){for(const z of R)z.isSuggestion=!1;e.model.position=e.model.offsetOf(R[R.length-1])}if(r==="accept-suggestion")return R.length!==0}const A=Da(e.model).filter(R=>!R.isSuggestion).map(R=>R.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"||(Mn.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 Gu(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 Cl(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 Sh(e,r){const n=new ji({from:e.context}),a=new $t({mode:"math",type:"root",body:zs(r,{context:n})}),u=m0(Ku(new or(a.render(n),{classes:"ML__base"}),n));return g0(u,{classes:"ML__latex"}).toMarkup()}function Od(e,r){var n;if(r.length===0){qa(e);return}let a="";for(const[f,v]of r.entries()){const A=v,C=Sh(e,v),R=_c(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>`,R&&(a+=`<span class="ML__popover__keybinding">${R}</span>`),a+="</li>"}const u=o1(e,`<ul>${a}</ul>`);N0()&&((n=u.querySelector(".ML__popover__current"))==null||n.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var f;u&&!N0()&&(u.classList.add("is-visible"),Vu(e),(f=u.querySelector(".ML__popover__current"))==null||f.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function N0(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function Vu(e,r){var n;if(!e.element||e.element.mathfield!==e||!N0())return;if(((n=e.model.at(e.model.position))==null?void 0:n.type)!=="latex"){qa(e);return}if(r!=null&&r.deferred){setTimeout(()=>Vu(e),32);return}const a=Bu(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,R=document.getElementById("mathlive-suggestion-popover");a.x+R.offsetWidth/2>f-v?R.style.left=`${f-R.offsetWidth-v}px`:a.x-R.offsetWidth/2<0?R.style.left="0":R.style.left=`${a.x-R.offsetWidth/2}px`;const z=a.y-a.height;u-A-C-a.y<z?(R.classList.add("ML__popover--reverse-direction"),R.classList.remove("top-tip"),R.classList.add("bottom-tip"),R.style.top=`${a.y-a.height-R.offsetHeight-15}px`):(R.classList.remove("ML__popover--reverse-direction"),R.classList.add("top-tip"),R.classList.remove("bottom-tip"),R.style.top=`${a.y+15}px`)}function qa(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=Gu("mathlive-suggestion-popover"),ja("suggestion-popover"),ja("core"),n.addEventListener("pointerdown",a=>a.preventDefault()),n.addEventListener("click",a=>{let u=a.target;for(;u&&!u.dataset.command;)u=u.parentElement;u&&(po(e,"reject"),Mn.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")&&(Cl("mathlive-suggestion-popover"),Oo("suggestion-popover"),Oo("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 Eh=null,_f,xf,Bd=((xf=(_f=globalThis==null?void 0:globalThis.document)==null?void 0:_f.currentScript)==null?void 0:xf.src)||u1();function wf(e){return pu(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(Eh===null)try{const r=yield fetch(Bd,{method:"HEAD"});r.status===200&&(Eh=r.url)}catch(r){console.error(`Invalid URL "${e}" (relative to "${Bd}")`)}return new URL(e,Eh!=null?Eh:Bd).href})}function c1(e,r,n={}){return new FontFace(e,`url(${r}.woff2) format('woff2')`,n)}var La="not-loaded";function h1(){return pu(this,null,function*(){return La="not-loaded",Ah()})}function Ah(){return pu(this,null,function*(){var e;if(La!=="not-loaded")return;if(La="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){La="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))){La="ready";return}if(!window.MathfieldElement.fontsDirectory){La="not-loaded";return}const u=yield wf(window.MathfieldElement.fontsDirectory);if(!u){document.body.classList.add("ML__fonts-did-not-load"),La="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)),La="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")}La="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(()=>{wl(e)&&e.dirty&&(e.atomBoundsCache=new Map,Wu(e,r),e.atomBoundsCache=void 0)})))}function f1(e,r){var n;r=r!=null?r:{};const a=new ji({from:d(N({},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 g0(Ku(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 Wu(e,r){if(!wl(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">${Rs(C)}</span>`)}a.innerHTML=window.MathfieldElement.createHTML(v),kh(e,r.interactive),e.dirty=!1}function kh(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)&&La!=="error"&&La!=="ready"&&setTimeout(()=>{La==="ready"?kh(e):setTimeout(()=>kh(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){Vu(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=Wc(e,ia(e,A),v);if(C){C.left/=v,C.right/=v,C.top/=v,C.bottom/=v;const R=document.createElement("div");R.classList.add("ML__contains-highlight"),R.style.position="absolute",R.style.left=`${C.left+1}px`,R.style.top=`${Math.ceil(C.top)}px`,R.style.width=`${Math.ceil(C.right-C.left)}px`,R.style.height=`${Math.ceil(C.bottom-C.top)}px`,n.insertBefore(R,n.childNodes[0])}}return}for(const A of p1(qc(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,zo;function wa(e,r){r=N({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},r!=null?r:{}),zo||(zo={});for(const n of Object.keys(e))console.assert(!zo[n],"Selector already defined: ",n),zo[n]=d(N({},r),{fn:e[n]})}function Fd(e){let r;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return Fd(e[1]);r=e[0]}else r=e;return r=r.replace(/-\w/g,n=>n[1].toUpperCase()),zo[r]}function $0(e){var r;return(r=Fd(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,R=>R[1].toUpperCase());const A=zo[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)||fo(e),zo[a].fn(e.model,...u),Ma(e),v=!0,f=!0}else if(C==="virtual-keyboard")v=(n=window.mathVirtualKeyboard.executeCommand(r))!=null?n:!1,f=!0;else if(zo[a]){if(!e.isSelectionEditable&&(A!=null&&A.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(a)&&e.flushInlineShortcutBuffer(),v=zo[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=Fd(r);window.MathfieldElement.playSound((n=a==null?void 0:a.audioFeedback)!=null?n:"keypress");const u=e.executeCommand(r);return e.scrollIntoView(),u}wa({performWithFeedback:(e,r)=>g1(e,r)});function v1(e){return Ma(e,{atIndex:e.suggestionIndex+1}),!1}function y1(e){return Ma(e,{atIndex:e.suggestionIndex-1}),!1}wa({complete:po},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),wa({nextSuggestion:v1,previousSuggestion:y1},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Th="mathlive#virtual-keyboard-message";function Nd(e){var r;return e.type!=="message"?!1:((r=e.data)==null?void 0:r.type)===Th}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(Nd(r)){if(!k0(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;$0(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(N({type:Th,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]"]]}},Ch={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=cu.singleton;if(!f)return;const v=z0(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 R="";for(const St of x1(A)){const nr=Df(St),xt=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);C[xt]=nr;const[Wt,hr]=Dh(nr);R+=`<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 J=Object.keys(C).length;let _e=5;J===1?_e=1:J===2||J===4?_e=2:J===3||J===5||J===6?_e=3:J>=7&&J<14&&(_e=4),z.style.width=`calc(var(--variant-keycap-length) * ${_e} + 12px)`,z.innerHTML=bp.createHTML(R),tn.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",J<=6?z.style.height="56px":J<=12?z.style.height="108px":J<=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)),nr=ze.top-z.clientHeight+5;z.style.transform=`translate(${St}px, ${nr}px)`,z.classList.add("is-visible"),requestAnimationFrame(()=>{z.addEventListener("pointerup",xt=>{const Wt=z0(xt.target);!(Wt!=null&&Wt.id)||!C[Wt.id]||($d(C[Wt.id]),Ec(),r==null||r(),xt.preventDefault())},{capture:!0,passive:!1,signal:Ie}),z.addEventListener("pointerenter",xt=>{const Wt=z0(xt.target);!(Wt!=null&&Wt.id)||!C[Wt.id]||Wt.classList.add("is-active")},{capture:!0,signal:Ie}),z.addEventListener("pointerleave",xt=>{const Wt=z0(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,tn.state==="open"&&tn.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 Ch[e]!==void 0}function x1(e){var r;return typeof e!="string"?e:(Ch[e]||(Ch[e]=(r=_1(e))!=null?r:[]),Ch[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 ji,n=new $t({mode:"math",type:"root",body:zs(e,{context:r,args:u=>u==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),a=m0(Ku(new or(n.render(r),{classes:"ML__base"}),r));return g0(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=ai();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 R of A)/[a-z]/.test(R)?C.push({label:R,class:"hide-shift",shift:{label:R.toUpperCase()},variants:Tf(R)?R:void 0}):R==="~"?a!=="dvorak"?C.push("[backspace]"):C.push({label:"[backspace]",width:1}):R==="^"?C.push("[shift]"):R===" "&&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=q(u,["rows"]);r=d(N({},v),{layers:kc({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const u=e,{markup:f}=u,v=q(u,["markup"]);r=d(N({},v),{layers:kc(e.markup)})}else r=N({},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()){U0(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=cu.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]=Dh(n);e.innerHTML=window.MathfieldElement.createHTML(a)}}function D1(){ja("virtual-keyboard"),ja("core"),Ah()}function M1(){Oo("core"),Oo("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,R;let z=A.target,J="";for(;z&&!J;)J=(C=z==null?void 0:z.getAttribute("data-command"))!=null?C:"",z=(R=z==null?void 0:z.parentElement)!=null?R:null;J&&e.executeCommand(JSON.parse(J))});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]=Dh(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 Dh(e,r={shifted:!1}){var n,a,u,f,v,A,C;let R="",z=(n=e.class)!=null?n:"";if(r.shifted&&U0(e)&&(z+=" is-active"),r.shifted&&"shift"in e)typeof e.shift=="string"?R=Ac(e.shift):typeof e.shift=="object"&&(R=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(R=e.label?e.label:(v=Ac(e.latex||e.insert||"")||e.key)!=null?v:"",e.shift){let J;typeof e.shift=="string"?J=Ac(e.shift):e.shift.label?J=e.shift.label:J=(A=Ac(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?A:"",R+=`<span class="MLK__shift">${J}</span>`}e.aside&&(R+=`<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:""),[R,z||"MLK__keycap"]}var ju={"[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="[,]"),!ju[e])return{latex:e};e={label:e}}let n;return"label"in e&&e.label&&ju[e.label]&&(n=d(N(N({},ju[e.label]),e),{label:ju[e.label].label})),"key"in e&&e.key&&ju[e.key]&&(n=d(N(N({},ju[e.key]),e),{key:ju[e.key].key})),n?(n.command==="insertDecimalSeparator"&&(n.label=(r=window.MathfieldElement.decimalSeparator)!=null?r:"."),e.label==="[action]"&&(n=N(N({},n),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(n=N(N({},n),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(n=N(N({},n),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(n=N(N({},n),window.mathVirtualKeyboard.tabKeycap)),n):e}var Tc;function O1(e){var r;if(e.button!==0)return;const n=cu.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=z0(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",Mh(v),{capture:!0,signal:A}),u.addEventListener("pointerleave",Mh(v),{capture:!0,signal:A}),u.addEventListener("pointercancel",Mh(v),{signal:A}),u.addEventListener("pointerup",Mh(v),{signal:A}),U0(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 Mh(e){return r=>{const n=z0(r.target);if(!(n!=null&&n.id))return;const a=cu.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"),U0(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"),U0(u)&&(a.shiftPressCount--,n.classList.toggle("is-active",a.isShifted));return}if(r.type==="pointerup"){Tc&&clearTimeout(Tc),U0(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"}]):$d(u.shift):$d(u),a.shiftPressCount===1&&!r.shiftKey&&(a.shiftPressCount=0)),e.abort(),r.preventDefault();return}}}}function $d(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=cu.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 z0(e){if(!e)return;let r=e;for(;r&&!B1(r);)r=r.parentElement;return r!=null?r:void 0}function U0(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var cu=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"&&H()&&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]=Dh(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(Nd(r)){if(!k0(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=$0(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:N({type:Th,action:r},n)}));return}if(a)a.postMessage(N({type:Th,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=$0(r);return k(r)?(n=r[0],n==="performWithFeedback"&&(r=r.slice(1),u=$0(r)),a=r.slice(1)):n=r,n=n.replace(/-\w/g,f=>f[1].toUpperCase()),u==="virtual-keyboard"?zo[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=mn(),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=cu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>b1.singleton,configurable:!0});function Lh(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=cu.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]=N({},e[n]):r[n]=e[n]}return r}function qu(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]=N({},e[u]):a[u]=e[u];return typeof r=="string"?a[r]:a}function Rh(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:ut,backgroundColorMap:gt,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:md,inlineShortcuts:bl,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:pd,value:""}}function Lf(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function hu(e,r){!e||!r||(k(e)?e.forEach(n=>hu(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),hu(e.body,r),hu(e.above,r),hu(e.below,r),hu(e.subscript,r),hu(e.superscript,r)))}function zd(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=fl),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 P0(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)}dr(["math","displaymath"],Za),dr("center",Za),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 un("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Jt("array","{columns:colspec}",(e,r,n,a)=>new un(e,Ud(r),n,{columns:a[0],mathstyleName:"textstyle"})),Jt(["equation","equation*","subequations"],"",(e,r,n)=>new un(e,Ud(r),n,{columns:[{align:"c"}]})),Jt(["multline","multline*"],"",Za),Jt(["align","align*","aligned","eqnarray"],"",Za),Jt("split","",Za),Jt(["gather","gathered"],"",Za),Jt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Za),Jt(["smallmatrix","smallmatrix*"],"[columns:colspec]",Za),Jt(["cases","dcases","rcases"],"",Za);function $1(e){for(const r of e)for(const n of r)if(n.length>0)return!1;return!0}function Ud(e,r=1){return $1(e)?Array(r).fill([[new $t({type:"first"}),new Ca]]):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 Za(e,r=[[[]]],n=[],a=[]){switch(r=Ud(r,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new un(e,r,n,{mathstyleName:"textstyle"});case"displaymath":return new un(e,r,n,{mathstyleName:"textstyle"});case"center":return new un(e,r,n,{columns:[{align:"c"}]});case"multline":case"multline*":return new un(e,r,n,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new un(e,r,n,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new un(e,r,n,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new un(e,r,n,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Zu(a[0])});case"bmatrix":case"bmatrix*":return new un(e,r,n,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Zu(a[0])});case"Bmatrix":case"Bmatrix*":return new un(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Zu(a[0])});case"vmatrix":case"vmatrix*":return new un(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Zu(a[0])});case"Vmatrix":case"Vmatrix*":return new un(e,r,n,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Zu(a[0])});case"matrix":case"matrix*":return new un(e,r,n,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Zu(a==null?void 0:a[0])});case"smallmatrix":case"smallmatrix*":return new un(e,r,n,{mathstyleName:"scriptstyle",columns:Zu(a==null?void 0:a[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new un(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 un(e,r,n,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new un(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 un(e,r,n,{arraycolsep:0,columns:f,minColumns:2})}}return new un(e,r,n,{mathstyleName:"textstyle"})}function Zu(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 un);)n=n.parent;if(n&&n.type==="array"&&n.environmentName,!n||!(n.parent instanceof un)){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=Oh()),u.length===0&&(u=Oh());let v;return r.endsWith("column")?(v=Za("split",[[f,u]]),e.root=v,Yu(v,0,0)?Xu(e,v,0,0):Yu(v,0,1)?Xu(e,v,0,1):e.position=e.offsetOf(a)):(v=Za("lines",[[f],[u]]),e.root=v,Yu(v,0,0)?Xu(e,v,0,0):Yu(v,1,0)?Xu(e,v,1,0):e.position=e.offsetOf(a)),[void 0,[0,0]]}if(n.parent instanceof Pn){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=Oh()),f.length===0&&(f=Oh());let A="pmatrix";const C=u.leftDelim,R=u.rightDelim;C==="("&&(R===")"||R==="?")?A="pmatrix":(C==="["||C==="\\lbrack")&&(R==="]"||R==="\\rbrack"||R==="?")?A="bmatrix":C==="\\vert"&&R==="\\vert"?A="vmatrix":C==="\\Vert"&&R==="\\Vert"?A="Vmatrix":(C==="{"||C==="\\lbrace")&&(R==="."||R==="?")&&(A="cases");const z=Za(A,r.endsWith("column")?[[v,f]]:[[v],[f]]);return u.parent.addChildBefore(z,u),u.parent.removeChild(u),Yu(z,0,0)?Xu(e,z,0,0):r.endsWith("column")?Yu(z,0,1)?Xu(e,z,0,1):e.position=e.offsetOf(n):Yu(z,1,0)?Xu(e,z,1,0):e.position=e.offsetOf(n),[void 0,[0,0]]}}return n&&n.parent instanceof un?[n.parent,n.parentBranch]:[void 0,[0,0]]}function Yu(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 Xu(e,r,n,a){const u=U1(e,r,n,a);typeof u!="number"&&e.setSelection(u)}function Ih(e,r,n,a,u){const f=r.getCell(n,a);f&&e.setPositionHandlingPlaceholder(e.offsetOf(f[u==="start"?0:f.length-1]))}function Ph(e,r){const[n,[a,u]]=z1(e,r);if(n)switch(r){case"after row":n.addRowAfter(a),Ih(e,n,a+1,0,"end");break;case"after column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnAfter(u),Ih(e,n,a,u+1,"end");break;case"before row":n.addRowBefore(a),Ih(e,n,a,0,"start");break;case"before column":if(n.maxColumns<=n.colCount){e.announce("plonk");return}n.addColumnBefore(u),Ih(e,n,a,u,"start");break}}function Rf(e){return e.contentWillChange({inputType:"insertText"})?(Ph(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function K1(e){return e.contentWillChange({inputType:"insertText"})?(Ph(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function If(e){return e.contentWillChange({inputType:"insertText"})?(Ph(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function H1(e){return e.contentWillChange({inputType:"insertText"})?(Ph(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 un);)n=n.parent;if(Array.isArray(n==null?void 0:n.parentBranch)&&(n==null?void 0:n.parent)instanceof un){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}wa({addRowAfter:Rf,addColumnAfter:If,addRowBefore:K1,addColumnBefore:H1,removeRow:G1,removeColumn:V1,setEnvironment:Pf},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Oh(){return[new Ca]}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 Kd(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 K0(e,r,n){var a,u,f,v,A,C,R;const z=e.position;(a=n==null?void 0:n.extend)!=null&&a||e.collapseSelection(r);let J=e.at(e.position);if(r==="forward"&&(J.type==="subsup"?(J=J.rightSibling,J||(J=e.at(e.position+1))):J=e.at(e.position+1)),!J)return e.announce("plonk"),!1;let _e=e.offsetOf(J);if(J instanceof Pu)_e=Kd(e,_e,r);else if(J instanceof As)if(J.isSuggestion)for(console.assert(r==="forward");J&&J instanceof As;)J.isSuggestion=!1,_e=e.offsetOf(J),J=J.rightSibling;else if(r==="forward"){if(J=J.rightSibling,!J||!(J instanceof As))return e.announce("plonk"),!1;for(;J&&J instanceof As&&/[a-zA-Z\*]/.test(J.value);)_e=e.offsetOf(J),J=J.rightSibling}else{if(J=J.leftSibling,!J||!(J instanceof As))return e.announce("plonk"),!1;for(;J&&J instanceof As&&/[a-zA-Z\*]/.test(J.value);)_e=e.offsetOf(J),J=J.leftSibling}else if(r==="forward"&&J.type==="mopen"){let Ie=0;do J.type==="mopen"?Ie+=1:J.type==="mclose"&&(Ie-=1),J=J.rightSibling;while(!J.isLastSibling&&Ie!==0);_e=e.offsetOf(J.leftSibling)}else if(r==="backward"&&J.type==="mclose"){let Ie=0;do J.type==="mopen"?Ie+=1:J.type==="mclose"&&(Ie-=1),J=J.leftSibling;while(!J.isFirstSibling&&Ie!==0);_e=e.offsetOf(J)}else if(r==="backward")if(J.type==="first")for(;_e>0&&J.type==="first";)_e-=1,J=e.at(_e);else{const Ie=J.type;J.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}=J;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((R=n==null?void 0:n.extend)!=null&&R){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 Uo(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]=xa(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=Bh(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=Uo(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=Bh(e,f,r))):f=Bh(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 Bh(e,r,n){return r=r+(n==="forward"?1:-1),r<0||r>e.lastOffset||Ff(e,r)?r:Bh(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=Zc(e.getHTMLElement(r[u])).right,v=Math.abs(n-f);if(v<=a)a=v;else break}return r[u-1]}function Fh(e,r,n,a,u){const f=e.mathfield.hasEditablePrompts,v=f?n.filter(R=>R.type==="prompt"&&!R.captureSelection):n,A=Zc(e.mathfield.getHTMLElement(r)).right,C=e.offsetOf(j1(e.mathfield,v,A))-(f?1:0);if(a){const[R,z]=e.selection.ranges[0];let J;C<(u==="up"?R:z)?J={ranges:[[C,z]],direction:"backward"}:J={ranges:[[R,C]],direction:"forward"},e.setSelection(J)}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,R;let z=!0;return e.silenceNotifications||(z=(R=(C=e.mathfield.host)==null?void 0:C.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?R:!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 un);)A=A.parent;if(Array.isArray(A==null?void 0:A.parentBranch)&&A.parent instanceof un){const C=A.parent;if(A.parentBranch[0]<1)return f();const R=A.parentBranch[0]-1,z=C.array[R][A.parentBranch[1]];if(!z.some(_e=>_e.type==="prompt"&&!_e.captureSelection)&&e.mathfield.hasEditablePrompts)return f();Fh(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();Fh(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,R;let z=!0;return e.silenceNotifications||(z=(R=(C=e.mathfield.host)==null?void 0:C.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?R:!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 un);)A=A.parent;if(Array.isArray(A==null?void 0:A.parentBranch)&&A.parent instanceof un){const C=A.parent;if(A.parentBranch[0]+1>C.array.length-1)return f();const R=A.parentBranch[0]+1,z=C.array[R][A.parentBranch[1]];if(!z.some(_e=>_e.type==="prompt"&&!_e.captureSelection)&&e.mathfield.hasEditablePrompts)return f();Fh(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();Fh(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 zu({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 zu({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 R=[],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?R.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(R)}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 R;const z=Number.parseInt((R=C.getAttribute("tabindex"))!=null?R:"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,R){for(const z of C)if(z.checked&&z.form===R)return z;return null}function v(C){var R;if(!C.name)return!0;const J=((R=C.form)!=null?R:C.ownerDocument).querySelectorAll('input[type="radio"][name="'+C.name+'"]'),_e=f(J,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 R=C.getBoundingClientRect();if(R.width===0||R.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 mo(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 Nh(e,r,n=!0){var a,u;const f=r==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&Uo(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=Hd(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 J=z.indexOf(document.activeElement)+f;return J<0&&(J=z.length-1),J>=z.length&&(J=0),z[J].focus(),e.mathfield.stopCoalescingUndo(),!0}return mo(e,C),!0}function Hd(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)}wa({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=>Uo(e,"forward"),moveToPreviousChar:e=>Uo(e,"backward"),moveUp:e=>Uo(e,"upward"),moveDown:e=>Uo(e,"downward"),moveToNextWord:e=>K0(e,"forward"),moveToPreviousWord:e=>K0(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 Nh(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?(mo(e,(n=_e.leftSibling)!=null?n:_e),e.mathfield.switchMode("math"),!0):mo(e,e.lastOffset)}}const A=e.at(e.anchor).parentPrompt,C=A?e.offsetOf(A)+1:Math.max(e.position+1,0),R=Hd(e,C,"forward");if(R)return mo(e,R);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 J=f.parent;if(J){if(J.type==="leftright"||J.type==="surd")return na(e,J);if(f.parentBranch==="superscript"&&J.subscript)return na(e,J.subscript);if(f.parentBranch==="above"&&J.below)return na(e,J.below);if(f.parentBranch==="superscript"||f.parentBranch==="subscript")return mo(e,J);if(f.parentBranch==="above"||f.parentBranch==="below")return na(e,J)}return mo(e,e.lastOffset)},moveToPreviousGroup:e=>{var r;if(e.position===0&&e.anchor===0)return Nh(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?mo(e,n):mo(e,0)}const u=e.at(e.anchor).parentPrompt,f=u?e.offsetOf(u.leftSibling):Math.max(e.position-1,0),v=Hd(e,f,"backward");if(v)return mo(e,v);if(a==="math"){const A=Uf(e,n,R=>R.type==="leftright"||R.type==="text","backward");if(A){if(A.mode==="text"){let R=A;for(;R&&R.mode==="text";)R=R.leftSibling;return na(e,[A,R])}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 mo(e,C);if(n.parentBranch==="above"||n.parentBranch==="below")return na(e,C)}return mo(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}),wa({moveToNextPlaceholder:e=>Nh(e,"forward"),moveToPreviousPlaceholder:e=>Nh(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 $h(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 Ju(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}Gd(e),e.contentDidChange({data:Wi(f),inputType:"insertText"})}function Gd(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||!en(n))return!1;const u=ks(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)&&Ju(a,1),!0;const v={")":"(","}":"{","]":"["}[u],{parent:A}=a.at(a.position);if(v&&A instanceof Pn&&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 Ju(a,1),!1;if(/\D\.[^\d\s]$/.test(f)){Ju(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 Ju(a,1),!0;if(/\([a-z][,;]$/.test(f))return Ju(a,2),!0;if(/[\d+\-=><*|]$/.test(u))return Gd(a),!0}else{if(r==="[Space]")return $h(a,void 0,v=>/[a-z][:,;.]$/.test(v.value)),!0;if(/[a-zA-Z]{3,}$/.test(f)&&!/(dxd|abc|xyz|uvw)$/.test(f))return $h(a,void 0,v=>/[a-zA-Z]/.test(v.value)),!0;if(/(^|\W)(if)$/i.test(f))return $h(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 $h(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>"+(pr(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=Gu("mathlive-keystroke-caption-panel");r.style.visibility="hidden"}return!1}function Kf(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(ja("keystroke-caption"),ja("core"),Gu("mathlive-keystroke-caption-panel"))}function im(){document.getElementById("mathlive-keystroke-caption-panel")&&(Cl("mathlive-keystroke-caption-panel"),Oo("core"),Oo("keystroke-caption"))}function Hf(e,r){var n,a,u;const{model:f}=e,v=ho(r);if(r.isTrusted){di(r);const Ie=ai();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="",R;const z=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(f.mode==="math")if(v==="[Backspace]")z.pop();else if(!en(r))e.flushInlineShortcutBuffer();else{const Ie=ks(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,nr="";for(;!A&&St<ze.length;)R=z.length-(ze.length-St),nr=ze.slice(St).join(""),A=S0(z[R].leftSiblings,nr,e.options.inlineShortcuts),!A&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(nr)&&(A=e.options.onInlineShortcut(e,nr)),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=Pd(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 Mn.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 Mn.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===","&&ks(r)===","&&(C="insertDecimalSeparator")}}if(!A&&!C){if(f.mathfield.smartFence){if(Wd(f,ks(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 Pn&&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:ks(r),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),r.preventDefault&&r.preventDefault(),!1;if(!f.selectionIsCollapsed){const ze=ks(r);if(ze==="("||ze==="{"||ze==="["){const St={"(":"(","{":"\\lbrace","[":"\\lbrack"}[ze],nr={"(":")","{":"\\rbrace","[":"\\rbrack"}[ze],[xt,Wt]=Ls(f.selection);return e.snapshot(),f.position=Wt,Mn.insert(f,nr,{format:"latex"}),f.position=xt,Mn.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 J=f.at(Math.max(f.position,f.anchor)),{parent:_e}=J;if(C==="moveAfterParent"&&(_e==null?void 0:_e.type)==="leftright"&&J.isLastSibling&&e.options.smartFence&&Wd(f,".",e.defaultStyle)&&(C="",ns(e)),e.keyboardDelegate.cancelComposition(),C)e.executeCommand(C);else if(A){const Ie=e.effectiveStyle;f.setState(z[R].state);const ze=z[z.length-1].keystrokes;for(const St of ze)Mn.insert(f,St,{silenceNotifications:!0,style:Ie});e.snapshot("insert-shortcut"),f.setState(z[R].state),f.deferNotifications({content:!0,selection:!0,data:A,type:"insertText"},()=>(Mn.insert(f,A,{format:"latex",style:Ie}),Gd(e.model),A.endsWith(" ")&&(e.switchMode("text"),Mn.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 Vd(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=p0(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 R of u)Hf(e,new KeyboardEvent("keypress",{key:R}))&&(C=!1);if(C)return}const v=a.at(a.position),A=N(N({},v.computedStyle),e.defaultStyle);if(a.selectionIsCollapsed||(a.deleteAtoms(Ls(a.selection)),e.snapshot("delete")),a.mode==="latex")a.deferNotifications({content:!0,selection:!0,data:r,type:"insertText"},()=>{fo(e);for(const C of u)Mn.insert(a,C);e.snapshot("insert-latex"),Ma(e)});else if(a.mode==="text"){for(const C of u)Mn.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),Mn.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({},n),v.style.variant&&(n.variant=v.style.variant),v.style.variantStyle&&(n.variantStyle=v.style.variantStyle))}Mn.insert(u,r,{style:n}),e.snapshot(`insert-${u.at(u.position).type}`)}function am(e){e.selectionIsCollapsed||(e.deleteAtoms(Ls(e.selection)),e.mathfield.snapshot("delete"))}function Wd(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=Fu[f],A=su[f];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[C,R]=Ls(e.selection),z=e.extractAtoms([C,R]),J=u.addChildrenAfter([new Pn("left...right",z,{leftDelim:f,rightDelim:A})],e.at(C));return e.setSelection(e.offsetOf(J.firstChild),e.offsetOf(J.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:f,inputType:"insertText"}),!0}if(f==="|"){const C=u instanceof Pn?u.leftDelim+u.rightDelim:"";if(C==="\\lbrace\\rbrace"||C==="\\{\\}"||C==="\\lbrace?")return e.mathfield.snapshot(),Mn.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 Pn&&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 Pn)){let J=a;for(;J&&!(J.type==="mclose"&&J.value===A);)J=J.rightSibling;if(J){e.mathfield.snapshot();const _e=e.extractAtoms([e.offsetOf(a),e.offsetOf(J)]);return _e.pop(),u.addChildrenAfter([new Pn("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 R;for(R=e.position;R<=C;R++){const J=e.at(R);if(J instanceof Pn&&(J.leftDelim==="?"||J.leftDelim===".")&&Gf(f,J.rightDelim))break}const z=e.at(R);if(R<=C&&z instanceof Pn){z.leftDelim=f,e.mathfield.snapshot();let J=e.extractAtoms([e.position,R-1]);return J=J.filter(_e=>_e.type!=="first"),z.addChildren(J,z.parentBranch),e.position+=1,e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(u instanceof Pn&&(u.leftDelim==="?"||u.leftDelim===".")&&Gf(f,u.rightDelim)){u.isDirty=!0,u.leftDelim=f,e.mathfield.snapshot();const J=e.extractAtoms([e.offsetOf(a.firstSibling),e.position]);for(const _e of J)u.parent.addChildBefore(_e,u);return e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(u instanceof Pn&&u.leftDelim==="|")){if(e.mathfield.snapshot(),Mn.insert(e,`\\left${f}\\right?`,{format:"latex",style:n}),a.lastSibling.type!=="first"){const J=e.offsetOf(a.lastSibling),_e=e.extractAtoms([e.position,J]);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 Pn("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 Pn&&a.isLastSibling&&jd(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 R=e.offsetOf(a.firstSibling);let z;for(z=e.position;z>=R;z--){const Ie=e.at(z);if(Ie instanceof Pn&&(Ie.rightDelim==="?"||Ie.rightDelim===".")&&jd(Ie.leftDelim,f))break}const J=e.at(z);if(z>=R&&J instanceof Pn)return e.mathfield.snapshot(),J.rightDelim=f,J.addChildren(e.extractAtoms([z,e.position]),J.parentBranch),e.contentDidChange({data:f,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(u instanceof Pn&&(u.rightDelim==="?"||u.rightDelim===".")&&jd(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 Pn&&(_e.rightDelim==="?"||_e.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(_e),Wd(e,f,n)):!1}return!1}function jd(e,r){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(r):su[e]===r:!0}function Gf(e,r){return r?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(r)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):Fu[r]===e:!0}wa({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)=>(Vd(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}}),wa({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"}),wa({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})&&(Ma(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=qd(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=N(N({},e.defaultStyle),n)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{a.selection.ranges.forEach(u=>zd(a,u,n,{operation:"toggle"})),e.snapshot("style-change")}),!0}wa({applyStyle:om},{target:"mathfield",canUndo:!0,changeContent:!0});function qd(e,r){var n,a,u,f,v,A,C,R,z,J;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=(R={italic:"it",up:"n",upright:"n",normal:"n"}[_e.fontShape])!=null?R:_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=(J={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[Ie.toLowerCase()])!=null?J:{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 Zd(e){let[r,n]=Ls(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}wa({selectGroup:e=>{const r=Zd(e);return r||e.announce("plonk"),r},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>Uo(e,"forward",{extend:!0}),extendSelectionBackward:e=>Uo(e,"backward",{extend:!0}),extendToNextWord:e=>K0(e,"forward",{extend:!0}),extendToPreviousWord:e=>K0(e,"backward",{extend:!0}),extendSelectionUpward:e=>Uo(e,"upward",{extend:!0}),extendSelectionDownward:e=>Uo(e,"downward",{extend:!0}),extendToNextBoundary:e=>K0(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>K0(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 Qu=null,Cc=0,zh=class Xa{static start(r,n,a,u){var f;Xa.element=r,(f=Xa.controller)==null||f.abort(),Xa.controller=new AbortController;const v={signal:Xa.controller.signal};"PointerEvent"in window?(r.addEventListener("pointermove",a,v),r.addEventListener("pointerup",u,v),r.addEventListener("pointercancel",u,v),Yd(n)&&(Xa.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=Xa.controller)==null||r.abort(),Xa.controller=void 0,typeof Xa.pointerId=="number"&&(Xa.element.releasePointerCapture(Xa.pointerId),Xa.pointerId=void 0)}};function Yd(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,R=!1;const z=r.clientX,J=r.clientY,_e=Date.now(),Ie=a.field,ze=setInterval(()=>{C?Ie.scroll({top:0,left:Ie.scrollLeft-16}):R&&Ie.scroll({top:0,left:Ie.scrollLeft+16})},32);function St(){zh.stop(),f=!1,clearInterval(ze),e.element.classList.remove("tracking"),r&&r.preventDefault()}function nr(Wt){if(!a.hasFocus()){St();return}const hr=Wt.clientX,Zt=Wt.clientY,Nr=Yd(Wt)&&Wt.pointerType==="touch"?20:5;if(Date.now()<_e+500&&Math.abs(z-hr)<Nr&&Math.abs(J-Zt)<Nr){Wt.preventDefault(),Wt.stopPropagation();return}const Qr=Ie.getBoundingClientRect();R=hr>Qr.right,C=hr<Qr.left;let jr=u;Yd(Wt)&&(Wt.isPrimary||(jr=Dc(a,Wt.clientX,Wt.clientY,{bias:0})));const Zi=Dc(a,hr,Zt,{bias:hr<=z?hr===z?0:-1:1});jr>=0&&Zi>=0&&(a.model.extendSelectionTo(jr,Zi),ns(e)),v&&Zd(a.model)}Qu&&Math.abs(Qu.x-z)<5&&Math.abs(Qu.y-J)<5&&Date.now()<Qu.time+500?(Cc+=1,Qu.time=_e):(Qu={x:z,y:J,time:_e},Cc=1);const xt=Ie.getBoundingClientRect();if(z>=xt.left&&z<=xt.right&&J>=xt.top&&J<=xt.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",u=Dc(e,z,J,{bias:0}),u>=0){if(e.element.classList.add("tracking"),r.shiftKey){const Wt=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,u),wc(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,wc(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,zh.start(Ie,r,nr,St),(r.detail===2||Cc===2)&&(v=!0,Zd(e.model),A="all"))}e.hasFocus()||(A="none",e.focus({preventScroll:!0}))}else Qu=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=ia(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 R=e.model.offsetOf(v);if(R<0)return-1;if(v.leftSibling)if(a.bias===0&&v.type!=="placeholder"){const z=ia(e,v);z&&r<(z.left+z.right)/2&&(R=e.model.offsetOf(v.leftSibling))}else a.bias<0&&(R=e.model.offsetOf(v.leftSibling));return R}var cm=class extends Mn{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=co(f),{model:A}=e;A.selectionIsCollapsed||A.deleteAtoms(Ls(A.selection));const C=A.at(A.position);if(C.parent instanceof un){console.assert(C.parentBranch!==void 0);const R=[];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?(R.push(z),z=[ze]):z.push(ze);z.length>0&&R.push(z);let J=Number(C.parentBranch[0]),_e=Number(C.parentBranch[1]);const Ie=C.parent.maxColumns;for(;C.parent.colCount-_e<R.length&&C.parent.colCount<Ie;)C.parent.addColumn();C.parent.addChildrenAfter(R[0],C);for(let ze=1;ze<R.length;ze++)_e++,_e>=Ie&&(_e=0,C.parent.addRowAfter(J),J++),C.parent.setCell(J,_e,R[ze])}else C.parent.addChildrenAfter(v.filter(R=>R.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]=xl(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(Ls(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 R=-1;C[0]?C["@"]=C[0]:typeof r=="string"&&/(^|[^\\])#@/.test(r)&&(R=dm(e),R>=0&&(C["@"]=e.getValue(R,e.position,"latex"))),C[0]||(C[0]=C["?"]);let z=!1;const J=hr=>(z=!0,C[hr]);let[_e,Ie]=qf(e,r,J,n);if(!Ie)return!1;const ze=Ie.length===1&&Ie[0].type==="genfrac";ze&&R>=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,J,n)):R>=0&&e.deleteAtoms([R,e.position]);const{parent:St}=e.at(e.position),nr=St.hasEmptyBranch("body");if(ze&&_e!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&St instanceof Pn&&St.leftDelim==="("&&nr){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"&&nr&&!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=zs(r,{context:e.mathfield.context})}else typeof r=="string"&&a.format==="ascii-math"?([f,r]=ru(r,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),v=zs(r,{context:e.mathfield.context}),f!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Uh(v)):(a.format==="auto"||(u=a.format)!=null&&u.startsWith("latex"))&&(a.format==="auto"&&([f,r]=ru(r,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),a.format==="latex"&&([,r]=xl(r)),v=zs(r,{context:e.mathfield.context,args:n}),a.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Uh(v));return hu(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 Pn&&r.leftDelim==="("&&r.rightDelim===")"?r.removeBranch("body"):null}function Uh(e){if(e){for(let r=0;e[r];r++){const n=e[r];if(n instanceof Pn&&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)){Uh(r.branch(n));const a=hm(r.branch(n));a&&r.setChildren(a,n)}if(r instanceof un)for(const n of r.cells)Uh(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=Fu[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===Fu[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 Mn{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(Ls(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(hu(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 "),zs(e,{context:r,parseMode:"text"})}new fm;function Ko(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var $n=4,ca=20,vs=2*(ca+$n),Kh=(e,r)=>`
<line x1="${e+ca}" y1="${r+ca}"
x2="${e>r?e+ca:7*ca+10*$n}"
y2="${e<r?r+ca:7*ca+10*$n}"/>
<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+ca}" y1="${r+ca}"
x2="${e>r?e+ca:7*ca+10*$n}"
y2="${e<r?r+ca:7*ca+10*$n}"/>
<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>`,Hh=(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*ca+10*$n+5} ${8*ca+10*$n+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${vs+$n}"
height="${3*vs}"
width="${vs}"
rx="${vs/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${vs+$n}"
y="0"
height="${vs}"
width="${3*vs}"
rx="${vs/2}"/>
<g data-command='"moveDown"'>
${Hh(2*($n+vs),2*$n+3*vs,0)}
</g>
<g data-command='"moveUp"'>
${Hh(2*($n+vs),2*$n+vs,180)}
</g>
<g data-command='"moveToNextWord"'>
${Hh(2*$n+3*vs,2*($n+vs),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${Hh(2*$n+vs,2*($n+vs),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Kh(2*$n+vs,$n)}
</g>
<g data-command='"removeColumn"'>
${Yf(2*$n+2*vs,$n)}
</g>
<g data-command='"addColumnAfter"'>
${Kh(2*$n+3*vs,$n)}
</g>
<g data-command='"addRowBefore"'>
${Kh($n,2*$n+vs)}
</g>
<g data-command='"removeRow"'>
${Yf($n,2*$n+2*vs)}
</g>
<g data-command='"addRowAfter"'>
${Kh($n,2*$n+3*vs)}
</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>`,Xd={matrix:gm,pmatrix:vm,bmatrix:ym,Bmatrix:Xf,vmatrix:bm,Vmatrix:_m},Jd={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=Gu("mathlive-environment-popover"),ja("environment-popover"),ja("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=[],R="";const z=e.model.parentEnvironment.environmentName;if(sh(z)){const ze=Am(z);R=Xd[ze]("active");const St=Xd,{[ze]:nr}=St,xt=q(St,[xe(ze)]);C=Object.values(xt).map(Wt=>Wt("inactive"))}else if(ah(z)){const ze=km(z);R=Jd[ze]("active");const St=Jd,{[ze]:nr}=St,xt=q(St,[xe(ze)]);C=Object.values(xt).map(Wt=>Wt("inactive"))}else Ad(z)&&(R=Xd.matrix("active"),C=Object.values(Jd).map(ze=>ze("inactive")));const J=document.createElement("div");J.className="MLEP__environment-delimiter-controls",J.style.display="flex",J.style.flexDirection="column",J.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${R}
${C.join("")}
</div>`,R&&v.appendChild(J),v.querySelectorAll("[data-command]").forEach(ze=>{const St=ze.dataset.command;let nr=St;try{nr=JSON.parse(St)}catch(xt){}ze.addEventListener("mousedown",xt=>xt.preventDefault()),nr&&ze.addEventListener("click",()=>e.executeCommand(nr))});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 Qd(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function Em(){document.getElementById("mathlive-environment-popover")&&(Cl("mathlive-environment-popover"),Oo("environment-popover"),Oo("core"))}function Gh(e){if(!e.hasFocus())return;let r=!1;if(e.model.mode==="math"){const n=e.model.parentEnvironment;if(n!=null&&n.array&&nh(n.environmentName)){const a=e.options.environmentPopoverPolicy;r=a==="auto"||a==="on"}}r?Sm(e):Qd()}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 ef(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),R=ef(r.location.y,C,r.verticalPos,f);R+C>window.innerHeight-8&&(r.alternateLocation?(R=ef(r.alternateLocation.y,C,r.verticalPos,f),R+C>window.innerHeight-8&&(R=void 0)):R=void 0),Number.isFinite(R)||(R=Math.max(8,window.innerHeight-8-C),8+C>window.innerHeight-8&&(e.style.bottom="8px")),C=Math.min(R+C,window.innerHeight-8)-R;const z=Number.isFinite(r.maxWidth)?Math.min(r.maxWidth,window.innerWidth):window.innerWidth;let J=Math.min(z,(u=r.width)!=null?u:v.width),_e=ef(r.location.x,J,r.horizontalPos,f);_e+J>window.innerWidth-8&&(r.alternateLocation?(_e=Tm(r.alternateLocation.x,J,r.verticalPos,f),_e+J>window.innerWidth-8&&(_e=void 0)):_e=void 0),Number.isFinite(_e)||(_e=Math.max(8,window.innerWidth-8-J),8+J>window.innerWidth-8&&(e.style.right="8px")),J=Math.min(_e+J,window.innerWidth-8)-_e,f==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-_e-J).toString()}px`:e.style.left=`${Math.ceil(_e).toString()}px`,e.style.top=`${Math.ceil(R).toString()}px`,C!==v.height&&(e.style.height=`${Math.ceil(C).toString()}px`),J!==v.width&&(e.style.width=`${Math.ceil(J).toString()}px`)}function Dm(e,r){return Math.hypot(r.x-e.x,r.y-e.y)}function H0(e){return"submenu"in e}function Ho(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function tf(e){return"type"in e&&e.type==="divider"}function rf(e){return"type"in e&&e.type==="heading"}var ep={};function nf(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,H0(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=Ho(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(tf(u)){this.enabled=!1,this.checked=!1;return}rf(u)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Ho(u)&&(this.checked=Ho(u)&&((r=G0(u.checked,e))!=null?r:!1)),(Ho(u)||H0(u))&&(this.enabled=(n=G0(u.enabled,e))!=null?n:!0,this.visible=(a=G0(u.visible,e))!=null?a:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(Ho(u)||rf(u)||H0(u))&&(this.label=G0(u.label,e),this.tooltip=G0(u.tooltip,e),this.ariaLabel=G0(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(nf("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(nf("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),Ho(this._declaration)&&this._declaration.keyboardShortcut){const n=document.createElement("kbd");n.innerHTML=pr(this._declaration.keyboardShortcut),e.append(n)}this.type==="submenu"&&e.append(nf("trailing-chevron"))}get element(){if(this._element)return this._element;if(tf(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,(Ho(this._declaration)||rf(this._declaration)||H0(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(!Ho(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 G0(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 J0{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(R=>R.updateState(r));const f=this.hasCheck;this.hasCheck=this._menuItems.some(R=>R.visible&&R.hasCheck),this.hasCheck!==f&&this._menuItems.forEach(R=>R.updateState(r));let v,A=0;for(const R of this._menuItems)R.type==="heading"?(v&&A===0&&(v.visible=!1),v=R,A=0):R.type==="divider"&&v?(v.visible=A>0,v=void 0,A=0):v&&R.visible&&(A+=1);v&&(v.visible=A>0);let C=!0;for(const R of this._menuItems)R.type==="divider"?(R.visible=!C,C=!0):R.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 J0._collator||(J0._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),J0._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=>J0.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),j()&&(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),j()&&((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){ki(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=xi(r)),r.stopImmediatePropagation()}handleKeydownEvent(r){var n,a,u;if(r.key==="Tab"||r.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=xi(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(xi(r));break;case"ArrowRight":if((A==null?void 0:A.type)==="submenu")A.select(xi(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 R=v.nextMenuItem(1);R&&(v.activeMenuItem=R)}}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 R=v.parentMenu.activeMenuItem;if(R){const{element:z}=R;z==null||z.focus(),z==null||z.classList.remove("is-submenu-open")}}else{const R=v.nextMenuItem(-1);R&&(v.activeMenuItem=R)}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(en(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 tn.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),tn.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),tn.state==="open"&&tn.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(N({},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,tn.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 tf(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(Ho(e)||H0(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||Ho(e)&&typeof e.checked=="function"?!0:H0(e)?e.submenu.some(sp):!1}var Vh=class{};Vh.DELAY=300,Vh.MAX_DISTANCE=10;function Rm(e){return new Promise((r,n)=>{const a=_r(e);a||r(!1);let u=a;const f=setTimeout(()=>{v.abort(),r(Dm(u,a)<Vh.MAX_DISTANCE)},Vh.DELAY),v=new AbortController,A=v.signal;for(const C of["pointermove","pointerup","pointercancel"])window.addEventListener(C,R=>{if(R.type==="pointerup"||R.type==="pointercancel")clearTimeout(f),v.abort(),r(!1);else if(R.type==="pointermove"){const z=_r(R);z&&(u=z)}},{passive:!0,signal:A})})}function ap(e,r,n){return pu(this,null,function*(){if(e.type==="contextmenu"){const a=e;if(n.show({target:r,location:_r(a),modifiers:xi(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:xi(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=_r(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 T0(d(N({},e),{body:Xe(e.args[0]),accentChar:op[e.command.slice(1)]}))}),Ue(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const r=Gt(Xe(e.args[0]));return new T0(d(N({},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 T0(d(N({},e),{body:Xe(e.args[0]),svgAccent:"overarc"}))}),Ue(["underarc","underparen"],"{body:auto}",{createAtom:e=>new ba(d(N({},e),{body:Xe(e.args[0]),svgBelow:"underarc"}))}),Ue("utilde","{body:auto}",{createAtom:e=>{const r=Xe(e.args[0]),n=Gt(r),a="widetilde"+(n.length>5?"4":["1","1","2","2","3","3"][n.length]);return new ba(d(N({},e),{body:r,svgBelow:a,boxType:ra(r)}))}}),Ue("^","{:string}",{createAtom:e=>{var r;return new $t(d(N({},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(N({},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(N({},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(N({},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(N({},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(N({},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(N({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(N({},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 R=A.match(/\s*([a-z]*)\s*=\s*"(.*)"/);R&&(R[1]==="mathbackground"?u.backgroundcolor=R[2]:R[1]==="mathcolor"?u.strokeColor=R[2]:R[1]==="padding"?u.padding=R[2]:R[1]==="shadow"&&(u.shadow=R[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 ou(e.command,Xe(a[2]),f,u)}}),Ue("cancel","{body:auto}",{createAtom:e=>{var r;return new ou(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 ou(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 ou(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 ba(d(N({},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 ba(d(N({},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 ba(d(N({},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 ba(d(N({},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 ba(d(N({},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(N({},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(N({},e),{limits:"over-under",variant:"main"}))}),Ue(["lim","mod"],"",{ifMode:"math",createAtom:e=>new No(e.command.slice(1),d(N({},e),{limits:"over-under",variant:"main"}))}),Ue(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new No(e.command.slice(1),d(N({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),Ue(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new $t(d(N({},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 or("\xB0",{style:d(N({},e.style),{variant:"normal",variantStyle:"up"})});return new or([n,u],{type:"inner",isSelected:e.isSelected,caret:a})}}),Ue("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new gh(d(N({},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=N({},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 Bo(a[0]?Xe(a[0]):[new Ca],a[1]?Xe(a[1]):[new Ca],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}`:Hn(e.command,n,a)}}),Ue(["brace","brack"],"",{infix:!0,createAtom:e=>new Bo(Xe(e.args[0]),Xe(e.args[1]),d(N({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,r)=>Wi([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 Bo(Xe(a[0]),Xe(a[1]),d(N({},e),{hasBarLine:e.command==="\\over",leftDelim:r,rightDelim:n}))},serialize:(e,r)=>Wi([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 Bo(Xe(a[0]),Xe(a[1]),d(N({},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 Bo(Xe(e.args[0]),Xe(e.args[1]),d(N({},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 gc({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(N({},e),{limits:"auto",variant:"main"}))}),Ue("smallint","",{ifMode:"math",createAtom:e=>new No("\u222B",d(N({},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 gc(n,d(N({},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(N({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Ue("middle","{:delim}",{ifMode:"math",createAtom:e=>{var r;return new fh(d(N({},e),{delim:(r=e.args[0])!=null?r:"|",size:1}))}}),Ue("the","{:value}",{createAtom:e=>new $t(d(N({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,r)=>{var n;const a=new ji({parent:r},e.style);let u="";e.isSelected&&(u+=" ML__selected");const f=a.evaluate(e.args[0]);return new or(((n=Ms(f))!=null?n:"").split("").map(v=>new or(v,{type:"ord",classes:u,mode:e.mode,isSelected:e.isSelected,style:N({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=Ms(e.args[0]))!=null?r:"\\relax"}`}}),Ue("mathtip","{:auto}{:math}",{createAtom:e=>new F0(d(N({},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(N({},r),{defaultMode:"math"}))}}`}),Ue("texttip","{:auto}{:text}",{createAtom:e=>new F0(d(N({},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(N({},r),{defaultMode:"text"}))}}`}),Ue("error","{:math}",{createAtom:e=>new $t(d(N({},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(N({},e),{body:Xe(e.args[0])})),serialize:(e,r)=>`${e.command}{${e.bodyToLatex(d(N({},r),{defaultMode:"math"}))}}`}),Ue("color","{:value}",{applyStyle:(e,r,n)=>{var a,u;return{verbatimColor:(a=Ms(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=Ms(r[0]))!=null?a:void 0,color:n.toColor((u=r[0])!=null?u:{string:"red"})}}}),Ue("boxed","{content:math}",{createAtom:e=>new uo(d(N({},e),{body:Xe(e.args[0]),framecolor:{string:"black"}}))}),Ue("colorbox","{:value}{:text*}",{applyStyle:(e,r,n)=>{var a,u;return{verbatimBackgroundColor:(a=Ms(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 uo(d(N({},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(N({},r),{defaultMode:"text"})):Hn(e.command,(n=Ms(e.framecolor))!=null?n:"",(a=Ms(e.backgroundcolor))!=null?a:"",e.bodyToLatex(d(N({},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 uo(d(N({},e),{body:a,padding:n.padding,border:n.border,backgroundcolor:(r=n.backgroundcolor)!=null?r:void 0})):new uo(d(N({},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=Ms(e.padding))!=null?n:""),e.border&&f.push(`border: ${e.border}`),e.backgroundcolor&&f.push((a=Ms(e.backgroundcolor))!=null?a:""),u+=`[${f.join(",")}]`}return Hn(u,e.bodyToLatex(r))}}),Ue(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new $t(d(N({},e),{body:Xe(e.args[0])})),render:(e,r)=>{const n=new ji({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):`{${Wi([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(N({},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(N({},e),{type:"mord",body:Xe(e.args[0]),mode:"math"})),serialize:(e,r)=>Hn("\\mbox",e.bodyToLatex(d(N({},r),{defaultMode:"text"})))}),Ue("text","{:text}",{ifMode:"math",applyMode:"text"}),Ue(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new $t(d(N({},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(N({},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(N({},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(N({},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(N({},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(N({},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 ph(d(N({},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 uu(d(N({},e),{width:(r=e.args[0])!=null?r:{dimension:0}}))}}),Ue(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var r;return new uu(d(N({},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===b0||a===vl)&&(n=1),(a===Ql||a===ua)&&(n=2),(a===Mo||a===Ds)&&(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(N({},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 or(e.bind(r,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,r)=>{const n=[Hn(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)),Wi(n)}}),Ue(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new $t(d(N({},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(N({},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 or(e.bind(r,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,r)=>{const n=[Hn(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)),Wi(n)}}),Ue(["char","unicode"],"{charcode:value}",{createAtom:e=>new $t(d(N({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var r;return`${e.command}${Ms((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 ji({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}),R=new or(null,{classes:"rule",type:"ord"});return R.width=A,R.height=C+v,R.depth=-v,R.setStyle("border-right-width",A,"em"),R.setStyle("border-top-width",C,"em"),R.setStyle("border-color",e.style.color),R.setStyle("vertical-align",v,"em"),e.isSelected&&R.setStyle("opacity","50%"),e.bind(f,R),e.caret&&(R.caret=e.caret),R.wrap(r)},serialize:e=>`\\rule${e.args[0]?`[${Ms(e.args[0])}]`:""}{${Ms(e.args[1])}}{${Ms(e.args[2])}}`}),Ue(["overline","underline"],"{:auto}",{createAtom:e=>new $t(d(N({},e),{body:Xe(e.args[0])})),render:(e,r)=>{const n=e.command.substring(1),a=new ji({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 or(null,{classes:n+"-line"});v.height=f,v.maxFontSize=f*1.125*a.scalingFactor;let A;return n==="overline"?A=new fs({shift:0,children:[{box:u},3*f,{box:v},f]}):A=new fs({top:u.height,children:[f,{box:v},3*f,{box:u}]}),e.caret&&(A.caret=e.caret),new or(A,{classes:n,type:"ignore"})}}),Ue("overset","{:auto}{base:auto}",{createAtom:e=>{const r=Xe(e.args[1]);return new ba(d(N({},e),{above:Xe(e.args[0]),body:r,skipBoundary:!1,boxType:ra(r)}))},serialize:(e,r)=>Hn(e.command,e.aboveToLatex(r),e.bodyToLatex(r))}),Ue("underset","{:auto}{base:auto}",{createAtom:e=>{const r=Xe(e.args[1]);return new ba(d(N({},e),{below:Xe(e.args[0]),body:r,skipBoundary:!1,boxType:ra(r)}))},serialize:(e,r)=>Hn(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 ba(d(N({},e),{above:Xe(e.args[0]),below:Xe(e.args[1]),body:r,skipBoundary:!1,boxType:ra(r)}))},serialize:(e,r)=>Hn(e.command,e.belowToLatex(r),e.bodyToLatex(r))}),Ue(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new ba(d(N({},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)=>Hn(e.command,e.aboveToLatex(r),e.bodyToLatex(r))}),Ue("smash","[:string]{:auto}",{createAtom:e=>{var r,n,a,u;return new lu(d(N({},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 lu(d(N({},e),{body:Xe(e.args[0]),isInvisible:!0,smashWidth:!0}))}),Ue(["hphantom"],"{:auto}",{createAtom:e=>new lu(d(N({},e),{body:Xe(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Ue(["phantom"],"{:auto}",{createAtom:e=>new lu(d(N({},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(N({},e),{type:"mrel",value:"\uE020"})):new $t(d(N({},e),{body:[new Tl(d(N({},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":ra(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(N({},e),{type:"mrel",body:[new Tl(d(N({},e),{body:"\uE020",align:"right",boxType:"rel"})),new $t(d(N({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),Ue("rlap","{:auto}",{createAtom:e=>new Tl(d(N({},e),{body:Xe(e.args[0]),align:"right"}))}),Ue("llap","{:auto}",{createAtom:e=>new Tl(d(N({},e),{body:Xe(e.args[0]),align:"left"}))}),Ue("mathrlap","{:math}",{createAtom:e=>new Tl(d(N({},e),{body:Xe(e.args[0]),align:"left"}))}),Ue("mathllap","{:math}",{createAtom:e=>new Tl(d(N({},e),{body:Xe(e.args[0]),align:"left"}))}),Ue("raisebox","{:value}{:text}",{createAtom:e=>{var r;return new uo(d(N({},e),{body:Xe(e.args[1]),padding:{dimension:0},offset:(r=e.args[0])!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n;return Hn("\\raisebox",(n=Ms(e.offset))!=null?n:"0pt",e.bodyToLatex(r))}}),Ue("raise","{:value}{:auto}",{createAtom:e=>{var r;return new uo(d(N({},e),{body:Xe(e.args[1]),padding:{dimension:0},offset:(r=e.args[0])!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n;return Hn("\\raise",(n=Ms(e.offset))!=null?n:"0pt",e.bodyToLatex(r))}}),Ue("lower","{:value}{:auto}",{createAtom:e=>{var r;return new uo(d(N({},e),{body:Xe(e.args[1]),padding:{dimension:0},offset:(r=Va(e.args[0],-1))!=null?r:{dimension:0}}))},serialize:(e,r)=>{var n,a;return Hn("\\lower",(a=Ms(Va((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 uu(e)}),Ue("space","",{createAtom:e=>new uu(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>",Wh="<mo>&#8290;</mo>";function jh(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ln(e,r){return!e||!r.generateID?"":` extid="${e}"`}function Im(e,r,n){var a,u,f,v,A,C,R,z,J,_e,Ie;let ze=!1;r=r!=null?r:e.atoms.length;let St="",nr="",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=st(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${Ln(xt.id,n)}>${Qr}</mi>`,Dl(St,e,n)||(e.mathML+=St,e.lastType="mi"),!0;Zt=(R={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?R:"",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${Ln(xt.id,n)}${Zt}>${Nr[xt.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(Qr=Wh+Qr),Dl(Qr,e,n)||(e.mathML+=Qr,e.lastType="mi"),!0}if(xt.command==="\\operatorname")nr=V0(xt.body),e.index+=1;else if(Wt||hr)for(;e.index<r&&(xt.type==="mord"||xt.type==="macro")&&!xt.isDigit()&&Wt===((J=(z=xt.style)==null?void 0:z.variant)!=null?J:"")&&hr===((Ie=(_e=xt.style)==null?void 0:_e.variantStyle)!=null?Ie:"");)nr+=V0([xt]),e.index+=1,xt=e.atoms[e.index];else(xt.type==="mord"||xt.type==="macro")&&!xt.isDigit()&&(nr+=V0([xt]),e.index+=1);if(nr.length>0){ze=!0,St=`<mi${Zt}>${nr}</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=Wh+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=cn(u.superscript,n);r.lastType="";const A=cn(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 ${Ln(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"+Ln(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 R=-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,R=z),z+=1;v&&(u="<mrow>",u+=e0(e.atoms[C],n),u+=cn(e.atoms,n,C+1,R),u+=e0(e.atoms[R],n),u+="</mrow>",e.index=R+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=Wh),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${Ln(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+=sf(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=e0(v,n);return v.superscript&&v.subscript?(u+="<munderover>"+C,u+=cn(v.subscript,n),u+=cn(v.superscript,n),u+="</munderover>"):v.superscript?(u+="<mover>"+C,u+=cn(v.superscript,n),u+="</mover>"):v.subscript&&(u+="<munder>"+C,u+=cn(v.subscript,n),u+="</munder>"),e.mathML+=u,e.lastType="mo",e.index+=1,!0}{const C=e.atoms[e.index],R=C.value==="\\operatorname",z=R?'<mi class="MathML-Unit"'+Ln(C.id,n)+">"+V0(C.value)+"</mi>":e0(C,n);u+=z,!R&&!/^<mo>(.*)<\/mo>$/.test(z)?(u+=cp,f="applyfunction"):f=R?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(u)&&(u=Wh+u),e.index+=1}return u.length>0&&(a=!0,Dl(u,e,n)||(e.mathML+=u,e.lastType=f)),a}function cn(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=sf(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=sf(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 e0(e,r){let n="";const a=V0(e.value);return a&&(n="<mo"+Ln(e.id,r)+">"+a+"</mo>"),n}function V0(e){if(!e)return"";if(typeof e=="string")return jh(e);if(!Array.isArray(e)&&typeof e.body=="string")return jh(e.body);let r="";for(const n of e)typeof n.value=="string"&&(r+=n.value);return jh(r)}function sf(e,r){var n,a,u,f,v,A,C,R,z,J,_e,Ie,ze,St,nr,xt,Wt,hr,Zt,Nr,Qr,jr;if(e.mode==="text")return`<mi${Ln(e.id,r)}>${e.value}</mi>`;const Zi={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"},An={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let gr="",Ra="",Vo,Ya,Is,Ia,ha,Rn;const{command:ls}=e;if(e.command==="\\error")return`<merror${Ln(e.id,r)}>${cn(e.body,r)}</merror>`;const Ps={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Wo={"\\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=cn(e.body,r);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(gr+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(gr+="<mo>"+(Ps[e.leftDelim]||e.leftDelim)+"</mo>")),gr+="<mtable",e.colFormat){for(gr+=' columnalign="',Is=0;Is<e.colFormat.length;Is++)e.colFormat[Is].align&&(gr+={l:"left",c:"center",r:"right"}[e.colFormat[Is].align]+" ");gr+='"'}for(gr+=">",Ya=0;Ya<e.array.length;Ya++){for(gr+="<mtr>",Vo=0;Vo<e.array[Ya].length;Vo++)gr+="<mtd>"+cn(e.array[Ya][Vo],r)+"</mtd>";gr+="</mtr>"}gr+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(gr+="<mo>"+(Ps[e.leftDelim]||e.rightDelim)+"</mo>"),gr+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(gr+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(gr+="<mo"+Ln(e.id,r)+">"+(Ps[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(gr+="<mfrac>",gr+=cn(e.above,r)||"<mi>&nbsp;</mi>",gr+=cn(e.below,r)||"<mi>&nbsp;</mi>",gr+="</mfrac>"):(gr+="<mtable"+Ln(e.id,r)+">",gr+="<mtr>"+cn(e.above,r)+"</mtr>",gr+="<mtr>"+cn(e.below,r)+"</mtr>",gr+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(gr+="<mo"+Ln(e.id,r)+">"+(Ps[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(gr+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(gr+="<msqrt"+Ln(e.id,r)+">",gr+=cn(e.body,r),gr+="</msqrt>"):(gr+="<mroot"+Ln(e.id,r)+">",gr+=cn(e.body,r),gr+=cn(e.above,r),gr+="</mroot>");break;case"leftright":const jo=e,qo=jo.leftDelim;gr="<mrow>",qo&&qo!=="."&&(gr+=`<mo${Ln(e.id,r)}>${(n=Ps[qo])!=null?n:qo}</mo>`),e.body&&(gr+=cn(e.body,r));const Zo=jo.matchingRightDelim();Zo&&Zo!=="."&&(gr+=`<mo${Ln(e.id,r)}>${(a=Ps[Zo])!=null?a:Zo}</mo>`),gr+="</mrow>";break;case"sizeddelim":case"delim":gr+=`<mo${Ln(e.id,r)}>${Ps[e.value]||e.value}</mo>`;break;case"accent":gr+='<mover accent="true"'+Ln(e.id,r)+">",gr+=cn(e.body,r),gr+="<mo>"+(Wo[ls]||e.accent)+"</mo>",gr+="</mover>";break;case"line":case"overlap":break;case"overunder":ha=e.above,Ia=e.below,(e.svgAbove||ha)&&(e.svgBelow||Ia)?Rn=e.body:ha&&ha.length>0?(Rn=e.body,(f=(u=e.body)==null?void 0:u[0])!=null&&f.below?(Ia=e.body[0].below,Rn=e.body[0].body):((A=(v=e.body)==null?void 0:v[0])==null?void 0:A.type)==="first"&&((R=(C=e.body)==null?void 0:C[1])!=null&&R.below)&&(Ia=e.body[1].below,Rn=e.body[1].body)):Ia&&Ia.length>0&&(Rn=e.body,(J=(z=e.body)==null?void 0:z[0])!=null&&J.above?(ha=e.body[0].above,Rn=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)&&(ha=e.body[1].overscript,Rn=e.body[1].body)),(e.svgAbove||ha)&&(e.svgBelow||Ia)?(gr+=`<munderover ${Ln(e.id,r)}>`,gr+=(nr=Zi[e.svgBody])!=null?nr:cn(Rn,r),gr+=(xt=Zi[e.svgBelow])!=null?xt:cn(Ia,r),gr+=(Wt=Zi[e.svgAbove])!=null?Wt:cn(ha,r),gr+="</munderover>"):e.svgAbove||ha?(gr+=`<mover ${Ln(e.id,r)}>`+((hr=Zi[e.svgBody])!=null?hr:cn(Rn,r)),gr+=(Zt=Zi[e.svgAbove])!=null?Zt:cn(ha,r),gr+="</mover>"):(e.svgBelow||Ia)&&(gr+=`<munder ${Ln(e.id,r)}>`+((Nr=Zi[e.svgBody])!=null?Nr:cn(Rn,r)),gr+=(Qr=Zi[e.svgBelow])!=null?Qr:cn(Ia,r),gr+="</munder>");break;case"placeholder":gr+="?";break;case"mord":{gr=typeof e.value=="string"?e.value:ls,ls==="\\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 go=/\d/.test(gr)?"mn":"mi";gr=`<${go}${Ln(e.id,r)}>${jh(gr)}</${go}>`;break}case"mbin":case"mrel":case"minner":gr=e0(e,r);break;case"mpunct":gr='<mo separator="true"'+Ln(e.id,r)+">"+ls+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(gr="<mo"+Ln(e.id,r)+">",gr+=ls==="\\operatorname"?e.body:ls||e.body,gr+="</mo>");break;case"box":gr='<menclose notation="box"',e.backgroundcolor&&(gr+=' mathbackground="'+e.backgroundcolor+'"'),gr+=Ln(e.id,r)+">"+cn(e.body,r)+"</menclose>";break;case"spacing":gr+='<mspace width="'+((jr=An[ls])!=null?jr:0)+'em"/>';break;case"enclose":gr='<menclose notation="';for(const go in e.notation)Object.prototype.hasOwnProperty.call(e.notation,go)&&e.notation[go]&&(gr+=Ra+go,Ra=" ");gr+=Ln(e.id,r)+'">'+cn(e.body,r)+"</menclose>";break;case"prompt":gr='<menclose notation="roundexbox""">'+cn(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+=e0(e,r);break;case"mclose":gr+=e0(e,r);break;case"macro":{const go=e.command+V0(e.macroArgs);go&&(gr+=`<mo ${Ln(e.id,r)}>${go}</mo>`)}break;case"latexgroup":gr+=cn(e.body,r);break;case"latex":gr+="<mtext"+Ln(e.id,r)+">"+e.value+"</mtext>";break;case"tooltip":gr+=cn(e.body,r);break;case"text":gr+=`<mtext ${Ln(e.id,r)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${Ln(e.id,r)} displaystyle="true">${cn(e.body,r)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${Ln(e.id,r)} displaystyle="false">${cn(e.body,r)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return gr}var W0={"\\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"},af={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 zi(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 R="";if(k(r)){let z=!1,J=!1;for(let _e=0;_e<r.length;_e++)r[_e].type!=="first"&&(r[_e].mode!=="text"&&(J=!1),_e<r.length-2&&r[_e].type==="mopen"&&r[_e+2].type==="mclose"&&r[_e+1].type==="mord"?(R+=" of ",R+=C(zi(e,r[_e+1])),_e+=2):r[_e].mode==="text"?J?R+=(n=r[_e].value)!=null?n:" ":(J=!0,R+=zi("text",r[_e])):r[_e].isDigit()?z?R+=r[_e].asDigit():(z=!0,R+=zi(e,r[_e])):(z=!1,R+=zi(e,r[_e])))}else if(r.mode==="text")r.id&&e==="math"&&(R+='<mark name="'+r.id.toString()+'"/>'),R+=r.value;else{r.id&&e==="math"&&(R+='<mark name="'+r.id.toString()+'"/>');let z="",J="",_e="",Ie=!1;const{command:ze}=r;switch(ze){case"\\vec":return"vector "+zi(e,r.body);case"\\acute":return zi(e,r.body)+" acute";case"\\grave":return zi(e,r.body)+" grave";case"\\dot":return"dot over"+zi(e,r.body);case"\\ddot":return"double dot over"+zi(e,r.body);case"\\mathring":return"ring over"+zi(e,r.body);case"\\tilde":case"\\widetilde":return"tilde over"+zi(e,r.body);case"\\bar":return zi(e,r.body)+" bar";case"\\breve":return zi(e,r.body)+" breve";case"\\check":case"\\widecheck":return"check over "+zi(e,r.body);case"\\hat":case"\\widehat":return"hat over"+zi(e,r.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+zi(e,r.body);case"\\underarc":case"\\underparen":return"arc under "+zi(e,r.body)}switch(r.type){case"prompt":const St=r.body.length>1?'start input . <break time="500ms"/> '+zi(e,r.body)+'. <break time="500ms"/> end input':"blank";R+=' <break time="300ms"/> '+St+'. <break time="700ms"/>'+((a=r.correctness)!=null?a:"")+' . <break time="700ms"/> ';break;case"array":const nr=r.array,xt=r.environmentName;if(Object.keys(af).includes(xt)){R+=` begin ${af[xt]} `;for(let Zt=0;Zt<nr.length;Zt++){Zt>0&&(R+=","),R+=` row ${Zt+1} `;for(let Nr=0;Nr<nr[Zt].length;Nr++)Nr>0&&(R+=","),R+=` column ${Nr+1}: `,R+=zi("math",nr[Zt][Nr])}R+=` end ${af[xt]} `}break;case"group":ze==="\\ne"?R+=" not equal ":(ze==="\\not"&&(R+=" not "),R+=zi("math",r.body));break;case"root":R+=zi("math",r.body);break;case"genfrac":if(z=zi("math",r.above),J=zi("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?R=Nr:R+=z+" over "+J}else R+=' the fraction <break time="150ms"/>'+z+' over <break time="150ms"/>'+J+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(_e=zi("math",r.body),r.hasEmptyBranch("above"))R+=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=zi("math",r.above);Zt=Zt.trim();const Nr=Zt.replace(/<mark([^/]*)\/>/g,"");Nr==="3"?R+=' the cube root of <break time="200ms"/>'+_e+'. <break time="200ms"/> End cube root':Nr==="n"?R+=' the nth root of <break time="200ms"/>'+_e+'. <break time="200ms"/> End root':R+=' the root with index: <break time="200ms"/>'+Zt+', of <break time="200ms"/>'+_e+'. <break time="200ms"/> End root'}break;case"leftright":{const Zt=r;R+=(u=Zt.leftDelim?W0[Zt.leftDelim]:void 0)!=null?u:Zt.leftDelim,R+=zi("math",r.body),R+=(f=Zt.rightDelim?W0[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=wr()[Wt];hr&&(hr!=null&&hr.expand?R+=zi("math",r.body):R+=`${Wt} `);break;case"placeholder":R+="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"){R=zi(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")R+=Zt;else{if(r.type==="mbin"&&(R+='<break time="150ms"/>'),Zt){const Qr=W0[Zt]||(Nr?W0[Nr.trim()]:"");if(Qr)R+=" "+Qr;else{const jr=Nr?zm(Nr.trim()):"";R+=jr||A(Zt)}}else R+=zi("math",r.body);r.type==="mbin"&&(R+='<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=zi("math",r.superscript);Nr=Nr.trim();let Qr=zi("math",r.subscript);Qr=Qr.trim(),R+=' 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"))R+=" the summation of";else{let Nr=zi("math",r.subscript);Nr=Nr.trim(),R+=' 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=zi("math",r.superscript);Nr=Nr.trim();let Qr=zi("math",r.subscript);Qr=Qr.trim(),R+=' 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"))R+=" the product of ";else{let Nr=zi("math",r.subscript);Nr=Nr.trim(),R+=' 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=zi("math",r.superscript);Nr=Nr.trim();let Qr=zi("math",r.subscript);Qr=Qr.trim(),R+=' the integral from <break time="200ms"/>'+C(Qr)+'<break time="200ms"/> to <break time="200ms"/>'+C(Nr)+' <break time="200ms"/> of ',Ie=!0}else R+=' the integral of <break time="200ms"/> ';else if(typeof r.value=="string"){const Nr=(v=W0[r.value])!=null?v:r.command?W0[r.command]:void 0;R+=Nr||" "+r.value}else r.command&&(r.command==="\\mathop"?R+=zi("math",r.body):r.command==="\\operatorname"?R+=Km(r.body):R+=r.command.startsWith("\\")?" "+r.command.slice(1):" "+r.command)}break;case"enclose":_e=zi("math",r.body),R+=" crossed out "+_e+". End crossed out.";break;case"space":case"spacing":break}if(!Ie&&!r.hasEmptyBranch("superscript")){let St=zi(e,r.superscript);St=St.trim();const nr=St.replace(/<[^>]*>/g,"");if(Mc(r.superscript)){if(e==="math"){const xt=Um(r.superscript);xt&&(R+='<mark name="'+xt+'"/>')}nr==="\u2032"?R+=" prime ":nr==="2"?R+=" squared ":nr==="3"?R+=" cubed ":Number.isNaN(Number.parseInt(nr))?R+=" to the "+St+"; ":R+=' to the <say-as interpret-as="ordinal">'+nr+"</say-as> power; "}else Number.isNaN(Number.parseInt(nr))?R+=" raised to the "+St+"; ":R+=' raised to the <say-as interpret-as="ordinal">'+nr+"</say-as> power; "}if(!Ie&&!r.hasEmptyBranch("subscript")){let St=zi("math",r.subscript);St=St.trim(),R+=Mc(r.subscript)?" sub "+St:" subscript "+St+". End subscript. "}}return R}function j0(e){var r,n;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const u=cn(e);if(u){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(r=window.MathfieldElement.textToSpeechRulesOptions)!=null?r:{},window.MathfieldElement.textToSpeechRulesOptions=d(N({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=d(N({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=d(N({},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=zi("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 os(e){var r,n,a,u,f,v,A,C,R,z,J,_e,Ie;if(!e)return"";if(k(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(os).join("");if(e[0].mode==="text"){let hr=0,Zt="";for(;((r=e[hr])==null?void 0:r.mode)==="text";)Zt+=e[hr].body?os(e[hr].body):e[hr].value,hr++;return`"${Zt}" ${os(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(os(e[xt++]))}return Wt.push(os(e.slice(xt))),Hm(Wt)}if(e.mode==="text")return`"${e.value}"`;let ze="";const{command:St}=e;let nr;if(St==="\\placeholder")return`(${os(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:""} ${os(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(jr=>jr.value).join("");case"group":case"root":ze=(n=Lc[St])!=null?n:os(e.body);break;case"genfrac":{const jr=e;(jr.leftDelim||jr.rightDelim)&&(ze=jr.leftDelim==="."||!jr.leftDelim?"{:":jr.leftDelim),jr.hasBarLine?(ze+="(",ze+=os(jr.above),ze+=")/(",ze+=os(jr.below),ze+=")"):(ze+="("+os(jr.above)+"),",ze+="("+os(jr.below)+")"),(jr.leftDelim||jr.rightDelim)&&(ze+=jr.rightDelim==="."||!jr.rightDelim?"{:":jr.rightDelim)}break;case"surd":ze+=e.hasEmptyBranch("above")?"sqrt("+os(e.body)+")":"root("+os(e.above)+")("+os(e.body)+")";break;case"latex":ze=e.value;break;case"leftright":{const jr=e,Zi=jr.leftDelim;ze+=Zi==="."||!Zi?"{:":Zi,ze+=os(jr.body);const An=jr.matchingRightDelim();ze+=An==="."||!An?":}":An}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+=" "),nr=St?St.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,nr?ze=String.fromCodePoint(Number.parseInt("0x"+nr[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"?os(e.body):(C=e.value)!=null?C:St,ze+=" ");break;case"array":const Wt=e.array,hr=e.environmentName,Zt=(R={bmatrix:["[","]"],"bmatrix*":["[","]"]}[hr])!=null?R:["(",")"],Nr=[];for(const jr of Wt){const Zi=[];for(const An of jr)Zi.push(Zt[0]+os(An)+Zt[1]);Nr.push(Zi.join(","))}const Qr=(z={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[hr])!=null?z:["(",")"];ze=Qr[0]+Nr.join(",")+Qr[1];break;case"box":break;case"spacing":ze=(J=Lc[St])!=null?J:" ";break;case"enclose":ze="("+os(e.body)+")";break;case"space":ze=" ";break;case"subsup":ze="";break;case"macro":ze=(Ie=(_e=Lc[St])!=null?_e:Rc[St])!=null?Ie:os(e.body);break}if(!e.hasEmptyBranch("subscript")){ze+="_";const xt=os(e.subscript);ze+=xt.length!==1?`(${xt})`:xt}if(!e.hasEmptyBranch("superscript")){ze+="^";const xt=os(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 Rs(e,r){var n,a;r!=null||(r={}),r.mathstyle=(n=r.mathstyle)!=null?n:"displaystyle";const u=new ji({from:d(N({},eu()),{renderPlaceholder:()=>new or(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:zs(e,{context:u,parseMode:"math",mathstyle:r.mathstyle})}).render(u);return v?(m0(Ku(v,u)),g0(v,{classes:"ML__latex"}).toMarkup()):""}function Pg(e){return dh(e,{context:eu()})}function Vm(e,r={}){return cn(zs(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),r)}function Wm(e){const r=zs(e,{parseMode:"math",mathstyle:"displaystyle"});return j0(r)}var qh;function jm(e){var r,n;if(!qh){const a=(r=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:r.ComputeEngine;a?qh=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=qh==null?void 0:qh.box(e).latex)!=null?n:""}function Og(e,r="math"){return os(new $t({type:"root",body:zs(e,{parseMode:r})}))}function Bg(e){return ru(e,{format:"ascii-math"})[1]}function of(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 q0(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 lf(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 uf(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,R=-.004196086541837188*u-.7034186144594493*f+1.7076147009309444*v,z=J=>{const _e=Math.abs(J);return _e<=.0031308?J*12.92:(Math.sign(J)||1)*(1.055*Math.pow(_e,1/2.4)-.055)};return[z(A),z(C),z(R)]}function cf(e){const[r,n,a]=e;return r>=0&&r<=1&&n>=0&&n<=1&&a>=0&&a<=1}function hf(e,r){let[n,a,u]=e;return n=q0(n*255),a=q0(a*255),u=q0(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]=uf(e);if(cf([r,n,a]))return hf([r,n,a],e.alpha);const u=Zm(e);if(u.C=0,[r,n,a]=uf(lf(u)),!cf([r,n,a]))return hf([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]=uf(lf(u)),cf([r,n,a])?f=A:v=A;return hf([r,n,a],e.alpha)}function Ym(e){return dp(lf(e))}function fp(e,r){const n=of(e),a=of(r),u=.56,f=.57,v=.62,A=.65,C=.022,R=1.414,z=.1,J=5e-4,_e=1.14,Ie=.027,ze=1.14,St=.027;function nr(jr){return jr>=C?jr:jr+vo(C-jr,R)}function xt(jr){return(jr<0?-1:1)*Math.pow(Math.abs(jr),2.4)}const Wt=nr(xt(a.r/255)*.2126729+xt(a.g/255)*.7151522+xt(a.b/255)*.072175),hr=nr(xt(n.r/255)*.2126729+xt(n.g/255)*.7151522+xt(n.b/255)*.072175);let Zt,Nr,Qr;return Math.abs(hr-Wt)<J?Nr=0:hr>Wt?(Zt=vo(hr,u)-vo(Wt,f),Nr=Zt*_e):(Zt=vo(hr,A)-vo(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=of(e);let n=((1<<24)+(q0(r.r)<<16)+(q0(r.g)<<8)+q0(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 Gn(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=yc[r];return a?!!a.test(n[0].value):!1}function Qm(e,r){return Gn(e).length>0}function eg(e){return[df(e,"double-struck","mathbb","tooltip.blackboard"),df(e,"fraktur","mathfrak","tooltip.fraktur"),df(e,"calligraphic","mathcal","tooltip.caligraphic"),ff(e,"up","mathrm","tooltip.roman-upright"),ff(e,"bold","mathbf","tooltip.bold"),ff(e,"italic","mathit","tooltip.italic")]}function tg(e){return[{label:()=>Rs(`\\vec{${Gn(e)}}`),visible:()=>Gn(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\overrightarrow{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\overleftarrow{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\dot{${Gn(e)}}`),visible:()=>Gn(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\ddot{${Gn(e)}}`),visible:()=>Gn(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\bar{${Gn(e)}}`),visible:()=>Gn(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\overline{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\overgroup{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\overbrace{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\underline{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\undergroup{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\underbrace{${Gn(e)}}`),visible:()=>Gn(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function rg(e){return[{label:()=>Rs(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Rs(`\\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:()=>t0(e)},{label:()=>ue("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>t0(e)},{label:()=>ue("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>t0(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:()=>t0(e)},{type:"divider"},{label:()=>ue("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>t0(e)},{label:()=>ue("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>t0(e)},{type:"divider"},{label:()=>ue("menu.borders"),visible:()=>(lg(e)||t0(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:()=>{po(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>ue("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{po(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&&Gn(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",Rs(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:()=>Mn.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>ue("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Mn.copyToClipboard(e,"ascii-math")},{label:()=>ue("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Mn.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 t0(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){fo(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 df(e,r,n,a){return{label:()=>Rs(`\\${n}{${Gn(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 ff(e,r,n,a){return{label:()=>Rs(`\\${n}{${Gn(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 Z0(e,r){return e+j0(r)}wa({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 J=null;switch(z){case"all":J=f.root;break;case"selection":J=f.getAtoms(f.selection);break;case"left":{J=f.getAtoms(f.offsetOf(f.at(f.position).leftSibling),f.position);break}case"right":{J=f.getAtoms(f.position,f.offsetOf(f.at(f.position).rightSibling));break}case"group":J=f.getAtoms(f.getSiblingsRange(f.position));break;case"parent":{const{parent:_e}=f.at(f.position);_e!=null&&_e.parent?J=_e:J=f.root;break}default:J=f.root}return J}function A(z){let J="";switch(z){case"all":console.log("Internal failure: speak all failed");break;case"selection":J="no selection";break;case"left":J="at start";break;case"right":J="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":J="no parent";break;default:console.log('unknown speak_ param value: "'+z+'"');break}return J}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 R=j0(C);return O()&&n.withHighlighting?(fu().readAloudMathfield=e,Wu(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,R)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(R),!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"}),R=URL.createObjectURL(C);new Audio(R).play().catch(J=>console.log(J))}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=Z0("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=Z0("",e.model.at(e.model.position));else if(r==="line"){const f=Z0("",e.model.root);e.keyboardDelegate.setAriaLabel(f)}else u=a?Z0(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 Z0("",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+=Z0("",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=co(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=Ls(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]),R=$t.commonAncestor(A,C);(R==null?void 0:R.type)==="array"&&A.parent===R&&C.parent===R?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 As&&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(Vs(e)){if(a=r!=null?r:{},e.ranges.length>1)return e.ranges.reduce((R,z)=>[...R,...this.getAtoms(z,a)],[]);e=e.ranges[0]}let u,f;if(ao(e)){if(u=e,!ao(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 R=v;R<=A;R++){const z=this.atoms[R];vp(this,z,v,A)&&C.push(z)}return a.includeChildren||(C=C.filter(R=>{let z=!1,{parent:J}=R;for(;J&&!z;)z=vp(this,J,v,A),J=J.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 cn(e);if(n==="spoken")return j0(e);if(n==="spoken-text"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const u=j0(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=j0(e);return window.MathfieldElement.textToSpeechMarkup=a,u}return n==="ascii-math"?os(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(ao(e)&&ao(r)?(a=[this.normalizeRange([e,r])],u=n):oo(e)?(a=[this.normalizeRange(e)],u=r):Vs(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 Wi(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&&pf(this,f,[a,u]);)u=this.offsetOf(f),f=f.parent;for(f=this.at(a).parent;f!==this.root&&pf(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&&pf(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||cd(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(ao(e)){const u=this.normalizeOffset(e);if(ao(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(oo(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 Vs(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(Ko(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(N({},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(Ko(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 pf(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,R;const z=n.parent;if(z&&n instanceof Pn){const J=!a&&r==="forward"||a==="body"&&r==="backward";let _e=J?e.offsetOf(n.firstChild):e.offsetOf(n.lastChild);return J?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 J=n.leftSibling;n.hasChildren&&z.addChildrenAfter(n.removeBranch("body"),n),z.removeChild(n),e.position=e.offsetOf(J)}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 J=a&&r==="backward"||!a&&r==="forward"?n.leftSibling:n.lastChild;return z.addChildrenAfter(n.removeBranch("body"),n),z.removeChild(n),e.position=e.offsetOf(J),!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 J=Oc.fractionNavigationOrder==="numerator-denominator"?"above":"below",_e=J==="above"?"below":"above";if(z&&(r==="forward"&&a===J||r==="backward"&&a===_e)){const Ie=n.removeBranch(J),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 J=r==="forward"?(v=(u=n.superscript)==null?void 0:u[0])!=null?v:(f=n.subscript)==null?void 0:f[0]:(R=(A=n.subscript)==null?void 0:A[0].lastSibling)!=null?R:(C=n.superscript)==null?void 0:C[0].lastSibling;return J&&(e.position=e.offsetOf(J)),!0}return!1}if(!n.hasChildren&&n.type==="subsup"){const J=r==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);return n.parent.removeChild(n),e.position=J,!0}if(a==="superscript")if(r==="backward"){const J=e.offsetOf(n.firstChild)-1;console.assert(J>=0),e.position=J}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 J=r==="forward"?e.offsetOf(n):Math.max(0,e.offsetOf(n)-1);n.parent.removeChild(n),e.position=J}return!0}if((z==null?void 0:z.type)==="genfrac"&&!a&&n.type!=="first"){let J=e.offsetOf(n.leftSibling);return z.removeChild(n),z.hasEmptyBranch("above")&&z.hasEmptyBranch("below")?(J=e.offsetOf(z.leftSibling),z.parent.removeChild(z),e.announce("delete",void 0,[z]),e.position=J,!0):(e.announce("delete",void 0,[n]),e.position=J,!0)}if(r==="backward"&&((z==null?void 0:z.command)==="\\ln"||(z==null?void 0:z.command)==="\\log")&&n.parentBranch!=="body"){const J=e.offsetOf(z.leftSibling);return z.parent.removeChild(z),e.announce("delete",void 0,[z]),e.position=J,!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])}}):Go(e,Ls(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])}):Go(e,Ls(e.selection),"deleteContentForward")}function Go(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,R=a[0].parentBranch==="below"?"above":"below",z=e.offsetOf(C.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:n},()=>{var J,_e;const Ie=C.removeBranch(R);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);(J=C.parent)==null||J.removeChild(C),e.position=e.offsetOf(ze)}})}}return e.deferNotifications({content:!0,selection:!0,type:n},()=>e.deleteAtoms(r))}wa({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&Go(e,[0,-1],"deleteContent"),deleteForward:e=>yg(e),deleteBackward:e=>vg(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&Go(e,[e.anchor,Kd(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&Go(e,[e.anchor,Kd(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&Go(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&Go(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&Go(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&Go(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=N(d(N({},Rh()),{macros:wr(),registers:Kc()}),Lh(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:zs(v,{context:this.context})});this.model=new gg(this,A,C),this.undoManager=new W1(this.model);const R=[];if(R.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>"),R.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),R.push("<span part=content class=ML__content>"),R.push(Sf(this)),R.push("</span>"),window.mathVirtualKeyboard&&(R.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">`),R.push(bg),R.push("</div>")),R.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),R.push(_g),R.push("</div>"),R.push("</span>"),R.push("<span class=ML__sr-only>"),R.push("<span role=status aria-live=assertive aria-atomic=true></span>"),R.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(R.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",J=>J.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(Ko(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",J=>{if(J.currentTarget!==z||this._menu.state!=="closed")return;this.element.classList.add("tracking");const _e=z.getBoundingClientRect();this._menu.modifiers=xi(J),this._menu.show({target:z,location:{x:_e.left,y:_e.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),J.preventDefault(),J.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=qs(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}),bt&&!Y.locale.startsWith(bt.locale)&&Zr(Y.locale),La!=="ready"&&document.fonts.ready.then(()=>kh(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(Ko(this)),Gh(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Qd())}showMenu(e){var r,n;const a=(n=(r=e==null?void 0:e.location)!=null?r:Bu(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:gt(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=N({},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=qd(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 R=this.queryStyle({[C]:r[C]});if(R==="none")return"none";if(R==="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]=yn(this.options.keybindings,(e=ai())!=null?e:hi());return((r=ai())==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=N(N({},this.options),Lh(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)&&Mn.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 qu(this.options,e)}getOption(e){return qu(this.options,e)}handleEvent(e){return pu(this,null,function*(){var r;if(wl(this)){if(Nd(e)){if(!k0(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($0(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))&&zh.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield ap(e,this.element.querySelector("[part=container]"),this._menu))&&zh.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Gh(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>wl(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>wl(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!wl(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 $0(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Ko(this))),!1):m1(this,e)}get errors(){return dh(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=dd(this.model,this.model.position))!=null?n:"math");const a=this.undoManager.canUndo();Mn.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&&Wu(this,{interactive:!0});const r=this.field.getBoundingClientRect();let n=null;if(this.model.selectionIsCollapsed)n=Bu(this.field);else{const a=qc(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?Mn.insert(this.model,e,N({style:this.model.at(this.model.position).computedStyle},r)):Mn.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=zs(r,{context:this.context,parseMode:e});v.collapseSelection("forward");const R=v.at(v.position);v.position=v.offsetOf(R.parent.addChildrenAfter(C,R)),A=!0}if(this.model.mode=e,e==="latex"){let C=v.selectionIsCollapsed;po(this,"accept");let R,z=v.at(v.position);if(C)R="\\";else{const _e=Ls(v.selection);R=this.model.getValue(_e,"latex");const Ie=this.model.extractAtoms(_e);Ie.length===1&&Ie[0].type==="placeholder"&&(R=r,C=!0),z=v.at(_e[0])}const J=new Fo(R);z.parent.addChildAfter(J,z),C?v.position=v.offsetOf(J.lastChild):v.setSelection(v.offsetOf(J.firstChild),v.offsetOf(J.lastChild))}else Da(v).forEach(C=>{C.isError=!1});if(n){const C=zs(n,{context:this.context,parseMode:f});v.collapseSelection("forward");const R=v.at(v.position);v.position=v.offsetOf(R.parent.addChildrenAfter(C,R)),A=!0}return ns(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),A}),this.model.mode=e,window.mathVirtualKeyboard.update(Ko(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};oo(r)?u.range=r:(r.operation==="toggle"&&(u.operation="toggle"),u.range=r.range,u.silenceNotifications=(n=r.silenceNotifications)!=null?n:!1);const f=qd(this,e),v=(a=u.operation)!=null?a:"set";if(u.range===void 0&&this.model.selectionIsCollapsed){if(v==="set"){this.defaultStyle=N(N({},this.defaultStyle),f);return}const A=N({},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)zd(this.model,A,f,{operation:v});else zd(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=Bu(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({},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(Ko(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(Ko(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(Ko(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"?(po(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(Ko(this)),Gh(this)}onContentWillChange(e){var r,n,a;return(a=(n=this.host)==null?void 0:n.dispatchEvent(new InputEvent("beforeinput",d(N({},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(),Wu(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="",qa(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,Qd();const a=new AbortController,u=a.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{wl(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:u})},{once:!0,signal:u}),setTimeout(()=>a.abort(),100)}onInput(e){Vd(this,e)}onKeystroke(e){return Hf(this,e)}onCompositionStart(e){this.model.deleteAtoms(Ls(this.model.selection));const r=Bu(this.field);r&&requestAnimationFrame(()=>{Wu(this),this.keyboardDelegate.moveTo(r.x,r.y-r.height)})}onCompositionUpdate(e){F1(this.model,e),ns(this)}onCompositionEnd(e){N1(this.model),Vd(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Mn.onCopy(this,e),Go(this.model,Ls(this.model.selection),"deleteByCut"),this.snapshot("cut"),ns(this))}onCopy(e){Mn.onCopy(this,e)}onPaste(e){let r=this.isSelectionEditable;return r&&(r=Mn.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(),Vu(this),Gh(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=>Rt(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 mf(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&&mf(a)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&mf(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"]};fu().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));fu().readAloudMarks=A.split(`
`).map(C=>C?JSON.parse(C):{}),fu().readAloudTokens=[];for(const C of fu().readAloudMarks)C.value&&fu().readAloudTokens.push(C.value);fu().readAloudCurrentMark="",u.OutputFormat="mp3",u.SpeechMarkTypes=[],a.synthesizeSpeech(u,(C,R)=>{if(C){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${r}") error:${C}`);return}if(!(R!=null&&R.AudioStream))return;const z=new Uint8Array(R.AudioStream),J=new Blob([z.buffer],{type:"audio/mpeg"}),_e=URL.createObjectURL(J),Ie=fu();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?(Wu(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 nr of Ie.readAloudMarks)nr.time<St&&(ze=nr.value);Ie.readAloudCurrentMark!==ze&&(Ie.readAloudCurrentToken=ze,ze&&ze===Ie.readAloudFinalToken?Ie.readAloudAudio.pause():(Ie.readAloudCurrentMark=ze,mf(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 rn=new WeakMap,Sg=.5,du={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 = ..."},Fs=class r0 extends HTMLElement{static get formAssociated(){return Y0()}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 pu(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 pu(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(du[a])if(du[a].startsWith("mf."))if(du[a].startsWith(`mf.${a}`))n.push(`Option \`${a}\` cannot be used as a constructor option. Use ${du[a]}`);else{const u=du[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 ${du[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(Y0()&&(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=[nu("core"),nu("mathfield"),nu("mathfield-element"),nu("ui"),nu("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>"+Sl("core")+Sl("mathfield")+Sl("mathfield-element")+Sl("ui")+Sl("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=r0.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?qu(this._mathfield.options,r):rn.has(this)?N({},qu(N(N({},Rh()),Lh(rn.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?qu(this._mathfield.options,r):rn.has(this)?qu(N(N({},Rh()),Lh(rn.get(this).options)),r):null}reflectAttributes(){const r=Rh(),n=this._getOptions();Object.keys(r0.optionsAttributes).forEach(a=>{const u=Ml(a);r0.optionsAttributes[a]==="on/off"?r[u]!==n[u]?this.setAttribute(a,n[u]?"on":"off"):this.removeAttribute(a):r[u]!==n[u]&&(r0.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(rn.has(this)){const n=N(N({},rn.get(this).options),r);rn.set(this,d(N({},rn.get(this)),{selection:{ranges:n.readOnly?[[0,0]]:[[0,-1]]},options:n}))}else rn.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))du[n]&&console.warn(`\`mf.setOptions({${n}:...})\` -> ${du[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(rn.has(this)){let v,A,C;if(Vs(r)?([v,A]=r.ranges[0],C=n):oo(r)?([v,A]=r,C=n):ao(r)&&ao(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=rn.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(rn.has(this)){const u=rn.get(this).options;rn.set(this,{value:r,selection:{ranges:[[-1,-1]],direction:"forward"},options:u,menuItems:void 0});return}const a=Bc(this);rn.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=ia(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;tn.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),Y0()||(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 R="";if(this.hasAttribute("value")?R=this.getAttribute("value"):R=(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(N({},(a=(n=rn.get(this))==null?void 0:n.options)!=null?a:Bc(this)),{eventSink:this,value:R})),!rn.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const z of Object.keys(r0.optionsAttributes))this.upgradeProperty(Ml(z))}if(!((u=this._mathfield)!=null&&u.model)){this._mathfield=null;return}if(rn.has(this)){const z=this._mathfield,J=rn.get(this),_e=J.menuItems;z.model.deferNotifications({content:!1,selection:!1},()=>{const Ie=J.value;Ie!==void 0&&z.setValue(Ie),z.model.selection=J.selection,rn.delete(this)}),_e&&(this.menuItems=_e)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Ah()}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=qu(this._mathfield.options,Object.keys(r0.optionsAttributes).map(u=>Ml(u)));rn.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",""),Y0()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Y0()?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"),Y0()?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(N({},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=rn.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}rn.has(this)?rn.set(this,d(N({},rn.get(this)),{menuItems:r})):rn.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:rn.has(this)?rn.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(rn.has(this)){rn.set(this,d(N({},rn.get(this)),{selection:r}));return}rn.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:rn.has(this)?rn.get(this).selection.ranges[0][0]:0}set position(r){if(this._mathfield&&(this._mathfield.model.position=r,ns(this._mathfield)),rn.has(this)){rn.set(this,d(N({},rn.get(this)),{selection:{ranges:[[r,r]]}}));return}rn.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}};Fs.version="0.98.5",Fs._fontsDirectory="./fonts",Fs._soundsDirectory="./sounds",Fs.keypressVibration=!0,Fs._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Fs._plonkSound="plonk.wav",Fs.audioBuffers={},Fs.createHTML=e=>e,Fs._speechEngineRate="100%",Fs._speechEngineVoice="Joanna",Fs._textToSpeechMarkup="",Fs._textToSpeechRules="mathlive",Fs._textToSpeechRulesOptions={},Fs.speakHook=dg,Fs.readAloudHook=wg,Fs._decimalSeparator=".",Fs.fractionNavigationOrder="numerator-denominator",Fs._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=Fs;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 Y0(){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 Zh(e,r,n,a,u="latex"){const f=[];for(const v of e)if(v.type==="text"){const A=v.data;let C=!0,R=0,z;z=A.indexOf(r),z!==-1&&(R=z,R>0&&f.push({type:"text",data:A.slice(0,R)}),C=!1);let J=!1;for(;!J;){if(C){if(z=A.indexOf(r,R),z===-1){J=!0;break}R!==z&&f.push({type:"text",data:A.slice(R,z)}),R=z}else{if(z=Eg(n,A,R+r.length),z===-1){J=!0;break}let _e=A.slice(R+r.length,z);u==="ascii-math"&&([,_e]=ru(_e,{format:"ascii-math"})),f.push({type:"math",data:_e,rawData:A.slice(R,z+n.length),mathstyle:a}),R=z+n.length}C=!C}R<A.length&&f.push({type:"text",data:A.slice(R)})}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=Zh(a,u,f,"textstyle")}),r!=null&&r.display&&r.display.forEach(([u,f])=>{a=Zh(a,u,f,"displaystyle")}),n!=null&&n.inline&&n.inline.forEach(([u,f])=>{a=Zh(a,u,f,"textstyle","ascii-math")}),n!=null&&n.display&&n.display.forEach(([u,f])=>{a=Zh(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 X0(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 R=n.renderToSpeakableText(e);C.innerHTML=window.MathfieldElement.createHTML(R),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=X0(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=X0(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,R,z,J,_e,Ie,ze,St,nr,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=X0(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=X0(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 jr;if((A=r.processScriptTypePattern)!=null&&A.test(Qr.type))jr=(C=Qr.textContent)!=null?C:"";else if((R=r.processMathJSONScriptTypePattern)!=null&&R.test(Qr.type))try{jr=(J=r.serializeToLatex)==null?void 0:J.call(r,JSON.parse((z=Qr.textContent)!=null?z:""))}catch(Zi){console.error(Zi)}if(jr){let Zi="textstyle";for(const gr of Qr.type.split(";")){const[Ra,Vo]=gr.toLowerCase().split("=");Ra.trim()==="mode"&&(Zi=Vo.trim()==="display"?"displaystyle":"textstyle")}const An=X0(jr,Zi,r,!0);An&&Qr.parentNode.replaceChild(An,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=(nr=r.ignoreClassPattern)==null?void 0:nr.test(Zt.className))!=null&&xt))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const jr=e.textContent;e.textContent="";const Zi=X0(jr!=null?jr:"","displaystyle",r,!0);Zi&&e.append(Zi)}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=N(N({},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:""),Ah(),ja("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=cu.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}wa({switchKeyboardLayer:Mg,toggleVirtualKeyboard:Lg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function fu(){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=Rs),(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"}}}]);
}());