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

209 lines
1.0 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[191,3,5,7,8,19],{"+NIl":function(Le,ye,F){(function(Y){Y(F("VrN/"))})(function(Y){"use strict";Y.defineMode("stex",function(K,L){"use strict";function H(d,s){d.cmdState.push(s)}function N(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function R(d){var s=d.cmdState.pop();s&&s.closeBracket()}function j(d){for(var s=d.cmdState,l=s.length-1;l>=0;l--){var i=s[l];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function k(d,s,l){return function(){this.name=d,this.bracketNo=0,this.style=s,this.styles=l,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=k("importmodule","tag",["string","builtin"]),A.documentclass=k("documentclass","tag",["","atom"]),A.usepackage=k("usepackage","tag",["atom"]),A.begin=k("begin","tag",["atom"]),A.end=k("end","tag",["atom"]),A.label=k("label","tag",["atom"]),A.ref=k("ref","tag",["atom"]),A.eqref=k("eqref","tag",["atom"]),A.cite=k("cite","tag",["atom"]),A.bibitem=k("bibitem","tag",["atom"]),A.Bibitem=k("Bibitem","tag",["atom"]),A.RBibitem=k("RBibitem","tag",["atom"]),A.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(d,s){d.f=s}function g(d,s){var l;if(d.match(/^\\[a-zA-Z@]+/)){var i=d.current().slice(1);return l=A.hasOwnProperty(i)?A[i]:A.DEFAULT,l=new l,H(s,l),D(s,u),l.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return D(s,function(n,f){return h(n,f,"\\]")}),"keyword";if(d.match("\\("))return D(s,function(n,f){return h(n,f,"\\)")}),"keyword";if(d.match("$$"))return D(s,function(n,f){return h(n,f,"$$")}),"keyword";if(d.match("$"))return D(s,function(n,f){return h(n,f,"$")}),"keyword";var o=d.next();if(o=="%")return d.skipToEnd(),"comment";if(o=="}"||o=="]"){if(l=N(s),l)l.closeBracket(o),D(s,u);else return"error";return"bracket"}else return o=="{"||o=="["?(l=A.DEFAULT,l=new l,H(s,l),"bracket"):/\d/.test(o)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),l=j(s),l.name=="begin"&&(l.argument=d.current()),l.styleIdentifier())}function h(d,s,l){if(d.eatSpace())return null;if(l&&d.match(l))return D(s,g),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=d.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(d.skipToEnd(),"comment"):"error"}function u(d,s){var l=d.peek(),i;return l=="{"||l=="["?(i=N(s),i.openBracket(l),d.eat(l),D(s,g),"bracket"):/[ \t\r]/.test(l)?(d.eat(l),null):(D(s,g),R(s),g(d,s))}return{startState:function(){var d=L.inMathMode?function(s,l){return h(s,l)}:g;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,s){return s.f(d,s)},blankLine:function(d){d.f=g,d.cmdState.length=0},lineComment:"%"}}),Y.defineMIME("text/x-stex","stex"),Y.defineMIME("text/x-latex","stex")})},"+aKw":function(Le,ye,F){"use strict";var Y=F("tJVT"),K=F("cDcd"),L=F.n(K),H=function(j){return String(j).length===1?"0".concat(j):j},N=function(j){var k=j.className,A=k===void 0?"":k,D=j.onChange,g=j.defaultValue,h=g===void 0?0:g,u=Object(K.useState)(h),d=Object(Y.a)(u,2),s=d[0],l=d[1];Object(K.useEffect)(function(){var f=setTimeout(function(){l(s+1e3)},1e3);return D(s+1e3),function(){clearInterval(f)}},[s]);var i=parseInt(s/(60*6e4))||"00",o=parseInt(s%(60*6e4)/6e4)||"00",n=parseInt(s%6e4/1e3)||"00";return L.a.createElement("div",{className:A},H(i),":",H(o),":",H(n))};ye.a=N},"+k/U":function(Le,ye,F){Le.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(Le,ye,F){},"07cG":function(Le,ye,F){Le.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Le,ye,F){(function(Y){Y(F("VrN/"))})(function(Y){Y.defineOption("placeholder","",function(k,A,D){var g=D&&D!=Y.Init;if(A&&!g)k.on("blur",N),k.on("change",R),k.on("swapDoc",R),Y.on(k.getInputField(),"compositionupdate",k.state.placeholderCompose=function(){H(k)}),R(k);else if(!A&&g){k.off("blur",N),k.off("change",R),k.off("swapDoc",R),Y.off(k.getInputField(),"compositionupdate",k.state.placeholderCompose),K(k);var h=k.getWrapperElement();h.className=h.className.replace(" CodeMirror-empty","")}A&&!k.hasFocus()&&N(k)});function K(k){k.state.placeholder&&(k.state.placeholder.parentNode.removeChild(k.state.placeholder),k.state.placeholder=null)}function L(k){K(k);var A=k.state.placeholder=document.createElement("pre");A.style.cssText="height: 0; overflow: visible",A.style.direction=k.getOption("direction"),A.className="CodeMirror-placeholder CodeMirror-line-like";var D=k.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),A.appendChild(D),k.display.lineSpace.insertBefore(A,k.display.lineSpace.firstChild)}function H(k){setTimeout(function(){var A=!1,D=k.getInputField();D.nodeName=="TEXTAREA"?A=!D.value:k.lineCount()==1&&(A=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),A?L(k):K(k)},20)}function N(k){j(k)&&L(k)}function R(k){var A=k.getWrapperElement(),D=j(k);A.className=A.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?L(k):K(k)}function j(k){return k.lineCount()===1&&k.getLine(0)===""}})},"1eCo":function(Le,ye,F){(function(Y){Y(F("VrN/"))})(function(Y){"use strict";var K={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},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Y.defineMode("xml",function(H,N){var R=H.indentUnit,j={},k=N.htmlMode?K:L;for(var A in k)j[A]=k[A];for(var A in N)j[A]=N[A];var D,g;function h(c,E){function _(P){return E.tokenize=P,P(c,E)}var b=c.next();if(b=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?_(s("atom","]]>")):null:c.match("--")?_(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),_(l(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),E.tokenize=s("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",E.tokenize=u,"tag bracket");if(b=="&"){var I;return c.eat("#")?c.eat("x")?I=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):I=c.eatWhile(/[\d]/)&&c.eat(";"):I=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),I?"atom":"error"}else return c.eatWhile(/[^&<]/),null}h.isInText=!0;function u(c,E){var _=c.next();if(_==">"||_=="/"&&c.eat(">"))return E.tokenize=h,D=_==">"?"endTag":"selfcloseTag","tag bracket";if(_=="=")return D="equals",null;if(_=="<"){E.tokenize=h,E.state=f,E.tagName=E.tagStart=null;var b=E.tokenize(c,E);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(_)?(E.tokenize=d(_),E.stringStartCol=c.column(),E.tokenize(c,E)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(c){var E=function(_,b){for(;!_.eol();)if(_.next()==c){b.tokenize=u;break}return"string"};return E.isInAttribute=!0,E}function s(c,E){return function(_,b){for(;!_.eol();){if(_.match(E)){b.tokenize=h;break}_.next()}return c}}function l(c){return function(E,_){for(var b;(b=E.next())!=null;){if(b=="<")return _.tokenize=l(c+1),_.tokenize(E,_);if(b==">")if(c==1){_.tokenize=h;break}else return _.tokenize=l(c-1),_.tokenize(E,_)}return"meta"}}function i(c,E,_){this.prev=c.context,this.tagName=E,this.indent=c.indented,this.startOfLine=_,(j.doNotIndent.hasOwnProperty(E)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function o(c){c.context&&(c.context=c.context.prev)}function n(c,E){for(var _;;){if(!c.context)return;if(_=c.context.tagName,!j.contextGrabbers.hasOwnProperty(_)||!j.contextGrabbers[_].hasOwnProperty(E))return;o(c)}}function f(c,E,_){return c=="openTag"?(_.tagStart=E.column(),O):c=="closeTag"?S:f}function O(c,E,_){return c=="word"?(_.tagName=E.current(),g="tag",T):j.allowMissingTagName&&c=="endTag"?(g="tag bracket",T(c,E,_)):(g="error",O)}function S(c,E,_){if(c=="word"){var b=E.current();return _.context&&_.context.tagName!=b&&j.implicitlyClosed.hasOwnProperty(_.context.tagName)&&o(_),_.context&&_.context.tagName==b||j.matchClosing===!1?(g="tag",x):(g="tag error",w)}else return j.allowMissingTagName&&c=="endTag"?(g="tag bracket",x(c,E,_)):(g="error",w)}function x(c,E,_){return c!="endTag"?(g="error",x):(o(_),f)}function w(c,E,_){return g="error",x(c,E,_)}function T(c,E,_){if(c=="word")return g="attribute",y;if(c=="endTag"||c=="selfcloseTag"){var b=_.tagName,I=_.tagStart;return _.tagName=_.tagStart=null,c=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(b)?n(_,b):(n(_,b),_.context=new i(_,b,I==_.indented)),f}return g="error",T}function y(c,E,_){return c=="equals"?v:(j.allowMissing||(g="error"),T(c,E,_))}function v(c,E,_){return c=="string"?p:c=="word"&&j.allowUnquoted?(g="string",T):(g="error",T(c,E,_))}function p(c,E,_){return c=="string"?p:T(c,E,_)}return{startState:function(c){var E={tokenize:h,state:f,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(E.baseIndent=c),E},token:function(c,E){if(!E.tagName&&c.sol()&&(E.indented=c.indentation()),c.eatSpace())return null;D=null;var _=E.tokenize(c,E);return(_||D)&&_!="comment"&&(g=null,E.state=E.state(D||_,c,E),g&&(_=g=="error"?_+" error":g)),_},indent:function(c,E,_){var b=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+R;if(b&&b.noIndent)return Y.Pass;if(c.tokenize!=u&&c.tokenize!=h)return _?_.match(/^(\s*)/)[0].length:0;if(c.tagName)return j.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+R*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var I=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(I&&I[1])for(;b;)if(b.tagName==I[2]){b=b.prev;break}else if(j.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(I)for(;b;){var P=j.contextGrabbers[b.tagName];if(P&&P.hasOwnProperty(I[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+R:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(c){c.state==v&&(c.state=T)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var E=[],_=c.context;_;_=_.prev)_.tagName&&E.push(_.tagName);return E.reverse()}}}),Y.defineMIME("text/xml","xml"),Y.defineMIME("application/xml","xml"),Y.mimeModes.hasOwnProperty("text/html")||Y.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Le,ye,F){"use strict";F.d(ye,"d",function(){return ot}),F.d(ye,"b",function(){return ce}),F.d(ye,"c",function(){return je}),F.d(ye,"a",function(){return ut});var Y=F("VTBJ"),K=F("1OyB"),L=F("vuIU"),H=F("JX7q"),N=F("Ji7U"),R=F("LK+K"),j=F("cDcd"),k=F("I8Z2"),A=F("BGR+"),D=F("wx14"),g=F("rePB"),h=F("4IlW"),u=F("2GS6"),d=F("Gytx"),s=F.n(d),l=F("TSYQ"),i=F.n(l),o=F("U8pU"),n=F("ODXe"),f=/iPhone/i,O=/iPod/i,S=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,w=/Android/i,T=/\bAndroid(?:.+)SD4930UR\b/i,y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,v=/Windows Phone/i,p=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,E=/BB10/i,_=/Opera Mini/i,b=/\b(CriOS|Chrome)(?:.+)Mobile/i,I=/Mobile(?:.+)Firefox\b/i;function P(rt,Me){return rt.test(Me)}function B(rt){var Me=rt||(typeof navigator!="undefined"?navigator.userAgent:""),Ue=Me.split("[FBAN");if(typeof Ue[1]!="undefined"){var we=Ue,ee=Object(n.a)(we,1);Me=ee[0]}if(Ue=Me.split("Twitter"),typeof Ue[1]!="undefined"){var he=Ue,Fe=Object(n.a)(he,1);Me=Fe[0]}var Re={apple:{phone:P(f,Me)&&!P(v,Me),ipod:P(O,Me),tablet:!P(f,Me)&&P(S,Me)&&!P(v,Me),device:(P(f,Me)||P(O,Me)||P(S,Me))&&!P(v,Me)},amazon:{phone:P(T,Me),tablet:!P(T,Me)&&P(y,Me),device:P(T,Me)||P(y,Me)},android:{phone:!P(v,Me)&&P(T,Me)||!P(v,Me)&&P(x,Me),tablet:!P(v,Me)&&!P(T,Me)&&!P(x,Me)&&(P(y,Me)||P(w,Me)),device:!P(v,Me)&&(P(T,Me)||P(y,Me)||P(x,Me)||P(w,Me))||P(/\bokhttp\b/i,Me)},windows:{phone:P(v,Me),tablet:P(p,Me),device:P(v,Me)||P(p,Me)},other:{blackberry:P(c,Me),blackberry10:P(E,Me),opera:P(_,Me),firefox:P(I,Me),chrome:P(b,Me),device:P(c,Me)||P(E,Me)||P(_,Me)||P(I,Me)||P(b,Me)},any:null,phone:null,tablet:null};return Re.any=Re.apple.device||Re.android.device||Re.windows.device||Re.other.device,Re.phone=Re.apple.phone||Re.android.phone||Re.windows.phone,Re.tablet=Re.apple.tablet||Re.android.tablet||Re.windows.tablet,Re}var z=Object(Y.a)(Object(Y.a)({},B()),{},{isMobile:B}),U=z;function C(){}function W(rt,Me,Ue){var we=Me||"";return rt.key||"".concat(we,"item_").concat(Ue)}function V(rt){return"".concat(rt,"-menu-")}function J(rt,Me){var Ue=-1;j.Children.forEach(rt,function(we){Ue+=1,we&&we.type&&we.type.isMenuItemGroup?j.Children.forEach(we.props.children,function(ee){Ue+=1,Me(ee,Ue)}):Me(we,Ue)})}function ne(rt,Me,Ue){if(!rt||Ue.find)return;j.Children.forEach(rt,function(we){if(we){var ee=we.type;if(!ee||!(ee.isSubMenu||ee.isMenuItem||ee.isMenuItemGroup))return;Me.indexOf(we.key)!==-1?Ue.find=!0:we.props.children&&ne(we.props.children,Me,Ue)}})}var fe=["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"],ue=function(Me){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=Me&&typeof Me.getBoundingClientRect=="function"&&Me.getBoundingClientRect().width;if(we){if(Ue){var ee=getComputedStyle(Me),he=ee.marginLeft,Fe=ee.marginRight;we+=+he.replace("px","")+ +Fe.replace("px","")}we=+we.toFixed(6)}return we||0},le=function(Me,Ue,we){Me&&Object(o.a)(Me.style)==="object"&&(Me.style[Ue]=we)},me=function(){return U.any},ge=F("KQm4"),re=F("Ff2n"),oe=F("faye"),xe=F("bdgK"),Be=F("uciX"),Ve=F("8XRh"),Ye={adjustX:1,adjustY:1},$e={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]}},Ke={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]}},We=$e,ze=0,at={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Je=function(Me,Ue,we){var ee=V(Ue),he=Me.getState();Me.setState({defaultActiveFirst:Object(Y.a)(Object(Y.a)({},he.defaultActiveFirst),{},Object(g.a)({},ee,we))})},Xe=function(rt){Object(N.a)(Ue,rt);var Me=Object(R.a)(Ue);function Ue(we){var ee;Object(K.a)(this,Ue),ee=Me.call(this,we),ee.onDestroy=function(Te){ee.props.onDestroy(Te)},ee.onKeyDown=function(Te){var Ae=Te.keyCode,Qe=ee.menuInstance,Et=ee.props,vt=Et.isOpen,cn=Et.store;if(Ae===h.a.ENTER)return ee.onTitleClick(Te),Je(cn,ee.props.eventKey,!0),!0;if(Ae===h.a.RIGHT)return vt?Qe.onKeyDown(Te):(ee.triggerOpenChange(!0),Je(cn,ee.props.eventKey,!0)),!0;if(Ae===h.a.LEFT){var yn;if(vt)yn=Qe.onKeyDown(Te);else return;return yn||(ee.triggerOpenChange(!1),yn=!0),yn}return vt&&(Ae===h.a.UP||Ae===h.a.DOWN)?Qe.onKeyDown(Te):void 0},ee.onOpenChange=function(Te){ee.props.onOpenChange(Te)},ee.onPopupVisibleChange=function(Te){ee.triggerOpenChange(Te,Te?"mouseenter":"mouseleave")},ee.onMouseEnter=function(Te){var Ae=ee.props,Qe=Ae.eventKey,Et=Ae.onMouseEnter,vt=Ae.store;Je(vt,ee.props.eventKey,!1),Et({key:Qe,domEvent:Te})},ee.onMouseLeave=function(Te){var Ae=ee.props,Qe=Ae.parentMenu,Et=Ae.eventKey,vt=Ae.onMouseLeave;Qe.subMenuInstance=Object(H.a)(ee),vt({key:Et,domEvent:Te})},ee.onTitleMouseEnter=function(Te){var Ae=ee.props,Qe=Ae.eventKey,Et=Ae.onItemHover,vt=Ae.onTitleMouseEnter;Et({key:Qe,hover:!0}),vt({key:Qe,domEvent:Te})},ee.onTitleMouseLeave=function(Te){var Ae=ee.props,Qe=Ae.parentMenu,Et=Ae.eventKey,vt=Ae.onItemHover,cn=Ae.onTitleMouseLeave;Qe.subMenuInstance=Object(H.a)(ee),vt({key:Et,hover:!1}),cn({key:Et,domEvent:Te})},ee.onTitleClick=function(Te){var Ae=Object(H.a)(ee),Qe=Ae.props;if(Qe.onTitleClick({key:Qe.eventKey,domEvent:Te}),Qe.triggerSubMenuAction==="hover")return;ee.triggerOpenChange(!Qe.isOpen,"click"),Je(Qe.store,ee.props.eventKey,!1)},ee.onSubMenuClick=function(Te){typeof ee.props.onClick=="function"&&ee.props.onClick(ee.addKeyPath(Te))},ee.onSelect=function(Te){ee.props.onSelect(Te)},ee.onDeselect=function(Te){ee.props.onDeselect(Te)},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(Te){ee.menuInstance=Te},ee.addKeyPath=function(Te){return Object(Y.a)(Object(Y.a)({},Te),{},{keyPath:(Te.keyPath||[]).concat(ee.props.eventKey)})},ee.triggerOpenChange=function(Te,Ae){var Qe=ee.props.eventKey,Et=function(){ee.onOpenChange({key:Qe,item:Object(H.a)(ee),trigger:Ae,open:Te})};Ae==="mouseenter"?ee.mouseenterTimeout=setTimeout(function(){Et()},0):Et()},ee.isChildrenSelected=function(){var Te={find:!1};return ne(ee.props.children,ee.props.selectedKeys,Te),Te.find},ee.isOpen=function(){return ee.props.openKeys.indexOf(ee.props.eventKey)!==-1},ee.adjustWidth=function(){if(!ee.subMenuTitle||!ee.menuInstance)return;var Te=oe.findDOMNode(ee.menuInstance);if(Te.offsetWidth>=ee.subMenuTitle.offsetWidth)return;Te.style.minWidth="".concat(ee.subMenuTitle.offsetWidth,"px")},ee.saveSubMenuTitle=function(Te){ee.subMenuTitle=Te},ee.getBaseProps=function(){var Te=Object(H.a)(ee),Ae=Te.props;return{mode:Ae.mode==="horizontal"?"vertical":Ae.mode,visible:ee.props.isOpen,level:Ae.level+1,inlineIndent:Ae.inlineIndent,focusable:!1,onClick:ee.onSubMenuClick,onSelect:ee.onSelect,onDeselect:ee.onDeselect,onDestroy:ee.onDestroy,selectedKeys:Ae.selectedKeys,eventKey:"".concat(Ae.eventKey,"-menu-"),openKeys:Ae.openKeys,motion:Ae.motion,onOpenChange:ee.onOpenChange,subMenuOpenDelay:Ae.subMenuOpenDelay,parentMenu:Object(H.a)(ee),subMenuCloseDelay:Ae.subMenuCloseDelay,forceSubMenuRender:Ae.forceSubMenuRender,triggerSubMenuAction:Ae.triggerSubMenuAction,builtinPlacements:Ae.builtinPlacements,defaultActiveFirst:Ae.store.getState().defaultActiveFirst[V(Ae.eventKey)],multiple:Ae.multiple,prefixCls:Ae.rootPrefixCls,id:ee.internalMenuId,manualRef:ee.saveMenuInstance,itemIcon:Ae.itemIcon,expandIcon:Ae.expandIcon,direction:Ae.direction}},ee.getMotion=function(Te,Ae){var Qe=Object(H.a)(ee),Et=Qe.haveRendered,vt=ee.props,cn=vt.motion,yn=vt.rootPrefixCls,ln=Object(Y.a)(Object(Y.a)({},cn),{},{leavedClassName:"".concat(yn,"-hidden"),removeOnLeave:!1,motionAppear:Et||!Ae||Te!=="inline"});return ln};var he=we.store,Fe=we.eventKey,Re=he.getState(),et=Re.defaultActiveFirst;ee.isRootMenu=!1;var tt=!1;return et&&(tt=et[Fe]),Je(he,Fe,tt),ee}return Object(L.a)(Ue,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ee=this,he=this.props,Fe=he.mode,Re=he.parentMenu,et=he.manualRef;if(et&&et(this),Fe!=="horizontal"||!Re.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ee.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ee=this.props,he=ee.onDestroy,Fe=ee.eventKey;he&&he(Fe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ee){var he=this,Fe=this.getBaseProps(),Re=this.getMotion(Fe.mode,Fe.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Fe.visible||Fe.forceSubMenuRender,!this.haveOpened)return j.createElement("div",null);var et=Fe.direction;return j.createElement(Ve.default,Object.assign({visible:Fe.visible},Re),function(tt){var Te=tt.className,Ae=tt.style,Qe=i()("".concat(Fe.prefixCls,"-sub"),Te,Object(g.a)({},"".concat(Fe.prefixCls,"-rtl"),et==="rtl"));return j.createElement(pe,Object.assign({},Fe,{id:he.internalMenuId,className:Qe,style:Ae}),ee)})}},{key:"render",value:function(){var ee,he=Object(Y.a)({},this.props),Fe=he.isOpen,Re=this.getPrefixCls(),et=he.mode==="inline",tt=i()(Re,"".concat(Re,"-").concat(he.mode),(ee={},Object(g.a)(ee,he.className,!!he.className),Object(g.a)(ee,this.getOpenClassName(),Fe),Object(g.a)(ee,this.getActiveClassName(),he.active||Fe&&!et),Object(g.a)(ee,this.getDisabledClassName(),he.disabled),Object(g.a)(ee,this.getSelectedClassName(),this.isChildrenSelected()),ee));this.internalMenuId||(he.eventKey?this.internalMenuId="".concat(he.eventKey,"$Menu"):(ze+=1,this.internalMenuId="$__$".concat(ze,"$Menu")));var Te={},Ae={},Qe={};he.disabled||(Te={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ae={onClick:this.onTitleClick},Qe={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Et={},vt=he.direction;et&&(vt==="rtl"?Et.paddingRight=he.inlineIndent*he.level:Et.paddingLeft=he.inlineIndent*he.level);var cn={};this.props.isOpen&&(cn={"aria-owns":this.internalMenuId});var yn=null;he.mode!=="horizontal"&&(yn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(yn=j.createElement(this.props.expandIcon,Object(Y.a)({},this.props))));var ln=j.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Et,className:"".concat(Re,"-title"),role:"button"},Qe,Ae,{"aria-expanded":Fe},cn,{"aria-haspopup":"true",title:typeof he.title=="string"?he.title:void 0}),he.title,yn||j.createElement("i",{className:"".concat(Re,"-arrow")})),bt=this.renderChildren(he.children),Rn=he.parentMenu.isRootMenu?he.parentMenu.props.getPopupContainer:function(mr){return mr.parentNode},zn=at[he.mode],Tn=he.popupOffset?{offset:he.popupOffset}:{},zt=he.mode==="inline"?"":he.popupClassName;zt+=vt==="rtl"?" ".concat(Re,"-rtl"):"";var Sn=he.disabled,Bn=he.triggerSubMenuAction,pr=he.subMenuOpenDelay,nt=he.forceSubMenuRender,ct=he.subMenuCloseDelay,qn=he.builtinPlacements;fe.forEach(function(mr){return delete he[mr]}),delete he.onClick;var xr=vt==="rtl"?Object.assign({},Ke,qn):Object.assign({},$e,qn);return delete he.direction,j.createElement("li",Object.assign({},he,Te,{className:tt,role:"menuitem"}),et&&ln,et&&bt,!et&&j.createElement(Be.a,{prefixCls:Re,popupClassName:i()("".concat(Re,"-popup"),zt),getPopupContainer:Rn,builtinPlacements:xr,popupPlacement:zn,popupVisible:Fe,popupAlign:Tn,popup:bt,action:Sn?[]:[Bn],mouseEnterDelay:pr,mouseLeaveDelay:ct,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:nt},ln))}}]),Ue}(j.Component);Xe.defaultProps={onMouseEnter:C,onMouseLeave:C,onTitleMouseEnter:C,onTitleMouseLeave:C,onTitleClick:C,manualRef:C,mode:"vertical",title:""};var He=Object(k.b)(function(rt,Me){var Ue=rt.openKeys,we=rt.activeKey,ee=rt.selectedKeys,he=Me.eventKey,Fe=Me.subMenuKey;return{isOpen:Ue.indexOf(he)>-1,active:we[Fe]===he,selectedKeys:ee}})(Xe);He.isSubMenu=!0;var ot=He,ft="menuitem-overflowed",dt=.5,lt=function(rt){Object(N.a)(Ue,rt);var Me=Object(R.a)(Ue);function Ue(){var we;return Object(K.a)(this,Ue),we=Me.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,he=oe.findDOMNode(Object(H.a)(we));return he?[].slice.call(he.children).filter(function(Fe){return Fe.className.split(" ").indexOf("".concat(ee,"-overflowed-submenu"))<0}):[]},we.getOverflowedSubMenuItem=function(ee,he,Fe){var Re=we.props,et=Re.overflowedIndicator,tt=Re.level,Te=Re.mode,Ae=Re.prefixCls,Qe=Re.theme;if(tt!==1||Te!=="horizontal")return null;var Et=we.props.children[0],vt=Et.props,cn=vt.children,yn=vt.title,ln=vt.style,bt=Object(re.a)(vt,["children","title","style"]),Rn=Object(Y.a)({},ln),zn="".concat(ee,"-overflowed-indicator"),Tn="".concat(ee,"-overflowed-indicator");he.length===0&&Fe!==!0?Rn=Object(Y.a)(Object(Y.a)({},Rn),{},{display:"none"}):Fe&&(Rn=Object(Y.a)(Object(Y.a)({},Rn),{},{visibility:"hidden",position:"absolute"}),zn="".concat(zn,"-placeholder"),Tn="".concat(Tn,"-placeholder"));var zt=Qe?"".concat(Ae,"-").concat(Qe):"",Sn={};return fe.forEach(function(Bn){bt[Bn]!==void 0&&(Sn[Bn]=bt[Bn])}),j.createElement(ot,Object.assign({title:et,className:"".concat(Ae,"-overflowed-submenu"),popupClassName:zt},Sn,{key:zn,eventKey:Tn,disabled:!1,style:Rn}),he)},we.setChildrenWidthAndResize=function(){if(we.props.mode!=="horizontal")return;var ee=oe.findDOMNode(Object(H.a)(we));if(!ee)return;var he=ee.children;if(!he||he.length===0)return;var Fe=ee.children[he.length-1];le(Fe,"display","inline-block");var Re=we.getMenuItemNodes(),et=Re.filter(function(tt){return tt.className.split(" ").indexOf(ft)>=0});et.forEach(function(tt){le(tt,"display","inline-block")}),we.menuItemSizes=Re.map(function(tt){return ue(tt,!0)}),et.forEach(function(tt){le(tt,"display","none")}),we.overflowedIndicatorWidth=ue(ee.children[ee.children.length-1],!0),we.originalTotalWidth=we.menuItemSizes.reduce(function(tt,Te){return tt+Te},0),we.handleResize(),le(Fe,"display","none")},we.handleResize=function(){if(we.props.mode!=="horizontal")return;var ee=oe.findDOMNode(Object(H.a)(we));if(!ee)return;var he=ue(ee);we.overflowedItems=[];var Fe=0,Re;we.originalTotalWidth>he+dt&&(Re=-1,we.menuItemSizes.forEach(function(et){Fe+=et,Fe+we.overflowedIndicatorWidth<=he&&(Re+=1)})),we.setState({lastVisibleIndex:Re})},we}return Object(L.a)(Ue,[{key:"componentDidMount",value:function(){var ee=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var he=oe.findDOMNode(this);if(!he)return;this.resizeObserver=new xe.default(function(Fe){Fe.forEach(function(){var Re=ee.cancelFrameId;cancelAnimationFrame(Re),ee.cancelFrameId=requestAnimationFrame(ee.setChildrenWidthAndResize)})}),[].slice.call(he.children).concat(he).forEach(function(Fe){ee.resizeObserver.observe(Fe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ee.resizeObserver.disconnect(),[].slice.call(he.children).concat(he).forEach(function(Fe){ee.resizeObserver.observe(Fe)}),ee.setChildrenWidthAndResize()}),this.mutationObserver.observe(he,{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 he=this,Fe=this.state.lastVisibleIndex;return(ee||[]).reduce(function(Re,et,tt){var Te=et;if(he.props.mode==="horizontal"){var Ae=he.getOverflowedSubMenuItem(et.props.eventKey,[]);Fe!==void 0&&he.props.className.indexOf("".concat(he.props.prefixCls,"-root"))!==-1&&(tt>Fe&&(Te=j.cloneElement(et,{style:{display:"none"},eventKey:"".concat(et.props.eventKey,"-hidden"),className:"".concat(ft)})),tt===Fe+1&&(he.overflowedItems=ee.slice(Fe+1).map(function(Et){return j.cloneElement(Et,{key:Et.props.eventKey,mode:"vertical-left"})}),Ae=he.getOverflowedSubMenuItem(et.props.eventKey,he.overflowedItems)));var Qe=[].concat(Object(ge.a)(Re),[Ae,Te]);return tt===ee.length-1&&Qe.push(he.getOverflowedSubMenuItem(et.props.eventKey,[],!0)),Qe}return[].concat(Object(ge.a)(Re),[Te])},[])}},{key:"render",value:function(){var ee=this.props,he=ee.visible,Fe=ee.prefixCls,Re=ee.overflowedIndicator,et=ee.mode,tt=ee.level,Te=ee.tag,Ae=ee.children,Qe=ee.theme,Et=Object(re.a)(ee,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),vt=Te;return j.createElement(vt,Object.assign({},Et),this.renderChildren(Ae))}}]),Ue}(j.Component);lt.defaultProps={tag:"div",className:""};var _t=lt;function ht(rt){return rt.length?rt.every(function(Me){return!!Me.props.disabled}):!0}function be(rt,Me,Ue){var we=rt.getState();rt.setState({activeKey:Object(Y.a)(Object(Y.a)({},we.activeKey),{},Object(g.a)({},Me,Ue))})}function _e(rt){return rt.eventKey||"0-menu-"}function Ne(rt,Me){var Ue=Me,we=rt.children,ee=rt.eventKey;if(Ue){var he;if(J(we,function(Fe,Re){Fe&&Fe.props&&!Fe.props.disabled&&Ue===W(Fe,ee,Re)&&(he=!0)}),he)return Ue}return Ue=null,rt.defaultActiveFirst&&J(we,function(Fe,Re){!Ue&&Fe&&!Fe.props.disabled&&(Ue=W(Fe,ee,Re))}),Ue}function ke(rt){if(rt){var Me=this.instanceArray.indexOf(rt);Me!==-1?this.instanceArray[Me]=rt:this.instanceArray.push(rt)}}var Ee=function(rt){Object(N.a)(Ue,rt);var Me=Object(R.a)(Ue);function Ue(we){var ee;return Object(K.a)(this,Ue),ee=Me.call(this,we),ee.onKeyDown=function(he,Fe){var Re=he.keyCode,et;if(ee.getFlatInstanceArray().forEach(function(Te){Te&&Te.props.active&&Te.onKeyDown&&(et=Te.onKeyDown(he))}),et)return 1;var tt=null;return(Re===h.a.UP||Re===h.a.DOWN)&&(tt=ee.step(Re===h.a.UP?-1:1)),tt?(he.preventDefault(),be(ee.props.store,_e(ee.props),tt.props.eventKey),typeof Fe=="function"&&Fe(tt),1):void 0},ee.onItemHover=function(he){var Fe=he.key,Re=he.hover;be(ee.props.store,_e(ee.props),Re?Fe:null)},ee.onDeselect=function(he){ee.props.onDeselect(he)},ee.onSelect=function(he){ee.props.onSelect(he)},ee.onClick=function(he){ee.props.onClick(he)},ee.onOpenChange=function(he){ee.props.onOpenChange(he)},ee.onDestroy=function(he){ee.props.onDestroy(he)},ee.getFlatInstanceArray=function(){return ee.instanceArray},ee.step=function(he){var Fe=ee.getFlatInstanceArray(),Re=ee.props.store.getState().activeKey[_e(ee.props)],et=Fe.length;if(!et)return null;he<0&&(Fe=Fe.concat().reverse());var tt=-1;if(Fe.every(function(Et,vt){return Et&&Et.props.eventKey===Re?(tt=vt,!1):!0}),!ee.props.defaultActiveFirst&&tt!==-1&&ht(Fe.slice(tt,et-1)))return;var Te=(tt+1)%et,Ae=Te;do{var Qe=Fe[Ae];if(!Qe||Qe.props.disabled)Ae=(Ae+1)%et;else return Qe}while(Ae!==Te);return null},ee.renderCommonMenuItem=function(he,Fe,Re){var et=ee.props.store.getState(),tt=Object(H.a)(ee),Te=tt.props,Ae=W(he,Te.eventKey,Fe),Qe=he.props;if(!Qe||typeof he.type=="string")return he;var Et=Ae===et.activeKey,vt=Object(Y.a)(Object(Y.a)({mode:Qe.mode||Te.mode,level:Te.level,inlineIndent:Te.inlineIndent,renderMenuItem:ee.renderMenuItem,rootPrefixCls:Te.prefixCls,index:Fe,parentMenu:Te.parentMenu,manualRef:Qe.disabled?void 0:Object(u.a)(he.ref,ke.bind(Object(H.a)(ee))),eventKey:Ae,active:!Qe.disabled&&Et,multiple:Te.multiple,onClick:function(yn){(Qe.onClick||C)(yn),ee.onClick(yn)},onItemHover:ee.onItemHover,motion:Te.motion,subMenuOpenDelay:Te.subMenuOpenDelay,subMenuCloseDelay:Te.subMenuCloseDelay,forceSubMenuRender:Te.forceSubMenuRender,onOpenChange:ee.onOpenChange,onDeselect:ee.onDeselect,onSelect:ee.onSelect,builtinPlacements:Te.builtinPlacements,itemIcon:Qe.itemIcon||ee.props.itemIcon,expandIcon:Qe.expandIcon||ee.props.expandIcon},Re),{},{direction:Te.direction});return(Te.mode==="inline"||me())&&(vt.triggerSubMenuAction="click"),j.cloneElement(he,vt)},ee.renderMenuItem=function(he,Fe,Re){if(!he)return null;var et=ee.props.store.getState(),tt={openKeys:et.openKeys,selectedKeys:et.selectedKeys,triggerSubMenuAction:ee.props.triggerSubMenuAction,subMenuKey:Re};return ee.renderCommonMenuItem(he,Fe,tt)},we.store.setState({activeKey:Object(Y.a)(Object(Y.a)({},we.store.getState().activeKey),{},Object(g.a)({},we.eventKey,Ne(we,we.activeKey)))}),ee.instanceArray=[],ee}return Object(L.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||!s()(this.props.style,ee.style)}},{key:"componentDidUpdate",value:function(ee){var he=this.props,Fe="activeKey"in he?he.activeKey:he.store.getState().activeKey[_e(he)],Re=Ne(he,Fe);if(Re!==Fe)be(he.store,_e(he),Re);else if("activeKey"in ee){var et=Ne(ee,ee.activeKey);Re!==et&&be(he.store,_e(he),Re)}}},{key:"render",value:function(){var ee=this,he=Object(D.a)({},this.props);this.instanceArray=[];var Fe=i()(he.prefixCls,he.className,"".concat(he.prefixCls,"-").concat(he.mode)),Re={className:Fe,role:he.role||"menu"};he.id&&(Re.id=he.id),he.focusable&&(Re.tabIndex=0,Re.onKeyDown=this.onKeyDown);var et=he.prefixCls,tt=he.eventKey,Te=he.visible,Ae=he.level,Qe=he.mode,Et=he.overflowedIndicator,vt=he.theme;return fe.forEach(function(cn){return delete he[cn]}),delete he.onClick,j.createElement(_t,Object.assign({},he,{prefixCls:et,mode:Qe,tag:"ul",level:Ae,theme:vt,visible:Te,overflowedIndicator:Et},Re),j.Children.map(he.children,function(cn,yn){return ee.renderMenuItem(cn,yn,tt||"0-menu-")}))}}]),Ue}(j.Component);Ee.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:C};var Ie=Object(k.b)()(Ee),pe=Ie,ae=F("Kwbf");function ie(rt,Me,Ue){var we=rt.prefixCls,ee=rt.motion,he=rt.defaultMotions,Fe=he===void 0?{}:he,Re=rt.openAnimation,et=rt.openTransitionName,tt=Me.switchingModeFromInline;if(ee)return ee;if(Object(o.a)(Re)==="object"&&Re)Object(ae.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Re=="string")return{motionName:"".concat(we,"-open-").concat(Re)};if(et)return{motionName:et};var Te=Fe[Ue];return Te||(tt?null:Fe.other)}var Q=function(rt){Object(N.a)(Ue,rt);var Me=Object(R.a)(Ue);function Ue(we){var ee;Object(K.a)(this,Ue),ee=Me.call(this,we),ee.inlineOpenKeys=[],ee.onSelect=function(Re){var et=Object(H.a)(ee),tt=et.props;if(tt.selectable){var Te=ee.store.getState(),Ae=Te.selectedKeys,Qe=Re.key;tt.multiple?Ae=Ae.concat([Qe]):Ae=[Qe],"selectedKeys"in tt||ee.store.setState({selectedKeys:Ae}),tt.onSelect(Object(Y.a)(Object(Y.a)({},Re),{},{selectedKeys:Ae}))}},ee.onClick=function(Re){var et=ee.getRealMenuMode(),tt=Object(H.a)(ee),Te=tt.store,Ae=tt.props.onOpenChange;et!=="inline"&&!("openKeys"in ee.props)&&(Te.setState({openKeys:[]}),Ae([])),ee.props.onClick(Re)},ee.onKeyDown=function(Re,et){ee.innerMenu.getWrappedInstance().onKeyDown(Re,et)},ee.onOpenChange=function(Re){var et=Object(H.a)(ee),tt=et.props,Te=ee.store.getState().openKeys.concat(),Ae=!1,Qe=function(vt){var cn=!1;if(vt.open)cn=Te.indexOf(vt.key)===-1,cn&&Te.push(vt.key);else{var yn=Te.indexOf(vt.key);cn=yn!==-1,cn&&Te.splice(yn,1)}Ae=Ae||cn};Array.isArray(Re)?Re.forEach(Qe):Qe(Re),Ae&&("openKeys"in ee.props||ee.store.setState({openKeys:Te}),tt.onOpenChange(Te))},ee.onDeselect=function(Re){var et=Object(H.a)(ee),tt=et.props;if(tt.selectable){var Te=ee.store.getState().selectedKeys.concat(),Ae=Re.key,Qe=Te.indexOf(Ae);Qe!==-1&&Te.splice(Qe,1),"selectedKeys"in tt||ee.store.setState({selectedKeys:Te}),tt.onDeselect(Object(Y.a)(Object(Y.a)({},Re),{},{selectedKeys:Te}))}},ee.onMouseEnter=function(Re){ee.restoreModeVerticalFromInline();var et=ee.props.onMouseEnter;et&&et(Re)},ee.onTransitionEnd=function(Re){var et=Re.propertyName==="width"&&Re.target===Re.currentTarget,tt=Re.target.className,Te=Object.prototype.toString.call(tt)==="[object SVGAnimatedString]"?tt.animVal:tt,Ae=Re.propertyName==="font-size"&&Te.indexOf("anticon")>=0;(et||Ae)&&ee.restoreModeVerticalFromInline()},ee.setInnerMenu=function(Re){ee.innerMenu=Re},ee.isRootMenu=!0;var he=we.defaultSelectedKeys,Fe=we.defaultOpenKeys;return"selectedKeys"in we&&(he=we.selectedKeys||[]),"openKeys"in we&&(Fe=we.openKeys||[]),ee.store=Object(k.c)({selectedKeys:he,openKeys:Fe,activeKey:{"0-menu-":Ne(we,we.activeKey)}}),ee.state={switchingModeFromInline:!1},ee}return Object(L.a)(Ue,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ee){this.updateOpentKeysWhenSwitchMode(ee),this.updateMiniStore();var he=this.props,Fe=he.siderCollapsed,Re=he.inlineCollapsed,et=he.onOpenChange;(!ee.inlineCollapsed&&Re||!ee.siderCollapsed&&Fe)&&et([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ee){var he=this.props,Fe=this.store,Re=this.inlineOpenKeys,et=Fe.getState(),tt={};ee.mode==="inline"&&he.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in he||((he.inlineCollapsed&&!ee.inlineCollapsed||he.siderCollapsed&&!ee.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=et.openKeys.concat(),tt.openKeys=[]),(!he.inlineCollapsed&&ee.inlineCollapsed||!he.siderCollapsed&&ee.siderCollapsed)&&(tt.openKeys=Re,this.inlineOpenKeys=[])),Object.keys(tt).length&&Fe.setState(tt)}},{key:"updateMenuDisplay",value:function(){var ee=this.props.collapsedWidth,he=this.store,Fe=this.prevOpenKeys,Re=this.getInlineCollapsed()&&(ee===0||ee==="0"||ee==="0px");Re?(this.prevOpenKeys=he.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Fe&&(this.store.setState({openKeys:Fe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ee=this.props.mode,he=this.state.switchingModeFromInline,Fe=this.getInlineCollapsed();return he&&Fe?"inline":Fe?"vertical":ee}},{key:"getInlineCollapsed",value:function(){var ee=this.props,he=ee.inlineCollapsed,Fe=ee.siderCollapsed;return Fe!==void 0?Fe:he}},{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(Y.a)({},Object(A.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),he=this.getRealMenuMode();return ee.className+=" ".concat(ee.prefixCls,"-root"),ee.direction==="rtl"&&(ee.className+=" ".concat(ee.prefixCls,"-rtl")),ee=Object(Y.a)(Object(Y.a)({},ee),{},{mode:he,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ie(this.props,this.state,he)}),delete ee.openAnimation,delete ee.openTransitionName,j.createElement(k.a,{store:this.store},j.createElement(pe,Object.assign({},ee,{ref:this.setInnerMenu}),this.props.children))}}]),Ue}(j.Component);Q.defaultProps={selectable:!0,onClick:C,onSelect:C,onOpenChange:C,onDeselect:C,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:j.createElement("span",null,"\xB7\xB7\xB7")};var q=Q,te=function(rt){Object(N.a)(Ue,rt);var Me=Object(R.a)(Ue);function Ue(){var we;return Object(K.a)(this,Ue),we=Me.apply(this,arguments),we.onKeyDown=function(ee){var he=ee.keyCode;return he===h.a.ENTER?(we.onClick(ee),!0):void 0},we.onMouseLeave=function(ee){var he=we.props,Fe=he.eventKey,Re=he.onItemHover,et=he.onMouseLeave;Re({key:Fe,hover:!1}),et({key:Fe,domEvent:ee})},we.onMouseEnter=function(ee){var he=we.props,Fe=he.eventKey,Re=he.onItemHover,et=he.onMouseEnter;Re({key:Fe,hover:!0}),et({key:Fe,domEvent:ee})},we.onClick=function(ee){var he=we.props,Fe=he.eventKey,Re=he.multiple,et=he.onClick,tt=he.onSelect,Te=he.onDeselect,Ae=he.isSelected,Qe={key:Fe,keyPath:[Fe],item:Object(H.a)(we),domEvent:ee};et(Qe),Re?Ae?Te(Qe):tt(Qe):Ae||tt(Qe)},we.saveNode=function(ee){we.node=ee},we}return Object(L.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,he=Object(Y.a)({},this.props),Fe=i()(this.getPrefixCls(),he.className,(ee={},Object(g.a)(ee,this.getActiveClassName(),!he.disabled&&he.active),Object(g.a)(ee,this.getSelectedClassName(),he.isSelected),Object(g.a)(ee,this.getDisabledClassName(),he.disabled),ee)),Re=Object(Y.a)(Object(Y.a)({},he.attribute),{},{title:typeof he.title=="string"?he.title:void 0,className:Fe,role:he.role||"menuitem","aria-disabled":he.disabled});he.role==="option"?Re=Object(Y.a)(Object(Y.a)({},Re),{},{role:"option","aria-selected":he.isSelected}):(he.role===null||he.role==="none")&&(Re.role="none");var et={onClick:he.disabled?null:this.onClick,onMouseLeave:he.disabled?null:this.onMouseLeave,onMouseEnter:he.disabled?null:this.onMouseEnter},tt=Object(Y.a)({},he.style);he.mode==="inline"&&(he.direction==="rtl"?tt.paddingRight=he.inlineIndent*he.level:tt.paddingLeft=he.inlineIndent*he.level),fe.forEach(function(Ae){return delete he[Ae]}),delete he.direction;var Te=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Te=j.createElement(this.props.itemIcon,this.props)),j.createElement("li",Object.assign({},Object(A.default)(he,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Re,et,{style:tt,ref:this.saveNode}),he.children,Te)}}]),Ue}(j.Component);te.isMenuItem=!0,te.defaultProps={onSelect:C,onMouseEnter:C,onMouseLeave:C,manualRef:C};var se=Object(k.b)(function(rt,Me){var Ue=rt.activeKey,we=rt.selectedKeys,ee=Me.eventKey,he=Me.subMenuKey;return{active:Ue[he]===ee,isSelected:we.indexOf(ee)!==-1}})(te),ce=se,Se=function(rt){Object(N.a)(Ue,rt);var Me=Object(R.a)(Ue);function Ue(){var we;return Object(K.a)(this,Ue),we=Me.apply(this,arguments),we.renderInnerMenuItem=function(ee){var he=we.props,Fe=he.renderMenuItem,Re=he.index;return Fe(ee,Re,we.props.subMenuKey)},we}return Object(L.a)(Ue,[{key:"render",value:function(){var ee=Object(D.a)({},this.props),he=ee.className,Fe=he===void 0?"":he,Re=ee.rootPrefixCls,et="".concat(Re,"-item-group-title"),tt="".concat(Re,"-item-group-list"),Te=ee.title,Ae=ee.children;return fe.forEach(function(Qe){return delete ee[Qe]}),delete ee.onClick,delete ee.direction,j.createElement("li",Object.assign({},ee,{className:"".concat(Fe," ").concat(Re,"-item-group")}),j.createElement("div",{className:et,title:typeof Te=="string"?Te:void 0},Te),j.createElement("ul",{className:tt},j.Children.map(Ae,this.renderInnerMenuItem)))}}]),Ue}(j.Component);Se.isMenuItemGroup=!0,Se.defaultProps={disabled:!0};var je=Se,Ze=function(Me){var Ue=Me.className,we=Me.rootPrefixCls,ee=Me.style;return j.createElement("li",{className:"".concat(Ue," ").concat(we,"-item-divider"),style:ee})};Ze.defaultProps={disabled:!0,className:"",style:{}};var ut=Ze,it=ye.e=q},"55Ip":function(Le,ye,F){"use strict";F.d(ye,"a",function(){return n});var Y=F("Ty5D"),K=F("dI71"),L=F("cDcd"),H=F.n(L),N=F("YS25"),R=F("17x9"),j=F.n(R),k=F("wx14"),A=F("zLVn"),D=F("9R94"),g=function(v){Object(K.a)(p,v);function p(){for(var E,_=arguments.length,b=new Array(_),I=0;I<_;I++)b[I]=arguments[I];return E=v.call.apply(v,[this].concat(b))||this,E.history=Object(N.a)(E.props),E}var c=p.prototype;return c.render=function(){return H.a.createElement(Y.c,{history:this.history,children:this.props.children})},p}(H.a.Component),h=function(v){Object(K.a)(p,v);function p(){for(var E,_=arguments.length,b=new Array(_),I=0;I<_;I++)b[I]=arguments[I];return E=v.call.apply(v,[this].concat(b))||this,E.history=Object(N.b)(E.props),E}var c=p.prototype;return c.render=function(){return H.a.createElement(Y.c,{history:this.history,children:this.props.children})},p}(H.a.Component),u=function(p,c){return typeof p=="function"?p(c):p},d=function(p,c){return typeof p=="string"?Object(N.c)(p,null,null,c):p},s=function(p){return p},l=H.a.forwardRef;typeof l=="undefined"&&(l=s);function i(v){return!!(v.metaKey||v.altKey||v.ctrlKey||v.shiftKey)}var o=l(function(v,p){var c=v.innerRef,E=v.navigate,_=v.onClick,b=Object(A.a)(v,["innerRef","navigate","onClick"]),I=b.target,P=Object(k.a)({},b,{onClick:function(z){try{_&&_(z)}catch(U){throw z.preventDefault(),U}!z.defaultPrevented&&z.button===0&&(!I||I==="_self")&&!i(z)&&(z.preventDefault(),E())}});return s!==l?P.ref=p||c:P.ref=c,H.a.createElement("a",P)}),n=l(function(v,p){var c=v.component,E=c===void 0?o:c,_=v.replace,b=v.to,I=v.innerRef,P=Object(A.a)(v,["component","replace","to","innerRef"]);return H.a.createElement(Y.e.Consumer,null,function(B){B||Object(D.a)(!1);var z=B.history,U=d(u(b,B.location),B.location),C=U?z.createHref(U):"",W=Object(k.a)({},P,{href:C,navigate:function(){var J=u(b,B.location),ne=_?z.replace:z.push;ne(J)}});return s!==l?W.ref=p||I:W.innerRef=I,H.a.createElement(E,W)})});if(!1)var f,O;var S=function(p){return p},x=H.a.forwardRef;typeof x=="undefined"&&(x=S);function w(){for(var v=arguments.length,p=new Array(v),c=0;c<v;c++)p[c]=arguments[c];return p.filter(function(E){return E}).join(" ")}var T=x(function(v,p){var c=v["aria-current"],E=c===void 0?"page":c,_=v.activeClassName,b=_===void 0?"active":_,I=v.activeStyle,P=v.className,B=v.exact,z=v.isActive,U=v.location,C=v.sensitive,W=v.strict,V=v.style,J=v.to,ne=v.innerRef,fe=Object(A.a)(v,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return H.a.createElement(Y.e.Consumer,null,function(ue){ue||Object(D.a)(!1);var le=U||ue.location,me=d(u(J,le),le),ge=me.pathname,re=ge&&ge.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),oe=re?Object(Y.f)(le.pathname,{path:re,exact:B,sensitive:C,strict:W}):null,xe=!!(z?z(oe,le):oe),Be=xe?w(P,b):P,Ve=xe?Object(k.a)({},V,{},I):V,Ye=Object(k.a)({"aria-current":xe&&E||null,className:Be,style:Ve,to:me},fe);return S!==x?Ye.ref=p||ne:Ye.innerRef=ne,H.a.createElement(n,Ye)})});if(!1)var y},"5VLF":function(Le,ye,F){"use strict";var Y,K;function L(H,N,R){var j=function(k,A){return H.js_beautify(k,A)};return j.js=H.js_beautify,j.css=N.css_beautify,j.html=R.html_beautify,j.js_beautify=H.js_beautify,j.css_beautify=N.css_beautify,j.html_beautify=R.html_beautify,j}!(Y=[F("6UM0"),F("TXwP"),F("psGv")],K=function(H,N,R){return L(H,N,R)}.apply(ye,Y),K!==void 0&&(Le.exports=K))},"5nXd":function(Le,ye,F){var Y=F("MFOe"),K=Y.slice,L=Y.pluck,H=Y.each,N=Y.bind,R=Y.create,j=Y.isList,k=Y.isFunction,A=Y.isObject;Le.exports={createStore:h};var D={version:"2.0.12",enabled:!1,get:function(u,d){var s=this.storage.read(this._namespacePrefix+u);return this._deserialize(s,d)},set:function(u,d){return d===void 0?this.remove(u):(this.storage.write(this._namespacePrefix+u,this._serialize(d)),d)},remove:function(u){this.storage.remove(this._namespacePrefix+u)},each:function(u){var d=this;this.storage.each(function(s,l){u.call(d,d._deserialize(s),(l||"").replace(d._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(u){return this._namespacePrefix=="__storejs_"+u+"_"},createStore:function(){return h.apply(this,arguments)},addPlugin:function(u){this._addPlugin(u)},namespace:function(u){return h(this.storage,this.plugins,u)}};function g(){var u=typeof console=="undefined"?null:console;if(!u)return;var d=u.warn?u.warn:u.log;d.apply(u,arguments)}function h(u,d,s){s||(s=""),u&&!j(u)&&(u=[u]),d&&!j(d)&&(d=[d]);var l=s?"__storejs_"+s+"_":"",i=s?new RegExp("^"+l):null,o=/^[a-zA-Z0-9_\-]*$/;if(!o.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var n={_namespacePrefix:l,_namespaceRegexp:i,_testStorage:function(O){try{var S="__storejs__test__";O.write(S,S);var x=O.read(S)===S;return O.remove(S),x}catch(w){return!1}},_assignPluginFnProp:function(O,S){var x=this[S];this[S]=function(){var T=K(arguments,0),y=this;function v(){return x?(H(arguments,function(c,E){T[E]=c}),x.apply(y,T)):void 0}var p=[v].concat(T);return O.apply(y,p)}},_serialize:function(O){return JSON.stringify(O)},_deserialize:function(O,S){if(!O)return S;var x="";try{x=JSON.parse(O)}catch(w){x=O}return x!==void 0?x:S},_addStorage:function(O){if(this.enabled)return;this._testStorage(O)&&(this.storage=O,this.enabled=!0)},_addPlugin:function(O){var S=this;if(j(O)){H(O,function(T){S._addPlugin(T)});return}var x=L(this.plugins,function(T){return O===T});if(x)return;if(this.plugins.push(O),!k(O))throw new Error("Plugins must be function values that return objects");var w=O.call(this);if(!A(w))throw new Error("Plugins must return an object of function properties");H(w,function(T,y){if(!k(T))throw new Error("Bad plugin property: "+y+" from plugin "+O.name+". Plugins should only return functions.");S._assignPluginFnProp(T,y)})},addStorage:function(O){g("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(O)}},f=R(n,D,{plugins:[]});return f.raw={},H(f,function(O,S){k(O)&&(f.raw[S]=N(f,O))}),H(u,function(O){f._addStorage(O)}),H(d,function(O){f._addPlugin(O)}),f}},"6+eU":function(Le,ye,F){"use strict";F.d(ye,"a",function(){return x});var Y=F("wx14"),K=F("rePB"),L=F("VTBJ"),H=F("1OyB"),N=F("vuIU"),R=F("Ji7U"),j=F("LK+K"),k=F("cDcd"),A=F.n(k),D=F("TSYQ"),g=F.n(D),h=function(T){var y,v="".concat(T.rootPrefixCls,"-item"),p=g()(v,"".concat(v,"-").concat(T.page),(y={},Object(K.a)(y,"".concat(v,"-active"),T.active),Object(K.a)(y,T.className,!!T.className),Object(K.a)(y,"".concat(v,"-disabled"),!T.page),y)),c=function(){T.onClick(T.page)},E=function(b){T.onKeyPress(b,T.onClick,T.page)};return A.a.createElement("li",{title:T.showTitle?T.page:null,className:p,onClick:c,onKeyPress:E,tabIndex:"0"},T.itemRender(T.page,"page",A.a.createElement("a",{rel:"nofollow"},T.page)))},u=h,d={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(w){Object(R.a)(y,w);var T=Object(j.a)(y);function y(){var v;Object(H.a)(this,y);for(var p=arguments.length,c=new Array(p),E=0;E<p;E++)c[E]=arguments[E];return v=T.call.apply(T,[this].concat(c)),v.state={goInputText:""},v.buildOptionText=function(_){return"".concat(_," ").concat(v.props.locale.items_per_page)},v.changeSize=function(_){v.props.changeSize(Number(_))},v.handleChange=function(_){v.setState({goInputText:_.target.value})},v.handleBlur=function(_){var b=v.props,I=b.goButton,P=b.quickGo,B=b.rootPrefixCls,z=v.state.goInputText;if(I||z==="")return;if(_.relatedTarget&&(_.relatedTarget.className.indexOf("".concat(B,"-prev"))>=0||_.relatedTarget.className.indexOf("".concat(B,"-next"))>=0))return;v.setState({goInputText:""}),P(v.getValidValue())},v.go=function(_){var b=v.state.goInputText;if(b==="")return;(_.keyCode===d.ENTER||_.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(N.a)(y,[{key:"getValidValue",value:function(){var p=this.state,c=p.goInputText,E=p.current;return!c||isNaN(c)?E:Number(c)}},{key:"getPageSizeOptions",value:function(){var p=this.props,c=p.pageSize,E=p.pageSizeOptions;return E.some(function(_){return _.toString()===c.toString()})?E:E.concat([c.toString()]).sort(function(_,b){var I=isNaN(Number(_))?0:Number(_),P=isNaN(Number(b))?0:Number(b);return I-P})}},{key:"render",value:function(){var p=this,c=this.props,E=c.pageSize,_=c.locale,b=c.rootPrefixCls,I=c.changeSize,P=c.quickGo,B=c.goButton,z=c.selectComponentClass,U=c.buildOptionText,C=c.selectPrefixCls,W=c.disabled,V=this.state.goInputText,J="".concat(b,"-options"),ne=z,fe=null,ue=null,le=null;if(!I&&!P)return null;var me=this.getPageSizeOptions();if(I&&ne){var ge=me.map(function(re,oe){return A.a.createElement(ne.Option,{key:oe,value:re.toString()},(U||p.buildOptionText)(re))});fe=A.a.createElement(ne,{disabled:W,prefixCls:C,showSearch:!1,className:"".concat(J,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||me[0]).toString(),onChange:this.changeSize,getPopupContainer:function(oe){return oe.parentNode}},ge)}return P&&(B&&(le=typeof B=="boolean"?A.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:W,className:"".concat(J,"-quick-jumper-button")},_.jump_to_confirm):A.a.createElement("span",{onClick:this.go,onKeyUp:this.go},B)),ue=A.a.createElement("div",{className:"".concat(J,"-quick-jumper")},_.jump_to,A.a.createElement("input",{disabled:W,type:"text",value:V,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),_.page,le)),A.a.createElement("li",{className:"".concat(J)},fe,ue)}}]),y}(A.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=s,i=F("N2Kk");function o(){}function n(w){return typeof w=="number"&&isFinite(w)&&Math.floor(w)===w}function f(w,T,y){return y}function O(w,T,y){var v=typeof w=="undefined"?T.pageSize:w;return Math.floor((y.total-1)/v)+1}var S=function(w){Object(R.a)(y,w);var T=Object(j.a)(y);function y(v){var p;Object(H.a)(this,y),p=T.call(this,v),p.getJumpPrevPage=function(){return Math.max(1,p.state.current-(p.props.showLessItems?3:5))},p.getJumpNextPage=function(){return Math.min(O(void 0,p.state,p.props),p.state.current+(p.props.showLessItems?3:5))},p.getItemIcon=function(I,P){var B=p.props.prefixCls,z=I||A.a.createElement("button",{type:"button","aria-label":P,className:"".concat(B,"-item-link")});return typeof I=="function"&&(z=A.a.createElement(I,Object(L.a)({},p.props))),z},p.savePaginationNode=function(I){p.paginationNode=I},p.isValid=function(I){return n(I)&&I!==p.state.current},p.shouldDisplayQuickJumper=function(){var I=p.props,P=I.showQuickJumper,B=I.pageSize,z=I.total;return z<=B?!1:P},p.handleKeyDown=function(I){(I.keyCode===d.ARROW_UP||I.keyCode===d.ARROW_DOWN)&&I.preventDefault()},p.handleKeyUp=function(I){var P=p.getValidValue(I),B=p.state.currentInputValue;P!==B&&p.setState({currentInputValue:P}),I.keyCode===d.ENTER?p.handleChange(P):I.keyCode===d.ARROW_UP?p.handleChange(P-1):I.keyCode===d.ARROW_DOWN&&p.handleChange(P+1)},p.changePageSize=function(I){var P=p.state.current,B=O(I,p.state,p.props);P=P>B?B:P,B===0&&(P=p.state.current),typeof I=="number"&&("pageSize"in p.props||p.setState({pageSize:I}),"current"in p.props||p.setState({current:P,currentInputValue:P})),p.props.onShowSizeChange(P,I),"onChange"in p.props&&p.props.onChange&&p.props.onChange(P,I)},p.handleChange=function(I){var P=p.props.disabled,B=I;if(p.isValid(B)&&!P){var z=O(void 0,p.state,p.props);B>z?B=z:B<1&&(B=1),"current"in p.props||p.setState({current:B,currentInputValue:B});var U=p.state.pageSize;return p.props.onChange(B,U),B}return p.state.current},p.prev=function(){p.hasPrev()&&p.handleChange(p.state.current-1)},p.next=function(){p.hasNext()&&p.handleChange(p.state.current+1)},p.jumpPrev=function(){p.handleChange(p.getJumpPrevPage())},p.jumpNext=function(){p.handleChange(p.getJumpNextPage())},p.hasPrev=function(){return p.state.current>1},p.hasNext=function(){return p.state.current<O(void 0,p.state,p.props)},p.runIfEnter=function(I,P){if(I.key==="Enter"||I.charCode===13){for(var B=arguments.length,z=new Array(B>2?B-2:0),U=2;U<B;U++)z[U-2]=arguments[U];P.apply(void 0,z)}},p.runIfEnterPrev=function(I){p.runIfEnter(I,p.prev)},p.runIfEnterNext=function(I){p.runIfEnter(I,p.next)},p.runIfEnterJumpPrev=function(I){p.runIfEnter(I,p.jumpPrev)},p.runIfEnterJumpNext=function(I){p.runIfEnter(I,p.jumpNext)},p.handleGoTO=function(I){(I.keyCode===d.ENTER||I.type==="click")&&p.handleChange(p.state.currentInputValue)};var c=v.onChange!==o,E="current"in v;E&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var _=v.defaultCurrent;"current"in v&&(_=v.current);var b=v.defaultPageSize;return"pageSize"in v&&(b=v.pageSize),_=Math.min(_,O(b,void 0,v)),p.state={current:_,currentInputValue:_,pageSize:b},p}return Object(N.a)(y,[{key:"componentDidUpdate",value:function(p,c){var E=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var _=this.paginationNode.querySelector(".".concat(E,"-item-").concat(c.current));_&&document.activeElement===_&&_.blur()}}},{key:"getValidValue",value:function(p){var c=p.target.value,E=O(void 0,this.state,this.props),_=this.state.currentInputValue,b;return c===""?b=c:isNaN(Number(c))?b=_:c>=E?b=E:b=Number(c),b}},{key:"getShowSizeChanger",value:function(){var p=this.props,c=p.showSizeChanger,E=p.total,_=p.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:E>_}},{key:"renderPrev",value:function(p){var c=this.props,E=c.prevIcon,_=c.itemRender,b=_(p,"prev",this.getItemIcon(E,"prev page")),I=!this.hasPrev();return Object(k.isValidElement)(b)?Object(k.cloneElement)(b,{disabled:I}):b}},{key:"renderNext",value:function(p){var c=this.props,E=c.nextIcon,_=c.itemRender,b=_(p,"next",this.getItemIcon(E,"next page")),I=!this.hasNext();return Object(k.isValidElement)(b)?Object(k.cloneElement)(b,{disabled:I}):b}},{key:"render",value:function(){var p=this,c=this.props,E=c.prefixCls,_=c.className,b=c.style,I=c.disabled,P=c.hideOnSinglePage,B=c.total,z=c.locale,U=c.showQuickJumper,C=c.showLessItems,W=c.showTitle,V=c.showTotal,J=c.simple,ne=c.itemRender,fe=c.showPrevNextJumpers,ue=c.jumpPrevIcon,le=c.jumpNextIcon,me=c.selectComponentClass,ge=c.selectPrefixCls,re=c.pageSizeOptions,oe=this.state,xe=oe.current,Be=oe.pageSize,Ve=oe.currentInputValue;if(P===!0&&B<=Be)return null;var Ye=O(void 0,this.state,this.props),$e=[],Ke=null,We=null,ze=null,at=null,Je=null,Xe=U&&U.goButton,He=C?1:2,ot=xe-1>0?xe-1:0,ft=xe+1<Ye?xe+1:Ye,dt=Object.keys(this.props).reduce(function(Q,q){return(q.substr(0,5)==="data-"||q.substr(0,5)==="aria-"||q==="role")&&(Q[q]=p.props[q]),Q},{});if(J)return Xe&&(typeof Xe=="boolean"?Je=A.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},z.jump_to_confirm):Je=A.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Xe),Je=A.a.createElement("li",{title:W?"".concat(z.jump_to).concat(xe,"/").concat(Ye):null,className:"".concat(E,"-simple-pager")},Je)),A.a.createElement("ul",Object(Y.a)({className:g()(E,"".concat(E,"-simple"),Object(K.a)({},"".concat(E,"-disabled"),I),_),style:b,ref:this.savePaginationNode},dt),A.a.createElement("li",{title:W?z.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(E,"-prev"),Object(K.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ot)),A.a.createElement("li",{title:W?"".concat(xe,"/").concat(Ye):null,className:"".concat(E,"-simple-pager")},A.a.createElement("input",{type:"text",value:Ve,disabled:I,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),A.a.createElement("span",{className:"".concat(E,"-slash")},"/"),Ye),A.a.createElement("li",{title:W?z.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(E,"-next"),Object(K.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ft)),Je);if(Ye<=3+He*2){var lt={locale:z,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:W,itemRender:ne};Ye||$e.push(A.a.createElement(u,Object(Y.a)({},lt,{key:"noPager",page:Ye,className:"".concat(E,"-disabled")})));for(var _t=1;_t<=Ye;_t+=1){var ht=xe===_t;$e.push(A.a.createElement(u,Object(Y.a)({},lt,{key:_t,page:_t,active:ht})))}}else{var be=C?z.prev_3:z.prev_5,_e=C?z.next_3:z.next_5;fe&&(Ke=A.a.createElement("li",{title:W?be:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(E,"-jump-prev"),Object(K.a)({},"".concat(E,"-jump-prev-custom-icon"),!!ue))},ne(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ue,"prev page"))),We=A.a.createElement("li",{title:W?_e:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(E,"-jump-next"),Object(K.a)({},"".concat(E,"-jump-next-custom-icon"),!!le))},ne(this.getJumpNextPage(),"jump-next",this.getItemIcon(le,"next page")))),at=A.a.createElement(u,{locale:z,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ye,page:Ye,active:!1,showTitle:W,itemRender:ne}),ze=A.a.createElement(u,{locale:z,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:W,itemRender:ne});var Ne=Math.max(1,xe-He),ke=Math.min(xe+He,Ye);xe-1<=He&&(ke=1+He*2),Ye-xe<=He&&(Ne=Ye-He*2);for(var Ee=Ne;Ee<=ke;Ee+=1){var Ie=xe===Ee;$e.push(A.a.createElement(u,{locale:z,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ee,page:Ee,active:Ie,showTitle:W,itemRender:ne}))}xe-1>=He*2&&xe!==1+2&&($e[0]=Object(k.cloneElement)($e[0],{className:"".concat(E,"-item-after-jump-prev")}),$e.unshift(Ke)),Ye-xe>=He*2&&xe!==Ye-2&&($e[$e.length-1]=Object(k.cloneElement)($e[$e.length-1],{className:"".concat(E,"-item-before-jump-next")}),$e.push(We)),Ne!==1&&$e.unshift(ze),ke!==Ye&&$e.push(at)}var pe=null;V&&(pe=A.a.createElement("li",{className:"".concat(E,"-total-text")},V(B,[B===0?0:(xe-1)*Be+1,xe*Be>B?B:xe*Be])));var ae=!this.hasPrev()||!Ye,ie=!this.hasNext()||!Ye;return A.a.createElement("ul",Object(Y.a)({className:g()(E,_,Object(K.a)({},"".concat(E,"-disabled"),I)),style:b,unselectable:"unselectable",ref:this.savePaginationNode},dt),pe,A.a.createElement("li",{title:W?z.prev_page:null,onClick:this.prev,tabIndex:ae?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(E,"-prev"),Object(K.a)({},"".concat(E,"-disabled"),ae)),"aria-disabled":ae},this.renderPrev(ot)),$e,A.a.createElement("li",{title:W?z.next_page:null,onClick:this.next,tabIndex:ie?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(E,"-next"),Object(K.a)({},"".concat(E,"-disabled"),ie)),"aria-disabled":ie},this.renderNext(ft)),A.a.createElement(l,{disabled:I,locale:z,rootPrefixCls:E,selectComponentClass:me,selectPrefixCls:ge,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:xe,pageSize:Be,pageSizeOptions:re,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Xe}))}}],[{key:"getDerivedStateFromProps",value:function(p,c){var E={};if("current"in p&&(E.current=p.current,p.current!==c.current&&(E.currentInputValue=E.current)),"pageSize"in p&&p.pageSize!==c.pageSize){var _=c.current,b=O(p.pageSize,c,p);_=_>b?b:_,"current"in p||(E.current=_,E.currentInputValue=_),E.pageSize=p.pageSize}return E}}]),y}(A.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:o,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:o,locale:i.a,style:{},itemRender:f,totalBoundaryShowSizeChanger:50};var x=S},"6RRn":function(Le,ye,F){"use strict";var Y=F("wCXF"),K=F("n6Qo");F.d(ye,"b",function(){return K.a});var L=F("IBYe"),H=F("6eGT"),N=F("hW8S");F.d(ye,"a",function(){return N.a}),ye.c=Y.b},"6UM0":function(Le,ye,F){var Y,K;(function(){var L;(function(){"use strict";var N=[function(A,D,g){var h=g(1).Beautifier,u=g(5).Options;function d(s,l){var i=new h(s,l);return i.beautify()}A.exports=d,A.exports.defaultOptions=function(){return new u}},function(A,D,g){var h=g(2).Output,u=g(3).Token,d=g(4),s=g(5).Options,l=g(7).Tokenizer,i=g(7).line_starters,o=g(7).positionable_operators,n=g(7).TOKEN;function f(C,W){return W.indexOf(C)!==-1}function O(C){return C.replace(/^\s+/g,"")}function S(C){for(var W={},V=0;V<C.length;V++)W[C[V].replace(/-/g,"_")]=C[V];return W}function x(C,W){return C&&C.type===n.RESERVED&&C.text===W}function w(C,W){return C&&C.type===n.RESERVED&&f(C.text,W)}var T=["case","return","do","if","throw","else","await","break","continue","async"],y=["before-newline","after-newline","preserve-newline"],v=S(y),p=[v.before_newline,v.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(C,W){if(W.multiline_frame||W.mode===c.ForInitializer||W.mode===c.Conditional)return;C.remove_indent(W.start_line_index)}function _(C){C=C.replace(d.allLineBreaks,`
`);for(var W=[],V=C.indexOf(`
`);V!==-1;)W.push(C.substring(0,V)),C=C.substring(V+1),V=C.indexOf(`
`);return C.length&&W.push(C),W}function b(C){return C===c.ArrayLiteral}function I(C){return f(C,[c.Expression,c.ForInitializer,c.Conditional])}function P(C,W){for(var V=0;V<C.length;V++){var J=C[V].trim();if(J.charAt(0)!==W)return!1}return!0}function B(C,W){for(var V=0,J=C.length,ne;V<J;V++)if(ne=C[V],ne&&ne.indexOf(W)!==0)return!1;return!0}function z(C,W){W=W||{},this._source_text=C||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(W)}z.prototype.create_flags=function(C,W){var V=0;C&&(V=C.indentation_level,!this._output.just_added_newline()&&C.line_indent_level>V&&(V=C.line_indent_level));var J={mode:W,parent:C,last_token:C?C.last_token:new u(n.START_BLOCK,""),last_word:C?C.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:V,alignment:0,line_indent_level:C?C.line_indent_level:V,start_line_index:this._output.get_line_number(),ternary_depth:0};return J},z.prototype._reset=function(C){var W=C.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new h(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var V=new l(C,this._options);return this._tokens=V.tokenize(),C},z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C,W=this._reset(this._source_text),V=this._options.eol;this._options.eol==="auto"&&(V=`
`,W&&d.lineBreak.test(W||"")&&(V=W.match(d.lineBreak)[0]));for(var J=this._tokens.next();J;)this.handle_token(J),this._last_last_text=this._flags.last_token.text,this._flags.last_token=J,J=this._tokens.next();return C=this._output.get_code(V),C},z.prototype.handle_token=function(C,W){C.type===n.START_EXPR?this.handle_start_expr(C):C.type===n.END_EXPR?this.handle_end_expr(C):C.type===n.START_BLOCK?this.handle_start_block(C):C.type===n.END_BLOCK?this.handle_end_block(C):C.type===n.WORD?this.handle_word(C):C.type===n.RESERVED?this.handle_word(C):C.type===n.SEMICOLON?this.handle_semicolon(C):C.type===n.STRING?this.handle_string(C):C.type===n.EQUALS?this.handle_equals(C):C.type===n.OPERATOR?this.handle_operator(C):C.type===n.COMMA?this.handle_comma(C):C.type===n.BLOCK_COMMENT?this.handle_block_comment(C,W):C.type===n.COMMENT?this.handle_comment(C,W):C.type===n.DOT?this.handle_dot(C):C.type===n.EOF?this.handle_eof(C):C.type===n.UNKNOWN?this.handle_unknown(C,W):this.handle_unknown(C,W)},z.prototype.handle_whitespace_and_comments=function(C,W){var V=C.newlines,J=this._options.keep_array_indentation&&b(this._flags.mode);if(C.comments_before)for(var ne=C.comments_before.next();ne;)this.handle_whitespace_and_comments(ne,W),this.handle_token(ne,W),ne=C.comments_before.next();if(J)for(var fe=0;fe<V;fe+=1)this.print_newline(fe>0,W);else if(this._options.max_preserve_newlines&&V>this._options.max_preserve_newlines&&(V=this._options.max_preserve_newlines),this._options.preserve_newlines&&V>1){this.print_newline(!1,W);for(var ue=1;ue<V;ue+=1)this.print_newline(!0,W)}};var U=["async","break","continue","return","throw","yield"];z.prototype.allow_wrap_or_preserved_newline=function(C,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var V=this._options.preserve_newlines&&C.newlines||W,J=f(this._flags.last_token.text,o)||f(C.text,o);if(J){var ne=f(this._flags.last_token.text,o)&&f(this._options.operator_position,p)||f(C.text,o);V=V&&ne}if(V)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(w(this._flags.last_token,U))return;this._output.set_wrap_point()}},z.prototype.print_newline=function(C,W){if(!W&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var V=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(C)&&(this._flags.multiline_frame=!0)},z.prototype.print_token_line_indentation=function(C){this._output.just_added_newline()&&(this._options.keep_array_indentation&&C.newlines&&(C.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(C.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},z.prototype.print_token=function(C){if(this._output.raw){this._output.add_raw_token(C);return}if(this._options.comma_first&&C.previous&&C.previous.type===n.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(C),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(C),this._output.non_breaking_space=!0,this._output.add_token(C.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},z.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},z.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},z.prototype.set_mode=function(C){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,C),this._flags=this.create_flags(this._previous_flags,C),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},z.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},z.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"]))},z.prototype.start_of_statement=function(C){var W=!1;return W=W||w(this._flags.last_token,["var","let","const"])&&C.type===n.WORD,W=W||x(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&w(this._flags.last_token,U)&&!C.newlines,W=W||x(this._flags.last_token,"else")&&!(x(C,"if")&&!C.comments_before),W=W||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),W=W||this._flags.last_token.type===n.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(C.text==="--"||C.text==="++")&&this._last_last_text!=="function"&&C.type!==n.WORD&&C.type!==n.RESERVED,W=W||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"])),W?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(C,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C,w(C,["do","for","if","while"])),!0):!1},z.prototype.handle_start_expr=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C);var W=c.Expression;if(C.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){w(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(C),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=c.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),f(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=c.ForInitializer):f(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=c.Conditional):f(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&C.whitespace_before===""?this._output.space_before_token=!1:(f(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var V=this._tokens.peek(-3);if(this._options.space_after_named_function&&V){var J=this._tokens.peek(-4);w(V,["async","function"])||V.text==="*"&&w(J,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(V.text==="{"||V.text===","||V.text==="*"&&(J.text==="{"||J.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(C);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&f(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(C,C.newlines),this.print_token(C),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},z.prototype.handle_end_expr=function(C){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(C,C.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(C),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},z.prototype.handle_start_block=function(C){this.handle_whitespace_and_comments(C);var W=this._tokens.peek(),V=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):V&&(f(V.text,[":",","])&&f(W.type,[n.STRING,n.WORD,n.RESERVED])||f(W.text,["get","set","..."])&&f(V.type,[n.WORD,n.RESERVED]))?f(this._last_last_text,["class","interface"])&&!f(V.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):f(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||w(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(w(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var J=!W.comments_before&&W.text==="}",ne=J&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var fe=0,ue=null;this._flags.inline_frame=!0;do if(fe+=1,ue=this._tokens.peek(fe-1),ue.newlines){this._flags.inline_frame=!1;break}while(ue.type!==n.EOF&&!(ue.type===n.END_BLOCK&&ue.opened===C))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(ne||this._flags.last_token.type===n.EQUALS||w(this._flags.last_token,T)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(C),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(C),this.indent(),!J&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},z.prototype.handle_end_block=function(C){for(this.handle_whitespace_and_comments(C);this._flags.mode===c.Statement;)this.restore_mode();var W=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(C)},z.prototype.handle_word=function(C){if(C.type===n.RESERVED){if(f(C.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)C.type=n.WORD;else if(C.text==="import"&&f(this._tokens.peek().text,["(","."]))C.type=n.WORD;else if(f(C.text,["as","from"])&&!this._flags.import_block)C.type=n.WORD;else if(this._flags.mode===c.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(C.type=n.WORD)}}if(this.start_of_statement(C)?w(this._flags.last_token,["var","let","const"])&&C.type===n.WORD&&(this._flags.declaration_statement=!0):C.newlines&&!I(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!w(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(C),this.print_newline()):this.handle_whitespace_and_comments(C),this._flags.do_block&&!this._flags.do_while)if(x(C,"while")){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(C,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&w(C,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(C),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C)),x(C,"function")){(f(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(f(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!C.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?w(this._flags.last_token,["get","set","new","export"])||w(this._flags.last_token,U)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(I(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(C),this._flags.last_word=C.text;return}var V="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?V="SPACE":w(C,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines?V="NEWLINE":(V="SPACE",this._output.space_before_token=!0):V="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===c.BlockStatement?V="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&I(this._flags.mode)?V="SPACE":this._flags.last_token.type===n.STRING?V="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&f(this._last_last_text,["{",","]))?V="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?V="SPACE":V="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,V="NEWLINE"),w(C,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?V="SPACE":V="NEWLINE"),w(C,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var J=this._output.current_line;J.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else V==="NEWLINE"?w(this._flags.last_token,T)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&w(C,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!w(C,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(C,"if")&&x(C.previous,"else")?this._output.space_before_token=!0:this.print_newline()):w(C,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():V==="SPACE"&&(this._output.space_before_token=!0);C.previous&&(C.previous.type===n.WORD||C.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(C),this._flags.last_word=C.text,C.type===n.RESERVED&&(C.text==="do"?this._flags.do_block=!0:C.text==="if"?this._flags.if_block=!0:C.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(C,"from")&&(this._flags.import_block=!1))},z.prototype.handle_semicolon=function(C){this.start_of_statement(C)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(C);for(var W=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(C)},z.prototype.handle_string=function(C){C.text.startsWith("`")&&C.newlines===0&&C.whitespace_before===""&&(C.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(C)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(C),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C):C.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(C.previous.text==="]"||C.previous.text===")")&&C.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(C)},z.prototype.handle_equals=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0},z.prototype.handle_comma=function(C){this.handle_whitespace_and_comments(C,!0),this.print_token(C),this._output.space_before_token=!0,this._flags.declaration_statement?(I(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)},z.prototype.handle_operator=function(C){var W=C.text==="*"&&(w(this._flags.last_token,["function","yield"])||f(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),V=f(C.text,["-","+"])&&(f(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||f(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(C)){var J=!W;this.handle_whitespace_and_comments(C,J)}if(C.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(C);return}if(C.text==="::"){this.print_token(C);return}if(this._flags.last_token.type===n.OPERATOR&&f(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(C),C.text===":"&&this._flags.in_case){this.print_token(C),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ne=!0,fe=!0,ue=!1;if(C.text===":"?this._flags.ternary_depth===0?ne=!1:(this._flags.ternary_depth-=1,ue=!0):C.text==="?"&&(this._flags.ternary_depth+=1),!V&&!W&&this._options.preserve_newlines&&f(C.text,o)){var le=C.text===":",me=le&&ue,ge=le&&!ue;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!ge,this.print_token(C),(!le||me)&&this.allow_wrap_or_preserved_newline(C),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!le||me?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(C):this._output.space_before_token=!1,this.print_token(C),this._output.space_before_token=!0;return;case v.preserve_newline:ge||this.allow_wrap_or_preserved_newline(C),ne=!(this._output.just_added_newline()||ge),this._output.space_before_token=ne,this.print_token(C),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(C),ne=!1;var re=this._tokens.peek();fe=re&&f(re.type,[n.WORD,n.RESERVED])}else if(C.text==="...")this.allow_wrap_or_preserved_newline(C),ne=this._flags.last_token.type===n.START_BLOCK,fe=!1;else if(f(C.text,["--","++","!","~"])||V){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(C),ne=!1,fe=!1,C.newlines&&(C.text==="--"||C.text==="++"||C.text==="~")){var oe=w(this._flags.last_token,T)&&C.newlines;oe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(oe,!0)}this._flags.last_token.text===";"&&I(this._flags.mode)&&(ne=!0),this._flags.last_token.type===n.RESERVED?ne=!0:this._flags.last_token.type===n.END_EXPR?ne=!(this._flags.last_token.text==="]"&&(C.text==="--"||C.text==="++")):this._flags.last_token.type===n.OPERATOR&&(ne=f(C.text,["--","-","++","+"])&&f(this._flags.last_token.text,["--","-","++","+"]),f(C.text,["+","-"])&&f(this._flags.last_token.text,["--","++"])&&(fe=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ne,this.print_token(C),this._output.space_before_token=fe},z.prototype.handle_block_comment=function(C,W){if(this._output.raw){this._output.add_raw_token(C),C.directives&&C.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(C.directives){this.print_newline(!1,W),this.print_token(C),C.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(C.text)&&!C.newlines){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0;return}else this.print_block_commment(C,W)},z.prototype.print_block_commment=function(C,W){var V=_(C.text),J,ne=!1,fe=!1,ue=C.whitespace_before,le=ue.length;if(this.print_newline(!1,W),this.print_token_line_indentation(C),this._output.add_token(V[0]),this.print_newline(!1,W),V.length>1){for(V=V.slice(1),ne=P(V,"*"),fe=B(V,ue),ne&&(this._flags.alignment=1),J=0;J<V.length;J++)ne?(this.print_token_line_indentation(C),this._output.add_token(O(V[J]))):fe&&V[J]?(this.print_token_line_indentation(C),this._output.add_token(V[J].substring(le))):(this._output.current_line.set_indent(-1),this._output.add_token(V[J])),this.print_newline(!1,W);this._flags.alignment=0}},z.prototype.handle_comment=function(C,W){C.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(C),this.print_newline(!1,W)},z.prototype.handle_dot=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),w(this._flags.last_token,T)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(C,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(C)},z.prototype.handle_unknown=function(C,W){this.print_token(C),C.text[C.text.length-1]===`
`&&this.print_newline(!1,W)},z.prototype.handle_eof=function(C){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C)},A.exports.Beautifier=z},function(A){function D(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var u=new D(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},D.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},D.prototype.has_match=function(u){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(u))return!0;return!1},D.prototype.set_indent=function(u,d){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(u){this.__items.push(u);var d=u.lastIndexOf(`
`);d!==-1?this.__character_count=u.length-d:this.__character_count+=u.length},D.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,d){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),d=d||"",u.indent_level>0&&(d=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(u,d){var s=this.__base_string_length;return d=d||0,u<0&&(s=0),s+=u*this.__indent_size,s+=d,s},g.prototype.get_indent_string=function(u,d){var s=this.__base_string;return d=d||0,u<0&&(u=0,s=""),d+=u*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,d=0,s="";this.__indent_size&&u>=this.__indent_size&&(d=Math.floor(u/this.__indent_size),u-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function h(u,d){this.__indent_cache=new g(u,d),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(u,d){return this.__indent_cache.get_indent_string(u,d)},h.prototype.get_indent_size=function(u,d){return this.__indent_cache.get_indent_size(u,d)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(u){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return u!==`
`&&(s=s.replace(/[\n]/g,u)),s},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(u,d){return u=u||0,d=d||0,this.next_line.set_indent(u,d),this.__lines.length>1?(this.current_line.set_indent(u,d),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(u){for(var d=0;d<u.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(u){for(var d=this.__lines.length;u<d;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(u,d){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(u)!==0&&l.item(-1)!==d){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},A.exports.Output=h},function(A){function D(g,h,u,d){this.type=g,this.text=h,this.comments_before=null,this.newlines=u||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}A.exports.Token=D},function(A,D){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",d="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+g+u+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+h+u+d+"])*";D.identifier=new RegExp(s+l,"g"),D.identifierStart=new RegExp(s),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+h+u+d+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(A,D,g){var h=g(6).Options,u=["before-newline","after-newline","preserve-newline"];function d(s){h.call(this,s,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var o=0;o<i.length;o++)i[o]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[o];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}d.prototype=new h,A.exports.Options=d},function(A){function D(u,d){this.raw_options=g(u,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(u,d){var s=this.raw_options[u],l=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},D.prototype._get_boolean=function(u,d){var s=this.raw_options[u],l=s===void 0?!!d:!!s;return l},D.prototype._get_characters=function(u,d){var s=this.raw_options[u],l=d||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},D.prototype._get_number=function(u,d){var s=this.raw_options[u];d=parseInt(d,10),isNaN(d)&&(d=0);var l=parseInt(s,10);return isNaN(l)&&(l=d),l},D.prototype._get_selection=function(u,d,s){var l=this._get_selection_list(u,d,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[u]+"'");return l[0]},D.prototype._get_selection_list=function(u,d,s){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[d[0]],!this._is_valid_selection(s,d))throw new Error("Invalid Default Value!");var l=this._get_array(u,s);if(!this._is_valid_selection(l,d))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[u]+"'");return l},D.prototype._is_valid_selection=function(u,d){return u.length&&d.length&&!u.some(function(s){return d.indexOf(s)===-1})};function g(u,d){var s={};u=h(u);var l;for(l in u)l!==d&&(s[l]=u[l]);if(d&&u[d])for(l in u[d])s[l]=u[d][l];return s}function h(u){var d={},s;for(s in u){var l=s.replace(/-/g,"_");d[l]=u[s]}return d}A.exports.Options=D,A.exports.normalizeOpts=h,A.exports.mergeOpts=g},function(A,D,g){var h=g(8).InputScanner,u=g(9).Tokenizer,d=g(9).TOKEN,s=g(13).Directives,l=g(4),i=g(12).Pattern,o=g(14).TemplatablePattern;function n(P,B){return B.indexOf(P)!==-1}var f={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:d.START,RAW:d.RAW,EOF:d.EOF},O=new s(/\/\*/,/\*\//),S=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,w=/[^\d\.]/,T=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var v=new RegExp(y),p="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=p.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+c.join("|")+")$"),_,b=function(P,B){u.call(this,P,B),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var z=new i(this._input),U=new o(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(l.identifier).matching(l.identifierMatch),number:z.matching(S),punct:z.matching(v),comment:z.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:z.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:z.matching(/<!--/),html_comment_end:z.matching(/-->/),include:z.starting_with(/#include/).until_after(l.lineBreak),shebang:z.starting_with(/#!/).until_after(l.lineBreak),xml:z.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};b.prototype=new u,b.prototype._is_comment=function(P){return P.type===f.COMMENT||P.type===f.BLOCK_COMMENT||P.type===f.UNKNOWN},b.prototype._is_opening=function(P){return P.type===f.START_BLOCK||P.type===f.START_EXPR},b.prototype._is_closing=function(P,B){return(P.type===f.END_BLOCK||P.type===f.END_EXPR)&&B&&(P.text==="]"&&B.text==="["||P.text===")"&&B.text==="("||P.text==="}"&&B.text==="{")},b.prototype._reset=function(){_=!1},b.prototype._get_next_token=function(P,B){var z=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(f.EOF,""):(z=z||this._read_non_javascript(U),z=z||this._read_string(U),z=z||this._read_word(P),z=z||this._read_singles(U),z=z||this._read_comment(U),z=z||this._read_regexp(U,P),z=z||this._read_xml(U,P),z=z||this._read_punctuation(),z=z||this._create_token(f.UNKNOWN,this._input.next()),z)},b.prototype._read_word=function(P){var B;if(B=this.__patterns.identifier.read(),B!=="")return B=B.replace(l.allLineBreaks,`
`),!(P.type===f.DOT||P.type===f.RESERVED&&(P.text==="set"||P.text==="get"))&&E.test(B)?(B==="in"||B==="of")&&(P.type===f.WORD||P.type===f.STRING)?this._create_token(f.OPERATOR,B):this._create_token(f.RESERVED,B):this._create_token(f.WORD,B);if(B=this.__patterns.number.read(),B!=="")return this._create_token(f.WORD,B)},b.prototype._read_singles=function(P){var B=null;return P==="("||P==="["?B=this._create_token(f.START_EXPR,P):P===")"||P==="]"?B=this._create_token(f.END_EXPR,P):P==="{"?B=this._create_token(f.START_BLOCK,P):P==="}"?B=this._create_token(f.END_BLOCK,P):P===";"?B=this._create_token(f.SEMICOLON,P):P==="."&&w.test(this._input.peek(1))?B=this._create_token(f.DOT,P):P===","&&(B=this._create_token(f.COMMA,P)),B&&this._input.next(),B},b.prototype._read_punctuation=function(){var P=this.__patterns.punct.read();if(P!=="")return P==="="?this._create_token(f.EQUALS,P):P==="?."?this._create_token(f.DOT,P):this._create_token(f.OPERATOR,P)},b.prototype._read_non_javascript=function(P){var B="";if(P==="#"){if(this._is_first_token()&&(B=this.__patterns.shebang.read(),B))return this._create_token(f.UNKNOWN,B.trim()+`
`);if(B=this.__patterns.include.read(),B)return this._create_token(f.UNKNOWN,B.trim()+`
`);P=this._input.next();var z="#";if(this._input.hasNext()&&this._input.testChar(x)){do P=this._input.next(),z+=P;while(this._input.hasNext()&&P!=="#"&&P!=="=");return P==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(z+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(z+="{}",this._input.next(),this._input.next())),this._create_token(f.WORD,z)}this._input.back()}else if(P==="<"&&this._is_first_token()){if(B=this.__patterns.html_comment_start.read(),B){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)B+=this._input.next();return _=!0,this._create_token(f.COMMENT,B)}}else if(_&&P==="-"&&(B=this.__patterns.html_comment_end.read(),B))return _=!1,this._create_token(f.COMMENT,B);return null},b.prototype._read_comment=function(P){var B=null;if(P==="/"){var z="";if(this._input.peek(1)==="*"){z=this.__patterns.block_comment.read();var U=O.get_directives(z);U&&U.ignore==="start"&&(z+=O.readIgnored(this._input)),z=z.replace(l.allLineBreaks,`
`),B=this._create_token(f.BLOCK_COMMENT,z),B.directives=U}else this._input.peek(1)==="/"&&(z=this.__patterns.comment.read(),B=this._create_token(f.COMMENT,z))}return B},b.prototype._read_string=function(P){if(P==="`"||P==="'"||P==='"'){var B=this._input.next();return this.has_char_escapes=!1,P==="`"?B+=this._read_string_recursive("`",!0,"${"):B+=this._read_string_recursive(P),this.has_char_escapes&&this._options.unescape_strings&&(B=I(B)),this._input.peek()===P&&(B+=this._input.next()),B=B.replace(l.allLineBreaks,`
`),this._create_token(f.STRING,B)}return null},b.prototype._allow_regexp_or_xml=function(P){return P.type===f.RESERVED&&n(P.text,["return","case","throw","else","do","typeof","yield"])||P.type===f.END_EXPR&&P.text===")"&&P.opened.previous.type===f.RESERVED&&n(P.opened.previous.text,["if","while","for"])||n(P.type,[f.COMMENT,f.START_EXPR,f.START_BLOCK,f.START,f.END_BLOCK,f.OPERATOR,f.EQUALS,f.EOF,f.SEMICOLON,f.COMMA])},b.prototype._read_regexp=function(P,B){if(P==="/"&&this._allow_regexp_or_xml(B)){for(var z=this._input.next(),U=!1,C=!1;this._input.hasNext()&&(U||C||this._input.peek()!==P)&&!this._input.testChar(l.newline);)z+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?C=!0:this._input.peek()==="]"&&(C=!1)),this._input.next();return this._input.peek()===P&&(z+=this._input.next(),z+=this._input.read(l.identifier)),this._create_token(f.STRING,z)}return null},b.prototype._read_xml=function(P,B){if(this._options.e4x&&P==="<"&&this._allow_regexp_or_xml(B)){var z="",U=this.__patterns.xml.read_match();if(U){for(var C=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=C.indexOf("{")===0,V=0;U;){var J=!!U[1],ne=U[2],fe=!!U[U.length-1]||ne.slice(0,8)==="![CDATA[";if(!fe&&(ne===C||W&&ne.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(J?--V:++V),z+=U[0],V<=0)break;U=this.__patterns.xml.read_match()}return U||(z+=this._input.match(/[\s\S]*/g)[0]),z=z.replace(l.allLineBreaks,`
`),this._create_token(f.STRING,z)}}return null};function I(P){for(var B="",z=0,U=new h(P),C=null;U.hasNext();)if(C=U.match(/([\s]|[^\\]|\\\\)+/g),C&&(B+=C[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")C=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")C=U.match(/u([0-9A-Fa-f]{4})/g);else{B+="\\",U.hasNext()&&(B+=U.next());continue}if(!C)return P;if(z=parseInt(C[1],16),z>126&&z<=255&&C[0].indexOf("x")===0)return P;if(z>=0&&z<32){B+="\\"+C[0];continue}else z===34||z===39||z===92?B+="\\"+String.fromCharCode(z):B+=String.fromCharCode(z)}return B}b.prototype._read_string_recursive=function(P,B,z){var U,C;P==="'"?C=this.__patterns.single_quote:P==='"'?C=this.__patterns.double_quote:P==="`"?C=this.__patterns.template_text:P==="}"&&(C=this.__patterns.template_expression);for(var W=C.read(),V="";this._input.hasNext();){if(V=this._input.next(),V===P||!B&&l.newline.test(V)){this._input.back();break}else V==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),V+=this._input.next()):z&&(z==="${"&&V==="$"&&this._input.peek()==="{"&&(V+=this._input.next()),z===V&&(P==="`"?V+=this._read_string_recursive("}",B,"`"):V+=this._read_string_recursive("`",B,"${"),this._input.hasNext()&&(V+=this._input.next())));V+=C.read(),W+=V}return W},A.exports.Tokenizer=b,A.exports.TOKEN=f,A.exports.positionable_operators=T.slice(),A.exports.line_starters=p.slice()},function(A){var D=RegExp.prototype.hasOwnProperty("sticky");function g(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},g.prototype.peek=function(h){var u=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(u=this.__input.charAt(h)),u},g.prototype.__match=function(h,u){h.lastIndex=u;var d=h.exec(this.__input);return d&&!(D&&h.sticky)&&(d.index!==u&&(d=null)),d},g.prototype.test=function(h,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(h,u):!1},g.prototype.testChar=function(h,u){var d=this.peek(u);return h.lastIndex=0,d!==null&&h.test(d)},g.prototype.match=function(h){var u=this.__match(h,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(h,u,d){var s="",l;return h&&(l=this.match(h),l&&(s+=l[0])),u&&(l||!h)&&(s+=this.readUntil(u,d)),s},g.prototype.readUntil=function(h,u){var d="",s=this.__position;h.lastIndex=this.__position;var l=h.exec(this.__input);return l?(s=l.index,u&&(s+=l[0].length)):s=this.__input_length,d=this.__input.substring(this.__position,s),this.__position=s,d},g.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},g.prototype.get_regexp=function(h,u){var d=null,s="g";return u&&D&&(s="y"),typeof h=="string"&&h!==""?d=new RegExp(h,s):h&&(d=new RegExp(h.source,s)),d},g.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(h){var u=this.__position,d=this.readUntilAfter(h);return this.__position=u,d},g.prototype.lookBack=function(h){var u=this.__position-1;return u>=h.length&&this.__input.substring(u-h.length,u).toLowerCase()===h},A.exports.InputScanner=g},function(A,D,g){var h=g(8).InputScanner,u=g(3).Token,d=g(10).TokenStream,s=g(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(o,n){this._input=new h(o),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var o,n=new u(l.START,""),f=null,O=[],S=new d;n.type!==l.EOF;){for(o=this._get_next_token(n,f);this._is_comment(o);)S.add(o),o=this._get_next_token(n,f);S.isEmpty()||(o.comments_before=S,S=new d),o.parent=f,this._is_opening(o)?(O.push(f),f=o):f&&this._is_closing(o,f)&&(o.opened=f,f.closed=o,f=O.pop(),o.parent=f),o.previous=n,n.next=o,this.__tokens.add(o),n=o}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(o,n){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(l.RAW,f):this._create_token(l.EOF,"")},i.prototype._is_comment=function(o){return!1},i.prototype._is_opening=function(o){return!1},i.prototype._is_closing=function(o,n){return!1},i.prototype._create_token=function(o,n){var f=new u(o,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},A.exports.Tokenizer=i,A.exports.TOKEN=l},function(A){function D(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},D.prototype.peek=function(g){var h=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(h=this.__tokens[g]),h},D.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},A.exports.TokenStream=D},function(A,D,g){var h=g(12).Pattern;function u(d,s){h.call(this,d,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new h,u.prototype.__set_whitespace_patterns=function(d,s){d+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var s=this.__split(this._newline_regexp,d);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return d},u.prototype.matching=function(d,s){var l=this._create();return l.__set_whitespace_patterns(d,s),l._update(),l},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(d,s){d.lastIndex=0;for(var l=0,i=[],o=d.exec(s);o;)i.push(s.substring(l,o.index)),l=o.index+o[0].length,o=d.exec(s);return l<s.length?i.push(s.substring(l,s.length)):i.push(""),i},A.exports.WhitespacePattern=u},function(A){function D(g,h){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}D.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(g){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(g),h._update(),h},D.prototype.until=function(g){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(g),h._update(),h},D.prototype.starting_with=function(g){var h=this._create();return h._starting_pattern=this._input.get_regexp(g,!0),h._update(),h},D.prototype.matching=function(g){var h=this._create();return h._match_pattern=this._input.get_regexp(g,!0),h._update(),h},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},A.exports.Pattern=D},function(A){function D(g,h){g=typeof g=="string"?g:g.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+h,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)h[u[1]]=u[2],u=this.__directive_pattern.exec(g);return h},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},A.exports.Directives=D},function(A,D,g){var h=g(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(s,l){h.call(this,s,l),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var i=new h(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new h,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(s){var l=this._create();return l._disabled[s]=!0,l._update(),l},d.prototype.read_options=function(s){var l=this._create();for(var i in u)l._disabled[i]=s.templating.indexOf(i)===-1;return l._update(),l},d.prototype.exclude=function(s){var l=this._create();return l._excluded[s]=!0,l._update(),l},d.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),s+=l,l=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},d.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},d.prototype._read_template=function(){var s="",l=this._input.peek();if(l==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},A.exports.TemplatablePattern=d}],R={};function j(A){var D=R[A];if(D!==void 0)return D.exports;var g=R[A]={exports:{}};return N[A](g,g.exports,j),g.exports}var k=j(0);L=k})();var H=L;!(Y=[],K=function(){return{js_beautify:H}}.apply(ye,Y),K!==void 0&&(Le.exports=K))})()},"6eGT":function(Le,ye,F){"use strict";function Y(K){return null}ye.a=Y},"7Cbv":function(Le,ye,F){"use strict";var Y=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),K=new Uint8Array(16);function L(){if(!Y)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Y(K)}var H=/^(?:[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 N(u){return typeof u=="string"&&H.test(u)}for(var R=N,j=[],k=0;k<256;++k)j.push((k+256).toString(16).substr(1));function A(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(j[u[d+0]]+j[u[d+1]]+j[u[d+2]]+j[u[d+3]]+"-"+j[u[d+4]]+j[u[d+5]]+"-"+j[u[d+6]]+j[u[d+7]]+"-"+j[u[d+8]]+j[u[d+9]]+"-"+j[u[d+10]]+j[u[d+11]]+j[u[d+12]]+j[u[d+13]]+j[u[d+14]]+j[u[d+15]]).toLowerCase();if(!R(s))throw TypeError("Stringified UUID is invalid");return s}var D=A;function g(u,d,s){u=u||{};var l=u.random||(u.rng||L)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,d){s=s||0;for(var i=0;i<16;++i)d[s+i]=l[i];return d}return D(l)}var h=ye.a=g},"7ahc":function(Le,ye,F){"use strict";F.d(ye,"a",function(){return O});var Y=F("k1fw"),K=F("0Owb"),L=F("+L6B"),H=F("2/Rp"),N=F("y8nQ"),R=F("Vl3Y"),j=F("tJVT"),k=F("OaEy"),A=F("2fM7"),D=F("cDcd"),g=F.n(D),h=F("VrN/"),u=F.n(h),d=F("p77/"),s=F.n(d),l=F("c5Ni"),i=F.n(l),o=A.a.Option,n={labelCol:{span:4},wrapperCol:{span:20}},f={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"]};ye.b=function(S){var x=S.callback,w=S.onCancel,T=Object(D.useState)("python"),y=Object(j.a)(T,2),v=y[0],p=y[1];function c(_){p(f[_][1])}function E(_){x(_)}return g.a.createElement(R.a,Object(K.a)({},n,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),g.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(A.a,{onChange:c},Object.keys(f).map(function(_){return g.a.createElement(o,{key:_,value:_},f[_][0])}))),g.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(O,{mode:v})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(H.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function O(S){var x=S.value,w=S.onChange,T=S.mode,y=S.options,v=y===void 0?{}:y,p=Object(D.useRef)(),c=Object(D.useState)(),E=Object(j.a)(c,2),_=E[0],b=E[1];return Object(D.useEffect)(function(){if(_){function I(P){var B=P.getValue();w&&w(B)}return _.on("change",I),function(){_.off("change",I)}}},[_,w]),Object(D.useEffect)(function(){_&&_.setOption("mode",T)},[_,T]),Object(D.useEffect)(function(){_&&((x!==_.getValue()||x==="")&&setTimeout(function(){_.setValue(x||" ")},300))},[_,x]),Object(D.useEffect)(function(){if(p.current&&!_){var I=u.a.fromTextArea(p.current,Object(Y.a)({mode:T,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));b(I)}},[p.current,_]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:p}))}},"7ixt":function(Le,ye,F){"use strict";F.d(ye,"a",function(){return L});var Y={adjustX:1,adjustY:1},K=[0,0],L={left:{points:["cr","cl"],overflow:Y,offset:[-4,0],targetOffset:K},right:{points:["cl","cr"],overflow:Y,offset:[4,0],targetOffset:K},top:{points:["bc","tc"],overflow:Y,offset:[0,-4],targetOffset:K},bottom:{points:["tc","bc"],overflow:Y,offset:[0,4],targetOffset:K},topLeft:{points:["bl","tl"],overflow:Y,offset:[0,-4],targetOffset:K},leftTop:{points:["tr","tl"],overflow:Y,offset:[-4,0],targetOffset:K},topRight:{points:["br","tr"],overflow:Y,offset:[0,-4],targetOffset:K},rightTop:{points:["tl","tr"],overflow:Y,offset:[4,0],targetOffset:K},bottomRight:{points:["tr","br"],overflow:Y,offset:[0,4],targetOffset:K},rightBottom:{points:["bl","br"],overflow:Y,offset:[4,0],targetOffset:K},bottomLeft:{points:["tl","bl"],overflow:Y,offset:[0,4],targetOffset:K},leftBottom:{points:["br","bl"],overflow:Y,offset:[-4,0],targetOffset:K}},H=L},"815F":function(Le,ye,F){"use strict";F.d(ye,"e",function(){return j}),F.d(ye,"c",function(){return A}),F.d(ye,"d",function(){return D}),F.d(ye,"a",function(){return h}),F.d(ye,"f",function(){return u}),F.d(ye,"b",function(){return d});var Y=F("KQm4"),K=F("VTBJ"),L=F("Ff2n"),H=F("Zm9Q"),N=F("Kwbf"),R=F("OZM5");function j(s,l){return s!=null?s:l}function k(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function i(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(o||[]).forEach(function(f){var O=f.key,S=f.children;Object(N.a)(O!=null,"Tree node must have a certain key: [".concat(n).concat(O,"]"));var x=String(O);Object(N.a)(!l.has(x)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(x)),l.set(x,!0),i(S,"".concat(n).concat(x," > "))})}i(s)}function A(s){function l(i){var o=Object(H.a)(i);return o.map(function(n){if(!Object(R.i)(n))return Object(N.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var f=n.key,O=n.props,S=O.children,x=Object(L.a)(O,["children"]),w=Object(K.a)({key:f},x),T=l(S);return T.length&&(w.children=T),w}).filter(function(n){return n})}return l(s)}function D(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(l===!0?[]:l),o=[];function n(f){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.map(function(S,x){var w=Object(R.h)(O?O.pos:"0",x),T=j(S.key,w),y=Object(K.a)(Object(K.a)({},S),{},{parent:O,pos:w,children:null,data:S,isStart:[].concat(Object(Y.a)(O?O.isStart:[]),[x===0]),isEnd:[].concat(Object(Y.a)(O?O.isEnd:[]),[x===f.length-1])});return o.push(y),l===!0||i.has(T)?y.children=n(S.children||[],y):y.children=[],y})}return n(s),o}function g(s,l,i){var o;i?typeof i=="string"?o=function(O){return O[i]}:typeof i=="function"&&(o=function(O){return i(O)}):o=function(O,S){return j(O.key,S)};function n(f,O,S){var x=f?f.children:s,w=f?Object(R.h)(S.pos,O):"0";if(f){var T=o(f,w),y={node:f,index:O,pos:w,key:T,parentPos:S.node?S.pos:null,level:S.level+1};l(y)}x&&x.forEach(function(v,p){n(v,p,{node:f,pos:w,level:S?S.level+1:-1})})}n(null)}function h(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=l.initWrapper,o=l.processEntity,n=l.onProcessFinished,f=arguments.length>2?arguments[2]:void 0,O={},S={},x={posEntities:O,keyEntities:S};return i&&(x=i(x)||x),g(s,function(w){var T=w.node,y=w.index,v=w.pos,p=w.key,c=w.parentPos,E=w.level,_={node:T,index:y,key:p,pos:v,level:E},b=j(p,v);O[v]=_,S[b]=_,_.parent=O[c],_.parent&&(_.parent.children=_.parent.children||[],_.parent.children.push(_)),o&&o(_,x)},f),n&&n(x),x}function u(s,l){var i=l.expandedKeys,o=l.selectedKeys,n=l.loadedKeys,f=l.loadingKeys,O=l.checkedKeys,S=l.halfCheckedKeys,x=l.dragOverNodeKey,w=l.dropPosition,T=l.keyEntities,y=T[s],v={eventKey:s,expanded:i.indexOf(s)!==-1,selected:o.indexOf(s)!==-1,loaded:n.indexOf(s)!==-1,loading:f.indexOf(s)!==-1,checked:O.indexOf(s)!==-1,halfChecked:S.indexOf(s)!==-1,pos:String(y?y.pos:""),dragOver:x===s&&w===0,dragOverGapTop:x===s&&w===-1,dragOverGapBottom:x===s&&w===1};return v}function d(s){var l=s.data,i=s.expanded,o=s.selected,n=s.checked,f=s.loaded,O=s.loading,S=s.halfChecked,x=s.dragOver,w=s.dragOverGapTop,T=s.dragOverGapBottom,y=s.pos,v=s.active,p=Object(K.a)(Object(K.a)({},l),{},{expanded:i,selected:o,checked:n,loaded:f,loading:O,halfChecked:S,dragOver:x,dragOverGapTop:w,dragOverGapBottom:T,pos:y,active:v});return"props"in p||Object.defineProperty(p,"props",{get:function(){return Object(N.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),p}},"8EBN":function(Le,ye,F){(function(Y){Y(F("VrN/"))})(function(Y){"use strict";Y.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 K=0;K<Y.modeInfo.length;K++){var L=Y.modeInfo[K];L.mimes&&(L.mime=L.mimes[0])}Y.findModeByMIME=function(H){H=H.toLowerCase();for(var N=0;N<Y.modeInfo.length;N++){var R=Y.modeInfo[N];if(R.mime==H)return R;if(R.mimes){for(var j=0;j<R.mimes.length;j++)if(R.mimes[j]==H)return R}}if(/\+xml$/.test(H))return Y.findModeByMIME("application/xml");if(/\+json$/.test(H))return Y.findModeByMIME("application/json")},Y.findModeByExtension=function(H){H=H.toLowerCase();for(var N=0;N<Y.modeInfo.length;N++){var R=Y.modeInfo[N];if(R.ext){for(var j=0;j<R.ext.length;j++)if(R.ext[j]==H)return R}}},Y.findModeByFileName=function(H){for(var N=0;N<Y.modeInfo.length;N++){var R=Y.modeInfo[N];if(R.file&&R.file.test(H))return R}var j=H.lastIndexOf("."),k=j>-1&&H.substring(j+1,H.length);if(k)return Y.findModeByExtension(k)},Y.findModeByName=function(H){H=H.toLowerCase();for(var N=0;N<Y.modeInfo.length;N++){var R=Y.modeInfo[N];if(R.name.toLowerCase()==H)return R;if(R.alias){for(var j=0;j<R.alias.length;j++)if(R.alias[j].toLowerCase()==H)return R}}}})},"8hTe":function(Le,ye,F){Le.exports={button:"button___1wy9m"}},"9Bee":function(Le,ye,F){"use strict";var Y=F("DYRE"),K=F("zeV3"),L=F("+L6B"),H=F("2/Rp"),N=F("k1fw"),R=F("tJVT"),j=F("cDcd"),k=F.n(j),A=F("vg9a"),D=F("DlQD"),g=F.n(D),h=F("rUJ1");function u(le,me){var ge=le.match(/^(\s+)(?:```)/);if(ge===null)return me;var re=ge[1];return me.split(`
`).map(function(oe){var xe=oe.match(/^\s+/);if(xe===null)return oe;var Be=Object(R.a)(xe,1),Ve=Be[0];return Ve.length>=re.length?oe.slice(re.length):oe}).join(`
`)}var d=[],s=["<ul>"],l=new g.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function o(){d.length=0,s=["<ul>"]}var n={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(le,me,ge,re){if(me>=le.length||le[me].level<=ge)return me;var oe=le[me];re.push("<li><a href='#"+oe.anchor+"'>"+oe.text+"</a>"),me++;var xe=[];return me=f(le,me,oe.level,xe),xe.length>0&&(re.push("<ul>"),xe.forEach(function(Be){re.push(Be)}),re.push("</ul>")),re.push("</li>"),me=f(le,me,ge,re),me}function O(){return f(d,0,0,s),s.push("</ul>"),s.join("")}var S={heading:function(me){var ge=i.exec(me);if(ge)return{type:"heading",raw:ge[0],depth:ge[1].length,text:ge[2]}},fences:function(me){var ge=this.rules.block.fences.exec(me);if(ge){var re=ge[0],oe=u(re,ge[3]||""),xe=ge[2]?ge[2].trim():ge[2];if(["latex","katex","math"].indexOf(xe)>=0){var Be=T(),Ve=oe;oe=Be,y[Be]={type:"block",expression:Ve}}return{type:"code",raw:re,lang:xe,text:oe}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,T=function(){return"__special_katext_id_".concat(w++,"__")},y={};function v(){return y}function p(){w=0,y={}}function c(le){return le=le.replace(x,function(me,ge){var re=T();return y[re]={type:"inline",expression:ge},re}),le}var E=l.listitem;l.listitem=function(le){return E(c(le))};var _=l.paragraph;l.paragraph=function(le){return _(c(le))};var b=l.tablecell;l.tablecell=function(le,me){return b(c(le),me)},l.code=function(le,me,ge){var re=(me||"").match(/\S*/)[0];return re?["latex","katex","math"].indexOf(re)>=0?"<p class='editormd-tex'>".concat(le,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(me,'">').concat(ge?le:Object(h.escape)(le,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(ge?le:Object(h.escape)(le,!0))+"</code></pre>"},l.heading=function(le,me,ge){var re=this.options.headerPrefix+ge.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:re,level:me,text:le}),"<h"+me+' id="'+re+'">'+le+"</h"+me+">"},g.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),g.a.use({tokenizer:S,renderer:l});var I=g.a,P=F("SJMd"),B=F("ulZh"),z=F.n(B),U=F("m3rI"),C=F("Oy/b"),W=F("p5ED"),V=F("8hTe"),J=F.n(V),ne=/<pre[^>]*>/g;function fe(le){var me=document.createElement("div");return me.innerHTML=le,me.childNodes.length===0?"":me.childNodes[0].nodeValue}var ue=ye.a=function(le){var me=le.value,ge=me===void 0?"":me,re=le.edit,oe=re===void 0?!1:re,xe=le.className,Be=le.showTextOnly,Ve=le.showLines,Ye=le.replaces,$e=le.zoomImg,Ke=le.hasMask,We=le.style,ze=We===void 0?{}:We,at=le.stylesPrev,Je=at===void 0?{}:at,Xe=String(ge),He=Object(j.useRef)(),ot=Object(j.useRef)(),ft=Object(j.useState)(""),dt=Object(R.a)(ft,2),lt=dt[0],_t=dt[1],ht=Object(j.useState)("office"),be=Object(R.a)(ht,2),_e=be[0],Ne=be[1],ke=Object(j.useMemo)(function(){try{var ie=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Q=/\"\/api\/attachments\/|\"\/attachments\/download\//g,q=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Xe=Xe.replace(ie,"("+U.a.API_SERVER+"/api/attachments/").replace(Q,'"'+U.a.API_SERVER+"/api/attachments/").replace(q,'"'+U.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(Se){}var te=I(Xe),se=v();if(Xe.match(/\[TOC\]/)&&(te=te.replace("<p>[TOC]</p>",O()),o()),te=te.replace(/(__special_katext_id_\d+__)/g,function(Se,je){var Ze=se[je],ut=Ze.type,it=Ze.expression;return Object(C.renderToString)(fe(it)||"",{displayMode:ut==="block",throwOnError:!1,output:"html"})}),te=te.replace(/▁/g,"\u2581\u2581\u2581"),p(),Be){var ce=document.createElement("div");return ce.innerHTML=te,ce.innerText}return setTimeout(function(){return pe()},500),te},[Xe]),Ee=Object(j.useRef)();n.WebkitLineClamp=Ve,Ve&&(ze=Object(N.a)(Object(N.a)({},ze),n));function Ie(ie){var Q=ie.target;if(Q.tagName.toUpperCase()==="IMG"){if($e){var q=Q.getAttribute("src");_t(q),Ne("image")}}else if(Q.tagName.toUpperCase()==="A"){var te=Q.getAttribute("href");if(te.indexOf("office")>-1)ie.preventDefault(),_t(te),Ne("office");else if(te.indexOf("application/pdf")>-1)ie.preventDefault(),_t(te),Ne("pdf");else if(te.indexOf("text/html")>-1)ie.preventDefault(),_t(te),Ne("html");else if(te.startsWith("#")){ie.preventDefault();var se=document.getElementById(te.replace("#",""));se&&se.scrollIntoView(!0)}}}var pe=function(){var Q,q=(Q=Ee.current)===null||Q===void 0?void 0:Q.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(z.a.isSupported()){var se=new z.a;se.loadSource(te.src),se.attachMedia(te)}}})};Object(j.useEffect)(function(){if(Ee.current&&ke&&(ke.match(ne)&&window.PR.prettyPrint()),Ee.current)return Ee.current.addEventListener("click",Ie),function(){Ee.current.removeEventListener("click",Ie),p(),o()}},[ke,Ee.current,Ie]);var ae=function(Q){if(!oe)return;Q.target.nodeName==="IMG"?(He.current.style.display="flex",He.current.style.width=Q.target.clientWidth+"px",He.current.style.height=Q.target.clientHeight+"px",He.current.style.top=Q.target.offsetTop+"px",He.current.style.left=Q.target.offsetLeft+"px",ot.current.src=Q.target.getAttribute("src")):He.current.style.display="none"};return k.a.createElement("div",{style:{position:"relative"}},k.a.createElement("div",{ref:Ee,style:Object(N.a)({},ze),className:"".concat(xe||""," markdown-body ").concat(J.a.mdBody),onMouseOver:ae,dangerouslySetInnerHTML:{__html:ke}}),k.a.createElement("div",{ref:He,className:J.a.button},k.a.createElement(K.a,null,k.a.createElement(H.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),k.a.createElement(H.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),k.a.createElement("img",{ref:ot,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),k.a.createElement(W.a,{close:!0,data:lt,type:lt!=null&&lt.length?_e:"",style:Object(N.a)({},Je),onClose:function(){return _t("")}}))}},"9VGf":function(Le,ye,F){"use strict";F.d(ye,"a",function(){return L});var Y=F("cDcd"),K=F.n(Y);function L(H,N){var R=Object(Y.useRef)();Object(Y.useEffect)(function(){R.current=H}),Object(Y.useEffect)(function(){function j(){R.current()}if(N!==null){var k=setInterval(j,N);return function(){return clearInterval(k)}}},[N])}},AMnG:function(Le,ye,F){"use strict";var Y=F("miYZ"),K=F("tsqr"),L=F("tJVT"),H=F("cDcd"),N=F.n(H),R=F("nWbc"),j=F.n(R),k=F("Ot1p");ye.a=function(A){var D=A.id,g=A.activeDiscussIndex,h=A.onReplyDiscuss,u=Object(H.useState)(""),d=Object(L.a)(u,2),s=d[0],l=d[1];function i(n){l(n)}function o(){if(!s){K.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}h(D,s),l("")}return N.a.createElement("div",{key:D,className:"discuss-item-editor",style:{display:g===D?"block":"none",width:"100%"}},N.a.createElement(k.a,{miniToolbar:!0,startInit:g===D,defaultValue:s,id:D,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),N.a.createElement("a",{onClick:o,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return R});var Y=F("MNnm"),K="rc-util-key";function L(j){if(j.attachTo)return j.attachTo;var k=document.querySelector("head");return k||document.body}function H(j){var k,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Y.a)())return null;var D=document.createElement("style");if((k=A.csp)===null||k===void 0?void 0:k.nonce){var g;D.nonce=(g=A.csp)===null||g===void 0?void 0:g.nonce}D.innerHTML=j;var h=L(A),u=h.firstChild;return A.prepend&&h.prepend?h.prepend(D):A.prepend&&u?h.insertBefore(D,u):h.appendChild(D),D}var N=new Map;function R(j,k){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=L(A);if(!N.has(D)){var g=H("",A),h=g.parentNode;N.set(D,h),h.removeChild(g)}var u=Array.from(N.get(D).children).find(function(o){return o.tagName==="STYLE"&&o[K]===k});if(u){var d,s;if(((d=A.csp)===null||d===void 0?void 0:d.nonce)&&u.nonce!==((s=A.csp)===null||s===void 0?void 0:s.nonce)){var l;u.nonce=(l=A.csp)===null||l===void 0?void 0:l.nonce}return u.innerHTML!==j&&(u.innerHTML=j),u}var i=H(j,A);return i[K]=k,i}},Bd2K:function(Le,ye,F){(function(Y){Y(F("VrN/"),F("osHv"))})(function(Y){Y.defineOption("autoCloseTags",!1,function(A,D,g){if(g!=Y.Init&&g&&A.removeKeyMap("autoCloseTags"),!D)return;var h={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(h["'/'"]=function(u){return R(u)}),(typeof D!="object"||D.whenOpening!==!1)&&(h["'>'"]=function(u){return H(u)}),A.addKeyMap(h)});var K=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],L=["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 H(A){if(A.getOption("disableInput"))return Y.Pass;for(var D=A.listSelections(),g=[],h=A.getOption("autoCloseTags"),u=0;u<D.length;u++){if(!D[u].empty())return Y.Pass;var d=D[u].head,s=A.getTokenAt(d),l=Y.innerMode(A.getMode(),s.state),i=l.state,o=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(i),n=o&&o.name;if(!n)return Y.Pass;var f=l.mode.configuration=="html",O=typeof h=="object"&&h.dontCloseTags||f&&K,S=typeof h=="object"&&h.indentTags||f&&L;s.end>d.ch&&(n=n.slice(0,n.length-s.end+d.ch));var x=n.toLowerCase();if(!n||s.type=="string"&&(s.end!=d.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&o.close||s.string.indexOf("/")==d.ch-s.start-1||O&&j(O,x)>-1||k(A,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(i)||[],n,d,!0))return Y.Pass;var w=typeof h=="object"&&h.emptyTags;if(w&&j(w,n)>-1){g[u]={text:"/>",newPos:Y.Pos(d.line,d.ch+2)};continue}var T=S&&j(S,x)>-1;g[u]={indent:T,text:">"+(T?`
`:"")+"</"+n+">",newPos:T?Y.Pos(d.line+1,0):Y.Pos(d.line,d.ch+1)}}for(var y=typeof h=="object"&&h.dontIndentOnAutoClose,u=D.length-1;u>=0;u--){var v=g[u];A.replaceRange(v.text,D[u].head,D[u].anchor,"+insert");var p=A.listSelections().slice(0);p[u]={head:v.newPos,anchor:v.newPos},A.setSelections(p),!y&&v.indent&&(A.indentLine(v.newPos.line,null,!0),A.indentLine(v.newPos.line+1,null,!0))}}function N(A,D){for(var g=A.listSelections(),h=[],u=D?"/":"</",d=A.getOption("autoCloseTags"),s=typeof d=="object"&&d.dontIndentOnSlash,l=0;l<g.length;l++){if(!g[l].empty())return Y.Pass;var i=g[l].head,o=A.getTokenAt(i),n=Y.innerMode(A.getMode(),o.state),f=n.state;if(D&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=i.ch-1))return Y.Pass;var O,S=n.mode.name!="xml"&&A.getMode().name=="htmlmixed";if(S&&n.mode.name=="javascript")O=u+"script";else if(S&&n.mode.name=="css")O=u+"style";else{var x=n.mode.xmlCurrentContext&&n.mode.xmlCurrentContext(f);if(!x||x.length&&k(A,x,x[x.length-1],i))return Y.Pass;O=u+x[x.length-1]}A.getLine(i.line).charAt(o.end)!=">"&&(O+=">"),h[l]=O}if(A.replaceSelections(h),g=A.listSelections(),!s)for(var l=0;l<g.length;l++)(l==g.length-1||g[l].head.line<g[l+1].head.line)&&A.indentLine(g[l].head.line)}function R(A){return A.getOption("disableInput")?Y.Pass:N(A,!0)}Y.commands.closeTag=function(A){return N(A)};function j(A,D){if(A.indexOf)return A.indexOf(D);for(var g=0,h=A.length;g<h;++g)if(A[g]==D)return g;return-1}function k(A,D,g,h,u){if(!Y.scanForClosingTag)return!1;var d=Math.min(A.lastLine()+1,h.line+500),s=Y.scanForClosingTag(A,h,null,d);if(!s||s.tag!=g)return!1;for(var l=u?1:0,i=D.length-1;i>=0&&D[i]==g;i--)++l;h=s.to;for(var i=1;i<l;i++){var o=Y.scanForClosingTag(A,h,null,d);if(!o||o.tag!=g)return!1;h=o.to}return!0}})},BdwD:function(Le,ye,F){"use strict";var Y=F("+L6B"),K=F("2/Rp"),L=F("0Owb"),H=F("k1fw"),N=F("cDcd"),R=F.n(N),j=F("FOrL"),k=F.n(j),A=function(g){var h=g.buttonProps,u=h===void 0?{}:h,d=g.styles,s=d===void 0?{}:d,l=g.customText,i=g.ButtonText,o=g.ButtonClick,n=g.Buttonclass,f=g.ButtonTwo;return R.a.createElement("section",{className:"tc animated fadeIn",style:Object(H.a)(Object(H.a)({},{color:"#999",margin:"200px auto"}),s)},R.a.createElement("img",{src:k.a}),R.a.createElement("p",{className:"mt20 font14"},l||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&R.a.createElement(K.a,Object(L.a)({className:n,onClick:o},u),i),f&&f)};ye.a=A},BjJ7:function(Le,ye,F){"use strict";F.d(ye,"d",function(){return K}),F.d(ye,"c",function(){return L}),F.d(ye,"e",function(){return H}),F.d(ye,"b",function(){return N}),F.d(ye,"a",function(){return j});var Y=F("m3rI");function K(k){var A=!0;if(k.length>0){for(var D=0;D<k.length;D++)if(k[D].compile_success==0||!k[D].compile_success){A=!1;break}}else A=!1;return A}function L(k){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;g<k.length;g++){var h=k[g],u=A?"".concat(A,"/").concat(h.name):"".concat(h.name);D.push({title:h.name,isLeaf:!(h.type==="tree"),key:u})}return D}function H(k,A,D){for(var g=0;g<k.length;g++){var h=k[g];if(h.key===A){h.children=D;break}h.children&&H(h.children,A,D)}return k}function N(k,A,D){var g;return function(){var h=this,u=arguments,d=function(){g=null,D||k.apply(h,u)},s=D&&!g;clearTimeout(g),g=setTimeout(d,A),s&&k.apply(h,u)}}var R=!0,j=Y.a.API_SERVER},"C+DQ":function(Le,ye,F){},CrYA:function(Le,ye,F){var Y=F("MFOe"),K=Y.Global;Le.exports={name:"sessionStorage",read:H,write:N,each:R,remove:j,clearAll:k};function L(){return K.sessionStorage}function H(A){return L().getItem(A)}function N(A,D){return L().setItem(A,D)}function R(A){for(var D=L().length-1;D>=0;D--){var g=L().key(D);A(H(g),g)}}function j(A){return L().removeItem(A)}function k(){return L().clear()}},DlQD:function(Le,ye,F){(function(Y,K){Le.exports=K()})(this,function(){"use strict";function Y(pe,ae){for(var ie=0;ie<ae.length;ie++){var Q=ae[ie];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(pe,Q.key,Q)}}function K(pe,ae,ie){return ae&&Y(pe.prototype,ae),ie&&Y(pe,ie),pe}function L(pe,ae){if(!pe)return;if(typeof pe=="string")return H(pe,ae);var ie=Object.prototype.toString.call(pe).slice(8,-1);if(ie==="Object"&&pe.constructor&&(ie=pe.constructor.name),ie==="Map"||ie==="Set")return Array.from(pe);if(ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ie))return H(pe,ae)}function H(pe,ae){(ae==null||ae>pe.length)&&(ae=pe.length);for(var ie=0,Q=new Array(ae);ie<ae;ie++)Q[ie]=pe[ie];return Q}function N(pe,ae){var ie;if(typeof Symbol=="undefined"||pe[Symbol.iterator]==null){if(Array.isArray(pe)||(ie=L(pe))||ae&&pe&&typeof pe.length=="number"){ie&&(pe=ie);var Q=0;return function(){return Q>=pe.length?{done:!0}:{done:!1,value:pe[Q++]}}}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 ie=pe[Symbol.iterator](),ie.next.bind(ie)}function R(pe,ae){return ae={exports:{}},pe(ae,ae.exports),ae.exports}var j=R(function(pe){function ae(){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 ie(Q){pe.exports.defaults=Q}pe.exports={defaults:ae(),getDefaults:ae,changeDefaults:ie}}),k=j.defaults,A=j.getDefaults,D=j.changeDefaults,g=/[&<>"']/,h=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=function(ae){return s[ae]};function i(pe,ae){if(ae){if(g.test(pe))return pe.replace(h,l)}else if(u.test(pe))return pe.replace(d,l);return pe}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(pe){return pe.replace(o,function(ae,ie){return ie=ie.toLowerCase(),ie==="colon"?":":ie.charAt(0)==="#"?ie.charAt(1)==="x"?String.fromCharCode(parseInt(ie.substring(2),16)):String.fromCharCode(+ie.substring(1)):""})}var f=/(^|[^\[])\^/g;function O(pe,ae){pe=pe.source||pe,ae=ae||"";var ie={replace:function(q,te){return te=te.source||te,te=te.replace(f,"$1"),pe=pe.replace(q,te),ie},getRegex:function(){return new RegExp(pe,ae)}};return ie}var S=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(pe,ae,ie){if(pe){var Q;try{Q=decodeURIComponent(n(ie)).replace(S,"").toLowerCase()}catch(q){return null}if(Q.indexOf("javascript:")===0||Q.indexOf("vbscript:")===0||Q.indexOf("data:")===0)return null}ae&&!x.test(ie)&&(ie=c(ae,ie));try{ie=encodeURI(ie).replace(/%25/g,"%")}catch(q){return null}return ie}var T={},y=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,p=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(pe,ae){T[" "+pe]||(y.test(pe)?T[" "+pe]=pe+"/":T[" "+pe]=I(pe,"/",!0)),pe=T[" "+pe];var ie=pe.indexOf(":")===-1;return ae.substring(0,2)==="//"?ie?ae:pe.replace(v,"$1")+ae:ae.charAt(0)==="/"?ie?ae:pe.replace(p,"$1")+ae:pe+ae}var E={exec:function(){}};function _(pe){for(var ae=1,ie,Q;ae<arguments.length;ae++){ie=arguments[ae];for(Q in ie)Object.prototype.hasOwnProperty.call(ie,Q)&&(pe[Q]=ie[Q])}return pe}function b(pe,ae){var ie=pe.replace(/\|/g,function(te,se,ce){for(var Se=!1,je=se;--je>=0&&ce[je]==="\\";)Se=!Se;return Se?"|":" |"}),Q=ie.split(/ \|/),q=0;if(Q.length>ae)Q.splice(ae);else for(;Q.length<ae;)Q.push("");for(;q<Q.length;q++)Q[q]=Q[q].trim().replace(/\\\|/g,"|");return Q}function I(pe,ae,ie){var Q=pe.length;if(Q===0)return"";for(var q=0;q<Q;){var te=pe.charAt(Q-q-1);if(te===ae&&!ie)q++;else if(te!==ae&&ie)q++;else break}return pe.substr(0,Q-q)}function P(pe,ae){if(pe.indexOf(ae[1])===-1)return-1;for(var ie=pe.length,Q=0,q=0;q<ie;q++)if(pe[q]==="\\")q++;else if(pe[q]===ae[0])Q++;else if(pe[q]===ae[1]&&(Q--,Q<0))return q;return-1}function B(pe){pe&&pe.sanitize&&!pe.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 z={escape:i,unescape:n,edit:O,cleanUrl:w,resolveUrl:c,noopTest:E,merge:_,splitCells:b,rtrim:I,findClosingBracket:P,checkSanitizeDeprecation:B},U=j.defaults,C=z.rtrim,W=z.splitCells,V=z.escape,J=z.findClosingBracket;function ne(pe,ae,ie){var Q=ae.href,q=ae.title?V(ae.title):null,te=pe[1].replace(/\\([\[\]])/g,"$1");return pe[0].charAt(0)!=="!"?{type:"link",raw:ie,href:Q,title:q,text:te}:{type:"image",raw:ie,href:Q,title:q,text:V(te)}}function fe(pe,ae){var ie=pe.match(/^(\s+)(?:```)/);if(ie===null)return ae;var Q=ie[1];return ae.split(`
`).map(function(q){var te=q.match(/^\s+/);if(te===null)return q;var se=te[0];return se.length>=Q.length?q.slice(Q.length):q}).join(`
`)}var ue=function(){function pe(ie){this.options=ie||U}var ae=pe.prototype;return ae.space=function(Q){var q=this.rules.block.newline.exec(Q);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
`}},ae.code=function(Q,q){var te=this.rules.block.code.exec(Q);if(te){var se=q[q.length-1];if(se&&se.type==="paragraph")return{raw:te[0],text:te[0].trimRight()};var ce=te[0].replace(/^ {4}/gm,"");return{type:"code",raw:te[0],codeBlockStyle:"indented",text:this.options.pedantic?ce:C(ce,`
`)}}},ae.fences=function(Q){var q=this.rules.block.fences.exec(Q);if(q){var te=q[0],se=fe(te,q[3]||"");return{type:"code",raw:te,lang:q[2]?q[2].trim():q[2],text:se}}},ae.heading=function(Q){var q=this.rules.block.heading.exec(Q);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},ae.nptable=function(Q){var q=this.rules.block.nptable.exec(Q);if(q){var te={type:"table",header:W(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 se=te.align.length,ce;for(ce=0;ce<se;ce++)/^ *-+: *$/.test(te.align[ce])?te.align[ce]="right":/^ *:-+: *$/.test(te.align[ce])?te.align[ce]="center":/^ *:-+ *$/.test(te.align[ce])?te.align[ce]="left":te.align[ce]=null;for(se=te.cells.length,ce=0;ce<se;ce++)te.cells[ce]=W(te.cells[ce],te.header.length);return te}}},ae.hr=function(Q){var q=this.rules.block.hr.exec(Q);if(q)return{type:"hr",raw:q[0]}},ae.blockquote=function(Q){var q=this.rules.block.blockquote.exec(Q);if(q){var te=q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:q[0],text:te}}},ae.list=function(Q){var q=this.rules.block.list.exec(Q);if(q){for(var te=q[0],se=q[2],ce=se.length>1,Se=se[se.length-1]===")",je={type:"list",raw:te,ordered:ce,start:ce?+se.slice(0,-1):"",loose:!1,items:[]},Ze=q[0].match(this.rules.block.item),ut=!1,it,rt,Me,Ue,we,ee,he,Fe=Ze.length,Re=0;Re<Fe;Re++)it=Ze[Re],te=it,rt=it.length,it=it.replace(/^ *([*+-]|\d+[.)]) */,""),~it.indexOf(`
`)&&(rt-=it.length,it=this.options.pedantic?it.replace(/^ {1,4}/gm,""):it.replace(new RegExp("^ {1,"+rt+"}","gm"),"")),Re!==Fe-1&&(Me=this.rules.block.bullet.exec(Ze[Re+1])[0],(ce?Me.length===1||!Se&&Me[Me.length-1]===")":Me.length>1||this.options.smartLists&&Me!==se)&&(Ue=Ze.slice(Re+1).join(`
`),je.raw=je.raw.substring(0,je.raw.length-Ue.length),Re=Fe-1)),we=ut||/\n\n(?!\s*$)/.test(it),Re!==Fe-1&&(ut=it.charAt(it.length-1)===`
`,we||(we=ut)),we&&(je.loose=!0),ee=/^\[[ xX]\] /.test(it),he=void 0,ee&&(he=it[1]!==" ",it=it.replace(/^\[[ xX]\] +/,"")),je.items.push({type:"list_item",raw:te,task:ee,checked:he,loose:we,text:it});return je}},ae.html=function(Q){var q=this.rules.block.html.exec(Q);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]):V(q[0]):q[0]}},ae.def=function(Q){var q=this.rules.block.def.exec(Q);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]}}},ae.table=function(Q){var q=this.rules.block.table.exec(Q);if(q){var te={type:"table",header:W(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 se=te.align.length,ce;for(ce=0;ce<se;ce++)/^ *-+: *$/.test(te.align[ce])?te.align[ce]="right":/^ *:-+: *$/.test(te.align[ce])?te.align[ce]="center":/^ *:-+ *$/.test(te.align[ce])?te.align[ce]="left":te.align[ce]=null;for(se=te.cells.length,ce=0;ce<se;ce++)te.cells[ce]=W(te.cells[ce].replace(/^ *\| *| *\| *$/g,""),te.header.length);return te}}},ae.lheading=function(Q){var q=this.rules.block.lheading.exec(Q);if(q)return{type:"heading",raw:q[0],depth:q[2].charAt(0)==="="?1:2,text:q[1]}},ae.paragraph=function(Q){var q=this.rules.block.paragraph.exec(Q);if(q)return{type:"paragraph",raw:q[0],text:q[1].charAt(q[1].length-1)===`
`?q[1].slice(0,-1):q[1]}},ae.text=function(Q,q){var te=this.rules.block.text.exec(Q);if(te){var se=q[q.length-1];return se&&se.type==="text"?{raw:te[0],text:te[0]}:{type:"text",raw:te[0],text:te[0]}}},ae.escape=function(Q){var q=this.rules.inline.escape.exec(Q);if(q)return{type:"escape",raw:q[0],text:V(q[1])}},ae.tag=function(Q,q,te){var se=this.rules.inline.tag.exec(Q);if(se)return!q&&/^<a /i.test(se[0])?q=!0:q&&/^<\/a>/i.test(se[0])&&(q=!1),!te&&/^<(pre|code|kbd|script)(\s|>)/i.test(se[0])?te=!0:te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(se[0])&&(te=!1),{type:this.options.sanitize?"text":"html",raw:se[0],inLink:q,inRawBlock:te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):V(se[0]):se[0]}},ae.link=function(Q){var q=this.rules.inline.link.exec(Q);if(q){var te=J(q[2],"()");if(te>-1){var se=q[0].indexOf("!")===0?5:4,ce=se+q[1].length+te;q[2]=q[2].substring(0,te),q[0]=q[0].substring(0,ce).trim(),q[3]=""}var Se=q[2],je="";if(this.options.pedantic){var Ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Se);Ze?(Se=Ze[1],je=Ze[3]):je=""}else je=q[3]?q[3].slice(1,-1):"";Se=Se.trim().replace(/^<([\s\S]*)>$/,"$1");var ut=ne(q,{href:Se&&Se.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},q[0]);return ut}},ae.reflink=function(Q,q){var te;if((te=this.rules.inline.reflink.exec(Q))||(te=this.rules.inline.nolink.exec(Q))){var se=(te[2]||te[1]).replace(/\s+/g," ");if(se=q[se.toLowerCase()],!se||!se.href){var ce=te[0].charAt(0);return{type:"text",raw:ce,text:ce}}var Se=ne(te,se,te[0]);return Se}},ae.strong=function(Q,q,te){te===void 0&&(te="");var se=this.rules.inline.strong.start.exec(Q);if(se&&(!se[1]||se[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){q=q.slice(-1*Q.length);var ce=se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ce.lastIndex=0;for(var Se;(se=ce.exec(q))!=null;)if(Se=this.rules.inline.strong.middle.exec(q.slice(0,se.index+3)),Se)return{type:"strong",raw:Q.slice(0,Se[0].length),text:Q.slice(2,Se[0].length-2)}}},ae.em=function(Q,q,te){te===void 0&&(te="");var se=this.rules.inline.em.start.exec(Q);if(se&&(!se[1]||se[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){q=q.slice(-1*Q.length);var ce=se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ce.lastIndex=0;for(var Se;(se=ce.exec(q))!=null;)if(Se=this.rules.inline.em.middle.exec(q.slice(0,se.index+2)),Se)return{type:"em",raw:Q.slice(0,Se[0].length),text:Q.slice(1,Se[0].length-1)}}},ae.codespan=function(Q){var q=this.rules.inline.code.exec(Q);if(q){var te=q[2].replace(/\n/g," "),se=/[^ ]/.test(te),ce=te.startsWith(" ")&&te.endsWith(" ");return se&&ce&&(te=te.substring(1,te.length-1)),te=V(te,!0),{type:"codespan",raw:q[0],text:te}}},ae.br=function(Q){var q=this.rules.inline.br.exec(Q);if(q)return{type:"br",raw:q[0]}},ae.del=function(Q){var q=this.rules.inline.del.exec(Q);if(q)return{type:"del",raw:q[0],text:q[1]}},ae.autolink=function(Q,q){var te=this.rules.inline.autolink.exec(Q);if(te){var se,ce;return te[2]==="@"?(se=V(this.options.mangle?q(te[1]):te[1]),ce="mailto:"+se):(se=V(te[1]),ce=se),{type:"link",raw:te[0],text:se,href:ce,tokens:[{type:"text",raw:se,text:se}]}}},ae.url=function(Q,q){var te;if(te=this.rules.inline.url.exec(Q)){var se,ce;if(te[2]==="@")se=V(this.options.mangle?q(te[0]):te[0]),ce="mailto:"+se;else{var Se;do Se=te[0],te[0]=this.rules.inline._backpedal.exec(te[0])[0];while(Se!==te[0]);se=V(te[0]),te[1]==="www."?ce="http://"+se:ce=se}return{type:"link",raw:te[0],text:se,href:ce,tokens:[{type:"text",raw:se,text:se}]}}},ae.inlineText=function(Q,q,te){var se=this.rules.inline.text.exec(Q);if(se){var ce;return q?ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):V(se[0]):se[0]:ce=V(this.options.smartypants?te(se[0]):se[0]),{type:"text",raw:se[0],text:ce}}},pe}(),le=z.noopTest,me=z.edit,ge=z.merge,re={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:le,table:le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};re._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,re._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,re.def=me(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,re.item=me(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.list=me(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/<!--(?!-?>)[\s\S]*?-->/,re.html=me(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=me(re._paragraph).replace("hr",re.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",re._tag).getRegex(),re.blockquote=me(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=ge({},re),re.gfm=ge({},re.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*|$)"}),re.gfm.nptable=me(re.gfm.nptable).replace("hr",re.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",re._tag).getRegex(),re.gfm.table=me(re.gfm.table).replace("hr",re.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",re._tag).getRegex(),re.pedantic=ge({},re.normal,{html:me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re._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:le,paragraph:me(re.normal._paragraph).replace("hr",re.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:le,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:le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};oe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oe.punctuation=me(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",oe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",oe.em.start=me(oe.em.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.middle=me(oe.em.middle).replace(/punctuation/g,oe._punctuation).replace(/overlapSkip/g,oe._overlapSkip).getRegex(),oe.em.endAst=me(oe.em.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.endUnd=me(oe.em.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.start=me(oe.strong.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.middle=me(oe.strong.middle).replace(/punctuation/g,oe._punctuation).replace(/blockSkip/g,oe._blockSkip).getRegex(),oe.strong.endAst=me(oe.strong.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.endUnd=me(oe.strong.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=me(oe._blockSkip,"g").getRegex(),oe.overlapSkip=me(oe._overlapSkip,"g").getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=me(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=me(oe.tag).replace("comment",re._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=me(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=me(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=me(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=ge({},oe),oe.pedantic=ge({},oe.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:me(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=ge({},oe.normal,{escape:me(oe.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),oe.gfm.url=me(oe.gfm.url,"i").replace("email",oe.gfm._extended_email).getRegex(),oe.breaks=ge({},oe.gfm,{br:me(oe.br).replace("{2,}","*").getRegex(),text:me(oe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var xe={block:re,inline:oe},Be=j.defaults,Ve=xe.block,Ye=xe.inline;function $e(pe){return pe.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 Ke(pe){var ae="",ie,Q,q=pe.length;for(ie=0;ie<q;ie++)Q=pe.charCodeAt(ie),Math.random()>.5&&(Q="x"+Q.toString(16)),ae+="&#"+Q+";";return ae}var We=function(){function pe(ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=ie||Be,this.options.tokenizer=this.options.tokenizer||new ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Q={block:Ve.normal,inline:Ye.normal};this.options.pedantic?(Q.block=Ve.pedantic,Q.inline=Ye.pedantic):this.options.gfm&&(Q.block=Ve.gfm,this.options.breaks?Q.inline=Ye.breaks:Q.inline=Ye.gfm),this.tokenizer.rules=Q}pe.lex=function(Q,q){var te=new pe(q);return te.lex(Q)};var ae=pe.prototype;return ae.lex=function(Q){return Q=Q.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(Q,this.tokens,!0),this.inline(this.tokens),this.tokens},ae.blockTokens=function(Q,q,te){q===void 0&&(q=[]),te===void 0&&(te=!0),Q=Q.replace(/^ +$/gm,"");for(var se,ce,Se,je;Q;){if(se=this.tokenizer.space(Q)){Q=Q.substring(se.raw.length),se.type&&q.push(se);continue}if(se=this.tokenizer.code(Q,q)){Q=Q.substring(se.raw.length),se.type?q.push(se):(je=q[q.length-1],je.raw+=`
`+se.raw,je.text+=`
`+se.text);continue}if(se=this.tokenizer.fences(Q)){Q=Q.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.heading(Q)){Q=Q.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.nptable(Q)){Q=Q.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.hr(Q)){Q=Q.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.blockquote(Q)){Q=Q.substring(se.raw.length),se.tokens=this.blockTokens(se.text,[],te),q.push(se);continue}if(se=this.tokenizer.list(Q)){for(Q=Q.substring(se.raw.length),Se=se.items.length,ce=0;ce<Se;ce++)se.items[ce].tokens=this.blockTokens(se.items[ce].text,[],!1);q.push(se);continue}if(se=this.tokenizer.html(Q)){Q=Q.substring(se.raw.length),q.push(se);continue}if(te&&(se=this.tokenizer.def(Q))){Q=Q.substring(se.raw.length),this.tokens.links[se.tag]||(this.tokens.links[se.tag]={href:se.href,title:se.title});continue}if(se=this.tokenizer.table(Q)){Q=Q.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.lheading(Q)){Q=Q.substring(se.raw.length),q.push(se);continue}if(te&&(se=this.tokenizer.paragraph(Q))){Q=Q.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.text(Q,q)){Q=Q.substring(se.raw.length),se.type?q.push(se):(je=q[q.length-1],je.raw+=`
`+se.raw,je.text+=`
`+se.text);continue}if(Q){var Ze="Infinite loop on byte: "+Q.charCodeAt(0);if(this.options.silent){console.error(Ze);break}else throw new Error(Ze)}}return q},ae.inline=function(Q){var q,te,se,ce,Se,je,Ze=Q.length;for(q=0;q<Ze;q++){je=Q[q];switch(je.type){case"paragraph":case"text":case"heading":{je.tokens=[],this.inlineTokens(je.text,je.tokens);break}case"table":{for(je.tokens={header:[],cells:[]},ce=je.header.length,te=0;te<ce;te++)je.tokens.header[te]=[],this.inlineTokens(je.header[te],je.tokens.header[te]);for(ce=je.cells.length,te=0;te<ce;te++)for(Se=je.cells[te],je.tokens.cells[te]=[],se=0;se<Se.length;se++)je.tokens.cells[te][se]=[],this.inlineTokens(Se[se],je.tokens.cells[te][se]);break}case"blockquote":{this.inline(je.tokens);break}case"list":{for(ce=je.items.length,te=0;te<ce;te++)this.inline(je.items[te].tokens);break}}}return Q},ae.inlineTokens=function(Q,q,te,se,ce){q===void 0&&(q=[]),te===void 0&&(te=!1),se===void 0&&(se=!1),ce===void 0&&(ce="");var Se,je=Q,Ze;if(this.tokens.links){var ut=Object.keys(this.tokens.links);if(ut.length>0)for(;(Ze=this.tokenizer.rules.inline.reflinkSearch.exec(je))!=null;)ut.includes(Ze[0].slice(Ze[0].lastIndexOf("[")+1,-1))&&(je=je.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ze=this.tokenizer.rules.inline.blockSkip.exec(je))!=null;)je=je.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Q;){if(Se=this.tokenizer.escape(Q)){Q=Q.substring(Se.raw.length),q.push(Se);continue}if(Se=this.tokenizer.tag(Q,te,se)){Q=Q.substring(Se.raw.length),te=Se.inLink,se=Se.inRawBlock,q.push(Se);continue}if(Se=this.tokenizer.link(Q)){Q=Q.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,se)),q.push(Se);continue}if(Se=this.tokenizer.reflink(Q,this.tokens.links)){Q=Q.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,se)),q.push(Se);continue}if(Se=this.tokenizer.strong(Q,je,ce)){Q=Q.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],te,se),q.push(Se);continue}if(Se=this.tokenizer.em(Q,je,ce)){Q=Q.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],te,se),q.push(Se);continue}if(Se=this.tokenizer.codespan(Q)){Q=Q.substring(Se.raw.length),q.push(Se);continue}if(Se=this.tokenizer.br(Q)){Q=Q.substring(Se.raw.length),q.push(Se);continue}if(Se=this.tokenizer.del(Q)){Q=Q.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],te,se),q.push(Se);continue}if(Se=this.tokenizer.autolink(Q,Ke)){Q=Q.substring(Se.raw.length),q.push(Se);continue}if(!te&&(Se=this.tokenizer.url(Q,Ke))){Q=Q.substring(Se.raw.length),q.push(Se);continue}if(Se=this.tokenizer.inlineText(Q,se,$e)){Q=Q.substring(Se.raw.length),ce=Se.raw.slice(-1),q.push(Se);continue}if(Q){var it="Infinite loop on byte: "+Q.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return q},K(pe,null,[{key:"rules",get:function(){return{block:Ve,inline:Ye}}}]),pe}(),ze=j.defaults,at=z.cleanUrl,Je=z.escape,Xe=function(){function pe(ie){this.options=ie||ze}var ae=pe.prototype;return ae.code=function(Q,q,te){var se=(q||"").match(/\S*/)[0];if(this.options.highlight){var ce=this.options.highlight(Q,se);ce!=null&&ce!==Q&&(te=!0,Q=ce)}return se?'<pre><code class="'+this.options.langPrefix+Je(se,!0)+'">'+(te?Q:Je(Q,!0))+`</code></pre>
`:"<pre><code>"+(te?Q:Je(Q,!0))+`</code></pre>
`},ae.blockquote=function(Q){return`<blockquote>
`+Q+`</blockquote>
`},ae.html=function(Q){return Q},ae.heading=function(Q,q,te,se){return this.options.headerIds?"<h"+q+' id="'+this.options.headerPrefix+se.slug(te)+'">'+Q+"</h"+q+`>
`:"<h"+q+">"+Q+"</h"+q+`>
`},ae.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ae.list=function(Q,q,te){var se=q?"ol":"ul",ce=q&&te!==1?' start="'+te+'"':"";return"<"+se+ce+`>
`+Q+"</"+se+`>
`},ae.listitem=function(Q){return"<li>"+Q+`</li>
`},ae.checkbox=function(Q){return"<input "+(Q?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ae.paragraph=function(Q){return"<p>"+Q+`</p>
`},ae.table=function(Q,q){return q&&(q="<tbody>"+q+"</tbody>"),`<table>
<thead>
`+Q+`</thead>
`+q+`</table>
`},ae.tablerow=function(Q){return`<tr>
`+Q+`</tr>
`},ae.tablecell=function(Q,q){var te=q.header?"th":"td",se=q.align?"<"+te+' align="'+q.align+'">':"<"+te+">";return se+Q+"</"+te+`>
`},ae.strong=function(Q){return"<strong>"+Q+"</strong>"},ae.em=function(Q){return"<em>"+Q+"</em>"},ae.codespan=function(Q){return"<code>"+Q+"</code>"},ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},ae.del=function(Q){return"<del>"+Q+"</del>"},ae.link=function(Q,q,te){if(Q=at(this.options.sanitize,this.options.baseUrl,Q),Q===null)return te;var se='<a href="'+Je(Q)+'"';return q&&(se+=' title="'+q+'"'),se+=">"+te+"</a>",se},ae.image=function(Q,q,te){if(Q=at(this.options.sanitize,this.options.baseUrl,Q),Q===null)return te;var se='<img src="'+Q+'" alt="'+te+'"';return q&&(se+=' title="'+q+'"'),se+=this.options.xhtml?"/>":">",se},ae.text=function(Q){return Q},pe}(),He=function(){function pe(){}var ae=pe.prototype;return ae.strong=function(Q){return Q},ae.em=function(Q){return Q},ae.codespan=function(Q){return Q},ae.del=function(Q){return Q},ae.html=function(Q){return Q},ae.text=function(Q){return Q},ae.link=function(Q,q,te){return""+te},ae.image=function(Q,q,te){return""+te},ae.br=function(){return""},pe}(),ot=function(){function pe(){this.seen={}}var ae=pe.prototype;return ae.slug=function(Q){var q=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},pe}(),ft=j.defaults,dt=z.unescape,lt=function(){function pe(ie){this.options=ie||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 ot}pe.parse=function(Q,q){var te=new pe(q);return te.parse(Q)};var ae=pe.prototype;return ae.parse=function(Q,q){q===void 0&&(q=!0);var te="",se,ce,Se,je,Ze,ut,it,rt,Me,Ue,we,ee,he,Fe,Re,et,tt,Te,Ae=Q.length;for(se=0;se<Ae;se++){Ue=Q[se];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,dt(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(rt="",it="",je=Ue.header.length,ce=0;ce<je;ce++)it+=this.renderer.tablecell(this.parseInline(Ue.tokens.header[ce]),{header:!0,align:Ue.align[ce]});for(rt+=this.renderer.tablerow(it),Me="",je=Ue.cells.length,ce=0;ce<je;ce++){for(ut=Ue.tokens.cells[ce],it="",Ze=ut.length,Se=0;Se<Ze;Se++)it+=this.renderer.tablecell(this.parseInline(ut[Se]),{header:!1,align:Ue.align[Se]});Me+=this.renderer.tablerow(it)}te+=this.renderer.table(rt,Me);continue}case"blockquote":{Me=this.parse(Ue.tokens),te+=this.renderer.blockquote(Me);continue}case"list":{for(we=Ue.ordered,ee=Ue.start,he=Ue.loose,je=Ue.items.length,Me="",ce=0;ce<je;ce++)Re=Ue.items[ce],et=Re.checked,tt=Re.task,Fe="",Re.task&&(Te=this.renderer.checkbox(et),he?Re.tokens.length>0&&Re.tokens[0].type==="text"?(Re.tokens[0].text=Te+" "+Re.tokens[0].text,Re.tokens[0].tokens&&Re.tokens[0].tokens.length>0&&Re.tokens[0].tokens[0].type==="text"&&(Re.tokens[0].tokens[0].text=Te+" "+Re.tokens[0].tokens[0].text)):Re.tokens.unshift({type:"text",text:Te}):Fe+=Te),Fe+=this.parse(Re.tokens,he),Me+=this.renderer.listitem(Fe,tt,et);te+=this.renderer.list(Me,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(Me=Ue.tokens?this.parseInline(Ue.tokens):Ue.text;se+1<Ae&&Q[se+1].type==="text";)Ue=Q[++se],Me+=`
`+(Ue.tokens?this.parseInline(Ue.tokens):Ue.text);te+=q?this.renderer.paragraph(Me):Me;continue}default:{var Qe='Token with "'+Ue.type+'" type was not found.';if(this.options.silent){console.error(Qe);return}else throw new Error(Qe)}}}return te},ae.parseInline=function(Q,q){q=q||this.renderer;var te="",se,ce,Se=Q.length;for(se=0;se<Se;se++){ce=Q[se];switch(ce.type){case"escape":{te+=q.text(ce.text);break}case"html":{te+=q.html(ce.text);break}case"link":{te+=q.link(ce.href,ce.title,this.parseInline(ce.tokens,q));break}case"image":{te+=q.image(ce.href,ce.title,ce.text);break}case"strong":{te+=q.strong(this.parseInline(ce.tokens,q));break}case"em":{te+=q.em(this.parseInline(ce.tokens,q));break}case"codespan":{te+=q.codespan(ce.text);break}case"br":{te+=q.br();break}case"del":{te+=q.del(this.parseInline(ce.tokens,q));break}case"text":{te+=q.text(ce.text);break}default:{var je='Token with "'+ce.type+'" type was not found.';if(this.options.silent){console.error(je);return}else throw new Error(je)}}}return te},pe}(),_t=z.merge,ht=z.checkSanitizeDeprecation,be=z.escape,_e=j.getDefaults,Ne=j.changeDefaults,ke=j.defaults;function Ee(pe,ae,ie){if(typeof pe=="undefined"||pe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof pe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(pe)+", string expected");if(typeof ae=="function"&&(ie=ae,ae=null),ae=_t({},Ee.defaults,ae||{}),ht(ae),ie){var Q=ae.highlight,q;try{q=We.lex(pe,ae)}catch(Se){return ie(Se)}var te=function(je){var Ze;if(!je)try{Ze=lt.parse(q,ae)}catch(ut){je=ut}return ae.highlight=Q,je?ie(je):ie(null,Ze)};if(!Q||Q.length<3)return te();if(delete ae.highlight,!q.length)return te();var se=0;Ee.walkTokens(q,function(Se){Se.type==="code"&&(se++,setTimeout(function(){Q(Se.text,Se.lang,function(je,Ze){if(je)return te(je);Ze!=null&&Ze!==Se.text&&(Se.text=Ze,Se.escaped=!0),se--,se===0&&te()})},0))}),se===0&&te();return}try{var ce=We.lex(pe,ae);return ae.walkTokens&&Ee.walkTokens(ce,ae.walkTokens),lt.parse(ce,ae)}catch(Se){if(Se.message+=`
Please report this to https://github.com/markedjs/marked.`,ae.silent)return"<p>An error occurred:</p><pre>"+be(Se.message+"",!0)+"</pre>";throw Se}}Ee.options=Ee.setOptions=function(pe){return _t(Ee.defaults,pe),Ne(Ee.defaults),Ee},Ee.getDefaults=_e,Ee.defaults=ke,Ee.use=function(pe){var ae=_t({},pe);if(pe.renderer&&function(){var Q=Ee.defaults.renderer||new Xe,q=function(ce){var Se=Q[ce];Q[ce]=function(){for(var je=arguments.length,Ze=new Array(je),ut=0;ut<je;ut++)Ze[ut]=arguments[ut];var it=pe.renderer[ce].apply(Q,Ze);return it===!1&&(it=Se.apply(Q,Ze)),it}};for(var te in pe.renderer)q(te);ae.renderer=Q}(),pe.tokenizer&&function(){var Q=Ee.defaults.tokenizer||new ue,q=function(ce){var Se=Q[ce];Q[ce]=function(){for(var je=arguments.length,Ze=new Array(je),ut=0;ut<je;ut++)Ze[ut]=arguments[ut];var it=pe.tokenizer[ce].apply(Q,Ze);return it===!1&&(it=Se.apply(Q,Ze)),it}};for(var te in pe.tokenizer)q(te);ae.tokenizer=Q}(),pe.walkTokens){var ie=Ee.defaults.walkTokens;ae.walkTokens=function(Q){pe.walkTokens(Q),ie&&ie(Q)}}Ee.setOptions(ae)},Ee.walkTokens=function(pe,ae){for(var ie=N(pe),Q;!(Q=ie()).done;){var q=Q.value;ae(q);switch(q.type){case"table":{for(var te=N(q.tokens.header),se;!(se=te()).done;){var ce=se.value;Ee.walkTokens(ce,ae)}for(var Se=N(q.tokens.cells),je;!(je=Se()).done;)for(var Ze=je.value,ut=N(Ze),it;!(it=ut()).done;){var rt=it.value;Ee.walkTokens(rt,ae)}break}case"list":{Ee.walkTokens(q.items,ae);break}default:q.tokens&&Ee.walkTokens(q.tokens,ae)}}},Ee.Parser=lt,Ee.parser=lt.parse,Ee.Renderer=Xe,Ee.TextRenderer=He,Ee.Lexer=We,Ee.lexer=We.lex,Ee.Tokenizer=ue,Ee.Slugger=ot,Ee.parse=Ee;var Ie=Ee;return Ie})},"DlR+":function(Le,ye,F){var Y=F("MFOe"),K=Y.Global,L=Y.trim;Le.exports={name:"cookieStorage",read:N,write:j,each:R,remove:k,clearAll:A};var H=K.document;function N(g){if(!g||!D(g))return null;var h="(?:^|.*;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(H.cookie.replace(new RegExp(h),"$1"))}function R(g){for(var h=H.cookie.split(/; ?/g),u=h.length-1;u>=0;u--){if(!L(h[u]))continue;var d=h[u].split("="),s=unescape(d[0]),l=unescape(d[1]);g(l,s)}}function j(g,h){if(!g)return;H.cookie=escape(g)+"="+escape(h)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function k(g){if(!g||!D(g))return;H.cookie=escape(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function A(){R(function(g,h){k(h)})}function D(g){return new RegExp("(?:^|;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(H.cookie)}},EHPI:function(Le,ye,F){"use strict";var Y=F("bbsP"),K=F("/wGt"),L=F("tJVT"),H=F("k1fw"),N=F("cDcd"),R=F.n(N),j=F("ZW9T"),k=F("ZD9Y"),A=F("M8RZ"),D=F("bCnd"),g=F("fcyK"),h=F.n(g),u={theme:Object(D.a)("cmCodeMode","vs-dark"),fontSize:Object(D.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(D.a)("cmTabToSpace",!0)},d;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(d||(d={}));function s(i,o){switch(o.type){case d.set_show_editor_setting:return Object(H.a)(Object(H.a)({},i),{},{showEditorSetting:o.payload});case d.set_theme:return Object(H.a)(Object(H.a)({},i),{},{theme:o.payload});case d.set_font_size:return Object(H.a)(Object(H.a)({},i),{},{fontSize:o.payload});case d.on_tab_to_space:return Object(H.a)(Object(H.a)({},i),{},{tabToSpace:o.payload});default:throw new Error}}ye.a=function(i){var o=i.isLoading,n=i.value,f=i.onChange,O=i.language,S=i.ActionBarRender,x=S===void 0?function(z){return R.a.createElement(l,{onShowCodeSetting:z})}:S,w=Object(N.useReducer)(s,u),T=Object(L.a)(w,2),y=T[0],v=T[1],p=y.theme,c=y.fontSize,E=y.showEditorSetting,_=y.tabToSpace,b={onFontSizeChange:function(U){v({type:d.set_font_size,payload:U}),Object(D.b)("cmFontSize",U)},tabToSpace:_,cmFontSize:c,className:"oj",cmCodeMode:p,onTabToSpace:function(U){v({type:d.on_tab_to_space,payload:U}),Object(D.b)("cmTabToSpace",U)},onCodeModeChange:function(U){v({type:d.set_theme,payload:U}),Object(D.b)("cmCodeMode",U)}};function I(){v({type:d.set_show_editor_setting,payload:!1})}function P(){v({type:d.set_show_editor_setting,payload:!0})}var B={value:n,language:O,onChange:f,theme:p,height:"calc(100% - 56px)",options:{fontSize:c,insertSpaces:_}};return R.a.createElement(N.Fragment,null,R.a.createElement("div",{className:"code-panel-container"},x(P),!o&&R.a.createElement(j.b,B)),R.a.createElement(A.a,null,R.a.createElement(K.a,{className:"oj",title:null,placement:"right",closable:!1,visible:E,onClose:I},R.a.createElement(k.a,b))))};function l(i){var o=i.onShowCodeSetting;return R.a.createElement("div",{className:"action-bar"},R.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),R.a.createElement("a",{onClick:o},R.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Le,ye,F){(function(Y){Y(F("VrN/"))})(function(Y){var K={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},L=Y.Pos;Y.defineOption("autoCloseBrackets",!1,function(s,l,i){i&&i!=Y.Init&&(s.removeKeyMap(N),s.state.closeBrackets=null),l&&(R(H(l,"pairs")),s.state.closeBrackets=l,s.addKeyMap(N))});function H(s,l){return l=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[l]!=null?s[l]:K[l]}var N={Backspace:A,Enter:D};function R(s){for(var l=0;l<s.length;l++){var i=s.charAt(l),o="'"+i+"'";N[o]||(N[o]=j(i))}}R(K.pairs+"`");function j(s){return function(l){return h(l,s)}}function k(s){var l=s.state.closeBrackets;if(!l||l.override)return l;var i=s.getModeAt(s.getCursor());return i.closeBrackets||l}function A(s){var l=k(s);if(!l||s.getOption("disableInput"))return Y.Pass;for(var i=H(l,"pairs"),o=s.listSelections(),n=0;n<o.length;n++){if(!o[n].empty())return Y.Pass;var f=u(s,o[n].head);if(!f||i.indexOf(f)%2!=0)return Y.Pass}for(var n=o.length-1;n>=0;n--){var O=o[n].head;s.replaceRange("",L(O.line,O.ch-1),L(O.line,O.ch+1),"+delete")}}function D(s){var l=k(s),i=l&&H(l,"explode");if(!i||s.getOption("disableInput"))return Y.Pass;for(var o=s.listSelections(),n=0;n<o.length;n++){if(!o[n].empty())return Y.Pass;var f=u(s,o[n].head);if(!f||i.indexOf(f)%2!=0)return Y.Pass}s.operation(function(){var O=s.lineSeparator()||`
`;s.replaceSelection(O+O,null),s.execCommand("goCharLeft"),o=s.listSelections();for(var S=0;S<o.length;S++){var x=o[S].head.line;s.indentLine(x,null,!0),s.indentLine(x+1,null,!0)}})}function g(s){var l=Y.cmpPos(s.anchor,s.head)>0;return{anchor:new L(s.anchor.line,s.anchor.ch+(l?-1:1)),head:new L(s.head.line,s.head.ch+(l?1:-1))}}function h(s,l){var i=k(s);if(!i||s.getOption("disableInput"))return Y.Pass;var o=H(i,"pairs"),n=o.indexOf(l);if(n==-1)return Y.Pass;for(var f=H(i,"closeBefore"),O=H(i,"triples"),S=o.charAt(n+1)==l,x=s.listSelections(),w=n%2==0,T,y=0;y<x.length;y++){var v=x[y],p=v.head,c,E=s.getRange(p,L(p.line,p.ch+1));if(w&&!v.empty())c="surround";else if((S||!w)&&E==l)S&&d(s,p)?c="both":O.indexOf(l)>=0&&s.getRange(p,L(p.line,p.ch+3))==l+l+l?c="skipThree":c="skip";else if(S&&p.ch>1&&O.indexOf(l)>=0&&s.getRange(L(p.line,p.ch-2),p)==l+l){if(p.ch>2&&/\bstring/.test(s.getTokenTypeAt(L(p.line,p.ch-2))))return Y.Pass;c="addFour"}else if(S){var _=p.ch==0?" ":s.getRange(L(p.line,p.ch-1),p);if(!Y.isWordChar(E)&&_!=l&&!Y.isWordChar(_))c="both";else return Y.Pass}else if(w&&(E.length===0||/\s/.test(E)||f.indexOf(E)>-1))c="both";else return Y.Pass;if(!T)T=c;else if(T!=c)return Y.Pass}var b=n%2?o.charAt(n-1):l,I=n%2?l:o.charAt(n+1);s.operation(function(){if(T=="skip")s.execCommand("goCharRight");else if(T=="skipThree")for(var P=0;P<3;P++)s.execCommand("goCharRight");else if(T=="surround"){for(var B=s.getSelections(),P=0;P<B.length;P++)B[P]=b+B[P]+I;s.replaceSelections(B,"around"),B=s.listSelections().slice();for(var P=0;P<B.length;P++)B[P]=g(B[P]);s.setSelections(B)}else T=="both"?(s.replaceSelection(b+I,null),s.triggerElectric(b+I),s.execCommand("goCharLeft")):T=="addFour"&&(s.replaceSelection(b+b+b+b,"before"),s.execCommand("goCharRight"))})}function u(s,l){var i=s.getRange(L(l.line,l.ch-1),L(l.line,l.ch+1));return i.length==2?i:null}function d(s,l){var i=s.getTokenAt(L(l.line,l.ch+1));return/\bstring/.test(i.type)&&i.start==l.ch&&(l.ch==0||!/\bstring/.test(s.getTokenTypeAt(l)))}})},FOrL:function(Le,ye,F){Le.exports=F.p+"static/nodata.a6b3f948.png"},Gytx:function(Le,ye){Le.exports=function(Y,K,L,H){var N=L?L.call(H,Y,K):void 0;if(N!==void 0)return!!N;if(Y===K)return!0;if(typeof Y!="object"||!Y||typeof K!="object"||!K)return!1;var R=Object.keys(Y),j=Object.keys(K);if(R.length!==j.length)return!1;for(var k=Object.prototype.hasOwnProperty.bind(K),A=0;A<R.length;A++){var D=R[A];if(!k(D))return!1;var g=Y[D],h=K[D];if(N=L?L.call(H,g,h,D):void 0,N===!1||N===void 0&&g!==h)return!1}return!0}},H2Ag:function(Le,ye,F){Le.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(Le,ye,F){},I8Z2:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return H}),F.d(ye,"b",function(){return u}),F.d(ye,"c",function(){return s});var Y=F("cDcd"),K=function(){var l=function(i,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,f){n.__proto__=f}||function(n,f){for(var O in f)f.hasOwnProperty(O)&&(n[O]=f[O])},l(i,o)};return function(i,o){l(i,o);function n(){this.constructor=i}i.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),L=Y.createContext(null),H=function(l){K(i,l);function i(){return l!==null&&l.apply(this,arguments)||this}return i.prototype.render=function(){return Y.createElement(L.Provider,{value:this.props.store},this.props.children)},i}(Y.Component),N=F("Gytx"),R=F.n(N),j=F("2mql"),k=F.n(j),A=function(){var l=function(i,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,f){n.__proto__=f}||function(n,f){for(var O in f)f.hasOwnProperty(O)&&(n[O]=f[O])},l(i,o)};return function(i,o){l(i,o);function n(){this.constructor=i}i.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),D=function(){return D=Object.assign||function(l){for(var i,o=1,n=arguments.length;o<n;o++){i=arguments[o];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(l[f]=i[f])}return l},D.apply(this,arguments)};function g(l){return l.displayName||l.name||"Component"}var h=function(){return{}};function u(l,i){i===void 0&&(i={});var o=!!l,n=l||h;return function(O){var S=function(w){A(T,w);function T(y,v){var p=w.call(this,y,v)||this;return p.unsubscribe=null,p.handleChange=function(){if(!p.unsubscribe)return;var c=n(p.store.getState(),p.props);p.setState({subscribed:c})},p.store=p.context,p.state={subscribed:n(p.store.getState(),y),store:p.store,props:y},p}return T.getDerivedStateFromProps=function(y,v){return l&&l.length===2&&y!==v.props?{subscribed:n(v.store.getState(),y),props:y}:{props:y}},T.prototype.componentDidMount=function(){this.trySubscribe()},T.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},T.prototype.shouldComponentUpdate=function(y,v){return!R()(this.props,y)||!R()(this.state.subscribed,v.subscribed)},T.prototype.trySubscribe=function(){o&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},T.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},T.prototype.render=function(){var y=D(D(D({},this.props),this.state.subscribed),{store:this.store});return Y.createElement(O,D({},y,{ref:this.props.miniStoreForwardedRef}))},T.displayName="Connect("+g(O)+")",T.contextType=L,T}(Y.Component);if(i.forwardRef){var x=Y.forwardRef(function(w,T){return Y.createElement(S,D({},w,{miniStoreForwardedRef:T}))});return k()(x,O)}return k()(S,O)}}var d=function(){return d=Object.assign||function(l){for(var i,o=1,n=arguments.length;o<n;o++){i=arguments[o];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(l[f]=i[f])}return l},d.apply(this,arguments)};function s(l){var i=l,o=[];function n(S){i=d(d({},i),S);for(var x=0;x<o.length;x++)o[x]()}function f(){return i}function O(S){return o.push(S),function(){var w=o.indexOf(S);o.splice(w,1)}}return{setState:n,getState:f,subscribe:O}}},IBYe:function(Le,ye,F){"use strict";function Y(K){return null}ye.a=Y},IxHN:function(Le,ye,F){"use strict";var Y=F("cDcd"),K=F.n(Y),L=F("07cG"),H=F.n(L);ye.a=function(N){var R=N.message,j=N.className,k=N.children,A=N.style,D=A===void 0?{}:A;return K.a.createElement("div",{className:"".concat(H.a.idsRingWrapper," ").concat(j)},K.a.createElement("div",{className:H.a.ldsRing},K.a.createElement("div",null),K.a.createElement("div",null),K.a.createElement("div",null),K.a.createElement("div",null)),R?K.a.createElement("p",{style:D},R):null,k)}},J66h:function(Le,ye,F){(function(Y){var K,L;(function(H,N){Le.exports=N(H)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Y!="undefined"?Y:this,function(H){"use strict";H=H||{};var N=H.Base64,R="2.6.4",j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=function(b){for(var I={},P=0,B=b.length;P<B;P++)I[b.charAt(P)]=P;return I}(j),A=String.fromCharCode,D=function(b){if(b.length<2){var I=b.charCodeAt(0);return I<128?b:I<2048?A(192|I>>>6)+A(128|I&63):A(224|I>>>12&15)+A(128|I>>>6&63)+A(128|I&63)}else{var I=65536+(b.charCodeAt(0)-55296)*1024+(b.charCodeAt(1)-56320);return A(240|I>>>18&7)+A(128|I>>>12&63)+A(128|I>>>6&63)+A(128|I&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(b){return b.replace(g,D)},u=function(b){var I=[0,2,1][b.length%3],P=b.charCodeAt(0)<<16|(b.length>1?b.charCodeAt(1):0)<<8|(b.length>2?b.charCodeAt(2):0),B=[j.charAt(P>>>18),j.charAt(P>>>12&63),I>=2?"=":j.charAt(P>>>6&63),I>=1?"=":j.charAt(P&63)];return B.join("")},d=H.btoa&&typeof H.btoa=="function"?function(b){return H.btoa(b)}:function(b){if(b.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return b.replace(/[\s\S]{1,3}/g,u)},s=function(b){return d(h(String(b)))},l=function(b){return b.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},i=function(b,I){return I?l(s(b)):s(b)},o=function(b){return i(b,!0)},n;H.Uint8Array&&(n=function(b,I){for(var P="",B=0,z=b.length;B<z;B+=3){var U=b[B],C=b[B+1],W=b[B+2],V=U<<16|C<<8|W;P+=j.charAt(V>>>18)+j.charAt(V>>>12&63)+(typeof C!="undefined"?j.charAt(V>>>6&63):"=")+(typeof W!="undefined"?j.charAt(V&63):"=")}return I?l(P):P});var f=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(b){switch(b.length){case 4:var I=(7&b.charCodeAt(0))<<18|(63&b.charCodeAt(1))<<12|(63&b.charCodeAt(2))<<6|63&b.charCodeAt(3),P=I-65536;return A((P>>>10)+55296)+A((P&1023)+56320);case 3:return A((15&b.charCodeAt(0))<<12|(63&b.charCodeAt(1))<<6|63&b.charCodeAt(2));default:return A((31&b.charCodeAt(0))<<6|63&b.charCodeAt(1))}},S=function(b){return b.replace(f,O)},x=function(b){var I=b.length,P=I%4,B=(I>0?k[b.charAt(0)]<<18:0)|(I>1?k[b.charAt(1)]<<12:0)|(I>2?k[b.charAt(2)]<<6:0)|(I>3?k[b.charAt(3)]:0),z=[A(B>>>16),A(B>>>8&255),A(B&255)];return z.length-=[0,0,2,1][P],z.join("")},w=H.atob&&typeof H.atob=="function"?function(b){return H.atob(b)}:function(b){return b.replace(/\S{1,4}/g,x)},T=function(b){return w(String(b).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(b){return S(w(b))},v=function(b){return String(b).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},p=function(b){return y(v(b))},c;H.Uint8Array&&(c=function(b){return Uint8Array.from(T(v(b)),function(I){return I.charCodeAt(0)})});var E=function(){var b=H.Base64;return H.Base64=N,b};if(H.Base64={VERSION:R,atob:T,btoa:d,fromBase64:p,toBase64:i,utob:h,encode:i,encodeURI:o,btou:S,decode:p,noConflict:E,fromUint8Array:n,toUint8Array:c},typeof Object.defineProperty=="function"){var _=function(b){return{value:b,enumerable:!1,writable:!0,configurable:!0}};H.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",_(function(){return p(this)})),Object.defineProperty(String.prototype,"toBase64",_(function(b){return i(this,b)})),Object.defineProperty(String.prototype,"toBase64URI",_(function(){return i(this,!0)}))}}return H.Meteor&&(Base64=H.Base64),Le.exports?Le.exports.Base64=H.Base64:!(K=[],L=function(){return H.Base64}.apply(ye,K),L!==void 0&&(Le.exports=L)),{Base64:H.Base64}})}).call(this,F("IyRk"))},JB8y:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return Y});var Y;(function(K){K[K.NOMATCH=-1]="NOMATCH",K[K.OK=0]="OK",K[K.TIMEOUT=2]="TIMEOUT",K[K.PODFAILURE=3]="PODFAILURE",K[K.COMPILEFAILURE=4]="COMPILEFAILURE",K[K.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(Y||(Y={}))},JPnl:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return v}),F.d(ye,"c",function(){return E});var Y=F("+L6B"),K=F("2/Rp"),L=F("tJVT"),H=F("9og8"),N=F("k1fw"),R=F("jrin"),j=F("5NDa"),k=F("5rEg"),A=F("WmNS"),D=F.n(A),g=F("cDcd"),h=F.n(g),u=F("8Skl"),d=F("y3Kf"),s=F("JB8y"),l=F("J66h"),i=F.n(l),o=F("a4uL"),n=F.n(o),f=F("IxHN"),O=F("9Bee"),S=F("1vsH"),x=F("ErOA"),w,T=k.a.TextArea,y={visible:!1,tabIndex:"0"},v=(w={},Object(R.a)(w,s.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(R.a)(w,s.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(R.a)(w,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(R.a)(w,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(R.a)(w,4,"\u7F16\u8BD1\u5931\u8D25"),Object(R.a)(w,5,"\u6267\u884C\u5931\u8D25"),w),p;(function(b){b[b.SET_VISIBLE=0]="SET_VISIBLE",b[b.SET_TABINDEX=1]="SET_TABINDEX"})(p||(p={}));function c(b,I){switch(I.type){case p.SET_VISIBLE:return Object(N.a)(Object(N.a)({},b),{},{visible:I.payload});case p.SET_TABINDEX:return Object(N.a)(Object(N.a)({},b),{},{tabIndex:I.payload});default:throw new Error}}function E(b){var I=b.status,P=b.error_msg,B=b.output,z=b.input,U=b.expected_output,C=b.is_file,W=b.input_file_url,V=b.output_file_url,J=b.expected_output_file_url,ne=b.setMonacoValue,fe=b.setData,ue=null,le={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(I){case s.a.NOMATCH:ue=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!C&&h.a.createElement(O.a,{value:z,style:le}),C&&h.a.createElement("div",{style:le},h.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(H.a)(D.a.mark(function me(){var ge;return D.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,fetch(W,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return ge=oe.sent,oe.t0=ne,oe.next=6,ge.text();case 6:oe.t1=oe.sent,(0,oe.t0)(oe.t1),setTimeout(function(){fe(W)},200);case 9:case"end":return oe.stop()}},me)}))},z)),h.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!C&&h.a.createElement(O.a,{value:B&&l.Base64.decode(B)||"",style:le}),C&&h.a.createElement("div",{style:le},h.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(H.a)(D.a.mark(function me(){var ge;return D.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(x.a)(V,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:ge=oe.sent,ne(ge),setTimeout(function(){fe(V)},200);case 5:case"end":return oe.stop()}},me)}))},B)),h.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!C&&h.a.createElement(O.a,{value:U&&l.Base64.decode(U)||"",style:le}),C&&h.a.createElement("div",{style:le},h.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(H.a)(D.a.mark(function me(){var ge;return D.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,fetch(J,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return ge=oe.sent,oe.t0=ne,oe.next=6,ge.text();case 6:oe.t1=oe.sent,(0,oe.t0)(oe.t1),setTimeout(function(){fe(J)},200);case 9:case"end":return oe.stop()}},me)}))},U)));break;case s.a.EXECUTEFAILURE:ue=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!C&&h.a.createElement(O.a,{value:z,style:le}),C&&h.a.createElement("div",{style:le},h.a.createElement("a",{onClick:function(){return Object(S.y)(W,z)}},z)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},l.Base64.decode(P)));break;case s.a.COMPILEFAILURE:ue=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!C&&h.a.createElement(O.a,{value:z,style:le}),C&&h.a.createElement("div",{style:le},h.a.createElement("a",{onClick:function(){return Object(S.y)(W,z)}},z)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},l.Base64.decode(P)));break;case s.a.PODFAILURE:ue=h.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:ue=h.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return h.a.createElement(h.a.Fragment,null," ",ue," ")}function _(b){var I=b.status,P=b.error_msg,B=b.execute_time,z=b.output,U=b.input,C=b.expected_output,W=b.is_file,V=b.input_file_url,J=b.output_file_url,ne=b.expected_output_file_url,fe=null;switch(I){case s.a.OK:fe=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",B),h.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),h.a.createElement("pre",null,l.Base64.decode(z)));break;case s.a.NOMATCH:fe=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u8F93\u5165\uFF1A",h.a.createElement("pre",null,U)),h.a.createElement("p",null,"\u8F93\u51FA\uFF1A",z&&l.Base64.decode(z)),h.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",C&&l.Base64.decode(C)));break;case s.a.EXECUTEFAILURE:fe=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",h.a.createElement("pre",null,U)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},l.Base64.decode(P)));break;case s.a.COMPILEFAILURE:fe=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",h.a.createElement("pre",null,U)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},l.Base64.decode(P)));break;case s.a.PODFAILURE:fe=h.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:fe=h.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return h.a.createElement(h.a.Fragment,null," ",fe," ")}ye.b=function(b){var I=b.input,P=b.debuging,B=b.submitting,z=b.executingMessage,U=b.debugResult,C=b.onChangeInput,W=b.onDebugCode,V=b.onSubmitCode,J=b.hack,ne=b.user,fe=Object(g.useReducer)(c,y),ue=Object(L.a)(fe,2),le=ue[0],me=ue[1],ge=le.visible,re=le.tabIndex;function oe($e){var Ke=$e.target.id;me({type:p.SET_TABINDEX,payload:Ke})}function xe(){me({type:p.SET_VISIBLE,payload:!ge})}var Be=Object(g.useMemo)(function(){if(U){var $e=U.status;return h.a.createElement(h.a.Fragment,null,_(U))}return null},[U]);function Ve(){me({type:p.SET_VISIBLE,payload:!0}),me({type:p.SET_TABINDEX,payload:"1"}),W()}var Ye=function(){var $e=Object(H.a)(D.a.mark(function Ke(We){var ze;return D.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return Je.next=2,Object(x.a)("/api/problems/".concat(We,"/start.json"),{method:"get",params:{hack_user_id:ne==null?void 0:ne.user_id}});case 2:ze=Je.sent,ze&&(window.location.href="/myproblems/".concat(ze==null?void 0:ze.identifier,"?type=1"));case 4:case"end":return Je.stop()}},Ke)}));return function(We){return $e.apply(this,arguments)}}();return h.a.createElement("div",{className:"test-case-panel"},h.a.createElement("div",{className:"test-case-panel-body ".concat(ge?"active":"")},h.a.createElement("ul",{className:"s-navs"},h.a.createElement("li",null,h.a.createElement("a",{className:re==="0"?"active":"",id:"0",onClick:oe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),h.a.createElement("li",null,h.a.createElement("a",{className:re==="1"?"active":"",id:"1",onClick:oe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),h.a.createElement("div",{className:"tab-panel-body ".concat(re==="0"?"":"hide")},h.a.createElement(T,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:I,onChange:C})),h.a.createElement("div",{className:"tab-panel-body ".concat(re==="1"?"":"hide")},P?h.a.createElement(f.a,{message:z}):U?h.a.createElement("section",{style:{height:200}}," ",Be," "):h.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"))),h.a.createElement("a",{className:"btn-collapse ".concat(ge?"up":""),onClick:xe},ge?h.a.createElement(u.a,null):h.a.createElement(d.a,null)),h.a.createElement("footer",{className:"footer"},h.a.createElement("span",null,"\u63A7\u5236\u53F0"),h.a.createElement("div",{className:"flex-container"},(J==null?void 0:J.is_program)&&(J==null?void 0:J.above_question)&&h.a.createElement(K.a,{onClick:function(){return Ye(J==null?void 0:J.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(J==null?void 0:J.is_program)&&(J==null?void 0:J.under_question)&&h.a.createElement(K.a,{onClick:function(){return Ye(J==null?void 0:J.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),h.a.createElement(K.a,{className:"btn-green",type:"ghost",loading:P,onClick:Ve},"\u8C03\u8BD5\u4EE3\u7801"),h.a.createElement(K.a,{type:"primary",loading:B,disabled:B,onClick:function(){me({type:p.SET_VISIBLE,payload:!1}),V()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},LdHM:function(Le,ye,F){"use strict";F.d(ye,"b",function(){return f}),F.d(ye,"a",function(){return S});var Y=F("1OyB"),K=F("vuIU"),L=F("Ji7U"),H=F("LK+K"),N=F("cDcd"),R=F("rePB"),j=F("Ff2n"),k=F("ODXe"),A=F("4IlW"),D=F("bX4T"),g=F("YrtM"),h=F("TSYQ"),u=F.n(h),d=F("+nKL"),s=F("8OUc"),l=function(W,V){var J=W.prefixCls,ne=W.id,fe=W.flattenOptions,ue=W.childrenAsData,le=W.values,me=W.searchValue,ge=W.multiple,re=W.defaultActiveFirstOption,oe=W.height,xe=W.itemHeight,Be=W.notFoundContent,Ve=W.open,Ye=W.menuItemSelectedIcon,$e=W.virtual,Ke=W.onSelect,We=W.onToggleOpen,ze=W.onActiveValue,at=W.onScroll,Je=W.onMouseEnter,Xe="".concat(J,"-item"),He=Object(g.a)(function(){return fe},[Ve,fe],function(Ie,pe){return pe[0]&&Ie[1]!==pe[1]}),ot=N.useRef(null),ft=function(pe){pe.preventDefault()},dt=function(pe){ot.current&&ot.current.scrollTo({index:pe})},lt=function(pe){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=He.length,Q=0;Q<ie;Q+=1){var q=(pe+Q*ae+ie)%ie,te=He[q],se=te.group,ce=te.data;if(!se&&!ce.disabled)return q}return-1},_t=N.useState(function(){return lt(0)}),ht=Object(k.a)(_t,2),be=ht[0],_e=ht[1],Ne=function(pe){_e(pe);var ae=He[pe];if(!ae){ze(null,-1);return}ze(ae.data.value,pe)};N.useEffect(function(){Ne(re!==!1?lt(0):-1)},[He.length,me]),N.useEffect(function(){var Ie=setTimeout(function(){if(!ge&&Ve&&le.size===1){var pe=Array.from(le)[0],ae=He.findIndex(function(ie){var Q=ie.data;return Q.value===pe});Ne(ae),dt(ae)}});return function(){return clearTimeout(Ie)}},[Ve]);var ke=function(pe){pe!==void 0&&Ke(pe,{selected:!le.has(pe)}),ge||We(!1)};if(N.useImperativeHandle(V,function(){return{onKeyDown:function(pe){var ae=pe.which;switch(ae){case A.a.UP:case A.a.DOWN:{var ie=0;if(ae===A.a.UP?ie=-1:ae===A.a.DOWN&&(ie=1),ie!==0){var Q=lt(be+ie,ie);dt(Q),Ne(Q)}break}case A.a.ENTER:{var q=He[be];q&&!q.data.disabled?ke(q.data.value):ke(void 0),Ve&&pe.preventDefault();break}case A.a.ESC:We(!1)}},onKeyUp:function(){},scrollTo:function(pe){dt(pe)}}}),He.length===0)return N.createElement("div",{role:"listbox",id:"".concat(ne,"_list"),className:"".concat(Xe,"-empty"),onMouseDown:ft},Be);function Ee(Ie){var pe=He[Ie];if(!pe)return null;var ae=pe.data||{},ie=ae.value,Q=ae.label,q=ae.children,te=Object(D.a)(ae,!0),se=ue?q:Q;return pe?N.createElement("div",Object.assign({"aria-label":typeof se=="string"?se:null},te,{key:Ie,role:"option",id:"".concat(ne,"_list_").concat(Ie),"aria-selected":le.has(ie)}),ie):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(ne,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ee(be-1),Ee(be),Ee(be+1)),N.createElement(d.a,{itemKey:"key",ref:ot,data:He,height:oe,itemHeight:xe,fullHeight:!1,onMouseDown:ft,onScroll:at,virtual:$e,onMouseEnter:Je},function(Ie,pe){var ae,ie=Ie.group,Q=Ie.groupOption,q=Ie.data,te=q.label,se=q.key;if(ie)return N.createElement("div",{className:u()(Xe,"".concat(Xe,"-group"))},te!==void 0?te:se);var ce=q.disabled,Se=q.value,je=q.title,Ze=q.children,ut=q.style,it=q.className,rt=Object(j.a)(q,["disabled","value","title","children","style","className"]),Me=le.has(Se),Ue="".concat(Xe,"-option"),we=u()(Xe,Ue,it,(ae={},Object(R.a)(ae,"".concat(Ue,"-grouped"),Q),Object(R.a)(ae,"".concat(Ue,"-active"),be===pe&&!ce),Object(R.a)(ae,"".concat(Ue,"-disabled"),ce),Object(R.a)(ae,"".concat(Ue,"-selected"),Me),ae)),ee=ue?Ze:te,he=!Ye||typeof Ye=="function"||Me;return N.createElement("div",Object.assign({},rt,{"aria-selected":Me,className:we,title:je,onMouseMove:function(){if(be===pe||ce)return;Ne(pe)},onClick:function(){ce||ke(Se)},style:ut}),N.createElement("div",{className:"".concat(Ue,"-content")},ee||Se),N.isValidElement(Ye)||Me,he&&N.createElement(s.a,{className:"".concat(Xe,"-option-state"),customizeIcon:Ye,customizeIconProps:{isSelected:Me}},Me?"\u2713":null))}))},i=N.forwardRef(l);i.displayName="OptionList";var o=i,n=function(){return null};n.isSelectOption=!0;var f=n,O=function(){return null};O.isSelectOptGroup=!0;var S=O,x=F("VTBJ"),w=F("Zm9Q");function T(C){var W=C.key,V=C.props,J=V.children,ne=V.value,fe=Object(j.a)(V,["children","value"]);return Object(x.a)({key:W,value:ne!==void 0?ne:W,children:J},fe)}function y(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(C).map(function(V,J){if(!N.isValidElement(V)||!V.type)return null;var ne=V.type.isSelectOptGroup,fe=V.key,ue=V.props,le=ue.children,me=Object(j.a)(ue,["children"]);return W||!ne?T(V):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(fe===null?J:fe,"__"),label:fe},me),{},{options:y(le)})}).filter(function(V){return V})}var v=F("2Qr1"),p=F("qNPg"),c=F("U8pU"),E=F("Kwbf"),_=F("WKfj");function b(C){var W=C.mode,V=C.options,J=C.children,ne=C.backfill,fe=C.allowClear,ue=C.placeholder,le=C.getInputElement,me=C.showSearch,ge=C.onSearch,re=C.defaultOpen,oe=C.autoFocus,xe=C.labelInValue,Be=C.value,Ve=C.inputValue,Ye=C.optionLabelProp,$e=W==="multiple"||W==="tags",Ke=me!==void 0?me:$e||W==="combobox",We=V||y(J);if(Object(E.a)(W!=="tags"||We.every(function(Xe){return!Xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var ze=We.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(E.a)(!ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(W!=="combobox"||!Ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(W==="combobox"||!ne,"`backfill` only works with `combobox` mode."),Object(E.a)(W==="combobox"||!le,"`getInputElement` only work with `combobox` mode."),Object(E.b)(W!=="combobox"||!le||!fe||!ue,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ge&&!Ke&&W!=="combobox"&&W!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!re||oe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Be!=null){var at=Object(_.d)(Be);Object(E.a)(!xe||at.every(function(Xe){return Object(c.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(E.a)(!$e||Array.isArray(Be),"`value` should be array when `mode` is `multiple` or `tags`")}if(J){var Je=null;Object(w.a)(J).some(function(Xe){if(!N.isValidElement(Xe)||!Xe.type)return!1;var He=Xe.type;if(He.isSelectOption)return!1;if(He.isSelectOptGroup){var ot=Object(w.a)(Xe.props.children).every(function(ft){return!N.isValidElement(ft)||!Xe.type||ft.type.isSelectOption?!0:(Je=ft.type,!1)});return!ot}return Je=He,!0}),Je&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Je.displayName||Je.name||Je,"`.")),Object(E.a)(Ve===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=b,P=Object(p.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:y,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:I,fillOptionsWithMissingValue:v.a}),B=function(C){Object(L.a)(V,C);var W=Object(H.a)(V);function V(){var J;return Object(Y.a)(this,V),J=W.apply(this,arguments),J.selectRef=N.createRef(),J.focus=function(){J.selectRef.current.focus()},J.blur=function(){J.selectRef.current.blur()},J}return Object(K.a)(V,[{key:"render",value:function(){return N.createElement(P,Object.assign({ref:this.selectRef},this.props))}}]),V}(N.Component);B.Option=f,B.OptGroup=S;var z=B,U=ye.c=z},M8RZ:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return A});var Y=F("fWQN"),K=F("mtLc"),L=F("yKVA"),H=F("879j"),N=F("cDcd"),R=F.n(N),j=F("faye"),k=F.n(j),A=function(D){Object(L.a)(h,D);var g=Object(H.a)(h);function h(u){var d;Object(Y.a)(this,h),d=g.call(this,u);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(K.a)(h,[{key:"render",value:function(){var d=this.props.children;return Object(j.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),h}(R.a.Component)},MFOe:function(Le,ye,F){(function(Y){var K=R(),L=j(),H=k(),N=typeof window!="undefined"?window:Y;Le.exports={assign:K,create:L,trim:H,bind:A,slice:D,each:g,map:h,pluck:u,isList:d,isFunction:s,isObject:l,Global:N};function R(){return Object.assign?Object.assign:function(o,n,f,O){for(var S=1;S<arguments.length;S++)g(Object(arguments[S]),function(x,w){o[w]=x});return o}}function j(){if(Object.create)return function(n,f,O,S){var x=D(arguments,1);return K.apply(this,[Object.create(n)].concat(x))};{function i(){}return function(n,f,O,S){var x=D(arguments,1);return i.prototype=n,K.apply(this,[new i].concat(x))}}}function k(){return String.prototype.trim?function(o){return String.prototype.trim.call(o)}:function(o){return o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function A(i,o){return function(){return o.apply(i,Array.prototype.slice.call(arguments,0))}}function D(i,o){return Array.prototype.slice.call(i,o||0)}function g(i,o){u(i,function(n,f){return o(n,f),!1})}function h(i,o){var n=d(i)?[]:{};return u(i,function(f,O){return n[O]=o(f,O),!1}),n}function u(i,o){if(d(i)){for(var n=0;n<i.length;n++)if(o(i[n],n))return i[n]}else for(var f in i)if(i.hasOwnProperty(f)&&o(i[f],f))return i[f]}function d(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function s(i){return i&&{}.toString.call(i)==="[object Function]"}function l(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,F("IyRk"))},NvD2:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return R});var Y=F("Kwbf");function K(j,k){var A=new Set;return j.forEach(function(D){k.has(D)||A.add(D)}),A}function L(j){var k=j||{},A=k.disabled,D=k.disableCheckbox,g=k.checkable;return!!(A||D)||g===!1}function H(j,k,A,D){for(var g=new Set(j),h=new Set,u=0;u<=A;u+=1){var d=k.get(u)||new Set;d.forEach(function(o){var n=o.key,f=o.node,O=o.children,S=O===void 0?[]:O;g.has(n)&&!D(f)&&S.filter(function(x){return!D(x.node)}).forEach(function(x){g.add(x.key)})})}for(var s=new Set,l=A;l>=0;l-=1){var i=k.get(l)||new Set;i.forEach(function(o){var n=o.parent,f=o.node;if(D(f)||!o.parent||s.has(o.parent.key))return;if(D(o.parent.node)){s.add(n.key);return}var O=!0,S=!1;(n.children||[]).filter(function(x){return!D(x.node)}).forEach(function(x){var w=x.key,T=g.has(w);O&&!T&&(O=!1),!S&&(T||h.has(w))&&(S=!0)}),O&&g.add(n.key),S&&h.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(K(h,g))}}function N(j,k,A,D,g){for(var h=new Set(j),u=new Set(k),d=0;d<=D;d+=1){var s=A.get(d)||new Set;s.forEach(function(n){var f=n.key,O=n.node,S=n.children,x=S===void 0?[]:S;!h.has(f)&&!u.has(f)&&!g(O)&&x.filter(function(w){return!g(w.node)}).forEach(function(w){h.delete(w.key)})})}u=new Set;for(var l=new Set,i=D;i>=0;i-=1){var o=A.get(i)||new Set;o.forEach(function(n){var f=n.parent,O=n.node;if(g(O)||!n.parent||l.has(n.parent.key))return;if(g(n.parent.node)){l.add(f.key);return}var S=!0,x=!1;(f.children||[]).filter(function(w){return!g(w.node)}).forEach(function(w){var T=w.key,y=h.has(T);S&&!y&&(S=!1),!x&&(y||u.has(T))&&(x=!0)}),S||h.delete(f.key),x&&u.add(f.key),l.add(f.key)})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(K(u,h))}}function R(j,k,A,D){var g=[],h;D?h=D:h=L;var u=new Set(j.filter(function(i){var o=!!A[i];return o||g.push(i),o})),d=new Map,s=0;Object.keys(A).forEach(function(i){var o=A[i],n=o.level,f=d.get(n);f||(f=new Set,d.set(n,f)),f.add(o),s=Math.max(s,n)}),Object(Y.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var l;return k===!0?l=H(u,d,s,h):l=N(u,k.halfCheckedKeys,d,s,h),l}},OJz4:function(Le,ye,F){"use strict";F.d(ye,"d",function(){return K}),F.d(ye,"h",function(){return L}),F.d(ye,"b",function(){return H}),F.d(ye,"f",function(){return N}),F.d(ye,"e",function(){return R}),F.d(ye,"c",function(){return j}),F.d(ye,"a",function(){return k}),F.d(ye,"g",function(){return A}),F.d(ye,"i",function(){return D}),F.d(ye,"k",function(){return g}),F.d(ye,"j",function(){return h});var Y=F("ErOA");function K(u){return Object(Y.c)("myproblems/".concat(u,".json"),{hidePopLogin:!0})}function L(u,d){return Object(Y.f)("myproblems/".concat(u,"/code_submit.json"),d)}function H(u,d){return Object(Y.c)("myproblems/".concat(u,"/code_debug.json"),d)}function N(u,d){return Object(Y.c)("myproblems/".concat(u,"/submit_records.json"),d)}function R(u){return Object(Y.c)("myproblems/record_detail.json",{id:u})}function j(u,d){return Object(Y.c)("myproblems/".concat(u,"/result.json"),{mode:d})}function k(u,d){return Object(Y.f)("myproblems/".concat(u,"/add_notes.json"),d)}function A(u){return Object(Y.f)("myproblems/".concat(u,"/restore_initial_code.json"))}function D(u){return Object(Y.f)("myproblems/".concat(u,"/sync_code.json"))}function g(u,d){return Object(Y.f)("myproblems/".concat(u,"/update_code.json"),d)}function h(u,d){return Object(Y.f)("discusses/".concat(u,"/plus.json"),d)}},OLES:function(Le,ye,F){"use strict";var Y=F("U8pU"),K=F("VTBJ"),L=F("Ff2n"),H=F("cDcd"),N=F("uciX"),R=F("7ixt"),j=function(u){var d=u.overlay,s=u.prefixCls,l=u.id,i=u.overlayInnerStyle;return H.createElement("div",{className:"".concat(s,"-inner"),id:l,role:"tooltip",style:i},typeof d=="function"?d():d)},k=j,A=function(u,d){var s=u.overlayClassName,l=u.trigger,i=l===void 0?["hover"]:l,o=u.mouseEnterDelay,n=o===void 0?0:o,f=u.mouseLeaveDelay,O=f===void 0?.1:f,S=u.overlayStyle,x=u.prefixCls,w=x===void 0?"rc-tooltip":x,T=u.children,y=u.onVisibleChange,v=u.afterVisibleChange,p=u.transitionName,c=u.animation,E=u.placement,_=E===void 0?"right":E,b=u.align,I=b===void 0?{}:b,P=u.destroyTooltipOnHide,B=P===void 0?!1:P,z=u.defaultVisible,U=u.getTooltipContainer,C=u.overlayInnerStyle,W=Object(L.a)(u,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),V=Object(H.useRef)(null);Object(H.useImperativeHandle)(d,function(){return V.current});var J=Object(K.a)({},W);"visible"in u&&(J.popupVisible=u.visible);var ne=function(){var ge=u.arrowContent,re=ge===void 0?null:ge,oe=u.overlay,xe=u.id;return[H.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},re),H.createElement(k,{key:"content",prefixCls:w,id:xe,overlay:oe,overlayInnerStyle:C})]},fe=!1,ue=!1;if(typeof B=="boolean")fe=B;else if(B&&Object(Y.a)(B)==="object"){var le=B.keepParent;fe=le===!0,ue=le===!1}return H.createElement(N.a,Object.assign({popupClassName:s,prefixCls:w,popup:ne,action:i,builtinPlacements:R.a,popupPlacement:_,ref:V,popupAlign:I,getPopupContainer:U,onPopupVisibleChange:y,afterPopupVisibleChange:v,popupTransitionName:p,popupAnimation:c,defaultPopupVisible:z,destroyPopupOnHide:fe,autoDestroy:ue,mouseLeaveDelay:O,popupStyle:S,mouseEnterDelay:n},J),T)},D=Object(H.forwardRef)(A),g=ye.a=D},OZM5:function(Le,ye,F){"use strict";F.d(ye,"b",function(){return D}),F.d(ye,"a",function(){return g}),F.d(ye,"k",function(){return h}),F.d(ye,"h",function(){return u}),F.d(ye,"i",function(){return d}),F.d(ye,"g",function(){return s}),F.d(ye,"c",function(){return l}),F.d(ye,"d",function(){return i}),F.d(ye,"j",function(){return f}),F.d(ye,"e",function(){return O}),F.d(ye,"f",function(){return S});var Y=F("KQm4"),K=F("U8pU"),L=F("Ff2n"),H=F("cDcd"),N=F.n(H),R=F("Kwbf"),j=F("WaYH"),k=.25,A=2;function D(x,w){var T=x.slice(),y=T.indexOf(w);return y>=0&&T.splice(y,1),T}function g(x,w){var T=x.slice();return T.indexOf(w)===-1&&T.push(w),T}function h(x){return x.split("-")}function u(x,w){return"".concat(x,"-").concat(w)}function d(x){return x&&x.type&&x.type.isTreeNode}function s(x,w){var T=[x],y=w[x];function v(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];p.forEach(function(c){var E=c.key,_=c.children;T.push(E),v(_)})}return v(y.children),T}function l(x,w){var T=x.clientY,y=w.selectHandle.getBoundingClientRect(),v=y.top,p=y.bottom,c=y.height,E=Math.max(c*k,A);return T<=v+E?-1:T>=p-E?1:0}function i(x,w){if(!x)return;var T=w.multiple;return T?x.slice():x.length?[x[0]]:x}var o=function(w){return w};function n(x,w){if(!x)return[];var T=w||{},y=T.processProps,v=y===void 0?o:y,p=Array.isArray(x)?x:[x];return p.map(function(c){var E=c.children,_=Object(L.a)(c,["children"]),b=n(E,w);return N.a.createElement(j.a,Object.assign({},v(_)),b)})}function f(x){if(!x)return null;var w;if(Array.isArray(x))w={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(K.a)(x)==="object")w={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return w}function O(x,w){var T=new Set;function y(v){if(T.has(v))return;var p=w[v];if(!p)return;T.add(v);var c=p.parent,E=p.node;if(E.disabled)return;c&&y(c.key)}return(x||[]).forEach(function(v){y(v)}),Object(Y.a)(T)}function S(x){var w={};return Object.keys(x).forEach(function(T){(T.startsWith("data-")||T.startsWith("aria-"))&&(w[T]=x[T])}),w}},Ot1p:function(Le,ye,F){"use strict";var Y=F("2qtc"),K=F("kLXV"),L=F("rAM+"),H=F("miYZ"),N=F("tsqr"),R=F("9og8"),j=F("tJVT"),k=F("jrin"),A=F("WmNS"),D=F.n(A),g=F("cDcd"),h=F.n(g),u=F("VrN/"),d=F.n(u),s=F("bdgK"),l=F("p77/"),i=F("Bd2K"),o=F("ELLl"),n=F("19Vz"),f=F("lZu9"),O=F("+NIl"),S=F("kSUc"),x=F("9Bee"),w=function(ce){var Se=ce.value,je=Se===void 0?"":Se,Ze=ce.className,ut=ce.showTextOnly,it=ce.showLines,rt=ce.style,Me=rt===void 0?{}:rt,Ue=Object(g.useMemo)(function(){return""},[je]);return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ue}}))},T=F("0Owb"),y=F("dejd"),v=F("C+DQ"),p=F("1vsH"),c=F("m3rI"),E=[{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 _(ce){var Se=ce.onActionCallback,je=ce.title,Ze=ce.icon,ut=ce.actionName,it=ce.className,rt=it===void 0?"":it,Me=ce.children;function Ue(){Se(ut)}return h.a.createElement("a",{title:je,className:rt,onClick:Ue},h.a.createElement("i",{className:"md-iconfont ".concat(Ze)}),Me)}var b=function(ce){var Se=ce.watch,je=ce.showNullButton,Ze=ce.onActionCallback,ut=ce.fullScreen,it=ce.insertTemp,rt=ce.hidetoolBar,Me=ce.uuid,Ue=ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(p.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(p.G)("_educoder_session"),"&key=").concat(Me,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var we=[].concat(E,[{title:"".concat(Se?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Se?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return h.a.createElement("ul",{className:"markdown-toolbar-container"},!rt&&we.map(function(ee,he){return h.a.createElement("li",{key:he},ee.actionName?h.a.createElement(_,Object(T.a)({},ee,{onActionCallback:Ze})):h.a.createElement("span",{className:"v-line"}))}),je?h.a.createElement("li",null,h.a.createElement(_,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ze},h.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,it&&h.a.createElement("li",null,h.a.createElement(_,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(it),onActionCallback:Ze},h.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),h.a.createElement("li",{className:"btn-full-screen"},h.a.createElement(_,{icon:"".concat(ut?"icon-shrink":"icon-enlarge"),title:ut?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ze})))},I=F("M8RZ"),P=F("+L6B"),B=F("2/Rp"),z=F("y8nQ"),U=F("Vl3Y"),C=F("5NDa"),W=F("5rEg"),V={labelCol:{span:4},wrapperCol:{span:20}},J=function(ce){var Se=ce.callback,je=ce.onCancel;function Ze(ut){Se(ut)}return h.a.createElement(U.a,Object(T.a)({},V,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ze}),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},h.a.createElement(W.a,null)),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},h.a.createElement(W.a,null)),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(B.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},ne=F("7ahc"),fe=F("HmJG"),ue=F("BjJ7"),le=U.a.useForm,me={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},re=function(ce){var Se=ce.callback,je=ce.onCancel,Ze=le(),ut=Object(j.a)(Ze,1),it=ut[0];function rt(we){Se(we)}function Me(we,ee){if(we.status===-1){N.b.error(we.message);return}it.setFieldsValue({src:"/api/attachments/".concat(we.id),type:ee.type})}function Ue(we){var ee=we.target.files[0];xe(ee,Me)}return h.a.createElement(U.a,Object(T.a)({form:it},ge,{className:"upload-image-panel",onFinish:rt}),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},h.a.createElement("div",{className:"flex-container"},h.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},h.a.createElement(W.a,{style:me})),h.a.createElement(oe,{onFileChange:Ue}))),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},h.a.createElement(W.a,{style:{width:264}})),h.a.createElement(U.a.Item,{style:{textAlign:"right"}},h.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(B.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))};function oe(ce){var Se=ce.onFileChange;return h.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",h.a.createElement("input",{type:"file",onChange:Se}))}function xe(ce,Se){if(!ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var je=new FormData;je.append("editormd-image-file",ce),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var Ze=new window.XMLHttpRequest;Ze.withCredentials=!0,Ze.addEventListener("load",function(ut){Se(JSON.parse(ut.target.responseText),ce)},!1),Ze.addEventListener("error",function(ut){console.error(ut)},!1),Ze.open("POST","".concat(ue.a,"/api/attachments.json")),Ze.send(je)}var Be=F("giR+"),Ve=F("fyUT"),Ye=F("7Kak"),$e=F("9yH6"),Ke=$e.a.Group,We={margin:"0 8px"},ze=function(ce){var Se=ce.callback,je=ce.onCancel;function Ze(ut){Se(ut)}return h.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ze},h.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},h.a.createElement("span",{style:We},"\u5355\u5143\u683C\u6570\uFF1A"),h.a.createElement("span",{style:We},"\u884C\u6570"),h.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},h.a.createElement(Ve.a,null)),h.a.createElement("span",{style:We},"\u5217\u6570"),h.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},h.a.createElement(Ve.a,null))),h.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},h.a.createElement("span",{style:We},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),h.a.createElement(U.a.Item,{name:"align"},h.a.createElement(Ke,null,h.a.createElement($e.a,{value:"default"},h.a.createElement("i",{className:"fa fa-align-justify"})),h.a.createElement($e.a,{value:"left"},h.a.createElement("i",{className:"fa fa-align-left"})),h.a.createElement($e.a,{value:"center"},h.a.createElement("i",{className:"fa fa-align-center"})),h.a.createElement($e.a,{value:"right"},h.a.createElement("i",{className:"fa fa-align-right"}))))),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(B.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},at=F("ErOA"),Je=F("7Cbv"),Xe="link",He="upload-image",ot="code-block",ft="add-table",dt="------------",lt={default:dt,left:":".concat(dt),center:":".concat(dt,":"),right:"".concat(dt,":")},_t=F("9VGf"),ht,be;function _e(){}var Ne=0,ke=1e4,Ee="\u2581",Ie=`
**\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 pe(ce){return/^\d+$/.test(ce)?"".concat(ce,"px"):ce}var ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,ie=ae?"Cmd":"Ctrl",Q=["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(k.a)(ht,ie+"-B","bold"),Object(k.a)(ht,ie+"-I","italic"),ht),te=(be={},Object(k.a)(be,Xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(k.a)(be,ot,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(k.a)(be,He,"\u6DFB\u52A0\u6587\u4EF6"),Object(k.a)(be,ft,"\u6DFB\u52A0\u8868\u683C"),be),se=ye.a=function(ce){var Se=ce.defaultValue,je=Se===void 0?"":Se,Ze=ce.onChange,ut=ce.width,it=ut===void 0?"100%":ut,rt=ce.height,Me=rt===void 0?400:rt,Ue=ce.miniToolbar,we=Ue===void 0?!1:Ue,ee=ce.isFocus,he=ee===void 0?!1:ee,Fe=ce.watch,Re=ce.insertTemp,et=ce.mode,tt=et===void 0?"markdown":et,Te=ce.id,Ae=Te===void 0?"markdown-editor-id":Te,Qe=ce.showResizeBar,Et=Qe===void 0?!1:Qe,vt=ce.noStorage,cn=vt===void 0?!1:vt,yn=ce.showNullButton,ln=yn===void 0?!1:yn,bt=ce.hidetoolBar,Rn=bt===void 0?!1:bt,zn=ce.fullScreen,Tn=zn===void 0?!1:zn,zt=ce.onBlur,Sn=ce.onCMBeforeChange,Bn=ce.onFullScreen,pr=ce.className,nt=pr===void 0?"":pr,ct=ce.disablePaste,qn=ct===void 0?!1:ct,xr=ce.placeholder,mr=xr===void 0?"":xr,Ur=ce.values,Un=Ur===void 0?"":Ur,Lt=Object(g.useState)(null),Pe=Object(j.a)(Lt,2),Ce=Pe[0],It=Pe[1],Kt=Object(g.useState)(je),vn=Object(j.a)(Kt,2),fn=vn[0],rn=vn[1],Gt=Object(g.useState)(Fe),Dt=Object(j.a)(Gt,2),Pt=Dt[0],Ft=Dt[1],Mt=Object(g.useState)(Tn),qt=Object(j.a)(Mt,2),gt=qt[0],un=qt[1],Qt=Object(g.useState)(""),Ln=Object(j.a)(Qt,2),kt=Ln[0],In=Ln[1],Nn=Object(g.useState)(0),wn=Object(j.a)(Nn,2),bn=wn[0],An=wn[1],nr=Object(g.useState)(Me),lr=Object(j.a)(nr,2),Xn=lr[0],xn=lr[1],ur=Object(g.useState)(!1),dn=Object(j.a)(ur,2),hn=dn[0],pn=dn[1],Xt=Object(g.useRef)(Object(Je.a)()),St=Object(g.useRef)(!1),jt=Object(g.useRef)(),xt=Object(g.useRef)(),en=Object(g.useRef)(),Ut=Object(g.useRef)(),rr=Object(g.useRef)(),Mn=function(){var wt=Object(R.a)(D.a.mark(function Wt(){var At,Vt;return D.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,Object(at.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:Vt=_n.sent,Vt!=null&&(At=Vt.attachments)!==null&&At!==void 0&&At.length&&(console.log("cm:",Ce,xt),Vt.attachments.map(function(tn){tn.content_type.indexOf("image")>-1?Ce.replaceSelection("![,](/api/attachments/".concat(tn.id,"?type=").concat(tn.content_type,")")):tn.content_type.indexOf("video")>-1?Ce.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):tn.content_type.indexOf("pdf")>-1?Ce.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(tn.id,"?type=").concat(tn.content_type,'&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Ce.replaceSelection("[".concat(tn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(tn.id,"?type=").concat(tn.content_type,")"))}));case 4:case"end":return _n.stop()}},Wt)}));return function(){return wt.apply(this,arguments)}}();Object(g.useEffect)(function(){rn(Un),Ce==null||Ce.setValue(Un)},[Un]),Object(g.useEffect)(function(){Bn==null||Bn(gt)},[gt]),Object(g.useEffect)(function(){if(xt.current){var wt=d.a.fromTextArea(xt.current,{mode:tt,lineNumbers:!we,lineWrapping:!0,value:je,autoCloseTags:!0,autoCloseBrackets:!0});he&&wt.focus();function Wt(At,Vt){if(qn){Vt.preventDefault();return}var $t=Vt.clipboardData;if($t){var _n=$t.types.toString(),tn=$t.items;if(_n==="Files"||$t.types.indexOf("Files")>-1){if(Vt.preventDefault(),tt=="stex")return;try{var Pn,er=tn[1];((Pn=tn[0])===null||Pn===void 0?void 0:Pn.kind)==="file"&&(er=tn[0]);var Yt=er.getAsFile(),vr=Yt.name.split(".").pop();xe(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?wt.replaceSelection("![,](/api/attachments/".concat(mn.id,"?type=").concat(mn.content_type,")")):(Yt==null||((Yn=Yt.type)===null||Yn===void 0)?void 0:Yn.indexOf("video"))>-1?wt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(Yt==null||((cr=Yt.type)===null||cr===void 0)?void 0:cr.indexOf("pdf"))>-1?wt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(Yt.type,'&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):Q.includes(vr)?wt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):wt.replaceSelection("[".concat(Yt.name,"](").concat(c.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){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return wt.on("paste",Wt),wt.on("dragleave",function(At,Vt){en.current.classList.remove("mouse-hover-md")}),wt.on("dragover",function(At,Vt){en.current.classList.add("mouse-hover-md")}),wt.on("drop",function(At,Vt){en.current.classList.add("mouse-hover-md");var $t;if($t=Vt.dataTransfer.files,$t.length>0){Vt.preventDefault(),Vt.stopPropagation();for(var _n=function(er){var Yt=$t[er],vr=Yt.name.split(".").pop();xe(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?wt.replaceSelection("![,](/api/attachments/".concat(mn.id,"?type=").concat(mn.content_type,")")):(Yt==null||((Yn=Yt.type)===null||Yn===void 0)?void 0:Yn.indexOf("video"))>-1?wt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(mn.id,'"></video>')):(Yt==null||((cr=Yt.type)===null||cr===void 0)?void 0:cr.indexOf("pdf"))>-1?wt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(mn.id,"?type=").concat(Yt.type,'&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):Q.includes(vr)?wt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(mn.id,'?type=office&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):wt.replaceSelection("[".concat(Yt.name,"](").concat(c.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++)_n(tn)}}),It(wt),function(){wt.off("paste",Wt)}}},[]);var dr=Object(g.useCallback)(function(){if(en.current)try{}catch(wt){console.log(wt,"---- to set md editor body height")}},[Xn,en,gt]);Object(g.useEffect)(function(){function wt(){var At=new s.default(function(Vt){var $t=Object(L.a)(Vt),_n;try{for($t.s();!(_n=$t.n()).done;){var tn=_n.value;(tn.target.offsetHeight>0||tn.target.offsetWidth>0)&&(dr(),Ce.setSize("100%","100%"),Ce.refresh())}}catch(Pn){$t.e(Pn)}finally{$t.f()}});return At.observe(xt.current.parentElement),At}if(Ce){var Wt=wt();return function(){Wt.unobserve(xt.current.parentElement)}}},[Ce,dr]),Object(g.useEffect)(function(){if(Ce){for(var wt=[],Wt=function(){var tn=Vt[At];$t=Object(j.a)(tn,2);var Pn=$t[0],er=$t[1],Yt=Object(k.a)({},Pn,function(){Qr(er)});wt.push(Yt),Ce.addKeyMap(Yt)},At=0,Vt=Object.entries(q);At<Vt.length;At++){var $t;Wt()}return jt.current=setInterval(function(){St.current&&Mn()},4e3),function(){clearInterval(jt.current);var _n=Object(L.a)(wt),tn;try{for(_n.s();!(tn=_n.n()).done;){var Pn=tn.value;Ce.removeKeyMap(Pn)}}catch(er){_n.e(er)}finally{_n.f()}}}},[Ce]),Object(g.useEffect)(function(){Tn!==gt&&un(Tn)},[Tn]),Object(_t.a)(function(){if(!cn&&bn>0){var wt=new Date().getTime(),Wt=window.sessionStorage.getItem(Ae);wt>=bn+ke&&(!Wt||Wt!==fn)&&(window.sessionStorage.setItem(Ae,fn),pn(!0))}},ke),Object(g.useEffect)(function(){Ft(Fe)},[Ce,Fe]),Object(g.useEffect)(function(){Ce&&(he&&Ce.focus())},[Ce,he]),Object(g.useEffect)(function(){if(Pt&&Ce){var wt=Ce.getScrollerElement();function Wt(At){var Vt=At.target;if(rr.current){var $t=Vt.scrollTop/Vt.scrollHeight;rr.current.scrollTop=rr.current.scrollHeight*$t}}return wt.addEventListener("scroll",Wt),function(){wt.removeEventListener("scroll",Wt)}}},[Ce,Pt]),Object(g.useEffect)(function(){if(Ce&&Sn){function wt(Wt,At){Sn(Wt,At)}return Ce.on("beforeChange",wt),function(){Ce.off("beforeChange",wt)}}},[Ce,Sn]),Object(g.useEffect)(function(){if(Ce&&zt){function wt(){zt(Ce.getValue())}return Ce.on("blur",wt),function(){Ce.off("blur",wt)}}},[Ce,zt]),Object(g.useEffect)(function(){if(Ce){function wt(Wt){var At=Wt.getValue();rn(At),An(new Date().getTime()),Wt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ze&&Ze(At)}return Ce.on("change",wt),function(){Ce.off("change",wt)}}},[Ce,Ze]),Object(g.useEffect)(function(){Ce&&(je==null?(Ce.setValue(""),rn("")):je!==Ce.getValue()&&(Ce.setValue(je),rn(je),Ce.setCursor(Ce.lineCount(),0)))},[Ce,je]);var Qr=Object(g.useCallback)(function(wt){var Wt=Ce.getCursor(),At=Ce.getSelection(),Vt=At.split(`
`);switch(wt){case"bold":return Ce.replaceSelection("**"+At+"**"),At===""&&Ce.setCursor(Wt.line,Wt.ch+2),Ce.focus();case"italic":return Ce.replaceSelection("*"+At+"*"),At===""&&Ce.setCursor(Wt.line,Wt.ch+1),Ce.focus();case"code":return Ce.replaceSelection("`"+At+"`"),At===""&&Ce.setCursor(Wt.line,Wt.ch+1),Ce.focus();case"inline-latex":return Ce.replaceSelection("`$$"+At+"$$`"),At===""&&Ce.setCursor(Wt.line,Wt.ch+3),Ce.focus();case"latex":return Ce.replaceSelection("```latex\n"+At+"\n```"),Ce.setCursor(Wt.line+1,At.length+1),Ce.focus();case"line-break":return Ce.replaceSelection(`<br/>
`),Ce.focus();case"list-ul":return At===""?Ce.replaceSelection("- "+At):Ce.replaceSelection(Vt.map(function($t){return $t===""?"":"- ".concat($t)}).join(`
`)),Ce.focus();case"list-ol":return At===""?Ce.replaceSelection("1. "+At):Ce.replaceSelection(Vt.map(function($t,_n){return $t===""?"":"".concat(_n+1,". ").concat($t)}).join(`
`)),Ce.focus();case"add-null-ch":return At===""&&Ce.setCursor(Wt.line,Wt.ch+1),Ce.replaceSelection(Ee),Ce.focus();case"inster-template-1":return At===""&&Ce.setCursor(Wt.line,Wt.ch),Ce.replaceSelection(Ie),Ce.focus();case"eraser":return Ce.setValue(""),Ce.focus();case"trigger-watch":return Ft(!Pt),Ce.focus();case"trigger-full-screen":return un(!gt),Ce.focus();case Xe:In(Xe);return;case ot:In(ot);return;case He:In(He);return;case ft:In(ft);return;default:throw new Error}},[Ce,Pt,gt]),Ir=Object(g.useCallback)(function(wt){In("");switch(kt){case Xe:var Wt=wt.title,At=wt.link;return Ce.replaceSelection("[".concat(Wt,"](").concat(At,")")),Ce.focus();case ot:var Vt=wt.language,$t=wt.content;return Ce.replaceSelection(["```"+Vt,$t,"```"].join(`
`)),Ce.focus();case He:var _n=wt.src,tn=wt.alt;return tn?Ce.replaceSelection("![ ".concat(tn," ]( ").concat(_n,' "').concat(tn,'" )')):Ce.replaceSelection("![,](".concat(_n,")")),Ce.focus();case ft:for(var Pn=wt.row,er=wt.col,Yt=wt.align,vr=`
`,mn=0;mn<Pn;mn++){for(var Vn=[],Yn=[],cr=0;cr<er;cr++)mn===1&&Yn.push(lt[Yt]),Vn.push(" ");mn===1&&(vr+="| ".concat(Yn.join(" | "),` |
`)),vr+="| ".concat(Vn.join(er===1?"":" | "),` |
`)}return Ce.replaceSelection(vr+`
`),Ce.focus();default:throw new Error}},[Ce,kt]),Gr=Object(g.useMemo)(function(){switch(kt){case Xe:return h.a.createElement(J,{callback:Ir,onCancel:Mr});case ot:return h.a.createElement(ne.b,{callback:Ir,onCancel:Mr});case He:return h.a.createElement(re,{callback:Ir,onCancel:Mr});case ft:return h.a.createElement(ze,{callback:Ir,onCancel:Mr});default:return null}},[kt]);function Mr(){In("")}Object(g.useEffect)(function(){if(Ut.current){var wt=Ut.current,Wt=!1,At=0;function Vt(tn){Wt=!0,At=tn.pageY}function $t(){Wt=!1}function _n(tn){if(Wt){var Pn=tn.pageY-At;Pn<0&&(Pn=0),Pn>300&&(Pn=300);var er=Me+Pn+"px";xn(er)}}return wt.addEventListener("mousedown",Vt),document.addEventListener("mousemove",_n),document.addEventListener("mouseup",$t),function(){wt.removeEventListener("mousedown",Vt),document.removeEventListener("mousemove",_n),document.removeEventListener("mouseup",$t)}}},[Ce,Ut]),Object(g.useEffect)(function(){xn(Me)},[Me]);var Or=pe(it),Br=pe(Xn),Fn={width:Or,height:Br},Rt=Object(g.useMemo)(function(){if(bn){var wt=new Date(bn),Wt=wt.getHours(),At=wt.getMinutes(),Vt=wt.getSeconds();return Wt=Wt<10?"0"+Wt:Wt,At=At<10?"0"+At:At,Vt=Vt<10?"0"+Vt:Vt,"".concat(Wt,":").concat(At,":").concat(Vt)}return 0},[bn]);function zr(){window.sessionStorage.removeItem(Ae),pn(!1),An(0)}function gr(){pn(!1),An(0),Ce.setValue(window.sessionStorage.getItem(Ae))}function ni(wt,Wt){var At=Ce.getValue();At=At.replace(wt,Wt),rn(At),Ce==null||Ce.setValue(At)}return h.a.createElement(g.Fragment,null,h.a.createElement("div",{className:"markdown-editor-wrapper",ref:en},h.a.createElement("div",{className:"markdown-editor-container ".concat(nt," ").concat(Pt?"on-preview":""," ").concat(we?"mini":""," ").concat(gt?"full-screen":""),style:Fn},h.a.createElement(b,{insertTemp:Re,watch:Pt,fullScreen:gt,showNullButton:ln,onActionCallback:Qr,hidetoolBar:Rn,uuid:Xt.current,setOpenPhones:function(){St.current=!0}}),h.a.createElement("div",{className:"markdown-editor-body"},h.a.createElement("div",{className:"codemirror-container"},h.a.createElement("textarea",{ref:xt,placeholder:mr})),Pt?h.a.createElement("div",{ref:rr,className:"preview-container"},tt==="stex"&&h.a.createElement(w,{value:fn}),tt!=="stex"&&h.a.createElement(x.a,{edit:!0,value:fn,replaces:ni})):null))),Et?h.a.createElement("a",{ref:Ut,className:"editor-resize"}):null,h.a.createElement(I.a,null,te[kt]?h.a.createElement(K.a,{centered:!0,title:te[kt],visible:!0,onCancel:Mr,footer:null,className:"markdown-popup-form"},Gr):null))}},PD8m:function(Le,ye){Le.exports={name:"memoryStorage",read:Y,write:K,each:L,remove:H,clearAll:N};var F={};function Y(R){return F[R]}function K(R,j){F[R]=j}function L(R){for(var j in F)F.hasOwnProperty(j)&&R(F[j],j)}function H(R){delete F[R]}function N(R){F={}}},QUZ3:function(Le,ye,F){"use strict";F.r(ye);var Y=F("0Owb"),K=F("PpiC"),L=F("OaEy"),H=F("2fM7"),N=F("T2oS"),R=F("W9HT"),j=F("+L6B"),k=F("2/Rp"),A=F("9og8"),D=F("2qtc"),g=F("kLXV"),h=F("tJVT"),u=F("k1fw"),d=F("aHsQ"),s=F("sGsY"),l=F("WmNS"),i=F.n(l),o=F("cDcd"),n=F.n(o),f=F("Icgb"),O=F("Fvcw"),S=F("GIiI"),x=F("Ty5D"),w=F("55Ip"),T=F("OJz4"),y=F("V0Rq"),v=F("bntm"),p=F("cDPC"),c=F("m3rI"),E=F("RCxd"),_=F("EHPI"),b=F("S+dL"),I=F.n(b),P=F("J66h"),B=F("uMZB"),z=F.n(B),U=F("p/48"),C=F("JPnl"),W=F("y8nQ"),V=F("Vl3Y"),J=F("5NDa"),ne=F("5rEg"),fe=ne.a.TextArea,ue=5e3,le=function(Pe){var Ce=Pe.callback,It=Pe.onCancel,Kt=Pe.notes;function vn(fn){Ce(fn)}return n.a.createElement(V.a,{className:"note-form-panel",onFinish:vn,initialValues:{notes:Kt}},n.a.createElement(V.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:ue,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(ue)}]},n.a.createElement(fe,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(V.a.Item,{style:{textAlign:"right"}},n.a.createElement(k.a,{type:"ghost",onClick:It,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(k.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},me=F("bbsP"),ge=F("/wGt"),re=F("DjyN"),oe=F("NUBc"),xe=F("H2Ag"),Be=F.n(xe),Ve=F("miYZ"),Ye=F("tsqr"),$e=F("g9YV"),Ke=F("wCAj"),We=F("+k/U"),ze=F.n(We),at=F("ye1Q"),Je=F("lfch"),Xe=F("JB8y"),He=F("p5ED"),ot=F("ErOA"),ft=F("wd/R"),dt=F.n(ft),lt=Ke.a.Column,_t=function(Pe){var Ce,It=Pe.submitResult,Kt=Pe.submitting,vn=Pe.submitRecords,fn=Pe.page,rn=Pe.onPageChange,Gt=Pe.topicId,Dt=It||{},Pt=Dt.status,Ft=Dt.id,Mt=Dt.input,qt=Dt.output,gt=Dt.expected_output,un=Dt.is_file,Qt=Dt.input_file_url,Ln=Dt.output_file_url,kt=Dt.expected_output_file_url,In=Dt.error_msg,Nn=vn||{},wn=Nn.records,bn=Nn.records_count,An=Object(o.useState)(""),nr=Object(h.a)(An,2),lr=nr[0],Xn=nr[1],xn=Object(o.useState)(""),ur=Object(h.a)(xn,2),dn=ur[0],hn=ur[1],pn=Object(x.h)(),Xt=(pn==null||((Ce=pn.query)===null||Ce===void 0)?void 0:Ce.type)==="1";function St(){un?navigator.clipboard.writeText(P.Base64.decode(In)).then(function(){Ye.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(P.Base64.decode(qt)).then(function(){Ye.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(R.a,{spinning:Kt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(at.a,{style:{fontSize:24},spin:!0})},Ft?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:ze.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:Pt===Xe.a.OK?"c-green":"c-red"},C.a[Pt])),n.a.createElement("li",{className:ze.a.error},n.a.createElement("a",{onClick:St},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(Je.a,null)," ")),n.a.createElement("li",null,n.a.createElement(w.a,{to:"/myproblems/".concat(Gt,"/record-detail/").concat(Ft)},"\u663E\u793A\u8BE6\u60C5 >"," "))),Pt!==Xe.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!un&&Mt,un&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(A.a)(i.a.mark(function jt(){var xt;return i.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,fetch(Qt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return xt=Ut.sent,Ut.t0=hn,Ut.next=6,xt.text();case 6:Ut.t1=Ut.sent,(0,Ut.t0)(Ut.t1),setTimeout(function(){Xn(Qt)},200);case 9:case"end":return Ut.stop()}},jt)}))},Mt)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(Pt===4||Pt===5)&&P.Base64.decode(In),Pt!=4&&Pt!=5&&(un?n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(A.a)(i.a.mark(function jt(){var xt;return i.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(ot.a)(Ln,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:xt=Ut.sent;try{hn(xt)}catch(rr){hn("")}setTimeout(function(){Xn(Ln)},200);case 5:case"end":return Ut.stop()}},jt)}))},qt):P.Base64.decode(qt))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!un&&P.Base64.decode(gt),un&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(A.a)(i.a.mark(function jt(){var xt;return i.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,fetch(kt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return xt=Ut.sent,Ut.t0=hn,Ut.next=6,xt.text();case 6:Ut.t1=Ut.sent,(0,Ut.t0)(Ut.t1),setTimeout(function(){Xn(kt)},200);case 9:case"end":return Ut.stop()}},jt)}))},gt))):null):null,(wn==null?void 0:wn.length)>0?n.a.createElement(Ke.a,{dataSource:wn,rowKey:"id",pagination:!1},n.a.createElement(lt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(xt,en){return n.a.createElement("span",null," ",dt()(xt).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(lt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(xt,en){var Ut;return n.a.createElement(w.a,{className:xt===0?"c-green":"c-red",to:"/myproblems/".concat(Gt,"/record-detail/").concat(en.id)},(Ut=C.a[xt])===null||Ut===void 0?void 0:Ut.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(lt,{title:"\u6267\u884C\u7528\u65F6 (".concat(Xt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(xt){return xt?Xt?xt:xt/1e3:""}}),n.a.createElement(lt,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(Xt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(xt){return xt?Xt?xt:parseFloat((xt/1024).toFixed(2)):""}}),n.a.createElement(lt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),n.a.createElement(lt,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(xt,en){return n.a.createElement(w.a,{className:"c-light-primary",to:"/myproblems/".concat(Gt,"/record-detail/").concat(en.id)},"\u67E5\u770B")}})):n.a.createElement("div",{style:{height:300,width:"100%"}}),bn>15?n.a.createElement(oe.a,{className:ze.a.pagination,current:fn,pageSize:15,total:bn,onChange:rn}):null,n.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=F("BdwD"),be=F("DYRE"),_e=F("zeV3"),Ne=F("+BJd"),ke=F("mr32"),Ee=F("pPuO"),Ie=F.n(Ee),pe=F("9Bee"),ae={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ie=function(Pe){var Ce=Pe.hack,It=Pe.onTriggerPraise,Kt=Pe.toDiscuss,vn=Ce.language,fn=Ce.difficult,rn=Ce.time_limit,Gt=Ce.username,Dt=Ce.user_path,Pt=Ce.user_praise,Ft=Ce.comments_count,Mt=Ce.praises_count,qt=Ce.description,gt=Ce.pass_count,un=Ce.submit_count,Qt=Object(x.h)(),Ln=ae[fn];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:Ie.a.info},n.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",n.a.createElement("b",null,vn)),n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(ke.a,{color:Ln.color},Ln.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,rn,"\u79D2"))),n.a.createElement(pe.a,{value:qt,className:Ie.a.desc}),n.a.createElement("ul",{className:Ie.a["commit-info"]},n.a.createElement("li",null,n.a.createElement(_e.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,gt))),n.a.createElement("li",null,n.a.createElement(_e.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,un))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),Qt.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement(_e.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Kt})," ",n.a.createElement("b",null,Ft))," ")))},Q=F("dhSg"),q=F("oBTY"),te=F("M8RZ"),se=F("qJ4+");function ce(Pe,Ce){return Object(ot.c)("/problems/".concat(Pe,"/comments.json?page=").concat(Ce,"&limit=10"))}function Se(Pe){return Object(ot.f)("/discusses/".concat(Pe,"/plus.json"),{container_type:"Discuss",type:1})}function je(Pe,Ce,It){return Object(ot.f)("/problems/".concat(Pe,"/comments/reply.json"),{comments:{content:It,parent_id:Ce}})}function Ze(Pe,Ce){return Object(ot.f)("/problems/".concat(Pe,"/comments.json"),{comments:{content:Ce}})}function ut(Pe,Ce,It){return Object(ot.f)("/problems/".concat(Pe,"/comments/").concat(Ce,"/hidden.json"),It)}function it(Pe,Ce){return Object(ot.b)("/problems/".concat(Pe,"/comments/").concat(Ce))}var rt=F("U7T7"),Me=F("AMnG");function Ue(Pe){var Ce=Pe.author;return n.a.createElement("a",{href:"/users/".concat(Ce.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(c.a.IMG_SERVER,"/images/").concat(Ce.image_url),width:"50"}))}function we(Pe){var Ce=Pe.data,It=Pe.index,Kt=Pe.parentDiscussIndex,vn=Pe.user,fn=Pe.onSetActionType,rn=Ce.author,Gt=Ce.can_delete,Dt=Ce.content,Pt=Ce.id,Ft=Ce.time;function Mt(){fn({id:Pt,index:It,type:"delete-discuss",parentDiscussIndex:Kt,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var qt=vn.admin||Gt||rn.user_id===vn.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(Ue,{author:rn}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(rn.login),target:"_blank"},rn.name),n.a.createElement("span",{className:"grey"},Ft),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},qt?n.a.createElement("a",{onClick:Mt,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(pe.a,{className:"discuss-content",value:Dt})))}var ee=function(Pe){var Ce=Pe.user,It=Pe.data,Kt=Pe.index,vn=Pe.onPlusDiscuss,fn=Pe.onSetActionType,rn=Pe.activeDiscussIndex,Gt=Pe.onReplyDiscuss,Dt=Pe.onSetActiveDiscussIndex,Pt=It.content,Ft=It.children,Mt=It.hidden,qt=It.id,gt=It.praise_count,un=It.time,Qt=It.user_praise,Ln=It.can_delete,kt=It.author;function In(){Dt(qt)}function Nn(){vn(qt,!Qt,Kt)}function wn(){fn({id:qt,index:Kt,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function bn(){fn({id:qt,index:Kt,params:{hidden:Mt?"0":"1"},type:"hidden-discuss",message:Mt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var An=Ce.admin||Ce.user_id===kt.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:qt},n.a.createElement(Ue,{author:kt}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(kt.login),target:"_blank"}," ",kt.name," "),n.a.createElement("span",{className:"grey"},un)),n.a.createElement(pe.a,{className:"discuss-content",value:Pt}),Ft&&Ft.length>0?n.a.createElement("div",{className:"reply-discuss-container"},Ft.map(function(nr,lr){return n.a.createElement(we,{key:nr.id,data:nr,index:lr,user:Ce,onSetActionType:fn,parentDiscussIndex:Kt})})):null,n.a.createElement("div",{className:"btn-group"},An?n.a.createElement("a",{onClick:bn,title:Mt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Mt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Ln&&(!Ft||Ft.length==0)?n.a.createElement("a",{onClick:wn,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:In,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:Nn,className:Qt?"c-orange":""},n.a.createElement("i",{className:Qt?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,gt||""))),n.a.createElement(Me.a,{id:qt,activeDiscussIndex:rn,onReplyDiscuss:Gt})))},he=F("kaH+"),Fe=F("uD2n"),Re=F.n(Fe),et=F("Ot1p"),tt=function(Pe){var Ce=Pe.user_praise,It=Pe.praise_count,Kt=Pe.praisePlus,vn=Pe.onCreateDiscuss,fn=Pe.discuss_count,rn=Object(o.useState)(!1),Gt=Object(h.a)(rn,2),Dt=Gt[0],Pt=Gt[1],Ft=Object(o.useState)(""),Mt=Object(h.a)(Ft,2),qt=Mt[0],gt=Mt[1];function un(Nn){gt(Nn)}function Qt(){Pt(!0)}function Ln(){Pt(!1)}function kt(){return In.apply(this,arguments)}function In(){return In=Object(A.a)(i.a.mark(function Nn(){return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:vn(qt),gt(""),Pt(!1);case 3:case"end":return bn.stop()}},Nn)})),In.apply(this,arguments)}return n.a.createElement("div",{className:"".concat(Re.a["dis-input-editor-container"]," ").concat(Dt?Re.a.active:""," ")},n.a.createElement("div",{className:Dt?"hide ".concat(Re.a["text-area"]):Re.a["text-area"]},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Qt}),n.a.createElement("a",null," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",fn," "),n.a.createElement("a",{className:"c-light-black",onClick:Kt,title:Ce?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(Ce?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),It?n.a.createElement("span",null,It):"")),Dt?n.a.createElement("div",{className:Re.a["input-mask"],onClick:Ln}):null,n.a.createElement("div",{className:Dt?Re.a["md-container"]:"".concat(Re.a["md-container"]," hide")},n.a.createElement(et.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:qt,height:240,onChange:un}),n.a.createElement("div",{className:Re.a["tip-container"],onClick:Ln},n.a.createElement("a",{className:Re.a["btn-send"],onClick:kt}," \u53D1\u9001 "))))},Te={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Ae;(function(Pe){Pe[Pe.GET_DISCUSSES=0]="GET_DISCUSSES",Pe[Pe.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Pe[Pe.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Pe[Pe.PLUS_DISCUSS=3]="PLUS_DISCUSS",Pe[Pe.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Pe[Pe.SET_PAGE=5]="SET_PAGE",Pe[Pe.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Ae||(Ae={}));function Qe(Pe,Ce){switch(Ce.type){case Ae.SHOW_DISCUSSES_LOADING:return Object(u.a)(Object(u.a)({},Pe),{},{loading:!0});case Ae.GET_DISCUSSES:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);case Ae.TOP_OR_DOWN_DISCUSS:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);case Ae.SET_ACTION_TYPE:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);case Ae.PLUS_DISCUSS:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);case Ae.SET_PAGE:return Object(u.a)(Object(u.a)({},Pe),{},{page:Ce.payload});case Ae.ACTIVE_DISCUSS_INDEX:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);default:throw new Error}}var Et=function(Pe){var Ce=Pe.user,It=Pe.identifier,Kt=Pe.hack,vn=Pe.onTriggerPraise,fn=Object(o.useReducer)(Qe,Te),rn=Object(h.a)(fn,2),Gt=rn[0],Dt=rn[1],Pt=Gt.loading,Ft=Gt.page,Mt=Gt.data,qt=Gt.count,gt=Gt.actionType,un=Gt.activeDiscussIndex,Qt=Object(o.useCallback)(Object(A.a)(i.a.mark(function dn(){var hn,pn,Xt;return i.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return Dt({type:Ae.SHOW_DISCUSSES_LOADING}),jt.next=3,ce(It,Ft);case 3:hn=jt.sent,pn=hn.comments,Xt=hn.disscuss_count,Dt({type:Ae.GET_DISCUSSES,payload:{data:pn,count:Xt,loading:!1}});case 6:case"end":return jt.stop()}},dn)})),[Ft,It]);Object(o.useEffect)(function(){Qt()},[It,Ft]);function Ln(dn){Dt({type:Ae.SET_PAGE,page:dn})}function kt(dn){Dt({type:Ae.SET_ACTION_TYPE,payload:{actionType:dn}})}function In(dn){un===dn?Dt({type:Ae.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):Dt({type:Ae.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:dn}})}function Nn(dn,hn,pn){return wn.apply(this,arguments)}function wn(){return wn=Object(A.a)(i.a.mark(function dn(hn,pn,Xt){var St;return i.a.wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:return xt.prev=0,xt.next=3,Se(hn);case 3:St=xt.sent,Mt[Xt].user_praise=pn,Mt[Xt].praise_count=St.praise_count,Dt({type:Ae.PLUS_DISCUSS,payload:{data:Object(q.a)(Mt)}}),xt.next=12;break;case 9:xt.prev=9,xt.t0=xt.catch(0),console.log(xt.t0);case 12:case"end":return xt.stop()}},dn,null,[[0,9]])})),wn.apply(this,arguments)}function bn(){return An.apply(this,arguments)}function An(){return An=Object(A.a)(i.a.mark(function dn(){var hn,pn,Xt,St,jt,xt,en,Ut;return i.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(hn=gt.id,pn=gt.params,Xt=gt.type,St=gt.index,jt=gt.parentDiscussIndex,!(Xt==="hidden-discuss")){Mn.next=6;break}return Mn.next=4,ut(It,hn,pn);case 4:jt?Mt[jt].children[St].hidden=pn.hidden==1:Mt[St].hidden=pn.hidden==1,Dt({type:Ae.SET_ACTION_TYPE,payload:{actionType:null,data:Object(q.a)(Mt)}});case 6:if(!(Xt==="delete-discuss")){Mn.next=31;break}return Mn.next=9,it(It,hn);case 9:if(!(jt||jt===0)){Mn.next=22;break}xt=Mt[jt].children,en=xt.length-1;case 12:if(!(en>=0)){Mn.next=19;break}if(!(xt[en].id===hn)){Mn.next=16;break}return xt.splice(en,1),Mn.abrupt("break",19);case 16:en--,Mn.next=12;break;case 19:Mt[jt].children=xt,Mn.next=30;break;case 22:Ut=Mt.length-1;case 23:if(!(Ut>=0)){Mn.next=30;break}if(!(Mt[Ut].id===hn)){Mn.next=27;break}return Mt.splice(Ut,1),Mn.abrupt("break",30);case 27:Ut--,Mn.next=23;break;case 30:Dt({type:Ae.SET_ACTION_TYPE,payload:{actionType:null,data:Object(q.a)(Mt)}});case 31:case"end":return Mn.stop()}},dn)})),An.apply(this,arguments)}function nr(){Dt({type:Ae.SET_ACTION_TYPE,payload:{actionType:null}})}function lr(dn,hn){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(A.a)(i.a.mark(function dn(hn,pn){return i.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.prev=0,St.next=3,je(It,hn,pn);case 3:Qt(),St.next=9;break;case 6:St.prev=6,St.t0=St.catch(0),console.log(St.t0);case 9:case"end":return St.stop()}},dn,null,[[0,6]])})),Xn.apply(this,arguments)}function xn(dn){return ur.apply(this,arguments)}function ur(){return ur=Object(A.a)(i.a.mark(function dn(hn){return i.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Dt({type:Ae.SHOW_DISCUSSES_LOADING}),Xt.next=3,Ze(It,hn);case 3:Qt();case 4:case"end":return Xt.stop()}},dn)})),ur.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},Mt.length===0?n.a.createElement(ht.a,null):Mt.map(function(dn,hn){return n.a.createElement(ee,{onReplyDiscuss:lr,onPlusDiscuss:Nn,onSetActiveDiscussIndex:In,onSetActionType:kt,data:dn,index:hn,user:Ce,activeDiscussIndex:un})}),qt>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(oe.a,{showQuickJumper:!0,onChange:Ln,current:Ft,total:qt})):null),n.a.createElement(tt,{user_praise:Kt.user_praise,praise_count:Kt.praises_count,praisePlus:vn,discuss_count:Kt.comments_count,onCreateDiscuss:xn}),n.a.createElement(te.a,null,n.a.createElement(g.a,{centered:!0,title:"\u63D0\u793A",visible:!!gt,onOk:bn,onCancel:nr},n.a.createElement("p",null,gt?gt.message:"")),n.a.createElement(he.a,null)))},vt=F("9kvl"),cn={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},yn={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},ln=function(Pe){var Ce,It=Pe.hack,Kt=Pe.onTriggerPraise,vn=Pe.topicId,fn=Pe.page,rn=Pe.onPageChange,Gt=Pe.user,Dt=Pe.submitRecords,Pt=Pe.submitting,Ft=Pe.submitResult,Mt=Object(o.useState)("0"),qt=Object(h.a)(Mt,2),gt=qt[0],un=qt[1],Qt=Object(x.h)(),Ln=Object(o.useState)(!1),kt=Object(h.a)(Ln,2),In=kt[0],Nn=kt[1],wn=Object(o.useState)([]),bn=Object(h.a)(wn,2),An=bn[0],nr=bn[1],lr=Object(o.useState)(Object(u.a)(Object(u.a)({},Object(x.i)()),{},{page:1,per_page:20,name:""})),Xn=Object(h.a)(lr,2),xn=Xn[0],ur=Xn[1];function dn(St){var jt=St.target.id;un(jt)}Object(o.useEffect)(function(){var St=Q.a.subscribe("to-commit-info",function(){un("1")});return St},[]);function hn(){un("2")}function pn(){return Xt.apply(this,arguments)}function Xt(){return Xt=Object(A.a)(i.a.mark(function St(){var jt;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(ot.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(u.a)({identifier:xn==null?void 0:xn.id},xn)});case 2:jt=en.sent,nr(jt);case 4:case"end":return en.stop()}},St)})),Xt.apply(this,arguments)}return console.log(Dt,"submitRecords"),n.a.createElement("div",{className:Be.a["left-panel"]},n.a.createElement("ul",{className:"".concat(Be.a["s-navs"]," ").concat(Be.a["bg-white"]," ").concat(Be.a.b1)},n.a.createElement("li",null,n.a.createElement("a",{className:gt==="0"?Be.a.active:"",id:"0",onClick:dn},"\u4EFB\u52A1\u63CF\u8FF0")),n.a.createElement("li",null,n.a.createElement("a",{className:gt==="1"?Be.a.active:"",id:"1",onClick:dn},"\u63D0\u4EA4\u8BB0\u5F55")),Qt.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement("a",{className:gt==="2"?Be.a.active:"",id:"2",onClick:dn},"\u8BC4\u8BBA"))),n.a.createElement("div",{className:"".concat(Be.a["tab-panel-body"]," ").concat(gt==="0"?"":"hide")},n.a.createElement(ie,{hack:It,onTriggerPraise:Kt,toDiscuss:hn})),n.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(Be.a["tab-panel-body"]," ").concat(gt==="1"?"":"hide")},!!(Dt!=null&&Dt.records_count)||Pt?n.a.createElement(_t,{page:fn,onPageChange:rn,topicId:vn,submitting:Pt,submitRecords:Dt,submitResult:Ft}):n.a.createElement(ht.a,null)),n.a.createElement("div",{className:"".concat(Be.a["tab-panel-body"]," ").concat(gt==="2"?"":"hide"),style:{padding:0}},n.a.createElement(Et,{user:Gt,identifier:It.identifier,hack:It,onTriggerPraise:Kt})),n.a.createElement(ge.a,{className:Be.a.drawer,headerStyle:{background:"#000",border:0},closable:!1,title:n.a.createElement("div",{style:{display:"flex",alignItems:"center"}},n.a.createElement("span",{style:{color:"#fff"}},"\u9898\u76EE\u5217\u8868"),n.a.createElement(ne.a.Search,{onSearch:function(jt){xn.name=jt,xn.page=1,ur(Object(u.a)({},xn)),pn()},style:{width:180,margin:"0px 20px",marginLeft:"auto"},placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22"}),n.a.createElement(H.a,{style:{width:100},placeholder:"\u8BF7\u9009\u62E9\u96BE\u5EA6",onChange:function(jt){xn.page=1,xn.difficult=jt||null,ur(Object(u.a)({},xn)),pn()}},n.a.createElement(H.a.Option,{value:0},"\u5168\u90E8"),n.a.createElement(H.a.Option,{value:1},"\u7B80\u5355"),n.a.createElement(H.a.Option,{value:2},"\u9002\u4E2D"),n.a.createElement(H.a.Option,{value:3},"\u56F0\u96BE"))),bodyStyle:{background:"#0f1e31",padding:"20px 0px"},footerStyle:{background:"#0f1e31",border:0,textAlign:"center"},footer:n.a.createElement("div",null,n.a.createElement(oe.a,{current:xn.page,className:"mt10 mb10",hideOnSinglePage:!0,total:An==null?void 0:An.count,pageSize:xn.per_page,onChange:function(jt,xt){xn.page=jt,xn.per_page=xt,pn()}})),width:530,placement:"left",onClose:function(){return Nn(!1)},visible:In},An==null||((Ce=An.data)===null||Ce===void 0)?void 0:Ce.map(function(St,jt){return n.a.createElement("div",{onClick:Object(A.a)(i.a.mark(function xt(){var en;return i.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return rr.next=2,Object(ot.a)("/api/problems/".concat(St==null?void 0:St.identifier,"/start.json"),{method:"get",params:{hack_user_id:Gt==null?void 0:Gt.user_id}});case 2:en=rr.sent,en&&(vt.d.replace("/myproblems/".concat(en==null?void 0:en.identifier,"?type=1")),window.location.reload());case 4:case"end":return rr.stop()}},xt)})),className:"".concat(Be.a.list," ").concat(St!=null&&St.checked?Be.a.active:"")},n.a.createElement("div",null,(St==null?void 0:St.opened)&&(St==null?void 0:St.passed)&&n.a.createElement("i",{className:"iconfont icon-wancheng1 c-green-29b"}),(St==null?void 0:St.opened)&&!(St!=null&&St.passed)&&n.a.createElement("i",{className:"iconfont icon-cuowu c-red"}),n.a.createElement("span",{style:{color:"rgb(186, 196, 205)",fontWeight:400,fontSize:14,marginLeft:10}},St.name)),n.a.createElement("span",{style:{color:yn[St.difficult]}},cn[St.difficult]))})),(It==null?void 0:It.is_program)&&n.a.createElement("div",{onClick:function(){pn(),Nn(!0)},className:Be.a.btns},n.a.createElement("i",{className:"iconfont icon-timuliebiao"}),n.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},bt=F("oFv4"),Rn=F.n(bt),zn=F("+aKw"),Tn=F("S/kP"),zt=F.n(Tn),Sn=F("t/PP"),Bn=F.n(Sn),pr=s.a.Countdown,nt={Java:"java",C:"c",Python:"py","C++":"c"},ct;(function(Pe){Pe[Pe.SET_LOADING=0]="SET_LOADING",Pe[Pe.GET_DATA=1]="GET_DATA",Pe[Pe.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",Pe[Pe.SET_DATA=3]="SET_DATA",Pe[Pe.SET_DEBUGING=4]="SET_DEBUGING",Pe[Pe.SET_SUBMITING=5]="SET_SUBMITING",Pe[Pe.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",Pe[Pe.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",Pe[Pe.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",Pe[Pe.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",Pe[Pe.SET_PAGE=10]="SET_PAGE"})(ct||(ct={}));function qn(){return new Date().getTime()}var xr={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function mr(Pe,Ce){switch(Ce.type){case ct.GET_DATA:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);case ct.SET_DATA:return Object(u.a)(Object(u.a)({},Pe),{},{data:Ce.payload});case ct.SET_LOADING:return Object(u.a)(Object(u.a)({},Pe),{},{loading:Ce.payload});case ct.SET_SHOW_NOTE:return Object(u.a)(Object(u.a)({},Pe),{},{showNote:Ce.payload});case ct.SET_DEBUGING:return Object(u.a)(Object(u.a)({},Pe),{},{debuging:Ce.payload});case ct.SET_SUBMITING:return Object(u.a)(Object(u.a)({},Pe),{},{submitting:Ce.payload});case ct.GET_SUBMIT_RECORDS:return Object(u.a)(Object(u.a)({},Pe),{},{submitRecords:Ce.payload});case ct.SET_PAGE:return Object(u.a)(Object(u.a)({},Pe),{},{submitRecordPage:Ce.payload});case ct.SET_EXECUTE_MESSAGE:return Object(u.a)(Object(u.a)({},Pe),{},{executingMessage:Ce.payload});case ct.SET_EXECUTE_RESULT:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);case ct.SET_SUBMIT_RESULT:return Object(u.a)(Object(u.a)({},Pe),Ce.payload);default:throw new Error}}var Ur=ye.default=function(Pe){var Ce,It,Kt,vn,fn=Pe.children,rn=Object(o.useReducer)(mr,xr),Gt=Object(h.a)(rn,2),Dt=Gt[0],Pt=Gt[1],Ft=Object(x.i)(),Mt=Ft.id,qt=Object(x.g)(),gt=Object(x.h)(),un=Dt.loading,Qt=Dt.data,Ln=Dt.debugResult,kt=Dt.submitResult,In=Dt.submitRecords,Nn=Dt.submitRecordPage,wn=Dt.showNote,bn=Dt.debuging,An=Dt.submitting,nr=Dt.executingMessage,lr=Object(o.useState)("#FFF"),Xn=Object(h.a)(lr,2),xn=Xn[0],ur=Xn[1],dn=Object(o.useState)(null),hn=Object(h.a)(dn,2),pn=hn[0],Xt=hn[1],St=Object(o.useState)({}),jt=Object(h.a)(St,2),xt=jt[0],en=jt[1],Ut=Object(o.useState)(!0),rr=Object(h.a)(Ut,2),Mn=rr[0],dr=rr[1],Qr=Object(o.useState)(!1),Ir=Object(h.a)(Qr,2),Gr=Ir[0],Mr=Ir[1],Or=Object(o.useRef)(null),Br=Object(o.useRef)(0),Fn=Qt==null?void 0:Qt.user,Rt=Qt==null?void 0:Qt.hack,zr=Object(o.useRef)(),gr=Object(o.useRef)();Object(o.useEffect)(function(){var Zt;if(clearTimeout(zr.current),clearTimeout(gr.current),xt!=null&&(Zt=xt.exercise)!==null&&Zt!==void 0&&Zt.left_time){var Ct,Jt;if((xt==null||((Ct=xt.exercise)===null||Ct===void 0)?void 0:Ct.left_time)>1800){var yt;gr.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:n.a.createElement(f.a,null),okText:"\u77E5\u9053\u4E86"})},((xt==null||((yt=xt.exercise)===null||yt===void 0)?void 0:yt.left_time)-1800)*1e3)}if((xt==null||((Jt=xt.exercise)===null||Jt===void 0)?void 0:Jt.left_time)>900){var on;zr.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:n.a.createElement(f.a,null),okText:"\u77E5\u9053\u4E86"})},((xt==null||((on=xt.exercise)===null||on===void 0)?void 0:on.left_time)-900)*1e3)}}},[xt]),Object(o.useEffect)(function(){function Zt(){return Ct.apply(this,arguments)}function Ct(){return Ct=Object(A.a)(i.a.mark(function Jt(){var yt,on,Cn,Hn,_r,yr,Bt,Wr,Xr,wr,Kn,$n;return i.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return dr(!0),Jn.next=3,Object(T.d)(Mt);case 3:if(yt=Jn.sent,setTimeout(function(){dr(!1)},800),yt.status===401)document.location.href="/user/login";else{try{yt.hack.code=P.Base64.decode(yt.hack.code)}catch(Kr){console.log(Kr)}yt.hack=Object(u.a)(Object(u.a)({},yt.hack),{},{is_program:(gt==null||((on=gt.query)===null||on===void 0)?void 0:on.type)==="1"}),Pt({type:ct.GET_DATA,payload:{loading:!1,data:yt}})}if(!(gt.query.type==="exercises")){Jn.next=18;break}if(!(gt.query.coursesId=="coursesId")){Jn.next=13;break}return Jn.next=10,Object(y.Y)({categoryId:gt.query.exercisesId,login:gt.query.login});case 10:yr=Jn.sent,Jn.next=16;break;case 13:return Jn.next=15,Object(y.z)({categoryId:gt.query.exercisesId,login:gt.query.login});case 15:yr=Jn.sent;case 16:en(Object(u.a)({},yr)),(Cn=yr)!==null&&Cn!==void 0&&Cn.left_banner_id&&(Hn=yr)!==null&&Hn!==void 0&&(_r=Hn.exercise)!==null&&_r!==void 0&&_r.left_time&&(Xt(Date.now()+((Bt=yr)===null||Bt===void 0||((Wr=Bt.exercise)===null||Wr===void 0)?void 0:Wr.left_time)*1e3),setTimeout(function(){ur("red")},(((Xr=yr)===null||Xr===void 0||((wr=Xr.exercise)===null||wr===void 0)?void 0:wr.left_time)-300>0?((Kn=yr)===null||Kn===void 0||(($n=Kn.exercise)===null||$n===void 0)?void 0:$n.left_time)-300:0)*1e3));case 18:case"end":return Jn.stop()}},Jt)})),Ct.apply(this,arguments)}Mt&&Zt()},[Mt]),Object(o.useEffect)(function(){return gt.query.type==="exercises"&&(window.addEventListener(Object(v.c)(),wt),window.focus(),window.onblur=function(){Object(v.a)()&&Object(v.b)()}),function(){document.removeEventListener(Object(v.c)(),wt)}},[Mt]),Object(o.useEffect)(function(){Mt&&Rt!==null&&Rt!==void 0&&Rt.language&&Wt()},[Mt,Nn,Rt==null?void 0:Rt.language]),Object(o.useEffect)(function(){return Rt!=null&&Rt.is_program&&(Br.current=0,Or.current=setInterval(function(){ni()},15e3)),function(){clearInterval(Or.current)}},[Rt==null?void 0:Rt.is_program]);var ni=function(){var Zt=Object(A.a)(i.a.mark(function Ct(){var Jt;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(ot.a)("/api/myproblems/".concat(Mt,"/save_long_time.json"),{method:"get",params:{answer_long_time:Br.current}});case 2:Jt=on.sent;case 3:case"end":return on.stop()}},Ct)}));return function(){return Zt.apply(this,arguments)}}(),wt=function(){window.parent.postMessage("backExercise","*")};function Wt(){return At.apply(this,arguments)}function At(){return At=Object(A.a)(i.a.mark(function Zt(){var Ct;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.prev=0,yt.next=3,Object(T.f)(Mt,{limit:15,page:Nn,language:Rt==null?void 0:Rt.language});case 3:Ct=yt.sent,Pt({type:ct.GET_SUBMIT_RECORDS,payload:Ct}),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()}},Zt,null,[[0,7]])})),At.apply(this,arguments)}function Vt(Zt){Pt({type:ct.SET_PAGE,payload:Zt})}function $t(){return _n.apply(this,arguments)}function _n(){return _n=Object(A.a)(i.a.mark(function Zt(){var Ct;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(T.k)(Mt,{code:P.Base64.encode(Rt.code),language:Rt==null?void 0:Rt.language});case 2:return Ct=yt.sent,yt.abrupt("return",Ct);case 4:case"end":return yt.stop()}},Zt)})),_n.apply(this,arguments)}function tn(){return Pn.apply(this,arguments)}function Pn(){return Pn=Object(A.a)(i.a.mark(function Zt(){var Ct,Jt,yt,on,Cn,Hn,_r;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(!An){Bt.next=2;break}return Bt.abrupt("return");case 2:return Pt({type:ct.SET_SUBMITING,payload:!0}),Bt.prev=3,Q.a.publish("to-commit-info"),Bt.next=7,$t();case 7:if(Ct=Bt.sent,console.log(Ct,1),!(Ct.status===0)){Bt.next=23;break}return _r=function(){return _r=Object(A.a)(i.a.mark(function Xr(){var wr,Kn,$n,Hr,Jn,Kr,Hi;return i.a.wrap(function(Pr){for(;;)switch(Pr.prev=Pr.next){case 0:return Pr.next=2,Object(T.c)(Mt,"submit");case 2:if(wr=Pr.sent,Kn=wr.status,$n=wr.data,Hr=qn(),Jn=Hr-Cn>(on+3)*1e3,Kn!==0&&!Jn&&setTimeout(Hn,1e3),!Jn){Pr.next=12;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Pt({type:ct.SET_SUBMITING,payload:!1}),Pr.abrupt("return");case 12:if(!(Kn===0)){Pr.next=19;break}return $n.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),($n==null?void 0:$n.status)===0&&(gt==null||((Kr=gt.query)===null||Kr===void 0)?void 0:Kr.type)==="1"&&Mr(!0),Pr.next=17,Object(T.f)(Mt,{limit:15,page:Nn,language:Rt==null?void 0:Rt.language});case 17:Hi=Pr.sent,Pt({type:ct.SET_SUBMIT_RESULT,payload:Object(u.a)(Object(u.a)({},Dt),{},{submitResult:$n,submitting:!1,submitRecords:Hi})});case 19:case"end":return Pr.stop()}},Xr)})),_r.apply(this,arguments)},Hn=function(){return _r.apply(this,arguments)},Jt={},gt.query.type==="exercises"&&(Jt.extras={exercise_id:gt.query.exercisesId,question_id:gt.query.questionId}),Bt.next=16,Object(T.h)(Mt,Jt);case 16:if(yt=Bt.sent,!(yt.status===-1)){Bt.next=20;break}return window.parent.location.href="/classrooms/".concat(gt.query.coursesId,"/exercise/").concat(gt.query.exercisesId,"/detail"),Bt.abrupt("return");case 20:on=Rt.time_limit,Cn=qn(),Hn();case 23:Bt.next=29;break;case 25:Bt.prev=25,Bt.t0=Bt.catch(3),console.log(Bt.t0),Pt({type:ct.SET_SUBMITING,payload:!1});case 29:case"end":return Bt.stop()}},Zt,null,[[3,25]])})),Pn.apply(this,arguments)}function er(){return Yt.apply(this,arguments)}function Yt(){return Yt=Object(A.a)(i.a.mark(function Zt(){var Ct,Jt,yt,on,Cn,Hn,_r;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Dt.debuging=!0,Pt({type:ct.SET_DEBUGING,payload:!0}),Bt.prev=2,Bt.next=5,$t();case 5:if(Ct=Bt.sent,!(Ct.status===0)){Bt.next=22;break}return _r=function(){return _r=Object(A.a)(i.a.mark(function Xr(){var wr,Kn,$n,Hr,Jn,Kr;return i.a.wrap(function(Vr){for(;;)switch(Vr.prev=Vr.next){case 0:return Vr.next=2,Object(T.c)(Mt,"debug");case 2:if(wr=Vr.sent,Kn=wr.status,$n=wr.message,Hr=wr.data,Jn=qn(),Kr=Jn-Cn>(Jt+3)*1e3,Kn!==0&&!Kr&&(Pt({type:ct.SET_EXECUTE_MESSAGE,payload:$n}),setTimeout(Hn,1e3)),!Kr){Vr.next=13;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Pt({type:ct.SET_DEBUGING,payload:!1}),Vr.abrupt("return");case 13:Kn===0&&(Pt({type:ct.SET_DEBUGING,payload:!1}),Hr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Hr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Pt({type:ct.SET_EXECUTE_RESULT,payload:Object(u.a)(Object(u.a)({},Dt),{},{debugResult:Hr,debuging:!1})}));case 14:case"end":return Vr.stop()}},Xr)})),_r.apply(this,arguments)},Hn=function(){return _r.apply(this,arguments)},Jt=Rt.time_limit,yt={input:encodeURIComponent(Qt.test_case.input)},gt.query.type==="exercises"&&(yt.exercise_id=gt.query.exercisesId),Bt.next=14,Object(T.b)(Mt,yt);case 14:if(on=Bt.sent,!(on.status===-1&&gt.query.coursesId)){Bt.next=18;break}return window.parent.location.href="/classrooms/".concat(gt.query.coursesId,"/exercise/").concat(gt.query.exercisesId,"/detail"),Bt.abrupt("return");case 18:Cn=qn(),Hn(),Bt.next=23;break;case 22:Pt({type:ct.SET_DEBUGING,payload:!1});case 23:Bt.next=28;break;case 25:Bt.prev=25,Bt.t0=Bt.catch(2),console.log(Bt.t0);case 28:return Bt.prev=28,Bt.finish(28);case 30:case"end":return Bt.stop()}},Zt,null,[[2,25,28,30]])})),Yt.apply(this,arguments)}function vr(Zt){Pt({type:ct.SET_DATA,payload:Object(u.a)(Object(u.a)({},Qt),{},{hack:Object(u.a)(Object(u.a)({},Rt),{},{code:Zt})})})}var mn=function(){var Zt=Object(A.a)(i.a.mark(function Ct(Jt){var yt,on;return i.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Object(ot.a)("/api/problems/".concat(Rt==null?void 0:Rt.identifier,"/start.json"),{method:"get",params:{language:Jt==="C++"||Jt==="c++"?encodeURIComponent(Jt):Jt,hack_user_id:Fn==null?void 0:Fn.user_id}});case 2:yt=Hn.sent,yt.status!==-1&&qt.replace("/myproblems/".concat(yt==null?void 0:yt.identifier,"?type=").concat(gt==null||((on=gt.query)===null||on===void 0)?void 0:on.type));case 4:case"end":return Hn.stop()}},Ct)}));return function(Jt){return Zt.apply(this,arguments)}}();function Vn(Zt){var Ct=Zt.target.value;Pt({type:ct.SET_DATA,payload:Object(u.a)(Object(u.a)({},Qt),{},{test_case:{input:Ct}})})}function Yn(){return cr.apply(this,arguments)}function cr(){return cr=Object(A.a)(i.a.mark(function Zt(){var Ct;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.prev=0,yt.next=3,Object(T.g)(Mt);case 3:Ct=yt.sent,Ct.status===401?qt.replace("/login",{from:gt.pathname}):vr(P.Base64.decode(Ct.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()}},Zt,null,[[0,7]])})),cr.apply(this,arguments)}function Wi(){g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.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)(i.a.mark(function Ct(){var Jt;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(T.i)(Mt);case 2:Jt=on.sent,Jt.status===401?qt.replace("/login",{from:gt.pathname}):vr(P.Base64.decode(Jt.code));case 4:case"end":return on.stop()}},Ct)}))()}})}function gn(){Pt({type:ct.SET_SHOW_NOTE,payload:!0})}function an(){Pt({type:ct.SET_SHOW_NOTE,payload:!1})}function sn(Zt){return fr.apply(this,arguments)}function fr(){return fr=Object(A.a)(i.a.mark(function Zt(Ct){return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(T.a)(Mt,Ct);case 2:Pt({type:ct.GET_DATA,payload:{showNote:!1,data:Object(u.a)(Object(u.a)({},Qt),{},{hack:Object(u.a)(Object(u.a)({},Rt),{},{notes:Ct.notes})})}});case 3:case"end":return yt.stop()}},Zt)})),fr.apply(this,arguments)}var Zr={hack:Rt,isLoading:Mn,input:Qt==null||((Ce=Qt.test_case)===null||Ce===void 0)?void 0:Ce.input,language:Rt==null?void 0:Rt.language,code:Rt==null?void 0:Rt.code,title:"main."+nt[Rt==null?void 0:Rt.language],modify_code:Rt==null?void 0:Rt.modify_code,notes:Rt==null?void 0:Rt.notes,debugResult:Ln,debuging:bn,submitting:An,executingMessage:nr,onCancelNote:an,onAddNote:sn,showNote:wn,user:Fn,onShowNote:gn,onSubmitCode:tn,onChangeCode:vr,onChangeInput:Vn,onDebugCode:er,onResetCode:Yn,onSyncCode:Wi,onUpdateCode:$t,onChangeLanguage:mn};function qr(){return ri.apply(this,arguments)}function ri(){return ri=Object(A.a)(i.a.mark(function Zt(){var Ct,Jt,yt;return i.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.next=2,Object(T.j)(Rt.id,{container_type:"Hack",type:1});case 2:Ct=Cn.sent,Jt=Ct.praise_count,yt=Object(u.a)(Object(u.a)({},Qt),{},{hack:Object(u.a)(Object(u.a)({},Rt),{},{praises_count:Jt,user_praise:!Rt.user_praise})}),Pt({type:ct.SET_DATA,payload:yt});case 6:case"end":return Cn.stop()}},Zt)})),ri.apply(this,arguments)}var Ti={topicId:Mt,submitResult:kt,submitRecords:In,submitting:An,page:Nn,onPageChange:Vt,hack:Rt,user:Qt==null?void 0:Qt.user,onTriggerPraise:qr};return n.a.createElement(n.a.Fragment,null,n.a.createElement(R.a,{spinning:un,delay:500},Qt?n.a.createElement(n.a.Fragment,null,n.a.createElement("header",{className:z.a.header},gt.query.type!=="exercises"&&n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(c.a.IMG_SERVER,"/images/").concat(Fn.image_url),alt:"user",width:30}),n.a.createElement("span",null,Fn.name)),n.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},n.a.createElement("div",null,Rt.name),(Rt==null?void 0:Rt.is_program)&&n.a.createElement(zn.a,{defaultValue:Rt==null?void 0:Rt.answer_long_time,onChange:function(Ct){console.log(Ct),Br.current=Ct},className:"font12 c-grey-999"})),Fn.hack_manager?n.a.createElement(w.a,{className:z.a.btn_back,to:(gt==null||((It=gt.query)===null||It===void 0)?void 0:It.type)==="1"?"/problems/".concat(Rt.identifier,"/edit?type=1"):"/problems/".concat(Rt.identifier,"/edit"),style:{marginRight:10}}," ",n.a.createElement(O.a,null)," \u7F16\u8F91"):null,(xt==null||((Kt=xt.exercise)===null||Kt===void 0)?void 0:Kt.left_time)&&n.a.createElement(n.a.Fragment,null,n.a.createElement("span",{style:{color:xn},className:"iconfont icon-kaoshishichang mr5"}),n.a.createElement("span",{className:"c-white mr20"},n.a.createElement(pr,{valueStyle:{color:xn,fontSize:16,fontWeight:"normal"},title:n.a.createElement("span",{style:{color:xn,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:pn,onFinish:Object(A.a)(i.a.mark(function Zt(){var Ct,Jt;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(y.Z)({categoryId:gt.query.exercisesId,commit_method:2});case 2:Ct=on.sent,(Ct==null?void 0:Ct.status)===0&&($t(),g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:n.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",n.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Cn=Object(A.a)(i.a.mark(function _r(){return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:window.parent.location.href="/classrooms/".concat(gt.query.coursesId,"/exercise/").concat(gt.query.exercisesId,"/detail");case 1:case"end":return Bt.stop()}},_r)}));function Hn(){return Cn.apply(this,arguments)}return Hn}()})),(Ct==null?void 0:Ct.status)===-3&&(Jt=parseInt(Ct==null?void 0:Ct.message),Xt(Date.now()+Jt*1e3));case 5:case"end":return on.stop()}},Zt)}))}))),(gt==null||((vn=gt.query)===null||vn===void 0)?void 0:vn.type)==="exercises"?n.a.createElement(k.a,{type:"primary",onClick:function(){$t(),g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){wt()}})}},n.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," \u8FD4\u56DE\u8BD5\u5377"):n.a.createElement("span",{className:z.a.btn_back,onClick:function(){var Ct;if((gt==null||((Ct=gt.query)===null||Ct===void 0)?void 0:Ct.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")}}," ",n.a.createElement(S.a,null),"\u9000\u51FA")),n.a.createElement(R.a,{size:"large",spinning:Mn},n.a.createElement(p.a,{className:"my-problems",leftChild:n.a.createElement(ln,Ti),rightChild:n.a.createElement(Lt,Zr)}))):null,n.a.createElement(g.a,{centered:!0,closable:!1,width:680,footer:null,visible:Gr,className:"oj-modal"},n.a.createElement("section",{className:"oj-modal-content"},n.a.createElement("div",{className:"oj-modal-head"},n.a.createElement("img",{src:Rn.a,alt:""}),n.a.createElement("i",{onClick:function(){return Mr(!1)},className:"iconfont icon-guanbi1"})),n.a.createElement("aside",null,n.a.createElement("img",{className:"mr30",src:Bn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",n.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},kt==null?void 0:kt.execute_time,"ms"),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(kt==null?void 0:kt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("aside",{className:"mb50"},n.a.createElement("img",{src:zt.a,className:"mr30"}),n.a.createElement("span",{className:"oj-modal-tt"},n.a.createElement("span",null,n.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),n.a.createElement("span",{className:"c-light-primary"},kt==null?void 0:kt.execute_memory,"kb")),n.a.createElement("span",null,n.a.createElement("span",null))),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(kt==null?void 0:kt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("div",{id:"oj-modal-next",onClick:Object(A.a)(i.a.mark(function Zt(){var Ct,Jt,yt;return i.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:if(!(kt!=null&&kt.next_identifier)){Cn.next=7;break}return Cn.next=3,Object(ot.a)("/api/problems/".concat(kt==null?void 0:kt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:Fn==null?void 0:Fn.user_id}});case 3:Ct=Cn.sent,Ct&&(qt.replace("/myproblems/".concat(Ct==null?void 0:Ct.identifier,"?type=1")),window.location.reload()),Cn.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 Cn.stop()}},Zt)})),className:"oj-modal-btn"},kt!=null&&kt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function Un(Pe){var Ce,It=Pe.title,Kt=Pe.modify_code,vn=Pe.onSyncCode,fn=Pe.onShowCodeSetting,rn=Pe.onResetCode,Gt=Pe.hack,Dt=Pe.onChangeLanguage,Pt=function(){g.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(E.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(Gt,"hack"),n.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},(Gt==null?void 0:Gt.is_program)&&n.a.createElement(H.a,{className:"oj-select",value:Gt==null?void 0:Gt.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Dt},Gt==null||((Ce=Gt.all_language)===null||Ce===void 0)?void 0:Ce.map(function(Ft){return n.a.createElement(H.a.Option,{key:Ft,value:Ft},Ft)})),n.a.createElement("span",null),Kt?n.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:vn},n.a.createElement("img",{src:I.a,alt:"notice"})):null,n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:Pt},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:fn},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Lt(Pe){var Ce=Pe.input,It=Pe.showNote,Kt=Pe.onShowNote,vn=Pe.notes,fn=Pe.onCancelNote,rn=Pe.onAddNote,Gt=Pe.debugResult,Dt=Pe.language,Pt=Pe.debuging,Ft=Pe.submitting,Mt=Pe.executingMessage,qt=Pe.code,gt=Pe.onSubmitCode,un=Pe.onDebugCode,Qt=Pe.onChangeCode,Ln=Pe.onChangeInput,kt=Pe.onUpdateCode,In=Pe.user,Nn=Pe.isLoading,wn=Object(K.a)(Pe,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function bn(nr){return n.a.createElement(Un,Object(Y.a)({},wn,{onShowCodeSetting:nr}))}var An=Object(u.a)({input:Ce,debugResult:Gt,debuging:Pt,submitting:Ft,executingMessage:Mt,onDebugCode:un,onChangeCode:Qt,onSubmitCode:gt,onChangeInput:Ln,user:In},wn);return n.a.createElement("div",{className:"right-panel"},n.a.createElement(_.a,{isLoading:Nn,language:Dt,value:qt,onChange:Qt,ActionBarRender:bn}),n.a.createElement("div",{className:"note-form-area ".concat(It?"active":"")},n.a.createElement(le,{onCancel:fn,notes:vn,callback:rn})),n.a.createElement(C.b,An))}},RELg:function(Le,ye,F){var Y=F("MFOe"),K=Y.Global;Le.exports={name:"oldIE-userDataStorage",write:j,read:k,each:A,remove:D,clearAll:g};var L="storejs",H=K.document,N=d(),R=(K.navigator?K.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function j(s,l){if(R)return;var i=u(s);N(function(o){o.setAttribute(i,l),o.save(L)})}function k(s){if(R)return;var l=u(s),i=null;return N(function(o){i=o.getAttribute(l)}),i}function A(s){N(function(l){for(var i=l.XMLDocument.documentElement.attributes,o=i.length-1;o>=0;o--){var n=i[o];s(l.getAttribute(n.name),n.name)}})}function D(s){var l=u(s);N(function(i){i.removeAttribute(l),i.save(L)})}function g(){N(function(s){var l=s.XMLDocument.documentElement.attributes;s.load(L);for(var i=l.length-1;i>=0;i--)s.removeAttribute(l[i].name);s.save(L)})}var h=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function u(s){return s.replace(/^\d/,"___$&").replace(h,"___")}function d(){if(!H||!H.documentElement||!H.documentElement.addBehavior)return null;var s="script",l,i,o;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),i.close(),l=i.w.frames[0].document,o=l.createElement("div")}catch(n){o=H.createElement("div"),l=H.body}return function(n){var f=[].slice.call(arguments,0);f.unshift(o),l.appendChild(o),o.addBehavior("#default#userData"),o.load(L),n.apply(this,f),l.removeChild(o);return}}},"S+dL":function(Le,ye){Le.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(Le,ye,F){Le.exports=F.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Le,ye,F){var Y=F("wTVA"),K=F("EbDI"),L=F("ZhPi"),H=F("wkBT");function N(R){return Y(R)||K(R)||L(R)||H()}Le.exports=N,Le.exports.__esModule=!0,Le.exports.default=Le.exports},SJMd:function(Le,ye){/**
* @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 F,Y,K,L=!1,H,N;window.PR_SHOULD_USE_CONTINUATION=!0;var R,j;(function(){var k=window,A=["break,continue,do,else,for,if,return,while"],D=[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"],g=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[g,"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"],u=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[g,"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"],s="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",l=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",o=[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"],n=[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"],f=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[h,d,u,l,i,o,n,f],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",w="kwd",T="com",y="typ",v="lit",p="pun",c="pln",E="tag",_="dec",b="src",I="atn",P="atv",B="nocode",z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(Ke){for(var We=0,ze=!1,at=!1,Je=0,Xe=Ke.length;Je<Xe;++Je){var He=Ke[Je];if(He.ignoreCase)at=!0;else if(/[a-z]/i.test(He.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ze=!0,at=!1;break}}var ot={b:8,t:9,n:10,v:11,f:12,r:13};function ft(be){var _e=be.charCodeAt(0);if(_e!==92)return _e;var Ne=be.charAt(1);return _e=ot[Ne],_e||("0"<=Ne&&Ne<="7"?parseInt(be.substring(1),8):Ne==="u"||Ne==="x"?parseInt(be.substring(2),16):be.charCodeAt(1))}function dt(be){if(be<32)return(be<16?"\\x0":"\\x")+be.toString(16);var _e=String.fromCharCode(be);return _e==="\\"||_e==="-"||_e==="]"||_e==="^"?"\\"+_e:_e}function lt(be){var _e=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")),Ne=[],ke=_e[0]==="^",Ee=["["];ke&&Ee.push("^");for(var Ie=ke?1:0,pe=_e.length;Ie<pe;++Ie){var ae=_e[Ie];if(/\\[bdsw]/i.test(ae))Ee.push(ae);else{var ie=ft(ae),Q;Ie+2<pe&&_e[Ie+1]==="-"?(Q=ft(_e[Ie+2]),Ie+=2):Q=ie,Ne.push([ie,Q]),Q<65||ie>122||(Q<65||ie>90||Ne.push([Math.max(65,ie)|32,Math.min(Q,90)|32]),Q<97||ie>122||Ne.push([Math.max(97,ie)&~32,Math.min(Q,122)&~32]))}}Ne.sort(function(ce,Se){return ce[0]-Se[0]||Se[1]-ce[1]});for(var q=[],te=[],Ie=0;Ie<Ne.length;++Ie){var se=Ne[Ie];se[0]<=te[1]+1?te[1]=Math.max(te[1],se[1]):q.push(te=se)}for(var Ie=0;Ie<q.length;++Ie){var se=q[Ie];Ee.push(dt(se[0])),se[1]>se[0]&&(se[1]+1>se[0]&&Ee.push("-"),Ee.push(dt(se[1])))}return Ee.push("]"),Ee.join("")}function _t(be){for(var _e=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")),Ne=_e.length,ke=[],Ee=0,Ie=0;Ee<Ne;++Ee){var pe=_e[Ee];if(pe==="(")++Ie;else if(pe.charAt(0)==="\\"){var ae=+pe.substring(1);ae&&(ae<=Ie?ke[ae]=-1:_e[Ee]=dt(ae))}}for(var Ee=1;Ee<ke.length;++Ee)ke[Ee]===-1&&(ke[Ee]=++We);for(var Ee=0,Ie=0;Ee<Ne;++Ee){var pe=_e[Ee];if(pe==="(")++Ie,ke[Ie]||(_e[Ee]="(?:");else if(pe.charAt(0)==="\\"){var ae=+pe.substring(1);ae&&ae<=Ie&&(_e[Ee]="\\"+ke[ae])}}for(var Ee=0;Ee<Ne;++Ee)_e[Ee]==="^"&&_e[Ee+1]!=="^"&&(_e[Ee]="");if(be.ignoreCase&&ze)for(var Ee=0;Ee<Ne;++Ee){var pe=_e[Ee],ie=pe.charAt(0);pe.length>=2&&ie==="["?_e[Ee]=lt(pe):ie!=="\\"&&(_e[Ee]=pe.replace(/[a-zA-Z]/g,function(te){var se=te.charCodeAt(0);return"["+String.fromCharCode(se&~32,se|32)+"]"}))}return _e.join("")}for(var ht=[],Je=0,Xe=Ke.length;Je<Xe;++Je){var He=Ke[Je];if(He.global||He.multiline)throw new Error(""+He);ht.push("(?:"+_t(He)+")")}return new RegExp(ht.join("|"),at?"gi":"g")}function C(Ke,We){var ze=/(?:^|\s)nocode(?:\s|$)/,at=[],Je=0,Xe=[],He=0;function ot(ft){var dt=ft.nodeType;if(dt==1){if(ze.test(ft.className))return;for(var lt=ft.firstChild;lt;lt=lt.nextSibling)ot(lt);var _t=ft.nodeName.toLowerCase();(_t==="br"||_t==="li")&&(at[He]=`
`,Xe[He<<1]=Je++,Xe[He++<<1|1]=ft)}else if(dt==3||dt==4){var ht=ft.nodeValue;ht.length&&(We?ht=ht.replace(/\r\n?/g,`
`):ht=ht.replace(/[ \t\r\n]+/g," "),at[He]=ht,Xe[He<<1]=Je,Je+=ht.length,Xe[He++<<1|1]=ft)}}return ot(Ke),{sourceCode:at.join("").replace(/\n$/,""),spans:Xe}}function W(Ke,We,ze,at,Je){if(!ze)return;var Xe={sourceNode:Ke,pre:1,langExtension:null,numberLines:null,sourceCode:ze,spans:null,basePos:We,decorations:null};at(Xe),Je.push.apply(Je,Xe.decorations)}var V=/\S/;function J(Ke){for(var We=void 0,ze=Ke.firstChild;ze;ze=ze.nextSibling){var at=ze.nodeType;We=at===1?We?Ke:ze:at===3&&V.test(ze.nodeValue)?Ke:We}return We===Ke?void 0:We}function ne(Ke,We){var ze={},at;(function(){for(var He=Ke.concat(We),ot=[],ft={},dt=0,lt=He.length;dt<lt;++dt){var _t=He[dt],ht=_t[3];if(ht)for(var be=ht.length;--be>=0;)ze[ht.charAt(be)]=_t;var _e=_t[1],Ne=""+_e;ft.hasOwnProperty(Ne)||(ot.push(_e),ft[Ne]=null)}ot.push(/[\0-\uffff]/),at=U(ot)})();var Je=We.length,Xe=function(He){for(var ot=He.sourceCode,ft=He.basePos,dt=He.sourceNode,lt=[ft,c],_t=0,ht=ot.match(at)||[],be={},_e=0,Ne=ht.length;_e<Ne;++_e){var ke=ht[_e],Ee=be[ke],Ie=void 0,pe;if(typeof Ee=="string")pe=!1;else{var ae=ze[ke.charAt(0)];if(ae)Ie=ke.match(ae[1]),Ee=ae[0];else{for(var ie=0;ie<Je;++ie)if(ae=We[ie],Ie=ke.match(ae[1]),Ie){Ee=ae[0];break}Ie||(Ee=c)}pe=Ee.length>=5&&Ee.substring(0,5)==="lang-",pe&&!(Ie&&typeof Ie[1]=="string")&&(pe=!1,Ee=b),pe||(be[ke]=Ee)}var Q=_t;if(_t+=ke.length,!pe)lt.push(ft+Q,Ee);else{var q=Ie[1],te=ke.indexOf(q),se=te+q.length;Ie[2]&&(se=ke.length-Ie[2].length,te=se-q.length);var ce=Ee.substring(5);W(dt,ft+Q,ke.substring(0,te),Xe,lt),W(dt,ft+Q+te,q,oe(ce,q),lt),W(dt,ft+Q+se,ke.substring(se),Xe,lt)}}He.decorations=lt};return Xe}function fe(Ke){var We=[],ze=[];Ke.tripleQuotedStrings?We.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ke.multiLineStrings?We.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ke.verbatimStrings&&ze.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var at=Ke.hashComments;at&&(Ke.cStyleComments?(at>1?We.push([T,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([T,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ze.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([T,/^#[^\r\n]*/,null,"#"])),Ke.cStyleComments&&(ze.push([T,/^\/\/[^\r\n]*/,null]),ze.push([T,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Je=Ke.regexLiterals;if(Je){var Xe=Je>1?"":`
\r`,He=Xe?".":"[\\S\\s]",ot="/(?=[^/*"+Xe+"])(?:[^/\\x5B\\x5C"+Xe+"]|\\x5C"+He+"|\\x5B(?:[^\\x5C\\x5D"+Xe+"]|\\x5C"+He+")*(?:\\x5D|$))+/";ze.push(["lang-regex",RegExp("^"+z+"("+ot+")")])}var ft=Ke.types;ft&&ze.push([y,ft]);var dt=(""+Ke.keywords).replace(/^ | $/g,"");dt.length&&ze.push([w,new RegExp("^(?:"+dt.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([c,/^\s+/,null,` \r
\xA0`]);var lt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ke.regexLiterals&&(lt+="(?!s*/)"),ze.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[p,new RegExp(lt),null]),ne(We,ze)}var ue=fe({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function le(Ke,We,ze){for(var at=/(?:^|\s)nocode(?:\s|$)/,Je=/\r\n?|\n/,Xe=Ke.ownerDocument,He=Xe.createElement("li");Ke.firstChild;)He.appendChild(Ke.firstChild);var ot=[He];function ft(_e){var Ne=_e.nodeType;if(Ne==1&&!at.test(_e.className))if(_e.nodeName==="br")dt(_e),_e.parentNode&&_e.parentNode.removeChild(_e);else for(var ke=_e.firstChild;ke;ke=ke.nextSibling)ft(ke);else if((Ne==3||Ne==4)&&ze){var Ee=_e.nodeValue,Ie=Ee.match(Je);if(Ie){var pe=Ee.substring(0,Ie.index);_e.nodeValue=pe;var ae=Ee.substring(Ie.index+Ie[0].length);if(ae){var ie=_e.parentNode;ie.insertBefore(Xe.createTextNode(ae),_e.nextSibling)}dt(_e),pe||_e.parentNode.removeChild(_e)}}}function dt(_e){for(;!_e.nextSibling;)if(_e=_e.parentNode,!_e)return;function Ne(Ie,pe){var ae=pe?Ie.cloneNode(!1):Ie,ie=Ie.parentNode;if(ie){var Q=Ne(ie,1),q=Ie.nextSibling;Q.appendChild(ae);for(var te=q;te;te=q)q=te.nextSibling,Q.appendChild(te)}return ae}for(var ke=Ne(_e.nextSibling,0),Ee;(Ee=ke.parentNode)&&Ee.nodeType===1;)ke=Ee;ot.push(ke)}for(var lt=0;lt<ot.length;++lt)ft(ot[lt]);We===(We|0)&&ot[0].setAttribute("value",We);var _t=Xe.createElement("ol");_t.className="linenums";for(var ht=Math.max(0,We-1|0)||0,lt=0,be=ot.length;lt<be;++lt)He=ot[lt],He.className="L"+(lt+ht)%10,He.firstChild||He.appendChild(Xe.createTextNode("\xA0")),_t.appendChild(He);Ke.appendChild(_t)}function me(Ke){var We=/\bMSIE\s(\d+)/.exec(navigator.userAgent);We=We&&+We[1]<=8;var ze=/\n/g,at=Ke.sourceCode,Je=at.length,Xe=0,He=Ke.spans,ot=He.length,ft=0,dt=Ke.decorations,lt=dt.length,_t=0;dt[lt]=Je;var ht,be;for(be=ht=0;be<lt;)dt[be]!==dt[be+2]?(dt[ht++]=dt[be++],dt[ht++]=dt[be++]):be+=2;for(lt=ht,be=ht=0;be<lt;){for(var _e=dt[be],Ne=dt[be+1],ke=be+2;ke+2<=lt&&dt[ke+1]===Ne;)ke+=2;dt[ht++]=_e,dt[ht++]=Ne,be=ke}lt=dt.length=ht;var Ee=Ke.sourceNode,Ie="";Ee&&(Ie=Ee.style.display,Ee.style.display="none");try{for(var pe=null;ft<ot;){var ae=He[ft],ie=He[ft+2]||Je,Q=dt[_t+2]||Je,ke=Math.min(ie,Q),q=He[ft+1],te;if(q.nodeType!==1&&(te=at.substring(Xe,ke))){We&&(te=te.replace(ze,"\r")),q.nodeValue=te;var se=q.ownerDocument,ce=se.createElement("span");ce.className=dt[_t+1];var Se=q.parentNode;Se.replaceChild(ce,q),ce.appendChild(q),Xe<ie&&(He[ft+1]=q=se.createTextNode(at.substring(ke,ie)),Se.insertBefore(q,ce.nextSibling))}Xe=ke,Xe>=ie&&(ft+=2),Xe>=Q&&(_t+=2)}}finally{Ee&&(Ee.style.display=Ie)}}var ge={};function re(Ke,We){for(var ze=We.length;--ze>=0;){var at=We[ze];ge.hasOwnProperty(at)?k.console&&console.warn("cannot override language handler %s",at):ge[at]=Ke}}function oe(Ke,We){return Ke&&ge.hasOwnProperty(Ke)||(Ke=/^\s*</.test(We)?"default-markup":"default-code"),ge[Ke]}re(ue,["default-code"]),re(ne([],[[c,/^[^<?]+/],[_,/^<!\w[^>]*(?:>|$)/],[T,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[p,/^(?:<[%?]|[%?]>)/],["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"]),re(ne([[c,/^[\s]+/,null,` \r
`],[P,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[p,/^[=<>\/]+/],["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"]),re(ne([],[[P,/^[\s\S]+/]]),["uq.val"]),re(fe({keywords:h,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),re(fe({keywords:"null,true,false"}),["json"]),re(fe({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),re(fe({keywords:u,cStyleComments:!0}),["java"]),re(fe({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),re(fe({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),re(fe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),re(fe({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),re(fe({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),re(fe({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),re(ne([],[[x,/^[\s\S]+/]]),["regex"]);function xe(Ke){var We=Ke.langExtension;try{var ze=C(Ke.sourceNode,Ke.pre),at=ze.sourceCode;Ke.sourceCode=at,Ke.spans=ze.spans,Ke.basePos=0,oe(We,at)(Ke),me(Ke)}catch(Je){k.console&&console.log(Je&&Je.stack||Je)}}function Be(Ke,We,ze){var at=ze||!1,Je=We||null,Xe=document.createElement("div");Xe.innerHTML="<pre>"+Ke+"</pre>",Xe=Xe.firstChild,at&&le(Xe,at,!0);var He={langExtension:Je,numberLines:at,sourceNode:Xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return xe(He),Xe.innerHTML}function Ve(Ke,We){var ze=We||document.body,at=ze.ownerDocument||document;function Je(ae){return ze.getElementsByTagName(ae)}for(var Xe=[Je("pre"),Je("code"),Je("xmp")],He=[],ot=0;ot<Xe.length;++ot)for(var ft=0,dt=Xe[ot].length;ft<dt;++ft)He.push(Xe[ot][ft]);Xe=null;var lt=Date;lt.now||(lt={now:function(){return+new Date}});var _t=0,ht=/\blang(?:uage)?-([\w.]+)(?!\S)/,be=/\bprettyprint\b/,_e=/\bprettyprinted\b/,Ne=/pre|xmp/i,ke=/^code$/i,Ee=/^(?:pre|code|xmp)$/i,Ie={};function pe(){for(var ae=k.PR_SHOULD_USE_CONTINUATION?lt.now()+250:Infinity;_t<He.length&&lt.now()<ae;_t++){for(var ie=He[_t],Q=Ie,q=ie;q=q.previousSibling;){var te=q.nodeType,se=(te===7||te===8)&&q.nodeValue;if(se?!/^\??prettify\b/.test(se):te!==3||/\S/.test(q.nodeValue))break;if(se){Q={},se.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Fe,Re,et){Q[Re]=et});break}}var ce=ie.className;if((Q!==Ie||be.test(ce))&&!_e.test(ce)){for(var Se=!1,je=ie.parentNode;je;je=je.parentNode){var Ze=je.tagName;if(Ee.test(Ze)&&je.className&&be.test(je.className)){Se=!0;break}}if(!Se){ie.className+=" prettyprinted";var ut=Q.lang;if(!ut){ut=ce.match(ht);var it;!ut&&(it=J(ie))&&ke.test(it.tagName)&&(ut=it.className.match(ht)),ut&&(ut=ut[1])}var rt;if(Ne.test(ie.tagName))rt=1;else{var Me=ie.currentStyle,Ue=at.defaultView,we=Me?Me.whiteSpace:Ue&&Ue.getComputedStyle?Ue.getComputedStyle(ie,null).getPropertyValue("white-space"):0;rt=we&&we.substring(0,3)==="pre"}var ee=Q.linenums;(ee=ee==="true"||+ee)||(ee=ce.match(/\blinenums\b(?::(\d+))?/),ee=ee?ee[1]&&ee[1].length?+ee[1]:!0:!1),ee&&le(ie,ee,rt);var he={langExtension:ut,sourceNode:ie,numberLines:ee,pre:rt,sourceCode:null,basePos:null,spans:null,decorations:null};xe(he)}}}_t<He.length?k.setTimeout(pe,250):typeof Ke=="function"&&Ke()}pe()}var Ye=k.PR={createSimpleLexer:ne,registerLangHandler:re,sourceDecorator:fe,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:P,PR_COMMENT:T,PR_DECLARATION:_,PR_KEYWORD:w,PR_LITERAL:v,PR_NOCODE:B,PR_PLAIN:c,PR_PUNCTUATION:p,PR_SOURCE:b,PR_STRING:x,PR_TAG:E,PR_TYPE:y,prettyPrintOne:L?k.prettyPrintOne=Be:R=Be,prettyPrint:j=L?k.prettyPrint=Ve:j=Ve},$e=k.define;typeof $e=="function"&&$e.amd&&$e("google-code-prettify",[],function(){return Ye})})()},TXwP:function(Le,ye,F){var Y,K;(function(){var L;(function(){"use strict";var N=[,,function(A){function D(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var u=new D(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},D.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},D.prototype.has_match=function(u){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(u))return!0;return!1},D.prototype.set_indent=function(u,d){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(u){this.__items.push(u);var d=u.lastIndexOf(`
`);d!==-1?this.__character_count=u.length-d:this.__character_count+=u.length},D.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,d){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),d=d||"",u.indent_level>0&&(d=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(u,d){var s=this.__base_string_length;return d=d||0,u<0&&(s=0),s+=u*this.__indent_size,s+=d,s},g.prototype.get_indent_string=function(u,d){var s=this.__base_string;return d=d||0,u<0&&(u=0,s=""),d+=u*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,d=0,s="";this.__indent_size&&u>=this.__indent_size&&(d=Math.floor(u/this.__indent_size),u-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function h(u,d){this.__indent_cache=new g(u,d),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(u,d){return this.__indent_cache.get_indent_string(u,d)},h.prototype.get_indent_size=function(u,d){return this.__indent_cache.get_indent_size(u,d)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(u){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return u!==`
`&&(s=s.replace(/[\n]/g,u)),s},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(u,d){return u=u||0,d=d||0,this.next_line.set_indent(u,d),this.__lines.length>1?(this.current_line.set_indent(u,d),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(u){for(var d=0;d<u.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(u){for(var d=this.__lines.length;u<d;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(u,d){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(u)!==0&&l.item(-1)!==d){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},A.exports.Output=h},,,,function(A){function D(u,d){this.raw_options=g(u,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}D.prototype._get_array=function(u,d){var s=this.raw_options[u],l=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},D.prototype._get_boolean=function(u,d){var s=this.raw_options[u],l=s===void 0?!!d:!!s;return l},D.prototype._get_characters=function(u,d){var s=this.raw_options[u],l=d||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},D.prototype._get_number=function(u,d){var s=this.raw_options[u];d=parseInt(d,10),isNaN(d)&&(d=0);var l=parseInt(s,10);return isNaN(l)&&(l=d),l},D.prototype._get_selection=function(u,d,s){var l=this._get_selection_list(u,d,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[u]+"'");return l[0]},D.prototype._get_selection_list=function(u,d,s){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[d[0]],!this._is_valid_selection(s,d))throw new Error("Invalid Default Value!");var l=this._get_array(u,s);if(!this._is_valid_selection(l,d))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[u]+"'");return l},D.prototype._is_valid_selection=function(u,d){return u.length&&d.length&&!u.some(function(s){return d.indexOf(s)===-1})};function g(u,d){var s={};u=h(u);var l;for(l in u)l!==d&&(s[l]=u[l]);if(d&&u[d])for(l in u[d])s[l]=u[d][l];return s}function h(u){var d={},s;for(s in u){var l=s.replace(/-/g,"_");d[l]=u[s]}return d}A.exports.Options=D,A.exports.normalizeOpts=h,A.exports.mergeOpts=g},,function(A){var D=RegExp.prototype.hasOwnProperty("sticky");function g(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},g.prototype.peek=function(h){var u=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(u=this.__input.charAt(h)),u},g.prototype.__match=function(h,u){h.lastIndex=u;var d=h.exec(this.__input);return d&&!(D&&h.sticky)&&(d.index!==u&&(d=null)),d},g.prototype.test=function(h,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(h,u):!1},g.prototype.testChar=function(h,u){var d=this.peek(u);return h.lastIndex=0,d!==null&&h.test(d)},g.prototype.match=function(h){var u=this.__match(h,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(h,u,d){var s="",l;return h&&(l=this.match(h),l&&(s+=l[0])),u&&(l||!h)&&(s+=this.readUntil(u,d)),s},g.prototype.readUntil=function(h,u){var d="",s=this.__position;h.lastIndex=this.__position;var l=h.exec(this.__input);return l?(s=l.index,u&&(s+=l[0].length)):s=this.__input_length,d=this.__input.substring(this.__position,s),this.__position=s,d},g.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},g.prototype.get_regexp=function(h,u){var d=null,s="g";return u&&D&&(s="y"),typeof h=="string"&&h!==""?d=new RegExp(h,s):h&&(d=new RegExp(h.source,s)),d},g.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(h){var u=this.__position,d=this.readUntilAfter(h);return this.__position=u,d},g.prototype.lookBack=function(h){var u=this.__position-1;return u>=h.length&&this.__input.substring(u-h.length,u).toLowerCase()===h},A.exports.InputScanner=g},,,,,function(A){function D(g,h){g=typeof g=="string"?g:g.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+h,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)h[u[1]]=u[2],u=this.__directive_pattern.exec(g);return h},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},A.exports.Directives=D},,function(A,D,g){var h=g(16).Beautifier,u=g(17).Options;function d(s,l){var i=new h(s,l);return i.beautify()}A.exports=d,A.exports.defaultOptions=function(){return new u}},function(A,D,g){var h=g(17).Options,u=g(2).Output,d=g(8).InputScanner,s=g(13).Directives,l=new s(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,n=/\s/,f=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(w,T){this._source_text=w||"",this._options=new h(T),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(w){var T="";for(this._ch=this._input.next();this._ch;){if(T+=this._ch,this._ch==="\\")T+=this._input.next();else if(w.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return T},x.prototype.eatWhitespace=function(w){for(var T=n.test(this._input.peek()),y=0;n.test(this._input.peek());)this._ch=this._input.next(),w&&this._ch===`
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return T},x.prototype.foundNestedPseudoClass=function(){for(var w=0,T=1,y=this._input.peek(T);y;){if(y==="{")return!0;if(y==="(")w+=1;else if(y===")"){if(w===0)return!1;w-=1}else if(y===";"||y==="}")return!1;T++,y=this._input.peek(T)}return!1},x.prototype.print_string=function(w){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(w)},x.prototype.preserveSingleSpace=function(w){w&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,T=this._options.eol;T==="auto"&&(T=`
`,w&&i.test(w||"")&&(T=w.match(i)[0])),w=w.replace(o,`
`);var y=w.match(/^[\t ]*/)[0];this._output=new u(this._options,y),this._input=new d(w),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var v=0,p=!1,c=!1,E=!1,_=!1,b=!1,I=!1,P=this._ch,B=!1,z,U,C;z=this._input.read(f),U=z!=="",C=P,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),P=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(O),V=l.get_directives(W);V&&V.ignore==="start"&&(W+=l.readIgnored(this._input)),this.print_string(W),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var J=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);J.match(/[ :]$/)&&(J=this.eatString(": ").replace(/\s$/,""),this.print_string(J),this._output.space_before_token=!0),J=J.replace(/\s$/,""),J==="extend"?_=!0:J==="import"&&(b=!0),J in this.NESTED_AT_RULE?(this._nestedLevel+=1,J in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!p&&v===0&&J.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),E?(E=!1,p=this._indentLevel>=this._nestedLevel):p=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&p&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(C==="("?this._output.space_before_token=!1:C!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),C==="{"&&this._output.trim(!0),b=!1,_=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),p=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ne=0;ne<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ne++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ne])){B=!0;break}(p||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!_&&v===0?(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var fe=C==='"'||C==="'";this.preserveSingleSpace(fe||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")B=!1,v===0?(c&&(this.outdent(),c=!1),_=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),v++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),v&&(v--,this.outdent()));else{var ue=!1;this._input.lookBack("with")&&(ue=!0),this.preserveSingleSpace(U||ue),this.print_string(this._ch),c&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),I=!0):(this.eatWhitespace(),v++,this.indent())}else if(this._ch===")")v&&(v--,this.outdent()),I&&this._input.peek()===";"&&this._options.selector_separator_newline&&(I=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!c||I)&&v===0&&!b&&!_?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&v===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var le=C==='"'||C==="'";this.preserveSingleSpace(le||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&B&&this._output.add_new_line()}var me=this._output.get_code(T);return me},A.exports.Beautifier=x},function(A,D,g){var h=g(6).Options;function u(d){h.call(this,d,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<l.length;i++)l[i]!=="expand"?this.brace_style="collapse":this.brace_style=l[i]}u.prototype=new h,A.exports.Options=u}],R={};function j(A){var D=R[A];if(D!==void 0)return D.exports;var g=R[A]={exports:{}};return N[A](g,g.exports,j),g.exports}var k=j(15);L=k})();var H=L;!(Y=[],K=function(){return{css_beautify:H}}.apply(ye,Y),K!==void 0&&(Le.exports=K))})()},U7T7:function(Le,ye,F){},UZu5:function(Le,ye,F){},"VrN/":function(Le,ye,F){(function(Y,K){Le.exports=K()})(this,function(){"use strict";var Y=navigator.userAgent,K=navigator.platform,L=/gecko\/\d/i.test(Y),H=/MSIE \d/.test(Y),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Y),R=/Edge\/(\d+)/.exec(Y),j=H||N||R,k=j&&(H?document.documentMode||6:+(R||N)[1]),A=!R&&/WebKit\//.test(Y),D=A&&/Qt\/\d+\.\d+/.test(Y),g=!R&&/Chrome\//.test(Y),h=/Opera\//.test(Y),u=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Y),s=/PhantomJS/.test(Y),l=!R&&/AppleWebKit/.test(Y)&&/Mobile\/\w+/.test(Y),i=/Android/.test(Y),o=l||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Y),n=l||/Mac/.test(K),f=/\bCrOS\b/.test(Y),O=/win/i.test(K),S=h&&Y.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(h=!1,A=!0);var x=n&&(D||h&&(S==null||S<12.11)),w=L||j&&k>=9;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,t){var a=e.className,r=T(t).exec(a);if(r){var m=a.slice(r.index+r[0].length);e.className=a.slice(0,r.index)+(m?r[1]+m:"")}};function v(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function p(e,t){return v(e).appendChild(t)}function c(e,t,a,r){var m=document.createElement(e);if(a&&(m.className=a),r&&(m.style.cssText=r),typeof t=="string")m.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)m.appendChild(t[M]);return m}function E(e,t,a,r){var m=c(e,t,a,r);return m.setAttribute("role","presentation"),m}var _;document.createRange?_=function(e,t,a,r){var m=document.createRange();return m.setEnd(r||e,a),m.setStart(e,t),m}:_=function(e,t,a){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(m){return r}return r.collapse(!0),r.moveEnd("character",a),r.moveStart("character",t),r};function b(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 I(){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 P(e,t){var a=e.className;T(t).test(a)||(e.className+=(a?" ":"")+t)}function B(e,t){for(var a=e.split(" "),r=0;r<a.length;r++)a[r]&&!T(a[r]).test(t)&&(t+=" "+a[r]);return t}var z=function(e){e.select()};l?z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:j&&(z=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function C(e,t,a){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(a!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function W(e,t,a,r,m){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=r||0,G=m||0;;){var X=e.indexOf(" ",M);if(X<0||X>=t)return G+(t-M);G+=X-M,G+=a-G%a,M=X+1}}var V=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.prototype.set=function(e,t){this.f=t;var a=+new Date+e;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=a)};function J(e,t){for(var a=0;a<e.length;++a)if(e[a]==t)return a;return-1}var ne=50,fe={toString:function(){return"CodeMirror.Pass"}},ue={scroll:!1},le={origin:"*mouse"},me={origin:"+move"};function ge(e,t,a){for(var r=0,m=0;;){var M=e.indexOf(" ",r);M==-1&&(M=e.length);var G=M-r;if(M==e.length||m+G>=t)return r+Math.min(G,t-m);if(m+=M-r,m+=a-m%a,r=M+1,m>=t)return r}}var re=[""];function oe(e){for(;re.length<=e;)re.push(xe(re)+" ");return re[e]}function xe(e){return e[e.length-1]}function Be(e,t){for(var a=[],r=0;r<e.length;r++)a[r]=t(e[r],r);return a}function Ve(e,t,a){for(var r=0,m=a(t);r<e.length&&a(e[r])<=m;)r++;e.splice(r,0,t)}function Ye(){}function $e(e,t){var a;return Object.create?a=Object.create(e):(Ye.prototype=e,a=new Ye),t&&C(t,a),a}var Ke=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function We(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ke.test(e))}function ze(e,t){return t?t.source.indexOf("\\w")>-1&&We(e)?!0:t.test(e):We(e)}function at(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Je=/[\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&&Je.test(e)}function He(e,t,a){for(;(a<0?t>0:t<e.length)&&Xe(e.charAt(t));)t+=a;return t}function ot(e,t,a){for(var r=t>a?-1:1;;){if(t==a)return t;var m=(t+a)/2,M=r<0?Math.ceil(m):Math.floor(m);if(M==t)return e(M)?t:a;e(M)?a=M:t=M+r}}function ft(e,t,a,r){if(!e)return r(t,a,"ltr",0);for(var m=!1,M=0;M<e.length;++M){var G=e[M];(G.from<a&&G.to>t||t==a&&G.to==t)&&(r(Math.max(G.from,t),Math.min(G.to,a),G.level==1?"rtl":"ltr",M),m=!0)}m||r(t,a,"ltr")}var dt=null;function lt(e,t,a){var r;dt=null;for(var m=0;m<e.length;++m){var M=e[m];if(M.from<t&&M.to>t)return m;M.to==t&&(M.from!=M.to&&a=="before"?r=m:dt=m),M.from==t&&(M.from!=M.to&&a!="before"?r=m:dt=m)}return r!=null?r:dt}var _t=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(Z){return Z<=247?e.charAt(Z):1424<=Z&&Z<=1524?"R":1536<=Z&&Z<=1785?t.charAt(Z-1536):1774<=Z&&Z<=2220?"r":8192<=Z&&Z<=8203?"w":Z==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,m=/[stwN]/,M=/[LRr]/,G=/[Lb1n]/,X=/[1n]/;function $(Z,de,ve){this.level=Z,this.from=de,this.to=ve}return function(Z,de){var ve=de=="ltr"?"L":"R";if(Z.length==0||de=="ltr"&&!r.test(Z))return!1;for(var De=Z.length,Oe=[],Ge=0;Ge<De;++Ge)Oe.push(a(Z.charCodeAt(Ge)));for(var qe=0,st=ve;qe<De;++qe){var pt=Oe[qe];pt=="m"?Oe[qe]=st:st=pt}for(var Tt=0,mt=ve;Tt<De;++Tt){var Ot=Oe[Tt];Ot=="1"&&mt=="r"?Oe[Tt]="n":M.test(Ot)&&(mt=Ot,Ot=="r"&&(Oe[Tt]="R"))}for(var Ht=1,Nt=Oe[0];Ht<De-1;++Ht){var nn=Oe[Ht];nn=="+"&&Nt=="1"&&Oe[Ht+1]=="1"?Oe[Ht]="1":nn==","&&Nt==Oe[Ht+1]&&(Nt=="1"||Nt=="n")&&(Oe[Ht]=Nt),Nt=nn}for(var Dn=0;Dn<De;++Dn){var or=Oe[Dn];if(or==",")Oe[Dn]="N";else if(or=="%"){var jn=void 0;for(jn=Dn+1;jn<De&&Oe[jn]=="%";++jn);for(var kr=Dn&&Oe[Dn-1]=="!"||jn<De&&Oe[jn]=="1"?"1":"N",Ar=Dn;Ar<jn;++Ar)Oe[Ar]=kr;Dn=jn-1}}for(var Qn=0,Dr=ve;Qn<De;++Qn){var hr=Oe[Qn];Dr=="L"&&hr=="1"?Oe[Qn]="L":M.test(hr)&&(Dr=hr)}for(var tr=0;tr<De;++tr)if(m.test(Oe[tr])){var Zn=void 0;for(Zn=tr+1;Zn<De&&m.test(Oe[Zn]);++Zn);for(var Wn=(tr?Oe[tr-1]:ve)=="L",Lr=(Zn<De?Oe[Zn]:ve)=="L",ji=Wn==Lr?Wn?"L":"R":ve,hi=tr;hi<Zn;++hi)Oe[hi]=ji;tr=Zn-1}for(var Er=[],ti,sr=0;sr<De;)if(G.test(Oe[sr])){var co=sr;for(++sr;sr<De&&G.test(Oe[sr]);++sr);Er.push(new $(0,co,sr))}else{var ai=sr,Ei=Er.length,xi=de=="rtl"?1:0;for(++sr;sr<De&&Oe[sr]!="L";++sr);for(var Sr=ai;Sr<sr;)if(X.test(Oe[Sr])){ai<Sr&&(Er.splice(Ei,0,new $(1,ai,Sr)),Ei+=xi);var Bi=Sr;for(++Sr;Sr<sr&&X.test(Oe[Sr]);++Sr);Er.splice(Ei,0,new $(2,Bi,Sr)),Ei+=xi,ai=Sr}else++Sr;ai<sr&&Er.splice(Ei,0,new $(1,ai,sr))}return de=="ltr"&&(Er[0].level==1&&(ti=Z.match(/^\s+/))&&(Er[0].from=ti[0].length,Er.unshift(new $(0,0,ti[0].length))),xe(Er).level==1&&(ti=Z.match(/\s+$/))&&(xe(Er).to-=ti[0].length,Er.push(new $(0,De-ti[0].length,De)))),de=="rtl"?Er.reverse():Er}}();function ht(e,t){var a=e.order;return a==null&&(a=e.order=_t(e.text,t)),a}var be=[],_e=function(e,t,a){if(e.addEventListener)e.addEventListener(t,a,!1);else if(e.attachEvent)e.attachEvent("on"+t,a);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||be).concat(a)}};function Ne(e,t){return e._handlers&&e._handlers[t]||be}function ke(e,t,a){if(e.removeEventListener)e.removeEventListener(t,a,!1);else if(e.detachEvent)e.detachEvent("on"+t,a);else{var r=e._handlers,m=r&&r[t];if(m){var M=J(m,a);M>-1&&(r[t]=m.slice(0,M).concat(m.slice(M+1)))}}}function Ee(e,t){var a=Ne(e,t);if(!a.length)return;for(var r=Array.prototype.slice.call(arguments,2),m=0;m<a.length;++m)a[m].apply(null,r)}function Ie(e,t,a){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ee(e,a||t.type,e,t),te(t)||t.codemirrorIgnore}function pe(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var a=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)J(a,t[r])==-1&&a.push(t[r])}function ae(e,t){return Ne(e,t).length>0}function ie(e){e.prototype.on=function(t,a){_e(this,t,a)},e.prototype.off=function(t,a){ke(this,t,a)}}function Q(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 se(e){Q(e),q(e)}function ce(e){return e.target||e.srcElement}function Se(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}var je=function(){if(j&&k<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Ze;function ut(e){if(Ze==null){var t=c("span","\u200B");p(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ze=t.offsetWidth<=1&&t.offsetHeight>2&&!(j&&k<8))}var a=Ze?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var it;function rt(e){if(it!=null)return it;var t=p(e,document.createTextNode("A\u062EA")),a=_(t,0,1).getBoundingClientRect(),r=_(t,1,2).getBoundingClientRect();return v(e),!a||a.left==a.right?!1:it=r.right-a.right<3}var Me=`
b`.split(/\n/).length!=3?function(e){for(var t=0,a=[],r=e.length;t<=r;){var m=e.indexOf(`
`,t);m==-1&&(m=e.length);var M=e.slice(t,e.charAt(m-1)=="\r"?m-1:m),G=M.indexOf("\r");G!=-1?(a.push(M.slice(0,G)),t+=G+1):(a.push(M),t=m+1)}return a}: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(a){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},we=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ee=null;function he(e){if(ee!=null)return ee;var t=p(e,c("span","x")),a=t.getBoundingClientRect(),r=_(t,0,1).getBoundingClientRect();return ee=Math.abs(a.left-r.left)>1}var Fe={},Re={};function et(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fe[e]=t}function tt(e,t){Re[e]=t}function Te(e){if(typeof e=="string"&&Re.hasOwnProperty(e))e=Re[e];else if(e&&typeof e.name=="string"&&Re.hasOwnProperty(e.name)){var t=Re[e.name];typeof t=="string"&&(t={name:t}),e=$e(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Te("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Te("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ae(e,t){t=Te(t);var a=Fe[t.name];if(!a)return Ae(e,"text/plain");var r=a(e,t);if(Qe.hasOwnProperty(t.name)){var m=Qe[t.name];for(var M in m){if(!m.hasOwnProperty(M))continue;r.hasOwnProperty(M)&&(r["_"+M]=r[M]),r[M]=m[M]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var G in t.modeProps)r[G]=t.modeProps[G];return r}var Qe={};function Et(e,t){var a=Qe.hasOwnProperty(e)?Qe[e]:Qe[e]={};C(t,a)}function vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var a={};for(var r in t){var m=t[r];m instanceof Array&&(m=m.concat([])),a[r]=m}return a}function cn(e,t){for(var a;e.innerMode&&!(a=e.innerMode(t),!a||a.mode==e);)t=a.state,e=a.mode;return a||{mode:e,state:t}}function yn(e,t,a){return e.startState?e.startState(t,a):!0}var ln=function(e,t,a){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};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),a;if(typeof e=="string"?a=t==e:a=t&&(e.test?e.test(t):e(t)),a)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=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},ln.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},ln.prototype.match=function(e,t,a){if(typeof e=="string"){var r=function(G){return a?G.toLowerCase():G},m=this.string.substr(this.pos,e.length);if(r(m)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},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 a=e;!a.lines;)for(var r=0;;++r){var m=a.children[r],M=m.chunkSize();if(t<M){a=m;break}t-=M}return a.lines[t]}function Rn(e,t,a){var r=[],m=t.line;return e.iter(t.line,a.line+1,function(M){var G=M.text;m==a.line&&(G=G.slice(0,a.ch)),m==t.line&&(G=G.slice(t.ch)),r.push(G),++m}),r}function zn(e,t,a){var r=[];return e.iter(t,a,function(m){r.push(m.text)}),r}function Tn(e,t){var a=t-e.height;if(a)for(var r=e;r;r=r.parent)r.height+=a}function zt(e){if(e.parent==null)return null;for(var t=e.parent,a=J(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var m=0;!(r.children[m]==t);++m)a+=r.children[m].chunkSize();return a+t.first}function Sn(e,t){var a=e.first;e:do{for(var r=0;r<e.children.length;++r){var m=e.children[r],M=m.height;if(t<M){e=m;continue e}t-=M,a+=m.chunkSize()}return a}while(!e.lines);for(var G=0;G<e.lines.length;++G){var X=e.lines[G],$=X.height;if(t<$)break;t-=$}return a+G}function Bn(e,t){return t>=e.first&&t<e.first+e.size}function pr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function nt(e,t,a){if(a===void 0&&(a=null),!(this instanceof nt))return new nt(e,t,a);this.line=e,this.ch=t,this.sticky=a}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 xr(e){return nt(e.line,e.ch)}function mr(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 Lt(e,t){if(t.line<e.first)return nt(e.first,0);var a=e.first+e.size-1;return t.line>a?nt(a,bt(e,a).text.length):Pe(t,bt(e,t.line).text.length)}function Pe(e,t){var a=e.ch;return a==null||a>t?nt(e.line,t):a<0?nt(e.line,0):e}function Ce(e,t){for(var a=[],r=0;r<t.length;r++)a[r]=Lt(e,t[r]);return a}var It=function(e,t){this.state=e,this.lookAhead=t},Kt=function(e,t,a,r){this.state=t,this.doc=e,this.line=a,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Kt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Kt.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}},Kt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Kt.fromSaved=function(e,t,a){return t instanceof It?new Kt(e,vt(e.mode,t.state),a,t.lookAhead):new Kt(e,vt(e.mode,t),a)},Kt.prototype.save=function(e){var t=e!==!1?vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new It(t,this.maxLookAhead):t};function vn(e,t,a,r){var m=[e.state.modeGen],M={};gt(e,t.text,e.doc.mode,a,function(Z,de){return m.push(Z,de)},M,r);for(var G=a.state,X=function(Z){a.baseTokens=m;var de=e.state.overlays[Z],ve=1,De=0;a.state=!0,gt(e,t.text,de.mode,a,function(Oe,Ge){for(var qe=ve;De<Oe;){var st=m[ve];st>Oe&&m.splice(ve,1,Oe,m[ve+1],st),ve+=2,De=Math.min(Oe,st)}if(!Ge)return;if(de.opaque)m.splice(qe,ve-qe,Oe,"overlay "+Ge),ve=qe+2;else for(;qe<ve;qe+=2){var pt=m[qe+1];m[qe+1]=(pt?pt+" ":"")+"overlay "+Ge}},M),a.state=G,a.baseTokens=null,a.baseTokenPos=1},$=0;$<e.state.overlays.length;++$)X($);return{styles:m,classes:M.bgClass||M.textClass?M:null}}function fn(e,t,a){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=rn(e,zt(t)),m=t.text.length>e.options.maxHighlightLength&&vt(e.doc.mode,r.state),M=vn(e,t,r);m&&(r.state=m),t.stateAfter=r.save(!m),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),a===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function rn(e,t,a){var r=e.doc,m=e.display;if(!r.mode.startState)return new Kt(r,!0,t);var M=un(e,t,a),G=M>r.first&&bt(r,M-1).stateAfter,X=G?Kt.fromSaved(r,G,M):new Kt(r,yn(r.mode),M);return r.iter(M,t,function($){Gt(e,$.text,X);var Z=X.line;$.stateAfter=Z==t-1||Z%5==0||Z>=m.viewFrom&&Z<m.viewTo?X.save():null,X.nextLine()}),a&&(r.modeFrontier=X.line),X}function Gt(e,t,a,r){var m=e.doc.mode,M=new ln(t,e.options.tabSize,a);for(M.start=M.pos=r||0,t==""&&Dt(m,a.state);!M.eol();)Pt(m,M,a.state),M.start=M.pos}function Dt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var a=cn(e,t);if(a.mode.blankLine)return a.mode.blankLine(a.state)}function Pt(e,t,a,r){for(var m=0;m<10;m++){r&&(r[0]=cn(e,a).mode);var M=e.token(t,a);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ft=function(e,t,a){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=a};function Mt(e,t,a,r){var m=e.doc,M=m.mode,G;t=Lt(m,t);var X=bt(m,t.line),$=rn(e,t.line,a),Z=new ln(X.text,e.options.tabSize,$),de;for(r&&(de=[]);(r||Z.pos<t.ch)&&!Z.eol();)Z.start=Z.pos,G=Pt(M,Z,$.state),r&&de.push(new Ft(Z,G,vt(m.mode,$.state)));return r?de:new Ft(Z,G,$.state)}function qt(e,t){if(e)for(;;){var a=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;e=e.slice(0,a.index)+e.slice(a.index+a[0].length);var r=a[1]?"bgClass":"textClass";t[r]==null?t[r]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+a[2])}return e}function gt(e,t,a,r,m,M,G){var X=a.flattenSpans;X==null&&(X=e.options.flattenSpans);var $=0,Z=null,de=new ln(t,e.options.tabSize,r),ve,De=e.options.addModeClass&&[null];for(t==""&&qt(Dt(a,r.state),M);!de.eol();){if(de.pos>e.options.maxHighlightLength?(X=!1,G&&Gt(e,t,r,de.pos),de.pos=t.length,ve=null):ve=qt(Pt(a,de,r.state,De),M),De){var Oe=De[0].name;Oe&&(ve="m-"+(ve?Oe+" "+ve:Oe))}if(!X||Z!=ve){for(;$<de.start;)$=Math.min(de.start,$+5e3),m($,Z);Z=ve}de.start=de.pos}for(;$<de.pos;){var Ge=Math.min(de.pos,$+5e3);m(Ge,Z),$=Ge}}function un(e,t,a){for(var r,m,M=e.doc,G=a?-1:t-(e.doc.mode.innerMode?1e3:100),X=t;X>G;--X){if(X<=M.first)return M.first;var $=bt(M,X-1),Z=$.stateAfter;if(Z&&(!a||X+(Z instanceof It?Z.lookAhead:0)<=M.modeFrontier))return X;var de=W($.text,null,e.options.tabSize);(m==null||r>de)&&(m=X-1,r=de)}return m}function Qt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var a=e.first,r=t-1;r>a;r--){var m=bt(e,r).stateAfter;if(m&&(!(m instanceof It)||r+m.lookAhead<t)){a=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,a)}var Ln=!1,kt=!1;function In(){Ln=!0}function Nn(){kt=!0}function wn(e,t,a){this.marker=e,this.from=t,this.to=a}function bn(e,t){if(e)for(var a=0;a<e.length;++a){var r=e[a];if(r.marker==t)return r}}function An(e,t){for(var a,r=0;r<e.length;++r)e[r]!=t&&(a||(a=[])).push(e[r]);return a}function nr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function lr(e,t,a){var r;if(e)for(var m=0;m<e.length;++m){var M=e[m],G=M.marker,X=M.from==null||(G.inclusiveLeft?M.from<=t:M.from<t);if(X||M.from==t&&G.type=="bookmark"&&(!a||!M.marker.insertLeft)){var $=M.to==null||(G.inclusiveRight?M.to>=t:M.to>t);(r||(r=[])).push(new wn(G,M.from,$?null:M.to))}}return r}function Xn(e,t,a){var r;if(e)for(var m=0;m<e.length;++m){var M=e[m],G=M.marker,X=M.to==null||(G.inclusiveRight?M.to>=t:M.to>t);if(X||M.from==t&&G.type=="bookmark"&&(!a||M.marker.insertLeft)){var $=M.from==null||(G.inclusiveLeft?M.from<=t:M.from<t);(r||(r=[])).push(new wn(G,$?null:M.from-t,M.to==null?null:M.to-t))}}return r}function xn(e,t){if(t.full)return null;var a=Bn(e,t.from.line)&&bt(e,t.from.line).markedSpans,r=Bn(e,t.to.line)&&bt(e,t.to.line).markedSpans;if(!a&&!r)return null;var m=t.from.ch,M=t.to.ch,G=ct(t.from,t.to)==0,X=lr(a,m,G),$=Xn(r,M,G),Z=t.text.length==1,de=xe(t.text).length+(Z?m:0);if(X)for(var ve=0;ve<X.length;++ve){var De=X[ve];if(De.to==null){var Oe=bn($,De.marker);Oe?Z&&(De.to=Oe.to==null?null:Oe.to+de):De.to=m}}if($)for(var Ge=0;Ge<$.length;++Ge){var qe=$[Ge];if(qe.to!=null&&(qe.to+=de),qe.from==null){var st=bn(X,qe.marker);st||(qe.from=de,Z&&(X||(X=[])).push(qe))}else qe.from+=de,Z&&(X||(X=[])).push(qe)}X&&(X=ur(X)),$&&$!=X&&($=ur($));var pt=[X];if(!Z){var Tt=t.text.length-2,mt;if(Tt>0&&X)for(var Ot=0;Ot<X.length;++Ot)X[Ot].to==null&&(mt||(mt=[])).push(new wn(X[Ot].marker,null,null));for(var Ht=0;Ht<Tt;++Ht)pt.push(mt);pt.push($)}return pt}function ur(e){for(var t=0;t<e.length;++t){var a=e[t];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function dn(e,t,a){var r=null;if(e.iter(t.line,a.line+1,function(Oe){if(Oe.markedSpans)for(var Ge=0;Ge<Oe.markedSpans.length;++Ge){var qe=Oe.markedSpans[Ge].marker;qe.readOnly&&(!r||J(r,qe)==-1)&&(r||(r=[])).push(qe)}}),!r)return null;for(var m=[{from:t,to:a}],M=0;M<r.length;++M)for(var G=r[M],X=G.find(0),$=0;$<m.length;++$){var Z=m[$];if(ct(Z.to,X.from)<0||ct(Z.from,X.to)>0)continue;var de=[$,1],ve=ct(Z.from,X.from),De=ct(Z.to,X.to);(ve<0||!G.inclusiveLeft&&!ve)&&de.push({from:Z.from,to:X.from}),(De>0||!G.inclusiveRight&&!De)&&de.push({from:X.to,to:Z.to}),m.splice.apply(m,de),$+=de.length-3}return m}function hn(e){var t=e.markedSpans;if(!t)return;for(var a=0;a<t.length;++a)t[a].marker.detachLine(e);e.markedSpans=null}function pn(e,t){if(!t)return;for(var a=0;a<t.length;++a)t[a].marker.attachLine(e);e.markedSpans=t}function Xt(e){return e.inclusiveLeft?-1:0}function St(e){return e.inclusiveRight?1:0}function jt(e,t){var a=e.lines.length-t.lines.length;if(a!=0)return a;var r=e.find(),m=t.find(),M=ct(r.from,m.from)||Xt(e)-Xt(t);if(M)return-M;var G=ct(r.to,m.to)||St(e)-St(t);return G||t.id-e.id}function xt(e,t){var a=kt&&e.markedSpans,r;if(a)for(var m=void 0,M=0;M<a.length;++M)m=a[M],m.marker.collapsed&&(t?m.from:m.to)==null&&(!r||jt(r,m.marker)<0)&&(r=m.marker);return r}function en(e){return xt(e,!0)}function Ut(e){return xt(e,!1)}function rr(e,t){var a=kt&&e.markedSpans,r;if(a)for(var m=0;m<a.length;++m){var M=a[m];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!r||jt(r,M.marker)<0)&&(r=M.marker)}return r}function Mn(e,t,a,r,m){var M=bt(e,t),G=kt&&M.markedSpans;if(G)for(var X=0;X<G.length;++X){var $=G[X];if(!$.marker.collapsed)continue;var Z=$.marker.find(0),de=ct(Z.from,a)||Xt($.marker)-Xt(m),ve=ct(Z.to,r)||St($.marker)-St(m);if(de>=0&&ve<=0||de<=0&&ve>=0)continue;if(de<=0&&($.marker.inclusiveRight&&m.inclusiveLeft?ct(Z.to,a)>=0:ct(Z.to,a)>0)||de>=0&&($.marker.inclusiveRight&&m.inclusiveLeft?ct(Z.from,r)<=0:ct(Z.from,r)<0))return!0}}function dr(e){for(var t;t=en(e);)e=t.find(-1,!0).line;return e}function Qr(e){for(var t;t=Ut(e);)e=t.find(1,!0).line;return e}function Ir(e){for(var t,a;t=Ut(e);)e=t.find(1,!0).line,(a||(a=[])).push(e);return a}function Gr(e,t){var a=bt(e,t),r=dr(a);return a==r?t:zt(r)}function Mr(e,t){if(t>e.lastLine())return t;var a=bt(e,t),r;if(!Or(e,a))return t;for(;r=Ut(a);)a=r.find(1,!0).line;return zt(a)+1}function Or(e,t){var a=kt&&t.markedSpans;if(a)for(var r=void 0,m=0;m<a.length;++m){if(r=a[m],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&Br(e,t,r))return!0}}function Br(e,t,a){if(a.to==null){var r=a.marker.find(1,!0);return Br(e,r.line,bn(r.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==t.text.length)return!0;for(var m=void 0,M=0;M<t.markedSpans.length;++M)if(m=t.markedSpans[M],m.marker.collapsed&&!m.marker.widgetNode&&m.from==a.to&&(m.to==null||m.to!=a.from)&&(m.marker.inclusiveLeft||a.marker.inclusiveRight)&&Br(e,t,m))return!0}function Fn(e){e=dr(e);for(var t=0,a=e.parent,r=0;r<a.lines.length;++r){var m=a.lines[r];if(m==e)break;t+=m.height}for(var M=a.parent;M;a=M,M=a.parent)for(var G=0;G<M.children.length;++G){var X=M.children[G];if(X==a)break;t+=X.height}return t}function Rt(e){if(e.height==0)return 0;for(var t=e.text.length,a,r=e;a=en(r);){var m=a.find(0,!0);r=m.from.line,t+=m.from.ch-m.to.ch}for(r=e;a=Ut(r);){var M=a.find(0,!0);t-=r.text.length-M.from.ch,r=M.to.line,t+=r.text.length-M.to.ch}return t}function zr(e){var t=e.display,a=e.doc;t.maxLine=bt(a,a.first),t.maxLineLength=Rt(t.maxLine),t.maxLineChanged=!0,a.iter(function(r){var m=Rt(r);m>t.maxLineLength&&(t.maxLineLength=m,t.maxLine=r)})}var gr=function(e,t,a){this.text=e,pn(this,t),this.height=a?a(this):1};gr.prototype.lineNo=function(){return zt(this)},ie(gr);function ni(e,t,a,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),hn(e),pn(e,a);var m=r?r(e):1;m!=e.height&&Tn(e,m)}function wt(e){e.parent=null,hn(e)}var Wt={},At={};function Vt(e,t){if(!e||/^\s*$/.test(e))return null;var a=t.addModeClass?At:Wt;return a[e]||(a[e]=e.replace(/\S+/g,"cm-$&"))}function $t(e,t){var a=E("span",null,null,A?"padding-right: .1px":null),r={pre:E("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var m=0;m<=(t.rest?t.rest.length:0);m++){var M=m?t.rest[m-1]:t.line,G=void 0;r.pos=0,r.addToken=tn,rt(e.display.measure)&&(G=ht(M,e.doc.direction))&&(r.addToken=er(r.addToken,G)),r.map=[];var X=t!=e.display.externalMeasured&&zt(M);vr(M,r,fn(e,M,X)),M.styleClasses&&(M.styleClasses.bgClass&&(r.bgClass=B(M.styleClasses.bgClass,r.bgClass||"")),M.styleClasses.textClass&&(r.textClass=B(M.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ut(e.display.measure))),m==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(A){var $=r.content.lastChild;(/\bcm-tab\b/.test($.className)||$.querySelector&&$.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ee(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=B(r.pre.className,r.textClass||"")),r}function _n(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function tn(e,t,a,r,m,M,G){if(!t)return;var X=e.splitSpaces?Pn(t,e.trailingSpace):t,$=e.cm.state.specialChars,Z=!1,de;if(!$.test(t))e.col+=t.length,de=document.createTextNode(X),e.map.push(e.pos,e.pos+t.length,de),j&&k<9&&(Z=!0),e.pos+=t.length;else{de=document.createDocumentFragment();for(var ve=0;;){$.lastIndex=ve;var De=$.exec(t),Oe=De?De.index-ve:t.length-ve;if(Oe){var Ge=document.createTextNode(X.slice(ve,ve+Oe));j&&k<9?de.appendChild(c("span",[Ge])):de.appendChild(Ge),e.map.push(e.pos,e.pos+Oe,Ge),e.col+=Oe,e.pos+=Oe}if(!De)break;ve+=Oe+1;var qe=void 0;if(De[0]==" "){var st=e.cm.options.tabSize,pt=st-e.col%st;qe=de.appendChild(c("span",oe(pt),"cm-tab")),qe.setAttribute("role","presentation"),qe.setAttribute("cm-text"," "),e.col+=pt}else De[0]=="\r"||De[0]==`
`?(qe=de.appendChild(c("span",De[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),qe.setAttribute("cm-text",De[0]),e.col+=1):(qe=e.cm.options.specialCharPlaceholder(De[0]),qe.setAttribute("cm-text",De[0]),j&&k<9?de.appendChild(c("span",[qe])):de.appendChild(qe),e.col+=1);e.map.push(e.pos,e.pos+1,qe),e.pos++}}if(e.trailingSpace=X.charCodeAt(t.length-1)==32,a||r||m||Z||M||G){var Tt=a||"";r&&(Tt+=r),m&&(Tt+=m);var mt=c("span",[de],Tt,M);if(G)for(var Ot in G)G.hasOwnProperty(Ot)&&Ot!="style"&&Ot!="class"&&mt.setAttribute(Ot,G[Ot]);return e.content.appendChild(mt)}e.content.appendChild(de)}function Pn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var a=t,r="",m=0;m<e.length;m++){var M=e.charAt(m);M==" "&&a&&(m==e.length-1||e.charCodeAt(m+1)==32)&&(M="\xA0"),r+=M,a=M==" "}return r}function er(e,t){return function(a,r,m,M,G,X,$){m=m?m+" cm-force-border":"cm-force-border";for(var Z=a.pos,de=Z+r.length;;){for(var ve=void 0,De=0;De<t.length&&!(ve=t[De],ve.to>Z&&ve.from<=Z);De++);if(ve.to>=de)return e(a,r,m,M,G,X,$);e(a,r.slice(0,ve.to-Z),m,M,null,X,$),M=null,r=r.slice(ve.to-Z),Z=ve.to}}}function Yt(e,t,a,r){var m=!r&&a.widgetNode;m&&e.map.push(e.pos,e.pos+t,m),!r&&e.cm.display.input.needsContentAttribute&&(m||(m=e.content.appendChild(document.createElement("span"))),m.setAttribute("cm-marker",a.id)),m&&(e.cm.display.input.setUneditable(m),e.content.appendChild(m)),e.pos+=t,e.trailingSpace=!1}function vr(e,t,a){var r=e.markedSpans,m=e.text,M=0;if(!r){for(var G=1;G<a.length;G+=2)t.addToken(t,m.slice(M,M=a[G]),Vt(a[G+1],t.cm.options));return}for(var X=m.length,$=0,Z=1,de="",ve,De,Oe=0,Ge,qe,st,pt,Tt;;){if(Oe==$){Ge=qe=st=De="",Tt=null,pt=null,Oe=Infinity;for(var mt=[],Ot=void 0,Ht=0;Ht<r.length;++Ht){var Nt=r[Ht],nn=Nt.marker;if(nn.type=="bookmark"&&Nt.from==$&&nn.widgetNode)mt.push(nn);else if(Nt.from<=$&&(Nt.to==null||Nt.to>$||nn.collapsed&&Nt.to==$&&Nt.from==$)){if(Nt.to!=null&&Nt.to!=$&&Oe>Nt.to&&(Oe=Nt.to,qe=""),nn.className&&(Ge+=" "+nn.className),nn.css&&(De=(De?De+";":"")+nn.css),nn.startStyle&&Nt.from==$&&(st+=" "+nn.startStyle),nn.endStyle&&Nt.to==Oe&&(Ot||(Ot=[])).push(nn.endStyle,Nt.to),nn.title&&((Tt||(Tt={})).title=nn.title),nn.attributes)for(var Dn in nn.attributes)(Tt||(Tt={}))[Dn]=nn.attributes[Dn];nn.collapsed&&(!pt||jt(pt.marker,nn)<0)&&(pt=Nt)}else Nt.from>$&&Oe>Nt.from&&(Oe=Nt.from)}if(Ot)for(var or=0;or<Ot.length;or+=2)Ot[or+1]==Oe&&(qe+=" "+Ot[or]);if(!pt||pt.from==$)for(var jn=0;jn<mt.length;++jn)Yt(t,0,mt[jn]);if(pt&&(pt.from||0)==$){if(Yt(t,(pt.to==null?X+1:pt.to)-$,pt.marker,pt.from==null),pt.to==null)return;pt.to==$&&(pt=!1)}}if($>=X)break;for(var kr=Math.min(X,Oe);;){if(de){var Ar=$+de.length;if(!pt){var Qn=Ar>kr?de.slice(0,kr-$):de;t.addToken(t,Qn,ve?ve+Ge:Ge,st,$+Qn.length==Oe?qe:"",De,Tt)}if(Ar>=kr){de=de.slice(kr-$),$=kr;break}$=Ar,st=""}de=m.slice(M,M=a[Z++]),ve=Vt(a[Z++],t.cm.options)}}}function mn(e,t,a){this.line=t,this.rest=Ir(t),this.size=this.rest?zt(xe(this.rest))-a+1:1,this.node=this.text=null,this.hidden=Or(e,t)}function Vn(e,t,a){for(var r=[],m,M=t;M<a;M=m){var G=new mn(e.doc,bt(e.doc,M),M);m=M+G.size,r.push(G)}return r}var Yn=null;function cr(e){Yn?Yn.ops.push(e):e.ownsGroup=Yn={ops:[e],delayedCallbacks:[]}}function Wi(e){var t=e.delayedCallbacks,a=0;do{for(;a<t.length;a++)t[a].call(null);for(var r=0;r<e.ops.length;r++){var m=e.ops[r];if(m.cursorActivityHandlers)for(;m.cursorActivityCalled<m.cursorActivityHandlers.length;)m.cursorActivityHandlers[m.cursorActivityCalled++].call(null,m.cm)}}while(a<t.length)}function gn(e,t){var a=e.ownsGroup;if(!a)return;try{Wi(a)}finally{Yn=null,t(a)}}var an=null;function sn(e,t){var a=Ne(e,t);if(!a.length)return;var r=Array.prototype.slice.call(arguments,2),m;Yn?m=Yn.delayedCallbacks:an?m=an:(m=an=[],setTimeout(fr,0));for(var M=function(X){m.push(function(){return a[X].apply(null,r)})},G=0;G<a.length;++G)M(G)}function fr(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function Zr(e,t,a,r){for(var m=0;m<t.changes.length;m++){var M=t.changes[m];M=="text"?Zt(e,t):M=="gutter"?Jt(e,t,a,r):M=="class"?Ct(e,t):M=="widget"&&yt(e,t,r)}t.changes=null}function qr(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),j&&k<8&&(e.node.style.zIndex=2)),e.node}function ri(e,t){var a=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),t.background)a?t.background.className=a:(t.background.parentNode.removeChild(t.background),t.background=null);else if(a){var r=qr(t);t.background=r.insertBefore(c("div",null,a),r.firstChild),e.display.input.setUneditable(t.background)}}function Ti(e,t){var a=e.display.externalMeasured;return a&&a.line==t.line?(e.display.externalMeasured=null,t.measure=a.measure,a.built):$t(e,t)}function Zt(e,t){var a=t.text.className,r=Ti(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Ct(e,t)):a&&(t.text.className=a)}function Ct(e,t){ri(e,t),t.line.wrapClass?qr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var a=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=a||""}function Jt(e,t,a,r){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 m=qr(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),m.insertBefore(t.gutterBackground,t.text)}var M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var G=qr(t),X=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(X),G.insertBefore(X,t.text),t.line.gutterClass&&(X.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=X.appendChild(c("div",pr(e.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var $=0;$<e.display.gutterSpecs.length;++$){var Z=e.display.gutterSpecs[$].className,de=M.hasOwnProperty(Z)&&M[Z];de&&X.appendChild(c("div",[de],"CodeMirror-gutter-elt","left: "+r.gutterLeft[Z]+"px; width: "+r.gutterWidth[Z]+"px"))}}}function yt(e,t,a){t.alignable&&(t.alignable=null);for(var r=T("CodeMirror-linewidget"),m=t.node.firstChild,M=void 0;m;m=M)M=m.nextSibling,r.test(m.className)&&t.node.removeChild(m);Cn(e,t,a)}function on(e,t,a,r){var m=Ti(e,t);return t.text=t.node=m.pre,m.bgClass&&(t.bgClass=m.bgClass),m.textClass&&(t.textClass=m.textClass),Ct(e,t),Jt(e,t,a,r),Cn(e,t,r),t.node}function Cn(e,t,a){if(Hn(e,t.line,t,a,!0),t.rest)for(var r=0;r<t.rest.length;r++)Hn(e,t.rest[r],t,a,!1)}function Hn(e,t,a,r,m){if(!t.widgets)return;for(var M=qr(a),G=0,X=t.widgets;G<X.length;++G){var $=X[G],Z=c("div",[$.node],"CodeMirror-linewidget"+($.className?" "+$.className:""));$.handleMouseEvents||Z.setAttribute("cm-ignore-events","true"),_r($,Z,a,r),e.display.input.setUneditable(Z),m&&$.above?M.insertBefore(Z,a.gutter||a.text):M.appendChild(Z),sn($,"redraw")}}function _r(e,t,a,r){if(e.noHScroll){(a.alignable||(a.alignable=[])).push(t);var m=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(m-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=m+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function yr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var a="position: relative;";e.coverGutter&&(a+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(a+="width: "+t.display.wrapper.clientWidth+"px;"),p(t.display.measure,c("div",[e.node],null,a))}return e.height=e.node.parentNode.offsetHeight}function Bt(e,t){for(var a=ce(t);a!=e.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==e.sizer&&a!=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=p(e.measure,c("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Kn(e){return ne-e.display.nativeBarWidth}function $n(e){return e.display.scroller.clientWidth-Kn(e)-e.display.barWidth}function Hr(e){return e.display.scroller.clientHeight-Kn(e)-e.display.barHeight}function Jn(e,t,a){var r=e.options.lineWrapping,m=r&&$n(e);if(!t.measure.heights||r&&t.measure.width!=m){var M=t.measure.heights=[];if(r){t.measure.width=m;for(var G=t.text.firstChild.getClientRects(),X=0;X<G.length-1;X++){var $=G[X],Z=G[X+1];Math.abs($.bottom-Z.bottom)>2&&M.push(($.bottom+Z.top)/2-a.top)}}M.push(a.bottom-a.top)}}function Kr(e,t,a){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var m=0;m<e.rest.length;m++)if(zt(e.rest[m])>a)return{map:e.measure.maps[m],cache:e.measure.caches[m],before:!0}}function Hi(e,t){t=dr(t);var a=zt(t),r=e.display.externalMeasured=new mn(e.doc,t,a);r.lineN=a;var m=r.built=$t(e,r);return r.text=m.pre,p(e.display.lineMeasure,m.pre),r}function Vr(e,t,a,r){return ei(e,Si(e,t),a,r)}function Pr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gi(e,t)];var a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size)return a}function Si(e,t){var a=zt(t),r=Pr(e,a);r&&!r.text?r=null:r&&r.changes&&(Zr(e,r,a,Ua(e)),e.curOp.forceUpdate=!0),r||(r=Hi(e,t));var m=Kr(r,t,a);return{line:t,view:r,rect:null,map:m.map,cache:m.cache,before:m.before,hasHeights:!1}}function ei(e,t,a,r,m){t.before&&(a=-1);var M=a+(r||""),G;return t.cache.hasOwnProperty(M)?G=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Jn(e,t.view,t.rect),t.hasHeights=!0),G=Ws(e,t,a,r),G.bogus||(t.cache[M]=G)),{left:G.left,right:G.right,top:m?G.rtop:G.top,bottom:m?G.rbottom:G.bottom}}var ho={left:0,right:0,top:0,bottom:0};function po(e,t,a){for(var r,m,M,G,X,$,Z=0;Z<e.length;Z+=3)if(X=e[Z],$=e[Z+1],t<X?(m=0,M=1,G="left"):t<$?(m=t-X,M=m+1):(Z==e.length-3||t==$&&e[Z+3]>t)&&(M=$-X,m=M-1,t>=$&&(G="right")),m!=null){if(r=e[Z+2],X==$&&a==(r.insertLeft?"left":"right")&&(G=a),a=="left"&&m==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)r=e[(Z-=3)+2],G="left";if(a=="right"&&m==$-X)for(;Z<e.length-3&&e[Z+3]==e[Z+4]&&!e[Z+5].insertLeft;)r=e[(Z+=3)+2],G="right";break}return{node:r,start:m,end:M,collapse:G,coverStart:X,coverEnd:$}}function Bs(e,t){var a=ho;if(t=="left")for(var r=0;r<e.length&&!((a=e[r]).left!=a.right);r++);else for(var m=e.length-1;m>=0&&!((a=e[m]).left!=a.right);m--);return a}function Ws(e,t,a,r){var m=po(t.map,a,r),M=m.node,G=m.start,X=m.end,$=m.collapse,Z;if(M.nodeType==3){for(var de=0;de<4;de++){for(;G&&Xe(t.line.text.charAt(m.coverStart+G));)--G;for(;m.coverStart+X<m.coverEnd&&Xe(t.line.text.charAt(m.coverStart+X));)++X;if(j&&k<9&&G==0&&X==m.coverEnd-m.coverStart?Z=M.parentNode.getBoundingClientRect():Z=Bs(_(M,G,X).getClientRects(),r),Z.left||Z.right||G==0)break;X=G,G=G-1,$="right"}j&&k<11&&(Z=Hs(e.display.measure,Z))}else{G>0&&($=r="right");var ve;e.options.lineWrapping&&(ve=M.getClientRects()).length>1?Z=ve[r=="right"?ve.length-1:0]:Z=M.getBoundingClientRect()}if(j&&k<9&&!G&&(!Z||!Z.left&&!Z.right)){var De=M.parentNode.getClientRects()[0];De?Z={left:De.left,right:De.left+wi(e.display),top:De.top,bottom:De.bottom}:Z=ho}for(var Oe=Z.top-t.rect.top,Ge=Z.bottom-t.rect.top,qe=(Oe+Ge)/2,st=t.view.measure.heights,pt=0;pt<st.length-1&&!(qe<st[pt]);pt++);var Tt=pt?st[pt-1]:0,mt=st[pt],Ot={left:($=="right"?Z.right:Z.left)-t.rect.left,right:($=="left"?Z.left:Z.right)-t.rect.left,top:Tt,bottom:mt};return!Z.left&&!Z.right&&(Ot.bogus=!0),e.options.singleCursorHeightPerLine||(Ot.rtop=Oe,Ot.rbottom=Ge),Ot}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!he(e))return t;var a=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*a,right:t.right*a,top:t.top*r,bottom:t.bottom*r}}function mo(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 go(e){e.display.externalMeasure=null,v(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)mo(e.display.view[t])}function Ki(e){go(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function vo(){return g&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function _o(){return g&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ia(e){var t=0;if(e.widgets)for(var a=0;a<e.widgets.length;++a)e.widgets[a].above&&(t+=yr(e.widgets[a]));return t}function ca(e,t,a,r,m){if(!m){var M=Ia(t);a.top+=M,a.bottom+=M}if(r=="line")return a;r||(r="local");var G=Fn(t);if(r=="local"?G+=Wr(e.display):G-=e.display.viewOffset,r=="page"||r=="window"){var X=e.display.lineSpace.getBoundingClientRect();G+=X.top+(r=="window"?0:_o());var $=X.left+(r=="window"?0:vo());a.left+=$,a.right+=$}return a.top+=G,a.bottom+=G,a}function yo(e,t,a){if(a=="div")return t;var r=t.left,m=t.top;if(a=="page")r-=vo(),m-=_o();else if(a=="local"||!a){var M=e.display.sizer.getBoundingClientRect();r+=M.left,m+=M.top}var G=e.display.lineSpace.getBoundingClientRect();return{left:r-G.left,top:m-G.top}}function Ma(e,t,a,r,m){return r||(r=bt(e.doc,t.line)),ca(e,r,Vr(e,r,t.ch,m),a)}function Yr(e,t,a,r,m,M){r=r||bt(e.doc,t.line),m||(m=Si(e,r));function G(Ge,qe){var st=ei(e,m,Ge,qe?"right":"left",M);return qe?st.left=st.right:st.right=st.left,ca(e,r,st,a)}var X=ht(r,e.doc.direction),$=t.ch,Z=t.sticky;if($>=r.text.length?($=r.text.length,Z="before"):$<=0&&($=0,Z="after"),!X)return G(Z=="before"?$-1:$,Z=="before");function de(Ge,qe,st){var pt=X[qe],Tt=pt.level==1;return G(st?Ge-1:Ge,Tt!=st)}var ve=lt(X,$,Z),De=dt,Oe=de($,ve,Z=="before");return De!=null&&(Oe.other=de($,De,Z!="before")),Oe}function bo(e,t){var a=0;t=Lt(e.doc,t),e.options.lineWrapping||(a=wi(e.display)*t.ch);var r=bt(e.doc,t.line),m=Fn(r)+Wr(e.display);return{left:a,right:a,top:m,bottom:m+r.height}}function Pa(e,t,a,r,m){var M=nt(e,t,a);return M.xRel=m,r&&(M.outside=r),M}function Na(e,t,a){var r=e.doc;if(a+=e.display.viewOffset,a<0)return Pa(r.first,0,null,-1,-1);var m=Sn(r,a),M=r.first+r.size-1;if(m>M)return Pa(r.first+r.size-1,bt(r,M).text.length,null,1,1);t<0&&(t=0);for(var G=bt(r,m);;){var X=Ks(e,G,m,t,a),$=rr(G,X.ch+(X.xRel>0||X.outside>0?1:0));if(!$)return X;var Z=$.find(1);if(Z.line==m)return Z;G=bt(r,m=Z.line)}}function Eo(e,t,a,r){r-=Ia(t);var m=t.text.length,M=ot(function(G){return ei(e,a,G-1).bottom<=r},m,0);return m=ot(function(G){return ei(e,a,G).top>r},M,m),{begin:M,end:m}}function xo(e,t,a,r){a||(a=Si(e,t));var m=ca(e,t,ei(e,a,r),"line").top;return Eo(e,t,a,m)}function ka(e,t,a,r){return e.bottom<=a?!1:e.top>a?!0:(r?e.left:e.right)>t}function Ks(e,t,a,r,m){m-=Fn(t);var M=Si(e,t),G=Ia(t),X=0,$=t.text.length,Z=!0,de=ht(t,e.doc.direction);if(de){var ve=(e.options.lineWrapping?zs:Gs)(e,t,a,M,de,r,m);Z=ve.level!=1,X=Z?ve.from:ve.to-1,$=Z?ve.to:ve.from-1}var De=null,Oe=null,Ge=ot(function(Ht){var Nt=ei(e,M,Ht);return Nt.top+=G,Nt.bottom+=G,ka(Nt,r,m,!1)?(Nt.top<=m&&Nt.left<=r&&(De=Ht,Oe=Nt),!0):!1},X,$),qe,st,pt=!1;if(Oe){var Tt=r-Oe.left<Oe.right-r,mt=Tt==Z;Ge=De+(mt?0:1),st=mt?"after":"before",qe=Tt?Oe.left:Oe.right}else{!Z&&(Ge==$||Ge==X)&&Ge++,st=Ge==0?"after":Ge==t.text.length?"before":ei(e,M,Ge-(Z?1:0)).bottom+G<=m==Z?"after":"before";var Ot=Yr(e,nt(a,Ge,st),"line",t,M);qe=Ot.left,pt=m<Ot.top?-1:m>=Ot.bottom?1:0}return Ge=He(t.text,Ge,1),Pa(a,Ge,st,pt,r-qe)}function Gs(e,t,a,r,m,M,G){var X=ot(function(ve){var De=m[ve],Oe=De.level!=1;return ka(Yr(e,nt(a,Oe?De.to:De.from,Oe?"before":"after"),"line",t,r),M,G,!0)},0,m.length-1),$=m[X];if(X>0){var Z=$.level!=1,de=Yr(e,nt(a,Z?$.from:$.to,Z?"after":"before"),"line",t,r);ka(de,M,G,!0)&&de.top>G&&($=m[X-1])}return $}function zs(e,t,a,r,m,M,G){var X=Eo(e,t,r,G),$=X.begin,Z=X.end;/\s/.test(t.text.charAt(Z-1))&&Z--;for(var de=null,ve=null,De=0;De<m.length;De++){var Oe=m[De];if(Oe.from>=Z||Oe.to<=$)continue;var Ge=Oe.level!=1,qe=ei(e,r,Ge?Math.min(Z,Oe.to)-1:Math.max($,Oe.from)).right,st=qe<M?M-qe+1e9:qe-M;(!de||ve>st)&&(de=Oe,ve=st)}return de||(de=m[m.length-1]),de.from<$&&(de={from:$,to:de.to,level:de.level}),de.to>Z&&(de={from:de.from,to:Z,level:de.level}),de}var pi;function Oi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pi==null){pi=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pi.appendChild(document.createTextNode("x")),pi.appendChild(c("br"));pi.appendChild(document.createTextNode("x"))}p(e.measure,pi);var a=pi.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),v(e.measure),a||1}function wi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),a=c("pre",[t],"CodeMirror-line-like");p(e.measure,a);var r=t.getBoundingClientRect(),m=(r.right-r.left)/10;return m>2&&(e.cachedCharWidth=m),m||10}function Ua(e){for(var t=e.display,a={},r={},m=t.gutters.clientLeft,M=t.gutters.firstChild,G=0;M;M=M.nextSibling,++G){var X=e.display.gutterSpecs[G].className;a[X]=M.offsetLeft+M.clientLeft+m,r[X]=M.clientWidth}return{fixedPos:Fa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function To(e){var t=Oi(e.display),a=e.options.lineWrapping,r=a&&Math.max(5,e.display.scroller.clientWidth/wi(e.display)-3);return function(m){if(Or(e.doc,m))return 0;var M=0;if(m.widgets)for(var G=0;G<m.widgets.length;G++)m.widgets[G].height&&(M+=m.widgets[G].height);return a?M+(Math.ceil(m.text.length/r)||1)*t:M+t}}function ja(e){var t=e.doc,a=To(e);t.iter(function(r){var m=a(r);m!=r.height&&Tn(r,m)})}function mi(e,t,a,r){var m=e.display;if(!a&&ce(t).getAttribute("cm-not-content")=="true")return null;var M,G,X=m.lineSpace.getBoundingClientRect();try{M=t.clientX-X.left,G=t.clientY-X.top}catch(ve){return null}var $=Na(e,M,G),Z;if(r&&$.xRel>0&&(Z=bt(e.doc,$.line).text).length==$.ch){var de=W(Z,Z.length,e.options.tabSize)-Z.length;$=nt($.line,Math.max(0,Math.round((M-wr(e.display).left)/wi(e.display))-de))}return $}function gi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var a=e.display.view,r=0;r<a.length;r++)if(t-=a[r].size,t<0)return r}function Cr(e,t,a,r){t==null&&(t=e.doc.first),a==null&&(a=e.doc.first+e.doc.size),r||(r=0);var m=e.display;if(r&&a<m.viewTo&&(m.updateLineNumbers==null||m.updateLineNumbers>t)&&(m.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=m.viewTo)kt&&Gr(e.doc,t)<m.viewTo&&si(e);else if(a<=m.viewFrom)kt&&Mr(e.doc,a+r)>m.viewFrom?si(e):(m.viewFrom+=r,m.viewTo+=r);else if(t<=m.viewFrom&&a>=m.viewTo)si(e);else if(t<=m.viewFrom){var M=fa(e,a,a+r,1);M?(m.view=m.view.slice(M.index),m.viewFrom=M.lineN,m.viewTo+=r):si(e)}else if(a>=m.viewTo){var G=fa(e,t,t,-1);G?(m.view=m.view.slice(0,G.index),m.viewTo=G.lineN):si(e)}else{var X=fa(e,t,t,-1),$=fa(e,a,a+r,1);X&&$?(m.view=m.view.slice(0,X.index).concat(Vn(e,X.lineN,$.lineN)).concat(m.view.slice($.index)),m.viewTo+=r):si(e)}var Z=m.externalMeasured;Z&&(a<Z.lineN?Z.lineN+=r:t<Z.lineN+Z.size&&(m.externalMeasured=null))}function oi(e,t,a){e.curOp.viewChanged=!0;var r=e.display,m=e.display.externalMeasured;if(m&&t>=m.lineN&&t<m.lineN+m.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var M=r.view[gi(e,t)];if(M.node==null)return;var G=M.changes||(M.changes=[]);J(G,a)==-1&&G.push(a)}function si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fa(e,t,a,r){var m=gi(e,t),M,G=e.display.view;if(!kt||a==e.doc.first+e.doc.size)return{index:m,lineN:a};for(var X=e.display.viewFrom,$=0;$<m;$++)X+=G[$].size;if(X!=t){if(r>0){if(m==G.length-1)return null;M=X+G[m].size-t,m++}else M=X-t;t+=M,a+=M}for(;Gr(e.doc,a)!=a;){if(m==(r<0?0:G.length-1))return null;a+=r*G[m-(r<0?1:0)].size,m+=r}return{index:m,lineN:a}}function Xs(e,t,a){var r=e.display,m=r.view;m.length==0||t>=r.viewTo||a<=r.viewFrom?(r.view=Vn(e,t,a),r.viewFrom=t):(r.viewFrom>t?r.view=Vn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(gi(e,t))),r.viewFrom=t,r.viewTo<a?r.view=r.view.concat(Vn(e,r.viewTo,a)):r.viewTo>a&&(r.view=r.view.slice(0,gi(e,a)))),r.viewTo=a}function So(e){for(var t=e.display.view,a=0,r=0;r<t.length;r++){var m=t[r];!m.hidden&&(!m.node||m.changes)&&++a}return a}function Gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Oo(e,t){t===void 0&&(t=!0);for(var a=e.doc,r={},m=r.cursors=document.createDocumentFragment(),M=r.selection=document.createDocumentFragment(),G=0;G<a.sel.ranges.length;G++){if(!t&&G==a.sel.primIndex)continue;var X=a.sel.ranges[G];if(X.from().line>=e.display.viewTo||X.to().line<e.display.viewFrom)continue;var $=X.empty();($||e.options.showCursorWhenSelecting)&&wo(e,X.head,m),$||Vs(e,X,M)}return r}function wo(e,t,a){var r=Yr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),m=a.appendChild(c("div","\xA0","CodeMirror-cursor"));if(m.style.left=r.left+"px",m.style.top=r.top+"px",m.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var M=a.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=r.other.left+"px",M.style.top=r.other.top+"px",M.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function ha(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,a){var r=e.display,m=e.doc,M=document.createDocumentFragment(),G=wr(e.display),X=G.left,$=Math.max(r.sizerWidth,$n(e)-r.sizer.offsetLeft)-G.right,Z=m.direction=="ltr";function de(mt,Ot,Ht,Nt){Ot<0&&(Ot=0),Ot=Math.round(Ot),Nt=Math.round(Nt),M.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+mt+`px;
top: `+Ot+"px; width: "+(Ht==null?$-mt:Ht)+`px;
height: `+(Nt-Ot)+"px"))}function ve(mt,Ot,Ht){var Nt=bt(m,mt),nn=Nt.text.length,Dn,or;function jn(Qn,Dr){return Ma(e,nt(mt,Qn),"div",Nt,Dr)}function kr(Qn,Dr,hr){var tr=xo(e,Nt,null,Qn),Zn=Dr=="ltr"==(hr=="after")?"left":"right",Wn=hr=="after"?tr.begin:tr.end-(/\s/.test(Nt.text.charAt(tr.end-1))?2:1);return jn(Wn,Zn)[Zn]}var Ar=ht(Nt,m.direction);return ft(Ar,Ot||0,Ht==null?nn:Ht,function(Qn,Dr,hr,tr){var Zn=hr=="ltr",Wn=jn(Qn,Zn?"left":"right"),Lr=jn(Dr-1,Zn?"right":"left"),ji=Ot==null&&Qn==0,hi=Ht==null&&Dr==nn,Er=tr==0,ti=!Ar||tr==Ar.length-1;if(Lr.top-Wn.top<=3){var sr=(Z?ji:hi)&&Er,co=(Z?hi:ji)&&ti,ai=sr?X:(Zn?Wn:Lr).left,Ei=co?$:(Zn?Lr:Wn).right;de(ai,Wn.top,Ei-ai,Wn.bottom)}else{var xi,Sr,Bi,fo;Zn?(xi=Z&&ji&&Er?X:Wn.left,Sr=Z?$:kr(Qn,hr,"before"),Bi=Z?X:kr(Dr,hr,"after"),fo=Z&&hi&&ti?$:Lr.right):(xi=Z?kr(Qn,hr,"before"):X,Sr=!Z&&ji&&Er?$:Wn.right,Bi=!Z&&hi&&ti?X:Lr.left,fo=Z?kr(Dr,hr,"after"):$),de(xi,Wn.top,Sr-xi,Wn.bottom),Wn.bottom<Lr.top&&de(X,Wn.bottom,null,Lr.top),de(Bi,Lr.top,fo-Bi,Lr.bottom)}(!Dn||ha(Wn,Dn)<0)&&(Dn=Wn),ha(Lr,Dn)<0&&(Dn=Lr),(!or||ha(Wn,or)<0)&&(or=Wn),ha(Lr,or)<0&&(or=Lr)}),{start:Dn,end:or}}var De=t.from(),Oe=t.to();if(De.line==Oe.line)ve(De.line,De.ch,Oe.ch);else{var Ge=bt(m,De.line),qe=bt(m,Oe.line),st=dr(Ge)==dr(qe),pt=ve(De.line,De.ch,st?Ge.text.length+1:null).end,Tt=ve(Oe.line,st?0:null,Oe.ch).start;st&&(pt.top<Tt.top-2?(de(pt.right,pt.top,null,pt.bottom),de(X,Tt.top,Tt.left,Tt.bottom)):de(pt.right,pt.top,Tt.left-pt.right,pt.bottom)),pt.bottom<Tt.top&&de(X,pt.bottom,null,Tt.top)}a.appendChild(M)}function Ba(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var a=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ci(e),t.cursorDiv.style.visibility=(a=!a)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Co(e){e.state.focused||(e.display.input.focus(),Wa(e))}function Ro(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ci(e))},100)}function Wa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ee(e,"focus",e,t),e.state.focused=!0,P(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()),Ba(e)}function Ci(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ee(e,"blur",e,t),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function pa(e){for(var t=e.display,a=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var m=t.view[r],M=e.options.lineWrapping,G=void 0,X=0;if(m.hidden)continue;if(j&&k<8){var $=m.node.offsetTop+m.node.offsetHeight;G=$-a,a=$}else{var Z=m.node.getBoundingClientRect();G=Z.bottom-Z.top,!M&&m.text.firstChild&&(X=m.text.firstChild.getBoundingClientRect().right-Z.left-1)}var de=m.line.height-G;if((de>.005||de<-.005)&&(Tn(m.line,G),Ao(m.line),m.rest))for(var ve=0;ve<m.rest.length;ve++)Ao(m.rest[ve]);if(X>e.display.sizerWidth){var De=Math.ceil(X/wi(e.display));De>e.display.maxLineLength&&(e.display.maxLineLength=De,e.display.maxLine=m.line,e.display.maxLineChanged=!0)}}}function Ao(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],r=a.node.parentNode;r&&(a.height=r.offsetHeight)}}function ma(e,t,a){var r=a&&a.top!=null?Math.max(0,a.top):e.scroller.scrollTop;r=Math.floor(r-Wr(e));var m=a&&a.bottom!=null?a.bottom:r+e.wrapper.clientHeight,M=Sn(t,r),G=Sn(t,m);if(a&&a.ensure){var X=a.ensure.from.line,$=a.ensure.to.line;X<M?(M=X,G=Sn(t,Fn(bt(t,X))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=G&&(M=Sn(t,Fn(bt(t,$))-e.wrapper.clientHeight),G=$)}return{from:M,to:Math.max(G,M+1)}}function Ys(e,t){if(Ie(e,"scrollCursorIntoView"))return;var a=e.display,r=a.sizer.getBoundingClientRect(),m=null;if(t.top+r.top<0?m=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(m=!1),m!=null&&!s){var M=c("div","\u200B",null,`position: absolute;
top: `+(t.top-a.viewOffset-Wr(e.display))+`px;
height: `+(t.bottom-t.top+Kn(e)+a.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(m),e.display.lineSpace.removeChild(M)}}function $s(e,t,a,r){r==null&&(r=0);var m;!e.options.lineWrapping&&t==a&&(t=t.ch?nt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,a=t.sticky=="before"?nt(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var G=!1,X=Yr(e,t),$=!a||a==t?X:Yr(e,a);m={left:Math.min(X.left,$.left),top:Math.min(X.top,$.top)-r,right:Math.max(X.left,$.left),bottom:Math.max(X.bottom,$.bottom)+r};var Z=Ha(e,m),de=e.doc.scrollTop,ve=e.doc.scrollLeft;if(Z.scrollTop!=null&&(Xi(e,Z.scrollTop),Math.abs(e.doc.scrollTop-de)>1&&(G=!0)),Z.scrollLeft!=null&&(vi(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-ve)>1&&(G=!0)),!G)break}return m}function Js(e,t){var a=Ha(e,t);a.scrollTop!=null&&Xi(e,a.scrollTop),a.scrollLeft!=null&&vi(e,a.scrollLeft)}function Ha(e,t){var a=e.display,r=Oi(e.display);t.top<0&&(t.top=0);var m=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:a.scroller.scrollTop,M=Hr(e),G={};t.bottom-t.top>M&&(t.bottom=t.top+M);var X=e.doc.height+Xr(a),$=t.top<r,Z=t.bottom>X-r;if(t.top<m)G.scrollTop=$?0:t.top;else if(t.bottom>m+M){var de=Math.min(t.top,(Z?X:t.bottom)-M);de!=m&&(G.scrollTop=de)}var ve=e.options.fixedGutter?0:a.gutters.offsetWidth,De=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:a.scroller.scrollLeft-ve,Oe=$n(e)-a.gutters.offsetWidth,Ge=t.right-t.left>Oe;return Ge&&(t.right=t.left+Oe),t.left<10?G.scrollLeft=0:t.left<De?G.scrollLeft=Math.max(0,t.left+ve-(Ge?0:10)):t.right>Oe+De-3&&(G.scrollLeft=t.right+(Ge?0:10)-Oe),G}function Ka(e,t){if(t==null)return;ga(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ri(e){ga(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function zi(e,t,a){(t!=null||a!=null)&&ga(e),t!=null&&(e.curOp.scrollLeft=t),a!=null&&(e.curOp.scrollTop=a)}function Qs(e,t){ga(e),e.curOp.scrollToPos=t}function ga(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var a=bo(e,t.from),r=bo(e,t.to);Do(e,a,r,t.margin)}}function Do(e,t,a,r){var m=Ha(e,{left:Math.min(t.left,a.left),top:Math.min(t.top,a.top)-r,right:Math.max(t.right,a.right),bottom:Math.max(t.bottom,a.bottom)+r});zi(e,m.scrollLeft,m.scrollTop)}function Xi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;L||za(e,{top:t}),Lo(e,t,!0),L&&za(e),$i(e,100)}function Lo(e,t,a){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!a)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function vi(e,t,a,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(a?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,ko(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vi(e){var t=e.display,a=t.gutters.offsetWidth,r=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?a:0,docHeight:r,scrollHeight:r+Kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:a}}var _i=function(e,t,a){this.cm=a;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),m=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=m.tabIndex=-1,e(r),e(m),_e(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),_e(m,"scroll",function(){m.clientWidth&&t(m.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,j&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};_i.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,a=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var m=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+m)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=a?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(a?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:a?r:0,bottom:t?r:0}},_i.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},_i.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},_i.prototype.zeroWidthHack=function(){var e=n&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},_i.prototype.enableZeroWidthBar=function(e,t,a){e.style.pointerEvents="auto";function r(){var m=e.getBoundingClientRect(),M=a=="vert"?document.elementFromPoint(m.right-1,(m.top+m.bottom)/2):document.elementFromPoint((m.right+m.left)/2,m.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},_i.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Yi=function(){};Yi.prototype.update=function(){return{bottom:0,right:0}},Yi.prototype.setScrollLeft=function(){},Yi.prototype.setScrollTop=function(){},Yi.prototype.clear=function(){};function Ai(e,t){t||(t=Vi(e));var a=e.display.barWidth,r=e.display.barHeight;Io(e,t);for(var m=0;m<4&&a!=e.display.barWidth||r!=e.display.barHeight;m++)a!=e.display.barWidth&&e.options.lineWrapping&&pa(e),Io(e,Vi(e)),a=e.display.barWidth,r=e.display.barHeight}function Io(e,t){var a=e.display,r=a.scrollbars.update(t);a.sizer.style.paddingRight=(a.barWidth=r.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=r.bottom)+"px",a.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=r.bottom+"px",a.scrollbarFiller.style.width=r.right+"px"):a.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=r.bottom+"px",a.gutterFiller.style.width=t.gutterWidth+"px"):a.gutterFiller.style.display=""}var Mo={native:_i,null:Yi};function Po(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(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),_e(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,a){a=="horizontal"?vi(e,t):Xi(e,t)},e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function yi(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:++Zs},cr(e.curOp)}function bi(e){var t=e.curOp;t&&gn(t,function(a){for(var r=0;r<a.ops.length;r++)a.ops[r].cm.curOp=null;qs(a)})}function qs(e){for(var t=e.ops,a=0;a<t.length;a++)el(t[a]);for(var r=0;r<t.length;r++)tl(t[r]);for(var m=0;m<t.length;m++)nl(t[m]);for(var M=0;M<t.length;M++)rl(t[M]);for(var G=0;G<t.length;G++)il(t[G])}function el(e){var t=e.cm,a=t.display;ol(t),e.updateMaxLine&&zr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<a.viewFrom||e.scrollToPos.to.line>=a.viewTo)||a.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new va(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ga(e.cm,e.update)}function nl(e){var t=e.cm,a=t.display;e.updatedDisplay&&pa(t),e.barMeasure=Vi(t),a.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Vr(t,a.maxLine,a.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+e.adjustWidthTo+Kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+e.adjustWidthTo-$n(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=a.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&&vi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var a=e.focus&&e.focus==I();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,a),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ai(t,e.barMeasure),e.updatedDisplay&&Va(t,e.barMeasure),e.selectionChanged&&Ba(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),a&&Co(e.cm)}function il(e){var t=e.cm,a=t.display,r=t.doc;if(e.updatedDisplay&&No(t,e.update),a.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(a.wheelStartX=a.wheelStartY=null),e.scrollTop!=null&&Lo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vi(t,e.scrollLeft,!0,!0),e.scrollToPos){var m=$s(t,Lt(r,e.scrollToPos.from),Lt(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,m)}var M=e.maybeHiddenMarkers,G=e.maybeUnhiddenMarkers;if(M)for(var X=0;X<M.length;++X)M[X].lines.length||Ee(M[X],"hide");if(G)for(var $=0;$<G.length;++$)G[$].lines.length&&Ee(G[$],"unhide");a.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ee(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Nr(e,t){if(e.curOp)return t();yi(e);try{return t()}finally{bi(e)}}function ir(e,t){return function(){if(e.curOp)return t.apply(e,arguments);yi(e);try{return t.apply(e,arguments)}finally{bi(e)}}}function Tr(e){return function(){if(this.curOp)return e.apply(this,arguments);yi(this);try{return e.apply(this,arguments)}finally{bi(this)}}}function ar(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);yi(t);try{return e.apply(this,arguments)}finally{bi(t)}}}function $i(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var a=+new Date+e.options.workTime,r=rn(e,t.highlightFrontier),m=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(r.line>=e.display.viewFrom){var G=M.styles,X=M.text.length>e.options.maxHighlightLength?vt(t.mode,r.state):null,$=vn(e,M,r,!0);X&&(r.state=X),M.styles=$.styles;var Z=M.styleClasses,de=$.classes;de?M.styleClasses=de:Z&&(M.styleClasses=null);for(var ve=!G||G.length!=M.styles.length||Z!=de&&(!Z||!de||Z.bgClass!=de.bgClass||Z.textClass!=de.textClass),De=0;!ve&&De<G.length;++De)ve=G[De]!=M.styles[De];ve&&m.push(r.line),M.stateAfter=r.save(),r.nextLine()}else M.text.length<=e.options.maxHighlightLength&&Gt(e,M.text,r),M.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>a)return $i(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),m.length&&Nr(e,function(){for(var M=0;M<m.length;M++)oi(e,m[M],"text")})}var va=function(e,t,a){var r=e.display;this.viewport=t,this.visible=ma(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$n(e),this.force=a,this.dims=Ua(e),this.events=[]};va.prototype.signal=function(e,t){ae(e,t)&&this.events.push(arguments)},va.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ee.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=Kn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Kn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=I();if(!t||!b(e.display.lineDiv,t))return null;var a={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&b(e.display.lineDiv,r.anchorNode)&&(a.anchorNode=r.anchorNode,a.anchorOffset=r.anchorOffset,a.focusNode=r.focusNode,a.focusOffset=r.focusOffset)}return a}function ll(e){if(!e||!e.activeElt||e.activeElt==I())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),a=document.createRange();a.setEnd(e.anchorNode,e.anchorOffset),a.collapse(!1),t.removeAllRanges(),t.addRange(a),t.extend(e.focusNode,e.focusOffset)}}function Ga(e,t){var a=e.display,r=e.doc;if(t.editorIsHidden)return si(e),!1;if(!t.force&&t.visible.from>=a.viewFrom&&t.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&So(e)==0)return!1;Uo(e)&&(si(e),t.dims=Ua(e));var m=r.first+r.size,M=Math.max(t.visible.from-e.options.viewportMargin,r.first),G=Math.min(m,t.visible.to+e.options.viewportMargin);a.viewFrom<M&&M-a.viewFrom<20&&(M=Math.max(r.first,a.viewFrom)),a.viewTo>G&&a.viewTo-G<20&&(G=Math.min(m,a.viewTo)),kt&&(M=Gr(e.doc,M),G=Mr(e.doc,G));var X=M!=a.viewFrom||G!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth;Xs(e,M,G),a.viewOffset=Fn(bt(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px";var $=So(e);if(!X&&$==0&&!t.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var Z=sl(e);return $>4&&(a.lineDiv.style.display="none"),ul(e,a.updateLineNumbers,t.dims),$>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,ll(Z),v(a.cursorDiv),v(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,X&&(a.lastWrapHeight=t.wrapperHeight,a.lastWrapWidth=t.wrapperWidth,$i(e,400)),a.updateLineNumbers=null,!0}function No(e,t){for(var a=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==$n(e)){if(a&&a.top!=null&&(a={top:Math.min(e.doc.height+Xr(e.display)-Hr(e),a.top)}),t.visible=ma(e.display,e.doc,a),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ma(e.display,e.doc,a));if(!Ga(e,t))break;pa(e);var m=Vi(e);Gi(e),Ai(e,m),Va(e,m),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 za(e,t){var a=new va(e,t);if(Ga(e,a)){pa(e),No(e,a);var r=Vi(e);Gi(e),Ai(e,r),Va(e,r),a.finish()}}function ul(e,t,a){var r=e.display,m=e.options.lineNumbers,M=r.lineDiv,G=M.firstChild;function X(Ge){var qe=Ge.nextSibling;return A&&n&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),qe}for(var $=r.view,Z=r.viewFrom,de=0;de<$.length;de++){var ve=$[de];if(!ve.hidden)if(!ve.node||ve.node.parentNode!=M){var De=on(e,ve,Z,a);M.insertBefore(De,G)}else{for(;G!=ve.node;)G=X(G);var Oe=m&&t!=null&&t<=Z&&ve.lineNumber;ve.changes&&(J(ve.changes,"gutter")>-1&&(Oe=!1),Zr(e,ve,Z,a)),Oe&&(v(ve.lineNumber),ve.lineNumber.appendChild(document.createTextNode(pr(e.options,Z)))),G=ve.node.nextSibling}Z+=ve.size}for(;G;)G=X(G)}function Xa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Va(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+Kn(e)+"px"}function ko(e){var t=e.display,a=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Fa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,m=t.gutters.offsetWidth,M=r+"px",G=0;G<a.length;G++)if(!a[G].hidden){e.options.fixedGutter&&(a[G].gutter&&(a[G].gutter.style.left=M),a[G].gutterBackground&&(a[G].gutterBackground.style.left=M));var X=a[G].alignable;if(X)for(var $=0;$<X.length;$++)X[$].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=r+m+"px")}function Uo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=pr(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var m=r.measure.appendChild(c("div",[c("div",a)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=m.firstChild.offsetWidth,G=m.offsetWidth-M;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(M,r.lineGutter.offsetWidth-G)+1,r.lineNumWidth=r.lineNumInnerWidth+G,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Xa(e.display),!0}return!1}function Ya(e,t){for(var a=[],r=!1,m=0;m<e.length;m++){var M=e[m],G=null;if(typeof M!="string"&&(G=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)r=!0;else continue;a.push({className:M,style:G})}return t&&!r&&a.push({className:"CodeMirror-linenumbers",style:null}),a}function Fo(e){var t=e.gutters,a=e.gutterSpecs;v(t),e.lineGutter=null;for(var r=0;r<a.length;++r){var m=a[r],M=m.className,G=m.style,X=t.appendChild(c("div",null,"CodeMirror-gutter "+M));G&&(X.style.cssText=G),M=="CodeMirror-linenumbers"&&(e.lineGutter=X,X.style.width=(e.lineNumWidth||1)+"px")}t.style.display=a.length?"":"none",Xa(e)}function Ji(e){Fo(e.display),Cr(e),ko(e)}function dl(e,t,a,r){var m=this;this.input=a,m.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),m.scrollbarFiller.setAttribute("cm-not-content","true"),m.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),m.gutterFiller.setAttribute("cm-not-content","true"),m.lineDiv=E("div",null,"CodeMirror-code"),m.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),m.cursorDiv=c("div",null,"CodeMirror-cursors"),m.measure=c("div",null,"CodeMirror-measure"),m.lineMeasure=c("div",null,"CodeMirror-measure"),m.lineSpace=E("div",[m.measure,m.lineMeasure,m.selectionDiv,m.cursorDiv,m.lineDiv],null,"position: relative; outline: none");var M=E("div",[m.lineSpace],"CodeMirror-lines");m.mover=c("div",[M],null,"position: relative"),m.sizer=c("div",[m.mover],"CodeMirror-sizer"),m.sizerWidth=null,m.heightForcer=c("div",null,null,"position: absolute; height: "+ne+"px; width: 1px;"),m.gutters=c("div",null,"CodeMirror-gutters"),m.lineGutter=null,m.scroller=c("div",[m.sizer,m.heightForcer,m.gutters],"CodeMirror-scroll"),m.scroller.setAttribute("tabIndex","-1"),m.wrapper=c("div",[m.scrollbarFiller,m.gutterFiller,m.scroller],"CodeMirror"),j&&k<8&&(m.gutters.style.zIndex=-1,m.scroller.style.paddingRight=0),!A&&!(L&&o)&&(m.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(m.wrapper):e(m.wrapper)),m.viewFrom=m.viewTo=t.first,m.reportedViewFrom=m.reportedViewTo=t.first,m.view=[],m.renderedView=null,m.externalMeasured=null,m.viewOffset=0,m.lastWrapHeight=m.lastWrapWidth=0,m.updateLineNumbers=null,m.nativeBarWidth=m.barHeight=m.barWidth=0,m.scrollbarsClipped=!1,m.lineNumWidth=m.lineNumInnerWidth=m.lineNumChars=null,m.alignWidgets=!1,m.cachedCharWidth=m.cachedTextHeight=m.cachedPaddingH=null,m.maxLine=null,m.maxLineLength=0,m.maxLineChanged=!1,m.wheelDX=m.wheelDY=m.wheelStartX=m.wheelStartY=null,m.shift=!1,m.selForContextMenu=null,m.activeTouch=null,m.gutterSpecs=Ya(r.gutters,r.lineNumbers),Fo(m),a.init(m)}var _a=0,Fr=null;j?Fr=-.53:L?Fr=15:g?Fr=-.7:u&&(Fr=-1/3);function jo(e){var t=e.wheelDeltaX,a=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),a==null&&e.detail&&e.axis==e.VERTICAL_AXIS?a=e.detail:a==null&&(a=e.wheelDelta),{x:t,y:a}}function cl(e){var t=jo(e);return t.x*=Fr,t.y*=Fr,t}function Bo(e,t){var a=jo(t),r=a.x,m=a.y,M=e.display,G=M.scroller,X=G.scrollWidth>G.clientWidth,$=G.scrollHeight>G.clientHeight;if(!(r&&X||m&&$))return;if(m&&n&&A){e:for(var Z=t.target,de=M.view;Z!=G;Z=Z.parentNode)for(var ve=0;ve<de.length;ve++)if(de[ve].node==Z){e.display.currentWheelTarget=Z;break e}}if(r&&!L&&!h&&Fr!=null){m&&$&&Xi(e,Math.max(0,G.scrollTop+m*Fr)),vi(e,Math.max(0,G.scrollLeft+r*Fr)),(!m||m&&$)&&Q(t),M.wheelStartX=null;return}if(m&&Fr!=null){var De=m*Fr,Oe=e.doc.scrollTop,Ge=Oe+M.wrapper.clientHeight;De<0?Oe=Math.max(0,Oe+De-50):Ge=Math.min(e.doc.height,Ge+De+50),za(e,{top:Oe,bottom:Ge})}_a<20&&(M.wheelStartX==null?(M.wheelStartX=G.scrollLeft,M.wheelStartY=G.scrollTop,M.wheelDX=r,M.wheelDY=m,setTimeout(function(){if(M.wheelStartX==null)return;var qe=G.scrollLeft-M.wheelStartX,st=G.scrollTop-M.wheelStartY,pt=st&&M.wheelDY&&st/M.wheelDY||qe&&M.wheelDX&&qe/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!pt)return;Fr=(Fr*_a+pt)/(_a+1),++_a},200)):(M.wheelDX+=r,M.wheelDY+=m))}var jr=function(e,t){this.ranges=e,this.primIndex=t};jr.prototype.primary=function(){return this.ranges[this.primIndex]},jr.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 a=this.ranges[t],r=e.ranges[t];if(!qn(a.anchor,r.anchor)||!qn(a.head,r.head))return!1}return!0},jr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new En(xr(this.ranges[t].anchor),xr(this.ranges[t].head));return new jr(e,this.primIndex)},jr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},jr.prototype.contains=function(e,t){t||(t=e);for(var a=0;a<this.ranges.length;a++){var r=this.ranges[a];if(ct(t,r.from())>=0&&ct(e,r.to())<=0)return a}return-1};var En=function(e,t){this.anchor=e,this.head=t};En.prototype.from=function(){return Ur(this.anchor,this.head)},En.prototype.to=function(){return mr(this.anchor,this.head)},En.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function $r(e,t,a){var r=e&&e.options.selectionsMayTouch,m=t[a];t.sort(function(De,Oe){return ct(De.from(),Oe.from())}),a=J(t,m);for(var M=1;M<t.length;M++){var G=t[M],X=t[M-1],$=ct(X.to(),G.from());if(r&&!G.empty()?$>0:$>=0){var Z=Ur(X.from(),G.from()),de=mr(X.to(),G.to()),ve=X.empty()?G.from()==G.head:X.from()==X.head;M<=a&&--a,t.splice(--M,2,new En(ve?de:Z,ve?Z:de))}}return new jr(t,a)}function li(e,t){return new jr([new En(e,t||e)],0)}function ui(e){return e.text?nt(e.from.line+e.text.length-1,xe(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 ui(t);var a=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ui(t).ch-t.to.ch),nt(a,r)}function $a(e,t){for(var a=[],r=0;r<e.sel.ranges.length;r++){var m=e.sel.ranges[r];a.push(new En(Wo(m.anchor,t),Wo(m.head,t)))}return $r(e.cm,a,e.sel.primIndex)}function Ho(e,t,a){return e.line==t.line?nt(a.line,e.ch-t.ch+a.ch):nt(a.line+(e.line-t.line),e.ch)}function fl(e,t,a){for(var r=[],m=nt(e.first,0),M=m,G=0;G<t.length;G++){var X=t[G],$=Ho(X.from,m,M),Z=Ho(ui(X),m,M);if(m=X.to,M=Z,a=="around"){var de=e.sel.ranges[G],ve=ct(de.head,de.anchor)<0;r[G]=new En(ve?Z:$,ve?$:Z)}else r[G]=new En($,$)}return new jr(r,e.sel.primIndex)}function Ja(e){e.doc.mode=Ae(e.options,e.doc.modeOption),Qi(e)}function Qi(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,$i(e,100),e.state.modeGen++,e.curOp&&Cr(e)}function Ko(e,t){return t.from.ch==0&&t.to.ch==0&&xe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Qa(e,t,a,r){function m(Tt){return a?a[Tt]:null}function M(Tt,mt,Ot){ni(Tt,mt,Ot,r),sn(Tt,"change",Tt,t)}function G(Tt,mt){for(var Ot=[],Ht=Tt;Ht<mt;++Ht)Ot.push(new gr(Z[Ht],m(Ht),r));return Ot}var X=t.from,$=t.to,Z=t.text,de=bt(e,X.line),ve=bt(e,$.line),De=xe(Z),Oe=m(Z.length-1),Ge=$.line-X.line;if(t.full)e.insert(0,G(0,Z.length)),e.remove(Z.length,e.size-Z.length);else if(Ko(e,t)){var qe=G(0,Z.length-1);M(ve,ve.text,Oe),Ge&&e.remove(X.line,Ge),qe.length&&e.insert(X.line,qe)}else if(de==ve)if(Z.length==1)M(de,de.text.slice(0,X.ch)+De+de.text.slice($.ch),Oe);else{var st=G(1,Z.length-1);st.push(new gr(De+de.text.slice($.ch),Oe,r)),M(de,de.text.slice(0,X.ch)+Z[0],m(0)),e.insert(X.line+1,st)}else if(Z.length==1)M(de,de.text.slice(0,X.ch)+Z[0]+ve.text.slice($.ch),m(0)),e.remove(X.line+1,Ge);else{M(de,de.text.slice(0,X.ch)+Z[0],m(0)),M(ve,De+ve.text.slice($.ch),Oe);var pt=G(1,Z.length-1);Ge>1&&e.remove(X.line+1,Ge-1),e.insert(X.line+1,pt)}sn(e,"change",e,t)}function di(e,t,a){function r(m,M,G){if(m.linked)for(var X=0;X<m.linked.length;++X){var $=m.linked[X];if($.doc==M)continue;var Z=G&&$.sharedHist;if(a&&!Z)continue;t($.doc,Z),r($.doc,m,Z)}}r(e,null,!0)}function Go(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ja(e),Ja(e),zo(e),e.options.lineWrapping||zr(e),e.options.mode=t.modeOption,Cr(e)}function zo(e){(e.doc.direction=="rtl"?P:y)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){Nr(e,function(){zo(e),Cr(e)})}function ya(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 Za(e,t){var a={from:xr(t.from),to:ui(t),text:Rn(e,t.from,t.to)};return Yo(e,a,t.from.line,t.to.line+1),di(e,function(r){return Yo(r,a,t.from.line,t.to.line+1)},!0),a}function Xo(e){for(;e.length;){var t=xe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Xo(e.done),xe(e.done);if(e.done.length&&!xe(e.done).ranges)return xe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),xe(e.done)}function Vo(e,t,a,r){var m=e.history;m.undone.length=0;var M=+new Date,G,X;if((m.lastOp==r||m.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&m.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(G=pl(m,m.lastOp==r)))X=xe(G.changes),ct(t.from,t.to)==0&&ct(t.from,X.to)==0?X.to=ui(t):G.changes.push(Za(e,t));else{var $=xe(m.done);for((!$||!$.ranges)&&ba(e.sel,m.done),G={changes:[Za(e,t)],generation:m.generation},m.done.push(G);m.done.length>m.undoDepth;)m.done.shift(),m.done[0].ranges||m.done.shift()}m.done.push(a),m.generation=++m.maxGeneration,m.lastModTime=m.lastSelTime=M,m.lastOp=m.lastSelOp=r,m.lastOrigin=m.lastSelOrigin=t.origin,X||Ee(e,"historyAdded")}function ml(e,t,a,r){var m=t.charAt(0);return m=="*"||m=="+"&&a.ranges.length==r.ranges.length&&a.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,a,r){var m=e.history,M=r&&r.origin;a==m.lastSelOp||M&&m.lastSelOrigin==M&&(m.lastModTime==m.lastSelTime&&m.lastOrigin==M||ml(e,M,xe(m.done),t))?m.done[m.done.length-1]=t:ba(t,m.done),m.lastSelTime=+new Date,m.lastSelOrigin=M,m.lastSelOp=a,r&&r.clearRedo!==!1&&Xo(m.undone)}function ba(e,t){var a=xe(t);a&&a.ranges&&a.equals(e)||t.push(e)}function Yo(e,t,a,r){var m=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,r),function(G){G.markedSpans&&((m||(m=t["spans_"+e.id]={}))[M]=G.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,a=0;a<e.length;++a)e[a].marker.explicitlyCleared?t||(t=e.slice(0,a)):t&&t.push(e[a]);return t?t.length?t:null:e}function _l(e,t){var a=t["spans_"+e.id];if(!a)return null;for(var r=[],m=0;m<t.text.length;++m)r.push(vl(a[m]));return r}function $o(e,t){var a=_l(e,t),r=xn(e,t);if(!a)return r;if(!r)return a;for(var m=0;m<a.length;++m){var M=a[m],G=r[m];if(M&&G){e:for(var X=0;X<G.length;++X){for(var $=G[X],Z=0;Z<M.length;++Z)if(M[Z].marker==$.marker)continue e;M.push($)}}else G&&(a[m]=G)}return a}function Di(e,t,a){for(var r=[],m=0;m<e.length;++m){var M=e[m];if(M.ranges){r.push(a?jr.prototype.deepCopy.call(M):M);continue}var G=M.changes,X=[];r.push({changes:X});for(var $=0;$<G.length;++$){var Z=G[$],de=void 0;if(X.push({from:Z.from,to:Z.to,text:Z.text}),t)for(var ve in Z)(de=ve.match(/^spans_(\d+)$/))&&(J(t,Number(de[1]))>-1&&(xe(X)[ve]=Z[ve],delete Z[ve]))}}return r}function qa(e,t,a,r){if(r){var m=e.anchor;if(a){var M=ct(t,m)<0;M!=ct(a,m)<0?(m=t,t=a):M!=ct(t,a)<0&&(t=a)}return new En(m,t)}else return new En(a||t,t)}function Ea(e,t,a,r,m){m==null&&(m=e.cm&&(e.cm.display.shift||e.extend)),br(e,new jr([qa(e.sel.primary(),t,a,m)],0),r)}function Jo(e,t,a){for(var r=[],m=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)r[M]=qa(e.sel.ranges[M],t[M],null,m);var G=$r(e.cm,r,e.sel.primIndex);br(e,G,a)}function eo(e,t,a,r){var m=e.sel.ranges.slice(0);m[t]=a,br(e,$r(e.cm,m,e.sel.primIndex),r)}function Qo(e,t,a,r){br(e,li(t,a),r)}function yl(e,t,a){var r={ranges:t.ranges,update:function(m){this.ranges=[];for(var M=0;M<m.length;M++)this.ranges[M]=new En(Lt(e,m[M].anchor),Lt(e,m[M].head))},origin:a&&a.origin};return Ee(e,"beforeSelectionChange",e,r),e.cm&&Ee(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?$r(e.cm,r.ranges,r.ranges.length-1):t}function Zo(e,t,a){var r=e.history.done,m=xe(r);m&&m.ranges?(r[r.length-1]=t,xa(e,t,a)):br(e,t,a)}function br(e,t,a){xa(e,t,a),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,a)}function xa(e,t,a){(ae(e,"beforeSelectionChange")||e.cm&&ae(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,a));var r=a&&a.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);qo(e,ts(e,t,r,!0)),!(a&&a.scroll===!1)&&e.cm&&Ri(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,pe(e.cm)),sn(e,"cursorActivity",e)}function es(e){qo(e,ts(e,e.sel,null,!1))}function ts(e,t,a,r){for(var m,M=0;M<t.ranges.length;M++){var G=t.ranges[M],X=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],$=Ta(e,G.anchor,X&&X.anchor,a,r),Z=Ta(e,G.head,X&&X.head,a,r);(m||$!=G.anchor||Z!=G.head)&&(m||(m=t.ranges.slice(0,M)),m[M]=new En($,Z))}return m?$r(e.cm,m,t.primIndex):t}function Li(e,t,a,r,m){var M=bt(e,t.line);if(M.markedSpans)for(var G=0;G<M.markedSpans.length;++G){var X=M.markedSpans[G],$=X.marker,Z="selectLeft"in $?!$.selectLeft:$.inclusiveLeft,de="selectRight"in $?!$.selectRight:$.inclusiveRight;if((X.from==null||(Z?X.from<=t.ch:X.from<t.ch))&&(X.to==null||(de?X.to>=t.ch:X.to>t.ch))){if(m&&(Ee($,"beforeCursorEnter"),$.explicitlyCleared))if(M.markedSpans){--G;continue}else break;if(!$.atomic)continue;if(a){var ve=$.find(r<0?1:-1),De=void 0;if((r<0?de:Z)&&(ve=ns(e,ve,-r,ve&&ve.line==t.line?M:null)),ve&&ve.line==t.line&&(De=ct(ve,a))&&(r<0?De<0:De>0))return Li(e,ve,t,r,m)}var Oe=$.find(r<0?-1:1);return(r<0?Z:de)&&(Oe=ns(e,Oe,r,Oe.line==t.line?M:null)),Oe?Li(e,Oe,t,r,m):null}}return t}function Ta(e,t,a,r,m){var M=r||1,G=Li(e,t,a,M,m)||!m&&Li(e,t,a,M,!0)||Li(e,t,a,-M,m)||!m&&Li(e,t,a,-M,!0);return G||(e.cantEdit=!0,nt(e.first,0))}function ns(e,t,a,r){return a<0&&t.ch==0?t.line>e.first?Lt(e,nt(t.line-1)):null:a>0&&t.ch==(r||bt(e,t.line)).text.length?t.line<e.first+e.size-1?nt(t.line+1,0):null:new nt(t.line,t.ch+a)}function rs(e){e.setSelection(nt(e.firstLine(),0),nt(e.lastLine()),ue)}function is(e,t,a){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return a&&(r.update=function(m,M,G,X){m&&(r.from=Lt(e,m)),M&&(r.to=Lt(e,M)),G&&(r.text=G),X!==void 0&&(r.origin=X)}),Ee(e,"beforeChange",e,r),e.cm&&Ee(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ii(e,t,a){if(e.cm){if(!e.cm.curOp)return ir(e.cm,Ii)(e,t,a);if(e.cm.state.suppressEdits)return}if((ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"))&&(t=is(e,t,!0),!t))return;var r=Ln&&!a&&dn(e,t.from,t.to);if(r)for(var m=r.length-1;m>=0;--m)as(e,{from:r[m].from,to:r[m].to,text:m?[""]:t.text,origin:t.origin});else as(e,t)}function as(e,t){if(t.text.length==1&&t.text[0]==""&&ct(t.from,t.to)==0)return;var a=$a(e,t);Vo(e,t,a,e.cm?e.cm.curOp.id:NaN),Zi(e,t,a,xn(e,t));var r=[];di(e,function(m,M){!M&&J(r,m.history)==-1&&(us(m.history,t),r.push(m.history)),Zi(m,t,null,xn(m,t))})}function Sa(e,t,a){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!a)return;for(var m=e.history,M,G=e.sel,X=t=="undo"?m.done:m.undone,$=t=="undo"?m.undone:m.done,Z=0;Z<X.length&&!(M=X[Z],a?M.ranges&&!M.equals(e.sel):!M.ranges);Z++);if(Z==X.length)return;for(m.lastOrigin=m.lastSelOrigin=null;;)if(M=X.pop(),M.ranges){if(ba(M,$),a&&!M.equals(e.sel)){br(e,M,{clearRedo:!1});return}G=M}else if(r){X.push(M);return}else break;var de=[];ba(G,$),$.push({changes:de,generation:m.generation}),m.generation=M.generation||++m.maxGeneration;for(var ve=ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"),De=function(qe){var st=M.changes[qe];if(st.origin=t,ve&&!is(e,st,!1))return X.length=0,{};de.push(Za(e,st));var pt=qe?$a(e,st):xe(X);Zi(e,st,pt,$o(e,st)),!qe&&e.cm&&e.cm.scrollIntoView({from:st.from,to:ui(st)});var Tt=[];di(e,function(mt,Ot){!Ot&&J(Tt,mt.history)==-1&&(us(mt.history,st),Tt.push(mt.history)),Zi(mt,st,null,$o(mt,st))})},Oe=M.changes.length-1;Oe>=0;--Oe){var Ge=De(Oe);if(Ge)return Ge.v}}function os(e,t){if(t==0)return;if(e.first+=t,e.sel=new jr(Be(e.sel.ranges,function(m){return new En(nt(m.anchor.line+t,m.anchor.ch),nt(m.head.line+t,m.head.ch))}),e.sel.primIndex),e.cm){Cr(e.cm,e.first,e.first-t,t);for(var a=e.cm.display,r=a.viewFrom;r<a.viewTo;r++)oi(e.cm,r,"gutter")}}function Zi(e,t,a,r){if(e.cm&&!e.cm.curOp)return ir(e.cm,Zi)(e,t,a,r);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 m=t.text.length-1-(e.first-t.from.line);os(e,m),t={from:nt(e.first,0),to:nt(t.to.line+m,t.to.ch),text:[xe(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:nt(M,bt(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Rn(e,t.from,t.to),a||(a=$a(e,t)),e.cm?bl(e.cm,t,r):Qa(e,t,r),xa(e,a,ue),e.cantEdit&&Ta(e,nt(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,a){var r=e.doc,m=e.display,M=t.from,G=t.to,X=!1,$=M.line;e.options.lineWrapping||($=zt(dr(bt(r,M.line))),r.iter($,G.line+1,function(Oe){if(Oe==m.maxLine)return X=!0,!0})),r.sel.contains(t.from,t.to)>-1&&pe(e),Qa(r,t,a,To(e)),e.options.lineWrapping||(r.iter($,M.line+t.text.length,function(Oe){var Ge=Rt(Oe);Ge>m.maxLineLength&&(m.maxLine=Oe,m.maxLineLength=Ge,m.maxLineChanged=!0,X=!1)}),X&&(e.curOp.updateMaxLine=!0)),Qt(r,M.line),$i(e,400);var Z=t.text.length-(G.line-M.line)-1;t.full?Cr(e):M.line==G.line&&t.text.length==1&&!Ko(e.doc,t)?oi(e,M.line,"text"):Cr(e,M.line,G.line+1,Z);var de=ae(e,"changes"),ve=ae(e,"change");if(ve||de){var De={from:M,to:G,text:t.text,removed:t.removed,origin:t.origin};ve&&sn(e,"change",e,De),de&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(De)}e.display.selForContextMenu=null}function Mi(e,t,a,r,m){var M;r||(r=a),ct(r,a)<0&&(M=[r,a],a=M[0],r=M[1]),typeof t=="string"&&(t=e.splitLines(t)),Ii(e,{from:a,to:r,text:t,origin:m})}function ss(e,t,a,r){a<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ls(e,t,a,r){for(var m=0;m<e.length;++m){var M=e[m],G=!0;if(M.ranges){M.copied||(M=e[m]=M.deepCopy(),M.copied=!0);for(var X=0;X<M.ranges.length;X++)ss(M.ranges[X].anchor,t,a,r),ss(M.ranges[X].head,t,a,r);continue}for(var $=0;$<M.changes.length;++$){var Z=M.changes[$];if(a<Z.from.line)Z.from=nt(Z.from.line+r,Z.from.ch),Z.to=nt(Z.to.line+r,Z.to.ch);else if(t<=Z.to.line){G=!1;break}}G||(e.splice(0,m+1),m=0)}}function us(e,t){var a=t.from.line,r=t.to.line,m=t.text.length-(r-a)-1;ls(e.done,a,r,m),ls(e.undone,a,r,m)}function qi(e,t,a,r){var m=t,M=t;return typeof t=="number"?M=bt(e,Un(e,t)):m=zt(t),m==null?null:(r(M,m)&&e.cm&&oi(e.cm,m,a),M)}function ea(e){this.lines=e,this.parent=null;for(var t=0,a=0;a<e.length;++a)e[a].parent=this,t+=e[a].height;this.height=t}ea.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var a=e,r=e+t;a<r;++a){var m=this.lines[a];this.height-=m.height,wt(m),sn(m,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,a){this.height+=a,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,a){for(var r=e+t;e<r;++e)if(a(this.lines[e]))return!0}};function ta(e){this.children=e;for(var t=0,a=0,r=0;r<e.length;++r){var m=e[r];t+=m.chunkSize(),a+=m.height,m.parent=this}this.size=t,this.height=a,this.parent=null}ta.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var a=0;a<this.children.length;++a){var r=this.children[a],m=r.chunkSize();if(e<m){var M=Math.min(t,m-e),G=r.height;if(r.removeInner(e,M),this.height-=G-r.height,m==M&&(this.children.splice(a--,1),r.parent=null),(t-=M)==0)break;e=0}else e-=m}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ea))){var X=[];this.collapse(X),this.children=[new ea(X)],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,a){this.size+=t.length,this.height+=a;for(var r=0;r<this.children.length;++r){var m=this.children[r],M=m.chunkSize();if(e<=M){if(m.insertInner(e,t,a),m.lines&&m.lines.length>50){for(var G=m.lines.length%25+25,X=G;X<m.lines.length;){var $=new ea(m.lines.slice(X,X+=25));m.height-=$.height,this.children.splice(++r,0,$),$.parent=this}m.lines=m.lines.slice(0,G),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),a=new ta(t);if(e.parent){e.size-=a.size,e.height-=a.height;var m=J(e.parent.children,e);e.parent.children.splice(m+1,0,a)}else{var r=new ta(e.children);r.parent=e,e.children=[r,a],e=r}a.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,a){for(var r=0;r<this.children.length;++r){var m=this.children[r],M=m.chunkSize();if(e<M){var G=Math.min(t,M-e);if(m.iterN(e,G,a))return!0;if((t-=G)==0)break;e=0}else e-=M}}};var na=function(e,t,a){if(a)for(var r in a)a.hasOwnProperty(r)&&(this[r]=a[r]);this.doc=e,this.node=t};na.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,a=this.line,r=zt(a);if(r==null||!t)return;for(var m=0;m<t.length;++m)t[m]==this&&t.splice(m--,1);t.length||(a.widgets=null);var M=yr(this);Tn(a,Math.max(0,a.height-M)),e&&(Nr(e,function(){ds(e,a,-M),oi(e,r,"widget")}),sn(e,"lineWidgetCleared",e,this,r))},na.prototype.changed=function(){var e=this,t=this.height,a=this.doc.cm,r=this.line;this.height=null;var m=yr(this)-t;if(!m)return;Or(this.doc,r)||Tn(r,r.height+m),a&&Nr(a,function(){a.curOp.forceUpdate=!0,ds(a,r,m),sn(a,"lineWidgetChanged",a,e,zt(r))})},ie(na);function ds(e,t,a){Fn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ka(e,a)}function El(e,t,a,r){var m=new na(e,a,r),M=e.cm;return M&&m.noHScroll&&(M.display.alignWidgets=!0),qi(e,t,"widget",function(G){var X=G.widgets||(G.widgets=[]);if(m.insertAt==null?X.push(m):X.splice(Math.min(X.length-1,Math.max(0,m.insertAt)),0,m),m.line=G,M&&!Or(e,G)){var $=Fn(G)<e.scrollTop;Tn(G,G.height+yr(m)),$&&Ka(M,m.height),M.curOp.forceUpdate=!0}return!0}),M&&sn(M,"lineWidgetAdded",M,m,typeof t=="number"?t:zt(t)),m}var cs=0,ci=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++cs};ci.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&yi(e),ae(this,"clear")){var a=this.find();a&&sn(this,"clear",a.from,a.to)}for(var r=null,m=null,M=0;M<this.lines.length;++M){var G=this.lines[M],X=bn(G.markedSpans,this);e&&!this.collapsed?oi(e,zt(G),"text"):e&&(X.to!=null&&(m=zt(G)),X.from!=null&&(r=zt(G))),G.markedSpans=An(G.markedSpans,X),X.from==null&&this.collapsed&&!Or(this.doc,G)&&e&&Tn(G,Oi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var $=0;$<this.lines.length;++$){var Z=dr(this.lines[$]),de=Rt(Z);de>e.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=de,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Cr(e,r,m+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,r,m),t&&bi(e),this.parent&&this.parent.clear()},ci.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var a,r,m=0;m<this.lines.length;++m){var M=this.lines[m],G=bn(M.markedSpans,this);if(G.from!=null&&(a=nt(t?M:zt(M),G.from),e==-1))return a;if(G.to!=null&&(r=nt(t?M:zt(M),G.to),e==1))return r}return a&&{from:a,to:r}},ci.prototype.changed=function(){var e=this,t=this.find(-1,!0),a=this,r=this.doc.cm;if(!t||!r)return;Nr(r,function(){var m=t.line,M=zt(t.line),G=Pr(r,M);if(G&&(mo(G),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Or(a.doc,m)&&a.height!=null){var X=a.height;a.height=null;var $=yr(a)-X;$&&Tn(m,m.height+$)}sn(r,"markerChanged",r,e)})},ci.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||J(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ci.prototype.detachLine=function(e){if(this.lines.splice(J(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ie(ci);function Pi(e,t,a,r,m){if(r&&r.shared)return xl(e,t,a,r,m);if(e.cm&&!e.cm.curOp)return ir(e.cm,Pi)(e,t,a,r,m);var M=new ci(e,m),G=ct(t,a);if(r&&C(r,M,!1),G>0||G==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=E("span",[M.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(Mn(e,t.line,t,a,M)||t.line!=a.line&&Mn(e,a.line,t,a,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");Nn()}M.addToHistory&&Vo(e,{from:t,to:a,origin:"markText"},e.sel,NaN);var X=t.line,$=e.cm,Z;if(e.iter(X,a.line+1,function(ve){$&&M.collapsed&&!$.options.lineWrapping&&dr(ve)==$.display.maxLine&&(Z=!0),M.collapsed&&X!=t.line&&Tn(ve,0),nr(ve,new wn(M,X==t.line?t.ch:null,X==a.line?a.ch:null)),++X}),M.collapsed&&e.iter(t.line,a.line+1,function(ve){Or(e,ve)&&Tn(ve,0)}),M.clearOnEnter&&_e(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(In(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++cs,M.atomic=!0),$){if(Z&&($.curOp.updateMaxLine=!0),M.collapsed)Cr($,t.line,a.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var de=t.line;de<=a.line;de++)oi($,de,"text");M.atomic&&es($.doc),sn($,"markerAdded",$,M)}return M}var ra=function(e,t){this.markers=e,this.primary=t;for(var a=0;a<e.length;++a)e[a].parent=this};ra.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")},ra.prototype.find=function(e,t){return this.primary.find(e,t)},ie(ra);function xl(e,t,a,r,m){r=C(r),r.shared=!1;var M=[Pi(e,t,a,r,m)],G=M[0],X=r.widgetNode;return di(e,function($){X&&(r.widgetNode=X.cloneNode(!0)),M.push(Pi($,Lt($,t),Lt($,a),r,m));for(var Z=0;Z<$.linked.length;++Z)if($.linked[Z].isParent)return;G=xe(M)}),new ra(M,G)}function fs(e){return e.findMarks(nt(e.first,0),e.clipPos(nt(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var a=0;a<t.length;a++){var r=t[a],m=r.find(),M=e.clipPos(m.from),G=e.clipPos(m.to);if(ct(M,G)){var X=Pi(e,M,G,r.primary,r.primary.type);r.markers.push(X),X.parent=r}}}function Sl(e){for(var t=function(r){var m=e[r],M=[m.primary.doc];di(m.primary.doc,function($){return M.push($)});for(var G=0;G<m.markers.length;G++){var X=m.markers[G];J(M,X.doc)==-1&&(X.parent=null,m.markers.splice(G--,1))}},a=0;a<e.length;a++)t(a)}var Ol=0,Rr=function(e,t,a,r,m){if(!(this instanceof Rr))return new Rr(e,t,a,r,m);a==null&&(a=0),ta.call(this,[new ea([new gr("",null)])]),this.first=a,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=a;var M=nt(a,0);this.sel=li(M),this.history=new ya(null),this.id=++Ol,this.modeOption=t,this.lineSep=r,this.direction=m=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Qa(this,{from:M,to:M,text:e}),br(this,li(M),ue)};Rr.prototype=$e(ta.prototype,{constructor:Rr,iter:function(e,t,a){a?this.iterN(e-this.first,t-e,a):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var a=0,r=0;r<t.length;++r)a+=t[r].height;this.insertInner(e-this.first,t,a)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=zn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ar(function(e){var t=nt(this.first,0),a=this.first+this.size-1;Ii(this,{from:t,to:nt(a,bt(this,a).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&zi(this.cm,0,0),br(this,li(t),ue)}),replaceRange:function(e,t,a,r){t=Lt(this,t),a=a?Lt(this,a):t,Mi(this,e,t,a,r)},getRange:function(e,t,a){var r=Rn(this,Lt(this,e),Lt(this,t));return a===!1?r:r.join(a||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 zt(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 Lt(this,e)},getCursor:function(e){var t=this.sel.primary(),a;return e==null||e=="head"?a=t.head:e=="anchor"?a=t.anchor:e=="end"||e=="to"||e===!1?a=t.to():a=t.from(),a},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ar(function(e,t,a){Qo(this,Lt(this,typeof e=="number"?nt(e,t||0):e),null,a)}),setSelection:ar(function(e,t,a){Qo(this,Lt(this,e),Lt(this,t||e),a)}),extendSelection:ar(function(e,t,a){Ea(this,Lt(this,e),t&&Lt(this,t),a)}),extendSelections:ar(function(e,t){Jo(this,Ce(this,e),t)}),extendSelectionsBy:ar(function(e,t){var a=Be(this.sel.ranges,e);Jo(this,Ce(this,a),t)}),setSelections:ar(function(e,t,a){if(!e.length)return;for(var r=[],m=0;m<e.length;m++)r[m]=new En(Lt(this,e[m].anchor),Lt(this,e[m].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),br(this,$r(this.cm,r,t),a)}),addSelection:ar(function(e,t,a){var r=this.sel.ranges.slice(0);r.push(new En(Lt(this,e),Lt(this,t||e))),br(this,$r(this.cm,r,r.length-1),a)}),getSelection:function(e){for(var t=this.sel.ranges,a,r=0;r<t.length;r++){var m=Rn(this,t[r].from(),t[r].to());a=a?a.concat(m):m}return e===!1?a:a.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],a=this.sel.ranges,r=0;r<a.length;r++){var m=Rn(this,a[r].from(),a[r].to());e!==!1&&(m=m.join(e||this.lineSeparator())),t[r]=m}return t},replaceSelection:function(e,t,a){for(var r=[],m=0;m<this.sel.ranges.length;m++)r[m]=e;this.replaceSelections(r,t,a||"+input")},replaceSelections:ar(function(e,t,a){for(var r=[],m=this.sel,M=0;M<m.ranges.length;M++){var G=m.ranges[M];r[M]={from:G.from(),to:G.to(),text:this.splitLines(e[M]),origin:a}}for(var X=t&&t!="end"&&fl(this,r,t),$=r.length-1;$>=0;$--)Ii(this,r[$]);X?Zo(this,X):this.cm&&Ri(this.cm)}),undo:ar(function(){Sa(this,"undo")}),redo:ar(function(){Sa(this,"redo")}),undoSelection:ar(function(){Sa(this,"undo",!0)}),redoSelection:ar(function(){Sa(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,a=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var m=0;m<e.undone.length;m++)e.undone[m].ranges||++a;return{undo:t,redo:a}},clearHistory:function(){var e=this;this.history=new ya(this.history.maxGeneration),di(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:Di(this.history.done),undone:Di(this.history.undone)}},setHistory:function(e){var t=this.history=new ya(this.history.maxGeneration);t.done=Di(e.done.slice(0),null,!0),t.undone=Di(e.undone.slice(0),null,!0)},setGutterMarker:ar(function(e,t,a){return qi(this,e,"gutter",function(r){var m=r.gutterMarkers||(r.gutterMarkers={});return m[t]=a,!a&&at(m)&&(r.gutterMarkers=null),!0})}),clearGutter:ar(function(e){var t=this;this.iter(function(a){a.gutterMarkers&&a.gutterMarkers[e]&&qi(t,a,"gutter",function(){return a.gutterMarkers[e]=null,at(a.gutterMarkers)&&(a.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=zt(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:ar(function(e,t,a){return qi(this,e,t=="gutter"?"gutter":"class",function(r){var m=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[m])r[m]=a;else{if(T(a).test(r[m]))return!1;r[m]+=" "+a}return!0})}),removeLineClass:ar(function(e,t,a){return qi(this,e,t=="gutter"?"gutter":"class",function(r){var m=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=r[m];if(M)if(a==null)r[m]=null;else{var G=M.match(T(a));if(!G)return!1;var X=G.index+G[0].length;r[m]=M.slice(0,G.index)+(!G.index||X==M.length?"":" ")+M.slice(X)||null}else return!1;return!0})}),addLineWidget:ar(function(e,t,a){return El(this,e,t,a)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,a){return Pi(this,Lt(this,e),Lt(this,t),a,a&&a.type||"range")},setBookmark:function(e,t){var a={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Lt(this,e),Pi(this,e,e,a,"bookmark")},findMarksAt:function(e){e=Lt(this,e);var t=[],a=bt(this,e.line).markedSpans;if(a)for(var r=0;r<a.length;++r){var m=a[r];(m.from==null||m.from<=e.ch)&&(m.to==null||m.to>=e.ch)&&t.push(m.marker.parent||m.marker)}return t},findMarks:function(e,t,a){e=Lt(this,e),t=Lt(this,t);var r=[],m=e.line;return this.iter(e.line,t.line+1,function(M){var G=M.markedSpans;if(G)for(var X=0;X<G.length;X++){var $=G[X];!($.to!=null&&m==e.line&&e.ch>=$.to||$.from==null&&m!=e.line||$.from!=null&&m==t.line&&$.from>=t.ch)&&(!a||a($.marker))&&r.push($.marker.parent||$.marker)}++m}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var a=t.markedSpans;if(a)for(var r=0;r<a.length;++r)a[r].from!=null&&e.push(a[r].marker)}),e},posFromIndex:function(e){var t,a=this.first,r=this.lineSeparator().length;return this.iter(function(m){var M=m.text.length+r;if(M>e)return t=e,!0;e-=M,++a}),Lt(this,nt(a,t))},indexFromPos:function(e){e=Lt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var a=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+a}),t},copy:function(e){var t=new Rr(zn(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,a=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<a&&(a=e.to);var r=new Rr(zn(this,t,a),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,fs(this)),r},unlinkDoc:function(e){if(e instanceof kn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var a=this.linked[t];if(a.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(fs(this));break}if(e.history==this.history){var r=[e.id];di(e,function(m){return r.push(m.id)},!0),e.history=new ya(null),e.history.done=Di(this.history.done,r),e.history.undone=Di(this.history.undone,r)}},iterLinkedDocs:function(e){di(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Me(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:ar(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)})}),Rr.prototype.eachLine=Rr.prototype.iter;var hs=0;function wl(e){var t=this;if(ps(t),Ie(t,e)||Bt(t.display,e))return;Q(e),j&&(hs=+new Date);var a=mi(t,e,!0),r=e.dataTransfer.files;if(!a||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var m=r.length,M=Array(m),G=0,X=function(){++G==m&&ir(t,function(){a=Lt(t.doc,a);var Oe={from:a,to:a,text:t.doc.splitLines(M.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ii(t.doc,Oe),Zo(t.doc,li(Lt(t.doc,a),Lt(t.doc,ui(Oe))))})()},$=function(Oe,Ge){if(t.options.allowDropFileTypes&&J(t.options.allowDropFileTypes,Oe.type)==-1){X();return}var qe=new FileReader;qe.onerror=function(){return X()},qe.onload=function(){var st=qe.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(st)){X();return}M[Ge]=st,X()},qe.readAsText(Oe)},Z=0;Z<r.length;Z++)$(r[Z],Z);else{if(t.state.draggingText&&t.doc.sel.contains(a)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var de=e.dataTransfer.getData("Text");if(de){var ve;if(t.state.draggingText&&!t.state.draggingText.copy&&(ve=t.listSelections()),xa(t.doc,li(a,a)),ve)for(var De=0;De<ve.length;++De)Mi(t.doc,"",ve[De].anchor,ve[De].head,"drag");t.replaceSelection(de,"around","paste"),t.display.input.focus()}}catch(Oe){}}}function Cl(e,t){if(j&&(!e.state.draggingText||+new Date-hs<100)){se(t);return}if(Ie(e,t)||Bt(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!u){var a=c("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(a.width=a.height=1,e.display.wrapper.appendChild(a),a._top=a.offsetTop),t.dataTransfer.setDragImage(a,0,0),h&&a.parentNode.removeChild(a)}}function Rl(e,t){var a=mi(e,t);if(!a)return;var r=document.createDocumentFragment();wo(e,a,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),p(e.display.dragCursor,r)}function ps(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ms(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),a=[],r=0;r<t.length;r++){var m=t[r].CodeMirror;m&&a.push(m)}a.length&&a[0].operation(function(){for(var M=0;M<a.length;M++)e(a[M])})}var gs=!1;function Al(){if(gs)return;Dl(),gs=!0}function Dl(){var e;_e(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ms(Ll)},100))}),_e(window,"blur",function(){return ms(Ci)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var fi={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"},ia=0;ia<10;ia++)fi[ia+48]=fi[ia+96]=String(ia);for(var Oa=65;Oa<=90;Oa++)fi[Oa]=String.fromCharCode(Oa);for(var aa=1;aa<=12;aa++)fi[aa+111]=fi[aa+63235]="F"+aa;var ii={};ii.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"},ii.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"},ii.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"},ii.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"]},ii.default=n?ii.macDefault:ii.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var a,r,m,M,G=0;G<t.length-1;G++){var X=t[G];if(/^(cmd|meta|m)$/i.test(X))M=!0;else if(/^a(lt)?$/i.test(X))a=!0;else if(/^(c|ctrl|control)$/i.test(X))r=!0;else if(/^s(hift)?$/i.test(X))m=!0;else throw new Error("Unrecognized modifier name: "+X)}return a&&(e="Alt-"+e),r&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),m&&(e="Shift-"+e),e}function Ml(e){var t={};for(var a in e)if(e.hasOwnProperty(a)){var r=e[a];if(/^(name|fallthrough|(de|at)tach)$/.test(a))continue;if(r=="..."){delete e[a];continue}for(var m=Be(a.split(" "),Il),M=0;M<m.length;M++){var G=void 0,X=void 0;M==m.length-1?(X=m.join(" "),G=r):(X=m.slice(0,M+1).join(" "),G="...");var $=t[X];if(!$)t[X]=G;else if($!=G)throw new Error("Inconsistent bindings for "+X)}delete e[a]}for(var Z in t)e[Z]=t[Z];return e}function Ni(e,t,a,r){t=wa(t);var m=t.call?t.call(e,r):t[e];if(m===!1)return"nothing";if(m==="...")return"multi";if(m!=null&&a(m))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ni(e,t.fallthrough,a,r);for(var M=0;M<t.fallthrough.length;M++){var G=Ni(e,t.fallthrough[M],a,r);if(G)return G}}}function vs(e){var t=typeof e=="string"?e:fi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function _s(e,t,a){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!a&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function ys(e,t){if(h&&e.keyCode==34&&e.char)return!1;var a=fi[e.keyCode];return a==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(a=e.code),_s(a,e,t))}function wa(e){return typeof e=="string"?ii[e]:e}function ki(e,t){for(var a=e.doc.sel.ranges,r=[],m=0;m<a.length;m++){for(var M=t(a[m]);r.length&&ct(M.from,xe(r).to)<=0;){var G=r.pop();if(ct(G.from,M.from)<0){M.from=G.from;break}}r.push(M)}Nr(e,function(){for(var X=r.length-1;X>=0;X--)Mi(e.doc,"",r[X].from,r[X].to,"+delete");Ri(e)})}function to(e,t,a){var r=He(e.text,t+a,a);return r<0||r>e.text.length?null:r}function no(e,t,a){var r=to(e,t.ch,a);return r==null?null:new nt(t.line,r,a<0?"after":"before")}function ro(e,t,a,r,m){if(e){t.doc.direction=="rtl"&&(m=-m);var M=ht(a,t.doc.direction);if(M){var G=m<0?xe(M):M[0],X=m<0==(G.level==1),$=X?"after":"before",Z;if(G.level>0||t.doc.direction=="rtl"){var de=Si(t,a);Z=m<0?a.text.length-1:0;var ve=ei(t,de,Z).top;Z=ot(function(De){return ei(t,de,De).top==ve},m<0==(G.level==1)?G.from:G.to-1,Z),$=="before"&&(Z=to(a,Z,1))}else Z=m<0?G.to:G.from;return new nt(r,Z,$)}}return new nt(r,m<0?a.text.length:0,m<0?"before":"after")}function Pl(e,t,a,r){var m=ht(t,e.doc.direction);if(!m)return no(t,a,r);a.ch>=t.text.length?(a.ch=t.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var M=lt(m,a.ch,a.sticky),G=m[M];if(e.doc.direction=="ltr"&&G.level%2==0&&(r>0?G.to>a.ch:G.from<a.ch))return no(t,a,r);var X=function(pt,Tt){return to(t,pt instanceof nt?pt.ch:pt,Tt)},$,Z=function(pt){return e.options.lineWrapping?($=$||Si(e,t),xo(e,t,$,pt)):{begin:0,end:t.text.length}},de=Z(a.sticky=="before"?X(a,-1):a.ch);if(e.doc.direction=="rtl"||G.level==1){var ve=G.level==1==r<0,De=X(a,ve?1:-1);if(De!=null&&(ve?De<=G.to&&De<=de.end:De>=G.from&&De>=de.begin)){var Oe=ve?"before":"after";return new nt(a.line,De,Oe)}}var Ge=function(pt,Tt,mt){for(var Ot=function(Dn,or){return or?new nt(a.line,X(Dn,1),"before"):new nt(a.line,Dn,"after")};pt>=0&&pt<m.length;pt+=Tt){var Ht=m[pt],Nt=Tt>0==(Ht.level!=1),nn=Nt?mt.begin:X(mt.end,-1);if(Ht.from<=nn&&nn<Ht.to)return Ot(nn,Nt);if(nn=Nt?Ht.from:X(Ht.to,-1),mt.begin<=nn&&nn<mt.end)return Ot(nn,Nt)}},qe=Ge(M+r,r,de);if(qe)return qe;var st=r>0?de.end:X(de.begin,-1);return st!=null&&!(r>0&&st==t.text.length)&&(qe=Ge(r>0?0:m.length-1,r,Z(st)),qe)?qe:null}var oa={selectAll:rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ue)},killLine:function(e){return ki(e,function(t){if(t.empty()){var a=bt(e.doc,t.head.line).text.length;return t.head.ch==a&&t.head.line<e.lastLine()?{from:t.head,to:nt(t.head.line+1,0)}:{from:t.head,to:nt(t.head.line,a)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ki(e,function(t){return{from:nt(t.from().line,0),to:Lt(e.doc,nt(t.to().line+1,0))}})},delLineLeft:function(e){return ki(e,function(t){return{from:nt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ki(e,function(t){var a=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:a},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return ki(e,function(t){var a=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div");return{from:t.from(),to:r}})},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(nt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(nt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return bs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Es(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div")},me)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:a},"div")},me)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:a},"div");return r.ch<e.getLine(r.line).search(/\S/)?Es(e,t.head):r},me)},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=[],a=e.listSelections(),r=e.options.tabSize,m=0;m<a.length;m++){var M=a[m].from(),G=W(e.getLine(M.line),M.ch,r);t.push(oe(r-G%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Nr(e,function(){for(var t=e.listSelections(),a=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var m=t[r].head,M=bt(e.doc,m.line).text;if(M){if(m.ch==M.length&&(m=new nt(m.line,m.ch-1)),m.ch>0)m=new nt(m.line,m.ch+1),e.replaceRange(M.charAt(m.ch-1)+M.charAt(m.ch-2),nt(m.line,m.ch-2),m,"+transpose");else if(m.line>e.doc.first){var G=bt(e.doc,m.line-1).text;G&&(m=new nt(m.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+G.charAt(G.length-1),nt(m.line-1,G.length-1),m,"+transpose"))}}a.push(new En(m,m))}e.setSelections(a)})},newlineAndIndent:function(e){return Nr(e,function(){for(var t=e.listSelections(),a=t.length-1;a>=0;a--)e.replaceRange(e.doc.lineSeparator(),t[a].anchor,t[a].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Ri(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function bs(e,t){var a=bt(e.doc,t),r=dr(a);return r!=a&&(t=zt(r)),ro(!0,e,r,t,1)}function Nl(e,t){var a=bt(e.doc,t),r=Qr(a);return r!=a&&(t=zt(r)),ro(!0,e,a,t,-1)}function Es(e,t){var a=bs(e,t.line),r=bt(e.doc,a.line),m=ht(r,e.doc.direction);if(!m||m[0].level==0){var M=Math.max(a.ch,r.text.search(/\S/)),G=t.line==a.line&&t.ch<=M&&t.ch;return nt(a.line,G?0:M,a.sticky)}return a}function Ca(e,t,a){if(typeof t=="string"&&(t=oa[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,m=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a&&(e.display.shift=!1),m=t(e)!=fe}finally{e.display.shift=r,e.state.suppressEdits=!1}return m}function kl(e,t,a){for(var r=0;r<e.state.keyMaps.length;r++){var m=Ni(t,e.state.keyMaps[r],a,e);if(m)return m}return e.options.extraKeys&&Ni(t,e.options.extraKeys,a,e)||Ni(t,e.options.keyMap,a,e)}var Ul=new V;function sa(e,t,a,r){var m=e.state.keySeq;if(m){if(vs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==m&&(e.state.keySeq=null,e.display.input.reset())}),xs(e,m+" "+t,a,r))return!0}return xs(e,t,a,r)}function xs(e,t,a,r){var m=kl(e,t,r);return m=="multi"&&(e.state.keySeq=t),m=="handled"&&sn(e,"keyHandled",e,t,a),(m=="handled"||m=="multi")&&(Q(a),Ba(e)),!!m}function Ts(e,t){var a=ys(t,!0);return a?t.shiftKey&&!e.state.keySeq?sa(e,"Shift-"+a,t,function(r){return Ca(e,r,!0)})||sa(e,a,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ca(e,r)}):sa(e,a,t,function(r){return Ca(e,r)}):!1}function Fl(e,t,a){return sa(e,"'"+a+"'",t,function(r){return Ca(e,r,!0)})}var io=null;function Ss(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=I(),Ie(t,e))return;j&&k<11&&e.keyCode==27&&(e.returnValue=!1);var a=e.keyCode;t.display.shift=a==16||e.shiftKey;var r=Ts(t,e);h&&(io=r?a:null,!r&&a==88&&!we&&(n?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),L&&!n&&!r&&a==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;P(t,"CodeMirror-crosshair");function a(r){(r.keyCode==18||!r.altKey)&&(y(t,"CodeMirror-crosshair"),ke(document,"keyup",a),ke(document,"mouseover",a))}_e(document,"keyup",a),_e(document,"mouseover",a)}function Os(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ie(this,e)}function ws(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Bt(t.display,e)||Ie(t,e)||e.ctrlKey&&!e.altKey||n&&e.metaKey)return;var a=e.keyCode,r=e.charCode;if(h&&a==io){io=null,Q(e);return}if(h&&(!e.which||e.which<10)&&Ts(t,e))return;var m=String.fromCharCode(r==null?a:r);if(m=="\b")return;if(Fl(t,e,m))return;t.display.input.onKeyPress(e)}var Bl=400,ao=function(e,t,a){this.time=e,this.pos=t,this.button=a};ao.prototype.compare=function(e,t,a){return this.time+Bl>e&&ct(t,this.pos)==0&&a==this.button};var la,ua;function Wl(e,t){var a=+new Date;return ua&&ua.compare(a,e,t)?(la=ua=null,"triple"):la&&la.compare(a,e,t)?(ua=new ao(a,e,t),la=null,"double"):(la=new ao(a,e,t),ua=null,"single")}function Cs(e){var t=this,a=t.display;if(Ie(t,e)||a.activeTouch&&a.input.supportsTouch())return;if(a.input.ensurePolled(),a.shift=e.shiftKey,Bt(a,e)){A||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(oo(t,e))return;var r=mi(t,e),m=Se(e),M=r?Wl(r,m):"single";if(window.focus(),m==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,m,r,M,e))return;m==1?r?Gl(t,r,M,e):ce(e)==a.scroller&&Q(e):m==2?(r&&Ea(t.doc,r),setTimeout(function(){return a.input.focus()},20)):m==3&&(w?t.display.input.onContextMenu(e):Ro(t))}function Hl(e,t,a,r,m){var M="Click";return r=="double"?M="Double"+M:r=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,sa(e,_s(M,m),m,function(G){if(typeof G=="string"&&(G=oa[G]),!G)return!1;var X=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),X=G(e,a)!=fe}finally{e.state.suppressEdits=!1}return X})}function Kl(e,t,a){var r=e.getOption("configureMouse"),m=r?r(e,t,a):{};if(m.unit==null){var M=f?a.shiftKey&&a.metaKey:a.altKey;m.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(m.extend==null||e.doc.extend)&&(m.extend=e.doc.extend||a.shiftKey),m.addNew==null&&(m.addNew=n?a.metaKey:a.ctrlKey),m.moveOnDrag==null&&(m.moveOnDrag=!(n?a.altKey:a.ctrlKey)),m}function Gl(e,t,a,r){j?setTimeout(U(Co,e),0):e.curOp.focus=I();var m=Kl(e,a,r),M=e.doc.sel,G;e.options.dragDrop&&je&&!e.isReadOnly()&&a=="single"&&(G=M.contains(t))>-1&&(ct((G=M.ranges[G]).from(),t)<0||t.xRel>0)&&(ct(G.to(),t)>0||t.xRel<0)?zl(e,r,t,m):Xl(e,r,t,m)}function zl(e,t,a,r){var m=e.display,M=!1,G=ir(e,function(Z){A&&(m.scroller.draggable=!1),e.state.draggingText=!1,ke(m.wrapper.ownerDocument,"mouseup",G),ke(m.wrapper.ownerDocument,"mousemove",X),ke(m.scroller,"dragstart",$),ke(m.scroller,"drop",G),M||(Q(Z),r.addNew||Ea(e.doc,a,null,null,r.extend),A&&!u||j&&k==9?setTimeout(function(){m.wrapper.ownerDocument.body.focus({preventScroll:!0}),m.input.focus()},20):m.input.focus())}),X=function(Z){M=M||Math.abs(t.clientX-Z.clientX)+Math.abs(t.clientY-Z.clientY)>=10},$=function(){return M=!0};A&&(m.scroller.draggable=!0),e.state.draggingText=G,G.copy=!r.moveOnDrag,m.scroller.dragDrop&&m.scroller.dragDrop(),_e(m.wrapper.ownerDocument,"mouseup",G),_e(m.wrapper.ownerDocument,"mousemove",X),_e(m.scroller,"dragstart",$),_e(m.scroller,"drop",G),Ro(e),setTimeout(function(){return m.input.focus()},20)}function Rs(e,t,a){if(a=="char")return new En(t,t);if(a=="word")return e.findWordAt(t);if(a=="line")return new En(nt(t.line,0),Lt(e.doc,nt(t.line+1,0)));var r=a(e,t);return new En(r.from,r.to)}function Xl(e,t,a,r){var m=e.display,M=e.doc;Q(t);var G,X,$=M.sel,Z=$.ranges;if(r.addNew&&!r.extend?(X=M.sel.contains(a),X>-1?G=Z[X]:G=new En(a,a)):(G=M.sel.primary(),X=M.sel.primIndex),r.unit=="rectangle")r.addNew||(G=new En(a,a)),a=mi(e,t,!0,!0),X=-1;else{var de=Rs(e,a,r.unit);r.extend?G=qa(G,de.anchor,de.head,r.extend):G=de}r.addNew?X==-1?(X=Z.length,br(M,$r(e,Z.concat([G]),X),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[X].empty()&&r.unit=="char"&&!r.extend?(br(M,$r(e,Z.slice(0,X).concat(Z.slice(X+1)),0),{scroll:!1,origin:"*mouse"}),$=M.sel):eo(M,X,G,le):(X=0,br(M,new jr([G],0),le),$=M.sel);var ve=a;function De(mt){if(ct(ve,mt)==0)return;if(ve=mt,r.unit=="rectangle"){for(var Ot=[],Ht=e.options.tabSize,Nt=W(bt(M,a.line).text,a.ch,Ht),nn=W(bt(M,mt.line).text,mt.ch,Ht),Dn=Math.min(Nt,nn),or=Math.max(Nt,nn),jn=Math.min(a.line,mt.line),kr=Math.min(e.lastLine(),Math.max(a.line,mt.line));jn<=kr;jn++){var Ar=bt(M,jn).text,Qn=ge(Ar,Dn,Ht);Dn==or?Ot.push(new En(nt(jn,Qn),nt(jn,Qn))):Ar.length>Qn&&Ot.push(new En(nt(jn,Qn),nt(jn,ge(Ar,or,Ht))))}Ot.length||Ot.push(new En(a,a)),br(M,$r(e,$.ranges.slice(0,X).concat(Ot),X),{origin:"*mouse",scroll:!1}),e.scrollIntoView(mt)}else{var Dr=G,hr=Rs(e,mt,r.unit),tr=Dr.anchor,Zn;ct(hr.anchor,tr)>0?(Zn=hr.head,tr=Ur(Dr.from(),hr.anchor)):(Zn=hr.anchor,tr=mr(Dr.to(),hr.head));var Wn=$.ranges.slice(0);Wn[X]=Vl(e,new En(Lt(M,tr),Zn)),br(M,$r(e,Wn,X),le)}}var Oe=m.wrapper.getBoundingClientRect(),Ge=0;function qe(mt){var Ot=++Ge,Ht=mi(e,mt,!0,r.unit=="rectangle");if(!Ht)return;if(ct(Ht,ve)!=0){e.curOp.focus=I(),De(Ht);var Nt=ma(m,M);(Ht.line>=Nt.to||Ht.line<Nt.from)&&setTimeout(ir(e,function(){Ge==Ot&&qe(mt)}),150)}else{var nn=mt.clientY<Oe.top?-20:mt.clientY>Oe.bottom?20:0;nn&&setTimeout(ir(e,function(){if(Ge!=Ot)return;m.scroller.scrollTop+=nn,qe(mt)}),50)}}function st(mt){e.state.selectingText=!1,Ge=Infinity,mt&&(Q(mt),m.input.focus()),ke(m.wrapper.ownerDocument,"mousemove",pt),ke(m.wrapper.ownerDocument,"mouseup",Tt),M.history.lastSelOrigin=null}var pt=ir(e,function(mt){mt.buttons===0||!Se(mt)?st(mt):qe(mt)}),Tt=ir(e,st);e.state.selectingText=Tt,_e(m.wrapper.ownerDocument,"mousemove",pt),_e(m.wrapper.ownerDocument,"mouseup",Tt)}function Vl(e,t){var a=t.anchor,r=t.head,m=bt(e.doc,a.line);if(ct(a,r)==0&&a.sticky==r.sticky)return t;var M=ht(m);if(!M)return t;var G=lt(M,a.ch,a.sticky),X=M[G];if(X.from!=a.ch&&X.to!=a.ch)return t;var $=G+(X.from==a.ch==(X.level!=1)?0:1);if($==0||$==M.length)return t;var Z;if(r.line!=a.line)Z=(r.line-a.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var de=lt(M,r.ch,r.sticky),ve=de-G||(r.ch-a.ch)*(X.level==1?-1:1);de==$-1||de==$?Z=ve<0:Z=ve>0}var De=M[$+(Z?-1:0)],Oe=Z==(De.level==1),Ge=Oe?De.from:De.to,qe=Oe?"after":"before";return a.ch==Ge&&a.sticky==qe?t:new En(new nt(a.line,Ge,qe),r)}function As(e,t,a,r){var m,M;if(t.touches)m=t.touches[0].clientX,M=t.touches[0].clientY;else try{m=t.clientX,M=t.clientY}catch(De){return!1}if(m>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Q(t);var G=e.display,X=G.lineDiv.getBoundingClientRect();if(M>X.bottom||!ae(e,a))return te(t);M-=X.top-G.viewOffset;for(var $=0;$<e.display.gutterSpecs.length;++$){var Z=G.gutters.childNodes[$];if(Z&&Z.getBoundingClientRect().right>=m){var de=Sn(e.doc,M),ve=e.display.gutterSpecs[$];return Ee(e,a,e,de,ve.className,t),te(t)}}}function oo(e,t){return As(e,t,"gutterClick",!0)}function Ds(e,t){if(Bt(e.display,t)||Yl(e,t))return;if(Ie(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Yl(e,t){return ae(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-"),Ki(e)}var Ui={toString:function(){return"CodeMirror.Init"}},Is={},Ra={};function $l(e){var t=e.optionHandlers;function a(r,m,M,G){e.defaults[r]=m,M&&(t[r]=G?function(X,$,Z){Z!=Ui&&M(X,$,Z)}:M)}e.defineOption=a,e.Init=Ui,a("value","",function(r,m){return r.setValue(m)},!0),a("mode",null,function(r,m){r.doc.modeOption=m,Ja(r)},!0),a("indentUnit",2,Ja,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(r){Qi(r),Ki(r),Cr(r)},!0),a("lineSeparator",null,function(r,m){if(r.doc.lineSep=m,!m)return;var M=[],G=r.doc.first;r.doc.iter(function($){for(var Z=0;;){var de=$.text.indexOf(m,Z);if(de==-1)break;Z=de+m.length,M.push(nt(G,de))}G++});for(var X=M.length-1;X>=0;X--)Mi(r.doc,m,M[X],nt(M[X].line,M[X].ch+m.length))}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,m,M){r.state.specialChars=new RegExp(m.source+(m.test(" ")?"":"| "),"g"),M!=Ui&&r.refresh()}),a("specialCharPlaceholder",_n,function(r){return r.refresh()},!0),a("electricChars",!0),a("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(r,m){return r.getInputField().spellcheck=m},!0),a("autocorrect",!1,function(r,m){return r.getInputField().autocorrect=m},!0),a("autocapitalize",!1,function(r,m){return r.getInputField().autocapitalize=m},!0),a("rtlMoveVisually",!O),a("wholeLineUpdateBefore",!0),a("theme","default",function(r){Ls(r),Ji(r)},!0),a("keyMap","default",function(r,m,M){var G=wa(m),X=M!=Ui&&wa(M);X&&X.detach&&X.detach(r,G),G.attach&&G.attach(r,X||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,Ql,!0),a("gutters",[],function(r,m){r.display.gutterSpecs=Ya(m,r.options.lineNumbers),Ji(r)},!0),a("fixedGutter",!0,function(r,m){r.display.gutters.style.left=m?Fa(r.display)+"px":"0",r.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(r){return Ai(r)},!0),a("scrollbarStyle","native",function(r){Po(r),Ai(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),a("lineNumbers",!1,function(r,m){r.display.gutterSpecs=Ya(r.options.gutters,m),Ji(r)},!0),a("firstLineNumber",1,Ji,!0),a("lineNumberFormatter",function(r){return r},Ji,!0),a("showCursorWhenSelecting",!1,Gi,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(r,m){m=="nocursor"&&(Ci(r),r.display.input.blur()),r.display.input.readOnlyChanged(m)}),a("screenReaderLabel",null,function(r,m){m=m===""?null:m,r.display.input.screenReaderLabelChanged(m)}),a("disableInput",!1,function(r,m){m||r.display.input.reset()},!0),a("dragDrop",!0,Jl),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,Gi,!0),a("singleCursorHeightPerLine",!0,Gi,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,Qi,!0),a("addModeClass",!1,Qi,!0),a("pollInterval",100),a("undoDepth",200,function(r,m){return r.doc.history.undoDepth=m}),a("historyEventDelay",1250),a("viewportMargin",10,function(r){return r.refresh()},!0),a("maxHighlightLength",1e4,Qi,!0),a("moveInputWithCursor",!0,function(r,m){m||r.display.input.resetPosition()}),a("tabindex",null,function(r,m){return r.display.input.getField().tabIndex=m||""}),a("autofocus",null),a("direction","ltr",function(r,m){return r.doc.setDirection(m)},!0),a("phrases",null)}function Jl(e,t,a){var r=a&&a!=Ui;if(!t!=!r){var m=e.display.dragFunctions,M=t?_e:ke;M(e.display.scroller,"dragstart",m.start),M(e.display.scroller,"dragenter",m.enter),M(e.display.scroller,"dragover",m.over),M(e.display.scroller,"dragleave",m.leave),M(e.display.scroller,"drop",m.drop)}}function Ql(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),zr(e)),ja(e),Cr(e),Ki(e),setTimeout(function(){return Ai(e)},100)}function kn(e,t){var a=this;if(!(this instanceof kn))return new kn(e,t);this.options=t=t?C(t):{},C(Is,t,!1);var r=t.value;typeof r=="string"?r=new Rr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var m=new kn.inputStyles[t.inputStyle](this),M=this.display=new dl(e,r,m,t);M.wrapper.CodeMirror=this,Ls(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Po(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 V,keySeq:null,specialChars:null},t.autofocus&&!o&&M.input.focus(),j&&k<11&&setTimeout(function(){return a.display.input.reset(!0)},20),Zl(this),Al(),yi(this),this.curOp.forceUpdate=!0,Go(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&Wa(a)},20):Ci(this);for(var G in Ra)Ra.hasOwnProperty(G)&&Ra[G](this,t[G],Ui);Uo(this),t.finishInit&&t.finishInit(this);for(var X=0;X<so.length;++X)so[X](this);bi(this),A&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}kn.defaults=Is,kn.optionHandlers=Ra;function Zl(e){var t=e.display;_e(t.scroller,"mousedown",ir(e,Cs)),j&&k<11?_e(t.scroller,"dblclick",ir(e,function($){if(Ie(e,$))return;var Z=mi(e,$);if(!Z||oo(e,$)||Bt(e.display,$))return;Q($);var de=e.findWordAt(Z);Ea(e.doc,de.anchor,de.head)})):_e(t.scroller,"dblclick",function($){return Ie(e,$)||Q($)}),_e(t.scroller,"contextmenu",function($){return Ds(e,$)}),_e(t.input.getField(),"contextmenu",function($){t.scroller.contains($.target)||Ds(e,$)});var a,r={end:0};function m(){t.activeTouch&&(a=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function M($){if($.touches.length!=1)return!1;var Z=$.touches[0];return Z.radiusX<=1&&Z.radiusY<=1}function G($,Z){if(Z.left==null)return!0;var de=Z.left-$.left,ve=Z.top-$.top;return de*de+ve*ve>20*20}_e(t.scroller,"touchstart",function($){if(!Ie(e,$)&&!M($)&&!oo(e,$)){t.input.ensurePolled(),clearTimeout(a);var Z=+new Date;t.activeTouch={start:Z,moved:!1,prev:Z-r.end<=300?r:null},$.touches.length==1&&(t.activeTouch.left=$.touches[0].pageX,t.activeTouch.top=$.touches[0].pageY)}}),_e(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),_e(t.scroller,"touchend",function($){var Z=t.activeTouch;if(Z&&!Bt(t,$)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var de=e.coordsChar(t.activeTouch,"page"),ve;!Z.prev||G(Z,Z.prev)?ve=new En(de,de):!Z.prev.prev||G(Z,Z.prev.prev)?ve=e.findWordAt(de):ve=new En(nt(de.line,0),Lt(e.doc,nt(de.line+1,0))),e.setSelection(ve.anchor,ve.head),e.focus(),Q($)}m()}),_e(t.scroller,"touchcancel",m),_e(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Xi(e,t.scroller.scrollTop),vi(e,t.scroller.scrollLeft,!0),Ee(e,"scroll",e))}),_e(t.scroller,"mousewheel",function($){return Bo(e,$)}),_e(t.scroller,"DOMMouseScroll",function($){return Bo(e,$)}),_e(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function($){Ie(e,$)||se($)},over:function($){Ie(e,$)||(Rl(e,$),se($))},start:function($){return Cl(e,$)},drop:ir(e,wl),leave:function($){Ie(e,$)||ps(e)}};var X=t.input.getField();_e(X,"keyup",function($){return Os.call(e,$)}),_e(X,"keydown",ir(e,Ss)),_e(X,"keypress",ir(e,ws)),_e(X,"focus",function($){return Wa(e,$)}),_e(X,"blur",function($){return Ci(e,$)})}var so=[];kn.defineInitHook=function(e){return so.push(e)};function da(e,t,a,r){var m=e.doc,M;a==null&&(a="add"),a=="smart"&&(m.mode.indent?M=rn(e,t).state:a="prev");var G=e.options.tabSize,X=bt(m,t),$=W(X.text,null,G);X.stateAfter&&(X.stateAfter=null);var Z=X.text.match(/^\s*/)[0],de;if(!r&&!/\S/.test(X.text))de=0,a="not";else if(a=="smart"&&(de=m.mode.indent(M,X.text.slice(Z.length),X.text),de==fe||de>150)){if(!r)return;a="prev"}a=="prev"?t>m.first?de=W(bt(m,t-1).text,null,G):de=0:a=="add"?de=$+e.options.indentUnit:a=="subtract"?de=$-e.options.indentUnit:typeof a=="number"&&(de=$+a),de=Math.max(0,de);var ve="",De=0;if(e.options.indentWithTabs)for(var Oe=Math.floor(de/G);Oe;--Oe)De+=G,ve+=" ";if(De<de&&(ve+=oe(de-De)),ve!=Z)return Mi(m,ve,nt(t,0),nt(t,Z.length),"+input"),X.stateAfter=null,!0;for(var Ge=0;Ge<m.sel.ranges.length;Ge++){var qe=m.sel.ranges[Ge];if(qe.head.line==t&&qe.head.ch<Z.length){var st=nt(t,Z.length);eo(m,Ge,new En(st,st));break}}}var Jr=null;function Aa(e){Jr=e}function lo(e,t,a,r,m){var M=e.doc;e.display.shift=!1,r||(r=M.sel);var G=+new Date-200,X=m=="paste"||e.state.pasteIncoming>G,$=Me(t),Z=null;if(X&&r.ranges.length>1)if(Jr&&Jr.text.join(`
`)==t){if(r.ranges.length%Jr.text.length==0){Z=[];for(var de=0;de<Jr.text.length;de++)Z.push(M.splitLines(Jr.text[de]))}}else $.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(Z=Be($,function(pt){return[pt]}));for(var ve=e.curOp.updateInput,De=r.ranges.length-1;De>=0;De--){var Oe=r.ranges[De],Ge=Oe.from(),qe=Oe.to();Oe.empty()&&(a&&a>0?Ge=nt(Ge.line,Ge.ch-a):e.state.overwrite&&!X?qe=nt(qe.line,Math.min(bt(M,qe.line).text.length,qe.ch+xe($).length)):X&&Jr&&Jr.lineWise&&Jr.text.join(`
`)==$.join(`
`)&&(Ge=qe=nt(Ge.line,0)));var st={from:Ge,to:qe,text:Z?Z[De%Z.length]:$,origin:m||(X?"paste":e.state.cutIncoming>G?"cut":"+input")};Ii(e.doc,st),sn(e,"inputRead",e,st)}t&&!X&&Ps(e,t),Ri(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ve),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ms(e,t){var a=e.clipboardData&&e.clipboardData.getData("Text");if(a)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Nr(t,function(){return lo(t,a,0,null,"paste")}),!0}function Ps(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var a=e.doc.sel,r=a.ranges.length-1;r>=0;r--){var m=a.ranges[r];if(m.head.ch>100||r&&a.ranges[r-1].head.line==m.head.line)continue;var M=e.getModeAt(m.head),G=!1;if(M.electricChars){for(var X=0;X<M.electricChars.length;X++)if(t.indexOf(M.electricChars.charAt(X))>-1){G=da(e,m.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(bt(e.doc,m.head.line).text.slice(0,m.head.ch))&&(G=da(e,m.head.line,"smart")));G&&sn(e,"electricInput",e,m.head.line)}}function Ns(e){for(var t=[],a=[],r=0;r<e.doc.sel.ranges.length;r++){var m=e.doc.sel.ranges[r].head.line,M={anchor:nt(m,0),head:nt(m+1,0)};a.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:a}}function ks(e,t,a,r){e.setAttribute("autocorrect",a?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Us(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return A?e.style.width="1000px":e.setAttribute("wrap","off"),l&&(e.style.border="1px solid black"),ks(e),t}function ql(e){var t=e.optionHandlers,a=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,m){var M=this.options,G=M[r];if(M[r]==m&&r!="mode")return;M[r]=m,t.hasOwnProperty(r)&&ir(this,t[r])(this,m,G),Ee(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,m){this.state.keyMaps[m?"push":"unshift"](wa(r))},removeKeyMap:function(r){for(var m=this.state.keyMaps,M=0;M<m.length;++M)if(m[M]==r||m[M].name==r)return m.splice(M,1),!0},addOverlay:Tr(function(r,m){var M=r.token?r:e.getMode(this.options,r);if(M.startState)throw new Error("Overlays may not be stateful.");Ve(this.state.overlays,{mode:M,modeSpec:r,opaque:m&&m.opaque,priority:m&&m.priority||0},function(G){return G.priority}),this.state.modeGen++,Cr(this)}),removeOverlay:Tr(function(r){for(var m=this.state.overlays,M=0;M<m.length;++M){var G=m[M].modeSpec;if(G==r||typeof r=="string"&&G.name==r){m.splice(M,1),this.state.modeGen++,Cr(this);return}}}),indentLine:Tr(function(r,m,M){typeof m!="string"&&typeof m!="number"&&(m==null?m=this.options.smartIndent?"smart":"prev":m=m?"add":"subtract"),Bn(this.doc,r)&&da(this,r,m,M)}),indentSelection:Tr(function(r){for(var m=this.doc.sel.ranges,M=-1,G=0;G<m.length;G++){var X=m[G];if(X.empty())X.head.line>M&&(da(this,X.head.line,r,!0),M=X.head.line,G==this.doc.sel.primIndex&&Ri(this));else{var $=X.from(),Z=X.to(),de=Math.max(M,$.line);M=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var ve=de;ve<M;++ve)da(this,ve,r);var De=this.doc.sel.ranges;$.ch==0&&m.length==De.length&&De[G].from().ch>0&&eo(this.doc,G,new En($,De[G].to()),ue)}}}),getTokenAt:function(r,m){return Mt(this,r,m)},getLineTokens:function(r,m){return Mt(this,nt(r),m,!0)},getTokenTypeAt:function(r){r=Lt(this.doc,r);var m=fn(this,bt(this.doc,r.line)),M=0,G=(m.length-1)/2,X=r.ch,$;if(X==0)$=m[2];else for(;;){var Z=M+G>>1;if((Z?m[Z*2-1]:0)>=X)G=Z;else if(m[Z*2+1]<X)M=Z+1;else{$=m[Z*2+2];break}}var de=$?$.indexOf("overlay "):-1;return de<0?$:de==0?null:$.slice(0,de-1)},getModeAt:function(r){var m=this.doc.mode;return m.innerMode?e.innerMode(m,this.getTokenAt(r).state).mode:m},getHelper:function(r,m){return this.getHelpers(r,m)[0]},getHelpers:function(r,m){var M=[];if(!a.hasOwnProperty(m))return M;var G=a[m],X=this.getModeAt(r);if(typeof X[m]=="string")G[X[m]]&&M.push(G[X[m]]);else if(X[m])for(var $=0;$<X[m].length;$++){var Z=G[X[m][$]];Z&&M.push(Z)}else X.helperType&&G[X.helperType]?M.push(G[X.helperType]):G[X.name]&&M.push(G[X.name]);for(var de=0;de<G._global.length;de++){var ve=G._global[de];ve.pred(X,this)&&J(M,ve.val)==-1&&M.push(ve.val)}return M},getStateAfter:function(r,m){var M=this.doc;return r=Un(M,r==null?M.first+M.size-1:r),rn(this,r+1,m).state},cursorCoords:function(r,m){var M,G=this.doc.sel.primary();return r==null?M=G.head:typeof r=="object"?M=Lt(this.doc,r):M=r?G.from():G.to(),Yr(this,M,m||"page")},charCoords:function(r,m){return Ma(this,Lt(this.doc,r),m||"page")},coordsChar:function(r,m){return r=yo(this,r,m||"page"),Na(this,r.left,r.top)},lineAtHeight:function(r,m){return r=yo(this,{top:r,left:0},m||"page").top,Sn(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,m,M){var G=!1,X;if(typeof r=="number"){var $=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>$&&(r=$,G=!0),X=bt(this.doc,r)}else X=r;return ca(this,X,{top:0,left:0},m||"page",M||G).top+(G?this.doc.height-Fn(X):0)},defaultTextHeight:function(){return Oi(this.display)},defaultCharWidth:function(){return wi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,m,M,G,X){var $=this.display;r=Yr(this,Lt(this.doc,r));var Z=r.bottom,de=r.left;if(m.style.position="absolute",m.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(m),$.sizer.appendChild(m),G=="over")Z=r.top;else if(G=="above"||G=="near"){var ve=Math.max($.wrapper.clientHeight,this.doc.height),De=Math.max($.sizer.clientWidth,$.lineSpace.clientWidth);(G=="above"||r.bottom+m.offsetHeight>ve)&&r.top>m.offsetHeight?Z=r.top-m.offsetHeight:r.bottom+m.offsetHeight<=ve&&(Z=r.bottom),de+m.offsetWidth>De&&(de=De-m.offsetWidth)}m.style.top=Z+"px",m.style.left=m.style.right="",X=="right"?(de=$.sizer.clientWidth-m.offsetWidth,m.style.right="0px"):(X=="left"?de=0:X=="middle"&&(de=($.sizer.clientWidth-m.offsetWidth)/2),m.style.left=de+"px"),M&&Js(this,{left:de,top:Z,right:de+m.offsetWidth,bottom:Z+m.offsetHeight})},triggerOnKeyDown:Tr(Ss),triggerOnKeyPress:Tr(ws),triggerOnKeyUp:Os,triggerOnMouseDown:Tr(Cs),execCommand:function(r){if(oa.hasOwnProperty(r))return oa[r].call(null,this)},triggerElectric:Tr(function(r){Ps(this,r)}),findPosH:function(r,m,M,G){var X=1;m<0&&(X=-1,m=-m);for(var $=Lt(this.doc,r),Z=0;Z<m&&!($=uo(this.doc,$,X,M,G),$.hitSide);++Z);return $},moveH:Tr(function(r,m){var M=this;this.extendSelectionsBy(function(G){return M.display.shift||M.doc.extend||G.empty()?uo(M.doc,G.head,r,m,M.options.rtlMoveVisually):r<0?G.from():G.to()},me)}),deleteH:Tr(function(r,m){var M=this.doc.sel,G=this.doc;M.somethingSelected()?G.replaceSelection("",null,"+delete"):ki(this,function(X){var $=uo(G,X.head,r,m,!1);return r<0?{from:$,to:X.head}:{from:X.head,to:$}})}),findPosV:function(r,m,M,G){var X=1,$=G;m<0&&(X=-1,m=-m);for(var Z=Lt(this.doc,r),de=0;de<m;++de){var ve=Yr(this,Z,"div");if($==null?$=ve.left:ve.left=$,Z=Fs(this,ve,X,M),Z.hitSide)break}return Z},moveV:Tr(function(r,m){var M=this,G=this.doc,X=[],$=!this.display.shift&&!G.extend&&G.sel.somethingSelected();if(G.extendSelectionsBy(function(de){if($)return r<0?de.from():de.to();var ve=Yr(M,de.head,"div");de.goalColumn!=null&&(ve.left=de.goalColumn),X.push(ve.left);var De=Fs(M,ve,r,m);return m=="page"&&de==G.sel.primary()&&Ka(M,Ma(M,De,"div").top-ve.top),De},me),X.length)for(var Z=0;Z<G.sel.ranges.length;Z++)G.sel.ranges[Z].goalColumn=X[Z]}),findWordAt:function(r){var m=this.doc,M=bt(m,r.line).text,G=r.ch,X=r.ch;if(M){var $=this.getHelper(r,"wordChars");(r.sticky=="before"||X==M.length)&&G?--G:++X;for(var Z=M.charAt(G),de=ze(Z,$)?function(ve){return ze(ve,$)}:/\s/.test(Z)?function(ve){return/\s/.test(ve)}:function(ve){return!/\s/.test(ve)&&!ze(ve)};G>0&&de(M.charAt(G-1));)--G;for(;X<M.length&&de(M.charAt(X));)++X}return new En(nt(r.line,G),nt(r.line,X))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):y(this.display.cursorDiv,"CodeMirror-overwrite"),Ee(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Tr(function(r,m){zi(this,r,m)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Kn(this)-this.display.barHeight,width:r.scrollWidth-Kn(this)-this.display.barWidth,clientHeight:Hr(this),clientWidth:$n(this)}},scrollIntoView:Tr(function(r,m){r==null?(r={from:this.doc.sel.primary().head,to:null},m==null&&(m=this.options.cursorScrollMargin)):typeof r=="number"?r={from:nt(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=m||0,r.from.line!=null?Qs(this,r):Do(this,r.from,r.to,r.margin)}),setSize:Tr(function(r,m){var M=this,G=function($){return typeof $=="number"||/^\d+$/.test(String($))?$+"px":$};r!=null&&(this.display.wrapper.style.width=G(r)),m!=null&&(this.display.wrapper.style.height=G(m)),this.options.lineWrapping&&go(this);var X=this.display.viewFrom;this.doc.iter(X,this.display.viewTo,function($){if($.widgets){for(var Z=0;Z<$.widgets.length;Z++)if($.widgets[Z].noHScroll){oi(M,X,"widget");break}}++X}),this.curOp.forceUpdate=!0,Ee(this,"refresh",this)}),operation:function(r){return Nr(this,r)},startOperation:function(){return yi(this)},endOperation:function(){return bi(this)},refresh:Tr(function(){var r=this.display.cachedTextHeight;Cr(this),this.curOp.forceUpdate=!0,Ki(this),zi(this,this.doc.scrollLeft,this.doc.scrollTop),Xa(this.display),(r==null||Math.abs(r-Oi(this.display))>.5||this.options.lineWrapping)&&ja(this),Ee(this,"refresh",this)}),swapDoc:Tr(function(r){var m=this.doc;return m.cm=null,this.state.selectingText&&this.state.selectingText(),Go(this,r),Ki(this),this.display.input.reset(),zi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,m),m}),phrase:function(r){var m=this.options.phrases;return m&&Object.prototype.hasOwnProperty.call(m,r)?m[r]:r},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}},ie(e),e.registerHelper=function(r,m,M){a.hasOwnProperty(r)||(a[r]=e[r]={_global:[]}),a[r][m]=M},e.registerGlobalHelper=function(r,m,M,G){e.registerHelper(r,m,G),a[r]._global.push({pred:M,val:G})}}function uo(e,t,a,r,m){var M=t,G=a,X=bt(e,t.line),$=m&&e.direction=="rtl"?-a:a;function Z(){var Tt=t.line+$;return Tt<e.first||Tt>=e.first+e.size?!1:(t=new nt(Tt,t.ch,t.sticky),X=bt(e,Tt))}function de(Tt){var mt;if(r=="codepoint"){var Ot=X.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Ot)?mt=null:mt=new nt(t.line,Math.max(0,Math.min(X.text.length,t.ch+a*(Ot>=55296&&Ot<56320?2:1))),-a)}else m?mt=Pl(e.cm,X,t,a):mt=no(X,t,a);if(mt==null)if(!Tt&&Z())t=ro(m,e.cm,X,t.line,$);else return!1;else t=mt;return!0}if(r=="char"||r=="codepoint")de();else if(r=="column")de(!0);else if(r=="word"||r=="group")for(var ve=null,De=r=="group",Oe=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(a<0&&!de(!Ge));Ge=!1){var qe=X.text.charAt(t.ch)||`
`,st=ze(qe,Oe)?"w":De&&qe==`
`?"n":!De||/\s/.test(qe)?null:"p";if(De&&!Ge&&!st&&(st="s"),ve&&ve!=st){a<0&&(a=1,de(),t.sticky="after");break}if(st&&(ve=st),a>0&&!de(!Ge))break}var pt=Ta(e,t,M,G,!0);return qn(M,pt)&&(pt.hitSide=!0),pt}function Fs(e,t,a,r){var m=e.doc,M=t.left,G;if(r=="page"){var X=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),$=Math.max(X-.5*Oi(e.display),3);G=(a>0?t.bottom:t.top)+a*$}else r=="line"&&(G=a>0?t.bottom+3:t.top-3);for(var Z;!(Z=Na(e,M,G),!Z.outside);){if(a<0?G<=0:G>=m.height){Z.hitSide=!0;break}G+=a*5}return Z}var On=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};On.prototype.init=function(e){var t=this,a=this,r=a.cm,m=a.div=e.lineDiv;ks(m,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function M(X){for(var $=X.target;$;$=$.parentNode){if($==m)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test($.className))break}return!1}_e(m,"paste",function(X){if(!M(X)||Ie(r,X)||Ms(X,r))return;k<=11&&setTimeout(ir(r,function(){return t.updateFromDOM()}),20)}),_e(m,"compositionstart",function(X){t.composing={data:X.data,done:!1}}),_e(m,"compositionupdate",function(X){t.composing||(t.composing={data:X.data,done:!1})}),_e(m,"compositionend",function(X){t.composing&&(X.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),_e(m,"touchstart",function(){return a.forceCompositionEnd()}),_e(m,"input",function(){t.composing||t.readFromDOMSoon()});function G(X){if(!M(X)||Ie(r,X))return;if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()}),X.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var $=Ns(r);Aa({lineWise:!0,text:$.text}),X.type=="cut"&&r.operation(function(){r.setSelections($.ranges,0,ue),r.replaceSelection("",null,"cut")})}else return;if(X.clipboardData){X.clipboardData.clearData();var Z=Jr.text.join(`
`);if(X.clipboardData.setData("Text",Z),X.clipboardData.getData("Text")==Z){X.preventDefault();return}}var de=Us(),ve=de.firstChild;r.display.lineSpace.insertBefore(de,r.display.lineSpace.firstChild),ve.value=Jr.text.join(`
`);var De=document.activeElement;z(ve),setTimeout(function(){r.display.lineSpace.removeChild(de),De.focus(),De==m&&a.showPrimarySelection()},50)}_e(m,"copy",G),_e(m,"cut",G)},On.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},On.prototype.prepareSelection=function(){var e=Oo(this.cm,!1);return e.focus=document.activeElement==this.div,e},On.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},On.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},On.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,a=t.doc.sel.primary(),r=a.from(),m=a.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||m.line<t.display.viewFrom){e.removeAllRanges();return}var M=Da(t,e.anchorNode,e.anchorOffset),G=Da(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&G&&!G.bad&&ct(Ur(M,G),r)==0&&ct(mr(M,G),m)==0)return;var X=t.display.view,$=r.line>=t.display.viewFrom&&js(t,r)||{node:X[0].measure.map[2],offset:0},Z=m.line<t.display.viewTo&&js(t,m);if(!Z){var de=X[X.length-1].measure,ve=de.maps?de.maps[de.maps.length-1]:de.map;Z={node:ve[ve.length-1],offset:ve[ve.length-2]-ve[ve.length-3]}}if(!$||!Z){e.removeAllRanges();return}var De=e.rangeCount&&e.getRangeAt(0),Oe;try{Oe=_($.node,$.offset,Z.offset,Z.node)}catch(Ge){}Oe&&(!L&&t.state.focused?(e.collapse($.node,$.offset),Oe.collapsed||(e.removeAllRanges(),e.addRange(Oe))):(e.removeAllRanges(),e.addRange(Oe)),De&&e.anchorNode==null?e.addRange(De):L&&this.startGracePeriod()),this.rememberSelection()},On.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)},On.prototype.showMultipleSelections=function(e){p(this.cm.display.cursorDiv,e.cursors),p(this.cm.display.selectionDiv,e.selection)},On.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},On.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},On.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},On.prototype.blur=function(){this.div.blur()},On.prototype.getField=function(){return this.div},On.prototype.supportsTouch=function(){return!0},On.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Nr(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)},On.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},On.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(i&&g&&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 a=Da(t,e.anchorNode,e.anchorOffset),r=Da(t,e.focusNode,e.focusOffset);a&&r&&Nr(t,function(){br(t.doc,li(a,r),ue),(a.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},On.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,a=e.doc.sel.primary(),r=a.from(),m=a.to();if(r.ch==0&&r.line>e.firstLine()&&(r=nt(r.line-1,bt(e.doc,r.line-1).length)),m.ch==bt(e.doc,m.line).text.length&&m.line<e.lastLine()&&(m=nt(m.line+1,0)),r.line<t.viewFrom||m.line>t.viewTo-1)return!1;var M,G,X;r.line==t.viewFrom||(M=gi(e,r.line))==0?(G=zt(t.view[0].line),X=t.view[0].node):(G=zt(t.view[M].line),X=t.view[M-1].node.nextSibling);var $=gi(e,m.line),Z,de;if($==t.view.length-1?(Z=t.viewTo-1,de=t.lineDiv.lastChild):(Z=zt(t.view[$+1].line)-1,de=t.view[$+1].node.previousSibling),!X)return!1;for(var ve=e.doc.splitLines(tu(e,X,de,G,Z)),De=Rn(e.doc,nt(G,0),nt(Z,bt(e.doc,Z).text.length));ve.length>1&&De.length>1;)if(xe(ve)==xe(De))ve.pop(),De.pop(),Z--;else if(ve[0]==De[0])ve.shift(),De.shift(),G++;else break;for(var Oe=0,Ge=0,qe=ve[0],st=De[0],pt=Math.min(qe.length,st.length);Oe<pt&&qe.charCodeAt(Oe)==st.charCodeAt(Oe);)++Oe;for(var Tt=xe(ve),mt=xe(De),Ot=Math.min(Tt.length-(ve.length==1?Oe:0),mt.length-(De.length==1?Oe:0));Ge<Ot&&Tt.charCodeAt(Tt.length-Ge-1)==mt.charCodeAt(mt.length-Ge-1);)++Ge;if(ve.length==1&&De.length==1&&G==r.line)for(;Oe&&Oe>r.ch&&Tt.charCodeAt(Tt.length-Ge-1)==mt.charCodeAt(mt.length-Ge-1);)Oe--,Ge++;ve[ve.length-1]=Tt.slice(0,Tt.length-Ge).replace(/^\u200b+/,""),ve[0]=ve[0].slice(Oe).replace(/\u200b+$/,"");var Ht=nt(G,Oe),Nt=nt(Z,De.length?xe(De).length-Ge:0);if(ve.length>1||ve[0]||ct(Ht,Nt))return Mi(e.doc,ve,Ht,Nt,"+input"),!0},On.prototype.ensurePolled=function(){this.forceCompositionEnd()},On.prototype.reset=function(){this.forceCompositionEnd()},On.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},On.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)},On.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Nr(this.cm,function(){return Cr(e.cm)})},On.prototype.setUneditable=function(e){e.contentEditable="false"},On.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ir(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},On.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},On.prototype.onContextMenu=function(){},On.prototype.resetPosition=function(){},On.prototype.needsContentAttribute=!0;function js(e,t){var a=Pr(e,t.line);if(!a||a.hidden)return null;var r=bt(e.doc,t.line),m=Kr(a,r,t.line),M=ht(r,e.doc.direction),G="left";if(M){var X=lt(M,t.ch);G=X%2?"right":"left"}var $=po(m.map,t.ch,G);return $.offset=$.collapse=="right"?$.end:$.start,$}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fi(e,t){return t&&(e.bad=!0),e}function tu(e,t,a,r,m){var M="",G=!1,X=e.doc.lineSeparator(),$=!1;function Z(Oe){return function(Ge){return Ge.id==Oe}}function de(){G&&(M+=X,$&&(M+=X),G=$=!1)}function ve(Oe){Oe&&(de(),M+=Oe)}function De(Oe){if(Oe.nodeType==1){var Ge=Oe.getAttribute("cm-text");if(Ge){ve(Ge);return}var qe=Oe.getAttribute("cm-marker"),st;if(qe){var pt=e.findMarks(nt(r,0),nt(m+1,0),Z(+qe));pt.length&&(st=pt[0].find(0))&&ve(Rn(e.doc,st.from,st.to).join(X));return}if(Oe.getAttribute("contenteditable")=="false")return;var Tt=/^(pre|div|p|li|table|br)$/i.test(Oe.nodeName);if(!/^br$/i.test(Oe.nodeName)&&Oe.textContent.length==0)return;Tt&&de();for(var mt=0;mt<Oe.childNodes.length;mt++)De(Oe.childNodes[mt]);/^(pre|p)$/i.test(Oe.nodeName)&&($=!0),Tt&&(G=!0)}else Oe.nodeType==3&&ve(Oe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(De(t),t==a);)t=t.nextSibling,$=!1;return M}function Da(e,t,a){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[a],!r)return Fi(e.clipPos(nt(e.display.viewTo-1)),!0);t=null,a=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var m=0;m<e.display.view.length;m++){var M=e.display.view[m];if(M.node==r)return nu(M,t,a)}}function nu(e,t,a){var r=e.text.firstChild,m=!1;if(!t||!b(r,t))return Fi(nt(zt(e.line),0),!0);if(t==r&&(m=!0,t=r.childNodes[a],a=0,!t)){var M=e.rest?xe(e.rest):e.line;return Fi(nt(zt(M),M.text.length),m)}var G=t.nodeType==3?t:null,X=t;for(!G&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(G=t.firstChild,a&&(a=G.nodeValue.length));X.parentNode!=r;)X=X.parentNode;var $=e.measure,Z=$.maps;function de(st,pt,Tt){for(var mt=-1;mt<(Z?Z.length:0);mt++)for(var Ot=mt<0?$.map:Z[mt],Ht=0;Ht<Ot.length;Ht+=3){var Nt=Ot[Ht+2];if(Nt==st||Nt==pt){var nn=zt(mt<0?e.line:e.rest[mt]),Dn=Ot[Ht]+Tt;return(Tt<0||Nt!=st)&&(Dn=Ot[Ht+(Tt?1:0)]),nt(nn,Dn)}}}var ve=de(G,X,a);if(ve)return Fi(ve,m);for(var De=X.nextSibling,Oe=G?G.nodeValue.length-a:0;De;De=De.nextSibling){if(ve=de(De,De.firstChild,0),ve)return Fi(nt(ve.line,ve.ch-Oe),m);Oe+=De.textContent.length}for(var Ge=X.previousSibling,qe=a;Ge;Ge=Ge.previousSibling){if(ve=de(Ge,Ge.firstChild,-1),ve)return Fi(nt(ve.line,ve.ch+qe),m);qe+=Ge.textContent.length}}var Gn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};Gn.prototype.init=function(e){var t=this,a=this,r=this.cm;this.createField(e);var m=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),l&&(m.style.width="0px"),_e(m,"input",function(){j&&k>=9&&t.hasSelection&&(t.hasSelection=null),a.poll()}),_e(m,"paste",function(G){if(Ie(r,G)||Ms(G,r))return;r.state.pasteIncoming=+new Date,a.fastPoll()});function M(G){if(Ie(r,G))return;if(r.somethingSelected())Aa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var X=Ns(r);Aa({lineWise:!0,text:X.text}),G.type=="cut"?r.setSelections(X.ranges,null,ue):(a.prevInput="",m.value=X.text.join(`
`),z(m))}else return;G.type=="cut"&&(r.state.cutIncoming=+new Date)}_e(m,"cut",M),_e(m,"copy",M),_e(e.scroller,"paste",function(G){if(Bt(e,G)||Ie(r,G))return;if(!m.dispatchEvent){r.state.pasteIncoming=+new Date,a.focus();return}var X=new Event("paste");X.clipboardData=G.clipboardData,m.dispatchEvent(X)}),_e(e.lineSpace,"selectstart",function(G){Bt(e,G)||Q(G)}),_e(m,"compositionstart",function(){var G=r.getCursor("from");a.composing&&a.composing.range.clear(),a.composing={start:G,range:r.markText(G,r.getCursor("to"),{className:"CodeMirror-composing"})}}),_e(m,"compositionend",function(){a.composing&&(a.poll(),a.composing.range.clear(),a.composing=null)})},Gn.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},Gn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Gn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,a=e.doc,r=Oo(e);if(e.options.moveInputWithCursor){var m=Yr(e,a.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),G=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,m.top+G.top-M.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,m.left+G.left-M.left))}return r},Gn.prototype.showSelection=function(e){var t=this.cm,a=t.display;p(a.cursorDiv,e.cursors),p(a.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Gn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var a=t.getSelection();this.textarea.value=a,t.state.focused&&z(this.textarea),j&&k>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",j&&k>=9&&(this.hasSelection=null))},Gn.prototype.getField=function(){return this.textarea},Gn.prototype.supportsTouch=function(){return!1},Gn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Gn.prototype.blur=function(){this.textarea.blur()},Gn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Gn.prototype.receivedFocus=function(){this.slowPoll()},Gn.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()})},Gn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function a(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,a)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,a)},Gn.prototype.poll=function(){var e=this,t=this.cm,a=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ue(a)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var m=a.value;if(m==r&&!t.somethingSelected())return!1;if(j&&k>=9&&this.hasSelection===m||n&&/[\uf700-\uf7ff]/.test(m))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=m.charCodeAt(0);if(M==8203&&!r&&(r="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,X=Math.min(r.length,m.length);G<X&&r.charCodeAt(G)==m.charCodeAt(G);)++G;return Nr(t,function(){lo(t,m.slice(G),r.length-G,null,e.composing?"*compose":null),m.length>1e3||m.indexOf(`
`)>-1?a.value=e.prevInput="":e.prevInput=m,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Gn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Gn.prototype.onKeyPress=function(){j&&k>=9&&(this.hasSelection=null),this.fastPoll()},Gn.prototype.onContextMenu=function(e){var t=this,a=t.cm,r=a.display,m=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=mi(a,e),G=r.scroller.scrollTop;if(!M||h)return;var X=a.options.resetSelectionOnContextMenu;X&&a.doc.sel.contains(M)==-1&&ir(a,br)(a.doc,li(M),ue);var $=m.style.cssText,Z=t.wrapper.style.cssText,de=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",m.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-de.top-5)+"px; left: "+(e.clientX-de.left-5)+`px;
z-index: 1000; background: `+(j?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ve;A&&(ve=window.scrollY),r.input.focus(),A&&window.scrollTo(null,ve),r.input.reset(),a.somethingSelected()||(m.value=t.prevInput=" "),t.contextMenuPending=Oe,r.selForContextMenu=a.doc.sel,clearTimeout(r.detectingSelectAll);function De(){if(m.selectionStart!=null){var qe=a.somethingSelected(),st="\u200B"+(qe?m.value:"");m.value="\u21DA",m.value=st,t.prevInput=qe?"":"\u200B",m.selectionStart=1,m.selectionEnd=st.length,r.selForContextMenu=a.doc.sel}}function Oe(){if(t.contextMenuPending!=Oe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Z,m.style.cssText=$,j&&k<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=G),m.selectionStart!=null){(!j||j&&k<9)&&De();var qe=0,st=function(){r.selForContextMenu==a.doc.sel&&m.selectionStart==0&&m.selectionEnd>0&&t.prevInput=="\u200B"?ir(a,rs)(a):qe++<10?r.detectingSelectAll=setTimeout(st,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(st,200)}}if(j&&k>=9&&De(),w){se(e);var Ge=function(){ke(window,"mouseup",Ge),setTimeout(Oe,20)};_e(window,"mouseup",Ge)}else setTimeout(Oe,50)},Gn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Gn.prototype.setUneditable=function(){},Gn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?C(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 a=I();t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body}function r(){e.value=X.getValue()}var m;if(e.form&&(_e(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var M=e.form;m=M.submit;try{var G=M.submit=function(){r(),M.submit=m,M.submit(),M.submit=G}}catch($){}}t.finishInit=function($){$.save=r,$.getTextArea=function(){return e},$.toTextArea=function(){$.toTextArea=isNaN,r(),e.parentNode.removeChild($.getWrapperElement()),e.style.display="",e.form&&(ke(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=m))}},e.style.display="none";var X=kn(function($){return e.parentNode.insertBefore($,e.nextSibling)},t);return X}function iu(e){e.off=ke,e.on=_e,e.wheelEventPixels=cl,e.Doc=Rr,e.splitLines=Me,e.countColumn=W,e.findColumn=ge,e.isWordChar=We,e.Pass=fe,e.signal=Ee,e.Line=gr,e.changeEnd=ui,e.scrollbarModel=Mo,e.Pos=nt,e.cmpPos=ct,e.modes=Fe,e.mimeModes=Re,e.resolveMode=Te,e.getMode=Ae,e.modeExtensions=Qe,e.extendMode=Et,e.copyState=vt,e.startState=yn,e.innerMode=cn,e.commands=oa,e.keyMap=ii,e.keyName=ys,e.isModifierKey=vs,e.lookupKey=Ni,e.normalizeKeyMap=Ml,e.StringStream=ln,e.SharedTextMarker=ra,e.TextMarker=ci,e.LineWidget=na,e.e_preventDefault=Q,e.e_stopPropagation=q,e.e_stop=se,e.addClass=P,e.contains=b,e.rmClass=y,e.keyNames=fi}$l(kn),ql(kn);var au="iter insert remove copy getEditor constructor".split(" ");for(var La in Rr.prototype)Rr.prototype.hasOwnProperty(La)&&J(au,La)<0&&(kn.prototype[La]=function(e){return function(){return e.apply(this.doc,arguments)}}(Rr.prototype[La]));return ie(Rr),kn.inputStyles={textarea:Gn,contenteditable:On},kn.defineMode=function(e){!kn.defaults.mode&&e!="null"&&(kn.defaults.mode=e),et.apply(this,arguments)},kn.defineMIME=tt,kn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),kn.defineMIME("text/plain","null"),kn.defineExtension=function(e,t){kn.prototype[e]=t},kn.defineDocExtension=function(e,t){Rr.prototype[e]=t},kn.fromTextArea=ru,iu(kn),kn.version="5.58.2",kn})},WaYH:function(Le,ye,F){"use strict";var Y=F("rePB"),K=F("Ff2n"),L=F("VTBJ"),H=F("1OyB"),N=F("vuIU"),R=F("JX7q"),j=F("Ji7U"),k=F("LK+K"),A=F("cDcd"),D=F("TSYQ"),g=F.n(D),h=F("sboe"),u=F("OZM5"),d=function(w){var T=w.prefixCls,y=w.level,v=w.isStart,p=w.isEnd;if(!y)return null;for(var c="".concat(T,"-indent-unit"),E=[],_=0;_<y;_+=1){var b;E.push(A.createElement("span",{key:_,className:g()(c,(b={},Object(Y.a)(b,"".concat(c,"-start"),v[_+1]),Object(Y.a)(b,"".concat(c,"-end"),p[_+1]),Object(Y.a)(b,"".concat(c,"-end-first-level"),!_&&p[0]),b))}))}return A.createElement("span",{"aria-hidden":"true",className:"".concat(T,"-indent")},E)},s=d,l=F("815F"),i="open",o="close",n="---",f=function(x){Object(j.a)(T,x);var w=Object(k.a)(T);function T(){var y;return Object(H.a)(this,T),y=w.apply(this,arguments),y.state={dragNodeHighlight:!1},y.onSelectorClick=function(v){var p=y.props.context.onNodeClick;p(v,Object(l.b)(y.props)),y.isSelectable()?y.onSelect(v):y.onCheck(v)},y.onSelectorDoubleClick=function(v){var p=y.props.context.onNodeDoubleClick;p(v,Object(l.b)(y.props))},y.onSelect=function(v){if(y.isDisabled())return;var p=y.props.context.onNodeSelect;v.preventDefault(),p(v,Object(l.b)(y.props))},y.onCheck=function(v){if(y.isDisabled())return;var p=y.props,c=p.disableCheckbox,E=p.checked,_=y.props.context.onNodeCheck;if(!y.isCheckable()||c)return;v.preventDefault();var b=!E;_(v,Object(l.b)(y.props),b)},y.onMouseEnter=function(v){var p=y.props.context.onNodeMouseEnter;p(v,Object(l.b)(y.props))},y.onMouseLeave=function(v){var p=y.props.context.onNodeMouseLeave;p(v,Object(l.b)(y.props))},y.onContextMenu=function(v){var p=y.props.context.onNodeContextMenu;p(v,Object(l.b)(y.props))},y.onDragStart=function(v){var p=y.props.context.onNodeDragStart;v.stopPropagation(),y.setState({dragNodeHighlight:!0}),p(v,Object(R.a)(y));try{v.dataTransfer.setData("text/plain","")}catch(c){}},y.onDragEnter=function(v){var p=y.props.context.onNodeDragEnter;v.preventDefault(),v.stopPropagation(),p(v,Object(R.a)(y))},y.onDragOver=function(v){var p=y.props.context.onNodeDragOver;v.preventDefault(),v.stopPropagation(),p(v,Object(R.a)(y))},y.onDragLeave=function(v){var p=y.props.context.onNodeDragLeave;v.stopPropagation(),p(v,Object(R.a)(y))},y.onDragEnd=function(v){var p=y.props.context.onNodeDragEnd;v.stopPropagation(),y.setState({dragNodeHighlight:!1}),p(v,Object(R.a)(y))},y.onDrop=function(v){var p=y.props.context.onNodeDrop;v.preventDefault(),v.stopPropagation(),y.setState({dragNodeHighlight:!1}),p(v,Object(R.a)(y))},y.onExpand=function(v){var p=y.props.context.onNodeExpand;p(v,Object(l.b)(y.props))},y.setSelectHandle=function(v){y.selectHandle=v},y.getNodeState=function(){var v=y.props.expanded;return y.isLeaf()?null:v?i:o},y.hasChildren=function(){var v=y.props.eventKey,p=y.props.context.keyEntities,c=p[v]||{},E=c.children;return!!(E||[]).length},y.isLeaf=function(){var v=y.props,p=v.isLeaf,c=v.loaded,E=y.props.context.loadData,_=y.hasChildren();return p===!1?!1:p||!E&&!_||E&&c&&!_},y.isDisabled=function(){var v=y.props.disabled,p=y.props.context.disabled;return!!(p||v)},y.isCheckable=function(){var v=y.props.checkable,p=y.props.context.checkable;return!p||v===!1?!1:p},y.syncLoadData=function(v){var p=v.expanded,c=v.loading,E=v.loaded,_=y.props.context,b=_.loadData,I=_.onNodeLoad;if(c)return;b&&p&&!y.isLeaf()&&(!y.hasChildren()&&!E&&I(Object(l.b)(y.props)))},y.renderSwitcher=function(){var v=y.props,p=v.expanded,c=v.switcherIcon,E=y.props.context,_=E.prefixCls,b=E.switcherIcon,I=c||b;if(y.isLeaf())return A.createElement("span",{className:g()("".concat(_,"-switcher"),"".concat(_,"-switcher-noop"))},typeof I=="function"?I(Object(L.a)(Object(L.a)({},y.props),{},{isLeaf:!0})):I);var P=g()("".concat(_,"-switcher"),"".concat(_,"-switcher_").concat(p?i:o));return A.createElement("span",{onClick:y.onExpand,className:P},typeof I=="function"?I(Object(L.a)(Object(L.a)({},y.props),{},{isLeaf:!1})):I)},y.renderCheckbox=function(){var v=y.props,p=v.checked,c=v.halfChecked,E=v.disableCheckbox,_=y.props.context.prefixCls,b=y.isDisabled(),I=y.isCheckable();if(!I)return null;var P=typeof I!="boolean"?I:null;return A.createElement("span",{className:g()("".concat(_,"-checkbox"),p&&"".concat(_,"-checkbox-checked"),!p&&c&&"".concat(_,"-checkbox-indeterminate"),(b||E)&&"".concat(_,"-checkbox-disabled")),onClick:y.onCheck},P)},y.renderIcon=function(){var v=y.props.loading,p=y.props.context.prefixCls;return A.createElement("span",{className:g()("".concat(p,"-iconEle"),"".concat(p,"-icon__").concat(y.getNodeState()||"docu"),v&&"".concat(p,"-icon_loading"))})},y.renderSelector=function(){var v=y.state.dragNodeHighlight,p=y.props,c=p.title,E=p.selected,_=p.icon,b=p.loading,I=p.data,P=y.props.context,B=P.prefixCls,z=P.showIcon,U=P.icon,C=P.draggable,W=P.loadData,V=P.titleRender,J=y.isDisabled(),ne="".concat(B,"-node-content-wrapper"),fe;if(z){var ue=_||U;fe=ue?A.createElement("span",{className:g()("".concat(B,"-iconEle"),"".concat(B,"-icon__customize"))},typeof ue=="function"?ue(y.props):ue):y.renderIcon()}else W&&b&&(fe=y.renderIcon());var le;typeof c=="function"?le=c(I):V?le=V(I):le=c;var me=A.createElement("span",{className:"".concat(B,"-title")},le);return A.createElement("span",{ref:y.setSelectHandle,title:typeof c=="string"?c:"",className:g()("".concat(ne),"".concat(ne,"-").concat(y.getNodeState()||"normal"),!J&&(E||v)&&"".concat(B,"-node-selected"),!J&&C&&"draggable"),draggable:!J&&C||void 0,"aria-grabbed":!J&&C||void 0,onMouseEnter:y.onMouseEnter,onMouseLeave:y.onMouseLeave,onContextMenu:y.onContextMenu,onClick:y.onSelectorClick,onDoubleClick:y.onSelectorDoubleClick,onDragStart:C?y.onDragStart:void 0},fe,me)},y}return Object(N.a)(T,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var v=this.props.selectable,p=this.props.context.selectable;return typeof v=="boolean"?v:p}},{key:"render",value:function(){var v,p=this.props,c=p.eventKey,E=p.className,_=p.style,b=p.dragOver,I=p.dragOverGapTop,P=p.dragOverGapBottom,B=p.isLeaf,z=p.isStart,U=p.isEnd,C=p.expanded,W=p.selected,V=p.checked,J=p.halfChecked,ne=p.loading,fe=p.domRef,ue=p.active,le=p.onMouseMove,me=Object(K.a)(p,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ge=this.props.context,re=ge.prefixCls,oe=ge.filterTreeNode,xe=ge.draggable,Be=ge.keyEntities,Ve=this.isDisabled(),Ye=Object(u.f)(me),$e=Be[c]||{},Ke=$e.level,We=U[U.length-1];return A.createElement("div",Object.assign({ref:fe,className:g()(E,"".concat(re,"-treenode"),(v={},Object(Y.a)(v,"".concat(re,"-treenode-disabled"),Ve),Object(Y.a)(v,"".concat(re,"-treenode-switcher-").concat(C?"open":"close"),!B),Object(Y.a)(v,"".concat(re,"-treenode-checkbox-checked"),V),Object(Y.a)(v,"".concat(re,"-treenode-checkbox-indeterminate"),J),Object(Y.a)(v,"".concat(re,"-treenode-selected"),W),Object(Y.a)(v,"".concat(re,"-treenode-loading"),ne),Object(Y.a)(v,"".concat(re,"-treenode-active"),ue),Object(Y.a)(v,"".concat(re,"-treenode-leaf-last"),We),Object(Y.a)(v,"drag-over",!Ve&&b),Object(Y.a)(v,"drag-over-gap-top",!Ve&&I),Object(Y.a)(v,"drag-over-gap-bottom",!Ve&&P),Object(Y.a)(v,"filter-node",oe&&oe(Object(l.b)(this.props))),v)),style:_,onDragEnter:xe?this.onDragEnter:void 0,onDragOver:xe?this.onDragOver:void 0,onDragLeave:xe?this.onDragLeave:void 0,onDrop:xe?this.onDrop:void 0,onDragEnd:xe?this.onDragEnd:void 0,onMouseMove:le},Ye),A.createElement(s,{prefixCls:re,level:Ke,isStart:z,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),T}(A.Component),O=function(w){return A.createElement(h.a.Consumer,null,function(T){return A.createElement(f,Object.assign({},w,{context:T}))})};O.displayName="TreeNode",O.defaultProps={title:n},O.isTreeNode=1;var S=ye.a=O},XIdC:function(Le,ye,F){"use strict";var Y=F("rePB"),K=F("ODXe"),L=F("Ff2n"),H=F("cDcd"),N=F.n(H),R=F("TSYQ"),j=F.n(R),k=F("6cGi"),A=F("4IlW"),D=H.forwardRef(function(g,h){var u,d=g.prefixCls,s=d===void 0?"rc-switch":d,l=g.className,i=g.checked,o=g.defaultChecked,n=g.disabled,f=g.loadingIcon,O=g.checkedChildren,S=g.unCheckedChildren,x=g.onClick,w=g.onChange,T=g.onKeyDown,y=Object(L.a)(g,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),v=Object(k.a)(!1,{value:i,defaultValue:o}),p=Object(K.a)(v,2),c=p[0],E=p[1];function _(B,z){var U=c;return n||(U=B,E(U),w==null||w(U,z)),U}function b(B){B.which===A.a.LEFT?_(!1,B):B.which===A.a.RIGHT&&_(!0,B),T==null||T(B)}function I(B){var z=_(!c,B);x==null||x(z,B)}var P=j()(s,l,(u={},Object(Y.a)(u,"".concat(s,"-checked"),c),Object(Y.a)(u,"".concat(s,"-disabled"),n),u));return H.createElement("button",Object.assign({},y,{type:"button",role:"switch","aria-checked":c,disabled:n,className:P,ref:h,onKeyDown:b,onClick:I}),f,H.createElement("span",{className:"".concat(s,"-inner")},c?O:S))});D.displayName="Switch",ye.a=D},Y1PL:function(Le,ye,F){"use strict";F.r(ye),F.d(ye,"ResizableTextArea",function(){return J});var Y=F("wx14"),K=F("1OyB"),L=F("vuIU"),H=F("Ji7U"),N=F("LK+K"),R=F("cDcd"),j=F("VTBJ"),k=F("rePB"),A=F("Zm9Q"),D=F("Kwbf"),g=F("c+Xe"),h=F("m+aA"),u=F("bdgK"),d=new Map;function s(ue){ue.forEach(function(le){var me,ge=le.target;(me=d.get(ge))===null||me===void 0||me.forEach(function(re){return re(ge)})})}var l=new u.default(s),i=null,o=null;function n(ue,le){d.has(ue)||(d.set(ue,new Set),l.observe(ue)),d.get(ue).add(le)}function f(ue,le){d.has(ue)&&(d.get(ue).delete(le),d.get(ue).size||(l.unobserve(ue),d.delete(ue)))}var O=function(ue){Object(H.a)(me,ue);var le=Object(N.a)(me);function me(){return Object(K.a)(this,me),le.apply(this,arguments)}return Object(L.a)(me,[{key:"render",value:function(){return this.props.children}}]),me}(R.Component),S=R.createContext(null);function x(ue){var le=ue.children,me=ue.onBatchResize,ge=R.useRef(0),re=R.useRef([]),oe=R.useContext(S),xe=R.useCallback(function(Be,Ve,Ye){ge.current+=1;var $e=ge.current;re.current.push({size:Be,element:Ve,data:Ye}),Promise.resolve().then(function(){$e===ge.current&&(me==null||me(re.current),re.current=[])}),oe==null||oe(Be,Ve,Ye)},[me,oe]);return R.createElement(S.Provider,{value:xe},le)}function w(ue){var le=ue.children,me=ue.disabled,ge=R.useRef(null),re=R.useRef(null),oe=R.useContext(S),xe=R.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Be=R.isValidElement(le)&&Object(g.c)(le),Ve=Be?le.ref:null,Ye=R.useMemo(function(){return Object(g.a)(Ve,ge)},[Ve,ge]),$e=R.useRef(ue);$e.current=ue;var Ke=R.useCallback(function(We){var ze=$e.current,at=ze.onResize,Je=ze.data,Xe=We.getBoundingClientRect(),He=Xe.width,ot=Xe.height,ft=We.offsetWidth,dt=We.offsetHeight,lt=Math.floor(He),_t=Math.floor(ot);if(xe.current.width!==lt||xe.current.height!==_t||xe.current.offsetWidth!==ft||xe.current.offsetHeight!==dt){var ht={width:lt,height:_t,offsetWidth:ft,offsetHeight:dt};xe.current=ht;var be=ft===Math.round(He)?He:ft,_e=dt===Math.round(ot)?ot:dt,Ne=Object(j.a)(Object(j.a)({},ht),{},{offsetWidth:be,offsetHeight:_e});oe==null||oe(Ne,We,Je),at&&Promise.resolve().then(function(){at(Ne,We)})}},[]);return R.useEffect(function(){var We=Object(h.a)(ge.current)||Object(h.a)(re.current);return We&&!me&&n(We,Ke),function(){return f(We,Ke)}},[ge.current,me]),R.createElement(O,{ref:re},Be?R.cloneElement(le,{ref:Ye}):le)}var T="rc-observer-key";function y(ue){var le=ue.children,me=Object(A.a)(le);return me.map(function(ge,re){var oe=(ge==null?void 0:ge.key)||"".concat(T,"-").concat(re);return R.createElement(w,Object(Y.a)({},ue,{key:oe}),ge)})}y.Collection=x;var v=y,p=F("bT9E"),c=F("TSYQ"),E=F.n(c),_=`
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
`,b=["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"],I={},P;function B(ue){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=ue.getAttribute("id")||ue.getAttribute("data-reactid")||ue.getAttribute("name");if(le&&I[me])return I[me];var ge=window.getComputedStyle(ue),re=ge.getPropertyValue("box-sizing")||ge.getPropertyValue("-moz-box-sizing")||ge.getPropertyValue("-webkit-box-sizing"),oe=parseFloat(ge.getPropertyValue("padding-bottom"))+parseFloat(ge.getPropertyValue("padding-top")),xe=parseFloat(ge.getPropertyValue("border-bottom-width"))+parseFloat(ge.getPropertyValue("border-top-width")),Be=b.map(function(Ye){return"".concat(Ye,":").concat(ge.getPropertyValue(Ye))}).join(";"),Ve={sizingStyle:Be,paddingSize:oe,borderSize:xe,boxSizing:re};return le&&me&&(I[me]=Ve),Ve}function z(ue){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ge=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;P||(P=document.createElement("textarea"),P.setAttribute("tab-index","-1"),P.setAttribute("aria-hidden","true"),document.body.appendChild(P)),ue.getAttribute("wrap")?P.setAttribute("wrap",ue.getAttribute("wrap")):P.removeAttribute("wrap");var re=B(ue,le),oe=re.paddingSize,xe=re.borderSize,Be=re.boxSizing,Ve=re.sizingStyle;P.setAttribute("style","".concat(Ve,";").concat(_)),P.value=ue.value||ue.placeholder||"";var Ye=Number.MIN_SAFE_INTEGER,$e=Number.MAX_SAFE_INTEGER,Ke=P.scrollHeight,We;if(Be==="border-box"?Ke+=xe:Be==="content-box"&&(Ke-=oe),me!==null||ge!==null){P.value=" ";var ze=P.scrollHeight-oe;me!==null&&(Ye=ze*me,Be==="border-box"&&(Ye=Ye+oe+xe),Ke=Math.max(Ye,Ke)),ge!==null&&($e=ze*ge,Be==="border-box"&&($e=$e+oe+xe),We=Ke>$e?"":"hidden",Ke=Math.min($e,Ke))}return{height:Ke,minHeight:Ye,maxHeight:$e,overflowY:We,resize:"none"}}var U=F("Gytx"),C=F.n(U),W;(function(ue){ue[ue.NONE=0]="NONE",ue[ue.RESIZING=1]="RESIZING",ue[ue.RESIZED=2]="RESIZED"})(W||(W={}));var V=function(ue){Object(H.a)(me,ue);var le=Object(N.a)(me);function me(ge){var re;return Object(K.a)(this,me),re=le.call(this,ge),re.nextFrameActionId=void 0,re.resizeFrameId=void 0,re.textArea=void 0,re.saveTextArea=function(oe){re.textArea=oe},re.handleResize=function(oe){var xe=re.state.resizeStatus,Be=re.props,Ve=Be.autoSize,Ye=Be.onResize;if(xe!==W.NONE)return;typeof Ye=="function"&&Ye(oe),Ve&&re.resizeOnNextFrame()},re.resizeOnNextFrame=function(){cancelAnimationFrame(re.nextFrameActionId),re.nextFrameActionId=requestAnimationFrame(re.resizeTextarea)},re.resizeTextarea=function(){var oe=re.props.autoSize;if(!oe||!re.textArea)return;var xe=oe.minRows,Be=oe.maxRows,Ve=z(re.textArea,!1,xe,Be);re.setState({textareaStyles:Ve,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(re.resizeFrameId),re.resizeFrameId=requestAnimationFrame(function(){re.setState({resizeStatus:W.RESIZED},function(){re.resizeFrameId=requestAnimationFrame(function(){re.setState({resizeStatus:W.NONE}),re.fixFirefoxAutoScroll()})})})})},re.renderTextArea=function(){var oe=re.props,xe=oe.prefixCls,Be=xe===void 0?"rc-textarea":xe,Ve=oe.autoSize,Ye=oe.onResize,$e=oe.className,Ke=oe.disabled,We=re.state,ze=We.textareaStyles,at=We.resizeStatus,Je=Object(p.a)(re.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Xe=E()(Be,$e,Object(k.a)({},"".concat(Be,"-disabled"),Ke));"value"in Je&&(Je.value=Je.value||"");var He=Object(j.a)(Object(j.a)(Object(j.a)({},re.props.style),ze),at===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return R.createElement(v,{onResize:re.handleResize,disabled:!(Ve||Ye)},R.createElement("textarea",Object(Y.a)({},Je,{className:Xe,style:He,ref:re.saveTextArea})))},re.state={textareaStyles:{},resizeStatus:W.NONE},re}return Object(L.a)(me,[{key:"componentDidUpdate",value:function(re){(re.value!==this.props.value||!C()(re.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 re=this.textArea.selectionStart,oe=this.textArea.selectionEnd;this.textArea.setSelectionRange(re,oe)}}catch(xe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),me}(R.Component),J=V,ne=function(ue){Object(H.a)(me,ue);var le=Object(N.a)(me);function me(ge){var re;Object(K.a)(this,me),re=le.call(this,ge),re.resizableTextArea=void 0,re.focus=function(){re.resizableTextArea.textArea.focus()},re.saveTextArea=function(xe){re.resizableTextArea=xe},re.handleChange=function(xe){var Be=re.props.onChange;re.setValue(xe.target.value,function(){re.resizableTextArea.resizeTextarea()}),Be&&Be(xe)},re.handleKeyDown=function(xe){var Be=re.props,Ve=Be.onPressEnter,Ye=Be.onKeyDown;xe.keyCode===13&&Ve&&Ve(xe),Ye&&Ye(xe)};var oe=typeof ge.value=="undefined"||ge.value===null?ge.defaultValue:ge.value;return re.state={value:oe},re}return Object(L.a)(me,[{key:"setValue",value:function(re,oe){"value"in this.props||this.setState({value:re},oe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return R.createElement(J,Object(Y.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(re){return"value"in re?{value:re.value}:null}}]),me}(R.Component),fe=ye.default=ne},ZD9Y:function(Le,ye,F){"use strict";var Y=F("BoS7"),K=F("Sdc0"),L=F("OaEy"),H=F("2fM7"),N=F("cDcd"),R=F.n(N),j=F("lOMy"),k=F.n(j),A=H.a.Option;ye.a=function(D){var g=D.onFontSizeChange,h=D.cmFontSize,u=D.cmCodeMode,d=D.onCodeModeChange,s=D.onTabToSpace,l=D.className,i=l===void 0?"":l,o=D.tabToSpace,n=D.children;return R.a.createElement("div",{className:"tpi-code-setting ".concat(i)},R.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),R.a.createElement("section",null,R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),R.a.createElement(H.a,{bordered:!1,size:"small",value:u,onChange:d},R.a.createElement(A,{value:"vs"},"\u767D\u8272\u80CC\u666F"),R.a.createElement(A,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),R.a.createElement(H.a,{bordered:!1,size:"small",value:h,onChange:g},R.a.createElement(A,{value:12},"12px"),R.a.createElement(A,{value:14},"14px"),R.a.createElement(A,{value:16},"16px"),R.a.createElement(A,{value:18},"18px"),R.a.createElement(A,{value:20},"20px"),R.a.createElement(A,{value:22},"22px"))),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"Tab\u8F6C\u6362"),R.a.createElement(K.a,{checked:o,onChange:s}))),R.a.createElement("h3",null,"\u5FEB\u6377\u952E"),R.a.createElement("section",null,R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),R.a.createElement("span",null,"Ctrl + S")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),R.a.createElement("span",null,"F1 / Alt + F1")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),R.a.createElement("span",null,"Ctrl + ]/[")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),R.a.createElement("span",null,"Ctrl + Shift + \\")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),R.a.createElement("span",null,"Home")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),R.a.createElement("span",null,"End"))),n)}},ZW9T:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return z});var Y=F("k1fw"),K=F("miYZ"),L=F("tsqr"),H=F("rAM+"),N=F("tJVT"),R=F("PpiC"),j=F("cDcd"),k=F.n(j),A=F("bdgK"),D=F("oBTY"),g=F("9og8"),h=F("WmNS"),u=F.n(h),d={keywords:["print","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"]},s={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},i={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},o=F("5VLF"),n=F.n(o),f={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(C,W){return W.map(function(V){return{label:V,kind:C.languages.CompletionItemKind.Keyword,insertText:V}})},S=function(C){return Object.keys(f.tables).map(function(W){return{label:W,kind:C.languages.CompletionItemKind.Variable,insertText:W}})},x=function(C,W){var V=f.tables[C];return V?V.map(function(J){return{label:J,kind:W.languages.CompletionItemKind.Field,insertText:J}}):[]};function w(U,C,W,V,J){var ne=C.getWordUntilPosition(W),fe={startLineNumber:W.lineNumber,endLineNumber:W.lineNumber,startColumn:ne.startColumn,endColumn:ne.endColumn},ue=V.map(function(le){return{label:le,kind:U.languages.CompletionItemKind.Keyword,insertText:le,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}});return J.map(function(le){ue.push(Object(Y.a)(Object(Y.a)({},le),{},{range:fe}))}),ue}var T=function(U){f.languages.map(function(J){return U.languages.registerDocumentFormattingEditProvider(J,{provideDocumentFormattingEdits:function(fe,ue,le){return Object(g.a)(u.a.mark(function me(){var ge;return u.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return ge=n()(fe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),oe.abrupt("return",[{range:fe.getFullModelRange(),text:ge}]);case 2:case"end":return oe.stop()}},me)}))()}}),J});var C=l.quickKey.map(function(J){return{label:J.label,kind:U.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),W=i.quickKey.map(function(J){return{label:J.label,kind:U.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=s.quickKey.map(function(J){return{label:J.label,kind:U.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}});U.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(D.a)(l.keywords),Object(D.a)(l.quickKey.map(function(J){return J.label}))),provideCompletionItems:function(ne,fe){var ue=ne.getValueInRange({startLineNumber:fe.lineNumber,startColumn:1,endLineNumber:fe.lineNumber,endColumn:fe.column}),le=ue.match(/cu/gim);console.log("match:",le,fe,ue,ne);var me=[],ge=fe.lineNumber,re=fe.column,oe=ne.getValueInRange({startLineNumber:ge,startColumn:0,endLineNumber:ge,endColumn:re}),xe=oe.trim().split(/\s+/),Be=xe[xe.length-1];if(Be.endsWith(".")){var Ve=Be.slice(0,Be.length-1);Object.keys(f.tables).includes(Ve)&&(me=Object(D.a)(x(Ve,U)))}else Be==="."?me=[]:me=[].concat(Object(D.a)(S(U)),Object(D.a)(O(U,l.keywords)),Object(D.a)(C));return{suggestions:me}}}),U.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(D.a)(d.keywords)),provideCompletionItems:function(ne,fe){var ue=ne.getValueInRange({startLineNumber:fe.lineNumber,startColumn:1,endLineNumber:fe.lineNumber,endColumn:fe.column}),le=ue.match(/cu/gim);console.log("match:",le,fe,ue,ne);var me=[],ge=fe.lineNumber,re=fe.column,oe=ne.getValueInRange({startLineNumber:ge,startColumn:0,endLineNumber:ge,endColumn:re}),xe=oe.trim().split(/\s+/),Be=xe[xe.length-1];if(Be.endsWith(".")){var Ve=Be.slice(0,Be.length-1);Object.keys(f.tables).includes(Ve)&&(me=Object(D.a)(x(Ve,U)))}else Be==="."?me=[]:me=[].concat(Object(D.a)(S(U)),Object(D.a)(O(U,d.keywords)));return{suggestions:me}}}),U.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(D.a)(s.keywords)),provideCompletionItems:function(ne,fe){var ue=[],le=fe.lineNumber,me=fe.column,ge=ne.getValueInRange({startLineNumber:le,startColumn:0,endLineNumber:le,endColumn:me}),re=ge.trim().split(/\s+/),oe=re[re.length-1];if(oe.endsWith(".")){var xe=oe.slice(0,oe.length-1);Object.keys(f.tables).includes(xe)&&(ue=Object(D.a)(x(xe,U)))}else oe==="."?ue=[]:ue=[].concat(Object(D.a)(S(U)),Object(D.a)(O(U,s.keywords)),Object(D.a)(V));return{suggestions:ue}}}),U.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(D.a)(i.keywords)),provideCompletionItems:function(ne,fe){var ue=[],le=fe.lineNumber,me=fe.column,ge=ne.getValueInRange({startLineNumber:le,startColumn:0,endLineNumber:le,endColumn:me}),re=ge.trim().split(/\s+/),oe=re[re.length-1];if(oe.endsWith(".")){var xe=oe.slice(0,oe.length-1);Object.keys(f.tables).includes(xe)&&(ue=Object(D.a)(x(xe,U)))}else oe==="."?ue=[]:ue=[].concat(Object(D.a)(S(U)),Object(D.a)(O(U,i.keywords)),Object(D.a)(W));return{suggestions:ue}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=F("LvDl"),p=F("+ua5");function c(U){return/^\d+$/.test(U)?"".concat(U,"px"):U}function E(){}var _=!1,b={"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 I(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=U;if(Array.isArray(U)){for(var W=0;W<U.length;W++){var V=b[U[W]];if(V)return V}return C[0]}return b[C]||C}var P=null,B=ye.b=function(U){var C=U.width,W=C===void 0?"100%":C,V=U.height,J=V===void 0?"100%":V,ne=U.value,fe=U.language,ue=fe===void 0?"javascript":fe,le=U.style,me=le===void 0?{}:le,ge=U.options,re=ge===void 0?{}:ge,oe=U.overrideServices,xe=oe===void 0?{}:oe,Be=U.theme,Ve=Be===void 0?"vs-dark":Be,Ye=U.onEditBlur,$e=U.onSave,Ke=U.autoHeight,We=Ke===void 0?!1:Ke,ze=U.forbidCopy,at=ze===void 0?!1:ze,Je=U.onChange,Xe=Je===void 0?E:Je,He=U.editorDidMount,ot=He===void 0?E:He,ft=U.onFocus,dt=ft===void 0?E:ft,lt=U.filename,_t=lt===void 0?"educoder.txt":lt,ht=U.errorLine,be=U.errorContent,_e=be===void 0?"":be,Ne=Object(R.a)(U,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ke=Object(j.useRef)(),Ee=Object(j.useRef)({}),Ie=Object(j.useRef)(),pe=Object(j.useRef)(!1),ae=Object(j.useRef)(),ie=Object(j.useState)(!1),Q=Object(N.a)(ie,2),q=Q[0],te=Q[1];function se(){var Te;return ke.current&&(Te=new A.default(function(Ae){var Qe=Object(H.a)(Ae),Et;try{for(Qe.s();!(Et=Qe.n()).done;){var vt=Et.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(cn){Qe.e(cn)}finally{Qe.f()}}),Te.observe(ke.current)),Te}function ce(){L.b.warn(decodeURIComponent(y))}var Se=function(){var Ae=Ee.current.instance;if(ne!=null&&Ae&&q){var Qe=Ae.getModel();Qe&&ne!==Qe.getValue()&&(_=!0,Qe.setValue(ne),Ae.layout(),_=!1)}};Object(j.useEffect)(function(){Ie.current&&clearTimeout(Ie.current),Ie.current=setTimeout(function(){Se()},500)},[ne,q,Ee.current]),Object(j.useEffect)(function(){if(ht&&Ee.current&&Ee.current.instance){var Te=Ee.current.instance;Te.changeViewZones(function(Qe){var Et=document.createElement("div");Et.style.padding="10px 20px",Et.style.width="calc(100% - 20px)",Et.className="my-error-line-wrp",Et.innerHTML=_e,Qe.addZone({afterLineNumber:ht||11,heightInLines:3,domNode:Et})});var Ae={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}};Te.addOverlayWidget(Ae),Te.revealPositionInCenter({lineNumber:20,column:1})}},[ht,Ee.current,q]);function je(){var Te=Ee.current.instance;if(Te){var Ae=Te.getSelection(),Qe=Ee.current.pastePos||{},Et=new P.Range(Qe.startLineNumber||Ae.endLineNumber,Qe.startColumn||Ae.endColumn,Qe.endLineNumber||Ae.endLineNumber,Qe.endColumn||Ae.endColumn);setTimeout(function(){Te.executeEdits("",[{range:Et,text:""}])},300)}}function Ze(Te){(window.navigator.platform.match("Mac")?Te.metaKey:Te.ctrlKey)&&Te.keyCode==83&&(Te.preventDefault(),$e())}var ut=function(){if(We&&Ee.current.instance){var Ae=Ee.current.instance.getContentHeight();et(Ae<J?J:Ae)}else et(J)};function it(Te){var Ae=document.createEvent("MouseEvents");Ae.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Te.dispatchEvent(Ae)}function rt(Te,Ae){var Qe=window.URL||window.webkitURL||window,Et=new Blob([Ae]),vt=document.createElementNS("http://www.w3.org/1999/xhtml","a");vt.href=Qe.createObjectURL(Et),vt.download=Te,it(vt)}Object(j.useEffect)(function(){ut()},[ut]),Object(j.useEffect)(function(){ke.current&&!q&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(Te){try{P=Te,Ee.current.instance=P.editor.create(ke.current,{value:ne,language:I(ue),theme:Ve,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},xe);var Ae=Ee.current.instance;if(ot(Ae,P),setTimeout(function(){ut(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){rt(_t||"educoder.txt",Ae.getValue())}})},500),Ee.current.subscription=Ae.onDidChangeModelContent(function(Et){pe.current?clearTimeout(ae.current):(ut(),Xe(Ae.getValue(),Et)),ae.current=setTimeout(function(){pe.current=!1},500)}),window.Monaco||T(P),at&&(Ae.addCommand(P.KeyMod.CtrlCmd|P.KeyMod.Shift|P.KeyCode.KEY_V,function(){return ce(),null}),Ae.addCommand(P.KeyMod.CtrlCmd|P.KeyCode.KEY_C,function(){return ce(),null})),window.Monaco=P,Ye&&Ae.onDidBlurEditorWidget(function(){Ye(Ae.getValue())}),dt&&Ae.onDidFocusEditorText(function(){dt(Ae.getValue())}),at){Ae.addCommand(P.KeyMod.CtrlCmd|P.KeyCode.KEY_V,function(){return ce(),null}),Ae.onDidPaste(function(Et){Ee.current.pastePos=Et});try{window.addEventListener("paste",je)}catch(Et){}}var Qe=se();return te(!0),function(){var Et=Ee.current.instance;Et.dispose();var vt=Et.getModel();vt&&vt.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),at&&window.removeEventListener("paste",je),Qe.unobserve(ke.current)}}catch(Et){}})},[]),Object(j.useEffect)(function(){var Te=Ee.current.instance;if(Te&&q)return document.addEventListener("keydown",Ze,!1),function(){document.removeEventListener("keydown",Ze)}},[$e,q]),Object(j.useEffect)(function(){var Te=Ee.current.instance;if(Te&&q){var Ae=I(ue);P.editor.setModelLanguage(Te.getModel(),Ae),console.log("language:",ue,Te.getModel(),Ae)}},[ue,q]),Object(j.useEffect)(function(){var Te=Ee.current.instance;Te&&q&&P.editor.setTheme(Ve)},[Ve,q]),Object(j.useEffect)(function(){var Te=Ee.current.instance;Te&&q&&(Te.updateOptions(Object(Y.a)({},re)),setTimeout(function(){Te.getModel().updateOptions(Object(Y.a)({},re))},200))},[JSON.stringify(re),q]),Object(j.useEffect)(function(){var Te=Ee.current.instance;Te&&q&&Te.layout()},[W,J,q]);var Me=Object(j.useState)(c(W)),Ue=Object(N.a)(Me,2),we=Ue[0],ee=Ue[1],he=Object(j.useState)(c(J)),Fe=Object(N.a)(he,2),Re=Fe[0],et=Fe[1],tt=Object(Y.a)(Object(Y.a)({},me),{},{width:we,height:Re});return k.a.createElement("div",{className:"my-monaco-editor",ref:ke,style:tt})};function z(U){var C=U.width,W=C===void 0?"100%":C,V=U.height,J=V===void 0?"100%":V,ne=U.original,fe=U.modified,ue=U.language,le=U.options,me=le===void 0?{}:le,ge=Object(j.useRef)(),re=Object(j.useState)(null),oe=Object(N.a)(re,2),xe=oe[0],Be=oe[1];function Ve(We){var ze;return ge.current&&(ze=new A.default(function(at){var Je=Object(H.a)(at),Xe;try{for(Je.s();!(Xe=Je.n()).done;){var He=Xe.value;(He.target.offsetHeight>0||He.target.offsetWidth>0)&&We.layout()}}catch(ot){Je.e(ot)}finally{Je.f()}}),ze.observe(ge.current)),ze}Object(j.useEffect)(function(){ge.current&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(We){P=We;var ze=P.editor.createDiffEditor(ge.current,Object(Y.a)(Object(Y.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},me),{},{wordWrap:!0}));Be(ze);var at=Ve(ze);return function(){ze.dispose();var Je=ze.getModel();Je&&Je.dispose(),at.unobserve(ge.current)}})},[]),Object(j.useEffect)(function(){xe&&xe.setModel({original:P.editor.createModel(ne,ue),modified:P.editor.createModel(fe,ue)})},[ne,fe,ue,xe]);var Ye=c(W),$e=c(J),Ke={width:Ye,height:$e};return k.a.createElement("div",{className:"my-diff-editor",ref:ge,style:Ke})}},ZpRC:function(Le,ye,F){"use strict";function Y(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function K(g,h){return(!h||g!=="hidden")&&g!=="visible"&&g!=="clip"}function L(g,h){if(g.clientHeight<g.scrollHeight||g.clientWidth<g.scrollWidth){var u=getComputedStyle(g,null);return K(u.overflowY,h)||K(u.overflowX,h)||function(d){var s=function(l){if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch(i){return null}}(d);return!!s&&(s.clientHeight<d.scrollHeight||s.clientWidth<d.scrollWidth)}(g)}return!1}function H(g,h,u,d,s,l,i,o){return l<g&&i>h||l>g&&i<h?0:l<=g&&o<=u||i>=h&&o>=u?l-g-d:i>h&&o<u||l<g&&o>u?i-h+s:0}var N=function(g,h){var u=window,d=h.scrollMode,s=h.block,l=h.inline,i=h.boundary,o=h.skipOverflowHiddenElements,n=typeof i=="function"?i:function(ze){return ze!==i};if(!Y(g))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,O=[],S=g;Y(S)&&n(S);){if((S=S.parentElement)===f){O.push(S);break}S!=null&&S===document.body&&L(S)&&!L(document.documentElement)||S!=null&&L(S,o)&&O.push(S)}for(var x=u.visualViewport?u.visualViewport.width:innerWidth,w=u.visualViewport?u.visualViewport.height:innerHeight,T=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,v=g.getBoundingClientRect(),p=v.height,c=v.width,E=v.top,_=v.right,b=v.bottom,I=v.left,P=s==="start"||s==="nearest"?E:s==="end"?b:E+p/2,B=l==="center"?I+c/2:l==="end"?_:I,z=[],U=0;U<O.length;U++){var C=O[U],W=C.getBoundingClientRect(),V=W.height,J=W.width,ne=W.top,fe=W.right,ue=W.bottom,le=W.left;if(d==="if-needed"&&E>=0&&I>=0&&b<=w&&_<=x&&E>=ne&&b<=ue&&I>=le&&_<=fe)return z;var me=getComputedStyle(C),ge=parseInt(me.borderLeftWidth,10),re=parseInt(me.borderTopWidth,10),oe=parseInt(me.borderRightWidth,10),xe=parseInt(me.borderBottomWidth,10),Be=0,Ve=0,Ye="offsetWidth"in C?C.offsetWidth-C.clientWidth-ge-oe:0,$e="offsetHeight"in C?C.offsetHeight-C.clientHeight-re-xe:0;if(f===C)Be=s==="start"?P:s==="end"?P-w:s==="nearest"?H(y,y+w,w,re,xe,y+P,y+P+p,p):P-w/2,Ve=l==="start"?B:l==="center"?B-x/2:l==="end"?B-x:H(T,T+x,x,ge,oe,T+B,T+B+c,c),Be=Math.max(0,Be+y),Ve=Math.max(0,Ve+T);else{Be=s==="start"?P-ne-re:s==="end"?P-ue+xe+$e:s==="nearest"?H(ne,ue,V,re,xe+$e,P,P+p,p):P-(ne+V/2)+$e/2,Ve=l==="start"?B-le-ge:l==="center"?B-(le+J/2)+Ye/2:l==="end"?B-fe+oe+Ye:H(le,fe,J,ge,oe+Ye,B,B+c,c);var Ke=C.scrollLeft,We=C.scrollTop;P+=We-(Be=Math.max(0,Math.min(We+Be,C.scrollHeight-V+$e))),B+=Ke-(Ve=Math.max(0,Math.min(Ke+Ve,C.scrollWidth-J+Ye)))}z.push({el:C,top:Be,left:Ve})}return z};function R(g){return g===Object(g)&&Object.keys(g).length!==0}function j(g,h){h===void 0&&(h="auto");var u="scrollBehavior"in document.body.style;g.forEach(function(d){var s=d.el,l=d.top,i=d.left;s.scroll&&u?s.scroll({top:l,left:i,behavior:h}):(s.scrollTop=l,s.scrollLeft=i)})}function k(g){return g===!1?{block:"end",inline:"nearest"}:R(g)?g:{block:"start",inline:"nearest"}}function A(g,h){var u=!g.ownerDocument.documentElement.contains(g);if(R(h)&&typeof h.behavior=="function")return h.behavior(u?[]:N(g,h));if(u)return;var d=k(h);return j(N(g,d),d.behavior)}var D=ye.a=A},a4uL:function(Le,ye,F){},bCnd:function(Le,ye,F){"use strict";F.d(ye,"b",function(){return H}),F.d(ye,"a",function(){return N});var Y=F("je13"),K=F.n(Y),L=!1;function H(R,j){var k=K.a.get("__ec");k||(k={}),k[R]=j,K.a.set("__ec",k)}function N(R,j){var k=K.a.get("__ec");return k?k[R]===void 0?j:k[R]:j}},bT9E:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return K});var Y=F("VTBJ");function K(L,H){var N=Object(Y.a)({},L);return Array.isArray(H)&&H.forEach(function(R){delete N[R]}),N}},biw7:function(Le,ye,F){"use strict";var Y=F("cDcd"),K=F.n(Y),L=Y.createContext(null);ye.a=L},c5Ni:function(Le,ye,F){},cDPC:function(Le,ye,F){"use strict";var Y=F("tJVT"),K=F("cDcd"),L=F.n(K),H=F("i3hx"),N=F.n(H);ye.a=function(R){var j=R.defaultX,k=j===void 0?"40%":j,A=R.leftChild,D=R.rightChild,g=R.className,h=R.hideResize,u=h===void 0?!1:h,d=Object(K.useState)(k),s=Object(Y.a)(d,2),l=s[0],i=s[1],o=Object(K.useRef)();function n(){o.current=!0}Object(K.useEffect)(function(){function S(w){o.current&&i(w.pageX)}function x(){o.current=!1}return window.addEventListener("mousemove",S),window.addEventListener("mouseup",x),function(){window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",x)}},[]);var f=typeof l=="number"&&l!==.01?"".concat(l,"px"):k,O="calc(100% - ".concat(u?"0px":"4px"," - ").concat(f,")");return L.a.createElement("div",{className:"split-panel-container ".concat(g)},L.a.createElement("section",{style:{width:f,display:l===.01?"none":""}},A),L.a.createElement("section",{className:"resize-x-bar",onMouseDown:n},L.a.createElement("a",{className:"btn-resize"},L.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},L.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"})))),L.a.createElement("section",{style:{width:O}},D))}},dejd:function(Le,ye,F){},dmUQ:function(Le,ye,F){"use strict";var Y=F("Ff2n"),K=F("rePB"),L=F("1OyB"),H=F("vuIU"),N=F("Ji7U"),R=F("md7G"),j=F("foSv"),k=F("cDcd"),A=F.n(k),D=F("TSYQ"),g=F.n(D),h=F("4IlW");function u(p,c){var E=Object.keys(p);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(p);c&&(_=_.filter(function(b){return Object.getOwnPropertyDescriptor(p,b).enumerable})),E.push.apply(E,_)}return E}function d(p){for(var c=1;c<arguments.length;c++){var E=arguments[c]!=null?arguments[c]:{};c%2?u(Object(E),!0).forEach(function(_){Object(K.a)(p,_,E[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(E)):u(Object(E)).forEach(function(_){Object.defineProperty(p,_,Object.getOwnPropertyDescriptor(E,_))})}return p}function s(p){var c=l();return function(){var _=Object(j.a)(p),b;if(c){var I=Object(j.a)(this).constructor;b=Reflect.construct(_,arguments,I)}else b=_.apply(this,arguments);return Object(R.a)(this,b)}}function l(){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(p){return!1}}function i(){}function o(p){p.preventDefault()}var n=function(c){return c.replace(/[^\w.-]+/g,"")},f=200,O=600,S=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(c){return c!=null},w=function(c,E){return E===c||typeof E=="number"&&typeof c=="number"&&isNaN(E)&&isNaN(c)},T=function(p){Object(N.a)(E,p);var c=s(E);function E(_){var b;Object(L.a)(this,E),b=c.call(this,_),b.onKeyDown=function(B){var z=b.props,U=z.onKeyDown,C=z.onPressEnter;if(B.keyCode===h.a.UP){var W=b.getRatio(B);b.up(B,W,null),b.stop()}else if(B.keyCode===h.a.DOWN){var V=b.getRatio(B);b.down(B,V,null),b.stop()}else B.keyCode===h.a.ENTER&&C&&C(B);if(b.recordCursorPosition(),b.lastKeyCode=B.keyCode,U){for(var J=arguments.length,ne=new Array(J>1?J-1:0),fe=1;fe<J;fe++)ne[fe-1]=arguments[fe];U.apply(void 0,[B].concat(ne))}},b.onKeyUp=function(B){var z=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),z){for(var U=arguments.length,C=new Array(U>1?U-1:0),W=1;W<U;W++)C[W-1]=arguments[W];z.apply(void 0,[B].concat(C))}},b.onChange=function(B){var z=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(B)),b.setState({inputValue:b.rawInput}),z(b.toNumber(b.rawInput))},b.onMouseUp=function(){var B=b.props.onMouseUp;b.recordCursorPosition(),B&&B.apply(void 0,arguments)},b.onFocus=function(){var B;b.setState({focused:!0}),(B=b.props).onFocus.apply(B,arguments)},b.onBlur=function(){var B=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var z=b.getCurrentValidValue(b.state.inputValue),U=b.setValue(z,i);if(B){var C=b.input.value,W=b.getInputDisplayValue({focus:!1,value:U});b.input.value=W&&Number(W),B.apply(void 0,arguments),b.input.value=C}},b.getRatio=function(B){var z=1;return B.metaKey||B.ctrlKey?z=.1:B.shiftKey&&(z=10),z},b.getFullNum=function(B){return isNaN(B)?B:/e/i.test(String(B))?Number(B).toFixed(18).replace(/\.?0+$/,""):B},b.getPrecision=function(B){if(x(b.props.precision))return b.props.precision;var z=String(B);if(z.indexOf("e-")>=0)return parseInt(z.slice(z.indexOf("e-")+2),10);var U=0;return z.indexOf(".")>=0&&(U=z.length-z.indexOf(".")-1),U},b.getInputDisplayValue=function(B){var z=B||b.state,U=z.focused,C=z.inputValue,W=z.value,V;U?V=C:V=b.toPrecisionAsStep(W),V==null&&(V="");var J=b.formatWrapper(V);return x(b.props.decimalSeparator)&&(J=J.toString().replace(".",b.props.decimalSeparator)),J},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(B){}},b.restoreByAfter=function(B){if(B===void 0)return!1;var z=b.input.value,U=z.lastIndexOf(B);if(U===-1)return!1;var C=b.cursorBefore.length;return b.lastKeyCode===h.a.DELETE&&b.cursorBefore.charAt(C-1)===B[0]?(b.fixCaret(C,C),!0):U+B.length===z.length?(b.fixCaret(U,U),!0):!1},b.partRestoreByAfter=function(B){return B===void 0?!1:Array.prototype.some.call(B,function(z,U){var C=B.substring(U);return b.restoreByAfter(C)})},b.isNotCompleteNumber=function(B){return isNaN(B)||B===""||B===null||B&&B.toString().indexOf(".")===B.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(B,z,U){b.pressingUpOrDown=!0,b.step("down",B,z,U)},b.up=function(B,z,U){b.pressingUpOrDown=!0,b.step("up",B,z,U)},b.saveInput=function(B){b.input=B};var I=_.value;I===void 0&&(I=_.defaultValue),b.state={focused:_.autoFocus};var P=b.getValidValue(b.toNumber(I));return b.state=d(d({},b.state),{},{inputValue:b.toPrecisionAsStep(P),value:P}),b}return Object(H.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var I=this.props,P=I.value,B=I.onChange,z=I.max,U=I.min,C=this.state.focused;if(b){if(!w(b.value,P)||!w(b.max,z)||!w(b.min,U)){var W=C?P:this.getValidValue(P),V;this.pressingUpOrDown?V=W:this.inputting?V=this.rawInput:V=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:V})}var J="value"in this.props?P:this.state.value;"max"in this.props&&b.max!==z&&typeof J=="number"&&J>z&&B&&B(z),"min"in this.props&&b.min!==U&&typeof J=="number"&&J<U&&B&&B(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ne=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===h.a.BACKSPACE?ne=this.cursorStart-1:this.lastKeyCode===h.a.DELETE&&(ne=this.cursorStart):ne=this.input.value.length,this.fixCaret(ne,ne)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case h.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case h.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(fe){}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(b){var I=b;return I===""?I="":this.isNotCompleteNumber(parseFloat(I))?I=this.state.value:I=this.getValidValue(I),this.toNumber(I)}},{key:"getValueFromEvent",value:function(b){var I=b.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(I=I.replace(this.props.decimalSeparator,".")),I}},{key:"getValidValue",value:function(b){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,B=parseFloat(b);return isNaN(B)?b:(B<I&&(B=I),B>P&&(B=P),B)}},{key:"setValue",value:function(b,I){var P=this.props.precision,B=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),z=this.state.value,U=z===void 0?null:z,C=this.state.inputValue,W=C===void 0?null:C,V=typeof B=="number"?B.toFixed(P):"".concat(B),J=B!==U||V!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},I)):this.setState({value:B,inputValue:this.toPrecisionAsStep(b)},I),J&&this.props.onChange(B),B}},{key:"getMaxPrecision",value:function(b){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.props,B=P.precision,z=P.step;if(x(B))return B;var U=this.getPrecision(I),C=this.getPrecision(z),W=this.getPrecision(b);return b?Math.max(W,U+C):U+C}},{key:"getPrecisionFactor",value:function(b){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.getMaxPrecision(b,I);return Math.pow(10,P)}},{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(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var I=Math.abs(this.getMaxPrecision(b));return isNaN(I)?b.toString():Number(b).toFixed(I)}},{key:"toNumber",value:function(b){var I=this.props.precision,P=this.state.focused,B=b&&b.length>16&&P;return this.isNotCompleteNumber(b)||B?b:x(I)?Math.round(b*Math.pow(10,I))/Math.pow(10,I):Number(b)}},{key:"upStep",value:function(b,I){var P=this.props.step,B=this.getPrecisionFactor(b,I),z=Math.abs(this.getMaxPrecision(b,I)),U=((B*b+B*P*I)/B).toFixed(z);return this.toNumber(U)}},{key:"downStep",value:function(b,I){var P=this.props.step,B=this.getPrecisionFactor(b,I),z=Math.abs(this.getMaxPrecision(b,I)),U=((B*b-B*P*I)/B).toFixed(z);return this.toNumber(U)}},{key:"step",value:function(b,I){var P=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,z=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var U=this.props;if(U.disabled)return;var C=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(C))return;var W=this["".concat(b,"Step")](C,B),V=W>U.max||W<U.min;if(W>U.max?W=U.max:W<U.min&&(W=U.min),this.setValue(W,null),this.setState({focused:!0},function(){P.pressingUpOrDown=!1}),V)return;this.autoStepTimer=setTimeout(function(){P[b](I,B,!0)},z?f:O)}},{key:"fixCaret",value:function(b,I){if(b===void 0||I===void 0||!this.input||!this.input.value)return;try{var P=this.input.selectionStart,B=this.input.selectionEnd;(b!==P||I!==B)&&this.input.setSelectionRange(b,I)}catch(z){}}},{key:"render",value:function(){var b,I=this.props,P=I.prefixCls,B=I.disabled,z=I.readOnly,U=I.useTouch,C=I.autoComplete,W=I.upHandler,V=I.downHandler,J=I.className,ne=I.max,fe=I.min,ue=I.style,le=I.title,me=I.onMouseEnter,ge=I.onMouseLeave,re=I.onMouseOver,oe=I.onMouseOut,xe=I.required,Be=I.onClick,Ve=I.tabIndex,Ye=I.type,$e=I.placeholder,Ke=I.id,We=I.inputMode,ze=I.pattern,at=I.step,Je=I.maxLength,Xe=I.autoFocus,He=I.name,ot=I.onPaste,ft=I.onInput,dt=Object(Y.a)(I,["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"]),lt=this.state,_t=lt.value,ht=lt.focused,be=g()(P,(b={},Object(K.a)(b,J,!!J),Object(K.a)(b,"".concat(P,"-disabled"),B),Object(K.a)(b,"".concat(P,"-focused"),ht),b)),_e={};Object.keys(dt).forEach(function(se){(se.substr(0,5)==="data-"||se.substr(0,5)==="aria-"||se==="role")&&(_e[se]=dt[se])});var Ne=!z&&!B,ke=this.getInputDisplayValue(null),Ee=(_t||_t===0)&&(isNaN(_t)||Number(_t)>=ne),Ie=(_t||_t===0)&&(isNaN(_t)||Number(_t)<=fe),pe=Ee||B||z,ae=Ie||B||z,ie=g()("".concat(P,"-handler"),"".concat(P,"-handler-up"),Object(K.a)({},"".concat(P,"-handler-up-disabled"),pe)),Q=g()("".concat(P,"-handler"),"".concat(P,"-handler-down"),Object(K.a)({},"".concat(P,"-handler-down-disabled"),ae)),q=U?{onTouchStart:pe?i:this.up,onTouchEnd:this.stop}:{onMouseDown:pe?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},te=U?{onTouchStart:ae?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ae?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return A.a.createElement("div",{className:be,style:ue,title:le,onMouseEnter:me,onMouseLeave:ge,onMouseOver:re,onMouseOut:oe,onFocus:function(){return null},onBlur:function(){return null}},A.a.createElement("div",{className:"".concat(P,"-handler-wrap")},A.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Increase Value","aria-disabled":pe,className:ie}),W||A.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-up-inner"),onClick:o})),A.a.createElement("span",Object.assign({unselectable:"on"},te,{role:"button","aria-label":"Decrease Value","aria-disabled":ae,className:Q}),V||A.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-down-inner"),onClick:o}))),A.a.createElement("div",{className:"".concat(P,"-input-wrap")},A.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":fe,"aria-valuemax":ne,"aria-valuenow":_t,required:xe,type:Ye,placeholder:$e,onPaste:ot,onClick:Be,onMouseUp:this.onMouseUp,className:"".concat(P,"-input"),tabIndex:Ve,autoComplete:C,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ne?this.onKeyDown:i,onKeyUp:Ne?this.onKeyUp:i,autoFocus:Xe,maxLength:Je,readOnly:z,disabled:B,max:ne,min:fe,step:at,name:He,title:le,id:Ke,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ke),pattern:ze,inputMode:We,onInput:ft},_e))))}}]),E}(A.a.Component);T.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:n,required:!1,autoComplete:"off"};var y=T,v=ye.a=y},fcSX:function(Le,ye,F){"use strict";var Y=F("Ff2n"),K=F("1OyB"),L=F("vuIU"),H=F("Ji7U"),N=F("md7G"),R=F("foSv"),j=F("1W/9"),k=F("cDcd"),A=F("rePB"),D=F("JX7q"),g=F("TSYQ"),h=F.n(g),u=F("qx4F"),d=F("4IlW");function s(B){return Array.isArray(B)?B:[B]}var l={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(l).filter(function(B){if(typeof document=="undefined")return!1;var z=document.getElementsByTagName("html")[0];return B in(z?z.style:{})})[0],o=l[i];function n(B,z,U,C){B.addEventListener?B.addEventListener(z,U,C):B.attachEvent&&B.attachEvent("on".concat(z),U)}function f(B,z,U,C){B.removeEventListener?B.removeEventListener(z,U,C):B.attachEvent&&B.detachEvent("on".concat(z),U)}function O(B,z){var U=typeof B=="function"?B(z):B;return Array.isArray(U)?U.length===2?U:[U[0],U[1]]:[U]}var S=function(z){return!isNaN(parseFloat(z))&&isFinite(z)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),w=function B(z,U,C,W){if(!U||U===document||U instanceof Document)return!1;if(U===z.parentNode)return!0;var V=Math.max(Math.abs(C),Math.abs(W))===Math.abs(W),J=Math.max(Math.abs(C),Math.abs(W))===Math.abs(C),ne=U.scrollHeight-U.clientHeight,fe=U.scrollWidth-U.clientWidth,ue=document.defaultView.getComputedStyle(U),le=ue.overflowY==="auto"||ue.overflowY==="scroll",me=ue.overflowX==="auto"||ue.overflowX==="scroll",ge=ne&&le,re=fe&&me;return V&&(!ge||ge&&(U.scrollTop>=ne&&W<0||U.scrollTop<=0&&W>0))||J&&(!re||re&&(U.scrollLeft>=fe&&C<0||U.scrollLeft<=0&&C>0))?B(z,U.parentNode,C,W):!1};function T(B){var z=y();return function(){var C=Object(R.a)(B),W;if(z){var V=Object(R.a)(this).constructor;W=Reflect.construct(C,arguments,V)}else W=C.apply(this,arguments);return Object(N.a)(this,W)}}function y(){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(B){return!1}}var v={},p=function(B){Object(H.a)(U,B);var z=T(U);function U(C){var W;return Object(K.a)(this,U),W=z.call(this,C),W.domFocus=function(){W.dom&&W.dom.focus()},W.removeStartHandler=function(V){if(V.touches.length>1)return;W.startPos={x:V.touches[0].clientX,y:V.touches[0].clientY}},W.removeMoveHandler=function(V){if(V.changedTouches.length>1)return;var J=V.currentTarget,ne=V.changedTouches[0].clientX-W.startPos.x,fe=V.changedTouches[0].clientY-W.startPos.y;(J===W.maskDom||J===W.handlerDom||J===W.contentDom&&w(J,V.target,ne,fe))&&V.cancelable&&V.preventDefault()},W.transitionEnd=function(V){var J=V.target;f(J,o,W.transitionEnd),J.style.transition=""},W.onKeyDown=function(V){if(V.keyCode===d.a.ESC){var J=W.props.onClose;V.stopPropagation(),J&&J(V)}},W.onWrapperTransitionEnd=function(V){var J=W.props,ne=J.open,fe=J.afterVisibleChange;V.target===W.contentWrapper&&V.propertyName.match(/transform$/)&&(W.dom.style.transition="",!ne&&W.getCurrentDrawerSome()&&(document.body.style.overflowX="",W.maskDom&&(W.maskDom.style.left="",W.maskDom.style.width="")),fe&&fe(!!ne))},W.openLevelTransition=function(){var V=W.props,J=V.open,ne=V.width,fe=V.height,ue=W.getHorizontalBoolAndPlacementName(),le=ue.isHorizontal,me=ue.placementName,ge=W.contentDom?W.contentDom.getBoundingClientRect()[le?"width":"height"]:0,re=(le?ne:fe)||ge;W.setLevelAndScrolling(J,me,re)},W.setLevelTransform=function(V,J,ne,fe){var ue=W.props,le=ue.placement,me=ue.levelMove,ge=ue.duration,re=ue.ease,oe=ue.showMask;W.levelDom.forEach(function(xe){xe.style.transition="transform ".concat(ge," ").concat(re),n(xe,o,W.transitionEnd);var Be=V?ne:0;if(me){var Ve=O(me,{target:xe,open:V});Be=V?Ve[0]:Ve[1]||0}var Ye=typeof Be=="number"?"".concat(Be,"px"):Be,$e=le==="left"||le==="top"?Ye:"-".concat(Ye);$e=oe&&le==="right"&&fe?"calc(".concat($e," + ").concat(fe,"px)"):$e,xe.style.transform=Be?"".concat(J,"(").concat($e,")"):""})},W.setLevelAndScrolling=function(V,J,ne){var fe=W.props.onChange;if(!x){var ue=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(u.a)(!0):0;W.setLevelTransform(V,J,ne,ue),W.toggleScrollingToDrawerAndBody(ue)}fe&&fe(V)},W.toggleScrollingToDrawerAndBody=function(V){var J=W.props,ne=J.getOpenCount,fe=J.getContainer,ue=J.showMask,le=J.open,me=fe&&fe(),ge=ne&&ne();if(me&&me.parentNode===document.body&&ue){var re=["touchstart"],oe=[document.body,W.maskDom,W.handlerDom,W.contentDom];le&&document.body.style.overflow!=="hidden"?(V&&W.addScrollingEffect(V),ge===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",oe.forEach(function(xe,Be){if(!xe)return;n(xe,re[Be]||"touchmove",Be?W.removeMoveHandler:W.removeStartHandler,W.passive)})):W.getCurrentDrawerSome()&&(ge||(document.body.style.overflow=""),document.body.style.touchAction="",V&&W.remScrollingEffect(V),oe.forEach(function(xe,Be){if(!xe)return;f(xe,re[Be]||"touchmove",Be?W.removeMoveHandler:W.removeStartHandler,W.passive)}))}},W.addScrollingEffect=function(V){var J=W.props,ne=J.placement,fe=J.duration,ue=J.ease,le=J.getOpenCount,me=J.switchScrollingEffect,ge=le&&le();ge===1&&me();var re="width ".concat(fe," ").concat(ue),oe="transform ".concat(fe," ").concat(ue);W.dom.style.transition="none";switch(ne){case"right":W.dom.style.transform="translateX(-".concat(V,"px)");break;case"top":case"bottom":W.dom.style.width="calc(100% - ".concat(V,"px)"),W.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(oe,",").concat(re),W.dom.style.width="",W.dom.style.transform="")})},W.remScrollingEffect=function(V){var J=W.props,ne=J.placement,fe=J.duration,ue=J.ease,le=J.getOpenCount,me=J.switchScrollingEffect,ge=le&&le();ge||me(!0),i&&(document.body.style.overflowX="hidden"),W.dom.style.transition="none";var re,oe="width ".concat(fe," ").concat(ue),xe="transform ".concat(fe," ").concat(ue);switch(ne){case"left":{W.dom.style.width="100%",oe="width 0s ".concat(ue," ").concat(fe);break}case"right":{W.dom.style.transform="translateX(".concat(V,"px)"),W.dom.style.width="100%",oe="width 0s ".concat(ue," ").concat(fe),W.maskDom&&(W.maskDom.style.left="-".concat(V,"px"),W.maskDom.style.width="calc(100% + ".concat(V,"px)"));break}case"top":case"bottom":{W.dom.style.width="calc(100% + ".concat(V,"px)"),W.dom.style.height="100%",W.dom.style.transform="translateZ(0)",re="height 0s ".concat(ue," ").concat(fe);break}default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(xe,",").concat(re?"".concat(re,","):"").concat(oe),W.dom.style.transform="",W.dom.style.width="",W.dom.style.height="")})},W.getCurrentDrawerSome=function(){return!Object.keys(v).some(function(V){return v[V]})},W.getLevelDom=function(V){var J=V.level,ne=V.getContainer;if(x)return;var fe=ne&&ne(),ue=fe?fe.parentNode:null;if(W.levelDom=[],J==="all"){var le=ue?Array.prototype.slice.call(ue.children):[];le.forEach(function(me){me.nodeName!=="SCRIPT"&&me.nodeName!=="STYLE"&&me.nodeName!=="LINK"&&me!==fe&&W.levelDom.push(me)})}else J&&s(J).forEach(function(me){document.querySelectorAll(me).forEach(function(ge){W.levelDom.push(ge)})})},W.getHorizontalBoolAndPlacementName=function(){var V=W.props.placement,J=V==="left"||V==="right",ne="translate".concat(J?"X":"Y");return{isHorizontal:J,placementName:ne}},W.state={_self:Object(D.a)(W)},W}return Object(L.a)(U,[{key:"componentDidMount",value:function(){var W=this;if(!x){var V=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return V=!0,null}}))}catch(le){}this.passive=V?{passive:!1}:!1}var J=this.props,ne=J.open,fe=J.getContainer,ue=fe&&fe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ne&&(ue&&ue.parentNode===document.body&&(v[this.drawerId]=ne),this.openLevelTransition(),this.forceUpdate(function(){W.domFocus()}))}},{key:"componentDidUpdate",value:function(W){var V=this.props,J=V.open,ne=V.getContainer,fe=ne&&ne();J!==W.open&&(J&&this.domFocus(),fe&&fe.parentNode===document.body&&(v[this.drawerId]=!!J),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var W=this.props,V=W.getOpenCount,J=W.open,ne=W.switchScrollingEffect,fe=typeof V=="function"&&V();delete v[this.drawerId],J&&(this.setLevelTransform(!1),document.body.style.touchAction=""),fe||(document.body.style.overflow="",ne(!0))}},{key:"render",value:function(){var W,V=this,J=this.props,ne=J.className,fe=J.children,ue=J.style,le=J.width,me=J.height,ge=J.defaultOpen,re=J.open,oe=J.prefixCls,xe=J.placement,Be=J.level,Ve=J.levelMove,Ye=J.ease,$e=J.duration,Ke=J.getContainer,We=J.handler,ze=J.onChange,at=J.afterVisibleChange,Je=J.showMask,Xe=J.maskClosable,He=J.maskStyle,ot=J.onClose,ft=J.onHandleClick,dt=J.keyboard,lt=J.getOpenCount,_t=J.switchScrollingEffect,ht=Object(Y.a)(J,["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?re:!1,_e=h()(oe,(W={},Object(A.a)(W,"".concat(oe,"-").concat(xe),!0),Object(A.a)(W,"".concat(oe,"-open"),be),Object(A.a)(W,ne||"",!!ne),Object(A.a)(W,"no-mask",!Je),W)),Ne=this.getHorizontalBoolAndPlacementName(),ke=Ne.placementName,Ee=xe==="left"||xe==="top"?"-100%":"100%",Ie=be?"":"".concat(ke,"(").concat(Ee,")"),pe=We&&k.cloneElement(We,{onClick:function(ie){We.props.onClick&&We.props.onClick(),ft&&ft(ie)},ref:function(ie){V.handlerDom=ie}});return k.createElement("div",Object.assign({},ht,{tabIndex:-1,className:_e,style:ue,ref:function(ie){V.dom=ie},onKeyDown:be&&dt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Je&&k.createElement("div",{className:"".concat(oe,"-mask"),onClick:Xe?ot:void 0,style:He,ref:function(ie){V.maskDom=ie}}),k.createElement("div",{className:"".concat(oe,"-content-wrapper"),style:{transform:Ie,msTransform:Ie,width:S(le)?"".concat(le,"px"):le,height:S(me)?"".concat(me,"px"):me},ref:function(ie){V.contentWrapper=ie}},k.createElement("div",{className:"".concat(oe,"-content"),ref:function(ie){V.contentDom=ie},onTouchStart:be&&Je?this.removeStartHandler:void 0,onTouchMove:be&&Je?this.removeMoveHandler:void 0},fe),pe))}}],[{key:"getDerivedStateFromProps",value:function(W,V){var J=V.prevProps,ne=V._self,fe={prevProps:W};if(J!==void 0){var ue=W.placement,le=W.level;ue!==J.placement&&(ne.contentDom=null),le!==J.level&&ne.getLevelDom(W)}return fe}}]),U}(k.Component);p.defaultProps={switchScrollingEffect:function(){}};var c=p;function E(B){var z=_();return function(){var C=Object(R.a)(B),W;if(z){var V=Object(R.a)(this).constructor;W=Reflect.construct(C,arguments,V)}else W=C.apply(this,arguments);return Object(N.a)(this,W)}}function _(){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(B){return!1}}var b=function(B){Object(H.a)(U,B);var z=E(U);function U(C){var W;Object(K.a)(this,U),W=z.call(this,C),W.onHandleClick=function(J){var ne=W.props,fe=ne.onHandleClick,ue=ne.open;if(fe&&fe(J),typeof ue=="undefined"){var le=W.state.open;W.setState({open:!le})}},W.onClose=function(J){var ne=W.props,fe=ne.onClose,ue=ne.open;fe&&fe(J),typeof ue=="undefined"&&W.setState({open:!1})};var V=typeof C.open!="undefined"?C.open:!!C.defaultOpen;return W.state={open:V},"onMaskClick"in C&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),W}return Object(L.a)(U,[{key:"render",value:function(){var W=this,V=this.props,J=V.defaultOpen,ne=V.getContainer,fe=V.wrapperClassName,ue=V.forceRender,le=V.handler,me=Object(Y.a)(V,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),ge=this.state.open;if(!ne)return k.createElement("div",{className:fe,ref:function(xe){W.dom=xe}},k.createElement(c,Object.assign({},me,{open:ge,handler:le,getContainer:function(){return W.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var re=!!le||ue;return k.createElement(j.a,{visible:ge,forceRender:re,getContainer:ne,wrapperClassName:fe},function(oe){var xe=oe.visible,Be=oe.afterClose,Ve=Object(Y.a)(oe,["visible","afterClose"]);return k.createElement(c,Object.assign({},me,Ve,{open:xe!==void 0?xe:ge,afterVisibleChange:Be!==void 0?Be:me.afterVisibleChange,handler:le,onClose:W.onClose,onHandleClick:W.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(W,V){var J=V.prevProps,ne={prevProps:W};return typeof J!="undefined"&&W.open!==J.open&&(ne.open=W.open),ne}}]),U}(k.Component);b.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:k.createElement("div",{className:"drawer-handle"},k.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var I=b,P=ye.a=I},fcyK:function(Le,ye,F){},fyJ8:function(Le,ye,F){"use strict";var Y=F("rePB"),K=F("VTBJ"),L=F("Ff2n"),H=F("U8pU"),N=F("cDcd"),R=F.n(N),j=F("TSYQ"),k=F.n(j),A=F("c+Xe"),D=F("sR1s");function g(l){return l&&Object(H.a)(l)==="object"&&!Array.isArray(l)&&!N.isValidElement(l)}function h(l){return typeof l=="string"?!0:Object(A.c)(l)}function u(l,i){var o,n=l.prefixCls,f=l.className,O=l.record,S=l.index,x=l.dataIndex,w=l.render,T=l.children,y=l.component,v=y===void 0?"td":y,p=l.colSpan,c=l.rowSpan,E=l.fixLeft,_=l.fixRight,b=l.firstFixLeft,I=l.lastFixLeft,P=l.firstFixRight,B=l.lastFixRight,z=l.appendNode,U=l.additionalProps,C=U===void 0?{}:U,W=l.ellipsis,V=l.align,J=l.rowType,ne=l.isSticky,fe="".concat(n,"-cell"),ue,le;if(T)le=T;else{var me=Object(D.b)(O,x);if(le=me,w){var ge=w(me,O,S);g(ge)?(le=ge.children,ue=ge.props):le=ge}}Object(H.a)(le)==="object"&&!Array.isArray(le)&&!N.isValidElement(le)&&(le=null),W&&(I||P)&&(le=N.createElement("span",{className:"".concat(fe,"-content")},le));var re=ue||{},oe=re.colSpan,xe=re.rowSpan,Be=re.style,Ve=re.className,Ye=Object(L.a)(re,["colSpan","rowSpan","style","className"]),$e=oe!==void 0?oe:p,Ke=xe!==void 0?xe:c;if($e===0||Ke===0)return null;var We={},ze=typeof E=="number",at=typeof _=="number";ze&&(We.position="sticky",We.left=E),at&&(We.position="sticky",We.right=_);var Je={};V&&(Je.textAlign=V);var Xe,He=W===!0?{showTitle:!0}:W;He&&(He.showTitle||J==="header")&&(typeof le=="string"||typeof le=="number"?Xe=le.toString():N.isValidElement(le)&&typeof le.props.children=="string"&&(Xe=le.props.children));var ot=Object(K.a)(Object(K.a)(Object(K.a)({title:Xe},Ye),C),{},{colSpan:$e&&$e!==1?$e:null,rowSpan:Ke&&Ke!==1?Ke:null,className:k()(fe,f,(o={},Object(Y.a)(o,"".concat(fe,"-fix-left"),ze),Object(Y.a)(o,"".concat(fe,"-fix-left-first"),b),Object(Y.a)(o,"".concat(fe,"-fix-left-last"),I),Object(Y.a)(o,"".concat(fe,"-fix-right"),at),Object(Y.a)(o,"".concat(fe,"-fix-right-first"),P),Object(Y.a)(o,"".concat(fe,"-fix-right-last"),B),Object(Y.a)(o,"".concat(fe,"-ellipsis"),W),Object(Y.a)(o,"".concat(fe,"-with-append"),z),Object(Y.a)(o,"".concat(fe,"-fix-sticky"),(ze||at)&&ne),o),C.className,Ve),style:Object(K.a)(Object(K.a)(Object(K.a)(Object(K.a)({},C.style),Je),We),Be),ref:h(v)?i:null});return N.createElement(v,Object.assign({},ot),z,le)}var d=N.forwardRef(u);d.displayName="Cell";var s=N.memo(d,function(l,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,l.record):!1});ye.a=s},gRFJ:function(Le,ye,F){Le.exports=[F("rdUC"),F("ynwM"),F("RELg"),F("DlR+"),F("CrYA"),F("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(Le){return Le<10?"0"+Le:Le}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(Le){return rx_escapable.lastIndex=0,rx_escapable.test(Le)?'"'+Le.replace(rx_escapable,function(ye){var F=meta[ye];return typeof F=="string"?F:"\\u"+("0000"+ye.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Le+'"'}function str(Le,ye){var F,Y,K,L,H=gap,N,R=ye[Le];R&&typeof R=="object"&&typeof R.toJSON=="function"&&(R=R.toJSON(Le)),typeof rep=="function"&&(R=rep.call(ye,Le,R));switch(typeof R){case"string":return quote(R);case"number":return isFinite(R)?String(R):"null";case"boolean":case"null":return String(R);case"object":if(!R)return"null";if(gap+=indent,N=[],Object.prototype.toString.apply(R)==="[object Array]"){for(L=R.length,F=0;F<L;F+=1)N[F]=str(F,R)||"null";return K=N.length===0?"[]":gap?`[
`+gap+N.join(`,
`+gap)+`
`+H+"]":"["+N.join(",")+"]",gap=H,K}if(rep&&typeof rep=="object")for(L=rep.length,F=0;F<L;F+=1)typeof rep[F]=="string"&&(Y=rep[F],K=str(Y,R),K&&N.push(quote(Y)+(gap?": ":":")+K));else for(Y in R)Object.prototype.hasOwnProperty.call(R,Y)&&(K=str(Y,R),K&&N.push(quote(Y)+(gap?": ":":")+K));return K=N.length===0?"{}":gap?`{
`+gap+N.join(`,
`+gap)+`
`+H+"}":"{"+N.join(",")+"}",gap=H,K}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(Le,ye,F){var Y;if(gap="",indent="",typeof F=="number")for(Y=0;Y<F;Y+=1)indent+=" ";else typeof F=="string"&&(indent=F);if(rep=ye,ye&&typeof ye!="function"&&(typeof ye!="object"||typeof ye.length!="number"))throw new Error("JSON.stringify");return str("",{"":Le})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(Le,ye){var F,Y,K=Le[ye];if(K&&typeof K=="object")for(F in K)Object.prototype.hasOwnProperty.call(K,F)&&(Y=walk(K,F),Y!==void 0?K[F]=Y:delete K[F]);return reviver.call(Le,ye,K)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(Le){return"\\u"+("0000"+Le.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(Le,ye,F){"use strict";F.d(ye,"a",function(){return H}),F.d(ye,"c",function(){return N}),F.d(ye,"b",function(){return R});var Y=F("VTBJ"),K=F("Ff2n"),L=F("Kwbf"),H="RC_TABLE_INTERNAL_COL_DEFINE";function N(j){var k=j.expandable,A=Object(K.a)(j,["expandable"]);return"expandable"in j?Object(Y.a)(Object(Y.a)({},A),k):A}function R(j){return Object.keys(j).reduce(function(k,A){return(A.substr(0,5)==="data-"||A.substr(0,5)==="aria-")&&(k[A]=j[A]),k},{})}},i3hx:function(Le,ye,F){},je13:function(Le,ye,F){var Y=F("5nXd"),K=F("gRFJ"),L=[F("uQRt")];Le.exports=Y.createStore(K,L)},kSUc:function(Le,ye,F){},"kaH+":function(Le,ye,F){"use strict";var Y=F("+L6B"),K=F("2/Rp"),L=F("tJVT"),H=F("cDcd"),N=F.n(H),R=F("UZu5"),j=F.n(R),k=F("dhSg"),A=F("rLCj"),D=F("dF/Y"),g=F("4i/N");ye.a=function(){var h=Object(H.useState)(""),u=Object(L.a)(h,2),d=u[0],s=u[1],l=Object(H.useState)(0),i=Object(L.a)(l,2),o=i[0],n=i[1],f=Object(H.useRef)("");Object(H.useEffect)(function(){var v=k.a.subscribe("preview-image",function(p){s(p),document.body.style.overflow="hidden"});return v},[]),Object(H.useEffect)(function(){return document.addEventListener("keydown",O),function(){document.removeEventListener("keydown",O)}},[]),Object(H.useEffect)(function(){f.current=d},[d]);function O(v){v.keyCode==27&&f.current&&S()}function S(){document.body.style.overflow="auto",s("")}function x(){n(o+90)}var w=Object(H.useRef)(),T=Object(H.useRef)(),y=function(p){(p.nativeEvent.target===w.current||p.nativeEvent.target===T.current)&&S()};return N.a.createElement(H.Fragment,null,d?N.a.createElement("div",{className:"image-preview-container",ref:w,onClick:y},N.a.createElement("div",{className:"button-group"},N.a.createElement(K.a,{onClick:x},"\u65CB\u8F6C",N.a.createElement(A.a,null)),N.a.createElement(K.a,{href:d},"\u4E0B\u8F7D",N.a.createElement(D.a,null)),N.a.createElement(K.a,{onClick:S},"\u5173\u95ED",N.a.createElement(g.a,null))),N.a.createElement("div",{className:"preview-wrp-group",ref:T},N.a.createElement("img",{className:"image-preview",src:d,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(o,"deg)")}}))):null)}},lOMy:function(Le,ye,F){},lZu9:function(Le,ye,F){(function(Y){Y(F("VrN/"),F("1eCo"),F("8EBN"))})(function(Y){"use strict";Y.defineMode("markdown",function(K,L){var H=Y.getMode(K,"text/html"),N=H.name=="null";function R(U){if(Y.findModeByName){var C=Y.findModeByName(U);C&&(U=C.mime||C.mimes[0])}var W=Y.getMode(K,U);return W.name=="null"?null:W}L.highlightFormatting===void 0&&(L.highlightFormatting=!1),L.maxBlockquoteDepth===void 0&&(L.maxBlockquoteDepth=0),L.taskLists===void 0&&(L.taskLists=!1),L.strikethrough===void 0&&(L.strikethrough=!1),L.emoji===void 0&&(L.emoji=!1),L.fencedCodeBlockHighlighting===void 0&&(L.fencedCodeBlockHighlighting=!0),L.fencedCodeBlockDefaultMode===void 0&&(L.fencedCodeBlockDefaultMode="text/plain"),L.xml===void 0&&(L.xml=!0),L.tokenTypeOverrides===void 0&&(L.tokenTypeOverrides={});var j={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 k in j)j.hasOwnProperty(k)&&L.tokenTypeOverrides[k]&&(j[k]=L.tokenTypeOverrides[k]);var A=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,h=L.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,u=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,o=" ";function n(U,C,W){return C.f=C.inline=W,W(U,C)}function f(U,C,W){return C.f=C.block=W,W(U,C)}function O(U){return!U||!/\S/.test(U.string)}function S(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==w){var C=N;if(!C){var W=Y.innerMode(H,U.htmlState);C=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}C&&(U.f=p,U.block=x,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function x(U,C){var W=U.column()===C.indentation,V=O(C.prevLine.stream),J=C.indentedCode,ne=C.prevLine.hr,fe=C.list!==!1,ue=(C.listStack[C.listStack.length-1]||0)+3;C.indentedCode=!1;var le=C.indentation;if(C.indentationDiff===null&&(C.indentationDiff=C.indentation,fe)){for(C.list=null;le<C.listStack[C.listStack.length-1];)C.listStack.pop(),C.listStack.length?C.indentation=C.listStack[C.listStack.length-1]:C.list=!1;C.list!==!1&&(C.indentationDiff=le-C.listStack[C.listStack.length-1])}var me=!V&&!ne&&!C.prevLine.header&&(!fe||!J)&&!C.prevLine.fencedCodeEnd,ge=(C.list===!1||ne||V)&&C.indentation<=ue&&U.match(A),re=null;if(C.indentationDiff>=4&&(J||C.prevLine.fencedCodeEnd||C.prevLine.header||V))return U.skipToEnd(),C.indentedCode=!0,j.code;if(U.eatSpace())return null;if(W&&C.indentation<=ue&&(re=U.match(h))&&re[1].length<=6)return C.quote=0,C.header=re[1].length,C.thisLine.header=!0,L.highlightFormatting&&(C.formatting="header"),C.f=C.inline,y(C);if(C.indentation<=ue&&U.eat(">"))return C.quote=W?1:C.quote+1,L.highlightFormatting&&(C.formatting="quote"),U.eatSpace(),y(C);if(!ge&&!C.setext&&W&&C.indentation<=ue&&(re=U.match(D))){var oe=re[1]?"ol":"ul";return C.indentation=le+U.current().length,C.list=!0,C.quote=0,C.listStack.push(C.indentation),C.em=!1,C.strong=!1,C.code=!1,C.strikethrough=!1,L.taskLists&&U.match(g,!1)&&(C.taskList=!0),C.f=C.inline,L.highlightFormatting&&(C.formatting=["list","list-"+oe]),y(C)}else{if(W&&C.indentation<=ue&&(re=U.match(s,!0)))return C.quote=0,C.fencedEndRE=new RegExp(re[1]+"+ *$"),C.localMode=L.fencedCodeBlockHighlighting&&R(re[2]||L.fencedCodeBlockDefaultMode),C.localMode&&(C.localState=Y.startState(C.localMode)),C.f=C.block=T,L.highlightFormatting&&(C.formatting="code-block"),C.code=-1,y(C);if(C.setext||(!me||!fe)&&!C.quote&&C.list===!1&&!C.code&&!ge&&!l.test(U.string)&&(re=U.lookAhead(1))&&(re=re.match(u)))return C.setext?(C.header=C.setext,C.setext=0,U.skipToEnd(),L.highlightFormatting&&(C.formatting="header")):(C.header=re[0].charAt(0)=="="?1:2,C.setext=C.header),C.thisLine.header=!0,C.f=C.inline,y(C);if(ge)return U.skipToEnd(),C.hr=!0,C.thisLine.hr=!0,j.hr;if(U.peek()==="[")return n(U,C,I)}return n(U,C,C.inline)}function w(U,C){var W=H.token(U,C.htmlState);if(!N){var V=Y.innerMode(H,C.htmlState);(V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText||C.md_inside&&U.current().indexOf(">")>-1)&&(C.f=p,C.block=x,C.htmlState=null)}return W}function T(U,C){var W=C.listStack[C.listStack.length-1]||0,V=C.indentation<W,J=W+3;if(C.fencedEndRE&&C.indentation<=J&&(V||U.match(C.fencedEndRE))){L.highlightFormatting&&(C.formatting="code-block");var ne;return V||(ne=y(C)),C.localMode=C.localState=null,C.block=x,C.f=p,C.fencedEndRE=null,C.code=0,C.thisLine.fencedCodeEnd=!0,V?f(U,C,C.block):ne}else return C.localMode?C.localMode.token(U,C.localState):(U.skipToEnd(),j.code)}function y(U){var C=[];if(U.formatting){C.push(j.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var W=0;W<U.formatting.length;W++)C.push(j.formatting+"-"+U.formatting[W]),U.formatting[W]==="header"&&C.push(j.formatting+"-"+U.formatting[W]+"-"+U.header),U.formatting[W]==="quote"&&(!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=U.quote?C.push(j.formatting+"-"+U.formatting[W]+"-"+U.quote):C.push("error"))}if(U.taskOpen)return C.push("meta"),C.length?C.join(" "):null;if(U.taskClosed)return C.push("property"),C.length?C.join(" "):null;if(U.linkHref?C.push(j.linkHref,"url"):(U.strong&&C.push(j.strong),U.em&&C.push(j.em),U.strikethrough&&C.push(j.strikethrough),U.emoji&&C.push(j.emoji),U.linkText&&C.push(j.linkText),U.code&&C.push(j.code),U.image&&C.push(j.image),U.imageAltText&&C.push(j.imageAltText,"link"),U.imageMarker&&C.push(j.imageMarker)),U.header&&C.push(j.header,j.header+"-"+U.header),U.quote&&(C.push(j.quote),!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=U.quote?C.push(j.quote+"-"+U.quote):C.push(j.quote+"-"+L.maxBlockquoteDepth)),U.list!==!1){var V=(U.listStack.length-1)%3;V?V===1?C.push(j.list2):C.push(j.list3):C.push(j.list1)}return U.trailingSpaceNewLine?C.push("trailing-space-new-line"):U.trailingSpace&&C.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),C.length?C.join(" "):null}function v(U,C){return U.match(d,!0)?y(C):void 0}function p(U,C){var W=C.text(U,C);if(typeof W!="undefined")return W;if(C.list)return C.list=null,y(C);if(C.taskList){var V=U.match(g,!0)[1]===" ";return V?C.taskOpen=!0:C.taskClosed=!0,L.highlightFormatting&&(C.formatting="task"),C.taskList=!1,y(C)}if(C.taskOpen=!1,C.taskClosed=!1,C.header&&U.match(/^#+$/,!0))return L.highlightFormatting&&(C.formatting="header"),y(C);var J=U.next();if(C.linkTitle){C.linkTitle=!1;var ne=J;J==="("&&(ne=")"),ne=(ne+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var fe="^\\s*(?:[^"+ne+"\\\\]+|\\\\\\\\|\\\\.)"+ne;if(U.match(new RegExp(fe),!0))return j.linkHref}if(J==="`"){var ue=C.formatting;L.highlightFormatting&&(C.formatting="code"),U.eatWhile("`");var le=U.current().length;if(C.code==0&&(!C.quote||le==1))return C.code=le,y(C);if(le==C.code){var me=y(C);return C.code=0,me}else return C.formatting=ue,y(C)}else if(C.code)return y(C);if(J==="\\"&&(U.next(),L.highlightFormatting)){var ge=y(C),re=j.formatting+"-escape";return ge?ge+" "+re:re}if(J==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return C.imageMarker=!0,C.image=!0,L.highlightFormatting&&(C.formatting="image"),y(C);if(J==="["&&C.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return C.imageMarker=!1,C.imageAltText=!0,L.highlightFormatting&&(C.formatting="image"),y(C);if(J==="]"&&C.imageAltText){L.highlightFormatting&&(C.formatting="image");var ge=y(C);return C.imageAltText=!1,C.image=!1,C.inline=C.f=E,ge}if(J==="["&&!C.image)return C.linkText&&U.match(/^.*?\]/)||(C.linkText=!0,L.highlightFormatting&&(C.formatting="link")),y(C);if(J==="]"&&C.linkText){L.highlightFormatting&&(C.formatting="link");var ge=y(C);return C.linkText=!1,C.inline=C.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?E:p,ge}if(J==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){C.f=C.inline=c,L.highlightFormatting&&(C.formatting="link");var ge=y(C);return ge?ge+=" ":ge="",ge+j.linkInline}if(J==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){C.f=C.inline=c,L.highlightFormatting&&(C.formatting="link");var ge=y(C);return ge?ge+=" ":ge="",ge+j.linkEmail}if(L.xml&&J==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var oe=U.string.indexOf(">",U.pos);if(oe!=-1){var xe=U.string.substring(U.start,oe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(xe)&&(C.md_inside=!0)}return U.backUp(1),C.htmlState=Y.startState(H),f(U,C,w)}if(L.xml&&J==="<"&&U.match(/^\/\w*?>/))return C.md_inside=!1,"tag";if(J==="*"||J==="_"){for(var Be=1,Ve=U.pos==1?" ":U.string.charAt(U.pos-2);Be<3&&U.eat(J);)Be++;var Ye=U.peek()||" ",$e=!/\s/.test(Ye)&&(!i.test(Ye)||/\s/.test(Ve)||i.test(Ve)),Ke=!/\s/.test(Ve)&&(!i.test(Ve)||/\s/.test(Ye)||i.test(Ye)),We=null,ze=null;if(Be%2&&(!C.em&&$e&&(J==="*"||!Ke||i.test(Ve))?We=!0:C.em==J&&Ke&&(J==="*"||!$e||i.test(Ye))&&(We=!1)),Be>1&&(!C.strong&&$e&&(J==="*"||!Ke||i.test(Ve))?ze=!0:C.strong==J&&Ke&&(J==="*"||!$e||i.test(Ye))&&(ze=!1)),ze!=null||We!=null){L.highlightFormatting&&(C.formatting=We==null?"strong":ze==null?"em":"strong em"),We===!0&&(C.em=J),ze===!0&&(C.strong=J);var me=y(C);return We===!1&&(C.em=!1),ze===!1&&(C.strong=!1),me}}else if(J===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return y(C);U.backUp(1)}if(L.strikethrough){if(J==="~"&&U.eatWhile(J)){if(C.strikethrough){L.highlightFormatting&&(C.formatting="strikethrough");var me=y(C);return C.strikethrough=!1,me}else if(U.match(/^[^\s]/,!1))return C.strikethrough=!0,L.highlightFormatting&&(C.formatting="strikethrough"),y(C)}else if(J===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return y(C);U.backUp(2)}}if(L.emoji&&J===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){C.emoji=!0,L.highlightFormatting&&(C.formatting="emoji");var at=y(C);return C.emoji=!1,at}return J===" "&&(U.match(/^ +$/,!1)?C.trailingSpace++:C.trailingSpace&&(C.trailingSpaceNewLine=!0)),y(C)}function c(U,C){var W=U.next();if(W===">"){C.f=C.inline=p,L.highlightFormatting&&(C.formatting="link");var V=y(C);return V?V+=" ":V="",V+j.linkInline}return U.match(/^[^>]+/,!0),j.linkInline}function E(U,C){if(U.eatSpace())return null;var W=U.next();return W==="("||W==="["?(C.f=C.inline=b(W==="("?")":"]"),L.highlightFormatting&&(C.formatting="link-string"),C.linkHref=!0,y(C)):"error"}var _={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(U){return function(C,W){var V=C.next();if(V===U){W.f=W.inline=p,L.highlightFormatting&&(W.formatting="link-string");var J=y(W);return W.linkHref=!1,J}return C.match(_[U]),W.linkHref=!0,y(W)}}function I(U,C){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(C.f=P,U.next(),L.highlightFormatting&&(C.formatting="link"),C.linkText=!0,y(C)):n(U,C,p)}function P(U,C){if(U.match(/^\]:/,!0)){C.f=C.inline=B,L.highlightFormatting&&(C.formatting="link");var W=y(C);return C.linkText=!1,W}return U.match(/^([^\]\\]|\\.)+/,!0),j.linkText}function B(U,C){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?C.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),C.f=C.inline=p,j.linkHref+" url")}var z={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:p,text:v,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(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&Y.copyState(H,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?Y.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,C){if(C.formatting=!1,U!=C.thisLine.stream){if(C.header=0,C.hr=!1,U.match(/^\s*$/,!0))return S(C),null;if(C.prevLine=C.thisLine,C.thisLine={stream:U},C.taskList=!1,C.trailingSpace=0,C.trailingSpaceNewLine=!1,!C.localState&&(C.f=C.block,C.f!=w)){var W=U.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(C.indentation=W,C.indentationDiff=null,W>0)return null}}return C.f(U,C)},innerMode:function(U){return U.block==w?{state:U.htmlState,mode:H}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:z}},indent:function(U,C,W){return U.block==w&&H.indent?H.indent(U.htmlState,C,W):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,C,W):Y.Pass},blankLine:S,getType:y,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return z},"xml"),Y.defineMIME("text/markdown","markdown"),Y.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return k});var Y=F("cDcd"),K=F("biw7"),L=F("fyJ8");function H(A){var D=A.className,g=A.index,h=A.children,u=A.colSpan,d=A.rowSpan,s=Y.useContext(K.a),l=s.prefixCls,i=s.fixedInfoList,o=i[g];return Y.createElement(L.a,Object.assign({className:D,index:g,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:h,props:{colSpan:u,rowSpan:d}}}},o))}function N(A){return Y.createElement("tr",Object.assign({},A))}function R(A){var D=A.children,g=Y.useContext(K.a),h=g.prefixCls;return Y.createElement("tfoot",{className:"".concat(h,"-summary")},D)}var j=ye.b=R,k={Cell:H,Row:N}},nWbc:function(Le,ye,F){},oFv4:function(Le,ye,F){Le.exports=F.p+"static/internal.da228387.png"},osHv:function(Le,ye,F){(function(Y){Y(F("VrN/"))})(function(Y){"use strict";var K=Y.Pos;function L(i,o){return i.line-o.line||i.ch-o.ch}var H="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",N=H+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",R=new RegExp("<(/?)(["+H+"]["+N+"]*)","g");function j(i,o,n,f){this.line=o,this.ch=n,this.cm=i,this.text=i.getLine(o),this.min=f?Math.max(f.from,i.firstLine()):i.firstLine(),this.max=f?Math.min(f.to-1,i.lastLine()):i.lastLine()}function k(i,o){var n=i.cm.getTokenTypeAt(K(i.line,o));return n&&/\btag\b/.test(n)}function A(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function D(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function g(i){for(;;){var o=i.text.indexOf(">",i.ch);if(o==-1){if(A(i))continue;return}if(!k(i,o+1)){i.ch=o+1;continue}var n=i.text.lastIndexOf("/",o),f=n>-1&&!/\S/.test(i.text.slice(n+1,o));return i.ch=o+1,f?"selfClose":"regular"}}function h(i){for(;;){var o=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(o==-1){if(D(i))continue;return}if(!k(i,o+1)){i.ch=o;continue}R.lastIndex=o,i.ch=o;var n=R.exec(i.text);if(n&&n.index==o)return n}}function u(i){for(;;){R.lastIndex=i.ch;var o=R.exec(i.text);if(!o){if(A(i))continue;return}if(!k(i,o.index+1)){i.ch=o.index+1;continue}return i.ch=o.index+o[0].length,o}}function d(i){for(;;){var o=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(o==-1){if(D(i))continue;return}if(!k(i,o+1)){i.ch=o;continue}var n=i.text.lastIndexOf("/",o),f=n>-1&&!/\S/.test(i.text.slice(n+1,o));return i.ch=o+1,f?"selfClose":"regular"}}function s(i,o){for(var n=[];;){var f=u(i),O,S=i.line,x=i.ch-(f?f[0].length:0);if(!f||!(O=g(i)))return;if(O=="selfClose")continue;if(f[1]){for(var w=n.length-1;w>=0;--w)if(n[w]==f[2]){n.length=w;break}if(w<0&&(!o||o==f[2]))return{tag:f[2],from:K(S,x),to:K(i.line,i.ch)}}else n.push(f[2])}}function l(i,o){for(var n=[];;){var f=d(i);if(!f)return;if(f=="selfClose"){h(i);continue}var O=i.line,S=i.ch,x=h(i);if(!x)return;if(x[1])n.push(x[2]);else{for(var w=n.length-1;w>=0;--w)if(n[w]==x[2]){n.length=w;break}if(w<0&&(!o||o==x[2]))return{tag:x[2],from:K(i.line,i.ch),to:K(O,S)}}}}Y.registerHelper("fold","xml",function(i,o){for(var n=new j(i,o.line,0);;){var f=u(n);if(!f||n.line!=o.line)return;var O=g(n);if(!O)return;if(!f[1]&&O!="selfClose"){var S=K(n.line,n.ch),x=s(n,f[2]);return x&&L(x.from,S)>0?{from:S,to:x.from}:null}}}),Y.findMatchingTag=function(i,o,n){var f=new j(i,o.line,o.ch,n);if(f.text.indexOf(">")==-1&&f.text.indexOf("<")==-1)return;var O=g(f),S=O&&K(f.line,f.ch),x=O&&h(f);if(!O||!x||L(f,o)>0)return;var w={from:K(f.line,f.ch),to:S,tag:x[2]};return O=="selfClose"?{open:w,close:null,at:"open"}:x[1]?{open:l(f,x[2]),close:w,at:"close"}:(f=new j(i,S.line,S.ch,n),{open:w,close:s(f,x[2]),at:"open"})},Y.findEnclosingTag=function(i,o,n,f){for(var O=new j(i,o.line,o.ch,n);;){var S=l(O,f);if(!S)break;var x=new j(i,o.line,o.ch,n),w=s(x,S.tag);if(w)return{open:S,close:w}}},Y.scanForClosingTag=function(i,o,n,f){var O=new j(i,o.line,o.ch,f?{from:0,to:f}:null);return s(O,n)}})},"p/48":function(Le,ye,F){},p5ED:function(Le,ye,F){"use strict";var Y=F("+L6B"),K=F("2/Rp"),L=F("5Dmo"),H=F("3S7+"),N=F("k1fw"),R=F("tJVT"),j=F("cDcd"),k=F.n(j),A=F("vHTk"),D=F.n(A),g=F("yEEn"),h=F("ZW9T"),u=F("1vsH");ye.a=function(d){var s=d.name,l=d.data,i=d.theme,o=d.type,n=d.filename,f=d.monacoEditor,O=d.className,S=d.style,x=d.close,w=d.onClose,T=d.hasMask,y=Object(j.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),v=Object(R.a)(y,2),p=v[0],c=v[1],E=Object(j.useState)(""),_=Object(R.a)(E,2),b=_[0],I=_[1],P,B=1024*1024,z=10*B,U=Object(j.useRef)();o==="office"&&(P=Object(u.V)(l).filesize,P>z&&(o="other")),n&&(f.filename=n),Object(j.useEffect)(function(){var V,J,ne=(V=document.cookie)===null||V===void 0||((J=V.replace(/\s/g,""))===null||J===void 0)?void 0:J.split(";");ne==null||ne.map(function(fe){var ue=fe.split("=");ue[0]==="_educoder_session"&&I(ue[1])})},[]);var C=function(){if(l.startsWith("http")||l.startsWith("/")){W();return}Object(u.z)(n||"educoder",l,n)},W=function(){Object(u.x)(n||s,l)};return console.log("data:",l,"fileanme:",n," name:",s),k.a.createElement("div",{style:Object(N.a)({},S||{}),className:"".concat(T&&D.a.bgBlack," ").concat(o?D.a.wrp:"hide")},x&&k.a.createElement("div",{className:D.a.close,ref:U},k.a.createElement(H.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},k.a.createElement("span",{onClick:W},k.a.createElement("i",{className:"icon-quxiaozhiding"}))),k.a.createElement(H.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},k.a.createElement("span",{className:"",onClick:w},k.a.createElement("i",{className:"icon-guanbi1"})))),k.a.createElement("div",{className:"".concat(D.a[O]," ").concat(O," ").concat(D.a.monaco," ").concat(o==="txt"?"show":"hide")},o==="txt"&&k.a.createElement(h.b,f)),o==="audio"&&k.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),o==="video"&&k.a.createElement(k.a.Fragment,null,l!=null&&l.startsWith("/")?k.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):k.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),o==="html"&&k.a.createElement("iframe",{src:l+"&disposition=inline"}),o==="pdf"&&k.a.createElement("embed",{className:D.a.embed,src:l}),o==="image"&&k.a.createElement(k.a.Fragment,null,k.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),o==="other"&&k.a.createElement("div",null,k.a.createElement(K.a,{type:"primary",size:"large",onClick:C},k.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(o==="download"||o==="office")&&k.a.createElement(K.a,{type:"primary",size:"large",onClick:C},k.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Le,ye,F){},pPuO:function(Le,ye,F){Le.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},psGv:function(Le,ye,F){var Y,K;(function(){var L;(function(){"use strict";var j=[,,function(g){function h(s){this.__parent=s,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}h.prototype.clone_empty=function(){var s=new h(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},h.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},h.prototype.has_match=function(s){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(s))return!0;return!1},h.prototype.set_indent=function(s,l){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},h.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(s){this.__items.push(s);var l=s.lastIndexOf(`
`);l!==-1?this.__character_count=s.length-l:this.__character_count+=s.length},h.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function u(s,l){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),l=l||"",s.indent_level>0&&(l=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}u.prototype.get_indent_size=function(s,l){var i=this.__base_string_length;return l=l||0,s<0&&(i=0),i+=s*this.__indent_size,i+=l,i},u.prototype.get_indent_string=function(s,l){var i=this.__base_string;return l=l||0,s<0&&(s=0,i=""),l+=s*this.__indent_size,this.__ensure_cache(l),i+=this.__cache[l],i},u.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var s=this.__cache.length,l=0,i="";this.__indent_size&&s>=this.__indent_size&&(l=Math.floor(s/this.__indent_size),s-=l*this.__indent_size,i=new Array(l+1).join(this.__indent_string)),s&&(i+=new Array(s+1).join(" ")),this.__cache.push(i)};function d(s,l){this.__indent_cache=new u(s,l),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(s,l){return this.__indent_cache.get_indent_string(s,l)},d.prototype.get_indent_size=function(s,l){return this.__indent_cache.get_indent_size(s,l)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(s){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return s!==`
`&&(i=i.replace(/[\n]/g,s)),i},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(s,l){return s=s||0,l=l||0,this.next_line.set_indent(s,l),this.__lines.length>1?(this.current_line.set_indent(s,l),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(s){for(var l=0;l<s.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},d.prototype.remove_indent=function(s){for(var l=this.__lines.length;s<l;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(s,l){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(s)!==0&&o.item(-1)!==l){this.__lines.splice(i+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},g.exports.Output=d},function(g){function h(u,d,s,l){this.type=u,this.text=d,this.comments_before=null,this.newlines=s||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=h},,,function(g){function h(s,l){this.raw_options=u(s,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}h.prototype._get_array=function(s,l){var i=this.raw_options[s],o=l||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(o=i.concat()):typeof i=="string"&&(o=i.split(/[^a-zA-Z0-9_\/\-]+/)),o},h.prototype._get_boolean=function(s,l){var i=this.raw_options[s],o=i===void 0?!!l:!!i;return o},h.prototype._get_characters=function(s,l){var i=this.raw_options[s],o=l||"";return typeof i=="string"&&(o=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),o},h.prototype._get_number=function(s,l){var i=this.raw_options[s];l=parseInt(l,10),isNaN(l)&&(l=0);var o=parseInt(i,10);return isNaN(o)&&(o=l),o},h.prototype._get_selection=function(s,l,i){var o=this._get_selection_list(s,l,i);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[s]+"'");return o[0]},h.prototype._get_selection_list=function(s,l,i){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[l[0]],!this._is_valid_selection(i,l))throw new Error("Invalid Default Value!");var o=this._get_array(s,i);if(!this._is_valid_selection(o,l))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[s]+"'");return o},h.prototype._is_valid_selection=function(s,l){return s.length&&l.length&&!s.some(function(i){return l.indexOf(i)===-1})};function u(s,l){var i={};s=d(s);var o;for(o in s)o!==l&&(i[o]=s[o]);if(l&&s[l])for(o in s[l])i[o]=s[l][o];return i}function d(s){var l={},i;for(i in s){var o=i.replace(/-/g,"_");l[o]=s[i]}return l}g.exports.Options=h,g.exports.normalizeOpts=d,g.exports.mergeOpts=u},,function(g){var h=RegExp.prototype.hasOwnProperty("sticky");function u(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position<this.__input_length},u.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},u.prototype.peek=function(d){var s=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(s=this.__input.charAt(d)),s},u.prototype.__match=function(d,s){d.lastIndex=s;var l=d.exec(this.__input);return l&&!(h&&d.sticky)&&(l.index!==s&&(l=null)),l},u.prototype.test=function(d,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(d,s):!1},u.prototype.testChar=function(d,s){var l=this.peek(s);return d.lastIndex=0,l!==null&&d.test(l)},u.prototype.match=function(d){var s=this.__match(d,this.__position);return s?this.__position+=s[0].length:s=null,s},u.prototype.read=function(d,s,l){var i="",o;return d&&(o=this.match(d),o&&(i+=o[0])),s&&(o||!d)&&(i+=this.readUntil(s,l)),i},u.prototype.readUntil=function(d,s){var l="",i=this.__position;d.lastIndex=this.__position;var o=d.exec(this.__input);return o?(i=o.index,s&&(i+=o[0].length)):i=this.__input_length,l=this.__input.substring(this.__position,i),this.__position=i,l},u.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},u.prototype.get_regexp=function(d,s){var l=null,i="g";return s&&h&&(i="y"),typeof d=="string"&&d!==""?l=new RegExp(d,i):d&&(l=new RegExp(d.source,i)),l},u.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(d){var s=this.__position,l=this.readUntilAfter(d);return this.__position=s,l},u.prototype.lookBack=function(d){var s=this.__position-1;return s>=d.length&&this.__input.substring(s-d.length,s).toLowerCase()===d},g.exports.InputScanner=u},function(g,h,u){var d=u(8).InputScanner,s=u(3).Token,l=u(10).TokenStream,i=u(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(f,O){this._input=new d(f),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var f,O=new s(o.START,""),S=null,x=[],w=new l;O.type!==o.EOF;){for(f=this._get_next_token(O,S);this._is_comment(f);)w.add(f),f=this._get_next_token(O,S);w.isEmpty()||(f.comments_before=w,w=new l),f.parent=S,this._is_opening(f)?(x.push(S),S=f):S&&this._is_closing(f,S)&&(f.opened=S,S.closed=f,S=x.pop(),f.parent=S),f.previous=O,O.next=f,this.__tokens.add(f),O=f}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(f,O){this._readWhitespace();var S=this._input.read(/.+/g);return S?this._create_token(o.RAW,S):this._create_token(o.EOF,"")},n.prototype._is_comment=function(f){return!1},n.prototype._is_opening=function(f){return!1},n.prototype._is_closing=function(f,O){return!1},n.prototype._create_token=function(f,O){var S=new s(f,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=n,g.exports.TOKEN=o},function(g){function h(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},h.prototype.peek=function(u){var d=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(d=this.__tokens[u]),d},h.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},g.exports.TokenStream=h},function(g,h,u){var d=u(12).Pattern;function s(l,i){d.call(this,l,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new d,s.prototype.__set_whitespace_patterns=function(l,i){l+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var i=this.__split(this._newline_regexp,l);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return l},s.prototype.matching=function(l,i){var o=this._create();return o.__set_whitespace_patterns(l,i),o._update(),o},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(l,i){l.lastIndex=0;for(var o=0,n=[],f=l.exec(i);f;)n.push(i.substring(o,f.index)),o=f.index+f[0].length,f=l.exec(i);return o<i.length?n.push(i.substring(o,i.length)):n.push(""),n},g.exports.WhitespacePattern=s},function(g){function h(u,d){this._input=u,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}h.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(u){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(u),d._update(),d},h.prototype.until=function(u){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(u),d._update(),d},h.prototype.starting_with=function(u){var d=this._create();return d._starting_pattern=this._input.get_regexp(u,!0),d._update(),d},h.prototype.matching=function(u){var d=this._create();return d._match_pattern=this._input.get_regexp(u,!0),d._update(),d},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},g.exports.Pattern=h},function(g){function h(u,d){u=typeof u=="string"?u:u.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+d,"g")}h.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(u);s;)d[s[1]]=s[2],s=this.__directive_pattern.exec(u);return d},h.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=h},function(g,h,u){var d=u(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(i,o){d.call(this,i,o),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var n=new d(i);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new d,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(i){var o=this._create();return o._disabled[i]=!0,o._update(),o},l.prototype.read_options=function(i){var o=this._create();for(var n in s)o._disabled[n]=i.templating.indexOf(n)===-1;return o._update(),o},l.prototype.exclude=function(i){var o=this._create();return o._excluded[i]=!0,o._update(),o},l.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),i+=o,o=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},l.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},l.prototype._read_template=function(){var i="",o=this._input.peek();if(o==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(i=i||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},g.exports.TemplatablePattern=l},,,,function(g,h,u){var d=u(19).Beautifier,s=u(20).Options;function l(i,o,n,f){var O=new d(i,o,n,f);return O.beautify()}g.exports=l,g.exports.defaultOptions=function(){return new s}},function(g,h,u){var d=u(20).Options,s=u(2).Output,l=u(21).Tokenizer,i=u(21).TOKEN,o=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,f=function(E,_){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new s(E,_)};f.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},f.prototype.set_space_before_token=function(E,_){this._output.space_before_token=E,this._output.non_breaking_space=_},f.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},f.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},f.prototype.print_preserved_newlines=function(E){var _=0;E.type!==i.TEXT&&E.previous.type!==i.TEXT&&(_=E.newlines?1:0),this.preserve_newlines&&(_=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var b=0;b<_;b++)this.print_newline(b>0);return _!==0},f.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},f.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},f.prototype.print_newline=function(E){this._output.add_new_line(E)},f.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var O=function(E){for(var _=null,b=E.next;b.type!==i.EOF&&E.closed!==b;){if(b.type===i.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===i.EQUALS&&b.next.next&&b.next.next.type===i.VALUE&&(_=b.next.next.text);break}b=b.next}return _},S=function(E,_){var b=null,I=null;return _.closed?(E==="script"?b="text/javascript":E==="style"&&(b="text/css"),b=O(_)||b,b.search("text/css")>-1?I="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?I="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?I="html":b.search(/test\/null/)>-1&&(I="null"),I):null};function x(E,_){return _.indexOf(E)!==-1}function w(E,_,b){this.parent=E||null,this.tag=_?_.tag_name:"",this.indent_level=b||0,this.parser_token=_||null}function T(E){this._printer=E,this._current_frame=null}T.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},T.prototype.record_tag=function(E){var _=new w(this._current_frame,E,this._printer.indent_level);this._current_frame=_},T.prototype._try_pop_frame=function(E){var _=null;return E&&(_=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),_},T.prototype._get_frame=function(E,_){for(var b=this._current_frame;b&&!(E.indexOf(b.tag)!==-1);){if(_&&_.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},T.prototype.try_pop=function(E,_){var b=this._get_frame([E],_);return this._try_pop_frame(b)},T.prototype.indent_to_tag=function(E){var _=this._get_frame(E);_&&(this._printer.indent_level=_.indent_level)};function y(E,_,b,I){this._source_text=E||"",_=_||{},this._js_beautify=b,this._css_beautify=I,this._tag_stack=null;var P=new d(_,"html");this._options=P,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,_=this._options.eol;this._options.eol==="auto"&&(_=`
`,E&&o.test(E)&&(_=E.match(o)[0])),E=E.replace(n,`
`);var b=E.match(/^[\t ]*/)[0],I={text:"",type:""},P=new v,B=new f(this._options,b),z=new l(E,this._options).tokenize();this._tag_stack=new T(B);for(var U=null,C=z.next();C.type!==i.EOF;)C.type===i.TAG_OPEN||C.type===i.COMMENT?(U=this._handle_tag_open(B,C,P,I),P=U):C.type===i.ATTRIBUTE||C.type===i.EQUALS||C.type===i.VALUE||C.type===i.TEXT&&!P.tag_complete?U=this._handle_inside_tag(B,C,P,z):C.type===i.TAG_CLOSE?U=this._handle_tag_close(B,C,P):C.type===i.TEXT?U=this._handle_text(B,C,P):B.add_raw_token(C),I=U,C=z.next();var W=B._output.get_code(_);return W},y.prototype._handle_tag_close=function(E,_,b){var I={text:_.text,type:_.type};return E.alignment_size=0,b.tag_complete=!0,E.set_space_before_token(_.newlines||_.whitespace_before!=="",!0),b.is_unformatted?E.add_raw_token(_):(b.tag_start_char==="<"&&(E.set_space_before_token(_.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(_)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(E.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&E.set_wrap_point(),I},y.prototype._handle_inside_tag=function(E,_,b,I){var P=b.has_wrapped_attrs,B={text:_.text,type:_.type};if(E.set_space_before_token(_.newlines||_.whitespace_before!=="",!0),b.is_unformatted)E.add_raw_token(_);else if(b.tag_start_char==="{"&&_.type===i.TEXT)E.print_preserved_newlines(_)?(_.newlines=0,E.add_raw_token(_)):E.print_token(_);else{if(_.type===i.ATTRIBUTE?(E.set_space_before_token(!0),b.attr_count+=1):(_.type===i.EQUALS||_.type===i.VALUE&&_.previous.type===i.EQUALS)&&E.set_space_before_token(!1),_.type===i.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(_),P=P||_.newlines!==0),this._is_wrap_attributes_force)){var z=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var U=!0,C=0,W;do{if(W=I.peek(C),W.type===i.ATTRIBUTE){U=!1;break}C+=1}while(C<4&&W.type!==i.EOF&&W.type!==i.TAG_CLOSE);z=!U}z&&(E.print_newline(!1),P=!0)}E.print_token(_),P=P||E.previous_token_wrapped(),b.has_wrapped_attrs=P}return B},y.prototype._handle_text=function(E,_,b){var I={text:_.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(E,_,b):b.is_unformatted||b.is_content_unformatted?E.add_raw_token(_):(E.traverse_whitespace(_),E.print_token(_)),I},y.prototype._print_custom_beatifier_text=function(E,_,b){var I=this;if(_.text!==""){var P=_.text,B,z=1,U="",C="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?B=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?B=this._css_beautify:b.custom_beautifier_name==="html"&&(B=function(ue,le){var me=new y(ue,le,I._js_beautify,I._css_beautify);return me.beautify()}),this._options.indent_scripts==="keep"?z=0:this._options.indent_scripts==="separate"&&(z=-E.indent_level);var W=E.get_full_indent(z);if(P=P.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&P[0]==="<"&&P.match(/^(<!--|<!\[CDATA\[)/)){var V=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(P);if(!V){E.add_raw_token(_);return}U=W+V[1]+`
`,P=V[4],V[5]&&(C=W+V[5]),P=P.replace(/\n[ \t]*$/,""),(V[2]||V[3].indexOf(`
`)!==-1)&&(V=V[3].match(/[ \t]+$/),V&&(_.whitespace_before=V[0]))}if(P)if(B){var J=function(){this.eol=`
`};J.prototype=this._options.raw_options;var ne=new J;P=B(W+P,ne)}else{var fe=_.whitespace_before;fe&&(P=P.replace(new RegExp(`
(`+fe+")?","g"),`
`)),P=W+P.replace(/\n/g,`
`+W)}U&&(P?P=U+P+`
`+C:P=U+C),E.print_newline(!1),P&&(_.text=P,_.whitespace_before="",_.newlines=0,E.add_raw_token(_),E.print_newline(!0))}},y.prototype._handle_tag_open=function(E,_,b,I){var P=this._get_tag_open_token(_);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&_.type===i.TAG_OPEN&&_.text.indexOf("</")===0?(E.add_raw_token(_),P.start_tag_token=this._tag_stack.try_pop(P.tag_name)):(E.traverse_whitespace(_),this._set_tag_position(E,_,P,b,I),P.is_inline_element||E.set_wrap_point(),E.print_token(_)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(P.alignment_size=_.text.length+1),!P.tag_complete&&!P.is_unformatted&&(E.alignment_size=P.alignment_size),P};var v=function(E,_){if(this.parent=E||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!_)this.tag_complete=!0;else{var b;this.tag_start_char=_.text[0],this.text=_.text,this.tag_start_char==="<"?(b=_.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=_.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(_.text.startsWith("{{#>")||_.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&_.next!==null?this.tag_check=_.next.text.split(" ")[0]:this.tag_check=_.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),_.type===i.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||_.closed&&_.closed.text==="/>";var I=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(I=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(I)))}};y.prototype._get_tag_open_token=function(E){var _=new v(this._tag_stack.get_parser_token(),E);return _.alignment_size=this._options.wrap_attributes_indent_size,_.is_end_tag=_.is_end_tag||x(_.tag_check,this._options.void_elements),_.is_empty_element=_.tag_complete||_.is_start_tag&&_.is_end_tag,_.is_unformatted=!_.tag_complete&&x(_.tag_check,this._options.unformatted),_.is_content_unformatted=!_.is_empty_element&&x(_.tag_check,this._options.content_unformatted),_.is_inline_element=x(_.tag_name,this._options.inline)||_.tag_name.includes("-")||_.tag_start_char==="{",_},y.prototype._set_tag_position=function(E,_,b,I,P){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=S(b.tag_check,_)))),x(b.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var B=E.current_line_has_match(/{{#if/);B||E.print_newline(!1)}b.tag_name==="!--"&&P.type===i.TAG_CLOSE&&I.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,b))}else if(b.is_end_tag){var z=!1;z=b.start_tag_token&&b.start_tag_token.multiline_content,z=z||!b.is_inline_element&&!(I.is_inline_element||I.is_unformatted)&&!(P.type===i.TAG_CLOSE&&b.start_tag_token===I)&&P.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(z=!1),z&&E.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(P.type!=="TK_CONTENT"||b.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,b)},y.prototype._calcluate_parent_multiline=function(E,_){_.parent&&E._output.just_added_newline()&&!((_.is_inline_element||_.is_unformatted)&&_.parent.is_inline_element)&&(_.parent.multiline_content=!0)};var p=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(E){var _=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")_=_||this._tag_stack.try_pop("head");else if(E.tag_name==="li")_=_||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")_=_||this._tag_stack.try_pop("dt",["dl"]),_=_||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&p.indexOf(E.tag_name)!==-1){var b=E.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(_=_||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(_=_||this._tag_stack.try_pop("rt",["ruby","rtc"]),_=_||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?_=_||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?_=_||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?_=_||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(_=_||this._tag_stack.try_pop("caption",["table"]),_=_||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(_=_||this._tag_stack.try_pop("caption",["table"]),_=_||this._tag_stack.try_pop("colgroup",["table"]),_=_||this._tag_stack.try_pop("thead",["table"]),_=_||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(_=_||this._tag_stack.try_pop("caption",["table"]),_=_||this._tag_stack.try_pop("colgroup",["table"]),_=_||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(_=_||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),_=_||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),_},g.exports.Beautifier=y},function(g,h,u){var d=u(6).Options;function s(l){d.call(this,l,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}s.prototype=new d,g.exports.Options=s},function(g,h,u){var d=u(9).Tokenizer,s=u(9).TOKEN,l=u(13).Directives,i=u(14).TemplatablePattern,o=u(12).Pattern,n={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},f=new l(/<\!--/,/-->/),O=function(S,x){d.call(this,S,x),this._current_tag_name="";var w=new i(this._input).read_options(this._options),T=new o(this._input);if(this.__patterns={word:w.until(/[\n\r\t <]/),single_quote:w.until_after(/'/),double_quote:w.until_after(/"/),attribute:w.until(/[\n\r\t =>]|\/>/),element_name:w.until(/[\n\r\t >\/]/),handlebars_comment:T.starting_with(/{{!--/).until_after(/--}}/),handlebars:T.starting_with(/{{/).until_after(/}}/),handlebars_open:T.until(/[\n\r\t }]/),handlebars_raw_close:T.until(/}}/),comment:T.starting_with(/<!--/).until_after(/-->/),cdata:T.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:T.starting_with(/<!\[/).until_after(/]>/),processing:T.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=T.matching(y).until_after(y)}};O.prototype=new d,O.prototype._is_comment=function(S){return!1},O.prototype._is_opening=function(S){return S.type===n.TAG_OPEN},O.prototype._is_closing=function(S,x){return S.type===n.TAG_CLOSE&&x&&((S.text===">"||S.text==="/>")&&x.text[0]==="<"||S.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(S,x){var w=null;this._readWhitespace();var T=this._input.peek();return T===null?this._create_token(n.EOF,""):(w=w||this._read_open_handlebars(T,x),w=w||this._read_attribute(T,S,x),w=w||this._read_close(T,x),w=w||this._read_raw_content(T,S,x),w=w||this._read_content_word(T),w=w||this._read_comment_or_cdata(T),w=w||this._read_processing(T),w=w||this._read_open(T,x),w=w||this._create_token(n.UNKNOWN,this._input.next()),w)},O.prototype._read_comment_or_cdata=function(S){var x=null,w=null,T=null;if(S==="<"){var y=this._input.peek(1);y==="!"&&(w=this.__patterns.comment.read(),w?(T=f.get_directives(w),T&&T.ignore==="start"&&(w+=f.readIgnored(this._input))):w=this.__patterns.cdata.read()),w&&(x=this._create_token(n.COMMENT,w),x.directives=T)}return x},O.prototype._read_processing=function(S){var x=null,w=null,T=null;if(S==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(w=this.__patterns.conditional_comment.read(),w=w||this.__patterns.processing.read()),w&&(x=this._create_token(n.COMMENT,w),x.directives=T)}return x},O.prototype._read_open=function(S,x){var w=null,T=null;return x||S==="<"&&(w=this._input.next(),this._input.peek()==="/"&&(w+=this._input.next()),w+=this.__patterns.element_name.read(),T=this._create_token(n.TAG_OPEN,w)),T},O.prototype._read_open_handlebars=function(S,x){var w=null,T=null;return x||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(w=this.__patterns.handlebars_comment.read(),w=w||this.__patterns.handlebars.read(),T=this._create_token(n.COMMENT,w)):(w=this.__patterns.handlebars_open.read(),T=this._create_token(n.TAG_OPEN,w))),T},O.prototype._read_close=function(S,x){var w=null,T=null;return x&&(x.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(w=this._input.next(),S==="/"&&(w+=this._input.next()),T=this._create_token(n.TAG_CLOSE,w)):x.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),T=this._create_token(n.TAG_CLOSE,"}}"))),T},O.prototype._read_attribute=function(S,x,w){var T=null,y="";if(w&&w.text[0]==="<")if(S==="=")T=this._create_token(n.EQUALS,this._input.next());else if(S==='"'||S==="'"){var v=this._input.next();S==='"'?v+=this.__patterns.double_quote.read():v+=this.__patterns.single_quote.read(),T=this._create_token(n.VALUE,v)}else y=this.__patterns.attribute.read(),y&&(x.type===n.EQUALS?T=this._create_token(n.VALUE,y):T=this._create_token(n.ATTRIBUTE,y));return T},O.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},O.prototype._read_raw_content=function(S,x,w){var T="";if(w&&w.text[0]==="{")T=this.__patterns.handlebars_raw_close.read();else if(x.type===n.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var y=x.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var v=this._read_comment_or_cdata(S);if(v)return v.type=n.TEXT,v;T=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(T=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return T?this._create_token(n.TEXT,T):null},O.prototype._read_content_word=function(S){var x="";if(this._options.unformatted_content_delimiter&&(S===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(n.TEXT,x)},g.exports.Tokenizer=O,g.exports.TOKEN=n}],k={};function A(g){var h=k[g];if(h!==void 0)return h.exports;var u=k[g]={exports:{}};return j[g](u,u.exports,A),u.exports}var D=A(18);L=D})();var H=L;if(!0)!(Y=[F,F("6UM0"),F("TXwP")],K=function(j){var k=F("6UM0"),A=F("TXwP");return{html_beautify:function(D,g){return H(D,g,k.js_beautify,A.css_beautify)}}}.apply(ye,Y),K!==void 0&&(Le.exports=K));else var N,R})()},"qJ4+":function(Le,ye,F){},"rAM+":function(Le,ye,F){"use strict";F.d(ye,"a",function(){return K});var Y=F("Qw5x");function K(L,H){var N;if(typeof Symbol=="undefined"||L[Symbol.iterator]==null){if(Array.isArray(L)||(N=Object(Y.a)(L))||H&&L&&typeof L.length=="number"){N&&(L=N);var R=0,j=function(){};return{s:j,n:function(){return R>=L.length?{done:!0}:{done:!1,value:L[R++]}},e:function(h){throw h},f:j}}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 k=!0,A=!1,D;return{s:function(){N=L[Symbol.iterator]()},n:function(){var h=N.next();return k=h.done,h},e:function(h){A=!0,D=h},f:function(){try{!k&&N.return!=null&&N.return()}finally{if(A)throw D}}}}},rUJ1:function(Le,ye){const F=/[&<>"']/,Y=/[&<>"']/g,K=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},N=T=>H[T];function R(T,y){if(y){if(F.test(T))return T.replace(Y,N)}else if(K.test(T))return T.replace(L,N);return T}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function k(T){return T.replace(j,(y,v)=>(v=v.toLowerCase(),v==="colon"?":":v.charAt(0)==="#"?v.charAt(1)==="x"?String.fromCharCode(parseInt(v.substring(2),16)):String.fromCharCode(+v.substring(1)):""))}const A=/(^|[^\[])\^/g;function D(T,y){T=T.source||T,y=y||"";const v={replace:(p,c)=>(c=c.source||c,c=c.replace(A,"$1"),T=T.replace(p,c),v),getRegex:()=>new RegExp(T,y)};return v}const g=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(T,y,v){if(T){let p;try{p=decodeURIComponent(k(v)).replace(g,"").toLowerCase()}catch(c){return null}if(p.indexOf("javascript:")===0||p.indexOf("vbscript:")===0||p.indexOf("data:")===0)return null}y&&!h.test(v)&&(v=o(y,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(p){return null}return v}const d={},s=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(T,y){d[" "+T]||(s.test(T)?d[" "+T]=T+"/":d[" "+T]=S(T,"/",!0)),T=d[" "+T];const v=T.indexOf(":")===-1;return y.substring(0,2)==="//"?v?y:T.replace(l,"$1")+y:y.charAt(0)==="/"?v?y:T.replace(i,"$1")+y:T+y}const n={exec:function(){}};function f(T){let y=1,v,p;for(;y<arguments.length;y++){v=arguments[y];for(p in v)Object.prototype.hasOwnProperty.call(v,p)&&(T[p]=v[p])}return T}function O(T,y){const v=T.replace(/\|/g,(E,_,b)=>{let I=!1,P=_;for(;--P>=0&&b[P]==="\\";)I=!I;return I?"|":" |"}),p=v.split(/ \|/);let c=0;if(p.length>y)p.splice(y);else for(;p.length<y;)p.push("");for(;c<p.length;c++)p[c]=p[c].trim().replace(/\\\|/g,"|");return p}function S(T,y,v){const p=T.length;if(p===0)return"";let c=0;for(;c<p;){const E=T.charAt(p-c-1);if(E===y&&!v)c++;else if(E!==y&&v)c++;else break}return T.substr(0,p-c)}function x(T,y){if(T.indexOf(y[1])===-1)return-1;const v=T.length;let p=0,c=0;for(;c<v;c++)if(T[c]==="\\")c++;else if(T[c]===y[0])p++;else if(T[c]===y[1]&&(p--,p<0))return c;return-1}function w(T){T&&T.sanitize&&!T.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")}Le.exports={escape:R,unescape:k,edit:D,cleanUrl:u,resolveUrl:o,noopTest:n,merge:f,splitCells:O,rtrim:S,findClosingBracket:x,checkSanitizeDeprecation:w}},rdUC:function(Le,ye,F){var Y=F("MFOe"),K=Y.Global;Le.exports={name:"localStorage",read:H,write:N,each:R,remove:j,clearAll:k};function L(){return K.localStorage}function H(A){return L().getItem(A)}function N(A,D){return L().setItem(A,D)}function R(A){for(var D=L().length-1;D>=0;D--){var g=L().key(D);A(H(g),g)}}function j(A){return L().removeItem(A)}function k(){return L().clear()}},sR1s:function(Le,ye,F){"use strict";F.d(ye,"b",function(){return H}),F.d(ye,"a",function(){return N}),F.d(ye,"c",function(){return R}),F.d(ye,"d",function(){return j});var Y=F("U8pU"),K="RC_TABLE_KEY";function L(k){return k==null?[]:Array.isArray(k)?k:[k]}function H(k,A){if(!A&&typeof A!="number")return k;for(var D=L(A),g=k,h=0;h<D.length;h+=1){if(!g)return null;var u=D[h];g=g[u]}return g}function N(k){var A=[],D={};return k.forEach(function(g){for(var h=g||{},u=h.key,d=h.dataIndex,s=u||L(d).join("-")||K;D[s];)s="".concat(s,"_next");D[s]=!0,A.push(s)}),A}function R(){var k={};function A(u,d){d&&Object.keys(d).forEach(function(s){var l=d[s];l&&Object(Y.a)(l)==="object"?(u[s]=u[s]||{},A(u[s],l)):u[s]=l})}for(var D=arguments.length,g=new Array(D),h=0;h<D;h++)g[h]=arguments[h];return g.forEach(function(u){A(k,u)}),k}function j(k){return k!=null}},sboe:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return L});var Y=F("cDcd"),K=F.n(Y),L=Y.createContext(null)},"t/PP":function(Le,ye,F){Le.exports=F.p+"static/title.dd3b799f.svg"},t23M:function(Le,ye,F){"use strict";var Y=F("VTBJ"),K=F("1OyB"),L=F("vuIU"),H=F("Ji7U"),N=F("LK+K"),R=F("cDcd"),j=F.n(R),k=F("m+aA"),A=F("Zm9Q"),D=F("Kwbf"),g=F("c+Xe"),h=F("bdgK"),u="rc-observer-key",d=function(s){Object(H.a)(i,s);var l=Object(N.a)(i);function i(){var o;return Object(K.a)(this,i),o=l.apply(this,arguments),o.resizeObserver=null,o.childNode=null,o.currentElement=null,o.state={width:0,height:0,offsetHeight:0,offsetWidth:0},o.onResize=function(n){var f=o.props.onResize,O=n[0].target,S=O.getBoundingClientRect(),x=S.width,w=S.height,T=O.offsetWidth,y=O.offsetHeight,v=Math.floor(x),p=Math.floor(w);if(o.state.width!==v||o.state.height!==p||o.state.offsetWidth!==T||o.state.offsetHeight!==y){var c={width:v,height:p,offsetWidth:T,offsetHeight:y};o.setState(c),f&&Promise.resolve().then(function(){f(Object(Y.a)(Object(Y.a)({},c),{},{offsetWidth:T,offsetHeight:y}))})}},o.setChildNode=function(n){o.childNode=n},o}return Object(L.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var f=Object(k.a)(this.childNode||this),O=f!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=f),!this.resizeObserver&&f&&(this.resizeObserver=new h.default(this.onResize),this.resizeObserver.observe(f))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,f=Object(A.a)(n);if(f.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(f.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=f[0];if(R.isValidElement(O)&&Object(g.c)(O)){var S=O.ref;f[0]=R.cloneElement(O,{ref:Object(g.a)(S,this.setChildNode)})}return f.length===1?f[0]:f.map(function(x,w){return!R.isValidElement(x)||"key"in x&&x.key!==null?x:R.cloneElement(x,{key:"".concat(u,"-").concat(w)})})}}]),i}(R.Component);d.displayName="ResizeObserver",ye.a=d},uD2n:function(Le,ye,F){Le.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(Le,ye,F){Le.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(Le,ye,F){Le.exports=Y;function Y(){return F("gaXo"),{}}},ulZh:function(Le,ye,F){typeof window!="undefined"&&function(K,L){Le.exports=L()}(this,function(){return function(Y){var K={};function L(H){if(K[H])return K[H].exports;var N=K[H]={i:H,l:!1,exports:{}};return Y[H].call(N.exports,N,N.exports,L),N.l=!0,N.exports}return L.m=Y,L.c=K,L.d=function(H,N,R){L.o(H,N)||Object.defineProperty(H,N,{enumerable:!0,get:R})},L.r=function(H){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(H,"__esModule",{value:!0})},L.t=function(H,N){if(N&1&&(H=L(H)),N&8)return H;if(N&4&&typeof H=="object"&&H&&H.__esModule)return H;var R=Object.create(null);if(L.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:H}),N&2&&typeof H!="string")for(var j in H)L.d(R,j,function(k){return H[k]}.bind(null,j));return R},L.n=function(H){var N=H&&H.__esModule?function(){return H.default}:function(){return H};return L.d(N,"a",N),N},L.o=function(H,N){return Object.prototype.hasOwnProperty.call(H,N)},L.p="/dist/",L(L.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Y,K,L){"use strict";var H=Object.prototype.hasOwnProperty,N="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(N=!1));function j(g,h,u){this.fn=g,this.context=h,this.once=u||!1}function k(g,h,u,d,s){if(typeof u!="function")throw new TypeError("The listener must be a function");var l=new j(u,d||g,s),i=N?N+h:h;return g._events[i]?g._events[i].fn?g._events[i]=[g._events[i],l]:g._events[i].push(l):(g._events[i]=l,g._eventsCount++),g}function A(g,h){--g._eventsCount===0?g._events=new R:delete g._events[h]}function D(){this._events=new R,this._eventsCount=0}D.prototype.eventNames=function(){var h=[],u,d;if(this._eventsCount===0)return h;for(d in u=this._events)H.call(u,d)&&h.push(N?d.slice(1):d);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(u)):h},D.prototype.listeners=function(h){var u=N?N+h:h,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var s=0,l=d.length,i=new Array(l);s<l;s++)i[s]=d[s].fn;return i},D.prototype.listenerCount=function(h){var u=N?N+h:h,d=this._events[u];return d?d.fn?1:d.length:0},D.prototype.emit=function(h,u,d,s,l,i){var o=N?N+h:h;if(!this._events[o])return!1;var n=this._events[o],f=arguments.length,O,S;if(n.fn){n.once&&this.removeListener(h,n.fn,void 0,!0);switch(f){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,u),!0;case 3:return n.fn.call(n.context,u,d),!0;case 4:return n.fn.call(n.context,u,d,s),!0;case 5:return n.fn.call(n.context,u,d,s,l),!0;case 6:return n.fn.call(n.context,u,d,s,l,i),!0}for(S=1,O=new Array(f-1);S<f;S++)O[S-1]=arguments[S];n.fn.apply(n.context,O)}else{var x=n.length,w;for(S=0;S<x;S++){n[S].once&&this.removeListener(h,n[S].fn,void 0,!0);switch(f){case 1:n[S].fn.call(n[S].context);break;case 2:n[S].fn.call(n[S].context,u);break;case 3:n[S].fn.call(n[S].context,u,d);break;case 4:n[S].fn.call(n[S].context,u,d,s);break;default:if(!O)for(w=1,O=new Array(f-1);w<f;w++)O[w-1]=arguments[w];n[S].fn.apply(n[S].context,O)}}}return!0},D.prototype.on=function(h,u,d){return k(this,h,u,d,!1)},D.prototype.once=function(h,u,d){return k(this,h,u,d,!0)},D.prototype.removeListener=function(h,u,d,s){var l=N?N+h:h;if(!this._events[l])return this;if(!u)return A(this,l),this;var i=this._events[l];if(i.fn)i.fn===u&&(!s||i.once)&&(!d||i.context===d)&&A(this,l);else{for(var o=0,n=[],f=i.length;o<f;o++)(i[o].fn!==u||s&&!i[o].once||d&&i[o].context!==d)&&n.push(i[o]);n.length?this._events[l]=n.length===1?n[0]:n:A(this,l)}return this},D.prototype.removeAllListeners=function(h){var u;return h?(u=N?N+h:h,this._events[u]&&A(this,u)):(this._events=new R,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=N,D.EventEmitter=D,Y.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(Y,K,L){(function(H){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,k=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,A={buildAbsoluteURL:function(D,g,h){if(h=h||{},D=D.trim(),g=g.trim(),!g){if(!h.alwaysNormalize)return D;var u=A.parseURL(D);if(!u)throw new Error("Error trying to parse base URL.");return u.path=A.normalizePath(u.path),A.buildURLFromParts(u)}var d=A.parseURL(g);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return h.alwaysNormalize?(d.path=A.normalizePath(d.path),A.buildURLFromParts(d)):g;var s=A.parseURL(D);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var l=R.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var i={scheme:s.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(i.netLoc=s.netLoc,d.path[0]!=="/"))if(!d.path)i.path=s.path,d.params||(i.params=s.params,d.query||(i.query=s.query));else{var o=s.path,n=o.substring(0,o.lastIndexOf("/")+1)+d.path;i.path=A.normalizePath(n)}return i.path===null&&(i.path=h.alwaysNormalize?A.normalizePath(d.path):d.path),A.buildURLFromParts(i)},parseURL:function(D){var g=N.exec(D);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(j,"");D.length!==(D=D.replace(k,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};Y.exports=A})(this)},"./node_modules/webworkify-webpack/index.js":function(Y,K,L){function H(h){var u={};function d(l){if(u[l])return u[l].exports;var i=u[l]={i:l,l:!1,exports:{}};return h[l].call(i.exports,i,i.exports,d),i.l=!0,i.exports}d.m=h,d.c=u,d.i=function(l){return l},d.d=function(l,i,o){d.o(l,i)||Object.defineProperty(l,i,{configurable:!1,enumerable:!0,get:o})},d.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},d.n=function(l){var i=l&&l.__esModule?function(){return l.default}:function(){return l};return d.d(i,"a",i),i},d.o=function(l,i){return Object.prototype.hasOwnProperty.call(l,i)},d.p="/",d.oe=function(l){throw console.error(l),l};var s=d(d.s=ENTRY_MODULE);return s.default||s}var N="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function j(h){return(h+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function k(h){return!isNaN(1*h)}function A(h,u,d){var s={};s[d]=[];var l=u.toString(),i=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return s;for(var o=i[1],n=new RegExp("(\\\\n|\\W)"+j(o)+R,"g"),f;f=n.exec(l);){if(f[3]==="dll-reference")continue;s[d].push(f[3])}for(n=new RegExp("\\("+j(o)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+R,"g");f=n.exec(l);)h[f[2]]||(s[d].push(f[1]),h[f[2]]=L(f[1]).m),s[f[2]]=s[f[2]]||[],s[f[2]].push(f[4]);for(var O=Object.keys(s),S=0;S<O.length;S++)for(var x=0;x<s[O[S]].length;x++)k(s[O[S]][x])&&(s[O[S]][x]=1*s[O[S]][x]);return s}function D(h){var u=Object.keys(h);return u.reduce(function(d,s){return d||h[s].length>0},!1)}function g(h,u){for(var d={main:[u]},s={main:[]},l={main:{}};D(d);)for(var i=Object.keys(d),o=0;o<i.length;o++){var n=i[o],f=d[n],O=f.pop();if(l[n]=l[n]||{},l[n][O]||!h[n][O])continue;l[n][O]=!0,s[n]=s[n]||[],s[n].push(O);for(var S=A(h,h[n][O],n),x=Object.keys(S),w=0;w<x.length;w++)d[x[w]]=d[x[w]]||[],d[x[w]]=d[x[w]].concat(S[x[w]])}return s}Y.exports=function(h,u){u=u||{};var d={main:L.m},s=u.all?{main:Object.keys(d.main)}:g(d,h),l="";Object.keys(s).filter(function(O){return O!=="main"}).forEach(function(O){for(var S=0;s[O][S];)S++;s[O].push(S),d[O][S]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+O+" = ("+H.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+s[O].map(function(x){return""+JSON.stringify(x)+": "+d[O][x].toString()}).join(",")+`});
`}),l=l+"new (("+H.toString().replace("ENTRY_MODULE",JSON.stringify(h))+")({"+s.main.map(function(O){return""+JSON.stringify(O)+": "+d.main[O].toString()}).join(",")+"}))(self);";var i=new window.Blob([l],{type:"text/javascript"});if(u.bare)return i;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,n=o.createObjectURL(i),f=new window.Worker(n);return f.objectURL=n,f}},"./src/config.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"hlsDefaultConfig",function(){return w}),L.d(K,"mergeConfig",function(){return y}),L.d(K,"enableStreamingMode",function(){return v});var H=L("./src/controller/abr-controller.ts"),N=L("./src/controller/audio-stream-controller.ts"),R=L("./src/controller/audio-track-controller.ts"),j=L("./src/controller/subtitle-stream-controller.ts"),k=L("./src/controller/subtitle-track-controller.ts"),A=L("./src/controller/buffer-controller.ts"),D=L("./src/controller/timeline-controller.ts"),g=L("./src/controller/cap-level-controller.ts"),h=L("./src/controller/fps-controller.ts"),u=L("./src/controller/eme-controller.ts"),d=L("./src/controller/cmcd-controller.ts"),s=L("./src/utils/xhr-loader.ts"),l=L("./src/utils/fetch-loader.ts"),i=L("./src/utils/cues.ts"),o=L("./src/utils/mediakeys-helper.ts"),n=L("./src/utils/logger.ts");function f(){return f=Object.assign||function(p){for(var c=1;c<arguments.length;c++){var E=arguments[c];for(var _ in E)Object.prototype.hasOwnProperty.call(E,_)&&(p[_]=E[_])}return p},f.apply(this,arguments)}function O(p,c){var E=Object.keys(p);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(p);c&&(_=_.filter(function(b){return Object.getOwnPropertyDescriptor(p,b).enumerable})),E.push.apply(E,_)}return E}function S(p){for(var c=1;c<arguments.length;c++){var E=arguments[c]!=null?arguments[c]:{};c%2?O(Object(E),!0).forEach(function(_){x(p,_,E[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(E)):O(Object(E)).forEach(function(_){Object.defineProperty(p,_,Object.getOwnPropertyDescriptor(E,_))})}return p}function x(p,c,E){return c in p?Object.defineProperty(p,c,{value:E,enumerable:!0,configurable:!0,writable:!0}):p[c]=E,p}var w=S(S({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:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:H.default,bufferController:A.default,capLevelController:g.default,fpsController:h.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:o.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},T()),{},{subtitleStreamController:j.SubtitleStreamController,subtitleTrackController:k.default,timelineController:D.TimelineController,audioStreamController:N.default,audioTrackController:R.default,emeController:u.default,cmcdController:d.default});function T(){return{cueHandler:i.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 y(p,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return f({},p,c)}function v(p){var c=p.loader;if(c!==l.default&&c!==s.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),p.progressive=!1;else{var E=Object(l.fetchSupported)();E&&(p.loader=l.default,p.progressive=!0,p.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/polyfills/number.ts"),N=L("./src/utils/ewma-bandwidth-estimator.ts"),R=L("./src/events.ts"),j=L("./src/utils/buffer-helper.ts"),k=L("./src/errors.ts"),A=L("./src/types/loader.ts"),D=L("./src/utils/logger.ts");function g(d,s){for(var l=0;l<s.length;l++){var i=s[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}function h(d,s,l){return s&&g(d.prototype,s),l&&g(d,l),d}var u=function(){function d(l){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=l;var i=l.config;this.bwEstimator=new N.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var s=d.prototype;return s.registerListeners=function(){var i=this.hls;i.on(R.Events.FRAG_LOADING,this.onFragLoading,this),i.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(R.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(R.Events.FRAG_LOADING,this.onFragLoading,this),i.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(R.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(i,o){var n=o.frag;if(n.type===A.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=n,this.partCurrent=(f=o.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(i,o){var n=this.hls.config;o.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var i=this.fragCurrent,o=this.partCurrent,n=this.hls,f=n.autoLevelEnabled,O=n.config,S=n.media;if(!i||!S)return;var x=o?o.stats:i.stats,w=o?o.duration:i.duration;if(x.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||S.paused||!S.playbackRate||!S.readyState)return;var T=performance.now()-x.loading.start,y=Math.abs(S.playbackRate);if(T<=500*w/y)return;var v=n.levels,p=n.minAutoLevel,c=v[i.level],E=x.total||Math.max(x.loaded,Math.round(w*c.maxBitrate/8)),_=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/T),b=(E-x.loaded)/_,I=S.currentTime,P=(j.BufferHelper.bufferInfo(S,I,O.maxBufferHole).end-I)/y;if(P>=2*w/y||b<=P)return;var B=Number.POSITIVE_INFINITY,z;for(z=i.level-1;z>p;z--){var U=v[z].maxBitrate;if(B=w*U/(8*.8*_),B<P)break}if(B>=b)return;var C=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+i.sn+(o?" part "+o.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+z+`
Current BW estimate: `+(Object(H.isFiniteNumber)(C)?(C/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+B.toFixed(3)+` s
Time to underbuffer: `+P.toFixed(3)+" s"),n.nextLoadLevel=z,this.bwEstimator.sample(T,x.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),n.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:o,stats:x})},s.onFragLoaded=function(i,o){var n=o.frag,f=o.part;if(n.type===A.PlaylistLevelType.MAIN&&Object(H.isFiniteNumber)(n.sn)){var O=f?f.stats:n.stats,S=f?f.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[n.level],w=(x.loaded?x.loaded.bytes:0)+O.loaded,T=(x.loaded?x.loaded.duration:0)+S;x.loaded={bytes:w,duration:T},x.realBitrate=Math.round(8*w/T)}if(n.bitrateTest){var y={stats:O,frag:n,part:f,id:n.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,y),n.bitrateTest=!1}}},s.onFragBuffered=function(i,o){var n=o.frag,f=o.part,O=f?f.stats:n.stats;if(O.aborted)return;if(n.type!==A.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var S=O.parsing.end-O.loading.start;this.bwEstimator.sample(S,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},s.onError=function(i,o){switch(o.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,o=this.partCurrent,n=this.hls,f=n.maxAutoLevel,O=n.config,S=n.minAutoLevel,x=n.media,w=o?o.duration:i?i.duration:0,T=x?x.currentTime:0,y=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,p=(j.BufferHelper.bufferInfo(x,T,O.maxBufferHole).end-T)/y,c=this.findBestLevel(v,S,f,p,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(c>=0)return c;D.logger.trace((p?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=w?Math.min(w,O.maxStarvationDelay):O.maxStarvationDelay,_=O.abrBandWidthFactor,b=O.abrBandWidthUpFactor;if(!p){var I=this.bitrateTestDelay;if(I){var P=w?Math.min(w,O.maxLoadingDelay):O.maxLoadingDelay;E=P-I,D.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),_=b=1}}return c=this.findBestLevel(v,S,f,p+E,_,b),Math.max(c,0)},s.findBestLevel=function(i,o,n,f,O,S){for(var x,w=this.fragCurrent,T=this.partCurrent,y=this.lastLoadedFragLevel,v=this.hls.levels,p=v[y],c=!!(p!=null&&(x=p.details)!==null&&x!==void 0&&x.live),E=p==null?void 0:p.codecSet,_=T?T.duration:w?w.duration:0,b=n;b>=o;b--){var I=v[b];if(!I||E&&I.codecSet!==E)continue;var P=I.details,B=(T?P==null?void 0:P.partTarget:P==null?void 0:P.averagetargetduration)||_,z=void 0;b<=y?z=O*i:z=S*i;var U=v[b].maxBitrate,C=U*B/z;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(z)+"/"+U+"/"+B+"/"+f+"/"+C),z>U&&(!C||c&&!this.bitrateTestDelay||C<f))return b}return-1},h(d,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,o=this.bwEstimator;if(i!==-1&&(!o||!o.canEstimate()))return i;var n=this.getNextABRAutoLevel();return i!==-1&&(n=Math.min(i,n)),n},set:function(i){this._nextAutoLevel=i}}]),d}();K.default=u},"./src/controller/audio-stream-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/polyfills/number.ts"),N=L("./src/controller/base-stream-controller.ts"),R=L("./src/events.ts"),j=L("./src/utils/buffer-helper.ts"),k=L("./src/controller/fragment-tracker.ts"),A=L("./src/types/level.ts"),D=L("./src/types/loader.ts"),g=L("./src/loader/fragment.ts"),h=L("./src/demux/chunk-cache.ts"),u=L("./src/demux/transmuxer-interface.ts"),d=L("./src/types/transmuxer.ts"),s=L("./src/controller/fragment-finders.ts"),l=L("./src/utils/discontinuities.ts"),i=L("./src/errors.ts"),o=L("./src/utils/logger.ts");function n(){return n=Object.assign||function(w){for(var T=1;T<arguments.length;T++){var y=arguments[T];for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(w[v]=y[v])}return w},n.apply(this,arguments)}function f(w,T){w.prototype=Object.create(T.prototype),w.prototype.constructor=w,O(w,T)}function O(w,T){return O=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},O(w,T)}var S=100,x=function(w){f(T,w);function T(v,p){var c;return c=w.call(this,v,p,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var y=T.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var p=this.hls;p.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),p.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),p.on(R.Events.ERROR,this.onError,this),p.on(R.Events.BUFFER_RESET,this.onBufferReset,this),p.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),p.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var p=this.hls;p.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),p.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),p.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),p.off(R.Events.ERROR,this.onError,this),p.off(R.Events.BUFFER_RESET,this.onBufferReset,this),p.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),p.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),p.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),p.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(p,c){var E=c.frag,_=c.id,b=c.initPTS;if(_==="main"){var I=E.cc;this.initPTS[E.cc]=b,this.log("InitPTS for cc: "+I+" found from main: "+b),this.videoTrackCC=I,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(p){if(!this.levels){this.startPosition=p,this.state=N.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),this.fragLoadError=0,c>0&&p===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=p,this.tick()},y.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var p,c=this.levels,E=this.trackId,_=c==null||((p=c[E])===null||p===void 0)?void 0:p.details;if(_){if(this.waitForCdnTuneIn(_))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var b,I=performance.now(),P=this.retryDate;(!P||I>=P||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var B=this.waitingData;if(B){var z=B.frag,U=B.part,C=B.cache,W=B.complete;if(this.initPTS[z.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var V=C.flush(),J={frag:z,part:U,payload:V,networkDetails:null};this._handleFragmentLoadProgress(J),W&&w.prototype._handleFragmentLoadComplete.call(this,J)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+z.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ne=this.getLoadPosition(),fe=j.BufferHelper.bufferInfo(this.mediaBuffer,ne,this.config.maxBufferHole),ue=Object(s.fragmentWithinToleranceTest)(fe.end,this.config.maxFragLookUpTolerance,z);ue<0&&(o.logger.log("Waiting fragment cc ("+z.cc+") @ "+z.start+" cancelled because another fragment at "+fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var p=this.waitingData;p&&(this.fragmentTracker.removeFragment(p.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},y.onTickEnd=function(){var p=this.media;if(!p||!p.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:p,E=c.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=p.currentTime},y.doTickIdle=function(){var p,c,E=this.hls,_=this.levels,b=this.media,I=this.trackId,P=E.config;if(!_||!_[I])return;if(!b&&(this.startFragRequested||!P.startFragPrefetch))return;var B=_[I],z=B.details;if(!z||z.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(z)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(U===null)return;var C=U.len,W=this.getMaxBufferLength(),V=this.audioSwitch;if(C>=W&&!V)return;if(!V&&this._streamEnded(U,z)){E.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var J=z.fragments,ne=J[0].start,fe=U.end;if(V){var ue=this.getLoadPosition();fe=ue,z.PTSKnown&&ue<ne&&((U.end>ne||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=ne+.05))}var le=this.getNextFragment(fe,z);if(!le){this.bufferFlushed=!0;return}((p=le.decryptdata)===null||p===void 0?void 0:p.keyFormat)==="identity"&&!((c=le.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(le,z):this.loadFragment(le,z,fe)},y.getMaxBufferLength=function(){var p=w.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return c===null?p:Math.max(p,c.len)},y.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(p,c){var E=c.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(_){return new A.Level(_)})},y.onAudioTrackSwitching=function(p,c){var E=!!c.url;this.trackId=c.id;var _=this.fragCurrent;_!=null&&_.loader&&_.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(S):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(p,c){this.mainDetails=c.details},y.onAudioTrackLoaded=function(p,c){var E,_=this.levels,b=c.details,I=c.id;if(!_){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var P=_[I],B=0;if(b.live||(E=P.details)!==null&&E!==void 0&&E.live){var z=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!z)return;!P.details&&b.hasProgramDateTime&&z.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(b,z),B=b.fragments[0].start):B=this.alignPlaylists(b,P.details)}P.details=b,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(P.details,B),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=N.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(p){var c,E=p.frag,_=p.part,b=p.payload,I=this.config,P=this.trackId,B=this.levels;if(!B){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var z=B[P];console.assert(z,"Audio track is defined on fragment load progress");var U=z.details;console.assert(U,"Audio track details are defined on fragment load progress");var C=I.defaultAudioCodec||z.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new u.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var V=this.initPTS[E.cc],J=(c=E.initSegment)===null||c===void 0?void 0:c.data;if(V!==void 0){var ne=!1,fe=_?_.index:-1,ue=fe!==-1,le=new d.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,b.byteLength,fe,ue);W.push(b,J,C,"",E,_,U.totalduration,ne,le,V)}else{o.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+P);var me=this.waitingData=this.waitingData||{frag:E,part:_,cache:new h.default,complete:!1},ge=me.cache;ge.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(p){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,p)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(p,c){var E=c.tracks.audio;E&&(this.mediaBuffer=E.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},y.onFragBuffered=function(p,c){var E=c.frag,_=c.part;if(E.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(_?" p: "+_.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,_)},y.onError=function(p,c){switch(c.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,c);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=c.fatal?N.State.ERROR:N.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var E=!0,_=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);_&&_.len>.5&&(E=!this.reduceMaxBufferLength(_.len)),E&&(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}},y.onBufferFlushed=function(p,c){var E=c.type;E===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(p){var c,E="audio",_=this.hls,b=p.remuxResult,I=p.chunkMeta,P=this.getCurrentContext(I);if(!P){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var B=P.frag,z=P.part,U=b.audio,C=b.text,W=b.id3,V=b.initSegment;if(this.fragContextChanged(B))return;if(this.state=N.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),V!=null&&V.tracks&&(this._bufferInitSegment(V.tracks,B,I),_.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:E,tracks:V.tracks})),U){var J=U.startPTS,ne=U.endPTS,fe=U.startDTS,ue=U.endDTS;z&&(z.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:J,endPTS:ne,startDTS:fe,endDTS:ue}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,J,ne,fe,ue),this.bufferFragmentData(U,B,z,I)}if(W!=null&&(c=W.samples)!==null&&c!==void 0&&c.length){var le=n({frag:B,id:E},W);_.trigger(R.Events.FRAG_PARSING_METADATA,le)}if(C){var me=n({frag:B,id:E},C);_.trigger(R.Events.FRAG_PARSING_USERDATA,me)}},y._bufferInitSegment=function(p,c,E){if(this.state!==N.State.PARSING)return;p.video&&delete p.video;var _=p.audio;if(!_)return;_.levelCodec=_.codec,_.id="audio",this.log("Init audio buffer, container:"+_.container+", codecs[parsed]=["+_.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,p);var b=_.initSegment;if(b!=null&&b.byteLength){var I={type:"audio",frag:c,part:null,chunkMeta:E,parent:c.type,data:b};this.hls.trigger(R.Events.BUFFER_APPENDING,I)}this.tick()},y.loadFragment=function(p,c,E){var _=this.fragmentTracker.getState(p);this.fragCurrent=p,(this.audioSwitch||_===k.FragmentState.NOT_LOADED||_===k.FragmentState.PARTIAL)&&(p.sn==="initSegment"?this._loadInitSegment(p):c.live&&!Object(H.isFiniteNumber)(this.initPTS[p.cc])?(this.log("Waiting for video PTS in continuity counter "+p.cc+" of live stream before loading audio fragment "+p.sn+" of level "+this.trackId),this.state=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,p,c,E)))},y.completeAudioSwitch=function(){var p=this.hls,c=this.media,E=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,p.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:E})},T}(N.default);K.default=x},"./src/controller/audio-track-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/events.ts"),N=L("./src/errors.ts"),R=L("./src/controller/base-playlist-controller.ts"),j=L("./src/types/loader.ts");function k(u,d){for(var s=0;s<d.length;s++){var l=d[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function A(u,d,s){return d&&k(u.prototype,d),s&&k(u,s),u}function D(u,d){u.prototype=Object.create(d.prototype),u.prototype.constructor=u,g(u,d)}function g(u,d){return g=Object.setPrototypeOf||function(l,i){return l.__proto__=i,l},g(u,d)}var h=function(u){D(d,u);function d(l){var i;return i=u.call(this,l,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var s=d.prototype;return s.registerListeners=function(){var i=this.hls;i.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(H.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(H.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(H.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(H.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,u.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(i,o){this.tracks=o.audioTracks||[]},s.onAudioTrackLoaded=function(i,o){var n=o.id,f=o.details,O=this.tracksInGroup[n];if(!O){this.warn("Invalid audio track id "+n);return}var S=O.details;O.details=o.details,this.log("audioTrack "+n+" loaded ["+f.startSN+"-"+f.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,o,S))},s.onLevelLoading=function(i,o){this.switchLevel(o.level)},s.onLevelSwitching=function(i,o){this.switchLevel(o.level)},s.switchLevel=function(i){var o=this.hls.levels[i];if(!(o!=null&&o.audioGroupIds))return;var n=o.audioGroupIds[o.urlId];if(this.groupId!==n){this.groupId=n;var f=this.tracks.filter(function(S){return!n||S.groupId===n});this.selectDefaultTrack&&!f.some(function(S){return S.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var O={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(H.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},s.onError=function(i,o){if(u.prototype.onError.call(this,i,o),o.fatal||!o.context)return;o.context.type===j.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},s.setAudioTrack=function(i){var o=this.tracksInGroup;if(i<0||i>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=o[this.trackId];this.log("Now switching to audio-track index "+i);var f=o[i],O=f.id,S=f.groupId,x=S===void 0?"":S,w=f.name,T=f.type,y=f.url;if(this.trackId=i,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(H.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:x,name:w,type:T,url:y}),f.details&&!f.details.live)return;var v=this.switchParams(f.url,n==null?void 0:n.details);this.loadPlaylist(v)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,n=this.findTrackId(o)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var o=this.tracksInGroup,n=0;n<o.length;n++){var f=o[n];if((!this.selectDefaultTrack||f.default)&&(!i||i===f.name))return f.id}return-1},s.loadPlaylist=function(i){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var n=o.id,f=o.groupId,O=o.url;if(i)try{O=i.addDirectives(O)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(H.Events.AUDIO_TRACK_LOADING,{url:O,id:n,groupId:f,deliveryDirectives:i||null})}},A(d,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),d}(R.default);K.default=h},"./src/controller/base-playlist-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return A});var H=L("./src/polyfills/number.ts"),N=L("./src/types/level.ts"),R=L("./src/controller/level-helper.ts"),j=L("./src/utils/logger.ts"),k=L("./src/errors.ts"),A=function(){function D(h,u){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,u+":"),this.warn=j.logger.warn.bind(j.logger,u+":"),this.hls=h}var g=D.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(u,d){d.fatal&&d.type===k.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(u,d){var s=d==null?void 0:d.renditionReports;if(s)for(var l=0;l<s.length;l++){var i=s[l],o=""+i.URI;if(o===u.substr(-o.length)){var n=parseInt(i["LAST-MSN"]),f=parseInt(i["LAST-PART"]);if(d&&this.hls.config.lowLatencyMode){var O=Math.min(d.age-d.partTarget,d.targetduration);f!==void 0&&O>d.partTarget&&(f+=1)}if(Object(H.isFiniteNumber)(n))return new N.HlsUrlParameters(n,Object(H.isFiniteNumber)(f)?f:void 0,N.HlsSkip.No)}}},g.loadPlaylist=function(u){},g.shouldLoadTrack=function(u){return this.canLoad&&u&&!!u.url&&(!u.details||u.details.live)},g.playlistLoaded=function(u,d,s){var l=this,i=d.details,o=d.stats,n=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(i.advancedDateTime=Date.now()-n,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+u+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(R.mergeDetails)(s,i),!this.canLoad||!i.live)return;var f,O=void 0,S=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var x=this.hls.config.lowLatencyMode,w=i.lastPartSn,T=i.endSN,y=i.lastPartIndex,v=y!==-1,p=w===T,c=x?0:y;v?(O=p?T+1:w,S=p?c:y+1):O=T+1;var E=i.age,_=E+i.ageHeader,b=Math.min(_-i.partTarget,i.targetduration*1.5);if(b>0){if(s&&b>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+b+" with playlist age: "+i.age),b=0;else{var I=Math.floor(b/i.targetduration);if(O+=I,S!==void 0){var P=Math.round(b%i.targetduration/i.partTarget);S+=P}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+b+" skip sn "+I+" to part "+S)}i.tuneInGoal=b}if(f=this.getDeliveryDirectives(i,d.deliveryDirectives,O,S),x||!p){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(i,d.deliveryDirectives,O,S);var B=Object(R.computeReloadInterval)(i,o);O!==void 0&&i.canBlockReload&&(B-=i.partTarget||1),this.log("reload live playlist "+u+" in "+Math.round(B)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(f)},B)}else this.clearTimer()},g.getDeliveryDirectives=function(u,d,s,l){var i=Object(N.getSkipValue)(u,s);return d!=null&&d.skip&&u.deltaUpdateFailed&&(s=d.msn,l=d.part,i=N.HlsSkip.No),new N.HlsUrlParameters(s,l,i)},g.retryLoadingOrFail=function(u){var d=this,s=this.hls.config,l=this.retryCount<s.levelLoadingMaxRetry;if(l){var i;if(this.retryCount++,u.details.indexOf("LoadTimeOut")>-1&&(i=u.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+u.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+u.details+'"')}}else this.warn('cannot recover from error "'+u.details+'"'),this.clearTimer(),u.fatal=!0;return l},D}()},"./src/controller/base-stream-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"State",function(){return T}),L.d(K,"default",function(){return y});var H=L("./src/polyfills/number.ts"),N=L("./src/task-loop.ts"),R=L("./src/controller/fragment-tracker.ts"),j=L("./src/utils/buffer-helper.ts"),k=L("./src/utils/logger.ts"),A=L("./src/events.ts"),D=L("./src/errors.ts"),g=L("./src/types/transmuxer.ts"),h=L("./src/utils/mp4-tools.ts"),u=L("./src/utils/discontinuities.ts"),d=L("./src/controller/fragment-finders.ts"),s=L("./src/controller/level-helper.ts"),l=L("./src/loader/fragment-loader.ts"),i=L("./src/crypt/decrypter.ts"),o=L("./src/utils/time-ranges.ts"),n=L("./src/types/loader.ts");function f(v,p){for(var c=0;c<p.length;c++){var E=p[c];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(v,E.key,E)}}function O(v,p,c){return p&&f(v.prototype,p),c&&f(v,c),v}function S(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function x(v,p){v.prototype=Object.create(p.prototype),v.prototype.constructor=v,w(v,p)}function w(v,p){return w=Object.setPrototypeOf||function(E,_){return E.__proto__=_,E},w(v,p)}var T={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"},y=function(v){x(p,v);function p(E,_,b){var I;return I=v.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=T.STOPPED,I.media=void 0,I.mediaBuffer=void 0,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=b,I.log=k.logger.log.bind(k.logger,b+":"),I.warn=k.logger.warn.bind(k.logger,b+":"),I.hls=E,I.fragmentLoader=new l.default(E.config),I.fragmentTracker=_,I.config=E.config,I.decrypter=new i.default(E,E.config),E.on(A.Events.KEY_LOADED,I.onKeyLoaded,S(I)),I}var c=p.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(_){},c.stopLoad=function(){this.fragmentLoader.abort();var _=this.fragCurrent;_&&this.fragmentTracker.removeFragment(_),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=T.STOPPED},c._streamEnded=function(_,b){var I=this.fragCurrent,P=this.fragmentTracker;if(!b.live&&I&&I.sn===b.endSN&&!_.nextStart){var B=P.getState(I);return B===R.FragmentState.PARTIAL||B===R.FragmentState.OK}return!1},c.onMediaAttached=function(_,b){var I=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),I.addEventListener("seeking",this.onvseeking),I.addEventListener("ended",this.onvended);var P=this.config;this.levels&&P.autoStartLoad&&this.state===T.STOPPED&&this.startLoad(P.startPosition)},c.onMediaDetaching=function(){var _=this.media;_!=null&&_.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),_&&(_.removeEventListener("seeking",this.onvseeking),_.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var _=this.config,b=this.fragCurrent,I=this.media,P=this.mediaBuffer,B=this.state,z=I?I.currentTime:0,U=j.BufferHelper.bufferInfo(P||I,z,_.maxBufferHole);if(this.log("media seeking to "+(Object(H.isFiniteNumber)(z)?z.toFixed(3):z)+", state: "+B),B===T.ENDED)this.resetLoadingState();else if(b&&!U.len){var C=_.maxFragLookUpTolerance,W=b.start-C,V=b.start+b.duration+C,J=z>V;(z<W||J)&&(J&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}I&&(this.lastCurrentTime=z),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=z),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(_,b){if(this.state!==T.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=T.IDLE;var I=this.levels[b.frag.level].details;I&&this.loadFragment(b.frag,I,b.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),v.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=T.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,v.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(_,b){this.log("Loading key for "+_.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+_.level),this.state=T.KEY_LOADING,this.fragCurrent=_,this.hls.trigger(A.Events.KEY_LOADING,{frag:_})},c.loadFragment=function(_,b,I){this._loadFragForPlayback(_,b,I)},c._loadFragForPlayback=function(_,b,I){var P=this,B=function(U){if(P.fragContextChanged(_)){P.warn("Fragment "+_.sn+(U.part?" p: "+U.part.index:"")+" of level "+_.level+" was dropped during download."),P.fragmentTracker.removeFragment(_);return}_.stats.chunkCount++,P._handleFragmentLoadProgress(U)};this._doFragLoad(_,b,I,B).then(function(z){if(!z)return;P.fragLoadError=0;var U=P.state;if(P.fragContextChanged(_)){(U===T.FRAG_LOADING||U===T.BACKTRACKING||!P.fragCurrent&&U===T.PARSING)&&(P.fragmentTracker.removeFragment(_),P.state=T.IDLE);return}if("payload"in z&&(P.log("Loaded fragment "+_.sn+" of level "+_.level),P.hls.trigger(A.Events.FRAG_LOADED,z),P.state===T.BACKTRACKING)){P.fragmentTracker.backtrack(_,z),P.resetFragmentLoading(_);return}P._handleFragmentLoadComplete(z)}).catch(function(z){P.warn(z),P.resetFragmentLoading(_)})},c.flushMainBuffer=function(_,b,I){if(I===void 0&&(I=null),!(_-b))return;var P={startOffset:_,endOffset:b,type:I};this.fragLoadError=0,this.hls.trigger(A.Events.BUFFER_FLUSHING,P)},c._loadInitSegment=function(_){var b=this;this._doFragLoad(_).then(function(I){if(!I||b.fragContextChanged(_)||!b.levels)throw new Error("init load aborted");return I}).then(function(I){var P=b.hls,B=I.payload,z=_.decryptdata;if(B&&B.byteLength>0&&z&&z.key&&z.iv&&z.method==="AES-128"){var U=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(B),z.key.buffer,z.iv.buffer).then(function(C){var W=self.performance.now();return P.trigger(A.Events.FRAG_DECRYPTED,{frag:_,payload:C,stats:{tstart:U,tdecrypt:W}}),I.payload=C,I})}return I}).then(function(I){var P=b.fragCurrent,B=b.hls,z=b.levels;if(!z)throw new Error("init load aborted, missing levels");var U=z[_.level].details;console.assert(U,"Level details are defined when init segment is loaded");var C=_.stats;b.state=T.IDLE,b.fragLoadError=0,_.data=new Uint8Array(I.payload),C.parsing.start=C.buffering.start=self.performance.now(),C.parsing.end=C.buffering.end=self.performance.now(),I.frag===P&&B.trigger(A.Events.FRAG_BUFFERED,{stats:C,frag:P,part:null,id:_.type}),b.tick()}).catch(function(I){b.warn(I),b.resetFragmentLoading(_)})},c.fragContextChanged=function(_){var b=this.fragCurrent;return!_||!b||_.level!==b.level||_.sn!==b.sn||_.urlId!==b.urlId},c.fragBufferedComplete=function(_,b){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+_.type+" sn: "+_.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+_.level+" "+o.default.toString(j.BufferHelper.getBuffered(I))),this.state=T.IDLE,this.tick()},c._handleFragmentLoadComplete=function(_){var b=this.transmuxer;if(!b)return;var I=_.frag,P=_.part,B=_.partsLoaded,z=!B||B.length===0||B.some(function(C){return!C}),U=new g.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,P?P.index:-1,!z);b.flush(U)},c._handleFragmentLoadProgress=function(_){},c._doFragLoad=function(_,b,I,P){var B=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(_.start,I||0),this.config.lowLatencyMode&&b){var z=b.partList;if(z&&P){I>_.end&&b.fragmentHint&&(_=b.fragmentHint);var U=this.getNextPart(z,_,I);if(U>-1){var C=z[U];return this.log("Loading part sn: "+_.sn+" p: "+C.index+" cc: "+_.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+U+"-"+(z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+_.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=C.start+C.duration,this.state=T.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:_,part:z[U],targetBufferTime:I}),this.doFragPartsLoad(_,z,U,P).catch(function(W){return B.handleFragLoadError(W)})}else if(!_.url||this.loadedEndOfParts(z,I))return Promise.resolve(null)}}return this.log("Loading fragment "+_.sn+" cc: "+_.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+_.level+", target: "+parseFloat(I.toFixed(3))),Object(H.isFiniteNumber)(_.sn)&&!this.bitrateTest&&(this.nextLoadPosition=_.start+_.duration),this.state=T.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:_,targetBufferTime:I}),this.fragmentLoader.load(_,P).catch(function(W){return B.handleFragLoadError(W)})},c.doFragPartsLoad=function(_,b,I,P){var B=this;return new Promise(function(z,U){var C=[],W=function V(J){var ne=b[J];B.fragmentLoader.loadPart(_,ne,P).then(function(fe){C[ne.index]=fe;var ue=fe.part;B.hls.trigger(A.Events.FRAG_LOADED,fe);var le=b[J+1];if(le&&le.fragment===_)V(J+1);else return z({frag:_,part:ue,partsLoaded:C})}).catch(U)};W(I)})},c.handleFragLoadError=function(_){var b=_.data;return b&&b.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(A.Events.ERROR,b),null},c._handleTransmuxerFlush=function(_){var b=this.getCurrentContext(_);if(!b||this.state!==T.PARSING){this.fragCurrent||(this.state=T.IDLE);return}var I=b.frag,P=b.part,B=b.level,z=self.performance.now();I.stats.parsing.end=z,P&&(P.stats.parsing.end=z),this.updateLevelTiming(I,P,B,_.partial)},c.getCurrentContext=function(_){var b=this.levels,I=_.level,P=_.sn,B=_.part;if(!b||!b[I])return this.warn("Levels object was unset while buffering fragment "+P+" of level "+I+". The current chunk will not be buffered."),null;var z=b[I],U=B>-1?Object(s.getPartWith)(z,P,B):null,C=U?U.fragment:Object(s.getFragmentWithSN)(z,P,this.fragCurrent);return C?{frag:C,part:U,level:z}:null},c.bufferFragmentData=function(_,b,I,P){if(!_||this.state!==T.PARSING)return;var B=_.data1,z=_.data2,U=B;if(B&&z&&(U=Object(h.appendUint8Array)(B,z)),!U||!U.length)return;var C={type:_.type,frag:b,part:I,chunkMeta:P,parent:b.type,data:U};this.hls.trigger(A.Events.BUFFER_APPENDING,C),_.dropped&&_.independent&&!I&&this.flushBufferGap(b)},c.flushBufferGap=function(_){var b=this.media;if(!b)return;if(!j.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,_.start);return}var I=b.currentTime,P=j.BufferHelper.bufferInfo(b,I,0),B=_.duration,z=Math.min(this.config.maxFragLookUpTolerance*2,B*.25),U=Math.max(Math.min(_.start-z,P.end-z),I+z);_.start-U>z&&this.flushMainBuffer(U,_.start)},c.getFwdBufferInfo=function(_,b){var I=this.config,P=this.getLoadPosition();if(!Object(H.isFiniteNumber)(P))return null;var B=j.BufferHelper.bufferInfo(_,P,I.maxBufferHole);if(B.len===0&&B.nextStart!==void 0){var z=this.fragmentTracker.getBufferedFrag(P,b);if(z&&B.nextStart<z.end)return j.BufferHelper.bufferInfo(_,P,Math.max(B.nextStart,I.maxBufferHole))}return B},c.getMaxBufferLength=function(_){var b=this.config,I;return _?I=Math.max(8*b.maxBufferSize/_,b.maxBufferLength):I=b.maxBufferLength,Math.min(I,b.maxMaxBufferLength)},c.reduceMaxBufferLength=function(_){var b=this.config,I=_||b.maxBufferLength;return b.maxMaxBufferLength>=I?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(_,b){var I,P,B=b.fragments,z=B.length;if(!z)return null;var U=this.config,C=B[0].start,W;if(b.live){var V=U.initialLiveManifestSize;if(z<V)return this.warn("Not enough fragments to start playback (have: "+z+", need: "+V+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(b,B),this.startPosition=W?this.hls.liveSyncPosition||W.start:_)}else _<=C&&(W=B[0]);if(!W){var J=U.lowLatencyMode?b.partEnd:b.fragmentEnd;W=this.getFragmentAtPosition(_,J,b)}return(I=W)!==null&&I!==void 0&&I.initSegment&&!((P=W)!==null&&P!==void 0&&P.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},c.getNextPart=function(_,b,I){for(var P=-1,B=!1,z=!0,U=0,C=_.length;U<C;U++){var W=_[U];if(z=z&&!W.independent,P>-1&&I<W.start)break;var V=W.loaded;!V&&(B||W.independent||z)&&W.fragment===b&&(P=U),B=V}return P},c.loadedEndOfParts=function(_,b){var I=_[_.length-1];return I&&b>I.start&&I.loaded},c.getInitialLiveFragment=function(_,b){var I=this.fragPrevious,P=null;if(I){if(_.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),P=Object(d.findFragmentByPDT)(b,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!P){var B=I.sn+1;if(B>=_.startSN&&B<=_.endSN){var z=b[B-_.startSN];I.cc===z.cc&&(P=z,this.log("Live playlist, switching playlist, load frag with next SN: "+P.sn))}P||(P=Object(d.findFragWithCC)(b,I.cc),P&&this.log("Live playlist, switching playlist, load frag with same CC: "+P.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(P=this.getFragmentAtPosition(U,this.bitrateTest?_.fragmentEnd:_.edge,_))}return P},c.getFragmentAtPosition=function(_,b,I){var P=this.config,B=this.fragPrevious,z=I.fragments,U=I.endSN,C=I.fragmentHint,W=P.maxFragLookUpTolerance,V=!!(P.lowLatencyMode&&I.partList&&C);V&&C&&!this.bitrateTest&&(z=z.concat(C),U=C.sn);var J;if(_<b){var ne=_>b-W?0:W;J=Object(d.findFragmentByPTS)(B,z,_,ne)}else J=z[z.length-1];if(J){var fe=J.sn-I.startSN,ue=B&&J.level===B.level,le=z[fe+1],me=this.fragmentTracker.getState(J);if(me===R.FragmentState.BACKTRACKED){J=null;for(var ge=fe;z[ge]&&this.fragmentTracker.getState(z[ge])===R.FragmentState.BACKTRACKED;)B?J=z[ge--]:J=z[--ge];J||(J=le)}else B&&J.sn===B.sn&&!V&&(ue&&(J.sn<U&&this.fragmentTracker.getState(le)!==R.FragmentState.OK?(this.log("SN "+J.sn+" just loaded, load next one: "+le.sn),J=le):J=null))}return J},c.synchronizeToLiveEdge=function(_){var b=this.config,I=this.media;if(!I)return;var P=this.hls.liveSyncPosition,B=I.currentTime,z=_.fragments[0].start,U=_.edge,C=B>=z-b.maxFragLookUpTolerance&&B<=U;if(P!==null&&I.duration>P&&(B<P||!C)){var W=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*_.targetduration;(!C&&I.readyState<4||B<U-W)&&(this.loadedmetadata||(this.nextLoadPosition=P),I.readyState&&(this.warn("Playback: "+B.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+P.toFixed(3)),I.currentTime=P))}},c.alignPlaylists=function(_,b){var I=this.levels,P=this.levelLastLoaded,B=this.fragPrevious,z=P!==null?I[P]:null,U=_.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var C=_.fragments[0].start,W=!b,V=_.alignedSliding&&Object(H.isFiniteNumber)(C);if(W||!V&&!C){Object(u.alignStream)(B,z,_);var J=_.fragments[0].start;return this.log("Live playlist sliding: "+J.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+_.startSN+" prev-sn: "+(B?B.sn:"na")+" fragments: "+U),J}return C},c.waitForCdnTuneIn=function(_){var b=3;return _.live&&_.canBlockReload&&_.tuneInGoal>Math.max(_.partHoldBack,_.partTarget*b)},c.setStartPosition=function(_,b){var I=this.startPosition;if(I<b&&(I=-1),I===-1||this.lastCurrentTime===-1){var P=_.startTimeOffset;Object(H.isFiniteNumber)(P)?(I=b+P,P<0&&(I+=_.totalduration),I=Math.min(Math.max(b,I),b+_.totalduration),this.log("Start time offset "+P+" found in playlist, adjust startPosition to "+I),this.startPosition=I):_.live?I=this.hls.liveSyncPosition||b:this.startPosition=I=0,this.lastCurrentTime=I}this.nextLoadPosition=I},c.getLoadPosition=function(){var _=this.media,b=0;return this.loadedmetadata&&_?b=_.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},c.handleFragLoadAborted=function(_,b){this.transmuxer&&_.sn!=="initSegment"&&_.stats.aborted&&(this.warn("Fragment "+_.sn+(b?" part"+b.index:"")+" of level "+_.level+" was aborted"),this.resetFragmentLoading(_))},c.resetFragmentLoading=function(_){(!this.fragCurrent||!this.fragContextChanged(_))&&(this.state=T.IDLE)},c.onFragmentOrKeyLoadError=function(_,b){if(b.fatal)return;var I=b.frag;if(!I||I.type!==_)return;var P=this.fragCurrent;console.assert(P&&I.sn===P.sn&&I.level===P.level&&I.urlId===P.urlId,"Frag load error must match current frag to retry");var B=this.config;if(this.fragLoadError+1<=B.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(I.level))return;var z=Math.min(Math.pow(2,this.fragLoadError)*B.fragLoadingRetryDelay,B.fragLoadingMaxRetryTimeout);this.warn("Fragment "+I.sn+" of "+_+" "+I.level+" failed to load, retrying in "+z+"ms"),this.retryDate=self.performance.now()+z,this.fragLoadError++,this.state=T.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(_===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=T.IDLE):(k.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=T.ERROR)},c.afterBufferFlushed=function(_,b,I){if(!_)return;var P=j.BufferHelper.getBuffered(_);this.fragmentTracker.detectEvictedFragments(b,P,I),this.state===T.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=T.IDLE},c.resetLiveStartWhenNotLoaded=function(_){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[_].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(_,b,I,P){var B=this,z=I.details;console.assert(!!z,"level.details must be defined");var U=Object.keys(_.elementaryStreams).reduce(function(C,W){var V=_.elementaryStreams[W];if(V){var J=V.endPTS-V.startPTS;if(J<=0)return B.warn("Could not parse fragment "+_.sn+" "+W+" duration reliably ("+J+") resetting transmuxer to fallback to playlist timing"),B.resetTransmuxer(),C||!1;var ne=P?0:Object(s.updateFragPTSDTS)(z,_,V.startPTS,V.endPTS,V.startDTS,V.endDTS);return B.hls.trigger(A.Events.LEVEL_PTS_UPDATED,{details:z,level:I,drift:ne,type:W,frag:_,start:V.startPTS,end:V.endPTS}),!0}return C},!1);U?(this.state=T.PARSED,this.hls.trigger(A.Events.FRAG_PARSED,{frag:_,part:b})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(p,[{key:"state",get:function(){return this._state},set:function(_){var b=this._state;b!==_&&(this._state=_,this.log(b+"->"+_))}}]),p}(N.default)},"./src/controller/buffer-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return d});var H=L("./src/polyfills/number.ts"),N=L("./src/events.ts"),R=L("./src/utils/logger.ts"),j=L("./src/errors.ts"),k=L("./src/utils/buffer-helper.ts"),A=L("./src/utils/mediasource-helper.ts"),D=L("./src/loader/fragment.ts"),g=L("./src/controller/buffer-operation-queue.ts"),h=Object(A.getMediaSource)(),u=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function s(i){var o=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 n=o.hls,f=o.media,O=o.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),f&&(o.updateMediaElementDuration(),n.trigger(N.Events.MEDIA_ATTACHED,{media:f})),O&&O.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var l=s.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var o=this.hls;o.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(N.Events.BUFFER_RESET,this.onBufferReset,this),o.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(N.Events.BUFFER_EOS,this.onBufferEos,this),o.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(N.Events.FRAG_PARSED,this.onFragParsed,this),o.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var o=this.hls;o.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(N.Events.BUFFER_RESET,this.onBufferReset,this),o.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(N.Events.BUFFER_EOS,this.onBufferEos,this),o.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(N.Events.FRAG_PARSED,this.onFragParsed,this),o.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(o,n){var f=2;(n.audio&&!n.video||!n.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(o,n){var f=this.media=n.media;if(f&&h){var O=this.mediaSource=new h;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(O),this._objectUrl=f.src}},l.onMediaDetaching=function(){var o=this.media,n=this.mediaSource,f=this._objectUrl;if(n){if(R.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(O){R.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(f&&self.URL.revokeObjectURL(f),o.src===f?(o.removeAttribute("src"),o.load()):R.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(N.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(n){var f=o.sourceBuffer[n];try{f&&(o.removeBufferListeners(n),o.mediaSource&&o.mediaSource.removeSourceBuffer(f),o.sourceBuffer[n]=void 0)}catch(O){R.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",O)}}),this._initSourceBuffer()},l.onBufferCodecs=function(o,n){var f=this,O=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(S){if(O){var x=f.tracks[S];if(x&&typeof x.buffer.changeType=="function"){var w=n[S],T=w.codec,y=w.levelCodec,v=w.container,p=(x.levelCodec||x.codec).replace(u,"$1"),c=(y||T).replace(u,"$1");if(p!==c){var E=v+";codecs="+(y||T);f.appendChangeType(S,E)}}}else f.pendingTracks[S]=n[S]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(o,n){var f=this,O=this.operationQueue,S={execute:function(){var w=f.sourceBuffer[o];w&&(R.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+n),w.changeType(n)),O.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(w){R.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",w)}};O.append(S,o)},l.onBufferAppending=function(o,n){var f=this,O=this.hls,S=this.operationQueue,x=this.tracks,w=n.data,T=n.type,y=n.frag,v=n.part,p=n.chunkMeta,c=p.buffering[T],E=self.performance.now();c.start=E;var _=y.stats.buffering,b=v?v.stats.buffering:null;_.start===0&&(_.start=E),b&&b.start===0&&(b.start=E);var I=x.audio,P=T==="audio"&&p.id===1&&(I==null?void 0:I.container)==="audio/mpeg",B={execute:function(){if(c.executeStart=self.performance.now(),P){var U=f.sourceBuffer[T];if(U){var C=y.start-U.timestampOffset;Math.abs(C)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+C+") sn: "+y.sn+")"),U.timestampOffset=y.start)}}f.appendExecutor(w,T)},onStart:function(){},onComplete:function(){var U=self.performance.now();c.executeEnd=c.end=U,_.first===0&&(_.first=U),b&&b.first===0&&(b.first=U);var C=f.sourceBuffer,W={};for(var V in C)W[V]=k.BufferHelper.getBuffered(C[V]);f.appendError=0,f.hls.trigger(N.Events.BUFFER_APPENDED,{type:T,frag:y,part:v,chunkMeta:p,parent:y.type,timeRanges:W})},onError:function(U){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+T+" SourceBuffer",U);var C={type:j.ErrorTypes.MEDIA_ERROR,parent:y.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=j.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,C.details=j.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>O.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),C.fatal=!0)),O.trigger(N.Events.ERROR,C)}};S.append(B,T)},l.onBufferFlushing=function(o,n){var f=this,O=this.operationQueue,S=function(w){return{execute:f.removeExecutor.bind(f,w,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(N.Events.BUFFER_FLUSHED,{type:w})},onError:function(y){R.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",y)}}};n.type?O.append(S(n.type),n.type):this.getSourceBufferTypes().forEach(function(x){O.append(S(x),x)})},l.onFragParsed=function(o,n){var f=this,O=n.frag,S=n.part,x=[],w=S?S.elementaryStreams:O.elementaryStreams;w[D.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(w[D.ElementaryStreamTypes.AUDIO]&&x.push("audio"),w[D.ElementaryStreamTypes.VIDEO]&&x.push("video"));var T=function(){var v=self.performance.now();O.stats.buffering.end=v,S&&(S.stats.buffering.end=v);var p=S?S.stats:O.stats;f.hls.trigger(N.Events.FRAG_BUFFERED,{frag:O,part:S,stats:p,id:O.type})};x.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(T,x)},l.onFragChanged=function(o,n){this.flushBackBuffer()},l.onBufferEos=function(o,n){var f=this,O=this.getSourceBufferTypes().reduce(function(S,x){var w=f.sourceBuffer[x];return(!n.type||n.type===x)&&(w&&!w.ended&&(w.ended=!0,R.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),S&&!!(!w||w.ended)},!0);O&&this.blockBuffers(function(){var S=f.mediaSource;if(!S||S.readyState!=="open")return;S.endOfStream()})},l.onLevelUpdated=function(o,n){var f=n.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var o=this.hls,n=this.details,f=this.media,O=this.sourceBuffer;if(!f||n===null)return;var S=this.getSourceBufferTypes();if(!S.length)return;var x=n.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(H.isFiniteNumber)(x)||x<0)return;var w=f.currentTime,T=n.levelTargetDuration,y=Math.max(x,T),v=Math.floor(w/T)*T-y;S.forEach(function(p){var c=O[p];if(c){var E=k.BufferHelper.getBuffered(c);E.length>0&&v>E.start(0)&&(o.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),n.live&&o.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),o.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:p}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,n=this.hls,f=this.media,O=this.mediaSource,S=o.fragments[0].start+o.totalduration,x=f.duration,w=Object(H.isFiniteNumber)(O.duration)?O.duration:0;o.live&&n.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(o)):(S>w&&S>x||!Object(H.isFiniteNumber)(x))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),O.duration=S)},l.updateSeekableRange=function(o){var n=this.mediaSource,f=o.fragments,O=f.length;if(O&&o.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var S=Math.max(0,f[0].start),x=Math.max(S,S+o.totalduration);n.setLiveSeekableRange(S,x)}},l.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,n=this.operationQueue,f=this.pendingTracks,O=Object.keys(f).length;if(O&&!o||O===2){this.createSourceBuffers(f),this.pendingTracks={};var S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(N.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(x){n.executeNext(x)})}},l.createSourceBuffers=function(o){var n=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var S in o)if(!n[S]){var x=o[S];if(!x)throw Error("source buffer exists for track "+S+", however track does not");var w=x.levelCodec||x.codec,T=x.container+";codecs="+w;R.logger.log("[buffer-controller]: creating sourceBuffer("+T+")");try{var y=n[S]=f.addSourceBuffer(T),v=S;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[S]={buffer:y,codec:w,container:x.container,levelCodec:x.levelCodec,id:x.id},O++}catch(p){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+p.message),this.hls.trigger(N.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,mimeType:T})}}O&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(o){var n=this.operationQueue,f=n.current(o);f.onStart()},l._onSBUpdateEnd=function(o){var n=this.operationQueue,f=n.current(o);f.onComplete(),n.shiftAndExecuteNext(o)},l._onSBUpdateError=function(o,n){R.logger.error("[buffer-controller]: "+o+" SourceBuffer error",n),this.hls.trigger(N.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(o);f&&f.onError(n)},l.removeExecutor=function(o,n,f){var O=this.media,S=this.mediaSource,x=this.operationQueue,w=this.sourceBuffer,T=w[o];if(!O||!S||!T){R.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(o);return}var y=Object(H.isFiniteNumber)(O.duration)?O.duration:Infinity,v=Object(H.isFiniteNumber)(S.duration)?S.duration:Infinity,p=Math.max(0,n),c=Math.min(f,y,v);c>p?(R.logger.log("[buffer-controller]: Removing ["+p+","+c+"] from the "+o+" SourceBuffer"),console.assert(!T.updating,o+" sourceBuffer must not be updating"),T.remove(p,c)):x.shiftAndExecuteNext(o)},l.appendExecutor=function(o,n){var f=this.operationQueue,O=this.sourceBuffer,S=O[n];if(!S){R.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(n);return}S.ended=!1,console.assert(!S.updating,n+" sourceBuffer must not be updating"),S.appendBuffer(o)},l.blockBuffers=function(o,n){var f=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var O=this.operationQueue,S=n.map(function(x){return O.appendBlocker(x)});Promise.all(S).then(function(){o(),n.forEach(function(x){var w=f.sourceBuffer[x];(!w||!w.updating)&&O.shiftAndExecuteNext(x)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(o,n,f){var O=this.sourceBuffer[o];if(!O)return;var S=f.bind(this,o);this.listeners[o].push({event:n,listener:S}),O.addEventListener(n,S)},l.removeBufferListeners=function(o){var n=this.sourceBuffer[o];if(!n)return;this.listeners[o].forEach(function(f){n.removeEventListener(f.event,f.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return N});var H=L("./src/utils/logger.ts"),N=function(){function R(k){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=k}var j=R.prototype;return j.append=function(A,D){var g=this.queues[D];g.push(A),g.length===1&&this.buffers[D]&&this.executeNext(D)},j.insertAbort=function(A,D){var g=this.queues[D];g.unshift(A),this.executeNext(D)},j.appendBlocker=function(A){var D,g=new Promise(function(u){D=u}),h={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(h,A),g},j.executeNext=function(A){var D=this.buffers,g=this.queues,h=D[A],u=g[A];if(u.length){var d=u[0];try{d.execute()}catch(s){H.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(s),(!h||!h.updating)&&(u.shift(),this.executeNext(A))}}},j.shiftAndExecuteNext=function(A){this.queues[A].shift(),this.executeNext(A)},j.current=function(A){return this.queues[A][0]},R}()},"./src/controller/cap-level-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/events.ts");function N(k,A){for(var D=0;D<A.length;D++){var g=A[D];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(k,g.key,g)}}function R(k,A,D){return A&&N(k.prototype,A),D&&N(k,D),k}var j=function(){function k(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var A=k.prototype;return A.setStreamController=function(g){this.streamController=g},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 g=this.hls;g.on(H.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},A.unregisterListener=function(){var g=this.hls;g.off(H.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},A.onFpsDropLevelCapping=function(g,h){k.isLevelAllowed(h.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(h.droppedLevel)},A.onMediaAttaching=function(g,h){this.media=h.media instanceof HTMLVideoElement?h.media:null},A.onManifestParsed=function(g,h){var u=this.hls;this.restrictedLevels=[],this.firstLevel=h.firstLevel,u.config.capLevelToPlayerSize&&h.video&&this.startCapping()},A.onBufferCodecs=function(g,h){var u=this.hls;u.config.capLevelToPlayerSize&&h.video&&this.startCapping()},A.onMediaDetaching=function(){this.stopCapping()},A.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var h=this.hls;h.autoLevelCapping=this.getMaxLevel(g.length-1),h.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=h.autoLevelCapping}}},A.getMaxLevel=function(g){var h=this,u=this.hls.levels;if(!u.length)return-1;var d=u.filter(function(s,l){return k.isLevelAllowed(l,h.restrictedLevels)&&l<=g});return this.clientRect=null,k.getMaxLevelByMediaSize(d,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 g=this.media,h={width:0,height:0};if(g){var u=g.getBoundingClientRect();h.width=u.width,h.height=u.height,!h.width&&!h.height&&(h.width=u.right-u.left||g.width||0,h.height=u.bottom-u.top||g.height||0)}return this.clientRect=h,h},k.isLevelAllowed=function(g,h){return h===void 0&&(h=[]),h.indexOf(g)===-1},k.getMaxLevelByMediaSize=function(g,h,u){if(!g||!g.length)return-1;for(var d=function(n,f){return f?n.width!==f.width||n.height!==f.height:!0},s=g.length-1,l=0;l<g.length;l+=1){var i=g[l];if((i.width>=h||i.height>=u)&&d(i,g[l+1])){s=l;break}}return s},R(k,[{key:"mediaWidth",get:function(){return this.getDimensions().width*k.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*k.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(h){}return g}}]),k}();K.default=j},"./src/controller/cmcd-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return d});var H=L("./src/events.ts"),N=L("./src/types/cmcd.ts"),R=L("./src/utils/buffer-helper.ts"),j=L("./src/utils/logger.ts");function k(s,l){for(var i=0;i<l.length;i++){var o=l[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}function A(s,l,i){return l&&k(s.prototype,l),i&&k(s,i),s}function D(s,l){var i=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(i)return(i=i.call(s)).next.bind(i);if(Array.isArray(s)||(i=g(s))||l&&s&&typeof s.length=="number"){i&&(s=i);var o=0;return function(){return o>=s.length?{done:!0}:{done:!1,value:s[o++]}}}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 g(s,l){if(!s)return;if(typeof s=="string")return h(s,l);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return h(s,l)}function h(s,l){(l==null||l>s.length)&&(l=s.length);for(var i=0,o=new Array(l);i<l;i++)o[i]=s[i];return o}function u(){return u=Object.assign||function(s){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(s[o]=i[o])}return s},u.apply(this,arguments)}var d=function(){function s(i){var o=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(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(O){try{o.apply(O,{ot:N.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(S){j.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(O){try{var S=O.frag,x=o.hls.levels[S.level],w=o.getObjectType(S),T={d:S.duration*1e3,ot:w};(w===N.CMCDObjectType.VIDEO||w===N.CMCDObjectType.AUDIO||w==N.CMCDObjectType.MUXED)&&(T.br=x.bitrate/1e3,T.tb=o.getTopBandwidth(w),T.bl=o.getBufferLength(w)),o.apply(O,T)}catch(y){j.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=i;var n=this.config=i.config,f=n.cmcd;f!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||s.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var l=s.prototype;return l.registerListeners=function(){var o=this.hls;o.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var o=this.hls;o.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(o,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(o,n){var f,O;this.audioBuffer=(f=n.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(O=n.tracks.video)===null||O===void 0?void 0:O.buffer},l.createData=function(){var o;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(o=this.media)===null||o===void 0?void 0:o.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(o,n){n===void 0&&(n={}),u(n,this.createData());var f=n.ot===N.CMCDObjectType.INIT||n.ot===N.CMCDObjectType.VIDEO||n.ot===N.CMCDObjectType.MUXED;if(this.starved&&f&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var O=s.toHeaders(n);if(!Object.keys(O).length)return;o.headers||(o.headers={}),u(o.headers,O)}else{var S=s.toQuery(n);if(!S)return;o.url=s.appendQueryToUri(o.url,S)}},l.getObjectType=function(o){var n=o.type;return n==="subtitle"?N.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?N.CMCDObjectType.INIT:n==="audio"?N.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(o){for(var n=0,f=o===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=D(f),S;!(S=O()).done;){var x=S.value;x.bitrate>n&&(n=x.bitrate)}return n>0?n:NaN},l.getBufferLength=function(o){var n=this.hls.media,f=o===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!n)return NaN;var O=R.BufferHelper.bufferInfo(f,n.currentTime,this.config.maxBufferHole);return O.len*1e3},l.createPlaylistLoader=function(){var o=this.config.pLoader,n=this.applyPlaylistData,f=o||this.config.loader;return function(){function O(x){this.loader=void 0,this.loader=new f(x)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(w,T,y){n(w),this.loader.load(w,T,y)},A(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},l.createFragmentLoader=function(){var o=this.config.fLoader,n=this.applyFragmentData,f=o||this.config.loader;return function(){function O(x){this.loader=void 0,this.loader=new f(x)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(w,T,y){n(w),this.loader.load(w,T,y)},A(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},s.uuid=function(){var o=URL.createObjectURL(new Blob),n=o.toString();return URL.revokeObjectURL(o),n.substr(n.lastIndexOf("/")+1)},s.serialize=function(o){for(var n=[],f=function(P){return!Number.isNaN(P)&&P!=null&&P!==""&&P!==!1},O=function(P){return Math.round(P)},S=function(P){return O(P/100)*100},x=function(P){return encodeURIComponent(P)},w={br:O,d:O,bl:S,dl:S,mtp:S,nor:x,rtp:S,tb:O},T=Object.keys(o||{}).sort(),y=D(T),v;!(v=y()).done;){var p=v.value,c=o[p];if(!f(c))continue;if(p==="v"&&c===1)continue;if(p=="pr"&&c===1)continue;var E=w[p];E&&(c=E(c));var _=typeof c,b=void 0;p==="ot"||p==="sf"||p==="st"?b=p+"="+c:_==="boolean"?b=p:_==="number"?b=p+"="+c:b=p+"="+JSON.stringify(c),n.push(b)}return n.join(",")},s.toHeaders=function(o){for(var n=Object.keys(o),f={},O=["Object","Request","Session","Status"],S=[{},{},{},{}],x={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,T=n;w<T.length;w++){var y=T[w],v=x[y]!=null?x[y]:1;S[v][y]=o[y]}for(var p=0;p<S.length;p++){var c=s.serialize(S[p]);c&&(f["CMCD-"+O[p]]=c)}return f},s.toQuery=function(o){return"CMCD="+encodeURIComponent(s.serialize(o))},s.appendQueryToUri=function(o,n){if(!n)return o;var f=o.includes("?")?"&":"?";return""+o+f+n},s}()},"./src/controller/eme-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/events.ts"),N=L("./src/errors.ts"),R=L("./src/utils/logger.ts"),j=L("./src/utils/mediakeys-helper.ts");function k(d,s){for(var l=0;l<s.length;l++){var i=s[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}function A(d,s,l){return s&&k(d.prototype,s),l&&k(d,l),d}var D=3,g=function(s,l,i){var o={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(n){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:i.audioRobustness||""})}),l.forEach(function(n){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:i.videoRobustness||""})}),[o]},h=function(s,l,i,o){switch(s){case j.KeySystems.WIDEVINE:return g(l,i,o);default:throw new Error("Unknown key-system: "+s)}},u=function(){function d(l){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=l,this._config=l.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 s=d.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(i){switch(i){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},s._attemptKeySystemAccess=function(i,o,n){var f=this,O=h(i,o,n,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var S=this.requestMediaKeySystemAccess(i,O);this.mediaKeysPromise=S.then(function(x){return f._onMediaKeySystemAccessObtained(i,x)}),S.catch(function(x){R.logger.error('Failed to obtain key-system "'+i+'" access:',x)})},s._onMediaKeySystemAccessObtained=function(i,o){var n=this;R.logger.log('Access for key-system "'+i+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:i};this._mediaKeysList.push(f);var O=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(S){return f.mediaKeys=S,R.logger.log('Media-keys created for key-system "'+i+'"'),n._onMediaKeysCreated(),S});return O.catch(function(S){R.logger.error("Failed to create media-keys:",S)}),O},s._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),i._onNewMediaKeySession(o.mediaKeysSession))})},s._onNewMediaKeySession=function(i){var o=this;R.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(n){o._onKeySessionMessage(i,n.message)},!1)},s._onKeySessionMessage=function(i,o){R.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(n){R.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),i.update(n)})},s.onMediaEncrypted=function(i){var o=this;if(R.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(O){if(!o._media)return;o._attemptSetMediaKeys(O),o._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(n).catch(n)},s._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(i,o){var n=this,f=this._mediaKeysList[0];if(!f){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(f.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var O=f.mediaKeysSession;if(!O){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+i+'" init data type'),f.mediaKeysSessionInitialized=!0,O.generateRequest(i,o).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(S){R.logger.error("Error generating key-session request:",S),n.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(i,o,n){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,i,o,n);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,f,i),O=void 0}catch(S){R.logger.error(S)}try{f.readyState||f.open("POST",i,!0),O&&O.call(this.hls,f,i)}catch(S){throw new Error("issue setting up KeySystem license XHR "+S)}return f},s._onLicenseRequestReadyStageChange=function(i,o,n,f){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var O=i.response,S=this._licenseResponseCallback;if(S)try{O=S.call(this.hls,i,o)}catch(w){R.logger.error(w)}f(O)}else{if(R.logger.error("License Request XHR failed ("+o+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=D-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(n,f)}break}},s._generateLicenseRequestChallenge=function(i,o){switch(i.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,o){R.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(n.mediaKeySystemDomain),O=this._createLicenseXhr(f,i,o);R.logger.log("Sending license request to URL: "+f);var S=this._generateLicenseRequestChallenge(n,i);O.send(S)}catch(x){R.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,o){if(!this._emeEnabled)return;var n=o.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,o=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,o){if(!this._emeEnabled)return;var n=o.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),f=o.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(j.KeySystems.WIDEVINE,n,f)},A(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();K.default=u},"./src/controller/fps-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/events.ts"),N=L("./src/utils/logger.ts"),R=function(){function j(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 k=j.prototype;return k.setStreamController=function(D){this.streamController=D},k.registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},k.unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching)},k.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},k.onMediaAttaching=function(D,g){var h=this.hls.config;if(h.capLevelOnFPSDrop){var u=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),h.fpsDroppedMonitoringPeriod)}},k.checkFPS=function(D,g,h){var u=performance.now();if(g){if(this.lastTime){var d=u-this.lastTime,s=h-this.lastDroppedFrames,l=g-this.lastDecodedFrames,i=1e3*s/d,o=this.hls;if(o.trigger(H.Events.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:h}),i>0&&s>o.config.fpsDroppedMonitoringThreshold*l){var n=o.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=n)&&(n=n-1,o.trigger(H.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:o.currentLevel}),o.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=h,this.lastDecodedFrames=g}},k.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var g=D.getVideoPlaybackQuality();this.checkFPS(D,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},j}();K.default=R},"./src/controller/fragment-finders.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"findFragmentByPDT",function(){return R}),L.d(K,"findFragmentByPTS",function(){return j}),L.d(K,"fragmentWithinToleranceTest",function(){return k}),L.d(K,"pdtWithinToleranceTest",function(){return A}),L.d(K,"findFragWithCC",function(){return D});var H=L("./src/polyfills/number.ts"),N=L("./src/utils/binary-search.ts");function R(g,h,u){if(h===null||!Array.isArray(g)||!g.length||!Object(H.isFiniteNumber)(h))return null;var d=g[0].programDateTime;if(h<(d||0))return null;var s=g[g.length-1].endProgramDateTime;if(h>=(s||0))return null;u=u||0;for(var l=0;l<g.length;++l){var i=g[l];if(A(h,u,i))return i}return null}function j(g,h,u,d){u===void 0&&(u=0),d===void 0&&(d=0);var s=null;if(g?s=h[g.sn-h[0].sn+1]||null:u===0&&h[0].start===0&&(s=h[0]),s&&k(u,d,s)===0)return s;var l=N.default.search(h,k.bind(null,u,d));return l||s}function k(g,h,u){g===void 0&&(g=0),h===void 0&&(h=0);var d=Math.min(h,u.duration+(u.deltaPTS?u.deltaPTS:0));return u.start+u.duration-d<=g?1:u.start-d>g&&u.start?-1:0}function A(g,h,u){var d=Math.min(h,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,s=u.endProgramDateTime||0;return s-d>g}function D(g,h){return N.default.search(g,function(u){return u.cc<h?1:u.cc>h?-1:0})}},"./src/controller/fragment-tracker.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"FragmentState",function(){return R}),L.d(K,"FragmentTracker",function(){return j});var H=L("./src/events.ts"),N=L("./src/types/loader.ts"),R;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(R||(R={}));var j=function(){function D(h){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=h,this._registerListeners()}var g=D.prototype;return g._registerListeners=function(){var u=this.hls;u.on(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(H.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var u=this.hls;u.off(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(H.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(u,d){if(d===N.PlaylistLevelType.MAIN){var s=this.activeFragment,l=this.activeParts;if(!s)return null;if(l)for(var i=l.length;i--;){var o=l[i],n=o?o.end:s.appendedPTS;if(o.start<=u&&n!==void 0&&u<=n)return i>9&&(this.activeParts=l.slice(i-9)),o}else if(s.start<=u&&s.appendedPTS!==void 0&&u<=s.appendedPTS)return s}return this.getBufferedFrag(u,d)},g.getBufferedFrag=function(u,d){for(var s=this.fragments,l=Object.keys(s),i=l.length;i--;){var o=s[l[i]];if((o==null?void 0:o.body.type)===d&&o.buffered){var n=o.body;if(n.start<=u&&u<=n.end)return n}}return null},g.detectEvictedFragments=function(u,d,s){var l=this;Object.keys(this.fragments).forEach(function(i){var o=l.fragments[i];if(!o)return;if(!o.buffered){o.body.type===s&&l.removeFragment(o.body);return}var n=o.range[u];if(!n)return;n.time.some(function(f){var O=!l.isTimeBuffered(f.startPTS,f.endPTS,d);return O&&l.removeFragment(o.body),O})})},g.detectPartialFragments=function(u){var d=this,s=this.timeRanges,l=u.frag,i=u.part;if(!s||l.sn==="initSegment")return;var o=A(l),n=this.fragments[o];if(!n)return;Object.keys(s).forEach(function(f){var O=l.elementaryStreams[f];if(!O)return;var S=s[f],x=i!==null||O.partial===!0;n.range[f]=d.getBufferedTimes(l,i,x,S)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},g.fragBuffered=function(u){var d=A(u),s=this.fragments[d];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},g.getBufferedTimes=function(u,d,s,l){for(var i={time:[],partial:s},o=d?d.start:u.start,n=d?d.end:u.end,f=u.minEndPTS||n,O=u.maxStartPTS||o,S=0;S<l.length;S++){var x=l.start(S)-this.bufferPadding,w=l.end(S)+this.bufferPadding;if(O>=x&&f<=w){i.time.push({startPTS:Math.max(o,l.start(S)),endPTS:Math.min(n,l.end(S))});break}else if(o<w&&n>x)i.partial=!0,i.time.push({startPTS:Math.max(o,l.start(S)),endPTS:Math.min(n,l.end(S))});else if(n<=x)break}return i},g.getPartialFragment=function(u){var d=null,s,l,i,o=0,n=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(O){var S=f[O];if(!S)return;k(S)&&(l=S.body.start-n,i=S.body.end+n,u>=l&&u<=i&&(s=Math.min(u-l,i-u),o<=s&&(d=S.body,o=s)))}),d},g.getState=function(u){var d=A(u),s=this.fragments[d];return s?s.buffered?k(s)?R.PARTIAL:R.OK:s.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},g.backtrack=function(u,d){var s=A(u),l=this.fragments[s];if(!l||l.backtrack)return null;var i=l.backtrack=d||l.loaded;return l.loaded=null,i},g.getBacktrackData=function(u){var d=A(u),s=this.fragments[d];if(s){var l,i=s.backtrack;if(i!=null&&(l=i.payload)!==null&&l!==void 0&&l.byteLength)return i;this.removeFragment(u)}return null},g.isTimeBuffered=function(u,d,s){for(var l,i,o=0;o<s.length;o++){if(l=s.start(o)-this.bufferPadding,i=s.end(o)+this.bufferPadding,u>=l&&d<=i)return!0;if(d<=l)return!1}return!1},g.onFragLoaded=function(u,d){var s=d.frag,l=d.part;if(s.sn==="initSegment"||s.bitrateTest||l)return;var i=A(s);this.fragments[i]={body:s,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(u,d){var s=this,l=d.frag,i=d.part,o=d.timeRanges;if(l.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=l,i){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(i)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(f){var O=o[f];if(s.detectEvictedFragments(f,O),!i)for(var S=0;S<O.length;S++)l.appendedPTS=Math.max(O.end(S),l.appendedPTS||0)})},g.onFragBuffered=function(u,d){this.detectPartialFragments(d)},g.hasFragment=function(u){var d=A(u);return!!this.fragments[d]},g.removeFragmentsInRange=function(u,d,s){var l=this;Object.keys(this.fragments).forEach(function(i){var o=l.fragments[i];if(!o)return;if(o.buffered){var n=o.body;n.type===s&&n.start<d&&n.end>u&&l.removeFragment(n)}})},g.removeFragment=function(u){var d=A(u);u.stats.loaded=0,u.clearElementaryStreamInfo(),delete this.fragments[d]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function k(D){var g,h;return D.buffered&&(((g=D.range.video)===null||g===void 0?void 0:g.partial)||((h=D.range.audio)===null||h===void 0?void 0:h.partial))}function A(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"STALL_MINIMUM_DURATION_MS",function(){return k}),L.d(K,"MAX_START_GAP_JUMP",function(){return A}),L.d(K,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),L.d(K,"SKIP_BUFFER_RANGE_START",function(){return g}),L.d(K,"default",function(){return h});var H=L("./src/utils/buffer-helper.ts"),N=L("./src/errors.ts"),R=L("./src/events.ts"),j=L("./src/utils/logger.ts"),k=250,A=2,D=.1,g=.05,h=function(){function u(s,l,i,o){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=s,this.media=l,this.fragmentTracker=i,this.hls=o}var d=u.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(l){var i=this.config,o=this.media,n=this.stalled,f=o.currentTime,O=o.seeking,S=this.seeking&&!O,x=!this.seeking&&O;if(this.seeking=O,f!==l){if(this.moved=!0,n!==null){if(this.stallReported){var w=self.performance.now()-n;j.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||S)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!H.BufferHelper.getBuffered(o).length)return;var T=H.BufferHelper.bufferInfo(o,f,0),y=T.len>0,v=T.nextStart||0;if(!y&&!v)return;if(O){var p=T.len>A,c=!v||v-f>A&&!this.fragmentTracker.getPartialFragment(f);if(p||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,_=Math.max(v,T.start||0)-f,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=b==null||((E=b.details)===null||E===void 0)?void 0:E.live,P=I?b.details.targetduration*2:A;if(_>0&&_<=P){this._trySkipBufferHole(null);return}}var B=self.performance.now();if(n===null){this.stalled=B;return}var z=B-n;!O&&z>=k&&this._reportStall(T.len);var U=H.BufferHelper.bufferInfo(o,f,i.maxBufferHole);this._tryFixBufferStall(U,z)},d._tryFixBufferStall=function(l,i){var o=this.config,n=this.fragmentTracker,f=this.media,O=f.currentTime,S=n.getPartialFragment(O);if(S){var x=this._trySkipBufferHole(S);if(x)return}l.len>o.maxBufferHole&&i>o.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(l){var i=this.hls,o=this.media,n=this.stallReported;n||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+l+")"),i.trigger(R.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},d._trySkipBufferHole=function(l){for(var i=this.config,o=this.hls,n=this.media,f=n.currentTime,O=0,S=H.BufferHelper.getBuffered(n),x=0;x<S.length;x++){var w=S.start(x);if(f+i.maxBufferHole>=O&&f<w){var T=Math.max(w+g,n.currentTime+D);return j.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+T),this.moved=!0,this.stalled=null,n.currentTime=T,l&&o.trigger(R.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+f+" to "+T,frag:l}),T}O=S.end(x)}return 0},d._tryNudgeBuffer=function(){var l=this.config,i=this.hls,o=this.media,n=o.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<l.nudgeMaxRetry){var O=n+f*l.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+n+" to "+O),o.currentTime=O,i.trigger(R.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+l.nudgeMaxRetry+" nudges"),i.trigger(R.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},u}()},"./src/controller/id3-track-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/events.ts"),N=L("./src/utils/texttrack-utils.ts"),R=L("./src/demux/id3.ts"),j=.25,k=function(){function A(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var D=A.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var h=this.hls;h.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(H.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var h=this.hls;h.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(H.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(h,u){this.media=u.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(h){if(!this.media)return;for(var u=0;u<h.length;u++){var d=h[u];if(d.kind==="metadata"&&d.label==="id3")return Object(N.sendAddTrackEvent)(d,this.media),d}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(h,u){if(!this.media)return;var d=u.frag,s=u.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<s.length;i++){var o=R.getID3Frames(s[i].data);if(o){var n=s[i].pts,f=i<s.length-1?s[i+1].pts:d.end,O=f-n;O<=0&&(f=n+j);for(var S=0;S<o.length;S++){var x=o[S];if(!R.isTimeStampFrame(x)){var w=new l(n,f,"");w.value=x,this.id3Track.addCue(w)}}}}},D.onBufferFlushing=function(h,u){var d=u.startOffset,s=u.endOffset,l=u.type;if(!l||l==="audio"){var i=this.id3Track;i&&Object(N.removeCuesInRange)(i,d,s)}},A}();K.default=k},"./src/controller/latency-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return A});var H=L("./src/errors.ts"),N=L("./src/events.ts"),R=L("./src/utils/logger.ts");function j(D,g){for(var h=0;h<g.length;h++){var u=g[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(D,u.key,u)}}function k(D,g,h){return g&&j(D.prototype,g),h&&j(D,h),D}var A=function(){function D(h){var u=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 u.timeupdate()},this.hls=h,this.config=h.config,this.registerListeners()}var g=D.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(N.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(N.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(N.Events.ERROR,this.onError)},g.onMediaAttached=function(u,d){this.media=d.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(u,d){var s=d.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(u,d){if(d.details!==H.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var u=this.media,d=this.levelDetails;if(!u||!d)return;this.currentTime=u.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var l=this.config,i=l.lowLatencyMode,o=l.maxLiveSyncPlaybackRate;if(!i||o===1)return;var n=this.targetLatency;if(n===null)return;var f=s-n,O=Math.min(this.maxLatency,n+d.targetduration),S=f<O;if(d.live&&S&&f>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,o)),w=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;u.playbackRate=Math.min(x,Math.max(1,w))}else u.playbackRate!==1&&u.playbackRate!==0&&(u.playbackRate=1)},g.estimateLiveEdge=function(){var u=this.levelDetails;return u===null?null:u.edge+u.age},g.computeLatency=function(){var u=this.estimateLiveEdge();return u===null?null:u-this.currentTime},k(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var u=this.config,d=this.levelDetails;return u.liveMaxLatencyDuration!==void 0?u.liveMaxLatencyDuration:d?u.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var u=this.levelDetails;if(u===null)return null;var d=u.holdBack,s=u.partHoldBack,l=u.targetduration,i=this.config,o=i.liveSyncDuration,n=i.liveSyncDurationCount,f=i.lowLatencyMode,O=this.hls.userConfig,S=f&&s||d;(O.liveSyncDuration||O.liveSyncDurationCount||S===0)&&(S=o!==void 0?o:n*l);var x=l,w=1;return S+Math.min(this.stallCount*w,x)}},{key:"liveSyncPosition",get:function(){var u=this.estimateLiveEdge(),d=this.targetLatency,s=this.levelDetails;if(u===null||d===null||s===null)return null;var l=s.edge,i=u-d-this.edgeStalled,o=l-s.totalduration,n=l-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(o,i),n)}},{key:"drift",get:function(){var u=this.levelDetails;return u===null?1:u.drift}},{key:"edgeStalled",get:function(){var u=this.levelDetails;if(u===null)return 0;var d=(this.config.lowLatencyMode&&u.partTarget||u.targetduration)*3;return Math.max(u.age-d,0)}},{key:"forwardBufferLength",get:function(){var u=this.media,d=this.levelDetails;if(!u||!d)return 0;var s=u.buffered.length;return s?u.buffered.end(s-1):d.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return i});var H=L("./src/types/level.ts"),N=L("./src/events.ts"),R=L("./src/errors.ts"),j=L("./src/utils/codecs.ts"),k=L("./src/controller/level-helper.ts"),A=L("./src/controller/base-playlist-controller.ts"),D=L("./src/types/loader.ts");function g(){return g=Object.assign||function(o){for(var n=1;n<arguments.length;n++){var f=arguments[n];for(var O in f)Object.prototype.hasOwnProperty.call(f,O)&&(o[O]=f[O])}return o},g.apply(this,arguments)}function h(o,n){for(var f=0;f<n.length;f++){var O=n[f];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(o,O.key,O)}}function u(o,n,f){return n&&h(o.prototype,n),f&&h(o,f),o}function d(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,s(o,n)}function s(o,n){return s=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},s(o,n)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(o){d(n,o);function n(O){var S;return S=o.call(this,O,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var f=n.prototype;return f._registerListeners=function(){var S=this.hls;S.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(N.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var S=this.hls;S.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),S.off(N.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,o.prototype.destroy.call(this)},f.startLoad=function(){var S=this._levels;S.forEach(function(x){x.loadError=0}),o.prototype.startLoad.call(this)},f.onManifestLoaded=function(S,x){var w=[],T=[],y=[],v,p={},c,E=!1,_=!1,b=!1;if(x.levels.forEach(function(z){var U=z.attrs;E=E||!!(z.width&&z.height),_=_||!!z.videoCodec,b=b||!!z.audioCodec,l&&z.audioCodec&&z.audioCodec.indexOf("mp4a.40.34")!==-1&&(z.audioCodec=void 0);var C=z.bitrate+"-"+z.attrs.RESOLUTION+"-"+z.attrs.CODECS;c=p[C],c?c.url.push(z.url):(c=new H.Level(z),p[C]=c,w.push(c)),U&&(U.AUDIO&&Object(k.addGroupId)(c,"audio",U.AUDIO),U.SUBTITLES&&Object(k.addGroupId)(c,"text",U.SUBTITLES))}),(E||_)&&b&&(w=w.filter(function(z){var U=z.videoCodec,C=z.width,W=z.height;return!!U||!!(C&&W)})),w=w.filter(function(z){var U=z.audioCodec,C=z.videoCodec;return(!U||Object(j.isCodecSupportedInMp4)(U,"audio"))&&(!C||Object(j.isCodecSupportedInMp4)(C,"video"))}),x.audioTracks&&(T=x.audioTracks.filter(function(z){return!z.audioCodec||Object(j.isCodecSupportedInMp4)(z.audioCodec,"audio")}),Object(k.assignTrackIdsByGroup)(T)),x.subtitles&&(y=x.subtitles,Object(k.assignTrackIdsByGroup)(y)),w.length>0){v=w[0].bitrate,w.sort(function(z,U){return z.bitrate-U.bitrate}),this._levels=w;for(var I=0;I<w.length;I++)if(w[I].bitrate===v){this._firstLevel=I,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+v);break}var P=b&&!_,B={levels:w,audioTracks:T,subtitleTracks:y,firstLevel:this._firstLevel,stats:x.stats,audio:b,video:_,altAudio:!P&&T.some(function(z){return!!z.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,B),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(S,x){if(o.prototype.onError.call(this,S,x),x.fatal)return;var w=x.context,T=this._levels[this.currentLevelIndex];if(w&&(w.type===D.PlaylistContextType.AUDIO_TRACK&&T.audioGroupIds&&w.groupId===T.audioGroupIds[T.urlId]||w.type===D.PlaylistContextType.SUBTITLE_TRACK&&T.textGroupIds&&w.groupId===T.textGroupIds[T.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,v=!0,p;switch(x.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var c=this._levels[x.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(p=x.frag.level)):p=x.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(v=!1),p=w.level),y=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:p=x.level,y=!0;break}p!==void 0&&this.recoverLevel(x,p,y,v)},f.recoverLevel=function(S,x,w,T){var y=S.details,v=this._levels[x];if(v.loadError++,w){var p=this.retryLoadingOrFail(S);if(p)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(T){var c=v.url.length;if(c>1&&v.loadError<c)S.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var E=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(y+": switch to "+E),S.levelRetry=!0,this.hls.nextAutoLevel=E)}}},f.redundantFailover=function(S){var x=this._levels[S],w=x.url.length;if(w>1){var T=(x.urlId+1)%w;this.warn("Switching to redundant URL-id "+T),this._levels.forEach(function(y){y.urlId=T}),this.level=S}},f.onFragLoaded=function(S,x){var w=x.frag;if(w!==void 0&&w.type===D.PlaylistLevelType.MAIN){var T=this._levels[w.level];T!==void 0&&(T.fragmentError=0,T.loadError=0)}},f.onLevelLoaded=function(S,x){var w,T=x.level,y=x.details,v=this._levels[T];if(!v){var p;this.warn("Invalid level index "+T),(p=x.deliveryDirectives)!==null&&p!==void 0&&p.skip&&(y.deltaUpdateFailed=!0);return}T===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(T,x,v.details)):(w=x.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(y.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(S,x){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var T=-1,y=this.hls.audioTracks[x.id].groupId,v=0;v<w.audioGroupIds.length;v++)if(w.audioGroupIds[v]===y){T=v;break}T!==w.urlId&&(w.urlId=T,this.startLoad())}},f.loadPlaylist=function(S){var x=this.currentLevelIndex,w=this._levels[x];if(this.canLoad&&w&&w.url.length>0){var T=w.urlId,y=w.url[T];if(S)try{y=S.addDirectives(y)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+x+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+T+" "+y),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:y,level:x,id:T,deliveryDirectives:S||null})}},f.removeLevel=function(S,x){var w=function(v,p){return p!==x},T=this._levels.filter(function(y,v){return v!==S?!0:y.url.length>1&&x!==void 0?(y.url=y.url.filter(w),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(w)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(w)),y.urlId=0,!0):!1}).map(function(y,v){var p=y.details;return p!=null&&p.fragments&&p.fragments.forEach(function(c){c.level=v}),y});this._levels=T,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:T})},u(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var x,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===S&&(x=w[S])!==null&&x!==void 0&&x.details)return;if(S<0||S>=w.length){var T=S<0;if(this.hls.trigger(N.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:T,reason:"invalid level idx"}),T)return;S=Math.min(S,w.length-1)}this.clearTimer();var y=this.currentLevelIndex,v=w[y],p=w[S];this.log("switching to level "+S+" from "+y),this.currentLevelIndex=S;var c=g({},p,{level:S,maxBitrate:p.maxBitrate,uri:p.uri,urlId:p.urlId});delete c._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,c);var E=p.details;if(!E||E.live){var _=this.switchParams(p.uri,v==null?void 0:v.details);this.loadPlaylist(_)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),n}(A.default)},"./src/controller/level-helper.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"addGroupId",function(){return R}),L.d(K,"assignTrackIdsByGroup",function(){return j}),L.d(K,"updatePTS",function(){return k}),L.d(K,"updateFragPTSDTS",function(){return D}),L.d(K,"mergeDetails",function(){return g}),L.d(K,"mapPartIntersection",function(){return h}),L.d(K,"mapFragmentIntersection",function(){return u}),L.d(K,"adjustSliding",function(){return d}),L.d(K,"addSliding",function(){return s}),L.d(K,"computeReloadInterval",function(){return l}),L.d(K,"getFragmentWithSN",function(){return i}),L.d(K,"getPartWith",function(){return o});var H=L("./src/polyfills/number.ts"),N=L("./src/utils/logger.ts");function R(n,f,O){switch(f){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(O);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(O);break}}function j(n){var f={};n.forEach(function(O){var S=O.groupId||"";O.id=f[S]=f[S]||0,f[S]++})}function k(n,f,O){var S=n[f],x=n[O];A(S,x)}function A(n,f){var O=f.startPTS;if(Object(H.isFiniteNumber)(O)){var S=0,x;f.sn>n.sn?(S=O-n.start,x=n):(S=n.start-O,x=f),x.duration!==S&&(x.duration=S)}else if(f.sn>n.sn){var w=n.cc===f.cc;w&&n.minEndPTS?f.start=n.start+(n.minEndPTS-n.start):f.start=n.start+n.duration}else f.start=Math.max(n.start-f.duration,0)}function D(n,f,O,S,x,w){var T=S-O;T<=0&&(N.logger.warn("Fragment should have a positive duration",f),S=O+f.duration,w=x+f.duration);var y=O,v=S,p=f.startPTS,c=f.endPTS;if(Object(H.isFiniteNumber)(p)){var E=Math.abs(p-O);Object(H.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(E,f.deltaPTS):f.deltaPTS=E,y=Math.max(O,p),O=Math.min(O,p),x=Math.min(x,f.startDTS),v=Math.min(S,c),S=Math.max(S,c),w=Math.max(w,f.endDTS)}f.duration=S-O;var _=O-f.start;f.appendedPTS=S,f.start=f.startPTS=O,f.maxStartPTS=y,f.startDTS=x,f.endPTS=S,f.minEndPTS=v,f.endDTS=w;var b=f.sn;if(!n||b<n.startSN||b>n.endSN)return 0;var I,P=b-n.startSN,B=n.fragments;for(B[P]=f,I=P;I>0;I--)A(B[I],B[I-1]);for(I=P;I<B.length-1;I++)A(B[I],B[I+1]);return n.fragmentHint&&A(B[B.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,_}function g(n,f){for(var O=null,S=n.fragments,x=S.length-1;x>=0;x--){var w=S[x].initSegment;if(w){O=w;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var T=0,y;if(u(n,f,function(I,P){I.relurl&&(T=I.cc-P.cc),Object(H.isFiniteNumber)(I.startPTS)&&Object(H.isFiniteNumber)(I.endPTS)&&(P.start=P.startPTS=I.startPTS,P.startDTS=I.startDTS,P.appendedPTS=I.appendedPTS,P.maxStartPTS=I.maxStartPTS,P.endPTS=I.endPTS,P.endDTS=I.endDTS,P.minEndPTS=I.minEndPTS,P.duration=I.endPTS-I.startPTS,P.duration&&(y=P),f.PTSKnown=f.alignedSliding=!0),P.elementaryStreams=I.elementaryStreams,P.loader=I.loader,P.stats=I.stats,P.urlId=I.urlId,I.initSegment&&(P.initSegment=I.initSegment,O=I.initSegment)}),O){var v=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;v.forEach(function(I){var P;(!I.initSegment||I.initSegment.relurl===((P=O)===null||P===void 0?void 0:P.relurl))&&(I.initSegment=O)})}if(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(I){return!I}),f.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=f.skippedSegments;p--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var c=f.fragments;if(T){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<c.length;E++)c[E].cc+=T}f.skippedSegments&&(f.startCC=f.fragments[0].cc),h(n.partList,f.partList,function(I,P){P.elementaryStreams=I.elementaryStreams,P.stats=I.stats}),y?D(f,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):d(n,f),c.length&&(f.totalduration=f.edge-c[0].start),f.driftStartTime=n.driftStartTime,f.driftStart=n.driftStart;var _=f.advancedDateTime;if(f.advanced&&_){var b=f.edge;f.driftStart||(f.driftStartTime=_,f.driftStart=b),f.driftEndTime=_,f.driftEnd=b}else f.driftEndTime=n.driftEndTime,f.driftEnd=n.driftEnd,f.advancedDateTime=n.advancedDateTime}function h(n,f,O){if(n&&f)for(var S=0,x=0,w=n.length;x<=w;x++){var T=n[x],y=f[x+S];T&&y&&T.index===y.index&&T.fragment.sn===y.fragment.sn?O(T,y):S--}}function u(n,f,O){for(var S=f.skippedSegments,x=Math.max(n.startSN,f.startSN)-f.startSN,w=(n.fragmentHint?1:0)+(S?f.endSN:Math.min(n.endSN,f.endSN))-f.startSN,T=f.startSN-n.startSN,y=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,v=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,p=x;p<=w;p++){var c=v[T+p],E=y[p];S&&!E&&p<S&&(E=f.fragments[p]=c),c&&E&&O(c,E)}}function d(n,f){var O=f.startSN+f.skippedSegments-n.startSN,S=n.fragments;if(O<0||O>=S.length)return;s(f,S[O].start)}function s(n,f){if(f){for(var O=n.fragments,S=n.skippedSegments;S<O.length;S++)O[S].start+=f;n.fragmentHint&&(n.fragmentHint.start+=f)}}function l(n,f){var O=1e3*n.levelTargetDuration,S=O/2,x=n.age,w=x>0&&x<O*3,T=f.loading.end-f.loading.start,y,v=n.availabilityDelay;if(n.updated===!1)if(w){var p=333*n.misses;y=Math.max(Math.min(S,T*2),p),n.availabilityDelay=(n.availabilityDelay||0)+y}else y=S;else w?(v=Math.min(v||O/2,x),n.availabilityDelay=v,y=v+O-x):y=O-T;return Math.round(y)}function i(n,f,O){if(!n||!n.details)return null;var S=n.details,x=S.fragments[f-S.startSN];return x||(x=S.fragmentHint,x&&x.sn===f?x:f<S.startSN&&O&&O.sn===f?O:null)}function o(n,f,O){if(!n||!n.details)return null;var S=n.details.partList;if(S)for(var x=S.length;x--;){var w=S[x];if(w.index===O&&w.fragment.sn===f)return w}return null}},"./src/controller/stream-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return S});var H=L("./src/polyfills/number.ts"),N=L("./src/controller/base-stream-controller.ts"),R=L("./src/is-supported.ts"),j=L("./src/events.ts"),k=L("./src/utils/buffer-helper.ts"),A=L("./src/controller/fragment-tracker.ts"),D=L("./src/types/loader.ts"),g=L("./src/loader/fragment.ts"),h=L("./src/demux/transmuxer-interface.ts"),u=L("./src/types/transmuxer.ts"),d=L("./src/controller/gap-controller.ts"),s=L("./src/errors.ts"),l=L("./src/utils/logger.ts");function i(x,w){for(var T=0;T<w.length;T++){var y=w[T];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(x,y.key,y)}}function o(x,w,T){return w&&i(x.prototype,w),T&&i(x,T),x}function n(x,w){x.prototype=Object.create(w.prototype),x.prototype.constructor=x,f(x,w)}function f(x,w){return f=Object.setPrototypeOf||function(y,v){return y.__proto__=v,y},f(x,w)}var O=100,S=function(x){n(w,x);function w(y,v){var p;return p=x.call(this,y,v,"[stream-controller]")||this,p.audioCodecSwap=!1,p.gapController=null,p.level=-1,p._forceStartLoad=!1,p.altAudio=!1,p.audioOnly=!1,p.fragPlaying=null,p.onvplaying=null,p.onvseeked=null,p.fragLastKbps=0,p.stalled=!1,p.couldBacktrack=!1,p.audioCodecSwitch=!1,p.videoBuffer=null,p._registerListeners(),p}var T=w.prototype;return T._registerListeners=function(){var v=this.hls;v.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),v.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.on(j.Events.ERROR,this.onError,this),v.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T._unregisterListeners=function(){var v=this.hls;v.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.off(j.Events.ERROR,this.onError,this),v.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},T.startLoad=function(v){if(this.levels){var p=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=c.startLevel;E===-1&&(c.config.testBandwidth?(E=0,this.bitrateTest=!0):E=c.nextAutoLevel),this.level=c.nextLoadLevel=E,this.loadedmetadata=!1}p>0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),v=p),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},T.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},T.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var v,p=this.levels,c=this.level,E=p==null||((v=p[c])===null||v===void 0)?void 0:v.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var _,b=self.performance.now(),I=this.retryDate;(!I||b>=I||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},T.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},T.doTickIdle=function(){var v,p,c=this.hls,E=this.levelLastLoaded,_=this.levels,b=this.media,I=c.config,P=c.nextLoadLevel;if(E===null||!b&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!_||!_[P])return;var B=_[P];this.level=c.nextLoadLevel=P;var z=B.details;if(!z||this.state===N.State.WAITING_LEVEL||z.live&&this.levelLastLoaded!==P){this.state=N.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,D.PlaylistLevelType.MAIN);if(U===null)return;var C=U.len,W=this.getMaxBufferLength(B.maxBitrate);if(C>=W)return;if(this._streamEnded(U,z)){var V={};this.altAudio&&(V.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,V),this.state=N.State.ENDED;return}var J=U.end,ne=this.getNextFragment(J,z);if(this.couldBacktrack&&!this.fragPrevious&&ne&&ne.sn!=="initSegment"){var fe=ne.sn-z.startSN;fe>1&&(ne=z.fragments[fe-1],this.fragmentTracker.removeFragment(ne))}if(ne&&this.fragmentTracker.getState(ne)===A.FragmentState.OK&&this.nextLoadPosition>J){var ue=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ue,D.PlaylistLevelType.MAIN),ne=this.getNextFragment(this.nextLoadPosition,z)}if(!ne)return;ne.initSegment&&!ne.initSegment.data&&!this.bitrateTest&&(ne=ne.initSegment),((v=ne.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((p=ne.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(ne,z):this.loadFragment(ne,z,J)},T.loadFragment=function(v,p,c){var E,_=this.fragmentTracker.getState(v);if(this.fragCurrent=v,_===A.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(v);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else _=A.FragmentState.NOT_LOADED}_===A.FragmentState.NOT_LOADED||_===A.FragmentState.PARTIAL?v.sn==="initSegment"?this._loadInitSegment(v):this.bitrateTest?(v.bitrateTest=!0,this.log("Fragment "+v.sn+" of level "+v.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(v)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,v,p,c)):_===A.FragmentState.APPENDING?this.reduceMaxBufferLength(v.duration)&&this.fragmentTracker.removeFragment(v):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},T.getAppendedFrag=function(v){var p=this.fragmentTracker.getAppendedFrag(v,D.PlaylistLevelType.MAIN);return p&&"fragment"in p?p.fragment:p},T.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,D.PlaylistLevelType.MAIN)},T.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},T.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},T.nextLevelSwitch=function(){var v=this.levels,p=this.media;if(p!=null&&p.readyState){var c,E=this.getAppendedFrag(p.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!p.paused&&v){var _=this.hls.nextLoadLevel,b=v[_],I=this.fragLastKbps;I&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*I)+1:c=0}else c=0;var P=this.getBufferedFrag(p.currentTime+c);if(P){var B=this.followingBufferedFrag(P);if(B){this.abortCurrentFrag();var z=B.maxStartPTS?B.maxStartPTS:B.start,U=B.duration,C=Math.max(P.end,z+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(C,Number.POSITIVE_INFINITY)}}}},T.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},T.flushMainBuffer=function(v,p){x.prototype.flushMainBuffer.call(this,v,p,this.altAudio?"video":null)},T.onMediaAttached=function(v,p){x.prototype.onMediaAttached.call(this,v,p);var c=p.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,c,this.fragmentTracker,this.hls)},T.onMediaDetaching=function(){var v=this.media;v&&(v.removeEventListener("playing",this.onvplaying),v.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},T.onMediaPlaying=function(){this.tick()},T.onMediaSeeked=function(){var v=this.media,p=v?v.currentTime:null;Object(H.isFiniteNumber)(p)&&this.log("Media seeked to "+p.toFixed(3)),this.tick()},T.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},T.onManifestParsed=function(v,p){var c=!1,E=!1,_;p.levels.forEach(function(b){_=b.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(c=!0),_.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=c&&E&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=p.levels,this.startFragRequested=!1},T.onLevelLoading=function(v,p){var c=this.levels;if(!c||this.state!==N.State.IDLE)return;var E=c[p.level];(!E.details||E.details.live&&this.levelLastLoaded!==p.level||this.waitForCdnTuneIn(E.details))&&(this.state=N.State.WAITING_LEVEL)},T.onLevelLoaded=function(v,p){var c,E=this.levels,_=p.level,b=p.details,I=b.totalduration;if(!E){this.warn("Levels were reset while loading level "+_);return}this.log("Level "+_+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+I);var P=this.fragCurrent;P&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(P.level!==p.level&&P.loader&&(this.state=N.State.IDLE,P.loader.abort()));var B=E[_],z=0;if(b.live||(c=B.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;z=this.alignPlaylists(b,B.details)}if(B.details=b,this.levelLastLoaded=_,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:b,level:_}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=N.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,z),this.tick()},T._handleFragmentLoadProgress=function(v){var p,c=v.frag,E=v.part,_=v.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var I=b[c.level],P=I.details;if(!P){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var B=I.videoCodec,z=P.PTSKnown||!P.live,U=(p=c.initSegment)===null||p===void 0?void 0:p.data,C=this._getAudioCodec(I),W=this.transmuxer=this.transmuxer||new h.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),V=E?E.index:-1,J=V!==-1,ne=new u.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,_.byteLength,V,J),fe=this.initPTS[c.cc];W.push(_,U,C,B,c,E,P.totalduration,z,ne,fe)},T.onAudioTrackSwitching=function(v,p){var c=this.altAudio,E=!!p.url,_=p.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;c&&I.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:_})}},T.onAudioTrackSwitched=function(v,p){var c=p.id,E=!!this.hls.audioTracks[c].url;if(E){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=E,this.tick()},T.onBufferCreated=function(v,p){var c=p.tracks,E,_,b=!1;for(var I in c){var P=c[I];if(P.id==="main"){if(_=I,E=P,I==="video"){var B=c[I];B&&(this.videoBuffer=B.buffer)}}else b=!0}b&&E?(this.log("Alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},T.onFragBuffered=function(v,p){var c=p.frag,E=p.part;if(c&&c.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(E?" p: "+E.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var _=E?E.stats:c.stats;this.fragLastKbps=Math.round(8*_.total/(_.buffering.end-_.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,E)},T.onError=function(v,p){switch(p.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,p);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(p.fatal?(this.warn(""+p.details),this.state=N.State.ERROR):!p.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var c=!0,E=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);E&&E.len>.5&&(c=!this.reduceMaxBufferLength(E.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},T.checkBuffer=function(){var v=this.media,p=this.gapController;if(!v||!p||!v.readyState)return;var c=k.BufferHelper.getBuffered(v);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):p.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},T.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},T.onBufferFlushed=function(v,p){var c=p.type;if(c!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(c===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,c,D.PlaylistLevelType.MAIN)}},T.onLevelsUpdated=function(v,p){this.levels=p.levels},T.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},T.seekToStartPos=function(){var v=this.media,p=v.currentTime,c=this.startPosition;if(c>=0&&p<c){if(v.seeking){l.logger.log("could not seek to "+c+", already seeking at "+p);return}var E=k.BufferHelper.getBuffered(v),_=E.length?E.start(0):0,b=_-c;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+b+" to match buffer start"),c+=b,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+p),v.currentTime=c}},T._getAudioCodec=function(v){var p=this.config.defaultAudioCodec||v.audioCodec;return this.audioCodecSwap&&p&&(this.log("Swapping audio codec"),p.indexOf("mp4a.40.5")!==-1?p="mp4a.40.2":p="mp4a.40.5"),p},T._loadBitrateTestFrag=function(v){var p=this;this._doFragLoad(v).then(function(c){var E=p.hls;if(!c||E.nextLoadLevel||p.fragContextChanged(v))return;p.fragLoadError=0,p.state=N.State.IDLE,p.startFragRequested=!1,p.bitrateTest=!1;var _=v.stats;_.parsing.start=_.parsing.end=_.buffering.start=_.buffering.end=self.performance.now(),E.trigger(j.Events.FRAG_LOADED,c)})},T._handleTransmuxComplete=function(v){var p,c="main",E=this.hls,_=v.remuxResult,b=v.chunkMeta,I=this.getCurrentContext(b);if(!I){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var P=I.frag,B=I.part,z=I.level,U=_.video,C=_.text,W=_.id3,V=_.initSegment,J=this.altAudio?void 0:_.audio;if(this.fragContextChanged(P))return;if(this.state=N.State.PARSING,V){V.tracks&&(this._bufferInitSegment(z,V.tracks,P,b),E.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:P,id:c,tracks:V.tracks}));var ne=V.initPTS,fe=V.timescale;Object(H.isFiniteNumber)(ne)&&(this.initPTS[P.cc]=ne,E.trigger(j.Events.INIT_PTS_FOUND,{frag:P,id:c,initPTS:ne,timescale:fe}))}if(U&&_.independent!==!1){if(z.details){var ue=U.startPTS,le=U.endPTS,me=U.startDTS,ge=U.endDTS;if(B)B.elementaryStreams[U.type]={startPTS:ue,endPTS:le,startDTS:me,endDTS:ge};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var re=this.getLoadPosition()+this.config.maxBufferHole;if(re<ue){this.backtrack(P);return}P.setElementaryStreamInfo(U.type,P.start,le,P.start,ge,!0)}P.setElementaryStreamInfo(U.type,ue,le,me,ge),this.bufferFragmentData(U,P,B,b)}}else if(_.independent===!1){this.backtrack(P);return}if(J){var oe=J.startPTS,xe=J.endPTS,Be=J.startDTS,Ve=J.endDTS;B&&(B.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:xe,startDTS:Be,endDTS:Ve}),P.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,oe,xe,Be,Ve),this.bufferFragmentData(J,P,B,b)}if(W!=null&&(p=W.samples)!==null&&p!==void 0&&p.length){var Ye={frag:P,id:c,samples:W.samples};E.trigger(j.Events.FRAG_PARSING_METADATA,Ye)}if(C){var $e={frag:P,id:c,samples:C.samples};E.trigger(j.Events.FRAG_PARSING_USERDATA,$e)}},T._bufferInitSegment=function(v,p,c,E){var _=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!p.audio&&!p.video,this.altAudio&&!this.audioOnly&&delete p.audio;var b=p.audio,I=p.video,P=p.audiovideo;if(b){var B=v.audioCodec,z=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(B&&(B.indexOf("mp4a.40.5")!==-1?B="mp4a.40.2":B="mp4a.40.5"),b.metadata.channelCount!==1&&z.indexOf("firefox")===-1&&(B="mp4a.40.5")),z.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(B="mp4a.40.2",this.log("Android: force audio codec to "+B)),v.audioCodec&&v.audioCodec!==B&&this.log('Swapping manifest audio codec "'+v.audioCodec+'" for "'+B+'"'),b.levelCodec=B,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(B||"")+"/"+(v.audioCodec||"")+"/"+b.codec+"]")}I&&(I.levelCodec=v.videoCodec,I.id="main",this.log("Init video buffer, container:"+I.container+", codecs[level/parsed]=["+(v.videoCodec||"")+"/"+I.codec+"]")),P&&this.log("Init audiovideo buffer, container:"+P.container+", codecs[level/parsed]=["+(v.attrs.CODECS||"")+"/"+P.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,p),Object.keys(p).forEach(function(U){var C=p[U],W=C.initSegment;W!=null&&W.byteLength&&_.hls.trigger(j.Events.BUFFER_APPENDING,{type:U,data:W,frag:c,part:null,chunkMeta:E,parent:c.type})}),this.tick()},T.backtrack=function(v){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(v);var p=this.fragmentTracker.backtrack(v);this.fragPrevious=null,this.nextLoadPosition=v.start,p?this.resetFragmentLoading(v):this.state=N.State.BACKTRACKING},T.checkFragmentChanged=function(){var v=this.media,p=null;if(v&&v.readyState>1&&v.seeking===!1){var c=v.currentTime;if(k.BufferHelper.isBuffered(v,c)?p=this.getAppendedFrag(c):k.BufferHelper.isBuffered(v,c+.1)&&(p=this.getAppendedFrag(c+.1)),p){var E=this.fragPlaying,_=p.level;(!E||p.sn!==E.sn||E.level!==_||p.urlId!==E.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:p}),(!E||E.level!==_)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:_}),this.fragPlaying=p)}}},o(w,[{key:"nextLevel",get:function(){var v=this.nextBufferedFrag;return v?v.level:-1}},{key:"currentLevel",get:function(){var v=this.media;if(v){var p=this.getAppendedFrag(v.currentTime);if(p)return p.level}return-1}},{key:"nextBufferedFrag",get:function(){var v=this.media;if(v){var p=this.getAppendedFrag(v.currentTime);return this.followingBufferedFrag(p)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"SubtitleStreamController",function(){return n});var H=L("./src/events.ts"),N=L("./src/utils/logger.ts"),R=L("./src/utils/buffer-helper.ts"),j=L("./src/controller/fragment-finders.ts"),k=L("./src/utils/discontinuities.ts"),A=L("./src/controller/level-helper.ts"),D=L("./src/controller/fragment-tracker.ts"),g=L("./src/controller/base-stream-controller.ts"),h=L("./src/types/loader.ts"),u=L("./src/types/level.ts");function d(f,O){for(var S=0;S<O.length;S++){var x=O[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(f,x.key,x)}}function s(f,O,S){return O&&d(f.prototype,O),S&&d(f,S),f}function l(f,O){f.prototype=Object.create(O.prototype),f.prototype.constructor=f,i(f,O)}function i(f,O){return i=Object.setPrototypeOf||function(x,w){return x.__proto__=w,x},i(f,O)}var o=500,n=function(f){l(O,f);function O(x,w){var T;return T=f.call(this,x,w,"[subtitle-stream-controller]")||this,T.levels=[],T.currentTrackId=-1,T.tracksBuffered=[],T.mainDetails=null,T._registerListeners(),T}var S=O.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var w=this.hls;w.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(H.Events.ERROR,this.onError,this),w.on(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(H.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(H.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S._unregisterListeners=function(){var w=this.hls;w.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(H.Events.ERROR,this.onError,this),w.off(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(H.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(H.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(o),this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(w,T){this.mainDetails=T.details},S.onSubtitleFragProcessed=function(w,T){var y=T.frag,v=T.success;if(this.fragPrevious=y,this.state=g.State.IDLE,!v)return;var p=this.tracksBuffered[this.currentTrackId];if(!p)return;for(var c,E=y.start,_=0;_<p.length;_++)if(E>=p[_].start&&E<=p[_].end){c=p[_];break}var b=y.start+y.duration;c?c.end=b:(c={start:E,end:b},p.push(c)),this.fragmentTracker.fragBuffered(y)},S.onBufferFlushing=function(w,T){var y=T.startOffset,v=T.endOffset;if(y===0&&v!==Number.POSITIVE_INFINITY){var p=this.currentTrackId,c=this.levels;if(!c.length||!c[p]||!c[p].details)return;var E=c[p].details,_=E.targetduration,b=v-_;if(b<=0)return;T.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(I){for(var P=0;P<I.length;){if(I[P].end<=b){I.shift();continue}else if(I[P].start<b)I[P].start=b;else break;P++}}),this.fragmentTracker.removeFragmentsInRange(y,b,h.PlaylistLevelType.SUBTITLE)}},S.onError=function(w,T){var y,v=T.frag;if(!v||v.type!==h.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},S.onSubtitleTracksUpdated=function(w,T){var y=this,v=T.subtitleTracks;this.tracksBuffered=[],this.levels=v.map(function(p){return new u.Level(p)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(p){y.tracksBuffered[p.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(w,T){if(this.currentTrackId=T.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(o)},S.onSubtitleTrackLoaded=function(w,T){var y,v=T.details,p=T.id,c=this.currentTrackId,E=this.levels;if(!E.length)return;var _=E[c];if(p>=E.length||p!==c||!_)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(y=_.details)!==null&&y!==void 0&&y.live){var b=this.mainDetails;if(v.deltaUpdateFailed||!b)return;var I=b.fragments[0];if(!_.details)v.hasProgramDateTime&&b.hasProgramDateTime?Object(k.alignMediaPlaylistByPDT)(v,b):I&&Object(A.addSliding)(v,I.start);else{var P=this.alignPlaylists(v,_.details);P===0&&I&&Object(A.addSliding)(v,I.start)}}if(_.details=v,this.levelLastLoaded=p,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var B=Object(j.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);B||(this.warn("Subtitle playlist not aligned with playback"),_.details=void 0)}},S._handleFragmentLoadComplete=function(w){var T=w.frag,y=w.payload,v=T.decryptdata,p=this.hls;if(this.fragContextChanged(T))return;if(y&&y.byteLength>0&&v&&v.key&&v.iv&&v.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),v.key.buffer,v.iv.buffer).then(function(E){var _=performance.now();p.trigger(H.Events.FRAG_DECRYPTED,{frag:T,payload:E,stats:{tstart:c,tdecrypt:_}})})}},S.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var w,T=this.currentTrackId,y=this.levels;if(!y.length||!y[T]||!y[T].details)return;var v=y[T].details,p=v.targetduration,c=this.config,E=this.media,_=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-p,c.maxBufferHole),b=_.end,I=_.len,P=this.getMaxBufferLength()+p;if(I>P)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var B=v.fragments,z=B.length,U=v.edge,C,W=this.fragPrevious;if(b<U){var V=c.maxFragLookUpTolerance;W&&v.hasProgramDateTime&&(C=Object(j.findFragmentByPDT)(B,W.endProgramDateTime,V)),C||(C=Object(j.findFragmentByPTS)(W,B,b,V),!C&&W&&W.start<B[0].start&&(C=B[0]))}else C=B[z-1];(w=C)!==null&&w!==void 0&&w.encrypted?(N.logger.log("Loading key for "+C.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(H.Events.KEY_LOADING,{frag:C})):C&&this.fragmentTracker.getState(C)===D.FragmentState.NOT_LOADED&&this.loadFragment(C,v,b)}},S.loadFragment=function(w,T,y){this.fragCurrent=w,f.prototype.loadFragment.call(this,w,T,y)},s(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(g.default)},"./src/controller/subtitle-track-controller.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/events.ts"),N=L("./src/utils/texttrack-utils.ts"),R=L("./src/controller/base-playlist-controller.ts"),j=L("./src/types/loader.ts");function k(d,s){for(var l=0;l<s.length;l++){var i=s[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(d,i.key,i)}}function A(d,s,l){return s&&k(d.prototype,s),l&&k(d,l),d}function D(d,s){d.prototype=Object.create(s.prototype),d.prototype.constructor=d,g(d,s)}function g(d,s){return g=Object.setPrototypeOf||function(i,o){return i.__proto__=o,i},g(d,s)}var h=function(d){D(s,d);function s(i){var o;return o=d.call(this,i,"[subtitle-track-controller]")||this,o.media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o.subtitleDisplay=!0,o.registerListeners(),o}var l=s.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,d.prototype.destroy.call(this)},l.registerListeners=function(){var o=this.hls;o.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(H.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(H.Events.ERROR,this.onError,this)},l.onMediaAttached=function(o,n){if(this.media=n.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)},l.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},l.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 o=u(this.media.textTracks);o.forEach(function(n){Object(N.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(o,n){this.tracks=n.subtitleTracks},l.onSubtitleTrackLoaded=function(o,n){var f=n.id,O=n.details,S=this.trackId,x=this.tracksInGroup[S];if(!x){this.warn("Invalid subtitle track id "+f);return}var w=x.details;x.details=n.details,this.log("subtitle track "+f+" loaded ["+O.startSN+"-"+O.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,n,w))},l.onLevelLoading=function(o,n){this.switchLevel(n.level)},l.onLevelSwitching=function(o,n){this.switchLevel(n.level)},l.switchLevel=function(o){var n=this.hls.levels[o];if(!(n!=null&&n.textGroupIds))return;var f=n.textGroupIds[n.urlId];if(this.groupId!==f){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,S=this.tracks.filter(function(T){return!f||T.groupId===f});this.tracksInGroup=S;var x=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=f;var w={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(H.Events.SUBTITLE_TRACKS_UPDATED,w),x!==-1&&this.setSubtitleTrack(x,O)}},l.findTrackId=function(o){for(var n=this.tracksInGroup,f=0;f<n.length;f++){var O=n[f];if((!this.selectDefaultTrack||O.default)&&(!o||o===O.name))return O.id}return-1},l.onError=function(o,n){if(d.prototype.onError.call(this,o,n),n.fatal||!n.context)return;n.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},l.loadPlaylist=function(o){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var f=n.id,O=n.groupId,S=n.url;if(o)try{S=o.addDirectives(S)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(H.Events.SUBTITLE_TRACK_LOADING,{url:S,id:f,groupId:O,deliveryDirectives:o||null})}},l.toggleTrackModes=function(o){var n=this,f=this.media,O=this.subtitleDisplay,S=this.trackId;if(!f)return;var x=u(f.textTracks),w=x.filter(function(v){return v.groupId===n.groupId});if(o===-1)[].slice.call(x).forEach(function(v){v.mode="disabled"});else{var T=w[S];T&&(T.mode="disabled")}var y=w[o];y&&(y.mode=O?"showing":"hidden")},l.setSubtitleTrack=function(o,n){var f,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(f=O[o])!==null&&f!==void 0&&f.details)||o<-1||o>=O.length)return;this.clearTimer();var S=O[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,S){var x=S.id,w=S.groupId,T=w===void 0?"":w,y=S.name,v=S.type,p=S.url;this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:T,name:y,type:v,url:p});var c=this.switchParams(S.url,n==null?void 0:n.details);this.loadPlaylist(c)}else this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:o})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,n=u(this.media.textTracks),f=0;f<n.length;f++)if(n[f].mode==="hidden")o=f;else if(n[f].mode==="showing"){o=f;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},A(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,n)}}]),s}(R.default);function u(d){for(var s=[],l=0;l<d.length;l++){var i=d[l];i.kind==="subtitles"&&i.label&&s.push(d[l])}return s}K.default=h},"./src/controller/timeline-controller.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"TimelineController",function(){return u});var H=L("./src/polyfills/number.ts"),N=L("./src/events.ts"),R=L("./src/utils/cea-608-parser.ts"),j=L("./src/utils/output-filter.ts"),k=L("./src/utils/webvtt-parser.ts"),A=L("./src/utils/texttrack-utils.ts"),D=L("./src/utils/imsc1-ttml-parser.ts"),g=L("./src/types/loader.ts"),h=L("./src/utils/logger.ts"),u=function(){function i(n){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=l(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.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 f=new j.default(this,"textTrack1"),O=new j.default(this,"textTrack2"),S=new j.default(this,"textTrack3"),x=new j.default(this,"textTrack4");this.cea608Parser1=new R.default(1,f,O),this.cea608Parser2=new R.default(3,S,x)}n.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(N.Events.FRAG_LOADING,this.onFragLoading,this),n.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=i.prototype;return o.destroy=function(){var f=this.hls;f.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.off(N.Events.FRAG_LOADING,this.onFragLoading,this),f.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.off(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(f,O,S,x,w){for(var T=!1,y=w.length;y--;){var v=w[y],p=s(v[0],v[1],O,S);if(p>=0&&(v[0]=Math.min(v[0],O),v[1]=Math.max(v[1],S),T=!0,p/(S-O)>.5))return}if(T||w.push([O,S]),this.config.renderTextTracksNatively){var c=this.captionsTracks[f];this.Cues.newCue(c,O,S,x)}else{var E=this.Cues.newCue(null,O,S,x);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:E,track:f})}},o.onInitPtsFound=function(f,O){var S=this,x=O.frag,w=O.id,T=O.initPTS,y=O.timescale,v=this.unparsedVttFrags;w==="main"&&(this.initPTS[x.cc]=T,this.timescale[x.cc]=y),v.length&&(this.unparsedVttFrags=[],v.forEach(function(p){S.onFragLoaded(N.Events.FRAG_LOADED,p)}))},o.getExistingTrack=function(f){var O=this.media;if(O)for(var S=0;S<O.textTracks.length;S++){var x=O.textTracks[S];if(x[f])return x}return null},o.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},o.createNativeTrack=function(f){if(this.captionsTracks[f])return;var O=this.captionsProperties,S=this.captionsTracks,x=this.media,w=O[f],T=w.label,y=w.languageCode,v=this.getExistingTrack(f);if(v)S[f]=v,Object(A.clearCurrentCues)(S[f]),Object(A.sendAddTrackEvent)(S[f],x);else{var p=this.createTextTrack("captions",T,y);p&&(p[f]=!0,S[f]=p)}},o.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var O=this.captionsProperties[f];if(!O)return;var S=O.label,x={_id:f,label:S,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[f]=x,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},o.createTextTrack=function(f,O,S){var x=this.media;return x?x.addTextTrack(f,O,S):void 0},o.onMediaAttaching=function(f,O){this.media=O.media,this._cleanTracks()},o.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(O){Object(A.clearCurrentCues)(f[O]),delete f[O]}),this.nonNativeCaptionsTracks={}},o.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),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())},o._cleanTracks=function(){var f=this.media;if(!f)return;var O=f.textTracks;if(O)for(var S=0;S<O.length;S++)Object(A.clearCurrentCues)(O[S])},o.onSubtitleTracksUpdated=function(f,O){var S=this;this.textTracks=[];var x=O.subtitleTracks||[],w=x.some(function(p){return p.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var T=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(p,c){var E;if(c<y.length){for(var _=null,b=0;b<y.length;b++)if(d(y[b],p)){_=y[b];break}_&&(E=_)}E?Object(A.clearCurrentCues)(E):(E=S.createTextTrack("subtitles",p.name,p.lang),E&&(E.mode="disabled")),E&&(E.groupId=p.groupId,S.textTracks.push(E))})}else if(!T&&this.tracks&&this.tracks.length){var v=this.tracks.map(function(p){return{label:p.name,kind:p.type.toLowerCase(),default:p.default,subtitleTrack:p}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:v})}}},o.onManifestLoaded=function(f,O){var S=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(x){var w=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!w)return;var T="textTrack"+w[1],y=S.captionsProperties[T];if(!y)return;y.label=x.name,x.lang&&(y.languageCode=x.lang),y.media=x})},o.onFragLoading=function(f,O){var S=this.cea608Parser1,x=this.cea608Parser2,w=this.lastSn,T=this.lastPartIndex;if(!this.enabled||!(S&&x))return;if(O.frag.type===g.PlaylistLevelType.MAIN){var y,v,p=O.frag.sn,c=(y=O==null||((v=O.part)===null||v===void 0)?void 0:v.index)!=null?y:-1;p===w+1||p===w&&c===T+1||(S.reset(),x.reset()),this.lastSn=p,this.lastPartIndex=c}},o.onFragLoaded=function(f,O){var S=O.frag,x=O.payload,w=this.initPTS,T=this.unparsedVttFrags;if(S.type===g.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(H.isFiniteNumber)(w[S.cc])){T.push(O),w.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Missing initial subtitle PTS")});return}var y=S.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var v=this.tracks[S.level],p=this.vttCCs;p[S.cc]||(p[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc),v&&v.textCodec===D.IMSC1_CODEC?this._parseIMSC1(S,x):this._parseVTTs(S,x,p)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(f,O){var S=this,x=this.hls;Object(D.parseIMSC1)(O,this.initPTS[f.cc],this.timescale[f.cc],function(w){S._appendCues(w,f.level),x.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(w){h.logger.log("Failed to parse IMSC1: "+w),x.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:w})})},o._parseVTTs=function(f,O,S){var x=this,w=this.hls;Object(k.parseWebVTT)(O,this.initPTS[f.cc],this.timescale[f.cc],S,f.cc,f.start,function(T){x._appendCues(T,f.level),w.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(T){x._fallbackToIMSC1(f,O),h.logger.log("Failed to parse VTT cue: "+T),w.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:T})})},o._fallbackToIMSC1=function(f,O){var S=this,x=this.tracks[f.level];x.textCodec||Object(D.parseIMSC1)(O,this.initPTS[f.cc],this.timescale[f.cc],function(){x.textCodec=D.IMSC1_CODEC,S._parseIMSC1(f,O)},function(){x.textCodec="wvtt"})},o._appendCues=function(f,O){var S=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[O];if(x.mode==="disabled")return;f.forEach(function(y){return Object(A.addCueToTrack)(x,y)})}else{var w=this.tracks[O],T=w.default?"default":"subtitles"+O;S.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:f,track:T})}},o.onFragDecrypted=function(f,O){var S=O.frag;if(S.type===g.PlaylistLevelType.SUBTITLE){if(!Object(H.isFiniteNumber)(this.initPTS[S.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(N.Events.FRAG_LOADED,O)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(f,O){var S=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(S&&x))return;for(var w=0;w<O.samples.length;w++){var T=O.samples[w].bytes;if(T){var y=this.extractCea608Data(T);S.addData(O.samples[w].pts,y[0]),x.addData(O.samples[w].pts,y[1])}}},o.onBufferFlushing=function(f,O){var S=O.startOffset,x=O.endOffset,w=O.endOffsetSubtitles,T=O.type,y=this.media;if(!y||y.currentTime<x)return;if(!T||T==="video"){var v=this.captionsTracks;Object.keys(v).forEach(function(c){return Object(A.removeCuesInRange)(v[c],S,x)})}if(this.config.renderTextTracksNatively&&(S===0&&w!==void 0)){var p=this.textTracks;Object.keys(p).forEach(function(c){return Object(A.removeCuesInRange)(p[c],S,w)})}},o.extractCea608Data=function(f){for(var O=f[0]&31,S=2,x=[[],[]],w=0;w<O;w++){var T=f[S++],y=127&f[S++],v=127&f[S++],p=(4&T)!==0,c=3&T;if(y===0&&v===0)continue;p&&((c===0||c===1)&&(x[c].push(y),x[c].push(v)))}return x},i}();function d(i,o){return i&&i.label===o.name&&!(i.textTrack1||i.textTrack2)}function s(i,o,n,f){return Math.min(o,f)-Math.max(i,n)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return H});var H=function(){function N(j,k){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=k}var R=N.prototype;return R.decrypt=function(k,A){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},A,k)},N}()},"./src/crypt/aes-decryptor.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"removePadding",function(){return N}),L.d(K,"default",function(){return R});var H=L("./src/utils/typed-array.ts");function N(j){var k=j.byteLength,A=k&&new DataView(j.buffer).getUint8(k-1);return A?Object(H.sliceUint8)(j,0,k-A):j}var R=function(){function j(){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 k=j.prototype;return k.uint8ArrayToUint32Array_=function(D){for(var g=new DataView(D),h=new Uint32Array(4),u=0;u<4;u++)h[u]=g.getUint32(u*4);return h},k.initTable=function(){var D=this.sBox,g=this.invSBox,h=this.subMix,u=h[0],d=h[1],s=h[2],l=h[3],i=this.invSubMix,o=i[0],n=i[1],f=i[2],O=i[3],S=new Uint32Array(256),x=0,w=0,T=0;for(T=0;T<256;T++)T<128?S[T]=T<<1:S[T]=T<<1^283;for(T=0;T<256;T++){var y=w^w<<1^w<<2^w<<3^w<<4;y=y>>>8^y&255^99,D[x]=y,g[y]=x;var v=S[x],p=S[v],c=S[p],E=S[y]*257^y*16843008;u[x]=E<<24|E>>>8,d[x]=E<<16|E>>>16,s[x]=E<<8|E>>>24,l[x]=E,E=c*16843009^p*65537^v*257^x*16843008,o[y]=E<<24|E>>>8,n[y]=E<<16|E>>>16,f[y]=E<<8|E>>>24,O[y]=E,x?(x=v^S[S[S[c^v]]],w^=S[S[w]]):x=w=1}},k.expandKey=function(D){for(var g=this.uint8ArrayToUint32Array_(D),h=!0,u=0;u<g.length&&h;)h=g[u]===this.key[u],u++;if(h)return;this.key=g;var d=this.keySize=g.length;if(d!==4&&d!==6&&d!==8)throw new Error("Invalid aes key size="+d);var s=this.ksRows=(d+6+1)*4,l,i,o=this.keySchedule=new Uint32Array(s),n=this.invKeySchedule=new Uint32Array(s),f=this.sBox,O=this.rcon,S=this.invSubMix,x=S[0],w=S[1],T=S[2],y=S[3],v,p;for(l=0;l<s;l++){if(l<d){v=o[l]=g[l];continue}p=v,l%d===0?(p=p<<8|p>>>24,p=f[p>>>24]<<24|f[p>>>16&255]<<16|f[p>>>8&255]<<8|f[p&255],p^=O[l/d|0]<<24):d>6&&l%d===4&&(p=f[p>>>24]<<24|f[p>>>16&255]<<16|f[p>>>8&255]<<8|f[p&255]),o[l]=v=(o[l-d]^p)>>>0}for(i=0;i<s;i++)l=s-i,i&3?p=o[l]:p=o[l-4],i<4||l<=4?n[i]=p:n[i]=x[f[p>>>24]]^w[f[p>>>16&255]]^T[f[p>>>8&255]]^y[f[p&255]],n[i]=n[i]>>>0},k.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},k.decrypt=function(D,g,h){for(var u=this.keySize+6,d=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,i=l[0],o=l[1],n=l[2],f=l[3],O=this.uint8ArrayToUint32Array_(h),S=O[0],x=O[1],w=O[2],T=O[3],y=new Int32Array(D),v=new Int32Array(y.length),p,c,E,_,b,I,P,B,z,U,C,W,V,J,ne=this.networkToHostOrderSwap;g<y.length;){for(z=ne(y[g]),U=ne(y[g+1]),C=ne(y[g+2]),W=ne(y[g+3]),b=z^d[0],I=W^d[1],P=C^d[2],B=U^d[3],V=4,J=1;J<u;J++)p=i[b>>>24]^o[I>>16&255]^n[P>>8&255]^f[B&255]^d[V],c=i[I>>>24]^o[P>>16&255]^n[B>>8&255]^f[b&255]^d[V+1],E=i[P>>>24]^o[B>>16&255]^n[b>>8&255]^f[I&255]^d[V+2],_=i[B>>>24]^o[b>>16&255]^n[I>>8&255]^f[P&255]^d[V+3],b=p,I=c,P=E,B=_,V=V+4;p=s[b>>>24]<<24^s[I>>16&255]<<16^s[P>>8&255]<<8^s[B&255]^d[V],c=s[I>>>24]<<24^s[P>>16&255]<<16^s[B>>8&255]<<8^s[b&255]^d[V+1],E=s[P>>>24]<<24^s[B>>16&255]<<16^s[b>>8&255]<<8^s[I&255]^d[V+2],_=s[B>>>24]<<24^s[b>>16&255]<<16^s[I>>8&255]<<8^s[P&255]^d[V+3],v[g]=ne(p^S),v[g+1]=ne(_^x),v[g+2]=ne(E^w),v[g+3]=ne(c^T),S=z,x=U,w=C,T=W,g=g+4}return v.buffer},j}()},"./src/crypt/decrypter.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return g});var H=L("./src/crypt/aes-crypto.ts"),N=L("./src/crypt/fast-aes-key.ts"),R=L("./src/crypt/aes-decryptor.ts"),j=L("./src/utils/logger.ts"),k=L("./src/utils/mp4-tools.ts"),A=L("./src/utils/typed-array.ts"),D=16,g=function(){function h(d,s,l){var i=l===void 0?{}:l,o=i.removePKCS7Padding,n=o===void 0?!0:o;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=d,this.config=s,this.removePKCS7Padding=n,n)try{var f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var u=h.prototype;return u.destroy=function(){this.observer=null},u.isSync=function(){return this.config.enableSoftwareAES},u.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var l=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(l):l},u.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},u.decrypt=function(s,l,i,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),l,i);var n=this.flush();n&&o(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),l,i).then(o)},u.softwareDecrypt=function(s,l,i){var o=this.currentIV,n=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(s=Object(k.appendUint8Array)(f,s),this.remainderData=null);var O=this.getValidChunk(s);if(!O.length)return null;o&&(i=o);var S=this.softwareDecrypter;S||(S=this.softwareDecrypter=new R.default),S.expandKey(l);var x=n;return this.currentResult=S.decrypt(O.buffer,0,i),this.currentIV=Object(A.sliceUint8)(O,-16).buffer,x||null},u.webCryptoDecrypt=function(s,l,i){var o=this,n=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new N.default(n,l)),this.fastAesKey.expandKey().then(function(f){if(!n)return Promise.reject(new Error("web crypto not initialized"));var O=new H.default(n,i);return O.decrypt(s.buffer,f)}).catch(function(f){return o.onWebCryptoError(f,s,l,i)})},u.onWebCryptoError=function(s,l,i,o){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,i,o)},u.getValidChunk=function(s){var l=s,i=s.length-s.length%D;return i!==s.length&&(l=Object(A.sliceUint8)(s,0,i),this.remainderData=Object(A.sliceUint8)(s,i)),l},u.logOnce=function(s){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},h}()},"./src/crypt/fast-aes-key.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return H});var H=function(){function N(j,k){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=k}var R=N.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/demux/base-audio-demuxer.ts"),N=L("./src/demux/adts.ts"),R=L("./src/utils/logger.ts"),j=L("./src/demux/id3.ts");function k(g,h){g.prototype=Object.create(h.prototype),g.prototype.constructor=g,A(g,h)}function A(g,h){return A=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},A(g,h)}var D=function(g){k(h,g);function h(d,s){var l;return l=g.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=d,l.config=s,l}var u=h.prototype;return u.resetInitSegment=function(s,l,i){g.prototype.resetInitSegment.call(this,s,l,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},h.probe=function(s){if(!s)return!1;for(var l=j.getID3Data(s,0)||[],i=l.length,o=s.length;i<o;i++)if(N.probe(s,i))return R.logger.log("ADTS sync word found !"),!0;return!1},u.canParse=function(s,l){return N.canParse(s,l)},u.appendFrame=function(s,l,i){N.initTrackConfig(s,this.observer,l,i,s.manifestCodec);var o=N.appendFrame(s,l,i,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},h}(H.default);D.minProbeByteLength=9,K.default=D},"./src/demux/adts.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"getAudioConfig",function(){return j}),L.d(K,"isHeaderPattern",function(){return k}),L.d(K,"getHeaderLength",function(){return A}),L.d(K,"getFullFrameLength",function(){return D}),L.d(K,"canGetFrameLength",function(){return g}),L.d(K,"isHeader",function(){return h}),L.d(K,"canParse",function(){return u}),L.d(K,"probe",function(){return d}),L.d(K,"initTrackConfig",function(){return s}),L.d(K,"getFrameDuration",function(){return l}),L.d(K,"parseFrameHeader",function(){return i}),L.d(K,"appendFrame",function(){return o});var H=L("./src/utils/logger.ts"),N=L("./src/errors.ts"),R=L("./src/events.ts");function j(n,f,O,S){var x,w,T,y,v=navigator.userAgent.toLowerCase(),p=S,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((f[O+2]&192)>>>6)+1;var E=(f[O+2]&60)>>>2;if(E>c.length-1){n.trigger(R.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return T=(f[O+2]&1)<<2,T|=(f[O+3]&192)>>>6,H.logger.log("manifest codec:"+S+", ADTS type:"+x+", samplingIndex:"+E),/firefox/i.test(v)?E>=6?(x=5,y=new Array(4),w=E-3):(x=2,y=new Array(2),w=E):v.indexOf("android")!==-1?(x=2,y=new Array(2),w=E):(x=5,y=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&E>=6?w=E-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(E>=6&&T===1||/vivaldi/i.test(v))||!S&&T===1)&&(x=2,y=new Array(2)),w=E)),y[0]=x<<3,y[0]|=(E&14)>>1,y[1]|=(E&1)<<7,y[1]|=T<<3,x===5&&(y[1]|=(w&14)>>1,y[2]=(w&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:c[E],channelCount:T,codec:"mp4a.40."+x,manifestCodec:p}}function k(n,f){return n[f]===255&&(n[f+1]&246)===240}function A(n,f){return n[f+1]&1?7:9}function D(n,f){return(n[f+3]&3)<<11|n[f+4]<<3|(n[f+5]&224)>>>5}function g(n,f){return f+5<n.length}function h(n,f){return f+1<n.length&&k(n,f)}function u(n,f){return g(n,f)&&k(n,f)&&D(n,f)<=n.length-f}function d(n,f){if(h(n,f)){var O=A(n,f);if(f+O>=n.length)return!1;var S=D(n,f);if(S<=O)return!1;var x=f+S;return x===n.length||h(n,x)}return!1}function s(n,f,O,S,x){if(!n.samplerate){var w=j(f,O,S,x);if(!w)return;n.config=w.config,n.samplerate=w.samplerate,n.channelCount=w.channelCount,n.codec=w.codec,n.manifestCodec=w.manifestCodec,H.logger.log("parsed codec:"+n.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function l(n){return 1024*9e4/n}function i(n,f,O,S,x){var w=A(n,f),T=D(n,f);if(T-=w,T>0){var y=O+S*x;return{headerLength:w,frameLength:T,stamp:y}}}function o(n,f,O,S,x){var w=l(n.samplerate),T=i(f,O,S,x,w);if(T){var y=T.frameLength,v=T.headerLength,p=T.stamp,c=v+y,E=Math.max(0,O+c-f.length),_;E?(_=new Uint8Array(c-v),_.set(f.subarray(O+v,f.length),0)):_=f.subarray(O+v,O+c);var b={unit:_,pts:p};return E||n.samples.push(b),{sample:b,length:c,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"initPTSFn",function(){return D});var H=L("./src/polyfills/number.ts"),N=L("./src/demux/id3.ts"),R=L("./src/demux/dummy-demuxed-track.ts"),j=L("./src/utils/mp4-tools.ts"),k=L("./src/utils/typed-array.ts"),A=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var h=g.prototype;return h.resetInitSegment=function(d,s,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},h.resetTimeStamp=function(){},h.resetContiguity=function(){},h.canParse=function(d,s){return!1},h.appendFrame=function(d,s,l){},h.demux=function(d,s){this.cachedData&&(d=Object(j.appendUint8Array)(this.cachedData,d),this.cachedData=null);var l=N.getID3Data(d,0),i=l?l.length:0,o,n,f=this._audioTrack,O=this._id3Track,S=l?N.getTimeStamp(l):void 0,x=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(S,s)),l&&l.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),n=this.initPTS;i<x;){if(this.canParse(d,i)){var w=this.appendFrame(f,d,i);w?(this.frameIndex++,n=w.sample.pts,i+=w.length,o=i):i=x}else N.canParse(d,i)?(l=N.getID3Data(d,i),O.samples.push({pts:n,dts:n,data:l}),i+=l.length,o=i):i++;if(i===x&&o!==x){var T=Object(k.sliceUint8)(d,o);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,T):this.cachedData=T}}return{audioTrack:f,avcTrack:Object(R.dummyTrack)(),id3Track:O,textTrack:Object(R.dummyTrack)()}},h.demuxSampleAes=function(d,s,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},h.flush=function(d){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},h.destroy=function(){},g}(),D=function(h,u){return Object(H.isFiniteNumber)(h)?h*90:u*9e4};K.default=A},"./src/demux/chunk-cache.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return H});var H=function(){function R(){this.chunks=[],this.dataLength=0}var j=R.prototype;return j.push=function(A){this.chunks.push(A),this.dataLength+=A.length},j.flush=function(){var A=this.chunks,D=this.dataLength,g;if(A.length)A.length===1?g=A[0]:g=N(A,D);else return new Uint8Array(0);return this.reset(),g},j.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function N(R,j){for(var k=new Uint8Array(j),A=0,D=0;D<R.length;D++){var g=R[D];k.set(g,A),A+=g.length}return k}},"./src/demux/dummy-demuxed-track.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"dummyTrack",function(){return H});function H(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/utils/logger.ts"),N=function(){function R(k){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=k,this.bytesAvailable=k.byteLength,this.word=0,this.bitsAvailable=0}var j=R.prototype;return j.loadWord=function(){var A=this.data,D=this.bytesAvailable,g=A.byteLength-D,h=new Uint8Array(4),u=Math.min(4,D);if(u===0)throw new Error("no bytes available");h.set(A.subarray(g,g+u)),this.word=new DataView(h.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u},j.skipBits=function(A){var D;this.bitsAvailable>A?(this.word<<=A,this.bitsAvailable-=A):(A-=this.bitsAvailable,D=A>>3,A-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=A,this.bitsAvailable-=A)},j.readBits=function(A){var D=Math.min(this.bitsAvailable,A),g=this.word>>>32-D;return A>32&&H.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=A-D,D>0&&this.bitsAvailable?g<<D|this.readBits(D):g},j.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()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var A=this.skipLZ();return this.readBits(A+1)-1},j.readEG=function(){var A=this.readUEG();return 1&A?1+A>>>1:-1*(A>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(A){for(var D=8,g=8,h,u=0;u<A;u++)g!==0&&(h=this.readEG(),g=(D+h+256)%256),D=g===0?D:g},j.readSPS=function(){var A=0,D=0,g=0,h=0,u,d,s,l=this.readUByte.bind(this),i=this.readBits.bind(this),o=this.readUEG.bind(this),n=this.readBoolean.bind(this),f=this.skipBits.bind(this),O=this.skipEG.bind(this),S=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);l();var w=l();if(i(5),f(3),l(),S(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var T=o();if(T===3&&f(1),S(),S(),f(1),n())for(d=T!==3?8:12,s=0;s<d;s++)n()&&(s<6?x(16):x(64))}S();var y=o();if(y===0)o();else if(y===1)for(f(1),O(),O(),u=o(),s=0;s<u;s++)O();S(),f(1);var v=o(),p=o(),c=i(1);c===0&&f(1),f(1),n()&&(A=o(),D=o(),g=o(),h=o());var E=[1,1];if(n()&&n()){var _=l();switch(_){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((v+1)*16-A*2-D*2),height:(2-c)*(p+1)*16-(c?2:4)*(g+h),pixelRatio:E}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();K.default=N},"./src/demux/id3.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"isHeader",function(){return H}),L.d(K,"isFooter",function(){return N}),L.d(K,"getID3Data",function(){return R}),L.d(K,"canParse",function(){return k}),L.d(K,"getTimeStamp",function(){return A}),L.d(K,"isTimeStampFrame",function(){return D}),L.d(K,"getID3Frames",function(){return h}),L.d(K,"decodeFrame",function(){return u}),L.d(K,"utf8ArrayToStr",function(){return o}),L.d(K,"testables",function(){return n});var H=function(x,w){return w+10<=x.length&&(x[w]===73&&x[w+1]===68&&x[w+2]===51&&(x[w+3]<255&&x[w+4]<255&&(x[w+6]<128&&x[w+7]<128&&x[w+8]<128&&x[w+9]<128)))},N=function(x,w){return w+10<=x.length&&(x[w]===51&&x[w+1]===68&&x[w+2]===73&&(x[w+3]<255&&x[w+4]<255&&(x[w+6]<128&&x[w+7]<128&&x[w+8]<128&&x[w+9]<128)))},R=function(x,w){for(var T=w,y=0;H(x,w);){y+=10;var v=j(x,w+6);y+=v,N(x,w+10)&&(y+=10),w+=y}return y>0?x.subarray(T,T+y):void 0},j=function(x,w){var T=0;return T=(x[w]&127)<<21,T|=(x[w+1]&127)<<14,T|=(x[w+2]&127)<<7,T|=x[w+3]&127,T},k=function(x,w){return H(x,w)&&j(x,w+6)+10<=x.length-w},A=function(x){for(var w=h(x),T=0;T<w.length;T++){var y=w[T];if(D(y))return i(y)}return},D=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},g=function(x){var w=String.fromCharCode(x[0],x[1],x[2],x[3]),T=j(x,4),y=10;return{type:w,size:T,data:x.subarray(y,y+T)}},h=function(x){for(var w=0,T=[];H(x,w);){var y=j(x,w+6);w+=10;for(var v=w+y;w+8<v;){var p=g(x.subarray(w)),c=u(p);c&&T.push(c),w+=p.size+10}N(x,w)&&(w+=10)}return T},u=function(x){return x.type==="PRIV"?d(x):x.type[0]==="W"?l(x):s(x)},d=function(x){if(x.size<2)return;var w=o(x.data,!0),T=new Uint8Array(x.data.subarray(w.length+1));return{key:x.type,info:w,data:T.buffer}},s=function(x){if(x.size<2)return;if(x.type==="TXXX"){var w=1,T=o(x.data.subarray(w),!0);w+=T.length+1;var y=o(x.data.subarray(w));return{key:x.type,info:T,data:y}}var v=o(x.data.subarray(1));return{key:x.type,data:v}},l=function(x){if(x.type==="WXXX"){if(x.size<2)return;var w=1,T=o(x.data.subarray(w),!0);w+=T.length+1;var y=o(x.data.subarray(w));return{key:x.type,info:T,data:y}}var v=o(x.data);return{key:x.type,data:v}},i=function(x){if(x.data.byteLength===8){var w=new Uint8Array(x.data),T=w[3]&1,y=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return y/=45,T&&(y+=4772185884e-2),Math.round(y)}return},o=function(x,w){w===void 0&&(w=!1);var T=O();if(T){var y=T.decode(x);if(w){var v=y.indexOf("\0");return v!==-1?y.substring(0,v):y}return y.replace(/\0/g,"")}for(var p=x.length,c,E,_,b="",I=0;I<p;){if(c=x[I++],c===0&&w)return b;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(c);break;case 12:case 13:E=x[I++],b+=String.fromCharCode((c&31)<<6|E&63);break;case 14:E=x[I++],_=x[I++],b+=String.fromCharCode((c&15)<<12|(E&63)<<6|(_&63)<<0);break;default:}}return b},n={decodeTextFrame:s},f;function O(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./src/demux/mp3demuxer.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/demux/base-audio-demuxer.ts"),N=L("./src/demux/id3.ts"),R=L("./src/utils/logger.ts"),j=L("./src/demux/mpegaudio.ts");function k(g,h){g.prototype=Object.create(h.prototype),g.prototype.constructor=g,A(g,h)}function A(g,h){return A=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},A(g,h)}var D=function(g){k(h,g);function h(){return g.apply(this,arguments)||this}var u=h.prototype;return u.resetInitSegment=function(s,l,i){g.prototype.resetInitSegment.call(this,s,l,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},h.probe=function(s){if(!s)return!1;for(var l=N.getID3Data(s,0)||[],i=l.length,o=s.length;i<o;i++)if(j.probe(s,i))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},u.canParse=function(s,l){return j.canParse(s,l)},u.appendFrame=function(s,l,i){return this.initPTS===null?void 0:j.appendFrame(s,l,i,this.initPTS,this.frameIndex)},h}(H.default);D.minProbeByteLength=4,K.default=D},"./src/demux/mp4demuxer.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/utils/mp4-tools.ts"),N=L("./src/demux/dummy-demuxed-track.ts"),R=function(){function j(A,D){this.remainderData=null,this.config=void 0,this.config=D}var k=j.prototype;return k.resetTimeStamp=function(){},k.resetInitSegment=function(){},k.resetContiguity=function(){},j.probe=function(D){return Object(H.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},k.demux=function(D){var g=D,h=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(H.appendUint8Array)(this.remainderData,D));var u=Object(H.segmentValidRange)(g);this.remainderData=u.remainder,h.samples=u.valid||new Uint8Array}else h.samples=g;return{audioTrack:Object(N.dummyTrack)(),avcTrack:h,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},k.flush=function(){var D=Object(N.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:D,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},k.demuxSampleAes=function(D,g,h){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},k.destroy=function(){},j}();R.minProbeByteLength=1024,K.default=R},"./src/demux/mpegaudio.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"appendFrame",function(){return A}),L.d(K,"parseHeader",function(){return D}),L.d(K,"isHeaderPattern",function(){return g}),L.d(K,"isHeader",function(){return h}),L.d(K,"canParse",function(){return u}),L.d(K,"probe",function(){return d});var H=null,N=[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],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],k=[0,1,1,4];function A(s,l,i,o,n){if(i+24>l.length)return;var f=D(l,i);if(f&&i+f.frameLength<=l.length){var O=f.samplesPerFrame*9e4/f.sampleRate,S=o+n*O,x={unit:l.subarray(i,i+f.frameLength),pts:S,dts:S};return s.config=[],s.channelCount=f.channelCount,s.samplerate=f.sampleRate,s.samples.push(x),{sample:x,length:f.frameLength,missing:0}}}function D(s,l){var i=s[l+1]>>3&3,o=s[l+1]>>1&3,n=s[l+2]>>4&15,f=s[l+2]>>2&3;if(i!==1&&n!==0&&n!==15&&f!==3){var O=s[l+2]>>1&1,S=s[l+3]>>6,x=i===3?3-o:o===3?3:4,w=N[x*14+n-1]*1e3,T=i===3?0:i===2?1:2,y=R[T*3+f],v=S===3?1:2,p=j[i][o],c=k[o],E=p*8*c,_=Math.floor(p*w/y+O)*c;if(H===null){var b=navigator.userAgent||"",I=b.match(/Chrome\/(\d+)/i);H=I?parseInt(I[1]):0}var P=!!H&&H<=87;return P&&o===2&&w>=224e3&&S===0&&(s[l+3]=s[l+3]|128),{sampleRate:y,channelCount:v,frameLength:_,samplesPerFrame:E}}}function g(s,l){return s[l]===255&&(s[l+1]&224)===224&&(s[l+1]&6)!==0}function h(s,l){return l+1<s.length&&g(s,l)}function u(s,l){var i=4;return g(s,l)&&i<=s.length-l}function d(s,l){if(l+1<s.length&&g(s,l)){var i=4,o=D(s,l),n=i;o!=null&&o.frameLength&&(n=o.frameLength);var f=l+n;return f===s.length||h(s,f)}return!1}},"./src/demux/sample-aes.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/crypt/decrypter.ts"),N=L("./src/demux/tsdemuxer.ts"),R=function(){function j(A,D,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new H.default(A,D,{removePKCS7Padding:!1})}var k=j.prototype;return k.decryptBuffer=function(D,g){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,g)},k.decryptAacSample=function(D,g,h,u){var d=D[g].unit,s=d.subarray(16,d.length-d.length%16),l=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),i=this;this.decryptBuffer(l,function(o){var n=new Uint8Array(o);d.set(n,16),u||i.decryptAacSamples(D,g+1,h)})},k.decryptAacSamples=function(D,g,h){for(;;g++){if(g>=D.length){h();return}if(D[g].unit.length<32)continue;var u=this.decrypter.isSync();if(this.decryptAacSample(D,g,h,u),!u)return}},k.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,h=new Int8Array(g),u=0,d=32;d<=D.length-16;d+=160,u+=16)h.set(D.subarray(d,d+16),u);return h},k.getAvcDecryptedUnit=function(D,g){for(var h=new Uint8Array(g),u=0,d=32;d<=D.length-16;d+=160,u+=16)D.set(h.subarray(u,u+16),d);return D},k.decryptAvcSample=function(D,g,h,u,d,s){var l=Object(N.discardEPB)(d.data),i=this.getAvcEncryptedData(l),o=this;this.decryptBuffer(i.buffer,function(n){d.data=o.getAvcDecryptedUnit(l,n),s||o.decryptAvcSamples(D,g,h+1,u)})},k.decryptAvcSamples=function(D,g,h,u){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,h=0){if(g>=D.length){u();return}for(var d=D[g].units;!(h>=d.length);h++){var s=d[h];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(D,g,h,u,s,l),!l)return}}},j}();K.default=R},"./src/demux/transmuxer-interface.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return d});var H=L("./node_modules/webworkify-webpack/index.js"),N=L.n(H),R=L("./src/events.ts"),j=L("./src/demux/transmuxer.ts"),k=L("./src/utils/logger.ts"),A=L("./src/errors.ts"),D=L("./src/utils/mediasource-helper.ts"),g=L("./node_modules/eventemitter3/index.js"),h=L.n(g),u=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function s(i,o,n,f){var O=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=i,this.id=o,this.onTransmuxComplete=n,this.onFlush=f;var S=i.config,x=function(p,c){c=c||{},c.frag=O.frag,c.id=O.id,i.trigger(p,c)};this.observer=new g.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,x),this.observer.on(R.Events.ERROR,x);var w={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},T=navigator.vendor;if(S.enableWorker&&typeof Worker!="undefined"){k.logger.log("demuxing in webworker");var y;try{y=this.worker=H("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(v){i.trigger(R.Events.ERROR,{type:A.ErrorTypes.OTHER_ERROR,details:A.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},y.postMessage({cmd:"init",typeSupported:w,vendor:T,id:o,config:JSON.stringify(S)})}catch(v){k.logger.warn("Error in worker:",v),k.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new j.default(this.observer,w,S,T,o),this.worker=null}}else this.transmuxer=new j.default(this.observer,w,S,T,o)}var l=s.prototype;return l.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var f=this.observer;f&&f.removeAllListeners(),this.observer=null},l.push=function(o,n,f,O,S,x,w,T,y,v){var p=this;y.transmuxing.start=self.performance.now();var c=this.transmuxer,E=this.worker,_=x?x.start:S.start,b=S.decryptdata,I=this.frag,P=!(I&&S.cc===I.cc),B=!(I&&y.level===I.level),z=I?y.sn-I.sn:-1,U=this.part?y.part-this.part.index:1,C=!B&&(z===1||z===0&&U===1),W=self.performance.now();(B||z||S.stats.parsing.start===0)&&(S.stats.parsing.start=W),x&&(U||!C)&&(x.stats.parsing.start=W);var V=new j.TransmuxState(P,C,T,B,_);if(!C||P){k.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
discontinuity: `+P+`
trackSwitch: `+B+`
contiguous: `+C+`
accurateTimeOffset: `+T+`
timeOffset: `+_);var J=new j.TransmuxConfig(f,O,n,w,v);this.configureTransmuxer(J)}if(this.frag=S,this.part=x,E)E.postMessage({cmd:"demux",data:o,decryptdata:b,chunkMeta:y,state:V},o instanceof ArrayBuffer?[o]:[]);else if(c){var ne=c.push(o,b,y,V);Object(j.isPromise)(ne)?ne.then(function(fe){p.handleTransmuxComplete(fe)}):this.handleTransmuxComplete(ne)}},l.flush=function(o){var n=this;o.transmuxing.start=self.performance.now();var f=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:o});else if(f){var S=f.flush(o);Object(j.isPromise)(S)?S.then(function(x){n.handleFlushResult(x,o)}):this.handleFlushResult(S,o)}},l.handleFlushResult=function(o,n){var f=this;o.forEach(function(O){f.handleTransmuxComplete(O)}),this.onFlush(n)},l.onWorkerMessage=function(o){var n=o.data,f=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,f.trigger(n.event,n.data);break}}},l.configureTransmuxer=function(o){var n=this.worker,f=this.transmuxer;n?n.postMessage({cmd:"configure",config:o}):f&&f.configure(o)},l.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},s}()},"./src/demux/transmuxer-worker.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return A});var H=L("./src/demux/transmuxer.ts"),N=L("./src/events.ts"),R=L("./src/utils/logger.ts"),j=L("./node_modules/eventemitter3/index.js"),k=L.n(j);function A(d){var s=new j.EventEmitter,l=function(o,n){d.postMessage({event:o,data:n})};s.on(N.Events.FRAG_DECRYPTED,l),s.on(N.Events.ERROR,l),d.addEventListener("message",function(i){var o=i.data;switch(o.cmd){case"init":{var n=JSON.parse(o.config);d.transmuxer=new H.default(s,o.typeSupported,n,o.vendor,o.id),Object(R.enableLogs)(n.debug),l("init",null);break}case"configure":{d.transmuxer.configure(o.config);break}case"demux":{var f=d.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(H.isPromise)(f)?f.then(function(x){D(d,x)}):D(d,f);break}case"flush":{var O=o.chunkMeta,S=d.transmuxer.flush(O);Object(H.isPromise)(S)?S.then(function(x){h(d,x,O)}):h(d,S,O);break}default:break}})}function D(d,s){if(u(s.remuxResult))return;var l=[],i=s.remuxResult,o=i.audio,n=i.video;o&&g(l,o),n&&g(l,n),d.postMessage({event:"transmuxComplete",data:s},l)}function g(d,s){s.data1&&d.push(s.data1.buffer),s.data2&&d.push(s.data2.buffer)}function h(d,s,l){s.forEach(function(i){D(d,i)}),d.postMessage({event:"flush",data:l})}function u(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return n}),L.d(K,"isPromise",function(){return S}),L.d(K,"TransmuxConfig",function(){return x}),L.d(K,"TransmuxState",function(){return w});var H=L("./src/events.ts"),N=L("./src/errors.ts"),R=L("./src/crypt/decrypter.ts"),j=L("./src/demux/aacdemuxer.ts"),k=L("./src/demux/mp4demuxer.ts"),A=L("./src/demux/tsdemuxer.ts"),D=L("./src/demux/mp3demuxer.ts"),g=L("./src/remux/mp4-remuxer.ts"),h=L("./src/remux/passthrough-remuxer.ts"),u=L("./src/demux/chunk-cache.ts"),d=L("./src/utils/mp4-tools.ts"),s=L("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(T){s.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var i=[{demux:A.default,remux:g.default},{demux:k.default,remux:h.default},{demux:j.default,remux:g.default},{demux:D.default,remux:g.default}],o=1024;i.forEach(function(T){var y=T.demux;o=Math.max(o,y.minProbeByteLength)});var n=function(){function T(v,p,c,E,_){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 u.default,this.observer=v,this.typeSupported=p,this.config=c,this.vendor=E,this.id=_}var y=T.prototype;return y.configure=function(p){this.transmuxConfig=p,this.decrypter&&this.decrypter.reset()},y.push=function(p,c,E,_){var b=this,I=E.transmuxing;I.executeStart=l();var P=new Uint8Array(p),B=this.cache,z=this.config,U=this.currentTransmuxState,C=this.transmuxConfig;_&&(this.currentTransmuxState=_);var W=f(P,c);if(W&&W.method==="AES-128"){var V=this.getDecrypter();if(z.enableSoftwareAES){var J=V.softwareDecrypt(P,W.key.buffer,W.iv.buffer);if(!J)return I.executeEnd=l(),O(E);P=new Uint8Array(J)}else return this.decryptionPromise=V.webCryptoDecrypt(P,W.key.buffer,W.iv.buffer).then(function(We){var ze=b.push(We,null,E);return b.decryptionPromise=null,ze}),this.decryptionPromise}var ne=_||U,fe=ne.contiguous,ue=ne.discontinuity,le=ne.trackSwitch,me=ne.accurateTimeOffset,ge=ne.timeOffset,re=C.audioCodec,oe=C.videoCodec,xe=C.defaultInitPts,Be=C.duration,Ve=C.initSegmentData;if((ue||le)&&this.resetInitSegment(Ve,re,oe,Be),ue&&this.resetInitialTimestamp(xe),fe||this.resetContiguity(),this.needsProbing(P,ue,le)){if(B.dataLength){var Ye=B.flush();P=Object(d.appendUint8Array)(Ye,P)}this.configureTransmuxer(P,C)}var $e=this.transmux(P,W,ge,me,E),Ke=this.currentTransmuxState;return Ke.contiguous=!0,Ke.discontinuity=!1,Ke.trackSwitch=!1,I.executeEnd=l(),$e},y.flush=function(p){var c=this,E=p.transmuxing;E.executeStart=l();var _=this.decrypter,b=this.cache,I=this.currentTransmuxState,P=this.decryptionPromise;if(P)return P.then(function(){return c.flush(p)});var B=[],z=I.timeOffset;if(_){var U=_.flush();U&&B.push(this.push(U,null,p))}var C=b.dataLength;b.reset();var W=this.demuxer,V=this.remuxer;if(!W||!V)return C>=o&&this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=l(),[O(p)];var J=W.flush(z);return S(J)?J.then(function(ne){return c.flushRemux(B,ne,p),B}):(this.flushRemux(B,J,p),B)},y.flushRemux=function(p,c,E){var _=c.audioTrack,b=c.avcTrack,I=c.id3Track,P=c.textTrack,B=this.currentTransmuxState,z=B.accurateTimeOffset,U=B.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var C=this.remuxer.remux(_,b,I,P,U,z,!0,this.id);p.push({remuxResult:C,chunkMeta:E}),E.transmuxing.executeEnd=l()},y.resetInitialTimestamp=function(p){var c=this.demuxer,E=this.remuxer;if(!c||!E)return;c.resetTimeStamp(p),E.resetTimeStamp(p)},y.resetContiguity=function(){var p=this.demuxer,c=this.remuxer;if(!p||!c)return;p.resetContiguity(),c.resetNextTimestamp()},y.resetInitSegment=function(p,c,E,_){var b=this.demuxer,I=this.remuxer;if(!b||!I)return;b.resetInitSegment(c,E,_),I.resetInitSegment(p,c,E)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(p,c,E,_,b){var I;return c&&c.method==="SAMPLE-AES"?I=this.transmuxSampleAes(p,c,E,_,b):I=this.transmuxUnencrypted(p,E,_,b),I},y.transmuxUnencrypted=function(p,c,E,_){var b=this.demuxer.demux(p,c,!1,!this.config.progressive),I=b.audioTrack,P=b.avcTrack,B=b.id3Track,z=b.textTrack,U=this.remuxer.remux(I,P,B,z,c,E,!1,this.id);return{remuxResult:U,chunkMeta:_}},y.transmuxSampleAes=function(p,c,E,_,b){var I=this;return this.demuxer.demuxSampleAes(p,c,E).then(function(P){var B=I.remuxer.remux(P.audioTrack,P.avcTrack,P.id3Track,P.textTrack,E,_,!1,I.id);return{remuxResult:B,chunkMeta:b}})},y.configureTransmuxer=function(p,c){for(var E=this.config,_=this.observer,b=this.typeSupported,I=this.vendor,P=c.audioCodec,B=c.defaultInitPts,z=c.duration,U=c.initSegmentData,C=c.videoCodec,W,V=0,J=i.length;V<J;V++)if(i[V].demux.probe(p)){W=i[V];break}W||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:k.default,remux:h.default});var ne=this.demuxer,fe=this.remuxer,ue=W.remux,le=W.demux;(!fe||!(fe instanceof ue))&&(this.remuxer=new ue(_,E,b,I)),(!ne||!(ne instanceof le))&&(this.demuxer=new le(_,E,b),this.probe=le.probe),this.resetInitSegment(U,P,C,z),this.resetInitialTimestamp(B)},y.needsProbing=function(p,c,E){return!this.demuxer||!this.remuxer||c||E},y.getDecrypter=function(){var p=this.decrypter;return p||(p=this.decrypter=new R.default(this.observer,this.config)),p},T}();function f(T,y){var v=null;return T.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(v=y),v}var O=function(y){return{remuxResult:{},chunkMeta:y}};function S(T){return"then"in T&&T.then instanceof Function}var x=function(y,v,p,c,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=v,this.initSegmentData=p,this.duration=c,this.defaultInitPts=E},w=function(y,v,p,c,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=v,this.accurateTimeOffset=p,this.trackSwitch=c,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"discardEPB",function(){return O});var H=L("./src/demux/adts.ts"),N=L("./src/demux/mpegaudio.ts"),R=L("./src/demux/exp-golomb.ts"),j=L("./src/demux/id3.ts"),k=L("./src/demux/sample-aes.ts"),A=L("./src/events.ts"),D=L("./src/utils/mp4-tools.ts"),g=L("./src/utils/logger.ts"),h=L("./src/errors.ts"),u={video:1,audio:2,id3:3,text:4},d=function(){function S(w,T,y){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=T,this.typeSupported=y}S.probe=function(T){var y=S.syncOffset(T);return y<0?!1:(y&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},S.syncOffset=function(T){for(var y=Math.min(1e3,T.length-3*188),v=0;v<y;){if(T[v]===71&&T[v+188]===71&&T[v+2*188]===71)return v;v++}return-1},S.createTrack=function(T,y){return{container:T==="video"||T==="audio"?"video/mp2t":void 0,type:T,id:u[T],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:T==="audio"?y:void 0}};var x=S.prototype;return x.resetInitSegment=function(T,y,v){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=S.createTrack("video",v),this._audioTrack=S.createTrack("audio",v),this._id3Track=S.createTrack("id3",v),this._txtTrack=S.createTrack("text",v),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=T,this.videoCodec=y,this._duration=v},x.resetTimeStamp=function(){},x.resetContiguity=function(){var T=this._audioTrack,y=this._avcTrack,v=this._id3Track;T&&(T.pesData=null),y&&(y.pesData=null),v&&(v.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(T,y,v,p){v===void 0&&(v=!1),p===void 0&&(p=!1),v||(this.sampleAes=null);var c,E=this._avcTrack,_=this._audioTrack,b=this._id3Track,I=E.pid,P=E.pesData,B=_.pid,z=b.pid,U=_.pesData,C=b.pesData,W=!1,V=this.pmtParsed,J=this._pmtId,ne=T.length;if(this.remainderData&&(T=Object(D.appendUint8Array)(this.remainderData,T),ne=T.length,this.remainderData=null),ne<188&&!p)return this.remainderData=T,{audioTrack:_,avcTrack:E,id3Track:b,textTrack:this._txtTrack};var fe=Math.max(0,S.syncOffset(T));ne-=(ne+fe)%188,ne<T.byteLength&&!p&&(this.remainderData=new Uint8Array(T.buffer,ne,T.buffer.byteLength-ne));for(var ue=fe;ue<ne;ue+=188)if(T[ue]===71){var le=!!(T[ue+1]&64),me=((T[ue+1]&31)<<8)+T[ue+2],ge=(T[ue+3]&48)>>4,re=void 0;if(ge>1){if(re=ue+5+T[ue+4],re===ue+188)continue}else re=ue+4;switch(me){case I:le&&(P&&(c=o(P))&&this.parseAVCPES(c,!1),P={data:[],size:0}),P&&(P.data.push(T.subarray(re,ue+188)),P.size+=ue+188-re);break;case B:le&&(U&&(c=o(U))&&(_.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),U={data:[],size:0}),U&&(U.data.push(T.subarray(re,ue+188)),U.size+=ue+188-re);break;case z:le&&(C&&(c=o(C))&&this.parseID3PES(c),C={data:[],size:0}),C&&(C.data.push(T.subarray(re,ue+188)),C.size+=ue+188-re);break;case 0:le&&(re+=T[re]+1),J=this._pmtId=l(T,re);break;case J:{le&&(re+=T[re]+1);var oe=i(T,re,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);I=oe.avc,I>0&&(E.pid=I),B=oe.audio,B>0&&(_.pid=B,_.isAAC=oe.isAAC),z=oe.id3,z>0&&(b.pid=z),W&&!V&&(g.logger.log("reparse from beginning"),W=!1,ue=fe-188),V=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=P,_.pesData=U,b.pesData=C;var xe={audioTrack:_,avcTrack:E,id3Track:b,textTrack:this._txtTrack};return p&&this.extractRemainingSamples(xe),xe},x.flush=function(){var T=this.remainderData;this.remainderData=null;var y;return T?y=this.demux(T,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},x.extractRemainingSamples=function(T){var y=T.audioTrack,v=T.avcTrack,p=T.id3Track,c=v.pesData,E=y.pesData,_=p.pesData,b;c&&(b=o(c))?(this.parseAVCPES(b,!0),v.pesData=null):v.pesData=c,E&&(b=o(E))?(y.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),y.pesData=null):(E!=null&&E.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=E),_&&(b=o(_))?(this.parseID3PES(b),p.pesData=null):p.pesData=_},x.demuxSampleAes=function(T,y,v){var p=this.demux(T,v,!0,!this.config.progressive),c=this.sampleAes=new k.default(this.observer,this.config,y);return this.decrypt(p,c)},x.decrypt=function(T,y){return new Promise(function(v){var p=T.audioTrack,c=T.avcTrack;p.samples&&p.isAAC?y.decryptAacSamples(p.samples,0,function(){c.samples?y.decryptAvcSamples(c.samples,0,0,function(){v(T)}):v(T)}):c.samples&&y.decryptAvcSamples(c.samples,0,0,function(){v(T)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(T,y){var v=this,p=this._avcTrack,c=this.parseAVCNALu(T.data),E=!1,_=this.avcSample,b,I=!1;T.data=null,_&&c.length&&!p.audFound&&(n(_,p),_=this.avcSample=s(!1,T.pts,T.dts,"")),c.forEach(function(P){switch(P.type){case 1:{b=!0,_||(_=v.avcSample=s(!0,T.pts,T.dts,"")),E&&(_.debug+="NDR "),_.frame=!0;var B=P.data;if(I&&B.length>4){var z=new R.default(B).readSliceType();(z===2||z===4||z===7||z===9)&&(_.key=!0)}break}case 5:b=!0,_||(_=v.avcSample=s(!0,T.pts,T.dts,"")),E&&(_.debug+="IDR "),_.key=!0,_.frame=!0;break;case 6:{b=!0,E&&_&&(_.debug+="SEI ");var U=new R.default(O(P.data));U.readUByte();for(var C=0,W=0,V=!1,J=0;!V&&U.bytesAvailable>1;){C=0;do J=U.readUByte(),C+=J;while(J===255);W=0;do J=U.readUByte(),W+=J;while(J===255);if(C===4&&U.bytesAvailable!==0){V=!0;var ne=U.readUByte();if(ne===181){var fe=U.readUShort();if(fe===49){var ue=U.readUInt();if(ue===1195456820){var le=U.readUByte();if(le===3){for(var me=U.readUByte(),ge=U.readUByte(),re=31&me,oe=[me,ge],xe=0;xe<re;xe++)oe.push(U.readUByte()),oe.push(U.readUByte()),oe.push(U.readUByte());f(v._txtTrack.samples,{type:3,pts:T.pts,bytes:oe})}}}}}else if(C===5&&U.bytesAvailable!==0){if(V=!0,W>16){for(var Be=[],Ve=0;Ve<16;Ve++)Be.push(U.readUByte().toString(16)),(Ve===3||Ve===5||Ve===7||Ve===9)&&Be.push("-");for(var Ye=W-16,$e=new Uint8Array(Ye),Ke=0;Ke<Ye;Ke++)$e[Ke]=U.readUByte();f(v._txtTrack.samples,{pts:T.pts,payloadType:C,uuid:Be.join(""),userData:Object(j.utf8ArrayToStr)($e),userDataBytes:$e})}}else if(W<U.bytesAvailable)for(var We=0;We<W;We++)U.readUByte()}break}case 7:if(b=!0,I=!0,E&&_&&(_.debug+="SPS "),!p.sps){var ze=new R.default(P.data),at=ze.readSPS();p.width=at.width,p.height=at.height,p.pixelRatio=at.pixelRatio,p.sps=[P.data],p.duration=v._duration;for(var Je=P.data.subarray(1,4),Xe="avc1.",He=0;He<3;He++){var ot=Je[He].toString(16);ot.length<2&&(ot="0"+ot),Xe+=ot}p.codec=Xe}break;case 8:b=!0,E&&_&&(_.debug+="PPS "),p.pps||(p.pps=[P.data]);break;case 9:b=!1,p.audFound=!0,_&&n(_,p),_=v.avcSample=s(!1,T.pts,T.dts,E?"AUD ":"");break;case 12:b=!1;break;default:b=!1,_&&(_.debug+="unknown NAL "+P.type+" ");break}if(_&&b){var ft=_.units;ft.push(P)}}),y&&_&&(n(_,p),this.avcSample=null)},x.getLastNalUnit=function(){var T,y=this.avcSample,v;if(!y||y.units.length===0){var p=this._avcTrack.samples;y=p[p.length-1]}if((T=y)!==null&&T!==void 0&&T.units){var c=y.units;v=c[c.length-1]}return v},x.parseAVCNALu=function(T){var y=T.byteLength,v=this._avcTrack,p=v.naluState||0,c=p,E=[],_=0,b,I,P,B=-1,z=0;for(p===-1&&(B=0,z=T[0]&31,p=0,_=1);_<y;){if(b=T[_++],!p){p=b?0:1;continue}if(p===1){p=b?0:2;continue}if(!b)p=3;else if(b===1){if(B>=0){var U={data:T.subarray(B,_-p-1),type:z};E.push(U)}else{var C=this.getLastNalUnit();if(C&&(c&&_<=4-c&&(C.state&&(C.data=C.data.subarray(0,C.data.byteLength-c))),I=_-p-1,I>0)){var W=new Uint8Array(C.data.byteLength+I);W.set(C.data,0),W.set(T.subarray(0,I),C.data.byteLength),C.data=W,C.state=0}}_<y?(P=T[_]&31,B=_,z=P,p=0):p=-1}else p=0}if(B>=0&&p>=0){var V={data:T.subarray(B,y),type:z,state:p};E.push(V)}if(E.length===0){var J=this.getLastNalUnit();if(J){var ne=new Uint8Array(J.data.byteLength+T.byteLength);ne.set(J.data,0),ne.set(T,J.data.byteLength),J.data=ne}}return v.naluState=p,E},x.parseAACPES=function(T){var y=0,v=this._audioTrack,p=this.aacOverFlow,c=T.data;if(p){this.aacOverFlow=null;var E=p.sample.unit.byteLength,_=Math.min(p.missing,E),b=E-_;p.sample.unit.set(c.subarray(0,_),b),v.samples.push(p.sample),y=p.missing}var I,P;for(I=y,P=c.length;I<P-1&&!H.isHeader(c,I);I++);if(I!==y){var B,z;if(I<P-1?(B="AAC PES did not start with ADTS header,offset:"+I,z=!1):(B="no ADTS header found in AAC PES",z=!0),g.logger.warn("parsing error:"+B),this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:z,reason:B}),z)return}H.initTrackConfig(v,this.observer,c,I,this.audioCodec);var U;if(T.pts!==void 0)U=T.pts;else if(p){var C=H.getFrameDuration(v.samplerate);U=p.sample.pts+C}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;I<P;)if(H.isHeader(c,I)){if(I+5<P){var V=H.appendFrame(v,c,I,U,W);if(V)if(V.missing)this.aacOverFlow=V;else{I+=V.length,W++;continue}}break}else I++},x.parseMPEGPES=function(T){var y=T.data,v=y.length,p=0,c=0,E=T.pts;if(E===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<v;)if(N.isHeader(y,c)){var _=N.appendFrame(this._audioTrack,y,c,E,p);if(_)c+=_.length,p++;else break}else c++},x.parseID3PES=function(T){if(T.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(T)},S}();d.minProbeByteLength=188;function s(S,x,w,T){return{key:S,frame:!1,pts:x,dts:w,units:[],debug:T,length:0}}function l(S,x){return(S[x+10]&31)<<8|S[x+11]}function i(S,x,w,T){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},v=(S[x+1]&15)<<8|S[x+2],p=x+3+v-4,c=(S[x+10]&15)<<8|S[x+11];for(x+=12+c;x<p;){var E=(S[x+1]&31)<<8|S[x+2];switch(S[x]){case 207:if(!T){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=E);break;case 21:y.id3===-1&&(y.id3=E);break;case 219:if(!T){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=E);break;case 3:case 4:w?y.audio===-1&&(y.audio=E,y.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((S[x+3]&15)<<8|S[x+4])+5}return y}function o(S){var x=0,w,T,y,v,p,c=S.data;if(!S||S.size===0)return null;for(;c[0].length<19&&c.length>1;){var E=new Uint8Array(c[0].length+c[1].length);E.set(c[0]),E.set(c[1],c[0].length),c[0]=E,c.splice(1,1)}w=c[0];var _=(w[0]<<16)+(w[1]<<8)+w[2];if(_===1){if(T=(w[4]<<8)+w[5],T&&T>S.size-6)return null;var b=w[7];b&192&&(v=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,b&64?(p=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,v-p>60*9e4&&(g.logger.warn(Math.round((v-p)/9e4)+"s delta between PTS and DTS, align them"),v=p)):p=v),y=w[8];var I=y+9;if(S.size<=I)return null;S.size-=I;for(var P=new Uint8Array(S.size),B=0,z=c.length;B<z;B++){w=c[B];var U=w.byteLength;if(I)if(I>U){I-=U;continue}else w=w.subarray(I),U-=I,I=0;P.set(w,x),x+=U}return T&&(T-=y+3),{data:P,pts:v,dts:p,len:T}}return null}function n(S,x){if(S.units.length&&S.frame){if(S.pts===void 0){var w=x.samples,T=w.length;if(T){var y=w[T-1];S.pts=y.pts,S.dts=y.dts}else{x.dropped++;return}}x.samples.push(S)}S.debug.length&&g.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function f(S,x){var w=S.length;if(w>0){if(x.pts>=S[w-1].pts)S.push(x);else for(var T=w-1;T>=0;T--)if(x.pts<S[T].pts){S.splice(T,0,x);break}}else S.push(x)}function O(S){for(var x=S.byteLength,w=[],T=1;T<x-2;)S[T]===0&&S[T+1]===0&&S[T+2]===3?(w.push(T+2),T+=2):T++;if(w.length===0)return S;var y=x-w.length,v=new Uint8Array(y),p=0;for(T=0;T<y;p++,T++)p===w[0]&&(p++,w.shift()),v[T]=S[p];return v}K.default=d},"./src/errors.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"ErrorTypes",function(){return H}),L.d(K,"ErrorDetails",function(){return N});var H;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(H||(H={}));var N;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"Events",function(){return H});var H;(function(N){N.MEDIA_ATTACHING="hlsMediaAttaching",N.MEDIA_ATTACHED="hlsMediaAttached",N.MEDIA_DETACHING="hlsMediaDetaching",N.MEDIA_DETACHED="hlsMediaDetached",N.BUFFER_RESET="hlsBufferReset",N.BUFFER_CODECS="hlsBufferCodecs",N.BUFFER_CREATED="hlsBufferCreated",N.BUFFER_APPENDING="hlsBufferAppending",N.BUFFER_APPENDED="hlsBufferAppended",N.BUFFER_EOS="hlsBufferEos",N.BUFFER_FLUSHING="hlsBufferFlushing",N.BUFFER_FLUSHED="hlsBufferFlushed",N.MANIFEST_LOADING="hlsManifestLoading",N.MANIFEST_LOADED="hlsManifestLoaded",N.MANIFEST_PARSED="hlsManifestParsed",N.LEVEL_SWITCHING="hlsLevelSwitching",N.LEVEL_SWITCHED="hlsLevelSwitched",N.LEVEL_LOADING="hlsLevelLoading",N.LEVEL_LOADED="hlsLevelLoaded",N.LEVEL_UPDATED="hlsLevelUpdated",N.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",N.LEVELS_UPDATED="hlsLevelsUpdated",N.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",N.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",N.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",N.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",N.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",N.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",N.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",N.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",N.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",N.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",N.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",N.CUES_PARSED="hlsCuesParsed",N.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",N.INIT_PTS_FOUND="hlsInitPtsFound",N.FRAG_LOADING="hlsFragLoading",N.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",N.FRAG_LOADED="hlsFragLoaded",N.FRAG_DECRYPTED="hlsFragDecrypted",N.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",N.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",N.FRAG_PARSING_METADATA="hlsFragParsingMetadata",N.FRAG_PARSED="hlsFragParsed",N.FRAG_BUFFERED="hlsFragBuffered",N.FRAG_CHANGED="hlsFragChanged",N.FPS_DROP="hlsFpsDrop",N.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",N.ERROR="hlsError",N.DESTROYING="hlsDestroying",N.KEY_LOADING="hlsKeyLoading",N.KEY_LOADED="hlsKeyLoaded",N.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",N.BACK_BUFFER_REACHED="hlsBackBufferReached"})(H||(H={}))},"./src/hls.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return S});var H=L("./node_modules/url-toolkit/src/url-toolkit.js"),N=L.n(H),R=L("./src/loader/playlist-loader.ts"),j=L("./src/loader/key-loader.ts"),k=L("./src/controller/id3-track-controller.ts"),A=L("./src/controller/latency-controller.ts"),D=L("./src/controller/level-controller.ts"),g=L("./src/controller/fragment-tracker.ts"),h=L("./src/controller/stream-controller.ts"),u=L("./src/is-supported.ts"),d=L("./src/utils/logger.ts"),s=L("./src/config.ts"),l=L("./node_modules/eventemitter3/index.js"),i=L.n(l),o=L("./src/events.ts"),n=L("./src/errors.ts");function f(x,w){for(var T=0;T<w.length;T++){var y=w[T];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(x,y.key,y)}}function O(x,w,T){return w&&f(x.prototype,w),T&&f(x,T),x}var S=function(){x.isSupported=function(){return Object(u.isSupported)()};function x(T){T===void 0&&(T={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.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 y=this.config=Object(s.mergeConfig)(x.DefaultConfig,T);this.userConfig=T,Object(d.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(s.enableStreamingMode)(y);var v=y.abrController,p=y.bufferController,c=y.capLevelController,E=y.fpsController,_=this.abrController=new v(this),b=this.bufferController=new p(this),I=this.capLevelController=new c(this),P=new E(this),B=new R.default(this),z=new j.default(this),U=new k.default(this),C=this.levelController=new D.default(this),W=new g.FragmentTracker(this),V=this.streamController=new h.default(this,W);I.setStreamController(V),P.setStreamController(V);var J=[C,V];this.networkControllers=J;var ne=[B,z,_,b,I,P,U,W];this.audioTrackController=this.createController(y.audioTrackController,null,J),this.createController(y.audioStreamController,W,J),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,J),this.createController(y.subtitleStreamController,W,J),this.createController(y.timelineController,null,ne),this.emeController=this.createController(y.emeController,null,ne),this.cmcdController=this.createController(y.cmcdController,null,ne),this.latencyController=this.createController(A.default,null,ne),this.coreComponents=ne}var w=x.prototype;return w.createController=function(y,v,p){if(y){var c=v?new y(this,v):new y(this);return p&&p.push(c),c}return null},w.on=function(y,v,p){p===void 0&&(p=this),this._emitter.on(y,v,p)},w.once=function(y,v,p){p===void 0&&(p=this),this._emitter.once(y,v,p)},w.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},w.off=function(y,v,p,c){p===void 0&&(p=this),this._emitter.off(y,v,p,c)},w.listeners=function(y){return this._emitter.listeners(y)},w.emit=function(y,v,p){return this._emitter.emit(y,v,p)},w.trigger=function(y,v){if(this.config.debug)return this.emit(y,y,v);try{return this.emit(y,y,v)}catch(p){d.logger.error("An internal error happened while handling event "+y+'. Error message: "'+p.message+'". Here is a stacktrace:',p),this.trigger(o.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:p})}return!1},w.listenerCount=function(y){return this._emitter.listenerCount(y)},w.destroy=function(){d.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},w.attachMedia=function(y){d.logger.log("attachMedia"),this._media=y,this.trigger(o.Events.MEDIA_ATTACHING,{media:y})},w.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(y){this.stopLoad();var v=this.media,p=this.url,c=this.url=H.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});d.logger.log("loadSource:"+c),v&&p&&p!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(v)),this.trigger(o.Events.MANIFEST_LOADING,{url:y})},w.startLoad=function(y){y===void 0&&(y=-1),d.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(v){v.startLoad(y)})},w.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},w.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){d.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},w.removeLevel=function(y,v){v===void 0&&(v=0),this.levelController.removeLevel(y,v)},O(x,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){d.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){d.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){d.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){d.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){d.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var v=!!y;v!==this.config.capLevelToPlayerSize&&(v?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=v)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(d.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,v=this.config.minAutoBitrate;if(!y)return 0;for(var p=y.length,c=0;c<p;c++)if(y[c].maxBitrate>v)return c;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,v=this.autoLevelCapping,p;return v===-1&&y&&y.length?p=y.length-1:p=v,p}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var v=this.audioTrackController;v&&(v.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var v=this.subtitleTrackController;v&&(v.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var v=this.subtitleTrackController;v&&(v.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{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 o.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(y){x.defaultConfig=y}}]),x}();S.defaultConfig=void 0},"./src/is-supported.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"isSupported",function(){return R}),L.d(K,"changeTypeSupported",function(){return j});var H=L("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var k=Object(H.getMediaSource)();if(!k)return!1;var A=N(),D=k&&typeof k.isTypeSupported=="function"&&k.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!A||A.prototype&&typeof A.prototype.appendBuffer=="function"&&typeof A.prototype.remove=="function";return!!D&&!!g}function j(){var k,A=N();return typeof(A==null||((k=A.prototype)===null||k===void 0)?void 0:k.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return d}),L.d(K,"LoadError",function(){return l});var H=L("./src/polyfills/number.ts"),N=L("./src/errors.ts");function R(i,o){i.prototype=Object.create(o.prototype),i.prototype.constructor=i,g(i,o)}function j(i){var o=typeof Map=="function"?new Map:void 0;return j=function(f){if(f===null||!D(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(f))return o.get(f);o.set(f,O)}function O(){return k(f,arguments,h(this).constructor)}return O.prototype=Object.create(f.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g(O,f)},j(i)}function k(i,o,n){return A()?k=Reflect.construct:k=function(O,S,x){var w=[null];w.push.apply(w,S);var T=Function.bind.apply(O,w),y=new T;return x&&g(y,x.prototype),y},k.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(i){return!1}}function D(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function g(i,o){return g=Object.setPrototypeOf||function(f,O){return f.__proto__=O,f},g(i,o)}function h(i){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},h(i)}var u=Math.pow(2,17),d=function(){function i(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var o=i.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(f,O){var S=this,x=f.url;if(!x)return Promise.reject(new l({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var w=this.config,T=w.fLoader,y=w.loader;return new Promise(function(v,p){S.loader&&S.loader.destroy();var c=S.loader=f.loader=T?new T(w):new y(w),E=s(f),_={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:u};f.stats=c.stats,c.load(E,_,{onSuccess:function(I,P,B,z){S.resetLoader(f,c),v({frag:f,part:null,payload:I.data,networkDetails:z})},onError:function(I,P,B){S.resetLoader(f,c),p(new l({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:I,networkDetails:B}))},onAbort:function(I,P,B){S.resetLoader(f,c),p(new l({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:B}))},onTimeout:function(I,P,B){S.resetLoader(f,c),p(new l({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:B}))},onProgress:function(I,P,B,z){O&&O({frag:f,part:null,payload:B,networkDetails:z})}})})},o.loadPart=function(f,O,S){var x=this;this.abort();var w=this.config,T=w.fLoader,y=w.loader;return new Promise(function(v,p){x.loader&&x.loader.destroy();var c=x.loader=f.loader=T?new T(w):new y(w),E=s(f,O),_={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:u};O.stats=c.stats,c.load(E,_,{onSuccess:function(I,P,B,z){x.resetLoader(f,c),x.updateStatsFromPart(f,O);var U={frag:f,part:O,payload:I.data,networkDetails:z};S(U),v(U)},onError:function(I,P,B){x.resetLoader(f,c),p(new l({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:O,response:I,networkDetails:B}))},onAbort:function(I,P,B){f.stats.aborted=O.stats.aborted,x.resetLoader(f,c),p(new l({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:O,networkDetails:B}))},onTimeout:function(I,P,B){x.resetLoader(f,c),p(new l({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:O,networkDetails:B}))}})})},o.updateStatsFromPart=function(f,O){var S=f.stats,x=O.stats,w=x.total;if(S.loaded+=x.loaded,w){var T=Math.round(f.duration/O.duration),y=Math.min(Math.round(S.loaded/w),T),v=T-y,p=v*Math.round(S.loaded/y);S.total=S.loaded+p}else S.total=Math.max(S.loaded,S.total);var c=S.loading,E=x.loading;c.start?c.first+=E.first-E.start:(c.start=E.start,c.first=E.first),c.end=E.end},o.resetLoader=function(f,O){f.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},i}();function s(i,o){o===void 0&&(o=null);var n=o||i,f={frag:i,part:o,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},O=n.byteRangeStartOffset,S=n.byteRangeEndOffset;return Object(H.isFiniteNumber)(O)&&Object(H.isFiniteNumber)(S)&&(f.rangeStart=O,f.rangeEnd=S),f}var l=function(i){R(o,i);function o(n){for(var f,O=arguments.length,S=new Array(O>1?O-1:0),x=1;x<O;x++)S[x-1]=arguments[x];return f=i.call.apply(i,[this].concat(S))||this,f.data=void 0,f.data=n,f}return o}(j(Error))},"./src/loader/fragment.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"ElementaryStreamTypes",function(){return d}),L.d(K,"BaseSegment",function(){return s}),L.d(K,"Fragment",function(){return l}),L.d(K,"Part",function(){return i});var H=L("./src/polyfills/number.ts"),N=L("./node_modules/url-toolkit/src/url-toolkit.js"),R=L.n(N),j=L("./src/utils/logger.ts"),k=L("./src/loader/level-key.ts"),A=L("./src/loader/load-stats.ts");function D(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,g(o,n)}function g(o,n){return g=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},g(o,n)}function h(o,n){for(var f=0;f<n.length;f++){var O=n[f];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(o,O.key,O)}}function u(o,n,f){return n&&h(o.prototype,n),f&&h(o,f),o}var d;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(d||(d={}));var s=function(){function o(f){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[d.AUDIO]=null,O[d.VIDEO]=null,O[d.AUDIOVIDEO]=null,O),this.baseurl=f}var n=o.prototype;return n.setByteRange=function(O,S){var x=O.split("@",2),w=[];x.length===1?w[0]=S?S.byteRangeEndOffset:0:w[0]=parseInt(x[1]),w[1]=parseInt(x[0])+w[0],this._byteRange=w},u(o,[{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(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(O){this._url=O}}]),o}(),l=function(o){D(n,o);function n(O,S){var x;return x=o.call(this,S)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new A.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=O,x}var f=n.prototype;return f.createInitializationVector=function(S){for(var x=new Uint8Array(16),w=12;w<16;w++)x[w]=S>>8*(15-w)&255;return x},f.setDecryptDataFromLevelKey=function(S,x){var w=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(w=k.LevelKey.fromURI(S.uri),w.method=S.method,w.iv=this.createInitializationVector(x),w.keyFormat="identity"),w},f.setElementaryStreamInfo=function(S,x,w,T,y,v){v===void 0&&(v=!1);var p=this.elementaryStreams,c=p[S];if(!c){p[S]={startPTS:x,endPTS:w,startDTS:T,endDTS:y,partial:v};return}c.startPTS=Math.min(c.startPTS,x),c.endPTS=Math.max(c.endPTS,w),c.startDTS=Math.min(c.startDTS,T),c.endDTS=Math.max(c.endDTS,y)},f.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[d.AUDIO]=null,S[d.VIDEO]=null,S[d.AUDIOVIDEO]=null},u(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&j.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(H.isFiniteNumber)(this.programDateTime))return null;var S=Object(H.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),n}(s),i=function(o){D(n,o);function n(f,O,S,x,w){var T;T=o.call(this,S)||this,T.fragOffset=0,T.duration=0,T.gap=!1,T.independent=!1,T.relurl=void 0,T.fragment=void 0,T.index=void 0,T.stats=new A.LoadStats,T.duration=f.decimalFloatingPoint("DURATION"),T.gap=f.bool("GAP"),T.independent=f.bool("INDEPENDENT"),T.relurl=f.enumeratedString("URI"),T.fragment=O,T.index=x;var y=f.enumeratedString("BYTERANGE");return y&&T.setByteRange(y,w),w&&(T.fragOffset=w.fragOffset+w.duration),T}return u(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),n}(s)},"./src/loader/key-loader.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return j});var H=L("./src/events.ts"),N=L("./src/errors.ts"),R=L("./src/utils/logger.ts"),j=function(){function k(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var A=k.prototype;return A._registerListeners=function(){this.hls.on(H.Events.KEY_LOADING,this.onKeyLoading,this)},A._unregisterListeners=function(){this.hls.off(H.Events.KEY_LOADING,this.onKeyLoading)},A.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var h=this.loaders[g];h&&h.destroy()}this.loaders={}},A.onKeyLoading=function(g,h){var u=h.frag,d=u.type,s=this.loaders[d];if(!u.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=u.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(R.logger.warn("abort previous key loader for type:"+d),s.abort()),!l){R.logger.warn("key uri is falsy");return}var o=i.loader,n=u.loader=this.loaders[d]=new o(i);this.decrypturl=l,this.decryptkey=null;var f={url:l,frag:u,responseType:"arraybuffer"},O={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(f,O,S)}else this.decryptkey&&(u.decryptdata.key=this.decryptkey,this.hls.trigger(H.Events.KEY_LOADED,{frag:u}))},A.loadsuccess=function(g,h,u){var d=u.frag;if(!d.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(g.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(H.Events.KEY_LOADED,{frag:d})},A.loaderror=function(g,h){var u=h.frag,d=u.loader;d&&d.abort(),delete this.loaders[u.type],this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:u,response:g})},A.loadtimeout=function(g,h){var u=h.frag,d=u.loader;d&&d.abort(),delete this.loaders[u.type],this.hls.trigger(H.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:u})},k}()},"./src/loader/level-details.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"LevelDetails",function(){return k});var H=L("./src/polyfills/number.ts");function N(A,D){for(var g=0;g<D.length;g++){var h=D[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(A,h.key,h)}}function R(A,D,g){return D&&N(A.prototype,D),g&&N(A,g),A}var j=10,k=function(){function A(g){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=g}var D=A.prototype;return D.reloaded=function(h){if(!h){this.advanced=!0,this.updated=!0;return}var u=this.lastPartSn-h.lastPartSn,d=this.lastPartIndex-h.lastPartIndex;this.updated=this.endSN!==h.endSN||!!d||!!u,this.advanced=this.endSN>h.endSN||u>0||u===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(h.misses*.6):this.misses=h.misses+1,this.availabilityDelay=h.availabilityDelay},R(A,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(H.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||j}},{key:"drift",get:function(){var h=this.driftEndTime-this.driftStartTime;if(h>0){var u=this.driftEnd-this.driftStart;return u*1e3/h}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var h;return(h=this.fragments)!==null&&h!==void 0&&h.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 h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),A}()},"./src/loader/level-key.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"LevelKey",function(){return k});var H=L("./node_modules/url-toolkit/src/url-toolkit.js"),N=L.n(H);function R(A,D){for(var g=0;g<D.length;g++){var h=D[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(A,h.key,h)}}function j(A,D,g){return D&&R(A.prototype,D),g&&R(A,g),A}var k=function(){A.fromURL=function(g,h){return new A(g,h)},A.fromURI=function(g){return new A(g)};function A(D,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(H.buildAbsoluteURL)(D,g,{alwaysNormalize:!0}):this._uri=D}return j(A,[{key:"uri",get:function(){return this._uri}}]),A}()},"./src/loader/load-stats.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"LoadStats",function(){return H});var H=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(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return n});var H=L("./src/polyfills/number.ts"),N=L("./node_modules/url-toolkit/src/url-toolkit.js"),R=L.n(N),j=L("./src/loader/fragment.ts"),k=L("./src/loader/level-details.ts"),A=L("./src/loader/level-key.ts"),D=L("./src/utils/attr-list.ts"),g=L("./src/utils/logger.ts"),h=L("./src/utils/codecs.ts"),u=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,d=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),l=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("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function o(w){var T,y;return i.test((T=(y=N.parseURL(w))===null||y===void 0?void 0:y.path)!=null?T:"")}var n=function(){function w(){}return w.findGroup=function(y,v){for(var p=0;p<y.length;p++){var c=y[p];if(c.id===v)return c}},w.convertAVC1ToAVCOTI=function(y){var v=y.split(".");if(v.length>2){var p=v.shift()+".";return p+=parseInt(v.shift()).toString(16),p+=("000"+parseInt(v.shift()).toString(16)).substr(-4),p}return y},w.resolve=function(y,v){return N.buildAbsoluteURL(v,y,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(y,v){var p=[],c={},E=!1;u.lastIndex=0;for(var _;(_=u.exec(y))!=null;)if(_[1]){var b=new D.AttrList(_[1]),I={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:w.resolve(_[2],v)},P=b.decimalResolution("RESOLUTION");P&&(I.width=P.width,I.height=P.height),f((b.CODECS||"").split(/[ ,]+/).filter(function(z){return z}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=w.convertAVC1ToAVCOTI(I.videoCodec)),p.push(I)}else if(_[3]){var B=new D.AttrList(_[3]);B["DATA-ID"]&&(E=!0,c[B["DATA-ID"]]=B)}return{levels:p,sessionData:E?c:null}},w.parseMasterPlaylistMedia=function(y,v,p,c){c===void 0&&(c=[]);var E,_=[],b=0;for(d.lastIndex=0;(E=d.exec(y))!==null;){var I=new D.AttrList(E[1]);if(I.TYPE===p){var P={attrs:I,bitrate:0,id:b++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:p,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?w.resolve(I.URI,v):""};if(c.length){var B=w.findGroup(c,P.groupId)||c[0];O(P,B,"audioCodec"),O(P,B,"textCodec")}_.push(P)}}return _},w.parseLevelPlaylist=function(y,v,p,c,E){var _=new k.LevelDetails(v),b=_.fragments,I=null,P=0,B=0,z=0,U=0,C=null,W=new j.Fragment(c,v),V,J,ne,fe=-1,ue=!1;for(s.lastIndex=0,_.m3u8=y;(V=s.exec(y))!==null;){ue&&(ue=!1,W=new j.Fragment(c,v),W.start=z,W.sn=P,W.cc=U,W.level=p,I&&(W.initSegment=I,W.rawProgramDateTime=I.rawProgramDateTime));var le=V[1];if(le){W.duration=parseFloat(le);var me=(" "+V[2]).slice(1);W.title=me||null,W.tagList.push(me?["INF",le,me]:["INF",le])}else if(V[3])Object(H.isFiniteNumber)(W.duration)&&(W.start=z,ne&&(W.levelkey=ne),W.sn=P,W.level=p,W.cc=U,W.urlId=E,b.push(W),W.relurl=(" "+V[3]).slice(1),x(W,C),C=W,z+=W.duration,P++,B=0,ue=!0);else if(V[4]){var ge=(" "+V[4]).slice(1);C?W.setByteRange(ge,C):W.setByteRange(ge)}else if(V[5])W.rawProgramDateTime=(" "+V[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),fe===-1&&(fe=b.length);else{if(V=V[0].match(l),!V){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(J=1;J<V.length&&!(typeof V[J]!="undefined");J++);var re=(" "+V[J]).slice(1),oe=(" "+V[J+1]).slice(1),xe=V[J+2]?(" "+V[J+2]).slice(1):"";switch(re){case"PLAYLIST-TYPE":_.type=oe.toUpperCase();break;case"MEDIA-SEQUENCE":P=_.startSN=parseInt(oe);break;case"SKIP":{var Be=new D.AttrList(oe),Ve=Be.decimalInteger("SKIPPED-SEGMENTS");if(Object(H.isFiniteNumber)(Ve)){_.skippedSegments=Ve;for(var Ye=Ve;Ye--;)b.unshift(null);P+=Ve}var $e=Be.enumeratedString("RECENTLY-REMOVED-DATERANGES");$e&&(_.recentlyRemovedDateranges=$e.split(" "));break}case"TARGETDURATION":_.targetduration=parseFloat(oe);break;case"VERSION":_.version=parseInt(oe);break;case"EXTM3U":break;case"ENDLIST":_.live=!1;break;case"#":(oe||xe)&&W.tagList.push(xe?[oe,xe]:[oe]);break;case"DIS":U++;case"GAP":W.tagList.push([re]);break;case"BITRATE":W.tagList.push([re,oe]);break;case"DISCONTINUITY-SEQ":U=parseInt(oe);break;case"KEY":{var Ke,We=new D.AttrList(oe),ze=We.enumeratedString("METHOD"),at=We.URI,Je=We.hexadecimalInteger("IV"),Xe=We.enumeratedString("KEYFORMATVERSIONS"),He=We.enumeratedString("KEYID"),ot=(Ke=We.enumeratedString("KEYFORMAT"))!=null?Ke:"identity",ft=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ft.indexOf(ot)>-1){g.logger.warn("Keyformat "+ot+" is not supported from the manifest");continue}else if(ot!=="identity")continue;ze&&(ne=A.LevelKey.fromURL(v,at),at&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ze)>=0&&(ne.method=ze,ne.keyFormat=ot,He&&(ne.keyID=He),Xe&&(ne.keyFormatVersions=Xe),ne.iv=Je));break}case"START":{var dt=new D.AttrList(oe),lt=dt.decimalFloatingPoint("TIME-OFFSET");Object(H.isFiniteNumber)(lt)&&(_.startTimeOffset=lt);break}case"MAP":{var _t=new D.AttrList(oe);W.relurl=_t.URI,_t.BYTERANGE&&W.setByteRange(_t.BYTERANGE),W.level=p,W.sn="initSegment",ne&&(W.levelkey=ne),W.initSegment=null,I=W,ue=!0;break}case"SERVER-CONTROL":{var ht=new D.AttrList(oe);_.canBlockReload=ht.bool("CAN-BLOCK-RELOAD"),_.canSkipUntil=ht.optionalFloat("CAN-SKIP-UNTIL",0),_.canSkipDateRanges=_.canSkipUntil>0&&ht.bool("CAN-SKIP-DATERANGES"),_.partHoldBack=ht.optionalFloat("PART-HOLD-BACK",0),_.holdBack=ht.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var be=new D.AttrList(oe);_.partTarget=be.decimalFloatingPoint("PART-TARGET");break}case"PART":{var _e=_.partList;_e||(_e=_.partList=[]);var Ne=B>0?_e[_e.length-1]:void 0,ke=B++,Ee=new j.Part(new D.AttrList(oe),W,v,ke,Ne);_e.push(Ee),W.duration+=Ee.duration;break}case"PRELOAD-HINT":{var Ie=new D.AttrList(oe);_.preloadHint=Ie;break}case"RENDITION-REPORT":{var pe=new D.AttrList(oe);_.renditionReports=_.renditionReports||[],_.renditionReports.push(pe);break}default:g.logger.warn("line parsed but not handled: "+V);break}}}C&&!C.relurl?(b.pop(),z-=C.duration,_.partList&&(_.fragmentHint=C)):_.partList&&(x(W,C),W.cc=U,_.fragmentHint=W);var ae=b.length,ie=b[0],Q=b[ae-1];if(z+=_.skippedSegments*_.targetduration,z>0&&ae&&Q){_.averagetargetduration=z/ae;var q=Q.sn;_.endSN=q!=="initSegment"?q:0,ie&&(_.startCC=ie.cc,ie.initSegment||_.fragments.every(function(te){return te.relurl&&o(te.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new j.Fragment(c,v),W.relurl=Q.relurl,W.level=p,W.sn="initSegment",ie.initSegment=W,_.needSidxRanges=!0))}else _.endSN=0,_.startCC=0;return _.fragmentHint&&(z+=_.fragmentHint.duration),_.totalduration=z,_.endCC=U,fe>0&&S(b,fe),_},w}();function f(w,T){["video","audio","text"].forEach(function(y){var v=w.filter(function(c){return Object(h.isCodecType)(c,y)});if(v.length){var p=v.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});T[y+"Codec"]=p.length>0?p[0]:v[0],w=w.filter(function(c){return v.indexOf(c)===-1})}}),T.unknownCodecs=w}function O(w,T,y){var v=T[y];v&&(w[y]=v)}function S(w,T){for(var y=w[T],v=T;v--;){var p=w[v];if(!p)return;p.programDateTime=y.programDateTime-p.duration*1e3,y=p}}function x(w,T){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):T!=null&&T.programDateTime&&(w.programDateTime=T.endProgramDateTime),Object(H.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/polyfills/number.ts"),N=L("./src/events.ts"),R=L("./src/errors.ts"),j=L("./src/utils/logger.ts"),k=L("./src/utils/mp4-tools.ts"),A=L("./src/loader/m3u8-parser.ts"),D=L("./src/types/loader.ts"),g=L("./src/utils/attr-list.ts");function h(s){var l=s.type;switch(l){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function u(s,l){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=l.url),i}var d=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var l=s.prototype;return l.registerListeners=function(){var o=this.hls;o.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var o=this.hls;o.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(o){var n=this.hls.config,f=n.pLoader,O=n.loader,S=f||O,x=new S(n);return o.loader=x,this.loaders[o.type]=x,x},l.getInternalLoader=function(o){return this.loaders[o.type]},l.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},l.destroyInternalLoaders=function(){for(var o in this.loaders){var n=this.loaders[o];n&&n.destroy(),this.resetInternalLoader(o)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(o,n){var f=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},l.onLevelLoading=function(o,n){var f=n.id,O=n.level,S=n.url,x=n.deliveryDirectives;this.load({id:f,groupId:null,level:O,responseType:"text",type:D.PlaylistContextType.LEVEL,url:S,deliveryDirectives:x})},l.onAudioTrackLoading=function(o,n){var f=n.id,O=n.groupId,S=n.url,x=n.deliveryDirectives;this.load({id:f,groupId:O,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:x})},l.onSubtitleTrackLoading=function(o,n){var f=n.id,O=n.groupId,S=n.url,x=n.deliveryDirectives;this.load({id:f,groupId:O,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:x})},l.load=function(o){var n,f=this.hls.config,O=this.getInternalLoader(o);if(O){var S=O.context;if(S&&S.url===o.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),O.abort()}var x,w,T,y;switch(o.type){case D.PlaylistContextType.MANIFEST:x=f.manifestLoadingMaxRetry,w=f.manifestLoadingTimeOut,T=f.manifestLoadingRetryDelay,y=f.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:x=0,w=f.levelLoadingTimeOut;break;default:x=f.levelLoadingMaxRetry,w=f.levelLoadingTimeOut,T=f.levelLoadingRetryDelay,y=f.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(o),(n=o.deliveryDirectives)!==null&&n!==void 0&&n.part){var v;if(o.type===D.PlaylistContextType.LEVEL&&o.level!==null?v=this.hls.levels[o.level].details:o.type===D.PlaylistContextType.AUDIO_TRACK&&o.id!==null?v=this.hls.audioTracks[o.id].details:o.type===D.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(v=this.hls.subtitleTracks[o.id].details),v){var p=v.partTarget,c=v.targetduration;p&&c&&(w=Math.min(Math.max(p*3,c*.8)*1e3,w))}}var E={timeout:w,maxRetry:x,retryDelay:T,maxRetryDelay:y,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(o,E,_)},l.loadsuccess=function(o,n,f,O){if(O===void 0&&(O=null),f.isSidxRequest){this.handleSidxRequest(o,f),this.handlePlaylistLoaded(o,n,f,O);return}this.resetInternalLoader(f.type);var S=o.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,f,"no EXTM3U delimiter",O);return}n.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,n,f,O):this.handleMasterPlaylist(o,n,f,O)},l.loaderror=function(o,n,f){f===void 0&&(f=null),this.handleNetworkError(n,f,!1,o)},l.loadtimeout=function(o,n,f){f===void 0&&(f=null),this.handleNetworkError(n,f,!0)},l.handleMasterPlaylist=function(o,n,f,O){var S=this.hls,x=o.data,w=u(o,f),T=A.default.parseMasterPlaylist(x,w),y=T.levels,v=T.sessionData;if(!y.length){this.handleManifestParsingError(o,f,"no level found in manifest",O);return}var p=y.map(function(P){return{id:P.attrs.AUDIO,audioCodec:P.audioCodec}}),c=y.map(function(P){return{id:P.attrs.SUBTITLES,textCodec:P.textCodec}}),E=A.default.parseMasterPlaylistMedia(x,w,"AUDIO",p),_=A.default.parseMasterPlaylistMedia(x,w,"SUBTITLES",c),b=A.default.parseMasterPlaylistMedia(x,w,"CLOSED-CAPTIONS");if(E.length){var I=E.some(function(P){return!P.url});!I&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(j.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}S.trigger(N.Events.MANIFEST_LOADED,{levels:y,audioTracks:E,subtitles:_,captions:b,url:w,stats:n,networkDetails:O,sessionData:v})},l.handleTrackOrLevelPlaylist=function(o,n,f,O){var S=this.hls,x=f.id,w=f.level,T=f.type,y=u(o,f),v=Object(H.isFiniteNumber)(x)?x:0,p=Object(H.isFiniteNumber)(w)?w:v,c=h(f),E=A.default.parseLevelPlaylist(o.data,y,p,c,v);if(!E.fragments.length){S.trigger(N.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(T===D.PlaylistContextType.MANIFEST){var _={attrs:new g.AttrList({}),bitrate:0,details:E,name:"",url:y};S.trigger(N.Events.MANIFEST_LOADED,{levels:[_],audioTracks:[],url:y,stats:n,networkDetails:O,sessionData:null})}if(n.parsing.end=performance.now(),E.needSidxRanges){var b,I=(b=E.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:I,isSidxRequest:!0,type:T,level:w,levelDetails:E,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=E,this.handlePlaylistLoaded(o,n,f,O)},l.handleSidxRequest=function(o,n){var f=Object(k.parseSegmentIndex)(new Uint8Array(o.data));if(!f)return;var O=f.references,S=n.levelDetails;O.forEach(function(x,w){var T=x.info,y=S.fragments[w];y.byteRange.length===0&&y.setByteRange(String(1+T.end-T.start)+"@"+String(T.start)),y.initSegment&&y.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(o,n,f,O){this.hls.trigger(N.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===D.PlaylistContextType.MANIFEST,url:o.url,reason:f,response:o,context:n,networkDetails:O})},l.handleNetworkError=function(o,n,f,O){f===void 0&&(f=!1),j.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var S=R.ErrorDetails.UNKNOWN,x=!1,w=this.getInternalLoader(o);switch(o.type){case D.PlaylistContextType.MANIFEST:S=f?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case D.PlaylistContextType.LEVEL:S=f?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.AUDIO_TRACK:S=f?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:S=f?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}w&&this.resetInternalLoader(o.type);var T={type:R.ErrorTypes.NETWORK_ERROR,details:S,fatal:x,url:o.url,loader:w,context:o,networkDetails:n};O&&(T.response=O),this.hls.trigger(N.Events.ERROR,T)},l.handlePlaylistLoaded=function(o,n,f,O){var S=f.type,x=f.level,w=f.id,T=f.groupId,y=f.loader,v=f.levelDetails,p=f.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(o,f,"invalid target duration",O);return}if(!y)return;v.live&&(y.getCacheAge&&(v.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(S){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:v,level:x||0,id:w||0,stats:n,networkDetails:O,deliveryDirectives:p});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:v,id:w||0,groupId:T||"",stats:n,networkDetails:O,deliveryDirectives:p});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:v,id:w||0,groupId:T||"",stats:n,networkDetails:O,deliveryDirectives:p});break}},s}();K.default=d},"./src/polyfills/number.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"isFiniteNumber",function(){return H}),L.d(K,"MAX_SAFE_INTEGER",function(){return N});var H=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Y,K,L){"use strict";L.r(K);var H=function(){function N(){}return N.getSilentFrame=function(j,k){switch(j){case"mp4a.40.2":if(k===1)return new Uint8Array([0,200,0,128,35,128]);if(k===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(k===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(k===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(k===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(k===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(k===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(k===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(k===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},N}();K.default=H},"./src/remux/mp4-generator.ts":function(Y,K,L){"use strict";L.r(K);var H=Math.pow(2,32)-1,N=function(){function R(){}return R.init=function(){R.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 k;for(k in R.types)R.types.hasOwnProperty(k)&&(R.types[k]=[k.charCodeAt(0),k.charCodeAt(1),k.charCodeAt(2),k.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]),D=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]);R.HDLR_TYPES={video:A,audio:D};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=h,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,u,s,u,d),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,g))},R.box=function(k){for(var A=8,D=arguments.length,g=new Array(D>1?D-1:0),h=1;h<D;h++)g[h-1]=arguments[h];for(var u=g.length,d=u;u--;)A+=g[u].byteLength;var s=new Uint8Array(A);for(s[0]=A>>24&255,s[1]=A>>16&255,s[2]=A>>8&255,s[3]=A&255,s.set(k,4),u=0,A=8;u<d;u++)s.set(g[u],A),A+=g[u].byteLength;return s},R.hdlr=function(k){return R.box(R.types.hdlr,R.HDLR_TYPES[k])},R.mdat=function(k){return R.box(R.types.mdat,k)},R.mdhd=function(k,A){A*=k;var D=Math.floor(A/(H+1)),g=Math.floor(A%(H+1));return R.box(R.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},R.mdia=function(k){return R.box(R.types.mdia,R.mdhd(k.timescale,k.duration),R.hdlr(k.type),R.minf(k))},R.mfhd=function(k){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255]))},R.minf=function(k){return k.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(k)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(k))},R.moof=function(k,A,D){return R.box(R.types.moof,R.mfhd(k),R.traf(D,A))},R.moov=function(k){for(var A=k.length,D=[];A--;)D[A]=R.trak(k[A]);return R.box.apply(null,[R.types.moov,R.mvhd(k[0].timescale,k[0].duration)].concat(D).concat(R.mvex(k)))},R.mvex=function(k){for(var A=k.length,D=[];A--;)D[A]=R.trex(k[A]);return R.box.apply(null,[R.types.mvex].concat(D))},R.mvhd=function(k,A){A*=k;var D=Math.floor(A/(H+1)),g=Math.floor(A%(H+1)),h=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&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 R.box(R.types.mvhd,h)},R.sdtp=function(k){var A=k.samples||[],D=new Uint8Array(4+A.length),g,h;for(g=0;g<A.length;g++)h=A[g].flags,D[g+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return R.box(R.types.sdtp,D)},R.stbl=function(k){return R.box(R.types.stbl,R.stsd(k),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(k){var A=[],D=[],g,h,u;for(g=0;g<k.sps.length;g++)h=k.sps[g],u=h.byteLength,A.push(u>>>8&255),A.push(u&255),A=A.concat(Array.prototype.slice.call(h));for(g=0;g<k.pps.length;g++)h=k.pps[g],u=h.byteLength,D.push(u>>>8&255),D.push(u&255),D=D.concat(Array.prototype.slice.call(h));var d=R.box(R.types.avcC,new Uint8Array([1,A[3],A[4],A[5],252|3,224|k.sps.length].concat(A).concat([k.pps.length]).concat(D))),s=k.width,l=k.height,i=k.pixelRatio[0],o=k.pixelRatio[1];return R.box(R.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,s>>8&255,s&255,l>>8&255,l&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]),d,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,o>>24,o>>16&255,o>>8&255,o&255])))},R.esds=function(k){var A=k.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(k.config).concat([6,1,2]))},R.mp4a=function(k){var A=k.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]),R.box(R.types.esds,R.esds(k)))},R.mp3=function(k){var A=k.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]))},R.stsd=function(k){return k.type==="audio"?!k.isAAC&&k.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(k)):R.box(R.types.stsd,R.STSD,R.mp4a(k)):R.box(R.types.stsd,R.STSD,R.avc1(k))},R.tkhd=function(k){var A=k.id,D=k.duration*k.timescale,g=k.width,h=k.height,u=Math.floor(D/(H+1)),d=Math.floor(D%(H+1));return R.box(R.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,u>>24,u>>16&255,u>>8&255,u&255,d>>24,d>>16&255,d>>8&255,d&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,g>>8&255,g&255,0,0,h>>8&255,h&255,0,0]))},R.traf=function(k,A){var D=R.sdtp(k),g=k.id,h=Math.floor(A/(H+1)),u=Math.floor(A%(H+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])),R.trun(k,D.length+16+20+8+16+8+8),D)},R.trak=function(k){return k.duration=k.duration||4294967295,R.box(R.types.trak,R.tkhd(k),R.mdia(k))},R.trex=function(k){var A=k.id;return R.box(R.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]))},R.trun=function(k,A){var D=k.samples||[],g=D.length,h=12+16*g,u=new Uint8Array(h),d,s,l,i,o,n;for(A+=8+h,u.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255],0),d=0;d<g;d++)s=D[d],l=s.duration,i=s.size,o=s.flags,n=s.cts,u.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*d);return R.box(R.types.trun,u)},R.initSegment=function(k){R.types||R.init();var A=R.moov(k),D=new Uint8Array(R.FTYP.byteLength+A.byteLength);return D.set(R.FTYP),D.set(A,R.FTYP.byteLength),D},R}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,K.default=N},"./src/remux/mp4-remuxer.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return n}),L.d(K,"normalizePts",function(){return f});var H=L("./src/polyfills/number.ts"),N=L("./src/remux/aac-helper.ts"),R=L("./src/remux/mp4-generator.ts"),j=L("./src/events.ts"),k=L("./src/errors.ts"),A=L("./src/utils/logger.ts"),D=L("./src/types/loader.ts"),g=L("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign||function(w){for(var T=1;T<arguments.length;T++){var y=arguments[T];for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(w[v]=y[v])}return w},h.apply(this,arguments)}var u=10*1e3,d=1024,s=1152,l=null,i=null,o=!1,n=function(){function w(y,v,p,c){if(c===void 0&&(c=""),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=y,this.config=v,this.typeSupported=p,this.ISGenerated=!1,l===null){var E=navigator.userAgent||"",_=E.match(/Chrome\/(\d+)/i);l=_?parseInt(_[1]):0}if(i===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);i=b?parseInt(b[1]):0}o=!!l&&l<75||!!i&&i<600}var T=w.prototype;return T.destroy=function(){},T.resetTimeStamp=function(v){A.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=v},T.resetNextTimestamp=function(){A.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},T.resetInitSegment=function(){A.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},T.getVideoStartPts=function(v){var p=!1,c=v.reduce(function(E,_){var b=_.pts-E;return b<-4294967296?(p=!0,f(E,_.pts)):b>0?E:_.pts},v[0].pts);return p&&A.logger.debug("PTS rollover detected"),c},T.remux=function(v,p,c,E,_,b,I,P){var B,z,U,C,W,V,J=_,ne=_,fe=v.pid>-1,ue=p.pid>-1,le=p.samples.length,me=v.samples.length>0,ge=le>1,re=(!fe||me)&&(!ue||ge)||this.ISGenerated||I;if(re){this.ISGenerated||(U=this.generateIS(v,p,_));var oe=this.isVideoContiguous,xe=-1;if(ge&&(xe=O(p.samples),!oe&&this.config.forceKeyFrameOnDiscontinuity))if(V=!0,xe>0){A.logger.warn("[mp4-remuxer]: Dropped "+xe+" out of "+le+" video samples due to a missing keyframe");var Be=this.getVideoStartPts(p.samples);p.samples=p.samples.slice(xe),p.dropped+=xe,ne+=(p.samples[0].pts-Be)/(p.timescale||9e4)}else xe===-1&&(A.logger.warn("[mp4-remuxer]: No keyframe found out of "+le+" video samples"),V=!1);if(this.ISGenerated){if(me&&ge){var Ve=this.getVideoStartPts(p.samples),Ye=f(v.samples[0].pts,Ve)-Ve,$e=Ye/p.inputTimeScale;J+=Math.max(0,$e),ne+=Math.max(0,-$e)}if(me){if(v.samplerate||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(v,p,_)),z=this.remuxAudio(v,J,this.isAudioContiguous,b,ue||ge||P===D.PlaylistLevelType.AUDIO?ne:void 0),ge){var Ke=z?z.endPTS-z.startPTS:0;p.inputTimeScale||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(v,p,_)),B=this.remuxVideo(p,ne,oe,Ke)}}else ge&&(B=this.remuxVideo(p,ne,oe,0));B&&(B.firstKeyFrame=xe,B.independent=xe!==-1)}}return this.ISGenerated&&(c.samples.length&&(W=this.remuxID3(c,_)),E.samples.length&&(C=this.remuxText(E,_))),{audio:z,video:B,initSegment:U,independent:V,text:C,id3:W}},T.generateIS=function(v,p,c){var E=v.samples,_=p.samples,b=this.typeSupported,I={},P=!Object(H.isFiniteNumber)(this._initPTS),B="audio/mp4",z,U,C;if(P&&(z=U=Infinity),v.config&&E.length&&(v.timescale=v.samplerate,v.isAAC||(b.mpeg?(B="audio/mpeg",v.codec=""):b.mp3&&(v.codec="mp3")),I.audio={id:"audio",container:B,codec:v.codec,initSegment:!v.isAAC&&b.mpeg?new Uint8Array(0):R.default.initSegment([v]),metadata:{channelCount:v.channelCount}},P&&(C=v.inputTimeScale,z=U=E[0].pts-Math.round(C*c))),p.sps&&p.pps&&_.length&&(p.timescale=p.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:p.codec,initSegment:R.default.initSegment([p]),metadata:{width:p.width,height:p.height}},P)){C=p.inputTimeScale;var W=this.getVideoStartPts(_),V=Math.round(C*c);U=Math.min(U,f(_[0].dts,W)-V),z=Math.min(z,W-V)}if(Object.keys(I).length)return this.ISGenerated=!0,P&&(this._initPTS=z,this._initDTS=U),{tracks:I,initPTS:z,timescale:C}},T.remuxVideo=function(v,p,c,E){var _=v.inputTimeScale,b=v.samples,I=[],P=b.length,B=this._initPTS,z=this.nextAvcDts,U=8,C,W,V,J=Number.POSITIVE_INFINITY,ne=Number.NEGATIVE_INFINITY,fe=0,ue=!1;if(!c||z===null){var le=p*_,me=b[0].pts-f(b[0].dts,b[0].pts);z=le-me}for(var ge=0;ge<P;ge++){var re=b[ge];if(re.pts=f(re.pts-B,z),re.dts=f(re.dts-B,z),re.dts>re.pts){var oe=9e4*.2;fe=Math.max(Math.min(fe,re.pts-re.dts),-1*oe)}re.dts<b[ge>0?ge-1:ge].dts&&(ue=!0)}ue&&b.sort(function(rt,Me){var Ue=rt.dts-Me.dts,we=rt.pts-Me.pts;return Ue||we}),W=b[0].dts,V=b[b.length-1].dts;var xe=Math.round((V-W)/(P-1));if(fe<0){if(fe<xe*-2){A.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-xe,!0)+" ms");for(var Be=fe,Ve=0;Ve<P;Ve++)b[Ve].dts=Be=Math.max(Be,b[Ve].pts-xe),b[Ve].pts=Math.max(Be,b[Ve].pts)}else{A.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(fe,!0)+" ms to overcome this issue");for(var Ye=0;Ye<P;Ye++)b[Ye].dts=b[Ye].dts+fe}W=b[0].dts}if(c){var $e=W-z,Ke=$e>xe,We=$e<-1;if(Ke||We){Ke?A.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)($e,!0)+" ms ("+$e+"dts) hole between fragments detected, filling it"):A.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-$e,!0)+" ms ("+$e+"dts) overlapping between fragments detected"),W=z;var ze=b[0].pts-$e;b[0].dts=W,b[0].pts=ze,A.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(ze,!0)+"/"+Object(g.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(g.toMsFromMpegTsClock)($e,!0)+" ms")}}o&&(W=Math.max(0,W));for(var at=0,Je=0,Xe=0;Xe<P;Xe++){for(var He=b[Xe],ot=He.units,ft=ot.length,dt=0,lt=0;lt<ft;lt++)dt+=ot[lt].data.length;Je+=dt,at+=ft,He.length=dt,He.dts=Math.max(He.dts,W),He.pts=Math.max(He.pts,He.dts,0),J=Math.min(He.pts,J),ne=Math.max(He.pts,ne)}V=b[P-1].dts;var _t=Je+4*at+8,ht;try{ht=new Uint8Array(_t)}catch(rt){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_t,reason:"fail allocating video mdat "+_t});return}var be=new DataView(ht.buffer);be.setUint32(0,_t),ht.set(R.default.types.mdat,4);for(var _e=0;_e<P;_e++){for(var Ne=b[_e],ke=Ne.units,Ee=0,Ie=0,pe=ke.length;Ie<pe;Ie++){var ae=ke[Ie],ie=ae.data,Q=ae.data.byteLength;be.setUint32(U,Q),U+=4,ht.set(ie,U),U+=Q,Ee+=4+Q}if(_e<P-1)C=b[_e+1].dts-Ne.dts;else{var q=this.config,te=Ne.dts-b[_e>0?_e-1:_e].dts;if(q.stretchShortVideoTrack&&this.nextAudioPts!==null){var se=Math.floor(q.maxBufferHole*_),ce=(E?J+E*_:this.nextAudioPts)-Ne.pts;ce>se?(C=ce-te,C<0&&(C=te),A.logger.log("[mp4-remuxer]: It is approximately "+ce/90+" ms to the next segment; using duration "+C/90+" ms for the last video frame.")):C=te}else C=te}var Se=Math.round(Ne.pts-Ne.dts);I.push(new S(Ne.key,C,Ee,Se))}if(I.length&&l&&l<70){var je=I[0].flags;je.dependsOn=2,je.isNonSync=0}console.assert(C!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=z=V+C,this.isVideoContiguous=!0;var Ze=R.default.moof(v.sequenceNumber++,W,h({},v,{samples:I})),ut="video",it={data1:Ze,data2:ht,startPTS:J/_,endPTS:(ne+C)/_,startDTS:W/_,endDTS:z/_,type:ut,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(ht.length,"MDAT length must not be zero"),it},T.remuxAudio=function(v,p,c,E,_){var b=v.inputTimeScale,I=v.samplerate?v.samplerate:b,P=b/I,B=v.isAAC?d:s,z=B*P,U=this._initPTS,C=!v.isAAC&&this.typeSupported.mpeg,W=[],V=v.samples,J=C?0:8,ne=this.nextAudioPts||-1,fe=p*b;if(this.isAudioContiguous=c=c||V.length&&ne>0&&(E&&Math.abs(fe-ne)<9e3||Math.abs(f(V[0].pts-U,fe)-ne)<20*z),V.forEach(function(ie){ie.pts=f(ie.pts-U,fe)}),!c||ne<0){if(V=V.filter(function(ie){return ie.pts>=0}),!V.length)return;_===0?ne=0:E?ne=Math.max(0,fe):ne=V[0].pts}if(v.isAAC)for(var ue=_!==void 0,le=this.config.maxAudioFramesDrift,me=0,ge=ne;me<V.length;me++){var re=V[me],oe=re.pts,xe=oe-ge,Be=Math.abs(1e3*xe/b);if(xe<=-le*z&&ue)me===0&&(A.logger.warn("Audio frame @ "+(oe/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*xe/b)+" ms."),this.nextAudioPts=ne=ge=oe);else if(xe>=le*z&&Be<u&&ue){var Ve=Math.round(xe/z);ge=oe-Ve*z,ge<0&&(Ve--,ge+=z),me===0&&(this.nextAudioPts=ne=ge),A.logger.warn("[mp4-remuxer]: Injecting "+Ve+" audio frame @ "+(ge/b).toFixed(3)+"s due to "+Math.round(1e3*xe/b)+" ms gap.");for(var Ye=0;Ye<Ve;Ye++){var $e=Math.max(ge,0),Ke=N.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);Ke||(A.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ke=re.unit.subarray()),V.splice(me,0,{unit:Ke,pts:$e}),ge+=z,me++}}re.pts=ge,ge+=z}for(var We=null,ze=null,at,Je=0,Xe=V.length;Xe--;)Je+=V[Xe].unit.byteLength;for(var He=0,ot=V.length;He<ot;He++){var ft=V[He],dt=ft.unit,lt=ft.pts;if(ze!==null){var _t=W[He-1];_t.duration=Math.round((lt-ze)/P)}else if(c&&v.isAAC&&(lt=ne),We=lt,Je>0){Je+=J;try{at=new Uint8Array(Je)}catch(ie){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Je,reason:"fail allocating audio mdat "+Je});return}if(!C){var ht=new DataView(at.buffer);ht.setUint32(0,Je),at.set(R.default.types.mdat,4)}}else return;at.set(dt,J);var be=dt.byteLength;J+=be,W.push(new S(!0,B,be,0)),ze=lt}var _e=W.length;if(!_e)return;var Ne=W[W.length-1];this.nextAudioPts=ne=ze+P*Ne.duration;var ke=C?new Uint8Array(0):R.default.moof(v.sequenceNumber++,We/P,h({},v,{samples:W}));v.samples=[];var Ee=We/b,Ie=ne/b,pe="audio",ae={data1:ke,data2:at,startPTS:Ee,endPTS:Ie,startDTS:Ee,endDTS:Ie,type:pe,hasAudio:!0,hasVideo:!1,nb:_e};return this.isAudioContiguous=!0,console.assert(at.length,"MDAT length must not be zero"),ae},T.remuxEmptyAudio=function(v,p,c,E){var _=v.inputTimeScale,b=v.samplerate?v.samplerate:_,I=_/b,P=this.nextAudioPts,B=(P!==null?P:E.startDTS*_)+this._initDTS,z=E.endDTS*_+this._initDTS,U=I*d,C=Math.ceil((z-B)/U),W=N.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(A.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){A.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var V=[],J=0;J<C;J++){var ne=B+J*U;V.push({unit:W,pts:ne,dts:ne})}return v.samples=V,this.remuxAudio(v,p,c,!1)},T.remuxID3=function(v,p){var c=v.samples.length;if(!c)return;for(var E=v.inputTimeScale,_=this._initPTS,b=this._initDTS,I=0;I<c;I++){var P=v.samples[I];P.pts=f(P.pts-_,p*E)/E,P.dts=f(P.dts-b,p*E)/E}var B=v.samples;return v.samples=[],{samples:B}},T.remuxText=function(v,p){var c=v.samples.length;if(!c)return;for(var E=v.inputTimeScale,_=this._initPTS,b=0;b<c;b++){var I=v.samples[b];I.pts=f(I.pts-_,p*E)/E}v.samples.sort(function(B,z){return B.pts-z.pts});var P=v.samples;return v.samples=[],{samples:P}},w}();function f(w,T){var y;if(T===null)return w;for(T<w?y=-8589934592:y=8589934592;Math.abs(w-T)>4294967296;)w+=y;return w}function O(w){for(var T=0;T<w.length;T++)if(w[T].key)return T;return-1}var S=function(T,y,v,p){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=v,this.cts=p,this.flags=new x(T)},x=function(T){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=T?2:1,this.isNonSync=T?0:1}},"./src/remux/passthrough-remuxer.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/polyfills/number.ts"),N=L("./src/utils/mp4-tools.ts"),R=L("./src/loader/fragment.ts"),j=L("./src/utils/logger.ts"),k=function(){function g(){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 h=g.prototype;return h.destroy=function(){},h.resetTimeStamp=function(d){this.initPTS=d,this.lastEndDTS=null},h.resetNextTimestamp=function(){this.lastEndDTS=null},h.resetInitSegment=function(d,s,l){this.audioCodec=s,this.videoCodec=l,this.generateInitSegment(d),this.emitInitSegment=!0},h.generateInitSegment=function(d){var s=this.audioCodec,l=this.videoCodec;if(!d||!d.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(N.parseInitSegment)(d);s||(s=D(i.audio,R.ElementaryStreamTypes.AUDIO)),l||(l=D(i.video,R.ElementaryStreamTypes.VIDEO));var o={};i.audio&&i.video?o.audiovideo={container:"video/mp4",codec:s+","+l,initSegment:d,id:"main"}:i.audio?o.audio={container:"audio/mp4",codec:s,initSegment:d,id:"audio"}:i.video?o.video={container:"video/mp4",codec:l,initSegment:d,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},h.remux=function(d,s,l,i,o){var n=this.initPTS,f=this.lastEndDTS,O={audio:void 0,video:void 0,text:i,id3:l,initSegment:void 0};Object(H.isFiniteNumber)(f)||(f=this.lastEndDTS=o||0);var S=s.samples;if(!S||!S.length)return O;var x={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(S),w=this.initData),!w||!w.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(H.isFiniteNumber)(n)||(this.initPTS=x.initPTS=n=A(w,S,f));var T=Object(N.getDuration)(S,w),y=f,v=T+y;Object(N.offsetStartDTS)(w,S,n),T>0?this.lastEndDTS=v:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var p=!!w.audio,c=!!w.video,E="";p&&(E+="audio"),c&&(E+="video");var _={data1:S,startPTS:y,startDTS:y,endPTS:v,endDTS:v,type:E,hasAudio:p,hasVideo:c,nb:1,dropped:0};return O.audio=_.type==="audio"?_:void 0,O.video=_.type!=="audio"?_:void 0,O.text=i,O.id3=l,O.initSegment=x,O},g}(),A=function(h,u,d){return Object(N.getStartDTS)(h,u)-d};function D(g,h){var u=g==null?void 0:g.codec;return u&&u.length>4?u:u==="hvc1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||h===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}K.default=k},"./src/task-loop.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return H});var H=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=N.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(k){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,k),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},N}()},"./src/types/cmcd.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"CMCDVersion",function(){return H}),L.d(K,"CMCDObjectType",function(){return N}),L.d(K,"CMCDStreamingFormat",function(){return R}),L.d(K,"CMCDStreamType",function(){return j});var H=1,N;(function(k){k.MANIFEST="m",k.AUDIO="a",k.VIDEO="v",k.MUXED="av",k.INIT="i",k.CAPTION="c",k.TIMED_TEXT="tt",k.KEY="k",k.OTHER="o"})(N||(N={}));var R;(function(k){k.DASH="d",k.HLS="h",k.SMOOTH="s",k.OTHER="o"})(R||(R={}));var j;(function(k){k.VOD="v",k.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"HlsSkip",function(){return R}),L.d(K,"getSkipValue",function(){return j}),L.d(K,"HlsUrlParameters",function(){return k}),L.d(K,"Level",function(){return A});function H(D,g){for(var h=0;h<g.length;h++){var u=g[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(D,u.key,u)}}function N(D,g,h){return g&&H(D.prototype,g),h&&H(D,h),D}var R;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(R||(R={}));function j(D,g){var h=D.canSkipUntil,u=D.canSkipDateRanges,d=D.endSN,s=g!==void 0?g-d:0;return h&&s<h?u?R.v2:R.Yes:R.No}var k=function(){function D(h,u,d){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=h,this.part=u,this.skip=d}var g=D.prototype;return g.addDirectives=function(u){var d=new self.URL(u);return this.msn!==void 0&&d.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&d.searchParams.set("_HLS_part",this.part.toString()),this.skip&&d.searchParams.set("_HLS_skip",this.skip),d.toString()},D}(),A=function(){function D(g){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=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(h){return h}).join(",").replace(/\.[^.,]+/g,"")}return N(D,[{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(h){var u=h%this.url.length;this._urlId!==u&&(this.details=void 0,this._urlId=u)}}]),D}()},"./src/types/loader.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"PlaylistContextType",function(){return H}),L.d(K,"PlaylistLevelType",function(){return N});var H;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(H||(H={}));var N;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"ChunkMetadata",function(){return H});var H=function(j,k,A,D,g,h){D===void 0&&(D=0),g===void 0&&(g=-1),h===void 0&&(h=!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=N(),this.buffering={audio:N(),video:N(),audiovideo:N()},this.level=j,this.sn=k,this.id=A,this.size=D,this.part=g,this.partial=h};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"AttrList",function(){return R});var H=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function j(A){typeof A=="string"&&(A=j.parseAttrList(A));for(var D in A)A.hasOwnProperty(D)&&(this[D]=A[D])}var k=j.prototype;return k.decimalInteger=function(D){var g=parseInt(this[D],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},k.hexadecimalInteger=function(D){if(this[D]){var g=(this[D]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var h=new Uint8Array(g.length/2),u=0;u<g.length/2;u++)h[u]=parseInt(g.slice(u*2,u*2+2),16);return h}else return null},k.hexadecimalIntegerAsNumber=function(D){var g=parseInt(this[D],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},k.decimalFloatingPoint=function(D){return parseFloat(this[D])},k.optionalFloat=function(D,g){var h=this[D];return h?parseFloat(h):g},k.enumeratedString=function(D){return this[D]},k.bool=function(D){return this[D]==="YES"},k.decimalResolution=function(D){var g=H.exec(this[D]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},j.parseAttrList=function(D){var g,h={},u='"';for(N.lastIndex=0;(g=N.exec(D))!==null;){var d=g[2];d.indexOf(u)===0&&d.lastIndexOf(u)===d.length-1&&(d=d.slice(1,-1)),h[g[1]]=d}return h},j}()},"./src/utils/binary-search.ts":function(Y,K,L){"use strict";L.r(K);var H={search:function(R,j){for(var k=0,A=R.length-1,D=null,g=null;k<=A;){D=(k+A)/2|0,g=R[D];var h=j(g);if(h>0)k=D+1;else if(h<0)A=D-1;else return g}return null}};K.default=H},"./src/utils/buffer-helper.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"BufferHelper",function(){return R});var H=L("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function j(){}return j.isBuffered=function(A,D){try{if(A){for(var g=j.getBuffered(A),h=0;h<g.length;h++)if(D>=g.start(h)&&D<=g.end(h))return!0}}catch(u){}return!1},j.bufferInfo=function(A,D,g){try{if(A){var h=j.getBuffered(A),u=[],d;for(d=0;d<h.length;d++)u.push({start:h.start(d),end:h.end(d)});return this.bufferedInfo(u,D,g)}}catch(s){}return{len:0,start:D,end:D,nextStart:void 0}},j.bufferedInfo=function(A,D,g){D=Math.max(0,D),A.sort(function(x,w){var T=x.start-w.start;return T||w.end-x.end});var h=[];if(g)for(var u=0;u<A.length;u++){var d=h.length;if(d){var s=h[d-1].end;A[u].start-s<g?A[u].end>s&&(h[d-1].end=A[u].end):h.push(A[u])}else h.push(A[u])}else h=A;for(var l=0,i,o=D,n=D,f=0;f<h.length;f++){var O=h[f].start,S=h[f].end;if(D+g>=O&&D<S)o=O,n=S,l=n-D;else if(D+g<O){i=O;break}}return{len:l,start:o||0,end:n||0,nextStart:i}},j.getBuffered=function(A){try{return A.buffered}catch(D){return H.logger.log("failed to get media.buffered",D),N}},j}()},"./src/utils/cea-608-parser.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"Row",function(){return n}),L.d(K,"CaptionScreen",function(){return f});var H=L("./src/utils/logger.ts"),N={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},R=function(v){var p=v;return N.hasOwnProperty(v)&&(p=N[v]),String.fromCharCode(p)},j=15,k=100,A={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},u=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],d;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(d||(d={}));var s=function(){function y(){this.time=null,this.verboseLevel=d.ERROR}var v=y.prototype;return v.log=function(c,E){this.verboseLevel>=c&&H.logger.log(this.time+" ["+c+"] "+E)},y}(),l=function(v){for(var p=[],c=0;c<v.length;c++)p.push(v[c].toString(16));return p},i=function(){function y(p,c,E,_,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=p||"white",this.underline=c||!1,this.italics=E||!1,this.background=_||"black",this.flash=b||!1}var v=y.prototype;return v.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},v.setStyles=function(c){for(var E=["foreground","underline","italics","background","flash"],_=0;_<E.length;_++){var b=E[_];c.hasOwnProperty(b)&&(this[b]=c[b])}},v.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},v.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},v.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},v.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),o=function(){function y(p,c,E,_,b,I){this.uchar=void 0,this.penState=void 0,this.uchar=p||" ",this.penState=new i(c,E,_,b,I)}var v=y.prototype;return v.reset=function(){this.uchar=" ",this.penState.reset()},v.setChar=function(c,E){this.uchar=c,this.penState.copy(E)},v.setPenState=function(c){this.penState.copy(c)},v.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},v.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},v.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),n=function(){function y(p){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<k;c++)this.chars.push(new o);this.logger=p,this.pos=0,this.currPenState=new i}var v=y.prototype;return v.equals=function(c){for(var E=!0,_=0;_<k;_++)if(!this.chars[_].equals(c.chars[_])){E=!1;break}return E},v.copy=function(c){for(var E=0;E<k;E++)this.chars[E].copy(c.chars[E])},v.isEmpty=function(){for(var c=!0,E=0;E<k;E++)if(!this.chars[E].isEmpty()){c=!1;break}return c},v.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(d.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>k&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=k)},v.moveCursor=function(c){var E=this.pos+c;if(c>1)for(var _=this.pos+1;_<E+1;_++)this.chars[_].setPenState(this.currPenState);this.setCursor(E)},v.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},v.insertChar=function(c){c>=144&&this.backSpace();var E=R(c);if(this.pos>=k){this.logger.log(d.ERROR,"Cannot insert "+c.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(c){var E;for(E=c;E<k;E++)this.chars[E].reset()},v.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},v.clearToEndOfRow=function(){this.clearFromPos(this.pos)},v.getTextString=function(){for(var c=[],E=!0,_=0;_<k;_++){var b=this.chars[_].uchar;b!==" "&&(E=!1),c.push(b)}return E?"":c.join("")},v.setPenStyles=function(c){this.currPenState.setStyles(c);var E=this.chars[this.pos];E.setPenState(this.currPenState)},y}(),f=function(){function y(p){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<j;c++)this.rows.push(new n(p));this.logger=p,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var v=y.prototype;return v.reset=function(){for(var c=0;c<j;c++)this.rows[c].clear();this.currRow=j-1},v.equals=function(c){for(var E=!0,_=0;_<j;_++)if(!this.rows[_].equals(c.rows[_])){E=!1;break}return E},v.copy=function(c){for(var E=0;E<j;E++)this.rows[E].copy(c.rows[E])},v.isEmpty=function(){for(var c=!0,E=0;E<j;E++)if(!this.rows[E].isEmpty()){c=!1;break}return c},v.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},v.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},v.insertChar=function(c){var E=this.rows[this.currRow];E.insertChar(c)},v.setPen=function(c){var E=this.rows[this.currRow];E.setPenStyles(c)},v.moveCursor=function(c){var E=this.rows[this.currRow];E.moveCursor(c)},v.setCursor=function(c){this.logger.log(d.INFO,"setCursor: "+c);var E=this.rows[this.currRow];E.setCursor(c)},v.setPAC=function(c){this.logger.log(d.INFO,"pacData = "+JSON.stringify(c));var E=c.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var _=0;_<j;_++)this.rows[_].clear();var b=this.currRow+1-this.nrRollUpRows,I=this.lastOutputScreen;if(I){var P=I.rows[b].cueStartTime,B=this.logger.time;if(P&&B!==null&&P<B)for(var z=0;z<this.nrRollUpRows;z++)this.rows[E-this.nrRollUpRows+z+1].copy(I.rows[b+z])}}this.currRow=E;var U=this.rows[this.currRow];if(c.indent!==null){var C=c.indent,W=Math.max(C-1,0);U.setCursor(c.indent),c.color=U.chars[W].penState.foreground}var V={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(V)},v.setBkgData=function(c){this.logger.log(d.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},v.setRollUpRows=function(c){this.nrRollUpRows=c},v.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(d.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(d.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(c,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(d.INFO,"Rolling up")},v.getDisplayText=function(c){c=c||!1;for(var E=[],_="",b=-1,I=0;I<j;I++){var P=this.rows[I].getTextString();P&&(b=I+1,c?E.push("Row "+b+": '"+P+"'"):E.push(P.trim()))}return E.length>0&&(c?_="["+E.join(" | ")+"]":_=E.join(`
`)),_},v.getTextAndFormat=function(){return this.rows},y}(),O=function(){function y(p,c,E){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=p,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new f(E),this.nonDisplayedMemory=new f(E),this.lastOutputScreen=new f(E),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var v=y.prototype;return v.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},v.getHandler=function(){return this.outputFilter},v.setHandler=function(c){this.outputFilter=c},v.setPAC=function(c){this.writeScreen.setPAC(c)},v.setBkgData=function(c){this.writeScreen.setBkgData(c)},v.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(d.INFO,"MODE="+c),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=c},v.insertChars=function(c){for(var E=0;E<c.length;E++)this.writeScreen.insertChar(c[E]);var _=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(d.INFO,_+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(d.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},v.ccRCL=function(){this.logger.log(d.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},v.ccBS=function(){if(this.logger.log(d.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},v.ccAOF=function(){},v.ccAON=function(){},v.ccDER=function(){this.logger.log(d.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},v.ccRU=function(c){this.logger.log(d.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},v.ccFON=function(){this.logger.log(d.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},v.ccRDC=function(){this.logger.log(d.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},v.ccTR=function(){this.logger.log(d.INFO,"TR"),this.setMode("MODE_TEXT")},v.ccRTD=function(){this.logger.log(d.INFO,"RTD"),this.setMode("MODE_TEXT")},v.ccEDM=function(){this.logger.log(d.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},v.ccCR=function(){this.logger.log(d.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},v.ccENM=function(){this.logger.log(d.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},v.ccEOC=function(){if(this.logger.log(d.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(d.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},v.ccTO=function(c){this.logger.log(d.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},v.ccMIDROW=function(c){var E={flash:!1};if(E.underline=c%2===1,E.italics=c>=46,E.italics)E.foreground="white";else{var _=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=b[_]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},v.outputDataUpdate=function(c){c===void 0&&(c=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},y}(),S=function(){function y(p,c,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var _=new s;this.channels=[null,new O(p,c,_),new O(p+1,E,_)],this.cmdHistory=T(),this.logger=_}var v=y.prototype;return v.getHandler=function(c){return this.channels[c].getHandler()},v.setHandler=function(c,E){this.channels[c].setHandler(E)},v.addData=function(c,E){var _,b,I,P=!1;this.logger.time=c;for(var B=0;B<E.length;B+=2){if(b=E[B]&127,I=E[B+1]&127,b===0&&I===0)continue;if(this.logger.log(d.DATA,"["+l([E[B],E[B+1]])+"] -> ("+l([b,I])+")"),_=this.parseCmd(b,I),_||(_=this.parseMidrow(b,I)),_||(_=this.parsePAC(b,I)),_||(_=this.parseBackgroundAttributes(b,I)),!_&&(P=this.parseChars(b,I),P)){var z=this.currentChannel;if(z&&z>0){var U=this.channels[z];U.insertChars(P)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!_&&!P&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+l([b,I])+" orig: "+l([E[B],E[B+1]]))}},v.parseCmd=function(c,E){var _=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&E>=32&&E<=47,I=(c===23||c===31)&&E>=33&&E<=35;if(!(b||I))return!1;if(w(c,E,_))return x(null,null,_),this.logger.log(d.DEBUG,"Repeated command ("+l([c,E])+") is dropped"),!0;var P=c===20||c===21||c===23?1:2,B=this.channels[P];return c===20||c===21||c===28||c===29?E===32?B.ccRCL():E===33?B.ccBS():E===34?B.ccAOF():E===35?B.ccAON():E===36?B.ccDER():E===37?B.ccRU(2):E===38?B.ccRU(3):E===39?B.ccRU(4):E===40?B.ccFON():E===41?B.ccRDC():E===42?B.ccTR():E===43?B.ccRTD():E===44?B.ccEDM():E===45?B.ccCR():E===46?B.ccENM():E===47&&B.ccEOC():B.ccTO(E-32),x(c,E,_),this.currentChannel=P,!0},v.parseMidrow=function(c,E){var _=0;if((c===17||c===25)&&E>=32&&E<=47){if(c===17?_=1:_=2,_!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[_];return b?(b.ccMIDROW(E),this.logger.log(d.DEBUG,"MIDROW ("+l([c,E])+")"),!0):!1}return!1},v.parsePAC=function(c,E){var _,b=this.cmdHistory,I=(c>=17&&c<=23||c>=25&&c<=31)&&E>=64&&E<=127,P=(c===16||c===24)&&E>=64&&E<=95;if(!(I||P))return!1;if(w(c,E,b))return x(null,null,b),!0;var B=c<=23?1:2;E>=64&&E<=95?_=B===1?A[c]:g[c]:_=B===1?D[c]:h[c];var z=this.channels[B];return z?(z.setPAC(this.interpretPAC(_,E)),x(c,E,b),this.currentChannel=B,!0):!1},v.interpretPAC=function(c,E){var _,b={color:null,italics:!1,indent:null,underline:!1,row:c};return E>95?_=E-96:_=E-64,b.underline=(_&1)===1,_<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(_/2)]:_<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((_-16)/2)*4,b},v.parseChars=function(c,E){var _,b=null,I=null;if(c>=25?(_=2,I=c-8):(_=1,I=c),I>=17&&I<=19){var P;I===17?P=E+80:I===18?P=E+112:P=E+144,this.logger.log(d.INFO,"Special char '"+R(P)+"' in channel "+_),b=[P]}else c>=32&&c<=127&&(b=E===0?[c]:[c,E]);if(b){var B=l(b);this.logger.log(d.DEBUG,"Char codes = "+B.join(",")),x(c,E,this.cmdHistory)}return b},v.parseBackgroundAttributes=function(c,E){var _=(c===16||c===24)&&E>=32&&E<=47,b=(c===23||c===31)&&E>=45&&E<=47;if(!(_||b))return!1;var I,P={};c===16||c===24?(I=Math.floor((E-32)/2),P.background=u[I],E%2===1&&(P.background=P.background+"_semi")):E===45?P.background="transparent":(P.foreground="black",E===47&&(P.underline=!0));var B=c<=23?1:2,z=this.channels[B];return z.setBkgData(P),x(c,E,this.cmdHistory),!0},v.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var E=this.channels[c];E&&E.reset()}this.cmdHistory=T()},v.cueSplitAtTime=function(c){for(var E=0;E<this.channels.length;E++){var _=this.channels[E];_&&_.cueSplitAtTime(c)}},y}();function x(y,v,p){p.a=y,p.b=v}function w(y,v,p){return p.a===y&&p.b===v}function T(){return{a:null,b:null}}K.default=S},"./src/utils/codecs.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"isCodecType",function(){return N}),L.d(K,"isCodecSupportedInMp4",function(){return R});var H={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 N(j,k){var A=H[k];return!!A&&A[j.slice(0,4)]===!0}function R(j,k){return MediaSource.isTypeSupported((k||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/utils/vttparser.ts"),N=L("./src/utils/webvtt-parser.ts"),R=L("./src/utils/texttrack-utils.ts"),j=/\s/,k={newCue:function(D,g,h,u){for(var d=[],s,l,i,o,n,f=self.VTTCue||self.TextTrackCue,O=0;O<u.rows.length;O++)if(s=u.rows[O],i=!0,o=0,n="",!s.isEmpty()){for(var S=0;S<s.chars.length;S++)j.test(s.chars[S].uchar)&&i?o++:(n+=s.chars[S].uchar,i=!1);s.cueStartTime=g,g===h&&(h+=1e-4),o>=16?o--:o++;var x=Object(H.fixLineBreaks)(n.trim()),w=Object(N.generateCueId)(g,h,x);(!D||!D.cues||!D.cues.getCueById(w))&&(l=new f(g,h,x),l.id=w,l.line=O+1,l.align="left",l.position=10+Math.min(80,Math.floor(o*8/32)*10),d.push(l))}return D&&d.length&&(d.sort(function(T,y){return T.line==="auto"||y.line==="auto"?0:T.line>8&&y.line>8?y.line-T.line:T.line-y.line}),d.forEach(function(T){return Object(R.addCueToTrack)(D,T)})),d}};K.default=k},"./src/utils/discontinuities.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"findFirstFragWithCC",function(){return j}),L.d(K,"shouldAlignOnDiscontinuities",function(){return k}),L.d(K,"findDiscontinuousReferenceFrag",function(){return A}),L.d(K,"adjustSlidingStart",function(){return g}),L.d(K,"alignStream",function(){return h}),L.d(K,"alignPDT",function(){return d}),L.d(K,"alignFragmentByPDTDelta",function(){return s}),L.d(K,"alignMediaPlaylistByPDT",function(){return l});var H=L("./src/polyfills/number.ts"),N=L("./src/utils/logger.ts"),R=L("./src/controller/level-helper.ts");function j(i,o){for(var n=null,f=0,O=i.length;f<O;f++){var S=i[f];if(S&&S.cc===o){n=S;break}}return n}function k(i,o,n){return!!(o.details&&(n.endCC>n.startCC||i&&i.cc<n.startCC))}function A(i,o){var n=i.fragments,f=o.fragments;if(!f.length||!n.length){N.logger.log("No fragments to align");return}var O=j(n,f[0].cc);if(!O||O&&!O.startPTS){N.logger.log("No frag in previous level to align on");return}return O}function D(i,o){if(i){var n=i.start+o;i.start=i.startPTS=n,i.endPTS=n+i.duration}}function g(i,o){for(var n=o.fragments,f=0,O=n.length;f<O;f++)D(n[f],i);o.fragmentHint&&D(o.fragmentHint,i),o.alignedSliding=!0}function h(i,o,n){if(!o)return;u(i,n,o),!n.alignedSliding&&o.details&&d(n,o.details),!n.alignedSliding&&o.details&&!n.skippedSegments&&Object(R.adjustSliding)(o.details,n)}function u(i,o,n){if(k(i,n,o)){var f=A(n.details,o);f&&Object(H.isFiniteNumber)(f.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),g(f.start,o))}}function d(i,o){if(!o.fragments.length||!i.hasProgramDateTime||!o.hasProgramDateTime)return;var n=o.fragments[0].programDateTime,f=i.fragments[0].programDateTime,O=(f-n)/1e3+o.fragments[0].start;O&&Object(H.isFiniteNumber)(O)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(f-n)+"ms, sliding:"+O.toFixed(3)+" "+i.url+" "),g(O,i))}function s(i,o){var n=i.programDateTime;if(!n)return;var f=(n-o)/1e3;i.start=i.startPTS=f,i.endPTS=f+i.duration}function l(i,o){if(!o.fragments.length||!i.hasProgramDateTime||!o.hasProgramDateTime)return;var n=o.fragments[0].programDateTime,f=o.fragments[0].start,O=n-f*1e3;i.fragments.forEach(function(S){s(S,O)}),i.fragmentHint&&s(i.fragmentHint,O),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/utils/ewma.ts"),N=function(){function R(k,A,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new H.default(k),this.fast_=new H.default(A)}var j=R.prototype;return j.update=function(A,D){var g=this.slow_,h=this.fast_;this.slow_.halfLife!==A&&(this.slow_=new H.default(A,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new H.default(D,h.getEstimate(),h.getTotalWeight()))},j.sample=function(A,D){A=Math.max(A,this.minDelayMs_);var g=8*D,h=A/1e3,u=g/h;this.fast_.sample(h,u),this.slow_.sample(h,u)},j.canEstimate=function(){var A=this.fast_;return A&&A.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},R}();K.default=N},"./src/utils/ewma.ts":function(Y,K,L){"use strict";L.r(K);var H=function(){function N(j,k,A){k===void 0&&(k=0),A===void 0&&(A=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=k,this.totalWeight_=A}var R=N.prototype;return R.sample=function(k,A){var D=Math.pow(this.alpha_,k);this.estimate_=A*(1-D)+D*this.estimate_,this.totalWeight_+=k},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var k=1-Math.pow(this.alpha_,this.totalWeight_);if(k)return this.estimate_/k}return this.estimate_},N}();K.default=H},"./src/utils/fetch-loader.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"fetchSupported",function(){return s});var H=L("./src/polyfills/number.ts"),N=L("./src/loader/load-stats.ts"),R=L("./src/demux/chunk-cache.ts");function j(f,O){f.prototype=Object.create(O.prototype),f.prototype.constructor=f,h(f,O)}function k(f){var O=typeof Map=="function"?new Map:void 0;return k=function(x){if(x===null||!g(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(x))return O.get(x);O.set(x,w)}function w(){return A(x,arguments,u(this).constructor)}return w.prototype=Object.create(x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),h(w,x)},k(f)}function A(f,O,S){return D()?A=Reflect.construct:A=function(w,T,y){var v=[null];v.push.apply(v,T);var p=Function.bind.apply(w,v),c=new p;return y&&h(c,y.prototype),c},A.apply(null,arguments)}function D(){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(f){return!1}}function g(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function h(f,O){return h=Object.setPrototypeOf||function(x,w){return x.__proto__=w,x},h(f,O)}function u(f){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},u(f)}function d(){return d=Object.assign||function(f){for(var O=1;O<arguments.length;O++){var S=arguments[O];for(var x in S)Object.prototype.hasOwnProperty.call(S,x)&&(f[x]=S[x])}return f},d.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(f){}return!1}var l=function(){function f(S){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=S.fetchSetup||o,this.controller=new self.AbortController,this.stats=new N.LoadStats}var O=f.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(x,w,T){var y=this,v=this.stats;if(v.loading.start)throw new Error("Loader can only be used once.");v.loading.start=self.performance.now();var p=i(x,this.controller.signal),c=T.onProgress,E=x.responseType==="arraybuffer",_=E?"byteLength":"length";this.context=x,this.config=w,this.callbacks=T,this.request=this.fetchSetup(x,p),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),T.onTimeout(v,x,y.response)},w.timeout),self.fetch(this.request).then(function(b){if(y.response=y.loader=b,!b.ok){var I=b.status,P=b.statusText;throw new n(P||"fetch, bad network response",I,b)}return v.loading.first=Math.max(self.performance.now(),v.loading.start),v.total=parseInt(b.headers.get("Content-Length")||"0"),c&&Object(H.isFiniteNumber)(w.highWaterMark)?y.loadProgressively(b,v,x,w.highWaterMark,c):E?b.arrayBuffer():b.text()}).then(function(b){var I=y.response;self.clearTimeout(y.requestTimeout),v.loading.end=Math.max(self.performance.now(),v.loading.first),v.loaded=v.total=b[_];var P={url:I.url,data:b};c&&!Object(H.isFiniteNumber)(w.highWaterMark)&&c(v,x,b,I),T.onSuccess(P,v,x,I)}).catch(function(b){if(self.clearTimeout(y.requestTimeout),v.aborted)return;var I=b.code||0;T.onError({code:I,text:b.message},x,b.details)})},O.getCacheAge=function(){var x=null;if(this.response){var w=this.response.headers.get("age");x=w?parseFloat(w):null}return x},O.loadProgressively=function(x,w,T,y,v){y===void 0&&(y=0);var p=new R.default,c=x.body.getReader(),E=function _(){return c.read().then(function(b){if(b.done)return p.dataLength&&v(w,T,p.flush(),x),Promise.resolve(new ArrayBuffer(0));var I=b.value,P=I.length;return w.loaded+=P,P<y||p.dataLength?(p.push(I),p.dataLength>=y&&v(w,T,p.flush(),x)):v(w,T,I,x),_()}).catch(function(){return Promise.reject()})};return E()},f}();function i(f,O){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(d({},f.headers))};return f.rangeEnd&&S.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),S}function o(f,O){return new self.Request(f.url,O)}var n=function(f){j(O,f);function O(S,x,w){var T;return T=f.call(this,S)||this,T.code=void 0,T.details=void 0,T.code=x,T.details=w,T}return O}(k(Error));K.default=l},"./src/utils/imsc1-ttml-parser.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"IMSC1_CODEC",function(){return g}),L.d(K,"parseIMSC1",function(){return s});var H=L("./src/utils/mp4-tools.ts"),N=L("./src/utils/vttparser.ts"),R=L("./src/utils/vttcue.ts"),j=L("./src/demux/id3.ts"),k=L("./src/utils/timescale-conversion.ts"),A=L("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var p=arguments[v];for(var c in p)Object.prototype.hasOwnProperty.call(p,c)&&(y[c]=p[c])}return y},D.apply(this,arguments)}var g="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,u=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,d={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(y,v,p,c,E){var _=Object(H.findBox)(new Uint8Array(y),["mdat"]);if(_.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var b=_[0],I=Object(j.utf8ArrayToStr)(new Uint8Array(y,b.start,b.end-b.start)),P=Object(k.toTimescaleFromScale)(v,1,p);try{c(l(I,P))}catch(B){E(B)}}function l(y,v){var p=new DOMParser,c=p.parseFromString(y,"text/xml"),E=c.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var _={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(_).reduce(function(U,C){return U[C]=E.getAttribute("ttp:"+C)||_[C],U},{}),I=E.getAttribute("xml:space")!=="preserve",P=o(i(E,"styling","style")),B=o(i(E,"layout","region")),z=i(E,"body","[begin]");return[].map.call(z,function(U){var C=n(U,I);if(!C||!U.hasAttribute("begin"))return null;var W=x(U.getAttribute("begin"),b),V=x(U.getAttribute("dur"),b),J=x(U.getAttribute("end"),b);if(W===null)throw S(U);if(J===null){if(V===null)throw S(U);J=W+V}var ne=new R.default(W-v,J-v,C);ne.id=Object(A.generateCueId)(ne.startTime,ne.endTime,ne.text);var fe=B[U.getAttribute("region")],ue=P[U.getAttribute("style")];ne.position=10,ne.size=80;var le=f(fe,ue),me=le.textAlign;if(me){var ge=d[me];ge&&(ne.lineAlign=ge),ne.align=me}return D(ne,le),ne}).filter(function(U){return U!==null})}function i(y,v,p){var c=y.getElementsByTagName(v)[0];return c?[].slice.call(c.querySelectorAll(p)):[]}function o(y){return y.reduce(function(v,p){var c=p.getAttribute("xml:id");return c&&(v[c]=p),v},{})}function n(y,v){return[].slice.call(y.childNodes).reduce(function(p,c,E){var _;return c.nodeName==="br"&&E?p+`
`:(_=c.childNodes)!==null&&_!==void 0&&_.length?n(c,v):v?p+c.textContent.trim().replace(/\s+/g," "):p+c.textContent},"")}function f(y,v){var p="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(E,_){var b=O(v,p,_)||O(y,p,_);return b&&(E[_]=b),E},{})}function O(y,v,p){return y.hasAttributeNS(v,p)?y.getAttributeNS(v,p):null}function S(y){return new Error("Could not parse ttml timestamp "+y)}function x(y,v){if(!y)return null;var p=Object(N.parseTimeStamp)(y);return p===null&&(h.test(y)?p=w(y,v):u.test(y)&&(p=T(y,v))),p}function w(y,v){var p=h.exec(y),c=(p[4]|0)+(p[5]|0)/v.subFrameRate;return(p[1]|0)*3600+(p[2]|0)*60+(p[3]|0)+c/v.frameRate}function T(y,v){var p=u.exec(y),c=Number(p[1]),E=p[2];switch(E){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/v.frameRate;case"t":return c/v.tickRate}return c}},"./src/utils/logger.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"enableLogs",function(){return A}),L.d(K,"logger",function(){return D});var H=function(){},N={trace:H,debug:H,log:H,warn:H,info:H,error:H},R=N;function j(g){var h=self.console[g];return h?h.bind(self.console,"["+g+"] >"):H}function k(g){for(var h=arguments.length,u=new Array(h>1?h-1:0),d=1;d<h;d++)u[d-1]=arguments[d];u.forEach(function(s){R[s]=g[s]?g[s].bind(g):j(s)})}function A(g){if(self.console&&g===!0||typeof g=="object"){k(g,"debug","log","info","warn","error");try{R.log()}catch(h){R=N}}else R=N}var D=R},"./src/utils/mediakeys-helper.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"KeySystems",function(){return H}),L.d(K,"requestMediaKeySystemAccess",function(){return N});var H;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(H||(H={}));var N=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"getMediaSource",function(){return H});function H(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"bin2str",function(){return k}),L.d(K,"readUint16",function(){return A}),L.d(K,"readUint32",function(){return D}),L.d(K,"writeUint32",function(){return g}),L.d(K,"findBox",function(){return h}),L.d(K,"parseSegmentIndex",function(){return u}),L.d(K,"parseInitSegment",function(){return d}),L.d(K,"getStartDTS",function(){return s}),L.d(K,"getDuration",function(){return l}),L.d(K,"computeRawDurationFromSamples",function(){return i}),L.d(K,"offsetStartDTS",function(){return o}),L.d(K,"segmentValidRange",function(){return n}),L.d(K,"appendUint8Array",function(){return f});var H=L("./src/utils/typed-array.ts"),N=L("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,j=[].push;function k(O){return String.fromCharCode.apply(null,O)}function A(O,S){"data"in O&&(S+=O.start,O=O.data);var x=O[S]<<8|O[S+1];return x<0?65536+x:x}function D(O,S){"data"in O&&(S+=O.start,O=O.data);var x=O[S]<<24|O[S+1]<<16|O[S+2]<<8|O[S+3];return x<0?4294967296+x:x}function g(O,S,x){"data"in O&&(S+=O.start,O=O.data),O[S]=x>>24,O[S+1]=x>>16&255,O[S+2]=x>>8&255,O[S+3]=x&255}function h(O,S){var x=[];if(!S.length)return x;var w,T,y;"data"in O?(w=O.data,T=O.start,y=O.end):(w=O,T=0,y=w.byteLength);for(var v=T;v<y;){var p=D(w,v),c=k(w.subarray(v+4,v+8)),E=p>1?v+p:y;if(c===S[0])if(S.length===1)x.push({data:w,start:v+8,end:E});else{var _=h({data:w,start:v+8,end:E},S.slice(1));_.length&&j.apply(x,_)}v=E}return x}function u(O){var S=h(O,["moov"]),x=S[0],w=x?x.end:null,T=h(O,["sidx"]);if(!T||!T[0])return null;var y=[],v=T[0],p=v.data[0],c=p===0?8:16,E=D(v,c);c+=4;var _=0,b=0;p===0?c+=8:c+=16,c+=2;var I=v.end+b,P=A(v,c);c+=2;for(var B=0;B<P;B++){var z=c,U=D(v,z);z+=4;var C=U&2147483647,W=(U&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var V=D(v,z);z+=4,y.push({referenceSize:C,subsegmentDuration:V,info:{duration:V/E,start:I,end:I+C-1}}),I+=C,z+=4,c=z}return{earliestPresentationTime:_,timescale:E,version:p,referencesCount:P,references:y,moovEndOffset:w}}function d(O){for(var S=[],x=h(O,["moov","trak"]),w=0;w<x.length;w++){var T=x[w],y=h(T,["tkhd"])[0];if(y){var v=y.data[y.start],p=v===0?12:20,c=D(y,p),E=h(T,["mdia","mdhd"])[0];if(E){v=E.data[E.start],p=v===0?12:20;var _=D(E,p),b=h(T,["mdia","hdlr"])[0];if(b){var I=k(b.data.subarray(b.start+8,b.start+12)),P={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[I];if(P){var B=h(T,["mdia","minf","stbl","stsd"])[0],z=void 0;B&&(z=k(B.data.subarray(B.start+12,B.start+16))),S[c]={timescale:_,type:P},S[P]={timescale:_,id:c,codec:z}}}}}}var U=h(O,["moov","mvex","trex"]);return U.forEach(function(C){var W=D(C,4),V=S[W];V&&(V.default={duration:D(C,12),flags:D(C,20)})}),S}function s(O,S){return h(S,["moof","traf"]).reduce(function(x,w){var T=h(w,["tfdt"])[0],y=T.data[T.start],v=h(w,["tfhd"]).reduce(function(p,c){var E=D(c,4),_=O[E];if(_){var b=D(T,4);y===1&&(b*=Math.pow(2,32),b+=D(T,8));var I=_.timescale||9e4,P=b/I;if(isFinite(P)&&(p===null||P<p))return P}return p},null);return v!==null&&isFinite(v)&&(x===null||v<x)?v:x},null)||0}function l(O,S){for(var x=0,w=0,T=0,y=h(O,["moof","traf"]),v=0;v<y.length;v++){var p=y[v],c=h(p,["tfhd"])[0],E=D(c,4),_=S[E];if(!_)continue;var b=_.default,I=D(c,0)|(b==null?void 0:b.flags),P=b==null?void 0:b.duration;I&8&&(I&2?P=D(c,12):P=D(c,8));for(var B=_.timescale||9e4,z=h(p,["trun"]),U=0;U<z.length;U++){if(P){var C=D(z[U],4);x=P*C}else x=i(z[U]);_.type===N.ElementaryStreamTypes.VIDEO?w+=x/B:_.type===N.ElementaryStreamTypes.AUDIO&&(T+=x/B)}}if(w===0&&T===0){var W=u(O);if(W!=null&&W.references)return W.references.reduce(function(V,J){return V+J.info.duration||0},0)}return w||T}function i(O){var S=D(O,0),x=8;S&1&&(x+=4),S&4&&(x+=4);for(var w=0,T=D(O,4),y=0;y<T;y++){if(S&256){var v=D(O,x);w+=v,x+=4}S&512&&(x+=4),S&1024&&(x+=4),S&2048&&(x+=4)}return w}function o(O,S,x){h(S,["moof","traf"]).forEach(function(w){h(w,["tfhd"]).forEach(function(T){var y=D(T,4),v=O[y];if(!v)return;var p=v.timescale||9e4;h(w,["tfdt"]).forEach(function(c){var E=c.data[c.start],_=D(c,4);if(E===0)g(c,4,_-x*p);else{_*=Math.pow(2,32),_+=D(c,8),_-=x*p,_=Math.max(_,0);var b=Math.floor(_/(R+1)),I=Math.floor(_%(R+1));g(c,4,b),g(c,8,I)}})})})}function n(O){var S={valid:null,remainder:null},x=h(O,["moof"]);if(x){if(x.length<2)return S.remainder=O,S}else return S;var w=x[x.length-1];return S.valid=Object(H.sliceUint8)(O,0,w.start-8),S.remainder=Object(H.sliceUint8)(O,w.start-8),S}function f(O,S){var x=new Uint8Array(O.length+S.length);return x.set(O),x.set(S,O.length),x}},"./src/utils/output-filter.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"default",function(){return H});var H=function(){function N(j,k){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=k}var R=N.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(k,A,D){(this.startTime===null||this.startTime>k)&&(this.startTime=k),this.endTime=A,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"sendAddTrackEvent",function(){return N}),L.d(K,"addCueToTrack",function(){return R}),L.d(K,"clearCurrentCues",function(){return j}),L.d(K,"removeCuesInRange",function(){return k}),L.d(K,"getCuesInRange",function(){return D});var H=L("./src/utils/logger.ts");function N(g,h){var u;try{u=new Event("addtrack")}catch(d){u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,h.dispatchEvent(u)}function R(g,h){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(h.id))try{if(g.addCue(h),!g.cues.getCueById(h.id))throw new Error("addCue is failed for: "+h)}catch(s){H.logger.debug("[texttrack-utils]: "+s);var d=new self.TextTrackCue(h.startTime,h.endTime,h.text);d.id=h.id,g.addCue(d)}u==="disabled"&&(g.mode=u)}function j(g){var h=g.mode;if(h==="disabled"&&(g.mode="hidden"),g.cues)for(var u=g.cues.length;u--;)g.removeCue(g.cues[u]);h==="disabled"&&(g.mode=h)}function k(g,h,u){var d=g.mode;if(d==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var s=D(g.cues,h,u),l=0;l<s.length;l++)g.removeCue(s[l]);d==="disabled"&&(g.mode=d)}function A(g,h){if(h<g[0].startTime)return 0;var u=g.length-1;if(h>g[u].endTime)return-1;for(var d=0,s=u;d<=s;){var l=Math.floor((s+d)/2);if(h<g[l].startTime)s=l-1;else if(h>g[l].startTime&&d<u)d=l+1;else return l}return g[d].startTime-h<h-g[s].startTime?d:s}function D(g,h,u){var d=[],s=A(g,h);if(s>-1)for(var l=s,i=g.length;l<i;l++){var o=g[l];if(o.startTime>=h&&o.endTime<=u)d.push(o);else if(o.startTime>u)return d}return d}},"./src/utils/time-ranges.ts":function(Y,K,L){"use strict";L.r(K);var H={toString:function(R){for(var j="",k=R.length,A=0;A<k;A++)j+="["+R.start(A).toFixed(3)+","+R.end(A).toFixed(3)+"]";return j}};K.default=H},"./src/utils/timescale-conversion.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"toTimescaleFromBase",function(){return N}),L.d(K,"toTimescaleFromScale",function(){return R}),L.d(K,"toMsFromMpegTsClock",function(){return j}),L.d(K,"toMpegTsClockFromTimescale",function(){return k});var H=9e4;function N(A,D,g,h){g===void 0&&(g=1),h===void 0&&(h=!1);var u=A*D*g;return h?Math.round(u):u}function R(A,D,g,h){return g===void 0&&(g=1),h===void 0&&(h=!1),N(A,D,1/g,h)}function j(A,D){return D===void 0&&(D=!1),N(A,1e3,1/H,D)}function k(A,D){return D===void 0&&(D=1),N(A,H,1/D)}},"./src/utils/typed-array.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"sliceUint8",function(){return H});function H(N,R,j){return Uint8Array.prototype.slice?N.slice(R,j):new Uint8Array(Array.prototype.slice.call(N,R,j))}},"./src/utils/vttcue.ts":function(Y,K,L){"use strict";L.r(K),K.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var H=["","lr","rl"],N=["start","middle","end","left","right"];function R(g,h){if(typeof h!="string")return!1;if(!Array.isArray(g))return!1;var u=h.toLowerCase();return~g.indexOf(u)?u:!1}function j(g){return R(H,g)}function k(g){return R(N,g)}function A(g){for(var h=arguments.length,u=new Array(h>1?h-1:0),d=1;d<h;d++)u[d-1]=arguments[d];for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var i in l)g[i]=l[i]}return g}function D(g,h,u){var d=this,s={enumerable:!0};d.hasBeenReset=!1;var l="",i=!1,o=g,n=h,f=u,O=null,S="",x=!0,w="auto",T="start",y=50,v="middle",p=50,c="middle";Object.defineProperty(d,"id",A({},s,{get:function(){return l},set:function(_){l=""+_}})),Object.defineProperty(d,"pauseOnExit",A({},s,{get:function(){return i},set:function(_){i=!!_}})),Object.defineProperty(d,"startTime",A({},s,{get:function(){return o},set:function(_){if(typeof _!="number")throw new TypeError("Start time must be set to a number.");o=_,this.hasBeenReset=!0}})),Object.defineProperty(d,"endTime",A({},s,{get:function(){return n},set:function(_){if(typeof _!="number")throw new TypeError("End time must be set to a number.");n=_,this.hasBeenReset=!0}})),Object.defineProperty(d,"text",A({},s,{get:function(){return f},set:function(_){f=""+_,this.hasBeenReset=!0}})),Object.defineProperty(d,"region",A({},s,{get:function(){return O},set:function(_){O=_,this.hasBeenReset=!0}})),Object.defineProperty(d,"vertical",A({},s,{get:function(){return S},set:function(_){var b=j(_);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");S=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"snapToLines",A({},s,{get:function(){return x},set:function(_){x=!!_,this.hasBeenReset=!0}})),Object.defineProperty(d,"line",A({},s,{get:function(){return w},set:function(_){if(typeof _!="number"&&_!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=_,this.hasBeenReset=!0}})),Object.defineProperty(d,"lineAlign",A({},s,{get:function(){return T},set:function(_){var b=k(_);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");T=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"position",A({},s,{get:function(){return y},set:function(_){if(_<0||_>100)throw new Error("Position must be between 0 and 100.");y=_,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",A({},s,{get:function(){return v},set:function(_){var b=k(_);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",A({},s,{get:function(){return p},set:function(_){if(_<0||_>100)throw new Error("Size must be between 0 and 100.");p=_,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",A({},s,{get:function(){return c},set:function(_){var b=k(_);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),d.displayState=void 0}return D.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"parseTimeStamp",function(){return R}),L.d(K,"fixLineBreaks",function(){return h}),L.d(K,"VTTParser",function(){return u});var H=L("./src/utils/vttcue.ts"),N=function(){function d(){}var s=d.prototype;return s.decode=function(i,o){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},d}();function R(d){function s(i,o,n,f){return(i|0)*3600+(o|0)*60+(n|0)+parseFloat(f||0)}var l=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?s(l[2],l[3],0,l[4]):s(l[1],l[2],l[3],l[4]):null}var j=function(){function d(){this.values=Object.create(null)}var s=d.prototype;return s.set=function(i,o){!this.get(i)&&o!==""&&(this.values[i]=o)},s.get=function(i,o,n){return n?this.has(i)?this.values[i]:o[n]:this.has(i)?this.values[i]:o},s.has=function(i){return i in this.values},s.alt=function(i,o,n){for(var f=0;f<n.length;++f)if(o===n[f]){this.set(i,o);break}},s.integer=function(i,o){/^-?\d+$/.test(o)&&this.set(i,parseInt(o,10))},s.percent=function(i,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var n=parseFloat(o);if(n>=0&&n<=100)return this.set(i,n),!0}return!1},d}();function k(d,s,l,i){var o=i?d.split(i):[d];for(var n in o){if(typeof o[n]!="string")continue;var f=o[n].split(l);if(f.length!==2)continue;var O=f[0],S=f[1];s(O,S)}}var A=new H.default(0,0,""),D=A.align==="middle"?"middle":"center";function g(d,s,l){var i=d;function o(){var O=R(d);if(O===null)throw new Error("Malformed timestamp: "+i);return d=d.replace(/^[^\sa-zA-Z-]+/,""),O}function n(O,S){var x=new j;k(O,function(y,v){var p;switch(y){case"region":for(var c=l.length-1;c>=0;c--)if(l[c].id===v){x.set(y,l[c].region);break}break;case"vertical":x.alt(y,v,["rl","lr"]);break;case"line":p=v.split(","),x.integer(y,p[0]),x.percent(y,p[0])&&x.set("snapToLines",!1),x.alt(y,p[0],["auto"]),p.length===2&&x.alt("lineAlign",p[1],["start",D,"end"]);break;case"position":p=v.split(","),x.percent(y,p[0]),p.length===2&&x.alt("positionAlign",p[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":x.percent(y,v);break;case"align":x.alt(y,v,["start",D,"end","left","right"]);break}},/:/,/\s/),S.region=x.get("region",null),S.vertical=x.get("vertical","");var w=x.get("line","auto");w==="auto"&&A.line===-1&&(w=-1),S.line=w,S.lineAlign=x.get("lineAlign","start"),S.snapToLines=x.get("snapToLines",!0),S.size=x.get("size",100),S.align=x.get("align",D);var T=x.get("position","auto");T==="auto"&&A.position===50&&(T=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=T}function f(){d=d.replace(/^\s+/,"")}if(f(),s.startTime=o(),f(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);d=d.substr(3),f(),s.endTime=o(),f(),n(d,s)}function h(d){return d.replace(/<br(?: \/)?>/gi,`
`)}var u=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=d.prototype;return s.parse=function(i){var o=this;i&&(o.buffer+=o.decoder.decode(i,{stream:!0}));function n(){var T=o.buffer,y=0;for(T=h(T);y<T.length&&T[y]!=="\r"&&T[y]!==`
`;)++y;var v=T.substr(0,y);return T[y]==="\r"&&++y,T[y]===`
`&&++y,o.buffer=T.substr(y),v}function f(T){k(T,function(y,v){},/:/)}try{var O="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;O=n();var S=O.match(/^()?WEBVTT([ \t].*)?$/);if(!S||!S[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var x=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;x?x=!1:O=n();switch(o.state){case"HEADER":/:/.test(O)?f(O):O||(o.state="ID");continue;case"NOTE":O||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){o.state="NOTE";break}if(!O)continue;if(o.cue=new H.default(0,0,""),o.state="CUE",O.indexOf("-->")===-1){o.cue.id=O;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{g(O,o.cue,o.regionList)}catch(T){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var w=O.indexOf("-->")!==-1;if(!O||w&&(x=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
`),o.cue.text+=O}continue;case"BADCUE":O||(o.state="ID")}}}catch(T){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){i.onparsingerror&&i.onparsingerror(o)}return i.onflush&&i.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(Y,K,L){"use strict";L.r(K),L.d(K,"generateCueId",function(){return u}),L.d(K,"parseWebVTT",function(){return s});var H=L("./src/polyfills/number.ts"),N=L("./src/utils/vttparser.ts"),R=L("./src/demux/id3.ts"),j=L("./src/utils/timescale-conversion.ts"),k=L("./src/remux/mp4-remuxer.ts"),A=/\r\n|\n\r|\n|\r/g,D=function(i,o,n){return n===void 0&&(n=0),i.substr(n,o.length)===o},g=function(i){var o=parseInt(i.substr(-3)),n=parseInt(i.substr(-6,2)),f=parseInt(i.substr(-9,2)),O=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(H.isFiniteNumber)(o)||!Object(H.isFiniteNumber)(n)||!Object(H.isFiniteNumber)(f)||!Object(H.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return o+=1e3*n,o+=60*1e3*f,o+=60*60*1e3*O,o},h=function(i){for(var o=5381,n=i.length;n;)o=o*33^i.charCodeAt(--n);return(o>>>0).toString()};function u(l,i,o){return h(l.toString())+h(i.toString())+h(o)}var d=function(i,o,n){var f=i[o],O=i[f.prevCC];if(!O||!O.new&&f.new){i.ccOffset=i.presentationOffset=f.start,f.new=!1;return}for(;(S=O)!==null&&S!==void 0&&S.new;){var S;i.ccOffset+=f.start-O.start,f.new=!1,f=O,O=i[f.prevCC]}i.presentationOffset=n};function s(l,i,o,n,f,O,S,x){var w=new N.VTTParser,T=Object(R.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(A,`
`).split(`
`),y=[],v=Object(j.toMpegTsClockFromTimescale)(i,o),p="00:00.000",c=0,E=0,_,b=!0,I=!1;w.oncue=function(P){var B=n[f],z=n.ccOffset,U=(c-v)/9e4;if(B!=null&&B.new&&(E!==void 0?z=n.ccOffset=B.start:d(n,f,U)),U&&(z=U-n.presentationOffset),I){var C=P.endTime-P.startTime,W=Object(k.normalizePts)((P.startTime+z-E)*9e4,O*9e4)/9e4;P.startTime=W,P.endTime=W+C}var V=P.text.trim();P.text=decodeURIComponent(encodeURIComponent(V)),P.id||(P.id=u(P.startTime,P.endTime,V)),P.endTime>0&&y.push(P)},w.onparsingerror=function(P){_=P},w.onflush=function(){if(_){x(_);return}S(y)},T.forEach(function(P){if(b)if(D(P,"X-TIMESTAMP-MAP=")){b=!1,I=!0,P.substr(16).split(",").forEach(function(B){D(B,"LOCAL:")?p=B.substr(6):D(B,"MPEGTS:")&&(c=parseInt(B.substr(7)))});try{E=g(p)/1e3}catch(B){I=!1,_=B}return}else P===""&&(b=!1);w.parse(P+`
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(Y,K,L){"use strict";L.r(K);var H=L("./src/utils/logger.ts"),N=L("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,j=function(){function k(D){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=D?D.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var A=k.prototype;return A.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},A.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},A.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},A.load=function(g,h,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=h,this.callbacks=u,this.retryDelay=h.retryDelay,this.loadInternal()},A.loadInternal=function(){var g=this.config,h=this.context;if(!g)return;var u=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var s=this.xhrSetup;try{if(s)try{s(u,h.url)}catch(o){u.open("GET",h.url,!0),s(u,h.url)}u.readyState||u.open("GET",h.url,!0);var l=this.context.headers;if(l)for(var i in l)u.setRequestHeader(i,l[i])}catch(o){this.callbacks.onError({code:u.status,text:o.message},h,u);return}h.rangeEnd&&u.setRequestHeader("Range","bytes="+h.rangeStart+"-"+(h.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=h.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),u.send()},A.readystatechange=function(){var g=this.context,h=this.loader,u=this.stats;if(!g||!h)return;var d=h.readyState,s=this.config;if(u.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),d===4){h.onreadystatechange=null,h.onprogress=null;var l=h.status;if(l>=200&&l<300){u.loading.end=Math.max(self.performance.now(),u.loading.first);var i,o;if(g.responseType==="arraybuffer"?(i=h.response,o=i.byteLength):(i=h.responseText,o=i.length),u.loaded=u.total=o,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(u,g,i,h),!this.callbacks)return;var f={url:h.responseURL,data:i};this.callbacks.onSuccess(f,u,g,h)}else u.retry>=s.maxRetry||l>=400&&l<499?(H.logger.error(l+" while loading "+g.url),this.callbacks.onError({code:l,text:h.statusText},g,h)):(H.logger.warn(l+" while loading "+g.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,s.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},A.loadtimeout=function(){H.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},A.loadprogress=function(g){var h=this.stats;h.loaded=g.loaded,g.lengthComputable&&(h.total=g.total)},A.getCacheAge=function(){var g=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var h=this.loader.getResponseHeader("age");g=h?parseFloat(h):null}return g},k}();K.default=j}}).default})},vHTk:function(Le,ye,F){Le.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return dt});var Y=F("rePB"),K=F("VTBJ"),L=F("KQm4"),H=F("U8pU"),N=F("ODXe"),R=F("cDcd"),j=F("TSYQ"),k=F.n(j),A=F("Gytx"),D=F.n(A),g=F("Kwbf"),h=F("t23M"),u=F("qx4F"),d=F("6eGT"),s=F("IBYe"),l=F("Ff2n"),i=F("c+Xe"),o=F("fyJ8"),n=F("biw7");function f(be,_e,Ne,ke,Ee){var Ie=Ne[be]||{},pe=Ne[_e]||{},ae,ie;Ie.fixed==="left"?ae=ke.left[be]:pe.fixed==="right"&&(ie=ke.right[_e]);var Q=!1,q=!1,te=!1,se=!1,ce=Ne[_e+1],Se=Ne[be-1];if(Ee==="rtl"){if(ae!==void 0){var je=Se&&Se.fixed==="left";se=!je}else if(ie!==void 0){var Ze=ce&&ce.fixed==="right";te=!Ze}}else if(ae!==void 0){var ut=ce&&ce.fixed==="left";Q=!ut}else if(ie!==void 0){var it=Se&&Se.fixed==="right";q=!it}return{fixLeft:ae,fixRight:ie,lastFixLeft:Q,firstFixRight:q,lastFixRight:te,firstFixLeft:se,isSticky:ke.isSticky}}var O=F("sR1s");function S(be){var _e=be.cells,Ne=be.stickyOffsets,ke=be.flattenColumns,Ee=be.rowComponent,Ie=be.cellComponent,pe=be.onHeaderRow,ae=be.index,ie=R.useContext(n.a),Q=ie.prefixCls,q=ie.direction,te;pe&&(te=pe(_e.map(function(ce){return ce.column}),ae));var se=Object(O.a)(_e.map(function(ce){return ce.column}));return R.createElement(Ee,Object.assign({},te),_e.map(function(ce,Se){var je=ce.column,Ze=f(ce.colStart,ce.colEnd,ke,Ne,q),ut;return je&&je.onHeaderCell&&(ut=ce.column.onHeaderCell(je)),R.createElement(o.a,Object.assign({},ce,{ellipsis:je.ellipsis,align:je.align,component:Ie,prefixCls:Q,key:se[Se]},Ze,{additionalProps:ut,rowType:"header"}))}))}S.displayName="HeaderRow";var x=S;function w(be){var _e=[];function Ne(pe,ae){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;_e[ie]=_e[ie]||[];var Q=ae,q=pe.filter(Boolean).map(function(te){var se={key:te.key,className:te.className||"",children:te.title,column:te,colStart:Q},ce=1,Se=te.children;return Se&&Se.length>0&&(ce=Ne(Se,Q,ie+1).reduce(function(je,Ze){return je+Ze},0),se.hasSubColumns=!0),"colSpan"in te&&(ce=te.colSpan),"rowSpan"in te&&(se.rowSpan=te.rowSpan),se.colSpan=ce,se.colEnd=se.colStart+ce-1,_e[ie].push(se),Q+=ce,ce});return q}Ne(be,0);for(var ke=_e.length,Ee=function(ae){_e[ae].forEach(function(ie){!("rowSpan"in ie)&&!ie.hasSubColumns&&(ie.rowSpan=ke-ae)})},Ie=0;Ie<ke;Ie+=1)Ee(Ie);return _e}function T(be){var _e=be.stickyOffsets,Ne=be.columns,ke=be.flattenColumns,Ee=be.onHeaderRow,Ie=R.useContext(n.a),pe=Ie.prefixCls,ae=Ie.getComponent,ie=R.useMemo(function(){return w(Ne)},[Ne]),Q=ae(["header","wrapper"],"thead"),q=ae(["header","row"],"tr"),te=ae(["header","cell"],"th");return R.createElement(Q,{className:"".concat(pe,"-thead")},ie.map(function(se,ce){var Se=R.createElement(x,{key:ce,flattenColumns:ke,cells:se,stickyOffsets:_e,rowComponent:q,cellComponent:te,onHeaderRow:Ee,index:ce});return Se}))}var y=T,v=F("hW8S");function p(be){for(var _e=be.colWidths,Ne=be.columns,ke=be.columCount,Ee=[],Ie=ke||Ne.length,pe=!1,ae=Ie-1;ae>=0;ae-=1){var ie=_e[ae],Q=Ne&&Ne[ae],q=Q&&Q[v.a];(ie||q||pe)&&(Ee.unshift(R.createElement("col",Object.assign({key:ae,style:{width:ie,minWidth:ie}},q))),pe=!0)}return R.createElement("colgroup",null,Ee)}var c=p;function E(be,_e){return Object(R.useMemo)(function(){for(var Ne=[],ke=0;ke<_e;ke+=1){var Ee=be[ke];if(Ee!==void 0)Ne[ke]=Ee;else return null}return Ne},[be.join("_"),_e])}var _=R.forwardRef(function(be,_e){var Ne=be.noData,ke=be.columns,Ee=be.flattenColumns,Ie=be.colWidths,pe=be.columCount,ae=be.stickyOffsets,ie=be.direction,Q=be.fixHeader,q=be.offsetHeader,te=be.stickyClassName,se=be.onScroll,ce=Object(l.a)(be,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Se=R.useContext(n.a),je=Se.prefixCls,Ze=Se.scrollbarSize,ut=Se.isSticky,it=ut&&!Q?0:Ze,rt=R.useRef(null),Me=R.useCallback(function(et){Object(i.b)(_e,et),Object(i.b)(rt,et)},[]);R.useEffect(function(){var et;function tt(Te){var Ae=Te.currentTarget,Qe=Te.deltaX;Qe&&(se({currentTarget:Ae,scrollLeft:Ae.scrollLeft+Qe}),Te.preventDefault())}return(et=rt.current)===null||et===void 0||et.addEventListener("wheel",tt),function(){var Te;(Te=rt.current)===null||Te===void 0||Te.removeEventListener("wheel",tt)}},[]);var Ue=Ee[Ee.length-1],we={fixed:Ue?Ue.fixed:null,onHeaderCell:function(){return{className:"".concat(je,"-cell-scrollbar")}}},ee=Object(R.useMemo)(function(){return it?[].concat(Object(L.a)(ke),[we]):ke},[it,ke]),he=Object(R.useMemo)(function(){return it?[].concat(Object(L.a)(Ee),[we]):Ee},[it,Ee]),Fe=Object(R.useMemo)(function(){var et=ae.right,tt=ae.left;return Object(K.a)(Object(K.a)({},ae),{},{left:ie==="rtl"?[].concat(Object(L.a)(tt.map(function(Te){return Te+it})),[0]):tt,right:ie==="rtl"?et:[].concat(Object(L.a)(et.map(function(Te){return Te+it})),[0]),isSticky:ut})},[it,ae,ut]),Re=E(Ie,pe);return R.createElement("div",{style:Object(K.a)({overflow:"hidden"},ut?{top:q}:{}),ref:Me,className:k()("".concat(je,"-header"),Object(Y.a)({},te,!!te))},R.createElement("table",{style:{tableLayout:"fixed",visibility:Ne||Re?null:"hidden"}},R.createElement(c,{colWidths:Re?[].concat(Object(L.a)(Re),[it]):[],columCount:pe+1,columns:he}),R.createElement(y,Object.assign({},ce,{stickyOffsets:Fe,columns:ee,flattenColumns:he}))))});_.displayName="FixedHeader";var b=_,I=R.createContext(null),P=I;function B(be){var _e=be.prefixCls,Ne=be.children,ke=be.component,Ee=be.cellComponent,Ie=be.fixHeader,pe=be.fixColumn,ae=be.horizonScroll,ie=be.className,Q=be.expanded,q=be.componentWidth,te=be.colSpan,se=R.useContext(n.a),ce=se.scrollbarSize;return R.useMemo(function(){var Se=Ne;return pe&&(Se=R.createElement("div",{style:{width:q-(Ie?ce:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(_e,"-expanded-row-fixed")},Se)),R.createElement(ke,{className:ie,style:{display:Q?null:"none"}},R.createElement(o.a,{component:Ee,prefixCls:_e,colSpan:te},Se))},[Ne,ke,Ie,ae,ie,Q,q,te,ce])}var z=B;function U(be){var _e=be.className,Ne=be.style,ke=be.record,Ee=be.index,Ie=be.rowKey,pe=be.getRowKey,ae=be.rowExpandable,ie=be.expandedKeys,Q=be.onRow,q=be.indent,te=q===void 0?0:q,se=be.rowComponent,ce=be.cellComponent,Se=be.childrenColumnName,je=R.useContext(n.a),Ze=je.prefixCls,ut=je.fixedInfoList,it=R.useContext(P),rt=it.fixHeader,Me=it.fixColumn,Ue=it.horizonScroll,we=it.componentWidth,ee=it.flattenColumns,he=it.expandableType,Fe=it.expandRowByClick,Re=it.onTriggerExpand,et=it.rowClassName,tt=it.expandedRowClassName,Te=it.indentSize,Ae=it.expandIcon,Qe=it.expandedRowRender,Et=it.expandIconColumnIndex,vt=R.useState(!1),cn=Object(N.a)(vt,2),yn=cn[0],ln=cn[1],bt=ie&&ie.has(be.recordKey);R.useEffect(function(){bt&&ln(!0)},[bt]);var Rn=he==="row"&&(!ae||ae(ke)),zn=he==="nest",Tn=Se&&ke&&ke[Se],zt=Rn||zn,Sn;Q&&(Sn=Q(ke,Ee));var Bn=function(Lt){if(Fe&&zt&&Re(ke,Lt),Sn&&Sn.onClick){for(var Pe,Ce=arguments.length,It=new Array(Ce>1?Ce-1:0),Kt=1;Kt<Ce;Kt++)It[Kt-1]=arguments[Kt];(Pe=Sn).onClick.apply(Pe,[Lt].concat(It))}},pr;typeof et=="string"?pr=et:typeof et=="function"&&(pr=et(ke,Ee,te));var nt=Object(O.a)(ee),ct=R.createElement(se,Object.assign({},Sn,{"data-row-key":Ie,className:k()(_e,"".concat(Ze,"-row"),"".concat(Ze,"-row-level-").concat(te),pr,Sn&&Sn.className),style:Object(K.a)(Object(K.a)({},Ne),Sn?Sn.style:null),onClick:Bn}),ee.map(function(Un,Lt){var Pe=Un.render,Ce=Un.dataIndex,It=Un.className,Kt=nt[Lt],vn=ut[Lt],fn;Lt===(Et||0)&&zn&&(fn=R.createElement(R.Fragment,null,R.createElement("span",{style:{paddingLeft:"".concat(Te*te,"px")},className:"".concat(Ze,"-row-indent indent-level-").concat(te)}),Ae({prefixCls:Ze,expanded:bt,expandable:Tn,record:ke,onExpand:Re})));var rn;return Un.onCell&&(rn=Un.onCell(ke,Ee)),R.createElement(o.a,Object.assign({className:It,ellipsis:Un.ellipsis,align:Un.align,component:ce,prefixCls:Ze,key:Kt,record:ke,index:Ee,dataIndex:Ce,render:Pe,shouldCellUpdate:Un.shouldCellUpdate},vn,{appendNode:fn,additionalProps:rn}))})),qn;if(Rn&&(yn||bt)){var xr=Qe(ke,Ee,te+1,bt),mr=tt&&tt(ke,Ee,te);qn=R.createElement(z,{expanded:bt,className:k()("".concat(Ze,"-expanded-row"),"".concat(Ze,"-expanded-row-level-").concat(te+1),mr),prefixCls:Ze,fixHeader:rt,fixColumn:Me,horizonScroll:Ue,component:se,componentWidth:we,cellComponent:ce,colSpan:ee.length},xr)}var Ur;return Tn&&bt&&(Ur=(ke[Se]||[]).map(function(Un,Lt){var Pe=pe(Un,Lt);return R.createElement(U,Object.assign({},be,{key:Pe,rowKey:Pe,record:Un,recordKey:Pe,index:Lt,indent:te+1}))})),R.createElement(R.Fragment,null,ct,qn,Ur)}U.displayName="BodyRow";var C=U,W=R.createContext(null),V=W;function J(be){var _e=be.columnKey,Ne=be.onColumnResize,ke=R.useRef();return R.useEffect(function(){ke.current&&Ne(_e,ke.current.offsetWidth)},[]),R.createElement(h.a,{onResize:function(Ie){var pe=Ie.offsetWidth;Ne(_e,pe)}},R.createElement("td",{ref:ke,style:{padding:0,border:0,height:0}},R.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ne(be){var _e=be.data,Ne=be.getRowKey,ke=be.measureColumnWidth,Ee=be.expandedKeys,Ie=be.onRow,pe=be.rowExpandable,ae=be.emptyNode,ie=be.childrenColumnName,Q=R.useContext(V),q=Q.onColumnResize,te=R.useContext(n.a),se=te.prefixCls,ce=te.getComponent,Se=R.useContext(P),je=Se.fixHeader,Ze=Se.horizonScroll,ut=Se.flattenColumns,it=Se.componentWidth;return R.useMemo(function(){var rt=ce(["body","wrapper"],"tbody"),Me=ce(["body","row"],"tr"),Ue=ce(["body","cell"],"td"),we;_e.length?we=_e.map(function(he,Fe){var Re=Ne(he,Fe);return R.createElement(C,{key:Re,rowKey:Re,record:he,recordKey:Re,index:Fe,rowComponent:Me,cellComponent:Ue,expandedKeys:Ee,onRow:Ie,getRowKey:Ne,rowExpandable:pe,childrenColumnName:ie})}):we=R.createElement(z,{expanded:!0,className:"".concat(se,"-placeholder"),prefixCls:se,fixHeader:je,fixColumn:Ze,horizonScroll:Ze,component:Me,componentWidth:it,cellComponent:Ue,colSpan:ut.length},ae);var ee=Object(O.a)(ut);return R.createElement(rt,{className:"".concat(se,"-tbody")},ke&&R.createElement("tr",{"aria-hidden":"true",className:"".concat(se,"-measure-row"),style:{height:0}},ee.map(function(he){return R.createElement(J,{key:he,columnKey:he,onColumnResize:q})})),we)},[_e,se,Ie,ke,Ee,Ne,ce,it,ae,ut])}var fe=R.memo(ne);fe.displayName="Body";var ue=fe,le=F("wRmb"),me=F("xEkU"),ge=F.n(me);function re(be){var _e=Object(R.useRef)(be),Ne=Object(R.useState)({}),ke=Object(N.a)(Ne,2),Ee=ke[1],Ie=Object(R.useRef)(null),pe=Object(R.useRef)([]);function ae(ie){Ie.current===null&&(pe.current=[],Ie.current=ge()(function(){pe.current.forEach(function(Q){_e.current=Q(_e.current)}),Ie.current=null,Ee({})})),pe.current.push(ie)}return Object(R.useEffect)(function(){return function(){ge.a.cancel(Ie.current)}},[]),[_e.current,ae]}function oe(be){var _e=Object(R.useRef)(be),Ne=Object(R.useRef)(null);function ke(){window.clearTimeout(Ne.current)}function Ee(pe){_e.current=pe,ke(),Ne.current=window.setTimeout(function(){_e.current=null,Ne.current=null},100)}function Ie(){return _e.current}return Object(R.useEffect)(function(){return ke},[]),[Ee,Ie]}function xe(be,_e,Ne){var ke=Object(R.useMemo)(function(){for(var Ee=[],Ie=[],pe=0,ae=0,ie=0;ie<_e;ie+=1)if(Ne==="rtl"){Ie[ie]=ae,ae+=be[ie]||0;var Q=_e-ie-1;Ee[Q]=pe,pe+=be[Q]||0}else{Ee[ie]=pe,pe+=be[ie]||0;var q=_e-ie-1;Ie[q]=ae,ae+=be[q]||0}return{left:Ee,right:Ie}},[be,_e,Ne]);return ke}var Be=xe;function Ve(be){var _e=be.className,Ne=be.children;return R.createElement("div",{className:_e},Ne)}var Ye=Ve,$e=F("n6Qo");function Ke(be){var _e,Ne=be.prefixCls,ke=be.record,Ee=be.onExpand,Ie=be.expanded,pe=be.expandable,ae="".concat(Ne,"-row-expand-icon");if(!pe)return R.createElement("span",{className:k()(ae,"".concat(Ne,"-row-spaced"))});var ie=function(q){Ee(ke,q),q.stopPropagation()};return R.createElement("span",{className:k()(ae,(_e={},Object(Y.a)(_e,"".concat(Ne,"-row-expanded"),Ie),Object(Y.a)(_e,"".concat(Ne,"-row-collapsed"),!Ie),_e)),onClick:ie})}function We(be,_e,Ne){var ke=[];function Ee(Ie){(Ie||[]).forEach(function(pe,ae){ke.push(_e(pe,ae)),Ee(pe[Ne])})}return Ee(be),ke}var ze=F("zT1h"),at=F("y0+3"),Je=function(_e,Ne){var ke,Ee,Ie=_e.scrollBodyRef,pe=_e.onScroll,ae=_e.offsetScroll,ie=R.useContext(n.a),Q=ie.prefixCls,q=((ke=Ie.current)===null||ke===void 0?void 0:ke.scrollWidth)||0,te=((Ee=Ie.current)===null||Ee===void 0?void 0:Ee.clientWidth)||0,se=q&&te*(te/q),ce=R.useRef(),Se=re({scrollLeft:0,isHiddenScrollBar:!1}),je=Object(N.a)(Se,2),Ze=je[0],ut=je[1],it=R.useRef({delta:0,x:0}),rt=R.useState(!1),Me=Object(N.a)(rt,2),Ue=Me[0],we=Me[1],ee=function(){we(!1)},he=function(Te){Te.persist(),it.current.delta=Te.pageX-Ze.scrollLeft,it.current.x=0,we(!0),Te.preventDefault()},Fe=function(Te){var Ae,Qe=Te||((Ae=window)===null||Ae===void 0?void 0:Ae.event),Et=Qe.buttons;if(!Ue||Et===0){Ue&&we(!1);return}var vt=it.current.x+Te.pageX-it.current.x-it.current.delta;vt<=0&&(vt=0),vt+se>=te&&(vt=te-se),pe({scrollLeft:vt/te*(q+2)}),it.current.x=Te.pageX},Re=function(){var Te=Object(at.b)(Ie.current).top,Ae=Te+Ie.current.offsetHeight,Qe=document.documentElement.scrollTop+window.innerHeight;Ae-Object(u.a)()<=Qe||Te>=Qe-ae?ut(function(Et){return Object(K.a)(Object(K.a)({},Et),{},{isHiddenScrollBar:!0})}):ut(function(Et){return Object(K.a)(Object(K.a)({},Et),{},{isHiddenScrollBar:!1})})},et=function(Te){ut(function(Ae){return Object(K.a)(Object(K.a)({},Ae),{},{scrollLeft:Te/q*te||0})})};return R.useImperativeHandle(Ne,function(){return{setScrollLeft:et}}),R.useEffect(function(){var tt=Object(ze.a)(document.body,"mouseup",ee,!1),Te=Object(ze.a)(document.body,"mousemove",Fe,!1);return Re(),function(){tt.remove(),Te.remove()}},[se,Ue]),R.useEffect(function(){var tt=Object(ze.a)(window,"scroll",Re,!1),Te=Object(ze.a)(window,"resize",Re,!1);return function(){tt.remove(),Te.remove()}},[]),R.useEffect(function(){Ze.isHiddenScrollBar||ut(function(tt){var Te,Ae;return Object(K.a)(Object(K.a)({},tt),{},{scrollLeft:Ie.current.scrollLeft/((Te=Ie.current)===null||Te===void 0?void 0:Te.scrollWidth)*((Ae=Ie.current)===null||Ae===void 0?void 0:Ae.clientWidth)})})},[Ze.isHiddenScrollBar]),q<=te||!se||Ze.isHiddenScrollBar?null:R.createElement("div",{style:{height:Object(u.a)(),width:te,bottom:ae},className:"".concat(Q,"-sticky-scroll")},R.createElement("div",{onMouseDown:he,ref:ce,className:k()("".concat(Q,"-sticky-scroll-bar"),Object(Y.a)({},"".concat(Q,"-sticky-scroll-bar-active"),Ue)),style:{width:"".concat(se,"px"),transform:"translate3d(".concat(Ze.scrollLeft,"px, 0, 0)")}}))},Xe=R.forwardRef(Je);function He(be,_e){return R.useMemo(function(){var Ne=!!be;return{isSticky:Ne,stickyClassName:Ne?"".concat(_e,"-sticky-header"):"",offsetHeader:Object(H.a)(be)==="object"&&be.offsetHeader||0,offsetScroll:Object(H.a)(be)==="object"&&be.offsetScroll||0}},[be,_e])}var ot=[],ft={},dt="rc-table-internal-hook",lt=R.memo(function(be){var _e=be.children;return _e},function(be,_e){return D()(be.props,_e.props)?be.pingLeft!==_e.pingLeft||be.pingRight!==_e.pingRight:!1});function _t(be){var _e,Ne=be.prefixCls,ke=be.className,Ee=be.rowClassName,Ie=be.style,pe=be.data,ae=be.rowKey,ie=be.scroll,Q=be.tableLayout,q=be.direction,te=be.title,se=be.footer,ce=be.summary,Se=be.id,je=be.showHeader,Ze=be.components,ut=be.emptyText,it=be.onRow,rt=be.onHeaderRow,Me=be.internalHooks,Ue=be.transformColumns,we=be.internalRefs,ee=be.sticky,he=pe||ot,Fe=!!he.length,Re=R.useState(0),et=Object(N.a)(Re,2),tt=et[0],Te=et[1];R.useEffect(function(){Te(Object(u.a)())});var Ae=R.useMemo(function(){return Object(O.c)(Ze,{})},[Ze]),Qe=R.useCallback(function(gn,an){return Object(O.b)(Ae,gn)||an},[Ae]),Et=R.useMemo(function(){return typeof ae=="function"?ae:function(gn){var an=gn&&gn[ae];return an}},[ae]),vt=Object(v.c)(be),cn=vt.expandIcon,yn=vt.expandedRowKeys,ln=vt.defaultExpandedRowKeys,bt=vt.defaultExpandAllRows,Rn=vt.expandedRowRender,zn=vt.onExpand,Tn=vt.onExpandedRowsChange,zt=vt.expandRowByClick,Sn=vt.rowExpandable,Bn=vt.expandIconColumnIndex,pr=vt.expandedRowClassName,nt=vt.childrenColumnName,ct=vt.indentSize,qn=cn||Ke,xr=nt||"children",mr=R.useMemo(function(){return Rn?"row":be.expandable&&Me===dt&&be.expandable.__PARENT_RENDER_ICON__||he.some(function(gn){return gn&&Object(H.a)(gn)==="object"&&gn[xr]})?"nest":!1},[!!Rn,he]),Ur=R.useState(function(){return ln||(bt?We(he,Et,xr):[])}),Un=Object(N.a)(Ur,2),Lt=Un[0],Pe=Un[1],Ce=R.useMemo(function(){return new Set(yn||Lt||[])},[yn,Lt]),It=R.useCallback(function(gn){var an=Et(gn,he.indexOf(gn)),sn,fr=Ce.has(an);fr?(Ce.delete(an),sn=Object(L.a)(Ce)):sn=[].concat(Object(L.a)(Ce),[an]),Pe(sn),zn&&zn(!fr,gn),Tn&&Tn(sn)},[Et,Ce,he,zn,Tn]),Kt=R.useState(0),vn=Object(N.a)(Kt,2),fn=vn[0],rn=vn[1],Gt=Object(le.b)(Object(K.a)(Object(K.a)(Object(K.a)({},be),vt),{},{expandable:!!Rn,expandedKeys:Ce,getRowKey:Et,onTriggerExpand:It,expandIcon:qn,expandIconColumnIndex:Bn,direction:q}),Me===dt?Ue:null),Dt=Object(N.a)(Gt,2),Pt=Dt[0],Ft=Dt[1],Mt=R.useMemo(function(){return{columns:Pt,flattenColumns:Ft}},[Pt,Ft]),qt=R.useRef(),gt=R.useRef(),un=R.useRef(),Qt=R.useState(!1),Ln=Object(N.a)(Qt,2),kt=Ln[0],In=Ln[1],Nn=R.useState(!1),wn=Object(N.a)(Nn,2),bn=wn[0],An=wn[1],nr=re(new Map),lr=Object(N.a)(nr,2),Xn=lr[0],xn=lr[1],ur=Object(O.a)(Ft),dn=ur.map(function(gn){return Xn.get(gn)}),hn=R.useMemo(function(){return dn},[dn.join("_")]),pn=Be(hn,Ft.length,q),Xt=ie&&Object(O.d)(ie.y),St=ie&&Object(O.d)(ie.x),jt=St&&Ft.some(function(gn){var an=gn.fixed;return an}),xt=R.useRef(),en=He(ee,Ne),Ut=en.isSticky,rr=en.offsetHeader,Mn=en.offsetScroll,dr=en.stickyClassName,Qr,Ir,Gr;Xt&&(Ir={overflowY:"scroll",maxHeight:ie.y}),St&&(Qr={overflowX:"auto"},Xt||(Ir={overflowY:"hidden"}),Gr={width:ie.x===!0?"auto":ie.x,minWidth:"100%"});var Mr=R.useCallback(function(gn,an){xn(function(sn){var fr=new Map(sn);return fr.set(gn,an),fr})},[]),Or=oe(null),Br=Object(N.a)(Or,2),Fn=Br[0],Rt=Br[1];function zr(gn,an){if(!an)return;typeof an=="function"?an(gn):an.scrollLeft!==gn&&(an.scrollLeft=gn)}var gr=function(an){var sn=an.currentTarget,fr=an.scrollLeft,Zr=typeof fr=="number"?fr:sn.scrollLeft,qr=sn||ft;if(!Rt()||Rt()===qr){var ri;Fn(qr),zr(Zr,gt.current),zr(Zr,un.current),zr(Zr,(ri=xt.current)===null||ri===void 0?void 0:ri.setScrollLeft)}if(sn){var Ti=sn.scrollWidth,Zt=sn.clientWidth;In(Zr>0),An(Zr<Ti-Zt)}},ni=function(){un.current&&gr({currentTarget:un.current})},wt=function(an){var sn=an.width;ni(),rn(qt.current?qt.current.offsetWidth:sn)};R.useEffect(function(){return ni},[]),R.useEffect(function(){St&&ni()},[St]),R.useEffect(function(){Me===dt&&we&&(we.body.current=un.current)});var Wt=Qe(["table"],"table"),At=R.useMemo(function(){return Q||(jt?ie.x==="max-content"?"auto":"fixed":Xt||Ft.some(function(gn){var an=gn.ellipsis;return an})?"fixed":"auto")},[Xt,jt,Ft,Q]),Vt,$t={colWidths:hn,columCount:Ft.length,stickyOffsets:pn,onHeaderRow:rt,fixHeader:Xt},_n=R.useMemo(function(){return Fe?null:typeof ut=="function"?ut():ut},[Fe,ut]),tn=R.createElement(ue,{data:he,measureColumnWidth:Xt||St||Ut,expandedKeys:Ce,rowExpandable:Sn,getRowKey:Et,onRow:it,emptyNode:_n,childrenColumnName:xr}),Pn=R.createElement(c,{colWidths:Ft.map(function(gn){var an=gn.width;return an}),columns:Ft}),er=ce&&R.createElement($e.b,null,ce(he)),Yt=Qe(["body"]);if(Xt||Ut){var vr;typeof Yt=="function"?(vr=Yt(he,{scrollbarSize:tt,ref:un,onScroll:gr}),$t.colWidths=Ft.map(function(gn,an){var sn=gn.width,fr=an===Pt.length-1?sn-tt:sn;return typeof fr=="number"&&!Number.isNaN(fr)?fr:(Object(g.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):vr=R.createElement("div",{style:Object(K.a)(Object(K.a)({},Qr),Ir),onScroll:gr,ref:un,className:k()("".concat(Ne,"-body"))},R.createElement(Wt,{style:Object(K.a)(Object(K.a)({},Gr),{},{tableLayout:At})},Pn,tn,er),Ut&&R.createElement(Xe,{ref:xt,offsetScroll:Mn,scrollBodyRef:un,onScroll:gr})),Vt=R.createElement(R.Fragment,null,je!==!1&&R.createElement(b,Object.assign({noData:!he.length},$t,Mt,{direction:q,offsetHeader:rr,stickyClassName:dr,ref:gt,onScroll:gr})),vr)}else Vt=R.createElement("div",{style:Object(K.a)(Object(K.a)({},Qr),Ir),className:k()("".concat(Ne,"-content")),onScroll:gr,ref:un},R.createElement(Wt,{style:Object(K.a)(Object(K.a)({},Gr),{},{tableLayout:At})},Pn,je!==!1&&R.createElement(y,Object.assign({},$t,Mt)),tn,er));var mn=Object(v.b)(be),Vn=R.createElement("div",Object.assign({className:k()(Ne,ke,(_e={},Object(Y.a)(_e,"".concat(Ne,"-rtl"),q==="rtl"),Object(Y.a)(_e,"".concat(Ne,"-ping-left"),kt),Object(Y.a)(_e,"".concat(Ne,"-ping-right"),bn),Object(Y.a)(_e,"".concat(Ne,"-layout-fixed"),Q==="fixed"),Object(Y.a)(_e,"".concat(Ne,"-fixed-header"),Xt),Object(Y.a)(_e,"".concat(Ne,"-fixed-column"),jt),Object(Y.a)(_e,"".concat(Ne,"-scroll-horizontal"),St),Object(Y.a)(_e,"".concat(Ne,"-has-fix-left"),Ft[0]&&Ft[0].fixed),Object(Y.a)(_e,"".concat(Ne,"-has-fix-right"),Ft[Ft.length-1]&&Ft[Ft.length-1].fixed==="right"),_e)),style:Ie,id:Se,ref:qt},mn),R.createElement(lt,{pingLeft:kt,pingRight:bn,props:Object(K.a)(Object(K.a)({},be),{},{stickyOffsets:pn,mergedExpandedKeys:Ce})},te&&R.createElement(Ye,{className:"".concat(Ne,"-title")},te(he)),R.createElement("div",{className:"".concat(Ne,"-container")},Vt),se&&R.createElement(Ye,{className:"".concat(Ne,"-footer")},se(he))));St&&(Vn=R.createElement(h.a,{onResize:wt},Vn));var Yn=R.useMemo(function(){return{prefixCls:Ne,getComponent:Qe,scrollbarSize:tt,direction:q,fixedInfoList:Ft.map(function(gn,an){return f(an,an,Ft,pn,q)}),isSticky:Ut}},[Ne,Qe,tt,q,Ft,pn,q,Ut]),cr=R.useMemo(function(){return Object(K.a)(Object(K.a)({},Mt),{},{tableLayout:At,rowClassName:Ee,expandedRowClassName:pr,componentWidth:fn,fixHeader:Xt,fixColumn:jt,horizonScroll:St,expandIcon:qn,expandableType:mr,expandRowByClick:zt,expandedRowRender:Rn,onTriggerExpand:It,expandIconColumnIndex:Bn,indentSize:ct})},[Mt,At,Ee,pr,fn,Xt,jt,St,qn,mr,zt,Rn,It,Bn,ct]),Wi=R.useMemo(function(){return{onColumnResize:Mr}},[Mr]);return R.createElement(n.a.Provider,{value:Yn},R.createElement(P.Provider,{value:cr},R.createElement(V.Provider,{value:Wi},Vn)))}_t.Column=s.a,_t.ColumnGroup=d.a,_t.Summary=$e.a,_t.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ht=ye.b=_t},wRmb:function(Le,ye,F){"use strict";F.d(ye,"a",function(){return D});var Y=F("rePB"),K=F("KQm4"),L=F("VTBJ"),H=F("Ff2n"),N=F("cDcd"),R=F.n(N),j=F("Kwbf"),k=F("Zm9Q"),A=F("hW8S");function D(s){return Object(k.a)(s).filter(function(l){return N.isValidElement(l)}).map(function(l){var i=l.key,o=l.props,n=o.children,f=Object(H.a)(o,["children"]),O=Object(L.a)({key:i},f);return n&&(O.children=D(n)),O})}function g(s){return s.reduce(function(l,i){var o=i.fixed,n=o===!0?"left":o,f=i.children;return f&&f.length>0?[].concat(Object(K.a)(l),Object(K.a)(g(f).map(function(O){return Object(L.a)({fixed:n},O)}))):[].concat(Object(K.a)(l),[Object(L.a)(Object(L.a)({},i),{},{fixed:n})])},[])}function h(s){for(var l=!0,i=0;i<s.length;i+=1){var o=s[i];if(l&&o.fixed!=="left")l=!1;else if(!l&&o.fixed==="left"){Object(j.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var n=!0,f=s.length-1;f>=0;f-=1){var O=s[f];if(n&&O.fixed!=="right")n=!1;else if(!n&&O.fixed==="right"){Object(j.a)(!1,"Index ".concat(f+1," of `columns` missing `fixed='right'` prop."));break}}}function u(s){return s.map(function(l){var i=l.fixed,o=Object(H.a)(l,["fixed"]),n=i;return i==="left"?n="right":i==="right"&&(n="left"),Object(L.a)({fixed:n},o)})}function d(s,l){var i=s.prefixCls,o=s.columns,n=s.children,f=s.expandable,O=s.expandedKeys,S=s.getRowKey,x=s.onTriggerExpand,w=s.expandIcon,T=s.rowExpandable,y=s.expandIconColumnIndex,v=s.direction,p=s.expandRowByClick,c=N.useMemo(function(){return o||D(n)},[o,n]),E=N.useMemo(function(){if(f){var I,P=y||0,B=c[P],z=(I={},Object(Y.a)(I,A.a,{className:"".concat(i,"-expand-icon-col")}),Object(Y.a)(I,"title",""),Object(Y.a)(I,"fixed",B?B.fixed:null),Object(Y.a)(I,"className","".concat(i,"-row-expand-icon-cell")),Object(Y.a)(I,"render",function(W,V,J){var ne=S(V,J),fe=O.has(ne),ue=T?T(V):!0,le=w({prefixCls:i,expanded:fe,expandable:ue,record:V,onExpand:x});return p?N.createElement("span",{onClick:function(ge){return ge.stopPropagation()}},le):le}),I),U=c.slice();return P>=0&&U.splice(P,0,z),U}return c},[f,c,S,O,w,v]),_=N.useMemo(function(){var I=E;return l&&(I=l(I)),I.length||(I=[{render:function(){return null}}]),I},[l,E,v]),b=N.useMemo(function(){return v==="rtl"?u(g(_)):g(_)},[_,v]);return[_,b]}ye.b=d},"y0+3":function(Le,ye,F){"use strict";F.d(ye,"a",function(){return g}),F.d(ye,"b",function(){return u});var Y=/margin|padding|width|height|max|min|offset/,K={left:!0,top:!0},L={cssFloat:1,styleFloat:1,float:1};function H(d){return d.nodeType===1?d.ownerDocument.defaultView.getComputedStyle(d,null):{}}function N(d,s,l){if(s=s.toLowerCase(),l==="auto"){if(s==="height")return d.offsetHeight;if(s==="width")return d.offsetWidth}return s in K||(K[s]=Y.test(s)),K[s]?parseFloat(l)||0:l}function R(d,s){var l=arguments.length,i=H(d);return s=L[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,l===1?i:N(d,s,i[s]||d.style[s])}function j(d,s,l){var i=arguments.length;if(s=L[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,i===3)return typeof l=="number"&&Y.test(s)&&(l="".concat(l,"px")),d.style[s]=l,l;for(var o in s)s.hasOwnProperty(o)&&j(d,o,s[o]);return H(d)}function k(d){return d===document.body?document.documentElement.clientWidth:d.offsetWidth}function A(d){return d===document.body?window.innerHeight||document.documentElement.clientHeight:d.offsetHeight}function D(){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:d,height:s}}function g(){var d=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:d,height:s}}function h(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function u(d){var s=d.getBoundingClientRect(),l=document.documentElement;return{left:s.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},ynwM:function(Le,ye,F){var Y=F("MFOe"),K=Y.Global;Le.exports={name:"oldFF-globalStorage",read:H,write:N,each:R,remove:j,clearAll:k};var L=K.globalStorage;function H(A){return L[A]}function N(A,D){L[A]=D}function R(A){for(var D=L.length-1;D>=0;D--){var g=L.key(D);A(L[g],g)}}function j(A){return L.removeItem(A)}function k(){R(function(A,D){delete L[A]})}}}]);