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__Classrooms__Lists__Group...

208 lines
914 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[86,5,6,7],{"+NIl":function(ot,We,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(V,D){"use strict";function G(d,s){d.cmdState.push(s)}function N(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function M(d){var s=d.cmdState.pop();s&&s.closeBracket()}function W(d){for(var s=d.cmdState,h=s.length-1;h>=0;h--){var l=s[h];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function B(d,s,h){return function(){this.name=d,this.bracketNo=0,this.style=s,this.styles=h,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=B("importmodule","tag",["string","builtin"]),P.documentclass=B("documentclass","tag",["","atom"]),P.usepackage=B("usepackage","tag",["atom"]),P.begin=B("begin","tag",["atom"]),P.end=B("end","tag",["atom"]),P.label=B("label","tag",["atom"]),P.ref=B("ref","tag",["atom"]),P.eqref=B("eqref","tag",["atom"]),P.cite=B("cite","tag",["atom"]),P.bibitem=B("bibitem","tag",["atom"]),P.Bibitem=B("Bibitem","tag",["atom"]),P.RBibitem=B("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(d,s){d.f=s}function v(d,s){var h;if(d.match(/^\\[a-zA-Z@]+/)){var l=d.current().slice(1);return h=P.hasOwnProperty(l)?P[l]:P.DEFAULT,h=new h,G(s,h),R(s,p),h.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return R(s,function(o,f){return m(o,f,"\\]")}),"keyword";if(d.match("\\("))return R(s,function(o,f){return m(o,f,"\\)")}),"keyword";if(d.match("$$"))return R(s,function(o,f){return m(o,f,"$$")}),"keyword";if(d.match("$"))return R(s,function(o,f){return m(o,f,"$")}),"keyword";var i=d.next();if(i=="%")return d.skipToEnd(),"comment";if(i=="}"||i=="]"){if(h=N(s),h)h.closeBracket(i),R(s,p);else return"error";return"bracket"}else return i=="{"||i=="["?(h=P.DEFAULT,h=new h,G(s,h),"bracket"):/\d/.test(i)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),h=W(s),h.name=="begin"&&(h.argument=d.current()),h.styleIdentifier())}function m(d,s,h){if(d.eatSpace())return null;if(h&&d.match(h))return R(s,v),"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 l=d.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(d.skipToEnd(),"comment"):"error"}function p(d,s){var h=d.peek(),l;return h=="{"||h=="["?(l=N(s),l.openBracket(h),d.eat(h),R(s,v),"bracket"):/[ \t\r]/.test(h)?(d.eat(h),null):(R(s,v),M(s),v(d,s))}return{startState:function(){var d=D.inMathMode?function(s,h){return m(s,h)}:v;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=v,d.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(ot,We,Z){},"19Vz":function(ot,We,Z){(function(ne){ne(Z("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(B,P,R){var v=R&&R!=ne.Init;if(P&&!v)B.on("blur",N),B.on("change",M),B.on("swapDoc",M),ne.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){G(B)}),M(B);else if(!P&&v){B.off("blur",N),B.off("change",M),B.off("swapDoc",M),ne.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),V(B);var m=B.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}P&&!B.hasFocus()&&N(B)});function V(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function D(B){V(B);var P=B.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=B.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var R=B.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),P.appendChild(R),B.display.lineSpace.insertBefore(P,B.display.lineSpace.firstChild)}function G(B){setTimeout(function(){var P=!1,R=B.getInputField();R.nodeName=="TEXTAREA"?P=!R.value:B.lineCount()==1&&(P=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),P?D(B):V(B)},20)}function N(B){W(B)&&D(B)}function M(B){var P=B.getWrapperElement(),R=W(B);P.className=P.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?D(B):V(B)}function W(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function(ot,We,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(G,N){var M=G.indentUnit,W={},B=N.htmlMode?V:D;for(var P in B)W[P]=B[P];for(var P in N)W[P]=N[P];var R,v;function m(c,u){function g(I){return u.tokenize=I,I(c,u)}var b=c.next();if(b=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?g(s("atom","]]>")):null:c.match("--")?g(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),g(h(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),u.tokenize=s("meta","?>"),"meta"):(R=c.eat("/")?"closeTag":"openTag",u.tokenize=p,"tag bracket");if(b=="&"){var k;return c.eat("#")?c.eat("x")?k=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):k=c.eatWhile(/[\d]/)&&c.eat(";"):k=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),k?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function p(c,u){var g=c.next();if(g==">"||g=="/"&&c.eat(">"))return u.tokenize=m,R=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return R="equals",null;if(g=="<"){u.tokenize=m,u.state=f,u.tagName=u.tagStart=null;var b=u.tokenize(c,u);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(g)?(u.tokenize=d(g),u.stringStartCol=c.column(),u.tokenize(c,u)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(c){var u=function(g,b){for(;!g.eol();)if(g.next()==c){b.tokenize=p;break}return"string"};return u.isInAttribute=!0,u}function s(c,u){return function(g,b){for(;!g.eol();){if(g.match(u)){b.tokenize=m;break}g.next()}return c}}function h(c){return function(u,g){for(var b;(b=u.next())!=null;){if(b=="<")return g.tokenize=h(c+1),g.tokenize(u,g);if(b==">")if(c==1){g.tokenize=m;break}else return g.tokenize=h(c-1),g.tokenize(u,g)}return"meta"}}function l(c,u,g){this.prev=c.context,this.tagName=u,this.indent=c.indented,this.startOfLine=g,(W.doNotIndent.hasOwnProperty(u)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function i(c){c.context&&(c.context=c.context.prev)}function o(c,u){for(var g;;){if(!c.context)return;if(g=c.context.tagName,!W.contextGrabbers.hasOwnProperty(g)||!W.contextGrabbers[g].hasOwnProperty(u))return;i(c)}}function f(c,u,g){return c=="openTag"?(g.tagStart=u.column(),A):c=="closeTag"?x:f}function A(c,u,g){return c=="word"?(g.tagName=u.current(),v="tag",S):W.allowMissingTagName&&c=="endTag"?(v="tag bracket",S(c,u,g)):(v="error",A)}function x(c,u,g){if(c=="word"){var b=u.current();return g.context&&g.context.tagName!=b&&W.implicitlyClosed.hasOwnProperty(g.context.tagName)&&i(g),g.context&&g.context.tagName==b||W.matchClosing===!1?(v="tag",T):(v="tag error",O)}else return W.allowMissingTagName&&c=="endTag"?(v="tag bracket",T(c,u,g)):(v="error",O)}function T(c,u,g){return c!="endTag"?(v="error",T):(i(g),f)}function O(c,u,g){return v="error",T(c,u,g)}function S(c,u,g){if(c=="word")return v="attribute",w;if(c=="endTag"||c=="selfcloseTag"){var b=g.tagName,k=g.tagStart;return g.tagName=g.tagStart=null,c=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(b)?o(g,b):(o(g,b),g.context=new l(g,b,k==g.indented)),f}return v="error",S}function w(c,u,g){return c=="equals"?E:(W.allowMissing||(v="error"),S(c,u,g))}function E(c,u,g){return c=="string"?_:c=="word"&&W.allowUnquoted?(v="string",S):(v="error",S(c,u,g))}function _(c,u,g){return c=="string"?_:S(c,u,g)}return{startState:function(c){var u={tokenize:m,state:f,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(u.baseIndent=c),u},token:function(c,u){if(!u.tagName&&c.sol()&&(u.indented=c.indentation()),c.eatSpace())return null;R=null;var g=u.tokenize(c,u);return(g||R)&&g!="comment"&&(v=null,u.state=u.state(R||g,c,u),v&&(g=v=="error"?g+" error":v)),g},indent:function(c,u,g){var b=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+M;if(b&&b.noIndent)return ne.Pass;if(c.tokenize!=p&&c.tokenize!=m)return g?g.match(/^(\s*)/)[0].length:0;if(c.tagName)return W.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+M*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(u))return 0;var k=u&&/^<(\/)?([\w_:\.-]*)/.exec(u);if(k&&k[1])for(;b;)if(b.tagName==k[2]){b=b.prev;break}else if(W.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(k)for(;b;){var I=W.contextGrabbers[b.tagName];if(I&&I.hasOwnProperty(k[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+M:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(c){c.state==E&&(c.state=S)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var u=[],g=c.context;g;g=g.prev)g.tagName&&u.push(g.tagName);return u.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"500L":function(ot,We,Z){"use strict";Z.d(We,"a",function(){return x});var ne=Z("+L6B"),V=Z("2/Rp"),D=Z("2qtc"),G=Z("kLXV"),N=Z("9og8"),M=Z("k1fw"),W=Z("miYZ"),B=Z("tsqr"),P=Z("oBTY"),R=Z("tJVT"),v=Z("DZo9"),m=Z("8z0m"),p=Z("WmNS"),d=Z.n(p),s=Z("cDcd"),h=Z.n(s),l=Z("m3rI"),i=Z("wzkS"),o=Z("y5JW"),f=Z("LtfV"),A=m.a.Dragger;function x(T){var O=[];return T&&T.length>0&&(O=T.map(function(S){return{uid:S.id,id:S.id,name:S.title+o.c+S.filesize,url:S.url,filesize:S.filesize,status:"done",response:{id:S.id}}})),O}We.b=function(T){var O=T.value,S=T.onChange,w=T.action,E=T.className,_=T.maxSize,c=_===void 0?150:_,u=T.title,g=u===void 0?"\u4E0A\u4F20\u9644\u4EF6":u,b=T.showRemoveModal,k=b===void 0?!1:b,I=T.accept,F=I===void 0?"":I,U=T.additionalText,C=T.isDragger,y=T.number,j=y===void 0?1e3:y,K=T.aloneClear,Q=K===void 0?!1:K,te=Object(s.useState)(!1),_e=Object(R.a)(te,2),de=_e[0],me=_e[1],fe=Object(s.useState)(O||[]),pe=Object(R.a)(fe,2),ae=pe[0],he=pe[1];Object(s.useEffect)(function(){O&&(he(Object(P.a)(O)),j===(O==null?void 0:O.length)&&me(!0))},[O]);var $=function(){setTimeout(function(){ae.pop(),he(Object(P.a)(ae))},500)},ie={multiple:!0,disabled:de,accept:F,withCredentials:!0,fileList:ae,beforeUpload:function(we,ye){var xe=we.size/1024/1024;return ae.concat(ye).length>j?(ae.pop(),he(Object(P.a)(ae)),B.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(j,"\u4E2A\u6587\u4EF6")),Q?Promise.reject():($(),!1)):!0},action:w||"".concat(l.a.API_SERVER,"/api/attachments.json"),onChange:function(we){var ye,xe,Le=Object(P.a)(we.fileList);if(we.file.status==="done"&&((ye=we.file)===null||ye===void 0||((xe=ye.response)===null||xe===void 0)?void 0:xe.status)===-1){var ke,Pe;B.b.error((ke=we.file)===null||ke===void 0||((Pe=ke.response)===null||Pe===void 0)?void 0:Pe.message);return}Le.length>=j?me(!0):me(!1),he(Object(P.a)(Le)),Le=Le.map(function(Ae){var Oe;if(Ae!=null&&(Oe=Ae.response)!==null&&Oe!==void 0&&Oe.id){var Be;Ae.url="/api/attachments/".concat(Ae==null||((Be=Ae.response)===null||Be===void 0)?void 0:Be.id)}return Ae.name.indexOf(o.c)===-1&&(Ae.name="".concat(Ae.name).concat(o.c).concat(Object(o.a)(Ae.size))),Object(M.a)({},Ae)}),console.log("info:",we),S(Le)},onRemove:function(){var Ee=Object(N.a)(d.a.mark(function ye(xe){var Le;return d.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:if(Le=function(){var Ae=Object(N.a)(d.a.mark(function Oe(){var Be,Ve;return d.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:if(Be=xe.response?xe.response.id:xe.id,!Be){je.next=8;break}return je.next=4,Object(i.d)(xe.response?xe.response.id:xe.uid);case 4:return Ve=je.sent,je.abrupt("return",Ve);case 8:return je.abrupt("return",!0);case 9:case"end":return je.stop()}},Oe)}));return function(){return Ae.apply(this,arguments)}}(),!k){Pe.next=5;break}return Pe.abrupt("return",new Promise(function(Ae,Oe){G.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:h.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Be=Object(N.a)(d.a.mark(function ze(){var je;return d.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Xe.next=2,Le();case 2:je=Xe.sent,B.b.success("\u5220\u9664\u6210\u529F"),Ae(!0);case 5:case"end":return Xe.stop()}},ze)}));function Ve(){return Be.apply(this,arguments)}return Ve}(),onCancel:function(){return Ae(!1)}})}));case 5:return Pe.next=7,Le();case 7:return Pe.abrupt("return",Pe.sent);case 8:case"end":return Pe.stop()}},ye)}));function we(ye){return Ee.apply(this,arguments)}return we}()};function ee(Ee){Ee.preventDefault(),Ee.stopPropagation()}return h.a.createElement("div",{className:"multi-upload ".concat(E||"")},C&&h.a.createElement(A,ie,h.a.createElement("p",{className:"ant-upload-drag-icon"},h.a.createElement(f.a,null)),h.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",h.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",c,"MB)"," "),U),!C&&h.a.createElement(m.a,ie,h.a.createElement(V.a,{disabled:de},g),h.a.createElement("span",{onClick:ee,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",c,"MB)"," ")))}},"55Ip":function(ot,We,Z){"use strict";Z.d(We,"a",function(){return o});var ne=Z("Ty5D"),V=Z("dI71"),D=Z("cDcd"),G=Z.n(D),N=Z("YS25"),M=Z("17x9"),W=Z.n(M),B=Z("wx14"),P=Z("zLVn"),R=Z("9R94"),v=function(E){Object(V.a)(_,E);function _(){for(var u,g=arguments.length,b=new Array(g),k=0;k<g;k++)b[k]=arguments[k];return u=E.call.apply(E,[this].concat(b))||this,u.history=Object(N.a)(u.props),u}var c=_.prototype;return c.render=function(){return G.a.createElement(ne.c,{history:this.history,children:this.props.children})},_}(G.a.Component),m=function(E){Object(V.a)(_,E);function _(){for(var u,g=arguments.length,b=new Array(g),k=0;k<g;k++)b[k]=arguments[k];return u=E.call.apply(E,[this].concat(b))||this,u.history=Object(N.b)(u.props),u}var c=_.prototype;return c.render=function(){return G.a.createElement(ne.c,{history:this.history,children:this.props.children})},_}(G.a.Component),p=function(_,c){return typeof _=="function"?_(c):_},d=function(_,c){return typeof _=="string"?Object(N.c)(_,null,null,c):_},s=function(_){return _},h=G.a.forwardRef;typeof h=="undefined"&&(h=s);function l(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var i=h(function(E,_){var c=E.innerRef,u=E.navigate,g=E.onClick,b=Object(P.a)(E,["innerRef","navigate","onClick"]),k=b.target,I=Object(B.a)({},b,{onClick:function(U){try{g&&g(U)}catch(C){throw U.preventDefault(),C}!U.defaultPrevented&&U.button===0&&(!k||k==="_self")&&!l(U)&&(U.preventDefault(),u())}});return s!==h?I.ref=_||c:I.ref=c,G.a.createElement("a",I)}),o=h(function(E,_){var c=E.component,u=c===void 0?i:c,g=E.replace,b=E.to,k=E.innerRef,I=Object(P.a)(E,["component","replace","to","innerRef"]);return G.a.createElement(ne.e.Consumer,null,function(F){F||Object(R.a)(!1);var U=F.history,C=d(p(b,F.location),F.location),y=C?U.createHref(C):"",j=Object(B.a)({},I,{href:y,navigate:function(){var Q=p(b,F.location),te=g?U.replace:U.push;te(Q)}});return s!==h?j.ref=_||k:j.innerRef=k,G.a.createElement(u,j)})});if(!1)var f,A;var x=function(_){return _},T=G.a.forwardRef;typeof T=="undefined"&&(T=x);function O(){for(var E=arguments.length,_=new Array(E),c=0;c<E;c++)_[c]=arguments[c];return _.filter(function(u){return u}).join(" ")}var S=T(function(E,_){var c=E["aria-current"],u=c===void 0?"page":c,g=E.activeClassName,b=g===void 0?"active":g,k=E.activeStyle,I=E.className,F=E.exact,U=E.isActive,C=E.location,y=E.sensitive,j=E.strict,K=E.style,Q=E.to,te=E.innerRef,_e=Object(P.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(ne.e.Consumer,null,function(de){de||Object(R.a)(!1);var me=C||de.location,fe=d(p(Q,me),me),pe=fe.pathname,ae=pe&&pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),he=ae?Object(ne.f)(me.pathname,{path:ae,exact:F,sensitive:y,strict:j}):null,$=!!(U?U(he,me):he),ie=$?O(I,b):I,ee=$?Object(B.a)({},K,{},k):K,Ee=Object(B.a)({"aria-current":$&&u||null,className:ie,style:ee,to:fe},_e);return x!==T?Ee.ref=_||te:Ee.innerRef=te,G.a.createElement(o,Ee)})});if(!1)var w},"5VLF":function(ot,We,Z){"use strict";var ne,V;function D(G,N,M){var W=function(B,P){return G.js_beautify(B,P)};return W.js=G.js_beautify,W.css=N.css_beautify,W.html=M.html_beautify,W.js_beautify=G.js_beautify,W.css_beautify=N.css_beautify,W.html_beautify=M.html_beautify,W}!(ne=[Z("6UM0"),Z("TXwP"),Z("psGv")],V=function(G,N,M){return D(G,N,M)}.apply(We,ne),V!==void 0&&(ot.exports=V))},"6UM0":function(ot,We,Z){var ne,V;(function(){var D;(function(){"use strict";var N=[function(P,R,v){var m=v(1).Beautifier,p=v(5).Options;function d(s,h){var l=new m(s,h);return l.beautify()}P.exports=d,P.exports.defaultOptions=function(){return new p}},function(P,R,v){var m=v(2).Output,p=v(3).Token,d=v(4),s=v(5).Options,h=v(7).Tokenizer,l=v(7).line_starters,i=v(7).positionable_operators,o=v(7).TOKEN;function f(y,j){return j.indexOf(y)!==-1}function A(y){return y.replace(/^\s+/g,"")}function x(y){for(var j={},K=0;K<y.length;K++)j[y[K].replace(/-/g,"_")]=y[K];return j}function T(y,j){return y&&y.type===o.RESERVED&&y.text===j}function O(y,j){return y&&y.type===o.RESERVED&&f(y.text,j)}var S=["case","return","do","if","throw","else","await","break","continue","async"],w=["before-newline","after-newline","preserve-newline"],E=x(w),_=[E.before_newline,E.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function u(y,j){if(j.multiline_frame||j.mode===c.ForInitializer||j.mode===c.Conditional)return;y.remove_indent(j.start_line_index)}function g(y){y=y.replace(d.allLineBreaks,`
`);for(var j=[],K=y.indexOf(`
`);K!==-1;)j.push(y.substring(0,K)),y=y.substring(K+1),K=y.indexOf(`
`);return y.length&&j.push(y),j}function b(y){return y===c.ArrayLiteral}function k(y){return f(y,[c.Expression,c.ForInitializer,c.Conditional])}function I(y,j){for(var K=0;K<y.length;K++){var Q=y[K].trim();if(Q.charAt(0)!==j)return!1}return!0}function F(y,j){for(var K=0,Q=y.length,te;K<Q;K++)if(te=y[K],te&&te.indexOf(j)!==0)return!1;return!0}function U(y,j){j=j||{},this._source_text=y||"",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(j)}U.prototype.create_flags=function(y,j){var K=0;y&&(K=y.indentation_level,!this._output.just_added_newline()&&y.line_indent_level>K&&(K=y.line_indent_level));var Q={mode:j,parent:y,last_token:y?y.last_token:new p(o.START_BLOCK,""),last_word:y?y.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:K,alignment:0,line_indent_level:y?y.line_indent_level:K,start_line_index:this._output.get_line_number(),ternary_depth:0};return Q},U.prototype._reset=function(y){var j=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,j),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var K=new h(y,this._options);return this._tokens=K.tokenize(),y},U.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,j=this._reset(this._source_text),K=this._options.eol;this._options.eol==="auto"&&(K=`
`,j&&d.lineBreak.test(j||"")&&(K=j.match(d.lineBreak)[0]));for(var Q=this._tokens.next();Q;)this.handle_token(Q),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Q,Q=this._tokens.next();return y=this._output.get_code(K),y},U.prototype.handle_token=function(y,j){y.type===o.START_EXPR?this.handle_start_expr(y):y.type===o.END_EXPR?this.handle_end_expr(y):y.type===o.START_BLOCK?this.handle_start_block(y):y.type===o.END_BLOCK?this.handle_end_block(y):y.type===o.WORD?this.handle_word(y):y.type===o.RESERVED?this.handle_word(y):y.type===o.SEMICOLON?this.handle_semicolon(y):y.type===o.STRING?this.handle_string(y):y.type===o.EQUALS?this.handle_equals(y):y.type===o.OPERATOR?this.handle_operator(y):y.type===o.COMMA?this.handle_comma(y):y.type===o.BLOCK_COMMENT?this.handle_block_comment(y,j):y.type===o.COMMENT?this.handle_comment(y,j):y.type===o.DOT?this.handle_dot(y):y.type===o.EOF?this.handle_eof(y):y.type===o.UNKNOWN?this.handle_unknown(y,j):this.handle_unknown(y,j)},U.prototype.handle_whitespace_and_comments=function(y,j){var K=y.newlines,Q=this._options.keep_array_indentation&&b(this._flags.mode);if(y.comments_before)for(var te=y.comments_before.next();te;)this.handle_whitespace_and_comments(te,j),this.handle_token(te,j),te=y.comments_before.next();if(Q)for(var _e=0;_e<K;_e+=1)this.print_newline(_e>0,j);else if(this._options.max_preserve_newlines&&K>this._options.max_preserve_newlines&&(K=this._options.max_preserve_newlines),this._options.preserve_newlines&&K>1){this.print_newline(!1,j);for(var de=1;de<K;de+=1)this.print_newline(!0,j)}};var C=["async","break","continue","return","throw","yield"];U.prototype.allow_wrap_or_preserved_newline=function(y,j){if(j=j===void 0?!1:j,this._output.just_added_newline())return;var K=this._options.preserve_newlines&&y.newlines||j,Q=f(this._flags.last_token.text,i)||f(y.text,i);if(Q){var te=f(this._flags.last_token.text,i)&&f(this._options.operator_position,_)||f(y.text,i);K=K&&te}if(K)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,C))return;this._output.set_wrap_point()}},U.prototype.print_newline=function(y,j){if(!j&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var K=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&T(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(y)&&(this._flags.multiline_frame=!0)},U.prototype.print_token_line_indentation=function(y){this._output.just_added_newline()&&(this._options.keep_array_indentation&&y.newlines&&(y.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(y.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))},U.prototype.print_token=function(y){if(this._output.raw){this._output.add_raw_token(y);return}if(this._options.comma_first&&y.previous&&y.previous.type===o.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var j=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(j),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(y),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(y),this._output.non_breaking_space=!0,this._output.add_token(y.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},U.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.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))},U.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.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&&u(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},U.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||O(this._flags.last_token,["get","set"]))},U.prototype.start_of_statement=function(y){var j=!1;return j=j||O(this._flags.last_token,["var","let","const"])&&y.type===o.WORD,j=j||T(this._flags.last_token,"do"),j=j||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&O(this._flags.last_token,C)&&!y.newlines,j=j||T(this._flags.last_token,"else")&&!(T(y,"if")&&!y.comments_before),j=j||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),j=j||this._flags.last_token.type===o.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==o.WORD&&y.type!==o.RESERVED,j=j||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),j?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,O(y,["do","for","if","while"])),!0):!1},U.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var j=c.Expression;if(y.text==="["){if(this._flags.last_token.type===o.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(j),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}j=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,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,j=c.ForInitializer):f(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,j=c.Conditional):f(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(f(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var K=this._tokens.peek(-3);if(this._options.space_after_named_function&&K){var Q=this._tokens.peek(-4);O(K,["async","function"])||K.text==="*"&&O(Q,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(K.text==="{"||K.text===","||K.text==="*"&&(Q.text==="{"||Q.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(y);(this._flags.last_token.type===o.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===o.START_BLOCK?this.print_newline():(this._flags.last_token.type===o.END_EXPR||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===o.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(j),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},U.prototype.handle_end_expr=function(y){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===o.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(y),this.restore_mode(),u(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)},U.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var j=this._tokens.peek(),K=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):K&&(f(K.text,[":",","])&&f(j.type,[o.STRING,o.WORD,o.RESERVED])||f(j.text,["get","set","..."])&&f(K.type,[o.WORD,o.RESERVED]))?f(this._last_last_text,["class","interface"])&&!f(K.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===o.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):f(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var Q=!j.comments_before&&j.text==="}",te=Q&&this._flags.last_word==="function"&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var _e=0,de=null;this._flags.inline_frame=!0;do if(_e+=1,de=this._tokens.peek(_e-1),de.newlines){this._flags.inline_frame=!1;break}while(de.type!==o.EOF&&!(de.type===o.END_BLOCK&&de.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(te||this._flags.last_token.type===o.EQUALS||O(this._flags.last_token,S)&&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===o.START_EXPR||this._flags.last_token.type===o.COMMA)&&((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(this._flags.last_token.type===o.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!Q&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},U.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===c.Statement;)this.restore_mode();var j=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!j?this._output.space_before_token=!0:this._options.brace_style==="expand"?j||this.print_newline():j||(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(y)},U.prototype.handle_word=function(y){if(y.type===o.RESERVED){if(f(y.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)y.type=o.WORD;else if(y.text==="import"&&f(this._tokens.peek().text,["(","."]))y.type=o.WORD;else if(f(y.text,["as","from"])&&!this._flags.import_block)y.type=o.WORD;else if(this._flags.mode===c.ObjectLiteral){var j=this._tokens.peek();j.text===":"&&(y.type=o.WORD)}}if(this.start_of_statement(y)?O(this._flags.last_token,["var","let","const"])&&y.type===o.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!k(this._flags.mode)&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==o.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(T(y,"while")){this._output.space_before_token=!0,this.print_token(y),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&&T(y,"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&&O(y,["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(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y)),T(y,"function")){(f(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(f(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===o.OPERATOR))&&(!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,C)?this._output.space_before_token=!0:T(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===o.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(k(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var K="NONE";if(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?K="SPACE":O(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?K="NEWLINE":(K="SPACE",this._output.space_before_token=!0):K="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===c.BlockStatement?K="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&k(this._flags.mode)?K="SPACE":this._flags.last_token.type===o.STRING?K="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&f(this._last_last_text,["{",","]))?K="SPACE":this._flags.last_token.type===o.START_BLOCK?this._flags.inline_frame?K="SPACE":K="NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,K="NEWLINE"),O(y,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?K="SPACE":K="NEWLINE"),O(y,["else","catch","finally"]))if((!(this._flags.last_token.type===o.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Q=this._output.current_line;Q.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else K==="NEWLINE"?O(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?(this._flags.last_token.type!==o.START_EXPR||!O(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(y,"if")&&T(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(y,l)&&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():K==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===o.WORD||y.previous.type===o.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===o.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(y,"from")&&(this._flags.import_block=!1))},U.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var j=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&T(j,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},U.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===o.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===o.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},U.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},U.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(k(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(y)):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(y)},U.prototype.handle_operator=function(y){var j=y.text==="*"&&(O(this._flags.last_token,["function","yield"])||f(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),K=f(y.text,["-","+"])&&(f(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||f(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var Q=!j;this.handle_whitespace_and_comments(y,Q)}if(y.text==="*"&&this._flags.last_token.type===o.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===o.OPERATOR&&f(this._options.operator_position,_)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==o.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 te=!0,_e=!0,de=!1;if(y.text===":"?this._flags.ternary_depth===0?te=!1:(this._flags.ternary_depth-=1,de=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!K&&!j&&this._options.preserve_newlines&&f(y.text,i)){var me=y.text===":",fe=me&&de,pe=me&&!de;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!pe,this.print_token(y),(!me||fe)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!me||fe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case E.preserve_newline:pe||this.allow_wrap_or_preserved_newline(y),te=!(this._output.just_added_newline()||pe),this._output.space_before_token=te,this.print_token(y),this._output.space_before_token=!0;return}}if(j){this.allow_wrap_or_preserved_newline(y),te=!1;var ae=this._tokens.peek();_e=ae&&f(ae.type,[o.WORD,o.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),te=this._flags.last_token.type===o.START_BLOCK,_e=!1;else if(f(y.text,["--","++","!","~"])||K){if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),te=!1,_e=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var he=O(this._flags.last_token,S)&&y.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&k(this._flags.mode)&&(te=!0),this._flags.last_token.type===o.RESERVED?te=!0:this._flags.last_token.type===o.END_EXPR?te=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===o.OPERATOR&&(te=f(y.text,["--","-","++","+"])&&f(this._flags.last_token.text,["--","-","++","+"]),f(y.text,["+","-"])&&f(this._flags.last_token.text,["--","++"])&&(_e=!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||te,this.print_token(y),this._output.space_before_token=_e},U.prototype.handle_block_comment=function(y,j){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,j),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,j)},U.prototype.print_block_commment=function(y,j){var K=g(y.text),Q,te=!1,_e=!1,de=y.whitespace_before,me=de.length;if(this.print_newline(!1,j),this.print_token_line_indentation(y),this._output.add_token(K[0]),this.print_newline(!1,j),K.length>1){for(K=K.slice(1),te=I(K,"*"),_e=F(K,de),te&&(this._flags.alignment=1),Q=0;Q<K.length;Q++)te?(this.print_token_line_indentation(y),this._output.add_token(A(K[Q]))):_e&&K[Q]?(this.print_token_line_indentation(y),this._output.add_token(K[Q].substring(me))):(this._output.current_line.set_indent(-1),this._output.add_token(K[Q])),this.print_newline(!1,j);this._flags.alignment=0}},U.prototype.handle_comment=function(y,j){y.newlines?this.print_newline(!1,j):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(y),this.print_newline(!1,j)},U.prototype.handle_dot=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),O(this._flags.last_token,S)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(y,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(y)},U.prototype.handle_unknown=function(y,j){this.print_token(y),y.text[y.text.length-1]===`
`&&this.print_newline(!1,j)},U.prototype.handle_eof=function(y){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y)},P.exports.Beautifier=U},function(P){function R(p){this.__parent=p,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=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(p))return!0;return!1},R.prototype.set_indent=function(p,d){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.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)},R.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},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var d=p.lastIndexOf(`
`);d!==-1?this.__character_count=p.length-d:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,d){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),d=d||"",p.indent_level>0&&(d=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}v.prototype.get_indent_size=function(p,d){var s=this.__base_string_length;return d=d||0,p<0&&(s=0),s+=p*this.__indent_size,s+=d,s},v.prototype.get_indent_string=function(p,d){var s=this.__base_string;return d=d||0,p<0&&(p=0,s=""),d+=p*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,d=0,s="";this.__indent_size&&p>=this.__indent_size&&(d=Math.floor(p/this.__indent_size),p-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),p&&(s+=new Array(p+1).join(" ")),this.__cache.push(s)};function m(p,d){this.__indent_cache=new v(p,d),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,d){return this.__indent_cache.get_indent_string(p,d)},m.prototype.get_indent_size=function(p,d){return this.__indent_cache.get_indent_size(p,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){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 p!==`
`&&(s=s.replace(/[\n]/g,p)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,d){return p=p||0,d=d||0,this.next_line.set_indent(p,d),this.__lines.length>1?(this.current_line.set_indent(p,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var d=0;d<p.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var d=this.__lines.length;p<d;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,d){for(var s=this.__lines.length-2;s>=0;){var h=this.__lines[s];if(h.is_empty())break;if(h.item(0).indexOf(p)!==0&&h.item(-1)!==d){this.__lines.splice(s+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},P.exports.Output=m},function(P){function R(v,m,p,d){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}P.exports.Token=R},function(P,R){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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}|["+v+p+"])",h="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+d+"])*";R.identifier=new RegExp(s+h,"g"),R.identifierStart=new RegExp(s),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+d+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r
|`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(P,R,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function d(s){m.call(this,s,"js");var h=this.raw_options.brace_style||null;h==="expand-strict"?this.raw_options.brace_style="expand":h==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var i=0;i<l.length;i++)l[i]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[i];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",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}d.prototype=new m,P.exports.Options=d},function(P){function R(p,d){this.raw_options=v(p,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"])}R.prototype._get_array=function(p,d){var s=this.raw_options[p],h=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(h=s.concat()):typeof s=="string"&&(h=s.split(/[^a-zA-Z0-9_\/\-]+/)),h},R.prototype._get_boolean=function(p,d){var s=this.raw_options[p],h=s===void 0?!!d:!!s;return h},R.prototype._get_characters=function(p,d){var s=this.raw_options[p],h=d||"";return typeof s=="string"&&(h=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),h},R.prototype._get_number=function(p,d){var s=this.raw_options[p];d=parseInt(d,10),isNaN(d)&&(d=0);var h=parseInt(s,10);return isNaN(h)&&(h=d),h},R.prototype._get_selection=function(p,d,s){var h=this._get_selection_list(p,d,s);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[p]+"'");return h[0]},R.prototype._get_selection_list=function(p,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 h=this._get_array(p,s);if(!this._is_valid_selection(h,d))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[p]+"'");return h},R.prototype._is_valid_selection=function(p,d){return p.length&&d.length&&!p.some(function(s){return d.indexOf(s)===-1})};function v(p,d){var s={};p=m(p);var h;for(h in p)h!==d&&(s[h]=p[h]);if(d&&p[d])for(h in p[d])s[h]=p[d][h];return s}function m(p){var d={},s;for(s in p){var h=s.replace(/-/g,"_");d[h]=p[s]}return d}P.exports.Options=R,P.exports.normalizeOpts=m,P.exports.mergeOpts=v},function(P,R,v){var m=v(8).InputScanner,p=v(9).Tokenizer,d=v(9).TOKEN,s=v(13).Directives,h=v(4),l=v(12).Pattern,i=v(14).TemplatablePattern;function o(I,F){return F.indexOf(I)!==-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},A=new s(/\/\*/,/\*\//),x=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,O=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),w=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";w=w.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),w="\\?\\.(?!\\d) "+w,w=w.replace(/ /g,"|");var E=new RegExp(w),_="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=_.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),u=new RegExp("^(?:"+c.join("|")+")$"),g,b=function(I,F){p.call(this,I,F),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var U=new l(this._input),C=new i(this._input).read_options(this._options);this.__patterns={template:C,identifier:C.starting_with(h.identifier).matching(h.identifierMatch),number:U.matching(x),punct:U.matching(E),comment:U.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:U.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:U.matching(/<!--/),html_comment_end:U.matching(/-->/),include:U.starting_with(/#include/).until_after(h.lineBreak),shebang:U.starting_with(/#!/).until_after(h.lineBreak),xml:U.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:C.until(/['\\\n\r\u2028\u2029]/),double_quote:C.until(/["\\\n\r\u2028\u2029]/),template_text:C.until(/[`\\$]/),template_expression:C.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(I){return I.type===f.COMMENT||I.type===f.BLOCK_COMMENT||I.type===f.UNKNOWN},b.prototype._is_opening=function(I){return I.type===f.START_BLOCK||I.type===f.START_EXPR},b.prototype._is_closing=function(I,F){return(I.type===f.END_BLOCK||I.type===f.END_EXPR)&&F&&(I.text==="]"&&F.text==="["||I.text===")"&&F.text==="("||I.text==="}"&&F.text==="{")},b.prototype._reset=function(){g=!1},b.prototype._get_next_token=function(I,F){var U=null;this._readWhitespace();var C=this._input.peek();return C===null?this._create_token(f.EOF,""):(U=U||this._read_non_javascript(C),U=U||this._read_string(C),U=U||this._read_word(I),U=U||this._read_singles(C),U=U||this._read_comment(C),U=U||this._read_regexp(C,I),U=U||this._read_xml(C,I),U=U||this._read_punctuation(),U=U||this._create_token(f.UNKNOWN,this._input.next()),U)},b.prototype._read_word=function(I){var F;if(F=this.__patterns.identifier.read(),F!=="")return F=F.replace(h.allLineBreaks,`
`),!(I.type===f.DOT||I.type===f.RESERVED&&(I.text==="set"||I.text==="get"))&&u.test(F)?(F==="in"||F==="of")&&(I.type===f.WORD||I.type===f.STRING)?this._create_token(f.OPERATOR,F):this._create_token(f.RESERVED,F):this._create_token(f.WORD,F);if(F=this.__patterns.number.read(),F!=="")return this._create_token(f.WORD,F)},b.prototype._read_singles=function(I){var F=null;return I==="("||I==="["?F=this._create_token(f.START_EXPR,I):I===")"||I==="]"?F=this._create_token(f.END_EXPR,I):I==="{"?F=this._create_token(f.START_BLOCK,I):I==="}"?F=this._create_token(f.END_BLOCK,I):I===";"?F=this._create_token(f.SEMICOLON,I):I==="."&&O.test(this._input.peek(1))?F=this._create_token(f.DOT,I):I===","&&(F=this._create_token(f.COMMA,I)),F&&this._input.next(),F},b.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(f.EQUALS,I):I==="?."?this._create_token(f.DOT,I):this._create_token(f.OPERATOR,I)},b.prototype._read_non_javascript=function(I){var F="";if(I==="#"){if(this._is_first_token()&&(F=this.__patterns.shebang.read(),F))return this._create_token(f.UNKNOWN,F.trim()+`
`);if(F=this.__patterns.include.read(),F)return this._create_token(f.UNKNOWN,F.trim()+`
`);I=this._input.next();var U="#";if(this._input.hasNext()&&this._input.testChar(T)){do I=this._input.next(),U+=I;while(this._input.hasNext()&&I!=="#"&&I!=="=");return I==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(U+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(U+="{}",this._input.next(),this._input.next())),this._create_token(f.WORD,U)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(F=this.__patterns.html_comment_start.read(),F){for(;this._input.hasNext()&&!this._input.testChar(h.newline);)F+=this._input.next();return g=!0,this._create_token(f.COMMENT,F)}}else if(g&&I==="-"&&(F=this.__patterns.html_comment_end.read(),F))return g=!1,this._create_token(f.COMMENT,F);return null},b.prototype._read_comment=function(I){var F=null;if(I==="/"){var U="";if(this._input.peek(1)==="*"){U=this.__patterns.block_comment.read();var C=A.get_directives(U);C&&C.ignore==="start"&&(U+=A.readIgnored(this._input)),U=U.replace(h.allLineBreaks,`
`),F=this._create_token(f.BLOCK_COMMENT,U),F.directives=C}else this._input.peek(1)==="/"&&(U=this.__patterns.comment.read(),F=this._create_token(f.COMMENT,U))}return F},b.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var F=this._input.next();return this.has_char_escapes=!1,I==="`"?F+=this._read_string_recursive("`",!0,"${"):F+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(F=k(F)),this._input.peek()===I&&(F+=this._input.next()),F=F.replace(h.allLineBreaks,`
`),this._create_token(f.STRING,F)}return null},b.prototype._allow_regexp_or_xml=function(I){return I.type===f.RESERVED&&o(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===f.END_EXPR&&I.text===")"&&I.opened.previous.type===f.RESERVED&&o(I.opened.previous.text,["if","while","for"])||o(I.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(I,F){if(I==="/"&&this._allow_regexp_or_xml(F)){for(var U=this._input.next(),C=!1,y=!1;this._input.hasNext()&&(C||y||this._input.peek()!==I)&&!this._input.testChar(h.newline);)U+=this._input.peek(),C?C=!1:(C=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===I&&(U+=this._input.next(),U+=this._input.read(h.identifier)),this._create_token(f.STRING,U)}return null},b.prototype._read_xml=function(I,F){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(F)){var U="",C=this.__patterns.xml.read_match();if(C){for(var y=C[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),j=y.indexOf("{")===0,K=0;C;){var Q=!!C[1],te=C[2],_e=!!C[C.length-1]||te.slice(0,8)==="![CDATA[";if(!_e&&(te===y||j&&te.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Q?--K:++K),U+=C[0],K<=0)break;C=this.__patterns.xml.read_match()}return C||(U+=this._input.match(/[\s\S]*/g)[0]),U=U.replace(h.allLineBreaks,`
`),this._create_token(f.STRING,U)}}return null};function k(I){for(var F="",U=0,C=new m(I),y=null;C.hasNext();)if(y=C.match(/([\s]|[^\\]|\\\\)+/g),y&&(F+=y[0]),C.peek()==="\\"){if(C.next(),C.peek()==="x")y=C.match(/x([0-9A-Fa-f]{2})/g);else if(C.peek()==="u")y=C.match(/u([0-9A-Fa-f]{4})/g);else{F+="\\",C.hasNext()&&(F+=C.next());continue}if(!y)return I;if(U=parseInt(y[1],16),U>126&&U<=255&&y[0].indexOf("x")===0)return I;if(U>=0&&U<32){F+="\\"+y[0];continue}else U===34||U===39||U===92?F+="\\"+String.fromCharCode(U):F+=String.fromCharCode(U)}return F}b.prototype._read_string_recursive=function(I,F,U){var C,y;I==="'"?y=this.__patterns.single_quote:I==='"'?y=this.__patterns.double_quote:I==="`"?y=this.__patterns.template_text:I==="}"&&(y=this.__patterns.template_expression);for(var j=y.read(),K="";this._input.hasNext();){if(K=this._input.next(),K===I||!F&&h.newline.test(K)){this._input.back();break}else K==="\\"&&this._input.hasNext()?(C=this._input.peek(),C==="x"||C==="u"?this.has_char_escapes=!0:C==="\r"&&this._input.peek(1)===`
`&&this._input.next(),K+=this._input.next()):U&&(U==="${"&&K==="$"&&this._input.peek()==="{"&&(K+=this._input.next()),U===K&&(I==="`"?K+=this._read_string_recursive("}",F,"`"):K+=this._read_string_recursive("`",F,"${"),this._input.hasNext()&&(K+=this._input.next())));K+=y.read(),j+=K}return j},P.exports.Tokenizer=b,P.exports.TOKEN=f,P.exports.positionable_operators=S.slice(),P.exports.line_starters=_.slice()},function(P){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var d=m.exec(this.__input);return d&&!(R&&m.sticky)&&(d.index!==p&&(d=null)),d},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var d=this.peek(p);return m.lastIndex=0,d!==null&&m.test(d)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,d){var s="",h;return m&&(h=this.match(m),h&&(s+=h[0])),p&&(h||!m)&&(s+=this.readUntil(p,d)),s},v.prototype.readUntil=function(m,p){var d="",s=this.__position;m.lastIndex=this.__position;var h=m.exec(this.__input);return h?(s=h.index,p&&(s+=h[0].length)):s=this.__input_length,d=this.__input.substring(this.__position,s),this.__position=s,d},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var d=null,s="g";return p&&R&&(s="y"),typeof m=="string"&&m!==""?d=new RegExp(m,s):m&&(d=new RegExp(m.source,s)),d},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,d=this.readUntilAfter(m);return this.__position=p,d},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},P.exports.InputScanner=v},function(P,R,v){var m=v(8).InputScanner,p=v(3).Token,d=v(10).TokenStream,s=v(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(i,o){this._input=new m(i),this._options=o||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var i,o=new p(h.START,""),f=null,A=[],x=new d;o.type!==h.EOF;){for(i=this._get_next_token(o,f);this._is_comment(i);)x.add(i),i=this._get_next_token(o,f);x.isEmpty()||(i.comments_before=x,x=new d),i.parent=f,this._is_opening(i)?(A.push(f),f=i):f&&this._is_closing(i,f)&&(i.opened=f,f.closed=i,f=A.pop(),i.parent=f),i.previous=o,o.next=i,this.__tokens.add(i),o=i}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(i,o){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(h.RAW,f):this._create_token(h.EOF,"")},l.prototype._is_comment=function(i){return!1},l.prototype._is_opening=function(i){return!1},l.prototype._is_closing=function(i,o){return!1},l.prototype._create_token=function(i,o){var f=new p(i,o,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},P.exports.Tokenizer=l,P.exports.TOKEN=h},function(P){function R(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position<this.__tokens_length},R.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},R.prototype.peek=function(v){var m=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(m=this.__tokens[v]),m},R.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},P.exports.TokenStream=R},function(P,R,v){var m=v(12).Pattern;function p(d,s){m.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=""}p.prototype=new m,p.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+"]")},p.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},p.prototype.matching=function(d,s){var h=this._create();return h.__set_whitespace_patterns(d,s),h._update(),h},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(d,s){d.lastIndex=0;for(var h=0,l=[],i=d.exec(s);i;)l.push(s.substring(h,i.index)),h=i.index+i[0].length,i=d.exec(s);return h<s.length?l.push(s.substring(h,s.length)):l.push(""),l},P.exports.WhitespacePattern=p},function(P){function R(v,m){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}R.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},R.prototype.read_match=function(){return this._input.match(this._match_pattern)},R.prototype.until_after=function(v){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(v),m._update(),m},R.prototype.until=function(v){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(v),m._update(),m},R.prototype.starting_with=function(v){var m=this._create();return m._starting_pattern=this._input.get_regexp(v,!0),m._update(),m},R.prototype.matching=function(v){var m=this._create();return m._match_pattern=this._input.get_regexp(v,!0),m._update(),m},R.prototype._create=function(){return new R(this._input,this)},R.prototype._update=function(){},P.exports.Pattern=R},function(P){function R(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}R.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},R.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},P.exports.Directives=R},function(P,R,v){var m=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(s,h){m.call(this,s,h),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var l=new m(s);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new m,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(s){var h=this._create();return h._disabled[s]=!0,h._update(),h},d.prototype.read_options=function(s){var h=this._create();for(var l in p)h._disabled[l]=s.templating.indexOf(l)===-1;return h._update(),h},d.prototype.exclude=function(s){var h=this._create();return h._excluded[s]=!0,h._update(),h},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 h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),s+=h,h=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="",h=this._input.peek();if(h==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(s=s||this.__patterns.erb.read())}else h==="{"&&(!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},P.exports.TemplatablePattern=d}],M={};function W(P){var R=M[P];if(R!==void 0)return R.exports;var v=M[P]={exports:{}};return N[P](v,v.exports,W),v.exports}var B=W(0);D=B})();var G=D;!(ne=[],V=function(){return{js_beautify:G}}.apply(We,ne),V!==void 0&&(ot.exports=V))})()},"7Cbv":function(ot,We,Z){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function D(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(V)}var G=/^(?:[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(p){return typeof p=="string"&&G.test(p)}for(var M=N,W=[],B=0;B<256;++B)W.push((B+256).toString(16).substr(1));function P(p){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(W[p[d+0]]+W[p[d+1]]+W[p[d+2]]+W[p[d+3]]+"-"+W[p[d+4]]+W[p[d+5]]+"-"+W[p[d+6]]+W[p[d+7]]+"-"+W[p[d+8]]+W[p[d+9]]+"-"+W[p[d+10]]+W[p[d+11]]+W[p[d+12]]+W[p[d+13]]+W[p[d+14]]+W[p[d+15]]).toLowerCase();if(!M(s))throw TypeError("Stringified UUID is invalid");return s}var R=P;function v(p,d,s){p=p||{};var h=p.random||(p.rng||D)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,d){s=s||0;for(var l=0;l<16;++l)d[s+l]=h[l];return d}return R(h)}var m=We.a=v},"7ahc":function(ot,We,Z){"use strict";Z.d(We,"a",function(){return A});var ne=Z("k1fw"),V=Z("0Owb"),D=Z("+L6B"),G=Z("2/Rp"),N=Z("y8nQ"),M=Z("Vl3Y"),W=Z("tJVT"),B=Z("OaEy"),P=Z("2fM7"),R=Z("cDcd"),v=Z.n(R),m=Z("VrN/"),p=Z.n(m),d=Z("p77/"),s=Z.n(d),h=Z("c5Ni"),l=Z.n(h),i=P.a.Option,o={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"]};We.b=function(x){var T=x.callback,O=x.onCancel,S=Object(R.useState)("python"),w=Object(W.a)(S,2),E=w[0],_=w[1];function c(g){_(f[g][1])}function u(g){T(g)}return v.a.createElement(M.a,Object(V.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:u}),v.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(P.a,{onChange:c},Object.keys(f).map(function(g){return v.a.createElement(i,{key:g,value:g},f[g][0])}))),v.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(A,{mode:E})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(G.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function A(x){var T=x.value,O=x.onChange,S=x.mode,w=x.options,E=w===void 0?{}:w,_=Object(R.useRef)(),c=Object(R.useState)(),u=Object(W.a)(c,2),g=u[0],b=u[1];return Object(R.useEffect)(function(){if(g){function k(I){var F=I.getValue();O&&O(F)}return g.on("change",k),function(){g.off("change",k)}}},[g,O]),Object(R.useEffect)(function(){g&&g.setOption("mode",S)},[g,S]),Object(R.useEffect)(function(){g&&((T!==g.getValue()||T==="")&&setTimeout(function(){g.setValue(T||" ")},300))},[g,T]),Object(R.useEffect)(function(){if(_.current&&!g){var k=p.a.fromTextArea(_.current,Object(ne.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));b(k)}},[_.current,g]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:_}))}},"8EBN":function(ot,We,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";ne.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 V=0;V<ne.modeInfo.length;V++){var D=ne.modeInfo[V];D.mimes&&(D.mime=D.mimes[0])}ne.findModeByMIME=function(G){G=G.toLowerCase();for(var N=0;N<ne.modeInfo.length;N++){var M=ne.modeInfo[N];if(M.mime==G)return M;if(M.mimes){for(var W=0;W<M.mimes.length;W++)if(M.mimes[W]==G)return M}}if(/\+xml$/.test(G))return ne.findModeByMIME("application/xml");if(/\+json$/.test(G))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(G){G=G.toLowerCase();for(var N=0;N<ne.modeInfo.length;N++){var M=ne.modeInfo[N];if(M.ext){for(var W=0;W<M.ext.length;W++)if(M.ext[W]==G)return M}}},ne.findModeByFileName=function(G){for(var N=0;N<ne.modeInfo.length;N++){var M=ne.modeInfo[N];if(M.file&&M.file.test(G))return M}var W=G.lastIndexOf("."),B=W>-1&&G.substring(W+1,G.length);if(B)return ne.findModeByExtension(B)},ne.findModeByName=function(G){G=G.toLowerCase();for(var N=0;N<ne.modeInfo.length;N++){var M=ne.modeInfo[N];if(M.name.toLowerCase()==G)return M;if(M.alias){for(var W=0;W<M.alias.length;W++)if(M.alias[W].toLowerCase()==G)return M}}}})},"8hTe":function(ot,We,Z){ot.exports={button:"button___1wy9m"}},"9Bee":function(ot,We,Z){"use strict";var ne=Z("DYRE"),V=Z("zeV3"),D=Z("+L6B"),G=Z("2/Rp"),N=Z("k1fw"),M=Z("tJVT"),W=Z("cDcd"),B=Z.n(W),P=Z("vg9a"),R=Z("DlQD"),v=Z.n(R),m=Z("rUJ1");function p(me,fe){var pe=me.match(/^(\s+)(?:```)/);if(pe===null)return fe;var ae=pe[1];return fe.split(`
`).map(function(he){var $=he.match(/^\s+/);if($===null)return he;var ie=Object(M.a)($,1),ee=ie[0];return ee.length>=ae.length?he.slice(ae.length):he}).join(`
`)}var d=[],s=["<ul>"],h=new v.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function i(){d.length=0,s=["<ul>"]}var o={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(me,fe,pe,ae){if(fe>=me.length||me[fe].level<=pe)return fe;var he=me[fe];ae.push("<li><a href='#"+he.anchor+"'>"+he.text+"</a>"),fe++;var $=[];return fe=f(me,fe,he.level,$),$.length>0&&(ae.push("<ul>"),$.forEach(function(ie){ae.push(ie)}),ae.push("</ul>")),ae.push("</li>"),fe=f(me,fe,pe,ae),fe}function A(){return f(d,0,0,s),s.push("</ul>"),s.join("")}var x={heading:function(fe){var pe=l.exec(fe);if(pe)return{type:"heading",raw:pe[0],depth:pe[1].length,text:pe[2]}},fences:function(fe){var pe=this.rules.block.fences.exec(fe);if(pe){var ae=pe[0],he=p(ae,pe[3]||""),$=pe[2]?pe[2].trim():pe[2];if(["latex","katex","math"].indexOf($)>=0){var ie=S(),ee=he;he=ie,w[ie]={type:"block",expression:ee}}return{type:"code",raw:ae,lang:$,text:he}}}},T=/(?:\${2})([^\n`]+?)(?:\${2})/gi,O=0,S=function(){return"__special_katext_id_".concat(O++,"__")},w={};function E(){return w}function _(){O=0,w={}}function c(me){return me=me.replace(T,function(fe,pe){var ae=S();return w[ae]={type:"inline",expression:pe},ae}),me}var u=h.listitem;h.listitem=function(me){return u(c(me))};var g=h.paragraph;h.paragraph=function(me){return g(c(me))};var b=h.tablecell;h.tablecell=function(me,fe){return b(c(me),fe)},h.code=function(me,fe,pe){var ae=(fe||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(me,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(fe,'">').concat(pe?me:Object(m.escape)(me,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(pe?me:Object(m.escape)(me,!0))+"</code></pre>"},h.heading=function(me,fe,pe){var ae=this.options.headerPrefix+pe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:ae,level:fe,text:me}),"<h"+fe+' id="'+ae+'">'+me+"</h"+fe+">"},v.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),v.a.use({tokenizer:x,renderer:h});var k=v.a,I=Z("SJMd"),F=Z("ulZh"),U=Z.n(F),C=Z("m3rI"),y=Z("Oy/b"),j=Z("p5ED"),K=Z("8hTe"),Q=Z.n(K),te=/<pre[^>]*>/g;function _e(me){var fe=document.createElement("div");return fe.innerHTML=me,fe.childNodes.length===0?"":fe.childNodes[0].nodeValue}var de=We.a=function(me){var fe=me.value,pe=fe===void 0?"":fe,ae=me.edit,he=ae===void 0?!1:ae,$=me.className,ie=me.showTextOnly,ee=me.showLines,Ee=me.replaces,we=me.zoomImg,ye=me.hasMask,xe=me.style,Le=xe===void 0?{}:xe,ke=me.stylesPrev,Pe=ke===void 0?{}:ke,Ae=String(pe),Oe=Object(W.useRef)(),Be=Object(W.useRef)(),Ve=Object(W.useState)(""),ze=Object(M.a)(Ve,2),je=ze[0],et=ze[1],Xe=Object(W.useState)("office"),$e=Object(M.a)(Xe,2),Ce=$e[0],qe=$e[1],Ke=Object(W.useMemo)(function(){try{var ue=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,J=/\"\/api\/attachments\/|\"\/attachments\/download\//g,q=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ae=Ae.replace(ue,"("+C.a.API_SERVER+"/api/attachments/").replace(J,'"'+C.a.API_SERVER+"/api/attachments/").replace(q,'"'+C.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(Re){}var re=k(Ae),oe=E();if(Ae.match(/\[TOC\]/)&&(re=re.replace("<p>[TOC]</p>",A()),i()),re=re.replace(/(__special_katext_id_\d+__)/g,function(Re,De){var Je=oe[De],it=Je.type,rt=Je.expression;return Object(y.renderToString)(_e(rt)||"",{displayMode:it==="block",throwOnError:!1,output:"html"})}),re=re.replace(/▁/g,"\u2581\u2581\u2581"),_(),ie){var ge=document.createElement("div");return ge.innerHTML=re,ge.innerText}return setTimeout(function(){return ve()},500),re},[Ae]),Se=Object(W.useRef)();o.WebkitLineClamp=ee,ee&&(Le=Object(N.a)(Object(N.a)({},Le),o));function Me(ue){var J=ue.target;if(J.tagName.toUpperCase()==="IMG"){if(we){var q=J.getAttribute("src");et(q),qe("image")}}else if(J.tagName.toUpperCase()==="A"){var re=J.getAttribute("href");if(re.indexOf("office")>-1)ue.preventDefault(),et(re),qe("office");else if(re.indexOf("application/pdf")>-1)ue.preventDefault(),et(re),qe("pdf");else if(re.indexOf("text/html")>-1)ue.preventDefault(),et(re),qe("html");else if(re.startsWith("#")){ue.preventDefault();var oe=document.getElementById(re.replace("#",""));oe&&oe.scrollIntoView(!0)}}}var ve=function(){var J,q=(J=Se.current)===null||J===void 0?void 0:J.querySelectorAll("video");q==null||q.forEach(function(re){if(re.oncontextmenu=function(){return!1},re.src.indexOf(".m3u8")>-1&&!re.canPlayType("application/vnd.apple.mpegurl")){if(U.a.isSupported()){var oe=new U.a;oe.loadSource(re.src),oe.attachMedia(re)}}})};Object(W.useEffect)(function(){if(Se.current&&Ke&&(Ke.match(te)&&window.PR.prettyPrint()),Se.current)return Se.current.addEventListener("click",Me),function(){Se.current.removeEventListener("click",Me),_(),i()}},[Ke,Se.current,Me]);var le=function(J){if(!he)return;J.target.nodeName==="IMG"?(Oe.current.style.display="flex",Oe.current.style.width=J.target.clientWidth+"px",Oe.current.style.height=J.target.clientHeight+"px",Oe.current.style.top=J.target.offsetTop+"px",Oe.current.style.left=J.target.offsetLeft+"px",Be.current.src=J.target.getAttribute("src")):Oe.current.style.display="none"};return B.a.createElement("div",{style:{position:"relative"}},B.a.createElement("div",{ref:Se,style:Object(N.a)({},Le),className:"".concat($||""," markdown-body ").concat(Q.a.mdBody),onMouseOver:le,dangerouslySetInnerHTML:{__html:Ke}}),B.a.createElement("div",{ref:Oe,className:Q.a.button},B.a.createElement(V.a,null,B.a.createElement(G.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),B.a.createElement(G.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),B.a.createElement("img",{ref:Be,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),B.a.createElement(j.a,{close:!0,data:je,type:je!=null&&je.length?Ce:"",style:Object(N.a)({},Pe),onClose:function(){return et("")}}))}},"9VGf":function(ot,We,Z){"use strict";Z.d(We,"a",function(){return D});var ne=Z("cDcd"),V=Z.n(ne);function D(G,N){var M=Object(ne.useRef)();Object(ne.useEffect)(function(){M.current=G}),Object(ne.useEffect)(function(){function W(){M.current()}if(N!==null){var B=setInterval(W,N);return function(){return clearInterval(B)}}},[N])}},BU3w:function(ot,We,Z){"use strict";Z.d(We,"a",function(){return M});var ne=Z("MNnm"),V="rc-util-key";function D(W){if(W.attachTo)return W.attachTo;var B=document.querySelector("head");return B||document.body}function G(W){var B,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var R=document.createElement("style");if((B=P.csp)===null||B===void 0?void 0:B.nonce){var v;R.nonce=(v=P.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=W;var m=D(P),p=m.firstChild;return P.prepend&&m.prepend?m.prepend(R):P.prepend&&p?m.insertBefore(R,p):m.appendChild(R),R}var N=new Map;function M(W,B){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=D(P);if(!N.has(R)){var v=G("",P),m=v.parentNode;N.set(R,m),m.removeChild(v)}var p=Array.from(N.get(R).children).find(function(i){return i.tagName==="STYLE"&&i[V]===B});if(p){var d,s;if(((d=P.csp)===null||d===void 0?void 0:d.nonce)&&p.nonce!==((s=P.csp)===null||s===void 0?void 0:s.nonce)){var h;p.nonce=(h=P.csp)===null||h===void 0?void 0:h.nonce}return p.innerHTML!==W&&(p.innerHTML=W),p}var l=G(W,P);return l[V]=B,l}},Bd2K:function(ot,We,Z){(function(ne){ne(Z("VrN/"),Z("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(P,R,v){if(v!=ne.Init&&v&&P.removeKeyMap("autoCloseTags"),!R)return;var m={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(m["'/'"]=function(p){return M(p)}),(typeof R!="object"||R.whenOpening!==!1)&&(m["'>'"]=function(p){return G(p)}),P.addKeyMap(m)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function G(P){if(P.getOption("disableInput"))return ne.Pass;for(var R=P.listSelections(),v=[],m=P.getOption("autoCloseTags"),p=0;p<R.length;p++){if(!R[p].empty())return ne.Pass;var d=R[p].head,s=P.getTokenAt(d),h=ne.innerMode(P.getMode(),s.state),l=h.state,i=h.mode.xmlCurrentTag&&h.mode.xmlCurrentTag(l),o=i&&i.name;if(!o)return ne.Pass;var f=h.mode.configuration=="html",A=typeof m=="object"&&m.dontCloseTags||f&&V,x=typeof m=="object"&&m.indentTags||f&&D;s.end>d.ch&&(o=o.slice(0,o.length-s.end+d.ch));var T=o.toLowerCase();if(!o||s.type=="string"&&(s.end!=d.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&i.close||s.string.indexOf("/")==d.ch-s.start-1||A&&W(A,T)>-1||B(P,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(l)||[],o,d,!0))return ne.Pass;var O=typeof m=="object"&&m.emptyTags;if(O&&W(O,o)>-1){v[p]={text:"/>",newPos:ne.Pos(d.line,d.ch+2)};continue}var S=x&&W(x,T)>-1;v[p]={indent:S,text:">"+(S?`
`:"")+"</"+o+">",newPos:S?ne.Pos(d.line+1,0):ne.Pos(d.line,d.ch+1)}}for(var w=typeof m=="object"&&m.dontIndentOnAutoClose,p=R.length-1;p>=0;p--){var E=v[p];P.replaceRange(E.text,R[p].head,R[p].anchor,"+insert");var _=P.listSelections().slice(0);_[p]={head:E.newPos,anchor:E.newPos},P.setSelections(_),!w&&E.indent&&(P.indentLine(E.newPos.line,null,!0),P.indentLine(E.newPos.line+1,null,!0))}}function N(P,R){for(var v=P.listSelections(),m=[],p=R?"/":"</",d=P.getOption("autoCloseTags"),s=typeof d=="object"&&d.dontIndentOnSlash,h=0;h<v.length;h++){if(!v[h].empty())return ne.Pass;var l=v[h].head,i=P.getTokenAt(l),o=ne.innerMode(P.getMode(),i.state),f=o.state;if(R&&(i.type=="string"||i.string.charAt(0)!="<"||i.start!=l.ch-1))return ne.Pass;var A,x=o.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(x&&o.mode.name=="javascript")A=p+"script";else if(x&&o.mode.name=="css")A=p+"style";else{var T=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(f);if(!T||T.length&&B(P,T,T[T.length-1],l))return ne.Pass;A=p+T[T.length-1]}P.getLine(l.line).charAt(i.end)!=">"&&(A+=">"),m[h]=A}if(P.replaceSelections(m),v=P.listSelections(),!s)for(var h=0;h<v.length;h++)(h==v.length-1||v[h].head.line<v[h+1].head.line)&&P.indentLine(v[h].head.line)}function M(P){return P.getOption("disableInput")?ne.Pass:N(P,!0)}ne.commands.closeTag=function(P){return N(P)};function W(P,R){if(P.indexOf)return P.indexOf(R);for(var v=0,m=P.length;v<m;++v)if(P[v]==R)return v;return-1}function B(P,R,v,m,p){if(!ne.scanForClosingTag)return!1;var d=Math.min(P.lastLine()+1,m.line+500),s=ne.scanForClosingTag(P,m,null,d);if(!s||s.tag!=v)return!1;for(var h=p?1:0,l=R.length-1;l>=0&&R[l]==v;l--)++h;m=s.to;for(var l=1;l<h;l++){var i=ne.scanForClosingTag(P,m,null,d);if(!i||i.tag!=v)return!1;m=i.to}return!0}})},BjJ7:function(ot,We,Z){"use strict";Z.d(We,"d",function(){return V}),Z.d(We,"c",function(){return D}),Z.d(We,"e",function(){return G}),Z.d(We,"b",function(){return N}),Z.d(We,"a",function(){return W});var ne=Z("m3rI");function V(B){var P=!0;if(B.length>0){for(var R=0;R<B.length;R++)if(B[R].compile_success==0||!B[R].compile_success){P=!1;break}}else P=!1;return P}function D(B){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;v<B.length;v++){var m=B[v],p=P?"".concat(P,"/").concat(m.name):"".concat(m.name);R.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return R}function G(B,P,R){for(var v=0;v<B.length;v++){var m=B[v];if(m.key===P){m.children=R;break}m.children&&G(m.children,P,R)}return B}function N(B,P,R){var v;return function(){var m=this,p=arguments,d=function(){v=null,R||B.apply(m,p)},s=R&&!v;clearTimeout(v),v=setTimeout(d,P),s&&B.apply(m,p)}}var M=!0,W=ne.a.API_SERVER},"C+DQ":function(ot,We,Z){},DlQD:function(ot,We,Z){(function(ne,V){ot.exports=V()})(this,function(){"use strict";function ne(ve,le){for(var ue=0;ue<le.length;ue++){var J=le[ue];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(ve,J.key,J)}}function V(ve,le,ue){return le&&ne(ve.prototype,le),ue&&ne(ve,ue),ve}function D(ve,le){if(!ve)return;if(typeof ve=="string")return G(ve,le);var ue=Object.prototype.toString.call(ve).slice(8,-1);if(ue==="Object"&&ve.constructor&&(ue=ve.constructor.name),ue==="Map"||ue==="Set")return Array.from(ve);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return G(ve,le)}function G(ve,le){(le==null||le>ve.length)&&(le=ve.length);for(var ue=0,J=new Array(le);ue<le;ue++)J[ue]=ve[ue];return J}function N(ve,le){var ue;if(typeof Symbol=="undefined"||ve[Symbol.iterator]==null){if(Array.isArray(ve)||(ue=D(ve))||le&&ve&&typeof ve.length=="number"){ue&&(ve=ue);var J=0;return function(){return J>=ve.length?{done:!0}:{done:!1,value:ve[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.`)}return ue=ve[Symbol.iterator](),ue.next.bind(ue)}function M(ve,le){return le={exports:{}},ve(le,le.exports),le.exports}var W=M(function(ve){function le(){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 ue(J){ve.exports.defaults=J}ve.exports={defaults:le(),getDefaults:le,changeDefaults:ue}}),B=W.defaults,P=W.getDefaults,R=W.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},h=function(le){return s[le]};function l(ve,le){if(le){if(v.test(ve))return ve.replace(m,h)}else if(p.test(ve))return ve.replace(d,h);return ve}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(ve){return ve.replace(i,function(le,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var f=/(^|[^\[])\^/g;function A(ve,le){ve=ve.source||ve,le=le||"";var ue={replace:function(q,re){return re=re.source||re,re=re.replace(f,"$1"),ve=ve.replace(q,re),ue},getRegex:function(){return new RegExp(ve,le)}};return ue}var x=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(ve,le,ue){if(ve){var J;try{J=decodeURIComponent(o(ue)).replace(x,"").toLowerCase()}catch(q){return null}if(J.indexOf("javascript:")===0||J.indexOf("vbscript:")===0||J.indexOf("data:")===0)return null}le&&!T.test(ue)&&(ue=c(le,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch(q){return null}return ue}var S={},w=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,_=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(ve,le){S[" "+ve]||(w.test(ve)?S[" "+ve]=ve+"/":S[" "+ve]=k(ve,"/",!0)),ve=S[" "+ve];var ue=ve.indexOf(":")===-1;return le.substring(0,2)==="//"?ue?le:ve.replace(E,"$1")+le:le.charAt(0)==="/"?ue?le:ve.replace(_,"$1")+le:ve+le}var u={exec:function(){}};function g(ve){for(var le=1,ue,J;le<arguments.length;le++){ue=arguments[le];for(J in ue)Object.prototype.hasOwnProperty.call(ue,J)&&(ve[J]=ue[J])}return ve}function b(ve,le){var ue=ve.replace(/\|/g,function(re,oe,ge){for(var Re=!1,De=oe;--De>=0&&ge[De]==="\\";)Re=!Re;return Re?"|":" |"}),J=ue.split(/ \|/),q=0;if(J.length>le)J.splice(le);else for(;J.length<le;)J.push("");for(;q<J.length;q++)J[q]=J[q].trim().replace(/\\\|/g,"|");return J}function k(ve,le,ue){var J=ve.length;if(J===0)return"";for(var q=0;q<J;){var re=ve.charAt(J-q-1);if(re===le&&!ue)q++;else if(re!==le&&ue)q++;else break}return ve.substr(0,J-q)}function I(ve,le){if(ve.indexOf(le[1])===-1)return-1;for(var ue=ve.length,J=0,q=0;q<ue;q++)if(ve[q]==="\\")q++;else if(ve[q]===le[0])J++;else if(ve[q]===le[1]&&(J--,J<0))return q;return-1}function F(ve){ve&&ve.sanitize&&!ve.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var U={escape:l,unescape:o,edit:A,cleanUrl:O,resolveUrl:c,noopTest:u,merge:g,splitCells:b,rtrim:k,findClosingBracket:I,checkSanitizeDeprecation:F},C=W.defaults,y=U.rtrim,j=U.splitCells,K=U.escape,Q=U.findClosingBracket;function te(ve,le,ue){var J=le.href,q=le.title?K(le.title):null,re=ve[1].replace(/\\([\[\]])/g,"$1");return ve[0].charAt(0)!=="!"?{type:"link",raw:ue,href:J,title:q,text:re}:{type:"image",raw:ue,href:J,title:q,text:K(re)}}function _e(ve,le){var ue=ve.match(/^(\s+)(?:```)/);if(ue===null)return le;var J=ue[1];return le.split(`
`).map(function(q){var re=q.match(/^\s+/);if(re===null)return q;var oe=re[0];return oe.length>=J.length?q.slice(J.length):q}).join(`
`)}var de=function(){function ve(ue){this.options=ue||C}var le=ve.prototype;return le.space=function(J){var q=this.rules.block.newline.exec(J);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
`}},le.code=function(J,q){var re=this.rules.block.code.exec(J);if(re){var oe=q[q.length-1];if(oe&&oe.type==="paragraph")return{raw:re[0],text:re[0].trimRight()};var ge=re[0].replace(/^ {4}/gm,"");return{type:"code",raw:re[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:y(ge,`
`)}}},le.fences=function(J){var q=this.rules.block.fences.exec(J);if(q){var re=q[0],oe=_e(re,q[3]||"");return{type:"code",raw:re,lang:q[2]?q[2].trim():q[2],text:oe}}},le.heading=function(J){var q=this.rules.block.heading.exec(J);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},le.nptable=function(J){var q=this.rules.block.nptable.exec(J);if(q){var re={type:"table",header:j(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
`):[],raw:q[0]};if(re.header.length===re.align.length){var oe=re.align.length,ge;for(ge=0;ge<oe;ge++)/^ *-+: *$/.test(re.align[ge])?re.align[ge]="right":/^ *:-+: *$/.test(re.align[ge])?re.align[ge]="center":/^ *:-+ *$/.test(re.align[ge])?re.align[ge]="left":re.align[ge]=null;for(oe=re.cells.length,ge=0;ge<oe;ge++)re.cells[ge]=j(re.cells[ge],re.header.length);return re}}},le.hr=function(J){var q=this.rules.block.hr.exec(J);if(q)return{type:"hr",raw:q[0]}},le.blockquote=function(J){var q=this.rules.block.blockquote.exec(J);if(q){var re=q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:q[0],text:re}}},le.list=function(J){var q=this.rules.block.list.exec(J);if(q){for(var re=q[0],oe=q[2],ge=oe.length>1,Re=oe[oe.length-1]===")",De={type:"list",raw:re,ordered:ge,start:ge?+oe.slice(0,-1):"",loose:!1,items:[]},Je=q[0].match(this.rules.block.item),it=!1,rt,Ot,_t,ut,bt,Rt,nt,Kt=Je.length,St=0;St<Kt;St++)rt=Je[St],re=rt,Ot=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
`)&&(Ot-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+Ot+"}","gm"),"")),St!==Kt-1&&(_t=this.rules.block.bullet.exec(Je[St+1])[0],(ge?_t.length===1||!Re&&_t[_t.length-1]===")":_t.length>1||this.options.smartLists&&_t!==oe)&&(ut=Je.slice(St+1).join(`
`),De.raw=De.raw.substring(0,De.raw.length-ut.length),St=Kt-1)),bt=it||/\n\n(?!\s*$)/.test(rt),St!==Kt-1&&(it=rt.charAt(rt.length-1)===`
`,bt||(bt=it)),bt&&(De.loose=!0),Rt=/^\[[ xX]\] /.test(rt),nt=void 0,Rt&&(nt=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),De.items.push({type:"list_item",raw:re,task:Rt,checked:nt,loose:bt,text:rt});return De}},le.html=function(J){var q=this.rules.block.html.exec(J);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]):K(q[0]):q[0]}},le.def=function(J){var q=this.rules.block.def.exec(J);if(q){q[3]&&(q[3]=q[3].substring(1,q[3].length-1));var re=q[1].toLowerCase().replace(/\s+/g," ");return{tag:re,raw:q[0],href:q[2],title:q[3]}}},le.table=function(J){var q=this.rules.block.table.exec(J);if(q){var re={type:"table",header:j(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
`):[]};if(re.header.length===re.align.length){re.raw=q[0];var oe=re.align.length,ge;for(ge=0;ge<oe;ge++)/^ *-+: *$/.test(re.align[ge])?re.align[ge]="right":/^ *:-+: *$/.test(re.align[ge])?re.align[ge]="center":/^ *:-+ *$/.test(re.align[ge])?re.align[ge]="left":re.align[ge]=null;for(oe=re.cells.length,ge=0;ge<oe;ge++)re.cells[ge]=j(re.cells[ge].replace(/^ *\| *| *\| *$/g,""),re.header.length);return re}}},le.lheading=function(J){var q=this.rules.block.lheading.exec(J);if(q)return{type:"heading",raw:q[0],depth:q[2].charAt(0)==="="?1:2,text:q[1]}},le.paragraph=function(J){var q=this.rules.block.paragraph.exec(J);if(q)return{type:"paragraph",raw:q[0],text:q[1].charAt(q[1].length-1)===`
`?q[1].slice(0,-1):q[1]}},le.text=function(J,q){var re=this.rules.block.text.exec(J);if(re){var oe=q[q.length-1];return oe&&oe.type==="text"?{raw:re[0],text:re[0]}:{type:"text",raw:re[0],text:re[0]}}},le.escape=function(J){var q=this.rules.inline.escape.exec(J);if(q)return{type:"escape",raw:q[0],text:K(q[1])}},le.tag=function(J,q,re){var oe=this.rules.inline.tag.exec(J);if(oe)return!q&&/^<a /i.test(oe[0])?q=!0:q&&/^<\/a>/i.test(oe[0])&&(q=!1),!re&&/^<(pre|code|kbd|script)(\s|>)/i.test(oe[0])?re=!0:re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(oe[0])&&(re=!1),{type:this.options.sanitize?"text":"html",raw:oe[0],inLink:q,inRawBlock:re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):K(oe[0]):oe[0]}},le.link=function(J){var q=this.rules.inline.link.exec(J);if(q){var re=Q(q[2],"()");if(re>-1){var oe=q[0].indexOf("!")===0?5:4,ge=oe+q[1].length+re;q[2]=q[2].substring(0,re),q[0]=q[0].substring(0,ge).trim(),q[3]=""}var Re=q[2],De="";if(this.options.pedantic){var Je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Re);Je?(Re=Je[1],De=Je[3]):De=""}else De=q[3]?q[3].slice(1,-1):"";Re=Re.trim().replace(/^<([\s\S]*)>$/,"$1");var it=te(q,{href:Re&&Re.replace(this.rules.inline._escapes,"$1"),title:De&&De.replace(this.rules.inline._escapes,"$1")},q[0]);return it}},le.reflink=function(J,q){var re;if((re=this.rules.inline.reflink.exec(J))||(re=this.rules.inline.nolink.exec(J))){var oe=(re[2]||re[1]).replace(/\s+/g," ");if(oe=q[oe.toLowerCase()],!oe||!oe.href){var ge=re[0].charAt(0);return{type:"text",raw:ge,text:ge}}var Re=te(re,oe,re[0]);return Re}},le.strong=function(J,q,re){re===void 0&&(re="");var oe=this.rules.inline.strong.start.exec(J);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){q=q.slice(-1*J.length);var ge=oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var Re;(oe=ge.exec(q))!=null;)if(Re=this.rules.inline.strong.middle.exec(q.slice(0,oe.index+3)),Re)return{type:"strong",raw:J.slice(0,Re[0].length),text:J.slice(2,Re[0].length-2)}}},le.em=function(J,q,re){re===void 0&&(re="");var oe=this.rules.inline.em.start.exec(J);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){q=q.slice(-1*J.length);var ge=oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var Re;(oe=ge.exec(q))!=null;)if(Re=this.rules.inline.em.middle.exec(q.slice(0,oe.index+2)),Re)return{type:"em",raw:J.slice(0,Re[0].length),text:J.slice(1,Re[0].length-1)}}},le.codespan=function(J){var q=this.rules.inline.code.exec(J);if(q){var re=q[2].replace(/\n/g," "),oe=/[^ ]/.test(re),ge=re.startsWith(" ")&&re.endsWith(" ");return oe&&ge&&(re=re.substring(1,re.length-1)),re=K(re,!0),{type:"codespan",raw:q[0],text:re}}},le.br=function(J){var q=this.rules.inline.br.exec(J);if(q)return{type:"br",raw:q[0]}},le.del=function(J){var q=this.rules.inline.del.exec(J);if(q)return{type:"del",raw:q[0],text:q[1]}},le.autolink=function(J,q){var re=this.rules.inline.autolink.exec(J);if(re){var oe,ge;return re[2]==="@"?(oe=K(this.options.mangle?q(re[1]):re[1]),ge="mailto:"+oe):(oe=K(re[1]),ge=oe),{type:"link",raw:re[0],text:oe,href:ge,tokens:[{type:"text",raw:oe,text:oe}]}}},le.url=function(J,q){var re;if(re=this.rules.inline.url.exec(J)){var oe,ge;if(re[2]==="@")oe=K(this.options.mangle?q(re[0]):re[0]),ge="mailto:"+oe;else{var Re;do Re=re[0],re[0]=this.rules.inline._backpedal.exec(re[0])[0];while(Re!==re[0]);oe=K(re[0]),re[1]==="www."?ge="http://"+oe:ge=oe}return{type:"link",raw:re[0],text:oe,href:ge,tokens:[{type:"text",raw:oe,text:oe}]}}},le.inlineText=function(J,q,re){var oe=this.rules.inline.text.exec(J);if(oe){var ge;return q?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):K(oe[0]):oe[0]:ge=K(this.options.smartypants?re(oe[0]):oe[0]),{type:"text",raw:oe[0],text:ge}}},ve}(),me=U.noopTest,fe=U.edit,pe=U.merge,ae={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:me,table:me,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ae.def=fe(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex(),ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ae.item=fe(ae.item,"gm").replace(/bull/g,ae.bullet).getRegex(),ae.list=fe(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex(),ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ae._comment=/<!--(?!-?>)[\s\S]*?-->/,ae.html=fe(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae.paragraph=fe(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ae._tag).getRegex(),ae.blockquote=fe(ae.blockquote).replace("paragraph",ae.paragraph).getRegex(),ae.normal=pe({},ae),ae.gfm=pe({},ae.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ae.gfm.nptable=fe(ae.gfm.nptable).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ae._tag).getRegex(),ae.gfm.table=fe(ae.gfm.table).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ae._tag).getRegex(),ae.pedantic=pe({},ae.normal,{html:fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:me,paragraph:fe(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:me,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:me,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};he._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",he.punctuation=fe(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=fe(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=fe(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=fe(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=fe(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=fe(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=fe(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=fe(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=fe(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=fe(he._blockSkip,"g").getRegex(),he.overlapSkip=fe(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=fe(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=fe(he.tag).replace("comment",ae._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=fe(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=fe(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=fe(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=pe({},he),he.pedantic=pe({},he.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:fe(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=pe({},he.normal,{escape:fe(he.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),he.gfm.url=fe(he.gfm.url,"i").replace("email",he.gfm._extended_email).getRegex(),he.breaks=pe({},he.gfm,{br:fe(he.br).replace("{2,}","*").getRegex(),text:fe(he.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var $={block:ae,inline:he},ie=W.defaults,ee=$.block,Ee=$.inline;function we(ve){return ve.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 ye(ve){var le="",ue,J,q=ve.length;for(ue=0;ue<q;ue++)J=ve.charCodeAt(ue),Math.random()>.5&&(J="x"+J.toString(16)),le+="&#"+J+";";return le}var xe=function(){function ve(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||ie,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var J={block:ee.normal,inline:Ee.normal};this.options.pedantic?(J.block=ee.pedantic,J.inline=Ee.pedantic):this.options.gfm&&(J.block=ee.gfm,this.options.breaks?J.inline=Ee.breaks:J.inline=Ee.gfm),this.tokenizer.rules=J}ve.lex=function(J,q){var re=new ve(q);return re.lex(J)};var le=ve.prototype;return le.lex=function(J){return J=J.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(J,this.tokens,!0),this.inline(this.tokens),this.tokens},le.blockTokens=function(J,q,re){q===void 0&&(q=[]),re===void 0&&(re=!0),J=J.replace(/^ +$/gm,"");for(var oe,ge,Re,De;J;){if(oe=this.tokenizer.space(J)){J=J.substring(oe.raw.length),oe.type&&q.push(oe);continue}if(oe=this.tokenizer.code(J,q)){J=J.substring(oe.raw.length),oe.type?q.push(oe):(De=q[q.length-1],De.raw+=`
`+oe.raw,De.text+=`
`+oe.text);continue}if(oe=this.tokenizer.fences(J)){J=J.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.heading(J)){J=J.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.nptable(J)){J=J.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.hr(J)){J=J.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.blockquote(J)){J=J.substring(oe.raw.length),oe.tokens=this.blockTokens(oe.text,[],re),q.push(oe);continue}if(oe=this.tokenizer.list(J)){for(J=J.substring(oe.raw.length),Re=oe.items.length,ge=0;ge<Re;ge++)oe.items[ge].tokens=this.blockTokens(oe.items[ge].text,[],!1);q.push(oe);continue}if(oe=this.tokenizer.html(J)){J=J.substring(oe.raw.length),q.push(oe);continue}if(re&&(oe=this.tokenizer.def(J))){J=J.substring(oe.raw.length),this.tokens.links[oe.tag]||(this.tokens.links[oe.tag]={href:oe.href,title:oe.title});continue}if(oe=this.tokenizer.table(J)){J=J.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.lheading(J)){J=J.substring(oe.raw.length),q.push(oe);continue}if(re&&(oe=this.tokenizer.paragraph(J))){J=J.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.text(J,q)){J=J.substring(oe.raw.length),oe.type?q.push(oe):(De=q[q.length-1],De.raw+=`
`+oe.raw,De.text+=`
`+oe.text);continue}if(J){var Je="Infinite loop on byte: "+J.charCodeAt(0);if(this.options.silent){console.error(Je);break}else throw new Error(Je)}}return q},le.inline=function(J){var q,re,oe,ge,Re,De,Je=J.length;for(q=0;q<Je;q++){De=J[q];switch(De.type){case"paragraph":case"text":case"heading":{De.tokens=[],this.inlineTokens(De.text,De.tokens);break}case"table":{for(De.tokens={header:[],cells:[]},ge=De.header.length,re=0;re<ge;re++)De.tokens.header[re]=[],this.inlineTokens(De.header[re],De.tokens.header[re]);for(ge=De.cells.length,re=0;re<ge;re++)for(Re=De.cells[re],De.tokens.cells[re]=[],oe=0;oe<Re.length;oe++)De.tokens.cells[re][oe]=[],this.inlineTokens(Re[oe],De.tokens.cells[re][oe]);break}case"blockquote":{this.inline(De.tokens);break}case"list":{for(ge=De.items.length,re=0;re<ge;re++)this.inline(De.items[re].tokens);break}}}return J},le.inlineTokens=function(J,q,re,oe,ge){q===void 0&&(q=[]),re===void 0&&(re=!1),oe===void 0&&(oe=!1),ge===void 0&&(ge="");var Re,De=J,Je;if(this.tokens.links){var it=Object.keys(this.tokens.links);if(it.length>0)for(;(Je=this.tokenizer.rules.inline.reflinkSearch.exec(De))!=null;)it.includes(Je[0].slice(Je[0].lastIndexOf("[")+1,-1))&&(De=De.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Je=this.tokenizer.rules.inline.blockSkip.exec(De))!=null;)De=De.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;J;){if(Re=this.tokenizer.escape(J)){J=J.substring(Re.raw.length),q.push(Re);continue}if(Re=this.tokenizer.tag(J,re,oe)){J=J.substring(Re.raw.length),re=Re.inLink,oe=Re.inRawBlock,q.push(Re);continue}if(Re=this.tokenizer.link(J)){J=J.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,oe)),q.push(Re);continue}if(Re=this.tokenizer.reflink(J,this.tokens.links)){J=J.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,oe)),q.push(Re);continue}if(Re=this.tokenizer.strong(J,De,ge)){J=J.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],re,oe),q.push(Re);continue}if(Re=this.tokenizer.em(J,De,ge)){J=J.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],re,oe),q.push(Re);continue}if(Re=this.tokenizer.codespan(J)){J=J.substring(Re.raw.length),q.push(Re);continue}if(Re=this.tokenizer.br(J)){J=J.substring(Re.raw.length),q.push(Re);continue}if(Re=this.tokenizer.del(J)){J=J.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],re,oe),q.push(Re);continue}if(Re=this.tokenizer.autolink(J,ye)){J=J.substring(Re.raw.length),q.push(Re);continue}if(!re&&(Re=this.tokenizer.url(J,ye))){J=J.substring(Re.raw.length),q.push(Re);continue}if(Re=this.tokenizer.inlineText(J,oe,we)){J=J.substring(Re.raw.length),ge=Re.raw.slice(-1),q.push(Re);continue}if(J){var rt="Infinite loop on byte: "+J.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return q},V(ve,null,[{key:"rules",get:function(){return{block:ee,inline:Ee}}}]),ve}(),Le=W.defaults,ke=U.cleanUrl,Pe=U.escape,Ae=function(){function ve(ue){this.options=ue||Le}var le=ve.prototype;return le.code=function(J,q,re){var oe=(q||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(J,oe);ge!=null&&ge!==J&&(re=!0,J=ge)}return oe?'<pre><code class="'+this.options.langPrefix+Pe(oe,!0)+'">'+(re?J:Pe(J,!0))+`</code></pre>
`:"<pre><code>"+(re?J:Pe(J,!0))+`</code></pre>
`},le.blockquote=function(J){return`<blockquote>
`+J+`</blockquote>
`},le.html=function(J){return J},le.heading=function(J,q,re,oe){return this.options.headerIds?"<h"+q+' id="'+this.options.headerPrefix+oe.slug(re)+'">'+J+"</h"+q+`>
`:"<h"+q+">"+J+"</h"+q+`>
`},le.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},le.list=function(J,q,re){var oe=q?"ol":"ul",ge=q&&re!==1?' start="'+re+'"':"";return"<"+oe+ge+`>
`+J+"</"+oe+`>
`},le.listitem=function(J){return"<li>"+J+`</li>
`},le.checkbox=function(J){return"<input "+(J?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},le.paragraph=function(J){return"<p>"+J+`</p>
`},le.table=function(J,q){return q&&(q="<tbody>"+q+"</tbody>"),`<table>
<thead>
`+J+`</thead>
`+q+`</table>
`},le.tablerow=function(J){return`<tr>
`+J+`</tr>
`},le.tablecell=function(J,q){var re=q.header?"th":"td",oe=q.align?"<"+re+' align="'+q.align+'">':"<"+re+">";return oe+J+"</"+re+`>
`},le.strong=function(J){return"<strong>"+J+"</strong>"},le.em=function(J){return"<em>"+J+"</em>"},le.codespan=function(J){return"<code>"+J+"</code>"},le.br=function(){return this.options.xhtml?"<br/>":"<br>"},le.del=function(J){return"<del>"+J+"</del>"},le.link=function(J,q,re){if(J=ke(this.options.sanitize,this.options.baseUrl,J),J===null)return re;var oe='<a href="'+Pe(J)+'"';return q&&(oe+=' title="'+q+'"'),oe+=">"+re+"</a>",oe},le.image=function(J,q,re){if(J=ke(this.options.sanitize,this.options.baseUrl,J),J===null)return re;var oe='<img src="'+J+'" alt="'+re+'"';return q&&(oe+=' title="'+q+'"'),oe+=this.options.xhtml?"/>":">",oe},le.text=function(J){return J},ve}(),Oe=function(){function ve(){}var le=ve.prototype;return le.strong=function(J){return J},le.em=function(J){return J},le.codespan=function(J){return J},le.del=function(J){return J},le.html=function(J){return J},le.text=function(J){return J},le.link=function(J,q,re){return""+re},le.image=function(J,q,re){return""+re},le.br=function(){return""},ve}(),Be=function(){function ve(){this.seen={}}var le=ve.prototype;return le.slug=function(J){var q=J.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(q)){var re=q;do this.seen[re]++,q=re+"-"+this.seen[re];while(this.seen.hasOwnProperty(q))}return this.seen[q]=0,q},ve}(),Ve=W.defaults,ze=U.unescape,je=function(){function ve(ue){this.options=ue||Ve,this.options.renderer=this.options.renderer||new Ae,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Oe,this.slugger=new Be}ve.parse=function(J,q){var re=new ve(q);return re.parse(J)};var le=ve.prototype;return le.parse=function(J,q){q===void 0&&(q=!0);var re="",oe,ge,Re,De,Je,it,rt,Ot,_t,ut,bt,Rt,nt,Kt,St,an,Ue,st,ct=J.length;for(oe=0;oe<ct;oe++){ut=J[oe];switch(ut.type){case"space":continue;case"hr":{re+=this.renderer.hr();continue}case"heading":{re+=this.renderer.heading(this.parseInline(ut.tokens),ut.depth,ze(this.parseInline(ut.tokens,this.textRenderer)),this.slugger);continue}case"code":{re+=this.renderer.code(ut.text,ut.lang,ut.escaped);continue}case"table":{for(Ot="",rt="",De=ut.header.length,ge=0;ge<De;ge++)rt+=this.renderer.tablecell(this.parseInline(ut.tokens.header[ge]),{header:!0,align:ut.align[ge]});for(Ot+=this.renderer.tablerow(rt),_t="",De=ut.cells.length,ge=0;ge<De;ge++){for(it=ut.tokens.cells[ge],rt="",Je=it.length,Re=0;Re<Je;Re++)rt+=this.renderer.tablecell(this.parseInline(it[Re]),{header:!1,align:ut.align[Re]});_t+=this.renderer.tablerow(rt)}re+=this.renderer.table(Ot,_t);continue}case"blockquote":{_t=this.parse(ut.tokens),re+=this.renderer.blockquote(_t);continue}case"list":{for(bt=ut.ordered,Rt=ut.start,nt=ut.loose,De=ut.items.length,_t="",ge=0;ge<De;ge++)St=ut.items[ge],an=St.checked,Ue=St.task,Kt="",St.task&&(st=this.renderer.checkbox(an),nt?St.tokens.length>0&&St.tokens[0].type==="text"?(St.tokens[0].text=st+" "+St.tokens[0].text,St.tokens[0].tokens&&St.tokens[0].tokens.length>0&&St.tokens[0].tokens[0].type==="text"&&(St.tokens[0].tokens[0].text=st+" "+St.tokens[0].tokens[0].text)):St.tokens.unshift({type:"text",text:st}):Kt+=st),Kt+=this.parse(St.tokens,nt),_t+=this.renderer.listitem(Kt,Ue,an);re+=this.renderer.list(_t,bt,Rt);continue}case"html":{re+=this.renderer.html(ut.text);continue}case"paragraph":{re+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(_t=ut.tokens?this.parseInline(ut.tokens):ut.text;oe+1<ct&&J[oe+1].type==="text";)ut=J[++oe],_t+=`
`+(ut.tokens?this.parseInline(ut.tokens):ut.text);re+=q?this.renderer.paragraph(_t):_t;continue}default:{var Lt='Token with "'+ut.type+'" type was not found.';if(this.options.silent){console.error(Lt);return}else throw new Error(Lt)}}}return re},le.parseInline=function(J,q){q=q||this.renderer;var re="",oe,ge,Re=J.length;for(oe=0;oe<Re;oe++){ge=J[oe];switch(ge.type){case"escape":{re+=q.text(ge.text);break}case"html":{re+=q.html(ge.text);break}case"link":{re+=q.link(ge.href,ge.title,this.parseInline(ge.tokens,q));break}case"image":{re+=q.image(ge.href,ge.title,ge.text);break}case"strong":{re+=q.strong(this.parseInline(ge.tokens,q));break}case"em":{re+=q.em(this.parseInline(ge.tokens,q));break}case"codespan":{re+=q.codespan(ge.text);break}case"br":{re+=q.br();break}case"del":{re+=q.del(this.parseInline(ge.tokens,q));break}case"text":{re+=q.text(ge.text);break}default:{var De='Token with "'+ge.type+'" type was not found.';if(this.options.silent){console.error(De);return}else throw new Error(De)}}}return re},ve}(),et=U.merge,Xe=U.checkSanitizeDeprecation,$e=U.escape,Ce=W.getDefaults,qe=W.changeDefaults,Ke=W.defaults;function Se(ve,le,ue){if(typeof ve=="undefined"||ve===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ve!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ve)+", string expected");if(typeof le=="function"&&(ue=le,le=null),le=et({},Se.defaults,le||{}),Xe(le),ue){var J=le.highlight,q;try{q=xe.lex(ve,le)}catch(Re){return ue(Re)}var re=function(De){var Je;if(!De)try{Je=je.parse(q,le)}catch(it){De=it}return le.highlight=J,De?ue(De):ue(null,Je)};if(!J||J.length<3)return re();if(delete le.highlight,!q.length)return re();var oe=0;Se.walkTokens(q,function(Re){Re.type==="code"&&(oe++,setTimeout(function(){J(Re.text,Re.lang,function(De,Je){if(De)return re(De);Je!=null&&Je!==Re.text&&(Re.text=Je,Re.escaped=!0),oe--,oe===0&&re()})},0))}),oe===0&&re();return}try{var ge=xe.lex(ve,le);return le.walkTokens&&Se.walkTokens(ge,le.walkTokens),je.parse(ge,le)}catch(Re){if(Re.message+=`
Please report this to https://github.com/markedjs/marked.`,le.silent)return"<p>An error occurred:</p><pre>"+$e(Re.message+"",!0)+"</pre>";throw Re}}Se.options=Se.setOptions=function(ve){return et(Se.defaults,ve),qe(Se.defaults),Se},Se.getDefaults=Ce,Se.defaults=Ke,Se.use=function(ve){var le=et({},ve);if(ve.renderer&&function(){var J=Se.defaults.renderer||new Ae,q=function(ge){var Re=J[ge];J[ge]=function(){for(var De=arguments.length,Je=new Array(De),it=0;it<De;it++)Je[it]=arguments[it];var rt=ve.renderer[ge].apply(J,Je);return rt===!1&&(rt=Re.apply(J,Je)),rt}};for(var re in ve.renderer)q(re);le.renderer=J}(),ve.tokenizer&&function(){var J=Se.defaults.tokenizer||new de,q=function(ge){var Re=J[ge];J[ge]=function(){for(var De=arguments.length,Je=new Array(De),it=0;it<De;it++)Je[it]=arguments[it];var rt=ve.tokenizer[ge].apply(J,Je);return rt===!1&&(rt=Re.apply(J,Je)),rt}};for(var re in ve.tokenizer)q(re);le.tokenizer=J}(),ve.walkTokens){var ue=Se.defaults.walkTokens;le.walkTokens=function(J){ve.walkTokens(J),ue&&ue(J)}}Se.setOptions(le)},Se.walkTokens=function(ve,le){for(var ue=N(ve),J;!(J=ue()).done;){var q=J.value;le(q);switch(q.type){case"table":{for(var re=N(q.tokens.header),oe;!(oe=re()).done;){var ge=oe.value;Se.walkTokens(ge,le)}for(var Re=N(q.tokens.cells),De;!(De=Re()).done;)for(var Je=De.value,it=N(Je),rt;!(rt=it()).done;){var Ot=rt.value;Se.walkTokens(Ot,le)}break}case"list":{Se.walkTokens(q.items,le);break}default:q.tokens&&Se.walkTokens(q.tokens,le)}}},Se.Parser=je,Se.parser=je.parse,Se.Renderer=Ae,Se.TextRenderer=Oe,Se.Lexer=xe,Se.lexer=xe.lex,Se.Tokenizer=de,Se.Slugger=Be,Se.parse=Se;var Me=Se;return Me})},ELLl:function(ot,We,Z){(function(ne){ne(Z("VrN/"))})(function(ne){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(s,h,l){l&&l!=ne.Init&&(s.removeKeyMap(N),s.state.closeBrackets=null),h&&(M(G(h,"pairs")),s.state.closeBrackets=h,s.addKeyMap(N))});function G(s,h){return h=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[h]!=null?s[h]:V[h]}var N={Backspace:P,Enter:R};function M(s){for(var h=0;h<s.length;h++){var l=s.charAt(h),i="'"+l+"'";N[i]||(N[i]=W(l))}}M(V.pairs+"`");function W(s){return function(h){return m(h,s)}}function B(s){var h=s.state.closeBrackets;if(!h||h.override)return h;var l=s.getModeAt(s.getCursor());return l.closeBrackets||h}function P(s){var h=B(s);if(!h||s.getOption("disableInput"))return ne.Pass;for(var l=G(h,"pairs"),i=s.listSelections(),o=0;o<i.length;o++){if(!i[o].empty())return ne.Pass;var f=p(s,i[o].head);if(!f||l.indexOf(f)%2!=0)return ne.Pass}for(var o=i.length-1;o>=0;o--){var A=i[o].head;s.replaceRange("",D(A.line,A.ch-1),D(A.line,A.ch+1),"+delete")}}function R(s){var h=B(s),l=h&&G(h,"explode");if(!l||s.getOption("disableInput"))return ne.Pass;for(var i=s.listSelections(),o=0;o<i.length;o++){if(!i[o].empty())return ne.Pass;var f=p(s,i[o].head);if(!f||l.indexOf(f)%2!=0)return ne.Pass}s.operation(function(){var A=s.lineSeparator()||`
`;s.replaceSelection(A+A,null),s.execCommand("goCharLeft"),i=s.listSelections();for(var x=0;x<i.length;x++){var T=i[x].head.line;s.indentLine(T,null,!0),s.indentLine(T+1,null,!0)}})}function v(s){var h=ne.cmpPos(s.anchor,s.head)>0;return{anchor:new D(s.anchor.line,s.anchor.ch+(h?-1:1)),head:new D(s.head.line,s.head.ch+(h?1:-1))}}function m(s,h){var l=B(s);if(!l||s.getOption("disableInput"))return ne.Pass;var i=G(l,"pairs"),o=i.indexOf(h);if(o==-1)return ne.Pass;for(var f=G(l,"closeBefore"),A=G(l,"triples"),x=i.charAt(o+1)==h,T=s.listSelections(),O=o%2==0,S,w=0;w<T.length;w++){var E=T[w],_=E.head,c,u=s.getRange(_,D(_.line,_.ch+1));if(O&&!E.empty())c="surround";else if((x||!O)&&u==h)x&&d(s,_)?c="both":A.indexOf(h)>=0&&s.getRange(_,D(_.line,_.ch+3))==h+h+h?c="skipThree":c="skip";else if(x&&_.ch>1&&A.indexOf(h)>=0&&s.getRange(D(_.line,_.ch-2),_)==h+h){if(_.ch>2&&/\bstring/.test(s.getTokenTypeAt(D(_.line,_.ch-2))))return ne.Pass;c="addFour"}else if(x){var g=_.ch==0?" ":s.getRange(D(_.line,_.ch-1),_);if(!ne.isWordChar(u)&&g!=h&&!ne.isWordChar(g))c="both";else return ne.Pass}else if(O&&(u.length===0||/\s/.test(u)||f.indexOf(u)>-1))c="both";else return ne.Pass;if(!S)S=c;else if(S!=c)return ne.Pass}var b=o%2?i.charAt(o-1):h,k=o%2?h:i.charAt(o+1);s.operation(function(){if(S=="skip")s.execCommand("goCharRight");else if(S=="skipThree")for(var I=0;I<3;I++)s.execCommand("goCharRight");else if(S=="surround"){for(var F=s.getSelections(),I=0;I<F.length;I++)F[I]=b+F[I]+k;s.replaceSelections(F,"around"),F=s.listSelections().slice();for(var I=0;I<F.length;I++)F[I]=v(F[I]);s.setSelections(F)}else S=="both"?(s.replaceSelection(b+k,null),s.triggerElectric(b+k),s.execCommand("goCharLeft")):S=="addFour"&&(s.replaceSelection(b+b+b+b,"before"),s.execCommand("goCharRight"))})}function p(s,h){var l=s.getRange(D(h.line,h.ch-1),D(h.line,h.ch+1));return l.length==2?l:null}function d(s,h){var l=s.getTokenAt(D(h.line,h.ch+1));return/\bstring/.test(l.type)&&l.start==h.ch&&(h.ch==0||!/\bstring/.test(s.getTokenTypeAt(h)))}})},GfqC:function(ot,We,Z){"use strict";var ne=Z("cDcd"),V=Z.n(ne),D=Z("TSYQ"),G=Z.n(D);function N(U,C){var y="cannot "+U.method+" "+U.action+" "+C.status+"'",j=new Error(y);return j.status=C.status,j.method=U.method,j.url=U.action,j}function M(U){var C=U.responseText||U.response;if(!C)return C;try{return JSON.parse(C)}catch(y){return C}}function W(U){var C=new XMLHttpRequest;U.onProgress&&C.upload&&(C.upload.onprogress=function(Q){Q.total>0&&(Q.percent=Q.loaded/Q.total*100),U.onProgress(Q)});var y=new FormData;U.data&&Object.keys(U.data).forEach(function(K){var Q=U.data[K];if(Array.isArray(Q)){Q.forEach(function(te){y.append(K+"[]",te)});return}y.append(K,U.data[K])}),U.file instanceof Blob?y.append(U.filename,U.file,U.file.name):y.append(U.filename,U.file),C.onerror=function(Q){U.onError(Q)},C.onload=function(){return C.status<200||C.status>=300?U.onError(N(U,C),M(C)):U.onSuccess(M(C),C)},C.open(U.method,U.action,!0),U.withCredentials&&"withCredentials"in C&&(C.withCredentials=!0);var j=U.headers||{};return j["X-Requested-With"]!==null&&C.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(j).forEach(function(K){j[K]!==null&&C.setRequestHeader(K,j[K])}),C.send(y),{abort:function(){C.abort()}}}var B=+new Date,P=0;function R(){return"rc-upload-"+B+"-"+ ++P}function v(U,C){return U.indexOf(C,U.length-C.length)!==-1}var m=function(U,C){if(U&&C){var y=Array.isArray(C)?C:C.split(","),j=U.name||"",K=U.type||"",Q=K.replace(/\/.*$/,"");return y.some(function(te){var _e=te.trim();return _e.charAt(0)==="."?v(j.toLowerCase(),_e.toLowerCase()):/\/\*$/.test(_e)?Q===_e.replace(/\/.*$/,""):K===_e})}return!0};function p(U,C){var y=U.createReader(),j=[];function K(){y.readEntries(function(Q){var te=Array.prototype.slice.apply(Q);j=j.concat(te);var _e=!te.length;_e?C(j):K()})}K()}var d=function(C,y,j){var K=function Q(te,_e){_e=_e||"",te.isFile?te.file(function(de){j(de)&&(te.fullPath&&!de.webkitRelativePath&&(Object.defineProperties(de,{webkitRelativePath:{writable:!0}}),de.webkitRelativePath=te.fullPath.replace(/^\//,""),Object.defineProperties(de,{webkitRelativePath:{writable:!1}})),y([de]))}):te.isDirectory&&p(te,function(de){de.forEach(function(me){Q(me,""+_e+te.name+"/")})})};C.forEach(function(Q){K(Q.webkitGetAsEntry())})},s=d,h=Object.assign||function(U){for(var C=1;C<arguments.length;C++){var y=arguments[C];for(var j in y)Object.prototype.hasOwnProperty.call(y,j)&&(U[j]=y[j])}return U},l=function(){function U(C,y){var j=[],K=!0,Q=!1,te=void 0;try{for(var _e=C[Symbol.iterator](),de;!(K=(de=_e.next()).done)&&!(j.push(de.value),y&&j.length===y);K=!0);}catch(me){Q=!0,te=me}finally{try{!K&&_e.return&&_e.return()}finally{if(Q)throw te}}return j}return function(C,y){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return U(C,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function U(C,y){for(var j=0;j<y.length;j++){var K=y[j];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(C,K.key,K)}}return function(C,y,j){return y&&U(C.prototype,y),j&&U(C,j),C}}();function o(U,C,y){return C in U?Object.defineProperty(U,C,{value:y,enumerable:!0,configurable:!0,writable:!0}):U[C]=y,U}function f(U,C){var y={};for(var j in U){if(C.indexOf(j)>=0)continue;if(!Object.prototype.hasOwnProperty.call(U,j))continue;y[j]=U[j]}return y}function A(U,C){if(!(U instanceof C))throw new TypeError("Cannot call a class as a function")}function x(U,C){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:U}function T(U,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);U.prototype=Object.create(C&&C.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(U,C):U.__proto__=C)}var O=function(C){return Object.keys(C).reduce(function(y,j){return(j.substr(0,5)==="data-"||j.substr(0,5)==="aria-"||j==="role")&&(y[j]=C[j]),y},{})},S=function(U){T(C,U);function C(){var y,j,K,Q;A(this,C);for(var te=arguments.length,_e=Array(te),de=0;de<te;de++)_e[de]=arguments[de];return Q=(j=(K=x(this,(y=C.__proto__||Object.getPrototypeOf(C)).call.apply(y,[this].concat(_e))),K),K.state={uid:R()},K.reqs={},K.onChange=function(me){var fe=me.target.files;K.uploadFiles(fe),K.reset()},K.onClick=function(me){var fe=K.fileInput;if(!fe)return;var pe=K.props,ae=pe.children,he=pe.onClick;ae&&ae.type==="button"&&(fe.parentNode.focus(),fe.parentNode.querySelector("button").blur()),fe.click(),he&&he(me)},K.onKeyDown=function(me){me.key==="Enter"&&K.onClick()},K.onFileDrop=function(me){var fe=K.props.multiple;if(me.preventDefault(),me.type==="dragover")return;if(K.props.directory)s(Array.prototype.slice.call(me.dataTransfer.items),K.uploadFiles,function(ae){return m(ae,K.props.accept)});else{var pe=Array.prototype.slice.call(me.dataTransfer.files).filter(function(ae){return m(ae,K.props.accept)});fe===!1&&(pe=pe.slice(0,1)),K.uploadFiles(pe)}},K.uploadFiles=function(me){var fe=Array.prototype.slice.call(me);fe.map(function(pe){return pe.uid=R(),pe}).forEach(function(pe){K.upload(pe,fe)})},K.saveFileInput=function(me){K.fileInput=me},j),x(K,Q)}return i(C,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(j,K){var Q=this,te=this.props;if(!te.beforeUpload)return setTimeout(function(){return Q.post(j)},0);var _e=te.beforeUpload(j,K);_e&&_e.then?_e.then(function(de){var me=Object.prototype.toString.call(de);return me==="[object File]"||me==="[object Blob]"?Q.post(de):Q.post(j)}).catch(function(de){console.log(de)}):_e!==!1&&setTimeout(function(){return Q.post(j)},0);return}},{key:"post",value:function(j){var K=this;if(!this._isMounted)return;var Q=this.props,te=Q.onStart,_e=Q.onProgress,de=Q.transformFile,me=de===void 0?function(fe){return fe}:de;new Promise(function(fe){var pe=Q.action;return typeof pe=="function"&&(pe=pe(j)),fe(pe)}).then(function(fe){var pe=j.uid,ae=Q.customRequest||W,he=Promise.resolve(me(j)).then(function($){var ie=Q.data;return typeof ie=="function"&&(ie=ie($)),Promise.all([$,ie])}).catch(function($){console.error($)});he.then(function($){var ie=l($,2),ee=ie[0],Ee=ie[1],we={action:fe,filename:Q.name,data:Ee,file:ee,headers:Q.headers,withCredentials:Q.withCredentials,method:Q.method||"post",onProgress:_e?function(ye){_e(ye,j)}:null,onSuccess:function(xe,Le){delete K.reqs[pe],Q.onSuccess(xe,j,Le)},onError:function(xe,Le){delete K.reqs[pe],Q.onError(xe,Le,j)}};te(j),K.reqs[pe]=ae(we)})})}},{key:"reset",value:function(){this.setState({uid:R()})}},{key:"abort",value:function(j){var K=this.reqs;if(j){var Q=j;j&&j.uid&&(Q=j.uid),K[Q]&&K[Q].abort&&K[Q].abort(),delete K[Q]}else Object.keys(K).forEach(function(te){K[te]&&K[te].abort&&K[te].abort(),delete K[te]})}},{key:"render",value:function(){var j,K=this.props,Q=K.component,te=K.prefixCls,_e=K.className,de=K.disabled,me=K.id,fe=K.style,pe=K.multiple,ae=K.accept,he=K.children,$=K.directory,ie=K.openFileDialogOnClick,ee=K.onMouseEnter,Ee=K.onMouseLeave,we=f(K,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ye=G()((j={},o(j,te,!0),o(j,te+"-disabled",de),o(j,_e,_e),j)),xe=de?{}:{onClick:ie?this.onClick:function(){},onKeyDown:ie?this.onKeyDown:function(){},onMouseEnter:ee,onMouseLeave:Ee,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return V.a.createElement(Q,h({},xe,{className:ye,role:"button",style:fe}),V.a.createElement("input",h({},O(we),{id:me,type:"file",ref:this.saveFileInput,onClick:function(ke){return ke.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ae,directory:$?"directory":null,webkitdirectory:$?"webkitdirectory":null,multiple:pe,onChange:this.onChange})),he)}}]),C}(ne.Component),w=S,E=Object.assign||function(U){for(var C=1;C<arguments.length;C++){var y=arguments[C];for(var j in y)Object.prototype.hasOwnProperty.call(y,j)&&(U[j]=y[j])}return U},_=function(){function U(C,y){for(var j=0;j<y.length;j++){var K=y[j];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(C,K.key,K)}}return function(C,y,j){return y&&U(C.prototype,y),j&&U(C,j),C}}();function c(U,C){if(!(U instanceof C))throw new TypeError("Cannot call a class as a function")}function u(U,C){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:U}function g(U,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);U.prototype=Object.create(C&&C.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(U,C):U.__proto__=C)}function b(){}var k=function(U){g(C,U);function C(){var y,j,K,Q;c(this,C);for(var te=arguments.length,_e=Array(te),de=0;de<te;de++)_e[de]=arguments[de];return Q=(j=(K=u(this,(y=C.__proto__||Object.getPrototypeOf(C)).call.apply(y,[this].concat(_e))),K),K.saveUploader=function(me){K.uploader=me},j),u(K,Q)}return _(C,[{key:"abort",value:function(j){this.uploader.abort(j)}},{key:"render",value:function(){return V.a.createElement(w,E({},this.props,{ref:this.saveUploader}))}}]),C}(ne.Component);k.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:b,onError:b,onSuccess:b,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var I=k,F=We.a=I},HmJG:function(ot,We,Z){},LdHM:function(ot,We,Z){"use strict";Z.d(We,"b",function(){return f}),Z.d(We,"a",function(){return x});var ne=Z("1OyB"),V=Z("vuIU"),D=Z("Ji7U"),G=Z("LK+K"),N=Z("cDcd"),M=Z("rePB"),W=Z("Ff2n"),B=Z("ODXe"),P=Z("4IlW"),R=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),d=Z("+nKL"),s=Z("8OUc"),h=function(j,K){var Q=j.prefixCls,te=j.id,_e=j.flattenOptions,de=j.childrenAsData,me=j.values,fe=j.searchValue,pe=j.multiple,ae=j.defaultActiveFirstOption,he=j.height,$=j.itemHeight,ie=j.notFoundContent,ee=j.open,Ee=j.menuItemSelectedIcon,we=j.virtual,ye=j.onSelect,xe=j.onToggleOpen,Le=j.onActiveValue,ke=j.onScroll,Pe=j.onMouseEnter,Ae="".concat(Q,"-item"),Oe=Object(v.a)(function(){return _e},[ee,_e],function(Me,ve){return ve[0]&&Me[1]!==ve[1]}),Be=N.useRef(null),Ve=function(ve){ve.preventDefault()},ze=function(ve){Be.current&&Be.current.scrollTo({index:ve})},je=function(ve){for(var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ue=Oe.length,J=0;J<ue;J+=1){var q=(ve+J*le+ue)%ue,re=Oe[q],oe=re.group,ge=re.data;if(!oe&&!ge.disabled)return q}return-1},et=N.useState(function(){return je(0)}),Xe=Object(B.a)(et,2),$e=Xe[0],Ce=Xe[1],qe=function(ve){Ce(ve);var le=Oe[ve];if(!le){Le(null,-1);return}Le(le.data.value,ve)};N.useEffect(function(){qe(ae!==!1?je(0):-1)},[Oe.length,fe]),N.useEffect(function(){var Me=setTimeout(function(){if(!pe&&ee&&me.size===1){var ve=Array.from(me)[0],le=Oe.findIndex(function(ue){var J=ue.data;return J.value===ve});qe(le),ze(le)}});return function(){return clearTimeout(Me)}},[ee]);var Ke=function(ve){ve!==void 0&&ye(ve,{selected:!me.has(ve)}),pe||xe(!1)};if(N.useImperativeHandle(K,function(){return{onKeyDown:function(ve){var le=ve.which;switch(le){case P.a.UP:case P.a.DOWN:{var ue=0;if(le===P.a.UP?ue=-1:le===P.a.DOWN&&(ue=1),ue!==0){var J=je($e+ue,ue);ze(J),qe(J)}break}case P.a.ENTER:{var q=Oe[$e];q&&!q.data.disabled?Ke(q.data.value):Ke(void 0),ee&&ve.preventDefault();break}case P.a.ESC:xe(!1)}},onKeyUp:function(){},scrollTo:function(ve){ze(ve)}}}),Oe.length===0)return N.createElement("div",{role:"listbox",id:"".concat(te,"_list"),className:"".concat(Ae,"-empty"),onMouseDown:Ve},ie);function Se(Me){var ve=Oe[Me];if(!ve)return null;var le=ve.data||{},ue=le.value,J=le.label,q=le.children,re=Object(R.a)(le,!0),oe=de?q:J;return ve?N.createElement("div",Object.assign({"aria-label":typeof oe=="string"?oe:null},re,{key:Me,role:"option",id:"".concat(te,"_list_").concat(Me),"aria-selected":me.has(ue)}),ue):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(te,"_list"),style:{height:0,width:0,overflow:"hidden"}},Se($e-1),Se($e),Se($e+1)),N.createElement(d.a,{itemKey:"key",ref:Be,data:Oe,height:he,itemHeight:$,fullHeight:!1,onMouseDown:Ve,onScroll:ke,virtual:we,onMouseEnter:Pe},function(Me,ve){var le,ue=Me.group,J=Me.groupOption,q=Me.data,re=q.label,oe=q.key;if(ue)return N.createElement("div",{className:p()(Ae,"".concat(Ae,"-group"))},re!==void 0?re:oe);var ge=q.disabled,Re=q.value,De=q.title,Je=q.children,it=q.style,rt=q.className,Ot=Object(W.a)(q,["disabled","value","title","children","style","className"]),_t=me.has(Re),ut="".concat(Ae,"-option"),bt=p()(Ae,ut,rt,(le={},Object(M.a)(le,"".concat(ut,"-grouped"),J),Object(M.a)(le,"".concat(ut,"-active"),$e===ve&&!ge),Object(M.a)(le,"".concat(ut,"-disabled"),ge),Object(M.a)(le,"".concat(ut,"-selected"),_t),le)),Rt=de?Je:re,nt=!Ee||typeof Ee=="function"||_t;return N.createElement("div",Object.assign({},Ot,{"aria-selected":_t,className:bt,title:De,onMouseMove:function(){if($e===ve||ge)return;qe(ve)},onClick:function(){ge||Ke(Re)},style:it}),N.createElement("div",{className:"".concat(ut,"-content")},Rt||Re),N.isValidElement(Ee)||_t,nt&&N.createElement(s.a,{className:"".concat(Ae,"-option-state"),customizeIcon:Ee,customizeIconProps:{isSelected:_t}},_t?"\u2713":null))}))},l=N.forwardRef(h);l.displayName="OptionList";var i=l,o=function(){return null};o.isSelectOption=!0;var f=o,A=function(){return null};A.isSelectOptGroup=!0;var x=A,T=Z("VTBJ"),O=Z("Zm9Q");function S(y){var j=y.key,K=y.props,Q=K.children,te=K.value,_e=Object(W.a)(K,["children","value"]);return Object(T.a)({key:j,value:te!==void 0?te:j,children:Q},_e)}function w(y){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(y).map(function(K,Q){if(!N.isValidElement(K)||!K.type)return null;var te=K.type.isSelectOptGroup,_e=K.key,de=K.props,me=de.children,fe=Object(W.a)(de,["children"]);return j||!te?S(K):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(_e===null?Q:_e,"__"),label:_e},fe),{},{options:w(me)})}).filter(function(K){return K})}var E=Z("2Qr1"),_=Z("qNPg"),c=Z("U8pU"),u=Z("Kwbf"),g=Z("WKfj");function b(y){var j=y.mode,K=y.options,Q=y.children,te=y.backfill,_e=y.allowClear,de=y.placeholder,me=y.getInputElement,fe=y.showSearch,pe=y.onSearch,ae=y.defaultOpen,he=y.autoFocus,$=y.labelInValue,ie=y.value,ee=y.inputValue,Ee=y.optionLabelProp,we=j==="multiple"||j==="tags",ye=fe!==void 0?fe:we||j==="combobox",xe=K||w(Q);if(Object(u.a)(j!=="tags"||xe.every(function(Ae){return!Ae.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),j==="tags"||j==="combobox"){var Le=xe.some(function(Ae){return Ae.options?Ae.options.some(function(Oe){return typeof("value"in Oe?Oe.value:Oe.key)=="number"}):typeof("value"in Ae?Ae.value:Ae.key)=="number"});Object(u.a)(!Le,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(u.a)(j!=="combobox"||!Ee,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(u.a)(j==="combobox"||!te,"`backfill` only works with `combobox` mode."),Object(u.a)(j==="combobox"||!me,"`getInputElement` only work with `combobox` mode."),Object(u.b)(j!=="combobox"||!me||!_e||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!ye&&j!=="combobox"&&j!=="tags"&&Object(u.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(u.b)(!ae||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ie!=null){var ke=Object(g.d)(ie);Object(u.a)(!$||ke.every(function(Ae){return Object(c.a)(Ae)==="object"&&("key"in Ae||"value"in Ae)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(u.a)(!we||Array.isArray(ie),"`value` should be array when `mode` is `multiple` or `tags`")}if(Q){var Pe=null;Object(O.a)(Q).some(function(Ae){if(!N.isValidElement(Ae)||!Ae.type)return!1;var Oe=Ae.type;if(Oe.isSelectOption)return!1;if(Oe.isSelectOptGroup){var Be=Object(O.a)(Ae.props.children).every(function(Ve){return!N.isValidElement(Ve)||!Ae.type||Ve.type.isSelectOption?!0:(Pe=Ve.type,!1)});return!Be}return Pe=Oe,!0}),Pe&&Object(u.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Pe.displayName||Pe.name||Pe,"`.")),Object(u.a)(ee===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var k=b,I=Object(_.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:w,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:k,fillOptionsWithMissingValue:E.a}),F=function(y){Object(D.a)(K,y);var j=Object(G.a)(K);function K(){var Q;return Object(ne.a)(this,K),Q=j.apply(this,arguments),Q.selectRef=N.createRef(),Q.focus=function(){Q.selectRef.current.focus()},Q.blur=function(){Q.selectRef.current.blur()},Q}return Object(V.a)(K,[{key:"render",value:function(){return N.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),K}(N.Component);F.Option=f,F.OptGroup=x;var U=F,C=We.c=U},M8RZ:function(ot,We,Z){"use strict";Z.d(We,"a",function(){return P});var ne=Z("fWQN"),V=Z("mtLc"),D=Z("yKVA"),G=Z("879j"),N=Z("cDcd"),M=Z.n(N),W=Z("faye"),B=Z.n(W),P=function(R){Object(D.a)(m,R);var v=Object(G.a)(m);function m(p){var d;Object(ne.a)(this,m),d=v.call(this,p);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(V.a)(m,[{key:"render",value:function(){var d=this.props.children;return Object(W.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(M.a.Component)},Ot1p:function(ot,We,Z){"use strict";var ne=Z("2qtc"),V=Z("kLXV"),D=Z("rAM+"),G=Z("miYZ"),N=Z("tsqr"),M=Z("9og8"),W=Z("tJVT"),B=Z("jrin"),P=Z("WmNS"),R=Z.n(P),v=Z("cDcd"),m=Z.n(v),p=Z("VrN/"),d=Z.n(p),s=Z("bdgK"),h=Z("p77/"),l=Z("Bd2K"),i=Z("ELLl"),o=Z("19Vz"),f=Z("lZu9"),A=Z("+NIl"),x=Z("kSUc"),T=Z("9Bee"),O=function(ge){var Re=ge.value,De=Re===void 0?"":Re,Je=ge.className,it=ge.showTextOnly,rt=ge.showLines,Ot=ge.style,_t=Ot===void 0?{}:Ot,ut=Object(v.useMemo)(function(){return""},[De]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},S=Z("0Owb"),w=Z("dejd"),E=Z("C+DQ"),_=Z("1vsH"),c=Z("m3rI"),u=[{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 g(ge){var Re=ge.onActionCallback,De=ge.title,Je=ge.icon,it=ge.actionName,rt=ge.className,Ot=rt===void 0?"":rt,_t=ge.children;function ut(){Re(it)}return m.a.createElement("a",{title:De,className:Ot,onClick:ut},m.a.createElement("i",{className:"md-iconfont ".concat(Je)}),_t)}var b=function(ge){var Re=ge.watch,De=ge.showNullButton,Je=ge.onActionCallback,it=ge.fullScreen,rt=ge.insertTemp,Ot=ge.hidetoolBar,_t=ge.uuid,ut=ge.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(_.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(_.G)("_educoder_session"),"&key=").concat(_t,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var bt=[].concat(u,[{title:"".concat(Re?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Re?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!Ot&&bt.map(function(Rt,nt){return m.a.createElement("li",{key:nt},Rt.actionName?m.a.createElement(g,Object(S.a)({},Rt,{onActionCallback:Je})):m.a.createElement("span",{className:"v-line"}))}),De?m.a.createElement("li",null,m.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Je},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&m.a.createElement("li",null,m.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:Je},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(g,{icon:"".concat(it?"icon-shrink":"icon-enlarge"),title:it?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Je})))},k=Z("M8RZ"),I=Z("+L6B"),F=Z("2/Rp"),U=Z("y8nQ"),C=Z("Vl3Y"),y=Z("5NDa"),j=Z("5rEg"),K={labelCol:{span:4},wrapperCol:{span:20}},Q=function(ge){var Re=ge.callback,De=ge.onCancel;function Je(it){Re(it)}return m.a.createElement(C.a,Object(S.a)({},K,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Je}),m.a.createElement(C.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(j.a,null)),m.a.createElement(C.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(j.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(F.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},te=Z("7ahc"),_e=Z("HmJG"),de=Z("BjJ7"),me=C.a.useForm,fe={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},ae=function(ge){var Re=ge.callback,De=ge.onCancel,Je=me(),it=Object(W.a)(Je,1),rt=it[0];function Ot(bt){Re(bt)}function _t(bt,Rt){if(bt.status===-1){N.b.error(bt.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(bt.id),type:Rt.type})}function ut(bt){var Rt=bt.target.files[0];$(Rt,_t)}return m.a.createElement(C.a,Object(S.a)({form:rt},pe,{className:"upload-image-panel",onFinish:Ot}),m.a.createElement(C.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(C.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(j.a,{style:fe})),m.a.createElement(he,{onFileChange:ut}))),m.a.createElement(C.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(j.a,{style:{width:264}})),m.a.createElement(C.a.Item,{style:{textAlign:"right"}},m.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(F.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))};function he(ge){var Re=ge.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Re}))}function $(ge,Re){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var De=new FormData;De.append("editormd-image-file",ge),De.append("file_param_name","editormd-image-file"),De.append("byxhr","true");var Je=new window.XMLHttpRequest;Je.withCredentials=!0,Je.addEventListener("load",function(it){Re(JSON.parse(it.target.responseText),ge)},!1),Je.addEventListener("error",function(it){console.error(it)},!1),Je.open("POST","".concat(de.a,"/api/attachments.json")),Je.send(De)}var ie=Z("giR+"),ee=Z("fyUT"),Ee=Z("7Kak"),we=Z("9yH6"),ye=we.a.Group,xe={margin:"0 8px"},Le=function(ge){var Re=ge.callback,De=ge.onCancel;function Je(it){Re(it)}return m.a.createElement(C.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Je},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:xe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:xe},"\u884C\u6570"),m.a.createElement(C.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(ee.a,null)),m.a.createElement("span",{style:xe},"\u5217\u6570"),m.a.createElement(C.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(ee.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:xe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(C.a.Item,{name:"align"},m.a.createElement(ye,null,m.a.createElement(we.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(we.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(we.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(we.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(F.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},ke=Z("ErOA"),Pe=Z("7Cbv"),Ae="link",Oe="upload-image",Be="code-block",Ve="add-table",ze="------------",je={default:ze,left:":".concat(ze),center:":".concat(ze,":"),right:"".concat(ze,":")},et=Z("9VGf"),Xe,$e;function Ce(){}var qe=0,Ke=1e4,Se="\u2581",Me=`
**\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 ve(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var le=navigator.platform.toUpperCase().indexOf("MAC")>=0,ue=le?"Cmd":"Ctrl",J=["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=(Xe={},Object(B.a)(Xe,ue+"-B","bold"),Object(B.a)(Xe,ue+"-I","italic"),Xe),re=($e={},Object(B.a)($e,Ae,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)($e,Be,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)($e,Oe,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)($e,Ve,"\u6DFB\u52A0\u8868\u683C"),$e),oe=We.a=function(ge){var Re=ge.defaultValue,De=Re===void 0?"":Re,Je=ge.onChange,it=ge.width,rt=it===void 0?"100%":it,Ot=ge.height,_t=Ot===void 0?400:Ot,ut=ge.miniToolbar,bt=ut===void 0?!1:ut,Rt=ge.isFocus,nt=Rt===void 0?!1:Rt,Kt=ge.watch,St=ge.insertTemp,an=ge.mode,Ue=an===void 0?"markdown":an,st=ge.id,ct=st===void 0?"markdown-editor-id":st,Lt=ge.showResizeBar,Ft=Lt===void 0?!1:Lt,Xt=ge.noStorage,or=Xt===void 0?!1:Xt,Hr=ge.showNullButton,Gt=Hr===void 0?!1:Hr,lt=ge.hidetoolBar,Nn=lt===void 0?!1:lt,lr=ge.fullScreen,dn=lr===void 0?!1:lr,At=ge.onBlur,Ln=ge.onCMBeforeChange,pn=ge.onFullScreen,ur=ge.className,Fe=ur===void 0?"":ur,gt=ge.disablePaste,Sr=gt===void 0?!1:gt,dr=ge.placeholder,cr=dr===void 0?"":dr,Un=ge.values,hr=Un===void 0?"":Un,vt=Object(v.useState)(null),On=Object(W.a)(vt,2),He=On[0],fr=On[1],vn=Object(v.useState)(De),_n=Object(W.a)(vn,2),Vn=_n[0],In=_n[1],pr=Object(v.useState)(Kt),Or=Object(W.a)(pr,2),Rn=Or[0],Rr=Or[1],Ar=Object(v.useState)(dn),mr=Object(W.a)(Ar,2),Dn=mr[0],Bn=mr[1],li=Object(v.useState)(""),Zn=Object(W.a)(li,2),sn=Zn[0],jn=Zn[1],ui=Object(v.useState)(0),Hn=Object(W.a)(ui,2),Ye=Hn[0],Tt=Hn[1],Wt=Object(v.useState)(_t),pt=Object(W.a)(Wt,2),kt=pt[0],Mt=pt[1],Nt=Object(v.useState)(!1),Bt=Object(W.a)(Nt,2),qn=Bt[0],on=Bt[1],Xn=Object(v.useRef)(Object(Pe.a)()),Cr=Object(v.useRef)(!1),Wr=Object(v.useRef)(),er=Object(v.useRef)(),tr=Object(v.useRef)(),nr=Object(v.useRef)(),Kr=Object(v.useRef)(),Fi=function(){var dt=Object(M.a)(R.a.mark(function yt(){var ft,xt;return R.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(ke.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xn.current}});case 2:xt=jt.sent,xt!=null&&(ft=xt.attachments)!==null&&ft!==void 0&&ft.length&&(console.log("cm:",He,er),xt.attachments.map(function(Ct){Ct.content_type.indexOf("image")>-1?He.replaceSelection("![,](/api/attachments/".concat(Ct.id,"?type=").concat(Ct.content_type,")")):Ct.content_type.indexOf("video")>-1?He.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ct.content_type.indexOf("pdf")>-1?He.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Ct.id,"?type=").concat(Ct.content_type,'&disposition=inline" target="_blank">').concat(Ct.name,"</a>")):He.replaceSelection("[".concat(Ct.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Ct.id,"?type=").concat(Ct.content_type,")"))}));case 4:case"end":return jt.stop()}},yt)}));return function(){return dt.apply(this,arguments)}}();Object(v.useEffect)(function(){In(hr),He==null||He.setValue(hr)},[hr]),Object(v.useEffect)(function(){pn==null||pn(Dn)},[Dn]),Object(v.useEffect)(function(){if(er.current){var dt=d.a.fromTextArea(er.current,{mode:Ue,lineNumbers:!bt,lineWrapping:!0,value:De,autoCloseTags:!0,autoCloseBrackets:!0});nt&&dt.focus();function yt(ft,xt){if(Sr){xt.preventDefault();return}var It=xt.clipboardData;if(It){var jt=It.types.toString(),Ct=It.items;if(jt==="Files"||It.types.indexOf("Files")>-1){if(xt.preventDefault(),Ue=="stex")return;try{var Zt,yn=Ct[1];((Zt=Ct[0])===null||Zt===void 0?void 0:Zt.kind)==="file"&&(yn=Ct[0]);var wt=yn.getAsFile(),rr=wt.name.split(".").pop();$(wt,function(Dt){if(Dt.id){var bn,cn,Fn;(wt==null||((bn=wt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?dt.replaceSelection("![,](/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type,")")):(wt==null||((cn=wt.type)===null||cn===void 0)?void 0:cn.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,'"></video>')):(wt==null||((Fn=wt.type)===null||Fn===void 0)?void 0:Fn.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(wt.type,'&disposition=inline" target="_blank">').concat(wt.name,"</a>")):J.includes(rr)?dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,'?type=office&disposition=inline" target="_blank">').concat(wt.name,"</a>")):dt.replaceSelection("[".concat(wt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}else(Dt==null?void 0:Dt.status)===401&&(document.location.href="/user/login")})}catch(Dt){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dt.on("paste",yt),dt.on("dragleave",function(ft,xt){tr.current.classList.remove("mouse-hover-md")}),dt.on("dragover",function(ft,xt){tr.current.classList.add("mouse-hover-md")}),dt.on("drop",function(ft,xt){tr.current.classList.add("mouse-hover-md");var It;if(It=xt.dataTransfer.files,It.length>0){xt.preventDefault(),xt.stopPropagation();for(var jt=function(yn){var wt=It[yn],rr=wt.name.split(".").pop();$(wt,function(Dt){if(Dt.id){var bn,cn,Fn;(wt==null||((bn=wt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?dt.replaceSelection("![,](/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type,")")):(wt==null||((cn=wt.type)===null||cn===void 0)?void 0:cn.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,'"></video>')):(wt==null||((Fn=wt.type)===null||Fn===void 0)?void 0:Fn.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(wt.type,'&disposition=inline" target="_blank">').concat(wt.name,"</a>")):J.includes(rr)?dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,'?type=office&disposition=inline" target="_blank">').concat(wt.name,"</a>")):dt.replaceSelection("[".concat(wt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}else(Dt==null?void 0:Dt.status)===401&&(document.location.href="/user/login")})},Ct=0;Ct<It.length;Ct++)jt(Ct)}}),fr(dt),function(){dt.off("paste",yt)}}},[]);var Pn=Object(v.useCallback)(function(){if(tr.current)try{}catch(dt){console.log(dt,"---- to set md editor body height")}},[kt,tr,Dn]);Object(v.useEffect)(function(){function dt(){var ft=new s.default(function(xt){var It=Object(D.a)(xt),jt;try{for(It.s();!(jt=It.n()).done;){var Ct=jt.value;(Ct.target.offsetHeight>0||Ct.target.offsetWidth>0)&&(Pn(),He.setSize("100%","100%"),He.refresh())}}catch(Zt){It.e(Zt)}finally{It.f()}});return ft.observe(er.current.parentElement),ft}if(He){var yt=dt();return function(){yt.unobserve(er.current.parentElement)}}},[He,Pn]),Object(v.useEffect)(function(){if(He){for(var dt=[],yt=function(){var Ct=xt[ft];It=Object(W.a)(Ct,2);var Zt=It[0],yn=It[1],wt=Object(B.a)({},Zt,function(){Bi(yn)});dt.push(wt),He.addKeyMap(wt)},ft=0,xt=Object.entries(q);ft<xt.length;ft++){var It;yt()}return Wr.current=setInterval(function(){Cr.current&&Fi()},4e3),function(){clearInterval(Wr.current);var jt=Object(D.a)(dt),Ct;try{for(jt.s();!(Ct=jt.n()).done;){var Zt=Ct.value;He.removeKeyMap(Zt)}}catch(yn){jt.e(yn)}finally{jt.f()}}}},[He]),Object(v.useEffect)(function(){dn!==Dn&&Bn(dn)},[dn]),Object(et.a)(function(){if(!or&&Ye>0){var dt=new Date().getTime(),yt=window.sessionStorage.getItem(ct);dt>=Ye+Ke&&(!yt||yt!==Vn)&&(window.sessionStorage.setItem(ct,Vn),on(!0))}},Ke),Object(v.useEffect)(function(){Rr(Kt)},[He,Kt]),Object(v.useEffect)(function(){He&&(nt&&He.focus())},[He,nt]),Object(v.useEffect)(function(){if(Rn&&He){var dt=He.getScrollerElement();function yt(ft){var xt=ft.target;if(Kr.current){var It=xt.scrollTop/xt.scrollHeight;Kr.current.scrollTop=Kr.current.scrollHeight*It}}return dt.addEventListener("scroll",yt),function(){dt.removeEventListener("scroll",yt)}}},[He,Rn]),Object(v.useEffect)(function(){if(He&&Ln){function dt(yt,ft){Ln(yt,ft)}return He.on("beforeChange",dt),function(){He.off("beforeChange",dt)}}},[He,Ln]),Object(v.useEffect)(function(){if(He&&At){function dt(){At(He.getValue())}return He.on("blur",dt),function(){He.off("blur",dt)}}},[He,At]),Object(v.useEffect)(function(){if(He){function dt(yt){var ft=yt.getValue();In(ft),Tt(new Date().getTime()),yt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Je&&Je(ft)}return He.on("change",dt),function(){He.off("change",dt)}}},[He,Je]),Object(v.useEffect)(function(){He&&(De==null?(He.setValue(""),In("")):De!==He.getValue()&&(He.setValue(De),In(De),He.setCursor(He.lineCount(),0)))},[He,De]);var Bi=Object(v.useCallback)(function(dt){var yt=He.getCursor(),ft=He.getSelection(),xt=ft.split(`
`);switch(dt){case"bold":return He.replaceSelection("**"+ft+"**"),ft===""&&He.setCursor(yt.line,yt.ch+2),He.focus();case"italic":return He.replaceSelection("*"+ft+"*"),ft===""&&He.setCursor(yt.line,yt.ch+1),He.focus();case"code":return He.replaceSelection("`"+ft+"`"),ft===""&&He.setCursor(yt.line,yt.ch+1),He.focus();case"inline-latex":return He.replaceSelection("`$$"+ft+"$$`"),ft===""&&He.setCursor(yt.line,yt.ch+3),He.focus();case"latex":return He.replaceSelection("```latex\n"+ft+"\n```"),He.setCursor(yt.line+1,ft.length+1),He.focus();case"line-break":return He.replaceSelection(`<br/>
`),He.focus();case"list-ul":return ft===""?He.replaceSelection("- "+ft):He.replaceSelection(xt.map(function(It){return It===""?"":"- ".concat(It)}).join(`
`)),He.focus();case"list-ol":return ft===""?He.replaceSelection("1. "+ft):He.replaceSelection(xt.map(function(It,jt){return It===""?"":"".concat(jt+1,". ").concat(It)}).join(`
`)),He.focus();case"add-null-ch":return ft===""&&He.setCursor(yt.line,yt.ch+1),He.replaceSelection(Se),He.focus();case"inster-template-1":return ft===""&&He.setCursor(yt.line,yt.ch),He.replaceSelection(Me),He.focus();case"eraser":return He.setValue(""),He.focus();case"trigger-watch":return Rr(!Rn),He.focus();case"trigger-full-screen":return Bn(!Dn),He.focus();case Ae:jn(Ae);return;case Be:jn(Be);return;case Oe:jn(Oe);return;case Ve:jn(Ve);return;default:throw new Error}},[He,Rn,Dn]),Gr=Object(v.useCallback)(function(dt){jn("");switch(sn){case Ae:var yt=dt.title,ft=dt.link;return He.replaceSelection("[".concat(yt,"](").concat(ft,")")),He.focus();case Be:var xt=dt.language,It=dt.content;return He.replaceSelection(["```"+xt,It,"```"].join(`
`)),He.focus();case Oe:var jt=dt.src,Ct=dt.alt;return Ct?He.replaceSelection("![ ".concat(Ct," ]( ").concat(jt,' "').concat(Ct,'" )')):He.replaceSelection("![,](".concat(jt,")")),He.focus();case Ve:for(var Zt=dt.row,yn=dt.col,wt=dt.align,rr=`
`,Dt=0;Dt<Zt;Dt++){for(var bn=[],cn=[],Fn=0;Fn<yn;Fn++)Dt===1&&cn.push(je[wt]),bn.push(" ");Dt===1&&(rr+="| ".concat(cn.join(" | "),` |
`)),rr+="| ".concat(bn.join(yn===1?"":" | "),` |
`)}return He.replaceSelection(rr+`
`),He.focus();default:throw new Error}},[He,sn]),di=Object(v.useMemo)(function(){switch(sn){case Ae:return m.a.createElement(Q,{callback:Gr,onCancel:gr});case Be:return m.a.createElement(te.b,{callback:Gr,onCancel:gr});case Oe:return m.a.createElement(ae,{callback:Gr,onCancel:gr});case Ve:return m.a.createElement(Le,{callback:Gr,onCancel:gr});default:return null}},[sn]);function gr(){jn("")}Object(v.useEffect)(function(){if(nr.current){var dt=nr.current,yt=!1,ft=0;function xt(Ct){yt=!0,ft=Ct.pageY}function It(){yt=!1}function jt(Ct){if(yt){var Zt=Ct.pageY-ft;Zt<0&&(Zt=0),Zt>300&&(Zt=300);var yn=_t+Zt+"px";Mt(yn)}}return dt.addEventListener("mousedown",xt),document.addEventListener("mousemove",jt),document.addEventListener("mouseup",It),function(){dt.removeEventListener("mousedown",xt),document.removeEventListener("mousemove",jt),document.removeEventListener("mouseup",It)}}},[He,nr]),Object(v.useEffect)(function(){Mt(_t)},[_t]);var Yn=ve(rt),ci=ve(kt),Wn={width:Yn,height:ci},hi=Object(v.useMemo)(function(){if(Ye){var dt=new Date(Ye),yt=dt.getHours(),ft=dt.getMinutes(),xt=dt.getSeconds();return yt=yt<10?"0"+yt:yt,ft=ft<10?"0"+ft:ft,xt=xt<10?"0"+xt:xt,"".concat(yt,":").concat(ft,":").concat(xt)}return 0},[Ye]);function ji(){window.sessionStorage.removeItem(ct),on(!1),Tt(0)}function Lr(){on(!1),Tt(0),He.setValue(window.sessionStorage.getItem(ct))}function ua(dt,yt){var ft=He.getValue();ft=ft.replace(dt,yt),In(ft),He==null||He.setValue(ft)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:tr},m.a.createElement("div",{className:"markdown-editor-container ".concat(Fe," ").concat(Rn?"on-preview":""," ").concat(bt?"mini":""," ").concat(Dn?"full-screen":""),style:Wn},m.a.createElement(b,{insertTemp:St,watch:Rn,fullScreen:Dn,showNullButton:Gt,onActionCallback:Bi,hidetoolBar:Nn,uuid:Xn.current,setOpenPhones:function(){Cr.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:er,placeholder:cr})),Rn?m.a.createElement("div",{ref:Kr,className:"preview-container"},Ue==="stex"&&m.a.createElement(O,{value:Vn}),Ue!=="stex"&&m.a.createElement(T.a,{edit:!0,value:Vn,replaces:ua})):null))),Ft?m.a.createElement("a",{ref:nr,className:"editor-resize"}):null,m.a.createElement(k.a,null,re[sn]?m.a.createElement(V.a,{centered:!0,title:re[sn],visible:!0,onCancel:gr,footer:null,className:"markdown-popup-form"},di):null))}},SJMd:function(ot,We){/**
* @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 Z,ne,V,D=!1,G,N;window.PR_SHOULD_USE_CONTINUATION=!0;var M,W;(function(){var B=window,P=["break,continue,do,else,for,if,return,while"],R=[P,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],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",h=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",i=[P,"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"],o=[P,"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=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[m,d,p,h,l,i,o,f],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",O="kwd",S="com",w="typ",E="lit",_="pun",c="pln",u="tag",g="dec",b="src",k="atn",I="atv",F="nocode",U="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function C(ye){for(var xe=0,Le=!1,ke=!1,Pe=0,Ae=ye.length;Pe<Ae;++Pe){var Oe=ye[Pe];if(Oe.ignoreCase)ke=!0;else if(/[a-z]/i.test(Oe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Le=!0,ke=!1;break}}var Be={b:8,t:9,n:10,v:11,f:12,r:13};function Ve($e){var Ce=$e.charCodeAt(0);if(Ce!==92)return Ce;var qe=$e.charAt(1);return Ce=Be[qe],Ce||("0"<=qe&&qe<="7"?parseInt($e.substring(1),8):qe==="u"||qe==="x"?parseInt($e.substring(2),16):$e.charCodeAt(1))}function ze($e){if($e<32)return($e<16?"\\x0":"\\x")+$e.toString(16);var Ce=String.fromCharCode($e);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function je($e){var Ce=$e.substring(1,$e.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")),qe=[],Ke=Ce[0]==="^",Se=["["];Ke&&Se.push("^");for(var Me=Ke?1:0,ve=Ce.length;Me<ve;++Me){var le=Ce[Me];if(/\\[bdsw]/i.test(le))Se.push(le);else{var ue=Ve(le),J;Me+2<ve&&Ce[Me+1]==="-"?(J=Ve(Ce[Me+2]),Me+=2):J=ue,qe.push([ue,J]),J<65||ue>122||(J<65||ue>90||qe.push([Math.max(65,ue)|32,Math.min(J,90)|32]),J<97||ue>122||qe.push([Math.max(97,ue)&~32,Math.min(J,122)&~32]))}}qe.sort(function(ge,Re){return ge[0]-Re[0]||Re[1]-ge[1]});for(var q=[],re=[],Me=0;Me<qe.length;++Me){var oe=qe[Me];oe[0]<=re[1]+1?re[1]=Math.max(re[1],oe[1]):q.push(re=oe)}for(var Me=0;Me<q.length;++Me){var oe=q[Me];Se.push(ze(oe[0])),oe[1]>oe[0]&&(oe[1]+1>oe[0]&&Se.push("-"),Se.push(ze(oe[1])))}return Se.push("]"),Se.join("")}function et($e){for(var Ce=$e.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")),qe=Ce.length,Ke=[],Se=0,Me=0;Se<qe;++Se){var ve=Ce[Se];if(ve==="(")++Me;else if(ve.charAt(0)==="\\"){var le=+ve.substring(1);le&&(le<=Me?Ke[le]=-1:Ce[Se]=ze(le))}}for(var Se=1;Se<Ke.length;++Se)Ke[Se]===-1&&(Ke[Se]=++xe);for(var Se=0,Me=0;Se<qe;++Se){var ve=Ce[Se];if(ve==="(")++Me,Ke[Me]||(Ce[Se]="(?:");else if(ve.charAt(0)==="\\"){var le=+ve.substring(1);le&&le<=Me&&(Ce[Se]="\\"+Ke[le])}}for(var Se=0;Se<qe;++Se)Ce[Se]==="^"&&Ce[Se+1]!=="^"&&(Ce[Se]="");if($e.ignoreCase&&Le)for(var Se=0;Se<qe;++Se){var ve=Ce[Se],ue=ve.charAt(0);ve.length>=2&&ue==="["?Ce[Se]=je(ve):ue!=="\\"&&(Ce[Se]=ve.replace(/[a-zA-Z]/g,function(re){var oe=re.charCodeAt(0);return"["+String.fromCharCode(oe&~32,oe|32)+"]"}))}return Ce.join("")}for(var Xe=[],Pe=0,Ae=ye.length;Pe<Ae;++Pe){var Oe=ye[Pe];if(Oe.global||Oe.multiline)throw new Error(""+Oe);Xe.push("(?:"+et(Oe)+")")}return new RegExp(Xe.join("|"),ke?"gi":"g")}function y(ye,xe){var Le=/(?:^|\s)nocode(?:\s|$)/,ke=[],Pe=0,Ae=[],Oe=0;function Be(Ve){var ze=Ve.nodeType;if(ze==1){if(Le.test(Ve.className))return;for(var je=Ve.firstChild;je;je=je.nextSibling)Be(je);var et=Ve.nodeName.toLowerCase();(et==="br"||et==="li")&&(ke[Oe]=`
`,Ae[Oe<<1]=Pe++,Ae[Oe++<<1|1]=Ve)}else if(ze==3||ze==4){var Xe=Ve.nodeValue;Xe.length&&(xe?Xe=Xe.replace(/\r\n?/g,`
`):Xe=Xe.replace(/[ \t\r\n]+/g," "),ke[Oe]=Xe,Ae[Oe<<1]=Pe,Pe+=Xe.length,Ae[Oe++<<1|1]=Ve)}}return Be(ye),{sourceCode:ke.join("").replace(/\n$/,""),spans:Ae}}function j(ye,xe,Le,ke,Pe){if(!Le)return;var Ae={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:Le,spans:null,basePos:xe,decorations:null};ke(Ae),Pe.push.apply(Pe,Ae.decorations)}var K=/\S/;function Q(ye){for(var xe=void 0,Le=ye.firstChild;Le;Le=Le.nextSibling){var ke=Le.nodeType;xe=ke===1?xe?ye:Le:ke===3&&K.test(Le.nodeValue)?ye:xe}return xe===ye?void 0:xe}function te(ye,xe){var Le={},ke;(function(){for(var Oe=ye.concat(xe),Be=[],Ve={},ze=0,je=Oe.length;ze<je;++ze){var et=Oe[ze],Xe=et[3];if(Xe)for(var $e=Xe.length;--$e>=0;)Le[Xe.charAt($e)]=et;var Ce=et[1],qe=""+Ce;Ve.hasOwnProperty(qe)||(Be.push(Ce),Ve[qe]=null)}Be.push(/[\0-\uffff]/),ke=C(Be)})();var Pe=xe.length,Ae=function(Oe){for(var Be=Oe.sourceCode,Ve=Oe.basePos,ze=Oe.sourceNode,je=[Ve,c],et=0,Xe=Be.match(ke)||[],$e={},Ce=0,qe=Xe.length;Ce<qe;++Ce){var Ke=Xe[Ce],Se=$e[Ke],Me=void 0,ve;if(typeof Se=="string")ve=!1;else{var le=Le[Ke.charAt(0)];if(le)Me=Ke.match(le[1]),Se=le[0];else{for(var ue=0;ue<Pe;++ue)if(le=xe[ue],Me=Ke.match(le[1]),Me){Se=le[0];break}Me||(Se=c)}ve=Se.length>=5&&Se.substring(0,5)==="lang-",ve&&!(Me&&typeof Me[1]=="string")&&(ve=!1,Se=b),ve||($e[Ke]=Se)}var J=et;if(et+=Ke.length,!ve)je.push(Ve+J,Se);else{var q=Me[1],re=Ke.indexOf(q),oe=re+q.length;Me[2]&&(oe=Ke.length-Me[2].length,re=oe-q.length);var ge=Se.substring(5);j(ze,Ve+J,Ke.substring(0,re),Ae,je),j(ze,Ve+J+re,q,he(ge,q),je),j(ze,Ve+J+oe,Ke.substring(oe),Ae,je)}}Oe.decorations=je};return Ae}function _e(ye){var xe=[],Le=[];ye.tripleQuotedStrings?xe.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?xe.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):xe.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Le.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ke=ye.hashComments;ke&&(ye.cStyleComments?(ke>1?xe.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):xe.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Le.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):xe.push([S,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Le.push([S,/^\/\/[^\r\n]*/,null]),Le.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Pe=ye.regexLiterals;if(Pe){var Ae=Pe>1?"":`
\r`,Oe=Ae?".":"[\\S\\s]",Be="/(?=[^/*"+Ae+"])(?:[^/\\x5B\\x5C"+Ae+"]|\\x5C"+Oe+"|\\x5B(?:[^\\x5C\\x5D"+Ae+"]|\\x5C"+Oe+")*(?:\\x5D|$))+/";Le.push(["lang-regex",RegExp("^"+U+"("+Be+")")])}var Ve=ye.types;Ve&&Le.push([w,Ve]);var ze=(""+ye.keywords).replace(/^ | $/g,"");ze.length&&Le.push([O,new RegExp("^(?:"+ze.replace(/[\s,]+/g,"|")+")\\b"),null]),xe.push([c,/^\s+/,null,` \r
\xA0`]);var je="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(je+="(?!s*/)"),Le.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[_,new RegExp(je),null]),te(xe,Le)}var de=_e({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function me(ye,xe,Le){for(var ke=/(?:^|\s)nocode(?:\s|$)/,Pe=/\r\n?|\n/,Ae=ye.ownerDocument,Oe=Ae.createElement("li");ye.firstChild;)Oe.appendChild(ye.firstChild);var Be=[Oe];function Ve(Ce){var qe=Ce.nodeType;if(qe==1&&!ke.test(Ce.className))if(Ce.nodeName==="br")ze(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var Ke=Ce.firstChild;Ke;Ke=Ke.nextSibling)Ve(Ke);else if((qe==3||qe==4)&&Le){var Se=Ce.nodeValue,Me=Se.match(Pe);if(Me){var ve=Se.substring(0,Me.index);Ce.nodeValue=ve;var le=Se.substring(Me.index+Me[0].length);if(le){var ue=Ce.parentNode;ue.insertBefore(Ae.createTextNode(le),Ce.nextSibling)}ze(Ce),ve||Ce.parentNode.removeChild(Ce)}}}function ze(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function qe(Me,ve){var le=ve?Me.cloneNode(!1):Me,ue=Me.parentNode;if(ue){var J=qe(ue,1),q=Me.nextSibling;J.appendChild(le);for(var re=q;re;re=q)q=re.nextSibling,J.appendChild(re)}return le}for(var Ke=qe(Ce.nextSibling,0),Se;(Se=Ke.parentNode)&&Se.nodeType===1;)Ke=Se;Be.push(Ke)}for(var je=0;je<Be.length;++je)Ve(Be[je]);xe===(xe|0)&&Be[0].setAttribute("value",xe);var et=Ae.createElement("ol");et.className="linenums";for(var Xe=Math.max(0,xe-1|0)||0,je=0,$e=Be.length;je<$e;++je)Oe=Be[je],Oe.className="L"+(je+Xe)%10,Oe.firstChild||Oe.appendChild(Ae.createTextNode("\xA0")),et.appendChild(Oe);ye.appendChild(et)}function fe(ye){var xe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);xe=xe&&+xe[1]<=8;var Le=/\n/g,ke=ye.sourceCode,Pe=ke.length,Ae=0,Oe=ye.spans,Be=Oe.length,Ve=0,ze=ye.decorations,je=ze.length,et=0;ze[je]=Pe;var Xe,$e;for($e=Xe=0;$e<je;)ze[$e]!==ze[$e+2]?(ze[Xe++]=ze[$e++],ze[Xe++]=ze[$e++]):$e+=2;for(je=Xe,$e=Xe=0;$e<je;){for(var Ce=ze[$e],qe=ze[$e+1],Ke=$e+2;Ke+2<=je&&ze[Ke+1]===qe;)Ke+=2;ze[Xe++]=Ce,ze[Xe++]=qe,$e=Ke}je=ze.length=Xe;var Se=ye.sourceNode,Me="";Se&&(Me=Se.style.display,Se.style.display="none");try{for(var ve=null;Ve<Be;){var le=Oe[Ve],ue=Oe[Ve+2]||Pe,J=ze[et+2]||Pe,Ke=Math.min(ue,J),q=Oe[Ve+1],re;if(q.nodeType!==1&&(re=ke.substring(Ae,Ke))){xe&&(re=re.replace(Le,"\r")),q.nodeValue=re;var oe=q.ownerDocument,ge=oe.createElement("span");ge.className=ze[et+1];var Re=q.parentNode;Re.replaceChild(ge,q),ge.appendChild(q),Ae<ue&&(Oe[Ve+1]=q=oe.createTextNode(ke.substring(Ke,ue)),Re.insertBefore(q,ge.nextSibling))}Ae=Ke,Ae>=ue&&(Ve+=2),Ae>=J&&(et+=2)}}finally{Se&&(Se.style.display=Me)}}var pe={};function ae(ye,xe){for(var Le=xe.length;--Le>=0;){var ke=xe[Le];pe.hasOwnProperty(ke)?B.console&&console.warn("cannot override language handler %s",ke):pe[ke]=ye}}function he(ye,xe){return ye&&pe.hasOwnProperty(ye)||(ye=/^\s*</.test(xe)?"default-markup":"default-code"),pe[ye]}ae(de,["default-code"]),ae(te([],[[c,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[_,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ae(te([[c,/^[\s]+/,null,` \r
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[u,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[k,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[_,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ae(te([],[[I,/^[\s\S]+/]]),["uq.val"]),ae(_e({keywords:m,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),ae(_e({keywords:"null,true,false"}),["json"]),ae(_e({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),ae(_e({keywords:p,cStyleComments:!0}),["java"]),ae(_e({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ae(_e({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ae(_e({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ae(_e({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ae(_e({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ae(_e({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ae(te([],[[T,/^[\s\S]+/]]),["regex"]);function $(ye){var xe=ye.langExtension;try{var Le=y(ye.sourceNode,ye.pre),ke=Le.sourceCode;ye.sourceCode=ke,ye.spans=Le.spans,ye.basePos=0,he(xe,ke)(ye),fe(ye)}catch(Pe){B.console&&console.log(Pe&&Pe.stack||Pe)}}function ie(ye,xe,Le){var ke=Le||!1,Pe=xe||null,Ae=document.createElement("div");Ae.innerHTML="<pre>"+ye+"</pre>",Ae=Ae.firstChild,ke&&me(Ae,ke,!0);var Oe={langExtension:Pe,numberLines:ke,sourceNode:Ae,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return $(Oe),Ae.innerHTML}function ee(ye,xe){var Le=xe||document.body,ke=Le.ownerDocument||document;function Pe(le){return Le.getElementsByTagName(le)}for(var Ae=[Pe("pre"),Pe("code"),Pe("xmp")],Oe=[],Be=0;Be<Ae.length;++Be)for(var Ve=0,ze=Ae[Be].length;Ve<ze;++Ve)Oe.push(Ae[Be][Ve]);Ae=null;var je=Date;je.now||(je={now:function(){return+new Date}});var et=0,Xe=/\blang(?:uage)?-([\w.]+)(?!\S)/,$e=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,qe=/pre|xmp/i,Ke=/^code$/i,Se=/^(?:pre|code|xmp)$/i,Me={};function ve(){for(var le=B.PR_SHOULD_USE_CONTINUATION?je.now()+250:Infinity;et<Oe.length&&je.now()<le;et++){for(var ue=Oe[et],J=Me,q=ue;q=q.previousSibling;){var re=q.nodeType,oe=(re===7||re===8)&&q.nodeValue;if(oe?!/^\??prettify\b/.test(oe):re!==3||/\S/.test(q.nodeValue))break;if(oe){J={},oe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Kt,St,an){J[St]=an});break}}var ge=ue.className;if((J!==Me||$e.test(ge))&&!Ce.test(ge)){for(var Re=!1,De=ue.parentNode;De;De=De.parentNode){var Je=De.tagName;if(Se.test(Je)&&De.className&&$e.test(De.className)){Re=!0;break}}if(!Re){ue.className+=" prettyprinted";var it=J.lang;if(!it){it=ge.match(Xe);var rt;!it&&(rt=Q(ue))&&Ke.test(rt.tagName)&&(it=rt.className.match(Xe)),it&&(it=it[1])}var Ot;if(qe.test(ue.tagName))Ot=1;else{var _t=ue.currentStyle,ut=ke.defaultView,bt=_t?_t.whiteSpace:ut&&ut.getComputedStyle?ut.getComputedStyle(ue,null).getPropertyValue("white-space"):0;Ot=bt&&bt.substring(0,3)==="pre"}var Rt=J.linenums;(Rt=Rt==="true"||+Rt)||(Rt=ge.match(/\blinenums\b(?::(\d+))?/),Rt=Rt?Rt[1]&&Rt[1].length?+Rt[1]:!0:!1),Rt&&me(ue,Rt,Ot);var nt={langExtension:it,sourceNode:ue,numberLines:Rt,pre:Ot,sourceCode:null,basePos:null,spans:null,decorations:null};$(nt)}}}et<Oe.length?B.setTimeout(ve,250):typeof ye=="function"&&ye()}ve()}var Ee=B.PR={createSimpleLexer:te,registerLangHandler:ae,sourceDecorator:_e,PR_ATTRIB_NAME:k,PR_ATTRIB_VALUE:I,PR_COMMENT:S,PR_DECLARATION:g,PR_KEYWORD:O,PR_LITERAL:E,PR_NOCODE:F,PR_PLAIN:c,PR_PUNCTUATION:_,PR_SOURCE:b,PR_STRING:T,PR_TAG:u,PR_TYPE:w,prettyPrintOne:D?B.prettyPrintOne=ie:M=ie,prettyPrint:W=D?B.prettyPrint=ee:W=ee},we=B.define;typeof we=="function"&&we.amd&&we("google-code-prettify",[],function(){return Ee})})()},Sdqs:function(ot,We,Z){"use strict";Z.r(We);var ne=Z("5Dmo"),V=Z("3S7+"),D=Z("+L6B"),G=Z("2/Rp"),N=Z("giR+"),M=Z("fyUT"),W=Z("sRBo"),B=Z("kaz8"),P=Z("/zsF"),R=Z("PArb"),v=Z("14J3"),m=Z("BMrR"),p=Z("jCWc"),d=Z("kPKH"),s=Z("sPJy"),h=Z("bE4q"),l=Z("miYZ"),i=Z("tsqr"),o=Z("9og8"),f=Z("k1fw"),A=Z("y8nQ"),x=Z("Vl3Y"),T=Z("2qtc"),O=Z("kLXV"),S=Z("tJVT"),w=Z("PpiC"),E=Z("WmNS"),_=Z.n(E),c=Z("cDcd"),u=Z.n(c),g=Z("Ty5D"),b=Z("9kvl"),k=Z("55Ip"),I=Z("jhfD"),F=Z("/MfK"),U=Z("kaH+"),C=Z("Ot1p"),y=Z("dhSg"),j=Z("wd/R"),K=Z.n(j),Q=Z("m3rI"),te=Z("LvDl"),_e=Z("XYT7"),de=Z("5NDa"),me=Z("5rEg"),fe=Z("ErOA"),pe=function(Oe){var Be=Oe.shixunHomeworks,Ve=Oe.dispatch,ze=Object(g.i)(),je=Object(c.useState)(!0),et=Object(S.a)(je,2),Xe=et[0],$e=et[1],Ce=x.a.useForm(),qe=Object(S.a)(Ce,1),Ke=qe[0];return u.a.createElement(u.a.Fragment,null,u.a.createElement(O.a,{centered:!0,title:"\u8C03\u5206",visible:Be.actionTabs.key==="\u8C03\u5206",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(o.a)(_.a.mark(function Se(){var Me,ve;return _.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Ke.validateFields();case 2:return Me=Ke.getFieldsValue(),ue.next=5,Object(fe.a)("/api/student_works/".concat(Be.actionTabs.id,"/adjust_score.json"),{method:"post",body:Object(f.a)({},Me)});case 5:ve=ue.sent,ve.status===0&&(i.b.success("\u8BC4\u9605\u6210\u529F"),Ke.resetFields(),Ve({type:"shixunHomeworks/setActionTabs",payload:{}}),Ve({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(f.a)({},ze)}));case 7:case"end":return ue.stop()}},Se)})),onCancel:function(){Ve({type:"shixunHomeworks/setActionTabs",payload:{}})}},u.a.createElement("p",{className:"tc"},"\u8BE5\u5B66\u751F\u7684\u6700\u7EC8\u6210\u7EE9\u5C06\u4E0D\u4F1A\u6309\u7167\u8BC4\u5206\u89C4\u5219\u8FDB\u884C\u8BA1\u7B97"),u.a.createElement(x.a,{form:Ke,layout:"horizontal"},u.a.createElement("div",{style:{display:"flex",alignItems:"baseline"}},u.a.createElement(x.a.Item,{label:"\u6210\u7EE9",name:"score",rules:[{required:!0,message:"\u8BF7\u8F93\u5165!"}]},u.a.createElement(M.a,{min:0,placeholder:"\u8BF7\u586B\u5199\u5206\u6570"})),u.a.createElement("span",{className:"ml10"},"\u5206")),u.a.createElement("div",null,u.a.createElement(x.a.Item,{name:"comment"},u.a.createElement(me.a.TextArea,{placeholder:"\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",rows:8}))))))},ae=Object(b.a)(function(Ae){var Oe=Ae.shixunHomeworks;return{shixunHomeworks:Oe}})(pe),he=Z("500L"),$=function(Oe){var Be=Oe.classroomList,Ve=Oe.loading,ze=Oe.dispatch,je=Object(g.i)(),et=x.a.useForm(),Xe=Object(S.a)(et,1),$e=Xe[0];return u.a.createElement(O.a,{centered:!0,title:"\u8865\u4EA4\u9644\u4EF6",visible:Be.actionTabs.key==="\u8865\u4EA4\u9644\u4EF6",bodyStyle:{minHeight:200},onOk:Object(o.a)(_.a.mark(function Ce(){var qe,Ke,Se,Me;return _.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,$e.validateFields();case 2:return Ke=Object(f.a)({},$e.getFieldValue()),Se=Be.actionTabs.selectArrs,Ke.attachment_ids=(qe=Ke.attachment_ids)===null||qe===void 0?void 0:qe.map(function(ue){return ue.response.id}),le.next=7,Object(_e.V)(Object(f.a)(Object(f.a)({},Ke),{},{homeworkId:Se.work_id}));case 7:Me=le.sent,Me.status===0&&(ze({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(f.a)({},Be.actionTabs.params)}),ze({type:"classroomList/setActionTabs",payload:{}}));case 9:case"end":return le.stop()}},Ce)})),onCancel:function(){ze({type:"classroomList/setActionTabs",payload:{}})}},u.a.createElement(x.a,{form:$e,initialValues:{}},u.a.createElement(x.a.Item,{name:"attachment_ids",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},u.a.createElement(he.b,null)),u.a.createElement(x.a.Item,{name:"description"},u.a.createElement(me.a.TextArea,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",rows:7}))))},ie=Object(b.a)(function(Ae){var Oe=Ae.classroomList,Be=Ae.loading;return{classroomList:Oe,loading:Be}})($),ee=Z("xKgJ"),Ee=Z("T/ev"),we=Z.n(Ee),ye=Z("9Bee"),xe=Z("1vsH"),Le=["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u5B9E\u8BAD\u9898"],ke=function(Oe){var Be,Ve,ze,je,et,Xe,$e,Ce,qe,Ke,Se,Me,ve,le,ue,J,q,re,oe,ge,Re,De,Je,it,rt=Oe.shixunHomeworks,Ot=Oe.globalSetting,_t=Oe.loading,ut=Oe.user,bt=Oe.dispatch,Rt=Object(w.a)(Oe,["shixunHomeworks","globalSetting","loading","user","dispatch"]),nt=Object(g.i)(),Kt=Object(c.useRef)(),St=Object(g.h)(),an=ut.userInfo,Ue=rt.studentWorkDetail,st=rt.studentWorkCommon,ct=rt.studentWorkSupplyDetail,Lt=rt.workList,Ft=Object(c.useState)({}),Xt=Object(S.a)(Ft,2),or=Xt[0],Hr=Xt[1],Gt=Object(c.useState)(""),lt=Object(S.a)(Gt,2),Nn=lt[0],lr=lt[1],dn=Object(c.useState)(!1),At=Object(S.a)(dn,2),Ln=At[0],pn=At[1],ur=O.a.useModal(),Fe=Object(S.a)(ur,2),gt=Fe[0],Sr=Fe[1],dr=x.a.useForm(),cr=Object(S.a)(dr,1),Un=cr[0],hr=Object(c.useState)({last:!1}),vt=Object(S.a)(hr,2),On=vt[0],He=vt[1],fr=Object(c.useState)({last:!1}),vn=Object(S.a)(fr,2),_n=vn[0],Vn=vn[1],In=Object(c.useState)(!1),pr=Object(S.a)(In,2),Or=pr[0],Rn=pr[1],Rr=Object(c.useState)(""),Ar=Object(S.a)(Rr,2),mr=Ar[0],Dn=Ar[1],Bn=function(){bt({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(f.a)({},nt)})};Object(c.useEffect)(function(){return bt({type:"globalSetting/footerToggle",payload:!1}),function(){bt({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(c.useEffect)(function(){bt({type:"shixunHomeworks/getStudentWorkDetail",payload:Object(f.a)({},nt)}),bt({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(f.a)({},nt)}),Bn(),li(),Kt.current.onclick=function(Ye){Ye.target.nodeName==="IMG"&&Ye.target.alt!==""&&y.a.publish("preview-image",Ye.target.src)}},[nt.categoryId,nt.userId]);function li(){return Zn.apply(this,arguments)}function Zn(){return Zn=Object(o.a)(_.a.mark(function Ye(){var Tt,Wt,pt,kt,Mt,Nt,Bt;return _.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return pt=JSON.parse(localStorage.getItem("all_student_works_param")||"{}"),on.next=3,bt({type:"shixunHomeworks/getAllStudentWorks",payload:Object(f.a)(Object(f.a)({},nt),pt)});case 3:kt=on.sent,Mt=(Tt=kt.all_student_works)===null||Tt===void 0?void 0:Tt.map(function(Xn){return String(Xn.student_work_id)}).indexOf(nt.userId),Mt===((Wt=kt.all_student_works)===null||Wt===void 0?void 0:Wt.length)-1?He({last:!0}):He((Nt=kt.all_student_works)===null||Nt===void 0?void 0:Nt[Mt+1]),Mt===0?Vn({last:!0}):Vn((Bt=kt.all_student_works)===null||Bt===void 0?void 0:Bt[Mt-1]);case 7:case"end":return on.stop()}},Ye)})),Zn.apply(this,arguments)}var sn=function(Tt){gt.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Wt=Object(o.a)(_.a.mark(function kt(){var Mt;return _.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,bt({type:"shixunHomeworks/deleteReply",payload:{object_id:Tt.id,object_type:"journals_for_message"}});case 2:Mt=Bt.sent,Mt.status===0&&(i.b.success("\u5220\u9664\u6210\u529F"),Bn());case 4:case"end":return Bt.stop()}},kt)}));function pt(){return Wt.apply(this,arguments)}return pt}()})},jn=function(Tt){gt.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Wt=Object(o.a)(_.a.mark(function kt(){var Mt;return _.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,Object(_e.k)({score_id:Tt.comment_id,userId:nt.userId});case 2:Mt=Bt.sent,Mt.status===0&&(i.b.success("\u5220\u9664\u6210\u529F"),Bn());case 4:case"end":return Bt.stop()}},kt)}));function pt(){return Wt.apply(this,arguments)}return pt}()})},ui=function(){var Ye=Object(o.a)(_.a.mark(function Tt(Wt){var pt,kt;return _.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Wt.attachment_ids=(pt=Wt.attachment_ids)===null||pt===void 0?void 0:pt.map(function(Bt){var qn;return Bt==null||((qn=Bt.response)===null||qn===void 0)?void 0:qn.id}),Nt.next=3,Object(_e.e)(Object(f.a)(Object(f.a)({},Wt),{},{userId:nt.userId}));case 3:kt=Nt.sent,kt.status===0&&(i.b.success("\u63D0\u4EA4\u6210\u529F"),Un.resetFields(),Bn());case 5:case"end":return Nt.stop()}},Tt)}));return function(Wt){return Ye.apply(this,arguments)}}(),Hn=function(){var Ye=Object(o.a)(_.a.mark(function Tt(Wt){var pt,kt,Mt,Nt,Bt;return _.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(pt=Un.getFieldsValue(),kt=pt.comment,Mt=pt.score,Nt=pt.attachment_ids,Bt=!Object(te.isNil)(Mt),console.log("-------",nt),!(kt||Bt||Nt)){on.next=6;break}return O.a.confirm({centered:!0,okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:u.a.createElement("div",{className:"tc"},"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539"),onOk:function(){Un.resetFields(),Wt==="last"?b.d.push("/classrooms/".concat(nt==null?void 0:nt.coursesId,"/group_homework/").concat(nt==null?void 0:nt.commonHomeworkId,"/review/").concat(_n==null?void 0:_n.student_work_id)):Wt==="read"?b.d.push("/classrooms/".concat(nt==null?void 0:nt.coursesId,"/group_homework/").concat(nt==null?void 0:nt.commonHomeworkId,"/review/").concat(On==null?void 0:On.student_work_id)):b.d.push("/classrooms/".concat(nt.coursesId,"/group_homework/").concat(nt.commonHomeworkId,"/detail"))}}),on.abrupt("return");case 6:Wt==="last"?b.d.push("/classrooms/".concat(nt==null?void 0:nt.coursesId,"/group_homework/").concat(nt==null?void 0:nt.commonHomeworkId,"/review/").concat(_n==null?void 0:_n.student_work_id)):Wt==="read"?b.d.push("/classrooms/".concat(nt==null?void 0:nt.coursesId,"/group_homework/").concat(nt==null?void 0:nt.commonHomeworkId,"/review/").concat(On==null?void 0:On.student_work_id)):b.d.push("/classrooms/".concat(nt.coursesId,"/group_homework/").concat(nt.commonHomeworkId,"/detail"));case 7:case"end":return on.stop()}},Tt)}));return function(Wt){return Ye.apply(this,arguments)}}();return u.a.createElement("section",{className:"edu-container",ref:Kt},u.a.createElement("section",{className:"animated fadeIn"},u.a.createElement("aside",{className:"mt10"},an&&u.a.createElement(h.a,{separator:">"},u.a.createElement(h.a.Item,null,u.a.createElement(k.a,{to:"/classrooms/".concat(nt.coursesId,"/group_homework")},an==null||((Be=an.course)===null||Be===void 0)?void 0:Be.course_name)),u.a.createElement(h.a.Item,null,u.a.createElement(k.a,{to:"/classrooms/".concat(nt.coursesId,"/group_homework")},"\u5206\u7EC4\u4F5C\u4E1A")),u.a.createElement(h.a.Item,null,u.a.createElement(k.a,{to:"/classrooms/".concat(nt.coursesId,"/group_homework/").concat(nt.commonHomeworkId,"/detail")},"\u4F5C\u4E1A\u8BE6\u60C5")),u.a.createElement(h.a.Item,null,Ue==null?void 0:Ue.author_name))),u.a.createElement("aside",{className:[we.a.title,"mt20"].join(" ")},u.a.createElement(m.a,{style:{width:"100%"}},u.a.createElement(d.a,{flex:"1"},u.a.createElement(k.a,{to:"/classrooms/".concat(nt.coursesId,"/group_homework")},u.a.createElement(I.a,{className:"font16 c-black"})),u.a.createElement("strong",{className:"font20 ml5"},Ue==null?void 0:Ue.homework_name),u.a.createElement(xe.m,{status:Ue==null?void 0:Ue.homework_status})),u.a.createElement(d.a,null,Object(ee.s)()&&(Ue==null||((Ve=Ue.homework_status)===null||Ve===void 0)?void 0:Ve.includes("\u8865\u4EA4\u4E2D"))&&u.a.createElement("span",{onClick:function(){bt({type:"classroomList/setActionTabs",payload:{key:"\u8865\u4EA4\u9644\u4EF6",params:nt,selectArrs:{homework_id:nt.commonHomeworkId,work_id:nt.userId}}})},className:"c-blue current font14"},"\u8865\u4EA4\u9644\u4EF6"))))),u.a.createElement("section",{className:[we.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},(Ue==null?void 0:Ue.description)&&u.a.createElement("aside",null,u.a.createElement("div",{className:"font16"},"\u5185\u5BB9"),u.a.createElement("div",{className:"pl30 mt20"},u.a.createElement(ye.a,{value:(Ue==null?void 0:Ue.description)||"\u6682\u65E0\uFF5E"})),Ue==null||((ze=Ue.attachments)===null||ze===void 0)?void 0:ze.map(function(Ye,Tt){return u.a.createElement("div",{className:"pl30",key:Tt},u.a.createElement("a",{href:"".concat(Q.a.API_SERVER).concat(Ye.url)},u.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),u.a.createElement("span",{className:"ml10 c-black"},Ye.title),u.a.createElement("span",{className:"c-light-black ml20 font12"},Ye.filesize)))}),u.a.createElement("aside",{className:"tr"},u.a.createElement("span",{className:" c-light-black"},K()(Ue.commit_time).format("YYYY-MM-DD HH:mm")),u.a.createElement("span",{className:"ml10"},Ue.commit_user_name),u.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),u.a.createElement("span",{className:"ml30 c-light-black"},K()(Ue.update_time).format("YYYY-MM-DD HH:mm")),u.a.createElement("span",{className:"ml10"},Ue.update_user_name),u.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(Ue==null?void 0:Ue.redo_description)&&u.a.createElement("aside",null,u.a.createElement(R.a,null),u.a.createElement("div",{className:"font16"},"\u91CD\u505A\u8BB0\u5F55"),u.a.createElement("div",{className:"pl30 mt20"},u.a.createElement(ye.a,{value:(Ue==null?void 0:Ue.redo_description)||"\u6682\u65E0\uFF5E"})),Ue==null||((je=Ue.redo_attachments)===null||je===void 0)?void 0:je.map(function(Ye,Tt){return u.a.createElement("div",{className:"pl30",key:Tt},u.a.createElement("a",{href:"".concat(Q.a.API_SERVER).concat(Ye.url)},u.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),u.a.createElement("span",{className:"ml10 c-black"},Ye.title),u.a.createElement("span",{className:"c-light-black ml20 font12"},Ye.filesize)))}),u.a.createElement("aside",{className:"tr"},u.a.createElement("span",{className:" c-light-black"},K()(Ue.redo_commit_time).format("YYYY-MM-DD HH:mm")),u.a.createElement("span",{className:"ml10"},Ue.commit_user_name),u.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),u.a.createElement("span",{className:"ml30 c-light-black"},K()(Ue.redo_update_time).format("YYYY-MM-DD HH:mm")),u.a.createElement("span",{className:"ml10"},Ue.update_user_name),u.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(ct==null?void 0:ct.revise_reason)&&u.a.createElement("aside",null,u.a.createElement(R.a,null),u.a.createElement("div",{className:"font16"},"\u8865\u4EA4\u5185\u5BB9"),u.a.createElement("div",{className:"pl30 mt20"},u.a.createElement(ye.a,{value:(ct==null?void 0:ct.revise_reason)||"\u6682\u65E0\uFF5E"})),ct==null||((et=ct.revise_attachments)===null||et===void 0)?void 0:et.map(function(Ye,Tt){return u.a.createElement("div",{className:"pl30",key:Tt},u.a.createElement("a",{href:"".concat(Q.a.API_SERVER).concat(Ye.url)},u.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),u.a.createElement("span",{className:"ml10 c-black"},Ye.title),u.a.createElement("span",{className:"c-light-black ml20 font12"},Ye.filesize)))}),u.a.createElement("aside",{className:"tr"},u.a.createElement("span",{className:"ml30 c-light-black"},K()(ct.atta_update_time).format("YYYY-MM-DD HH:mm")),u.a.createElement("span",{className:"ml10"},ct.atta_update_user),u.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),u.a.createElement(R.a,null),(Ue==null||((Xe=Ue.project_info)===null||Xe===void 0)?void 0:Xe.id)&&u.a.createElement("aside",null,u.a.createElement("div",{className:"font16"},"\u5173\u8054\u9879\u76EE"),u.a.createElement("div",{className:"pl30 mt20"},(Ue==null||(($e=Ue.project_info)===null||$e===void 0)?void 0:$e.id)===-1&&u.a.createElement("span",{className:"c-blue"},Ue==null||((Ce=Ue.project_info)===null||Ce===void 0)?void 0:Ce.name),(Ue==null||((qe=Ue.project_info)===null||qe===void 0)?void 0:qe.id)!==-1&&u.a.createElement("a",{target:"_blank",href:"".concat((Ke=ut.navigationInfo)===null||Ke===void 0||((Se=Ke.top)===null||Se===void 0)?void 0:Se.old_url).concat(Ue==null||((Me=Ue.project_info)===null||Me===void 0)?void 0:Me.id)},Ue==null||((ve=Ue.project_info)===null||ve===void 0)?void 0:ve.name))),u.a.createElement(R.a,null),(Ue==null||((le=Ue.project_info)===null||le===void 0)?void 0:le.id)&&u.a.createElement("aside",null,u.a.createElement("div",{className:"font16"},"\u5168\u90E8\u7EC4\u5458"),u.a.createElement("div",{className:"pl30 mt20"},"\u5F53\u524D\u7EC4\u5458\uFF1A",Ue==null?void 0:Ue.author_name," ",(Ue==null?void 0:Ue.is_leader_work)&&u.a.createElement("span",{className:we.a.leader},"\u7EC4\u957F"),u.a.createElement("br",null),(Ue==null||((ue=Ue.work_members)===null||ue===void 0)?void 0:ue.length)>0&&u.a.createElement("span",null,"\u5176\u4ED6\u7EC4\u5458\uFF1A",Ue==null||((J=Ue.work_members)===null||J===void 0)?void 0:J.map(function(Ye,Tt){return Object(ee.s)()?u.a.createElement("a",{style:{pointerEvents:"none"}},Ye.user_name,(Ye==null?void 0:Ye.is_leader)&&u.a.createElement("span",{className:we.a.leader},"\u7EC4\u957F")):u.a.createElement(k.a,{key:Tt,className:"mr10",to:"/classrooms/".concat(nt.coursesId,"/group_homework/").concat(nt.commonHomeworkId,"/review/").concat(Ye.work_id),target:"_blank"},Ye.user_name,(Ye==null?void 0:Ye.is_leader)&&u.a.createElement("span",{className:we.a.leader},"\u7EC4\u957F"))}))),!Object(ee.s)()&&u.a.createElement("div",{className:"c-grey-999 pl30"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u5176\u4ED6\u7EC4\u5458\u7684\u59D3\u540D\uFF0C\u53EF\u4EE5\u5FEB\u901F\u8BC4\u9605TA\u7684\u4F5C\u54C1"))),(Ue==null?void 0:Ue.anonymous_comment)&&Object(ee.e)()&&u.a.createElement("section",null,u.a.createElement("aside",{className:[we.a.replyList,"bg-white"].join(" ")},u.a.createElement("span",{style:{fontSize:"16px"}},"\u533F\u8BC4\u5B66\u5458"),u.a.createElement("br",null),(Ue==null||((q=Ue.no_commented_user_names)===null||q===void 0)?void 0:q.length)>0&&u.a.createElement("p",{style:{marginTop:"1em"}},"\u672A\u5B8C\u6210\u533F\u8BC4\uFF1A",Ue==null||((re=Ue.no_commented_user_names)===null||re===void 0)?void 0:re.toString()),u.a.createElement("span",{style:{marginTop:(Ue==null||((oe=Ue.no_commented_user_names)===null||oe===void 0)?void 0:oe.length)>0?"":"1em",display:"flex"}},"\u5DF2\u5B8C\u6210\u533F\u8BC4\uFF1A",Ue==null||((ge=Ue.commented_user_names)===null||ge===void 0)?void 0:ge.toString()))),(Object(ee.c)()||(Ue==null||((Re=Ue.homework_status)===null||Re===void 0)?void 0:Re.includes("\u533F\u8BC4\u4E2D"))||(Ue==null||((De=Ue.homework_status)===null||De===void 0)?void 0:De.includes("\u7533\u8BC9\u4E2D")))&&u.a.createElement("section",null,u.a.createElement("aside",{className:[we.a.replyList,"bg-white"].join(" ")},u.a.createElement(m.a,{gutter:[10,20]},u.a.createElement(d.a,{flex:1},u.a.createElement("span",{className:"font-16"},"\u5168\u90E8\u8BC4\u9605(",st==null?void 0:st.comment_count,")")),u.a.createElement(d.a,{style:{lineHeight:"40px"}},Object(ee.c)()&&(st==null?void 0:st.ultimate)&&u.a.createElement("span",{className:"font-16 c-blue current",onClick:function(){bt({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8C03\u5206",selectArrs:Ue,id:nt.userId,params:nt}})}},"\u8C03\u5206")),u.a.createElement(d.a,null)),(!(st!=null&&st.ultimate)||(Ue==null||((Je=Ue.homework_status)===null||Je===void 0)?void 0:Je.includes("\u533F\u8BC4\u4E2D")))&&!(st!=null&&st.is_author)&&u.a.createElement("aside",null,u.a.createElement(x.a,{layout:"vertical",form:Un,onFinish:function(Tt){return ui(Tt)},initialValues:{same_score:!0}},u.a.createElement(x.a.Item,{label:"\u8BC4\u8BED",name:"comment",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BC4\u8BED"}]},u.a.createElement(C.a,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u5BF9\u672C\u4F5C\u54C1\u7684\u8BC4\u8BED\uFF0C\u6700\u5927\u9650\u52362000\u4E2A\u5B57\u7B26",maxLength:2e3,defaultValue:"",height:200})),u.a.createElement(x.a.Item,{name:"same_score",valuePropName:"checked"},u.a.createElement(B.a,null,"\u6574\u7EC4\u540C\u8BC4(\u9009\u4E2D\uFF0C\u5219\u672C\u6B21\u8BC4\u9605\u5BF9\u8C61\u6307\u5C0F\u7EC4\u5168\u90E8\u6210\u5458\uFF0C\u5426\u5219\u4EC5\u8BC4\u9605\u6B64\u6210\u54581\u4EBA )")),u.a.createElement("div",null,u.a.createElement(x.a.Item,{name:"attachment_ids"},u.a.createElement(he.b,null))),u.a.createElement("div",{className:"mt10"},u.a.createElement(m.a,null,u.a.createElement(d.a,{flex:"1"},u.a.createElement(m.a,{align:"middle",justify:"start"},u.a.createElement(d.a,null,u.a.createElement(x.a.Item,{noStyle:!0,name:"score",rules:[{required:!Object(ee.c)(),message:"\u8BF7\u586B\u5199\u5206\u6570"}]},u.a.createElement(M.a,{min:0,step:.1,style:{width:100},size:"large",placeholder:"\u8BF7\u586B\u5199\u5206\u6570"}))),u.a.createElement(d.a,null,u.a.createElement("span",{className:"ml5 mr20"},"\u5206")))))),u.a.createElement("aside",{className:"".concat(we.a.buttonFixed)},u.a.createElement("aside",{className:"edu-container"},u.a.createElement(m.a,{align:"middle"},u.a.createElement(d.a,{flex:"1"},u.a.createElement(G.a,{type:"default",onClick:function(){return Hn("list")}},"\u8FD4\u56DE\u5217\u8868")),u.a.createElement(d.a,{flex:"1",className:"tr"},!Object(ee.s)()&&u.a.createElement(G.a,{type:"default",onClick:function(){return Hn("last")},disabled:_n==null?void 0:_n.last},"\u4E0A\u4E00\u4E2A"),!Object(ee.s)()&&u.a.createElement(G.a,{type:"default",disabled:On==null?void 0:On.last,style:{marginLeft:"20px",marginRight:"20px"},onClick:function(){return Hn("read")}},"\u4E0B\u4E00\u4E2A"),u.a.createElement(G.a,{htmlType:"submit",type:"primary"},"\u63D0\u4EA4\u8BC4\u9605"))))))),u.a.createElement(R.a,null),st==null||((it=st.comment_scores)===null||it===void 0)?void 0:it.map(function(Ye,Tt){var Wt;return u.a.createElement("aside",{key:Tt},u.a.createElement(m.a,{gutter:[12,12],key:Tt},u.a.createElement(d.a,{flex:"40px"},u.a.createElement("img",{className:we.a.headpic,width:"40",src:"".concat(Q.a.IMG_SERVER,"/images/").concat(Ye==null?void 0:Ye.user_image_url)})),u.a.createElement(d.a,{flex:"1"},u.a.createElement(m.a,{align:"middle"},u.a.createElement(d.a,{span:24},u.a.createElement(m.a,null,u.a.createElement(d.a,{flex:1},u.a.createElement("span",{className:"c-light-black"},Ye==null?void 0:Ye.user_name),u.a.createElement("span",{className:"c-light-black"},"\uFF08",Ye==null?void 0:Ye.comment_role,"\uFF09"),u.a.createElement("span",{className:"c-light-black ml10"},K()(Ye==null?void 0:Ye.comment_time).format("YYYY-MM-DD HH:mm")),Ye.score!==null&&u.a.createElement("span",{className:"ml30 c-orange"},Ye.score,"\u5206")),u.a.createElement(d.a,null,Tt===0?u.a.createElement("aside",null,Ye.delete&&u.a.createElement("span",{className:"c-blue current",onClick:function(){jn(Ye)}},"\u5220\u9664"),Ye.can_appeal&&u.a.createElement("span",{className:"c-blue current",onClick:function(){pn(!0)}},"\u7533\u8BC9"),Ye.can_reply&&u.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return pn(!0)}},"\u56DE\u590D")):u.a.createElement("aside",null,Ye.delete&&u.a.createElement("span",{className:"c-blue current",onClick:function(){jn(Ye)}},"\u5220\u9664"),Ye.can_appeal&&u.a.createElement("span",{className:"c-blue current",onClick:function(){pn(!0)}},"\u7533\u8BC9"),Ye.can_reply&&u.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return pn(!0)}},"\u56DE\u590D"),!Ye.can_reply&&u.a.createElement("span",{className:"c-light-black ml10"},"\u5931\u6548"))))),u.a.createElement(d.a,{span:24},Ye.content&&u.a.createElement(ye.a,{value:Ye.content}),!Ye.content&&u.a.createElement("span",{className:"c-light-black"},"\u6682\u672A\u5199\u8BC4\u8BED"),Ye==null||((Wt=Ye.attachments)===null||Wt===void 0)?void 0:Wt.map(function(pt,kt){return u.a.createElement("div",{key:kt},u.a.createElement("a",{href:"".concat(Q.a.API_SERVER).concat(pt.url)},u.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),u.a.createElement("span",{className:"ml10 c-black"},pt.title),u.a.createElement("span",{className:"c-light-black ml20 font12"},pt.filesize)))})),Ye.journals!=""&&u.a.createElement("div",{className:"w100"},u.a.createElement(R.a,null),u.a.createElement("aside",{className:[we.a.comment,"w100"].join(" ")},Ye.journals.map(function(pt,kt){var Mt,Nt;return u.a.createElement("aside",{key:kt},u.a.createElement(m.a,{key:kt},u.a.createElement(d.a,{span:24},u.a.createElement(m.a,null,u.a.createElement(d.a,{flex:"50px"},u.a.createElement("img",{className:we.a.headpic,width:"40",src:"".concat(Q.a.IMG_SERVER,"/images/").concat(pt==null||((Mt=pt.user_info)===null||Mt===void 0)?void 0:Mt.user_image_url)})),u.a.createElement(d.a,{flex:"1"},pt==null||((Nt=pt.user_info)===null||Nt===void 0)?void 0:Nt.user_name,u.a.createElement("span",{className:"c-light-black ml10"},K()(pt==null?void 0:pt.time).format("YYYY-MM-DD HH:mm")),u.a.createElement("br",null),u.a.createElement("strong",null,u.a.createElement(ye.a,{value:pt.content}))),u.a.createElement(d.a,null,u.a.createElement(V.a,{title:"\u5220\u9664"},u.a.createElement(F.a,{className:"current c-light-black",onClick:function(){sn(pt)}})))))),u.a.createElement(R.a,null))})))),Ln&&Tt===0&&u.a.createElement("aside",{className:["bg-white"].join(" ")},u.a.createElement(C.a,{onChange:function(kt){lr(kt)},height:150,isFocus:!0,watch:!0}),u.a.createElement(m.a,null,u.a.createElement(d.a,{span:24,className:"tr"},u.a.createElement(G.a,{type:"default",size:"large",onClick:Object(o.a)(_.a.mark(function pt(){return _.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:pn(!1);case 1:case"end":return Mt.stop()}},pt)}))},"\u53D6\u6D88"),u.a.createElement(G.a,{type:"primary",size:"large",className:"ml20",onClick:Object(o.a)(_.a.mark(function pt(){var kt;return _.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:if(!(Nn==="")){Nt.next=4;break}i.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Nt.next=8;break;case 4:return Nt.next=6,Object(_e.f)({comment:Nn,userId:nt.userId,score_id:Ye.score_id});case 6:kt=Nt.sent,kt.status===0&&(i.b.success("\u64CD\u4F5C\u6210\u529F"),pn(!1),Bn());case 8:case"end":return Nt.stop()}},pt)}))},"\u4FDD\u5B58")))))),u.a.createElement(R.a,null))}))),u.a.createElement(ae,null),u.a.createElement(ie,null),u.a.createElement(U.a,null),u.a.createElement(O.a,{title:"\u786E\u8BA4\u6253\u56DE\u91CD\u505A",visible:Or,destroyOnClose:!0,forceRender:!0,onCancel:function(){Rn(!1)},onOk:Object(o.a)(_.a.mark(function Ye(){var Tt;return _.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(mr){pt.next=3;break}return i.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),pt.abrupt("return");case 3:return pt.next=5,Object(fe.a)("/api/student_works/".concat(nt.userId,"/redo_modal.json"),{method:"post",body:{comment:mr,id:nt.userId}});case 5:Tt=pt.sent,(Tt==null?void 0:Tt.status)===0&&(i.b.info("\u6253\u56DE\u91CD\u505A\u6210\u529F"),Rn(!1),Bn());case 7:case"end":return pt.stop()}},Ye)})),width:700},u.a.createElement("div",{style:{padding:"32px"}},u.a.createElement("span",null,"\u786E\u8BA4\u5C06",Ue==null?void 0:Ue.author_name,"\u7684\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417"),u.a.createElement("div",{style:{marginTop:"20px"}},u.a.createElement("label",null,u.a.createElement("span",{style:{marginRight:"5px",color:"red"}},"*"),"\u8BC4\u8BED\uFF1A"),u.a.createElement(C.a,{className:we.a.MdEditor,onChange:function(Tt){return Dn(Tt)},defaultValue:"",height:250})))),Sr)},Pe=We.default=Object(b.a)(function(Ae){var Oe=Ae.shixunHomeworks,Be=Ae.loading,Ve=Ae.user,ze=Ae.globalSetting;return{shixunHomeworks:Oe,globalSetting:ze,user:Ve,loading:Be.effects}})(ke)},"T/ev":function(ot,We,Z){ot.exports={flex_box_center:"flex_box_center___YeRn8",flex_space_between:"flex_space_between___1Koq4",flex_box_vertical_center:"flex_box_vertical_center___iwltW",flex_box_center_end:"flex_box_center_end___Wt8Ci",flex_box_column:"flex_box_column___1_Hpq",bg:"bg___DLoEi",title:"title___Rt3xF",replyList:"replyList___1-Na2",leader:"leader___2AO79",buttonFixed:"buttonFixed___LfzzJ",exitComment:"exitComment___1F28w",nextComment:"nextComment___3Jkyg",modal:"modal___1isyX",MdEditor:"MdEditor___3xy6-"}},TXwP:function(ot,We,Z){var ne,V;(function(){var D;(function(){"use strict";var N=[,,function(P){function R(p){this.__parent=p,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=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(p))return!0;return!1},R.prototype.set_indent=function(p,d){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.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)},R.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},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var d=p.lastIndexOf(`
`);d!==-1?this.__character_count=p.length-d:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,d){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),d=d||"",p.indent_level>0&&(d=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}v.prototype.get_indent_size=function(p,d){var s=this.__base_string_length;return d=d||0,p<0&&(s=0),s+=p*this.__indent_size,s+=d,s},v.prototype.get_indent_string=function(p,d){var s=this.__base_string;return d=d||0,p<0&&(p=0,s=""),d+=p*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,d=0,s="";this.__indent_size&&p>=this.__indent_size&&(d=Math.floor(p/this.__indent_size),p-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),p&&(s+=new Array(p+1).join(" ")),this.__cache.push(s)};function m(p,d){this.__indent_cache=new v(p,d),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,d){return this.__indent_cache.get_indent_string(p,d)},m.prototype.get_indent_size=function(p,d){return this.__indent_cache.get_indent_size(p,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){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 p!==`
`&&(s=s.replace(/[\n]/g,p)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,d){return p=p||0,d=d||0,this.next_line.set_indent(p,d),this.__lines.length>1?(this.current_line.set_indent(p,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var d=0;d<p.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(p){for(var d=this.__lines.length;p<d;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,d){for(var s=this.__lines.length-2;s>=0;){var h=this.__lines[s];if(h.is_empty())break;if(h.item(0).indexOf(p)!==0&&h.item(-1)!==d){this.__lines.splice(s+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},P.exports.Output=m},,,,function(P){function R(p,d){this.raw_options=v(p,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"])}R.prototype._get_array=function(p,d){var s=this.raw_options[p],h=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(h=s.concat()):typeof s=="string"&&(h=s.split(/[^a-zA-Z0-9_\/\-]+/)),h},R.prototype._get_boolean=function(p,d){var s=this.raw_options[p],h=s===void 0?!!d:!!s;return h},R.prototype._get_characters=function(p,d){var s=this.raw_options[p],h=d||"";return typeof s=="string"&&(h=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),h},R.prototype._get_number=function(p,d){var s=this.raw_options[p];d=parseInt(d,10),isNaN(d)&&(d=0);var h=parseInt(s,10);return isNaN(h)&&(h=d),h},R.prototype._get_selection=function(p,d,s){var h=this._get_selection_list(p,d,s);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[p]+"'");return h[0]},R.prototype._get_selection_list=function(p,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 h=this._get_array(p,s);if(!this._is_valid_selection(h,d))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[p]+"'");return h},R.prototype._is_valid_selection=function(p,d){return p.length&&d.length&&!p.some(function(s){return d.indexOf(s)===-1})};function v(p,d){var s={};p=m(p);var h;for(h in p)h!==d&&(s[h]=p[h]);if(d&&p[d])for(h in p[d])s[h]=p[d][h];return s}function m(p){var d={},s;for(s in p){var h=s.replace(/-/g,"_");d[h]=p[s]}return d}P.exports.Options=R,P.exports.normalizeOpts=m,P.exports.mergeOpts=v},,function(P){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},v.prototype.__match=function(m,p){m.lastIndex=p;var d=m.exec(this.__input);return d&&!(R&&m.sticky)&&(d.index!==p&&(d=null)),d},v.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},v.prototype.testChar=function(m,p){var d=this.peek(p);return m.lastIndex=0,d!==null&&m.test(d)},v.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(m,p,d){var s="",h;return m&&(h=this.match(m),h&&(s+=h[0])),p&&(h||!m)&&(s+=this.readUntil(p,d)),s},v.prototype.readUntil=function(m,p){var d="",s=this.__position;m.lastIndex=this.__position;var h=m.exec(this.__input);return h?(s=h.index,p&&(s+=h[0].length)):s=this.__input_length,d=this.__input.substring(this.__position,s),this.__position=s,d},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,p){var d=null,s="g";return p&&R&&(s="y"),typeof m=="string"&&m!==""?d=new RegExp(m,s):m&&(d=new RegExp(m.source,s)),d},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var p=this.__position,d=this.readUntilAfter(m);return this.__position=p,d},v.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},P.exports.InputScanner=v},,,,,function(P){function R(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}R.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},R.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},P.exports.Directives=R},,function(P,R,v){var m=v(16).Beautifier,p=v(17).Options;function d(s,h){var l=new m(s,h);return l.beautify()}P.exports=d,P.exports.defaultOptions=function(){return new p}},function(P,R,v){var m=v(17).Options,p=v(2).Output,d=v(8).InputScanner,s=v(13).Directives,h=new s(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,o=/\s/,f=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,x=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(O,S){this._source_text=O||"",this._options=new m(S),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"]}T.prototype.eatString=function(O){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return S},T.prototype.eatWhitespace=function(O){for(var S=o.test(this._input.peek()),w=0;o.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
`&&((w===0||w<this._options.max_preserve_newlines)&&(w++,this._output.add_new_line(!0)));return S},T.prototype.foundNestedPseudoClass=function(){for(var O=0,S=1,w=this._input.peek(S);w;){if(w==="{")return!0;if(w==="(")O+=1;else if(w===")"){if(O===0)return!1;O-=1}else if(w===";"||w==="}")return!1;S++,w=this._input.peek(S)}return!1},T.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},T.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,S=this._options.eol;S==="auto"&&(S=`
`,O&&l.test(O||"")&&(S=O.match(l)[0])),O=O.replace(i,`
`);var w=O.match(/^[\t ]*/)[0];this._output=new p(this._options,w),this._input=new d(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,_=!1,c=!1,u=!1,g=!1,b=!1,k=!1,I=this._ch,F=!1,U,C,y;U=this._input.read(f),C=U!=="",y=I,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),I=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var j=this._input.read(A),K=h.get_directives(j);K&&K.ignore==="start"&&(j+=h.readIgnored(this._input)),this.print_string(j),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(x)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(C),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Q=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Q.match(/[ :]$/)&&(Q=this.eatString(": ").replace(/\s$/,""),this.print_string(Q),this._output.space_before_token=!0),Q=Q.replace(/\s$/,""),Q==="extend"?g=!0:Q==="import"&&(b=!0),Q in this.NESTED_AT_RULE?(this._nestedLevel+=1,Q in this.CONDITIONAL_GROUP_RULE&&(u=!0)):!_&&E===0&&Q.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(C),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),u?(u=!1,_=this._indentLevel>=this._nestedLevel):_=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&_&&(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)):(y==="("?this._output.space_before_token=!1:y!==","&&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(),y==="{"&&this._output.trim(!0),b=!1,g=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),_=!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 te=0;te<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;te++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[te])){F=!0;break}(_||u)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&E===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 _e=y==='"'||y==="'";this.preserveSingleSpace(_e||C),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")F=!1,E===0?(c&&(this.outdent(),c=!1),g=!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(),E++,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(")")),E&&(E--,this.outdent()));else{var de=!1;this._input.lookBack("with")&&(de=!0),this.preserveSingleSpace(C||de),this.print_string(this._ch),c&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),k=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),k&&this._input.peek()===";"&&this._options.selector_separator_newline&&(k=!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||k)&&E===0&&!b&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&E===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&&o.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(C),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),o.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 me=y==='"'||y==="'";this.preserveSingleSpace(me||C),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&F&&this._output.add_new_line()}var fe=this._output.get_code(S);return fe},P.exports.Beautifier=T},function(P,R,v){var m=v(6).Options;function p(d){m.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 h=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<h.length;l++)h[l]!=="expand"?this.brace_style="collapse":this.brace_style=h[l]}p.prototype=new m,P.exports.Options=p}],M={};function W(P){var R=M[P];if(R!==void 0)return R.exports;var v=M[P]={exports:{}};return N[P](v,v.exports,W),v.exports}var B=W(15);D=B})();var G=D;!(ne=[],V=function(){return{css_beautify:G}}.apply(We,ne),V!==void 0&&(ot.exports=V))})()},UZu5:function(ot,We,Z){},"VrN/":function(ot,We,Z){(function(ne,V){ot.exports=V()})(this,function(){"use strict";var ne=navigator.userAgent,V=navigator.platform,D=/gecko\/\d/i.test(ne),G=/MSIE \d/.test(ne),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),M=/Edge\/(\d+)/.exec(ne),W=G||N||M,B=W&&(G?document.documentMode||6:+(M||N)[1]),P=!M&&/WebKit\//.test(ne),R=P&&/Qt\/\d+\.\d+/.test(ne),v=!M&&/Chrome\//.test(ne),m=/Opera\//.test(ne),p=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),s=/PhantomJS/.test(ne),h=!M&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),l=/Android/.test(ne),i=h||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),o=h||/Mac/.test(V),f=/\bCrOS\b/.test(ne),A=/win/i.test(V),x=m&&ne.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(m=!1,P=!0);var T=o&&(R||m&&(x==null||x<12.11)),O=D||W&&B>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var w=function(e,t){var r=e.className,n=S(t).exec(r);if(n){var a=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(a?n[1]+a:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function _(e,t){return E(e).appendChild(t)}function c(e,t,r,n){var a=document.createElement(e);if(r&&(a.className=r),n&&(a.style.cssText=n),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var L=0;L<t.length;++L)a.appendChild(t[L]);return a}function u(e,t,r,n){var a=c(e,t,r,n);return a.setAttribute("role","presentation"),a}var g;document.createRange?g=function(e,t,r,n){var a=document.createRange();return a.setEnd(n||e,r),a.setStart(e,t),a}:g=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(a){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};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 k(){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 I(e,t){var r=e.className;S(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(t)&&(t+=" "+r[n]);return t}var U=function(e){e.select()};h?U=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(U=function(e){try{e.select()}catch(t){}});function C(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function y(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function j(e,t,r,n,a){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var L=n||0,H=a||0;;){var z=e.indexOf(" ",L);if(z<0||z>=t)return H+(t-L);H+=z-L,H+=r-H%r,L=z+1}}var K=function(){this.id=null,this.f=null,this.time=0,this.handler=C(this.onTimeout,this)};K.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},K.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function Q(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var te=50,_e={toString:function(){return"CodeMirror.Pass"}},de={scroll:!1},me={origin:"*mouse"},fe={origin:"+move"};function pe(e,t,r){for(var n=0,a=0;;){var L=e.indexOf(" ",n);L==-1&&(L=e.length);var H=L-n;if(L==e.length||a+H>=t)return n+Math.min(H,t-a);if(a+=L-n,a+=r-a%r,n=L+1,a>=t)return n}}var ae=[""];function he(e){for(;ae.length<=e;)ae.push($(ae)+" ");return ae[e]}function $(e){return e[e.length-1]}function ie(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function ee(e,t,r){for(var n=0,a=r(t);n<e.length&&r(e[n])<=a;)n++;e.splice(n,0,t)}function Ee(){}function we(e,t){var r;return Object.create?r=Object.create(e):(Ee.prototype=e,r=new Ee),t&&y(t,r),r}var ye=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function xe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ye.test(e))}function Le(e,t){return t?t.source.indexOf("\\w")>-1&&xe(e)?!0:t.test(e):xe(e)}function ke(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Pe=/[\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 Ae(e){return e.charCodeAt(0)>=768&&Pe.test(e)}function Oe(e,t,r){for(;(r<0?t>0:t<e.length)&&Ae(e.charAt(t));)t+=r;return t}function Be(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var a=(t+r)/2,L=n<0?Math.ceil(a):Math.floor(a);if(L==t)return e(L)?t:r;e(L)?r=L:t=L+n}}function Ve(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var a=!1,L=0;L<e.length;++L){var H=e[L];(H.from<r&&H.to>t||t==r&&H.to==t)&&(n(Math.max(H.from,t),Math.min(H.to,r),H.level==1?"rtl":"ltr",L),a=!0)}a||n(t,r,"ltr")}var ze=null;function je(e,t,r){var n;ze=null;for(var a=0;a<e.length;++a){var L=e[a];if(L.from<t&&L.to>t)return a;L.to==t&&(L.from!=L.to&&r=="before"?n=a:ze=a),L.from==t&&(L.from!=L.to&&r!="before"?n=a:ze=a)}return n!=null?n:ze}var et=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(Y){return Y<=247?e.charAt(Y):1424<=Y&&Y<=1524?"R":1536<=Y&&Y<=1785?t.charAt(Y-1536):1774<=Y&&Y<=2220?"r":8192<=Y&&Y<=8203?"w":Y==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,L=/[LRr]/,H=/[Lb1n]/,z=/[1n]/;function X(Y,se,ce){this.level=Y,this.from=se,this.to=ce}return function(Y,se){var ce=se=="ltr"?"L":"R";if(Y.length==0||se=="ltr"&&!n.test(Y))return!1;for(var Te=Y.length,be=[],Ie=0;Ie<Te;++Ie)be.push(r(Y.charCodeAt(Ie)));for(var Ne=0,Ge=ce;Ne<Te;++Ne){var Qe=be[Ne];Qe=="m"?be[Ne]=Ge:Ge=Qe}for(var tt=0,Ze=ce;tt<Te;++tt){var at=be[tt];at=="1"&&Ze=="r"?be[tt]="n":L.test(at)&&(Ze=at,at=="r"&&(be[tt]="R"))}for(var mt=1,ht=be[0];mt<Te-1;++mt){var Et=be[mt];Et=="+"&&ht=="1"&&be[mt+1]=="1"?be[mt]="1":Et==","&&ht==be[mt+1]&&(ht=="1"||ht=="n")&&(be[mt]=ht),ht=Et}for(var Ht=0;Ht<Te;++Ht){var nn=be[Ht];if(nn==",")be[Ht]="N";else if(nn=="%"){var Vt=void 0;for(Vt=Ht+1;Vt<Te&&be[Vt]=="%";++Vt);for(var Cn=Ht&&be[Ht-1]=="!"||Vt<Te&&be[Vt]=="1"?"1":"N",xn=Ht;xn<Vt;++xn)be[xn]=Cn;Ht=Vt-1}}for(var Jt=0,wn=ce;Jt<Te;++Jt){var un=be[Jt];wn=="L"&&un=="1"?be[Jt]="L":L.test(un)&&(wn=un)}for(var qt=0;qt<Te;++qt)if(a.test(be[qt])){var Qt=void 0;for(Qt=qt+1;Qt<Te&&a.test(be[Qt]);++Qt);for(var Yt=(qt?be[qt-1]:ce)=="L",Sn=(Qt<Te?be[Qt]:ce)=="L",si=Yt==Sn?Yt?"L":"R":ce,wr=qt;wr<Qt;++wr)be[wr]=si;qt=Qt-1}for(var fn=[],Qn,rn=0;rn<Te;)if(H.test(be[rn])){var Va=rn;for(++rn;rn<Te&&H.test(be[rn]);++rn);fn.push(new X(0,Va,rn))}else{var sr=rn,Br=fn.length,jr=se=="rtl"?1:0;for(++rn;rn<Te&&be[rn]!="L";++rn);for(var gn=sr;gn<rn;)if(z.test(be[gn])){sr<gn&&(fn.splice(Br,0,new X(1,sr,gn)),Br+=jr);var oi=gn;for(++gn;gn<rn&&z.test(be[gn]);++gn);fn.splice(Br,0,new X(2,oi,gn)),Br+=jr,sr=gn}else++gn;sr<rn&&fn.splice(Br,0,new X(1,sr,rn))}return se=="ltr"&&(fn[0].level==1&&(Qn=Y.match(/^\s+/))&&(fn[0].from=Qn[0].length,fn.unshift(new X(0,0,Qn[0].length))),$(fn).level==1&&(Qn=Y.match(/\s+$/))&&($(fn).to-=Qn[0].length,fn.push(new X(0,Te-Qn[0].length,Te)))),se=="rtl"?fn.reverse():fn}}();function Xe(e,t){var r=e.order;return r==null&&(r=e.order=et(e.text,t)),r}var $e=[],Ce=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||$e).concat(r)}};function qe(e,t){return e._handlers&&e._handlers[t]||$e}function Ke(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,a=n&&n[t];if(a){var L=Q(a,r);L>-1&&(n[t]=a.slice(0,L).concat(a.slice(L+1)))}}}function Se(e,t){var r=qe(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),a=0;a<r.length;++a)r[a].apply(null,n)}function Me(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Se(e,r||t.type,e,t),re(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Q(r,t[n])==-1&&r.push(t[n])}function le(e,t){return qe(e,t).length>0}function ue(e){e.prototype.on=function(t,r){Ce(this,t,r)},e.prototype.off=function(t,r){Ke(this,t,r)}}function J(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function q(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function re(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function oe(e){J(e),q(e)}function ge(e){return e.target||e.srcElement}function Re(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var De=function(){if(W&&B<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Je;function it(e){if(Je==null){var t=c("span","\u200B");_(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Je=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&B<8))}var r=Je?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var rt;function Ot(e){if(rt!=null)return rt;var t=_(e,document.createTextNode("A\u062EA")),r=g(t,0,1).getBoundingClientRect(),n=g(t,1,2).getBoundingClientRect();return E(e),!r||r.left==r.right?!1:rt=n.right-r.right<3}var _t=`
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var a=e.indexOf(`
`,t);a==-1&&(a=e.length);var L=e.slice(t,e.charAt(a-1)=="\r"?a-1:a),H=L.indexOf("\r");H!=-1?(r.push(L.slice(0,H)),t+=H+1):(r.push(L),t=a+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ut=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},bt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Rt=null;function nt(e){if(Rt!=null)return Rt;var t=_(e,c("span","x")),r=t.getBoundingClientRect(),n=g(t,0,1).getBoundingClientRect();return Rt=Math.abs(r.left-n.left)>1}var Kt={},St={};function an(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Kt[e]=t}function Ue(e,t){St[e]=t}function st(e){if(typeof e=="string"&&St.hasOwnProperty(e))e=St[e];else if(e&&typeof e.name=="string"&&St.hasOwnProperty(e.name)){var t=St[e.name];typeof t=="string"&&(t={name:t}),e=we(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return st("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return st("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ct(e,t){t=st(t);var r=Kt[t.name];if(!r)return ct(e,"text/plain");var n=r(e,t);if(Lt.hasOwnProperty(t.name)){var a=Lt[t.name];for(var L in a){if(!a.hasOwnProperty(L))continue;n.hasOwnProperty(L)&&(n["_"+L]=n[L]),n[L]=a[L]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var H in t.modeProps)n[H]=t.modeProps[H];return n}var Lt={};function Ft(e,t){var r=Lt.hasOwnProperty(e)?Lt[e]:Lt[e]={};y(t,r)}function Xt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var a=t[n];a instanceof Array&&(a=a.concat([])),r[n]=a}return r}function or(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Hr(e,t,r){return e.startState?e.startState(t,r):!0}var Gt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Gt.prototype.eol=function(){return this.pos>=this.string.length},Gt.prototype.sol=function(){return this.pos==this.lineStart},Gt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Gt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Gt.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Gt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Gt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Gt.prototype.skipToEnd=function(){this.pos=this.string.length},Gt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Gt.prototype.backUp=function(e){this.pos-=e},Gt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Gt.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Gt.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(H){return r?H.toLowerCase():H},a=this.string.substr(this.pos,e.length);if(n(a)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var L=this.string.slice(this.pos).match(e);return L&&L.index>0?null:(L&&t!==!1&&(this.pos+=L[0].length),L)}},Gt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Gt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Gt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Gt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function lt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var a=r.children[n],L=a.chunkSize();if(t<L){r=a;break}t-=L}return r.lines[t]}function Nn(e,t,r){var n=[],a=t.line;return e.iter(t.line,r.line+1,function(L){var H=L.text;a==r.line&&(H=H.slice(0,r.ch)),a==t.line&&(H=H.slice(t.ch)),n.push(H),++a}),n}function lr(e,t,r){var n=[];return e.iter(t,r,function(a){n.push(a.text)}),n}function dn(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function At(e){if(e.parent==null)return null;for(var t=e.parent,r=Q(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var a=0;!(n.children[a]==t);++a)r+=n.children[a].chunkSize();return r+t.first}function Ln(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var a=e.children[n],L=a.height;if(t<L){e=a;continue e}t-=L,r+=a.chunkSize()}return r}while(!e.lines);for(var H=0;H<e.lines.length;++H){var z=e.lines[H],X=z.height;if(t<X)break;t-=X}return r+H}function pn(e,t){return t>=e.first&&t<e.first+e.size}function ur(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Fe(e,t,r){if(r===void 0&&(r=null),!(this instanceof Fe))return new Fe(e,t,r);this.line=e,this.ch=t,this.sticky=r}function gt(e,t){return e.line-t.line||e.ch-t.ch}function Sr(e,t){return e.sticky==t.sticky&&gt(e,t)==0}function dr(e){return Fe(e.line,e.ch)}function cr(e,t){return gt(e,t)<0?t:e}function Un(e,t){return gt(e,t)<0?e:t}function hr(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function vt(e,t){if(t.line<e.first)return Fe(e.first,0);var r=e.first+e.size-1;return t.line>r?Fe(r,lt(e,r).text.length):On(t,lt(e,t.line).text.length)}function On(e,t){var r=e.ch;return r==null||r>t?Fe(e.line,t):r<0?Fe(e.line,0):e}function He(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=vt(e,t[n]);return r}var fr=function(e,t){this.state=e,this.lookAhead=t},vn=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};vn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vn.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}},vn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vn.fromSaved=function(e,t,r){return t instanceof fr?new vn(e,Xt(e.mode,t.state),r,t.lookAhead):new vn(e,Xt(e.mode,t),r)},vn.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fr(t,this.maxLookAhead):t};function _n(e,t,r,n){var a=[e.state.modeGen],L={};Dn(e,t.text,e.doc.mode,r,function(Y,se){return a.push(Y,se)},L,n);for(var H=r.state,z=function(Y){r.baseTokens=a;var se=e.state.overlays[Y],ce=1,Te=0;r.state=!0,Dn(e,t.text,se.mode,r,function(be,Ie){for(var Ne=ce;Te<be;){var Ge=a[ce];Ge>be&&a.splice(ce,1,be,a[ce+1],Ge),ce+=2,Te=Math.min(be,Ge)}if(!Ie)return;if(se.opaque)a.splice(Ne,ce-Ne,be,"overlay "+Ie),ce=Ne+2;else for(;Ne<ce;Ne+=2){var Qe=a[Ne+1];a[Ne+1]=(Qe?Qe+" ":"")+"overlay "+Ie}},L),r.state=H,r.baseTokens=null,r.baseTokenPos=1},X=0;X<e.state.overlays.length;++X)z(X);return{styles:a,classes:L.bgClass||L.textClass?L:null}}function Vn(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=In(e,At(t)),a=t.text.length>e.options.maxHighlightLength&&Xt(e.doc.mode,n.state),L=_n(e,t,n);a&&(n.state=a),t.stateAfter=n.save(!a),t.styles=L.styles,L.classes?t.styleClasses=L.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function In(e,t,r){var n=e.doc,a=e.display;if(!n.mode.startState)return new vn(n,!0,t);var L=Bn(e,t,r),H=L>n.first&&lt(n,L-1).stateAfter,z=H?vn.fromSaved(n,H,L):new vn(n,Hr(n.mode),L);return n.iter(L,t,function(X){pr(e,X.text,z);var Y=z.line;X.stateAfter=Y==t-1||Y%5==0||Y>=a.viewFrom&&Y<a.viewTo?z.save():null,z.nextLine()}),r&&(n.modeFrontier=z.line),z}function pr(e,t,r,n){var a=e.doc.mode,L=new Gt(t,e.options.tabSize,r);for(L.start=L.pos=n||0,t==""&&Or(a,r.state);!L.eol();)Rn(a,L,r.state),L.start=L.pos}function Or(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=or(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function Rn(e,t,r,n){for(var a=0;a<10;a++){n&&(n[0]=or(e,r).mode);var L=e.token(t,r);if(t.pos>t.start)return L}throw new Error("Mode "+e.name+" failed to advance stream.")}var Rr=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Ar(e,t,r,n){var a=e.doc,L=a.mode,H;t=vt(a,t);var z=lt(a,t.line),X=In(e,t.line,r),Y=new Gt(z.text,e.options.tabSize,X),se;for(n&&(se=[]);(n||Y.pos<t.ch)&&!Y.eol();)Y.start=Y.pos,H=Rn(L,Y,X.state),n&&se.push(new Rr(Y,H,Xt(a.mode,X.state)));return n?se:new Rr(Y,H,X.state)}function mr(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Dn(e,t,r,n,a,L,H){var z=r.flattenSpans;z==null&&(z=e.options.flattenSpans);var X=0,Y=null,se=new Gt(t,e.options.tabSize,n),ce,Te=e.options.addModeClass&&[null];for(t==""&&mr(Or(r,n.state),L);!se.eol();){if(se.pos>e.options.maxHighlightLength?(z=!1,H&&pr(e,t,n,se.pos),se.pos=t.length,ce=null):ce=mr(Rn(r,se,n.state,Te),L),Te){var be=Te[0].name;be&&(ce="m-"+(ce?be+" "+ce:be))}if(!z||Y!=ce){for(;X<se.start;)X=Math.min(se.start,X+5e3),a(X,Y);Y=ce}se.start=se.pos}for(;X<se.pos;){var Ie=Math.min(se.pos,X+5e3);a(Ie,Y),X=Ie}}function Bn(e,t,r){for(var n,a,L=e.doc,H=r?-1:t-(e.doc.mode.innerMode?1e3:100),z=t;z>H;--z){if(z<=L.first)return L.first;var X=lt(L,z-1),Y=X.stateAfter;if(Y&&(!r||z+(Y instanceof fr?Y.lookAhead:0)<=L.modeFrontier))return z;var se=j(X.text,null,e.options.tabSize);(a==null||n>se)&&(a=z-1,n=se)}return a}function li(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var a=lt(e,n).stateAfter;if(a&&(!(a instanceof fr)||n+a.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Zn=!1,sn=!1;function jn(){Zn=!0}function ui(){sn=!0}function Hn(e,t,r){this.marker=e,this.from=t,this.to=r}function Ye(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Tt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Wt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function pt(e,t,r){var n;if(e)for(var a=0;a<e.length;++a){var L=e[a],H=L.marker,z=L.from==null||(H.inclusiveLeft?L.from<=t:L.from<t);if(z||L.from==t&&H.type=="bookmark"&&(!r||!L.marker.insertLeft)){var X=L.to==null||(H.inclusiveRight?L.to>=t:L.to>t);(n||(n=[])).push(new Hn(H,L.from,X?null:L.to))}}return n}function kt(e,t,r){var n;if(e)for(var a=0;a<e.length;++a){var L=e[a],H=L.marker,z=L.to==null||(H.inclusiveRight?L.to>=t:L.to>t);if(z||L.from==t&&H.type=="bookmark"&&(!r||L.marker.insertLeft)){var X=L.from==null||(H.inclusiveLeft?L.from<=t:L.from<t);(n||(n=[])).push(new Hn(H,X?null:L.from-t,L.to==null?null:L.to-t))}}return n}function Mt(e,t){if(t.full)return null;var r=pn(e,t.from.line)&&lt(e,t.from.line).markedSpans,n=pn(e,t.to.line)&&lt(e,t.to.line).markedSpans;if(!r&&!n)return null;var a=t.from.ch,L=t.to.ch,H=gt(t.from,t.to)==0,z=pt(r,a,H),X=kt(n,L,H),Y=t.text.length==1,se=$(t.text).length+(Y?a:0);if(z)for(var ce=0;ce<z.length;++ce){var Te=z[ce];if(Te.to==null){var be=Ye(X,Te.marker);be?Y&&(Te.to=be.to==null?null:be.to+se):Te.to=a}}if(X)for(var Ie=0;Ie<X.length;++Ie){var Ne=X[Ie];if(Ne.to!=null&&(Ne.to+=se),Ne.from==null){var Ge=Ye(z,Ne.marker);Ge||(Ne.from=se,Y&&(z||(z=[])).push(Ne))}else Ne.from+=se,Y&&(z||(z=[])).push(Ne)}z&&(z=Nt(z)),X&&X!=z&&(X=Nt(X));var Qe=[z];if(!Y){var tt=t.text.length-2,Ze;if(tt>0&&z)for(var at=0;at<z.length;++at)z[at].to==null&&(Ze||(Ze=[])).push(new Hn(z[at].marker,null,null));for(var mt=0;mt<tt;++mt)Qe.push(Ze);Qe.push(X)}return Qe}function Nt(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Bt(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(be){if(be.markedSpans)for(var Ie=0;Ie<be.markedSpans.length;++Ie){var Ne=be.markedSpans[Ie].marker;Ne.readOnly&&(!n||Q(n,Ne)==-1)&&(n||(n=[])).push(Ne)}}),!n)return null;for(var a=[{from:t,to:r}],L=0;L<n.length;++L)for(var H=n[L],z=H.find(0),X=0;X<a.length;++X){var Y=a[X];if(gt(Y.to,z.from)<0||gt(Y.from,z.to)>0)continue;var se=[X,1],ce=gt(Y.from,z.from),Te=gt(Y.to,z.to);(ce<0||!H.inclusiveLeft&&!ce)&&se.push({from:Y.from,to:z.from}),(Te>0||!H.inclusiveRight&&!Te)&&se.push({from:z.to,to:Y.to}),a.splice.apply(a,se),X+=se.length-3}return a}function qn(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function on(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function Xn(e){return e.inclusiveLeft?-1:0}function Cr(e){return e.inclusiveRight?1:0}function Wr(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),a=t.find(),L=gt(n.from,a.from)||Xn(e)-Xn(t);if(L)return-L;var H=gt(n.to,a.to)||Cr(e)-Cr(t);return H||t.id-e.id}function er(e,t){var r=sn&&e.markedSpans,n;if(r)for(var a=void 0,L=0;L<r.length;++L)a=r[L],a.marker.collapsed&&(t?a.from:a.to)==null&&(!n||Wr(n,a.marker)<0)&&(n=a.marker);return n}function tr(e){return er(e,!0)}function nr(e){return er(e,!1)}function Kr(e,t){var r=sn&&e.markedSpans,n;if(r)for(var a=0;a<r.length;++a){var L=r[a];L.marker.collapsed&&(L.from==null||L.from<t)&&(L.to==null||L.to>t)&&(!n||Wr(n,L.marker)<0)&&(n=L.marker)}return n}function Fi(e,t,r,n,a){var L=lt(e,t),H=sn&&L.markedSpans;if(H)for(var z=0;z<H.length;++z){var X=H[z];if(!X.marker.collapsed)continue;var Y=X.marker.find(0),se=gt(Y.from,r)||Xn(X.marker)-Xn(a),ce=gt(Y.to,n)||Cr(X.marker)-Cr(a);if(se>=0&&ce<=0||se<=0&&ce>=0)continue;if(se<=0&&(X.marker.inclusiveRight&&a.inclusiveLeft?gt(Y.to,r)>=0:gt(Y.to,r)>0)||se>=0&&(X.marker.inclusiveRight&&a.inclusiveLeft?gt(Y.from,n)<=0:gt(Y.from,n)<0))return!0}}function Pn(e){for(var t;t=tr(e);)e=t.find(-1,!0).line;return e}function Bi(e){for(var t;t=nr(e);)e=t.find(1,!0).line;return e}function Gr(e){for(var t,r;t=nr(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function di(e,t){var r=lt(e,t),n=Pn(r);return r==n?t:At(n)}function gr(e,t){if(t>e.lastLine())return t;var r=lt(e,t),n;if(!Yn(e,r))return t;for(;n=nr(r);)r=n.find(1,!0).line;return At(r)+1}function Yn(e,t){var r=sn&&t.markedSpans;if(r)for(var n=void 0,a=0;a<r.length;++a){if(n=r[a],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&ci(e,t,n))return!0}}function ci(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return ci(e,n.line,Ye(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var a=void 0,L=0;L<t.markedSpans.length;++L)if(a=t.markedSpans[L],a.marker.collapsed&&!a.marker.widgetNode&&a.from==r.to&&(a.to==null||a.to!=r.from)&&(a.marker.inclusiveLeft||r.marker.inclusiveRight)&&ci(e,t,a))return!0}function Wn(e){e=Pn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var a=r.lines[n];if(a==e)break;t+=a.height}for(var L=r.parent;L;r=L,L=r.parent)for(var H=0;H<L.children.length;++H){var z=L.children[H];if(z==r)break;t+=z.height}return t}function hi(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=tr(n);){var a=r.find(0,!0);n=a.from.line,t+=a.from.ch-a.to.ch}for(n=e;r=nr(n);){var L=r.find(0,!0);t-=n.text.length-L.from.ch,n=L.to.line,t+=n.text.length-L.to.ch}return t}function ji(e){var t=e.display,r=e.doc;t.maxLine=lt(r,r.first),t.maxLineLength=hi(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var a=hi(n);a>t.maxLineLength&&(t.maxLineLength=a,t.maxLine=n)})}var Lr=function(e,t,r){this.text=e,on(this,t),this.height=r?r(this):1};Lr.prototype.lineNo=function(){return At(this)},ue(Lr);function ua(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),qn(e),on(e,r);var a=n?n(e):1;a!=e.height&&dn(e,a)}function dt(e){e.parent=null,qn(e)}var yt={},ft={};function xt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?ft:yt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function It(e,t){var r=u("span",null,null,P?"padding-right: .1px":null),n={pre:u("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var L=a?t.rest[a-1]:t.line,H=void 0;n.pos=0,n.addToken=Ct,Ot(e.display.measure)&&(H=Xe(L,e.doc.direction))&&(n.addToken=yn(n.addToken,H)),n.map=[];var z=t!=e.display.externalMeasured&&At(L);rr(L,n,Vn(e,L,z)),L.styleClasses&&(L.styleClasses.bgClass&&(n.bgClass=F(L.styleClasses.bgClass,n.bgClass||"")),L.styleClasses.textClass&&(n.textClass=F(L.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(it(e.display.measure))),a==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(P){var X=n.content.lastChild;(/\bcm-tab\b/.test(X.className)||X.querySelector&&X.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Se(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function jt(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 Ct(e,t,r,n,a,L,H){if(!t)return;var z=e.splitSpaces?Zt(t,e.trailingSpace):t,X=e.cm.state.specialChars,Y=!1,se;if(!X.test(t))e.col+=t.length,se=document.createTextNode(z),e.map.push(e.pos,e.pos+t.length,se),W&&B<9&&(Y=!0),e.pos+=t.length;else{se=document.createDocumentFragment();for(var ce=0;;){X.lastIndex=ce;var Te=X.exec(t),be=Te?Te.index-ce:t.length-ce;if(be){var Ie=document.createTextNode(z.slice(ce,ce+be));W&&B<9?se.appendChild(c("span",[Ie])):se.appendChild(Ie),e.map.push(e.pos,e.pos+be,Ie),e.col+=be,e.pos+=be}if(!Te)break;ce+=be+1;var Ne=void 0;if(Te[0]==" "){var Ge=e.cm.options.tabSize,Qe=Ge-e.col%Ge;Ne=se.appendChild(c("span",he(Qe),"cm-tab")),Ne.setAttribute("role","presentation"),Ne.setAttribute("cm-text"," "),e.col+=Qe}else Te[0]=="\r"||Te[0]==`
`?(Ne=se.appendChild(c("span",Te[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ne.setAttribute("cm-text",Te[0]),e.col+=1):(Ne=e.cm.options.specialCharPlaceholder(Te[0]),Ne.setAttribute("cm-text",Te[0]),W&&B<9?se.appendChild(c("span",[Ne])):se.appendChild(Ne),e.col+=1);e.map.push(e.pos,e.pos+1,Ne),e.pos++}}if(e.trailingSpace=z.charCodeAt(t.length-1)==32,r||n||a||Y||L||H){var tt=r||"";n&&(tt+=n),a&&(tt+=a);var Ze=c("span",[se],tt,L);if(H)for(var at in H)H.hasOwnProperty(at)&&at!="style"&&at!="class"&&Ze.setAttribute(at,H[at]);return e.content.appendChild(Ze)}e.content.appendChild(se)}function Zt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",a=0;a<e.length;a++){var L=e.charAt(a);L==" "&&r&&(a==e.length-1||e.charCodeAt(a+1)==32)&&(L="\xA0"),n+=L,r=L==" "}return n}function yn(e,t){return function(r,n,a,L,H,z,X){a=a?a+" cm-force-border":"cm-force-border";for(var Y=r.pos,se=Y+n.length;;){for(var ce=void 0,Te=0;Te<t.length&&!(ce=t[Te],ce.to>Y&&ce.from<=Y);Te++);if(ce.to>=se)return e(r,n,a,L,H,z,X);e(r,n.slice(0,ce.to-Y),a,L,null,z,X),L=null,n=n.slice(ce.to-Y),Y=ce.to}}}function wt(e,t,r,n){var a=!n&&r.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!n&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",r.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,a=e.text,L=0;if(!n){for(var H=1;H<r.length;H+=2)t.addToken(t,a.slice(L,L=r[H]),xt(r[H+1],t.cm.options));return}for(var z=a.length,X=0,Y=1,se="",ce,Te,be=0,Ie,Ne,Ge,Qe,tt;;){if(be==X){Ie=Ne=Ge=Te="",tt=null,Qe=null,be=Infinity;for(var Ze=[],at=void 0,mt=0;mt<n.length;++mt){var ht=n[mt],Et=ht.marker;if(Et.type=="bookmark"&&ht.from==X&&Et.widgetNode)Ze.push(Et);else if(ht.from<=X&&(ht.to==null||ht.to>X||Et.collapsed&&ht.to==X&&ht.from==X)){if(ht.to!=null&&ht.to!=X&&be>ht.to&&(be=ht.to,Ne=""),Et.className&&(Ie+=" "+Et.className),Et.css&&(Te=(Te?Te+";":"")+Et.css),Et.startStyle&&ht.from==X&&(Ge+=" "+Et.startStyle),Et.endStyle&&ht.to==be&&(at||(at=[])).push(Et.endStyle,ht.to),Et.title&&((tt||(tt={})).title=Et.title),Et.attributes)for(var Ht in Et.attributes)(tt||(tt={}))[Ht]=Et.attributes[Ht];Et.collapsed&&(!Qe||Wr(Qe.marker,Et)<0)&&(Qe=ht)}else ht.from>X&&be>ht.from&&(be=ht.from)}if(at)for(var nn=0;nn<at.length;nn+=2)at[nn+1]==be&&(Ne+=" "+at[nn]);if(!Qe||Qe.from==X)for(var Vt=0;Vt<Ze.length;++Vt)wt(t,0,Ze[Vt]);if(Qe&&(Qe.from||0)==X){if(wt(t,(Qe.to==null?z+1:Qe.to)-X,Qe.marker,Qe.from==null),Qe.to==null)return;Qe.to==X&&(Qe=!1)}}if(X>=z)break;for(var Cn=Math.min(z,be);;){if(se){var xn=X+se.length;if(!Qe){var Jt=xn>Cn?se.slice(0,Cn-X):se;t.addToken(t,Jt,ce?ce+Ie:Ie,Ge,X+Jt.length==be?Ne:"",Te,tt)}if(xn>=Cn){se=se.slice(Cn-X),X=Cn;break}X=xn,Ge=""}se=a.slice(L,L=r[Y++]),ce=xt(r[Y++],t.cm.options)}}}function Dt(e,t,r){this.line=t,this.rest=Gr(t),this.size=this.rest?At($(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Yn(e,t)}function bn(e,t,r){for(var n=[],a,L=t;L<r;L=a){var H=new Dt(e.doc,lt(e.doc,L),L);a=L+H.size,n.push(H)}return n}var cn=null;function Fn(e){cn?cn.ops.push(e):e.ownsGroup=cn={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var a=e.ops[n];if(a.cursorActivityHandlers)for(;a.cursorActivityCalled<a.cursorActivityHandlers.length;)a.cursorActivityHandlers[a.cursorActivityCalled++].call(null,a.cm)}}while(r<t.length)}function Io(e,t){var r=e.ownsGroup;if(!r)return;try{Lo(r)}finally{cn=null,t(r)}}var fi=null;function ln(e,t){var r=qe(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),a;cn?a=cn.delayedCallbacks:fi?a=fi:(a=fi=[],setTimeout(Do,0));for(var L=function(z){a.push(function(){return r[z].apply(null,n)})},H=0;H<r.length;++H)L(H)}function Do(){var e=fi;fi=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,r,n){for(var a=0;a<t.changes.length;a++){var L=t.changes[a];L=="text"?ko(e,t):L=="gutter"?Ja(e,t,r,n):L=="class"?da(e,t):L=="widget"&&Mo(e,t,n)}t.changes=null}function pi(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),W&&B<8&&(e.node.style.zIndex=2)),e.node}function Po(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=pi(t);t.background=n.insertBefore(c("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):It(e,t)}function ko(e,t){var r=t.text.className,n=$a(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,da(e,t)):r&&(t.text.className=r)}function da(e,t){Po(e,t),t.line.wrapClass?pi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ja(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=pi(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),a.insertBefore(t.gutterBackground,t.text)}var L=t.line.gutterMarkers;if(e.options.lineNumbers||L){var H=pi(t),z=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(z),H.insertBefore(z,t.text),t.line.gutterClass&&(z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!L||!L["CodeMirror-linenumbers"])&&(t.lineNumber=z.appendChild(c("div",ur(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),L)for(var X=0;X<e.display.gutterSpecs.length;++X){var Y=e.display.gutterSpecs[X].className,se=L.hasOwnProperty(Y)&&L[Y];se&&z.appendChild(c("div",[se],"CodeMirror-gutter-elt","left: "+n.gutterLeft[Y]+"px; width: "+n.gutterWidth[Y]+"px"))}}}function Mo(e,t,r){t.alignable&&(t.alignable=null);for(var n=S("CodeMirror-linewidget"),a=t.node.firstChild,L=void 0;a;a=L)L=a.nextSibling,n.test(a.className)&&t.node.removeChild(a);Qa(e,t,r)}function No(e,t,r,n){var a=$a(e,t);return t.text=t.node=a.pre,a.bgClass&&(t.bgClass=a.bgClass),a.textClass&&(t.textClass=a.textClass),da(e,t),Ja(e,t,r,n),Qa(e,t,n),t.node}function Qa(e,t,r){if(Za(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Za(e,t.rest[n],t,r,!1)}function Za(e,t,r,n,a){if(!t.widgets)return;for(var L=pi(r),H=0,z=t.widgets;H<z.length;++H){var X=z[H],Y=c("div",[X.node],"CodeMirror-linewidget"+(X.className?" "+X.className:""));X.handleMouseEvents||Y.setAttribute("cm-ignore-events","true"),Uo(X,Y,r,n),e.display.input.setUneditable(Y),a&&X.above?L.insertBefore(Y,r.gutter||r.text):L.appendChild(Y),ln(X,"redraw")}}function Uo(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var a=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(a-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=a+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function mi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),_(t.display.measure,c("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function ir(e,t){for(var r=ge(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Hi(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=_(e.measure,c("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function $n(e){return te-e.display.nativeBarWidth}function Ir(e){return e.display.scroller.clientWidth-$n(e)-e.display.barWidth}function ha(e){return e.display.scroller.clientHeight-$n(e)-e.display.barHeight}function Fo(e,t,r){var n=e.options.lineWrapping,a=n&&Ir(e);if(!t.measure.heights||n&&t.measure.width!=a){var L=t.measure.heights=[];if(n){t.measure.width=a;for(var H=t.text.firstChild.getClientRects(),z=0;z<H.length-1;z++){var X=H[z],Y=H[z+1];Math.abs(X.bottom-Y.bottom)>2&&L.push((X.bottom+Y.top)/2-r.top)}}L.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var a=0;a<e.rest.length;a++)if(At(e.rest[a])>r)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}function Bo(e,t){t=Pn(t);var r=At(t),n=e.display.externalMeasured=new Dt(e.doc,t,r);n.lineN=r;var a=n.built=It(e,n);return n.text=a.pre,_(e.display.lineMeasure,a.pre),n}function ts(e,t,r,n){return Jn(e,zr(e,t),r,n)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[kr(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function zr(e,t){var r=At(t),n=fa(e,r);n&&!n.text?n=null:n&&n.changes&&(Ya(e,n,r,ya(e)),e.curOp.forceUpdate=!0),n||(n=Bo(e,t));var a=es(n,t,r);return{line:t,view:n,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function Jn(e,t,r,n,a){t.before&&(r=-1);var L=r+(n||""),H;return t.cache.hasOwnProperty(L)?H=t.cache[L]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Fo(e,t.view,t.rect),t.hasHeights=!0),H=Ho(e,t,r,n),H.bogus||(t.cache[L]=H)),{left:H.left,right:H.right,top:a?H.rtop:H.top,bottom:a?H.rbottom:H.bottom}}var ns={left:0,right:0,top:0,bottom:0};function rs(e,t,r){for(var n,a,L,H,z,X,Y=0;Y<e.length;Y+=3)if(z=e[Y],X=e[Y+1],t<z?(a=0,L=1,H="left"):t<X?(a=t-z,L=a+1):(Y==e.length-3||t==X&&e[Y+3]>t)&&(L=X-z,a=L-1,t>=X&&(H="right")),a!=null){if(n=e[Y+2],z==X&&r==(n.insertLeft?"left":"right")&&(H=r),r=="left"&&a==0)for(;Y&&e[Y-2]==e[Y-3]&&e[Y-1].insertLeft;)n=e[(Y-=3)+2],H="left";if(r=="right"&&a==X-z)for(;Y<e.length-3&&e[Y+3]==e[Y+4]&&!e[Y+5].insertLeft;)n=e[(Y+=3)+2],H="right";break}return{node:n,start:a,end:L,collapse:H,coverStart:z,coverEnd:X}}function jo(e,t){var r=ns;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var a=e.length-1;a>=0&&!((r=e[a]).left!=r.right);a--);return r}function Ho(e,t,r,n){var a=rs(t.map,r,n),L=a.node,H=a.start,z=a.end,X=a.collapse,Y;if(L.nodeType==3){for(var se=0;se<4;se++){for(;H&&Ae(t.line.text.charAt(a.coverStart+H));)--H;for(;a.coverStart+z<a.coverEnd&&Ae(t.line.text.charAt(a.coverStart+z));)++z;if(W&&B<9&&H==0&&z==a.coverEnd-a.coverStart?Y=L.parentNode.getBoundingClientRect():Y=jo(g(L,H,z).getClientRects(),n),Y.left||Y.right||H==0)break;z=H,H=H-1,X="right"}W&&B<11&&(Y=Wo(e.display.measure,Y))}else{H>0&&(X=n="right");var ce;e.options.lineWrapping&&(ce=L.getClientRects()).length>1?Y=ce[n=="right"?ce.length-1:0]:Y=L.getBoundingClientRect()}if(W&&B<9&&!H&&(!Y||!Y.left&&!Y.right)){var Te=L.parentNode.getClientRects()[0];Te?Y={left:Te.left,right:Te.left+Xr(e.display),top:Te.top,bottom:Te.bottom}:Y=ns}for(var be=Y.top-t.rect.top,Ie=Y.bottom-t.rect.top,Ne=(be+Ie)/2,Ge=t.view.measure.heights,Qe=0;Qe<Ge.length-1&&!(Ne<Ge[Qe]);Qe++);var tt=Qe?Ge[Qe-1]:0,Ze=Ge[Qe],at={left:(X=="right"?Y.right:Y.left)-t.rect.left,right:(X=="left"?Y.left:Y.right)-t.rect.left,top:tt,bottom:Ze};return!Y.left&&!Y.right&&(at.bogus=!0),e.options.singleCursorHeightPerLine||(at.rtop=be,at.rbottom=Ie),at}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!nt(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function is(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 as(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)is(e.display.view[t])}function gi(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return v&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return v&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=mi(e.widgets[r]));return t}function Wi(e,t,r,n,a){if(!a){var L=pa(t);r.top+=L,r.bottom+=L}if(n=="line")return r;n||(n="local");var H=Wn(t);if(n=="local"?H+=Hi(e.display):H-=e.display.viewOffset,n=="page"||n=="window"){var z=e.display.lineSpace.getBoundingClientRect();H+=z.top+(n=="window"?0:os());var X=z.left+(n=="window"?0:ss());r.left+=X,r.right+=X}return r.top+=H,r.bottom+=H,r}function ls(e,t,r){if(r=="div")return t;var n=t.left,a=t.top;if(r=="page")n-=ss(),a-=os();else if(r=="local"||!r){var L=e.display.sizer.getBoundingClientRect();n+=L.left,a+=L.top}var H=e.display.lineSpace.getBoundingClientRect();return{left:n-H.left,top:a-H.top}}function ma(e,t,r,n,a){return n||(n=lt(e.doc,t.line)),Wi(e,n,ts(e,n,t.ch,a),r)}function Kn(e,t,r,n,a,L){n=n||lt(e.doc,t.line),a||(a=zr(e,n));function H(Ie,Ne){var Ge=Jn(e,a,Ie,Ne?"right":"left",L);return Ne?Ge.left=Ge.right:Ge.right=Ge.left,Wi(e,n,Ge,r)}var z=Xe(n,e.doc.direction),X=t.ch,Y=t.sticky;if(X>=n.text.length?(X=n.text.length,Y="before"):X<=0&&(X=0,Y="after"),!z)return H(Y=="before"?X-1:X,Y=="before");function se(Ie,Ne,Ge){var Qe=z[Ne],tt=Qe.level==1;return H(Ge?Ie-1:Ie,tt!=Ge)}var ce=je(z,X,Y),Te=ze,be=se(X,ce,Y=="before");return Te!=null&&(be.other=se(X,Te,Y!="before")),be}function us(e,t){var r=0;t=vt(e.doc,t),e.options.lineWrapping||(r=Xr(e.display)*t.ch);var n=lt(e.doc,t.line),a=Wn(n)+Hi(e.display);return{left:r,right:r,top:a,bottom:a+n.height}}function ga(e,t,r,n,a){var L=Fe(e,t,r);return L.xRel=a,n&&(L.outside=n),L}function va(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return ga(n.first,0,null,-1,-1);var a=Ln(n,r),L=n.first+n.size-1;if(a>L)return ga(n.first+n.size-1,lt(n,L).text.length,null,1,1);t<0&&(t=0);for(var H=lt(n,a);;){var z=Ko(e,H,a,t,r),X=Kr(H,z.ch+(z.xRel>0||z.outside>0?1:0));if(!X)return z;var Y=X.find(1);if(Y.line==a)return Y;H=lt(n,a=Y.line)}}function ds(e,t,r,n){n-=pa(t);var a=t.text.length,L=Be(function(H){return Jn(e,r,H-1).bottom<=n},a,0);return a=Be(function(H){return Jn(e,r,H).top>n},L,a),{begin:L,end:a}}function cs(e,t,r,n){r||(r=zr(e,t));var a=Wi(e,t,Jn(e,r,n),"line").top;return ds(e,t,r,a)}function _a(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Ko(e,t,r,n,a){a-=Wn(t);var L=zr(e,t),H=pa(t),z=0,X=t.text.length,Y=!0,se=Xe(t,e.doc.direction);if(se){var ce=(e.options.lineWrapping?zo:Go)(e,t,r,L,se,n,a);Y=ce.level!=1,z=Y?ce.from:ce.to-1,X=Y?ce.to:ce.from-1}var Te=null,be=null,Ie=Be(function(mt){var ht=Jn(e,L,mt);return ht.top+=H,ht.bottom+=H,_a(ht,n,a,!1)?(ht.top<=a&&ht.left<=n&&(Te=mt,be=ht),!0):!1},z,X),Ne,Ge,Qe=!1;if(be){var tt=n-be.left<be.right-n,Ze=tt==Y;Ie=Te+(Ze?0:1),Ge=Ze?"after":"before",Ne=tt?be.left:be.right}else{!Y&&(Ie==X||Ie==z)&&Ie++,Ge=Ie==0?"after":Ie==t.text.length?"before":Jn(e,L,Ie-(Y?1:0)).bottom+H<=a==Y?"after":"before";var at=Kn(e,Fe(r,Ie,Ge),"line",t,L);Ne=at.left,Qe=a<at.top?-1:a>=at.bottom?1:0}return Ie=Oe(t.text,Ie,1),ga(r,Ie,Ge,Qe,n-Ne)}function Go(e,t,r,n,a,L,H){var z=Be(function(ce){var Te=a[ce],be=Te.level!=1;return _a(Kn(e,Fe(r,be?Te.to:Te.from,be?"before":"after"),"line",t,n),L,H,!0)},0,a.length-1),X=a[z];if(z>0){var Y=X.level!=1,se=Kn(e,Fe(r,Y?X.from:X.to,Y?"after":"before"),"line",t,n);_a(se,L,H,!0)&&se.top>H&&(X=a[z-1])}return X}function zo(e,t,r,n,a,L,H){var z=ds(e,t,n,H),X=z.begin,Y=z.end;/\s/.test(t.text.charAt(Y-1))&&Y--;for(var se=null,ce=null,Te=0;Te<a.length;Te++){var be=a[Te];if(be.from>=Y||be.to<=X)continue;var Ie=be.level!=1,Ne=Jn(e,n,Ie?Math.min(Y,be.to)-1:Math.max(X,be.from)).right,Ge=Ne<L?L-Ne+1e9:Ne-L;(!se||ce>Ge)&&(se=be,ce=Ge)}return se||(se=a[a.length-1]),se.from<X&&(se={from:X,to:se.to,level:se.level}),se.to>Y&&(se={from:se.from,to:Y,level:se.level}),se}var Dr;function Vr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Dr==null){Dr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dr.appendChild(document.createTextNode("x")),Dr.appendChild(c("br"));Dr.appendChild(document.createTextNode("x"))}_(e.measure,Dr);var r=Dr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),E(e.measure),r||1}function Xr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),r=c("pre",[t],"CodeMirror-line-like");_(e.measure,r);var n=t.getBoundingClientRect(),a=(n.right-n.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function ya(e){for(var t=e.display,r={},n={},a=t.gutters.clientLeft,L=t.gutters.firstChild,H=0;L;L=L.nextSibling,++H){var z=e.display.gutterSpecs[H].className;r[z]=L.offsetLeft+L.clientLeft+a,n[z]=L.clientWidth}return{fixedPos:ba(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function hs(e){var t=Vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Xr(e.display)-3);return function(a){if(Yn(e.doc,a))return 0;var L=0;if(a.widgets)for(var H=0;H<a.widgets.length;H++)a.widgets[H].height&&(L+=a.widgets[H].height);return r?L+(Math.ceil(a.text.length/n)||1)*t:L+t}}function Ea(e){var t=e.doc,r=hs(e);t.iter(function(n){var a=r(n);a!=n.height&&dn(n,a)})}function Pr(e,t,r,n){var a=e.display;if(!r&&ge(t).getAttribute("cm-not-content")=="true")return null;var L,H,z=a.lineSpace.getBoundingClientRect();try{L=t.clientX-z.left,H=t.clientY-z.top}catch(ce){return null}var X=va(e,L,H),Y;if(n&&X.xRel>0&&(Y=lt(e.doc,X.line).text).length==X.ch){var se=j(Y,Y.length,e.options.tabSize)-Y.length;X=Fe(X.line,Math.max(0,Math.round((L-qa(e.display).left)/Xr(e.display))-se))}return X}function kr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function En(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var a=e.display;if(n&&r<a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>t)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)sn&&di(e.doc,t)<a.viewTo&&_r(e);else if(r<=a.viewFrom)sn&&gr(e.doc,r+n)>a.viewFrom?_r(e):(a.viewFrom+=n,a.viewTo+=n);else if(t<=a.viewFrom&&r>=a.viewTo)_r(e);else if(t<=a.viewFrom){var L=Ki(e,r,r+n,1);L?(a.view=a.view.slice(L.index),a.viewFrom=L.lineN,a.viewTo+=n):_r(e)}else if(r>=a.viewTo){var H=Ki(e,t,t,-1);H?(a.view=a.view.slice(0,H.index),a.viewTo=H.lineN):_r(e)}else{var z=Ki(e,t,t,-1),X=Ki(e,r,r+n,1);z&&X?(a.view=a.view.slice(0,z.index).concat(bn(e,z.lineN,X.lineN)).concat(a.view.slice(X.index)),a.viewTo+=n):_r(e)}var Y=a.externalMeasured;Y&&(r<Y.lineN?Y.lineN+=n:t<Y.lineN+Y.size&&(a.externalMeasured=null))}function vr(e,t,r){e.curOp.viewChanged=!0;var n=e.display,a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var L=n.view[kr(e,t)];if(L.node==null)return;var H=L.changes||(L.changes=[]);Q(H,r)==-1&&H.push(r)}function _r(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ki(e,t,r,n){var a=kr(e,t),L,H=e.display.view;if(!sn||r==e.doc.first+e.doc.size)return{index:a,lineN:r};for(var z=e.display.viewFrom,X=0;X<a;X++)z+=H[X].size;if(z!=t){if(n>0){if(a==H.length-1)return null;L=z+H[a].size-t,a++}else L=z-t;t+=L,r+=L}for(;di(e.doc,r)!=r;){if(a==(n<0?0:H.length-1))return null;r+=n*H[a-(n<0?1:0)].size,a+=n}return{index:a,lineN:r}}function Vo(e,t,r){var n=e.display,a=n.view;a.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=bn(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=bn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(kr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(bn(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,kr(e,r)))),n.viewTo=r}function fs(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var a=t[n];!a.hidden&&(!a.node||a.changes)&&++r}return r}function vi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},a=n.cursors=document.createDocumentFragment(),L=n.selection=document.createDocumentFragment(),H=0;H<r.sel.ranges.length;H++){if(!t&&H==r.sel.primIndex)continue;var z=r.sel.ranges[H];if(z.from().line>=e.display.viewTo||z.to().line<e.display.viewFrom)continue;var X=z.empty();(X||e.options.showCursorWhenSelecting)&&ms(e,z.head,a),X||Xo(e,z,L)}return n}function ms(e,t,r){var n=Kn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),a=r.appendChild(c("div","\xA0","CodeMirror-cursor"));if(a.style.left=n.left+"px",a.style.top=n.top+"px",a.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var L=r.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));L.style.display="",L.style.left=n.other.left+"px",L.style.top=n.other.top+"px",L.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Gi(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,r){var n=e.display,a=e.doc,L=document.createDocumentFragment(),H=qa(e.display),z=H.left,X=Math.max(n.sizerWidth,Ir(e)-n.sizer.offsetLeft)-H.right,Y=a.direction=="ltr";function se(Ze,at,mt,ht){at<0&&(at=0),at=Math.round(at),ht=Math.round(ht),L.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+Ze+`px;
top: `+at+"px; width: "+(mt==null?X-Ze:mt)+`px;
height: `+(ht-at)+"px"))}function ce(Ze,at,mt){var ht=lt(a,Ze),Et=ht.text.length,Ht,nn;function Vt(Jt,wn){return ma(e,Fe(Ze,Jt),"div",ht,wn)}function Cn(Jt,wn,un){var qt=cs(e,ht,null,Jt),Qt=wn=="ltr"==(un=="after")?"left":"right",Yt=un=="after"?qt.begin:qt.end-(/\s/.test(ht.text.charAt(qt.end-1))?2:1);return Vt(Yt,Qt)[Qt]}var xn=Xe(ht,a.direction);return Ve(xn,at||0,mt==null?Et:mt,function(Jt,wn,un,qt){var Qt=un=="ltr",Yt=Vt(Jt,Qt?"left":"right"),Sn=Vt(wn-1,Qt?"right":"left"),si=at==null&&Jt==0,wr=mt==null&&wn==Et,fn=qt==0,Qn=!xn||qt==xn.length-1;if(Sn.top-Yt.top<=3){var rn=(Y?si:wr)&&fn,Va=(Y?wr:si)&&Qn,sr=rn?z:(Qt?Yt:Sn).left,Br=Va?X:(Qt?Sn:Yt).right;se(sr,Yt.top,Br-sr,Yt.bottom)}else{var jr,gn,oi,Xa;Qt?(jr=Y&&si&&fn?z:Yt.left,gn=Y?X:Cn(Jt,un,"before"),oi=Y?z:Cn(wn,un,"after"),Xa=Y&&wr&&Qn?X:Sn.right):(jr=Y?Cn(Jt,un,"before"):z,gn=!Y&&si&&fn?X:Yt.right,oi=!Y&&wr&&Qn?z:Sn.left,Xa=Y?Cn(wn,un,"after"):X),se(jr,Yt.top,gn-jr,Yt.bottom),Yt.bottom<Sn.top&&se(z,Yt.bottom,null,Sn.top),se(oi,Sn.top,Xa-oi,Sn.bottom)}(!Ht||Gi(Yt,Ht)<0)&&(Ht=Yt),Gi(Sn,Ht)<0&&(Ht=Sn),(!nn||Gi(Yt,nn)<0)&&(nn=Yt),Gi(Sn,nn)<0&&(nn=Sn)}),{start:Ht,end:nn}}var Te=t.from(),be=t.to();if(Te.line==be.line)ce(Te.line,Te.ch,be.ch);else{var Ie=lt(a,Te.line),Ne=lt(a,be.line),Ge=Pn(Ie)==Pn(Ne),Qe=ce(Te.line,Te.ch,Ge?Ie.text.length+1:null).end,tt=ce(be.line,Ge?0:null,be.ch).start;Ge&&(Qe.top<tt.top-2?(se(Qe.right,Qe.top,null,Qe.bottom),se(z,tt.top,tt.left,tt.bottom)):se(Qe.right,Qe.top,tt.left-Qe.right,Qe.bottom)),Qe.bottom<tt.top&&se(z,Qe.bottom,null,tt.top)}r.appendChild(L)}function Ta(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Yr(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),xa(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Yr(e))},100)}function xa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Se(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ta(e)}function Yr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Se(e,"blur",e,t),e.state.focused=!1,w(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zi(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var a=t.view[n],L=e.options.lineWrapping,H=void 0,z=0;if(a.hidden)continue;if(W&&B<8){var X=a.node.offsetTop+a.node.offsetHeight;H=X-r,r=X}else{var Y=a.node.getBoundingClientRect();H=Y.bottom-Y.top,!L&&a.text.firstChild&&(z=a.text.firstChild.getBoundingClientRect().right-Y.left-1)}var se=a.line.height-H;if((se>.005||se<-.005)&&(dn(a.line,H),_s(a.line),a.rest))for(var ce=0;ce<a.rest.length;ce++)_s(a.rest[ce]);if(z>e.display.sizerWidth){var Te=Math.ceil(z/Xr(e.display));Te>e.display.maxLineLength&&(e.display.maxLineLength=Te,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}function _s(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Vi(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Hi(e));var a=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,L=Ln(t,n),H=Ln(t,a);if(r&&r.ensure){var z=r.ensure.from.line,X=r.ensure.to.line;z<L?(L=z,H=Ln(t,Wn(lt(t,z))+e.wrapper.clientHeight)):Math.min(X,t.lastLine())>=H&&(L=Ln(t,Wn(lt(t,X))-e.wrapper.clientHeight),H=X)}return{from:L,to:Math.max(H,L+1)}}function Yo(e,t){if(Me(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),a=null;if(t.top+n.top<0?a=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),a!=null&&!s){var L=c("div","\u200B",null,`position: absolute;
top: `+(t.top-r.viewOffset-Hi(e.display))+`px;
height: `+(t.bottom-t.top+$n(e)+r.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(L),L.scrollIntoView(a),e.display.lineSpace.removeChild(L)}}function $o(e,t,r,n){n==null&&(n=0);var a;!e.options.lineWrapping&&t==r&&(t=t.ch?Fe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Fe(t.line,t.ch+1,"before"):t);for(var L=0;L<5;L++){var H=!1,z=Kn(e,t),X=!r||r==t?z:Kn(e,r);a={left:Math.min(z.left,X.left),top:Math.min(z.top,X.top)-n,right:Math.max(z.left,X.left),bottom:Math.max(z.bottom,X.bottom)+n};var Y=wa(e,a),se=e.doc.scrollTop,ce=e.doc.scrollLeft;if(Y.scrollTop!=null&&(yi(e,Y.scrollTop),Math.abs(e.doc.scrollTop-se)>1&&(H=!0)),Y.scrollLeft!=null&&(Mr(e,Y.scrollLeft),Math.abs(e.doc.scrollLeft-ce)>1&&(H=!0)),!H)break}return a}function Jo(e,t){var r=wa(e,t);r.scrollTop!=null&&yi(e,r.scrollTop),r.scrollLeft!=null&&Mr(e,r.scrollLeft)}function wa(e,t){var r=e.display,n=Vr(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,L=ha(e),H={};t.bottom-t.top>L&&(t.bottom=t.top+L);var z=e.doc.height+ca(r),X=t.top<n,Y=t.bottom>z-n;if(t.top<a)H.scrollTop=X?0:t.top;else if(t.bottom>a+L){var se=Math.min(t.top,(Y?z:t.bottom)-L);se!=a&&(H.scrollTop=se)}var ce=e.options.fixedGutter?0:r.gutters.offsetWidth,Te=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-ce,be=Ir(e)-r.gutters.offsetWidth,Ie=t.right-t.left>be;return Ie&&(t.right=t.left+be),t.left<10?H.scrollLeft=0:t.left<Te?H.scrollLeft=Math.max(0,t.left+ce-(Ie?0:10)):t.right>be+Te-3&&(H.scrollLeft=t.right+(Ie?0:10)-be),H}function Sa(e,t){if(t==null)return;Xi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function $r(e){Xi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _i(e,t,r){(t!=null||r!=null)&&Xi(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Qo(e,t){Xi(e),e.curOp.scrollToPos=t}function Xi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),n=us(e,t.to);ys(e,r,n,t.margin)}}function ys(e,t,r,n){var a=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});_i(e,a.scrollLeft,a.scrollTop)}function yi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||Ra(e,{top:t}),bs(e,t,!0),D&&Ra(e),Ti(e,100)}function bs(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Mr(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function bi(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+ca(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+$n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Nr=function(e,t,r){this.cm=r;var n=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=a.tabIndex=-1,e(n),e(a),Ce(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ce(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&B<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Nr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var a=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var L=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+L)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Nr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Nr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Nr.prototype.zeroWidthHack=function(){var e=o&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new K,this.disableVert=new K},Nr.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var a=e.getBoundingClientRect(),L=r=="vert"?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1);L!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Nr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ei=function(){};Ei.prototype.update=function(){return{bottom:0,right:0}},Ei.prototype.setScrollLeft=function(){},Ei.prototype.setScrollTop=function(){},Ei.prototype.clear=function(){};function Jr(e,t){t||(t=bi(e));var r=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var a=0;a<4&&r!=e.display.barWidth||n!=e.display.barHeight;a++)r!=e.display.barWidth&&e.options.lineWrapping&&zi(e),Es(e,bi(e)),r=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var Ts={native:Nr,null:Ei};function xs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&w(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ts[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ce(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Mr(e,t):yi(e,t)},e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function Ur(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:++Zo},Fn(e.curOp)}function Fr(e){var t=e.curOp;t&&Io(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;qo(r)})}function qo(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var a=0;a<t.length;a++)nl(t[a]);for(var L=0;L<t.length;L++)rl(t[L]);for(var H=0;H<t.length;H++)il(t[H])}function el(e){var t=e.cm,r=t.display;sl(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Oa(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&zi(t),e.barMeasure=bi(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+$n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ir(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Mr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==k();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Jr(t,e.barMeasure),e.updatedDisplay&&Ca(t,e.barMeasure),e.selectionChanged&&Ta(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&gs(e.cm)}function il(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&ws(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&bs(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Mr(t,e.scrollLeft,!0,!0),e.scrollToPos){var a=$o(t,vt(n,e.scrollToPos.from),vt(n,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,a)}var L=e.maybeHiddenMarkers,H=e.maybeUnhiddenMarkers;if(L)for(var z=0;z<L.length;++z)L[z].lines.length||Se(L[z],"hide");if(H)for(var X=0;X<H.length;++X)H[X].lines.length&&Se(H[X],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Se(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function An(e,t){if(e.curOp)return t();Ur(e);try{return t()}finally{Fr(e)}}function en(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ur(e);try{return t.apply(e,arguments)}finally{Fr(e)}}}function mn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ur(this);try{return e.apply(this,arguments)}finally{Fr(this)}}}function tn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ur(t);try{return e.apply(this,arguments)}finally{Fr(t)}}}function Ti(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,C(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=In(e,t.highlightFrontier),a=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(L){if(n.line>=e.display.viewFrom){var H=L.styles,z=L.text.length>e.options.maxHighlightLength?Xt(t.mode,n.state):null,X=_n(e,L,n,!0);z&&(n.state=z),L.styles=X.styles;var Y=L.styleClasses,se=X.classes;se?L.styleClasses=se:Y&&(L.styleClasses=null);for(var ce=!H||H.length!=L.styles.length||Y!=se&&(!Y||!se||Y.bgClass!=se.bgClass||Y.textClass!=se.textClass),Te=0;!ce&&Te<H.length;++Te)ce=H[Te]!=L.styles[Te];ce&&a.push(n.line),L.stateAfter=n.save(),n.nextLine()}else L.text.length<=e.options.maxHighlightLength&&pr(e,L.text,n),L.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return Ti(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),a.length&&An(e,function(){for(var L=0;L<a.length;L++)vr(e,a[L],"text")})}var Yi=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Vi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ir(e),this.force=r,this.dims=ya(e),this.events=[]};Yi.prototype.signal=function(e,t){le(e,t)&&this.events.push(arguments)},Yi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Se.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=$n(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=$n(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=k();if(!t||!b(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&b(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==k())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(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Oa(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return _r(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Os(e)&&(_r(e),t.dims=ya(e));var a=n.first+n.size,L=Math.max(t.visible.from-e.options.viewportMargin,n.first),H=Math.min(a,t.visible.to+e.options.viewportMargin);r.viewFrom<L&&L-r.viewFrom<20&&(L=Math.max(n.first,r.viewFrom)),r.viewTo>H&&r.viewTo-H<20&&(H=Math.min(a,r.viewTo)),sn&&(L=di(e.doc,L),H=gr(e.doc,H));var z=L!=r.viewFrom||H!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,L,H),r.viewOffset=Wn(lt(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var X=fs(e);if(!z&&X==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var Y=ol(e);return X>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),X>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(Y),E(r.cursorDiv),E(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,z&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Ti(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ir(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ca(e.display)-ha(e),r.top)}),t.visible=Vi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vi(e.display,e.doc,r));if(!Oa(e,t))break;zi(e);var a=bi(e);vi(e),Jr(e,a),Ca(e,a),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 Ra(e,t){var r=new Yi(e,t);if(Oa(e,r)){zi(e),ws(e,r);var n=bi(e);vi(e),Jr(e,n),Ca(e,n),r.finish()}}function ul(e,t,r){var n=e.display,a=e.options.lineNumbers,L=n.lineDiv,H=L.firstChild;function z(Ie){var Ne=Ie.nextSibling;return P&&o&&e.display.currentWheelTarget==Ie?Ie.style.display="none":Ie.parentNode.removeChild(Ie),Ne}for(var X=n.view,Y=n.viewFrom,se=0;se<X.length;se++){var ce=X[se];if(!ce.hidden)if(!ce.node||ce.node.parentNode!=L){var Te=No(e,ce,Y,r);L.insertBefore(Te,H)}else{for(;H!=ce.node;)H=z(H);var be=a&&t!=null&&t<=Y&&ce.lineNumber;ce.changes&&(Q(ce.changes,"gutter")>-1&&(be=!1),Ya(e,ce,Y,r)),be&&(E(ce.lineNumber),ce.lineNumber.appendChild(document.createTextNode(ur(e.options,Y)))),H=ce.node.nextSibling}Y+=ce.size}for(;H;)H=z(H)}function Aa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ca(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+$n(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ba(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,L=n+"px",H=0;H<r.length;H++)if(!r[H].hidden){e.options.fixedGutter&&(r[H].gutter&&(r[H].gutter.style.left=L),r[H].gutterBackground&&(r[H].gutterBackground.style.left=L));var z=r[H].alignable;if(z)for(var X=0;X<z.length;X++)z[X].style.left=L}e.options.fixedGutter&&(t.gutters.style.left=n+a+"px")}function Os(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=ur(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var a=n.measure.appendChild(c("div",[c("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),L=a.firstChild.offsetWidth,H=a.offsetWidth-L;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(L,n.lineGutter.offsetWidth-H)+1,n.lineNumWidth=n.lineNumInnerWidth+H,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Aa(e.display),!0}return!1}function La(e,t){for(var r=[],n=!1,a=0;a<e.length;a++){var L=e[a],H=null;if(typeof L!="string"&&(H=L.style,L=L.className),L=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:L,style:H})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function Rs(e){var t=e.gutters,r=e.gutterSpecs;E(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var a=r[n],L=a.className,H=a.style,z=t.appendChild(c("div",null,"CodeMirror-gutter "+L));H&&(z.style.cssText=H),L=="CodeMirror-linenumbers"&&(e.lineGutter=z,z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Aa(e)}function xi(e){Rs(e.display),En(e),Ss(e)}function dl(e,t,r,n){var a=this;this.input=r,a.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=u("div",null,"CodeMirror-code"),a.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=c("div",null,"CodeMirror-cursors"),a.measure=c("div",null,"CodeMirror-measure"),a.lineMeasure=c("div",null,"CodeMirror-measure"),a.lineSpace=u("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var L=u("div",[a.lineSpace],"CodeMirror-lines");a.mover=c("div",[L],null,"position: relative"),a.sizer=c("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=c("div",null,null,"position: absolute; height: "+te+"px; width: 1px;"),a.gutters=c("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=c("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=c("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),W&&B<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!P&&!(D&&i)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=La(n.gutters,n.lineNumbers),Rs(a),r.init(a)}var $i=0,kn=null;W?kn=-.53:D?kn=15:v?kn=-.7:p&&(kn=-1/3);function As(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function cl(e){var t=As(e);return t.x*=kn,t.y*=kn,t}function Cs(e,t){var r=As(t),n=r.x,a=r.y,L=e.display,H=L.scroller,z=H.scrollWidth>H.clientWidth,X=H.scrollHeight>H.clientHeight;if(!(n&&z||a&&X))return;if(a&&o&&P){e:for(var Y=t.target,se=L.view;Y!=H;Y=Y.parentNode)for(var ce=0;ce<se.length;ce++)if(se[ce].node==Y){e.display.currentWheelTarget=Y;break e}}if(n&&!D&&!m&&kn!=null){a&&X&&yi(e,Math.max(0,H.scrollTop+a*kn)),Mr(e,Math.max(0,H.scrollLeft+n*kn)),(!a||a&&X)&&J(t),L.wheelStartX=null;return}if(a&&kn!=null){var Te=a*kn,be=e.doc.scrollTop,Ie=be+L.wrapper.clientHeight;Te<0?be=Math.max(0,be+Te-50):Ie=Math.min(e.doc.height,Ie+Te+50),Ra(e,{top:be,bottom:Ie})}$i<20&&(L.wheelStartX==null?(L.wheelStartX=H.scrollLeft,L.wheelStartY=H.scrollTop,L.wheelDX=n,L.wheelDY=a,setTimeout(function(){if(L.wheelStartX==null)return;var Ne=H.scrollLeft-L.wheelStartX,Ge=H.scrollTop-L.wheelStartY,Qe=Ge&&L.wheelDY&&Ge/L.wheelDY||Ne&&L.wheelDX&&Ne/L.wheelDX;if(L.wheelStartX=L.wheelStartY=null,!Qe)return;kn=(kn*$i+Qe)/($i+1),++$i},200)):(L.wheelDX+=n,L.wheelDY+=a))}var Mn=function(e,t){this.ranges=e,this.primIndex=t};Mn.prototype.primary=function(){return this.ranges[this.primIndex]},Mn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!Sr(r.anchor,n.anchor)||!Sr(r.head,n.head))return!1}return!0},Mn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Pt(dr(this.ranges[t].anchor),dr(this.ranges[t].head));return new Mn(e,this.primIndex)},Mn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Mn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(gt(t,n.from())>=0&&gt(e,n.to())<=0)return r}return-1};var Pt=function(e,t){this.anchor=e,this.head=t};Pt.prototype.from=function(){return Un(this.anchor,this.head)},Pt.prototype.to=function(){return cr(this.anchor,this.head)},Pt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Gn(e,t,r){var n=e&&e.options.selectionsMayTouch,a=t[r];t.sort(function(Te,be){return gt(Te.from(),be.from())}),r=Q(t,a);for(var L=1;L<t.length;L++){var H=t[L],z=t[L-1],X=gt(z.to(),H.from());if(n&&!H.empty()?X>0:X>=0){var Y=Un(z.from(),H.from()),se=cr(z.to(),H.to()),ce=z.empty()?H.from()==H.head:z.from()==z.head;L<=r&&--r,t.splice(--L,2,new Pt(ce?se:Y,ce?Y:se))}}return new Mn(t,r)}function yr(e,t){return new Mn([new Pt(e,t||e)],0)}function br(e){return e.text?Fe(e.from.line+e.text.length-1,$(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(gt(e,t.from)<0)return e;if(gt(e,t.to)<=0)return br(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=br(t).ch-t.to.ch),Fe(r,n)}function Ia(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var a=e.sel.ranges[n];r.push(new Pt(Ls(a.anchor,t),Ls(a.head,t)))}return Gn(e.cm,r,e.sel.primIndex)}function Is(e,t,r){return e.line==t.line?Fe(r.line,e.ch-t.ch+r.ch):Fe(r.line+(e.line-t.line),e.ch)}function hl(e,t,r){for(var n=[],a=Fe(e.first,0),L=a,H=0;H<t.length;H++){var z=t[H],X=Is(z.from,a,L),Y=Is(br(z),a,L);if(a=z.to,L=Y,r=="around"){var se=e.sel.ranges[H],ce=gt(se.head,se.anchor)<0;n[H]=new Pt(ce?Y:X,ce?X:Y)}else n[H]=new Pt(X,X)}return new Mn(n,e.sel.primIndex)}function Da(e){e.doc.mode=ct(e.options,e.doc.modeOption),wi(e)}function wi(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,Ti(e,100),e.state.modeGen++,e.curOp&&En(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&$(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Pa(e,t,r,n){function a(tt){return r?r[tt]:null}function L(tt,Ze,at){ua(tt,Ze,at,n),ln(tt,"change",tt,t)}function H(tt,Ze){for(var at=[],mt=tt;mt<Ze;++mt)at.push(new Lr(Y[mt],a(mt),n));return at}var z=t.from,X=t.to,Y=t.text,se=lt(e,z.line),ce=lt(e,X.line),Te=$(Y),be=a(Y.length-1),Ie=X.line-z.line;if(t.full)e.insert(0,H(0,Y.length)),e.remove(Y.length,e.size-Y.length);else if(Ds(e,t)){var Ne=H(0,Y.length-1);L(ce,ce.text,be),Ie&&e.remove(z.line,Ie),Ne.length&&e.insert(z.line,Ne)}else if(se==ce)if(Y.length==1)L(se,se.text.slice(0,z.ch)+Te+se.text.slice(X.ch),be);else{var Ge=H(1,Y.length-1);Ge.push(new Lr(Te+se.text.slice(X.ch),be,n)),L(se,se.text.slice(0,z.ch)+Y[0],a(0)),e.insert(z.line+1,Ge)}else if(Y.length==1)L(se,se.text.slice(0,z.ch)+Y[0]+ce.text.slice(X.ch),a(0)),e.remove(z.line+1,Ie);else{L(se,se.text.slice(0,z.ch)+Y[0],a(0)),L(ce,Te+ce.text.slice(X.ch),be);var Qe=H(1,Y.length-1);Ie>1&&e.remove(z.line+1,Ie-1),e.insert(z.line+1,Qe)}ln(e,"change",e,t)}function Er(e,t,r){function n(a,L,H){if(a.linked)for(var z=0;z<a.linked.length;++z){var X=a.linked[z];if(X.doc==L)continue;var Y=H&&X.sharedHist;if(r&&!Y)continue;t(X.doc,Y),n(X.doc,a,Y)}}n(e,null,!0)}function Ps(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),ks(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,En(e)}function ks(e){(e.doc.direction=="rtl"?I:w)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){An(e,function(){ks(e),En(e)})}function Ji(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 ka(e,t){var r={from:dr(t.from),to:br(t),text:Nn(e,t.from,t.to)};return Us(e,r,t.from.line,t.to.line+1),Er(e,function(n){return Us(n,r,t.from.line,t.to.line+1)},!0),r}function Ms(e){for(;e.length;){var t=$(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ms(e.done),$(e.done);if(e.done.length&&!$(e.done).ranges)return $(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),$(e.done)}function Ns(e,t,r,n){var a=e.history;a.undone.length=0;var L=+new Date,H,z;if((a.lastOp==n||a.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&a.lastModTime>L-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(H=pl(a,a.lastOp==n)))z=$(H.changes),gt(t.from,t.to)==0&&gt(t.from,z.to)==0?z.to=br(t):H.changes.push(ka(e,t));else{var X=$(a.done);for((!X||!X.ranges)&&Qi(e.sel,a.done),H={changes:[ka(e,t)],generation:a.generation},a.done.push(H);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(r),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=L,a.lastOp=a.lastSelOp=n,a.lastOrigin=a.lastSelOrigin=t.origin,z||Se(e,"historyAdded")}function ml(e,t,r,n){var a=t.charAt(0);return a=="*"||a=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var a=e.history,L=n&&n.origin;r==a.lastSelOp||L&&a.lastSelOrigin==L&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==L||ml(e,L,$(a.done),t))?a.done[a.done.length-1]=t:Qi(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=L,a.lastSelOp=r,n&&n.clearRedo!==!1&&Ms(a.undone)}function Qi(e,t){var r=$(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Us(e,t,r,n){var a=t["spans_"+e.id],L=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(H){H.markedSpans&&((a||(a=t["spans_"+e.id]={}))[L]=H.markedSpans),++L})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function _l(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],a=0;a<t.text.length;++a)n.push(vl(r[a]));return n}function Fs(e,t){var r=_l(e,t),n=Mt(e,t);if(!r)return n;if(!n)return r;for(var a=0;a<r.length;++a){var L=r[a],H=n[a];if(L&&H){e:for(var z=0;z<H.length;++z){for(var X=H[z],Y=0;Y<L.length;++Y)if(L[Y].marker==X.marker)continue e;L.push(X)}}else H&&(r[a]=H)}return r}function Qr(e,t,r){for(var n=[],a=0;a<e.length;++a){var L=e[a];if(L.ranges){n.push(r?Mn.prototype.deepCopy.call(L):L);continue}var H=L.changes,z=[];n.push({changes:z});for(var X=0;X<H.length;++X){var Y=H[X],se=void 0;if(z.push({from:Y.from,to:Y.to,text:Y.text}),t)for(var ce in Y)(se=ce.match(/^spans_(\d+)$/))&&(Q(t,Number(se[1]))>-1&&($(z)[ce]=Y[ce],delete Y[ce]))}}return n}function Ma(e,t,r,n){if(n){var a=e.anchor;if(r){var L=gt(t,a)<0;L!=gt(r,a)<0?(a=t,t=r):L!=gt(t,r)<0&&(t=r)}return new Pt(a,t)}else return new Pt(r||t,t)}function Zi(e,t,r,n,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),hn(e,new Mn([Ma(e.sel.primary(),t,r,a)],0),n)}function Bs(e,t,r){for(var n=[],a=e.cm&&(e.cm.display.shift||e.extend),L=0;L<e.sel.ranges.length;L++)n[L]=Ma(e.sel.ranges[L],t[L],null,a);var H=Gn(e.cm,n,e.sel.primIndex);hn(e,H,r)}function Na(e,t,r,n){var a=e.sel.ranges.slice(0);a[t]=r,hn(e,Gn(e.cm,a,e.sel.primIndex),n)}function js(e,t,r,n){hn(e,yr(t,r),n)}function yl(e,t,r){var n={ranges:t.ranges,update:function(a){this.ranges=[];for(var L=0;L<a.length;L++)this.ranges[L]=new Pt(vt(e,a[L].anchor),vt(e,a[L].head))},origin:r&&r.origin};return Se(e,"beforeSelectionChange",e,n),e.cm&&Se(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Gn(e.cm,n.ranges,n.ranges.length-1):t}function Hs(e,t,r){var n=e.history.done,a=$(n);a&&a.ranges?(n[n.length-1]=t,qi(e,t,r)):hn(e,t,r)}function hn(e,t,r){qi(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function qi(e,t,r){(le(e,"beforeSelectionChange")||e.cm&&le(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,r));var n=r&&r.bias||(gt(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Gs(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&$r(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),ln(e,"cursorActivity",e)}function Ks(e){Ws(e,Gs(e,e.sel,null,!1))}function Gs(e,t,r,n){for(var a,L=0;L<t.ranges.length;L++){var H=t.ranges[L],z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[L],X=ea(e,H.anchor,z&&z.anchor,r,n),Y=ea(e,H.head,z&&z.head,r,n);(a||X!=H.anchor||Y!=H.head)&&(a||(a=t.ranges.slice(0,L)),a[L]=new Pt(X,Y))}return a?Gn(e.cm,a,t.primIndex):t}function Zr(e,t,r,n,a){var L=lt(e,t.line);if(L.markedSpans)for(var H=0;H<L.markedSpans.length;++H){var z=L.markedSpans[H],X=z.marker,Y="selectLeft"in X?!X.selectLeft:X.inclusiveLeft,se="selectRight"in X?!X.selectRight:X.inclusiveRight;if((z.from==null||(Y?z.from<=t.ch:z.from<t.ch))&&(z.to==null||(se?z.to>=t.ch:z.to>t.ch))){if(a&&(Se(X,"beforeCursorEnter"),X.explicitlyCleared))if(L.markedSpans){--H;continue}else break;if(!X.atomic)continue;if(r){var ce=X.find(n<0?1:-1),Te=void 0;if((n<0?se:Y)&&(ce=zs(e,ce,-n,ce&&ce.line==t.line?L:null)),ce&&ce.line==t.line&&(Te=gt(ce,r))&&(n<0?Te<0:Te>0))return Zr(e,ce,t,n,a)}var be=X.find(n<0?-1:1);return(n<0?Y:se)&&(be=zs(e,be,n,be.line==t.line?L:null)),be?Zr(e,be,t,n,a):null}}return t}function ea(e,t,r,n,a){var L=n||1,H=Zr(e,t,r,L,a)||!a&&Zr(e,t,r,L,!0)||Zr(e,t,r,-L,a)||!a&&Zr(e,t,r,-L,!0);return H||(e.cantEdit=!0,Fe(e.first,0))}function zs(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?vt(e,Fe(t.line-1)):null:r>0&&t.ch==(n||lt(e,t.line)).text.length?t.line<e.first+e.size-1?Fe(t.line+1,0):null:new Fe(t.line,t.ch+r)}function Vs(e){e.setSelection(Fe(e.firstLine(),0),Fe(e.lastLine()),de)}function Xs(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(a,L,H,z){a&&(n.from=vt(e,a)),L&&(n.to=vt(e,L)),H&&(n.text=H),z!==void 0&&(n.origin=z)}),Se(e,"beforeChange",e,n),e.cm&&Se(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function qr(e,t,r){if(e.cm){if(!e.cm.curOp)return en(e.cm,qr)(e,t,r);if(e.cm.state.suppressEdits)return}if((le(e,"beforeChange")||e.cm&&le(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var n=Zn&&!r&&Bt(e,t.from,t.to);if(n)for(var a=n.length-1;a>=0;--a)Ys(e,{from:n[a].from,to:n[a].to,text:a?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&gt(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),Si(e,t,r,Mt(e,t));var n=[];Er(e,function(a,L){!L&&Q(n,a.history)==-1&&(Zs(a.history,t),n.push(a.history)),Si(a,t,null,Mt(a,t))})}function ta(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var a=e.history,L,H=e.sel,z=t=="undo"?a.done:a.undone,X=t=="undo"?a.undone:a.done,Y=0;Y<z.length&&!(L=z[Y],r?L.ranges&&!L.equals(e.sel):!L.ranges);Y++);if(Y==z.length)return;for(a.lastOrigin=a.lastSelOrigin=null;;)if(L=z.pop(),L.ranges){if(Qi(L,X),r&&!L.equals(e.sel)){hn(e,L,{clearRedo:!1});return}H=L}else if(n){z.push(L);return}else break;var se=[];Qi(H,X),X.push({changes:se,generation:a.generation}),a.generation=L.generation||++a.maxGeneration;for(var ce=le(e,"beforeChange")||e.cm&&le(e.cm,"beforeChange"),Te=function(Ne){var Ge=L.changes[Ne];if(Ge.origin=t,ce&&!Xs(e,Ge,!1))return z.length=0,{};se.push(ka(e,Ge));var Qe=Ne?Ia(e,Ge):$(z);Si(e,Ge,Qe,Fs(e,Ge)),!Ne&&e.cm&&e.cm.scrollIntoView({from:Ge.from,to:br(Ge)});var tt=[];Er(e,function(Ze,at){!at&&Q(tt,Ze.history)==-1&&(Zs(Ze.history,Ge),tt.push(Ze.history)),Si(Ze,Ge,null,Fs(Ze,Ge))})},be=L.changes.length-1;be>=0;--be){var Ie=Te(be);if(Ie)return Ie.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Mn(ie(e.sel.ranges,function(a){return new Pt(Fe(a.anchor.line+t,a.anchor.ch),Fe(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm){En(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)vr(e.cm,n,"gutter")}}function Si(e,t,r,n){if(e.cm&&!e.cm.curOp)return en(e.cm,Si)(e,t,r,n);if(t.to.line<e.first){$s(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 a=t.text.length-1-(e.first-t.from.line);$s(e,a),t={from:Fe(e.first,0),to:Fe(t.to.line+a,t.to.ch),text:[$(t.text)],origin:t.origin}}var L=e.lastLine();t.to.line>L&&(t={from:t.from,to:Fe(L,lt(e,L).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Nn(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?bl(e.cm,t,n):Pa(e,t,n),qi(e,r,de),e.cantEdit&&ea(e,Fe(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,r){var n=e.doc,a=e.display,L=t.from,H=t.to,z=!1,X=L.line;e.options.lineWrapping||(X=At(Pn(lt(n,L.line))),n.iter(X,H.line+1,function(be){if(be==a.maxLine)return z=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ve(e),Pa(n,t,r,hs(e)),e.options.lineWrapping||(n.iter(X,L.line+t.text.length,function(be){var Ie=hi(be);Ie>a.maxLineLength&&(a.maxLine=be,a.maxLineLength=Ie,a.maxLineChanged=!0,z=!1)}),z&&(e.curOp.updateMaxLine=!0)),li(n,L.line),Ti(e,400);var Y=t.text.length-(H.line-L.line)-1;t.full?En(e):L.line==H.line&&t.text.length==1&&!Ds(e.doc,t)?vr(e,L.line,"text"):En(e,L.line,H.line+1,Y);var se=le(e,"changes"),ce=le(e,"change");if(ce||se){var Te={from:L,to:H,text:t.text,removed:t.removed,origin:t.origin};ce&&ln(e,"change",e,Te),se&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Te)}e.display.selForContextMenu=null}function ei(e,t,r,n,a){var L;n||(n=r),gt(n,r)<0&&(L=[n,r],r=L[0],n=L[1]),typeof t=="string"&&(t=e.splitLines(t)),qr(e,{from:r,to:n,text:t,origin:a})}function Js(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,r,n){for(var a=0;a<e.length;++a){var L=e[a],H=!0;if(L.ranges){L.copied||(L=e[a]=L.deepCopy(),L.copied=!0);for(var z=0;z<L.ranges.length;z++)Js(L.ranges[z].anchor,t,r,n),Js(L.ranges[z].head,t,r,n);continue}for(var X=0;X<L.changes.length;++X){var Y=L.changes[X];if(r<Y.from.line)Y.from=Fe(Y.from.line+n,Y.from.ch),Y.to=Fe(Y.to.line+n,Y.to.ch);else if(t<=Y.to.line){H=!1;break}}H||(e.splice(0,a+1),a=0)}}function Zs(e,t){var r=t.from.line,n=t.to.line,a=t.text.length-(n-r)-1;Qs(e.done,r,n,a),Qs(e.undone,r,n,a)}function Oi(e,t,r,n){var a=t,L=t;return typeof t=="number"?L=lt(e,hr(e,t)):a=At(t),a==null?null:(n(L,a)&&e.cm&&vr(e.cm,a,r),L)}function Ri(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}Ri.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var a=this.lines[r];this.height-=a.height,dt(a),ln(a,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function Ai(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var a=e[n];t+=a.chunkSize(),r+=a.height,a.parent=this}this.size=t,this.height=r,this.parent=null}Ai.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],a=n.chunkSize();if(e<a){var L=Math.min(t,a-e),H=n.height;if(n.removeInner(e,L),this.height-=H-n.height,a==L&&(this.children.splice(r--,1),n.parent=null),(t-=L)==0)break;e=0}else e-=a}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ri))){var z=[];this.collapse(z),this.children=[new Ri(z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var a=this.children[n],L=a.chunkSize();if(e<=L){if(a.insertInner(e,t,r),a.lines&&a.lines.length>50){for(var H=a.lines.length%25+25,z=H;z<a.lines.length;){var X=new Ri(a.lines.slice(z,z+=25));a.height-=X.height,this.children.splice(++n,0,X),X.parent=this}a.lines=a.lines.slice(0,H),this.maybeSpill()}break}e-=L}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Ai(t);if(e.parent){e.size-=r.size,e.height-=r.height;var a=Q(e.parent.children,e);e.parent.children.splice(a+1,0,r)}else{var n=new Ai(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var a=this.children[n],L=a.chunkSize();if(e<L){var H=Math.min(t,L-e);if(a.iterN(e,H,r))return!0;if((t-=H)==0)break;e=0}else e-=L}}};var Ci=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Ci.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=At(r);if(n==null||!t)return;for(var a=0;a<t.length;++a)t[a]==this&&t.splice(a--,1);t.length||(r.widgets=null);var L=mi(this);dn(r,Math.max(0,r.height-L)),e&&(An(e,function(){qs(e,r,-L),vr(e,n,"widget")}),ln(e,"lineWidgetCleared",e,this,n))},Ci.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var a=mi(this)-t;if(!a)return;Yn(this.doc,n)||dn(n,n.height+a),r&&An(r,function(){r.curOp.forceUpdate=!0,qs(r,n,a),ln(r,"lineWidgetChanged",r,e,At(n))})},ue(Ci);function qs(e,t,r){Wn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function El(e,t,r,n){var a=new Ci(e,r,n),L=e.cm;return L&&a.noHScroll&&(L.display.alignWidgets=!0),Oi(e,t,"widget",function(H){var z=H.widgets||(H.widgets=[]);if(a.insertAt==null?z.push(a):z.splice(Math.min(z.length-1,Math.max(0,a.insertAt)),0,a),a.line=H,L&&!Yn(e,H)){var X=Wn(H)<e.scrollTop;dn(H,H.height+mi(a)),X&&Sa(L,a.height),L.curOp.forceUpdate=!0}return!0}),L&&ln(L,"lineWidgetAdded",L,a,typeof t=="number"?t:At(t)),a}var eo=0,Tr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};Tr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ur(e),le(this,"clear")){var r=this.find();r&&ln(this,"clear",r.from,r.to)}for(var n=null,a=null,L=0;L<this.lines.length;++L){var H=this.lines[L],z=Ye(H.markedSpans,this);e&&!this.collapsed?vr(e,At(H),"text"):e&&(z.to!=null&&(a=At(H)),z.from!=null&&(n=At(H))),H.markedSpans=Tt(H.markedSpans,z),z.from==null&&this.collapsed&&!Yn(this.doc,H)&&e&&dn(H,Vr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var X=0;X<this.lines.length;++X){var Y=Pn(this.lines[X]),se=hi(Y);se>e.display.maxLineLength&&(e.display.maxLine=Y,e.display.maxLineLength=se,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&En(e,n,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ks(e.doc)),e&&ln(e,"markerCleared",e,this,n,a),t&&Fr(e),this.parent&&this.parent.clear()},Tr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,a=0;a<this.lines.length;++a){var L=this.lines[a],H=Ye(L.markedSpans,this);if(H.from!=null&&(r=Fe(t?L:At(L),H.from),e==-1))return r;if(H.to!=null&&(n=Fe(t?L:At(L),H.to),e==1))return n}return r&&{from:r,to:n}},Tr.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;An(n,function(){var a=t.line,L=At(t.line),H=fa(n,L);if(H&&(is(H),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Yn(r.doc,a)&&r.height!=null){var z=r.height;r.height=null;var X=mi(r)-z;X&&dn(a,a.height+X)}ln(n,"markerChanged",n,e)})},Tr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Q(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Tr.prototype.detachLine=function(e){if(this.lines.splice(Q(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ue(Tr);function ti(e,t,r,n,a){if(n&&n.shared)return Tl(e,t,r,n,a);if(e.cm&&!e.cm.curOp)return en(e.cm,ti)(e,t,r,n,a);var L=new Tr(e,a),H=gt(t,r);if(n&&y(n,L,!1),H>0||H==0&&L.clearWhenEmpty!==!1)return L;if(L.replacedWith&&(L.collapsed=!0,L.widgetNode=u("span",[L.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||L.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(L.widgetNode.insertLeft=!0)),L.collapsed){if(Fi(e,t.line,t,r,L)||t.line!=r.line&&Fi(e,r.line,t,r,L))throw new Error("Inserting collapsed marker partially overlapping an existing one");ui()}L.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var z=t.line,X=e.cm,Y;if(e.iter(z,r.line+1,function(ce){X&&L.collapsed&&!X.options.lineWrapping&&Pn(ce)==X.display.maxLine&&(Y=!0),L.collapsed&&z!=t.line&&dn(ce,0),Wt(ce,new Hn(L,z==t.line?t.ch:null,z==r.line?r.ch:null)),++z}),L.collapsed&&e.iter(t.line,r.line+1,function(ce){Yn(e,ce)&&dn(ce,0)}),L.clearOnEnter&&Ce(L,"beforeCursorEnter",function(){return L.clear()}),L.readOnly&&(jn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),L.collapsed&&(L.id=++eo,L.atomic=!0),X){if(Y&&(X.curOp.updateMaxLine=!0),L.collapsed)En(X,t.line,r.line+1);else if(L.className||L.startStyle||L.endStyle||L.css||L.attributes||L.title)for(var se=t.line;se<=r.line;se++)vr(X,se,"text");L.atomic&&Ks(X.doc),ln(X,"markerAdded",X,L)}return L}var Li=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Li.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")},Li.prototype.find=function(e,t){return this.primary.find(e,t)},ue(Li);function Tl(e,t,r,n,a){n=y(n),n.shared=!1;var L=[ti(e,t,r,n,a)],H=L[0],z=n.widgetNode;return Er(e,function(X){z&&(n.widgetNode=z.cloneNode(!0)),L.push(ti(X,vt(X,t),vt(X,r),n,a));for(var Y=0;Y<X.linked.length;++Y)if(X.linked[Y].isParent)return;H=$(L)}),new Li(L,H)}function to(e){return e.findMarks(Fe(e.first,0),e.clipPos(Fe(e.lastLine())),function(t){return t.parent})}function xl(e,t){for(var r=0;r<t.length;r++){var n=t[r],a=n.find(),L=e.clipPos(a.from),H=e.clipPos(a.to);if(gt(L,H)){var z=ti(e,L,H,n.primary,n.primary.type);n.markers.push(z),z.parent=n}}}function wl(e){for(var t=function(n){var a=e[n],L=[a.primary.doc];Er(a.primary.doc,function(X){return L.push(X)});for(var H=0;H<a.markers.length;H++){var z=a.markers[H];Q(L,z.doc)==-1&&(z.parent=null,a.markers.splice(H--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,Tn=function(e,t,r,n,a){if(!(this instanceof Tn))return new Tn(e,t,r,n,a);r==null&&(r=0),Ai.call(this,[new Ri([new Lr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var L=Fe(r,0);this.sel=yr(L),this.history=new Ji(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=a=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Pa(this,{from:L,to:L,text:e}),hn(this,yr(L),de)};Tn.prototype=we(Ai.prototype,{constructor:Tn,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=lr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:tn(function(e){var t=Fe(this.first,0),r=this.first+this.size-1;qr(this,{from:t,to:Fe(r,lt(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_i(this.cm,0,0),hn(this,yr(t),de)}),replaceRange:function(e,t,r,n){t=vt(this,t),r=r?vt(this,r):t,ei(this,e,t,r,n)},getRange:function(e,t,r){var n=Nn(this,vt(this,e),vt(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pn(this,e))return lt(this,e)},getLineNumber:function(e){return At(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=lt(this,e)),Pn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return vt(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:tn(function(e,t,r){js(this,vt(this,typeof e=="number"?Fe(e,t||0):e),null,r)}),setSelection:tn(function(e,t,r){js(this,vt(this,e),vt(this,t||e),r)}),extendSelection:tn(function(e,t,r){Zi(this,vt(this,e),t&&vt(this,t),r)}),extendSelections:tn(function(e,t){Bs(this,He(this,e),t)}),extendSelectionsBy:tn(function(e,t){var r=ie(this.sel.ranges,e);Bs(this,He(this,r),t)}),setSelections:tn(function(e,t,r){if(!e.length)return;for(var n=[],a=0;a<e.length;a++)n[a]=new Pt(vt(this,e[a].anchor),vt(this,e[a].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),hn(this,Gn(this.cm,n,t),r)}),addSelection:tn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Pt(vt(this,e),vt(this,t||e))),hn(this,Gn(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var a=Nn(this,t[n].from(),t[n].to());r=r?r.concat(a):a}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var a=Nn(this,r[n].from(),r[n].to());e!==!1&&(a=a.join(e||this.lineSeparator())),t[n]=a}return t},replaceSelection:function(e,t,r){for(var n=[],a=0;a<this.sel.ranges.length;a++)n[a]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:tn(function(e,t,r){for(var n=[],a=this.sel,L=0;L<a.ranges.length;L++){var H=a.ranges[L];n[L]={from:H.from(),to:H.to(),text:this.splitLines(e[L]),origin:r}}for(var z=t&&t!="end"&&hl(this,n,t),X=n.length-1;X>=0;X--)qr(this,n[X]);z?Hs(this,z):this.cm&&$r(this.cm)}),undo:tn(function(){ta(this,"undo")}),redo:tn(function(){ta(this,"redo")}),undoSelection:tn(function(){ta(this,"undo",!0)}),redoSelection:tn(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var a=0;a<e.undone.length;a++)e.undone[a].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Ji(this.history.maxGeneration),Er(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:Qr(this.history.done),undone:Qr(this.history.undone)}},setHistory:function(e){var t=this.history=new Ji(this.history.maxGeneration);t.done=Qr(e.done.slice(0),null,!0),t.undone=Qr(e.undone.slice(0),null,!0)},setGutterMarker:tn(function(e,t,r){return Oi(this,e,"gutter",function(n){var a=n.gutterMarkers||(n.gutterMarkers={});return a[t]=r,!r&&ke(a)&&(n.gutterMarkers=null),!0})}),clearGutter:tn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Oi(t,r,"gutter",function(){return r.gutterMarkers[e]=null,ke(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!pn(this,e))return null;if(t=e,e=lt(this,e),!e)return null}else if(t=At(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:tn(function(e,t,r){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[a])n[a]=r;else{if(S(r).test(n[a]))return!1;n[a]+=" "+r}return!0})}),removeLineClass:tn(function(e,t,r){return Oi(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",L=n[a];if(L)if(r==null)n[a]=null;else{var H=L.match(S(r));if(!H)return!1;var z=H.index+H[0].length;n[a]=L.slice(0,H.index)+(!H.index||z==L.length?"":" ")+L.slice(z)||null}else return!1;return!0})}),addLineWidget:tn(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ti(this,vt(this,e),vt(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=vt(this,e),ti(this,e,e,r,"bookmark")},findMarksAt:function(e){e=vt(this,e);var t=[],r=lt(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var a=r[n];(a.from==null||a.from<=e.ch)&&(a.to==null||a.to>=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,r){e=vt(this,e),t=vt(this,t);var n=[],a=e.line;return this.iter(e.line,t.line+1,function(L){var H=L.markedSpans;if(H)for(var z=0;z<H.length;z++){var X=H[z];!(X.to!=null&&a==e.line&&e.ch>=X.to||X.from==null&&a!=e.line||X.from!=null&&a==t.line&&X.from>=t.ch)&&(!r||r(X.marker))&&n.push(X.marker.parent||X.marker)}++a}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(a){var L=a.text.length+n;if(L>e)return t=e,!0;e-=L,++r}),vt(this,Fe(r,t))},indexFromPos:function(e){e=vt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new Tn(lr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new Tn(lr(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],xl(n,to(this)),n},unlinkDoc:function(e){if(e instanceof zt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var n=[e.id];Er(e,function(a){return n.push(a.id)},!0),e.history=new Ji(null),e.history.done=Qr(this.history.done,n),e.history.undone=Qr(this.history.undone,n)}},iterLinkedDocs:function(e){Er(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_t(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:tn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Tn.prototype.eachLine=Tn.prototype.iter;var no=0;function Ol(e){var t=this;if(ro(t),Me(t,e)||ir(t.display,e))return;J(e),W&&(no=+new Date);var r=Pr(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var a=n.length,L=Array(a),H=0,z=function(){++H==a&&en(t,function(){r=vt(t.doc,r);var be={from:r,to:r,text:t.doc.splitLines(L.filter(function(Ie){return Ie!=null}).join(t.doc.lineSeparator())),origin:"paste"};qr(t.doc,be),Hs(t.doc,yr(vt(t.doc,r),vt(t.doc,br(be))))})()},X=function(be,Ie){if(t.options.allowDropFileTypes&&Q(t.options.allowDropFileTypes,be.type)==-1){z();return}var Ne=new FileReader;Ne.onerror=function(){return z()},Ne.onload=function(){var Ge=Ne.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ge)){z();return}L[Ie]=Ge,z()},Ne.readAsText(be)},Y=0;Y<n.length;Y++)X(n[Y],Y);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var se=e.dataTransfer.getData("Text");if(se){var ce;if(t.state.draggingText&&!t.state.draggingText.copy&&(ce=t.listSelections()),qi(t.doc,yr(r,r)),ce)for(var Te=0;Te<ce.length;++Te)ei(t.doc,"",ce[Te].anchor,ce[Te].head,"drag");t.replaceSelection(se,"around","paste"),t.display.input.focus()}}catch(be){}}}function Rl(e,t){if(W&&(!e.state.draggingText||+new Date-no<100)){oe(t);return}if(Me(e,t)||ir(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var r=c("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),m&&r.parentNode.removeChild(r)}}function Al(e,t){var r=Pr(e,t);if(!r)return;var n=document.createDocumentFragment();ms(e,r,n),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),_(e.display.dragCursor,n)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function io(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var a=t[n].CodeMirror;a&&r.push(a)}r.length&&r[0].operation(function(){for(var L=0;L<r.length;L++)e(r[L])})}var ao=!1;function Cl(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Ce(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,io(Il)},100))}),Ce(window,"blur",function(){return io(Yr)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var xr={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"},Ii=0;Ii<10;Ii++)xr[Ii+48]=xr[Ii+96]=String(Ii);for(var na=65;na<=90;na++)xr[na]=String.fromCharCode(na);for(var Di=1;Di<=12;Di++)xr[Di+111]=xr[Di+63235]="F"+Di;var ar={};ar.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"},ar.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"},ar.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"},ar.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"]},ar.default=o?ar.macDefault:ar.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,a,L,H=0;H<t.length-1;H++){var z=t[H];if(/^(cmd|meta|m)$/i.test(z))L=!0;else if(/^a(lt)?$/i.test(z))r=!0;else if(/^(c|ctrl|control)$/i.test(z))n=!0;else if(/^s(hift)?$/i.test(z))a=!0;else throw new Error("Unrecognized modifier name: "+z)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),L&&(e="Cmd-"+e),a&&(e="Shift-"+e),e}function Pl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var a=ie(r.split(" "),Dl),L=0;L<a.length;L++){var H=void 0,z=void 0;L==a.length-1?(z=a.join(" "),H=n):(z=a.slice(0,L+1).join(" "),H="...");var X=t[z];if(!X)t[z]=H;else if(X!=H)throw new Error("Inconsistent bindings for "+z)}delete e[r]}for(var Y in t)e[Y]=t[Y];return e}function ni(e,t,r,n){t=ra(t);var a=t.call?t.call(e,n):t[e];if(a===!1)return"nothing";if(a==="...")return"multi";if(a!=null&&r(a))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ni(e,t.fallthrough,r,n);for(var L=0;L<t.fallthrough.length;L++){var H=ni(e,t.fallthrough[L],r,n);if(H)return H}}}function so(e){var t=typeof e=="string"?e:xr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var r=xr[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),oo(r,e,t))}function ra(e){return typeof e=="string"?ar[e]:e}function ri(e,t){for(var r=e.doc.sel.ranges,n=[],a=0;a<r.length;a++){for(var L=t(r[a]);n.length&&gt(L.from,$(n).to)<=0;){var H=n.pop();if(gt(H.from,L.from)<0){L.from=H.from;break}}n.push(L)}An(e,function(){for(var z=n.length-1;z>=0;z--)ei(e.doc,"",n[z].from,n[z].to,"+delete");$r(e)})}function Ua(e,t,r){var n=Oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Fa(e,t,r){var n=Ua(e,t.ch,r);return n==null?null:new Fe(t.line,n,r<0?"after":"before")}function Ba(e,t,r,n,a){if(e){t.doc.direction=="rtl"&&(a=-a);var L=Xe(r,t.doc.direction);if(L){var H=a<0?$(L):L[0],z=a<0==(H.level==1),X=z?"after":"before",Y;if(H.level>0||t.doc.direction=="rtl"){var se=zr(t,r);Y=a<0?r.text.length-1:0;var ce=Jn(t,se,Y).top;Y=Be(function(Te){return Jn(t,se,Te).top==ce},a<0==(H.level==1)?H.from:H.to-1,Y),X=="before"&&(Y=Ua(r,Y,1))}else Y=a<0?H.to:H.from;return new Fe(n,Y,X)}}return new Fe(n,a<0?r.text.length:0,a<0?"before":"after")}function kl(e,t,r,n){var a=Xe(t,e.doc.direction);if(!a)return Fa(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var L=je(a,r.ch,r.sticky),H=a[L];if(e.doc.direction=="ltr"&&H.level%2==0&&(n>0?H.to>r.ch:H.from<r.ch))return Fa(t,r,n);var z=function(Qe,tt){return Ua(t,Qe instanceof Fe?Qe.ch:Qe,tt)},X,Y=function(Qe){return e.options.lineWrapping?(X=X||zr(e,t),cs(e,t,X,Qe)):{begin:0,end:t.text.length}},se=Y(r.sticky=="before"?z(r,-1):r.ch);if(e.doc.direction=="rtl"||H.level==1){var ce=H.level==1==n<0,Te=z(r,ce?1:-1);if(Te!=null&&(ce?Te<=H.to&&Te<=se.end:Te>=H.from&&Te>=se.begin)){var be=ce?"before":"after";return new Fe(r.line,Te,be)}}var Ie=function(Qe,tt,Ze){for(var at=function(Ht,nn){return nn?new Fe(r.line,z(Ht,1),"before"):new Fe(r.line,Ht,"after")};Qe>=0&&Qe<a.length;Qe+=tt){var mt=a[Qe],ht=tt>0==(mt.level!=1),Et=ht?Ze.begin:z(Ze.end,-1);if(mt.from<=Et&&Et<mt.to)return at(Et,ht);if(Et=ht?mt.from:z(mt.to,-1),Ze.begin<=Et&&Et<Ze.end)return at(Et,ht)}},Ne=Ie(L+n,n,se);if(Ne)return Ne;var Ge=n>0?se.end:z(se.begin,-1);return Ge!=null&&!(n>0&&Ge==t.text.length)&&(Ne=Ie(n>0?0:a.length-1,n,Y(Ge)),Ne)?Ne:null}var Pi={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return ri(e,function(t){if(t.empty()){var r=lt(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Fe(t.head.line+1,0)}:{from:t.head,to:Fe(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ri(e,function(t){return{from:Fe(t.from().line,0),to:vt(e.doc,Fe(t.to().line+1,0))}})},delLineLeft:function(e){return ri(e,function(t){return{from:Fe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ri(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return ri(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Fe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Fe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return co(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?co(e,t.head):n},fe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,a=0;a<r.length;a++){var L=r[a].from(),H=j(e.getLine(L.line),L.ch,n);t.push(he(n-H%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return An(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var a=t[n].head,L=lt(e.doc,a.line).text;if(L){if(a.ch==L.length&&(a=new Fe(a.line,a.ch-1)),a.ch>0)a=new Fe(a.line,a.ch+1),e.replaceRange(L.charAt(a.ch-1)+L.charAt(a.ch-2),Fe(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var H=lt(e.doc,a.line-1).text;H&&(a=new Fe(a.line,1),e.replaceRange(L.charAt(0)+e.doc.lineSeparator()+H.charAt(H.length-1),Fe(a.line-1,H.length-1),a,"+transpose"))}}r.push(new Pt(a,a))}e.setSelections(r)})},newlineAndIndent:function(e){return An(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);$r(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var r=lt(e.doc,t),n=Pn(r);return n!=r&&(t=At(n)),Ba(!0,e,n,t,1)}function Ml(e,t){var r=lt(e.doc,t),n=Bi(r);return n!=r&&(t=At(n)),Ba(!0,e,r,t,-1)}function co(e,t){var r=uo(e,t.line),n=lt(e.doc,r.line),a=Xe(n,e.doc.direction);if(!a||a[0].level==0){var L=Math.max(r.ch,n.text.search(/\S/)),H=t.line==r.line&&t.ch<=L&&t.ch;return Fe(r.line,H?0:L,r.sticky)}return r}function ia(e,t,r){if(typeof t=="string"&&(t=Pi[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),a=t(e)!=_e}finally{e.display.shift=n,e.state.suppressEdits=!1}return a}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var a=ni(t,e.state.keyMaps[n],r,e);if(a)return a}return e.options.extraKeys&&ni(t,e.options.extraKeys,r,e)||ni(t,e.options.keyMap,r,e)}var Ul=new K;function ki(e,t,r,n){var a=e.state.keySeq;if(a){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==a&&(e.state.keySeq=null,e.display.input.reset())}),ho(e,a+" "+t,r,n))return!0}return ho(e,t,r,n)}function ho(e,t,r,n){var a=Nl(e,t,n);return a=="multi"&&(e.state.keySeq=t),a=="handled"&&ln(e,"keyHandled",e,t,r),(a=="handled"||a=="multi")&&(J(r),Ta(e)),!!a}function fo(e,t){var r=lo(t,!0);return r?t.shiftKey&&!e.state.keySeq?ki(e,"Shift-"+r,t,function(n){return ia(e,n,!0)})||ki(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ia(e,n)}):ki(e,r,t,function(n){return ia(e,n)}):!1}function Fl(e,t,r){return ki(e,"'"+r+"'",t,function(n){return ia(e,n,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=k(),Me(t,e))return;W&&B<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=fo(t,e);m&&(ja=n?r:null,!n&&r==88&&!bt&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!o&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;I(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(w(t,"CodeMirror-crosshair"),Ke(document,"keyup",r),Ke(document,"mouseover",r))}Ce(document,"keyup",r),Ce(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Me(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ir(t.display,e)||Me(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(m&&r==ja){ja=null,J(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var a=String.fromCharCode(n==null?r:n);if(a=="\b")return;if(Fl(t,e,a))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ha.prototype.compare=function(e,t,r){return this.time+jl>e&&gt(t,this.pos)==0&&r==this.button};var Mi,Ni;function Hl(e,t){var r=+new Date;return Ni&&Ni.compare(r,e,t)?(Mi=Ni=null,"triple"):Mi&&Mi.compare(r,e,t)?(Ni=new Ha(r,e,t),Mi=null,"double"):(Mi=new Ha(r,e,t),Ni=null,"single")}function vo(e){var t=this,r=t.display;if(Me(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,ir(r,e)){P||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Pr(t,e),a=Re(e),L=n?Hl(n,a):"single";if(window.focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,a,n,L,e))return;a==1?n?Gl(t,n,L,e):ge(e)==r.scroller&&J(e):a==2?(n&&Zi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):a==3&&(O?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,n,a){var L="Click";return n=="double"?L="Double"+L:n=="triple"&&(L="Triple"+L),L=(t==1?"Left":t==2?"Middle":"Right")+L,ki(e,oo(L,a),a,function(H){if(typeof H=="string"&&(H=Pi[H]),!H)return!1;var z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),z=H(e,r)!=_e}finally{e.state.suppressEdits=!1}return z})}function Kl(e,t,r){var n=e.getOption("configureMouse"),a=n?n(e,t,r):{};if(a.unit==null){var L=f?r.shiftKey&&r.metaKey:r.altKey;a.unit=L?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(a.extend==null||e.doc.extend)&&(a.extend=e.doc.extend||r.shiftKey),a.addNew==null&&(a.addNew=o?r.metaKey:r.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(o?r.altKey:r.ctrlKey)),a}function Gl(e,t,r,n){W?setTimeout(C(gs,e),0):e.curOp.focus=k();var a=Kl(e,r,n),L=e.doc.sel,H;e.options.dragDrop&&De&&!e.isReadOnly()&&r=="single"&&(H=L.contains(t))>-1&&(gt((H=L.ranges[H]).from(),t)<0||t.xRel>0)&&(gt(H.to(),t)>0||t.xRel<0)?zl(e,n,t,a):Vl(e,n,t,a)}function zl(e,t,r,n){var a=e.display,L=!1,H=en(e,function(Y){P&&(a.scroller.draggable=!1),e.state.draggingText=!1,Ke(a.wrapper.ownerDocument,"mouseup",H),Ke(a.wrapper.ownerDocument,"mousemove",z),Ke(a.scroller,"dragstart",X),Ke(a.scroller,"drop",H),L||(J(Y),n.addNew||Zi(e.doc,r,null,null,n.extend),P&&!p||W&&B==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),z=function(Y){L=L||Math.abs(t.clientX-Y.clientX)+Math.abs(t.clientY-Y.clientY)>=10},X=function(){return L=!0};P&&(a.scroller.draggable=!0),e.state.draggingText=H,H.copy=!n.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop(),Ce(a.wrapper.ownerDocument,"mouseup",H),Ce(a.wrapper.ownerDocument,"mousemove",z),Ce(a.scroller,"dragstart",X),Ce(a.scroller,"drop",H),vs(e),setTimeout(function(){return a.input.focus()},20)}function _o(e,t,r){if(r=="char")return new Pt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Pt(Fe(t.line,0),vt(e.doc,Fe(t.line+1,0)));var n=r(e,t);return new Pt(n.from,n.to)}function Vl(e,t,r,n){var a=e.display,L=e.doc;J(t);var H,z,X=L.sel,Y=X.ranges;if(n.addNew&&!n.extend?(z=L.sel.contains(r),z>-1?H=Y[z]:H=new Pt(r,r)):(H=L.sel.primary(),z=L.sel.primIndex),n.unit=="rectangle")n.addNew||(H=new Pt(r,r)),r=Pr(e,t,!0,!0),z=-1;else{var se=_o(e,r,n.unit);n.extend?H=Ma(H,se.anchor,se.head,n.extend):H=se}n.addNew?z==-1?(z=Y.length,hn(L,Gn(e,Y.concat([H]),z),{scroll:!1,origin:"*mouse"})):Y.length>1&&Y[z].empty()&&n.unit=="char"&&!n.extend?(hn(L,Gn(e,Y.slice(0,z).concat(Y.slice(z+1)),0),{scroll:!1,origin:"*mouse"}),X=L.sel):Na(L,z,H,me):(z=0,hn(L,new Mn([H],0),me),X=L.sel);var ce=r;function Te(Ze){if(gt(ce,Ze)==0)return;if(ce=Ze,n.unit=="rectangle"){for(var at=[],mt=e.options.tabSize,ht=j(lt(L,r.line).text,r.ch,mt),Et=j(lt(L,Ze.line).text,Ze.ch,mt),Ht=Math.min(ht,Et),nn=Math.max(ht,Et),Vt=Math.min(r.line,Ze.line),Cn=Math.min(e.lastLine(),Math.max(r.line,Ze.line));Vt<=Cn;Vt++){var xn=lt(L,Vt).text,Jt=pe(xn,Ht,mt);Ht==nn?at.push(new Pt(Fe(Vt,Jt),Fe(Vt,Jt))):xn.length>Jt&&at.push(new Pt(Fe(Vt,Jt),Fe(Vt,pe(xn,nn,mt))))}at.length||at.push(new Pt(r,r)),hn(L,Gn(e,X.ranges.slice(0,z).concat(at),z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ze)}else{var wn=H,un=_o(e,Ze,n.unit),qt=wn.anchor,Qt;gt(un.anchor,qt)>0?(Qt=un.head,qt=Un(wn.from(),un.anchor)):(Qt=un.anchor,qt=cr(wn.to(),un.head));var Yt=X.ranges.slice(0);Yt[z]=Xl(e,new Pt(vt(L,qt),Qt)),hn(L,Gn(e,Yt,z),me)}}var be=a.wrapper.getBoundingClientRect(),Ie=0;function Ne(Ze){var at=++Ie,mt=Pr(e,Ze,!0,n.unit=="rectangle");if(!mt)return;if(gt(mt,ce)!=0){e.curOp.focus=k(),Te(mt);var ht=Vi(a,L);(mt.line>=ht.to||mt.line<ht.from)&&setTimeout(en(e,function(){Ie==at&&Ne(Ze)}),150)}else{var Et=Ze.clientY<be.top?-20:Ze.clientY>be.bottom?20:0;Et&&setTimeout(en(e,function(){if(Ie!=at)return;a.scroller.scrollTop+=Et,Ne(Ze)}),50)}}function Ge(Ze){e.state.selectingText=!1,Ie=Infinity,Ze&&(J(Ze),a.input.focus()),Ke(a.wrapper.ownerDocument,"mousemove",Qe),Ke(a.wrapper.ownerDocument,"mouseup",tt),L.history.lastSelOrigin=null}var Qe=en(e,function(Ze){Ze.buttons===0||!Re(Ze)?Ge(Ze):Ne(Ze)}),tt=en(e,Ge);e.state.selectingText=tt,Ce(a.wrapper.ownerDocument,"mousemove",Qe),Ce(a.wrapper.ownerDocument,"mouseup",tt)}function Xl(e,t){var r=t.anchor,n=t.head,a=lt(e.doc,r.line);if(gt(r,n)==0&&r.sticky==n.sticky)return t;var L=Xe(a);if(!L)return t;var H=je(L,r.ch,r.sticky),z=L[H];if(z.from!=r.ch&&z.to!=r.ch)return t;var X=H+(z.from==r.ch==(z.level!=1)?0:1);if(X==0||X==L.length)return t;var Y;if(n.line!=r.line)Y=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var se=je(L,n.ch,n.sticky),ce=se-H||(n.ch-r.ch)*(z.level==1?-1:1);se==X-1||se==X?Y=ce<0:Y=ce>0}var Te=L[X+(Y?-1:0)],be=Y==(Te.level==1),Ie=be?Te.from:Te.to,Ne=be?"after":"before";return r.ch==Ie&&r.sticky==Ne?t:new Pt(new Fe(r.line,Ie,Ne),n)}function yo(e,t,r,n){var a,L;if(t.touches)a=t.touches[0].clientX,L=t.touches[0].clientY;else try{a=t.clientX,L=t.clientY}catch(Te){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&J(t);var H=e.display,z=H.lineDiv.getBoundingClientRect();if(L>z.bottom||!le(e,r))return re(t);L-=z.top-H.viewOffset;for(var X=0;X<e.display.gutterSpecs.length;++X){var Y=H.gutters.childNodes[X];if(Y&&Y.getBoundingClientRect().right>=a){var se=Ln(e.doc,L),ce=e.display.gutterSpecs[X];return Se(e,r,e,se,ce.className,t),re(t)}}}function Wa(e,t){return yo(e,t,"gutterClick",!0)}function bo(e,t){if(ir(e.display,t)||Yl(e,t))return;if(Me(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Yl(e,t){return le(e,"gutterContextMenu")?yo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gi(e)}var ii={toString:function(){return"CodeMirror.Init"}},To={},aa={};function $l(e){var t=e.optionHandlers;function r(n,a,L,H){e.defaults[n]=a,L&&(t[n]=H?function(z,X,Y){Y!=ii&&L(z,X,Y)}:L)}e.defineOption=r,e.Init=ii,r("value","",function(n,a){return n.setValue(a)},!0),r("mode",null,function(n,a){n.doc.modeOption=a,Da(n)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){wi(n),gi(n),En(n)},!0),r("lineSeparator",null,function(n,a){if(n.doc.lineSep=a,!a)return;var L=[],H=n.doc.first;n.doc.iter(function(X){for(var Y=0;;){var se=X.text.indexOf(a,Y);if(se==-1)break;Y=se+a.length,L.push(Fe(H,se))}H++});for(var z=L.length-1;z>=0;z--)ei(n.doc,a,L[z],Fe(L[z].line,L[z].ch+a.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,a,L){n.state.specialChars=new RegExp(a.source+(a.test(" ")?"":"| "),"g"),L!=ii&&n.refresh()}),r("specialCharPlaceholder",jt,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,a){return n.getInputField().spellcheck=a},!0),r("autocorrect",!1,function(n,a){return n.getInputField().autocorrect=a},!0),r("autocapitalize",!1,function(n,a){return n.getInputField().autocapitalize=a},!0),r("rtlMoveVisually",!A),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Eo(n),xi(n)},!0),r("keyMap","default",function(n,a,L){var H=ra(a),z=L!=ii&&ra(L);z&&z.detach&&z.detach(n,H),H.attach&&H.attach(n,z||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ql,!0),r("gutters",[],function(n,a){n.display.gutterSpecs=La(a,n.options.lineNumbers),xi(n)},!0),r("fixedGutter",!0,function(n,a){n.display.gutters.style.left=a?ba(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Jr(n)},!0),r("scrollbarStyle","native",function(n){xs(n),Jr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,a){n.display.gutterSpecs=La(n.options.gutters,a),xi(n)},!0),r("firstLineNumber",1,xi,!0),r("lineNumberFormatter",function(n){return n},xi,!0),r("showCursorWhenSelecting",!1,vi,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,a){a=="nocursor"&&(Yr(n),n.display.input.blur()),n.display.input.readOnlyChanged(a)}),r("screenReaderLabel",null,function(n,a){a=a===""?null:a,n.display.input.screenReaderLabelChanged(a)}),r("disableInput",!1,function(n,a){a||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,vi,!0),r("singleCursorHeightPerLine",!0,vi,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,wi,!0),r("addModeClass",!1,wi,!0),r("pollInterval",100),r("undoDepth",200,function(n,a){return n.doc.history.undoDepth=a}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,wi,!0),r("moveInputWithCursor",!0,function(n,a){a||n.display.input.resetPosition()}),r("tabindex",null,function(n,a){return n.display.input.getField().tabIndex=a||""}),r("autofocus",null),r("direction","ltr",function(n,a){return n.doc.setDirection(a)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=ii;if(!t!=!n){var a=e.display.dragFunctions,L=t?Ce:Ke;L(e.display.scroller,"dragstart",a.start),L(e.display.scroller,"dragenter",a.enter),L(e.display.scroller,"dragover",a.over),L(e.display.scroller,"dragleave",a.leave),L(e.display.scroller,"drop",a.drop)}}function Ql(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(w(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ea(e),En(e),gi(e),setTimeout(function(){return Jr(e)},100)}function zt(e,t){var r=this;if(!(this instanceof zt))return new zt(e,t);this.options=t=t?y(t):{},y(To,t,!1);var n=t.value;typeof n=="string"?n=new Tn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var a=new zt.inputStyles[t.inputStyle](this),L=this.display=new dl(e,n,a,t);L.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xs(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 K,keySeq:null,specialChars:null},t.autofocus&&!i&&L.input.focus(),W&&B<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Cl(),Ur(this),this.curOp.forceUpdate=!0,Ps(this,n),t.autofocus&&!i||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&xa(r)},20):Yr(this);for(var H in aa)aa.hasOwnProperty(H)&&aa[H](this,t[H],ii);Os(this),t.finishInit&&t.finishInit(this);for(var z=0;z<Ka.length;++z)Ka[z](this);Fr(this),P&&t.lineWrapping&&getComputedStyle(L.lineDiv).textRendering=="optimizelegibility"&&(L.lineDiv.style.textRendering="auto")}zt.defaults=To,zt.optionHandlers=aa;function Zl(e){var t=e.display;Ce(t.scroller,"mousedown",en(e,vo)),W&&B<11?Ce(t.scroller,"dblclick",en(e,function(X){if(Me(e,X))return;var Y=Pr(e,X);if(!Y||Wa(e,X)||ir(e.display,X))return;J(X);var se=e.findWordAt(Y);Zi(e.doc,se.anchor,se.head)})):Ce(t.scroller,"dblclick",function(X){return Me(e,X)||J(X)}),Ce(t.scroller,"contextmenu",function(X){return bo(e,X)}),Ce(t.input.getField(),"contextmenu",function(X){t.scroller.contains(X.target)||bo(e,X)});var r,n={end:0};function a(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function L(X){if(X.touches.length!=1)return!1;var Y=X.touches[0];return Y.radiusX<=1&&Y.radiusY<=1}function H(X,Y){if(Y.left==null)return!0;var se=Y.left-X.left,ce=Y.top-X.top;return se*se+ce*ce>20*20}Ce(t.scroller,"touchstart",function(X){if(!Me(e,X)&&!L(X)&&!Wa(e,X)){t.input.ensurePolled(),clearTimeout(r);var Y=+new Date;t.activeTouch={start:Y,moved:!1,prev:Y-n.end<=300?n:null},X.touches.length==1&&(t.activeTouch.left=X.touches[0].pageX,t.activeTouch.top=X.touches[0].pageY)}}),Ce(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ce(t.scroller,"touchend",function(X){var Y=t.activeTouch;if(Y&&!ir(t,X)&&Y.left!=null&&!Y.moved&&new Date-Y.start<300){var se=e.coordsChar(t.activeTouch,"page"),ce;!Y.prev||H(Y,Y.prev)?ce=new Pt(se,se):!Y.prev.prev||H(Y,Y.prev.prev)?ce=e.findWordAt(se):ce=new Pt(Fe(se.line,0),vt(e.doc,Fe(se.line+1,0))),e.setSelection(ce.anchor,ce.head),e.focus(),J(X)}a()}),Ce(t.scroller,"touchcancel",a),Ce(t.scroller,"scroll",function(){t.scroller.clientHeight&&(yi(e,t.scroller.scrollTop),Mr(e,t.scroller.scrollLeft,!0),Se(e,"scroll",e))}),Ce(t.scroller,"mousewheel",function(X){return Cs(e,X)}),Ce(t.scroller,"DOMMouseScroll",function(X){return Cs(e,X)}),Ce(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){Me(e,X)||oe(X)},over:function(X){Me(e,X)||(Al(e,X),oe(X))},start:function(X){return Rl(e,X)},drop:en(e,Ol),leave:function(X){Me(e,X)||ro(e)}};var z=t.input.getField();Ce(z,"keyup",function(X){return mo.call(e,X)}),Ce(z,"keydown",en(e,po)),Ce(z,"keypress",en(e,go)),Ce(z,"focus",function(X){return xa(e,X)}),Ce(z,"blur",function(X){return Yr(e,X)})}var Ka=[];zt.defineInitHook=function(e){return Ka.push(e)};function Ui(e,t,r,n){var a=e.doc,L;r==null&&(r="add"),r=="smart"&&(a.mode.indent?L=In(e,t).state:r="prev");var H=e.options.tabSize,z=lt(a,t),X=j(z.text,null,H);z.stateAfter&&(z.stateAfter=null);var Y=z.text.match(/^\s*/)[0],se;if(!n&&!/\S/.test(z.text))se=0,r="not";else if(r=="smart"&&(se=a.mode.indent(L,z.text.slice(Y.length),z.text),se==_e||se>150)){if(!n)return;r="prev"}r=="prev"?t>a.first?se=j(lt(a,t-1).text,null,H):se=0:r=="add"?se=X+e.options.indentUnit:r=="subtract"?se=X-e.options.indentUnit:typeof r=="number"&&(se=X+r),se=Math.max(0,se);var ce="",Te=0;if(e.options.indentWithTabs)for(var be=Math.floor(se/H);be;--be)Te+=H,ce+=" ";if(Te<se&&(ce+=he(se-Te)),ce!=Y)return ei(a,ce,Fe(t,0),Fe(t,Y.length),"+input"),z.stateAfter=null,!0;for(var Ie=0;Ie<a.sel.ranges.length;Ie++){var Ne=a.sel.ranges[Ie];if(Ne.head.line==t&&Ne.head.ch<Y.length){var Ge=Fe(t,Y.length);Na(a,Ie,new Pt(Ge,Ge));break}}}var zn=null;function sa(e){zn=e}function Ga(e,t,r,n,a){var L=e.doc;e.display.shift=!1,n||(n=L.sel);var H=+new Date-200,z=a=="paste"||e.state.pasteIncoming>H,X=_t(t),Y=null;if(z&&n.ranges.length>1)if(zn&&zn.text.join(`
`)==t){if(n.ranges.length%zn.text.length==0){Y=[];for(var se=0;se<zn.text.length;se++)Y.push(L.splitLines(zn.text[se]))}}else X.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(Y=ie(X,function(Qe){return[Qe]}));for(var ce=e.curOp.updateInput,Te=n.ranges.length-1;Te>=0;Te--){var be=n.ranges[Te],Ie=be.from(),Ne=be.to();be.empty()&&(r&&r>0?Ie=Fe(Ie.line,Ie.ch-r):e.state.overwrite&&!z?Ne=Fe(Ne.line,Math.min(lt(L,Ne.line).text.length,Ne.ch+$(X).length)):z&&zn&&zn.lineWise&&zn.text.join(`
`)==X.join(`
`)&&(Ie=Ne=Fe(Ie.line,0)));var Ge={from:Ie,to:Ne,text:Y?Y[Te%Y.length]:X,origin:a||(z?"paste":e.state.cutIncoming>H?"cut":"+input")};qr(e.doc,Ge),ln(e,"inputRead",e,Ge)}t&&!z&&wo(e,t),$r(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function xo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&An(t,function(){return Ga(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var a=r.ranges[n];if(a.head.ch>100||n&&r.ranges[n-1].head.line==a.head.line)continue;var L=e.getModeAt(a.head),H=!1;if(L.electricChars){for(var z=0;z<L.electricChars.length;z++)if(t.indexOf(L.electricChars.charAt(z))>-1){H=Ui(e,a.head.line,"smart");break}}else L.electricInput&&(L.electricInput.test(lt(e.doc,a.head.line).text.slice(0,a.head.ch))&&(H=Ui(e,a.head.line,"smart")));H&&ln(e,"electricInput",e,a.head.line)}}function So(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var a=e.doc.sel.ranges[n].head.line,L={anchor:Fe(a,0),head:Fe(a+1,0)};r.push(L),t.push(e.getRange(L.anchor,L.head))}return{text:t,ranges:r}}function Oo(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ro(){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 P?e.style.width="1000px":e.setAttribute("wrap","off"),h&&(e.style.border="1px solid black"),Oo(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,a){var L=this.options,H=L[n];if(L[n]==a&&n!="mode")return;L[n]=a,t.hasOwnProperty(n)&&en(this,t[n])(this,a,H),Se(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,a){this.state.keyMaps[a?"push":"unshift"](ra(n))},removeKeyMap:function(n){for(var a=this.state.keyMaps,L=0;L<a.length;++L)if(a[L]==n||a[L].name==n)return a.splice(L,1),!0},addOverlay:mn(function(n,a){var L=n.token?n:e.getMode(this.options,n);if(L.startState)throw new Error("Overlays may not be stateful.");ee(this.state.overlays,{mode:L,modeSpec:n,opaque:a&&a.opaque,priority:a&&a.priority||0},function(H){return H.priority}),this.state.modeGen++,En(this)}),removeOverlay:mn(function(n){for(var a=this.state.overlays,L=0;L<a.length;++L){var H=a[L].modeSpec;if(H==n||typeof n=="string"&&H.name==n){a.splice(L,1),this.state.modeGen++,En(this);return}}}),indentLine:mn(function(n,a,L){typeof a!="string"&&typeof a!="number"&&(a==null?a=this.options.smartIndent?"smart":"prev":a=a?"add":"subtract"),pn(this.doc,n)&&Ui(this,n,a,L)}),indentSelection:mn(function(n){for(var a=this.doc.sel.ranges,L=-1,H=0;H<a.length;H++){var z=a[H];if(z.empty())z.head.line>L&&(Ui(this,z.head.line,n,!0),L=z.head.line,H==this.doc.sel.primIndex&&$r(this));else{var X=z.from(),Y=z.to(),se=Math.max(L,X.line);L=Math.min(this.lastLine(),Y.line-(Y.ch?0:1))+1;for(var ce=se;ce<L;++ce)Ui(this,ce,n);var Te=this.doc.sel.ranges;X.ch==0&&a.length==Te.length&&Te[H].from().ch>0&&Na(this.doc,H,new Pt(X,Te[H].to()),de)}}}),getTokenAt:function(n,a){return Ar(this,n,a)},getLineTokens:function(n,a){return Ar(this,Fe(n),a,!0)},getTokenTypeAt:function(n){n=vt(this.doc,n);var a=Vn(this,lt(this.doc,n.line)),L=0,H=(a.length-1)/2,z=n.ch,X;if(z==0)X=a[2];else for(;;){var Y=L+H>>1;if((Y?a[Y*2-1]:0)>=z)H=Y;else if(a[Y*2+1]<z)L=Y+1;else{X=a[Y*2+2];break}}var se=X?X.indexOf("overlay "):-1;return se<0?X:se==0?null:X.slice(0,se-1)},getModeAt:function(n){var a=this.doc.mode;return a.innerMode?e.innerMode(a,this.getTokenAt(n).state).mode:a},getHelper:function(n,a){return this.getHelpers(n,a)[0]},getHelpers:function(n,a){var L=[];if(!r.hasOwnProperty(a))return L;var H=r[a],z=this.getModeAt(n);if(typeof z[a]=="string")H[z[a]]&&L.push(H[z[a]]);else if(z[a])for(var X=0;X<z[a].length;X++){var Y=H[z[a][X]];Y&&L.push(Y)}else z.helperType&&H[z.helperType]?L.push(H[z.helperType]):H[z.name]&&L.push(H[z.name]);for(var se=0;se<H._global.length;se++){var ce=H._global[se];ce.pred(z,this)&&Q(L,ce.val)==-1&&L.push(ce.val)}return L},getStateAfter:function(n,a){var L=this.doc;return n=hr(L,n==null?L.first+L.size-1:n),In(this,n+1,a).state},cursorCoords:function(n,a){var L,H=this.doc.sel.primary();return n==null?L=H.head:typeof n=="object"?L=vt(this.doc,n):L=n?H.from():H.to(),Kn(this,L,a||"page")},charCoords:function(n,a){return ma(this,vt(this.doc,n),a||"page")},coordsChar:function(n,a){return n=ls(this,n,a||"page"),va(this,n.left,n.top)},lineAtHeight:function(n,a){return n=ls(this,{top:n,left:0},a||"page").top,Ln(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,a,L){var H=!1,z;if(typeof n=="number"){var X=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>X&&(n=X,H=!0),z=lt(this.doc,n)}else z=n;return Wi(this,z,{top:0,left:0},a||"page",L||H).top+(H?this.doc.height-Wn(z):0)},defaultTextHeight:function(){return Vr(this.display)},defaultCharWidth:function(){return Xr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,a,L,H,z){var X=this.display;n=Kn(this,vt(this.doc,n));var Y=n.bottom,se=n.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),X.sizer.appendChild(a),H=="over")Y=n.top;else if(H=="above"||H=="near"){var ce=Math.max(X.wrapper.clientHeight,this.doc.height),Te=Math.max(X.sizer.clientWidth,X.lineSpace.clientWidth);(H=="above"||n.bottom+a.offsetHeight>ce)&&n.top>a.offsetHeight?Y=n.top-a.offsetHeight:n.bottom+a.offsetHeight<=ce&&(Y=n.bottom),se+a.offsetWidth>Te&&(se=Te-a.offsetWidth)}a.style.top=Y+"px",a.style.left=a.style.right="",z=="right"?(se=X.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(z=="left"?se=0:z=="middle"&&(se=(X.sizer.clientWidth-a.offsetWidth)/2),a.style.left=se+"px"),L&&Jo(this,{left:se,top:Y,right:se+a.offsetWidth,bottom:Y+a.offsetHeight})},triggerOnKeyDown:mn(po),triggerOnKeyPress:mn(go),triggerOnKeyUp:mo,triggerOnMouseDown:mn(vo),execCommand:function(n){if(Pi.hasOwnProperty(n))return Pi[n].call(null,this)},triggerElectric:mn(function(n){wo(this,n)}),findPosH:function(n,a,L,H){var z=1;a<0&&(z=-1,a=-a);for(var X=vt(this.doc,n),Y=0;Y<a&&!(X=za(this.doc,X,z,L,H),X.hitSide);++Y);return X},moveH:mn(function(n,a){var L=this;this.extendSelectionsBy(function(H){return L.display.shift||L.doc.extend||H.empty()?za(L.doc,H.head,n,a,L.options.rtlMoveVisually):n<0?H.from():H.to()},fe)}),deleteH:mn(function(n,a){var L=this.doc.sel,H=this.doc;L.somethingSelected()?H.replaceSelection("",null,"+delete"):ri(this,function(z){var X=za(H,z.head,n,a,!1);return n<0?{from:X,to:z.head}:{from:z.head,to:X}})}),findPosV:function(n,a,L,H){var z=1,X=H;a<0&&(z=-1,a=-a);for(var Y=vt(this.doc,n),se=0;se<a;++se){var ce=Kn(this,Y,"div");if(X==null?X=ce.left:ce.left=X,Y=Ao(this,ce,z,L),Y.hitSide)break}return Y},moveV:mn(function(n,a){var L=this,H=this.doc,z=[],X=!this.display.shift&&!H.extend&&H.sel.somethingSelected();if(H.extendSelectionsBy(function(se){if(X)return n<0?se.from():se.to();var ce=Kn(L,se.head,"div");se.goalColumn!=null&&(ce.left=se.goalColumn),z.push(ce.left);var Te=Ao(L,ce,n,a);return a=="page"&&se==H.sel.primary()&&Sa(L,ma(L,Te,"div").top-ce.top),Te},fe),z.length)for(var Y=0;Y<H.sel.ranges.length;Y++)H.sel.ranges[Y].goalColumn=z[Y]}),findWordAt:function(n){var a=this.doc,L=lt(a,n.line).text,H=n.ch,z=n.ch;if(L){var X=this.getHelper(n,"wordChars");(n.sticky=="before"||z==L.length)&&H?--H:++z;for(var Y=L.charAt(H),se=Le(Y,X)?function(ce){return Le(ce,X)}:/\s/.test(Y)?function(ce){return/\s/.test(ce)}:function(ce){return!/\s/.test(ce)&&!Le(ce)};H>0&&se(L.charAt(H-1));)--H;for(;z<L.length&&se(L.charAt(z));)++z}return new Pt(Fe(n.line,H),Fe(n.line,z))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):w(this.display.cursorDiv,"CodeMirror-overwrite"),Se(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==k()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:mn(function(n,a){_i(this,n,a)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-$n(this)-this.display.barHeight,width:n.scrollWidth-$n(this)-this.display.barWidth,clientHeight:ha(this),clientWidth:Ir(this)}},scrollIntoView:mn(function(n,a){n==null?(n={from:this.doc.sel.primary().head,to:null},a==null&&(a=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Fe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=a||0,n.from.line!=null?Qo(this,n):ys(this,n.from,n.to,n.margin)}),setSize:mn(function(n,a){var L=this,H=function(X){return typeof X=="number"||/^\d+$/.test(String(X))?X+"px":X};n!=null&&(this.display.wrapper.style.width=H(n)),a!=null&&(this.display.wrapper.style.height=H(a)),this.options.lineWrapping&&as(this);var z=this.display.viewFrom;this.doc.iter(z,this.display.viewTo,function(X){if(X.widgets){for(var Y=0;Y<X.widgets.length;Y++)if(X.widgets[Y].noHScroll){vr(L,z,"widget");break}}++z}),this.curOp.forceUpdate=!0,Se(this,"refresh",this)}),operation:function(n){return An(this,n)},startOperation:function(){return Ur(this)},endOperation:function(){return Fr(this)},refresh:mn(function(){var n=this.display.cachedTextHeight;En(this),this.curOp.forceUpdate=!0,gi(this),_i(this,this.doc.scrollLeft,this.doc.scrollTop),Aa(this.display),(n==null||Math.abs(n-Vr(this.display))>.5||this.options.lineWrapping)&&Ea(this),Se(this,"refresh",this)}),swapDoc:mn(function(n){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Ps(this,n),gi(this),this.display.input.reset(),_i(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,a),a}),phrase:function(n){var a=this.options.phrases;return a&&Object.prototype.hasOwnProperty.call(a,n)?a[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ue(e),e.registerHelper=function(n,a,L){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][a]=L},e.registerGlobalHelper=function(n,a,L,H){e.registerHelper(n,a,H),r[n]._global.push({pred:L,val:H})}}function za(e,t,r,n,a){var L=t,H=r,z=lt(e,t.line),X=a&&e.direction=="rtl"?-r:r;function Y(){var tt=t.line+X;return tt<e.first||tt>=e.first+e.size?!1:(t=new Fe(tt,t.ch,t.sticky),z=lt(e,tt))}function se(tt){var Ze;if(n=="codepoint"){var at=z.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(at)?Ze=null:Ze=new Fe(t.line,Math.max(0,Math.min(z.text.length,t.ch+r*(at>=55296&&at<56320?2:1))),-r)}else a?Ze=kl(e.cm,z,t,r):Ze=Fa(z,t,r);if(Ze==null)if(!tt&&Y())t=Ba(a,e.cm,z,t.line,X);else return!1;else t=Ze;return!0}if(n=="char"||n=="codepoint")se();else if(n=="column")se(!0);else if(n=="word"||n=="group")for(var ce=null,Te=n=="group",be=e.cm&&e.cm.getHelper(t,"wordChars"),Ie=!0;!(r<0&&!se(!Ie));Ie=!1){var Ne=z.text.charAt(t.ch)||`
`,Ge=Le(Ne,be)?"w":Te&&Ne==`
`?"n":!Te||/\s/.test(Ne)?null:"p";if(Te&&!Ie&&!Ge&&(Ge="s"),ce&&ce!=Ge){r<0&&(r=1,se(),t.sticky="after");break}if(Ge&&(ce=Ge),r>0&&!se(!Ie))break}var Qe=ea(e,t,L,H,!0);return Sr(L,Qe)&&(Qe.hitSide=!0),Qe}function Ao(e,t,r,n){var a=e.doc,L=t.left,H;if(n=="page"){var z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(z-.5*Vr(e.display),3);H=(r>0?t.bottom:t.top)+r*X}else n=="line"&&(H=r>0?t.bottom+3:t.top-3);for(var Y;!(Y=va(e,L,H),!Y.outside);){if(r<0?H<=0:H>=a.height){Y.hitSide=!0;break}H+=r*5}return Y}var Ut=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new K,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ut.prototype.init=function(e){var t=this,r=this,n=r.cm,a=r.div=e.lineDiv;Oo(a,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function L(z){for(var X=z.target;X;X=X.parentNode){if(X==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(X.className))break}return!1}Ce(a,"paste",function(z){if(!L(z)||Me(n,z)||xo(z,n))return;B<=11&&setTimeout(en(n,function(){return t.updateFromDOM()}),20)}),Ce(a,"compositionstart",function(z){t.composing={data:z.data,done:!1}}),Ce(a,"compositionupdate",function(z){t.composing||(t.composing={data:z.data,done:!1})}),Ce(a,"compositionend",function(z){t.composing&&(z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ce(a,"touchstart",function(){return r.forceCompositionEnd()}),Ce(a,"input",function(){t.composing||t.readFromDOMSoon()});function H(z){if(!L(z)||Me(n,z))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),z.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var X=So(n);sa({lineWise:!0,text:X.text}),z.type=="cut"&&n.operation(function(){n.setSelections(X.ranges,0,de),n.replaceSelection("",null,"cut")})}else return;if(z.clipboardData){z.clipboardData.clearData();var Y=zn.text.join(`
`);if(z.clipboardData.setData("Text",Y),z.clipboardData.getData("Text")==Y){z.preventDefault();return}}var se=Ro(),ce=se.firstChild;n.display.lineSpace.insertBefore(se,n.display.lineSpace.firstChild),ce.value=zn.text.join(`
`);var Te=document.activeElement;U(ce),setTimeout(function(){n.display.lineSpace.removeChild(se),Te.focus(),Te==a&&r.showPrimarySelection()},50)}Ce(a,"copy",H),Ce(a,"cut",H)},Ut.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ut.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ut.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ut.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ut.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var L=oa(t,e.anchorNode,e.anchorOffset),H=oa(t,e.focusNode,e.focusOffset);if(L&&!L.bad&&H&&!H.bad&&gt(Un(L,H),n)==0&&gt(cr(L,H),a)==0)return;var z=t.display.view,X=n.line>=t.display.viewFrom&&Co(t,n)||{node:z[0].measure.map[2],offset:0},Y=a.line<t.display.viewTo&&Co(t,a);if(!Y){var se=z[z.length-1].measure,ce=se.maps?se.maps[se.maps.length-1]:se.map;Y={node:ce[ce.length-1],offset:ce[ce.length-2]-ce[ce.length-3]}}if(!X||!Y){e.removeAllRanges();return}var Te=e.rangeCount&&e.getRangeAt(0),be;try{be=g(X.node,X.offset,Y.offset,Y.node)}catch(Ie){}be&&(!D&&t.state.focused?(e.collapse(X.node,X.offset),be.collapsed||(e.removeAllRanges(),e.addRange(be))):(e.removeAllRanges(),e.addRange(be)),Te&&e.anchorNode==null?e.addRange(Te):D&&this.startGracePeriod()),this.rememberSelection()},Ut.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)},Ut.prototype.showMultipleSelections=function(e){_(this.cm.display.cursorDiv,e.cursors),_(this.cm.display.selectionDiv,e.selection)},Ut.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ut.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},Ut.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ut.prototype.blur=function(){this.div.blur()},Ut.prototype.getField=function(){return this.div},Ut.prototype.supportsTouch=function(){return!0},Ut.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():An(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)},Ut.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ut.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=oa(t,e.anchorNode,e.anchorOffset),n=oa(t,e.focusNode,e.focusOffset);r&&n&&An(t,function(){hn(t.doc,yr(r,n),de),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Ut.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),a=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Fe(n.line-1,lt(e.doc,n.line-1).length)),a.ch==lt(e.doc,a.line).text.length&&a.line<e.lastLine()&&(a=Fe(a.line+1,0)),n.line<t.viewFrom||a.line>t.viewTo-1)return!1;var L,H,z;n.line==t.viewFrom||(L=kr(e,n.line))==0?(H=At(t.view[0].line),z=t.view[0].node):(H=At(t.view[L].line),z=t.view[L-1].node.nextSibling);var X=kr(e,a.line),Y,se;if(X==t.view.length-1?(Y=t.viewTo-1,se=t.lineDiv.lastChild):(Y=At(t.view[X+1].line)-1,se=t.view[X+1].node.previousSibling),!z)return!1;for(var ce=e.doc.splitLines(tu(e,z,se,H,Y)),Te=Nn(e.doc,Fe(H,0),Fe(Y,lt(e.doc,Y).text.length));ce.length>1&&Te.length>1;)if($(ce)==$(Te))ce.pop(),Te.pop(),Y--;else if(ce[0]==Te[0])ce.shift(),Te.shift(),H++;else break;for(var be=0,Ie=0,Ne=ce[0],Ge=Te[0],Qe=Math.min(Ne.length,Ge.length);be<Qe&&Ne.charCodeAt(be)==Ge.charCodeAt(be);)++be;for(var tt=$(ce),Ze=$(Te),at=Math.min(tt.length-(ce.length==1?be:0),Ze.length-(Te.length==1?be:0));Ie<at&&tt.charCodeAt(tt.length-Ie-1)==Ze.charCodeAt(Ze.length-Ie-1);)++Ie;if(ce.length==1&&Te.length==1&&H==n.line)for(;be&&be>n.ch&&tt.charCodeAt(tt.length-Ie-1)==Ze.charCodeAt(Ze.length-Ie-1);)be--,Ie++;ce[ce.length-1]=tt.slice(0,tt.length-Ie).replace(/^\u200b+/,""),ce[0]=ce[0].slice(be).replace(/\u200b+$/,"");var mt=Fe(H,be),ht=Fe(Y,Te.length?$(Te).length-Ie:0);if(ce.length>1||ce[0]||gt(mt,ht))return ei(e.doc,ce,mt,ht,"+input"),!0},Ut.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ut.prototype.reset=function(){this.forceCompositionEnd()},Ut.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ut.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)},Ut.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&An(this.cm,function(){return En(e.cm)})},Ut.prototype.setUneditable=function(e){e.contentEditable="false"},Ut.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||en(this.cm,Ga)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ut.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ut.prototype.onContextMenu=function(){},Ut.prototype.resetPosition=function(){},Ut.prototype.needsContentAttribute=!0;function Co(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var n=lt(e.doc,t.line),a=es(r,n,t.line),L=Xe(n,e.doc.direction),H="left";if(L){var z=je(L,t.ch);H=z%2?"right":"left"}var X=rs(a.map,t.ch,H);return X.offset=X.collapse=="right"?X.end:X.start,X}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ai(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,a){var L="",H=!1,z=e.doc.lineSeparator(),X=!1;function Y(be){return function(Ie){return Ie.id==be}}function se(){H&&(L+=z,X&&(L+=z),H=X=!1)}function ce(be){be&&(se(),L+=be)}function Te(be){if(be.nodeType==1){var Ie=be.getAttribute("cm-text");if(Ie){ce(Ie);return}var Ne=be.getAttribute("cm-marker"),Ge;if(Ne){var Qe=e.findMarks(Fe(n,0),Fe(a+1,0),Y(+Ne));Qe.length&&(Ge=Qe[0].find(0))&&ce(Nn(e.doc,Ge.from,Ge.to).join(z));return}if(be.getAttribute("contenteditable")=="false")return;var tt=/^(pre|div|p|li|table|br)$/i.test(be.nodeName);if(!/^br$/i.test(be.nodeName)&&be.textContent.length==0)return;tt&&se();for(var Ze=0;Ze<be.childNodes.length;Ze++)Te(be.childNodes[Ze]);/^(pre|p)$/i.test(be.nodeName)&&(X=!0),tt&&(H=!0)}else be.nodeType==3&&ce(be.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Te(t),t==r);)t=t.nextSibling,X=!1;return L}function oa(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return ai(e.clipPos(Fe(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var a=0;a<e.display.view.length;a++){var L=e.display.view[a];if(L.node==n)return nu(L,t,r)}}function nu(e,t,r){var n=e.text.firstChild,a=!1;if(!t||!b(n,t))return ai(Fe(At(e.line),0),!0);if(t==n&&(a=!0,t=n.childNodes[r],r=0,!t)){var L=e.rest?$(e.rest):e.line;return ai(Fe(At(L),L.text.length),a)}var H=t.nodeType==3?t:null,z=t;for(!H&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(H=t.firstChild,r&&(r=H.nodeValue.length));z.parentNode!=n;)z=z.parentNode;var X=e.measure,Y=X.maps;function se(Ge,Qe,tt){for(var Ze=-1;Ze<(Y?Y.length:0);Ze++)for(var at=Ze<0?X.map:Y[Ze],mt=0;mt<at.length;mt+=3){var ht=at[mt+2];if(ht==Ge||ht==Qe){var Et=At(Ze<0?e.line:e.rest[Ze]),Ht=at[mt]+tt;return(tt<0||ht!=Ge)&&(Ht=at[mt+(tt?1:0)]),Fe(Et,Ht)}}}var ce=se(H,z,r);if(ce)return ai(ce,a);for(var Te=z.nextSibling,be=H?H.nodeValue.length-r:0;Te;Te=Te.nextSibling){if(ce=se(Te,Te.firstChild,0),ce)return ai(Fe(ce.line,ce.ch-be),a);be+=Te.textContent.length}for(var Ie=z.previousSibling,Ne=r;Ie;Ie=Ie.previousSibling){if(ce=se(Ie,Ie.firstChild,-1),ce)return ai(Fe(ce.line,ce.ch+Ne),a);Ne+=Ie.textContent.length}}var $t=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new K,this.hasSelection=!1,this.composing=null};$t.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var a=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),h&&(a.style.width="0px"),Ce(a,"input",function(){W&&B>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Ce(a,"paste",function(H){if(Me(n,H)||xo(H,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function L(H){if(Me(n,H))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var z=So(n);sa({lineWise:!0,text:z.text}),H.type=="cut"?n.setSelections(z.ranges,null,de):(r.prevInput="",a.value=z.text.join(`
`),U(a))}else return;H.type=="cut"&&(n.state.cutIncoming=+new Date)}Ce(a,"cut",L),Ce(a,"copy",L),Ce(e.scroller,"paste",function(H){if(ir(e,H)||Me(n,H))return;if(!a.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var z=new Event("paste");z.clipboardData=H.clipboardData,a.dispatchEvent(z)}),Ce(e.lineSpace,"selectstart",function(H){ir(e,H)||J(H)}),Ce(a,"compositionstart",function(){var H=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:H,range:n.markText(H,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ce(a,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},$t.prototype.createField=function(e){this.wrapper=Ro(),this.textarea=this.wrapper.firstChild},$t.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$t.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var a=Kn(e,r.sel.primary().head,"div"),L=t.wrapper.getBoundingClientRect(),H=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+H.top-L.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+H.left-L.left))}return n},$t.prototype.showSelection=function(e){var t=this.cm,r=t.display;_(r.cursorDiv,e.cursors),_(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$t.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&U(this.textarea),W&&B>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",W&&B>=9&&(this.hasSelection=null))},$t.prototype.getField=function(){return this.textarea},$t.prototype.supportsTouch=function(){return!1},$t.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||k()!=this.textarea))try{this.textarea.focus()}catch(e){}},$t.prototype.blur=function(){this.textarea.blur()},$t.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$t.prototype.receivedFocus=function(){this.slowPoll()},$t.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()})},$t.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},$t.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ut(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var a=r.value;if(a==n&&!t.somethingSelected())return!1;if(W&&B>=9&&this.hasSelection===a||o&&/[\uf700-\uf7ff]/.test(a))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var L=a.charCodeAt(0);if(L==8203&&!n&&(n="\u200B"),L==8666)return this.reset(),this.cm.execCommand("undo")}for(var H=0,z=Math.min(n.length,a.length);H<z&&n.charCodeAt(H)==a.charCodeAt(H);)++H;return An(t,function(){Ga(t,a.slice(H),n.length-H,null,e.composing?"*compose":null),a.length>1e3||a.indexOf(`
`)>-1?r.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},$t.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$t.prototype.onKeyPress=function(){W&&B>=9&&(this.hasSelection=null),this.fastPoll()},$t.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var L=Pr(r,e),H=n.scroller.scrollTop;if(!L||m)return;var z=r.options.resetSelectionOnContextMenu;z&&r.doc.sel.contains(L)==-1&&en(r,hn)(r.doc,yr(L),de);var X=a.style.cssText,Y=t.wrapper.style.cssText,se=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-se.top-5)+"px; left: "+(e.clientX-se.left-5)+`px;
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ce;P&&(ce=window.scrollY),n.input.focus(),P&&window.scrollTo(null,ce),n.input.reset(),r.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=be,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Te(){if(a.selectionStart!=null){var Ne=r.somethingSelected(),Ge="\u200B"+(Ne?a.value:"");a.value="\u21DA",a.value=Ge,t.prevInput=Ne?"":"\u200B",a.selectionStart=1,a.selectionEnd=Ge.length,n.selForContextMenu=r.doc.sel}}function be(){if(t.contextMenuPending!=be)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Y,a.style.cssText=X,W&&B<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=H),a.selectionStart!=null){(!W||W&&B<9)&&Te();var Ne=0,Ge=function(){n.selForContextMenu==r.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="\u200B"?en(r,Vs)(r):Ne++<10?n.detectingSelectAll=setTimeout(Ge,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ge,200)}}if(W&&B>=9&&Te(),O){oe(e);var Ie=function(){Ke(window,"mouseup",Ie),setTimeout(be,20)};Ce(window,"mouseup",Ie)}else setTimeout(be,50)},$t.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},$t.prototype.setUneditable=function(){},$t.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?y(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=k();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=z.getValue()}var a;if(e.form&&(Ce(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var L=e.form;a=L.submit;try{var H=L.submit=function(){n(),L.submit=a,L.submit(),L.submit=H}}catch(X){}}t.finishInit=function(X){X.save=n,X.getTextArea=function(){return e},X.toTextArea=function(){X.toTextArea=isNaN,n(),e.parentNode.removeChild(X.getWrapperElement()),e.style.display="",e.form&&(Ke(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var z=zt(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return z}function iu(e){e.off=Ke,e.on=Ce,e.wheelEventPixels=cl,e.Doc=Tn,e.splitLines=_t,e.countColumn=j,e.findColumn=pe,e.isWordChar=xe,e.Pass=_e,e.signal=Se,e.Line=Lr,e.changeEnd=br,e.scrollbarModel=Ts,e.Pos=Fe,e.cmpPos=gt,e.modes=Kt,e.mimeModes=St,e.resolveMode=st,e.getMode=ct,e.modeExtensions=Lt,e.extendMode=Ft,e.copyState=Xt,e.startState=Hr,e.innerMode=or,e.commands=Pi,e.keyMap=ar,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ni,e.normalizeKeyMap=Pl,e.StringStream=Gt,e.SharedTextMarker=Li,e.TextMarker=Tr,e.LineWidget=Ci,e.e_preventDefault=J,e.e_stopPropagation=q,e.e_stop=oe,e.addClass=I,e.contains=b,e.rmClass=w,e.keyNames=xr}$l(zt),ql(zt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Tn.prototype)Tn.prototype.hasOwnProperty(la)&&Q(au,la)<0&&(zt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tn.prototype[la]));return ue(Tn),zt.inputStyles={textarea:$t,contenteditable:Ut},zt.defineMode=function(e){!zt.defaults.mode&&e!="null"&&(zt.defaults.mode=e),an.apply(this,arguments)},zt.defineMIME=Ue,zt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),zt.defineMIME("text/plain","null"),zt.defineExtension=function(e,t){zt.prototype[e]=t},zt.defineDocExtension=function(e,t){Tn.prototype[e]=t},zt.fromTextArea=ru,iu(zt),zt.version="5.58.2",zt})},Y1PL:function(ot,We,Z){"use strict";Z.r(We),Z.d(We,"ResizableTextArea",function(){return Q});var ne=Z("wx14"),V=Z("1OyB"),D=Z("vuIU"),G=Z("Ji7U"),N=Z("LK+K"),M=Z("cDcd"),W=Z("VTBJ"),B=Z("rePB"),P=Z("Zm9Q"),R=Z("Kwbf"),v=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),d=new Map;function s(de){de.forEach(function(me){var fe,pe=me.target;(fe=d.get(pe))===null||fe===void 0||fe.forEach(function(ae){return ae(pe)})})}var h=new p.default(s),l=null,i=null;function o(de,me){d.has(de)||(d.set(de,new Set),h.observe(de)),d.get(de).add(me)}function f(de,me){d.has(de)&&(d.get(de).delete(me),d.get(de).size||(h.unobserve(de),d.delete(de)))}var A=function(de){Object(G.a)(fe,de);var me=Object(N.a)(fe);function fe(){return Object(V.a)(this,fe),me.apply(this,arguments)}return Object(D.a)(fe,[{key:"render",value:function(){return this.props.children}}]),fe}(M.Component),x=M.createContext(null);function T(de){var me=de.children,fe=de.onBatchResize,pe=M.useRef(0),ae=M.useRef([]),he=M.useContext(x),$=M.useCallback(function(ie,ee,Ee){pe.current+=1;var we=pe.current;ae.current.push({size:ie,element:ee,data:Ee}),Promise.resolve().then(function(){we===pe.current&&(fe==null||fe(ae.current),ae.current=[])}),he==null||he(ie,ee,Ee)},[fe,he]);return M.createElement(x.Provider,{value:$},me)}function O(de){var me=de.children,fe=de.disabled,pe=M.useRef(null),ae=M.useRef(null),he=M.useContext(x),$=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ie=M.isValidElement(me)&&Object(v.c)(me),ee=ie?me.ref:null,Ee=M.useMemo(function(){return Object(v.a)(ee,pe)},[ee,pe]),we=M.useRef(de);we.current=de;var ye=M.useCallback(function(xe){var Le=we.current,ke=Le.onResize,Pe=Le.data,Ae=xe.getBoundingClientRect(),Oe=Ae.width,Be=Ae.height,Ve=xe.offsetWidth,ze=xe.offsetHeight,je=Math.floor(Oe),et=Math.floor(Be);if($.current.width!==je||$.current.height!==et||$.current.offsetWidth!==Ve||$.current.offsetHeight!==ze){var Xe={width:je,height:et,offsetWidth:Ve,offsetHeight:ze};$.current=Xe;var $e=Ve===Math.round(Oe)?Oe:Ve,Ce=ze===Math.round(Be)?Be:ze,qe=Object(W.a)(Object(W.a)({},Xe),{},{offsetWidth:$e,offsetHeight:Ce});he==null||he(qe,xe,Pe),ke&&Promise.resolve().then(function(){ke(qe,xe)})}},[]);return M.useEffect(function(){var xe=Object(m.a)(pe.current)||Object(m.a)(ae.current);return xe&&!fe&&o(xe,ye),function(){return f(xe,ye)}},[pe.current,fe]),M.createElement(A,{ref:ae},ie?M.cloneElement(me,{ref:Ee}):me)}var S="rc-observer-key";function w(de){var me=de.children,fe=Object(P.a)(me);return fe.map(function(pe,ae){var he=(pe==null?void 0:pe.key)||"".concat(S,"-").concat(ae);return M.createElement(O,Object(ne.a)({},de,{key:he}),pe)})}w.Collection=T;var E=w,_=Z("bT9E"),c=Z("TSYQ"),u=Z.n(c),g=`
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"],k={},I;function F(de){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(me&&k[fe])return k[fe];var pe=window.getComputedStyle(de),ae=pe.getPropertyValue("box-sizing")||pe.getPropertyValue("-moz-box-sizing")||pe.getPropertyValue("-webkit-box-sizing"),he=parseFloat(pe.getPropertyValue("padding-bottom"))+parseFloat(pe.getPropertyValue("padding-top")),$=parseFloat(pe.getPropertyValue("border-bottom-width"))+parseFloat(pe.getPropertyValue("border-top-width")),ie=b.map(function(Ee){return"".concat(Ee,":").concat(pe.getPropertyValue(Ee))}).join(";"),ee={sizingStyle:ie,paddingSize:he,borderSize:$,boxSizing:ae};return me&&fe&&(k[fe]=ee),ee}function U(de){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),de.getAttribute("wrap")?I.setAttribute("wrap",de.getAttribute("wrap")):I.removeAttribute("wrap");var ae=F(de,me),he=ae.paddingSize,$=ae.borderSize,ie=ae.boxSizing,ee=ae.sizingStyle;I.setAttribute("style","".concat(ee,";").concat(g)),I.value=de.value||de.placeholder||"";var Ee=Number.MIN_SAFE_INTEGER,we=Number.MAX_SAFE_INTEGER,ye=I.scrollHeight,xe;if(ie==="border-box"?ye+=$:ie==="content-box"&&(ye-=he),fe!==null||pe!==null){I.value=" ";var Le=I.scrollHeight-he;fe!==null&&(Ee=Le*fe,ie==="border-box"&&(Ee=Ee+he+$),ye=Math.max(Ee,ye)),pe!==null&&(we=Le*pe,ie==="border-box"&&(we=we+he+$),xe=ye>we?"":"hidden",ye=Math.min(we,ye))}return{height:ye,minHeight:Ee,maxHeight:we,overflowY:xe,resize:"none"}}var C=Z("Gytx"),y=Z.n(C),j;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(j||(j={}));var K=function(de){Object(G.a)(fe,de);var me=Object(N.a)(fe);function fe(pe){var ae;return Object(V.a)(this,fe),ae=me.call(this,pe),ae.nextFrameActionId=void 0,ae.resizeFrameId=void 0,ae.textArea=void 0,ae.saveTextArea=function(he){ae.textArea=he},ae.handleResize=function(he){var $=ae.state.resizeStatus,ie=ae.props,ee=ie.autoSize,Ee=ie.onResize;if($!==j.NONE)return;typeof Ee=="function"&&Ee(he),ee&&ae.resizeOnNextFrame()},ae.resizeOnNextFrame=function(){cancelAnimationFrame(ae.nextFrameActionId),ae.nextFrameActionId=requestAnimationFrame(ae.resizeTextarea)},ae.resizeTextarea=function(){var he=ae.props.autoSize;if(!he||!ae.textArea)return;var $=he.minRows,ie=he.maxRows,ee=U(ae.textArea,!1,$,ie);ae.setState({textareaStyles:ee,resizeStatus:j.RESIZING},function(){cancelAnimationFrame(ae.resizeFrameId),ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:j.RESIZED},function(){ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:j.NONE}),ae.fixFirefoxAutoScroll()})})})})},ae.renderTextArea=function(){var he=ae.props,$=he.prefixCls,ie=$===void 0?"rc-textarea":$,ee=he.autoSize,Ee=he.onResize,we=he.className,ye=he.disabled,xe=ae.state,Le=xe.textareaStyles,ke=xe.resizeStatus,Pe=Object(_.a)(ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ae=u()(ie,we,Object(B.a)({},"".concat(ie,"-disabled"),ye));"value"in Pe&&(Pe.value=Pe.value||"");var Oe=Object(W.a)(Object(W.a)(Object(W.a)({},ae.props.style),Le),ke===j.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(E,{onResize:ae.handleResize,disabled:!(ee||Ee)},M.createElement("textarea",Object(ne.a)({},Pe,{className:Ae,style:Oe,ref:ae.saveTextArea})))},ae.state={textareaStyles:{},resizeStatus:j.NONE},ae}return Object(D.a)(fe,[{key:"componentDidUpdate",value:function(ae){(ae.value!==this.props.value||!y()(ae.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ae=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(ae,he)}}catch($){}}},{key:"render",value:function(){return this.renderTextArea()}}]),fe}(M.Component),Q=K,te=function(de){Object(G.a)(fe,de);var me=Object(N.a)(fe);function fe(pe){var ae;Object(V.a)(this,fe),ae=me.call(this,pe),ae.resizableTextArea=void 0,ae.focus=function(){ae.resizableTextArea.textArea.focus()},ae.saveTextArea=function($){ae.resizableTextArea=$},ae.handleChange=function($){var ie=ae.props.onChange;ae.setValue($.target.value,function(){ae.resizableTextArea.resizeTextarea()}),ie&&ie($)},ae.handleKeyDown=function($){var ie=ae.props,ee=ie.onPressEnter,Ee=ie.onKeyDown;$.keyCode===13&&ee&&ee($),Ee&&Ee($)};var he=typeof pe.value=="undefined"||pe.value===null?pe.defaultValue:pe.value;return ae.state={value:he},ae}return Object(D.a)(fe,[{key:"setValue",value:function(ae,he){"value"in this.props||this.setState({value:ae},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(Q,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ae){return"value"in ae?{value:ae.value}:null}}]),fe}(M.Component),_e=We.default=te},ZW9T:function(ot,We,Z){"use strict";Z.d(We,"a",function(){return U});var ne=Z("k1fw"),V=Z("miYZ"),D=Z("tsqr"),G=Z("rAM+"),N=Z("tJVT"),M=Z("PpiC"),W=Z("cDcd"),B=Z.n(W),P=Z("bdgK"),R=Z("oBTY"),v=Z("9og8"),m=Z("WmNS"),p=Z.n(m),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"]},h={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(`
`)}]},l={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(`
`)}]},i=Z("5VLF"),o=Z.n(i),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"]}},A=function(y,j){return j.map(function(K){return{label:K,kind:y.languages.CompletionItemKind.Keyword,insertText:K}})},x=function(y){return Object.keys(f.tables).map(function(j){return{label:j,kind:y.languages.CompletionItemKind.Variable,insertText:j}})},T=function(y,j){var K=f.tables[y];return K?K.map(function(Q){return{label:Q,kind:j.languages.CompletionItemKind.Field,insertText:Q}}):[]};function O(C,y,j,K,Q){var te=y.getWordUntilPosition(j),_e={startLineNumber:j.lineNumber,endLineNumber:j.lineNumber,startColumn:te.startColumn,endColumn:te.endColumn},de=K.map(function(me){return{label:me,kind:C.languages.CompletionItemKind.Keyword,insertText:me,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}});return Q.map(function(me){de.push(Object(ne.a)(Object(ne.a)({},me),{},{range:_e}))}),de}var S=function(C){f.languages.map(function(Q){return C.languages.registerDocumentFormattingEditProvider(Q,{provideDocumentFormattingEdits:function(_e,de,me){return Object(v.a)(p.a.mark(function fe(){var pe;return p.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return pe=o()(_e.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}),he.abrupt("return",[{range:_e.getFullModelRange(),text:pe}]);case 2:case"end":return he.stop()}},fe)}))()}}),Q});var y=h.quickKey.map(function(Q){return{label:Q.label,kind:C.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),j=l.quickKey.map(function(Q){return{label:Q.label,kind:C.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),K=s.quickKey.map(function(Q){return{label:Q.label,kind:C.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}});C.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(R.a)(h.keywords),Object(R.a)(h.quickKey.map(function(Q){return Q.label}))),provideCompletionItems:function(te,_e){var de=te.getValueInRange({startLineNumber:_e.lineNumber,startColumn:1,endLineNumber:_e.lineNumber,endColumn:_e.column}),me=de.match(/cu/gim);console.log("match:",me,_e,de,te);var fe=[],pe=_e.lineNumber,ae=_e.column,he=te.getValueInRange({startLineNumber:pe,startColumn:0,endLineNumber:pe,endColumn:ae}),$=he.trim().split(/\s+/),ie=$[$.length-1];if(ie.endsWith(".")){var ee=ie.slice(0,ie.length-1);Object.keys(f.tables).includes(ee)&&(fe=Object(R.a)(T(ee,C)))}else ie==="."?fe=[]:fe=[].concat(Object(R.a)(x(C)),Object(R.a)(A(C,h.keywords)),Object(R.a)(y));return{suggestions:fe}}}),C.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(R.a)(d.keywords)),provideCompletionItems:function(te,_e){var de=te.getValueInRange({startLineNumber:_e.lineNumber,startColumn:1,endLineNumber:_e.lineNumber,endColumn:_e.column}),me=de.match(/cu/gim);console.log("match:",me,_e,de,te);var fe=[],pe=_e.lineNumber,ae=_e.column,he=te.getValueInRange({startLineNumber:pe,startColumn:0,endLineNumber:pe,endColumn:ae}),$=he.trim().split(/\s+/),ie=$[$.length-1];if(ie.endsWith(".")){var ee=ie.slice(0,ie.length-1);Object.keys(f.tables).includes(ee)&&(fe=Object(R.a)(T(ee,C)))}else ie==="."?fe=[]:fe=[].concat(Object(R.a)(x(C)),Object(R.a)(A(C,d.keywords)));return{suggestions:fe}}}),C.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(R.a)(s.keywords)),provideCompletionItems:function(te,_e){var de=[],me=_e.lineNumber,fe=_e.column,pe=te.getValueInRange({startLineNumber:me,startColumn:0,endLineNumber:me,endColumn:fe}),ae=pe.trim().split(/\s+/),he=ae[ae.length-1];if(he.endsWith(".")){var $=he.slice(0,he.length-1);Object.keys(f.tables).includes($)&&(de=Object(R.a)(T($,C)))}else he==="."?de=[]:de=[].concat(Object(R.a)(x(C)),Object(R.a)(A(C,s.keywords)),Object(R.a)(K));return{suggestions:de}}}),C.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(R.a)(l.keywords)),provideCompletionItems:function(te,_e){var de=[],me=_e.lineNumber,fe=_e.column,pe=te.getValueInRange({startLineNumber:me,startColumn:0,endLineNumber:me,endColumn:fe}),ae=pe.trim().split(/\s+/),he=ae[ae.length-1];if(he.endsWith(".")){var $=he.slice(0,he.length-1);Object.keys(f.tables).includes($)&&(de=Object(R.a)(T($,C)))}else he==="."?de=[]:de=[].concat(Object(R.a)(x(C)),Object(R.a)(A(C,l.keywords)),Object(R.a)(j));return{suggestions:de}}})},w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=Z("LvDl"),_=Z("+ua5");function c(C){return/^\d+$/.test(C)?"".concat(C,"px"):C}function u(){}var g=!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 k(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=C;if(Array.isArray(C)){for(var j=0;j<C.length;j++){var K=b[C[j]];if(K)return K}return y[0]}return b[y]||y}var I=null,F=We.b=function(C){var y=C.width,j=y===void 0?"100%":y,K=C.height,Q=K===void 0?"100%":K,te=C.value,_e=C.language,de=_e===void 0?"javascript":_e,me=C.style,fe=me===void 0?{}:me,pe=C.options,ae=pe===void 0?{}:pe,he=C.overrideServices,$=he===void 0?{}:he,ie=C.theme,ee=ie===void 0?"vs-dark":ie,Ee=C.onEditBlur,we=C.onSave,ye=C.autoHeight,xe=ye===void 0?!1:ye,Le=C.forbidCopy,ke=Le===void 0?!1:Le,Pe=C.onChange,Ae=Pe===void 0?u:Pe,Oe=C.editorDidMount,Be=Oe===void 0?u:Oe,Ve=C.onFocus,ze=Ve===void 0?u:Ve,je=C.filename,et=je===void 0?"educoder.txt":je,Xe=C.errorLine,$e=C.errorContent,Ce=$e===void 0?"":$e,qe=Object(M.a)(C,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ke=Object(W.useRef)(),Se=Object(W.useRef)({}),Me=Object(W.useRef)(),ve=Object(W.useRef)(!1),le=Object(W.useRef)(),ue=Object(W.useState)(!1),J=Object(N.a)(ue,2),q=J[0],re=J[1];function oe(){var st;return Ke.current&&(st=new P.default(function(ct){var Lt=Object(G.a)(ct),Ft;try{for(Lt.s();!(Ft=Lt.n()).done;){var Xt=Ft.value;(Xt.target.offsetHeight>0||Xt.target.offsetWidth>0)&&Se.current.instance.layout()}}catch(or){Lt.e(or)}finally{Lt.f()}}),st.observe(Ke.current)),st}function ge(){D.b.warn(decodeURIComponent(w))}var Re=function(){var ct=Se.current.instance;if(te!=null&&ct&&q){var Lt=ct.getModel();Lt&&te!==Lt.getValue()&&(g=!0,Lt.setValue(te),ct.layout(),g=!1)}};Object(W.useEffect)(function(){Me.current&&clearTimeout(Me.current),Me.current=setTimeout(function(){Re()},500)},[te,q,Se.current]),Object(W.useEffect)(function(){if(Xe&&Se.current&&Se.current.instance){var st=Se.current.instance;st.changeViewZones(function(Lt){var Ft=document.createElement("div");Ft.style.padding="10px 20px",Ft.style.width="calc(100% - 20px)",Ft.className="my-error-line-wrp",Ft.innerHTML=Ce,Lt.addZone({afterLineNumber:Xe||11,heightInLines:3,domNode:Ft})});var ct={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}};st.addOverlayWidget(ct),st.revealPositionInCenter({lineNumber:20,column:1})}},[Xe,Se.current,q]);function De(){var st=Se.current.instance;if(st){var ct=st.getSelection(),Lt=Se.current.pastePos||{},Ft=new I.Range(Lt.startLineNumber||ct.endLineNumber,Lt.startColumn||ct.endColumn,Lt.endLineNumber||ct.endLineNumber,Lt.endColumn||ct.endColumn);setTimeout(function(){st.executeEdits("",[{range:Ft,text:""}])},300)}}function Je(st){(window.navigator.platform.match("Mac")?st.metaKey:st.ctrlKey)&&st.keyCode==83&&(st.preventDefault(),we())}var it=function(){if(xe&&Se.current.instance){var ct=Se.current.instance.getContentHeight();an(ct<Q?Q:ct)}else an(Q)};function rt(st){var ct=document.createEvent("MouseEvents");ct.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),st.dispatchEvent(ct)}function Ot(st,ct){var Lt=window.URL||window.webkitURL||window,Ft=new Blob([ct]),Xt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Xt.href=Lt.createObjectURL(Ft),Xt.download=st,rt(Xt)}Object(W.useEffect)(function(){it()},[it]),Object(W.useEffect)(function(){Ke.current&&!q&&Z.e(27).then(Z.t.bind(null,"M/lh",7)).then(function(st){try{I=st,Se.current.instance=I.editor.create(Ke.current,{value:te,language:k(de),theme:ee,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},$);var ct=Se.current.instance;if(Be(ct,I),setTimeout(function(){it(),Se.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ot(et||"educoder.txt",ct.getValue())}})},500),Se.current.subscription=ct.onDidChangeModelContent(function(Ft){ve.current?clearTimeout(le.current):(it(),Ae(ct.getValue(),Ft)),le.current=setTimeout(function(){ve.current=!1},500)}),window.Monaco||S(I),ke&&(ct.addCommand(I.KeyMod.CtrlCmd|I.KeyMod.Shift|I.KeyCode.KEY_V,function(){return ge(),null}),ct.addCommand(I.KeyMod.CtrlCmd|I.KeyCode.KEY_C,function(){return ge(),null})),window.Monaco=I,Ee&&ct.onDidBlurEditorWidget(function(){Ee(ct.getValue())}),ze&&ct.onDidFocusEditorText(function(){ze(ct.getValue())}),ke){ct.addCommand(I.KeyMod.CtrlCmd|I.KeyCode.KEY_V,function(){return ge(),null}),ct.onDidPaste(function(Ft){Se.current.pastePos=Ft});try{window.addEventListener("paste",De)}catch(Ft){}}var Lt=oe();return re(!0),function(){var Ft=Se.current.instance;Ft.dispose();var Xt=Ft.getModel();Xt&&Xt.dispose(),Se.current.subscription&&Se.current.subscription.dispose(),ke&&window.removeEventListener("paste",De),Lt.unobserve(Ke.current)}}catch(Ft){}})},[]),Object(W.useEffect)(function(){var st=Se.current.instance;if(st&&q)return document.addEventListener("keydown",Je,!1),function(){document.removeEventListener("keydown",Je)}},[we,q]),Object(W.useEffect)(function(){var st=Se.current.instance;if(st&&q){var ct=k(de);I.editor.setModelLanguage(st.getModel(),ct),console.log("language:",de,st.getModel(),ct)}},[de,q]),Object(W.useEffect)(function(){var st=Se.current.instance;st&&q&&I.editor.setTheme(ee)},[ee,q]),Object(W.useEffect)(function(){var st=Se.current.instance;st&&q&&(st.updateOptions(Object(ne.a)({},ae)),setTimeout(function(){st.getModel().updateOptions(Object(ne.a)({},ae))},200))},[JSON.stringify(ae),q]),Object(W.useEffect)(function(){var st=Se.current.instance;st&&q&&st.layout()},[j,Q,q]);var _t=Object(W.useState)(c(j)),ut=Object(N.a)(_t,2),bt=ut[0],Rt=ut[1],nt=Object(W.useState)(c(Q)),Kt=Object(N.a)(nt,2),St=Kt[0],an=Kt[1],Ue=Object(ne.a)(Object(ne.a)({},fe),{},{width:bt,height:St});return B.a.createElement("div",{className:"my-monaco-editor",ref:Ke,style:Ue})};function U(C){var y=C.width,j=y===void 0?"100%":y,K=C.height,Q=K===void 0?"100%":K,te=C.original,_e=C.modified,de=C.language,me=C.options,fe=me===void 0?{}:me,pe=Object(W.useRef)(),ae=Object(W.useState)(null),he=Object(N.a)(ae,2),$=he[0],ie=he[1];function ee(xe){var Le;return pe.current&&(Le=new P.default(function(ke){var Pe=Object(G.a)(ke),Ae;try{for(Pe.s();!(Ae=Pe.n()).done;){var Oe=Ae.value;(Oe.target.offsetHeight>0||Oe.target.offsetWidth>0)&&xe.layout()}}catch(Be){Pe.e(Be)}finally{Pe.f()}}),Le.observe(pe.current)),Le}Object(W.useEffect)(function(){pe.current&&Z.e(27).then(Z.t.bind(null,"M/lh",7)).then(function(xe){I=xe;var Le=I.editor.createDiffEditor(pe.current,Object(ne.a)(Object(ne.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},fe),{},{wordWrap:!0}));ie(Le);var ke=ee(Le);return function(){Le.dispose();var Pe=Le.getModel();Pe&&Pe.dispose(),ke.unobserve(pe.current)}})},[]),Object(W.useEffect)(function(){$&&$.setModel({original:I.editor.createModel(te,de),modified:I.editor.createModel(_e,de)})},[te,_e,de,$]);var Ee=c(j),we=c(Q),ye={width:Ee,height:we};return B.a.createElement("div",{className:"my-diff-editor",ref:pe,style:ye})}},ZpRC:function(ot,We,Z){"use strict";function ne(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function V(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function D(v,m){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var p=getComputedStyle(v,null);return V(p.overflowY,m)||V(p.overflowX,m)||function(d){var s=function(h){if(!h.ownerDocument||!h.ownerDocument.defaultView)return null;try{return h.ownerDocument.defaultView.frameElement}catch(l){return null}}(d);return!!s&&(s.clientHeight<d.scrollHeight||s.clientWidth<d.scrollWidth)}(v)}return!1}function G(v,m,p,d,s,h,l,i){return h<v&&l>m||h>v&&l<m?0:h<=v&&i<=p||l>=m&&i>=p?h-v-d:l>m&&i<p||h<v&&i>p?l-m+s:0}var N=function(v,m){var p=window,d=m.scrollMode,s=m.block,h=m.inline,l=m.boundary,i=m.skipOverflowHiddenElements,o=typeof l=="function"?l:function(Le){return Le!==l};if(!ne(v))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,A=[],x=v;ne(x)&&o(x);){if((x=x.parentElement)===f){A.push(x);break}x!=null&&x===document.body&&D(x)&&!D(document.documentElement)||x!=null&&D(x,i)&&A.push(x)}for(var T=p.visualViewport?p.visualViewport.width:innerWidth,O=p.visualViewport?p.visualViewport.height:innerHeight,S=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,E=v.getBoundingClientRect(),_=E.height,c=E.width,u=E.top,g=E.right,b=E.bottom,k=E.left,I=s==="start"||s==="nearest"?u:s==="end"?b:u+_/2,F=h==="center"?k+c/2:h==="end"?g:k,U=[],C=0;C<A.length;C++){var y=A[C],j=y.getBoundingClientRect(),K=j.height,Q=j.width,te=j.top,_e=j.right,de=j.bottom,me=j.left;if(d==="if-needed"&&u>=0&&k>=0&&b<=O&&g<=T&&u>=te&&b<=de&&k>=me&&g<=_e)return U;var fe=getComputedStyle(y),pe=parseInt(fe.borderLeftWidth,10),ae=parseInt(fe.borderTopWidth,10),he=parseInt(fe.borderRightWidth,10),$=parseInt(fe.borderBottomWidth,10),ie=0,ee=0,Ee="offsetWidth"in y?y.offsetWidth-y.clientWidth-pe-he:0,we="offsetHeight"in y?y.offsetHeight-y.clientHeight-ae-$:0;if(f===y)ie=s==="start"?I:s==="end"?I-O:s==="nearest"?G(w,w+O,O,ae,$,w+I,w+I+_,_):I-O/2,ee=h==="start"?F:h==="center"?F-T/2:h==="end"?F-T:G(S,S+T,T,pe,he,S+F,S+F+c,c),ie=Math.max(0,ie+w),ee=Math.max(0,ee+S);else{ie=s==="start"?I-te-ae:s==="end"?I-de+$+we:s==="nearest"?G(te,de,K,ae,$+we,I,I+_,_):I-(te+K/2)+we/2,ee=h==="start"?F-me-pe:h==="center"?F-(me+Q/2)+Ee/2:h==="end"?F-_e+he+Ee:G(me,_e,Q,pe,he+Ee,F,F+c,c);var ye=y.scrollLeft,xe=y.scrollTop;I+=xe-(ie=Math.max(0,Math.min(xe+ie,y.scrollHeight-K+we))),F+=ye-(ee=Math.max(0,Math.min(ye+ee,y.scrollWidth-Q+Ee)))}U.push({el:y,top:ie,left:ee})}return U};function M(v){return v===Object(v)&&Object.keys(v).length!==0}function W(v,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(d){var s=d.el,h=d.top,l=d.left;s.scroll&&p?s.scroll({top:h,left:l,behavior:m}):(s.scrollTop=h,s.scrollLeft=l)})}function B(v){return v===!1?{block:"end",inline:"nearest"}:M(v)?v:{block:"start",inline:"nearest"}}function P(v,m){var p=!v.ownerDocument.documentElement.contains(v);if(M(m)&&typeof m.behavior=="function")return m.behavior(p?[]:N(v,m));if(p)return;var d=B(m);return W(N(v,d),d.behavior)}var R=We.a=P},Zss7:function(ot,We,Z){var ne;(function(V){var D=/^\s+/,G=/\s+$/,N=0,M=V.round,W=V.min,B=V.max,P=V.random;function R($,ie){if($=$||"",ie=ie||{},$ instanceof R)return $;if(!(this instanceof R))return new R($,ie);var ee=v($);this._originalInput=$,this._r=ee.r,this._g=ee.g,this._b=ee.b,this._a=ee.a,this._roundA=M(100*this._a)/100,this._format=ie.format||ee.format,this._gradientType=ie.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=ee.ok,this._tc_id=N++}R.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var $=this.toRgb();return($.r*299+$.g*587+$.b*114)/1e3},getLuminance:function(){var $=this.toRgb(),ie,ee,Ee,we,ye,xe;return ie=$.r/255,ee=$.g/255,Ee=$.b/255,ie<=.03928?we=ie/12.92:we=V.pow((ie+.055)/1.055,2.4),ee<=.03928?ye=ee/12.92:ye=V.pow((ee+.055)/1.055,2.4),Ee<=.03928?xe=Ee/12.92:xe=V.pow((Ee+.055)/1.055,2.4),.2126*we+.7152*ye+.0722*xe},setAlpha:function($){return this._a=U($),this._roundA=M(100*this._a)/100,this},toHsv:function(){var $=s(this._r,this._g,this._b);return{h:$.h*360,s:$.s,v:$.v,a:this._a}},toHsvString:function(){var $=s(this._r,this._g,this._b),ie=M($.h*360),ee=M($.s*100),Ee=M($.v*100);return this._a==1?"hsv("+ie+", "+ee+"%, "+Ee+"%)":"hsva("+ie+", "+ee+"%, "+Ee+"%, "+this._roundA+")"},toHsl:function(){var $=p(this._r,this._g,this._b);return{h:$.h*360,s:$.s,l:$.l,a:this._a}},toHslString:function(){var $=p(this._r,this._g,this._b),ie=M($.h*360),ee=M($.s*100),Ee=M($.l*100);return this._a==1?"hsl("+ie+", "+ee+"%, "+Ee+"%)":"hsla("+ie+", "+ee+"%, "+Ee+"%, "+this._roundA+")"},toHex:function($){return l(this._r,this._g,this._b,$)},toHexString:function($){return"#"+this.toHex($)},toHex8:function($){return i(this._r,this._g,this._b,this._a,$)},toHex8String:function($){return"#"+this.toHex8($)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(C(this._r,255)*100)+"%",g:M(C(this._g,255)*100)+"%",b:M(C(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(C(this._r,255)*100)+"%, "+M(C(this._g,255)*100)+"%, "+M(C(this._b,255)*100)+"%)":"rgba("+M(C(this._r,255)*100)+"%, "+M(C(this._g,255)*100)+"%, "+M(C(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:I[l(this._r,this._g,this._b,!0)]||!1},toFilter:function($){var ie="#"+o(this._r,this._g,this._b,this._a),ee=ie,Ee=this._gradientType?"GradientType = 1, ":"";if($){var we=R($);ee="#"+o(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ee+"startColorstr="+ie+",endColorstr="+ee+")"},toString:function($){var ie=!!$;$=$||this._format;var ee=!1,Ee=this._a<1&&this._a>=0,we=!ie&&Ee&&($==="hex"||$==="hex6"||$==="hex3"||$==="hex4"||$==="hex8"||$==="name");return we?$==="name"&&this._a===0?this.toName():this.toRgbString():($==="rgb"&&(ee=this.toRgbString()),$==="prgb"&&(ee=this.toPercentageRgbString()),($==="hex"||$==="hex6")&&(ee=this.toHexString()),$==="hex3"&&(ee=this.toHexString(!0)),$==="hex4"&&(ee=this.toHex8String(!0)),$==="hex8"&&(ee=this.toHex8String()),$==="name"&&(ee=this.toName()),$==="hsl"&&(ee=this.toHslString()),$==="hsv"&&(ee=this.toHsvString()),ee||this.toHexString())},clone:function(){return R(this.toString())},_applyModification:function($,ie){var ee=$.apply(null,[this].concat([].slice.call(ie)));return this._r=ee._r,this._g=ee._g,this._b=ee._b,this.setAlpha(ee._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(O,arguments)},darken:function(){return this._applyModification(S,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(A,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function($,ie){return $.apply(null,[this].concat([].slice.call(ie)))},analogous:function(){return this._applyCombination(g,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(u,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(c,arguments)}},R.fromRatio=function($,ie){if(typeof $=="object"){var ee={};for(var Ee in $)$.hasOwnProperty(Ee)&&(Ee==="a"?ee[Ee]=$[Ee]:ee[Ee]=_e($[Ee]));$=ee}return R($,ie)};function v($){var ie={r:0,g:0,b:0},ee=1,Ee=null,we=null,ye=null,xe=!1,Le=!1;return typeof $=="string"&&($=ae($)),typeof $=="object"&&(pe($.r)&&pe($.g)&&pe($.b)?(ie=m($.r,$.g,$.b),xe=!0,Le=String($.r).substr(-1)==="%"?"prgb":"rgb"):pe($.h)&&pe($.s)&&pe($.v)?(Ee=_e($.s),we=_e($.v),ie=h($.h,Ee,we),xe=!0,Le="hsv"):pe($.h)&&pe($.s)&&pe($.l)&&(Ee=_e($.s),ye=_e($.l),ie=d($.h,Ee,ye),xe=!0,Le="hsl"),$.hasOwnProperty("a")&&(ee=$.a)),ee=U(ee),{ok:xe,format:$.format||Le,r:W(255,B(ie.r,0)),g:W(255,B(ie.g,0)),b:W(255,B(ie.b,0)),a:ee}}function m($,ie,ee){return{r:C($,255)*255,g:C(ie,255)*255,b:C(ee,255)*255}}function p($,ie,ee){$=C($,255),ie=C(ie,255),ee=C(ee,255);var Ee=B($,ie,ee),we=W($,ie,ee),ye,xe,Le=(Ee+we)/2;if(Ee==we)ye=xe=0;else{var ke=Ee-we;xe=Le>.5?ke/(2-Ee-we):ke/(Ee+we);switch(Ee){case $:ye=(ie-ee)/ke+(ie<ee?6:0);break;case ie:ye=(ee-$)/ke+2;break;case ee:ye=($-ie)/ke+4;break}ye/=6}return{h:ye,s:xe,l:Le}}function d($,ie,ee){var Ee,we,ye;$=C($,360),ie=C(ie,100),ee=C(ee,100);function xe(Pe,Ae,Oe){return Oe<0&&(Oe+=1),Oe>1&&(Oe-=1),Oe<1/6?Pe+(Ae-Pe)*6*Oe:Oe<1/2?Ae:Oe<2/3?Pe+(Ae-Pe)*(2/3-Oe)*6:Pe}if(ie===0)Ee=we=ye=ee;else{var Le=ee<.5?ee*(1+ie):ee+ie-ee*ie,ke=2*ee-Le;Ee=xe(ke,Le,$+1/3),we=xe(ke,Le,$),ye=xe(ke,Le,$-1/3)}return{r:Ee*255,g:we*255,b:ye*255}}function s($,ie,ee){$=C($,255),ie=C(ie,255),ee=C(ee,255);var Ee=B($,ie,ee),we=W($,ie,ee),ye,xe,Le=Ee,ke=Ee-we;if(xe=Ee===0?0:ke/Ee,Ee==we)ye=0;else{switch(Ee){case $:ye=(ie-ee)/ke+(ie<ee?6:0);break;case ie:ye=(ee-$)/ke+2;break;case ee:ye=($-ie)/ke+4;break}ye/=6}return{h:ye,s:xe,v:Le}}function h($,ie,ee){$=C($,360)*6,ie=C(ie,100),ee=C(ee,100);var Ee=V.floor($),we=$-Ee,ye=ee*(1-ie),xe=ee*(1-we*ie),Le=ee*(1-(1-we)*ie),ke=Ee%6,Pe=[ee,xe,ye,ye,Le,ee][ke],Ae=[Le,ee,ee,xe,ye,ye][ke],Oe=[ye,ye,Le,ee,ee,xe][ke];return{r:Pe*255,g:Ae*255,b:Oe*255}}function l($,ie,ee,Ee){var we=[te(M($).toString(16)),te(M(ie).toString(16)),te(M(ee).toString(16))];return Ee&&we[0].charAt(0)==we[0].charAt(1)&&we[1].charAt(0)==we[1].charAt(1)&&we[2].charAt(0)==we[2].charAt(1)?we[0].charAt(0)+we[1].charAt(0)+we[2].charAt(0):we.join("")}function i($,ie,ee,Ee,we){var ye=[te(M($).toString(16)),te(M(ie).toString(16)),te(M(ee).toString(16)),te(de(Ee))];return we&&ye[0].charAt(0)==ye[0].charAt(1)&&ye[1].charAt(0)==ye[1].charAt(1)&&ye[2].charAt(0)==ye[2].charAt(1)&&ye[3].charAt(0)==ye[3].charAt(1)?ye[0].charAt(0)+ye[1].charAt(0)+ye[2].charAt(0)+ye[3].charAt(0):ye.join("")}function o($,ie,ee,Ee){var we=[te(de(Ee)),te(M($).toString(16)),te(M(ie).toString(16)),te(M(ee).toString(16))];return we.join("")}R.equals=function($,ie){return!$||!ie?!1:R($).toRgbString()==R(ie).toRgbString()},R.random=function(){return R.fromRatio({r:P(),g:P(),b:P()})};function f($,ie){ie=ie===0?0:ie||10;var ee=R($).toHsl();return ee.s-=ie/100,ee.s=y(ee.s),R(ee)}function A($,ie){ie=ie===0?0:ie||10;var ee=R($).toHsl();return ee.s+=ie/100,ee.s=y(ee.s),R(ee)}function x($){return R($).desaturate(100)}function T($,ie){ie=ie===0?0:ie||10;var ee=R($).toHsl();return ee.l+=ie/100,ee.l=y(ee.l),R(ee)}function O($,ie){ie=ie===0?0:ie||10;var ee=R($).toRgb();return ee.r=B(0,W(255,ee.r-M(255*-(ie/100)))),ee.g=B(0,W(255,ee.g-M(255*-(ie/100)))),ee.b=B(0,W(255,ee.b-M(255*-(ie/100)))),R(ee)}function S($,ie){ie=ie===0?0:ie||10;var ee=R($).toHsl();return ee.l-=ie/100,ee.l=y(ee.l),R(ee)}function w($,ie){var ee=R($).toHsl(),Ee=(ee.h+ie)%360;return ee.h=Ee<0?360+Ee:Ee,R(ee)}function E($){var ie=R($).toHsl();return ie.h=(ie.h+180)%360,R(ie)}function _($){var ie=R($).toHsl(),ee=ie.h;return[R($),R({h:(ee+120)%360,s:ie.s,l:ie.l}),R({h:(ee+240)%360,s:ie.s,l:ie.l})]}function c($){var ie=R($).toHsl(),ee=ie.h;return[R($),R({h:(ee+90)%360,s:ie.s,l:ie.l}),R({h:(ee+180)%360,s:ie.s,l:ie.l}),R({h:(ee+270)%360,s:ie.s,l:ie.l})]}function u($){var ie=R($).toHsl(),ee=ie.h;return[R($),R({h:(ee+72)%360,s:ie.s,l:ie.l}),R({h:(ee+216)%360,s:ie.s,l:ie.l})]}function g($,ie,ee){ie=ie||6,ee=ee||30;var Ee=R($).toHsl(),we=360/ee,ye=[R($)];for(Ee.h=(Ee.h-(we*ie>>1)+720)%360;--ie;)Ee.h=(Ee.h+we)%360,ye.push(R(Ee));return ye}function b($,ie){ie=ie||6;for(var ee=R($).toHsv(),Ee=ee.h,we=ee.s,ye=ee.v,xe=[],Le=1/ie;ie--;)xe.push(R({h:Ee,s:we,v:ye})),ye=(ye+Le)%1;return xe}R.mix=function($,ie,ee){ee=ee===0?0:ee||50;var Ee=R($).toRgb(),we=R(ie).toRgb(),ye=ee/100,xe={r:(we.r-Ee.r)*ye+Ee.r,g:(we.g-Ee.g)*ye+Ee.g,b:(we.b-Ee.b)*ye+Ee.b,a:(we.a-Ee.a)*ye+Ee.a};return R(xe)},R.readability=function($,ie){var ee=R($),Ee=R(ie);return(V.max(ee.getLuminance(),Ee.getLuminance())+.05)/(V.min(ee.getLuminance(),Ee.getLuminance())+.05)},R.isReadable=function($,ie,ee){var Ee=R.readability($,ie),we,ye;ye=!1,we=he(ee);switch(we.level+we.size){case"AAsmall":case"AAAlarge":ye=Ee>=4.5;break;case"AAlarge":ye=Ee>=3;break;case"AAAsmall":ye=Ee>=7;break}return ye},R.mostReadable=function($,ie,ee){var Ee=null,we=0,ye,xe,Le,ke;ee=ee||{},xe=ee.includeFallbackColors,Le=ee.level,ke=ee.size;for(var Pe=0;Pe<ie.length;Pe++)ye=R.readability($,ie[Pe]),ye>we&&(we=ye,Ee=R(ie[Pe]));return R.isReadable($,Ee,{level:Le,size:ke})||!xe?Ee:(ee.includeFallbackColors=!1,R.mostReadable($,["#fff","#000"],ee))};var k=R.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},I=R.hexNames=F(k);function F($){var ie={};for(var ee in $)$.hasOwnProperty(ee)&&(ie[$[ee]]=ee);return ie}function U($){return $=parseFloat($),(isNaN($)||$<0||$>1)&&($=1),$}function C($,ie){K($)&&($="100%");var ee=Q($);return $=W(ie,B(0,parseFloat($))),ee&&($=parseInt($*ie,10)/100),V.abs($-ie)<1e-6?1:$%ie/parseFloat(ie)}function y($){return W(1,B(0,$))}function j($){return parseInt($,16)}function K($){return typeof $=="string"&&$.indexOf(".")!=-1&&parseFloat($)===1}function Q($){return typeof $=="string"&&$.indexOf("%")!=-1}function te($){return $.length==1?"0"+$:""+$}function _e($){return $<=1&&($=$*100+"%"),$}function de($){return V.round(parseFloat($)*255).toString(16)}function me($){return j($)/255}var fe=function(){var $="[-\\+]?\\d+%?",ie="[-\\+]?\\d*\\.\\d+%?",ee="(?:"+ie+")|(?:"+$+")",Ee="[\\s|\\(]+("+ee+")[,|\\s]+("+ee+")[,|\\s]+("+ee+")\\s*\\)?",we="[\\s|\\(]+("+ee+")[,|\\s]+("+ee+")[,|\\s]+("+ee+")[,|\\s]+("+ee+")\\s*\\)?";return{CSS_UNIT:new RegExp(ee),rgb:new RegExp("rgb"+Ee),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+Ee),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+Ee),hsva:new RegExp("hsva"+we),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function pe($){return!!fe.CSS_UNIT.exec($)}function ae($){$=$.replace(D,"").replace(G,"").toLowerCase();var ie=!1;if(k[$])$=k[$],ie=!0;else if($=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ee;return(ee=fe.rgb.exec($))?{r:ee[1],g:ee[2],b:ee[3]}:(ee=fe.rgba.exec($))?{r:ee[1],g:ee[2],b:ee[3],a:ee[4]}:(ee=fe.hsl.exec($))?{h:ee[1],s:ee[2],l:ee[3]}:(ee=fe.hsla.exec($))?{h:ee[1],s:ee[2],l:ee[3],a:ee[4]}:(ee=fe.hsv.exec($))?{h:ee[1],s:ee[2],v:ee[3]}:(ee=fe.hsva.exec($))?{h:ee[1],s:ee[2],v:ee[3],a:ee[4]}:(ee=fe.hex8.exec($))?{r:j(ee[1]),g:j(ee[2]),b:j(ee[3]),a:me(ee[4]),format:ie?"name":"hex8"}:(ee=fe.hex6.exec($))?{r:j(ee[1]),g:j(ee[2]),b:j(ee[3]),format:ie?"name":"hex"}:(ee=fe.hex4.exec($))?{r:j(ee[1]+""+ee[1]),g:j(ee[2]+""+ee[2]),b:j(ee[3]+""+ee[3]),a:me(ee[4]+""+ee[4]),format:ie?"name":"hex8"}:(ee=fe.hex3.exec($))?{r:j(ee[1]+""+ee[1]),g:j(ee[2]+""+ee[2]),b:j(ee[3]+""+ee[3]),format:ie?"name":"hex"}:!1}function he($){var ie,ee;return $=$||{level:"AA",size:"small"},ie=($.level||"AA").toUpperCase(),ee=($.size||"small").toLowerCase(),ie!=="AA"&&ie!=="AAA"&&(ie="AA"),ee!=="small"&&ee!=="large"&&(ee="small"),{level:ie,size:ee}}ot.exports?ot.exports=R:!(ne=function(){return R}.call(We,Z,We,ot),ne!==void 0&&(ot.exports=ne))})(Math)},bT9E:function(ot,We,Z){"use strict";Z.d(We,"a",function(){return V});var ne=Z("VTBJ");function V(D,G){var N=Object(ne.a)({},D);return Array.isArray(G)&&G.forEach(function(M){delete N[M]}),N}},c5Ni:function(ot,We,Z){},dejd:function(ot,We,Z){},dmUQ:function(ot,We,Z){"use strict";var ne=Z("Ff2n"),V=Z("rePB"),D=Z("1OyB"),G=Z("vuIU"),N=Z("Ji7U"),M=Z("md7G"),W=Z("foSv"),B=Z("cDcd"),P=Z.n(B),R=Z("TSYQ"),v=Z.n(R),m=Z("4IlW");function p(_,c){var u=Object.keys(_);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(_);c&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(_,b).enumerable})),u.push.apply(u,g)}return u}function d(_){for(var c=1;c<arguments.length;c++){var u=arguments[c]!=null?arguments[c]:{};c%2?p(Object(u),!0).forEach(function(g){Object(V.a)(_,g,u[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(u)):p(Object(u)).forEach(function(g){Object.defineProperty(_,g,Object.getOwnPropertyDescriptor(u,g))})}return _}function s(_){var c=h();return function(){var g=Object(W.a)(_),b;if(c){var k=Object(W.a)(this).constructor;b=Reflect.construct(g,arguments,k)}else b=g.apply(this,arguments);return Object(M.a)(this,b)}}function h(){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(_){return!1}}function l(){}function i(_){_.preventDefault()}var o=function(c){return c.replace(/[^\w.-]+/g,"")},f=200,A=600,x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(c){return c!=null},O=function(c,u){return u===c||typeof u=="number"&&typeof c=="number"&&isNaN(u)&&isNaN(c)},S=function(_){Object(N.a)(u,_);var c=s(u);function u(g){var b;Object(D.a)(this,u),b=c.call(this,g),b.onKeyDown=function(F){var U=b.props,C=U.onKeyDown,y=U.onPressEnter;if(F.keyCode===m.a.UP){var j=b.getRatio(F);b.up(F,j,null),b.stop()}else if(F.keyCode===m.a.DOWN){var K=b.getRatio(F);b.down(F,K,null),b.stop()}else F.keyCode===m.a.ENTER&&y&&y(F);if(b.recordCursorPosition(),b.lastKeyCode=F.keyCode,C){for(var Q=arguments.length,te=new Array(Q>1?Q-1:0),_e=1;_e<Q;_e++)te[_e-1]=arguments[_e];C.apply(void 0,[F].concat(te))}},b.onKeyUp=function(F){var U=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),U){for(var C=arguments.length,y=new Array(C>1?C-1:0),j=1;j<C;j++)y[j-1]=arguments[j];U.apply(void 0,[F].concat(y))}},b.onChange=function(F){var U=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(F)),b.setState({inputValue:b.rawInput}),U(b.toNumber(b.rawInput))},b.onMouseUp=function(){var F=b.props.onMouseUp;b.recordCursorPosition(),F&&F.apply(void 0,arguments)},b.onFocus=function(){var F;b.setState({focused:!0}),(F=b.props).onFocus.apply(F,arguments)},b.onBlur=function(){var F=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var U=b.getCurrentValidValue(b.state.inputValue),C=b.setValue(U,l);if(F){var y=b.input.value,j=b.getInputDisplayValue({focus:!1,value:C});b.input.value=j&&Number(j),F.apply(void 0,arguments),b.input.value=y}},b.getRatio=function(F){var U=1;return F.metaKey||F.ctrlKey?U=.1:F.shiftKey&&(U=10),U},b.getFullNum=function(F){return isNaN(F)?F:/e/i.test(String(F))?Number(F).toFixed(18).replace(/\.?0+$/,""):F},b.getPrecision=function(F){if(T(b.props.precision))return b.props.precision;var U=String(F);if(U.indexOf("e-")>=0)return parseInt(U.slice(U.indexOf("e-")+2),10);var C=0;return U.indexOf(".")>=0&&(C=U.length-U.indexOf(".")-1),C},b.getInputDisplayValue=function(F){var U=F||b.state,C=U.focused,y=U.inputValue,j=U.value,K;C?K=y:K=b.toPrecisionAsStep(j),K==null&&(K="");var Q=b.formatWrapper(K);return T(b.props.decimalSeparator)&&(Q=Q.toString().replace(".",b.props.decimalSeparator)),Q},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(F){}},b.restoreByAfter=function(F){if(F===void 0)return!1;var U=b.input.value,C=U.lastIndexOf(F);if(C===-1)return!1;var y=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(y-1)===F[0]?(b.fixCaret(y,y),!0):C+F.length===U.length?(b.fixCaret(C,C),!0):!1},b.partRestoreByAfter=function(F){return F===void 0?!1:Array.prototype.some.call(F,function(U,C){var y=F.substring(C);return b.restoreByAfter(y)})},b.isNotCompleteNumber=function(F){return isNaN(F)||F===""||F===null||F&&F.toString().indexOf(".")===F.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(F,U,C){b.pressingUpOrDown=!0,b.step("down",F,U,C)},b.up=function(F,U,C){b.pressingUpOrDown=!0,b.step("up",F,U,C)},b.saveInput=function(F){b.input=F};var k=g.value;k===void 0&&(k=g.defaultValue),b.state={focused:g.autoFocus};var I=b.getValidValue(b.toNumber(k));return b.state=d(d({},b.state),{},{inputValue:b.toPrecisionAsStep(I),value:I}),b}return Object(G.a)(u,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var k=this.props,I=k.value,F=k.onChange,U=k.max,C=k.min,y=this.state.focused;if(b){if(!O(b.value,I)||!O(b.max,U)||!O(b.min,C)){var j=y?I:this.getValidValue(I),K;this.pressingUpOrDown?K=j:this.inputting?K=this.rawInput:K=this.toPrecisionAsStep(j),this.setState({value:j,inputValue:K})}var Q="value"in this.props?I:this.state.value;"max"in this.props&&b.max!==U&&typeof Q=="number"&&Q>U&&F&&F(U),"min"in this.props&&b.min!==C&&typeof Q=="number"&&Q<C&&F&&F(C)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var te=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?te=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(te=this.cursorStart):te=this.input.value.length,this.fixCaret(te,te)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(_e){}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 k=b;return k===""?k="":this.isNotCompleteNumber(parseFloat(k))?k=this.state.value:k=this.getValidValue(k),this.toNumber(k)}},{key:"getValueFromEvent",value:function(b){var k=b.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(k=k.replace(this.props.decimalSeparator,".")),k}},{key:"getValidValue",value:function(b){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,F=parseFloat(b);return isNaN(F)?b:(F<k&&(F=k),F>I&&(F=I),F)}},{key:"setValue",value:function(b,k){var I=this.props.precision,F=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),U=this.state.value,C=U===void 0?null:U,y=this.state.inputValue,j=y===void 0?null:y,K=typeof F=="number"?F.toFixed(I):"".concat(F),Q=F!==C||K!=="".concat(j);return"value"in this.props?(j=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:j},k)):this.setState({value:F,inputValue:this.toPrecisionAsStep(b)},k),Q&&this.props.onChange(F),F}},{key:"getMaxPrecision",value:function(b){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,I=this.props,F=I.precision,U=I.step;if(T(F))return F;var C=this.getPrecision(k),y=this.getPrecision(U),j=this.getPrecision(b);return b?Math.max(j,C+y):C+y}},{key:"getPrecisionFactor",value:function(b){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,I=this.getMaxPrecision(b,k);return Math.pow(10,I)}},{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 k=Math.abs(this.getMaxPrecision(b));return isNaN(k)?b.toString():Number(b).toFixed(k)}},{key:"toNumber",value:function(b){var k=this.props.precision,I=this.state.focused,F=b&&b.length>16&&I;return this.isNotCompleteNumber(b)||F?b:T(k)?Math.round(b*Math.pow(10,k))/Math.pow(10,k):Number(b)}},{key:"upStep",value:function(b,k){var I=this.props.step,F=this.getPrecisionFactor(b,k),U=Math.abs(this.getMaxPrecision(b,k)),C=((F*b+F*I*k)/F).toFixed(U);return this.toNumber(C)}},{key:"downStep",value:function(b,k){var I=this.props.step,F=this.getPrecisionFactor(b,k),U=Math.abs(this.getMaxPrecision(b,k)),C=((F*b-F*I*k)/F).toFixed(U);return this.toNumber(C)}},{key:"step",value:function(b,k){var I=this,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,U=arguments.length>3?arguments[3]:void 0;this.stop(),k&&(k.persist(),k.preventDefault());var C=this.props;if(C.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var j=this["".concat(b,"Step")](y,F),K=j>C.max||j<C.min;if(j>C.max?j=C.max:j<C.min&&(j=C.min),this.setValue(j,null),this.setState({focused:!0},function(){I.pressingUpOrDown=!1}),K)return;this.autoStepTimer=setTimeout(function(){I[b](k,F,!0)},U?f:A)}},{key:"fixCaret",value:function(b,k){if(b===void 0||k===void 0||!this.input||!this.input.value)return;try{var I=this.input.selectionStart,F=this.input.selectionEnd;(b!==I||k!==F)&&this.input.setSelectionRange(b,k)}catch(U){}}},{key:"render",value:function(){var b,k=this.props,I=k.prefixCls,F=k.disabled,U=k.readOnly,C=k.useTouch,y=k.autoComplete,j=k.upHandler,K=k.downHandler,Q=k.className,te=k.max,_e=k.min,de=k.style,me=k.title,fe=k.onMouseEnter,pe=k.onMouseLeave,ae=k.onMouseOver,he=k.onMouseOut,$=k.required,ie=k.onClick,ee=k.tabIndex,Ee=k.type,we=k.placeholder,ye=k.id,xe=k.inputMode,Le=k.pattern,ke=k.step,Pe=k.maxLength,Ae=k.autoFocus,Oe=k.name,Be=k.onPaste,Ve=k.onInput,ze=Object(ne.a)(k,["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"]),je=this.state,et=je.value,Xe=je.focused,$e=v()(I,(b={},Object(V.a)(b,Q,!!Q),Object(V.a)(b,"".concat(I,"-disabled"),F),Object(V.a)(b,"".concat(I,"-focused"),Xe),b)),Ce={};Object.keys(ze).forEach(function(oe){(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(Ce[oe]=ze[oe])});var qe=!U&&!F,Ke=this.getInputDisplayValue(null),Se=(et||et===0)&&(isNaN(et)||Number(et)>=te),Me=(et||et===0)&&(isNaN(et)||Number(et)<=_e),ve=Se||F||U,le=Me||F||U,ue=v()("".concat(I,"-handler"),"".concat(I,"-handler-up"),Object(V.a)({},"".concat(I,"-handler-up-disabled"),ve)),J=v()("".concat(I,"-handler"),"".concat(I,"-handler-down"),Object(V.a)({},"".concat(I,"-handler-down-disabled"),le)),q=C?{onTouchStart:ve?l:this.up,onTouchEnd:this.stop}:{onMouseDown:ve?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},re=C?{onTouchStart:le?l:this.down,onTouchEnd:this.stop}:{onMouseDown:le?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:$e,style:de,title:me,onMouseEnter:fe,onMouseLeave:pe,onMouseOver:ae,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(I,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Increase Value","aria-disabled":ve,className:ue}),j||P.a.createElement("span",{unselectable:"on",className:"".concat(I,"-handler-up-inner"),onClick:i})),P.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Decrease Value","aria-disabled":le,className:J}),K||P.a.createElement("span",{unselectable:"on",className:"".concat(I,"-handler-down-inner"),onClick:i}))),P.a.createElement("div",{className:"".concat(I,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":_e,"aria-valuemax":te,"aria-valuenow":et,required:$,type:Ee,placeholder:we,onPaste:Be,onClick:ie,onMouseUp:this.onMouseUp,className:"".concat(I,"-input"),tabIndex:ee,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:qe?this.onKeyDown:l,onKeyUp:qe?this.onKeyUp:l,autoFocus:Ae,maxLength:Pe,readOnly:U,disabled:F,max:te,min:_e,step:ke,name:Oe,title:me,id:ye,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ke),pattern:Le,inputMode:xe,onInput:Ve},Ce))))}}]),u}(P.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:o,required:!1,autoComplete:"off"};var w=S,E=We.a=w},h78n:function(ot,We,Z){"use strict";Z.d(We,"a",function(){return b});var ne=Z("cDcd"),V=Z.n(ne),D=Z("TSYQ"),G=Z.n(D),N={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(F){var U=F.map(function(){return Object(ne.useRef)()}),C=Object(ne.useRef)();return Object(ne.useEffect)(function(){var y=Date.now(),j=!1;Object.keys(U).forEach(function(K){var Q=U[K].current;if(!Q)return;j=!0;var te=Q.style;te.transitionDuration=".3s, .3s, .3s, .06s",C.current&&y-C.current<100&&(te.transitionDuration="0s, 0s")}),j&&(C.current=Date.now())}),[U]};function W(){return W=Object.assign||function(I){for(var F=1;F<arguments.length;F++){var U=arguments[F];for(var C in U)Object.prototype.hasOwnProperty.call(U,C)&&(I[C]=U[C])}return I},W.apply(this,arguments)}function B(I,F){return p(I)||m(I,F)||R(I,F)||P()}function P(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(I,F){if(!I)return;if(typeof I=="string")return v(I,F);var U=Object.prototype.toString.call(I).slice(8,-1);if(U==="Object"&&I.constructor&&(U=I.constructor.name),U==="Map"||U==="Set")return Array.from(I);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return v(I,F)}function v(I,F){(F==null||F>I.length)&&(F=I.length);for(var U=0,C=new Array(F);U<F;U++)C[U]=I[U];return C}function m(I,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(I)))return;var U=[],C=!0,y=!1,j=void 0;try{for(var K=I[Symbol.iterator](),Q;!(C=(Q=K.next()).done)&&!(U.push(Q.value),F&&U.length===F);C=!0);}catch(te){y=!0,j=te}finally{try{!C&&K.return!=null&&K.return()}finally{if(y)throw j}}return U}function p(I){if(Array.isArray(I))return I}function d(I,F){if(I==null)return{};var U=s(I,F),C,y;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(I);for(y=0;y<j.length;y++){if(C=j[y],F.indexOf(C)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(I,C))continue;U[C]=I[C]}}return U}function s(I,F){if(I==null)return{};var U={},C=Object.keys(I),y,j;for(j=0;j<C.length;j++){if(y=C[j],F.indexOf(y)>=0)continue;U[y]=I[y]}return U}var h=function(F){var U=F.className,C=F.percent,y=F.prefixCls,j=F.strokeColor,K=F.strokeLinecap,Q=F.strokeWidth,te=F.style,_e=F.trailColor,de=F.trailWidth,me=F.transition,fe=d(F,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete fe.gapPosition;var pe=Array.isArray(C)?C:[C],ae=Array.isArray(j)?j:[j],he=M(pe),$=B(he,1),ie=$[0],ee=Q/2,Ee=100-Q/2,we="M ".concat(K==="round"?ee:0,",").concat(ee,`
L `).concat(K==="round"?Ee:100,",").concat(ee),ye="0 0 100 ".concat(Q),xe=0;return V.a.createElement("svg",W({className:G()("".concat(y,"-line"),U),viewBox:ye,preserveAspectRatio:"none",style:te},fe),V.a.createElement("path",{className:"".concat(y,"-line-trail"),d:we,strokeLinecap:K,stroke:_e,strokeWidth:de||Q,fillOpacity:"0"}),pe.map(function(Le,ke){var Pe={strokeDasharray:"".concat(Le,"px, 100px"),strokeDashoffset:"-".concat(xe,"px"),transition:me||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ae=ae[ke]||ae[ae.length-1];return xe+=Le,V.a.createElement("path",{key:ke,className:"".concat(y,"-line-path"),d:we,strokeLinecap:K,stroke:Ae,strokeWidth:Q,fillOpacity:"0",ref:ie[ke],style:Pe})}))};h.defaultProps=N;var l=h;function i(){return i=Object.assign||function(I){for(var F=1;F<arguments.length;F++){var U=arguments[F];for(var C in U)Object.prototype.hasOwnProperty.call(U,C)&&(I[C]=U[C])}return I},i.apply(this,arguments)}function o(I,F){return O(I)||T(I,F)||A(I,F)||f()}function f(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(I,F){if(!I)return;if(typeof I=="string")return x(I,F);var U=Object.prototype.toString.call(I).slice(8,-1);if(U==="Object"&&I.constructor&&(U=I.constructor.name),U==="Map"||U==="Set")return Array.from(I);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return x(I,F)}function x(I,F){(F==null||F>I.length)&&(F=I.length);for(var U=0,C=new Array(F);U<F;U++)C[U]=I[U];return C}function T(I,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(I)))return;var U=[],C=!0,y=!1,j=void 0;try{for(var K=I[Symbol.iterator](),Q;!(C=(Q=K.next()).done)&&!(U.push(Q.value),F&&U.length===F);C=!0);}catch(te){y=!0,j=te}finally{try{!C&&K.return!=null&&K.return()}finally{if(y)throw j}}return U}function O(I){if(Array.isArray(I))return I}function S(I,F){if(I==null)return{};var U=w(I,F),C,y;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(I);for(y=0;y<j.length;y++){if(C=j[y],F.indexOf(C)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(I,C))continue;U[C]=I[C]}}return U}function w(I,F){if(I==null)return{};var U={},C=Object.keys(I),y,j;for(j=0;j<C.length;j++){if(y=C[j],F.indexOf(y)>=0)continue;U[y]=I[y]}return U}var E=0;function _(I){return+I.replace("%","")}function c(I){return Array.isArray(I)?I:[I]}function u(I,F,U,C){var y=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,j=arguments.length>5?arguments[5]:void 0,K=50-C/2,Q=0,te=-K,_e=0,de=-2*K;switch(j){case"left":Q=-K,te=0,_e=2*K,de=0;break;case"right":Q=K,te=0,_e=-2*K,de=0;break;case"bottom":te=K,de=2*K;break;default:}var me="M 50,50 m ".concat(Q,",").concat(te,`
a `).concat(K,",").concat(K," 0 1 1 ").concat(_e,",").concat(-de,`
a `).concat(K,",").concat(K," 0 1 1 ").concat(-_e,",").concat(de),fe=Math.PI*2*K,pe={stroke:U,strokeDasharray:"".concat(F/100*(fe-y),"px ").concat(fe,"px"),strokeDashoffset:"-".concat(y/2+I/100*(fe-y),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:me,pathStyle:pe}}var g=function(F){var U=F.prefixCls,C=F.strokeWidth,y=F.trailWidth,j=F.gapDegree,K=F.gapPosition,Q=F.trailColor,te=F.strokeLinecap,_e=F.style,de=F.className,me=F.strokeColor,fe=F.percent,pe=S(F,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ae=Object(ne.useMemo)(function(){return E+=1,E},[]),he=u(0,100,Q,C,j,K),$=he.pathString,ie=he.pathStyle,ee=c(fe),Ee=c(me),we=Ee.find(function(Pe){return Object.prototype.toString.call(Pe)==="[object Object]"}),ye=M(ee),xe=o(ye,1),Le=xe[0],ke=function(){var Ae=0;return ee.map(function(Oe,Be){var Ve=Ee[Be]||Ee[Ee.length-1],ze=Object.prototype.toString.call(Ve)==="[object Object]"?"url(#".concat(U,"-gradient-").concat(ae,")"):"",je=u(Ae,Oe,Ve,C,j,K);return Ae+=Oe,V.a.createElement("path",{key:Be,className:"".concat(U,"-circle-path"),d:je.pathString,stroke:ze,strokeLinecap:te,strokeWidth:C,opacity:Oe===0?0:1,fillOpacity:"0",style:je.pathStyle,ref:Le[Be]})})};return V.a.createElement("svg",i({className:G()("".concat(U,"-circle"),de),viewBox:"0 0 100 100",style:_e},pe),we&&V.a.createElement("defs",null,V.a.createElement("linearGradient",{id:"".concat(U,"-gradient-").concat(ae),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(we).sort(function(Pe,Ae){return _(Pe)-_(Ae)}).map(function(Pe,Ae){return V.a.createElement("stop",{key:Ae,offset:Pe,stopColor:we[Pe]})}))),V.a.createElement("path",{className:"".concat(U,"-circle-trail"),d:$,stroke:Q,strokeLinecap:te,strokeWidth:y||C,fillOpacity:"0",style:ie}),ke().reverse())};g.defaultProps=N;var b=g,k={Line:l,Circle:b}},kSUc:function(ot,We,Z){},"kaH+":function(ot,We,Z){"use strict";var ne=Z("+L6B"),V=Z("2/Rp"),D=Z("tJVT"),G=Z("cDcd"),N=Z.n(G),M=Z("UZu5"),W=Z.n(M),B=Z("dhSg"),P=Z("rLCj"),R=Z("dF/Y"),v=Z("4i/N");We.a=function(){var m=Object(G.useState)(""),p=Object(D.a)(m,2),d=p[0],s=p[1],h=Object(G.useState)(0),l=Object(D.a)(h,2),i=l[0],o=l[1],f=Object(G.useRef)("");Object(G.useEffect)(function(){var E=B.a.subscribe("preview-image",function(_){s(_),document.body.style.overflow="hidden"});return E},[]),Object(G.useEffect)(function(){return document.addEventListener("keydown",A),function(){document.removeEventListener("keydown",A)}},[]),Object(G.useEffect)(function(){f.current=d},[d]);function A(E){E.keyCode==27&&f.current&&x()}function x(){document.body.style.overflow="auto",s("")}function T(){o(i+90)}var O=Object(G.useRef)(),S=Object(G.useRef)(),w=function(_){(_.nativeEvent.target===O.current||_.nativeEvent.target===S.current)&&x()};return N.a.createElement(G.Fragment,null,d?N.a.createElement("div",{className:"image-preview-container",ref:O,onClick:w},N.a.createElement("div",{className:"button-group"},N.a.createElement(V.a,{onClick:T},"\u65CB\u8F6C",N.a.createElement(P.a,null)),N.a.createElement(V.a,{href:d},"\u4E0B\u8F7D",N.a.createElement(R.a,null)),N.a.createElement(V.a,{onClick:x},"\u5173\u95ED",N.a.createElement(v.a,null))),N.a.createElement("div",{className:"preview-wrp-group",ref:S},N.a.createElement("img",{className:"image-preview",src:d,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(i,"deg)")}}))):null)}},lZu9:function(ot,We,Z){(function(ne){ne(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(V,D){var G=ne.getMode(V,"text/html"),N=G.name=="null";function M(C){if(ne.findModeByName){var y=ne.findModeByName(C);y&&(C=y.mime||y.mimes[0])}var j=ne.getMode(V,C);return j.name=="null"?null:j}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.tokenTypeOverrides={});var W={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 B in W)W.hasOwnProperty(B)&&D.tokenTypeOverrides[B]&&(W[B]=D.tokenTypeOverrides[B]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,i=" ";function o(C,y,j){return y.f=y.inline=j,j(C,y)}function f(C,y,j){return y.f=y.block=j,j(C,y)}function A(C){return!C||!/\S/.test(C.string)}function x(C){if(C.linkTitle=!1,C.linkHref=!1,C.linkText=!1,C.em=!1,C.strong=!1,C.strikethrough=!1,C.quote=0,C.indentedCode=!1,C.f==O){var y=N;if(!y){var j=ne.innerMode(G,C.htmlState);y=j.mode.name=="xml"&&j.state.tagStart===null&&!j.state.context&&j.state.tokenize.isInText}y&&(C.f=_,C.block=T,C.htmlState=null)}return C.trailingSpace=0,C.trailingSpaceNewLine=!1,C.prevLine=C.thisLine,C.thisLine={stream:null},null}function T(C,y){var j=C.column()===y.indentation,K=A(y.prevLine.stream),Q=y.indentedCode,te=y.prevLine.hr,_e=y.list!==!1,de=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var me=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,_e)){for(y.list=null;me<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=me-y.listStack[y.listStack.length-1])}var fe=!K&&!te&&!y.prevLine.header&&(!_e||!Q)&&!y.prevLine.fencedCodeEnd,pe=(y.list===!1||te||K)&&y.indentation<=de&&C.match(P),ae=null;if(y.indentationDiff>=4&&(Q||y.prevLine.fencedCodeEnd||y.prevLine.header||K))return C.skipToEnd(),y.indentedCode=!0,W.code;if(C.eatSpace())return null;if(j&&y.indentation<=de&&(ae=C.match(m))&&ae[1].length<=6)return y.quote=0,y.header=ae[1].length,y.thisLine.header=!0,D.highlightFormatting&&(y.formatting="header"),y.f=y.inline,w(y);if(y.indentation<=de&&C.eat(">"))return y.quote=j?1:y.quote+1,D.highlightFormatting&&(y.formatting="quote"),C.eatSpace(),w(y);if(!pe&&!y.setext&&j&&y.indentation<=de&&(ae=C.match(R))){var he=ae[1]?"ol":"ul";return y.indentation=me+C.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,D.taskLists&&C.match(v,!1)&&(y.taskList=!0),y.f=y.inline,D.highlightFormatting&&(y.formatting=["list","list-"+he]),w(y)}else{if(j&&y.indentation<=de&&(ae=C.match(s,!0)))return y.quote=0,y.fencedEndRE=new RegExp(ae[1]+"+ *$"),y.localMode=D.fencedCodeBlockHighlighting&&M(ae[2]||D.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=ne.startState(y.localMode)),y.f=y.block=S,D.highlightFormatting&&(y.formatting="code-block"),y.code=-1,w(y);if(y.setext||(!fe||!_e)&&!y.quote&&y.list===!1&&!y.code&&!pe&&!h.test(C.string)&&(ae=C.lookAhead(1))&&(ae=ae.match(p)))return y.setext?(y.header=y.setext,y.setext=0,C.skipToEnd(),D.highlightFormatting&&(y.formatting="header")):(y.header=ae[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,w(y);if(pe)return C.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,W.hr;if(C.peek()==="[")return o(C,y,k)}return o(C,y,y.inline)}function O(C,y){var j=G.token(C,y.htmlState);if(!N){var K=ne.innerMode(G,y.htmlState);(K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText||y.md_inside&&C.current().indexOf(">")>-1)&&(y.f=_,y.block=T,y.htmlState=null)}return j}function S(C,y){var j=y.listStack[y.listStack.length-1]||0,K=y.indentation<j,Q=j+3;if(y.fencedEndRE&&y.indentation<=Q&&(K||C.match(y.fencedEndRE))){D.highlightFormatting&&(y.formatting="code-block");var te;return K||(te=w(y)),y.localMode=y.localState=null,y.block=T,y.f=_,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,K?f(C,y,y.block):te}else return y.localMode?y.localMode.token(C,y.localState):(C.skipToEnd(),W.code)}function w(C){var y=[];if(C.formatting){y.push(W.formatting),typeof C.formatting=="string"&&(C.formatting=[C.formatting]);for(var j=0;j<C.formatting.length;j++)y.push(W.formatting+"-"+C.formatting[j]),C.formatting[j]==="header"&&y.push(W.formatting+"-"+C.formatting[j]+"-"+C.header),C.formatting[j]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=C.quote?y.push(W.formatting+"-"+C.formatting[j]+"-"+C.quote):y.push("error"))}if(C.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(C.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(C.linkHref?y.push(W.linkHref,"url"):(C.strong&&y.push(W.strong),C.em&&y.push(W.em),C.strikethrough&&y.push(W.strikethrough),C.emoji&&y.push(W.emoji),C.linkText&&y.push(W.linkText),C.code&&y.push(W.code),C.image&&y.push(W.image),C.imageAltText&&y.push(W.imageAltText,"link"),C.imageMarker&&y.push(W.imageMarker)),C.header&&y.push(W.header,W.header+"-"+C.header),C.quote&&(y.push(W.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=C.quote?y.push(W.quote+"-"+C.quote):y.push(W.quote+"-"+D.maxBlockquoteDepth)),C.list!==!1){var K=(C.listStack.length-1)%3;K?K===1?y.push(W.list2):y.push(W.list3):y.push(W.list1)}return C.trailingSpaceNewLine?y.push("trailing-space-new-line"):C.trailingSpace&&y.push("trailing-space-"+(C.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function E(C,y){return C.match(d,!0)?w(y):void 0}function _(C,y){var j=y.text(C,y);if(typeof j!="undefined")return j;if(y.list)return y.list=null,w(y);if(y.taskList){var K=C.match(v,!0)[1]===" ";return K?y.taskOpen=!0:y.taskClosed=!0,D.highlightFormatting&&(y.formatting="task"),y.taskList=!1,w(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&C.match(/^#+$/,!0))return D.highlightFormatting&&(y.formatting="header"),w(y);var Q=C.next();if(y.linkTitle){y.linkTitle=!1;var te=Q;Q==="("&&(te=")"),te=(te+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var _e="^\\s*(?:[^"+te+"\\\\]+|\\\\\\\\|\\\\.)"+te;if(C.match(new RegExp(_e),!0))return W.linkHref}if(Q==="`"){var de=y.formatting;D.highlightFormatting&&(y.formatting="code"),C.eatWhile("`");var me=C.current().length;if(y.code==0&&(!y.quote||me==1))return y.code=me,w(y);if(me==y.code){var fe=w(y);return y.code=0,fe}else return y.formatting=de,w(y)}else if(y.code)return w(y);if(Q==="\\"&&(C.next(),D.highlightFormatting)){var pe=w(y),ae=W.formatting+"-escape";return pe?pe+" "+ae:ae}if(Q==="!"&&C.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,D.highlightFormatting&&(y.formatting="image"),w(y);if(Q==="["&&y.imageMarker&&C.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,D.highlightFormatting&&(y.formatting="image"),w(y);if(Q==="]"&&y.imageAltText){D.highlightFormatting&&(y.formatting="image");var pe=w(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=u,pe}if(Q==="["&&!y.image)return y.linkText&&C.match(/^.*?\]/)||(y.linkText=!0,D.highlightFormatting&&(y.formatting="link")),w(y);if(Q==="]"&&y.linkText){D.highlightFormatting&&(y.formatting="link");var pe=w(y);return y.linkText=!1,y.inline=y.f=C.match(/\(.*?\)| ?\[.*?\]/,!1)?u:_,pe}if(Q==="<"&&C.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=c,D.highlightFormatting&&(y.formatting="link");var pe=w(y);return pe?pe+=" ":pe="",pe+W.linkInline}if(Q==="<"&&C.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=c,D.highlightFormatting&&(y.formatting="link");var pe=w(y);return pe?pe+=" ":pe="",pe+W.linkEmail}if(D.xml&&Q==="<"&&C.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=C.string.indexOf(">",C.pos);if(he!=-1){var $=C.string.substring(C.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test($)&&(y.md_inside=!0)}return C.backUp(1),y.htmlState=ne.startState(G),f(C,y,O)}if(D.xml&&Q==="<"&&C.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(Q==="*"||Q==="_"){for(var ie=1,ee=C.pos==1?" ":C.string.charAt(C.pos-2);ie<3&&C.eat(Q);)ie++;var Ee=C.peek()||" ",we=!/\s/.test(Ee)&&(!l.test(Ee)||/\s/.test(ee)||l.test(ee)),ye=!/\s/.test(ee)&&(!l.test(ee)||/\s/.test(Ee)||l.test(Ee)),xe=null,Le=null;if(ie%2&&(!y.em&&we&&(Q==="*"||!ye||l.test(ee))?xe=!0:y.em==Q&&ye&&(Q==="*"||!we||l.test(Ee))&&(xe=!1)),ie>1&&(!y.strong&&we&&(Q==="*"||!ye||l.test(ee))?Le=!0:y.strong==Q&&ye&&(Q==="*"||!we||l.test(Ee))&&(Le=!1)),Le!=null||xe!=null){D.highlightFormatting&&(y.formatting=xe==null?"strong":Le==null?"em":"strong em"),xe===!0&&(y.em=Q),Le===!0&&(y.strong=Q);var fe=w(y);return xe===!1&&(y.em=!1),Le===!1&&(y.strong=!1),fe}}else if(Q===" "&&(C.eat("*")||C.eat("_"))){if(C.peek()===" ")return w(y);C.backUp(1)}if(D.strikethrough){if(Q==="~"&&C.eatWhile(Q)){if(y.strikethrough){D.highlightFormatting&&(y.formatting="strikethrough");var fe=w(y);return y.strikethrough=!1,fe}else if(C.match(/^[^\s]/,!1))return y.strikethrough=!0,D.highlightFormatting&&(y.formatting="strikethrough"),w(y)}else if(Q===" "&&C.match(/^~~/,!0)){if(C.peek()===" ")return w(y);C.backUp(2)}}if(D.emoji&&Q===":"&&C.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,D.highlightFormatting&&(y.formatting="emoji");var ke=w(y);return y.emoji=!1,ke}return Q===" "&&(C.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),w(y)}function c(C,y){var j=C.next();if(j===">"){y.f=y.inline=_,D.highlightFormatting&&(y.formatting="link");var K=w(y);return K?K+=" ":K="",K+W.linkInline}return C.match(/^[^>]+/,!0),W.linkInline}function u(C,y){if(C.eatSpace())return null;var j=C.next();return j==="("||j==="["?(y.f=y.inline=b(j==="("?")":"]"),D.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,w(y)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(C){return function(y,j){var K=y.next();if(K===C){j.f=j.inline=_,D.highlightFormatting&&(j.formatting="link-string");var Q=w(j);return j.linkHref=!1,Q}return y.match(g[C]),j.linkHref=!0,w(j)}}function k(C,y){return C.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=I,C.next(),D.highlightFormatting&&(y.formatting="link"),y.linkText=!0,w(y)):o(C,y,_)}function I(C,y){if(C.match(/^\]:/,!0)){y.f=y.inline=F,D.highlightFormatting&&(y.formatting="link");var j=w(y);return y.linkText=!1,j}return C.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function F(C,y){return C.eatSpace()?null:(C.match(/^[^\s]+/,!0),C.peek()===void 0?y.linkTitle=!0:C.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=_,W.linkHref+" url")}var U={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:_,text:E,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(C){return{f:C.f,prevLine:C.prevLine,thisLine:C.thisLine,block:C.block,htmlState:C.htmlState&&ne.copyState(G,C.htmlState),indentation:C.indentation,localMode:C.localMode,localState:C.localMode?ne.copyState(C.localMode,C.localState):null,inline:C.inline,text:C.text,formatting:!1,linkText:C.linkText,linkTitle:C.linkTitle,linkHref:C.linkHref,code:C.code,em:C.em,strong:C.strong,strikethrough:C.strikethrough,emoji:C.emoji,header:C.header,setext:C.setext,hr:C.hr,taskList:C.taskList,list:C.list,listStack:C.listStack.slice(0),quote:C.quote,indentedCode:C.indentedCode,trailingSpace:C.trailingSpace,trailingSpaceNewLine:C.trailingSpaceNewLine,md_inside:C.md_inside,fencedEndRE:C.fencedEndRE}},token:function(C,y){if(y.formatting=!1,C!=y.thisLine.stream){if(y.header=0,y.hr=!1,C.match(/^\s*$/,!0))return x(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:C},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=O)){var j=C.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(y.indentation=j,y.indentationDiff=null,j>0)return null}}return y.f(C,y)},innerMode:function(C){return C.block==O?{state:C.htmlState,mode:G}:C.localState?{state:C.localState,mode:C.localMode}:{state:C,mode:U}},indent:function(C,y,j){return C.block==O&&G.indent?G.indent(C.htmlState,y,j):C.localState&&C.localMode.indent?C.localMode.indent(C.localState,y,j):ne.Pass},blankLine:x,getType:w,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return U},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},osHv:function(ot,We,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";var V=ne.Pos;function D(l,i){return l.line-i.line||l.ch-i.ch}var G="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=G+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+G+"]["+N+"]*)","g");function W(l,i,o,f){this.line=i,this.ch=o,this.cm=l,this.text=l.getLine(i),this.min=f?Math.max(f.from,l.firstLine()):l.firstLine(),this.max=f?Math.min(f.to-1,l.lastLine()):l.lastLine()}function B(l,i){var o=l.cm.getTokenTypeAt(V(l.line,i));return o&&/\btag\b/.test(o)}function P(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function R(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function v(l){for(;;){var i=l.text.indexOf(">",l.ch);if(i==-1){if(P(l))continue;return}if(!B(l,i+1)){l.ch=i+1;continue}var o=l.text.lastIndexOf("/",i),f=o>-1&&!/\S/.test(l.text.slice(o+1,i));return l.ch=i+1,f?"selfClose":"regular"}}function m(l){for(;;){var i=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(i==-1){if(R(l))continue;return}if(!B(l,i+1)){l.ch=i;continue}M.lastIndex=i,l.ch=i;var o=M.exec(l.text);if(o&&o.index==i)return o}}function p(l){for(;;){M.lastIndex=l.ch;var i=M.exec(l.text);if(!i){if(P(l))continue;return}if(!B(l,i.index+1)){l.ch=i.index+1;continue}return l.ch=i.index+i[0].length,i}}function d(l){for(;;){var i=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(i==-1){if(R(l))continue;return}if(!B(l,i+1)){l.ch=i;continue}var o=l.text.lastIndexOf("/",i),f=o>-1&&!/\S/.test(l.text.slice(o+1,i));return l.ch=i+1,f?"selfClose":"regular"}}function s(l,i){for(var o=[];;){var f=p(l),A,x=l.line,T=l.ch-(f?f[0].length:0);if(!f||!(A=v(l)))return;if(A=="selfClose")continue;if(f[1]){for(var O=o.length-1;O>=0;--O)if(o[O]==f[2]){o.length=O;break}if(O<0&&(!i||i==f[2]))return{tag:f[2],from:V(x,T),to:V(l.line,l.ch)}}else o.push(f[2])}}function h(l,i){for(var o=[];;){var f=d(l);if(!f)return;if(f=="selfClose"){m(l);continue}var A=l.line,x=l.ch,T=m(l);if(!T)return;if(T[1])o.push(T[2]);else{for(var O=o.length-1;O>=0;--O)if(o[O]==T[2]){o.length=O;break}if(O<0&&(!i||i==T[2]))return{tag:T[2],from:V(l.line,l.ch),to:V(A,x)}}}}ne.registerHelper("fold","xml",function(l,i){for(var o=new W(l,i.line,0);;){var f=p(o);if(!f||o.line!=i.line)return;var A=v(o);if(!A)return;if(!f[1]&&A!="selfClose"){var x=V(o.line,o.ch),T=s(o,f[2]);return T&&D(T.from,x)>0?{from:x,to:T.from}:null}}}),ne.findMatchingTag=function(l,i,o){var f=new W(l,i.line,i.ch,o);if(f.text.indexOf(">")==-1&&f.text.indexOf("<")==-1)return;var A=v(f),x=A&&V(f.line,f.ch),T=A&&m(f);if(!A||!T||D(f,i)>0)return;var O={from:V(f.line,f.ch),to:x,tag:T[2]};return A=="selfClose"?{open:O,close:null,at:"open"}:T[1]?{open:h(f,T[2]),close:O,at:"close"}:(f=new W(l,x.line,x.ch,o),{open:O,close:s(f,T[2]),at:"open"})},ne.findEnclosingTag=function(l,i,o,f){for(var A=new W(l,i.line,i.ch,o);;){var x=h(A,f);if(!x)break;var T=new W(l,i.line,i.ch,o),O=s(T,x.tag);if(O)return{open:x,close:O}}},ne.scanForClosingTag=function(l,i,o,f){var A=new W(l,i.line,i.ch,f?{from:0,to:f}:null);return s(A,o)}})},p5ED:function(ot,We,Z){"use strict";var ne=Z("+L6B"),V=Z("2/Rp"),D=Z("5Dmo"),G=Z("3S7+"),N=Z("k1fw"),M=Z("tJVT"),W=Z("cDcd"),B=Z.n(W),P=Z("vHTk"),R=Z.n(P),v=Z("yEEn"),m=Z("ZW9T"),p=Z("1vsH");We.a=function(d){var s=d.name,h=d.data,l=d.theme,i=d.type,o=d.filename,f=d.monacoEditor,A=d.className,x=d.style,T=d.close,O=d.onClose,S=d.hasMask,w=Object(W.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),E=Object(M.a)(w,2),_=E[0],c=E[1],u=Object(W.useState)(""),g=Object(M.a)(u,2),b=g[0],k=g[1],I,F=1024*1024,U=10*F,C=Object(W.useRef)();i==="office"&&(I=Object(p.V)(h).filesize,I>U&&(i="other")),o&&(f.filename=o),Object(W.useEffect)(function(){var K,Q,te=(K=document.cookie)===null||K===void 0||((Q=K.replace(/\s/g,""))===null||Q===void 0)?void 0:Q.split(";");te==null||te.map(function(_e){var de=_e.split("=");de[0]==="_educoder_session"&&k(de[1])})},[]);var y=function(){if(h.startsWith("http")||h.startsWith("/")){j();return}Object(p.z)(o||"educoder",h,o)},j=function(){Object(p.x)(o||s,h)};return console.log("data:",h,"fileanme:",o," name:",s),B.a.createElement("div",{style:Object(N.a)({},x||{}),className:"".concat(S&&R.a.bgBlack," ").concat(i?R.a.wrp:"hide")},T&&B.a.createElement("div",{className:R.a.close,ref:C},B.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return C.current}},B.a.createElement("span",{onClick:j},B.a.createElement("i",{className:"icon-quxiaozhiding"}))),B.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return C.current}},B.a.createElement("span",{className:"",onClick:O},B.a.createElement("i",{className:"icon-guanbi1"})))),B.a.createElement("div",{className:"".concat(R.a[A]," ").concat(A," ").concat(R.a.monaco," ").concat(i==="txt"?"show":"hide")},i==="txt"&&B.a.createElement(m.b,f)),i==="audio"&&B.a.createElement("audio",{src:"".concat(h!=null&&h.startsWith("/")||(h==null?void 0:h.indexOf("https://"))>-1?h:"data:audio/mp3;base64,").concat(h),autoPlay:!0}),i==="video"&&B.a.createElement(B.a.Fragment,null,h!=null&&h.startsWith("/")?B.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):B.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),i==="html"&&B.a.createElement("iframe",{src:h+"&disposition=inline"}),i==="pdf"&&B.a.createElement("embed",{className:R.a.embed,src:h}),i==="image"&&B.a.createElement(B.a.Fragment,null,B.a.createElement("img",{src:"".concat(h!=null&&h.startsWith("/")||(h==null?void 0:h.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(h)})),i==="other"&&B.a.createElement("div",null,B.a.createElement(V.a,{type:"primary",size:"large",onClick:y},B.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(i==="download"||i==="office")&&B.a.createElement(V.a,{type:"primary",size:"large",onClick:y},B.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ot,We,Z){},psGv:function(ot,We,Z){var ne,V;(function(){var D;(function(){"use strict";var W=[,,function(v){function m(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=[]}m.prototype.clone_empty=function(){var s=new m(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},m.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},m.prototype.has_match=function(s){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(s))return!0;return!1},m.prototype.set_indent=function(s,h){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.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)},m.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},m.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},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(s){this.__items.push(s);var h=s.lastIndexOf(`
`);h!==-1?this.__character_count=s.length-h:this.__character_count+=s.length},m.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.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 p(s,h){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)),h=h||"",s.indent_level>0&&(h=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}p.prototype.get_indent_size=function(s,h){var l=this.__base_string_length;return h=h||0,s<0&&(l=0),l+=s*this.__indent_size,l+=h,l},p.prototype.get_indent_string=function(s,h){var l=this.__base_string;return h=h||0,s<0&&(s=0,l=""),h+=s*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},p.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var s=this.__cache.length,h=0,l="";this.__indent_size&&s>=this.__indent_size&&(h=Math.floor(s/this.__indent_size),s-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),s&&(l+=new Array(s+1).join(" ")),this.__cache.push(l)};function d(s,h){this.__indent_cache=new p(s,h),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 m(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,h){return this.__indent_cache.get_indent_string(s,h)},d.prototype.get_indent_size=function(s,h){return this.__indent_cache.get_indent_size(s,h)},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 h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return s!==`
`&&(l=l.replace(/[\n]/g,s)),l},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(s,h){return s=s||0,h=h||0,this.next_line.set_indent(s,h),this.__lines.length>1?(this.current_line.set_indent(s,h),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(s){for(var h=0;h<s.newlines;h++)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 h=this.__lines.length;s<h;)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,h){for(var l=this.__lines.length-2;l>=0;){var i=this.__lines[l];if(i.is_empty())break;if(i.item(0).indexOf(s)!==0&&i.item(-1)!==h){this.__lines.splice(l+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},v.exports.Output=d},function(v){function m(p,d,s,h){this.type=p,this.text=d,this.comments_before=null,this.newlines=s||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(s,h){this.raw_options=p(s,h),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"])}m.prototype._get_array=function(s,h){var l=this.raw_options[s],i=h||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(i=l.concat()):typeof l=="string"&&(i=l.split(/[^a-zA-Z0-9_\/\-]+/)),i},m.prototype._get_boolean=function(s,h){var l=this.raw_options[s],i=l===void 0?!!h:!!l;return i},m.prototype._get_characters=function(s,h){var l=this.raw_options[s],i=h||"";return typeof l=="string"&&(i=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),i},m.prototype._get_number=function(s,h){var l=this.raw_options[s];h=parseInt(h,10),isNaN(h)&&(h=0);var i=parseInt(l,10);return isNaN(i)&&(i=h),i},m.prototype._get_selection=function(s,h,l){var i=this._get_selection_list(s,h,l);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[s]+"'");return i[0]},m.prototype._get_selection_list=function(s,h,l){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[h[0]],!this._is_valid_selection(l,h))throw new Error("Invalid Default Value!");var i=this._get_array(s,l);if(!this._is_valid_selection(i,h))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[s]+"'");return i},m.prototype._is_valid_selection=function(s,h){return s.length&&h.length&&!s.some(function(l){return h.indexOf(l)===-1})};function p(s,h){var l={};s=d(s);var i;for(i in s)i!==h&&(l[i]=s[i]);if(h&&s[h])for(i in s[h])l[i]=s[h][i];return l}function d(s){var h={},l;for(l in s){var i=l.replace(/-/g,"_");h[i]=s[l]}return h}v.exports.Options=m,v.exports.normalizeOpts=d,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},p.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},p.prototype.__match=function(d,s){d.lastIndex=s;var h=d.exec(this.__input);return h&&!(m&&d.sticky)&&(h.index!==s&&(h=null)),h},p.prototype.test=function(d,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(d,s):!1},p.prototype.testChar=function(d,s){var h=this.peek(s);return d.lastIndex=0,h!==null&&d.test(h)},p.prototype.match=function(d){var s=this.__match(d,this.__position);return s?this.__position+=s[0].length:s=null,s},p.prototype.read=function(d,s,h){var l="",i;return d&&(i=this.match(d),i&&(l+=i[0])),s&&(i||!d)&&(l+=this.readUntil(s,h)),l},p.prototype.readUntil=function(d,s){var h="",l=this.__position;d.lastIndex=this.__position;var i=d.exec(this.__input);return i?(l=i.index,s&&(l+=i[0].length)):l=this.__input_length,h=this.__input.substring(this.__position,l),this.__position=l,h},p.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},p.prototype.get_regexp=function(d,s){var h=null,l="g";return s&&m&&(l="y"),typeof d=="string"&&d!==""?h=new RegExp(d,l):d&&(h=new RegExp(d.source,l)),h},p.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(d){var s=this.__position,h=this.readUntilAfter(d);return this.__position=s,h},p.prototype.lookBack=function(d){var s=this.__position-1;return s>=d.length&&this.__input.substring(s-d.length,s).toLowerCase()===d},v.exports.InputScanner=p},function(v,m,p){var d=p(8).InputScanner,s=p(3).Token,h=p(10).TokenStream,l=p(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(f,A){this._input=new d(f),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var f,A=new s(i.START,""),x=null,T=[],O=new h;A.type!==i.EOF;){for(f=this._get_next_token(A,x);this._is_comment(f);)O.add(f),f=this._get_next_token(A,x);O.isEmpty()||(f.comments_before=O,O=new h),f.parent=x,this._is_opening(f)?(T.push(x),x=f):x&&this._is_closing(f,x)&&(f.opened=x,x.closed=f,x=T.pop(),f.parent=x),f.previous=A,A.next=f,this.__tokens.add(f),A=f}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(f,A){this._readWhitespace();var x=this._input.read(/.+/g);return x?this._create_token(i.RAW,x):this._create_token(i.EOF,"")},o.prototype._is_comment=function(f){return!1},o.prototype._is_opening=function(f){return!1},o.prototype._is_closing=function(f,A){return!1},o.prototype._create_token=function(f,A){var x=new s(f,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return x},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=o,v.exports.TOKEN=i},function(v){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var d=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(d=this.__tokens[p]),d},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=m},function(v,m,p){var d=p(12).Pattern;function s(h,l){d.call(this,h,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new d,s.prototype.__set_whitespace_patterns=function(h,l){h+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var l=this.__split(this._newline_regexp,h);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return h},s.prototype.matching=function(h,l){var i=this._create();return i.__set_whitespace_patterns(h,l),i._update(),i},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(h,l){h.lastIndex=0;for(var i=0,o=[],f=h.exec(l);f;)o.push(l.substring(i,f.index)),i=f.index+f[0].length,f=h.exec(l);return i<l.length?o.push(l.substring(i,l.length)):o.push(""),o},v.exports.WhitespacePattern=s},function(v){function m(p,d){this._input=p,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)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(p),d._update(),d},m.prototype.until=function(p){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(p),d._update(),d},m.prototype.starting_with=function(p){var d=this._create();return d._starting_pattern=this._input.get_regexp(p,!0),d._update(),d},m.prototype.matching=function(p){var d=this._create();return d._match_pattern=this._input.get_regexp(p,!0),d._update(),d},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},v.exports.Pattern=m},function(v){function m(p,d){p=typeof p=="string"?p:p.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+d,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(p);s;)d[s[1]]=s[2],s=this.__directive_pattern.exec(p);return d},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=m},function(v,m,p){var d=p(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(l,i){d.call(this,l,i),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),i&&(this.__template_pattern=this._input.get_regexp(i.__template_pattern),this._excluded=Object.assign(this._excluded,i._excluded),this._disabled=Object.assign(this._disabled,i._disabled));var o=new d(l);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new d,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(l){var i=this._create();return i._disabled[l]=!0,i._update(),i},h.prototype.read_options=function(l){var i=this._create();for(var o in s)i._disabled[o]=l.templating.indexOf(o)===-1;return i._update(),i},h.prototype.exclude=function(l){var i=this._create();return i._excluded[l]=!0,i._update(),i},h.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),l+=i,i=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},h.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},h.prototype._read_template=function(){var l="",i=this._input.peek();if(i==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},v.exports.TemplatablePattern=h},,,,function(v,m,p){var d=p(19).Beautifier,s=p(20).Options;function h(l,i,o,f){var A=new d(l,i,o,f);return A.beautify()}v.exports=h,v.exports.defaultOptions=function(){return new s}},function(v,m,p){var d=p(20).Options,s=p(2).Output,h=p(21).Tokenizer,l=p(21).TOKEN,i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,f=function(u,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=u.max_preserve_newlines,this.preserve_newlines=u.preserve_newlines,this._output=new s(u,g)};f.prototype.current_line_has_match=function(u){return this._output.current_line.has_match(u)},f.prototype.set_space_before_token=function(u,g){this._output.space_before_token=u,this._output.non_breaking_space=g},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(u){this._output.add_raw_token(u)},f.prototype.print_preserved_newlines=function(u){var g=0;u.type!==l.TEXT&&u.previous.type!==l.TEXT&&(g=u.newlines?1:0),this.preserve_newlines&&(g=u.newlines<this.max_preserve_newlines+1?u.newlines:this.max_preserve_newlines+1);for(var b=0;b<g;b++)this.print_newline(b>0);return g!==0},f.prototype.traverse_whitespace=function(u){return u.whitespace_before||u.newlines?(this.print_preserved_newlines(u)||(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(u){this._output.add_new_line(u)},f.prototype.print_token=function(u){u.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(u.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.get_full_indent=function(u){return u=this.indent_level+(u||0),u<1?"":this._output.get_indent_string(u)};var A=function(u){for(var g=null,b=u.next;b.type!==l.EOF&&u.closed!==b;){if(b.type===l.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===l.EQUALS&&b.next.next&&b.next.next.type===l.VALUE&&(g=b.next.next.text);break}b=b.next}return g},x=function(u,g){var b=null,k=null;return g.closed?(u==="script"?b="text/javascript":u==="style"&&(b="text/css"),b=A(g)||b,b.search("text/css")>-1?k="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?k="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?k="html":b.search(/test\/null/)>-1&&(k="null"),k):null};function T(u,g){return g.indexOf(u)!==-1}function O(u,g,b){this.parent=u||null,this.tag=g?g.tag_name:"",this.indent_level=b||0,this.parser_token=g||null}function S(u){this._printer=u,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(u){var g=new O(this._current_frame,u,this._printer.indent_level);this._current_frame=g},S.prototype._try_pop_frame=function(u){var g=null;return u&&(g=u.parser_token,this._printer.indent_level=u.indent_level,this._current_frame=u.parent),g},S.prototype._get_frame=function(u,g){for(var b=this._current_frame;b&&!(u.indexOf(b.tag)!==-1);){if(g&&g.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},S.prototype.try_pop=function(u,g){var b=this._get_frame([u],g);return this._try_pop_frame(b)},S.prototype.indent_to_tag=function(u){var g=this._get_frame(u);g&&(this._printer.indent_level=g.indent_level)};function w(u,g,b,k){this._source_text=u||"",g=g||{},this._js_beautify=b,this._css_beautify=k,this._tag_stack=null;var I=new d(g,"html");this._options=I,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"}w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var u=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
`,u&&i.test(u)&&(g=u.match(i)[0])),u=u.replace(o,`
`);var b=u.match(/^[\t ]*/)[0],k={text:"",type:""},I=new E,F=new f(this._options,b),U=new h(u,this._options).tokenize();this._tag_stack=new S(F);for(var C=null,y=U.next();y.type!==l.EOF;)y.type===l.TAG_OPEN||y.type===l.COMMENT?(C=this._handle_tag_open(F,y,I,k),I=C):y.type===l.ATTRIBUTE||y.type===l.EQUALS||y.type===l.VALUE||y.type===l.TEXT&&!I.tag_complete?C=this._handle_inside_tag(F,y,I,U):y.type===l.TAG_CLOSE?C=this._handle_tag_close(F,y,I):y.type===l.TEXT?C=this._handle_text(F,y,I):F.add_raw_token(y),k=C,y=U.next();var j=F._output.get_code(g);return j},w.prototype._handle_tag_close=function(u,g,b){var k={text:g.text,type:g.type};return u.alignment_size=0,b.tag_complete=!0,u.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),b.is_unformatted?u.add_raw_token(g):(b.tag_start_char==="<"&&(u.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&u.print_newline(!1)),u.print_token(g)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(u.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&u.set_wrap_point(),k},w.prototype._handle_inside_tag=function(u,g,b,k){var I=b.has_wrapped_attrs,F={text:g.text,type:g.type};if(u.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),b.is_unformatted)u.add_raw_token(g);else if(b.tag_start_char==="{"&&g.type===l.TEXT)u.print_preserved_newlines(g)?(g.newlines=0,u.add_raw_token(g)):u.print_token(g);else{if(g.type===l.ATTRIBUTE?(u.set_space_before_token(!0),b.attr_count+=1):(g.type===l.EQUALS||g.type===l.VALUE&&g.previous.type===l.EQUALS)&&u.set_space_before_token(!1),g.type===l.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(u.traverse_whitespace(g),I=I||g.newlines!==0),this._is_wrap_attributes_force)){var U=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var C=!0,y=0,j;do{if(j=k.peek(y),j.type===l.ATTRIBUTE){C=!1;break}y+=1}while(y<4&&j.type!==l.EOF&&j.type!==l.TAG_CLOSE);U=!C}U&&(u.print_newline(!1),I=!0)}u.print_token(g),I=I||u.previous_token_wrapped(),b.has_wrapped_attrs=I}return F},w.prototype._handle_text=function(u,g,b){var k={text:g.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(u,g,b):b.is_unformatted||b.is_content_unformatted?u.add_raw_token(g):(u.traverse_whitespace(g),u.print_token(g)),k},w.prototype._print_custom_beatifier_text=function(u,g,b){var k=this;if(g.text!==""){var I=g.text,F,U=1,C="",y="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?F=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?F=this._css_beautify:b.custom_beautifier_name==="html"&&(F=function(de,me){var fe=new w(de,me,k._js_beautify,k._css_beautify);return fe.beautify()}),this._options.indent_scripts==="keep"?U=0:this._options.indent_scripts==="separate"&&(U=-u.indent_level);var j=u.get_full_indent(U);if(I=I.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&I[0]==="<"&&I.match(/^(<!--|<!\[CDATA\[)/)){var K=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(I);if(!K){u.add_raw_token(g);return}C=j+K[1]+`
`,I=K[4],K[5]&&(y=j+K[5]),I=I.replace(/\n[ \t]*$/,""),(K[2]||K[3].indexOf(`
`)!==-1)&&(K=K[3].match(/[ \t]+$/),K&&(g.whitespace_before=K[0]))}if(I)if(F){var Q=function(){this.eol=`
`};Q.prototype=this._options.raw_options;var te=new Q;I=F(j+I,te)}else{var _e=g.whitespace_before;_e&&(I=I.replace(new RegExp(`
(`+_e+")?","g"),`
`)),I=j+I.replace(/\n/g,`
`+j)}C&&(I?I=C+I+`
`+y:I=C+y),u.print_newline(!1),I&&(g.text=I,g.whitespace_before="",g.newlines=0,u.add_raw_token(g),u.print_newline(!0))}},w.prototype._handle_tag_open=function(u,g,b,k){var I=this._get_tag_open_token(g);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&g.type===l.TAG_OPEN&&g.text.indexOf("</")===0?(u.add_raw_token(g),I.start_tag_token=this._tag_stack.try_pop(I.tag_name)):(u.traverse_whitespace(g),this._set_tag_position(u,g,I,b,k),I.is_inline_element||u.set_wrap_point(),u.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(I.alignment_size=g.text.length+1),!I.tag_complete&&!I.is_unformatted&&(u.alignment_size=I.alignment_size),I};var E=function(u,g){if(this.parent=u||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="",!g)this.tag_complete=!0;else{var b;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(b=g.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.type===l.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||g.closed&&g.closed.text==="/>";var k=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(k=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(k)))}};w.prototype._get_tag_open_token=function(u){var g=new E(this._tag_stack.get_parser_token(),u);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||T(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&T(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&T(g.tag_check,this._options.content_unformatted),g.is_inline_element=T(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},w.prototype._set_tag_position=function(u,g,b,k,I){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||u.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=x(b.tag_check,g)))),T(b.tag_check,this._options.extra_liners)&&(u.print_newline(!1),u._output.just_added_blankline()||u.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 F=u.current_line_has_match(/{{#if/);F||u.print_newline(!1)}b.tag_name==="!--"&&I.type===l.TAG_CLOSE&&k.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||u.print_newline(!1),this._calcluate_parent_multiline(u,b))}else if(b.is_end_tag){var U=!1;U=b.start_tag_token&&b.start_tag_token.multiline_content,U=U||!b.is_inline_element&&!(k.is_inline_element||k.is_unformatted)&&!(I.type===l.TAG_CLOSE&&b.start_tag_token===k)&&I.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(U=!1),U&&u.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)&&(I.type!=="TK_CONTENT"||b.is_content_unformatted)&&u.print_newline(!1),this._calcluate_parent_multiline(u,b)},w.prototype._calcluate_parent_multiline=function(u,g){g.parent&&u._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var _=["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"];w.prototype._do_optional_end_element=function(u){var g=null;if(u.is_empty_element||!u.is_start_tag||!u.parent)return;if(u.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(u.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(u.tag_name==="dd"||u.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(u.parent.tag_name==="p"&&_.indexOf(u.tag_name)!==-1){var b=u.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else u.tag_name==="rp"||u.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):u.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):u.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):u.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):u.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):u.tag_name==="tbody"||u.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):u.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(u.tag_name==="th"||u.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return u.parent=this._tag_stack.get_parser_token(),g},v.exports.Beautifier=w},function(v,m,p){var d=p(6).Options;function s(h){d.call(this,h,"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,v.exports.Options=s},function(v,m,p){var d=p(9).Tokenizer,s=p(9).TOKEN,h=p(13).Directives,l=p(14).TemplatablePattern,i=p(12).Pattern,o={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 h(/<\!--/,/-->/),A=function(x,T){d.call(this,x,T),this._current_tag_name="";var O=new l(this._input).read_options(this._options),S=new i(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.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 w=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(w).until_after(w)}};A.prototype=new d,A.prototype._is_comment=function(x){return!1},A.prototype._is_opening=function(x){return x.type===o.TAG_OPEN},A.prototype._is_closing=function(x,T){return x.type===o.TAG_CLOSE&&T&&((x.text===">"||x.text==="/>")&&T.text[0]==="<"||x.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(x,T){var O=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(o.EOF,""):(O=O||this._read_open_handlebars(S,T),O=O||this._read_attribute(S,x,T),O=O||this._read_close(S,T),O=O||this._read_raw_content(S,x,T),O=O||this._read_content_word(S),O=O||this._read_comment_or_cdata(S),O=O||this._read_processing(S),O=O||this._read_open(S,T),O=O||this._create_token(o.UNKNOWN,this._input.next()),O)},A.prototype._read_comment_or_cdata=function(x){var T=null,O=null,S=null;if(x==="<"){var w=this._input.peek(1);w==="!"&&(O=this.__patterns.comment.read(),O?(S=f.get_directives(O),S&&S.ignore==="start"&&(O+=f.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(T=this._create_token(o.COMMENT,O),T.directives=S)}return T},A.prototype._read_processing=function(x){var T=null,O=null,S=null;if(x==="<"){var w=this._input.peek(1);(w==="!"||w==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(T=this._create_token(o.COMMENT,O),T.directives=S)}return T},A.prototype._read_open=function(x,T){var O=null,S=null;return T||x==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),S=this._create_token(o.TAG_OPEN,O)),S},A.prototype._read_open_handlebars=function(x,T){var O=null,S=null;return T||this._options.indent_handlebars&&x==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),S=this._create_token(o.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),S=this._create_token(o.TAG_OPEN,O))),S},A.prototype._read_close=function(x,T){var O=null,S=null;return T&&(T.text[0]==="<"&&(x===">"||x==="/"&&this._input.peek(1)===">")?(O=this._input.next(),x==="/"&&(O+=this._input.next()),S=this._create_token(o.TAG_CLOSE,O)):T.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(o.TAG_CLOSE,"}}"))),S},A.prototype._read_attribute=function(x,T,O){var S=null,w="";if(O&&O.text[0]==="<")if(x==="=")S=this._create_token(o.EQUALS,this._input.next());else if(x==='"'||x==="'"){var E=this._input.next();x==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),S=this._create_token(o.VALUE,E)}else w=this.__patterns.attribute.read(),w&&(T.type===o.EQUALS?S=this._create_token(o.VALUE,w):S=this._create_token(o.ATTRIBUTE,w));return S},A.prototype._is_content_unformatted=function(x){return this._options.void_elements.indexOf(x)===-1&&(this._options.content_unformatted.indexOf(x)!==-1||this._options.unformatted.indexOf(x)!==-1)},A.prototype._read_raw_content=function(x,T,O){var S="";if(O&&O.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(T.type===o.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var w=T.opened.text.substr(1).toLowerCase();if(w==="script"||w==="style"){var E=this._read_comment_or_cdata(x);if(E)return E.type=o.TEXT,E;S=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(w)&&(S=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(o.TEXT,S):null},A.prototype._read_content_word=function(x){var T="";if(this._options.unformatted_content_delimiter&&(x===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(o.TEXT,T)},v.exports.Tokenizer=A,v.exports.TOKEN=o}],B={};function P(v){var m=B[v];if(m!==void 0)return m.exports;var p=B[v]={exports:{}};return W[v](p,p.exports,P),p.exports}var R=P(18);D=R})();var G=D;if(!0)!(ne=[Z,Z("6UM0"),Z("TXwP")],V=function(W){var B=Z("6UM0"),P=Z("TXwP");return{html_beautify:function(R,v){return G(R,v,B.js_beautify,P.css_beautify)}}}.apply(We,ne),V!==void 0&&(ot.exports=V));else var N,M})()},"rAM+":function(ot,We,Z){"use strict";Z.d(We,"a",function(){return V});var ne=Z("Qw5x");function V(D,G){var N;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(N=Object(ne.a)(D))||G&&D&&typeof D.length=="number"){N&&(D=N);var M=0,W=function(){};return{s:W,n:function(){return M>=D.length?{done:!0}:{done:!1,value:D[M++]}},e:function(m){throw m},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B=!0,P=!1,R;return{s:function(){N=D[Symbol.iterator]()},n:function(){var m=N.next();return B=m.done,m},e:function(m){P=!0,R=m},f:function(){try{!B&&N.return!=null&&N.return()}finally{if(P)throw R}}}}},rUJ1:function(ot,We){const Z=/[&<>"']/,ne=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},N=S=>G[S];function M(S,w){if(w){if(Z.test(S))return S.replace(ne,N)}else if(V.test(S))return S.replace(D,N);return S}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(S){return S.replace(W,(w,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const P=/(^|[^\[])\^/g;function R(S,w){S=S.source||S,w=w||"";const E={replace:(_,c)=>(c=c.source||c,c=c.replace(P,"$1"),S=S.replace(_,c),E),getRegex:()=>new RegExp(S,w)};return E}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(S,w,E){if(S){let _;try{_=decodeURIComponent(B(E)).replace(v,"").toLowerCase()}catch(c){return null}if(_.indexOf("javascript:")===0||_.indexOf("vbscript:")===0||_.indexOf("data:")===0)return null}w&&!m.test(E)&&(E=i(w,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(_){return null}return E}const d={},s=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(S,w){d[" "+S]||(s.test(S)?d[" "+S]=S+"/":d[" "+S]=x(S,"/",!0)),S=d[" "+S];const E=S.indexOf(":")===-1;return w.substring(0,2)==="//"?E?w:S.replace(h,"$1")+w:w.charAt(0)==="/"?E?w:S.replace(l,"$1")+w:S+w}const o={exec:function(){}};function f(S){let w=1,E,_;for(;w<arguments.length;w++){E=arguments[w];for(_ in E)Object.prototype.hasOwnProperty.call(E,_)&&(S[_]=E[_])}return S}function A(S,w){const E=S.replace(/\|/g,(u,g,b)=>{let k=!1,I=g;for(;--I>=0&&b[I]==="\\";)k=!k;return k?"|":" |"}),_=E.split(/ \|/);let c=0;if(_.length>w)_.splice(w);else for(;_.length<w;)_.push("");for(;c<_.length;c++)_[c]=_[c].trim().replace(/\\\|/g,"|");return _}function x(S,w,E){const _=S.length;if(_===0)return"";let c=0;for(;c<_;){const u=S.charAt(_-c-1);if(u===w&&!E)c++;else if(u!==w&&E)c++;else break}return S.substr(0,_-c)}function T(S,w){if(S.indexOf(w[1])===-1)return-1;const E=S.length;let _=0,c=0;for(;c<E;c++)if(S[c]==="\\")c++;else if(S[c]===w[0])_++;else if(S[c]===w[1]&&(_--,_<0))return c;return-1}function O(S){S&&S.sanitize&&!S.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")}ot.exports={escape:M,unescape:B,edit:R,cleanUrl:p,resolveUrl:i,noopTest:o,merge:f,splitCells:A,rtrim:x,findClosingBracket:T,checkSanitizeDeprecation:O}},ulZh:function(ot,We,Z){typeof window!="undefined"&&function(V,D){ot.exports=D()}(this,function(){return function(ne){var V={};function D(G){if(V[G])return V[G].exports;var N=V[G]={i:G,l:!1,exports:{}};return ne[G].call(N.exports,N,N.exports,D),N.l=!0,N.exports}return D.m=ne,D.c=V,D.d=function(G,N,M){D.o(G,N)||Object.defineProperty(G,N,{enumerable:!0,get:M})},D.r=function(G){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},D.t=function(G,N){if(N&1&&(G=D(G)),N&8)return G;if(N&4&&typeof G=="object"&&G&&G.__esModule)return G;var M=Object.create(null);if(D.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:G}),N&2&&typeof G!="string")for(var W in G)D.d(M,W,function(B){return G[B]}.bind(null,W));return M},D.n=function(G){var N=G&&G.__esModule?function(){return G.default}:function(){return G};return D.d(N,"a",N),N},D.o=function(G,N){return Object.prototype.hasOwnProperty.call(G,N)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,V,D){"use strict";var G=Object.prototype.hasOwnProperty,N="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(N=!1));function W(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function B(v,m,p,d,s){if(typeof p!="function")throw new TypeError("The listener must be a function");var h=new W(p,d||v,s),l=N?N+m:m;return v._events[l]?v._events[l].fn?v._events[l]=[v._events[l],h]:v._events[l].push(h):(v._events[l]=h,v._eventsCount++),v}function P(v,m){--v._eventsCount===0?v._events=new M:delete v._events[m]}function R(){this._events=new M,this._eventsCount=0}R.prototype.eventNames=function(){var m=[],p,d;if(this._eventsCount===0)return m;for(d in p=this._events)G.call(p,d)&&m.push(N?d.slice(1):d);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},R.prototype.listeners=function(m){var p=N?N+m:m,d=this._events[p];if(!d)return[];if(d.fn)return[d.fn];for(var s=0,h=d.length,l=new Array(h);s<h;s++)l[s]=d[s].fn;return l},R.prototype.listenerCount=function(m){var p=N?N+m:m,d=this._events[p];return d?d.fn?1:d.length:0},R.prototype.emit=function(m,p,d,s,h,l){var i=N?N+m:m;if(!this._events[i])return!1;var o=this._events[i],f=arguments.length,A,x;if(o.fn){o.once&&this.removeListener(m,o.fn,void 0,!0);switch(f){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,p),!0;case 3:return o.fn.call(o.context,p,d),!0;case 4:return o.fn.call(o.context,p,d,s),!0;case 5:return o.fn.call(o.context,p,d,s,h),!0;case 6:return o.fn.call(o.context,p,d,s,h,l),!0}for(x=1,A=new Array(f-1);x<f;x++)A[x-1]=arguments[x];o.fn.apply(o.context,A)}else{var T=o.length,O;for(x=0;x<T;x++){o[x].once&&this.removeListener(m,o[x].fn,void 0,!0);switch(f){case 1:o[x].fn.call(o[x].context);break;case 2:o[x].fn.call(o[x].context,p);break;case 3:o[x].fn.call(o[x].context,p,d);break;case 4:o[x].fn.call(o[x].context,p,d,s);break;default:if(!A)for(O=1,A=new Array(f-1);O<f;O++)A[O-1]=arguments[O];o[x].fn.apply(o[x].context,A)}}}return!0},R.prototype.on=function(m,p,d){return B(this,m,p,d,!1)},R.prototype.once=function(m,p,d){return B(this,m,p,d,!0)},R.prototype.removeListener=function(m,p,d,s){var h=N?N+m:m;if(!this._events[h])return this;if(!p)return P(this,h),this;var l=this._events[h];if(l.fn)l.fn===p&&(!s||l.once)&&(!d||l.context===d)&&P(this,h);else{for(var i=0,o=[],f=l.length;i<f;i++)(l[i].fn!==p||s&&!l[i].once||d&&l[i].context!==d)&&o.push(l[i]);o.length?this._events[h]=o.length===1?o[0]:o:P(this,h)}return this},R.prototype.removeAllListeners=function(m){var p;return m?(p=N?N+m:m,this._events[p]&&P(this,p)):(this._events=new M,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=N,R.EventEmitter=R,ne.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,V,D){(function(G){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,P={buildAbsoluteURL:function(R,v,m){if(m=m||{},R=R.trim(),v=v.trim(),!v){if(!m.alwaysNormalize)return R;var p=P.parseURL(R);if(!p)throw new Error("Error trying to parse base URL.");return p.path=P.normalizePath(p.path),P.buildURLFromParts(p)}var d=P.parseURL(v);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return m.alwaysNormalize?(d.path=P.normalizePath(d.path),P.buildURLFromParts(d)):v;var s=P.parseURL(R);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var h=M.exec(s.path);s.netLoc=h[1],s.path=h[2]}s.netLoc&&!s.path&&(s.path="/");var l={scheme:s.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(l.netLoc=s.netLoc,d.path[0]!=="/"))if(!d.path)l.path=s.path,d.params||(l.params=s.params,d.query||(l.query=s.query));else{var i=s.path,o=i.substring(0,i.lastIndexOf("/")+1)+d.path;l.path=P.normalizePath(o)}return l.path===null&&(l.path=m.alwaysNormalize?P.normalizePath(d.path):d.path),P.buildURLFromParts(l)},parseURL:function(R){var v=N.exec(R);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(R){for(R=R.split("").reverse().join("").replace(W,"");R.length!==(R=R.replace(B,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};ne.exports=P})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,V,D){function G(m){var p={};function d(h){if(p[h])return p[h].exports;var l=p[h]={i:h,l:!1,exports:{}};return m[h].call(l.exports,l,l.exports,d),l.l=!0,l.exports}d.m=m,d.c=p,d.i=function(h){return h},d.d=function(h,l,i){d.o(h,l)||Object.defineProperty(h,l,{configurable:!1,enumerable:!0,get:i})},d.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},d.n=function(h){var l=h&&h.__esModule?function(){return h.default}:function(){return h};return d.d(l,"a",l),l},d.o=function(h,l){return Object.prototype.hasOwnProperty.call(h,l)},d.p="/",d.oe=function(h){throw console.error(h),h};var s=d(d.s=ENTRY_MODULE);return s.default||s}var N="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function W(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function B(m){return!isNaN(1*m)}function P(m,p,d){var s={};s[d]=[];var h=p.toString(),l=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return s;for(var i=l[1],o=new RegExp("(\\\\n|\\W)"+W(i)+M,"g"),f;f=o.exec(h);){if(f[3]==="dll-reference")continue;s[d].push(f[3])}for(o=new RegExp("\\("+W(i)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+M,"g");f=o.exec(h);)m[f[2]]||(s[d].push(f[1]),m[f[2]]=D(f[1]).m),s[f[2]]=s[f[2]]||[],s[f[2]].push(f[4]);for(var A=Object.keys(s),x=0;x<A.length;x++)for(var T=0;T<s[A[x]].length;T++)B(s[A[x]][T])&&(s[A[x]][T]=1*s[A[x]][T]);return s}function R(m){var p=Object.keys(m);return p.reduce(function(d,s){return d||m[s].length>0},!1)}function v(m,p){for(var d={main:[p]},s={main:[]},h={main:{}};R(d);)for(var l=Object.keys(d),i=0;i<l.length;i++){var o=l[i],f=d[o],A=f.pop();if(h[o]=h[o]||{},h[o][A]||!m[o][A])continue;h[o][A]=!0,s[o]=s[o]||[],s[o].push(A);for(var x=P(m,m[o][A],o),T=Object.keys(x),O=0;O<T.length;O++)d[T[O]]=d[T[O]]||[],d[T[O]]=d[T[O]].concat(x[T[O]])}return s}ne.exports=function(m,p){p=p||{};var d={main:D.m},s=p.all?{main:Object.keys(d.main)}:v(d,m),h="";Object.keys(s).filter(function(A){return A!=="main"}).forEach(function(A){for(var x=0;s[A][x];)x++;s[A].push(x),d[A][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+A+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+s[A].map(function(T){return""+JSON.stringify(T)+": "+d[A][T].toString()}).join(",")+`});
`}),h=h+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+s.main.map(function(A){return""+JSON.stringify(A)+": "+d.main[A].toString()}).join(",")+"}))(self);";var l=new window.Blob([h],{type:"text/javascript"});if(p.bare)return l;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,o=i.createObjectURL(l),f=new window.Worker(o);return f.objectURL=o,f}},"./src/config.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"hlsDefaultConfig",function(){return O}),D.d(V,"mergeConfig",function(){return w}),D.d(V,"enableStreamingMode",function(){return E});var G=D("./src/controller/abr-controller.ts"),N=D("./src/controller/audio-stream-controller.ts"),M=D("./src/controller/audio-track-controller.ts"),W=D("./src/controller/subtitle-stream-controller.ts"),B=D("./src/controller/subtitle-track-controller.ts"),P=D("./src/controller/buffer-controller.ts"),R=D("./src/controller/timeline-controller.ts"),v=D("./src/controller/cap-level-controller.ts"),m=D("./src/controller/fps-controller.ts"),p=D("./src/controller/eme-controller.ts"),d=D("./src/controller/cmcd-controller.ts"),s=D("./src/utils/xhr-loader.ts"),h=D("./src/utils/fetch-loader.ts"),l=D("./src/utils/cues.ts"),i=D("./src/utils/mediakeys-helper.ts"),o=D("./src/utils/logger.ts");function f(){return f=Object.assign||function(_){for(var c=1;c<arguments.length;c++){var u=arguments[c];for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(_[g]=u[g])}return _},f.apply(this,arguments)}function A(_,c){var u=Object.keys(_);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(_);c&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(_,b).enumerable})),u.push.apply(u,g)}return u}function x(_){for(var c=1;c<arguments.length;c++){var u=arguments[c]!=null?arguments[c]:{};c%2?A(Object(u),!0).forEach(function(g){T(_,g,u[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(u)):A(Object(u)).forEach(function(g){Object.defineProperty(_,g,Object.getOwnPropertyDescriptor(u,g))})}return _}function T(_,c,u){return c in _?Object.defineProperty(_,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):_[c]=u,_}var O=x(x({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:P.default,capLevelController:v.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},S()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:B.default,timelineController:R.TimelineController,audioStreamController:N.default,audioTrackController:M.default,emeController:p.default,cmcdController:d.default});function S(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function w(_,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({},_,c)}function E(_){var c=_.loader;if(c!==h.default&&c!==s.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),_.progressive=!1;else{var u=Object(h.fetchSupported)();u&&(_.loader=h.default,_.progressive=!0,_.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/polyfills/number.ts"),N=D("./src/utils/ewma-bandwidth-estimator.ts"),M=D("./src/events.ts"),W=D("./src/utils/buffer-helper.ts"),B=D("./src/errors.ts"),P=D("./src/types/loader.ts"),R=D("./src/utils/logger.ts");function v(d,s){for(var h=0;h<s.length;h++){var l=s[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(d,l.key,l)}}function m(d,s,h){return s&&v(d.prototype,s),h&&v(d,h),d}var p=function(){function d(h){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=h;var l=h.config;this.bwEstimator=new N.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var s=d.prototype;return s.registerListeners=function(){var l=this.hls;l.on(M.Events.FRAG_LOADING,this.onFragLoading,this),l.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(M.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var l=this.hls;l.off(M.Events.FRAG_LOADING,this.onFragLoading,this),l.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(M.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(l,i){var o=i.frag;if(o.type===P.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=o,this.partCurrent=(f=i.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(l,i){var o=this.hls.config;i.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var l=this.fragCurrent,i=this.partCurrent,o=this.hls,f=o.autoLevelEnabled,A=o.config,x=o.media;if(!l||!x)return;var T=i?i.stats:l.stats,O=i?i.duration:l.duration;if(T.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||x.paused||!x.playbackRate||!x.readyState)return;var S=performance.now()-T.loading.start,w=Math.abs(x.playbackRate);if(S<=500*O/w)return;var E=o.levels,_=o.minAutoLevel,c=E[l.level],u=T.total||Math.max(T.loaded,Math.round(O*c.maxBitrate/8)),g=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/S),b=(u-T.loaded)/g,k=x.currentTime,I=(W.BufferHelper.bufferInfo(x,k,A.maxBufferHole).end-k)/w;if(I>=2*O/w||b<=I)return;var F=Number.POSITIVE_INFINITY,U;for(U=l.level-1;U>_;U--){var C=E[U].maxBitrate;if(F=O*C/(8*.8*g),F<I)break}if(F>=b)return;var y=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+l.sn+(i?" part "+i.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+U+`
Current BW estimate: `+(Object(G.isFiniteNumber)(y)?(y/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+F.toFixed(3)+` s
Time to underbuffer: `+I.toFixed(3)+" s"),o.nextLoadLevel=U,this.bwEstimator.sample(S,T.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),o.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:i,stats:T})},s.onFragLoaded=function(l,i){var o=i.frag,f=i.part;if(o.type===P.PlaylistLevelType.MAIN&&Object(G.isFiniteNumber)(o.sn)){var A=f?f.stats:o.stats,x=f?f.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[o.level],O=(T.loaded?T.loaded.bytes:0)+A.loaded,S=(T.loaded?T.loaded.duration:0)+x;T.loaded={bytes:O,duration:S},T.realBitrate=Math.round(8*O/S)}if(o.bitrateTest){var w={stats:A,frag:o,part:f,id:o.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,w),o.bitrateTest=!1}}},s.onFragBuffered=function(l,i){var o=i.frag,f=i.part,A=f?f.stats:o.stats;if(A.aborted)return;if(o.type!==P.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var x=A.parsing.end-A.loading.start;this.bwEstimator.sample(x,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},s.onError=function(l,i){switch(i.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var l=this.fragCurrent,i=this.partCurrent,o=this.hls,f=o.maxAutoLevel,A=o.config,x=o.minAutoLevel,T=o.media,O=i?i.duration:l?l.duration:0,S=T?T.currentTime:0,w=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,_=(W.BufferHelper.bufferInfo(T,S,A.maxBufferHole).end-S)/w,c=this.findBestLevel(E,x,f,_,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(c>=0)return c;R.logger.trace((_?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var u=O?Math.min(O,A.maxStarvationDelay):A.maxStarvationDelay,g=A.abrBandWidthFactor,b=A.abrBandWidthUpFactor;if(!_){var k=this.bitrateTestDelay;if(k){var I=O?Math.min(O,A.maxLoadingDelay):A.maxLoadingDelay;u=I-k,R.logger.trace("bitrate test took "+Math.round(1e3*k)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*u)+" ms"),g=b=1}}return c=this.findBestLevel(E,x,f,_+u,g,b),Math.max(c,0)},s.findBestLevel=function(l,i,o,f,A,x){for(var T,O=this.fragCurrent,S=this.partCurrent,w=this.lastLoadedFragLevel,E=this.hls.levels,_=E[w],c=!!(_!=null&&(T=_.details)!==null&&T!==void 0&&T.live),u=_==null?void 0:_.codecSet,g=S?S.duration:O?O.duration:0,b=o;b>=i;b--){var k=E[b];if(!k||u&&k.codecSet!==u)continue;var I=k.details,F=(S?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||g,U=void 0;b<=w?U=A*l:U=x*l;var C=E[b].maxBitrate,y=C*F/U;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(U)+"/"+C+"/"+F+"/"+f+"/"+y),U>C&&(!y||c&&!this.bitrateTestDelay||y<f))return b}return-1},m(d,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,i=this.bwEstimator;if(l!==-1&&(!i||!i.canEstimate()))return l;var o=this.getNextABRAutoLevel();return l!==-1&&(o=Math.min(l,o)),o},set:function(l){this._nextAutoLevel=l}}]),d}();V.default=p},"./src/controller/audio-stream-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/polyfills/number.ts"),N=D("./src/controller/base-stream-controller.ts"),M=D("./src/events.ts"),W=D("./src/utils/buffer-helper.ts"),B=D("./src/controller/fragment-tracker.ts"),P=D("./src/types/level.ts"),R=D("./src/types/loader.ts"),v=D("./src/loader/fragment.ts"),m=D("./src/demux/chunk-cache.ts"),p=D("./src/demux/transmuxer-interface.ts"),d=D("./src/types/transmuxer.ts"),s=D("./src/controller/fragment-finders.ts"),h=D("./src/utils/discontinuities.ts"),l=D("./src/errors.ts"),i=D("./src/utils/logger.ts");function o(){return o=Object.assign||function(O){for(var S=1;S<arguments.length;S++){var w=arguments[S];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(O[E]=w[E])}return O},o.apply(this,arguments)}function f(O,S){O.prototype=Object.create(S.prototype),O.prototype.constructor=O,A(O,S)}function A(O,S){return A=Object.setPrototypeOf||function(E,_){return E.__proto__=_,E},A(O,S)}var x=100,T=function(O){f(S,O);function S(E,_){var c;return c=O.call(this,E,_,"[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 w=S.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var _=this.hls;_.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),_.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),_.on(M.Events.ERROR,this.onError,this),_.on(M.Events.BUFFER_RESET,this.onBufferReset,this),_.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),_.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var _=this.hls;_.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),_.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),_.off(M.Events.ERROR,this.onError,this),_.off(M.Events.BUFFER_RESET,this.onBufferReset,this),_.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),_.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onInitPtsFound=function(_,c){var u=c.frag,g=c.id,b=c.initPTS;if(g==="main"){var k=u.cc;this.initPTS[u.cc]=b,this.log("InitPTS for cc: "+k+" found from main: "+b),this.videoTrackCC=k,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},w.startLoad=function(_){if(!this.levels){this.startPosition=_,this.state=N.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,c>0&&_===-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=_,this.tick()},w.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var _,c=this.levels,u=this.trackId,g=c==null||((_=c[u])===null||_===void 0)?void 0:_.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var b,k=performance.now(),I=this.retryDate;(!I||k>=I||(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 F=this.waitingData;if(F){var U=F.frag,C=F.part,y=F.cache,j=F.complete;if(this.initPTS[U.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var K=y.flush(),Q={frag:U,part:C,payload:K,networkDetails:null};this._handleFragmentLoadProgress(Q),j&&O.prototype._handleFragmentLoadComplete.call(this,Q)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+U.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var te=this.getLoadPosition(),_e=W.BufferHelper.bufferInfo(this.mediaBuffer,te,this.config.maxBufferHole),de=Object(s.fragmentWithinToleranceTest)(_e.end,this.config.maxFragLookUpTolerance,U);de<0&&(i.logger.log("Waiting fragment cc ("+U.cc+") @ "+U.start+" cancelled because another fragment at "+_e.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},w.clearWaitingFragment=function(){var _=this.waitingData;_&&(this.fragmentTracker.removeFragment(_.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},w.onTickEnd=function(){var _=this.media;if(!_||!_.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:_,u=c.buffered;!this.loadedmetadata&&u.length&&(this.loadedmetadata=!0),this.lastCurrentTime=_.currentTime},w.doTickIdle=function(){var _,c,u=this.hls,g=this.levels,b=this.media,k=this.trackId,I=u.config;if(!g||!g[k])return;if(!b&&(this.startFragRequested||!I.startFragPrefetch))return;var F=g[k],U=F.details;if(!U||U.live&&this.levelLastLoaded!==k||this.waitForCdnTuneIn(U)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var C=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(C===null)return;var y=C.len,j=this.getMaxBufferLength(),K=this.audioSwitch;if(y>=j&&!K)return;if(!K&&this._streamEnded(C,U)){u.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var Q=U.fragments,te=Q[0].start,_e=C.end;if(K){var de=this.getLoadPosition();_e=de,U.PTSKnown&&de<te&&((C.end>te||C.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=te+.05))}var me=this.getNextFragment(_e,U);if(!me){this.bufferFlushed=!0;return}((_=me.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((c=me.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(me,U):this.loadFragment(me,U,_e)},w.getMaxBufferLength=function(){var _=O.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return c===null?_:Math.max(_,c.len)},w.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},w.onAudioTracksUpdated=function(_,c){var u=c.audioTracks;this.resetTransmuxer(),this.levels=u.map(function(g){return new P.Level(g)})},w.onAudioTrackSwitching=function(_,c){var u=!!c.url;this.trackId=c.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),u?this.setInterval(x):this.resetTransmuxer(),u?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},w.onLevelLoaded=function(_,c){this.mainDetails=c.details},w.onAudioTrackLoaded=function(_,c){var u,g=this.levels,b=c.details,k=c.id;if(!g){this.warn("Audio tracks were reset while loading level "+k);return}this.log("Track "+k+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var I=g[k],F=0;if(b.live||(u=I.details)!==null&&u!==void 0&&u.live){var U=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!U)return;!I.details&&b.hasProgramDateTime&&U.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(b,U),F=b.fragments[0].start):F=this.alignPlaylists(b,I.details)}I.details=b,this.levelLastLoaded=k,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(I.details,F),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=N.State.IDLE),this.tick()},w._handleFragmentLoadProgress=function(_){var c,u=_.frag,g=_.part,b=_.payload,k=this.config,I=this.trackId,F=this.levels;if(!F){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var U=F[I];console.assert(U,"Audio track is defined on fragment load progress");var C=U.details;console.assert(C,"Audio track details are defined on fragment load progress");var y=k.defaultAudioCodec||U.audioCodec||"mp4a.40.2",j=this.transmuxer;j||(j=this.transmuxer=new p.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var K=this.initPTS[u.cc],Q=(c=u.initSegment)===null||c===void 0?void 0:c.data;if(K!==void 0){var te=!1,_e=g?g.index:-1,de=_e!==-1,me=new d.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,b.byteLength,_e,de);j.push(b,Q,y,"",u,g,C.totalduration,te,me,K)}else{i.logger.log("Unknown video PTS for cc "+u.cc+", waiting for video PTS before demuxing audio frag "+u.sn+" of ["+C.startSN+" ,"+C.endSN+"],track "+I);var fe=this.waitingData=this.waitingData||{frag:u,part:g,cache:new m.default,complete:!1},pe=fe.cache;pe.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},w._handleFragmentLoadComplete=function(_){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,_)},w.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},w.onBufferCreated=function(_,c){var u=c.tracks.audio;u&&(this.mediaBuffer=u.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},w.onFragBuffered=function(_,c){var u=c.frag,g=c.part;if(u.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(g?" p: "+g.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}u.sn!=="initSegment"&&(this.fragPrevious=u,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(u,g)},w.onError=function(_,c){switch(c.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,c);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.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 l.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var u=!0,g=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);g&&g.len>.5&&(u=!this.reduceMaxBufferLength(g.len)),u&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},w.onBufferFlushed=function(_,c){var u=c.type;u===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},w._handleTransmuxComplete=function(_){var c,u="audio",g=this.hls,b=_.remuxResult,k=_.chunkMeta,I=this.getCurrentContext(k);if(!I){this.warn("The loading context changed while buffering fragment "+k.sn+" of level "+k.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(k.level);return}var F=I.frag,U=I.part,C=b.audio,y=b.text,j=b.id3,K=b.initSegment;if(this.fragContextChanged(F))return;if(this.state=N.State.PARSING,this.audioSwitch&&C&&this.completeAudioSwitch(),K!=null&&K.tracks&&(this._bufferInitSegment(K.tracks,F,k),g.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:u,tracks:K.tracks})),C){var Q=C.startPTS,te=C.endPTS,_e=C.startDTS,de=C.endDTS;U&&(U.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:Q,endPTS:te,startDTS:_e,endDTS:de}),F.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,Q,te,_e,de),this.bufferFragmentData(C,F,U,k)}if(j!=null&&(c=j.samples)!==null&&c!==void 0&&c.length){var me=o({frag:F,id:u},j);g.trigger(M.Events.FRAG_PARSING_METADATA,me)}if(y){var fe=o({frag:F,id:u},y);g.trigger(M.Events.FRAG_PARSING_USERDATA,fe)}},w._bufferInitSegment=function(_,c,u){if(this.state!==N.State.PARSING)return;_.video&&delete _.video;var g=_.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,_);var b=g.initSegment;if(b!=null&&b.byteLength){var k={type:"audio",frag:c,part:null,chunkMeta:u,parent:c.type,data:b};this.hls.trigger(M.Events.BUFFER_APPENDING,k)}this.tick()},w.loadFragment=function(_,c,u){var g=this.fragmentTracker.getState(_);this.fragCurrent=_,(this.audioSwitch||g===B.FragmentState.NOT_LOADED||g===B.FragmentState.PARTIAL)&&(_.sn==="initSegment"?this._loadInitSegment(_):c.live&&!Object(G.isFiniteNumber)(this.initPTS[_.cc])?(this.log("Waiting for video PTS in continuity counter "+_.cc+" of live stream before loading audio fragment "+_.sn+" of level "+this.trackId),this.state=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,_,c,u)))},w.completeAudioSwitch=function(){var _=this.hls,c=this.media,u=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,_.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:u})},S}(N.default);V.default=T},"./src/controller/audio-track-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/events.ts"),N=D("./src/errors.ts"),M=D("./src/controller/base-playlist-controller.ts"),W=D("./src/types/loader.ts");function B(p,d){for(var s=0;s<d.length;s++){var h=d[s];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(p,h.key,h)}}function P(p,d,s){return d&&B(p.prototype,d),s&&B(p,s),p}function R(p,d){p.prototype=Object.create(d.prototype),p.prototype.constructor=p,v(p,d)}function v(p,d){return v=Object.setPrototypeOf||function(h,l){return h.__proto__=l,h},v(p,d)}var m=function(p){R(d,p);function d(h){var l;return l=p.call(this,h,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var s=d.prototype;return s.registerListeners=function(){var l=this.hls;l.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(G.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var l=this.hls;l.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(G.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.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(l,i){this.tracks=i.audioTracks||[]},s.onAudioTrackLoaded=function(l,i){var o=i.id,f=i.details,A=this.tracksInGroup[o];if(!A){this.warn("Invalid audio track id "+o);return}var x=A.details;A.details=i.details,this.log("audioTrack "+o+" loaded ["+f.startSN+"-"+f.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,i,x))},s.onLevelLoading=function(l,i){this.switchLevel(i.level)},s.onLevelSwitching=function(l,i){this.switchLevel(i.level)},s.switchLevel=function(l){var i=this.hls.levels[l];if(!(i!=null&&i.audioGroupIds))return;var o=i.audioGroupIds[i.urlId];if(this.groupId!==o){this.groupId=o;var f=this.tracks.filter(function(x){return!o||x.groupId===o});this.selectDefaultTrack&&!f.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var A={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(G.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},s.onError=function(l,i){if(p.prototype.onError.call(this,l,i),i.fatal||!i.context)return;i.context.type===W.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},s.setAudioTrack=function(l){var i=this.tracksInGroup;if(l<0||l>=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=i[this.trackId];this.log("Now switching to audio-track index "+l);var f=i[l],A=f.id,x=f.groupId,T=x===void 0?"":x,O=f.name,S=f.type,w=f.url;if(this.trackId=l,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(G.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:T,name:O,type:S,url:w}),f.details&&!f.details.live)return;var E=this.switchParams(f.url,o==null?void 0:o.details);this.loadPlaylist(E)},s.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,o=this.findTrackId(i)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(l){for(var i=this.tracksInGroup,o=0;o<i.length;o++){var f=i[o];if((!this.selectDefaultTrack||f.default)&&(!l||l===f.name))return f.id}return-1},s.loadPlaylist=function(l){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var o=i.id,f=i.groupId,A=i.url;if(l)try{A=l.addDirectives(A)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(G.Events.AUDIO_TRACK_LOADING,{url:A,id:o,groupId:f,deliveryDirectives:l||null})}},P(d,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),d}(M.default);V.default=m},"./src/controller/base-playlist-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return P});var G=D("./src/polyfills/number.ts"),N=D("./src/types/level.ts"),M=D("./src/controller/level-helper.ts"),W=D("./src/utils/logger.ts"),B=D("./src/errors.ts"),P=function(){function R(m,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,p+":"),this.warn=W.logger.warn.bind(W.logger,p+":"),this.hls=m}var v=R.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,d){d.fatal&&d.type===B.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(p,d){var s=d==null?void 0:d.renditionReports;if(s)for(var h=0;h<s.length;h++){var l=s[h],i=""+l.URI;if(i===p.substr(-i.length)){var o=parseInt(l["LAST-MSN"]),f=parseInt(l["LAST-PART"]);if(d&&this.hls.config.lowLatencyMode){var A=Math.min(d.age-d.partTarget,d.targetduration);f!==void 0&&A>d.partTarget&&(f+=1)}if(Object(G.isFiniteNumber)(o))return new N.HlsUrlParameters(o,Object(G.isFiniteNumber)(f)?f:void 0,N.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,d,s){var h=this,l=d.details,i=d.stats,o=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(l.advancedDateTime=Date.now()-o,l.live||s!=null&&s.live){if(l.reloaded(s),s&&this.log("live playlist "+p+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),s&&l.fragments.length>0&&Object(M.mergeDetails)(s,l),!this.canLoad||!l.live)return;var f,A=void 0,x=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var T=this.hls.config.lowLatencyMode,O=l.lastPartSn,S=l.endSN,w=l.lastPartIndex,E=w!==-1,_=O===S,c=T?0:w;E?(A=_?S+1:O,x=_?c:w+1):A=S+1;var u=l.age,g=u+l.ageHeader,b=Math.min(g-l.partTarget,l.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: "+l.age),b=0;else{var k=Math.floor(b/l.targetduration);if(A+=k,x!==void 0){var I=Math.round(b%l.targetduration/l.partTarget);x+=I}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+u.toFixed(2)+"s goal: "+b+" skip sn "+k+" to part "+x)}l.tuneInGoal=b}if(f=this.getDeliveryDirectives(l,d.deliveryDirectives,A,x),T||!_){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(l,d.deliveryDirectives,A,x);var F=Object(M.computeReloadInterval)(l,i);A!==void 0&&l.canBlockReload&&(F-=l.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(F)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(f)},F)}else this.clearTimer()},v.getDeliveryDirectives=function(p,d,s,h){var l=Object(N.getSkipValue)(p,s);return d!=null&&d.skip&&p.deltaUpdateFailed&&(s=d.msn,h=d.part,l=N.HlsSkip.No),new N.HlsUrlParameters(s,h,l)},v.retryLoadingOrFail=function(p){var d=this,s=this.hls.config,h=this.retryCount<s.levelLoadingMaxRetry;if(h){var l;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(l=p.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return h},R}()},"./src/controller/base-stream-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"State",function(){return S}),D.d(V,"default",function(){return w});var G=D("./src/polyfills/number.ts"),N=D("./src/task-loop.ts"),M=D("./src/controller/fragment-tracker.ts"),W=D("./src/utils/buffer-helper.ts"),B=D("./src/utils/logger.ts"),P=D("./src/events.ts"),R=D("./src/errors.ts"),v=D("./src/types/transmuxer.ts"),m=D("./src/utils/mp4-tools.ts"),p=D("./src/utils/discontinuities.ts"),d=D("./src/controller/fragment-finders.ts"),s=D("./src/controller/level-helper.ts"),h=D("./src/loader/fragment-loader.ts"),l=D("./src/crypt/decrypter.ts"),i=D("./src/utils/time-ranges.ts"),o=D("./src/types/loader.ts");function f(E,_){for(var c=0;c<_.length;c++){var u=_[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}function A(E,_,c){return _&&f(E.prototype,_),c&&f(E,c),E}function x(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function T(E,_){E.prototype=Object.create(_.prototype),E.prototype.constructor=E,O(E,_)}function O(E,_){return O=Object.setPrototypeOf||function(u,g){return u.__proto__=g,u},O(E,_)}var S={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"},w=function(E){T(_,E);function _(u,g,b){var k;return k=E.call(this)||this,k.hls=void 0,k.fragPrevious=null,k.fragCurrent=null,k.fragmentTracker=void 0,k.transmuxer=null,k._state=S.STOPPED,k.media=void 0,k.mediaBuffer=void 0,k.config=void 0,k.bitrateTest=!1,k.lastCurrentTime=0,k.nextLoadPosition=0,k.startPosition=0,k.loadedmetadata=!1,k.fragLoadError=0,k.retryDate=0,k.levels=null,k.fragmentLoader=void 0,k.levelLastLoaded=null,k.startFragRequested=!1,k.decrypter=void 0,k.initPTS=[],k.onvseeking=null,k.onvended=null,k.logPrefix="",k.log=void 0,k.warn=void 0,k.logPrefix=b,k.log=B.logger.log.bind(B.logger,b+":"),k.warn=B.logger.warn.bind(B.logger,b+":"),k.hls=u,k.fragmentLoader=new h.default(u.config),k.fragmentTracker=g,k.config=u.config,k.decrypter=new l.default(u,u.config),u.on(P.Events.KEY_LOADED,k.onKeyLoaded,x(k)),k}var c=_.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(g){},c.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},c._streamEnded=function(g,b){var k=this.fragCurrent,I=this.fragmentTracker;if(!b.live&&k&&k.sn===b.endSN&&!g.nextStart){var F=I.getState(k);return F===M.FragmentState.PARTIAL||F===M.FragmentState.OK}return!1},c.onMediaAttached=function(g,b){var k=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),k.addEventListener("seeking",this.onvseeking),k.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(I.startPosition)},c.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.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 g=this.config,b=this.fragCurrent,k=this.media,I=this.mediaBuffer,F=this.state,U=k?k.currentTime:0,C=W.BufferHelper.bufferInfo(I||k,U,g.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(U)?U.toFixed(3):U)+", state: "+F),F===S.ENDED)this.resetLoadingState();else if(b&&!C.len){var y=g.maxFragLookUpTolerance,j=b.start-y,K=b.start+b.duration+y,Q=U>K;(U<j||Q)&&(Q&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}k&&(this.lastCurrentTime=U),!this.loadedmetadata&&!C.len&&(this.nextLoadPosition=this.startPosition=U),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(g,b){if(this.state!==S.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=S.IDLE;var k=this.levels[b.frag.level].details;k&&this.loadFragment(b.frag,k,b.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(P.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,E.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(g,b){this.log("Loading key for "+g.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=S.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(P.Events.KEY_LOADING,{frag:g})},c.loadFragment=function(g,b,k){this._loadFragForPlayback(g,b,k)},c._loadFragForPlayback=function(g,b,k){var I=this,F=function(C){if(I.fragContextChanged(g)){I.warn("Fragment "+g.sn+(C.part?" p: "+C.part.index:"")+" of level "+g.level+" was dropped during download."),I.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,I._handleFragmentLoadProgress(C)};this._doFragLoad(g,b,k,F).then(function(U){if(!U)return;I.fragLoadError=0;var C=I.state;if(I.fragContextChanged(g)){(C===S.FRAG_LOADING||C===S.BACKTRACKING||!I.fragCurrent&&C===S.PARSING)&&(I.fragmentTracker.removeFragment(g),I.state=S.IDLE);return}if("payload"in U&&(I.log("Loaded fragment "+g.sn+" of level "+g.level),I.hls.trigger(P.Events.FRAG_LOADED,U),I.state===S.BACKTRACKING)){I.fragmentTracker.backtrack(g,U),I.resetFragmentLoading(g);return}I._handleFragmentLoadComplete(U)}).catch(function(U){I.warn(U),I.resetFragmentLoading(g)})},c.flushMainBuffer=function(g,b,k){if(k===void 0&&(k=null),!(g-b))return;var I={startOffset:g,endOffset:b,type:k};this.fragLoadError=0,this.hls.trigger(P.Events.BUFFER_FLUSHING,I)},c._loadInitSegment=function(g){var b=this;this._doFragLoad(g).then(function(k){if(!k||b.fragContextChanged(g)||!b.levels)throw new Error("init load aborted");return k}).then(function(k){var I=b.hls,F=k.payload,U=g.decryptdata;if(F&&F.byteLength>0&&U&&U.key&&U.iv&&U.method==="AES-128"){var C=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(F),U.key.buffer,U.iv.buffer).then(function(y){var j=self.performance.now();return I.trigger(P.Events.FRAG_DECRYPTED,{frag:g,payload:y,stats:{tstart:C,tdecrypt:j}}),k.payload=y,k})}return k}).then(function(k){var I=b.fragCurrent,F=b.hls,U=b.levels;if(!U)throw new Error("init load aborted, missing levels");var C=U[g.level].details;console.assert(C,"Level details are defined when init segment is loaded");var y=g.stats;b.state=S.IDLE,b.fragLoadError=0,g.data=new Uint8Array(k.payload),y.parsing.start=y.buffering.start=self.performance.now(),y.parsing.end=y.buffering.end=self.performance.now(),k.frag===I&&F.trigger(P.Events.FRAG_BUFFERED,{stats:y,frag:I,part:null,id:g.type}),b.tick()}).catch(function(k){b.warn(k),b.resetFragmentLoading(g)})},c.fragContextChanged=function(g){var b=this.fragCurrent;return!g||!b||g.level!==b.level||g.sn!==b.sn||g.urlId!==b.urlId},c.fragBufferedComplete=function(g,b){var k=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+i.default.toString(W.BufferHelper.getBuffered(k))),this.state=S.IDLE,this.tick()},c._handleFragmentLoadComplete=function(g){var b=this.transmuxer;if(!b)return;var k=g.frag,I=g.part,F=g.partsLoaded,U=!F||F.length===0||F.some(function(y){return!y}),C=new v.ChunkMetadata(k.level,k.sn,k.stats.chunkCount+1,0,I?I.index:-1,!U);b.flush(C)},c._handleFragmentLoadProgress=function(g){},c._doFragLoad=function(g,b,k,I){var F=this;if(k===void 0&&(k=null),!this.levels)throw new Error("frag load aborted, missing levels");if(k=Math.max(g.start,k||0),this.config.lowLatencyMode&&b){var U=b.partList;if(U&&I){k>g.end&&b.fragmentHint&&(g=b.fragmentHint);var C=this.getNextPart(U,g,k);if(C>-1){var y=U[C];return this.log("Loading part sn: "+g.sn+" p: "+y.index+" cc: "+g.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+C+"-"+(U.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(k.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=S.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:g,part:U[C],targetBufferTime:k}),this.doFragPartsLoad(g,U,C,I).catch(function(j){return F.handleFragLoadError(j)})}else if(!g.url||this.loadedEndOfParts(U,k))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(k.toFixed(3))),Object(G.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=S.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:g,targetBufferTime:k}),this.fragmentLoader.load(g,I).catch(function(j){return F.handleFragLoadError(j)})},c.doFragPartsLoad=function(g,b,k,I){var F=this;return new Promise(function(U,C){var y=[],j=function K(Q){var te=b[Q];F.fragmentLoader.loadPart(g,te,I).then(function(_e){y[te.index]=_e;var de=_e.part;F.hls.trigger(P.Events.FRAG_LOADED,_e);var me=b[Q+1];if(me&&me.fragment===g)K(Q+1);else return U({frag:g,part:de,partsLoaded:y})}).catch(C)};j(k)})},c.handleFragLoadError=function(g){var b=g.data;return b&&b.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(P.Events.ERROR,b),null},c._handleTransmuxerFlush=function(g){var b=this.getCurrentContext(g);if(!b||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var k=b.frag,I=b.part,F=b.level,U=self.performance.now();k.stats.parsing.end=U,I&&(I.stats.parsing.end=U),this.updateLevelTiming(k,I,F,g.partial)},c.getCurrentContext=function(g){var b=this.levels,k=g.level,I=g.sn,F=g.part;if(!b||!b[k])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+k+". The current chunk will not be buffered."),null;var U=b[k],C=F>-1?Object(s.getPartWith)(U,I,F):null,y=C?C.fragment:Object(s.getFragmentWithSN)(U,I,this.fragCurrent);return y?{frag:y,part:C,level:U}:null},c.bufferFragmentData=function(g,b,k,I){if(!g||this.state!==S.PARSING)return;var F=g.data1,U=g.data2,C=F;if(F&&U&&(C=Object(m.appendUint8Array)(F,U)),!C||!C.length)return;var y={type:g.type,frag:b,part:k,chunkMeta:I,parent:b.type,data:C};this.hls.trigger(P.Events.BUFFER_APPENDING,y),g.dropped&&g.independent&&!k&&this.flushBufferGap(b)},c.flushBufferGap=function(g){var b=this.media;if(!b)return;if(!W.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,g.start);return}var k=b.currentTime,I=W.BufferHelper.bufferInfo(b,k,0),F=g.duration,U=Math.min(this.config.maxFragLookUpTolerance*2,F*.25),C=Math.max(Math.min(g.start-U,I.end-U),k+U);g.start-C>U&&this.flushMainBuffer(C,g.start)},c.getFwdBufferInfo=function(g,b){var k=this.config,I=this.getLoadPosition();if(!Object(G.isFiniteNumber)(I))return null;var F=W.BufferHelper.bufferInfo(g,I,k.maxBufferHole);if(F.len===0&&F.nextStart!==void 0){var U=this.fragmentTracker.getBufferedFrag(I,b);if(U&&F.nextStart<U.end)return W.BufferHelper.bufferInfo(g,I,Math.max(F.nextStart,k.maxBufferHole))}return F},c.getMaxBufferLength=function(g){var b=this.config,k;return g?k=Math.max(8*b.maxBufferSize/g,b.maxBufferLength):k=b.maxBufferLength,Math.min(k,b.maxMaxBufferLength)},c.reduceMaxBufferLength=function(g){var b=this.config,k=g||b.maxBufferLength;return b.maxMaxBufferLength>=k?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(g,b){var k,I,F=b.fragments,U=F.length;if(!U)return null;var C=this.config,y=F[0].start,j;if(b.live){var K=C.initialLiveManifestSize;if(U<K)return this.warn("Not enough fragments to start playback (have: "+U+", need: "+K+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(j=this.getInitialLiveFragment(b,F),this.startPosition=j?this.hls.liveSyncPosition||j.start:g)}else g<=y&&(j=F[0]);if(!j){var Q=C.lowLatencyMode?b.partEnd:b.fragmentEnd;j=this.getFragmentAtPosition(g,Q,b)}return(k=j)!==null&&k!==void 0&&k.initSegment&&!((I=j)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(j=j.initSegment),j},c.getNextPart=function(g,b,k){for(var I=-1,F=!1,U=!0,C=0,y=g.length;C<y;C++){var j=g[C];if(U=U&&!j.independent,I>-1&&k<j.start)break;var K=j.loaded;!K&&(F||j.independent||U)&&j.fragment===b&&(I=C),F=K}return I},c.loadedEndOfParts=function(g,b){var k=g[g.length-1];return k&&b>k.start&&k.loaded},c.getInitialLiveFragment=function(g,b){var k=this.fragPrevious,I=null;if(k){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+k.programDateTime),I=Object(d.findFragmentByPDT)(b,k.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var F=k.sn+1;if(F>=g.startSN&&F<=g.endSN){var U=b[F-g.startSN];k.cc===U.cc&&(I=U,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(d.findFragWithCC)(b,k.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var C=this.hls.liveSyncPosition;C!==null&&(I=this.getFragmentAtPosition(C,this.bitrateTest?g.fragmentEnd:g.edge,g))}return I},c.getFragmentAtPosition=function(g,b,k){var I=this.config,F=this.fragPrevious,U=k.fragments,C=k.endSN,y=k.fragmentHint,j=I.maxFragLookUpTolerance,K=!!(I.lowLatencyMode&&k.partList&&y);K&&y&&!this.bitrateTest&&(U=U.concat(y),C=y.sn);var Q;if(g<b){var te=g>b-j?0:j;Q=Object(d.findFragmentByPTS)(F,U,g,te)}else Q=U[U.length-1];if(Q){var _e=Q.sn-k.startSN,de=F&&Q.level===F.level,me=U[_e+1],fe=this.fragmentTracker.getState(Q);if(fe===M.FragmentState.BACKTRACKED){Q=null;for(var pe=_e;U[pe]&&this.fragmentTracker.getState(U[pe])===M.FragmentState.BACKTRACKED;)F?Q=U[pe--]:Q=U[--pe];Q||(Q=me)}else F&&Q.sn===F.sn&&!K&&(de&&(Q.sn<C&&this.fragmentTracker.getState(me)!==M.FragmentState.OK?(this.log("SN "+Q.sn+" just loaded, load next one: "+me.sn),Q=me):Q=null))}return Q},c.synchronizeToLiveEdge=function(g){var b=this.config,k=this.media;if(!k)return;var I=this.hls.liveSyncPosition,F=k.currentTime,U=g.fragments[0].start,C=g.edge,y=F>=U-b.maxFragLookUpTolerance&&F<=C;if(I!==null&&k.duration>I&&(F<I||!y)){var j=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*g.targetduration;(!y&&k.readyState<4||F<C-j)&&(this.loadedmetadata||(this.nextLoadPosition=I),k.readyState&&(this.warn("Playback: "+F.toFixed(3)+" is located too far from the end of live sliding playlist: "+C+", reset currentTime to : "+I.toFixed(3)),k.currentTime=I))}},c.alignPlaylists=function(g,b){var k=this.levels,I=this.levelLastLoaded,F=this.fragPrevious,U=I!==null?k[I]:null,C=g.fragments.length;if(!C)return this.warn("No fragments in live playlist"),0;var y=g.fragments[0].start,j=!b,K=g.alignedSliding&&Object(G.isFiniteNumber)(y);if(j||!K&&!y){Object(p.alignStream)(F,U,g);var Q=g.fragments[0].start;return this.log("Live playlist sliding: "+Q.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+g.startSN+" prev-sn: "+(F?F.sn:"na")+" fragments: "+C),Q}return y},c.waitForCdnTuneIn=function(g){var b=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*b)},c.setStartPosition=function(g,b){var k=this.startPosition;if(k<b&&(k=-1),k===-1||this.lastCurrentTime===-1){var I=g.startTimeOffset;Object(G.isFiniteNumber)(I)?(k=b+I,I<0&&(k+=g.totalduration),k=Math.min(Math.max(b,k),b+g.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+k),this.startPosition=k):g.live?k=this.hls.liveSyncPosition||b:this.startPosition=k=0,this.lastCurrentTime=k}this.nextLoadPosition=k},c.getLoadPosition=function(){var g=this.media,b=0;return this.loadedmetadata&&g?b=g.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},c.handleFragLoadAborted=function(g,b){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(b?" part"+b.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},c.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=S.IDLE)},c.onFragmentOrKeyLoadError=function(g,b){if(b.fatal)return;var k=b.frag;if(!k||k.type!==g)return;var I=this.fragCurrent;console.assert(I&&k.sn===I.sn&&k.level===I.level&&k.urlId===I.urlId,"Frag load error must match current frag to retry");var F=this.config;if(this.fragLoadError+1<=F.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(k.level))return;var U=Math.min(Math.pow(2,this.fragLoadError)*F.fragLoadingRetryDelay,F.fragLoadingMaxRetryTimeout);this.warn("Fragment "+k.sn+" of "+g+" "+k.level+" failed to load, retrying in "+U+"ms"),this.retryDate=self.performance.now()+U,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(g===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(B.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)},c.afterBufferFlushed=function(g,b,k){if(!g)return;var I=W.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(b,I,k),this.state===S.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},c.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[g].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(g,b,k,I){var F=this,U=k.details;console.assert(!!U,"level.details must be defined");var C=Object.keys(g.elementaryStreams).reduce(function(y,j){var K=g.elementaryStreams[j];if(K){var Q=K.endPTS-K.startPTS;if(Q<=0)return F.warn("Could not parse fragment "+g.sn+" "+j+" duration reliably ("+Q+") resetting transmuxer to fallback to playlist timing"),F.resetTransmuxer(),y||!1;var te=I?0:Object(s.updateFragPTSDTS)(U,g,K.startPTS,K.endPTS,K.startDTS,K.endDTS);return F.hls.trigger(P.Events.LEVEL_PTS_UPDATED,{details:U,level:k,drift:te,type:j,frag:g,start:K.startPTS,end:K.endPTS}),!0}return y},!1);C?(this.state=S.PARSED,this.hls.trigger(P.Events.FRAG_PARSED,{frag:g,part:b})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(_,[{key:"state",get:function(){return this._state},set:function(g){var b=this._state;b!==g&&(this._state=g,this.log(b+"->"+g))}}]),_}(N.default)},"./src/controller/buffer-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d});var G=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),M=D("./src/utils/logger.ts"),W=D("./src/errors.ts"),B=D("./src/utils/buffer-helper.ts"),P=D("./src/utils/mediasource-helper.ts"),R=D("./src/loader/fragment.ts"),v=D("./src/controller/buffer-operation-queue.ts"),m=Object(P.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function s(l){var i=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var o=i.hls,f=i.media,A=i.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),f&&(i.updateMediaElementDuration(),o.trigger(N.Events.MEDIA_ATTACHED,{media:f})),A&&A.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var h=s.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var i=this.hls;i.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(N.Events.BUFFER_RESET,this.onBufferReset,this),i.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(N.Events.BUFFER_EOS,this.onBufferEos,this),i.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(N.Events.FRAG_PARSED,this.onFragParsed,this),i.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var i=this.hls;i.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(N.Events.BUFFER_RESET,this.onBufferReset,this),i.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(N.Events.BUFFER_EOS,this.onBufferEos,this),i.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(N.Events.FRAG_PARSED,this.onFragParsed,this),i.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(i,o){var f=2;(o.audio&&!o.video||!o.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(i,o){var f=this.media=o.media;if(f&&m){var A=this.mediaSource=new m;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(A),this._objectUrl=f.src}},h.onMediaDetaching=function(){var i=this.media,o=this.mediaSource,f=this._objectUrl;if(o){if(M.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(A){M.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(f&&self.URL.revokeObjectURL(f),i.src===f?(i.removeAttribute("src"),i.load()):M.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)},h.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(o){var f=i.sourceBuffer[o];try{f&&(i.removeBufferListeners(o),i.mediaSource&&i.mediaSource.removeSourceBuffer(f),i.sourceBuffer[o]=void 0)}catch(A){M.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",A)}}),this._initSourceBuffer()},h.onBufferCodecs=function(i,o){var f=this,A=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(x){if(A){var T=f.tracks[x];if(T&&typeof T.buffer.changeType=="function"){var O=o[x],S=O.codec,w=O.levelCodec,E=O.container,_=(T.levelCodec||T.codec).replace(p,"$1"),c=(w||S).replace(p,"$1");if(_!==c){var u=E+";codecs="+(w||S);f.appendChangeType(x,u)}}}else f.pendingTracks[x]=o[x]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(i,o){var f=this,A=this.operationQueue,x={execute:function(){var O=f.sourceBuffer[i];O&&(M.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+o),O.changeType(o)),A.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(O){M.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",O)}};A.append(x,i)},h.onBufferAppending=function(i,o){var f=this,A=this.hls,x=this.operationQueue,T=this.tracks,O=o.data,S=o.type,w=o.frag,E=o.part,_=o.chunkMeta,c=_.buffering[S],u=self.performance.now();c.start=u;var g=w.stats.buffering,b=E?E.stats.buffering:null;g.start===0&&(g.start=u),b&&b.start===0&&(b.start=u);var k=T.audio,I=S==="audio"&&_.id===1&&(k==null?void 0:k.container)==="audio/mpeg",F={execute:function(){if(c.executeStart=self.performance.now(),I){var C=f.sourceBuffer[S];if(C){var y=w.start-C.timestampOffset;Math.abs(y)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+w.start+" (delta: "+y+") sn: "+w.sn+")"),C.timestampOffset=w.start)}}f.appendExecutor(O,S)},onStart:function(){},onComplete:function(){var C=self.performance.now();c.executeEnd=c.end=C,g.first===0&&(g.first=C),b&&b.first===0&&(b.first=C);var y=f.sourceBuffer,j={};for(var K in y)j[K]=B.BufferHelper.getBuffered(y[K]);f.appendError=0,f.hls.trigger(N.Events.BUFFER_APPENDED,{type:S,frag:w,part:E,chunkMeta:_,parent:w.type,timeRanges:j})},onError:function(C){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",C);var y={type:W.ErrorTypes.MEDIA_ERROR,parent:w.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:C,fatal:!1};C.code===DOMException.QUOTA_EXCEEDED_ERR?y.details=W.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,y.details=W.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>A.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),y.fatal=!0)),A.trigger(N.Events.ERROR,y)}};x.append(F,S)},h.onBufferFlushing=function(i,o){var f=this,A=this.operationQueue,x=function(O){return{execute:f.removeExecutor.bind(f,O,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(N.Events.BUFFER_FLUSHED,{type:O})},onError:function(w){M.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",w)}}};o.type?A.append(x(o.type),o.type):this.getSourceBufferTypes().forEach(function(T){A.append(x(T),T)})},h.onFragParsed=function(i,o){var f=this,A=o.frag,x=o.part,T=[],O=x?x.elementaryStreams:A.elementaryStreams;O[R.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(O[R.ElementaryStreamTypes.AUDIO]&&T.push("audio"),O[R.ElementaryStreamTypes.VIDEO]&&T.push("video"));var S=function(){var E=self.performance.now();A.stats.buffering.end=E,x&&(x.stats.buffering.end=E);var _=x?x.stats:A.stats;f.hls.trigger(N.Events.FRAG_BUFFERED,{frag:A,part:x,stats:_,id:A.type})};T.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(S,T)},h.onFragChanged=function(i,o){this.flushBackBuffer()},h.onBufferEos=function(i,o){var f=this,A=this.getSourceBufferTypes().reduce(function(x,T){var O=f.sourceBuffer[T];return(!o.type||o.type===T)&&(O&&!O.ended&&(O.ended=!0,M.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),x&&!!(!O||O.ended)},!0);A&&this.blockBuffers(function(){var x=f.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},h.onLevelUpdated=function(i,o){var f=o.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var i=this.hls,o=this.details,f=this.media,A=this.sourceBuffer;if(!f||o===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var T=o.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(G.isFiniteNumber)(T)||T<0)return;var O=f.currentTime,S=o.levelTargetDuration,w=Math.max(T,S),E=Math.floor(O/S)*S-w;x.forEach(function(_){var c=A[_];if(c){var u=B.BufferHelper.getBuffered(c);u.length>0&&E>u.start(0)&&(i.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),o.live&&i.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),i.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:_}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,o=this.hls,f=this.media,A=this.mediaSource,x=i.fragments[0].start+i.totalduration,T=f.duration,O=Object(G.isFiniteNumber)(A.duration)?A.duration:0;i.live&&o.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(i)):(x>O&&x>T||!Object(G.isFiniteNumber)(T))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),A.duration=x)},h.updateSeekableRange=function(i){var o=this.mediaSource,f=i.fragments,A=f.length;if(A&&i.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var x=Math.max(0,f[0].start),T=Math.max(x,x+i.totalduration);o.setLiveSeekableRange(x,T)}},h.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,o=this.operationQueue,f=this.pendingTracks,A=Object.keys(f).length;if(A&&!i||A===2){this.createSourceBuffers(f),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(N.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(T){o.executeNext(T)})}},h.createSourceBuffers=function(i){var o=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var x in i)if(!o[x]){var T=i[x];if(!T)throw Error("source buffer exists for track "+x+", however track does not");var O=T.levelCodec||T.codec,S=T.container+";codecs="+O;M.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var w=o[x]=f.addSourceBuffer(S),E=x;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[x]={buffer:w,codec:O,container:T.container,levelCodec:T.levelCodec,id:T.id},A++}catch(_){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+_.message),this.hls.trigger(N.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:_,mimeType:S})}}A&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(i){var o=this.operationQueue,f=o.current(i);f.onStart()},h._onSBUpdateEnd=function(i){var o=this.operationQueue,f=o.current(i);f.onComplete(),o.shiftAndExecuteNext(i)},h._onSBUpdateError=function(i,o){M.logger.error("[buffer-controller]: "+i+" SourceBuffer error",o),this.hls.trigger(N.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(i);f&&f.onError(o)},h.removeExecutor=function(i,o,f){var A=this.media,x=this.mediaSource,T=this.operationQueue,O=this.sourceBuffer,S=O[i];if(!A||!x||!S){M.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(i);return}var w=Object(G.isFiniteNumber)(A.duration)?A.duration:Infinity,E=Object(G.isFiniteNumber)(x.duration)?x.duration:Infinity,_=Math.max(0,o),c=Math.min(f,w,E);c>_?(M.logger.log("[buffer-controller]: Removing ["+_+","+c+"] from the "+i+" SourceBuffer"),console.assert(!S.updating,i+" sourceBuffer must not be updating"),S.remove(_,c)):T.shiftAndExecuteNext(i)},h.appendExecutor=function(i,o){var f=this.operationQueue,A=this.sourceBuffer,x=A[o];if(!x){M.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(o);return}x.ended=!1,console.assert(!x.updating,o+" sourceBuffer must not be updating"),x.appendBuffer(i)},h.blockBuffers=function(i,o){var f=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var A=this.operationQueue,x=o.map(function(T){return A.appendBlocker(T)});Promise.all(x).then(function(){i(),o.forEach(function(T){var O=f.sourceBuffer[T];(!O||!O.updating)&&A.shiftAndExecuteNext(T)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(i,o,f){var A=this.sourceBuffer[i];if(!A)return;var x=f.bind(this,i);this.listeners[i].push({event:o,listener:x}),A.addEventListener(o,x)},h.removeBufferListeners=function(i){var o=this.sourceBuffer[i];if(!o)return;this.listeners[i].forEach(function(f){o.removeEventListener(f.event,f.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return N});var G=D("./src/utils/logger.ts"),N=function(){function M(B){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=B}var W=M.prototype;return W.append=function(P,R){var v=this.queues[R];v.push(P),v.length===1&&this.buffers[R]&&this.executeNext(R)},W.insertAbort=function(P,R){var v=this.queues[R];v.unshift(P),this.executeNext(R)},W.appendBlocker=function(P){var R,v=new Promise(function(p){R=p}),m={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,P),v},W.executeNext=function(P){var R=this.buffers,v=this.queues,m=R[P],p=v[P];if(p.length){var d=p[0];try{d.execute()}catch(s){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(s),(!m||!m.updating)&&(p.shift(),this.executeNext(P))}}},W.shiftAndExecuteNext=function(P){this.queues[P].shift(),this.executeNext(P)},W.current=function(P){return this.queues[P][0]},M}()},"./src/controller/cap-level-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/events.ts");function N(B,P){for(var R=0;R<P.length;R++){var v=P[R];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(B,v.key,v)}}function M(B,P,R){return P&&N(B.prototype,P),R&&N(B,R),B}var W=function(){function B(R){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=R,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var P=B.prototype;return P.setStreamController=function(v){this.streamController=v},P.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},P.registerListeners=function(){var v=this.hls;v.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.unregisterListener=function(){var v=this.hls;v.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.onFpsDropLevelCapping=function(v,m){B.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},P.onMediaAttaching=function(v,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},P.onManifestParsed=function(v,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},P.onBufferCodecs=function(v,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},P.onMediaDetaching=function(){this.stopCapping()},P.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},P.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var d=p.filter(function(s,h){return B.isLevelAllowed(h,m.restrictedLevels)&&h<=v});return this.clientRect=null,B.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},P.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()},P.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},P.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},B.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},B.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var d=function(o,f){return f?o.width!==f.width||o.height!==f.height:!0},s=v.length-1,h=0;h<v.length;h+=1){var l=v[h];if((l.width>=m||l.height>=p)&&d(l,v[h+1])){s=h;break}}return s},M(B,[{key:"mediaWidth",get:function(){return this.getDimensions().width*B.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*B.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),B}();V.default=W},"./src/controller/cmcd-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d});var G=D("./src/events.ts"),N=D("./src/types/cmcd.ts"),M=D("./src/utils/buffer-helper.ts"),W=D("./src/utils/logger.ts");function B(s,h){for(var l=0;l<h.length;l++){var i=h[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,i.key,i)}}function P(s,h,l){return h&&B(s.prototype,h),l&&B(s,l),s}function R(s,h){var l=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(l)return(l=l.call(s)).next.bind(l);if(Array.isArray(s)||(l=v(s))||h&&s&&typeof s.length=="number"){l&&(s=l);var i=0;return function(){return i>=s.length?{done:!0}:{done:!1,value:s[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(s,h){if(!s)return;if(typeof s=="string")return m(s,h);var l=Object.prototype.toString.call(s).slice(8,-1);if(l==="Object"&&s.constructor&&(l=s.constructor.name),l==="Map"||l==="Set")return Array.from(s);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return m(s,h)}function m(s,h){(h==null||h>s.length)&&(h=s.length);for(var l=0,i=new Array(h);l<h;l++)i[l]=s[l];return i}function p(){return p=Object.assign||function(s){for(var h=1;h<arguments.length;h++){var l=arguments[h];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(s[i]=l[i])}return s},p.apply(this,arguments)}var d=function(){function s(l){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(A){try{i.apply(A,{ot:N.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(x){W.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(A){try{var x=A.frag,T=i.hls.levels[x.level],O=i.getObjectType(x),S={d:x.duration*1e3,ot:O};(O===N.CMCDObjectType.VIDEO||O===N.CMCDObjectType.AUDIO||O==N.CMCDObjectType.MUXED)&&(S.br=T.bitrate/1e3,S.tb=i.getTopBandwidth(O),S.bl=i.getBufferLength(O)),i.apply(A,S)}catch(w){W.logger.warn("Could not generate segment CMCD data.",w)}},this.hls=l;var o=this.config=l.config,f=o.cmcd;f!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||s.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var h=s.prototype;return h.registerListeners=function(){var i=this.hls;i.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var i=this.hls;i.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(i,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.onBufferCreated=function(i,o){var f,A;this.audioBuffer=(f=o.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(A=o.tracks.video)===null||A===void 0?void 0:A.buffer},h.createData=function(){var i;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(i=this.media)===null||i===void 0?void 0:i.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},h.apply=function(i,o){o===void 0&&(o={}),p(o,this.createData());var f=o.ot===N.CMCDObjectType.INIT||o.ot===N.CMCDObjectType.VIDEO||o.ot===N.CMCDObjectType.MUXED;if(this.starved&&f&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var A=s.toHeaders(o);if(!Object.keys(A).length)return;i.headers||(i.headers={}),p(i.headers,A)}else{var x=s.toQuery(o);if(!x)return;i.url=s.appendQueryToUri(i.url,x)}},h.getObjectType=function(i){var o=i.type;return o==="subtitle"?N.CMCDObjectType.TIMED_TEXT:i.sn==="initSegment"?N.CMCDObjectType.INIT:o==="audio"?N.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(i){for(var o=0,f=i===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=R(f),x;!(x=A()).done;){var T=x.value;T.bitrate>o&&(o=T.bitrate)}return o>0?o:NaN},h.getBufferLength=function(i){var o=this.hls.media,f=i===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!o)return NaN;var A=M.BufferHelper.bufferInfo(f,o.currentTime,this.config.maxBufferHole);return A.len*1e3},h.createPlaylistLoader=function(){var i=this.config.pLoader,o=this.applyPlaylistData,f=i||this.config.loader;return function(){function A(T){this.loader=void 0,this.loader=new f(T)}var x=A.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(O,S,w){o(O),this.loader.load(O,S,w)},P(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},h.createFragmentLoader=function(){var i=this.config.fLoader,o=this.applyFragmentData,f=i||this.config.loader;return function(){function A(T){this.loader=void 0,this.loader=new f(T)}var x=A.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(O,S,w){o(O),this.loader.load(O,S,w)},P(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},s.uuid=function(){var i=URL.createObjectURL(new Blob),o=i.toString();return URL.revokeObjectURL(i),o.substr(o.lastIndexOf("/")+1)},s.serialize=function(i){for(var o=[],f=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},A=function(I){return Math.round(I)},x=function(I){return A(I/100)*100},T=function(I){return encodeURIComponent(I)},O={br:A,d:A,bl:x,dl:x,mtp:x,nor:T,rtp:x,tb:A},S=Object.keys(i||{}).sort(),w=R(S),E;!(E=w()).done;){var _=E.value,c=i[_];if(!f(c))continue;if(_==="v"&&c===1)continue;if(_=="pr"&&c===1)continue;var u=O[_];u&&(c=u(c));var g=typeof c,b=void 0;_==="ot"||_==="sf"||_==="st"?b=_+"="+c:g==="boolean"?b=_:g==="number"?b=_+"="+c:b=_+"="+JSON.stringify(c),o.push(b)}return o.join(",")},s.toHeaders=function(i){for(var o=Object.keys(i),f={},A=["Object","Request","Session","Status"],x=[{},{},{},{}],T={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},O=0,S=o;O<S.length;O++){var w=S[O],E=T[w]!=null?T[w]:1;x[E][w]=i[w]}for(var _=0;_<x.length;_++){var c=s.serialize(x[_]);c&&(f["CMCD-"+A[_]]=c)}return f},s.toQuery=function(i){return"CMCD="+encodeURIComponent(s.serialize(i))},s.appendQueryToUri=function(i,o){if(!o)return i;var f=i.includes("?")?"&":"?";return""+i+f+o},s}()},"./src/controller/eme-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/events.ts"),N=D("./src/errors.ts"),M=D("./src/utils/logger.ts"),W=D("./src/utils/mediakeys-helper.ts");function B(d,s){for(var h=0;h<s.length;h++){var l=s[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(d,l.key,l)}}function P(d,s,h){return s&&B(d.prototype,s),h&&B(d,h),d}var R=3,v=function(s,h,l){var i={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(o){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:l.audioRobustness||""})}),h.forEach(function(o){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:l.videoRobustness||""})}),[i]},m=function(s,h,l,i){switch(s){case W.KeySystems.WIDEVINE:return v(h,l,i);default:throw new Error("Unknown key-system: "+s)}},p=function(){function d(h){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=h,this._config=h.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(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(l){switch(l){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},s._attemptKeySystemAccess=function(l,i,o){var f=this,A=m(l,i,o,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(l,A);this.mediaKeysPromise=x.then(function(T){return f._onMediaKeySystemAccessObtained(l,T)}),x.catch(function(T){M.logger.error('Failed to obtain key-system "'+l+'" access:',T)})},s._onMediaKeySystemAccessObtained=function(l,i){var o=this;M.logger.log('Access for key-system "'+l+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:i,mediaKeySystemDomain:l};this._mediaKeysList.push(f);var A=Promise.resolve().then(function(){return i.createMediaKeys()}).then(function(x){return f.mediaKeys=x,M.logger.log('Media-keys created for key-system "'+l+'"'),o._onMediaKeysCreated(),x});return A.catch(function(x){M.logger.error("Failed to create media-keys:",x)}),A},s._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(i){i.mediaKeysSession||(i.mediaKeysSession=i.mediaKeys.createSession(),l._onNewMediaKeySession(i.mediaKeysSession))})},s._onNewMediaKeySession=function(l){var i=this;M.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(o){i._onKeySessionMessage(l,o.message)},!1)},s._onKeySessionMessage=function(l,i){M.logger.log("Got EME message event, creating license request"),this._requestLicense(i,function(o){M.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),l.update(o)})},s.onMediaEncrypted=function(l){var i=this;if(M.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(A){if(!i._media)return;i._attemptSetMediaKeys(A),i._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(o).catch(o)},s._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var i=this._mediaKeysList[0];if(!i||!i.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(i.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(l,i){var o=this,f=this._mediaKeysList[0];if(!f){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(f.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var A=f.mediaKeysSession;if(!A){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!i){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+l+'" init data type'),f.mediaKeysSessionInitialized=!0,A.generateRequest(l,i).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(x){M.logger.error("Error generating key-session request:",x),o.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(l,i,o){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,l,i,o);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,f,l),A=void 0}catch(x){M.logger.error(x)}try{f.readyState||f.open("POST",l,!0),A&&A.call(this.hls,f,l)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return f},s._onLicenseRequestReadyStageChange=function(l,i,o,f){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var A=l.response,x=this._licenseResponseCallback;if(x)try{A=x.call(this.hls,l,i)}catch(O){M.logger.error(O)}f(A)}else{if(M.logger.error("License Request XHR failed ("+i+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=R-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(o,f)}break}},s._generateLicenseRequestChallenge=function(l,i){switch(l.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},s._requestLicense=function(l,i){M.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(o.mediaKeySystemDomain),A=this._createLicenseXhr(f,l,i);M.logger.log("Sending license request to URL: "+f);var x=this._generateLicenseRequestChallenge(o,l);A.send(x)}catch(T){M.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(l,i){if(!this._emeEnabled)return;var o=i.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var l=this._media,i=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(l,i){if(!this._emeEnabled)return;var o=i.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),f=i.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,o,f)},P(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();V.default=p},"./src/controller/fps-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/events.ts"),N=D("./src/utils/logger.ts"),M=function(){function W(P){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=P,this.registerListeners()}var B=W.prototype;return B.setStreamController=function(R){this.streamController=R},B.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},B.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching)},B.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},B.onMediaAttaching=function(R,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},B.checkFPS=function(R,v,m){var p=performance.now();if(v){if(this.lastTime){var d=p-this.lastTime,s=m-this.lastDroppedFrames,h=v-this.lastDecodedFrames,l=1e3*s/d,i=this.hls;if(i.trigger(G.Events.FPS_DROP,{currentDropped:s,currentDecoded:h,totalDroppedFrames:m}),l>0&&s>i.config.fpsDroppedMonitoringThreshold*h){var o=i.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=o)&&(o=o-1,i.trigger(G.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:i.currentLevel}),i.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},B.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var v=R.getVideoPlaybackQuality();this.checkFPS(R,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},W}();V.default=M},"./src/controller/fragment-finders.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"findFragmentByPDT",function(){return M}),D.d(V,"findFragmentByPTS",function(){return W}),D.d(V,"fragmentWithinToleranceTest",function(){return B}),D.d(V,"pdtWithinToleranceTest",function(){return P}),D.d(V,"findFragWithCC",function(){return R});var G=D("./src/polyfills/number.ts"),N=D("./src/utils/binary-search.ts");function M(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(G.isFiniteNumber)(m))return null;var d=v[0].programDateTime;if(m<(d||0))return null;var s=v[v.length-1].endProgramDateTime;if(m>=(s||0))return null;p=p||0;for(var h=0;h<v.length;++h){var l=v[h];if(P(m,p,l))return l}return null}function W(v,m,p,d){p===void 0&&(p=0),d===void 0&&(d=0);var s=null;if(v?s=m[v.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(s=m[0]),s&&B(p,d,s)===0)return s;var h=N.default.search(m,B.bind(null,p,d));return h||s}function B(v,m,p){v===void 0&&(v=0),m===void 0&&(m=0);var d=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-d<=v?1:p.start-d>v&&p.start?-1:0}function P(v,m,p){var d=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,s=p.endProgramDateTime||0;return s-d>v}function R(v,m){return N.default.search(v,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"FragmentState",function(){return M}),D.d(V,"FragmentTracker",function(){return W});var G=D("./src/events.ts"),N=D("./src/types/loader.ts"),M;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(M||(M={}));var W=function(){function R(m){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=m,this._registerListeners()}var v=R.prototype;return v._registerListeners=function(){var p=this.hls;p.on(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(G.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(G.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,d){if(d===N.PlaylistLevelType.MAIN){var s=this.activeFragment,h=this.activeParts;if(!s)return null;if(h)for(var l=h.length;l--;){var i=h[l],o=i?i.end:s.appendedPTS;if(i.start<=p&&o!==void 0&&p<=o)return l>9&&(this.activeParts=h.slice(l-9)),i}else if(s.start<=p&&s.appendedPTS!==void 0&&p<=s.appendedPTS)return s}return this.getBufferedFrag(p,d)},v.getBufferedFrag=function(p,d){for(var s=this.fragments,h=Object.keys(s),l=h.length;l--;){var i=s[h[l]];if((i==null?void 0:i.body.type)===d&&i.buffered){var o=i.body;if(o.start<=p&&p<=o.end)return o}}return null},v.detectEvictedFragments=function(p,d,s){var h=this;Object.keys(this.fragments).forEach(function(l){var i=h.fragments[l];if(!i)return;if(!i.buffered){i.body.type===s&&h.removeFragment(i.body);return}var o=i.range[p];if(!o)return;o.time.some(function(f){var A=!h.isTimeBuffered(f.startPTS,f.endPTS,d);return A&&h.removeFragment(i.body),A})})},v.detectPartialFragments=function(p){var d=this,s=this.timeRanges,h=p.frag,l=p.part;if(!s||h.sn==="initSegment")return;var i=P(h),o=this.fragments[i];if(!o)return;Object.keys(s).forEach(function(f){var A=h.elementaryStreams[f];if(!A)return;var x=s[f],T=l!==null||A.partial===!0;o.range[f]=d.getBufferedTimes(h,l,T,x)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},v.fragBuffered=function(p){var d=P(p),s=this.fragments[d];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},v.getBufferedTimes=function(p,d,s,h){for(var l={time:[],partial:s},i=d?d.start:p.start,o=d?d.end:p.end,f=p.minEndPTS||o,A=p.maxStartPTS||i,x=0;x<h.length;x++){var T=h.start(x)-this.bufferPadding,O=h.end(x)+this.bufferPadding;if(A>=T&&f<=O){l.time.push({startPTS:Math.max(i,h.start(x)),endPTS:Math.min(o,h.end(x))});break}else if(i<O&&o>T)l.partial=!0,l.time.push({startPTS:Math.max(i,h.start(x)),endPTS:Math.min(o,h.end(x))});else if(o<=T)break}return l},v.getPartialFragment=function(p){var d=null,s,h,l,i=0,o=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(A){var x=f[A];if(!x)return;B(x)&&(h=x.body.start-o,l=x.body.end+o,p>=h&&p<=l&&(s=Math.min(p-h,l-p),i<=s&&(d=x.body,i=s)))}),d},v.getState=function(p){var d=P(p),s=this.fragments[d];return s?s.buffered?B(s)?M.PARTIAL:M.OK:s.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},v.backtrack=function(p,d){var s=P(p),h=this.fragments[s];if(!h||h.backtrack)return null;var l=h.backtrack=d||h.loaded;return h.loaded=null,l},v.getBacktrackData=function(p){var d=P(p),s=this.fragments[d];if(s){var h,l=s.backtrack;if(l!=null&&(h=l.payload)!==null&&h!==void 0&&h.byteLength)return l;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,d,s){for(var h,l,i=0;i<s.length;i++){if(h=s.start(i)-this.bufferPadding,l=s.end(i)+this.bufferPadding,p>=h&&d<=l)return!0;if(d<=h)return!1}return!1},v.onFragLoaded=function(p,d){var s=d.frag,h=d.part;if(s.sn==="initSegment"||s.bitrateTest||h)return;var l=P(s);this.fragments[l]={body:s,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,d){var s=this,h=d.frag,l=d.part,i=d.timeRanges;if(h.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=h,l){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(l)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(f){var A=i[f];if(s.detectEvictedFragments(f,A),!l)for(var x=0;x<A.length;x++)h.appendedPTS=Math.max(A.end(x),h.appendedPTS||0)})},v.onFragBuffered=function(p,d){this.detectPartialFragments(d)},v.hasFragment=function(p){var d=P(p);return!!this.fragments[d]},v.removeFragmentsInRange=function(p,d,s){var h=this;Object.keys(this.fragments).forEach(function(l){var i=h.fragments[l];if(!i)return;if(i.buffered){var o=i.body;o.type===s&&o.start<d&&o.end>p&&h.removeFragment(o)}})},v.removeFragment=function(p){var d=P(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[d]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function B(R){var v,m;return R.buffered&&(((v=R.range.video)===null||v===void 0?void 0:v.partial)||((m=R.range.audio)===null||m===void 0?void 0:m.partial))}function P(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"STALL_MINIMUM_DURATION_MS",function(){return B}),D.d(V,"MAX_START_GAP_JUMP",function(){return P}),D.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),D.d(V,"SKIP_BUFFER_RANGE_START",function(){return v}),D.d(V,"default",function(){return m});var G=D("./src/utils/buffer-helper.ts"),N=D("./src/errors.ts"),M=D("./src/events.ts"),W=D("./src/utils/logger.ts"),B=250,P=2,R=.1,v=.05,m=function(){function p(s,h,l,i){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=h,this.fragmentTracker=l,this.hls=i}var d=p.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(h){var l=this.config,i=this.media,o=this.stalled,f=i.currentTime,A=i.seeking,x=this.seeking&&!A,T=!this.seeking&&A;if(this.seeking=A,f!==h){if(this.moved=!0,o!==null){if(this.stallReported){var O=self.performance.now()-o;W.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||x)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!G.BufferHelper.getBuffered(i).length)return;var S=G.BufferHelper.bufferInfo(i,f,0),w=S.len>0,E=S.nextStart||0;if(!w&&!E)return;if(A){var _=S.len>P,c=!E||E-f>P&&!this.fragmentTracker.getPartialFragment(f);if(_||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var u,g=Math.max(E,S.start||0)-f,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,k=b==null||((u=b.details)===null||u===void 0)?void 0:u.live,I=k?b.details.targetduration*2:P;if(g>0&&g<=I){this._trySkipBufferHole(null);return}}var F=self.performance.now();if(o===null){this.stalled=F;return}var U=F-o;!A&&U>=B&&this._reportStall(S.len);var C=G.BufferHelper.bufferInfo(i,f,l.maxBufferHole);this._tryFixBufferStall(C,U)},d._tryFixBufferStall=function(h,l){var i=this.config,o=this.fragmentTracker,f=this.media,A=f.currentTime,x=o.getPartialFragment(A);if(x){var T=this._trySkipBufferHole(x);if(T)return}h.len>i.maxBufferHole&&l>i.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(h){var l=this.hls,i=this.media,o=this.stallReported;o||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+h+")"),l.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},d._trySkipBufferHole=function(h){for(var l=this.config,i=this.hls,o=this.media,f=o.currentTime,A=0,x=G.BufferHelper.getBuffered(o),T=0;T<x.length;T++){var O=x.start(T);if(f+l.maxBufferHole>=A&&f<O){var S=Math.max(O+v,o.currentTime+R);return W.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+S),this.moved=!0,this.stalled=null,o.currentTime=S,h&&i.trigger(M.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 "+S,frag:h}),S}A=x.end(T)}return 0},d._tryNudgeBuffer=function(){var h=this.config,l=this.hls,i=this.media,o=i.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<h.nudgeMaxRetry){var A=o+f*h.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+o+" to "+A),i.currentTime=A,l.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+h.nudgeMaxRetry+" nudges"),l.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/events.ts"),N=D("./src/utils/texttrack-utils.ts"),M=D("./src/demux/id3.ts"),W=.25,B=function(){function P(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var R=P.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var m=this.hls;m.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var m=this.hls;m.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(m,p){this.media=p.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},R.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var d=m[p];if(d.kind==="metadata"&&d.label==="id3")return Object(N.sendAddTrackEvent)(d,this.media),d}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(m,p){if(!this.media)return;var d=p.frag,s=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<s.length;l++){var i=M.getID3Frames(s[l].data);if(i){var o=s[l].pts,f=l<s.length-1?s[l+1].pts:d.end,A=f-o;A<=0&&(f=o+W);for(var x=0;x<i.length;x++){var T=i[x];if(!M.isTimeStampFrame(T)){var O=new h(o,f,"");O.value=T,this.id3Track.addCue(O)}}}}},R.onBufferFlushing=function(m,p){var d=p.startOffset,s=p.endOffset,h=p.type;if(!h||h==="audio"){var l=this.id3Track;l&&Object(N.removeCuesInRange)(l,d,s)}},P}();V.default=B},"./src/controller/latency-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return P});var G=D("./src/errors.ts"),N=D("./src/events.ts"),M=D("./src/utils/logger.ts");function W(R,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function B(R,v,m){return v&&W(R.prototype,v),m&&W(R,m),R}var P=function(){function R(m){var p=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 p.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var v=R.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.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)},v.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)},v.onMediaAttached=function(p,d){this.media=d.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(p,d){var s=d.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,d){if(d.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,d=this.levelDetails;if(!p||!d)return;this.currentTime=p.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var h=this.config,l=h.lowLatencyMode,i=h.maxLiveSyncPlaybackRate;if(!l||i===1)return;var o=this.targetLatency;if(o===null)return;var f=s-o,A=Math.min(this.maxLatency,o+d.targetduration),x=f<A;if(d.live&&x&&f>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,i)),O=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;p.playbackRate=Math.min(T,Math.max(1,O))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},B(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,d=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:d?p.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var d=p.holdBack,s=p.partHoldBack,h=p.targetduration,l=this.config,i=l.liveSyncDuration,o=l.liveSyncDurationCount,f=l.lowLatencyMode,A=this.hls.userConfig,x=f&&s||d;(A.liveSyncDuration||A.liveSyncDurationCount||x===0)&&(x=i!==void 0?i:o*h);var T=h,O=1;return x+Math.min(this.stallCount*O,T)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),d=this.targetLatency,s=this.levelDetails;if(p===null||d===null||s===null)return null;var h=s.edge,l=p-d-this.edgeStalled,i=h-s.totalduration,o=h-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(i,l),o)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var d=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-d,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,d=this.levelDetails;if(!p||!d)return 0;var s=p.buffered.length;return s?p.buffered.end(s-1):d.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return l});var G=D("./src/types/level.ts"),N=D("./src/events.ts"),M=D("./src/errors.ts"),W=D("./src/utils/codecs.ts"),B=D("./src/controller/level-helper.ts"),P=D("./src/controller/base-playlist-controller.ts"),R=D("./src/types/loader.ts");function v(){return v=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var f=arguments[o];for(var A in f)Object.prototype.hasOwnProperty.call(f,A)&&(i[A]=f[A])}return i},v.apply(this,arguments)}function m(i,o){for(var f=0;f<o.length;f++){var A=o[f];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(i,A.key,A)}}function p(i,o,f){return o&&m(i.prototype,o),f&&m(i,f),i}function d(i,o){i.prototype=Object.create(o.prototype),i.prototype.constructor=i,s(i,o)}function s(i,o){return s=Object.setPrototypeOf||function(A,x){return A.__proto__=x,A},s(i,o)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(i){d(o,i);function o(A){var x;return x=i.call(this,A,"[level-controller]")||this,x._levels=[],x._firstLevel=-1,x._startLevel=void 0,x.currentLevelIndex=-1,x.manualLevelIndex=-1,x.onParsedComplete=void 0,x._registerListeners(),x}var f=o.prototype;return f._registerListeners=function(){var x=this.hls;x.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),x.on(N.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var x=this.hls;x.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(N.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,i.prototype.destroy.call(this)},f.startLoad=function(){var x=this._levels;x.forEach(function(T){T.loadError=0}),i.prototype.startLoad.call(this)},f.onManifestLoaded=function(x,T){var O=[],S=[],w=[],E,_={},c,u=!1,g=!1,b=!1;if(T.levels.forEach(function(U){var C=U.attrs;u=u||!!(U.width&&U.height),g=g||!!U.videoCodec,b=b||!!U.audioCodec,h&&U.audioCodec&&U.audioCodec.indexOf("mp4a.40.34")!==-1&&(U.audioCodec=void 0);var y=U.bitrate+"-"+U.attrs.RESOLUTION+"-"+U.attrs.CODECS;c=_[y],c?c.url.push(U.url):(c=new G.Level(U),_[y]=c,O.push(c)),C&&(C.AUDIO&&Object(B.addGroupId)(c,"audio",C.AUDIO),C.SUBTITLES&&Object(B.addGroupId)(c,"text",C.SUBTITLES))}),(u||g)&&b&&(O=O.filter(function(U){var C=U.videoCodec,y=U.width,j=U.height;return!!C||!!(y&&j)})),O=O.filter(function(U){var C=U.audioCodec,y=U.videoCodec;return(!C||Object(W.isCodecSupportedInMp4)(C,"audio"))&&(!y||Object(W.isCodecSupportedInMp4)(y,"video"))}),T.audioTracks&&(S=T.audioTracks.filter(function(U){return!U.audioCodec||Object(W.isCodecSupportedInMp4)(U.audioCodec,"audio")}),Object(B.assignTrackIdsByGroup)(S)),T.subtitles&&(w=T.subtitles,Object(B.assignTrackIdsByGroup)(w)),O.length>0){E=O[0].bitrate,O.sort(function(U,C){return U.bitrate-C.bitrate}),this._levels=O;for(var k=0;k<O.length;k++)if(O[k].bitrate===E){this._firstLevel=k,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+E);break}var I=b&&!g,F={levels:O,audioTracks:S,subtitleTracks:w,firstLevel:this._firstLevel,stats:T.stats,audio:b,video:g,altAudio:!I&&S.some(function(U){return!!U.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,F),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(x,T){if(i.prototype.onError.call(this,x,T),T.fatal)return;var O=T.context,S=this._levels[this.currentLevelIndex];if(O&&(O.type===R.PlaylistContextType.AUDIO_TRACK&&S.audioGroupIds&&O.groupId===S.audioGroupIds[S.urlId]||O.type===R.PlaylistContextType.SUBTITLE_TRACK&&S.textGroupIds&&O.groupId===S.textGroupIds[S.urlId])){this.redundantFailover(this.currentLevelIndex);return}var w=!1,E=!0,_;switch(T.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var c=this._levels[T.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(_=T.frag.level)):_=T.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(E=!1),_=O.level),w=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:_=T.level,w=!0;break}_!==void 0&&this.recoverLevel(T,_,w,E)},f.recoverLevel=function(x,T,O,S){var w=x.details,E=this._levels[T];if(E.loadError++,O){var _=this.retryLoadingOrFail(x);if(_)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var c=E.url.length;if(c>1&&E.loadError<c)x.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var u=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==u&&this._levels[u].loadError===0&&(this.warn(w+": switch to "+u),x.levelRetry=!0,this.hls.nextAutoLevel=u)}}},f.redundantFailover=function(x){var T=this._levels[x],O=T.url.length;if(O>1){var S=(T.urlId+1)%O;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(w){w.urlId=S}),this.level=x}},f.onFragLoaded=function(x,T){var O=T.frag;if(O!==void 0&&O.type===R.PlaylistLevelType.MAIN){var S=this._levels[O.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},f.onLevelLoaded=function(x,T){var O,S=T.level,w=T.details,E=this._levels[S];if(!E){var _;this.warn("Invalid level index "+S),(_=T.deliveryDirectives)!==null&&_!==void 0&&_.skip&&(w.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(S,T,E.details)):(O=T.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(w.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(x,T){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var S=-1,w=this.hls.audioTracks[T.id].groupId,E=0;E<O.audioGroupIds.length;E++)if(O.audioGroupIds[E]===w){S=E;break}S!==O.urlId&&(O.urlId=S,this.startLoad())}},f.loadPlaylist=function(x){var T=this.currentLevelIndex,O=this._levels[T];if(this.canLoad&&O&&O.url.length>0){var S=O.urlId,w=O.url[S];if(x)try{w=x.addDirectives(w)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+T+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+S+" "+w),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:w,level:T,id:S,deliveryDirectives:x||null})}},f.removeLevel=function(x,T){var O=function(E,_){return _!==T},S=this._levels.filter(function(w,E){return E!==x?!0:w.url.length>1&&T!==void 0?(w.url=w.url.filter(O),w.audioGroupIds&&(w.audioGroupIds=w.audioGroupIds.filter(O)),w.textGroupIds&&(w.textGroupIds=w.textGroupIds.filter(O)),w.urlId=0,!0):!1}).map(function(w,E){var _=w.details;return _!=null&&_.fragments&&_.fragments.forEach(function(c){c.level=E}),w});this._levels=S,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:S})},p(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var T,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===x&&(T=O[x])!==null&&T!==void 0&&T.details)return;if(x<0||x>=O.length){var S=x<0;if(this.hls.trigger(N.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:S,reason:"invalid level idx"}),S)return;x=Math.min(x,O.length-1)}this.clearTimer();var w=this.currentLevelIndex,E=O[w],_=O[x];this.log("switching to level "+x+" from "+w),this.currentLevelIndex=x;var c=v({},_,{level:x,maxBitrate:_.maxBitrate,uri:_.uri,urlId:_.urlId});delete c._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,c);var u=_.details;if(!u||u.live){var g=this.switchParams(_.uri,E==null?void 0:E.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),o}(P.default)},"./src/controller/level-helper.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"addGroupId",function(){return M}),D.d(V,"assignTrackIdsByGroup",function(){return W}),D.d(V,"updatePTS",function(){return B}),D.d(V,"updateFragPTSDTS",function(){return R}),D.d(V,"mergeDetails",function(){return v}),D.d(V,"mapPartIntersection",function(){return m}),D.d(V,"mapFragmentIntersection",function(){return p}),D.d(V,"adjustSliding",function(){return d}),D.d(V,"addSliding",function(){return s}),D.d(V,"computeReloadInterval",function(){return h}),D.d(V,"getFragmentWithSN",function(){return l}),D.d(V,"getPartWith",function(){return i});var G=D("./src/polyfills/number.ts"),N=D("./src/utils/logger.ts");function M(o,f,A){switch(f){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(A);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(A);break}}function W(o){var f={};o.forEach(function(A){var x=A.groupId||"";A.id=f[x]=f[x]||0,f[x]++})}function B(o,f,A){var x=o[f],T=o[A];P(x,T)}function P(o,f){var A=f.startPTS;if(Object(G.isFiniteNumber)(A)){var x=0,T;f.sn>o.sn?(x=A-o.start,T=o):(x=o.start-A,T=f),T.duration!==x&&(T.duration=x)}else if(f.sn>o.sn){var O=o.cc===f.cc;O&&o.minEndPTS?f.start=o.start+(o.minEndPTS-o.start):f.start=o.start+o.duration}else f.start=Math.max(o.start-f.duration,0)}function R(o,f,A,x,T,O){var S=x-A;S<=0&&(N.logger.warn("Fragment should have a positive duration",f),x=A+f.duration,O=T+f.duration);var w=A,E=x,_=f.startPTS,c=f.endPTS;if(Object(G.isFiniteNumber)(_)){var u=Math.abs(_-A);Object(G.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(u,f.deltaPTS):f.deltaPTS=u,w=Math.max(A,_),A=Math.min(A,_),T=Math.min(T,f.startDTS),E=Math.min(x,c),x=Math.max(x,c),O=Math.max(O,f.endDTS)}f.duration=x-A;var g=A-f.start;f.appendedPTS=x,f.start=f.startPTS=A,f.maxStartPTS=w,f.startDTS=T,f.endPTS=x,f.minEndPTS=E,f.endDTS=O;var b=f.sn;if(!o||b<o.startSN||b>o.endSN)return 0;var k,I=b-o.startSN,F=o.fragments;for(F[I]=f,k=I;k>0;k--)P(F[k],F[k-1]);for(k=I;k<F.length-1;k++)P(F[k],F[k+1]);return o.fragmentHint&&P(F[F.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,g}function v(o,f){for(var A=null,x=o.fragments,T=x.length-1;T>=0;T--){var O=x[T].initSegment;if(O){A=O;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var S=0,w;if(p(o,f,function(k,I){k.relurl&&(S=k.cc-I.cc),Object(G.isFiniteNumber)(k.startPTS)&&Object(G.isFiniteNumber)(k.endPTS)&&(I.start=I.startPTS=k.startPTS,I.startDTS=k.startDTS,I.appendedPTS=k.appendedPTS,I.maxStartPTS=k.maxStartPTS,I.endPTS=k.endPTS,I.endDTS=k.endDTS,I.minEndPTS=k.minEndPTS,I.duration=k.endPTS-k.startPTS,I.duration&&(w=I),f.PTSKnown=f.alignedSliding=!0),I.elementaryStreams=k.elementaryStreams,I.loader=k.loader,I.stats=k.stats,I.urlId=k.urlId,k.initSegment&&(I.initSegment=k.initSegment,A=k.initSegment)}),A){var E=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;E.forEach(function(k){var I;(!k.initSegment||k.initSegment.relurl===((I=A)===null||I===void 0?void 0:I.relurl))&&(k.initSegment=A)})}if(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(k){return!k}),f.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var _=f.skippedSegments;_--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var c=f.fragments;if(S){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var u=0;u<c.length;u++)c[u].cc+=S}f.skippedSegments&&(f.startCC=f.fragments[0].cc),m(o.partList,f.partList,function(k,I){I.elementaryStreams=k.elementaryStreams,I.stats=k.stats}),w?R(f,w,w.startPTS,w.endPTS,w.startDTS,w.endDTS):d(o,f),c.length&&(f.totalduration=f.edge-c[0].start),f.driftStartTime=o.driftStartTime,f.driftStart=o.driftStart;var g=f.advancedDateTime;if(f.advanced&&g){var b=f.edge;f.driftStart||(f.driftStartTime=g,f.driftStart=b),f.driftEndTime=g,f.driftEnd=b}else f.driftEndTime=o.driftEndTime,f.driftEnd=o.driftEnd,f.advancedDateTime=o.advancedDateTime}function m(o,f,A){if(o&&f)for(var x=0,T=0,O=o.length;T<=O;T++){var S=o[T],w=f[T+x];S&&w&&S.index===w.index&&S.fragment.sn===w.fragment.sn?A(S,w):x--}}function p(o,f,A){for(var x=f.skippedSegments,T=Math.max(o.startSN,f.startSN)-f.startSN,O=(o.fragmentHint?1:0)+(x?f.endSN:Math.min(o.endSN,f.endSN))-f.startSN,S=f.startSN-o.startSN,w=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,E=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,_=T;_<=O;_++){var c=E[S+_],u=w[_];x&&!u&&_<x&&(u=f.fragments[_]=c),c&&u&&A(c,u)}}function d(o,f){var A=f.startSN+f.skippedSegments-o.startSN,x=o.fragments;if(A<0||A>=x.length)return;s(f,x[A].start)}function s(o,f){if(f){for(var A=o.fragments,x=o.skippedSegments;x<A.length;x++)A[x].start+=f;o.fragmentHint&&(o.fragmentHint.start+=f)}}function h(o,f){var A=1e3*o.levelTargetDuration,x=A/2,T=o.age,O=T>0&&T<A*3,S=f.loading.end-f.loading.start,w,E=o.availabilityDelay;if(o.updated===!1)if(O){var _=333*o.misses;w=Math.max(Math.min(x,S*2),_),o.availabilityDelay=(o.availabilityDelay||0)+w}else w=x;else O?(E=Math.min(E||A/2,T),o.availabilityDelay=E,w=E+A-T):w=A-S;return Math.round(w)}function l(o,f,A){if(!o||!o.details)return null;var x=o.details,T=x.fragments[f-x.startSN];return T||(T=x.fragmentHint,T&&T.sn===f?T:f<x.startSN&&A&&A.sn===f?A:null)}function i(o,f,A){if(!o||!o.details)return null;var x=o.details.partList;if(x)for(var T=x.length;T--;){var O=x[T];if(O.index===A&&O.fragment.sn===f)return O}return null}},"./src/controller/stream-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return x});var G=D("./src/polyfills/number.ts"),N=D("./src/controller/base-stream-controller.ts"),M=D("./src/is-supported.ts"),W=D("./src/events.ts"),B=D("./src/utils/buffer-helper.ts"),P=D("./src/controller/fragment-tracker.ts"),R=D("./src/types/loader.ts"),v=D("./src/loader/fragment.ts"),m=D("./src/demux/transmuxer-interface.ts"),p=D("./src/types/transmuxer.ts"),d=D("./src/controller/gap-controller.ts"),s=D("./src/errors.ts"),h=D("./src/utils/logger.ts");function l(T,O){for(var S=0;S<O.length;S++){var w=O[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}function i(T,O,S){return O&&l(T.prototype,O),S&&l(T,S),T}function o(T,O){T.prototype=Object.create(O.prototype),T.prototype.constructor=T,f(T,O)}function f(T,O){return f=Object.setPrototypeOf||function(w,E){return w.__proto__=E,w},f(T,O)}var A=100,x=function(T){o(O,T);function O(w,E){var _;return _=T.call(this,w,E,"[stream-controller]")||this,_.audioCodecSwap=!1,_.gapController=null,_.level=-1,_._forceStartLoad=!1,_.altAudio=!1,_.audioOnly=!1,_.fragPlaying=null,_.onvplaying=null,_.onvseeked=null,_.fragLastKbps=0,_.stalled=!1,_.couldBacktrack=!1,_.audioCodecSwitch=!1,_.videoBuffer=null,_._registerListeners(),_}var S=O.prototype;return S._registerListeners=function(){var E=this.hls;E.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(W.Events.ERROR,this.onError,this),E.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var E=this.hls;E.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(W.Events.ERROR,this.onError,this),E.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(E){if(this.levels){var _=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var u=c.startLevel;u===-1&&(c.config.testBandwidth?(u=0,this.bitrateTest=!0):u=c.nextAutoLevel),this.level=c.nextLoadLevel=u,this.loadedmetadata=!1}_>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),E=_),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var E,_=this.levels,c=this.level,u=_==null||((E=_[c])===null||E===void 0)?void 0:E.details;if(u&&(!u.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(u))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var g,b=self.performance.now(),k=this.retryDate;(!k||b>=k||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var E,_,c=this.hls,u=this.levelLastLoaded,g=this.levels,b=this.media,k=c.config,I=c.nextLoadLevel;if(u===null||!b&&(this.startFragRequested||!k.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[I])return;var F=g[I];this.level=c.nextLoadLevel=I;var U=F.details;if(!U||this.state===N.State.WAITING_LEVEL||U.live&&this.levelLastLoaded!==I){this.state=N.State.WAITING_LEVEL;return}var C=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(C===null)return;var y=C.len,j=this.getMaxBufferLength(F.maxBitrate);if(y>=j)return;if(this._streamEnded(C,U)){var K={};this.altAudio&&(K.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,K),this.state=N.State.ENDED;return}var Q=C.end,te=this.getNextFragment(Q,U);if(this.couldBacktrack&&!this.fragPrevious&&te&&te.sn!=="initSegment"){var _e=te.sn-U.startSN;_e>1&&(te=U.fragments[_e-1],this.fragmentTracker.removeFragment(te))}if(te&&this.fragmentTracker.getState(te)===P.FragmentState.OK&&this.nextLoadPosition>Q){var de=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,de,R.PlaylistLevelType.MAIN),te=this.getNextFragment(this.nextLoadPosition,U)}if(!te)return;te.initSegment&&!te.initSegment.data&&!this.bitrateTest&&(te=te.initSegment),((E=te.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((_=te.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(te,U):this.loadFragment(te,U,Q)},S.loadFragment=function(E,_,c){var u,g=this.fragmentTracker.getState(E);if(this.fragCurrent=E,g===P.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(E);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else g=P.FragmentState.NOT_LOADED}g===P.FragmentState.NOT_LOADED||g===P.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,E,_,c)):g===P.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((u=this.media)===null||u===void 0?void 0:u.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(E){var _=this.fragmentTracker.getAppendedFrag(E,R.PlaylistLevelType.MAIN);return _&&"fragment"in _?_.fragment:_},S.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,R.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var E=this.levels,_=this.media;if(_!=null&&_.readyState){var c,u=this.getAppendedFrag(_.currentTime);if(u&&u.start>1&&this.flushMainBuffer(0,u.start-1),!_.paused&&E){var g=this.hls.nextLoadLevel,b=E[g],k=this.fragLastKbps;k&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*k)+1:c=0}else c=0;var I=this.getBufferedFrag(_.currentTime+c);if(I){var F=this.followingBufferedFrag(I);if(F){this.abortCurrentFrag();var U=F.maxStartPTS?F.maxStartPTS:F.start,C=F.duration,y=Math.max(I.end,U+Math.min(Math.max(C-this.config.maxFragLookUpTolerance,C*.5),C*.75));this.flushMainBuffer(y,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(E,_){T.prototype.flushMainBuffer.call(this,E,_,this.altAudio?"video":null)},S.onMediaAttached=function(E,_){T.prototype.onMediaAttached.call(this,E,_);var c=_.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)},S.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var E=this.media,_=E?E.currentTime:null;Object(G.isFiniteNumber)(_)&&this.log("Media seeked to "+_.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(E,_){var c=!1,u=!1,g;_.levels.forEach(function(b){g=b.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(c=!0),g.indexOf("mp4a.40.5")!==-1&&(u=!0))}),this.audioCodecSwitch=c&&u&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=_.levels,this.startFragRequested=!1},S.onLevelLoading=function(E,_){var c=this.levels;if(!c||this.state!==N.State.IDLE)return;var u=c[_.level];(!u.details||u.details.live&&this.levelLastLoaded!==_.level||this.waitForCdnTuneIn(u.details))&&(this.state=N.State.WAITING_LEVEL)},S.onLevelLoaded=function(E,_){var c,u=this.levels,g=_.level,b=_.details,k=b.totalduration;if(!u){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+k);var I=this.fragCurrent;I&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==_.level&&I.loader&&(this.state=N.State.IDLE,I.loader.abort()));var F=u[g],U=0;if(b.live||(c=F.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;U=this.alignPlaylists(b,F.details)}if(F.details=b,this.levelLastLoaded=g,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:b,level:g}),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,U),this.tick()},S._handleFragmentLoadProgress=function(E){var _,c=E.frag,u=E.part,g=E.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 k=b[c.level],I=k.details;if(!I){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var F=k.videoCodec,U=I.PTSKnown||!I.live,C=(_=c.initSegment)===null||_===void 0?void 0:_.data,y=this._getAudioCodec(k),j=this.transmuxer=this.transmuxer||new m.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),K=u?u.index:-1,Q=K!==-1,te=new p.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,g.byteLength,K,Q),_e=this.initPTS[c.cc];j.push(g,C,y,F,c,u,I.totalduration,U,te,_e)},S.onAudioTrackSwitching=function(E,_){var c=this.altAudio,u=!!_.url,g=_.id;if(!u){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 k=this.hls;c&&k.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),k.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:g})}},S.onAudioTrackSwitched=function(E,_){var c=_.id,u=!!this.hls.audioTracks[c].url;if(u){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=u,this.tick()},S.onBufferCreated=function(E,_){var c=_.tracks,u,g,b=!1;for(var k in c){var I=c[k];if(I.id==="main"){if(g=k,u=I,k==="video"){var F=c[k];F&&(this.videoBuffer=F.buffer)}}else b=!0}b&&u?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=u.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(E,_){var c=_.frag,u=_.part;if(c&&c.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(u?" p: "+u.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 g=u?u.stats:c.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,u)},S.onError=function(E,_){switch(_.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(R.PlaylistLevelType.MAIN,_);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(_.fatal?(this.warn(""+_.details),this.state=N.State.ERROR):!_.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var c=!0,u=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);u&&u.len>.5&&(c=!this.reduceMaxBufferLength(u.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var E=this.media,_=this.gapController;if(!E||!_||!E.readyState)return;var c=B.BufferHelper.getBuffered(E);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):_.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(E,_){var c=_.type;if(c!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var u=(c===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(u,c,R.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(E,_){this.levels=_.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var E=this.media,_=E.currentTime,c=this.startPosition;if(c>=0&&_<c){if(E.seeking){h.logger.log("could not seek to "+c+", already seeking at "+_);return}var u=B.BufferHelper.getBuffered(E),g=u.length?u.start(0):0,b=g-c;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(h.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 "+_),E.currentTime=c}},S._getAudioCodec=function(E){var _=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&_&&(this.log("Swapping audio codec"),_.indexOf("mp4a.40.5")!==-1?_="mp4a.40.2":_="mp4a.40.5"),_},S._loadBitrateTestFrag=function(E){var _=this;this._doFragLoad(E).then(function(c){var u=_.hls;if(!c||u.nextLoadLevel||_.fragContextChanged(E))return;_.fragLoadError=0,_.state=N.State.IDLE,_.startFragRequested=!1,_.bitrateTest=!1;var g=E.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),u.trigger(W.Events.FRAG_LOADED,c)})},S._handleTransmuxComplete=function(E){var _,c="main",u=this.hls,g=E.remuxResult,b=E.chunkMeta,k=this.getCurrentContext(b);if(!k){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 I=k.frag,F=k.part,U=k.level,C=g.video,y=g.text,j=g.id3,K=g.initSegment,Q=this.altAudio?void 0:g.audio;if(this.fragContextChanged(I))return;if(this.state=N.State.PARSING,K){K.tracks&&(this._bufferInitSegment(U,K.tracks,I,b),u.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:c,tracks:K.tracks}));var te=K.initPTS,_e=K.timescale;Object(G.isFiniteNumber)(te)&&(this.initPTS[I.cc]=te,u.trigger(W.Events.INIT_PTS_FOUND,{frag:I,id:c,initPTS:te,timescale:_e}))}if(C&&g.independent!==!1){if(U.details){var de=C.startPTS,me=C.endPTS,fe=C.startDTS,pe=C.endDTS;if(F)F.elementaryStreams[C.type]={startPTS:de,endPTS:me,startDTS:fe,endDTS:pe};else if(C.firstKeyFrame&&C.independent&&(this.couldBacktrack=!0),C.dropped&&C.independent){var ae=this.getLoadPosition()+this.config.maxBufferHole;if(ae<de){this.backtrack(I);return}I.setElementaryStreamInfo(C.type,I.start,me,I.start,pe,!0)}I.setElementaryStreamInfo(C.type,de,me,fe,pe),this.bufferFragmentData(C,I,F,b)}}else if(g.independent===!1){this.backtrack(I);return}if(Q){var he=Q.startPTS,$=Q.endPTS,ie=Q.startDTS,ee=Q.endDTS;F&&(F.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:he,endPTS:$,startDTS:ie,endDTS:ee}),I.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,he,$,ie,ee),this.bufferFragmentData(Q,I,F,b)}if(j!=null&&(_=j.samples)!==null&&_!==void 0&&_.length){var Ee={frag:I,id:c,samples:j.samples};u.trigger(W.Events.FRAG_PARSING_METADATA,Ee)}if(y){var we={frag:I,id:c,samples:y.samples};u.trigger(W.Events.FRAG_PARSING_USERDATA,we)}},S._bufferInitSegment=function(E,_,c,u){var g=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!_.audio&&!_.video,this.altAudio&&!this.audioOnly&&delete _.audio;var b=_.audio,k=_.video,I=_.audiovideo;if(b){var F=E.audioCodec,U=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(F&&(F.indexOf("mp4a.40.5")!==-1?F="mp4a.40.2":F="mp4a.40.5"),b.metadata.channelCount!==1&&U.indexOf("firefox")===-1&&(F="mp4a.40.5")),U.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(F="mp4a.40.2",this.log("Android: force audio codec to "+F)),E.audioCodec&&E.audioCodec!==F&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+F+'"'),b.levelCodec=F,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(F||"")+"/"+(E.audioCodec||"")+"/"+b.codec+"]")}k&&(k.levelCodec=E.videoCodec,k.id="main",this.log("Init video buffer, container:"+k.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+k.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,_),Object.keys(_).forEach(function(C){var y=_[C],j=y.initSegment;j!=null&&j.byteLength&&g.hls.trigger(W.Events.BUFFER_APPENDING,{type:C,data:j,frag:c,part:null,chunkMeta:u,parent:c.type})}),this.tick()},S.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var _=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,_?this.resetFragmentLoading(E):this.state=N.State.BACKTRACKING},S.checkFragmentChanged=function(){var E=this.media,_=null;if(E&&E.readyState>1&&E.seeking===!1){var c=E.currentTime;if(B.BufferHelper.isBuffered(E,c)?_=this.getAppendedFrag(c):B.BufferHelper.isBuffered(E,c+.1)&&(_=this.getAppendedFrag(c+.1)),_){var u=this.fragPlaying,g=_.level;(!u||_.sn!==u.sn||u.level!==g||_.urlId!==u.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:_}),(!u||u.level!==g)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=_)}}},i(O,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var _=this.getAppendedFrag(E.currentTime);if(_)return _.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var _=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(_)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"SubtitleStreamController",function(){return o});var G=D("./src/events.ts"),N=D("./src/utils/logger.ts"),M=D("./src/utils/buffer-helper.ts"),W=D("./src/controller/fragment-finders.ts"),B=D("./src/utils/discontinuities.ts"),P=D("./src/controller/level-helper.ts"),R=D("./src/controller/fragment-tracker.ts"),v=D("./src/controller/base-stream-controller.ts"),m=D("./src/types/loader.ts"),p=D("./src/types/level.ts");function d(f,A){for(var x=0;x<A.length;x++){var T=A[x];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(f,T.key,T)}}function s(f,A,x){return A&&d(f.prototype,A),x&&d(f,x),f}function h(f,A){f.prototype=Object.create(A.prototype),f.prototype.constructor=f,l(f,A)}function l(f,A){return l=Object.setPrototypeOf||function(T,O){return T.__proto__=O,T},l(f,A)}var i=500,o=function(f){h(A,f);function A(T,O){var S;return S=f.call(this,T,O,"[subtitle-stream-controller]")||this,S.levels=[],S.currentTrackId=-1,S.tracksBuffered=[],S.mainDetails=null,S._registerListeners(),S}var x=A.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var O=this.hls;O.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(G.Events.ERROR,this.onError,this),O.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var O=this.hls;O.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(G.Events.ERROR,this.onError,this),O.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(i),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(O,S){this.mainDetails=S.details},x.onSubtitleFragProcessed=function(O,S){var w=S.frag,E=S.success;if(this.fragPrevious=w,this.state=v.State.IDLE,!E)return;var _=this.tracksBuffered[this.currentTrackId];if(!_)return;for(var c,u=w.start,g=0;g<_.length;g++)if(u>=_[g].start&&u<=_[g].end){c=_[g];break}var b=w.start+w.duration;c?c.end=b:(c={start:u,end:b},_.push(c)),this.fragmentTracker.fragBuffered(w)},x.onBufferFlushing=function(O,S){var w=S.startOffset,E=S.endOffset;if(w===0&&E!==Number.POSITIVE_INFINITY){var _=this.currentTrackId,c=this.levels;if(!c.length||!c[_]||!c[_].details)return;var u=c[_].details,g=u.targetduration,b=E-g;if(b<=0)return;S.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(k){for(var I=0;I<k.length;){if(k[I].end<=b){k.shift();continue}else if(k[I].start<b)k[I].start=b;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(w,b,m.PlaylistLevelType.SUBTITLE)}},x.onError=function(O,S){var w,E=S.frag;if(!E||E.type!==m.PlaylistLevelType.SUBTITLE)return;(w=this.fragCurrent)!==null&&w!==void 0&&w.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},x.onSubtitleTracksUpdated=function(O,S){var w=this,E=S.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(_){return new p.Level(_)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(_){w.tracksBuffered[_.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(O,S){if(this.currentTrackId=S.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var w=this.levels[this.currentTrackId];w!=null&&w.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,w&&this.setInterval(i)},x.onSubtitleTrackLoaded=function(O,S){var w,E=S.details,_=S.id,c=this.currentTrackId,u=this.levels;if(!u.length)return;var g=u[c];if(_>=u.length||_!==c||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(w=g.details)!==null&&w!==void 0&&w.live){var b=this.mainDetails;if(E.deltaUpdateFailed||!b)return;var k=b.fragments[0];if(!g.details)E.hasProgramDateTime&&b.hasProgramDateTime?Object(B.alignMediaPlaylistByPDT)(E,b):k&&Object(P.addSliding)(E,k.start);else{var I=this.alignPlaylists(E,g.details);I===0&&k&&Object(P.addSliding)(E,k.start)}}if(g.details=E,this.levelLastLoaded=_,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var F=Object(W.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);F||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},x._handleFragmentLoadComplete=function(O){var S=O.frag,w=O.payload,E=S.decryptdata,_=this.hls;if(this.fragContextChanged(S))return;if(w&&w.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(w),E.key.buffer,E.iv.buffer).then(function(u){var g=performance.now();_.trigger(G.Events.FRAG_DECRYPTED,{frag:S,payload:u,stats:{tstart:c,tdecrypt:g}})})}},x.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var O,S=this.currentTrackId,w=this.levels;if(!w.length||!w[S]||!w[S].details)return;var E=w[S].details,_=E.targetduration,c=this.config,u=this.media,g=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,u.currentTime-_,c.maxBufferHole),b=g.end,k=g.len,I=this.getMaxBufferLength()+_;if(k>I)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var F=E.fragments,U=F.length,C=E.edge,y,j=this.fragPrevious;if(b<C){var K=c.maxFragLookUpTolerance;j&&E.hasProgramDateTime&&(y=Object(W.findFragmentByPDT)(F,j.endProgramDateTime,K)),y||(y=Object(W.findFragmentByPTS)(j,F,b,K),!y&&j&&j.start<F[0].start&&(y=F[0]))}else y=F[U-1];(O=y)!==null&&O!==void 0&&O.encrypted?(N.logger.log("Loading key for "+y.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:y})):y&&this.fragmentTracker.getState(y)===R.FragmentState.NOT_LOADED&&this.loadFragment(y,E,b)}},x.loadFragment=function(O,S,w){this.fragCurrent=O,f.prototype.loadFragment.call(this,O,S,w)},s(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(v.default)},"./src/controller/subtitle-track-controller.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/events.ts"),N=D("./src/utils/texttrack-utils.ts"),M=D("./src/controller/base-playlist-controller.ts"),W=D("./src/types/loader.ts");function B(d,s){for(var h=0;h<s.length;h++){var l=s[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(d,l.key,l)}}function P(d,s,h){return s&&B(d.prototype,s),h&&B(d,h),d}function R(d,s){d.prototype=Object.create(s.prototype),d.prototype.constructor=d,v(d,s)}function v(d,s){return v=Object.setPrototypeOf||function(l,i){return l.__proto__=i,l},v(d,s)}var m=function(d){R(s,d);function s(l){var i;return i=d.call(this,l,"[subtitle-track-controller]")||this,i.media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}var h=s.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,d.prototype.destroy.call(this)},h.registerListeners=function(){var i=this.hls;i.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.on(G.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var i=this.hls;i.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.off(G.Events.ERROR,this.onError,this)},h.onMediaAttached=function(i,o){if(this.media=o.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)},h.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},h.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var i=p(this.media.textTracks);i.forEach(function(o){Object(N.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(i,o){this.tracks=o.subtitleTracks},h.onSubtitleTrackLoaded=function(i,o){var f=o.id,A=o.details,x=this.trackId,T=this.tracksInGroup[x];if(!T){this.warn("Invalid subtitle track id "+f);return}var O=T.details;T.details=o.details,this.log("subtitle track "+f+" loaded ["+A.startSN+"-"+A.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,o,O))},h.onLevelLoading=function(i,o){this.switchLevel(o.level)},h.onLevelSwitching=function(i,o){this.switchLevel(o.level)},h.switchLevel=function(i){var o=this.hls.levels[i];if(!(o!=null&&o.textGroupIds))return;var f=o.textGroupIds[o.urlId];if(this.groupId!==f){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(S){return!f||S.groupId===f});this.tracksInGroup=x;var T=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=f;var O={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,O),T!==-1&&this.setSubtitleTrack(T,A)}},h.findTrackId=function(i){for(var o=this.tracksInGroup,f=0;f<o.length;f++){var A=o[f];if((!this.selectDefaultTrack||A.default)&&(!i||i===A.name))return A.id}return-1},h.onError=function(i,o){if(d.prototype.onError.call(this,i,o),o.fatal||!o.context)return;o.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},h.loadPlaylist=function(i){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var f=o.id,A=o.groupId,x=o.url;if(i)try{x=i.addDirectives(x)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADING,{url:x,id:f,groupId:A,deliveryDirectives:i||null})}},h.toggleTrackModes=function(i){var o=this,f=this.media,A=this.subtitleDisplay,x=this.trackId;if(!f)return;var T=p(f.textTracks),O=T.filter(function(E){return E.groupId===o.groupId});if(i===-1)[].slice.call(T).forEach(function(E){E.mode="disabled"});else{var S=O[x];S&&(S.mode="disabled")}var w=O[i];w&&(w.mode=A?"showing":"hidden")},h.setSubtitleTrack=function(i,o){var f,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=i;return}if(this.trackId!==i&&this.toggleTrackModes(i),this.trackId===i&&(i===-1||(f=A[i])!==null&&f!==void 0&&f.details)||i<-1||i>=A.length)return;this.clearTimer();var x=A[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,x){var T=x.id,O=x.groupId,S=O===void 0?"":O,w=x.name,E=x.type,_=x.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:S,name:w,type:E,url:_});var c=this.switchParams(x.url,o==null?void 0:o.details);this.loadPlaylist(c)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:i})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,o=p(this.media.textTracks),f=0;f<o.length;f++)if(o[f].mode==="hidden")i=f;else if(o[f].mode==="showing"){i=f;break}this.subtitleTrack!==i&&(this.subtitleTrack=i)},P(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(i,o)}}]),s}(M.default);function p(d){for(var s=[],h=0;h<d.length;h++){var l=d[h];l.kind==="subtitles"&&l.label&&s.push(d[h])}return s}V.default=m},"./src/controller/timeline-controller.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"TimelineController",function(){return p});var G=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),M=D("./src/utils/cea-608-parser.ts"),W=D("./src/utils/output-filter.ts"),B=D("./src/utils/webvtt-parser.ts"),P=D("./src/utils/texttrack-utils.ts"),R=D("./src/utils/imsc1-ttml-parser.ts"),v=D("./src/types/loader.ts"),m=D("./src/utils/logger.ts"),p=function(){function l(o){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=h(),this.captionsProperties=void 0,this.hls=o,this.config=o.config,this.Cues=o.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 W.default(this,"textTrack1"),A=new W.default(this,"textTrack2"),x=new W.default(this,"textTrack3"),T=new W.default(this,"textTrack4");this.cea608Parser1=new M.default(1,f,A),this.cea608Parser2=new M.default(3,x,T)}o.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(N.Events.FRAG_LOADING,this.onFragLoading,this),o.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=l.prototype;return i.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},i.addCues=function(f,A,x,T,O){for(var S=!1,w=O.length;w--;){var E=O[w],_=s(E[0],E[1],A,x);if(_>=0&&(E[0]=Math.min(E[0],A),E[1]=Math.max(E[1],x),S=!0,_/(x-A)>.5))return}if(S||O.push([A,x]),this.config.renderTextTracksNatively){var c=this.captionsTracks[f];this.Cues.newCue(c,A,x,T)}else{var u=this.Cues.newCue(null,A,x,T);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:u,track:f})}},i.onInitPtsFound=function(f,A){var x=this,T=A.frag,O=A.id,S=A.initPTS,w=A.timescale,E=this.unparsedVttFrags;O==="main"&&(this.initPTS[T.cc]=S,this.timescale[T.cc]=w),E.length&&(this.unparsedVttFrags=[],E.forEach(function(_){x.onFragLoaded(N.Events.FRAG_LOADED,_)}))},i.getExistingTrack=function(f){var A=this.media;if(A)for(var x=0;x<A.textTracks.length;x++){var T=A.textTracks[x];if(T[f])return T}return null},i.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},i.createNativeTrack=function(f){if(this.captionsTracks[f])return;var A=this.captionsProperties,x=this.captionsTracks,T=this.media,O=A[f],S=O.label,w=O.languageCode,E=this.getExistingTrack(f);if(E)x[f]=E,Object(P.clearCurrentCues)(x[f]),Object(P.sendAddTrackEvent)(x[f],T);else{var _=this.createTextTrack("captions",S,w);_&&(_[f]=!0,x[f]=_)}},i.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var A=this.captionsProperties[f];if(!A)return;var x=A.label,T={_id:f,label:x,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[f]=T,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},i.createTextTrack=function(f,A,x){var T=this.media;return T?T.addTextTrack(f,A,x):void 0},i.onMediaAttaching=function(f,A){this.media=A.media,this._cleanTracks()},i.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(A){Object(P.clearCurrentCues)(f[A]),delete f[A]}),this.nonNativeCaptionsTracks={}},i.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},i._cleanTracks=function(){var f=this.media;if(!f)return;var A=f.textTracks;if(A)for(var x=0;x<A.length;x++)Object(P.clearCurrentCues)(A[x])},i.onSubtitleTracksUpdated=function(f,A){var x=this;this.textTracks=[];var T=A.subtitleTracks||[],O=T.some(function(_){return _.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var S=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var w=this.media?this.media.textTracks:[];this.tracks.forEach(function(_,c){var u;if(c<w.length){for(var g=null,b=0;b<w.length;b++)if(d(w[b],_)){g=w[b];break}g&&(u=g)}u?Object(P.clearCurrentCues)(u):(u=x.createTextTrack("subtitles",_.name,_.lang),u&&(u.mode="disabled")),u&&(u.groupId=_.groupId,x.textTracks.push(u))})}else if(!S&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(_){return{label:_.name,kind:_.type.toLowerCase(),default:_.default,subtitleTrack:_}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},i.onManifestLoaded=function(f,A){var x=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(T){var O=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!O)return;var S="textTrack"+O[1],w=x.captionsProperties[S];if(!w)return;w.label=T.name,T.lang&&(w.languageCode=T.lang),w.media=T})},i.onFragLoading=function(f,A){var x=this.cea608Parser1,T=this.cea608Parser2,O=this.lastSn,S=this.lastPartIndex;if(!this.enabled||!(x&&T))return;if(A.frag.type===v.PlaylistLevelType.MAIN){var w,E,_=A.frag.sn,c=(w=A==null||((E=A.part)===null||E===void 0)?void 0:E.index)!=null?w:-1;_===O+1||_===O&&c===S+1||(x.reset(),T.reset()),this.lastSn=_,this.lastPartIndex=c}},i.onFragLoaded=function(f,A){var x=A.frag,T=A.payload,O=this.initPTS,S=this.unparsedVttFrags;if(x.type===v.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(G.isFiniteNumber)(O[x.cc])){S.push(A),O.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Missing initial subtitle PTS")});return}var w=x.decryptdata;if(w==null||w.key==null||w.method!=="AES-128"){var E=this.tracks[x.level],_=this.vttCCs;_[x.cc]||(_[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),E&&E.textCodec===R.IMSC1_CODEC?this._parseIMSC1(x,T):this._parseVTTs(x,T,_)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},i._parseIMSC1=function(f,A){var x=this,T=this.hls;Object(R.parseIMSC1)(A,this.initPTS[f.cc],this.timescale[f.cc],function(O){x._appendCues(O,f.level),T.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(O){m.logger.log("Failed to parse IMSC1: "+O),T.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:O})})},i._parseVTTs=function(f,A,x){var T=this,O=this.hls;Object(B.parseWebVTT)(A,this.initPTS[f.cc],this.timescale[f.cc],x,f.cc,f.start,function(S){T._appendCues(S,f.level),O.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(S){T._fallbackToIMSC1(f,A),m.logger.log("Failed to parse VTT cue: "+S),O.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:S})})},i._fallbackToIMSC1=function(f,A){var x=this,T=this.tracks[f.level];T.textCodec||Object(R.parseIMSC1)(A,this.initPTS[f.cc],this.timescale[f.cc],function(){T.textCodec=R.IMSC1_CODEC,x._parseIMSC1(f,A)},function(){T.textCodec="wvtt"})},i._appendCues=function(f,A){var x=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[A];if(T.mode==="disabled")return;f.forEach(function(w){return Object(P.addCueToTrack)(T,w)})}else{var O=this.tracks[A],S=O.default?"default":"subtitles"+A;x.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:f,track:S})}},i.onFragDecrypted=function(f,A){var x=A.frag;if(x.type===v.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(N.Events.FRAG_LOADED,A)}},i.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},i.onFragParsingUserdata=function(f,A){var x=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(x&&T))return;for(var O=0;O<A.samples.length;O++){var S=A.samples[O].bytes;if(S){var w=this.extractCea608Data(S);x.addData(A.samples[O].pts,w[0]),T.addData(A.samples[O].pts,w[1])}}},i.onBufferFlushing=function(f,A){var x=A.startOffset,T=A.endOffset,O=A.endOffsetSubtitles,S=A.type,w=this.media;if(!w||w.currentTime<T)return;if(!S||S==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(c){return Object(P.removeCuesInRange)(E[c],x,T)})}if(this.config.renderTextTracksNatively&&(x===0&&O!==void 0)){var _=this.textTracks;Object.keys(_).forEach(function(c){return Object(P.removeCuesInRange)(_[c],x,O)})}},i.extractCea608Data=function(f){for(var A=f[0]&31,x=2,T=[[],[]],O=0;O<A;O++){var S=f[x++],w=127&f[x++],E=127&f[x++],_=(4&S)!==0,c=3&S;if(w===0&&E===0)continue;_&&((c===0||c===1)&&(T[c].push(w),T[c].push(E)))}return T},l}();function d(l,i){return l&&l.label===i.name&&!(l.textTrack1||l.textTrack2)}function s(l,i,o,f){return Math.min(i,f)-Math.max(l,o)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return G});var G=function(){function N(W,B){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=B}var M=N.prototype;return M.decrypt=function(B,P){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},P,B)},N}()},"./src/crypt/aes-decryptor.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"removePadding",function(){return N}),D.d(V,"default",function(){return M});var G=D("./src/utils/typed-array.ts");function N(W){var B=W.byteLength,P=B&&new DataView(W.buffer).getUint8(B-1);return P?Object(G.sliceUint8)(W,0,B-P):W}var M=function(){function W(){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 B=W.prototype;return B.uint8ArrayToUint32Array_=function(R){for(var v=new DataView(R),m=new Uint32Array(4),p=0;p<4;p++)m[p]=v.getUint32(p*4);return m},B.initTable=function(){var R=this.sBox,v=this.invSBox,m=this.subMix,p=m[0],d=m[1],s=m[2],h=m[3],l=this.invSubMix,i=l[0],o=l[1],f=l[2],A=l[3],x=new Uint32Array(256),T=0,O=0,S=0;for(S=0;S<256;S++)S<128?x[S]=S<<1:x[S]=S<<1^283;for(S=0;S<256;S++){var w=O^O<<1^O<<2^O<<3^O<<4;w=w>>>8^w&255^99,R[T]=w,v[w]=T;var E=x[T],_=x[E],c=x[_],u=x[w]*257^w*16843008;p[T]=u<<24|u>>>8,d[T]=u<<16|u>>>16,s[T]=u<<8|u>>>24,h[T]=u,u=c*16843009^_*65537^E*257^T*16843008,i[w]=u<<24|u>>>8,o[w]=u<<16|u>>>16,f[w]=u<<8|u>>>24,A[w]=u,T?(T=E^x[x[x[c^E]]],O^=x[x[O]]):T=O=1}},B.expandKey=function(R){for(var v=this.uint8ArrayToUint32Array_(R),m=!0,p=0;p<v.length&&m;)m=v[p]===this.key[p],p++;if(m)return;this.key=v;var d=this.keySize=v.length;if(d!==4&&d!==6&&d!==8)throw new Error("Invalid aes key size="+d);var s=this.ksRows=(d+6+1)*4,h,l,i=this.keySchedule=new Uint32Array(s),o=this.invKeySchedule=new Uint32Array(s),f=this.sBox,A=this.rcon,x=this.invSubMix,T=x[0],O=x[1],S=x[2],w=x[3],E,_;for(h=0;h<s;h++){if(h<d){E=i[h]=v[h];continue}_=E,h%d===0?(_=_<<8|_>>>24,_=f[_>>>24]<<24|f[_>>>16&255]<<16|f[_>>>8&255]<<8|f[_&255],_^=A[h/d|0]<<24):d>6&&h%d===4&&(_=f[_>>>24]<<24|f[_>>>16&255]<<16|f[_>>>8&255]<<8|f[_&255]),i[h]=E=(i[h-d]^_)>>>0}for(l=0;l<s;l++)h=s-l,l&3?_=i[h]:_=i[h-4],l<4||h<=4?o[l]=_:o[l]=T[f[_>>>24]]^O[f[_>>>16&255]]^S[f[_>>>8&255]]^w[f[_&255]],o[l]=o[l]>>>0},B.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},B.decrypt=function(R,v,m){for(var p=this.keySize+6,d=this.invKeySchedule,s=this.invSBox,h=this.invSubMix,l=h[0],i=h[1],o=h[2],f=h[3],A=this.uint8ArrayToUint32Array_(m),x=A[0],T=A[1],O=A[2],S=A[3],w=new Int32Array(R),E=new Int32Array(w.length),_,c,u,g,b,k,I,F,U,C,y,j,K,Q,te=this.networkToHostOrderSwap;v<w.length;){for(U=te(w[v]),C=te(w[v+1]),y=te(w[v+2]),j=te(w[v+3]),b=U^d[0],k=j^d[1],I=y^d[2],F=C^d[3],K=4,Q=1;Q<p;Q++)_=l[b>>>24]^i[k>>16&255]^o[I>>8&255]^f[F&255]^d[K],c=l[k>>>24]^i[I>>16&255]^o[F>>8&255]^f[b&255]^d[K+1],u=l[I>>>24]^i[F>>16&255]^o[b>>8&255]^f[k&255]^d[K+2],g=l[F>>>24]^i[b>>16&255]^o[k>>8&255]^f[I&255]^d[K+3],b=_,k=c,I=u,F=g,K=K+4;_=s[b>>>24]<<24^s[k>>16&255]<<16^s[I>>8&255]<<8^s[F&255]^d[K],c=s[k>>>24]<<24^s[I>>16&255]<<16^s[F>>8&255]<<8^s[b&255]^d[K+1],u=s[I>>>24]<<24^s[F>>16&255]<<16^s[b>>8&255]<<8^s[k&255]^d[K+2],g=s[F>>>24]<<24^s[b>>16&255]<<16^s[k>>8&255]<<8^s[I&255]^d[K+3],E[v]=te(_^x),E[v+1]=te(g^T),E[v+2]=te(u^O),E[v+3]=te(c^S),x=U,T=C,O=y,S=j,v=v+4}return E.buffer},W}()},"./src/crypt/decrypter.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return v});var G=D("./src/crypt/aes-crypto.ts"),N=D("./src/crypt/fast-aes-key.ts"),M=D("./src/crypt/aes-decryptor.ts"),W=D("./src/utils/logger.ts"),B=D("./src/utils/mp4-tools.ts"),P=D("./src/utils/typed-array.ts"),R=16,v=function(){function m(d,s,h){var l=h===void 0?{}:h,i=l.removePKCS7Padding,o=i===void 0?!0:i;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=d,this.config=s,this.removePKCS7Padding=o,o)try{var f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var h=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(h):h},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(s,h,l,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),h,l);var o=this.flush();o&&i(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),h,l).then(i)},p.softwareDecrypt=function(s,h,l){var i=this.currentIV,o=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(s=Object(B.appendUint8Array)(f,s),this.remainderData=null);var A=this.getValidChunk(s);if(!A.length)return null;i&&(l=i);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new M.default),x.expandKey(h);var T=o;return this.currentResult=x.decrypt(A.buffer,0,l),this.currentIV=Object(P.sliceUint8)(A,-16).buffer,T||null},p.webCryptoDecrypt=function(s,h,l){var i=this,o=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new N.default(o,h)),this.fastAesKey.expandKey().then(function(f){if(!o)return Promise.reject(new Error("web crypto not initialized"));var A=new G.default(o,l);return A.decrypt(s.buffer,f)}).catch(function(f){return i.onWebCryptoError(f,s,h,l)})},p.onWebCryptoError=function(s,h,l,i){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,l,i)},p.getValidChunk=function(s){var h=s,l=s.length-s.length%R;return l!==s.length&&(h=Object(P.sliceUint8)(s,0,l),this.remainderData=Object(P.sliceUint8)(s,l)),h},p.logOnce=function(s){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return G});var G=function(){function N(W,B){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=B}var M=N.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/demux/base-audio-demuxer.ts"),N=D("./src/demux/adts.ts"),M=D("./src/utils/logger.ts"),W=D("./src/demux/id3.ts");function B(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,P(v,m)}function P(v,m){return P=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},P(v,m)}var R=function(v){B(m,v);function m(d,s){var h;return h=v.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=d,h.config=s,h}var p=m.prototype;return p.resetInitSegment=function(s,h,l){v.prototype.resetInitSegment.call(this,s,h,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:l,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var h=W.getID3Data(s,0)||[],l=h.length,i=s.length;l<i;l++)if(N.probe(s,l))return M.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(s,h){return N.canParse(s,h)},p.appendFrame=function(s,h,l){N.initTrackConfig(s,this.observer,h,l,s.manifestCodec);var i=N.appendFrame(s,h,l,this.initPTS,this.frameIndex);if(i&&i.missing===0)return i},m}(G.default);R.minProbeByteLength=9,V.default=R},"./src/demux/adts.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"getAudioConfig",function(){return W}),D.d(V,"isHeaderPattern",function(){return B}),D.d(V,"getHeaderLength",function(){return P}),D.d(V,"getFullFrameLength",function(){return R}),D.d(V,"canGetFrameLength",function(){return v}),D.d(V,"isHeader",function(){return m}),D.d(V,"canParse",function(){return p}),D.d(V,"probe",function(){return d}),D.d(V,"initTrackConfig",function(){return s}),D.d(V,"getFrameDuration",function(){return h}),D.d(V,"parseFrameHeader",function(){return l}),D.d(V,"appendFrame",function(){return i});var G=D("./src/utils/logger.ts"),N=D("./src/errors.ts"),M=D("./src/events.ts");function W(o,f,A,x){var T,O,S,w,E=navigator.userAgent.toLowerCase(),_=x,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((f[A+2]&192)>>>6)+1;var u=(f[A+2]&60)>>>2;if(u>c.length-1){o.trigger(M.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+u});return}return S=(f[A+2]&1)<<2,S|=(f[A+3]&192)>>>6,G.logger.log("manifest codec:"+x+", ADTS type:"+T+", samplingIndex:"+u),/firefox/i.test(E)?u>=6?(T=5,w=new Array(4),O=u-3):(T=2,w=new Array(2),O=u):E.indexOf("android")!==-1?(T=2,w=new Array(2),O=u):(T=5,w=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&u>=6?O=u-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(u>=6&&S===1||/vivaldi/i.test(E))||!x&&S===1)&&(T=2,w=new Array(2)),O=u)),w[0]=T<<3,w[0]|=(u&14)>>1,w[1]|=(u&1)<<7,w[1]|=S<<3,T===5&&(w[1]|=(O&14)>>1,w[2]=(O&1)<<7,w[2]|=2<<2,w[3]=0),{config:w,samplerate:c[u],channelCount:S,codec:"mp4a.40."+T,manifestCodec:_}}function B(o,f){return o[f]===255&&(o[f+1]&246)===240}function P(o,f){return o[f+1]&1?7:9}function R(o,f){return(o[f+3]&3)<<11|o[f+4]<<3|(o[f+5]&224)>>>5}function v(o,f){return f+5<o.length}function m(o,f){return f+1<o.length&&B(o,f)}function p(o,f){return v(o,f)&&B(o,f)&&R(o,f)<=o.length-f}function d(o,f){if(m(o,f)){var A=P(o,f);if(f+A>=o.length)return!1;var x=R(o,f);if(x<=A)return!1;var T=f+x;return T===o.length||m(o,T)}return!1}function s(o,f,A,x,T){if(!o.samplerate){var O=W(f,A,x,T);if(!O)return;o.config=O.config,o.samplerate=O.samplerate,o.channelCount=O.channelCount,o.codec=O.codec,o.manifestCodec=O.manifestCodec,G.logger.log("parsed codec:"+o.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function h(o){return 1024*9e4/o}function l(o,f,A,x,T){var O=P(o,f),S=R(o,f);if(S-=O,S>0){var w=A+x*T;return{headerLength:O,frameLength:S,stamp:w}}}function i(o,f,A,x,T){var O=h(o.samplerate),S=l(f,A,x,T,O);if(S){var w=S.frameLength,E=S.headerLength,_=S.stamp,c=E+w,u=Math.max(0,A+c-f.length),g;u?(g=new Uint8Array(c-E),g.set(f.subarray(A+E,f.length),0)):g=f.subarray(A+E,A+c);var b={unit:g,pts:_};return u||o.samples.push(b),{sample:b,length:c,missing:u}}}},"./src/demux/base-audio-demuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"initPTSFn",function(){return R});var G=D("./src/polyfills/number.ts"),N=D("./src/demux/id3.ts"),M=D("./src/demux/dummy-demuxed-track.ts"),W=D("./src/utils/mp4-tools.ts"),B=D("./src/utils/typed-array.ts"),P=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(d,s,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(d,s){return!1},m.appendFrame=function(d,s,h){},m.demux=function(d,s){this.cachedData&&(d=Object(W.appendUint8Array)(this.cachedData,d),this.cachedData=null);var h=N.getID3Data(d,0),l=h?h.length:0,i,o,f=this._audioTrack,A=this._id3Track,x=h?N.getTimeStamp(h):void 0,T=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(x,s)),h&&h.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),o=this.initPTS;l<T;){if(this.canParse(d,l)){var O=this.appendFrame(f,d,l);O?(this.frameIndex++,o=O.sample.pts,l+=O.length,i=l):l=T}else N.canParse(d,l)?(h=N.getID3Data(d,l),A.samples.push({pts:o,dts:o,data:h}),l+=h.length,i=l):l++;if(l===T&&i!==T){var S=Object(B.sliceUint8)(d,i);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,S):this.cachedData=S}}return{audioTrack:f,avcTrack:Object(M.dummyTrack)(),id3Track:A,textTrack:Object(M.dummyTrack)()}},m.demuxSampleAes=function(d,s,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(d){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},m.destroy=function(){},v}(),R=function(m,p){return Object(G.isFiniteNumber)(m)?m*90:p*9e4};V.default=P},"./src/demux/chunk-cache.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return G});var G=function(){function M(){this.chunks=[],this.dataLength=0}var W=M.prototype;return W.push=function(P){this.chunks.push(P),this.dataLength+=P.length},W.flush=function(){var P=this.chunks,R=this.dataLength,v;if(P.length)P.length===1?v=P[0]:v=N(P,R);else return new Uint8Array(0);return this.reset(),v},W.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function N(M,W){for(var B=new Uint8Array(W),P=0,R=0;R<M.length;R++){var v=M[R];B.set(v,P),P+=v.length}return B}},"./src/demux/dummy-demuxed-track.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"dummyTrack",function(){return G});function G(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/utils/logger.ts"),N=function(){function M(B){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=B,this.bytesAvailable=B.byteLength,this.word=0,this.bitsAvailable=0}var W=M.prototype;return W.loadWord=function(){var P=this.data,R=this.bytesAvailable,v=P.byteLength-R,m=new Uint8Array(4),p=Math.min(4,R);if(p===0)throw new Error("no bytes available");m.set(P.subarray(v,v+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},W.skipBits=function(P){var R;this.bitsAvailable>P?(this.word<<=P,this.bitsAvailable-=P):(P-=this.bitsAvailable,R=P>>3,P-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=P,this.bitsAvailable-=P)},W.readBits=function(P){var R=Math.min(this.bitsAvailable,P),v=this.word>>>32-R;return P>32&&G.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=P-R,R>0&&this.bitsAvailable?v<<R|this.readBits(R):v},W.skipLZ=function(){var P;for(P=0;P<this.bitsAvailable;++P)if((this.word&2147483648>>>P)!==0)return this.word<<=P,this.bitsAvailable-=P,P;return this.loadWord(),P+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var P=this.skipLZ();return this.readBits(P+1)-1},W.readEG=function(){var P=this.readUEG();return 1&P?1+P>>>1:-1*(P>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(P){for(var R=8,v=8,m,p=0;p<P;p++)v!==0&&(m=this.readEG(),v=(R+m+256)%256),R=v===0?R:v},W.readSPS=function(){var P=0,R=0,v=0,m=0,p,d,s,h=this.readUByte.bind(this),l=this.readBits.bind(this),i=this.readUEG.bind(this),o=this.readBoolean.bind(this),f=this.skipBits.bind(this),A=this.skipEG.bind(this),x=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);h();var O=h();if(l(5),f(3),h(),x(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var S=i();if(S===3&&f(1),x(),x(),f(1),o())for(d=S!==3?8:12,s=0;s<d;s++)o()&&(s<6?T(16):T(64))}x();var w=i();if(w===0)i();else if(w===1)for(f(1),A(),A(),p=i(),s=0;s<p;s++)A();x(),f(1);var E=i(),_=i(),c=l(1);c===0&&f(1),f(1),o()&&(P=i(),R=i(),v=i(),m=i());var u=[1,1];if(o()&&o()){var g=h();switch(g){case 1:u=[1,1];break;case 2:u=[12,11];break;case 3:u=[10,11];break;case 4:u=[16,11];break;case 5:u=[40,33];break;case 6:u=[24,11];break;case 7:u=[20,11];break;case 8:u=[32,11];break;case 9:u=[80,33];break;case 10:u=[18,11];break;case 11:u=[15,11];break;case 12:u=[64,33];break;case 13:u=[160,99];break;case 14:u=[4,3];break;case 15:u=[3,2];break;case 16:u=[2,1];break;case 255:{u=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((E+1)*16-P*2-R*2),height:(2-c)*(_+1)*16-(c?2:4)*(v+m),pixelRatio:u}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();V.default=N},"./src/demux/id3.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"isHeader",function(){return G}),D.d(V,"isFooter",function(){return N}),D.d(V,"getID3Data",function(){return M}),D.d(V,"canParse",function(){return B}),D.d(V,"getTimeStamp",function(){return P}),D.d(V,"isTimeStampFrame",function(){return R}),D.d(V,"getID3Frames",function(){return m}),D.d(V,"decodeFrame",function(){return p}),D.d(V,"utf8ArrayToStr",function(){return i}),D.d(V,"testables",function(){return o});var G=function(T,O){return O+10<=T.length&&(T[O]===73&&T[O+1]===68&&T[O+2]===51&&(T[O+3]<255&&T[O+4]<255&&(T[O+6]<128&&T[O+7]<128&&T[O+8]<128&&T[O+9]<128)))},N=function(T,O){return O+10<=T.length&&(T[O]===51&&T[O+1]===68&&T[O+2]===73&&(T[O+3]<255&&T[O+4]<255&&(T[O+6]<128&&T[O+7]<128&&T[O+8]<128&&T[O+9]<128)))},M=function(T,O){for(var S=O,w=0;G(T,O);){w+=10;var E=W(T,O+6);w+=E,N(T,O+10)&&(w+=10),O+=w}return w>0?T.subarray(S,S+w):void 0},W=function(T,O){var S=0;return S=(T[O]&127)<<21,S|=(T[O+1]&127)<<14,S|=(T[O+2]&127)<<7,S|=T[O+3]&127,S},B=function(T,O){return G(T,O)&&W(T,O+6)+10<=T.length-O},P=function(T){for(var O=m(T),S=0;S<O.length;S++){var w=O[S];if(R(w))return l(w)}return},R=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},v=function(T){var O=String.fromCharCode(T[0],T[1],T[2],T[3]),S=W(T,4),w=10;return{type:O,size:S,data:T.subarray(w,w+S)}},m=function(T){for(var O=0,S=[];G(T,O);){var w=W(T,O+6);O+=10;for(var E=O+w;O+8<E;){var _=v(T.subarray(O)),c=p(_);c&&S.push(c),O+=_.size+10}N(T,O)&&(O+=10)}return S},p=function(T){return T.type==="PRIV"?d(T):T.type[0]==="W"?h(T):s(T)},d=function(T){if(T.size<2)return;var O=i(T.data,!0),S=new Uint8Array(T.data.subarray(O.length+1));return{key:T.type,info:O,data:S.buffer}},s=function(T){if(T.size<2)return;if(T.type==="TXXX"){var O=1,S=i(T.data.subarray(O),!0);O+=S.length+1;var w=i(T.data.subarray(O));return{key:T.type,info:S,data:w}}var E=i(T.data.subarray(1));return{key:T.type,data:E}},h=function(T){if(T.type==="WXXX"){if(T.size<2)return;var O=1,S=i(T.data.subarray(O),!0);O+=S.length+1;var w=i(T.data.subarray(O));return{key:T.type,info:S,data:w}}var E=i(T.data);return{key:T.type,data:E}},l=function(T){if(T.data.byteLength===8){var O=new Uint8Array(T.data),S=O[3]&1,w=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return w/=45,S&&(w+=4772185884e-2),Math.round(w)}return},i=function(T,O){O===void 0&&(O=!1);var S=A();if(S){var w=S.decode(T);if(O){var E=w.indexOf("\0");return E!==-1?w.substring(0,E):w}return w.replace(/\0/g,"")}for(var _=T.length,c,u,g,b="",k=0;k<_;){if(c=T[k++],c===0&&O)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:u=T[k++],b+=String.fromCharCode((c&31)<<6|u&63);break;case 14:u=T[k++],g=T[k++],b+=String.fromCharCode((c&15)<<12|(u&63)<<6|(g&63)<<0);break;default:}}return b},o={decodeTextFrame:s},f;function A(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./src/demux/mp3demuxer.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/demux/base-audio-demuxer.ts"),N=D("./src/demux/id3.ts"),M=D("./src/utils/logger.ts"),W=D("./src/demux/mpegaudio.ts");function B(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,P(v,m)}function P(v,m){return P=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},P(v,m)}var R=function(v){B(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(s,h,l){v.prototype.resetInitSegment.call(this,s,h,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:l,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var h=N.getID3Data(s,0)||[],l=h.length,i=s.length;l<i;l++)if(W.probe(s,l))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(s,h){return W.canParse(s,h)},p.appendFrame=function(s,h,l){return this.initPTS===null?void 0:W.appendFrame(s,h,l,this.initPTS,this.frameIndex)},m}(G.default);R.minProbeByteLength=4,V.default=R},"./src/demux/mp4demuxer.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/utils/mp4-tools.ts"),N=D("./src/demux/dummy-demuxed-track.ts"),M=function(){function W(P,R){this.remainderData=null,this.config=void 0,this.config=R}var B=W.prototype;return B.resetTimeStamp=function(){},B.resetInitSegment=function(){},B.resetContiguity=function(){},W.probe=function(R){return Object(G.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},B.demux=function(R){var v=R,m=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(G.appendUint8Array)(this.remainderData,R));var p=Object(G.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(N.dummyTrack)(),avcTrack:m,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},B.flush=function(){var R=Object(N.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:R,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},B.demuxSampleAes=function(R,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},B.destroy=function(){},W}();M.minProbeByteLength=1024,V.default=M},"./src/demux/mpegaudio.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"appendFrame",function(){return P}),D.d(V,"parseHeader",function(){return R}),D.d(V,"isHeaderPattern",function(){return v}),D.d(V,"isHeader",function(){return m}),D.d(V,"canParse",function(){return p}),D.d(V,"probe",function(){return d});var G=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],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],B=[0,1,1,4];function P(s,h,l,i,o){if(l+24>h.length)return;var f=R(h,l);if(f&&l+f.frameLength<=h.length){var A=f.samplesPerFrame*9e4/f.sampleRate,x=i+o*A,T={unit:h.subarray(l,l+f.frameLength),pts:x,dts:x};return s.config=[],s.channelCount=f.channelCount,s.samplerate=f.sampleRate,s.samples.push(T),{sample:T,length:f.frameLength,missing:0}}}function R(s,h){var l=s[h+1]>>3&3,i=s[h+1]>>1&3,o=s[h+2]>>4&15,f=s[h+2]>>2&3;if(l!==1&&o!==0&&o!==15&&f!==3){var A=s[h+2]>>1&1,x=s[h+3]>>6,T=l===3?3-i:i===3?3:4,O=N[T*14+o-1]*1e3,S=l===3?0:l===2?1:2,w=M[S*3+f],E=x===3?1:2,_=W[l][i],c=B[i],u=_*8*c,g=Math.floor(_*O/w+A)*c;if(G===null){var b=navigator.userAgent||"",k=b.match(/Chrome\/(\d+)/i);G=k?parseInt(k[1]):0}var I=!!G&&G<=87;return I&&i===2&&O>=224e3&&x===0&&(s[h+3]=s[h+3]|128),{sampleRate:w,channelCount:E,frameLength:g,samplesPerFrame:u}}}function v(s,h){return s[h]===255&&(s[h+1]&224)===224&&(s[h+1]&6)!==0}function m(s,h){return h+1<s.length&&v(s,h)}function p(s,h){var l=4;return v(s,h)&&l<=s.length-h}function d(s,h){if(h+1<s.length&&v(s,h)){var l=4,i=R(s,h),o=l;i!=null&&i.frameLength&&(o=i.frameLength);var f=h+o;return f===s.length||m(s,f)}return!1}},"./src/demux/sample-aes.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/crypt/decrypter.ts"),N=D("./src/demux/tsdemuxer.ts"),M=function(){function W(P,R,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new G.default(P,R,{removePKCS7Padding:!1})}var B=W.prototype;return B.decryptBuffer=function(R,v){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,v)},B.decryptAacSample=function(R,v,m,p){var d=R[v].unit,s=d.subarray(16,d.length-d.length%16),h=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),l=this;this.decryptBuffer(h,function(i){var o=new Uint8Array(i);d.set(o,16),p||l.decryptAacSamples(R,v+1,m)})},B.decryptAacSamples=function(R,v,m){for(;;v++){if(v>=R.length){m();return}if(R[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(R,v,m,p),!p)return}},B.getAvcEncryptedData=function(R){for(var v=Math.floor((R.length-48)/160)*16+16,m=new Int8Array(v),p=0,d=32;d<=R.length-16;d+=160,p+=16)m.set(R.subarray(d,d+16),p);return m},B.getAvcDecryptedUnit=function(R,v){for(var m=new Uint8Array(v),p=0,d=32;d<=R.length-16;d+=160,p+=16)R.set(m.subarray(p,p+16),d);return R},B.decryptAvcSample=function(R,v,m,p,d,s){var h=Object(N.discardEPB)(d.data),l=this.getAvcEncryptedData(h),i=this;this.decryptBuffer(l.buffer,function(o){d.data=i.getAvcDecryptedUnit(h,o),s||i.decryptAvcSamples(R,v,m+1,p)})},B.decryptAvcSamples=function(R,v,m,p){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=R.length){p();return}for(var d=R[v].units;!(m>=d.length);m++){var s=d[m];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(R,v,m,p,s,h),!h)return}}},W}();V.default=M},"./src/demux/transmuxer-interface.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d});var G=D("./node_modules/webworkify-webpack/index.js"),N=D.n(G),M=D("./src/events.ts"),W=D("./src/demux/transmuxer.ts"),B=D("./src/utils/logger.ts"),P=D("./src/errors.ts"),R=D("./src/utils/mediasource-helper.ts"),v=D("./node_modules/eventemitter3/index.js"),m=D.n(v),p=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function s(l,i,o,f){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=i,this.onTransmuxComplete=o,this.onFlush=f;var x=l.config,T=function(_,c){c=c||{},c.frag=A.frag,c.id=A.id,l.trigger(_,c)};this.observer=new v.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,T),this.observer.on(M.Events.ERROR,T);var O={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){B.logger.log("demuxing in webworker");var w;try{w=this.worker=G("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),w.addEventListener("message",this.onwmsg),w.onerror=function(E){l.trigger(M.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},w.postMessage({cmd:"init",typeSupported:O,vendor:S,id:i,config:JSON.stringify(x)})}catch(E){B.logger.warn("Error in worker:",E),B.logger.error("Error while initializing DemuxerWorker, fallback to inline"),w&&self.URL.revokeObjectURL(w.objectURL),this.transmuxer=new W.default(this.observer,O,x,S,i),this.worker=null}}else this.transmuxer=new W.default(this.observer,O,x,S,i)}var h=s.prototype;return h.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var f=this.observer;f&&f.removeAllListeners(),this.observer=null},h.push=function(i,o,f,A,x,T,O,S,w,E){var _=this;w.transmuxing.start=self.performance.now();var c=this.transmuxer,u=this.worker,g=T?T.start:x.start,b=x.decryptdata,k=this.frag,I=!(k&&x.cc===k.cc),F=!(k&&w.level===k.level),U=k?w.sn-k.sn:-1,C=this.part?w.part-this.part.index:1,y=!F&&(U===1||U===0&&C===1),j=self.performance.now();(F||U||x.stats.parsing.start===0)&&(x.stats.parsing.start=j),T&&(C||!y)&&(T.stats.parsing.start=j);var K=new W.TransmuxState(I,y,S,F,g);if(!y||I){B.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+w.sn+" p: "+w.part+" level: "+w.level+" id: "+w.id+`
discontinuity: `+I+`
trackSwitch: `+F+`
contiguous: `+y+`
accurateTimeOffset: `+S+`
timeOffset: `+g);var Q=new W.TransmuxConfig(f,A,o,O,E);this.configureTransmuxer(Q)}if(this.frag=x,this.part=T,u)u.postMessage({cmd:"demux",data:i,decryptdata:b,chunkMeta:w,state:K},i instanceof ArrayBuffer?[i]:[]);else if(c){var te=c.push(i,b,w,K);Object(W.isPromise)(te)?te.then(function(_e){_.handleTransmuxComplete(_e)}):this.handleTransmuxComplete(te)}},h.flush=function(i){var o=this;i.transmuxing.start=self.performance.now();var f=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:i});else if(f){var x=f.flush(i);Object(W.isPromise)(x)?x.then(function(T){o.handleFlushResult(T,i)}):this.handleFlushResult(x,i)}},h.handleFlushResult=function(i,o){var f=this;i.forEach(function(A){f.handleTransmuxComplete(A)}),this.onFlush(o)},h.onWorkerMessage=function(i){var o=i.data,f=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,f.trigger(o.event,o.data);break}}},h.configureTransmuxer=function(i){var o=this.worker,f=this.transmuxer;o?o.postMessage({cmd:"configure",config:i}):f&&f.configure(i)},h.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},s}()},"./src/demux/transmuxer-worker.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return P});var G=D("./src/demux/transmuxer.ts"),N=D("./src/events.ts"),M=D("./src/utils/logger.ts"),W=D("./node_modules/eventemitter3/index.js"),B=D.n(W);function P(d){var s=new W.EventEmitter,h=function(i,o){d.postMessage({event:i,data:o})};s.on(N.Events.FRAG_DECRYPTED,h),s.on(N.Events.ERROR,h),d.addEventListener("message",function(l){var i=l.data;switch(i.cmd){case"init":{var o=JSON.parse(i.config);d.transmuxer=new G.default(s,i.typeSupported,o,i.vendor,i.id),Object(M.enableLogs)(o.debug),h("init",null);break}case"configure":{d.transmuxer.configure(i.config);break}case"demux":{var f=d.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(G.isPromise)(f)?f.then(function(T){R(d,T)}):R(d,f);break}case"flush":{var A=i.chunkMeta,x=d.transmuxer.flush(A);Object(G.isPromise)(x)?x.then(function(T){m(d,T,A)}):m(d,x,A);break}default:break}})}function R(d,s){if(p(s.remuxResult))return;var h=[],l=s.remuxResult,i=l.audio,o=l.video;i&&v(h,i),o&&v(h,o),d.postMessage({event:"transmuxComplete",data:s},h)}function v(d,s){s.data1&&d.push(s.data1.buffer),s.data2&&d.push(s.data2.buffer)}function m(d,s,h){s.forEach(function(l){R(d,l)}),d.postMessage({event:"flush",data:h})}function p(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return o}),D.d(V,"isPromise",function(){return x}),D.d(V,"TransmuxConfig",function(){return T}),D.d(V,"TransmuxState",function(){return O});var G=D("./src/events.ts"),N=D("./src/errors.ts"),M=D("./src/crypt/decrypter.ts"),W=D("./src/demux/aacdemuxer.ts"),B=D("./src/demux/mp4demuxer.ts"),P=D("./src/demux/tsdemuxer.ts"),R=D("./src/demux/mp3demuxer.ts"),v=D("./src/remux/mp4-remuxer.ts"),m=D("./src/remux/passthrough-remuxer.ts"),p=D("./src/demux/chunk-cache.ts"),d=D("./src/utils/mp4-tools.ts"),s=D("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(S){s.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var l=[{demux:P.default,remux:v.default},{demux:B.default,remux:m.default},{demux:W.default,remux:v.default},{demux:R.default,remux:v.default}],i=1024;l.forEach(function(S){var w=S.demux;i=Math.max(i,w.minProbeByteLength)});var o=function(){function S(E,_,c,u,g){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 p.default,this.observer=E,this.typeSupported=_,this.config=c,this.vendor=u,this.id=g}var w=S.prototype;return w.configure=function(_){this.transmuxConfig=_,this.decrypter&&this.decrypter.reset()},w.push=function(_,c,u,g){var b=this,k=u.transmuxing;k.executeStart=h();var I=new Uint8Array(_),F=this.cache,U=this.config,C=this.currentTransmuxState,y=this.transmuxConfig;g&&(this.currentTransmuxState=g);var j=f(I,c);if(j&&j.method==="AES-128"){var K=this.getDecrypter();if(U.enableSoftwareAES){var Q=K.softwareDecrypt(I,j.key.buffer,j.iv.buffer);if(!Q)return k.executeEnd=h(),A(u);I=new Uint8Array(Q)}else return this.decryptionPromise=K.webCryptoDecrypt(I,j.key.buffer,j.iv.buffer).then(function(xe){var Le=b.push(xe,null,u);return b.decryptionPromise=null,Le}),this.decryptionPromise}var te=g||C,_e=te.contiguous,de=te.discontinuity,me=te.trackSwitch,fe=te.accurateTimeOffset,pe=te.timeOffset,ae=y.audioCodec,he=y.videoCodec,$=y.defaultInitPts,ie=y.duration,ee=y.initSegmentData;if((de||me)&&this.resetInitSegment(ee,ae,he,ie),de&&this.resetInitialTimestamp($),_e||this.resetContiguity(),this.needsProbing(I,de,me)){if(F.dataLength){var Ee=F.flush();I=Object(d.appendUint8Array)(Ee,I)}this.configureTransmuxer(I,y)}var we=this.transmux(I,j,pe,fe,u),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,k.executeEnd=h(),we},w.flush=function(_){var c=this,u=_.transmuxing;u.executeStart=h();var g=this.decrypter,b=this.cache,k=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return c.flush(_)});var F=[],U=k.timeOffset;if(g){var C=g.flush();C&&F.push(this.push(C,null,_))}var y=b.dataLength;b.reset();var j=this.demuxer,K=this.remuxer;if(!j||!K)return y>=i&&this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),u.executeEnd=h(),[A(_)];var Q=j.flush(U);return x(Q)?Q.then(function(te){return c.flushRemux(F,te,_),F}):(this.flushRemux(F,Q,_),F)},w.flushRemux=function(_,c,u){var g=c.audioTrack,b=c.avcTrack,k=c.id3Track,I=c.textTrack,F=this.currentTransmuxState,U=F.accurateTimeOffset,C=F.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+u.sn+(u.part>-1?" p: "+u.part:"")+" of level "+u.level);var y=this.remuxer.remux(g,b,k,I,C,U,!0,this.id);_.push({remuxResult:y,chunkMeta:u}),u.transmuxing.executeEnd=h()},w.resetInitialTimestamp=function(_){var c=this.demuxer,u=this.remuxer;if(!c||!u)return;c.resetTimeStamp(_),u.resetTimeStamp(_)},w.resetContiguity=function(){var _=this.demuxer,c=this.remuxer;if(!_||!c)return;_.resetContiguity(),c.resetNextTimestamp()},w.resetInitSegment=function(_,c,u,g){var b=this.demuxer,k=this.remuxer;if(!b||!k)return;b.resetInitSegment(c,u,g),k.resetInitSegment(_,c,u)},w.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},w.transmux=function(_,c,u,g,b){var k;return c&&c.method==="SAMPLE-AES"?k=this.transmuxSampleAes(_,c,u,g,b):k=this.transmuxUnencrypted(_,u,g,b),k},w.transmuxUnencrypted=function(_,c,u,g){var b=this.demuxer.demux(_,c,!1,!this.config.progressive),k=b.audioTrack,I=b.avcTrack,F=b.id3Track,U=b.textTrack,C=this.remuxer.remux(k,I,F,U,c,u,!1,this.id);return{remuxResult:C,chunkMeta:g}},w.transmuxSampleAes=function(_,c,u,g,b){var k=this;return this.demuxer.demuxSampleAes(_,c,u).then(function(I){var F=k.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,u,g,!1,k.id);return{remuxResult:F,chunkMeta:b}})},w.configureTransmuxer=function(_,c){for(var u=this.config,g=this.observer,b=this.typeSupported,k=this.vendor,I=c.audioCodec,F=c.defaultInitPts,U=c.duration,C=c.initSegmentData,y=c.videoCodec,j,K=0,Q=l.length;K<Q;K++)if(l[K].demux.probe(_)){j=l[K];break}j||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),j={demux:B.default,remux:m.default});var te=this.demuxer,_e=this.remuxer,de=j.remux,me=j.demux;(!_e||!(_e instanceof de))&&(this.remuxer=new de(g,u,b,k)),(!te||!(te instanceof me))&&(this.demuxer=new me(g,u,b),this.probe=me.probe),this.resetInitSegment(C,I,y,U),this.resetInitialTimestamp(F)},w.needsProbing=function(_,c,u){return!this.demuxer||!this.remuxer||c||u},w.getDecrypter=function(){var _=this.decrypter;return _||(_=this.decrypter=new M.default(this.observer,this.config)),_},S}();function f(S,w){var E=null;return S.byteLength>0&&w!=null&&w.key!=null&&w.iv!==null&&w.method!=null&&(E=w),E}var A=function(w){return{remuxResult:{},chunkMeta:w}};function x(S){return"then"in S&&S.then instanceof Function}var T=function(w,E,_,c,u){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=w,this.videoCodec=E,this.initSegmentData=_,this.duration=c,this.defaultInitPts=u},O=function(w,E,_,c,u){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=w,this.contiguous=E,this.accurateTimeOffset=_,this.trackSwitch=c,this.timeOffset=u}},"./src/demux/tsdemuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"discardEPB",function(){return A});var G=D("./src/demux/adts.ts"),N=D("./src/demux/mpegaudio.ts"),M=D("./src/demux/exp-golomb.ts"),W=D("./src/demux/id3.ts"),B=D("./src/demux/sample-aes.ts"),P=D("./src/events.ts"),R=D("./src/utils/mp4-tools.ts"),v=D("./src/utils/logger.ts"),m=D("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},d=function(){function x(O,S,w){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=O,this.config=S,this.typeSupported=w}x.probe=function(S){var w=x.syncOffset(S);return w<0?!1:(w&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+w+", junk ahead ?"),!0)},x.syncOffset=function(S){for(var w=Math.min(1e3,S.length-3*188),E=0;E<w;){if(S[E]===71&&S[E+188]===71&&S[E+2*188]===71)return E;E++}return-1},x.createTrack=function(S,w){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:p[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?w:void 0}};var T=x.prototype;return T.resetInitSegment=function(S,w,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",E),this._audioTrack=x.createTrack("audio",E),this._id3Track=x.createTrack("id3",E),this._txtTrack=x.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=S,this.videoCodec=w,this._duration=E},T.resetTimeStamp=function(){},T.resetContiguity=function(){var S=this._audioTrack,w=this._avcTrack,E=this._id3Track;S&&(S.pesData=null),w&&(w.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(S,w,E,_){E===void 0&&(E=!1),_===void 0&&(_=!1),E||(this.sampleAes=null);var c,u=this._avcTrack,g=this._audioTrack,b=this._id3Track,k=u.pid,I=u.pesData,F=g.pid,U=b.pid,C=g.pesData,y=b.pesData,j=!1,K=this.pmtParsed,Q=this._pmtId,te=S.length;if(this.remainderData&&(S=Object(R.appendUint8Array)(this.remainderData,S),te=S.length,this.remainderData=null),te<188&&!_)return this.remainderData=S,{audioTrack:g,avcTrack:u,id3Track:b,textTrack:this._txtTrack};var _e=Math.max(0,x.syncOffset(S));te-=(te+_e)%188,te<S.byteLength&&!_&&(this.remainderData=new Uint8Array(S.buffer,te,S.buffer.byteLength-te));for(var de=_e;de<te;de+=188)if(S[de]===71){var me=!!(S[de+1]&64),fe=((S[de+1]&31)<<8)+S[de+2],pe=(S[de+3]&48)>>4,ae=void 0;if(pe>1){if(ae=de+5+S[de+4],ae===de+188)continue}else ae=de+4;switch(fe){case k:me&&(I&&(c=i(I))&&this.parseAVCPES(c,!1),I={data:[],size:0}),I&&(I.data.push(S.subarray(ae,de+188)),I.size+=de+188-ae);break;case F:me&&(C&&(c=i(C))&&(g.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),C={data:[],size:0}),C&&(C.data.push(S.subarray(ae,de+188)),C.size+=de+188-ae);break;case U:me&&(y&&(c=i(y))&&this.parseID3PES(c),y={data:[],size:0}),y&&(y.data.push(S.subarray(ae,de+188)),y.size+=de+188-ae);break;case 0:me&&(ae+=S[ae]+1),Q=this._pmtId=h(S,ae);break;case Q:{me&&(ae+=S[ae]+1);var he=l(S,ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);k=he.avc,k>0&&(u.pid=k),F=he.audio,F>0&&(g.pid=F,g.isAAC=he.isAAC),U=he.id3,U>0&&(b.pid=U),j&&!K&&(v.logger.log("reparse from beginning"),j=!1,de=_e-188),K=this.pmtParsed=!0;break}case 17:case 8191:break;default:j=!0;break}}else this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});u.pesData=I,g.pesData=C,b.pesData=y;var $={audioTrack:g,avcTrack:u,id3Track:b,textTrack:this._txtTrack};return _&&this.extractRemainingSamples($),$},T.flush=function(){var S=this.remainderData;this.remainderData=null;var w;return S?w=this.demux(S,-1,!1,!0):w={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(w),this.sampleAes?this.decrypt(w,this.sampleAes):w},T.extractRemainingSamples=function(S){var w=S.audioTrack,E=S.avcTrack,_=S.id3Track,c=E.pesData,u=w.pesData,g=_.pesData,b;c&&(b=i(c))?(this.parseAVCPES(b,!0),E.pesData=null):E.pesData=c,u&&(b=i(u))?(w.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),w.pesData=null):(u!=null&&u.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),w.pesData=u),g&&(b=i(g))?(this.parseID3PES(b),_.pesData=null):_.pesData=g},T.demuxSampleAes=function(S,w,E){var _=this.demux(S,E,!0,!this.config.progressive),c=this.sampleAes=new B.default(this.observer,this.config,w);return this.decrypt(_,c)},T.decrypt=function(S,w){return new Promise(function(E){var _=S.audioTrack,c=S.avcTrack;_.samples&&_.isAAC?w.decryptAacSamples(_.samples,0,function(){c.samples?w.decryptAvcSamples(c.samples,0,0,function(){E(S)}):E(S)}):c.samples&&w.decryptAvcSamples(c.samples,0,0,function(){E(S)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(S,w){var E=this,_=this._avcTrack,c=this.parseAVCNALu(S.data),u=!1,g=this.avcSample,b,k=!1;S.data=null,g&&c.length&&!_.audFound&&(o(g,_),g=this.avcSample=s(!1,S.pts,S.dts,"")),c.forEach(function(I){switch(I.type){case 1:{b=!0,g||(g=E.avcSample=s(!0,S.pts,S.dts,"")),u&&(g.debug+="NDR "),g.frame=!0;var F=I.data;if(k&&F.length>4){var U=new M.default(F).readSliceType();(U===2||U===4||U===7||U===9)&&(g.key=!0)}break}case 5:b=!0,g||(g=E.avcSample=s(!0,S.pts,S.dts,"")),u&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{b=!0,u&&g&&(g.debug+="SEI ");var C=new M.default(A(I.data));C.readUByte();for(var y=0,j=0,K=!1,Q=0;!K&&C.bytesAvailable>1;){y=0;do Q=C.readUByte(),y+=Q;while(Q===255);j=0;do Q=C.readUByte(),j+=Q;while(Q===255);if(y===4&&C.bytesAvailable!==0){K=!0;var te=C.readUByte();if(te===181){var _e=C.readUShort();if(_e===49){var de=C.readUInt();if(de===1195456820){var me=C.readUByte();if(me===3){for(var fe=C.readUByte(),pe=C.readUByte(),ae=31&fe,he=[fe,pe],$=0;$<ae;$++)he.push(C.readUByte()),he.push(C.readUByte()),he.push(C.readUByte());f(E._txtTrack.samples,{type:3,pts:S.pts,bytes:he})}}}}}else if(y===5&&C.bytesAvailable!==0){if(K=!0,j>16){for(var ie=[],ee=0;ee<16;ee++)ie.push(C.readUByte().toString(16)),(ee===3||ee===5||ee===7||ee===9)&&ie.push("-");for(var Ee=j-16,we=new Uint8Array(Ee),ye=0;ye<Ee;ye++)we[ye]=C.readUByte();f(E._txtTrack.samples,{pts:S.pts,payloadType:y,uuid:ie.join(""),userData:Object(W.utf8ArrayToStr)(we),userDataBytes:we})}}else if(j<C.bytesAvailable)for(var xe=0;xe<j;xe++)C.readUByte()}break}case 7:if(b=!0,k=!0,u&&g&&(g.debug+="SPS "),!_.sps){var Le=new M.default(I.data),ke=Le.readSPS();_.width=ke.width,_.height=ke.height,_.pixelRatio=ke.pixelRatio,_.sps=[I.data],_.duration=E._duration;for(var Pe=I.data.subarray(1,4),Ae="avc1.",Oe=0;Oe<3;Oe++){var Be=Pe[Oe].toString(16);Be.length<2&&(Be="0"+Be),Ae+=Be}_.codec=Ae}break;case 8:b=!0,u&&g&&(g.debug+="PPS "),_.pps||(_.pps=[I.data]);break;case 9:b=!1,_.audFound=!0,g&&o(g,_),g=E.avcSample=s(!1,S.pts,S.dts,u?"AUD ":"");break;case 12:b=!1;break;default:b=!1,g&&(g.debug+="unknown NAL "+I.type+" ");break}if(g&&b){var Ve=g.units;Ve.push(I)}}),w&&g&&(o(g,_),this.avcSample=null)},T.getLastNalUnit=function(){var S,w=this.avcSample,E;if(!w||w.units.length===0){var _=this._avcTrack.samples;w=_[_.length-1]}if((S=w)!==null&&S!==void 0&&S.units){var c=w.units;E=c[c.length-1]}return E},T.parseAVCNALu=function(S){var w=S.byteLength,E=this._avcTrack,_=E.naluState||0,c=_,u=[],g=0,b,k,I,F=-1,U=0;for(_===-1&&(F=0,U=S[0]&31,_=0,g=1);g<w;){if(b=S[g++],!_){_=b?0:1;continue}if(_===1){_=b?0:2;continue}if(!b)_=3;else if(b===1){if(F>=0){var C={data:S.subarray(F,g-_-1),type:U};u.push(C)}else{var y=this.getLastNalUnit();if(y&&(c&&g<=4-c&&(y.state&&(y.data=y.data.subarray(0,y.data.byteLength-c))),k=g-_-1,k>0)){var j=new Uint8Array(y.data.byteLength+k);j.set(y.data,0),j.set(S.subarray(0,k),y.data.byteLength),y.data=j,y.state=0}}g<w?(I=S[g]&31,F=g,U=I,_=0):_=-1}else _=0}if(F>=0&&_>=0){var K={data:S.subarray(F,w),type:U,state:_};u.push(K)}if(u.length===0){var Q=this.getLastNalUnit();if(Q){var te=new Uint8Array(Q.data.byteLength+S.byteLength);te.set(Q.data,0),te.set(S,Q.data.byteLength),Q.data=te}}return E.naluState=_,u},T.parseAACPES=function(S){var w=0,E=this._audioTrack,_=this.aacOverFlow,c=S.data;if(_){this.aacOverFlow=null;var u=_.sample.unit.byteLength,g=Math.min(_.missing,u),b=u-g;_.sample.unit.set(c.subarray(0,g),b),E.samples.push(_.sample),w=_.missing}var k,I;for(k=w,I=c.length;k<I-1&&!G.isHeader(c,k);k++);if(k!==w){var F,U;if(k<I-1?(F="AAC PES did not start with ADTS header,offset:"+k,U=!1):(F="no ADTS header found in AAC PES",U=!0),v.logger.warn("parsing error:"+F),this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:U,reason:F}),U)return}G.initTrackConfig(E,this.observer,c,k,this.audioCodec);var C;if(S.pts!==void 0)C=S.pts;else if(_){var y=G.getFrameDuration(E.samplerate);C=_.sample.pts+y}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var j=0;k<I;)if(G.isHeader(c,k)){if(k+5<I){var K=G.appendFrame(E,c,k,C,j);if(K)if(K.missing)this.aacOverFlow=K;else{k+=K.length,j++;continue}}break}else k++},T.parseMPEGPES=function(S){var w=S.data,E=w.length,_=0,c=0,u=S.pts;if(u===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<E;)if(N.isHeader(w,c)){var g=N.appendFrame(this._audioTrack,w,c,u,_);if(g)c+=g.length,_++;else break}else c++},T.parseID3PES=function(S){if(S.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(S)},x}();d.minProbeByteLength=188;function s(x,T,O,S){return{key:x,frame:!1,pts:T,dts:O,units:[],debug:S,length:0}}function h(x,T){return(x[T+10]&31)<<8|x[T+11]}function l(x,T,O,S){var w={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(x[T+1]&15)<<8|x[T+2],_=T+3+E-4,c=(x[T+10]&15)<<8|x[T+11];for(T+=12+c;T<_;){var u=(x[T+1]&31)<<8|x[T+2];switch(x[T]){case 207:if(!S){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:w.audio===-1&&(w.audio=u);break;case 21:w.id3===-1&&(w.id3=u);break;case 219:if(!S){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:w.avc===-1&&(w.avc=u);break;case 3:case 4:O?w.audio===-1&&(w.audio=u,w.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((x[T+3]&15)<<8|x[T+4])+5}return w}function i(x){var T=0,O,S,w,E,_,c=x.data;if(!x||x.size===0)return null;for(;c[0].length<19&&c.length>1;){var u=new Uint8Array(c[0].length+c[1].length);u.set(c[0]),u.set(c[1],c[0].length),c[0]=u,c.splice(1,1)}O=c[0];var g=(O[0]<<16)+(O[1]<<8)+O[2];if(g===1){if(S=(O[4]<<8)+O[5],S&&S>x.size-6)return null;var b=O[7];b&192&&(E=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,b&64?(_=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,E-_>60*9e4&&(v.logger.warn(Math.round((E-_)/9e4)+"s delta between PTS and DTS, align them"),E=_)):_=E),w=O[8];var k=w+9;if(x.size<=k)return null;x.size-=k;for(var I=new Uint8Array(x.size),F=0,U=c.length;F<U;F++){O=c[F];var C=O.byteLength;if(k)if(k>C){k-=C;continue}else O=O.subarray(k),C-=k,k=0;I.set(O,T),T+=C}return S&&(S-=w+3),{data:I,pts:E,dts:_,len:S}}return null}function o(x,T){if(x.units.length&&x.frame){if(x.pts===void 0){var O=T.samples,S=O.length;if(S){var w=O[S-1];x.pts=w.pts,x.dts=w.dts}else{T.dropped++;return}}T.samples.push(x)}x.debug.length&&v.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function f(x,T){var O=x.length;if(O>0){if(T.pts>=x[O-1].pts)x.push(T);else for(var S=O-1;S>=0;S--)if(T.pts<x[S].pts){x.splice(S,0,T);break}}else x.push(T)}function A(x){for(var T=x.byteLength,O=[],S=1;S<T-2;)x[S]===0&&x[S+1]===0&&x[S+2]===3?(O.push(S+2),S+=2):S++;if(O.length===0)return x;var w=T-O.length,E=new Uint8Array(w),_=0;for(S=0;S<w;_++,S++)_===O[0]&&(_++,O.shift()),E[S]=x[_];return E}V.default=d},"./src/errors.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"ErrorTypes",function(){return G}),D.d(V,"ErrorDetails",function(){return N});var G;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(G||(G={}));var N;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"Events",function(){return G});var G;(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"})(G||(G={}))},"./src/hls.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return x});var G=D("./node_modules/url-toolkit/src/url-toolkit.js"),N=D.n(G),M=D("./src/loader/playlist-loader.ts"),W=D("./src/loader/key-loader.ts"),B=D("./src/controller/id3-track-controller.ts"),P=D("./src/controller/latency-controller.ts"),R=D("./src/controller/level-controller.ts"),v=D("./src/controller/fragment-tracker.ts"),m=D("./src/controller/stream-controller.ts"),p=D("./src/is-supported.ts"),d=D("./src/utils/logger.ts"),s=D("./src/config.ts"),h=D("./node_modules/eventemitter3/index.js"),l=D.n(h),i=D("./src/events.ts"),o=D("./src/errors.ts");function f(T,O){for(var S=0;S<O.length;S++){var w=O[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(T,w.key,w)}}function A(T,O,S){return O&&f(T.prototype,O),S&&f(T,S),T}var x=function(){T.isSupported=function(){return Object(p.isSupported)()};function T(S){S===void 0&&(S={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.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 w=this.config=Object(s.mergeConfig)(T.DefaultConfig,S);this.userConfig=S,Object(d.enableLogs)(w.debug),this._autoLevelCapping=-1,w.progressive&&Object(s.enableStreamingMode)(w);var E=w.abrController,_=w.bufferController,c=w.capLevelController,u=w.fpsController,g=this.abrController=new E(this),b=this.bufferController=new _(this),k=this.capLevelController=new c(this),I=new u(this),F=new M.default(this),U=new W.default(this),C=new B.default(this),y=this.levelController=new R.default(this),j=new v.FragmentTracker(this),K=this.streamController=new m.default(this,j);k.setStreamController(K),I.setStreamController(K);var Q=[y,K];this.networkControllers=Q;var te=[F,U,g,b,k,I,C,j];this.audioTrackController=this.createController(w.audioTrackController,null,Q),this.createController(w.audioStreamController,j,Q),this.subtitleTrackController=this.createController(w.subtitleTrackController,null,Q),this.createController(w.subtitleStreamController,j,Q),this.createController(w.timelineController,null,te),this.emeController=this.createController(w.emeController,null,te),this.cmcdController=this.createController(w.cmcdController,null,te),this.latencyController=this.createController(P.default,null,te),this.coreComponents=te}var O=T.prototype;return O.createController=function(w,E,_){if(w){var c=E?new w(this,E):new w(this);return _&&_.push(c),c}return null},O.on=function(w,E,_){_===void 0&&(_=this),this._emitter.on(w,E,_)},O.once=function(w,E,_){_===void 0&&(_=this),this._emitter.once(w,E,_)},O.removeAllListeners=function(w){this._emitter.removeAllListeners(w)},O.off=function(w,E,_,c){_===void 0&&(_=this),this._emitter.off(w,E,_,c)},O.listeners=function(w){return this._emitter.listeners(w)},O.emit=function(w,E,_){return this._emitter.emit(w,E,_)},O.trigger=function(w,E){if(this.config.debug)return this.emit(w,w,E);try{return this.emit(w,w,E)}catch(_){d.logger.error("An internal error happened while handling event "+w+'. Error message: "'+_.message+'". Here is a stacktrace:',_),this.trigger(i.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:w,error:_})}return!1},O.listenerCount=function(w){return this._emitter.listenerCount(w)},O.destroy=function(){d.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(w){return w.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(w){return w.destroy()}),this.coreComponents.length=0},O.attachMedia=function(w){d.logger.log("attachMedia"),this._media=w,this.trigger(i.Events.MEDIA_ATTACHING,{media:w})},O.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(w){this.stopLoad();var E=this.media,_=this.url,c=this.url=G.buildAbsoluteURL(self.location.href,w,{alwaysNormalize:!0});d.logger.log("loadSource:"+c),E&&_&&_!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(i.Events.MANIFEST_LOADING,{url:w})},O.startLoad=function(w){w===void 0&&(w=-1),d.logger.log("startLoad("+w+")"),this.networkControllers.forEach(function(E){E.startLoad(w)})},O.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach(function(w){w.stopLoad()})},O.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){d.logger.log("recoverMediaError");var w=this._media;this.detachMedia(),w&&this.attachMedia(w)},O.removeLevel=function(w,E){E===void 0&&(E=0),this.levelController.removeLevel(w,E)},A(T,[{key:"levels",get:function(){var w=this.levelController.levels;return w||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(w){d.logger.log("set currentLevel:"+w),this.loadLevel=w,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(w){d.logger.log("set nextLevel:"+w),this.levelController.manualLevel=w,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(w){d.logger.log("set loadLevel:"+w),this.levelController.manualLevel=w}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(w){this.levelController.nextLoadLevel=w}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(w){d.logger.log("set firstLevel:"+w),this.levelController.firstLevel=w}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(w){d.logger.log("set startLevel:"+w),w!==-1&&(w=Math.max(w,this.minAutoLevel)),this.levelController.startLevel=w}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(w){var E=!!w;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(w){this._autoLevelCapping!==w&&(d.logger.log("set autoLevelCapping:"+w),this._autoLevelCapping=w)}},{key:"bandwidthEstimate",get:function(){var w=this.abrController.bwEstimator;return w?w.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var w=this.levels,E=this.config.minAutoBitrate;if(!w)return 0;for(var _=w.length,c=0;c<_;c++)if(w[c].maxBitrate>E)return c;return 0}},{key:"maxAutoLevel",get:function(){var w=this.levels,E=this.autoLevelCapping,_;return E===-1&&w&&w.length?_=w.length-1:_=E,_}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(w){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,w)}},{key:"audioTracks",get:function(){var w=this.audioTrackController;return w?w.audioTracks:[]}},{key:"audioTrack",get:function(){var w=this.audioTrackController;return w?w.audioTrack:-1},set:function(w){var E=this.audioTrackController;E&&(E.audioTrack=w)}},{key:"subtitleTracks",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTrack:-1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleTrack=w)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var w=this.subtitleTrackController;return w?w.subtitleDisplay:!1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=w)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(w){this.config.lowLatencyMode=w}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:s.hlsDefaultConfig},set:function(w){T.defaultConfig=w}}]),T}();x.defaultConfig=void 0},"./src/is-supported.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"isSupported",function(){return M}),D.d(V,"changeTypeSupported",function(){return W});var G=D("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var B=Object(G.getMediaSource)();if(!B)return!1;var P=N(),R=B&&typeof B.isTypeSupported=="function"&&B.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!P||P.prototype&&typeof P.prototype.appendBuffer=="function"&&typeof P.prototype.remove=="function";return!!R&&!!v}function W(){var B,P=N();return typeof(P==null||((B=P.prototype)===null||B===void 0)?void 0:B.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return d}),D.d(V,"LoadError",function(){return h});var G=D("./src/polyfills/number.ts"),N=D("./src/errors.ts");function M(l,i){l.prototype=Object.create(i.prototype),l.prototype.constructor=l,v(l,i)}function W(l){var i=typeof Map=="function"?new Map:void 0;return W=function(f){if(f===null||!R(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(f))return i.get(f);i.set(f,A)}function A(){return B(f,arguments,m(this).constructor)}return A.prototype=Object.create(f.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),v(A,f)},W(l)}function B(l,i,o){return P()?B=Reflect.construct:B=function(A,x,T){var O=[null];O.push.apply(O,x);var S=Function.bind.apply(A,O),w=new S;return T&&v(w,T.prototype),w},B.apply(null,arguments)}function P(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function R(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function v(l,i){return v=Object.setPrototypeOf||function(f,A){return f.__proto__=A,f},v(l,i)}function m(l){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},m(l)}var p=Math.pow(2,17),d=function(){function l(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var i=l.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(f,A){var x=this,T=f.url;if(!T)return Promise.reject(new h({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var O=this.config,S=O.fLoader,w=O.loader;return new Promise(function(E,_){x.loader&&x.loader.destroy();var c=x.loader=f.loader=S?new S(O):new w(O),u=s(f),g={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:p};f.stats=c.stats,c.load(u,g,{onSuccess:function(k,I,F,U){x.resetLoader(f,c),E({frag:f,part:null,payload:k.data,networkDetails:U})},onError:function(k,I,F){x.resetLoader(f,c),_(new h({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:k,networkDetails:F}))},onAbort:function(k,I,F){x.resetLoader(f,c),_(new h({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:F}))},onTimeout:function(k,I,F){x.resetLoader(f,c),_(new h({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:F}))},onProgress:function(k,I,F,U){A&&A({frag:f,part:null,payload:F,networkDetails:U})}})})},i.loadPart=function(f,A,x){var T=this;this.abort();var O=this.config,S=O.fLoader,w=O.loader;return new Promise(function(E,_){T.loader&&T.loader.destroy();var c=T.loader=f.loader=S?new S(O):new w(O),u=s(f,A),g={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:p};A.stats=c.stats,c.load(u,g,{onSuccess:function(k,I,F,U){T.resetLoader(f,c),T.updateStatsFromPart(f,A);var C={frag:f,part:A,payload:k.data,networkDetails:U};x(C),E(C)},onError:function(k,I,F){T.resetLoader(f,c),_(new h({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:A,response:k,networkDetails:F}))},onAbort:function(k,I,F){f.stats.aborted=A.stats.aborted,T.resetLoader(f,c),_(new h({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:A,networkDetails:F}))},onTimeout:function(k,I,F){T.resetLoader(f,c),_(new h({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:A,networkDetails:F}))}})})},i.updateStatsFromPart=function(f,A){var x=f.stats,T=A.stats,O=T.total;if(x.loaded+=T.loaded,O){var S=Math.round(f.duration/A.duration),w=Math.min(Math.round(x.loaded/O),S),E=S-w,_=E*Math.round(x.loaded/w);x.total=x.loaded+_}else x.total=Math.max(x.loaded,x.total);var c=x.loading,u=T.loading;c.start?c.first+=u.first-u.start:(c.start=u.start,c.first=u.first),c.end=u.end},i.resetLoader=function(f,A){f.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},l}();function s(l,i){i===void 0&&(i=null);var o=i||l,f={frag:l,part:i,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},A=o.byteRangeStartOffset,x=o.byteRangeEndOffset;return Object(G.isFiniteNumber)(A)&&Object(G.isFiniteNumber)(x)&&(f.rangeStart=A,f.rangeEnd=x),f}var h=function(l){M(i,l);function i(o){for(var f,A=arguments.length,x=new Array(A>1?A-1:0),T=1;T<A;T++)x[T-1]=arguments[T];return f=l.call.apply(l,[this].concat(x))||this,f.data=void 0,f.data=o,f}return i}(W(Error))},"./src/loader/fragment.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"ElementaryStreamTypes",function(){return d}),D.d(V,"BaseSegment",function(){return s}),D.d(V,"Fragment",function(){return h}),D.d(V,"Part",function(){return l});var G=D("./src/polyfills/number.ts"),N=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(N),W=D("./src/utils/logger.ts"),B=D("./src/loader/level-key.ts"),P=D("./src/loader/load-stats.ts");function R(i,o){i.prototype=Object.create(o.prototype),i.prototype.constructor=i,v(i,o)}function v(i,o){return v=Object.setPrototypeOf||function(A,x){return A.__proto__=x,A},v(i,o)}function m(i,o){for(var f=0;f<o.length;f++){var A=o[f];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(i,A.key,A)}}function p(i,o,f){return o&&m(i.prototype,o),f&&m(i,f),i}var d;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(d||(d={}));var s=function(){function i(f){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[d.AUDIO]=null,A[d.VIDEO]=null,A[d.AUDIOVIDEO]=null,A),this.baseurl=f}var o=i.prototype;return o.setByteRange=function(A,x){var T=A.split("@",2),O=[];T.length===1?O[0]=x?x.byteRangeEndOffset:0:O[0]=parseInt(T[1]),O[1]=parseInt(T[0])+O[0],this._byteRange=O},p(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),i}(),h=function(i){R(o,i);function o(A,x){var T;return T=i.call(this,x)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new P.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=A,T}var f=o.prototype;return f.createInitializationVector=function(x){for(var T=new Uint8Array(16),O=12;O<16;O++)T[O]=x>>8*(15-O)&255;return T},f.setDecryptDataFromLevelKey=function(x,T){var O=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(O=B.LevelKey.fromURI(x.uri),O.method=x.method,O.iv=this.createInitializationVector(T),O.keyFormat="identity"),O},f.setElementaryStreamInfo=function(x,T,O,S,w,E){E===void 0&&(E=!1);var _=this.elementaryStreams,c=_[x];if(!c){_[x]={startPTS:T,endPTS:O,startDTS:S,endDTS:w,partial:E};return}c.startPTS=Math.min(c.startPTS,T),c.endPTS=Math.max(c.endPTS,O),c.startDTS=Math.min(c.startDTS,S),c.endDTS=Math.max(c.endDTS,w)},f.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[d.AUDIO]=null,x[d.VIDEO]=null,x[d.AUDIOVIDEO]=null},p(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(G.isFiniteNumber)(this.programDateTime))return null;var x=Object(G.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),o}(s),l=function(i){R(o,i);function o(f,A,x,T,O){var S;S=i.call(this,x)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new P.LoadStats,S.duration=f.decimalFloatingPoint("DURATION"),S.gap=f.bool("GAP"),S.independent=f.bool("INDEPENDENT"),S.relurl=f.enumeratedString("URI"),S.fragment=A,S.index=T;var w=f.enumeratedString("BYTERANGE");return w&&S.setByteRange(w,O),O&&(S.fragOffset=O.fragOffset+O.duration),S}return p(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),o}(s)},"./src/loader/key-loader.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return W});var G=D("./src/events.ts"),N=D("./src/errors.ts"),M=D("./src/utils/logger.ts"),W=function(){function B(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var P=B.prototype;return P._registerListeners=function(){this.hls.on(G.Events.KEY_LOADING,this.onKeyLoading,this)},P._unregisterListeners=function(){this.hls.off(G.Events.KEY_LOADING,this.onKeyLoading)},P.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},P.onKeyLoading=function(v,m){var p=m.frag,d=p.type,s=this.loaders[d];if(!p.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=p.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(s&&(M.logger.warn("abort previous key loader for type:"+d),s.abort()),!h){M.logger.warn("key uri is falsy");return}var i=l.loader,o=p.loader=this.loaders[d]=new i(l);this.decrypturl=h,this.decryptkey=null;var f={url:h,frag:p,responseType:"arraybuffer"},A={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(f,A,x)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:p}))},P.loadsuccess=function(v,m,p){var d=p.frag;if(!d.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(v.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:d})},P.loaderror=function(v,m){var p=m.frag,d=p.loader;d&&d.abort(),delete this.loaders[p.type],this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},P.loadtimeout=function(v,m){var p=m.frag,d=p.loader;d&&d.abort(),delete this.loaders[p.type],this.hls.trigger(G.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},B}()},"./src/loader/level-details.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"LevelDetails",function(){return B});var G=D("./src/polyfills/number.ts");function N(P,R){for(var v=0;v<R.length;v++){var m=R[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function M(P,R,v){return R&&N(P.prototype,R),v&&N(P,v),P}var W=10,B=function(){function P(v){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=v}var R=P.prototype;return R.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,d=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!d||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},M(P,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(G.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.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 m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),P}()},"./src/loader/level-key.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"LevelKey",function(){return B});var G=D("./node_modules/url-toolkit/src/url-toolkit.js"),N=D.n(G);function M(P,R){for(var v=0;v<R.length;v++){var m=R[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function W(P,R,v){return R&&M(P.prototype,R),v&&M(P,v),P}var B=function(){P.fromURL=function(v,m){return new P(v,m)},P.fromURI=function(v){return new P(v)};function P(R,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(G.buildAbsoluteURL)(R,v,{alwaysNormalize:!0}):this._uri=R}return W(P,[{key:"uri",get:function(){return this._uri}}]),P}()},"./src/loader/load-stats.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"LoadStats",function(){return G});var G=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(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return o});var G=D("./src/polyfills/number.ts"),N=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(N),W=D("./src/loader/fragment.ts"),B=D("./src/loader/level-details.ts"),P=D("./src/loader/level-key.ts"),R=D("./src/utils/attr-list.ts"),v=D("./src/utils/logger.ts"),m=D("./src/utils/codecs.ts"),p=/#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"),h=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function i(O){var S,w;return l.test((S=(w=N.parseURL(O))===null||w===void 0?void 0:w.path)!=null?S:"")}var o=function(){function O(){}return O.findGroup=function(w,E){for(var _=0;_<w.length;_++){var c=w[_];if(c.id===E)return c}},O.convertAVC1ToAVCOTI=function(w){var E=w.split(".");if(E.length>2){var _=E.shift()+".";return _+=parseInt(E.shift()).toString(16),_+=("000"+parseInt(E.shift()).toString(16)).substr(-4),_}return w},O.resolve=function(w,E){return N.buildAbsoluteURL(E,w,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(w,E){var _=[],c={},u=!1;p.lastIndex=0;for(var g;(g=p.exec(w))!=null;)if(g[1]){var b=new R.AttrList(g[1]),k={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:O.resolve(g[2],E)},I=b.decimalResolution("RESOLUTION");I&&(k.width=I.width,k.height=I.height),f((b.CODECS||"").split(/[ ,]+/).filter(function(U){return U}),k),k.videoCodec&&k.videoCodec.indexOf("avc1")!==-1&&(k.videoCodec=O.convertAVC1ToAVCOTI(k.videoCodec)),_.push(k)}else if(g[3]){var F=new R.AttrList(g[3]);F["DATA-ID"]&&(u=!0,c[F["DATA-ID"]]=F)}return{levels:_,sessionData:u?c:null}},O.parseMasterPlaylistMedia=function(w,E,_,c){c===void 0&&(c=[]);var u,g=[],b=0;for(d.lastIndex=0;(u=d.exec(w))!==null;){var k=new R.AttrList(u[1]);if(k.TYPE===_){var I={attrs:k,bitrate:0,id:b++,groupId:k["GROUP-ID"],instreamId:k["INSTREAM-ID"],name:k.NAME||k.LANGUAGE||"",type:_,default:k.bool("DEFAULT"),autoselect:k.bool("AUTOSELECT"),forced:k.bool("FORCED"),lang:k.LANGUAGE,url:k.URI?O.resolve(k.URI,E):""};if(c.length){var F=O.findGroup(c,I.groupId)||c[0];A(I,F,"audioCodec"),A(I,F,"textCodec")}g.push(I)}}return g},O.parseLevelPlaylist=function(w,E,_,c,u){var g=new B.LevelDetails(E),b=g.fragments,k=null,I=0,F=0,U=0,C=0,y=null,j=new W.Fragment(c,E),K,Q,te,_e=-1,de=!1;for(s.lastIndex=0,g.m3u8=w;(K=s.exec(w))!==null;){de&&(de=!1,j=new W.Fragment(c,E),j.start=U,j.sn=I,j.cc=C,j.level=_,k&&(j.initSegment=k,j.rawProgramDateTime=k.rawProgramDateTime));var me=K[1];if(me){j.duration=parseFloat(me);var fe=(" "+K[2]).slice(1);j.title=fe||null,j.tagList.push(fe?["INF",me,fe]:["INF",me])}else if(K[3])Object(G.isFiniteNumber)(j.duration)&&(j.start=U,te&&(j.levelkey=te),j.sn=I,j.level=_,j.cc=C,j.urlId=u,b.push(j),j.relurl=(" "+K[3]).slice(1),T(j,y),y=j,U+=j.duration,I++,F=0,de=!0);else if(K[4]){var pe=(" "+K[4]).slice(1);y?j.setByteRange(pe,y):j.setByteRange(pe)}else if(K[5])j.rawProgramDateTime=(" "+K[5]).slice(1),j.tagList.push(["PROGRAM-DATE-TIME",j.rawProgramDateTime]),_e===-1&&(_e=b.length);else{if(K=K[0].match(h),!K){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(Q=1;Q<K.length&&!(typeof K[Q]!="undefined");Q++);var ae=(" "+K[Q]).slice(1),he=(" "+K[Q+1]).slice(1),$=K[Q+2]?(" "+K[Q+2]).slice(1):"";switch(ae){case"PLAYLIST-TYPE":g.type=he.toUpperCase();break;case"MEDIA-SEQUENCE":I=g.startSN=parseInt(he);break;case"SKIP":{var ie=new R.AttrList(he),ee=ie.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)(ee)){g.skippedSegments=ee;for(var Ee=ee;Ee--;)b.unshift(null);I+=ee}var we=ie.enumeratedString("RECENTLY-REMOVED-DATERANGES");we&&(g.recentlyRemovedDateranges=we.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(he);break;case"VERSION":g.version=parseInt(he);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(he||$)&&j.tagList.push($?[he,$]:[he]);break;case"DIS":C++;case"GAP":j.tagList.push([ae]);break;case"BITRATE":j.tagList.push([ae,he]);break;case"DISCONTINUITY-SEQ":C=parseInt(he);break;case"KEY":{var ye,xe=new R.AttrList(he),Le=xe.enumeratedString("METHOD"),ke=xe.URI,Pe=xe.hexadecimalInteger("IV"),Ae=xe.enumeratedString("KEYFORMATVERSIONS"),Oe=xe.enumeratedString("KEYID"),Be=(ye=xe.enumeratedString("KEYFORMAT"))!=null?ye:"identity",Ve=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ve.indexOf(Be)>-1){v.logger.warn("Keyformat "+Be+" is not supported from the manifest");continue}else if(Be!=="identity")continue;Le&&(te=P.LevelKey.fromURL(E,ke),ke&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Le)>=0&&(te.method=Le,te.keyFormat=Be,Oe&&(te.keyID=Oe),Ae&&(te.keyFormatVersions=Ae),te.iv=Pe));break}case"START":{var ze=new R.AttrList(he),je=ze.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(je)&&(g.startTimeOffset=je);break}case"MAP":{var et=new R.AttrList(he);j.relurl=et.URI,et.BYTERANGE&&j.setByteRange(et.BYTERANGE),j.level=_,j.sn="initSegment",te&&(j.levelkey=te),j.initSegment=null,k=j,de=!0;break}case"SERVER-CONTROL":{var Xe=new R.AttrList(he);g.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var $e=new R.AttrList(he);g.partTarget=$e.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=g.partList;Ce||(Ce=g.partList=[]);var qe=F>0?Ce[Ce.length-1]:void 0,Ke=F++,Se=new W.Part(new R.AttrList(he),j,E,Ke,qe);Ce.push(Se),j.duration+=Se.duration;break}case"PRELOAD-HINT":{var Me=new R.AttrList(he);g.preloadHint=Me;break}case"RENDITION-REPORT":{var ve=new R.AttrList(he);g.renditionReports=g.renditionReports||[],g.renditionReports.push(ve);break}default:v.logger.warn("line parsed but not handled: "+K);break}}}y&&!y.relurl?(b.pop(),U-=y.duration,g.partList&&(g.fragmentHint=y)):g.partList&&(T(j,y),j.cc=C,g.fragmentHint=j);var le=b.length,ue=b[0],J=b[le-1];if(U+=g.skippedSegments*g.targetduration,U>0&&le&&J){g.averagetargetduration=U/le;var q=J.sn;g.endSN=q!=="initSegment"?q:0,ue&&(g.startCC=ue.cc,ue.initSegment||g.fragments.every(function(re){return re.relurl&&i(re.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),j=new W.Fragment(c,E),j.relurl=J.relurl,j.level=_,j.sn="initSegment",ue.initSegment=j,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(U+=g.fragmentHint.duration),g.totalduration=U,g.endCC=C,_e>0&&x(b,_e),g},O}();function f(O,S){["video","audio","text"].forEach(function(w){var E=O.filter(function(c){return Object(m.isCodecType)(c,w)});if(E.length){var _=E.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});S[w+"Codec"]=_.length>0?_[0]:E[0],O=O.filter(function(c){return E.indexOf(c)===-1})}}),S.unknownCodecs=O}function A(O,S,w){var E=S[w];E&&(O[w]=E)}function x(O,S){for(var w=O[S],E=S;E--;){var _=O[E];if(!_)return;_.programDateTime=w.programDateTime-_.duration*1e3,w=_}}function T(O,S){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):S!=null&&S.programDateTime&&(O.programDateTime=S.endProgramDateTime),Object(G.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),M=D("./src/errors.ts"),W=D("./src/utils/logger.ts"),B=D("./src/utils/mp4-tools.ts"),P=D("./src/loader/m3u8-parser.ts"),R=D("./src/types/loader.ts"),v=D("./src/utils/attr-list.ts");function m(s){var h=s.type;switch(h){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function p(s,h){var l=s.url;return(l===void 0||l.indexOf("data:")===0)&&(l=h.url),l}var d=function(){function s(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var h=s.prototype;return h.registerListeners=function(){var i=this.hls;i.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var i=this.hls;i.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(i){var o=this.hls.config,f=o.pLoader,A=o.loader,x=f||A,T=new x(o);return i.loader=T,this.loaders[i.type]=T,T},h.getInternalLoader=function(i){return this.loaders[i.type]},h.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},h.destroyInternalLoaders=function(){for(var i in this.loaders){var o=this.loaders[i];o&&o.destroy(),this.resetInternalLoader(i)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(i,o){var f=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},h.onLevelLoading=function(i,o){var f=o.id,A=o.level,x=o.url,T=o.deliveryDirectives;this.load({id:f,groupId:null,level:A,responseType:"text",type:R.PlaylistContextType.LEVEL,url:x,deliveryDirectives:T})},h.onAudioTrackLoading=function(i,o){var f=o.id,A=o.groupId,x=o.url,T=o.deliveryDirectives;this.load({id:f,groupId:A,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:T})},h.onSubtitleTrackLoading=function(i,o){var f=o.id,A=o.groupId,x=o.url,T=o.deliveryDirectives;this.load({id:f,groupId:A,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:T})},h.load=function(i){var o,f=this.hls.config,A=this.getInternalLoader(i);if(A){var x=A.context;if(x&&x.url===i.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),A.abort()}var T,O,S,w;switch(i.type){case R.PlaylistContextType.MANIFEST:T=f.manifestLoadingMaxRetry,O=f.manifestLoadingTimeOut,S=f.manifestLoadingRetryDelay,w=f.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:T=0,O=f.levelLoadingTimeOut;break;default:T=f.levelLoadingMaxRetry,O=f.levelLoadingTimeOut,S=f.levelLoadingRetryDelay,w=f.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(i),(o=i.deliveryDirectives)!==null&&o!==void 0&&o.part){var E;if(i.type===R.PlaylistContextType.LEVEL&&i.level!==null?E=this.hls.levels[i.level].details:i.type===R.PlaylistContextType.AUDIO_TRACK&&i.id!==null?E=this.hls.audioTracks[i.id].details:i.type===R.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(E=this.hls.subtitleTracks[i.id].details),E){var _=E.partTarget,c=E.targetduration;_&&c&&(O=Math.min(Math.max(_*3,c*.8)*1e3,O))}}var u={timeout:O,maxRetry:T,retryDelay:S,maxRetryDelay:w,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(i,u,g)},h.loadsuccess=function(i,o,f,A){if(A===void 0&&(A=null),f.isSidxRequest){this.handleSidxRequest(i,f),this.handlePlaylistLoaded(i,o,f,A);return}this.resetInternalLoader(f.type);var x=i.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,f,"no EXTM3U delimiter",A);return}o.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,o,f,A):this.handleMasterPlaylist(i,o,f,A)},h.loaderror=function(i,o,f){f===void 0&&(f=null),this.handleNetworkError(o,f,!1,i)},h.loadtimeout=function(i,o,f){f===void 0&&(f=null),this.handleNetworkError(o,f,!0)},h.handleMasterPlaylist=function(i,o,f,A){var x=this.hls,T=i.data,O=p(i,f),S=P.default.parseMasterPlaylist(T,O),w=S.levels,E=S.sessionData;if(!w.length){this.handleManifestParsingError(i,f,"no level found in manifest",A);return}var _=w.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),c=w.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),u=P.default.parseMasterPlaylistMedia(T,O,"AUDIO",_),g=P.default.parseMasterPlaylistMedia(T,O,"SUBTITLES",c),b=P.default.parseMasterPlaylistMedia(T,O,"CLOSED-CAPTIONS");if(u.length){var k=u.some(function(I){return!I.url});!k&&w[0].audioCodec&&!w[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),u.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}x.trigger(N.Events.MANIFEST_LOADED,{levels:w,audioTracks:u,subtitles:g,captions:b,url:O,stats:o,networkDetails:A,sessionData:E})},h.handleTrackOrLevelPlaylist=function(i,o,f,A){var x=this.hls,T=f.id,O=f.level,S=f.type,w=p(i,f),E=Object(G.isFiniteNumber)(T)?T:0,_=Object(G.isFiniteNumber)(O)?O:E,c=m(f),u=P.default.parseLevelPlaylist(i.data,w,_,c,E);if(!u.fragments.length){x.trigger(N.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:w,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(S===R.PlaylistContextType.MANIFEST){var g={attrs:new v.AttrList({}),bitrate:0,details:u,name:"",url:w};x.trigger(N.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:w,stats:o,networkDetails:A,sessionData:null})}if(o.parsing.end=performance.now(),u.needSidxRanges){var b,k=(b=u.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:k,isSidxRequest:!0,type:S,level:O,levelDetails:u,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=u,this.handlePlaylistLoaded(i,o,f,A)},h.handleSidxRequest=function(i,o){var f=Object(B.parseSegmentIndex)(new Uint8Array(i.data));if(!f)return;var A=f.references,x=o.levelDetails;A.forEach(function(T,O){var S=T.info,w=x.fragments[O];w.byteRange.length===0&&w.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),w.initSegment&&w.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(i,o,f,A){this.hls.trigger(N.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===R.PlaylistContextType.MANIFEST,url:i.url,reason:f,response:i,context:o,networkDetails:A})},h.handleNetworkError=function(i,o,f,A){f===void 0&&(f=!1),W.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var x=M.ErrorDetails.UNKNOWN,T=!1,O=this.getInternalLoader(i);switch(i.type){case R.PlaylistContextType.MANIFEST:x=f?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case R.PlaylistContextType.LEVEL:x=f?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case R.PlaylistContextType.AUDIO_TRACK:x=f?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:x=f?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}O&&this.resetInternalLoader(i.type);var S={type:M.ErrorTypes.NETWORK_ERROR,details:x,fatal:T,url:i.url,loader:O,context:i,networkDetails:o};A&&(S.response=A),this.hls.trigger(N.Events.ERROR,S)},h.handlePlaylistLoaded=function(i,o,f,A){var x=f.type,T=f.level,O=f.id,S=f.groupId,w=f.loader,E=f.levelDetails,_=f.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(i,f,"invalid target duration",A);return}if(!w)return;E.live&&(w.getCacheAge&&(E.ageHeader=w.getCacheAge()||0),(!w.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(x){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:E,level:T||0,id:O||0,stats:o,networkDetails:A,deliveryDirectives:_});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:E,id:O||0,groupId:S||"",stats:o,networkDetails:A,deliveryDirectives:_});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:E,id:O||0,groupId:S||"",stats:o,networkDetails:A,deliveryDirectives:_});break}},s}();V.default=d},"./src/polyfills/number.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"isFiniteNumber",function(){return G}),D.d(V,"MAX_SAFE_INTEGER",function(){return N});var G=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,V,D){"use strict";D.r(V);var G=function(){function N(){}return N.getSilentFrame=function(W,B){switch(W){case"mp4a.40.2":if(B===1)return new Uint8Array([0,200,0,128,35,128]);if(B===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(B===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(B===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(B===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(B===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(B===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(B===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(B===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}();V.default=G},"./src/remux/mp4-generator.ts":function(ne,V,D){"use strict";D.r(V);var G=Math.pow(2,32)-1,N=function(){function M(){}return M.init=function(){M.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 B;for(B in M.types)M.types.hasOwnProperty(B)&&(M.types[B]=[B.charCodeAt(0),B.charCodeAt(1),B.charCodeAt(2),B.charCodeAt(3)]);var P=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]),R=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]);M.HDLR_TYPES={video:P,audio:R};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=m,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,p,s,p,d),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,v))},M.box=function(B){for(var P=8,R=arguments.length,v=new Array(R>1?R-1:0),m=1;m<R;m++)v[m-1]=arguments[m];for(var p=v.length,d=p;p--;)P+=v[p].byteLength;var s=new Uint8Array(P);for(s[0]=P>>24&255,s[1]=P>>16&255,s[2]=P>>8&255,s[3]=P&255,s.set(B,4),p=0,P=8;p<d;p++)s.set(v[p],P),P+=v[p].byteLength;return s},M.hdlr=function(B){return M.box(M.types.hdlr,M.HDLR_TYPES[B])},M.mdat=function(B){return M.box(M.types.mdat,B)},M.mdhd=function(B,P){P*=B;var R=Math.floor(P/(G+1)),v=Math.floor(P%(G+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},M.mdia=function(B){return M.box(M.types.mdia,M.mdhd(B.timescale,B.duration),M.hdlr(B.type),M.minf(B))},M.mfhd=function(B){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,B>>24,B>>16&255,B>>8&255,B&255]))},M.minf=function(B){return B.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(B)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(B))},M.moof=function(B,P,R){return M.box(M.types.moof,M.mfhd(B),M.traf(R,P))},M.moov=function(B){for(var P=B.length,R=[];P--;)R[P]=M.trak(B[P]);return M.box.apply(null,[M.types.moov,M.mvhd(B[0].timescale,B[0].duration)].concat(R).concat(M.mvex(B)))},M.mvex=function(B){for(var P=B.length,R=[];P--;)R[P]=M.trex(B[P]);return M.box.apply(null,[M.types.mvex].concat(R))},M.mvhd=function(B,P){P*=B;var R=Math.floor(P/(G+1)),v=Math.floor(P%(G+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,m)},M.sdtp=function(B){var P=B.samples||[],R=new Uint8Array(4+P.length),v,m;for(v=0;v<P.length;v++)m=P[v].flags,R[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return M.box(M.types.sdtp,R)},M.stbl=function(B){return M.box(M.types.stbl,M.stsd(B),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(B){var P=[],R=[],v,m,p;for(v=0;v<B.sps.length;v++)m=B.sps[v],p=m.byteLength,P.push(p>>>8&255),P.push(p&255),P=P.concat(Array.prototype.slice.call(m));for(v=0;v<B.pps.length;v++)m=B.pps[v],p=m.byteLength,R.push(p>>>8&255),R.push(p&255),R=R.concat(Array.prototype.slice.call(m));var d=M.box(M.types.avcC,new Uint8Array([1,P[3],P[4],P[5],252|3,224|B.sps.length].concat(P).concat([B.pps.length]).concat(R))),s=B.width,h=B.height,l=B.pixelRatio[0],i=B.pixelRatio[1];return M.box(M.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,h>>8&255,h&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,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,i>>24,i>>16&255,i>>8&255,i&255])))},M.esds=function(B){var P=B.config.length;return new Uint8Array([0,0,0,0,3,23+P,0,1,0,4,15+P,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([P]).concat(B.config).concat([6,1,2]))},M.mp4a=function(B){var P=B.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]),M.box(M.types.esds,M.esds(B)))},M.mp3=function(B){var P=B.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]))},M.stsd=function(B){return B.type==="audio"?!B.isAAC&&B.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(B)):M.box(M.types.stsd,M.STSD,M.mp4a(B)):M.box(M.types.stsd,M.STSD,M.avc1(B))},M.tkhd=function(B){var P=B.id,R=B.duration*B.timescale,v=B.width,m=B.height,p=Math.floor(R/(G+1)),d=Math.floor(R%(G+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&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,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},M.traf=function(B,P){var R=M.sdtp(B),v=B.id,m=Math.floor(P/(G+1)),p=Math.floor(P%(G+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),M.trun(B,R.length+16+20+8+16+8+8),R)},M.trak=function(B){return B.duration=B.duration||4294967295,M.box(M.types.trak,M.tkhd(B),M.mdia(B))},M.trex=function(B){var P=B.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(B,P){var R=B.samples||[],v=R.length,m=12+16*v,p=new Uint8Array(m),d,s,h,l,i,o;for(P+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255],0),d=0;d<v;d++)s=R[d],h=s.duration,l=s.size,i=s.flags,o=s.cts,p.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*d);return M.box(M.types.trun,p)},M.initSegment=function(B){M.types||M.init();var P=M.moov(B),R=new Uint8Array(M.FTYP.byteLength+P.byteLength);return R.set(M.FTYP),R.set(P,M.FTYP.byteLength),R},M}();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,V.default=N},"./src/remux/mp4-remuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return o}),D.d(V,"normalizePts",function(){return f});var G=D("./src/polyfills/number.ts"),N=D("./src/remux/aac-helper.ts"),M=D("./src/remux/mp4-generator.ts"),W=D("./src/events.ts"),B=D("./src/errors.ts"),P=D("./src/utils/logger.ts"),R=D("./src/types/loader.ts"),v=D("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(O){for(var S=1;S<arguments.length;S++){var w=arguments[S];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(O[E]=w[E])}return O},m.apply(this,arguments)}var p=10*1e3,d=1024,s=1152,h=null,l=null,i=!1,o=function(){function O(w,E,_,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=w,this.config=E,this.typeSupported=_,this.ISGenerated=!1,h===null){var u=navigator.userAgent||"",g=u.match(/Chrome\/(\d+)/i);h=g?parseInt(g[1]):0}if(l===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);l=b?parseInt(b[1]):0}i=!!h&&h<75||!!l&&l<600}var S=O.prototype;return S.destroy=function(){},S.resetTimeStamp=function(E){P.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},S.resetNextTimestamp=function(){P.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},S.resetInitSegment=function(){P.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},S.getVideoStartPts=function(E){var _=!1,c=E.reduce(function(u,g){var b=g.pts-u;return b<-4294967296?(_=!0,f(u,g.pts)):b>0?u:g.pts},E[0].pts);return _&&P.logger.debug("PTS rollover detected"),c},S.remux=function(E,_,c,u,g,b,k,I){var F,U,C,y,j,K,Q=g,te=g,_e=E.pid>-1,de=_.pid>-1,me=_.samples.length,fe=E.samples.length>0,pe=me>1,ae=(!_e||fe)&&(!de||pe)||this.ISGenerated||k;if(ae){this.ISGenerated||(C=this.generateIS(E,_,g));var he=this.isVideoContiguous,$=-1;if(pe&&($=A(_.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if(K=!0,$>0){P.logger.warn("[mp4-remuxer]: Dropped "+$+" out of "+me+" video samples due to a missing keyframe");var ie=this.getVideoStartPts(_.samples);_.samples=_.samples.slice($),_.dropped+=$,te+=(_.samples[0].pts-ie)/(_.timescale||9e4)}else $===-1&&(P.logger.warn("[mp4-remuxer]: No keyframe found out of "+me+" video samples"),K=!1);if(this.ISGenerated){if(fe&&pe){var ee=this.getVideoStartPts(_.samples),Ee=f(E.samples[0].pts,ee)-ee,we=Ee/_.inputTimeScale;Q+=Math.max(0,we),te+=Math.max(0,-we)}if(fe){if(E.samplerate||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),C=this.generateIS(E,_,g)),U=this.remuxAudio(E,Q,this.isAudioContiguous,b,de||pe||I===R.PlaylistLevelType.AUDIO?te:void 0),pe){var ye=U?U.endPTS-U.startPTS:0;_.inputTimeScale||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),C=this.generateIS(E,_,g)),F=this.remuxVideo(_,te,he,ye)}}else pe&&(F=this.remuxVideo(_,te,he,0));F&&(F.firstKeyFrame=$,F.independent=$!==-1)}}return this.ISGenerated&&(c.samples.length&&(j=this.remuxID3(c,g)),u.samples.length&&(y=this.remuxText(u,g))),{audio:U,video:F,initSegment:C,independent:K,text:y,id3:j}},S.generateIS=function(E,_,c){var u=E.samples,g=_.samples,b=this.typeSupported,k={},I=!Object(G.isFiniteNumber)(this._initPTS),F="audio/mp4",U,C,y;if(I&&(U=C=Infinity),E.config&&u.length&&(E.timescale=E.samplerate,E.isAAC||(b.mpeg?(F="audio/mpeg",E.codec=""):b.mp3&&(E.codec="mp3")),k.audio={id:"audio",container:F,codec:E.codec,initSegment:!E.isAAC&&b.mpeg?new Uint8Array(0):M.default.initSegment([E]),metadata:{channelCount:E.channelCount}},I&&(y=E.inputTimeScale,U=C=u[0].pts-Math.round(y*c))),_.sps&&_.pps&&g.length&&(_.timescale=_.inputTimeScale,k.video={id:"main",container:"video/mp4",codec:_.codec,initSegment:M.default.initSegment([_]),metadata:{width:_.width,height:_.height}},I)){y=_.inputTimeScale;var j=this.getVideoStartPts(g),K=Math.round(y*c);C=Math.min(C,f(g[0].dts,j)-K),U=Math.min(U,j-K)}if(Object.keys(k).length)return this.ISGenerated=!0,I&&(this._initPTS=U,this._initDTS=C),{tracks:k,initPTS:U,timescale:y}},S.remuxVideo=function(E,_,c,u){var g=E.inputTimeScale,b=E.samples,k=[],I=b.length,F=this._initPTS,U=this.nextAvcDts,C=8,y,j,K,Q=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,_e=0,de=!1;if(!c||U===null){var me=_*g,fe=b[0].pts-f(b[0].dts,b[0].pts);U=me-fe}for(var pe=0;pe<I;pe++){var ae=b[pe];if(ae.pts=f(ae.pts-F,U),ae.dts=f(ae.dts-F,U),ae.dts>ae.pts){var he=9e4*.2;_e=Math.max(Math.min(_e,ae.pts-ae.dts),-1*he)}ae.dts<b[pe>0?pe-1:pe].dts&&(de=!0)}de&&b.sort(function(Ot,_t){var ut=Ot.dts-_t.dts,bt=Ot.pts-_t.pts;return ut||bt}),j=b[0].dts,K=b[b.length-1].dts;var $=Math.round((K-j)/(I-1));if(_e<0){if(_e<$*-2){P.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-$,!0)+" ms");for(var ie=_e,ee=0;ee<I;ee++)b[ee].dts=ie=Math.max(ie,b[ee].pts-$),b[ee].pts=Math.max(ie,b[ee].pts)}else{P.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(_e,!0)+" ms to overcome this issue");for(var Ee=0;Ee<I;Ee++)b[Ee].dts=b[Ee].dts+_e}j=b[0].dts}if(c){var we=j-U,ye=we>$,xe=we<-1;if(ye||xe){ye?P.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(we,!0)+" ms ("+we+"dts) hole between fragments detected, filling it"):P.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-we,!0)+" ms ("+we+"dts) overlapping between fragments detected"),j=U;var Le=b[0].pts-we;b[0].dts=j,b[0].pts=Le,P.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Le,!0)+"/"+Object(v.toMsFromMpegTsClock)(j,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(we,!0)+" ms")}}i&&(j=Math.max(0,j));for(var ke=0,Pe=0,Ae=0;Ae<I;Ae++){for(var Oe=b[Ae],Be=Oe.units,Ve=Be.length,ze=0,je=0;je<Ve;je++)ze+=Be[je].data.length;Pe+=ze,ke+=Ve,Oe.length=ze,Oe.dts=Math.max(Oe.dts,j),Oe.pts=Math.max(Oe.pts,Oe.dts,0),Q=Math.min(Oe.pts,Q),te=Math.max(Oe.pts,te)}K=b[I-1].dts;var et=Pe+4*ke+8,Xe;try{Xe=new Uint8Array(et)}catch(Ot){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:et,reason:"fail allocating video mdat "+et});return}var $e=new DataView(Xe.buffer);$e.setUint32(0,et),Xe.set(M.default.types.mdat,4);for(var Ce=0;Ce<I;Ce++){for(var qe=b[Ce],Ke=qe.units,Se=0,Me=0,ve=Ke.length;Me<ve;Me++){var le=Ke[Me],ue=le.data,J=le.data.byteLength;$e.setUint32(C,J),C+=4,Xe.set(ue,C),C+=J,Se+=4+J}if(Ce<I-1)y=b[Ce+1].dts-qe.dts;else{var q=this.config,re=qe.dts-b[Ce>0?Ce-1:Ce].dts;if(q.stretchShortVideoTrack&&this.nextAudioPts!==null){var oe=Math.floor(q.maxBufferHole*g),ge=(u?Q+u*g:this.nextAudioPts)-qe.pts;ge>oe?(y=ge-re,y<0&&(y=re),P.logger.log("[mp4-remuxer]: It is approximately "+ge/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=re}else y=re}var Re=Math.round(qe.pts-qe.dts);k.push(new x(qe.key,y,Se,Re))}if(k.length&&h&&h<70){var De=k[0].flags;De.dependsOn=2,De.isNonSync=0}console.assert(y!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=U=K+y,this.isVideoContiguous=!0;var Je=M.default.moof(E.sequenceNumber++,j,m({},E,{samples:k})),it="video",rt={data1:Je,data2:Xe,startPTS:Q/g,endPTS:(te+y)/g,startDTS:j/g,endDTS:U/g,type:it,hasAudio:!1,hasVideo:!0,nb:k.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(Xe.length,"MDAT length must not be zero"),rt},S.remuxAudio=function(E,_,c,u,g){var b=E.inputTimeScale,k=E.samplerate?E.samplerate:b,I=b/k,F=E.isAAC?d:s,U=F*I,C=this._initPTS,y=!E.isAAC&&this.typeSupported.mpeg,j=[],K=E.samples,Q=y?0:8,te=this.nextAudioPts||-1,_e=_*b;if(this.isAudioContiguous=c=c||K.length&&te>0&&(u&&Math.abs(_e-te)<9e3||Math.abs(f(K[0].pts-C,_e)-te)<20*U),K.forEach(function(ue){ue.pts=f(ue.pts-C,_e)}),!c||te<0){if(K=K.filter(function(ue){return ue.pts>=0}),!K.length)return;g===0?te=0:u?te=Math.max(0,_e):te=K[0].pts}if(E.isAAC)for(var de=g!==void 0,me=this.config.maxAudioFramesDrift,fe=0,pe=te;fe<K.length;fe++){var ae=K[fe],he=ae.pts,$=he-pe,ie=Math.abs(1e3*$/b);if($<=-me*U&&de)fe===0&&(P.logger.warn("Audio frame @ "+(he/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*$/b)+" ms."),this.nextAudioPts=te=pe=he);else if($>=me*U&&ie<p&&de){var ee=Math.round($/U);pe=he-ee*U,pe<0&&(ee--,pe+=U),fe===0&&(this.nextAudioPts=te=pe),P.logger.warn("[mp4-remuxer]: Injecting "+ee+" audio frame @ "+(pe/b).toFixed(3)+"s due to "+Math.round(1e3*$/b)+" ms gap.");for(var Ee=0;Ee<ee;Ee++){var we=Math.max(pe,0),ye=N.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);ye||(P.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ye=ae.unit.subarray()),K.splice(fe,0,{unit:ye,pts:we}),pe+=U,fe++}}ae.pts=pe,pe+=U}for(var xe=null,Le=null,ke,Pe=0,Ae=K.length;Ae--;)Pe+=K[Ae].unit.byteLength;for(var Oe=0,Be=K.length;Oe<Be;Oe++){var Ve=K[Oe],ze=Ve.unit,je=Ve.pts;if(Le!==null){var et=j[Oe-1];et.duration=Math.round((je-Le)/I)}else if(c&&E.isAAC&&(je=te),xe=je,Pe>0){Pe+=Q;try{ke=new Uint8Array(Pe)}catch(ue){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Pe,reason:"fail allocating audio mdat "+Pe});return}if(!y){var Xe=new DataView(ke.buffer);Xe.setUint32(0,Pe),ke.set(M.default.types.mdat,4)}}else return;ke.set(ze,Q);var $e=ze.byteLength;Q+=$e,j.push(new x(!0,F,$e,0)),Le=je}var Ce=j.length;if(!Ce)return;var qe=j[j.length-1];this.nextAudioPts=te=Le+I*qe.duration;var Ke=y?new Uint8Array(0):M.default.moof(E.sequenceNumber++,xe/I,m({},E,{samples:j}));E.samples=[];var Se=xe/b,Me=te/b,ve="audio",le={data1:Ke,data2:ke,startPTS:Se,endPTS:Me,startDTS:Se,endDTS:Me,type:ve,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(ke.length,"MDAT length must not be zero"),le},S.remuxEmptyAudio=function(E,_,c,u){var g=E.inputTimeScale,b=E.samplerate?E.samplerate:g,k=g/b,I=this.nextAudioPts,F=(I!==null?I:u.startDTS*g)+this._initDTS,U=u.endDTS*g+this._initDTS,C=k*d,y=Math.ceil((U-F)/C),j=N.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(P.logger.warn("[mp4-remuxer]: remux empty Audio"),!j){P.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var K=[],Q=0;Q<y;Q++){var te=F+Q*C;K.push({unit:j,pts:te,dts:te})}return E.samples=K,this.remuxAudio(E,_,c,!1)},S.remuxID3=function(E,_){var c=E.samples.length;if(!c)return;for(var u=E.inputTimeScale,g=this._initPTS,b=this._initDTS,k=0;k<c;k++){var I=E.samples[k];I.pts=f(I.pts-g,_*u)/u,I.dts=f(I.dts-b,_*u)/u}var F=E.samples;return E.samples=[],{samples:F}},S.remuxText=function(E,_){var c=E.samples.length;if(!c)return;for(var u=E.inputTimeScale,g=this._initPTS,b=0;b<c;b++){var k=E.samples[b];k.pts=f(k.pts-g,_*u)/u}E.samples.sort(function(F,U){return F.pts-U.pts});var I=E.samples;return E.samples=[],{samples:I}},O}();function f(O,S){var w;if(S===null)return O;for(S<O?w=-8589934592:w=8589934592;Math.abs(O-S)>4294967296;)O+=w;return O}function A(O){for(var S=0;S<O.length;S++)if(O[S].key)return S;return-1}var x=function(S,w,E,_){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=w,this.size=E,this.cts=_,this.flags=new T(S)},T=function(S){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=S?2:1,this.isNonSync=S?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/polyfills/number.ts"),N=D("./src/utils/mp4-tools.ts"),M=D("./src/loader/fragment.ts"),W=D("./src/utils/logger.ts"),B=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=v.prototype;return m.destroy=function(){},m.resetTimeStamp=function(d){this.initPTS=d,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(d,s,h){this.audioCodec=s,this.videoCodec=h,this.generateInitSegment(d),this.emitInitSegment=!0},m.generateInitSegment=function(d){var s=this.audioCodec,h=this.videoCodec;if(!d||!d.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(N.parseInitSegment)(d);s||(s=R(l.audio,M.ElementaryStreamTypes.AUDIO)),h||(h=R(l.video,M.ElementaryStreamTypes.VIDEO));var i={};l.audio&&l.video?i.audiovideo={container:"video/mp4",codec:s+","+h,initSegment:d,id:"main"}:l.audio?i.audio={container:"audio/mp4",codec:s,initSegment:d,id:"audio"}:l.video?i.video={container:"video/mp4",codec:h,initSegment:d,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},m.remux=function(d,s,h,l,i){var o=this.initPTS,f=this.lastEndDTS,A={audio:void 0,video:void 0,text:l,id3:h,initSegment:void 0};Object(G.isFiniteNumber)(f)||(f=this.lastEndDTS=i||0);var x=s.samples;if(!x||!x.length)return A;var T={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(x),O=this.initData),!O||!O.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(G.isFiniteNumber)(o)||(this.initPTS=T.initPTS=o=P(O,x,f));var S=Object(N.getDuration)(x,O),w=f,E=S+w;Object(N.offsetStartDTS)(O,x,o),S>0?this.lastEndDTS=E:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var _=!!O.audio,c=!!O.video,u="";_&&(u+="audio"),c&&(u+="video");var g={data1:x,startPTS:w,startDTS:w,endPTS:E,endDTS:E,type:u,hasAudio:_,hasVideo:c,nb:1,dropped:0};return A.audio=g.type==="audio"?g:void 0,A.video=g.type!=="audio"?g:void 0,A.text=l,A.id3=h,A.initSegment=T,A},v}(),P=function(m,p,d){return Object(N.getStartDTS)(m,p)-d};function R(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=B},"./src/task-loop.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return G});var G=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=N.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(B){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,B),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},N}()},"./src/types/cmcd.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"CMCDVersion",function(){return G}),D.d(V,"CMCDObjectType",function(){return N}),D.d(V,"CMCDStreamingFormat",function(){return M}),D.d(V,"CMCDStreamType",function(){return W});var G=1,N;(function(B){B.MANIFEST="m",B.AUDIO="a",B.VIDEO="v",B.MUXED="av",B.INIT="i",B.CAPTION="c",B.TIMED_TEXT="tt",B.KEY="k",B.OTHER="o"})(N||(N={}));var M;(function(B){B.DASH="d",B.HLS="h",B.SMOOTH="s",B.OTHER="o"})(M||(M={}));var W;(function(B){B.VOD="v",B.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"HlsSkip",function(){return M}),D.d(V,"getSkipValue",function(){return W}),D.d(V,"HlsUrlParameters",function(){return B}),D.d(V,"Level",function(){return P});function G(R,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(R,p.key,p)}}function N(R,v,m){return v&&G(R.prototype,v),m&&G(R,m),R}var M;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(M||(M={}));function W(R,v){var m=R.canSkipUntil,p=R.canSkipDateRanges,d=R.endSN,s=v!==void 0?v-d:0;return m&&s<m?p?M.v2:M.Yes:M.No}var B=function(){function R(m,p,d){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=d}var v=R.prototype;return v.addDirectives=function(p){var d=new self.URL(p);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()},R}(),P=function(){function R(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return N(R,[{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(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),R}()},"./src/types/loader.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"PlaylistContextType",function(){return G}),D.d(V,"PlaylistLevelType",function(){return N});var G;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var N;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"ChunkMetadata",function(){return G});var G=function(W,B,P,R,v,m){R===void 0&&(R=0),v===void 0&&(v=-1),m===void 0&&(m=!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=W,this.sn=B,this.id=P,this.size=R,this.part=v,this.partial=m};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"AttrList",function(){return M});var G=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function W(P){typeof P=="string"&&(P=W.parseAttrList(P));for(var R in P)P.hasOwnProperty(R)&&(this[R]=P[R])}var B=W.prototype;return B.decimalInteger=function(R){var v=parseInt(this[R],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},B.hexadecimalInteger=function(R){if(this[R]){var v=(this[R]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)m[p]=parseInt(v.slice(p*2,p*2+2),16);return m}else return null},B.hexadecimalIntegerAsNumber=function(R){var v=parseInt(this[R],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},B.decimalFloatingPoint=function(R){return parseFloat(this[R])},B.optionalFloat=function(R,v){var m=this[R];return m?parseFloat(m):v},B.enumeratedString=function(R){return this[R]},B.bool=function(R){return this[R]==="YES"},B.decimalResolution=function(R){var v=G.exec(this[R]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},W.parseAttrList=function(R){var v,m={},p='"';for(N.lastIndex=0;(v=N.exec(R))!==null;){var d=v[2];d.indexOf(p)===0&&d.lastIndexOf(p)===d.length-1&&(d=d.slice(1,-1)),m[v[1]]=d}return m},W}()},"./src/utils/binary-search.ts":function(ne,V,D){"use strict";D.r(V);var G={search:function(M,W){for(var B=0,P=M.length-1,R=null,v=null;B<=P;){R=(B+P)/2|0,v=M[R];var m=W(v);if(m>0)B=R+1;else if(m<0)P=R-1;else return v}return null}};V.default=G},"./src/utils/buffer-helper.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"BufferHelper",function(){return M});var G=D("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function W(){}return W.isBuffered=function(P,R){try{if(P){for(var v=W.getBuffered(P),m=0;m<v.length;m++)if(R>=v.start(m)&&R<=v.end(m))return!0}}catch(p){}return!1},W.bufferInfo=function(P,R,v){try{if(P){var m=W.getBuffered(P),p=[],d;for(d=0;d<m.length;d++)p.push({start:m.start(d),end:m.end(d)});return this.bufferedInfo(p,R,v)}}catch(s){}return{len:0,start:R,end:R,nextStart:void 0}},W.bufferedInfo=function(P,R,v){R=Math.max(0,R),P.sort(function(T,O){var S=T.start-O.start;return S||O.end-T.end});var m=[];if(v)for(var p=0;p<P.length;p++){var d=m.length;if(d){var s=m[d-1].end;P[p].start-s<v?P[p].end>s&&(m[d-1].end=P[p].end):m.push(P[p])}else m.push(P[p])}else m=P;for(var h=0,l,i=R,o=R,f=0;f<m.length;f++){var A=m[f].start,x=m[f].end;if(R+v>=A&&R<x)i=A,o=x,h=o-R;else if(R+v<A){l=A;break}}return{len:h,start:i||0,end:o||0,nextStart:l}},W.getBuffered=function(P){try{return P.buffered}catch(R){return G.logger.log("failed to get media.buffered",R),N}},W}()},"./src/utils/cea-608-parser.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"Row",function(){return o}),D.d(V,"CaptionScreen",function(){return f});var G=D("./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},M=function(E){var _=E;return N.hasOwnProperty(E)&&(_=N[E]),String.fromCharCode(_)},W=15,B=100,P={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},R={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],d;(function(w){w[w.ERROR=0]="ERROR",w[w.TEXT=1]="TEXT",w[w.WARNING=2]="WARNING",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w[w.DATA=3]="DATA"})(d||(d={}));var s=function(){function w(){this.time=null,this.verboseLevel=d.ERROR}var E=w.prototype;return E.log=function(c,u){this.verboseLevel>=c&&G.logger.log(this.time+" ["+c+"] "+u)},w}(),h=function(E){for(var _=[],c=0;c<E.length;c++)_.push(E[c].toString(16));return _},l=function(){function w(_,c,u,g,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=_||"white",this.underline=c||!1,this.italics=u||!1,this.background=g||"black",this.flash=b||!1}var E=w.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(c){for(var u=["foreground","underline","italics","background","flash"],g=0;g<u.length;g++){var b=u[g];c.hasOwnProperty(b)&&(this[b]=c[b])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},E.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},w}(),i=function(){function w(_,c,u,g,b,k){this.uchar=void 0,this.penState=void 0,this.uchar=_||" ",this.penState=new l(c,u,g,b,k)}var E=w.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(c,u){this.uchar=c,this.penState.copy(u)},E.setPenState=function(c){this.penState.copy(c)},E.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},E.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},w}(),o=function(){function w(_){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<B;c++)this.chars.push(new i);this.logger=_,this.pos=0,this.currPenState=new l}var E=w.prototype;return E.equals=function(c){for(var u=!0,g=0;g<B;g++)if(!this.chars[g].equals(c.chars[g])){u=!1;break}return u},E.copy=function(c){for(var u=0;u<B;u++)this.chars[u].copy(c.chars[u])},E.isEmpty=function(){for(var c=!0,u=0;u<B;u++)if(!this.chars[u].isEmpty()){c=!1;break}return c},E.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>B&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=B)},E.moveCursor=function(c){var u=this.pos+c;if(c>1)for(var g=this.pos+1;g<u+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(u)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(c){c>=144&&this.backSpace();var u=M(c);if(this.pos>=B){this.logger.log(d.ERROR,"Cannot insert "+c.toString(16)+" ("+u+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(u,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(c){var u;for(u=c;u<B;u++)this.chars[u].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var c=[],u=!0,g=0;g<B;g++){var b=this.chars[g].uchar;b!==" "&&(u=!1),c.push(b)}return u?"":c.join("")},E.setPenStyles=function(c){this.currPenState.setStyles(c);var u=this.chars[this.pos];u.setPenState(this.currPenState)},w}(),f=function(){function w(_){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<W;c++)this.rows.push(new o(_));this.logger=_,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=w.prototype;return E.reset=function(){for(var c=0;c<W;c++)this.rows[c].clear();this.currRow=W-1},E.equals=function(c){for(var u=!0,g=0;g<W;g++)if(!this.rows[g].equals(c.rows[g])){u=!1;break}return u},E.copy=function(c){for(var u=0;u<W;u++)this.rows[u].copy(c.rows[u])},E.isEmpty=function(){for(var c=!0,u=0;u<W;u++)if(!this.rows[u].isEmpty()){c=!1;break}return c},E.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},E.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},E.insertChar=function(c){var u=this.rows[this.currRow];u.insertChar(c)},E.setPen=function(c){var u=this.rows[this.currRow];u.setPenStyles(c)},E.moveCursor=function(c){var u=this.rows[this.currRow];u.moveCursor(c)},E.setCursor=function(c){this.logger.log(d.INFO,"setCursor: "+c);var u=this.rows[this.currRow];u.setCursor(c)},E.setPAC=function(c){this.logger.log(d.INFO,"pacData = "+JSON.stringify(c));var u=c.row-1;if(this.nrRollUpRows&&u<this.nrRollUpRows-1&&(u=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==u){for(var g=0;g<W;g++)this.rows[g].clear();var b=this.currRow+1-this.nrRollUpRows,k=this.lastOutputScreen;if(k){var I=k.rows[b].cueStartTime,F=this.logger.time;if(I&&F!==null&&I<F)for(var U=0;U<this.nrRollUpRows;U++)this.rows[u-this.nrRollUpRows+U+1].copy(k.rows[b+U])}}this.currRow=u;var C=this.rows[this.currRow];if(c.indent!==null){var y=c.indent,j=Math.max(y-1,0);C.setCursor(c.indent),c.color=C.chars[j].penState.foreground}var K={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(K)},E.setBkgData=function(c){this.logger.log(d.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},E.setRollUpRows=function(c){this.nrRollUpRows=c},E.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,u=this.rows.splice(c,1)[0];u.clear(),this.rows.splice(this.currRow,0,u),this.logger.log(d.INFO,"Rolling up")},E.getDisplayText=function(c){c=c||!1;for(var u=[],g="",b=-1,k=0;k<W;k++){var I=this.rows[k].getTextString();I&&(b=k+1,c?u.push("Row "+b+": '"+I+"'"):u.push(I.trim()))}return u.length>0&&(c?g="["+u.join(" | ")+"]":g=u.join(`
`)),g},E.getTextAndFormat=function(){return this.rows},w}(),A=function(){function w(_,c,u){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=_,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new f(u),this.nonDisplayedMemory=new f(u),this.lastOutputScreen=new f(u),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=u}var E=w.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(c){this.outputFilter=c},E.setPAC=function(c){this.writeScreen.setPAC(c)},E.setBkgData=function(c){this.writeScreen.setBkgData(c)},E.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},E.insertChars=function(c){for(var u=0;u<c.length;u++)this.writeScreen.insertChar(c[u]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(d.INFO,g+": "+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())},E.ccRCL=function(){this.logger.log(d.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(d.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(d.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.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)},E.ccFON=function(){this.logger.log(d.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(d.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(d.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(d.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(d.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(d.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(d.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.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)},E.ccTO=function(c){this.logger.log(d.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},E.ccMIDROW=function(c){var u={flash:!1};if(u.underline=c%2===1,u.italics=c>=46,u.italics)u.foreground="white";else{var g=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];u.foreground=b[g]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(u)),this.writeScreen.setPen(u)},E.outputDataUpdate=function(c){c===void 0&&(c=!1);var u=this.logger.time;if(u===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=u:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,u,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:u),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},w}(),x=function(){function w(_,c,u){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new s;this.channels=[null,new A(_,c,g),new A(_+1,u,g)],this.cmdHistory=S(),this.logger=g}var E=w.prototype;return E.getHandler=function(c){return this.channels[c].getHandler()},E.setHandler=function(c,u){this.channels[c].setHandler(u)},E.addData=function(c,u){var g,b,k,I=!1;this.logger.time=c;for(var F=0;F<u.length;F+=2){if(b=u[F]&127,k=u[F+1]&127,b===0&&k===0)continue;if(this.logger.log(d.DATA,"["+h([u[F],u[F+1]])+"] -> ("+h([b,k])+")"),g=this.parseCmd(b,k),g||(g=this.parseMidrow(b,k)),g||(g=this.parsePAC(b,k)),g||(g=this.parseBackgroundAttributes(b,k)),!g&&(I=this.parseChars(b,k),I)){var U=this.currentChannel;if(U&&U>0){var C=this.channels[U];C.insertChars(I)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!I&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+h([b,k])+" orig: "+h([u[F],u[F+1]]))}},E.parseCmd=function(c,u){var g=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&u>=32&&u<=47,k=(c===23||c===31)&&u>=33&&u<=35;if(!(b||k))return!1;if(O(c,u,g))return T(null,null,g),this.logger.log(d.DEBUG,"Repeated command ("+h([c,u])+") is dropped"),!0;var I=c===20||c===21||c===23?1:2,F=this.channels[I];return c===20||c===21||c===28||c===29?u===32?F.ccRCL():u===33?F.ccBS():u===34?F.ccAOF():u===35?F.ccAON():u===36?F.ccDER():u===37?F.ccRU(2):u===38?F.ccRU(3):u===39?F.ccRU(4):u===40?F.ccFON():u===41?F.ccRDC():u===42?F.ccTR():u===43?F.ccRTD():u===44?F.ccEDM():u===45?F.ccCR():u===46?F.ccENM():u===47&&F.ccEOC():F.ccTO(u-32),T(c,u,g),this.currentChannel=I,!0},E.parseMidrow=function(c,u){var g=0;if((c===17||c===25)&&u>=32&&u<=47){if(c===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[g];return b?(b.ccMIDROW(u),this.logger.log(d.DEBUG,"MIDROW ("+h([c,u])+")"),!0):!1}return!1},E.parsePAC=function(c,u){var g,b=this.cmdHistory,k=(c>=17&&c<=23||c>=25&&c<=31)&&u>=64&&u<=127,I=(c===16||c===24)&&u>=64&&u<=95;if(!(k||I))return!1;if(O(c,u,b))return T(null,null,b),!0;var F=c<=23?1:2;u>=64&&u<=95?g=F===1?P[c]:v[c]:g=F===1?R[c]:m[c];var U=this.channels[F];return U?(U.setPAC(this.interpretPAC(g,u)),T(c,u,b),this.currentChannel=F,!0):!1},E.interpretPAC=function(c,u){var g,b={color:null,italics:!1,indent:null,underline:!1,row:c};return u>95?g=u-96:g=u-64,b.underline=(g&1)===1,g<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((g-16)/2)*4,b},E.parseChars=function(c,u){var g,b=null,k=null;if(c>=25?(g=2,k=c-8):(g=1,k=c),k>=17&&k<=19){var I;k===17?I=u+80:k===18?I=u+112:I=u+144,this.logger.log(d.INFO,"Special char '"+M(I)+"' in channel "+g),b=[I]}else c>=32&&c<=127&&(b=u===0?[c]:[c,u]);if(b){var F=h(b);this.logger.log(d.DEBUG,"Char codes = "+F.join(",")),T(c,u,this.cmdHistory)}return b},E.parseBackgroundAttributes=function(c,u){var g=(c===16||c===24)&&u>=32&&u<=47,b=(c===23||c===31)&&u>=45&&u<=47;if(!(g||b))return!1;var k,I={};c===16||c===24?(k=Math.floor((u-32)/2),I.background=p[k],u%2===1&&(I.background=I.background+"_semi")):u===45?I.background="transparent":(I.foreground="black",u===47&&(I.underline=!0));var F=c<=23?1:2,U=this.channels[F];return U.setBkgData(I),T(c,u,this.cmdHistory),!0},E.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var u=this.channels[c];u&&u.reset()}this.cmdHistory=S()},E.cueSplitAtTime=function(c){for(var u=0;u<this.channels.length;u++){var g=this.channels[u];g&&g.cueSplitAtTime(c)}},w}();function T(w,E,_){_.a=w,_.b=E}function O(w,E,_){return _.a===w&&_.b===E}function S(){return{a:null,b:null}}V.default=x},"./src/utils/codecs.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"isCodecType",function(){return N}),D.d(V,"isCodecSupportedInMp4",function(){return M});var G={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(W,B){var P=G[B];return!!P&&P[W.slice(0,4)]===!0}function M(W,B){return MediaSource.isTypeSupported((B||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/utils/vttparser.ts"),N=D("./src/utils/webvtt-parser.ts"),M=D("./src/utils/texttrack-utils.ts"),W=/\s/,B={newCue:function(R,v,m,p){for(var d=[],s,h,l,i,o,f=self.VTTCue||self.TextTrackCue,A=0;A<p.rows.length;A++)if(s=p.rows[A],l=!0,i=0,o="",!s.isEmpty()){for(var x=0;x<s.chars.length;x++)W.test(s.chars[x].uchar)&&l?i++:(o+=s.chars[x].uchar,l=!1);s.cueStartTime=v,v===m&&(m+=1e-4),i>=16?i--:i++;var T=Object(G.fixLineBreaks)(o.trim()),O=Object(N.generateCueId)(v,m,T);(!R||!R.cues||!R.cues.getCueById(O))&&(h=new f(v,m,T),h.id=O,h.line=A+1,h.align="left",h.position=10+Math.min(80,Math.floor(i*8/32)*10),d.push(h))}return R&&d.length&&(d.sort(function(S,w){return S.line==="auto"||w.line==="auto"?0:S.line>8&&w.line>8?w.line-S.line:S.line-w.line}),d.forEach(function(S){return Object(M.addCueToTrack)(R,S)})),d}};V.default=B},"./src/utils/discontinuities.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"findFirstFragWithCC",function(){return W}),D.d(V,"shouldAlignOnDiscontinuities",function(){return B}),D.d(V,"findDiscontinuousReferenceFrag",function(){return P}),D.d(V,"adjustSlidingStart",function(){return v}),D.d(V,"alignStream",function(){return m}),D.d(V,"alignPDT",function(){return d}),D.d(V,"alignFragmentByPDTDelta",function(){return s}),D.d(V,"alignMediaPlaylistByPDT",function(){return h});var G=D("./src/polyfills/number.ts"),N=D("./src/utils/logger.ts"),M=D("./src/controller/level-helper.ts");function W(l,i){for(var o=null,f=0,A=l.length;f<A;f++){var x=l[f];if(x&&x.cc===i){o=x;break}}return o}function B(l,i,o){return!!(i.details&&(o.endCC>o.startCC||l&&l.cc<o.startCC))}function P(l,i){var o=l.fragments,f=i.fragments;if(!f.length||!o.length){N.logger.log("No fragments to align");return}var A=W(o,f[0].cc);if(!A||A&&!A.startPTS){N.logger.log("No frag in previous level to align on");return}return A}function R(l,i){if(l){var o=l.start+i;l.start=l.startPTS=o,l.endPTS=o+l.duration}}function v(l,i){for(var o=i.fragments,f=0,A=o.length;f<A;f++)R(o[f],l);i.fragmentHint&&R(i.fragmentHint,l),i.alignedSliding=!0}function m(l,i,o){if(!i)return;p(l,o,i),!o.alignedSliding&&i.details&&d(o,i.details),!o.alignedSliding&&i.details&&!o.skippedSegments&&Object(M.adjustSliding)(i.details,o)}function p(l,i,o){if(B(l,o,i)){var f=P(o.details,i);f&&Object(G.isFiniteNumber)(f.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),v(f.start,i))}}function d(l,i){if(!i.fragments.length||!l.hasProgramDateTime||!i.hasProgramDateTime)return;var o=i.fragments[0].programDateTime,f=l.fragments[0].programDateTime,A=(f-o)/1e3+i.fragments[0].start;A&&Object(G.isFiniteNumber)(A)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(f-o)+"ms, sliding:"+A.toFixed(3)+" "+l.url+" "),v(A,l))}function s(l,i){var o=l.programDateTime;if(!o)return;var f=(o-i)/1e3;l.start=l.startPTS=f,l.endPTS=f+l.duration}function h(l,i){if(!i.fragments.length||!l.hasProgramDateTime||!i.hasProgramDateTime)return;var o=i.fragments[0].programDateTime,f=i.fragments[0].start,A=o-f*1e3;l.fragments.forEach(function(x){s(x,A)}),l.fragmentHint&&s(l.fragmentHint,A),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/utils/ewma.ts"),N=function(){function M(B,P,R){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=R,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new G.default(B),this.fast_=new G.default(P)}var W=M.prototype;return W.update=function(P,R){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==P&&(this.slow_=new G.default(P,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new G.default(R,m.getEstimate(),m.getTotalWeight()))},W.sample=function(P,R){P=Math.max(P,this.minDelayMs_);var v=8*R,m=P/1e3,p=v/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},W.canEstimate=function(){var P=this.fast_;return P&&P.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},M}();V.default=N},"./src/utils/ewma.ts":function(ne,V,D){"use strict";D.r(V);var G=function(){function N(W,B,P){B===void 0&&(B=0),P===void 0&&(P=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=B,this.totalWeight_=P}var M=N.prototype;return M.sample=function(B,P){var R=Math.pow(this.alpha_,B);this.estimate_=P*(1-R)+R*this.estimate_,this.totalWeight_+=B},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var B=1-Math.pow(this.alpha_,this.totalWeight_);if(B)return this.estimate_/B}return this.estimate_},N}();V.default=G},"./src/utils/fetch-loader.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"fetchSupported",function(){return s});var G=D("./src/polyfills/number.ts"),N=D("./src/loader/load-stats.ts"),M=D("./src/demux/chunk-cache.ts");function W(f,A){f.prototype=Object.create(A.prototype),f.prototype.constructor=f,m(f,A)}function B(f){var A=typeof Map=="function"?new Map:void 0;return B=function(T){if(T===null||!v(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(T))return A.get(T);A.set(T,O)}function O(){return P(T,arguments,p(this).constructor)}return O.prototype=Object.create(T.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),m(O,T)},B(f)}function P(f,A,x){return R()?P=Reflect.construct:P=function(O,S,w){var E=[null];E.push.apply(E,S);var _=Function.bind.apply(O,E),c=new _;return w&&m(c,w.prototype),c},P.apply(null,arguments)}function R(){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 v(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function m(f,A){return m=Object.setPrototypeOf||function(T,O){return T.__proto__=O,T},m(f,A)}function p(f){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},p(f)}function d(){return d=Object.assign||function(f){for(var A=1;A<arguments.length;A++){var x=arguments[A];for(var T in x)Object.prototype.hasOwnProperty.call(x,T)&&(f[T]=x[T])}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 h=function(){function f(x){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=x.fetchSetup||i,this.controller=new self.AbortController,this.stats=new N.LoadStats}var A=f.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(T,O,S){var w=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var _=l(T,this.controller.signal),c=S.onProgress,u=T.responseType==="arraybuffer",g=u?"byteLength":"length";this.context=T,this.config=O,this.callbacks=S,this.request=this.fetchSetup(T,_),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){w.abortInternal(),S.onTimeout(E,T,w.response)},O.timeout),self.fetch(this.request).then(function(b){if(w.response=w.loader=b,!b.ok){var k=b.status,I=b.statusText;throw new o(I||"fetch, bad network response",k,b)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(b.headers.get("Content-Length")||"0"),c&&Object(G.isFiniteNumber)(O.highWaterMark)?w.loadProgressively(b,E,T,O.highWaterMark,c):u?b.arrayBuffer():b.text()}).then(function(b){var k=w.response;self.clearTimeout(w.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=b[g];var I={url:k.url,data:b};c&&!Object(G.isFiniteNumber)(O.highWaterMark)&&c(E,T,b,k),S.onSuccess(I,E,T,k)}).catch(function(b){if(self.clearTimeout(w.requestTimeout),E.aborted)return;var k=b.code||0;S.onError({code:k,text:b.message},T,b.details)})},A.getCacheAge=function(){var T=null;if(this.response){var O=this.response.headers.get("age");T=O?parseFloat(O):null}return T},A.loadProgressively=function(T,O,S,w,E){w===void 0&&(w=0);var _=new M.default,c=T.body.getReader(),u=function g(){return c.read().then(function(b){if(b.done)return _.dataLength&&E(O,S,_.flush(),T),Promise.resolve(new ArrayBuffer(0));var k=b.value,I=k.length;return O.loaded+=I,I<w||_.dataLength?(_.push(k),_.dataLength>=w&&E(O,S,_.flush(),T)):E(O,S,k,T),g()}).catch(function(){return Promise.reject()})};return u()},f}();function l(f,A){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(d({},f.headers))};return f.rangeEnd&&x.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),x}function i(f,A){return new self.Request(f.url,A)}var o=function(f){W(A,f);function A(x,T,O){var S;return S=f.call(this,x)||this,S.code=void 0,S.details=void 0,S.code=T,S.details=O,S}return A}(B(Error));V.default=h},"./src/utils/imsc1-ttml-parser.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"IMSC1_CODEC",function(){return v}),D.d(V,"parseIMSC1",function(){return s});var G=D("./src/utils/mp4-tools.ts"),N=D("./src/utils/vttparser.ts"),M=D("./src/utils/vttcue.ts"),W=D("./src/demux/id3.ts"),B=D("./src/utils/timescale-conversion.ts"),P=D("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var _=arguments[E];for(var c in _)Object.prototype.hasOwnProperty.call(_,c)&&(w[c]=_[c])}return w},R.apply(this,arguments)}var v="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,d={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(w,E,_,c,u){var g=Object(G.findBox)(new Uint8Array(w),["mdat"]);if(g.length===0){u(new Error("Could not parse IMSC1 mdat"));return}var b=g[0],k=Object(W.utf8ArrayToStr)(new Uint8Array(w,b.start,b.end-b.start)),I=Object(B.toTimescaleFromScale)(E,1,_);try{c(h(k,I))}catch(F){u(F)}}function h(w,E){var _=new DOMParser,c=_.parseFromString(w,"text/xml"),u=c.getElementsByTagName("tt")[0];if(!u)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(g).reduce(function(C,y){return C[y]=u.getAttribute("ttp:"+y)||g[y],C},{}),k=u.getAttribute("xml:space")!=="preserve",I=i(l(u,"styling","style")),F=i(l(u,"layout","region")),U=l(u,"body","[begin]");return[].map.call(U,function(C){var y=o(C,k);if(!y||!C.hasAttribute("begin"))return null;var j=T(C.getAttribute("begin"),b),K=T(C.getAttribute("dur"),b),Q=T(C.getAttribute("end"),b);if(j===null)throw x(C);if(Q===null){if(K===null)throw x(C);Q=j+K}var te=new M.default(j-E,Q-E,y);te.id=Object(P.generateCueId)(te.startTime,te.endTime,te.text);var _e=F[C.getAttribute("region")],de=I[C.getAttribute("style")];te.position=10,te.size=80;var me=f(_e,de),fe=me.textAlign;if(fe){var pe=d[fe];pe&&(te.lineAlign=pe),te.align=fe}return R(te,me),te}).filter(function(C){return C!==null})}function l(w,E,_){var c=w.getElementsByTagName(E)[0];return c?[].slice.call(c.querySelectorAll(_)):[]}function i(w){return w.reduce(function(E,_){var c=_.getAttribute("xml:id");return c&&(E[c]=_),E},{})}function o(w,E){return[].slice.call(w.childNodes).reduce(function(_,c,u){var g;return c.nodeName==="br"&&u?_+`
`:(g=c.childNodes)!==null&&g!==void 0&&g.length?o(c,E):E?_+c.textContent.trim().replace(/\s+/g," "):_+c.textContent},"")}function f(w,E){var _="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(u,g){var b=A(E,_,g)||A(w,_,g);return b&&(u[g]=b),u},{})}function A(w,E,_){return w.hasAttributeNS(E,_)?w.getAttributeNS(E,_):null}function x(w){return new Error("Could not parse ttml timestamp "+w)}function T(w,E){if(!w)return null;var _=Object(N.parseTimeStamp)(w);return _===null&&(m.test(w)?_=O(w,E):p.test(w)&&(_=S(w,E))),_}function O(w,E){var _=m.exec(w),c=(_[4]|0)+(_[5]|0)/E.subFrameRate;return(_[1]|0)*3600+(_[2]|0)*60+(_[3]|0)+c/E.frameRate}function S(w,E){var _=p.exec(w),c=Number(_[1]),u=_[2];switch(u){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/E.frameRate;case"t":return c/E.tickRate}return c}},"./src/utils/logger.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"enableLogs",function(){return P}),D.d(V,"logger",function(){return R});var G=function(){},N={trace:G,debug:G,log:G,warn:G,info:G,error:G},M=N;function W(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):G}function B(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),d=1;d<m;d++)p[d-1]=arguments[d];p.forEach(function(s){M[s]=v[s]?v[s].bind(v):W(s)})}function P(v){if(self.console&&v===!0||typeof v=="object"){B(v,"debug","log","info","warn","error");try{M.log()}catch(m){M=N}}else M=N}var R=M},"./src/utils/mediakeys-helper.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"KeySystems",function(){return G}),D.d(V,"requestMediaKeySystemAccess",function(){return N});var G;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(G||(G={}));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(ne,V,D){"use strict";D.r(V),D.d(V,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"bin2str",function(){return B}),D.d(V,"readUint16",function(){return P}),D.d(V,"readUint32",function(){return R}),D.d(V,"writeUint32",function(){return v}),D.d(V,"findBox",function(){return m}),D.d(V,"parseSegmentIndex",function(){return p}),D.d(V,"parseInitSegment",function(){return d}),D.d(V,"getStartDTS",function(){return s}),D.d(V,"getDuration",function(){return h}),D.d(V,"computeRawDurationFromSamples",function(){return l}),D.d(V,"offsetStartDTS",function(){return i}),D.d(V,"segmentValidRange",function(){return o}),D.d(V,"appendUint8Array",function(){return f});var G=D("./src/utils/typed-array.ts"),N=D("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,W=[].push;function B(A){return String.fromCharCode.apply(null,A)}function P(A,x){"data"in A&&(x+=A.start,A=A.data);var T=A[x]<<8|A[x+1];return T<0?65536+T:T}function R(A,x){"data"in A&&(x+=A.start,A=A.data);var T=A[x]<<24|A[x+1]<<16|A[x+2]<<8|A[x+3];return T<0?4294967296+T:T}function v(A,x,T){"data"in A&&(x+=A.start,A=A.data),A[x]=T>>24,A[x+1]=T>>16&255,A[x+2]=T>>8&255,A[x+3]=T&255}function m(A,x){var T=[];if(!x.length)return T;var O,S,w;"data"in A?(O=A.data,S=A.start,w=A.end):(O=A,S=0,w=O.byteLength);for(var E=S;E<w;){var _=R(O,E),c=B(O.subarray(E+4,E+8)),u=_>1?E+_:w;if(c===x[0])if(x.length===1)T.push({data:O,start:E+8,end:u});else{var g=m({data:O,start:E+8,end:u},x.slice(1));g.length&&W.apply(T,g)}E=u}return T}function p(A){var x=m(A,["moov"]),T=x[0],O=T?T.end:null,S=m(A,["sidx"]);if(!S||!S[0])return null;var w=[],E=S[0],_=E.data[0],c=_===0?8:16,u=R(E,c);c+=4;var g=0,b=0;_===0?c+=8:c+=16,c+=2;var k=E.end+b,I=P(E,c);c+=2;for(var F=0;F<I;F++){var U=c,C=R(E,U);U+=4;var y=C&2147483647,j=(C&2147483648)>>>31;if(j===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var K=R(E,U);U+=4,w.push({referenceSize:y,subsegmentDuration:K,info:{duration:K/u,start:k,end:k+y-1}}),k+=y,U+=4,c=U}return{earliestPresentationTime:g,timescale:u,version:_,referencesCount:I,references:w,moovEndOffset:O}}function d(A){for(var x=[],T=m(A,["moov","trak"]),O=0;O<T.length;O++){var S=T[O],w=m(S,["tkhd"])[0];if(w){var E=w.data[w.start],_=E===0?12:20,c=R(w,_),u=m(S,["mdia","mdhd"])[0];if(u){E=u.data[u.start],_=E===0?12:20;var g=R(u,_),b=m(S,["mdia","hdlr"])[0];if(b){var k=B(b.data.subarray(b.start+8,b.start+12)),I={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[k];if(I){var F=m(S,["mdia","minf","stbl","stsd"])[0],U=void 0;F&&(U=B(F.data.subarray(F.start+12,F.start+16))),x[c]={timescale:g,type:I},x[I]={timescale:g,id:c,codec:U}}}}}}var C=m(A,["moov","mvex","trex"]);return C.forEach(function(y){var j=R(y,4),K=x[j];K&&(K.default={duration:R(y,12),flags:R(y,20)})}),x}function s(A,x){return m(x,["moof","traf"]).reduce(function(T,O){var S=m(O,["tfdt"])[0],w=S.data[S.start],E=m(O,["tfhd"]).reduce(function(_,c){var u=R(c,4),g=A[u];if(g){var b=R(S,4);w===1&&(b*=Math.pow(2,32),b+=R(S,8));var k=g.timescale||9e4,I=b/k;if(isFinite(I)&&(_===null||I<_))return I}return _},null);return E!==null&&isFinite(E)&&(T===null||E<T)?E:T},null)||0}function h(A,x){for(var T=0,O=0,S=0,w=m(A,["moof","traf"]),E=0;E<w.length;E++){var _=w[E],c=m(_,["tfhd"])[0],u=R(c,4),g=x[u];if(!g)continue;var b=g.default,k=R(c,0)|(b==null?void 0:b.flags),I=b==null?void 0:b.duration;k&8&&(k&2?I=R(c,12):I=R(c,8));for(var F=g.timescale||9e4,U=m(_,["trun"]),C=0;C<U.length;C++){if(I){var y=R(U[C],4);T=I*y}else T=l(U[C]);g.type===N.ElementaryStreamTypes.VIDEO?O+=T/F:g.type===N.ElementaryStreamTypes.AUDIO&&(S+=T/F)}}if(O===0&&S===0){var j=p(A);if(j!=null&&j.references)return j.references.reduce(function(K,Q){return K+Q.info.duration||0},0)}return O||S}function l(A){var x=R(A,0),T=8;x&1&&(T+=4),x&4&&(T+=4);for(var O=0,S=R(A,4),w=0;w<S;w++){if(x&256){var E=R(A,T);O+=E,T+=4}x&512&&(T+=4),x&1024&&(T+=4),x&2048&&(T+=4)}return O}function i(A,x,T){m(x,["moof","traf"]).forEach(function(O){m(O,["tfhd"]).forEach(function(S){var w=R(S,4),E=A[w];if(!E)return;var _=E.timescale||9e4;m(O,["tfdt"]).forEach(function(c){var u=c.data[c.start],g=R(c,4);if(u===0)v(c,4,g-T*_);else{g*=Math.pow(2,32),g+=R(c,8),g-=T*_,g=Math.max(g,0);var b=Math.floor(g/(M+1)),k=Math.floor(g%(M+1));v(c,4,b),v(c,8,k)}})})})}function o(A){var x={valid:null,remainder:null},T=m(A,["moof"]);if(T){if(T.length<2)return x.remainder=A,x}else return x;var O=T[T.length-1];return x.valid=Object(G.sliceUint8)(A,0,O.start-8),x.remainder=Object(G.sliceUint8)(A,O.start-8),x}function f(A,x){var T=new Uint8Array(A.length+x.length);return T.set(A),T.set(x,A.length),T}},"./src/utils/output-filter.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"default",function(){return G});var G=function(){function N(W,B){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=B}var M=N.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(B,P,R){(this.startTime===null||this.startTime>B)&&(this.startTime=B),this.endTime=P,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"sendAddTrackEvent",function(){return N}),D.d(V,"addCueToTrack",function(){return M}),D.d(V,"clearCurrentCues",function(){return W}),D.d(V,"removeCuesInRange",function(){return B}),D.d(V,"getCuesInRange",function(){return R});var G=D("./src/utils/logger.ts");function N(v,m){var p;try{p=new Event("addtrack")}catch(d){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function M(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(s){G.logger.debug("[texttrack-utils]: "+s);var d=new self.TextTrackCue(m.startTime,m.endTime,m.text);d.id=m.id,v.addCue(d)}p==="disabled"&&(v.mode=p)}function W(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function B(v,m,p){var d=v.mode;if(d==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var s=R(v.cues,m,p),h=0;h<s.length;h++)v.removeCue(s[h]);d==="disabled"&&(v.mode=d)}function P(v,m){if(m<v[0].startTime)return 0;var p=v.length-1;if(m>v[p].endTime)return-1;for(var d=0,s=p;d<=s;){var h=Math.floor((s+d)/2);if(m<v[h].startTime)s=h-1;else if(m>v[h].startTime&&d<p)d=h+1;else return h}return v[d].startTime-m<m-v[s].startTime?d:s}function R(v,m,p){var d=[],s=P(v,m);if(s>-1)for(var h=s,l=v.length;h<l;h++){var i=v[h];if(i.startTime>=m&&i.endTime<=p)d.push(i);else if(i.startTime>p)return d}return d}},"./src/utils/time-ranges.ts":function(ne,V,D){"use strict";D.r(V);var G={toString:function(M){for(var W="",B=M.length,P=0;P<B;P++)W+="["+M.start(P).toFixed(3)+","+M.end(P).toFixed(3)+"]";return W}};V.default=G},"./src/utils/timescale-conversion.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"toTimescaleFromBase",function(){return N}),D.d(V,"toTimescaleFromScale",function(){return M}),D.d(V,"toMsFromMpegTsClock",function(){return W}),D.d(V,"toMpegTsClockFromTimescale",function(){return B});var G=9e4;function N(P,R,v,m){v===void 0&&(v=1),m===void 0&&(m=!1);var p=P*R*v;return m?Math.round(p):p}function M(P,R,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),N(P,R,1/v,m)}function W(P,R){return R===void 0&&(R=!1),N(P,1e3,1/G,R)}function B(P,R){return R===void 0&&(R=1),N(P,G,1/R)}},"./src/utils/typed-array.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"sliceUint8",function(){return G});function G(N,M,W){return Uint8Array.prototype.slice?N.slice(M,W):new Uint8Array(Array.prototype.slice.call(N,M,W))}},"./src/utils/vttcue.ts":function(ne,V,D){"use strict";D.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var G=["","lr","rl"],N=["start","middle","end","left","right"];function M(v,m){if(typeof m!="string")return!1;if(!Array.isArray(v))return!1;var p=m.toLowerCase();return~v.indexOf(p)?p:!1}function W(v){return M(G,v)}function B(v){return M(N,v)}function P(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),d=1;d<m;d++)p[d-1]=arguments[d];for(var s=1;s<arguments.length;s++){var h=arguments[s];for(var l in h)v[l]=h[l]}return v}function R(v,m,p){var d=this,s={enumerable:!0};d.hasBeenReset=!1;var h="",l=!1,i=v,o=m,f=p,A=null,x="",T=!0,O="auto",S="start",w=50,E="middle",_=50,c="middle";Object.defineProperty(d,"id",P({},s,{get:function(){return h},set:function(g){h=""+g}})),Object.defineProperty(d,"pauseOnExit",P({},s,{get:function(){return l},set:function(g){l=!!g}})),Object.defineProperty(d,"startTime",P({},s,{get:function(){return i},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");i=g,this.hasBeenReset=!0}})),Object.defineProperty(d,"endTime",P({},s,{get:function(){return o},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");o=g,this.hasBeenReset=!0}})),Object.defineProperty(d,"text",P({},s,{get:function(){return f},set:function(g){f=""+g,this.hasBeenReset=!0}})),Object.defineProperty(d,"region",P({},s,{get:function(){return A},set:function(g){A=g,this.hasBeenReset=!0}})),Object.defineProperty(d,"vertical",P({},s,{get:function(){return x},set:function(g){var b=W(g);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"snapToLines",P({},s,{get:function(){return T},set:function(g){T=!!g,this.hasBeenReset=!0}})),Object.defineProperty(d,"line",P({},s,{get:function(){return O},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=g,this.hasBeenReset=!0}})),Object.defineProperty(d,"lineAlign",P({},s,{get:function(){return S},set:function(g){var b=B(g);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");S=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"position",P({},s,{get:function(){return w},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");w=g,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",P({},s,{get:function(){return E},set:function(g){var b=B(g);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",P({},s,{get:function(){return _},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");_=g,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",P({},s,{get:function(){return c},set:function(g){var b=B(g);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),d.displayState=void 0}return R.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"parseTimeStamp",function(){return M}),D.d(V,"fixLineBreaks",function(){return m}),D.d(V,"VTTParser",function(){return p});var G=D("./src/utils/vttcue.ts"),N=function(){function d(){}var s=d.prototype;return s.decode=function(l,i){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},d}();function M(d){function s(l,i,o,f){return(l|0)*3600+(i|0)*60+(o|0)+parseFloat(f||0)}var h=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?s(h[2],h[3],0,h[4]):s(h[1],h[2],h[3],h[4]):null}var W=function(){function d(){this.values=Object.create(null)}var s=d.prototype;return s.set=function(l,i){!this.get(l)&&i!==""&&(this.values[l]=i)},s.get=function(l,i,o){return o?this.has(l)?this.values[l]:i[o]:this.has(l)?this.values[l]:i},s.has=function(l){return l in this.values},s.alt=function(l,i,o){for(var f=0;f<o.length;++f)if(i===o[f]){this.set(l,i);break}},s.integer=function(l,i){/^-?\d+$/.test(i)&&this.set(l,parseInt(i,10))},s.percent=function(l,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var o=parseFloat(i);if(o>=0&&o<=100)return this.set(l,o),!0}return!1},d}();function B(d,s,h,l){var i=l?d.split(l):[d];for(var o in i){if(typeof i[o]!="string")continue;var f=i[o].split(h);if(f.length!==2)continue;var A=f[0],x=f[1];s(A,x)}}var P=new G.default(0,0,""),R=P.align==="middle"?"middle":"center";function v(d,s,h){var l=d;function i(){var A=M(d);if(A===null)throw new Error("Malformed timestamp: "+l);return d=d.replace(/^[^\sa-zA-Z-]+/,""),A}function o(A,x){var T=new W;B(A,function(w,E){var _;switch(w){case"region":for(var c=h.length-1;c>=0;c--)if(h[c].id===E){T.set(w,h[c].region);break}break;case"vertical":T.alt(w,E,["rl","lr"]);break;case"line":_=E.split(","),T.integer(w,_[0]),T.percent(w,_[0])&&T.set("snapToLines",!1),T.alt(w,_[0],["auto"]),_.length===2&&T.alt("lineAlign",_[1],["start",R,"end"]);break;case"position":_=E.split(","),T.percent(w,_[0]),_.length===2&&T.alt("positionAlign",_[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":T.percent(w,E);break;case"align":T.alt(w,E,["start",R,"end","left","right"]);break}},/:/,/\s/),x.region=T.get("region",null),x.vertical=T.get("vertical","");var O=T.get("line","auto");O==="auto"&&P.line===-1&&(O=-1),x.line=O,x.lineAlign=T.get("lineAlign","start"),x.snapToLines=T.get("snapToLines",!0),x.size=T.get("size",100),x.align=T.get("align",R);var S=T.get("position","auto");S==="auto"&&P.position===50&&(S=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=S}function f(){d=d.replace(/^\s+/,"")}if(f(),s.startTime=i(),f(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);d=d.substr(3),f(),s.endTime=i(),f(),o(d,s)}function m(d){return d.replace(/<br(?: \/)?>/gi,`
`)}var p=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(l){var i=this;l&&(i.buffer+=i.decoder.decode(l,{stream:!0}));function o(){var S=i.buffer,w=0;for(S=m(S);w<S.length&&S[w]!=="\r"&&S[w]!==`
`;)++w;var E=S.substr(0,w);return S[w]==="\r"&&++w,S[w]===`
`&&++w,i.buffer=S.substr(w),E}function f(S){B(S,function(w,E){},/:/)}try{var A="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;A=o();var x=A.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var T=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;T?T=!1:A=o();switch(i.state){case"HEADER":/:/.test(A)?f(A):A||(i.state="ID");continue;case"NOTE":A||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){i.state="NOTE";break}if(!A)continue;if(i.cue=new G.default(0,0,""),i.state="CUE",A.indexOf("-->")===-1){i.cue.id=A;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{v(A,i.cue,i.regionList)}catch(S){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var O=A.indexOf("-->")!==-1;if(!A||O&&(T=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
`),i.cue.text+=A}continue;case"BADCUE":A||(i.state="ID")}}}catch(S){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){l.onparsingerror&&l.onparsingerror(i)}return l.onflush&&l.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(ne,V,D){"use strict";D.r(V),D.d(V,"generateCueId",function(){return p}),D.d(V,"parseWebVTT",function(){return s});var G=D("./src/polyfills/number.ts"),N=D("./src/utils/vttparser.ts"),M=D("./src/demux/id3.ts"),W=D("./src/utils/timescale-conversion.ts"),B=D("./src/remux/mp4-remuxer.ts"),P=/\r\n|\n\r|\n|\r/g,R=function(l,i,o){return o===void 0&&(o=0),l.substr(o,i.length)===i},v=function(l){var i=parseInt(l.substr(-3)),o=parseInt(l.substr(-6,2)),f=parseInt(l.substr(-9,2)),A=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(G.isFiniteNumber)(i)||!Object(G.isFiniteNumber)(o)||!Object(G.isFiniteNumber)(f)||!Object(G.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return i+=1e3*o,i+=60*1e3*f,i+=60*60*1e3*A,i},m=function(l){for(var i=5381,o=l.length;o;)i=i*33^l.charCodeAt(--o);return(i>>>0).toString()};function p(h,l,i){return m(h.toString())+m(l.toString())+m(i)}var d=function(l,i,o){var f=l[i],A=l[f.prevCC];if(!A||!A.new&&f.new){l.ccOffset=l.presentationOffset=f.start,f.new=!1;return}for(;(x=A)!==null&&x!==void 0&&x.new;){var x;l.ccOffset+=f.start-A.start,f.new=!1,f=A,A=l[f.prevCC]}l.presentationOffset=o};function s(h,l,i,o,f,A,x,T){var O=new N.VTTParser,S=Object(M.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(P,`
`).split(`
`),w=[],E=Object(W.toMpegTsClockFromTimescale)(l,i),_="00:00.000",c=0,u=0,g,b=!0,k=!1;O.oncue=function(I){var F=o[f],U=o.ccOffset,C=(c-E)/9e4;if(F!=null&&F.new&&(u!==void 0?U=o.ccOffset=F.start:d(o,f,C)),C&&(U=C-o.presentationOffset),k){var y=I.endTime-I.startTime,j=Object(B.normalizePts)((I.startTime+U-u)*9e4,A*9e4)/9e4;I.startTime=j,I.endTime=j+y}var K=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(K)),I.id||(I.id=p(I.startTime,I.endTime,K)),I.endTime>0&&w.push(I)},O.onparsingerror=function(I){g=I},O.onflush=function(){if(g){T(g);return}x(w)},S.forEach(function(I){if(b)if(R(I,"X-TIMESTAMP-MAP=")){b=!1,k=!0,I.substr(16).split(",").forEach(function(F){R(F,"LOCAL:")?_=F.substr(6):R(F,"MPEGTS:")&&(c=parseInt(F.substr(7)))});try{u=v(_)/1e3}catch(F){k=!1,g=F}return}else I===""&&(b=!1);O.parse(I+`
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(ne,V,D){"use strict";D.r(V);var G=D("./src/utils/logger.ts"),N=D("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,W=function(){function B(R){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=R?R.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var P=B.prototype;return P.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},P.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},P.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},P.load=function(v,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},P.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var s=this.xhrSetup;try{if(s)try{s(p,m.url)}catch(i){p.open("GET",m.url,!0),s(p,m.url)}p.readyState||p.open("GET",m.url,!0);var h=this.context.headers;if(h)for(var l in h)p.setRequestHeader(l,h[l])}catch(i){this.callbacks.onError({code:p.status,text:i.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},P.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var d=m.readyState,s=this.config;if(p.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),d===4){m.onreadystatechange=null,m.onprogress=null;var h=m.status;if(h>=200&&h<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var l,i;if(v.responseType==="arraybuffer"?(l=m.response,i=l.byteLength):(l=m.responseText,i=l.length),p.loaded=p.total=i,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(p,v,l,m),!this.callbacks)return;var f={url:m.responseURL,data:l};this.callbacks.onSuccess(f,p,v,m)}else p.retry>=s.maxRetry||h>=400&&h<499?(G.logger.error(h+" while loading "+v.url),this.callbacks.onError({code:h,text:m.statusText},v,m)):(G.logger.warn(h+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},P.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},P.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},P.getCacheAge=function(){var v=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},B}();V.default=W}}).default})},vHTk:function(ot,We,Z){ot.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(ot,We,Z){"use strict";Z.d(We,"c",function(){return N}),Z.d(We,"b",function(){return M}),Z.d(We,"d",function(){return W}),Z.d(We,"a",function(){return P}),Z.d(We,"e",function(){return R});var ne=Z("9og8"),V=Z("WmNS"),D=Z.n(V),G=Z("ErOA");function N(v){return Object(G.c)("libraries/".concat(v,".json"))}function M(){return Object(G.c)("library_tags.json")}function W(v){return B.apply(this,arguments)}function B(){return B=Object(ne.a)(D.a.mark(function v(m){var p;return D.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Object(G.b)("attachments/".concat(m,".json"));case 2:return p=s.sent,s.abrupt("return",p.status===0);case 4:case"end":return s.stop()}},v)})),B.apply(this,arguments)}function P(v){return Object(G.f)("libraries.json",v)}function R(v,m){return Object(G.g)("libraries/".concat(v,".json"),m)}},y5JW:function(ot,We,Z){"use strict";Z.d(We,"c",function(){return h}),Z.d(We,"a",function(){return l});var ne=Z("DZo9"),V=Z("8z0m"),D=Z("+L6B"),G=Z("2/Rp"),N=Z("9og8"),M=Z("miYZ"),W=Z("tsqr"),B=Z("k1fw"),P=Z("oBTY"),R=Z("WmNS"),v=Z.n(R),m=Z("cDcd"),p=Z.n(m),d=Z("m3rI"),s=Z("wzkS"),h="\u3000\u3000";function l(i){var o=["Bytes","KB","MB","GB","TB"];if(i==0)return"0 Byte";var f=parseInt(""+Math.floor(Math.log(i)/Math.log(1024)),10);return(i/Math.pow(1024,f)).toFixed(1)+" "+o[f]}We.b=function(i){var o=i.value,f=o===void 0?[]:o,A=i.action,x=i.onChange,T=i.className,O=i.maxSize,S=O===void 0?150:O,w=i.title,E=w===void 0?"\u6587\u4EF6\u4E0A\u4F20":w,_=i.accept,c=_===void 0?null:_,u={multiple:!1,fileList:f,accept:c,withCredentials:!0,beforeUpload:function(k){var I=k.size/1024/1024;return!0},action:"".concat(d.a.API_SERVER,"/api/attachments.json"),onChange:function(k){var I,F,U=Object(P.a)(k.fileList);if(U=U.map(function(j){return j.name.indexOf(h)===-1&&(j.name="".concat(j.name).concat(h).concat(l(j.size))),Object(B.a)({},j)}),k.file.status==="done"&&((I=k.file)===null||I===void 0||((F=I.response)===null||F===void 0)?void 0:F.status)===-1){var C,y;W.b.error((C=k.file)===null||C===void 0||((y=C.response)===null||y===void 0)?void 0:y.message),x([]);return}x(U)},onRemove:function(){var b=Object(N.a)(v.a.mark(function I(F){var U,C,y;return v.a.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(U=F.size/1024/1024,!(F.status==="uploading")){K.next=3;break}return K.abrupt("return",!0);case 3:if(U<S){K.next=7;break}return K.abrupt("return",!0);case 7:if(C=F.response?F.response.id:F.uid,!C){K.next=15;break}return K.next=11,Object(s.d)(F.response?F.response.id:F.id);case 11:return y=K.sent,K.abrupt("return",y);case 15:return K.abrupt("return",!0);case 16:case"end":return K.stop()}},I)}));function k(I){return b.apply(this,arguments)}return k}()};function g(b){b.preventDefault(),b.stopPropagation()}return p.a.createElement("div",{className:"single-upload ".concat(T||"")},p.a.createElement(V.a,u,p.a.createElement(G.a,{type:"primary",title:f.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:f.length>0,ghost:!0},E),p.a.createElement("span",{onClick:g,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",S,"M)"," ")))}}}]);