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.
144 lines
909 KiB
144 lines
909 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[191,3,5,7,8,19],{"+NIl":function(Ie,Ee,k){(function(V){V(k("VrN/"))})(function(V){"use strict";V.defineMode("stex",function(B,D){"use strict";function F(S,p){S.cmdState.push(p)}function M(S){return S.cmdState.length>0?S.cmdState[S.cmdState.length-1]:null}function _(S){var p=S.cmdState.pop();p&&p.closeBracket()}function N(S){for(var p=S.cmdState,m=p.length-1;m>=0;m--){var l=p[m];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function I(S,p,m){return function(){this.name=S,this.bracketNo=0,this.style=p,this.styles=m,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var A={};A.importmodule=I("importmodule","tag",["string","builtin"]),A.documentclass=I("documentclass","tag",["","atom"]),A.usepackage=I("usepackage","tag",["atom"]),A.begin=I("begin","tag",["atom"]),A.end=I("end","tag",["atom"]),A.label=I("label","tag",["atom"]),A.ref=I("ref","tag",["atom"]),A.eqref=I("eqref","tag",["atom"]),A.cite=I("cite","tag",["atom"]),A.bibitem=I("bibitem","tag",["atom"]),A.Bibitem=I("Bibitem","tag",["atom"]),A.RBibitem=I("RBibitem","tag",["atom"]),A.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(S,p){S.f=p}function v(S,p){var m;if(S.match(/^\\[a-zA-Z@]+/)){var l=S.current().slice(1);return m=A.hasOwnProperty(l)?A[l]:A.DEFAULT,m=new m,F(p,m),L(p,O),m.style}if(S.match(/^\\[$&%#{}_]/))return"tag";if(S.match(/^\\[,;!\/\\]/))return"tag";if(S.match("\\["))return L(p,function(a,c){return y(a,c,"\\]")}),"keyword";if(S.match("\\("))return L(p,function(a,c){return y(a,c,"\\)")}),"keyword";if(S.match("$$"))return L(p,function(a,c){return y(a,c,"$$")}),"keyword";if(S.match("$"))return L(p,function(a,c){return y(a,c,"$")}),"keyword";var i=S.next();if(i=="%")return S.skipToEnd(),"comment";if(i=="}"||i=="]"){if(m=M(p),m)m.closeBracket(i),L(p,O);else return"error";return"bracket"}else return i=="{"||i=="["?(m=A.DEFAULT,m=new m,F(p,m),"bracket"):/\d/.test(i)?(S.eatWhile(/[\w.%]/),"atom"):(S.eatWhile(/[\w\-_]/),m=N(p),m.name=="begin"&&(m.argument=S.current()),m.styleIdentifier())}function y(S,p,m){if(S.eatSpace())return null;if(m&&S.match(m))return L(p,v),"keyword";if(S.match(/^\\[a-zA-Z@]+/))return"tag";if(S.match(/^[a-zA-Z]+/))return"variable-2";if(S.match(/^\\[$&%#{}_]/))return"tag";if(S.match(/^\\[,;!\/]/))return"tag";if(S.match(/^[\^_&]/))return"tag";if(S.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(S.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=S.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(S.skipToEnd(),"comment"):"error"}function O(S,p){var m=S.peek(),l;return m=="{"||m=="["?(l=M(p),l.openBracket(m),S.eat(m),L(p,v),"bracket"):/[ \t\r]/.test(m)?(S.eat(m),null):(L(p,v),_(p),v(S,p))}return{startState:function(){var S=D.inMathMode?function(p,m){return y(p,m)}:v;return{cmdState:[],f:S}},copyState:function(S){return{cmdState:S.cmdState.slice(),f:S.f}},token:function(S,p){return p.f(S,p)},blankLine:function(S){S.f=v,S.cmdState.length=0},lineComment:"%"}}),V.defineMIME("text/x-stex","stex"),V.defineMIME("text/x-latex","stex")})},"+aKw":function(Ie,Ee,k){"use strict";var V=k("tJVT"),B=k("cDcd"),D=k.n(B),F=function(N){return String(N).length===1?"0".concat(N):N},M=function(N){var I=N.className,A=I===void 0?"":I,L=N.onChange,v=N.defaultValue,y=v===void 0?0:v,O=Object(B.useState)(y),S=Object(V.a)(O,2),p=S[0],m=S[1];Object(B.useEffect)(function(){var c=setTimeout(function(){m(p+1e3)},1e3);return L(p+1e3),function(){clearInterval(c)}},[p]);var l=parseInt(p/(60*6e4))||"00",i=parseInt(p%(60*6e4)/6e4)||"00",a=parseInt(p%6e4/1e3)||"00";return D.a.createElement("div",{className:A},F(l),":",F(i),":",F(a))};Ee.a=M},"+k/U":function(Ie,Ee,k){Ie.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(Ie,Ee,k){},"07cG":function(Ie,Ee,k){Ie.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Ie,Ee,k){(function(V){V(k("VrN/"))})(function(V){V.defineOption("placeholder","",function(I,A,L){var v=L&&L!=V.Init;if(A&&!v)I.on("blur",M),I.on("change",_),I.on("swapDoc",_),V.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){F(I)}),_(I);else if(!A&&v){I.off("blur",M),I.off("change",_),I.off("swapDoc",_),V.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),B(I);var y=I.getWrapperElement();y.className=y.className.replace(" CodeMirror-empty","")}A&&!I.hasFocus()&&M(I)});function B(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function D(I){B(I);var A=I.state.placeholder=document.createElement("pre");A.style.cssText="height: 0; overflow: visible",A.style.direction=I.getOption("direction"),A.className="CodeMirror-placeholder CodeMirror-line-like";var L=I.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),A.appendChild(L),I.display.lineSpace.insertBefore(A,I.display.lineSpace.firstChild)}function F(I){setTimeout(function(){var A=!1,L=I.getInputField();L.nodeName=="TEXTAREA"?A=!L.value:I.lineCount()==1&&(A=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),A?D(I):B(I)},20)}function M(I){N(I)&&D(I)}function _(I){var A=I.getWrapperElement(),L=N(I);A.className=A.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?D(I):B(I)}function N(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1eCo":function(Ie,Ee,k){(function(V){V(k("VrN/"))})(function(V){"use strict";var B={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};V.defineMode("xml",function(F,M){var _=F.indentUnit,N={},I=M.htmlMode?B:D;for(var A in I)N[A]=I[A];for(var A in M)N[A]=M[A];var L,v;function y(o,T){function b(j){return T.tokenize=j,j(o,T)}var g=o.next();if(g=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?b(p("atom","]]>")):null:o.match("--")?b(p("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),b(m(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),T.tokenize=p("meta","?>"),"meta"):(L=o.eat("/")?"closeTag":"openTag",T.tokenize=O,"tag bracket");if(g=="&"){var P;return o.eat("#")?o.eat("x")?P=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):P=o.eatWhile(/[\d]/)&&o.eat(";"):P=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),P?"atom":"error"}else return o.eatWhile(/[^&<]/),null}y.isInText=!0;function O(o,T){var b=o.next();if(b==">"||b=="/"&&o.eat(">"))return T.tokenize=y,L=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return L="equals",null;if(b=="<"){T.tokenize=y,T.state=c,T.tagName=T.tagStart=null;var g=T.tokenize(o,T);return g?g+" tag error":"tag error"}else return/[\'\"]/.test(b)?(T.tokenize=S(b),T.stringStartCol=o.column(),T.tokenize(o,T)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function S(o){var T=function(b,g){for(;!b.eol();)if(b.next()==o){g.tokenize=O;break}return"string"};return T.isInAttribute=!0,T}function p(o,T){return function(b,g){for(;!b.eol();){if(b.match(T)){g.tokenize=y;break}b.next()}return o}}function m(o){return function(T,b){for(var g;(g=T.next())!=null;){if(g=="<")return b.tokenize=m(o+1),b.tokenize(T,b);if(g==">")if(o==1){b.tokenize=y;break}else return b.tokenize=m(o-1),b.tokenize(T,b)}return"meta"}}function l(o,T,b){this.prev=o.context,this.tagName=T,this.indent=o.indented,this.startOfLine=b,(N.doNotIndent.hasOwnProperty(T)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function i(o){o.context&&(o.context=o.context.prev)}function a(o,T){for(var b;;){if(!o.context)return;if(b=o.context.tagName,!N.contextGrabbers.hasOwnProperty(b)||!N.contextGrabbers[b].hasOwnProperty(T))return;i(o)}}function c(o,T,b){return o=="openTag"?(b.tagStart=T.column(),C):o=="closeTag"?x:c}function C(o,T,b){return o=="word"?(b.tagName=T.current(),v="tag",E):N.allowMissingTagName&&o=="endTag"?(v="tag bracket",E(o,T,b)):(v="error",C)}function x(o,T,b){if(o=="word"){var g=T.current();return b.context&&b.context.tagName!=g&&N.implicitlyClosed.hasOwnProperty(b.context.tagName)&&i(b),b.context&&b.context.tagName==g||N.matchClosing===!1?(v="tag",h):(v="tag error",w)}else return N.allowMissingTagName&&o=="endTag"?(v="tag bracket",h(o,T,b)):(v="error",w)}function h(o,T,b){return o!="endTag"?(v="error",h):(i(b),c)}function w(o,T,b){return v="error",h(o,T,b)}function E(o,T,b){if(o=="word")return v="attribute",f;if(o=="endTag"||o=="selfcloseTag"){var g=b.tagName,P=b.tagStart;return b.tagName=b.tagStart=null,o=="selfcloseTag"||N.autoSelfClosers.hasOwnProperty(g)?a(b,g):(a(b,g),b.context=new l(b,g,P==b.indented)),c}return v="error",E}function f(o,T,b){return o=="equals"?d:(N.allowMissing||(v="error"),E(o,T,b))}function d(o,T,b){return o=="string"?s:o=="word"&&N.allowUnquoted?(v="string",E):(v="error",E(o,T,b))}function s(o,T,b){return o=="string"?s:E(o,T,b)}return{startState:function(o){var T={tokenize:y,state:c,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(T.baseIndent=o),T},token:function(o,T){if(!T.tagName&&o.sol()&&(T.indented=o.indentation()),o.eatSpace())return null;L=null;var b=T.tokenize(o,T);return(b||L)&&b!="comment"&&(v=null,T.state=T.state(L||b,o,T),v&&(b=v=="error"?b+" error":v)),b},indent:function(o,T,b){var g=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+_;if(g&&g.noIndent)return V.Pass;if(o.tokenize!=O&&o.tokenize!=y)return b?b.match(/^(\s*)/)[0].length:0;if(o.tagName)return N.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+_*(N.multilineTagIndentFactor||1);if(N.alignCDATA&&/<!\[CDATA\[/.test(T))return 0;var P=T&&/^<(\/)?([\w_:\.-]*)/.exec(T);if(P&&P[1])for(;g;)if(g.tagName==P[2]){g=g.prev;break}else if(N.implicitlyClosed.hasOwnProperty(g.tagName))g=g.prev;else break;else if(P)for(;g;){var j=N.contextGrabbers[g.tagName];if(j&&j.hasOwnProperty(P[2]))g=g.prev;else break}for(;g&&g.prev&&!g.startOfLine;)g=g.prev;return g?g.indent+_:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:N.htmlMode?"html":"xml",helperType:N.htmlMode?"html":"xml",skipAttribute:function(o){o.state==d&&(o.state=E)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var T=[],b=o.context;b;b=b.prev)b.tagName&&T.push(b.tagName);return T.reverse()}}}),V.defineMIME("text/xml","xml"),V.defineMIME("application/xml","xml"),V.mimeModes.hasOwnProperty("text/html")||V.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Ie,Ee,k){"use strict";k.d(Ee,"d",function(){return st}),k.d(Ee,"b",function(){return ue}),k.d(Ee,"c",function(){return Oe}),k.d(Ee,"a",function(){return tt});var V=k("VTBJ"),B=k("1OyB"),D=k("vuIU"),F=k("JX7q"),M=k("Ji7U"),_=k("LK+K"),N=k("cDcd"),I=k("I8Z2"),A=k("BGR+"),L=k("wx14"),v=k("rePB"),y=k("4IlW"),O=k("2GS6"),S=k("Gytx"),p=k.n(S),m=k("TSYQ"),l=k.n(m),i=k("U8pU"),a=k("ODXe"),c=/iPhone/i,C=/iPod/i,x=/iPad/i,h=/\bAndroid(?:.+)Mobile\b/i,w=/Android/i,E=/\bAndroid(?:.+)SD4930UR\b/i,f=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,d=/Windows Phone/i,s=/\bWindows(?:.+)ARM\b/i,o=/BlackBerry/i,T=/BB10/i,b=/Opera Mini/i,g=/\b(CriOS|Chrome)(?:.+)Mobile/i,P=/Mobile(?:.+)Firefox\b/i;function j(qe,Le){return qe.test(Le)}function H(qe){var Le=qe||(typeof navigator!="undefined"?navigator.userAgent:""),Ue=Le.split("[FBAN");if(typeof Ue[1]!="undefined"){var we=Ue,ee=Object(a.a)(we,1);Le=ee[0]}if(Ue=Le.split("Twitter"),typeof Ue[1]!="undefined"){var ce=Ue,je=Object(a.a)(ce,1);Le=je[0]}var De={apple:{phone:j(c,Le)&&!j(d,Le),ipod:j(C,Le),tablet:!j(c,Le)&&j(x,Le)&&!j(d,Le),device:(j(c,Le)||j(C,Le)||j(x,Le))&&!j(d,Le)},amazon:{phone:j(E,Le),tablet:!j(E,Le)&&j(f,Le),device:j(E,Le)||j(f,Le)},android:{phone:!j(d,Le)&&j(E,Le)||!j(d,Le)&&j(h,Le),tablet:!j(d,Le)&&!j(E,Le)&&!j(h,Le)&&(j(f,Le)||j(w,Le)),device:!j(d,Le)&&(j(E,Le)||j(f,Le)||j(h,Le)||j(w,Le))||j(/\bokhttp\b/i,Le)},windows:{phone:j(d,Le),tablet:j(s,Le),device:j(d,Le)||j(s,Le)},other:{blackberry:j(o,Le),blackberry10:j(T,Le),opera:j(b,Le),firefox:j(P,Le),chrome:j(g,Le),device:j(o,Le)||j(T,Le)||j(b,Le)||j(P,Le)||j(g,Le)},any:null,phone:null,tablet:null};return De.any=De.apple.device||De.android.device||De.windows.device||De.other.device,De.phone=De.apple.phone||De.android.phone||De.windows.phone,De.tablet=De.apple.tablet||De.android.tablet||De.windows.tablet,De}var X=Object(V.a)(Object(V.a)({},H()),{},{isMobile:H}),W=X;function U(){}function z(qe,Le,Ue){var we=Le||"";return qe.key||"".concat(we,"item_").concat(Ue)}function Z(qe){return"".concat(qe,"-menu-")}function q(qe,Le){var Ue=-1;N.Children.forEach(qe,function(we){Ue+=1,we&&we.type&&we.type.isMenuItemGroup?N.Children.forEach(we.props.children,function(ee){Ue+=1,Le(ee,Ue)}):Le(we,Ue)})}function oe(qe,Le,Ue){if(!qe||Ue.find)return;N.Children.forEach(qe,function(we){if(we){var ee=we.type;if(!ee||!(ee.isSubMenu||ee.isMenuItem||ee.isMenuItemGroup))return;Le.indexOf(we.key)!==-1?Ue.find=!0:we.props.children&&oe(we.props.children,Le,Ue)}})}var ye=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],me=function(Le){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=Le&&typeof Le.getBoundingClientRect=="function"&&Le.getBoundingClientRect().width;if(we){if(Ue){var ee=getComputedStyle(Le),ce=ee.marginLeft,je=ee.marginRight;we+=+ce.replace("px","")+ +je.replace("px","")}we=+we.toFixed(6)}return we||0},fe=function(Le,Ue,we){Le&&Object(i.a)(Le.style)==="object"&&(Le.style[Ue]=we)},ve=function(){return W.any},ge=k("KQm4"),ae=k("Ff2n"),se=k("faye"),Te=k("bdgK"),We=k("uciX"),Je=k("8XRh"),Ye={adjustX:1,adjustY:1},Ze={topLeft:{points:["bl","tl"],overflow:Ye,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ye,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Ye,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Ye,offset:[4,0]}},ze={topLeft:{points:["bl","tl"],overflow:Ye,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ye,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Ye,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Ye,offset:[4,0]}},Ke=Ze,$e=0,Qe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},nt=function(Le,Ue,we){var ee=Z(Ue),ce=Le.getState();Le.setState({defaultActiveFirst:Object(V.a)(Object(V.a)({},ce.defaultActiveFirst),{},Object(v.a)({},ee,we))})},Xe=function(qe){Object(M.a)(Ue,qe);var Le=Object(_.a)(Ue);function Ue(we){var ee;Object(B.a)(this,Ue),ee=Le.call(this,we),ee.onDestroy=function(Pe){ee.props.onDestroy(Pe)},ee.onKeyDown=function(Pe){var Be=Pe.keyCode,dt=ee.menuInstance,Bt=ee.props,Tt=Bt.isOpen,gn=Bt.store;if(Be===y.a.ENTER)return ee.onTitleClick(Pe),nt(gn,ee.props.eventKey,!0),!0;if(Be===y.a.RIGHT)return Tt?dt.onKeyDown(Pe):(ee.triggerOpenChange(!0),nt(gn,ee.props.eventKey,!0)),!0;if(Be===y.a.LEFT){var bn;if(Tt)bn=dt.onKeyDown(Pe);else return;return bn||(ee.triggerOpenChange(!1),bn=!0),bn}return Tt&&(Be===y.a.UP||Be===y.a.DOWN)?dt.onKeyDown(Pe):void 0},ee.onOpenChange=function(Pe){ee.props.onOpenChange(Pe)},ee.onPopupVisibleChange=function(Pe){ee.triggerOpenChange(Pe,Pe?"mouseenter":"mouseleave")},ee.onMouseEnter=function(Pe){var Be=ee.props,dt=Be.eventKey,Bt=Be.onMouseEnter,Tt=Be.store;nt(Tt,ee.props.eventKey,!1),Bt({key:dt,domEvent:Pe})},ee.onMouseLeave=function(Pe){var Be=ee.props,dt=Be.parentMenu,Bt=Be.eventKey,Tt=Be.onMouseLeave;dt.subMenuInstance=Object(F.a)(ee),Tt({key:Bt,domEvent:Pe})},ee.onTitleMouseEnter=function(Pe){var Be=ee.props,dt=Be.eventKey,Bt=Be.onItemHover,Tt=Be.onTitleMouseEnter;Bt({key:dt,hover:!0}),Tt({key:dt,domEvent:Pe})},ee.onTitleMouseLeave=function(Pe){var Be=ee.props,dt=Be.parentMenu,Bt=Be.eventKey,Tt=Be.onItemHover,gn=Be.onTitleMouseLeave;dt.subMenuInstance=Object(F.a)(ee),Tt({key:Bt,hover:!1}),gn({key:Bt,domEvent:Pe})},ee.onTitleClick=function(Pe){var Be=Object(F.a)(ee),dt=Be.props;if(dt.onTitleClick({key:dt.eventKey,domEvent:Pe}),dt.triggerSubMenuAction==="hover")return;ee.triggerOpenChange(!dt.isOpen,"click"),nt(dt.store,ee.props.eventKey,!1)},ee.onSubMenuClick=function(Pe){typeof ee.props.onClick=="function"&&ee.props.onClick(ee.addKeyPath(Pe))},ee.onSelect=function(Pe){ee.props.onSelect(Pe)},ee.onDeselect=function(Pe){ee.props.onDeselect(Pe)},ee.getPrefixCls=function(){return"".concat(ee.props.rootPrefixCls,"-submenu")},ee.getActiveClassName=function(){return"".concat(ee.getPrefixCls(),"-active")},ee.getDisabledClassName=function(){return"".concat(ee.getPrefixCls(),"-disabled")},ee.getSelectedClassName=function(){return"".concat(ee.getPrefixCls(),"-selected")},ee.getOpenClassName=function(){return"".concat(ee.props.rootPrefixCls,"-submenu-open")},ee.saveMenuInstance=function(Pe){ee.menuInstance=Pe},ee.addKeyPath=function(Pe){return Object(V.a)(Object(V.a)({},Pe),{},{keyPath:(Pe.keyPath||[]).concat(ee.props.eventKey)})},ee.triggerOpenChange=function(Pe,Be){var dt=ee.props.eventKey,Bt=function(){ee.onOpenChange({key:dt,item:Object(F.a)(ee),trigger:Be,open:Pe})};Be==="mouseenter"?ee.mouseenterTimeout=setTimeout(function(){Bt()},0):Bt()},ee.isChildrenSelected=function(){var Pe={find:!1};return oe(ee.props.children,ee.props.selectedKeys,Pe),Pe.find},ee.isOpen=function(){return ee.props.openKeys.indexOf(ee.props.eventKey)!==-1},ee.adjustWidth=function(){if(!ee.subMenuTitle||!ee.menuInstance)return;var Pe=se.findDOMNode(ee.menuInstance);if(Pe.offsetWidth>=ee.subMenuTitle.offsetWidth)return;Pe.style.minWidth="".concat(ee.subMenuTitle.offsetWidth,"px")},ee.saveSubMenuTitle=function(Pe){ee.subMenuTitle=Pe},ee.getBaseProps=function(){var Pe=Object(F.a)(ee),Be=Pe.props;return{mode:Be.mode==="horizontal"?"vertical":Be.mode,visible:ee.props.isOpen,level:Be.level+1,inlineIndent:Be.inlineIndent,focusable:!1,onClick:ee.onSubMenuClick,onSelect:ee.onSelect,onDeselect:ee.onDeselect,onDestroy:ee.onDestroy,selectedKeys:Be.selectedKeys,eventKey:"".concat(Be.eventKey,"-menu-"),openKeys:Be.openKeys,motion:Be.motion,onOpenChange:ee.onOpenChange,subMenuOpenDelay:Be.subMenuOpenDelay,parentMenu:Object(F.a)(ee),subMenuCloseDelay:Be.subMenuCloseDelay,forceSubMenuRender:Be.forceSubMenuRender,triggerSubMenuAction:Be.triggerSubMenuAction,builtinPlacements:Be.builtinPlacements,defaultActiveFirst:Be.store.getState().defaultActiveFirst[Z(Be.eventKey)],multiple:Be.multiple,prefixCls:Be.rootPrefixCls,id:ee.internalMenuId,manualRef:ee.saveMenuInstance,itemIcon:Be.itemIcon,expandIcon:Be.expandIcon,direction:Be.direction}},ee.getMotion=function(Pe,Be){var dt=Object(F.a)(ee),Bt=dt.haveRendered,Tt=ee.props,gn=Tt.motion,bn=Tt.rootPrefixCls,ln=Object(V.a)(Object(V.a)({},gn),{},{leavedClassName:"".concat(bn,"-hidden"),removeOnLeave:!1,motionAppear:Bt||!Be||Pe!=="inline"});return ln};var ce=we.store,je=we.eventKey,De=ce.getState(),at=De.defaultActiveFirst;ee.isRootMenu=!1;var it=!1;return at&&(it=at[je]),nt(ce,je,it),ee}return Object(D.a)(Ue,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ee=this,ce=this.props,je=ce.mode,De=ce.parentMenu,at=ce.manualRef;if(at&&at(this),je!=="horizontal"||!De.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ee.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ee=this.props,ce=ee.onDestroy,je=ee.eventKey;ce&&ce(je),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ee){var ce=this,je=this.getBaseProps(),De=this.getMotion(je.mode,je.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||je.visible||je.forceSubMenuRender,!this.haveOpened)return N.createElement("div",null);var at=je.direction;return N.createElement(Je.default,Object.assign({visible:je.visible},De),function(it){var Pe=it.className,Be=it.style,dt=l()("".concat(je.prefixCls,"-sub"),Pe,Object(v.a)({},"".concat(je.prefixCls,"-rtl"),at==="rtl"));return N.createElement(de,Object.assign({},je,{id:ce.internalMenuId,className:dt,style:Be}),ee)})}},{key:"render",value:function(){var ee,ce=Object(V.a)({},this.props),je=ce.isOpen,De=this.getPrefixCls(),at=ce.mode==="inline",it=l()(De,"".concat(De,"-").concat(ce.mode),(ee={},Object(v.a)(ee,ce.className,!!ce.className),Object(v.a)(ee,this.getOpenClassName(),je),Object(v.a)(ee,this.getActiveClassName(),ce.active||je&&!at),Object(v.a)(ee,this.getDisabledClassName(),ce.disabled),Object(v.a)(ee,this.getSelectedClassName(),this.isChildrenSelected()),ee));this.internalMenuId||(ce.eventKey?this.internalMenuId="".concat(ce.eventKey,"$Menu"):($e+=1,this.internalMenuId="$__$".concat($e,"$Menu")));var Pe={},Be={},dt={};ce.disabled||(Pe={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Be={onClick:this.onTitleClick},dt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Bt={},Tt=ce.direction;at&&(Tt==="rtl"?Bt.paddingRight=ce.inlineIndent*ce.level:Bt.paddingLeft=ce.inlineIndent*ce.level);var gn={};this.props.isOpen&&(gn={"aria-owns":this.internalMenuId});var bn=null;ce.mode!=="horizontal"&&(bn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(bn=N.createElement(this.props.expandIcon,Object(V.a)({},this.props))));var ln=N.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Bt,className:"".concat(De,"-title"),role:"button"},dt,Be,{"aria-expanded":je},gn,{"aria-haspopup":"true",title:typeof ce.title=="string"?ce.title:void 0}),ce.title,bn||N.createElement("i",{className:"".concat(De,"-arrow")})),bt=this.renderChildren(ce.children),Dn=ce.parentMenu.isRootMenu?ce.parentMenu.props.getPopupContainer:function(pr){return pr.parentNode},Gn=Qe[ce.mode],Cn=ce.popupOffset?{offset:ce.popupOffset}:{},Gt=ce.mode==="inline"?"":ce.popupClassName;Gt+=Tt==="rtl"?" ".concat(De,"-rtl"):"";var _n=ce.disabled,Bn=ce.triggerSubMenuAction,mr=ce.subMenuOpenDelay,rt=ce.forceSubMenuRender,ct=ce.subMenuCloseDelay,qn=ce.builtinPlacements;ye.forEach(function(pr){return delete ce[pr]}),delete ce.onClick;var Tr=Tt==="rtl"?Object.assign({},ze,qn):Object.assign({},Ze,qn);return delete ce.direction,N.createElement("li",Object.assign({},ce,Pe,{className:it,role:"menuitem"}),at&&ln,at&&bt,!at&&N.createElement(We.a,{prefixCls:De,popupClassName:l()("".concat(De,"-popup"),Gt),getPopupContainer:Dn,builtinPlacements:Tr,popupPlacement:Gn,popupVisible:je,popupAlign:Cn,popup:bt,action:_n?[]:[Bn],mouseEnterDelay:mr,mouseLeaveDelay:ct,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:rt},ln))}}]),Ue}(N.Component);Xe.defaultProps={onMouseEnter:U,onMouseLeave:U,onTitleMouseEnter:U,onTitleMouseLeave:U,onTitleClick:U,manualRef:U,mode:"vertical",title:""};var He=Object(I.b)(function(qe,Le){var Ue=qe.openKeys,we=qe.activeKey,ee=qe.selectedKeys,ce=Le.eventKey,je=Le.subMenuKey;return{isOpen:Ue.indexOf(ce)>-1,active:we[je]===ce,selectedKeys:ee}})(Xe);He.isSubMenu=!0;var st=He,ft="menuitem-overflowed",ot=.5,ut=function(qe){Object(M.a)(Ue,qe);var Le=Object(_.a)(Ue);function Ue(){var we;return Object(B.a)(this,Ue),we=Le.apply(this,arguments),we.resizeObserver=null,we.mutationObserver=null,we.originalTotalWidth=0,we.overflowedItems=[],we.menuItemSizes=[],we.cancelFrameId=null,we.state={lastVisibleIndex:void 0},we.getMenuItemNodes=function(){var ee=we.props.prefixCls,ce=se.findDOMNode(Object(F.a)(we));return ce?[].slice.call(ce.children).filter(function(je){return je.className.split(" ").indexOf("".concat(ee,"-overflowed-submenu"))<0}):[]},we.getOverflowedSubMenuItem=function(ee,ce,je){var De=we.props,at=De.overflowedIndicator,it=De.level,Pe=De.mode,Be=De.prefixCls,dt=De.theme;if(it!==1||Pe!=="horizontal")return null;var Bt=we.props.children[0],Tt=Bt.props,gn=Tt.children,bn=Tt.title,ln=Tt.style,bt=Object(ae.a)(Tt,["children","title","style"]),Dn=Object(V.a)({},ln),Gn="".concat(ee,"-overflowed-indicator"),Cn="".concat(ee,"-overflowed-indicator");ce.length===0&&je!==!0?Dn=Object(V.a)(Object(V.a)({},Dn),{},{display:"none"}):je&&(Dn=Object(V.a)(Object(V.a)({},Dn),{},{visibility:"hidden",position:"absolute"}),Gn="".concat(Gn,"-placeholder"),Cn="".concat(Cn,"-placeholder"));var Gt=dt?"".concat(Be,"-").concat(dt):"",_n={};return ye.forEach(function(Bn){bt[Bn]!==void 0&&(_n[Bn]=bt[Bn])}),N.createElement(st,Object.assign({title:at,className:"".concat(Be,"-overflowed-submenu"),popupClassName:Gt},_n,{key:Gn,eventKey:Cn,disabled:!1,style:Dn}),ce)},we.setChildrenWidthAndResize=function(){if(we.props.mode!=="horizontal")return;var ee=se.findDOMNode(Object(F.a)(we));if(!ee)return;var ce=ee.children;if(!ce||ce.length===0)return;var je=ee.children[ce.length-1];fe(je,"display","inline-block");var De=we.getMenuItemNodes(),at=De.filter(function(it){return it.className.split(" ").indexOf(ft)>=0});at.forEach(function(it){fe(it,"display","inline-block")}),we.menuItemSizes=De.map(function(it){return me(it,!0)}),at.forEach(function(it){fe(it,"display","none")}),we.overflowedIndicatorWidth=me(ee.children[ee.children.length-1],!0),we.originalTotalWidth=we.menuItemSizes.reduce(function(it,Pe){return it+Pe},0),we.handleResize(),fe(je,"display","none")},we.handleResize=function(){if(we.props.mode!=="horizontal")return;var ee=se.findDOMNode(Object(F.a)(we));if(!ee)return;var ce=me(ee);we.overflowedItems=[];var je=0,De;we.originalTotalWidth>ce+ot&&(De=-1,we.menuItemSizes.forEach(function(at){je+=at,je+we.overflowedIndicatorWidth<=ce&&(De+=1)})),we.setState({lastVisibleIndex:De})},we}return Object(D.a)(Ue,[{key:"componentDidMount",value:function(){var ee=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ce=se.findDOMNode(this);if(!ce)return;this.resizeObserver=new Te.default(function(je){je.forEach(function(){var De=ee.cancelFrameId;cancelAnimationFrame(De),ee.cancelFrameId=requestAnimationFrame(ee.setChildrenWidthAndResize)})}),[].slice.call(ce.children).concat(ce).forEach(function(je){ee.resizeObserver.observe(je)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ee.resizeObserver.disconnect(),[].slice.call(ce.children).concat(ce).forEach(function(je){ee.resizeObserver.observe(je)}),ee.setChildrenWidthAndResize()}),this.mutationObserver.observe(ce,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ee){var ce=this,je=this.state.lastVisibleIndex;return(ee||[]).reduce(function(De,at,it){var Pe=at;if(ce.props.mode==="horizontal"){var Be=ce.getOverflowedSubMenuItem(at.props.eventKey,[]);je!==void 0&&ce.props.className.indexOf("".concat(ce.props.prefixCls,"-root"))!==-1&&(it>je&&(Pe=N.cloneElement(at,{style:{display:"none"},eventKey:"".concat(at.props.eventKey,"-hidden"),className:"".concat(ft)})),it===je+1&&(ce.overflowedItems=ee.slice(je+1).map(function(Bt){return N.cloneElement(Bt,{key:Bt.props.eventKey,mode:"vertical-left"})}),Be=ce.getOverflowedSubMenuItem(at.props.eventKey,ce.overflowedItems)));var dt=[].concat(Object(ge.a)(De),[Be,Pe]);return it===ee.length-1&&dt.push(ce.getOverflowedSubMenuItem(at.props.eventKey,[],!0)),dt}return[].concat(Object(ge.a)(De),[Pe])},[])}},{key:"render",value:function(){var ee=this.props,ce=ee.visible,je=ee.prefixCls,De=ee.overflowedIndicator,at=ee.mode,it=ee.level,Pe=ee.tag,Be=ee.children,dt=ee.theme,Bt=Object(ae.a)(ee,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Tt=Pe;return N.createElement(Tt,Object.assign({},Bt),this.renderChildren(Be))}}]),Ue}(N.Component);ut.defaultProps={tag:"div",className:""};var gt=ut;function ht(qe){return qe.length?qe.every(function(Le){return!!Le.props.disabled}):!0}function be(qe,Le,Ue){var we=qe.getState();qe.setState({activeKey:Object(V.a)(Object(V.a)({},we.activeKey),{},Object(v.a)({},Le,Ue))})}function pe(qe){return qe.eventKey||"0-menu-"}function ke(qe,Le){var Ue=Le,we=qe.children,ee=qe.eventKey;if(Ue){var ce;if(q(we,function(je,De){je&&je.props&&!je.props.disabled&&Ue===z(je,ee,De)&&(ce=!0)}),ce)return Ue}return Ue=null,qe.defaultActiveFirst&&q(we,function(je,De){!Ue&&je&&!je.props.disabled&&(Ue=z(je,ee,De))}),Ue}function Ne(qe){if(qe){var Le=this.instanceArray.indexOf(qe);Le!==-1?this.instanceArray[Le]=qe:this.instanceArray.push(qe)}}var xe=function(qe){Object(M.a)(Ue,qe);var Le=Object(_.a)(Ue);function Ue(we){var ee;return Object(B.a)(this,Ue),ee=Le.call(this,we),ee.onKeyDown=function(ce,je){var De=ce.keyCode,at;if(ee.getFlatInstanceArray().forEach(function(Pe){Pe&&Pe.props.active&&Pe.onKeyDown&&(at=Pe.onKeyDown(ce))}),at)return 1;var it=null;return(De===y.a.UP||De===y.a.DOWN)&&(it=ee.step(De===y.a.UP?-1:1)),it?(ce.preventDefault(),be(ee.props.store,pe(ee.props),it.props.eventKey),typeof je=="function"&&je(it),1):void 0},ee.onItemHover=function(ce){var je=ce.key,De=ce.hover;be(ee.props.store,pe(ee.props),De?je:null)},ee.onDeselect=function(ce){ee.props.onDeselect(ce)},ee.onSelect=function(ce){ee.props.onSelect(ce)},ee.onClick=function(ce){ee.props.onClick(ce)},ee.onOpenChange=function(ce){ee.props.onOpenChange(ce)},ee.onDestroy=function(ce){ee.props.onDestroy(ce)},ee.getFlatInstanceArray=function(){return ee.instanceArray},ee.step=function(ce){var je=ee.getFlatInstanceArray(),De=ee.props.store.getState().activeKey[pe(ee.props)],at=je.length;if(!at)return null;ce<0&&(je=je.concat().reverse());var it=-1;if(je.every(function(Bt,Tt){return Bt&&Bt.props.eventKey===De?(it=Tt,!1):!0}),!ee.props.defaultActiveFirst&&it!==-1&&ht(je.slice(it,at-1)))return;var Pe=(it+1)%at,Be=Pe;do{var dt=je[Be];if(!dt||dt.props.disabled)Be=(Be+1)%at;else return dt}while(Be!==Pe);return null},ee.renderCommonMenuItem=function(ce,je,De){var at=ee.props.store.getState(),it=Object(F.a)(ee),Pe=it.props,Be=z(ce,Pe.eventKey,je),dt=ce.props;if(!dt||typeof ce.type=="string")return ce;var Bt=Be===at.activeKey,Tt=Object(V.a)(Object(V.a)({mode:dt.mode||Pe.mode,level:Pe.level,inlineIndent:Pe.inlineIndent,renderMenuItem:ee.renderMenuItem,rootPrefixCls:Pe.prefixCls,index:je,parentMenu:Pe.parentMenu,manualRef:dt.disabled?void 0:Object(O.a)(ce.ref,Ne.bind(Object(F.a)(ee))),eventKey:Be,active:!dt.disabled&&Bt,multiple:Pe.multiple,onClick:function(bn){(dt.onClick||U)(bn),ee.onClick(bn)},onItemHover:ee.onItemHover,motion:Pe.motion,subMenuOpenDelay:Pe.subMenuOpenDelay,subMenuCloseDelay:Pe.subMenuCloseDelay,forceSubMenuRender:Pe.forceSubMenuRender,onOpenChange:ee.onOpenChange,onDeselect:ee.onDeselect,onSelect:ee.onSelect,builtinPlacements:Pe.builtinPlacements,itemIcon:dt.itemIcon||ee.props.itemIcon,expandIcon:dt.expandIcon||ee.props.expandIcon},De),{},{direction:Pe.direction});return(Pe.mode==="inline"||ve())&&(Tt.triggerSubMenuAction="click"),N.cloneElement(ce,Tt)},ee.renderMenuItem=function(ce,je,De){if(!ce)return null;var at=ee.props.store.getState(),it={openKeys:at.openKeys,selectedKeys:at.selectedKeys,triggerSubMenuAction:ee.props.triggerSubMenuAction,subMenuKey:De};return ee.renderCommonMenuItem(ce,je,it)},we.store.setState({activeKey:Object(V.a)(Object(V.a)({},we.store.getState().activeKey),{},Object(v.a)({},we.eventKey,ke(we,we.activeKey)))}),ee.instanceArray=[],ee}return Object(D.a)(Ue,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ee){return this.props.visible||ee.visible||this.props.className!==ee.className||!p()(this.props.style,ee.style)}},{key:"componentDidUpdate",value:function(ee){var ce=this.props,je="activeKey"in ce?ce.activeKey:ce.store.getState().activeKey[pe(ce)],De=ke(ce,je);if(De!==je)be(ce.store,pe(ce),De);else if("activeKey"in ee){var at=ke(ee,ee.activeKey);De!==at&&be(ce.store,pe(ce),De)}}},{key:"render",value:function(){var ee=this,ce=Object(L.a)({},this.props);this.instanceArray=[];var je=l()(ce.prefixCls,ce.className,"".concat(ce.prefixCls,"-").concat(ce.mode)),De={className:je,role:ce.role||"menu"};ce.id&&(De.id=ce.id),ce.focusable&&(De.tabIndex=0,De.onKeyDown=this.onKeyDown);var at=ce.prefixCls,it=ce.eventKey,Pe=ce.visible,Be=ce.level,dt=ce.mode,Bt=ce.overflowedIndicator,Tt=ce.theme;return ye.forEach(function(gn){return delete ce[gn]}),delete ce.onClick,N.createElement(gt,Object.assign({},ce,{prefixCls:at,mode:dt,tag:"ul",level:Be,theme:Tt,visible:Pe,overflowedIndicator:Bt},De),N.Children.map(ce.children,function(gn,bn){return ee.renderMenuItem(gn,bn,it||"0-menu-")}))}}]),Ue}(N.Component);xe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:U};var Re=Object(I.b)()(xe),de=Re,re=k("Kwbf");function ne(qe,Le,Ue){var we=qe.prefixCls,ee=qe.motion,ce=qe.defaultMotions,je=ce===void 0?{}:ce,De=qe.openAnimation,at=qe.openTransitionName,it=Le.switchingModeFromInline;if(ee)return ee;if(Object(i.a)(De)==="object"&&De)Object(re.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof De=="string")return{motionName:"".concat(we,"-open-").concat(De)};if(at)return{motionName:at};var Pe=je[Ue];return Pe||(it?null:je.other)}var $=function(qe){Object(M.a)(Ue,qe);var Le=Object(_.a)(Ue);function Ue(we){var ee;Object(B.a)(this,Ue),ee=Le.call(this,we),ee.inlineOpenKeys=[],ee.onSelect=function(De){var at=Object(F.a)(ee),it=at.props;if(it.selectable){var Pe=ee.store.getState(),Be=Pe.selectedKeys,dt=De.key;it.multiple?Be=Be.concat([dt]):Be=[dt],"selectedKeys"in it||ee.store.setState({selectedKeys:Be}),it.onSelect(Object(V.a)(Object(V.a)({},De),{},{selectedKeys:Be}))}},ee.onClick=function(De){var at=ee.getRealMenuMode(),it=Object(F.a)(ee),Pe=it.store,Be=it.props.onOpenChange;at!=="inline"&&!("openKeys"in ee.props)&&(Pe.setState({openKeys:[]}),Be([])),ee.props.onClick(De)},ee.onKeyDown=function(De,at){ee.innerMenu.getWrappedInstance().onKeyDown(De,at)},ee.onOpenChange=function(De){var at=Object(F.a)(ee),it=at.props,Pe=ee.store.getState().openKeys.concat(),Be=!1,dt=function(Tt){var gn=!1;if(Tt.open)gn=Pe.indexOf(Tt.key)===-1,gn&&Pe.push(Tt.key);else{var bn=Pe.indexOf(Tt.key);gn=bn!==-1,gn&&Pe.splice(bn,1)}Be=Be||gn};Array.isArray(De)?De.forEach(dt):dt(De),Be&&("openKeys"in ee.props||ee.store.setState({openKeys:Pe}),it.onOpenChange(Pe))},ee.onDeselect=function(De){var at=Object(F.a)(ee),it=at.props;if(it.selectable){var Pe=ee.store.getState().selectedKeys.concat(),Be=De.key,dt=Pe.indexOf(Be);dt!==-1&&Pe.splice(dt,1),"selectedKeys"in it||ee.store.setState({selectedKeys:Pe}),it.onDeselect(Object(V.a)(Object(V.a)({},De),{},{selectedKeys:Pe}))}},ee.onMouseEnter=function(De){ee.restoreModeVerticalFromInline();var at=ee.props.onMouseEnter;at&&at(De)},ee.onTransitionEnd=function(De){var at=De.propertyName==="width"&&De.target===De.currentTarget,it=De.target.className,Pe=Object.prototype.toString.call(it)==="[object SVGAnimatedString]"?it.animVal:it,Be=De.propertyName==="font-size"&&Pe.indexOf("anticon")>=0;(at||Be)&&ee.restoreModeVerticalFromInline()},ee.setInnerMenu=function(De){ee.innerMenu=De},ee.isRootMenu=!0;var ce=we.defaultSelectedKeys,je=we.defaultOpenKeys;return"selectedKeys"in we&&(ce=we.selectedKeys||[]),"openKeys"in we&&(je=we.openKeys||[]),ee.store=Object(I.c)({selectedKeys:ce,openKeys:je,activeKey:{"0-menu-":ke(we,we.activeKey)}}),ee.state={switchingModeFromInline:!1},ee}return Object(D.a)(Ue,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ee){this.updateOpentKeysWhenSwitchMode(ee),this.updateMiniStore();var ce=this.props,je=ce.siderCollapsed,De=ce.inlineCollapsed,at=ce.onOpenChange;(!ee.inlineCollapsed&&De||!ee.siderCollapsed&&je)&&at([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ee){var ce=this.props,je=this.store,De=this.inlineOpenKeys,at=je.getState(),it={};ee.mode==="inline"&&ce.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in ce||((ce.inlineCollapsed&&!ee.inlineCollapsed||ce.siderCollapsed&&!ee.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=at.openKeys.concat(),it.openKeys=[]),(!ce.inlineCollapsed&&ee.inlineCollapsed||!ce.siderCollapsed&&ee.siderCollapsed)&&(it.openKeys=De,this.inlineOpenKeys=[])),Object.keys(it).length&&je.setState(it)}},{key:"updateMenuDisplay",value:function(){var ee=this.props.collapsedWidth,ce=this.store,je=this.prevOpenKeys,De=this.getInlineCollapsed()&&(ee===0||ee==="0"||ee==="0px");De?(this.prevOpenKeys=ce.getState().openKeys.concat(),this.store.setState({openKeys:[]})):je&&(this.store.setState({openKeys:je}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ee=this.props.mode,ce=this.state.switchingModeFromInline,je=this.getInlineCollapsed();return ce&&je?"inline":je?"vertical":ee}},{key:"getInlineCollapsed",value:function(){var ee=this.props,ce=ee.inlineCollapsed,je=ee.siderCollapsed;return je!==void 0?je:ce}},{key:"restoreModeVerticalFromInline",value:function(){var ee=this.state.switchingModeFromInline;ee&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ee=Object(V.a)({},Object(A.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ce=this.getRealMenuMode();return ee.className+=" ".concat(ee.prefixCls,"-root"),ee.direction==="rtl"&&(ee.className+=" ".concat(ee.prefixCls,"-rtl")),ee=Object(V.a)(Object(V.a)({},ee),{},{mode:ce,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ne(this.props,this.state,ce)}),delete ee.openAnimation,delete ee.openTransitionName,N.createElement(I.a,{store:this.store},N.createElement(de,Object.assign({},ee,{ref:this.setInnerMenu}),this.props.children))}}]),Ue}(N.Component);$.defaultProps={selectable:!0,onClick:U,onSelect:U,onOpenChange:U,onDeselect:U,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:N.createElement("span",null,"\xB7\xB7\xB7")};var Q=$,te=function(qe){Object(M.a)(Ue,qe);var Le=Object(_.a)(Ue);function Ue(){var we;return Object(B.a)(this,Ue),we=Le.apply(this,arguments),we.onKeyDown=function(ee){var ce=ee.keyCode;return ce===y.a.ENTER?(we.onClick(ee),!0):void 0},we.onMouseLeave=function(ee){var ce=we.props,je=ce.eventKey,De=ce.onItemHover,at=ce.onMouseLeave;De({key:je,hover:!1}),at({key:je,domEvent:ee})},we.onMouseEnter=function(ee){var ce=we.props,je=ce.eventKey,De=ce.onItemHover,at=ce.onMouseEnter;De({key:je,hover:!0}),at({key:je,domEvent:ee})},we.onClick=function(ee){var ce=we.props,je=ce.eventKey,De=ce.multiple,at=ce.onClick,it=ce.onSelect,Pe=ce.onDeselect,Be=ce.isSelected,dt={key:je,keyPath:[je],item:Object(F.a)(we),domEvent:ee};at(dt),De?Be?Pe(dt):it(dt):Be||it(dt)},we.saveNode=function(ee){we.node=ee},we}return Object(D.a)(Ue,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ee=this.props;ee.onDestroy&&ee.onDestroy(ee.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ee,ce=Object(V.a)({},this.props),je=l()(this.getPrefixCls(),ce.className,(ee={},Object(v.a)(ee,this.getActiveClassName(),!ce.disabled&&ce.active),Object(v.a)(ee,this.getSelectedClassName(),ce.isSelected),Object(v.a)(ee,this.getDisabledClassName(),ce.disabled),ee)),De=Object(V.a)(Object(V.a)({},ce.attribute),{},{title:typeof ce.title=="string"?ce.title:void 0,className:je,role:ce.role||"menuitem","aria-disabled":ce.disabled});ce.role==="option"?De=Object(V.a)(Object(V.a)({},De),{},{role:"option","aria-selected":ce.isSelected}):(ce.role===null||ce.role==="none")&&(De.role="none");var at={onClick:ce.disabled?null:this.onClick,onMouseLeave:ce.disabled?null:this.onMouseLeave,onMouseEnter:ce.disabled?null:this.onMouseEnter},it=Object(V.a)({},ce.style);ce.mode==="inline"&&(ce.direction==="rtl"?it.paddingRight=ce.inlineIndent*ce.level:it.paddingLeft=ce.inlineIndent*ce.level),ye.forEach(function(Be){return delete ce[Be]}),delete ce.direction;var Pe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Pe=N.createElement(this.props.itemIcon,this.props)),N.createElement("li",Object.assign({},Object(A.default)(ce,["onClick","onMouseEnter","onMouseLeave","onSelect"]),De,at,{style:it,ref:this.saveNode}),ce.children,Pe)}}]),Ue}(N.Component);te.isMenuItem=!0,te.defaultProps={onSelect:U,onMouseEnter:U,onMouseLeave:U,manualRef:U};var ie=Object(I.b)(function(qe,Le){var Ue=qe.activeKey,we=qe.selectedKeys,ee=Le.eventKey,ce=Le.subMenuKey;return{active:Ue[ce]===ee,isSelected:we.indexOf(ee)!==-1}})(te),ue=ie,Ce=function(qe){Object(M.a)(Ue,qe);var Le=Object(_.a)(Ue);function Ue(){var we;return Object(B.a)(this,Ue),we=Le.apply(this,arguments),we.renderInnerMenuItem=function(ee){var ce=we.props,je=ce.renderMenuItem,De=ce.index;return je(ee,De,we.props.subMenuKey)},we}return Object(D.a)(Ue,[{key:"render",value:function(){var ee=Object(L.a)({},this.props),ce=ee.className,je=ce===void 0?"":ce,De=ee.rootPrefixCls,at="".concat(De,"-item-group-title"),it="".concat(De,"-item-group-list"),Pe=ee.title,Be=ee.children;return ye.forEach(function(dt){return delete ee[dt]}),delete ee.onClick,delete ee.direction,N.createElement("li",Object.assign({},ee,{className:"".concat(je," ").concat(De,"-item-group")}),N.createElement("div",{className:at,title:typeof Pe=="string"?Pe:void 0},Pe),N.createElement("ul",{className:it},N.Children.map(Be,this.renderInnerMenuItem)))}}]),Ue}(N.Component);Ce.isMenuItemGroup=!0,Ce.defaultProps={disabled:!0};var Oe=Ce,Fe=function(Le){var Ue=Le.className,we=Le.rootPrefixCls,ee=Le.style;return N.createElement("li",{className:"".concat(Ue," ").concat(we,"-item-divider"),style:ee})};Fe.defaultProps={disabled:!0,className:"",style:{}};var tt=Fe,Ve=Ee.e=Q},"55Ip":function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return a});var V=k("Ty5D"),B=k("dI71"),D=k("cDcd"),F=k.n(D),M=k("YS25"),_=k("17x9"),N=k.n(_),I=k("wx14"),A=k("zLVn"),L=k("9R94"),v=function(d){Object(B.a)(s,d);function s(){for(var T,b=arguments.length,g=new Array(b),P=0;P<b;P++)g[P]=arguments[P];return T=d.call.apply(d,[this].concat(g))||this,T.history=Object(M.a)(T.props),T}var o=s.prototype;return o.render=function(){return F.a.createElement(V.c,{history:this.history,children:this.props.children})},s}(F.a.Component),y=function(d){Object(B.a)(s,d);function s(){for(var T,b=arguments.length,g=new Array(b),P=0;P<b;P++)g[P]=arguments[P];return T=d.call.apply(d,[this].concat(g))||this,T.history=Object(M.b)(T.props),T}var o=s.prototype;return o.render=function(){return F.a.createElement(V.c,{history:this.history,children:this.props.children})},s}(F.a.Component),O=function(s,o){return typeof s=="function"?s(o):s},S=function(s,o){return typeof s=="string"?Object(M.c)(s,null,null,o):s},p=function(s){return s},m=F.a.forwardRef;typeof m=="undefined"&&(m=p);function l(d){return!!(d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)}var i=m(function(d,s){var o=d.innerRef,T=d.navigate,b=d.onClick,g=Object(A.a)(d,["innerRef","navigate","onClick"]),P=g.target,j=Object(I.a)({},g,{onClick:function(X){try{b&&b(X)}catch(W){throw X.preventDefault(),W}!X.defaultPrevented&&X.button===0&&(!P||P==="_self")&&!l(X)&&(X.preventDefault(),T())}});return p!==m?j.ref=s||o:j.ref=o,F.a.createElement("a",j)}),a=m(function(d,s){var o=d.component,T=o===void 0?i:o,b=d.replace,g=d.to,P=d.innerRef,j=Object(A.a)(d,["component","replace","to","innerRef"]);return F.a.createElement(V.e.Consumer,null,function(H){H||Object(L.a)(!1);var X=H.history,W=S(O(g,H.location),H.location),U=W?X.createHref(W):"",z=Object(I.a)({},j,{href:U,navigate:function(){var q=O(g,H.location),oe=b?X.replace:X.push;oe(q)}});return p!==m?z.ref=s||P:z.innerRef=P,F.a.createElement(T,z)})});if(!1)var c,C;var x=function(s){return s},h=F.a.forwardRef;typeof h=="undefined"&&(h=x);function w(){for(var d=arguments.length,s=new Array(d),o=0;o<d;o++)s[o]=arguments[o];return s.filter(function(T){return T}).join(" ")}var E=h(function(d,s){var o=d["aria-current"],T=o===void 0?"page":o,b=d.activeClassName,g=b===void 0?"active":b,P=d.activeStyle,j=d.className,H=d.exact,X=d.isActive,W=d.location,U=d.sensitive,z=d.strict,Z=d.style,q=d.to,oe=d.innerRef,ye=Object(A.a)(d,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return F.a.createElement(V.e.Consumer,null,function(me){me||Object(L.a)(!1);var fe=W||me.location,ve=S(O(q,fe),fe),ge=ve.pathname,ae=ge&&ge.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),se=ae?Object(V.f)(fe.pathname,{path:ae,exact:H,sensitive:U,strict:z}):null,Te=!!(X?X(se,fe):se),We=Te?w(j,g):j,Je=Te?Object(I.a)({},Z,{},P):Z,Ye=Object(I.a)({"aria-current":Te&&T||null,className:We,style:Je,to:ve},ye);return x!==h?Ye.ref=s||oe:Ye.innerRef=oe,F.a.createElement(a,Ye)})});if(!1)var f},"5nXd":function(Ie,Ee,k){var V=k("MFOe"),B=V.slice,D=V.pluck,F=V.each,M=V.bind,_=V.create,N=V.isList,I=V.isFunction,A=V.isObject;Ie.exports={createStore:y};var L={version:"2.0.12",enabled:!1,get:function(O,S){var p=this.storage.read(this._namespacePrefix+O);return this._deserialize(p,S)},set:function(O,S){return S===void 0?this.remove(O):(this.storage.write(this._namespacePrefix+O,this._serialize(S)),S)},remove:function(O){this.storage.remove(this._namespacePrefix+O)},each:function(O){var S=this;this.storage.each(function(p,m){O.call(S,S._deserialize(p),(m||"").replace(S._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(O){return this._namespacePrefix=="__storejs_"+O+"_"},createStore:function(){return y.apply(this,arguments)},addPlugin:function(O){this._addPlugin(O)},namespace:function(O){return y(this.storage,this.plugins,O)}};function v(){var O=typeof console=="undefined"?null:console;if(!O)return;var S=O.warn?O.warn:O.log;S.apply(O,arguments)}function y(O,S,p){p||(p=""),O&&!N(O)&&(O=[O]),S&&!N(S)&&(S=[S]);var m=p?"__storejs_"+p+"_":"",l=p?new RegExp("^"+m):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(p))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var a={_namespacePrefix:m,_namespaceRegexp:l,_testStorage:function(C){try{var x="__storejs__test__";C.write(x,x);var h=C.read(x)===x;return C.remove(x),h}catch(w){return!1}},_assignPluginFnProp:function(C,x){var h=this[x];this[x]=function(){var E=B(arguments,0),f=this;function d(){return h?(F(arguments,function(o,T){E[T]=o}),h.apply(f,E)):void 0}var s=[d].concat(E);return C.apply(f,s)}},_serialize:function(C){return JSON.stringify(C)},_deserialize:function(C,x){if(!C)return x;var h="";try{h=JSON.parse(C)}catch(w){h=C}return h!==void 0?h:x},_addStorage:function(C){if(this.enabled)return;this._testStorage(C)&&(this.storage=C,this.enabled=!0)},_addPlugin:function(C){var x=this;if(N(C)){F(C,function(E){x._addPlugin(E)});return}var h=D(this.plugins,function(E){return C===E});if(h)return;if(this.plugins.push(C),!I(C))throw new Error("Plugins must be function values that return objects");var w=C.call(this);if(!A(w))throw new Error("Plugins must return an object of function properties");F(w,function(E,f){if(!I(E))throw new Error("Bad plugin property: "+f+" from plugin "+C.name+". Plugins should only return functions.");x._assignPluginFnProp(E,f)})},addStorage:function(C){v("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(C)}},c=_(a,L,{plugins:[]});return c.raw={},F(c,function(C,x){I(C)&&(c.raw[x]=M(c,C))}),F(O,function(C){c._addStorage(C)}),F(S,function(C){c._addPlugin(C)}),c}},"6+eU":function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return h});var V=k("wx14"),B=k("rePB"),D=k("VTBJ"),F=k("1OyB"),M=k("vuIU"),_=k("Ji7U"),N=k("LK+K"),I=k("cDcd"),A=k.n(I),L=k("TSYQ"),v=k.n(L),y=function(E){var f,d="".concat(E.rootPrefixCls,"-item"),s=v()(d,"".concat(d,"-").concat(E.page),(f={},Object(B.a)(f,"".concat(d,"-active"),E.active),Object(B.a)(f,E.className,!!E.className),Object(B.a)(f,"".concat(d,"-disabled"),!E.page),f)),o=function(){E.onClick(E.page)},T=function(g){E.onKeyPress(g,E.onClick,E.page)};return A.a.createElement("li",{title:E.showTitle?E.page:null,className:s,onClick:o,onKeyPress:T,tabIndex:"0"},E.itemRender(E.page,"page",A.a.createElement("a",{rel:"nofollow"},E.page)))},O=y,S={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},p=function(w){Object(_.a)(f,w);var E=Object(N.a)(f);function f(){var d;Object(F.a)(this,f);for(var s=arguments.length,o=new Array(s),T=0;T<s;T++)o[T]=arguments[T];return d=E.call.apply(E,[this].concat(o)),d.state={goInputText:""},d.buildOptionText=function(b){return"".concat(b," ").concat(d.props.locale.items_per_page)},d.changeSize=function(b){d.props.changeSize(Number(b))},d.handleChange=function(b){d.setState({goInputText:b.target.value})},d.handleBlur=function(b){var g=d.props,P=g.goButton,j=g.quickGo,H=g.rootPrefixCls,X=d.state.goInputText;if(P||X==="")return;if(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(H,"-prev"))>=0||b.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;d.setState({goInputText:""}),j(d.getValidValue())},d.go=function(b){var g=d.state.goInputText;if(g==="")return;(b.keyCode===S.ENTER||b.type==="click")&&(d.setState({goInputText:""}),d.props.quickGo(d.getValidValue()))},d}return Object(M.a)(f,[{key:"getValidValue",value:function(){var s=this.state,o=s.goInputText,T=s.current;return!o||isNaN(o)?T:Number(o)}},{key:"getPageSizeOptions",value:function(){var s=this.props,o=s.pageSize,T=s.pageSizeOptions;return T.some(function(b){return b.toString()===o.toString()})?T:T.concat([o.toString()]).sort(function(b,g){var P=isNaN(Number(b))?0:Number(b),j=isNaN(Number(g))?0:Number(g);return P-j})}},{key:"render",value:function(){var s=this,o=this.props,T=o.pageSize,b=o.locale,g=o.rootPrefixCls,P=o.changeSize,j=o.quickGo,H=o.goButton,X=o.selectComponentClass,W=o.buildOptionText,U=o.selectPrefixCls,z=o.disabled,Z=this.state.goInputText,q="".concat(g,"-options"),oe=X,ye=null,me=null,fe=null;if(!P&&!j)return null;var ve=this.getPageSizeOptions();if(P&&oe){var ge=ve.map(function(ae,se){return A.a.createElement(oe.Option,{key:se,value:ae.toString()},(W||s.buildOptionText)(ae))});ye=A.a.createElement(oe,{disabled:z,prefixCls:U,showSearch:!1,className:"".concat(q,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(T||ve[0]).toString(),onChange:this.changeSize,getPopupContainer:function(se){return se.parentNode}},ge)}return j&&(H&&(fe=typeof H=="boolean"?A.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(q,"-quick-jumper-button")},b.jump_to_confirm):A.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),me=A.a.createElement("div",{className:"".concat(q,"-quick-jumper")},b.jump_to,A.a.createElement("input",{disabled:z,type:"text",value:Z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),b.page,fe)),A.a.createElement("li",{className:"".concat(q)},ye,me)}}]),f}(A.a.Component);p.defaultProps={pageSizeOptions:["10","20","50","100"]};var m=p,l=k("N2Kk");function i(){}function a(w){return typeof w=="number"&&isFinite(w)&&Math.floor(w)===w}function c(w,E,f){return f}function C(w,E,f){var d=typeof w=="undefined"?E.pageSize:w;return Math.floor((f.total-1)/d)+1}var x=function(w){Object(_.a)(f,w);var E=Object(N.a)(f);function f(d){var s;Object(F.a)(this,f),s=E.call(this,d),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(C(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(P,j){var H=s.props.prefixCls,X=P||A.a.createElement("button",{type:"button","aria-label":j,className:"".concat(H,"-item-link")});return typeof P=="function"&&(X=A.a.createElement(P,Object(D.a)({},s.props))),X},s.savePaginationNode=function(P){s.paginationNode=P},s.isValid=function(P){return a(P)&&P!==s.state.current},s.shouldDisplayQuickJumper=function(){var P=s.props,j=P.showQuickJumper,H=P.pageSize,X=P.total;return X<=H?!1:j},s.handleKeyDown=function(P){(P.keyCode===S.ARROW_UP||P.keyCode===S.ARROW_DOWN)&&P.preventDefault()},s.handleKeyUp=function(P){var j=s.getValidValue(P),H=s.state.currentInputValue;j!==H&&s.setState({currentInputValue:j}),P.keyCode===S.ENTER?s.handleChange(j):P.keyCode===S.ARROW_UP?s.handleChange(j-1):P.keyCode===S.ARROW_DOWN&&s.handleChange(j+1)},s.changePageSize=function(P){var j=s.state.current,H=C(P,s.state,s.props);j=j>H?H:j,H===0&&(j=s.state.current),typeof P=="number"&&("pageSize"in s.props||s.setState({pageSize:P}),"current"in s.props||s.setState({current:j,currentInputValue:j})),s.props.onShowSizeChange(j,P),"onChange"in s.props&&s.props.onChange&&s.props.onChange(j,P)},s.handleChange=function(P){var j=s.props.disabled,H=P;if(s.isValid(H)&&!j){var X=C(void 0,s.state,s.props);H>X?H=X:H<1&&(H=1),"current"in s.props||s.setState({current:H,currentInputValue:H});var W=s.state.pageSize;return s.props.onChange(H,W),H}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current<C(void 0,s.state,s.props)},s.runIfEnter=function(P,j){if(P.key==="Enter"||P.charCode===13){for(var H=arguments.length,X=new Array(H>2?H-2:0),W=2;W<H;W++)X[W-2]=arguments[W];j.apply(void 0,X)}},s.runIfEnterPrev=function(P){s.runIfEnter(P,s.prev)},s.runIfEnterNext=function(P){s.runIfEnter(P,s.next)},s.runIfEnterJumpPrev=function(P){s.runIfEnter(P,s.jumpPrev)},s.runIfEnterJumpNext=function(P){s.runIfEnter(P,s.jumpNext)},s.handleGoTO=function(P){(P.keyCode===S.ENTER||P.type==="click")&&s.handleChange(s.state.currentInputValue)};var o=d.onChange!==i,T="current"in d;T&&!o&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var b=d.defaultCurrent;"current"in d&&(b=d.current);var g=d.defaultPageSize;return"pageSize"in d&&(g=d.pageSize),b=Math.min(b,C(g,void 0,d)),s.state={current:b,currentInputValue:b,pageSize:g},s}return Object(M.a)(f,[{key:"componentDidUpdate",value:function(s,o){var T=this.props.prefixCls;if(o.current!==this.state.current&&this.paginationNode){var b=this.paginationNode.querySelector(".".concat(T,"-item-").concat(o.current));b&&document.activeElement===b&&b.blur()}}},{key:"getValidValue",value:function(s){var o=s.target.value,T=C(void 0,this.state,this.props),b=this.state.currentInputValue,g;return o===""?g=o:isNaN(Number(o))?g=b:o>=T?g=T:g=Number(o),g}},{key:"getShowSizeChanger",value:function(){var s=this.props,o=s.showSizeChanger,T=s.total,b=s.totalBoundaryShowSizeChanger;return typeof o!="undefined"?o:T>b}},{key:"renderPrev",value:function(s){var o=this.props,T=o.prevIcon,b=o.itemRender,g=b(s,"prev",this.getItemIcon(T,"prev page")),P=!this.hasPrev();return Object(I.isValidElement)(g)?Object(I.cloneElement)(g,{disabled:P}):g}},{key:"renderNext",value:function(s){var o=this.props,T=o.nextIcon,b=o.itemRender,g=b(s,"next",this.getItemIcon(T,"next page")),P=!this.hasNext();return Object(I.isValidElement)(g)?Object(I.cloneElement)(g,{disabled:P}):g}},{key:"render",value:function(){var s=this,o=this.props,T=o.prefixCls,b=o.className,g=o.style,P=o.disabled,j=o.hideOnSinglePage,H=o.total,X=o.locale,W=o.showQuickJumper,U=o.showLessItems,z=o.showTitle,Z=o.showTotal,q=o.simple,oe=o.itemRender,ye=o.showPrevNextJumpers,me=o.jumpPrevIcon,fe=o.jumpNextIcon,ve=o.selectComponentClass,ge=o.selectPrefixCls,ae=o.pageSizeOptions,se=this.state,Te=se.current,We=se.pageSize,Je=se.currentInputValue;if(j===!0&&H<=We)return null;var Ye=C(void 0,this.state,this.props),Ze=[],ze=null,Ke=null,$e=null,Qe=null,nt=null,Xe=W&&W.goButton,He=U?1:2,st=Te-1>0?Te-1:0,ft=Te+1<Ye?Te+1:Ye,ot=Object.keys(this.props).reduce(function($,Q){return(Q.substr(0,5)==="data-"||Q.substr(0,5)==="aria-"||Q==="role")&&($[Q]=s.props[Q]),$},{});if(q)return Xe&&(typeof Xe=="boolean"?nt=A.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},X.jump_to_confirm):nt=A.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Xe),nt=A.a.createElement("li",{title:z?"".concat(X.jump_to).concat(Te,"/").concat(Ye):null,className:"".concat(T,"-simple-pager")},nt)),A.a.createElement("ul",Object(V.a)({className:v()(T,"".concat(T,"-simple"),Object(B.a)({},"".concat(T,"-disabled"),P),b),style:g,ref:this.savePaginationNode},ot),A.a.createElement("li",{title:z?X.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:v()("".concat(T,"-prev"),Object(B.a)({},"".concat(T,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(st)),A.a.createElement("li",{title:z?"".concat(Te,"/").concat(Ye):null,className:"".concat(T,"-simple-pager")},A.a.createElement("input",{type:"text",value:Je,disabled:P,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),A.a.createElement("span",{className:"".concat(T,"-slash")},"/"),Ye),A.a.createElement("li",{title:z?X.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:v()("".concat(T,"-next"),Object(B.a)({},"".concat(T,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ft)),nt);if(Ye<=3+He*2){var ut={locale:X,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:oe};Ye||Ze.push(A.a.createElement(O,Object(V.a)({},ut,{key:"noPager",page:Ye,className:"".concat(T,"-disabled")})));for(var gt=1;gt<=Ye;gt+=1){var ht=Te===gt;Ze.push(A.a.createElement(O,Object(V.a)({},ut,{key:gt,page:gt,active:ht})))}}else{var be=U?X.prev_3:X.prev_5,pe=U?X.next_3:X.next_5;ye&&(ze=A.a.createElement("li",{title:z?be:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:v()("".concat(T,"-jump-prev"),Object(B.a)({},"".concat(T,"-jump-prev-custom-icon"),!!me))},oe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(me,"prev page"))),Ke=A.a.createElement("li",{title:z?pe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:v()("".concat(T,"-jump-next"),Object(B.a)({},"".concat(T,"-jump-next-custom-icon"),!!fe))},oe(this.getJumpNextPage(),"jump-next",this.getItemIcon(fe,"next page")))),Qe=A.a.createElement(O,{locale:X,last:!0,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ye,page:Ye,active:!1,showTitle:z,itemRender:oe}),$e=A.a.createElement(O,{locale:X,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:oe});var ke=Math.max(1,Te-He),Ne=Math.min(Te+He,Ye);Te-1<=He&&(Ne=1+He*2),Ye-Te<=He&&(ke=Ye-He*2);for(var xe=ke;xe<=Ne;xe+=1){var Re=Te===xe;Ze.push(A.a.createElement(O,{locale:X,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:xe,page:xe,active:Re,showTitle:z,itemRender:oe}))}Te-1>=He*2&&Te!==1+2&&(Ze[0]=Object(I.cloneElement)(Ze[0],{className:"".concat(T,"-item-after-jump-prev")}),Ze.unshift(ze)),Ye-Te>=He*2&&Te!==Ye-2&&(Ze[Ze.length-1]=Object(I.cloneElement)(Ze[Ze.length-1],{className:"".concat(T,"-item-before-jump-next")}),Ze.push(Ke)),ke!==1&&Ze.unshift($e),Ne!==Ye&&Ze.push(Qe)}var de=null;Z&&(de=A.a.createElement("li",{className:"".concat(T,"-total-text")},Z(H,[H===0?0:(Te-1)*We+1,Te*We>H?H:Te*We])));var re=!this.hasPrev()||!Ye,ne=!this.hasNext()||!Ye;return A.a.createElement("ul",Object(V.a)({className:v()(T,b,Object(B.a)({},"".concat(T,"-disabled"),P)),style:g,unselectable:"unselectable",ref:this.savePaginationNode},ot),de,A.a.createElement("li",{title:z?X.prev_page:null,onClick:this.prev,tabIndex:re?null:0,onKeyPress:this.runIfEnterPrev,className:v()("".concat(T,"-prev"),Object(B.a)({},"".concat(T,"-disabled"),re)),"aria-disabled":re},this.renderPrev(st)),Ze,A.a.createElement("li",{title:z?X.next_page:null,onClick:this.next,tabIndex:ne?null:0,onKeyPress:this.runIfEnterNext,className:v()("".concat(T,"-next"),Object(B.a)({},"".concat(T,"-disabled"),ne)),"aria-disabled":ne},this.renderNext(ft)),A.a.createElement(m,{disabled:P,locale:X,rootPrefixCls:T,selectComponentClass:ve,selectPrefixCls:ge,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Te,pageSize:We,pageSizeOptions:ae,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Xe}))}}],[{key:"getDerivedStateFromProps",value:function(s,o){var T={};if("current"in s&&(T.current=s.current,s.current!==o.current&&(T.currentInputValue=T.current)),"pageSize"in s&&s.pageSize!==o.pageSize){var b=o.current,g=C(s.pageSize,o,s);b=b>g?g:b,"current"in s||(T.current=b,T.currentInputValue=b),T.pageSize=s.pageSize}return T}}]),f}(A.a.Component);x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:i,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:i,locale:l.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var h=x},"6RRn":function(Ie,Ee,k){"use strict";var V=k("wCXF"),B=k("n6Qo");k.d(Ee,"b",function(){return B.a});var D=k("IBYe"),F=k("6eGT"),M=k("hW8S");k.d(Ee,"a",function(){return M.a}),Ee.c=V.b},"6eGT":function(Ie,Ee,k){"use strict";function V(B){return null}Ee.a=V},"7Cbv":function(Ie,Ee,k){"use strict";var V=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),B=new Uint8Array(16);function D(){if(!V)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return V(B)}var F=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function M(O){return typeof O=="string"&&F.test(O)}for(var _=M,N=[],I=0;I<256;++I)N.push((I+256).toString(16).substr(1));function A(O){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=(N[O[S+0]]+N[O[S+1]]+N[O[S+2]]+N[O[S+3]]+"-"+N[O[S+4]]+N[O[S+5]]+"-"+N[O[S+6]]+N[O[S+7]]+"-"+N[O[S+8]]+N[O[S+9]]+"-"+N[O[S+10]]+N[O[S+11]]+N[O[S+12]]+N[O[S+13]]+N[O[S+14]]+N[O[S+15]]).toLowerCase();if(!_(p))throw TypeError("Stringified UUID is invalid");return p}var L=A;function v(O,S,p){O=O||{};var m=O.random||(O.rng||D)();if(m[6]=m[6]&15|64,m[8]=m[8]&63|128,S){p=p||0;for(var l=0;l<16;++l)S[p+l]=m[l];return S}return L(m)}var y=Ee.a=v},"7ahc":function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return C});var V=k("k1fw"),B=k("0Owb"),D=k("+L6B"),F=k("2/Rp"),M=k("y8nQ"),_=k("Vl3Y"),N=k("tJVT"),I=k("OaEy"),A=k("2fM7"),L=k("cDcd"),v=k.n(L),y=k("VrN/"),O=k.n(y),S=k("p77/"),p=k.n(S),m=k("c5Ni"),l=k.n(m),i=A.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},c={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ee.b=function(x){var h=x.callback,w=x.onCancel,E=Object(L.useState)("python"),f=Object(N.a)(E,2),d=f[0],s=f[1];function o(b){s(c[b][1])}function T(b){h(b)}return v.a.createElement(_.a,Object(B.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:T}),v.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(A.a,{onChange:o},Object.keys(c).map(function(b){return v.a.createElement(i,{key:b,value:b},c[b][0])}))),v.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(C,{mode:d})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(F.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function C(x){var h=x.value,w=x.onChange,E=x.mode,f=x.options,d=f===void 0?{}:f,s=Object(L.useRef)(),o=Object(L.useState)(),T=Object(N.a)(o,2),b=T[0],g=T[1];return Object(L.useEffect)(function(){if(b){function P(j){var H=j.getValue();w&&w(H)}return b.on("change",P),function(){b.off("change",P)}}},[b,w]),Object(L.useEffect)(function(){b&&b.setOption("mode",E)},[b,E]),Object(L.useEffect)(function(){b&&((h!==b.getValue()||h==="")&&setTimeout(function(){b.setValue(h||" ")},300))},[b,h]),Object(L.useEffect)(function(){if(s.current&&!b){var P=O.a.fromTextArea(s.current,Object(V.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},d));g(P)}},[s.current,b]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:s}))}},"7ixt":function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return D});var V={adjustX:1,adjustY:1},B=[0,0],D={left:{points:["cr","cl"],overflow:V,offset:[-4,0],targetOffset:B},right:{points:["cl","cr"],overflow:V,offset:[4,0],targetOffset:B},top:{points:["bc","tc"],overflow:V,offset:[0,-4],targetOffset:B},bottom:{points:["tc","bc"],overflow:V,offset:[0,4],targetOffset:B},topLeft:{points:["bl","tl"],overflow:V,offset:[0,-4],targetOffset:B},leftTop:{points:["tr","tl"],overflow:V,offset:[-4,0],targetOffset:B},topRight:{points:["br","tr"],overflow:V,offset:[0,-4],targetOffset:B},rightTop:{points:["tl","tr"],overflow:V,offset:[4,0],targetOffset:B},bottomRight:{points:["tr","br"],overflow:V,offset:[0,4],targetOffset:B},rightBottom:{points:["bl","br"],overflow:V,offset:[4,0],targetOffset:B},bottomLeft:{points:["tl","bl"],overflow:V,offset:[0,4],targetOffset:B},leftBottom:{points:["br","bl"],overflow:V,offset:[-4,0],targetOffset:B}},F=D},"815F":function(Ie,Ee,k){"use strict";k.d(Ee,"e",function(){return N}),k.d(Ee,"c",function(){return A}),k.d(Ee,"d",function(){return L}),k.d(Ee,"a",function(){return y}),k.d(Ee,"f",function(){return O}),k.d(Ee,"b",function(){return S});var V=k("KQm4"),B=k("VTBJ"),D=k("Ff2n"),F=k("Zm9Q"),M=k("Kwbf"),_=k("OZM5");function N(p,m){return p!=null?p:m}function I(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=new Map;function l(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(i||[]).forEach(function(c){var C=c.key,x=c.children;Object(M.a)(C!=null,"Tree node must have a certain key: [".concat(a).concat(C,"]"));var h=String(C);Object(M.a)(!m.has(h)||C===null||C===void 0,"Same 'key' exist in the Tree: ".concat(h)),m.set(h,!0),l(x,"".concat(a).concat(h," > "))})}l(p)}function A(p){function m(l){var i=Object(F.a)(l);return i.map(function(a){if(!Object(_.i)(a))return Object(M.a)(!a,"Tree/TreeNode can only accept TreeNode as children."),null;var c=a.key,C=a.props,x=C.children,h=Object(D.a)(C,["children"]),w=Object(B.a)({key:c},h),E=m(x);return E.length&&(w.children=E),w}).filter(function(a){return a})}return m(p)}function L(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(m===!0?[]:m),i=[];function a(c){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(x,h){var w=Object(_.h)(C?C.pos:"0",h),E=N(x.key,w),f=Object(B.a)(Object(B.a)({},x),{},{parent:C,pos:w,children:null,data:x,isStart:[].concat(Object(V.a)(C?C.isStart:[]),[h===0]),isEnd:[].concat(Object(V.a)(C?C.isEnd:[]),[h===c.length-1])});return i.push(f),m===!0||l.has(E)?f.children=a(x.children||[],f):f.children=[],f})}return a(p),i}function v(p,m,l){var i;l?typeof l=="string"?i=function(C){return C[l]}:typeof l=="function"&&(i=function(C){return l(C)}):i=function(C,x){return N(C.key,x)};function a(c,C,x){var h=c?c.children:p,w=c?Object(_.h)(x.pos,C):"0";if(c){var E=i(c,w),f={node:c,index:C,pos:w,key:E,parentPos:x.node?x.pos:null,level:x.level+1};m(f)}h&&h.forEach(function(d,s){a(d,s,{node:c,pos:w,level:x?x.level+1:-1})})}a(null)}function y(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=m.initWrapper,i=m.processEntity,a=m.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,C={},x={},h={posEntities:C,keyEntities:x};return l&&(h=l(h)||h),v(p,function(w){var E=w.node,f=w.index,d=w.pos,s=w.key,o=w.parentPos,T=w.level,b={node:E,index:f,key:s,pos:d,level:T},g=N(s,d);C[d]=b,x[g]=b,b.parent=C[o],b.parent&&(b.parent.children=b.parent.children||[],b.parent.children.push(b)),i&&i(b,h)},c),a&&a(h),h}function O(p,m){var l=m.expandedKeys,i=m.selectedKeys,a=m.loadedKeys,c=m.loadingKeys,C=m.checkedKeys,x=m.halfCheckedKeys,h=m.dragOverNodeKey,w=m.dropPosition,E=m.keyEntities,f=E[p],d={eventKey:p,expanded:l.indexOf(p)!==-1,selected:i.indexOf(p)!==-1,loaded:a.indexOf(p)!==-1,loading:c.indexOf(p)!==-1,checked:C.indexOf(p)!==-1,halfChecked:x.indexOf(p)!==-1,pos:String(f?f.pos:""),dragOver:h===p&&w===0,dragOverGapTop:h===p&&w===-1,dragOverGapBottom:h===p&&w===1};return d}function S(p){var m=p.data,l=p.expanded,i=p.selected,a=p.checked,c=p.loaded,C=p.loading,x=p.halfChecked,h=p.dragOver,w=p.dragOverGapTop,E=p.dragOverGapBottom,f=p.pos,d=p.active,s=Object(B.a)(Object(B.a)({},m),{},{expanded:l,selected:i,checked:a,loaded:c,loading:C,halfChecked:x,dragOver:h,dragOverGapTop:w,dragOverGapBottom:E,pos:f,active:d});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(M.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),p}}),s}},"8EBN":function(Ie,Ee,k){(function(V){V(k("VrN/"))})(function(V){"use strict";V.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var B=0;B<V.modeInfo.length;B++){var D=V.modeInfo[B];D.mimes&&(D.mime=D.mimes[0])}V.findModeByMIME=function(F){F=F.toLowerCase();for(var M=0;M<V.modeInfo.length;M++){var _=V.modeInfo[M];if(_.mime==F)return _;if(_.mimes){for(var N=0;N<_.mimes.length;N++)if(_.mimes[N]==F)return _}}if(/\+xml$/.test(F))return V.findModeByMIME("application/xml");if(/\+json$/.test(F))return V.findModeByMIME("application/json")},V.findModeByExtension=function(F){F=F.toLowerCase();for(var M=0;M<V.modeInfo.length;M++){var _=V.modeInfo[M];if(_.ext){for(var N=0;N<_.ext.length;N++)if(_.ext[N]==F)return _}}},V.findModeByFileName=function(F){for(var M=0;M<V.modeInfo.length;M++){var _=V.modeInfo[M];if(_.file&&_.file.test(F))return _}var N=F.lastIndexOf("."),I=N>-1&&F.substring(N+1,F.length);if(I)return V.findModeByExtension(I)},V.findModeByName=function(F){F=F.toLowerCase();for(var M=0;M<V.modeInfo.length;M++){var _=V.modeInfo[M];if(_.name.toLowerCase()==F)return _;if(_.alias){for(var N=0;N<_.alias.length;N++)if(_.alias[N].toLowerCase()==F)return _}}}})},"8hTe":function(Ie,Ee,k){Ie.exports={button:"button___1wy9m"}},"9Bee":function(Ie,Ee,k){"use strict";var V=k("DYRE"),B=k("zeV3"),D=k("+L6B"),F=k("2/Rp"),M=k("k1fw"),_=k("tJVT"),N=k("cDcd"),I=k.n(N),A=k("vg9a"),L=k("DlQD"),v=k.n(L),y=k("rUJ1");function O(fe,ve){var ge=fe.match(/^(\s+)(?:```)/);if(ge===null)return ve;var ae=ge[1];return ve.split(`
|
|
`).map(function(se){var Te=se.match(/^\s+/);if(Te===null)return se;var We=Object(_.a)(Te,1),Je=We[0];return Je.length>=ae.length?se.slice(ae.length):se}).join(`
|
|
`)}var S=[],p=["<ul>"],m=new v.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function i(){S.length=0,p=["<ul>"]}var a={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function c(fe,ve,ge,ae){if(ve>=fe.length||fe[ve].level<=ge)return ve;var se=fe[ve];ae.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),ve++;var Te=[];return ve=c(fe,ve,se.level,Te),Te.length>0&&(ae.push("<ul>"),Te.forEach(function(We){ae.push(We)}),ae.push("</ul>")),ae.push("</li>"),ve=c(fe,ve,ge,ae),ve}function C(){return c(S,0,0,p),p.push("</ul>"),p.join("")}var x={heading:function(ve){var ge=l.exec(ve);if(ge)return{type:"heading",raw:ge[0],depth:ge[1].length,text:ge[2]}},fences:function(ve){var ge=this.rules.block.fences.exec(ve);if(ge){var ae=ge[0],se=O(ae,ge[3]||""),Te=ge[2]?ge[2].trim():ge[2];if(["latex","katex","math"].indexOf(Te)>=0){var We=E(),Je=se;se=We,f[We]={type:"block",expression:Je}}return{type:"code",raw:ae,lang:Te,text:se}}}},h=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,E=function(){return"__special_katext_id_".concat(w++,"__")},f={};function d(){return f}function s(){w=0,f={}}function o(fe){return fe=fe.replace(h,function(ve,ge){var ae=E();return f[ae]={type:"inline",expression:ge},ae}),fe}var T=m.listitem;m.listitem=function(fe){return T(o(fe))};var b=m.paragraph;m.paragraph=function(fe){return b(o(fe))};var g=m.tablecell;m.tablecell=function(fe,ve){return g(o(fe),ve)},m.code=function(fe,ve,ge){var ae=(ve||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(fe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ve,'">').concat(ge?fe:Object(y.escape)(fe,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(ge?fe:Object(y.escape)(fe,!0))+"</code></pre>"},m.heading=function(fe,ve,ge){var ae=this.options.headerPrefix+ge.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return S.push({anchor:ae,level:ve,text:fe}),"<h"+ve+' id="'+ae+'">'+fe+"</h"+ve+">"},v.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),v.a.use({tokenizer:x,renderer:m});var P=v.a,j=k("SJMd"),H=k("ulZh"),X=k.n(H),W=k("m3rI"),U=k("Oy/b"),z=k("p5ED"),Z=k("8hTe"),q=k.n(Z),oe=/<pre[^>]*>/g;function ye(fe){var ve=document.createElement("div");return ve.innerHTML=fe,ve.childNodes.length===0?"":ve.childNodes[0].nodeValue}var me=Ee.a=function(fe){var ve=fe.value,ge=ve===void 0?"":ve,ae=fe.edit,se=ae===void 0?!1:ae,Te=fe.className,We=fe.showTextOnly,Je=fe.showLines,Ye=fe.replaces,Ze=fe.zoomImg,ze=fe.hasMask,Ke=fe.style,$e=Ke===void 0?{}:Ke,Qe=fe.stylesPrev,nt=Qe===void 0?{}:Qe,Xe=String(ge),He=Object(N.useRef)(),st=Object(N.useRef)(),ft=Object(N.useState)(""),ot=Object(_.a)(ft,2),ut=ot[0],gt=ot[1],ht=Object(N.useState)("office"),be=Object(_.a)(ht,2),pe=be[0],ke=be[1],Ne=Object(N.useMemo)(function(){try{var ne=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,$=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Q=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Xe=Xe.replace(ne,"("+W.a.API_SERVER+"/api/attachments/").replace($,'"'+W.a.API_SERVER+"/api/attachments/").replace(Q,'"'+W.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(Ce){}var te=P(Xe),ie=d();if(Xe.match(/\[TOC\]/)&&(te=te.replace("<p>[TOC]</p>",C()),i()),te=te.replace(/(__special_katext_id_\d+__)/g,function(Ce,Oe){var Fe=ie[Oe],tt=Fe.type,Ve=Fe.expression;return Object(U.renderToString)(ye(Ve)||"",{displayMode:tt==="block",throwOnError:!1,output:"html"})}),te=te.replace(/▁/g,"\u2581\u2581\u2581"),s(),We){var ue=document.createElement("div");return ue.innerHTML=te,ue.innerText}return setTimeout(function(){return de()},500),te},[Xe]),xe=Object(N.useRef)();a.WebkitLineClamp=Je,Je&&($e=Object(M.a)(Object(M.a)({},$e),a));function Re(ne){var $=ne.target;if($.tagName.toUpperCase()==="IMG"){if(Ze){var Q=$.getAttribute("src");gt(Q),ke("image")}}else if($.tagName.toUpperCase()==="A"){var te=$.getAttribute("href");if(te.indexOf("office")>-1)ne.preventDefault(),gt(te),ke("office");else if(te.indexOf("application/pdf")>-1)ne.preventDefault(),gt(te),ke("pdf");else if(te.indexOf("text/html")>-1)ne.preventDefault(),gt(te),ke("html");else if(te.startsWith("#")){ne.preventDefault();var ie=document.getElementById(te.replace("#",""));ie&&ie.scrollIntoView(!0)}}}var de=function(){var $,Q=($=xe.current)===null||$===void 0?void 0:$.querySelectorAll("video");Q==null||Q.forEach(function(te){if(te.oncontextmenu=function(){return!1},te.src.indexOf(".m3u8")>-1&&!te.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var ie=new X.a;ie.loadSource(te.src),ie.attachMedia(te)}}})};Object(N.useEffect)(function(){if(xe.current&&Ne&&(Ne.match(oe)&&window.PR.prettyPrint()),xe.current)return xe.current.addEventListener("click",Re),function(){xe.current.removeEventListener("click",Re),s(),i()}},[Ne,xe.current,Re]);var re=function($){if(!se)return;$.target.nodeName==="IMG"?(He.current.style.display="flex",He.current.style.width=$.target.clientWidth+"px",He.current.style.height=$.target.clientHeight+"px",He.current.style.top=$.target.offsetTop+"px",He.current.style.left=$.target.offsetLeft+"px",st.current.src=$.target.getAttribute("src")):He.current.style.display="none"};return I.a.createElement("div",{style:{position:"relative"}},I.a.createElement("div",{ref:xe,style:Object(M.a)({},$e),className:"".concat(Te||""," markdown-body ").concat(q.a.mdBody),onMouseOver:re,dangerouslySetInnerHTML:{__html:Ne}}),I.a.createElement("div",{ref:He,className:q.a.button},I.a.createElement(B.a,null,I.a.createElement(F.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),I.a.createElement(F.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),I.a.createElement("img",{ref:st,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),I.a.createElement(z.a,{close:!0,data:ut,type:ut!=null&&ut.length?pe:"",style:Object(M.a)({},nt),onClose:function(){return gt("")}}))}},"9VGf":function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return D});var V=k("cDcd"),B=k.n(V);function D(F,M){var _=Object(V.useRef)();Object(V.useEffect)(function(){_.current=F}),Object(V.useEffect)(function(){function N(){_.current()}if(M!==null){var I=setInterval(N,M);return function(){return clearInterval(I)}}},[M])}},AMnG:function(Ie,Ee,k){"use strict";var V=k("miYZ"),B=k("tsqr"),D=k("tJVT"),F=k("cDcd"),M=k.n(F),_=k("nWbc"),N=k.n(_),I=k("Ot1p");Ee.a=function(A){var L=A.id,v=A.activeDiscussIndex,y=A.onReplyDiscuss,O=Object(F.useState)(""),S=Object(D.a)(O,2),p=S[0],m=S[1];function l(a){m(a)}function i(){if(!p){B.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}y(L,p),m("")}return M.a.createElement("div",{key:L,className:"discuss-item-editor",style:{display:v===L?"block":"none",width:"100%"}},M.a.createElement(I.a,{miniToolbar:!0,startInit:v===L,defaultValue:p,id:L,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:l}),M.a.createElement("a",{onClick:i,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return _});var V=k("MNnm"),B="rc-util-key";function D(N){if(N.attachTo)return N.attachTo;var I=document.querySelector("head");return I||document.body}function F(N){var I,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(V.a)())return null;var L=document.createElement("style");if((I=A.csp)===null||I===void 0?void 0:I.nonce){var v;L.nonce=(v=A.csp)===null||v===void 0?void 0:v.nonce}L.innerHTML=N;var y=D(A),O=y.firstChild;return A.prepend&&y.prepend?y.prepend(L):A.prepend&&O?y.insertBefore(L,O):y.appendChild(L),L}var M=new Map;function _(N,I){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=D(A);if(!M.has(L)){var v=F("",A),y=v.parentNode;M.set(L,y),y.removeChild(v)}var O=Array.from(M.get(L).children).find(function(i){return i.tagName==="STYLE"&&i[B]===I});if(O){var S,p;if(((S=A.csp)===null||S===void 0?void 0:S.nonce)&&O.nonce!==((p=A.csp)===null||p===void 0?void 0:p.nonce)){var m;O.nonce=(m=A.csp)===null||m===void 0?void 0:m.nonce}return O.innerHTML!==N&&(O.innerHTML=N),O}var l=F(N,A);return l[B]=I,l}},Bd2K:function(Ie,Ee,k){(function(V){V(k("VrN/"),k("osHv"))})(function(V){V.defineOption("autoCloseTags",!1,function(A,L,v){if(v!=V.Init&&v&&A.removeKeyMap("autoCloseTags"),!L)return;var y={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(y["'/'"]=function(O){return _(O)}),(typeof L!="object"||L.whenOpening!==!1)&&(y["'>'"]=function(O){return F(O)}),A.addKeyMap(y)});var B=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function F(A){if(A.getOption("disableInput"))return V.Pass;for(var L=A.listSelections(),v=[],y=A.getOption("autoCloseTags"),O=0;O<L.length;O++){if(!L[O].empty())return V.Pass;var S=L[O].head,p=A.getTokenAt(S),m=V.innerMode(A.getMode(),p.state),l=m.state,i=m.mode.xmlCurrentTag&&m.mode.xmlCurrentTag(l),a=i&&i.name;if(!a)return V.Pass;var c=m.mode.configuration=="html",C=typeof y=="object"&&y.dontCloseTags||c&&B,x=typeof y=="object"&&y.indentTags||c&&D;p.end>S.ch&&(a=a.slice(0,a.length-p.end+S.ch));var h=a.toLowerCase();if(!a||p.type=="string"&&(p.end!=S.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||p.string.length==1)||p.type=="tag"&&i.close||p.string.indexOf("/")==S.ch-p.start-1||C&&N(C,h)>-1||I(A,m.mode.xmlCurrentContext&&m.mode.xmlCurrentContext(l)||[],a,S,!0))return V.Pass;var w=typeof y=="object"&&y.emptyTags;if(w&&N(w,a)>-1){v[O]={text:"/>",newPos:V.Pos(S.line,S.ch+2)};continue}var E=x&&N(x,h)>-1;v[O]={indent:E,text:">"+(E?`
|
|
|
|
`:"")+"</"+a+">",newPos:E?V.Pos(S.line+1,0):V.Pos(S.line,S.ch+1)}}for(var f=typeof y=="object"&&y.dontIndentOnAutoClose,O=L.length-1;O>=0;O--){var d=v[O];A.replaceRange(d.text,L[O].head,L[O].anchor,"+insert");var s=A.listSelections().slice(0);s[O]={head:d.newPos,anchor:d.newPos},A.setSelections(s),!f&&d.indent&&(A.indentLine(d.newPos.line,null,!0),A.indentLine(d.newPos.line+1,null,!0))}}function M(A,L){for(var v=A.listSelections(),y=[],O=L?"/":"</",S=A.getOption("autoCloseTags"),p=typeof S=="object"&&S.dontIndentOnSlash,m=0;m<v.length;m++){if(!v[m].empty())return V.Pass;var l=v[m].head,i=A.getTokenAt(l),a=V.innerMode(A.getMode(),i.state),c=a.state;if(L&&(i.type=="string"||i.string.charAt(0)!="<"||i.start!=l.ch-1))return V.Pass;var C,x=a.mode.name!="xml"&&A.getMode().name=="htmlmixed";if(x&&a.mode.name=="javascript")C=O+"script";else if(x&&a.mode.name=="css")C=O+"style";else{var h=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(c);if(!h||h.length&&I(A,h,h[h.length-1],l))return V.Pass;C=O+h[h.length-1]}A.getLine(l.line).charAt(i.end)!=">"&&(C+=">"),y[m]=C}if(A.replaceSelections(y),v=A.listSelections(),!p)for(var m=0;m<v.length;m++)(m==v.length-1||v[m].head.line<v[m+1].head.line)&&A.indentLine(v[m].head.line)}function _(A){return A.getOption("disableInput")?V.Pass:M(A,!0)}V.commands.closeTag=function(A){return M(A)};function N(A,L){if(A.indexOf)return A.indexOf(L);for(var v=0,y=A.length;v<y;++v)if(A[v]==L)return v;return-1}function I(A,L,v,y,O){if(!V.scanForClosingTag)return!1;var S=Math.min(A.lastLine()+1,y.line+500),p=V.scanForClosingTag(A,y,null,S);if(!p||p.tag!=v)return!1;for(var m=O?1:0,l=L.length-1;l>=0&&L[l]==v;l--)++m;y=p.to;for(var l=1;l<m;l++){var i=V.scanForClosingTag(A,y,null,S);if(!i||i.tag!=v)return!1;y=i.to}return!0}})},BdwD:function(Ie,Ee,k){"use strict";var V=k("+L6B"),B=k("2/Rp"),D=k("0Owb"),F=k("k1fw"),M=k("cDcd"),_=k.n(M),N=k("FOrL"),I=k.n(N),A=function(v){var y=v.buttonProps,O=y===void 0?{}:y,S=v.styles,p=S===void 0?{}:S,m=v.customText,l=v.ButtonText,i=v.ButtonClick,a=v.Buttonclass,c=v.ButtonTwo;return _.a.createElement("section",{className:"tc animated fadeIn",style:Object(F.a)(Object(F.a)({},{color:"#999",margin:"200px auto"}),p)},_.a.createElement("img",{src:I.a}),_.a.createElement("p",{className:"mt20 font14"},m||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&_.a.createElement(B.a,Object(D.a)({className:a,onClick:i},O),l),c&&c)};Ee.a=A},BjJ7:function(Ie,Ee,k){"use strict";k.d(Ee,"d",function(){return B}),k.d(Ee,"c",function(){return D}),k.d(Ee,"e",function(){return F}),k.d(Ee,"b",function(){return M}),k.d(Ee,"a",function(){return N});var V=k("m3rI");function B(I){var A=!0;if(I.length>0){for(var L=0;L<I.length;L++)if(I[L].compile_success==0||!I[L].compile_success){A=!1;break}}else A=!1;return A}function D(I){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],v=0;v<I.length;v++){var y=I[v],O=A?"".concat(A,"/").concat(y.name):"".concat(y.name);L.push({title:y.name,isLeaf:!(y.type==="tree"),key:O})}return L}function F(I,A,L){for(var v=0;v<I.length;v++){var y=I[v];if(y.key===A){y.children=L;break}y.children&&F(y.children,A,L)}return I}function M(I,A,L){var v;return function(){var y=this,O=arguments,S=function(){v=null,L||I.apply(y,O)},p=L&&!v;clearTimeout(v),v=setTimeout(S,A),p&&I.apply(y,O)}}var _=!0,N=V.a.API_SERVER},"C+DQ":function(Ie,Ee,k){},CrYA:function(Ie,Ee,k){var V=k("MFOe"),B=V.Global;Ie.exports={name:"sessionStorage",read:F,write:M,each:_,remove:N,clearAll:I};function D(){return B.sessionStorage}function F(A){return D().getItem(A)}function M(A,L){return D().setItem(A,L)}function _(A){for(var L=D().length-1;L>=0;L--){var v=D().key(L);A(F(v),v)}}function N(A){return D().removeItem(A)}function I(){return D().clear()}},DlQD:function(Ie,Ee,k){(function(V,B){Ie.exports=B()})(this,function(){"use strict";function V(de,re){for(var ne=0;ne<re.length;ne++){var $=re[ne];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(de,$.key,$)}}function B(de,re,ne){return re&&V(de.prototype,re),ne&&V(de,ne),de}function D(de,re){if(!de)return;if(typeof de=="string")return F(de,re);var ne=Object.prototype.toString.call(de).slice(8,-1);if(ne==="Object"&&de.constructor&&(ne=de.constructor.name),ne==="Map"||ne==="Set")return Array.from(de);if(ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne))return F(de,re)}function F(de,re){(re==null||re>de.length)&&(re=de.length);for(var ne=0,$=new Array(re);ne<re;ne++)$[ne]=de[ne];return $}function M(de,re){var ne;if(typeof Symbol=="undefined"||de[Symbol.iterator]==null){if(Array.isArray(de)||(ne=D(de))||re&&de&&typeof de.length=="number"){ne&&(de=ne);var $=0;return function(){return $>=de.length?{done:!0}:{done:!1,value:de[$++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ne=de[Symbol.iterator](),ne.next.bind(ne)}function _(de,re){return re={exports:{}},de(re,re.exports),re.exports}var N=_(function(de){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 ne($){de.exports.defaults=$}de.exports={defaults:re(),getDefaults:re,changeDefaults:ne}}),I=N.defaults,A=N.getDefaults,L=N.changeDefaults,v=/[&<>"']/,y=/[&<>"']/g,O=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"},m=function(re){return p[re]};function l(de,re){if(re){if(v.test(de))return de.replace(y,m)}else if(O.test(de))return de.replace(S,m);return de}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(de){return de.replace(i,function(re,ne){return ne=ne.toLowerCase(),ne==="colon"?":":ne.charAt(0)==="#"?ne.charAt(1)==="x"?String.fromCharCode(parseInt(ne.substring(2),16)):String.fromCharCode(+ne.substring(1)):""})}var c=/(^|[^\[])\^/g;function C(de,re){de=de.source||de,re=re||"";var ne={replace:function(Q,te){return te=te.source||te,te=te.replace(c,"$1"),de=de.replace(Q,te),ne},getRegex:function(){return new RegExp(de,re)}};return ne}var x=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(de,re,ne){if(de){var $;try{$=decodeURIComponent(a(ne)).replace(x,"").toLowerCase()}catch(Q){return null}if($.indexOf("javascript:")===0||$.indexOf("vbscript:")===0||$.indexOf("data:")===0)return null}re&&!h.test(ne)&&(ne=o(re,ne));try{ne=encodeURI(ne).replace(/%25/g,"%")}catch(Q){return null}return ne}var E={},f=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(de,re){E[" "+de]||(f.test(de)?E[" "+de]=de+"/":E[" "+de]=P(de,"/",!0)),de=E[" "+de];var ne=de.indexOf(":")===-1;return re.substring(0,2)==="//"?ne?re:de.replace(d,"$1")+re:re.charAt(0)==="/"?ne?re:de.replace(s,"$1")+re:de+re}var T={exec:function(){}};function b(de){for(var re=1,ne,$;re<arguments.length;re++){ne=arguments[re];for($ in ne)Object.prototype.hasOwnProperty.call(ne,$)&&(de[$]=ne[$])}return de}function g(de,re){var ne=de.replace(/\|/g,function(te,ie,ue){for(var Ce=!1,Oe=ie;--Oe>=0&&ue[Oe]==="\\";)Ce=!Ce;return Ce?"|":" |"}),$=ne.split(/ \|/),Q=0;if($.length>re)$.splice(re);else for(;$.length<re;)$.push("");for(;Q<$.length;Q++)$[Q]=$[Q].trim().replace(/\\\|/g,"|");return $}function P(de,re,ne){var $=de.length;if($===0)return"";for(var Q=0;Q<$;){var te=de.charAt($-Q-1);if(te===re&&!ne)Q++;else if(te!==re&&ne)Q++;else break}return de.substr(0,$-Q)}function j(de,re){if(de.indexOf(re[1])===-1)return-1;for(var ne=de.length,$=0,Q=0;Q<ne;Q++)if(de[Q]==="\\")Q++;else if(de[Q]===re[0])$++;else if(de[Q]===re[1]&&($--,$<0))return Q;return-1}function H(de){de&&de.sanitize&&!de.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")}var X={escape:l,unescape:a,edit:C,cleanUrl:w,resolveUrl:o,noopTest:T,merge:b,splitCells:g,rtrim:P,findClosingBracket:j,checkSanitizeDeprecation:H},W=N.defaults,U=X.rtrim,z=X.splitCells,Z=X.escape,q=X.findClosingBracket;function oe(de,re,ne){var $=re.href,Q=re.title?Z(re.title):null,te=de[1].replace(/\\([\[\]])/g,"$1");return de[0].charAt(0)!=="!"?{type:"link",raw:ne,href:$,title:Q,text:te}:{type:"image",raw:ne,href:$,title:Q,text:Z(te)}}function ye(de,re){var ne=de.match(/^(\s+)(?:```)/);if(ne===null)return re;var $=ne[1];return re.split(`
|
|
`).map(function(Q){var te=Q.match(/^\s+/);if(te===null)return Q;var ie=te[0];return ie.length>=$.length?Q.slice($.length):Q}).join(`
|
|
`)}var me=function(){function de(ne){this.options=ne||W}var re=de.prototype;return re.space=function($){var Q=this.rules.block.newline.exec($);if(Q)return Q[0].length>1?{type:"space",raw:Q[0]}:{raw:`
|
|
`}},re.code=function($,Q){var te=this.rules.block.code.exec($);if(te){var ie=Q[Q.length-1];if(ie&&ie.type==="paragraph")return{raw:te[0],text:te[0].trimRight()};var ue=te[0].replace(/^ {4}/gm,"");return{type:"code",raw:te[0],codeBlockStyle:"indented",text:this.options.pedantic?ue:U(ue,`
|
|
`)}}},re.fences=function($){var Q=this.rules.block.fences.exec($);if(Q){var te=Q[0],ie=ye(te,Q[3]||"");return{type:"code",raw:te,lang:Q[2]?Q[2].trim():Q[2],text:ie}}},re.heading=function($){var Q=this.rules.block.heading.exec($);if(Q)return{type:"heading",raw:Q[0],depth:Q[1].length,text:Q[2]}},re.nptable=function($){var Q=this.rules.block.nptable.exec($);if(Q){var te={type:"table",header:z(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Q[0]};if(te.header.length===te.align.length){var ie=te.align.length,ue;for(ue=0;ue<ie;ue++)/^ *-+: *$/.test(te.align[ue])?te.align[ue]="right":/^ *:-+: *$/.test(te.align[ue])?te.align[ue]="center":/^ *:-+ *$/.test(te.align[ue])?te.align[ue]="left":te.align[ue]=null;for(ie=te.cells.length,ue=0;ue<ie;ue++)te.cells[ue]=z(te.cells[ue],te.header.length);return te}}},re.hr=function($){var Q=this.rules.block.hr.exec($);if(Q)return{type:"hr",raw:Q[0]}},re.blockquote=function($){var Q=this.rules.block.blockquote.exec($);if(Q){var te=Q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Q[0],text:te}}},re.list=function($){var Q=this.rules.block.list.exec($);if(Q){for(var te=Q[0],ie=Q[2],ue=ie.length>1,Ce=ie[ie.length-1]===")",Oe={type:"list",raw:te,ordered:ue,start:ue?+ie.slice(0,-1):"",loose:!1,items:[]},Fe=Q[0].match(this.rules.block.item),tt=!1,Ve,qe,Le,Ue,we,ee,ce,je=Fe.length,De=0;De<je;De++)Ve=Fe[De],te=Ve,qe=Ve.length,Ve=Ve.replace(/^ *([*+-]|\d+[.)]) */,""),~Ve.indexOf(`
|
|
`)&&(qe-=Ve.length,Ve=this.options.pedantic?Ve.replace(/^ {1,4}/gm,""):Ve.replace(new RegExp("^ {1,"+qe+"}","gm"),"")),De!==je-1&&(Le=this.rules.block.bullet.exec(Fe[De+1])[0],(ue?Le.length===1||!Ce&&Le[Le.length-1]===")":Le.length>1||this.options.smartLists&&Le!==ie)&&(Ue=Fe.slice(De+1).join(`
|
|
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-Ue.length),De=je-1)),we=tt||/\n\n(?!\s*$)/.test(Ve),De!==je-1&&(tt=Ve.charAt(Ve.length-1)===`
|
|
`,we||(we=tt)),we&&(Oe.loose=!0),ee=/^\[[ xX]\] /.test(Ve),ce=void 0,ee&&(ce=Ve[1]!==" ",Ve=Ve.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:te,task:ee,checked:ce,loose:we,text:Ve});return Oe}},re.html=function($){var Q=this.rules.block.html.exec($);if(Q)return{type:this.options.sanitize?"paragraph":"html",raw:Q[0],pre:!this.options.sanitizer&&(Q[1]==="pre"||Q[1]==="script"||Q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):Z(Q[0]):Q[0]}},re.def=function($){var Q=this.rules.block.def.exec($);if(Q){Q[3]&&(Q[3]=Q[3].substring(1,Q[3].length-1));var te=Q[1].toLowerCase().replace(/\s+/g," ");return{tag:te,raw:Q[0],href:Q[2],title:Q[3]}}},re.table=function($){var Q=this.rules.block.table.exec($);if(Q){var te={type:"table",header:z(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
|
|
`):[]};if(te.header.length===te.align.length){te.raw=Q[0];var ie=te.align.length,ue;for(ue=0;ue<ie;ue++)/^ *-+: *$/.test(te.align[ue])?te.align[ue]="right":/^ *:-+: *$/.test(te.align[ue])?te.align[ue]="center":/^ *:-+ *$/.test(te.align[ue])?te.align[ue]="left":te.align[ue]=null;for(ie=te.cells.length,ue=0;ue<ie;ue++)te.cells[ue]=z(te.cells[ue].replace(/^ *\| *| *\| *$/g,""),te.header.length);return te}}},re.lheading=function($){var Q=this.rules.block.lheading.exec($);if(Q)return{type:"heading",raw:Q[0],depth:Q[2].charAt(0)==="="?1:2,text:Q[1]}},re.paragraph=function($){var Q=this.rules.block.paragraph.exec($);if(Q)return{type:"paragraph",raw:Q[0],text:Q[1].charAt(Q[1].length-1)===`
|
|
`?Q[1].slice(0,-1):Q[1]}},re.text=function($,Q){var te=this.rules.block.text.exec($);if(te){var ie=Q[Q.length-1];return ie&&ie.type==="text"?{raw:te[0],text:te[0]}:{type:"text",raw:te[0],text:te[0]}}},re.escape=function($){var Q=this.rules.inline.escape.exec($);if(Q)return{type:"escape",raw:Q[0],text:Z(Q[1])}},re.tag=function($,Q,te){var ie=this.rules.inline.tag.exec($);if(ie)return!Q&&/^<a /i.test(ie[0])?Q=!0:Q&&/^<\/a>/i.test(ie[0])&&(Q=!1),!te&&/^<(pre|code|kbd|script)(\s|>)/i.test(ie[0])?te=!0:te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ie[0])&&(te=!1),{type:this.options.sanitize?"text":"html",raw:ie[0],inLink:Q,inRawBlock:te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):Z(ie[0]):ie[0]}},re.link=function($){var Q=this.rules.inline.link.exec($);if(Q){var te=q(Q[2],"()");if(te>-1){var ie=Q[0].indexOf("!")===0?5:4,ue=ie+Q[1].length+te;Q[2]=Q[2].substring(0,te),Q[0]=Q[0].substring(0,ue).trim(),Q[3]=""}var Ce=Q[2],Oe="";if(this.options.pedantic){var Fe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);Fe?(Ce=Fe[1],Oe=Fe[3]):Oe=""}else Oe=Q[3]?Q[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var tt=oe(Q,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},Q[0]);return tt}},re.reflink=function($,Q){var te;if((te=this.rules.inline.reflink.exec($))||(te=this.rules.inline.nolink.exec($))){var ie=(te[2]||te[1]).replace(/\s+/g," ");if(ie=Q[ie.toLowerCase()],!ie||!ie.href){var ue=te[0].charAt(0);return{type:"text",raw:ue,text:ue}}var Ce=oe(te,ie,te[0]);return Ce}},re.strong=function($,Q,te){te===void 0&&(te="");var ie=this.rules.inline.strong.start.exec($);if(ie&&(!ie[1]||ie[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){Q=Q.slice(-1*$.length);var ue=ie[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ue.lastIndex=0;for(var Ce;(ie=ue.exec(Q))!=null;)if(Ce=this.rules.inline.strong.middle.exec(Q.slice(0,ie.index+3)),Ce)return{type:"strong",raw:$.slice(0,Ce[0].length),text:$.slice(2,Ce[0].length-2)}}},re.em=function($,Q,te){te===void 0&&(te="");var ie=this.rules.inline.em.start.exec($);if(ie&&(!ie[1]||ie[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){Q=Q.slice(-1*$.length);var ue=ie[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ue.lastIndex=0;for(var Ce;(ie=ue.exec(Q))!=null;)if(Ce=this.rules.inline.em.middle.exec(Q.slice(0,ie.index+2)),Ce)return{type:"em",raw:$.slice(0,Ce[0].length),text:$.slice(1,Ce[0].length-1)}}},re.codespan=function($){var Q=this.rules.inline.code.exec($);if(Q){var te=Q[2].replace(/\n/g," "),ie=/[^ ]/.test(te),ue=te.startsWith(" ")&&te.endsWith(" ");return ie&&ue&&(te=te.substring(1,te.length-1)),te=Z(te,!0),{type:"codespan",raw:Q[0],text:te}}},re.br=function($){var Q=this.rules.inline.br.exec($);if(Q)return{type:"br",raw:Q[0]}},re.del=function($){var Q=this.rules.inline.del.exec($);if(Q)return{type:"del",raw:Q[0],text:Q[1]}},re.autolink=function($,Q){var te=this.rules.inline.autolink.exec($);if(te){var ie,ue;return te[2]==="@"?(ie=Z(this.options.mangle?Q(te[1]):te[1]),ue="mailto:"+ie):(ie=Z(te[1]),ue=ie),{type:"link",raw:te[0],text:ie,href:ue,tokens:[{type:"text",raw:ie,text:ie}]}}},re.url=function($,Q){var te;if(te=this.rules.inline.url.exec($)){var ie,ue;if(te[2]==="@")ie=Z(this.options.mangle?Q(te[0]):te[0]),ue="mailto:"+ie;else{var Ce;do Ce=te[0],te[0]=this.rules.inline._backpedal.exec(te[0])[0];while(Ce!==te[0]);ie=Z(te[0]),te[1]==="www."?ue="http://"+ie:ue=ie}return{type:"link",raw:te[0],text:ie,href:ue,tokens:[{type:"text",raw:ie,text:ie}]}}},re.inlineText=function($,Q,te){var ie=this.rules.inline.text.exec($);if(ie){var ue;return Q?ue=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):Z(ie[0]):ie[0]:ue=Z(this.options.smartypants?te(ie[0]):ie[0]),{type:"text",raw:ie[0],text:ue}}},de}(),fe=X.noopTest,ve=X.edit,ge=X.merge,ae={newline:/^\n+/,code:/^( {4}[^\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}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\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{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:fe,table:fe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ae.def=ve(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex(),ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ae.item=ve(ae.item,"gm").replace(/bull/g,ae.bullet).getRegex(),ae.list=ve(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex(),ae._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",ae._comment=/<!--(?!-?>)[\s\S]*?-->/,ae.html=ve(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae.paragraph=ve(ae._paragraph).replace("hr",ae.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",ae._tag).getRegex(),ae.blockquote=ve(ae.blockquote).replace("paragraph",ae.paragraph).getRegex(),ae.normal=ge({},ae),ae.gfm=ge({},ae.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ae.gfm.nptable=ve(ae.gfm.nptable).replace("hr",ae.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",ae._tag).getRegex(),ae.gfm.table=ve(ae.gfm.table).replace("hr",ae.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",ae._tag).getRegex(),ae.pedantic=ge({},ae.normal,{html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._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]+?) *(?:#+ *)?(?:\n+|$)/,fences:fe,paragraph:ve(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fe,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(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:fe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=ve(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=ve(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=ve(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=ve(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=ve(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=ve(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=ve(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=ve(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=ve(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=ve(se._blockSkip,"g").getRegex(),se.overlapSkip=ve(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=ve(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=ve(se.tag).replace("comment",ae._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=ve(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=ve(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=ve(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=ge({},se),se.pedantic=ge({},se.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:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=ge({},se.normal,{escape:ve(se.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)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),se.gfm.url=ve(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex(),se.breaks=ge({},se.gfm,{br:ve(se.br).replace("{2,}","*").getRegex(),text:ve(se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Te={block:ae,inline:se},We=N.defaults,Je=Te.block,Ye=Te.inline;function Ze(de){return de.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 ze(de){var re="",ne,$,Q=de.length;for(ne=0;ne<Q;ne++)$=de.charCodeAt(ne),Math.random()>.5&&($="x"+$.toString(16)),re+="&#"+$+";";return re}var Ke=function(){function de(ne){this.tokens=[],this.tokens.links=Object.create(null),this.options=ne||We,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var $={block:Je.normal,inline:Ye.normal};this.options.pedantic?($.block=Je.pedantic,$.inline=Ye.pedantic):this.options.gfm&&($.block=Je.gfm,this.options.breaks?$.inline=Ye.breaks:$.inline=Ye.gfm),this.tokenizer.rules=$}de.lex=function($,Q){var te=new de(Q);return te.lex($)};var re=de.prototype;return re.lex=function($){return $=$.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens($,this.tokens,!0),this.inline(this.tokens),this.tokens},re.blockTokens=function($,Q,te){Q===void 0&&(Q=[]),te===void 0&&(te=!0),$=$.replace(/^ +$/gm,"");for(var ie,ue,Ce,Oe;$;){if(ie=this.tokenizer.space($)){$=$.substring(ie.raw.length),ie.type&&Q.push(ie);continue}if(ie=this.tokenizer.code($,Q)){$=$.substring(ie.raw.length),ie.type?Q.push(ie):(Oe=Q[Q.length-1],Oe.raw+=`
|
|
`+ie.raw,Oe.text+=`
|
|
`+ie.text);continue}if(ie=this.tokenizer.fences($)){$=$.substring(ie.raw.length),Q.push(ie);continue}if(ie=this.tokenizer.heading($)){$=$.substring(ie.raw.length),Q.push(ie);continue}if(ie=this.tokenizer.nptable($)){$=$.substring(ie.raw.length),Q.push(ie);continue}if(ie=this.tokenizer.hr($)){$=$.substring(ie.raw.length),Q.push(ie);continue}if(ie=this.tokenizer.blockquote($)){$=$.substring(ie.raw.length),ie.tokens=this.blockTokens(ie.text,[],te),Q.push(ie);continue}if(ie=this.tokenizer.list($)){for($=$.substring(ie.raw.length),Ce=ie.items.length,ue=0;ue<Ce;ue++)ie.items[ue].tokens=this.blockTokens(ie.items[ue].text,[],!1);Q.push(ie);continue}if(ie=this.tokenizer.html($)){$=$.substring(ie.raw.length),Q.push(ie);continue}if(te&&(ie=this.tokenizer.def($))){$=$.substring(ie.raw.length),this.tokens.links[ie.tag]||(this.tokens.links[ie.tag]={href:ie.href,title:ie.title});continue}if(ie=this.tokenizer.table($)){$=$.substring(ie.raw.length),Q.push(ie);continue}if(ie=this.tokenizer.lheading($)){$=$.substring(ie.raw.length),Q.push(ie);continue}if(te&&(ie=this.tokenizer.paragraph($))){$=$.substring(ie.raw.length),Q.push(ie);continue}if(ie=this.tokenizer.text($,Q)){$=$.substring(ie.raw.length),ie.type?Q.push(ie):(Oe=Q[Q.length-1],Oe.raw+=`
|
|
`+ie.raw,Oe.text+=`
|
|
`+ie.text);continue}if($){var Fe="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(Fe);break}else throw new Error(Fe)}}return Q},re.inline=function($){var Q,te,ie,ue,Ce,Oe,Fe=$.length;for(Q=0;Q<Fe;Q++){Oe=$[Q];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},ue=Oe.header.length,te=0;te<ue;te++)Oe.tokens.header[te]=[],this.inlineTokens(Oe.header[te],Oe.tokens.header[te]);for(ue=Oe.cells.length,te=0;te<ue;te++)for(Ce=Oe.cells[te],Oe.tokens.cells[te]=[],ie=0;ie<Ce.length;ie++)Oe.tokens.cells[te][ie]=[],this.inlineTokens(Ce[ie],Oe.tokens.cells[te][ie]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(ue=Oe.items.length,te=0;te<ue;te++)this.inline(Oe.items[te].tokens);break}}}return $},re.inlineTokens=function($,Q,te,ie,ue){Q===void 0&&(Q=[]),te===void 0&&(te=!1),ie===void 0&&(ie=!1),ue===void 0&&(ue="");var Ce,Oe=$,Fe;if(this.tokens.links){var tt=Object.keys(this.tokens.links);if(tt.length>0)for(;(Fe=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)tt.includes(Fe[0].slice(Fe[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,Fe.index)+"["+"a".repeat(Fe[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Fe=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,Fe.index)+"["+"a".repeat(Fe[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;$;){if(Ce=this.tokenizer.escape($)){$=$.substring(Ce.raw.length),Q.push(Ce);continue}if(Ce=this.tokenizer.tag($,te,ie)){$=$.substring(Ce.raw.length),te=Ce.inLink,ie=Ce.inRawBlock,Q.push(Ce);continue}if(Ce=this.tokenizer.link($)){$=$.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,ie)),Q.push(Ce);continue}if(Ce=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,ie)),Q.push(Ce);continue}if(Ce=this.tokenizer.strong($,Oe,ue)){$=$.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],te,ie),Q.push(Ce);continue}if(Ce=this.tokenizer.em($,Oe,ue)){$=$.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],te,ie),Q.push(Ce);continue}if(Ce=this.tokenizer.codespan($)){$=$.substring(Ce.raw.length),Q.push(Ce);continue}if(Ce=this.tokenizer.br($)){$=$.substring(Ce.raw.length),Q.push(Ce);continue}if(Ce=this.tokenizer.del($)){$=$.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],te,ie),Q.push(Ce);continue}if(Ce=this.tokenizer.autolink($,ze)){$=$.substring(Ce.raw.length),Q.push(Ce);continue}if(!te&&(Ce=this.tokenizer.url($,ze))){$=$.substring(Ce.raw.length),Q.push(Ce);continue}if(Ce=this.tokenizer.inlineText($,ie,Ze)){$=$.substring(Ce.raw.length),ue=Ce.raw.slice(-1),Q.push(Ce);continue}if($){var Ve="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(Ve);break}else throw new Error(Ve)}}return Q},B(de,null,[{key:"rules",get:function(){return{block:Je,inline:Ye}}}]),de}(),$e=N.defaults,Qe=X.cleanUrl,nt=X.escape,Xe=function(){function de(ne){this.options=ne||$e}var re=de.prototype;return re.code=function($,Q,te){var ie=(Q||"").match(/\S*/)[0];if(this.options.highlight){var ue=this.options.highlight($,ie);ue!=null&&ue!==$&&(te=!0,$=ue)}return ie?'<pre><code class="'+this.options.langPrefix+nt(ie,!0)+'">'+(te?$:nt($,!0))+`</code></pre>
|
|
`:"<pre><code>"+(te?$:nt($,!0))+`</code></pre>
|
|
`},re.blockquote=function($){return`<blockquote>
|
|
`+$+`</blockquote>
|
|
`},re.html=function($){return $},re.heading=function($,Q,te,ie){return this.options.headerIds?"<h"+Q+' id="'+this.options.headerPrefix+ie.slug(te)+'">'+$+"</h"+Q+`>
|
|
`:"<h"+Q+">"+$+"</h"+Q+`>
|
|
`},re.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},re.list=function($,Q,te){var ie=Q?"ol":"ul",ue=Q&&te!==1?' start="'+te+'"':"";return"<"+ie+ue+`>
|
|
`+$+"</"+ie+`>
|
|
`},re.listitem=function($){return"<li>"+$+`</li>
|
|
`},re.checkbox=function($){return"<input "+($?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},re.paragraph=function($){return"<p>"+$+`</p>
|
|
`},re.table=function($,Q){return Q&&(Q="<tbody>"+Q+"</tbody>"),`<table>
|
|
<thead>
|
|
`+$+`</thead>
|
|
`+Q+`</table>
|
|
`},re.tablerow=function($){return`<tr>
|
|
`+$+`</tr>
|
|
`},re.tablecell=function($,Q){var te=Q.header?"th":"td",ie=Q.align?"<"+te+' align="'+Q.align+'">':"<"+te+">";return ie+$+"</"+te+`>
|
|
`},re.strong=function($){return"<strong>"+$+"</strong>"},re.em=function($){return"<em>"+$+"</em>"},re.codespan=function($){return"<code>"+$+"</code>"},re.br=function(){return this.options.xhtml?"<br/>":"<br>"},re.del=function($){return"<del>"+$+"</del>"},re.link=function($,Q,te){if($=Qe(this.options.sanitize,this.options.baseUrl,$),$===null)return te;var ie='<a href="'+nt($)+'"';return Q&&(ie+=' title="'+Q+'"'),ie+=">"+te+"</a>",ie},re.image=function($,Q,te){if($=Qe(this.options.sanitize,this.options.baseUrl,$),$===null)return te;var ie='<img src="'+$+'" alt="'+te+'"';return Q&&(ie+=' title="'+Q+'"'),ie+=this.options.xhtml?"/>":">",ie},re.text=function($){return $},de}(),He=function(){function de(){}var re=de.prototype;return re.strong=function($){return $},re.em=function($){return $},re.codespan=function($){return $},re.del=function($){return $},re.html=function($){return $},re.text=function($){return $},re.link=function($,Q,te){return""+te},re.image=function($,Q,te){return""+te},re.br=function(){return""},de}(),st=function(){function de(){this.seen={}}var re=de.prototype;return re.slug=function($){var Q=$.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Q)){var te=Q;do this.seen[te]++,Q=te+"-"+this.seen[te];while(this.seen.hasOwnProperty(Q))}return this.seen[Q]=0,Q},de}(),ft=N.defaults,ot=X.unescape,ut=function(){function de(ne){this.options=ne||ft,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He,this.slugger=new st}de.parse=function($,Q){var te=new de(Q);return te.parse($)};var re=de.prototype;return re.parse=function($,Q){Q===void 0&&(Q=!0);var te="",ie,ue,Ce,Oe,Fe,tt,Ve,qe,Le,Ue,we,ee,ce,je,De,at,it,Pe,Be=$.length;for(ie=0;ie<Be;ie++){Ue=$[ie];switch(Ue.type){case"space":continue;case"hr":{te+=this.renderer.hr();continue}case"heading":{te+=this.renderer.heading(this.parseInline(Ue.tokens),Ue.depth,ot(this.parseInline(Ue.tokens,this.textRenderer)),this.slugger);continue}case"code":{te+=this.renderer.code(Ue.text,Ue.lang,Ue.escaped);continue}case"table":{for(qe="",Ve="",Oe=Ue.header.length,ue=0;ue<Oe;ue++)Ve+=this.renderer.tablecell(this.parseInline(Ue.tokens.header[ue]),{header:!0,align:Ue.align[ue]});for(qe+=this.renderer.tablerow(Ve),Le="",Oe=Ue.cells.length,ue=0;ue<Oe;ue++){for(tt=Ue.tokens.cells[ue],Ve="",Fe=tt.length,Ce=0;Ce<Fe;Ce++)Ve+=this.renderer.tablecell(this.parseInline(tt[Ce]),{header:!1,align:Ue.align[Ce]});Le+=this.renderer.tablerow(Ve)}te+=this.renderer.table(qe,Le);continue}case"blockquote":{Le=this.parse(Ue.tokens),te+=this.renderer.blockquote(Le);continue}case"list":{for(we=Ue.ordered,ee=Ue.start,ce=Ue.loose,Oe=Ue.items.length,Le="",ue=0;ue<Oe;ue++)De=Ue.items[ue],at=De.checked,it=De.task,je="",De.task&&(Pe=this.renderer.checkbox(at),ce?De.tokens.length>0&&De.tokens[0].type==="text"?(De.tokens[0].text=Pe+" "+De.tokens[0].text,De.tokens[0].tokens&&De.tokens[0].tokens.length>0&&De.tokens[0].tokens[0].type==="text"&&(De.tokens[0].tokens[0].text=Pe+" "+De.tokens[0].tokens[0].text)):De.tokens.unshift({type:"text",text:Pe}):je+=Pe),je+=this.parse(De.tokens,ce),Le+=this.renderer.listitem(je,it,at);te+=this.renderer.list(Le,we,ee);continue}case"html":{te+=this.renderer.html(Ue.text);continue}case"paragraph":{te+=this.renderer.paragraph(this.parseInline(Ue.tokens));continue}case"text":{for(Le=Ue.tokens?this.parseInline(Ue.tokens):Ue.text;ie+1<Be&&$[ie+1].type==="text";)Ue=$[++ie],Le+=`
|
|
`+(Ue.tokens?this.parseInline(Ue.tokens):Ue.text);te+=Q?this.renderer.paragraph(Le):Le;continue}default:{var dt='Token with "'+Ue.type+'" type was not found.';if(this.options.silent){console.error(dt);return}else throw new Error(dt)}}}return te},re.parseInline=function($,Q){Q=Q||this.renderer;var te="",ie,ue,Ce=$.length;for(ie=0;ie<Ce;ie++){ue=$[ie];switch(ue.type){case"escape":{te+=Q.text(ue.text);break}case"html":{te+=Q.html(ue.text);break}case"link":{te+=Q.link(ue.href,ue.title,this.parseInline(ue.tokens,Q));break}case"image":{te+=Q.image(ue.href,ue.title,ue.text);break}case"strong":{te+=Q.strong(this.parseInline(ue.tokens,Q));break}case"em":{te+=Q.em(this.parseInline(ue.tokens,Q));break}case"codespan":{te+=Q.codespan(ue.text);break}case"br":{te+=Q.br();break}case"del":{te+=Q.del(this.parseInline(ue.tokens,Q));break}case"text":{te+=Q.text(ue.text);break}default:{var Oe='Token with "'+ue.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return te},de}(),gt=X.merge,ht=X.checkSanitizeDeprecation,be=X.escape,pe=N.getDefaults,ke=N.changeDefaults,Ne=N.defaults;function xe(de,re,ne){if(typeof de=="undefined"||de===null)throw new Error("marked(): input parameter is undefined or null");if(typeof de!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(de)+", string expected");if(typeof re=="function"&&(ne=re,re=null),re=gt({},xe.defaults,re||{}),ht(re),ne){var $=re.highlight,Q;try{Q=Ke.lex(de,re)}catch(Ce){return ne(Ce)}var te=function(Oe){var Fe;if(!Oe)try{Fe=ut.parse(Q,re)}catch(tt){Oe=tt}return re.highlight=$,Oe?ne(Oe):ne(null,Fe)};if(!$||$.length<3)return te();if(delete re.highlight,!Q.length)return te();var ie=0;xe.walkTokens(Q,function(Ce){Ce.type==="code"&&(ie++,setTimeout(function(){$(Ce.text,Ce.lang,function(Oe,Fe){if(Oe)return te(Oe);Fe!=null&&Fe!==Ce.text&&(Ce.text=Fe,Ce.escaped=!0),ie--,ie===0&&te()})},0))}),ie===0&&te();return}try{var ue=Ke.lex(de,re);return re.walkTokens&&xe.walkTokens(ue,re.walkTokens),ut.parse(ue,re)}catch(Ce){if(Ce.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,re.silent)return"<p>An error occurred:</p><pre>"+be(Ce.message+"",!0)+"</pre>";throw Ce}}xe.options=xe.setOptions=function(de){return gt(xe.defaults,de),ke(xe.defaults),xe},xe.getDefaults=pe,xe.defaults=Ne,xe.use=function(de){var re=gt({},de);if(de.renderer&&function(){var $=xe.defaults.renderer||new Xe,Q=function(ue){var Ce=$[ue];$[ue]=function(){for(var Oe=arguments.length,Fe=new Array(Oe),tt=0;tt<Oe;tt++)Fe[tt]=arguments[tt];var Ve=de.renderer[ue].apply($,Fe);return Ve===!1&&(Ve=Ce.apply($,Fe)),Ve}};for(var te in de.renderer)Q(te);re.renderer=$}(),de.tokenizer&&function(){var $=xe.defaults.tokenizer||new me,Q=function(ue){var Ce=$[ue];$[ue]=function(){for(var Oe=arguments.length,Fe=new Array(Oe),tt=0;tt<Oe;tt++)Fe[tt]=arguments[tt];var Ve=de.tokenizer[ue].apply($,Fe);return Ve===!1&&(Ve=Ce.apply($,Fe)),Ve}};for(var te in de.tokenizer)Q(te);re.tokenizer=$}(),de.walkTokens){var ne=xe.defaults.walkTokens;re.walkTokens=function($){de.walkTokens($),ne&&ne($)}}xe.setOptions(re)},xe.walkTokens=function(de,re){for(var ne=M(de),$;!($=ne()).done;){var Q=$.value;re(Q);switch(Q.type){case"table":{for(var te=M(Q.tokens.header),ie;!(ie=te()).done;){var ue=ie.value;xe.walkTokens(ue,re)}for(var Ce=M(Q.tokens.cells),Oe;!(Oe=Ce()).done;)for(var Fe=Oe.value,tt=M(Fe),Ve;!(Ve=tt()).done;){var qe=Ve.value;xe.walkTokens(qe,re)}break}case"list":{xe.walkTokens(Q.items,re);break}default:Q.tokens&&xe.walkTokens(Q.tokens,re)}}},xe.Parser=ut,xe.parser=ut.parse,xe.Renderer=Xe,xe.TextRenderer=He,xe.Lexer=Ke,xe.lexer=Ke.lex,xe.Tokenizer=me,xe.Slugger=st,xe.parse=xe;var Re=xe;return Re})},"DlR+":function(Ie,Ee,k){var V=k("MFOe"),B=V.Global,D=V.trim;Ie.exports={name:"cookieStorage",read:M,write:N,each:_,remove:I,clearAll:A};var F=B.document;function M(v){if(!v||!L(v))return null;var y="(?:^|.*;\\s*)"+escape(v).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(F.cookie.replace(new RegExp(y),"$1"))}function _(v){for(var y=F.cookie.split(/; ?/g),O=y.length-1;O>=0;O--){if(!D(y[O]))continue;var S=y[O].split("="),p=unescape(S[0]),m=unescape(S[1]);v(m,p)}}function N(v,y){if(!v)return;F.cookie=escape(v)+"="+escape(y)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function I(v){if(!v||!L(v))return;F.cookie=escape(v)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function A(){_(function(v,y){I(y)})}function L(v){return new RegExp("(?:^|;\\s*)"+escape(v).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(F.cookie)}},EHPI:function(Ie,Ee,k){"use strict";var V=k("bbsP"),B=k("/wGt"),D=k("tJVT"),F=k("k1fw"),M=k("cDcd"),_=k.n(M),N=k("ZW9T"),I=k("ZD9Y"),A=k("M8RZ"),L=k("bCnd"),v=k("fcyK"),y=k.n(v),O={theme:Object(L.a)("cmCodeMode","vs-dark"),fontSize:Object(L.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(L.a)("cmTabToSpace",!0)},S;(function(l){l[l.set_font_size=0]="set_font_size",l[l.set_theme=1]="set_theme",l[l.on_tab_to_space=2]="on_tab_to_space",l[l.set_show_editor_setting=3]="set_show_editor_setting"})(S||(S={}));function p(l,i){switch(i.type){case S.set_show_editor_setting:return Object(F.a)(Object(F.a)({},l),{},{showEditorSetting:i.payload});case S.set_theme:return Object(F.a)(Object(F.a)({},l),{},{theme:i.payload});case S.set_font_size:return Object(F.a)(Object(F.a)({},l),{},{fontSize:i.payload});case S.on_tab_to_space:return Object(F.a)(Object(F.a)({},l),{},{tabToSpace:i.payload});default:throw new Error}}Ee.a=function(l){var i=l.isLoading,a=l.value,c=l.onChange,C=l.language,x=l.ActionBarRender,h=x===void 0?function(X){return _.a.createElement(m,{onShowCodeSetting:X})}:x,w=Object(M.useReducer)(p,O),E=Object(D.a)(w,2),f=E[0],d=E[1],s=f.theme,o=f.fontSize,T=f.showEditorSetting,b=f.tabToSpace,g={onFontSizeChange:function(W){d({type:S.set_font_size,payload:W}),Object(L.b)("cmFontSize",W)},tabToSpace:b,cmFontSize:o,className:"oj",cmCodeMode:s,onTabToSpace:function(W){d({type:S.on_tab_to_space,payload:W}),Object(L.b)("cmTabToSpace",W)},onCodeModeChange:function(W){d({type:S.set_theme,payload:W}),Object(L.b)("cmCodeMode",W)}};function P(){d({type:S.set_show_editor_setting,payload:!1})}function j(){d({type:S.set_show_editor_setting,payload:!0})}var H={value:a,language:C,onChange:c,theme:s,height:"calc(100% - 56px)",options:{fontSize:o,insertSpaces:b}};return _.a.createElement(M.Fragment,null,_.a.createElement("div",{className:"code-panel-container"},h(j),!i&&_.a.createElement(N.b,H)),_.a.createElement(A.a,null,_.a.createElement(B.a,{className:"oj",title:null,placement:"right",closable:!1,visible:T,onClose:P},_.a.createElement(I.a,g))))};function m(l){var i=l.onShowCodeSetting;return _.a.createElement("div",{className:"action-bar"},_.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),_.a.createElement("a",{onClick:i},_.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Ie,Ee,k){(function(V){V(k("VrN/"))})(function(V){var B={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=V.Pos;V.defineOption("autoCloseBrackets",!1,function(p,m,l){l&&l!=V.Init&&(p.removeKeyMap(M),p.state.closeBrackets=null),m&&(_(F(m,"pairs")),p.state.closeBrackets=m,p.addKeyMap(M))});function F(p,m){return m=="pairs"&&typeof p=="string"?p:typeof p=="object"&&p[m]!=null?p[m]:B[m]}var M={Backspace:A,Enter:L};function _(p){for(var m=0;m<p.length;m++){var l=p.charAt(m),i="'"+l+"'";M[i]||(M[i]=N(l))}}_(B.pairs+"`");function N(p){return function(m){return y(m,p)}}function I(p){var m=p.state.closeBrackets;if(!m||m.override)return m;var l=p.getModeAt(p.getCursor());return l.closeBrackets||m}function A(p){var m=I(p);if(!m||p.getOption("disableInput"))return V.Pass;for(var l=F(m,"pairs"),i=p.listSelections(),a=0;a<i.length;a++){if(!i[a].empty())return V.Pass;var c=O(p,i[a].head);if(!c||l.indexOf(c)%2!=0)return V.Pass}for(var a=i.length-1;a>=0;a--){var C=i[a].head;p.replaceRange("",D(C.line,C.ch-1),D(C.line,C.ch+1),"+delete")}}function L(p){var m=I(p),l=m&&F(m,"explode");if(!l||p.getOption("disableInput"))return V.Pass;for(var i=p.listSelections(),a=0;a<i.length;a++){if(!i[a].empty())return V.Pass;var c=O(p,i[a].head);if(!c||l.indexOf(c)%2!=0)return V.Pass}p.operation(function(){var C=p.lineSeparator()||`
|
|
`;p.replaceSelection(C+C,null),p.execCommand("goCharLeft"),i=p.listSelections();for(var x=0;x<i.length;x++){var h=i[x].head.line;p.indentLine(h,null,!0),p.indentLine(h+1,null,!0)}})}function v(p){var m=V.cmpPos(p.anchor,p.head)>0;return{anchor:new D(p.anchor.line,p.anchor.ch+(m?-1:1)),head:new D(p.head.line,p.head.ch+(m?1:-1))}}function y(p,m){var l=I(p);if(!l||p.getOption("disableInput"))return V.Pass;var i=F(l,"pairs"),a=i.indexOf(m);if(a==-1)return V.Pass;for(var c=F(l,"closeBefore"),C=F(l,"triples"),x=i.charAt(a+1)==m,h=p.listSelections(),w=a%2==0,E,f=0;f<h.length;f++){var d=h[f],s=d.head,o,T=p.getRange(s,D(s.line,s.ch+1));if(w&&!d.empty())o="surround";else if((x||!w)&&T==m)x&&S(p,s)?o="both":C.indexOf(m)>=0&&p.getRange(s,D(s.line,s.ch+3))==m+m+m?o="skipThree":o="skip";else if(x&&s.ch>1&&C.indexOf(m)>=0&&p.getRange(D(s.line,s.ch-2),s)==m+m){if(s.ch>2&&/\bstring/.test(p.getTokenTypeAt(D(s.line,s.ch-2))))return V.Pass;o="addFour"}else if(x){var b=s.ch==0?" ":p.getRange(D(s.line,s.ch-1),s);if(!V.isWordChar(T)&&b!=m&&!V.isWordChar(b))o="both";else return V.Pass}else if(w&&(T.length===0||/\s/.test(T)||c.indexOf(T)>-1))o="both";else return V.Pass;if(!E)E=o;else if(E!=o)return V.Pass}var g=a%2?i.charAt(a-1):m,P=a%2?m:i.charAt(a+1);p.operation(function(){if(E=="skip")p.execCommand("goCharRight");else if(E=="skipThree")for(var j=0;j<3;j++)p.execCommand("goCharRight");else if(E=="surround"){for(var H=p.getSelections(),j=0;j<H.length;j++)H[j]=g+H[j]+P;p.replaceSelections(H,"around"),H=p.listSelections().slice();for(var j=0;j<H.length;j++)H[j]=v(H[j]);p.setSelections(H)}else E=="both"?(p.replaceSelection(g+P,null),p.triggerElectric(g+P),p.execCommand("goCharLeft")):E=="addFour"&&(p.replaceSelection(g+g+g+g,"before"),p.execCommand("goCharRight"))})}function O(p,m){var l=p.getRange(D(m.line,m.ch-1),D(m.line,m.ch+1));return l.length==2?l:null}function S(p,m){var l=p.getTokenAt(D(m.line,m.ch+1));return/\bstring/.test(l.type)&&l.start==m.ch&&(m.ch==0||!/\bstring/.test(p.getTokenTypeAt(m)))}})},FOrL:function(Ie,Ee,k){Ie.exports=k.p+"static/nodata.a6b3f948.png"},Gytx:function(Ie,Ee){Ie.exports=function(V,B,D,F){var M=D?D.call(F,V,B):void 0;if(M!==void 0)return!!M;if(V===B)return!0;if(typeof V!="object"||!V||typeof B!="object"||!B)return!1;var _=Object.keys(V),N=Object.keys(B);if(_.length!==N.length)return!1;for(var I=Object.prototype.hasOwnProperty.bind(B),A=0;A<_.length;A++){var L=_[A];if(!I(L))return!1;var v=V[L],y=B[L];if(M=D?D.call(F,v,y,L):void 0,M===!1||M===void 0&&v!==y)return!1}return!0}},H2Ag:function(Ie,Ee,k){Ie.exports={flex_box_center:"flex_box_center___2pJkw",flex_space_between:"flex_space_between___2XyGR",flex_box_vertical_center:"flex_box_vertical_center___3RcdW",flex_box_center_end:"flex_box_center_end___ELbjB",flex_box_column:"flex_box_column___1nxOL","left-panel":"left-panel___19pOi","tab-panel-body":"tab-panel-body___1Wa4B",b1:"b1___rOGbM","oj-width-input":"oj-width-input___1L1MS","oj-mr":"oj-mr___2FJRu","s-navs":"s-navs___Rtxdn","bg-white":"bg-white___3Or1a",active:"active___x-fRG",list:"list___2RvQV",btns:"btns___FcbS4",drawer:"drawer___2L-f8"}},HmJG:function(Ie,Ee,k){},I8Z2:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return F}),k.d(Ee,"b",function(){return O}),k.d(Ee,"c",function(){return p});var V=k("cDcd"),B=function(){var m=function(l,i){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var C in c)c.hasOwnProperty(C)&&(a[C]=c[C])},m(l,i)};return function(l,i){m(l,i);function a(){this.constructor=l}l.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),D=V.createContext(null),F=function(m){B(l,m);function l(){return m!==null&&m.apply(this,arguments)||this}return l.prototype.render=function(){return V.createElement(D.Provider,{value:this.props.store},this.props.children)},l}(V.Component),M=k("Gytx"),_=k.n(M),N=k("2mql"),I=k.n(N),A=function(){var m=function(l,i){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var C in c)c.hasOwnProperty(C)&&(a[C]=c[C])},m(l,i)};return function(l,i){m(l,i);function a(){this.constructor=l}l.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),L=function(){return L=Object.assign||function(m){for(var l,i=1,a=arguments.length;i<a;i++){l=arguments[i];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(m[c]=l[c])}return m},L.apply(this,arguments)};function v(m){return m.displayName||m.name||"Component"}var y=function(){return{}};function O(m,l){l===void 0&&(l={});var i=!!m,a=m||y;return function(C){var x=function(w){A(E,w);function E(f,d){var s=w.call(this,f,d)||this;return s.unsubscribe=null,s.handleChange=function(){if(!s.unsubscribe)return;var o=a(s.store.getState(),s.props);s.setState({subscribed:o})},s.store=s.context,s.state={subscribed:a(s.store.getState(),f),store:s.store,props:f},s}return E.getDerivedStateFromProps=function(f,d){return m&&m.length===2&&f!==d.props?{subscribed:a(d.store.getState(),f),props:f}:{props:f}},E.prototype.componentDidMount=function(){this.trySubscribe()},E.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},E.prototype.shouldComponentUpdate=function(f,d){return!_()(this.props,f)||!_()(this.state.subscribed,d.subscribed)},E.prototype.trySubscribe=function(){i&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},E.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},E.prototype.render=function(){var f=L(L(L({},this.props),this.state.subscribed),{store:this.store});return V.createElement(C,L({},f,{ref:this.props.miniStoreForwardedRef}))},E.displayName="Connect("+v(C)+")",E.contextType=D,E}(V.Component);if(l.forwardRef){var h=V.forwardRef(function(w,E){return V.createElement(x,L({},w,{miniStoreForwardedRef:E}))});return I()(h,C)}return I()(x,C)}}var S=function(){return S=Object.assign||function(m){for(var l,i=1,a=arguments.length;i<a;i++){l=arguments[i];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(m[c]=l[c])}return m},S.apply(this,arguments)};function p(m){var l=m,i=[];function a(x){l=S(S({},l),x);for(var h=0;h<i.length;h++)i[h]()}function c(){return l}function C(x){return i.push(x),function(){var w=i.indexOf(x);i.splice(w,1)}}return{setState:a,getState:c,subscribe:C}}},IBYe:function(Ie,Ee,k){"use strict";function V(B){return null}Ee.a=V},IxHN:function(Ie,Ee,k){"use strict";var V=k("cDcd"),B=k.n(V),D=k("07cG"),F=k.n(D);Ee.a=function(M){var _=M.message,N=M.className,I=M.children,A=M.style,L=A===void 0?{}:A;return B.a.createElement("div",{className:"".concat(F.a.idsRingWrapper," ").concat(N)},B.a.createElement("div",{className:F.a.ldsRing},B.a.createElement("div",null),B.a.createElement("div",null),B.a.createElement("div",null),B.a.createElement("div",null)),_?B.a.createElement("p",{style:L},_):null,I)}},J66h:function(Ie,Ee,k){(function(V){var B,D;(function(F,M){Ie.exports=M(F)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof V!="undefined"?V:this,function(F){"use strict";F=F||{};var M=F.Base64,_="2.6.4",N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=function(g){for(var P={},j=0,H=g.length;j<H;j++)P[g.charAt(j)]=j;return P}(N),A=String.fromCharCode,L=function(g){if(g.length<2){var P=g.charCodeAt(0);return P<128?g:P<2048?A(192|P>>>6)+A(128|P&63):A(224|P>>>12&15)+A(128|P>>>6&63)+A(128|P&63)}else{var P=65536+(g.charCodeAt(0)-55296)*1024+(g.charCodeAt(1)-56320);return A(240|P>>>18&7)+A(128|P>>>12&63)+A(128|P>>>6&63)+A(128|P&63)}},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,y=function(g){return g.replace(v,L)},O=function(g){var P=[0,2,1][g.length%3],j=g.charCodeAt(0)<<16|(g.length>1?g.charCodeAt(1):0)<<8|(g.length>2?g.charCodeAt(2):0),H=[N.charAt(j>>>18),N.charAt(j>>>12&63),P>=2?"=":N.charAt(j>>>6&63),P>=1?"=":N.charAt(j&63)];return H.join("")},S=F.btoa&&typeof F.btoa=="function"?function(g){return F.btoa(g)}:function(g){if(g.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return g.replace(/[\s\S]{1,3}/g,O)},p=function(g){return S(y(String(g)))},m=function(g){return g.replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,"")},l=function(g,P){return P?m(p(g)):p(g)},i=function(g){return l(g,!0)},a;F.Uint8Array&&(a=function(g,P){for(var j="",H=0,X=g.length;H<X;H+=3){var W=g[H],U=g[H+1],z=g[H+2],Z=W<<16|U<<8|z;j+=N.charAt(Z>>>18)+N.charAt(Z>>>12&63)+(typeof U!="undefined"?N.charAt(Z>>>6&63):"=")+(typeof z!="undefined"?N.charAt(Z&63):"=")}return P?m(j):j});var c=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,C=function(g){switch(g.length){case 4:var P=(7&g.charCodeAt(0))<<18|(63&g.charCodeAt(1))<<12|(63&g.charCodeAt(2))<<6|63&g.charCodeAt(3),j=P-65536;return A((j>>>10)+55296)+A((j&1023)+56320);case 3:return A((15&g.charCodeAt(0))<<12|(63&g.charCodeAt(1))<<6|63&g.charCodeAt(2));default:return A((31&g.charCodeAt(0))<<6|63&g.charCodeAt(1))}},x=function(g){return g.replace(c,C)},h=function(g){var P=g.length,j=P%4,H=(P>0?I[g.charAt(0)]<<18:0)|(P>1?I[g.charAt(1)]<<12:0)|(P>2?I[g.charAt(2)]<<6:0)|(P>3?I[g.charAt(3)]:0),X=[A(H>>>16),A(H>>>8&255),A(H&255)];return X.length-=[0,0,2,1][j],X.join("")},w=F.atob&&typeof F.atob=="function"?function(g){return F.atob(g)}:function(g){return g.replace(/\S{1,4}/g,h)},E=function(g){return w(String(g).replace(/[^A-Za-z0-9\+\/]/g,""))},f=function(g){return x(w(g))},d=function(g){return String(g).replace(/[-_]/g,function(P){return P=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},s=function(g){return f(d(g))},o;F.Uint8Array&&(o=function(g){return Uint8Array.from(E(d(g)),function(P){return P.charCodeAt(0)})});var T=function(){var g=F.Base64;return F.Base64=M,g};if(F.Base64={VERSION:_,atob:E,btoa:S,fromBase64:s,toBase64:l,utob:y,encode:l,encodeURI:i,btou:x,decode:s,noConflict:T,fromUint8Array:a,toUint8Array:o},typeof Object.defineProperty=="function"){var b=function(g){return{value:g,enumerable:!1,writable:!0,configurable:!0}};F.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",b(function(){return s(this)})),Object.defineProperty(String.prototype,"toBase64",b(function(g){return l(this,g)})),Object.defineProperty(String.prototype,"toBase64URI",b(function(){return l(this,!0)}))}}return F.Meteor&&(Base64=F.Base64),Ie.exports?Ie.exports.Base64=F.Base64:!(B=[],D=function(){return F.Base64}.apply(Ee,B),D!==void 0&&(Ie.exports=D)),{Base64:F.Base64}})}).call(this,k("IyRk"))},JB8y:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return V});var V;(function(B){B[B.NOMATCH=-1]="NOMATCH",B[B.OK=0]="OK",B[B.TIMEOUT=2]="TIMEOUT",B[B.PODFAILURE=3]="PODFAILURE",B[B.COMPILEFAILURE=4]="COMPILEFAILURE",B[B.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(V||(V={}))},JPnl:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return d}),k.d(Ee,"c",function(){return T});var V=k("+L6B"),B=k("2/Rp"),D=k("tJVT"),F=k("9og8"),M=k("k1fw"),_=k("jrin"),N=k("5NDa"),I=k("5rEg"),A=k("WmNS"),L=k.n(A),v=k("cDcd"),y=k.n(v),O=k("8Skl"),S=k("y3Kf"),p=k("JB8y"),m=k("J66h"),l=k.n(m),i=k("a4uL"),a=k.n(i),c=k("IxHN"),C=k("9Bee"),x=k("1vsH"),h=k("ErOA"),w,E=I.a.TextArea,f={visible:!1,tabIndex:"0"},d=(w={},Object(_.a)(w,p.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(_.a)(w,p.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(_.a)(w,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(_.a)(w,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(_.a)(w,4,"\u7F16\u8BD1\u5931\u8D25"),Object(_.a)(w,5,"\u6267\u884C\u5931\u8D25"),w),s;(function(g){g[g.SET_VISIBLE=0]="SET_VISIBLE",g[g.SET_TABINDEX=1]="SET_TABINDEX"})(s||(s={}));function o(g,P){switch(P.type){case s.SET_VISIBLE:return Object(M.a)(Object(M.a)({},g),{},{visible:P.payload});case s.SET_TABINDEX:return Object(M.a)(Object(M.a)({},g),{},{tabIndex:P.payload});default:throw new Error}}function T(g){var P=g.status,j=g.error_msg,H=g.output,X=g.input,W=g.expected_output,U=g.is_file,z=g.input_file_url,Z=g.output_file_url,q=g.expected_output_file_url,oe=g.setMonacoValue,ye=g.setData,me=null,fe={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(P){case p.a.NOMATCH:me=y.a.createElement(y.a.Fragment,null,y.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!U&&y.a.createElement(C.a,{value:X,style:fe}),U&&y.a.createElement("div",{style:fe},y.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(F.a)(L.a.mark(function ve(){var ge;return L.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,fetch(z,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return ge=se.sent,se.t0=oe,se.next=6,ge.text();case 6:se.t1=se.sent,(0,se.t0)(se.t1),setTimeout(function(){ye(z)},200);case 9:case"end":return se.stop()}},ve)}))},X)),y.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!U&&y.a.createElement(C.a,{value:H&&m.Base64.decode(H)||"",style:fe}),U&&y.a.createElement("div",{style:fe},y.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(F.a)(L.a.mark(function ve(){var ge;return L.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(h.a)(Z,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:ge=se.sent,oe(ge),setTimeout(function(){ye(Z)},200);case 5:case"end":return se.stop()}},ve)}))},H)),y.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!U&&y.a.createElement(C.a,{value:W&&m.Base64.decode(W)||"",style:fe}),U&&y.a.createElement("div",{style:fe},y.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(F.a)(L.a.mark(function ve(){var ge;return L.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,fetch(q,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return ge=se.sent,se.t0=oe,se.next=6,ge.text();case 6:se.t1=se.sent,(0,se.t0)(se.t1),setTimeout(function(){ye(q)},200);case 9:case"end":return se.stop()}},ve)}))},W)));break;case p.a.EXECUTEFAILURE:me=y.a.createElement(y.a.Fragment,null,y.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!U&&y.a.createElement(C.a,{value:X,style:fe}),U&&y.a.createElement("div",{style:fe},y.a.createElement("a",{onClick:function(){return Object(x.y)(z,X)}},X)),y.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),y.a.createElement("pre",{className:"error"},m.Base64.decode(j)));break;case p.a.COMPILEFAILURE:me=y.a.createElement(y.a.Fragment,null,y.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!U&&y.a.createElement(C.a,{value:X,style:fe}),U&&y.a.createElement("div",{style:fe},y.a.createElement("a",{onClick:function(){return Object(x.y)(z,X)}},X)),y.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),y.a.createElement("pre",{className:"error"},m.Base64.decode(j)));break;case p.a.PODFAILURE:me=y.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case p.a.TIMEOUT:me=y.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return y.a.createElement(y.a.Fragment,null," ",me," ")}function b(g){var P=g.status,j=g.error_msg,H=g.execute_time,X=g.output,W=g.input,U=g.expected_output,z=g.is_file,Z=g.input_file_url,q=g.output_file_url,oe=g.expected_output_file_url,ye=null;switch(P){case p.a.OK:ye=y.a.createElement(y.a.Fragment,null,y.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",H),y.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),y.a.createElement("pre",null,m.Base64.decode(X)));break;case p.a.NOMATCH:ye=y.a.createElement(y.a.Fragment,null,y.a.createElement("p",null,"\u8F93\u5165\uFF1A",y.a.createElement("pre",null,W)),y.a.createElement("p",null,"\u8F93\u51FA\uFF1A",X&&m.Base64.decode(X)),y.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",U&&m.Base64.decode(U)));break;case p.a.EXECUTEFAILURE:ye=y.a.createElement(y.a.Fragment,null,y.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",y.a.createElement("pre",null,W)),y.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),y.a.createElement("pre",{className:"error"},m.Base64.decode(j)));break;case p.a.COMPILEFAILURE:ye=y.a.createElement(y.a.Fragment,null,y.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",y.a.createElement("pre",null,W)),y.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),y.a.createElement("pre",{className:"error"},m.Base64.decode(j)));break;case p.a.PODFAILURE:ye=y.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case p.a.TIMEOUT:ye=y.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return y.a.createElement(y.a.Fragment,null," ",ye," ")}Ee.b=function(g){var P=g.input,j=g.debuging,H=g.submitting,X=g.executingMessage,W=g.debugResult,U=g.onChangeInput,z=g.onDebugCode,Z=g.onSubmitCode,q=g.hack,oe=g.user,ye=Object(v.useReducer)(o,f),me=Object(D.a)(ye,2),fe=me[0],ve=me[1],ge=fe.visible,ae=fe.tabIndex;function se(Ze){var ze=Ze.target.id;ve({type:s.SET_TABINDEX,payload:ze})}function Te(){ve({type:s.SET_VISIBLE,payload:!ge})}var We=Object(v.useMemo)(function(){if(W){var Ze=W.status;return y.a.createElement(y.a.Fragment,null,b(W))}return null},[W]);function Je(){ve({type:s.SET_VISIBLE,payload:!0}),ve({type:s.SET_TABINDEX,payload:"1"}),z()}var Ye=function(){var Ze=Object(F.a)(L.a.mark(function ze(Ke){var $e;return L.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return nt.next=2,Object(h.a)("/api/problems/".concat(Ke,"/start.json"),{method:"get",params:{hack_user_id:oe==null?void 0:oe.user_id}});case 2:$e=nt.sent,$e&&(window.location.href="/myproblems/".concat($e==null?void 0:$e.identifier,"?type=1"));case 4:case"end":return nt.stop()}},ze)}));return function(Ke){return Ze.apply(this,arguments)}}();return y.a.createElement("div",{className:"test-case-panel"},y.a.createElement("div",{className:"test-case-panel-body ".concat(ge?"active":"")},y.a.createElement("ul",{className:"s-navs"},y.a.createElement("li",null,y.a.createElement("a",{className:ae==="0"?"active":"",id:"0",onClick:se},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),y.a.createElement("li",null,y.a.createElement("a",{className:ae==="1"?"active":"",id:"1",onClick:se},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),y.a.createElement("div",{className:"tab-panel-body ".concat(ae==="0"?"":"hide")},y.a.createElement(E,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:P,onChange:U})),y.a.createElement("div",{className:"tab-panel-body ".concat(ae==="1"?"":"hide")},j?y.a.createElement(c.a,{message:X}):W?y.a.createElement("section",{style:{height:200}}," ",We," "):y.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),y.a.createElement("a",{className:"btn-collapse ".concat(ge?"up":""),onClick:Te},ge?y.a.createElement(O.a,null):y.a.createElement(S.a,null)),y.a.createElement("footer",{className:"footer"},y.a.createElement("span",null,"\u63A7\u5236\u53F0"),y.a.createElement("div",{className:"flex-container"},(q==null?void 0:q.is_program)&&(q==null?void 0:q.above_question)&&y.a.createElement(B.a,{onClick:function(){return Ye(q==null?void 0:q.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(q==null?void 0:q.is_program)&&(q==null?void 0:q.under_question)&&y.a.createElement(B.a,{onClick:function(){return Ye(q==null?void 0:q.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),y.a.createElement(B.a,{className:"btn-green",type:"ghost",loading:j,onClick:Je},"\u8C03\u8BD5\u4EE3\u7801"),y.a.createElement(B.a,{type:"primary",loading:H,disabled:H,onClick:function(){ve({type:s.SET_VISIBLE,payload:!1}),Z()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},LdHM:function(Ie,Ee,k){"use strict";k.d(Ee,"b",function(){return c}),k.d(Ee,"a",function(){return x});var V=k("1OyB"),B=k("vuIU"),D=k("Ji7U"),F=k("LK+K"),M=k("cDcd"),_=k("rePB"),N=k("Ff2n"),I=k("ODXe"),A=k("4IlW"),L=k("bX4T"),v=k("YrtM"),y=k("TSYQ"),O=k.n(y),S=k("+nKL"),p=k("8OUc"),m=function(z,Z){var q=z.prefixCls,oe=z.id,ye=z.flattenOptions,me=z.childrenAsData,fe=z.values,ve=z.searchValue,ge=z.multiple,ae=z.defaultActiveFirstOption,se=z.height,Te=z.itemHeight,We=z.notFoundContent,Je=z.open,Ye=z.menuItemSelectedIcon,Ze=z.virtual,ze=z.onSelect,Ke=z.onToggleOpen,$e=z.onActiveValue,Qe=z.onScroll,nt=z.onMouseEnter,Xe="".concat(q,"-item"),He=Object(v.a)(function(){return ye},[Je,ye],function(Re,de){return de[0]&&Re[1]!==de[1]}),st=M.useRef(null),ft=function(de){de.preventDefault()},ot=function(de){st.current&&st.current.scrollTo({index:de})},ut=function(de){for(var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ne=He.length,$=0;$<ne;$+=1){var Q=(de+$*re+ne)%ne,te=He[Q],ie=te.group,ue=te.data;if(!ie&&!ue.disabled)return Q}return-1},gt=M.useState(function(){return ut(0)}),ht=Object(I.a)(gt,2),be=ht[0],pe=ht[1],ke=function(de){pe(de);var re=He[de];if(!re){$e(null,-1);return}$e(re.data.value,de)};M.useEffect(function(){ke(ae!==!1?ut(0):-1)},[He.length,ve]),M.useEffect(function(){var Re=setTimeout(function(){if(!ge&&Je&&fe.size===1){var de=Array.from(fe)[0],re=He.findIndex(function(ne){var $=ne.data;return $.value===de});ke(re),ot(re)}});return function(){return clearTimeout(Re)}},[Je]);var Ne=function(de){de!==void 0&&ze(de,{selected:!fe.has(de)}),ge||Ke(!1)};if(M.useImperativeHandle(Z,function(){return{onKeyDown:function(de){var re=de.which;switch(re){case A.a.UP:case A.a.DOWN:{var ne=0;if(re===A.a.UP?ne=-1:re===A.a.DOWN&&(ne=1),ne!==0){var $=ut(be+ne,ne);ot($),ke($)}break}case A.a.ENTER:{var Q=He[be];Q&&!Q.data.disabled?Ne(Q.data.value):Ne(void 0),Je&&de.preventDefault();break}case A.a.ESC:Ke(!1)}},onKeyUp:function(){},scrollTo:function(de){ot(de)}}}),He.length===0)return M.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),className:"".concat(Xe,"-empty"),onMouseDown:ft},We);function xe(Re){var de=He[Re];if(!de)return null;var re=de.data||{},ne=re.value,$=re.label,Q=re.children,te=Object(L.a)(re,!0),ie=me?Q:$;return de?M.createElement("div",Object.assign({"aria-label":typeof ie=="string"?ie:null},te,{key:Re,role:"option",id:"".concat(oe,"_list_").concat(Re),"aria-selected":fe.has(ne)}),ne):null}return M.createElement(M.Fragment,null,M.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),style:{height:0,width:0,overflow:"hidden"}},xe(be-1),xe(be),xe(be+1)),M.createElement(S.a,{itemKey:"key",ref:st,data:He,height:se,itemHeight:Te,fullHeight:!1,onMouseDown:ft,onScroll:Qe,virtual:Ze,onMouseEnter:nt},function(Re,de){var re,ne=Re.group,$=Re.groupOption,Q=Re.data,te=Q.label,ie=Q.key;if(ne)return M.createElement("div",{className:O()(Xe,"".concat(Xe,"-group"))},te!==void 0?te:ie);var ue=Q.disabled,Ce=Q.value,Oe=Q.title,Fe=Q.children,tt=Q.style,Ve=Q.className,qe=Object(N.a)(Q,["disabled","value","title","children","style","className"]),Le=fe.has(Ce),Ue="".concat(Xe,"-option"),we=O()(Xe,Ue,Ve,(re={},Object(_.a)(re,"".concat(Ue,"-grouped"),$),Object(_.a)(re,"".concat(Ue,"-active"),be===de&&!ue),Object(_.a)(re,"".concat(Ue,"-disabled"),ue),Object(_.a)(re,"".concat(Ue,"-selected"),Le),re)),ee=me?Fe:te,ce=!Ye||typeof Ye=="function"||Le;return M.createElement("div",Object.assign({},qe,{"aria-selected":Le,className:we,title:Oe,onMouseMove:function(){if(be===de||ue)return;ke(de)},onClick:function(){ue||Ne(Ce)},style:tt}),M.createElement("div",{className:"".concat(Ue,"-content")},ee||Ce),M.isValidElement(Ye)||Le,ce&&M.createElement(p.a,{className:"".concat(Xe,"-option-state"),customizeIcon:Ye,customizeIconProps:{isSelected:Le}},Le?"\u2713":null))}))},l=M.forwardRef(m);l.displayName="OptionList";var i=l,a=function(){return null};a.isSelectOption=!0;var c=a,C=function(){return null};C.isSelectOptGroup=!0;var x=C,h=k("VTBJ"),w=k("Zm9Q");function E(U){var z=U.key,Z=U.props,q=Z.children,oe=Z.value,ye=Object(N.a)(Z,["children","value"]);return Object(h.a)({key:z,value:oe!==void 0?oe:z,children:q},ye)}function f(U){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(U).map(function(Z,q){if(!M.isValidElement(Z)||!Z.type)return null;var oe=Z.type.isSelectOptGroup,ye=Z.key,me=Z.props,fe=me.children,ve=Object(N.a)(me,["children"]);return z||!oe?E(Z):Object(h.a)(Object(h.a)({key:"__RC_SELECT_GRP__".concat(ye===null?q:ye,"__"),label:ye},ve),{},{options:f(fe)})}).filter(function(Z){return Z})}var d=k("2Qr1"),s=k("qNPg"),o=k("U8pU"),T=k("Kwbf"),b=k("WKfj");function g(U){var z=U.mode,Z=U.options,q=U.children,oe=U.backfill,ye=U.allowClear,me=U.placeholder,fe=U.getInputElement,ve=U.showSearch,ge=U.onSearch,ae=U.defaultOpen,se=U.autoFocus,Te=U.labelInValue,We=U.value,Je=U.inputValue,Ye=U.optionLabelProp,Ze=z==="multiple"||z==="tags",ze=ve!==void 0?ve:Ze||z==="combobox",Ke=Z||f(q);if(Object(T.a)(z!=="tags"||Ke.every(function(Xe){return!Xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var $e=Ke.some(function(Xe){return Xe.options?Xe.options.some(function(He){return typeof("value"in He?He.value:He.key)=="number"}):typeof("value"in Xe?Xe.value:Xe.key)=="number"});Object(T.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(z!=="combobox"||!Ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(z==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(T.a)(z==="combobox"||!fe,"`getInputElement` only work with `combobox` mode."),Object(T.b)(z!=="combobox"||!fe||!ye||!me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ge&&!ze&&z!=="combobox"&&z!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!ae||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),We!=null){var Qe=Object(b.d)(We);Object(T.a)(!Te||Qe.every(function(Xe){return Object(o.a)(Xe)==="object"&&("key"in Xe||"value"in Xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!Ze||Array.isArray(We),"`value` should be array when `mode` is `multiple` or `tags`")}if(q){var nt=null;Object(w.a)(q).some(function(Xe){if(!M.isValidElement(Xe)||!Xe.type)return!1;var He=Xe.type;if(He.isSelectOption)return!1;if(He.isSelectOptGroup){var st=Object(w.a)(Xe.props.children).every(function(ft){return!M.isValidElement(ft)||!Xe.type||ft.type.isSelectOption?!0:(nt=ft.type,!1)});return!st}return nt=He,!0}),nt&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(nt.displayName||nt.name||nt,"`.")),Object(T.a)(Je===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=g,j=Object(s.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:f,flattenOptions:d.d,getLabeledValue:d.e,filterOptions:d.b,isValueDisabled:d.g,findValueOption:d.c,warningProps:P,fillOptionsWithMissingValue:d.a}),H=function(U){Object(D.a)(Z,U);var z=Object(F.a)(Z);function Z(){var q;return Object(V.a)(this,Z),q=z.apply(this,arguments),q.selectRef=M.createRef(),q.focus=function(){q.selectRef.current.focus()},q.blur=function(){q.selectRef.current.blur()},q}return Object(B.a)(Z,[{key:"render",value:function(){return M.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),Z}(M.Component);H.Option=c,H.OptGroup=x;var X=H,W=Ee.c=X},M8RZ:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return A});var V=k("fWQN"),B=k("mtLc"),D=k("yKVA"),F=k("879j"),M=k("cDcd"),_=k.n(M),N=k("faye"),I=k.n(N),A=function(L){Object(D.a)(y,L);var v=Object(F.a)(y);function y(O){var S;Object(V.a)(this,y),S=v.call(this,O);var p=window.document;return S.node=p.createElement("div"),p.body.appendChild(S.node),S}return Object(B.a)(y,[{key:"render",value:function(){var S=this.props.children;return Object(N.createPortal)(S,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),y}(_.a.Component)},MFOe:function(Ie,Ee,k){(function(V){var B=_(),D=N(),F=I(),M=typeof window!="undefined"?window:V;Ie.exports={assign:B,create:D,trim:F,bind:A,slice:L,each:v,map:y,pluck:O,isList:S,isFunction:p,isObject:m,Global:M};function _(){return Object.assign?Object.assign:function(i,a,c,C){for(var x=1;x<arguments.length;x++)v(Object(arguments[x]),function(h,w){i[w]=h});return i}}function N(){if(Object.create)return function(a,c,C,x){var h=L(arguments,1);return B.apply(this,[Object.create(a)].concat(h))};{function l(){}return function(a,c,C,x){var h=L(arguments,1);return l.prototype=a,B.apply(this,[new l].concat(h))}}}function I(){return String.prototype.trim?function(i){return String.prototype.trim.call(i)}:function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function A(l,i){return function(){return i.apply(l,Array.prototype.slice.call(arguments,0))}}function L(l,i){return Array.prototype.slice.call(l,i||0)}function v(l,i){O(l,function(a,c){return i(a,c),!1})}function y(l,i){var a=S(l)?[]:{};return O(l,function(c,C){return a[C]=i(c,C),!1}),a}function O(l,i){if(S(l)){for(var a=0;a<l.length;a++)if(i(l[a],a))return l[a]}else for(var c in l)if(l.hasOwnProperty(c)&&i(l[c],c))return l[c]}function S(l){return l!=null&&typeof l!="function"&&typeof l.length=="number"}function p(l){return l&&{}.toString.call(l)==="[object Function]"}function m(l){return l&&{}.toString.call(l)==="[object Object]"}}).call(this,k("IyRk"))},NvD2:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return _});var V=k("Kwbf");function B(N,I){var A=new Set;return N.forEach(function(L){I.has(L)||A.add(L)}),A}function D(N){var I=N||{},A=I.disabled,L=I.disableCheckbox,v=I.checkable;return!!(A||L)||v===!1}function F(N,I,A,L){for(var v=new Set(N),y=new Set,O=0;O<=A;O+=1){var S=I.get(O)||new Set;S.forEach(function(i){var a=i.key,c=i.node,C=i.children,x=C===void 0?[]:C;v.has(a)&&!L(c)&&x.filter(function(h){return!L(h.node)}).forEach(function(h){v.add(h.key)})})}for(var p=new Set,m=A;m>=0;m-=1){var l=I.get(m)||new Set;l.forEach(function(i){var a=i.parent,c=i.node;if(L(c)||!i.parent||p.has(i.parent.key))return;if(L(i.parent.node)){p.add(a.key);return}var C=!0,x=!1;(a.children||[]).filter(function(h){return!L(h.node)}).forEach(function(h){var w=h.key,E=v.has(w);C&&!E&&(C=!1),!x&&(E||y.has(w))&&(x=!0)}),C&&v.add(a.key),x&&y.add(a.key),p.add(a.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(B(y,v))}}function M(N,I,A,L,v){for(var y=new Set(N),O=new Set(I),S=0;S<=L;S+=1){var p=A.get(S)||new Set;p.forEach(function(a){var c=a.key,C=a.node,x=a.children,h=x===void 0?[]:x;!y.has(c)&&!O.has(c)&&!v(C)&&h.filter(function(w){return!v(w.node)}).forEach(function(w){y.delete(w.key)})})}O=new Set;for(var m=new Set,l=L;l>=0;l-=1){var i=A.get(l)||new Set;i.forEach(function(a){var c=a.parent,C=a.node;if(v(C)||!a.parent||m.has(a.parent.key))return;if(v(a.parent.node)){m.add(c.key);return}var x=!0,h=!1;(c.children||[]).filter(function(w){return!v(w.node)}).forEach(function(w){var E=w.key,f=y.has(E);x&&!f&&(x=!1),!h&&(f||O.has(E))&&(h=!0)}),x||y.delete(c.key),h&&O.add(c.key),m.add(c.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(B(O,y))}}function _(N,I,A,L){var v=[],y;L?y=L:y=D;var O=new Set(N.filter(function(l){var i=!!A[l];return i||v.push(l),i})),S=new Map,p=0;Object.keys(A).forEach(function(l){var i=A[l],a=i.level,c=S.get(a);c||(c=new Set,S.set(a,c)),c.add(i),p=Math.max(p,a)}),Object(V.a)(!v.length,"Tree missing follow keys: ".concat(v.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var m;return I===!0?m=F(O,S,p,y):m=M(O,I.halfCheckedKeys,S,p,y),m}},OJz4:function(Ie,Ee,k){"use strict";k.d(Ee,"d",function(){return B}),k.d(Ee,"h",function(){return D}),k.d(Ee,"b",function(){return F}),k.d(Ee,"f",function(){return M}),k.d(Ee,"e",function(){return _}),k.d(Ee,"c",function(){return N}),k.d(Ee,"a",function(){return I}),k.d(Ee,"g",function(){return A}),k.d(Ee,"i",function(){return L}),k.d(Ee,"k",function(){return v}),k.d(Ee,"j",function(){return y});var V=k("ErOA");function B(O){return Object(V.c)("myproblems/".concat(O,".json"),{hidePopLogin:!0})}function D(O,S){return Object(V.f)("myproblems/".concat(O,"/code_submit.json"),S)}function F(O,S){return Object(V.c)("myproblems/".concat(O,"/code_debug.json"),S)}function M(O,S){return Object(V.c)("myproblems/".concat(O,"/submit_records.json"),S)}function _(O){return Object(V.c)("myproblems/record_detail.json",{id:O})}function N(O,S){return Object(V.c)("myproblems/".concat(O,"/result.json"),{mode:S})}function I(O,S){return Object(V.f)("myproblems/".concat(O,"/add_notes.json"),S)}function A(O){return Object(V.f)("myproblems/".concat(O,"/restore_initial_code.json"))}function L(O){return Object(V.f)("myproblems/".concat(O,"/sync_code.json"))}function v(O,S){return Object(V.f)("myproblems/".concat(O,"/update_code.json"),S)}function y(O,S){return Object(V.f)("discusses/".concat(O,"/plus.json"),S)}},OLES:function(Ie,Ee,k){"use strict";var V=k("U8pU"),B=k("VTBJ"),D=k("Ff2n"),F=k("cDcd"),M=k("uciX"),_=k("7ixt"),N=function(O){var S=O.overlay,p=O.prefixCls,m=O.id,l=O.overlayInnerStyle;return F.createElement("div",{className:"".concat(p,"-inner"),id:m,role:"tooltip",style:l},typeof S=="function"?S():S)},I=N,A=function(O,S){var p=O.overlayClassName,m=O.trigger,l=m===void 0?["hover"]:m,i=O.mouseEnterDelay,a=i===void 0?0:i,c=O.mouseLeaveDelay,C=c===void 0?.1:c,x=O.overlayStyle,h=O.prefixCls,w=h===void 0?"rc-tooltip":h,E=O.children,f=O.onVisibleChange,d=O.afterVisibleChange,s=O.transitionName,o=O.animation,T=O.placement,b=T===void 0?"right":T,g=O.align,P=g===void 0?{}:g,j=O.destroyTooltipOnHide,H=j===void 0?!1:j,X=O.defaultVisible,W=O.getTooltipContainer,U=O.overlayInnerStyle,z=Object(D.a)(O,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Z=Object(F.useRef)(null);Object(F.useImperativeHandle)(S,function(){return Z.current});var q=Object(B.a)({},z);"visible"in O&&(q.popupVisible=O.visible);var oe=function(){var ge=O.arrowContent,ae=ge===void 0?null:ge,se=O.overlay,Te=O.id;return[F.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},ae),F.createElement(I,{key:"content",prefixCls:w,id:Te,overlay:se,overlayInnerStyle:U})]},ye=!1,me=!1;if(typeof H=="boolean")ye=H;else if(H&&Object(V.a)(H)==="object"){var fe=H.keepParent;ye=fe===!0,me=fe===!1}return F.createElement(M.a,Object.assign({popupClassName:p,prefixCls:w,popup:oe,action:l,builtinPlacements:_.a,popupPlacement:b,ref:Z,popupAlign:P,getPopupContainer:W,onPopupVisibleChange:f,afterPopupVisibleChange:d,popupTransitionName:s,popupAnimation:o,defaultPopupVisible:X,destroyPopupOnHide:ye,autoDestroy:me,mouseLeaveDelay:C,popupStyle:x,mouseEnterDelay:a},q),E)},L=Object(F.forwardRef)(A),v=Ee.a=L},OZM5:function(Ie,Ee,k){"use strict";k.d(Ee,"b",function(){return L}),k.d(Ee,"a",function(){return v}),k.d(Ee,"k",function(){return y}),k.d(Ee,"h",function(){return O}),k.d(Ee,"i",function(){return S}),k.d(Ee,"g",function(){return p}),k.d(Ee,"c",function(){return m}),k.d(Ee,"d",function(){return l}),k.d(Ee,"j",function(){return c}),k.d(Ee,"e",function(){return C}),k.d(Ee,"f",function(){return x});var V=k("KQm4"),B=k("U8pU"),D=k("Ff2n"),F=k("cDcd"),M=k.n(F),_=k("Kwbf"),N=k("WaYH"),I=.25,A=2;function L(h,w){var E=h.slice(),f=E.indexOf(w);return f>=0&&E.splice(f,1),E}function v(h,w){var E=h.slice();return E.indexOf(w)===-1&&E.push(w),E}function y(h){return h.split("-")}function O(h,w){return"".concat(h,"-").concat(w)}function S(h){return h&&h.type&&h.type.isTreeNode}function p(h,w){var E=[h],f=w[h];function d(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(o){var T=o.key,b=o.children;E.push(T),d(b)})}return d(f.children),E}function m(h,w){var E=h.clientY,f=w.selectHandle.getBoundingClientRect(),d=f.top,s=f.bottom,o=f.height,T=Math.max(o*I,A);return E<=d+T?-1:E>=s-T?1:0}function l(h,w){if(!h)return;var E=w.multiple;return E?h.slice():h.length?[h[0]]:h}var i=function(w){return w};function a(h,w){if(!h)return[];var E=w||{},f=E.processProps,d=f===void 0?i:f,s=Array.isArray(h)?h:[h];return s.map(function(o){var T=o.children,b=Object(D.a)(o,["children"]),g=a(T,w);return M.a.createElement(N.a,Object.assign({},d(b)),g)})}function c(h){if(!h)return null;var w;if(Array.isArray(h))w={checkedKeys:h,halfCheckedKeys:void 0};else if(Object(B.a)(h)==="object")w={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Object(_.a)(!1,"`checkedKeys` is not an array or an object"),null;return w}function C(h,w){var E=new Set;function f(d){if(E.has(d))return;var s=w[d];if(!s)return;E.add(d);var o=s.parent,T=s.node;if(T.disabled)return;o&&f(o.key)}return(h||[]).forEach(function(d){f(d)}),Object(V.a)(E)}function x(h){var w={};return Object.keys(h).forEach(function(E){(E.startsWith("data-")||E.startsWith("aria-"))&&(w[E]=h[E])}),w}},Ot1p:function(Ie,Ee,k){"use strict";var V=k("2qtc"),B=k("kLXV"),D=k("rAM+"),F=k("miYZ"),M=k("tsqr"),_=k("9og8"),N=k("tJVT"),I=k("jrin"),A=k("WmNS"),L=k.n(A),v=k("cDcd"),y=k.n(v),O=k("VrN/"),S=k.n(O),p=k("bdgK"),m=k("p77/"),l=k("Bd2K"),i=k("ELLl"),a=k("19Vz"),c=k("lZu9"),C=k("+NIl"),x=k("kSUc"),h=k("9Bee"),w=function(ue){var Ce=ue.value,Oe=Ce===void 0?"":Ce,Fe=ue.className,tt=ue.showTextOnly,Ve=ue.showLines,qe=ue.style,Le=qe===void 0?{}:qe,Ue=Object(v.useMemo)(function(){return""},[Oe]);return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ue}}))},E=k("0Owb"),f=k("dejd"),d=k("C+DQ"),s=k("1vsH"),o=k("m3rI"),T=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function b(ue){var Ce=ue.onActionCallback,Oe=ue.title,Fe=ue.icon,tt=ue.actionName,Ve=ue.className,qe=Ve===void 0?"":Ve,Le=ue.children;function Ue(){Ce(tt)}return y.a.createElement("a",{title:Oe,className:qe,onClick:Ue},y.a.createElement("i",{className:"md-iconfont ".concat(Fe)}),Le)}var g=function(ue){var Ce=ue.watch,Oe=ue.showNullButton,Fe=ue.onActionCallback,tt=ue.fullScreen,Ve=ue.insertTemp,qe=ue.hidetoolBar,Le=ue.uuid,Ue=ue.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.G)("_educoder_session"),"&key=").concat(Le,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var we=[].concat(T,[{title:"".concat(Ce?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ce?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return y.a.createElement("ul",{className:"markdown-toolbar-container"},!qe&&we.map(function(ee,ce){return y.a.createElement("li",{key:ce},ee.actionName?y.a.createElement(b,Object(E.a)({},ee,{onActionCallback:Fe})):y.a.createElement("span",{className:"v-line"}))}),Oe?y.a.createElement("li",null,y.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Fe},y.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ve&&y.a.createElement("li",null,y.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ve),onActionCallback:Fe},y.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),y.a.createElement("li",{className:"btn-full-screen"},y.a.createElement(b,{icon:"".concat(tt?"icon-shrink":"icon-enlarge"),title:tt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Fe})))},P=k("M8RZ"),j=k("+L6B"),H=k("2/Rp"),X=k("y8nQ"),W=k("Vl3Y"),U=k("5NDa"),z=k("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},q=function(ue){var Ce=ue.callback,Oe=ue.onCancel;function Fe(tt){Ce(tt)}return y.a.createElement(W.a,Object(E.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Fe}),y.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},y.a.createElement(z.a,null)),y.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},y.a.createElement(z.a,null)),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(H.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},oe=k("7ahc"),ye=k("HmJG"),me=k("BjJ7"),fe=W.a.useForm,ve={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},ae=function(ue){var Ce=ue.callback,Oe=ue.onCancel,Fe=fe(),tt=Object(N.a)(Fe,1),Ve=tt[0];function qe(we){Ce(we)}function Le(we,ee){if(we.status===-1){M.b.error(we.message);return}Ve.setFieldsValue({src:"/api/attachments/".concat(we.id),type:ee.type})}function Ue(we){var ee=we.target.files[0];Te(ee,Le)}return y.a.createElement(W.a,Object(E.a)({form:Ve},ge,{className:"upload-image-panel",onFinish:qe}),y.a.createElement(W.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},y.a.createElement("div",{className:"flex-container"},y.a.createElement(W.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},y.a.createElement(z.a,{style:ve})),y.a.createElement(se,{onFileChange:Ue}))),y.a.createElement(W.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},y.a.createElement(z.a,{style:{width:264}})),y.a.createElement(W.a.Item,{style:{textAlign:"right"}},y.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(H.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))};function se(ue){var Ce=ue.onFileChange;return y.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",y.a.createElement("input",{type:"file",onChange:Ce}))}function Te(ue,Ce){if(!ue)throw new String("\u6CA1\u6709\u6587\u4EF6");var Oe=new FormData;Oe.append("editormd-image-file",ue),Oe.append("file_param_name","editormd-image-file"),Oe.append("byxhr","true");var Fe=new window.XMLHttpRequest;Fe.withCredentials=!0,Fe.addEventListener("load",function(tt){Ce(JSON.parse(tt.target.responseText),ue)},!1),Fe.addEventListener("error",function(tt){console.error(tt)},!1),Fe.open("POST","".concat(me.a,"/api/attachments.json")),Fe.send(Oe)}var We=k("giR+"),Je=k("fyUT"),Ye=k("7Kak"),Ze=k("9yH6"),ze=Ze.a.Group,Ke={margin:"0 8px"},$e=function(ue){var Ce=ue.callback,Oe=ue.onCancel;function Fe(tt){Ce(tt)}return y.a.createElement(W.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Fe},y.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},y.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),y.a.createElement("span",{style:Ke},"\u884C\u6570"),y.a.createElement(W.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},y.a.createElement(Je.a,null)),y.a.createElement("span",{style:Ke},"\u5217\u6570"),y.a.createElement(W.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},y.a.createElement(Je.a,null))),y.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},y.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),y.a.createElement(W.a.Item,{name:"align"},y.a.createElement(ze,null,y.a.createElement(Ze.a,{value:"default"},y.a.createElement("i",{className:"fa fa-align-justify"})),y.a.createElement(Ze.a,{value:"left"},y.a.createElement("i",{className:"fa fa-align-left"})),y.a.createElement(Ze.a,{value:"center"},y.a.createElement("i",{className:"fa fa-align-center"})),y.a.createElement(Ze.a,{value:"right"},y.a.createElement("i",{className:"fa fa-align-right"}))))),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(H.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},Qe=k("ErOA"),nt=k("7Cbv"),Xe="link",He="upload-image",st="code-block",ft="add-table",ot="------------",ut={default:ot,left:":".concat(ot),center:":".concat(ot,":"),right:"".concat(ot,":")},gt=k("9VGf"),ht,be;function pe(){}var ke=0,Ne=1e4,xe="\u2581",Re=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function de(ue){return/^\d+$/.test(ue)?"".concat(ue,"px"):ue}var re=navigator.platform.toUpperCase().indexOf("MAC")>=0,ne=re?"Cmd":"Ctrl",$=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Q=(ht={},Object(I.a)(ht,ne+"-B","bold"),Object(I.a)(ht,ne+"-I","italic"),ht),te=(be={},Object(I.a)(be,Xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(be,st,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(be,He,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(be,ft,"\u6DFB\u52A0\u8868\u683C"),be),ie=Ee.a=function(ue){var Ce=ue.defaultValue,Oe=Ce===void 0?"":Ce,Fe=ue.onChange,tt=ue.width,Ve=tt===void 0?"100%":tt,qe=ue.height,Le=qe===void 0?400:qe,Ue=ue.miniToolbar,we=Ue===void 0?!1:Ue,ee=ue.isFocus,ce=ee===void 0?!1:ee,je=ue.watch,De=ue.insertTemp,at=ue.mode,it=at===void 0?"markdown":at,Pe=ue.id,Be=Pe===void 0?"markdown-editor-id":Pe,dt=ue.showResizeBar,Bt=dt===void 0?!1:dt,Tt=ue.noStorage,gn=Tt===void 0?!1:Tt,bn=ue.showNullButton,ln=bn===void 0?!1:bn,bt=ue.hidetoolBar,Dn=bt===void 0?!1:bt,Gn=ue.fullScreen,Cn=Gn===void 0?!1:Gn,Gt=ue.onBlur,_n=ue.onCMBeforeChange,Bn=ue.onFullScreen,mr=ue.className,rt=mr===void 0?"":mr,ct=ue.disablePaste,qn=ct===void 0?!1:ct,Tr=ue.placeholder,pr=Tr===void 0?"":Tr,Ur=ue.values,Un=Ur===void 0?"":Ur,Rt=Object(v.useState)(null),Me=Object(N.a)(Rt,2),Se=Me[0],Lt=Me[1],Ht=Object(v.useState)(Oe),vn=Object(N.a)(Ht,2),cn=vn[0],rn=vn[1],zt=Object(v.useState)(je),At=Object(N.a)(zt,2),Mt=At[0],Ut=At[1],Pt=Object(v.useState)(Cn),qt=Object(N.a)(Pt,2),vt=qt[0],un=qt[1],Zt=Object(v.useState)(""),Ln=Object(N.a)(Zt,2),kt=Ln[0],Pn=Ln[1],kn=Object(v.useState)(0),wn=Object(N.a)(kn,2),En=wn[0],An=wn[1],nr=Object(v.useState)(Le),lr=Object(N.a)(nr,2),Xn=lr[0],Tn=lr[1],ur=Object(v.useState)(!1),dn=Object(N.a)(ur,2),fn=dn[0],hn=dn[1],Xt=Object(v.useRef)(Object(nt.a)()),Ct=Object(v.useRef)(!1),jt=Object(v.useRef)(),Et=Object(v.useRef)(),en=Object(v.useRef)(),Nt=Object(v.useRef)(),rr=Object(v.useRef)(),Mn=function(){var St=Object(_.a)(L.a.mark(function Wt(){var Dt,Vt;return L.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.next=2,Object(Qe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:Vt=yn.sent,Vt!=null&&(Dt=Vt.attachments)!==null&&Dt!==void 0&&Dt.length&&(console.log("cm:",Se,Et),Vt.attachments.map(function(tn){tn.content_type.indexOf("image")>-1?Se.replaceSelection(".concat(tn.content_type,")")):tn.content_type.indexOf("video")>-1?Se.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):tn.content_type.indexOf("pdf")>-1?Se.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(tn.id,"?type=").concat(tn.content_type,'&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Se.replaceSelection("[".concat(tn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(tn.id,"?type=").concat(tn.content_type,")"))}));case 4:case"end":return yn.stop()}},Wt)}));return function(){return St.apply(this,arguments)}}();Object(v.useEffect)(function(){rn(Un),Se==null||Se.setValue(Un)},[Un]),Object(v.useEffect)(function(){Bn==null||Bn(vt)},[vt]),Object(v.useEffect)(function(){if(Et.current){var St=S.a.fromTextArea(Et.current,{mode:it,lineNumbers:!we,lineWrapping:!0,value:Oe,autoCloseTags:!0,autoCloseBrackets:!0});ce&&St.focus();function Wt(Dt,Vt){if(qn){Vt.preventDefault();return}var $t=Vt.clipboardData;if($t){var yn=$t.types.toString(),tn=$t.items;if(yn==="Files"||$t.types.indexOf("Files")>-1){if(Vt.preventDefault(),it=="stex")return;try{var In,er=tn[1];((In=tn[0])===null||In===void 0?void 0:In.kind)==="file"&&(er=tn[0]);var Yt=er.getAsFile(),gr=Yt.name.split(".").pop();Te(Yt,function(mn){if(mn.id){var Vn,Yn,cr;(Yt==null||((Vn=Yt.type)===null||Vn===void 0)?void 0:Vn.indexOf("image"))>-1?St.replaceSelection(".concat(mn.content_type,")")):(Yt==null||((Yn=Yt.type)===null||Yn===void 0)?void 0:Yn.indexOf("video"))>-1?St.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(Yt==null||((cr=Yt.type)===null||cr===void 0)?void 0:cr.indexOf("pdf"))>-1?St.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(Yt.type,'&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):$.includes(gr)?St.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):St.replaceSelection("[".concat(Yt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(mn.content_type,")"))}else(mn==null?void 0:mn.status)===401&&(document.location.href="/user/login")})}catch(mn){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return St.on("paste",Wt),St.on("dragleave",function(Dt,Vt){en.current.classList.remove("mouse-hover-md")}),St.on("dragover",function(Dt,Vt){en.current.classList.add("mouse-hover-md")}),St.on("drop",function(Dt,Vt){en.current.classList.add("mouse-hover-md");var $t;if($t=Vt.dataTransfer.files,$t.length>0){Vt.preventDefault(),Vt.stopPropagation();for(var yn=function(er){var Yt=$t[er],gr=Yt.name.split(".").pop();Te(Yt,function(mn){if(mn.id){var Vn,Yn,cr;(Yt==null||((Vn=Yt.type)===null||Vn===void 0)?void 0:Vn.indexOf("image"))>-1?St.replaceSelection(".concat(mn.content_type,")")):(Yt==null||((Yn=Yt.type)===null||Yn===void 0)?void 0:Yn.indexOf("video"))>-1?St.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(Yt==null||((cr=Yt.type)===null||cr===void 0)?void 0:cr.indexOf("pdf"))>-1?St.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(Yt.type,'&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):$.includes(gr)?St.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):St.replaceSelection("[".concat(Yt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(mn.content_type,")"))}else(mn==null?void 0:mn.status)===401&&(document.location.href="/user/login")})},tn=0;tn<$t.length;tn++)yn(tn)}}),Lt(St),function(){St.off("paste",Wt)}}},[]);var dr=Object(v.useCallback)(function(){if(en.current)try{}catch(St){console.log(St,"---- to set md editor body height")}},[Xn,en,vt]);Object(v.useEffect)(function(){function St(){var Dt=new p.default(function(Vt){var $t=Object(D.a)(Vt),yn;try{for($t.s();!(yn=$t.n()).done;){var tn=yn.value;(tn.target.offsetHeight>0||tn.target.offsetWidth>0)&&(dr(),Se.setSize("100%","100%"),Se.refresh())}}catch(In){$t.e(In)}finally{$t.f()}});return Dt.observe(Et.current.parentElement),Dt}if(Se){var Wt=St();return function(){Wt.unobserve(Et.current.parentElement)}}},[Se,dr]),Object(v.useEffect)(function(){if(Se){for(var St=[],Wt=function(){var tn=Vt[Dt];$t=Object(N.a)(tn,2);var In=$t[0],er=$t[1],Yt=Object(I.a)({},In,function(){Zr(er)});St.push(Yt),Se.addKeyMap(Yt)},Dt=0,Vt=Object.entries(Q);Dt<Vt.length;Dt++){var $t;Wt()}return jt.current=setInterval(function(){Ct.current&&Mn()},4e3),function(){clearInterval(jt.current);var yn=Object(D.a)(St),tn;try{for(yn.s();!(tn=yn.n()).done;){var In=tn.value;Se.removeKeyMap(In)}}catch(er){yn.e(er)}finally{yn.f()}}}},[Se]),Object(v.useEffect)(function(){Cn!==vt&&un(Cn)},[Cn]),Object(gt.a)(function(){if(!gn&&En>0){var St=new Date().getTime(),Wt=window.sessionStorage.getItem(Be);St>=En+Ne&&(!Wt||Wt!==cn)&&(window.sessionStorage.setItem(Be,cn),hn(!0))}},Ne),Object(v.useEffect)(function(){Ut(je)},[Se,je]),Object(v.useEffect)(function(){Se&&(ce&&Se.focus())},[Se,ce]),Object(v.useEffect)(function(){if(Mt&&Se){var St=Se.getScrollerElement();function Wt(Dt){var Vt=Dt.target;if(rr.current){var $t=Vt.scrollTop/Vt.scrollHeight;rr.current.scrollTop=rr.current.scrollHeight*$t}}return St.addEventListener("scroll",Wt),function(){St.removeEventListener("scroll",Wt)}}},[Se,Mt]),Object(v.useEffect)(function(){if(Se&&_n){function St(Wt,Dt){_n(Wt,Dt)}return Se.on("beforeChange",St),function(){Se.off("beforeChange",St)}}},[Se,_n]),Object(v.useEffect)(function(){if(Se&&Gt){function St(){Gt(Se.getValue())}return Se.on("blur",St),function(){Se.off("blur",St)}}},[Se,Gt]),Object(v.useEffect)(function(){if(Se){function St(Wt){var Dt=Wt.getValue();rn(Dt),An(new Date().getTime()),Wt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Fe&&Fe(Dt)}return Se.on("change",St),function(){Se.off("change",St)}}},[Se,Fe]),Object(v.useEffect)(function(){Se&&(Oe==null?(Se.setValue(""),rn("")):Oe!==Se.getValue()&&(Se.setValue(Oe),rn(Oe),Se.setCursor(Se.lineCount(),0)))},[Se,Oe]);var Zr=Object(v.useCallback)(function(St){var Wt=Se.getCursor(),Dt=Se.getSelection(),Vt=Dt.split(`
|
|
`);switch(St){case"bold":return Se.replaceSelection("**"+Dt+"**"),Dt===""&&Se.setCursor(Wt.line,Wt.ch+2),Se.focus();case"italic":return Se.replaceSelection("*"+Dt+"*"),Dt===""&&Se.setCursor(Wt.line,Wt.ch+1),Se.focus();case"code":return Se.replaceSelection("`"+Dt+"`"),Dt===""&&Se.setCursor(Wt.line,Wt.ch+1),Se.focus();case"inline-latex":return Se.replaceSelection("`$$"+Dt+"$$`"),Dt===""&&Se.setCursor(Wt.line,Wt.ch+3),Se.focus();case"latex":return Se.replaceSelection("```latex\n"+Dt+"\n```"),Se.setCursor(Wt.line+1,Dt.length+1),Se.focus();case"line-break":return Se.replaceSelection(`<br/>
|
|
`),Se.focus();case"list-ul":return Dt===""?Se.replaceSelection("- "+Dt):Se.replaceSelection(Vt.map(function($t){return $t===""?"":"- ".concat($t)}).join(`
|
|
`)),Se.focus();case"list-ol":return Dt===""?Se.replaceSelection("1. "+Dt):Se.replaceSelection(Vt.map(function($t,yn){return $t===""?"":"".concat(yn+1,". ").concat($t)}).join(`
|
|
`)),Se.focus();case"add-null-ch":return Dt===""&&Se.setCursor(Wt.line,Wt.ch+1),Se.replaceSelection(xe),Se.focus();case"inster-template-1":return Dt===""&&Se.setCursor(Wt.line,Wt.ch),Se.replaceSelection(Re),Se.focus();case"eraser":return Se.setValue(""),Se.focus();case"trigger-watch":return Ut(!Mt),Se.focus();case"trigger-full-screen":return un(!vt),Se.focus();case Xe:Pn(Xe);return;case st:Pn(st);return;case He:Pn(He);return;case ft:Pn(ft);return;default:throw new Error}},[Se,Mt,vt]),Pr=Object(v.useCallback)(function(St){Pn("");switch(kt){case Xe:var Wt=St.title,Dt=St.link;return Se.replaceSelection("[".concat(Wt,"](").concat(Dt,")")),Se.focus();case st:var Vt=St.language,$t=St.content;return Se.replaceSelection(["```"+Vt,$t,"```"].join(`
|
|
`)),Se.focus();case He:var yn=St.src,tn=St.alt;return tn?Se.replaceSelection(".concat(yn,' "').concat(tn,'" )')):Se.replaceSelection("")),Se.focus();case ft:for(var In=St.row,er=St.col,Yt=St.align,gr=`
|
|
`,mn=0;mn<In;mn++){for(var Vn=[],Yn=[],cr=0;cr<er;cr++)mn===1&&Yn.push(ut[Yt]),Vn.push(" ");mn===1&&(gr+="| ".concat(Yn.join(" | "),` |
|
|
`)),gr+="| ".concat(Vn.join(er===1?"":" | "),` |
|
|
`)}return Se.replaceSelection(gr+`
|
|
`),Se.focus();default:throw new Error}},[Se,kt]),zr=Object(v.useMemo)(function(){switch(kt){case Xe:return y.a.createElement(q,{callback:Pr,onCancel:Mr});case st:return y.a.createElement(oe.b,{callback:Pr,onCancel:Mr});case He:return y.a.createElement(ae,{callback:Pr,onCancel:Mr});case ft:return y.a.createElement($e,{callback:Pr,onCancel:Mr});default:return null}},[kt]);function Mr(){Pn("")}Object(v.useEffect)(function(){if(Nt.current){var St=Nt.current,Wt=!1,Dt=0;function Vt(tn){Wt=!0,Dt=tn.pageY}function $t(){Wt=!1}function yn(tn){if(Wt){var In=tn.pageY-Dt;In<0&&(In=0),In>300&&(In=300);var er=Le+In+"px";Tn(er)}}return St.addEventListener("mousedown",Vt),document.addEventListener("mousemove",yn),document.addEventListener("mouseup",$t),function(){St.removeEventListener("mousedown",Vt),document.removeEventListener("mousemove",yn),document.removeEventListener("mouseup",$t)}}},[Se,Nt]),Object(v.useEffect)(function(){Tn(Le)},[Le]);var Sr=de(Ve),Br=de(Xn),jn={width:Sr,height:Br},Ot=Object(v.useMemo)(function(){if(En){var St=new Date(En),Wt=St.getHours(),Dt=St.getMinutes(),Vt=St.getSeconds();return Wt=Wt<10?"0"+Wt:Wt,Dt=Dt<10?"0"+Dt:Dt,Vt=Vt<10?"0"+Vt:Vt,"".concat(Wt,":").concat(Dt,":").concat(Vt)}return 0},[En]);function Gr(){window.sessionStorage.removeItem(Be),hn(!1),An(0)}function vr(){hn(!1),An(0),Se.setValue(window.sessionStorage.getItem(Be))}function na(St,Wt){var Dt=Se.getValue();Dt=Dt.replace(St,Wt),rn(Dt),Se==null||Se.setValue(Dt)}return y.a.createElement(v.Fragment,null,y.a.createElement("div",{className:"markdown-editor-wrapper",ref:en},y.a.createElement("div",{className:"markdown-editor-container ".concat(rt," ").concat(Mt?"on-preview":""," ").concat(we?"mini":""," ").concat(vt?"full-screen":""),style:jn},y.a.createElement(g,{insertTemp:De,watch:Mt,fullScreen:vt,showNullButton:ln,onActionCallback:Zr,hidetoolBar:Dn,uuid:Xt.current,setOpenPhones:function(){Ct.current=!0}}),y.a.createElement("div",{className:"markdown-editor-body"},y.a.createElement("div",{className:"codemirror-container"},y.a.createElement("textarea",{ref:Et,placeholder:pr})),Mt?y.a.createElement("div",{ref:rr,className:"preview-container"},it==="stex"&&y.a.createElement(w,{value:cn}),it!=="stex"&&y.a.createElement(h.a,{edit:!0,value:cn,replaces:na})):null))),Bt?y.a.createElement("a",{ref:Nt,className:"editor-resize"}):null,y.a.createElement(P.a,null,te[kt]?y.a.createElement(B.a,{centered:!0,title:te[kt],visible:!0,onCancel:Mr,footer:null,className:"markdown-popup-form"},zr):null))}},PD8m:function(Ie,Ee){Ie.exports={name:"memoryStorage",read:V,write:B,each:D,remove:F,clearAll:M};var k={};function V(_){return k[_]}function B(_,N){k[_]=N}function D(_){for(var N in k)k.hasOwnProperty(N)&&_(k[N],N)}function F(_){delete k[_]}function M(_){k={}}},QUZ3:function(Ie,Ee,k){"use strict";k.r(Ee);var V=k("0Owb"),B=k("PpiC"),D=k("OaEy"),F=k("2fM7"),M=k("T2oS"),_=k("W9HT"),N=k("+L6B"),I=k("2/Rp"),A=k("9og8"),L=k("2qtc"),v=k("kLXV"),y=k("tJVT"),O=k("k1fw"),S=k("aHsQ"),p=k("sGsY"),m=k("WmNS"),l=k.n(m),i=k("cDcd"),a=k.n(i),c=k("Icgb"),C=k("Fvcw"),x=k("GIiI"),h=k("Ty5D"),w=k("55Ip"),E=k("OJz4"),f=k("V0Rq"),d=k("bntm"),s=k("cDPC"),o=k("m3rI"),T=k("RCxd"),b=k("EHPI"),g=k("S+dL"),P=k.n(g),j=k("J66h"),H=k("uMZB"),X=k.n(H),W=k("p/48"),U=k("JPnl"),z=k("y8nQ"),Z=k("Vl3Y"),q=k("5NDa"),oe=k("5rEg"),ye=oe.a.TextArea,me=5e3,fe=function(Me){var Se=Me.callback,Lt=Me.onCancel,Ht=Me.notes;function vn(cn){Se(cn)}return a.a.createElement(Z.a,{className:"note-form-panel",onFinish:vn,initialValues:{notes:Ht}},a.a.createElement(Z.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:me,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(me)}]},a.a.createElement(ye,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),a.a.createElement(Z.a.Item,{style:{textAlign:"right"}},a.a.createElement(I.a,{type:"ghost",onClick:Lt,style:{marginRight:10}}," \u53D6\u6D88 "),a.a.createElement(I.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},ve=k("bbsP"),ge=k("/wGt"),ae=k("DjyN"),se=k("NUBc"),Te=k("H2Ag"),We=k.n(Te),Je=k("miYZ"),Ye=k("tsqr"),Ze=k("g9YV"),ze=k("wCAj"),Ke=k("+k/U"),$e=k.n(Ke),Qe=k("ye1Q"),nt=k("lfch"),Xe=k("JB8y"),He=k("p5ED"),st=k("ErOA"),ft=k("wd/R"),ot=k.n(ft),ut=ze.a.Column,gt=function(Me){var Se,Lt=Me.submitResult,Ht=Me.submitting,vn=Me.submitRecords,cn=Me.page,rn=Me.onPageChange,zt=Me.topicId,At=Lt||{},Mt=At.status,Ut=At.id,Pt=At.input,qt=At.output,vt=At.expected_output,un=At.is_file,Zt=At.input_file_url,Ln=At.output_file_url,kt=At.expected_output_file_url,Pn=At.error_msg,kn=vn||{},wn=kn.records,En=kn.records_count,An=Object(i.useState)(""),nr=Object(y.a)(An,2),lr=nr[0],Xn=nr[1],Tn=Object(i.useState)(""),ur=Object(y.a)(Tn,2),dn=ur[0],fn=ur[1],hn=Object(h.h)(),Xt=(hn==null||((Se=hn.query)===null||Se===void 0)?void 0:Se.type)==="1";function Ct(){un?navigator.clipboard.writeText(j.Base64.decode(Pn)).then(function(){Ye.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(j.Base64.decode(qt)).then(function(){Ye.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return a.a.createElement(_.a,{spinning:Ht,tip:"\u8BC4\u6D4B\u4E2D...",indicator:a.a.createElement(Qe.a,{style:{fontSize:24},spin:!0})},Ut?a.a.createElement(a.a.Fragment,null,a.a.createElement("ul",{className:$e.a.info},a.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",a.a.createElement("span",{className:Mt===Xe.a.OK?"c-green":"c-red"},U.a[Mt])),a.a.createElement("li",{className:$e.a.error},a.a.createElement("a",{onClick:Ct},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",a.a.createElement(nt.a,null)," ")),a.a.createElement("li",null,a.a.createElement(w.a,{to:"/myproblems/".concat(zt,"/record-detail/").concat(Ut)},"\u663E\u793A\u8BE6\u60C5 >"," "))),Mt!==Xe.a.OK?a.a.createElement(a.a.Fragment,null,a.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),a.a.createElement("pre",null,!un&&Pt,un&&a.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(A.a)(l.a.mark(function jt(){var Et;return l.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(Zt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Et=Nt.sent,Nt.t0=fn,Nt.next=6,Et.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Xn(Zt)},200);case 9:case"end":return Nt.stop()}},jt)}))},Pt)),a.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),a.a.createElement("pre",null,(Mt===4||Mt===5)&&j.Base64.decode(Pn),Mt!=4&&Mt!=5&&(un?a.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(A.a)(l.a.mark(function jt(){var Et;return l.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(st.a)(Ln,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:Et=Nt.sent;try{fn(Et)}catch(rr){fn("")}setTimeout(function(){Xn(Ln)},200);case 5:case"end":return Nt.stop()}},jt)}))},qt):j.Base64.decode(qt))),a.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),a.a.createElement("pre",null,!un&&j.Base64.decode(vt),un&&a.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(A.a)(l.a.mark(function jt(){var Et;return l.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(kt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Et=Nt.sent,Nt.t0=fn,Nt.next=6,Et.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Xn(kt)},200);case 9:case"end":return Nt.stop()}},jt)}))},vt))):null):null,(wn==null?void 0:wn.length)>0?a.a.createElement(ze.a,{dataSource:wn,rowKey:"id",pagination:!1},a.a.createElement(ut,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(Et,en){return a.a.createElement("span",null," ",ot()(Et).format("YYYY-MM-DD HH:mm:ss"))}}),a.a.createElement(ut,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(Et,en){var Nt;return a.a.createElement(w.a,{className:Et===0?"c-green":"c-red",to:"/myproblems/".concat(zt,"/record-detail/").concat(en.id)},(Nt=U.a[Et])===null||Nt===void 0?void 0:Nt.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),a.a.createElement(ut,{title:"\u6267\u884C\u7528\u65F6 (".concat(Xt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(Et){return Et?Xt?Et:Et/1e3:""}}),a.a.createElement(ut,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(Xt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(Et){return Et?Xt?Et:parseFloat((Et/1024).toFixed(2)):""}}),a.a.createElement(ut,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),a.a.createElement(ut,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(Et,en){return a.a.createElement(w.a,{className:"c-light-primary",to:"/myproblems/".concat(zt,"/record-detail/").concat(en.id)},"\u67E5\u770B")}})):a.a.createElement("div",{style:{height:300,width:"100%"}}),En>15?a.a.createElement(se.a,{className:$e.a.pagination,current:cn,pageSize:15,total:En,onChange:rn}):null,a.a.createElement(He.a,{close:!0,data:lr,type:lr.length?"txt":"",onClose:function(){return Xn("")},monacoEditor:{value:dn,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}}))},ht=k("BdwD"),be=k("DYRE"),pe=k("zeV3"),ke=k("+BJd"),Ne=k("mr32"),xe=k("pPuO"),Re=k.n(xe),de=k("9Bee"),re={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ne=function(Me){var Se=Me.hack,Lt=Me.onTriggerPraise,Ht=Me.toDiscuss,vn=Se.language,cn=Se.difficult,rn=Se.time_limit,zt=Se.username,At=Se.user_path,Mt=Se.user_praise,Ut=Se.comments_count,Pt=Se.praises_count,qt=Se.description,vt=Se.pass_count,un=Se.submit_count,Zt=Object(h.h)(),Ln=re[cn];return a.a.createElement(a.a.Fragment,null,a.a.createElement("ul",{className:Re.a.info},a.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",a.a.createElement("b",null,vn)),a.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",a.a.createElement(Ne.a,{color:Ln.color},Ln.name)),a.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",a.a.createElement("b",null,rn,"\u79D2"))),a.a.createElement(de.a,{value:qt,className:Re.a.desc}),a.a.createElement("ul",{className:Re.a["commit-info"]},a.a.createElement("li",null,a.a.createElement(pe.a,{size:4},a.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",a.a.createElement("b",null,vt))),a.a.createElement("li",null,a.a.createElement(pe.a,{size:4},a.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",a.a.createElement("b",null,un))," "),a.a.createElement("li",{style:{flex:"1 0 0"}}),Zt.query.type!=="exercises"&&a.a.createElement("li",null,a.a.createElement(pe.a,{size:4},a.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Ht})," ",a.a.createElement("b",null,Ut))," ")))},$=k("dhSg"),Q=k("oBTY"),te=k("M8RZ"),ie=k("qJ4+");function ue(Me,Se){return Object(st.c)("/problems/".concat(Me,"/comments.json?page=").concat(Se,"&limit=10"))}function Ce(Me){return Object(st.f)("/discusses/".concat(Me,"/plus.json"),{container_type:"Discuss",type:1})}function Oe(Me,Se,Lt){return Object(st.f)("/problems/".concat(Me,"/comments/reply.json"),{comments:{content:Lt,parent_id:Se}})}function Fe(Me,Se){return Object(st.f)("/problems/".concat(Me,"/comments.json"),{comments:{content:Se}})}function tt(Me,Se,Lt){return Object(st.f)("/problems/".concat(Me,"/comments/").concat(Se,"/hidden.json"),Lt)}function Ve(Me,Se){return Object(st.b)("/problems/".concat(Me,"/comments/").concat(Se))}var qe=k("U7T7"),Le=k("AMnG");function Ue(Me){var Se=Me.author;return a.a.createElement("a",{href:"/users/".concat(Se.login),target:"_blank"},a.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(o.a.IMG_SERVER,"/images/").concat(Se.image_url),width:"50"}))}function we(Me){var Se=Me.data,Lt=Me.index,Ht=Me.parentDiscussIndex,vn=Me.user,cn=Me.onSetActionType,rn=Se.author,zt=Se.can_delete,At=Se.content,Mt=Se.id,Ut=Se.time;function Pt(){cn({id:Mt,index:Lt,type:"delete-discuss",parentDiscussIndex:Ht,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var qt=vn.admin||zt||rn.user_id===vn.user_id;return a.a.createElement("div",{className:"discuss-item-container second-discuss "},a.a.createElement(Ue,{author:rn}),a.a.createElement("section",null,a.a.createElement("div",{className:"discuss-info"},a.a.createElement("a",{href:"/users/".concat(rn.login),target:"_blank"},rn.name),a.a.createElement("span",{className:"grey"},Ut),a.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},qt?a.a.createElement("a",{onClick:Pt,title:"\u5220\u9664"},a.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),a.a.createElement(de.a,{className:"discuss-content",value:At})))}var ee=function(Me){var Se=Me.user,Lt=Me.data,Ht=Me.index,vn=Me.onPlusDiscuss,cn=Me.onSetActionType,rn=Me.activeDiscussIndex,zt=Me.onReplyDiscuss,At=Me.onSetActiveDiscussIndex,Mt=Lt.content,Ut=Lt.children,Pt=Lt.hidden,qt=Lt.id,vt=Lt.praise_count,un=Lt.time,Zt=Lt.user_praise,Ln=Lt.can_delete,kt=Lt.author;function Pn(){At(qt)}function kn(){vn(qt,!Zt,Ht)}function wn(){cn({id:qt,index:Ht,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function En(){cn({id:qt,index:Ht,params:{hidden:Pt?"0":"1"},type:"hidden-discuss",message:Pt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var An=Se.admin||Se.user_id===kt.user_id;return a.a.createElement("div",{className:"discuss-item-container",key:qt},a.a.createElement(Ue,{author:kt}),a.a.createElement("section",null,a.a.createElement("div",{className:"discuss-info"},a.a.createElement("a",{href:"/users/".concat(kt.login),target:"_blank"}," ",kt.name," "),a.a.createElement("span",{className:"grey"},un)),a.a.createElement(de.a,{className:"discuss-content",value:Mt}),Ut&&Ut.length>0?a.a.createElement("div",{className:"reply-discuss-container"},Ut.map(function(nr,lr){return a.a.createElement(we,{key:nr.id,data:nr,index:lr,user:Se,onSetActionType:cn,parentDiscussIndex:Ht})})):null,a.a.createElement("div",{className:"btn-group"},An?a.a.createElement("a",{onClick:En,title:Pt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},a.a.createElement("i",{className:Pt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Ln&&(!Ut||Ut.length==0)?a.a.createElement("a",{onClick:wn,title:"\u5220\u9664"},a.a.createElement("i",{className:"iconfont icon-shanchu"})):null,a.a.createElement("a",{onClick:Pn,title:"\u56DE\u590D"}," ",a.a.createElement("i",{className:"iconfont icon-huifu1"})," "),a.a.createElement("a",{onClick:kn,className:Zt?"c-orange":""},a.a.createElement("i",{className:Zt?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),a.a.createElement("span",null,vt||""))),a.a.createElement(Le.a,{id:qt,activeDiscussIndex:rn,onReplyDiscuss:zt})))},ce=k("kaH+"),je=k("uD2n"),De=k.n(je),at=k("Ot1p"),it=function(Me){var Se=Me.user_praise,Lt=Me.praise_count,Ht=Me.praisePlus,vn=Me.onCreateDiscuss,cn=Me.discuss_count,rn=Object(i.useState)(!1),zt=Object(y.a)(rn,2),At=zt[0],Mt=zt[1],Ut=Object(i.useState)(""),Pt=Object(y.a)(Ut,2),qt=Pt[0],vt=Pt[1];function un(kn){vt(kn)}function Zt(){Mt(!0)}function Ln(){Mt(!1)}function kt(){return Pn.apply(this,arguments)}function Pn(){return Pn=Object(A.a)(l.a.mark(function kn(){return l.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:vn(qt),vt(""),Mt(!1);case 3:case"end":return En.stop()}},kn)})),Pn.apply(this,arguments)}return a.a.createElement("div",{className:"".concat(De.a["dis-input-editor-container"]," ").concat(At?De.a.active:""," ")},a.a.createElement("div",{className:At?"hide ".concat(De.a["text-area"]):De.a["text-area"]},a.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Zt}),a.a.createElement("a",null," ",a.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",cn," "),a.a.createElement("a",{className:"c-light-black",onClick:Ht,title:Se?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},a.a.createElement("i",{className:"mr3 ".concat(Se?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Lt?a.a.createElement("span",null,Lt):"")),At?a.a.createElement("div",{className:De.a["input-mask"],onClick:Ln}):null,a.a.createElement("div",{className:At?De.a["md-container"]:"".concat(De.a["md-container"]," hide")},a.a.createElement(at.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:qt,height:240,onChange:un}),a.a.createElement("div",{className:De.a["tip-container"],onClick:Ln},a.a.createElement("a",{className:De.a["btn-send"],onClick:kt}," \u53D1\u9001 "))))},Pe={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Be;(function(Me){Me[Me.GET_DISCUSSES=0]="GET_DISCUSSES",Me[Me.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Me[Me.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Me[Me.PLUS_DISCUSS=3]="PLUS_DISCUSS",Me[Me.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Me[Me.SET_PAGE=5]="SET_PAGE",Me[Me.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Be||(Be={}));function dt(Me,Se){switch(Se.type){case Be.SHOW_DISCUSSES_LOADING:return Object(O.a)(Object(O.a)({},Me),{},{loading:!0});case Be.GET_DISCUSSES:return Object(O.a)(Object(O.a)({},Me),Se.payload);case Be.TOP_OR_DOWN_DISCUSS:return Object(O.a)(Object(O.a)({},Me),Se.payload);case Be.SET_ACTION_TYPE:return Object(O.a)(Object(O.a)({},Me),Se.payload);case Be.PLUS_DISCUSS:return Object(O.a)(Object(O.a)({},Me),Se.payload);case Be.SET_PAGE:return Object(O.a)(Object(O.a)({},Me),{},{page:Se.payload});case Be.ACTIVE_DISCUSS_INDEX:return Object(O.a)(Object(O.a)({},Me),Se.payload);default:throw new Error}}var Bt=function(Me){var Se=Me.user,Lt=Me.identifier,Ht=Me.hack,vn=Me.onTriggerPraise,cn=Object(i.useReducer)(dt,Pe),rn=Object(y.a)(cn,2),zt=rn[0],At=rn[1],Mt=zt.loading,Ut=zt.page,Pt=zt.data,qt=zt.count,vt=zt.actionType,un=zt.activeDiscussIndex,Zt=Object(i.useCallback)(Object(A.a)(l.a.mark(function dn(){var fn,hn,Xt;return l.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return At({type:Be.SHOW_DISCUSSES_LOADING}),jt.next=3,ue(Lt,Ut);case 3:fn=jt.sent,hn=fn.comments,Xt=fn.disscuss_count,At({type:Be.GET_DISCUSSES,payload:{data:hn,count:Xt,loading:!1}});case 6:case"end":return jt.stop()}},dn)})),[Ut,Lt]);Object(i.useEffect)(function(){Zt()},[Lt,Ut]);function Ln(dn){At({type:Be.SET_PAGE,page:dn})}function kt(dn){At({type:Be.SET_ACTION_TYPE,payload:{actionType:dn}})}function Pn(dn){un===dn?At({type:Be.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):At({type:Be.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:dn}})}function kn(dn,fn,hn){return wn.apply(this,arguments)}function wn(){return wn=Object(A.a)(l.a.mark(function dn(fn,hn,Xt){var Ct;return l.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.prev=0,Et.next=3,Ce(fn);case 3:Ct=Et.sent,Pt[Xt].user_praise=hn,Pt[Xt].praise_count=Ct.praise_count,At({type:Be.PLUS_DISCUSS,payload:{data:Object(Q.a)(Pt)}}),Et.next=12;break;case 9:Et.prev=9,Et.t0=Et.catch(0),console.log(Et.t0);case 12:case"end":return Et.stop()}},dn,null,[[0,9]])})),wn.apply(this,arguments)}function En(){return An.apply(this,arguments)}function An(){return An=Object(A.a)(l.a.mark(function dn(){var fn,hn,Xt,Ct,jt,Et,en,Nt;return l.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(fn=vt.id,hn=vt.params,Xt=vt.type,Ct=vt.index,jt=vt.parentDiscussIndex,!(Xt==="hidden-discuss")){Mn.next=6;break}return Mn.next=4,tt(Lt,fn,hn);case 4:jt?Pt[jt].children[Ct].hidden=hn.hidden==1:Pt[Ct].hidden=hn.hidden==1,At({type:Be.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Q.a)(Pt)}});case 6:if(!(Xt==="delete-discuss")){Mn.next=31;break}return Mn.next=9,Ve(Lt,fn);case 9:if(!(jt||jt===0)){Mn.next=22;break}Et=Pt[jt].children,en=Et.length-1;case 12:if(!(en>=0)){Mn.next=19;break}if(!(Et[en].id===fn)){Mn.next=16;break}return Et.splice(en,1),Mn.abrupt("break",19);case 16:en--,Mn.next=12;break;case 19:Pt[jt].children=Et,Mn.next=30;break;case 22:Nt=Pt.length-1;case 23:if(!(Nt>=0)){Mn.next=30;break}if(!(Pt[Nt].id===fn)){Mn.next=27;break}return Pt.splice(Nt,1),Mn.abrupt("break",30);case 27:Nt--,Mn.next=23;break;case 30:At({type:Be.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Q.a)(Pt)}});case 31:case"end":return Mn.stop()}},dn)})),An.apply(this,arguments)}function nr(){At({type:Be.SET_ACTION_TYPE,payload:{actionType:null}})}function lr(dn,fn){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(A.a)(l.a.mark(function dn(fn,hn){return l.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.prev=0,Ct.next=3,Oe(Lt,fn,hn);case 3:Zt(),Ct.next=9;break;case 6:Ct.prev=6,Ct.t0=Ct.catch(0),console.log(Ct.t0);case 9:case"end":return Ct.stop()}},dn,null,[[0,6]])})),Xn.apply(this,arguments)}function Tn(dn){return ur.apply(this,arguments)}function ur(){return ur=Object(A.a)(l.a.mark(function dn(fn){return l.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return At({type:Be.SHOW_DISCUSSES_LOADING}),Xt.next=3,Fe(Lt,fn);case 3:Zt();case 4:case"end":return Xt.stop()}},dn)})),ur.apply(this,arguments)}return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"discuss-panel"},Pt.length===0?a.a.createElement(ht.a,null):Pt.map(function(dn,fn){return a.a.createElement(ee,{onReplyDiscuss:lr,onPlusDiscuss:kn,onSetActiveDiscussIndex:Pn,onSetActionType:kt,data:dn,index:fn,user:Se,activeDiscussIndex:un})}),qt>10?a.a.createElement("div",{className:"pagination-container"},a.a.createElement(se.a,{showQuickJumper:!0,onChange:Ln,current:Ut,total:qt})):null),a.a.createElement(it,{user_praise:Ht.user_praise,praise_count:Ht.praises_count,praisePlus:vn,discuss_count:Ht.comments_count,onCreateDiscuss:Tn}),a.a.createElement(te.a,null,a.a.createElement(v.a,{centered:!0,title:"\u63D0\u793A",visible:!!vt,onOk:En,onCancel:nr},a.a.createElement("p",null,vt?vt.message:"")),a.a.createElement(ce.a,null)))},Tt=k("9kvl"),gn={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},bn={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},ln=function(Me){var Se,Lt=Me.hack,Ht=Me.onTriggerPraise,vn=Me.topicId,cn=Me.page,rn=Me.onPageChange,zt=Me.user,At=Me.submitRecords,Mt=Me.submitting,Ut=Me.submitResult,Pt=Object(i.useState)("0"),qt=Object(y.a)(Pt,2),vt=qt[0],un=qt[1],Zt=Object(h.h)(),Ln=Object(i.useState)(!1),kt=Object(y.a)(Ln,2),Pn=kt[0],kn=kt[1],wn=Object(i.useState)([]),En=Object(y.a)(wn,2),An=En[0],nr=En[1],lr=Object(i.useState)(Object(O.a)(Object(O.a)({},Object(h.i)()),{},{page:1,per_page:20,name:""})),Xn=Object(y.a)(lr,2),Tn=Xn[0],ur=Xn[1];function dn(Ct){var jt=Ct.target.id;un(jt)}Object(i.useEffect)(function(){var Ct=$.a.subscribe("to-commit-info",function(){un("1")});return Ct},[]);function fn(){un("2")}function hn(){return Xt.apply(this,arguments)}function Xt(){return Xt=Object(A.a)(l.a.mark(function Ct(){var jt;return l.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(st.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(O.a)({identifier:Tn==null?void 0:Tn.id},Tn)});case 2:jt=en.sent,nr(jt);case 4:case"end":return en.stop()}},Ct)})),Xt.apply(this,arguments)}return console.log(At,"submitRecords"),a.a.createElement("div",{className:We.a["left-panel"]},a.a.createElement("ul",{className:"".concat(We.a["s-navs"]," ").concat(We.a["bg-white"]," ").concat(We.a.b1)},a.a.createElement("li",null,a.a.createElement("a",{className:vt==="0"?We.a.active:"",id:"0",onClick:dn},"\u4EFB\u52A1\u63CF\u8FF0")),a.a.createElement("li",null,a.a.createElement("a",{className:vt==="1"?We.a.active:"",id:"1",onClick:dn},"\u63D0\u4EA4\u8BB0\u5F55")),Zt.query.type!=="exercises"&&a.a.createElement("li",null,a.a.createElement("a",{className:vt==="2"?We.a.active:"",id:"2",onClick:dn},"\u8BC4\u8BBA"))),a.a.createElement("div",{className:"".concat(We.a["tab-panel-body"]," ").concat(vt==="0"?"":"hide")},a.a.createElement(ne,{hack:Lt,onTriggerPraise:Ht,toDiscuss:fn})),a.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(We.a["tab-panel-body"]," ").concat(vt==="1"?"":"hide")},!!(At!=null&&At.records_count)||Mt?a.a.createElement(gt,{page:cn,onPageChange:rn,topicId:vn,submitting:Mt,submitRecords:At,submitResult:Ut}):a.a.createElement(ht.a,null)),a.a.createElement("div",{className:"".concat(We.a["tab-panel-body"]," ").concat(vt==="2"?"":"hide"),style:{padding:0}},a.a.createElement(Bt,{user:zt,identifier:Lt.identifier,hack:Lt,onTriggerPraise:Ht})),a.a.createElement(ge.a,{className:We.a.drawer,headerStyle:{background:"#000",border:0},closable:!1,title:a.a.createElement("div",{style:{display:"flex",alignItems:"center"}},a.a.createElement("span",{style:{color:"#fff"}},"\u9898\u76EE\u5217\u8868"),a.a.createElement(oe.a.Search,{onSearch:function(jt){Tn.name=jt,Tn.page=1,ur(Object(O.a)({},Tn)),hn()},style:{width:180,margin:"0px 20px",marginLeft:"auto"},placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22"}),a.a.createElement(F.a,{style:{width:100},placeholder:"\u8BF7\u9009\u62E9\u96BE\u5EA6",onChange:function(jt){Tn.page=1,Tn.difficult=jt||null,ur(Object(O.a)({},Tn)),hn()}},a.a.createElement(F.a.Option,{value:0},"\u5168\u90E8"),a.a.createElement(F.a.Option,{value:1},"\u7B80\u5355"),a.a.createElement(F.a.Option,{value:2},"\u9002\u4E2D"),a.a.createElement(F.a.Option,{value:3},"\u56F0\u96BE"))),bodyStyle:{background:"#0f1e31",padding:"20px 0px"},footerStyle:{background:"#0f1e31",border:0,textAlign:"center"},footer:a.a.createElement("div",null,a.a.createElement(se.a,{current:Tn.page,className:"mt10 mb10",hideOnSinglePage:!0,total:An==null?void 0:An.count,pageSize:Tn.per_page,onChange:function(jt,Et){Tn.page=jt,Tn.per_page=Et,hn()}})),width:530,placement:"left",onClose:function(){return kn(!1)},visible:Pn},An==null||((Se=An.data)===null||Se===void 0)?void 0:Se.map(function(Ct,jt){return a.a.createElement("div",{onClick:Object(A.a)(l.a.mark(function Et(){var en;return l.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return rr.next=2,Object(st.a)("/api/problems/".concat(Ct==null?void 0:Ct.identifier,"/start.json"),{method:"get",params:{hack_user_id:zt==null?void 0:zt.user_id}});case 2:en=rr.sent,en&&(Tt.d.replace("/myproblems/".concat(en==null?void 0:en.identifier,"?type=1")),window.location.reload());case 4:case"end":return rr.stop()}},Et)})),className:"".concat(We.a.list," ").concat(Ct!=null&&Ct.checked?We.a.active:"")},a.a.createElement("div",null,(Ct==null?void 0:Ct.opened)&&(Ct==null?void 0:Ct.passed)&&a.a.createElement("i",{className:"iconfont icon-wancheng1 c-green-29b"}),(Ct==null?void 0:Ct.opened)&&!(Ct!=null&&Ct.passed)&&a.a.createElement("i",{className:"iconfont icon-cuowu c-red"}),a.a.createElement("span",{style:{color:"rgb(186, 196, 205)",fontWeight:400,fontSize:14,marginLeft:10}},Ct.name)),a.a.createElement("span",{style:{color:bn[Ct.difficult]}},gn[Ct.difficult]))})),(Lt==null?void 0:Lt.is_program)&&a.a.createElement("div",{onClick:function(){hn(),kn(!0)},className:We.a.btns},a.a.createElement("i",{className:"iconfont icon-timuliebiao"}),a.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},bt=k("oFv4"),Dn=k.n(bt),Gn=k("+aKw"),Cn=k("S/kP"),Gt=k.n(Cn),_n=k("t/PP"),Bn=k.n(_n),mr=p.a.Countdown,rt={Java:"java",C:"c",Python:"py","C++":"c"},ct;(function(Me){Me[Me.SET_LOADING=0]="SET_LOADING",Me[Me.GET_DATA=1]="GET_DATA",Me[Me.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",Me[Me.SET_DATA=3]="SET_DATA",Me[Me.SET_DEBUGING=4]="SET_DEBUGING",Me[Me.SET_SUBMITING=5]="SET_SUBMITING",Me[Me.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",Me[Me.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",Me[Me.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",Me[Me.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",Me[Me.SET_PAGE=10]="SET_PAGE"})(ct||(ct={}));function qn(){return new Date().getTime()}var Tr={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function pr(Me,Se){switch(Se.type){case ct.GET_DATA:return Object(O.a)(Object(O.a)({},Me),Se.payload);case ct.SET_DATA:return Object(O.a)(Object(O.a)({},Me),{},{data:Se.payload});case ct.SET_LOADING:return Object(O.a)(Object(O.a)({},Me),{},{loading:Se.payload});case ct.SET_SHOW_NOTE:return Object(O.a)(Object(O.a)({},Me),{},{showNote:Se.payload});case ct.SET_DEBUGING:return Object(O.a)(Object(O.a)({},Me),{},{debuging:Se.payload});case ct.SET_SUBMITING:return Object(O.a)(Object(O.a)({},Me),{},{submitting:Se.payload});case ct.GET_SUBMIT_RECORDS:return Object(O.a)(Object(O.a)({},Me),{},{submitRecords:Se.payload});case ct.SET_PAGE:return Object(O.a)(Object(O.a)({},Me),{},{submitRecordPage:Se.payload});case ct.SET_EXECUTE_MESSAGE:return Object(O.a)(Object(O.a)({},Me),{},{executingMessage:Se.payload});case ct.SET_EXECUTE_RESULT:return Object(O.a)(Object(O.a)({},Me),Se.payload);case ct.SET_SUBMIT_RESULT:return Object(O.a)(Object(O.a)({},Me),Se.payload);default:throw new Error}}var Ur=Ee.default=function(Me){var Se,Lt,Ht,vn,cn=Me.children,rn=Object(i.useReducer)(pr,Tr),zt=Object(y.a)(rn,2),At=zt[0],Mt=zt[1],Ut=Object(h.i)(),Pt=Ut.id,qt=Object(h.g)(),vt=Object(h.h)(),un=At.loading,Zt=At.data,Ln=At.debugResult,kt=At.submitResult,Pn=At.submitRecords,kn=At.submitRecordPage,wn=At.showNote,En=At.debuging,An=At.submitting,nr=At.executingMessage,lr=Object(i.useState)("#FFF"),Xn=Object(y.a)(lr,2),Tn=Xn[0],ur=Xn[1],dn=Object(i.useState)(null),fn=Object(y.a)(dn,2),hn=fn[0],Xt=fn[1],Ct=Object(i.useState)({}),jt=Object(y.a)(Ct,2),Et=jt[0],en=jt[1],Nt=Object(i.useState)(!0),rr=Object(y.a)(Nt,2),Mn=rr[0],dr=rr[1],Zr=Object(i.useState)(!1),Pr=Object(y.a)(Zr,2),zr=Pr[0],Mr=Pr[1],Sr=Object(i.useRef)(null),Br=Object(i.useRef)(0),jn=Zt==null?void 0:Zt.user,Ot=Zt==null?void 0:Zt.hack,Gr=Object(i.useRef)(),vr=Object(i.useRef)();Object(i.useEffect)(function(){var Qt;if(clearTimeout(Gr.current),clearTimeout(vr.current),Et!=null&&(Qt=Et.exercise)!==null&&Qt!==void 0&&Qt.left_time){var wt,Jt;if((Et==null||((wt=Et.exercise)===null||wt===void 0)?void 0:wt.left_time)>1800){var yt;vr.current=setTimeout(function(){v.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:a.a.createElement(c.a,null),okText:"\u77E5\u9053\u4E86"})},((Et==null||((yt=Et.exercise)===null||yt===void 0)?void 0:yt.left_time)-1800)*1e3)}if((Et==null||((Jt=Et.exercise)===null||Jt===void 0)?void 0:Jt.left_time)>900){var on;Gr.current=setTimeout(function(){v.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:a.a.createElement(c.a,null),okText:"\u77E5\u9053\u4E86"})},((Et==null||((on=Et.exercise)===null||on===void 0)?void 0:on.left_time)-900)*1e3)}}},[Et]),Object(i.useEffect)(function(){function Qt(){return wt.apply(this,arguments)}function wt(){return wt=Object(A.a)(l.a.mark(function Jt(){var yt,on,On,Kn,yr,br,Ft,Wr,Xr,wr,Hn,$n;return l.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return dr(!0),Jn.next=3,Object(E.d)(Pt);case 3:if(yt=Jn.sent,setTimeout(function(){dr(!1)},800),yt.status===401)document.location.href="/user/login";else{try{yt.hack.code=j.Base64.decode(yt.hack.code)}catch(Hr){console.log(Hr)}yt.hack=Object(O.a)(Object(O.a)({},yt.hack),{},{is_program:(vt==null||((on=vt.query)===null||on===void 0)?void 0:on.type)==="1"}),Mt({type:ct.GET_DATA,payload:{loading:!1,data:yt}})}if(!(vt.query.type==="exercises")){Jn.next=18;break}if(!(vt.query.coursesId=="coursesId")){Jn.next=13;break}return Jn.next=10,Object(f.Y)({categoryId:vt.query.exercisesId,login:vt.query.login});case 10:br=Jn.sent,Jn.next=16;break;case 13:return Jn.next=15,Object(f.z)({categoryId:vt.query.exercisesId,login:vt.query.login});case 15:br=Jn.sent;case 16:en(Object(O.a)({},br)),(On=br)!==null&&On!==void 0&&On.left_banner_id&&(Kn=br)!==null&&Kn!==void 0&&(yr=Kn.exercise)!==null&&yr!==void 0&&yr.left_time&&(Xt(Date.now()+((Ft=br)===null||Ft===void 0||((Wr=Ft.exercise)===null||Wr===void 0)?void 0:Wr.left_time)*1e3),setTimeout(function(){ur("red")},(((Xr=br)===null||Xr===void 0||((wr=Xr.exercise)===null||wr===void 0)?void 0:wr.left_time)-300>0?((Hn=br)===null||Hn===void 0||(($n=Hn.exercise)===null||$n===void 0)?void 0:$n.left_time)-300:0)*1e3));case 18:case"end":return Jn.stop()}},Jt)})),wt.apply(this,arguments)}Pt&&Qt()},[Pt]),Object(i.useEffect)(function(){return vt.query.type==="exercises"&&(window.addEventListener(Object(d.c)(),St),window.focus(),window.onblur=function(){Object(d.a)()&&Object(d.b)()}),function(){document.removeEventListener(Object(d.c)(),St)}},[Pt]),Object(i.useEffect)(function(){Pt&&Ot!==null&&Ot!==void 0&&Ot.language&&Wt()},[Pt,kn,Ot==null?void 0:Ot.language]),Object(i.useEffect)(function(){return Ot!=null&&Ot.is_program&&(Br.current=0,Sr.current=setInterval(function(){na()},15e3)),function(){clearInterval(Sr.current)}},[Ot==null?void 0:Ot.is_program]);var na=function(){var Qt=Object(A.a)(l.a.mark(function wt(){var Jt;return l.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(st.a)("/api/myproblems/".concat(Pt,"/save_long_time.json"),{method:"get",params:{answer_long_time:Br.current}});case 2:Jt=on.sent;case 3:case"end":return on.stop()}},wt)}));return function(){return Qt.apply(this,arguments)}}(),St=function(){window.parent.postMessage("backExercise","*")};function Wt(){return Dt.apply(this,arguments)}function Dt(){return Dt=Object(A.a)(l.a.mark(function Qt(){var wt;return l.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.prev=0,yt.next=3,Object(E.f)(Pt,{limit:15,page:kn,language:Ot==null?void 0:Ot.language});case 3:wt=yt.sent,Mt({type:ct.GET_SUBMIT_RECORDS,payload:wt}),yt.next=10;break;case 7:yt.prev=7,yt.t0=yt.catch(0),console.log(yt.t0);case 10:case"end":return yt.stop()}},Qt,null,[[0,7]])})),Dt.apply(this,arguments)}function Vt(Qt){Mt({type:ct.SET_PAGE,payload:Qt})}function $t(){return yn.apply(this,arguments)}function yn(){return yn=Object(A.a)(l.a.mark(function Qt(){var wt;return l.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(E.k)(Pt,{code:j.Base64.encode(Ot.code),language:Ot==null?void 0:Ot.language});case 2:return wt=yt.sent,yt.abrupt("return",wt);case 4:case"end":return yt.stop()}},Qt)})),yn.apply(this,arguments)}function tn(){return In.apply(this,arguments)}function In(){return In=Object(A.a)(l.a.mark(function Qt(){var wt,Jt,yt,on,On,Kn,yr;return l.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:if(!An){Ft.next=2;break}return Ft.abrupt("return");case 2:return Mt({type:ct.SET_SUBMITING,payload:!0}),Ft.prev=3,$.a.publish("to-commit-info"),Ft.next=7,$t();case 7:if(wt=Ft.sent,console.log(wt,1),!(wt.status===0)){Ft.next=23;break}return yr=function(){return yr=Object(A.a)(l.a.mark(function Xr(){var wr,Hn,$n,Kr,Jn,Hr,Ka;return l.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(E.c)(Pt,"submit");case 2:if(wr=Ir.sent,Hn=wr.status,$n=wr.data,Kr=qn(),Jn=Kr-On>(on+3)*1e3,Hn!==0&&!Jn&&setTimeout(Kn,1e3),!Jn){Ir.next=12;break}return v.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Mt({type:ct.SET_SUBMITING,payload:!1}),Ir.abrupt("return");case 12:if(!(Hn===0)){Ir.next=19;break}return $n.status===2&&v.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),($n==null?void 0:$n.status)===0&&(vt==null||((Hr=vt.query)===null||Hr===void 0)?void 0:Hr.type)==="1"&&Mr(!0),Ir.next=17,Object(E.f)(Pt,{limit:15,page:kn,language:Ot==null?void 0:Ot.language});case 17:Ka=Ir.sent,Mt({type:ct.SET_SUBMIT_RESULT,payload:Object(O.a)(Object(O.a)({},At),{},{submitResult:$n,submitting:!1,submitRecords:Ka})});case 19:case"end":return Ir.stop()}},Xr)})),yr.apply(this,arguments)},Kn=function(){return yr.apply(this,arguments)},Jt={},vt.query.type==="exercises"&&(Jt.extras={exercise_id:vt.query.exercisesId,question_id:vt.query.questionId}),Ft.next=16,Object(E.h)(Pt,Jt);case 16:if(yt=Ft.sent,!(yt.status===-1)){Ft.next=20;break}return window.parent.location.href="/classrooms/".concat(vt.query.coursesId,"/exercise/").concat(vt.query.exercisesId,"/detail"),Ft.abrupt("return");case 20:on=Ot.time_limit,On=qn(),Kn();case 23:Ft.next=29;break;case 25:Ft.prev=25,Ft.t0=Ft.catch(3),console.log(Ft.t0),Mt({type:ct.SET_SUBMITING,payload:!1});case 29:case"end":return Ft.stop()}},Qt,null,[[3,25]])})),In.apply(this,arguments)}function er(){return Yt.apply(this,arguments)}function Yt(){return Yt=Object(A.a)(l.a.mark(function Qt(){var wt,Jt,yt,on,On,Kn,yr;return l.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return At.debuging=!0,Mt({type:ct.SET_DEBUGING,payload:!0}),Ft.prev=2,Ft.next=5,$t();case 5:if(wt=Ft.sent,!(wt.status===0)){Ft.next=22;break}return yr=function(){return yr=Object(A.a)(l.a.mark(function Xr(){var wr,Hn,$n,Kr,Jn,Hr;return l.a.wrap(function(Vr){for(;;)switch(Vr.prev=Vr.next){case 0:return Vr.next=2,Object(E.c)(Pt,"debug");case 2:if(wr=Vr.sent,Hn=wr.status,$n=wr.message,Kr=wr.data,Jn=qn(),Hr=Jn-On>(Jt+3)*1e3,Hn!==0&&!Hr&&(Mt({type:ct.SET_EXECUTE_MESSAGE,payload:$n}),setTimeout(Kn,1e3)),!Hr){Vr.next=13;break}return v.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Mt({type:ct.SET_DEBUGING,payload:!1}),Vr.abrupt("return");case 13:Hn===0&&(Mt({type:ct.SET_DEBUGING,payload:!1}),Kr.status===2&&v.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Kr.status===2&&v.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Mt({type:ct.SET_EXECUTE_RESULT,payload:Object(O.a)(Object(O.a)({},At),{},{debugResult:Kr,debuging:!1})}));case 14:case"end":return Vr.stop()}},Xr)})),yr.apply(this,arguments)},Kn=function(){return yr.apply(this,arguments)},Jt=Ot.time_limit,yt={input:encodeURIComponent(Zt.test_case.input)},vt.query.type==="exercises"&&(yt.exercise_id=vt.query.exercisesId),Ft.next=14,Object(E.b)(Pt,yt);case 14:if(on=Ft.sent,!(on.status===-1)){Ft.next=18;break}return window.parent.location.href="/classrooms/".concat(vt.query.coursesId,"/exercise/").concat(vt.query.exercisesId,"/detail"),Ft.abrupt("return");case 18:On=qn(),Kn(),Ft.next=23;break;case 22:Mt({type:ct.SET_DEBUGING,payload:!1});case 23:Ft.next=28;break;case 25:Ft.prev=25,Ft.t0=Ft.catch(2),console.log(Ft.t0);case 28:return Ft.prev=28,Ft.finish(28);case 30:case"end":return Ft.stop()}},Qt,null,[[2,25,28,30]])})),Yt.apply(this,arguments)}function gr(Qt){Mt({type:ct.SET_DATA,payload:Object(O.a)(Object(O.a)({},Zt),{},{hack:Object(O.a)(Object(O.a)({},Ot),{},{code:Qt})})})}var mn=function(){var Qt=Object(A.a)(l.a.mark(function wt(Jt){var yt,on;return l.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(st.a)("/api/problems/".concat(Ot==null?void 0:Ot.identifier,"/start.json"),{method:"get",params:{language:Jt==="C++"||Jt==="c++"?encodeURIComponent(Jt):Jt,hack_user_id:jn==null?void 0:jn.user_id}});case 2:yt=Kn.sent,yt.status!==-1&&qt.replace("/myproblems/".concat(yt==null?void 0:yt.identifier,"?type=").concat(vt==null||((on=vt.query)===null||on===void 0)?void 0:on.type));case 4:case"end":return Kn.stop()}},wt)}));return function(Jt){return Qt.apply(this,arguments)}}();function Vn(Qt){var wt=Qt.target.value;Mt({type:ct.SET_DATA,payload:Object(O.a)(Object(O.a)({},Zt),{},{test_case:{input:wt}})})}function Yn(){return cr.apply(this,arguments)}function cr(){return cr=Object(A.a)(l.a.mark(function Qt(){var wt;return l.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.prev=0,yt.next=3,Object(E.g)(Pt);case 3:wt=yt.sent,wt.status===401?qt.replace("/login",{from:vt.pathname}):gr(j.Base64.decode(wt.code)),yt.next=10;break;case 7:yt.prev=7,yt.t0=yt.catch(0),console.log(yt.t0);case 10:case"end":return yt.stop()}},Qt,null,[[0,7]])})),cr.apply(this,arguments)}function Wa(){v.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:a.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",a.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(A.a)(l.a.mark(function wt(){var Jt;return l.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(E.i)(Pt);case 2:Jt=on.sent,Jt.status===401?qt.replace("/login",{from:vt.pathname}):gr(j.Base64.decode(Jt.code));case 4:case"end":return on.stop()}},wt)}))()}})}function pn(){Mt({type:ct.SET_SHOW_NOTE,payload:!0})}function an(){Mt({type:ct.SET_SHOW_NOTE,payload:!1})}function sn(Qt){return fr.apply(this,arguments)}function fr(){return fr=Object(A.a)(l.a.mark(function Qt(wt){return l.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(E.a)(Pt,wt);case 2:Mt({type:ct.GET_DATA,payload:{showNote:!1,data:Object(O.a)(Object(O.a)({},Zt),{},{hack:Object(O.a)(Object(O.a)({},Ot),{},{notes:wt.notes})})}});case 3:case"end":return yt.stop()}},Qt)})),fr.apply(this,arguments)}var Qr={hack:Ot,isLoading:Mn,input:Zt==null||((Se=Zt.test_case)===null||Se===void 0)?void 0:Se.input,language:Ot==null?void 0:Ot.language,code:Ot==null?void 0:Ot.code,title:"main."+rt[Ot==null?void 0:Ot.language],modify_code:Ot==null?void 0:Ot.modify_code,notes:Ot==null?void 0:Ot.notes,debugResult:Ln,debuging:En,submitting:An,executingMessage:nr,onCancelNote:an,onAddNote:sn,showNote:wn,user:jn,onShowNote:pn,onSubmitCode:tn,onChangeCode:gr,onChangeInput:Vn,onDebugCode:er,onResetCode:Yn,onSyncCode:Wa,onUpdateCode:$t,onChangeLanguage:mn};function qr(){return ra.apply(this,arguments)}function ra(){return ra=Object(A.a)(l.a.mark(function Qt(){var wt,Jt,yt;return l.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,Object(E.j)(Ot.id,{container_type:"Hack",type:1});case 2:wt=On.sent,Jt=wt.praise_count,yt=Object(O.a)(Object(O.a)({},Zt),{},{hack:Object(O.a)(Object(O.a)({},Ot),{},{praises_count:Jt,user_praise:!Ot.user_praise})}),Mt({type:ct.SET_DATA,payload:yt});case 6:case"end":return On.stop()}},Qt)})),ra.apply(this,arguments)}var Ca={topicId:Pt,submitResult:kt,submitRecords:Pn,submitting:An,page:kn,onPageChange:Vt,hack:Ot,user:Zt==null?void 0:Zt.user,onTriggerPraise:qr};return a.a.createElement(a.a.Fragment,null,a.a.createElement(_.a,{spinning:un,delay:500},Zt?a.a.createElement(a.a.Fragment,null,a.a.createElement("header",{className:X.a.header},vt.query.type!=="exercises"&&a.a.createElement("div",null,a.a.createElement("img",{src:"".concat(o.a.IMG_SERVER,"/images/").concat(jn.image_url),alt:"user",width:30}),a.a.createElement("span",null,jn.name)),a.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},a.a.createElement("div",null,Ot.name),(Ot==null?void 0:Ot.is_program)&&a.a.createElement(Gn.a,{defaultValue:Ot==null?void 0:Ot.answer_long_time,onChange:function(wt){console.log(wt),Br.current=wt},className:"font12 c-grey-999"})),jn.hack_manager?a.a.createElement(w.a,{className:X.a.btn_back,to:(vt==null||((Lt=vt.query)===null||Lt===void 0)?void 0:Lt.type)==="1"?"/problems/".concat(Ot.identifier,"/edit?type=1"):"/problems/".concat(Ot.identifier,"/edit"),style:{marginRight:10}}," ",a.a.createElement(C.a,null)," \u7F16\u8F91"):null,(Et==null||((Ht=Et.exercise)===null||Ht===void 0)?void 0:Ht.left_time)&&a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{style:{color:Tn},className:"iconfont icon-kaoshishichang mr5"}),a.a.createElement("span",{className:"c-white mr20"},a.a.createElement(mr,{valueStyle:{color:Tn,fontSize:16,fontWeight:"normal"},title:a.a.createElement("span",{style:{color:Tn,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:hn,onFinish:Object(A.a)(l.a.mark(function Qt(){var wt,Jt;return l.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(f.Z)({categoryId:vt.query.exercisesId,commit_method:2});case 2:wt=on.sent,(wt==null?void 0:wt.status)===0&&($t(),v.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:a.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",a.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var On=Object(A.a)(l.a.mark(function yr(){return l.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:window.parent.location.href="/classrooms/".concat(vt.query.coursesId,"/exercise/").concat(vt.query.exercisesId,"/detail");case 1:case"end":return Ft.stop()}},yr)}));function Kn(){return On.apply(this,arguments)}return Kn}()})),(wt==null?void 0:wt.status)===-3&&(Jt=parseInt(wt==null?void 0:wt.message),Xt(Date.now()+Jt*1e3));case 5:case"end":return on.stop()}},Qt)}))}))),(vt==null||((vn=vt.query)===null||vn===void 0)?void 0:vn.type)==="exercises"?a.a.createElement(I.a,{type:"primary",onClick:function(){$t(),v.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:a.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){St()}})}},a.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," \u8FD4\u56DE\u8BD5\u5377"):a.a.createElement("span",{className:X.a.btn_back,onClick:function(){var wt;if((vt==null||((wt=vt.query)===null||wt===void 0)?void 0:wt.type)==="1"){var Jt,yt=(Jt=localStorage.getItem("program_homework"))===null||Jt===void 0?void 0:Jt.split(",");qt.push("/classrooms/".concat(yt==null?void 0:yt[0],"/program_homework/").concat(yt==null?void 0:yt[1],"/detail"))}else qt.push("/problemset")}}," ",a.a.createElement(x.a,null),"\u9000\u51FA")),a.a.createElement(_.a,{size:"large",spinning:Mn},a.a.createElement(s.a,{className:"my-problems",leftChild:a.a.createElement(ln,Ca),rightChild:a.a.createElement(Rt,Qr)}))):null,a.a.createElement(v.a,{centered:!0,closable:!1,width:680,footer:null,visible:zr,className:"oj-modal"},a.a.createElement("section",{className:"oj-modal-content"},a.a.createElement("div",{className:"oj-modal-head"},a.a.createElement("img",{src:Dn.a,alt:""}),a.a.createElement("i",{onClick:function(){return Mr(!1)},className:"iconfont icon-guanbi1"})),a.a.createElement("aside",null,a.a.createElement("img",{className:"mr30",src:Bn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",a.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},kt==null?void 0:kt.execute_time,"ms"),"\u4F18\u4E8E",a.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(kt==null?void 0:kt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),a.a.createElement("aside",{className:"mb50"},a.a.createElement("img",{src:Gt.a,className:"mr30"}),a.a.createElement("span",{className:"oj-modal-tt"},a.a.createElement("span",null,a.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),a.a.createElement("span",{className:"c-light-primary"},kt==null?void 0:kt.execute_memory,"kb")),a.a.createElement("span",null,a.a.createElement("span",null))),"\u4F18\u4E8E",a.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(kt==null?void 0:kt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),a.a.createElement("div",{id:"oj-modal-next",onClick:Object(A.a)(l.a.mark(function Qt(){var wt,Jt,yt;return l.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(!(kt!=null&&kt.next_identifier)){On.next=7;break}return On.next=3,Object(st.a)("/api/problems/".concat(kt==null?void 0:kt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:jn==null?void 0:jn.user_id}});case 3:wt=On.sent,wt&&(qt.replace("/myproblems/".concat(wt==null?void 0:wt.identifier,"?type=1")),window.location.reload()),On.next=9;break;case 7:yt=(Jt=localStorage.getItem("program_homework"))===null||Jt===void 0?void 0:Jt.split(","),qt.push("/classrooms/".concat(yt==null?void 0:yt[0],"/program_homework/").concat(yt==null?void 0:yt[1],"/detail"));case 9:case"end":return On.stop()}},Qt)})),className:"oj-modal-btn"},kt!=null&&kt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function Un(Me){var Se,Lt=Me.title,Ht=Me.modify_code,vn=Me.onSyncCode,cn=Me.onShowCodeSetting,rn=Me.onResetCode,zt=Me.hack,At=Me.onChangeLanguage,Mt=function(){v.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:a.a.createElement(T.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:rn})};return console.log(zt,"hack"),a.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},(zt==null?void 0:zt.is_program)&&a.a.createElement(F.a,{className:"oj-select",value:zt==null?void 0:zt.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:At},zt==null||((Se=zt.all_language)===null||Se===void 0)?void 0:Se.map(function(Ut){return a.a.createElement(F.a.Option,{key:Ut,value:Ut},Ut)})),a.a.createElement("span",null),Ht?a.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:vn},a.a.createElement("img",{src:P.a,alt:"notice"})):null,a.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:Mt},a.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),a.a.createElement("a",{onClick:cn},a.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Rt(Me){var Se=Me.input,Lt=Me.showNote,Ht=Me.onShowNote,vn=Me.notes,cn=Me.onCancelNote,rn=Me.onAddNote,zt=Me.debugResult,At=Me.language,Mt=Me.debuging,Ut=Me.submitting,Pt=Me.executingMessage,qt=Me.code,vt=Me.onSubmitCode,un=Me.onDebugCode,Zt=Me.onChangeCode,Ln=Me.onChangeInput,kt=Me.onUpdateCode,Pn=Me.user,kn=Me.isLoading,wn=Object(B.a)(Me,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function En(nr){return a.a.createElement(Un,Object(V.a)({},wn,{onShowCodeSetting:nr}))}var An=Object(O.a)({input:Se,debugResult:zt,debuging:Mt,submitting:Ut,executingMessage:Pt,onDebugCode:un,onChangeCode:Zt,onSubmitCode:vt,onChangeInput:Ln,user:Pn},wn);return a.a.createElement("div",{className:"right-panel"},a.a.createElement(b.a,{isLoading:kn,language:At,value:qt,onChange:Zt,ActionBarRender:En}),a.a.createElement("div",{className:"note-form-area ".concat(Lt?"active":"")},a.a.createElement(fe,{onCancel:cn,notes:vn,callback:rn})),a.a.createElement(U.b,An))}},RELg:function(Ie,Ee,k){var V=k("MFOe"),B=V.Global;Ie.exports={name:"oldIE-userDataStorage",write:N,read:I,each:A,remove:L,clearAll:v};var D="storejs",F=B.document,M=S(),_=(B.navigator?B.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function N(p,m){if(_)return;var l=O(p);M(function(i){i.setAttribute(l,m),i.save(D)})}function I(p){if(_)return;var m=O(p),l=null;return M(function(i){l=i.getAttribute(m)}),l}function A(p){M(function(m){for(var l=m.XMLDocument.documentElement.attributes,i=l.length-1;i>=0;i--){var a=l[i];p(m.getAttribute(a.name),a.name)}})}function L(p){var m=O(p);M(function(l){l.removeAttribute(m),l.save(D)})}function v(){M(function(p){var m=p.XMLDocument.documentElement.attributes;p.load(D);for(var l=m.length-1;l>=0;l--)p.removeAttribute(m[l].name);p.save(D)})}var y=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function O(p){return p.replace(/^\d/,"___$&").replace(y,"___")}function S(){if(!F||!F.documentElement||!F.documentElement.addBehavior)return null;var p="script",m,l,i;try{l=new ActiveXObject("htmlfile"),l.open(),l.write("<"+p+">document.w=window</"+p+'><iframe src="/favicon.ico"></iframe>'),l.close(),m=l.w.frames[0].document,i=m.createElement("div")}catch(a){i=F.createElement("div"),m=F.body}return function(a){var c=[].slice.call(arguments,0);c.unshift(i),m.appendChild(i),i.addBehavior("#default#userData"),i.load(D),a.apply(this,c),m.removeChild(i);return}}},"S+dL":function(Ie,Ee){Ie.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"S/kP":function(Ie,Ee,k){Ie.exports=k.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Ie,Ee,k){var V=k("wTVA"),B=k("EbDI"),D=k("ZhPi"),F=k("wkBT");function M(_){return V(_)||B(_)||D(_)||F()}Ie.exports=M,Ie.exports.__esModule=!0,Ie.exports.default=Ie.exports},SJMd:function(Ie,Ee){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var k,V,B,D=!1,F,M;window.PR_SHOULD_USE_CONTINUATION=!0;var _,N;(function(){var I=window,A=["break,continue,do,else,for,if,return,while"],L=[A,"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"],v=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],y=[v,"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"],O=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],S=[v,"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"],p="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",m=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",i=[A,"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"],a=[A,"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"],c=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[y,S,O,m,l,i,a,c],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",w="kwd",E="com",f="typ",d="lit",s="pun",o="pln",T="tag",b="dec",g="src",P="atn",j="atv",H="nocode",X="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(ze){for(var Ke=0,$e=!1,Qe=!1,nt=0,Xe=ze.length;nt<Xe;++nt){var He=ze[nt];if(He.ignoreCase)Qe=!0;else if(/[a-z]/i.test(He.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){$e=!0,Qe=!1;break}}var st={b:8,t:9,n:10,v:11,f:12,r:13};function ft(be){var pe=be.charCodeAt(0);if(pe!==92)return pe;var ke=be.charAt(1);return pe=st[ke],pe||("0"<=ke&&ke<="7"?parseInt(be.substring(1),8):ke==="u"||ke==="x"?parseInt(be.substring(2),16):be.charCodeAt(1))}function ot(be){if(be<32)return(be<16?"\\x0":"\\x")+be.toString(16);var pe=String.fromCharCode(be);return pe==="\\"||pe==="-"||pe==="]"||pe==="^"?"\\"+pe:pe}function ut(be){var pe=be.substring(1,be.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")),ke=[],Ne=pe[0]==="^",xe=["["];Ne&&xe.push("^");for(var Re=Ne?1:0,de=pe.length;Re<de;++Re){var re=pe[Re];if(/\\[bdsw]/i.test(re))xe.push(re);else{var ne=ft(re),$;Re+2<de&&pe[Re+1]==="-"?($=ft(pe[Re+2]),Re+=2):$=ne,ke.push([ne,$]),$<65||ne>122||($<65||ne>90||ke.push([Math.max(65,ne)|32,Math.min($,90)|32]),$<97||ne>122||ke.push([Math.max(97,ne)&~32,Math.min($,122)&~32]))}}ke.sort(function(ue,Ce){return ue[0]-Ce[0]||Ce[1]-ue[1]});for(var Q=[],te=[],Re=0;Re<ke.length;++Re){var ie=ke[Re];ie[0]<=te[1]+1?te[1]=Math.max(te[1],ie[1]):Q.push(te=ie)}for(var Re=0;Re<Q.length;++Re){var ie=Q[Re];xe.push(ot(ie[0])),ie[1]>ie[0]&&(ie[1]+1>ie[0]&&xe.push("-"),xe.push(ot(ie[1])))}return xe.push("]"),xe.join("")}function gt(be){for(var pe=be.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")),ke=pe.length,Ne=[],xe=0,Re=0;xe<ke;++xe){var de=pe[xe];if(de==="(")++Re;else if(de.charAt(0)==="\\"){var re=+de.substring(1);re&&(re<=Re?Ne[re]=-1:pe[xe]=ot(re))}}for(var xe=1;xe<Ne.length;++xe)Ne[xe]===-1&&(Ne[xe]=++Ke);for(var xe=0,Re=0;xe<ke;++xe){var de=pe[xe];if(de==="(")++Re,Ne[Re]||(pe[xe]="(?:");else if(de.charAt(0)==="\\"){var re=+de.substring(1);re&&re<=Re&&(pe[xe]="\\"+Ne[re])}}for(var xe=0;xe<ke;++xe)pe[xe]==="^"&&pe[xe+1]!=="^"&&(pe[xe]="");if(be.ignoreCase&&$e)for(var xe=0;xe<ke;++xe){var de=pe[xe],ne=de.charAt(0);de.length>=2&&ne==="["?pe[xe]=ut(de):ne!=="\\"&&(pe[xe]=de.replace(/[a-zA-Z]/g,function(te){var ie=te.charCodeAt(0);return"["+String.fromCharCode(ie&~32,ie|32)+"]"}))}return pe.join("")}for(var ht=[],nt=0,Xe=ze.length;nt<Xe;++nt){var He=ze[nt];if(He.global||He.multiline)throw new Error(""+He);ht.push("(?:"+gt(He)+")")}return new RegExp(ht.join("|"),Qe?"gi":"g")}function U(ze,Ke){var $e=/(?:^|\s)nocode(?:\s|$)/,Qe=[],nt=0,Xe=[],He=0;function st(ft){var ot=ft.nodeType;if(ot==1){if($e.test(ft.className))return;for(var ut=ft.firstChild;ut;ut=ut.nextSibling)st(ut);var gt=ft.nodeName.toLowerCase();(gt==="br"||gt==="li")&&(Qe[He]=`
|
|
`,Xe[He<<1]=nt++,Xe[He++<<1|1]=ft)}else if(ot==3||ot==4){var ht=ft.nodeValue;ht.length&&(Ke?ht=ht.replace(/\r\n?/g,`
|
|
`):ht=ht.replace(/[ \t\r\n]+/g," "),Qe[He]=ht,Xe[He<<1]=nt,nt+=ht.length,Xe[He++<<1|1]=ft)}}return st(ze),{sourceCode:Qe.join("").replace(/\n$/,""),spans:Xe}}function z(ze,Ke,$e,Qe,nt){if(!$e)return;var Xe={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:$e,spans:null,basePos:Ke,decorations:null};Qe(Xe),nt.push.apply(nt,Xe.decorations)}var Z=/\S/;function q(ze){for(var Ke=void 0,$e=ze.firstChild;$e;$e=$e.nextSibling){var Qe=$e.nodeType;Ke=Qe===1?Ke?ze:$e:Qe===3&&Z.test($e.nodeValue)?ze:Ke}return Ke===ze?void 0:Ke}function oe(ze,Ke){var $e={},Qe;(function(){for(var He=ze.concat(Ke),st=[],ft={},ot=0,ut=He.length;ot<ut;++ot){var gt=He[ot],ht=gt[3];if(ht)for(var be=ht.length;--be>=0;)$e[ht.charAt(be)]=gt;var pe=gt[1],ke=""+pe;ft.hasOwnProperty(ke)||(st.push(pe),ft[ke]=null)}st.push(/[\0-\uffff]/),Qe=W(st)})();var nt=Ke.length,Xe=function(He){for(var st=He.sourceCode,ft=He.basePos,ot=He.sourceNode,ut=[ft,o],gt=0,ht=st.match(Qe)||[],be={},pe=0,ke=ht.length;pe<ke;++pe){var Ne=ht[pe],xe=be[Ne],Re=void 0,de;if(typeof xe=="string")de=!1;else{var re=$e[Ne.charAt(0)];if(re)Re=Ne.match(re[1]),xe=re[0];else{for(var ne=0;ne<nt;++ne)if(re=Ke[ne],Re=Ne.match(re[1]),Re){xe=re[0];break}Re||(xe=o)}de=xe.length>=5&&xe.substring(0,5)==="lang-",de&&!(Re&&typeof Re[1]=="string")&&(de=!1,xe=g),de||(be[Ne]=xe)}var $=gt;if(gt+=Ne.length,!de)ut.push(ft+$,xe);else{var Q=Re[1],te=Ne.indexOf(Q),ie=te+Q.length;Re[2]&&(ie=Ne.length-Re[2].length,te=ie-Q.length);var ue=xe.substring(5);z(ot,ft+$,Ne.substring(0,te),Xe,ut),z(ot,ft+$+te,Q,se(ue,Q),ut),z(ot,ft+$+ie,Ne.substring(ie),Xe,ut)}}He.decorations=ut};return Xe}function ye(ze){var Ke=[],$e=[];ze.tripleQuotedStrings?Ke.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?Ke.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&$e.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Qe=ze.hashComments;Qe&&(ze.cStyleComments?(Qe>1?Ke.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ke.push([E,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&($e.push([E,/^\/\/[^\r\n]*/,null]),$e.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var nt=ze.regexLiterals;if(nt){var Xe=nt>1?"":`
|
|
\r`,He=Xe?".":"[\\S\\s]",st="/(?=[^/*"+Xe+"])(?:[^/\\x5B\\x5C"+Xe+"]|\\x5C"+He+"|\\x5B(?:[^\\x5C\\x5D"+Xe+"]|\\x5C"+He+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+X+"("+st+")")])}var ft=ze.types;ft&&$e.push([f,ft]);var ot=(""+ze.keywords).replace(/^ | $/g,"");ot.length&&$e.push([w,new RegExp("^(?:"+ot.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([o,/^\s+/,null,` \r
|
|
\xA0`]);var ut="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(ut+="(?!s*/)"),$e.push([d,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[d,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[s,new RegExp(ut),null]),oe(Ke,$e)}var me=ye({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function fe(ze,Ke,$e){for(var Qe=/(?:^|\s)nocode(?:\s|$)/,nt=/\r\n?|\n/,Xe=ze.ownerDocument,He=Xe.createElement("li");ze.firstChild;)He.appendChild(ze.firstChild);var st=[He];function ft(pe){var ke=pe.nodeType;if(ke==1&&!Qe.test(pe.className))if(pe.nodeName==="br")ot(pe),pe.parentNode&&pe.parentNode.removeChild(pe);else for(var Ne=pe.firstChild;Ne;Ne=Ne.nextSibling)ft(Ne);else if((ke==3||ke==4)&&$e){var xe=pe.nodeValue,Re=xe.match(nt);if(Re){var de=xe.substring(0,Re.index);pe.nodeValue=de;var re=xe.substring(Re.index+Re[0].length);if(re){var ne=pe.parentNode;ne.insertBefore(Xe.createTextNode(re),pe.nextSibling)}ot(pe),de||pe.parentNode.removeChild(pe)}}}function ot(pe){for(;!pe.nextSibling;)if(pe=pe.parentNode,!pe)return;function ke(Re,de){var re=de?Re.cloneNode(!1):Re,ne=Re.parentNode;if(ne){var $=ke(ne,1),Q=Re.nextSibling;$.appendChild(re);for(var te=Q;te;te=Q)Q=te.nextSibling,$.appendChild(te)}return re}for(var Ne=ke(pe.nextSibling,0),xe;(xe=Ne.parentNode)&&xe.nodeType===1;)Ne=xe;st.push(Ne)}for(var ut=0;ut<st.length;++ut)ft(st[ut]);Ke===(Ke|0)&&st[0].setAttribute("value",Ke);var gt=Xe.createElement("ol");gt.className="linenums";for(var ht=Math.max(0,Ke-1|0)||0,ut=0,be=st.length;ut<be;++ut)He=st[ut],He.className="L"+(ut+ht)%10,He.firstChild||He.appendChild(Xe.createTextNode("\xA0")),gt.appendChild(He);ze.appendChild(gt)}function ve(ze){var Ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ke=Ke&&+Ke[1]<=8;var $e=/\n/g,Qe=ze.sourceCode,nt=Qe.length,Xe=0,He=ze.spans,st=He.length,ft=0,ot=ze.decorations,ut=ot.length,gt=0;ot[ut]=nt;var ht,be;for(be=ht=0;be<ut;)ot[be]!==ot[be+2]?(ot[ht++]=ot[be++],ot[ht++]=ot[be++]):be+=2;for(ut=ht,be=ht=0;be<ut;){for(var pe=ot[be],ke=ot[be+1],Ne=be+2;Ne+2<=ut&&ot[Ne+1]===ke;)Ne+=2;ot[ht++]=pe,ot[ht++]=ke,be=Ne}ut=ot.length=ht;var xe=ze.sourceNode,Re="";xe&&(Re=xe.style.display,xe.style.display="none");try{for(var de=null;ft<st;){var re=He[ft],ne=He[ft+2]||nt,$=ot[gt+2]||nt,Ne=Math.min(ne,$),Q=He[ft+1],te;if(Q.nodeType!==1&&(te=Qe.substring(Xe,Ne))){Ke&&(te=te.replace($e,"\r")),Q.nodeValue=te;var ie=Q.ownerDocument,ue=ie.createElement("span");ue.className=ot[gt+1];var Ce=Q.parentNode;Ce.replaceChild(ue,Q),ue.appendChild(Q),Xe<ne&&(He[ft+1]=Q=ie.createTextNode(Qe.substring(Ne,ne)),Ce.insertBefore(Q,ue.nextSibling))}Xe=Ne,Xe>=ne&&(ft+=2),Xe>=$&&(gt+=2)}}finally{xe&&(xe.style.display=Re)}}var ge={};function ae(ze,Ke){for(var $e=Ke.length;--$e>=0;){var Qe=Ke[$e];ge.hasOwnProperty(Qe)?I.console&&console.warn("cannot override language handler %s",Qe):ge[Qe]=ze}}function se(ze,Ke){return ze&&ge.hasOwnProperty(ze)||(ze=/^\s*</.test(Ke)?"default-markup":"default-code"),ge[ze]}ae(me,["default-code"]),ae(oe([],[[o,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["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"]),ae(oe([[o,/^[\s]+/,null,` \r
|
|
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["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"]),ae(oe([],[[j,/^[\s\S]+/]]),["uq.val"]),ae(ye({keywords:y,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),ae(ye({keywords:"null,true,false"}),["json"]),ae(ye({keywords:S,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),ae(ye({keywords:O,cStyleComments:!0}),["java"]),ae(ye({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ae(ye({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ae(ye({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ae(ye({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ae(ye({keywords:m,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ae(ye({keywords:p,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ae(oe([],[[h,/^[\s\S]+/]]),["regex"]);function Te(ze){var Ke=ze.langExtension;try{var $e=U(ze.sourceNode,ze.pre),Qe=$e.sourceCode;ze.sourceCode=Qe,ze.spans=$e.spans,ze.basePos=0,se(Ke,Qe)(ze),ve(ze)}catch(nt){I.console&&console.log(nt&&nt.stack||nt)}}function We(ze,Ke,$e){var Qe=$e||!1,nt=Ke||null,Xe=document.createElement("div");Xe.innerHTML="<pre>"+ze+"</pre>",Xe=Xe.firstChild,Qe&&fe(Xe,Qe,!0);var He={langExtension:nt,numberLines:Qe,sourceNode:Xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Te(He),Xe.innerHTML}function Je(ze,Ke){var $e=Ke||document.body,Qe=$e.ownerDocument||document;function nt(re){return $e.getElementsByTagName(re)}for(var Xe=[nt("pre"),nt("code"),nt("xmp")],He=[],st=0;st<Xe.length;++st)for(var ft=0,ot=Xe[st].length;ft<ot;++ft)He.push(Xe[st][ft]);Xe=null;var ut=Date;ut.now||(ut={now:function(){return+new Date}});var gt=0,ht=/\blang(?:uage)?-([\w.]+)(?!\S)/,be=/\bprettyprint\b/,pe=/\bprettyprinted\b/,ke=/pre|xmp/i,Ne=/^code$/i,xe=/^(?:pre|code|xmp)$/i,Re={};function de(){for(var re=I.PR_SHOULD_USE_CONTINUATION?ut.now()+250:Infinity;gt<He.length&&ut.now()<re;gt++){for(var ne=He[gt],$=Re,Q=ne;Q=Q.previousSibling;){var te=Q.nodeType,ie=(te===7||te===8)&&Q.nodeValue;if(ie?!/^\??prettify\b/.test(ie):te!==3||/\S/.test(Q.nodeValue))break;if(ie){$={},ie.replace(/\b(\w+)=([\w:.%+-]+)/g,function(je,De,at){$[De]=at});break}}var ue=ne.className;if(($!==Re||be.test(ue))&&!pe.test(ue)){for(var Ce=!1,Oe=ne.parentNode;Oe;Oe=Oe.parentNode){var Fe=Oe.tagName;if(xe.test(Fe)&&Oe.className&&be.test(Oe.className)){Ce=!0;break}}if(!Ce){ne.className+=" prettyprinted";var tt=$.lang;if(!tt){tt=ue.match(ht);var Ve;!tt&&(Ve=q(ne))&&Ne.test(Ve.tagName)&&(tt=Ve.className.match(ht)),tt&&(tt=tt[1])}var qe;if(ke.test(ne.tagName))qe=1;else{var Le=ne.currentStyle,Ue=Qe.defaultView,we=Le?Le.whiteSpace:Ue&&Ue.getComputedStyle?Ue.getComputedStyle(ne,null).getPropertyValue("white-space"):0;qe=we&&we.substring(0,3)==="pre"}var ee=$.linenums;(ee=ee==="true"||+ee)||(ee=ue.match(/\blinenums\b(?::(\d+))?/),ee=ee?ee[1]&&ee[1].length?+ee[1]:!0:!1),ee&&fe(ne,ee,qe);var ce={langExtension:tt,sourceNode:ne,numberLines:ee,pre:qe,sourceCode:null,basePos:null,spans:null,decorations:null};Te(ce)}}}gt<He.length?I.setTimeout(de,250):typeof ze=="function"&&ze()}de()}var Ye=I.PR={createSimpleLexer:oe,registerLangHandler:ae,sourceDecorator:ye,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:j,PR_COMMENT:E,PR_DECLARATION:b,PR_KEYWORD:w,PR_LITERAL:d,PR_NOCODE:H,PR_PLAIN:o,PR_PUNCTUATION:s,PR_SOURCE:g,PR_STRING:h,PR_TAG:T,PR_TYPE:f,prettyPrintOne:D?I.prettyPrintOne=We:_=We,prettyPrint:N=D?I.prettyPrint=Je:N=Je},Ze=I.define;typeof Ze=="function"&&Ze.amd&&Ze("google-code-prettify",[],function(){return Ye})})()},U7T7:function(Ie,Ee,k){},UZu5:function(Ie,Ee,k){},"VrN/":function(Ie,Ee,k){(function(V,B){Ie.exports=B()})(this,function(){"use strict";var V=navigator.userAgent,B=navigator.platform,D=/gecko\/\d/i.test(V),F=/MSIE \d/.test(V),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(V),_=/Edge\/(\d+)/.exec(V),N=F||M||_,I=N&&(F?document.documentMode||6:+(_||M)[1]),A=!_&&/WebKit\//.test(V),L=A&&/Qt\/\d+\.\d+/.test(V),v=!_&&/Chrome\//.test(V),y=/Opera\//.test(V),O=/Apple Computer/.test(navigator.vendor),S=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(V),p=/PhantomJS/.test(V),m=!_&&/AppleWebKit/.test(V)&&/Mobile\/\w+/.test(V),l=/Android/.test(V),i=m||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(V),a=m||/Mac/.test(B),c=/\bCrOS\b/.test(V),C=/win/i.test(B),x=y&&V.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(y=!1,A=!0);var h=a&&(L||y&&(x==null||x<12.11)),w=D||N&&I>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var f=function(e,t){var r=e.className,n=E(t).exec(r);if(n){var u=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(u?n[1]+u:"")}};function d(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return d(e).appendChild(t)}function o(e,t,r,n){var u=document.createElement(e);if(r&&(u.className=r),n&&(u.style.cssText=n),typeof t=="string")u.appendChild(document.createTextNode(t));else if(t)for(var R=0;R<t.length;++R)u.appendChild(t[R]);return u}function T(e,t,r,n){var u=o(e,t,r,n);return u.setAttribute("role","presentation"),u}var b;document.createRange?b=function(e,t,r,n){var u=document.createRange();return u.setEnd(n||e,r),u.setStart(e,t),u}:b=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(u){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function g(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,t){var r=e.className;E(t).test(r)||(e.className+=(r?" ":"")+t)}function H(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!E(r[n]).test(t)&&(t+=" "+r[n]);return t}var X=function(e){e.select()};m?X=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:N&&(X=function(e){try{e.select()}catch(t){}});function W(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function U(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function z(e,t,r,n,u){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var R=n||0,K=u||0;;){var G=e.indexOf(" ",R);if(G<0||G>=t)return K+(t-R);K+=G-R,K+=r-K%r,R=G+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function q(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var oe=50,ye={toString:function(){return"CodeMirror.Pass"}},me={scroll:!1},fe={origin:"*mouse"},ve={origin:"+move"};function ge(e,t,r){for(var n=0,u=0;;){var R=e.indexOf(" ",n);R==-1&&(R=e.length);var K=R-n;if(R==e.length||u+K>=t)return n+Math.min(K,t-u);if(u+=R-n,u+=r-u%r,n=R+1,u>=t)return n}}var ae=[""];function se(e){for(;ae.length<=e;)ae.push(Te(ae)+" ");return ae[e]}function Te(e){return e[e.length-1]}function We(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Je(e,t,r){for(var n=0,u=r(t);n<e.length&&r(e[n])<=u;)n++;e.splice(n,0,t)}function Ye(){}function Ze(e,t){var r;return Object.create?r=Object.create(e):(Ye.prototype=e,r=new Ye),t&&U(t,r),r}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ke(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function $e(e,t){return t?t.source.indexOf("\\w")>-1&&Ke(e)?!0:t.test(e):Ke(e)}function Qe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var nt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Xe(e){return e.charCodeAt(0)>=768&&nt.test(e)}function He(e,t,r){for(;(r<0?t>0:t<e.length)&&Xe(e.charAt(t));)t+=r;return t}function st(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var u=(t+r)/2,R=n<0?Math.ceil(u):Math.floor(u);if(R==t)return e(R)?t:r;e(R)?r=R:t=R+n}}function ft(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var u=!1,R=0;R<e.length;++R){var K=e[R];(K.from<r&&K.to>t||t==r&&K.to==t)&&(n(Math.max(K.from,t),Math.min(K.to,r),K.level==1?"rtl":"ltr",R),u=!0)}u||n(t,r,"ltr")}var ot=null;function ut(e,t,r){var n;ot=null;for(var u=0;u<e.length;++u){var R=e[u];if(R.from<t&&R.to>t)return u;R.to==t&&(R.from!=R.to&&r=="before"?n=u:ot=u),R.from==t&&(R.from!=R.to&&r!="before"?n=u:ot=u)}return n!=null?n:ot}var gt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(J){return J<=247?e.charAt(J):1424<=J&&J<=1524?"R":1536<=J&&J<=1785?t.charAt(J-1536):1774<=J&&J<=2220?"r":8192<=J&&J<=8203?"w":J==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,u=/[stwN]/,R=/[LRr]/,K=/[Lb1n]/,G=/[1n]/;function Y(J,le,he){this.level=J,this.from=le,this.to=he}return function(J,le){var he=le=="ltr"?"L":"R";if(J.length==0||le=="ltr"&&!n.test(J))return!1;for(var Ae=J.length,_e=[],Ge=0;Ge<Ae;++Ge)_e.push(r(J.charCodeAt(Ge)));for(var et=0,lt=he;et<Ae;++et){var mt=_e[et];mt=="m"?_e[et]=lt:lt=mt}for(var xt=0,pt=he;xt<Ae;++xt){var _t=_e[xt];_t=="1"&&pt=="r"?_e[xt]="n":R.test(_t)&&(pt=_t,_t=="r"&&(_e[xt]="R"))}for(var Kt=1,It=_e[0];Kt<Ae-1;++Kt){var nn=_e[Kt];nn=="+"&&It=="1"&&_e[Kt+1]=="1"?_e[Kt]="1":nn==","&&It==_e[Kt+1]&&(It=="1"||It=="n")&&(_e[Kt]=It),It=nn}for(var Rn=0;Rn<Ae;++Rn){var or=_e[Rn];if(or==",")_e[Rn]="N";else if(or=="%"){var Fn=void 0;for(Fn=Rn+1;Fn<Ae&&_e[Fn]=="%";++Fn);for(var Nr=Rn&&_e[Rn-1]=="!"||Fn<Ae&&_e[Fn]=="1"?"1":"N",Ar=Rn;Ar<Fn;++Ar)_e[Ar]=Nr;Rn=Fn-1}}for(var Zn=0,Rr=he;Zn<Ae;++Zn){var hr=_e[Zn];Rr=="L"&&hr=="1"?_e[Zn]="L":R.test(hr)&&(Rr=hr)}for(var tr=0;tr<Ae;++tr)if(u.test(_e[tr])){var Qn=void 0;for(Qn=tr+1;Qn<Ae&&u.test(_e[Qn]);++Qn);for(var Wn=(tr?_e[tr-1]:he)=="L",Lr=(Qn<Ae?_e[Qn]:he)=="L",Fa=Wn==Lr?Wn?"L":"R":he,ha=tr;ha<Qn;++ha)_e[ha]=Fa;tr=Qn-1}for(var xr=[],ta,sr=0;sr<Ae;)if(K.test(_e[sr])){var co=sr;for(++sr;sr<Ae&&K.test(_e[sr]);++sr);xr.push(new Y(0,co,sr))}else{var ia=sr,xa=xr.length,Ta=le=="rtl"?1:0;for(++sr;sr<Ae&&_e[sr]!="L";++sr);for(var _r=ia;_r<sr;)if(G.test(_e[_r])){ia<_r&&(xr.splice(xa,0,new Y(1,ia,_r)),xa+=Ta);var Ba=_r;for(++_r;_r<sr&&G.test(_e[_r]);++_r);xr.splice(xa,0,new Y(2,Ba,_r)),xa+=Ta,ia=_r}else++_r;ia<sr&&xr.splice(xa,0,new Y(1,ia,sr))}return le=="ltr"&&(xr[0].level==1&&(ta=J.match(/^\s+/))&&(xr[0].from=ta[0].length,xr.unshift(new Y(0,0,ta[0].length))),Te(xr).level==1&&(ta=J.match(/\s+$/))&&(Te(xr).to-=ta[0].length,xr.push(new Y(0,Ae-ta[0].length,Ae)))),le=="rtl"?xr.reverse():xr}}();function ht(e,t){var r=e.order;return r==null&&(r=e.order=gt(e.text,t)),r}var be=[],pe=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||be).concat(r)}};function ke(e,t){return e._handlers&&e._handlers[t]||be}function Ne(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,u=n&&n[t];if(u){var R=q(u,r);R>-1&&(n[t]=u.slice(0,R).concat(u.slice(R+1)))}}}function xe(e,t){var r=ke(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),u=0;u<r.length;++u)r[u].apply(null,n)}function Re(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),xe(e,r||t.type,e,t),te(t)||t.codemirrorIgnore}function de(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)q(r,t[n])==-1&&r.push(t[n])}function re(e,t){return ke(e,t).length>0}function ne(e){e.prototype.on=function(t,r){pe(this,t,r)},e.prototype.off=function(t,r){Ne(this,t,r)}}function $(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Q(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function te(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ie(e){$(e),Q(e)}function ue(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var Oe=function(){if(N&&I<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),Fe;function tt(e){if(Fe==null){var t=o("span","\u200B");s(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Fe=t.offsetWidth<=1&&t.offsetHeight>2&&!(N&&I<8))}var r=Fe?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var Ve;function qe(e){if(Ve!=null)return Ve;var t=s(e,document.createTextNode("A\u062EA")),r=b(t,0,1).getBoundingClientRect(),n=b(t,1,2).getBoundingClientRect();return d(e),!r||r.left==r.right?!1:Ve=n.right-r.right<3}var Le=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var u=e.indexOf(`
|
|
`,t);u==-1&&(u=e.length);var R=e.slice(t,e.charAt(u-1)=="\r"?u-1:u),K=R.indexOf("\r");K!=-1?(r.push(R.slice(0,K)),t+=K+1):(r.push(R),t=u+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ue=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},we=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ee=null;function ce(e){if(ee!=null)return ee;var t=s(e,o("span","x")),r=t.getBoundingClientRect(),n=b(t,0,1).getBoundingClientRect();return ee=Math.abs(r.left-n.left)>1}var je={},De={};function at(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),je[e]=t}function it(e,t){De[e]=t}function Pe(e){if(typeof e=="string"&&De.hasOwnProperty(e))e=De[e];else if(e&&typeof e.name=="string"&&De.hasOwnProperty(e.name)){var t=De[e.name];typeof t=="string"&&(t={name:t}),e=Ze(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Be(e,t){t=Pe(t);var r=je[t.name];if(!r)return Be(e,"text/plain");var n=r(e,t);if(dt.hasOwnProperty(t.name)){var u=dt[t.name];for(var R in u){if(!u.hasOwnProperty(R))continue;n.hasOwnProperty(R)&&(n["_"+R]=n[R]),n[R]=u[R]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)n[K]=t.modeProps[K];return n}var dt={};function Bt(e,t){var r=dt.hasOwnProperty(e)?dt[e]:dt[e]={};U(t,r)}function Tt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var u=t[n];u instanceof Array&&(u=u.concat([])),r[n]=u}return r}function gn(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function bn(e,t,r){return e.startState?e.startState(t,r):!0}var ln=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};ln.prototype.eol=function(){return this.pos>=this.string.length},ln.prototype.sol=function(){return this.pos==this.lineStart},ln.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ln.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ln.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},ln.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ln.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ln.prototype.skipToEnd=function(){this.pos=this.string.length},ln.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ln.prototype.backUp=function(e){this.pos-=e},ln.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},ln.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},ln.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(K){return r?K.toLowerCase():K},u=this.string.substr(this.pos,e.length);if(n(u)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var R=this.string.slice(this.pos).match(e);return R&&R.index>0?null:(R&&t!==!1&&(this.pos+=R[0].length),R)}},ln.prototype.current=function(){return this.string.slice(this.start,this.pos)},ln.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ln.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ln.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function bt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var u=r.children[n],R=u.chunkSize();if(t<R){r=u;break}t-=R}return r.lines[t]}function Dn(e,t,r){var n=[],u=t.line;return e.iter(t.line,r.line+1,function(R){var K=R.text;u==r.line&&(K=K.slice(0,r.ch)),u==t.line&&(K=K.slice(t.ch)),n.push(K),++u}),n}function Gn(e,t,r){var n=[];return e.iter(t,r,function(u){n.push(u.text)}),n}function Cn(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Gt(e){if(e.parent==null)return null;for(var t=e.parent,r=q(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var u=0;!(n.children[u]==t);++u)r+=n.children[u].chunkSize();return r+t.first}function _n(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var u=e.children[n],R=u.height;if(t<R){e=u;continue e}t-=R,r+=u.chunkSize()}return r}while(!e.lines);for(var K=0;K<e.lines.length;++K){var G=e.lines[K],Y=G.height;if(t<Y)break;t-=Y}return r+K}function Bn(e,t){return t>=e.first&&t<e.first+e.size}function mr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function rt(e,t,r){if(r===void 0&&(r=null),!(this instanceof rt))return new rt(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ct(e,t){return e.line-t.line||e.ch-t.ch}function qn(e,t){return e.sticky==t.sticky&&ct(e,t)==0}function Tr(e){return rt(e.line,e.ch)}function pr(e,t){return ct(e,t)<0?t:e}function Ur(e,t){return ct(e,t)<0?e:t}function Un(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Rt(e,t){if(t.line<e.first)return rt(e.first,0);var r=e.first+e.size-1;return t.line>r?rt(r,bt(e,r).text.length):Me(t,bt(e,t.line).text.length)}function Me(e,t){var r=e.ch;return r==null||r>t?rt(e.line,t):r<0?rt(e.line,0):e}function Se(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Rt(e,t[n]);return r}var Lt=function(e,t){this.state=e,this.lookAhead=t},Ht=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Ht.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ht.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ht.fromSaved=function(e,t,r){return t instanceof Lt?new Ht(e,Tt(e.mode,t.state),r,t.lookAhead):new Ht(e,Tt(e.mode,t),r)},Ht.prototype.save=function(e){var t=e!==!1?Tt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Lt(t,this.maxLookAhead):t};function vn(e,t,r,n){var u=[e.state.modeGen],R={};vt(e,t.text,e.doc.mode,r,function(J,le){return u.push(J,le)},R,n);for(var K=r.state,G=function(J){r.baseTokens=u;var le=e.state.overlays[J],he=1,Ae=0;r.state=!0,vt(e,t.text,le.mode,r,function(_e,Ge){for(var et=he;Ae<_e;){var lt=u[he];lt>_e&&u.splice(he,1,_e,u[he+1],lt),he+=2,Ae=Math.min(_e,lt)}if(!Ge)return;if(le.opaque)u.splice(et,he-et,_e,"overlay "+Ge),he=et+2;else for(;et<he;et+=2){var mt=u[et+1];u[et+1]=(mt?mt+" ":"")+"overlay "+Ge}},R),r.state=K,r.baseTokens=null,r.baseTokenPos=1},Y=0;Y<e.state.overlays.length;++Y)G(Y);return{styles:u,classes:R.bgClass||R.textClass?R:null}}function cn(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=rn(e,Gt(t)),u=t.text.length>e.options.maxHighlightLength&&Tt(e.doc.mode,n.state),R=vn(e,t,n);u&&(n.state=u),t.stateAfter=n.save(!u),t.styles=R.styles,R.classes?t.styleClasses=R.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function rn(e,t,r){var n=e.doc,u=e.display;if(!n.mode.startState)return new Ht(n,!0,t);var R=un(e,t,r),K=R>n.first&&bt(n,R-1).stateAfter,G=K?Ht.fromSaved(n,K,R):new Ht(n,bn(n.mode),R);return n.iter(R,t,function(Y){zt(e,Y.text,G);var J=G.line;Y.stateAfter=J==t-1||J%5==0||J>=u.viewFrom&&J<u.viewTo?G.save():null,G.nextLine()}),r&&(n.modeFrontier=G.line),G}function zt(e,t,r,n){var u=e.doc.mode,R=new ln(t,e.options.tabSize,r);for(R.start=R.pos=n||0,t==""&&At(u,r.state);!R.eol();)Mt(u,R,r.state),R.start=R.pos}function At(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=gn(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function Mt(e,t,r,n){for(var u=0;u<10;u++){n&&(n[0]=gn(e,r).mode);var R=e.token(t,r);if(t.pos>t.start)return R}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ut=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Pt(e,t,r,n){var u=e.doc,R=u.mode,K;t=Rt(u,t);var G=bt(u,t.line),Y=rn(e,t.line,r),J=new ln(G.text,e.options.tabSize,Y),le;for(n&&(le=[]);(n||J.pos<t.ch)&&!J.eol();)J.start=J.pos,K=Mt(R,J,Y.state),n&&le.push(new Ut(J,K,Tt(u.mode,Y.state)));return n?le:new Ut(J,K,Y.state)}function qt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function vt(e,t,r,n,u,R,K){var G=r.flattenSpans;G==null&&(G=e.options.flattenSpans);var Y=0,J=null,le=new ln(t,e.options.tabSize,n),he,Ae=e.options.addModeClass&&[null];for(t==""&&qt(At(r,n.state),R);!le.eol();){if(le.pos>e.options.maxHighlightLength?(G=!1,K&&zt(e,t,n,le.pos),le.pos=t.length,he=null):he=qt(Mt(r,le,n.state,Ae),R),Ae){var _e=Ae[0].name;_e&&(he="m-"+(he?_e+" "+he:_e))}if(!G||J!=he){for(;Y<le.start;)Y=Math.min(le.start,Y+5e3),u(Y,J);J=he}le.start=le.pos}for(;Y<le.pos;){var Ge=Math.min(le.pos,Y+5e3);u(Ge,J),Y=Ge}}function un(e,t,r){for(var n,u,R=e.doc,K=r?-1:t-(e.doc.mode.innerMode?1e3:100),G=t;G>K;--G){if(G<=R.first)return R.first;var Y=bt(R,G-1),J=Y.stateAfter;if(J&&(!r||G+(J instanceof Lt?J.lookAhead:0)<=R.modeFrontier))return G;var le=z(Y.text,null,e.options.tabSize);(u==null||n>le)&&(u=G-1,n=le)}return u}function Zt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var u=bt(e,n).stateAfter;if(u&&(!(u instanceof Lt)||n+u.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Ln=!1,kt=!1;function Pn(){Ln=!0}function kn(){kt=!0}function wn(e,t,r){this.marker=e,this.from=t,this.to=r}function En(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function An(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function nr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function lr(e,t,r){var n;if(e)for(var u=0;u<e.length;++u){var R=e[u],K=R.marker,G=R.from==null||(K.inclusiveLeft?R.from<=t:R.from<t);if(G||R.from==t&&K.type=="bookmark"&&(!r||!R.marker.insertLeft)){var Y=R.to==null||(K.inclusiveRight?R.to>=t:R.to>t);(n||(n=[])).push(new wn(K,R.from,Y?null:R.to))}}return n}function Xn(e,t,r){var n;if(e)for(var u=0;u<e.length;++u){var R=e[u],K=R.marker,G=R.to==null||(K.inclusiveRight?R.to>=t:R.to>t);if(G||R.from==t&&K.type=="bookmark"&&(!r||R.marker.insertLeft)){var Y=R.from==null||(K.inclusiveLeft?R.from<=t:R.from<t);(n||(n=[])).push(new wn(K,Y?null:R.from-t,R.to==null?null:R.to-t))}}return n}function Tn(e,t){if(t.full)return null;var r=Bn(e,t.from.line)&&bt(e,t.from.line).markedSpans,n=Bn(e,t.to.line)&&bt(e,t.to.line).markedSpans;if(!r&&!n)return null;var u=t.from.ch,R=t.to.ch,K=ct(t.from,t.to)==0,G=lr(r,u,K),Y=Xn(n,R,K),J=t.text.length==1,le=Te(t.text).length+(J?u:0);if(G)for(var he=0;he<G.length;++he){var Ae=G[he];if(Ae.to==null){var _e=En(Y,Ae.marker);_e?J&&(Ae.to=_e.to==null?null:_e.to+le):Ae.to=u}}if(Y)for(var Ge=0;Ge<Y.length;++Ge){var et=Y[Ge];if(et.to!=null&&(et.to+=le),et.from==null){var lt=En(G,et.marker);lt||(et.from=le,J&&(G||(G=[])).push(et))}else et.from+=le,J&&(G||(G=[])).push(et)}G&&(G=ur(G)),Y&&Y!=G&&(Y=ur(Y));var mt=[G];if(!J){var xt=t.text.length-2,pt;if(xt>0&&G)for(var _t=0;_t<G.length;++_t)G[_t].to==null&&(pt||(pt=[])).push(new wn(G[_t].marker,null,null));for(var Kt=0;Kt<xt;++Kt)mt.push(pt);mt.push(Y)}return mt}function ur(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function dn(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(_e){if(_e.markedSpans)for(var Ge=0;Ge<_e.markedSpans.length;++Ge){var et=_e.markedSpans[Ge].marker;et.readOnly&&(!n||q(n,et)==-1)&&(n||(n=[])).push(et)}}),!n)return null;for(var u=[{from:t,to:r}],R=0;R<n.length;++R)for(var K=n[R],G=K.find(0),Y=0;Y<u.length;++Y){var J=u[Y];if(ct(J.to,G.from)<0||ct(J.from,G.to)>0)continue;var le=[Y,1],he=ct(J.from,G.from),Ae=ct(J.to,G.to);(he<0||!K.inclusiveLeft&&!he)&&le.push({from:J.from,to:G.from}),(Ae>0||!K.inclusiveRight&&!Ae)&&le.push({from:G.to,to:J.to}),u.splice.apply(u,le),Y+=le.length-3}return u}function fn(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function hn(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function Xt(e){return e.inclusiveLeft?-1:0}function Ct(e){return e.inclusiveRight?1:0}function jt(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),u=t.find(),R=ct(n.from,u.from)||Xt(e)-Xt(t);if(R)return-R;var K=ct(n.to,u.to)||Ct(e)-Ct(t);return K||t.id-e.id}function Et(e,t){var r=kt&&e.markedSpans,n;if(r)for(var u=void 0,R=0;R<r.length;++R)u=r[R],u.marker.collapsed&&(t?u.from:u.to)==null&&(!n||jt(n,u.marker)<0)&&(n=u.marker);return n}function en(e){return Et(e,!0)}function Nt(e){return Et(e,!1)}function rr(e,t){var r=kt&&e.markedSpans,n;if(r)for(var u=0;u<r.length;++u){var R=r[u];R.marker.collapsed&&(R.from==null||R.from<t)&&(R.to==null||R.to>t)&&(!n||jt(n,R.marker)<0)&&(n=R.marker)}return n}function Mn(e,t,r,n,u){var R=bt(e,t),K=kt&&R.markedSpans;if(K)for(var G=0;G<K.length;++G){var Y=K[G];if(!Y.marker.collapsed)continue;var J=Y.marker.find(0),le=ct(J.from,r)||Xt(Y.marker)-Xt(u),he=ct(J.to,n)||Ct(Y.marker)-Ct(u);if(le>=0&&he<=0||le<=0&&he>=0)continue;if(le<=0&&(Y.marker.inclusiveRight&&u.inclusiveLeft?ct(J.to,r)>=0:ct(J.to,r)>0)||le>=0&&(Y.marker.inclusiveRight&&u.inclusiveLeft?ct(J.from,n)<=0:ct(J.from,n)<0))return!0}}function dr(e){for(var t;t=en(e);)e=t.find(-1,!0).line;return e}function Zr(e){for(var t;t=Nt(e);)e=t.find(1,!0).line;return e}function Pr(e){for(var t,r;t=Nt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function zr(e,t){var r=bt(e,t),n=dr(r);return r==n?t:Gt(n)}function Mr(e,t){if(t>e.lastLine())return t;var r=bt(e,t),n;if(!Sr(e,r))return t;for(;n=Nt(r);)r=n.find(1,!0).line;return Gt(r)+1}function Sr(e,t){var r=kt&&t.markedSpans;if(r)for(var n=void 0,u=0;u<r.length;++u){if(n=r[u],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Br(e,t,n))return!0}}function Br(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return Br(e,n.line,En(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var u=void 0,R=0;R<t.markedSpans.length;++R)if(u=t.markedSpans[R],u.marker.collapsed&&!u.marker.widgetNode&&u.from==r.to&&(u.to==null||u.to!=r.from)&&(u.marker.inclusiveLeft||r.marker.inclusiveRight)&&Br(e,t,u))return!0}function jn(e){e=dr(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var u=r.lines[n];if(u==e)break;t+=u.height}for(var R=r.parent;R;r=R,R=r.parent)for(var K=0;K<R.children.length;++K){var G=R.children[K];if(G==r)break;t+=G.height}return t}function Ot(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=en(n);){var u=r.find(0,!0);n=u.from.line,t+=u.from.ch-u.to.ch}for(n=e;r=Nt(n);){var R=r.find(0,!0);t-=n.text.length-R.from.ch,n=R.to.line,t+=n.text.length-R.to.ch}return t}function Gr(e){var t=e.display,r=e.doc;t.maxLine=bt(r,r.first),t.maxLineLength=Ot(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var u=Ot(n);u>t.maxLineLength&&(t.maxLineLength=u,t.maxLine=n)})}var vr=function(e,t,r){this.text=e,hn(this,t),this.height=r?r(this):1};vr.prototype.lineNo=function(){return Gt(this)},ne(vr);function na(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),fn(e),hn(e,r);var u=n?n(e):1;u!=e.height&&Cn(e,u)}function St(e){e.parent=null,fn(e)}var Wt={},Dt={};function Vt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Dt:Wt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function $t(e,t){var r=T("span",null,null,A?"padding-right: .1px":null),n={pre:T("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var u=0;u<=(t.rest?t.rest.length:0);u++){var R=u?t.rest[u-1]:t.line,K=void 0;n.pos=0,n.addToken=tn,qe(e.display.measure)&&(K=ht(R,e.doc.direction))&&(n.addToken=er(n.addToken,K)),n.map=[];var G=t!=e.display.externalMeasured&&Gt(R);gr(R,n,cn(e,R,G)),R.styleClasses&&(R.styleClasses.bgClass&&(n.bgClass=H(R.styleClasses.bgClass,n.bgClass||"")),R.styleClasses.textClass&&(n.textClass=H(R.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(tt(e.display.measure))),u==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(A){var Y=n.content.lastChild;(/\bcm-tab\b/.test(Y.className)||Y.querySelector&&Y.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return xe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=H(n.pre.className,n.textClass||"")),n}function yn(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function tn(e,t,r,n,u,R,K){if(!t)return;var G=e.splitSpaces?In(t,e.trailingSpace):t,Y=e.cm.state.specialChars,J=!1,le;if(!Y.test(t))e.col+=t.length,le=document.createTextNode(G),e.map.push(e.pos,e.pos+t.length,le),N&&I<9&&(J=!0),e.pos+=t.length;else{le=document.createDocumentFragment();for(var he=0;;){Y.lastIndex=he;var Ae=Y.exec(t),_e=Ae?Ae.index-he:t.length-he;if(_e){var Ge=document.createTextNode(G.slice(he,he+_e));N&&I<9?le.appendChild(o("span",[Ge])):le.appendChild(Ge),e.map.push(e.pos,e.pos+_e,Ge),e.col+=_e,e.pos+=_e}if(!Ae)break;he+=_e+1;var et=void 0;if(Ae[0]==" "){var lt=e.cm.options.tabSize,mt=lt-e.col%lt;et=le.appendChild(o("span",se(mt),"cm-tab")),et.setAttribute("role","presentation"),et.setAttribute("cm-text"," "),e.col+=mt}else Ae[0]=="\r"||Ae[0]==`
|
|
`?(et=le.appendChild(o("span",Ae[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),et.setAttribute("cm-text",Ae[0]),e.col+=1):(et=e.cm.options.specialCharPlaceholder(Ae[0]),et.setAttribute("cm-text",Ae[0]),N&&I<9?le.appendChild(o("span",[et])):le.appendChild(et),e.col+=1);e.map.push(e.pos,e.pos+1,et),e.pos++}}if(e.trailingSpace=G.charCodeAt(t.length-1)==32,r||n||u||J||R||K){var xt=r||"";n&&(xt+=n),u&&(xt+=u);var pt=o("span",[le],xt,R);if(K)for(var _t in K)K.hasOwnProperty(_t)&&_t!="style"&&_t!="class"&&pt.setAttribute(_t,K[_t]);return e.content.appendChild(pt)}e.content.appendChild(le)}function In(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",u=0;u<e.length;u++){var R=e.charAt(u);R==" "&&r&&(u==e.length-1||e.charCodeAt(u+1)==32)&&(R="\xA0"),n+=R,r=R==" "}return n}function er(e,t){return function(r,n,u,R,K,G,Y){u=u?u+" cm-force-border":"cm-force-border";for(var J=r.pos,le=J+n.length;;){for(var he=void 0,Ae=0;Ae<t.length&&!(he=t[Ae],he.to>J&&he.from<=J);Ae++);if(he.to>=le)return e(r,n,u,R,K,G,Y);e(r,n.slice(0,he.to-J),u,R,null,G,Y),R=null,n=n.slice(he.to-J),J=he.to}}}function Yt(e,t,r,n){var u=!n&&r.widgetNode;u&&e.map.push(e.pos,e.pos+t,u),!n&&e.cm.display.input.needsContentAttribute&&(u||(u=e.content.appendChild(document.createElement("span"))),u.setAttribute("cm-marker",r.id)),u&&(e.cm.display.input.setUneditable(u),e.content.appendChild(u)),e.pos+=t,e.trailingSpace=!1}function gr(e,t,r){var n=e.markedSpans,u=e.text,R=0;if(!n){for(var K=1;K<r.length;K+=2)t.addToken(t,u.slice(R,R=r[K]),Vt(r[K+1],t.cm.options));return}for(var G=u.length,Y=0,J=1,le="",he,Ae,_e=0,Ge,et,lt,mt,xt;;){if(_e==Y){Ge=et=lt=Ae="",xt=null,mt=null,_e=Infinity;for(var pt=[],_t=void 0,Kt=0;Kt<n.length;++Kt){var It=n[Kt],nn=It.marker;if(nn.type=="bookmark"&&It.from==Y&&nn.widgetNode)pt.push(nn);else if(It.from<=Y&&(It.to==null||It.to>Y||nn.collapsed&&It.to==Y&&It.from==Y)){if(It.to!=null&&It.to!=Y&&_e>It.to&&(_e=It.to,et=""),nn.className&&(Ge+=" "+nn.className),nn.css&&(Ae=(Ae?Ae+";":"")+nn.css),nn.startStyle&&It.from==Y&&(lt+=" "+nn.startStyle),nn.endStyle&&It.to==_e&&(_t||(_t=[])).push(nn.endStyle,It.to),nn.title&&((xt||(xt={})).title=nn.title),nn.attributes)for(var Rn in nn.attributes)(xt||(xt={}))[Rn]=nn.attributes[Rn];nn.collapsed&&(!mt||jt(mt.marker,nn)<0)&&(mt=It)}else It.from>Y&&_e>It.from&&(_e=It.from)}if(_t)for(var or=0;or<_t.length;or+=2)_t[or+1]==_e&&(et+=" "+_t[or]);if(!mt||mt.from==Y)for(var Fn=0;Fn<pt.length;++Fn)Yt(t,0,pt[Fn]);if(mt&&(mt.from||0)==Y){if(Yt(t,(mt.to==null?G+1:mt.to)-Y,mt.marker,mt.from==null),mt.to==null)return;mt.to==Y&&(mt=!1)}}if(Y>=G)break;for(var Nr=Math.min(G,_e);;){if(le){var Ar=Y+le.length;if(!mt){var Zn=Ar>Nr?le.slice(0,Nr-Y):le;t.addToken(t,Zn,he?he+Ge:Ge,lt,Y+Zn.length==_e?et:"",Ae,xt)}if(Ar>=Nr){le=le.slice(Nr-Y),Y=Nr;break}Y=Ar,lt=""}le=u.slice(R,R=r[J++]),he=Vt(r[J++],t.cm.options)}}}function mn(e,t,r){this.line=t,this.rest=Pr(t),this.size=this.rest?Gt(Te(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Sr(e,t)}function Vn(e,t,r){for(var n=[],u,R=t;R<r;R=u){var K=new mn(e.doc,bt(e.doc,R),R);u=R+K.size,n.push(K)}return n}var Yn=null;function cr(e){Yn?Yn.ops.push(e):e.ownsGroup=Yn={ops:[e],delayedCallbacks:[]}}function Wa(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var u=e.ops[n];if(u.cursorActivityHandlers)for(;u.cursorActivityCalled<u.cursorActivityHandlers.length;)u.cursorActivityHandlers[u.cursorActivityCalled++].call(null,u.cm)}}while(r<t.length)}function pn(e,t){var r=e.ownsGroup;if(!r)return;try{Wa(r)}finally{Yn=null,t(r)}}var an=null;function sn(e,t){var r=ke(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),u;Yn?u=Yn.delayedCallbacks:an?u=an:(u=an=[],setTimeout(fr,0));for(var R=function(G){u.push(function(){return r[G].apply(null,n)})},K=0;K<r.length;++K)R(K)}function fr(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function Qr(e,t,r,n){for(var u=0;u<t.changes.length;u++){var R=t.changes[u];R=="text"?Qt(e,t):R=="gutter"?Jt(e,t,r,n):R=="class"?wt(e,t):R=="widget"&&yt(e,t,n)}t.changes=null}function qr(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),N&&I<8&&(e.node.style.zIndex=2)),e.node}function ra(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=qr(t);t.background=n.insertBefore(o("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Ca(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):$t(e,t)}function Qt(e,t){var r=t.text.className,n=Ca(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,wt(e,t)):r&&(t.text.className=r)}function wt(e,t){ra(e,t),t.line.wrapClass?qr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Jt(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var u=qr(t);t.gutterBackground=o("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),u.insertBefore(t.gutterBackground,t.text)}var R=t.line.gutterMarkers;if(e.options.lineNumbers||R){var K=qr(t),G=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(G),K.insertBefore(G,t.text),t.line.gutterClass&&(G.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!R||!R["CodeMirror-linenumbers"])&&(t.lineNumber=G.appendChild(o("div",mr(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),R)for(var Y=0;Y<e.display.gutterSpecs.length;++Y){var J=e.display.gutterSpecs[Y].className,le=R.hasOwnProperty(J)&&R[J];le&&G.appendChild(o("div",[le],"CodeMirror-gutter-elt","left: "+n.gutterLeft[J]+"px; width: "+n.gutterWidth[J]+"px"))}}}function yt(e,t,r){t.alignable&&(t.alignable=null);for(var n=E("CodeMirror-linewidget"),u=t.node.firstChild,R=void 0;u;u=R)R=u.nextSibling,n.test(u.className)&&t.node.removeChild(u);On(e,t,r)}function on(e,t,r,n){var u=Ca(e,t);return t.text=t.node=u.pre,u.bgClass&&(t.bgClass=u.bgClass),u.textClass&&(t.textClass=u.textClass),wt(e,t),Jt(e,t,r,n),On(e,t,n),t.node}function On(e,t,r){if(Kn(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Kn(e,t.rest[n],t,r,!1)}function Kn(e,t,r,n,u){if(!t.widgets)return;for(var R=qr(r),K=0,G=t.widgets;K<G.length;++K){var Y=G[K],J=o("div",[Y.node],"CodeMirror-linewidget"+(Y.className?" "+Y.className:""));Y.handleMouseEvents||J.setAttribute("cm-ignore-events","true"),yr(Y,J,r,n),e.display.input.setUneditable(J),u&&Y.above?R.insertBefore(J,r.gutter||r.text):R.appendChild(J),sn(Y,"redraw")}}function yr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var u=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(u-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=u+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function br(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!g(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,o("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Ft(e,t){for(var r=ue(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function Xr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function wr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,o("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Hn(e){return oe-e.display.nativeBarWidth}function $n(e){return e.display.scroller.clientWidth-Hn(e)-e.display.barWidth}function Kr(e){return e.display.scroller.clientHeight-Hn(e)-e.display.barHeight}function Jn(e,t,r){var n=e.options.lineWrapping,u=n&&$n(e);if(!t.measure.heights||n&&t.measure.width!=u){var R=t.measure.heights=[];if(n){t.measure.width=u;for(var K=t.text.firstChild.getClientRects(),G=0;G<K.length-1;G++){var Y=K[G],J=K[G+1];Math.abs(Y.bottom-J.bottom)>2&&R.push((Y.bottom+J.top)/2-r.top)}}R.push(r.bottom-r.top)}}function Hr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var u=0;u<e.rest.length;u++)if(Gt(e.rest[u])>r)return{map:e.measure.maps[u],cache:e.measure.caches[u],before:!0}}function Ka(e,t){t=dr(t);var r=Gt(t),n=e.display.externalMeasured=new mn(e.doc,t,r);n.lineN=r;var u=n.built=$t(e,n);return n.text=u.pre,s(e.display.lineMeasure,u.pre),n}function Vr(e,t,r,n){return ea(e,_a(e,t),r,n)}function Ir(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[va(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function _a(e,t){var r=Gt(t),n=Ir(e,r);n&&!n.text?n=null:n&&n.changes&&(Qr(e,n,r,Ui(e)),e.curOp.forceUpdate=!0),n||(n=Ka(e,t));var u=Hr(n,t,r);return{line:t,view:n,rect:null,map:u.map,cache:u.cache,before:u.before,hasHeights:!1}}function ea(e,t,r,n,u){t.before&&(r=-1);var R=r+(n||""),K;return t.cache.hasOwnProperty(R)?K=t.cache[R]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Jn(e,t.view,t.rect),t.hasHeights=!0),K=Ws(e,t,r,n),K.bogus||(t.cache[R]=K)),{left:K.left,right:K.right,top:u?K.rtop:K.top,bottom:u?K.rbottom:K.bottom}}var ho={left:0,right:0,top:0,bottom:0};function mo(e,t,r){for(var n,u,R,K,G,Y,J=0;J<e.length;J+=3)if(G=e[J],Y=e[J+1],t<G?(u=0,R=1,K="left"):t<Y?(u=t-G,R=u+1):(J==e.length-3||t==Y&&e[J+3]>t)&&(R=Y-G,u=R-1,t>=Y&&(K="right")),u!=null){if(n=e[J+2],G==Y&&r==(n.insertLeft?"left":"right")&&(K=r),r=="left"&&u==0)for(;J&&e[J-2]==e[J-3]&&e[J-1].insertLeft;)n=e[(J-=3)+2],K="left";if(r=="right"&&u==Y-G)for(;J<e.length-3&&e[J+3]==e[J+4]&&!e[J+5].insertLeft;)n=e[(J+=3)+2],K="right";break}return{node:n,start:u,end:R,collapse:K,coverStart:G,coverEnd:Y}}function Bs(e,t){var r=ho;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var u=e.length-1;u>=0&&!((r=e[u]).left!=r.right);u--);return r}function Ws(e,t,r,n){var u=mo(t.map,r,n),R=u.node,K=u.start,G=u.end,Y=u.collapse,J;if(R.nodeType==3){for(var le=0;le<4;le++){for(;K&&Xe(t.line.text.charAt(u.coverStart+K));)--K;for(;u.coverStart+G<u.coverEnd&&Xe(t.line.text.charAt(u.coverStart+G));)++G;if(N&&I<9&&K==0&&G==u.coverEnd-u.coverStart?J=R.parentNode.getBoundingClientRect():J=Bs(b(R,K,G).getClientRects(),n),J.left||J.right||K==0)break;G=K,K=K-1,Y="right"}N&&I<11&&(J=Ks(e.display.measure,J))}else{K>0&&(Y=n="right");var he;e.options.lineWrapping&&(he=R.getClientRects()).length>1?J=he[n=="right"?he.length-1:0]:J=R.getBoundingClientRect()}if(N&&I<9&&!K&&(!J||!J.left&&!J.right)){var Ae=R.parentNode.getClientRects()[0];Ae?J={left:Ae.left,right:Ae.left+wa(e.display),top:Ae.top,bottom:Ae.bottom}:J=ho}for(var _e=J.top-t.rect.top,Ge=J.bottom-t.rect.top,et=(_e+Ge)/2,lt=t.view.measure.heights,mt=0;mt<lt.length-1&&!(et<lt[mt]);mt++);var xt=mt?lt[mt-1]:0,pt=lt[mt],_t={left:(Y=="right"?J.right:J.left)-t.rect.left,right:(Y=="left"?J.left:J.right)-t.rect.left,top:xt,bottom:pt};return!J.left&&!J.right&&(_t.bogus=!0),e.options.singleCursorHeightPerLine||(_t.rtop=_e,_t.rbottom=Ge),_t}function Ks(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ce(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function po(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function vo(e){e.display.externalMeasure=null,d(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)po(e.display.view[t])}function Ha(e){vo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function go(){return v&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function yo(){return v&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Pi(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=br(e.widgets[r]));return t}function ci(e,t,r,n,u){if(!u){var R=Pi(t);r.top+=R,r.bottom+=R}if(n=="line")return r;n||(n="local");var K=jn(t);if(n=="local"?K+=Wr(e.display):K-=e.display.viewOffset,n=="page"||n=="window"){var G=e.display.lineSpace.getBoundingClientRect();K+=G.top+(n=="window"?0:yo());var Y=G.left+(n=="window"?0:go());r.left+=Y,r.right+=Y}return r.top+=K,r.bottom+=K,r}function bo(e,t,r){if(r=="div")return t;var n=t.left,u=t.top;if(r=="page")n-=go(),u-=yo();else if(r=="local"||!r){var R=e.display.sizer.getBoundingClientRect();n+=R.left,u+=R.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:n-K.left,top:u-K.top}}function Mi(e,t,r,n,u){return n||(n=bt(e.doc,t.line)),ci(e,n,Vr(e,n,t.ch,u),r)}function Yr(e,t,r,n,u,R){n=n||bt(e.doc,t.line),u||(u=_a(e,n));function K(Ge,et){var lt=ea(e,u,Ge,et?"right":"left",R);return et?lt.left=lt.right:lt.right=lt.left,ci(e,n,lt,r)}var G=ht(n,e.doc.direction),Y=t.ch,J=t.sticky;if(Y>=n.text.length?(Y=n.text.length,J="before"):Y<=0&&(Y=0,J="after"),!G)return K(J=="before"?Y-1:Y,J=="before");function le(Ge,et,lt){var mt=G[et],xt=mt.level==1;return K(lt?Ge-1:Ge,xt!=lt)}var he=ut(G,Y,J),Ae=ot,_e=le(Y,he,J=="before");return Ae!=null&&(_e.other=le(Y,Ae,J!="before")),_e}function Eo(e,t){var r=0;t=Rt(e.doc,t),e.options.lineWrapping||(r=wa(e.display)*t.ch);var n=bt(e.doc,t.line),u=jn(n)+Wr(e.display);return{left:r,right:r,top:u,bottom:u+n.height}}function Ii(e,t,r,n,u){var R=rt(e,t,r);return R.xRel=u,n&&(R.outside=n),R}function ki(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return Ii(n.first,0,null,-1,-1);var u=_n(n,r),R=n.first+n.size-1;if(u>R)return Ii(n.first+n.size-1,bt(n,R).text.length,null,1,1);t<0&&(t=0);for(var K=bt(n,u);;){var G=Hs(e,K,u,t,r),Y=rr(K,G.ch+(G.xRel>0||G.outside>0?1:0));if(!Y)return G;var J=Y.find(1);if(J.line==u)return J;K=bt(n,u=J.line)}}function xo(e,t,r,n){n-=Pi(t);var u=t.text.length,R=st(function(K){return ea(e,r,K-1).bottom<=n},u,0);return u=st(function(K){return ea(e,r,K).top>n},R,u),{begin:R,end:u}}function To(e,t,r,n){r||(r=_a(e,t));var u=ci(e,t,ea(e,r,n),"line").top;return xo(e,t,r,u)}function Ni(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Hs(e,t,r,n,u){u-=jn(t);var R=_a(e,t),K=Pi(t),G=0,Y=t.text.length,J=!0,le=ht(t,e.doc.direction);if(le){var he=(e.options.lineWrapping?Gs:zs)(e,t,r,R,le,n,u);J=he.level!=1,G=J?he.from:he.to-1,Y=J?he.to:he.from-1}var Ae=null,_e=null,Ge=st(function(Kt){var It=ea(e,R,Kt);return It.top+=K,It.bottom+=K,Ni(It,n,u,!1)?(It.top<=u&&It.left<=n&&(Ae=Kt,_e=It),!0):!1},G,Y),et,lt,mt=!1;if(_e){var xt=n-_e.left<_e.right-n,pt=xt==J;Ge=Ae+(pt?0:1),lt=pt?"after":"before",et=xt?_e.left:_e.right}else{!J&&(Ge==Y||Ge==G)&&Ge++,lt=Ge==0?"after":Ge==t.text.length?"before":ea(e,R,Ge-(J?1:0)).bottom+K<=u==J?"after":"before";var _t=Yr(e,rt(r,Ge,lt),"line",t,R);et=_t.left,mt=u<_t.top?-1:u>=_t.bottom?1:0}return Ge=He(t.text,Ge,1),Ii(r,Ge,lt,mt,n-et)}function zs(e,t,r,n,u,R,K){var G=st(function(he){var Ae=u[he],_e=Ae.level!=1;return Ni(Yr(e,rt(r,_e?Ae.to:Ae.from,_e?"before":"after"),"line",t,n),R,K,!0)},0,u.length-1),Y=u[G];if(G>0){var J=Y.level!=1,le=Yr(e,rt(r,J?Y.from:Y.to,J?"after":"before"),"line",t,n);Ni(le,R,K,!0)&&le.top>K&&(Y=u[G-1])}return Y}function Gs(e,t,r,n,u,R,K){var G=xo(e,t,n,K),Y=G.begin,J=G.end;/\s/.test(t.text.charAt(J-1))&&J--;for(var le=null,he=null,Ae=0;Ae<u.length;Ae++){var _e=u[Ae];if(_e.from>=J||_e.to<=Y)continue;var Ge=_e.level!=1,et=ea(e,n,Ge?Math.min(J,_e.to)-1:Math.max(Y,_e.from)).right,lt=et<R?R-et+1e9:et-R;(!le||he>lt)&&(le=_e,he=lt)}return le||(le=u[u.length-1]),le.from<Y&&(le={from:Y,to:le.to,level:le.level}),le.to>J&&(le={from:le.from,to:J,level:le.level}),le}var ma;function Sa(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ma==null){ma=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ma.appendChild(document.createTextNode("x")),ma.appendChild(o("br"));ma.appendChild(document.createTextNode("x"))}s(e.measure,ma);var r=ma.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),d(e.measure),r||1}function wa(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),r=o("pre",[t],"CodeMirror-line-like");s(e.measure,r);var n=t.getBoundingClientRect(),u=(n.right-n.left)/10;return u>2&&(e.cachedCharWidth=u),u||10}function Ui(e){for(var t=e.display,r={},n={},u=t.gutters.clientLeft,R=t.gutters.firstChild,K=0;R;R=R.nextSibling,++K){var G=e.display.gutterSpecs[K].className;r[G]=R.offsetLeft+R.clientLeft+u,n[G]=R.clientWidth}return{fixedPos:ji(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ji(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Co(e){var t=Sa(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/wa(e.display)-3);return function(u){if(Sr(e.doc,u))return 0;var R=0;if(u.widgets)for(var K=0;K<u.widgets.length;K++)u.widgets[K].height&&(R+=u.widgets[K].height);return r?R+(Math.ceil(u.text.length/n)||1)*t:R+t}}function Fi(e){var t=e.doc,r=Co(e);t.iter(function(n){var u=r(n);u!=n.height&&Cn(n,u)})}function pa(e,t,r,n){var u=e.display;if(!r&&ue(t).getAttribute("cm-not-content")=="true")return null;var R,K,G=u.lineSpace.getBoundingClientRect();try{R=t.clientX-G.left,K=t.clientY-G.top}catch(he){return null}var Y=ki(e,R,K),J;if(n&&Y.xRel>0&&(J=bt(e.doc,Y.line).text).length==Y.ch){var le=z(J,J.length,e.options.tabSize)-J.length;Y=rt(Y.line,Math.max(0,Math.round((R-wr(e.display).left)/wa(e.display))-le))}return Y}function va(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Or(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var u=e.display;if(n&&r<u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>t)&&(u.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=u.viewTo)kt&&zr(e.doc,t)<u.viewTo&&sa(e);else if(r<=u.viewFrom)kt&&Mr(e.doc,r+n)>u.viewFrom?sa(e):(u.viewFrom+=n,u.viewTo+=n);else if(t<=u.viewFrom&&r>=u.viewTo)sa(e);else if(t<=u.viewFrom){var R=fi(e,r,r+n,1);R?(u.view=u.view.slice(R.index),u.viewFrom=R.lineN,u.viewTo+=n):sa(e)}else if(r>=u.viewTo){var K=fi(e,t,t,-1);K?(u.view=u.view.slice(0,K.index),u.viewTo=K.lineN):sa(e)}else{var G=fi(e,t,t,-1),Y=fi(e,r,r+n,1);G&&Y?(u.view=u.view.slice(0,G.index).concat(Vn(e,G.lineN,Y.lineN)).concat(u.view.slice(Y.index)),u.viewTo+=n):sa(e)}var J=u.externalMeasured;J&&(r<J.lineN?J.lineN+=n:t<J.lineN+J.size&&(u.externalMeasured=null))}function oa(e,t,r){e.curOp.viewChanged=!0;var n=e.display,u=e.display.externalMeasured;if(u&&t>=u.lineN&&t<u.lineN+u.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var R=n.view[va(e,t)];if(R.node==null)return;var K=R.changes||(R.changes=[]);q(K,r)==-1&&K.push(r)}function sa(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fi(e,t,r,n){var u=va(e,t),R,K=e.display.view;if(!kt||r==e.doc.first+e.doc.size)return{index:u,lineN:r};for(var G=e.display.viewFrom,Y=0;Y<u;Y++)G+=K[Y].size;if(G!=t){if(n>0){if(u==K.length-1)return null;R=G+K[u].size-t,u++}else R=G-t;t+=R,r+=R}for(;zr(e.doc,r)!=r;){if(u==(n<0?0:K.length-1))return null;r+=n*K[u-(n<0?1:0)].size,u+=n}return{index:u,lineN:r}}function Xs(e,t,r){var n=e.display,u=n.view;u.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Vn(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Vn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(va(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Vn(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,va(e,r)))),n.viewTo=r}function _o(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var u=t[n];!u.hidden&&(!u.node||u.changes)&&++r}return r}function za(e){e.display.input.showSelection(e.display.input.prepareSelection())}function So(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},u=n.cursors=document.createDocumentFragment(),R=n.selection=document.createDocumentFragment(),K=0;K<r.sel.ranges.length;K++){if(!t&&K==r.sel.primIndex)continue;var G=r.sel.ranges[K];if(G.from().line>=e.display.viewTo||G.to().line<e.display.viewFrom)continue;var Y=G.empty();(Y||e.options.showCursorWhenSelecting)&&wo(e,G.head,u),Y||Vs(e,G,R)}return n}function wo(e,t,r){var n=Yr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),u=r.appendChild(o("div","\xA0","CodeMirror-cursor"));if(u.style.left=n.left+"px",u.style.top=n.top+"px",u.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var R=r.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));R.style.display="",R.style.left=n.other.left+"px",R.style.top=n.other.top+"px",R.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function hi(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,r){var n=e.display,u=e.doc,R=document.createDocumentFragment(),K=wr(e.display),G=K.left,Y=Math.max(n.sizerWidth,$n(e)-n.sizer.offsetLeft)-K.right,J=u.direction=="ltr";function le(pt,_t,Kt,It){_t<0&&(_t=0),_t=Math.round(_t),It=Math.round(It),R.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+pt+`px;
|
|
top: `+_t+"px; width: "+(Kt==null?Y-pt:Kt)+`px;
|
|
height: `+(It-_t)+"px"))}function he(pt,_t,Kt){var It=bt(u,pt),nn=It.text.length,Rn,or;function Fn(Zn,Rr){return Mi(e,rt(pt,Zn),"div",It,Rr)}function Nr(Zn,Rr,hr){var tr=To(e,It,null,Zn),Qn=Rr=="ltr"==(hr=="after")?"left":"right",Wn=hr=="after"?tr.begin:tr.end-(/\s/.test(It.text.charAt(tr.end-1))?2:1);return Fn(Wn,Qn)[Qn]}var Ar=ht(It,u.direction);return ft(Ar,_t||0,Kt==null?nn:Kt,function(Zn,Rr,hr,tr){var Qn=hr=="ltr",Wn=Fn(Zn,Qn?"left":"right"),Lr=Fn(Rr-1,Qn?"right":"left"),Fa=_t==null&&Zn==0,ha=Kt==null&&Rr==nn,xr=tr==0,ta=!Ar||tr==Ar.length-1;if(Lr.top-Wn.top<=3){var sr=(J?Fa:ha)&&xr,co=(J?ha:Fa)&&ta,ia=sr?G:(Qn?Wn:Lr).left,xa=co?Y:(Qn?Lr:Wn).right;le(ia,Wn.top,xa-ia,Wn.bottom)}else{var Ta,_r,Ba,fo;Qn?(Ta=J&&Fa&&xr?G:Wn.left,_r=J?Y:Nr(Zn,hr,"before"),Ba=J?G:Nr(Rr,hr,"after"),fo=J&&ha&&ta?Y:Lr.right):(Ta=J?Nr(Zn,hr,"before"):G,_r=!J&&Fa&&xr?Y:Wn.right,Ba=!J&&ha&&ta?G:Lr.left,fo=J?Nr(Rr,hr,"after"):Y),le(Ta,Wn.top,_r-Ta,Wn.bottom),Wn.bottom<Lr.top&&le(G,Wn.bottom,null,Lr.top),le(Ba,Lr.top,fo-Ba,Lr.bottom)}(!Rn||hi(Wn,Rn)<0)&&(Rn=Wn),hi(Lr,Rn)<0&&(Rn=Lr),(!or||hi(Wn,or)<0)&&(or=Wn),hi(Lr,or)<0&&(or=Lr)}),{start:Rn,end:or}}var Ae=t.from(),_e=t.to();if(Ae.line==_e.line)he(Ae.line,Ae.ch,_e.ch);else{var Ge=bt(u,Ae.line),et=bt(u,_e.line),lt=dr(Ge)==dr(et),mt=he(Ae.line,Ae.ch,lt?Ge.text.length+1:null).end,xt=he(_e.line,lt?0:null,_e.ch).start;lt&&(mt.top<xt.top-2?(le(mt.right,mt.top,null,mt.bottom),le(G,xt.top,xt.left,xt.bottom)):le(mt.right,mt.top,xt.left-mt.right,mt.bottom)),mt.bottom<xt.top&&le(G,mt.bottom,null,xt.top)}r.appendChild(R)}function Bi(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Oa(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Oo(e){e.state.focused||(e.display.input.focus(),Wi(e))}function Do(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Oa(e))},100)}function Wi(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(xe(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),A&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Bi(e)}function Oa(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(xe(e,"blur",e,t),e.state.focused=!1,f(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function mi(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var u=t.view[n],R=e.options.lineWrapping,K=void 0,G=0;if(u.hidden)continue;if(N&&I<8){var Y=u.node.offsetTop+u.node.offsetHeight;K=Y-r,r=Y}else{var J=u.node.getBoundingClientRect();K=J.bottom-J.top,!R&&u.text.firstChild&&(G=u.text.firstChild.getBoundingClientRect().right-J.left-1)}var le=u.line.height-K;if((le>.005||le<-.005)&&(Cn(u.line,K),Ao(u.line),u.rest))for(var he=0;he<u.rest.length;he++)Ao(u.rest[he]);if(G>e.display.sizerWidth){var Ae=Math.ceil(G/wa(e.display));Ae>e.display.maxLineLength&&(e.display.maxLineLength=Ae,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}function Ao(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function pi(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var u=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,R=_n(t,n),K=_n(t,u);if(r&&r.ensure){var G=r.ensure.from.line,Y=r.ensure.to.line;G<R?(R=G,K=_n(t,jn(bt(t,G))+e.wrapper.clientHeight)):Math.min(Y,t.lastLine())>=K&&(R=_n(t,jn(bt(t,Y))-e.wrapper.clientHeight),K=Y)}return{from:R,to:Math.max(K,R+1)}}function Ys(e,t){if(Re(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),u=null;if(t.top+n.top<0?u=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(u=!1),u!=null&&!p){var R=o("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Wr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Hn(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(R),R.scrollIntoView(u),e.display.lineSpace.removeChild(R)}}function $s(e,t,r,n){n==null&&(n=0);var u;!e.options.lineWrapping&&t==r&&(t=t.ch?rt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?rt(t.line,t.ch+1,"before"):t);for(var R=0;R<5;R++){var K=!1,G=Yr(e,t),Y=!r||r==t?G:Yr(e,r);u={left:Math.min(G.left,Y.left),top:Math.min(G.top,Y.top)-n,right:Math.max(G.left,Y.left),bottom:Math.max(G.bottom,Y.bottom)+n};var J=Ki(e,u),le=e.doc.scrollTop,he=e.doc.scrollLeft;if(J.scrollTop!=null&&(Xa(e,J.scrollTop),Math.abs(e.doc.scrollTop-le)>1&&(K=!0)),J.scrollLeft!=null&&(ga(e,J.scrollLeft),Math.abs(e.doc.scrollLeft-he)>1&&(K=!0)),!K)break}return u}function Js(e,t){var r=Ki(e,t);r.scrollTop!=null&&Xa(e,r.scrollTop),r.scrollLeft!=null&&ga(e,r.scrollLeft)}function Ki(e,t){var r=e.display,n=Sa(e.display);t.top<0&&(t.top=0);var u=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,R=Kr(e),K={};t.bottom-t.top>R&&(t.bottom=t.top+R);var G=e.doc.height+Xr(r),Y=t.top<n,J=t.bottom>G-n;if(t.top<u)K.scrollTop=Y?0:t.top;else if(t.bottom>u+R){var le=Math.min(t.top,(J?G:t.bottom)-R);le!=u&&(K.scrollTop=le)}var he=e.options.fixedGutter?0:r.gutters.offsetWidth,Ae=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-he,_e=$n(e)-r.gutters.offsetWidth,Ge=t.right-t.left>_e;return Ge&&(t.right=t.left+_e),t.left<10?K.scrollLeft=0:t.left<Ae?K.scrollLeft=Math.max(0,t.left+he-(Ge?0:10)):t.right>_e+Ae-3&&(K.scrollLeft=t.right+(Ge?0:10)-_e),K}function Hi(e,t){if(t==null)return;vi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Da(e){vi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ga(e,t,r){(t!=null||r!=null)&&vi(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Zs(e,t){vi(e),e.curOp.scrollToPos=t}function vi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Eo(e,t.from),n=Eo(e,t.to);Ro(e,r,n,t.margin)}}function Ro(e,t,r,n){var u=Ki(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Ga(e,u.scrollLeft,u.scrollTop)}function Xa(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||Gi(e,{top:t}),Lo(e,t,!0),D&&Gi(e),$a(e,100)}function Lo(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ga(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,No(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Va(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Xr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Hn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ya=function(e,t,r){this.cm=r;var n=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),u=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=u.tabIndex=-1,e(n),e(u),pe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),pe(u,"scroll",function(){u.clientWidth&&t(u.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,N&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ya.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var u=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+u)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var R=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+R)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},ya.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ya.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ya.prototype.zeroWidthHack=function(){var e=a&&!S?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},ya.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var u=e.getBoundingClientRect(),R=r=="vert"?document.elementFromPoint(u.right-1,(u.top+u.bottom)/2):document.elementFromPoint((u.right+u.left)/2,u.bottom-1);R!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},ya.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ya=function(){};Ya.prototype.update=function(){return{bottom:0,right:0}},Ya.prototype.setScrollLeft=function(){},Ya.prototype.setScrollTop=function(){},Ya.prototype.clear=function(){};function Aa(e,t){t||(t=Va(e));var r=e.display.barWidth,n=e.display.barHeight;Po(e,t);for(var u=0;u<4&&r!=e.display.barWidth||n!=e.display.barHeight;u++)r!=e.display.barWidth&&e.options.lineWrapping&&mi(e),Po(e,Va(e)),r=e.display.barWidth,n=e.display.barHeight}function Po(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var Mo={native:ya,null:Ya};function Io(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&f(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Mo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?ga(e,t):Xa(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function ba(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},cr(e.curOp)}function Ea(e){var t=e.curOp;t&&pn(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;qs(r)})}function qs(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var u=0;u<t.length;u++)nl(t[u]);for(var R=0;R<t.length;R++)rl(t[R]);for(var K=0;K<t.length;K++)al(t[K])}function el(e){var t=e.cm,r=t.display;ol(t),e.updateMaxLine&&Gr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new gi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&zi(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&mi(t),e.barMeasure=Va(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Vr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Hn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-$n(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ga(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Aa(t,e.barMeasure),e.updatedDisplay&&Vi(t,e.barMeasure),e.selectionChanged&&Bi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Oo(e.cm)}function al(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&ko(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&Lo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ga(t,e.scrollLeft,!0,!0),e.scrollToPos){var u=$s(t,Rt(n,e.scrollToPos.from),Rt(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,u)}var R=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(R)for(var G=0;G<R.length;++G)R[G].lines.length||xe(R[G],"hide");if(K)for(var Y=0;Y<K.length;++Y)K[Y].lines.length&&xe(K[Y],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&xe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function kr(e,t){if(e.curOp)return t();ba(e);try{return t()}finally{Ea(e)}}function ar(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ba(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Cr(e){return function(){if(this.curOp)return e.apply(this,arguments);ba(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function ir(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ba(t);try{return e.apply(this,arguments)}finally{Ea(t)}}}function $a(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,W(il,e))}function il(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=rn(e,t.highlightFrontier),u=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(R){if(n.line>=e.display.viewFrom){var K=R.styles,G=R.text.length>e.options.maxHighlightLength?Tt(t.mode,n.state):null,Y=vn(e,R,n,!0);G&&(n.state=G),R.styles=Y.styles;var J=R.styleClasses,le=Y.classes;le?R.styleClasses=le:J&&(R.styleClasses=null);for(var he=!K||K.length!=R.styles.length||J!=le&&(!J||!le||J.bgClass!=le.bgClass||J.textClass!=le.textClass),Ae=0;!he&&Ae<K.length;++Ae)he=K[Ae]!=R.styles[Ae];he&&u.push(n.line),R.stateAfter=n.save(),n.nextLine()}else R.text.length<=e.options.maxHighlightLength&&zt(e,R.text,n),R.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return $a(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),u.length&&kr(e,function(){for(var R=0;R<u.length;R++)oa(e,u[R],"text")})}var gi=function(e,t,r){var n=e.display;this.viewport=t,this.visible=pi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=$n(e),this.force=r,this.dims=Ui(e),this.events=[]};gi.prototype.signal=function(e,t){re(e,t)&&this.events.push(arguments)},gi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)xe.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Hn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Hn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!g(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&g(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&g(document.body,e.anchorNode)&&g(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function zi(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return sa(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&_o(e)==0)return!1;Uo(e)&&(sa(e),t.dims=Ui(e));var u=n.first+n.size,R=Math.max(t.visible.from-e.options.viewportMargin,n.first),K=Math.min(u,t.visible.to+e.options.viewportMargin);r.viewFrom<R&&R-r.viewFrom<20&&(R=Math.max(n.first,r.viewFrom)),r.viewTo>K&&r.viewTo-K<20&&(K=Math.min(u,r.viewTo)),kt&&(R=zr(e.doc,R),K=Mr(e.doc,K));var G=R!=r.viewFrom||K!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Xs(e,R,K),r.viewOffset=jn(bt(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var Y=_o(e);if(!G&&Y==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var J=sl(e);return Y>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),Y>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(J),d(r.cursorDiv),d(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,G&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,$a(e,400)),r.updateLineNumbers=null,!0}function ko(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==$n(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+Xr(e.display)-Kr(e),r.top)}),t.visible=pi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=pi(e.display,e.doc,r));if(!zi(e,t))break;mi(e);var u=Va(e);za(e),Aa(e,u),Vi(e,u),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Gi(e,t){var r=new gi(e,t);if(zi(e,r)){mi(e),ko(e,r);var n=Va(e);za(e),Aa(e,n),Vi(e,n),r.finish()}}function ul(e,t,r){var n=e.display,u=e.options.lineNumbers,R=n.lineDiv,K=R.firstChild;function G(Ge){var et=Ge.nextSibling;return A&&a&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),et}for(var Y=n.view,J=n.viewFrom,le=0;le<Y.length;le++){var he=Y[le];if(!he.hidden)if(!he.node||he.node.parentNode!=R){var Ae=on(e,he,J,r);R.insertBefore(Ae,K)}else{for(;K!=he.node;)K=G(K);var _e=u&&t!=null&&t<=J&&he.lineNumber;he.changes&&(q(he.changes,"gutter")>-1&&(_e=!1),Qr(e,he,J,r)),_e&&(d(he.lineNumber),he.lineNumber.appendChild(document.createTextNode(mr(e.options,J)))),K=he.node.nextSibling}J+=he.size}for(;K;)K=G(K)}function Xi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Vi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Hn(e)+"px"}function No(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ji(t)-t.scroller.scrollLeft+e.doc.scrollLeft,u=t.gutters.offsetWidth,R=n+"px",K=0;K<r.length;K++)if(!r[K].hidden){e.options.fixedGutter&&(r[K].gutter&&(r[K].gutter.style.left=R),r[K].gutterBackground&&(r[K].gutterBackground.style.left=R));var G=r[K].alignable;if(G)for(var Y=0;Y<G.length;Y++)G[Y].style.left=R}e.options.fixedGutter&&(t.gutters.style.left=n+u+"px")}function Uo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=mr(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var u=n.measure.appendChild(o("div",[o("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),R=u.firstChild.offsetWidth,K=u.offsetWidth-R;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(R,n.lineGutter.offsetWidth-K)+1,n.lineNumWidth=n.lineNumInnerWidth+K,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Xi(e.display),!0}return!1}function Yi(e,t){for(var r=[],n=!1,u=0;u<e.length;u++){var R=e[u],K=null;if(typeof R!="string"&&(K=R.style,R=R.className),R=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:R,style:K})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function jo(e){var t=e.gutters,r=e.gutterSpecs;d(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var u=r[n],R=u.className,K=u.style,G=t.appendChild(o("div",null,"CodeMirror-gutter "+R));K&&(G.style.cssText=K),R=="CodeMirror-linenumbers"&&(e.lineGutter=G,G.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Xi(e)}function Ja(e){jo(e.display),Or(e),No(e)}function dl(e,t,r,n){var u=this;this.input=r,u.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),u.scrollbarFiller.setAttribute("cm-not-content","true"),u.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),u.gutterFiller.setAttribute("cm-not-content","true"),u.lineDiv=T("div",null,"CodeMirror-code"),u.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),u.cursorDiv=o("div",null,"CodeMirror-cursors"),u.measure=o("div",null,"CodeMirror-measure"),u.lineMeasure=o("div",null,"CodeMirror-measure"),u.lineSpace=T("div",[u.measure,u.lineMeasure,u.selectionDiv,u.cursorDiv,u.lineDiv],null,"position: relative; outline: none");var R=T("div",[u.lineSpace],"CodeMirror-lines");u.mover=o("div",[R],null,"position: relative"),u.sizer=o("div",[u.mover],"CodeMirror-sizer"),u.sizerWidth=null,u.heightForcer=o("div",null,null,"position: absolute; height: "+oe+"px; width: 1px;"),u.gutters=o("div",null,"CodeMirror-gutters"),u.lineGutter=null,u.scroller=o("div",[u.sizer,u.heightForcer,u.gutters],"CodeMirror-scroll"),u.scroller.setAttribute("tabIndex","-1"),u.wrapper=o("div",[u.scrollbarFiller,u.gutterFiller,u.scroller],"CodeMirror"),N&&I<8&&(u.gutters.style.zIndex=-1,u.scroller.style.paddingRight=0),!A&&!(D&&i)&&(u.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(u.wrapper):e(u.wrapper)),u.viewFrom=u.viewTo=t.first,u.reportedViewFrom=u.reportedViewTo=t.first,u.view=[],u.renderedView=null,u.externalMeasured=null,u.viewOffset=0,u.lastWrapHeight=u.lastWrapWidth=0,u.updateLineNumbers=null,u.nativeBarWidth=u.barHeight=u.barWidth=0,u.scrollbarsClipped=!1,u.lineNumWidth=u.lineNumInnerWidth=u.lineNumChars=null,u.alignWidgets=!1,u.cachedCharWidth=u.cachedTextHeight=u.cachedPaddingH=null,u.maxLine=null,u.maxLineLength=0,u.maxLineChanged=!1,u.wheelDX=u.wheelDY=u.wheelStartX=u.wheelStartY=null,u.shift=!1,u.selForContextMenu=null,u.activeTouch=null,u.gutterSpecs=Yi(n.gutters,n.lineNumbers),jo(u),r.init(u)}var yi=0,jr=null;N?jr=-.53:D?jr=15:v?jr=-.7:O&&(jr=-1/3);function Fo(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function cl(e){var t=Fo(e);return t.x*=jr,t.y*=jr,t}function Bo(e,t){var r=Fo(t),n=r.x,u=r.y,R=e.display,K=R.scroller,G=K.scrollWidth>K.clientWidth,Y=K.scrollHeight>K.clientHeight;if(!(n&&G||u&&Y))return;if(u&&a&&A){e:for(var J=t.target,le=R.view;J!=K;J=J.parentNode)for(var he=0;he<le.length;he++)if(le[he].node==J){e.display.currentWheelTarget=J;break e}}if(n&&!D&&!y&&jr!=null){u&&Y&&Xa(e,Math.max(0,K.scrollTop+u*jr)),ga(e,Math.max(0,K.scrollLeft+n*jr)),(!u||u&&Y)&&$(t),R.wheelStartX=null;return}if(u&&jr!=null){var Ae=u*jr,_e=e.doc.scrollTop,Ge=_e+R.wrapper.clientHeight;Ae<0?_e=Math.max(0,_e+Ae-50):Ge=Math.min(e.doc.height,Ge+Ae+50),Gi(e,{top:_e,bottom:Ge})}yi<20&&(R.wheelStartX==null?(R.wheelStartX=K.scrollLeft,R.wheelStartY=K.scrollTop,R.wheelDX=n,R.wheelDY=u,setTimeout(function(){if(R.wheelStartX==null)return;var et=K.scrollLeft-R.wheelStartX,lt=K.scrollTop-R.wheelStartY,mt=lt&&R.wheelDY&</R.wheelDY||et&&R.wheelDX&&et/R.wheelDX;if(R.wheelStartX=R.wheelStartY=null,!mt)return;jr=(jr*yi+mt)/(yi+1),++yi},200)):(R.wheelDX+=n,R.wheelDY+=u))}var Fr=function(e,t){this.ranges=e,this.primIndex=t};Fr.prototype.primary=function(){return this.ranges[this.primIndex]},Fr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!qn(r.anchor,n.anchor)||!qn(r.head,n.head))return!1}return!0},Fr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new xn(Tr(this.ranges[t].anchor),Tr(this.ranges[t].head));return new Fr(e,this.primIndex)},Fr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Fr.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(ct(t,n.from())>=0&&ct(e,n.to())<=0)return r}return-1};var xn=function(e,t){this.anchor=e,this.head=t};xn.prototype.from=function(){return Ur(this.anchor,this.head)},xn.prototype.to=function(){return pr(this.anchor,this.head)},xn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function $r(e,t,r){var n=e&&e.options.selectionsMayTouch,u=t[r];t.sort(function(Ae,_e){return ct(Ae.from(),_e.from())}),r=q(t,u);for(var R=1;R<t.length;R++){var K=t[R],G=t[R-1],Y=ct(G.to(),K.from());if(n&&!K.empty()?Y>0:Y>=0){var J=Ur(G.from(),K.from()),le=pr(G.to(),K.to()),he=G.empty()?K.from()==K.head:G.from()==G.head;R<=r&&--r,t.splice(--R,2,new xn(he?le:J,he?J:le))}}return new Fr(t,r)}function la(e,t){return new Fr([new xn(e,t||e)],0)}function ua(e){return e.text?rt(e.from.line+e.text.length-1,Te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Wo(e,t){if(ct(e,t.from)<0)return e;if(ct(e,t.to)<=0)return ua(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=ua(t).ch-t.to.ch),rt(r,n)}function $i(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var u=e.sel.ranges[n];r.push(new xn(Wo(u.anchor,t),Wo(u.head,t)))}return $r(e.cm,r,e.sel.primIndex)}function Ko(e,t,r){return e.line==t.line?rt(r.line,e.ch-t.ch+r.ch):rt(r.line+(e.line-t.line),e.ch)}function fl(e,t,r){for(var n=[],u=rt(e.first,0),R=u,K=0;K<t.length;K++){var G=t[K],Y=Ko(G.from,u,R),J=Ko(ua(G),u,R);if(u=G.to,R=J,r=="around"){var le=e.sel.ranges[K],he=ct(le.head,le.anchor)<0;n[K]=new xn(he?J:Y,he?Y:J)}else n[K]=new xn(Y,Y)}return new Fr(n,e.sel.primIndex)}function Ji(e){e.doc.mode=Be(e.options,e.doc.modeOption),Za(e)}function Za(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,$a(e,100),e.state.modeGen++,e.curOp&&Or(e)}function Ho(e,t){return t.from.ch==0&&t.to.ch==0&&Te(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Zi(e,t,r,n){function u(xt){return r?r[xt]:null}function R(xt,pt,_t){na(xt,pt,_t,n),sn(xt,"change",xt,t)}function K(xt,pt){for(var _t=[],Kt=xt;Kt<pt;++Kt)_t.push(new vr(J[Kt],u(Kt),n));return _t}var G=t.from,Y=t.to,J=t.text,le=bt(e,G.line),he=bt(e,Y.line),Ae=Te(J),_e=u(J.length-1),Ge=Y.line-G.line;if(t.full)e.insert(0,K(0,J.length)),e.remove(J.length,e.size-J.length);else if(Ho(e,t)){var et=K(0,J.length-1);R(he,he.text,_e),Ge&&e.remove(G.line,Ge),et.length&&e.insert(G.line,et)}else if(le==he)if(J.length==1)R(le,le.text.slice(0,G.ch)+Ae+le.text.slice(Y.ch),_e);else{var lt=K(1,J.length-1);lt.push(new vr(Ae+le.text.slice(Y.ch),_e,n)),R(le,le.text.slice(0,G.ch)+J[0],u(0)),e.insert(G.line+1,lt)}else if(J.length==1)R(le,le.text.slice(0,G.ch)+J[0]+he.text.slice(Y.ch),u(0)),e.remove(G.line+1,Ge);else{R(le,le.text.slice(0,G.ch)+J[0],u(0)),R(he,Ae+he.text.slice(Y.ch),_e);var mt=K(1,J.length-1);Ge>1&&e.remove(G.line+1,Ge-1),e.insert(G.line+1,mt)}sn(e,"change",e,t)}function da(e,t,r){function n(u,R,K){if(u.linked)for(var G=0;G<u.linked.length;++G){var Y=u.linked[G];if(Y.doc==R)continue;var J=K&&Y.sharedHist;if(r&&!J)continue;t(Y.doc,J),n(Y.doc,u,J)}}n(e,null,!0)}function zo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Fi(e),Ji(e),Go(e),e.options.lineWrapping||Gr(e),e.options.mode=t.modeOption,Or(e)}function Go(e){(e.doc.direction=="rtl"?j:f)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){kr(e,function(){Go(e),Or(e)})}function bi(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Qi(e,t){var r={from:Tr(t.from),to:ua(t),text:Dn(e,t.from,t.to)};return Yo(e,r,t.from.line,t.to.line+1),da(e,function(n){return Yo(n,r,t.from.line,t.to.line+1)},!0),r}function Xo(e){for(;e.length;){var t=Te(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return Xo(e.done),Te(e.done);if(e.done.length&&!Te(e.done).ranges)return Te(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Te(e.done)}function Vo(e,t,r,n){var u=e.history;u.undone.length=0;var R=+new Date,K,G;if((u.lastOp==n||u.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&u.lastModTime>R-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=ml(u,u.lastOp==n)))G=Te(K.changes),ct(t.from,t.to)==0&&ct(t.from,G.to)==0?G.to=ua(t):K.changes.push(Qi(e,t));else{var Y=Te(u.done);for((!Y||!Y.ranges)&&Ei(e.sel,u.done),K={changes:[Qi(e,t)],generation:u.generation},u.done.push(K);u.done.length>u.undoDepth;)u.done.shift(),u.done[0].ranges||u.done.shift()}u.done.push(r),u.generation=++u.maxGeneration,u.lastModTime=u.lastSelTime=R,u.lastOp=u.lastSelOp=n,u.lastOrigin=u.lastSelOrigin=t.origin,G||xe(e,"historyAdded")}function pl(e,t,r,n){var u=t.charAt(0);return u=="*"||u=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,r,n){var u=e.history,R=n&&n.origin;r==u.lastSelOp||R&&u.lastSelOrigin==R&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==R||pl(e,R,Te(u.done),t))?u.done[u.done.length-1]=t:Ei(t,u.done),u.lastSelTime=+new Date,u.lastSelOrigin=R,u.lastSelOp=r,n&&n.clearRedo!==!1&&Xo(u.undone)}function Ei(e,t){var r=Te(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Yo(e,t,r,n){var u=t["spans_"+e.id],R=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(K){K.markedSpans&&((u||(u=t["spans_"+e.id]={}))[R]=K.markedSpans),++R})}function gl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],u=0;u<t.text.length;++u)n.push(gl(r[u]));return n}function $o(e,t){var r=yl(e,t),n=Tn(e,t);if(!r)return n;if(!n)return r;for(var u=0;u<r.length;++u){var R=r[u],K=n[u];if(R&&K){e:for(var G=0;G<K.length;++G){for(var Y=K[G],J=0;J<R.length;++J)if(R[J].marker==Y.marker)continue e;R.push(Y)}}else K&&(r[u]=K)}return r}function Ra(e,t,r){for(var n=[],u=0;u<e.length;++u){var R=e[u];if(R.ranges){n.push(r?Fr.prototype.deepCopy.call(R):R);continue}var K=R.changes,G=[];n.push({changes:G});for(var Y=0;Y<K.length;++Y){var J=K[Y],le=void 0;if(G.push({from:J.from,to:J.to,text:J.text}),t)for(var he in J)(le=he.match(/^spans_(\d+)$/))&&(q(t,Number(le[1]))>-1&&(Te(G)[he]=J[he],delete J[he]))}}return n}function qi(e,t,r,n){if(n){var u=e.anchor;if(r){var R=ct(t,u)<0;R!=ct(r,u)<0?(u=t,t=r):R!=ct(t,r)<0&&(t=r)}return new xn(u,t)}else return new xn(r||t,t)}function xi(e,t,r,n,u){u==null&&(u=e.cm&&(e.cm.display.shift||e.extend)),Er(e,new Fr([qi(e.sel.primary(),t,r,u)],0),n)}function Jo(e,t,r){for(var n=[],u=e.cm&&(e.cm.display.shift||e.extend),R=0;R<e.sel.ranges.length;R++)n[R]=qi(e.sel.ranges[R],t[R],null,u);var K=$r(e.cm,n,e.sel.primIndex);Er(e,K,r)}function eo(e,t,r,n){var u=e.sel.ranges.slice(0);u[t]=r,Er(e,$r(e.cm,u,e.sel.primIndex),n)}function Zo(e,t,r,n){Er(e,la(t,r),n)}function bl(e,t,r){var n={ranges:t.ranges,update:function(u){this.ranges=[];for(var R=0;R<u.length;R++)this.ranges[R]=new xn(Rt(e,u[R].anchor),Rt(e,u[R].head))},origin:r&&r.origin};return xe(e,"beforeSelectionChange",e,n),e.cm&&xe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?$r(e.cm,n.ranges,n.ranges.length-1):t}function Qo(e,t,r){var n=e.history.done,u=Te(n);u&&u.ranges?(n[n.length-1]=t,Ti(e,t,r)):Er(e,t,r)}function Er(e,t,r){Ti(e,t,r),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Ti(e,t,r){(re(e,"beforeSelectionChange")||e.cm&&re(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var n=r&&r.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);qo(e,ts(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Da(e.cm)}function qo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,de(e.cm)),sn(e,"cursorActivity",e)}function es(e){qo(e,ts(e,e.sel,null,!1))}function ts(e,t,r,n){for(var u,R=0;R<t.ranges.length;R++){var K=t.ranges[R],G=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[R],Y=Ci(e,K.anchor,G&&G.anchor,r,n),J=Ci(e,K.head,G&&G.head,r,n);(u||Y!=K.anchor||J!=K.head)&&(u||(u=t.ranges.slice(0,R)),u[R]=new xn(Y,J))}return u?$r(e.cm,u,t.primIndex):t}function La(e,t,r,n,u){var R=bt(e,t.line);if(R.markedSpans)for(var K=0;K<R.markedSpans.length;++K){var G=R.markedSpans[K],Y=G.marker,J="selectLeft"in Y?!Y.selectLeft:Y.inclusiveLeft,le="selectRight"in Y?!Y.selectRight:Y.inclusiveRight;if((G.from==null||(J?G.from<=t.ch:G.from<t.ch))&&(G.to==null||(le?G.to>=t.ch:G.to>t.ch))){if(u&&(xe(Y,"beforeCursorEnter"),Y.explicitlyCleared))if(R.markedSpans){--K;continue}else break;if(!Y.atomic)continue;if(r){var he=Y.find(n<0?1:-1),Ae=void 0;if((n<0?le:J)&&(he=ns(e,he,-n,he&&he.line==t.line?R:null)),he&&he.line==t.line&&(Ae=ct(he,r))&&(n<0?Ae<0:Ae>0))return La(e,he,t,n,u)}var _e=Y.find(n<0?-1:1);return(n<0?J:le)&&(_e=ns(e,_e,n,_e.line==t.line?R:null)),_e?La(e,_e,t,n,u):null}}return t}function Ci(e,t,r,n,u){var R=n||1,K=La(e,t,r,R,u)||!u&&La(e,t,r,R,!0)||La(e,t,r,-R,u)||!u&&La(e,t,r,-R,!0);return K||(e.cantEdit=!0,rt(e.first,0))}function ns(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?Rt(e,rt(t.line-1)):null:r>0&&t.ch==(n||bt(e,t.line)).text.length?t.line<e.first+e.size-1?rt(t.line+1,0):null:new rt(t.line,t.ch+r)}function rs(e){e.setSelection(rt(e.firstLine(),0),rt(e.lastLine()),me)}function as(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(u,R,K,G){u&&(n.from=Rt(e,u)),R&&(n.to=Rt(e,R)),K&&(n.text=K),G!==void 0&&(n.origin=G)}),xe(e,"beforeChange",e,n),e.cm&&xe(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Pa(e,t,r){if(e.cm){if(!e.cm.curOp)return ar(e.cm,Pa)(e,t,r);if(e.cm.state.suppressEdits)return}if((re(e,"beforeChange")||e.cm&&re(e.cm,"beforeChange"))&&(t=as(e,t,!0),!t))return;var n=Ln&&!r&&dn(e,t.from,t.to);if(n)for(var u=n.length-1;u>=0;--u)is(e,{from:n[u].from,to:n[u].to,text:u?[""]:t.text,origin:t.origin});else is(e,t)}function is(e,t){if(t.text.length==1&&t.text[0]==""&&ct(t.from,t.to)==0)return;var r=$i(e,t);Vo(e,t,r,e.cm?e.cm.curOp.id:NaN),Qa(e,t,r,Tn(e,t));var n=[];da(e,function(u,R){!R&&q(n,u.history)==-1&&(us(u.history,t),n.push(u.history)),Qa(u,t,null,Tn(u,t))})}function _i(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var u=e.history,R,K=e.sel,G=t=="undo"?u.done:u.undone,Y=t=="undo"?u.undone:u.done,J=0;J<G.length&&!(R=G[J],r?R.ranges&&!R.equals(e.sel):!R.ranges);J++);if(J==G.length)return;for(u.lastOrigin=u.lastSelOrigin=null;;)if(R=G.pop(),R.ranges){if(Ei(R,Y),r&&!R.equals(e.sel)){Er(e,R,{clearRedo:!1});return}K=R}else if(n){G.push(R);return}else break;var le=[];Ei(K,Y),Y.push({changes:le,generation:u.generation}),u.generation=R.generation||++u.maxGeneration;for(var he=re(e,"beforeChange")||e.cm&&re(e.cm,"beforeChange"),Ae=function(et){var lt=R.changes[et];if(lt.origin=t,he&&!as(e,lt,!1))return G.length=0,{};le.push(Qi(e,lt));var mt=et?$i(e,lt):Te(G);Qa(e,lt,mt,$o(e,lt)),!et&&e.cm&&e.cm.scrollIntoView({from:lt.from,to:ua(lt)});var xt=[];da(e,function(pt,_t){!_t&&q(xt,pt.history)==-1&&(us(pt.history,lt),xt.push(pt.history)),Qa(pt,lt,null,$o(pt,lt))})},_e=R.changes.length-1;_e>=0;--_e){var Ge=Ae(_e);if(Ge)return Ge.v}}function os(e,t){if(t==0)return;if(e.first+=t,e.sel=new Fr(We(e.sel.ranges,function(u){return new xn(rt(u.anchor.line+t,u.anchor.ch),rt(u.head.line+t,u.head.ch))}),e.sel.primIndex),e.cm){Or(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)oa(e.cm,n,"gutter")}}function Qa(e,t,r,n){if(e.cm&&!e.cm.curOp)return ar(e.cm,Qa)(e,t,r,n);if(t.to.line<e.first){os(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var u=t.text.length-1-(e.first-t.from.line);os(e,u),t={from:rt(e.first,0),to:rt(t.to.line+u,t.to.ch),text:[Te(t.text)],origin:t.origin}}var R=e.lastLine();t.to.line>R&&(t={from:t.from,to:rt(R,bt(e,R).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Dn(e,t.from,t.to),r||(r=$i(e,t)),e.cm?El(e.cm,t,n):Zi(e,t,n),Ti(e,r,me),e.cantEdit&&Ci(e,rt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,r){var n=e.doc,u=e.display,R=t.from,K=t.to,G=!1,Y=R.line;e.options.lineWrapping||(Y=Gt(dr(bt(n,R.line))),n.iter(Y,K.line+1,function(_e){if(_e==u.maxLine)return G=!0,!0})),n.sel.contains(t.from,t.to)>-1&&de(e),Zi(n,t,r,Co(e)),e.options.lineWrapping||(n.iter(Y,R.line+t.text.length,function(_e){var Ge=Ot(_e);Ge>u.maxLineLength&&(u.maxLine=_e,u.maxLineLength=Ge,u.maxLineChanged=!0,G=!1)}),G&&(e.curOp.updateMaxLine=!0)),Zt(n,R.line),$a(e,400);var J=t.text.length-(K.line-R.line)-1;t.full?Or(e):R.line==K.line&&t.text.length==1&&!Ho(e.doc,t)?oa(e,R.line,"text"):Or(e,R.line,K.line+1,J);var le=re(e,"changes"),he=re(e,"change");if(he||le){var Ae={from:R,to:K,text:t.text,removed:t.removed,origin:t.origin};he&&sn(e,"change",e,Ae),le&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ae)}e.display.selForContextMenu=null}function Ma(e,t,r,n,u){var R;n||(n=r),ct(n,r)<0&&(R=[n,r],r=R[0],n=R[1]),typeof t=="string"&&(t=e.splitLines(t)),Pa(e,{from:r,to:n,text:t,origin:u})}function ss(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ls(e,t,r,n){for(var u=0;u<e.length;++u){var R=e[u],K=!0;if(R.ranges){R.copied||(R=e[u]=R.deepCopy(),R.copied=!0);for(var G=0;G<R.ranges.length;G++)ss(R.ranges[G].anchor,t,r,n),ss(R.ranges[G].head,t,r,n);continue}for(var Y=0;Y<R.changes.length;++Y){var J=R.changes[Y];if(r<J.from.line)J.from=rt(J.from.line+n,J.from.ch),J.to=rt(J.to.line+n,J.to.ch);else if(t<=J.to.line){K=!1;break}}K||(e.splice(0,u+1),u=0)}}function us(e,t){var r=t.from.line,n=t.to.line,u=t.text.length-(n-r)-1;ls(e.done,r,n,u),ls(e.undone,r,n,u)}function qa(e,t,r,n){var u=t,R=t;return typeof t=="number"?R=bt(e,Un(e,t)):u=Gt(t),u==null?null:(n(R,u)&&e.cm&&oa(e.cm,u,r),R)}function ei(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}ei.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var u=this.lines[r];this.height-=u.height,St(u),sn(u,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function ti(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var u=e[n];t+=u.chunkSize(),r+=u.height,u.parent=this}this.size=t,this.height=r,this.parent=null}ti.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],u=n.chunkSize();if(e<u){var R=Math.min(t,u-e),K=n.height;if(n.removeInner(e,R),this.height-=K-n.height,u==R&&(this.children.splice(r--,1),n.parent=null),(t-=R)==0)break;e=0}else e-=u}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ei))){var G=[];this.collapse(G),this.children=[new ei(G)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var u=this.children[n],R=u.chunkSize();if(e<=R){if(u.insertInner(e,t,r),u.lines&&u.lines.length>50){for(var K=u.lines.length%25+25,G=K;G<u.lines.length;){var Y=new ei(u.lines.slice(G,G+=25));u.height-=Y.height,this.children.splice(++n,0,Y),Y.parent=this}u.lines=u.lines.slice(0,K),this.maybeSpill()}break}e-=R}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new ti(t);if(e.parent){e.size-=r.size,e.height-=r.height;var u=q(e.parent.children,e);e.parent.children.splice(u+1,0,r)}else{var n=new ti(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var u=this.children[n],R=u.chunkSize();if(e<R){var K=Math.min(t,R-e);if(u.iterN(e,K,r))return!0;if((t-=K)==0)break;e=0}else e-=R}}};var ni=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};ni.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Gt(r);if(n==null||!t)return;for(var u=0;u<t.length;++u)t[u]==this&&t.splice(u--,1);t.length||(r.widgets=null);var R=br(this);Cn(r,Math.max(0,r.height-R)),e&&(kr(e,function(){ds(e,r,-R),oa(e,n,"widget")}),sn(e,"lineWidgetCleared",e,this,n))},ni.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var u=br(this)-t;if(!u)return;Sr(this.doc,n)||Cn(n,n.height+u),r&&kr(r,function(){r.curOp.forceUpdate=!0,ds(r,n,u),sn(r,"lineWidgetChanged",r,e,Gt(n))})},ne(ni);function ds(e,t,r){jn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Hi(e,r)}function xl(e,t,r,n){var u=new ni(e,r,n),R=e.cm;return R&&u.noHScroll&&(R.display.alignWidgets=!0),qa(e,t,"widget",function(K){var G=K.widgets||(K.widgets=[]);if(u.insertAt==null?G.push(u):G.splice(Math.min(G.length-1,Math.max(0,u.insertAt)),0,u),u.line=K,R&&!Sr(e,K)){var Y=jn(K)<e.scrollTop;Cn(K,K.height+br(u)),Y&&Hi(R,u.height),R.curOp.forceUpdate=!0}return!0}),R&&sn(R,"lineWidgetAdded",R,u,typeof t=="number"?t:Gt(t)),u}var cs=0,ca=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++cs};ca.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ba(e),re(this,"clear")){var r=this.find();r&&sn(this,"clear",r.from,r.to)}for(var n=null,u=null,R=0;R<this.lines.length;++R){var K=this.lines[R],G=En(K.markedSpans,this);e&&!this.collapsed?oa(e,Gt(K),"text"):e&&(G.to!=null&&(u=Gt(K)),G.from!=null&&(n=Gt(K))),K.markedSpans=An(K.markedSpans,G),G.from==null&&this.collapsed&&!Sr(this.doc,K)&&e&&Cn(K,Sa(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Y=0;Y<this.lines.length;++Y){var J=dr(this.lines[Y]),le=Ot(J);le>e.display.maxLineLength&&(e.display.maxLine=J,e.display.maxLineLength=le,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Or(e,n,u+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&es(e.doc)),e&&sn(e,"markerCleared",e,this,n,u),t&&Ea(e),this.parent&&this.parent.clear()},ca.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,u=0;u<this.lines.length;++u){var R=this.lines[u],K=En(R.markedSpans,this);if(K.from!=null&&(r=rt(t?R:Gt(R),K.from),e==-1))return r;if(K.to!=null&&(n=rt(t?R:Gt(R),K.to),e==1))return n}return r&&{from:r,to:n}},ca.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;kr(n,function(){var u=t.line,R=Gt(t.line),K=Ir(n,R);if(K&&(po(K),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Sr(r.doc,u)&&r.height!=null){var G=r.height;r.height=null;var Y=br(r)-G;Y&&Cn(u,u.height+Y)}sn(n,"markerChanged",n,e)})},ca.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||q(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ca.prototype.detachLine=function(e){if(this.lines.splice(q(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ne(ca);function Ia(e,t,r,n,u){if(n&&n.shared)return Tl(e,t,r,n,u);if(e.cm&&!e.cm.curOp)return ar(e.cm,Ia)(e,t,r,n,u);var R=new ca(e,u),K=ct(t,r);if(n&&U(n,R,!1),K>0||K==0&&R.clearWhenEmpty!==!1)return R;if(R.replacedWith&&(R.collapsed=!0,R.widgetNode=T("span",[R.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||R.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(R.widgetNode.insertLeft=!0)),R.collapsed){if(Mn(e,t.line,t,r,R)||t.line!=r.line&&Mn(e,r.line,t,r,R))throw new Error("Inserting collapsed marker partially overlapping an existing one");kn()}R.addToHistory&&Vo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var G=t.line,Y=e.cm,J;if(e.iter(G,r.line+1,function(he){Y&&R.collapsed&&!Y.options.lineWrapping&&dr(he)==Y.display.maxLine&&(J=!0),R.collapsed&&G!=t.line&&Cn(he,0),nr(he,new wn(R,G==t.line?t.ch:null,G==r.line?r.ch:null)),++G}),R.collapsed&&e.iter(t.line,r.line+1,function(he){Sr(e,he)&&Cn(he,0)}),R.clearOnEnter&&pe(R,"beforeCursorEnter",function(){return R.clear()}),R.readOnly&&(Pn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),R.collapsed&&(R.id=++cs,R.atomic=!0),Y){if(J&&(Y.curOp.updateMaxLine=!0),R.collapsed)Or(Y,t.line,r.line+1);else if(R.className||R.startStyle||R.endStyle||R.css||R.attributes||R.title)for(var le=t.line;le<=r.line;le++)oa(Y,le,"text");R.atomic&&es(Y.doc),sn(Y,"markerAdded",Y,R)}return R}var ri=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};ri.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sn(this,"clear")},ri.prototype.find=function(e,t){return this.primary.find(e,t)},ne(ri);function Tl(e,t,r,n,u){n=U(n),n.shared=!1;var R=[Ia(e,t,r,n,u)],K=R[0],G=n.widgetNode;return da(e,function(Y){G&&(n.widgetNode=G.cloneNode(!0)),R.push(Ia(Y,Rt(Y,t),Rt(Y,r),n,u));for(var J=0;J<Y.linked.length;++J)if(Y.linked[J].isParent)return;K=Te(R)}),new ri(R,K)}function fs(e){return e.findMarks(rt(e.first,0),e.clipPos(rt(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var r=0;r<t.length;r++){var n=t[r],u=n.find(),R=e.clipPos(u.from),K=e.clipPos(u.to);if(ct(R,K)){var G=Ia(e,R,K,n.primary,n.primary.type);n.markers.push(G),G.parent=n}}}function _l(e){for(var t=function(n){var u=e[n],R=[u.primary.doc];da(u.primary.doc,function(Y){return R.push(Y)});for(var K=0;K<u.markers.length;K++){var G=u.markers[K];q(R,G.doc)==-1&&(G.parent=null,u.markers.splice(K--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,Dr=function(e,t,r,n,u){if(!(this instanceof Dr))return new Dr(e,t,r,n,u);r==null&&(r=0),ti.call(this,[new ei([new vr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var R=rt(r,0);this.sel=la(R),this.history=new bi(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=u=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Zi(this,{from:R,to:R,text:e}),Er(this,la(R),me)};Dr.prototype=Ze(ti.prototype,{constructor:Dr,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Gn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ir(function(e){var t=rt(this.first,0),r=this.first+this.size-1;Pa(this,{from:t,to:rt(r,bt(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ga(this.cm,0,0),Er(this,la(t),me)}),replaceRange:function(e,t,r,n){t=Rt(this,t),r=r?Rt(this,r):t,Ma(this,e,t,r,n)},getRange:function(e,t,r){var n=Dn(this,Rt(this,e),Rt(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Bn(this,e))return bt(this,e)},getLineNumber:function(e){return Gt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=bt(this,e)),dr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Rt(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ir(function(e,t,r){Zo(this,Rt(this,typeof e=="number"?rt(e,t||0):e),null,r)}),setSelection:ir(function(e,t,r){Zo(this,Rt(this,e),Rt(this,t||e),r)}),extendSelection:ir(function(e,t,r){xi(this,Rt(this,e),t&&Rt(this,t),r)}),extendSelections:ir(function(e,t){Jo(this,Se(this,e),t)}),extendSelectionsBy:ir(function(e,t){var r=We(this.sel.ranges,e);Jo(this,Se(this,r),t)}),setSelections:ir(function(e,t,r){if(!e.length)return;for(var n=[],u=0;u<e.length;u++)n[u]=new xn(Rt(this,e[u].anchor),Rt(this,e[u].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Er(this,$r(this.cm,n,t),r)}),addSelection:ir(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new xn(Rt(this,e),Rt(this,t||e))),Er(this,$r(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var u=Dn(this,t[n].from(),t[n].to());r=r?r.concat(u):u}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var u=Dn(this,r[n].from(),r[n].to());e!==!1&&(u=u.join(e||this.lineSeparator())),t[n]=u}return t},replaceSelection:function(e,t,r){for(var n=[],u=0;u<this.sel.ranges.length;u++)n[u]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ir(function(e,t,r){for(var n=[],u=this.sel,R=0;R<u.ranges.length;R++){var K=u.ranges[R];n[R]={from:K.from(),to:K.to(),text:this.splitLines(e[R]),origin:r}}for(var G=t&&t!="end"&&fl(this,n,t),Y=n.length-1;Y>=0;Y--)Pa(this,n[Y]);G?Qo(this,G):this.cm&&Da(this.cm)}),undo:ir(function(){_i(this,"undo")}),redo:ir(function(){_i(this,"redo")}),undoSelection:ir(function(){_i(this,"undo",!0)}),redoSelection:ir(function(){_i(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var u=0;u<e.undone.length;u++)e.undone[u].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new bi(this.history.maxGeneration),da(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ra(this.history.done),undone:Ra(this.history.undone)}},setHistory:function(e){var t=this.history=new bi(this.history.maxGeneration);t.done=Ra(e.done.slice(0),null,!0),t.undone=Ra(e.undone.slice(0),null,!0)},setGutterMarker:ir(function(e,t,r){return qa(this,e,"gutter",function(n){var u=n.gutterMarkers||(n.gutterMarkers={});return u[t]=r,!r&&Qe(u)&&(n.gutterMarkers=null),!0})}),clearGutter:ir(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&qa(t,r,"gutter",function(){return r.gutterMarkers[e]=null,Qe(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Bn(this,e))return null;if(t=e,e=bt(this,e),!e)return null}else if(t=Gt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ir(function(e,t,r){return qa(this,e,t=="gutter"?"gutter":"class",function(n){var u=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[u])n[u]=r;else{if(E(r).test(n[u]))return!1;n[u]+=" "+r}return!0})}),removeLineClass:ir(function(e,t,r){return qa(this,e,t=="gutter"?"gutter":"class",function(n){var u=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",R=n[u];if(R)if(r==null)n[u]=null;else{var K=R.match(E(r));if(!K)return!1;var G=K.index+K[0].length;n[u]=R.slice(0,K.index)+(!K.index||G==R.length?"":" ")+R.slice(G)||null}else return!1;return!0})}),addLineWidget:ir(function(e,t,r){return xl(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Ia(this,Rt(this,e),Rt(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Rt(this,e),Ia(this,e,e,r,"bookmark")},findMarksAt:function(e){e=Rt(this,e);var t=[],r=bt(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var u=r[n];(u.from==null||u.from<=e.ch)&&(u.to==null||u.to>=e.ch)&&t.push(u.marker.parent||u.marker)}return t},findMarks:function(e,t,r){e=Rt(this,e),t=Rt(this,t);var n=[],u=e.line;return this.iter(e.line,t.line+1,function(R){var K=R.markedSpans;if(K)for(var G=0;G<K.length;G++){var Y=K[G];!(Y.to!=null&&u==e.line&&e.ch>=Y.to||Y.from==null&&u!=e.line||Y.from!=null&&u==t.line&&Y.from>=t.ch)&&(!r||r(Y.marker))&&n.push(Y.marker.parent||Y.marker)}++u}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(u){var R=u.text.length+n;if(R>e)return t=e,!0;e-=R,++r}),Rt(this,rt(r,t))},indexFromPos:function(e){e=Rt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new Dr(Gn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new Dr(Gn(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(n,fs(this)),n},unlinkDoc:function(e){if(e instanceof Nn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),_l(fs(this));break}if(e.history==this.history){var n=[e.id];da(e,function(u){return n.push(u.id)},!0),e.history=new bi(null),e.history.done=Ra(this.history.done,n),e.history.undone=Ra(this.history.undone,n)}},iterLinkedDocs:function(e){da(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Le(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:ir(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),Dr.prototype.eachLine=Dr.prototype.iter;var hs=0;function wl(e){var t=this;if(ms(t),Re(t,e)||Ft(t.display,e))return;$(e),N&&(hs=+new Date);var r=pa(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var u=n.length,R=Array(u),K=0,G=function(){++K==u&&ar(t,function(){r=Rt(t.doc,r);var _e={from:r,to:r,text:t.doc.splitLines(R.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};Pa(t.doc,_e),Qo(t.doc,la(Rt(t.doc,r),Rt(t.doc,ua(_e))))})()},Y=function(_e,Ge){if(t.options.allowDropFileTypes&&q(t.options.allowDropFileTypes,_e.type)==-1){G();return}var et=new FileReader;et.onerror=function(){return G()},et.onload=function(){var lt=et.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(lt)){G();return}R[Ge]=lt,G()},et.readAsText(_e)},J=0;J<n.length;J++)Y(n[J],J);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var le=e.dataTransfer.getData("Text");if(le){var he;if(t.state.draggingText&&!t.state.draggingText.copy&&(he=t.listSelections()),Ti(t.doc,la(r,r)),he)for(var Ae=0;Ae<he.length;++Ae)Ma(t.doc,"",he[Ae].anchor,he[Ae].head,"drag");t.replaceSelection(le,"around","paste"),t.display.input.focus()}}catch(_e){}}}function Ol(e,t){if(N&&(!e.state.draggingText||+new Date-hs<100)){ie(t);return}if(Re(e,t)||Ft(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!O){var r=o("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",y&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),y&&r.parentNode.removeChild(r)}}function Dl(e,t){var r=pa(e,t);if(!r)return;var n=document.createDocumentFragment();wo(e,r,n),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,n)}function ms(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ps(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var u=t[n].CodeMirror;u&&r.push(u)}r.length&&r[0].operation(function(){for(var R=0;R<r.length;R++)e(r[R])})}var vs=!1;function Al(){if(vs)return;Rl(),vs=!0}function Rl(){var e;pe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ps(Ll)},100))}),pe(window,"blur",function(){return ps(Oa)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var fa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ai=0;ai<10;ai++)fa[ai+48]=fa[ai+96]=String(ai);for(var Si=65;Si<=90;Si++)fa[Si]=String.fromCharCode(Si);for(var ii=1;ii<=12;ii++)fa[ii+111]=fa[ii+63235]="F"+ii;var aa={};aa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},aa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},aa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},aa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},aa.default=a?aa.macDefault:aa.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,u,R,K=0;K<t.length-1;K++){var G=t[K];if(/^(cmd|meta|m)$/i.test(G))R=!0;else if(/^a(lt)?$/i.test(G))r=!0;else if(/^(c|ctrl|control)$/i.test(G))n=!0;else if(/^s(hift)?$/i.test(G))u=!0;else throw new Error("Unrecognized modifier name: "+G)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),R&&(e="Cmd-"+e),u&&(e="Shift-"+e),e}function Ml(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var u=We(r.split(" "),Pl),R=0;R<u.length;R++){var K=void 0,G=void 0;R==u.length-1?(G=u.join(" "),K=n):(G=u.slice(0,R+1).join(" "),K="...");var Y=t[G];if(!Y)t[G]=K;else if(Y!=K)throw new Error("Inconsistent bindings for "+G)}delete e[r]}for(var J in t)e[J]=t[J];return e}function ka(e,t,r,n){t=wi(t);var u=t.call?t.call(e,n):t[e];if(u===!1)return"nothing";if(u==="...")return"multi";if(u!=null&&r(u))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ka(e,t.fallthrough,r,n);for(var R=0;R<t.fallthrough.length;R++){var K=ka(e,t.fallthrough[R],r,n);if(K)return K}}}function gs(e){var t=typeof e=="string"?e:fa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ys(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(h?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(h?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function bs(e,t){if(y&&e.keyCode==34&&e.char)return!1;var r=fa[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),ys(r,e,t))}function wi(e){return typeof e=="string"?aa[e]:e}function Na(e,t){for(var r=e.doc.sel.ranges,n=[],u=0;u<r.length;u++){for(var R=t(r[u]);n.length&&ct(R.from,Te(n).to)<=0;){var K=n.pop();if(ct(K.from,R.from)<0){R.from=K.from;break}}n.push(R)}kr(e,function(){for(var G=n.length-1;G>=0;G--)Ma(e.doc,"",n[G].from,n[G].to,"+delete");Da(e)})}function to(e,t,r){var n=He(e.text,t+r,r);return n<0||n>e.text.length?null:n}function no(e,t,r){var n=to(e,t.ch,r);return n==null?null:new rt(t.line,n,r<0?"after":"before")}function ro(e,t,r,n,u){if(e){t.doc.direction=="rtl"&&(u=-u);var R=ht(r,t.doc.direction);if(R){var K=u<0?Te(R):R[0],G=u<0==(K.level==1),Y=G?"after":"before",J;if(K.level>0||t.doc.direction=="rtl"){var le=_a(t,r);J=u<0?r.text.length-1:0;var he=ea(t,le,J).top;J=st(function(Ae){return ea(t,le,Ae).top==he},u<0==(K.level==1)?K.from:K.to-1,J),Y=="before"&&(J=to(r,J,1))}else J=u<0?K.to:K.from;return new rt(n,J,Y)}}return new rt(n,u<0?r.text.length:0,u<0?"before":"after")}function Il(e,t,r,n){var u=ht(t,e.doc.direction);if(!u)return no(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var R=ut(u,r.ch,r.sticky),K=u[R];if(e.doc.direction=="ltr"&&K.level%2==0&&(n>0?K.to>r.ch:K.from<r.ch))return no(t,r,n);var G=function(mt,xt){return to(t,mt instanceof rt?mt.ch:mt,xt)},Y,J=function(mt){return e.options.lineWrapping?(Y=Y||_a(e,t),To(e,t,Y,mt)):{begin:0,end:t.text.length}},le=J(r.sticky=="before"?G(r,-1):r.ch);if(e.doc.direction=="rtl"||K.level==1){var he=K.level==1==n<0,Ae=G(r,he?1:-1);if(Ae!=null&&(he?Ae<=K.to&&Ae<=le.end:Ae>=K.from&&Ae>=le.begin)){var _e=he?"before":"after";return new rt(r.line,Ae,_e)}}var Ge=function(mt,xt,pt){for(var _t=function(Rn,or){return or?new rt(r.line,G(Rn,1),"before"):new rt(r.line,Rn,"after")};mt>=0&&mt<u.length;mt+=xt){var Kt=u[mt],It=xt>0==(Kt.level!=1),nn=It?pt.begin:G(pt.end,-1);if(Kt.from<=nn&&nn<Kt.to)return _t(nn,It);if(nn=It?Kt.from:G(Kt.to,-1),pt.begin<=nn&&nn<pt.end)return _t(nn,It)}},et=Ge(R+n,n,le);if(et)return et;var lt=n>0?le.end:G(le.begin,-1);return lt!=null&&!(n>0&<==t.text.length)&&(et=Ge(n>0?0:u.length-1,n,J(lt)),et)?et:null}var oi={selectAll:rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),me)},killLine:function(e){return Na(e,function(t){if(t.empty()){var r=bt(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:rt(t.head.line+1,0)}:{from:t.head,to:rt(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Na(e,function(t){return{from:rt(t.from().line,0),to:Rt(e.doc,rt(t.to().line+1,0))}})},delLineLeft:function(e){return Na(e,function(t){return{from:rt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Na(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Na(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(rt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(rt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Es(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return xs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},ve)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},ve)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?xs(e,t.head):n},ve)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,u=0;u<r.length;u++){var R=r[u].from(),K=z(e.getLine(R.line),R.ch,n);t.push(se(n-K%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return kr(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var u=t[n].head,R=bt(e.doc,u.line).text;if(R){if(u.ch==R.length&&(u=new rt(u.line,u.ch-1)),u.ch>0)u=new rt(u.line,u.ch+1),e.replaceRange(R.charAt(u.ch-1)+R.charAt(u.ch-2),rt(u.line,u.ch-2),u,"+transpose");else if(u.line>e.doc.first){var K=bt(e.doc,u.line-1).text;K&&(u=new rt(u.line,1),e.replaceRange(R.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),rt(u.line-1,K.length-1),u,"+transpose"))}}r.push(new xn(u,u))}e.setSelections(r)})},newlineAndIndent:function(e){return kr(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Da(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Es(e,t){var r=bt(e.doc,t),n=dr(r);return n!=r&&(t=Gt(n)),ro(!0,e,n,t,1)}function kl(e,t){var r=bt(e.doc,t),n=Zr(r);return n!=r&&(t=Gt(n)),ro(!0,e,r,t,-1)}function xs(e,t){var r=Es(e,t.line),n=bt(e.doc,r.line),u=ht(n,e.doc.direction);if(!u||u[0].level==0){var R=Math.max(r.ch,n.text.search(/\S/)),K=t.line==r.line&&t.ch<=R&&t.ch;return rt(r.line,K?0:R,r.sticky)}return r}function Oi(e,t,r){if(typeof t=="string"&&(t=oi[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,u=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),u=t(e)!=ye}finally{e.display.shift=n,e.state.suppressEdits=!1}return u}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var u=ka(t,e.state.keyMaps[n],r,e);if(u)return u}return e.options.extraKeys&&ka(t,e.options.extraKeys,r,e)||ka(t,e.options.keyMap,r,e)}var Ul=new Z;function si(e,t,r,n){var u=e.state.keySeq;if(u){if(gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==u&&(e.state.keySeq=null,e.display.input.reset())}),Ts(e,u+" "+t,r,n))return!0}return Ts(e,t,r,n)}function Ts(e,t,r,n){var u=Nl(e,t,n);return u=="multi"&&(e.state.keySeq=t),u=="handled"&&sn(e,"keyHandled",e,t,r),(u=="handled"||u=="multi")&&($(r),Bi(e)),!!u}function Cs(e,t){var r=bs(t,!0);return r?t.shiftKey&&!e.state.keySeq?si(e,"Shift-"+r,t,function(n){return Oi(e,n,!0)})||si(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Oi(e,n)}):si(e,r,t,function(n){return Oi(e,n)}):!1}function jl(e,t,r){return si(e,"'"+r+"'",t,function(n){return Oi(e,n,!0)})}var ao=null;function _s(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),Re(t,e))return;N&&I<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=Cs(t,e);y&&(ao=n?r:null,!n&&r==88&&!we&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!a&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(f(t,"CodeMirror-crosshair"),Ne(document,"keyup",r),Ne(document,"mouseover",r))}pe(document,"keyup",r),pe(document,"mouseover",r)}function Ss(e){e.keyCode==16&&(this.doc.sel.shift=!1),Re(this,e)}function ws(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ft(t.display,e)||Re(t,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(y&&r==ao){ao=null,$(e);return}if(y&&(!e.which||e.which<10)&&Cs(t,e))return;var u=String.fromCharCode(n==null?r:n);if(u=="\b")return;if(jl(t,e,u))return;t.display.input.onKeyPress(e)}var Bl=400,io=function(e,t,r){this.time=e,this.pos=t,this.button=r};io.prototype.compare=function(e,t,r){return this.time+Bl>e&&ct(t,this.pos)==0&&r==this.button};var li,ui;function Wl(e,t){var r=+new Date;return ui&&ui.compare(r,e,t)?(li=ui=null,"triple"):li&&li.compare(r,e,t)?(ui=new io(r,e,t),li=null,"double"):(li=new io(r,e,t),ui=null,"single")}function Os(e){var t=this,r=t.display;if(Re(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,Ft(r,e)){A||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(oo(t,e))return;var n=pa(t,e),u=Ce(e),R=n?Wl(n,u):"single";if(window.focus(),u==1&&t.state.selectingText&&t.state.selectingText(e),n&&Kl(t,u,n,R,e))return;u==1?n?zl(t,n,R,e):ue(e)==r.scroller&&$(e):u==2?(n&&xi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):u==3&&(w?t.display.input.onContextMenu(e):Do(t))}function Kl(e,t,r,n,u){var R="Click";return n=="double"?R="Double"+R:n=="triple"&&(R="Triple"+R),R=(t==1?"Left":t==2?"Middle":"Right")+R,si(e,ys(R,u),u,function(K){if(typeof K=="string"&&(K=oi[K]),!K)return!1;var G=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),G=K(e,r)!=ye}finally{e.state.suppressEdits=!1}return G})}function Hl(e,t,r){var n=e.getOption("configureMouse"),u=n?n(e,t,r):{};if(u.unit==null){var R=c?r.shiftKey&&r.metaKey:r.altKey;u.unit=R?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(u.extend==null||e.doc.extend)&&(u.extend=e.doc.extend||r.shiftKey),u.addNew==null&&(u.addNew=a?r.metaKey:r.ctrlKey),u.moveOnDrag==null&&(u.moveOnDrag=!(a?r.altKey:r.ctrlKey)),u}function zl(e,t,r,n){N?setTimeout(W(Oo,e),0):e.curOp.focus=P();var u=Hl(e,r,n),R=e.doc.sel,K;e.options.dragDrop&&Oe&&!e.isReadOnly()&&r=="single"&&(K=R.contains(t))>-1&&(ct((K=R.ranges[K]).from(),t)<0||t.xRel>0)&&(ct(K.to(),t)>0||t.xRel<0)?Gl(e,n,t,u):Xl(e,n,t,u)}function Gl(e,t,r,n){var u=e.display,R=!1,K=ar(e,function(J){A&&(u.scroller.draggable=!1),e.state.draggingText=!1,Ne(u.wrapper.ownerDocument,"mouseup",K),Ne(u.wrapper.ownerDocument,"mousemove",G),Ne(u.scroller,"dragstart",Y),Ne(u.scroller,"drop",K),R||($(J),n.addNew||xi(e.doc,r,null,null,n.extend),A&&!O||N&&I==9?setTimeout(function(){u.wrapper.ownerDocument.body.focus({preventScroll:!0}),u.input.focus()},20):u.input.focus())}),G=function(J){R=R||Math.abs(t.clientX-J.clientX)+Math.abs(t.clientY-J.clientY)>=10},Y=function(){return R=!0};A&&(u.scroller.draggable=!0),e.state.draggingText=K,K.copy=!n.moveOnDrag,u.scroller.dragDrop&&u.scroller.dragDrop(),pe(u.wrapper.ownerDocument,"mouseup",K),pe(u.wrapper.ownerDocument,"mousemove",G),pe(u.scroller,"dragstart",Y),pe(u.scroller,"drop",K),Do(e),setTimeout(function(){return u.input.focus()},20)}function Ds(e,t,r){if(r=="char")return new xn(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new xn(rt(t.line,0),Rt(e.doc,rt(t.line+1,0)));var n=r(e,t);return new xn(n.from,n.to)}function Xl(e,t,r,n){var u=e.display,R=e.doc;$(t);var K,G,Y=R.sel,J=Y.ranges;if(n.addNew&&!n.extend?(G=R.sel.contains(r),G>-1?K=J[G]:K=new xn(r,r)):(K=R.sel.primary(),G=R.sel.primIndex),n.unit=="rectangle")n.addNew||(K=new xn(r,r)),r=pa(e,t,!0,!0),G=-1;else{var le=Ds(e,r,n.unit);n.extend?K=qi(K,le.anchor,le.head,n.extend):K=le}n.addNew?G==-1?(G=J.length,Er(R,$r(e,J.concat([K]),G),{scroll:!1,origin:"*mouse"})):J.length>1&&J[G].empty()&&n.unit=="char"&&!n.extend?(Er(R,$r(e,J.slice(0,G).concat(J.slice(G+1)),0),{scroll:!1,origin:"*mouse"}),Y=R.sel):eo(R,G,K,fe):(G=0,Er(R,new Fr([K],0),fe),Y=R.sel);var he=r;function Ae(pt){if(ct(he,pt)==0)return;if(he=pt,n.unit=="rectangle"){for(var _t=[],Kt=e.options.tabSize,It=z(bt(R,r.line).text,r.ch,Kt),nn=z(bt(R,pt.line).text,pt.ch,Kt),Rn=Math.min(It,nn),or=Math.max(It,nn),Fn=Math.min(r.line,pt.line),Nr=Math.min(e.lastLine(),Math.max(r.line,pt.line));Fn<=Nr;Fn++){var Ar=bt(R,Fn).text,Zn=ge(Ar,Rn,Kt);Rn==or?_t.push(new xn(rt(Fn,Zn),rt(Fn,Zn))):Ar.length>Zn&&_t.push(new xn(rt(Fn,Zn),rt(Fn,ge(Ar,or,Kt))))}_t.length||_t.push(new xn(r,r)),Er(R,$r(e,Y.ranges.slice(0,G).concat(_t),G),{origin:"*mouse",scroll:!1}),e.scrollIntoView(pt)}else{var Rr=K,hr=Ds(e,pt,n.unit),tr=Rr.anchor,Qn;ct(hr.anchor,tr)>0?(Qn=hr.head,tr=Ur(Rr.from(),hr.anchor)):(Qn=hr.anchor,tr=pr(Rr.to(),hr.head));var Wn=Y.ranges.slice(0);Wn[G]=Vl(e,new xn(Rt(R,tr),Qn)),Er(R,$r(e,Wn,G),fe)}}var _e=u.wrapper.getBoundingClientRect(),Ge=0;function et(pt){var _t=++Ge,Kt=pa(e,pt,!0,n.unit=="rectangle");if(!Kt)return;if(ct(Kt,he)!=0){e.curOp.focus=P(),Ae(Kt);var It=pi(u,R);(Kt.line>=It.to||Kt.line<It.from)&&setTimeout(ar(e,function(){Ge==_t&&et(pt)}),150)}else{var nn=pt.clientY<_e.top?-20:pt.clientY>_e.bottom?20:0;nn&&setTimeout(ar(e,function(){if(Ge!=_t)return;u.scroller.scrollTop+=nn,et(pt)}),50)}}function lt(pt){e.state.selectingText=!1,Ge=Infinity,pt&&($(pt),u.input.focus()),Ne(u.wrapper.ownerDocument,"mousemove",mt),Ne(u.wrapper.ownerDocument,"mouseup",xt),R.history.lastSelOrigin=null}var mt=ar(e,function(pt){pt.buttons===0||!Ce(pt)?lt(pt):et(pt)}),xt=ar(e,lt);e.state.selectingText=xt,pe(u.wrapper.ownerDocument,"mousemove",mt),pe(u.wrapper.ownerDocument,"mouseup",xt)}function Vl(e,t){var r=t.anchor,n=t.head,u=bt(e.doc,r.line);if(ct(r,n)==0&&r.sticky==n.sticky)return t;var R=ht(u);if(!R)return t;var K=ut(R,r.ch,r.sticky),G=R[K];if(G.from!=r.ch&&G.to!=r.ch)return t;var Y=K+(G.from==r.ch==(G.level!=1)?0:1);if(Y==0||Y==R.length)return t;var J;if(n.line!=r.line)J=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var le=ut(R,n.ch,n.sticky),he=le-K||(n.ch-r.ch)*(G.level==1?-1:1);le==Y-1||le==Y?J=he<0:J=he>0}var Ae=R[Y+(J?-1:0)],_e=J==(Ae.level==1),Ge=_e?Ae.from:Ae.to,et=_e?"after":"before";return r.ch==Ge&&r.sticky==et?t:new xn(new rt(r.line,Ge,et),n)}function As(e,t,r,n){var u,R;if(t.touches)u=t.touches[0].clientX,R=t.touches[0].clientY;else try{u=t.clientX,R=t.clientY}catch(Ae){return!1}if(u>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&$(t);var K=e.display,G=K.lineDiv.getBoundingClientRect();if(R>G.bottom||!re(e,r))return te(t);R-=G.top-K.viewOffset;for(var Y=0;Y<e.display.gutterSpecs.length;++Y){var J=K.gutters.childNodes[Y];if(J&&J.getBoundingClientRect().right>=u){var le=_n(e.doc,R),he=e.display.gutterSpecs[Y];return xe(e,r,e,le,he.className,t),te(t)}}}function oo(e,t){return As(e,t,"gutterClick",!0)}function Rs(e,t){if(Ft(e.display,t)||Yl(e,t))return;if(Re(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Yl(e,t){return re(e,"gutterContextMenu")?As(e,t,"gutterContextMenu",!1):!1}function Ls(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ha(e)}var Ua={toString:function(){return"CodeMirror.Init"}},Ps={},Di={};function $l(e){var t=e.optionHandlers;function r(n,u,R,K){e.defaults[n]=u,R&&(t[n]=K?function(G,Y,J){J!=Ua&&R(G,Y,J)}:R)}e.defineOption=r,e.Init=Ua,r("value","",function(n,u){return n.setValue(u)},!0),r("mode",null,function(n,u){n.doc.modeOption=u,Ji(n)},!0),r("indentUnit",2,Ji,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Za(n),Ha(n),Or(n)},!0),r("lineSeparator",null,function(n,u){if(n.doc.lineSep=u,!u)return;var R=[],K=n.doc.first;n.doc.iter(function(Y){for(var J=0;;){var le=Y.text.indexOf(u,J);if(le==-1)break;J=le+u.length,R.push(rt(K,le))}K++});for(var G=R.length-1;G>=0;G--)Ma(n.doc,u,R[G],rt(R[G].line,R[G].ch+u.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,u,R){n.state.specialChars=new RegExp(u.source+(u.test(" ")?"":"| "),"g"),R!=Ua&&n.refresh()}),r("specialCharPlaceholder",yn,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,u){return n.getInputField().spellcheck=u},!0),r("autocorrect",!1,function(n,u){return n.getInputField().autocorrect=u},!0),r("autocapitalize",!1,function(n,u){return n.getInputField().autocapitalize=u},!0),r("rtlMoveVisually",!C),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Ls(n),Ja(n)},!0),r("keyMap","default",function(n,u,R){var K=wi(u),G=R!=Ua&&wi(R);G&&G.detach&&G.detach(n,K),K.attach&&K.attach(n,G||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,u){n.display.gutterSpecs=Yi(u,n.options.lineNumbers),Ja(n)},!0),r("fixedGutter",!0,function(n,u){n.display.gutters.style.left=u?ji(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Aa(n)},!0),r("scrollbarStyle","native",function(n){Io(n),Aa(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,u){n.display.gutterSpecs=Yi(n.options.gutters,u),Ja(n)},!0),r("firstLineNumber",1,Ja,!0),r("lineNumberFormatter",function(n){return n},Ja,!0),r("showCursorWhenSelecting",!1,za,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,u){u=="nocursor"&&(Oa(n),n.display.input.blur()),n.display.input.readOnlyChanged(u)}),r("screenReaderLabel",null,function(n,u){u=u===""?null:u,n.display.input.screenReaderLabelChanged(u)}),r("disableInput",!1,function(n,u){u||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,za,!0),r("singleCursorHeightPerLine",!0,za,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Za,!0),r("addModeClass",!1,Za,!0),r("pollInterval",100),r("undoDepth",200,function(n,u){return n.doc.history.undoDepth=u}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Za,!0),r("moveInputWithCursor",!0,function(n,u){u||n.display.input.resetPosition()}),r("tabindex",null,function(n,u){return n.display.input.getField().tabIndex=u||""}),r("autofocus",null),r("direction","ltr",function(n,u){return n.doc.setDirection(u)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=Ua;if(!t!=!n){var u=e.display.dragFunctions,R=t?pe:Ne;R(e.display.scroller,"dragstart",u.start),R(e.display.scroller,"dragenter",u.enter),R(e.display.scroller,"dragover",u.over),R(e.display.scroller,"dragleave",u.leave),R(e.display.scroller,"drop",u.drop)}}function Zl(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(f(e.display.wrapper,"CodeMirror-wrap"),Gr(e)),Fi(e),Or(e),Ha(e),setTimeout(function(){return Aa(e)},100)}function Nn(e,t){var r=this;if(!(this instanceof Nn))return new Nn(e,t);this.options=t=t?U(t):{},U(Ps,t,!1);var n=t.value;typeof n=="string"?n=new Dr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var u=new Nn.inputStyles[t.inputStyle](this),R=this.display=new dl(e,n,u,t);R.wrapper.CodeMirror=this,Ls(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Io(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Z,keySeq:null,specialChars:null},t.autofocus&&!i&&R.input.focus(),N&&I<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Ql(this),Al(),ba(this),this.curOp.forceUpdate=!0,zo(this,n),t.autofocus&&!i||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Wi(r)},20):Oa(this);for(var K in Di)Di.hasOwnProperty(K)&&Di[K](this,t[K],Ua);Uo(this),t.finishInit&&t.finishInit(this);for(var G=0;G<so.length;++G)so[G](this);Ea(this),A&&t.lineWrapping&&getComputedStyle(R.lineDiv).textRendering=="optimizelegibility"&&(R.lineDiv.style.textRendering="auto")}Nn.defaults=Ps,Nn.optionHandlers=Di;function Ql(e){var t=e.display;pe(t.scroller,"mousedown",ar(e,Os)),N&&I<11?pe(t.scroller,"dblclick",ar(e,function(Y){if(Re(e,Y))return;var J=pa(e,Y);if(!J||oo(e,Y)||Ft(e.display,Y))return;$(Y);var le=e.findWordAt(J);xi(e.doc,le.anchor,le.head)})):pe(t.scroller,"dblclick",function(Y){return Re(e,Y)||$(Y)}),pe(t.scroller,"contextmenu",function(Y){return Rs(e,Y)}),pe(t.input.getField(),"contextmenu",function(Y){t.scroller.contains(Y.target)||Rs(e,Y)});var r,n={end:0};function u(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function R(Y){if(Y.touches.length!=1)return!1;var J=Y.touches[0];return J.radiusX<=1&&J.radiusY<=1}function K(Y,J){if(J.left==null)return!0;var le=J.left-Y.left,he=J.top-Y.top;return le*le+he*he>20*20}pe(t.scroller,"touchstart",function(Y){if(!Re(e,Y)&&!R(Y)&&!oo(e,Y)){t.input.ensurePolled(),clearTimeout(r);var J=+new Date;t.activeTouch={start:J,moved:!1,prev:J-n.end<=300?n:null},Y.touches.length==1&&(t.activeTouch.left=Y.touches[0].pageX,t.activeTouch.top=Y.touches[0].pageY)}}),pe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),pe(t.scroller,"touchend",function(Y){var J=t.activeTouch;if(J&&!Ft(t,Y)&&J.left!=null&&!J.moved&&new Date-J.start<300){var le=e.coordsChar(t.activeTouch,"page"),he;!J.prev||K(J,J.prev)?he=new xn(le,le):!J.prev.prev||K(J,J.prev.prev)?he=e.findWordAt(le):he=new xn(rt(le.line,0),Rt(e.doc,rt(le.line+1,0))),e.setSelection(he.anchor,he.head),e.focus(),$(Y)}u()}),pe(t.scroller,"touchcancel",u),pe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Xa(e,t.scroller.scrollTop),ga(e,t.scroller.scrollLeft,!0),xe(e,"scroll",e))}),pe(t.scroller,"mousewheel",function(Y){return Bo(e,Y)}),pe(t.scroller,"DOMMouseScroll",function(Y){return Bo(e,Y)}),pe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Y){Re(e,Y)||ie(Y)},over:function(Y){Re(e,Y)||(Dl(e,Y),ie(Y))},start:function(Y){return Ol(e,Y)},drop:ar(e,wl),leave:function(Y){Re(e,Y)||ms(e)}};var G=t.input.getField();pe(G,"keyup",function(Y){return Ss.call(e,Y)}),pe(G,"keydown",ar(e,_s)),pe(G,"keypress",ar(e,ws)),pe(G,"focus",function(Y){return Wi(e,Y)}),pe(G,"blur",function(Y){return Oa(e,Y)})}var so=[];Nn.defineInitHook=function(e){return so.push(e)};function di(e,t,r,n){var u=e.doc,R;r==null&&(r="add"),r=="smart"&&(u.mode.indent?R=rn(e,t).state:r="prev");var K=e.options.tabSize,G=bt(u,t),Y=z(G.text,null,K);G.stateAfter&&(G.stateAfter=null);var J=G.text.match(/^\s*/)[0],le;if(!n&&!/\S/.test(G.text))le=0,r="not";else if(r=="smart"&&(le=u.mode.indent(R,G.text.slice(J.length),G.text),le==ye||le>150)){if(!n)return;r="prev"}r=="prev"?t>u.first?le=z(bt(u,t-1).text,null,K):le=0:r=="add"?le=Y+e.options.indentUnit:r=="subtract"?le=Y-e.options.indentUnit:typeof r=="number"&&(le=Y+r),le=Math.max(0,le);var he="",Ae=0;if(e.options.indentWithTabs)for(var _e=Math.floor(le/K);_e;--_e)Ae+=K,he+=" ";if(Ae<le&&(he+=se(le-Ae)),he!=J)return Ma(u,he,rt(t,0),rt(t,J.length),"+input"),G.stateAfter=null,!0;for(var Ge=0;Ge<u.sel.ranges.length;Ge++){var et=u.sel.ranges[Ge];if(et.head.line==t&&et.head.ch<J.length){var lt=rt(t,J.length);eo(u,Ge,new xn(lt,lt));break}}}var Jr=null;function Ai(e){Jr=e}function lo(e,t,r,n,u){var R=e.doc;e.display.shift=!1,n||(n=R.sel);var K=+new Date-200,G=u=="paste"||e.state.pasteIncoming>K,Y=Le(t),J=null;if(G&&n.ranges.length>1)if(Jr&&Jr.text.join(`
|
|
`)==t){if(n.ranges.length%Jr.text.length==0){J=[];for(var le=0;le<Jr.text.length;le++)J.push(R.splitLines(Jr.text[le]))}}else Y.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(J=We(Y,function(mt){return[mt]}));for(var he=e.curOp.updateInput,Ae=n.ranges.length-1;Ae>=0;Ae--){var _e=n.ranges[Ae],Ge=_e.from(),et=_e.to();_e.empty()&&(r&&r>0?Ge=rt(Ge.line,Ge.ch-r):e.state.overwrite&&!G?et=rt(et.line,Math.min(bt(R,et.line).text.length,et.ch+Te(Y).length)):G&&Jr&&Jr.lineWise&&Jr.text.join(`
|
|
`)==Y.join(`
|
|
`)&&(Ge=et=rt(Ge.line,0)));var lt={from:Ge,to:et,text:J?J[Ae%J.length]:Y,origin:u||(G?"paste":e.state.cutIncoming>K?"cut":"+input")};Pa(e.doc,lt),sn(e,"inputRead",e,lt)}t&&!G&&Is(e,t),Da(e),e.curOp.updateInput<2&&(e.curOp.updateInput=he),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ms(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&kr(t,function(){return lo(t,r,0,null,"paste")}),!0}function Is(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var u=r.ranges[n];if(u.head.ch>100||n&&r.ranges[n-1].head.line==u.head.line)continue;var R=e.getModeAt(u.head),K=!1;if(R.electricChars){for(var G=0;G<R.electricChars.length;G++)if(t.indexOf(R.electricChars.charAt(G))>-1){K=di(e,u.head.line,"smart");break}}else R.electricInput&&(R.electricInput.test(bt(e.doc,u.head.line).text.slice(0,u.head.ch))&&(K=di(e,u.head.line,"smart")));K&&sn(e,"electricInput",e,u.head.line)}}function ks(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var u=e.doc.sel.ranges[n].head.line,R={anchor:rt(u,0),head:rt(u+1,0)};r.push(R),t.push(e.getRange(R.anchor,R.head))}return{text:t,ranges:r}}function Ns(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Us(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return A?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ns(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,u){var R=this.options,K=R[n];if(R[n]==u&&n!="mode")return;R[n]=u,t.hasOwnProperty(n)&&ar(this,t[n])(this,u,K),xe(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,u){this.state.keyMaps[u?"push":"unshift"](wi(n))},removeKeyMap:function(n){for(var u=this.state.keyMaps,R=0;R<u.length;++R)if(u[R]==n||u[R].name==n)return u.splice(R,1),!0},addOverlay:Cr(function(n,u){var R=n.token?n:e.getMode(this.options,n);if(R.startState)throw new Error("Overlays may not be stateful.");Je(this.state.overlays,{mode:R,modeSpec:n,opaque:u&&u.opaque,priority:u&&u.priority||0},function(K){return K.priority}),this.state.modeGen++,Or(this)}),removeOverlay:Cr(function(n){for(var u=this.state.overlays,R=0;R<u.length;++R){var K=u[R].modeSpec;if(K==n||typeof n=="string"&&K.name==n){u.splice(R,1),this.state.modeGen++,Or(this);return}}}),indentLine:Cr(function(n,u,R){typeof u!="string"&&typeof u!="number"&&(u==null?u=this.options.smartIndent?"smart":"prev":u=u?"add":"subtract"),Bn(this.doc,n)&&di(this,n,u,R)}),indentSelection:Cr(function(n){for(var u=this.doc.sel.ranges,R=-1,K=0;K<u.length;K++){var G=u[K];if(G.empty())G.head.line>R&&(di(this,G.head.line,n,!0),R=G.head.line,K==this.doc.sel.primIndex&&Da(this));else{var Y=G.from(),J=G.to(),le=Math.max(R,Y.line);R=Math.min(this.lastLine(),J.line-(J.ch?0:1))+1;for(var he=le;he<R;++he)di(this,he,n);var Ae=this.doc.sel.ranges;Y.ch==0&&u.length==Ae.length&&Ae[K].from().ch>0&&eo(this.doc,K,new xn(Y,Ae[K].to()),me)}}}),getTokenAt:function(n,u){return Pt(this,n,u)},getLineTokens:function(n,u){return Pt(this,rt(n),u,!0)},getTokenTypeAt:function(n){n=Rt(this.doc,n);var u=cn(this,bt(this.doc,n.line)),R=0,K=(u.length-1)/2,G=n.ch,Y;if(G==0)Y=u[2];else for(;;){var J=R+K>>1;if((J?u[J*2-1]:0)>=G)K=J;else if(u[J*2+1]<G)R=J+1;else{Y=u[J*2+2];break}}var le=Y?Y.indexOf("overlay "):-1;return le<0?Y:le==0?null:Y.slice(0,le-1)},getModeAt:function(n){var u=this.doc.mode;return u.innerMode?e.innerMode(u,this.getTokenAt(n).state).mode:u},getHelper:function(n,u){return this.getHelpers(n,u)[0]},getHelpers:function(n,u){var R=[];if(!r.hasOwnProperty(u))return R;var K=r[u],G=this.getModeAt(n);if(typeof G[u]=="string")K[G[u]]&&R.push(K[G[u]]);else if(G[u])for(var Y=0;Y<G[u].length;Y++){var J=K[G[u][Y]];J&&R.push(J)}else G.helperType&&K[G.helperType]?R.push(K[G.helperType]):K[G.name]&&R.push(K[G.name]);for(var le=0;le<K._global.length;le++){var he=K._global[le];he.pred(G,this)&&q(R,he.val)==-1&&R.push(he.val)}return R},getStateAfter:function(n,u){var R=this.doc;return n=Un(R,n==null?R.first+R.size-1:n),rn(this,n+1,u).state},cursorCoords:function(n,u){var R,K=this.doc.sel.primary();return n==null?R=K.head:typeof n=="object"?R=Rt(this.doc,n):R=n?K.from():K.to(),Yr(this,R,u||"page")},charCoords:function(n,u){return Mi(this,Rt(this.doc,n),u||"page")},coordsChar:function(n,u){return n=bo(this,n,u||"page"),ki(this,n.left,n.top)},lineAtHeight:function(n,u){return n=bo(this,{top:n,left:0},u||"page").top,_n(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,u,R){var K=!1,G;if(typeof n=="number"){var Y=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>Y&&(n=Y,K=!0),G=bt(this.doc,n)}else G=n;return ci(this,G,{top:0,left:0},u||"page",R||K).top+(K?this.doc.height-jn(G):0)},defaultTextHeight:function(){return Sa(this.display)},defaultCharWidth:function(){return wa(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,u,R,K,G){var Y=this.display;n=Yr(this,Rt(this.doc,n));var J=n.bottom,le=n.left;if(u.style.position="absolute",u.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(u),Y.sizer.appendChild(u),K=="over")J=n.top;else if(K=="above"||K=="near"){var he=Math.max(Y.wrapper.clientHeight,this.doc.height),Ae=Math.max(Y.sizer.clientWidth,Y.lineSpace.clientWidth);(K=="above"||n.bottom+u.offsetHeight>he)&&n.top>u.offsetHeight?J=n.top-u.offsetHeight:n.bottom+u.offsetHeight<=he&&(J=n.bottom),le+u.offsetWidth>Ae&&(le=Ae-u.offsetWidth)}u.style.top=J+"px",u.style.left=u.style.right="",G=="right"?(le=Y.sizer.clientWidth-u.offsetWidth,u.style.right="0px"):(G=="left"?le=0:G=="middle"&&(le=(Y.sizer.clientWidth-u.offsetWidth)/2),u.style.left=le+"px"),R&&Js(this,{left:le,top:J,right:le+u.offsetWidth,bottom:J+u.offsetHeight})},triggerOnKeyDown:Cr(_s),triggerOnKeyPress:Cr(ws),triggerOnKeyUp:Ss,triggerOnMouseDown:Cr(Os),execCommand:function(n){if(oi.hasOwnProperty(n))return oi[n].call(null,this)},triggerElectric:Cr(function(n){Is(this,n)}),findPosH:function(n,u,R,K){var G=1;u<0&&(G=-1,u=-u);for(var Y=Rt(this.doc,n),J=0;J<u&&!(Y=uo(this.doc,Y,G,R,K),Y.hitSide);++J);return Y},moveH:Cr(function(n,u){var R=this;this.extendSelectionsBy(function(K){return R.display.shift||R.doc.extend||K.empty()?uo(R.doc,K.head,n,u,R.options.rtlMoveVisually):n<0?K.from():K.to()},ve)}),deleteH:Cr(function(n,u){var R=this.doc.sel,K=this.doc;R.somethingSelected()?K.replaceSelection("",null,"+delete"):Na(this,function(G){var Y=uo(K,G.head,n,u,!1);return n<0?{from:Y,to:G.head}:{from:G.head,to:Y}})}),findPosV:function(n,u,R,K){var G=1,Y=K;u<0&&(G=-1,u=-u);for(var J=Rt(this.doc,n),le=0;le<u;++le){var he=Yr(this,J,"div");if(Y==null?Y=he.left:he.left=Y,J=js(this,he,G,R),J.hitSide)break}return J},moveV:Cr(function(n,u){var R=this,K=this.doc,G=[],Y=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(le){if(Y)return n<0?le.from():le.to();var he=Yr(R,le.head,"div");le.goalColumn!=null&&(he.left=le.goalColumn),G.push(he.left);var Ae=js(R,he,n,u);return u=="page"&&le==K.sel.primary()&&Hi(R,Mi(R,Ae,"div").top-he.top),Ae},ve),G.length)for(var J=0;J<K.sel.ranges.length;J++)K.sel.ranges[J].goalColumn=G[J]}),findWordAt:function(n){var u=this.doc,R=bt(u,n.line).text,K=n.ch,G=n.ch;if(R){var Y=this.getHelper(n,"wordChars");(n.sticky=="before"||G==R.length)&&K?--K:++G;for(var J=R.charAt(K),le=$e(J,Y)?function(he){return $e(he,Y)}:/\s/.test(J)?function(he){return/\s/.test(he)}:function(he){return!/\s/.test(he)&&!$e(he)};K>0&&le(R.charAt(K-1));)--K;for(;G<R.length&&le(R.charAt(G));)++G}return new xn(rt(n.line,K),rt(n.line,G))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):f(this.display.cursorDiv,"CodeMirror-overwrite"),xe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Cr(function(n,u){Ga(this,n,u)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Hn(this)-this.display.barHeight,width:n.scrollWidth-Hn(this)-this.display.barWidth,clientHeight:Kr(this),clientWidth:$n(this)}},scrollIntoView:Cr(function(n,u){n==null?(n={from:this.doc.sel.primary().head,to:null},u==null&&(u=this.options.cursorScrollMargin)):typeof n=="number"?n={from:rt(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=u||0,n.from.line!=null?Zs(this,n):Ro(this,n.from,n.to,n.margin)}),setSize:Cr(function(n,u){var R=this,K=function(Y){return typeof Y=="number"||/^\d+$/.test(String(Y))?Y+"px":Y};n!=null&&(this.display.wrapper.style.width=K(n)),u!=null&&(this.display.wrapper.style.height=K(u)),this.options.lineWrapping&&vo(this);var G=this.display.viewFrom;this.doc.iter(G,this.display.viewTo,function(Y){if(Y.widgets){for(var J=0;J<Y.widgets.length;J++)if(Y.widgets[J].noHScroll){oa(R,G,"widget");break}}++G}),this.curOp.forceUpdate=!0,xe(this,"refresh",this)}),operation:function(n){return kr(this,n)},startOperation:function(){return ba(this)},endOperation:function(){return Ea(this)},refresh:Cr(function(){var n=this.display.cachedTextHeight;Or(this),this.curOp.forceUpdate=!0,Ha(this),Ga(this,this.doc.scrollLeft,this.doc.scrollTop),Xi(this.display),(n==null||Math.abs(n-Sa(this.display))>.5||this.options.lineWrapping)&&Fi(this),xe(this,"refresh",this)}),swapDoc:Cr(function(n){var u=this.doc;return u.cm=null,this.state.selectingText&&this.state.selectingText(),zo(this,n),Ha(this),this.display.input.reset(),Ga(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,u),u}),phrase:function(n){var u=this.options.phrases;return u&&Object.prototype.hasOwnProperty.call(u,n)?u[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ne(e),e.registerHelper=function(n,u,R){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][u]=R},e.registerGlobalHelper=function(n,u,R,K){e.registerHelper(n,u,K),r[n]._global.push({pred:R,val:K})}}function uo(e,t,r,n,u){var R=t,K=r,G=bt(e,t.line),Y=u&&e.direction=="rtl"?-r:r;function J(){var xt=t.line+Y;return xt<e.first||xt>=e.first+e.size?!1:(t=new rt(xt,t.ch,t.sticky),G=bt(e,xt))}function le(xt){var pt;if(n=="codepoint"){var _t=G.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(_t)?pt=null:pt=new rt(t.line,Math.max(0,Math.min(G.text.length,t.ch+r*(_t>=55296&&_t<56320?2:1))),-r)}else u?pt=Il(e.cm,G,t,r):pt=no(G,t,r);if(pt==null)if(!xt&&J())t=ro(u,e.cm,G,t.line,Y);else return!1;else t=pt;return!0}if(n=="char"||n=="codepoint")le();else if(n=="column")le(!0);else if(n=="word"||n=="group")for(var he=null,Ae=n=="group",_e=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(r<0&&!le(!Ge));Ge=!1){var et=G.text.charAt(t.ch)||`
|
|
`,lt=$e(et,_e)?"w":Ae&&et==`
|
|
`?"n":!Ae||/\s/.test(et)?null:"p";if(Ae&&!Ge&&!lt&&(lt="s"),he&&he!=lt){r<0&&(r=1,le(),t.sticky="after");break}if(lt&&(he=lt),r>0&&!le(!Ge))break}var mt=Ci(e,t,R,K,!0);return qn(R,mt)&&(mt.hitSide=!0),mt}function js(e,t,r,n){var u=e.doc,R=t.left,K;if(n=="page"){var G=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Y=Math.max(G-.5*Sa(e.display),3);K=(r>0?t.bottom:t.top)+r*Y}else n=="line"&&(K=r>0?t.bottom+3:t.top-3);for(var J;!(J=ki(e,R,K),!J.outside);){if(r<0?K<=0:K>=u.height){J.hitSide=!0;break}K+=r*5}return J}var Sn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Sn.prototype.init=function(e){var t=this,r=this,n=r.cm,u=r.div=e.lineDiv;Ns(u,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function R(G){for(var Y=G.target;Y;Y=Y.parentNode){if(Y==u)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Y.className))break}return!1}pe(u,"paste",function(G){if(!R(G)||Re(n,G)||Ms(G,n))return;I<=11&&setTimeout(ar(n,function(){return t.updateFromDOM()}),20)}),pe(u,"compositionstart",function(G){t.composing={data:G.data,done:!1}}),pe(u,"compositionupdate",function(G){t.composing||(t.composing={data:G.data,done:!1})}),pe(u,"compositionend",function(G){t.composing&&(G.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),pe(u,"touchstart",function(){return r.forceCompositionEnd()}),pe(u,"input",function(){t.composing||t.readFromDOMSoon()});function K(G){if(!R(G)||Re(n,G))return;if(n.somethingSelected())Ai({lineWise:!1,text:n.getSelections()}),G.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var Y=ks(n);Ai({lineWise:!0,text:Y.text}),G.type=="cut"&&n.operation(function(){n.setSelections(Y.ranges,0,me),n.replaceSelection("",null,"cut")})}else return;if(G.clipboardData){G.clipboardData.clearData();var J=Jr.text.join(`
|
|
`);if(G.clipboardData.setData("Text",J),G.clipboardData.getData("Text")==J){G.preventDefault();return}}var le=Us(),he=le.firstChild;n.display.lineSpace.insertBefore(le,n.display.lineSpace.firstChild),he.value=Jr.text.join(`
|
|
`);var Ae=document.activeElement;X(he),setTimeout(function(){n.display.lineSpace.removeChild(le),Ae.focus(),Ae==u&&r.showPrimarySelection()},50)}pe(u,"copy",K),pe(u,"cut",K)},Sn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Sn.prototype.prepareSelection=function(){var e=So(this.cm,!1);return e.focus=document.activeElement==this.div,e},Sn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Sn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Sn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),u=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||u.line<t.display.viewFrom){e.removeAllRanges();return}var R=Ri(t,e.anchorNode,e.anchorOffset),K=Ri(t,e.focusNode,e.focusOffset);if(R&&!R.bad&&K&&!K.bad&&ct(Ur(R,K),n)==0&&ct(pr(R,K),u)==0)return;var G=t.display.view,Y=n.line>=t.display.viewFrom&&Fs(t,n)||{node:G[0].measure.map[2],offset:0},J=u.line<t.display.viewTo&&Fs(t,u);if(!J){var le=G[G.length-1].measure,he=le.maps?le.maps[le.maps.length-1]:le.map;J={node:he[he.length-1],offset:he[he.length-2]-he[he.length-3]}}if(!Y||!J){e.removeAllRanges();return}var Ae=e.rangeCount&&e.getRangeAt(0),_e;try{_e=b(Y.node,Y.offset,J.offset,J.node)}catch(Ge){}_e&&(!D&&t.state.focused?(e.collapse(Y.node,Y.offset),_e.collapsed||(e.removeAllRanges(),e.addRange(_e))):(e.removeAllRanges(),e.addRange(_e)),Ae&&e.anchorNode==null?e.addRange(Ae):D&&this.startGracePeriod()),this.rememberSelection()},Sn.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Sn.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},Sn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Sn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},Sn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Sn.prototype.blur=function(){this.div.blur()},Sn.prototype.getField=function(){return this.div},Sn.prototype.supportsTouch=function(){return!0},Sn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():kr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Sn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Sn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=Ri(t,e.anchorNode,e.anchorOffset),n=Ri(t,e.focusNode,e.focusOffset);r&&n&&kr(t,function(){Er(t.doc,la(r,n),me),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Sn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),u=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=rt(n.line-1,bt(e.doc,n.line-1).length)),u.ch==bt(e.doc,u.line).text.length&&u.line<e.lastLine()&&(u=rt(u.line+1,0)),n.line<t.viewFrom||u.line>t.viewTo-1)return!1;var R,K,G;n.line==t.viewFrom||(R=va(e,n.line))==0?(K=Gt(t.view[0].line),G=t.view[0].node):(K=Gt(t.view[R].line),G=t.view[R-1].node.nextSibling);var Y=va(e,u.line),J,le;if(Y==t.view.length-1?(J=t.viewTo-1,le=t.lineDiv.lastChild):(J=Gt(t.view[Y+1].line)-1,le=t.view[Y+1].node.previousSibling),!G)return!1;for(var he=e.doc.splitLines(tu(e,G,le,K,J)),Ae=Dn(e.doc,rt(K,0),rt(J,bt(e.doc,J).text.length));he.length>1&&Ae.length>1;)if(Te(he)==Te(Ae))he.pop(),Ae.pop(),J--;else if(he[0]==Ae[0])he.shift(),Ae.shift(),K++;else break;for(var _e=0,Ge=0,et=he[0],lt=Ae[0],mt=Math.min(et.length,lt.length);_e<mt&&et.charCodeAt(_e)==lt.charCodeAt(_e);)++_e;for(var xt=Te(he),pt=Te(Ae),_t=Math.min(xt.length-(he.length==1?_e:0),pt.length-(Ae.length==1?_e:0));Ge<_t&&xt.charCodeAt(xt.length-Ge-1)==pt.charCodeAt(pt.length-Ge-1);)++Ge;if(he.length==1&&Ae.length==1&&K==n.line)for(;_e&&_e>n.ch&&xt.charCodeAt(xt.length-Ge-1)==pt.charCodeAt(pt.length-Ge-1);)_e--,Ge++;he[he.length-1]=xt.slice(0,xt.length-Ge).replace(/^\u200b+/,""),he[0]=he[0].slice(_e).replace(/\u200b+$/,"");var Kt=rt(K,_e),It=rt(J,Ae.length?Te(Ae).length-Ge:0);if(he.length>1||he[0]||ct(Kt,It))return Ma(e.doc,he,Kt,It,"+input"),!0},Sn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Sn.prototype.reset=function(){this.forceCompositionEnd()},Sn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Sn.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Sn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&kr(this.cm,function(){return Or(e.cm)})},Sn.prototype.setUneditable=function(e){e.contentEditable="false"},Sn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ar(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Sn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Sn.prototype.onContextMenu=function(){},Sn.prototype.resetPosition=function(){},Sn.prototype.needsContentAttribute=!0;function Fs(e,t){var r=Ir(e,t.line);if(!r||r.hidden)return null;var n=bt(e.doc,t.line),u=Hr(r,n,t.line),R=ht(n,e.doc.direction),K="left";if(R){var G=ut(R,t.ch);K=G%2?"right":"left"}var Y=mo(u.map,t.ch,K);return Y.offset=Y.collapse=="right"?Y.end:Y.start,Y}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ja(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,u){var R="",K=!1,G=e.doc.lineSeparator(),Y=!1;function J(_e){return function(Ge){return Ge.id==_e}}function le(){K&&(R+=G,Y&&(R+=G),K=Y=!1)}function he(_e){_e&&(le(),R+=_e)}function Ae(_e){if(_e.nodeType==1){var Ge=_e.getAttribute("cm-text");if(Ge){he(Ge);return}var et=_e.getAttribute("cm-marker"),lt;if(et){var mt=e.findMarks(rt(n,0),rt(u+1,0),J(+et));mt.length&&(lt=mt[0].find(0))&&he(Dn(e.doc,lt.from,lt.to).join(G));return}if(_e.getAttribute("contenteditable")=="false")return;var xt=/^(pre|div|p|li|table|br)$/i.test(_e.nodeName);if(!/^br$/i.test(_e.nodeName)&&_e.textContent.length==0)return;xt&&le();for(var pt=0;pt<_e.childNodes.length;pt++)Ae(_e.childNodes[pt]);/^(pre|p)$/i.test(_e.nodeName)&&(Y=!0),xt&&(K=!0)}else _e.nodeType==3&&he(_e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ae(t),t==r);)t=t.nextSibling,Y=!1;return R}function Ri(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return ja(e.clipPos(rt(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var u=0;u<e.display.view.length;u++){var R=e.display.view[u];if(R.node==n)return nu(R,t,r)}}function nu(e,t,r){var n=e.text.firstChild,u=!1;if(!t||!g(n,t))return ja(rt(Gt(e.line),0),!0);if(t==n&&(u=!0,t=n.childNodes[r],r=0,!t)){var R=e.rest?Te(e.rest):e.line;return ja(rt(Gt(R),R.text.length),u)}var K=t.nodeType==3?t:null,G=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,r&&(r=K.nodeValue.length));G.parentNode!=n;)G=G.parentNode;var Y=e.measure,J=Y.maps;function le(lt,mt,xt){for(var pt=-1;pt<(J?J.length:0);pt++)for(var _t=pt<0?Y.map:J[pt],Kt=0;Kt<_t.length;Kt+=3){var It=_t[Kt+2];if(It==lt||It==mt){var nn=Gt(pt<0?e.line:e.rest[pt]),Rn=_t[Kt]+xt;return(xt<0||It!=lt)&&(Rn=_t[Kt+(xt?1:0)]),rt(nn,Rn)}}}var he=le(K,G,r);if(he)return ja(he,u);for(var Ae=G.nextSibling,_e=K?K.nodeValue.length-r:0;Ae;Ae=Ae.nextSibling){if(he=le(Ae,Ae.firstChild,0),he)return ja(rt(he.line,he.ch-_e),u);_e+=Ae.textContent.length}for(var Ge=G.previousSibling,et=r;Ge;Ge=Ge.previousSibling){if(he=le(Ge,Ge.firstChild,-1),he)return ja(rt(he.line,he.ch+et),u);et+=Ge.textContent.length}}var zn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};zn.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var u=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(u.style.width="0px"),pe(u,"input",function(){N&&I>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),pe(u,"paste",function(K){if(Re(n,K)||Ms(K,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function R(K){if(Re(n,K))return;if(n.somethingSelected())Ai({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var G=ks(n);Ai({lineWise:!0,text:G.text}),K.type=="cut"?n.setSelections(G.ranges,null,me):(r.prevInput="",u.value=G.text.join(`
|
|
`),X(u))}else return;K.type=="cut"&&(n.state.cutIncoming=+new Date)}pe(u,"cut",R),pe(u,"copy",R),pe(e.scroller,"paste",function(K){if(Ft(e,K)||Re(n,K))return;if(!u.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var G=new Event("paste");G.clipboardData=K.clipboardData,u.dispatchEvent(G)}),pe(e.lineSpace,"selectstart",function(K){Ft(e,K)||$(K)}),pe(u,"compositionstart",function(){var K=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:K,range:n.markText(K,n.getCursor("to"),{className:"CodeMirror-composing"})}}),pe(u,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},zn.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},zn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},zn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=So(e);if(e.options.moveInputWithCursor){var u=Yr(e,r.sel.primary().head,"div"),R=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,u.top+K.top-R.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,u.left+K.left-R.left))}return n},zn.prototype.showSelection=function(e){var t=this.cm,r=t.display;s(r.cursorDiv,e.cursors),s(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},zn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&X(this.textarea),N&&I>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",N&&I>=9&&(this.hasSelection=null))},zn.prototype.getField=function(){return this.textarea},zn.prototype.supportsTouch=function(){return!1},zn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},zn.prototype.blur=function(){this.textarea.blur()},zn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},zn.prototype.receivedFocus=function(){this.slowPoll()},zn.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},zn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},zn.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ue(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var u=r.value;if(u==n&&!t.somethingSelected())return!1;if(N&&I>=9&&this.hasSelection===u||a&&/[\uf700-\uf7ff]/.test(u))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var R=u.charCodeAt(0);if(R==8203&&!n&&(n="\u200B"),R==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,G=Math.min(n.length,u.length);K<G&&n.charCodeAt(K)==u.charCodeAt(K);)++K;return kr(t,function(){lo(t,u.slice(K),n.length-K,null,e.composing?"*compose":null),u.length>1e3||u.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=u,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},zn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zn.prototype.onKeyPress=function(){N&&I>=9&&(this.hasSelection=null),this.fastPoll()},zn.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,u=t.textarea;t.contextMenuPending&&t.contextMenuPending();var R=pa(r,e),K=n.scroller.scrollTop;if(!R||y)return;var G=r.options.resetSelectionOnContextMenu;G&&r.doc.sel.contains(R)==-1&&ar(r,Er)(r.doc,la(R),me);var Y=u.style.cssText,J=t.wrapper.style.cssText,le=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",u.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-le.top-5)+"px; left: "+(e.clientX-le.left-5)+`px;
|
|
z-index: 1000; background: `+(N?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var he;A&&(he=window.scrollY),n.input.focus(),A&&window.scrollTo(null,he),n.input.reset(),r.somethingSelected()||(u.value=t.prevInput=" "),t.contextMenuPending=_e,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Ae(){if(u.selectionStart!=null){var et=r.somethingSelected(),lt="\u200B"+(et?u.value:"");u.value="\u21DA",u.value=lt,t.prevInput=et?"":"\u200B",u.selectionStart=1,u.selectionEnd=lt.length,n.selForContextMenu=r.doc.sel}}function _e(){if(t.contextMenuPending!=_e)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=J,u.style.cssText=Y,N&&I<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=K),u.selectionStart!=null){(!N||N&&I<9)&&Ae();var et=0,lt=function(){n.selForContextMenu==r.doc.sel&&u.selectionStart==0&&u.selectionEnd>0&&t.prevInput=="\u200B"?ar(r,rs)(r):et++<10?n.detectingSelectAll=setTimeout(lt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(lt,200)}}if(N&&I>=9&&Ae(),w){ie(e);var Ge=function(){Ne(window,"mouseup",Ge),setTimeout(_e,20)};pe(window,"mouseup",Ge)}else setTimeout(_e,50)},zn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},zn.prototype.setUneditable=function(){},zn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?U(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=P();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=G.getValue()}var u;if(e.form&&(pe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var R=e.form;u=R.submit;try{var K=R.submit=function(){n(),R.submit=u,R.submit(),R.submit=K}}catch(Y){}}t.finishInit=function(Y){Y.save=n,Y.getTextArea=function(){return e},Y.toTextArea=function(){Y.toTextArea=isNaN,n(),e.parentNode.removeChild(Y.getWrapperElement()),e.style.display="",e.form&&(Ne(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=u))}},e.style.display="none";var G=Nn(function(Y){return e.parentNode.insertBefore(Y,e.nextSibling)},t);return G}function au(e){e.off=Ne,e.on=pe,e.wheelEventPixels=cl,e.Doc=Dr,e.splitLines=Le,e.countColumn=z,e.findColumn=ge,e.isWordChar=Ke,e.Pass=ye,e.signal=xe,e.Line=vr,e.changeEnd=ua,e.scrollbarModel=Mo,e.Pos=rt,e.cmpPos=ct,e.modes=je,e.mimeModes=De,e.resolveMode=Pe,e.getMode=Be,e.modeExtensions=dt,e.extendMode=Bt,e.copyState=Tt,e.startState=bn,e.innerMode=gn,e.commands=oi,e.keyMap=aa,e.keyName=bs,e.isModifierKey=gs,e.lookupKey=ka,e.normalizeKeyMap=Ml,e.StringStream=ln,e.SharedTextMarker=ri,e.TextMarker=ca,e.LineWidget=ni,e.e_preventDefault=$,e.e_stopPropagation=Q,e.e_stop=ie,e.addClass=j,e.contains=g,e.rmClass=f,e.keyNames=fa}$l(Nn),ql(Nn);var iu="iter insert remove copy getEditor constructor".split(" ");for(var Li in Dr.prototype)Dr.prototype.hasOwnProperty(Li)&&q(iu,Li)<0&&(Nn.prototype[Li]=function(e){return function(){return e.apply(this.doc,arguments)}}(Dr.prototype[Li]));return ne(Dr),Nn.inputStyles={textarea:zn,contenteditable:Sn},Nn.defineMode=function(e){!Nn.defaults.mode&&e!="null"&&(Nn.defaults.mode=e),at.apply(this,arguments)},Nn.defineMIME=it,Nn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nn.defineMIME("text/plain","null"),Nn.defineExtension=function(e,t){Nn.prototype[e]=t},Nn.defineDocExtension=function(e,t){Dr.prototype[e]=t},Nn.fromTextArea=ru,au(Nn),Nn.version="5.58.2",Nn})},WaYH:function(Ie,Ee,k){"use strict";var V=k("rePB"),B=k("Ff2n"),D=k("VTBJ"),F=k("1OyB"),M=k("vuIU"),_=k("JX7q"),N=k("Ji7U"),I=k("LK+K"),A=k("cDcd"),L=k("TSYQ"),v=k.n(L),y=k("sboe"),O=k("OZM5"),S=function(w){var E=w.prefixCls,f=w.level,d=w.isStart,s=w.isEnd;if(!f)return null;for(var o="".concat(E,"-indent-unit"),T=[],b=0;b<f;b+=1){var g;T.push(A.createElement("span",{key:b,className:v()(o,(g={},Object(V.a)(g,"".concat(o,"-start"),d[b+1]),Object(V.a)(g,"".concat(o,"-end"),s[b+1]),Object(V.a)(g,"".concat(o,"-end-first-level"),!b&&s[0]),g))}))}return A.createElement("span",{"aria-hidden":"true",className:"".concat(E,"-indent")},T)},p=S,m=k("815F"),l="open",i="close",a="---",c=function(h){Object(N.a)(E,h);var w=Object(I.a)(E);function E(){var f;return Object(F.a)(this,E),f=w.apply(this,arguments),f.state={dragNodeHighlight:!1},f.onSelectorClick=function(d){var s=f.props.context.onNodeClick;s(d,Object(m.b)(f.props)),f.isSelectable()?f.onSelect(d):f.onCheck(d)},f.onSelectorDoubleClick=function(d){var s=f.props.context.onNodeDoubleClick;s(d,Object(m.b)(f.props))},f.onSelect=function(d){if(f.isDisabled())return;var s=f.props.context.onNodeSelect;d.preventDefault(),s(d,Object(m.b)(f.props))},f.onCheck=function(d){if(f.isDisabled())return;var s=f.props,o=s.disableCheckbox,T=s.checked,b=f.props.context.onNodeCheck;if(!f.isCheckable()||o)return;d.preventDefault();var g=!T;b(d,Object(m.b)(f.props),g)},f.onMouseEnter=function(d){var s=f.props.context.onNodeMouseEnter;s(d,Object(m.b)(f.props))},f.onMouseLeave=function(d){var s=f.props.context.onNodeMouseLeave;s(d,Object(m.b)(f.props))},f.onContextMenu=function(d){var s=f.props.context.onNodeContextMenu;s(d,Object(m.b)(f.props))},f.onDragStart=function(d){var s=f.props.context.onNodeDragStart;d.stopPropagation(),f.setState({dragNodeHighlight:!0}),s(d,Object(_.a)(f));try{d.dataTransfer.setData("text/plain","")}catch(o){}},f.onDragEnter=function(d){var s=f.props.context.onNodeDragEnter;d.preventDefault(),d.stopPropagation(),s(d,Object(_.a)(f))},f.onDragOver=function(d){var s=f.props.context.onNodeDragOver;d.preventDefault(),d.stopPropagation(),s(d,Object(_.a)(f))},f.onDragLeave=function(d){var s=f.props.context.onNodeDragLeave;d.stopPropagation(),s(d,Object(_.a)(f))},f.onDragEnd=function(d){var s=f.props.context.onNodeDragEnd;d.stopPropagation(),f.setState({dragNodeHighlight:!1}),s(d,Object(_.a)(f))},f.onDrop=function(d){var s=f.props.context.onNodeDrop;d.preventDefault(),d.stopPropagation(),f.setState({dragNodeHighlight:!1}),s(d,Object(_.a)(f))},f.onExpand=function(d){var s=f.props.context.onNodeExpand;s(d,Object(m.b)(f.props))},f.setSelectHandle=function(d){f.selectHandle=d},f.getNodeState=function(){var d=f.props.expanded;return f.isLeaf()?null:d?l:i},f.hasChildren=function(){var d=f.props.eventKey,s=f.props.context.keyEntities,o=s[d]||{},T=o.children;return!!(T||[]).length},f.isLeaf=function(){var d=f.props,s=d.isLeaf,o=d.loaded,T=f.props.context.loadData,b=f.hasChildren();return s===!1?!1:s||!T&&!b||T&&o&&!b},f.isDisabled=function(){var d=f.props.disabled,s=f.props.context.disabled;return!!(s||d)},f.isCheckable=function(){var d=f.props.checkable,s=f.props.context.checkable;return!s||d===!1?!1:s},f.syncLoadData=function(d){var s=d.expanded,o=d.loading,T=d.loaded,b=f.props.context,g=b.loadData,P=b.onNodeLoad;if(o)return;g&&s&&!f.isLeaf()&&(!f.hasChildren()&&!T&&P(Object(m.b)(f.props)))},f.renderSwitcher=function(){var d=f.props,s=d.expanded,o=d.switcherIcon,T=f.props.context,b=T.prefixCls,g=T.switcherIcon,P=o||g;if(f.isLeaf())return A.createElement("span",{className:v()("".concat(b,"-switcher"),"".concat(b,"-switcher-noop"))},typeof P=="function"?P(Object(D.a)(Object(D.a)({},f.props),{},{isLeaf:!0})):P);var j=v()("".concat(b,"-switcher"),"".concat(b,"-switcher_").concat(s?l:i));return A.createElement("span",{onClick:f.onExpand,className:j},typeof P=="function"?P(Object(D.a)(Object(D.a)({},f.props),{},{isLeaf:!1})):P)},f.renderCheckbox=function(){var d=f.props,s=d.checked,o=d.halfChecked,T=d.disableCheckbox,b=f.props.context.prefixCls,g=f.isDisabled(),P=f.isCheckable();if(!P)return null;var j=typeof P!="boolean"?P:null;return A.createElement("span",{className:v()("".concat(b,"-checkbox"),s&&"".concat(b,"-checkbox-checked"),!s&&o&&"".concat(b,"-checkbox-indeterminate"),(g||T)&&"".concat(b,"-checkbox-disabled")),onClick:f.onCheck},j)},f.renderIcon=function(){var d=f.props.loading,s=f.props.context.prefixCls;return A.createElement("span",{className:v()("".concat(s,"-iconEle"),"".concat(s,"-icon__").concat(f.getNodeState()||"docu"),d&&"".concat(s,"-icon_loading"))})},f.renderSelector=function(){var d=f.state.dragNodeHighlight,s=f.props,o=s.title,T=s.selected,b=s.icon,g=s.loading,P=s.data,j=f.props.context,H=j.prefixCls,X=j.showIcon,W=j.icon,U=j.draggable,z=j.loadData,Z=j.titleRender,q=f.isDisabled(),oe="".concat(H,"-node-content-wrapper"),ye;if(X){var me=b||W;ye=me?A.createElement("span",{className:v()("".concat(H,"-iconEle"),"".concat(H,"-icon__customize"))},typeof me=="function"?me(f.props):me):f.renderIcon()}else z&&g&&(ye=f.renderIcon());var fe;typeof o=="function"?fe=o(P):Z?fe=Z(P):fe=o;var ve=A.createElement("span",{className:"".concat(H,"-title")},fe);return A.createElement("span",{ref:f.setSelectHandle,title:typeof o=="string"?o:"",className:v()("".concat(oe),"".concat(oe,"-").concat(f.getNodeState()||"normal"),!q&&(T||d)&&"".concat(H,"-node-selected"),!q&&U&&"draggable"),draggable:!q&&U||void 0,"aria-grabbed":!q&&U||void 0,onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onContextMenu:f.onContextMenu,onClick:f.onSelectorClick,onDoubleClick:f.onSelectorDoubleClick,onDragStart:U?f.onDragStart:void 0},ye,ve)},f}return Object(M.a)(E,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var d=this.props.selectable,s=this.props.context.selectable;return typeof d=="boolean"?d:s}},{key:"render",value:function(){var d,s=this.props,o=s.eventKey,T=s.className,b=s.style,g=s.dragOver,P=s.dragOverGapTop,j=s.dragOverGapBottom,H=s.isLeaf,X=s.isStart,W=s.isEnd,U=s.expanded,z=s.selected,Z=s.checked,q=s.halfChecked,oe=s.loading,ye=s.domRef,me=s.active,fe=s.onMouseMove,ve=Object(B.a)(s,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ge=this.props.context,ae=ge.prefixCls,se=ge.filterTreeNode,Te=ge.draggable,We=ge.keyEntities,Je=this.isDisabled(),Ye=Object(O.f)(ve),Ze=We[o]||{},ze=Ze.level,Ke=W[W.length-1];return A.createElement("div",Object.assign({ref:ye,className:v()(T,"".concat(ae,"-treenode"),(d={},Object(V.a)(d,"".concat(ae,"-treenode-disabled"),Je),Object(V.a)(d,"".concat(ae,"-treenode-switcher-").concat(U?"open":"close"),!H),Object(V.a)(d,"".concat(ae,"-treenode-checkbox-checked"),Z),Object(V.a)(d,"".concat(ae,"-treenode-checkbox-indeterminate"),q),Object(V.a)(d,"".concat(ae,"-treenode-selected"),z),Object(V.a)(d,"".concat(ae,"-treenode-loading"),oe),Object(V.a)(d,"".concat(ae,"-treenode-active"),me),Object(V.a)(d,"".concat(ae,"-treenode-leaf-last"),Ke),Object(V.a)(d,"drag-over",!Je&&g),Object(V.a)(d,"drag-over-gap-top",!Je&&P),Object(V.a)(d,"drag-over-gap-bottom",!Je&&j),Object(V.a)(d,"filter-node",se&&se(Object(m.b)(this.props))),d)),style:b,onDragEnter:Te?this.onDragEnter:void 0,onDragOver:Te?this.onDragOver:void 0,onDragLeave:Te?this.onDragLeave:void 0,onDrop:Te?this.onDrop:void 0,onDragEnd:Te?this.onDragEnd:void 0,onMouseMove:fe},Ye),A.createElement(p,{prefixCls:ae,level:ze,isStart:X,isEnd:W}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),E}(A.Component),C=function(w){return A.createElement(y.a.Consumer,null,function(E){return A.createElement(c,Object.assign({},w,{context:E}))})};C.displayName="TreeNode",C.defaultProps={title:a},C.isTreeNode=1;var x=Ee.a=C},XIdC:function(Ie,Ee,k){"use strict";var V=k("rePB"),B=k("ODXe"),D=k("Ff2n"),F=k("cDcd"),M=k.n(F),_=k("TSYQ"),N=k.n(_),I=k("6cGi"),A=k("4IlW"),L=F.forwardRef(function(v,y){var O,S=v.prefixCls,p=S===void 0?"rc-switch":S,m=v.className,l=v.checked,i=v.defaultChecked,a=v.disabled,c=v.loadingIcon,C=v.checkedChildren,x=v.unCheckedChildren,h=v.onClick,w=v.onChange,E=v.onKeyDown,f=Object(D.a)(v,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),d=Object(I.a)(!1,{value:l,defaultValue:i}),s=Object(B.a)(d,2),o=s[0],T=s[1];function b(H,X){var W=o;return a||(W=H,T(W),w==null||w(W,X)),W}function g(H){H.which===A.a.LEFT?b(!1,H):H.which===A.a.RIGHT&&b(!0,H),E==null||E(H)}function P(H){var X=b(!o,H);h==null||h(X,H)}var j=N()(p,m,(O={},Object(V.a)(O,"".concat(p,"-checked"),o),Object(V.a)(O,"".concat(p,"-disabled"),a),O));return F.createElement("button",Object.assign({},f,{type:"button",role:"switch","aria-checked":o,disabled:a,className:j,ref:y,onKeyDown:g,onClick:P}),c,F.createElement("span",{className:"".concat(p,"-inner")},o?C:x))});L.displayName="Switch",Ee.a=L},Y1PL:function(Ie,Ee,k){"use strict";k.r(Ee),k.d(Ee,"ResizableTextArea",function(){return q});var V=k("wx14"),B=k("1OyB"),D=k("vuIU"),F=k("Ji7U"),M=k("LK+K"),_=k("cDcd"),N=k("VTBJ"),I=k("rePB"),A=k("Zm9Q"),L=k("Kwbf"),v=k("c+Xe"),y=k("m+aA"),O=k("bdgK"),S=new Map;function p(me){me.forEach(function(fe){var ve,ge=fe.target;(ve=S.get(ge))===null||ve===void 0||ve.forEach(function(ae){return ae(ge)})})}var m=new O.default(p),l=null,i=null;function a(me,fe){S.has(me)||(S.set(me,new Set),m.observe(me)),S.get(me).add(fe)}function c(me,fe){S.has(me)&&(S.get(me).delete(fe),S.get(me).size||(m.unobserve(me),S.delete(me)))}var C=function(me){Object(F.a)(ve,me);var fe=Object(M.a)(ve);function ve(){return Object(B.a)(this,ve),fe.apply(this,arguments)}return Object(D.a)(ve,[{key:"render",value:function(){return this.props.children}}]),ve}(_.Component),x=_.createContext(null);function h(me){var fe=me.children,ve=me.onBatchResize,ge=_.useRef(0),ae=_.useRef([]),se=_.useContext(x),Te=_.useCallback(function(We,Je,Ye){ge.current+=1;var Ze=ge.current;ae.current.push({size:We,element:Je,data:Ye}),Promise.resolve().then(function(){Ze===ge.current&&(ve==null||ve(ae.current),ae.current=[])}),se==null||se(We,Je,Ye)},[ve,se]);return _.createElement(x.Provider,{value:Te},fe)}function w(me){var fe=me.children,ve=me.disabled,ge=_.useRef(null),ae=_.useRef(null),se=_.useContext(x),Te=_.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),We=_.isValidElement(fe)&&Object(v.c)(fe),Je=We?fe.ref:null,Ye=_.useMemo(function(){return Object(v.a)(Je,ge)},[Je,ge]),Ze=_.useRef(me);Ze.current=me;var ze=_.useCallback(function(Ke){var $e=Ze.current,Qe=$e.onResize,nt=$e.data,Xe=Ke.getBoundingClientRect(),He=Xe.width,st=Xe.height,ft=Ke.offsetWidth,ot=Ke.offsetHeight,ut=Math.floor(He),gt=Math.floor(st);if(Te.current.width!==ut||Te.current.height!==gt||Te.current.offsetWidth!==ft||Te.current.offsetHeight!==ot){var ht={width:ut,height:gt,offsetWidth:ft,offsetHeight:ot};Te.current=ht;var be=ft===Math.round(He)?He:ft,pe=ot===Math.round(st)?st:ot,ke=Object(N.a)(Object(N.a)({},ht),{},{offsetWidth:be,offsetHeight:pe});se==null||se(ke,Ke,nt),Qe&&Promise.resolve().then(function(){Qe(ke,Ke)})}},[]);return _.useEffect(function(){var Ke=Object(y.a)(ge.current)||Object(y.a)(ae.current);return Ke&&!ve&&a(Ke,ze),function(){return c(Ke,ze)}},[ge.current,ve]),_.createElement(C,{ref:ae},We?_.cloneElement(fe,{ref:Ye}):fe)}var E="rc-observer-key";function f(me){var fe=me.children,ve=Object(A.a)(fe);return ve.map(function(ge,ae){var se=(ge==null?void 0:ge.key)||"".concat(E,"-").concat(ae);return _.createElement(w,Object(V.a)({},me,{key:se}),ge)})}f.Collection=h;var d=f,s=k("bT9E"),o=k("TSYQ"),T=k.n(o),b=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,g=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},j;function H(me){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=me.getAttribute("id")||me.getAttribute("data-reactid")||me.getAttribute("name");if(fe&&P[ve])return P[ve];var ge=window.getComputedStyle(me),ae=ge.getPropertyValue("box-sizing")||ge.getPropertyValue("-moz-box-sizing")||ge.getPropertyValue("-webkit-box-sizing"),se=parseFloat(ge.getPropertyValue("padding-bottom"))+parseFloat(ge.getPropertyValue("padding-top")),Te=parseFloat(ge.getPropertyValue("border-bottom-width"))+parseFloat(ge.getPropertyValue("border-top-width")),We=g.map(function(Ye){return"".concat(Ye,":").concat(ge.getPropertyValue(Ye))}).join(";"),Je={sizingStyle:We,paddingSize:se,borderSize:Te,boxSizing:ae};return fe&&ve&&(P[ve]=Je),Je}function X(me){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ge=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),me.getAttribute("wrap")?j.setAttribute("wrap",me.getAttribute("wrap")):j.removeAttribute("wrap");var ae=H(me,fe),se=ae.paddingSize,Te=ae.borderSize,We=ae.boxSizing,Je=ae.sizingStyle;j.setAttribute("style","".concat(Je,";").concat(b)),j.value=me.value||me.placeholder||"";var Ye=Number.MIN_SAFE_INTEGER,Ze=Number.MAX_SAFE_INTEGER,ze=j.scrollHeight,Ke;if(We==="border-box"?ze+=Te:We==="content-box"&&(ze-=se),ve!==null||ge!==null){j.value=" ";var $e=j.scrollHeight-se;ve!==null&&(Ye=$e*ve,We==="border-box"&&(Ye=Ye+se+Te),ze=Math.max(Ye,ze)),ge!==null&&(Ze=$e*ge,We==="border-box"&&(Ze=Ze+se+Te),Ke=ze>Ze?"":"hidden",ze=Math.min(Ze,ze))}return{height:ze,minHeight:Ye,maxHeight:Ze,overflowY:Ke,resize:"none"}}var W=k("Gytx"),U=k.n(W),z;(function(me){me[me.NONE=0]="NONE",me[me.RESIZING=1]="RESIZING",me[me.RESIZED=2]="RESIZED"})(z||(z={}));var Z=function(me){Object(F.a)(ve,me);var fe=Object(M.a)(ve);function ve(ge){var ae;return Object(B.a)(this,ve),ae=fe.call(this,ge),ae.nextFrameActionId=void 0,ae.resizeFrameId=void 0,ae.textArea=void 0,ae.saveTextArea=function(se){ae.textArea=se},ae.handleResize=function(se){var Te=ae.state.resizeStatus,We=ae.props,Je=We.autoSize,Ye=We.onResize;if(Te!==z.NONE)return;typeof Ye=="function"&&Ye(se),Je&&ae.resizeOnNextFrame()},ae.resizeOnNextFrame=function(){cancelAnimationFrame(ae.nextFrameActionId),ae.nextFrameActionId=requestAnimationFrame(ae.resizeTextarea)},ae.resizeTextarea=function(){var se=ae.props.autoSize;if(!se||!ae.textArea)return;var Te=se.minRows,We=se.maxRows,Je=X(ae.textArea,!1,Te,We);ae.setState({textareaStyles:Je,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(ae.resizeFrameId),ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:z.RESIZED},function(){ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:z.NONE}),ae.fixFirefoxAutoScroll()})})})})},ae.renderTextArea=function(){var se=ae.props,Te=se.prefixCls,We=Te===void 0?"rc-textarea":Te,Je=se.autoSize,Ye=se.onResize,Ze=se.className,ze=se.disabled,Ke=ae.state,$e=Ke.textareaStyles,Qe=Ke.resizeStatus,nt=Object(s.a)(ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Xe=T()(We,Ze,Object(I.a)({},"".concat(We,"-disabled"),ze));"value"in nt&&(nt.value=nt.value||"");var He=Object(N.a)(Object(N.a)(Object(N.a)({},ae.props.style),$e),Qe===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return _.createElement(d,{onResize:ae.handleResize,disabled:!(Je||Ye)},_.createElement("textarea",Object(V.a)({},nt,{className:Xe,style:He,ref:ae.saveTextArea})))},ae.state={textareaStyles:{},resizeStatus:z.NONE},ae}return Object(D.a)(ve,[{key:"componentDidUpdate",value:function(ae){(ae.value!==this.props.value||!U()(ae.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ae=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(ae,se)}}catch(Te){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ve}(_.Component),q=Z,oe=function(me){Object(F.a)(ve,me);var fe=Object(M.a)(ve);function ve(ge){var ae;Object(B.a)(this,ve),ae=fe.call(this,ge),ae.resizableTextArea=void 0,ae.focus=function(){ae.resizableTextArea.textArea.focus()},ae.saveTextArea=function(Te){ae.resizableTextArea=Te},ae.handleChange=function(Te){var We=ae.props.onChange;ae.setValue(Te.target.value,function(){ae.resizableTextArea.resizeTextarea()}),We&&We(Te)},ae.handleKeyDown=function(Te){var We=ae.props,Je=We.onPressEnter,Ye=We.onKeyDown;Te.keyCode===13&&Je&&Je(Te),Ye&&Ye(Te)};var se=typeof ge.value=="undefined"||ge.value===null?ge.defaultValue:ge.value;return ae.state={value:se},ae}return Object(D.a)(ve,[{key:"setValue",value:function(ae,se){"value"in this.props||this.setState({value:ae},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return _.createElement(q,Object(V.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ae){return"value"in ae?{value:ae.value}:null}}]),ve}(_.Component),ye=Ee.default=oe},ZD9Y:function(Ie,Ee,k){"use strict";var V=k("BoS7"),B=k("Sdc0"),D=k("OaEy"),F=k("2fM7"),M=k("cDcd"),_=k.n(M),N=k("lOMy"),I=k.n(N),A=F.a.Option;Ee.a=function(L){var v=L.onFontSizeChange,y=L.cmFontSize,O=L.cmCodeMode,S=L.onCodeModeChange,p=L.onTabToSpace,m=L.className,l=m===void 0?"":m,i=L.tabToSpace,a=L.children;return _.a.createElement("div",{className:"tpi-code-setting ".concat(l)},_.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),_.a.createElement("section",null,_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),_.a.createElement(F.a,{bordered:!1,size:"small",value:O,onChange:S},_.a.createElement(A,{value:"vs"},"\u767D\u8272\u80CC\u666F"),_.a.createElement(A,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),_.a.createElement(F.a,{bordered:!1,size:"small",value:y,onChange:v},_.a.createElement(A,{value:12},"12px"),_.a.createElement(A,{value:14},"14px"),_.a.createElement(A,{value:16},"16px"),_.a.createElement(A,{value:18},"18px"),_.a.createElement(A,{value:20},"20px"),_.a.createElement(A,{value:22},"22px"))),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"Tab\u8F6C\u6362"),_.a.createElement(B.a,{checked:i,onChange:p}))),_.a.createElement("h3",null,"\u5FEB\u6377\u952E"),_.a.createElement("section",null,_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),_.a.createElement("span",null,"Ctrl + S")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),_.a.createElement("span",null,"F1 / Alt + F1")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),_.a.createElement("span",null,"Ctrl + ]/[")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),_.a.createElement("span",null,"Ctrl + Shift + \\")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),_.a.createElement("span",null,"Home")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),_.a.createElement("span",null,"End"))),a)}},ZW9T:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return x});var V=k("k1fw"),B=k("miYZ"),D=k("tsqr"),F=k("rAM+"),M=k("tJVT"),_=k("PpiC"),N=k("cDcd"),I=k.n(N),A=k("bdgK");function L(h,w,E,f,d){var s=w.getWordUntilPosition(E),o={startLineNumber:E.lineNumber,endLineNumber:E.lineNumber,startColumn:s.startColumn,endColumn:s.endColumn},T=f.map(function(b){return{label:b,kind:h.languages.CompletionItemKind.Keyword,insertText:b,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}});return d.map(function(b){T.push(Object(V.a)(Object(V.a)({},b),{},{range:o}))}),T}var v=function(h){var w={label:"ifelse",kind:h.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet},E=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];h.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(o,T){var b=L(h,o,T,E,[w]);return{suggestions:b}}});var f=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];h.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(o,T){var b=[{label:"print",kind:h.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}],g=L(h,o,T,f,b);return{suggestions:g}}});var d=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];h.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(o,T){var b=[w,{label:"main",kind:h.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:h.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}],g=L(h,o,T,d,b);return{suggestions:g}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",O=k("LvDl"),S=k("+ua5");function p(h){return/^\d+$/.test(h)?"".concat(h,"px"):h}function m(){}var l=!1,i={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function a(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],w=h;if(Array.isArray(h)){for(var E=0;E<h.length;E++){var f=i[h[E]];if(f)return f}return w[0]}return i[w]||w}var c=null,C=Ee.b=function(h){var w=h.width,E=w===void 0?"100%":w,f=h.height,d=f===void 0?"100%":f,s=h.value,o=h.language,T=o===void 0?"javascript":o,b=h.style,g=b===void 0?{}:b,P=h.options,j=P===void 0?{}:P,H=h.overrideServices,X=H===void 0?{}:H,W=h.theme,U=W===void 0?"vs-dark":W,z=h.onEditBlur,Z=h.onSave,q=h.autoHeight,oe=q===void 0?!1:q,ye=h.forbidCopy,me=ye===void 0?!1:ye,fe=h.onChange,ve=fe===void 0?m:fe,ge=h.editorDidMount,ae=ge===void 0?m:ge,se=h.onFocus,Te=se===void 0?m:se,We=h.filename,Je=We===void 0?"educoder.txt":We,Ye=h.errorLine,Ze=h.errorContent,ze=Ze===void 0?"":Ze,Ke=Object(_.a)(h,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),$e=Object(N.useRef)(),Qe=Object(N.useRef)({}),nt=Object(N.useRef)(),Xe=Object(N.useRef)(!1),He=Object(N.useRef)(),st=Object(N.useState)(!1),ft=Object(M.a)(st,2),ot=ft[0],ut=ft[1];function gt(){var Oe;return $e.current&&(Oe=new A.default(function(Fe){var tt=Object(F.a)(Fe),Ve;try{for(tt.s();!(Ve=tt.n()).done;){var qe=Ve.value;(qe.target.offsetHeight>0||qe.target.offsetWidth>0)&&Qe.current.instance.layout()}}catch(Le){tt.e(Le)}finally{tt.f()}}),Oe.observe($e.current)),Oe}function ht(){D.b.warn(decodeURIComponent(y))}var be=function(){var Fe=Qe.current.instance;if(s!=null&&Fe&&ot){var tt=Fe.getModel();tt&&s!==tt.getValue()&&(l=!0,tt.setValue(s),Fe.layout(),l=!1)}};Object(N.useEffect)(function(){nt.current&&clearTimeout(nt.current),nt.current=setTimeout(function(){be()},500)},[s,ot,Qe.current]),Object(N.useEffect)(function(){if(Ye&&Qe.current&&Qe.current.instance){var Oe=Qe.current.instance;Oe.changeViewZones(function(tt){var Ve=document.createElement("div");Ve.style.padding="10px 20px",Ve.style.width="calc(100% - 20px)",Ve.className="my-error-line-wrp",Ve.innerHTML=ze,tt.addZone({afterLineNumber:Ye||11,heightInLines:3,domNode:Ve})});var Fe={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Oe.addOverlayWidget(Fe),Oe.revealPositionInCenter({lineNumber:20,column:1})}},[Ye,Qe.current,ot]);function pe(){var Oe=Qe.current.instance;if(Oe){var Fe=Oe.getSelection(),tt=Qe.current.pastePos||{},Ve=new c.Range(tt.startLineNumber||Fe.endLineNumber,tt.startColumn||Fe.endColumn,tt.endLineNumber||Fe.endLineNumber,tt.endColumn||Fe.endColumn);setTimeout(function(){Oe.executeEdits("",[{range:Ve,text:""}])},300)}}function ke(Oe){(window.navigator.platform.match("Mac")?Oe.metaKey:Oe.ctrlKey)&&Oe.keyCode==83&&(Oe.preventDefault(),Z())}var Ne=function(){if(oe&&Qe.current.instance){var Fe=Qe.current.instance.getContentHeight();ue(Fe<d?d:Fe)}else ue(d)};function xe(Oe){var Fe=document.createEvent("MouseEvents");Fe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Oe.dispatchEvent(Fe)}function Re(Oe,Fe){var tt=window.URL||window.webkitURL||window,Ve=new Blob([Fe]),qe=document.createElementNS("http://www.w3.org/1999/xhtml","a");qe.href=tt.createObjectURL(Ve),qe.download=Oe,xe(qe)}Object(N.useEffect)(function(){Ne()},[Ne]),Object(N.useEffect)(function(){$e.current&&!ot&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(Oe){try{c=Oe,Qe.current.instance=c.editor.create($e.current,{value:s,language:a(T),theme:U,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},X);var Fe=Qe.current.instance;if(ae(Fe,c),setTimeout(function(){Ne(),Qe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Re(Je||"educoder.txt",Fe.getValue())}})},500),Qe.current.subscription=Fe.onDidChangeModelContent(function(Ve){Xe.current?clearTimeout(He.current):(Ne(),ve(Fe.getValue(),Ve)),He.current=setTimeout(function(){Xe.current=!1},500)}),window.Monaco||v(c),me&&(Fe.addCommand(c.KeyMod.CtrlCmd|c.KeyMod.Shift|c.KeyCode.KEY_V,function(){return ht(),null}),Fe.addCommand(c.KeyMod.CtrlCmd|c.KeyCode.KEY_C,function(){return ht(),null})),window.Monaco=c,z&&Fe.onDidBlurEditorWidget(function(){z(Fe.getValue())}),Te&&Fe.onDidFocusEditorText(function(){Te(Fe.getValue())}),me){Fe.addCommand(c.KeyMod.CtrlCmd|c.KeyCode.KEY_V,function(){return ht(),null}),Fe.onDidPaste(function(Ve){Qe.current.pastePos=Ve});try{window.addEventListener("paste",pe)}catch(Ve){}}var tt=gt();return ut(!0),function(){var Ve=Qe.current.instance;Ve.dispose();var qe=Ve.getModel();qe&&qe.dispose(),Qe.current.subscription&&Qe.current.subscription.dispose(),me&&window.removeEventListener("paste",pe),tt.unobserve($e.current)}}catch(Ve){}})},[]),Object(N.useEffect)(function(){var Oe=Qe.current.instance;if(Oe&&ot)return document.addEventListener("keydown",ke,!1),function(){document.removeEventListener("keydown",ke)}},[Z,ot]),Object(N.useEffect)(function(){var Oe=Qe.current.instance;if(Oe&&ot){var Fe=a(T);c.editor.setModelLanguage(Oe.getModel(),Fe),console.log("language:",T,Oe.getModel(),Fe)}},[T,ot]),Object(N.useEffect)(function(){var Oe=Qe.current.instance;Oe&&ot&&c.editor.setTheme(U)},[U,ot]),Object(N.useEffect)(function(){var Oe=Qe.current.instance;Oe&&ot&&(Oe.updateOptions(Object(V.a)({},j)),setTimeout(function(){Oe.getModel().updateOptions(Object(V.a)({},j))},200))},[JSON.stringify(j),ot]),Object(N.useEffect)(function(){var Oe=Qe.current.instance;Oe&&ot&&Oe.layout()},[E,d,ot]);var de=Object(N.useState)(p(E)),re=Object(M.a)(de,2),ne=re[0],$=re[1],Q=Object(N.useState)(p(d)),te=Object(M.a)(Q,2),ie=te[0],ue=te[1],Ce=Object(V.a)(Object(V.a)({},g),{},{width:ne,height:ie});return I.a.createElement("div",{className:"my-monaco-editor",ref:$e,style:Ce})};function x(h){var w=h.width,E=w===void 0?"100%":w,f=h.height,d=f===void 0?"100%":f,s=h.original,o=h.modified,T=h.language,b=h.options,g=b===void 0?{}:b,P=Object(N.useRef)(),j=Object(N.useState)(null),H=Object(M.a)(j,2),X=H[0],W=H[1];function U(oe){var ye;return P.current&&(ye=new A.default(function(me){var fe=Object(F.a)(me),ve;try{for(fe.s();!(ve=fe.n()).done;){var ge=ve.value;(ge.target.offsetHeight>0||ge.target.offsetWidth>0)&&oe.layout()}}catch(ae){fe.e(ae)}finally{fe.f()}}),ye.observe(P.current)),ye}Object(N.useEffect)(function(){P.current&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(oe){c=oe;var ye=c.editor.createDiffEditor(P.current,Object(V.a)(Object(V.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},g),{},{wordWrap:!0}));W(ye);var me=U(ye);return function(){ye.dispose();var fe=ye.getModel();fe&&fe.dispose(),me.unobserve(P.current)}})},[]),Object(N.useEffect)(function(){X&&X.setModel({original:c.editor.createModel(s,T),modified:c.editor.createModel(o,T)})},[s,o,T,X]);var z=p(E),Z=p(d),q={width:z,height:Z};return I.a.createElement("div",{className:"my-diff-editor",ref:P,style:q})}},ZpRC:function(Ie,Ee,k){"use strict";function V(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function B(v,y){return(!y||v!=="hidden")&&v!=="visible"&&v!=="clip"}function D(v,y){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var O=getComputedStyle(v,null);return B(O.overflowY,y)||B(O.overflowX,y)||function(S){var p=function(m){if(!m.ownerDocument||!m.ownerDocument.defaultView)return null;try{return m.ownerDocument.defaultView.frameElement}catch(l){return null}}(S);return!!p&&(p.clientHeight<S.scrollHeight||p.clientWidth<S.scrollWidth)}(v)}return!1}function F(v,y,O,S,p,m,l,i){return m<v&&l>y||m>v&&l<y?0:m<=v&&i<=O||l>=y&&i>=O?m-v-S:l>y&&i<O||m<v&&i>O?l-y+p:0}var M=function(v,y){var O=window,S=y.scrollMode,p=y.block,m=y.inline,l=y.boundary,i=y.skipOverflowHiddenElements,a=typeof l=="function"?l:function($e){return $e!==l};if(!V(v))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,C=[],x=v;V(x)&&a(x);){if((x=x.parentElement)===c){C.push(x);break}x!=null&&x===document.body&&D(x)&&!D(document.documentElement)||x!=null&&D(x,i)&&C.push(x)}for(var h=O.visualViewport?O.visualViewport.width:innerWidth,w=O.visualViewport?O.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,f=window.scrollY||pageYOffset,d=v.getBoundingClientRect(),s=d.height,o=d.width,T=d.top,b=d.right,g=d.bottom,P=d.left,j=p==="start"||p==="nearest"?T:p==="end"?g:T+s/2,H=m==="center"?P+o/2:m==="end"?b:P,X=[],W=0;W<C.length;W++){var U=C[W],z=U.getBoundingClientRect(),Z=z.height,q=z.width,oe=z.top,ye=z.right,me=z.bottom,fe=z.left;if(S==="if-needed"&&T>=0&&P>=0&&g<=w&&b<=h&&T>=oe&&g<=me&&P>=fe&&b<=ye)return X;var ve=getComputedStyle(U),ge=parseInt(ve.borderLeftWidth,10),ae=parseInt(ve.borderTopWidth,10),se=parseInt(ve.borderRightWidth,10),Te=parseInt(ve.borderBottomWidth,10),We=0,Je=0,Ye="offsetWidth"in U?U.offsetWidth-U.clientWidth-ge-se:0,Ze="offsetHeight"in U?U.offsetHeight-U.clientHeight-ae-Te:0;if(c===U)We=p==="start"?j:p==="end"?j-w:p==="nearest"?F(f,f+w,w,ae,Te,f+j,f+j+s,s):j-w/2,Je=m==="start"?H:m==="center"?H-h/2:m==="end"?H-h:F(E,E+h,h,ge,se,E+H,E+H+o,o),We=Math.max(0,We+f),Je=Math.max(0,Je+E);else{We=p==="start"?j-oe-ae:p==="end"?j-me+Te+Ze:p==="nearest"?F(oe,me,Z,ae,Te+Ze,j,j+s,s):j-(oe+Z/2)+Ze/2,Je=m==="start"?H-fe-ge:m==="center"?H-(fe+q/2)+Ye/2:m==="end"?H-ye+se+Ye:F(fe,ye,q,ge,se+Ye,H,H+o,o);var ze=U.scrollLeft,Ke=U.scrollTop;j+=Ke-(We=Math.max(0,Math.min(Ke+We,U.scrollHeight-Z+Ze))),H+=ze-(Je=Math.max(0,Math.min(ze+Je,U.scrollWidth-q+Ye)))}X.push({el:U,top:We,left:Je})}return X};function _(v){return v===Object(v)&&Object.keys(v).length!==0}function N(v,y){y===void 0&&(y="auto");var O="scrollBehavior"in document.body.style;v.forEach(function(S){var p=S.el,m=S.top,l=S.left;p.scroll&&O?p.scroll({top:m,left:l,behavior:y}):(p.scrollTop=m,p.scrollLeft=l)})}function I(v){return v===!1?{block:"end",inline:"nearest"}:_(v)?v:{block:"start",inline:"nearest"}}function A(v,y){var O=!v.ownerDocument.documentElement.contains(v);if(_(y)&&typeof y.behavior=="function")return y.behavior(O?[]:M(v,y));if(O)return;var S=I(y);return N(M(v,S),S.behavior)}var L=Ee.a=A},a4uL:function(Ie,Ee,k){},bCnd:function(Ie,Ee,k){"use strict";k.d(Ee,"b",function(){return F}),k.d(Ee,"a",function(){return M});var V=k("je13"),B=k.n(V),D=!1;function F(_,N){var I=B.a.get("__ec");I||(I={}),I[_]=N,B.a.set("__ec",I)}function M(_,N){var I=B.a.get("__ec");return I?I[_]===void 0?N:I[_]:N}},bT9E:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return B});var V=k("VTBJ");function B(D,F){var M=Object(V.a)({},D);return Array.isArray(F)&&F.forEach(function(_){delete M[_]}),M}},biw7:function(Ie,Ee,k){"use strict";var V=k("cDcd"),B=k.n(V),D=V.createContext(null);Ee.a=D},c5Ni:function(Ie,Ee,k){},cDPC:function(Ie,Ee,k){"use strict";var V=k("tJVT"),B=k("cDcd"),D=k.n(B),F=k("i3hx"),M=k.n(F);Ee.a=function(_){var N=_.defaultX,I=N===void 0?"40%":N,A=_.leftChild,L=_.rightChild,v=_.className,y=_.hideResize,O=y===void 0?!1:y,S=Object(B.useState)(I),p=Object(V.a)(S,2),m=p[0],l=p[1],i=Object(B.useRef)();function a(){i.current=!0}Object(B.useEffect)(function(){function x(w){i.current&&l(w.pageX)}function h(){i.current=!1}return window.addEventListener("mousemove",x),window.addEventListener("mouseup",h),function(){window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",h)}},[]);var c=typeof m=="number"&&m!==.01?"".concat(m,"px"):I,C="calc(100% - ".concat(O?"0px":"4px"," - ").concat(c,")");return D.a.createElement("div",{className:"split-panel-container ".concat(v)},D.a.createElement("section",{style:{width:c,display:m===.01?"none":""}},A),D.a.createElement("section",{className:"resize-x-bar",onMouseDown:a},D.a.createElement("a",{className:"btn-resize"},D.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},D.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),D.a.createElement("section",{style:{width:C}},L))}},dejd:function(Ie,Ee,k){},dmUQ:function(Ie,Ee,k){"use strict";var V=k("Ff2n"),B=k("rePB"),D=k("1OyB"),F=k("vuIU"),M=k("Ji7U"),_=k("md7G"),N=k("foSv"),I=k("cDcd"),A=k.n(I),L=k("TSYQ"),v=k.n(L),y=k("4IlW");function O(s,o){var T=Object.keys(s);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(s);o&&(b=b.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),T.push.apply(T,b)}return T}function S(s){for(var o=1;o<arguments.length;o++){var T=arguments[o]!=null?arguments[o]:{};o%2?O(Object(T),!0).forEach(function(b){Object(B.a)(s,b,T[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(T)):O(Object(T)).forEach(function(b){Object.defineProperty(s,b,Object.getOwnPropertyDescriptor(T,b))})}return s}function p(s){var o=m();return function(){var b=Object(N.a)(s),g;if(o){var P=Object(N.a)(this).constructor;g=Reflect.construct(b,arguments,P)}else g=b.apply(this,arguments);return Object(_.a)(this,g)}}function m(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function l(){}function i(s){s.preventDefault()}var a=function(o){return o.replace(/[^\w.-]+/g,"")},c=200,C=600,x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,h=function(o){return o!=null},w=function(o,T){return T===o||typeof T=="number"&&typeof o=="number"&&isNaN(T)&&isNaN(o)},E=function(s){Object(M.a)(T,s);var o=p(T);function T(b){var g;Object(D.a)(this,T),g=o.call(this,b),g.onKeyDown=function(H){var X=g.props,W=X.onKeyDown,U=X.onPressEnter;if(H.keyCode===y.a.UP){var z=g.getRatio(H);g.up(H,z,null),g.stop()}else if(H.keyCode===y.a.DOWN){var Z=g.getRatio(H);g.down(H,Z,null),g.stop()}else H.keyCode===y.a.ENTER&&U&&U(H);if(g.recordCursorPosition(),g.lastKeyCode=H.keyCode,W){for(var q=arguments.length,oe=new Array(q>1?q-1:0),ye=1;ye<q;ye++)oe[ye-1]=arguments[ye];W.apply(void 0,[H].concat(oe))}},g.onKeyUp=function(H){var X=g.props.onKeyUp;if(g.stop(),g.recordCursorPosition(),X){for(var W=arguments.length,U=new Array(W>1?W-1:0),z=1;z<W;z++)U[z-1]=arguments[z];X.apply(void 0,[H].concat(U))}},g.onChange=function(H){var X=g.props.onChange;g.state.focused&&(g.inputting=!0),g.rawInput=g.props.parser(g.getValueFromEvent(H)),g.setState({inputValue:g.rawInput}),X(g.toNumber(g.rawInput))},g.onMouseUp=function(){var H=g.props.onMouseUp;g.recordCursorPosition(),H&&H.apply(void 0,arguments)},g.onFocus=function(){var H;g.setState({focused:!0}),(H=g.props).onFocus.apply(H,arguments)},g.onBlur=function(){var H=g.props.onBlur;g.inputting=!1,g.setState({focused:!1});var X=g.getCurrentValidValue(g.state.inputValue),W=g.setValue(X,l);if(H){var U=g.input.value,z=g.getInputDisplayValue({focus:!1,value:W});g.input.value=z&&Number(z),H.apply(void 0,arguments),g.input.value=U}},g.getRatio=function(H){var X=1;return H.metaKey||H.ctrlKey?X=.1:H.shiftKey&&(X=10),X},g.getFullNum=function(H){return isNaN(H)?H:/e/i.test(String(H))?Number(H).toFixed(18).replace(/\.?0+$/,""):H},g.getPrecision=function(H){if(h(g.props.precision))return g.props.precision;var X=String(H);if(X.indexOf("e-")>=0)return parseInt(X.slice(X.indexOf("e-")+2),10);var W=0;return X.indexOf(".")>=0&&(W=X.length-X.indexOf(".")-1),W},g.getInputDisplayValue=function(H){var X=H||g.state,W=X.focused,U=X.inputValue,z=X.value,Z;W?Z=U:Z=g.toPrecisionAsStep(z),Z==null&&(Z="");var q=g.formatWrapper(Z);return h(g.props.decimalSeparator)&&(q=q.toString().replace(".",g.props.decimalSeparator)),q},g.recordCursorPosition=function(){try{g.cursorStart=g.input.selectionStart,g.cursorEnd=g.input.selectionEnd,g.currentValue=g.input.value,g.cursorBefore=g.input.value.substring(0,g.cursorStart),g.cursorAfter=g.input.value.substring(g.cursorEnd)}catch(H){}},g.restoreByAfter=function(H){if(H===void 0)return!1;var X=g.input.value,W=X.lastIndexOf(H);if(W===-1)return!1;var U=g.cursorBefore.length;return g.lastKeyCode===y.a.DELETE&&g.cursorBefore.charAt(U-1)===H[0]?(g.fixCaret(U,U),!0):W+H.length===X.length?(g.fixCaret(W,W),!0):!1},g.partRestoreByAfter=function(H){return H===void 0?!1:Array.prototype.some.call(H,function(X,W){var U=H.substring(W);return g.restoreByAfter(U)})},g.isNotCompleteNumber=function(H){return isNaN(H)||H===""||H===null||H&&H.toString().indexOf(".")===H.toString().length-1},g.stop=function(){g.autoStepTimer&&clearTimeout(g.autoStepTimer)},g.down=function(H,X,W){g.pressingUpOrDown=!0,g.step("down",H,X,W)},g.up=function(H,X,W){g.pressingUpOrDown=!0,g.step("up",H,X,W)},g.saveInput=function(H){g.input=H};var P=b.value;P===void 0&&(P=b.defaultValue),g.state={focused:b.autoFocus};var j=g.getValidValue(g.toNumber(P));return g.state=S(S({},g.state),{},{inputValue:g.toPrecisionAsStep(j),value:j}),g}return Object(F.a)(T,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(g){var P=this.props,j=P.value,H=P.onChange,X=P.max,W=P.min,U=this.state.focused;if(g){if(!w(g.value,j)||!w(g.max,X)||!w(g.min,W)){var z=U?j:this.getValidValue(j),Z;this.pressingUpOrDown?Z=z:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:Z})}var q="value"in this.props?j:this.state.value;"max"in this.props&&g.max!==X&&typeof q=="number"&&q>X&&H&&H(X),"min"in this.props&&g.min!==W&&typeof q=="number"&&q<W&&H&&H(W)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var oe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===y.a.BACKSPACE?oe=this.cursorStart-1:this.lastKeyCode===y.a.DELETE&&(oe=this.cursorStart):oe=this.input.value.length,this.fixCaret(oe,oe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case y.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case y.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ye){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(g){var P=g;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(g){var P=g.target.value.trim().replace(/。/g,".");return h(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(g){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,H=parseFloat(g);return isNaN(H)?g:(H<P&&(H=P),H>j&&(H=j),H)}},{key:"setValue",value:function(g,P){var j=this.props.precision,H=this.isNotCompleteNumber(parseFloat(g))?null:parseFloat(g),X=this.state.value,W=X===void 0?null:X,U=this.state.inputValue,z=U===void 0?null:U,Z=typeof H=="number"?H.toFixed(j):"".concat(H),q=H!==W||Z!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},P)):this.setState({value:H,inputValue:this.toPrecisionAsStep(g)},P),q&&this.props.onChange(H),H}},{key:"getMaxPrecision",value:function(g){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,H=j.precision,X=j.step;if(h(H))return H;var W=this.getPrecision(P),U=this.getPrecision(X),z=this.getPrecision(g);return g?Math.max(z,W+U):W+U}},{key:"getPrecisionFactor",value:function(g){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(g,P);return Math.pow(10,j)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(g){return this.props.formatter?this.props.formatter(g):g}},{key:"toPrecisionAsStep",value:function(g){if(this.isNotCompleteNumber(g)||g==="")return g;var P=Math.abs(this.getMaxPrecision(g));return isNaN(P)?g.toString():Number(g).toFixed(P)}},{key:"toNumber",value:function(g){var P=this.props.precision,j=this.state.focused,H=g&&g.length>16&&j;return this.isNotCompleteNumber(g)||H?g:h(P)?Math.round(g*Math.pow(10,P))/Math.pow(10,P):Number(g)}},{key:"upStep",value:function(g,P){var j=this.props.step,H=this.getPrecisionFactor(g,P),X=Math.abs(this.getMaxPrecision(g,P)),W=((H*g+H*j*P)/H).toFixed(X);return this.toNumber(W)}},{key:"downStep",value:function(g,P){var j=this.props.step,H=this.getPrecisionFactor(g,P),X=Math.abs(this.getMaxPrecision(g,P)),W=((H*g-H*j*P)/H).toFixed(X);return this.toNumber(W)}},{key:"step",value:function(g,P){var j=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,X=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var W=this.props;if(W.disabled)return;var U=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(U))return;var z=this["".concat(g,"Step")](U,H),Z=z>W.max||z<W.min;if(z>W.max?z=W.max:z<W.min&&(z=W.min),this.setValue(z,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){j[g](P,H,!0)},X?c:C)}},{key:"fixCaret",value:function(g,P){if(g===void 0||P===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,H=this.input.selectionEnd;(g!==j||P!==H)&&this.input.setSelectionRange(g,P)}catch(X){}}},{key:"render",value:function(){var g,P=this.props,j=P.prefixCls,H=P.disabled,X=P.readOnly,W=P.useTouch,U=P.autoComplete,z=P.upHandler,Z=P.downHandler,q=P.className,oe=P.max,ye=P.min,me=P.style,fe=P.title,ve=P.onMouseEnter,ge=P.onMouseLeave,ae=P.onMouseOver,se=P.onMouseOut,Te=P.required,We=P.onClick,Je=P.tabIndex,Ye=P.type,Ze=P.placeholder,ze=P.id,Ke=P.inputMode,$e=P.pattern,Qe=P.step,nt=P.maxLength,Xe=P.autoFocus,He=P.name,st=P.onPaste,ft=P.onInput,ot=Object(V.a)(P,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ut=this.state,gt=ut.value,ht=ut.focused,be=v()(j,(g={},Object(B.a)(g,q,!!q),Object(B.a)(g,"".concat(j,"-disabled"),H),Object(B.a)(g,"".concat(j,"-focused"),ht),g)),pe={};Object.keys(ot).forEach(function(ie){(ie.substr(0,5)==="data-"||ie.substr(0,5)==="aria-"||ie==="role")&&(pe[ie]=ot[ie])});var ke=!X&&!H,Ne=this.getInputDisplayValue(null),xe=(gt||gt===0)&&(isNaN(gt)||Number(gt)>=oe),Re=(gt||gt===0)&&(isNaN(gt)||Number(gt)<=ye),de=xe||H||X,re=Re||H||X,ne=v()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(B.a)({},"".concat(j,"-handler-up-disabled"),de)),$=v()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(B.a)({},"".concat(j,"-handler-down-disabled"),re)),Q=W?{onTouchStart:de?l:this.up,onTouchEnd:this.stop}:{onMouseDown:de?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},te=W?{onTouchStart:re?l:this.down,onTouchEnd:this.stop}:{onMouseDown:re?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return A.a.createElement("div",{className:be,style:me,title:fe,onMouseEnter:ve,onMouseLeave:ge,onMouseOver:ae,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},A.a.createElement("div",{className:"".concat(j,"-handler-wrap")},A.a.createElement("span",Object.assign({unselectable:"on"},Q,{role:"button","aria-label":"Increase Value","aria-disabled":de,className:ne}),z||A.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:i})),A.a.createElement("span",Object.assign({unselectable:"on"},te,{role:"button","aria-label":"Decrease Value","aria-disabled":re,className:$}),Z||A.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:i}))),A.a.createElement("div",{className:"".concat(j,"-input-wrap")},A.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ye,"aria-valuemax":oe,"aria-valuenow":gt,required:Te,type:Ye,placeholder:Ze,onPaste:st,onClick:We,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:Je,autoComplete:U,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ke?this.onKeyDown:l,onKeyUp:ke?this.onKeyUp:l,autoFocus:Xe,maxLength:nt,readOnly:X,disabled:H,max:oe,min:ye,step:Qe,name:He,title:fe,id:ze,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ne),pattern:$e,inputMode:Ke,onInput:ft},pe))))}}]),T}(A.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:a,required:!1,autoComplete:"off"};var f=E,d=Ee.a=f},fcSX:function(Ie,Ee,k){"use strict";var V=k("Ff2n"),B=k("1OyB"),D=k("vuIU"),F=k("Ji7U"),M=k("md7G"),_=k("foSv"),N=k("1W/9"),I=k("cDcd"),A=k("rePB"),L=k("JX7q"),v=k("TSYQ"),y=k.n(v),O=k("qx4F"),S=k("4IlW");function p(H){return Array.isArray(H)?H:[H]}var m={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(m).filter(function(H){if(typeof document=="undefined")return!1;var X=document.getElementsByTagName("html")[0];return H in(X?X.style:{})})[0],i=m[l];function a(H,X,W,U){H.addEventListener?H.addEventListener(X,W,U):H.attachEvent&&H.attachEvent("on".concat(X),W)}function c(H,X,W,U){H.removeEventListener?H.removeEventListener(X,W,U):H.attachEvent&&H.detachEvent("on".concat(X),W)}function C(H,X){var W=typeof H=="function"?H(X):H;return Array.isArray(W)?W.length===2?W:[W[0],W[1]]:[W]}var x=function(X){return!isNaN(parseFloat(X))&&isFinite(X)},h=!(typeof window!="undefined"&&window.document&&window.document.createElement),w=function H(X,W,U,z){if(!W||W===document||W instanceof Document)return!1;if(W===X.parentNode)return!0;var Z=Math.max(Math.abs(U),Math.abs(z))===Math.abs(z),q=Math.max(Math.abs(U),Math.abs(z))===Math.abs(U),oe=W.scrollHeight-W.clientHeight,ye=W.scrollWidth-W.clientWidth,me=document.defaultView.getComputedStyle(W),fe=me.overflowY==="auto"||me.overflowY==="scroll",ve=me.overflowX==="auto"||me.overflowX==="scroll",ge=oe&&fe,ae=ye&&ve;return Z&&(!ge||ge&&(W.scrollTop>=oe&&z<0||W.scrollTop<=0&&z>0))||q&&(!ae||ae&&(W.scrollLeft>=ye&&U<0||W.scrollLeft<=0&&U>0))?H(X,W.parentNode,U,z):!1};function E(H){var X=f();return function(){var U=Object(_.a)(H),z;if(X){var Z=Object(_.a)(this).constructor;z=Reflect.construct(U,arguments,Z)}else z=U.apply(this,arguments);return Object(M.a)(this,z)}}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}var d={},s=function(H){Object(F.a)(W,H);var X=E(W);function W(U){var z;return Object(B.a)(this,W),z=X.call(this,U),z.domFocus=function(){z.dom&&z.dom.focus()},z.removeStartHandler=function(Z){if(Z.touches.length>1)return;z.startPos={x:Z.touches[0].clientX,y:Z.touches[0].clientY}},z.removeMoveHandler=function(Z){if(Z.changedTouches.length>1)return;var q=Z.currentTarget,oe=Z.changedTouches[0].clientX-z.startPos.x,ye=Z.changedTouches[0].clientY-z.startPos.y;(q===z.maskDom||q===z.handlerDom||q===z.contentDom&&w(q,Z.target,oe,ye))&&Z.cancelable&&Z.preventDefault()},z.transitionEnd=function(Z){var q=Z.target;c(q,i,z.transitionEnd),q.style.transition=""},z.onKeyDown=function(Z){if(Z.keyCode===S.a.ESC){var q=z.props.onClose;Z.stopPropagation(),q&&q(Z)}},z.onWrapperTransitionEnd=function(Z){var q=z.props,oe=q.open,ye=q.afterVisibleChange;Z.target===z.contentWrapper&&Z.propertyName.match(/transform$/)&&(z.dom.style.transition="",!oe&&z.getCurrentDrawerSome()&&(document.body.style.overflowX="",z.maskDom&&(z.maskDom.style.left="",z.maskDom.style.width="")),ye&&ye(!!oe))},z.openLevelTransition=function(){var Z=z.props,q=Z.open,oe=Z.width,ye=Z.height,me=z.getHorizontalBoolAndPlacementName(),fe=me.isHorizontal,ve=me.placementName,ge=z.contentDom?z.contentDom.getBoundingClientRect()[fe?"width":"height"]:0,ae=(fe?oe:ye)||ge;z.setLevelAndScrolling(q,ve,ae)},z.setLevelTransform=function(Z,q,oe,ye){var me=z.props,fe=me.placement,ve=me.levelMove,ge=me.duration,ae=me.ease,se=me.showMask;z.levelDom.forEach(function(Te){Te.style.transition="transform ".concat(ge," ").concat(ae),a(Te,i,z.transitionEnd);var We=Z?oe:0;if(ve){var Je=C(ve,{target:Te,open:Z});We=Z?Je[0]:Je[1]||0}var Ye=typeof We=="number"?"".concat(We,"px"):We,Ze=fe==="left"||fe==="top"?Ye:"-".concat(Ye);Ze=se&&fe==="right"&&ye?"calc(".concat(Ze," + ").concat(ye,"px)"):Ze,Te.style.transform=We?"".concat(q,"(").concat(Ze,")"):""})},z.setLevelAndScrolling=function(Z,q,oe){var ye=z.props.onChange;if(!h){var me=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(O.a)(!0):0;z.setLevelTransform(Z,q,oe,me),z.toggleScrollingToDrawerAndBody(me)}ye&&ye(Z)},z.toggleScrollingToDrawerAndBody=function(Z){var q=z.props,oe=q.getOpenCount,ye=q.getContainer,me=q.showMask,fe=q.open,ve=ye&&ye(),ge=oe&&oe();if(ve&&ve.parentNode===document.body&&me){var ae=["touchstart"],se=[document.body,z.maskDom,z.handlerDom,z.contentDom];fe&&document.body.style.overflow!=="hidden"?(Z&&z.addScrollingEffect(Z),ge===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",se.forEach(function(Te,We){if(!Te)return;a(Te,ae[We]||"touchmove",We?z.removeMoveHandler:z.removeStartHandler,z.passive)})):z.getCurrentDrawerSome()&&(ge||(document.body.style.overflow=""),document.body.style.touchAction="",Z&&z.remScrollingEffect(Z),se.forEach(function(Te,We){if(!Te)return;c(Te,ae[We]||"touchmove",We?z.removeMoveHandler:z.removeStartHandler,z.passive)}))}},z.addScrollingEffect=function(Z){var q=z.props,oe=q.placement,ye=q.duration,me=q.ease,fe=q.getOpenCount,ve=q.switchScrollingEffect,ge=fe&&fe();ge===1&&ve();var ae="width ".concat(ye," ").concat(me),se="transform ".concat(ye," ").concat(me);z.dom.style.transition="none";switch(oe){case"right":z.dom.style.transform="translateX(-".concat(Z,"px)");break;case"top":case"bottom":z.dom.style.width="calc(100% - ".concat(Z,"px)"),z.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(se,",").concat(ae),z.dom.style.width="",z.dom.style.transform="")})},z.remScrollingEffect=function(Z){var q=z.props,oe=q.placement,ye=q.duration,me=q.ease,fe=q.getOpenCount,ve=q.switchScrollingEffect,ge=fe&&fe();ge||ve(!0),l&&(document.body.style.overflowX="hidden"),z.dom.style.transition="none";var ae,se="width ".concat(ye," ").concat(me),Te="transform ".concat(ye," ").concat(me);switch(oe){case"left":{z.dom.style.width="100%",se="width 0s ".concat(me," ").concat(ye);break}case"right":{z.dom.style.transform="translateX(".concat(Z,"px)"),z.dom.style.width="100%",se="width 0s ".concat(me," ").concat(ye),z.maskDom&&(z.maskDom.style.left="-".concat(Z,"px"),z.maskDom.style.width="calc(100% + ".concat(Z,"px)"));break}case"top":case"bottom":{z.dom.style.width="calc(100% + ".concat(Z,"px)"),z.dom.style.height="100%",z.dom.style.transform="translateZ(0)",ae="height 0s ".concat(me," ").concat(ye);break}default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(Te,",").concat(ae?"".concat(ae,","):"").concat(se),z.dom.style.transform="",z.dom.style.width="",z.dom.style.height="")})},z.getCurrentDrawerSome=function(){return!Object.keys(d).some(function(Z){return d[Z]})},z.getLevelDom=function(Z){var q=Z.level,oe=Z.getContainer;if(h)return;var ye=oe&&oe(),me=ye?ye.parentNode:null;if(z.levelDom=[],q==="all"){var fe=me?Array.prototype.slice.call(me.children):[];fe.forEach(function(ve){ve.nodeName!=="SCRIPT"&&ve.nodeName!=="STYLE"&&ve.nodeName!=="LINK"&&ve!==ye&&z.levelDom.push(ve)})}else q&&p(q).forEach(function(ve){document.querySelectorAll(ve).forEach(function(ge){z.levelDom.push(ge)})})},z.getHorizontalBoolAndPlacementName=function(){var Z=z.props.placement,q=Z==="left"||Z==="right",oe="translate".concat(q?"X":"Y");return{isHorizontal:q,placementName:oe}},z.state={_self:Object(L.a)(z)},z}return Object(D.a)(W,[{key:"componentDidMount",value:function(){var z=this;if(!h){var Z=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Z=!0,null}}))}catch(fe){}this.passive=Z?{passive:!1}:!1}var q=this.props,oe=q.open,ye=q.getContainer,me=ye&&ye();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),oe&&(me&&me.parentNode===document.body&&(d[this.drawerId]=oe),this.openLevelTransition(),this.forceUpdate(function(){z.domFocus()}))}},{key:"componentDidUpdate",value:function(z){var Z=this.props,q=Z.open,oe=Z.getContainer,ye=oe&&oe();q!==z.open&&(q&&this.domFocus(),ye&&ye.parentNode===document.body&&(d[this.drawerId]=!!q),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var z=this.props,Z=z.getOpenCount,q=z.open,oe=z.switchScrollingEffect,ye=typeof Z=="function"&&Z();delete d[this.drawerId],q&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ye||(document.body.style.overflow="",oe(!0))}},{key:"render",value:function(){var z,Z=this,q=this.props,oe=q.className,ye=q.children,me=q.style,fe=q.width,ve=q.height,ge=q.defaultOpen,ae=q.open,se=q.prefixCls,Te=q.placement,We=q.level,Je=q.levelMove,Ye=q.ease,Ze=q.duration,ze=q.getContainer,Ke=q.handler,$e=q.onChange,Qe=q.afterVisibleChange,nt=q.showMask,Xe=q.maskClosable,He=q.maskStyle,st=q.onClose,ft=q.onHandleClick,ot=q.keyboard,ut=q.getOpenCount,gt=q.switchScrollingEffect,ht=Object(V.a)(q,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),be=this.dom?ae:!1,pe=y()(se,(z={},Object(A.a)(z,"".concat(se,"-").concat(Te),!0),Object(A.a)(z,"".concat(se,"-open"),be),Object(A.a)(z,oe||"",!!oe),Object(A.a)(z,"no-mask",!nt),z)),ke=this.getHorizontalBoolAndPlacementName(),Ne=ke.placementName,xe=Te==="left"||Te==="top"?"-100%":"100%",Re=be?"":"".concat(Ne,"(").concat(xe,")"),de=Ke&&I.cloneElement(Ke,{onClick:function(ne){Ke.props.onClick&&Ke.props.onClick(),ft&&ft(ne)},ref:function(ne){Z.handlerDom=ne}});return I.createElement("div",Object.assign({},ht,{tabIndex:-1,className:pe,style:me,ref:function(ne){Z.dom=ne},onKeyDown:be&&ot?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),nt&&I.createElement("div",{className:"".concat(se,"-mask"),onClick:Xe?st:void 0,style:He,ref:function(ne){Z.maskDom=ne}}),I.createElement("div",{className:"".concat(se,"-content-wrapper"),style:{transform:Re,msTransform:Re,width:x(fe)?"".concat(fe,"px"):fe,height:x(ve)?"".concat(ve,"px"):ve},ref:function(ne){Z.contentWrapper=ne}},I.createElement("div",{className:"".concat(se,"-content"),ref:function(ne){Z.contentDom=ne},onTouchStart:be&&nt?this.removeStartHandler:void 0,onTouchMove:be&&nt?this.removeMoveHandler:void 0},ye),de))}}],[{key:"getDerivedStateFromProps",value:function(z,Z){var q=Z.prevProps,oe=Z._self,ye={prevProps:z};if(q!==void 0){var me=z.placement,fe=z.level;me!==q.placement&&(oe.contentDom=null),fe!==q.level&&oe.getLevelDom(z)}return ye}}]),W}(I.Component);s.defaultProps={switchScrollingEffect:function(){}};var o=s;function T(H){var X=b();return function(){var U=Object(_.a)(H),z;if(X){var Z=Object(_.a)(this).constructor;z=Reflect.construct(U,arguments,Z)}else z=U.apply(this,arguments);return Object(M.a)(this,z)}}function b(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}var g=function(H){Object(F.a)(W,H);var X=T(W);function W(U){var z;Object(B.a)(this,W),z=X.call(this,U),z.onHandleClick=function(q){var oe=z.props,ye=oe.onHandleClick,me=oe.open;if(ye&&ye(q),typeof me=="undefined"){var fe=z.state.open;z.setState({open:!fe})}},z.onClose=function(q){var oe=z.props,ye=oe.onClose,me=oe.open;ye&&ye(q),typeof me=="undefined"&&z.setState({open:!1})};var Z=typeof U.open!="undefined"?U.open:!!U.defaultOpen;return z.state={open:Z},"onMaskClick"in U&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),z}return Object(D.a)(W,[{key:"render",value:function(){var z=this,Z=this.props,q=Z.defaultOpen,oe=Z.getContainer,ye=Z.wrapperClassName,me=Z.forceRender,fe=Z.handler,ve=Object(V.a)(Z,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),ge=this.state.open;if(!oe)return I.createElement("div",{className:ye,ref:function(Te){z.dom=Te}},I.createElement(o,Object.assign({},ve,{open:ge,handler:fe,getContainer:function(){return z.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ae=!!fe||me;return I.createElement(N.a,{visible:ge,forceRender:ae,getContainer:oe,wrapperClassName:ye},function(se){var Te=se.visible,We=se.afterClose,Je=Object(V.a)(se,["visible","afterClose"]);return I.createElement(o,Object.assign({},ve,Je,{open:Te!==void 0?Te:ge,afterVisibleChange:We!==void 0?We:ve.afterVisibleChange,handler:fe,onClose:z.onClose,onHandleClick:z.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(z,Z){var q=Z.prevProps,oe={prevProps:z};return typeof q!="undefined"&&z.open!==q.open&&(oe.open=z.open),oe}}]),W}(I.Component);g.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:I.createElement("div",{className:"drawer-handle"},I.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var P=g,j=Ee.a=P},fcyK:function(Ie,Ee,k){},fyJ8:function(Ie,Ee,k){"use strict";var V=k("rePB"),B=k("VTBJ"),D=k("Ff2n"),F=k("U8pU"),M=k("cDcd"),_=k.n(M),N=k("TSYQ"),I=k.n(N),A=k("c+Xe"),L=k("sR1s");function v(m){return m&&Object(F.a)(m)==="object"&&!Array.isArray(m)&&!M.isValidElement(m)}function y(m){return typeof m=="string"?!0:Object(A.c)(m)}function O(m,l){var i,a=m.prefixCls,c=m.className,C=m.record,x=m.index,h=m.dataIndex,w=m.render,E=m.children,f=m.component,d=f===void 0?"td":f,s=m.colSpan,o=m.rowSpan,T=m.fixLeft,b=m.fixRight,g=m.firstFixLeft,P=m.lastFixLeft,j=m.firstFixRight,H=m.lastFixRight,X=m.appendNode,W=m.additionalProps,U=W===void 0?{}:W,z=m.ellipsis,Z=m.align,q=m.rowType,oe=m.isSticky,ye="".concat(a,"-cell"),me,fe;if(E)fe=E;else{var ve=Object(L.b)(C,h);if(fe=ve,w){var ge=w(ve,C,x);v(ge)?(fe=ge.children,me=ge.props):fe=ge}}Object(F.a)(fe)==="object"&&!Array.isArray(fe)&&!M.isValidElement(fe)&&(fe=null),z&&(P||j)&&(fe=M.createElement("span",{className:"".concat(ye,"-content")},fe));var ae=me||{},se=ae.colSpan,Te=ae.rowSpan,We=ae.style,Je=ae.className,Ye=Object(D.a)(ae,["colSpan","rowSpan","style","className"]),Ze=se!==void 0?se:s,ze=Te!==void 0?Te:o;if(Ze===0||ze===0)return null;var Ke={},$e=typeof T=="number",Qe=typeof b=="number";$e&&(Ke.position="sticky",Ke.left=T),Qe&&(Ke.position="sticky",Ke.right=b);var nt={};Z&&(nt.textAlign=Z);var Xe,He=z===!0?{showTitle:!0}:z;He&&(He.showTitle||q==="header")&&(typeof fe=="string"||typeof fe=="number"?Xe=fe.toString():M.isValidElement(fe)&&typeof fe.props.children=="string"&&(Xe=fe.props.children));var st=Object(B.a)(Object(B.a)(Object(B.a)({title:Xe},Ye),U),{},{colSpan:Ze&&Ze!==1?Ze:null,rowSpan:ze&&ze!==1?ze:null,className:I()(ye,c,(i={},Object(V.a)(i,"".concat(ye,"-fix-left"),$e),Object(V.a)(i,"".concat(ye,"-fix-left-first"),g),Object(V.a)(i,"".concat(ye,"-fix-left-last"),P),Object(V.a)(i,"".concat(ye,"-fix-right"),Qe),Object(V.a)(i,"".concat(ye,"-fix-right-first"),j),Object(V.a)(i,"".concat(ye,"-fix-right-last"),H),Object(V.a)(i,"".concat(ye,"-ellipsis"),z),Object(V.a)(i,"".concat(ye,"-with-append"),X),Object(V.a)(i,"".concat(ye,"-fix-sticky"),($e||Qe)&&oe),i),U.className,Je),style:Object(B.a)(Object(B.a)(Object(B.a)(Object(B.a)({},U.style),nt),Ke),We),ref:y(d)?l:null});return M.createElement(d,Object.assign({},st),X,fe)}var S=M.forwardRef(O);S.displayName="Cell";var p=M.memo(S,function(m,l){return l.shouldCellUpdate?!l.shouldCellUpdate(l.record,m.record):!1});Ee.a=p},gRFJ:function(Ie,Ee,k){Ie.exports=[k("rdUC"),k("ynwM"),k("RELg"),k("DlR+"),k("CrYA"),k("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(Ie){return Ie<10?"0"+Ie:Ie}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(Ie){return rx_escapable.lastIndex=0,rx_escapable.test(Ie)?'"'+Ie.replace(rx_escapable,function(Ee){var k=meta[Ee];return typeof k=="string"?k:"\\u"+("0000"+Ee.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Ie+'"'}function str(Ie,Ee){var k,V,B,D,F=gap,M,_=Ee[Ie];_&&typeof _=="object"&&typeof _.toJSON=="function"&&(_=_.toJSON(Ie)),typeof rep=="function"&&(_=rep.call(Ee,Ie,_));switch(typeof _){case"string":return quote(_);case"number":return isFinite(_)?String(_):"null";case"boolean":case"null":return String(_);case"object":if(!_)return"null";if(gap+=indent,M=[],Object.prototype.toString.apply(_)==="[object Array]"){for(D=_.length,k=0;k<D;k+=1)M[k]=str(k,_)||"null";return B=M.length===0?"[]":gap?`[
|
|
`+gap+M.join(`,
|
|
`+gap)+`
|
|
`+F+"]":"["+M.join(",")+"]",gap=F,B}if(rep&&typeof rep=="object")for(D=rep.length,k=0;k<D;k+=1)typeof rep[k]=="string"&&(V=rep[k],B=str(V,_),B&&M.push(quote(V)+(gap?": ":":")+B));else for(V in _)Object.prototype.hasOwnProperty.call(_,V)&&(B=str(V,_),B&&M.push(quote(V)+(gap?": ":":")+B));return B=M.length===0?"{}":gap?`{
|
|
`+gap+M.join(`,
|
|
`+gap)+`
|
|
`+F+"}":"{"+M.join(",")+"}",gap=F,B}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(Ie,Ee,k){var V;if(gap="",indent="",typeof k=="number")for(V=0;V<k;V+=1)indent+=" ";else typeof k=="string"&&(indent=k);if(rep=Ee,Ee&&typeof Ee!="function"&&(typeof Ee!="object"||typeof Ee.length!="number"))throw new Error("JSON.stringify");return str("",{"":Ie})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(Ie,Ee){var k,V,B=Ie[Ee];if(B&&typeof B=="object")for(k in B)Object.prototype.hasOwnProperty.call(B,k)&&(V=walk(B,k),V!==void 0?B[k]=V:delete B[k]);return reviver.call(Ie,Ee,B)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(Ie){return"\\u"+("0000"+Ie.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},hW8S:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return F}),k.d(Ee,"c",function(){return M}),k.d(Ee,"b",function(){return _});var V=k("VTBJ"),B=k("Ff2n"),D=k("Kwbf"),F="RC_TABLE_INTERNAL_COL_DEFINE";function M(N){var I=N.expandable,A=Object(B.a)(N,["expandable"]);return"expandable"in N?Object(V.a)(Object(V.a)({},A),I):A}function _(N){return Object.keys(N).reduce(function(I,A){return(A.substr(0,5)==="data-"||A.substr(0,5)==="aria-")&&(I[A]=N[A]),I},{})}},i3hx:function(Ie,Ee,k){},je13:function(Ie,Ee,k){var V=k("5nXd"),B=k("gRFJ"),D=[k("uQRt")];Ie.exports=V.createStore(B,D)},kSUc:function(Ie,Ee,k){},"kaH+":function(Ie,Ee,k){"use strict";var V=k("+L6B"),B=k("2/Rp"),D=k("tJVT"),F=k("cDcd"),M=k.n(F),_=k("UZu5"),N=k.n(_),I=k("dhSg"),A=k("rLCj"),L=k("dF/Y"),v=k("4i/N");Ee.a=function(){var y=Object(F.useState)(""),O=Object(D.a)(y,2),S=O[0],p=O[1],m=Object(F.useState)(0),l=Object(D.a)(m,2),i=l[0],a=l[1],c=Object(F.useRef)("");Object(F.useEffect)(function(){var d=I.a.subscribe("preview-image",function(s){p(s),document.body.style.overflow="hidden"});return d},[]),Object(F.useEffect)(function(){return document.addEventListener("keydown",C),function(){document.removeEventListener("keydown",C)}},[]),Object(F.useEffect)(function(){c.current=S},[S]);function C(d){d.keyCode==27&&c.current&&x()}function x(){document.body.style.overflow="auto",p("")}function h(){a(i+90)}var w=Object(F.useRef)(),E=Object(F.useRef)(),f=function(s){(s.nativeEvent.target===w.current||s.nativeEvent.target===E.current)&&x()};return M.a.createElement(F.Fragment,null,S?M.a.createElement("div",{className:"image-preview-container",ref:w,onClick:f},M.a.createElement("div",{className:"button-group"},M.a.createElement(B.a,{onClick:h},"\u65CB\u8F6C",M.a.createElement(A.a,null)),M.a.createElement(B.a,{href:S},"\u4E0B\u8F7D",M.a.createElement(L.a,null)),M.a.createElement(B.a,{onClick:x},"\u5173\u95ED",M.a.createElement(v.a,null))),M.a.createElement("div",{className:"preview-wrp-group",ref:E},M.a.createElement("img",{className:"image-preview",src:S,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(i,"deg)")}}))):null)}},lOMy:function(Ie,Ee,k){},lZu9:function(Ie,Ee,k){(function(V){V(k("VrN/"),k("1eCo"),k("8EBN"))})(function(V){"use strict";V.defineMode("markdown",function(B,D){var F=V.getMode(B,"text/html"),M=F.name=="null";function _(W){if(V.findModeByName){var U=V.findModeByName(W);U&&(W=U.mime||U.mimes[0])}var z=V.getMode(B,W);return z.name=="null"?null:z}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.tokenTypeOverrides={});var N={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var I in N)N.hasOwnProperty(I)&&D.tokenTypeOverrides[I]&&(N[I]=D.tokenTypeOverrides[I]);var A=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,y=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,O=/^ {0,3}(?:\={1,}|-{2,})\s*$/,S=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,i=" ";function a(W,U,z){return U.f=U.inline=z,z(W,U)}function c(W,U,z){return U.f=U.block=z,z(W,U)}function C(W){return!W||!/\S/.test(W.string)}function x(W){if(W.linkTitle=!1,W.linkHref=!1,W.linkText=!1,W.em=!1,W.strong=!1,W.strikethrough=!1,W.quote=0,W.indentedCode=!1,W.f==w){var U=M;if(!U){var z=V.innerMode(F,W.htmlState);U=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}U&&(W.f=s,W.block=h,W.htmlState=null)}return W.trailingSpace=0,W.trailingSpaceNewLine=!1,W.prevLine=W.thisLine,W.thisLine={stream:null},null}function h(W,U){var z=W.column()===U.indentation,Z=C(U.prevLine.stream),q=U.indentedCode,oe=U.prevLine.hr,ye=U.list!==!1,me=(U.listStack[U.listStack.length-1]||0)+3;U.indentedCode=!1;var fe=U.indentation;if(U.indentationDiff===null&&(U.indentationDiff=U.indentation,ye)){for(U.list=null;fe<U.listStack[U.listStack.length-1];)U.listStack.pop(),U.listStack.length?U.indentation=U.listStack[U.listStack.length-1]:U.list=!1;U.list!==!1&&(U.indentationDiff=fe-U.listStack[U.listStack.length-1])}var ve=!Z&&!oe&&!U.prevLine.header&&(!ye||!q)&&!U.prevLine.fencedCodeEnd,ge=(U.list===!1||oe||Z)&&U.indentation<=me&&W.match(A),ae=null;if(U.indentationDiff>=4&&(q||U.prevLine.fencedCodeEnd||U.prevLine.header||Z))return W.skipToEnd(),U.indentedCode=!0,N.code;if(W.eatSpace())return null;if(z&&U.indentation<=me&&(ae=W.match(y))&&ae[1].length<=6)return U.quote=0,U.header=ae[1].length,U.thisLine.header=!0,D.highlightFormatting&&(U.formatting="header"),U.f=U.inline,f(U);if(U.indentation<=me&&W.eat(">"))return U.quote=z?1:U.quote+1,D.highlightFormatting&&(U.formatting="quote"),W.eatSpace(),f(U);if(!ge&&!U.setext&&z&&U.indentation<=me&&(ae=W.match(L))){var se=ae[1]?"ol":"ul";return U.indentation=fe+W.current().length,U.list=!0,U.quote=0,U.listStack.push(U.indentation),U.em=!1,U.strong=!1,U.code=!1,U.strikethrough=!1,D.taskLists&&W.match(v,!1)&&(U.taskList=!0),U.f=U.inline,D.highlightFormatting&&(U.formatting=["list","list-"+se]),f(U)}else{if(z&&U.indentation<=me&&(ae=W.match(p,!0)))return U.quote=0,U.fencedEndRE=new RegExp(ae[1]+"+ *$"),U.localMode=D.fencedCodeBlockHighlighting&&_(ae[2]||D.fencedCodeBlockDefaultMode),U.localMode&&(U.localState=V.startState(U.localMode)),U.f=U.block=E,D.highlightFormatting&&(U.formatting="code-block"),U.code=-1,f(U);if(U.setext||(!ve||!ye)&&!U.quote&&U.list===!1&&!U.code&&!ge&&!m.test(W.string)&&(ae=W.lookAhead(1))&&(ae=ae.match(O)))return U.setext?(U.header=U.setext,U.setext=0,W.skipToEnd(),D.highlightFormatting&&(U.formatting="header")):(U.header=ae[0].charAt(0)=="="?1:2,U.setext=U.header),U.thisLine.header=!0,U.f=U.inline,f(U);if(ge)return W.skipToEnd(),U.hr=!0,U.thisLine.hr=!0,N.hr;if(W.peek()==="[")return a(W,U,P)}return a(W,U,U.inline)}function w(W,U){var z=F.token(W,U.htmlState);if(!M){var Z=V.innerMode(F,U.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||U.md_inside&&W.current().indexOf(">")>-1)&&(U.f=s,U.block=h,U.htmlState=null)}return z}function E(W,U){var z=U.listStack[U.listStack.length-1]||0,Z=U.indentation<z,q=z+3;if(U.fencedEndRE&&U.indentation<=q&&(Z||W.match(U.fencedEndRE))){D.highlightFormatting&&(U.formatting="code-block");var oe;return Z||(oe=f(U)),U.localMode=U.localState=null,U.block=h,U.f=s,U.fencedEndRE=null,U.code=0,U.thisLine.fencedCodeEnd=!0,Z?c(W,U,U.block):oe}else return U.localMode?U.localMode.token(W,U.localState):(W.skipToEnd(),N.code)}function f(W){var U=[];if(W.formatting){U.push(N.formatting),typeof W.formatting=="string"&&(W.formatting=[W.formatting]);for(var z=0;z<W.formatting.length;z++)U.push(N.formatting+"-"+W.formatting[z]),W.formatting[z]==="header"&&U.push(N.formatting+"-"+W.formatting[z]+"-"+W.header),W.formatting[z]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=W.quote?U.push(N.formatting+"-"+W.formatting[z]+"-"+W.quote):U.push("error"))}if(W.taskOpen)return U.push("meta"),U.length?U.join(" "):null;if(W.taskClosed)return U.push("property"),U.length?U.join(" "):null;if(W.linkHref?U.push(N.linkHref,"url"):(W.strong&&U.push(N.strong),W.em&&U.push(N.em),W.strikethrough&&U.push(N.strikethrough),W.emoji&&U.push(N.emoji),W.linkText&&U.push(N.linkText),W.code&&U.push(N.code),W.image&&U.push(N.image),W.imageAltText&&U.push(N.imageAltText,"link"),W.imageMarker&&U.push(N.imageMarker)),W.header&&U.push(N.header,N.header+"-"+W.header),W.quote&&(U.push(N.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=W.quote?U.push(N.quote+"-"+W.quote):U.push(N.quote+"-"+D.maxBlockquoteDepth)),W.list!==!1){var Z=(W.listStack.length-1)%3;Z?Z===1?U.push(N.list2):U.push(N.list3):U.push(N.list1)}return W.trailingSpaceNewLine?U.push("trailing-space-new-line"):W.trailingSpace&&U.push("trailing-space-"+(W.trailingSpace%2?"a":"b")),U.length?U.join(" "):null}function d(W,U){return W.match(S,!0)?f(U):void 0}function s(W,U){var z=U.text(W,U);if(typeof z!="undefined")return z;if(U.list)return U.list=null,f(U);if(U.taskList){var Z=W.match(v,!0)[1]===" ";return Z?U.taskOpen=!0:U.taskClosed=!0,D.highlightFormatting&&(U.formatting="task"),U.taskList=!1,f(U)}if(U.taskOpen=!1,U.taskClosed=!1,U.header&&W.match(/^#+$/,!0))return D.highlightFormatting&&(U.formatting="header"),f(U);var q=W.next();if(U.linkTitle){U.linkTitle=!1;var oe=q;q==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ye="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(W.match(new RegExp(ye),!0))return N.linkHref}if(q==="`"){var me=U.formatting;D.highlightFormatting&&(U.formatting="code"),W.eatWhile("`");var fe=W.current().length;if(U.code==0&&(!U.quote||fe==1))return U.code=fe,f(U);if(fe==U.code){var ve=f(U);return U.code=0,ve}else return U.formatting=me,f(U)}else if(U.code)return f(U);if(q==="\\"&&(W.next(),D.highlightFormatting)){var ge=f(U),ae=N.formatting+"-escape";return ge?ge+" "+ae:ae}if(q==="!"&&W.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return U.imageMarker=!0,U.image=!0,D.highlightFormatting&&(U.formatting="image"),f(U);if(q==="["&&U.imageMarker&&W.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return U.imageMarker=!1,U.imageAltText=!0,D.highlightFormatting&&(U.formatting="image"),f(U);if(q==="]"&&U.imageAltText){D.highlightFormatting&&(U.formatting="image");var ge=f(U);return U.imageAltText=!1,U.image=!1,U.inline=U.f=T,ge}if(q==="["&&!U.image)return U.linkText&&W.match(/^.*?\]/)||(U.linkText=!0,D.highlightFormatting&&(U.formatting="link")),f(U);if(q==="]"&&U.linkText){D.highlightFormatting&&(U.formatting="link");var ge=f(U);return U.linkText=!1,U.inline=U.f=W.match(/\(.*?\)| ?\[.*?\]/,!1)?T:s,ge}if(q==="<"&&W.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=o,D.highlightFormatting&&(U.formatting="link");var ge=f(U);return ge?ge+=" ":ge="",ge+N.linkInline}if(q==="<"&&W.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=o,D.highlightFormatting&&(U.formatting="link");var ge=f(U);return ge?ge+=" ":ge="",ge+N.linkEmail}if(D.xml&&q==="<"&&W.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var se=W.string.indexOf(">",W.pos);if(se!=-1){var Te=W.string.substring(W.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Te)&&(U.md_inside=!0)}return W.backUp(1),U.htmlState=V.startState(F),c(W,U,w)}if(D.xml&&q==="<"&&W.match(/^\/\w*?>/))return U.md_inside=!1,"tag";if(q==="*"||q==="_"){for(var We=1,Je=W.pos==1?" ":W.string.charAt(W.pos-2);We<3&&W.eat(q);)We++;var Ye=W.peek()||" ",Ze=!/\s/.test(Ye)&&(!l.test(Ye)||/\s/.test(Je)||l.test(Je)),ze=!/\s/.test(Je)&&(!l.test(Je)||/\s/.test(Ye)||l.test(Ye)),Ke=null,$e=null;if(We%2&&(!U.em&&Ze&&(q==="*"||!ze||l.test(Je))?Ke=!0:U.em==q&&ze&&(q==="*"||!Ze||l.test(Ye))&&(Ke=!1)),We>1&&(!U.strong&&Ze&&(q==="*"||!ze||l.test(Je))?$e=!0:U.strong==q&&ze&&(q==="*"||!Ze||l.test(Ye))&&($e=!1)),$e!=null||Ke!=null){D.highlightFormatting&&(U.formatting=Ke==null?"strong":$e==null?"em":"strong em"),Ke===!0&&(U.em=q),$e===!0&&(U.strong=q);var ve=f(U);return Ke===!1&&(U.em=!1),$e===!1&&(U.strong=!1),ve}}else if(q===" "&&(W.eat("*")||W.eat("_"))){if(W.peek()===" ")return f(U);W.backUp(1)}if(D.strikethrough){if(q==="~"&&W.eatWhile(q)){if(U.strikethrough){D.highlightFormatting&&(U.formatting="strikethrough");var ve=f(U);return U.strikethrough=!1,ve}else if(W.match(/^[^\s]/,!1))return U.strikethrough=!0,D.highlightFormatting&&(U.formatting="strikethrough"),f(U)}else if(q===" "&&W.match(/^~~/,!0)){if(W.peek()===" ")return f(U);W.backUp(2)}}if(D.emoji&&q===":"&&W.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){U.emoji=!0,D.highlightFormatting&&(U.formatting="emoji");var Qe=f(U);return U.emoji=!1,Qe}return q===" "&&(W.match(/^ +$/,!1)?U.trailingSpace++:U.trailingSpace&&(U.trailingSpaceNewLine=!0)),f(U)}function o(W,U){var z=W.next();if(z===">"){U.f=U.inline=s,D.highlightFormatting&&(U.formatting="link");var Z=f(U);return Z?Z+=" ":Z="",Z+N.linkInline}return W.match(/^[^>]+/,!0),N.linkInline}function T(W,U){if(W.eatSpace())return null;var z=W.next();return z==="("||z==="["?(U.f=U.inline=g(z==="("?")":"]"),D.highlightFormatting&&(U.formatting="link-string"),U.linkHref=!0,f(U)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function g(W){return function(U,z){var Z=U.next();if(Z===W){z.f=z.inline=s,D.highlightFormatting&&(z.formatting="link-string");var q=f(z);return z.linkHref=!1,q}return U.match(b[W]),z.linkHref=!0,f(z)}}function P(W,U){return W.match(/^([^\]\\]|\\.)*\]:/,!1)?(U.f=j,W.next(),D.highlightFormatting&&(U.formatting="link"),U.linkText=!0,f(U)):a(W,U,s)}function j(W,U){if(W.match(/^\]:/,!0)){U.f=U.inline=H,D.highlightFormatting&&(U.formatting="link");var z=f(U);return U.linkText=!1,z}return W.match(/^([^\]\\]|\\.)+/,!0),N.linkText}function H(W,U){return W.eatSpace()?null:(W.match(/^[^\s]+/,!0),W.peek()===void 0?U.linkTitle=!0:W.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),U.f=U.inline=s,N.linkHref+" url")}var X={startState:function(){return{f:h,prevLine:{stream:null},thisLine:{stream:null},block:h,htmlState:null,indentation:0,inline:s,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(W){return{f:W.f,prevLine:W.prevLine,thisLine:W.thisLine,block:W.block,htmlState:W.htmlState&&V.copyState(F,W.htmlState),indentation:W.indentation,localMode:W.localMode,localState:W.localMode?V.copyState(W.localMode,W.localState):null,inline:W.inline,text:W.text,formatting:!1,linkText:W.linkText,linkTitle:W.linkTitle,linkHref:W.linkHref,code:W.code,em:W.em,strong:W.strong,strikethrough:W.strikethrough,emoji:W.emoji,header:W.header,setext:W.setext,hr:W.hr,taskList:W.taskList,list:W.list,listStack:W.listStack.slice(0),quote:W.quote,indentedCode:W.indentedCode,trailingSpace:W.trailingSpace,trailingSpaceNewLine:W.trailingSpaceNewLine,md_inside:W.md_inside,fencedEndRE:W.fencedEndRE}},token:function(W,U){if(U.formatting=!1,W!=U.thisLine.stream){if(U.header=0,U.hr=!1,W.match(/^\s*$/,!0))return x(U),null;if(U.prevLine=U.thisLine,U.thisLine={stream:W},U.taskList=!1,U.trailingSpace=0,U.trailingSpaceNewLine=!1,!U.localState&&(U.f=U.block,U.f!=w)){var z=W.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(U.indentation=z,U.indentationDiff=null,z>0)return null}}return U.f(W,U)},innerMode:function(W){return W.block==w?{state:W.htmlState,mode:F}:W.localState?{state:W.localState,mode:W.localMode}:{state:W,mode:X}},indent:function(W,U,z){return W.block==w&&F.indent?F.indent(W.htmlState,U,z):W.localState&&W.localMode.indent?W.localMode.indent(W.localState,U,z):V.Pass},blankLine:x,getType:f,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return X},"xml"),V.defineMIME("text/markdown","markdown"),V.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return I});var V=k("cDcd"),B=k("biw7"),D=k("fyJ8");function F(A){var L=A.className,v=A.index,y=A.children,O=A.colSpan,S=A.rowSpan,p=V.useContext(B.a),m=p.prefixCls,l=p.fixedInfoList,i=l[v];return V.createElement(D.a,Object.assign({className:L,index:v,component:"td",prefixCls:m,record:null,dataIndex:null,render:function(){return{children:y,props:{colSpan:O,rowSpan:S}}}},i))}function M(A){return V.createElement("tr",Object.assign({},A))}function _(A){var L=A.children,v=V.useContext(B.a),y=v.prefixCls;return V.createElement("tfoot",{className:"".concat(y,"-summary")},L)}var N=Ee.b=_,I={Cell:F,Row:M}},nWbc:function(Ie,Ee,k){},oFv4:function(Ie,Ee,k){Ie.exports=k.p+"static/internal.da228387.png"},osHv:function(Ie,Ee,k){(function(V){V(k("VrN/"))})(function(V){"use strict";var B=V.Pos;function D(l,i){return l.line-i.line||l.ch-i.ch}var F="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",M=F+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_=new RegExp("<(/?)(["+F+"]["+M+"]*)","g");function N(l,i,a,c){this.line=i,this.ch=a,this.cm=l,this.text=l.getLine(i),this.min=c?Math.max(c.from,l.firstLine()):l.firstLine(),this.max=c?Math.min(c.to-1,l.lastLine()):l.lastLine()}function I(l,i){var a=l.cm.getTokenTypeAt(B(l.line,i));return a&&/\btag\b/.test(a)}function A(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function L(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function v(l){for(;;){var i=l.text.indexOf(">",l.ch);if(i==-1){if(A(l))continue;return}if(!I(l,i+1)){l.ch=i+1;continue}var a=l.text.lastIndexOf("/",i),c=a>-1&&!/\S/.test(l.text.slice(a+1,i));return l.ch=i+1,c?"selfClose":"regular"}}function y(l){for(;;){var i=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(i==-1){if(L(l))continue;return}if(!I(l,i+1)){l.ch=i;continue}_.lastIndex=i,l.ch=i;var a=_.exec(l.text);if(a&&a.index==i)return a}}function O(l){for(;;){_.lastIndex=l.ch;var i=_.exec(l.text);if(!i){if(A(l))continue;return}if(!I(l,i.index+1)){l.ch=i.index+1;continue}return l.ch=i.index+i[0].length,i}}function S(l){for(;;){var i=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(i==-1){if(L(l))continue;return}if(!I(l,i+1)){l.ch=i;continue}var a=l.text.lastIndexOf("/",i),c=a>-1&&!/\S/.test(l.text.slice(a+1,i));return l.ch=i+1,c?"selfClose":"regular"}}function p(l,i){for(var a=[];;){var c=O(l),C,x=l.line,h=l.ch-(c?c[0].length:0);if(!c||!(C=v(l)))return;if(C=="selfClose")continue;if(c[1]){for(var w=a.length-1;w>=0;--w)if(a[w]==c[2]){a.length=w;break}if(w<0&&(!i||i==c[2]))return{tag:c[2],from:B(x,h),to:B(l.line,l.ch)}}else a.push(c[2])}}function m(l,i){for(var a=[];;){var c=S(l);if(!c)return;if(c=="selfClose"){y(l);continue}var C=l.line,x=l.ch,h=y(l);if(!h)return;if(h[1])a.push(h[2]);else{for(var w=a.length-1;w>=0;--w)if(a[w]==h[2]){a.length=w;break}if(w<0&&(!i||i==h[2]))return{tag:h[2],from:B(l.line,l.ch),to:B(C,x)}}}}V.registerHelper("fold","xml",function(l,i){for(var a=new N(l,i.line,0);;){var c=O(a);if(!c||a.line!=i.line)return;var C=v(a);if(!C)return;if(!c[1]&&C!="selfClose"){var x=B(a.line,a.ch),h=p(a,c[2]);return h&&D(h.from,x)>0?{from:x,to:h.from}:null}}}),V.findMatchingTag=function(l,i,a){var c=new N(l,i.line,i.ch,a);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var C=v(c),x=C&&B(c.line,c.ch),h=C&&y(c);if(!C||!h||D(c,i)>0)return;var w={from:B(c.line,c.ch),to:x,tag:h[2]};return C=="selfClose"?{open:w,close:null,at:"open"}:h[1]?{open:m(c,h[2]),close:w,at:"close"}:(c=new N(l,x.line,x.ch,a),{open:w,close:p(c,h[2]),at:"open"})},V.findEnclosingTag=function(l,i,a,c){for(var C=new N(l,i.line,i.ch,a);;){var x=m(C,c);if(!x)break;var h=new N(l,i.line,i.ch,a),w=p(h,x.tag);if(w)return{open:x,close:w}}},V.scanForClosingTag=function(l,i,a,c){var C=new N(l,i.line,i.ch,c?{from:0,to:c}:null);return p(C,a)}})},"p/48":function(Ie,Ee,k){},p5ED:function(Ie,Ee,k){"use strict";var V=k("+L6B"),B=k("2/Rp"),D=k("5Dmo"),F=k("3S7+"),M=k("k1fw"),_=k("tJVT"),N=k("cDcd"),I=k.n(N),A=k("vHTk"),L=k.n(A),v=k("yEEn"),y=k("ZW9T"),O=k("1vsH");Ee.a=function(S){var p=S.name,m=S.data,l=S.theme,i=S.type,a=S.filename,c=S.monacoEditor,C=S.className,x=S.style,h=S.close,w=S.onClose,E=S.hasMask,f=Object(N.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),d=Object(_.a)(f,2),s=d[0],o=d[1],T=Object(N.useState)(""),b=Object(_.a)(T,2),g=b[0],P=b[1],j,H=1024*1024,X=10*H,W=Object(N.useRef)();i==="office"&&(j=Object(O.V)(m).filesize,j>X&&(i="other")),a&&(c.filename=a),Object(N.useEffect)(function(){var Z,q,oe=(Z=document.cookie)===null||Z===void 0||((q=Z.replace(/\s/g,""))===null||q===void 0)?void 0:q.split(";");oe==null||oe.map(function(ye){var me=ye.split("=");me[0]==="_educoder_session"&&P(me[1])})},[]);var U=function(){if(m.startsWith("http")||m.startsWith("blob:")){z();return}Object(O.z)(a||"educoder",m,a)},z=function(){Object(O.x)(a||"educoder",decodeURIComponent(m))};return console.log("data:",m,"fileanme:",a," name:",p),I.a.createElement("div",{style:Object(M.a)({},x||{}),className:"".concat(E&&L.a.bgBlack," ").concat(i?L.a.wrp:"hide")},h&&I.a.createElement("div",{className:L.a.close,ref:W},I.a.createElement(F.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return W.current}},I.a.createElement("span",{onClick:z},I.a.createElement("i",{className:"icon-quxiaozhiding"}))),I.a.createElement(F.a,{title:"\u5173\u95ED",getPopupContainer:function(){return W.current}},I.a.createElement("span",{className:"",onClick:w},I.a.createElement("i",{className:"icon-guanbi1"})))),I.a.createElement("div",{className:"".concat(L.a[C]," ").concat(C," ").concat(L.a.monaco," ").concat(i==="txt"?"show":"hide")},i==="txt"&&I.a.createElement(y.b,c)),i==="audio"&&I.a.createElement("audio",{src:"".concat(m!=null&&m.startsWith("/")||(m==null?void 0:m.indexOf("https://"))>-1?m:"data:audio/mp3;base64,").concat(m),autoPlay:!0}),i==="video"&&I.a.createElement(I.a.Fragment,null,m!=null&&m.startsWith("/")?I.a.createElement("video",{controls:!0,src:"".concat(m),autoPlay:!0}):I.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(m),autoPlay:!0})),i==="html"&&I.a.createElement("iframe",{src:m+"&disposition=inline"}),i==="html"&&I.a.createElement("iframe",{src:m+"&disposition=inline"}),i==="pdf"&&I.a.createElement("embed",{className:L.a.embed,src:m}),i==="image"&&I.a.createElement(I.a.Fragment,null,I.a.createElement("img",{src:"".concat(m!=null&&m.startsWith("/")||(m==null?void 0:m.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(m)})),i==="other"&&I.a.createElement("div",null,I.a.createElement(B.a,{type:"primary",size:"large",onClick:U},I.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(i==="download"||i==="office")&&I.a.createElement(B.a,{type:"primary",size:"large",onClick:U},I.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ie,Ee,k){},pPuO:function(Ie,Ee,k){Ie.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},"qJ4+":function(Ie,Ee,k){},"rAM+":function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return B});var V=k("Qw5x");function B(D,F){var M;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(M=Object(V.a)(D))||F&&D&&typeof D.length=="number"){M&&(D=M);var _=0,N=function(){};return{s:N,n:function(){return _>=D.length?{done:!0}:{done:!1,value:D[_++]}},e:function(y){throw y},f:N}}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 I=!0,A=!1,L;return{s:function(){M=D[Symbol.iterator]()},n:function(){var y=M.next();return I=y.done,y},e:function(y){A=!0,L=y},f:function(){try{!I&&M.return!=null&&M.return()}finally{if(A)throw L}}}}},rUJ1:function(Ie,Ee){const k=/[&<>"']/,V=/[&<>"']/g,B=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,F={"&":"&","<":"<",">":">",'"':""","'":"'"},M=E=>F[E];function _(E,f){if(f){if(k.test(E))return E.replace(V,M)}else if(B.test(E))return E.replace(D,M);return E}const N=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(E){return E.replace(N,(f,d)=>(d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""))}const A=/(^|[^\[])\^/g;function L(E,f){E=E.source||E,f=f||"";const d={replace:(s,o)=>(o=o.source||o,o=o.replace(A,"$1"),E=E.replace(s,o),d),getRegex:()=>new RegExp(E,f)};return d}const v=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(E,f,d){if(E){let s;try{s=decodeURIComponent(I(d)).replace(v,"").toLowerCase()}catch(o){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}f&&!y.test(d)&&(d=i(f,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch(s){return null}return d}const S={},p=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(E,f){S[" "+E]||(p.test(E)?S[" "+E]=E+"/":S[" "+E]=x(E,"/",!0)),E=S[" "+E];const d=E.indexOf(":")===-1;return f.substring(0,2)==="//"?d?f:E.replace(m,"$1")+f:f.charAt(0)==="/"?d?f:E.replace(l,"$1")+f:E+f}const a={exec:function(){}};function c(E){let f=1,d,s;for(;f<arguments.length;f++){d=arguments[f];for(s in d)Object.prototype.hasOwnProperty.call(d,s)&&(E[s]=d[s])}return E}function C(E,f){const d=E.replace(/\|/g,(T,b,g)=>{let P=!1,j=b;for(;--j>=0&&g[j]==="\\";)P=!P;return P?"|":" |"}),s=d.split(/ \|/);let o=0;if(s.length>f)s.splice(f);else for(;s.length<f;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(/\\\|/g,"|");return s}function x(E,f,d){const s=E.length;if(s===0)return"";let o=0;for(;o<s;){const T=E.charAt(s-o-1);if(T===f&&!d)o++;else if(T!==f&&d)o++;else break}return E.substr(0,s-o)}function h(E,f){if(E.indexOf(f[1])===-1)return-1;const d=E.length;let s=0,o=0;for(;o<d;o++)if(E[o]==="\\")o++;else if(E[o]===f[0])s++;else if(E[o]===f[1]&&(s--,s<0))return o;return-1}function w(E){E&&E.sanitize&&!E.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")}Ie.exports={escape:_,unescape:I,edit:L,cleanUrl:O,resolveUrl:i,noopTest:a,merge:c,splitCells:C,rtrim:x,findClosingBracket:h,checkSanitizeDeprecation:w}},rdUC:function(Ie,Ee,k){var V=k("MFOe"),B=V.Global;Ie.exports={name:"localStorage",read:F,write:M,each:_,remove:N,clearAll:I};function D(){return B.localStorage}function F(A){return D().getItem(A)}function M(A,L){return D().setItem(A,L)}function _(A){for(var L=D().length-1;L>=0;L--){var v=D().key(L);A(F(v),v)}}function N(A){return D().removeItem(A)}function I(){return D().clear()}},sR1s:function(Ie,Ee,k){"use strict";k.d(Ee,"b",function(){return F}),k.d(Ee,"a",function(){return M}),k.d(Ee,"c",function(){return _}),k.d(Ee,"d",function(){return N});var V=k("U8pU"),B="RC_TABLE_KEY";function D(I){return I==null?[]:Array.isArray(I)?I:[I]}function F(I,A){if(!A&&typeof A!="number")return I;for(var L=D(A),v=I,y=0;y<L.length;y+=1){if(!v)return null;var O=L[y];v=v[O]}return v}function M(I){var A=[],L={};return I.forEach(function(v){for(var y=v||{},O=y.key,S=y.dataIndex,p=O||D(S).join("-")||B;L[p];)p="".concat(p,"_next");L[p]=!0,A.push(p)}),A}function _(){var I={};function A(O,S){S&&Object.keys(S).forEach(function(p){var m=S[p];m&&Object(V.a)(m)==="object"?(O[p]=O[p]||{},A(O[p],m)):O[p]=m})}for(var L=arguments.length,v=new Array(L),y=0;y<L;y++)v[y]=arguments[y];return v.forEach(function(O){A(I,O)}),I}function N(I){return I!=null}},sboe:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return D});var V=k("cDcd"),B=k.n(V),D=V.createContext(null)},"t/PP":function(Ie,Ee,k){Ie.exports=k.p+"static/title.dd3b799f.svg"},t23M:function(Ie,Ee,k){"use strict";var V=k("VTBJ"),B=k("1OyB"),D=k("vuIU"),F=k("Ji7U"),M=k("LK+K"),_=k("cDcd"),N=k.n(_),I=k("m+aA"),A=k("Zm9Q"),L=k("Kwbf"),v=k("c+Xe"),y=k("bdgK"),O="rc-observer-key",S=function(p){Object(F.a)(l,p);var m=Object(M.a)(l);function l(){var i;return Object(B.a)(this,l),i=m.apply(this,arguments),i.resizeObserver=null,i.childNode=null,i.currentElement=null,i.state={width:0,height:0,offsetHeight:0,offsetWidth:0},i.onResize=function(a){var c=i.props.onResize,C=a[0].target,x=C.getBoundingClientRect(),h=x.width,w=x.height,E=C.offsetWidth,f=C.offsetHeight,d=Math.floor(h),s=Math.floor(w);if(i.state.width!==d||i.state.height!==s||i.state.offsetWidth!==E||i.state.offsetHeight!==f){var o={width:d,height:s,offsetWidth:E,offsetHeight:f};i.setState(o),c&&Promise.resolve().then(function(){c(Object(V.a)(Object(V.a)({},o),{},{offsetWidth:E,offsetHeight:f}))})}},i.setChildNode=function(a){i.childNode=a},i}return Object(D.a)(l,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var a=this.props.disabled;if(a){this.destroyObserver();return}var c=Object(I.a)(this.childNode||this),C=c!==this.currentElement;C&&(this.destroyObserver(),this.currentElement=c),!this.resizeObserver&&c&&(this.resizeObserver=new y.default(this.onResize),this.resizeObserver.observe(c))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var a=this.props.children,c=Object(A.a)(a);if(c.length>1)Object(L.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(L.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var C=c[0];if(_.isValidElement(C)&&Object(v.c)(C)){var x=C.ref;c[0]=_.cloneElement(C,{ref:Object(v.a)(x,this.setChildNode)})}return c.length===1?c[0]:c.map(function(h,w){return!_.isValidElement(h)||"key"in h&&h.key!==null?h:_.cloneElement(h,{key:"".concat(O,"-").concat(w)})})}}]),l}(_.Component);S.displayName="ResizeObserver",Ee.a=S},uD2n:function(Ie,Ee,k){Ie.exports={"dis-input-editor-container":"dis-input-editor-container___3uf7A",active:"active___20tmT","input-mask":"input-mask___1kijM","text-area":"text-area___2gTEA","tip-container":"tip-container___2tKkE",hide:"hide___3jIwM","md-container":"md-container___14zRI","btn-send":"btn-send___3TabT"}},uMZB:function(Ie,Ee,k){Ie.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(Ie,Ee,k){Ie.exports=V;function V(){return k("gaXo"),{}}},ulZh:function(Ie,Ee,k){typeof window!="undefined"&&function(B,D){Ie.exports=D()}(this,function(){return function(V){var B={};function D(F){if(B[F])return B[F].exports;var M=B[F]={i:F,l:!1,exports:{}};return V[F].call(M.exports,M,M.exports,D),M.l=!0,M.exports}return D.m=V,D.c=B,D.d=function(F,M,_){D.o(F,M)||Object.defineProperty(F,M,{enumerable:!0,get:_})},D.r=function(F){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})},D.t=function(F,M){if(M&1&&(F=D(F)),M&8)return F;if(M&4&&typeof F=="object"&&F&&F.__esModule)return F;var _=Object.create(null);if(D.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:F}),M&2&&typeof F!="string")for(var N in F)D.d(_,N,function(I){return F[I]}.bind(null,N));return _},D.n=function(F){var M=F&&F.__esModule?function(){return F.default}:function(){return F};return D.d(M,"a",M),M},D.o=function(F,M){return Object.prototype.hasOwnProperty.call(F,M)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(V,B,D){"use strict";var F=Object.prototype.hasOwnProperty,M="~";function _(){}Object.create&&(_.prototype=Object.create(null),new _().__proto__||(M=!1));function N(v,y,O){this.fn=v,this.context=y,this.once=O||!1}function I(v,y,O,S,p){if(typeof O!="function")throw new TypeError("The listener must be a function");var m=new N(O,S||v,p),l=M?M+y:y;return v._events[l]?v._events[l].fn?v._events[l]=[v._events[l],m]:v._events[l].push(m):(v._events[l]=m,v._eventsCount++),v}function A(v,y){--v._eventsCount===0?v._events=new _:delete v._events[y]}function L(){this._events=new _,this._eventsCount=0}L.prototype.eventNames=function(){var y=[],O,S;if(this._eventsCount===0)return y;for(S in O=this._events)F.call(O,S)&&y.push(M?S.slice(1):S);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(O)):y},L.prototype.listeners=function(y){var O=M?M+y:y,S=this._events[O];if(!S)return[];if(S.fn)return[S.fn];for(var p=0,m=S.length,l=new Array(m);p<m;p++)l[p]=S[p].fn;return l},L.prototype.listenerCount=function(y){var O=M?M+y:y,S=this._events[O];return S?S.fn?1:S.length:0},L.prototype.emit=function(y,O,S,p,m,l){var i=M?M+y:y;if(!this._events[i])return!1;var a=this._events[i],c=arguments.length,C,x;if(a.fn){a.once&&this.removeListener(y,a.fn,void 0,!0);switch(c){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,O),!0;case 3:return a.fn.call(a.context,O,S),!0;case 4:return a.fn.call(a.context,O,S,p),!0;case 5:return a.fn.call(a.context,O,S,p,m),!0;case 6:return a.fn.call(a.context,O,S,p,m,l),!0}for(x=1,C=new Array(c-1);x<c;x++)C[x-1]=arguments[x];a.fn.apply(a.context,C)}else{var h=a.length,w;for(x=0;x<h;x++){a[x].once&&this.removeListener(y,a[x].fn,void 0,!0);switch(c){case 1:a[x].fn.call(a[x].context);break;case 2:a[x].fn.call(a[x].context,O);break;case 3:a[x].fn.call(a[x].context,O,S);break;case 4:a[x].fn.call(a[x].context,O,S,p);break;default:if(!C)for(w=1,C=new Array(c-1);w<c;w++)C[w-1]=arguments[w];a[x].fn.apply(a[x].context,C)}}}return!0},L.prototype.on=function(y,O,S){return I(this,y,O,S,!1)},L.prototype.once=function(y,O,S){return I(this,y,O,S,!0)},L.prototype.removeListener=function(y,O,S,p){var m=M?M+y:y;if(!this._events[m])return this;if(!O)return A(this,m),this;var l=this._events[m];if(l.fn)l.fn===O&&(!p||l.once)&&(!S||l.context===S)&&A(this,m);else{for(var i=0,a=[],c=l.length;i<c;i++)(l[i].fn!==O||p&&!l[i].once||S&&l[i].context!==S)&&a.push(l[i]);a.length?this._events[m]=a.length===1?a[0]:a:A(this,m)}return this},L.prototype.removeAllListeners=function(y){var O;return y?(O=M?M+y:y,this._events[O]&&A(this,O)):(this._events=new _,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=M,L.EventEmitter=L,V.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(V,B,D){(function(F){var M=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,_=/^([^\/?#]*)([^]*)$/,N=/(?:\/|^)\.(?=\/)/g,I=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,A={buildAbsoluteURL:function(L,v,y){if(y=y||{},L=L.trim(),v=v.trim(),!v){if(!y.alwaysNormalize)return L;var O=A.parseURL(L);if(!O)throw new Error("Error trying to parse base URL.");return O.path=A.normalizePath(O.path),A.buildURLFromParts(O)}var S=A.parseURL(v);if(!S)throw new Error("Error trying to parse relative URL.");if(S.scheme)return y.alwaysNormalize?(S.path=A.normalizePath(S.path),A.buildURLFromParts(S)):v;var p=A.parseURL(L);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var m=_.exec(p.path);p.netLoc=m[1],p.path=m[2]}p.netLoc&&!p.path&&(p.path="/");var l={scheme:p.scheme,netLoc:S.netLoc,path:null,params:S.params,query:S.query,fragment:S.fragment};if(!S.netLoc&&(l.netLoc=p.netLoc,S.path[0]!=="/"))if(!S.path)l.path=p.path,S.params||(l.params=p.params,S.query||(l.query=p.query));else{var i=p.path,a=i.substring(0,i.lastIndexOf("/")+1)+S.path;l.path=A.normalizePath(a)}return l.path===null&&(l.path=y.alwaysNormalize?A.normalizePath(S.path):S.path),A.buildURLFromParts(l)},parseURL:function(L){var v=M.exec(L);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(N,"");L.length!==(L=L.replace(I,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};V.exports=A})(this)},"./node_modules/webworkify-webpack/index.js":function(V,B,D){function F(y){var O={};function S(m){if(O[m])return O[m].exports;var l=O[m]={i:m,l:!1,exports:{}};return y[m].call(l.exports,l,l.exports,S),l.l=!0,l.exports}S.m=y,S.c=O,S.i=function(m){return m},S.d=function(m,l,i){S.o(m,l)||Object.defineProperty(m,l,{configurable:!1,enumerable:!0,get:i})},S.r=function(m){Object.defineProperty(m,"__esModule",{value:!0})},S.n=function(m){var l=m&&m.__esModule?function(){return m.default}:function(){return m};return S.d(l,"a",l),l},S.o=function(m,l){return Object.prototype.hasOwnProperty.call(m,l)},S.p="/",S.oe=function(m){throw console.error(m),m};var p=S(S.s=ENTRY_MODULE);return p.default||p}var M="[\\.|\\-|\\+|\\w|/|@]+",_="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+M+").*?\\)";function N(y){return(y+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function I(y){return!isNaN(1*y)}function A(y,O,S){var p={};p[S]=[];var m=O.toString(),l=m.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return p;for(var i=l[1],a=new RegExp("(\\\\n|\\W)"+N(i)+_,"g"),c;c=a.exec(m);){if(c[3]==="dll-reference")continue;p[S].push(c[3])}for(a=new RegExp("\\("+N(i)+'\\("(dll-reference\\s('+M+'))"\\)\\)'+_,"g");c=a.exec(m);)y[c[2]]||(p[S].push(c[1]),y[c[2]]=D(c[1]).m),p[c[2]]=p[c[2]]||[],p[c[2]].push(c[4]);for(var C=Object.keys(p),x=0;x<C.length;x++)for(var h=0;h<p[C[x]].length;h++)I(p[C[x]][h])&&(p[C[x]][h]=1*p[C[x]][h]);return p}function L(y){var O=Object.keys(y);return O.reduce(function(S,p){return S||y[p].length>0},!1)}function v(y,O){for(var S={main:[O]},p={main:[]},m={main:{}};L(S);)for(var l=Object.keys(S),i=0;i<l.length;i++){var a=l[i],c=S[a],C=c.pop();if(m[a]=m[a]||{},m[a][C]||!y[a][C])continue;m[a][C]=!0,p[a]=p[a]||[],p[a].push(C);for(var x=A(y,y[a][C],a),h=Object.keys(x),w=0;w<h.length;w++)S[h[w]]=S[h[w]]||[],S[h[w]]=S[h[w]].concat(x[h[w]])}return p}V.exports=function(y,O){O=O||{};var S={main:D.m},p=O.all?{main:Object.keys(S.main)}:v(S,y),m="";Object.keys(p).filter(function(C){return C!=="main"}).forEach(function(C){for(var x=0;p[C][x];)x++;p[C].push(x),S[C][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",m=m+"var "+C+" = ("+F.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+p[C].map(function(h){return""+JSON.stringify(h)+": "+S[C][h].toString()}).join(",")+`});
|
|
`}),m=m+"new (("+F.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+p.main.map(function(C){return""+JSON.stringify(C)+": "+S.main[C].toString()}).join(",")+"}))(self);";var l=new window.Blob([m],{type:"text/javascript"});if(O.bare)return l;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,a=i.createObjectURL(l),c=new window.Worker(a);return c.objectURL=a,c}},"./src/config.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"hlsDefaultConfig",function(){return w}),D.d(B,"mergeConfig",function(){return f}),D.d(B,"enableStreamingMode",function(){return d});var F=D("./src/controller/abr-controller.ts"),M=D("./src/controller/audio-stream-controller.ts"),_=D("./src/controller/audio-track-controller.ts"),N=D("./src/controller/subtitle-stream-controller.ts"),I=D("./src/controller/subtitle-track-controller.ts"),A=D("./src/controller/buffer-controller.ts"),L=D("./src/controller/timeline-controller.ts"),v=D("./src/controller/cap-level-controller.ts"),y=D("./src/controller/fps-controller.ts"),O=D("./src/controller/eme-controller.ts"),S=D("./src/controller/cmcd-controller.ts"),p=D("./src/utils/xhr-loader.ts"),m=D("./src/utils/fetch-loader.ts"),l=D("./src/utils/cues.ts"),i=D("./src/utils/mediakeys-helper.ts"),a=D("./src/utils/logger.ts");function c(){return c=Object.assign||function(s){for(var o=1;o<arguments.length;o++){var T=arguments[o];for(var b in T)Object.prototype.hasOwnProperty.call(T,b)&&(s[b]=T[b])}return s},c.apply(this,arguments)}function C(s,o){var T=Object.keys(s);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(s);o&&(b=b.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),T.push.apply(T,b)}return T}function x(s){for(var o=1;o<arguments.length;o++){var T=arguments[o]!=null?arguments[o]:{};o%2?C(Object(T),!0).forEach(function(b){h(s,b,T[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(T)):C(Object(T)).forEach(function(b){Object.defineProperty(s,b,Object.getOwnPropertyDescriptor(T,b))})}return s}function h(s,o,T){return o in s?Object.defineProperty(s,o,{value:T,enumerable:!0,configurable:!0,writable:!0}):s[o]=T,s}var w=x(x({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:F.default,bufferController:A.default,capLevelController:v.default,fpsController:y.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:N.SubtitleStreamController,subtitleTrackController:I.default,timelineController:L.TimelineController,audioStreamController:M.default,audioTrackController:_.default,emeController:O.default,cmcdController:S.default});function E(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function f(s,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return c({},s,o)}function d(s){var o=s.loader;if(o!==m.default&&o!==p.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var T=Object(m.fetchSupported)();T&&(s.loader=m.default,s.progressive=!0,s.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/polyfills/number.ts"),M=D("./src/utils/ewma-bandwidth-estimator.ts"),_=D("./src/events.ts"),N=D("./src/utils/buffer-helper.ts"),I=D("./src/errors.ts"),A=D("./src/types/loader.ts"),L=D("./src/utils/logger.ts");function v(S,p){for(var m=0;m<p.length;m++){var l=p[m];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(S,l.key,l)}}function y(S,p,m){return p&&v(S.prototype,p),m&&v(S,m),S}var O=function(){function S(m){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=m;var l=m.config;this.bwEstimator=new M.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var p=S.prototype;return p.registerListeners=function(){var l=this.hls;l.on(_.Events.FRAG_LOADING,this.onFragLoading,this),l.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(_.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(_.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var l=this.hls;l.off(_.Events.FRAG_LOADING,this.onFragLoading,this),l.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(_.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(_.Events.ERROR,this.onError,this)},p.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},p.onFragLoading=function(l,i){var a=i.frag;if(a.type===A.PlaylistLevelType.MAIN&&!this.timer){var c;this.fragCurrent=a,this.partCurrent=(c=i.part)!=null?c:null,this.timer=self.setInterval(this.onCheck,100)}},p.onLevelLoaded=function(l,i){var a=this.hls.config;i.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},p._abandonRulesCheck=function(){var l=this.fragCurrent,i=this.partCurrent,a=this.hls,c=a.autoLevelEnabled,C=a.config,x=a.media;if(!l||!x)return;var h=i?i.stats:l.stats,w=i?i.duration:l.duration;if(h.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!c||x.paused||!x.playbackRate||!x.readyState)return;var E=performance.now()-h.loading.start,f=Math.abs(x.playbackRate);if(E<=500*w/f)return;var d=a.levels,s=a.minAutoLevel,o=d[l.level],T=h.total||Math.max(h.loaded,Math.round(w*o.maxBitrate/8)),b=Math.max(1,h.bwEstimate?h.bwEstimate/8:h.loaded*1e3/E),g=(T-h.loaded)/b,P=x.currentTime,j=(N.BufferHelper.bufferInfo(x,P,C.maxBufferHole).end-P)/f;if(j>=2*w/f||g<=j)return;var H=Number.POSITIVE_INFINITY,X;for(X=l.level-1;X>s;X--){var W=d[X].maxBitrate;if(H=w*W/(8*.8*b),H<j)break}if(H>=g)return;var U=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+l.sn+(i?" part "+i.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+X+`
|
|
Current BW estimate: `+(Object(F.isFiniteNumber)(U)?(U/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+g.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+H.toFixed(3)+` s
|
|
Time to underbuffer: `+j.toFixed(3)+" s"),a.nextLoadLevel=X,this.bwEstimator.sample(E,h.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),a.trigger(_.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:i,stats:h})},p.onFragLoaded=function(l,i){var a=i.frag,c=i.part;if(a.type===A.PlaylistLevelType.MAIN&&Object(F.isFiniteNumber)(a.sn)){var C=c?c.stats:a.stats,x=c?c.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var h=this.hls.levels[a.level],w=(h.loaded?h.loaded.bytes:0)+C.loaded,E=(h.loaded?h.loaded.duration:0)+x;h.loaded={bytes:w,duration:E},h.realBitrate=Math.round(8*w/E)}if(a.bitrateTest){var f={stats:C,frag:a,part:c,id:a.type};this.onFragBuffered(_.Events.FRAG_BUFFERED,f),a.bitrateTest=!1}}},p.onFragBuffered=function(l,i){var a=i.frag,c=i.part,C=c?c.stats:a.stats;if(C.aborted)return;if(a.type!==A.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var x=C.parsing.end-C.loading.start;this.bwEstimator.sample(x,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},p.onError=function(l,i){switch(i.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},p.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},p.getNextABRAutoLevel=function(){var l=this.fragCurrent,i=this.partCurrent,a=this.hls,c=a.maxAutoLevel,C=a.config,x=a.minAutoLevel,h=a.media,w=i?i.duration:l?l.duration:0,E=h?h.currentTime:0,f=h&&h.playbackRate!==0?Math.abs(h.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,s=(N.BufferHelper.bufferInfo(h,E,C.maxBufferHole).end-E)/f,o=this.findBestLevel(d,x,c,s,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(o>=0)return o;L.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=w?Math.min(w,C.maxStarvationDelay):C.maxStarvationDelay,b=C.abrBandWidthFactor,g=C.abrBandWidthUpFactor;if(!s){var P=this.bitrateTestDelay;if(P){var j=w?Math.min(w,C.maxLoadingDelay):C.maxLoadingDelay;T=j-P,L.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),b=g=1}}return o=this.findBestLevel(d,x,c,s+T,b,g),Math.max(o,0)},p.findBestLevel=function(l,i,a,c,C,x){for(var h,w=this.fragCurrent,E=this.partCurrent,f=this.lastLoadedFragLevel,d=this.hls.levels,s=d[f],o=!!(s!=null&&(h=s.details)!==null&&h!==void 0&&h.live),T=s==null?void 0:s.codecSet,b=E?E.duration:w?w.duration:0,g=a;g>=i;g--){var P=d[g];if(!P||T&&P.codecSet!==T)continue;var j=P.details,H=(E?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||b,X=void 0;g<=f?X=C*l:X=x*l;var W=d[g].maxBitrate,U=W*H/X;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+g+"/"+Math.round(X)+"/"+W+"/"+H+"/"+c+"/"+U),X>W&&(!U||o&&!this.bitrateTestDelay||U<c))return g}return-1},y(S,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,i=this.bwEstimator;if(l!==-1&&(!i||!i.canEstimate()))return l;var a=this.getNextABRAutoLevel();return l!==-1&&(a=Math.min(l,a)),a},set:function(l){this._nextAutoLevel=l}}]),S}();B.default=O},"./src/controller/audio-stream-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/polyfills/number.ts"),M=D("./src/controller/base-stream-controller.ts"),_=D("./src/events.ts"),N=D("./src/utils/buffer-helper.ts"),I=D("./src/controller/fragment-tracker.ts"),A=D("./src/types/level.ts"),L=D("./src/types/loader.ts"),v=D("./src/loader/fragment.ts"),y=D("./src/demux/chunk-cache.ts"),O=D("./src/demux/transmuxer-interface.ts"),S=D("./src/types/transmuxer.ts"),p=D("./src/controller/fragment-finders.ts"),m=D("./src/utils/discontinuities.ts"),l=D("./src/errors.ts"),i=D("./src/utils/logger.ts");function a(){return a=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(w[d]=f[d])}return w},a.apply(this,arguments)}function c(w,E){w.prototype=Object.create(E.prototype),w.prototype.constructor=w,C(w,E)}function C(w,E){return C=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},C(w,E)}var x=100,h=function(w){c(E,w);function E(d,s){var o;return o=w.call(this,d,s,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var f=E.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var s=this.hls;s.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(_.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(_.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(_.Events.ERROR,this.onError,this),s.on(_.Events.BUFFER_RESET,this.onBufferReset,this),s.on(_.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(_.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(_.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var s=this.hls;s.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(_.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(_.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(_.Events.ERROR,this.onError,this),s.off(_.Events.BUFFER_RESET,this.onBufferReset,this),s.off(_.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(_.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(_.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(s,o){var T=o.frag,b=o.id,g=o.initPTS;if(b==="main"){var P=T.cc;this.initPTS[T.cc]=g,this.log("InitPTS for cc: "+P+" found from main: "+g),this.videoTrackCC=P,this.state===M.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=M.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,o>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=M.State.IDLE):(this.loadedmetadata=!1,this.state=M.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},f.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_TRACK:{var s,o=this.levels,T=this.trackId,b=o==null||((s=o[T])===null||s===void 0)?void 0:s.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=M.State.WAITING_INIT_PTS}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var g,P=performance.now(),j=this.retryDate;(!j||P>=j||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=M.State.IDLE);break}case M.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var X=H.frag,W=H.part,U=H.cache,z=H.complete;if(this.initPTS[X.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.FRAG_LOADING;var Z=U.flush(),q={frag:X,part:W,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(q),z&&w.prototype._handleFragmentLoadComplete.call(this,q)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+X.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var oe=this.getLoadPosition(),ye=N.BufferHelper.bufferInfo(this.mediaBuffer,oe,this.config.maxBufferHole),me=Object(p.fragmentWithinToleranceTest)(ye.end,this.config.maxFragLookUpTolerance,X);me<0&&(i.logger.log("Waiting fragment cc ("+X.cc+") @ "+X.start+" cancelled because another fragment at "+ye.end+" is needed"),this.clearWaitingFragment())}}else this.state=M.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.IDLE)},f.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:s,T=o.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},f.doTickIdle=function(){var s,o,T=this.hls,b=this.levels,g=this.media,P=this.trackId,j=T.config;if(!b||!b[P])return;if(!g&&(this.startFragRequested||!j.startFragPrefetch))return;var H=b[P],X=H.details;if(!X||X.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(X)){this.state=M.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(W===null)return;var U=W.len,z=this.getMaxBufferLength(),Z=this.audioSwitch;if(U>=z&&!Z)return;if(!Z&&this._streamEnded(W,X)){T.trigger(_.Events.BUFFER_EOS,{type:"audio"}),this.state=M.State.ENDED;return}var q=X.fragments,oe=q[0].start,ye=W.end;if(Z){var me=this.getLoadPosition();ye=me,X.PTSKnown&&me<oe&&((W.end>oe||W.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),g.currentTime=oe+.05))}var fe=this.getNextFragment(ye,X);if(!fe){this.bufferFlushed=!0;return}((s=fe.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((o=fe.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(fe,X):this.loadFragment(fe,X,ye)},f.getMaxBufferLength=function(){var s=w.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return o===null?s:Math.max(s,o.len)},f.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(s,o){var T=o.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(b){return new A.Level(b)})},f.onAudioTrackSwitching=function(s,o){var T=!!o.url;this.trackId=o.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(x):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=M.State.IDLE):this.state=M.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(s,o){this.mainDetails=o.details},f.onAudioTrackLoaded=function(s,o){var T,b=this.levels,g=o.details,P=o.id;if(!b){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+g.startSN+","+g.endSN+"],duration:"+g.totalduration);var j=b[P],H=0;if(g.live||(T=j.details)!==null&&T!==void 0&&T.live){var X=this.mainDetails;if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed||!X)return;!j.details&&g.hasProgramDateTime&&X.hasProgramDateTime?(Object(m.alignMediaPlaylistByPDT)(g,X),H=g.fragments[0].start):H=this.alignPlaylists(g,j.details)}j.details=g,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!g.live)&&this.setStartPosition(j.details,H),this.state===M.State.WAITING_TRACK&&!this.waitForCdnTuneIn(g)&&(this.state=M.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(s){var o,T=s.frag,b=s.part,g=s.payload,P=this.config,j=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var X=H[j];console.assert(X,"Audio track is defined on fragment load progress");var W=X.details;console.assert(W,"Audio track details are defined on fragment load progress");var U=P.defaultAudioCodec||X.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new O.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[T.cc],q=(o=T.initSegment)===null||o===void 0?void 0:o.data;if(Z!==void 0){var oe=!1,ye=b?b.index:-1,me=ye!==-1,fe=new S.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,g.byteLength,ye,me);z.push(g,q,U,"",T,b,W.totalduration,oe,fe,Z)}else{i.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+W.startSN+" ,"+W.endSN+"],track "+j);var ve=this.waitingData=this.waitingData||{frag:T,part:b,cache:new y.default,complete:!1},ge=ve.cache;ge.push(new Uint8Array(g)),this.waitingVideoCC=this.videoTrackCC,this.state=M.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,s)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(s,o){var T=o.tracks.audio;T&&(this.mediaBuffer=T.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},f.onFragBuffered=function(s,o){var T=o.frag,b=o.part;if(T.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(b?" p: "+b.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,b)},f.onError=function(s,o){switch(o.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,o);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==M.State.ERROR&&this.state!==M.State.STOPPED&&(this.state=o.fatal?M.State.ERROR:M.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var T=!0,b=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);b&&b.len>.5&&(T=!this.reduceMaxBufferLength(b.len)),T&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(s,o){var T=o.type;T===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(s){var o,T="audio",b=this.hls,g=s.remuxResult,P=s.chunkMeta,j=this.getCurrentContext(P);if(!j){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var H=j.frag,X=j.part,W=g.audio,U=g.text,z=g.id3,Z=g.initSegment;if(this.fragContextChanged(H))return;if(this.state=M.State.PARSING,this.audioSwitch&&W&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,H,P),b.trigger(_.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:T,tracks:Z.tracks})),W){var q=W.startPTS,oe=W.endPTS,ye=W.startDTS,me=W.endDTS;X&&(X.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:oe,startDTS:ye,endDTS:me}),H.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,q,oe,ye,me),this.bufferFragmentData(W,H,X,P)}if(z!=null&&(o=z.samples)!==null&&o!==void 0&&o.length){var fe=a({frag:H,id:T},z);b.trigger(_.Events.FRAG_PARSING_METADATA,fe)}if(U){var ve=a({frag:H,id:T},U);b.trigger(_.Events.FRAG_PARSING_USERDATA,ve)}},f._bufferInitSegment=function(s,o,T){if(this.state!==M.State.PARSING)return;s.video&&delete s.video;var b=s.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(_.Events.BUFFER_CODECS,s);var g=b.initSegment;if(g!=null&&g.byteLength){var P={type:"audio",frag:o,part:null,chunkMeta:T,parent:o.type,data:g};this.hls.trigger(_.Events.BUFFER_APPENDING,P)}this.tick()},f.loadFragment=function(s,o,T){var b=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||b===I.FragmentState.NOT_LOADED||b===I.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):o.live&&!Object(F.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=M.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,s,o,T)))},f.completeAudioSwitch=function(){var s=this.hls,o=this.media,T=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:T})},E}(M.default);B.default=h},"./src/controller/audio-track-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/events.ts"),M=D("./src/errors.ts"),_=D("./src/controller/base-playlist-controller.ts"),N=D("./src/types/loader.ts");function I(O,S){for(var p=0;p<S.length;p++){var m=S[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(O,m.key,m)}}function A(O,S,p){return S&&I(O.prototype,S),p&&I(O,p),O}function L(O,S){O.prototype=Object.create(S.prototype),O.prototype.constructor=O,v(O,S)}function v(O,S){return v=Object.setPrototypeOf||function(m,l){return m.__proto__=l,m},v(O,S)}var y=function(O){L(S,O);function S(m){var l;return l=O.call(this,m,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var p=S.prototype;return p.registerListeners=function(){var l=this.hls;l.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(F.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var l=this.hls;l.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(F.Events.ERROR,this.onError,this)},p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,O.prototype.destroy.call(this)},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},p.onManifestParsed=function(l,i){this.tracks=i.audioTracks||[]},p.onAudioTrackLoaded=function(l,i){var a=i.id,c=i.details,C=this.tracksInGroup[a];if(!C){this.warn("Invalid audio track id "+a);return}var x=C.details;C.details=i.details,this.log("audioTrack "+a+" loaded ["+c.startSN+"-"+c.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,i,x))},p.onLevelLoading=function(l,i){this.switchLevel(i.level)},p.onLevelSwitching=function(l,i){this.switchLevel(i.level)},p.switchLevel=function(l){var i=this.hls.levels[l];if(!(i!=null&&i.audioGroupIds))return;var a=i.audioGroupIds[i.urlId];if(this.groupId!==a){this.groupId=a;var c=this.tracks.filter(function(x){return!a||x.groupId===a});this.selectDefaultTrack&&!c.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=c;var C={audioTracks:c};this.log("Updating audio tracks, "+c.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(F.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}},p.onError=function(l,i){if(O.prototype.onError.call(this,l,i),i.fatal||!i.context)return;i.context.type===N.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},p.setAudioTrack=function(l){var i=this.tracksInGroup;if(l<0||l>=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=i[this.trackId];this.log("Now switching to audio-track index "+l);var c=i[l],C=c.id,x=c.groupId,h=x===void 0?"":x,w=c.name,E=c.type,f=c.url;if(this.trackId=l,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(F.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:h,name:w,type:E,url:f}),c.details&&!c.details.live)return;var d=this.switchParams(c.url,a==null?void 0:a.details);this.loadPlaylist(d)},p.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,a=this.findTrackId(i)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},p.findTrackId=function(l){for(var i=this.tracksInGroup,a=0;a<i.length;a++){var c=i[a];if((!this.selectDefaultTrack||c.default)&&(!l||l===c.name))return c.id}return-1},p.loadPlaylist=function(l){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var a=i.id,c=i.groupId,C=i.url;if(l)try{C=l.addDirectives(C)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(F.Events.AUDIO_TRACK_LOADING,{url:C,id:a,groupId:c,deliveryDirectives:l||null})}},A(S,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),S}(_.default);B.default=y},"./src/controller/base-playlist-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return A});var F=D("./src/polyfills/number.ts"),M=D("./src/types/level.ts"),_=D("./src/controller/level-helper.ts"),N=D("./src/utils/logger.ts"),I=D("./src/errors.ts"),A=function(){function L(y,O){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=N.logger.log.bind(N.logger,O+":"),this.warn=N.logger.warn.bind(N.logger,O+":"),this.hls=y}var v=L.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(O,S){S.fatal&&S.type===I.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(O,S){var p=S==null?void 0:S.renditionReports;if(p)for(var m=0;m<p.length;m++){var l=p[m],i=""+l.URI;if(i===O.substr(-i.length)){var a=parseInt(l["LAST-MSN"]),c=parseInt(l["LAST-PART"]);if(S&&this.hls.config.lowLatencyMode){var C=Math.min(S.age-S.partTarget,S.targetduration);c!==void 0&&C>S.partTarget&&(c+=1)}if(Object(F.isFiniteNumber)(a))return new M.HlsUrlParameters(a,Object(F.isFiniteNumber)(c)?c:void 0,M.HlsSkip.No)}}},v.loadPlaylist=function(O){},v.shouldLoadTrack=function(O){return this.canLoad&&O&&!!O.url&&(!O.details||O.details.live)},v.playlistLoaded=function(O,S,p){var m=this,l=S.details,i=S.stats,a=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(l.advancedDateTime=Date.now()-a,l.live||p!=null&&p.live){if(l.reloaded(p),p&&this.log("live playlist "+O+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),p&&l.fragments.length>0&&Object(_.mergeDetails)(p,l),!this.canLoad||!l.live)return;var c,C=void 0,x=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var h=this.hls.config.lowLatencyMode,w=l.lastPartSn,E=l.endSN,f=l.lastPartIndex,d=f!==-1,s=w===E,o=h?0:f;d?(C=s?E+1:w,x=s?o:f+1):C=E+1;var T=l.age,b=T+l.ageHeader,g=Math.min(b-l.partTarget,l.targetduration*1.5);if(g>0){if(p&&g>p.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+p.tuneInGoal+" to: "+g+" with playlist age: "+l.age),g=0;else{var P=Math.floor(g/l.targetduration);if(C+=P,x!==void 0){var j=Math.round(g%l.targetduration/l.partTarget);x+=j}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+g+" skip sn "+P+" to part "+x)}l.tuneInGoal=g}if(c=this.getDeliveryDirectives(l,S.deliveryDirectives,C,x),h||!s){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(l,S.deliveryDirectives,C,x);var H=Object(_.computeReloadInterval)(l,i);C!==void 0&&l.canBlockReload&&(H-=l.partTarget||1),this.log("reload live playlist "+O+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return m.loadPlaylist(c)},H)}else this.clearTimer()},v.getDeliveryDirectives=function(O,S,p,m){var l=Object(M.getSkipValue)(O,p);return S!=null&&S.skip&&O.deltaUpdateFailed&&(p=S.msn,m=S.part,l=M.HlsSkip.No),new M.HlsUrlParameters(p,m,l)},v.retryLoadingOrFail=function(O){var S=this,p=this.hls.config,m=this.retryCount<p.levelLoadingMaxRetry;if(m){var l;if(this.retryCount++,O.details.indexOf("LoadTimeOut")>-1&&(l=O.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+O.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*p.levelLoadingRetryDelay,p.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return S.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+O.details+'"')}}else this.warn('cannot recover from error "'+O.details+'"'),this.clearTimer(),O.fatal=!0;return m},L}()},"./src/controller/base-stream-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"State",function(){return E}),D.d(B,"default",function(){return f});var F=D("./src/polyfills/number.ts"),M=D("./src/task-loop.ts"),_=D("./src/controller/fragment-tracker.ts"),N=D("./src/utils/buffer-helper.ts"),I=D("./src/utils/logger.ts"),A=D("./src/events.ts"),L=D("./src/errors.ts"),v=D("./src/types/transmuxer.ts"),y=D("./src/utils/mp4-tools.ts"),O=D("./src/utils/discontinuities.ts"),S=D("./src/controller/fragment-finders.ts"),p=D("./src/controller/level-helper.ts"),m=D("./src/loader/fragment-loader.ts"),l=D("./src/crypt/decrypter.ts"),i=D("./src/utils/time-ranges.ts"),a=D("./src/types/loader.ts");function c(d,s){for(var o=0;o<s.length;o++){var T=s[o];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,T.key,T)}}function C(d,s,o){return s&&c(d.prototype,s),o&&c(d,o),d}function x(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function h(d,s){d.prototype=Object.create(s.prototype),d.prototype.constructor=d,w(d,s)}function w(d,s){return w=Object.setPrototypeOf||function(T,b){return T.__proto__=b,T},w(d,s)}var E={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",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},f=function(d){h(s,d);function s(T,b,g){var P;return P=d.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=E.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=g,P.log=I.logger.log.bind(I.logger,g+":"),P.warn=I.logger.warn.bind(I.logger,g+":"),P.hls=T,P.fragmentLoader=new m.default(T.config),P.fragmentTracker=b,P.config=T.config,P.decrypter=new l.default(T,T.config),T.on(A.Events.KEY_LOADED,P.onKeyLoaded,x(P)),P}var o=s.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(b){},o.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},o._streamEnded=function(b,g){var P=this.fragCurrent,j=this.fragmentTracker;if(!g.live&&P&&P.sn===g.endSN&&!b.nextStart){var H=j.getState(P);return H===_.FragmentState.PARTIAL||H===_.FragmentState.OK}return!1},o.onMediaAttached=function(b,g){var P=this.media=this.mediaBuffer=g.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(j.startPosition)},o.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var b=this.config,g=this.fragCurrent,P=this.media,j=this.mediaBuffer,H=this.state,X=P?P.currentTime:0,W=N.BufferHelper.bufferInfo(j||P,X,b.maxBufferHole);if(this.log("media seeking to "+(Object(F.isFiniteNumber)(X)?X.toFixed(3):X)+", state: "+H),H===E.ENDED)this.resetLoadingState();else if(g&&!W.len){var U=b.maxFragLookUpTolerance,z=g.start-U,Z=g.start+g.duration+U,q=X>Z;(X<z||q)&&(q&&g.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),g.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=X),!this.loadedmetadata&&!W.len&&(this.nextLoadPosition=this.startPosition=X),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(b,g){if(this.state!==E.KEY_LOADING||g.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var P=this.levels[g.frag.level].details;P&&this.loadFragment(g.frag,P,g.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),d.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=E.STOPPED,this.hls.off(A.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,d.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(b,g){this.log("Loading key for "+b.sn+" of ["+g.startSN+"-"+g.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=E.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(A.Events.KEY_LOADING,{frag:b})},o.loadFragment=function(b,g,P){this._loadFragForPlayback(b,g,P)},o._loadFragForPlayback=function(b,g,P){var j=this,H=function(W){if(j.fragContextChanged(b)){j.warn("Fragment "+b.sn+(W.part?" p: "+W.part.index:"")+" of level "+b.level+" was dropped during download."),j.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,j._handleFragmentLoadProgress(W)};this._doFragLoad(b,g,P,H).then(function(X){if(!X)return;j.fragLoadError=0;var W=j.state;if(j.fragContextChanged(b)){(W===E.FRAG_LOADING||W===E.BACKTRACKING||!j.fragCurrent&&W===E.PARSING)&&(j.fragmentTracker.removeFragment(b),j.state=E.IDLE);return}if("payload"in X&&(j.log("Loaded fragment "+b.sn+" of level "+b.level),j.hls.trigger(A.Events.FRAG_LOADED,X),j.state===E.BACKTRACKING)){j.fragmentTracker.backtrack(b,X),j.resetFragmentLoading(b);return}j._handleFragmentLoadComplete(X)}).catch(function(X){j.warn(X),j.resetFragmentLoading(b)})},o.flushMainBuffer=function(b,g,P){if(P===void 0&&(P=null),!(b-g))return;var j={startOffset:b,endOffset:g,type:P};this.fragLoadError=0,this.hls.trigger(A.Events.BUFFER_FLUSHING,j)},o._loadInitSegment=function(b){var g=this;this._doFragLoad(b).then(function(P){if(!P||g.fragContextChanged(b)||!g.levels)throw new Error("init load aborted");return P}).then(function(P){var j=g.hls,H=P.payload,X=b.decryptdata;if(H&&H.byteLength>0&&X&&X.key&&X.iv&&X.method==="AES-128"){var W=self.performance.now();return g.decrypter.webCryptoDecrypt(new Uint8Array(H),X.key.buffer,X.iv.buffer).then(function(U){var z=self.performance.now();return j.trigger(A.Events.FRAG_DECRYPTED,{frag:b,payload:U,stats:{tstart:W,tdecrypt:z}}),P.payload=U,P})}return P}).then(function(P){var j=g.fragCurrent,H=g.hls,X=g.levels;if(!X)throw new Error("init load aborted, missing levels");var W=X[b.level].details;console.assert(W,"Level details are defined when init segment is loaded");var U=b.stats;g.state=E.IDLE,g.fragLoadError=0,b.data=new Uint8Array(P.payload),U.parsing.start=U.buffering.start=self.performance.now(),U.parsing.end=U.buffering.end=self.performance.now(),P.frag===j&&H.trigger(A.Events.FRAG_BUFFERED,{stats:U,frag:j,part:null,id:b.type}),g.tick()}).catch(function(P){g.warn(P),g.resetFragmentLoading(b)})},o.fragContextChanged=function(b){var g=this.fragCurrent;return!b||!g||b.level!==g.level||b.sn!==g.sn||b.urlId!==g.urlId},o.fragBufferedComplete=function(b,g){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(g?" part: "+g.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+i.default.toString(N.BufferHelper.getBuffered(P))),this.state=E.IDLE,this.tick()},o._handleFragmentLoadComplete=function(b){var g=this.transmuxer;if(!g)return;var P=b.frag,j=b.part,H=b.partsLoaded,X=!H||H.length===0||H.some(function(U){return!U}),W=new v.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,j?j.index:-1,!X);g.flush(W)},o._handleFragmentLoadProgress=function(b){},o._doFragLoad=function(b,g,P,j){var H=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(b.start,P||0),this.config.lowLatencyMode&&g){var X=g.partList;if(X&&j){P>b.end&&g.fragmentHint&&(b=g.fragmentHint);var W=this.getNextPart(X,b,P);if(W>-1){var U=X[W];return this.log("Loading part sn: "+b.sn+" p: "+U.index+" cc: "+b.cc+" of playlist ["+g.startSN+"-"+g.endSN+"] parts [0-"+W+"-"+(X.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=U.start+U.duration,this.state=E.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:b,part:X[W],targetBufferTime:P}),this.doFragPartsLoad(b,X,W,j).catch(function(z){return H.handleFragLoadError(z)})}else if(!b.url||this.loadedEndOfParts(X,P))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(g?"of ["+g.startSN+"-"+g.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(P.toFixed(3))),Object(F.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=E.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:b,targetBufferTime:P}),this.fragmentLoader.load(b,j).catch(function(z){return H.handleFragLoadError(z)})},o.doFragPartsLoad=function(b,g,P,j){var H=this;return new Promise(function(X,W){var U=[],z=function Z(q){var oe=g[q];H.fragmentLoader.loadPart(b,oe,j).then(function(ye){U[oe.index]=ye;var me=ye.part;H.hls.trigger(A.Events.FRAG_LOADED,ye);var fe=g[q+1];if(fe&&fe.fragment===b)Z(q+1);else return X({frag:b,part:me,partsLoaded:U})}).catch(W)};z(P)})},o.handleFragLoadError=function(b){var g=b.data;return g&&g.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(g.frag,g.part):this.hls.trigger(A.Events.ERROR,g),null},o._handleTransmuxerFlush=function(b){var g=this.getCurrentContext(b);if(!g||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var P=g.frag,j=g.part,H=g.level,X=self.performance.now();P.stats.parsing.end=X,j&&(j.stats.parsing.end=X),this.updateLevelTiming(P,j,H,b.partial)},o.getCurrentContext=function(b){var g=this.levels,P=b.level,j=b.sn,H=b.part;if(!g||!g[P])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+P+". The current chunk will not be buffered."),null;var X=g[P],W=H>-1?Object(p.getPartWith)(X,j,H):null,U=W?W.fragment:Object(p.getFragmentWithSN)(X,j,this.fragCurrent);return U?{frag:U,part:W,level:X}:null},o.bufferFragmentData=function(b,g,P,j){if(!b||this.state!==E.PARSING)return;var H=b.data1,X=b.data2,W=H;if(H&&X&&(W=Object(y.appendUint8Array)(H,X)),!W||!W.length)return;var U={type:b.type,frag:g,part:P,chunkMeta:j,parent:g.type,data:W};this.hls.trigger(A.Events.BUFFER_APPENDING,U),b.dropped&&b.independent&&!P&&this.flushBufferGap(g)},o.flushBufferGap=function(b){var g=this.media;if(!g)return;if(!N.BufferHelper.isBuffered(g,g.currentTime)){this.flushMainBuffer(0,b.start);return}var P=g.currentTime,j=N.BufferHelper.bufferInfo(g,P,0),H=b.duration,X=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),W=Math.max(Math.min(b.start-X,j.end-X),P+X);b.start-W>X&&this.flushMainBuffer(W,b.start)},o.getFwdBufferInfo=function(b,g){var P=this.config,j=this.getLoadPosition();if(!Object(F.isFiniteNumber)(j))return null;var H=N.BufferHelper.bufferInfo(b,j,P.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var X=this.fragmentTracker.getBufferedFrag(j,g);if(X&&H.nextStart<X.end)return N.BufferHelper.bufferInfo(b,j,Math.max(H.nextStart,P.maxBufferHole))}return H},o.getMaxBufferLength=function(b){var g=this.config,P;return b?P=Math.max(8*g.maxBufferSize/b,g.maxBufferLength):P=g.maxBufferLength,Math.min(P,g.maxMaxBufferLength)},o.reduceMaxBufferLength=function(b){var g=this.config,P=b||g.maxBufferLength;return g.maxMaxBufferLength>=P?(g.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+g.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(b,g){var P,j,H=g.fragments,X=H.length;if(!X)return null;var W=this.config,U=H[0].start,z;if(g.live){var Z=W.initialLiveManifestSize;if(X<Z)return this.warn("Not enough fragments to start playback (have: "+X+", need: "+Z+")"),null;!g.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(g,H),this.startPosition=z?this.hls.liveSyncPosition||z.start:b)}else b<=U&&(z=H[0]);if(!z){var q=W.lowLatencyMode?g.partEnd:g.fragmentEnd;z=this.getFragmentAtPosition(b,q,g)}return(P=z)!==null&&P!==void 0&&P.initSegment&&!((j=z)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},o.getNextPart=function(b,g,P){for(var j=-1,H=!1,X=!0,W=0,U=b.length;W<U;W++){var z=b[W];if(X=X&&!z.independent,j>-1&&P<z.start)break;var Z=z.loaded;!Z&&(H||z.independent||X)&&z.fragment===g&&(j=W),H=Z}return j},o.loadedEndOfParts=function(b,g){var P=b[b.length-1];return P&&g>P.start&&P.loaded},o.getInitialLiveFragment=function(b,g){var P=this.fragPrevious,j=null;if(P){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),j=Object(S.findFragmentByPDT)(g,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var H=P.sn+1;if(H>=b.startSN&&H<=b.endSN){var X=g[H-b.startSN];P.cc===X.cc&&(j=X,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(S.findFragWithCC)(g,P.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var W=this.hls.liveSyncPosition;W!==null&&(j=this.getFragmentAtPosition(W,this.bitrateTest?b.fragmentEnd:b.edge,b))}return j},o.getFragmentAtPosition=function(b,g,P){var j=this.config,H=this.fragPrevious,X=P.fragments,W=P.endSN,U=P.fragmentHint,z=j.maxFragLookUpTolerance,Z=!!(j.lowLatencyMode&&P.partList&&U);Z&&U&&!this.bitrateTest&&(X=X.concat(U),W=U.sn);var q;if(b<g){var oe=b>g-z?0:z;q=Object(S.findFragmentByPTS)(H,X,b,oe)}else q=X[X.length-1];if(q){var ye=q.sn-P.startSN,me=H&&q.level===H.level,fe=X[ye+1],ve=this.fragmentTracker.getState(q);if(ve===_.FragmentState.BACKTRACKED){q=null;for(var ge=ye;X[ge]&&this.fragmentTracker.getState(X[ge])===_.FragmentState.BACKTRACKED;)H?q=X[ge--]:q=X[--ge];q||(q=fe)}else H&&q.sn===H.sn&&!Z&&(me&&(q.sn<W&&this.fragmentTracker.getState(fe)!==_.FragmentState.OK?(this.log("SN "+q.sn+" just loaded, load next one: "+fe.sn),q=fe):q=null))}return q},o.synchronizeToLiveEdge=function(b){var g=this.config,P=this.media;if(!P)return;var j=this.hls.liveSyncPosition,H=P.currentTime,X=b.fragments[0].start,W=b.edge,U=H>=X-g.maxFragLookUpTolerance&&H<=W;if(j!==null&&P.duration>j&&(H<j||!U)){var z=g.liveMaxLatencyDuration!==void 0?g.liveMaxLatencyDuration:g.liveMaxLatencyDurationCount*b.targetduration;(!U&&P.readyState<4||H<W-z)&&(this.loadedmetadata||(this.nextLoadPosition=j),P.readyState&&(this.warn("Playback: "+H.toFixed(3)+" is located too far from the end of live sliding playlist: "+W+", reset currentTime to : "+j.toFixed(3)),P.currentTime=j))}},o.alignPlaylists=function(b,g){var P=this.levels,j=this.levelLastLoaded,H=this.fragPrevious,X=j!==null?P[j]:null,W=b.fragments.length;if(!W)return this.warn("No fragments in live playlist"),0;var U=b.fragments[0].start,z=!g,Z=b.alignedSliding&&Object(F.isFiniteNumber)(U);if(z||!Z&&!U){Object(O.alignStream)(H,X,b);var q=b.fragments[0].start;return this.log("Live playlist sliding: "+q.toFixed(2)+" start-sn: "+(g?g.startSN:"na")+"->"+b.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+W),q}return U},o.waitForCdnTuneIn=function(b){var g=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*g)},o.setStartPosition=function(b,g){var P=this.startPosition;if(P<g&&(P=-1),P===-1||this.lastCurrentTime===-1){var j=b.startTimeOffset;Object(F.isFiniteNumber)(j)?(P=g+j,j<0&&(P+=b.totalduration),P=Math.min(Math.max(g,P),g+b.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+P),this.startPosition=P):b.live?P=this.hls.liveSyncPosition||g:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},o.getLoadPosition=function(){var b=this.media,g=0;return this.loadedmetadata&&b?g=b.currentTime:this.nextLoadPosition&&(g=this.nextLoadPosition),g},o.handleFragLoadAborted=function(b,g){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(g?" part"+g.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},o.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=E.IDLE)},o.onFragmentOrKeyLoadError=function(b,g){if(g.fatal)return;var P=g.frag;if(!P||P.type!==b)return;var j=this.fragCurrent;console.assert(j&&P.sn===j.sn&&P.level===j.level&&P.urlId===j.urlId,"Frag load error must match current frag to retry");var H=this.config;if(this.fragLoadError+1<=H.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var X=Math.min(Math.pow(2,this.fragLoadError)*H.fragLoadingRetryDelay,H.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+b+" "+P.level+" failed to load, retrying in "+X+"ms"),this.retryDate=self.performance.now()+X,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else g.levelRetry?(b===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(I.logger.error(g.details+" reaches max retry, redispatch as fatal ..."),g.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},o.afterBufferFlushed=function(b,g,P){if(!b)return;var j=N.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(g,j,P),this.state===E.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},o.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var g=this.levels?this.levels[b].details:null;if(g!=null&&g.live)return this.startPosition=-1,this.setStartPosition(g,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(b,g,P,j){var H=this,X=P.details;console.assert(!!X,"level.details must be defined");var W=Object.keys(b.elementaryStreams).reduce(function(U,z){var Z=b.elementaryStreams[z];if(Z){var q=Z.endPTS-Z.startPTS;if(q<=0)return H.warn("Could not parse fragment "+b.sn+" "+z+" duration reliably ("+q+") resetting transmuxer to fallback to playlist timing"),H.resetTransmuxer(),U||!1;var oe=j?0:Object(p.updateFragPTSDTS)(X,b,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return H.hls.trigger(A.Events.LEVEL_PTS_UPDATED,{details:X,level:P,drift:oe,type:z,frag:b,start:Z.startPTS,end:Z.endPTS}),!0}return U},!1);W?(this.state=E.PARSED,this.hls.trigger(A.Events.FRAG_PARSED,{frag:b,part:g})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C(s,[{key:"state",get:function(){return this._state},set:function(b){var g=this._state;g!==b&&(this._state=b,this.log(g+"->"+b))}}]),s}(M.default)},"./src/controller/buffer-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return S});var F=D("./src/polyfills/number.ts"),M=D("./src/events.ts"),_=D("./src/utils/logger.ts"),N=D("./src/errors.ts"),I=D("./src/utils/buffer-helper.ts"),A=D("./src/utils/mediasource-helper.ts"),L=D("./src/loader/fragment.ts"),v=D("./src/controller/buffer-operation-queue.ts"),y=Object(A.getMediaSource)(),O=/([ha]vc.)(?:\.[^.,]+)+/,S=function(){function p(l){var i=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var a=i.hls,c=i.media,C=i.mediaSource;_.logger.log("[buffer-controller]: Media source opened"),c&&(i.updateMediaElementDuration(),a.trigger(M.Events.MEDIA_ATTACHED,{media:c})),C&&C.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){_.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){_.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var m=p.prototype;return m.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},m.destroy=function(){this.unregisterListeners(),this.details=null},m.registerListeners=function(){var i=this.hls;i.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(M.Events.BUFFER_RESET,this.onBufferReset,this),i.on(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(M.Events.BUFFER_EOS,this.onBufferEos,this),i.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(M.Events.FRAG_PARSED,this.onFragParsed,this),i.on(M.Events.FRAG_CHANGED,this.onFragChanged,this)},m.unregisterListeners=function(){var i=this.hls;i.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(M.Events.BUFFER_RESET,this.onBufferReset,this),i.off(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(M.Events.BUFFER_EOS,this.onBufferEos,this),i.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(M.Events.FRAG_PARSED,this.onFragParsed,this),i.off(M.Events.FRAG_CHANGED,this.onFragChanged,this)},m._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},m.onManifestParsed=function(i,a){var c=2;(a.audio&&!a.video||!a.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,_.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},m.onMediaAttaching=function(i,a){var c=this.media=a.media;if(c&&y){var C=this.mediaSource=new y;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(C),this._objectUrl=c.src}},m.onMediaDetaching=function(){var i=this.media,a=this.mediaSource,c=this._objectUrl;if(a){if(_.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(C){_.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(c&&self.URL.revokeObjectURL(c),i.src===c?(i.removeAttribute("src"),i.load()):_.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(M.Events.MEDIA_DETACHED,void 0)},m.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(a){var c=i.sourceBuffer[a];try{c&&(i.removeBufferListeners(a),i.mediaSource&&i.mediaSource.removeSourceBuffer(c),i.sourceBuffer[a]=void 0)}catch(C){_.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",C)}}),this._initSourceBuffer()},m.onBufferCodecs=function(i,a){var c=this,C=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(x){if(C){var h=c.tracks[x];if(h&&typeof h.buffer.changeType=="function"){var w=a[x],E=w.codec,f=w.levelCodec,d=w.container,s=(h.levelCodec||h.codec).replace(O,"$1"),o=(f||E).replace(O,"$1");if(s!==o){var T=d+";codecs="+(f||E);c.appendChangeType(x,T)}}}else c.pendingTracks[x]=a[x]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},m.appendChangeType=function(i,a){var c=this,C=this.operationQueue,x={execute:function(){var w=c.sourceBuffer[i];w&&(_.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+a),w.changeType(a)),C.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(w){_.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",w)}};C.append(x,i)},m.onBufferAppending=function(i,a){var c=this,C=this.hls,x=this.operationQueue,h=this.tracks,w=a.data,E=a.type,f=a.frag,d=a.part,s=a.chunkMeta,o=s.buffering[E],T=self.performance.now();o.start=T;var b=f.stats.buffering,g=d?d.stats.buffering:null;b.start===0&&(b.start=T),g&&g.start===0&&(g.start=T);var P=h.audio,j=E==="audio"&&s.id===1&&(P==null?void 0:P.container)==="audio/mpeg",H={execute:function(){if(o.executeStart=self.performance.now(),j){var W=c.sourceBuffer[E];if(W){var U=f.start-W.timestampOffset;Math.abs(U)>=.1&&(_.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+U+") sn: "+f.sn+")"),W.timestampOffset=f.start)}}c.appendExecutor(w,E)},onStart:function(){},onComplete:function(){var W=self.performance.now();o.executeEnd=o.end=W,b.first===0&&(b.first=W),g&&g.first===0&&(g.first=W);var U=c.sourceBuffer,z={};for(var Z in U)z[Z]=I.BufferHelper.getBuffered(U[Z]);c.appendError=0,c.hls.trigger(M.Events.BUFFER_APPENDED,{type:E,frag:f,part:d,chunkMeta:s,parent:f.type,timeRanges:z})},onError:function(W){_.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",W);var U={type:N.ErrorTypes.MEDIA_ERROR,parent:f.type,details:N.ErrorDetails.BUFFER_APPEND_ERROR,err:W,fatal:!1};W.code===DOMException.QUOTA_EXCEEDED_ERR?U.details=N.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,U.details=N.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>C.config.appendErrorMaxRetry&&(_.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),U.fatal=!0)),C.trigger(M.Events.ERROR,U)}};x.append(H,E)},m.onBufferFlushing=function(i,a){var c=this,C=this.operationQueue,x=function(w){return{execute:c.removeExecutor.bind(c,w,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(M.Events.BUFFER_FLUSHED,{type:w})},onError:function(f){_.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",f)}}};a.type?C.append(x(a.type),a.type):this.getSourceBufferTypes().forEach(function(h){C.append(x(h),h)})},m.onFragParsed=function(i,a){var c=this,C=a.frag,x=a.part,h=[],w=x?x.elementaryStreams:C.elementaryStreams;w[L.ElementaryStreamTypes.AUDIOVIDEO]?h.push("audiovideo"):(w[L.ElementaryStreamTypes.AUDIO]&&h.push("audio"),w[L.ElementaryStreamTypes.VIDEO]&&h.push("video"));var E=function(){var d=self.performance.now();C.stats.buffering.end=d,x&&(x.stats.buffering.end=d);var s=x?x.stats:C.stats;c.hls.trigger(M.Events.FRAG_BUFFERED,{frag:C,part:x,stats:s,id:C.type})};h.length===0&&_.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(E,h)},m.onFragChanged=function(i,a){this.flushBackBuffer()},m.onBufferEos=function(i,a){var c=this,C=this.getSourceBufferTypes().reduce(function(x,h){var w=c.sourceBuffer[h];return(!a.type||a.type===h)&&(w&&!w.ended&&(w.ended=!0,_.logger.log("[buffer-controller]: "+h+" sourceBuffer now EOS"))),x&&!!(!w||w.ended)},!0);C&&this.blockBuffers(function(){var x=c.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},m.onLevelUpdated=function(i,a){var c=a.details;if(!c.fragments.length)return;this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},m.flushBackBuffer=function(){var i=this.hls,a=this.details,c=this.media,C=this.sourceBuffer;if(!c||a===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var h=a.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(F.isFiniteNumber)(h)||h<0)return;var w=c.currentTime,E=a.levelTargetDuration,f=Math.max(h,E),d=Math.floor(w/E)*E-f;x.forEach(function(s){var o=C[s];if(o){var T=I.BufferHelper.getBuffered(o);T.length>0&&d>T.start(0)&&(i.trigger(M.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),a.live&&i.trigger(M.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),i.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:s}))}})},m.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,a=this.hls,c=this.media,C=this.mediaSource,x=i.fragments[0].start+i.totalduration,h=c.duration,w=Object(F.isFiniteNumber)(C.duration)?C.duration:0;i.live&&a.config.liveDurationInfinity?(_.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(i)):(x>w&&x>h||!Object(F.isFiniteNumber)(h))&&(_.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),C.duration=x)},m.updateSeekableRange=function(i){var a=this.mediaSource,c=i.fragments,C=c.length;if(C&&i.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var x=Math.max(0,c[0].start),h=Math.max(x,x+i.totalduration);a.setLiveSeekableRange(x,h)}},m.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,a=this.operationQueue,c=this.pendingTracks,C=Object.keys(c).length;if(C&&!i||C===2){this.createSourceBuffers(c),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(h){a.executeNext(h)})}},m.createSourceBuffers=function(i){var a=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var x in i)if(!a[x]){var h=i[x];if(!h)throw Error("source buffer exists for track "+x+", however track does not");var w=h.levelCodec||h.codec,E=h.container+";codecs="+w;_.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var f=a[x]=c.addSourceBuffer(E),d=x;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[x]={buffer:f,codec:w,container:h.container,levelCodec:h.levelCodec,id:h.id},C++}catch(s){_.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:E})}}C&&this.hls.trigger(M.Events.BUFFER_CREATED,{tracks:this.tracks})},m._onSBUpdateStart=function(i){var a=this.operationQueue,c=a.current(i);c.onStart()},m._onSBUpdateEnd=function(i){var a=this.operationQueue,c=a.current(i);c.onComplete(),a.shiftAndExecuteNext(i)},m._onSBUpdateError=function(i,a){_.logger.error("[buffer-controller]: "+i+" SourceBuffer error",a),this.hls.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(i);c&&c.onError(a)},m.removeExecutor=function(i,a,c){var C=this.media,x=this.mediaSource,h=this.operationQueue,w=this.sourceBuffer,E=w[i];if(!C||!x||!E){_.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(i);return}var f=Object(F.isFiniteNumber)(C.duration)?C.duration:Infinity,d=Object(F.isFiniteNumber)(x.duration)?x.duration:Infinity,s=Math.max(0,a),o=Math.min(c,f,d);o>s?(_.logger.log("[buffer-controller]: Removing ["+s+","+o+"] from the "+i+" SourceBuffer"),console.assert(!E.updating,i+" sourceBuffer must not be updating"),E.remove(s,o)):h.shiftAndExecuteNext(i)},m.appendExecutor=function(i,a){var c=this.operationQueue,C=this.sourceBuffer,x=C[a];if(!x){_.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(a);return}x.ended=!1,console.assert(!x.updating,a+" sourceBuffer must not be updating"),x.appendBuffer(i)},m.blockBuffers=function(i,a){var c=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){_.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var C=this.operationQueue,x=a.map(function(h){return C.appendBlocker(h)});Promise.all(x).then(function(){i(),a.forEach(function(h){var w=c.sourceBuffer[h];(!w||!w.updating)&&C.shiftAndExecuteNext(h)})})},m.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},m.addBufferListener=function(i,a,c){var C=this.sourceBuffer[i];if(!C)return;var x=c.bind(this,i);this.listeners[i].push({event:a,listener:x}),C.addEventListener(a,x)},m.removeBufferListeners=function(i){var a=this.sourceBuffer[i];if(!a)return;this.listeners[i].forEach(function(c){a.removeEventListener(c.event,c.listener)})},p}()},"./src/controller/buffer-operation-queue.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return M});var F=D("./src/utils/logger.ts"),M=function(){function _(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var N=_.prototype;return N.append=function(A,L){var v=this.queues[L];v.push(A),v.length===1&&this.buffers[L]&&this.executeNext(L)},N.insertAbort=function(A,L){var v=this.queues[L];v.unshift(A),this.executeNext(L)},N.appendBlocker=function(A){var L,v=new Promise(function(O){L=O}),y={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(y,A),v},N.executeNext=function(A){var L=this.buffers,v=this.queues,y=L[A],O=v[A];if(O.length){var S=O[0];try{S.execute()}catch(p){F.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),S.onError(p),(!y||!y.updating)&&(O.shift(),this.executeNext(A))}}},N.shiftAndExecuteNext=function(A){this.queues[A].shift(),this.executeNext(A)},N.current=function(A){return this.queues[A][0]},_}()},"./src/controller/cap-level-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/events.ts");function M(I,A){for(var L=0;L<A.length;L++){var v=A[L];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(I,v.key,v)}}function _(I,A,L){return A&&M(I.prototype,A),L&&M(I,L),I}var N=function(){function I(L){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var A=I.prototype;return A.setStreamController=function(v){this.streamController=v},A.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},A.registerListeners=function(){var v=this.hls;v.on(F.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},A.unregisterListener=function(){var v=this.hls;v.off(F.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},A.onFpsDropLevelCapping=function(v,y){I.isLevelAllowed(y.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(y.droppedLevel)},A.onMediaAttaching=function(v,y){this.media=y.media instanceof HTMLVideoElement?y.media:null},A.onManifestParsed=function(v,y){var O=this.hls;this.restrictedLevels=[],this.firstLevel=y.firstLevel,O.config.capLevelToPlayerSize&&y.video&&this.startCapping()},A.onBufferCodecs=function(v,y){var O=this.hls;O.config.capLevelToPlayerSize&&y.video&&this.startCapping()},A.onMediaDetaching=function(){this.stopCapping()},A.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var y=this.hls;y.autoLevelCapping=this.getMaxLevel(v.length-1),y.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=y.autoLevelCapping}}},A.getMaxLevel=function(v){var y=this,O=this.hls.levels;if(!O.length)return-1;var S=O.filter(function(p,m){return I.isLevelAllowed(m,y.restrictedLevels)&&m<=v});return this.clientRect=null,I.getMaxLevelByMediaSize(S,this.mediaWidth,this.mediaHeight)},A.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},A.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},A.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,y={width:0,height:0};if(v){var O=v.getBoundingClientRect();y.width=O.width,y.height=O.height,!y.width&&!y.height&&(y.width=O.right-O.left||v.width||0,y.height=O.bottom-O.top||v.height||0)}return this.clientRect=y,y},I.isLevelAllowed=function(v,y){return y===void 0&&(y=[]),y.indexOf(v)===-1},I.getMaxLevelByMediaSize=function(v,y,O){if(!v||!v.length)return-1;for(var S=function(a,c){return c?a.width!==c.width||a.height!==c.height:!0},p=v.length-1,m=0;m<v.length;m+=1){var l=v[m];if((l.width>=y||l.height>=O)&&S(l,v[m+1])){p=m;break}}return p},_(I,[{key:"mediaWidth",get:function(){return this.getDimensions().width*I.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*I.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(y){}return v}}]),I}();B.default=N},"./src/controller/cmcd-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return S});var F=D("./src/events.ts"),M=D("./src/types/cmcd.ts"),_=D("./src/utils/buffer-helper.ts"),N=D("./src/utils/logger.ts");function I(p,m){for(var l=0;l<m.length;l++){var i=m[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}function A(p,m,l){return m&&I(p.prototype,m),l&&I(p,l),p}function L(p,m){var l=typeof Symbol!="undefined"&&p[Symbol.iterator]||p["@@iterator"];if(l)return(l=l.call(p)).next.bind(l);if(Array.isArray(p)||(l=v(p))||m&&p&&typeof p.length=="number"){l&&(p=l);var i=0;return function(){return i>=p.length?{done:!0}:{done:!1,value:p[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(p,m){if(!p)return;if(typeof p=="string")return y(p,m);var l=Object.prototype.toString.call(p).slice(8,-1);if(l==="Object"&&p.constructor&&(l=p.constructor.name),l==="Map"||l==="Set")return Array.from(p);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return y(p,m)}function y(p,m){(m==null||m>p.length)&&(m=p.length);for(var l=0,i=new Array(m);l<m;l++)i[l]=p[l];return i}function O(){return O=Object.assign||function(p){for(var m=1;m<arguments.length;m++){var l=arguments[m];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(p[i]=l[i])}return p},O.apply(this,arguments)}var S=function(){function p(l){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(C){try{i.apply(C,{ot:M.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(x){N.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(C){try{var x=C.frag,h=i.hls.levels[x.level],w=i.getObjectType(x),E={d:x.duration*1e3,ot:w};(w===M.CMCDObjectType.VIDEO||w===M.CMCDObjectType.AUDIO||w==M.CMCDObjectType.MUXED)&&(E.br=h.bitrate/1e3,E.tb=i.getTopBandwidth(w),E.bl=i.getBufferLength(w)),i.apply(C,E)}catch(f){N.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=l;var a=this.config=l.config,c=a.cmcd;c!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=c.sessionId||p.uuid(),this.cid=c.contentId,this.useHeaders=c.useHeaders===!0,this.registerListeners())}var m=p.prototype;return m.registerListeners=function(){var i=this.hls;i.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this)},m.unregisterListeners=function(){var i=this.hls;i.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},m.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},m.onMediaAttached=function(i,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},m.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},m.onBufferCreated=function(i,a){var c,C;this.audioBuffer=(c=a.tracks.audio)===null||c===void 0?void 0:c.buffer,this.videoBuffer=(C=a.tracks.video)===null||C===void 0?void 0:C.buffer},m.createData=function(){var i;return{v:M.CMCDVersion,sf:M.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(i=this.media)===null||i===void 0?void 0:i.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},m.apply=function(i,a){a===void 0&&(a={}),O(a,this.createData());var c=a.ot===M.CMCDObjectType.INIT||a.ot===M.CMCDObjectType.VIDEO||a.ot===M.CMCDObjectType.MUXED;if(this.starved&&c&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var C=p.toHeaders(a);if(!Object.keys(C).length)return;i.headers||(i.headers={}),O(i.headers,C)}else{var x=p.toQuery(a);if(!x)return;i.url=p.appendQueryToUri(i.url,x)}},m.getObjectType=function(i){var a=i.type;return a==="subtitle"?M.CMCDObjectType.TIMED_TEXT:i.sn==="initSegment"?M.CMCDObjectType.INIT:a==="audio"?M.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?M.CMCDObjectType.VIDEO:M.CMCDObjectType.MUXED:void 0},m.getTopBandwidth=function(i){for(var a=0,c=i===M.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,C=L(c),x;!(x=C()).done;){var h=x.value;h.bitrate>a&&(a=h.bitrate)}return a>0?a:NaN},m.getBufferLength=function(i){var a=this.hls.media,c=i===M.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!a)return NaN;var C=_.BufferHelper.bufferInfo(c,a.currentTime,this.config.maxBufferHole);return C.len*1e3},m.createPlaylistLoader=function(){var i=this.config.pLoader,a=this.applyPlaylistData,c=i||this.config.loader;return function(){function C(h){this.loader=void 0,this.loader=new c(h)}var x=C.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(w,E,f){a(w),this.loader.load(w,E,f)},A(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},m.createFragmentLoader=function(){var i=this.config.fLoader,a=this.applyFragmentData,c=i||this.config.loader;return function(){function C(h){this.loader=void 0,this.loader=new c(h)}var x=C.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(w,E,f){a(w),this.loader.load(w,E,f)},A(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},p.uuid=function(){var i=URL.createObjectURL(new Blob),a=i.toString();return URL.revokeObjectURL(i),a.substr(a.lastIndexOf("/")+1)},p.serialize=function(i){for(var a=[],c=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},C=function(j){return Math.round(j)},x=function(j){return C(j/100)*100},h=function(j){return encodeURIComponent(j)},w={br:C,d:C,bl:x,dl:x,mtp:x,nor:h,rtp:x,tb:C},E=Object.keys(i||{}).sort(),f=L(E),d;!(d=f()).done;){var s=d.value,o=i[s];if(!c(o))continue;if(s==="v"&&o===1)continue;if(s=="pr"&&o===1)continue;var T=w[s];T&&(o=T(o));var b=typeof o,g=void 0;s==="ot"||s==="sf"||s==="st"?g=s+"="+o:b==="boolean"?g=s:b==="number"?g=s+"="+o:g=s+"="+JSON.stringify(o),a.push(g)}return a.join(",")},p.toHeaders=function(i){for(var a=Object.keys(i),c={},C=["Object","Request","Session","Status"],x=[{},{},{},{}],h={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},w=0,E=a;w<E.length;w++){var f=E[w],d=h[f]!=null?h[f]:1;x[d][f]=i[f]}for(var s=0;s<x.length;s++){var o=p.serialize(x[s]);o&&(c["CMCD-"+C[s]]=o)}return c},p.toQuery=function(i){return"CMCD="+encodeURIComponent(p.serialize(i))},p.appendQueryToUri=function(i,a){if(!a)return i;var c=i.includes("?")?"&":"?";return""+i+c+a},p}()},"./src/controller/eme-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/events.ts"),M=D("./src/errors.ts"),_=D("./src/utils/logger.ts"),N=D("./src/utils/mediakeys-helper.ts");function I(S,p){for(var m=0;m<p.length;m++){var l=p[m];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(S,l.key,l)}}function A(S,p,m){return p&&I(S.prototype,p),m&&I(S,m),S}var L=3,v=function(p,m,l){var i={audioCapabilities:[],videoCapabilities:[]};return p.forEach(function(a){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:l.audioRobustness||""})}),m.forEach(function(a){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:l.videoRobustness||""})}),[i]},y=function(p,m,l,i){switch(p){case N.KeySystems.WIDEVINE:return v(m,l,i);default:throw new Error("Unknown key-system: "+p)}},O=function(){function S(m){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=m,this._config=m.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var p=S.prototype;return p.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},p._registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this)},p._unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this)},p.getLicenseServerUrl=function(l){switch(l){case N.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},p._attemptKeySystemAccess=function(l,i,a){var c=this,C=y(l,i,a,this._drmSystemOptions);_.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(l,C);this.mediaKeysPromise=x.then(function(h){return c._onMediaKeySystemAccessObtained(l,h)}),x.catch(function(h){_.logger.error('Failed to obtain key-system "'+l+'" access:',h)})},p._onMediaKeySystemAccessObtained=function(l,i){var a=this;_.logger.log('Access for key-system "'+l+'" obtained');var c={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:i,mediaKeySystemDomain:l};this._mediaKeysList.push(c);var C=Promise.resolve().then(function(){return i.createMediaKeys()}).then(function(x){return c.mediaKeys=x,_.logger.log('Media-keys created for key-system "'+l+'"'),a._onMediaKeysCreated(),x});return C.catch(function(x){_.logger.error("Failed to create media-keys:",x)}),C},p._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(i){i.mediaKeysSession||(i.mediaKeysSession=i.mediaKeys.createSession(),l._onNewMediaKeySession(i.mediaKeysSession))})},p._onNewMediaKeySession=function(l){var i=this;_.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(a){i._onKeySessionMessage(l,a.message)},!1)},p._onKeySessionMessage=function(l,i){_.logger.log("Got EME message event, creating license request"),this._requestLicense(i,function(a){_.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),l.update(a)})},p.onMediaEncrypted=function(l){var i=this;if(_.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){_.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(C){if(!i._media)return;i._attemptSetMediaKeys(C),i._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(a).catch(a)},p._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var i=this._mediaKeysList[0];if(!i||!i.mediaKeys){_.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}_.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(i.mediaKeys),this._hasSetMediaKeys=!0}},p._generateRequestWithPreferredKeySession=function(l,i){var a=this,c=this._mediaKeysList[0];if(!c){_.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(c.mediaKeysSessionInitialized){_.logger.warn("Key-Session already initialized but requested again");return}var C=c.mediaKeysSession;if(!C){_.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!i){_.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}_.logger.log('Generating key-session request for "'+l+'" init data type'),c.mediaKeysSessionInitialized=!0,C.generateRequest(l,i).then(function(){_.logger.debug("Key-session generation succeeded")}).catch(function(x){_.logger.error("Error generating key-session request:",x),a.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},p._createLicenseXhr=function(l,i,a){var c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,c,l,i,a);var C=this._licenseXhrSetup;if(C)try{C.call(this.hls,c,l),C=void 0}catch(x){_.logger.error(x)}try{c.readyState||c.open("POST",l,!0),C&&C.call(this.hls,c,l)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return c},p._onLicenseRequestReadyStageChange=function(l,i,a,c){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,_.logger.log("License request succeeded");var C=l.response,x=this._licenseResponseCallback;if(x)try{C=x.call(this.hls,l,i)}catch(w){_.logger.error(w)}c(C)}else{if(_.logger.error("License Request XHR failed ("+i+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var h=L-this._requestLicenseFailureCount+1;_.logger.warn("Retrying license request, "+h+" attempts left"),this._requestLicense(a,c)}break}},p._generateLicenseRequestChallenge=function(l,i){switch(l.mediaKeySystemDomain){case N.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},p._requestLicense=function(l,i){_.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){_.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(a.mediaKeySystemDomain),C=this._createLicenseXhr(c,l,i);_.logger.log("Sending license request to URL: "+c);var x=this._generateLicenseRequestChallenge(a,l);C.send(x)}catch(h){_.logger.error("Failure requesting DRM license: "+h),this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},p.onMediaAttached=function(l,i){if(!this._emeEnabled)return;var a=i.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},p.onMediaDetached=function(){var l=this._media,i=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},p.onManifestParsed=function(l,i){if(!this._emeEnabled)return;var a=i.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),c=i.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(N.KeySystems.WIDEVINE,a,c)},A(S,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),S}();B.default=O},"./src/controller/fps-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/events.ts"),M=D("./src/utils/logger.ts"),_=function(){function N(A){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=A,this.registerListeners()}var I=N.prototype;return I.setStreamController=function(L){this.streamController=L},I.registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},I.unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching)},I.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},I.onMediaAttaching=function(L,v){var y=this.hls.config;if(y.capLevelOnFPSDrop){var O=v.media instanceof self.HTMLVideoElement?v.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),y.fpsDroppedMonitoringPeriod)}},I.checkFPS=function(L,v,y){var O=performance.now();if(v){if(this.lastTime){var S=O-this.lastTime,p=y-this.lastDroppedFrames,m=v-this.lastDecodedFrames,l=1e3*p/S,i=this.hls;if(i.trigger(F.Events.FPS_DROP,{currentDropped:p,currentDecoded:m,totalDroppedFrames:y}),l>0&&p>i.config.fpsDroppedMonitoringThreshold*m){var a=i.currentLevel;M.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=a)&&(a=a-1,i.trigger(F.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:i.currentLevel}),i.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=O,this.lastDroppedFrames=y,this.lastDecodedFrames=v}},I.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var v=L.getVideoPlaybackQuality();this.checkFPS(L,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},N}();B.default=_},"./src/controller/fragment-finders.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"findFragmentByPDT",function(){return _}),D.d(B,"findFragmentByPTS",function(){return N}),D.d(B,"fragmentWithinToleranceTest",function(){return I}),D.d(B,"pdtWithinToleranceTest",function(){return A}),D.d(B,"findFragWithCC",function(){return L});var F=D("./src/polyfills/number.ts"),M=D("./src/utils/binary-search.ts");function _(v,y,O){if(y===null||!Array.isArray(v)||!v.length||!Object(F.isFiniteNumber)(y))return null;var S=v[0].programDateTime;if(y<(S||0))return null;var p=v[v.length-1].endProgramDateTime;if(y>=(p||0))return null;O=O||0;for(var m=0;m<v.length;++m){var l=v[m];if(A(y,O,l))return l}return null}function N(v,y,O,S){O===void 0&&(O=0),S===void 0&&(S=0);var p=null;if(v?p=y[v.sn-y[0].sn+1]||null:O===0&&y[0].start===0&&(p=y[0]),p&&I(O,S,p)===0)return p;var m=M.default.search(y,I.bind(null,O,S));return m||p}function I(v,y,O){v===void 0&&(v=0),y===void 0&&(y=0);var S=Math.min(y,O.duration+(O.deltaPTS?O.deltaPTS:0));return O.start+O.duration-S<=v?1:O.start-S>v&&O.start?-1:0}function A(v,y,O){var S=Math.min(y,O.duration+(O.deltaPTS?O.deltaPTS:0))*1e3,p=O.endProgramDateTime||0;return p-S>v}function L(v,y){return M.default.search(v,function(O){return O.cc<y?1:O.cc>y?-1:0})}},"./src/controller/fragment-tracker.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"FragmentState",function(){return _}),D.d(B,"FragmentTracker",function(){return N});var F=D("./src/events.ts"),M=D("./src/types/loader.ts"),_;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(_||(_={}));var N=function(){function L(y){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=y,this._registerListeners()}var v=L.prototype;return v._registerListeners=function(){var O=this.hls;O.on(F.Events.BUFFER_APPENDED,this.onBufferAppended,this),O.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),O.on(F.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var O=this.hls;O.off(F.Events.BUFFER_APPENDED,this.onBufferAppended,this),O.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),O.off(F.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(O,S){if(S===M.PlaylistLevelType.MAIN){var p=this.activeFragment,m=this.activeParts;if(!p)return null;if(m)for(var l=m.length;l--;){var i=m[l],a=i?i.end:p.appendedPTS;if(i.start<=O&&a!==void 0&&O<=a)return l>9&&(this.activeParts=m.slice(l-9)),i}else if(p.start<=O&&p.appendedPTS!==void 0&&O<=p.appendedPTS)return p}return this.getBufferedFrag(O,S)},v.getBufferedFrag=function(O,S){for(var p=this.fragments,m=Object.keys(p),l=m.length;l--;){var i=p[m[l]];if((i==null?void 0:i.body.type)===S&&i.buffered){var a=i.body;if(a.start<=O&&O<=a.end)return a}}return null},v.detectEvictedFragments=function(O,S,p){var m=this;Object.keys(this.fragments).forEach(function(l){var i=m.fragments[l];if(!i)return;if(!i.buffered){i.body.type===p&&m.removeFragment(i.body);return}var a=i.range[O];if(!a)return;a.time.some(function(c){var C=!m.isTimeBuffered(c.startPTS,c.endPTS,S);return C&&m.removeFragment(i.body),C})})},v.detectPartialFragments=function(O){var S=this,p=this.timeRanges,m=O.frag,l=O.part;if(!p||m.sn==="initSegment")return;var i=A(m),a=this.fragments[i];if(!a)return;Object.keys(p).forEach(function(c){var C=m.elementaryStreams[c];if(!C)return;var x=p[c],h=l!==null||C.partial===!0;a.range[c]=S.getBufferedTimes(m,l,h,x)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},v.fragBuffered=function(O){var S=A(O),p=this.fragments[S];p&&(p.backtrack=p.loaded=null,p.buffered=!0)},v.getBufferedTimes=function(O,S,p,m){for(var l={time:[],partial:p},i=S?S.start:O.start,a=S?S.end:O.end,c=O.minEndPTS||a,C=O.maxStartPTS||i,x=0;x<m.length;x++){var h=m.start(x)-this.bufferPadding,w=m.end(x)+this.bufferPadding;if(C>=h&&c<=w){l.time.push({startPTS:Math.max(i,m.start(x)),endPTS:Math.min(a,m.end(x))});break}else if(i<w&&a>h)l.partial=!0,l.time.push({startPTS:Math.max(i,m.start(x)),endPTS:Math.min(a,m.end(x))});else if(a<=h)break}return l},v.getPartialFragment=function(O){var S=null,p,m,l,i=0,a=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(C){var x=c[C];if(!x)return;I(x)&&(m=x.body.start-a,l=x.body.end+a,O>=m&&O<=l&&(p=Math.min(O-m,l-O),i<=p&&(S=x.body,i=p)))}),S},v.getState=function(O){var S=A(O),p=this.fragments[S];return p?p.buffered?I(p)?_.PARTIAL:_.OK:p.backtrack?_.BACKTRACKED:_.APPENDING:_.NOT_LOADED},v.backtrack=function(O,S){var p=A(O),m=this.fragments[p];if(!m||m.backtrack)return null;var l=m.backtrack=S||m.loaded;return m.loaded=null,l},v.getBacktrackData=function(O){var S=A(O),p=this.fragments[S];if(p){var m,l=p.backtrack;if(l!=null&&(m=l.payload)!==null&&m!==void 0&&m.byteLength)return l;this.removeFragment(O)}return null},v.isTimeBuffered=function(O,S,p){for(var m,l,i=0;i<p.length;i++){if(m=p.start(i)-this.bufferPadding,l=p.end(i)+this.bufferPadding,O>=m&&S<=l)return!0;if(S<=m)return!1}return!1},v.onFragLoaded=function(O,S){var p=S.frag,m=S.part;if(p.sn==="initSegment"||p.bitrateTest||m)return;var l=A(p);this.fragments[l]={body:p,loaded:S,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(O,S){var p=this,m=S.frag,l=S.part,i=S.timeRanges;if(m.type===M.PlaylistLevelType.MAIN)if(this.activeFragment=m,l){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(l)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(c){var C=i[c];if(p.detectEvictedFragments(c,C),!l)for(var x=0;x<C.length;x++)m.appendedPTS=Math.max(C.end(x),m.appendedPTS||0)})},v.onFragBuffered=function(O,S){this.detectPartialFragments(S)},v.hasFragment=function(O){var S=A(O);return!!this.fragments[S]},v.removeFragmentsInRange=function(O,S,p){var m=this;Object.keys(this.fragments).forEach(function(l){var i=m.fragments[l];if(!i)return;if(i.buffered){var a=i.body;a.type===p&&a.start<S&&a.end>O&&m.removeFragment(a)}})},v.removeFragment=function(O){var S=A(O);O.stats.loaded=0,O.clearElementaryStreamInfo(),delete this.fragments[S]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function I(L){var v,y;return L.buffered&&(((v=L.range.video)===null||v===void 0?void 0:v.partial)||((y=L.range.audio)===null||y===void 0?void 0:y.partial))}function A(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"STALL_MINIMUM_DURATION_MS",function(){return I}),D.d(B,"MAX_START_GAP_JUMP",function(){return A}),D.d(B,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),D.d(B,"SKIP_BUFFER_RANGE_START",function(){return v}),D.d(B,"default",function(){return y});var F=D("./src/utils/buffer-helper.ts"),M=D("./src/errors.ts"),_=D("./src/events.ts"),N=D("./src/utils/logger.ts"),I=250,A=2,L=.1,v=.05,y=function(){function O(p,m,l,i){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=p,this.media=m,this.fragmentTracker=l,this.hls=i}var S=O.prototype;return S.destroy=function(){this.hls=this.fragmentTracker=this.media=null},S.poll=function(m){var l=this.config,i=this.media,a=this.stalled,c=i.currentTime,C=i.seeking,x=this.seeking&&!C,h=!this.seeking&&C;if(this.seeking=C,c!==m){if(this.moved=!0,a!==null){if(this.stallReported){var w=self.performance.now()-a;N.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((h||x)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!F.BufferHelper.getBuffered(i).length)return;var E=F.BufferHelper.bufferInfo(i,c,0),f=E.len>0,d=E.nextStart||0;if(!f&&!d)return;if(C){var s=E.len>A,o=!d||d-c>A&&!this.fragmentTracker.getPartialFragment(c);if(s||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,b=Math.max(d,E.start||0)-c,g=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=g==null||((T=g.details)===null||T===void 0)?void 0:T.live,j=P?g.details.targetduration*2:A;if(b>0&&b<=j){this._trySkipBufferHole(null);return}}var H=self.performance.now();if(a===null){this.stalled=H;return}var X=H-a;!C&&X>=I&&this._reportStall(E.len);var W=F.BufferHelper.bufferInfo(i,c,l.maxBufferHole);this._tryFixBufferStall(W,X)},S._tryFixBufferStall=function(m,l){var i=this.config,a=this.fragmentTracker,c=this.media,C=c.currentTime,x=a.getPartialFragment(C);if(x){var h=this._trySkipBufferHole(x);if(h)return}m.len>i.maxBufferHole&&l>i.highBufferWatchdogPeriod*1e3&&(N.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},S._reportStall=function(m){var l=this.hls,i=this.media,a=this.stallReported;a||(this.stallReported=!0,N.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+m+")"),l.trigger(_.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m}))},S._trySkipBufferHole=function(m){for(var l=this.config,i=this.hls,a=this.media,c=a.currentTime,C=0,x=F.BufferHelper.getBuffered(a),h=0;h<x.length;h++){var w=x.start(h);if(c+l.maxBufferHole>=C&&c<w){var E=Math.max(w+v,a.currentTime+L);return N.logger.warn("skipping hole, adjusting currentTime from "+c+" to "+E),this.moved=!0,this.stalled=null,a.currentTime=E,m&&i.trigger(_.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+c+" to "+E,frag:m}),E}C=x.end(h)}return 0},S._tryNudgeBuffer=function(){var m=this.config,l=this.hls,i=this.media,a=i.currentTime,c=(this.nudgeRetry||0)+1;if(this.nudgeRetry=c,c<m.nudgeMaxRetry){var C=a+c*m.nudgeOffset;N.logger.warn("Nudging 'currentTime' from "+a+" to "+C),i.currentTime=C,l.trigger(_.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else N.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+m.nudgeMaxRetry+" nudges"),l.trigger(_.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},O}()},"./src/controller/id3-track-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/events.ts"),M=D("./src/utils/texttrack-utils.ts"),_=D("./src/demux/id3.ts"),N=.25,I=function(){function A(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var L=A.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var y=this.hls;y.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(F.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var y=this.hls;y.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(F.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(y,O){this.media=O.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(M.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(y){if(!this.media)return;for(var O=0;O<y.length;O++){var S=y[O];if(S.kind==="metadata"&&S.label==="id3")return Object(M.sendAddTrackEvent)(S,this.media),S}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(y,O){if(!this.media)return;var S=O.frag,p=O.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var m=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<p.length;l++){var i=_.getID3Frames(p[l].data);if(i){var a=p[l].pts,c=l<p.length-1?p[l+1].pts:S.end,C=c-a;C<=0&&(c=a+N);for(var x=0;x<i.length;x++){var h=i[x];if(!_.isTimeStampFrame(h)){var w=new m(a,c,"");w.value=h,this.id3Track.addCue(w)}}}}},L.onBufferFlushing=function(y,O){var S=O.startOffset,p=O.endOffset,m=O.type;if(!m||m==="audio"){var l=this.id3Track;l&&Object(M.removeCuesInRange)(l,S,p)}},A}();B.default=I},"./src/controller/latency-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return A});var F=D("./src/errors.ts"),M=D("./src/events.ts"),_=D("./src/utils/logger.ts");function N(L,v){for(var y=0;y<v.length;y++){var O=v[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(L,O.key,O)}}function I(L,v,y){return v&&N(L.prototype,v),y&&N(L,y),L}var A=function(){function L(y){var O=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return O.timeupdate()},this.hls=y,this.config=y.config,this.registerListeners()}var v=L.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(M.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(M.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(M.Events.ERROR,this.onError)},v.onMediaAttached=function(O,S){this.media=S.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(O,S){var p=S.details;this.levelDetails=p,p.advanced&&this.timeupdate(),!p.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(O,S){if(S.details!==F.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,_.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var O=this.media,S=this.levelDetails;if(!O||!S)return;this.currentTime=O.currentTime;var p=this.computeLatency();if(p===null)return;this._latency=p;var m=this.config,l=m.lowLatencyMode,i=m.maxLiveSyncPlaybackRate;if(!l||i===1)return;var a=this.targetLatency;if(a===null)return;var c=p-a,C=Math.min(this.maxLatency,a+S.targetduration),x=c<C;if(S.live&&x&&c>.05&&this.forwardBufferLength>1){var h=Math.min(2,Math.max(1,i)),w=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;O.playbackRate=Math.min(h,Math.max(1,w))}else O.playbackRate!==1&&O.playbackRate!==0&&(O.playbackRate=1)},v.estimateLiveEdge=function(){var O=this.levelDetails;return O===null?null:O.edge+O.age},v.computeLatency=function(){var O=this.estimateLiveEdge();return O===null?null:O-this.currentTime},I(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var O=this.config,S=this.levelDetails;return O.liveMaxLatencyDuration!==void 0?O.liveMaxLatencyDuration:S?O.liveMaxLatencyDurationCount*S.targetduration:0}},{key:"targetLatency",get:function(){var O=this.levelDetails;if(O===null)return null;var S=O.holdBack,p=O.partHoldBack,m=O.targetduration,l=this.config,i=l.liveSyncDuration,a=l.liveSyncDurationCount,c=l.lowLatencyMode,C=this.hls.userConfig,x=c&&p||S;(C.liveSyncDuration||C.liveSyncDurationCount||x===0)&&(x=i!==void 0?i:a*m);var h=m,w=1;return x+Math.min(this.stallCount*w,h)}},{key:"liveSyncPosition",get:function(){var O=this.estimateLiveEdge(),S=this.targetLatency,p=this.levelDetails;if(O===null||S===null||p===null)return null;var m=p.edge,l=O-S-this.edgeStalled,i=m-p.totalduration,a=m-(this.config.lowLatencyMode&&p.partTarget||p.targetduration);return Math.min(Math.max(i,l),a)}},{key:"drift",get:function(){var O=this.levelDetails;return O===null?1:O.drift}},{key:"edgeStalled",get:function(){var O=this.levelDetails;if(O===null)return 0;var S=(this.config.lowLatencyMode&&O.partTarget||O.targetduration)*3;return Math.max(O.age-S,0)}},{key:"forwardBufferLength",get:function(){var O=this.media,S=this.levelDetails;if(!O||!S)return 0;var p=O.buffered.length;return p?O.buffered.end(p-1):S.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return l});var F=D("./src/types/level.ts"),M=D("./src/events.ts"),_=D("./src/errors.ts"),N=D("./src/utils/codecs.ts"),I=D("./src/controller/level-helper.ts"),A=D("./src/controller/base-playlist-controller.ts"),L=D("./src/types/loader.ts");function v(){return v=Object.assign||function(i){for(var a=1;a<arguments.length;a++){var c=arguments[a];for(var C in c)Object.prototype.hasOwnProperty.call(c,C)&&(i[C]=c[C])}return i},v.apply(this,arguments)}function y(i,a){for(var c=0;c<a.length;c++){var C=a[c];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(i,C.key,C)}}function O(i,a,c){return a&&y(i.prototype,a),c&&y(i,c),i}function S(i,a){i.prototype=Object.create(a.prototype),i.prototype.constructor=i,p(i,a)}function p(i,a){return p=Object.setPrototypeOf||function(C,x){return C.__proto__=x,C},p(i,a)}var m=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(i){S(a,i);function a(C){var x;return x=i.call(this,C,"[level-controller]")||this,x._levels=[],x._firstLevel=-1,x._startLevel=void 0,x.currentLevelIndex=-1,x.manualLevelIndex=-1,x.onParsedComplete=void 0,x._registerListeners(),x}var c=a.prototype;return c._registerListeners=function(){var x=this.hls;x.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),x.on(M.Events.ERROR,this.onError,this)},c._unregisterListeners=function(){var x=this.hls;x.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(M.Events.ERROR,this.onError,this)},c.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,i.prototype.destroy.call(this)},c.startLoad=function(){var x=this._levels;x.forEach(function(h){h.loadError=0}),i.prototype.startLoad.call(this)},c.onManifestLoaded=function(x,h){var w=[],E=[],f=[],d,s={},o,T=!1,b=!1,g=!1;if(h.levels.forEach(function(X){var W=X.attrs;T=T||!!(X.width&&X.height),b=b||!!X.videoCodec,g=g||!!X.audioCodec,m&&X.audioCodec&&X.audioCodec.indexOf("mp4a.40.34")!==-1&&(X.audioCodec=void 0);var U=X.bitrate+"-"+X.attrs.RESOLUTION+"-"+X.attrs.CODECS;o=s[U],o?o.url.push(X.url):(o=new F.Level(X),s[U]=o,w.push(o)),W&&(W.AUDIO&&Object(I.addGroupId)(o,"audio",W.AUDIO),W.SUBTITLES&&Object(I.addGroupId)(o,"text",W.SUBTITLES))}),(T||b)&&g&&(w=w.filter(function(X){var W=X.videoCodec,U=X.width,z=X.height;return!!W||!!(U&&z)})),w=w.filter(function(X){var W=X.audioCodec,U=X.videoCodec;return(!W||Object(N.isCodecSupportedInMp4)(W,"audio"))&&(!U||Object(N.isCodecSupportedInMp4)(U,"video"))}),h.audioTracks&&(E=h.audioTracks.filter(function(X){return!X.audioCodec||Object(N.isCodecSupportedInMp4)(X.audioCodec,"audio")}),Object(I.assignTrackIdsByGroup)(E)),h.subtitles&&(f=h.subtitles,Object(I.assignTrackIdsByGroup)(f)),w.length>0){d=w[0].bitrate,w.sort(function(X,W){return X.bitrate-W.bitrate}),this._levels=w;for(var P=0;P<w.length;P++)if(w[P].bitrate===d){this._firstLevel=P,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+d);break}var j=g&&!b,H={levels:w,audioTracks:E,subtitleTracks:f,firstLevel:this._firstLevel,stats:h.stats,audio:g,video:b,altAudio:!j&&E.some(function(X){return!!X.url})};this.hls.trigger(M.Events.MANIFEST_PARSED,H),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(M.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:h.url,reason:"no level with compatible codecs found in manifest"})},c.onError=function(x,h){if(i.prototype.onError.call(this,x,h),h.fatal)return;var w=h.context,E=this._levels[this.currentLevelIndex];if(w&&(w.type===L.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&w.groupId===E.audioGroupIds[E.urlId]||w.type===L.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&w.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,d=!0,s;switch(h.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:if(h.frag){var o=this._levels[h.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=h.frag.level)):s=h.frag.level}break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(d=!1),s=w.level),f=!0;break;case _.ErrorDetails.REMUX_ALLOC_ERROR:s=h.level,f=!0;break}s!==void 0&&this.recoverLevel(h,s,f,d)},c.recoverLevel=function(x,h,w,E){var f=x.details,d=this._levels[h];if(d.loadError++,w){var s=this.retryLoadingOrFail(x);if(s)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var o=d.url.length;if(o>1&&d.loadError<o)x.levelRetry=!0,this.redundantFailover(h);else if(this.manualLevelIndex===-1){var T=h===0?this._levels.length-1:h-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(f+": switch to "+T),x.levelRetry=!0,this.hls.nextAutoLevel=T)}}},c.redundantFailover=function(x){var h=this._levels[x],w=h.url.length;if(w>1){var E=(h.urlId+1)%w;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(f){f.urlId=E}),this.level=x}},c.onFragLoaded=function(x,h){var w=h.frag;if(w!==void 0&&w.type===L.PlaylistLevelType.MAIN){var E=this._levels[w.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},c.onLevelLoaded=function(x,h){var w,E=h.level,f=h.details,d=this._levels[E];if(!d){var s;this.warn("Invalid level index "+E),(s=h.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(f.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(d.fragmentError===0&&(d.loadError=0,this.retryCount=0),this.playlistLoaded(E,h,d.details)):(w=h.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(f.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(x,h){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var E=-1,f=this.hls.audioTracks[h.id].groupId,d=0;d<w.audioGroupIds.length;d++)if(w.audioGroupIds[d]===f){E=d;break}E!==w.urlId&&(w.urlId=E,this.startLoad())}},c.loadPlaylist=function(x){var h=this.currentLevelIndex,w=this._levels[h];if(this.canLoad&&w&&w.url.length>0){var E=w.urlId,f=w.url[E];if(x)try{f=x.addDirectives(f)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("Attempt loading level index "+h+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+E+" "+f),this.clearTimer(),this.hls.trigger(M.Events.LEVEL_LOADING,{url:f,level:h,id:E,deliveryDirectives:x||null})}},c.removeLevel=function(x,h){var w=function(d,s){return s!==h},E=this._levels.filter(function(f,d){return d!==x?!0:f.url.length>1&&h!==void 0?(f.url=f.url.filter(w),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(w)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(w)),f.urlId=0,!0):!1}).map(function(f,d){var s=f.details;return s!=null&&s.fragments&&s.fragments.forEach(function(o){o.level=d}),f});this._levels=E,this.hls.trigger(M.Events.LEVELS_UPDATED,{levels:E})},O(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var h,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===x&&(h=w[x])!==null&&h!==void 0&&h.details)return;if(x<0||x>=w.length){var E=x<0;if(this.hls.trigger(M.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:E,reason:"invalid level idx"}),E)return;x=Math.min(x,w.length-1)}this.clearTimer();var f=this.currentLevelIndex,d=w[f],s=w[x];this.log("switching to level "+x+" from "+f),this.currentLevelIndex=x;var o=v({},s,{level:x,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete o._urlId,this.hls.trigger(M.Events.LEVEL_SWITCHING,o);var T=s.details;if(!T||T.live){var b=this.switchParams(s.uri,d==null?void 0:d.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),a}(A.default)},"./src/controller/level-helper.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"addGroupId",function(){return _}),D.d(B,"assignTrackIdsByGroup",function(){return N}),D.d(B,"updatePTS",function(){return I}),D.d(B,"updateFragPTSDTS",function(){return L}),D.d(B,"mergeDetails",function(){return v}),D.d(B,"mapPartIntersection",function(){return y}),D.d(B,"mapFragmentIntersection",function(){return O}),D.d(B,"adjustSliding",function(){return S}),D.d(B,"addSliding",function(){return p}),D.d(B,"computeReloadInterval",function(){return m}),D.d(B,"getFragmentWithSN",function(){return l}),D.d(B,"getPartWith",function(){return i});var F=D("./src/polyfills/number.ts"),M=D("./src/utils/logger.ts");function _(a,c,C){switch(c){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(C);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(C);break}}function N(a){var c={};a.forEach(function(C){var x=C.groupId||"";C.id=c[x]=c[x]||0,c[x]++})}function I(a,c,C){var x=a[c],h=a[C];A(x,h)}function A(a,c){var C=c.startPTS;if(Object(F.isFiniteNumber)(C)){var x=0,h;c.sn>a.sn?(x=C-a.start,h=a):(x=a.start-C,h=c),h.duration!==x&&(h.duration=x)}else if(c.sn>a.sn){var w=a.cc===c.cc;w&&a.minEndPTS?c.start=a.start+(a.minEndPTS-a.start):c.start=a.start+a.duration}else c.start=Math.max(a.start-c.duration,0)}function L(a,c,C,x,h,w){var E=x-C;E<=0&&(M.logger.warn("Fragment should have a positive duration",c),x=C+c.duration,w=h+c.duration);var f=C,d=x,s=c.startPTS,o=c.endPTS;if(Object(F.isFiniteNumber)(s)){var T=Math.abs(s-C);Object(F.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(T,c.deltaPTS):c.deltaPTS=T,f=Math.max(C,s),C=Math.min(C,s),h=Math.min(h,c.startDTS),d=Math.min(x,o),x=Math.max(x,o),w=Math.max(w,c.endDTS)}c.duration=x-C;var b=C-c.start;c.appendedPTS=x,c.start=c.startPTS=C,c.maxStartPTS=f,c.startDTS=h,c.endPTS=x,c.minEndPTS=d,c.endDTS=w;var g=c.sn;if(!a||g<a.startSN||g>a.endSN)return 0;var P,j=g-a.startSN,H=a.fragments;for(H[j]=c,P=j;P>0;P--)A(H[P],H[P-1]);for(P=j;P<H.length-1;P++)A(H[P],H[P+1]);return a.fragmentHint&&A(H[H.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,b}function v(a,c){for(var C=null,x=a.fragments,h=x.length-1;h>=0;h--){var w=x[h].initSegment;if(w){C=w;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var E=0,f;if(O(a,c,function(P,j){P.relurl&&(E=P.cc-j.cc),Object(F.isFiniteNumber)(P.startPTS)&&Object(F.isFiniteNumber)(P.endPTS)&&(j.start=j.startPTS=P.startPTS,j.startDTS=P.startDTS,j.appendedPTS=P.appendedPTS,j.maxStartPTS=P.maxStartPTS,j.endPTS=P.endPTS,j.endDTS=P.endDTS,j.minEndPTS=P.minEndPTS,j.duration=P.endPTS-P.startPTS,j.duration&&(f=j),c.PTSKnown=c.alignedSliding=!0),j.elementaryStreams=P.elementaryStreams,j.loader=P.loader,j.stats=P.stats,j.urlId=P.urlId,P.initSegment&&(j.initSegment=P.initSegment,C=P.initSegment)}),C){var d=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;d.forEach(function(P){var j;(!P.initSegment||P.initSegment.relurl===((j=C)===null||j===void 0?void 0:j.relurl))&&(P.initSegment=C)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(P){return!P}),c.deltaUpdateFailed)){M.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=c.skippedSegments;s--;)c.fragments.shift();c.startSN=c.fragments[0].sn,c.startCC=c.fragments[0].cc}var o=c.fragments;if(E){M.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<o.length;T++)o[T].cc+=E}c.skippedSegments&&(c.startCC=c.fragments[0].cc),y(a.partList,c.partList,function(P,j){j.elementaryStreams=P.elementaryStreams,j.stats=P.stats}),f?L(c,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):S(a,c),o.length&&(c.totalduration=c.edge-o[0].start),c.driftStartTime=a.driftStartTime,c.driftStart=a.driftStart;var b=c.advancedDateTime;if(c.advanced&&b){var g=c.edge;c.driftStart||(c.driftStartTime=b,c.driftStart=g),c.driftEndTime=b,c.driftEnd=g}else c.driftEndTime=a.driftEndTime,c.driftEnd=a.driftEnd,c.advancedDateTime=a.advancedDateTime}function y(a,c,C){if(a&&c)for(var x=0,h=0,w=a.length;h<=w;h++){var E=a[h],f=c[h+x];E&&f&&E.index===f.index&&E.fragment.sn===f.fragment.sn?C(E,f):x--}}function O(a,c,C){for(var x=c.skippedSegments,h=Math.max(a.startSN,c.startSN)-c.startSN,w=(a.fragmentHint?1:0)+(x?c.endSN:Math.min(a.endSN,c.endSN))-c.startSN,E=c.startSN-a.startSN,f=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,d=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,s=h;s<=w;s++){var o=d[E+s],T=f[s];x&&!T&&s<x&&(T=c.fragments[s]=o),o&&T&&C(o,T)}}function S(a,c){var C=c.startSN+c.skippedSegments-a.startSN,x=a.fragments;if(C<0||C>=x.length)return;p(c,x[C].start)}function p(a,c){if(c){for(var C=a.fragments,x=a.skippedSegments;x<C.length;x++)C[x].start+=c;a.fragmentHint&&(a.fragmentHint.start+=c)}}function m(a,c){var C=1e3*a.levelTargetDuration,x=C/2,h=a.age,w=h>0&&h<C*3,E=c.loading.end-c.loading.start,f,d=a.availabilityDelay;if(a.updated===!1)if(w){var s=333*a.misses;f=Math.max(Math.min(x,E*2),s),a.availabilityDelay=(a.availabilityDelay||0)+f}else f=x;else w?(d=Math.min(d||C/2,h),a.availabilityDelay=d,f=d+C-h):f=C-E;return Math.round(f)}function l(a,c,C){if(!a||!a.details)return null;var x=a.details,h=x.fragments[c-x.startSN];return h||(h=x.fragmentHint,h&&h.sn===c?h:c<x.startSN&&C&&C.sn===c?C:null)}function i(a,c,C){if(!a||!a.details)return null;var x=a.details.partList;if(x)for(var h=x.length;h--;){var w=x[h];if(w.index===C&&w.fragment.sn===c)return w}return null}},"./src/controller/stream-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return x});var F=D("./src/polyfills/number.ts"),M=D("./src/controller/base-stream-controller.ts"),_=D("./src/is-supported.ts"),N=D("./src/events.ts"),I=D("./src/utils/buffer-helper.ts"),A=D("./src/controller/fragment-tracker.ts"),L=D("./src/types/loader.ts"),v=D("./src/loader/fragment.ts"),y=D("./src/demux/transmuxer-interface.ts"),O=D("./src/types/transmuxer.ts"),S=D("./src/controller/gap-controller.ts"),p=D("./src/errors.ts"),m=D("./src/utils/logger.ts");function l(h,w){for(var E=0;E<w.length;E++){var f=w[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}function i(h,w,E){return w&&l(h.prototype,w),E&&l(h,E),h}function a(h,w){h.prototype=Object.create(w.prototype),h.prototype.constructor=h,c(h,w)}function c(h,w){return c=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},c(h,w)}var C=100,x=function(h){a(w,h);function w(f,d){var s;return s=h.call(this,f,d,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var E=w.prototype;return E._registerListeners=function(){var d=this.hls;d.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.on(N.Events.ERROR,this.onError,this),d.on(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(N.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var d=this.hls;d.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.off(N.Events.ERROR,this.onError,this),d.off(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(N.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(d){if(this.levels){var s=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=o.startLevel;T===-1&&(o.config.testBandwidth?(T=0,this.bitrateTest=!0):T=o.nextAutoLevel),this.level=o.nextLoadLevel=T,this.loadedmetadata=!1}s>0&&d===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),d=s),this.state=M.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()}else this._forceStartLoad=!0,this.state=M.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,h.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_LEVEL:{var d,s=this.levels,o=this.level,T=s==null||((d=s[o])===null||d===void 0)?void 0:d.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=M.State.IDLE;break}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var b,g=self.performance.now(),P=this.retryDate;(!P||g>=P||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=M.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){h.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var d,s,o=this.hls,T=this.levelLastLoaded,b=this.levels,g=this.media,P=o.config,j=o.nextLoadLevel;if(T===null||!g&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[j])return;var H=b[j];this.level=o.nextLoadLevel=j;var X=H.details;if(!X||this.state===M.State.WAITING_LEVEL||X.live&&this.levelLastLoaded!==j){this.state=M.State.WAITING_LEVEL;return}var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:g,L.PlaylistLevelType.MAIN);if(W===null)return;var U=W.len,z=this.getMaxBufferLength(H.maxBitrate);if(U>=z)return;if(this._streamEnded(W,X)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(N.Events.BUFFER_EOS,Z),this.state=M.State.ENDED;return}var q=W.end,oe=this.getNextFragment(q,X);if(this.couldBacktrack&&!this.fragPrevious&&oe&&oe.sn!=="initSegment"){var ye=oe.sn-X.startSN;ye>1&&(oe=X.fragments[ye-1],this.fragmentTracker.removeFragment(oe))}if(oe&&this.fragmentTracker.getState(oe)===A.FragmentState.OK&&this.nextLoadPosition>q){var me=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(g,me,L.PlaylistLevelType.MAIN),oe=this.getNextFragment(this.nextLoadPosition,X)}if(!oe)return;oe.initSegment&&!oe.initSegment.data&&!this.bitrateTest&&(oe=oe.initSegment),((d=oe.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((s=oe.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(oe,X):this.loadFragment(oe,X,q)},E.loadFragment=function(d,s,o){var T,b=this.fragmentTracker.getState(d);if(this.fragCurrent=d,b===A.FragmentState.BACKTRACKED){var g=this.fragmentTracker.getBacktrackData(d);if(g){this._handleFragmentLoadProgress(g),this._handleFragmentLoadComplete(g);return}else b=A.FragmentState.NOT_LOADED}b===A.FragmentState.NOT_LOADED||b===A.FragmentState.PARTIAL?d.sn==="initSegment"?this._loadInitSegment(d):this.bitrateTest?(d.bitrateTest=!0,this.log("Fragment "+d.sn+" of level "+d.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(d)):(this.startFragRequested=!0,h.prototype.loadFragment.call(this,d,s,o)):b===A.FragmentState.APPENDING?this.reduceMaxBufferLength(d.duration)&&this.fragmentTracker.removeFragment(d):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(d){var s=this.fragmentTracker.getAppendedFrag(d,L.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},E.getBufferedFrag=function(d){return this.fragmentTracker.getBufferedFrag(d,L.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(d){return d?this.getBufferedFrag(d.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var d=this.levels,s=this.media;if(s!=null&&s.readyState){var o,T=this.getAppendedFrag(s.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!s.paused&&d){var b=this.hls.nextLoadLevel,g=d[b],P=this.fragLastKbps;P&&this.fragCurrent?o=this.fragCurrent.duration*g.maxBitrate/(1e3*P)+1:o=0}else o=0;var j=this.getBufferedFrag(s.currentTime+o);if(j){var H=this.followingBufferedFrag(j);if(H){this.abortCurrentFrag();var X=H.maxStartPTS?H.maxStartPTS:H.start,W=H.duration,U=Math.max(j.end,X+Math.min(Math.max(W-this.config.maxFragLookUpTolerance,W*.5),W*.75));this.flushMainBuffer(U,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var d=this.fragCurrent;this.fragCurrent=null,d!=null&&d.loader&&d.loader.abort(),this.state===M.State.KEY_LOADING&&(this.state=M.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(d,s){h.prototype.flushMainBuffer.call(this,d,s,this.altAudio?"video":null)},E.onMediaAttached=function(d,s){h.prototype.onMediaAttached.call(this,d,s);var o=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new S.default(this.config,o,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var d=this.media;d&&(d.removeEventListener("playing",this.onvplaying),d.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),h.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var d=this.media,s=d?d.currentTime:null;Object(F.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(N.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(d,s){var o=!1,T=!1,b;s.levels.forEach(function(g){b=g.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(o=!0),b.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=o&&T&&!Object(_.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},E.onLevelLoading=function(d,s){var o=this.levels;if(!o||this.state!==M.State.IDLE)return;var T=o[s.level];(!T.details||T.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(T.details))&&(this.state=M.State.WAITING_LEVEL)},E.onLevelLoaded=function(d,s){var o,T=this.levels,b=s.level,g=s.details,P=g.totalduration;if(!T){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+g.startSN+","+g.endSN+"], cc ["+g.startCC+", "+g.endCC+"] duration:"+P);var j=this.fragCurrent;j&&(this.state===M.State.FRAG_LOADING||this.state===M.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==s.level&&j.loader&&(this.state=M.State.IDLE,j.loader.abort()));var H=T[b],X=0;if(g.live||(o=H.details)!==null&&o!==void 0&&o.live){if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed)return;X=this.alignPlaylists(g,H.details)}if(H.details=g,this.levelLastLoaded=b,this.hls.trigger(N.Events.LEVEL_UPDATED,{details:g,level:b}),this.state===M.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(g))return;this.state=M.State.IDLE}this.startFragRequested?g.live&&this.synchronizeToLiveEdge(g):this.setStartPosition(g,X),this.tick()},E._handleFragmentLoadProgress=function(d){var s,o=d.frag,T=d.part,b=d.payload,g=this.levels;if(!g){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var P=g[o.level],j=P.details;if(!j){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var H=P.videoCodec,X=j.PTSKnown||!j.live,W=(s=o.initSegment)===null||s===void 0?void 0:s.data,U=this._getAudioCodec(P),z=this.transmuxer=this.transmuxer||new y.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=T?T.index:-1,q=Z!==-1,oe=new O.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,b.byteLength,Z,q),ye=this.initPTS[o.cc];z.push(b,W,U,H,o,T,j.totalduration,X,oe,ye)},E.onAudioTrackSwitching=function(d,s){var o=this.altAudio,T=!!s.url,b=s.id;if(!T){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var g=this.fragCurrent;g!=null&&g.loader&&(this.log("Switching to main audio track, cancel main fragment load"),g.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;o&&P.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:b})}},E.onAudioTrackSwitched=function(d,s){var o=s.id,T=!!this.hls.audioTracks[o].url;if(T){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=T,this.tick()},E.onBufferCreated=function(d,s){var o=s.tracks,T,b,g=!1;for(var P in o){var j=o[P];if(j.id==="main"){if(b=P,T=j,P==="video"){var H=o[P];H&&(this.videoBuffer=H.buffer)}}else g=!0}g&&T?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(d,s){var o=s.frag,T=s.part;if(o&&o.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(T?" p: "+T.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===M.State.PARSED&&(this.state=M.State.IDLE);return}var b=T?T.stats:o.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,T)},E.onError=function(d,s){switch(s.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,s);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==M.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=M.State.ERROR):!s.levelRetry&&this.state===M.State.WAITING_LEVEL&&(this.state=M.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var o=!0,T=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);T&&T.len>.5&&(o=!this.reduceMaxBufferLength(T.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var d=this.media,s=this.gapController;if(!d||!s||!d.readyState)return;var o=I.BufferHelper.getBuffered(d);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=d.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=M.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(d,s){var o=s.type;if(o!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(o===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,o,L.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(d,s){this.levels=s.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var d=this.media,s=d.currentTime,o=this.startPosition;if(o>=0&&s<o){if(d.seeking){m.logger.log("could not seek to "+o+", already seeking at "+s);return}var T=I.BufferHelper.getBuffered(d),b=T.length?T.start(0):0,g=b-o;g>0&&(g<this.config.maxBufferHole||g<this.config.maxFragLookUpTolerance)&&(m.logger.log("adjusting start position by "+g+" to match buffer start"),o+=g,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+s),d.currentTime=o}},E._getAudioCodec=function(d){var s=this.config.defaultAudioCodec||d.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},E._loadBitrateTestFrag=function(d){var s=this;this._doFragLoad(d).then(function(o){var T=s.hls;if(!o||T.nextLoadLevel||s.fragContextChanged(d))return;s.fragLoadError=0,s.state=M.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var b=d.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),T.trigger(N.Events.FRAG_LOADED,o)})},E._handleTransmuxComplete=function(d){var s,o="main",T=this.hls,b=d.remuxResult,g=d.chunkMeta,P=this.getCurrentContext(g);if(!P){this.warn("The loading context changed while buffering fragment "+g.sn+" of level "+g.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(g.level);return}var j=P.frag,H=P.part,X=P.level,W=b.video,U=b.text,z=b.id3,Z=b.initSegment,q=this.altAudio?void 0:b.audio;if(this.fragContextChanged(j))return;if(this.state=M.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(X,Z.tracks,j,g),T.trigger(N.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:o,tracks:Z.tracks}));var oe=Z.initPTS,ye=Z.timescale;Object(F.isFiniteNumber)(oe)&&(this.initPTS[j.cc]=oe,T.trigger(N.Events.INIT_PTS_FOUND,{frag:j,id:o,initPTS:oe,timescale:ye}))}if(W&&b.independent!==!1){if(X.details){var me=W.startPTS,fe=W.endPTS,ve=W.startDTS,ge=W.endDTS;if(H)H.elementaryStreams[W.type]={startPTS:me,endPTS:fe,startDTS:ve,endDTS:ge};else if(W.firstKeyFrame&&W.independent&&(this.couldBacktrack=!0),W.dropped&&W.independent){var ae=this.getLoadPosition()+this.config.maxBufferHole;if(ae<me){this.backtrack(j);return}j.setElementaryStreamInfo(W.type,j.start,fe,j.start,ge,!0)}j.setElementaryStreamInfo(W.type,me,fe,ve,ge),this.bufferFragmentData(W,j,H,g)}}else if(b.independent===!1){this.backtrack(j);return}if(q){var se=q.startPTS,Te=q.endPTS,We=q.startDTS,Je=q.endDTS;H&&(H.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:Te,startDTS:We,endDTS:Je}),j.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,se,Te,We,Je),this.bufferFragmentData(q,j,H,g)}if(z!=null&&(s=z.samples)!==null&&s!==void 0&&s.length){var Ye={frag:j,id:o,samples:z.samples};T.trigger(N.Events.FRAG_PARSING_METADATA,Ye)}if(U){var Ze={frag:j,id:o,samples:U.samples};T.trigger(N.Events.FRAG_PARSING_USERDATA,Ze)}},E._bufferInitSegment=function(d,s,o,T){var b=this;if(this.state!==M.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var g=s.audio,P=s.video,j=s.audiovideo;if(g){var H=d.audioCodec,X=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(H&&(H.indexOf("mp4a.40.5")!==-1?H="mp4a.40.2":H="mp4a.40.5"),g.metadata.channelCount!==1&&X.indexOf("firefox")===-1&&(H="mp4a.40.5")),X.indexOf("android")!==-1&&g.container!=="audio/mpeg"&&(H="mp4a.40.2",this.log("Android: force audio codec to "+H)),d.audioCodec&&d.audioCodec!==H&&this.log('Swapping manifest audio codec "'+d.audioCodec+'" for "'+H+'"'),g.levelCodec=H,g.id="main",this.log("Init audio buffer, container:"+g.container+", codecs[selected/level/parsed]=["+(H||"")+"/"+(d.audioCodec||"")+"/"+g.codec+"]")}P&&(P.levelCodec=d.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(d.videoCodec||"")+"/"+P.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(d.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(N.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(W){var U=s[W],z=U.initSegment;z!=null&&z.byteLength&&b.hls.trigger(N.Events.BUFFER_APPENDING,{type:W,data:z,frag:o,part:null,chunkMeta:T,parent:o.type})}),this.tick()},E.backtrack=function(d){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(d);var s=this.fragmentTracker.backtrack(d);this.fragPrevious=null,this.nextLoadPosition=d.start,s?this.resetFragmentLoading(d):this.state=M.State.BACKTRACKING},E.checkFragmentChanged=function(){var d=this.media,s=null;if(d&&d.readyState>1&&d.seeking===!1){var o=d.currentTime;if(I.BufferHelper.isBuffered(d,o)?s=this.getAppendedFrag(o):I.BufferHelper.isBuffered(d,o+.1)&&(s=this.getAppendedFrag(o+.1)),s){var T=this.fragPlaying,b=s.level;(!T||s.sn!==T.sn||T.level!==b||s.urlId!==T.urlId)&&(this.hls.trigger(N.Events.FRAG_CHANGED,{frag:s}),(!T||T.level!==b)&&this.hls.trigger(N.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=s)}}},i(w,[{key:"nextLevel",get:function(){var d=this.nextBufferedFrag;return d?d.level:-1}},{key:"currentLevel",get:function(){var d=this.media;if(d){var s=this.getAppendedFrag(d.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var d=this.media;if(d){var s=this.getAppendedFrag(d.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(M.default)},"./src/controller/subtitle-stream-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"SubtitleStreamController",function(){return a});var F=D("./src/events.ts"),M=D("./src/utils/logger.ts"),_=D("./src/utils/buffer-helper.ts"),N=D("./src/controller/fragment-finders.ts"),I=D("./src/utils/discontinuities.ts"),A=D("./src/controller/level-helper.ts"),L=D("./src/controller/fragment-tracker.ts"),v=D("./src/controller/base-stream-controller.ts"),y=D("./src/types/loader.ts"),O=D("./src/types/level.ts");function S(c,C){for(var x=0;x<C.length;x++){var h=C[x];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(c,h.key,h)}}function p(c,C,x){return C&&S(c.prototype,C),x&&S(c,x),c}function m(c,C){c.prototype=Object.create(C.prototype),c.prototype.constructor=c,l(c,C)}function l(c,C){return l=Object.setPrototypeOf||function(h,w){return h.__proto__=w,h},l(c,C)}var i=500,a=function(c){m(C,c);function C(h,w){var E;return E=c.call(this,h,w,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var x=C.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var w=this.hls;w.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(F.Events.ERROR,this.onError,this),w.on(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(F.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(F.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var w=this.hls;w.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(F.Events.ERROR,this.onError,this),w.off(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(F.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(F.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(i),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(w,E){this.mainDetails=E.details},x.onSubtitleFragProcessed=function(w,E){var f=E.frag,d=E.success;if(this.fragPrevious=f,this.state=v.State.IDLE,!d)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var o,T=f.start,b=0;b<s.length;b++)if(T>=s[b].start&&T<=s[b].end){o=s[b];break}var g=f.start+f.duration;o?o.end=g:(o={start:T,end:g},s.push(o)),this.fragmentTracker.fragBuffered(f)},x.onBufferFlushing=function(w,E){var f=E.startOffset,d=E.endOffset;if(f===0&&d!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,o=this.levels;if(!o.length||!o[s]||!o[s].details)return;var T=o[s].details,b=T.targetduration,g=d-b;if(g<=0)return;E.endOffsetSubtitles=Math.max(0,g),this.tracksBuffered.forEach(function(P){for(var j=0;j<P.length;){if(P[j].end<=g){P.shift();continue}else if(P[j].start<g)P[j].start=g;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(f,g,y.PlaylistLevelType.SUBTITLE)}},x.onError=function(w,E){var f,d=E.frag;if(!d||d.type!==y.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},x.onSubtitleTracksUpdated=function(w,E){var f=this,d=E.subtitleTracks;this.tracksBuffered=[],this.levels=d.map(function(s){return new O.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){f.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(w,E){if(this.currentTrackId=E.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(i)},x.onSubtitleTrackLoaded=function(w,E){var f,d=E.details,s=E.id,o=this.currentTrackId,T=this.levels;if(!T.length)return;var b=T[o];if(s>=T.length||s!==o||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,d.live||(f=b.details)!==null&&f!==void 0&&f.live){var g=this.mainDetails;if(d.deltaUpdateFailed||!g)return;var P=g.fragments[0];if(!b.details)d.hasProgramDateTime&&g.hasProgramDateTime?Object(I.alignMediaPlaylistByPDT)(d,g):P&&Object(A.addSliding)(d,P.start);else{var j=this.alignPlaylists(d,b.details);j===0&&P&&Object(A.addSliding)(d,P.start)}}if(b.details=d,this.levelLastLoaded=s,this.tick(),d.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var H=Object(N.findFragmentByPTS)(null,d.fragments,this.media.currentTime,0);H||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},x._handleFragmentLoadComplete=function(w){var E=w.frag,f=w.payload,d=E.decryptdata,s=this.hls;if(this.fragContextChanged(E))return;if(f&&f.byteLength>0&&d&&d.key&&d.iv&&d.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),d.key.buffer,d.iv.buffer).then(function(T){var b=performance.now();s.trigger(F.Events.FRAG_DECRYPTED,{frag:E,payload:T,stats:{tstart:o,tdecrypt:b}})})}},x.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var w,E=this.currentTrackId,f=this.levels;if(!f.length||!f[E]||!f[E].details)return;var d=f[E].details,s=d.targetduration,o=this.config,T=this.media,b=_.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-s,o.maxBufferHole),g=b.end,P=b.len,j=this.getMaxBufferLength()+s;if(P>j)return;console.assert(d,"Subtitle track details are defined on idle subtitle stream controller tick");var H=d.fragments,X=H.length,W=d.edge,U,z=this.fragPrevious;if(g<W){var Z=o.maxFragLookUpTolerance;z&&d.hasProgramDateTime&&(U=Object(N.findFragmentByPDT)(H,z.endProgramDateTime,Z)),U||(U=Object(N.findFragmentByPTS)(z,H,g,Z),!U&&z&&z.start<H[0].start&&(U=H[0]))}else U=H[X-1];(w=U)!==null&&w!==void 0&&w.encrypted?(M.logger.log("Loading key for "+U.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(F.Events.KEY_LOADING,{frag:U})):U&&this.fragmentTracker.getState(U)===L.FragmentState.NOT_LOADED&&this.loadFragment(U,d,g)}},x.loadFragment=function(w,E,f){this.fragCurrent=w,c.prototype.loadFragment.call(this,w,E,f)},p(C,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),C}(v.default)},"./src/controller/subtitle-track-controller.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/events.ts"),M=D("./src/utils/texttrack-utils.ts"),_=D("./src/controller/base-playlist-controller.ts"),N=D("./src/types/loader.ts");function I(S,p){for(var m=0;m<p.length;m++){var l=p[m];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(S,l.key,l)}}function A(S,p,m){return p&&I(S.prototype,p),m&&I(S,m),S}function L(S,p){S.prototype=Object.create(p.prototype),S.prototype.constructor=S,v(S,p)}function v(S,p){return v=Object.setPrototypeOf||function(l,i){return l.__proto__=i,l},v(S,p)}var y=function(S){L(p,S);function p(l){var i;return i=S.call(this,l,"[subtitle-track-controller]")||this,i.media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}var m=p.prototype;return m.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,S.prototype.destroy.call(this)},m.registerListeners=function(){var i=this.hls;i.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.on(F.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){var i=this.hls;i.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.off(F.Events.ERROR,this.onError,this)},m.onMediaAttached=function(i,a){if(this.media=a.media,!this.media)return;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)},m.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},m.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var i=O(this.media.textTracks);i.forEach(function(a){Object(M.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},m.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},m.onManifestParsed=function(i,a){this.tracks=a.subtitleTracks},m.onSubtitleTrackLoaded=function(i,a){var c=a.id,C=a.details,x=this.trackId,h=this.tracksInGroup[x];if(!h){this.warn("Invalid subtitle track id "+c);return}var w=h.details;h.details=a.details,this.log("subtitle track "+c+" loaded ["+C.startSN+"-"+C.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,a,w))},m.onLevelLoading=function(i,a){this.switchLevel(a.level)},m.onLevelSwitching=function(i,a){this.switchLevel(a.level)},m.switchLevel=function(i){var a=this.hls.levels[i];if(!(a!=null&&a.textGroupIds))return;var c=a.textGroupIds[a.urlId];if(this.groupId!==c){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(E){return!c||E.groupId===c});this.tracksInGroup=x;var h=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=c;var w={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(F.Events.SUBTITLE_TRACKS_UPDATED,w),h!==-1&&this.setSubtitleTrack(h,C)}},m.findTrackId=function(i){for(var a=this.tracksInGroup,c=0;c<a.length;c++){var C=a[c];if((!this.selectDefaultTrack||C.default)&&(!i||i===C.name))return C.id}return-1},m.onError=function(i,a){if(S.prototype.onError.call(this,i,a),a.fatal||!a.context)return;a.context.type===N.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},m.loadPlaylist=function(i){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var c=a.id,C=a.groupId,x=a.url;if(i)try{x=i.addDirectives(x)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Loading subtitle playlist for id "+c),this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADING,{url:x,id:c,groupId:C,deliveryDirectives:i||null})}},m.toggleTrackModes=function(i){var a=this,c=this.media,C=this.subtitleDisplay,x=this.trackId;if(!c)return;var h=O(c.textTracks),w=h.filter(function(d){return d.groupId===a.groupId});if(i===-1)[].slice.call(h).forEach(function(d){d.mode="disabled"});else{var E=w[x];E&&(E.mode="disabled")}var f=w[i];f&&(f.mode=C?"showing":"hidden")},m.setSubtitleTrack=function(i,a){var c,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=i;return}if(this.trackId!==i&&this.toggleTrackModes(i),this.trackId===i&&(i===-1||(c=C[i])!==null&&c!==void 0&&c.details)||i<-1||i>=C.length)return;this.clearTimer();var x=C[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,x){var h=x.id,w=x.groupId,E=w===void 0?"":w,f=x.name,d=x.type,s=x.url;this.hls.trigger(F.Events.SUBTITLE_TRACK_SWITCH,{id:h,groupId:E,name:f,type:d,url:s});var o=this.switchParams(x.url,a==null?void 0:a.details);this.loadPlaylist(o)}else this.hls.trigger(F.Events.SUBTITLE_TRACK_SWITCH,{id:i})},m.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,a=O(this.media.textTracks),c=0;c<a.length;c++)if(a[c].mode==="hidden")i=c;else if(a[c].mode==="showing"){i=c;break}this.subtitleTrack!==i&&(this.subtitleTrack=i)},A(p,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(i,a)}}]),p}(_.default);function O(S){for(var p=[],m=0;m<S.length;m++){var l=S[m];l.kind==="subtitles"&&l.label&&p.push(S[m])}return p}B.default=y},"./src/controller/timeline-controller.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"TimelineController",function(){return O});var F=D("./src/polyfills/number.ts"),M=D("./src/events.ts"),_=D("./src/utils/cea-608-parser.ts"),N=D("./src/utils/output-filter.ts"),I=D("./src/utils/webvtt-parser.ts"),A=D("./src/utils/texttrack-utils.ts"),L=D("./src/utils/imsc1-ttml-parser.ts"),v=D("./src/types/loader.ts"),y=D("./src/utils/logger.ts"),O=function(){function l(a){if(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.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=m(),this.captionsProperties=void 0,this.hls=a,this.config=a.config,this.Cues=a.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}},this.config.enableCEA708Captions){var c=new N.default(this,"textTrack1"),C=new N.default(this,"textTrack2"),x=new N.default(this,"textTrack3"),h=new N.default(this,"textTrack4");this.cea608Parser1=new _.default(1,c,C),this.cea608Parser2=new _.default(3,x,h)}a.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(M.Events.FRAG_LOADING,this.onFragLoading,this),a.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=l.prototype;return i.destroy=function(){var c=this.hls;c.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.off(M.Events.FRAG_LOADING,this.onFragLoading,this),c.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.off(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},i.addCues=function(c,C,x,h,w){for(var E=!1,f=w.length;f--;){var d=w[f],s=p(d[0],d[1],C,x);if(s>=0&&(d[0]=Math.min(d[0],C),d[1]=Math.max(d[1],x),E=!0,s/(x-C)>.5))return}if(E||w.push([C,x]),this.config.renderTextTracksNatively){var o=this.captionsTracks[c];this.Cues.newCue(o,C,x,h)}else{var T=this.Cues.newCue(null,C,x,h);this.hls.trigger(M.Events.CUES_PARSED,{type:"captions",cues:T,track:c})}},i.onInitPtsFound=function(c,C){var x=this,h=C.frag,w=C.id,E=C.initPTS,f=C.timescale,d=this.unparsedVttFrags;w==="main"&&(this.initPTS[h.cc]=E,this.timescale[h.cc]=f),d.length&&(this.unparsedVttFrags=[],d.forEach(function(s){x.onFragLoaded(M.Events.FRAG_LOADED,s)}))},i.getExistingTrack=function(c){var C=this.media;if(C)for(var x=0;x<C.textTracks.length;x++){var h=C.textTracks[x];if(h[c])return h}return null},i.createCaptionsTrack=function(c){this.config.renderTextTracksNatively?this.createNativeTrack(c):this.createNonNativeTrack(c)},i.createNativeTrack=function(c){if(this.captionsTracks[c])return;var C=this.captionsProperties,x=this.captionsTracks,h=this.media,w=C[c],E=w.label,f=w.languageCode,d=this.getExistingTrack(c);if(d)x[c]=d,Object(A.clearCurrentCues)(x[c]),Object(A.sendAddTrackEvent)(x[c],h);else{var s=this.createTextTrack("captions",E,f);s&&(s[c]=!0,x[c]=s)}},i.createNonNativeTrack=function(c){if(this.nonNativeCaptionsTracks[c])return;var C=this.captionsProperties[c];if(!C)return;var x=C.label,h={_id:c,label:x,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[c]=h,this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[h]})},i.createTextTrack=function(c,C,x){var h=this.media;return h?h.addTextTrack(c,C,x):void 0},i.onMediaAttaching=function(c,C){this.media=C.media,this._cleanTracks()},i.onMediaDetaching=function(){var c=this.captionsTracks;Object.keys(c).forEach(function(C){Object(A.clearCurrentCues)(c[C]),delete c[C]}),this.nonNativeCaptionsTracks={}},i.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=m(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},i._cleanTracks=function(){var c=this.media;if(!c)return;var C=c.textTracks;if(C)for(var x=0;x<C.length;x++)Object(A.clearCurrentCues)(C[x])},i.onSubtitleTracksUpdated=function(c,C){var x=this;this.textTracks=[];var h=C.subtitleTracks||[],w=h.some(function(s){return s.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var E=this.tracks&&h&&this.tracks.length===h.length;if(this.tracks=h||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,o){var T;if(o<f.length){for(var b=null,g=0;g<f.length;g++)if(S(f[g],s)){b=f[g];break}b&&(T=b)}T?Object(A.clearCurrentCues)(T):(T=x.createTextTrack("subtitles",s.name,s.lang),T&&(T.mode="disabled")),T&&(T.groupId=s.groupId,x.textTracks.push(T))})}else if(!E&&this.tracks&&this.tracks.length){var d=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:d})}}},i.onManifestLoaded=function(c,C){var x=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(h){var w=/(?:CC|SERVICE)([1-4])/.exec(h.instreamId);if(!w)return;var E="textTrack"+w[1],f=x.captionsProperties[E];if(!f)return;f.label=h.name,h.lang&&(f.languageCode=h.lang),f.media=h})},i.onFragLoading=function(c,C){var x=this.cea608Parser1,h=this.cea608Parser2,w=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(x&&h))return;if(C.frag.type===v.PlaylistLevelType.MAIN){var f,d,s=C.frag.sn,o=(f=C==null||((d=C.part)===null||d===void 0)?void 0:d.index)!=null?f:-1;s===w+1||s===w&&o===E+1||(x.reset(),h.reset()),this.lastSn=s,this.lastPartIndex=o}},i.onFragLoaded=function(c,C){var x=C.frag,h=C.payload,w=this.initPTS,E=this.unparsedVttFrags;if(x.type===v.PlaylistLevelType.SUBTITLE)if(h.byteLength){if(!Object(F.isFiniteNumber)(w[x.cc])){E.push(C),w.length&&this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Missing initial subtitle PTS")});return}var f=x.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var d=this.tracks[x.level],s=this.vttCCs;s[x.cc]||(s[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),d&&d.textCodec===L.IMSC1_CODEC?this._parseIMSC1(x,h):this._parseVTTs(x,h,s)}}else this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},i._parseIMSC1=function(c,C){var x=this,h=this.hls;Object(L.parseIMSC1)(C,this.initPTS[c.cc],this.timescale[c.cc],function(w){x._appendCues(w,c.level),h.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(w){y.logger.log("Failed to parse IMSC1: "+w),h.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:w})})},i._parseVTTs=function(c,C,x){var h=this,w=this.hls;Object(I.parseWebVTT)(C,this.initPTS[c.cc],this.timescale[c.cc],x,c.cc,c.start,function(E){h._appendCues(E,c.level),w.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(E){h._fallbackToIMSC1(c,C),y.logger.log("Failed to parse VTT cue: "+E),w.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:E})})},i._fallbackToIMSC1=function(c,C){var x=this,h=this.tracks[c.level];h.textCodec||Object(L.parseIMSC1)(C,this.initPTS[c.cc],this.timescale[c.cc],function(){h.textCodec=L.IMSC1_CODEC,x._parseIMSC1(c,C)},function(){h.textCodec="wvtt"})},i._appendCues=function(c,C){var x=this.hls;if(this.config.renderTextTracksNatively){var h=this.textTracks[C];if(h.mode==="disabled")return;c.forEach(function(f){return Object(A.addCueToTrack)(h,f)})}else{var w=this.tracks[C],E=w.default?"default":"subtitles"+C;x.trigger(M.Events.CUES_PARSED,{type:"subtitles",cues:c,track:E})}},i.onFragDecrypted=function(c,C){var x=C.frag;if(x.type===v.PlaylistLevelType.SUBTITLE){if(!Object(F.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(M.Events.FRAG_LOADED,C)}},i.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},i.onFragParsingUserdata=function(c,C){var x=this.cea608Parser1,h=this.cea608Parser2;if(!this.enabled||!(x&&h))return;for(var w=0;w<C.samples.length;w++){var E=C.samples[w].bytes;if(E){var f=this.extractCea608Data(E);x.addData(C.samples[w].pts,f[0]),h.addData(C.samples[w].pts,f[1])}}},i.onBufferFlushing=function(c,C){var x=C.startOffset,h=C.endOffset,w=C.endOffsetSubtitles,E=C.type,f=this.media;if(!f||f.currentTime<h)return;if(!E||E==="video"){var d=this.captionsTracks;Object.keys(d).forEach(function(o){return Object(A.removeCuesInRange)(d[o],x,h)})}if(this.config.renderTextTracksNatively&&(x===0&&w!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(o){return Object(A.removeCuesInRange)(s[o],x,w)})}},i.extractCea608Data=function(c){for(var C=c[0]&31,x=2,h=[[],[]],w=0;w<C;w++){var E=c[x++],f=127&c[x++],d=127&c[x++],s=(4&E)!==0,o=3&E;if(f===0&&d===0)continue;s&&((o===0||o===1)&&(h[o].push(f),h[o].push(d)))}return h},l}();function S(l,i){return l&&l.label===i.name&&!(l.textTrack1||l.textTrack2)}function p(l,i,a,c){return Math.min(i,c)-Math.max(l,a)}function m(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return F});var F=function(){function M(N,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=N,this.aesIV=I}var _=M.prototype;return _.decrypt=function(I,A){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},A,I)},M}()},"./src/crypt/aes-decryptor.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"removePadding",function(){return M}),D.d(B,"default",function(){return _});var F=D("./src/utils/typed-array.ts");function M(N){var I=N.byteLength,A=I&&new DataView(N.buffer).getUint8(I-1);return A?Object(F.sliceUint8)(N,0,I-A):N}var _=function(){function N(){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()}var I=N.prototype;return I.uint8ArrayToUint32Array_=function(L){for(var v=new DataView(L),y=new Uint32Array(4),O=0;O<4;O++)y[O]=v.getUint32(O*4);return y},I.initTable=function(){var L=this.sBox,v=this.invSBox,y=this.subMix,O=y[0],S=y[1],p=y[2],m=y[3],l=this.invSubMix,i=l[0],a=l[1],c=l[2],C=l[3],x=new Uint32Array(256),h=0,w=0,E=0;for(E=0;E<256;E++)E<128?x[E]=E<<1:x[E]=E<<1^283;for(E=0;E<256;E++){var f=w^w<<1^w<<2^w<<3^w<<4;f=f>>>8^f&255^99,L[h]=f,v[f]=h;var d=x[h],s=x[d],o=x[s],T=x[f]*257^f*16843008;O[h]=T<<24|T>>>8,S[h]=T<<16|T>>>16,p[h]=T<<8|T>>>24,m[h]=T,T=o*16843009^s*65537^d*257^h*16843008,i[f]=T<<24|T>>>8,a[f]=T<<16|T>>>16,c[f]=T<<8|T>>>24,C[f]=T,h?(h=d^x[x[x[o^d]]],w^=x[x[w]]):h=w=1}},I.expandKey=function(L){for(var v=this.uint8ArrayToUint32Array_(L),y=!0,O=0;O<v.length&&y;)y=v[O]===this.key[O],O++;if(y)return;this.key=v;var S=this.keySize=v.length;if(S!==4&&S!==6&&S!==8)throw new Error("Invalid aes key size="+S);var p=this.ksRows=(S+6+1)*4,m,l,i=this.keySchedule=new Uint32Array(p),a=this.invKeySchedule=new Uint32Array(p),c=this.sBox,C=this.rcon,x=this.invSubMix,h=x[0],w=x[1],E=x[2],f=x[3],d,s;for(m=0;m<p;m++){if(m<S){d=i[m]=v[m];continue}s=d,m%S===0?(s=s<<8|s>>>24,s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255],s^=C[m/S|0]<<24):S>6&&m%S===4&&(s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255]),i[m]=d=(i[m-S]^s)>>>0}for(l=0;l<p;l++)m=p-l,l&3?s=i[m]:s=i[m-4],l<4||m<=4?a[l]=s:a[l]=h[c[s>>>24]]^w[c[s>>>16&255]]^E[c[s>>>8&255]]^f[c[s&255]],a[l]=a[l]>>>0},I.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},I.decrypt=function(L,v,y){for(var O=this.keySize+6,S=this.invKeySchedule,p=this.invSBox,m=this.invSubMix,l=m[0],i=m[1],a=m[2],c=m[3],C=this.uint8ArrayToUint32Array_(y),x=C[0],h=C[1],w=C[2],E=C[3],f=new Int32Array(L),d=new Int32Array(f.length),s,o,T,b,g,P,j,H,X,W,U,z,Z,q,oe=this.networkToHostOrderSwap;v<f.length;){for(X=oe(f[v]),W=oe(f[v+1]),U=oe(f[v+2]),z=oe(f[v+3]),g=X^S[0],P=z^S[1],j=U^S[2],H=W^S[3],Z=4,q=1;q<O;q++)s=l[g>>>24]^i[P>>16&255]^a[j>>8&255]^c[H&255]^S[Z],o=l[P>>>24]^i[j>>16&255]^a[H>>8&255]^c[g&255]^S[Z+1],T=l[j>>>24]^i[H>>16&255]^a[g>>8&255]^c[P&255]^S[Z+2],b=l[H>>>24]^i[g>>16&255]^a[P>>8&255]^c[j&255]^S[Z+3],g=s,P=o,j=T,H=b,Z=Z+4;s=p[g>>>24]<<24^p[P>>16&255]<<16^p[j>>8&255]<<8^p[H&255]^S[Z],o=p[P>>>24]<<24^p[j>>16&255]<<16^p[H>>8&255]<<8^p[g&255]^S[Z+1],T=p[j>>>24]<<24^p[H>>16&255]<<16^p[g>>8&255]<<8^p[P&255]^S[Z+2],b=p[H>>>24]<<24^p[g>>16&255]<<16^p[P>>8&255]<<8^p[j&255]^S[Z+3],d[v]=oe(s^x),d[v+1]=oe(b^h),d[v+2]=oe(T^w),d[v+3]=oe(o^E),x=X,h=W,w=U,E=z,v=v+4}return d.buffer},N}()},"./src/crypt/decrypter.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return v});var F=D("./src/crypt/aes-crypto.ts"),M=D("./src/crypt/fast-aes-key.ts"),_=D("./src/crypt/aes-decryptor.ts"),N=D("./src/utils/logger.ts"),I=D("./src/utils/mp4-tools.ts"),A=D("./src/utils/typed-array.ts"),L=16,v=function(){function y(S,p,m){var l=m===void 0?{}:m,i=l.removePKCS7Padding,a=i===void 0?!0:i;if(this.logEnabled=!0,this.observer=void 0,this.config=void 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.observer=S,this.config=p,this.removePKCS7Padding=a,a)try{var c=self.crypto;c&&(this.subtle=c.subtle||c.webkitSubtle)}catch(C){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var O=y.prototype;return O.destroy=function(){this.observer=null},O.isSync=function(){return this.config.enableSoftwareAES},O.flush=function(){var p=this.currentResult;if(!p){this.reset();return}var m=new Uint8Array(p);return this.reset(),this.removePKCS7Padding?Object(_.removePadding)(m):m},O.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},O.decrypt=function(p,m,l,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(p),m,l);var a=this.flush();a&&i(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(p),m,l).then(i)},O.softwareDecrypt=function(p,m,l){var i=this.currentIV,a=this.currentResult,c=this.remainderData;this.logOnce("JS AES decrypt"),c&&(p=Object(I.appendUint8Array)(c,p),this.remainderData=null);var C=this.getValidChunk(p);if(!C.length)return null;i&&(l=i);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new _.default),x.expandKey(m);var h=a;return this.currentResult=x.decrypt(C.buffer,0,l),this.currentIV=Object(A.sliceUint8)(C,-16).buffer,h||null},O.webCryptoDecrypt=function(p,m,l){var i=this,a=this.subtle;return(this.key!==m||!this.fastAesKey)&&(this.key=m,this.fastAesKey=new M.default(a,m)),this.fastAesKey.expandKey().then(function(c){if(!a)return Promise.reject(new Error("web crypto not initialized"));var C=new F.default(a,l);return C.decrypt(p.buffer,c)}).catch(function(c){return i.onWebCryptoError(c,p,m,l)})},O.onWebCryptoError=function(p,m,l,i){return N.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",p),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(m,l,i)},O.getValidChunk=function(p){var m=p,l=p.length-p.length%L;return l!==p.length&&(m=Object(A.sliceUint8)(p,0,l),this.remainderData=Object(A.sliceUint8)(p,l)),m},O.logOnce=function(p){if(!this.logEnabled)return;N.logger.log("[decrypter.ts]: "+p),this.logEnabled=!1},y}()},"./src/crypt/fast-aes-key.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return F});var F=function(){function M(N,I){this.subtle=void 0,this.key=void 0,this.subtle=N,this.key=I}var _=M.prototype;return _.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},M}()},"./src/demux/aacdemuxer.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/demux/base-audio-demuxer.ts"),M=D("./src/demux/adts.ts"),_=D("./src/utils/logger.ts"),N=D("./src/demux/id3.ts");function I(v,y){v.prototype=Object.create(y.prototype),v.prototype.constructor=v,A(v,y)}function A(v,y){return A=Object.setPrototypeOf||function(S,p){return S.__proto__=p,S},A(v,y)}var L=function(v){I(y,v);function y(S,p){var m;return m=v.call(this)||this,m.observer=void 0,m.config=void 0,m.observer=S,m.config=p,m}var O=y.prototype;return O.resetInitSegment=function(p,m,l){v.prototype.resetInitSegment.call(this,p,m,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:p,duration:l,inputTimeScale:9e4,dropped:0}},y.probe=function(p){if(!p)return!1;for(var m=N.getID3Data(p,0)||[],l=m.length,i=p.length;l<i;l++)if(M.probe(p,l))return _.logger.log("ADTS sync word found !"),!0;return!1},O.canParse=function(p,m){return M.canParse(p,m)},O.appendFrame=function(p,m,l){M.initTrackConfig(p,this.observer,m,l,p.manifestCodec);var i=M.appendFrame(p,m,l,this.initPTS,this.frameIndex);if(i&&i.missing===0)return i},y}(F.default);L.minProbeByteLength=9,B.default=L},"./src/demux/adts.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"getAudioConfig",function(){return N}),D.d(B,"isHeaderPattern",function(){return I}),D.d(B,"getHeaderLength",function(){return A}),D.d(B,"getFullFrameLength",function(){return L}),D.d(B,"canGetFrameLength",function(){return v}),D.d(B,"isHeader",function(){return y}),D.d(B,"canParse",function(){return O}),D.d(B,"probe",function(){return S}),D.d(B,"initTrackConfig",function(){return p}),D.d(B,"getFrameDuration",function(){return m}),D.d(B,"parseFrameHeader",function(){return l}),D.d(B,"appendFrame",function(){return i});var F=D("./src/utils/logger.ts"),M=D("./src/errors.ts"),_=D("./src/events.ts");function N(a,c,C,x){var h,w,E,f,d=navigator.userAgent.toLowerCase(),s=x,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];h=((c[C+2]&192)>>>6)+1;var T=(c[C+2]&60)>>>2;if(T>o.length-1){a.trigger(_.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return E=(c[C+2]&1)<<2,E|=(c[C+3]&192)>>>6,F.logger.log("manifest codec:"+x+", ADTS type:"+h+", samplingIndex:"+T),/firefox/i.test(d)?T>=6?(h=5,f=new Array(4),w=T-3):(h=2,f=new Array(2),w=T):d.indexOf("android")!==-1?(h=2,f=new Array(2),w=T):(h=5,f=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&T>=6?w=T-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(T>=6&&E===1||/vivaldi/i.test(d))||!x&&E===1)&&(h=2,f=new Array(2)),w=T)),f[0]=h<<3,f[0]|=(T&14)>>1,f[1]|=(T&1)<<7,f[1]|=E<<3,h===5&&(f[1]|=(w&14)>>1,f[2]=(w&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:o[T],channelCount:E,codec:"mp4a.40."+h,manifestCodec:s}}function I(a,c){return a[c]===255&&(a[c+1]&246)===240}function A(a,c){return a[c+1]&1?7:9}function L(a,c){return(a[c+3]&3)<<11|a[c+4]<<3|(a[c+5]&224)>>>5}function v(a,c){return c+5<a.length}function y(a,c){return c+1<a.length&&I(a,c)}function O(a,c){return v(a,c)&&I(a,c)&&L(a,c)<=a.length-c}function S(a,c){if(y(a,c)){var C=A(a,c);if(c+C>=a.length)return!1;var x=L(a,c);if(x<=C)return!1;var h=c+x;return h===a.length||y(a,h)}return!1}function p(a,c,C,x,h){if(!a.samplerate){var w=N(c,C,x,h);if(!w)return;a.config=w.config,a.samplerate=w.samplerate,a.channelCount=w.channelCount,a.codec=w.codec,a.manifestCodec=w.manifestCodec,F.logger.log("parsed codec:"+a.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function m(a){return 1024*9e4/a}function l(a,c,C,x,h){var w=A(a,c),E=L(a,c);if(E-=w,E>0){var f=C+x*h;return{headerLength:w,frameLength:E,stamp:f}}}function i(a,c,C,x,h){var w=m(a.samplerate),E=l(c,C,x,h,w);if(E){var f=E.frameLength,d=E.headerLength,s=E.stamp,o=d+f,T=Math.max(0,C+o-c.length),b;T?(b=new Uint8Array(o-d),b.set(c.subarray(C+d,c.length),0)):b=c.subarray(C+d,C+o);var g={unit:b,pts:s};return T||a.samples.push(g),{sample:g,length:o,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"initPTSFn",function(){return L});var F=D("./src/polyfills/number.ts"),M=D("./src/demux/id3.ts"),_=D("./src/demux/dummy-demuxed-track.ts"),N=D("./src/utils/mp4-tools.ts"),I=D("./src/utils/typed-array.ts"),A=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var y=v.prototype;return y.resetInitSegment=function(S,p,m){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},y.resetTimeStamp=function(){},y.resetContiguity=function(){},y.canParse=function(S,p){return!1},y.appendFrame=function(S,p,m){},y.demux=function(S,p){this.cachedData&&(S=Object(N.appendUint8Array)(this.cachedData,S),this.cachedData=null);var m=M.getID3Data(S,0),l=m?m.length:0,i,a,c=this._audioTrack,C=this._id3Track,x=m?M.getTimeStamp(m):void 0,h=S.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(x,p)),m&&m.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:m}),a=this.initPTS;l<h;){if(this.canParse(S,l)){var w=this.appendFrame(c,S,l);w?(this.frameIndex++,a=w.sample.pts,l+=w.length,i=l):l=h}else M.canParse(S,l)?(m=M.getID3Data(S,l),C.samples.push({pts:a,dts:a,data:m}),l+=m.length,i=l):l++;if(l===h&&i!==h){var E=Object(I.sliceUint8)(S,i);this.cachedData?this.cachedData=Object(N.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:c,avcTrack:Object(_.dummyTrack)(),id3Track:C,textTrack:Object(_.dummyTrack)()}},y.demuxSampleAes=function(S,p,m){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},y.flush=function(S){var p=this.cachedData;return p&&(this.cachedData=null,this.demux(p,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(_.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(_.dummyTrack)()}},y.destroy=function(){},v}(),L=function(y,O){return Object(F.isFiniteNumber)(y)?y*90:O*9e4};B.default=A},"./src/demux/chunk-cache.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return F});var F=function(){function _(){this.chunks=[],this.dataLength=0}var N=_.prototype;return N.push=function(A){this.chunks.push(A),this.dataLength+=A.length},N.flush=function(){var A=this.chunks,L=this.dataLength,v;if(A.length)A.length===1?v=A[0]:v=M(A,L);else return new Uint8Array(0);return this.reset(),v},N.reset=function(){this.chunks.length=0,this.dataLength=0},_}();function M(_,N){for(var I=new Uint8Array(N),A=0,L=0;L<_.length;L++){var v=_[L];I.set(v,A),A+=v.length}return I}},"./src/demux/dummy-demuxed-track.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"dummyTrack",function(){return F});function F(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/utils/logger.ts"),M=function(){function _(I){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=I,this.bytesAvailable=I.byteLength,this.word=0,this.bitsAvailable=0}var N=_.prototype;return N.loadWord=function(){var A=this.data,L=this.bytesAvailable,v=A.byteLength-L,y=new Uint8Array(4),O=Math.min(4,L);if(O===0)throw new Error("no bytes available");y.set(A.subarray(v,v+O)),this.word=new DataView(y.buffer).getUint32(0),this.bitsAvailable=O*8,this.bytesAvailable-=O},N.skipBits=function(A){var L;this.bitsAvailable>A?(this.word<<=A,this.bitsAvailable-=A):(A-=this.bitsAvailable,L=A>>3,A-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=A,this.bitsAvailable-=A)},N.readBits=function(A){var L=Math.min(this.bitsAvailable,A),v=this.word>>>32-L;return A>32&&F.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=A-L,L>0&&this.bitsAvailable?v<<L|this.readBits(L):v},N.skipLZ=function(){var A;for(A=0;A<this.bitsAvailable;++A)if((this.word&2147483648>>>A)!==0)return this.word<<=A,this.bitsAvailable-=A,A;return this.loadWord(),A+this.skipLZ()},N.skipUEG=function(){this.skipBits(1+this.skipLZ())},N.skipEG=function(){this.skipBits(1+this.skipLZ())},N.readUEG=function(){var A=this.skipLZ();return this.readBits(A+1)-1},N.readEG=function(){var A=this.readUEG();return 1&A?1+A>>>1:-1*(A>>>1)},N.readBoolean=function(){return this.readBits(1)===1},N.readUByte=function(){return this.readBits(8)},N.readUShort=function(){return this.readBits(16)},N.readUInt=function(){return this.readBits(32)},N.skipScalingList=function(A){for(var L=8,v=8,y,O=0;O<A;O++)v!==0&&(y=this.readEG(),v=(L+y+256)%256),L=v===0?L:v},N.readSPS=function(){var A=0,L=0,v=0,y=0,O,S,p,m=this.readUByte.bind(this),l=this.readBits.bind(this),i=this.readUEG.bind(this),a=this.readBoolean.bind(this),c=this.skipBits.bind(this),C=this.skipEG.bind(this),x=this.skipUEG.bind(this),h=this.skipScalingList.bind(this);m();var w=m();if(l(5),c(3),m(),x(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var E=i();if(E===3&&c(1),x(),x(),c(1),a())for(S=E!==3?8:12,p=0;p<S;p++)a()&&(p<6?h(16):h(64))}x();var f=i();if(f===0)i();else if(f===1)for(c(1),C(),C(),O=i(),p=0;p<O;p++)C();x(),c(1);var d=i(),s=i(),o=l(1);o===0&&c(1),c(1),a()&&(A=i(),L=i(),v=i(),y=i());var T=[1,1];if(a()&&a()){var b=m();switch(b){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[m()<<8|m(),m()<<8|m()];break}}}return{width:Math.ceil((d+1)*16-A*2-L*2),height:(2-o)*(s+1)*16-(o?2:4)*(v+y),pixelRatio:T}},N.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},_}();B.default=M},"./src/demux/id3.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"isHeader",function(){return F}),D.d(B,"isFooter",function(){return M}),D.d(B,"getID3Data",function(){return _}),D.d(B,"canParse",function(){return I}),D.d(B,"getTimeStamp",function(){return A}),D.d(B,"isTimeStampFrame",function(){return L}),D.d(B,"getID3Frames",function(){return y}),D.d(B,"decodeFrame",function(){return O}),D.d(B,"utf8ArrayToStr",function(){return i}),D.d(B,"testables",function(){return a});var F=function(h,w){return w+10<=h.length&&(h[w]===73&&h[w+1]===68&&h[w+2]===51&&(h[w+3]<255&&h[w+4]<255&&(h[w+6]<128&&h[w+7]<128&&h[w+8]<128&&h[w+9]<128)))},M=function(h,w){return w+10<=h.length&&(h[w]===51&&h[w+1]===68&&h[w+2]===73&&(h[w+3]<255&&h[w+4]<255&&(h[w+6]<128&&h[w+7]<128&&h[w+8]<128&&h[w+9]<128)))},_=function(h,w){for(var E=w,f=0;F(h,w);){f+=10;var d=N(h,w+6);f+=d,M(h,w+10)&&(f+=10),w+=f}return f>0?h.subarray(E,E+f):void 0},N=function(h,w){var E=0;return E=(h[w]&127)<<21,E|=(h[w+1]&127)<<14,E|=(h[w+2]&127)<<7,E|=h[w+3]&127,E},I=function(h,w){return F(h,w)&&N(h,w+6)+10<=h.length-w},A=function(h){for(var w=y(h),E=0;E<w.length;E++){var f=w[E];if(L(f))return l(f)}return},L=function(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"},v=function(h){var w=String.fromCharCode(h[0],h[1],h[2],h[3]),E=N(h,4),f=10;return{type:w,size:E,data:h.subarray(f,f+E)}},y=function(h){for(var w=0,E=[];F(h,w);){var f=N(h,w+6);w+=10;for(var d=w+f;w+8<d;){var s=v(h.subarray(w)),o=O(s);o&&E.push(o),w+=s.size+10}M(h,w)&&(w+=10)}return E},O=function(h){return h.type==="PRIV"?S(h):h.type[0]==="W"?m(h):p(h)},S=function(h){if(h.size<2)return;var w=i(h.data,!0),E=new Uint8Array(h.data.subarray(w.length+1));return{key:h.type,info:w,data:E.buffer}},p=function(h){if(h.size<2)return;if(h.type==="TXXX"){var w=1,E=i(h.data.subarray(w),!0);w+=E.length+1;var f=i(h.data.subarray(w));return{key:h.type,info:E,data:f}}var d=i(h.data.subarray(1));return{key:h.type,data:d}},m=function(h){if(h.type==="WXXX"){if(h.size<2)return;var w=1,E=i(h.data.subarray(w),!0);w+=E.length+1;var f=i(h.data.subarray(w));return{key:h.type,info:E,data:f}}var d=i(h.data);return{key:h.type,data:d}},l=function(h){if(h.data.byteLength===8){var w=new Uint8Array(h.data),E=w[3]&1,f=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return f/=45,E&&(f+=4772185884e-2),Math.round(f)}return},i=function(h,w){w===void 0&&(w=!1);var E=C();if(E){var f=E.decode(h);if(w){var d=f.indexOf("\0");return d!==-1?f.substring(0,d):f}return f.replace(/\0/g,"")}for(var s=h.length,o,T,b,g="",P=0;P<s;){if(o=h[P++],o===0&&w)return g;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:g+=String.fromCharCode(o);break;case 12:case 13:T=h[P++],g+=String.fromCharCode((o&31)<<6|T&63);break;case 14:T=h[P++],b=h[P++],g+=String.fromCharCode((o&15)<<12|(T&63)<<6|(b&63)<<0);break;default:}}return g},a={decodeTextFrame:p},c;function C(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/demux/base-audio-demuxer.ts"),M=D("./src/demux/id3.ts"),_=D("./src/utils/logger.ts"),N=D("./src/demux/mpegaudio.ts");function I(v,y){v.prototype=Object.create(y.prototype),v.prototype.constructor=v,A(v,y)}function A(v,y){return A=Object.setPrototypeOf||function(S,p){return S.__proto__=p,S},A(v,y)}var L=function(v){I(y,v);function y(){return v.apply(this,arguments)||this}var O=y.prototype;return O.resetInitSegment=function(p,m,l){v.prototype.resetInitSegment.call(this,p,m,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:p,duration:l,inputTimeScale:9e4,dropped:0}},y.probe=function(p){if(!p)return!1;for(var m=M.getID3Data(p,0)||[],l=m.length,i=p.length;l<i;l++)if(N.probe(p,l))return _.logger.log("MPEG Audio sync word found !"),!0;return!1},O.canParse=function(p,m){return N.canParse(p,m)},O.appendFrame=function(p,m,l){return this.initPTS===null?void 0:N.appendFrame(p,m,l,this.initPTS,this.frameIndex)},y}(F.default);L.minProbeByteLength=4,B.default=L},"./src/demux/mp4demuxer.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/utils/mp4-tools.ts"),M=D("./src/demux/dummy-demuxed-track.ts"),_=function(){function N(A,L){this.remainderData=null,this.config=void 0,this.config=L}var I=N.prototype;return I.resetTimeStamp=function(){},I.resetInitSegment=function(){},I.resetContiguity=function(){},N.probe=function(L){return Object(F.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},I.demux=function(L){var v=L,y=Object(M.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(F.appendUint8Array)(this.remainderData,L));var O=Object(F.segmentValidRange)(v);this.remainderData=O.remainder,y.samples=O.valid||new Uint8Array}else y.samples=v;return{audioTrack:Object(M.dummyTrack)(),avcTrack:y,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},I.flush=function(){var L=Object(M.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(M.dummyTrack)(),avcTrack:L,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},I.demuxSampleAes=function(L,v,y){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},I.destroy=function(){},N}();_.minProbeByteLength=1024,B.default=_},"./src/demux/mpegaudio.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"appendFrame",function(){return A}),D.d(B,"parseHeader",function(){return L}),D.d(B,"isHeaderPattern",function(){return v}),D.d(B,"isHeader",function(){return y}),D.d(B,"canParse",function(){return O}),D.d(B,"probe",function(){return S});var F=null,M=[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],_=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],N=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function A(p,m,l,i,a){if(l+24>m.length)return;var c=L(m,l);if(c&&l+c.frameLength<=m.length){var C=c.samplesPerFrame*9e4/c.sampleRate,x=i+a*C,h={unit:m.subarray(l,l+c.frameLength),pts:x,dts:x};return p.config=[],p.channelCount=c.channelCount,p.samplerate=c.sampleRate,p.samples.push(h),{sample:h,length:c.frameLength,missing:0}}}function L(p,m){var l=p[m+1]>>3&3,i=p[m+1]>>1&3,a=p[m+2]>>4&15,c=p[m+2]>>2&3;if(l!==1&&a!==0&&a!==15&&c!==3){var C=p[m+2]>>1&1,x=p[m+3]>>6,h=l===3?3-i:i===3?3:4,w=M[h*14+a-1]*1e3,E=l===3?0:l===2?1:2,f=_[E*3+c],d=x===3?1:2,s=N[l][i],o=I[i],T=s*8*o,b=Math.floor(s*w/f+C)*o;if(F===null){var g=navigator.userAgent||"",P=g.match(/Chrome\/(\d+)/i);F=P?parseInt(P[1]):0}var j=!!F&&F<=87;return j&&i===2&&w>=224e3&&x===0&&(p[m+3]=p[m+3]|128),{sampleRate:f,channelCount:d,frameLength:b,samplesPerFrame:T}}}function v(p,m){return p[m]===255&&(p[m+1]&224)===224&&(p[m+1]&6)!==0}function y(p,m){return m+1<p.length&&v(p,m)}function O(p,m){var l=4;return v(p,m)&&l<=p.length-m}function S(p,m){if(m+1<p.length&&v(p,m)){var l=4,i=L(p,m),a=l;i!=null&&i.frameLength&&(a=i.frameLength);var c=m+a;return c===p.length||y(p,c)}return!1}},"./src/demux/sample-aes.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/crypt/decrypter.ts"),M=D("./src/demux/tsdemuxer.ts"),_=function(){function N(A,L,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new F.default(A,L,{removePKCS7Padding:!1})}var I=N.prototype;return I.decryptBuffer=function(L,v){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,v)},I.decryptAacSample=function(L,v,y,O){var S=L[v].unit,p=S.subarray(16,S.length-S.length%16),m=p.buffer.slice(p.byteOffset,p.byteOffset+p.length),l=this;this.decryptBuffer(m,function(i){var a=new Uint8Array(i);S.set(a,16),O||l.decryptAacSamples(L,v+1,y)})},I.decryptAacSamples=function(L,v,y){for(;;v++){if(v>=L.length){y();return}if(L[v].unit.length<32)continue;var O=this.decrypter.isSync();if(this.decryptAacSample(L,v,y,O),!O)return}},I.getAvcEncryptedData=function(L){for(var v=Math.floor((L.length-48)/160)*16+16,y=new Int8Array(v),O=0,S=32;S<=L.length-16;S+=160,O+=16)y.set(L.subarray(S,S+16),O);return y},I.getAvcDecryptedUnit=function(L,v){for(var y=new Uint8Array(v),O=0,S=32;S<=L.length-16;S+=160,O+=16)L.set(y.subarray(O,O+16),S);return L},I.decryptAvcSample=function(L,v,y,O,S,p){var m=Object(M.discardEPB)(S.data),l=this.getAvcEncryptedData(m),i=this;this.decryptBuffer(l.buffer,function(a){S.data=i.getAvcDecryptedUnit(m,a),p||i.decryptAvcSamples(L,v,y+1,O)})},I.decryptAvcSamples=function(L,v,y,O){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,y=0){if(v>=L.length){O();return}for(var S=L[v].units;!(y>=S.length);y++){var p=S[y];if(p.data.length<=48||p.type!==1&&p.type!==5)continue;var m=this.decrypter.isSync();if(this.decryptAvcSample(L,v,y,O,p,m),!m)return}}},N}();B.default=_},"./src/demux/transmuxer-interface.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return S});var F=D("./node_modules/webworkify-webpack/index.js"),M=D.n(F),_=D("./src/events.ts"),N=D("./src/demux/transmuxer.ts"),I=D("./src/utils/logger.ts"),A=D("./src/errors.ts"),L=D("./src/utils/mediasource-helper.ts"),v=D("./node_modules/eventemitter3/index.js"),y=D.n(v),O=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},S=function(){function p(l,i,a,c){var C=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=i,this.onTransmuxComplete=a,this.onFlush=c;var x=l.config,h=function(s,o){o=o||{},o.frag=C.frag,o.id=C.id,l.trigger(s,o)};this.observer=new v.EventEmitter,this.observer.on(_.Events.FRAG_DECRYPTED,h),this.observer.on(_.Events.ERROR,h);var w={mp4:O.isTypeSupported("video/mp4"),mpeg:O.isTypeSupported("audio/mpeg"),mp3:O.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){I.logger.log("demuxing in webworker");var f;try{f=this.worker=F("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(d){l.trigger(_.Events.ERROR,{type:A.ErrorTypes.OTHER_ERROR,details:A.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(d.message+" ("+d.filename+":"+d.lineno+")")})},f.postMessage({cmd:"init",typeSupported:w,vendor:E,id:i,config:JSON.stringify(x)})}catch(d){I.logger.warn("Error in worker:",d),I.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new N.default(this.observer,w,x,E,i),this.worker=null}}else this.transmuxer=new N.default(this.observer,w,x,E,i)}var m=p.prototype;return m.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var c=this.observer;c&&c.removeAllListeners(),this.observer=null},m.push=function(i,a,c,C,x,h,w,E,f,d){var s=this;f.transmuxing.start=self.performance.now();var o=this.transmuxer,T=this.worker,b=h?h.start:x.start,g=x.decryptdata,P=this.frag,j=!(P&&x.cc===P.cc),H=!(P&&f.level===P.level),X=P?f.sn-P.sn:-1,W=this.part?f.part-this.part.index:1,U=!H&&(X===1||X===0&&W===1),z=self.performance.now();(H||X||x.stats.parsing.start===0)&&(x.stats.parsing.start=z),h&&(W||!U)&&(h.stats.parsing.start=z);var Z=new N.TransmuxState(j,U,E,H,b);if(!U||j){I.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
|
|
discontinuity: `+j+`
|
|
trackSwitch: `+H+`
|
|
contiguous: `+U+`
|
|
accurateTimeOffset: `+E+`
|
|
timeOffset: `+b);var q=new N.TransmuxConfig(c,C,a,w,d);this.configureTransmuxer(q)}if(this.frag=x,this.part=h,T)T.postMessage({cmd:"demux",data:i,decryptdata:g,chunkMeta:f,state:Z},i instanceof ArrayBuffer?[i]:[]);else if(o){var oe=o.push(i,g,f,Z);Object(N.isPromise)(oe)?oe.then(function(ye){s.handleTransmuxComplete(ye)}):this.handleTransmuxComplete(oe)}},m.flush=function(i){var a=this;i.transmuxing.start=self.performance.now();var c=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:i});else if(c){var x=c.flush(i);Object(N.isPromise)(x)?x.then(function(h){a.handleFlushResult(h,i)}):this.handleFlushResult(x,i)}},m.handleFlushResult=function(i,a){var c=this;i.forEach(function(C){c.handleTransmuxComplete(C)}),this.onFlush(a)},m.onWorkerMessage=function(i){var a=i.data,c=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,c.trigger(a.event,a.data);break}}},m.configureTransmuxer=function(i){var a=this.worker,c=this.transmuxer;a?a.postMessage({cmd:"configure",config:i}):c&&c.configure(i)},m.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},p}()},"./src/demux/transmuxer-worker.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return A});var F=D("./src/demux/transmuxer.ts"),M=D("./src/events.ts"),_=D("./src/utils/logger.ts"),N=D("./node_modules/eventemitter3/index.js"),I=D.n(N);function A(S){var p=new N.EventEmitter,m=function(i,a){S.postMessage({event:i,data:a})};p.on(M.Events.FRAG_DECRYPTED,m),p.on(M.Events.ERROR,m),S.addEventListener("message",function(l){var i=l.data;switch(i.cmd){case"init":{var a=JSON.parse(i.config);S.transmuxer=new F.default(p,i.typeSupported,a,i.vendor,i.id),Object(_.enableLogs)(a.debug),m("init",null);break}case"configure":{S.transmuxer.configure(i.config);break}case"demux":{var c=S.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(F.isPromise)(c)?c.then(function(h){L(S,h)}):L(S,c);break}case"flush":{var C=i.chunkMeta,x=S.transmuxer.flush(C);Object(F.isPromise)(x)?x.then(function(h){y(S,h,C)}):y(S,x,C);break}default:break}})}function L(S,p){if(O(p.remuxResult))return;var m=[],l=p.remuxResult,i=l.audio,a=l.video;i&&v(m,i),a&&v(m,a),S.postMessage({event:"transmuxComplete",data:p},m)}function v(S,p){p.data1&&S.push(p.data1.buffer),p.data2&&S.push(p.data2.buffer)}function y(S,p,m){p.forEach(function(l){L(S,l)}),S.postMessage({event:"flush",data:m})}function O(S){return!S.audio&&!S.video&&!S.text&&!S.id3&&!S.initSegment}},"./src/demux/transmuxer.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return a}),D.d(B,"isPromise",function(){return x}),D.d(B,"TransmuxConfig",function(){return h}),D.d(B,"TransmuxState",function(){return w});var F=D("./src/events.ts"),M=D("./src/errors.ts"),_=D("./src/crypt/decrypter.ts"),N=D("./src/demux/aacdemuxer.ts"),I=D("./src/demux/mp4demuxer.ts"),A=D("./src/demux/tsdemuxer.ts"),L=D("./src/demux/mp3demuxer.ts"),v=D("./src/remux/mp4-remuxer.ts"),y=D("./src/remux/passthrough-remuxer.ts"),O=D("./src/demux/chunk-cache.ts"),S=D("./src/utils/mp4-tools.ts"),p=D("./src/utils/logger.ts"),m;try{m=self.performance.now.bind(self.performance)}catch(E){p.logger.debug("Unable to use Performance API on this environment"),m=self.Date.now}var l=[{demux:A.default,remux:v.default},{demux:I.default,remux:y.default},{demux:N.default,remux:v.default},{demux:L.default,remux:v.default}],i=1024;l.forEach(function(E){var f=E.demux;i=Math.max(i,f.minProbeByteLength)});var a=function(){function E(d,s,o,T,b){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=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.cache=new O.default,this.observer=d,this.typeSupported=s,this.config=o,this.vendor=T,this.id=b}var f=E.prototype;return f.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},f.push=function(s,o,T,b){var g=this,P=T.transmuxing;P.executeStart=m();var j=new Uint8Array(s),H=this.cache,X=this.config,W=this.currentTransmuxState,U=this.transmuxConfig;b&&(this.currentTransmuxState=b);var z=c(j,o);if(z&&z.method==="AES-128"){var Z=this.getDecrypter();if(X.enableSoftwareAES){var q=Z.softwareDecrypt(j,z.key.buffer,z.iv.buffer);if(!q)return P.executeEnd=m(),C(T);j=new Uint8Array(q)}else return this.decryptionPromise=Z.webCryptoDecrypt(j,z.key.buffer,z.iv.buffer).then(function(Ke){var $e=g.push(Ke,null,T);return g.decryptionPromise=null,$e}),this.decryptionPromise}var oe=b||W,ye=oe.contiguous,me=oe.discontinuity,fe=oe.trackSwitch,ve=oe.accurateTimeOffset,ge=oe.timeOffset,ae=U.audioCodec,se=U.videoCodec,Te=U.defaultInitPts,We=U.duration,Je=U.initSegmentData;if((me||fe)&&this.resetInitSegment(Je,ae,se,We),me&&this.resetInitialTimestamp(Te),ye||this.resetContiguity(),this.needsProbing(j,me,fe)){if(H.dataLength){var Ye=H.flush();j=Object(S.appendUint8Array)(Ye,j)}this.configureTransmuxer(j,U)}var Ze=this.transmux(j,z,ge,ve,T),ze=this.currentTransmuxState;return ze.contiguous=!0,ze.discontinuity=!1,ze.trackSwitch=!1,P.executeEnd=m(),Ze},f.flush=function(s){var o=this,T=s.transmuxing;T.executeStart=m();var b=this.decrypter,g=this.cache,P=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return o.flush(s)});var H=[],X=P.timeOffset;if(b){var W=b.flush();W&&H.push(this.push(W,null,s))}var U=g.dataLength;g.reset();var z=this.demuxer,Z=this.remuxer;if(!z||!Z)return U>=i&&this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=m(),[C(s)];var q=z.flush(X);return x(q)?q.then(function(oe){return o.flushRemux(H,oe,s),H}):(this.flushRemux(H,q,s),H)},f.flushRemux=function(s,o,T){var b=o.audioTrack,g=o.avcTrack,P=o.id3Track,j=o.textTrack,H=this.currentTransmuxState,X=H.accurateTimeOffset,W=H.timeOffset;p.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var U=this.remuxer.remux(b,g,P,j,W,X,!0,this.id);s.push({remuxResult:U,chunkMeta:T}),T.transmuxing.executeEnd=m()},f.resetInitialTimestamp=function(s){var o=this.demuxer,T=this.remuxer;if(!o||!T)return;o.resetTimeStamp(s),T.resetTimeStamp(s)},f.resetContiguity=function(){var s=this.demuxer,o=this.remuxer;if(!s||!o)return;s.resetContiguity(),o.resetNextTimestamp()},f.resetInitSegment=function(s,o,T,b){var g=this.demuxer,P=this.remuxer;if(!g||!P)return;g.resetInitSegment(o,T,b),P.resetInitSegment(s,o,T)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(s,o,T,b,g){var P;return o&&o.method==="SAMPLE-AES"?P=this.transmuxSampleAes(s,o,T,b,g):P=this.transmuxUnencrypted(s,T,b,g),P},f.transmuxUnencrypted=function(s,o,T,b){var g=this.demuxer.demux(s,o,!1,!this.config.progressive),P=g.audioTrack,j=g.avcTrack,H=g.id3Track,X=g.textTrack,W=this.remuxer.remux(P,j,H,X,o,T,!1,this.id);return{remuxResult:W,chunkMeta:b}},f.transmuxSampleAes=function(s,o,T,b,g){var P=this;return this.demuxer.demuxSampleAes(s,o,T).then(function(j){var H=P.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,T,b,!1,P.id);return{remuxResult:H,chunkMeta:g}})},f.configureTransmuxer=function(s,o){for(var T=this.config,b=this.observer,g=this.typeSupported,P=this.vendor,j=o.audioCodec,H=o.defaultInitPts,X=o.duration,W=o.initSegmentData,U=o.videoCodec,z,Z=0,q=l.length;Z<q;Z++)if(l[Z].demux.probe(s)){z=l[Z];break}z||(p.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:I.default,remux:y.default});var oe=this.demuxer,ye=this.remuxer,me=z.remux,fe=z.demux;(!ye||!(ye instanceof me))&&(this.remuxer=new me(b,T,g,P)),(!oe||!(oe instanceof fe))&&(this.demuxer=new fe(b,T,g),this.probe=fe.probe),this.resetInitSegment(W,j,U,X),this.resetInitialTimestamp(H)},f.needsProbing=function(s,o,T){return!this.demuxer||!this.remuxer||o||T},f.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new _.default(this.observer,this.config)),s},E}();function c(E,f){var d=null;return E.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(d=f),d}var C=function(f){return{remuxResult:{},chunkMeta:f}};function x(E){return"then"in E&&E.then instanceof Function}var h=function(f,d,s,o,T){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=d,this.initSegmentData=s,this.duration=o,this.defaultInitPts=T},w=function(f,d,s,o,T){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=d,this.accurateTimeOffset=s,this.trackSwitch=o,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"discardEPB",function(){return C});var F=D("./src/demux/adts.ts"),M=D("./src/demux/mpegaudio.ts"),_=D("./src/demux/exp-golomb.ts"),N=D("./src/demux/id3.ts"),I=D("./src/demux/sample-aes.ts"),A=D("./src/events.ts"),L=D("./src/utils/mp4-tools.ts"),v=D("./src/utils/logger.ts"),y=D("./src/errors.ts"),O={video:1,audio:2,id3:3,text:4},S=function(){function x(w,E,f){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._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=w,this.config=E,this.typeSupported=f}x.probe=function(E){var f=x.syncOffset(E);return f<0?!1:(f&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},x.syncOffset=function(E){for(var f=Math.min(1e3,E.length-3*188),d=0;d<f;){if(E[d]===71&&E[d+188]===71&&E[d+2*188]===71)return d;d++}return-1},x.createTrack=function(E,f){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:O[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?f:void 0}};var h=x.prototype;return h.resetInitSegment=function(E,f,d){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",d),this._audioTrack=x.createTrack("audio",d),this._id3Track=x.createTrack("id3",d),this._txtTrack=x.createTrack("text",d),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=E,this.videoCodec=f,this._duration=d},h.resetTimeStamp=function(){},h.resetContiguity=function(){var E=this._audioTrack,f=this._avcTrack,d=this._id3Track;E&&(E.pesData=null),f&&(f.pesData=null),d&&(d.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},h.demux=function(E,f,d,s){d===void 0&&(d=!1),s===void 0&&(s=!1),d||(this.sampleAes=null);var o,T=this._avcTrack,b=this._audioTrack,g=this._id3Track,P=T.pid,j=T.pesData,H=b.pid,X=g.pid,W=b.pesData,U=g.pesData,z=!1,Z=this.pmtParsed,q=this._pmtId,oe=E.length;if(this.remainderData&&(E=Object(L.appendUint8Array)(this.remainderData,E),oe=E.length,this.remainderData=null),oe<188&&!s)return this.remainderData=E,{audioTrack:b,avcTrack:T,id3Track:g,textTrack:this._txtTrack};var ye=Math.max(0,x.syncOffset(E));oe-=(oe+ye)%188,oe<E.byteLength&&!s&&(this.remainderData=new Uint8Array(E.buffer,oe,E.buffer.byteLength-oe));for(var me=ye;me<oe;me+=188)if(E[me]===71){var fe=!!(E[me+1]&64),ve=((E[me+1]&31)<<8)+E[me+2],ge=(E[me+3]&48)>>4,ae=void 0;if(ge>1){if(ae=me+5+E[me+4],ae===me+188)continue}else ae=me+4;switch(ve){case P:fe&&(j&&(o=i(j))&&this.parseAVCPES(o,!1),j={data:[],size:0}),j&&(j.data.push(E.subarray(ae,me+188)),j.size+=me+188-ae);break;case H:fe&&(W&&(o=i(W))&&(b.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),W={data:[],size:0}),W&&(W.data.push(E.subarray(ae,me+188)),W.size+=me+188-ae);break;case X:fe&&(U&&(o=i(U))&&this.parseID3PES(o),U={data:[],size:0}),U&&(U.data.push(E.subarray(ae,me+188)),U.size+=me+188-ae);break;case 0:fe&&(ae+=E[ae]+1),q=this._pmtId=m(E,ae);break;case q:{fe&&(ae+=E[ae]+1);var se=l(E,ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,d);P=se.avc,P>0&&(T.pid=P),H=se.audio,H>0&&(b.pid=H,b.isAAC=se.isAAC),X=se.id3,X>0&&(g.pid=X),z&&!Z&&(v.logger.log("reparse from beginning"),z=!1,me=ye-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=j,b.pesData=W,g.pesData=U;var Te={audioTrack:b,avcTrack:T,id3Track:g,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(Te),Te},h.flush=function(){var E=this.remainderData;this.remainderData=null;var f;return E?f=this.demux(E,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},h.extractRemainingSamples=function(E){var f=E.audioTrack,d=E.avcTrack,s=E.id3Track,o=d.pesData,T=f.pesData,b=s.pesData,g;o&&(g=i(o))?(this.parseAVCPES(g,!0),d.pesData=null):d.pesData=o,T&&(g=i(T))?(f.isAAC?this.parseAACPES(g):this.parseMPEGPES(g),f.pesData=null):(T!=null&&T.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=T),b&&(g=i(b))?(this.parseID3PES(g),s.pesData=null):s.pesData=b},h.demuxSampleAes=function(E,f,d){var s=this.demux(E,d,!0,!this.config.progressive),o=this.sampleAes=new I.default(this.observer,this.config,f);return this.decrypt(s,o)},h.decrypt=function(E,f){return new Promise(function(d){var s=E.audioTrack,o=E.avcTrack;s.samples&&s.isAAC?f.decryptAacSamples(s.samples,0,function(){o.samples?f.decryptAvcSamples(o.samples,0,0,function(){d(E)}):d(E)}):o.samples&&f.decryptAvcSamples(o.samples,0,0,function(){d(E)})})},h.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},h.parseAVCPES=function(E,f){var d=this,s=this._avcTrack,o=this.parseAVCNALu(E.data),T=!1,b=this.avcSample,g,P=!1;E.data=null,b&&o.length&&!s.audFound&&(a(b,s),b=this.avcSample=p(!1,E.pts,E.dts,"")),o.forEach(function(j){switch(j.type){case 1:{g=!0,b||(b=d.avcSample=p(!0,E.pts,E.dts,"")),T&&(b.debug+="NDR "),b.frame=!0;var H=j.data;if(P&&H.length>4){var X=new _.default(H).readSliceType();(X===2||X===4||X===7||X===9)&&(b.key=!0)}break}case 5:g=!0,b||(b=d.avcSample=p(!0,E.pts,E.dts,"")),T&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{g=!0,T&&b&&(b.debug+="SEI ");var W=new _.default(C(j.data));W.readUByte();for(var U=0,z=0,Z=!1,q=0;!Z&&W.bytesAvailable>1;){U=0;do q=W.readUByte(),U+=q;while(q===255);z=0;do q=W.readUByte(),z+=q;while(q===255);if(U===4&&W.bytesAvailable!==0){Z=!0;var oe=W.readUByte();if(oe===181){var ye=W.readUShort();if(ye===49){var me=W.readUInt();if(me===1195456820){var fe=W.readUByte();if(fe===3){for(var ve=W.readUByte(),ge=W.readUByte(),ae=31&ve,se=[ve,ge],Te=0;Te<ae;Te++)se.push(W.readUByte()),se.push(W.readUByte()),se.push(W.readUByte());c(d._txtTrack.samples,{type:3,pts:E.pts,bytes:se})}}}}}else if(U===5&&W.bytesAvailable!==0){if(Z=!0,z>16){for(var We=[],Je=0;Je<16;Je++)We.push(W.readUByte().toString(16)),(Je===3||Je===5||Je===7||Je===9)&&We.push("-");for(var Ye=z-16,Ze=new Uint8Array(Ye),ze=0;ze<Ye;ze++)Ze[ze]=W.readUByte();c(d._txtTrack.samples,{pts:E.pts,payloadType:U,uuid:We.join(""),userData:Object(N.utf8ArrayToStr)(Ze),userDataBytes:Ze})}}else if(z<W.bytesAvailable)for(var Ke=0;Ke<z;Ke++)W.readUByte()}break}case 7:if(g=!0,P=!0,T&&b&&(b.debug+="SPS "),!s.sps){var $e=new _.default(j.data),Qe=$e.readSPS();s.width=Qe.width,s.height=Qe.height,s.pixelRatio=Qe.pixelRatio,s.sps=[j.data],s.duration=d._duration;for(var nt=j.data.subarray(1,4),Xe="avc1.",He=0;He<3;He++){var st=nt[He].toString(16);st.length<2&&(st="0"+st),Xe+=st}s.codec=Xe}break;case 8:g=!0,T&&b&&(b.debug+="PPS "),s.pps||(s.pps=[j.data]);break;case 9:g=!1,s.audFound=!0,b&&a(b,s),b=d.avcSample=p(!1,E.pts,E.dts,T?"AUD ":"");break;case 12:g=!1;break;default:g=!1,b&&(b.debug+="unknown NAL "+j.type+" ");break}if(b&&g){var ft=b.units;ft.push(j)}}),f&&b&&(a(b,s),this.avcSample=null)},h.getLastNalUnit=function(){var E,f=this.avcSample,d;if(!f||f.units.length===0){var s=this._avcTrack.samples;f=s[s.length-1]}if((E=f)!==null&&E!==void 0&&E.units){var o=f.units;d=o[o.length-1]}return d},h.parseAVCNALu=function(E){var f=E.byteLength,d=this._avcTrack,s=d.naluState||0,o=s,T=[],b=0,g,P,j,H=-1,X=0;for(s===-1&&(H=0,X=E[0]&31,s=0,b=1);b<f;){if(g=E[b++],!s){s=g?0:1;continue}if(s===1){s=g?0:2;continue}if(!g)s=3;else if(g===1){if(H>=0){var W={data:E.subarray(H,b-s-1),type:X};T.push(W)}else{var U=this.getLastNalUnit();if(U&&(o&&b<=4-o&&(U.state&&(U.data=U.data.subarray(0,U.data.byteLength-o))),P=b-s-1,P>0)){var z=new Uint8Array(U.data.byteLength+P);z.set(U.data,0),z.set(E.subarray(0,P),U.data.byteLength),U.data=z,U.state=0}}b<f?(j=E[b]&31,H=b,X=j,s=0):s=-1}else s=0}if(H>=0&&s>=0){var Z={data:E.subarray(H,f),type:X,state:s};T.push(Z)}if(T.length===0){var q=this.getLastNalUnit();if(q){var oe=new Uint8Array(q.data.byteLength+E.byteLength);oe.set(q.data,0),oe.set(E,q.data.byteLength),q.data=oe}}return d.naluState=s,T},h.parseAACPES=function(E){var f=0,d=this._audioTrack,s=this.aacOverFlow,o=E.data;if(s){this.aacOverFlow=null;var T=s.sample.unit.byteLength,b=Math.min(s.missing,T),g=T-b;s.sample.unit.set(o.subarray(0,b),g),d.samples.push(s.sample),f=s.missing}var P,j;for(P=f,j=o.length;P<j-1&&!F.isHeader(o,P);P++);if(P!==f){var H,X;if(P<j-1?(H="AAC PES did not start with ADTS header,offset:"+P,X=!1):(H="no ADTS header found in AAC PES",X=!0),v.logger.warn("parsing error:"+H),this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:X,reason:H}),X)return}F.initTrackConfig(d,this.observer,o,P,this.audioCodec);var W;if(E.pts!==void 0)W=E.pts;else if(s){var U=F.getFrameDuration(d.samplerate);W=s.sample.pts+U}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;P<j;)if(F.isHeader(o,P)){if(P+5<j){var Z=F.appendFrame(d,o,P,W,z);if(Z)if(Z.missing)this.aacOverFlow=Z;else{P+=Z.length,z++;continue}}break}else P++},h.parseMPEGPES=function(E){var f=E.data,d=f.length,s=0,o=0,T=E.pts;if(T===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<d;)if(M.isHeader(f,o)){var b=M.appendFrame(this._audioTrack,f,o,T,s);if(b)o+=b.length,s++;else break}else o++},h.parseID3PES=function(E){if(E.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},x}();S.minProbeByteLength=188;function p(x,h,w,E){return{key:x,frame:!1,pts:h,dts:w,units:[],debug:E,length:0}}function m(x,h){return(x[h+10]&31)<<8|x[h+11]}function l(x,h,w,E){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},d=(x[h+1]&15)<<8|x[h+2],s=h+3+d-4,o=(x[h+10]&15)<<8|x[h+11];for(h+=12+o;h<s;){var T=(x[h+1]&31)<<8|x[h+2];switch(x[h]){case 207:if(!E){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=T);break;case 21:f.id3===-1&&(f.id3=T);break;case 219:if(!E){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=T);break;case 3:case 4:w?f.audio===-1&&(f.audio=T,f.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}h+=((x[h+3]&15)<<8|x[h+4])+5}return f}function i(x){var h=0,w,E,f,d,s,o=x.data;if(!x||x.size===0)return null;for(;o[0].length<19&&o.length>1;){var T=new Uint8Array(o[0].length+o[1].length);T.set(o[0]),T.set(o[1],o[0].length),o[0]=T,o.splice(1,1)}w=o[0];var b=(w[0]<<16)+(w[1]<<8)+w[2];if(b===1){if(E=(w[4]<<8)+w[5],E&&E>x.size-6)return null;var g=w[7];g&192&&(d=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,g&64?(s=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,d-s>60*9e4&&(v.logger.warn(Math.round((d-s)/9e4)+"s delta between PTS and DTS, align them"),d=s)):s=d),f=w[8];var P=f+9;if(x.size<=P)return null;x.size-=P;for(var j=new Uint8Array(x.size),H=0,X=o.length;H<X;H++){w=o[H];var W=w.byteLength;if(P)if(P>W){P-=W;continue}else w=w.subarray(P),W-=P,P=0;j.set(w,h),h+=W}return E&&(E-=f+3),{data:j,pts:d,dts:s,len:E}}return null}function a(x,h){if(x.units.length&&x.frame){if(x.pts===void 0){var w=h.samples,E=w.length;if(E){var f=w[E-1];x.pts=f.pts,x.dts=f.dts}else{h.dropped++;return}}h.samples.push(x)}x.debug.length&&v.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function c(x,h){var w=x.length;if(w>0){if(h.pts>=x[w-1].pts)x.push(h);else for(var E=w-1;E>=0;E--)if(h.pts<x[E].pts){x.splice(E,0,h);break}}else x.push(h)}function C(x){for(var h=x.byteLength,w=[],E=1;E<h-2;)x[E]===0&&x[E+1]===0&&x[E+2]===3?(w.push(E+2),E+=2):E++;if(w.length===0)return x;var f=h-w.length,d=new Uint8Array(f),s=0;for(E=0;E<f;s++,E++)s===w[0]&&(s++,w.shift()),d[E]=x[s];return d}B.default=S},"./src/errors.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"ErrorTypes",function(){return F}),D.d(B,"ErrorDetails",function(){return M});var F;(function(_){_.NETWORK_ERROR="networkError",_.MEDIA_ERROR="mediaError",_.KEY_SYSTEM_ERROR="keySystemError",_.MUX_ERROR="muxError",_.OTHER_ERROR="otherError"})(F||(F={}));var M;(function(_){_.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",_.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",_.KEY_SYSTEM_NO_SESSION="keySystemNoSession",_.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",_.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",_.MANIFEST_LOAD_ERROR="manifestLoadError",_.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",_.MANIFEST_PARSING_ERROR="manifestParsingError",_.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",_.LEVEL_EMPTY_ERROR="levelEmptyError",_.LEVEL_LOAD_ERROR="levelLoadError",_.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",_.LEVEL_SWITCH_ERROR="levelSwitchError",_.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",_.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",_.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",_.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",_.FRAG_LOAD_ERROR="fragLoadError",_.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",_.FRAG_DECRYPT_ERROR="fragDecryptError",_.FRAG_PARSING_ERROR="fragParsingError",_.REMUX_ALLOC_ERROR="remuxAllocError",_.KEY_LOAD_ERROR="keyLoadError",_.KEY_LOAD_TIMEOUT="keyLoadTimeOut",_.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",_.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",_.BUFFER_APPEND_ERROR="bufferAppendError",_.BUFFER_APPENDING_ERROR="bufferAppendingError",_.BUFFER_STALLED_ERROR="bufferStalledError",_.BUFFER_FULL_ERROR="bufferFullError",_.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",_.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",_.INTERNAL_EXCEPTION="internalException",_.INTERNAL_ABORTED="aborted",_.UNKNOWN="unknown"})(M||(M={}))},"./src/events.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"Events",function(){return F});var F;(function(M){M.MEDIA_ATTACHING="hlsMediaAttaching",M.MEDIA_ATTACHED="hlsMediaAttached",M.MEDIA_DETACHING="hlsMediaDetaching",M.MEDIA_DETACHED="hlsMediaDetached",M.BUFFER_RESET="hlsBufferReset",M.BUFFER_CODECS="hlsBufferCodecs",M.BUFFER_CREATED="hlsBufferCreated",M.BUFFER_APPENDING="hlsBufferAppending",M.BUFFER_APPENDED="hlsBufferAppended",M.BUFFER_EOS="hlsBufferEos",M.BUFFER_FLUSHING="hlsBufferFlushing",M.BUFFER_FLUSHED="hlsBufferFlushed",M.MANIFEST_LOADING="hlsManifestLoading",M.MANIFEST_LOADED="hlsManifestLoaded",M.MANIFEST_PARSED="hlsManifestParsed",M.LEVEL_SWITCHING="hlsLevelSwitching",M.LEVEL_SWITCHED="hlsLevelSwitched",M.LEVEL_LOADING="hlsLevelLoading",M.LEVEL_LOADED="hlsLevelLoaded",M.LEVEL_UPDATED="hlsLevelUpdated",M.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",M.LEVELS_UPDATED="hlsLevelsUpdated",M.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",M.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",M.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",M.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",M.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",M.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",M.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",M.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",M.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",M.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",M.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",M.CUES_PARSED="hlsCuesParsed",M.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",M.INIT_PTS_FOUND="hlsInitPtsFound",M.FRAG_LOADING="hlsFragLoading",M.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",M.FRAG_LOADED="hlsFragLoaded",M.FRAG_DECRYPTED="hlsFragDecrypted",M.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",M.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",M.FRAG_PARSING_METADATA="hlsFragParsingMetadata",M.FRAG_PARSED="hlsFragParsed",M.FRAG_BUFFERED="hlsFragBuffered",M.FRAG_CHANGED="hlsFragChanged",M.FPS_DROP="hlsFpsDrop",M.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",M.ERROR="hlsError",M.DESTROYING="hlsDestroying",M.KEY_LOADING="hlsKeyLoading",M.KEY_LOADED="hlsKeyLoaded",M.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",M.BACK_BUFFER_REACHED="hlsBackBufferReached"})(F||(F={}))},"./src/hls.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return x});var F=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(F),_=D("./src/loader/playlist-loader.ts"),N=D("./src/loader/key-loader.ts"),I=D("./src/controller/id3-track-controller.ts"),A=D("./src/controller/latency-controller.ts"),L=D("./src/controller/level-controller.ts"),v=D("./src/controller/fragment-tracker.ts"),y=D("./src/controller/stream-controller.ts"),O=D("./src/is-supported.ts"),S=D("./src/utils/logger.ts"),p=D("./src/config.ts"),m=D("./node_modules/eventemitter3/index.js"),l=D.n(m),i=D("./src/events.ts"),a=D("./src/errors.ts");function c(h,w){for(var E=0;E<w.length;E++){var f=w[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}function C(h,w,E){return w&&c(h.prototype,w),E&&c(h,E),h}var x=function(){h.isSupported=function(){return Object(O.isSupported)()};function h(E){E===void 0&&(E={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new m.EventEmitter,this._autoLevelCapping=void 0,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.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var f=this.config=Object(p.mergeConfig)(h.DefaultConfig,E);this.userConfig=E,Object(S.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(p.enableStreamingMode)(f);var d=f.abrController,s=f.bufferController,o=f.capLevelController,T=f.fpsController,b=this.abrController=new d(this),g=this.bufferController=new s(this),P=this.capLevelController=new o(this),j=new T(this),H=new _.default(this),X=new N.default(this),W=new I.default(this),U=this.levelController=new L.default(this),z=new v.FragmentTracker(this),Z=this.streamController=new y.default(this,z);P.setStreamController(Z),j.setStreamController(Z);var q=[U,Z];this.networkControllers=q;var oe=[H,X,b,g,P,j,W,z];this.audioTrackController=this.createController(f.audioTrackController,null,q),this.createController(f.audioStreamController,z,q),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,q),this.createController(f.subtitleStreamController,z,q),this.createController(f.timelineController,null,oe),this.emeController=this.createController(f.emeController,null,oe),this.cmcdController=this.createController(f.cmcdController,null,oe),this.latencyController=this.createController(A.default,null,oe),this.coreComponents=oe}var w=h.prototype;return w.createController=function(f,d,s){if(f){var o=d?new f(this,d):new f(this);return s&&s.push(o),o}return null},w.on=function(f,d,s){s===void 0&&(s=this),this._emitter.on(f,d,s)},w.once=function(f,d,s){s===void 0&&(s=this),this._emitter.once(f,d,s)},w.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},w.off=function(f,d,s,o){s===void 0&&(s=this),this._emitter.off(f,d,s,o)},w.listeners=function(f){return this._emitter.listeners(f)},w.emit=function(f,d,s){return this._emitter.emit(f,d,s)},w.trigger=function(f,d){if(this.config.debug)return this.emit(f,f,d);try{return this.emit(f,f,d)}catch(s){S.logger.error("An internal error happened while handling event "+f+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(i.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:s})}return!1},w.listenerCount=function(f){return this._emitter.listenerCount(f)},w.destroy=function(){S.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},w.attachMedia=function(f){S.logger.log("attachMedia"),this._media=f,this.trigger(i.Events.MEDIA_ATTACHING,{media:f})},w.detachMedia=function(){S.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(f){this.stopLoad();var d=this.media,s=this.url,o=this.url=F.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});S.logger.log("loadSource:"+o),d&&s&&s!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(d)),this.trigger(i.Events.MANIFEST_LOADING,{url:f})},w.startLoad=function(f){f===void 0&&(f=-1),S.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(d){d.startLoad(f)})},w.stopLoad=function(){S.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},w.swapAudioCodec=function(){S.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){S.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},w.removeLevel=function(f,d){d===void 0&&(d=0),this.levelController.removeLevel(f,d)},C(h,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){S.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){S.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){S.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){S.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){S.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var d=!!f;d!==this.config.capLevelToPlayerSize&&(d?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=d)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(S.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,d=this.config.minAutoBitrate;if(!f)return 0;for(var s=f.length,o=0;o<s;o++)if(f[o].maxBitrate>d)return o;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,d=this.autoLevelCapping,s;return d===-1&&f&&f.length?s=f.length-1:s=d,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var d=this.audioTrackController;d&&(d.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var d=this.subtitleTrackController;d&&(d.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var d=this.subtitleTrackController;d&&(d.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return h.defaultConfig?h.defaultConfig:p.hlsDefaultConfig},set:function(f){h.defaultConfig=f}}]),h}();x.defaultConfig=void 0},"./src/is-supported.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"isSupported",function(){return _}),D.d(B,"changeTypeSupported",function(){return N});var F=D("./src/utils/mediasource-helper.ts");function M(){return self.SourceBuffer||self.WebKitSourceBuffer}function _(){var I=Object(F.getMediaSource)();if(!I)return!1;var A=M(),L=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!A||A.prototype&&typeof A.prototype.appendBuffer=="function"&&typeof A.prototype.remove=="function";return!!L&&!!v}function N(){var I,A=M();return typeof(A==null||((I=A.prototype)===null||I===void 0)?void 0:I.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return S}),D.d(B,"LoadError",function(){return m});var F=D("./src/polyfills/number.ts"),M=D("./src/errors.ts");function _(l,i){l.prototype=Object.create(i.prototype),l.prototype.constructor=l,v(l,i)}function N(l){var i=typeof Map=="function"?new Map:void 0;return N=function(c){if(c===null||!L(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(c))return i.get(c);i.set(c,C)}function C(){return I(c,arguments,y(this).constructor)}return C.prototype=Object.create(c.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),v(C,c)},N(l)}function I(l,i,a){return A()?I=Reflect.construct:I=function(C,x,h){var w=[null];w.push.apply(w,x);var E=Function.bind.apply(C,w),f=new E;return h&&v(f,h.prototype),f},I.apply(null,arguments)}function A(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function L(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function v(l,i){return v=Object.setPrototypeOf||function(c,C){return c.__proto__=C,c},v(l,i)}function y(l){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},y(l)}var O=Math.pow(2,17),S=function(){function l(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var i=l.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(c,C){var x=this,h=c.url;if(!h)return Promise.reject(new m({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(h?"part list":"url")));this.abort();var w=this.config,E=w.fLoader,f=w.loader;return new Promise(function(d,s){x.loader&&x.loader.destroy();var o=x.loader=c.loader=E?new E(w):new f(w),T=p(c),b={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:O};c.stats=o.stats,o.load(T,b,{onSuccess:function(P,j,H,X){x.resetLoader(c,o),d({frag:c,part:null,payload:P.data,networkDetails:X})},onError:function(P,j,H){x.resetLoader(c,o),s(new m({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:P,networkDetails:H}))},onAbort:function(P,j,H){x.resetLoader(c,o),s(new m({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:H}))},onTimeout:function(P,j,H){x.resetLoader(c,o),s(new m({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:H}))},onProgress:function(P,j,H,X){C&&C({frag:c,part:null,payload:H,networkDetails:X})}})})},i.loadPart=function(c,C,x){var h=this;this.abort();var w=this.config,E=w.fLoader,f=w.loader;return new Promise(function(d,s){h.loader&&h.loader.destroy();var o=h.loader=c.loader=E?new E(w):new f(w),T=p(c,C),b={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:O};C.stats=o.stats,o.load(T,b,{onSuccess:function(P,j,H,X){h.resetLoader(c,o),h.updateStatsFromPart(c,C);var W={frag:c,part:C,payload:P.data,networkDetails:X};x(W),d(W)},onError:function(P,j,H){h.resetLoader(c,o),s(new m({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:C,response:P,networkDetails:H}))},onAbort:function(P,j,H){c.stats.aborted=C.stats.aborted,h.resetLoader(c,o),s(new m({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:C,networkDetails:H}))},onTimeout:function(P,j,H){h.resetLoader(c,o),s(new m({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:C,networkDetails:H}))}})})},i.updateStatsFromPart=function(c,C){var x=c.stats,h=C.stats,w=h.total;if(x.loaded+=h.loaded,w){var E=Math.round(c.duration/C.duration),f=Math.min(Math.round(x.loaded/w),E),d=E-f,s=d*Math.round(x.loaded/f);x.total=x.loaded+s}else x.total=Math.max(x.loaded,x.total);var o=x.loading,T=h.loading;o.start?o.first+=T.first-T.start:(o.start=T.start,o.first=T.first),o.end=T.end},i.resetLoader=function(c,C){c.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},l}();function p(l,i){i===void 0&&(i=null);var a=i||l,c={frag:l,part:i,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},C=a.byteRangeStartOffset,x=a.byteRangeEndOffset;return Object(F.isFiniteNumber)(C)&&Object(F.isFiniteNumber)(x)&&(c.rangeStart=C,c.rangeEnd=x),c}var m=function(l){_(i,l);function i(a){for(var c,C=arguments.length,x=new Array(C>1?C-1:0),h=1;h<C;h++)x[h-1]=arguments[h];return c=l.call.apply(l,[this].concat(x))||this,c.data=void 0,c.data=a,c}return i}(N(Error))},"./src/loader/fragment.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"ElementaryStreamTypes",function(){return S}),D.d(B,"BaseSegment",function(){return p}),D.d(B,"Fragment",function(){return m}),D.d(B,"Part",function(){return l});var F=D("./src/polyfills/number.ts"),M=D("./node_modules/url-toolkit/src/url-toolkit.js"),_=D.n(M),N=D("./src/utils/logger.ts"),I=D("./src/loader/level-key.ts"),A=D("./src/loader/load-stats.ts");function L(i,a){i.prototype=Object.create(a.prototype),i.prototype.constructor=i,v(i,a)}function v(i,a){return v=Object.setPrototypeOf||function(C,x){return C.__proto__=x,C},v(i,a)}function y(i,a){for(var c=0;c<a.length;c++){var C=a[c];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(i,C.key,C)}}function O(i,a,c){return a&&y(i.prototype,a),c&&y(i,c),i}var S;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(S||(S={}));var p=function(){function i(c){var C;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(C={},C[S.AUDIO]=null,C[S.VIDEO]=null,C[S.AUDIOVIDEO]=null,C),this.baseurl=c}var a=i.prototype;return a.setByteRange=function(C,x){var h=C.split("@",2),w=[];h.length===1?w[0]=x?x.byteRangeEndOffset:0:w[0]=parseInt(h[1]),w[1]=parseInt(h[0])+w[0],this._byteRange=w},O(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(M.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(C){this._url=C}}]),i}(),m=function(i){L(a,i);function a(C,x){var h;return h=i.call(this,x)||this,h._decryptdata=null,h.rawProgramDateTime=null,h.programDateTime=null,h.tagList=[],h.duration=0,h.sn=0,h.levelkey=void 0,h.type=void 0,h.loader=null,h.level=-1,h.cc=0,h.startPTS=void 0,h.endPTS=void 0,h.appendedPTS=void 0,h.startDTS=void 0,h.endDTS=void 0,h.start=0,h.deltaPTS=void 0,h.maxStartPTS=void 0,h.minEndPTS=void 0,h.stats=new A.LoadStats,h.urlId=0,h.data=void 0,h.bitrateTest=!1,h.title=null,h.initSegment=null,h.type=C,h}var c=a.prototype;return c.createInitializationVector=function(x){for(var h=new Uint8Array(16),w=12;w<16;w++)h[w]=x>>8*(15-w)&255;return h},c.setDecryptDataFromLevelKey=function(x,h){var w=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(w=I.LevelKey.fromURI(x.uri),w.method=x.method,w.iv=this.createInitializationVector(h),w.keyFormat="identity"),w},c.setElementaryStreamInfo=function(x,h,w,E,f,d){d===void 0&&(d=!1);var s=this.elementaryStreams,o=s[x];if(!o){s[x]={startPTS:h,endPTS:w,startDTS:E,endDTS:f,partial:d};return}o.startPTS=Math.min(o.startPTS,h),o.endPTS=Math.max(o.endPTS,w),o.startDTS=Math.min(o.startDTS,E),o.endDTS=Math.max(o.endDTS,f)},c.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[S.AUDIO]=null,x[S.VIDEO]=null,x[S.AUDIOVIDEO]=null},O(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&N.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(F.isFiniteNumber)(this.programDateTime))return null;var x=Object(F.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),a}(p),l=function(i){L(a,i);function a(c,C,x,h,w){var E;E=i.call(this,x)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new A.LoadStats,E.duration=c.decimalFloatingPoint("DURATION"),E.gap=c.bool("GAP"),E.independent=c.bool("INDEPENDENT"),E.relurl=c.enumeratedString("URI"),E.fragment=C,E.index=h;var f=c.enumeratedString("BYTERANGE");return f&&E.setByteRange(f,w),w&&(E.fragOffset=w.fragOffset+w.duration),E}return O(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),a}(p)},"./src/loader/key-loader.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return N});var F=D("./src/events.ts"),M=D("./src/errors.ts"),_=D("./src/utils/logger.ts"),N=function(){function I(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var A=I.prototype;return A._registerListeners=function(){this.hls.on(F.Events.KEY_LOADING,this.onKeyLoading,this)},A._unregisterListeners=function(){this.hls.off(F.Events.KEY_LOADING,this.onKeyLoading)},A.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var y=this.loaders[v];y&&y.destroy()}this.loaders={}},A.onKeyLoading=function(v,y){var O=y.frag,S=O.type,p=this.loaders[S];if(!O.decryptdata){_.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var m=O.decryptdata.uri;if(m!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(p&&(_.logger.warn("abort previous key loader for type:"+S),p.abort()),!m){_.logger.warn("key uri is falsy");return}var i=l.loader,a=O.loader=this.loaders[S]=new i(l);this.decrypturl=m,this.decryptkey=null;var c={url:m,frag:O,responseType:"arraybuffer"},C={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(c,C,x)}else this.decryptkey&&(O.decryptdata.key=this.decryptkey,this.hls.trigger(F.Events.KEY_LOADED,{frag:O}))},A.loadsuccess=function(v,y,O){var S=O.frag;if(!S.decryptdata){_.logger.error("after key load, decryptdata unset");return}this.decryptkey=S.decryptdata.key=new Uint8Array(v.data),S.loader=null,delete this.loaders[S.type],this.hls.trigger(F.Events.KEY_LOADED,{frag:S})},A.loaderror=function(v,y){var O=y.frag,S=O.loader;S&&S.abort(),delete this.loaders[O.type],this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:O,response:v})},A.loadtimeout=function(v,y){var O=y.frag,S=O.loader;S&&S.abort(),delete this.loaders[O.type],this.hls.trigger(F.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:O})},I}()},"./src/loader/level-details.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"LevelDetails",function(){return I});var F=D("./src/polyfills/number.ts");function M(A,L){for(var v=0;v<L.length;v++){var y=L[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(A,y.key,y)}}function _(A,L,v){return L&&M(A.prototype,L),v&&M(A,v),A}var N=10,I=function(){function A(v){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.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,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.fragments=[],this.url=v}var L=A.prototype;return L.reloaded=function(y){if(!y){this.advanced=!0,this.updated=!0;return}var O=this.lastPartSn-y.lastPartSn,S=this.lastPartIndex-y.lastPartIndex;this.updated=this.endSN!==y.endSN||!!S||!!O,this.advanced=this.endSN>y.endSN||O>0||O===0&&S>0,this.updated||this.advanced?this.misses=Math.floor(y.misses*.6):this.misses=y.misses+1,this.availabilityDelay=y.availabilityDelay},_(A,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(F.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||N}},{key:"drift",get:function(){var y=this.driftEndTime-this.driftStartTime;if(y>0){var O=this.driftEnd-this.driftStart;return O*1e3/y}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var y;return(y=this.fragments)!==null&&y!==void 0&&y.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),A}()},"./src/loader/level-key.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"LevelKey",function(){return I});var F=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(F);function _(A,L){for(var v=0;v<L.length;v++){var y=L[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(A,y.key,y)}}function N(A,L,v){return L&&_(A.prototype,L),v&&_(A,v),A}var I=function(){A.fromURL=function(v,y){return new A(v,y)},A.fromURI=function(v){return new A(v)};function A(L,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(F.buildAbsoluteURL)(L,v,{alwaysNormalize:!0}):this._uri=L}return N(A,[{key:"uri",get:function(){return this._uri}}]),A}()},"./src/loader/load-stats.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"LoadStats",function(){return F});var F=function(){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}}},"./src/loader/m3u8-parser.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return a});var F=D("./src/polyfills/number.ts"),M=D("./node_modules/url-toolkit/src/url-toolkit.js"),_=D.n(M),N=D("./src/loader/fragment.ts"),I=D("./src/loader/level-details.ts"),A=D("./src/loader/level-key.ts"),L=D("./src/utils/attr-list.ts"),v=D("./src/utils/logger.ts"),y=D("./src/utils/codecs.ts"),O=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,S=/#EXT-X-MEDIA:(.*)/g,p=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),m=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function i(w){var E,f;return l.test((E=(f=M.parseURL(w))===null||f===void 0?void 0:f.path)!=null?E:"")}var a=function(){function w(){}return w.findGroup=function(f,d){for(var s=0;s<f.length;s++){var o=f[s];if(o.id===d)return o}},w.convertAVC1ToAVCOTI=function(f){var d=f.split(".");if(d.length>2){var s=d.shift()+".";return s+=parseInt(d.shift()).toString(16),s+=("000"+parseInt(d.shift()).toString(16)).substr(-4),s}return f},w.resolve=function(f,d){return M.buildAbsoluteURL(d,f,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(f,d){var s=[],o={},T=!1;O.lastIndex=0;for(var b;(b=O.exec(f))!=null;)if(b[1]){var g=new L.AttrList(b[1]),P={attrs:g,bitrate:g.decimalInteger("AVERAGE-BANDWIDTH")||g.decimalInteger("BANDWIDTH"),name:g.NAME,url:w.resolve(b[2],d)},j=g.decimalResolution("RESOLUTION");j&&(P.width=j.width,P.height=j.height),c((g.CODECS||"").split(/[ ,]+/).filter(function(X){return X}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=w.convertAVC1ToAVCOTI(P.videoCodec)),s.push(P)}else if(b[3]){var H=new L.AttrList(b[3]);H["DATA-ID"]&&(T=!0,o[H["DATA-ID"]]=H)}return{levels:s,sessionData:T?o:null}},w.parseMasterPlaylistMedia=function(f,d,s,o){o===void 0&&(o=[]);var T,b=[],g=0;for(S.lastIndex=0;(T=S.exec(f))!==null;){var P=new L.AttrList(T[1]);if(P.TYPE===s){var j={attrs:P,bitrate:0,id:g++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:s,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?w.resolve(P.URI,d):""};if(o.length){var H=w.findGroup(o,j.groupId)||o[0];C(j,H,"audioCodec"),C(j,H,"textCodec")}b.push(j)}}return b},w.parseLevelPlaylist=function(f,d,s,o,T){var b=new I.LevelDetails(d),g=b.fragments,P=null,j=0,H=0,X=0,W=0,U=null,z=new N.Fragment(o,d),Z,q,oe,ye=-1,me=!1;for(p.lastIndex=0,b.m3u8=f;(Z=p.exec(f))!==null;){me&&(me=!1,z=new N.Fragment(o,d),z.start=X,z.sn=j,z.cc=W,z.level=s,P&&(z.initSegment=P,z.rawProgramDateTime=P.rawProgramDateTime));var fe=Z[1];if(fe){z.duration=parseFloat(fe);var ve=(" "+Z[2]).slice(1);z.title=ve||null,z.tagList.push(ve?["INF",fe,ve]:["INF",fe])}else if(Z[3])Object(F.isFiniteNumber)(z.duration)&&(z.start=X,oe&&(z.levelkey=oe),z.sn=j,z.level=s,z.cc=W,z.urlId=T,g.push(z),z.relurl=(" "+Z[3]).slice(1),h(z,U),U=z,X+=z.duration,j++,H=0,me=!0);else if(Z[4]){var ge=(" "+Z[4]).slice(1);U?z.setByteRange(ge,U):z.setByteRange(ge)}else if(Z[5])z.rawProgramDateTime=(" "+Z[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),ye===-1&&(ye=g.length);else{if(Z=Z[0].match(m),!Z){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(q=1;q<Z.length&&!(typeof Z[q]!="undefined");q++);var ae=(" "+Z[q]).slice(1),se=(" "+Z[q+1]).slice(1),Te=Z[q+2]?(" "+Z[q+2]).slice(1):"";switch(ae){case"PLAYLIST-TYPE":b.type=se.toUpperCase();break;case"MEDIA-SEQUENCE":j=b.startSN=parseInt(se);break;case"SKIP":{var We=new L.AttrList(se),Je=We.decimalInteger("SKIPPED-SEGMENTS");if(Object(F.isFiniteNumber)(Je)){b.skippedSegments=Je;for(var Ye=Je;Ye--;)g.unshift(null);j+=Je}var Ze=We.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ze&&(b.recentlyRemovedDateranges=Ze.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(se);break;case"VERSION":b.version=parseInt(se);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(se||Te)&&z.tagList.push(Te?[se,Te]:[se]);break;case"DIS":W++;case"GAP":z.tagList.push([ae]);break;case"BITRATE":z.tagList.push([ae,se]);break;case"DISCONTINUITY-SEQ":W=parseInt(se);break;case"KEY":{var ze,Ke=new L.AttrList(se),$e=Ke.enumeratedString("METHOD"),Qe=Ke.URI,nt=Ke.hexadecimalInteger("IV"),Xe=Ke.enumeratedString("KEYFORMATVERSIONS"),He=Ke.enumeratedString("KEYID"),st=(ze=Ke.enumeratedString("KEYFORMAT"))!=null?ze:"identity",ft=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ft.indexOf(st)>-1){v.logger.warn("Keyformat "+st+" is not supported from the manifest");continue}else if(st!=="identity")continue;$e&&(oe=A.LevelKey.fromURL(d,Qe),Qe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf($e)>=0&&(oe.method=$e,oe.keyFormat=st,He&&(oe.keyID=He),Xe&&(oe.keyFormatVersions=Xe),oe.iv=nt));break}case"START":{var ot=new L.AttrList(se),ut=ot.decimalFloatingPoint("TIME-OFFSET");Object(F.isFiniteNumber)(ut)&&(b.startTimeOffset=ut);break}case"MAP":{var gt=new L.AttrList(se);z.relurl=gt.URI,gt.BYTERANGE&&z.setByteRange(gt.BYTERANGE),z.level=s,z.sn="initSegment",oe&&(z.levelkey=oe),z.initSegment=null,P=z,me=!0;break}case"SERVER-CONTROL":{var ht=new L.AttrList(se);b.canBlockReload=ht.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=ht.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&ht.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=ht.optionalFloat("PART-HOLD-BACK",0),b.holdBack=ht.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var be=new L.AttrList(se);b.partTarget=be.decimalFloatingPoint("PART-TARGET");break}case"PART":{var pe=b.partList;pe||(pe=b.partList=[]);var ke=H>0?pe[pe.length-1]:void 0,Ne=H++,xe=new N.Part(new L.AttrList(se),z,d,Ne,ke);pe.push(xe),z.duration+=xe.duration;break}case"PRELOAD-HINT":{var Re=new L.AttrList(se);b.preloadHint=Re;break}case"RENDITION-REPORT":{var de=new L.AttrList(se);b.renditionReports=b.renditionReports||[],b.renditionReports.push(de);break}default:v.logger.warn("line parsed but not handled: "+Z);break}}}U&&!U.relurl?(g.pop(),X-=U.duration,b.partList&&(b.fragmentHint=U)):b.partList&&(h(z,U),z.cc=W,b.fragmentHint=z);var re=g.length,ne=g[0],$=g[re-1];if(X+=b.skippedSegments*b.targetduration,X>0&&re&&$){b.averagetargetduration=X/re;var Q=$.sn;b.endSN=Q!=="initSegment"?Q:0,ne&&(b.startCC=ne.cc,ne.initSegment||b.fragments.every(function(te){return te.relurl&&i(te.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new N.Fragment(o,d),z.relurl=$.relurl,z.level=s,z.sn="initSegment",ne.initSegment=z,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(X+=b.fragmentHint.duration),b.totalduration=X,b.endCC=W,ye>0&&x(g,ye),b},w}();function c(w,E){["video","audio","text"].forEach(function(f){var d=w.filter(function(o){return Object(y.isCodecType)(o,f)});if(d.length){var s=d.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});E[f+"Codec"]=s.length>0?s[0]:d[0],w=w.filter(function(o){return d.indexOf(o)===-1})}}),E.unknownCodecs=w}function C(w,E,f){var d=E[f];d&&(w[f]=d)}function x(w,E){for(var f=w[E],d=E;d--;){var s=w[d];if(!s)return;s.programDateTime=f.programDateTime-s.duration*1e3,f=s}}function h(w,E){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):E!=null&&E.programDateTime&&(w.programDateTime=E.endProgramDateTime),Object(F.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/polyfills/number.ts"),M=D("./src/events.ts"),_=D("./src/errors.ts"),N=D("./src/utils/logger.ts"),I=D("./src/utils/mp4-tools.ts"),A=D("./src/loader/m3u8-parser.ts"),L=D("./src/types/loader.ts"),v=D("./src/utils/attr-list.ts");function y(p){var m=p.type;switch(m){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function O(p,m){var l=p.url;return(l===void 0||l.indexOf("data:")===0)&&(l=m.url),l}var S=function(){function p(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var m=p.prototype;return m.registerListeners=function(){var i=this.hls;i.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.unregisterListeners=function(){var i=this.hls;i.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.createInternalLoader=function(i){var a=this.hls.config,c=a.pLoader,C=a.loader,x=c||C,h=new x(a);return i.loader=h,this.loaders[i.type]=h,h},m.getInternalLoader=function(i){return this.loaders[i.type]},m.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},m.destroyInternalLoaders=function(){for(var i in this.loaders){var a=this.loaders[i];a&&a.destroy(),this.resetInternalLoader(i)}},m.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},m.onManifestLoading=function(i,a){var c=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},m.onLevelLoading=function(i,a){var c=a.id,C=a.level,x=a.url,h=a.deliveryDirectives;this.load({id:c,groupId:null,level:C,responseType:"text",type:L.PlaylistContextType.LEVEL,url:x,deliveryDirectives:h})},m.onAudioTrackLoading=function(i,a){var c=a.id,C=a.groupId,x=a.url,h=a.deliveryDirectives;this.load({id:c,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:h})},m.onSubtitleTrackLoading=function(i,a){var c=a.id,C=a.groupId,x=a.url,h=a.deliveryDirectives;this.load({id:c,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:h})},m.load=function(i){var a,c=this.hls.config,C=this.getInternalLoader(i);if(C){var x=C.context;if(x&&x.url===i.url){N.logger.trace("[playlist-loader]: playlist request ongoing");return}N.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),C.abort()}var h,w,E,f;switch(i.type){case L.PlaylistContextType.MANIFEST:h=c.manifestLoadingMaxRetry,w=c.manifestLoadingTimeOut,E=c.manifestLoadingRetryDelay,f=c.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:h=0,w=c.levelLoadingTimeOut;break;default:h=c.levelLoadingMaxRetry,w=c.levelLoadingTimeOut,E=c.levelLoadingRetryDelay,f=c.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(i),(a=i.deliveryDirectives)!==null&&a!==void 0&&a.part){var d;if(i.type===L.PlaylistContextType.LEVEL&&i.level!==null?d=this.hls.levels[i.level].details:i.type===L.PlaylistContextType.AUDIO_TRACK&&i.id!==null?d=this.hls.audioTracks[i.id].details:i.type===L.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(d=this.hls.subtitleTracks[i.id].details),d){var s=d.partTarget,o=d.targetduration;s&&o&&(w=Math.min(Math.max(s*3,o*.8)*1e3,w))}}var T={timeout:w,maxRetry:h,retryDelay:E,maxRetryDelay:f,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(i,T,b)},m.loadsuccess=function(i,a,c,C){if(C===void 0&&(C=null),c.isSidxRequest){this.handleSidxRequest(i,c),this.handlePlaylistLoaded(i,a,c,C);return}this.resetInternalLoader(c.type);var x=i.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,c,"no EXTM3U delimiter",C);return}a.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,a,c,C):this.handleMasterPlaylist(i,a,c,C)},m.loaderror=function(i,a,c){c===void 0&&(c=null),this.handleNetworkError(a,c,!1,i)},m.loadtimeout=function(i,a,c){c===void 0&&(c=null),this.handleNetworkError(a,c,!0)},m.handleMasterPlaylist=function(i,a,c,C){var x=this.hls,h=i.data,w=O(i,c),E=A.default.parseMasterPlaylist(h,w),f=E.levels,d=E.sessionData;if(!f.length){this.handleManifestParsingError(i,c,"no level found in manifest",C);return}var s=f.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),o=f.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),T=A.default.parseMasterPlaylistMedia(h,w,"AUDIO",s),b=A.default.parseMasterPlaylistMedia(h,w,"SUBTITLES",o),g=A.default.parseMasterPlaylistMedia(h,w,"CLOSED-CAPTIONS");if(T.length){var P=T.some(function(j){return!j.url});!P&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(N.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}x.trigger(M.Events.MANIFEST_LOADED,{levels:f,audioTracks:T,subtitles:b,captions:g,url:w,stats:a,networkDetails:C,sessionData:d})},m.handleTrackOrLevelPlaylist=function(i,a,c,C){var x=this.hls,h=c.id,w=c.level,E=c.type,f=O(i,c),d=Object(F.isFiniteNumber)(h)?h:0,s=Object(F.isFiniteNumber)(w)?w:d,o=y(c),T=A.default.parseLevelPlaylist(i.data,f,s,o,d);if(!T.fragments.length){x.trigger(M.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(E===L.PlaylistContextType.MANIFEST){var b={attrs:new v.AttrList({}),bitrate:0,details:T,name:"",url:f};x.trigger(M.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:f,stats:a,networkDetails:C,sessionData:null})}if(a.parsing.end=performance.now(),T.needSidxRanges){var g,P=(g=T.fragments[0].initSegment)===null||g===void 0?void 0:g.url;this.load({url:P,isSidxRequest:!0,type:E,level:w,levelDetails:T,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=T,this.handlePlaylistLoaded(i,a,c,C)},m.handleSidxRequest=function(i,a){var c=Object(I.parseSegmentIndex)(new Uint8Array(i.data));if(!c)return;var C=c.references,x=a.levelDetails;C.forEach(function(h,w){var E=h.info,f=x.fragments[w];f.byteRange.length===0&&f.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),f.initSegment&&f.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},m.handleManifestParsingError=function(i,a,c,C){this.hls.trigger(M.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===L.PlaylistContextType.MANIFEST,url:i.url,reason:c,response:i,context:a,networkDetails:C})},m.handleNetworkError=function(i,a,c,C){c===void 0&&(c=!1),N.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var x=_.ErrorDetails.UNKNOWN,h=!1,w=this.getInternalLoader(i);switch(i.type){case L.PlaylistContextType.MANIFEST:x=c?_.ErrorDetails.MANIFEST_LOAD_TIMEOUT:_.ErrorDetails.MANIFEST_LOAD_ERROR,h=!0;break;case L.PlaylistContextType.LEVEL:x=c?_.ErrorDetails.LEVEL_LOAD_TIMEOUT:_.ErrorDetails.LEVEL_LOAD_ERROR,h=!1;break;case L.PlaylistContextType.AUDIO_TRACK:x=c?_.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:x=c?_.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:_.ErrorDetails.SUBTITLE_LOAD_ERROR,h=!1;break}w&&this.resetInternalLoader(i.type);var E={type:_.ErrorTypes.NETWORK_ERROR,details:x,fatal:h,url:i.url,loader:w,context:i,networkDetails:a};C&&(E.response=C),this.hls.trigger(M.Events.ERROR,E)},m.handlePlaylistLoaded=function(i,a,c,C){var x=c.type,h=c.level,w=c.id,E=c.groupId,f=c.loader,d=c.levelDetails,s=c.deliveryDirectives;if(!(d!=null&&d.targetduration)){this.handleManifestParsingError(i,c,"invalid target duration",C);return}if(!f)return;d.live&&(f.getCacheAge&&(d.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(d.ageHeader))&&(d.ageHeader=0));switch(x){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(M.Events.LEVEL_LOADED,{details:d,level:h||0,id:w||0,stats:a,networkDetails:C,deliveryDirectives:s});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,{details:d,id:w||0,groupId:E||"",stats:a,networkDetails:C,deliveryDirectives:s});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(M.Events.SUBTITLE_TRACK_LOADED,{details:d,id:w||0,groupId:E||"",stats:a,networkDetails:C,deliveryDirectives:s});break}},p}();B.default=S},"./src/polyfills/number.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"isFiniteNumber",function(){return F}),D.d(B,"MAX_SAFE_INTEGER",function(){return M});var F=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},M=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(V,B,D){"use strict";D.r(B);var F=function(){function M(){}return M.getSilentFrame=function(N,I){switch(N){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}return},M}();B.default=F},"./src/remux/mp4-generator.ts":function(V,B,D){"use strict";D.r(B);var F=Math.pow(2,32)-1,M=function(){function _(){}return _.init=function(){_.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var I;for(I in _.types)_.types.hasOwnProperty(I)&&(_.types[I]=[I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2),I.charCodeAt(3)]);var A=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]),L=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]);_.HDLR_TYPES={video:A,audio:L};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),y=new Uint8Array([0,0,0,0,0,0,0,0]);_.STTS=_.STSC=_.STCO=y,_.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),_.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),_.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var O=new Uint8Array([105,115,111,109]),S=new Uint8Array([97,118,99,49]),p=new Uint8Array([0,0,0,1]);_.FTYP=_.box(_.types.ftyp,O,p,O,S),_.DINF=_.box(_.types.dinf,_.box(_.types.dref,v))},_.box=function(I){for(var A=8,L=arguments.length,v=new Array(L>1?L-1:0),y=1;y<L;y++)v[y-1]=arguments[y];for(var O=v.length,S=O;O--;)A+=v[O].byteLength;var p=new Uint8Array(A);for(p[0]=A>>24&255,p[1]=A>>16&255,p[2]=A>>8&255,p[3]=A&255,p.set(I,4),O=0,A=8;O<S;O++)p.set(v[O],A),A+=v[O].byteLength;return p},_.hdlr=function(I){return _.box(_.types.hdlr,_.HDLR_TYPES[I])},_.mdat=function(I){return _.box(_.types.mdat,I)},_.mdhd=function(I,A){A*=I;var L=Math.floor(A/(F+1)),v=Math.floor(A%(F+1));return _.box(_.types.mdhd,new Uint8Array([1,0,0,0,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,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},_.mdia=function(I){return _.box(_.types.mdia,_.mdhd(I.timescale,I.duration),_.hdlr(I.type),_.minf(I))},_.mfhd=function(I){return _.box(_.types.mfhd,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255]))},_.minf=function(I){return I.type==="audio"?_.box(_.types.minf,_.box(_.types.smhd,_.SMHD),_.DINF,_.stbl(I)):_.box(_.types.minf,_.box(_.types.vmhd,_.VMHD),_.DINF,_.stbl(I))},_.moof=function(I,A,L){return _.box(_.types.moof,_.mfhd(I),_.traf(L,A))},_.moov=function(I){for(var A=I.length,L=[];A--;)L[A]=_.trak(I[A]);return _.box.apply(null,[_.types.moov,_.mvhd(I[0].timescale,I[0].duration)].concat(L).concat(_.mvex(I)))},_.mvex=function(I){for(var A=I.length,L=[];A--;)L[A]=_.trex(I[A]);return _.box.apply(null,[_.types.mvex].concat(L))},_.mvhd=function(I,A){A*=I;var L=Math.floor(A/(F+1)),v=Math.floor(A%(F+1)),y=new Uint8Array([1,0,0,0,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,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&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 _.box(_.types.mvhd,y)},_.sdtp=function(I){var A=I.samples||[],L=new Uint8Array(4+A.length),v,y;for(v=0;v<A.length;v++)y=A[v].flags,L[v+4]=y.dependsOn<<4|y.isDependedOn<<2|y.hasRedundancy;return _.box(_.types.sdtp,L)},_.stbl=function(I){return _.box(_.types.stbl,_.stsd(I),_.box(_.types.stts,_.STTS),_.box(_.types.stsc,_.STSC),_.box(_.types.stsz,_.STSZ),_.box(_.types.stco,_.STCO))},_.avc1=function(I){var A=[],L=[],v,y,O;for(v=0;v<I.sps.length;v++)y=I.sps[v],O=y.byteLength,A.push(O>>>8&255),A.push(O&255),A=A.concat(Array.prototype.slice.call(y));for(v=0;v<I.pps.length;v++)y=I.pps[v],O=y.byteLength,L.push(O>>>8&255),L.push(O&255),L=L.concat(Array.prototype.slice.call(y));var S=_.box(_.types.avcC,new Uint8Array([1,A[3],A[4],A[5],252|3,224|I.sps.length].concat(A).concat([I.pps.length]).concat(L))),p=I.width,m=I.height,l=I.pixelRatio[0],i=I.pixelRatio[1];return _.box(_.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,p>>8&255,p&255,m>>8&255,m&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]),S,_.box(_.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),_.box(_.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,i>>24,i>>16&255,i>>8&255,i&255])))},_.esds=function(I){var A=I.config.length;return new Uint8Array([0,0,0,0,3,23+A,0,1,0,4,15+A,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([A]).concat(I.config).concat([6,1,2]))},_.mp4a=function(I){var A=I.samplerate;return _.box(_.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]),_.box(_.types.esds,_.esds(I)))},_.mp3=function(I){var A=I.samplerate;return _.box(_.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]))},_.stsd=function(I){return I.type==="audio"?!I.isAAC&&I.codec==="mp3"?_.box(_.types.stsd,_.STSD,_.mp3(I)):_.box(_.types.stsd,_.STSD,_.mp4a(I)):_.box(_.types.stsd,_.STSD,_.avc1(I))},_.tkhd=function(I){var A=I.id,L=I.duration*I.timescale,v=I.width,y=I.height,O=Math.floor(L/(F+1)),S=Math.floor(L%(F+1));return _.box(_.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,A>>24&255,A>>16&255,A>>8&255,A&255,0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,S>>24,S>>16&255,S>>8&255,S&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,v>>8&255,v&255,0,0,y>>8&255,y&255,0,0]))},_.traf=function(I,A){var L=_.sdtp(I),v=I.id,y=Math.floor(A/(F+1)),O=Math.floor(A%(F+1));return _.box(_.types.traf,_.box(_.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),_.box(_.types.tfdt,new Uint8Array([1,0,0,0,y>>24,y>>16&255,y>>8&255,y&255,O>>24,O>>16&255,O>>8&255,O&255])),_.trun(I,L.length+16+20+8+16+8+8),L)},_.trak=function(I){return I.duration=I.duration||4294967295,_.box(_.types.trak,_.tkhd(I),_.mdia(I))},_.trex=function(I){var A=I.id;return _.box(_.types.trex,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},_.trun=function(I,A){var L=I.samples||[],v=L.length,y=12+16*v,O=new Uint8Array(y),S,p,m,l,i,a;for(A+=8+y,O.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255],0),S=0;S<v;S++)p=L[S],m=p.duration,l=p.size,i=p.flags,a=p.cts,O.set([m>>>24&255,m>>>16&255,m>>>8&255,m&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*S);return _.box(_.types.trun,O)},_.initSegment=function(I){_.types||_.init();var A=_.moov(I),L=new Uint8Array(_.FTYP.byteLength+A.byteLength);return L.set(_.FTYP),L.set(A,_.FTYP.byteLength),L},_}();M.types=void 0,M.HDLR_TYPES=void 0,M.STTS=void 0,M.STSC=void 0,M.STCO=void 0,M.STSZ=void 0,M.VMHD=void 0,M.SMHD=void 0,M.STSD=void 0,M.FTYP=void 0,M.DINF=void 0,B.default=M},"./src/remux/mp4-remuxer.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return a}),D.d(B,"normalizePts",function(){return c});var F=D("./src/polyfills/number.ts"),M=D("./src/remux/aac-helper.ts"),_=D("./src/remux/mp4-generator.ts"),N=D("./src/events.ts"),I=D("./src/errors.ts"),A=D("./src/utils/logger.ts"),L=D("./src/types/loader.ts"),v=D("./src/utils/timescale-conversion.ts");function y(){return y=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(w[d]=f[d])}return w},y.apply(this,arguments)}var O=10*1e3,S=1024,p=1152,m=null,l=null,i=!1,a=function(){function w(f,d,s,o){if(o===void 0&&(o=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=f,this.config=d,this.typeSupported=s,this.ISGenerated=!1,m===null){var T=navigator.userAgent||"",b=T.match(/Chrome\/(\d+)/i);m=b?parseInt(b[1]):0}if(l===null){var g=navigator.userAgent.match(/Safari\/(\d+)/i);l=g?parseInt(g[1]):0}i=!!m&&m<75||!!l&&l<600}var E=w.prototype;return E.destroy=function(){},E.resetTimeStamp=function(d){A.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=d},E.resetNextTimestamp=function(){A.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){A.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(d){var s=!1,o=d.reduce(function(T,b){var g=b.pts-T;return g<-4294967296?(s=!0,c(T,b.pts)):g>0?T:b.pts},d[0].pts);return s&&A.logger.debug("PTS rollover detected"),o},E.remux=function(d,s,o,T,b,g,P,j){var H,X,W,U,z,Z,q=b,oe=b,ye=d.pid>-1,me=s.pid>-1,fe=s.samples.length,ve=d.samples.length>0,ge=fe>1,ae=(!ye||ve)&&(!me||ge)||this.ISGenerated||P;if(ae){this.ISGenerated||(W=this.generateIS(d,s,b));var se=this.isVideoContiguous,Te=-1;if(ge&&(Te=C(s.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,Te>0){A.logger.warn("[mp4-remuxer]: Dropped "+Te+" out of "+fe+" video samples due to a missing keyframe");var We=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(Te),s.dropped+=Te,oe+=(s.samples[0].pts-We)/(s.timescale||9e4)}else Te===-1&&(A.logger.warn("[mp4-remuxer]: No keyframe found out of "+fe+" video samples"),Z=!1);if(this.ISGenerated){if(ve&&ge){var Je=this.getVideoStartPts(s.samples),Ye=c(d.samples[0].pts,Je)-Je,Ze=Ye/s.inputTimeScale;q+=Math.max(0,Ze),oe+=Math.max(0,-Ze)}if(ve){if(d.samplerate||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),W=this.generateIS(d,s,b)),X=this.remuxAudio(d,q,this.isAudioContiguous,g,me||ge||j===L.PlaylistLevelType.AUDIO?oe:void 0),ge){var ze=X?X.endPTS-X.startPTS:0;s.inputTimeScale||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),W=this.generateIS(d,s,b)),H=this.remuxVideo(s,oe,se,ze)}}else ge&&(H=this.remuxVideo(s,oe,se,0));H&&(H.firstKeyFrame=Te,H.independent=Te!==-1)}}return this.ISGenerated&&(o.samples.length&&(z=this.remuxID3(o,b)),T.samples.length&&(U=this.remuxText(T,b))),{audio:X,video:H,initSegment:W,independent:Z,text:U,id3:z}},E.generateIS=function(d,s,o){var T=d.samples,b=s.samples,g=this.typeSupported,P={},j=!Object(F.isFiniteNumber)(this._initPTS),H="audio/mp4",X,W,U;if(j&&(X=W=Infinity),d.config&&T.length&&(d.timescale=d.samplerate,d.isAAC||(g.mpeg?(H="audio/mpeg",d.codec=""):g.mp3&&(d.codec="mp3")),P.audio={id:"audio",container:H,codec:d.codec,initSegment:!d.isAAC&&g.mpeg?new Uint8Array(0):_.default.initSegment([d]),metadata:{channelCount:d.channelCount}},j&&(U=d.inputTimeScale,X=W=T[0].pts-Math.round(U*o))),s.sps&&s.pps&&b.length&&(s.timescale=s.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:_.default.initSegment([s]),metadata:{width:s.width,height:s.height}},j)){U=s.inputTimeScale;var z=this.getVideoStartPts(b),Z=Math.round(U*o);W=Math.min(W,c(b[0].dts,z)-Z),X=Math.min(X,z-Z)}if(Object.keys(P).length)return this.ISGenerated=!0,j&&(this._initPTS=X,this._initDTS=W),{tracks:P,initPTS:X,timescale:U}},E.remuxVideo=function(d,s,o,T){var b=d.inputTimeScale,g=d.samples,P=[],j=g.length,H=this._initPTS,X=this.nextAvcDts,W=8,U,z,Z,q=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,ye=0,me=!1;if(!o||X===null){var fe=s*b,ve=g[0].pts-c(g[0].dts,g[0].pts);X=fe-ve}for(var ge=0;ge<j;ge++){var ae=g[ge];if(ae.pts=c(ae.pts-H,X),ae.dts=c(ae.dts-H,X),ae.dts>ae.pts){var se=9e4*.2;ye=Math.max(Math.min(ye,ae.pts-ae.dts),-1*se)}ae.dts<g[ge>0?ge-1:ge].dts&&(me=!0)}me&&g.sort(function(qe,Le){var Ue=qe.dts-Le.dts,we=qe.pts-Le.pts;return Ue||we}),z=g[0].dts,Z=g[g.length-1].dts;var Te=Math.round((Z-z)/(j-1));if(ye<0){if(ye<Te*-2){A.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-Te,!0)+" ms");for(var We=ye,Je=0;Je<j;Je++)g[Je].dts=We=Math.max(We,g[Je].pts-Te),g[Je].pts=Math.max(We,g[Je].pts)}else{A.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(ye,!0)+" ms to overcome this issue");for(var Ye=0;Ye<j;Ye++)g[Ye].dts=g[Ye].dts+ye}z=g[0].dts}if(o){var Ze=z-X,ze=Ze>Te,Ke=Ze<-1;if(ze||Ke){ze?A.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ze,!0)+" ms ("+Ze+"dts) hole between fragments detected, filling it"):A.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ze,!0)+" ms ("+Ze+"dts) overlapping between fragments detected"),z=X;var $e=g[0].pts-Ze;g[0].dts=z,g[0].pts=$e,A.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)($e,!0)+"/"+Object(v.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ze,!0)+" ms")}}i&&(z=Math.max(0,z));for(var Qe=0,nt=0,Xe=0;Xe<j;Xe++){for(var He=g[Xe],st=He.units,ft=st.length,ot=0,ut=0;ut<ft;ut++)ot+=st[ut].data.length;nt+=ot,Qe+=ft,He.length=ot,He.dts=Math.max(He.dts,z),He.pts=Math.max(He.pts,He.dts,0),q=Math.min(He.pts,q),oe=Math.max(He.pts,oe)}Z=g[j-1].dts;var gt=nt+4*Qe+8,ht;try{ht=new Uint8Array(gt)}catch(qe){this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:gt,reason:"fail allocating video mdat "+gt});return}var be=new DataView(ht.buffer);be.setUint32(0,gt),ht.set(_.default.types.mdat,4);for(var pe=0;pe<j;pe++){for(var ke=g[pe],Ne=ke.units,xe=0,Re=0,de=Ne.length;Re<de;Re++){var re=Ne[Re],ne=re.data,$=re.data.byteLength;be.setUint32(W,$),W+=4,ht.set(ne,W),W+=$,xe+=4+$}if(pe<j-1)U=g[pe+1].dts-ke.dts;else{var Q=this.config,te=ke.dts-g[pe>0?pe-1:pe].dts;if(Q.stretchShortVideoTrack&&this.nextAudioPts!==null){var ie=Math.floor(Q.maxBufferHole*b),ue=(T?q+T*b:this.nextAudioPts)-ke.pts;ue>ie?(U=ue-te,U<0&&(U=te),A.logger.log("[mp4-remuxer]: It is approximately "+ue/90+" ms to the next segment; using duration "+U/90+" ms for the last video frame.")):U=te}else U=te}var Ce=Math.round(ke.pts-ke.dts);P.push(new x(ke.key,U,xe,Ce))}if(P.length&&m&&m<70){var Oe=P[0].flags;Oe.dependsOn=2,Oe.isNonSync=0}console.assert(U!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=X=Z+U,this.isVideoContiguous=!0;var Fe=_.default.moof(d.sequenceNumber++,z,y({},d,{samples:P})),tt="video",Ve={data1:Fe,data2:ht,startPTS:q/b,endPTS:(oe+U)/b,startDTS:z/b,endDTS:X/b,type:tt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:d.dropped};return d.samples=[],d.dropped=0,console.assert(ht.length,"MDAT length must not be zero"),Ve},E.remuxAudio=function(d,s,o,T,b){var g=d.inputTimeScale,P=d.samplerate?d.samplerate:g,j=g/P,H=d.isAAC?S:p,X=H*j,W=this._initPTS,U=!d.isAAC&&this.typeSupported.mpeg,z=[],Z=d.samples,q=U?0:8,oe=this.nextAudioPts||-1,ye=s*g;if(this.isAudioContiguous=o=o||Z.length&&oe>0&&(T&&Math.abs(ye-oe)<9e3||Math.abs(c(Z[0].pts-W,ye)-oe)<20*X),Z.forEach(function(ne){ne.pts=c(ne.pts-W,ye)}),!o||oe<0){if(Z=Z.filter(function(ne){return ne.pts>=0}),!Z.length)return;b===0?oe=0:T?oe=Math.max(0,ye):oe=Z[0].pts}if(d.isAAC)for(var me=b!==void 0,fe=this.config.maxAudioFramesDrift,ve=0,ge=oe;ve<Z.length;ve++){var ae=Z[ve],se=ae.pts,Te=se-ge,We=Math.abs(1e3*Te/g);if(Te<=-fe*X&&me)ve===0&&(A.logger.warn("Audio frame @ "+(se/g).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Te/g)+" ms."),this.nextAudioPts=oe=ge=se);else if(Te>=fe*X&&We<O&&me){var Je=Math.round(Te/X);ge=se-Je*X,ge<0&&(Je--,ge+=X),ve===0&&(this.nextAudioPts=oe=ge),A.logger.warn("[mp4-remuxer]: Injecting "+Je+" audio frame @ "+(ge/g).toFixed(3)+"s due to "+Math.round(1e3*Te/g)+" ms gap.");for(var Ye=0;Ye<Je;Ye++){var Ze=Math.max(ge,0),ze=M.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);ze||(A.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ze=ae.unit.subarray()),Z.splice(ve,0,{unit:ze,pts:Ze}),ge+=X,ve++}}ae.pts=ge,ge+=X}for(var Ke=null,$e=null,Qe,nt=0,Xe=Z.length;Xe--;)nt+=Z[Xe].unit.byteLength;for(var He=0,st=Z.length;He<st;He++){var ft=Z[He],ot=ft.unit,ut=ft.pts;if($e!==null){var gt=z[He-1];gt.duration=Math.round((ut-$e)/j)}else if(o&&d.isAAC&&(ut=oe),Ke=ut,nt>0){nt+=q;try{Qe=new Uint8Array(nt)}catch(ne){this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:nt,reason:"fail allocating audio mdat "+nt});return}if(!U){var ht=new DataView(Qe.buffer);ht.setUint32(0,nt),Qe.set(_.default.types.mdat,4)}}else return;Qe.set(ot,q);var be=ot.byteLength;q+=be,z.push(new x(!0,H,be,0)),$e=ut}var pe=z.length;if(!pe)return;var ke=z[z.length-1];this.nextAudioPts=oe=$e+j*ke.duration;var Ne=U?new Uint8Array(0):_.default.moof(d.sequenceNumber++,Ke/j,y({},d,{samples:z}));d.samples=[];var xe=Ke/g,Re=oe/g,de="audio",re={data1:Ne,data2:Qe,startPTS:xe,endPTS:Re,startDTS:xe,endDTS:Re,type:de,hasAudio:!0,hasVideo:!1,nb:pe};return this.isAudioContiguous=!0,console.assert(Qe.length,"MDAT length must not be zero"),re},E.remuxEmptyAudio=function(d,s,o,T){var b=d.inputTimeScale,g=d.samplerate?d.samplerate:b,P=b/g,j=this.nextAudioPts,H=(j!==null?j:T.startDTS*b)+this._initDTS,X=T.endDTS*b+this._initDTS,W=P*S,U=Math.ceil((X-H)/W),z=M.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);if(A.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){A.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],q=0;q<U;q++){var oe=H+q*W;Z.push({unit:z,pts:oe,dts:oe})}return d.samples=Z,this.remuxAudio(d,s,o,!1)},E.remuxID3=function(d,s){var o=d.samples.length;if(!o)return;for(var T=d.inputTimeScale,b=this._initPTS,g=this._initDTS,P=0;P<o;P++){var j=d.samples[P];j.pts=c(j.pts-b,s*T)/T,j.dts=c(j.dts-g,s*T)/T}var H=d.samples;return d.samples=[],{samples:H}},E.remuxText=function(d,s){var o=d.samples.length;if(!o)return;for(var T=d.inputTimeScale,b=this._initPTS,g=0;g<o;g++){var P=d.samples[g];P.pts=c(P.pts-b,s*T)/T}d.samples.sort(function(H,X){return H.pts-X.pts});var j=d.samples;return d.samples=[],{samples:j}},w}();function c(w,E){var f;if(E===null)return w;for(E<w?f=-8589934592:f=8589934592;Math.abs(w-E)>4294967296;)w+=f;return w}function C(w){for(var E=0;E<w.length;E++)if(w[E].key)return E;return-1}var x=function(E,f,d,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=d,this.cts=s,this.flags=new h(E)},h=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/polyfills/number.ts"),M=D("./src/utils/mp4-tools.ts"),_=D("./src/loader/fragment.ts"),N=D("./src/utils/logger.ts"),I=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var y=v.prototype;return y.destroy=function(){},y.resetTimeStamp=function(S){this.initPTS=S,this.lastEndDTS=null},y.resetNextTimestamp=function(){this.lastEndDTS=null},y.resetInitSegment=function(S,p,m){this.audioCodec=p,this.videoCodec=m,this.generateInitSegment(S),this.emitInitSegment=!0},y.generateInitSegment=function(S){var p=this.audioCodec,m=this.videoCodec;if(!S||!S.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(M.parseInitSegment)(S);p||(p=L(l.audio,_.ElementaryStreamTypes.AUDIO)),m||(m=L(l.video,_.ElementaryStreamTypes.VIDEO));var i={};l.audio&&l.video?i.audiovideo={container:"video/mp4",codec:p+","+m,initSegment:S,id:"main"}:l.audio?i.audio={container:"audio/mp4",codec:p,initSegment:S,id:"audio"}:l.video?i.video={container:"video/mp4",codec:m,initSegment:S,id:"main"}:N.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},y.remux=function(S,p,m,l,i){var a=this.initPTS,c=this.lastEndDTS,C={audio:void 0,video:void 0,text:l,id3:m,initSegment:void 0};Object(F.isFiniteNumber)(c)||(c=this.lastEndDTS=i||0);var x=p.samples;if(!x||!x.length)return C;var h={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(x),w=this.initData),!w||!w.length)return N.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),C;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1),Object(F.isFiniteNumber)(a)||(this.initPTS=h.initPTS=a=A(w,x,c));var E=Object(M.getDuration)(x,w),f=c,d=E+f;Object(M.offsetStartDTS)(w,x,a),E>0?this.lastEndDTS=d:(N.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!w.audio,o=!!w.video,T="";s&&(T+="audio"),o&&(T+="video");var b={data1:x,startPTS:f,startDTS:f,endPTS:d,endDTS:d,type:T,hasAudio:s,hasVideo:o,nb:1,dropped:0};return C.audio=b.type==="audio"?b:void 0,C.video=b.type!=="audio"?b:void 0,C.text=l,C.id3=m,C.initSegment=h,C},v}(),A=function(y,O,S){return Object(M.getStartDTS)(y,O)-S};function L(v,y){var O=v==null?void 0:v.codec;return O&&O.length>4?O:O==="hvc1"?"hvc1.1.c.L120.90":O==="av01"?"av01.0.04M.08":O==="avc1"||y===_.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}B.default=I},"./src/task-loop.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return F});var F=function(){function M(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var _=M.prototype;return _.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},_.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},_.onHandlerDestroyed=function(){},_.hasInterval=function(){return!!this._tickInterval},_.hasNextTick=function(){return!!this._tickTimer},_.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},_.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},_.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},_.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},_.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},_.doTick=function(){},M}()},"./src/types/cmcd.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"CMCDVersion",function(){return F}),D.d(B,"CMCDObjectType",function(){return M}),D.d(B,"CMCDStreamingFormat",function(){return _}),D.d(B,"CMCDStreamType",function(){return N});var F=1,M;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(M||(M={}));var _;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(_||(_={}));var N;(function(I){I.VOD="v",I.LIVE="l"})(N||(N={}))},"./src/types/level.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"HlsSkip",function(){return _}),D.d(B,"getSkipValue",function(){return N}),D.d(B,"HlsUrlParameters",function(){return I}),D.d(B,"Level",function(){return A});function F(L,v){for(var y=0;y<v.length;y++){var O=v[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(L,O.key,O)}}function M(L,v,y){return v&&F(L.prototype,v),y&&F(L,y),L}var _;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(_||(_={}));function N(L,v){var y=L.canSkipUntil,O=L.canSkipDateRanges,S=L.endSN,p=v!==void 0?v-S:0;return y&&p<y?O?_.v2:_.Yes:_.No}var I=function(){function L(y,O,S){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=y,this.part=O,this.skip=S}var v=L.prototype;return v.addDirectives=function(O){var S=new self.URL(O);return this.msn!==void 0&&S.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&S.searchParams.set("_HLS_part",this.part.toString()),this.skip&&S.searchParams.set("_HLS_skip",this.skip),S.toString()},L}(),A=function(){function L(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(y){return y}).join(",").replace(/\.[^.,]+/g,"")}return M(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(y){var O=y%this.url.length;this._urlId!==O&&(this.details=void 0,this._urlId=O)}}]),L}()},"./src/types/loader.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"PlaylistContextType",function(){return F}),D.d(B,"PlaylistLevelType",function(){return M});var F;(function(_){_.MANIFEST="manifest",_.LEVEL="level",_.AUDIO_TRACK="audioTrack",_.SUBTITLE_TRACK="subtitleTrack"})(F||(F={}));var M;(function(_){_.MAIN="main",_.AUDIO="audio",_.SUBTITLE="subtitle"})(M||(M={}))},"./src/types/transmuxer.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"ChunkMetadata",function(){return F});var F=function(N,I,A,L,v,y){L===void 0&&(L=0),v===void 0&&(v=-1),y===void 0&&(y=!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=M(),this.buffering={audio:M(),video:M(),audiovideo:M()},this.level=N,this.sn=I,this.id=A,this.size=L,this.part=v,this.partial=y};function M(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"AttrList",function(){return _});var F=/^(\d+)x(\d+)$/,M=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,_=function(){function N(A){typeof A=="string"&&(A=N.parseAttrList(A));for(var L in A)A.hasOwnProperty(L)&&(this[L]=A[L])}var I=N.prototype;return I.decimalInteger=function(L){var v=parseInt(this[L],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},I.hexadecimalInteger=function(L){if(this[L]){var v=(this[L]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var y=new Uint8Array(v.length/2),O=0;O<v.length/2;O++)y[O]=parseInt(v.slice(O*2,O*2+2),16);return y}else return null},I.hexadecimalIntegerAsNumber=function(L){var v=parseInt(this[L],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},I.decimalFloatingPoint=function(L){return parseFloat(this[L])},I.optionalFloat=function(L,v){var y=this[L];return y?parseFloat(y):v},I.enumeratedString=function(L){return this[L]},I.bool=function(L){return this[L]==="YES"},I.decimalResolution=function(L){var v=F.exec(this[L]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},N.parseAttrList=function(L){var v,y={},O='"';for(M.lastIndex=0;(v=M.exec(L))!==null;){var S=v[2];S.indexOf(O)===0&&S.lastIndexOf(O)===S.length-1&&(S=S.slice(1,-1)),y[v[1]]=S}return y},N}()},"./src/utils/binary-search.ts":function(V,B,D){"use strict";D.r(B);var F={search:function(_,N){for(var I=0,A=_.length-1,L=null,v=null;I<=A;){L=(I+A)/2|0,v=_[L];var y=N(v);if(y>0)I=L+1;else if(y<0)A=L-1;else return v}return null}};B.default=F},"./src/utils/buffer-helper.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"BufferHelper",function(){return _});var F=D("./src/utils/logger.ts"),M={length:0,start:function(){return 0},end:function(){return 0}},_=function(){function N(){}return N.isBuffered=function(A,L){try{if(A){for(var v=N.getBuffered(A),y=0;y<v.length;y++)if(L>=v.start(y)&&L<=v.end(y))return!0}}catch(O){}return!1},N.bufferInfo=function(A,L,v){try{if(A){var y=N.getBuffered(A),O=[],S;for(S=0;S<y.length;S++)O.push({start:y.start(S),end:y.end(S)});return this.bufferedInfo(O,L,v)}}catch(p){}return{len:0,start:L,end:L,nextStart:void 0}},N.bufferedInfo=function(A,L,v){L=Math.max(0,L),A.sort(function(h,w){var E=h.start-w.start;return E||w.end-h.end});var y=[];if(v)for(var O=0;O<A.length;O++){var S=y.length;if(S){var p=y[S-1].end;A[O].start-p<v?A[O].end>p&&(y[S-1].end=A[O].end):y.push(A[O])}else y.push(A[O])}else y=A;for(var m=0,l,i=L,a=L,c=0;c<y.length;c++){var C=y[c].start,x=y[c].end;if(L+v>=C&&L<x)i=C,a=x,m=a-L;else if(L+v<C){l=C;break}}return{len:m,start:i||0,end:a||0,nextStart:l}},N.getBuffered=function(A){try{return A.buffered}catch(L){return F.logger.log("failed to get media.buffered",L),M}},N}()},"./src/utils/cea-608-parser.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"Row",function(){return a}),D.d(B,"CaptionScreen",function(){return c});var F=D("./src/utils/logger.ts"),M={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},_=function(d){var s=d;return M.hasOwnProperty(d)&&(s=M[d]),String.fromCharCode(s)},N=15,I=100,A={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},y={25:2,26:4,29:6,30:8,31:10,27:13,28:15},O=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],S;(function(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(S||(S={}));var p=function(){function f(){this.time=null,this.verboseLevel=S.ERROR}var d=f.prototype;return d.log=function(o,T){this.verboseLevel>=o&&F.logger.log(this.time+" ["+o+"] "+T)},f}(),m=function(d){for(var s=[],o=0;o<d.length;o++)s.push(d[o].toString(16));return s},l=function(){function f(s,o,T,b,g){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=o||!1,this.italics=T||!1,this.background=b||"black",this.flash=g||!1}var d=f.prototype;return d.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},d.setStyles=function(o){for(var T=["foreground","underline","italics","background","flash"],b=0;b<T.length;b++){var g=T[b];o.hasOwnProperty(g)&&(this[g]=o[g])}},d.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},d.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},d.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},d.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),i=function(){function f(s,o,T,b,g,P){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new l(o,T,b,g,P)}var d=f.prototype;return d.reset=function(){this.uchar=" ",this.penState.reset()},d.setChar=function(o,T){this.uchar=o,this.penState.copy(T)},d.setPenState=function(o){this.penState.copy(o)},d.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},d.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},d.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},f}(),a=function(){function f(s){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<I;o++)this.chars.push(new i);this.logger=s,this.pos=0,this.currPenState=new l}var d=f.prototype;return d.equals=function(o){for(var T=!0,b=0;b<I;b++)if(!this.chars[b].equals(o.chars[b])){T=!1;break}return T},d.copy=function(o){for(var T=0;T<I;T++)this.chars[T].copy(o.chars[T])},d.isEmpty=function(){for(var o=!0,T=0;T<I;T++)if(!this.chars[T].isEmpty()){o=!1;break}return o},d.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(S.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(S.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},d.moveCursor=function(o){var T=this.pos+o;if(o>1)for(var b=this.pos+1;b<T+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(T)},d.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},d.insertChar=function(o){o>=144&&this.backSpace();var T=_(o);if(this.pos>=I){this.logger.log(S.ERROR,"Cannot insert "+o.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},d.clearFromPos=function(o){var T;for(T=o;T<I;T++)this.chars[T].reset()},d.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},d.clearToEndOfRow=function(){this.clearFromPos(this.pos)},d.getTextString=function(){for(var o=[],T=!0,b=0;b<I;b++){var g=this.chars[b].uchar;g!==" "&&(T=!1),o.push(g)}return T?"":o.join("")},d.setPenStyles=function(o){this.currPenState.setStyles(o);var T=this.chars[this.pos];T.setPenState(this.currPenState)},f}(),c=function(){function f(s){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<N;o++)this.rows.push(new a(s));this.logger=s,this.currRow=N-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var d=f.prototype;return d.reset=function(){for(var o=0;o<N;o++)this.rows[o].clear();this.currRow=N-1},d.equals=function(o){for(var T=!0,b=0;b<N;b++)if(!this.rows[b].equals(o.rows[b])){T=!1;break}return T},d.copy=function(o){for(var T=0;T<N;T++)this.rows[T].copy(o.rows[T])},d.isEmpty=function(){for(var o=!0,T=0;T<N;T++)if(!this.rows[T].isEmpty()){o=!1;break}return o},d.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},d.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},d.insertChar=function(o){var T=this.rows[this.currRow];T.insertChar(o)},d.setPen=function(o){var T=this.rows[this.currRow];T.setPenStyles(o)},d.moveCursor=function(o){var T=this.rows[this.currRow];T.moveCursor(o)},d.setCursor=function(o){this.logger.log(S.INFO,"setCursor: "+o);var T=this.rows[this.currRow];T.setCursor(o)},d.setPAC=function(o){this.logger.log(S.INFO,"pacData = "+JSON.stringify(o));var T=o.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var b=0;b<N;b++)this.rows[b].clear();var g=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var j=P.rows[g].cueStartTime,H=this.logger.time;if(j&&H!==null&&j<H)for(var X=0;X<this.nrRollUpRows;X++)this.rows[T-this.nrRollUpRows+X+1].copy(P.rows[g+X])}}this.currRow=T;var W=this.rows[this.currRow];if(o.indent!==null){var U=o.indent,z=Math.max(U-1,0);W.setCursor(o.indent),o.color=W.chars[z].penState.foreground}var Z={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(Z)},d.setBkgData=function(o){this.logger.log(S.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},d.setRollUpRows=function(o){this.nrRollUpRows=o},d.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(S.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(S.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(o,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(S.INFO,"Rolling up")},d.getDisplayText=function(o){o=o||!1;for(var T=[],b="",g=-1,P=0;P<N;P++){var j=this.rows[P].getTextString();j&&(g=P+1,o?T.push("Row "+g+": '"+j+"'"):T.push(j.trim()))}return T.length>0&&(o?b="["+T.join(" | ")+"]":b=T.join(`
|
|
`)),b},d.getTextAndFormat=function(){return this.rows},f}(),C=function(){function f(s,o,T){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=s,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new c(T),this.nonDisplayedMemory=new c(T),this.lastOutputScreen=new c(T),this.currRollUpRow=this.displayedMemory.rows[N-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var d=f.prototype;return d.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[N-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},d.getHandler=function(){return this.outputFilter},d.setHandler=function(o){this.outputFilter=o},d.setPAC=function(o){this.writeScreen.setPAC(o)},d.setBkgData=function(o){this.writeScreen.setBkgData(o)},d.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(S.INFO,"MODE="+o),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=o},d.insertChars=function(o){for(var T=0;T<o.length;T++)this.writeScreen.insertChar(o[T]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(S.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(S.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},d.ccRCL=function(){this.logger.log(S.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},d.ccBS=function(){if(this.logger.log(S.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},d.ccAOF=function(){},d.ccAON=function(){},d.ccDER=function(){this.logger.log(S.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},d.ccRU=function(o){this.logger.log(S.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},d.ccFON=function(){this.logger.log(S.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},d.ccRDC=function(){this.logger.log(S.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},d.ccTR=function(){this.logger.log(S.INFO,"TR"),this.setMode("MODE_TEXT")},d.ccRTD=function(){this.logger.log(S.INFO,"RTD"),this.setMode("MODE_TEXT")},d.ccEDM=function(){this.logger.log(S.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},d.ccCR=function(){this.logger.log(S.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},d.ccENM=function(){this.logger.log(S.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},d.ccEOC=function(){if(this.logger.log(S.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(S.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},d.ccTO=function(o){this.logger.log(S.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},d.ccMIDROW=function(o){var T={flash:!1};if(T.underline=o%2===1,T.italics=o>=46,T.italics)T.foreground="white";else{var b=Math.floor(o/2)-16,g=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=g[b]}this.logger.log(S.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},d.outputDataUpdate=function(o){o===void 0&&(o=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},d.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},f}(),x=function(){function f(s,o,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new p;this.channels=[null,new C(s,o,b),new C(s+1,T,b)],this.cmdHistory=E(),this.logger=b}var d=f.prototype;return d.getHandler=function(o){return this.channels[o].getHandler()},d.setHandler=function(o,T){this.channels[o].setHandler(T)},d.addData=function(o,T){var b,g,P,j=!1;this.logger.time=o;for(var H=0;H<T.length;H+=2){if(g=T[H]&127,P=T[H+1]&127,g===0&&P===0)continue;if(this.logger.log(S.DATA,"["+m([T[H],T[H+1]])+"] -> ("+m([g,P])+")"),b=this.parseCmd(g,P),b||(b=this.parseMidrow(g,P)),b||(b=this.parsePAC(g,P)),b||(b=this.parseBackgroundAttributes(g,P)),!b&&(j=this.parseChars(g,P),j)){var X=this.currentChannel;if(X&&X>0){var W=this.channels[X];W.insertChars(j)}else this.logger.log(S.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!j&&this.logger.log(S.WARNING,"Couldn't parse cleaned data "+m([g,P])+" orig: "+m([T[H],T[H+1]]))}},d.parseCmd=function(o,T){var b=this.cmdHistory,g=(o===20||o===28||o===21||o===29)&&T>=32&&T<=47,P=(o===23||o===31)&&T>=33&&T<=35;if(!(g||P))return!1;if(w(o,T,b))return h(null,null,b),this.logger.log(S.DEBUG,"Repeated command ("+m([o,T])+") is dropped"),!0;var j=o===20||o===21||o===23?1:2,H=this.channels[j];return o===20||o===21||o===28||o===29?T===32?H.ccRCL():T===33?H.ccBS():T===34?H.ccAOF():T===35?H.ccAON():T===36?H.ccDER():T===37?H.ccRU(2):T===38?H.ccRU(3):T===39?H.ccRU(4):T===40?H.ccFON():T===41?H.ccRDC():T===42?H.ccTR():T===43?H.ccRTD():T===44?H.ccEDM():T===45?H.ccCR():T===46?H.ccENM():T===47&&H.ccEOC():H.ccTO(T-32),h(o,T,b),this.currentChannel=j,!0},d.parseMidrow=function(o,T){var b=0;if((o===17||o===25)&&T>=32&&T<=47){if(o===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(S.ERROR,"Mismatch channel in midrow parsing"),!1;var g=this.channels[b];return g?(g.ccMIDROW(T),this.logger.log(S.DEBUG,"MIDROW ("+m([o,T])+")"),!0):!1}return!1},d.parsePAC=function(o,T){var b,g=this.cmdHistory,P=(o>=17&&o<=23||o>=25&&o<=31)&&T>=64&&T<=127,j=(o===16||o===24)&&T>=64&&T<=95;if(!(P||j))return!1;if(w(o,T,g))return h(null,null,g),!0;var H=o<=23?1:2;T>=64&&T<=95?b=H===1?A[o]:v[o]:b=H===1?L[o]:y[o];var X=this.channels[H];return X?(X.setPAC(this.interpretPAC(b,T)),h(o,T,g),this.currentChannel=H,!0):!1},d.interpretPAC=function(o,T){var b,g={color:null,italics:!1,indent:null,underline:!1,row:o};return T>95?b=T-96:b=T-64,g.underline=(b&1)===1,b<=13?g.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(g.italics=!0,g.color="white"):g.indent=Math.floor((b-16)/2)*4,g},d.parseChars=function(o,T){var b,g=null,P=null;if(o>=25?(b=2,P=o-8):(b=1,P=o),P>=17&&P<=19){var j;P===17?j=T+80:P===18?j=T+112:j=T+144,this.logger.log(S.INFO,"Special char '"+_(j)+"' in channel "+b),g=[j]}else o>=32&&o<=127&&(g=T===0?[o]:[o,T]);if(g){var H=m(g);this.logger.log(S.DEBUG,"Char codes = "+H.join(",")),h(o,T,this.cmdHistory)}return g},d.parseBackgroundAttributes=function(o,T){var b=(o===16||o===24)&&T>=32&&T<=47,g=(o===23||o===31)&&T>=45&&T<=47;if(!(b||g))return!1;var P,j={};o===16||o===24?(P=Math.floor((T-32)/2),j.background=O[P],T%2===1&&(j.background=j.background+"_semi")):T===45?j.background="transparent":(j.foreground="black",T===47&&(j.underline=!0));var H=o<=23?1:2,X=this.channels[H];return X.setBkgData(j),h(o,T,this.cmdHistory),!0},d.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var T=this.channels[o];T&&T.reset()}this.cmdHistory=E()},d.cueSplitAtTime=function(o){for(var T=0;T<this.channels.length;T++){var b=this.channels[T];b&&b.cueSplitAtTime(o)}},f}();function h(f,d,s){s.a=f,s.b=d}function w(f,d,s){return s.a===f&&s.b===d}function E(){return{a:null,b:null}}B.default=x},"./src/utils/codecs.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"isCodecType",function(){return M}),D.d(B,"isCodecSupportedInMp4",function(){return _});var F={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function M(N,I){var A=F[I];return!!A&&A[N.slice(0,4)]===!0}function _(N,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+N+'"')}},"./src/utils/cues.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/utils/vttparser.ts"),M=D("./src/utils/webvtt-parser.ts"),_=D("./src/utils/texttrack-utils.ts"),N=/\s/,I={newCue:function(L,v,y,O){for(var S=[],p,m,l,i,a,c=self.VTTCue||self.TextTrackCue,C=0;C<O.rows.length;C++)if(p=O.rows[C],l=!0,i=0,a="",!p.isEmpty()){for(var x=0;x<p.chars.length;x++)N.test(p.chars[x].uchar)&&l?i++:(a+=p.chars[x].uchar,l=!1);p.cueStartTime=v,v===y&&(y+=1e-4),i>=16?i--:i++;var h=Object(F.fixLineBreaks)(a.trim()),w=Object(M.generateCueId)(v,y,h);(!L||!L.cues||!L.cues.getCueById(w))&&(m=new c(v,y,h),m.id=w,m.line=C+1,m.align="left",m.position=10+Math.min(80,Math.floor(i*8/32)*10),S.push(m))}return L&&S.length&&(S.sort(function(E,f){return E.line==="auto"||f.line==="auto"?0:E.line>8&&f.line>8?f.line-E.line:E.line-f.line}),S.forEach(function(E){return Object(_.addCueToTrack)(L,E)})),S}};B.default=I},"./src/utils/discontinuities.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"findFirstFragWithCC",function(){return N}),D.d(B,"shouldAlignOnDiscontinuities",function(){return I}),D.d(B,"findDiscontinuousReferenceFrag",function(){return A}),D.d(B,"adjustSlidingStart",function(){return v}),D.d(B,"alignStream",function(){return y}),D.d(B,"alignPDT",function(){return S}),D.d(B,"alignFragmentByPDTDelta",function(){return p}),D.d(B,"alignMediaPlaylistByPDT",function(){return m});var F=D("./src/polyfills/number.ts"),M=D("./src/utils/logger.ts"),_=D("./src/controller/level-helper.ts");function N(l,i){for(var a=null,c=0,C=l.length;c<C;c++){var x=l[c];if(x&&x.cc===i){a=x;break}}return a}function I(l,i,a){return!!(i.details&&(a.endCC>a.startCC||l&&l.cc<a.startCC))}function A(l,i){var a=l.fragments,c=i.fragments;if(!c.length||!a.length){M.logger.log("No fragments to align");return}var C=N(a,c[0].cc);if(!C||C&&!C.startPTS){M.logger.log("No frag in previous level to align on");return}return C}function L(l,i){if(l){var a=l.start+i;l.start=l.startPTS=a,l.endPTS=a+l.duration}}function v(l,i){for(var a=i.fragments,c=0,C=a.length;c<C;c++)L(a[c],l);i.fragmentHint&&L(i.fragmentHint,l),i.alignedSliding=!0}function y(l,i,a){if(!i)return;O(l,a,i),!a.alignedSliding&&i.details&&S(a,i.details),!a.alignedSliding&&i.details&&!a.skippedSegments&&Object(_.adjustSliding)(i.details,a)}function O(l,i,a){if(I(l,a,i)){var c=A(a.details,i);c&&Object(F.isFiniteNumber)(c.start)&&(M.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),v(c.start,i))}}function S(l,i){if(!i.fragments.length||!l.hasProgramDateTime||!i.hasProgramDateTime)return;var a=i.fragments[0].programDateTime,c=l.fragments[0].programDateTime,C=(c-a)/1e3+i.fragments[0].start;C&&Object(F.isFiniteNumber)(C)&&(M.logger.log("Adjusting PTS using programDateTime delta "+(c-a)+"ms, sliding:"+C.toFixed(3)+" "+l.url+" "),v(C,l))}function p(l,i){var a=l.programDateTime;if(!a)return;var c=(a-i)/1e3;l.start=l.startPTS=c,l.endPTS=c+l.duration}function m(l,i){if(!i.fragments.length||!l.hasProgramDateTime||!i.hasProgramDateTime)return;var a=i.fragments[0].programDateTime,c=i.fragments[0].start,C=a-c*1e3;l.fragments.forEach(function(x){p(x,C)}),l.fragmentHint&&p(l.fragmentHint,C),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/utils/ewma.ts"),M=function(){function _(I,A,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new F.default(I),this.fast_=new F.default(A)}var N=_.prototype;return N.update=function(A,L){var v=this.slow_,y=this.fast_;this.slow_.halfLife!==A&&(this.slow_=new F.default(A,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new F.default(L,y.getEstimate(),y.getTotalWeight()))},N.sample=function(A,L){A=Math.max(A,this.minDelayMs_);var v=8*L,y=A/1e3,O=v/y;this.fast_.sample(y,O),this.slow_.sample(y,O)},N.canEstimate=function(){var A=this.fast_;return A&&A.getTotalWeight()>=this.minWeight_},N.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},N.destroy=function(){},_}();B.default=M},"./src/utils/ewma.ts":function(V,B,D){"use strict";D.r(B);var F=function(){function M(N,I,A){I===void 0&&(I=0),A===void 0&&(A=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=N,this.alpha_=N?Math.exp(Math.log(.5)/N):0,this.estimate_=I,this.totalWeight_=A}var _=M.prototype;return _.sample=function(I,A){var L=Math.pow(this.alpha_,I);this.estimate_=A*(1-L)+L*this.estimate_,this.totalWeight_+=I},_.getTotalWeight=function(){return this.totalWeight_},_.getEstimate=function(){if(this.alpha_){var I=1-Math.pow(this.alpha_,this.totalWeight_);if(I)return this.estimate_/I}return this.estimate_},M}();B.default=F},"./src/utils/fetch-loader.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"fetchSupported",function(){return p});var F=D("./src/polyfills/number.ts"),M=D("./src/loader/load-stats.ts"),_=D("./src/demux/chunk-cache.ts");function N(c,C){c.prototype=Object.create(C.prototype),c.prototype.constructor=c,y(c,C)}function I(c){var C=typeof Map=="function"?new Map:void 0;return I=function(h){if(h===null||!v(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(h))return C.get(h);C.set(h,w)}function w(){return A(h,arguments,O(this).constructor)}return w.prototype=Object.create(h.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),y(w,h)},I(c)}function A(c,C,x){return L()?A=Reflect.construct:A=function(w,E,f){var d=[null];d.push.apply(d,E);var s=Function.bind.apply(w,d),o=new s;return f&&y(o,f.prototype),o},A.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function v(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function y(c,C){return y=Object.setPrototypeOf||function(h,w){return h.__proto__=w,h},y(c,C)}function O(c){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},O(c)}function S(){return S=Object.assign||function(c){for(var C=1;C<arguments.length;C++){var x=arguments[C];for(var h in x)Object.prototype.hasOwnProperty.call(x,h)&&(c[h]=x[h])}return c},S.apply(this,arguments)}function p(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(c){}return!1}var m=function(){function c(x){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=x.fetchSetup||i,this.controller=new self.AbortController,this.stats=new M.LoadStats}var C=c.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var h=this.response;(!h||!h.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(h,w,E){var f=this,d=this.stats;if(d.loading.start)throw new Error("Loader can only be used once.");d.loading.start=self.performance.now();var s=l(h,this.controller.signal),o=E.onProgress,T=h.responseType==="arraybuffer",b=T?"byteLength":"length";this.context=h,this.config=w,this.callbacks=E,this.request=this.fetchSetup(h,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),E.onTimeout(d,h,f.response)},w.timeout),self.fetch(this.request).then(function(g){if(f.response=f.loader=g,!g.ok){var P=g.status,j=g.statusText;throw new a(j||"fetch, bad network response",P,g)}return d.loading.first=Math.max(self.performance.now(),d.loading.start),d.total=parseInt(g.headers.get("Content-Length")||"0"),o&&Object(F.isFiniteNumber)(w.highWaterMark)?f.loadProgressively(g,d,h,w.highWaterMark,o):T?g.arrayBuffer():g.text()}).then(function(g){var P=f.response;self.clearTimeout(f.requestTimeout),d.loading.end=Math.max(self.performance.now(),d.loading.first),d.loaded=d.total=g[b];var j={url:P.url,data:g};o&&!Object(F.isFiniteNumber)(w.highWaterMark)&&o(d,h,g,P),E.onSuccess(j,d,h,P)}).catch(function(g){if(self.clearTimeout(f.requestTimeout),d.aborted)return;var P=g.code||0;E.onError({code:P,text:g.message},h,g.details)})},C.getCacheAge=function(){var h=null;if(this.response){var w=this.response.headers.get("age");h=w?parseFloat(w):null}return h},C.loadProgressively=function(h,w,E,f,d){f===void 0&&(f=0);var s=new _.default,o=h.body.getReader(),T=function b(){return o.read().then(function(g){if(g.done)return s.dataLength&&d(w,E,s.flush(),h),Promise.resolve(new ArrayBuffer(0));var P=g.value,j=P.length;return w.loaded+=j,j<f||s.dataLength?(s.push(P),s.dataLength>=f&&d(w,E,s.flush(),h)):d(w,E,P,h),b()}).catch(function(){return Promise.reject()})};return T()},c}();function l(c,C){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(S({},c.headers))};return c.rangeEnd&&x.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),x}function i(c,C){return new self.Request(c.url,C)}var a=function(c){N(C,c);function C(x,h,w){var E;return E=c.call(this,x)||this,E.code=void 0,E.details=void 0,E.code=h,E.details=w,E}return C}(I(Error));B.default=m},"./src/utils/imsc1-ttml-parser.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"IMSC1_CODEC",function(){return v}),D.d(B,"parseIMSC1",function(){return p});var F=D("./src/utils/mp4-tools.ts"),M=D("./src/utils/vttparser.ts"),_=D("./src/utils/vttcue.ts"),N=D("./src/demux/id3.ts"),I=D("./src/utils/timescale-conversion.ts"),A=D("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(f){for(var d=1;d<arguments.length;d++){var s=arguments[d];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(f[o]=s[o])}return f},L.apply(this,arguments)}var v="stpp.ttml.im1t",y=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,O=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,S={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(f,d,s,o,T){var b=Object(F.findBox)(new Uint8Array(f),["mdat"]);if(b.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var g=b[0],P=Object(N.utf8ArrayToStr)(new Uint8Array(f,g.start,g.end-g.start)),j=Object(I.toTimescaleFromScale)(d,1,s);try{o(m(P,j))}catch(H){T(H)}}function m(f,d){var s=new DOMParser,o=s.parseFromString(f,"text/xml"),T=o.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},g=Object.keys(b).reduce(function(W,U){return W[U]=T.getAttribute("ttp:"+U)||b[U],W},{}),P=T.getAttribute("xml:space")!=="preserve",j=i(l(T,"styling","style")),H=i(l(T,"layout","region")),X=l(T,"body","[begin]");return[].map.call(X,function(W){var U=a(W,P);if(!U||!W.hasAttribute("begin"))return null;var z=h(W.getAttribute("begin"),g),Z=h(W.getAttribute("dur"),g),q=h(W.getAttribute("end"),g);if(z===null)throw x(W);if(q===null){if(Z===null)throw x(W);q=z+Z}var oe=new _.default(z-d,q-d,U);oe.id=Object(A.generateCueId)(oe.startTime,oe.endTime,oe.text);var ye=H[W.getAttribute("region")],me=j[W.getAttribute("style")];oe.position=10,oe.size=80;var fe=c(ye,me),ve=fe.textAlign;if(ve){var ge=S[ve];ge&&(oe.lineAlign=ge),oe.align=ve}return L(oe,fe),oe}).filter(function(W){return W!==null})}function l(f,d,s){var o=f.getElementsByTagName(d)[0];return o?[].slice.call(o.querySelectorAll(s)):[]}function i(f){return f.reduce(function(d,s){var o=s.getAttribute("xml:id");return o&&(d[o]=s),d},{})}function a(f,d){return[].slice.call(f.childNodes).reduce(function(s,o,T){var b;return o.nodeName==="br"&&T?s+`
|
|
`:(b=o.childNodes)!==null&&b!==void 0&&b.length?a(o,d):d?s+o.textContent.trim().replace(/\s+/g," "):s+o.textContent},"")}function c(f,d){var s="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(T,b){var g=C(d,s,b)||C(f,s,b);return g&&(T[b]=g),T},{})}function C(f,d,s){return f.hasAttributeNS(d,s)?f.getAttributeNS(d,s):null}function x(f){return new Error("Could not parse ttml timestamp "+f)}function h(f,d){if(!f)return null;var s=Object(M.parseTimeStamp)(f);return s===null&&(y.test(f)?s=w(f,d):O.test(f)&&(s=E(f,d))),s}function w(f,d){var s=y.exec(f),o=(s[4]|0)+(s[5]|0)/d.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+o/d.frameRate}function E(f,d){var s=O.exec(f),o=Number(s[1]),T=s[2];switch(T){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/d.frameRate;case"t":return o/d.tickRate}return o}},"./src/utils/logger.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"enableLogs",function(){return A}),D.d(B,"logger",function(){return L});var F=function(){},M={trace:F,debug:F,log:F,warn:F,info:F,error:F},_=M;function N(v){var y=self.console[v];return y?y.bind(self.console,"["+v+"] >"):F}function I(v){for(var y=arguments.length,O=new Array(y>1?y-1:0),S=1;S<y;S++)O[S-1]=arguments[S];O.forEach(function(p){_[p]=v[p]?v[p].bind(v):N(p)})}function A(v){if(self.console&&v===!0||typeof v=="object"){I(v,"debug","log","info","warn","error");try{_.log()}catch(y){_=M}}else _=M}var L=_},"./src/utils/mediakeys-helper.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"KeySystems",function(){return F}),D.d(B,"requestMediaKeySystemAccess",function(){return M});var F;(function(_){_.WIDEVINE="com.widevine.alpha",_.PLAYREADY="com.microsoft.playready"})(F||(F={}));var M=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"getMediaSource",function(){return F});function F(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"bin2str",function(){return I}),D.d(B,"readUint16",function(){return A}),D.d(B,"readUint32",function(){return L}),D.d(B,"writeUint32",function(){return v}),D.d(B,"findBox",function(){return y}),D.d(B,"parseSegmentIndex",function(){return O}),D.d(B,"parseInitSegment",function(){return S}),D.d(B,"getStartDTS",function(){return p}),D.d(B,"getDuration",function(){return m}),D.d(B,"computeRawDurationFromSamples",function(){return l}),D.d(B,"offsetStartDTS",function(){return i}),D.d(B,"segmentValidRange",function(){return a}),D.d(B,"appendUint8Array",function(){return c});var F=D("./src/utils/typed-array.ts"),M=D("./src/loader/fragment.ts"),_=Math.pow(2,32)-1,N=[].push;function I(C){return String.fromCharCode.apply(null,C)}function A(C,x){"data"in C&&(x+=C.start,C=C.data);var h=C[x]<<8|C[x+1];return h<0?65536+h:h}function L(C,x){"data"in C&&(x+=C.start,C=C.data);var h=C[x]<<24|C[x+1]<<16|C[x+2]<<8|C[x+3];return h<0?4294967296+h:h}function v(C,x,h){"data"in C&&(x+=C.start,C=C.data),C[x]=h>>24,C[x+1]=h>>16&255,C[x+2]=h>>8&255,C[x+3]=h&255}function y(C,x){var h=[];if(!x.length)return h;var w,E,f;"data"in C?(w=C.data,E=C.start,f=C.end):(w=C,E=0,f=w.byteLength);for(var d=E;d<f;){var s=L(w,d),o=I(w.subarray(d+4,d+8)),T=s>1?d+s:f;if(o===x[0])if(x.length===1)h.push({data:w,start:d+8,end:T});else{var b=y({data:w,start:d+8,end:T},x.slice(1));b.length&&N.apply(h,b)}d=T}return h}function O(C){var x=y(C,["moov"]),h=x[0],w=h?h.end:null,E=y(C,["sidx"]);if(!E||!E[0])return null;var f=[],d=E[0],s=d.data[0],o=s===0?8:16,T=L(d,o);o+=4;var b=0,g=0;s===0?o+=8:o+=16,o+=2;var P=d.end+g,j=A(d,o);o+=2;for(var H=0;H<j;H++){var X=o,W=L(d,X);X+=4;var U=W&2147483647,z=(W&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=L(d,X);X+=4,f.push({referenceSize:U,subsegmentDuration:Z,info:{duration:Z/T,start:P,end:P+U-1}}),P+=U,X+=4,o=X}return{earliestPresentationTime:b,timescale:T,version:s,referencesCount:j,references:f,moovEndOffset:w}}function S(C){for(var x=[],h=y(C,["moov","trak"]),w=0;w<h.length;w++){var E=h[w],f=y(E,["tkhd"])[0];if(f){var d=f.data[f.start],s=d===0?12:20,o=L(f,s),T=y(E,["mdia","mdhd"])[0];if(T){d=T.data[T.start],s=d===0?12:20;var b=L(T,s),g=y(E,["mdia","hdlr"])[0];if(g){var P=I(g.data.subarray(g.start+8,g.start+12)),j={soun:M.ElementaryStreamTypes.AUDIO,vide:M.ElementaryStreamTypes.VIDEO}[P];if(j){var H=y(E,["mdia","minf","stbl","stsd"])[0],X=void 0;H&&(X=I(H.data.subarray(H.start+12,H.start+16))),x[o]={timescale:b,type:j},x[j]={timescale:b,id:o,codec:X}}}}}}var W=y(C,["moov","mvex","trex"]);return W.forEach(function(U){var z=L(U,4),Z=x[z];Z&&(Z.default={duration:L(U,12),flags:L(U,20)})}),x}function p(C,x){return y(x,["moof","traf"]).reduce(function(h,w){var E=y(w,["tfdt"])[0],f=E.data[E.start],d=y(w,["tfhd"]).reduce(function(s,o){var T=L(o,4),b=C[T];if(b){var g=L(E,4);f===1&&(g*=Math.pow(2,32),g+=L(E,8));var P=b.timescale||9e4,j=g/P;if(isFinite(j)&&(s===null||j<s))return j}return s},null);return d!==null&&isFinite(d)&&(h===null||d<h)?d:h},null)||0}function m(C,x){for(var h=0,w=0,E=0,f=y(C,["moof","traf"]),d=0;d<f.length;d++){var s=f[d],o=y(s,["tfhd"])[0],T=L(o,4),b=x[T];if(!b)continue;var g=b.default,P=L(o,0)|(g==null?void 0:g.flags),j=g==null?void 0:g.duration;P&8&&(P&2?j=L(o,12):j=L(o,8));for(var H=b.timescale||9e4,X=y(s,["trun"]),W=0;W<X.length;W++){if(j){var U=L(X[W],4);h=j*U}else h=l(X[W]);b.type===M.ElementaryStreamTypes.VIDEO?w+=h/H:b.type===M.ElementaryStreamTypes.AUDIO&&(E+=h/H)}}if(w===0&&E===0){var z=O(C);if(z!=null&&z.references)return z.references.reduce(function(Z,q){return Z+q.info.duration||0},0)}return w||E}function l(C){var x=L(C,0),h=8;x&1&&(h+=4),x&4&&(h+=4);for(var w=0,E=L(C,4),f=0;f<E;f++){if(x&256){var d=L(C,h);w+=d,h+=4}x&512&&(h+=4),x&1024&&(h+=4),x&2048&&(h+=4)}return w}function i(C,x,h){y(x,["moof","traf"]).forEach(function(w){y(w,["tfhd"]).forEach(function(E){var f=L(E,4),d=C[f];if(!d)return;var s=d.timescale||9e4;y(w,["tfdt"]).forEach(function(o){var T=o.data[o.start],b=L(o,4);if(T===0)v(o,4,b-h*s);else{b*=Math.pow(2,32),b+=L(o,8),b-=h*s,b=Math.max(b,0);var g=Math.floor(b/(_+1)),P=Math.floor(b%(_+1));v(o,4,g),v(o,8,P)}})})})}function a(C){var x={valid:null,remainder:null},h=y(C,["moof"]);if(h){if(h.length<2)return x.remainder=C,x}else return x;var w=h[h.length-1];return x.valid=Object(F.sliceUint8)(C,0,w.start-8),x.remainder=Object(F.sliceUint8)(C,w.start-8),x}function c(C,x){var h=new Uint8Array(C.length+x.length);return h.set(C),h.set(x,C.length),h}},"./src/utils/output-filter.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"default",function(){return F});var F=function(){function M(N,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=N,this.trackName=I}var _=M.prototype;return _.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},_.newCue=function(I,A,L){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=A,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},_.reset=function(){this.cueRanges=[]},M}()},"./src/utils/texttrack-utils.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"sendAddTrackEvent",function(){return M}),D.d(B,"addCueToTrack",function(){return _}),D.d(B,"clearCurrentCues",function(){return N}),D.d(B,"removeCuesInRange",function(){return I}),D.d(B,"getCuesInRange",function(){return L});var F=D("./src/utils/logger.ts");function M(v,y){var O;try{O=new Event("addtrack")}catch(S){O=document.createEvent("Event"),O.initEvent("addtrack",!1,!1)}O.track=v,y.dispatchEvent(O)}function _(v,y){var O=v.mode;if(O==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(y.id))try{if(v.addCue(y),!v.cues.getCueById(y.id))throw new Error("addCue is failed for: "+y)}catch(p){F.logger.debug("[texttrack-utils]: "+p);var S=new self.TextTrackCue(y.startTime,y.endTime,y.text);S.id=y.id,v.addCue(S)}O==="disabled"&&(v.mode=O)}function N(v){var y=v.mode;if(y==="disabled"&&(v.mode="hidden"),v.cues)for(var O=v.cues.length;O--;)v.removeCue(v.cues[O]);y==="disabled"&&(v.mode=y)}function I(v,y,O){var S=v.mode;if(S==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var p=L(v.cues,y,O),m=0;m<p.length;m++)v.removeCue(p[m]);S==="disabled"&&(v.mode=S)}function A(v,y){if(y<v[0].startTime)return 0;var O=v.length-1;if(y>v[O].endTime)return-1;for(var S=0,p=O;S<=p;){var m=Math.floor((p+S)/2);if(y<v[m].startTime)p=m-1;else if(y>v[m].startTime&&S<O)S=m+1;else return m}return v[S].startTime-y<y-v[p].startTime?S:p}function L(v,y,O){var S=[],p=A(v,y);if(p>-1)for(var m=p,l=v.length;m<l;m++){var i=v[m];if(i.startTime>=y&&i.endTime<=O)S.push(i);else if(i.startTime>O)return S}return S}},"./src/utils/time-ranges.ts":function(V,B,D){"use strict";D.r(B);var F={toString:function(_){for(var N="",I=_.length,A=0;A<I;A++)N+="["+_.start(A).toFixed(3)+","+_.end(A).toFixed(3)+"]";return N}};B.default=F},"./src/utils/timescale-conversion.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"toTimescaleFromBase",function(){return M}),D.d(B,"toTimescaleFromScale",function(){return _}),D.d(B,"toMsFromMpegTsClock",function(){return N}),D.d(B,"toMpegTsClockFromTimescale",function(){return I});var F=9e4;function M(A,L,v,y){v===void 0&&(v=1),y===void 0&&(y=!1);var O=A*L*v;return y?Math.round(O):O}function _(A,L,v,y){return v===void 0&&(v=1),y===void 0&&(y=!1),M(A,L,1/v,y)}function N(A,L){return L===void 0&&(L=!1),M(A,1e3,1/F,L)}function I(A,L){return L===void 0&&(L=1),M(A,F,1/L)}},"./src/utils/typed-array.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"sliceUint8",function(){return F});function F(M,_,N){return Uint8Array.prototype.slice?M.slice(_,N):new Uint8Array(Array.prototype.slice.call(M,_,N))}},"./src/utils/vttcue.ts":function(V,B,D){"use strict";D.r(B),B.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var F=["","lr","rl"],M=["start","middle","end","left","right"];function _(v,y){if(typeof y!="string")return!1;if(!Array.isArray(v))return!1;var O=y.toLowerCase();return~v.indexOf(O)?O:!1}function N(v){return _(F,v)}function I(v){return _(M,v)}function A(v){for(var y=arguments.length,O=new Array(y>1?y-1:0),S=1;S<y;S++)O[S-1]=arguments[S];for(var p=1;p<arguments.length;p++){var m=arguments[p];for(var l in m)v[l]=m[l]}return v}function L(v,y,O){var S=this,p={enumerable:!0};S.hasBeenReset=!1;var m="",l=!1,i=v,a=y,c=O,C=null,x="",h=!0,w="auto",E="start",f=50,d="middle",s=50,o="middle";Object.defineProperty(S,"id",A({},p,{get:function(){return m},set:function(b){m=""+b}})),Object.defineProperty(S,"pauseOnExit",A({},p,{get:function(){return l},set:function(b){l=!!b}})),Object.defineProperty(S,"startTime",A({},p,{get:function(){return i},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");i=b,this.hasBeenReset=!0}})),Object.defineProperty(S,"endTime",A({},p,{get:function(){return a},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");a=b,this.hasBeenReset=!0}})),Object.defineProperty(S,"text",A({},p,{get:function(){return c},set:function(b){c=""+b,this.hasBeenReset=!0}})),Object.defineProperty(S,"region",A({},p,{get:function(){return C},set:function(b){C=b,this.hasBeenReset=!0}})),Object.defineProperty(S,"vertical",A({},p,{get:function(){return x},set:function(b){var g=N(b);if(g===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=g,this.hasBeenReset=!0}})),Object.defineProperty(S,"snapToLines",A({},p,{get:function(){return h},set:function(b){h=!!b,this.hasBeenReset=!0}})),Object.defineProperty(S,"line",A({},p,{get:function(){return w},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=b,this.hasBeenReset=!0}})),Object.defineProperty(S,"lineAlign",A({},p,{get:function(){return E},set:function(b){var g=I(b);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");E=g,this.hasBeenReset=!0}})),Object.defineProperty(S,"position",A({},p,{get:function(){return f},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");f=b,this.hasBeenReset=!0}})),Object.defineProperty(S,"positionAlign",A({},p,{get:function(){return d},set:function(b){var g=I(b);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");d=g,this.hasBeenReset=!0}})),Object.defineProperty(S,"size",A({},p,{get:function(){return s},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");s=b,this.hasBeenReset=!0}})),Object.defineProperty(S,"align",A({},p,{get:function(){return o},set:function(b){var g=I(b);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");o=g,this.hasBeenReset=!0}})),S.displayState=void 0}return L.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"parseTimeStamp",function(){return _}),D.d(B,"fixLineBreaks",function(){return y}),D.d(B,"VTTParser",function(){return O});var F=D("./src/utils/vttcue.ts"),M=function(){function S(){}var p=S.prototype;return p.decode=function(l,i){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},S}();function _(S){function p(l,i,a,c){return(l|0)*3600+(i|0)*60+(a|0)+parseFloat(c||0)}var m=S.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return m?parseFloat(m[2])>59?p(m[2],m[3],0,m[4]):p(m[1],m[2],m[3],m[4]):null}var N=function(){function S(){this.values=Object.create(null)}var p=S.prototype;return p.set=function(l,i){!this.get(l)&&i!==""&&(this.values[l]=i)},p.get=function(l,i,a){return a?this.has(l)?this.values[l]:i[a]:this.has(l)?this.values[l]:i},p.has=function(l){return l in this.values},p.alt=function(l,i,a){for(var c=0;c<a.length;++c)if(i===a[c]){this.set(l,i);break}},p.integer=function(l,i){/^-?\d+$/.test(i)&&this.set(l,parseInt(i,10))},p.percent=function(l,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var a=parseFloat(i);if(a>=0&&a<=100)return this.set(l,a),!0}return!1},S}();function I(S,p,m,l){var i=l?S.split(l):[S];for(var a in i){if(typeof i[a]!="string")continue;var c=i[a].split(m);if(c.length!==2)continue;var C=c[0],x=c[1];p(C,x)}}var A=new F.default(0,0,""),L=A.align==="middle"?"middle":"center";function v(S,p,m){var l=S;function i(){var C=_(S);if(C===null)throw new Error("Malformed timestamp: "+l);return S=S.replace(/^[^\sa-zA-Z-]+/,""),C}function a(C,x){var h=new N;I(C,function(f,d){var s;switch(f){case"region":for(var o=m.length-1;o>=0;o--)if(m[o].id===d){h.set(f,m[o].region);break}break;case"vertical":h.alt(f,d,["rl","lr"]);break;case"line":s=d.split(","),h.integer(f,s[0]),h.percent(f,s[0])&&h.set("snapToLines",!1),h.alt(f,s[0],["auto"]),s.length===2&&h.alt("lineAlign",s[1],["start",L,"end"]);break;case"position":s=d.split(","),h.percent(f,s[0]),s.length===2&&h.alt("positionAlign",s[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":h.percent(f,d);break;case"align":h.alt(f,d,["start",L,"end","left","right"]);break}},/:/,/\s/),x.region=h.get("region",null),x.vertical=h.get("vertical","");var w=h.get("line","auto");w==="auto"&&A.line===-1&&(w=-1),x.line=w,x.lineAlign=h.get("lineAlign","start"),x.snapToLines=h.get("snapToLines",!0),x.size=h.get("size",100),x.align=h.get("align",L);var E=h.get("position","auto");E==="auto"&&A.position===50&&(E=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=E}function c(){S=S.replace(/^\s+/,"")}if(c(),p.startTime=i(),c(),S.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);S=S.substr(3),c(),p.endTime=i(),c(),a(S,p)}function y(S){return S.replace(/<br(?: \/)?>/gi,`
|
|
`)}var O=function(){function S(){this.state="INITIAL",this.buffer="",this.decoder=new M,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var p=S.prototype;return p.parse=function(l){var i=this;l&&(i.buffer+=i.decoder.decode(l,{stream:!0}));function a(){var E=i.buffer,f=0;for(E=y(E);f<E.length&&E[f]!=="\r"&&E[f]!==`
|
|
`;)++f;var d=E.substr(0,f);return E[f]==="\r"&&++f,E[f]===`
|
|
`&&++f,i.buffer=E.substr(f),d}function c(E){I(E,function(f,d){},/:/)}try{var C="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;C=a();var x=C.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var h=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;h?h=!1:C=a();switch(i.state){case"HEADER":/:/.test(C)?c(C):C||(i.state="ID");continue;case"NOTE":C||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){i.state="NOTE";break}if(!C)continue;if(i.cue=new F.default(0,0,""),i.state="CUE",C.indexOf("-->")===-1){i.cue.id=C;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{v(C,i.cue,i.regionList)}catch(E){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var w=C.indexOf("-->")!==-1;if(!C||w&&(h=!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+=C}continue;case"BADCUE":C||(i.state="ID")}}}catch(E){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},p.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
|
|
|
|
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){l.onparsingerror&&l.onparsingerror(i)}return l.onflush&&l.onflush(),this},S}()},"./src/utils/webvtt-parser.ts":function(V,B,D){"use strict";D.r(B),D.d(B,"generateCueId",function(){return O}),D.d(B,"parseWebVTT",function(){return p});var F=D("./src/polyfills/number.ts"),M=D("./src/utils/vttparser.ts"),_=D("./src/demux/id3.ts"),N=D("./src/utils/timescale-conversion.ts"),I=D("./src/remux/mp4-remuxer.ts"),A=/\r\n|\n\r|\n|\r/g,L=function(l,i,a){return a===void 0&&(a=0),l.substr(a,i.length)===i},v=function(l){var i=parseInt(l.substr(-3)),a=parseInt(l.substr(-6,2)),c=parseInt(l.substr(-9,2)),C=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(F.isFiniteNumber)(i)||!Object(F.isFiniteNumber)(a)||!Object(F.isFiniteNumber)(c)||!Object(F.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return i+=1e3*a,i+=60*1e3*c,i+=60*60*1e3*C,i},y=function(l){for(var i=5381,a=l.length;a;)i=i*33^l.charCodeAt(--a);return(i>>>0).toString()};function O(m,l,i){return y(m.toString())+y(l.toString())+y(i)}var S=function(l,i,a){var c=l[i],C=l[c.prevCC];if(!C||!C.new&&c.new){l.ccOffset=l.presentationOffset=c.start,c.new=!1;return}for(;(x=C)!==null&&x!==void 0&&x.new;){var x;l.ccOffset+=c.start-C.start,c.new=!1,c=C,C=l[c.prevCC]}l.presentationOffset=a};function p(m,l,i,a,c,C,x,h){var w=new M.VTTParser,E=Object(_.utf8ArrayToStr)(new Uint8Array(m)).trim().replace(A,`
|
|
`).split(`
|
|
`),f=[],d=Object(N.toMpegTsClockFromTimescale)(l,i),s="00:00.000",o=0,T=0,b,g=!0,P=!1;w.oncue=function(j){var H=a[c],X=a.ccOffset,W=(o-d)/9e4;if(H!=null&&H.new&&(T!==void 0?X=a.ccOffset=H.start:S(a,c,W)),W&&(X=W-a.presentationOffset),P){var U=j.endTime-j.startTime,z=Object(I.normalizePts)((j.startTime+X-T)*9e4,C*9e4)/9e4;j.startTime=z,j.endTime=z+U}var Z=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(Z)),j.id||(j.id=O(j.startTime,j.endTime,Z)),j.endTime>0&&f.push(j)},w.onparsingerror=function(j){b=j},w.onflush=function(){if(b){h(b);return}x(f)},E.forEach(function(j){if(g)if(L(j,"X-TIMESTAMP-MAP=")){g=!1,P=!0,j.substr(16).split(",").forEach(function(H){L(H,"LOCAL:")?s=H.substr(6):L(H,"MPEGTS:")&&(o=parseInt(H.substr(7)))});try{T=v(s)/1e3}catch(H){P=!1,b=H}return}else j===""&&(g=!1);w.parse(j+`
|
|
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(V,B,D){"use strict";D.r(B);var F=D("./src/utils/logger.ts"),M=D("./src/loader/load-stats.ts"),_=/^age:\s*[\d.]+\s*$/m,N=function(){function I(L){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=L?L.xhrSetup:null,this.stats=new M.LoadStats,this.retryDelay=0}var A=I.prototype;return A.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},A.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},A.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},A.load=function(v,y,O){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=y,this.callbacks=O,this.retryDelay=y.retryDelay,this.loadInternal()},A.loadInternal=function(){var v=this.config,y=this.context;if(!v)return;var O=this.loader=new self.XMLHttpRequest,S=this.stats;S.loading.first=0,S.loaded=0;var p=this.xhrSetup;try{if(p)try{p(O,y.url)}catch(i){O.open("GET",y.url,!0),p(O,y.url)}O.readyState||O.open("GET",y.url,!0);var m=this.context.headers;if(m)for(var l in m)O.setRequestHeader(l,m[l])}catch(i){this.callbacks.onError({code:O.status,text:i.message},y,O);return}y.rangeEnd&&O.setRequestHeader("Range","bytes="+y.rangeStart+"-"+(y.rangeEnd-1)),O.onreadystatechange=this.readystatechange.bind(this),O.onprogress=this.loadprogress.bind(this),O.responseType=y.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),O.send()},A.readystatechange=function(){var v=this.context,y=this.loader,O=this.stats;if(!v||!y)return;var S=y.readyState,p=this.config;if(O.aborted)return;if(S>=2)if(self.clearTimeout(this.requestTimeout),O.loading.first===0&&(O.loading.first=Math.max(self.performance.now(),O.loading.start)),S===4){y.onreadystatechange=null,y.onprogress=null;var m=y.status;if(m>=200&&m<300){O.loading.end=Math.max(self.performance.now(),O.loading.first);var l,i;if(v.responseType==="arraybuffer"?(l=y.response,i=l.byteLength):(l=y.responseText,i=l.length),O.loaded=O.total=i,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(O,v,l,y),!this.callbacks)return;var c={url:y.responseURL,data:l};this.callbacks.onSuccess(c,O,v,y)}else O.retry>=p.maxRetry||m>=400&&m<499?(F.logger.error(m+" while loading "+v.url),this.callbacks.onError({code:m,text:y.statusText},v,y)):(F.logger.warn(m+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,p.maxRetryDelay),O.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout)},A.loadtimeout=function(){F.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},A.loadprogress=function(v){var y=this.stats;y.loaded=v.loaded,v.lengthComputable&&(y.total=v.total)},A.getCacheAge=function(){var v=null;if(this.loader&&_.test(this.loader.getAllResponseHeaders())){var y=this.loader.getResponseHeader("age");v=y?parseFloat(y):null}return v},I}();B.default=N}}).default})},vHTk:function(Ie,Ee,k){Ie.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return ot});var V=k("rePB"),B=k("VTBJ"),D=k("KQm4"),F=k("U8pU"),M=k("ODXe"),_=k("cDcd"),N=k("TSYQ"),I=k.n(N),A=k("Gytx"),L=k.n(A),v=k("Kwbf"),y=k("t23M"),O=k("qx4F"),S=k("6eGT"),p=k("IBYe"),m=k("Ff2n"),l=k("c+Xe"),i=k("fyJ8"),a=k("biw7");function c(be,pe,ke,Ne,xe){var Re=ke[be]||{},de=ke[pe]||{},re,ne;Re.fixed==="left"?re=Ne.left[be]:de.fixed==="right"&&(ne=Ne.right[pe]);var $=!1,Q=!1,te=!1,ie=!1,ue=ke[pe+1],Ce=ke[be-1];if(xe==="rtl"){if(re!==void 0){var Oe=Ce&&Ce.fixed==="left";ie=!Oe}else if(ne!==void 0){var Fe=ue&&ue.fixed==="right";te=!Fe}}else if(re!==void 0){var tt=ue&&ue.fixed==="left";$=!tt}else if(ne!==void 0){var Ve=Ce&&Ce.fixed==="right";Q=!Ve}return{fixLeft:re,fixRight:ne,lastFixLeft:$,firstFixRight:Q,lastFixRight:te,firstFixLeft:ie,isSticky:Ne.isSticky}}var C=k("sR1s");function x(be){var pe=be.cells,ke=be.stickyOffsets,Ne=be.flattenColumns,xe=be.rowComponent,Re=be.cellComponent,de=be.onHeaderRow,re=be.index,ne=_.useContext(a.a),$=ne.prefixCls,Q=ne.direction,te;de&&(te=de(pe.map(function(ue){return ue.column}),re));var ie=Object(C.a)(pe.map(function(ue){return ue.column}));return _.createElement(xe,Object.assign({},te),pe.map(function(ue,Ce){var Oe=ue.column,Fe=c(ue.colStart,ue.colEnd,Ne,ke,Q),tt;return Oe&&Oe.onHeaderCell&&(tt=ue.column.onHeaderCell(Oe)),_.createElement(i.a,Object.assign({},ue,{ellipsis:Oe.ellipsis,align:Oe.align,component:Re,prefixCls:$,key:ie[Ce]},Fe,{additionalProps:tt,rowType:"header"}))}))}x.displayName="HeaderRow";var h=x;function w(be){var pe=[];function ke(de,re){var ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;pe[ne]=pe[ne]||[];var $=re,Q=de.filter(Boolean).map(function(te){var ie={key:te.key,className:te.className||"",children:te.title,column:te,colStart:$},ue=1,Ce=te.children;return Ce&&Ce.length>0&&(ue=ke(Ce,$,ne+1).reduce(function(Oe,Fe){return Oe+Fe},0),ie.hasSubColumns=!0),"colSpan"in te&&(ue=te.colSpan),"rowSpan"in te&&(ie.rowSpan=te.rowSpan),ie.colSpan=ue,ie.colEnd=ie.colStart+ue-1,pe[ne].push(ie),$+=ue,ue});return Q}ke(be,0);for(var Ne=pe.length,xe=function(re){pe[re].forEach(function(ne){!("rowSpan"in ne)&&!ne.hasSubColumns&&(ne.rowSpan=Ne-re)})},Re=0;Re<Ne;Re+=1)xe(Re);return pe}function E(be){var pe=be.stickyOffsets,ke=be.columns,Ne=be.flattenColumns,xe=be.onHeaderRow,Re=_.useContext(a.a),de=Re.prefixCls,re=Re.getComponent,ne=_.useMemo(function(){return w(ke)},[ke]),$=re(["header","wrapper"],"thead"),Q=re(["header","row"],"tr"),te=re(["header","cell"],"th");return _.createElement($,{className:"".concat(de,"-thead")},ne.map(function(ie,ue){var Ce=_.createElement(h,{key:ue,flattenColumns:Ne,cells:ie,stickyOffsets:pe,rowComponent:Q,cellComponent:te,onHeaderRow:xe,index:ue});return Ce}))}var f=E,d=k("hW8S");function s(be){for(var pe=be.colWidths,ke=be.columns,Ne=be.columCount,xe=[],Re=Ne||ke.length,de=!1,re=Re-1;re>=0;re-=1){var ne=pe[re],$=ke&&ke[re],Q=$&&$[d.a];(ne||Q||de)&&(xe.unshift(_.createElement("col",Object.assign({key:re,style:{width:ne,minWidth:ne}},Q))),de=!0)}return _.createElement("colgroup",null,xe)}var o=s;function T(be,pe){return Object(_.useMemo)(function(){for(var ke=[],Ne=0;Ne<pe;Ne+=1){var xe=be[Ne];if(xe!==void 0)ke[Ne]=xe;else return null}return ke},[be.join("_"),pe])}var b=_.forwardRef(function(be,pe){var ke=be.noData,Ne=be.columns,xe=be.flattenColumns,Re=be.colWidths,de=be.columCount,re=be.stickyOffsets,ne=be.direction,$=be.fixHeader,Q=be.offsetHeader,te=be.stickyClassName,ie=be.onScroll,ue=Object(m.a)(be,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ce=_.useContext(a.a),Oe=Ce.prefixCls,Fe=Ce.scrollbarSize,tt=Ce.isSticky,Ve=tt&&!$?0:Fe,qe=_.useRef(null),Le=_.useCallback(function(at){Object(l.b)(pe,at),Object(l.b)(qe,at)},[]);_.useEffect(function(){var at;function it(Pe){var Be=Pe.currentTarget,dt=Pe.deltaX;dt&&(ie({currentTarget:Be,scrollLeft:Be.scrollLeft+dt}),Pe.preventDefault())}return(at=qe.current)===null||at===void 0||at.addEventListener("wheel",it),function(){var Pe;(Pe=qe.current)===null||Pe===void 0||Pe.removeEventListener("wheel",it)}},[]);var Ue=xe[xe.length-1],we={fixed:Ue?Ue.fixed:null,onHeaderCell:function(){return{className:"".concat(Oe,"-cell-scrollbar")}}},ee=Object(_.useMemo)(function(){return Ve?[].concat(Object(D.a)(Ne),[we]):Ne},[Ve,Ne]),ce=Object(_.useMemo)(function(){return Ve?[].concat(Object(D.a)(xe),[we]):xe},[Ve,xe]),je=Object(_.useMemo)(function(){var at=re.right,it=re.left;return Object(B.a)(Object(B.a)({},re),{},{left:ne==="rtl"?[].concat(Object(D.a)(it.map(function(Pe){return Pe+Ve})),[0]):it,right:ne==="rtl"?at:[].concat(Object(D.a)(at.map(function(Pe){return Pe+Ve})),[0]),isSticky:tt})},[Ve,re,tt]),De=T(Re,de);return _.createElement("div",{style:Object(B.a)({overflow:"hidden"},tt?{top:Q}:{}),ref:Le,className:I()("".concat(Oe,"-header"),Object(V.a)({},te,!!te))},_.createElement("table",{style:{tableLayout:"fixed",visibility:ke||De?null:"hidden"}},_.createElement(o,{colWidths:De?[].concat(Object(D.a)(De),[Ve]):[],columCount:de+1,columns:ce}),_.createElement(f,Object.assign({},ue,{stickyOffsets:je,columns:ee,flattenColumns:ce}))))});b.displayName="FixedHeader";var g=b,P=_.createContext(null),j=P;function H(be){var pe=be.prefixCls,ke=be.children,Ne=be.component,xe=be.cellComponent,Re=be.fixHeader,de=be.fixColumn,re=be.horizonScroll,ne=be.className,$=be.expanded,Q=be.componentWidth,te=be.colSpan,ie=_.useContext(a.a),ue=ie.scrollbarSize;return _.useMemo(function(){var Ce=ke;return de&&(Ce=_.createElement("div",{style:{width:Q-(Re?ue:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(pe,"-expanded-row-fixed")},Ce)),_.createElement(Ne,{className:ne,style:{display:$?null:"none"}},_.createElement(i.a,{component:xe,prefixCls:pe,colSpan:te},Ce))},[ke,Ne,Re,re,ne,$,Q,te,ue])}var X=H;function W(be){var pe=be.className,ke=be.style,Ne=be.record,xe=be.index,Re=be.rowKey,de=be.getRowKey,re=be.rowExpandable,ne=be.expandedKeys,$=be.onRow,Q=be.indent,te=Q===void 0?0:Q,ie=be.rowComponent,ue=be.cellComponent,Ce=be.childrenColumnName,Oe=_.useContext(a.a),Fe=Oe.prefixCls,tt=Oe.fixedInfoList,Ve=_.useContext(j),qe=Ve.fixHeader,Le=Ve.fixColumn,Ue=Ve.horizonScroll,we=Ve.componentWidth,ee=Ve.flattenColumns,ce=Ve.expandableType,je=Ve.expandRowByClick,De=Ve.onTriggerExpand,at=Ve.rowClassName,it=Ve.expandedRowClassName,Pe=Ve.indentSize,Be=Ve.expandIcon,dt=Ve.expandedRowRender,Bt=Ve.expandIconColumnIndex,Tt=_.useState(!1),gn=Object(M.a)(Tt,2),bn=gn[0],ln=gn[1],bt=ne&&ne.has(be.recordKey);_.useEffect(function(){bt&&ln(!0)},[bt]);var Dn=ce==="row"&&(!re||re(Ne)),Gn=ce==="nest",Cn=Ce&&Ne&&Ne[Ce],Gt=Dn||Gn,_n;$&&(_n=$(Ne,xe));var Bn=function(Rt){if(je&&Gt&&De(Ne,Rt),_n&&_n.onClick){for(var Me,Se=arguments.length,Lt=new Array(Se>1?Se-1:0),Ht=1;Ht<Se;Ht++)Lt[Ht-1]=arguments[Ht];(Me=_n).onClick.apply(Me,[Rt].concat(Lt))}},mr;typeof at=="string"?mr=at:typeof at=="function"&&(mr=at(Ne,xe,te));var rt=Object(C.a)(ee),ct=_.createElement(ie,Object.assign({},_n,{"data-row-key":Re,className:I()(pe,"".concat(Fe,"-row"),"".concat(Fe,"-row-level-").concat(te),mr,_n&&_n.className),style:Object(B.a)(Object(B.a)({},ke),_n?_n.style:null),onClick:Bn}),ee.map(function(Un,Rt){var Me=Un.render,Se=Un.dataIndex,Lt=Un.className,Ht=rt[Rt],vn=tt[Rt],cn;Rt===(Bt||0)&&Gn&&(cn=_.createElement(_.Fragment,null,_.createElement("span",{style:{paddingLeft:"".concat(Pe*te,"px")},className:"".concat(Fe,"-row-indent indent-level-").concat(te)}),Be({prefixCls:Fe,expanded:bt,expandable:Cn,record:Ne,onExpand:De})));var rn;return Un.onCell&&(rn=Un.onCell(Ne,xe)),_.createElement(i.a,Object.assign({className:Lt,ellipsis:Un.ellipsis,align:Un.align,component:ue,prefixCls:Fe,key:Ht,record:Ne,index:xe,dataIndex:Se,render:Me,shouldCellUpdate:Un.shouldCellUpdate},vn,{appendNode:cn,additionalProps:rn}))})),qn;if(Dn&&(bn||bt)){var Tr=dt(Ne,xe,te+1,bt),pr=it&&it(Ne,xe,te);qn=_.createElement(X,{expanded:bt,className:I()("".concat(Fe,"-expanded-row"),"".concat(Fe,"-expanded-row-level-").concat(te+1),pr),prefixCls:Fe,fixHeader:qe,fixColumn:Le,horizonScroll:Ue,component:ie,componentWidth:we,cellComponent:ue,colSpan:ee.length},Tr)}var Ur;return Cn&&bt&&(Ur=(Ne[Ce]||[]).map(function(Un,Rt){var Me=de(Un,Rt);return _.createElement(W,Object.assign({},be,{key:Me,rowKey:Me,record:Un,recordKey:Me,index:Rt,indent:te+1}))})),_.createElement(_.Fragment,null,ct,qn,Ur)}W.displayName="BodyRow";var U=W,z=_.createContext(null),Z=z;function q(be){var pe=be.columnKey,ke=be.onColumnResize,Ne=_.useRef();return _.useEffect(function(){Ne.current&&ke(pe,Ne.current.offsetWidth)},[]),_.createElement(y.a,{onResize:function(Re){var de=Re.offsetWidth;ke(pe,de)}},_.createElement("td",{ref:Ne,style:{padding:0,border:0,height:0}},_.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function oe(be){var pe=be.data,ke=be.getRowKey,Ne=be.measureColumnWidth,xe=be.expandedKeys,Re=be.onRow,de=be.rowExpandable,re=be.emptyNode,ne=be.childrenColumnName,$=_.useContext(Z),Q=$.onColumnResize,te=_.useContext(a.a),ie=te.prefixCls,ue=te.getComponent,Ce=_.useContext(j),Oe=Ce.fixHeader,Fe=Ce.horizonScroll,tt=Ce.flattenColumns,Ve=Ce.componentWidth;return _.useMemo(function(){var qe=ue(["body","wrapper"],"tbody"),Le=ue(["body","row"],"tr"),Ue=ue(["body","cell"],"td"),we;pe.length?we=pe.map(function(ce,je){var De=ke(ce,je);return _.createElement(U,{key:De,rowKey:De,record:ce,recordKey:De,index:je,rowComponent:Le,cellComponent:Ue,expandedKeys:xe,onRow:Re,getRowKey:ke,rowExpandable:de,childrenColumnName:ne})}):we=_.createElement(X,{expanded:!0,className:"".concat(ie,"-placeholder"),prefixCls:ie,fixHeader:Oe,fixColumn:Fe,horizonScroll:Fe,component:Le,componentWidth:Ve,cellComponent:Ue,colSpan:tt.length},re);var ee=Object(C.a)(tt);return _.createElement(qe,{className:"".concat(ie,"-tbody")},Ne&&_.createElement("tr",{"aria-hidden":"true",className:"".concat(ie,"-measure-row"),style:{height:0}},ee.map(function(ce){return _.createElement(q,{key:ce,columnKey:ce,onColumnResize:Q})})),we)},[pe,ie,Re,Ne,xe,ke,ue,Ve,re,tt])}var ye=_.memo(oe);ye.displayName="Body";var me=ye,fe=k("wRmb"),ve=k("xEkU"),ge=k.n(ve);function ae(be){var pe=Object(_.useRef)(be),ke=Object(_.useState)({}),Ne=Object(M.a)(ke,2),xe=Ne[1],Re=Object(_.useRef)(null),de=Object(_.useRef)([]);function re(ne){Re.current===null&&(de.current=[],Re.current=ge()(function(){de.current.forEach(function($){pe.current=$(pe.current)}),Re.current=null,xe({})})),de.current.push(ne)}return Object(_.useEffect)(function(){return function(){ge.a.cancel(Re.current)}},[]),[pe.current,re]}function se(be){var pe=Object(_.useRef)(be),ke=Object(_.useRef)(null);function Ne(){window.clearTimeout(ke.current)}function xe(de){pe.current=de,Ne(),ke.current=window.setTimeout(function(){pe.current=null,ke.current=null},100)}function Re(){return pe.current}return Object(_.useEffect)(function(){return Ne},[]),[xe,Re]}function Te(be,pe,ke){var Ne=Object(_.useMemo)(function(){for(var xe=[],Re=[],de=0,re=0,ne=0;ne<pe;ne+=1)if(ke==="rtl"){Re[ne]=re,re+=be[ne]||0;var $=pe-ne-1;xe[$]=de,de+=be[$]||0}else{xe[ne]=de,de+=be[ne]||0;var Q=pe-ne-1;Re[Q]=re,re+=be[Q]||0}return{left:xe,right:Re}},[be,pe,ke]);return Ne}var We=Te;function Je(be){var pe=be.className,ke=be.children;return _.createElement("div",{className:pe},ke)}var Ye=Je,Ze=k("n6Qo");function ze(be){var pe,ke=be.prefixCls,Ne=be.record,xe=be.onExpand,Re=be.expanded,de=be.expandable,re="".concat(ke,"-row-expand-icon");if(!de)return _.createElement("span",{className:I()(re,"".concat(ke,"-row-spaced"))});var ne=function(Q){xe(Ne,Q),Q.stopPropagation()};return _.createElement("span",{className:I()(re,(pe={},Object(V.a)(pe,"".concat(ke,"-row-expanded"),Re),Object(V.a)(pe,"".concat(ke,"-row-collapsed"),!Re),pe)),onClick:ne})}function Ke(be,pe,ke){var Ne=[];function xe(Re){(Re||[]).forEach(function(de,re){Ne.push(pe(de,re)),xe(de[ke])})}return xe(be),Ne}var $e=k("zT1h"),Qe=k("y0+3"),nt=function(pe,ke){var Ne,xe,Re=pe.scrollBodyRef,de=pe.onScroll,re=pe.offsetScroll,ne=_.useContext(a.a),$=ne.prefixCls,Q=((Ne=Re.current)===null||Ne===void 0?void 0:Ne.scrollWidth)||0,te=((xe=Re.current)===null||xe===void 0?void 0:xe.clientWidth)||0,ie=Q&&te*(te/Q),ue=_.useRef(),Ce=ae({scrollLeft:0,isHiddenScrollBar:!1}),Oe=Object(M.a)(Ce,2),Fe=Oe[0],tt=Oe[1],Ve=_.useRef({delta:0,x:0}),qe=_.useState(!1),Le=Object(M.a)(qe,2),Ue=Le[0],we=Le[1],ee=function(){we(!1)},ce=function(Pe){Pe.persist(),Ve.current.delta=Pe.pageX-Fe.scrollLeft,Ve.current.x=0,we(!0),Pe.preventDefault()},je=function(Pe){var Be,dt=Pe||((Be=window)===null||Be===void 0?void 0:Be.event),Bt=dt.buttons;if(!Ue||Bt===0){Ue&&we(!1);return}var Tt=Ve.current.x+Pe.pageX-Ve.current.x-Ve.current.delta;Tt<=0&&(Tt=0),Tt+ie>=te&&(Tt=te-ie),de({scrollLeft:Tt/te*(Q+2)}),Ve.current.x=Pe.pageX},De=function(){var Pe=Object(Qe.b)(Re.current).top,Be=Pe+Re.current.offsetHeight,dt=document.documentElement.scrollTop+window.innerHeight;Be-Object(O.a)()<=dt||Pe>=dt-re?tt(function(Bt){return Object(B.a)(Object(B.a)({},Bt),{},{isHiddenScrollBar:!0})}):tt(function(Bt){return Object(B.a)(Object(B.a)({},Bt),{},{isHiddenScrollBar:!1})})},at=function(Pe){tt(function(Be){return Object(B.a)(Object(B.a)({},Be),{},{scrollLeft:Pe/Q*te||0})})};return _.useImperativeHandle(ke,function(){return{setScrollLeft:at}}),_.useEffect(function(){var it=Object($e.a)(document.body,"mouseup",ee,!1),Pe=Object($e.a)(document.body,"mousemove",je,!1);return De(),function(){it.remove(),Pe.remove()}},[ie,Ue]),_.useEffect(function(){var it=Object($e.a)(window,"scroll",De,!1),Pe=Object($e.a)(window,"resize",De,!1);return function(){it.remove(),Pe.remove()}},[]),_.useEffect(function(){Fe.isHiddenScrollBar||tt(function(it){var Pe,Be;return Object(B.a)(Object(B.a)({},it),{},{scrollLeft:Re.current.scrollLeft/((Pe=Re.current)===null||Pe===void 0?void 0:Pe.scrollWidth)*((Be=Re.current)===null||Be===void 0?void 0:Be.clientWidth)})})},[Fe.isHiddenScrollBar]),Q<=te||!ie||Fe.isHiddenScrollBar?null:_.createElement("div",{style:{height:Object(O.a)(),width:te,bottom:re},className:"".concat($,"-sticky-scroll")},_.createElement("div",{onMouseDown:ce,ref:ue,className:I()("".concat($,"-sticky-scroll-bar"),Object(V.a)({},"".concat($,"-sticky-scroll-bar-active"),Ue)),style:{width:"".concat(ie,"px"),transform:"translate3d(".concat(Fe.scrollLeft,"px, 0, 0)")}}))},Xe=_.forwardRef(nt);function He(be,pe){return _.useMemo(function(){var ke=!!be;return{isSticky:ke,stickyClassName:ke?"".concat(pe,"-sticky-header"):"",offsetHeader:Object(F.a)(be)==="object"&&be.offsetHeader||0,offsetScroll:Object(F.a)(be)==="object"&&be.offsetScroll||0}},[be,pe])}var st=[],ft={},ot="rc-table-internal-hook",ut=_.memo(function(be){var pe=be.children;return pe},function(be,pe){return L()(be.props,pe.props)?be.pingLeft!==pe.pingLeft||be.pingRight!==pe.pingRight:!1});function gt(be){var pe,ke=be.prefixCls,Ne=be.className,xe=be.rowClassName,Re=be.style,de=be.data,re=be.rowKey,ne=be.scroll,$=be.tableLayout,Q=be.direction,te=be.title,ie=be.footer,ue=be.summary,Ce=be.id,Oe=be.showHeader,Fe=be.components,tt=be.emptyText,Ve=be.onRow,qe=be.onHeaderRow,Le=be.internalHooks,Ue=be.transformColumns,we=be.internalRefs,ee=be.sticky,ce=de||st,je=!!ce.length,De=_.useState(0),at=Object(M.a)(De,2),it=at[0],Pe=at[1];_.useEffect(function(){Pe(Object(O.a)())});var Be=_.useMemo(function(){return Object(C.c)(Fe,{})},[Fe]),dt=_.useCallback(function(pn,an){return Object(C.b)(Be,pn)||an},[Be]),Bt=_.useMemo(function(){return typeof re=="function"?re:function(pn){var an=pn&&pn[re];return an}},[re]),Tt=Object(d.c)(be),gn=Tt.expandIcon,bn=Tt.expandedRowKeys,ln=Tt.defaultExpandedRowKeys,bt=Tt.defaultExpandAllRows,Dn=Tt.expandedRowRender,Gn=Tt.onExpand,Cn=Tt.onExpandedRowsChange,Gt=Tt.expandRowByClick,_n=Tt.rowExpandable,Bn=Tt.expandIconColumnIndex,mr=Tt.expandedRowClassName,rt=Tt.childrenColumnName,ct=Tt.indentSize,qn=gn||ze,Tr=rt||"children",pr=_.useMemo(function(){return Dn?"row":be.expandable&&Le===ot&&be.expandable.__PARENT_RENDER_ICON__||ce.some(function(pn){return pn&&Object(F.a)(pn)==="object"&&pn[Tr]})?"nest":!1},[!!Dn,ce]),Ur=_.useState(function(){return ln||(bt?Ke(ce,Bt,Tr):[])}),Un=Object(M.a)(Ur,2),Rt=Un[0],Me=Un[1],Se=_.useMemo(function(){return new Set(bn||Rt||[])},[bn,Rt]),Lt=_.useCallback(function(pn){var an=Bt(pn,ce.indexOf(pn)),sn,fr=Se.has(an);fr?(Se.delete(an),sn=Object(D.a)(Se)):sn=[].concat(Object(D.a)(Se),[an]),Me(sn),Gn&&Gn(!fr,pn),Cn&&Cn(sn)},[Bt,Se,ce,Gn,Cn]),Ht=_.useState(0),vn=Object(M.a)(Ht,2),cn=vn[0],rn=vn[1],zt=Object(fe.b)(Object(B.a)(Object(B.a)(Object(B.a)({},be),Tt),{},{expandable:!!Dn,expandedKeys:Se,getRowKey:Bt,onTriggerExpand:Lt,expandIcon:qn,expandIconColumnIndex:Bn,direction:Q}),Le===ot?Ue:null),At=Object(M.a)(zt,2),Mt=At[0],Ut=At[1],Pt=_.useMemo(function(){return{columns:Mt,flattenColumns:Ut}},[Mt,Ut]),qt=_.useRef(),vt=_.useRef(),un=_.useRef(),Zt=_.useState(!1),Ln=Object(M.a)(Zt,2),kt=Ln[0],Pn=Ln[1],kn=_.useState(!1),wn=Object(M.a)(kn,2),En=wn[0],An=wn[1],nr=ae(new Map),lr=Object(M.a)(nr,2),Xn=lr[0],Tn=lr[1],ur=Object(C.a)(Ut),dn=ur.map(function(pn){return Xn.get(pn)}),fn=_.useMemo(function(){return dn},[dn.join("_")]),hn=We(fn,Ut.length,Q),Xt=ne&&Object(C.d)(ne.y),Ct=ne&&Object(C.d)(ne.x),jt=Ct&&Ut.some(function(pn){var an=pn.fixed;return an}),Et=_.useRef(),en=He(ee,ke),Nt=en.isSticky,rr=en.offsetHeader,Mn=en.offsetScroll,dr=en.stickyClassName,Zr,Pr,zr;Xt&&(Pr={overflowY:"scroll",maxHeight:ne.y}),Ct&&(Zr={overflowX:"auto"},Xt||(Pr={overflowY:"hidden"}),zr={width:ne.x===!0?"auto":ne.x,minWidth:"100%"});var Mr=_.useCallback(function(pn,an){Tn(function(sn){var fr=new Map(sn);return fr.set(pn,an),fr})},[]),Sr=se(null),Br=Object(M.a)(Sr,2),jn=Br[0],Ot=Br[1];function Gr(pn,an){if(!an)return;typeof an=="function"?an(pn):an.scrollLeft!==pn&&(an.scrollLeft=pn)}var vr=function(an){var sn=an.currentTarget,fr=an.scrollLeft,Qr=typeof fr=="number"?fr:sn.scrollLeft,qr=sn||ft;if(!Ot()||Ot()===qr){var ra;jn(qr),Gr(Qr,vt.current),Gr(Qr,un.current),Gr(Qr,(ra=Et.current)===null||ra===void 0?void 0:ra.setScrollLeft)}if(sn){var Ca=sn.scrollWidth,Qt=sn.clientWidth;Pn(Qr>0),An(Qr<Ca-Qt)}},na=function(){un.current&&vr({currentTarget:un.current})},St=function(an){var sn=an.width;na(),rn(qt.current?qt.current.offsetWidth:sn)};_.useEffect(function(){return na},[]),_.useEffect(function(){Ct&&na()},[Ct]),_.useEffect(function(){Le===ot&&we&&(we.body.current=un.current)});var Wt=dt(["table"],"table"),Dt=_.useMemo(function(){return $||(jt?ne.x==="max-content"?"auto":"fixed":Xt||Ut.some(function(pn){var an=pn.ellipsis;return an})?"fixed":"auto")},[Xt,jt,Ut,$]),Vt,$t={colWidths:fn,columCount:Ut.length,stickyOffsets:hn,onHeaderRow:qe,fixHeader:Xt},yn=_.useMemo(function(){return je?null:typeof tt=="function"?tt():tt},[je,tt]),tn=_.createElement(me,{data:ce,measureColumnWidth:Xt||Ct||Nt,expandedKeys:Se,rowExpandable:_n,getRowKey:Bt,onRow:Ve,emptyNode:yn,childrenColumnName:Tr}),In=_.createElement(o,{colWidths:Ut.map(function(pn){var an=pn.width;return an}),columns:Ut}),er=ue&&_.createElement(Ze.b,null,ue(ce)),Yt=dt(["body"]);if(Xt||Nt){var gr;typeof Yt=="function"?(gr=Yt(ce,{scrollbarSize:it,ref:un,onScroll:vr}),$t.colWidths=Ut.map(function(pn,an){var sn=pn.width,fr=an===Mt.length-1?sn-it:sn;return typeof fr=="number"&&!Number.isNaN(fr)?fr:(Object(v.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):gr=_.createElement("div",{style:Object(B.a)(Object(B.a)({},Zr),Pr),onScroll:vr,ref:un,className:I()("".concat(ke,"-body"))},_.createElement(Wt,{style:Object(B.a)(Object(B.a)({},zr),{},{tableLayout:Dt})},In,tn,er),Nt&&_.createElement(Xe,{ref:Et,offsetScroll:Mn,scrollBodyRef:un,onScroll:vr})),Vt=_.createElement(_.Fragment,null,Oe!==!1&&_.createElement(g,Object.assign({noData:!ce.length},$t,Pt,{direction:Q,offsetHeader:rr,stickyClassName:dr,ref:vt,onScroll:vr})),gr)}else Vt=_.createElement("div",{style:Object(B.a)(Object(B.a)({},Zr),Pr),className:I()("".concat(ke,"-content")),onScroll:vr,ref:un},_.createElement(Wt,{style:Object(B.a)(Object(B.a)({},zr),{},{tableLayout:Dt})},In,Oe!==!1&&_.createElement(f,Object.assign({},$t,Pt)),tn,er));var mn=Object(d.b)(be),Vn=_.createElement("div",Object.assign({className:I()(ke,Ne,(pe={},Object(V.a)(pe,"".concat(ke,"-rtl"),Q==="rtl"),Object(V.a)(pe,"".concat(ke,"-ping-left"),kt),Object(V.a)(pe,"".concat(ke,"-ping-right"),En),Object(V.a)(pe,"".concat(ke,"-layout-fixed"),$==="fixed"),Object(V.a)(pe,"".concat(ke,"-fixed-header"),Xt),Object(V.a)(pe,"".concat(ke,"-fixed-column"),jt),Object(V.a)(pe,"".concat(ke,"-scroll-horizontal"),Ct),Object(V.a)(pe,"".concat(ke,"-has-fix-left"),Ut[0]&&Ut[0].fixed),Object(V.a)(pe,"".concat(ke,"-has-fix-right"),Ut[Ut.length-1]&&Ut[Ut.length-1].fixed==="right"),pe)),style:Re,id:Ce,ref:qt},mn),_.createElement(ut,{pingLeft:kt,pingRight:En,props:Object(B.a)(Object(B.a)({},be),{},{stickyOffsets:hn,mergedExpandedKeys:Se})},te&&_.createElement(Ye,{className:"".concat(ke,"-title")},te(ce)),_.createElement("div",{className:"".concat(ke,"-container")},Vt),ie&&_.createElement(Ye,{className:"".concat(ke,"-footer")},ie(ce))));Ct&&(Vn=_.createElement(y.a,{onResize:St},Vn));var Yn=_.useMemo(function(){return{prefixCls:ke,getComponent:dt,scrollbarSize:it,direction:Q,fixedInfoList:Ut.map(function(pn,an){return c(an,an,Ut,hn,Q)}),isSticky:Nt}},[ke,dt,it,Q,Ut,hn,Q,Nt]),cr=_.useMemo(function(){return Object(B.a)(Object(B.a)({},Pt),{},{tableLayout:Dt,rowClassName:xe,expandedRowClassName:mr,componentWidth:cn,fixHeader:Xt,fixColumn:jt,horizonScroll:Ct,expandIcon:qn,expandableType:pr,expandRowByClick:Gt,expandedRowRender:Dn,onTriggerExpand:Lt,expandIconColumnIndex:Bn,indentSize:ct})},[Pt,Dt,xe,mr,cn,Xt,jt,Ct,qn,pr,Gt,Dn,Lt,Bn,ct]),Wa=_.useMemo(function(){return{onColumnResize:Mr}},[Mr]);return _.createElement(a.a.Provider,{value:Yn},_.createElement(j.Provider,{value:cr},_.createElement(Z.Provider,{value:Wa},Vn)))}gt.Column=p.a,gt.ColumnGroup=S.a,gt.Summary=Ze.a,gt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ht=Ee.b=gt},wRmb:function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return L});var V=k("rePB"),B=k("KQm4"),D=k("VTBJ"),F=k("Ff2n"),M=k("cDcd"),_=k.n(M),N=k("Kwbf"),I=k("Zm9Q"),A=k("hW8S");function L(p){return Object(I.a)(p).filter(function(m){return M.isValidElement(m)}).map(function(m){var l=m.key,i=m.props,a=i.children,c=Object(F.a)(i,["children"]),C=Object(D.a)({key:l},c);return a&&(C.children=L(a)),C})}function v(p){return p.reduce(function(m,l){var i=l.fixed,a=i===!0?"left":i,c=l.children;return c&&c.length>0?[].concat(Object(B.a)(m),Object(B.a)(v(c).map(function(C){return Object(D.a)({fixed:a},C)}))):[].concat(Object(B.a)(m),[Object(D.a)(Object(D.a)({},l),{},{fixed:a})])},[])}function y(p){for(var m=!0,l=0;l<p.length;l+=1){var i=p[l];if(m&&i.fixed!=="left")m=!1;else if(!m&&i.fixed==="left"){Object(N.a)(!1,"Index ".concat(l-1," of `columns` missing `fixed='left'` prop."));break}}for(var a=!0,c=p.length-1;c>=0;c-=1){var C=p[c];if(a&&C.fixed!=="right")a=!1;else if(!a&&C.fixed==="right"){Object(N.a)(!1,"Index ".concat(c+1," of `columns` missing `fixed='right'` prop."));break}}}function O(p){return p.map(function(m){var l=m.fixed,i=Object(F.a)(m,["fixed"]),a=l;return l==="left"?a="right":l==="right"&&(a="left"),Object(D.a)({fixed:a},i)})}function S(p,m){var l=p.prefixCls,i=p.columns,a=p.children,c=p.expandable,C=p.expandedKeys,x=p.getRowKey,h=p.onTriggerExpand,w=p.expandIcon,E=p.rowExpandable,f=p.expandIconColumnIndex,d=p.direction,s=p.expandRowByClick,o=M.useMemo(function(){return i||L(a)},[i,a]),T=M.useMemo(function(){if(c){var P,j=f||0,H=o[j],X=(P={},Object(V.a)(P,A.a,{className:"".concat(l,"-expand-icon-col")}),Object(V.a)(P,"title",""),Object(V.a)(P,"fixed",H?H.fixed:null),Object(V.a)(P,"className","".concat(l,"-row-expand-icon-cell")),Object(V.a)(P,"render",function(z,Z,q){var oe=x(Z,q),ye=C.has(oe),me=E?E(Z):!0,fe=w({prefixCls:l,expanded:ye,expandable:me,record:Z,onExpand:h});return s?M.createElement("span",{onClick:function(ge){return ge.stopPropagation()}},fe):fe}),P),W=o.slice();return j>=0&&W.splice(j,0,X),W}return o},[c,o,x,C,w,d]),b=M.useMemo(function(){var P=T;return m&&(P=m(P)),P.length||(P=[{render:function(){return null}}]),P},[m,T,d]),g=M.useMemo(function(){return d==="rtl"?O(v(b)):v(b)},[b,d]);return[b,g]}Ee.b=S},"y0+3":function(Ie,Ee,k){"use strict";k.d(Ee,"a",function(){return v}),k.d(Ee,"b",function(){return O});var V=/margin|padding|width|height|max|min|offset/,B={left:!0,top:!0},D={cssFloat:1,styleFloat:1,float:1};function F(S){return S.nodeType===1?S.ownerDocument.defaultView.getComputedStyle(S,null):{}}function M(S,p,m){if(p=p.toLowerCase(),m==="auto"){if(p==="height")return S.offsetHeight;if(p==="width")return S.offsetWidth}return p in B||(B[p]=V.test(p)),B[p]?parseFloat(m)||0:m}function _(S,p){var m=arguments.length,l=F(S);return p=D[p]?"cssFloat"in S.style?"cssFloat":"styleFloat":p,m===1?l:M(S,p,l[p]||S.style[p])}function N(S,p,m){var l=arguments.length;if(p=D[p]?"cssFloat"in S.style?"cssFloat":"styleFloat":p,l===3)return typeof m=="number"&&V.test(p)&&(m="".concat(m,"px")),S.style[p]=m,m;for(var i in p)p.hasOwnProperty(i)&&N(S,i,p[i]);return F(S)}function I(S){return S===document.body?document.documentElement.clientWidth:S.offsetWidth}function A(S){return S===document.body?window.innerHeight||document.documentElement.clientHeight:S.offsetHeight}function L(){var S=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),p=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:S,height:p}}function v(){var S=document.documentElement.clientWidth,p=window.innerHeight||document.documentElement.clientHeight;return{width:S,height:p}}function y(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function O(S){var p=S.getBoundingClientRect(),m=document.documentElement;return{left:p.left+(window.pageXOffset||m.scrollLeft)-(m.clientLeft||document.body.clientLeft||0),top:p.top+(window.pageYOffset||m.scrollTop)-(m.clientTop||document.body.clientTop||0)}}},ynwM:function(Ie,Ee,k){var V=k("MFOe"),B=V.Global;Ie.exports={name:"oldFF-globalStorage",read:F,write:M,each:_,remove:N,clearAll:I};var D=B.globalStorage;function F(A){return D[A]}function M(A,L){D[A]=L}function _(A){for(var L=D.length-1;L>=0;L--){var v=D.key(L);A(D[v],v)}}function N(A){return D.removeItem(A)}function I(){_(function(A,L){delete D[A]})}}}]);
|