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.
133 lines
797 KiB
133 lines
797 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[224,7,9],{"+NIl":function(Se,xe,V){(function(q){q(V("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(G,D){"use strict";function K(C,S){C.cmdState.push(S)}function P(C){return C.cmdState.length>0?C.cmdState[C.cmdState.length-1]:null}function M(C){var S=C.cmdState.pop();S&&S.closeBracket()}function U(C){for(var S=C.cmdState,E=S.length-1;E>=0;E--){var u=S[E];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function B(C,S,E){return function(){this.name=C,this.bracketNo=0,this.style=S,this.styles=E,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var I={};I.importmodule=B("importmodule","tag",["string","builtin"]),I.documentclass=B("documentclass","tag",["","atom"]),I.usepackage=B("usepackage","tag",["atom"]),I.begin=B("begin","tag",["atom"]),I.end=B("end","tag",["atom"]),I.label=B("label","tag",["atom"]),I.ref=B("ref","tag",["atom"]),I.eqref=B("eqref","tag",["atom"]),I.cite=B("cite","tag",["atom"]),I.bibitem=B("bibitem","tag",["atom"]),I.Bibitem=B("Bibitem","tag",["atom"]),I.RBibitem=B("RBibitem","tag",["atom"]),I.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(C,S){C.f=S}function v(C,S){var E;if(C.match(/^\\[a-zA-Z@]+/)){var u=C.current().slice(1);return E=I.hasOwnProperty(u)?I[u]:I.DEFAULT,E=new E,K(S,E),R(S,L),E.style}if(C.match(/^\\[$&%#{}_]/))return"tag";if(C.match(/^\\[,;!\/\\]/))return"tag";if(C.match("\\["))return R(S,function(l,d){return T(l,d,"\\]")}),"keyword";if(C.match("\\("))return R(S,function(l,d){return T(l,d,"\\)")}),"keyword";if(C.match("$$"))return R(S,function(l,d){return T(l,d,"$$")}),"keyword";if(C.match("$"))return R(S,function(l,d){return T(l,d,"$")}),"keyword";var o=C.next();if(o=="%")return C.skipToEnd(),"comment";if(o=="}"||o=="]"){if(E=P(S),E)E.closeBracket(o),R(S,L);else return"error";return"bracket"}else return o=="{"||o=="["?(E=I.DEFAULT,E=new E,K(S,E),"bracket"):/\d/.test(o)?(C.eatWhile(/[\w.%]/),"atom"):(C.eatWhile(/[\w\-_]/),E=U(S),E.name=="begin"&&(E.argument=C.current()),E.styleIdentifier())}function T(C,S,E){if(C.eatSpace())return null;if(E&&C.match(E))return R(S,v),"keyword";if(C.match(/^\\[a-zA-Z@]+/))return"tag";if(C.match(/^[a-zA-Z]+/))return"variable-2";if(C.match(/^\\[$&%#{}_]/))return"tag";if(C.match(/^\\[,;!\/]/))return"tag";if(C.match(/^[\^_&]/))return"tag";if(C.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(C.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=C.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(C.skipToEnd(),"comment"):"error"}function L(C,S){var E=C.peek(),u;return E=="{"||E=="["?(u=P(S),u.openBracket(E),C.eat(E),R(S,v),"bracket"):/[ \t\r]/.test(E)?(C.eat(E),null):(R(S,v),M(S),v(C,S))}return{startState:function(){var C=D.inMathMode?function(S,E){return T(S,E)}:v;return{cmdState:[],f:C}},copyState:function(C){return{cmdState:C.cmdState.slice(),f:C.f}},token:function(C,S){return S.f(C,S)},blankLine:function(C){C.f=v,C.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"/GNS":function(Se,xe,V){Se.exports=V.p+"static/search1.c4136dd4.png"},"19Vz":function(Se,xe,V){(function(q){q(V("VrN/"))})(function(q){q.defineOption("placeholder","",function(B,I,R){var v=R&&R!=q.Init;if(I&&!v)B.on("blur",P),B.on("change",M),B.on("swapDoc",M),q.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){K(B)}),M(B);else if(!I&&v){B.off("blur",P),B.off("change",M),B.off("swapDoc",M),q.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),G(B);var T=B.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}I&&!B.hasFocus()&&P(B)});function G(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function D(B){G(B);var I=B.state.placeholder=document.createElement("pre");I.style.cssText="height: 0; overflow: visible",I.style.direction=B.getOption("direction"),I.className="CodeMirror-placeholder CodeMirror-line-like";var R=B.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),I.appendChild(R),B.display.lineSpace.insertBefore(I,B.display.lineSpace.firstChild)}function K(B){setTimeout(function(){var I=!1,R=B.getInputField();R.nodeName=="TEXTAREA"?I=!R.value:B.lineCount()==1&&(I=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),I?D(B):G(B)},20)}function P(B){U(B)&&D(B)}function M(B){var I=B.getWrapperElement(),R=U(B);I.className=I.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?D(B):G(B)}function U(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function(Se,xe,V){(function(q){q(V("VrN/"))})(function(q){"use strict";var G={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};q.defineMode("xml",function(K,P){var M=K.indentUnit,U={},B=P.htmlMode?G:D;for(var I in B)U[I]=B[I];for(var I in P)U[I]=P[I];var R,v;function T(a,g){function p(N){return g.tokenize=N,N(a,g)}var b=a.next();if(b=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?p(S("atom","]]>")):null:a.match("--")?p(S("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),p(E(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),g.tokenize=S("meta","?>"),"meta"):(R=a.eat("/")?"closeTag":"openTag",g.tokenize=L,"tag bracket");if(b=="&"){var O;return a.eat("#")?a.eat("x")?O=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):O=a.eatWhile(/[\d]/)&&a.eat(";"):O=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),O?"atom":"error"}else return a.eatWhile(/[^&<]/),null}T.isInText=!0;function L(a,g){var p=a.next();if(p==">"||p=="/"&&a.eat(">"))return g.tokenize=T,R=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return R="equals",null;if(p=="<"){g.tokenize=T,g.state=d,g.tagName=g.tagStart=null;var b=g.tokenize(a,g);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(p)?(g.tokenize=C(p),g.stringStartCol=a.column(),g.tokenize(a,g)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function C(a){var g=function(p,b){for(;!p.eol();)if(p.next()==a){b.tokenize=L;break}return"string"};return g.isInAttribute=!0,g}function S(a,g){return function(p,b){for(;!p.eol();){if(p.match(g)){b.tokenize=T;break}p.next()}return a}}function E(a){return function(g,p){for(var b;(b=g.next())!=null;){if(b=="<")return p.tokenize=E(a+1),p.tokenize(g,p);if(b==">")if(a==1){p.tokenize=T;break}else return p.tokenize=E(a-1),p.tokenize(g,p)}return"meta"}}function u(a,g,p){this.prev=a.context,this.tagName=g,this.indent=a.indented,this.startOfLine=p,(U.doNotIndent.hasOwnProperty(g)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,g){for(var p;;){if(!a.context)return;if(p=a.context.tagName,!U.contextGrabbers.hasOwnProperty(p)||!U.contextGrabbers[p].hasOwnProperty(g))return;o(a)}}function d(a,g,p){return a=="openTag"?(p.tagStart=g.column(),A):a=="closeTag"?f:d}function A(a,g,p){return a=="word"?(p.tagName=g.current(),v="tag",y):U.allowMissingTagName&&a=="endTag"?(v="tag bracket",y(a,g,p)):(v="error",A)}function f(a,g,p){if(a=="word"){var b=g.current();return p.context&&p.context.tagName!=b&&U.implicitlyClosed.hasOwnProperty(p.context.tagName)&&o(p),p.context&&p.context.tagName==b||U.matchClosing===!1?(v="tag",m):(v="tag error",w)}else return U.allowMissingTagName&&a=="endTag"?(v="tag bracket",m(a,g,p)):(v="error",w)}function m(a,g,p){return a!="endTag"?(v="error",m):(o(p),d)}function w(a,g,p){return v="error",m(a,g,p)}function y(a,g,p){if(a=="word")return v="attribute",h;if(a=="endTag"||a=="selfcloseTag"){var b=p.tagName,O=p.tagStart;return p.tagName=p.tagStart=null,a=="selfcloseTag"||U.autoSelfClosers.hasOwnProperty(b)?l(p,b):(l(p,b),p.context=new u(p,b,O==p.indented)),d}return v="error",y}function h(a,g,p){return a=="equals"?c:(U.allowMissing||(v="error"),y(a,g,p))}function c(a,g,p){return a=="string"?s:a=="word"&&U.allowUnquoted?(v="string",y):(v="error",y(a,g,p))}function s(a,g,p){return a=="string"?s:y(a,g,p)}return{startState:function(a){var g={tokenize:T,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(g.baseIndent=a),g},token:function(a,g){if(!g.tagName&&a.sol()&&(g.indented=a.indentation()),a.eatSpace())return null;R=null;var p=g.tokenize(a,g);return(p||R)&&p!="comment"&&(v=null,g.state=g.state(R||p,a,g),v&&(p=v=="error"?p+" error":v)),p},indent:function(a,g,p){var b=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+M;if(b&&b.noIndent)return q.Pass;if(a.tokenize!=L&&a.tokenize!=T)return p?p.match(/^(\s*)/)[0].length:0;if(a.tagName)return U.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+M*(U.multilineTagIndentFactor||1);if(U.alignCDATA&&/<!\[CDATA\[/.test(g))return 0;var O=g&&/^<(\/)?([\w_:\.-]*)/.exec(g);if(O&&O[1])for(;b;)if(b.tagName==O[2]){b=b.prev;break}else if(U.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(O)for(;b;){var N=U.contextGrabbers[b.tagName];if(N&&N.hasOwnProperty(O[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+M:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:U.htmlMode?"html":"xml",helperType:U.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=y)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var g=[],p=a.context;p;p=p.prev)p.tagName&&g.push(p.tagName);return g.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(Se,xe,V){"use strict";var q=V("Awhp"),G=V("KrTs"),D=V("+L6B"),K=V("2/Rp"),P=V("5NDa"),M=V("5rEg"),U=V("0Owb"),B=V("oBTY"),I=V("tJVT"),R=V("PpiC"),v=V("cDcd"),T=V.n(v),L=function(S){var E=S.InputRight,u=S.value,o=u===void 0?[]:u,l=S.onChange,d=l===void 0?function(){}:l,A=Object(R.a)(S,["InputRight","value","onChange"]),f=Object(v.useState)(),m=Object(I.a)(f,2),w=m[0],y=m[1],h=function(a){var g=o.filter(function(p,b){return b!==a});d(g)},c=function(a){if(a.preventDefault(),!w)return;d([].concat(Object(B.a)(o),[w])),y(null)};return T.a.createElement("div",null,T.a.createElement(M.a,Object(U.a)({},A,{value:w,onChange:function(a){return y(a.target.value)},onPressEnter:c,onBlur:c})),E,T.a.createElement("div",{className:"mt20"},o==null?void 0:o.map(function(s,a){return T.a.createElement(G.a,{className:"ml10 mr10",count:"x",onClick:function(){return h(a)}},T.a.createElement(K.a,{type:"primary",ghost:!0},s))})))};xe.a=L},"4qgm":function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RP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3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Se,xe,V){"use strict";V.d(xe,"a",function(){return l});var q=V("Ty5D"),G=V("dI71"),D=V("cDcd"),K=V.n(D),P=V("YS25"),M=V("17x9"),U=V.n(M),B=V("wx14"),I=V("zLVn"),R=V("9R94"),v=function(c){Object(G.a)(s,c);function s(){for(var g,p=arguments.length,b=new Array(p),O=0;O<p;O++)b[O]=arguments[O];return g=c.call.apply(c,[this].concat(b))||this,g.history=Object(P.a)(g.props),g}var a=s.prototype;return a.render=function(){return K.a.createElement(q.c,{history:this.history,children:this.props.children})},s}(K.a.Component),T=function(c){Object(G.a)(s,c);function s(){for(var g,p=arguments.length,b=new Array(p),O=0;O<p;O++)b[O]=arguments[O];return g=c.call.apply(c,[this].concat(b))||this,g.history=Object(P.b)(g.props),g}var a=s.prototype;return a.render=function(){return K.a.createElement(q.c,{history:this.history,children:this.props.children})},s}(K.a.Component),L=function(s,a){return typeof s=="function"?s(a):s},C=function(s,a){return typeof s=="string"?Object(P.c)(s,null,null,a):s},S=function(s){return s},E=K.a.forwardRef;typeof E=="undefined"&&(E=S);function u(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var o=E(function(c,s){var a=c.innerRef,g=c.navigate,p=c.onClick,b=Object(I.a)(c,["innerRef","navigate","onClick"]),O=b.target,N=Object(B.a)({},b,{onClick:function(Q){try{p&&p(Q)}catch(F){throw Q.preventDefault(),F}!Q.defaultPrevented&&Q.button===0&&(!O||O==="_self")&&!u(Q)&&(Q.preventDefault(),g())}});return S!==E?N.ref=s||a:N.ref=a,K.a.createElement("a",N)}),l=E(function(c,s){var a=c.component,g=a===void 0?o:a,p=c.replace,b=c.to,O=c.innerRef,N=Object(I.a)(c,["component","replace","to","innerRef"]);return K.a.createElement(q.e.Consumer,null,function(W){W||Object(R.a)(!1);var Q=W.history,F=C(L(b,W.location),W.location),_=F?Q.createHref(F):"",J=Object(B.a)({},N,{href:_,navigate:function(){var re=L(b,W.location),de=p?Q.replace:Q.push;de(re)}});return S!==E?J.ref=s||O:J.innerRef=O,K.a.createElement(g,J)})});if(!1)var d,A;var f=function(s){return s},m=K.a.forwardRef;typeof m=="undefined"&&(m=f);function w(){for(var c=arguments.length,s=new Array(c),a=0;a<c;a++)s[a]=arguments[a];return s.filter(function(g){return g}).join(" ")}var y=m(function(c,s){var a=c["aria-current"],g=a===void 0?"page":a,p=c.activeClassName,b=p===void 0?"active":p,O=c.activeStyle,N=c.className,W=c.exact,Q=c.isActive,F=c.location,_=c.sensitive,J=c.strict,ee=c.style,re=c.to,de=c.innerRef,Te=Object(I.a)(c,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return K.a.createElement(q.e.Consumer,null,function(ve){ve||Object(R.a)(!1);var pe=F||ve.location,he=C(L(re,pe),pe),me=he.pathname,ae=me&&me.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=ae?Object(q.f)(pe.pathname,{path:ae,exact:W,sensitive:_,strict:J}):null,be=!!(Q?Q(ue,pe):ue),Ue=be?w(N,b):N,Pe=be?Object(B.a)({},ee,{},O):ee,He=Object(B.a)({"aria-current":be&&g||null,className:Ue,style:Pe,to:he},Te);return f!==m?He.ref=s||de:He.innerRef=de,K.a.createElement(l,He)})});if(!1)var h},"5D2P":function(Se,xe){Se.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ieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(Se,xe,V){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),G=new Uint8Array(16);function D(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(G)}var K=/^(?:[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 P(L){return typeof L=="string"&&K.test(L)}for(var M=P,U=[],B=0;B<256;++B)U.push((B+256).toString(16).substr(1));function I(L){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=(U[L[C+0]]+U[L[C+1]]+U[L[C+2]]+U[L[C+3]]+"-"+U[L[C+4]]+U[L[C+5]]+"-"+U[L[C+6]]+U[L[C+7]]+"-"+U[L[C+8]]+U[L[C+9]]+"-"+U[L[C+10]]+U[L[C+11]]+U[L[C+12]]+U[L[C+13]]+U[L[C+14]]+U[L[C+15]]).toLowerCase();if(!M(S))throw TypeError("Stringified UUID is invalid");return S}var R=I;function v(L,C,S){L=L||{};var E=L.random||(L.rng||D)();if(E[6]=E[6]&15|64,E[8]=E[8]&63|128,C){S=S||0;for(var u=0;u<16;++u)C[S+u]=E[u];return C}return R(E)}var T=xe.a=v},"7ZXX":function(Se,xe,V){Se.exports=V.p+"static/err.6e7c5817.png"},"7ahc":function(Se,xe,V){"use strict";V.d(xe,"a",function(){return A});var q=V("k1fw"),G=V("0Owb"),D=V("+L6B"),K=V("2/Rp"),P=V("y8nQ"),M=V("Vl3Y"),U=V("tJVT"),B=V("OaEy"),I=V("2fM7"),R=V("cDcd"),v=V.n(R),T=V("VrN/"),L=V.n(T),C=V("p77/"),S=V.n(C),E=V("c5Ni"),u=V.n(E),o=I.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};xe.b=function(f){var m=f.callback,w=f.onCancel,y=Object(R.useState)("python"),h=Object(U.a)(y,2),c=h[0],s=h[1];function a(p){s(d[p][1])}function g(p){m(p)}return v.a.createElement(M.a,Object(G.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:g}),v.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(I.a,{onChange:a},Object.keys(d).map(function(p){return v.a.createElement(o,{key:p,value:p},d[p][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:c})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(K.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function A(f){var m=f.value,w=f.onChange,y=f.mode,h=f.options,c=h===void 0?{}:h,s=Object(R.useRef)(),a=Object(R.useState)(),g=Object(U.a)(a,2),p=g[0],b=g[1];return Object(R.useEffect)(function(){if(p){function O(N){var W=N.getValue();w&&w(W)}return p.on("change",O),function(){p.off("change",O)}}},[p,w]),Object(R.useEffect)(function(){p&&p.setOption("mode",y)},[p,y]),Object(R.useEffect)(function(){p&&((m!==p.getValue()||m==="")&&setTimeout(function(){p.setValue(m||" ")},300))},[p,m]),Object(R.useEffect)(function(){if(s.current&&!p){var O=L.a.fromTextArea(s.current,Object(q.a)({mode:y,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));b(O)}},[s.current,p]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:s}))}},"7ixt":function(Se,xe,V){"use strict";V.d(xe,"a",function(){return D});var q={adjustX:1,adjustY:1},G=[0,0],D={left:{points:["cr","cl"],overflow:q,offset:[-4,0],targetOffset:G},right:{points:["cl","cr"],overflow:q,offset:[4,0],targetOffset:G},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:G},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:G},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:G},leftTop:{points:["tr","tl"],overflow:q,offset:[-4,0],targetOffset:G},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:G},rightTop:{points:["tl","tr"],overflow:q,offset:[4,0],targetOffset:G},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:G},rightBottom:{points:["bl","br"],overflow:q,offset:[4,0],targetOffset:G},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:G},leftBottom:{points:["br","bl"],overflow:q,offset:[-4,0],targetOffset:G}},K=D},"7v3h":function(Se,xe,V){Se.exports=V.p+"static/empty2.dd73f390.png"},"8/bI":function(Se,xe,V){Se.exports=V.p+"static/empty.8918e228.png"},"8EBN":function(Se,xe,V){(function(q){q(V("VrN/"))})(function(q){"use strict";q.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 G=0;G<q.modeInfo.length;G++){var D=q.modeInfo[G];D.mimes&&(D.mime=D.mimes[0])}q.findModeByMIME=function(K){K=K.toLowerCase();for(var P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.mime==K)return M;if(M.mimes){for(var U=0;U<M.mimes.length;U++)if(M.mimes[U]==K)return M}}if(/\+xml$/.test(K))return q.findModeByMIME("application/xml");if(/\+json$/.test(K))return q.findModeByMIME("application/json")},q.findModeByExtension=function(K){K=K.toLowerCase();for(var P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.ext){for(var U=0;U<M.ext.length;U++)if(M.ext[U]==K)return M}}},q.findModeByFileName=function(K){for(var P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.file&&M.file.test(K))return M}var U=K.lastIndexOf("."),B=U>-1&&K.substring(U+1,K.length);if(B)return q.findModeByExtension(B)},q.findModeByName=function(K){K=K.toLowerCase();for(var P=0;P<q.modeInfo.length;P++){var M=q.modeInfo[P];if(M.name.toLowerCase()==K)return M;if(M.alias){for(var U=0;U<M.alias.length;U++)if(M.alias[U].toLowerCase()==K)return M}}}})},"8hTe":function(Se,xe,V){Se.exports={button:"button___1wy9m"}},"9Bee":function(Se,xe,V){"use strict";var q=V("DYRE"),G=V("zeV3"),D=V("+L6B"),K=V("2/Rp"),P=V("k1fw"),M=V("tJVT"),U=V("cDcd"),B=V.n(U),I=V("vg9a"),R=V("DlQD"),v=V.n(R),T=V("rUJ1");function L(pe,he){var me=pe.match(/^(\s+)(?:```)/);if(me===null)return he;var ae=me[1];return he.split(`
|
|
`).map(function(ue){var be=ue.match(/^\s+/);if(be===null)return ue;var Ue=Object(M.a)(be,1),Pe=Ue[0];return Pe.length>=ae.length?ue.slice(ae.length):ue}).join(`
|
|
`)}var C=[],S=["<ul>"],E=new v.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function o(){C.length=0,S=["<ul>"]}var l={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function d(pe,he,me,ae){if(he>=pe.length||pe[he].level<=me)return he;var ue=pe[he];ae.push("<li><a href='#"+ue.anchor+"'>"+ue.text+"</a>"),he++;var be=[];return he=d(pe,he,ue.level,be),be.length>0&&(ae.push("<ul>"),be.forEach(function(Ue){ae.push(Ue)}),ae.push("</ul>")),ae.push("</li>"),he=d(pe,he,me,ae),he}function A(){return d(C,0,0,S),S.push("</ul>"),S.join("")}var f={heading:function(he){var me=u.exec(he);if(me)return{type:"heading",raw:me[0],depth:me[1].length,text:me[2]}},fences:function(he){var me=this.rules.block.fences.exec(he);if(me){var ae=me[0],ue=L(ae,me[3]||""),be=me[2]?me[2].trim():me[2];if(["latex","katex","math"].indexOf(be)>=0){var Ue=y(),Pe=ue;ue=Ue,h[Ue]={type:"block",expression:Pe}}return{type:"code",raw:ae,lang:be,text:ue}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,y=function(){return"__special_katext_id_".concat(w++,"__")},h={};function c(){return h}function s(){w=0,h={}}function a(pe){return pe=pe.replace(m,function(he,me){var ae=y();return h[ae]={type:"inline",expression:me},ae}),pe}var g=E.listitem;E.listitem=function(pe){return g(a(pe))};var p=E.paragraph;E.paragraph=function(pe){return p(a(pe))};var b=E.tablecell;E.tablecell=function(pe,he){return b(a(pe),he)},E.code=function(pe,he,me){var ae=(he||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(pe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(he,'">').concat(me?pe:Object(T.escape)(pe,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(me?pe:Object(T.escape)(pe,!0))+"</code></pre>"},E.heading=function(pe,he,me){var ae=this.options.headerPrefix+me.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return C.push({anchor:ae,level:he,text:pe}),"<h"+he+' id="'+ae+'">'+pe+"</h"+he+">"},v.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),v.a.use({tokenizer:f,renderer:E});var O=v.a,N=V("SJMd"),W=V("ulZh"),Q=V.n(W),F=V("m3rI"),_=V("Oy/b"),J=V("p5ED"),ee=V("8hTe"),re=V.n(ee),de=/<pre[^>]*>/g;function Te(pe){var he=document.createElement("div");return he.innerHTML=pe,he.childNodes.length===0?"":he.childNodes[0].nodeValue}var ve=xe.a=function(pe){var he=pe.value,me=he===void 0?"":he,ae=pe.edit,ue=ae===void 0?!1:ae,be=pe.className,Ue=pe.showTextOnly,Pe=pe.showLines,He=pe.replaces,Je=pe.zoomImg,Le=pe.hasMask,De=pe.style,ke=De===void 0?{}:De,ze=pe.stylesPrev,Ge=ze===void 0?{}:ze,Ie=String(me),we=Object(U.useRef)(),Ze=Object(U.useRef)(),qe=Object(U.useState)(""),Qe=Object(M.a)(qe,2),Ve=Qe[0],tt=Qe[1],Xe=Object(U.useState)("office"),Ne=Object(M.a)(Xe,2),ge=Ne[0],Fe=Ne[1],je=Object(U.useMemo)(function(){try{var oe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Y=/\"\/api\/attachments\/|\"\/attachments\/download\//g,X=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ie=Ie.replace(oe,"("+F.a.API_SERVER+"/api/attachments/").replace(Y,'"'+F.a.API_SERVER+"/api/attachments/").replace(X,'"'+F.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(ye){}var Z=O(Ie),te=c();if(Ie.match(/\[TOC\]/)&&(Z=Z.replace("<p>[TOC]</p>",A()),o()),Z=Z.replace(/(__special_katext_id_\d+__)/g,function(ye,Ce){var Ye=te[Ce],at=Ye.type,rt=Ye.expression;return Object(_.renderToString)(Te(rt)||"",{displayMode:at==="block",throwOnError:!1,output:"html"})}),Z=Z.replace(/▁/g,"\u2581\u2581\u2581"),s(),Ue){var se=document.createElement("div");return se.innerHTML=Z,se.innerText}return setTimeout(function(){return le()},500),Z},[Ie]),Ee=Object(U.useRef)();l.WebkitLineClamp=Pe,Pe&&(ke=Object(P.a)(Object(P.a)({},ke),l));function Oe(oe){var Y=oe.target;if(Y.tagName.toUpperCase()==="IMG"){if(Je){var X=Y.getAttribute("src");tt(X),Fe("image")}}else if(Y.tagName.toUpperCase()==="A"){var Z=Y.getAttribute("href");if(Z.indexOf("office")>-1)oe.preventDefault(),tt(Z),Fe("office");else if(Z.indexOf("application/pdf")>-1)oe.preventDefault(),tt(Z),Fe("pdf");else if(Z.indexOf("text/html")>-1)oe.preventDefault(),tt(Z),Fe("html");else if(Z.startsWith("#")){oe.preventDefault();var te=document.getElementById(Z.replace("#",""));te&&te.scrollIntoView(!0)}}}var le=function(){var Y,X=(Y=Ee.current)===null||Y===void 0?void 0:Y.querySelectorAll("video");X==null||X.forEach(function(Z){if(Z.oncontextmenu=function(){return!1},Z.src.indexOf(".m3u8")>-1&&!Z.canPlayType("application/vnd.apple.mpegurl")){if(Q.a.isSupported()){var te=new Q.a;te.loadSource(Z.src),te.attachMedia(Z)}}})};Object(U.useEffect)(function(){if(Ee.current&&je&&(je.match(de)&&window.PR.prettyPrint()),Ee.current)return Ee.current.addEventListener("click",Oe),function(){Ee.current.removeEventListener("click",Oe),s(),o()}},[je,Ee.current,Oe]);var ie=function(Y){if(!ue)return;Y.target.nodeName==="IMG"?(we.current.style.display="flex",we.current.style.width=Y.target.clientWidth+"px",we.current.style.height=Y.target.clientHeight+"px",we.current.style.top=Y.target.offsetTop+"px",we.current.style.left=Y.target.offsetLeft+"px",Ze.current.src=Y.target.getAttribute("src")):we.current.style.display="none"};return B.a.createElement("div",{style:{position:"relative"}},B.a.createElement("div",{ref:Ee,style:Object(P.a)({},ke),className:"".concat(be||""," markdown-body ").concat(re.a.mdBody),onMouseOver:ie,dangerouslySetInnerHTML:{__html:je}}),B.a.createElement("div",{ref:we,className:re.a.button},B.a.createElement(G.a,null,B.a.createElement(K.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),B.a.createElement(K.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),B.a.createElement("img",{ref:Ze,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),B.a.createElement(J.a,{close:!0,data:Ve,type:Ve!=null&&Ve.length?ge:"",style:Object(P.a)({},Ge),onClose:function(){return tt("")}}))}},"9VGf":function(Se,xe,V){"use strict";V.d(xe,"a",function(){return D});var q=V("cDcd"),G=V.n(q);function D(K,P){var M=Object(q.useRef)();Object(q.useEffect)(function(){M.current=K}),Object(q.useEffect)(function(){function U(){M.current()}if(P!==null){var B=setInterval(U,P);return function(){return clearInterval(B)}}},[P])}},"9ZNV":function(Se,xe,V){"use strict";V.d(xe,"a",function(){return R});var q=V("0Owb"),G=V("+L6B"),D=V("2/Rp"),K=V("cDcd"),P=V.n(K),M=V("UUDw"),U=V.n(M),B=V("TSYQ"),I=V.n(B),R=function(T){var L=T.cancelText,C=L===void 0?"\u53D6\u6D88":L,S=T.okText,E=S===void 0?"\u786E\u5B9A":S,u=T.loading,o=u===void 0?!1:u,l=T.hasOkBtn,d=l===void 0?!0:l,A=T.okButtonProps,f=A===void 0?{}:A,m=T.onCancel,w=m===void 0?function(){}:m,y=T.onOk,h=y===void 0?function(){}:y,c=T.className,s=c===void 0?"":c;return P.a.createElement("div",{className:I()(U.a.buttonFixed,s)},P.a.createElement("div",{className:U.a.buttonWrap},P.a.createElement(D.a,{size:"large",className:"".concat(U.a.button," mr20"),onClick:w},C),d&&P.a.createElement(D.a,Object(q.a)({size:"large",type:"primary",className:"".concat(U.a.button," mr20"),loading:o,onClick:h},f),E)))}},"A/g1":function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZX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6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Se,xe,V){(function(q){q(V("VrN/"),V("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(I,R,v){if(v!=q.Init&&v&&I.removeKeyMap("autoCloseTags"),!R)return;var T={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(T["'/'"]=function(L){return M(L)}),(typeof R!="object"||R.whenOpening!==!1)&&(T["'>'"]=function(L){return K(L)}),I.addKeyMap(T)});var G=["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 K(I){if(I.getOption("disableInput"))return q.Pass;for(var R=I.listSelections(),v=[],T=I.getOption("autoCloseTags"),L=0;L<R.length;L++){if(!R[L].empty())return q.Pass;var C=R[L].head,S=I.getTokenAt(C),E=q.innerMode(I.getMode(),S.state),u=E.state,o=E.mode.xmlCurrentTag&&E.mode.xmlCurrentTag(u),l=o&&o.name;if(!l)return q.Pass;var d=E.mode.configuration=="html",A=typeof T=="object"&&T.dontCloseTags||d&&G,f=typeof T=="object"&&T.indentTags||d&&D;S.end>C.ch&&(l=l.slice(0,l.length-S.end+C.ch));var m=l.toLowerCase();if(!l||S.type=="string"&&(S.end!=C.ch||!/[\"\']/.test(S.string.charAt(S.string.length-1))||S.string.length==1)||S.type=="tag"&&o.close||S.string.indexOf("/")==C.ch-S.start-1||A&&U(A,m)>-1||B(I,E.mode.xmlCurrentContext&&E.mode.xmlCurrentContext(u)||[],l,C,!0))return q.Pass;var w=typeof T=="object"&&T.emptyTags;if(w&&U(w,l)>-1){v[L]={text:"/>",newPos:q.Pos(C.line,C.ch+2)};continue}var y=f&&U(f,m)>-1;v[L]={indent:y,text:">"+(y?`
|
|
|
|
`:"")+"</"+l+">",newPos:y?q.Pos(C.line+1,0):q.Pos(C.line,C.ch+1)}}for(var h=typeof T=="object"&&T.dontIndentOnAutoClose,L=R.length-1;L>=0;L--){var c=v[L];I.replaceRange(c.text,R[L].head,R[L].anchor,"+insert");var s=I.listSelections().slice(0);s[L]={head:c.newPos,anchor:c.newPos},I.setSelections(s),!h&&c.indent&&(I.indentLine(c.newPos.line,null,!0),I.indentLine(c.newPos.line+1,null,!0))}}function P(I,R){for(var v=I.listSelections(),T=[],L=R?"/":"</",C=I.getOption("autoCloseTags"),S=typeof C=="object"&&C.dontIndentOnSlash,E=0;E<v.length;E++){if(!v[E].empty())return q.Pass;var u=v[E].head,o=I.getTokenAt(u),l=q.innerMode(I.getMode(),o.state),d=l.state;if(R&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=u.ch-1))return q.Pass;var A,f=l.mode.name!="xml"&&I.getMode().name=="htmlmixed";if(f&&l.mode.name=="javascript")A=L+"script";else if(f&&l.mode.name=="css")A=L+"style";else{var m=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(d);if(!m||m.length&&B(I,m,m[m.length-1],u))return q.Pass;A=L+m[m.length-1]}I.getLine(u.line).charAt(o.end)!=">"&&(A+=">"),T[E]=A}if(I.replaceSelections(T),v=I.listSelections(),!S)for(var E=0;E<v.length;E++)(E==v.length-1||v[E].head.line<v[E+1].head.line)&&I.indentLine(v[E].head.line)}function M(I){return I.getOption("disableInput")?q.Pass:P(I,!0)}q.commands.closeTag=function(I){return P(I)};function U(I,R){if(I.indexOf)return I.indexOf(R);for(var v=0,T=I.length;v<T;++v)if(I[v]==R)return v;return-1}function B(I,R,v,T,L){if(!q.scanForClosingTag)return!1;var C=Math.min(I.lastLine()+1,T.line+500),S=q.scanForClosingTag(I,T,null,C);if(!S||S.tag!=v)return!1;for(var E=L?1:0,u=R.length-1;u>=0&&R[u]==v;u--)++E;T=S.to;for(var u=1;u<E;u++){var o=q.scanForClosingTag(I,T,null,C);if(!o||o.tag!=v)return!1;T=o.to}return!0}})},BjJ7:function(Se,xe,V){"use strict";V.d(xe,"d",function(){return G}),V.d(xe,"c",function(){return D}),V.d(xe,"e",function(){return K}),V.d(xe,"b",function(){return P}),V.d(xe,"a",function(){return U});var q=V("m3rI");function G(B){var I=!0;if(B.length>0){for(var R=0;R<B.length;R++)if(B[R].compile_success==0||!B[R].compile_success){I=!1;break}}else I=!1;return I}function D(B){for(var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;v<B.length;v++){var T=B[v],L=I?"".concat(I,"/").concat(T.name):"".concat(T.name);R.push({title:T.name,isLeaf:!(T.type==="tree"),key:L})}return R}function K(B,I,R){for(var v=0;v<B.length;v++){var T=B[v];if(T.key===I){T.children=R;break}T.children&&K(T.children,I,R)}return B}function P(B,I,R){var v;return function(){var T=this,L=arguments,C=function(){v=null,R||B.apply(T,L)},S=R&&!v;clearTimeout(v),v=setTimeout(C,I),S&&B.apply(T,L)}}var M=!0,U=q.a.API_SERVER},"C+DQ":function(Se,xe,V){},CJF0:function(Se,xe,V){"use strict";var q=V("14J3"),G=V("BMrR"),D=V("+L6B"),K=V("2/Rp"),P=V("jCWc"),M=V("kPKH"),U=V("PpiC"),B=V("cDcd"),I=V.n(B),R=V("Ty5D"),v=V("9kvl"),T=V("55Ip"),L=V("lzim"),C=V("nZ20"),S=V.n(C),E=function(o){var l,d,A,f,m=o.shixunsDetail,w=o.dispatch,y=o.loading,h=o.match,c=o.data,s=c===void 0?{}:c,a=o.title,g=Object(U.a)(o,["shixunsDetail","dispatch","loading","match","data","title"]),p=Object(R.i)(),b=!(((l=m.detail)===null||l===void 0?void 0:l.identity)>4||((d=m.detail)===null||d===void 0?void 0:d.identity)===void 0||((A=m.detail)===null||A===void 0?void 0:A.shixun_status)===2||((f=m.detail)===null||f===void 0?void 0:f.shixun_status)===1);return I.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(S.a.wrap)},I.a.createElement(G.a,{gutter:[20,20],align:"middle"},I.a.createElement(M.a,{flex:1},I.a.createElement("span",{className:S.a.icons},I.a.createElement("img",{src:L.e,width:"14"})),I.a.createElement("span",{className:"font16"},"\u7B2C ",s==null?void 0:s.position," \u5173\uFF1A",a)),I.a.createElement(M.a,null,(s==null?void 0:s.prev_challenge)&&I.a.createElement(K.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var N,W=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",Q="/shixuns/".concat(p.id,"/challenges/").concat(s==null||((N=s.prev_challenge)===null||N===void 0)?void 0:N.id).concat(W);v.d.replace(Q)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&I.a.createElement(K.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var N,W=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",Q="/shixuns/".concat(p.id,"/challenges/").concat(s==null||((N=s.next_challenge)===null||N===void 0)?void 0:N.id).concat(W);v.d.replace(Q)}},"\u4E0B\u4E00\u5173"),b&&I.a.createElement(K.a,{type:"primary"},I.a.createElement(T.a,{to:"/shixuns/".concat(p.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),b&&I.a.createElement(K.a,{type:"primary",className:"ml5"},I.a.createElement(T.a,{to:"/shixuns/".concat(p.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),I.a.createElement(K.a,{type:"primary",className:"ml5"},I.a.createElement(T.a,{to:"/shixuns/".concat(p.id,"/challenges")},"\u8FD4\u56DE")))))};xe.a=Object(v.a)(function(u){var o=u.shixunsDetail,l=u.newCourse,d=u.loading,A=u.globalSetting;return{shixunsDetail:o,newCourse:l,globalSetting:A,loading:d.effects}})(E)},DlQD:function(Se,xe,V){(function(q,G){Se.exports=G()})(this,function(){"use strict";function q(le,ie){for(var oe=0;oe<ie.length;oe++){var Y=ie[oe];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(le,Y.key,Y)}}function G(le,ie,oe){return ie&&q(le.prototype,ie),oe&&q(le,oe),le}function D(le,ie){if(!le)return;if(typeof le=="string")return K(le,ie);var oe=Object.prototype.toString.call(le).slice(8,-1);if(oe==="Object"&&le.constructor&&(oe=le.constructor.name),oe==="Map"||oe==="Set")return Array.from(le);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return K(le,ie)}function K(le,ie){(ie==null||ie>le.length)&&(ie=le.length);for(var oe=0,Y=new Array(ie);oe<ie;oe++)Y[oe]=le[oe];return Y}function P(le,ie){var oe;if(typeof Symbol=="undefined"||le[Symbol.iterator]==null){if(Array.isArray(le)||(oe=D(le))||ie&&le&&typeof le.length=="number"){oe&&(le=oe);var Y=0;return function(){return Y>=le.length?{done:!0}:{done:!1,value:le[Y++]}}}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 oe=le[Symbol.iterator](),oe.next.bind(oe)}function M(le,ie){return ie={exports:{}},le(ie,ie.exports),ie.exports}var U=M(function(le){function ie(){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 oe(Y){le.exports.defaults=Y}le.exports={defaults:ie(),getDefaults:ie,changeDefaults:oe}}),B=U.defaults,I=U.getDefaults,R=U.changeDefaults,v=/[&<>"']/,T=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,C=/[<>"']|&(?!#?\w+;)/g,S={"&":"&","<":"<",">":">",'"':""","'":"'"},E=function(ie){return S[ie]};function u(le,ie){if(ie){if(v.test(le))return le.replace(T,E)}else if(L.test(le))return le.replace(C,E);return le}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(le){return le.replace(o,function(ie,oe){return oe=oe.toLowerCase(),oe==="colon"?":":oe.charAt(0)==="#"?oe.charAt(1)==="x"?String.fromCharCode(parseInt(oe.substring(2),16)):String.fromCharCode(+oe.substring(1)):""})}var d=/(^|[^\[])\^/g;function A(le,ie){le=le.source||le,ie=ie||"";var oe={replace:function(X,Z){return Z=Z.source||Z,Z=Z.replace(d,"$1"),le=le.replace(X,Z),oe},getRegex:function(){return new RegExp(le,ie)}};return oe}var f=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(le,ie,oe){if(le){var Y;try{Y=decodeURIComponent(l(oe)).replace(f,"").toLowerCase()}catch(X){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}ie&&!m.test(oe)&&(oe=a(ie,oe));try{oe=encodeURI(oe).replace(/%25/g,"%")}catch(X){return null}return oe}var y={},h=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(le,ie){y[" "+le]||(h.test(le)?y[" "+le]=le+"/":y[" "+le]=O(le,"/",!0)),le=y[" "+le];var oe=le.indexOf(":")===-1;return ie.substring(0,2)==="//"?oe?ie:le.replace(c,"$1")+ie:ie.charAt(0)==="/"?oe?ie:le.replace(s,"$1")+ie:le+ie}var g={exec:function(){}};function p(le){for(var ie=1,oe,Y;ie<arguments.length;ie++){oe=arguments[ie];for(Y in oe)Object.prototype.hasOwnProperty.call(oe,Y)&&(le[Y]=oe[Y])}return le}function b(le,ie){var oe=le.replace(/\|/g,function(Z,te,se){for(var ye=!1,Ce=te;--Ce>=0&&se[Ce]==="\\";)ye=!ye;return ye?"|":" |"}),Y=oe.split(/ \|/),X=0;if(Y.length>ie)Y.splice(ie);else for(;Y.length<ie;)Y.push("");for(;X<Y.length;X++)Y[X]=Y[X].trim().replace(/\\\|/g,"|");return Y}function O(le,ie,oe){var Y=le.length;if(Y===0)return"";for(var X=0;X<Y;){var Z=le.charAt(Y-X-1);if(Z===ie&&!oe)X++;else if(Z!==ie&&oe)X++;else break}return le.substr(0,Y-X)}function N(le,ie){if(le.indexOf(ie[1])===-1)return-1;for(var oe=le.length,Y=0,X=0;X<oe;X++)if(le[X]==="\\")X++;else if(le[X]===ie[0])Y++;else if(le[X]===ie[1]&&(Y--,Y<0))return X;return-1}function W(le){le&&le.sanitize&&!le.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 Q={escape:u,unescape:l,edit:A,cleanUrl:w,resolveUrl:a,noopTest:g,merge:p,splitCells:b,rtrim:O,findClosingBracket:N,checkSanitizeDeprecation:W},F=U.defaults,_=Q.rtrim,J=Q.splitCells,ee=Q.escape,re=Q.findClosingBracket;function de(le,ie,oe){var Y=ie.href,X=ie.title?ee(ie.title):null,Z=le[1].replace(/\\([\[\]])/g,"$1");return le[0].charAt(0)!=="!"?{type:"link",raw:oe,href:Y,title:X,text:Z}:{type:"image",raw:oe,href:Y,title:X,text:ee(Z)}}function Te(le,ie){var oe=le.match(/^(\s+)(?:```)/);if(oe===null)return ie;var Y=oe[1];return ie.split(`
|
|
`).map(function(X){var Z=X.match(/^\s+/);if(Z===null)return X;var te=Z[0];return te.length>=Y.length?X.slice(Y.length):X}).join(`
|
|
`)}var ve=function(){function le(oe){this.options=oe||F}var ie=le.prototype;return ie.space=function(Y){var X=this.rules.block.newline.exec(Y);if(X)return X[0].length>1?{type:"space",raw:X[0]}:{raw:`
|
|
`}},ie.code=function(Y,X){var Z=this.rules.block.code.exec(Y);if(Z){var te=X[X.length-1];if(te&&te.type==="paragraph")return{raw:Z[0],text:Z[0].trimRight()};var se=Z[0].replace(/^ {4}/gm,"");return{type:"code",raw:Z[0],codeBlockStyle:"indented",text:this.options.pedantic?se:_(se,`
|
|
`)}}},ie.fences=function(Y){var X=this.rules.block.fences.exec(Y);if(X){var Z=X[0],te=Te(Z,X[3]||"");return{type:"code",raw:Z,lang:X[2]?X[2].trim():X[2],text:te}}},ie.heading=function(Y){var X=this.rules.block.heading.exec(Y);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},ie.nptable=function(Y){var X=this.rules.block.nptable.exec(Y);if(X){var Z={type:"table",header:J(X[1].replace(/^ *| *\| *$/g,"")),align:X[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:X[3]?X[3].replace(/\n$/,"").split(`
|
|
`):[],raw:X[0]};if(Z.header.length===Z.align.length){var te=Z.align.length,se;for(se=0;se<te;se++)/^ *-+: *$/.test(Z.align[se])?Z.align[se]="right":/^ *:-+: *$/.test(Z.align[se])?Z.align[se]="center":/^ *:-+ *$/.test(Z.align[se])?Z.align[se]="left":Z.align[se]=null;for(te=Z.cells.length,se=0;se<te;se++)Z.cells[se]=J(Z.cells[se],Z.header.length);return Z}}},ie.hr=function(Y){var X=this.rules.block.hr.exec(Y);if(X)return{type:"hr",raw:X[0]}},ie.blockquote=function(Y){var X=this.rules.block.blockquote.exec(Y);if(X){var Z=X[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:X[0],text:Z}}},ie.list=function(Y){var X=this.rules.block.list.exec(Y);if(X){for(var Z=X[0],te=X[2],se=te.length>1,ye=te[te.length-1]===")",Ce={type:"list",raw:Z,ordered:se,start:se?+te.slice(0,-1):"",loose:!1,items:[]},Ye=X[0].match(this.rules.block.item),at=!1,rt,xt,ht,st,Ct,yt,Ft,Bt=Ye.length,Et=0;Et<Bt;Et++)rt=Ye[Et],Z=rt,xt=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
|
|
`)&&(xt-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+xt+"}","gm"),"")),Et!==Bt-1&&(ht=this.rules.block.bullet.exec(Ye[Et+1])[0],(se?ht.length===1||!ye&&ht[ht.length-1]===")":ht.length>1||this.options.smartLists&&ht!==te)&&(st=Ye.slice(Et+1).join(`
|
|
`),Ce.raw=Ce.raw.substring(0,Ce.raw.length-st.length),Et=Bt-1)),Ct=at||/\n\n(?!\s*$)/.test(rt),Et!==Bt-1&&(at=rt.charAt(rt.length-1)===`
|
|
`,Ct||(Ct=at)),Ct&&(Ce.loose=!0),yt=/^\[[ xX]\] /.test(rt),Ft=void 0,yt&&(Ft=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),Ce.items.push({type:"list_item",raw:Z,task:yt,checked:Ft,loose:Ct,text:rt});return Ce}},ie.html=function(Y){var X=this.rules.block.html.exec(Y);if(X)return{type:this.options.sanitize?"paragraph":"html",raw:X[0],pre:!this.options.sanitizer&&(X[1]==="pre"||X[1]==="script"||X[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(X[0]):ee(X[0]):X[0]}},ie.def=function(Y){var X=this.rules.block.def.exec(Y);if(X){X[3]&&(X[3]=X[3].substring(1,X[3].length-1));var Z=X[1].toLowerCase().replace(/\s+/g," ");return{tag:Z,raw:X[0],href:X[2],title:X[3]}}},ie.table=function(Y){var X=this.rules.block.table.exec(Y);if(X){var Z={type:"table",header:J(X[1].replace(/^ *| *\| *$/g,"")),align:X[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:X[3]?X[3].replace(/\n$/,"").split(`
|
|
`):[]};if(Z.header.length===Z.align.length){Z.raw=X[0];var te=Z.align.length,se;for(se=0;se<te;se++)/^ *-+: *$/.test(Z.align[se])?Z.align[se]="right":/^ *:-+: *$/.test(Z.align[se])?Z.align[se]="center":/^ *:-+ *$/.test(Z.align[se])?Z.align[se]="left":Z.align[se]=null;for(te=Z.cells.length,se=0;se<te;se++)Z.cells[se]=J(Z.cells[se].replace(/^ *\| *| *\| *$/g,""),Z.header.length);return Z}}},ie.lheading=function(Y){var X=this.rules.block.lheading.exec(Y);if(X)return{type:"heading",raw:X[0],depth:X[2].charAt(0)==="="?1:2,text:X[1]}},ie.paragraph=function(Y){var X=this.rules.block.paragraph.exec(Y);if(X)return{type:"paragraph",raw:X[0],text:X[1].charAt(X[1].length-1)===`
|
|
`?X[1].slice(0,-1):X[1]}},ie.text=function(Y,X){var Z=this.rules.block.text.exec(Y);if(Z){var te=X[X.length-1];return te&&te.type==="text"?{raw:Z[0],text:Z[0]}:{type:"text",raw:Z[0],text:Z[0]}}},ie.escape=function(Y){var X=this.rules.inline.escape.exec(Y);if(X)return{type:"escape",raw:X[0],text:ee(X[1])}},ie.tag=function(Y,X,Z){var te=this.rules.inline.tag.exec(Y);if(te)return!X&&/^<a /i.test(te[0])?X=!0:X&&/^<\/a>/i.test(te[0])&&(X=!1),!Z&&/^<(pre|code|kbd|script)(\s|>)/i.test(te[0])?Z=!0:Z&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(te[0])&&(Z=!1),{type:this.options.sanitize?"text":"html",raw:te[0],inLink:X,inRawBlock:Z,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):ee(te[0]):te[0]}},ie.link=function(Y){var X=this.rules.inline.link.exec(Y);if(X){var Z=re(X[2],"()");if(Z>-1){var te=X[0].indexOf("!")===0?5:4,se=te+X[1].length+Z;X[2]=X[2].substring(0,Z),X[0]=X[0].substring(0,se).trim(),X[3]=""}var ye=X[2],Ce="";if(this.options.pedantic){var Ye=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ye);Ye?(ye=Ye[1],Ce=Ye[3]):Ce=""}else Ce=X[3]?X[3].slice(1,-1):"";ye=ye.trim().replace(/^<([\s\S]*)>$/,"$1");var at=de(X,{href:ye&&ye.replace(this.rules.inline._escapes,"$1"),title:Ce&&Ce.replace(this.rules.inline._escapes,"$1")},X[0]);return at}},ie.reflink=function(Y,X){var Z;if((Z=this.rules.inline.reflink.exec(Y))||(Z=this.rules.inline.nolink.exec(Y))){var te=(Z[2]||Z[1]).replace(/\s+/g," ");if(te=X[te.toLowerCase()],!te||!te.href){var se=Z[0].charAt(0);return{type:"text",raw:se,text:se}}var ye=de(Z,te,Z[0]);return ye}},ie.strong=function(Y,X,Z){Z===void 0&&(Z="");var te=this.rules.inline.strong.start.exec(Y);if(te&&(!te[1]||te[1]&&(Z===""||this.rules.inline.punctuation.exec(Z)))){X=X.slice(-1*Y.length);var se=te[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;se.lastIndex=0;for(var ye;(te=se.exec(X))!=null;)if(ye=this.rules.inline.strong.middle.exec(X.slice(0,te.index+3)),ye)return{type:"strong",raw:Y.slice(0,ye[0].length),text:Y.slice(2,ye[0].length-2)}}},ie.em=function(Y,X,Z){Z===void 0&&(Z="");var te=this.rules.inline.em.start.exec(Y);if(te&&(!te[1]||te[1]&&(Z===""||this.rules.inline.punctuation.exec(Z)))){X=X.slice(-1*Y.length);var se=te[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;se.lastIndex=0;for(var ye;(te=se.exec(X))!=null;)if(ye=this.rules.inline.em.middle.exec(X.slice(0,te.index+2)),ye)return{type:"em",raw:Y.slice(0,ye[0].length),text:Y.slice(1,ye[0].length-1)}}},ie.codespan=function(Y){var X=this.rules.inline.code.exec(Y);if(X){var Z=X[2].replace(/\n/g," "),te=/[^ ]/.test(Z),se=Z.startsWith(" ")&&Z.endsWith(" ");return te&&se&&(Z=Z.substring(1,Z.length-1)),Z=ee(Z,!0),{type:"codespan",raw:X[0],text:Z}}},ie.br=function(Y){var X=this.rules.inline.br.exec(Y);if(X)return{type:"br",raw:X[0]}},ie.del=function(Y){var X=this.rules.inline.del.exec(Y);if(X)return{type:"del",raw:X[0],text:X[1]}},ie.autolink=function(Y,X){var Z=this.rules.inline.autolink.exec(Y);if(Z){var te,se;return Z[2]==="@"?(te=ee(this.options.mangle?X(Z[1]):Z[1]),se="mailto:"+te):(te=ee(Z[1]),se=te),{type:"link",raw:Z[0],text:te,href:se,tokens:[{type:"text",raw:te,text:te}]}}},ie.url=function(Y,X){var Z;if(Z=this.rules.inline.url.exec(Y)){var te,se;if(Z[2]==="@")te=ee(this.options.mangle?X(Z[0]):Z[0]),se="mailto:"+te;else{var ye;do ye=Z[0],Z[0]=this.rules.inline._backpedal.exec(Z[0])[0];while(ye!==Z[0]);te=ee(Z[0]),Z[1]==="www."?se="http://"+te:se=te}return{type:"link",raw:Z[0],text:te,href:se,tokens:[{type:"text",raw:te,text:te}]}}},ie.inlineText=function(Y,X,Z){var te=this.rules.inline.text.exec(Y);if(te){var se;return X?se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):ee(te[0]):te[0]:se=ee(this.options.smartypants?Z(te[0]):te[0]),{type:"text",raw:te[0],text:se}}},le}(),pe=Q.noopTest,he=Q.edit,me=Q.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:pe,table:pe,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=he(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=he(ae.item,"gm").replace(/bull/g,ae.bullet).getRegex(),ae.list=he(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=he(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae.paragraph=he(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=he(ae.blockquote).replace("paragraph",ae.paragraph).getRegex(),ae.normal=me({},ae),ae.gfm=me({},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=he(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=he(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=me({},ae.normal,{html:he(`^ *(?: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:pe,paragraph:he(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 ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:pe,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:pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=he(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=he(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=he(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=he(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=he(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=he(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=he(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=he(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=he(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=he(ue._blockSkip,"g").getRegex(),ue.overlapSkip=he(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=he(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=he(ue.tag).replace("comment",ae._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=he(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=he(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=he(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=me({},ue),ue.pedantic=me({},ue.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:he(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=me({},ue.normal,{escape:he(ue.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=he(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=me({},ue.gfm,{br:he(ue.br).replace("{2,}","*").getRegex(),text:he(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var be={block:ae,inline:ue},Ue=U.defaults,Pe=be.block,He=be.inline;function Je(le){return le.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 Le(le){var ie="",oe,Y,X=le.length;for(oe=0;oe<X;oe++)Y=le.charCodeAt(oe),Math.random()>.5&&(Y="x"+Y.toString(16)),ie+="&#"+Y+";";return ie}var De=function(){function le(oe){this.tokens=[],this.tokens.links=Object.create(null),this.options=oe||Ue,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:Pe.normal,inline:He.normal};this.options.pedantic?(Y.block=Pe.pedantic,Y.inline=He.pedantic):this.options.gfm&&(Y.block=Pe.gfm,this.options.breaks?Y.inline=He.breaks:Y.inline=He.gfm),this.tokenizer.rules=Y}le.lex=function(Y,X){var Z=new le(X);return Z.lex(Y)};var ie=le.prototype;return ie.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},ie.blockTokens=function(Y,X,Z){X===void 0&&(X=[]),Z===void 0&&(Z=!0),Y=Y.replace(/^ +$/gm,"");for(var te,se,ye,Ce;Y;){if(te=this.tokenizer.space(Y)){Y=Y.substring(te.raw.length),te.type&&X.push(te);continue}if(te=this.tokenizer.code(Y,X)){Y=Y.substring(te.raw.length),te.type?X.push(te):(Ce=X[X.length-1],Ce.raw+=`
|
|
`+te.raw,Ce.text+=`
|
|
`+te.text);continue}if(te=this.tokenizer.fences(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.heading(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.nptable(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.hr(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.blockquote(Y)){Y=Y.substring(te.raw.length),te.tokens=this.blockTokens(te.text,[],Z),X.push(te);continue}if(te=this.tokenizer.list(Y)){for(Y=Y.substring(te.raw.length),ye=te.items.length,se=0;se<ye;se++)te.items[se].tokens=this.blockTokens(te.items[se].text,[],!1);X.push(te);continue}if(te=this.tokenizer.html(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(Z&&(te=this.tokenizer.def(Y))){Y=Y.substring(te.raw.length),this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.lheading(Y)){Y=Y.substring(te.raw.length),X.push(te);continue}if(Z&&(te=this.tokenizer.paragraph(Y))){Y=Y.substring(te.raw.length),X.push(te);continue}if(te=this.tokenizer.text(Y,X)){Y=Y.substring(te.raw.length),te.type?X.push(te):(Ce=X[X.length-1],Ce.raw+=`
|
|
`+te.raw,Ce.text+=`
|
|
`+te.text);continue}if(Y){var Ye="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return X},ie.inline=function(Y){var X,Z,te,se,ye,Ce,Ye=Y.length;for(X=0;X<Ye;X++){Ce=Y[X];switch(Ce.type){case"paragraph":case"text":case"heading":{Ce.tokens=[],this.inlineTokens(Ce.text,Ce.tokens);break}case"table":{for(Ce.tokens={header:[],cells:[]},se=Ce.header.length,Z=0;Z<se;Z++)Ce.tokens.header[Z]=[],this.inlineTokens(Ce.header[Z],Ce.tokens.header[Z]);for(se=Ce.cells.length,Z=0;Z<se;Z++)for(ye=Ce.cells[Z],Ce.tokens.cells[Z]=[],te=0;te<ye.length;te++)Ce.tokens.cells[Z][te]=[],this.inlineTokens(ye[te],Ce.tokens.cells[Z][te]);break}case"blockquote":{this.inline(Ce.tokens);break}case"list":{for(se=Ce.items.length,Z=0;Z<se;Z++)this.inline(Ce.items[Z].tokens);break}}}return Y},ie.inlineTokens=function(Y,X,Z,te,se){X===void 0&&(X=[]),Z===void 0&&(Z=!1),te===void 0&&(te=!1),se===void 0&&(se="");var ye,Ce=Y,Ye;if(this.tokens.links){var at=Object.keys(this.tokens.links);if(at.length>0)for(;(Ye=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)at.includes(Ye[0].slice(Ye[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ye=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(ye=this.tokenizer.escape(Y)){Y=Y.substring(ye.raw.length),X.push(ye);continue}if(ye=this.tokenizer.tag(Y,Z,te)){Y=Y.substring(ye.raw.length),Z=ye.inLink,te=ye.inRawBlock,X.push(ye);continue}if(ye=this.tokenizer.link(Y)){Y=Y.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,te)),X.push(ye);continue}if(ye=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,te)),X.push(ye);continue}if(ye=this.tokenizer.strong(Y,Ce,se)){Y=Y.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],Z,te),X.push(ye);continue}if(ye=this.tokenizer.em(Y,Ce,se)){Y=Y.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],Z,te),X.push(ye);continue}if(ye=this.tokenizer.codespan(Y)){Y=Y.substring(ye.raw.length),X.push(ye);continue}if(ye=this.tokenizer.br(Y)){Y=Y.substring(ye.raw.length),X.push(ye);continue}if(ye=this.tokenizer.del(Y)){Y=Y.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],Z,te),X.push(ye);continue}if(ye=this.tokenizer.autolink(Y,Le)){Y=Y.substring(ye.raw.length),X.push(ye);continue}if(!Z&&(ye=this.tokenizer.url(Y,Le))){Y=Y.substring(ye.raw.length),X.push(ye);continue}if(ye=this.tokenizer.inlineText(Y,te,Je)){Y=Y.substring(ye.raw.length),se=ye.raw.slice(-1),X.push(ye);continue}if(Y){var rt="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return X},G(le,null,[{key:"rules",get:function(){return{block:Pe,inline:He}}}]),le}(),ke=U.defaults,ze=Q.cleanUrl,Ge=Q.escape,Ie=function(){function le(oe){this.options=oe||ke}var ie=le.prototype;return ie.code=function(Y,X,Z){var te=(X||"").match(/\S*/)[0];if(this.options.highlight){var se=this.options.highlight(Y,te);se!=null&&se!==Y&&(Z=!0,Y=se)}return te?'<pre><code class="'+this.options.langPrefix+Ge(te,!0)+'">'+(Z?Y:Ge(Y,!0))+`</code></pre>
|
|
`:"<pre><code>"+(Z?Y:Ge(Y,!0))+`</code></pre>
|
|
`},ie.blockquote=function(Y){return`<blockquote>
|
|
`+Y+`</blockquote>
|
|
`},ie.html=function(Y){return Y},ie.heading=function(Y,X,Z,te){return this.options.headerIds?"<h"+X+' id="'+this.options.headerPrefix+te.slug(Z)+'">'+Y+"</h"+X+`>
|
|
`:"<h"+X+">"+Y+"</h"+X+`>
|
|
`},ie.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ie.list=function(Y,X,Z){var te=X?"ol":"ul",se=X&&Z!==1?' start="'+Z+'"':"";return"<"+te+se+`>
|
|
`+Y+"</"+te+`>
|
|
`},ie.listitem=function(Y){return"<li>"+Y+`</li>
|
|
`},ie.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ie.paragraph=function(Y){return"<p>"+Y+`</p>
|
|
`},ie.table=function(Y,X){return X&&(X="<tbody>"+X+"</tbody>"),`<table>
|
|
<thead>
|
|
`+Y+`</thead>
|
|
`+X+`</table>
|
|
`},ie.tablerow=function(Y){return`<tr>
|
|
`+Y+`</tr>
|
|
`},ie.tablecell=function(Y,X){var Z=X.header?"th":"td",te=X.align?"<"+Z+' align="'+X.align+'">':"<"+Z+">";return te+Y+"</"+Z+`>
|
|
`},ie.strong=function(Y){return"<strong>"+Y+"</strong>"},ie.em=function(Y){return"<em>"+Y+"</em>"},ie.codespan=function(Y){return"<code>"+Y+"</code>"},ie.br=function(){return this.options.xhtml?"<br/>":"<br>"},ie.del=function(Y){return"<del>"+Y+"</del>"},ie.link=function(Y,X,Z){if(Y=ze(this.options.sanitize,this.options.baseUrl,Y),Y===null)return Z;var te='<a href="'+Ge(Y)+'"';return X&&(te+=' title="'+X+'"'),te+=">"+Z+"</a>",te},ie.image=function(Y,X,Z){if(Y=ze(this.options.sanitize,this.options.baseUrl,Y),Y===null)return Z;var te='<img src="'+Y+'" alt="'+Z+'"';return X&&(te+=' title="'+X+'"'),te+=this.options.xhtml?"/>":">",te},ie.text=function(Y){return Y},le}(),we=function(){function le(){}var ie=le.prototype;return ie.strong=function(Y){return Y},ie.em=function(Y){return Y},ie.codespan=function(Y){return Y},ie.del=function(Y){return Y},ie.html=function(Y){return Y},ie.text=function(Y){return Y},ie.link=function(Y,X,Z){return""+Z},ie.image=function(Y,X,Z){return""+Z},ie.br=function(){return""},le}(),Ze=function(){function le(){this.seen={}}var ie=le.prototype;return ie.slug=function(Y){var X=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(X)){var Z=X;do this.seen[Z]++,X=Z+"-"+this.seen[Z];while(this.seen.hasOwnProperty(X))}return this.seen[X]=0,X},le}(),qe=U.defaults,Qe=Q.unescape,Ve=function(){function le(oe){this.options=oe||qe,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new we,this.slugger=new Ze}le.parse=function(Y,X){var Z=new le(X);return Z.parse(Y)};var ie=le.prototype;return ie.parse=function(Y,X){X===void 0&&(X=!0);var Z="",te,se,ye,Ce,Ye,at,rt,xt,ht,st,Ct,yt,Ft,Bt,Et,Cr,Or,lr,pr=Y.length;for(te=0;te<pr;te++){st=Y[te];switch(st.type){case"space":continue;case"hr":{Z+=this.renderer.hr();continue}case"heading":{Z+=this.renderer.heading(this.parseInline(st.tokens),st.depth,Qe(this.parseInline(st.tokens,this.textRenderer)),this.slugger);continue}case"code":{Z+=this.renderer.code(st.text,st.lang,st.escaped);continue}case"table":{for(xt="",rt="",Ce=st.header.length,se=0;se<Ce;se++)rt+=this.renderer.tablecell(this.parseInline(st.tokens.header[se]),{header:!0,align:st.align[se]});for(xt+=this.renderer.tablerow(rt),ht="",Ce=st.cells.length,se=0;se<Ce;se++){for(at=st.tokens.cells[se],rt="",Ye=at.length,ye=0;ye<Ye;ye++)rt+=this.renderer.tablecell(this.parseInline(at[ye]),{header:!1,align:st.align[ye]});ht+=this.renderer.tablerow(rt)}Z+=this.renderer.table(xt,ht);continue}case"blockquote":{ht=this.parse(st.tokens),Z+=this.renderer.blockquote(ht);continue}case"list":{for(Ct=st.ordered,yt=st.start,Ft=st.loose,Ce=st.items.length,ht="",se=0;se<Ce;se++)Et=st.items[se],Cr=Et.checked,Or=Et.task,Bt="",Et.task&&(lr=this.renderer.checkbox(Cr),Ft?Et.tokens.length>0&&Et.tokens[0].type==="text"?(Et.tokens[0].text=lr+" "+Et.tokens[0].text,Et.tokens[0].tokens&&Et.tokens[0].tokens.length>0&&Et.tokens[0].tokens[0].type==="text"&&(Et.tokens[0].tokens[0].text=lr+" "+Et.tokens[0].tokens[0].text)):Et.tokens.unshift({type:"text",text:lr}):Bt+=lr),Bt+=this.parse(Et.tokens,Ft),ht+=this.renderer.listitem(Bt,Or,Cr);Z+=this.renderer.list(ht,Ct,yt);continue}case"html":{Z+=this.renderer.html(st.text);continue}case"paragraph":{Z+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(ht=st.tokens?this.parseInline(st.tokens):st.text;te+1<pr&&Y[te+1].type==="text";)st=Y[++te],ht+=`
|
|
`+(st.tokens?this.parseInline(st.tokens):st.text);Z+=X?this.renderer.paragraph(ht):ht;continue}default:{var fr='Token with "'+st.type+'" type was not found.';if(this.options.silent){console.error(fr);return}else throw new Error(fr)}}}return Z},ie.parseInline=function(Y,X){X=X||this.renderer;var Z="",te,se,ye=Y.length;for(te=0;te<ye;te++){se=Y[te];switch(se.type){case"escape":{Z+=X.text(se.text);break}case"html":{Z+=X.html(se.text);break}case"link":{Z+=X.link(se.href,se.title,this.parseInline(se.tokens,X));break}case"image":{Z+=X.image(se.href,se.title,se.text);break}case"strong":{Z+=X.strong(this.parseInline(se.tokens,X));break}case"em":{Z+=X.em(this.parseInline(se.tokens,X));break}case"codespan":{Z+=X.codespan(se.text);break}case"br":{Z+=X.br();break}case"del":{Z+=X.del(this.parseInline(se.tokens,X));break}case"text":{Z+=X.text(se.text);break}default:{var Ce='Token with "'+se.type+'" type was not found.';if(this.options.silent){console.error(Ce);return}else throw new Error(Ce)}}}return Z},le}(),tt=Q.merge,Xe=Q.checkSanitizeDeprecation,Ne=Q.escape,ge=U.getDefaults,Fe=U.changeDefaults,je=U.defaults;function Ee(le,ie,oe){if(typeof le=="undefined"||le===null)throw new Error("marked(): input parameter is undefined or null");if(typeof le!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(le)+", string expected");if(typeof ie=="function"&&(oe=ie,ie=null),ie=tt({},Ee.defaults,ie||{}),Xe(ie),oe){var Y=ie.highlight,X;try{X=De.lex(le,ie)}catch(ye){return oe(ye)}var Z=function(Ce){var Ye;if(!Ce)try{Ye=Ve.parse(X,ie)}catch(at){Ce=at}return ie.highlight=Y,Ce?oe(Ce):oe(null,Ye)};if(!Y||Y.length<3)return Z();if(delete ie.highlight,!X.length)return Z();var te=0;Ee.walkTokens(X,function(ye){ye.type==="code"&&(te++,setTimeout(function(){Y(ye.text,ye.lang,function(Ce,Ye){if(Ce)return Z(Ce);Ye!=null&&Ye!==ye.text&&(ye.text=Ye,ye.escaped=!0),te--,te===0&&Z()})},0))}),te===0&&Z();return}try{var se=De.lex(le,ie);return ie.walkTokens&&Ee.walkTokens(se,ie.walkTokens),Ve.parse(se,ie)}catch(ye){if(ye.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ie.silent)return"<p>An error occurred:</p><pre>"+Ne(ye.message+"",!0)+"</pre>";throw ye}}Ee.options=Ee.setOptions=function(le){return tt(Ee.defaults,le),Fe(Ee.defaults),Ee},Ee.getDefaults=ge,Ee.defaults=je,Ee.use=function(le){var ie=tt({},le);if(le.renderer&&function(){var Y=Ee.defaults.renderer||new Ie,X=function(se){var ye=Y[se];Y[se]=function(){for(var Ce=arguments.length,Ye=new Array(Ce),at=0;at<Ce;at++)Ye[at]=arguments[at];var rt=le.renderer[se].apply(Y,Ye);return rt===!1&&(rt=ye.apply(Y,Ye)),rt}};for(var Z in le.renderer)X(Z);ie.renderer=Y}(),le.tokenizer&&function(){var Y=Ee.defaults.tokenizer||new ve,X=function(se){var ye=Y[se];Y[se]=function(){for(var Ce=arguments.length,Ye=new Array(Ce),at=0;at<Ce;at++)Ye[at]=arguments[at];var rt=le.tokenizer[se].apply(Y,Ye);return rt===!1&&(rt=ye.apply(Y,Ye)),rt}};for(var Z in le.tokenizer)X(Z);ie.tokenizer=Y}(),le.walkTokens){var oe=Ee.defaults.walkTokens;ie.walkTokens=function(Y){le.walkTokens(Y),oe&&oe(Y)}}Ee.setOptions(ie)},Ee.walkTokens=function(le,ie){for(var oe=P(le),Y;!(Y=oe()).done;){var X=Y.value;ie(X);switch(X.type){case"table":{for(var Z=P(X.tokens.header),te;!(te=Z()).done;){var se=te.value;Ee.walkTokens(se,ie)}for(var ye=P(X.tokens.cells),Ce;!(Ce=ye()).done;)for(var Ye=Ce.value,at=P(Ye),rt;!(rt=at()).done;){var xt=rt.value;Ee.walkTokens(xt,ie)}break}case"list":{Ee.walkTokens(X.items,ie);break}default:X.tokens&&Ee.walkTokens(X.tokens,ie)}}},Ee.Parser=Ve,Ee.parser=Ve.parse,Ee.Renderer=Ie,Ee.TextRenderer=we,Ee.Lexer=De,Ee.lexer=De.lex,Ee.Tokenizer=ve,Ee.Slugger=Ze,Ee.parse=Ee;var Oe=Ee;return Oe})},E7E6:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRY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E4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Se,xe,V){(function(q){q(V("VrN/"))})(function(q){var G={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=q.Pos;q.defineOption("autoCloseBrackets",!1,function(S,E,u){u&&u!=q.Init&&(S.removeKeyMap(P),S.state.closeBrackets=null),E&&(M(K(E,"pairs")),S.state.closeBrackets=E,S.addKeyMap(P))});function K(S,E){return E=="pairs"&&typeof S=="string"?S:typeof S=="object"&&S[E]!=null?S[E]:G[E]}var P={Backspace:I,Enter:R};function M(S){for(var E=0;E<S.length;E++){var u=S.charAt(E),o="'"+u+"'";P[o]||(P[o]=U(u))}}M(G.pairs+"`");function U(S){return function(E){return T(E,S)}}function B(S){var E=S.state.closeBrackets;if(!E||E.override)return E;var u=S.getModeAt(S.getCursor());return u.closeBrackets||E}function I(S){var E=B(S);if(!E||S.getOption("disableInput"))return q.Pass;for(var u=K(E,"pairs"),o=S.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return q.Pass;var d=L(S,o[l].head);if(!d||u.indexOf(d)%2!=0)return q.Pass}for(var l=o.length-1;l>=0;l--){var A=o[l].head;S.replaceRange("",D(A.line,A.ch-1),D(A.line,A.ch+1),"+delete")}}function R(S){var E=B(S),u=E&&K(E,"explode");if(!u||S.getOption("disableInput"))return q.Pass;for(var o=S.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return q.Pass;var d=L(S,o[l].head);if(!d||u.indexOf(d)%2!=0)return q.Pass}S.operation(function(){var A=S.lineSeparator()||`
|
|
`;S.replaceSelection(A+A,null),S.execCommand("goCharLeft"),o=S.listSelections();for(var f=0;f<o.length;f++){var m=o[f].head.line;S.indentLine(m,null,!0),S.indentLine(m+1,null,!0)}})}function v(S){var E=q.cmpPos(S.anchor,S.head)>0;return{anchor:new D(S.anchor.line,S.anchor.ch+(E?-1:1)),head:new D(S.head.line,S.head.ch+(E?1:-1))}}function T(S,E){var u=B(S);if(!u||S.getOption("disableInput"))return q.Pass;var o=K(u,"pairs"),l=o.indexOf(E);if(l==-1)return q.Pass;for(var d=K(u,"closeBefore"),A=K(u,"triples"),f=o.charAt(l+1)==E,m=S.listSelections(),w=l%2==0,y,h=0;h<m.length;h++){var c=m[h],s=c.head,a,g=S.getRange(s,D(s.line,s.ch+1));if(w&&!c.empty())a="surround";else if((f||!w)&&g==E)f&&C(S,s)?a="both":A.indexOf(E)>=0&&S.getRange(s,D(s.line,s.ch+3))==E+E+E?a="skipThree":a="skip";else if(f&&s.ch>1&&A.indexOf(E)>=0&&S.getRange(D(s.line,s.ch-2),s)==E+E){if(s.ch>2&&/\bstring/.test(S.getTokenTypeAt(D(s.line,s.ch-2))))return q.Pass;a="addFour"}else if(f){var p=s.ch==0?" ":S.getRange(D(s.line,s.ch-1),s);if(!q.isWordChar(g)&&p!=E&&!q.isWordChar(p))a="both";else return q.Pass}else if(w&&(g.length===0||/\s/.test(g)||d.indexOf(g)>-1))a="both";else return q.Pass;if(!y)y=a;else if(y!=a)return q.Pass}var b=l%2?o.charAt(l-1):E,O=l%2?E:o.charAt(l+1);S.operation(function(){if(y=="skip")S.execCommand("goCharRight");else if(y=="skipThree")for(var N=0;N<3;N++)S.execCommand("goCharRight");else if(y=="surround"){for(var W=S.getSelections(),N=0;N<W.length;N++)W[N]=b+W[N]+O;S.replaceSelections(W,"around"),W=S.listSelections().slice();for(var N=0;N<W.length;N++)W[N]=v(W[N]);S.setSelections(W)}else y=="both"?(S.replaceSelection(b+O,null),S.triggerElectric(b+O),S.execCommand("goCharLeft")):y=="addFour"&&(S.replaceSelection(b+b+b+b,"before"),S.execCommand("goCharRight"))})}function L(S,E){var u=S.getRange(D(E.line,E.ch-1),D(E.line,E.ch+1));return u.length==2?u:null}function C(S,E){var u=S.getTokenAt(D(E.line,E.ch+1));return/\bstring/.test(u.type)&&u.start==E.ch&&(E.ch==0||!/\bstring/.test(S.getTokenTypeAt(E)))}})},FOrL:function(Se,xe,V){Se.exports=V.p+"static/nodata.a6b3f948.png"},FPkq:function(Se,xe,V){Se.exports=V.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCBrO0IrqYc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+VZsTj3/SGI/MIyvjF6VqBrbAoTC6vDCjIfulZM/KMo9YptchsAEk8HvPkvhdbVwYznIJJnA97EVBvLXlvfblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},Gytx:function(Se,xe){Se.exports=function(q,G,D,K){var P=D?D.call(K,q,G):void 0;if(P!==void 0)return!!P;if(q===G)return!0;if(typeof q!="object"||!q||typeof G!="object"||!G)return!1;var M=Object.keys(q),U=Object.keys(G);if(M.length!==U.length)return!1;for(var B=Object.prototype.hasOwnProperty.bind(G),I=0;I<M.length;I++){var R=M[I];if(!B(R))return!1;var v=q[R],T=G[R];if(P=D?D.call(K,v,T,R):void 0,P===!1||P===void 0&&v!==T)return!1}return!0}},HmJG:function(Se,xe,V){},HpTS:function(Se,xe,V){Se.exports=V.p+"static/small_program.f74069ec.png"},JWDV:function(Se,xe,V){Se.exports=V.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r48eigdtz+TUKIF05GOSL3JKSUDwN4SALYXBRQwqzIrUNBvQ1DAIYm4BHAJxMz0TPOLoJu9BFClJxsglVVVWXGx8d/IYTIOl4rsSCnGvNzarCvIghLAl5NoN6WuKVPAu4dkMjtXyuEeP1kk6NJDpJSHgTQ8+Ht5Xj5UBWoqBhNQAsFP/6dwi2alIlTYq1caEY/IUT5zyGYlLIvgD4AugLIgm0zF3qgaccDgcCbMTExu1v6Xinl6YDc/lWxiWvWF6E04BiYxxUEQK0lcUe/BNx9qlLQFUKIt38mOVIAnA6gG4AugM104Qe0ajo1gA+FEHTwVhc96CoAbzy9txJP7KpAPKWKWFRQrCawZEoHZHnN4yEFVbX65DZeIKW8DVI+DiHimrtVSnlCCDFUCHGihc+TYJl7jwf1DlOW5KHWltCiLqSCfndqI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,V){Se.exports=V.p+"static/qrcode.2267e4d5.png"},LdHM:function(Se,xe,V){"use strict";V.d(xe,"b",function(){return d}),V.d(xe,"a",function(){return f});var q=V("1OyB"),G=V("vuIU"),D=V("Ji7U"),K=V("LK+K"),P=V("cDcd"),M=V("rePB"),U=V("Ff2n"),B=V("ODXe"),I=V("4IlW"),R=V("bX4T"),v=V("YrtM"),T=V("TSYQ"),L=V.n(T),C=V("+nKL"),S=V("8OUc"),E=function(J,ee){var re=J.prefixCls,de=J.id,Te=J.flattenOptions,ve=J.childrenAsData,pe=J.values,he=J.searchValue,me=J.multiple,ae=J.defaultActiveFirstOption,ue=J.height,be=J.itemHeight,Ue=J.notFoundContent,Pe=J.open,He=J.menuItemSelectedIcon,Je=J.virtual,Le=J.onSelect,De=J.onToggleOpen,ke=J.onActiveValue,ze=J.onScroll,Ge=J.onMouseEnter,Ie="".concat(re,"-item"),we=Object(v.a)(function(){return Te},[Pe,Te],function(Oe,le){return le[0]&&Oe[1]!==le[1]}),Ze=P.useRef(null),qe=function(le){le.preventDefault()},Qe=function(le){Ze.current&&Ze.current.scrollTo({index:le})},Ve=function(le){for(var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,oe=we.length,Y=0;Y<oe;Y+=1){var X=(le+Y*ie+oe)%oe,Z=we[X],te=Z.group,se=Z.data;if(!te&&!se.disabled)return X}return-1},tt=P.useState(function(){return Ve(0)}),Xe=Object(B.a)(tt,2),Ne=Xe[0],ge=Xe[1],Fe=function(le){ge(le);var ie=we[le];if(!ie){ke(null,-1);return}ke(ie.data.value,le)};P.useEffect(function(){Fe(ae!==!1?Ve(0):-1)},[we.length,he]),P.useEffect(function(){var Oe=setTimeout(function(){if(!me&&Pe&&pe.size===1){var le=Array.from(pe)[0],ie=we.findIndex(function(oe){var Y=oe.data;return Y.value===le});Fe(ie),Qe(ie)}});return function(){return clearTimeout(Oe)}},[Pe]);var je=function(le){le!==void 0&&Le(le,{selected:!pe.has(le)}),me||De(!1)};if(P.useImperativeHandle(ee,function(){return{onKeyDown:function(le){var ie=le.which;switch(ie){case I.a.UP:case I.a.DOWN:{var oe=0;if(ie===I.a.UP?oe=-1:ie===I.a.DOWN&&(oe=1),oe!==0){var Y=Ve(Ne+oe,oe);Qe(Y),Fe(Y)}break}case I.a.ENTER:{var X=we[Ne];X&&!X.data.disabled?je(X.data.value):je(void 0),Pe&&le.preventDefault();break}case I.a.ESC:De(!1)}},onKeyUp:function(){},scrollTo:function(le){Qe(le)}}}),we.length===0)return P.createElement("div",{role:"listbox",id:"".concat(de,"_list"),className:"".concat(Ie,"-empty"),onMouseDown:qe},Ue);function Ee(Oe){var le=we[Oe];if(!le)return null;var ie=le.data||{},oe=ie.value,Y=ie.label,X=ie.children,Z=Object(R.a)(ie,!0),te=ve?X:Y;return le?P.createElement("div",Object.assign({"aria-label":typeof te=="string"?te:null},Z,{key:Oe,role:"option",id:"".concat(de,"_list_").concat(Oe),"aria-selected":pe.has(oe)}),oe):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(de,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ee(Ne-1),Ee(Ne),Ee(Ne+1)),P.createElement(C.a,{itemKey:"key",ref:Ze,data:we,height:ue,itemHeight:be,fullHeight:!1,onMouseDown:qe,onScroll:ze,virtual:Je,onMouseEnter:Ge},function(Oe,le){var ie,oe=Oe.group,Y=Oe.groupOption,X=Oe.data,Z=X.label,te=X.key;if(oe)return P.createElement("div",{className:L()(Ie,"".concat(Ie,"-group"))},Z!==void 0?Z:te);var se=X.disabled,ye=X.value,Ce=X.title,Ye=X.children,at=X.style,rt=X.className,xt=Object(U.a)(X,["disabled","value","title","children","style","className"]),ht=pe.has(ye),st="".concat(Ie,"-option"),Ct=L()(Ie,st,rt,(ie={},Object(M.a)(ie,"".concat(st,"-grouped"),Y),Object(M.a)(ie,"".concat(st,"-active"),Ne===le&&!se),Object(M.a)(ie,"".concat(st,"-disabled"),se),Object(M.a)(ie,"".concat(st,"-selected"),ht),ie)),yt=ve?Ye:Z,Ft=!He||typeof He=="function"||ht;return P.createElement("div",Object.assign({},xt,{"aria-selected":ht,className:Ct,title:Ce,onMouseMove:function(){if(Ne===le||se)return;Fe(le)},onClick:function(){se||je(ye)},style:at}),P.createElement("div",{className:"".concat(st,"-content")},yt||ye),P.isValidElement(He)||ht,Ft&&P.createElement(S.a,{className:"".concat(Ie,"-option-state"),customizeIcon:He,customizeIconProps:{isSelected:ht}},ht?"\u2713":null))}))},u=P.forwardRef(E);u.displayName="OptionList";var o=u,l=function(){return null};l.isSelectOption=!0;var d=l,A=function(){return null};A.isSelectOptGroup=!0;var f=A,m=V("VTBJ"),w=V("Zm9Q");function y(_){var J=_.key,ee=_.props,re=ee.children,de=ee.value,Te=Object(U.a)(ee,["children","value"]);return Object(m.a)({key:J,value:de!==void 0?de:J,children:re},Te)}function h(_){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(_).map(function(ee,re){if(!P.isValidElement(ee)||!ee.type)return null;var de=ee.type.isSelectOptGroup,Te=ee.key,ve=ee.props,pe=ve.children,he=Object(U.a)(ve,["children"]);return J||!de?y(ee):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Te===null?re:Te,"__"),label:Te},he),{},{options:h(pe)})}).filter(function(ee){return ee})}var c=V("2Qr1"),s=V("qNPg"),a=V("U8pU"),g=V("Kwbf"),p=V("WKfj");function b(_){var J=_.mode,ee=_.options,re=_.children,de=_.backfill,Te=_.allowClear,ve=_.placeholder,pe=_.getInputElement,he=_.showSearch,me=_.onSearch,ae=_.defaultOpen,ue=_.autoFocus,be=_.labelInValue,Ue=_.value,Pe=_.inputValue,He=_.optionLabelProp,Je=J==="multiple"||J==="tags",Le=he!==void 0?he:Je||J==="combobox",De=ee||h(re);if(Object(g.a)(J!=="tags"||De.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),J==="tags"||J==="combobox"){var ke=De.some(function(Ie){return Ie.options?Ie.options.some(function(we){return typeof("value"in we?we.value:we.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(g.a)(!ke,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(g.a)(J!=="combobox"||!He,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(g.a)(J==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(g.a)(J==="combobox"||!pe,"`getInputElement` only work with `combobox` mode."),Object(g.b)(J!=="combobox"||!pe||!Te||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),me&&!Le&&J!=="combobox"&&J!=="tags"&&Object(g.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(g.b)(!ae||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ue!=null){var ze=Object(p.d)(Ue);Object(g.a)(!be||ze.every(function(Ie){return Object(a.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(g.a)(!Je||Array.isArray(Ue),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var Ge=null;Object(w.a)(re).some(function(Ie){if(!P.isValidElement(Ie)||!Ie.type)return!1;var we=Ie.type;if(we.isSelectOption)return!1;if(we.isSelectOptGroup){var Ze=Object(w.a)(Ie.props.children).every(function(qe){return!P.isValidElement(qe)||!Ie.type||qe.type.isSelectOption?!0:(Ge=qe.type,!1)});return!Ze}return Ge=we,!0}),Ge&&Object(g.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ge.displayName||Ge.name||Ge,"`.")),Object(g.a)(Pe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var O=b,N=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:h,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:O,fillOptionsWithMissingValue:c.a}),W=function(_){Object(D.a)(ee,_);var J=Object(K.a)(ee);function ee(){var re;return Object(q.a)(this,ee),re=J.apply(this,arguments),re.selectRef=P.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(G.a)(ee,[{key:"render",value:function(){return P.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),ee}(P.Component);W.Option=d,W.OptGroup=f;var Q=W,F=xe.c=Q},M8RZ:function(Se,xe,V){"use strict";V.d(xe,"a",function(){return I});var q=V("fWQN"),G=V("mtLc"),D=V("yKVA"),K=V("879j"),P=V("cDcd"),M=V.n(P),U=V("faye"),B=V.n(U),I=function(R){Object(D.a)(T,R);var v=Object(K.a)(T);function T(L){var C;Object(q.a)(this,T),C=v.call(this,L);var S=window.document;return C.node=S.createElement("div"),S.body.appendChild(C.node),C}return Object(G.a)(T,[{key:"render",value:function(){var C=this.props.children;return Object(U.createPortal)(C,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(M.a.Component)},Nmxd:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMz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9XEe0NVDBLzsnrMwcmbp/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(Se,xe,V){"use strict";var q=V("U8pU"),G=V("VTBJ"),D=V("Ff2n"),K=V("cDcd"),P=V("uciX"),M=V("7ixt"),U=function(L){var C=L.overlay,S=L.prefixCls,E=L.id,u=L.overlayInnerStyle;return K.createElement("div",{className:"".concat(S,"-inner"),id:E,role:"tooltip",style:u},typeof C=="function"?C():C)},B=U,I=function(L,C){var S=L.overlayClassName,E=L.trigger,u=E===void 0?["hover"]:E,o=L.mouseEnterDelay,l=o===void 0?0:o,d=L.mouseLeaveDelay,A=d===void 0?.1:d,f=L.overlayStyle,m=L.prefixCls,w=m===void 0?"rc-tooltip":m,y=L.children,h=L.onVisibleChange,c=L.afterVisibleChange,s=L.transitionName,a=L.animation,g=L.placement,p=g===void 0?"right":g,b=L.align,O=b===void 0?{}:b,N=L.destroyTooltipOnHide,W=N===void 0?!1:N,Q=L.defaultVisible,F=L.getTooltipContainer,_=L.overlayInnerStyle,J=Object(D.a)(L,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ee=Object(K.useRef)(null);Object(K.useImperativeHandle)(C,function(){return ee.current});var re=Object(G.a)({},J);"visible"in L&&(re.popupVisible=L.visible);var de=function(){var me=L.arrowContent,ae=me===void 0?null:me,ue=L.overlay,be=L.id;return[K.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},ae),K.createElement(B,{key:"content",prefixCls:w,id:be,overlay:ue,overlayInnerStyle:_})]},Te=!1,ve=!1;if(typeof W=="boolean")Te=W;else if(W&&Object(q.a)(W)==="object"){var pe=W.keepParent;Te=pe===!0,ve=pe===!1}return K.createElement(P.a,Object.assign({popupClassName:S,prefixCls:w,popup:de,action:u,builtinPlacements:M.a,popupPlacement:p,ref:ee,popupAlign:O,getPopupContainer:F,onPopupVisibleChange:h,afterPopupVisibleChange:c,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:Q,destroyPopupOnHide:Te,autoDestroy:ve,mouseLeaveDelay:A,popupStyle:f,mouseEnterDelay:l},re),y)},R=Object(K.forwardRef)(I),v=xe.a=R},Ohmc:function(Se,xe,V){Se.exports=V.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Se,xe,V){"use strict";var q=V("2qtc"),G=V("kLXV"),D=V("rAM+"),K=V("miYZ"),P=V("tsqr"),M=V("9og8"),U=V("tJVT"),B=V("jrin"),I=V("WmNS"),R=V.n(I),v=V("cDcd"),T=V.n(v),L=V("VrN/"),C=V.n(L),S=V("bdgK"),E=V("p77/"),u=V("Bd2K"),o=V("ELLl"),l=V("19Vz"),d=V("lZu9"),A=V("+NIl"),f=V("kSUc"),m=V("9Bee"),w=function(se){var ye=se.value,Ce=ye===void 0?"":ye,Ye=se.className,at=se.showTextOnly,rt=se.showLines,xt=se.style,ht=xt===void 0?{}:xt,st=Object(v.useMemo)(function(){return""},[Ce]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:st}}))},y=V("0Owb"),h=V("dejd"),c=V("C+DQ"),s=V("1vsH"),a=V("m3rI"),g=[{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 p(se){var ye=se.onActionCallback,Ce=se.title,Ye=se.icon,at=se.actionName,rt=se.className,xt=rt===void 0?"":rt,ht=se.children;function st(){ye(at)}return T.a.createElement("a",{title:Ce,className:xt,onClick:st},T.a.createElement("i",{className:"md-iconfont ".concat(Ye)}),ht)}var b=function(se){var ye=se.watch,Ce=se.showNullButton,Ye=se.onActionCallback,at=se.fullScreen,rt=se.insertTemp,xt=se.hidetoolBar,ht=se.uuid,st=se.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.G)("_educoder_session"),"&key=").concat(ht,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ct=[].concat(g,[{title:"".concat(ye?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ye?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!xt&&Ct.map(function(yt,Ft){return T.a.createElement("li",{key:Ft},yt.actionName?T.a.createElement(p,Object(y.a)({},yt,{onActionCallback:Ye})):T.a.createElement("span",{className:"v-line"}))}),Ce?T.a.createElement("li",null,T.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ye},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&T.a.createElement("li",null,T.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:Ye},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(p,{icon:"".concat(at?"icon-shrink":"icon-enlarge"),title:at?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ye})))},O=V("M8RZ"),N=V("+L6B"),W=V("2/Rp"),Q=V("y8nQ"),F=V("Vl3Y"),_=V("5NDa"),J=V("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},re=function(se){var ye=se.callback,Ce=se.onCancel;function Ye(at){ye(at)}return T.a.createElement(F.a,Object(y.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ye}),T.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement(J.a,null)),T.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement(J.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(W.a,{type:"ghost",onClick:Ce},"\u53D6\u6D88")))},de=V("7ahc"),Te=V("HmJG"),ve=V("BjJ7"),pe=F.a.useForm,he={width:280,marginRight:10},me={labelCol:{span:5},wrapperCol:{span:19}},ae=function(se){var ye=se.callback,Ce=se.onCancel,Ye=pe(),at=Object(U.a)(Ye,1),rt=at[0];function xt(Ct){ye(Ct)}function ht(Ct,yt){if(Ct.status===-1){P.b.error(Ct.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(Ct.id),type:yt.type})}function st(Ct){var yt=Ct.target.files[0];be(yt,ht)}return T.a.createElement(F.a,Object(y.a)({form:rt},me,{className:"upload-image-panel",onFinish:xt}),T.a.createElement(F.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(F.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},T.a.createElement(J.a,{style:he})),T.a.createElement(ue,{onFileChange:st}))),T.a.createElement(F.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},T.a.createElement(J.a,{style:{width:264}})),T.a.createElement(F.a.Item,{style:{textAlign:"right"}},T.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(W.a,{type:"ghost",onClick:Ce},"\u53D6\u6D88")))};function ue(se){var ye=se.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:ye}))}function be(se,ye){if(!se)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ce=new FormData;Ce.append("editormd-image-file",se),Ce.append("file_param_name","editormd-image-file"),Ce.append("byxhr","true");var Ye=new window.XMLHttpRequest;Ye.withCredentials=!0,Ye.addEventListener("load",function(at){ye(JSON.parse(at.target.responseText),se)},!1),Ye.addEventListener("error",function(at){console.error(at)},!1),Ye.open("POST","".concat(ve.a,"/api/attachments.json")),Ye.send(Ce)}var Ue=V("giR+"),Pe=V("fyUT"),He=V("7Kak"),Je=V("9yH6"),Le=Je.a.Group,De={margin:"0 8px"},ke=function(se){var ye=se.callback,Ce=se.onCancel;function Ye(at){ye(at)}return T.a.createElement(F.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ye},T.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},T.a.createElement("span",{style:De},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:De},"\u884C\u6570"),T.a.createElement(F.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(Pe.a,null)),T.a.createElement("span",{style:De},"\u5217\u6570"),T.a.createElement(F.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(Pe.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},T.a.createElement("span",{style:De},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(F.a.Item,{name:"align"},T.a.createElement(Le,null,T.a.createElement(Je.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(Je.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(Je.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(Je.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(W.a,{type:"ghost",onClick:Ce},"\u53D6\u6D88")))},ze=V("ErOA"),Ge=V("7Cbv"),Ie="link",we="upload-image",Ze="code-block",qe="add-table",Qe="------------",Ve={default:Qe,left:":".concat(Qe),center:":".concat(Qe,":"),right:"".concat(Qe,":")},tt=V("9VGf"),Xe,Ne;function ge(){}var Fe=0,je=1e4,Ee="\u2581",Oe=`
|
|
**\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 le(se){return/^\d+$/.test(se)?"".concat(se,"px"):se}var ie=navigator.platform.toUpperCase().indexOf("MAC")>=0,oe=ie?"Cmd":"Ctrl",Y=["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"],X=(Xe={},Object(B.a)(Xe,oe+"-B","bold"),Object(B.a)(Xe,oe+"-I","italic"),Xe),Z=(Ne={},Object(B.a)(Ne,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(Ne,Ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(Ne,we,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(Ne,qe,"\u6DFB\u52A0\u8868\u683C"),Ne),te=xe.a=function(se){var ye=se.defaultValue,Ce=ye===void 0?"":ye,Ye=se.onChange,at=se.width,rt=at===void 0?"100%":at,xt=se.height,ht=xt===void 0?400:xt,st=se.miniToolbar,Ct=st===void 0?!1:st,yt=se.isFocus,Ft=yt===void 0?!1:yt,Bt=se.watch,Et=se.insertTemp,Cr=se.mode,Or=Cr===void 0?"markdown":Cr,lr=se.id,pr=lr===void 0?"markdown-editor-id":lr,fr=se.showResizeBar,ia=fr===void 0?!1:fr,wr=se.noStorage,Kn=wr===void 0?!1:wr,Hn=se.showNullButton,Ot=Hn===void 0?!1:Hn,nt=se.hidetoolBar,Mr=nt===void 0?!1:nt,mn=se.fullScreen,qt=mn===void 0?!1:mn,At=se.onBlur,gr=se.onCMBeforeChange,Pr=se.onFullScreen,pn=se.className,Me=pn===void 0?"":pn,dt=se.disablePaste,Gn=dt===void 0?!1:dt,gn=se.placeholder,vn=gn===void 0?"":gn,Zr=se.values,yn=Zr===void 0?"":Zr,ft=Object(v.useState)(null),wi=Object(U.a)(ft,2),_e=wi[0],En=wi[1],hr=Object(v.useState)(Ce),zn=Object(U.a)(hr,2),qr=zn[0],vr=zn[1],Vn=Object(v.useState)(Bt),Qn=Object(U.a)(Vn,2),yr=Qn[0],Yn=Qn[1],Di=Object(v.useState)(qt),Jn=Object(U.a)(Di,2),Er=Jn[0],Li=Jn[1],aa=Object(v.useState)(""),Xn=Object(U.a)(aa,2),Jt=Xn[0],Wr=Xn[1],oa=Object(v.useState)(0),$r=Object(U.a)(oa,2),br=$r[0],Zn=$r[1],sa=Object(v.useState)(ht),Ri=Object(U.a)(sa,2),Ii=Ri[0],bn=Ri[1],Oi=Object(v.useState)(!1),Mi=Object(U.a)(Oi,2),la=Mi[0],xn=Mi[1],en=Object(v.useRef)(Object(Ge.a)()),tn=Object(v.useRef)(!1),An=Object(v.useRef)(),kr=Object(v.useRef)(),_r=Object(v.useRef)(),Br=Object(v.useRef)(),Tn=Object(v.useRef)(),Pi=function(){var it=Object(M.a)(R.a.mark(function ct(){var lt,pt;return R.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:return Dt.next=2,Object(ze.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:en.current}});case 2:pt=Dt.sent,pt!=null&&(lt=pt.attachments)!==null&<!==void 0&<.length&&(console.log("cm:",_e,kr),pt.attachments.map(function(vt){vt.content_type.indexOf("image")>-1?_e.replaceSelection(".concat(vt.content_type,")")):vt.content_type.indexOf("video")>-1?_e.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):vt.content_type.indexOf("pdf")>-1?_e.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,'&disposition=inline" target="_blank">').concat(vt.name,"</a>")):_e.replaceSelection("[".concat(vt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}));case 4:case"end":return Dt.stop()}},ct)}));return function(){return it.apply(this,arguments)}}();Object(v.useEffect)(function(){vr(yn),_e==null||_e.setValue(yn)},[yn]),Object(v.useEffect)(function(){Pr==null||Pr(Er)},[Er]),Object(v.useEffect)(function(){if(kr.current){var it=C.a.fromTextArea(kr.current,{mode:Or,lineNumbers:!Ct,lineWrapping:!0,value:Ce,autoCloseTags:!0,autoCloseBrackets:!0});Ft&&it.focus();function ct(lt,pt){if(Gn){pt.preventDefault();return}var bt=pt.clipboardData;if(bt){var Dt=bt.types.toString(),vt=bt.items;if(Dt==="Files"||bt.types.indexOf("Files")>-1){if(pt.preventDefault(),Or=="stex")return;try{var Ut,$t=vt[1];((Ut=vt[0])===null||Ut===void 0?void 0:Ut.kind)==="file"&&($t=vt[0]);var gt=$t.getAsFile(),Ur=gt.name.split(".").pop();be(gt,function(Tt){if(Tt.id){var er,Vt,mr;(gt==null||((er=gt.type)===null||er===void 0)?void 0:er.indexOf("image"))>-1?it.replaceSelection(".concat(Tt.content_type,")")):(gt==null||((Vt=gt.type)===null||Vt===void 0)?void 0:Vt.indexOf("video"))>-1?it.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'"></video>')):(gt==null||((mr=gt.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):Y.includes(Ur)?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):it.replaceSelection("[".concat(gt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(Tt.content_type,")"))}else(Tt==null?void 0:Tt.status)===401&&(document.location.href="/user/login")})}catch(Tt){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return it.on("paste",ct),it.on("dragleave",function(lt,pt){_r.current.classList.remove("mouse-hover-md")}),it.on("dragover",function(lt,pt){_r.current.classList.add("mouse-hover-md")}),it.on("drop",function(lt,pt){_r.current.classList.add("mouse-hover-md");var bt;if(bt=pt.dataTransfer.files,bt.length>0){pt.preventDefault(),pt.stopPropagation();for(var Dt=function($t){var gt=bt[$t],Ur=gt.name.split(".").pop();be(gt,function(Tt){if(Tt.id){var er,Vt,mr;(gt==null||((er=gt.type)===null||er===void 0)?void 0:er.indexOf("image"))>-1?it.replaceSelection(".concat(Tt.content_type,")")):(gt==null||((Vt=gt.type)===null||Vt===void 0)?void 0:Vt.indexOf("video"))>-1?it.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'"></video>')):(gt==null||((mr=gt.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):Y.includes(Ur)?it.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):it.replaceSelection("[".concat(gt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Tt.id,"?type=").concat(Tt.content_type,")"))}else(Tt==null?void 0:Tt.status)===401&&(document.location.href="/user/login")})},vt=0;vt<bt.length;vt++)Dt(vt)}}),En(it),function(){it.off("paste",ct)}}},[]);var ur=Object(v.useCallback)(function(){if(_r.current)try{}catch(it){console.log(it,"---- to set md editor body height")}},[Ii,_r,Er]);Object(v.useEffect)(function(){function it(){var lt=new S.default(function(pt){var bt=Object(D.a)(pt),Dt;try{for(bt.s();!(Dt=bt.n()).done;){var vt=Dt.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&(ur(),_e.setSize("100%","100%"),_e.refresh())}}catch(Ut){bt.e(Ut)}finally{bt.f()}});return lt.observe(kr.current.parentElement),lt}if(_e){var ct=it();return function(){ct.unobserve(kr.current.parentElement)}}},[_e,ur]),Object(v.useEffect)(function(){if(_e){for(var it=[],ct=function(){var vt=pt[lt];bt=Object(U.a)(vt,2);var Ut=bt[0],$t=bt[1],gt=Object(B.a)({},Ut,function(){ki($t)});it.push(gt),_e.addKeyMap(gt)},lt=0,pt=Object.entries(X);lt<pt.length;lt++){var bt;ct()}return An.current=setInterval(function(){tn.current&&Pi()},4e3),function(){clearInterval(An.current);var Dt=Object(D.a)(it),vt;try{for(Dt.s();!(vt=Dt.n()).done;){var Ut=vt.value;_e.removeKeyMap(Ut)}}catch($t){Dt.e($t)}finally{Dt.f()}}}},[_e]),Object(v.useEffect)(function(){qt!==Er&&Li(qt)},[qt]),Object(tt.a)(function(){if(!Kn&&br>0){var it=new Date().getTime(),ct=window.sessionStorage.getItem(pr);it>=br+je&&(!ct||ct!==qr)&&(window.sessionStorage.setItem(pr,qr),xn(!0))}},je),Object(v.useEffect)(function(){Yn(Bt)},[_e,Bt]),Object(v.useEffect)(function(){_e&&(Ft&&_e.focus())},[_e,Ft]),Object(v.useEffect)(function(){if(yr&&_e){var it=_e.getScrollerElement();function ct(lt){var pt=lt.target;if(Tn.current){var bt=pt.scrollTop/pt.scrollHeight;Tn.current.scrollTop=Tn.current.scrollHeight*bt}}return it.addEventListener("scroll",ct),function(){it.removeEventListener("scroll",ct)}}},[_e,yr]),Object(v.useEffect)(function(){if(_e&&gr){function it(ct,lt){gr(ct,lt)}return _e.on("beforeChange",it),function(){_e.off("beforeChange",it)}}},[_e,gr]),Object(v.useEffect)(function(){if(_e&&At){function it(){At(_e.getValue())}return _e.on("blur",it),function(){_e.off("blur",it)}}},[_e,At]),Object(v.useEffect)(function(){if(_e){function it(ct){var lt=ct.getValue();vr(lt),Zn(new Date().getTime()),ct.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ye&&Ye(lt)}return _e.on("change",it),function(){_e.off("change",it)}}},[_e,Ye]),Object(v.useEffect)(function(){_e&&(Ce==null?(_e.setValue(""),vr("")):Ce!==_e.getValue()&&(_e.setValue(Ce),vr(Ce),_e.setCursor(_e.lineCount(),0)))},[_e,Ce]);var ki=Object(v.useCallback)(function(it){var ct=_e.getCursor(),lt=_e.getSelection(),pt=lt.split(`
|
|
`);switch(it){case"bold":return _e.replaceSelection("**"+lt+"**"),lt===""&&_e.setCursor(ct.line,ct.ch+2),_e.focus();case"italic":return _e.replaceSelection("*"+lt+"*"),lt===""&&_e.setCursor(ct.line,ct.ch+1),_e.focus();case"code":return _e.replaceSelection("`"+lt+"`"),lt===""&&_e.setCursor(ct.line,ct.ch+1),_e.focus();case"inline-latex":return _e.replaceSelection("`$$"+lt+"$$`"),lt===""&&_e.setCursor(ct.line,ct.ch+3),_e.focus();case"latex":return _e.replaceSelection("```latex\n"+lt+"\n```"),_e.setCursor(ct.line+1,lt.length+1),_e.focus();case"line-break":return _e.replaceSelection(`<br/>
|
|
`),_e.focus();case"list-ul":return lt===""?_e.replaceSelection("- "+lt):_e.replaceSelection(pt.map(function(bt){return bt===""?"":"- ".concat(bt)}).join(`
|
|
`)),_e.focus();case"list-ol":return lt===""?_e.replaceSelection("1. "+lt):_e.replaceSelection(pt.map(function(bt,Dt){return bt===""?"":"".concat(Dt+1,". ").concat(bt)}).join(`
|
|
`)),_e.focus();case"add-null-ch":return lt===""&&_e.setCursor(ct.line,ct.ch+1),_e.replaceSelection(Ee),_e.focus();case"inster-template-1":return lt===""&&_e.setCursor(ct.line,ct.ch),_e.replaceSelection(Oe),_e.focus();case"eraser":return _e.setValue(""),_e.focus();case"trigger-watch":return Yn(!yr),_e.focus();case"trigger-full-screen":return Li(!Er),_e.focus();case Ie:Wr(Ie);return;case Ze:Wr(Ze);return;case we:Wr(we);return;case qe:Wr(qe);return;default:throw new Error}},[_e,yr,Er]),Sn=Object(v.useCallback)(function(it){Wr("");switch(Jt){case Ie:var ct=it.title,lt=it.link;return _e.replaceSelection("[".concat(ct,"](").concat(lt,")")),_e.focus();case Ze:var pt=it.language,bt=it.content;return _e.replaceSelection(["```"+pt,bt,"```"].join(`
|
|
`)),_e.focus();case we:var Dt=it.src,vt=it.alt;return vt?_e.replaceSelection(".concat(Dt,' "').concat(vt,'" )')):_e.replaceSelection("")),_e.focus();case qe:for(var Ut=it.row,$t=it.col,gt=it.align,Ur=`
|
|
`,Tt=0;Tt<Ut;Tt++){for(var er=[],Vt=[],mr=0;mr<$t;mr++)Tt===1&&Vt.push(Ve[gt]),er.push(" ");Tt===1&&(Ur+="| ".concat(Vt.join(" | "),` |
|
|
`)),Ur+="| ".concat(er.join($t===1?"":" | "),` |
|
|
`)}return _e.replaceSelection(Ur+`
|
|
`),_e.focus();default:throw new Error}},[_e,Jt]),qn=Object(v.useMemo)(function(){switch(Jt){case Ie:return T.a.createElement(re,{callback:Sn,onCancel:Kr});case Ze:return T.a.createElement(de.b,{callback:Sn,onCancel:Kr});case we:return T.a.createElement(ae,{callback:Sn,onCancel:Kr});case qe:return T.a.createElement(ke,{callback:Sn,onCancel:Kr});default:return null}},[Jt]);function Kr(){Wr("")}Object(v.useEffect)(function(){if(Br.current){var it=Br.current,ct=!1,lt=0;function pt(vt){ct=!0,lt=vt.pageY}function bt(){ct=!1}function Dt(vt){if(ct){var Ut=vt.pageY-lt;Ut<0&&(Ut=0),Ut>300&&(Ut=300);var $t=ht+Ut+"px";bn($t)}}return it.addEventListener("mousedown",pt),document.addEventListener("mousemove",Dt),document.addEventListener("mouseup",bt),function(){it.removeEventListener("mousedown",pt),document.removeEventListener("mousemove",Dt),document.removeEventListener("mouseup",bt)}}},[_e,Br]),Object(v.useEffect)(function(){bn(ht)},[ht]);var Dr=le(rt),$n=le(Ii),xr={width:Dr,height:$n},ei=Object(v.useMemo)(function(){if(br){var it=new Date(br),ct=it.getHours(),lt=it.getMinutes(),pt=it.getSeconds();return ct=ct<10?"0"+ct:ct,lt=lt<10?"0"+lt:lt,pt=pt<10?"0"+pt:pt,"".concat(ct,":").concat(lt,":").concat(pt)}return 0},[br]);function _i(){window.sessionStorage.removeItem(pr),xn(!1),Zn(0)}function rn(){xn(!1),Zn(0),_e.setValue(window.sessionStorage.getItem(pr))}function ua(it,ct){var lt=_e.getValue();lt=lt.replace(it,ct),vr(lt),_e==null||_e.setValue(lt)}return T.a.createElement(v.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:_r},T.a.createElement("div",{className:"markdown-editor-container ".concat(Me," ").concat(yr?"on-preview":""," ").concat(Ct?"mini":""," ").concat(Er?"full-screen":""),style:xr},T.a.createElement(b,{insertTemp:Et,watch:yr,fullScreen:Er,showNullButton:Ot,onActionCallback:ki,hidetoolBar:Mr,uuid:en.current,setOpenPhones:function(){tn.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:kr,placeholder:vn})),yr?T.a.createElement("div",{ref:Tn,className:"preview-container"},Or==="stex"&&T.a.createElement(w,{value:qr}),Or!=="stex"&&T.a.createElement(m.a,{edit:!0,value:qr,replaces:ua})):null))),ia?T.a.createElement("a",{ref:Br,className:"editor-resize"}):null,T.a.createElement(O.a,null,Z[Jt]?T.a.createElement(G.a,{centered:!0,title:Z[Jt],visible:!0,onCancel:Kr,footer:null,className:"markdown-popup-form"},qn):null))}},RMFE:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jF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ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},S3tb:function(Se,xe,V){Se.exports={flex_box_center:"flex_box_center___2JPaF",flex_space_between:"flex_space_between___2Xc04",flex_box_vertical_center:"flex_box_vertical_center___2dKRj",flex_box_center_end:"flex_box_center_end___1mhGC",flex_box_column:"flex_box_column___3_40N",bg:"bg___2hbcT",flexRow:"flexRow___1-nzu",flexJustifyCenter:"flexJustifyCenter___3gMIE",flexAlignEnd:"flexAlignEnd___ofjNV",flexAlignCenter:"flexAlignCenter___ozmjE",flexColumn:"flexColumn___2ijgP",formWrap:"formWrap___1fz8-",titleWrap:"titleWrap___Sj-tB",fieldWrap:"fieldWrap___49q9k",mdWrap:"mdWrap___3TEhM",backgroundFa:"backgroundFa___1anEp",button:"button___3i0ZA",icons:"icons___1IO0Z",navBar:"navBar___11xzI",active:"active___tYbqS"}},SJMd:function(Se,xe){/**
|
|
* @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 V,q,G,D=!1,K,P;window.PR_SHOULD_USE_CONTINUATION=!0;var M,U;(function(){var B=window,I=["break,continue,do,else,for,if,return,while"],R=[I,"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"],T=[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"],L=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],C=[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",E=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",o=[I,"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"],l=[I,"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"],d=[I,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[T,C,L,E,u,o,l,d],f=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",w="kwd",y="com",h="typ",c="lit",s="pun",a="pln",g="tag",p="dec",b="src",O="atn",N="atv",W="nocode",Q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(Le){for(var De=0,ke=!1,ze=!1,Ge=0,Ie=Le.length;Ge<Ie;++Ge){var we=Le[Ge];if(we.ignoreCase)ze=!0;else if(/[a-z]/i.test(we.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ke=!0,ze=!1;break}}var Ze={b:8,t:9,n:10,v:11,f:12,r:13};function qe(Ne){var ge=Ne.charCodeAt(0);if(ge!==92)return ge;var Fe=Ne.charAt(1);return ge=Ze[Fe],ge||("0"<=Fe&&Fe<="7"?parseInt(Ne.substring(1),8):Fe==="u"||Fe==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function Qe(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var ge=String.fromCharCode(Ne);return ge==="\\"||ge==="-"||ge==="]"||ge==="^"?"\\"+ge:ge}function Ve(Ne){var ge=Ne.substring(1,Ne.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")),Fe=[],je=ge[0]==="^",Ee=["["];je&&Ee.push("^");for(var Oe=je?1:0,le=ge.length;Oe<le;++Oe){var ie=ge[Oe];if(/\\[bdsw]/i.test(ie))Ee.push(ie);else{var oe=qe(ie),Y;Oe+2<le&&ge[Oe+1]==="-"?(Y=qe(ge[Oe+2]),Oe+=2):Y=oe,Fe.push([oe,Y]),Y<65||oe>122||(Y<65||oe>90||Fe.push([Math.max(65,oe)|32,Math.min(Y,90)|32]),Y<97||oe>122||Fe.push([Math.max(97,oe)&~32,Math.min(Y,122)&~32]))}}Fe.sort(function(se,ye){return se[0]-ye[0]||ye[1]-se[1]});for(var X=[],Z=[],Oe=0;Oe<Fe.length;++Oe){var te=Fe[Oe];te[0]<=Z[1]+1?Z[1]=Math.max(Z[1],te[1]):X.push(Z=te)}for(var Oe=0;Oe<X.length;++Oe){var te=X[Oe];Ee.push(Qe(te[0])),te[1]>te[0]&&(te[1]+1>te[0]&&Ee.push("-"),Ee.push(Qe(te[1])))}return Ee.push("]"),Ee.join("")}function tt(Ne){for(var ge=Ne.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")),Fe=ge.length,je=[],Ee=0,Oe=0;Ee<Fe;++Ee){var le=ge[Ee];if(le==="(")++Oe;else if(le.charAt(0)==="\\"){var ie=+le.substring(1);ie&&(ie<=Oe?je[ie]=-1:ge[Ee]=Qe(ie))}}for(var Ee=1;Ee<je.length;++Ee)je[Ee]===-1&&(je[Ee]=++De);for(var Ee=0,Oe=0;Ee<Fe;++Ee){var le=ge[Ee];if(le==="(")++Oe,je[Oe]||(ge[Ee]="(?:");else if(le.charAt(0)==="\\"){var ie=+le.substring(1);ie&&ie<=Oe&&(ge[Ee]="\\"+je[ie])}}for(var Ee=0;Ee<Fe;++Ee)ge[Ee]==="^"&&ge[Ee+1]!=="^"&&(ge[Ee]="");if(Ne.ignoreCase&&ke)for(var Ee=0;Ee<Fe;++Ee){var le=ge[Ee],oe=le.charAt(0);le.length>=2&&oe==="["?ge[Ee]=Ve(le):oe!=="\\"&&(ge[Ee]=le.replace(/[a-zA-Z]/g,function(Z){var te=Z.charCodeAt(0);return"["+String.fromCharCode(te&~32,te|32)+"]"}))}return ge.join("")}for(var Xe=[],Ge=0,Ie=Le.length;Ge<Ie;++Ge){var we=Le[Ge];if(we.global||we.multiline)throw new Error(""+we);Xe.push("(?:"+tt(we)+")")}return new RegExp(Xe.join("|"),ze?"gi":"g")}function _(Le,De){var ke=/(?:^|\s)nocode(?:\s|$)/,ze=[],Ge=0,Ie=[],we=0;function Ze(qe){var Qe=qe.nodeType;if(Qe==1){if(ke.test(qe.className))return;for(var Ve=qe.firstChild;Ve;Ve=Ve.nextSibling)Ze(Ve);var tt=qe.nodeName.toLowerCase();(tt==="br"||tt==="li")&&(ze[we]=`
|
|
`,Ie[we<<1]=Ge++,Ie[we++<<1|1]=qe)}else if(Qe==3||Qe==4){var Xe=qe.nodeValue;Xe.length&&(De?Xe=Xe.replace(/\r\n?/g,`
|
|
`):Xe=Xe.replace(/[ \t\r\n]+/g," "),ze[we]=Xe,Ie[we<<1]=Ge,Ge+=Xe.length,Ie[we++<<1|1]=qe)}}return Ze(Le),{sourceCode:ze.join("").replace(/\n$/,""),spans:Ie}}function J(Le,De,ke,ze,Ge){if(!ke)return;var Ie={sourceNode:Le,pre:1,langExtension:null,numberLines:null,sourceCode:ke,spans:null,basePos:De,decorations:null};ze(Ie),Ge.push.apply(Ge,Ie.decorations)}var ee=/\S/;function re(Le){for(var De=void 0,ke=Le.firstChild;ke;ke=ke.nextSibling){var ze=ke.nodeType;De=ze===1?De?Le:ke:ze===3&&ee.test(ke.nodeValue)?Le:De}return De===Le?void 0:De}function de(Le,De){var ke={},ze;(function(){for(var we=Le.concat(De),Ze=[],qe={},Qe=0,Ve=we.length;Qe<Ve;++Qe){var tt=we[Qe],Xe=tt[3];if(Xe)for(var Ne=Xe.length;--Ne>=0;)ke[Xe.charAt(Ne)]=tt;var ge=tt[1],Fe=""+ge;qe.hasOwnProperty(Fe)||(Ze.push(ge),qe[Fe]=null)}Ze.push(/[\0-\uffff]/),ze=F(Ze)})();var Ge=De.length,Ie=function(we){for(var Ze=we.sourceCode,qe=we.basePos,Qe=we.sourceNode,Ve=[qe,a],tt=0,Xe=Ze.match(ze)||[],Ne={},ge=0,Fe=Xe.length;ge<Fe;++ge){var je=Xe[ge],Ee=Ne[je],Oe=void 0,le;if(typeof Ee=="string")le=!1;else{var ie=ke[je.charAt(0)];if(ie)Oe=je.match(ie[1]),Ee=ie[0];else{for(var oe=0;oe<Ge;++oe)if(ie=De[oe],Oe=je.match(ie[1]),Oe){Ee=ie[0];break}Oe||(Ee=a)}le=Ee.length>=5&&Ee.substring(0,5)==="lang-",le&&!(Oe&&typeof Oe[1]=="string")&&(le=!1,Ee=b),le||(Ne[je]=Ee)}var Y=tt;if(tt+=je.length,!le)Ve.push(qe+Y,Ee);else{var X=Oe[1],Z=je.indexOf(X),te=Z+X.length;Oe[2]&&(te=je.length-Oe[2].length,Z=te-X.length);var se=Ee.substring(5);J(Qe,qe+Y,je.substring(0,Z),Ie,Ve),J(Qe,qe+Y+Z,X,ue(se,X),Ve),J(Qe,qe+Y+te,je.substring(te),Ie,Ve)}}we.decorations=Ve};return Ie}function Te(Le){var De=[],ke=[];Le.tripleQuotedStrings?De.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Le.multiLineStrings?De.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):De.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Le.verbatimStrings&&ke.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ze=Le.hashComments;ze&&(Le.cStyleComments?(ze>1?De.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):De.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ke.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):De.push([y,/^#[^\r\n]*/,null,"#"])),Le.cStyleComments&&(ke.push([y,/^\/\/[^\r\n]*/,null]),ke.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ge=Le.regexLiterals;if(Ge){var Ie=Ge>1?"":`
|
|
\r`,we=Ie?".":"[\\S\\s]",Ze="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+we+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+we+")*(?:\\x5D|$))+/";ke.push(["lang-regex",RegExp("^"+Q+"("+Ze+")")])}var qe=Le.types;qe&&ke.push([h,qe]);var Qe=(""+Le.keywords).replace(/^ | $/g,"");Qe.length&&ke.push([w,new RegExp("^(?:"+Qe.replace(/[\s,]+/g,"|")+")\\b"),null]),De.push([a,/^\s+/,null,` \r
|
|
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return Le.regexLiterals&&(Ve+="(?!s*/)"),ke.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[h,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(Ve),null]),de(De,ke)}var ve=Te({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function pe(Le,De,ke){for(var ze=/(?:^|\s)nocode(?:\s|$)/,Ge=/\r\n?|\n/,Ie=Le.ownerDocument,we=Ie.createElement("li");Le.firstChild;)we.appendChild(Le.firstChild);var Ze=[we];function qe(ge){var Fe=ge.nodeType;if(Fe==1&&!ze.test(ge.className))if(ge.nodeName==="br")Qe(ge),ge.parentNode&&ge.parentNode.removeChild(ge);else for(var je=ge.firstChild;je;je=je.nextSibling)qe(je);else if((Fe==3||Fe==4)&&ke){var Ee=ge.nodeValue,Oe=Ee.match(Ge);if(Oe){var le=Ee.substring(0,Oe.index);ge.nodeValue=le;var ie=Ee.substring(Oe.index+Oe[0].length);if(ie){var oe=ge.parentNode;oe.insertBefore(Ie.createTextNode(ie),ge.nextSibling)}Qe(ge),le||ge.parentNode.removeChild(ge)}}}function Qe(ge){for(;!ge.nextSibling;)if(ge=ge.parentNode,!ge)return;function Fe(Oe,le){var ie=le?Oe.cloneNode(!1):Oe,oe=Oe.parentNode;if(oe){var Y=Fe(oe,1),X=Oe.nextSibling;Y.appendChild(ie);for(var Z=X;Z;Z=X)X=Z.nextSibling,Y.appendChild(Z)}return ie}for(var je=Fe(ge.nextSibling,0),Ee;(Ee=je.parentNode)&&Ee.nodeType===1;)je=Ee;Ze.push(je)}for(var Ve=0;Ve<Ze.length;++Ve)qe(Ze[Ve]);De===(De|0)&&Ze[0].setAttribute("value",De);var tt=Ie.createElement("ol");tt.className="linenums";for(var Xe=Math.max(0,De-1|0)||0,Ve=0,Ne=Ze.length;Ve<Ne;++Ve)we=Ze[Ve],we.className="L"+(Ve+Xe)%10,we.firstChild||we.appendChild(Ie.createTextNode("\xA0")),tt.appendChild(we);Le.appendChild(tt)}function he(Le){var De=/\bMSIE\s(\d+)/.exec(navigator.userAgent);De=De&&+De[1]<=8;var ke=/\n/g,ze=Le.sourceCode,Ge=ze.length,Ie=0,we=Le.spans,Ze=we.length,qe=0,Qe=Le.decorations,Ve=Qe.length,tt=0;Qe[Ve]=Ge;var Xe,Ne;for(Ne=Xe=0;Ne<Ve;)Qe[Ne]!==Qe[Ne+2]?(Qe[Xe++]=Qe[Ne++],Qe[Xe++]=Qe[Ne++]):Ne+=2;for(Ve=Xe,Ne=Xe=0;Ne<Ve;){for(var ge=Qe[Ne],Fe=Qe[Ne+1],je=Ne+2;je+2<=Ve&&Qe[je+1]===Fe;)je+=2;Qe[Xe++]=ge,Qe[Xe++]=Fe,Ne=je}Ve=Qe.length=Xe;var Ee=Le.sourceNode,Oe="";Ee&&(Oe=Ee.style.display,Ee.style.display="none");try{for(var le=null;qe<Ze;){var ie=we[qe],oe=we[qe+2]||Ge,Y=Qe[tt+2]||Ge,je=Math.min(oe,Y),X=we[qe+1],Z;if(X.nodeType!==1&&(Z=ze.substring(Ie,je))){De&&(Z=Z.replace(ke,"\r")),X.nodeValue=Z;var te=X.ownerDocument,se=te.createElement("span");se.className=Qe[tt+1];var ye=X.parentNode;ye.replaceChild(se,X),se.appendChild(X),Ie<oe&&(we[qe+1]=X=te.createTextNode(ze.substring(je,oe)),ye.insertBefore(X,se.nextSibling))}Ie=je,Ie>=oe&&(qe+=2),Ie>=Y&&(tt+=2)}}finally{Ee&&(Ee.style.display=Oe)}}var me={};function ae(Le,De){for(var ke=De.length;--ke>=0;){var ze=De[ke];me.hasOwnProperty(ze)?B.console&&console.warn("cannot override language handler %s",ze):me[ze]=Le}}function ue(Le,De){return Le&&me.hasOwnProperty(Le)||(Le=/^\s*</.test(De)?"default-markup":"default-code"),me[Le]}ae(ve,["default-code"]),ae(de([],[[a,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ae(de([[a,/^[\s]+/,null,` \r
|
|
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[g,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[O,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ae(de([],[[N,/^[\s\S]+/]]),["uq.val"]),ae(Te({keywords:T,hashComments:!0,cStyleComments:!0,types:f}),["c","cc","cpp","cxx","cyc","m"]),ae(Te({keywords:"null,true,false"}),["json"]),ae(Te({keywords:C,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:f}),["cs"]),ae(Te({keywords:L,cStyleComments:!0}),["java"]),ae(Te({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ae(Te({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ae(Te({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ae(Te({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ae(Te({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ae(Te({keywords:S,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ae(de([],[[m,/^[\s\S]+/]]),["regex"]);function be(Le){var De=Le.langExtension;try{var ke=_(Le.sourceNode,Le.pre),ze=ke.sourceCode;Le.sourceCode=ze,Le.spans=ke.spans,Le.basePos=0,ue(De,ze)(Le),he(Le)}catch(Ge){B.console&&console.log(Ge&&Ge.stack||Ge)}}function Ue(Le,De,ke){var ze=ke||!1,Ge=De||null,Ie=document.createElement("div");Ie.innerHTML="<pre>"+Le+"</pre>",Ie=Ie.firstChild,ze&&pe(Ie,ze,!0);var we={langExtension:Ge,numberLines:ze,sourceNode:Ie,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return be(we),Ie.innerHTML}function Pe(Le,De){var ke=De||document.body,ze=ke.ownerDocument||document;function Ge(ie){return ke.getElementsByTagName(ie)}for(var Ie=[Ge("pre"),Ge("code"),Ge("xmp")],we=[],Ze=0;Ze<Ie.length;++Ze)for(var qe=0,Qe=Ie[Ze].length;qe<Qe;++qe)we.push(Ie[Ze][qe]);Ie=null;var Ve=Date;Ve.now||(Ve={now:function(){return+new Date}});var tt=0,Xe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,ge=/\bprettyprinted\b/,Fe=/pre|xmp/i,je=/^code$/i,Ee=/^(?:pre|code|xmp)$/i,Oe={};function le(){for(var ie=B.PR_SHOULD_USE_CONTINUATION?Ve.now()+250:Infinity;tt<we.length&&Ve.now()<ie;tt++){for(var oe=we[tt],Y=Oe,X=oe;X=X.previousSibling;){var Z=X.nodeType,te=(Z===7||Z===8)&&X.nodeValue;if(te?!/^\??prettify\b/.test(te):Z!==3||/\S/.test(X.nodeValue))break;if(te){Y={},te.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Bt,Et,Cr){Y[Et]=Cr});break}}var se=oe.className;if((Y!==Oe||Ne.test(se))&&!ge.test(se)){for(var ye=!1,Ce=oe.parentNode;Ce;Ce=Ce.parentNode){var Ye=Ce.tagName;if(Ee.test(Ye)&&Ce.className&&Ne.test(Ce.className)){ye=!0;break}}if(!ye){oe.className+=" prettyprinted";var at=Y.lang;if(!at){at=se.match(Xe);var rt;!at&&(rt=re(oe))&&je.test(rt.tagName)&&(at=rt.className.match(Xe)),at&&(at=at[1])}var xt;if(Fe.test(oe.tagName))xt=1;else{var ht=oe.currentStyle,st=ze.defaultView,Ct=ht?ht.whiteSpace:st&&st.getComputedStyle?st.getComputedStyle(oe,null).getPropertyValue("white-space"):0;xt=Ct&&Ct.substring(0,3)==="pre"}var yt=Y.linenums;(yt=yt==="true"||+yt)||(yt=se.match(/\blinenums\b(?::(\d+))?/),yt=yt?yt[1]&&yt[1].length?+yt[1]:!0:!1),yt&&pe(oe,yt,xt);var Ft={langExtension:at,sourceNode:oe,numberLines:yt,pre:xt,sourceCode:null,basePos:null,spans:null,decorations:null};be(Ft)}}}tt<we.length?B.setTimeout(le,250):typeof Le=="function"&&Le()}le()}var He=B.PR={createSimpleLexer:de,registerLangHandler:ae,sourceDecorator:Te,PR_ATTRIB_NAME:O,PR_ATTRIB_VALUE:N,PR_COMMENT:y,PR_DECLARATION:p,PR_KEYWORD:w,PR_LITERAL:c,PR_NOCODE:W,PR_PLAIN:a,PR_PUNCTUATION:s,PR_SOURCE:b,PR_STRING:m,PR_TAG:g,PR_TYPE:h,prettyPrintOne:D?B.prettyPrintOne=Ue:M=Ue,prettyPrint:U=D?B.prettyPrint=Pe:U=Pe},Je=B.define;typeof Je=="function"&&Je.amd&&Je("google-code-prettify",[],function(){return He})})()},SMhR:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUg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s8qW02QDZt861OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI2ffDkgT2qbJwF5UttsgLwJyJPa5gaQG0De0jY3gGza5gaQG22zAXKjbZ4EZAPkTUBuANm0zac6kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjR+ole1zZvaZgPkRtvcAPIkIJu22QDZtM3fCsiNttkAudE2TwKyaZtN22yAbNrmBpAbbbMBsgGyaZu3nEiSpHEiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaP9FHA3KjbTZAngRk0zafDMiTgPyptrkB5Eltc6Nt3gTkTW1zA8imbZ7UNt/qRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4yZdrm28G5JO1zQ0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(Se,xe,V){Se.exports=V.p+"static/lockclose.365036e8.svg"},UUDw:function(Se,xe,V){Se.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},"VrN/":function(Se,xe,V){(function(q,G){Se.exports=G()})(this,function(){"use strict";var q=navigator.userAgent,G=navigator.platform,D=/gecko\/\d/i.test(q),K=/MSIE \d/.test(q),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),M=/Edge\/(\d+)/.exec(q),U=K||P||M,B=U&&(K?document.documentMode||6:+(M||P)[1]),I=!M&&/WebKit\//.test(q),R=I&&/Qt\/\d+\.\d+/.test(q),v=!M&&/Chrome\//.test(q),T=/Opera\//.test(q),L=/Apple Computer/.test(navigator.vendor),C=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),S=/PhantomJS/.test(q),E=!M&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),u=/Android/.test(q),o=E||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),l=E||/Mac/.test(G),d=/\bCrOS\b/.test(q),A=/win/i.test(G),f=T&&q.match(/Version\/(\d*\.\d*)/);f&&(f=Number(f[1])),f&&f>=15&&(T=!1,I=!0);var m=l&&(R||T&&(f==null||f<12.11)),w=D||U&&B>=9;function y(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var h=function(e,t){var n=e.className,r=y(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function c(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return c(e).appendChild(t)}function a(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var x=0;x<t.length;++x)i.appendChild(t[x]);return i}function g(e,t,n,r){var i=a(e,t,n,r);return i.setAttribute("role","presentation"),i}var p;document.createRange?p=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:p=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function O(){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 N(e,t){var n=e.className;y(t).test(n)||(e.className+=(n?" ":"")+t)}function W(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!y(n[r]).test(t)&&(t+=" "+n[r]);return t}var Q=function(e){e.select()};E?Q=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:U&&(Q=function(e){try{e.select()}catch(t){}});function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function _(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function J(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var x=r||0,k=i||0;;){var j=e.indexOf(" ",x);if(j<0||j>=t)return k+(t-x);k+=j-x,k+=n-k%n,x=j+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function re(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var de=50,Te={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},pe={origin:"*mouse"},he={origin:"+move"};function me(e,t,n){for(var r=0,i=0;;){var x=e.indexOf(" ",r);x==-1&&(x=e.length);var k=x-r;if(x==e.length||i+k>=t)return r+Math.min(k,t-i);if(i+=x-r,i+=n-i%n,r=x+1,i>=t)return r}}var ae=[""];function ue(e){for(;ae.length<=e;)ae.push(be(ae)+" ");return ae[e]}function be(e){return e[e.length-1]}function Ue(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Pe(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function He(){}function Je(e,t){var n;return Object.create?n=Object.create(e):(He.prototype=e,n=new He),t&&_(t,n),n}var Le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function De(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Le.test(e))}function ke(e,t){return t?t.source.indexOf("\\w")>-1&&De(e)?!0:t.test(e):De(e)}function ze(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ge=/[\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 Ie(e){return e.charCodeAt(0)>=768&&Ge.test(e)}function we(e,t,n){for(;(n<0?t>0:t<e.length)&&Ie(e.charAt(t));)t+=n;return t}function Ze(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,x=r<0?Math.ceil(i):Math.floor(i);if(x==t)return e(x)?t:n;e(x)?n=x:t=x+r}}function qe(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,x=0;x<e.length;++x){var k=e[x];(k.from<n&&k.to>t||t==n&&k.to==t)&&(r(Math.max(k.from,t),Math.min(k.to,n),k.level==1?"rtl":"ltr",x),i=!0)}i||r(t,n,"ltr")}var Qe=null;function Ve(e,t,n){var r;Qe=null;for(var i=0;i<e.length;++i){var x=e[i];if(x.from<t&&x.to>t)return i;x.to==t&&(x.from!=x.to&&n=="before"?r=i:Qe=i),x.from==t&&(x.from!=x.to&&n!="before"?r=i:Qe=i)}return r!=null?r:Qe}var tt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(z){return z<=247?e.charAt(z):1424<=z&&z<=1524?"R":1536<=z&&z<=1785?t.charAt(z-1536):1774<=z&&z<=2220?"r":8192<=z&&z<=8203?"w":z==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,x=/[LRr]/,k=/[Lb1n]/,j=/[1n]/;function H(z,$,ne){this.level=z,this.from=$,this.to=ne}return function(z,$){var ne=$=="ltr"?"L":"R";if(z.length==0||$=="ltr"&&!r.test(z))return!1;for(var fe=z.length,ce=[],Ae=0;Ae<fe;++Ae)ce.push(n(z.charCodeAt(Ae)));for(var Re=0,Be=ne;Re<fe;++Re){var We=ce[Re];We=="m"?ce[Re]=Be:Be=We}for(var $e=0,Ke=ne;$e<fe;++$e){var et=ce[$e];et=="1"&&Ke=="r"?ce[$e]="n":x.test(et)&&(Ke=et,et=="r"&&(ce[$e]="R"))}for(var ut=1,ot=ce[0];ut<fe-1;++ut){var mt=ce[ut];mt=="+"&&ot=="1"&&ce[ut+1]=="1"?ce[ut]="1":mt==","&&ot==ce[ut+1]&&(ot=="1"||ot=="n")&&(ce[ut]=ot),ot=mt}for(var Lt=0;Lt<fe;++Lt){var Kt=ce[Lt];if(Kt==",")ce[Lt]="N";else if(Kt=="%"){var It=void 0;for(It=Lt+1;It<fe&&ce[It]=="%";++It);for(var sr=Lt&&ce[Lt-1]=="!"||It<fe&&ce[It]=="1"?"1":"N",nr=Lt;nr<It;++nr)ce[nr]=sr;Lt=It-1}}for(var kt=0,ir=ne;kt<fe;++kt){var zt=ce[kt];ir=="L"&&zt=="1"?ce[kt]="L":x.test(zt)&&(ir=zt)}for(var Nt=0;Nt<fe;++Nt)if(i.test(ce[Nt])){var _t=void 0;for(_t=Nt+1;_t<fe&&i.test(ce[_t]);++_t);for(var Mt=(Nt?ce[Nt-1]:ne)=="L",ar=(_t<fe?ce[_t]:ne)=="L",jn=Mt==ar?Mt?"L":"R":ne,Xr=Nt;Xr<_t;++Xr)ce[Xr]=jn;Nt=_t-1}for(var Yt=[],Ir,Ht=0;Ht<fe;)if(k.test(ce[Ht])){var Va=Ht;for(++Ht;Ht<fe&&k.test(ce[Ht]);++Ht);Yt.push(new H(0,Va,Ht))}else{var jr=Ht,fn=Yt.length,hn=$=="rtl"?1:0;for(++Ht;Ht<fe&&ce[Ht]!="L";++Ht);for(var Zt=jr;Zt<Ht;)if(j.test(ce[Zt])){jr<Zt&&(Yt.splice(fn,0,new H(1,jr,Zt)),fn+=hn);var Wn=Zt;for(++Zt;Zt<Ht&&j.test(ce[Zt]);++Zt);Yt.splice(fn,0,new H(2,Wn,Zt)),fn+=hn,jr=Zt}else++Zt;jr<Ht&&Yt.splice(fn,0,new H(1,jr,Ht))}return $=="ltr"&&(Yt[0].level==1&&(Ir=z.match(/^\s+/))&&(Yt[0].from=Ir[0].length,Yt.unshift(new H(0,0,Ir[0].length))),be(Yt).level==1&&(Ir=z.match(/\s+$/))&&(be(Yt).to-=Ir[0].length,Yt.push(new H(0,fe-Ir[0].length,fe)))),$=="rtl"?Yt.reverse():Yt}}();function Xe(e,t){var n=e.order;return n==null&&(n=e.order=tt(e.text,t)),n}var Ne=[],ge=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ne).concat(n)}};function Fe(e,t){return e._handlers&&e._handlers[t]||Ne}function je(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var x=re(i,n);x>-1&&(r[t]=i.slice(0,x).concat(i.slice(x+1)))}}}function Ee(e,t){var n=Fe(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Oe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ee(e,n||t.type,e,t),Z(t)||t.codemirrorIgnore}function le(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)re(n,t[r])==-1&&n.push(t[r])}function ie(e,t){return Fe(e,t).length>0}function oe(e){e.prototype.on=function(t,n){ge(this,t,n)},e.prototype.off=function(t,n){je(this,t,n)}}function Y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function X(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Z(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function te(e){Y(e),X(e)}function se(e){return e.target||e.srcElement}function ye(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),l&&e.ctrlKey&&t==1&&(t=3),t}var Ce=function(){if(U&&B<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),Ye;function at(e){if(Ye==null){var t=a("span","\u200B");s(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ye=t.offsetWidth<=1&&t.offsetHeight>2&&!(U&&B<8))}var n=Ye?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var rt;function xt(e){if(rt!=null)return rt;var t=s(e,document.createTextNode("A\u062EA")),n=p(t,0,1).getBoundingClientRect(),r=p(t,1,2).getBoundingClientRect();return c(e),!n||n.left==n.right?!1:rt=r.right-n.right<3}var ht=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var x=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),k=x.indexOf("\r");k!=-1?(n.push(x.slice(0,k)),t+=k+1):(n.push(x),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},st=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(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ct=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),yt=null;function Ft(e){if(yt!=null)return yt;var t=s(e,a("span","x")),n=t.getBoundingClientRect(),r=p(t,0,1).getBoundingClientRect();return yt=Math.abs(n.left-r.left)>1}var Bt={},Et={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Bt[e]=t}function Or(e,t){Et[e]=t}function lr(e){if(typeof e=="string"&&Et.hasOwnProperty(e))e=Et[e];else if(e&&typeof e.name=="string"&&Et.hasOwnProperty(e.name)){var t=Et[e.name];typeof t=="string"&&(t={name:t}),e=Je(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return lr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return lr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function pr(e,t){t=lr(t);var n=Bt[t.name];if(!n)return pr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var x in i){if(!i.hasOwnProperty(x))continue;r.hasOwnProperty(x)&&(r["_"+x]=r[x]),r[x]=i[x]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var k in t.modeProps)r[k]=t.modeProps[k];return r}var fr={};function ia(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};_(t,n)}function wr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Kn(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Hn(e,t,n){return e.startState?e.startState(t,n):!0}var Ot=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ot.prototype.eol=function(){return this.pos>=this.string.length},Ot.prototype.sol=function(){return this.pos==this.lineStart},Ot.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ot.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ot.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Ot.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ot.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ot.prototype.skipToEnd=function(){this.pos=this.string.length},Ot.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ot.prototype.backUp=function(e){this.pos-=e},Ot.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)},Ot.prototype.indentation=function(){return J(this.string,null,this.tabSize)-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(k){return n?k.toLowerCase():k},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var x=this.string.slice(this.pos).match(e);return x&&x.index>0?null:(x&&t!==!1&&(this.pos+=x[0].length),x)}},Ot.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ot.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ot.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ot.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function nt(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 n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],x=i.chunkSize();if(t<x){n=i;break}t-=x}return n.lines[t]}function Mr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(x){var k=x.text;i==n.line&&(k=k.slice(0,n.ch)),i==t.line&&(k=k.slice(t.ch)),r.push(k),++i}),r}function mn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function qt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function At(e){if(e.parent==null)return null;for(var t=e.parent,n=re(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;!(r.children[i]==t);++i)n+=r.children[i].chunkSize();return n+t.first}function gr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],x=i.height;if(t<x){e=i;continue e}t-=x,n+=i.chunkSize()}return n}while(!e.lines);for(var k=0;k<e.lines.length;++k){var j=e.lines[k],H=j.height;if(t<H)break;t-=H}return n+k}function Pr(e,t){return t>=e.first&&t<e.first+e.size}function pn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Me(e,t,n){if(n===void 0&&(n=null),!(this instanceof Me))return new Me(e,t,n);this.line=e,this.ch=t,this.sticky=n}function dt(e,t){return e.line-t.line||e.ch-t.ch}function Gn(e,t){return e.sticky==t.sticky&&dt(e,t)==0}function gn(e){return Me(e.line,e.ch)}function vn(e,t){return dt(e,t)<0?t:e}function Zr(e,t){return dt(e,t)<0?e:t}function yn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ft(e,t){if(t.line<e.first)return Me(e.first,0);var n=e.first+e.size-1;return t.line>n?Me(n,nt(e,n).text.length):wi(t,nt(e,t.line).text.length)}function wi(e,t){var n=e.ch;return n==null||n>t?Me(e.line,t):n<0?Me(e.line,0):e}function _e(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ft(e,t[r]);return n}var En=function(e,t){this.state=e,this.lookAhead=t},hr=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};hr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},hr.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}},hr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},hr.fromSaved=function(e,t,n){return t instanceof En?new hr(e,wr(e.mode,t.state),n,t.lookAhead):new hr(e,wr(e.mode,t),n)},hr.prototype.save=function(e){var t=e!==!1?wr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new En(t,this.maxLookAhead):t};function zn(e,t,n,r){var i=[e.state.modeGen],x={};Er(e,t.text,e.doc.mode,n,function(z,$){return i.push(z,$)},x,r);for(var k=n.state,j=function(z){n.baseTokens=i;var $=e.state.overlays[z],ne=1,fe=0;n.state=!0,Er(e,t.text,$.mode,n,function(ce,Ae){for(var Re=ne;fe<ce;){var Be=i[ne];Be>ce&&i.splice(ne,1,ce,i[ne+1],Be),ne+=2,fe=Math.min(ce,Be)}if(!Ae)return;if($.opaque)i.splice(Re,ne-Re,ce,"overlay "+Ae),ne=Re+2;else for(;Re<ne;Re+=2){var We=i[Re+1];i[Re+1]=(We?We+" ":"")+"overlay "+Ae}},x),n.state=k,n.baseTokens=null,n.baseTokenPos=1},H=0;H<e.state.overlays.length;++H)j(H);return{styles:i,classes:x.bgClass||x.textClass?x:null}}function qr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=vr(e,At(t)),i=t.text.length>e.options.maxHighlightLength&&wr(e.doc.mode,r.state),x=zn(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=x.styles,x.classes?t.styleClasses=x.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function vr(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new hr(r,!0,t);var x=Li(e,t,n),k=x>r.first&&nt(r,x-1).stateAfter,j=k?hr.fromSaved(r,k,x):new hr(r,Hn(r.mode),x);return r.iter(x,t,function(H){Vn(e,H.text,j);var z=j.line;H.stateAfter=z==t-1||z%5==0||z>=i.viewFrom&&z<i.viewTo?j.save():null,j.nextLine()}),n&&(r.modeFrontier=j.line),j}function Vn(e,t,n,r){var i=e.doc.mode,x=new Ot(t,e.options.tabSize,n);for(x.start=x.pos=r||0,t==""&&Qn(i,n.state);!x.eol();)yr(i,x,n.state),x.start=x.pos}function Qn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=Kn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function yr(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Kn(e,n).mode);var x=e.token(t,n);if(t.pos>t.start)return x}throw new Error("Mode "+e.name+" failed to advance stream.")}var Yn=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Di(e,t,n,r){var i=e.doc,x=i.mode,k;t=ft(i,t);var j=nt(i,t.line),H=vr(e,t.line,n),z=new Ot(j.text,e.options.tabSize,H),$;for(r&&($=[]);(r||z.pos<t.ch)&&!z.eol();)z.start=z.pos,k=yr(x,z,H.state),r&&$.push(new Yn(z,k,wr(i.mode,H.state)));return r?$:new Yn(z,k,H.state)}function Jn(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Er(e,t,n,r,i,x,k){var j=n.flattenSpans;j==null&&(j=e.options.flattenSpans);var H=0,z=null,$=new Ot(t,e.options.tabSize,r),ne,fe=e.options.addModeClass&&[null];for(t==""&&Jn(Qn(n,r.state),x);!$.eol();){if($.pos>e.options.maxHighlightLength?(j=!1,k&&Vn(e,t,r,$.pos),$.pos=t.length,ne=null):ne=Jn(yr(n,$,r.state,fe),x),fe){var ce=fe[0].name;ce&&(ne="m-"+(ne?ce+" "+ne:ce))}if(!j||z!=ne){for(;H<$.start;)H=Math.min($.start,H+5e3),i(H,z);z=ne}$.start=$.pos}for(;H<$.pos;){var Ae=Math.min($.pos,H+5e3);i(Ae,z),H=Ae}}function Li(e,t,n){for(var r,i,x=e.doc,k=n?-1:t-(e.doc.mode.innerMode?1e3:100),j=t;j>k;--j){if(j<=x.first)return x.first;var H=nt(x,j-1),z=H.stateAfter;if(z&&(!n||j+(z instanceof En?z.lookAhead:0)<=x.modeFrontier))return j;var $=J(H.text,null,e.options.tabSize);(i==null||r>$)&&(i=j-1,r=$)}return i}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var i=nt(e,r).stateAfter;if(i&&(!(i instanceof En)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Xn=!1,Jt=!1;function Wr(){Xn=!0}function oa(){Jt=!0}function $r(e,t,n){this.marker=e,this.from=t,this.to=n}function br(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Zn(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function sa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ri(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var x=e[i],k=x.marker,j=x.from==null||(k.inclusiveLeft?x.from<=t:x.from<t);if(j||x.from==t&&k.type=="bookmark"&&(!n||!x.marker.insertLeft)){var H=x.to==null||(k.inclusiveRight?x.to>=t:x.to>t);(r||(r=[])).push(new $r(k,x.from,H?null:x.to))}}return r}function Ii(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var x=e[i],k=x.marker,j=x.to==null||(k.inclusiveRight?x.to>=t:x.to>t);if(j||x.from==t&&k.type=="bookmark"&&(!n||x.marker.insertLeft)){var H=x.from==null||(k.inclusiveLeft?x.from<=t:x.from<t);(r||(r=[])).push(new $r(k,H?null:x.from-t,x.to==null?null:x.to-t))}}return r}function bn(e,t){if(t.full)return null;var n=Pr(e,t.from.line)&&nt(e,t.from.line).markedSpans,r=Pr(e,t.to.line)&&nt(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,x=t.to.ch,k=dt(t.from,t.to)==0,j=Ri(n,i,k),H=Ii(r,x,k),z=t.text.length==1,$=be(t.text).length+(z?i:0);if(j)for(var ne=0;ne<j.length;++ne){var fe=j[ne];if(fe.to==null){var ce=br(H,fe.marker);ce?z&&(fe.to=ce.to==null?null:ce.to+$):fe.to=i}}if(H)for(var Ae=0;Ae<H.length;++Ae){var Re=H[Ae];if(Re.to!=null&&(Re.to+=$),Re.from==null){var Be=br(j,Re.marker);Be||(Re.from=$,z&&(j||(j=[])).push(Re))}else Re.from+=$,z&&(j||(j=[])).push(Re)}j&&(j=Oi(j)),H&&H!=j&&(H=Oi(H));var We=[j];if(!z){var $e=t.text.length-2,Ke;if($e>0&&j)for(var et=0;et<j.length;++et)j[et].to==null&&(Ke||(Ke=[])).push(new $r(j[et].marker,null,null));for(var ut=0;ut<$e;++ut)We.push(Ke);We.push(H)}return We}function Oi(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Mi(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(ce){if(ce.markedSpans)for(var Ae=0;Ae<ce.markedSpans.length;++Ae){var Re=ce.markedSpans[Ae].marker;Re.readOnly&&(!r||re(r,Re)==-1)&&(r||(r=[])).push(Re)}}),!r)return null;for(var i=[{from:t,to:n}],x=0;x<r.length;++x)for(var k=r[x],j=k.find(0),H=0;H<i.length;++H){var z=i[H];if(dt(z.to,j.from)<0||dt(z.from,j.to)>0)continue;var $=[H,1],ne=dt(z.from,j.from),fe=dt(z.to,j.to);(ne<0||!k.inclusiveLeft&&!ne)&&$.push({from:z.from,to:j.from}),(fe>0||!k.inclusiveRight&&!fe)&&$.push({from:j.to,to:z.to}),i.splice.apply(i,$),H+=$.length-3}return i}function la(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function xn(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function en(e){return e.inclusiveLeft?-1:0}function tn(e){return e.inclusiveRight?1:0}function An(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),x=dt(r.from,i.from)||en(e)-en(t);if(x)return-x;var k=dt(r.to,i.to)||tn(e)-tn(t);return k||t.id-e.id}function kr(e,t){var n=Jt&&e.markedSpans,r;if(n)for(var i=void 0,x=0;x<n.length;++x)i=n[x],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||An(r,i.marker)<0)&&(r=i.marker);return r}function _r(e){return kr(e,!0)}function Br(e){return kr(e,!1)}function Tn(e,t){var n=Jt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var x=n[i];x.marker.collapsed&&(x.from==null||x.from<t)&&(x.to==null||x.to>t)&&(!r||An(r,x.marker)<0)&&(r=x.marker)}return r}function Pi(e,t,n,r,i){var x=nt(e,t),k=Jt&&x.markedSpans;if(k)for(var j=0;j<k.length;++j){var H=k[j];if(!H.marker.collapsed)continue;var z=H.marker.find(0),$=dt(z.from,n)||en(H.marker)-en(i),ne=dt(z.to,r)||tn(H.marker)-tn(i);if($>=0&&ne<=0||$<=0&&ne>=0)continue;if($<=0&&(H.marker.inclusiveRight&&i.inclusiveLeft?dt(z.to,n)>=0:dt(z.to,n)>0)||$>=0&&(H.marker.inclusiveRight&&i.inclusiveLeft?dt(z.from,r)<=0:dt(z.from,r)<0))return!0}}function ur(e){for(var t;t=_r(e);)e=t.find(-1,!0).line;return e}function ki(e){for(var t;t=Br(e);)e=t.find(1,!0).line;return e}function Sn(e){for(var t,n;t=Br(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function qn(e,t){var n=nt(e,t),r=ur(n);return n==r?t:At(r)}function Kr(e,t){if(t>e.lastLine())return t;var n=nt(e,t),r;if(!Dr(e,n))return t;for(;r=Br(n);)n=r.find(1,!0).line;return At(n)+1}function Dr(e,t){var n=Jt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){if(r=n[i],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&$n(e,t,r))return!0}}function $n(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return $n(e,r.line,br(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,x=0;x<t.markedSpans.length;++x)if(i=t.markedSpans[x],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&$n(e,t,i))return!0}function xr(e){e=ur(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var x=n.parent;x;n=x,x=n.parent)for(var k=0;k<x.children.length;++k){var j=x.children[k];if(j==n)break;t+=j.height}return t}function ei(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=_r(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Br(r);){var x=n.find(0,!0);t-=r.text.length-x.from.ch,r=x.to.line,t+=r.text.length-x.to.ch}return t}function _i(e){var t=e.display,n=e.doc;t.maxLine=nt(n,n.first),t.maxLineLength=ei(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=ei(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var rn=function(e,t,n){this.text=e,xn(this,t),this.height=n?n(this):1};rn.prototype.lineNo=function(){return At(this)},oe(rn);function ua(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),xn(e,n);var i=r?r(e):1;i!=e.height&&qt(e,i)}function it(e){e.parent=null,la(e)}var ct={},lt={};function pt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?lt:ct;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function bt(e,t){var n=g("span",null,null,I?"padding-right: .1px":null),r={pre:g("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var x=i?t.rest[i-1]:t.line,k=void 0;r.pos=0,r.addToken=vt,xt(e.display.measure)&&(k=Xe(x,e.doc.direction))&&(r.addToken=$t(r.addToken,k)),r.map=[];var j=t!=e.display.externalMeasured&&At(x);Ur(x,r,qr(e,x,j)),x.styleClasses&&(x.styleClasses.bgClass&&(r.bgClass=W(x.styleClasses.bgClass,r.bgClass||"")),x.styleClasses.textClass&&(r.textClass=W(x.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(at(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(I){var H=r.content.lastChild;(/\bcm-tab\b/.test(H.className)||H.querySelector&&H.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ee(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=W(r.pre.className,r.textClass||"")),r}function Dt(e){var t=a("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vt(e,t,n,r,i,x,k){if(!t)return;var j=e.splitSpaces?Ut(t,e.trailingSpace):t,H=e.cm.state.specialChars,z=!1,$;if(!H.test(t))e.col+=t.length,$=document.createTextNode(j),e.map.push(e.pos,e.pos+t.length,$),U&&B<9&&(z=!0),e.pos+=t.length;else{$=document.createDocumentFragment();for(var ne=0;;){H.lastIndex=ne;var fe=H.exec(t),ce=fe?fe.index-ne:t.length-ne;if(ce){var Ae=document.createTextNode(j.slice(ne,ne+ce));U&&B<9?$.appendChild(a("span",[Ae])):$.appendChild(Ae),e.map.push(e.pos,e.pos+ce,Ae),e.col+=ce,e.pos+=ce}if(!fe)break;ne+=ce+1;var Re=void 0;if(fe[0]==" "){var Be=e.cm.options.tabSize,We=Be-e.col%Be;Re=$.appendChild(a("span",ue(We),"cm-tab")),Re.setAttribute("role","presentation"),Re.setAttribute("cm-text"," "),e.col+=We}else fe[0]=="\r"||fe[0]==`
|
|
`?(Re=$.appendChild(a("span",fe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Re.setAttribute("cm-text",fe[0]),e.col+=1):(Re=e.cm.options.specialCharPlaceholder(fe[0]),Re.setAttribute("cm-text",fe[0]),U&&B<9?$.appendChild(a("span",[Re])):$.appendChild(Re),e.col+=1);e.map.push(e.pos,e.pos+1,Re),e.pos++}}if(e.trailingSpace=j.charCodeAt(t.length-1)==32,n||r||i||z||x||k){var $e=n||"";r&&($e+=r),i&&($e+=i);var Ke=a("span",[$],$e,x);if(k)for(var et in k)k.hasOwnProperty(et)&&et!="style"&&et!="class"&&Ke.setAttribute(et,k[et]);return e.content.appendChild(Ke)}e.content.appendChild($)}function Ut(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var x=e.charAt(i);x==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(x="\xA0"),r+=x,n=x==" "}return r}function $t(e,t){return function(n,r,i,x,k,j,H){i=i?i+" cm-force-border":"cm-force-border";for(var z=n.pos,$=z+r.length;;){for(var ne=void 0,fe=0;fe<t.length&&!(ne=t[fe],ne.to>z&&ne.from<=z);fe++);if(ne.to>=$)return e(n,r,i,x,k,j,H);e(n,r.slice(0,ne.to-z),i,x,null,j,H),x=null,r=r.slice(ne.to-z),z=ne.to}}}function gt(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ur(e,t,n){var r=e.markedSpans,i=e.text,x=0;if(!r){for(var k=1;k<n.length;k+=2)t.addToken(t,i.slice(x,x=n[k]),pt(n[k+1],t.cm.options));return}for(var j=i.length,H=0,z=1,$="",ne,fe,ce=0,Ae,Re,Be,We,$e;;){if(ce==H){Ae=Re=Be=fe="",$e=null,We=null,ce=Infinity;for(var Ke=[],et=void 0,ut=0;ut<r.length;++ut){var ot=r[ut],mt=ot.marker;if(mt.type=="bookmark"&&ot.from==H&&mt.widgetNode)Ke.push(mt);else if(ot.from<=H&&(ot.to==null||ot.to>H||mt.collapsed&&ot.to==H&&ot.from==H)){if(ot.to!=null&&ot.to!=H&&ce>ot.to&&(ce=ot.to,Re=""),mt.className&&(Ae+=" "+mt.className),mt.css&&(fe=(fe?fe+";":"")+mt.css),mt.startStyle&&ot.from==H&&(Be+=" "+mt.startStyle),mt.endStyle&&ot.to==ce&&(et||(et=[])).push(mt.endStyle,ot.to),mt.title&&(($e||($e={})).title=mt.title),mt.attributes)for(var Lt in mt.attributes)($e||($e={}))[Lt]=mt.attributes[Lt];mt.collapsed&&(!We||An(We.marker,mt)<0)&&(We=ot)}else ot.from>H&&ce>ot.from&&(ce=ot.from)}if(et)for(var Kt=0;Kt<et.length;Kt+=2)et[Kt+1]==ce&&(Re+=" "+et[Kt]);if(!We||We.from==H)for(var It=0;It<Ke.length;++It)gt(t,0,Ke[It]);if(We&&(We.from||0)==H){if(gt(t,(We.to==null?j+1:We.to)-H,We.marker,We.from==null),We.to==null)return;We.to==H&&(We=!1)}}if(H>=j)break;for(var sr=Math.min(j,ce);;){if($){var nr=H+$.length;if(!We){var kt=nr>sr?$.slice(0,sr-H):$;t.addToken(t,kt,ne?ne+Ae:Ae,Be,H+kt.length==ce?Re:"",fe,$e)}if(nr>=sr){$=$.slice(sr-H),H=sr;break}H=nr,Be=""}$=i.slice(x,x=n[z++]),ne=pt(n[z++],t.cm.options)}}}function Tt(e,t,n){this.line=t,this.rest=Sn(t),this.size=this.rest?At(be(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Dr(e,t)}function er(e,t,n){for(var r=[],i,x=t;x<n;x=i){var k=new Tt(e.doc,nt(e.doc,x),x);i=x+k.size,r.push(k)}return r}var Vt=null;function mr(e){Vt?Vt.ops.push(e):e.ownsGroup=Vt={ops:[e],delayedCallbacks:[]}}function Is(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Os(e,t){var n=e.ownsGroup;if(!n)return;try{Is(n)}finally{Vt=null,t(n)}}var ti=null;function Gt(e,t){var n=Fe(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;Vt?i=Vt.delayedCallbacks:ti?i=ti:(i=ti=[],setTimeout(Ms,0));for(var x=function(j){i.push(function(){return n[j].apply(null,r)})},k=0;k<n.length;++k)x(k)}function Ms(){var e=ti;ti=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,n,r){for(var i=0;i<t.changes.length;i++){var x=t.changes[i];x=="text"?ks(e,t):x=="gutter"?Xa(e,t,n,r):x=="class"?da(e,t):x=="widget"&&_s(e,t,r)}t.changes=null}function ri(e){return e.node==e.text&&(e.node=a("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),U&&B<8&&(e.node.style.zIndex=2)),e.node}function Ps(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=ri(t);t.background=r.insertBefore(a("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Ja(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):bt(e,t)}function ks(e,t){var n=t.text.className,r=Ja(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,da(e,t)):n&&(t.text.className=n)}function da(e,t){Ps(e,t),t.line.wrapClass?ri(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Xa(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ri(t);t.gutterBackground=a("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var x=t.line.gutterMarkers;if(e.options.lineNumbers||x){var k=ri(t),j=t.gutter=a("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(j),k.insertBefore(j,t.text),t.line.gutterClass&&(j.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!x||!x["CodeMirror-linenumbers"])&&(t.lineNumber=j.appendChild(a("div",pn(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),x)for(var H=0;H<e.display.gutterSpecs.length;++H){var z=e.display.gutterSpecs[H].className,$=x.hasOwnProperty(z)&&x[z];$&&j.appendChild(a("div",[$],"CodeMirror-gutter-elt","left: "+r.gutterLeft[z]+"px; width: "+r.gutterWidth[z]+"px"))}}}function _s(e,t,n){t.alignable&&(t.alignable=null);for(var r=y("CodeMirror-linewidget"),i=t.node.firstChild,x=void 0;i;i=x)x=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Za(e,t,n)}function Bs(e,t,n,r){var i=Ja(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),da(e,t),Xa(e,t,n,r),Za(e,t,r),t.node}function Za(e,t,n){if(qa(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)qa(e,t.rest[r],t,n,!1)}function qa(e,t,n,r,i){if(!t.widgets)return;for(var x=ri(n),k=0,j=t.widgets;k<j.length;++k){var H=j[k],z=a("div",[H.node],"CodeMirror-linewidget"+(H.className?" "+H.className:""));H.handleMouseEvents||z.setAttribute("cm-ignore-events","true"),Us(H,z,n,r),e.display.input.setUneditable(z),i&&H.above?x.insertBefore(z,n.gutter||n.text):x.appendChild(z),Gt(H,"redraw")}}function Us(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ni(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,a("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Nr(e,t){for(var n=se(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Bi(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,a("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Lr(e){return de-e.display.nativeBarWidth}function nn(e){return e.display.scroller.clientWidth-Lr(e)-e.display.barWidth}function fa(e){return e.display.scroller.clientHeight-Lr(e)-e.display.barHeight}function Ns(e,t,n){var r=e.options.lineWrapping,i=r&&nn(e);if(!t.measure.heights||r&&t.measure.width!=i){var x=t.measure.heights=[];if(r){t.measure.width=i;for(var k=t.text.firstChild.getClientRects(),j=0;j<k.length-1;j++){var H=k[j],z=k[j+1];Math.abs(H.bottom-z.bottom)>2&&x.push((H.bottom+z.top)/2-n.top)}}x.push(n.bottom-n.top)}}function eo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(At(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fs(e,t){t=ur(t);var n=At(t),r=e.display.externalMeasured=new Tt(e.doc,t,n);r.lineN=n;var i=r.built=bt(e,r);return r.text=i.pre,s(e.display.lineMeasure,i.pre),r}function to(e,t,n,r){return Rr(e,Cn(e,t),n,r)}function ha(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[sn(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Cn(e,t){var n=At(t),r=ha(e,n);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,n,Ea(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var i=eo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Rr(e,t,n,r,i){t.before&&(n=-1);var x=n+(r||""),k;return t.cache.hasOwnProperty(x)?k=t.cache[x]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ns(e,t.view,t.rect),t.hasHeights=!0),k=Ws(e,t,n,r),k.bogus||(t.cache[x]=k)),{left:k.left,right:k.right,top:i?k.rtop:k.top,bottom:i?k.rbottom:k.bottom}}var ro={left:0,right:0,top:0,bottom:0};function no(e,t,n){for(var r,i,x,k,j,H,z=0;z<e.length;z+=3)if(j=e[z],H=e[z+1],t<j?(i=0,x=1,k="left"):t<H?(i=t-j,x=i+1):(z==e.length-3||t==H&&e[z+3]>t)&&(x=H-j,i=x-1,t>=H&&(k="right")),i!=null){if(r=e[z+2],j==H&&n==(r.insertLeft?"left":"right")&&(k=n),n=="left"&&i==0)for(;z&&e[z-2]==e[z-3]&&e[z-1].insertLeft;)r=e[(z-=3)+2],k="left";if(n=="right"&&i==H-j)for(;z<e.length-3&&e[z+3]==e[z+4]&&!e[z+5].insertLeft;)r=e[(z+=3)+2],k="right";break}return{node:r,start:i,end:x,collapse:k,coverStart:j,coverEnd:H}}function js(e,t){var n=ro;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var i=e.length-1;i>=0&&!((n=e[i]).left!=n.right);i--);return n}function Ws(e,t,n,r){var i=no(t.map,n,r),x=i.node,k=i.start,j=i.end,H=i.collapse,z;if(x.nodeType==3){for(var $=0;$<4;$++){for(;k&&Ie(t.line.text.charAt(i.coverStart+k));)--k;for(;i.coverStart+j<i.coverEnd&&Ie(t.line.text.charAt(i.coverStart+j));)++j;if(U&&B<9&&k==0&&j==i.coverEnd-i.coverStart?z=x.parentNode.getBoundingClientRect():z=js(p(x,k,j).getClientRects(),r),z.left||z.right||k==0)break;j=k,k=k-1,H="right"}U&&B<11&&(z=Ks(e.display.measure,z))}else{k>0&&(H=r="right");var ne;e.options.lineWrapping&&(ne=x.getClientRects()).length>1?z=ne[r=="right"?ne.length-1:0]:z=x.getBoundingClientRect()}if(U&&B<9&&!k&&(!z||!z.left&&!z.right)){var fe=x.parentNode.getClientRects()[0];fe?z={left:fe.left,right:fe.left+Dn(e.display),top:fe.top,bottom:fe.bottom}:z=ro}for(var ce=z.top-t.rect.top,Ae=z.bottom-t.rect.top,Re=(ce+Ae)/2,Be=t.view.measure.heights,We=0;We<Be.length-1&&!(Re<Be[We]);We++);var $e=We?Be[We-1]:0,Ke=Be[We],et={left:(H=="right"?z.right:z.left)-t.rect.left,right:(H=="left"?z.left:z.right)-t.rect.left,top:$e,bottom:Ke};return!z.left&&!z.right&&(et.bogus=!0),e.options.singleCursorHeightPerLine||(et.rtop=ce,et.rbottom=Ae),et}function Ks(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ft(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function io(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 ao(e){e.display.externalMeasure=null,c(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)io(e.display.view[t])}function ii(e){ao(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return v&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return v&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ma(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=ni(e.widgets[n]));return t}function Ui(e,t,n,r,i){if(!i){var x=ma(t);n.top+=x,n.bottom+=x}if(r=="line")return n;r||(r="local");var k=xr(t);if(r=="local"?k+=Bi(e.display):k-=e.display.viewOffset,r=="page"||r=="window"){var j=e.display.lineSpace.getBoundingClientRect();k+=j.top+(r=="window"?0:so());var H=j.left+(r=="window"?0:oo());n.left+=H,n.right+=H}return n.top+=k,n.bottom+=k,n}function lo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=oo(),i-=so();else if(n=="local"||!n){var x=e.display.sizer.getBoundingClientRect();r+=x.left,i+=x.top}var k=e.display.lineSpace.getBoundingClientRect();return{left:r-k.left,top:i-k.top}}function pa(e,t,n,r,i){return r||(r=nt(e.doc,t.line)),Ui(e,r,to(e,r,t.ch,i),n)}function Ar(e,t,n,r,i,x){r=r||nt(e.doc,t.line),i||(i=Cn(e,r));function k(Ae,Re){var Be=Rr(e,i,Ae,Re?"right":"left",x);return Re?Be.left=Be.right:Be.right=Be.left,Ui(e,r,Be,n)}var j=Xe(r,e.doc.direction),H=t.ch,z=t.sticky;if(H>=r.text.length?(H=r.text.length,z="before"):H<=0&&(H=0,z="after"),!j)return k(z=="before"?H-1:H,z=="before");function $(Ae,Re,Be){var We=j[Re],$e=We.level==1;return k(Be?Ae-1:Ae,$e!=Be)}var ne=Ve(j,H,z),fe=Qe,ce=$(H,ne,z=="before");return fe!=null&&(ce.other=$(H,fe,z!="before")),ce}function uo(e,t){var n=0;t=ft(e.doc,t),e.options.lineWrapping||(n=Dn(e.display)*t.ch);var r=nt(e.doc,t.line),i=xr(r)+Bi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function ga(e,t,n,r,i){var x=Me(e,t,n);return x.xRel=i,r&&(x.outside=r),x}function va(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return ga(r.first,0,null,-1,-1);var i=gr(r,n),x=r.first+r.size-1;if(i>x)return ga(r.first+r.size-1,nt(r,x).text.length,null,1,1);t<0&&(t=0);for(var k=nt(r,i);;){var j=Hs(e,k,i,t,n),H=Tn(k,j.ch+(j.xRel>0||j.outside>0?1:0));if(!H)return j;var z=H.find(1);if(z.line==i)return z;k=nt(r,i=z.line)}}function co(e,t,n,r){r-=ma(t);var i=t.text.length,x=Ze(function(k){return Rr(e,n,k-1).bottom<=r},i,0);return i=Ze(function(k){return Rr(e,n,k).top>r},x,i),{begin:x,end:i}}function fo(e,t,n,r){n||(n=Cn(e,t));var i=Ui(e,t,Rr(e,n,r),"line").top;return co(e,t,n,i)}function ya(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Hs(e,t,n,r,i){i-=xr(t);var x=Cn(e,t),k=ma(t),j=0,H=t.text.length,z=!0,$=Xe(t,e.doc.direction);if($){var ne=(e.options.lineWrapping?zs:Gs)(e,t,n,x,$,r,i);z=ne.level!=1,j=z?ne.from:ne.to-1,H=z?ne.to:ne.from-1}var fe=null,ce=null,Ae=Ze(function(ut){var ot=Rr(e,x,ut);return ot.top+=k,ot.bottom+=k,ya(ot,r,i,!1)?(ot.top<=i&&ot.left<=r&&(fe=ut,ce=ot),!0):!1},j,H),Re,Be,We=!1;if(ce){var $e=r-ce.left<ce.right-r,Ke=$e==z;Ae=fe+(Ke?0:1),Be=Ke?"after":"before",Re=$e?ce.left:ce.right}else{!z&&(Ae==H||Ae==j)&&Ae++,Be=Ae==0?"after":Ae==t.text.length?"before":Rr(e,x,Ae-(z?1:0)).bottom+k<=i==z?"after":"before";var et=Ar(e,Me(n,Ae,Be),"line",t,x);Re=et.left,We=i<et.top?-1:i>=et.bottom?1:0}return Ae=we(t.text,Ae,1),ga(n,Ae,Be,We,r-Re)}function Gs(e,t,n,r,i,x,k){var j=Ze(function(ne){var fe=i[ne],ce=fe.level!=1;return ya(Ar(e,Me(n,ce?fe.to:fe.from,ce?"before":"after"),"line",t,r),x,k,!0)},0,i.length-1),H=i[j];if(j>0){var z=H.level!=1,$=Ar(e,Me(n,z?H.from:H.to,z?"after":"before"),"line",t,r);ya($,x,k,!0)&&$.top>k&&(H=i[j-1])}return H}function zs(e,t,n,r,i,x,k){var j=co(e,t,r,k),H=j.begin,z=j.end;/\s/.test(t.text.charAt(z-1))&&z--;for(var $=null,ne=null,fe=0;fe<i.length;fe++){var ce=i[fe];if(ce.from>=z||ce.to<=H)continue;var Ae=ce.level!=1,Re=Rr(e,r,Ae?Math.min(z,ce.to)-1:Math.max(H,ce.from)).right,Be=Re<x?x-Re+1e9:Re-x;(!$||ne>Be)&&($=ce,ne=Be)}return $||($=i[i.length-1]),$.from<H&&($={from:H,to:$.to,level:$.level}),$.to>z&&($={from:$.from,to:z,level:$.level}),$}var an;function wn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(an==null){an=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)an.appendChild(document.createTextNode("x")),an.appendChild(a("br"));an.appendChild(document.createTextNode("x"))}s(e.measure,an);var n=an.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),c(e.measure),n||1}function Dn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),n=a("pre",[t],"CodeMirror-line-like");s(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ea(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,x=t.gutters.firstChild,k=0;x;x=x.nextSibling,++k){var j=e.display.gutterSpecs[k].className;n[j]=x.offsetLeft+x.clientLeft+i,r[j]=x.clientWidth}return{fixedPos:ba(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ho(e){var t=wn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dn(e.display)-3);return function(i){if(Dr(e.doc,i))return 0;var x=0;if(i.widgets)for(var k=0;k<i.widgets.length;k++)i.widgets[k].height&&(x+=i.widgets[k].height);return n?x+(Math.ceil(i.text.length/r)||1)*t:x+t}}function xa(e){var t=e.doc,n=ho(e);t.iter(function(r){var i=n(r);i!=r.height&&qt(r,i)})}function on(e,t,n,r){var i=e.display;if(!n&&se(t).getAttribute("cm-not-content")=="true")return null;var x,k,j=i.lineSpace.getBoundingClientRect();try{x=t.clientX-j.left,k=t.clientY-j.top}catch(ne){return null}var H=va(e,x,k),z;if(r&&H.xRel>0&&(z=nt(e.doc,H.line).text).length==H.ch){var $=J(z,z.length,e.options.tabSize)-z.length;H=Me(H.line,Math.max(0,Math.round((x-$a(e.display).left)/Dn(e.display))-$))}return H}function sn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function tr(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Jt&&qn(e.doc,t)<i.viewTo&&Gr(e);else if(n<=i.viewFrom)Jt&&Kr(e.doc,n+r)>i.viewFrom?Gr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Gr(e);else if(t<=i.viewFrom){var x=Ni(e,n,n+r,1);x?(i.view=i.view.slice(x.index),i.viewFrom=x.lineN,i.viewTo+=r):Gr(e)}else if(n>=i.viewTo){var k=Ni(e,t,t,-1);k?(i.view=i.view.slice(0,k.index),i.viewTo=k.lineN):Gr(e)}else{var j=Ni(e,t,t,-1),H=Ni(e,n,n+r,1);j&&H?(i.view=i.view.slice(0,j.index).concat(er(e,j.lineN,H.lineN)).concat(i.view.slice(H.index)),i.viewTo+=r):Gr(e)}var z=i.externalMeasured;z&&(n<z.lineN?z.lineN+=r:t<z.lineN+z.size&&(i.externalMeasured=null))}function Hr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var x=r.view[sn(e,t)];if(x.node==null)return;var k=x.changes||(x.changes=[]);re(k,n)==-1&&k.push(n)}function Gr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ni(e,t,n,r){var i=sn(e,t),x,k=e.display.view;if(!Jt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var j=e.display.viewFrom,H=0;H<i;H++)j+=k[H].size;if(j!=t){if(r>0){if(i==k.length-1)return null;x=j+k[i].size-t,i++}else x=j-t;t+=x,n+=x}for(;qn(e.doc,n)!=n;){if(i==(r<0?0:k.length-1))return null;n+=r*k[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Vs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=er(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=er(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(sn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(er(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,sn(e,n)))),r.viewTo=n}function mo(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ai(e){e.display.input.showSelection(e.display.input.prepareSelection())}function po(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),x=r.selection=document.createDocumentFragment(),k=0;k<n.sel.ranges.length;k++){if(!t&&k==n.sel.primIndex)continue;var j=n.sel.ranges[k];if(j.from().line>=e.display.viewTo||j.to().line<e.display.viewFrom)continue;var H=j.empty();(H||e.options.showCursorWhenSelecting)&&go(e,j.head,i),H||Qs(e,j,x)}return r}function go(e,t,n){var r=Ar(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(a("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var x=n.appendChild(a("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));x.style.display="",x.style.left=r.other.left+"px",x.style.top=r.other.top+"px",x.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Fi(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,n){var r=e.display,i=e.doc,x=document.createDocumentFragment(),k=$a(e.display),j=k.left,H=Math.max(r.sizerWidth,nn(e)-r.sizer.offsetLeft)-k.right,z=i.direction=="ltr";function $(Ke,et,ut,ot){et<0&&(et=0),et=Math.round(et),ot=Math.round(ot),x.appendChild(a("div",null,"CodeMirror-selected","position: absolute; left: "+Ke+`px;
|
|
top: `+et+"px; width: "+(ut==null?H-Ke:ut)+`px;
|
|
height: `+(ot-et)+"px"))}function ne(Ke,et,ut){var ot=nt(i,Ke),mt=ot.text.length,Lt,Kt;function It(kt,ir){return pa(e,Me(Ke,kt),"div",ot,ir)}function sr(kt,ir,zt){var Nt=fo(e,ot,null,kt),_t=ir=="ltr"==(zt=="after")?"left":"right",Mt=zt=="after"?Nt.begin:Nt.end-(/\s/.test(ot.text.charAt(Nt.end-1))?2:1);return It(Mt,_t)[_t]}var nr=Xe(ot,i.direction);return qe(nr,et||0,ut==null?mt:ut,function(kt,ir,zt,Nt){var _t=zt=="ltr",Mt=It(kt,_t?"left":"right"),ar=It(ir-1,_t?"right":"left"),jn=et==null&&kt==0,Xr=ut==null&&ir==mt,Yt=Nt==0,Ir=!nr||Nt==nr.length-1;if(ar.top-Mt.top<=3){var Ht=(z?jn:Xr)&&Yt,Va=(z?Xr:jn)&&Ir,jr=Ht?j:(_t?Mt:ar).left,fn=Va?H:(_t?ar:Mt).right;$(jr,Mt.top,fn-jr,Mt.bottom)}else{var hn,Zt,Wn,Qa;_t?(hn=z&&jn&&Yt?j:Mt.left,Zt=z?H:sr(kt,zt,"before"),Wn=z?j:sr(ir,zt,"after"),Qa=z&&Xr&&Ir?H:ar.right):(hn=z?sr(kt,zt,"before"):j,Zt=!z&&jn&&Yt?H:Mt.right,Wn=!z&&Xr&&Ir?j:ar.left,Qa=z?sr(ir,zt,"after"):H),$(hn,Mt.top,Zt-hn,Mt.bottom),Mt.bottom<ar.top&&$(j,Mt.bottom,null,ar.top),$(Wn,ar.top,Qa-Wn,ar.bottom)}(!Lt||Fi(Mt,Lt)<0)&&(Lt=Mt),Fi(ar,Lt)<0&&(Lt=ar),(!Kt||Fi(Mt,Kt)<0)&&(Kt=Mt),Fi(ar,Kt)<0&&(Kt=ar)}),{start:Lt,end:Kt}}var fe=t.from(),ce=t.to();if(fe.line==ce.line)ne(fe.line,fe.ch,ce.ch);else{var Ae=nt(i,fe.line),Re=nt(i,ce.line),Be=ur(Ae)==ur(Re),We=ne(fe.line,fe.ch,Be?Ae.text.length+1:null).end,$e=ne(ce.line,Be?0:null,ce.ch).start;Be&&(We.top<$e.top-2?($(We.right,We.top,null,We.bottom),$(j,$e.top,$e.left,$e.bottom)):$(We.right,We.top,$e.left-We.right,We.bottom)),We.bottom<$e.top&&$(j,We.bottom,null,$e.top)}n.appendChild(x)}function Aa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ln(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Ta(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ln(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ee(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),I&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Aa(e)}function Ln(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ee(e,"blur",e,t),e.state.focused=!1,h(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ji(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],x=e.options.lineWrapping,k=void 0,j=0;if(i.hidden)continue;if(U&&B<8){var H=i.node.offsetTop+i.node.offsetHeight;k=H-n,n=H}else{var z=i.node.getBoundingClientRect();k=z.bottom-z.top,!x&&i.text.firstChild&&(j=i.text.firstChild.getBoundingClientRect().right-z.left-1)}var $=i.line.height-k;if(($>.005||$<-.005)&&(qt(i.line,k),Eo(i.line),i.rest))for(var ne=0;ne<i.rest.length;ne++)Eo(i.rest[ne]);if(j>e.display.sizerWidth){var fe=Math.ceil(j/Dn(e.display));fe>e.display.maxLineLength&&(e.display.maxLineLength=fe,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Eo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Wi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Bi(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,x=gr(t,r),k=gr(t,i);if(n&&n.ensure){var j=n.ensure.from.line,H=n.ensure.to.line;j<x?(x=j,k=gr(t,xr(nt(t,j))+e.wrapper.clientHeight)):Math.min(H,t.lastLine())>=k&&(x=gr(t,xr(nt(t,H))-e.wrapper.clientHeight),k=H)}return{from:x,to:Math.max(k,x+1)}}function Ys(e,t){if(Oe(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!S){var x=a("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Bi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Lr(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(x),x.scrollIntoView(i),e.display.lineSpace.removeChild(x)}}function Js(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?Me(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?Me(t.line,t.ch+1,"before"):t);for(var x=0;x<5;x++){var k=!1,j=Ar(e,t),H=!n||n==t?j:Ar(e,n);i={left:Math.min(j.left,H.left),top:Math.min(j.top,H.top)-r,right:Math.max(j.left,H.left),bottom:Math.max(j.bottom,H.bottom)+r};var z=Sa(e,i),$=e.doc.scrollTop,ne=e.doc.scrollLeft;if(z.scrollTop!=null&&(si(e,z.scrollTop),Math.abs(e.doc.scrollTop-$)>1&&(k=!0)),z.scrollLeft!=null&&(ln(e,z.scrollLeft),Math.abs(e.doc.scrollLeft-ne)>1&&(k=!0)),!k)break}return i}function Xs(e,t){var n=Sa(e,t);n.scrollTop!=null&&si(e,n.scrollTop),n.scrollLeft!=null&&ln(e,n.scrollLeft)}function Sa(e,t){var n=e.display,r=wn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,x=fa(e),k={};t.bottom-t.top>x&&(t.bottom=t.top+x);var j=e.doc.height+ca(n),H=t.top<r,z=t.bottom>j-r;if(t.top<i)k.scrollTop=H?0:t.top;else if(t.bottom>i+x){var $=Math.min(t.top,(z?j:t.bottom)-x);$!=i&&(k.scrollTop=$)}var ne=e.options.fixedGutter?0:n.gutters.offsetWidth,fe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ne,ce=nn(e)-n.gutters.offsetWidth,Ae=t.right-t.left>ce;return Ae&&(t.right=t.left+ce),t.left<10?k.scrollLeft=0:t.left<fe?k.scrollLeft=Math.max(0,t.left+ne-(Ae?0:10)):t.right>ce+fe-3&&(k.scrollLeft=t.right+(Ae?0:10)-ce),k}function Ca(e,t){if(t==null)return;Ki(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Rn(e){Ki(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function oi(e,t,n){(t!=null||n!=null)&&Ki(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Zs(e,t){Ki(e),e.curOp.scrollToPos=t}function Ki(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=uo(e,t.from),r=uo(e,t.to);bo(e,n,r,t.margin)}}function bo(e,t,n,r){var i=Sa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});oi(e,i.scrollLeft,i.scrollTop)}function si(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||Da(e,{top:t}),xo(e,t,!0),D&&Da(e),di(e,100)}function xo(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ln(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function li(e){var t=e.display,n=t.gutters.offsetWidth,r=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?n:0,docHeight:r,scrollHeight:r+Lr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var un=function(e,t,n){this.cm=n;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),ge(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),ge(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,U&&B<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};un.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var x=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+x)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},un.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},un.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},un.prototype.zeroWidthHack=function(){var e=l&&!C?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},un.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),x=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);x!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},un.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ui=function(){};ui.prototype.update=function(){return{bottom:0,right:0}},ui.prototype.setScrollLeft=function(){},ui.prototype.setScrollTop=function(){},ui.prototype.clear=function(){};function In(e,t){t||(t=li(e));var n=e.display.barWidth,r=e.display.barHeight;Ao(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ji(e),Ao(e,li(e)),n=e.display.barWidth,r=e.display.barHeight}function Ao(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var To={native:un,null:ui};function So(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&h(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new To[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ge(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?ln(e,t):si(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function dn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},mr(e.curOp)}function cn(e){var t=e.curOp;t&&Os(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;$s(n)})}function $s(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var i=0;i<t.length;i++)rl(t[i]);for(var x=0;x<t.length;x++)nl(t[x]);for(var k=0;k<t.length;k++)il(t[k])}function el(e){var t=e.cm,n=t.display;ol(t),e.updateMaxLine&&_i(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Hi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&wa(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&ji(t),e.barMeasure=li(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Lr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-nn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ln(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==O();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&In(t,e.barMeasure),e.updatedDisplay&&Ra(t,e.barMeasure),e.selectionChanged&&Aa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&vo(e.cm)}function il(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Co(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ln(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Js(t,ft(r,e.scrollToPos.from),ft(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,i)}var x=e.maybeHiddenMarkers,k=e.maybeUnhiddenMarkers;if(x)for(var j=0;j<x.length;++j)x[j].lines.length||Ee(x[j],"hide");if(k)for(var H=0;H<k.length;++H)k[H].lines.length&&Ee(k[H],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ee(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function or(e,t){if(e.curOp)return t();dn(e);try{return t()}finally{cn(e)}}function jt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);dn(e);try{return t.apply(e,arguments)}finally{cn(e)}}}function Xt(e){return function(){if(this.curOp)return e.apply(this,arguments);dn(this);try{return e.apply(this,arguments)}finally{cn(this)}}}function Wt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);dn(t);try{return e.apply(this,arguments)}finally{cn(t)}}}function di(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=vr(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(x){if(r.line>=e.display.viewFrom){var k=x.styles,j=x.text.length>e.options.maxHighlightLength?wr(t.mode,r.state):null,H=zn(e,x,r,!0);j&&(r.state=j),x.styles=H.styles;var z=x.styleClasses,$=H.classes;$?x.styleClasses=$:z&&(x.styleClasses=null);for(var ne=!k||k.length!=x.styles.length||z!=$&&(!z||!$||z.bgClass!=$.bgClass||z.textClass!=$.textClass),fe=0;!ne&&fe<k.length;++fe)ne=k[fe]!=x.styles[fe];ne&&i.push(r.line),x.stateAfter=r.save(),r.nextLine()}else x.text.length<=e.options.maxHighlightLength&&Vn(e,x.text,r),x.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return di(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&or(e,function(){for(var x=0;x<i.length;x++)Hr(e,i[x],"text")})}var Hi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Wi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=nn(e),this.force=n,this.dims=Ea(e),this.events=[]};Hi.prototype.signal=function(e,t){ie(e,t)&&this.events.push(arguments)},Hi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ee.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Lr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Lr(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=O();if(!t||!b(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&b(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==O())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(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function wa(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Gr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&mo(e)==0)return!1;Do(e)&&(Gr(e),t.dims=Ea(e));var i=r.first+r.size,x=Math.max(t.visible.from-e.options.viewportMargin,r.first),k=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<x&&x-n.viewFrom<20&&(x=Math.max(r.first,n.viewFrom)),n.viewTo>k&&n.viewTo-k<20&&(k=Math.min(i,n.viewTo)),Jt&&(x=qn(e.doc,x),k=Kr(e.doc,k));var j=x!=n.viewFrom||k!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,x,k),n.viewOffset=xr(nt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var H=mo(e);if(!j&&H==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var z=sl(e);return H>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),H>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(z),c(n.cursorDiv),c(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,j&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,di(e,400)),n.updateLineNumbers=null,!0}function Co(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==nn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ca(e.display)-fa(e),n.top)}),t.visible=Wi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Wi(e.display,e.doc,n));if(!wa(e,t))break;ji(e);var i=li(e);ai(e),In(e,i),Ra(e,i),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 Da(e,t){var n=new Hi(e,t);if(wa(e,n)){ji(e),Co(e,n);var r=li(e);ai(e),In(e,r),Ra(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,x=r.lineDiv,k=x.firstChild;function j(Ae){var Re=Ae.nextSibling;return I&&l&&e.display.currentWheelTarget==Ae?Ae.style.display="none":Ae.parentNode.removeChild(Ae),Re}for(var H=r.view,z=r.viewFrom,$=0;$<H.length;$++){var ne=H[$];if(!ne.hidden)if(!ne.node||ne.node.parentNode!=x){var fe=Bs(e,ne,z,n);x.insertBefore(fe,k)}else{for(;k!=ne.node;)k=j(k);var ce=i&&t!=null&&t<=z&&ne.lineNumber;ne.changes&&(re(ne.changes,"gutter")>-1&&(ce=!1),Ya(e,ne,z,n)),ce&&(c(ne.lineNumber),ne.lineNumber.appendChild(document.createTextNode(pn(e.options,z)))),k=ne.node.nextSibling}z+=ne.size}for(;k;)k=j(k)}function La(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(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+Lr(e)+"px"}function wo(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=ba(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,x=r+"px",k=0;k<n.length;k++)if(!n[k].hidden){e.options.fixedGutter&&(n[k].gutter&&(n[k].gutter.style.left=x),n[k].gutterBackground&&(n[k].gutterBackground.style.left=x));var j=n[k].alignable;if(j)for(var H=0;H<j.length;H++)j[H].style.left=x}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=pn(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(a("div",[a("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),x=i.firstChild.offsetWidth,k=i.offsetWidth-x;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(x,r.lineGutter.offsetWidth-k)+1,r.lineNumWidth=r.lineNumInnerWidth+k,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",La(e.display),!0}return!1}function Ia(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var x=e[i],k=null;if(typeof x!="string"&&(k=x.style,x=x.className),x=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:x,style:k})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Lo(e){var t=e.gutters,n=e.gutterSpecs;c(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],x=i.className,k=i.style,j=t.appendChild(a("div",null,"CodeMirror-gutter "+x));k&&(j.style.cssText=k),x=="CodeMirror-linenumbers"&&(e.lineGutter=j,j.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",La(e)}function ci(e){Lo(e.display),tr(e),wo(e)}function dl(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=a("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=a("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=g("div",null,"CodeMirror-code"),i.selectionDiv=a("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=a("div",null,"CodeMirror-cursors"),i.measure=a("div",null,"CodeMirror-measure"),i.lineMeasure=a("div",null,"CodeMirror-measure"),i.lineSpace=g("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var x=g("div",[i.lineSpace],"CodeMirror-lines");i.mover=a("div",[x],null,"position: relative"),i.sizer=a("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=a("div",null,null,"position: absolute; height: "+de+"px; width: 1px;"),i.gutters=a("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=a("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=a("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),U&&B<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!I&&!(D&&o)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Ia(r.gutters,r.lineNumbers),Lo(i),n.init(i)}var Gi=0,dr=null;U?dr=-.53:D?dr=15:v?dr=-.7:L&&(dr=-1/3);function Ro(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=Ro(e);return t.x*=dr,t.y*=dr,t}function Io(e,t){var n=Ro(t),r=n.x,i=n.y,x=e.display,k=x.scroller,j=k.scrollWidth>k.clientWidth,H=k.scrollHeight>k.clientHeight;if(!(r&&j||i&&H))return;if(i&&l&&I){e:for(var z=t.target,$=x.view;z!=k;z=z.parentNode)for(var ne=0;ne<$.length;ne++)if($[ne].node==z){e.display.currentWheelTarget=z;break e}}if(r&&!D&&!T&&dr!=null){i&&H&&si(e,Math.max(0,k.scrollTop+i*dr)),ln(e,Math.max(0,k.scrollLeft+r*dr)),(!i||i&&H)&&Y(t),x.wheelStartX=null;return}if(i&&dr!=null){var fe=i*dr,ce=e.doc.scrollTop,Ae=ce+x.wrapper.clientHeight;fe<0?ce=Math.max(0,ce+fe-50):Ae=Math.min(e.doc.height,Ae+fe+50),Da(e,{top:ce,bottom:Ae})}Gi<20&&(x.wheelStartX==null?(x.wheelStartX=k.scrollLeft,x.wheelStartY=k.scrollTop,x.wheelDX=r,x.wheelDY=i,setTimeout(function(){if(x.wheelStartX==null)return;var Re=k.scrollLeft-x.wheelStartX,Be=k.scrollTop-x.wheelStartY,We=Be&&x.wheelDY&&Be/x.wheelDY||Re&&x.wheelDX&&Re/x.wheelDX;if(x.wheelStartX=x.wheelStartY=null,!We)return;dr=(dr*Gi+We)/(Gi+1),++Gi},200)):(x.wheelDX+=r,x.wheelDY+=i))}var cr=function(e,t){this.ranges=e,this.primIndex=t};cr.prototype.primary=function(){return this.ranges[this.primIndex]},cr.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 n=this.ranges[t],r=e.ranges[t];if(!Gn(n.anchor,r.anchor)||!Gn(n.head,r.head))return!1}return!0},cr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new St(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new cr(e,this.primIndex)},cr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},cr.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(dt(t,r.from())>=0&&dt(e,r.to())<=0)return n}return-1};var St=function(e,t){this.anchor=e,this.head=t};St.prototype.from=function(){return Zr(this.anchor,this.head)},St.prototype.to=function(){return vn(this.anchor,this.head)},St.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Tr(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(fe,ce){return dt(fe.from(),ce.from())}),n=re(t,i);for(var x=1;x<t.length;x++){var k=t[x],j=t[x-1],H=dt(j.to(),k.from());if(r&&!k.empty()?H>0:H>=0){var z=Zr(j.from(),k.from()),$=vn(j.to(),k.to()),ne=j.empty()?k.from()==k.head:j.from()==j.head;x<=n&&--n,t.splice(--x,2,new St(ne?$:z,ne?z:$))}}return new cr(t,n)}function zr(e,t){return new cr([new St(e,t||e)],0)}function Vr(e){return e.text?Me(e.from.line+e.text.length-1,be(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Oo(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return Vr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Vr(t).ch-t.to.ch),Me(n,r)}function Oa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new St(Oo(i.anchor,t),Oo(i.head,t)))}return Tr(e.cm,n,e.sel.primIndex)}function Mo(e,t,n){return e.line==t.line?Me(n.line,e.ch-t.ch+n.ch):Me(n.line+(e.line-t.line),e.ch)}function fl(e,t,n){for(var r=[],i=Me(e.first,0),x=i,k=0;k<t.length;k++){var j=t[k],H=Mo(j.from,i,x),z=Mo(Vr(j),i,x);if(i=j.to,x=z,n=="around"){var $=e.sel.ranges[k],ne=dt($.head,$.anchor)<0;r[k]=new St(ne?z:H,ne?H:z)}else r[k]=new St(H,H)}return new cr(r,e.sel.primIndex)}function Ma(e){e.doc.mode=pr(e.options,e.doc.modeOption),fi(e)}function fi(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,di(e,100),e.state.modeGen++,e.curOp&&tr(e)}function Po(e,t){return t.from.ch==0&&t.to.ch==0&&be(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Pa(e,t,n,r){function i($e){return n?n[$e]:null}function x($e,Ke,et){ua($e,Ke,et,r),Gt($e,"change",$e,t)}function k($e,Ke){for(var et=[],ut=$e;ut<Ke;++ut)et.push(new rn(z[ut],i(ut),r));return et}var j=t.from,H=t.to,z=t.text,$=nt(e,j.line),ne=nt(e,H.line),fe=be(z),ce=i(z.length-1),Ae=H.line-j.line;if(t.full)e.insert(0,k(0,z.length)),e.remove(z.length,e.size-z.length);else if(Po(e,t)){var Re=k(0,z.length-1);x(ne,ne.text,ce),Ae&&e.remove(j.line,Ae),Re.length&&e.insert(j.line,Re)}else if($==ne)if(z.length==1)x($,$.text.slice(0,j.ch)+fe+$.text.slice(H.ch),ce);else{var Be=k(1,z.length-1);Be.push(new rn(fe+$.text.slice(H.ch),ce,r)),x($,$.text.slice(0,j.ch)+z[0],i(0)),e.insert(j.line+1,Be)}else if(z.length==1)x($,$.text.slice(0,j.ch)+z[0]+ne.text.slice(H.ch),i(0)),e.remove(j.line+1,Ae);else{x($,$.text.slice(0,j.ch)+z[0],i(0)),x(ne,fe+ne.text.slice(H.ch),ce);var We=k(1,z.length-1);Ae>1&&e.remove(j.line+1,Ae-1),e.insert(j.line+1,We)}Gt(e,"change",e,t)}function Qr(e,t,n){function r(i,x,k){if(i.linked)for(var j=0;j<i.linked.length;++j){var H=i.linked[j];if(H.doc==x)continue;var z=k&&H.sharedHist;if(n&&!z)continue;t(H.doc,z),r(H.doc,i,z)}}r(e,null,!0)}function ko(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xa(e),Ma(e),_o(e),e.options.lineWrapping||_i(e),e.options.mode=t.modeOption,tr(e)}function _o(e){(e.doc.direction=="rtl"?N:h)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){or(e,function(){_o(e),tr(e)})}function zi(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 n={from:gn(t.from),to:Vr(t),text:Mr(e,t.from,t.to)};return No(e,n,t.from.line,t.to.line+1),Qr(e,function(r){return No(r,n,t.from.line,t.to.line+1)},!0),n}function Bo(e){for(;e.length;){var t=be(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return Bo(e.done),be(e.done);if(e.done.length&&!be(e.done).ranges)return be(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),be(e.done)}function Uo(e,t,n,r){var i=e.history;i.undone.length=0;var x=+new Date,k,j;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>x-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(k=ml(i,i.lastOp==r)))j=be(k.changes),dt(t.from,t.to)==0&&dt(t.from,j.to)==0?j.to=Vr(t):k.changes.push(ka(e,t));else{var H=be(i.done);for((!H||!H.ranges)&&Vi(e.sel,i.done),k={changes:[ka(e,t)],generation:i.generation},i.done.push(k);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=x,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,j||Ee(e,"historyAdded")}function pl(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var i=e.history,x=r&&r.origin;n==i.lastSelOp||x&&i.lastSelOrigin==x&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==x||pl(e,x,be(i.done),t))?i.done[i.done.length-1]=t:Vi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=x,i.lastSelOp=n,r&&r.clearRedo!==!1&&Bo(i.undone)}function Vi(e,t){var n=be(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],x=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(k){k.markedSpans&&((i||(i=t["spans_"+e.id]={}))[x]=k.markedSpans),++x})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(vl(n[i]));return r}function Fo(e,t){var n=yl(e,t),r=bn(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var x=n[i],k=r[i];if(x&&k){e:for(var j=0;j<k.length;++j){for(var H=k[j],z=0;z<x.length;++z)if(x[z].marker==H.marker)continue e;x.push(H)}}else k&&(n[i]=k)}return n}function On(e,t,n){for(var r=[],i=0;i<e.length;++i){var x=e[i];if(x.ranges){r.push(n?cr.prototype.deepCopy.call(x):x);continue}var k=x.changes,j=[];r.push({changes:j});for(var H=0;H<k.length;++H){var z=k[H],$=void 0;if(j.push({from:z.from,to:z.to,text:z.text}),t)for(var ne in z)($=ne.match(/^spans_(\d+)$/))&&(re(t,Number($[1]))>-1&&(be(j)[ne]=z[ne],delete z[ne]))}}return r}function _a(e,t,n,r){if(r){var i=e.anchor;if(n){var x=dt(t,i)<0;x!=dt(n,i)<0?(i=t,t=n):x!=dt(t,n)<0&&(t=n)}return new St(i,t)}else return new St(n||t,t)}function Qi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qt(e,new cr([_a(e.sel.primary(),t,n,i)],0),r)}function jo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),x=0;x<e.sel.ranges.length;x++)r[x]=_a(e.sel.ranges[x],t[x],null,i);var k=Tr(e.cm,r,e.sel.primIndex);Qt(e,k,n)}function Ba(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qt(e,Tr(e.cm,i,e.sel.primIndex),r)}function Wo(e,t,n,r){Qt(e,zr(t,n),r)}function El(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var x=0;x<i.length;x++)this.ranges[x]=new St(ft(e,i[x].anchor),ft(e,i[x].head))},origin:n&&n.origin};return Ee(e,"beforeSelectionChange",e,r),e.cm&&Ee(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Tr(e.cm,r.ranges,r.ranges.length-1):t}function Ko(e,t,n){var r=e.history.done,i=be(r);i&&i.ranges?(r[r.length-1]=t,Yi(e,t,n)):Qt(e,t,n)}function Qt(e,t,n){Yi(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Yi(e,t,n){(ie(e,"beforeSelectionChange")||e.cm&&ie(e.cm,"beforeSelectionChange"))&&(t=El(e,t,n));var r=n&&n.bias||(dt(t.primary().head,e.sel.primary().head)<0?-1:1);Ho(e,zo(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Rn(e.cm)}function Ho(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,le(e.cm)),Gt(e,"cursorActivity",e)}function Go(e){Ho(e,zo(e,e.sel,null,!1))}function zo(e,t,n,r){for(var i,x=0;x<t.ranges.length;x++){var k=t.ranges[x],j=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[x],H=Ji(e,k.anchor,j&&j.anchor,n,r),z=Ji(e,k.head,j&&j.head,n,r);(i||H!=k.anchor||z!=k.head)&&(i||(i=t.ranges.slice(0,x)),i[x]=new St(H,z))}return i?Tr(e.cm,i,t.primIndex):t}function Mn(e,t,n,r,i){var x=nt(e,t.line);if(x.markedSpans)for(var k=0;k<x.markedSpans.length;++k){var j=x.markedSpans[k],H=j.marker,z="selectLeft"in H?!H.selectLeft:H.inclusiveLeft,$="selectRight"in H?!H.selectRight:H.inclusiveRight;if((j.from==null||(z?j.from<=t.ch:j.from<t.ch))&&(j.to==null||($?j.to>=t.ch:j.to>t.ch))){if(i&&(Ee(H,"beforeCursorEnter"),H.explicitlyCleared))if(x.markedSpans){--k;continue}else break;if(!H.atomic)continue;if(n){var ne=H.find(r<0?1:-1),fe=void 0;if((r<0?$:z)&&(ne=Vo(e,ne,-r,ne&&ne.line==t.line?x:null)),ne&&ne.line==t.line&&(fe=dt(ne,n))&&(r<0?fe<0:fe>0))return Mn(e,ne,t,r,i)}var ce=H.find(r<0?-1:1);return(r<0?z:$)&&(ce=Vo(e,ce,r,ce.line==t.line?x:null)),ce?Mn(e,ce,t,r,i):null}}return t}function Ji(e,t,n,r,i){var x=r||1,k=Mn(e,t,n,x,i)||!i&&Mn(e,t,n,x,!0)||Mn(e,t,n,-x,i)||!i&&Mn(e,t,n,-x,!0);return k||(e.cantEdit=!0,Me(e.first,0))}function Vo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ft(e,Me(t.line-1)):null:n>0&&t.ch==(r||nt(e,t.line)).text.length?t.line<e.first+e.size-1?Me(t.line+1,0):null:new Me(t.line,t.ch+n)}function Qo(e){e.setSelection(Me(e.firstLine(),0),Me(e.lastLine()),ve)}function Yo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,x,k,j){i&&(r.from=ft(e,i)),x&&(r.to=ft(e,x)),k&&(r.text=k),j!==void 0&&(r.origin=j)}),Ee(e,"beforeChange",e,r),e.cm&&Ee(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Pn(e,t,n){if(e.cm){if(!e.cm.curOp)return jt(e.cm,Pn)(e,t,n);if(e.cm.state.suppressEdits)return}if((ie(e,"beforeChange")||e.cm&&ie(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var r=Xn&&!n&&Mi(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Jo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Jo(e,t)}function Jo(e,t){if(t.text.length==1&&t.text[0]==""&&dt(t.from,t.to)==0)return;var n=Oa(e,t);Uo(e,t,n,e.cm?e.cm.curOp.id:NaN),hi(e,t,n,bn(e,t));var r=[];Qr(e,function(i,x){!x&&re(r,i.history)==-1&&($o(i.history,t),r.push(i.history)),hi(i,t,null,bn(i,t))})}function Xi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,x,k=e.sel,j=t=="undo"?i.done:i.undone,H=t=="undo"?i.undone:i.done,z=0;z<j.length&&!(x=j[z],n?x.ranges&&!x.equals(e.sel):!x.ranges);z++);if(z==j.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(x=j.pop(),x.ranges){if(Vi(x,H),n&&!x.equals(e.sel)){Qt(e,x,{clearRedo:!1});return}k=x}else if(r){j.push(x);return}else break;var $=[];Vi(k,H),H.push({changes:$,generation:i.generation}),i.generation=x.generation||++i.maxGeneration;for(var ne=ie(e,"beforeChange")||e.cm&&ie(e.cm,"beforeChange"),fe=function(Re){var Be=x.changes[Re];if(Be.origin=t,ne&&!Yo(e,Be,!1))return j.length=0,{};$.push(ka(e,Be));var We=Re?Oa(e,Be):be(j);hi(e,Be,We,Fo(e,Be)),!Re&&e.cm&&e.cm.scrollIntoView({from:Be.from,to:Vr(Be)});var $e=[];Qr(e,function(Ke,et){!et&&re($e,Ke.history)==-1&&($o(Ke.history,Be),$e.push(Ke.history)),hi(Ke,Be,null,Fo(Ke,Be))})},ce=x.changes.length-1;ce>=0;--ce){var Ae=fe(ce);if(Ae)return Ae.v}}function Xo(e,t){if(t==0)return;if(e.first+=t,e.sel=new cr(Ue(e.sel.ranges,function(i){return new St(Me(i.anchor.line+t,i.anchor.ch),Me(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){tr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Hr(e.cm,r,"gutter")}}function hi(e,t,n,r){if(e.cm&&!e.cm.curOp)return jt(e.cm,hi)(e,t,n,r);if(t.to.line<e.first){Xo(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 i=t.text.length-1-(e.first-t.from.line);Xo(e,i),t={from:Me(e.first,0),to:Me(t.to.line+i,t.to.ch),text:[be(t.text)],origin:t.origin}}var x=e.lastLine();t.to.line>x&&(t={from:t.from,to:Me(x,nt(e,x).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Mr(e,t.from,t.to),n||(n=Oa(e,t)),e.cm?bl(e.cm,t,r):Pa(e,t,r),Yi(e,n,ve),e.cantEdit&&Ji(e,Me(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,n){var r=e.doc,i=e.display,x=t.from,k=t.to,j=!1,H=x.line;e.options.lineWrapping||(H=At(ur(nt(r,x.line))),r.iter(H,k.line+1,function(ce){if(ce==i.maxLine)return j=!0,!0})),r.sel.contains(t.from,t.to)>-1&&le(e),Pa(r,t,n,ho(e)),e.options.lineWrapping||(r.iter(H,x.line+t.text.length,function(ce){var Ae=ei(ce);Ae>i.maxLineLength&&(i.maxLine=ce,i.maxLineLength=Ae,i.maxLineChanged=!0,j=!1)}),j&&(e.curOp.updateMaxLine=!0)),aa(r,x.line),di(e,400);var z=t.text.length-(k.line-x.line)-1;t.full?tr(e):x.line==k.line&&t.text.length==1&&!Po(e.doc,t)?Hr(e,x.line,"text"):tr(e,x.line,k.line+1,z);var $=ie(e,"changes"),ne=ie(e,"change");if(ne||$){var fe={from:x,to:k,text:t.text,removed:t.removed,origin:t.origin};ne&&Gt(e,"change",e,fe),$&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(fe)}e.display.selForContextMenu=null}function kn(e,t,n,r,i){var x;r||(r=n),dt(r,n)<0&&(x=[r,n],n=x[0],r=x[1]),typeof t=="string"&&(t=e.splitLines(t)),Pn(e,{from:n,to:r,text:t,origin:i})}function Zo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function qo(e,t,n,r){for(var i=0;i<e.length;++i){var x=e[i],k=!0;if(x.ranges){x.copied||(x=e[i]=x.deepCopy(),x.copied=!0);for(var j=0;j<x.ranges.length;j++)Zo(x.ranges[j].anchor,t,n,r),Zo(x.ranges[j].head,t,n,r);continue}for(var H=0;H<x.changes.length;++H){var z=x.changes[H];if(n<z.from.line)z.from=Me(z.from.line+r,z.from.ch),z.to=Me(z.to.line+r,z.to.ch);else if(t<=z.to.line){k=!1;break}}k||(e.splice(0,i+1),i=0)}}function $o(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;qo(e.done,n,r,i),qo(e.undone,n,r,i)}function mi(e,t,n,r){var i=t,x=t;return typeof t=="number"?x=nt(e,yn(e,t)):i=At(t),i==null?null:(r(x,i)&&e.cm&&Hr(e.cm,i,n),x)}function pi(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}pi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,it(i),Gt(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function gi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var x=Math.min(t,i-e),k=r.height;if(r.removeInner(e,x),this.height-=k-r.height,i==x&&(this.children.splice(n--,1),r.parent=null),(t-=x)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof pi))){var j=[];this.collapse(j),this.children=[new pi(j)],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,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],x=i.chunkSize();if(e<=x){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var k=i.lines.length%25+25,j=k;j<i.lines.length;){var H=new pi(i.lines.slice(j,j+=25));i.height-=H.height,this.children.splice(++r,0,H),H.parent=this}i.lines=i.lines.slice(0,k),this.maybeSpill()}break}e-=x}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new gi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=re(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new gi(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],x=i.chunkSize();if(e<x){var k=Math.min(t,x-e);if(i.iterN(e,k,n))return!0;if((t-=k)==0)break;e=0}else e-=x}}};var vi=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};vi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=At(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var x=ni(this);qt(n,Math.max(0,n.height-x)),e&&(or(e,function(){es(e,n,-x),Hr(e,r,"widget")}),Gt(e,"lineWidgetCleared",e,this,r))},vi.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=ni(this)-t;if(!i)return;Dr(this.doc,r)||qt(r,r.height+i),n&&or(n,function(){n.curOp.forceUpdate=!0,es(n,r,i),Gt(n,"lineWidgetChanged",n,e,At(r))})},oe(vi);function es(e,t,n){xr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ca(e,n)}function xl(e,t,n,r){var i=new vi(e,n,r),x=e.cm;return x&&i.noHScroll&&(x.display.alignWidgets=!0),mi(e,t,"widget",function(k){var j=k.widgets||(k.widgets=[]);if(i.insertAt==null?j.push(i):j.splice(Math.min(j.length-1,Math.max(0,i.insertAt)),0,i),i.line=k,x&&!Dr(e,k)){var H=xr(k)<e.scrollTop;qt(k,k.height+ni(i)),H&&Ca(x,i.height),x.curOp.forceUpdate=!0}return!0}),x&&Gt(x,"lineWidgetAdded",x,i,typeof t=="number"?t:At(t)),i}var ts=0,Yr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};Yr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&dn(e),ie(this,"clear")){var n=this.find();n&&Gt(this,"clear",n.from,n.to)}for(var r=null,i=null,x=0;x<this.lines.length;++x){var k=this.lines[x],j=br(k.markedSpans,this);e&&!this.collapsed?Hr(e,At(k),"text"):e&&(j.to!=null&&(i=At(k)),j.from!=null&&(r=At(k))),k.markedSpans=Zn(k.markedSpans,j),j.from==null&&this.collapsed&&!Dr(this.doc,k)&&e&&qt(k,wn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var H=0;H<this.lines.length;++H){var z=ur(this.lines[H]),$=ei(z);$>e.display.maxLineLength&&(e.display.maxLine=z,e.display.maxLineLength=$,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&tr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Go(e.doc)),e&&Gt(e,"markerCleared",e,this,r,i),t&&cn(e),this.parent&&this.parent.clear()},Yr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var x=this.lines[i],k=br(x.markedSpans,this);if(k.from!=null&&(n=Me(t?x:At(x),k.from),e==-1))return n;if(k.to!=null&&(r=Me(t?x:At(x),k.to),e==1))return r}return n&&{from:n,to:r}},Yr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;or(r,function(){var i=t.line,x=At(t.line),k=ha(r,x);if(k&&(io(k),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Dr(n.doc,i)&&n.height!=null){var j=n.height;n.height=null;var H=ni(n)-j;H&&qt(i,i.height+H)}Gt(r,"markerChanged",r,e)})},Yr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||re(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Yr.prototype.detachLine=function(e){if(this.lines.splice(re(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},oe(Yr);function _n(e,t,n,r,i){if(r&&r.shared)return Al(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return jt(e.cm,_n)(e,t,n,r,i);var x=new Yr(e,i),k=dt(t,n);if(r&&_(r,x,!1),k>0||k==0&&x.clearWhenEmpty!==!1)return x;if(x.replacedWith&&(x.collapsed=!0,x.widgetNode=g("span",[x.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||x.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(x.widgetNode.insertLeft=!0)),x.collapsed){if(Pi(e,t.line,t,n,x)||t.line!=n.line&&Pi(e,n.line,t,n,x))throw new Error("Inserting collapsed marker partially overlapping an existing one");oa()}x.addToHistory&&Uo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var j=t.line,H=e.cm,z;if(e.iter(j,n.line+1,function(ne){H&&x.collapsed&&!H.options.lineWrapping&&ur(ne)==H.display.maxLine&&(z=!0),x.collapsed&&j!=t.line&&qt(ne,0),sa(ne,new $r(x,j==t.line?t.ch:null,j==n.line?n.ch:null)),++j}),x.collapsed&&e.iter(t.line,n.line+1,function(ne){Dr(e,ne)&&qt(ne,0)}),x.clearOnEnter&&ge(x,"beforeCursorEnter",function(){return x.clear()}),x.readOnly&&(Wr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),x.collapsed&&(x.id=++ts,x.atomic=!0),H){if(z&&(H.curOp.updateMaxLine=!0),x.collapsed)tr(H,t.line,n.line+1);else if(x.className||x.startStyle||x.endStyle||x.css||x.attributes||x.title)for(var $=t.line;$<=n.line;$++)Hr(H,$,"text");x.atomic&&Go(H.doc),Gt(H,"markerAdded",H,x)}return x}var yi=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};yi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Gt(this,"clear")},yi.prototype.find=function(e,t){return this.primary.find(e,t)},oe(yi);function Al(e,t,n,r,i){r=_(r),r.shared=!1;var x=[_n(e,t,n,r,i)],k=x[0],j=r.widgetNode;return Qr(e,function(H){j&&(r.widgetNode=j.cloneNode(!0)),x.push(_n(H,ft(H,t),ft(H,n),r,i));for(var z=0;z<H.linked.length;++z)if(H.linked[z].isParent)return;k=be(x)}),new yi(x,k)}function rs(e){return e.findMarks(Me(e.first,0),e.clipPos(Me(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),x=e.clipPos(i.from),k=e.clipPos(i.to);if(dt(x,k)){var j=_n(e,x,k,r.primary,r.primary.type);r.markers.push(j),j.parent=r}}}function Sl(e){for(var t=function(r){var i=e[r],x=[i.primary.doc];Qr(i.primary.doc,function(H){return x.push(H)});for(var k=0;k<i.markers.length;k++){var j=i.markers[k];re(x,j.doc)==-1&&(j.parent=null,i.markers.splice(k--,1))}},n=0;n<e.length;n++)t(n)}var Cl=0,rr=function(e,t,n,r,i){if(!(this instanceof rr))return new rr(e,t,n,r,i);n==null&&(n=0),gi.call(this,[new pi([new rn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var x=Me(n,0);this.sel=zr(x),this.history=new zi(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Pa(this,{from:x,to:x,text:e}),Qt(this,zr(x),ve)};rr.prototype=Je(gi.prototype,{constructor:rr,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=mn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Wt(function(e){var t=Me(this.first,0),n=this.first+this.size-1;Pn(this,{from:t,to:Me(n,nt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&oi(this.cm,0,0),Qt(this,zr(t),ve)}),replaceRange:function(e,t,n,r){t=ft(this,t),n=n?ft(this,n):t,kn(this,e,t,n,r)},getRange:function(e,t,n){var r=Mr(this,ft(this,e),ft(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Pr(this,e))return nt(this,e)},getLineNumber:function(e){return At(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=nt(this,e)),ur(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ft(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Wt(function(e,t,n){Wo(this,ft(this,typeof e=="number"?Me(e,t||0):e),null,n)}),setSelection:Wt(function(e,t,n){Wo(this,ft(this,e),ft(this,t||e),n)}),extendSelection:Wt(function(e,t,n){Qi(this,ft(this,e),t&&ft(this,t),n)}),extendSelections:Wt(function(e,t){jo(this,_e(this,e),t)}),extendSelectionsBy:Wt(function(e,t){var n=Ue(this.sel.ranges,e);jo(this,_e(this,n),t)}),setSelections:Wt(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new St(ft(this,e[i].anchor),ft(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Qt(this,Tr(this.cm,r,t),n)}),addSelection:Wt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new St(ft(this,e),ft(this,t||e))),Qt(this,Tr(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Mr(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Mr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Wt(function(e,t,n){for(var r=[],i=this.sel,x=0;x<i.ranges.length;x++){var k=i.ranges[x];r[x]={from:k.from(),to:k.to(),text:this.splitLines(e[x]),origin:n}}for(var j=t&&t!="end"&&fl(this,r,t),H=r.length-1;H>=0;H--)Pn(this,r[H]);j?Ko(this,j):this.cm&&Rn(this.cm)}),undo:Wt(function(){Xi(this,"undo")}),redo:Wt(function(){Xi(this,"redo")}),undoSelection:Wt(function(){Xi(this,"undo",!0)}),redoSelection:Wt(function(){Xi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new zi(this.history.maxGeneration),Qr(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:On(this.history.done),undone:On(this.history.undone)}},setHistory:function(e){var t=this.history=new zi(this.history.maxGeneration);t.done=On(e.done.slice(0),null,!0),t.undone=On(e.undone.slice(0),null,!0)},setGutterMarker:Wt(function(e,t,n){return mi(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&ze(i)&&(r.gutterMarkers=null),!0})}),clearGutter:Wt(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&mi(t,n,"gutter",function(){return n.gutterMarkers[e]=null,ze(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Pr(this,e))return null;if(t=e,e=nt(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:Wt(function(e,t,n){return mi(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(y(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:Wt(function(e,t,n){return mi(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",x=r[i];if(x)if(n==null)r[i]=null;else{var k=x.match(y(n));if(!k)return!1;var j=k.index+k[0].length;r[i]=x.slice(0,k.index)+(!k.index||j==x.length?"":" ")+x.slice(j)||null}else return!1;return!0})}),addLineWidget:Wt(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return _n(this,ft(this,e),ft(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ft(this,e),_n(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ft(this,e);var t=[],n=nt(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ft(this,e),t=ft(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(x){var k=x.markedSpans;if(k)for(var j=0;j<k.length;j++){var H=k[j];!(H.to!=null&&i==e.line&&e.ch>=H.to||H.from==null&&i!=e.line||H.from!=null&&i==t.line&&H.from>=t.ch)&&(!n||n(H.marker))&&r.push(H.marker.parent||H.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var x=i.text.length+r;if(x>e)return t=e,!0;e-=x,++n}),ft(this,Me(n,t))},indexFromPos:function(e){e=ft(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new rr(mn(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,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new rr(mn(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,rs(this)),r},unlinkDoc:function(e){if(e instanceof Rt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(rs(this));break}if(e.history==this.history){var r=[e.id];Qr(e,function(i){return r.push(i.id)},!0),e.history=new zi(null),e.history.done=On(this.history.done,r),e.history.undone=On(this.history.undone,r)}},iterLinkedDocs:function(e){Qr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ht(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Wt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),rr.prototype.eachLine=rr.prototype.iter;var ns=0;function wl(e){var t=this;if(is(t),Oe(t,e)||Nr(t.display,e))return;Y(e),U&&(ns=+new Date);var n=on(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,x=Array(i),k=0,j=function(){++k==i&&jt(t,function(){n=ft(t.doc,n);var ce={from:n,to:n,text:t.doc.splitLines(x.filter(function(Ae){return Ae!=null}).join(t.doc.lineSeparator())),origin:"paste"};Pn(t.doc,ce),Ko(t.doc,zr(ft(t.doc,n),ft(t.doc,Vr(ce))))})()},H=function(ce,Ae){if(t.options.allowDropFileTypes&&re(t.options.allowDropFileTypes,ce.type)==-1){j();return}var Re=new FileReader;Re.onerror=function(){return j()},Re.onload=function(){var Be=Re.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Be)){j();return}x[Ae]=Be,j()},Re.readAsText(ce)},z=0;z<r.length;z++)H(r[z],z);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var $=e.dataTransfer.getData("Text");if($){var ne;if(t.state.draggingText&&!t.state.draggingText.copy&&(ne=t.listSelections()),Yi(t.doc,zr(n,n)),ne)for(var fe=0;fe<ne.length;++fe)kn(t.doc,"",ne[fe].anchor,ne[fe].head,"drag");t.replaceSelection($,"around","paste"),t.display.input.focus()}}catch(ce){}}}function Dl(e,t){if(U&&(!e.state.draggingText||+new Date-ns<100)){te(t);return}if(Oe(e,t)||Nr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!L){var n=a("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),T&&n.parentNode.removeChild(n)}}function Ll(e,t){var n=on(e,t);if(!n)return;var r=document.createDocumentFragment();go(e,n,r),e.display.dragCursor||(e.display.dragCursor=a("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,r)}function is(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function as(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var x=0;x<n.length;x++)e(n[x])})}var os=!1;function Rl(){if(os)return;Il(),os=!0}function Il(){var e;ge(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Ol)},100))}),ge(window,"blur",function(){return as(Ln)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Jr={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"},Ei=0;Ei<10;Ei++)Jr[Ei+48]=Jr[Ei+96]=String(Ei);for(var Zi=65;Zi<=90;Zi++)Jr[Zi]=String.fromCharCode(Zi);for(var bi=1;bi<=12;bi++)Jr[bi+111]=Jr[bi+63235]="F"+bi;var Fr={};Fr.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"},Fr.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"},Fr.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"},Fr.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"]},Fr.default=l?Fr.macDefault:Fr.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,x,k=0;k<t.length-1;k++){var j=t[k];if(/^(cmd|meta|m)$/i.test(j))x=!0;else if(/^a(lt)?$/i.test(j))n=!0;else if(/^(c|ctrl|control)$/i.test(j))r=!0;else if(/^s(hift)?$/i.test(j))i=!0;else throw new Error("Unrecognized modifier name: "+j)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),x&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Pl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=Ue(n.split(" "),Ml),x=0;x<i.length;x++){var k=void 0,j=void 0;x==i.length-1?(j=i.join(" "),k=r):(j=i.slice(0,x+1).join(" "),k="...");var H=t[j];if(!H)t[j]=k;else if(H!=k)throw new Error("Inconsistent bindings for "+j)}delete e[n]}for(var z in t)e[z]=t[z];return e}function Bn(e,t,n,r){t=qi(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Bn(e,t.fallthrough,n,r);for(var x=0;x<t.fallthrough.length;x++){var k=Bn(e,t.fallthrough[x],n,r);if(k)return k}}}function ss(e){var t=typeof e=="string"?e:Jr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(m?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(m?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(T&&e.keyCode==34&&e.char)return!1;var n=Jr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),ls(n,e,t))}function qi(e){return typeof e=="string"?Fr[e]:e}function Un(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var x=t(n[i]);r.length&&dt(x.from,be(r).to)<=0;){var k=r.pop();if(dt(k.from,x.from)<0){x.from=k.from;break}}r.push(x)}or(e,function(){for(var j=r.length-1;j>=0;j--)kn(e.doc,"",r[j].from,r[j].to,"+delete");Rn(e)})}function Ua(e,t,n){var r=we(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Na(e,t,n){var r=Ua(e,t.ch,n);return r==null?null:new Me(t.line,r,n<0?"after":"before")}function Fa(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var x=Xe(n,t.doc.direction);if(x){var k=i<0?be(x):x[0],j=i<0==(k.level==1),H=j?"after":"before",z;if(k.level>0||t.doc.direction=="rtl"){var $=Cn(t,n);z=i<0?n.text.length-1:0;var ne=Rr(t,$,z).top;z=Ze(function(fe){return Rr(t,$,fe).top==ne},i<0==(k.level==1)?k.from:k.to-1,z),H=="before"&&(z=Ua(n,z,1))}else z=i<0?k.to:k.from;return new Me(r,z,H)}}return new Me(r,i<0?n.text.length:0,i<0?"before":"after")}function kl(e,t,n,r){var i=Xe(t,e.doc.direction);if(!i)return Na(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var x=Ve(i,n.ch,n.sticky),k=i[x];if(e.doc.direction=="ltr"&&k.level%2==0&&(r>0?k.to>n.ch:k.from<n.ch))return Na(t,n,r);var j=function(We,$e){return Ua(t,We instanceof Me?We.ch:We,$e)},H,z=function(We){return e.options.lineWrapping?(H=H||Cn(e,t),fo(e,t,H,We)):{begin:0,end:t.text.length}},$=z(n.sticky=="before"?j(n,-1):n.ch);if(e.doc.direction=="rtl"||k.level==1){var ne=k.level==1==r<0,fe=j(n,ne?1:-1);if(fe!=null&&(ne?fe<=k.to&&fe<=$.end:fe>=k.from&&fe>=$.begin)){var ce=ne?"before":"after";return new Me(n.line,fe,ce)}}var Ae=function(We,$e,Ke){for(var et=function(Lt,Kt){return Kt?new Me(n.line,j(Lt,1),"before"):new Me(n.line,Lt,"after")};We>=0&&We<i.length;We+=$e){var ut=i[We],ot=$e>0==(ut.level!=1),mt=ot?Ke.begin:j(Ke.end,-1);if(ut.from<=mt&&mt<ut.to)return et(mt,ot);if(mt=ot?ut.from:j(ut.to,-1),Ke.begin<=mt&&mt<Ke.end)return et(mt,ot)}},Re=Ae(x+r,r,$);if(Re)return Re;var Be=r>0?$.end:j($.begin,-1);return Be!=null&&!(r>0&&Be==t.text.length)&&(Re=Ae(r>0?0:i.length-1,r,z(Be)),Re)?Re:null}var xi={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return Un(e,function(t){if(t.empty()){var n=nt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Me(t.head.line+1,0)}:{from:t.head,to:Me(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Un(e,function(t){return{from:Me(t.from().line,0),to:ft(e.doc,Me(t.to().line+1,0))}})},delLineLeft:function(e){return Un(e,function(t){return{from:Me(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Un(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Un(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Me(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Me(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return cs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return _l(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},he)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},he)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?cs(e,t.head):r},he)},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=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var x=n[i].from(),k=J(e.getLine(x.line),x.ch,r);t.push(ue(r-k%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return or(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,x=nt(e.doc,i.line).text;if(x){if(i.ch==x.length&&(i=new Me(i.line,i.ch-1)),i.ch>0)i=new Me(i.line,i.ch+1),e.replaceRange(x.charAt(i.ch-1)+x.charAt(i.ch-2),Me(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var k=nt(e.doc,i.line-1).text;k&&(i=new Me(i.line,1),e.replaceRange(x.charAt(0)+e.doc.lineSeparator()+k.charAt(k.length-1),Me(i.line-1,k.length-1),i,"+transpose"))}}n.push(new St(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return or(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Rn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var n=nt(e.doc,t),r=ur(n);return r!=n&&(t=At(r)),Fa(!0,e,r,t,1)}function _l(e,t){var n=nt(e.doc,t),r=ki(n);return r!=n&&(t=At(r)),Fa(!0,e,n,t,-1)}function cs(e,t){var n=ds(e,t.line),r=nt(e.doc,n.line),i=Xe(r,e.doc.direction);if(!i||i[0].level==0){var x=Math.max(n.ch,r.text.search(/\S/)),k=t.line==n.line&&t.ch<=x&&t.ch;return Me(n.line,k?0:x,n.sticky)}return n}function $i(e,t,n){if(typeof t=="string"&&(t=xi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Te}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Bl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Bn(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Bn(t,e.options.extraKeys,n,e)||Bn(t,e.options.keyMap,n,e)}var Ul=new ee;function Ai(e,t,n,r){var i=e.state.keySeq;if(i){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),fs(e,i+" "+t,n,r))return!0}return fs(e,t,n,r)}function fs(e,t,n,r){var i=Bl(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Gt(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Y(n),Aa(e)),!!i}function hs(e,t){var n=us(t,!0);return n?t.shiftKey&&!e.state.keySeq?Ai(e,"Shift-"+n,t,function(r){return $i(e,r,!0)})||Ai(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return $i(e,r)}):Ai(e,n,t,function(r){return $i(e,r)}):!1}function Nl(e,t,n){return Ai(e,"'"+n+"'",t,function(r){return $i(e,r,!0)})}var ja=null;function ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=O(),Oe(t,e))return;U&&B<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=hs(t,e);T&&(ja=r?n:null,!r&&n==88&&!Ct&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!l&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;N(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(h(t,"CodeMirror-crosshair"),je(document,"keyup",n),je(document,"mouseover",n))}ge(document,"keyup",n),ge(document,"mouseover",n)}function ps(e){e.keyCode==16&&(this.doc.sel.shift=!1),Oe(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Nr(t.display,e)||Oe(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(T&&n==ja){ja=null,Y(e);return}if(T&&(!e.which||e.which<10)&&hs(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Nl(t,e,i))return;t.display.input.onKeyPress(e)}var jl=400,Wa=function(e,t,n){this.time=e,this.pos=t,this.button=n};Wa.prototype.compare=function(e,t,n){return this.time+jl>e&&dt(t,this.pos)==0&&n==this.button};var Ti,Si;function Wl(e,t){var n=+new Date;return Si&&Si.compare(n,e,t)?(Ti=Si=null,"triple"):Ti&&Ti.compare(n,e,t)?(Si=new Wa(n,e,t),Ti=null,"double"):(Ti=new Wa(n,e,t),Si=null,"single")}function vs(e){var t=this,n=t.display;if(Oe(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Nr(n,e)){I||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Ka(t,e))return;var r=on(t,e),i=ye(e),x=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Kl(t,i,r,x,e))return;i==1?r?Gl(t,r,x,e):se(e)==n.scroller&&Y(e):i==2?(r&&Qi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):yo(t))}function Kl(e,t,n,r,i){var x="Click";return r=="double"?x="Double"+x:r=="triple"&&(x="Triple"+x),x=(t==1?"Left":t==2?"Middle":"Right")+x,Ai(e,ls(x,i),i,function(k){if(typeof k=="string"&&(k=xi[k]),!k)return!1;var j=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),j=k(e,n)!=Te}finally{e.state.suppressEdits=!1}return j})}function Hl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var x=d?n.shiftKey&&n.metaKey:n.altKey;i.unit=x?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=l?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(l?n.altKey:n.ctrlKey)),i}function Gl(e,t,n,r){U?setTimeout(F(vo,e),0):e.curOp.focus=O();var i=Hl(e,n,r),x=e.doc.sel,k;e.options.dragDrop&&Ce&&!e.isReadOnly()&&n=="single"&&(k=x.contains(t))>-1&&(dt((k=x.ranges[k]).from(),t)<0||t.xRel>0)&&(dt(k.to(),t)>0||t.xRel<0)?zl(e,r,t,i):Vl(e,r,t,i)}function zl(e,t,n,r){var i=e.display,x=!1,k=jt(e,function(z){I&&(i.scroller.draggable=!1),e.state.draggingText=!1,je(i.wrapper.ownerDocument,"mouseup",k),je(i.wrapper.ownerDocument,"mousemove",j),je(i.scroller,"dragstart",H),je(i.scroller,"drop",k),x||(Y(z),r.addNew||Qi(e.doc,n,null,null,r.extend),I&&!L||U&&B==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),j=function(z){x=x||Math.abs(t.clientX-z.clientX)+Math.abs(t.clientY-z.clientY)>=10},H=function(){return x=!0};I&&(i.scroller.draggable=!0),e.state.draggingText=k,k.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ge(i.wrapper.ownerDocument,"mouseup",k),ge(i.wrapper.ownerDocument,"mousemove",j),ge(i.scroller,"dragstart",H),ge(i.scroller,"drop",k),yo(e),setTimeout(function(){return i.input.focus()},20)}function ys(e,t,n){if(n=="char")return new St(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new St(Me(t.line,0),ft(e.doc,Me(t.line+1,0)));var r=n(e,t);return new St(r.from,r.to)}function Vl(e,t,n,r){var i=e.display,x=e.doc;Y(t);var k,j,H=x.sel,z=H.ranges;if(r.addNew&&!r.extend?(j=x.sel.contains(n),j>-1?k=z[j]:k=new St(n,n)):(k=x.sel.primary(),j=x.sel.primIndex),r.unit=="rectangle")r.addNew||(k=new St(n,n)),n=on(e,t,!0,!0),j=-1;else{var $=ys(e,n,r.unit);r.extend?k=_a(k,$.anchor,$.head,r.extend):k=$}r.addNew?j==-1?(j=z.length,Qt(x,Tr(e,z.concat([k]),j),{scroll:!1,origin:"*mouse"})):z.length>1&&z[j].empty()&&r.unit=="char"&&!r.extend?(Qt(x,Tr(e,z.slice(0,j).concat(z.slice(j+1)),0),{scroll:!1,origin:"*mouse"}),H=x.sel):Ba(x,j,k,pe):(j=0,Qt(x,new cr([k],0),pe),H=x.sel);var ne=n;function fe(Ke){if(dt(ne,Ke)==0)return;if(ne=Ke,r.unit=="rectangle"){for(var et=[],ut=e.options.tabSize,ot=J(nt(x,n.line).text,n.ch,ut),mt=J(nt(x,Ke.line).text,Ke.ch,ut),Lt=Math.min(ot,mt),Kt=Math.max(ot,mt),It=Math.min(n.line,Ke.line),sr=Math.min(e.lastLine(),Math.max(n.line,Ke.line));It<=sr;It++){var nr=nt(x,It).text,kt=me(nr,Lt,ut);Lt==Kt?et.push(new St(Me(It,kt),Me(It,kt))):nr.length>kt&&et.push(new St(Me(It,kt),Me(It,me(nr,Kt,ut))))}et.length||et.push(new St(n,n)),Qt(x,Tr(e,H.ranges.slice(0,j).concat(et),j),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ke)}else{var ir=k,zt=ys(e,Ke,r.unit),Nt=ir.anchor,_t;dt(zt.anchor,Nt)>0?(_t=zt.head,Nt=Zr(ir.from(),zt.anchor)):(_t=zt.anchor,Nt=vn(ir.to(),zt.head));var Mt=H.ranges.slice(0);Mt[j]=Ql(e,new St(ft(x,Nt),_t)),Qt(x,Tr(e,Mt,j),pe)}}var ce=i.wrapper.getBoundingClientRect(),Ae=0;function Re(Ke){var et=++Ae,ut=on(e,Ke,!0,r.unit=="rectangle");if(!ut)return;if(dt(ut,ne)!=0){e.curOp.focus=O(),fe(ut);var ot=Wi(i,x);(ut.line>=ot.to||ut.line<ot.from)&&setTimeout(jt(e,function(){Ae==et&&Re(Ke)}),150)}else{var mt=Ke.clientY<ce.top?-20:Ke.clientY>ce.bottom?20:0;mt&&setTimeout(jt(e,function(){if(Ae!=et)return;i.scroller.scrollTop+=mt,Re(Ke)}),50)}}function Be(Ke){e.state.selectingText=!1,Ae=Infinity,Ke&&(Y(Ke),i.input.focus()),je(i.wrapper.ownerDocument,"mousemove",We),je(i.wrapper.ownerDocument,"mouseup",$e),x.history.lastSelOrigin=null}var We=jt(e,function(Ke){Ke.buttons===0||!ye(Ke)?Be(Ke):Re(Ke)}),$e=jt(e,Be);e.state.selectingText=$e,ge(i.wrapper.ownerDocument,"mousemove",We),ge(i.wrapper.ownerDocument,"mouseup",$e)}function Ql(e,t){var n=t.anchor,r=t.head,i=nt(e.doc,n.line);if(dt(n,r)==0&&n.sticky==r.sticky)return t;var x=Xe(i);if(!x)return t;var k=Ve(x,n.ch,n.sticky),j=x[k];if(j.from!=n.ch&&j.to!=n.ch)return t;var H=k+(j.from==n.ch==(j.level!=1)?0:1);if(H==0||H==x.length)return t;var z;if(r.line!=n.line)z=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var $=Ve(x,r.ch,r.sticky),ne=$-k||(r.ch-n.ch)*(j.level==1?-1:1);$==H-1||$==H?z=ne<0:z=ne>0}var fe=x[H+(z?-1:0)],ce=z==(fe.level==1),Ae=ce?fe.from:fe.to,Re=ce?"after":"before";return n.ch==Ae&&n.sticky==Re?t:new St(new Me(n.line,Ae,Re),r)}function Es(e,t,n,r){var i,x;if(t.touches)i=t.touches[0].clientX,x=t.touches[0].clientY;else try{i=t.clientX,x=t.clientY}catch(fe){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Y(t);var k=e.display,j=k.lineDiv.getBoundingClientRect();if(x>j.bottom||!ie(e,n))return Z(t);x-=j.top-k.viewOffset;for(var H=0;H<e.display.gutterSpecs.length;++H){var z=k.gutters.childNodes[H];if(z&&z.getBoundingClientRect().right>=i){var $=gr(e.doc,x),ne=e.display.gutterSpecs[H];return Ee(e,n,e,$,ne.className,t),Z(t)}}}function Ka(e,t){return Es(e,t,"gutterClick",!0)}function bs(e,t){if(Nr(e.display,t)||Yl(e,t))return;if(Oe(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Yl(e,t){return ie(e,"gutterContextMenu")?Es(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ii(e)}var Nn={toString:function(){return"CodeMirror.Init"}},As={},ea={};function Jl(e){var t=e.optionHandlers;function n(r,i,x,k){e.defaults[r]=i,x&&(t[r]=k?function(j,H,z){z!=Nn&&x(j,H,z)}:x)}e.defineOption=n,e.Init=Nn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ma(r)},!0),n("indentUnit",2,Ma,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){fi(r),ii(r),tr(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var x=[],k=r.doc.first;r.doc.iter(function(H){for(var z=0;;){var $=H.text.indexOf(i,z);if($==-1)break;z=$+i.length,x.push(Me(k,$))}k++});for(var j=x.length-1;j>=0;j--)kn(r.doc,i,x[j],Me(x[j].line,x[j].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,x){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),x!=Nn&&r.refresh()}),n("specialCharPlaceholder",Dt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!A),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){xs(r),ci(r)},!0),n("keyMap","default",function(r,i,x){var k=qi(i),j=x!=Nn&&qi(x);j&&j.detach&&j.detach(r,k),k.attach&&k.attach(r,j||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Ia(i,r.options.lineNumbers),ci(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?ba(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return In(r)},!0),n("scrollbarStyle","native",function(r){So(r),In(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Ia(r.options.gutters,i),ci(r)},!0),n("firstLineNumber",1,ci,!0),n("lineNumberFormatter",function(r){return r},ci,!0),n("showCursorWhenSelecting",!1,ai,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ln(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Xl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ai,!0),n("singleCursorHeightPerLine",!0,ai,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,fi,!0),n("addModeClass",!1,fi,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,fi,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Xl(e,t,n){var r=n&&n!=Nn;if(!t!=!r){var i=e.display.dragFunctions,x=t?ge:je;x(e.display.scroller,"dragstart",i.start),x(e.display.scroller,"dragenter",i.enter),x(e.display.scroller,"dragover",i.over),x(e.display.scroller,"dragleave",i.leave),x(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(h(e.display.wrapper,"CodeMirror-wrap"),_i(e)),xa(e),tr(e),ii(e),setTimeout(function(){return In(e)},100)}function Rt(e,t){var n=this;if(!(this instanceof Rt))return new Rt(e,t);this.options=t=t?_(t):{},_(As,t,!1);var r=t.value;typeof r=="string"?r=new rr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Rt.inputStyles[t.inputStyle](this),x=this.display=new dl(e,r,i,t);x.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),So(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 ee,keySeq:null,specialChars:null},t.autofocus&&!o&&x.input.focus(),U&&B<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Rl(),dn(this),this.curOp.forceUpdate=!0,ko(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Ln(this);for(var k in ea)ea.hasOwnProperty(k)&&ea[k](this,t[k],Nn);Do(this),t.finishInit&&t.finishInit(this);for(var j=0;j<Ha.length;++j)Ha[j](this);cn(this),I&&t.lineWrapping&&getComputedStyle(x.lineDiv).textRendering=="optimizelegibility"&&(x.lineDiv.style.textRendering="auto")}Rt.defaults=As,Rt.optionHandlers=ea;function ql(e){var t=e.display;ge(t.scroller,"mousedown",jt(e,vs)),U&&B<11?ge(t.scroller,"dblclick",jt(e,function(H){if(Oe(e,H))return;var z=on(e,H);if(!z||Ka(e,H)||Nr(e.display,H))return;Y(H);var $=e.findWordAt(z);Qi(e.doc,$.anchor,$.head)})):ge(t.scroller,"dblclick",function(H){return Oe(e,H)||Y(H)}),ge(t.scroller,"contextmenu",function(H){return bs(e,H)}),ge(t.input.getField(),"contextmenu",function(H){t.scroller.contains(H.target)||bs(e,H)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function x(H){if(H.touches.length!=1)return!1;var z=H.touches[0];return z.radiusX<=1&&z.radiusY<=1}function k(H,z){if(z.left==null)return!0;var $=z.left-H.left,ne=z.top-H.top;return $*$+ne*ne>20*20}ge(t.scroller,"touchstart",function(H){if(!Oe(e,H)&&!x(H)&&!Ka(e,H)){t.input.ensurePolled(),clearTimeout(n);var z=+new Date;t.activeTouch={start:z,moved:!1,prev:z-r.end<=300?r:null},H.touches.length==1&&(t.activeTouch.left=H.touches[0].pageX,t.activeTouch.top=H.touches[0].pageY)}}),ge(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ge(t.scroller,"touchend",function(H){var z=t.activeTouch;if(z&&!Nr(t,H)&&z.left!=null&&!z.moved&&new Date-z.start<300){var $=e.coordsChar(t.activeTouch,"page"),ne;!z.prev||k(z,z.prev)?ne=new St($,$):!z.prev.prev||k(z,z.prev.prev)?ne=e.findWordAt($):ne=new St(Me($.line,0),ft(e.doc,Me($.line+1,0))),e.setSelection(ne.anchor,ne.head),e.focus(),Y(H)}i()}),ge(t.scroller,"touchcancel",i),ge(t.scroller,"scroll",function(){t.scroller.clientHeight&&(si(e,t.scroller.scrollTop),ln(e,t.scroller.scrollLeft,!0),Ee(e,"scroll",e))}),ge(t.scroller,"mousewheel",function(H){return Io(e,H)}),ge(t.scroller,"DOMMouseScroll",function(H){return Io(e,H)}),ge(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(H){Oe(e,H)||te(H)},over:function(H){Oe(e,H)||(Ll(e,H),te(H))},start:function(H){return Dl(e,H)},drop:jt(e,wl),leave:function(H){Oe(e,H)||is(e)}};var j=t.input.getField();ge(j,"keyup",function(H){return ps.call(e,H)}),ge(j,"keydown",jt(e,ms)),ge(j,"keypress",jt(e,gs)),ge(j,"focus",function(H){return Ta(e,H)}),ge(j,"blur",function(H){return Ln(e,H)})}var Ha=[];Rt.defineInitHook=function(e){return Ha.push(e)};function Ci(e,t,n,r){var i=e.doc,x;n==null&&(n="add"),n=="smart"&&(i.mode.indent?x=vr(e,t).state:n="prev");var k=e.options.tabSize,j=nt(i,t),H=J(j.text,null,k);j.stateAfter&&(j.stateAfter=null);var z=j.text.match(/^\s*/)[0],$;if(!r&&!/\S/.test(j.text))$=0,n="not";else if(n=="smart"&&($=i.mode.indent(x,j.text.slice(z.length),j.text),$==Te||$>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?$=J(nt(i,t-1).text,null,k):$=0:n=="add"?$=H+e.options.indentUnit:n=="subtract"?$=H-e.options.indentUnit:typeof n=="number"&&($=H+n),$=Math.max(0,$);var ne="",fe=0;if(e.options.indentWithTabs)for(var ce=Math.floor($/k);ce;--ce)fe+=k,ne+=" ";if(fe<$&&(ne+=ue($-fe)),ne!=z)return kn(i,ne,Me(t,0),Me(t,z.length),"+input"),j.stateAfter=null,!0;for(var Ae=0;Ae<i.sel.ranges.length;Ae++){var Re=i.sel.ranges[Ae];if(Re.head.line==t&&Re.head.ch<z.length){var Be=Me(t,z.length);Ba(i,Ae,new St(Be,Be));break}}}var Sr=null;function ta(e){Sr=e}function Ga(e,t,n,r,i){var x=e.doc;e.display.shift=!1,r||(r=x.sel);var k=+new Date-200,j=i=="paste"||e.state.pasteIncoming>k,H=ht(t),z=null;if(j&&r.ranges.length>1)if(Sr&&Sr.text.join(`
|
|
`)==t){if(r.ranges.length%Sr.text.length==0){z=[];for(var $=0;$<Sr.text.length;$++)z.push(x.splitLines(Sr.text[$]))}}else H.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(z=Ue(H,function(We){return[We]}));for(var ne=e.curOp.updateInput,fe=r.ranges.length-1;fe>=0;fe--){var ce=r.ranges[fe],Ae=ce.from(),Re=ce.to();ce.empty()&&(n&&n>0?Ae=Me(Ae.line,Ae.ch-n):e.state.overwrite&&!j?Re=Me(Re.line,Math.min(nt(x,Re.line).text.length,Re.ch+be(H).length)):j&&Sr&&Sr.lineWise&&Sr.text.join(`
|
|
`)==H.join(`
|
|
`)&&(Ae=Re=Me(Ae.line,0)));var Be={from:Ae,to:Re,text:z?z[fe%z.length]:H,origin:i||(j?"paste":e.state.cutIncoming>k?"cut":"+input")};Pn(e.doc,Be),Gt(e,"inputRead",e,Be)}t&&!j&&Ss(e,t),Rn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ne),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&or(t,function(){return Ga(t,n,0,null,"paste")}),!0}function Ss(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var x=e.getModeAt(i.head),k=!1;if(x.electricChars){for(var j=0;j<x.electricChars.length;j++)if(t.indexOf(x.electricChars.charAt(j))>-1){k=Ci(e,i.head.line,"smart");break}}else x.electricInput&&(x.electricInput.test(nt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(k=Ci(e,i.head.line,"smart")));k&&Gt(e,"electricInput",e,i.head.line)}}function Cs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,x={anchor:Me(i,0),head:Me(i+1,0)};n.push(x),t.push(e.getRange(x.anchor,x.head))}return{text:t,ranges:n}}function ws(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ds(){var e=a("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=a("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return I?e.style.width="1000px":e.setAttribute("wrap","off"),E&&(e.style.border="1px solid black"),ws(e),t}function $l(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var x=this.options,k=x[r];if(x[r]==i&&r!="mode")return;x[r]=i,t.hasOwnProperty(r)&&jt(this,t[r])(this,i,k),Ee(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](qi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,x=0;x<i.length;++x)if(i[x]==r||i[x].name==r)return i.splice(x,1),!0},addOverlay:Xt(function(r,i){var x=r.token?r:e.getMode(this.options,r);if(x.startState)throw new Error("Overlays may not be stateful.");Pe(this.state.overlays,{mode:x,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(k){return k.priority}),this.state.modeGen++,tr(this)}),removeOverlay:Xt(function(r){for(var i=this.state.overlays,x=0;x<i.length;++x){var k=i[x].modeSpec;if(k==r||typeof r=="string"&&k.name==r){i.splice(x,1),this.state.modeGen++,tr(this);return}}}),indentLine:Xt(function(r,i,x){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Pr(this.doc,r)&&Ci(this,r,i,x)}),indentSelection:Xt(function(r){for(var i=this.doc.sel.ranges,x=-1,k=0;k<i.length;k++){var j=i[k];if(j.empty())j.head.line>x&&(Ci(this,j.head.line,r,!0),x=j.head.line,k==this.doc.sel.primIndex&&Rn(this));else{var H=j.from(),z=j.to(),$=Math.max(x,H.line);x=Math.min(this.lastLine(),z.line-(z.ch?0:1))+1;for(var ne=$;ne<x;++ne)Ci(this,ne,r);var fe=this.doc.sel.ranges;H.ch==0&&i.length==fe.length&&fe[k].from().ch>0&&Ba(this.doc,k,new St(H,fe[k].to()),ve)}}}),getTokenAt:function(r,i){return Di(this,r,i)},getLineTokens:function(r,i){return Di(this,Me(r),i,!0)},getTokenTypeAt:function(r){r=ft(this.doc,r);var i=qr(this,nt(this.doc,r.line)),x=0,k=(i.length-1)/2,j=r.ch,H;if(j==0)H=i[2];else for(;;){var z=x+k>>1;if((z?i[z*2-1]:0)>=j)k=z;else if(i[z*2+1]<j)x=z+1;else{H=i[z*2+2];break}}var $=H?H.indexOf("overlay "):-1;return $<0?H:$==0?null:H.slice(0,$-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var x=[];if(!n.hasOwnProperty(i))return x;var k=n[i],j=this.getModeAt(r);if(typeof j[i]=="string")k[j[i]]&&x.push(k[j[i]]);else if(j[i])for(var H=0;H<j[i].length;H++){var z=k[j[i][H]];z&&x.push(z)}else j.helperType&&k[j.helperType]?x.push(k[j.helperType]):k[j.name]&&x.push(k[j.name]);for(var $=0;$<k._global.length;$++){var ne=k._global[$];ne.pred(j,this)&&re(x,ne.val)==-1&&x.push(ne.val)}return x},getStateAfter:function(r,i){var x=this.doc;return r=yn(x,r==null?x.first+x.size-1:r),vr(this,r+1,i).state},cursorCoords:function(r,i){var x,k=this.doc.sel.primary();return r==null?x=k.head:typeof r=="object"?x=ft(this.doc,r):x=r?k.from():k.to(),Ar(this,x,i||"page")},charCoords:function(r,i){return pa(this,ft(this.doc,r),i||"page")},coordsChar:function(r,i){return r=lo(this,r,i||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,i){return r=lo(this,{top:r,left:0},i||"page").top,gr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,x){var k=!1,j;if(typeof r=="number"){var H=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>H&&(r=H,k=!0),j=nt(this.doc,r)}else j=r;return Ui(this,j,{top:0,left:0},i||"page",x||k).top+(k?this.doc.height-xr(j):0)},defaultTextHeight:function(){return wn(this.display)},defaultCharWidth:function(){return Dn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,x,k,j){var H=this.display;r=Ar(this,ft(this.doc,r));var z=r.bottom,$=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),H.sizer.appendChild(i),k=="over")z=r.top;else if(k=="above"||k=="near"){var ne=Math.max(H.wrapper.clientHeight,this.doc.height),fe=Math.max(H.sizer.clientWidth,H.lineSpace.clientWidth);(k=="above"||r.bottom+i.offsetHeight>ne)&&r.top>i.offsetHeight?z=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=ne&&(z=r.bottom),$+i.offsetWidth>fe&&($=fe-i.offsetWidth)}i.style.top=z+"px",i.style.left=i.style.right="",j=="right"?($=H.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(j=="left"?$=0:j=="middle"&&($=(H.sizer.clientWidth-i.offsetWidth)/2),i.style.left=$+"px"),x&&Xs(this,{left:$,top:z,right:$+i.offsetWidth,bottom:z+i.offsetHeight})},triggerOnKeyDown:Xt(ms),triggerOnKeyPress:Xt(gs),triggerOnKeyUp:ps,triggerOnMouseDown:Xt(vs),execCommand:function(r){if(xi.hasOwnProperty(r))return xi[r].call(null,this)},triggerElectric:Xt(function(r){Ss(this,r)}),findPosH:function(r,i,x,k){var j=1;i<0&&(j=-1,i=-i);for(var H=ft(this.doc,r),z=0;z<i&&!(H=za(this.doc,H,j,x,k),H.hitSide);++z);return H},moveH:Xt(function(r,i){var x=this;this.extendSelectionsBy(function(k){return x.display.shift||x.doc.extend||k.empty()?za(x.doc,k.head,r,i,x.options.rtlMoveVisually):r<0?k.from():k.to()},he)}),deleteH:Xt(function(r,i){var x=this.doc.sel,k=this.doc;x.somethingSelected()?k.replaceSelection("",null,"+delete"):Un(this,function(j){var H=za(k,j.head,r,i,!1);return r<0?{from:H,to:j.head}:{from:j.head,to:H}})}),findPosV:function(r,i,x,k){var j=1,H=k;i<0&&(j=-1,i=-i);for(var z=ft(this.doc,r),$=0;$<i;++$){var ne=Ar(this,z,"div");if(H==null?H=ne.left:ne.left=H,z=Ls(this,ne,j,x),z.hitSide)break}return z},moveV:Xt(function(r,i){var x=this,k=this.doc,j=[],H=!this.display.shift&&!k.extend&&k.sel.somethingSelected();if(k.extendSelectionsBy(function($){if(H)return r<0?$.from():$.to();var ne=Ar(x,$.head,"div");$.goalColumn!=null&&(ne.left=$.goalColumn),j.push(ne.left);var fe=Ls(x,ne,r,i);return i=="page"&&$==k.sel.primary()&&Ca(x,pa(x,fe,"div").top-ne.top),fe},he),j.length)for(var z=0;z<k.sel.ranges.length;z++)k.sel.ranges[z].goalColumn=j[z]}),findWordAt:function(r){var i=this.doc,x=nt(i,r.line).text,k=r.ch,j=r.ch;if(x){var H=this.getHelper(r,"wordChars");(r.sticky=="before"||j==x.length)&&k?--k:++j;for(var z=x.charAt(k),$=ke(z,H)?function(ne){return ke(ne,H)}:/\s/.test(z)?function(ne){return/\s/.test(ne)}:function(ne){return!/\s/.test(ne)&&!ke(ne)};k>0&&$(x.charAt(k-1));)--k;for(;j<x.length&&$(x.charAt(j));)++j}return new St(Me(r.line,k),Me(r.line,j))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):h(this.display.cursorDiv,"CodeMirror-overwrite"),Ee(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==O()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Xt(function(r,i){oi(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Lr(this)-this.display.barHeight,width:r.scrollWidth-Lr(this)-this.display.barWidth,clientHeight:fa(this),clientWidth:nn(this)}},scrollIntoView:Xt(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Me(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Zs(this,r):bo(this,r.from,r.to,r.margin)}),setSize:Xt(function(r,i){var x=this,k=function(H){return typeof H=="number"||/^\d+$/.test(String(H))?H+"px":H};r!=null&&(this.display.wrapper.style.width=k(r)),i!=null&&(this.display.wrapper.style.height=k(i)),this.options.lineWrapping&&ao(this);var j=this.display.viewFrom;this.doc.iter(j,this.display.viewTo,function(H){if(H.widgets){for(var z=0;z<H.widgets.length;z++)if(H.widgets[z].noHScroll){Hr(x,j,"widget");break}}++j}),this.curOp.forceUpdate=!0,Ee(this,"refresh",this)}),operation:function(r){return or(this,r)},startOperation:function(){return dn(this)},endOperation:function(){return cn(this)},refresh:Xt(function(){var r=this.display.cachedTextHeight;tr(this),this.curOp.forceUpdate=!0,ii(this),oi(this,this.doc.scrollLeft,this.doc.scrollTop),La(this.display),(r==null||Math.abs(r-wn(this.display))>.5||this.options.lineWrapping)&&xa(this),Ee(this,"refresh",this)}),swapDoc:Xt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ko(this,r),ii(this),this.display.input.reset(),oi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Gt(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},oe(e),e.registerHelper=function(r,i,x){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=x},e.registerGlobalHelper=function(r,i,x,k){e.registerHelper(r,i,k),n[r]._global.push({pred:x,val:k})}}function za(e,t,n,r,i){var x=t,k=n,j=nt(e,t.line),H=i&&e.direction=="rtl"?-n:n;function z(){var $e=t.line+H;return $e<e.first||$e>=e.first+e.size?!1:(t=new Me($e,t.ch,t.sticky),j=nt(e,$e))}function $($e){var Ke;if(r=="codepoint"){var et=j.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(et)?Ke=null:Ke=new Me(t.line,Math.max(0,Math.min(j.text.length,t.ch+n*(et>=55296&&et<56320?2:1))),-n)}else i?Ke=kl(e.cm,j,t,n):Ke=Na(j,t,n);if(Ke==null)if(!$e&&z())t=Fa(i,e.cm,j,t.line,H);else return!1;else t=Ke;return!0}if(r=="char"||r=="codepoint")$();else if(r=="column")$(!0);else if(r=="word"||r=="group")for(var ne=null,fe=r=="group",ce=e.cm&&e.cm.getHelper(t,"wordChars"),Ae=!0;!(n<0&&!$(!Ae));Ae=!1){var Re=j.text.charAt(t.ch)||`
|
|
`,Be=ke(Re,ce)?"w":fe&&Re==`
|
|
`?"n":!fe||/\s/.test(Re)?null:"p";if(fe&&!Ae&&!Be&&(Be="s"),ne&&ne!=Be){n<0&&(n=1,$(),t.sticky="after");break}if(Be&&(ne=Be),n>0&&!$(!Ae))break}var We=Ji(e,t,x,k,!0);return Gn(x,We)&&(We.hitSide=!0),We}function Ls(e,t,n,r){var i=e.doc,x=t.left,k;if(r=="page"){var j=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),H=Math.max(j-.5*wn(e.display),3);k=(n>0?t.bottom:t.top)+n*H}else r=="line"&&(k=n>0?t.bottom+3:t.top-3);for(var z;!(z=va(e,x,k),!z.outside);){if(n<0?k<=0:k>=i.height){z.hitSide=!0;break}k+=n*5}return z}var wt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};wt.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;ws(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function x(j){for(var H=j.target;H;H=H.parentNode){if(H==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(H.className))break}return!1}ge(i,"paste",function(j){if(!x(j)||Oe(r,j)||Ts(j,r))return;B<=11&&setTimeout(jt(r,function(){return t.updateFromDOM()}),20)}),ge(i,"compositionstart",function(j){t.composing={data:j.data,done:!1}}),ge(i,"compositionupdate",function(j){t.composing||(t.composing={data:j.data,done:!1})}),ge(i,"compositionend",function(j){t.composing&&(j.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ge(i,"touchstart",function(){return n.forceCompositionEnd()}),ge(i,"input",function(){t.composing||t.readFromDOMSoon()});function k(j){if(!x(j)||Oe(r,j))return;if(r.somethingSelected())ta({lineWise:!1,text:r.getSelections()}),j.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var H=Cs(r);ta({lineWise:!0,text:H.text}),j.type=="cut"&&r.operation(function(){r.setSelections(H.ranges,0,ve),r.replaceSelection("",null,"cut")})}else return;if(j.clipboardData){j.clipboardData.clearData();var z=Sr.text.join(`
|
|
`);if(j.clipboardData.setData("Text",z),j.clipboardData.getData("Text")==z){j.preventDefault();return}}var $=Ds(),ne=$.firstChild;r.display.lineSpace.insertBefore($,r.display.lineSpace.firstChild),ne.value=Sr.text.join(`
|
|
`);var fe=document.activeElement;Q(ne),setTimeout(function(){r.display.lineSpace.removeChild($),fe.focus(),fe==i&&n.showPrimarySelection()},50)}ge(i,"copy",k),ge(i,"cut",k)},wt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},wt.prototype.prepareSelection=function(){var e=po(this.cm,!1);return e.focus=document.activeElement==this.div,e},wt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},wt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},wt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var x=ra(t,e.anchorNode,e.anchorOffset),k=ra(t,e.focusNode,e.focusOffset);if(x&&!x.bad&&k&&!k.bad&&dt(Zr(x,k),r)==0&&dt(vn(x,k),i)==0)return;var j=t.display.view,H=r.line>=t.display.viewFrom&&Rs(t,r)||{node:j[0].measure.map[2],offset:0},z=i.line<t.display.viewTo&&Rs(t,i);if(!z){var $=j[j.length-1].measure,ne=$.maps?$.maps[$.maps.length-1]:$.map;z={node:ne[ne.length-1],offset:ne[ne.length-2]-ne[ne.length-3]}}if(!H||!z){e.removeAllRanges();return}var fe=e.rangeCount&&e.getRangeAt(0),ce;try{ce=p(H.node,H.offset,z.offset,z.node)}catch(Ae){}ce&&(!D&&t.state.focused?(e.collapse(H.node,H.offset),ce.collapsed||(e.removeAllRanges(),e.addRange(ce))):(e.removeAllRanges(),e.addRange(ce)),fe&&e.anchorNode==null?e.addRange(fe):D&&this.startGracePeriod()),this.rememberSelection()},wt.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)},wt.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},wt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},wt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},wt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},wt.prototype.blur=function(){this.div.blur()},wt.prototype.getField=function(){return this.div},wt.prototype.supportsTouch=function(){return!0},wt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():or(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)},wt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},wt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&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 n=ra(t,e.anchorNode,e.anchorOffset),r=ra(t,e.focusNode,e.focusOffset);n&&r&&or(t,function(){Qt(t.doc,zr(n,r),ve),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},wt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Me(r.line-1,nt(e.doc,r.line-1).length)),i.ch==nt(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=Me(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var x,k,j;r.line==t.viewFrom||(x=sn(e,r.line))==0?(k=At(t.view[0].line),j=t.view[0].node):(k=At(t.view[x].line),j=t.view[x-1].node.nextSibling);var H=sn(e,i.line),z,$;if(H==t.view.length-1?(z=t.viewTo-1,$=t.lineDiv.lastChild):(z=At(t.view[H+1].line)-1,$=t.view[H+1].node.previousSibling),!j)return!1;for(var ne=e.doc.splitLines(tu(e,j,$,k,z)),fe=Mr(e.doc,Me(k,0),Me(z,nt(e.doc,z).text.length));ne.length>1&&fe.length>1;)if(be(ne)==be(fe))ne.pop(),fe.pop(),z--;else if(ne[0]==fe[0])ne.shift(),fe.shift(),k++;else break;for(var ce=0,Ae=0,Re=ne[0],Be=fe[0],We=Math.min(Re.length,Be.length);ce<We&&Re.charCodeAt(ce)==Be.charCodeAt(ce);)++ce;for(var $e=be(ne),Ke=be(fe),et=Math.min($e.length-(ne.length==1?ce:0),Ke.length-(fe.length==1?ce:0));Ae<et&&$e.charCodeAt($e.length-Ae-1)==Ke.charCodeAt(Ke.length-Ae-1);)++Ae;if(ne.length==1&&fe.length==1&&k==r.line)for(;ce&&ce>r.ch&&$e.charCodeAt($e.length-Ae-1)==Ke.charCodeAt(Ke.length-Ae-1);)ce--,Ae++;ne[ne.length-1]=$e.slice(0,$e.length-Ae).replace(/^\u200b+/,""),ne[0]=ne[0].slice(ce).replace(/\u200b+$/,"");var ut=Me(k,ce),ot=Me(z,fe.length?be(fe).length-Ae:0);if(ne.length>1||ne[0]||dt(ut,ot))return kn(e.doc,ne,ut,ot,"+input"),!0},wt.prototype.ensurePolled=function(){this.forceCompositionEnd()},wt.prototype.reset=function(){this.forceCompositionEnd()},wt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},wt.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)},wt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&or(this.cm,function(){return tr(e.cm)})},wt.prototype.setUneditable=function(e){e.contentEditable="false"},wt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||jt(this.cm,Ga)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},wt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},wt.prototype.onContextMenu=function(){},wt.prototype.resetPosition=function(){},wt.prototype.needsContentAttribute=!0;function Rs(e,t){var n=ha(e,t.line);if(!n||n.hidden)return null;var r=nt(e.doc,t.line),i=eo(n,r,t.line),x=Xe(r,e.doc.direction),k="left";if(x){var j=Ve(x,t.ch);k=j%2?"right":"left"}var H=no(i.map,t.ch,k);return H.offset=H.collapse=="right"?H.end:H.start,H}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fn(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var x="",k=!1,j=e.doc.lineSeparator(),H=!1;function z(ce){return function(Ae){return Ae.id==ce}}function $(){k&&(x+=j,H&&(x+=j),k=H=!1)}function ne(ce){ce&&($(),x+=ce)}function fe(ce){if(ce.nodeType==1){var Ae=ce.getAttribute("cm-text");if(Ae){ne(Ae);return}var Re=ce.getAttribute("cm-marker"),Be;if(Re){var We=e.findMarks(Me(r,0),Me(i+1,0),z(+Re));We.length&&(Be=We[0].find(0))&&ne(Mr(e.doc,Be.from,Be.to).join(j));return}if(ce.getAttribute("contenteditable")=="false")return;var $e=/^(pre|div|p|li|table|br)$/i.test(ce.nodeName);if(!/^br$/i.test(ce.nodeName)&&ce.textContent.length==0)return;$e&&$();for(var Ke=0;Ke<ce.childNodes.length;Ke++)fe(ce.childNodes[Ke]);/^(pre|p)$/i.test(ce.nodeName)&&(H=!0),$e&&(k=!0)}else ce.nodeType==3&&ne(ce.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(fe(t),t==n);)t=t.nextSibling,H=!1;return x}function ra(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Fn(e.clipPos(Me(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var x=e.display.view[i];if(x.node==r)return ru(x,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!b(r,t))return Fn(Me(At(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var x=e.rest?be(e.rest):e.line;return Fn(Me(At(x),x.text.length),i)}var k=t.nodeType==3?t:null,j=t;for(!k&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(k=t.firstChild,n&&(n=k.nodeValue.length));j.parentNode!=r;)j=j.parentNode;var H=e.measure,z=H.maps;function $(Be,We,$e){for(var Ke=-1;Ke<(z?z.length:0);Ke++)for(var et=Ke<0?H.map:z[Ke],ut=0;ut<et.length;ut+=3){var ot=et[ut+2];if(ot==Be||ot==We){var mt=At(Ke<0?e.line:e.rest[Ke]),Lt=et[ut]+$e;return($e<0||ot!=Be)&&(Lt=et[ut+($e?1:0)]),Me(mt,Lt)}}}var ne=$(k,j,n);if(ne)return Fn(ne,i);for(var fe=j.nextSibling,ce=k?k.nodeValue.length-n:0;fe;fe=fe.nextSibling){if(ne=$(fe,fe.firstChild,0),ne)return Fn(Me(ne.line,ne.ch-ce),i);ce+=fe.textContent.length}for(var Ae=j.previousSibling,Re=n;Ae;Ae=Ae.previousSibling){if(ne=$(Ae,Ae.firstChild,-1),ne)return Fn(Me(ne.line,ne.ch+Re),i);Re+=Ae.textContent.length}}var Pt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};Pt.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),E&&(i.style.width="0px"),ge(i,"input",function(){U&&B>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ge(i,"paste",function(k){if(Oe(r,k)||Ts(k,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function x(k){if(Oe(r,k))return;if(r.somethingSelected())ta({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var j=Cs(r);ta({lineWise:!0,text:j.text}),k.type=="cut"?r.setSelections(j.ranges,null,ve):(n.prevInput="",i.value=j.text.join(`
|
|
`),Q(i))}else return;k.type=="cut"&&(r.state.cutIncoming=+new Date)}ge(i,"cut",x),ge(i,"copy",x),ge(e.scroller,"paste",function(k){if(Nr(e,k)||Oe(r,k))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var j=new Event("paste");j.clipboardData=k.clipboardData,i.dispatchEvent(j)}),ge(e.lineSpace,"selectstart",function(k){Nr(e,k)||Y(k)}),ge(i,"compositionstart",function(){var k=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:k,range:r.markText(k,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ge(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Pt.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},Pt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Pt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=po(e);if(e.options.moveInputWithCursor){var i=Ar(e,n.sel.primary().head,"div"),x=t.wrapper.getBoundingClientRect(),k=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+k.top-x.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+k.left-x.left))}return r},Pt.prototype.showSelection=function(e){var t=this.cm,n=t.display;s(n.cursorDiv,e.cursors),s(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Pt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Q(this.textarea),U&&B>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",U&&B>=9&&(this.hasSelection=null))},Pt.prototype.getField=function(){return this.textarea},Pt.prototype.supportsTouch=function(){return!1},Pt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},Pt.prototype.blur=function(){this.textarea.blur()},Pt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Pt.prototype.receivedFocus=function(){this.slowPoll()},Pt.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()})},Pt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Pt.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(U&&B>=9&&this.hasSelection===i||l&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var x=i.charCodeAt(0);if(x==8203&&!r&&(r="\u200B"),x==8666)return this.reset(),this.cm.execCommand("undo")}for(var k=0,j=Math.min(r.length,i.length);k<j&&r.charCodeAt(k)==i.charCodeAt(k);)++k;return or(t,function(){Ga(t,i.slice(k),r.length-k,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Pt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Pt.prototype.onKeyPress=function(){U&&B>=9&&(this.hasSelection=null),this.fastPoll()},Pt.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var x=on(n,e),k=r.scroller.scrollTop;if(!x||T)return;var j=n.options.resetSelectionOnContextMenu;j&&n.doc.sel.contains(x)==-1&&jt(n,Qt)(n.doc,zr(x),ve);var H=i.style.cssText,z=t.wrapper.style.cssText,$=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-$.top-5)+"px; left: "+(e.clientX-$.left-5)+`px;
|
|
z-index: 1000; background: `+(U?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ne;I&&(ne=window.scrollY),r.input.focus(),I&&window.scrollTo(null,ne),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=ce,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function fe(){if(i.selectionStart!=null){var Re=n.somethingSelected(),Be="\u200B"+(Re?i.value:"");i.value="\u21DA",i.value=Be,t.prevInput=Re?"":"\u200B",i.selectionStart=1,i.selectionEnd=Be.length,r.selForContextMenu=n.doc.sel}}function ce(){if(t.contextMenuPending!=ce)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=z,i.style.cssText=H,U&&B<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=k),i.selectionStart!=null){(!U||U&&B<9)&&fe();var Re=0,Be=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?jt(n,Qo)(n):Re++<10?r.detectingSelectAll=setTimeout(Be,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Be,200)}}if(U&&B>=9&&fe(),w){te(e);var Ae=function(){je(window,"mouseup",Ae),setTimeout(ce,20)};ge(window,"mouseup",Ae)}else setTimeout(ce,50)},Pt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Pt.prototype.setUneditable=function(){},Pt.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?_(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 n=O();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=j.getValue()}var i;if(e.form&&(ge(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var x=e.form;i=x.submit;try{var k=x.submit=function(){r(),x.submit=i,x.submit(),x.submit=k}}catch(H){}}t.finishInit=function(H){H.save=r,H.getTextArea=function(){return e},H.toTextArea=function(){H.toTextArea=isNaN,r(),e.parentNode.removeChild(H.getWrapperElement()),e.style.display="",e.form&&(je(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var j=Rt(function(H){return e.parentNode.insertBefore(H,e.nextSibling)},t);return j}function iu(e){e.off=je,e.on=ge,e.wheelEventPixels=cl,e.Doc=rr,e.splitLines=ht,e.countColumn=J,e.findColumn=me,e.isWordChar=De,e.Pass=Te,e.signal=Ee,e.Line=rn,e.changeEnd=Vr,e.scrollbarModel=To,e.Pos=Me,e.cmpPos=dt,e.modes=Bt,e.mimeModes=Et,e.resolveMode=lr,e.getMode=pr,e.modeExtensions=fr,e.extendMode=ia,e.copyState=wr,e.startState=Hn,e.innerMode=Kn,e.commands=xi,e.keyMap=Fr,e.keyName=us,e.isModifierKey=ss,e.lookupKey=Bn,e.normalizeKeyMap=Pl,e.StringStream=Ot,e.SharedTextMarker=yi,e.TextMarker=Yr,e.LineWidget=vi,e.e_preventDefault=Y,e.e_stopPropagation=X,e.e_stop=te,e.addClass=N,e.contains=b,e.rmClass=h,e.keyNames=Jr}Jl(Rt),$l(Rt);var au="iter insert remove copy getEditor constructor".split(" ");for(var na in rr.prototype)rr.prototype.hasOwnProperty(na)&&re(au,na)<0&&(Rt.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(rr.prototype[na]));return oe(rr),Rt.inputStyles={textarea:Pt,contenteditable:wt},Rt.defineMode=function(e){!Rt.defaults.mode&&e!="null"&&(Rt.defaults.mode=e),Cr.apply(this,arguments)},Rt.defineMIME=Or,Rt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Rt.defineMIME("text/plain","null"),Rt.defineExtension=function(e,t){Rt.prototype[e]=t},Rt.defineDocExtension=function(e,t){rr.prototype[e]=t},Rt.fromTextArea=nu,iu(Rt),Rt.version="5.58.2",Rt})},W6BS:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/Uy/MnUEpD0S2AyzdKkMslZYklbwVYWZpXQSygrSVoc+4fcPzUAKtsom4xpIGiLCkMZbJGs1LkvOHPfJbrhRX5/CM/NDwJZlXiqBKlc7AEjg1aI2i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jkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+pdYyaz1k4Y9OdhE4D5dVoB6dZWbuLlneaXm2DPC1NR5BGCbF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(Se,xe,V){Se.exports=V.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Se,xe,V){"use strict";V.r(xe),V.d(xe,"ResizableTextArea",function(){return re});var q=V("wx14"),G=V("1OyB"),D=V("vuIU"),K=V("Ji7U"),P=V("LK+K"),M=V("cDcd"),U=V("VTBJ"),B=V("rePB"),I=V("Zm9Q"),R=V("Kwbf"),v=V("c+Xe"),T=V("m+aA"),L=V("bdgK"),C=new Map;function S(ve){ve.forEach(function(pe){var he,me=pe.target;(he=C.get(me))===null||he===void 0||he.forEach(function(ae){return ae(me)})})}var E=new L.default(S),u=null,o=null;function l(ve,pe){C.has(ve)||(C.set(ve,new Set),E.observe(ve)),C.get(ve).add(pe)}function d(ve,pe){C.has(ve)&&(C.get(ve).delete(pe),C.get(ve).size||(E.unobserve(ve),C.delete(ve)))}var A=function(ve){Object(K.a)(he,ve);var pe=Object(P.a)(he);function he(){return Object(G.a)(this,he),pe.apply(this,arguments)}return Object(D.a)(he,[{key:"render",value:function(){return this.props.children}}]),he}(M.Component),f=M.createContext(null);function m(ve){var pe=ve.children,he=ve.onBatchResize,me=M.useRef(0),ae=M.useRef([]),ue=M.useContext(f),be=M.useCallback(function(Ue,Pe,He){me.current+=1;var Je=me.current;ae.current.push({size:Ue,element:Pe,data:He}),Promise.resolve().then(function(){Je===me.current&&(he==null||he(ae.current),ae.current=[])}),ue==null||ue(Ue,Pe,He)},[he,ue]);return M.createElement(f.Provider,{value:be},pe)}function w(ve){var pe=ve.children,he=ve.disabled,me=M.useRef(null),ae=M.useRef(null),ue=M.useContext(f),be=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ue=M.isValidElement(pe)&&Object(v.c)(pe),Pe=Ue?pe.ref:null,He=M.useMemo(function(){return Object(v.a)(Pe,me)},[Pe,me]),Je=M.useRef(ve);Je.current=ve;var Le=M.useCallback(function(De){var ke=Je.current,ze=ke.onResize,Ge=ke.data,Ie=De.getBoundingClientRect(),we=Ie.width,Ze=Ie.height,qe=De.offsetWidth,Qe=De.offsetHeight,Ve=Math.floor(we),tt=Math.floor(Ze);if(be.current.width!==Ve||be.current.height!==tt||be.current.offsetWidth!==qe||be.current.offsetHeight!==Qe){var Xe={width:Ve,height:tt,offsetWidth:qe,offsetHeight:Qe};be.current=Xe;var Ne=qe===Math.round(we)?we:qe,ge=Qe===Math.round(Ze)?Ze:Qe,Fe=Object(U.a)(Object(U.a)({},Xe),{},{offsetWidth:Ne,offsetHeight:ge});ue==null||ue(Fe,De,Ge),ze&&Promise.resolve().then(function(){ze(Fe,De)})}},[]);return M.useEffect(function(){var De=Object(T.a)(me.current)||Object(T.a)(ae.current);return De&&!he&&l(De,Le),function(){return d(De,Le)}},[me.current,he]),M.createElement(A,{ref:ae},Ue?M.cloneElement(pe,{ref:He}):pe)}var y="rc-observer-key";function h(ve){var pe=ve.children,he=Object(I.a)(pe);return he.map(function(me,ae){var ue=(me==null?void 0:me.key)||"".concat(y,"-").concat(ae);return M.createElement(w,Object(q.a)({},ve,{key:ue}),me)})}h.Collection=m;var c=h,s=V("bT9E"),a=V("TSYQ"),g=V.n(a),p=`
|
|
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"],O={},N;function W(ve){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(pe&&O[he])return O[he];var me=window.getComputedStyle(ve),ae=me.getPropertyValue("box-sizing")||me.getPropertyValue("-moz-box-sizing")||me.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(me.getPropertyValue("padding-bottom"))+parseFloat(me.getPropertyValue("padding-top")),be=parseFloat(me.getPropertyValue("border-bottom-width"))+parseFloat(me.getPropertyValue("border-top-width")),Ue=b.map(function(He){return"".concat(He,":").concat(me.getPropertyValue(He))}).join(";"),Pe={sizingStyle:Ue,paddingSize:ue,borderSize:be,boxSizing:ae};return pe&&he&&(O[he]=Pe),Pe}function Q(ve){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),ve.getAttribute("wrap")?N.setAttribute("wrap",ve.getAttribute("wrap")):N.removeAttribute("wrap");var ae=W(ve,pe),ue=ae.paddingSize,be=ae.borderSize,Ue=ae.boxSizing,Pe=ae.sizingStyle;N.setAttribute("style","".concat(Pe,";").concat(p)),N.value=ve.value||ve.placeholder||"";var He=Number.MIN_SAFE_INTEGER,Je=Number.MAX_SAFE_INTEGER,Le=N.scrollHeight,De;if(Ue==="border-box"?Le+=be:Ue==="content-box"&&(Le-=ue),he!==null||me!==null){N.value=" ";var ke=N.scrollHeight-ue;he!==null&&(He=ke*he,Ue==="border-box"&&(He=He+ue+be),Le=Math.max(He,Le)),me!==null&&(Je=ke*me,Ue==="border-box"&&(Je=Je+ue+be),De=Le>Je?"":"hidden",Le=Math.min(Je,Le))}return{height:Le,minHeight:He,maxHeight:Je,overflowY:De,resize:"none"}}var F=V("Gytx"),_=V.n(F),J;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(J||(J={}));var ee=function(ve){Object(K.a)(he,ve);var pe=Object(P.a)(he);function he(me){var ae;return Object(G.a)(this,he),ae=pe.call(this,me),ae.nextFrameActionId=void 0,ae.resizeFrameId=void 0,ae.textArea=void 0,ae.saveTextArea=function(ue){ae.textArea=ue},ae.handleResize=function(ue){var be=ae.state.resizeStatus,Ue=ae.props,Pe=Ue.autoSize,He=Ue.onResize;if(be!==J.NONE)return;typeof He=="function"&&He(ue),Pe&&ae.resizeOnNextFrame()},ae.resizeOnNextFrame=function(){cancelAnimationFrame(ae.nextFrameActionId),ae.nextFrameActionId=requestAnimationFrame(ae.resizeTextarea)},ae.resizeTextarea=function(){var ue=ae.props.autoSize;if(!ue||!ae.textArea)return;var be=ue.minRows,Ue=ue.maxRows,Pe=Q(ae.textArea,!1,be,Ue);ae.setState({textareaStyles:Pe,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 ue=ae.props,be=ue.prefixCls,Ue=be===void 0?"rc-textarea":be,Pe=ue.autoSize,He=ue.onResize,Je=ue.className,Le=ue.disabled,De=ae.state,ke=De.textareaStyles,ze=De.resizeStatus,Ge=Object(s.a)(ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ie=g()(Ue,Je,Object(B.a)({},"".concat(Ue,"-disabled"),Le));"value"in Ge&&(Ge.value=Ge.value||"");var we=Object(U.a)(Object(U.a)(Object(U.a)({},ae.props.style),ke),ze===J.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(c,{onResize:ae.handleResize,disabled:!(Pe||He)},M.createElement("textarea",Object(q.a)({},Ge,{className:Ie,style:we,ref:ae.saveTextArea})))},ae.state={textareaStyles:{},resizeStatus:J.NONE},ae}return Object(D.a)(he,[{key:"componentDidUpdate",value:function(ae){(ae.value!==this.props.value||!_()(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,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(ae,ue)}}catch(be){}}},{key:"render",value:function(){return this.renderTextArea()}}]),he}(M.Component),re=ee,de=function(ve){Object(K.a)(he,ve);var pe=Object(P.a)(he);function he(me){var ae;Object(G.a)(this,he),ae=pe.call(this,me),ae.resizableTextArea=void 0,ae.focus=function(){ae.resizableTextArea.textArea.focus()},ae.saveTextArea=function(be){ae.resizableTextArea=be},ae.handleChange=function(be){var Ue=ae.props.onChange;ae.setValue(be.target.value,function(){ae.resizableTextArea.resizeTextarea()}),Ue&&Ue(be)},ae.handleKeyDown=function(be){var Ue=ae.props,Pe=Ue.onPressEnter,He=Ue.onKeyDown;be.keyCode===13&&Pe&&Pe(be),He&&He(be)};var ue=typeof me.value=="undefined"||me.value===null?me.defaultValue:me.value;return ae.state={value:ue},ae}return Object(D.a)(he,[{key:"setValue",value:function(ae,ue){"value"in this.props||this.setState({value:ae},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(re,Object(q.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}}]),he}(M.Component),Te=xe.default=de},ZpRC:function(Se,xe,V){"use strict";function q(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function G(v,T){return(!T||v!=="hidden")&&v!=="visible"&&v!=="clip"}function D(v,T){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var L=getComputedStyle(v,null);return G(L.overflowY,T)||G(L.overflowX,T)||function(C){var S=function(E){if(!E.ownerDocument||!E.ownerDocument.defaultView)return null;try{return E.ownerDocument.defaultView.frameElement}catch(u){return null}}(C);return!!S&&(S.clientHeight<C.scrollHeight||S.clientWidth<C.scrollWidth)}(v)}return!1}function K(v,T,L,C,S,E,u,o){return E<v&&u>T||E>v&&u<T?0:E<=v&&o<=L||u>=T&&o>=L?E-v-C:u>T&&o<L||E<v&&o>L?u-T+S:0}var P=function(v,T){var L=window,C=T.scrollMode,S=T.block,E=T.inline,u=T.boundary,o=T.skipOverflowHiddenElements,l=typeof u=="function"?u:function(ke){return ke!==u};if(!q(v))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,A=[],f=v;q(f)&&l(f);){if((f=f.parentElement)===d){A.push(f);break}f!=null&&f===document.body&&D(f)&&!D(document.documentElement)||f!=null&&D(f,o)&&A.push(f)}for(var m=L.visualViewport?L.visualViewport.width:innerWidth,w=L.visualViewport?L.visualViewport.height:innerHeight,y=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,c=v.getBoundingClientRect(),s=c.height,a=c.width,g=c.top,p=c.right,b=c.bottom,O=c.left,N=S==="start"||S==="nearest"?g:S==="end"?b:g+s/2,W=E==="center"?O+a/2:E==="end"?p:O,Q=[],F=0;F<A.length;F++){var _=A[F],J=_.getBoundingClientRect(),ee=J.height,re=J.width,de=J.top,Te=J.right,ve=J.bottom,pe=J.left;if(C==="if-needed"&&g>=0&&O>=0&&b<=w&&p<=m&&g>=de&&b<=ve&&O>=pe&&p<=Te)return Q;var he=getComputedStyle(_),me=parseInt(he.borderLeftWidth,10),ae=parseInt(he.borderTopWidth,10),ue=parseInt(he.borderRightWidth,10),be=parseInt(he.borderBottomWidth,10),Ue=0,Pe=0,He="offsetWidth"in _?_.offsetWidth-_.clientWidth-me-ue:0,Je="offsetHeight"in _?_.offsetHeight-_.clientHeight-ae-be:0;if(d===_)Ue=S==="start"?N:S==="end"?N-w:S==="nearest"?K(h,h+w,w,ae,be,h+N,h+N+s,s):N-w/2,Pe=E==="start"?W:E==="center"?W-m/2:E==="end"?W-m:K(y,y+m,m,me,ue,y+W,y+W+a,a),Ue=Math.max(0,Ue+h),Pe=Math.max(0,Pe+y);else{Ue=S==="start"?N-de-ae:S==="end"?N-ve+be+Je:S==="nearest"?K(de,ve,ee,ae,be+Je,N,N+s,s):N-(de+ee/2)+Je/2,Pe=E==="start"?W-pe-me:E==="center"?W-(pe+re/2)+He/2:E==="end"?W-Te+ue+He:K(pe,Te,re,me,ue+He,W,W+a,a);var Le=_.scrollLeft,De=_.scrollTop;N+=De-(Ue=Math.max(0,Math.min(De+Ue,_.scrollHeight-ee+Je))),W+=Le-(Pe=Math.max(0,Math.min(Le+Pe,_.scrollWidth-re+He)))}Q.push({el:_,top:Ue,left:Pe})}return Q};function M(v){return v===Object(v)&&Object.keys(v).length!==0}function U(v,T){T===void 0&&(T="auto");var L="scrollBehavior"in document.body.style;v.forEach(function(C){var S=C.el,E=C.top,u=C.left;S.scroll&&L?S.scroll({top:E,left:u,behavior:T}):(S.scrollTop=E,S.scrollLeft=u)})}function B(v){return v===!1?{block:"end",inline:"nearest"}:M(v)?v:{block:"start",inline:"nearest"}}function I(v,T){var L=!v.ownerDocument.documentElement.contains(v);if(M(T)&&typeof T.behavior=="function")return T.behavior(L?[]:P(v,T));if(L)return;var C=B(T);return U(P(v,C),C.behavior)}var R=xe.a=I},bT9E:function(Se,xe,V){"use strict";V.d(xe,"a",function(){return G});var q=V("VTBJ");function G(D,K){var P=Object(q.a)({},D);return Array.isArray(K)&&K.forEach(function(M){delete P[M]}),P}},c5Ni:function(Se,xe,V){},cRFk:function(Se,xe,V){Se.exports=V.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Se,xe,V){Se.exports=V.p+"static/choose.4ad1045f.svg"},dNgX:function(Se,xe,V){"use strict";V.r(xe);var q=V("14J3"),G=V("BMrR"),D=V("jCWc"),K=V("kPKH"),P=V("OaEy"),M=V("2fM7"),U=V("7Kak"),B=V("9yH6"),I=V("5NDa"),R=V("5rEg"),v=V("miYZ"),T=V("tsqr"),L=V("9og8"),C=V("k1fw"),S=V("y8nQ"),E=V("Vl3Y"),u=V("tJVT"),o=V("PpiC"),l=V("WmNS"),d=V.n(l),A=V("cDcd"),f=V.n(A),m=V("9kvl"),w=V("Ot1p"),y=V("HBuW"),h=V("S3tb"),c=V.n(h),s=V("9ZNV"),a=V("CJF0"),g=V("2RCv"),p={1:[100,200],2:[300,400,500,600],3:[700,800,900,1e3]},b=function(N){var W,Q,F,_=N.shixunsDetail,J=N.dispatch,ee=N.loading,re=N.match,de=Object(o.a)(N,["shixunsDetail","dispatch","loading","match"]),Te=E.a.useForm(),ve=Object(u.a)(Te,1),pe=ve[0],he=Object(A.useState)({}),me=Object(u.a)(he,2),ae=me[0],ue=me[1],be=Object(A.useState)([100,200]),Ue=Object(u.a)(be,2),Pe=Ue[0],He=Ue[1],Je=_.challengesNew,Le=Object(A.useState)(),De=Object(u.a)(Le,2),ke=De[0],ze=De[1],Ge=Object(A.useState)(),Ie=Object(u.a)(Ge,2),we=Ie[0],Ze=Ie[1];Object(A.useEffect)(function(){return J({type:"globalSetting/footerToggle",payload:!1}),function(){J({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(A.useEffect)(function(){re.params.challengesId?(Ze(!0),qe()):(Ze(!1),J({type:"shixunsDetail/getChallengesNew",payload:Object(C.a)({},re.params)}))},[re.params]);var qe=function(){var Ne=Object(L.a)(d.a.mark(function ge(){var Fe;return d.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return Ee.next=2,Object(y.H)({id:re.params.id,challengeId:re.params.challengesId,tab:0});case 2:Fe=Ee.sent,Fe&&(ze(Fe),Qe(Fe));case 4:case"end":return Ee.stop()}},ge)}));return function(){return Ne.apply(this,arguments)}}(),Qe=function(ge){var Fe={subject:ge.name,difficulty:ge.difficulty,score:ge.score,challenge_tag:ge.tags,task_pass:ge.task_pass},je=p[ge.difficulty];He(je),pe.setFieldsValue(Object(C.a)({},Fe)),ue(Object(C.a)({},Fe))},Ve=function(ge){var Fe=p[ge],je=Fe==null?void 0:Fe[0];He(Fe),pe.setFieldsValue({score:je}),ue(Object(C.a)(Object(C.a)({},pe.getFieldsValue()),{score:je}))},tt=function(ge,Fe){ue(Object(C.a)({},pe.getFieldsValue())),"difficulty"in ge&&Ve(ge.difficulty)},Xe=function(){var Ne=Object(L.a)(d.a.mark(function ge(){var Fe,je,Ee,Oe,le,ie=arguments;return d.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:if(je=ie.length>0&&ie[0]!==void 0?ie[0]:{},!(!we&&((Fe=_.detail)===null||Fe===void 0?void 0:Fe.shixun_status)===2)){Y.next=4;break}return T.b.info("\u8BE5\u5B9E\u8BAD\u5DF2\u7ECF\u53D1\u5E03\u4E0D\u80FD\u65B0\u5EFA"),Y.abrupt("return");case 4:if(!we){Y.next=10;break}return Y.next=7,Object(y.Mb)(Object(C.a)(Object(C.a)({},re.params),{},{tab:0,challenge:Object(C.a)({},je),challenge_tag:je.challenge_tag}));case 7:return Ee=Y.sent,Ee&&m.d.replace("/shixuns/".concat(re.params.id,"/challenges/").concat(re.params.challengesId,"/tab=2")),Y.abrupt("return");case 10:return Oe=Object(C.a)({},ae),Oe.identifier=re.params.id,Oe.st=0,Y.next=15,Object(y.b)(Object(C.a)({},Oe));case 15:le=Y.sent,le.status===1&&de.history.replace("/shixuns/".concat(re.params.id,"/challenges/").concat(le.challenge_id,"/tab=2"));case 17:case"end":return Y.stop()}},ge)}));return function(){return Ne.apply(this,arguments)}}();return f.a.createElement("section",{className:c.a.bg},f.a.createElement(a.a,{data:ke||Je,title:"\u5B9E\u8DF5\u9898"}),f.a.createElement(E.a,{form:pe,className:c.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:tt,onFinish:Xe},f.a.createElement("aside",{className:["bg-white",c.a.navBar,c.a.flexRow].join(" ")},f.a.createElement("li",{className:"".concat(c.a.active," current")},f.a.createElement("a",null,"1\u3001\u672C\u5173\u4EFB\u52A1")),we&&f.a.createElement(f.a.Fragment,null,f.a.createElement("li",{className:"current"},f.a.createElement("a",{onClick:function(){m.d.push("/shixuns/".concat(re.params.id,"/challenges/").concat(re.params.challengesId,"/tab=2"))}},"2\u3001\u8BC4\u6D4B\u8BBE\u7F6E")),f.a.createElement("li",{className:"current"},f.a.createElement("a",{onClick:function(){m.d.push("/shixuns/".concat(re.params.id,"/challenges/").concat(re.params.challengesId,"/tab=3"))}},"3\u3001\u53C2\u8003\u7B54\u6848")),f.a.createElement("li",{className:"current"},f.a.createElement("a",{onClick:function(){m.d.push("/shixuns/".concat(re.params.id,"/challenges/").concat(re.params.challengesId,"/tab=4"))}},"4\u3001\u5173\u5361\u6392\u884C\u699C")))),f.a.createElement("div",{className:c.a.fieldWrap},f.a.createElement(E.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},f.a.createElement(R.a,{maxLength:60,suffix:"".concat(((W=ae.subject)===null||W===void 0?void 0:W.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),f.a.createElement("div",{className:c.a.mdWrap},f.a.createElement(E.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u8FC7\u5173\u4EFB\u52A1\u7B80\u4ECB\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},f.a.createElement(w.a,{watch:!0,defaultValue:we?ke==null?void 0:ke.task_pass:Je.task_pass_default})),f.a.createElement(E.a.Item,{name:"difficulty",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},f.a.createElement(B.a.Group,{disabled:((Q=_.detail)===null||Q===void 0?void 0:Q.shixun_status)===2},f.a.createElement(B.a,{value:1},"\u7B80\u5355"),f.a.createElement(B.a,{value:2},"\u4E2D\u7B49"),f.a.createElement(B.a,{value:3},"\u56F0\u96BE"))),f.a.createElement(G.a,null,f.a.createElement(K.a,null,f.a.createElement(E.a.Item,{name:"score",label:"\u5956\u52B1\u7ECF\u9A8C\u503C:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},f.a.createElement(M.a,{disabled:((F=_.detail)===null||F===void 0?void 0:F.shixun_status)===2},Pe==null?void 0:Pe.map(function(Ne){return f.a.createElement(M.a.Option,{value:Ne},Ne)})))),f.a.createElement(K.a,{flex:1},f.a.createElement("div",{className:"font12 c-light-black ml10 mt20"},"\u5982\u679C\u5B66\u5458\u7B54\u9898\u9519\u8BEF\uFF0C\u5219\u4E0D\u80FD\u5F97\u5230\u76F8\u5E94\u7684\u7ECF\u9A8C\u503C",f.a.createElement("br",null),"\u5982\u679C\u5B66\u5458\u6210\u529F\u5F97\u5230\u7ECF\u9A8C\u503C\uFF0C\u90A3\u4E48\u5C06\u540C\u65F6\u83B7\u5F97\u7B49\u503C\u7684\u91D1\u5E01\u5956\u52B1\uFF0C\u5982\uFF1A+10\u7ECF\u9A8C\u503C\u3001+10\u91D1\u5E01"))),f.a.createElement(E.a.Item,{name:"challenge_tag",label:f.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E ",f.a.createElement("span",{className:"pl20 font12 c-light-black"},"\u5B66\u5458\u7B54\u9898\u6B63\u786E\u5C06\u83B7\u5F97\u6280\u80FD\uFF0C\u5426\u5219\u4E0D\u80FD\u83B7\u5F97\u6280\u80FD\uFF08\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E\uFF09")),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6280\u80FD\u6807\u7B7E"}]},f.a.createElement(g.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E",style:{width:"260px"},InputRight:f.a.createElement("span",{className:"ml5"},"(\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E)")}))),f.a.createElement(E.a.Item,{noStyle:!0},f.a.createElement(s.a,{okButtonProps:{htmlType:"submit"},onCancel:function(){return m.d.push("/shixuns/".concat(re.params.id,"/challenges"))}}))))};xe.default=Object(m.a)(function(O){var N=O.shixunsDetail,W=O.newCourse,Q=O.loading,F=O.globalSetting;return{shixunsDetail:N,newCourse:W,globalSetting:F,loading:Q.effects}})(b)},dejd:function(Se,xe,V){},djh8:function(Se,xe,V){Se.exports=V.p+"static/qrCode.42927872.png"},dmUQ:function(Se,xe,V){"use strict";var q=V("Ff2n"),G=V("rePB"),D=V("1OyB"),K=V("vuIU"),P=V("Ji7U"),M=V("md7G"),U=V("foSv"),B=V("cDcd"),I=V.n(B),R=V("TSYQ"),v=V.n(R),T=V("4IlW");function L(s,a){var g=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);a&&(p=p.filter(function(b){return Object.getOwnPropertyDescriptor(s,b).enumerable})),g.push.apply(g,p)}return g}function C(s){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?L(Object(g),!0).forEach(function(p){Object(G.a)(s,p,g[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(g)):L(Object(g)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(g,p))})}return s}function S(s){var a=E();return function(){var p=Object(U.a)(s),b;if(a){var O=Object(U.a)(this).constructor;b=Reflect.construct(p,arguments,O)}else b=p.apply(this,arguments);return Object(M.a)(this,b)}}function E(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function u(){}function o(s){s.preventDefault()}var l=function(a){return a.replace(/[^\w.-]+/g,"")},d=200,A=600,f=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,m=function(a){return a!=null},w=function(a,g){return g===a||typeof g=="number"&&typeof a=="number"&&isNaN(g)&&isNaN(a)},y=function(s){Object(P.a)(g,s);var a=S(g);function g(p){var b;Object(D.a)(this,g),b=a.call(this,p),b.onKeyDown=function(W){var Q=b.props,F=Q.onKeyDown,_=Q.onPressEnter;if(W.keyCode===T.a.UP){var J=b.getRatio(W);b.up(W,J,null),b.stop()}else if(W.keyCode===T.a.DOWN){var ee=b.getRatio(W);b.down(W,ee,null),b.stop()}else W.keyCode===T.a.ENTER&&_&&_(W);if(b.recordCursorPosition(),b.lastKeyCode=W.keyCode,F){for(var re=arguments.length,de=new Array(re>1?re-1:0),Te=1;Te<re;Te++)de[Te-1]=arguments[Te];F.apply(void 0,[W].concat(de))}},b.onKeyUp=function(W){var Q=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),Q){for(var F=arguments.length,_=new Array(F>1?F-1:0),J=1;J<F;J++)_[J-1]=arguments[J];Q.apply(void 0,[W].concat(_))}},b.onChange=function(W){var Q=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(W)),b.setState({inputValue:b.rawInput}),Q(b.toNumber(b.rawInput))},b.onMouseUp=function(){var W=b.props.onMouseUp;b.recordCursorPosition(),W&&W.apply(void 0,arguments)},b.onFocus=function(){var W;b.setState({focused:!0}),(W=b.props).onFocus.apply(W,arguments)},b.onBlur=function(){var W=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var Q=b.getCurrentValidValue(b.state.inputValue),F=b.setValue(Q,u);if(W){var _=b.input.value,J=b.getInputDisplayValue({focus:!1,value:F});b.input.value=J&&Number(J),W.apply(void 0,arguments),b.input.value=_}},b.getRatio=function(W){var Q=1;return W.metaKey||W.ctrlKey?Q=.1:W.shiftKey&&(Q=10),Q},b.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},b.getPrecision=function(W){if(m(b.props.precision))return b.props.precision;var Q=String(W);if(Q.indexOf("e-")>=0)return parseInt(Q.slice(Q.indexOf("e-")+2),10);var F=0;return Q.indexOf(".")>=0&&(F=Q.length-Q.indexOf(".")-1),F},b.getInputDisplayValue=function(W){var Q=W||b.state,F=Q.focused,_=Q.inputValue,J=Q.value,ee;F?ee=_:ee=b.toPrecisionAsStep(J),ee==null&&(ee="");var re=b.formatWrapper(ee);return m(b.props.decimalSeparator)&&(re=re.toString().replace(".",b.props.decimalSeparator)),re},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(W){}},b.restoreByAfter=function(W){if(W===void 0)return!1;var Q=b.input.value,F=Q.lastIndexOf(W);if(F===-1)return!1;var _=b.cursorBefore.length;return b.lastKeyCode===T.a.DELETE&&b.cursorBefore.charAt(_-1)===W[0]?(b.fixCaret(_,_),!0):F+W.length===Q.length?(b.fixCaret(F,F),!0):!1},b.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(Q,F){var _=W.substring(F);return b.restoreByAfter(_)})},b.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(W,Q,F){b.pressingUpOrDown=!0,b.step("down",W,Q,F)},b.up=function(W,Q,F){b.pressingUpOrDown=!0,b.step("up",W,Q,F)},b.saveInput=function(W){b.input=W};var O=p.value;O===void 0&&(O=p.defaultValue),b.state={focused:p.autoFocus};var N=b.getValidValue(b.toNumber(O));return b.state=C(C({},b.state),{},{inputValue:b.toPrecisionAsStep(N),value:N}),b}return Object(K.a)(g,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var O=this.props,N=O.value,W=O.onChange,Q=O.max,F=O.min,_=this.state.focused;if(b){if(!w(b.value,N)||!w(b.max,Q)||!w(b.min,F)){var J=_?N:this.getValidValue(N),ee;this.pressingUpOrDown?ee=J:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(J),this.setState({value:J,inputValue:ee})}var re="value"in this.props?N:this.state.value;"max"in this.props&&b.max!==Q&&typeof re=="number"&&re>Q&&W&&W(Q),"min"in this.props&&b.min!==F&&typeof re=="number"&&re<F&&W&&W(F)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var de=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===T.a.BACKSPACE?de=this.cursorStart-1:this.lastKeyCode===T.a.DELETE&&(de=this.cursorStart):de=this.input.value.length,this.fixCaret(de,de)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case T.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case T.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Te){}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 O=b;return O===""?O="":this.isNotCompleteNumber(parseFloat(O))?O=this.state.value:O=this.getValidValue(O),this.toNumber(O)}},{key:"getValueFromEvent",value:function(b){var O=b.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(O=O.replace(this.props.decimalSeparator,".")),O}},{key:"getValidValue",value:function(b){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(b);return isNaN(W)?b:(W<O&&(W=O),W>N&&(W=N),W)}},{key:"setValue",value:function(b,O){var N=this.props.precision,W=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),Q=this.state.value,F=Q===void 0?null:Q,_=this.state.inputValue,J=_===void 0?null:_,ee=typeof W=="number"?W.toFixed(N):"".concat(W),re=W!==F||ee!=="".concat(J);return"value"in this.props?(J=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:J},O)):this.setState({value:W,inputValue:this.toPrecisionAsStep(b)},O),re&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(b){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,W=N.precision,Q=N.step;if(m(W))return W;var F=this.getPrecision(O),_=this.getPrecision(Q),J=this.getPrecision(b);return b?Math.max(J,F+_):F+_}},{key:"getPrecisionFactor",value:function(b){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(b,O);return Math.pow(10,N)}},{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 O=Math.abs(this.getMaxPrecision(b));return isNaN(O)?b.toString():Number(b).toFixed(O)}},{key:"toNumber",value:function(b){var O=this.props.precision,N=this.state.focused,W=b&&b.length>16&&N;return this.isNotCompleteNumber(b)||W?b:m(O)?Math.round(b*Math.pow(10,O))/Math.pow(10,O):Number(b)}},{key:"upStep",value:function(b,O){var N=this.props.step,W=this.getPrecisionFactor(b,O),Q=Math.abs(this.getMaxPrecision(b,O)),F=((W*b+W*N*O)/W).toFixed(Q);return this.toNumber(F)}},{key:"downStep",value:function(b,O){var N=this.props.step,W=this.getPrecisionFactor(b,O),Q=Math.abs(this.getMaxPrecision(b,O)),F=((W*b-W*N*O)/W).toFixed(Q);return this.toNumber(F)}},{key:"step",value:function(b,O){var N=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Q=arguments.length>3?arguments[3]:void 0;this.stop(),O&&(O.persist(),O.preventDefault());var F=this.props;if(F.disabled)return;var _=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(_))return;var J=this["".concat(b,"Step")](_,W),ee=J>F.max||J<F.min;if(J>F.max?J=F.max:J<F.min&&(J=F.min),this.setValue(J,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){N[b](O,W,!0)},Q?d:A)}},{key:"fixCaret",value:function(b,O){if(b===void 0||O===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,W=this.input.selectionEnd;(b!==N||O!==W)&&this.input.setSelectionRange(b,O)}catch(Q){}}},{key:"render",value:function(){var b,O=this.props,N=O.prefixCls,W=O.disabled,Q=O.readOnly,F=O.useTouch,_=O.autoComplete,J=O.upHandler,ee=O.downHandler,re=O.className,de=O.max,Te=O.min,ve=O.style,pe=O.title,he=O.onMouseEnter,me=O.onMouseLeave,ae=O.onMouseOver,ue=O.onMouseOut,be=O.required,Ue=O.onClick,Pe=O.tabIndex,He=O.type,Je=O.placeholder,Le=O.id,De=O.inputMode,ke=O.pattern,ze=O.step,Ge=O.maxLength,Ie=O.autoFocus,we=O.name,Ze=O.onPaste,qe=O.onInput,Qe=Object(q.a)(O,["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"]),Ve=this.state,tt=Ve.value,Xe=Ve.focused,Ne=v()(N,(b={},Object(G.a)(b,re,!!re),Object(G.a)(b,"".concat(N,"-disabled"),W),Object(G.a)(b,"".concat(N,"-focused"),Xe),b)),ge={};Object.keys(Qe).forEach(function(te){(te.substr(0,5)==="data-"||te.substr(0,5)==="aria-"||te==="role")&&(ge[te]=Qe[te])});var Fe=!Q&&!W,je=this.getInputDisplayValue(null),Ee=(tt||tt===0)&&(isNaN(tt)||Number(tt)>=de),Oe=(tt||tt===0)&&(isNaN(tt)||Number(tt)<=Te),le=Ee||W||Q,ie=Oe||W||Q,oe=v()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(G.a)({},"".concat(N,"-handler-up-disabled"),le)),Y=v()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(G.a)({},"".concat(N,"-handler-down-disabled"),ie)),X=F?{onTouchStart:le?u:this.up,onTouchEnd:this.stop}:{onMouseDown:le?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=F?{onTouchStart:ie?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ie?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return I.a.createElement("div",{className:Ne,style:ve,title:pe,onMouseEnter:he,onMouseLeave:me,onMouseOver:ae,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},I.a.createElement("div",{className:"".concat(N,"-handler-wrap")},I.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Increase Value","aria-disabled":le,className:oe}),J||I.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:o})),I.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":ie,className:Y}),ee||I.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:o}))),I.a.createElement("div",{className:"".concat(N,"-input-wrap")},I.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Te,"aria-valuemax":de,"aria-valuenow":tt,required:be,type:He,placeholder:Je,onPaste:Ze,onClick:Ue,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:Pe,autoComplete:_,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Fe?this.onKeyDown:u,onKeyUp:Fe?this.onKeyUp:u,autoFocus:Ie,maxLength:Ge,readOnly:Q,disabled:W,max:de,min:Te,step:ze,name:we,title:pe,id:Le,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(je),pattern:ke,inputMode:De,onInput:qe},ge))))}}]),g}(I.a.Component);y.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:f,min:-f,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:l,required:!1,autoComplete:"off"};var h=y,c=xe.a=h},ji0R:function(Se,xe,V){Se.exports=V.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Se,xe,V){Se.exports=V.p+"static/question.cb52bef9.gif"},kPYp:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H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sFvYzt9Bf9cbKe0Ui8DnlYY1z2sXcETzfSavdMKB0OI4/7C42EtD5tcLhef+w1c0U0DcpYcXXUauYOus8Mdns1W2eIpy3Y18FGXrjipZmzAMLIoM4ZZQqwmdh7Oaltv3E0id1lMlR1hRJnk8PK+H0mqu7DmHBDB4vw6HtneQ8N06YNalIp4HmF6X8EfV6ljRfk5EmNxJvIdn09ksdYIs7oV2d7h7uGrhUOEzP14ibzoNgXmC3wjQx3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Se,xe,V){},l2Kq:function(Se,xe,V){Se.exports=V.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Se,xe,V){(function(q){q(V("VrN/"),V("1eCo"),V("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(G,D){var K=q.getMode(G,"text/html"),P=K.name=="null";function M(F){if(q.findModeByName){var _=q.findModeByName(F);_&&(F=_.mime||_.mimes[0])}var J=q.getMode(G,F);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 U={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 U)U.hasOwnProperty(B)&&D.tokenTypeOverrides[B]&&(U[B]=D.tokenTypeOverrides[B]);var I=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,T=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,L=/^ {0,3}(?:\={1,}|-{2,})\s*$/,C=/^[^#!\[\]*_\\<>` "'(~:]+/,S=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,E=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,o=" ";function l(F,_,J){return _.f=_.inline=J,J(F,_)}function d(F,_,J){return _.f=_.block=J,J(F,_)}function A(F){return!F||!/\S/.test(F.string)}function f(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==w){var _=P;if(!_){var J=q.innerMode(K,F.htmlState);_=J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText}_&&(F.f=s,F.block=m,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function m(F,_){var J=F.column()===_.indentation,ee=A(_.prevLine.stream),re=_.indentedCode,de=_.prevLine.hr,Te=_.list!==!1,ve=(_.listStack[_.listStack.length-1]||0)+3;_.indentedCode=!1;var pe=_.indentation;if(_.indentationDiff===null&&(_.indentationDiff=_.indentation,Te)){for(_.list=null;pe<_.listStack[_.listStack.length-1];)_.listStack.pop(),_.listStack.length?_.indentation=_.listStack[_.listStack.length-1]:_.list=!1;_.list!==!1&&(_.indentationDiff=pe-_.listStack[_.listStack.length-1])}var he=!ee&&!de&&!_.prevLine.header&&(!Te||!re)&&!_.prevLine.fencedCodeEnd,me=(_.list===!1||de||ee)&&_.indentation<=ve&&F.match(I),ae=null;if(_.indentationDiff>=4&&(re||_.prevLine.fencedCodeEnd||_.prevLine.header||ee))return F.skipToEnd(),_.indentedCode=!0,U.code;if(F.eatSpace())return null;if(J&&_.indentation<=ve&&(ae=F.match(T))&&ae[1].length<=6)return _.quote=0,_.header=ae[1].length,_.thisLine.header=!0,D.highlightFormatting&&(_.formatting="header"),_.f=_.inline,h(_);if(_.indentation<=ve&&F.eat(">"))return _.quote=J?1:_.quote+1,D.highlightFormatting&&(_.formatting="quote"),F.eatSpace(),h(_);if(!me&&!_.setext&&J&&_.indentation<=ve&&(ae=F.match(R))){var ue=ae[1]?"ol":"ul";return _.indentation=pe+F.current().length,_.list=!0,_.quote=0,_.listStack.push(_.indentation),_.em=!1,_.strong=!1,_.code=!1,_.strikethrough=!1,D.taskLists&&F.match(v,!1)&&(_.taskList=!0),_.f=_.inline,D.highlightFormatting&&(_.formatting=["list","list-"+ue]),h(_)}else{if(J&&_.indentation<=ve&&(ae=F.match(S,!0)))return _.quote=0,_.fencedEndRE=new RegExp(ae[1]+"+ *$"),_.localMode=D.fencedCodeBlockHighlighting&&M(ae[2]||D.fencedCodeBlockDefaultMode),_.localMode&&(_.localState=q.startState(_.localMode)),_.f=_.block=y,D.highlightFormatting&&(_.formatting="code-block"),_.code=-1,h(_);if(_.setext||(!he||!Te)&&!_.quote&&_.list===!1&&!_.code&&!me&&!E.test(F.string)&&(ae=F.lookAhead(1))&&(ae=ae.match(L)))return _.setext?(_.header=_.setext,_.setext=0,F.skipToEnd(),D.highlightFormatting&&(_.formatting="header")):(_.header=ae[0].charAt(0)=="="?1:2,_.setext=_.header),_.thisLine.header=!0,_.f=_.inline,h(_);if(me)return F.skipToEnd(),_.hr=!0,_.thisLine.hr=!0,U.hr;if(F.peek()==="[")return l(F,_,O)}return l(F,_,_.inline)}function w(F,_){var J=K.token(F,_.htmlState);if(!P){var ee=q.innerMode(K,_.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||_.md_inside&&F.current().indexOf(">")>-1)&&(_.f=s,_.block=m,_.htmlState=null)}return J}function y(F,_){var J=_.listStack[_.listStack.length-1]||0,ee=_.indentation<J,re=J+3;if(_.fencedEndRE&&_.indentation<=re&&(ee||F.match(_.fencedEndRE))){D.highlightFormatting&&(_.formatting="code-block");var de;return ee||(de=h(_)),_.localMode=_.localState=null,_.block=m,_.f=s,_.fencedEndRE=null,_.code=0,_.thisLine.fencedCodeEnd=!0,ee?d(F,_,_.block):de}else return _.localMode?_.localMode.token(F,_.localState):(F.skipToEnd(),U.code)}function h(F){var _=[];if(F.formatting){_.push(U.formatting),typeof F.formatting=="string"&&(F.formatting=[F.formatting]);for(var J=0;J<F.formatting.length;J++)_.push(U.formatting+"-"+F.formatting[J]),F.formatting[J]==="header"&&_.push(U.formatting+"-"+F.formatting[J]+"-"+F.header),F.formatting[J]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=F.quote?_.push(U.formatting+"-"+F.formatting[J]+"-"+F.quote):_.push("error"))}if(F.taskOpen)return _.push("meta"),_.length?_.join(" "):null;if(F.taskClosed)return _.push("property"),_.length?_.join(" "):null;if(F.linkHref?_.push(U.linkHref,"url"):(F.strong&&_.push(U.strong),F.em&&_.push(U.em),F.strikethrough&&_.push(U.strikethrough),F.emoji&&_.push(U.emoji),F.linkText&&_.push(U.linkText),F.code&&_.push(U.code),F.image&&_.push(U.image),F.imageAltText&&_.push(U.imageAltText,"link"),F.imageMarker&&_.push(U.imageMarker)),F.header&&_.push(U.header,U.header+"-"+F.header),F.quote&&(_.push(U.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=F.quote?_.push(U.quote+"-"+F.quote):_.push(U.quote+"-"+D.maxBlockquoteDepth)),F.list!==!1){var ee=(F.listStack.length-1)%3;ee?ee===1?_.push(U.list2):_.push(U.list3):_.push(U.list1)}return F.trailingSpaceNewLine?_.push("trailing-space-new-line"):F.trailingSpace&&_.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),_.length?_.join(" "):null}function c(F,_){return F.match(C,!0)?h(_):void 0}function s(F,_){var J=_.text(F,_);if(typeof J!="undefined")return J;if(_.list)return _.list=null,h(_);if(_.taskList){var ee=F.match(v,!0)[1]===" ";return ee?_.taskOpen=!0:_.taskClosed=!0,D.highlightFormatting&&(_.formatting="task"),_.taskList=!1,h(_)}if(_.taskOpen=!1,_.taskClosed=!1,_.header&&F.match(/^#+$/,!0))return D.highlightFormatting&&(_.formatting="header"),h(_);var re=F.next();if(_.linkTitle){_.linkTitle=!1;var de=re;re==="("&&(de=")"),de=(de+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Te="^\\s*(?:[^"+de+"\\\\]+|\\\\\\\\|\\\\.)"+de;if(F.match(new RegExp(Te),!0))return U.linkHref}if(re==="`"){var ve=_.formatting;D.highlightFormatting&&(_.formatting="code"),F.eatWhile("`");var pe=F.current().length;if(_.code==0&&(!_.quote||pe==1))return _.code=pe,h(_);if(pe==_.code){var he=h(_);return _.code=0,he}else return _.formatting=ve,h(_)}else if(_.code)return h(_);if(re==="\\"&&(F.next(),D.highlightFormatting)){var me=h(_),ae=U.formatting+"-escape";return me?me+" "+ae:ae}if(re==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return _.imageMarker=!0,_.image=!0,D.highlightFormatting&&(_.formatting="image"),h(_);if(re==="["&&_.imageMarker&&F.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return _.imageMarker=!1,_.imageAltText=!0,D.highlightFormatting&&(_.formatting="image"),h(_);if(re==="]"&&_.imageAltText){D.highlightFormatting&&(_.formatting="image");var me=h(_);return _.imageAltText=!1,_.image=!1,_.inline=_.f=g,me}if(re==="["&&!_.image)return _.linkText&&F.match(/^.*?\]/)||(_.linkText=!0,D.highlightFormatting&&(_.formatting="link")),h(_);if(re==="]"&&_.linkText){D.highlightFormatting&&(_.formatting="link");var me=h(_);return _.linkText=!1,_.inline=_.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?g:s,me}if(re==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){_.f=_.inline=a,D.highlightFormatting&&(_.formatting="link");var me=h(_);return me?me+=" ":me="",me+U.linkInline}if(re==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){_.f=_.inline=a,D.highlightFormatting&&(_.formatting="link");var me=h(_);return me?me+=" ":me="",me+U.linkEmail}if(D.xml&&re==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=F.string.indexOf(">",F.pos);if(ue!=-1){var be=F.string.substring(F.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(be)&&(_.md_inside=!0)}return F.backUp(1),_.htmlState=q.startState(K),d(F,_,w)}if(D.xml&&re==="<"&&F.match(/^\/\w*?>/))return _.md_inside=!1,"tag";if(re==="*"||re==="_"){for(var Ue=1,Pe=F.pos==1?" ":F.string.charAt(F.pos-2);Ue<3&&F.eat(re);)Ue++;var He=F.peek()||" ",Je=!/\s/.test(He)&&(!u.test(He)||/\s/.test(Pe)||u.test(Pe)),Le=!/\s/.test(Pe)&&(!u.test(Pe)||/\s/.test(He)||u.test(He)),De=null,ke=null;if(Ue%2&&(!_.em&&Je&&(re==="*"||!Le||u.test(Pe))?De=!0:_.em==re&&Le&&(re==="*"||!Je||u.test(He))&&(De=!1)),Ue>1&&(!_.strong&&Je&&(re==="*"||!Le||u.test(Pe))?ke=!0:_.strong==re&&Le&&(re==="*"||!Je||u.test(He))&&(ke=!1)),ke!=null||De!=null){D.highlightFormatting&&(_.formatting=De==null?"strong":ke==null?"em":"strong em"),De===!0&&(_.em=re),ke===!0&&(_.strong=re);var he=h(_);return De===!1&&(_.em=!1),ke===!1&&(_.strong=!1),he}}else if(re===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return h(_);F.backUp(1)}if(D.strikethrough){if(re==="~"&&F.eatWhile(re)){if(_.strikethrough){D.highlightFormatting&&(_.formatting="strikethrough");var he=h(_);return _.strikethrough=!1,he}else if(F.match(/^[^\s]/,!1))return _.strikethrough=!0,D.highlightFormatting&&(_.formatting="strikethrough"),h(_)}else if(re===" "&&F.match(/^~~/,!0)){if(F.peek()===" ")return h(_);F.backUp(2)}}if(D.emoji&&re===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){_.emoji=!0,D.highlightFormatting&&(_.formatting="emoji");var ze=h(_);return _.emoji=!1,ze}return re===" "&&(F.match(/^ +$/,!1)?_.trailingSpace++:_.trailingSpace&&(_.trailingSpaceNewLine=!0)),h(_)}function a(F,_){var J=F.next();if(J===">"){_.f=_.inline=s,D.highlightFormatting&&(_.formatting="link");var ee=h(_);return ee?ee+=" ":ee="",ee+U.linkInline}return F.match(/^[^>]+/,!0),U.linkInline}function g(F,_){if(F.eatSpace())return null;var J=F.next();return J==="("||J==="["?(_.f=_.inline=b(J==="("?")":"]"),D.highlightFormatting&&(_.formatting="link-string"),_.linkHref=!0,h(_)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(F){return function(_,J){var ee=_.next();if(ee===F){J.f=J.inline=s,D.highlightFormatting&&(J.formatting="link-string");var re=h(J);return J.linkHref=!1,re}return _.match(p[F]),J.linkHref=!0,h(J)}}function O(F,_){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(_.f=N,F.next(),D.highlightFormatting&&(_.formatting="link"),_.linkText=!0,h(_)):l(F,_,s)}function N(F,_){if(F.match(/^\]:/,!0)){_.f=_.inline=W,D.highlightFormatting&&(_.formatting="link");var J=h(_);return _.linkText=!1,J}return F.match(/^([^\]\\]|\\.)+/,!0),U.linkText}function W(F,_){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?_.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),_.f=_.inline=s,U.linkHref+" url")}var Q={startState:function(){return{f:m,prevLine:{stream:null},thisLine:{stream:null},block:m,htmlState:null,indentation:0,inline:s,text:c,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(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&q.copyState(K,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?q.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,_){if(_.formatting=!1,F!=_.thisLine.stream){if(_.header=0,_.hr=!1,F.match(/^\s*$/,!0))return f(_),null;if(_.prevLine=_.thisLine,_.thisLine={stream:F},_.taskList=!1,_.trailingSpace=0,_.trailingSpaceNewLine=!1,!_.localState&&(_.f=_.block,_.f!=w)){var J=F.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(_.indentation=J,_.indentationDiff=null,J>0)return null}}return _.f(F,_)},innerMode:function(F){return F.block==w?{state:F.htmlState,mode:K}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:Q}},indent:function(F,_,J){return F.block==w&&K.indent?K.indent(F.htmlState,_,J):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,_,J):q.Pass},blankLine:f,getType:h,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Q},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},lzim:function(Se,xe,V){"use strict";var q=V("E7E6"),G=V.n(q);V.d(xe,"z",function(){return G.a});var D=V("/GNS"),K=V.n(D);V.d(xe,"y",function(){return K.a});var P=V("FOrL"),M=V.n(P);V.d(xe,"s",function(){return M.a});var U=V("HpTS"),B=V.n(U);V.d(xe,"A",function(){return B.a});var I=V("tWlo"),R=V.n(I);V.d(xe,"b",function(){return R.a});var v=V("7ZXX"),T=V.n(v);V.d(xe,"m",function(){return T.a});var L=V("GABl"),C=V.n(L);V.d(xe,"f",function(){return C.a});var S=V("onxn"),E=V.n(S);V.d(xe,"o",function(){return E.a});var u=V("nKGa"),o=V.n(u);V.d(xe,"n",function(){return o.a});var l=V("4qgm"),d=V.n(l);V.d(xe,"C",function(){return d.a});var A=V("JeFH"),f=V.n(A);V.d(xe,"c",function(){return f.a});var m=V("ji0R"),w=V.n(m);V.d(xe,"j",function(){return w.a});var y=V("W6BS"),h=V.n(y);V.d(xe,"D",function(){return h.a});var c=V("kPYp"),s=V.n(c);V.d(xe,"E",function(){return s.a});var a=V("nukY"),g=V.n(a),p=V("4u4S"),b=V.n(p),O=V("yslc"),N=V.n(O),W=V("l2Kq"),Q=V.n(W);V.d(xe,"r",function(){return Q.a});var F=V("RMFE"),_=V.n(F);V.d(xe,"p",function(){return _.a});var J=V("TGq3"),ee=V.n(J),re=V("SMhR"),de=V.n(re);V.d(xe,"B",function(){return de.a});var Te=V("8/bI"),ve=V.n(Te);V.d(xe,"k",function(){return ve.a});var pe=V("JWDV"),he=V.n(pe),me=V("Xsq0"),ae=V.n(me);V.d(xe,"q",function(){return ae.a});var ue=V("Ohmc"),be=V.n(ue);V.d(xe,"d",function(){return be.a});var Ue=V("csWT"),Pe=V.n(Ue);V.d(xe,"e",function(){return Pe.a});var He=V("7v3h"),Je=V.n(He);V.d(xe,"l",function(){return Je.a});var Le=V("cRFk"),De=V.n(Le);V.d(xe,"x",function(){return De.a});var ke=V("kPWJ"),ze=V.n(ke);V.d(xe,"w",function(){return ze.a});var Ge=V("qgvg"),Ie=V.n(Ge);V.d(xe,"t",function(){return Ie.a});var we=V("FPkq"),Ze=V.n(we);V.d(xe,"v",function(){return Ze.a});var qe=V("A/g1"),Qe=V.n(qe);V.d(xe,"g",function(){return Qe.a});var Ve=V("Nmxd"),tt=V.n(Ve);V.d(xe,"h",function(){return tt.a});var Xe=V("5D2P"),Ne=V.n(Xe);V.d(xe,"i",function(){return Ne.a});var ge=V("djh8"),Fe=V.n(ge);V.d(xe,"u",function(){return Fe.a});var je=V("Jq4h"),Ee=V.n(je);V.d(xe,"a",function(){return Ee.a})},nKGa:function(Se,xe,V){Se.exports=V.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(Se,xe,V){Se.exports={icons:"icons___3O80F"}},nukY:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLOAa9CLsB4ioLSW6azUyZAFPoBdh/w4RvZYhG2lVU2ABz6AXYf8FEb2cAv21ChmxgC/Qu7q6moeHh/9KRB/JiJ20mnVuAV+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5GB0TvUK4KE6HbTqS5ma+eahgtO2ZY9fx2TlKtVziZp3Zl/FigUiZ3wOIYWZ/52pLR35oOU6oPtuw+dNdl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Se,xe,V){(function(q){q(V("VrN/"))})(function(q){"use strict";var G=q.Pos;function D(u,o){return u.line-o.line||u.ch-o.ch}var K="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",P=K+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+K+"]["+P+"]*)","g");function U(u,o,l,d){this.line=o,this.ch=l,this.cm=u,this.text=u.getLine(o),this.min=d?Math.max(d.from,u.firstLine()):u.firstLine(),this.max=d?Math.min(d.to-1,u.lastLine()):u.lastLine()}function B(u,o){var l=u.cm.getTokenTypeAt(G(u.line,o));return l&&/\btag\b/.test(l)}function I(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function R(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function v(u){for(;;){var o=u.text.indexOf(">",u.ch);if(o==-1){if(I(u))continue;return}if(!B(u,o+1)){u.ch=o+1;continue}var l=u.text.lastIndexOf("/",o),d=l>-1&&!/\S/.test(u.text.slice(l+1,o));return u.ch=o+1,d?"selfClose":"regular"}}function T(u){for(;;){var o=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(o==-1){if(R(u))continue;return}if(!B(u,o+1)){u.ch=o;continue}M.lastIndex=o,u.ch=o;var l=M.exec(u.text);if(l&&l.index==o)return l}}function L(u){for(;;){M.lastIndex=u.ch;var o=M.exec(u.text);if(!o){if(I(u))continue;return}if(!B(u,o.index+1)){u.ch=o.index+1;continue}return u.ch=o.index+o[0].length,o}}function C(u){for(;;){var o=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(o==-1){if(R(u))continue;return}if(!B(u,o+1)){u.ch=o;continue}var l=u.text.lastIndexOf("/",o),d=l>-1&&!/\S/.test(u.text.slice(l+1,o));return u.ch=o+1,d?"selfClose":"regular"}}function S(u,o){for(var l=[];;){var d=L(u),A,f=u.line,m=u.ch-(d?d[0].length:0);if(!d||!(A=v(u)))return;if(A=="selfClose")continue;if(d[1]){for(var w=l.length-1;w>=0;--w)if(l[w]==d[2]){l.length=w;break}if(w<0&&(!o||o==d[2]))return{tag:d[2],from:G(f,m),to:G(u.line,u.ch)}}else l.push(d[2])}}function E(u,o){for(var l=[];;){var d=C(u);if(!d)return;if(d=="selfClose"){T(u);continue}var A=u.line,f=u.ch,m=T(u);if(!m)return;if(m[1])l.push(m[2]);else{for(var w=l.length-1;w>=0;--w)if(l[w]==m[2]){l.length=w;break}if(w<0&&(!o||o==m[2]))return{tag:m[2],from:G(u.line,u.ch),to:G(A,f)}}}}q.registerHelper("fold","xml",function(u,o){for(var l=new U(u,o.line,0);;){var d=L(l);if(!d||l.line!=o.line)return;var A=v(l);if(!A)return;if(!d[1]&&A!="selfClose"){var f=G(l.line,l.ch),m=S(l,d[2]);return m&&D(m.from,f)>0?{from:f,to:m.from}:null}}}),q.findMatchingTag=function(u,o,l){var d=new U(u,o.line,o.ch,l);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var A=v(d),f=A&&G(d.line,d.ch),m=A&&T(d);if(!A||!m||D(d,o)>0)return;var w={from:G(d.line,d.ch),to:f,tag:m[2]};return A=="selfClose"?{open:w,close:null,at:"open"}:m[1]?{open:E(d,m[2]),close:w,at:"close"}:(d=new U(u,f.line,f.ch,l),{open:w,close:S(d,m[2]),at:"open"})},q.findEnclosingTag=function(u,o,l,d){for(var A=new U(u,o.line,o.ch,l);;){var f=E(A,d);if(!f)break;var m=new U(u,o.line,o.ch,l),w=S(m,f.tag);if(w)return{open:f,close:w}}},q.scanForClosingTag=function(u,o,l,d){var A=new U(u,o.line,o.ch,d?{from:0,to:d}:null);return S(A,l)}})},"p77/":function(Se,xe,V){},qgvg:function(Se,xe){Se.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Se,xe){const V=/[&<>"']/,q=/[&<>"']/g,G=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},P=y=>K[y];function M(y,h){if(h){if(V.test(y))return y.replace(q,P)}else if(G.test(y))return y.replace(D,P);return y}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(y){return y.replace(U,(h,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const I=/(^|[^\[])\^/g;function R(y,h){y=y.source||y,h=h||"";const c={replace:(s,a)=>(a=a.source||a,a=a.replace(I,"$1"),y=y.replace(s,a),c),getRegex:()=>new RegExp(y,h)};return c}const v=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(y,h,c){if(y){let s;try{s=decodeURIComponent(B(c)).replace(v,"").toLowerCase()}catch(a){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}h&&!T.test(c)&&(c=o(h,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(s){return null}return c}const C={},S=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(y,h){C[" "+y]||(S.test(y)?C[" "+y]=y+"/":C[" "+y]=f(y,"/",!0)),y=C[" "+y];const c=y.indexOf(":")===-1;return h.substring(0,2)==="//"?c?h:y.replace(E,"$1")+h:h.charAt(0)==="/"?c?h:y.replace(u,"$1")+h:y+h}const l={exec:function(){}};function d(y){let h=1,c,s;for(;h<arguments.length;h++){c=arguments[h];for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&(y[s]=c[s])}return y}function A(y,h){const c=y.replace(/\|/g,(g,p,b)=>{let O=!1,N=p;for(;--N>=0&&b[N]==="\\";)O=!O;return O?"|":" |"}),s=c.split(/ \|/);let a=0;if(s.length>h)s.splice(h);else for(;s.length<h;)s.push("");for(;a<s.length;a++)s[a]=s[a].trim().replace(/\\\|/g,"|");return s}function f(y,h,c){const s=y.length;if(s===0)return"";let a=0;for(;a<s;){const g=y.charAt(s-a-1);if(g===h&&!c)a++;else if(g!==h&&c)a++;else break}return y.substr(0,s-a)}function m(y,h){if(y.indexOf(h[1])===-1)return-1;const c=y.length;let s=0,a=0;for(;a<c;a++)if(y[a]==="\\")a++;else if(y[a]===h[0])s++;else if(y[a]===h[1]&&(s--,s<0))return a;return-1}function w(y){y&&y.sanitize&&!y.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")}Se.exports={escape:M,unescape:B,edit:R,cleanUrl:L,resolveUrl:o,noopTest:l,merge:d,splitCells:A,rtrim:f,findClosingBracket:m,checkSanitizeDeprecation:w}},tWlo:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZi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xfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(Se,xe,V){typeof window!="undefined"&&function(G,D){Se.exports=D()}(this,function(){return function(q){var G={};function D(K){if(G[K])return G[K].exports;var P=G[K]={i:K,l:!1,exports:{}};return q[K].call(P.exports,P,P.exports,D),P.l=!0,P.exports}return D.m=q,D.c=G,D.d=function(K,P,M){D.o(K,P)||Object.defineProperty(K,P,{enumerable:!0,get:M})},D.r=function(K){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})},D.t=function(K,P){if(P&1&&(K=D(K)),P&8)return K;if(P&4&&typeof K=="object"&&K&&K.__esModule)return K;var M=Object.create(null);if(D.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:K}),P&2&&typeof K!="string")for(var U in K)D.d(M,U,function(B){return K[B]}.bind(null,U));return M},D.n=function(K){var P=K&&K.__esModule?function(){return K.default}:function(){return K};return D.d(P,"a",P),P},D.o=function(K,P){return Object.prototype.hasOwnProperty.call(K,P)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,G,D){"use strict";var K=Object.prototype.hasOwnProperty,P="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(P=!1));function U(v,T,L){this.fn=v,this.context=T,this.once=L||!1}function B(v,T,L,C,S){if(typeof L!="function")throw new TypeError("The listener must be a function");var E=new U(L,C||v,S),u=P?P+T:T;return v._events[u]?v._events[u].fn?v._events[u]=[v._events[u],E]:v._events[u].push(E):(v._events[u]=E,v._eventsCount++),v}function I(v,T){--v._eventsCount===0?v._events=new M:delete v._events[T]}function R(){this._events=new M,this._eventsCount=0}R.prototype.eventNames=function(){var T=[],L,C;if(this._eventsCount===0)return T;for(C in L=this._events)K.call(L,C)&&T.push(P?C.slice(1):C);return Object.getOwnPropertySymbols?T.concat(Object.getOwnPropertySymbols(L)):T},R.prototype.listeners=function(T){var L=P?P+T:T,C=this._events[L];if(!C)return[];if(C.fn)return[C.fn];for(var S=0,E=C.length,u=new Array(E);S<E;S++)u[S]=C[S].fn;return u},R.prototype.listenerCount=function(T){var L=P?P+T:T,C=this._events[L];return C?C.fn?1:C.length:0},R.prototype.emit=function(T,L,C,S,E,u){var o=P?P+T:T;if(!this._events[o])return!1;var l=this._events[o],d=arguments.length,A,f;if(l.fn){l.once&&this.removeListener(T,l.fn,void 0,!0);switch(d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,L),!0;case 3:return l.fn.call(l.context,L,C),!0;case 4:return l.fn.call(l.context,L,C,S),!0;case 5:return l.fn.call(l.context,L,C,S,E),!0;case 6:return l.fn.call(l.context,L,C,S,E,u),!0}for(f=1,A=new Array(d-1);f<d;f++)A[f-1]=arguments[f];l.fn.apply(l.context,A)}else{var m=l.length,w;for(f=0;f<m;f++){l[f].once&&this.removeListener(T,l[f].fn,void 0,!0);switch(d){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,L);break;case 3:l[f].fn.call(l[f].context,L,C);break;case 4:l[f].fn.call(l[f].context,L,C,S);break;default:if(!A)for(w=1,A=new Array(d-1);w<d;w++)A[w-1]=arguments[w];l[f].fn.apply(l[f].context,A)}}}return!0},R.prototype.on=function(T,L,C){return B(this,T,L,C,!1)},R.prototype.once=function(T,L,C){return B(this,T,L,C,!0)},R.prototype.removeListener=function(T,L,C,S){var E=P?P+T:T;if(!this._events[E])return this;if(!L)return I(this,E),this;var u=this._events[E];if(u.fn)u.fn===L&&(!S||u.once)&&(!C||u.context===C)&&I(this,E);else{for(var o=0,l=[],d=u.length;o<d;o++)(u[o].fn!==L||S&&!u[o].once||C&&u[o].context!==C)&&l.push(u[o]);l.length?this._events[E]=l.length===1?l[0]:l:I(this,E)}return this},R.prototype.removeAllListeners=function(T){var L;return T?(L=P?P+T:T,this._events[L]&&I(this,L)):(this._events=new M,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=P,R.EventEmitter=R,q.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,G,D){(function(K){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,U=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,I={buildAbsoluteURL:function(R,v,T){if(T=T||{},R=R.trim(),v=v.trim(),!v){if(!T.alwaysNormalize)return R;var L=I.parseURL(R);if(!L)throw new Error("Error trying to parse base URL.");return L.path=I.normalizePath(L.path),I.buildURLFromParts(L)}var C=I.parseURL(v);if(!C)throw new Error("Error trying to parse relative URL.");if(C.scheme)return T.alwaysNormalize?(C.path=I.normalizePath(C.path),I.buildURLFromParts(C)):v;var S=I.parseURL(R);if(!S)throw new Error("Error trying to parse base URL.");if(!S.netLoc&&S.path&&S.path[0]!=="/"){var E=M.exec(S.path);S.netLoc=E[1],S.path=E[2]}S.netLoc&&!S.path&&(S.path="/");var u={scheme:S.scheme,netLoc:C.netLoc,path:null,params:C.params,query:C.query,fragment:C.fragment};if(!C.netLoc&&(u.netLoc=S.netLoc,C.path[0]!=="/"))if(!C.path)u.path=S.path,C.params||(u.params=S.params,C.query||(u.query=S.query));else{var o=S.path,l=o.substring(0,o.lastIndexOf("/")+1)+C.path;u.path=I.normalizePath(l)}return u.path===null&&(u.path=T.alwaysNormalize?I.normalizePath(C.path):C.path),I.buildURLFromParts(u)},parseURL:function(R){var v=P.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(U,"");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}};q.exports=I})(this)},"./node_modules/webworkify-webpack/index.js":function(q,G,D){function K(T){var L={};function C(E){if(L[E])return L[E].exports;var u=L[E]={i:E,l:!1,exports:{}};return T[E].call(u.exports,u,u.exports,C),u.l=!0,u.exports}C.m=T,C.c=L,C.i=function(E){return E},C.d=function(E,u,o){C.o(E,u)||Object.defineProperty(E,u,{configurable:!1,enumerable:!0,get:o})},C.r=function(E){Object.defineProperty(E,"__esModule",{value:!0})},C.n=function(E){var u=E&&E.__esModule?function(){return E.default}:function(){return E};return C.d(u,"a",u),u},C.o=function(E,u){return Object.prototype.hasOwnProperty.call(E,u)},C.p="/",C.oe=function(E){throw console.error(E),E};var S=C(C.s=ENTRY_MODULE);return S.default||S}var P="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function U(T){return(T+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function B(T){return!isNaN(1*T)}function I(T,L,C){var S={};S[C]=[];var E=L.toString(),u=E.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return S;for(var o=u[1],l=new RegExp("(\\\\n|\\W)"+U(o)+M,"g"),d;d=l.exec(E);){if(d[3]==="dll-reference")continue;S[C].push(d[3])}for(l=new RegExp("\\("+U(o)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+M,"g");d=l.exec(E);)T[d[2]]||(S[C].push(d[1]),T[d[2]]=D(d[1]).m),S[d[2]]=S[d[2]]||[],S[d[2]].push(d[4]);for(var A=Object.keys(S),f=0;f<A.length;f++)for(var m=0;m<S[A[f]].length;m++)B(S[A[f]][m])&&(S[A[f]][m]=1*S[A[f]][m]);return S}function R(T){var L=Object.keys(T);return L.reduce(function(C,S){return C||T[S].length>0},!1)}function v(T,L){for(var C={main:[L]},S={main:[]},E={main:{}};R(C);)for(var u=Object.keys(C),o=0;o<u.length;o++){var l=u[o],d=C[l],A=d.pop();if(E[l]=E[l]||{},E[l][A]||!T[l][A])continue;E[l][A]=!0,S[l]=S[l]||[],S[l].push(A);for(var f=I(T,T[l][A],l),m=Object.keys(f),w=0;w<m.length;w++)C[m[w]]=C[m[w]]||[],C[m[w]]=C[m[w]].concat(f[m[w]])}return S}q.exports=function(T,L){L=L||{};var C={main:D.m},S=L.all?{main:Object.keys(C.main)}:v(C,T),E="";Object.keys(S).filter(function(A){return A!=="main"}).forEach(function(A){for(var f=0;S[A][f];)f++;S[A].push(f),C[A][f]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",E=E+"var "+A+" = ("+K.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+S[A].map(function(m){return""+JSON.stringify(m)+": "+C[A][m].toString()}).join(",")+`});
|
|
`}),E=E+"new (("+K.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+S.main.map(function(A){return""+JSON.stringify(A)+": "+C.main[A].toString()}).join(",")+"}))(self);";var u=new window.Blob([E],{type:"text/javascript"});if(L.bare)return u;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,l=o.createObjectURL(u),d=new window.Worker(l);return d.objectURL=l,d}},"./src/config.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"hlsDefaultConfig",function(){return w}),D.d(G,"mergeConfig",function(){return h}),D.d(G,"enableStreamingMode",function(){return c});var K=D("./src/controller/abr-controller.ts"),P=D("./src/controller/audio-stream-controller.ts"),M=D("./src/controller/audio-track-controller.ts"),U=D("./src/controller/subtitle-stream-controller.ts"),B=D("./src/controller/subtitle-track-controller.ts"),I=D("./src/controller/buffer-controller.ts"),R=D("./src/controller/timeline-controller.ts"),v=D("./src/controller/cap-level-controller.ts"),T=D("./src/controller/fps-controller.ts"),L=D("./src/controller/eme-controller.ts"),C=D("./src/controller/cmcd-controller.ts"),S=D("./src/utils/xhr-loader.ts"),E=D("./src/utils/fetch-loader.ts"),u=D("./src/utils/cues.ts"),o=D("./src/utils/mediakeys-helper.ts"),l=D("./src/utils/logger.ts");function d(){return d=Object.assign||function(s){for(var a=1;a<arguments.length;a++){var g=arguments[a];for(var p in g)Object.prototype.hasOwnProperty.call(g,p)&&(s[p]=g[p])}return s},d.apply(this,arguments)}function A(s,a){var g=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);a&&(p=p.filter(function(b){return Object.getOwnPropertyDescriptor(s,b).enumerable})),g.push.apply(g,p)}return g}function f(s){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?A(Object(g),!0).forEach(function(p){m(s,p,g[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(g)):A(Object(g)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(g,p))})}return s}function m(s,a,g){return a in s?Object.defineProperty(s,a,{value:g,enumerable:!0,configurable:!0,writable:!0}):s[a]=g,s}var w=f(f({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:K.default,bufferController:I.default,capLevelController:v.default,fpsController:T.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:o.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},y()),{},{subtitleStreamController:U.SubtitleStreamController,subtitleTrackController:B.default,timelineController:R.TimelineController,audioStreamController:P.default,audioTrackController:M.default,emeController:L.default,cmcdController:C.default});function y(){return{cueHandler:u.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 h(s,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},s,a)}function c(s){var a=s.loader;if(a!==E.default&&a!==S.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var g=Object(E.fetchSupported)();g&&(s.loader=E.default,s.progressive=!0,s.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/utils/ewma-bandwidth-estimator.ts"),M=D("./src/events.ts"),U=D("./src/utils/buffer-helper.ts"),B=D("./src/errors.ts"),I=D("./src/types/loader.ts"),R=D("./src/utils/logger.ts");function v(C,S){for(var E=0;E<S.length;E++){var u=S[E];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(C,u.key,u)}}function T(C,S,E){return S&&v(C.prototype,S),E&&v(C,E),C}var L=function(){function C(E){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=E;var u=E.config;this.bwEstimator=new P.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var S=C.prototype;return S.registerListeners=function(){var u=this.hls;u.on(M.Events.FRAG_LOADING,this.onFragLoading,this),u.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(M.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var u=this.hls;u.off(M.Events.FRAG_LOADING,this.onFragLoading,this),u.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.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(u,o){var l=o.frag;if(l.type===I.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=l,this.partCurrent=(d=o.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},S.onLevelLoaded=function(u,o){var l=this.hls.config;o.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},S._abandonRulesCheck=function(){var u=this.fragCurrent,o=this.partCurrent,l=this.hls,d=l.autoLevelEnabled,A=l.config,f=l.media;if(!u||!f)return;var m=o?o.stats:u.stats,w=o?o.duration:u.duration;if(m.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||f.paused||!f.playbackRate||!f.readyState)return;var y=performance.now()-m.loading.start,h=Math.abs(f.playbackRate);if(y<=500*w/h)return;var c=l.levels,s=l.minAutoLevel,a=c[u.level],g=m.total||Math.max(m.loaded,Math.round(w*a.maxBitrate/8)),p=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/y),b=(g-m.loaded)/p,O=f.currentTime,N=(U.BufferHelper.bufferInfo(f,O,A.maxBufferHole).end-O)/h;if(N>=2*w/h||b<=N)return;var W=Number.POSITIVE_INFINITY,Q;for(Q=u.level-1;Q>s;Q--){var F=c[Q].maxBitrate;if(W=w*F/(8*.8*p),W<N)break}if(W>=b)return;var _=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+u.sn+(o?" part "+o.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Q+`
|
|
Current BW estimate: `+(Object(K.isFiniteNumber)(_)?(_/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+b.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+W.toFixed(3)+` s
|
|
Time to underbuffer: `+N.toFixed(3)+" s"),l.nextLoadLevel=Q,this.bwEstimator.sample(y,m.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),l.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:o,stats:m})},S.onFragLoaded=function(u,o){var l=o.frag,d=o.part;if(l.type===I.PlaylistLevelType.MAIN&&Object(K.isFiniteNumber)(l.sn)){var A=d?d.stats:l.stats,f=d?d.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[l.level],w=(m.loaded?m.loaded.bytes:0)+A.loaded,y=(m.loaded?m.loaded.duration:0)+f;m.loaded={bytes:w,duration:y},m.realBitrate=Math.round(8*w/y)}if(l.bitrateTest){var h={stats:A,frag:l,part:d,id:l.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,h),l.bitrateTest=!1}}},S.onFragBuffered=function(u,o){var l=o.frag,d=o.part,A=d?d.stats:l.stats;if(A.aborted)return;if(l.type!==I.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var f=A.parsing.end-A.loading.start;this.bwEstimator.sample(f,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=f/1e3:this.bitrateTestDelay=0},S.onError=function(u,o){switch(o.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 u=this.fragCurrent,o=this.partCurrent,l=this.hls,d=l.maxAutoLevel,A=l.config,f=l.minAutoLevel,m=l.media,w=o?o.duration:u?u.duration:0,y=m?m.currentTime:0,h=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,s=(U.BufferHelper.bufferInfo(m,y,A.maxBufferHole).end-y)/h,a=this.findBestLevel(c,f,d,s,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(a>=0)return a;R.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=w?Math.min(w,A.maxStarvationDelay):A.maxStarvationDelay,p=A.abrBandWidthFactor,b=A.abrBandWidthUpFactor;if(!s){var O=this.bitrateTestDelay;if(O){var N=w?Math.min(w,A.maxLoadingDelay):A.maxLoadingDelay;g=N-O,R.logger.trace("bitrate test took "+Math.round(1e3*O)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),p=b=1}}return a=this.findBestLevel(c,f,d,s+g,p,b),Math.max(a,0)},S.findBestLevel=function(u,o,l,d,A,f){for(var m,w=this.fragCurrent,y=this.partCurrent,h=this.lastLoadedFragLevel,c=this.hls.levels,s=c[h],a=!!(s!=null&&(m=s.details)!==null&&m!==void 0&&m.live),g=s==null?void 0:s.codecSet,p=y?y.duration:w?w.duration:0,b=l;b>=o;b--){var O=c[b];if(!O||g&&O.codecSet!==g)continue;var N=O.details,W=(y?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||p,Q=void 0;b<=h?Q=A*u:Q=f*u;var F=c[b].maxBitrate,_=F*W/Q;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(Q)+"/"+F+"/"+W+"/"+d+"/"+_),Q>F&&(!_||a&&!this.bitrateTestDelay||_<d))return b}return-1},T(C,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,o=this.bwEstimator;if(u!==-1&&(!o||!o.canEstimate()))return u;var l=this.getNextABRAutoLevel();return u!==-1&&(l=Math.min(u,l)),l},set:function(u){this._nextAutoLevel=u}}]),C}();G.default=L},"./src/controller/audio-stream-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/controller/base-stream-controller.ts"),M=D("./src/events.ts"),U=D("./src/utils/buffer-helper.ts"),B=D("./src/controller/fragment-tracker.ts"),I=D("./src/types/level.ts"),R=D("./src/types/loader.ts"),v=D("./src/loader/fragment.ts"),T=D("./src/demux/chunk-cache.ts"),L=D("./src/demux/transmuxer-interface.ts"),C=D("./src/types/transmuxer.ts"),S=D("./src/controller/fragment-finders.ts"),E=D("./src/utils/discontinuities.ts"),u=D("./src/errors.ts"),o=D("./src/utils/logger.ts");function l(){return l=Object.assign||function(w){for(var y=1;y<arguments.length;y++){var h=arguments[y];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(w[c]=h[c])}return w},l.apply(this,arguments)}function d(w,y){w.prototype=Object.create(y.prototype),w.prototype.constructor=w,A(w,y)}function A(w,y){return A=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},A(w,y)}var f=100,m=function(w){d(y,w);function y(c,s){var a;return a=w.call(this,c,s,"[audio-stream-controller]")||this,a.videoBuffer=null,a.videoTrackCC=-1,a.waitingVideoCC=-1,a.audioSwitch=!1,a.trackId=-1,a.waitingData=null,a.mainDetails=null,a.bufferFlushed=!1,a._registerListeners(),a}var h=y.prototype;return h.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},h._registerListeners=function(){var s=this.hls;s.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(M.Events.ERROR,this.onError,this),s.on(M.Events.BUFFER_RESET,this.onBufferReset,this),s.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},h._unregisterListeners=function(){var s=this.hls;s.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(M.Events.ERROR,this.onError,this),s.off(M.Events.BUFFER_RESET,this.onBufferReset,this),s.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},h.onInitPtsFound=function(s,a){var g=a.frag,p=a.id,b=a.initPTS;if(p==="main"){var O=g.cc;this.initPTS[g.cc]=b,this.log("InitPTS for cc: "+O+" found from main: "+b),this.videoTrackCC=O,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},h.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=P.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(f),this.fragLoadError=0,a>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},h.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var s,a=this.levels,g=this.trackId,p=a==null||((s=a[g])===null||s===void 0)?void 0:s.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var b,O=performance.now(),N=this.retryDate;(!N||O>=N||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var W=this.waitingData;if(W){var Q=W.frag,F=W.part,_=W.cache,J=W.complete;if(this.initPTS[Q.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var ee=_.flush(),re={frag:Q,part:F,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(re),J&&w.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+Q.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var de=this.getLoadPosition(),Te=U.BufferHelper.bufferInfo(this.mediaBuffer,de,this.config.maxBufferHole),ve=Object(S.fragmentWithinToleranceTest)(Te.end,this.config.maxFragLookUpTolerance,Q);ve<0&&(o.logger.log("Waiting fragment cc ("+Q.cc+") @ "+Q.start+" cancelled because another fragment at "+Te.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},h.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},h.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:s,g=a.buffered;!this.loadedmetadata&&g.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},h.doTickIdle=function(){var s,a,g=this.hls,p=this.levels,b=this.media,O=this.trackId,N=g.config;if(!p||!p[O])return;if(!b&&(this.startFragRequested||!N.startFragPrefetch))return;var W=p[O],Q=W.details;if(!Q||Q.live&&this.levelLastLoaded!==O||this.waitForCdnTuneIn(Q)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(F===null)return;var _=F.len,J=this.getMaxBufferLength(),ee=this.audioSwitch;if(_>=J&&!ee)return;if(!ee&&this._streamEnded(F,Q)){g.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var re=Q.fragments,de=re[0].start,Te=F.end;if(ee){var ve=this.getLoadPosition();Te=ve,Q.PTSKnown&&ve<de&&((F.end>de||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=de+.05))}var pe=this.getNextFragment(Te,Q);if(!pe){this.bufferFlushed=!0;return}((s=pe.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((a=pe.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(pe,Q):this.loadFragment(pe,Q,Te)},h.getMaxBufferLength=function(){var s=w.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return a===null?s:Math.max(s,a.len)},h.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},h.onAudioTracksUpdated=function(s,a){var g=a.audioTracks;this.resetTransmuxer(),this.levels=g.map(function(p){return new I.Level(p)})},h.onAudioTrackSwitching=function(s,a){var g=!!a.url;this.trackId=a.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),g?this.setInterval(f):this.resetTransmuxer(),g?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},h.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},h.onLevelLoaded=function(s,a){this.mainDetails=a.details},h.onAudioTrackLoaded=function(s,a){var g,p=this.levels,b=a.details,O=a.id;if(!p){this.warn("Audio tracks were reset while loading level "+O);return}this.log("Track "+O+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var N=p[O],W=0;if(b.live||(g=N.details)!==null&&g!==void 0&&g.live){var Q=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!Q)return;!N.details&&b.hasProgramDateTime&&Q.hasProgramDateTime?(Object(E.alignMediaPlaylistByPDT)(b,Q),W=b.fragments[0].start):W=this.alignPlaylists(b,N.details)}N.details=b,this.levelLastLoaded=O,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(N.details,W),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=P.State.IDLE),this.tick()},h._handleFragmentLoadProgress=function(s){var a,g=s.frag,p=s.part,b=s.payload,O=this.config,N=this.trackId,W=this.levels;if(!W){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var Q=W[N];console.assert(Q,"Audio track is defined on fragment load progress");var F=Q.details;console.assert(F,"Audio track details are defined on fragment load progress");var _=O.defaultAudioCodec||Q.audioCodec||"mp4a.40.2",J=this.transmuxer;J||(J=this.transmuxer=new L.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[g.cc],re=(a=g.initSegment)===null||a===void 0?void 0:a.data;if(ee!==void 0){var de=!1,Te=p?p.index:-1,ve=Te!==-1,pe=new C.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,b.byteLength,Te,ve);J.push(b,re,_,"",g,p,F.totalduration,de,pe,ee)}else{o.logger.log("Unknown video PTS for cc "+g.cc+", waiting for video PTS before demuxing audio frag "+g.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+N);var he=this.waitingData=this.waitingData||{frag:g,part:p,cache:new T.default,complete:!1},me=he.cache;me.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},h._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,s)},h.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},h.onBufferCreated=function(s,a){var g=a.tracks.audio;g&&(this.mediaBuffer=g.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},h.onFragBuffered=function(s,a){var g=a.frag,p=a.part;if(g.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(p?" p: "+p.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}g.sn!=="initSegment"&&(this.fragPrevious=g,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(g,p)},h.onError=function(s,a){switch(a.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,a);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=a.fatal?P.State.ERROR:P.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var g=!0,p=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);p&&p.len>.5&&(g=!this.reduceMaxBufferLength(p.len)),g&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},h.onBufferFlushed=function(s,a){var g=a.type;g===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},h._handleTransmuxComplete=function(s){var a,g="audio",p=this.hls,b=s.remuxResult,O=s.chunkMeta,N=this.getCurrentContext(O);if(!N){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var W=N.frag,Q=N.part,F=b.audio,_=b.text,J=b.id3,ee=b.initSegment;if(this.fragContextChanged(W))return;if(this.state=P.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,W,O),p.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:g,tracks:ee.tracks})),F){var re=F.startPTS,de=F.endPTS,Te=F.startDTS,ve=F.endDTS;Q&&(Q.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:re,endPTS:de,startDTS:Te,endDTS:ve}),W.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,re,de,Te,ve),this.bufferFragmentData(F,W,Q,O)}if(J!=null&&(a=J.samples)!==null&&a!==void 0&&a.length){var pe=l({frag:W,id:g},J);p.trigger(M.Events.FRAG_PARSING_METADATA,pe)}if(_){var he=l({frag:W,id:g},_);p.trigger(M.Events.FRAG_PARSING_USERDATA,he)}},h._bufferInitSegment=function(s,a,g){if(this.state!==P.State.PARSING)return;s.video&&delete s.video;var p=s.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,s);var b=p.initSegment;if(b!=null&&b.byteLength){var O={type:"audio",frag:a,part:null,chunkMeta:g,parent:a.type,data:b};this.hls.trigger(M.Events.BUFFER_APPENDING,O)}this.tick()},h.loadFragment=function(s,a,g){var p=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||p===B.FragmentState.NOT_LOADED||p===B.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):a.live&&!Object(K.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,s,a,g)))},h.completeAudioSwitch=function(){var s=this.hls,a=this.media,g=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:g})},y}(P.default);G.default=m},"./src/controller/audio-track-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/controller/base-playlist-controller.ts"),U=D("./src/types/loader.ts");function B(L,C){for(var S=0;S<C.length;S++){var E=C[S];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(L,E.key,E)}}function I(L,C,S){return C&&B(L.prototype,C),S&&B(L,S),L}function R(L,C){L.prototype=Object.create(C.prototype),L.prototype.constructor=L,v(L,C)}function v(L,C){return v=Object.setPrototypeOf||function(E,u){return E.__proto__=u,E},v(L,C)}var T=function(L){R(C,L);function C(E){var u;return u=L.call(this,E,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var S=C.prototype;return S.registerListeners=function(){var u=this.hls;u.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(K.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var u=this.hls;u.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(K.Events.ERROR,this.onError,this)},S.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,L.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(u,o){this.tracks=o.audioTracks||[]},S.onAudioTrackLoaded=function(u,o){var l=o.id,d=o.details,A=this.tracksInGroup[l];if(!A){this.warn("Invalid audio track id "+l);return}var f=A.details;A.details=o.details,this.log("audioTrack "+l+" loaded ["+d.startSN+"-"+d.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,o,f))},S.onLevelLoading=function(u,o){this.switchLevel(o.level)},S.onLevelSwitching=function(u,o){this.switchLevel(o.level)},S.switchLevel=function(u){var o=this.hls.levels[u];if(!(o!=null&&o.audioGroupIds))return;var l=o.audioGroupIds[o.urlId];if(this.groupId!==l){this.groupId=l;var d=this.tracks.filter(function(f){return!l||f.groupId===l});this.selectDefaultTrack&&!d.some(function(f){return f.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var A={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(K.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},S.onError=function(u,o){if(L.prototype.onError.call(this,u,o),o.fatal||!o.context)return;o.context.type===U.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},S.setAudioTrack=function(u){var o=this.tracksInGroup;if(u<0||u>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=o[this.trackId];this.log("Now switching to audio-track index "+u);var d=o[u],A=d.id,f=d.groupId,m=f===void 0?"":f,w=d.name,y=d.type,h=d.url;if(this.trackId=u,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(K.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:m,name:w,type:y,url:h}),d.details&&!d.details.live)return;var c=this.switchParams(d.url,l==null?void 0:l.details);this.loadPlaylist(c)},S.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,l=this.findTrackId(o)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},S.findTrackId=function(u){for(var o=this.tracksInGroup,l=0;l<o.length;l++){var d=o[l];if((!this.selectDefaultTrack||d.default)&&(!u||u===d.name))return d.id}return-1},S.loadPlaylist=function(u){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var l=o.id,d=o.groupId,A=o.url;if(u)try{A=u.addDirectives(A)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(K.Events.AUDIO_TRACK_LOADING,{url:A,id:l,groupId:d,deliveryDirectives:u||null})}},I(C,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),C}(M.default);G.default=T},"./src/controller/base-playlist-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return I});var K=D("./src/polyfills/number.ts"),P=D("./src/types/level.ts"),M=D("./src/controller/level-helper.ts"),U=D("./src/utils/logger.ts"),B=D("./src/errors.ts"),I=function(){function R(T,L){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=U.logger.log.bind(U.logger,L+":"),this.warn=U.logger.warn.bind(U.logger,L+":"),this.hls=T}var v=R.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(L,C){C.fatal&&C.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(L,C){var S=C==null?void 0:C.renditionReports;if(S)for(var E=0;E<S.length;E++){var u=S[E],o=""+u.URI;if(o===L.substr(-o.length)){var l=parseInt(u["LAST-MSN"]),d=parseInt(u["LAST-PART"]);if(C&&this.hls.config.lowLatencyMode){var A=Math.min(C.age-C.partTarget,C.targetduration);d!==void 0&&A>C.partTarget&&(d+=1)}if(Object(K.isFiniteNumber)(l))return new P.HlsUrlParameters(l,Object(K.isFiniteNumber)(d)?d:void 0,P.HlsSkip.No)}}},v.loadPlaylist=function(L){},v.shouldLoadTrack=function(L){return this.canLoad&&L&&!!L.url&&(!L.details||L.details.live)},v.playlistLoaded=function(L,C,S){var E=this,u=C.details,o=C.stats,l=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(u.advancedDateTime=Date.now()-l,u.live||S!=null&&S.live){if(u.reloaded(S),S&&this.log("live playlist "+L+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),S&&u.fragments.length>0&&Object(M.mergeDetails)(S,u),!this.canLoad||!u.live)return;var d,A=void 0,f=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var m=this.hls.config.lowLatencyMode,w=u.lastPartSn,y=u.endSN,h=u.lastPartIndex,c=h!==-1,s=w===y,a=m?0:h;c?(A=s?y+1:w,f=s?a:h+1):A=y+1;var g=u.age,p=g+u.ageHeader,b=Math.min(p-u.partTarget,u.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: "+u.age),b=0;else{var O=Math.floor(b/u.targetduration);if(A+=O,f!==void 0){var N=Math.round(b%u.targetduration/u.partTarget);f+=N}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+b+" skip sn "+O+" to part "+f)}u.tuneInGoal=b}if(d=this.getDeliveryDirectives(u,C.deliveryDirectives,A,f),m||!s){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(u,C.deliveryDirectives,A,f);var W=Object(M.computeReloadInterval)(u,o);A!==void 0&&u.canBlockReload&&(W-=u.partTarget||1),this.log("reload live playlist "+L+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return E.loadPlaylist(d)},W)}else this.clearTimer()},v.getDeliveryDirectives=function(L,C,S,E){var u=Object(P.getSkipValue)(L,S);return C!=null&&C.skip&&L.deltaUpdateFailed&&(S=C.msn,E=C.part,u=P.HlsSkip.No),new P.HlsUrlParameters(S,E,u)},v.retryLoadingOrFail=function(L){var C=this,S=this.hls.config,E=this.retryCount<S.levelLoadingMaxRetry;if(E){var u;if(this.retryCount++,L.details.indexOf("LoadTimeOut")>-1&&(u=L.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+L.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*S.levelLoadingRetryDelay,S.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return C.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+L.details+'"')}}else this.warn('cannot recover from error "'+L.details+'"'),this.clearTimer(),L.fatal=!0;return E},R}()},"./src/controller/base-stream-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"State",function(){return y}),D.d(G,"default",function(){return h});var K=D("./src/polyfills/number.ts"),P=D("./src/task-loop.ts"),M=D("./src/controller/fragment-tracker.ts"),U=D("./src/utils/buffer-helper.ts"),B=D("./src/utils/logger.ts"),I=D("./src/events.ts"),R=D("./src/errors.ts"),v=D("./src/types/transmuxer.ts"),T=D("./src/utils/mp4-tools.ts"),L=D("./src/utils/discontinuities.ts"),C=D("./src/controller/fragment-finders.ts"),S=D("./src/controller/level-helper.ts"),E=D("./src/loader/fragment-loader.ts"),u=D("./src/crypt/decrypter.ts"),o=D("./src/utils/time-ranges.ts"),l=D("./src/types/loader.ts");function d(c,s){for(var a=0;a<s.length;a++){var g=s[a];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(c,g.key,g)}}function A(c,s,a){return s&&d(c.prototype,s),a&&d(c,a),c}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function m(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,w(c,s)}function w(c,s){return w=Object.setPrototypeOf||function(g,p){return g.__proto__=p,g},w(c,s)}var y={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"},h=function(c){m(s,c);function s(g,p,b){var O;return O=c.call(this)||this,O.hls=void 0,O.fragPrevious=null,O.fragCurrent=null,O.fragmentTracker=void 0,O.transmuxer=null,O._state=y.STOPPED,O.media=void 0,O.mediaBuffer=void 0,O.config=void 0,O.bitrateTest=!1,O.lastCurrentTime=0,O.nextLoadPosition=0,O.startPosition=0,O.loadedmetadata=!1,O.fragLoadError=0,O.retryDate=0,O.levels=null,O.fragmentLoader=void 0,O.levelLastLoaded=null,O.startFragRequested=!1,O.decrypter=void 0,O.initPTS=[],O.onvseeking=null,O.onvended=null,O.logPrefix="",O.log=void 0,O.warn=void 0,O.logPrefix=b,O.log=B.logger.log.bind(B.logger,b+":"),O.warn=B.logger.warn.bind(B.logger,b+":"),O.hls=g,O.fragmentLoader=new E.default(g.config),O.fragmentTracker=p,O.config=g.config,O.decrypter=new u.default(g,g.config),g.on(I.Events.KEY_LOADED,O.onKeyLoaded,f(O)),O}var a=s.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(p){},a.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=y.STOPPED},a._streamEnded=function(p,b){var O=this.fragCurrent,N=this.fragmentTracker;if(!b.live&&O&&O.sn===b.endSN&&!p.nextStart){var W=N.getState(O);return W===M.FragmentState.PARTIAL||W===M.FragmentState.OK}return!1},a.onMediaAttached=function(p,b){var O=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),O.addEventListener("seeking",this.onvseeking),O.addEventListener("ended",this.onvended);var N=this.config;this.levels&&N.autoStartLoad&&this.state===y.STOPPED&&this.startLoad(N.startPosition)},a.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},a.onMediaSeeking=function(){var p=this.config,b=this.fragCurrent,O=this.media,N=this.mediaBuffer,W=this.state,Q=O?O.currentTime:0,F=U.BufferHelper.bufferInfo(N||O,Q,p.maxBufferHole);if(this.log("media seeking to "+(Object(K.isFiniteNumber)(Q)?Q.toFixed(3):Q)+", state: "+W),W===y.ENDED)this.resetLoadingState();else if(b&&!F.len){var _=p.maxFragLookUpTolerance,J=b.start-_,ee=b.start+b.duration+_,re=Q>ee;(Q<J||re)&&(re&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}O&&(this.lastCurrentTime=Q),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=Q),this.tickImmediate()},a.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},a.onKeyLoaded=function(p,b){if(this.state!==y.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=y.IDLE;var O=this.levels[b.frag.level].details;O&&this.loadFragment(b.frag,O,b.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=y.STOPPED,this.hls.off(I.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,c.prototype.onHandlerDestroyed.call(this)},a.loadKey=function(p,b){this.log("Loading key for "+p.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=y.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(I.Events.KEY_LOADING,{frag:p})},a.loadFragment=function(p,b,O){this._loadFragForPlayback(p,b,O)},a._loadFragForPlayback=function(p,b,O){var N=this,W=function(F){if(N.fragContextChanged(p)){N.warn("Fragment "+p.sn+(F.part?" p: "+F.part.index:"")+" of level "+p.level+" was dropped during download."),N.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,N._handleFragmentLoadProgress(F)};this._doFragLoad(p,b,O,W).then(function(Q){if(!Q)return;N.fragLoadError=0;var F=N.state;if(N.fragContextChanged(p)){(F===y.FRAG_LOADING||F===y.BACKTRACKING||!N.fragCurrent&&F===y.PARSING)&&(N.fragmentTracker.removeFragment(p),N.state=y.IDLE);return}if("payload"in Q&&(N.log("Loaded fragment "+p.sn+" of level "+p.level),N.hls.trigger(I.Events.FRAG_LOADED,Q),N.state===y.BACKTRACKING)){N.fragmentTracker.backtrack(p,Q),N.resetFragmentLoading(p);return}N._handleFragmentLoadComplete(Q)}).catch(function(Q){N.warn(Q),N.resetFragmentLoading(p)})},a.flushMainBuffer=function(p,b,O){if(O===void 0&&(O=null),!(p-b))return;var N={startOffset:p,endOffset:b,type:O};this.fragLoadError=0,this.hls.trigger(I.Events.BUFFER_FLUSHING,N)},a._loadInitSegment=function(p){var b=this;this._doFragLoad(p).then(function(O){if(!O||b.fragContextChanged(p)||!b.levels)throw new Error("init load aborted");return O}).then(function(O){var N=b.hls,W=O.payload,Q=p.decryptdata;if(W&&W.byteLength>0&&Q&&Q.key&&Q.iv&&Q.method==="AES-128"){var F=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(W),Q.key.buffer,Q.iv.buffer).then(function(_){var J=self.performance.now();return N.trigger(I.Events.FRAG_DECRYPTED,{frag:p,payload:_,stats:{tstart:F,tdecrypt:J}}),O.payload=_,O})}return O}).then(function(O){var N=b.fragCurrent,W=b.hls,Q=b.levels;if(!Q)throw new Error("init load aborted, missing levels");var F=Q[p.level].details;console.assert(F,"Level details are defined when init segment is loaded");var _=p.stats;b.state=y.IDLE,b.fragLoadError=0,p.data=new Uint8Array(O.payload),_.parsing.start=_.buffering.start=self.performance.now(),_.parsing.end=_.buffering.end=self.performance.now(),O.frag===N&&W.trigger(I.Events.FRAG_BUFFERED,{stats:_,frag:N,part:null,id:p.type}),b.tick()}).catch(function(O){b.warn(O),b.resetFragmentLoading(p)})},a.fragContextChanged=function(p){var b=this.fragCurrent;return!p||!b||p.level!==b.level||p.sn!==b.sn||p.urlId!==b.urlId},a.fragBufferedComplete=function(p,b){var O=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+o.default.toString(U.BufferHelper.getBuffered(O))),this.state=y.IDLE,this.tick()},a._handleFragmentLoadComplete=function(p){var b=this.transmuxer;if(!b)return;var O=p.frag,N=p.part,W=p.partsLoaded,Q=!W||W.length===0||W.some(function(_){return!_}),F=new v.ChunkMetadata(O.level,O.sn,O.stats.chunkCount+1,0,N?N.index:-1,!Q);b.flush(F)},a._handleFragmentLoadProgress=function(p){},a._doFragLoad=function(p,b,O,N){var W=this;if(O===void 0&&(O=null),!this.levels)throw new Error("frag load aborted, missing levels");if(O=Math.max(p.start,O||0),this.config.lowLatencyMode&&b){var Q=b.partList;if(Q&&N){O>p.end&&b.fragmentHint&&(p=b.fragmentHint);var F=this.getNextPart(Q,p,O);if(F>-1){var _=Q[F];return this.log("Loading part sn: "+p.sn+" p: "+_.index+" cc: "+p.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+F+"-"+(Q.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(O.toFixed(3))),this.nextLoadPosition=_.start+_.duration,this.state=y.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:p,part:Q[F],targetBufferTime:O}),this.doFragPartsLoad(p,Q,F,N).catch(function(J){return W.handleFragLoadError(J)})}else if(!p.url||this.loadedEndOfParts(Q,O))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(O.toFixed(3))),Object(K.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=y.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:p,targetBufferTime:O}),this.fragmentLoader.load(p,N).catch(function(J){return W.handleFragLoadError(J)})},a.doFragPartsLoad=function(p,b,O,N){var W=this;return new Promise(function(Q,F){var _=[],J=function ee(re){var de=b[re];W.fragmentLoader.loadPart(p,de,N).then(function(Te){_[de.index]=Te;var ve=Te.part;W.hls.trigger(I.Events.FRAG_LOADED,Te);var pe=b[re+1];if(pe&&pe.fragment===p)ee(re+1);else return Q({frag:p,part:ve,partsLoaded:_})}).catch(F)};J(O)})},a.handleFragLoadError=function(p){var b=p.data;return b&&b.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(I.Events.ERROR,b),null},a._handleTransmuxerFlush=function(p){var b=this.getCurrentContext(p);if(!b||this.state!==y.PARSING){this.fragCurrent||(this.state=y.IDLE);return}var O=b.frag,N=b.part,W=b.level,Q=self.performance.now();O.stats.parsing.end=Q,N&&(N.stats.parsing.end=Q),this.updateLevelTiming(O,N,W,p.partial)},a.getCurrentContext=function(p){var b=this.levels,O=p.level,N=p.sn,W=p.part;if(!b||!b[O])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+O+". The current chunk will not be buffered."),null;var Q=b[O],F=W>-1?Object(S.getPartWith)(Q,N,W):null,_=F?F.fragment:Object(S.getFragmentWithSN)(Q,N,this.fragCurrent);return _?{frag:_,part:F,level:Q}:null},a.bufferFragmentData=function(p,b,O,N){if(!p||this.state!==y.PARSING)return;var W=p.data1,Q=p.data2,F=W;if(W&&Q&&(F=Object(T.appendUint8Array)(W,Q)),!F||!F.length)return;var _={type:p.type,frag:b,part:O,chunkMeta:N,parent:b.type,data:F};this.hls.trigger(I.Events.BUFFER_APPENDING,_),p.dropped&&p.independent&&!O&&this.flushBufferGap(b)},a.flushBufferGap=function(p){var b=this.media;if(!b)return;if(!U.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,p.start);return}var O=b.currentTime,N=U.BufferHelper.bufferInfo(b,O,0),W=p.duration,Q=Math.min(this.config.maxFragLookUpTolerance*2,W*.25),F=Math.max(Math.min(p.start-Q,N.end-Q),O+Q);p.start-F>Q&&this.flushMainBuffer(F,p.start)},a.getFwdBufferInfo=function(p,b){var O=this.config,N=this.getLoadPosition();if(!Object(K.isFiniteNumber)(N))return null;var W=U.BufferHelper.bufferInfo(p,N,O.maxBufferHole);if(W.len===0&&W.nextStart!==void 0){var Q=this.fragmentTracker.getBufferedFrag(N,b);if(Q&&W.nextStart<Q.end)return U.BufferHelper.bufferInfo(p,N,Math.max(W.nextStart,O.maxBufferHole))}return W},a.getMaxBufferLength=function(p){var b=this.config,O;return p?O=Math.max(8*b.maxBufferSize/p,b.maxBufferLength):O=b.maxBufferLength,Math.min(O,b.maxMaxBufferLength)},a.reduceMaxBufferLength=function(p){var b=this.config,O=p||b.maxBufferLength;return b.maxMaxBufferLength>=O?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(p,b){var O,N,W=b.fragments,Q=W.length;if(!Q)return null;var F=this.config,_=W[0].start,J;if(b.live){var ee=F.initialLiveManifestSize;if(Q<ee)return this.warn("Not enough fragments to start playback (have: "+Q+", need: "+ee+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(J=this.getInitialLiveFragment(b,W),this.startPosition=J?this.hls.liveSyncPosition||J.start:p)}else p<=_&&(J=W[0]);if(!J){var re=F.lowLatencyMode?b.partEnd:b.fragmentEnd;J=this.getFragmentAtPosition(p,re,b)}return(O=J)!==null&&O!==void 0&&O.initSegment&&!((N=J)!==null&&N!==void 0&&N.initSegment.data)&&!this.bitrateTest&&(J=J.initSegment),J},a.getNextPart=function(p,b,O){for(var N=-1,W=!1,Q=!0,F=0,_=p.length;F<_;F++){var J=p[F];if(Q=Q&&!J.independent,N>-1&&O<J.start)break;var ee=J.loaded;!ee&&(W||J.independent||Q)&&J.fragment===b&&(N=F),W=ee}return N},a.loadedEndOfParts=function(p,b){var O=p[p.length-1];return O&&b>O.start&&O.loaded},a.getInitialLiveFragment=function(p,b){var O=this.fragPrevious,N=null;if(O){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+O.programDateTime),N=Object(C.findFragmentByPDT)(b,O.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var W=O.sn+1;if(W>=p.startSN&&W<=p.endSN){var Q=b[W-p.startSN];O.cc===Q.cc&&(N=Q,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(C.findFragWithCC)(b,O.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(N=this.getFragmentAtPosition(F,this.bitrateTest?p.fragmentEnd:p.edge,p))}return N},a.getFragmentAtPosition=function(p,b,O){var N=this.config,W=this.fragPrevious,Q=O.fragments,F=O.endSN,_=O.fragmentHint,J=N.maxFragLookUpTolerance,ee=!!(N.lowLatencyMode&&O.partList&&_);ee&&_&&!this.bitrateTest&&(Q=Q.concat(_),F=_.sn);var re;if(p<b){var de=p>b-J?0:J;re=Object(C.findFragmentByPTS)(W,Q,p,de)}else re=Q[Q.length-1];if(re){var Te=re.sn-O.startSN,ve=W&&re.level===W.level,pe=Q[Te+1],he=this.fragmentTracker.getState(re);if(he===M.FragmentState.BACKTRACKED){re=null;for(var me=Te;Q[me]&&this.fragmentTracker.getState(Q[me])===M.FragmentState.BACKTRACKED;)W?re=Q[me--]:re=Q[--me];re||(re=pe)}else W&&re.sn===W.sn&&!ee&&(ve&&(re.sn<F&&this.fragmentTracker.getState(pe)!==M.FragmentState.OK?(this.log("SN "+re.sn+" just loaded, load next one: "+pe.sn),re=pe):re=null))}return re},a.synchronizeToLiveEdge=function(p){var b=this.config,O=this.media;if(!O)return;var N=this.hls.liveSyncPosition,W=O.currentTime,Q=p.fragments[0].start,F=p.edge,_=W>=Q-b.maxFragLookUpTolerance&&W<=F;if(N!==null&&O.duration>N&&(W<N||!_)){var J=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*p.targetduration;(!_&&O.readyState<4||W<F-J)&&(this.loadedmetadata||(this.nextLoadPosition=N),O.readyState&&(this.warn("Playback: "+W.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+N.toFixed(3)),O.currentTime=N))}},a.alignPlaylists=function(p,b){var O=this.levels,N=this.levelLastLoaded,W=this.fragPrevious,Q=N!==null?O[N]:null,F=p.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var _=p.fragments[0].start,J=!b,ee=p.alignedSliding&&Object(K.isFiniteNumber)(_);if(J||!ee&&!_){Object(L.alignStream)(W,Q,p);var re=p.fragments[0].start;return this.log("Live playlist sliding: "+re.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+p.startSN+" prev-sn: "+(W?W.sn:"na")+" fragments: "+F),re}return _},a.waitForCdnTuneIn=function(p){var b=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*b)},a.setStartPosition=function(p,b){var O=this.startPosition;if(O<b&&(O=-1),O===-1||this.lastCurrentTime===-1){var N=p.startTimeOffset;Object(K.isFiniteNumber)(N)?(O=b+N,N<0&&(O+=p.totalduration),O=Math.min(Math.max(b,O),b+p.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+O),this.startPosition=O):p.live?O=this.hls.liveSyncPosition||b:this.startPosition=O=0,this.lastCurrentTime=O}this.nextLoadPosition=O},a.getLoadPosition=function(){var p=this.media,b=0;return this.loadedmetadata&&p?b=p.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},a.handleFragLoadAborted=function(p,b){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(b?" part"+b.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},a.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=y.IDLE)},a.onFragmentOrKeyLoadError=function(p,b){if(b.fatal)return;var O=b.frag;if(!O||O.type!==p)return;var N=this.fragCurrent;console.assert(N&&O.sn===N.sn&&O.level===N.level&&O.urlId===N.urlId,"Frag load error must match current frag to retry");var W=this.config;if(this.fragLoadError+1<=W.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(O.level))return;var Q=Math.min(Math.pow(2,this.fragLoadError)*W.fragLoadingRetryDelay,W.fragLoadingMaxRetryTimeout);this.warn("Fragment "+O.sn+" of "+p+" "+O.level+" failed to load, retrying in "+Q+"ms"),this.retryDate=self.performance.now()+Q,this.fragLoadError++,this.state=y.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(p===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=y.IDLE):(B.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=y.ERROR)},a.afterBufferFlushed=function(p,b,O){if(!p)return;var N=U.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(b,N,O),this.state===y.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=y.IDLE},a.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[p].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(p,b,O,N){var W=this,Q=O.details;console.assert(!!Q,"level.details must be defined");var F=Object.keys(p.elementaryStreams).reduce(function(_,J){var ee=p.elementaryStreams[J];if(ee){var re=ee.endPTS-ee.startPTS;if(re<=0)return W.warn("Could not parse fragment "+p.sn+" "+J+" duration reliably ("+re+") resetting transmuxer to fallback to playlist timing"),W.resetTransmuxer(),_||!1;var de=N?0:Object(S.updateFragPTSDTS)(Q,p,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return W.hls.trigger(I.Events.LEVEL_PTS_UPDATED,{details:Q,level:O,drift:de,type:J,frag:p,start:ee.startPTS,end:ee.endPTS}),!0}return _},!1);F?(this.state=y.PARSED,this.hls.trigger(I.Events.FRAG_PARSED,{frag:p,part:b})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(s,[{key:"state",get:function(){return this._state},set:function(p){var b=this._state;b!==p&&(this._state=p,this.log(b+"->"+p))}}]),s}(P.default)},"./src/controller/buffer-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C});var K=D("./src/polyfills/number.ts"),P=D("./src/events.ts"),M=D("./src/utils/logger.ts"),U=D("./src/errors.ts"),B=D("./src/utils/buffer-helper.ts"),I=D("./src/utils/mediasource-helper.ts"),R=D("./src/loader/fragment.ts"),v=D("./src/controller/buffer-operation-queue.ts"),T=Object(I.getMediaSource)(),L=/([ha]vc.)(?:\.[^.,]+)+/,C=function(){function S(u){var o=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var l=o.hls,d=o.media,A=o.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),d&&(o.updateMediaElementDuration(),l.trigger(P.Events.MEDIA_ATTACHED,{media:d})),A&&A.removeEventListener("sourceopen",o._onMediaSourceOpen),o.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=u,this._initSourceBuffer(),this.registerListeners()}var E=S.prototype;return E.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},E.destroy=function(){this.unregisterListeners(),this.details=null},E.registerListeners=function(){var o=this.hls;o.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(P.Events.BUFFER_RESET,this.onBufferReset,this),o.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(P.Events.BUFFER_EOS,this.onBufferEos,this),o.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(P.Events.FRAG_PARSED,this.onFragParsed,this),o.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},E.unregisterListeners=function(){var o=this.hls;o.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(P.Events.BUFFER_RESET,this.onBufferReset,this),o.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(P.Events.BUFFER_EOS,this.onBufferEos,this),o.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(P.Events.FRAG_PARSED,this.onFragParsed,this),o.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},E._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},E.onManifestParsed=function(o,l){var d=2;(l.audio&&!l.video||!l.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},E.onMediaAttaching=function(o,l){var d=this.media=l.media;if(d&&T){var A=this.mediaSource=new T;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(A),this._objectUrl=d.src}},E.onMediaDetaching=function(){var o=this.media,l=this.mediaSource,d=this._objectUrl;if(l){if(M.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(A){M.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(d&&self.URL.revokeObjectURL(d),o.src===d?(o.removeAttribute("src"),o.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(P.Events.MEDIA_DETACHED,void 0)},E.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(l){var d=o.sourceBuffer[l];try{d&&(o.removeBufferListeners(l),o.mediaSource&&o.mediaSource.removeSourceBuffer(d),o.sourceBuffer[l]=void 0)}catch(A){M.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",A)}}),this._initSourceBuffer()},E.onBufferCodecs=function(o,l){var d=this,A=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(f){if(A){var m=d.tracks[f];if(m&&typeof m.buffer.changeType=="function"){var w=l[f],y=w.codec,h=w.levelCodec,c=w.container,s=(m.levelCodec||m.codec).replace(L,"$1"),a=(h||y).replace(L,"$1");if(s!==a){var g=c+";codecs="+(h||y);d.appendChangeType(f,g)}}}else d.pendingTracks[f]=l[f]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},E.appendChangeType=function(o,l){var d=this,A=this.operationQueue,f={execute:function(){var w=d.sourceBuffer[o];w&&(M.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+l),w.changeType(l)),A.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(w){M.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",w)}};A.append(f,o)},E.onBufferAppending=function(o,l){var d=this,A=this.hls,f=this.operationQueue,m=this.tracks,w=l.data,y=l.type,h=l.frag,c=l.part,s=l.chunkMeta,a=s.buffering[y],g=self.performance.now();a.start=g;var p=h.stats.buffering,b=c?c.stats.buffering:null;p.start===0&&(p.start=g),b&&b.start===0&&(b.start=g);var O=m.audio,N=y==="audio"&&s.id===1&&(O==null?void 0:O.container)==="audio/mpeg",W={execute:function(){if(a.executeStart=self.performance.now(),N){var F=d.sourceBuffer[y];if(F){var _=h.start-F.timestampOffset;Math.abs(_)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+h.start+" (delta: "+_+") sn: "+h.sn+")"),F.timestampOffset=h.start)}}d.appendExecutor(w,y)},onStart:function(){},onComplete:function(){var F=self.performance.now();a.executeEnd=a.end=F,p.first===0&&(p.first=F),b&&b.first===0&&(b.first=F);var _=d.sourceBuffer,J={};for(var ee in _)J[ee]=B.BufferHelper.getBuffered(_[ee]);d.appendError=0,d.hls.trigger(P.Events.BUFFER_APPENDED,{type:y,frag:h,part:c,chunkMeta:s,parent:h.type,timeRanges:J})},onError:function(F){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+y+" SourceBuffer",F);var _={type:U.ErrorTypes.MEDIA_ERROR,parent:h.type,details:U.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?_.details=U.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,_.details=U.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>A.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),_.fatal=!0)),A.trigger(P.Events.ERROR,_)}};f.append(W,y)},E.onBufferFlushing=function(o,l){var d=this,A=this.operationQueue,f=function(w){return{execute:d.removeExecutor.bind(d,w,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(P.Events.BUFFER_FLUSHED,{type:w})},onError:function(h){M.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",h)}}};l.type?A.append(f(l.type),l.type):this.getSourceBufferTypes().forEach(function(m){A.append(f(m),m)})},E.onFragParsed=function(o,l){var d=this,A=l.frag,f=l.part,m=[],w=f?f.elementaryStreams:A.elementaryStreams;w[R.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(w[R.ElementaryStreamTypes.AUDIO]&&m.push("audio"),w[R.ElementaryStreamTypes.VIDEO]&&m.push("video"));var y=function(){var c=self.performance.now();A.stats.buffering.end=c,f&&(f.stats.buffering.end=c);var s=f?f.stats:A.stats;d.hls.trigger(P.Events.FRAG_BUFFERED,{frag:A,part:f,stats:s,id:A.type})};m.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(y,m)},E.onFragChanged=function(o,l){this.flushBackBuffer()},E.onBufferEos=function(o,l){var d=this,A=this.getSourceBufferTypes().reduce(function(f,m){var w=d.sourceBuffer[m];return(!l.type||l.type===m)&&(w&&!w.ended&&(w.ended=!0,M.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),f&&!!(!w||w.ended)},!0);A&&this.blockBuffers(function(){var f=d.mediaSource;if(!f||f.readyState!=="open")return;f.endOfStream()})},E.onLevelUpdated=function(o,l){var d=l.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},E.flushBackBuffer=function(){var o=this.hls,l=this.details,d=this.media,A=this.sourceBuffer;if(!d||l===null)return;var f=this.getSourceBufferTypes();if(!f.length)return;var m=l.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(K.isFiniteNumber)(m)||m<0)return;var w=d.currentTime,y=l.levelTargetDuration,h=Math.max(m,y),c=Math.floor(w/y)*y-h;f.forEach(function(s){var a=A[s];if(a){var g=B.BufferHelper.getBuffered(a);g.length>0&&c>g.start(0)&&(o.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),l.live&&o.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),o.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:s}))}})},E.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,l=this.hls,d=this.media,A=this.mediaSource,f=o.fragments[0].start+o.totalduration,m=d.duration,w=Object(K.isFiniteNumber)(A.duration)?A.duration:0;o.live&&l.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(o)):(f>w&&f>m||!Object(K.isFiniteNumber)(m))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+f.toFixed(3)),A.duration=f)},E.updateSeekableRange=function(o){var l=this.mediaSource,d=o.fragments,A=d.length;if(A&&o.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var f=Math.max(0,d[0].start),m=Math.max(f,f+o.totalduration);l.setLiveSeekableRange(f,m)}},E.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,l=this.operationQueue,d=this.pendingTracks,A=Object.keys(d).length;if(A&&!o||A===2){this.createSourceBuffers(d),this.pendingTracks={};var f=this.getSourceBufferTypes();if(f.length===0){this.hls.trigger(P.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}f.forEach(function(m){l.executeNext(m)})}},E.createSourceBuffers=function(o){var l=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var f in o)if(!l[f]){var m=o[f];if(!m)throw Error("source buffer exists for track "+f+", however track does not");var w=m.levelCodec||m.codec,y=m.container+";codecs="+w;M.logger.log("[buffer-controller]: creating sourceBuffer("+y+")");try{var h=l[f]=d.addSourceBuffer(y),c=f;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[f]={buffer:h,codec:w,container:m.container,levelCodec:m.levelCodec,id:m.id},A++}catch(s){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(P.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:y})}}A&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},E._onSBUpdateStart=function(o){var l=this.operationQueue,d=l.current(o);d.onStart()},E._onSBUpdateEnd=function(o){var l=this.operationQueue,d=l.current(o);d.onComplete(),l.shiftAndExecuteNext(o)},E._onSBUpdateError=function(o,l){M.logger.error("[buffer-controller]: "+o+" SourceBuffer error",l),this.hls.trigger(P.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(o);d&&d.onError(l)},E.removeExecutor=function(o,l,d){var A=this.media,f=this.mediaSource,m=this.operationQueue,w=this.sourceBuffer,y=w[o];if(!A||!f||!y){M.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(o);return}var h=Object(K.isFiniteNumber)(A.duration)?A.duration:Infinity,c=Object(K.isFiniteNumber)(f.duration)?f.duration:Infinity,s=Math.max(0,l),a=Math.min(d,h,c);a>s?(M.logger.log("[buffer-controller]: Removing ["+s+","+a+"] from the "+o+" SourceBuffer"),console.assert(!y.updating,o+" sourceBuffer must not be updating"),y.remove(s,a)):m.shiftAndExecuteNext(o)},E.appendExecutor=function(o,l){var d=this.operationQueue,A=this.sourceBuffer,f=A[l];if(!f){M.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(l);return}f.ended=!1,console.assert(!f.updating,l+" sourceBuffer must not be updating"),f.appendBuffer(o)},E.blockBuffers=function(o,l){var d=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var A=this.operationQueue,f=l.map(function(m){return A.appendBlocker(m)});Promise.all(f).then(function(){o(),l.forEach(function(m){var w=d.sourceBuffer[m];(!w||!w.updating)&&A.shiftAndExecuteNext(m)})})},E.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},E.addBufferListener=function(o,l,d){var A=this.sourceBuffer[o];if(!A)return;var f=d.bind(this,o);this.listeners[o].push({event:l,listener:f}),A.addEventListener(l,f)},E.removeBufferListeners=function(o){var l=this.sourceBuffer[o];if(!l)return;this.listeners[o].forEach(function(d){l.removeEventListener(d.event,d.listener)})},S}()},"./src/controller/buffer-operation-queue.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return P});var K=D("./src/utils/logger.ts"),P=function(){function M(B){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=B}var U=M.prototype;return U.append=function(I,R){var v=this.queues[R];v.push(I),v.length===1&&this.buffers[R]&&this.executeNext(R)},U.insertAbort=function(I,R){var v=this.queues[R];v.unshift(I),this.executeNext(R)},U.appendBlocker=function(I){var R,v=new Promise(function(L){R=L}),T={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(T,I),v},U.executeNext=function(I){var R=this.buffers,v=this.queues,T=R[I],L=v[I];if(L.length){var C=L[0];try{C.execute()}catch(S){K.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),C.onError(S),(!T||!T.updating)&&(L.shift(),this.executeNext(I))}}},U.shiftAndExecuteNext=function(I){this.queues[I].shift(),this.executeNext(I)},U.current=function(I){return this.queues[I][0]},M}()},"./src/controller/cap-level-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts");function P(B,I){for(var R=0;R<I.length;R++){var v=I[R];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(B,v.key,v)}}function M(B,I,R){return I&&P(B.prototype,I),R&&P(B,R),B}var U=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 I=B.prototype;return I.setStreamController=function(v){this.streamController=v},I.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},I.registerListeners=function(){var v=this.hls;v.on(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.unregisterListener=function(){var v=this.hls;v.off(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.onFpsDropLevelCapping=function(v,T){B.isLevelAllowed(T.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(T.droppedLevel)},I.onMediaAttaching=function(v,T){this.media=T.media instanceof HTMLVideoElement?T.media:null},I.onManifestParsed=function(v,T){var L=this.hls;this.restrictedLevels=[],this.firstLevel=T.firstLevel,L.config.capLevelToPlayerSize&&T.video&&this.startCapping()},I.onBufferCodecs=function(v,T){var L=this.hls;L.config.capLevelToPlayerSize&&T.video&&this.startCapping()},I.onMediaDetaching=function(){this.stopCapping()},I.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var T=this.hls;T.autoLevelCapping=this.getMaxLevel(v.length-1),T.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=T.autoLevelCapping}}},I.getMaxLevel=function(v){var T=this,L=this.hls.levels;if(!L.length)return-1;var C=L.filter(function(S,E){return B.isLevelAllowed(E,T.restrictedLevels)&&E<=v});return this.clientRect=null,B.getMaxLevelByMediaSize(C,this.mediaWidth,this.mediaHeight)},I.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()},I.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},I.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,T={width:0,height:0};if(v){var L=v.getBoundingClientRect();T.width=L.width,T.height=L.height,!T.width&&!T.height&&(T.width=L.right-L.left||v.width||0,T.height=L.bottom-L.top||v.height||0)}return this.clientRect=T,T},B.isLevelAllowed=function(v,T){return T===void 0&&(T=[]),T.indexOf(v)===-1},B.getMaxLevelByMediaSize=function(v,T,L){if(!v||!v.length)return-1;for(var C=function(l,d){return d?l.width!==d.width||l.height!==d.height:!0},S=v.length-1,E=0;E<v.length;E+=1){var u=v[E];if((u.width>=T||u.height>=L)&&C(u,v[E+1])){S=E;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(T){}return v}}]),B}();G.default=U},"./src/controller/cmcd-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C});var K=D("./src/events.ts"),P=D("./src/types/cmcd.ts"),M=D("./src/utils/buffer-helper.ts"),U=D("./src/utils/logger.ts");function B(S,E){for(var u=0;u<E.length;u++){var o=E[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(S,o.key,o)}}function I(S,E,u){return E&&B(S.prototype,E),u&&B(S,u),S}function R(S,E){var u=typeof Symbol!="undefined"&&S[Symbol.iterator]||S["@@iterator"];if(u)return(u=u.call(S)).next.bind(u);if(Array.isArray(S)||(u=v(S))||E&&S&&typeof S.length=="number"){u&&(S=u);var o=0;return function(){return o>=S.length?{done:!0}:{done:!1,value:S[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(S,E){if(!S)return;if(typeof S=="string")return T(S,E);var u=Object.prototype.toString.call(S).slice(8,-1);if(u==="Object"&&S.constructor&&(u=S.constructor.name),u==="Map"||u==="Set")return Array.from(S);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return T(S,E)}function T(S,E){(E==null||E>S.length)&&(E=S.length);for(var u=0,o=new Array(E);u<E;u++)o[u]=S[u];return o}function L(){return L=Object.assign||function(S){for(var E=1;E<arguments.length;E++){var u=arguments[E];for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&(S[o]=u[o])}return S},L.apply(this,arguments)}var C=function(){function S(u){var o=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(A){try{o.apply(A,{ot:P.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(f){U.logger.warn("Could not generate manifest CMCD data.",f)}},this.applyFragmentData=function(A){try{var f=A.frag,m=o.hls.levels[f.level],w=o.getObjectType(f),y={d:f.duration*1e3,ot:w};(w===P.CMCDObjectType.VIDEO||w===P.CMCDObjectType.AUDIO||w==P.CMCDObjectType.MUXED)&&(y.br=m.bitrate/1e3,y.tb=o.getTopBandwidth(w),y.bl=o.getBufferLength(w)),o.apply(A,y)}catch(h){U.logger.warn("Could not generate segment CMCD data.",h)}},this.hls=u;var l=this.config=u.config,d=l.cmcd;d!=null&&(l.pLoader=this.createPlaylistLoader(),l.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||S.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var E=S.prototype;return E.registerListeners=function(){var o=this.hls;o.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this)},E.unregisterListeners=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},E.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},E.onMediaAttached=function(o,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},E.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},E.onBufferCreated=function(o,l){var d,A;this.audioBuffer=(d=l.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(A=l.tracks.video)===null||A===void 0?void 0:A.buffer},E.createData=function(){var o;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(o=this.media)===null||o===void 0?void 0:o.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},E.apply=function(o,l){l===void 0&&(l={}),L(l,this.createData());var d=l.ot===P.CMCDObjectType.INIT||l.ot===P.CMCDObjectType.VIDEO||l.ot===P.CMCDObjectType.MUXED;if(this.starved&&d&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var A=S.toHeaders(l);if(!Object.keys(A).length)return;o.headers||(o.headers={}),L(o.headers,A)}else{var f=S.toQuery(l);if(!f)return;o.url=S.appendQueryToUri(o.url,f)}},E.getObjectType=function(o){var l=o.type;return l==="subtitle"?P.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?P.CMCDObjectType.INIT:l==="audio"?P.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},E.getTopBandwidth=function(o){for(var l=0,d=o===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=R(d),f;!(f=A()).done;){var m=f.value;m.bitrate>l&&(l=m.bitrate)}return l>0?l:NaN},E.getBufferLength=function(o){var l=this.hls.media,d=o===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!l)return NaN;var A=M.BufferHelper.bufferInfo(d,l.currentTime,this.config.maxBufferHole);return A.len*1e3},E.createPlaylistLoader=function(){var o=this.config.pLoader,l=this.applyPlaylistData,d=o||this.config.loader;return function(){function A(m){this.loader=void 0,this.loader=new d(m)}var f=A.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(w,y,h){l(w),this.loader.load(w,y,h)},I(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},E.createFragmentLoader=function(){var o=this.config.fLoader,l=this.applyFragmentData,d=o||this.config.loader;return function(){function A(m){this.loader=void 0,this.loader=new d(m)}var f=A.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(w,y,h){l(w),this.loader.load(w,y,h)},I(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},S.uuid=function(){var o=URL.createObjectURL(new Blob),l=o.toString();return URL.revokeObjectURL(o),l.substr(l.lastIndexOf("/")+1)},S.serialize=function(o){for(var l=[],d=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},A=function(N){return Math.round(N)},f=function(N){return A(N/100)*100},m=function(N){return encodeURIComponent(N)},w={br:A,d:A,bl:f,dl:f,mtp:f,nor:m,rtp:f,tb:A},y=Object.keys(o||{}).sort(),h=R(y),c;!(c=h()).done;){var s=c.value,a=o[s];if(!d(a))continue;if(s==="v"&&a===1)continue;if(s=="pr"&&a===1)continue;var g=w[s];g&&(a=g(a));var p=typeof a,b=void 0;s==="ot"||s==="sf"||s==="st"?b=s+"="+a:p==="boolean"?b=s:p==="number"?b=s+"="+a:b=s+"="+JSON.stringify(a),l.push(b)}return l.join(",")},S.toHeaders=function(o){for(var l=Object.keys(o),d={},A=["Object","Request","Session","Status"],f=[{},{},{},{}],m={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},w=0,y=l;w<y.length;w++){var h=y[w],c=m[h]!=null?m[h]:1;f[c][h]=o[h]}for(var s=0;s<f.length;s++){var a=S.serialize(f[s]);a&&(d["CMCD-"+A[s]]=a)}return d},S.toQuery=function(o){return"CMCD="+encodeURIComponent(S.serialize(o))},S.appendQueryToUri=function(o,l){if(!l)return o;var d=o.includes("?")?"&":"?";return""+o+d+l},S}()},"./src/controller/eme-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/utils/logger.ts"),U=D("./src/utils/mediakeys-helper.ts");function B(C,S){for(var E=0;E<S.length;E++){var u=S[E];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(C,u.key,u)}}function I(C,S,E){return S&&B(C.prototype,S),E&&B(C,E),C}var R=3,v=function(S,E,u){var o={audioCapabilities:[],videoCapabilities:[]};return S.forEach(function(l){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:u.audioRobustness||""})}),E.forEach(function(l){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:u.videoRobustness||""})}),[o]},T=function(S,E,u,o){switch(S){case U.KeySystems.WIDEVINE:return v(E,u,o);default:throw new Error("Unknown key-system: "+S)}},L=function(){function C(E){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=E,this._config=E.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=C.prototype;return S.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},S._registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},S._unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},S.getLicenseServerUrl=function(u){switch(u){case U.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},S._attemptKeySystemAccess=function(u,o,l){var d=this,A=T(u,o,l,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var f=this.requestMediaKeySystemAccess(u,A);this.mediaKeysPromise=f.then(function(m){return d._onMediaKeySystemAccessObtained(u,m)}),f.catch(function(m){M.logger.error('Failed to obtain key-system "'+u+'" access:',m)})},S._onMediaKeySystemAccessObtained=function(u,o){var l=this;M.logger.log('Access for key-system "'+u+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:u};this._mediaKeysList.push(d);var A=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(f){return d.mediaKeys=f,M.logger.log('Media-keys created for key-system "'+u+'"'),l._onMediaKeysCreated(),f});return A.catch(function(f){M.logger.error("Failed to create media-keys:",f)}),A},S._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),u._onNewMediaKeySession(o.mediaKeysSession))})},S._onNewMediaKeySession=function(u){var o=this;M.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(l){o._onKeySessionMessage(u,l.message)},!1)},S._onKeySessionMessage=function(u,o){M.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(l){M.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),u.update(l)})},S.onMediaEncrypted=function(u){var o=this;if(M.logger.log('Media is encrypted using "'+u.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(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(A){if(!o._media)return;o._attemptSetMediaKeys(A),o._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(l).catch(l)},S._attemptSetMediaKeys=function(u){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},S._generateRequestWithPreferredKeySession=function(u,o){var l=this,d=this._mediaKeysList[0];if(!d){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var A=d.mediaKeysSession;if(!A){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+u+'" init data type'),d.mediaKeysSessionInitialized=!0,A.generateRequest(u,o).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(f){M.logger.error("Error generating key-session request:",f),l.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},S._createLicenseXhr=function(u,o,l){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,u,o,l);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,d,u),A=void 0}catch(f){M.logger.error(f)}try{d.readyState||d.open("POST",u,!0),A&&A.call(this.hls,d,u)}catch(f){throw new Error("issue setting up KeySystem license XHR "+f)}return d},S._onLicenseRequestReadyStageChange=function(u,o,l,d){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var A=u.response,f=this._licenseResponseCallback;if(f)try{A=f.call(this.hls,u,o)}catch(w){M.logger.error(w)}d(A)}else{if(M.logger.error("License Request XHR failed ("+o+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=R-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(l,d)}break}},S._generateLicenseRequestChallenge=function(u,o){switch(u.mediaKeySystemDomain){case U.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},S._requestLicense=function(u,o){M.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(l.mediaKeySystemDomain),A=this._createLicenseXhr(d,u,o);M.logger.log("Sending license request to URL: "+d);var f=this._generateLicenseRequestChallenge(l,u);A.send(f)}catch(m){M.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},S.onMediaAttached=function(u,o){if(!this._emeEnabled)return;var l=o.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},S.onMediaDetached=function(){var u=this._media,o=this._mediaKeysList;if(!u)return;u.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return u.setMediaKeys(null)}).catch(function(){})},S.onManifestParsed=function(u,o){if(!this._emeEnabled)return;var l=o.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),d=o.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(U.KeySystems.WIDEVINE,l,d)},I(C,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),C}();G.default=L},"./src/controller/fps-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/utils/logger.ts"),M=function(){function U(I){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=I,this.registerListeners()}var B=U.prototype;return B.setStreamController=function(R){this.streamController=R},B.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},B.unregisterListeners=function(){this.hls.off(K.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 T=this.hls.config;if(T.capLevelOnFPSDrop){var L=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=L,L&&typeof L.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),T.fpsDroppedMonitoringPeriod)}},B.checkFPS=function(R,v,T){var L=performance.now();if(v){if(this.lastTime){var C=L-this.lastTime,S=T-this.lastDroppedFrames,E=v-this.lastDecodedFrames,u=1e3*S/C,o=this.hls;if(o.trigger(K.Events.FPS_DROP,{currentDropped:S,currentDecoded:E,totalDroppedFrames:T}),u>0&&S>o.config.fpsDroppedMonitoringThreshold*E){var l=o.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=l)&&(l=l-1,o.trigger(K.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:o.currentLevel}),o.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=L,this.lastDroppedFrames=T,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)},U}();G.default=M},"./src/controller/fragment-finders.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"findFragmentByPDT",function(){return M}),D.d(G,"findFragmentByPTS",function(){return U}),D.d(G,"fragmentWithinToleranceTest",function(){return B}),D.d(G,"pdtWithinToleranceTest",function(){return I}),D.d(G,"findFragWithCC",function(){return R});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/binary-search.ts");function M(v,T,L){if(T===null||!Array.isArray(v)||!v.length||!Object(K.isFiniteNumber)(T))return null;var C=v[0].programDateTime;if(T<(C||0))return null;var S=v[v.length-1].endProgramDateTime;if(T>=(S||0))return null;L=L||0;for(var E=0;E<v.length;++E){var u=v[E];if(I(T,L,u))return u}return null}function U(v,T,L,C){L===void 0&&(L=0),C===void 0&&(C=0);var S=null;if(v?S=T[v.sn-T[0].sn+1]||null:L===0&&T[0].start===0&&(S=T[0]),S&&B(L,C,S)===0)return S;var E=P.default.search(T,B.bind(null,L,C));return E||S}function B(v,T,L){v===void 0&&(v=0),T===void 0&&(T=0);var C=Math.min(T,L.duration+(L.deltaPTS?L.deltaPTS:0));return L.start+L.duration-C<=v?1:L.start-C>v&&L.start?-1:0}function I(v,T,L){var C=Math.min(T,L.duration+(L.deltaPTS?L.deltaPTS:0))*1e3,S=L.endProgramDateTime||0;return S-C>v}function R(v,T){return P.default.search(v,function(L){return L.cc<T?1:L.cc>T?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"FragmentState",function(){return M}),D.d(G,"FragmentTracker",function(){return U});var K=D("./src/events.ts"),P=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 U=function(){function R(T){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=T,this._registerListeners()}var v=R.prototype;return v._registerListeners=function(){var L=this.hls;L.on(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),L.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),L.on(K.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var L=this.hls;L.off(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),L.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),L.off(K.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(L,C){if(C===P.PlaylistLevelType.MAIN){var S=this.activeFragment,E=this.activeParts;if(!S)return null;if(E)for(var u=E.length;u--;){var o=E[u],l=o?o.end:S.appendedPTS;if(o.start<=L&&l!==void 0&&L<=l)return u>9&&(this.activeParts=E.slice(u-9)),o}else if(S.start<=L&&S.appendedPTS!==void 0&&L<=S.appendedPTS)return S}return this.getBufferedFrag(L,C)},v.getBufferedFrag=function(L,C){for(var S=this.fragments,E=Object.keys(S),u=E.length;u--;){var o=S[E[u]];if((o==null?void 0:o.body.type)===C&&o.buffered){var l=o.body;if(l.start<=L&&L<=l.end)return l}}return null},v.detectEvictedFragments=function(L,C,S){var E=this;Object.keys(this.fragments).forEach(function(u){var o=E.fragments[u];if(!o)return;if(!o.buffered){o.body.type===S&&E.removeFragment(o.body);return}var l=o.range[L];if(!l)return;l.time.some(function(d){var A=!E.isTimeBuffered(d.startPTS,d.endPTS,C);return A&&E.removeFragment(o.body),A})})},v.detectPartialFragments=function(L){var C=this,S=this.timeRanges,E=L.frag,u=L.part;if(!S||E.sn==="initSegment")return;var o=I(E),l=this.fragments[o];if(!l)return;Object.keys(S).forEach(function(d){var A=E.elementaryStreams[d];if(!A)return;var f=S[d],m=u!==null||A.partial===!0;l.range[d]=C.getBufferedTimes(E,u,m,f)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},v.fragBuffered=function(L){var C=I(L),S=this.fragments[C];S&&(S.backtrack=S.loaded=null,S.buffered=!0)},v.getBufferedTimes=function(L,C,S,E){for(var u={time:[],partial:S},o=C?C.start:L.start,l=C?C.end:L.end,d=L.minEndPTS||l,A=L.maxStartPTS||o,f=0;f<E.length;f++){var m=E.start(f)-this.bufferPadding,w=E.end(f)+this.bufferPadding;if(A>=m&&d<=w){u.time.push({startPTS:Math.max(o,E.start(f)),endPTS:Math.min(l,E.end(f))});break}else if(o<w&&l>m)u.partial=!0,u.time.push({startPTS:Math.max(o,E.start(f)),endPTS:Math.min(l,E.end(f))});else if(l<=m)break}return u},v.getPartialFragment=function(L){var C=null,S,E,u,o=0,l=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(A){var f=d[A];if(!f)return;B(f)&&(E=f.body.start-l,u=f.body.end+l,L>=E&&L<=u&&(S=Math.min(L-E,u-L),o<=S&&(C=f.body,o=S)))}),C},v.getState=function(L){var C=I(L),S=this.fragments[C];return S?S.buffered?B(S)?M.PARTIAL:M.OK:S.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},v.backtrack=function(L,C){var S=I(L),E=this.fragments[S];if(!E||E.backtrack)return null;var u=E.backtrack=C||E.loaded;return E.loaded=null,u},v.getBacktrackData=function(L){var C=I(L),S=this.fragments[C];if(S){var E,u=S.backtrack;if(u!=null&&(E=u.payload)!==null&&E!==void 0&&E.byteLength)return u;this.removeFragment(L)}return null},v.isTimeBuffered=function(L,C,S){for(var E,u,o=0;o<S.length;o++){if(E=S.start(o)-this.bufferPadding,u=S.end(o)+this.bufferPadding,L>=E&&C<=u)return!0;if(C<=E)return!1}return!1},v.onFragLoaded=function(L,C){var S=C.frag,E=C.part;if(S.sn==="initSegment"||S.bitrateTest||E)return;var u=I(S);this.fragments[u]={body:S,loaded:C,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(L,C){var S=this,E=C.frag,u=C.part,o=C.timeRanges;if(E.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=E,u){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(u)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(d){var A=o[d];if(S.detectEvictedFragments(d,A),!u)for(var f=0;f<A.length;f++)E.appendedPTS=Math.max(A.end(f),E.appendedPTS||0)})},v.onFragBuffered=function(L,C){this.detectPartialFragments(C)},v.hasFragment=function(L){var C=I(L);return!!this.fragments[C]},v.removeFragmentsInRange=function(L,C,S){var E=this;Object.keys(this.fragments).forEach(function(u){var o=E.fragments[u];if(!o)return;if(o.buffered){var l=o.body;l.type===S&&l.start<C&&l.end>L&&E.removeFragment(l)}})},v.removeFragment=function(L){var C=I(L);L.stats.loaded=0,L.clearElementaryStreamInfo(),delete this.fragments[C]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function B(R){var v,T;return R.buffered&&(((v=R.range.video)===null||v===void 0?void 0:v.partial)||((T=R.range.audio)===null||T===void 0?void 0:T.partial))}function I(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"STALL_MINIMUM_DURATION_MS",function(){return B}),D.d(G,"MAX_START_GAP_JUMP",function(){return I}),D.d(G,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),D.d(G,"SKIP_BUFFER_RANGE_START",function(){return v}),D.d(G,"default",function(){return T});var K=D("./src/utils/buffer-helper.ts"),P=D("./src/errors.ts"),M=D("./src/events.ts"),U=D("./src/utils/logger.ts"),B=250,I=2,R=.1,v=.05,T=function(){function L(S,E,u,o){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=S,this.media=E,this.fragmentTracker=u,this.hls=o}var C=L.prototype;return C.destroy=function(){this.hls=this.fragmentTracker=this.media=null},C.poll=function(E){var u=this.config,o=this.media,l=this.stalled,d=o.currentTime,A=o.seeking,f=this.seeking&&!A,m=!this.seeking&&A;if(this.seeking=A,d!==E){if(this.moved=!0,l!==null){if(this.stallReported){var w=self.performance.now()-l;U.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||f)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!K.BufferHelper.getBuffered(o).length)return;var y=K.BufferHelper.bufferInfo(o,d,0),h=y.len>0,c=y.nextStart||0;if(!h&&!c)return;if(A){var s=y.len>I,a=!c||c-d>I&&!this.fragmentTracker.getPartialFragment(d);if(s||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g,p=Math.max(c,y.start||0)-d,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,O=b==null||((g=b.details)===null||g===void 0)?void 0:g.live,N=O?b.details.targetduration*2:I;if(p>0&&p<=N){this._trySkipBufferHole(null);return}}var W=self.performance.now();if(l===null){this.stalled=W;return}var Q=W-l;!A&&Q>=B&&this._reportStall(y.len);var F=K.BufferHelper.bufferInfo(o,d,u.maxBufferHole);this._tryFixBufferStall(F,Q)},C._tryFixBufferStall=function(E,u){var o=this.config,l=this.fragmentTracker,d=this.media,A=d.currentTime,f=l.getPartialFragment(A);if(f){var m=this._trySkipBufferHole(f);if(m)return}E.len>o.maxBufferHole&&u>o.highBufferWatchdogPeriod*1e3&&(U.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},C._reportStall=function(E){var u=this.hls,o=this.media,l=this.stallReported;l||(this.stallReported=!0,U.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+E+")"),u.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:E}))},C._trySkipBufferHole=function(E){for(var u=this.config,o=this.hls,l=this.media,d=l.currentTime,A=0,f=K.BufferHelper.getBuffered(l),m=0;m<f.length;m++){var w=f.start(m);if(d+u.maxBufferHole>=A&&d<w){var y=Math.max(w+v,l.currentTime+R);return U.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+y),this.moved=!0,this.stalled=null,l.currentTime=y,E&&o.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+y,frag:E}),y}A=f.end(m)}return 0},C._tryNudgeBuffer=function(){var E=this.config,u=this.hls,o=this.media,l=o.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<E.nudgeMaxRetry){var A=l+d*E.nudgeOffset;U.logger.warn("Nudging 'currentTime' from "+l+" to "+A),o.currentTime=A,u.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else U.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+E.nudgeMaxRetry+" nudges"),u.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},L}()},"./src/controller/id3-track-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/utils/texttrack-utils.ts"),M=D("./src/demux/id3.ts"),U=.25,B=function(){function I(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var R=I.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var T=this.hls;T.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),T.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var T=this.hls;T.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),T.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(T,L){this.media=L.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},R.getID3Track=function(T){if(!this.media)return;for(var L=0;L<T.length;L++){var C=T[L];if(C.kind==="metadata"&&C.label==="id3")return Object(P.sendAddTrackEvent)(C,this.media),C}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(T,L){if(!this.media)return;var C=L.frag,S=L.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var E=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<S.length;u++){var o=M.getID3Frames(S[u].data);if(o){var l=S[u].pts,d=u<S.length-1?S[u+1].pts:C.end,A=d-l;A<=0&&(d=l+U);for(var f=0;f<o.length;f++){var m=o[f];if(!M.isTimeStampFrame(m)){var w=new E(l,d,"");w.value=m,this.id3Track.addCue(w)}}}}},R.onBufferFlushing=function(T,L){var C=L.startOffset,S=L.endOffset,E=L.type;if(!E||E==="audio"){var u=this.id3Track;u&&Object(P.removeCuesInRange)(u,C,S)}},I}();G.default=B},"./src/controller/latency-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return I});var K=D("./src/errors.ts"),P=D("./src/events.ts"),M=D("./src/utils/logger.ts");function U(R,v){for(var T=0;T<v.length;T++){var L=v[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}function B(R,v,T){return v&&U(R.prototype,v),T&&U(R,T),R}var I=function(){function R(T){var L=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 L.timeupdate()},this.hls=T,this.config=T.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(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},v.onMediaAttached=function(L,C){this.media=C.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(L,C){var S=C.details;this.levelDetails=S,S.advanced&&this.timeupdate(),!S.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(L,C){if(C.details!==K.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var L=this.media,C=this.levelDetails;if(!L||!C)return;this.currentTime=L.currentTime;var S=this.computeLatency();if(S===null)return;this._latency=S;var E=this.config,u=E.lowLatencyMode,o=E.maxLiveSyncPlaybackRate;if(!u||o===1)return;var l=this.targetLatency;if(l===null)return;var d=S-l,A=Math.min(this.maxLatency,l+C.targetduration),f=d<A;if(C.live&&f&&d>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,o)),w=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;L.playbackRate=Math.min(m,Math.max(1,w))}else L.playbackRate!==1&&L.playbackRate!==0&&(L.playbackRate=1)},v.estimateLiveEdge=function(){var L=this.levelDetails;return L===null?null:L.edge+L.age},v.computeLatency=function(){var L=this.estimateLiveEdge();return L===null?null:L-this.currentTime},B(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var L=this.config,C=this.levelDetails;return L.liveMaxLatencyDuration!==void 0?L.liveMaxLatencyDuration:C?L.liveMaxLatencyDurationCount*C.targetduration:0}},{key:"targetLatency",get:function(){var L=this.levelDetails;if(L===null)return null;var C=L.holdBack,S=L.partHoldBack,E=L.targetduration,u=this.config,o=u.liveSyncDuration,l=u.liveSyncDurationCount,d=u.lowLatencyMode,A=this.hls.userConfig,f=d&&S||C;(A.liveSyncDuration||A.liveSyncDurationCount||f===0)&&(f=o!==void 0?o:l*E);var m=E,w=1;return f+Math.min(this.stallCount*w,m)}},{key:"liveSyncPosition",get:function(){var L=this.estimateLiveEdge(),C=this.targetLatency,S=this.levelDetails;if(L===null||C===null||S===null)return null;var E=S.edge,u=L-C-this.edgeStalled,o=E-S.totalduration,l=E-(this.config.lowLatencyMode&&S.partTarget||S.targetduration);return Math.min(Math.max(o,u),l)}},{key:"drift",get:function(){var L=this.levelDetails;return L===null?1:L.drift}},{key:"edgeStalled",get:function(){var L=this.levelDetails;if(L===null)return 0;var C=(this.config.lowLatencyMode&&L.partTarget||L.targetduration)*3;return Math.max(L.age-C,0)}},{key:"forwardBufferLength",get:function(){var L=this.media,C=this.levelDetails;if(!L||!C)return 0;var S=L.buffered.length;return S?L.buffered.end(S-1):C.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return u});var K=D("./src/types/level.ts"),P=D("./src/events.ts"),M=D("./src/errors.ts"),U=D("./src/utils/codecs.ts"),B=D("./src/controller/level-helper.ts"),I=D("./src/controller/base-playlist-controller.ts"),R=D("./src/types/loader.ts");function v(){return v=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var d=arguments[l];for(var A in d)Object.prototype.hasOwnProperty.call(d,A)&&(o[A]=d[A])}return o},v.apply(this,arguments)}function T(o,l){for(var d=0;d<l.length;d++){var A=l[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,A.key,A)}}function L(o,l,d){return l&&T(o.prototype,l),d&&T(o,d),o}function C(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,S(o,l)}function S(o,l){return S=Object.setPrototypeOf||function(A,f){return A.__proto__=f,A},S(o,l)}var E=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(o){C(l,o);function l(A){var f;return f=o.call(this,A,"[level-controller]")||this,f._levels=[],f._firstLevel=-1,f._startLevel=void 0,f.currentLevelIndex=-1,f.manualLevelIndex=-1,f.onParsedComplete=void 0,f._registerListeners(),f}var d=l.prototype;return d._registerListeners=function(){var f=this.hls;f.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(P.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var f=this.hls;f.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(P.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,o.prototype.destroy.call(this)},d.startLoad=function(){var f=this._levels;f.forEach(function(m){m.loadError=0}),o.prototype.startLoad.call(this)},d.onManifestLoaded=function(f,m){var w=[],y=[],h=[],c,s={},a,g=!1,p=!1,b=!1;if(m.levels.forEach(function(Q){var F=Q.attrs;g=g||!!(Q.width&&Q.height),p=p||!!Q.videoCodec,b=b||!!Q.audioCodec,E&&Q.audioCodec&&Q.audioCodec.indexOf("mp4a.40.34")!==-1&&(Q.audioCodec=void 0);var _=Q.bitrate+"-"+Q.attrs.RESOLUTION+"-"+Q.attrs.CODECS;a=s[_],a?a.url.push(Q.url):(a=new K.Level(Q),s[_]=a,w.push(a)),F&&(F.AUDIO&&Object(B.addGroupId)(a,"audio",F.AUDIO),F.SUBTITLES&&Object(B.addGroupId)(a,"text",F.SUBTITLES))}),(g||p)&&b&&(w=w.filter(function(Q){var F=Q.videoCodec,_=Q.width,J=Q.height;return!!F||!!(_&&J)})),w=w.filter(function(Q){var F=Q.audioCodec,_=Q.videoCodec;return(!F||Object(U.isCodecSupportedInMp4)(F,"audio"))&&(!_||Object(U.isCodecSupportedInMp4)(_,"video"))}),m.audioTracks&&(y=m.audioTracks.filter(function(Q){return!Q.audioCodec||Object(U.isCodecSupportedInMp4)(Q.audioCodec,"audio")}),Object(B.assignTrackIdsByGroup)(y)),m.subtitles&&(h=m.subtitles,Object(B.assignTrackIdsByGroup)(h)),w.length>0){c=w[0].bitrate,w.sort(function(Q,F){return Q.bitrate-F.bitrate}),this._levels=w;for(var O=0;O<w.length;O++)if(w[O].bitrate===c){this._firstLevel=O,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+c);break}var N=b&&!p,W={levels:w,audioTracks:y,subtitleTracks:h,firstLevel:this._firstLevel,stats:m.stats,audio:b,video:p,altAudio:!N&&y.some(function(Q){return!!Q.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,W),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(f,m){if(o.prototype.onError.call(this,f,m),m.fatal)return;var w=m.context,y=this._levels[this.currentLevelIndex];if(w&&(w.type===R.PlaylistContextType.AUDIO_TRACK&&y.audioGroupIds&&w.groupId===y.audioGroupIds[y.urlId]||w.type===R.PlaylistContextType.SUBTITLE_TRACK&&y.textGroupIds&&w.groupId===y.textGroupIds[y.urlId])){this.redundantFailover(this.currentLevelIndex);return}var h=!1,c=!0,s;switch(m.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(m.frag){var a=this._levels[m.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=m.frag.level)):s=m.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(c=!1),s=w.level),h=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:s=m.level,h=!0;break}s!==void 0&&this.recoverLevel(m,s,h,c)},d.recoverLevel=function(f,m,w,y){var h=f.details,c=this._levels[m];if(c.loadError++,w){var s=this.retryLoadingOrFail(f);if(s)f.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(y){var a=c.url.length;if(a>1&&c.loadError<a)f.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var g=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==g&&this._levels[g].loadError===0&&(this.warn(h+": switch to "+g),f.levelRetry=!0,this.hls.nextAutoLevel=g)}}},d.redundantFailover=function(f){var m=this._levels[f],w=m.url.length;if(w>1){var y=(m.urlId+1)%w;this.warn("Switching to redundant URL-id "+y),this._levels.forEach(function(h){h.urlId=y}),this.level=f}},d.onFragLoaded=function(f,m){var w=m.frag;if(w!==void 0&&w.type===R.PlaylistLevelType.MAIN){var y=this._levels[w.level];y!==void 0&&(y.fragmentError=0,y.loadError=0)}},d.onLevelLoaded=function(f,m){var w,y=m.level,h=m.details,c=this._levels[y];if(!c){var s;this.warn("Invalid level index "+y),(s=m.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(h.deltaUpdateFailed=!0);return}y===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(y,m,c.details)):(w=m.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(h.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(f,m){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var y=-1,h=this.hls.audioTracks[m.id].groupId,c=0;c<w.audioGroupIds.length;c++)if(w.audioGroupIds[c]===h){y=c;break}y!==w.urlId&&(w.urlId=y,this.startLoad())}},d.loadPlaylist=function(f){var m=this.currentLevelIndex,w=this._levels[m];if(this.canLoad&&w&&w.url.length>0){var y=w.urlId,h=w.url[y];if(f)try{h=f.addDirectives(h)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+m+(f?" at sn "+f.msn+" part "+f.part:"")+" with URL-id "+y+" "+h),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:h,level:m,id:y,deliveryDirectives:f||null})}},d.removeLevel=function(f,m){var w=function(c,s){return s!==m},y=this._levels.filter(function(h,c){return c!==f?!0:h.url.length>1&&m!==void 0?(h.url=h.url.filter(w),h.audioGroupIds&&(h.audioGroupIds=h.audioGroupIds.filter(w)),h.textGroupIds&&(h.textGroupIds=h.textGroupIds.filter(w)),h.urlId=0,!0):!1}).map(function(h,c){var s=h.details;return s!=null&&s.fragments&&s.fragments.forEach(function(a){a.level=c}),h});this._levels=y,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:y})},L(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(f){var m,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===f&&(m=w[f])!==null&&m!==void 0&&m.details)return;if(f<0||f>=w.length){var y=f<0;if(this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:f,fatal:y,reason:"invalid level idx"}),y)return;f=Math.min(f,w.length-1)}this.clearTimer();var h=this.currentLevelIndex,c=w[h],s=w[f];this.log("switching to level "+f+" from "+h),this.currentLevelIndex=f;var a=v({},s,{level:f,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete a._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,a);var g=s.details;if(!g||g.live){var p=this.switchParams(s.uri,c==null?void 0:c.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(f){this.manualLevelIndex=f,this._startLevel===void 0&&(this._startLevel=f),f!==-1&&(this.level=f)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(f){this._firstLevel=f}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var f=this.hls.config.startLevel;return f!==void 0?f:this._firstLevel}else return this._startLevel},set:function(f){this._startLevel=f}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(f){this.level=f,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=f)}}]),l}(I.default)},"./src/controller/level-helper.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"addGroupId",function(){return M}),D.d(G,"assignTrackIdsByGroup",function(){return U}),D.d(G,"updatePTS",function(){return B}),D.d(G,"updateFragPTSDTS",function(){return R}),D.d(G,"mergeDetails",function(){return v}),D.d(G,"mapPartIntersection",function(){return T}),D.d(G,"mapFragmentIntersection",function(){return L}),D.d(G,"adjustSliding",function(){return C}),D.d(G,"addSliding",function(){return S}),D.d(G,"computeReloadInterval",function(){return E}),D.d(G,"getFragmentWithSN",function(){return u}),D.d(G,"getPartWith",function(){return o});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/logger.ts");function M(l,d,A){switch(d){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(A);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(A);break}}function U(l){var d={};l.forEach(function(A){var f=A.groupId||"";A.id=d[f]=d[f]||0,d[f]++})}function B(l,d,A){var f=l[d],m=l[A];I(f,m)}function I(l,d){var A=d.startPTS;if(Object(K.isFiniteNumber)(A)){var f=0,m;d.sn>l.sn?(f=A-l.start,m=l):(f=l.start-A,m=d),m.duration!==f&&(m.duration=f)}else if(d.sn>l.sn){var w=l.cc===d.cc;w&&l.minEndPTS?d.start=l.start+(l.minEndPTS-l.start):d.start=l.start+l.duration}else d.start=Math.max(l.start-d.duration,0)}function R(l,d,A,f,m,w){var y=f-A;y<=0&&(P.logger.warn("Fragment should have a positive duration",d),f=A+d.duration,w=m+d.duration);var h=A,c=f,s=d.startPTS,a=d.endPTS;if(Object(K.isFiniteNumber)(s)){var g=Math.abs(s-A);Object(K.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(g,d.deltaPTS):d.deltaPTS=g,h=Math.max(A,s),A=Math.min(A,s),m=Math.min(m,d.startDTS),c=Math.min(f,a),f=Math.max(f,a),w=Math.max(w,d.endDTS)}d.duration=f-A;var p=A-d.start;d.appendedPTS=f,d.start=d.startPTS=A,d.maxStartPTS=h,d.startDTS=m,d.endPTS=f,d.minEndPTS=c,d.endDTS=w;var b=d.sn;if(!l||b<l.startSN||b>l.endSN)return 0;var O,N=b-l.startSN,W=l.fragments;for(W[N]=d,O=N;O>0;O--)I(W[O],W[O-1]);for(O=N;O<W.length-1;O++)I(W[O],W[O+1]);return l.fragmentHint&&I(W[W.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,p}function v(l,d){for(var A=null,f=l.fragments,m=f.length-1;m>=0;m--){var w=f[m].initSegment;if(w){A=w;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var y=0,h;if(L(l,d,function(O,N){O.relurl&&(y=O.cc-N.cc),Object(K.isFiniteNumber)(O.startPTS)&&Object(K.isFiniteNumber)(O.endPTS)&&(N.start=N.startPTS=O.startPTS,N.startDTS=O.startDTS,N.appendedPTS=O.appendedPTS,N.maxStartPTS=O.maxStartPTS,N.endPTS=O.endPTS,N.endDTS=O.endDTS,N.minEndPTS=O.minEndPTS,N.duration=O.endPTS-O.startPTS,N.duration&&(h=N),d.PTSKnown=d.alignedSliding=!0),N.elementaryStreams=O.elementaryStreams,N.loader=O.loader,N.stats=O.stats,N.urlId=O.urlId,O.initSegment&&(N.initSegment=O.initSegment,A=O.initSegment)}),A){var c=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;c.forEach(function(O){var N;(!O.initSegment||O.initSegment.relurl===((N=A)===null||N===void 0?void 0:N.relurl))&&(O.initSegment=A)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(O){return!O}),d.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=d.skippedSegments;s--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var a=d.fragments;if(y){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g<a.length;g++)a[g].cc+=y}d.skippedSegments&&(d.startCC=d.fragments[0].cc),T(l.partList,d.partList,function(O,N){N.elementaryStreams=O.elementaryStreams,N.stats=O.stats}),h?R(d,h,h.startPTS,h.endPTS,h.startDTS,h.endDTS):C(l,d),a.length&&(d.totalduration=d.edge-a[0].start),d.driftStartTime=l.driftStartTime,d.driftStart=l.driftStart;var p=d.advancedDateTime;if(d.advanced&&p){var b=d.edge;d.driftStart||(d.driftStartTime=p,d.driftStart=b),d.driftEndTime=p,d.driftEnd=b}else d.driftEndTime=l.driftEndTime,d.driftEnd=l.driftEnd,d.advancedDateTime=l.advancedDateTime}function T(l,d,A){if(l&&d)for(var f=0,m=0,w=l.length;m<=w;m++){var y=l[m],h=d[m+f];y&&h&&y.index===h.index&&y.fragment.sn===h.fragment.sn?A(y,h):f--}}function L(l,d,A){for(var f=d.skippedSegments,m=Math.max(l.startSN,d.startSN)-d.startSN,w=(l.fragmentHint?1:0)+(f?d.endSN:Math.min(l.endSN,d.endSN))-d.startSN,y=d.startSN-l.startSN,h=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,c=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,s=m;s<=w;s++){var a=c[y+s],g=h[s];f&&!g&&s<f&&(g=d.fragments[s]=a),a&&g&&A(a,g)}}function C(l,d){var A=d.startSN+d.skippedSegments-l.startSN,f=l.fragments;if(A<0||A>=f.length)return;S(d,f[A].start)}function S(l,d){if(d){for(var A=l.fragments,f=l.skippedSegments;f<A.length;f++)A[f].start+=d;l.fragmentHint&&(l.fragmentHint.start+=d)}}function E(l,d){var A=1e3*l.levelTargetDuration,f=A/2,m=l.age,w=m>0&&m<A*3,y=d.loading.end-d.loading.start,h,c=l.availabilityDelay;if(l.updated===!1)if(w){var s=333*l.misses;h=Math.max(Math.min(f,y*2),s),l.availabilityDelay=(l.availabilityDelay||0)+h}else h=f;else w?(c=Math.min(c||A/2,m),l.availabilityDelay=c,h=c+A-m):h=A-y;return Math.round(h)}function u(l,d,A){if(!l||!l.details)return null;var f=l.details,m=f.fragments[d-f.startSN];return m||(m=f.fragmentHint,m&&m.sn===d?m:d<f.startSN&&A&&A.sn===d?A:null)}function o(l,d,A){if(!l||!l.details)return null;var f=l.details.partList;if(f)for(var m=f.length;m--;){var w=f[m];if(w.index===A&&w.fragment.sn===d)return w}return null}},"./src/controller/stream-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return f});var K=D("./src/polyfills/number.ts"),P=D("./src/controller/base-stream-controller.ts"),M=D("./src/is-supported.ts"),U=D("./src/events.ts"),B=D("./src/utils/buffer-helper.ts"),I=D("./src/controller/fragment-tracker.ts"),R=D("./src/types/loader.ts"),v=D("./src/loader/fragment.ts"),T=D("./src/demux/transmuxer-interface.ts"),L=D("./src/types/transmuxer.ts"),C=D("./src/controller/gap-controller.ts"),S=D("./src/errors.ts"),E=D("./src/utils/logger.ts");function u(m,w){for(var y=0;y<w.length;y++){var h=w[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}function o(m,w,y){return w&&u(m.prototype,w),y&&u(m,y),m}function l(m,w){m.prototype=Object.create(w.prototype),m.prototype.constructor=m,d(m,w)}function d(m,w){return d=Object.setPrototypeOf||function(h,c){return h.__proto__=c,h},d(m,w)}var A=100,f=function(m){l(w,m);function w(h,c){var s;return s=m.call(this,h,c,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var y=w.prototype;return y._registerListeners=function(){var c=this.hls;c.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(U.Events.ERROR,this.onError,this),c.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var c=this.hls;c.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(U.Events.ERROR,this.onError,this),c.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},y.startLoad=function(c){if(this.levels){var s=this.lastCurrentTime,a=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var g=a.startLevel;g===-1&&(a.config.testBandwidth?(g=0,this.bitrateTest=!0):g=a.nextAutoLevel),this.level=a.nextLoadLevel=g,this.loadedmetadata=!1}s>0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),c=s),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},y.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},y.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var c,s=this.levels,a=this.level,g=s==null||((c=s[a])===null||c===void 0)?void 0:c.details;if(g&&(!g.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(g))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var p,b=self.performance.now(),O=this.retryDate;(!O||b>=O||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},y.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},y.doTickIdle=function(){var c,s,a=this.hls,g=this.levelLastLoaded,p=this.levels,b=this.media,O=a.config,N=a.nextLoadLevel;if(g===null||!b&&(this.startFragRequested||!O.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[N])return;var W=p[N];this.level=a.nextLoadLevel=N;var Q=W.details;if(!Q||this.state===P.State.WAITING_LEVEL||Q.live&&this.levelLastLoaded!==N){this.state=P.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(F===null)return;var _=F.len,J=this.getMaxBufferLength(W.maxBitrate);if(_>=J)return;if(this._streamEnded(F,Q)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(U.Events.BUFFER_EOS,ee),this.state=P.State.ENDED;return}var re=F.end,de=this.getNextFragment(re,Q);if(this.couldBacktrack&&!this.fragPrevious&&de&&de.sn!=="initSegment"){var Te=de.sn-Q.startSN;Te>1&&(de=Q.fragments[Te-1],this.fragmentTracker.removeFragment(de))}if(de&&this.fragmentTracker.getState(de)===I.FragmentState.OK&&this.nextLoadPosition>re){var ve=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ve,R.PlaylistLevelType.MAIN),de=this.getNextFragment(this.nextLoadPosition,Q)}if(!de)return;de.initSegment&&!de.initSegment.data&&!this.bitrateTest&&(de=de.initSegment),((c=de.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((s=de.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(de,Q):this.loadFragment(de,Q,re)},y.loadFragment=function(c,s,a){var g,p=this.fragmentTracker.getState(c);if(this.fragCurrent=c,p===I.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(c);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else p=I.FragmentState.NOT_LOADED}p===I.FragmentState.NOT_LOADED||p===I.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,c,s,a)):p===I.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((g=this.media)===null||g===void 0?void 0:g.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},y.getAppendedFrag=function(c){var s=this.fragmentTracker.getAppendedFrag(c,R.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},y.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,R.PlaylistLevelType.MAIN)},y.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},y.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},y.nextLevelSwitch=function(){var c=this.levels,s=this.media;if(s!=null&&s.readyState){var a,g=this.getAppendedFrag(s.currentTime);if(g&&g.start>1&&this.flushMainBuffer(0,g.start-1),!s.paused&&c){var p=this.hls.nextLoadLevel,b=c[p],O=this.fragLastKbps;O&&this.fragCurrent?a=this.fragCurrent.duration*b.maxBitrate/(1e3*O)+1:a=0}else a=0;var N=this.getBufferedFrag(s.currentTime+a);if(N){var W=this.followingBufferedFrag(N);if(W){this.abortCurrentFrag();var Q=W.maxStartPTS?W.maxStartPTS:W.start,F=W.duration,_=Math.max(N.end,Q+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(_,Number.POSITIVE_INFINITY)}}}},y.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},y.flushMainBuffer=function(c,s){m.prototype.flushMainBuffer.call(this,c,s,this.altAudio?"video":null)},y.onMediaAttached=function(c,s){m.prototype.onMediaAttached.call(this,c,s);var a=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new C.default(this.config,a,this.fragmentTracker,this.hls)},y.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),m.prototype.onMediaDetaching.call(this)},y.onMediaPlaying=function(){this.tick()},y.onMediaSeeked=function(){var c=this.media,s=c?c.currentTime:null;Object(K.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},y.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(U.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},y.onManifestParsed=function(c,s){var a=!1,g=!1,p;s.levels.forEach(function(b){p=b.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(a=!0),p.indexOf("mp4a.40.5")!==-1&&(g=!0))}),this.audioCodecSwitch=a&&g&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},y.onLevelLoading=function(c,s){var a=this.levels;if(!a||this.state!==P.State.IDLE)return;var g=a[s.level];(!g.details||g.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(g.details))&&(this.state=P.State.WAITING_LEVEL)},y.onLevelLoaded=function(c,s){var a,g=this.levels,p=s.level,b=s.details,O=b.totalduration;if(!g){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+O);var N=this.fragCurrent;N&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==s.level&&N.loader&&(this.state=P.State.IDLE,N.loader.abort()));var W=g[p],Q=0;if(b.live||(a=W.details)!==null&&a!==void 0&&a.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;Q=this.alignPlaylists(b,W.details)}if(W.details=b,this.levelLastLoaded=p,this.hls.trigger(U.Events.LEVEL_UPDATED,{details:b,level:p}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=P.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,Q),this.tick()},y._handleFragmentLoadProgress=function(c){var s,a=c.frag,g=c.part,p=c.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var O=b[a.level],N=O.details;if(!N){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var W=O.videoCodec,Q=N.PTSKnown||!N.live,F=(s=a.initSegment)===null||s===void 0?void 0:s.data,_=this._getAudioCodec(O),J=this.transmuxer=this.transmuxer||new T.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=g?g.index:-1,re=ee!==-1,de=new L.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,p.byteLength,ee,re),Te=this.initPTS[a.cc];J.push(p,F,_,W,a,g,N.totalduration,Q,de,Te)},y.onAudioTrackSwitching=function(c,s){var a=this.altAudio,g=!!s.url,p=s.id;if(!g){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 O=this.hls;a&&O.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),O.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:p})}},y.onAudioTrackSwitched=function(c,s){var a=s.id,g=!!this.hls.audioTracks[a].url;if(g){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=g,this.tick()},y.onBufferCreated=function(c,s){var a=s.tracks,g,p,b=!1;for(var O in a){var N=a[O];if(N.id==="main"){if(p=O,g=N,O==="video"){var W=a[O];W&&(this.videoBuffer=W.buffer)}}else b=!0}b&&g?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=g.buffer):this.mediaBuffer=this.media},y.onFragBuffered=function(c,s){var a=s.frag,g=s.part;if(a&&a.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(g?" p: "+g.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var p=g?g.stats:a.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,g)},y.onError=function(c,s){switch(s.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,s);break;case S.ErrorDetails.LEVEL_LOAD_ERROR:case S.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=P.State.ERROR):!s.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case S.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var a=!0,g=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);g&&g.len>.5&&(a=!this.reduceMaxBufferLength(g.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},y.checkBuffer=function(){var c=this.media,s=this.gapController;if(!c||!s||!c.readyState)return;var a=B.BufferHelper.getBuffered(c);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},y.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},y.onBufferFlushed=function(c,s){var a=s.type;if(a!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var g=(a===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(g,a,R.PlaylistLevelType.MAIN)}},y.onLevelsUpdated=function(c,s){this.levels=s.levels},y.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},y.seekToStartPos=function(){var c=this.media,s=c.currentTime,a=this.startPosition;if(a>=0&&s<a){if(c.seeking){E.logger.log("could not seek to "+a+", already seeking at "+s);return}var g=B.BufferHelper.getBuffered(c),p=g.length?g.start(0):0,b=p-a;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(E.logger.log("adjusting start position by "+b+" to match buffer start"),a+=b,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+s),c.currentTime=a}},y._getAudioCodec=function(c){var s=this.config.defaultAudioCodec||c.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},y._loadBitrateTestFrag=function(c){var s=this;this._doFragLoad(c).then(function(a){var g=s.hls;if(!a||g.nextLoadLevel||s.fragContextChanged(c))return;s.fragLoadError=0,s.state=P.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var p=c.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),g.trigger(U.Events.FRAG_LOADED,a)})},y._handleTransmuxComplete=function(c){var s,a="main",g=this.hls,p=c.remuxResult,b=c.chunkMeta,O=this.getCurrentContext(b);if(!O){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 N=O.frag,W=O.part,Q=O.level,F=p.video,_=p.text,J=p.id3,ee=p.initSegment,re=this.altAudio?void 0:p.audio;if(this.fragContextChanged(N))return;if(this.state=P.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(Q,ee.tracks,N,b),g.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:a,tracks:ee.tracks}));var de=ee.initPTS,Te=ee.timescale;Object(K.isFiniteNumber)(de)&&(this.initPTS[N.cc]=de,g.trigger(U.Events.INIT_PTS_FOUND,{frag:N,id:a,initPTS:de,timescale:Te}))}if(F&&p.independent!==!1){if(Q.details){var ve=F.startPTS,pe=F.endPTS,he=F.startDTS,me=F.endDTS;if(W)W.elementaryStreams[F.type]={startPTS:ve,endPTS:pe,startDTS:he,endDTS:me};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var ae=this.getLoadPosition()+this.config.maxBufferHole;if(ae<ve){this.backtrack(N);return}N.setElementaryStreamInfo(F.type,N.start,pe,N.start,me,!0)}N.setElementaryStreamInfo(F.type,ve,pe,he,me),this.bufferFragmentData(F,N,W,b)}}else if(p.independent===!1){this.backtrack(N);return}if(re){var ue=re.startPTS,be=re.endPTS,Ue=re.startDTS,Pe=re.endDTS;W&&(W.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:be,startDTS:Ue,endDTS:Pe}),N.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ue,be,Ue,Pe),this.bufferFragmentData(re,N,W,b)}if(J!=null&&(s=J.samples)!==null&&s!==void 0&&s.length){var He={frag:N,id:a,samples:J.samples};g.trigger(U.Events.FRAG_PARSING_METADATA,He)}if(_){var Je={frag:N,id:a,samples:_.samples};g.trigger(U.Events.FRAG_PARSING_USERDATA,Je)}},y._bufferInitSegment=function(c,s,a,g){var p=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var b=s.audio,O=s.video,N=s.audiovideo;if(b){var W=c.audioCodec,Q=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(W&&(W.indexOf("mp4a.40.5")!==-1?W="mp4a.40.2":W="mp4a.40.5"),b.metadata.channelCount!==1&&Q.indexOf("firefox")===-1&&(W="mp4a.40.5")),Q.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(W="mp4a.40.2",this.log("Android: force audio codec to "+W)),c.audioCodec&&c.audioCodec!==W&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+W+'"'),b.levelCodec=W,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(W||"")+"/"+(c.audioCodec||"")+"/"+b.codec+"]")}O&&(O.levelCodec=c.videoCodec,O.id="main",this.log("Init video buffer, container:"+O.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+O.codec+"]")),N&&this.log("Init audiovideo buffer, container:"+N.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+N.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(F){var _=s[F],J=_.initSegment;J!=null&&J.byteLength&&p.hls.trigger(U.Events.BUFFER_APPENDING,{type:F,data:J,frag:a,part:null,chunkMeta:g,parent:a.type})}),this.tick()},y.backtrack=function(c){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(c);var s=this.fragmentTracker.backtrack(c);this.fragPrevious=null,this.nextLoadPosition=c.start,s?this.resetFragmentLoading(c):this.state=P.State.BACKTRACKING},y.checkFragmentChanged=function(){var c=this.media,s=null;if(c&&c.readyState>1&&c.seeking===!1){var a=c.currentTime;if(B.BufferHelper.isBuffered(c,a)?s=this.getAppendedFrag(a):B.BufferHelper.isBuffered(c,a+.1)&&(s=this.getAppendedFrag(a+.1)),s){var g=this.fragPlaying,p=s.level;(!g||s.sn!==g.sn||g.level!==p||s.urlId!==g.urlId)&&(this.hls.trigger(U.Events.FRAG_CHANGED,{frag:s}),(!g||g.level!==p)&&this.hls.trigger(U.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=s)}}},o(w,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"SubtitleStreamController",function(){return l});var K=D("./src/events.ts"),P=D("./src/utils/logger.ts"),M=D("./src/utils/buffer-helper.ts"),U=D("./src/controller/fragment-finders.ts"),B=D("./src/utils/discontinuities.ts"),I=D("./src/controller/level-helper.ts"),R=D("./src/controller/fragment-tracker.ts"),v=D("./src/controller/base-stream-controller.ts"),T=D("./src/types/loader.ts"),L=D("./src/types/level.ts");function C(d,A){for(var f=0;f<A.length;f++){var m=A[f];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}function S(d,A,f){return A&&C(d.prototype,A),f&&C(d,f),d}function E(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,u(d,A)}function u(d,A){return u=Object.setPrototypeOf||function(m,w){return m.__proto__=w,m},u(d,A)}var o=500,l=function(d){E(A,d);function A(m,w){var y;return y=d.call(this,m,w,"[subtitle-stream-controller]")||this,y.levels=[],y.currentTrackId=-1,y.tracksBuffered=[],y.mainDetails=null,y._registerListeners(),y}var f=A.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var w=this.hls;w.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(K.Events.ERROR,this.onError,this),w.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f._unregisterListeners=function(){var w=this.hls;w.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(K.Events.ERROR,this.onError,this),w.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(o),this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},f.onLevelLoaded=function(w,y){this.mainDetails=y.details},f.onSubtitleFragProcessed=function(w,y){var h=y.frag,c=y.success;if(this.fragPrevious=h,this.state=v.State.IDLE,!c)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var a,g=h.start,p=0;p<s.length;p++)if(g>=s[p].start&&g<=s[p].end){a=s[p];break}var b=h.start+h.duration;a?a.end=b:(a={start:g,end:b},s.push(a)),this.fragmentTracker.fragBuffered(h)},f.onBufferFlushing=function(w,y){var h=y.startOffset,c=y.endOffset;if(h===0&&c!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,a=this.levels;if(!a.length||!a[s]||!a[s].details)return;var g=a[s].details,p=g.targetduration,b=c-p;if(b<=0)return;y.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(O){for(var N=0;N<O.length;){if(O[N].end<=b){O.shift();continue}else if(O[N].start<b)O[N].start=b;else break;N++}}),this.fragmentTracker.removeFragmentsInRange(h,b,T.PlaylistLevelType.SUBTITLE)}},f.onError=function(w,y){var h,c=y.frag;if(!c||c.type!==T.PlaylistLevelType.SUBTITLE)return;(h=this.fragCurrent)!==null&&h!==void 0&&h.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},f.onSubtitleTracksUpdated=function(w,y){var h=this,c=y.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(s){return new L.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){h.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},f.onSubtitleTrackSwitch=function(w,y){if(this.currentTrackId=y.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var h=this.levels[this.currentTrackId];h!=null&&h.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,h&&this.setInterval(o)},f.onSubtitleTrackLoaded=function(w,y){var h,c=y.details,s=y.id,a=this.currentTrackId,g=this.levels;if(!g.length)return;var p=g[a];if(s>=g.length||s!==a||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(h=p.details)!==null&&h!==void 0&&h.live){var b=this.mainDetails;if(c.deltaUpdateFailed||!b)return;var O=b.fragments[0];if(!p.details)c.hasProgramDateTime&&b.hasProgramDateTime?Object(B.alignMediaPlaylistByPDT)(c,b):O&&Object(I.addSliding)(c,O.start);else{var N=this.alignPlaylists(c,p.details);N===0&&O&&Object(I.addSliding)(c,O.start)}}if(p.details=c,this.levelLastLoaded=s,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var W=Object(U.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);W||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},f._handleFragmentLoadComplete=function(w){var y=w.frag,h=w.payload,c=y.decryptdata,s=this.hls;if(this.fragContextChanged(y))return;if(h&&h.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(h),c.key.buffer,c.iv.buffer).then(function(g){var p=performance.now();s.trigger(K.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:a,tdecrypt:p}})})}},f.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var w,y=this.currentTrackId,h=this.levels;if(!h.length||!h[y]||!h[y].details)return;var c=h[y].details,s=c.targetduration,a=this.config,g=this.media,p=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,g.currentTime-s,a.maxBufferHole),b=p.end,O=p.len,N=this.getMaxBufferLength()+s;if(O>N)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var W=c.fragments,Q=W.length,F=c.edge,_,J=this.fragPrevious;if(b<F){var ee=a.maxFragLookUpTolerance;J&&c.hasProgramDateTime&&(_=Object(U.findFragmentByPDT)(W,J.endProgramDateTime,ee)),_||(_=Object(U.findFragmentByPTS)(J,W,b,ee),!_&&J&&J.start<W[0].start&&(_=W[0]))}else _=W[Q-1];(w=_)!==null&&w!==void 0&&w.encrypted?(P.logger.log("Loading key for "+_.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(K.Events.KEY_LOADING,{frag:_})):_&&this.fragmentTracker.getState(_)===R.FragmentState.NOT_LOADED&&this.loadFragment(_,c,b)}},f.loadFragment=function(w,y,h){this.fragCurrent=w,d.prototype.loadFragment.call(this,w,y,h)},S(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(v.default)},"./src/controller/subtitle-track-controller.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/events.ts"),P=D("./src/utils/texttrack-utils.ts"),M=D("./src/controller/base-playlist-controller.ts"),U=D("./src/types/loader.ts");function B(C,S){for(var E=0;E<S.length;E++){var u=S[E];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(C,u.key,u)}}function I(C,S,E){return S&&B(C.prototype,S),E&&B(C,E),C}function R(C,S){C.prototype=Object.create(S.prototype),C.prototype.constructor=C,v(C,S)}function v(C,S){return v=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},v(C,S)}var T=function(C){R(S,C);function S(u){var o;return o=C.call(this,u,"[subtitle-track-controller]")||this,o.media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o.subtitleDisplay=!0,o.registerListeners(),o}var E=S.prototype;return E.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,C.prototype.destroy.call(this)},E.registerListeners=function(){var o=this.hls;o.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(K.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(K.Events.ERROR,this.onError,this)},E.onMediaAttached=function(o,l){if(this.media=l.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)},E.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},E.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var o=L(this.media.textTracks);o.forEach(function(l){Object(P.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},E.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},E.onManifestParsed=function(o,l){this.tracks=l.subtitleTracks},E.onSubtitleTrackLoaded=function(o,l){var d=l.id,A=l.details,f=this.trackId,m=this.tracksInGroup[f];if(!m){this.warn("Invalid subtitle track id "+d);return}var w=m.details;m.details=l.details,this.log("subtitle track "+d+" loaded ["+A.startSN+"-"+A.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,l,w))},E.onLevelLoading=function(o,l){this.switchLevel(l.level)},E.onLevelSwitching=function(o,l){this.switchLevel(l.level)},E.switchLevel=function(o){var l=this.hls.levels[o];if(!(l!=null&&l.textGroupIds))return;var d=l.textGroupIds[l.urlId];if(this.groupId!==d){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,f=this.tracks.filter(function(y){return!d||y.groupId===d});this.tracksInGroup=f;var m=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=d;var w={subtitleTracks:f};this.log("Updating subtitle tracks, "+f.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(K.Events.SUBTITLE_TRACKS_UPDATED,w),m!==-1&&this.setSubtitleTrack(m,A)}},E.findTrackId=function(o){for(var l=this.tracksInGroup,d=0;d<l.length;d++){var A=l[d];if((!this.selectDefaultTrack||A.default)&&(!o||o===A.name))return A.id}return-1},E.onError=function(o,l){if(C.prototype.onError.call(this,o,l),l.fatal||!l.context)return;l.context.type===U.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},E.loadPlaylist=function(o){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var d=l.id,A=l.groupId,f=l.url;if(o)try{f=o.addDirectives(f)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADING,{url:f,id:d,groupId:A,deliveryDirectives:o||null})}},E.toggleTrackModes=function(o){var l=this,d=this.media,A=this.subtitleDisplay,f=this.trackId;if(!d)return;var m=L(d.textTracks),w=m.filter(function(c){return c.groupId===l.groupId});if(o===-1)[].slice.call(m).forEach(function(c){c.mode="disabled"});else{var y=w[f];y&&(y.mode="disabled")}var h=w[o];h&&(h.mode=A?"showing":"hidden")},E.setSubtitleTrack=function(o,l){var d,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(d=A[o])!==null&&d!==void 0&&d.details)||o<-1||o>=A.length)return;this.clearTimer();var f=A[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,f){var m=f.id,w=f.groupId,y=w===void 0?"":w,h=f.name,c=f.type,s=f.url;this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:y,name:h,type:c,url:s});var a=this.switchParams(f.url,l==null?void 0:l.details);this.loadPlaylist(a)}else this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:o})},E.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,l=L(this.media.textTracks),d=0;d<l.length;d++)if(l[d].mode==="hidden")o=d;else if(l[d].mode==="showing"){o=d;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},I(S,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,l)}}]),S}(M.default);function L(C){for(var S=[],E=0;E<C.length;E++){var u=C[E];u.kind==="subtitles"&&u.label&&S.push(C[E])}return S}G.default=T},"./src/controller/timeline-controller.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"TimelineController",function(){return L});var K=D("./src/polyfills/number.ts"),P=D("./src/events.ts"),M=D("./src/utils/cea-608-parser.ts"),U=D("./src/utils/output-filter.ts"),B=D("./src/utils/webvtt-parser.ts"),I=D("./src/utils/texttrack-utils.ts"),R=D("./src/utils/imsc1-ttml-parser.ts"),v=D("./src/types/loader.ts"),T=D("./src/utils/logger.ts"),L=function(){function u(l){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=E(),this.captionsProperties=void 0,this.hls=l,this.config=l.config,this.Cues=l.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 d=new U.default(this,"textTrack1"),A=new U.default(this,"textTrack2"),f=new U.default(this,"textTrack3"),m=new U.default(this,"textTrack4");this.cea608Parser1=new M.default(1,d,A),this.cea608Parser2=new M.default(3,f,m)}l.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(P.Events.FRAG_LOADING,this.onFragLoading,this),l.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=u.prototype;return o.destroy=function(){var d=this.hls;d.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(P.Events.FRAG_LOADING,this.onFragLoading,this),d.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(d,A,f,m,w){for(var y=!1,h=w.length;h--;){var c=w[h],s=S(c[0],c[1],A,f);if(s>=0&&(c[0]=Math.min(c[0],A),c[1]=Math.max(c[1],f),y=!0,s/(f-A)>.5))return}if(y||w.push([A,f]),this.config.renderTextTracksNatively){var a=this.captionsTracks[d];this.Cues.newCue(a,A,f,m)}else{var g=this.Cues.newCue(null,A,f,m);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:g,track:d})}},o.onInitPtsFound=function(d,A){var f=this,m=A.frag,w=A.id,y=A.initPTS,h=A.timescale,c=this.unparsedVttFrags;w==="main"&&(this.initPTS[m.cc]=y,this.timescale[m.cc]=h),c.length&&(this.unparsedVttFrags=[],c.forEach(function(s){f.onFragLoaded(P.Events.FRAG_LOADED,s)}))},o.getExistingTrack=function(d){var A=this.media;if(A)for(var f=0;f<A.textTracks.length;f++){var m=A.textTracks[f];if(m[d])return m}return null},o.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},o.createNativeTrack=function(d){if(this.captionsTracks[d])return;var A=this.captionsProperties,f=this.captionsTracks,m=this.media,w=A[d],y=w.label,h=w.languageCode,c=this.getExistingTrack(d);if(c)f[d]=c,Object(I.clearCurrentCues)(f[d]),Object(I.sendAddTrackEvent)(f[d],m);else{var s=this.createTextTrack("captions",y,h);s&&(s[d]=!0,f[d]=s)}},o.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var A=this.captionsProperties[d];if(!A)return;var f=A.label,m={_id:d,label:f,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[d]=m,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},o.createTextTrack=function(d,A,f){var m=this.media;return m?m.addTextTrack(d,A,f):void 0},o.onMediaAttaching=function(d,A){this.media=A.media,this._cleanTracks()},o.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(A){Object(I.clearCurrentCues)(d[A]),delete d[A]}),this.nonNativeCaptionsTracks={}},o.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=E(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},o._cleanTracks=function(){var d=this.media;if(!d)return;var A=d.textTracks;if(A)for(var f=0;f<A.length;f++)Object(I.clearCurrentCues)(A[f])},o.onSubtitleTracksUpdated=function(d,A){var f=this;this.textTracks=[];var m=A.subtitleTracks||[],w=m.some(function(s){return s.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var y=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var h=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,a){var g;if(a<h.length){for(var p=null,b=0;b<h.length;b++)if(C(h[b],s)){p=h[b];break}p&&(g=p)}g?Object(I.clearCurrentCues)(g):(g=f.createTextTrack("subtitles",s.name,s.lang),g&&(g.mode="disabled")),g&&(g.groupId=s.groupId,f.textTracks.push(g))})}else if(!y&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},o.onManifestLoaded=function(d,A){var f=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(m){var w=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!w)return;var y="textTrack"+w[1],h=f.captionsProperties[y];if(!h)return;h.label=m.name,m.lang&&(h.languageCode=m.lang),h.media=m})},o.onFragLoading=function(d,A){var f=this.cea608Parser1,m=this.cea608Parser2,w=this.lastSn,y=this.lastPartIndex;if(!this.enabled||!(f&&m))return;if(A.frag.type===v.PlaylistLevelType.MAIN){var h,c,s=A.frag.sn,a=(h=A==null||((c=A.part)===null||c===void 0)?void 0:c.index)!=null?h:-1;s===w+1||s===w&&a===y+1||(f.reset(),m.reset()),this.lastSn=s,this.lastPartIndex=a}},o.onFragLoaded=function(d,A){var f=A.frag,m=A.payload,w=this.initPTS,y=this.unparsedVttFrags;if(f.type===v.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(K.isFiniteNumber)(w[f.cc])){y.push(A),w.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Missing initial subtitle PTS")});return}var h=f.decryptdata;if(h==null||h.key==null||h.method!=="AES-128"){var c=this.tracks[f.level],s=this.vttCCs;s[f.cc]||(s[f.cc]={start:f.start,prevCC:this.prevCC,new:!0},this.prevCC=f.cc),c&&c.textCodec===R.IMSC1_CODEC?this._parseIMSC1(f,m):this._parseVTTs(f,m,s)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(d,A){var f=this,m=this.hls;Object(R.parseIMSC1)(A,this.initPTS[d.cc],this.timescale[d.cc],function(w){f._appendCues(w,d.level),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(w){T.logger.log("Failed to parse IMSC1: "+w),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:w})})},o._parseVTTs=function(d,A,f){var m=this,w=this.hls;Object(B.parseWebVTT)(A,this.initPTS[d.cc],this.timescale[d.cc],f,d.cc,d.start,function(y){m._appendCues(y,d.level),w.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(y){m._fallbackToIMSC1(d,A),T.logger.log("Failed to parse VTT cue: "+y),w.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:y})})},o._fallbackToIMSC1=function(d,A){var f=this,m=this.tracks[d.level];m.textCodec||Object(R.parseIMSC1)(A,this.initPTS[d.cc],this.timescale[d.cc],function(){m.textCodec=R.IMSC1_CODEC,f._parseIMSC1(d,A)},function(){m.textCodec="wvtt"})},o._appendCues=function(d,A){var f=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[A];if(m.mode==="disabled")return;d.forEach(function(h){return Object(I.addCueToTrack)(m,h)})}else{var w=this.tracks[A],y=w.default?"default":"subtitles"+A;f.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:d,track:y})}},o.onFragDecrypted=function(d,A){var f=A.frag;if(f.type===v.PlaylistLevelType.SUBTITLE){if(!Object(K.isFiniteNumber)(this.initPTS[f.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(P.Events.FRAG_LOADED,A)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(d,A){var f=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(f&&m))return;for(var w=0;w<A.samples.length;w++){var y=A.samples[w].bytes;if(y){var h=this.extractCea608Data(y);f.addData(A.samples[w].pts,h[0]),m.addData(A.samples[w].pts,h[1])}}},o.onBufferFlushing=function(d,A){var f=A.startOffset,m=A.endOffset,w=A.endOffsetSubtitles,y=A.type,h=this.media;if(!h||h.currentTime<m)return;if(!y||y==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(a){return Object(I.removeCuesInRange)(c[a],f,m)})}if(this.config.renderTextTracksNatively&&(f===0&&w!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(a){return Object(I.removeCuesInRange)(s[a],f,w)})}},o.extractCea608Data=function(d){for(var A=d[0]&31,f=2,m=[[],[]],w=0;w<A;w++){var y=d[f++],h=127&d[f++],c=127&d[f++],s=(4&y)!==0,a=3&y;if(h===0&&c===0)continue;s&&((a===0||a===1)&&(m[a].push(h),m[a].push(c)))}return m},u}();function C(u,o){return u&&u.label===o.name&&!(u.textTrack1||u.textTrack2)}function S(u,o,l,d){return Math.min(o,d)-Math.max(u,l)}function E(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(U,B){this.subtle=void 0,this.aesIV=void 0,this.subtle=U,this.aesIV=B}var M=P.prototype;return M.decrypt=function(B,I){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},I,B)},P}()},"./src/crypt/aes-decryptor.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"removePadding",function(){return P}),D.d(G,"default",function(){return M});var K=D("./src/utils/typed-array.ts");function P(U){var B=U.byteLength,I=B&&new DataView(U.buffer).getUint8(B-1);return I?Object(K.sliceUint8)(U,0,B-I):U}var M=function(){function U(){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=U.prototype;return B.uint8ArrayToUint32Array_=function(R){for(var v=new DataView(R),T=new Uint32Array(4),L=0;L<4;L++)T[L]=v.getUint32(L*4);return T},B.initTable=function(){var R=this.sBox,v=this.invSBox,T=this.subMix,L=T[0],C=T[1],S=T[2],E=T[3],u=this.invSubMix,o=u[0],l=u[1],d=u[2],A=u[3],f=new Uint32Array(256),m=0,w=0,y=0;for(y=0;y<256;y++)y<128?f[y]=y<<1:f[y]=y<<1^283;for(y=0;y<256;y++){var h=w^w<<1^w<<2^w<<3^w<<4;h=h>>>8^h&255^99,R[m]=h,v[h]=m;var c=f[m],s=f[c],a=f[s],g=f[h]*257^h*16843008;L[m]=g<<24|g>>>8,C[m]=g<<16|g>>>16,S[m]=g<<8|g>>>24,E[m]=g,g=a*16843009^s*65537^c*257^m*16843008,o[h]=g<<24|g>>>8,l[h]=g<<16|g>>>16,d[h]=g<<8|g>>>24,A[h]=g,m?(m=c^f[f[f[a^c]]],w^=f[f[w]]):m=w=1}},B.expandKey=function(R){for(var v=this.uint8ArrayToUint32Array_(R),T=!0,L=0;L<v.length&&T;)T=v[L]===this.key[L],L++;if(T)return;this.key=v;var C=this.keySize=v.length;if(C!==4&&C!==6&&C!==8)throw new Error("Invalid aes key size="+C);var S=this.ksRows=(C+6+1)*4,E,u,o=this.keySchedule=new Uint32Array(S),l=this.invKeySchedule=new Uint32Array(S),d=this.sBox,A=this.rcon,f=this.invSubMix,m=f[0],w=f[1],y=f[2],h=f[3],c,s;for(E=0;E<S;E++){if(E<C){c=o[E]=v[E];continue}s=c,E%C===0?(s=s<<8|s>>>24,s=d[s>>>24]<<24|d[s>>>16&255]<<16|d[s>>>8&255]<<8|d[s&255],s^=A[E/C|0]<<24):C>6&&E%C===4&&(s=d[s>>>24]<<24|d[s>>>16&255]<<16|d[s>>>8&255]<<8|d[s&255]),o[E]=c=(o[E-C]^s)>>>0}for(u=0;u<S;u++)E=S-u,u&3?s=o[E]:s=o[E-4],u<4||E<=4?l[u]=s:l[u]=m[d[s>>>24]]^w[d[s>>>16&255]]^y[d[s>>>8&255]]^h[d[s&255]],l[u]=l[u]>>>0},B.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},B.decrypt=function(R,v,T){for(var L=this.keySize+6,C=this.invKeySchedule,S=this.invSBox,E=this.invSubMix,u=E[0],o=E[1],l=E[2],d=E[3],A=this.uint8ArrayToUint32Array_(T),f=A[0],m=A[1],w=A[2],y=A[3],h=new Int32Array(R),c=new Int32Array(h.length),s,a,g,p,b,O,N,W,Q,F,_,J,ee,re,de=this.networkToHostOrderSwap;v<h.length;){for(Q=de(h[v]),F=de(h[v+1]),_=de(h[v+2]),J=de(h[v+3]),b=Q^C[0],O=J^C[1],N=_^C[2],W=F^C[3],ee=4,re=1;re<L;re++)s=u[b>>>24]^o[O>>16&255]^l[N>>8&255]^d[W&255]^C[ee],a=u[O>>>24]^o[N>>16&255]^l[W>>8&255]^d[b&255]^C[ee+1],g=u[N>>>24]^o[W>>16&255]^l[b>>8&255]^d[O&255]^C[ee+2],p=u[W>>>24]^o[b>>16&255]^l[O>>8&255]^d[N&255]^C[ee+3],b=s,O=a,N=g,W=p,ee=ee+4;s=S[b>>>24]<<24^S[O>>16&255]<<16^S[N>>8&255]<<8^S[W&255]^C[ee],a=S[O>>>24]<<24^S[N>>16&255]<<16^S[W>>8&255]<<8^S[b&255]^C[ee+1],g=S[N>>>24]<<24^S[W>>16&255]<<16^S[b>>8&255]<<8^S[O&255]^C[ee+2],p=S[W>>>24]<<24^S[b>>16&255]<<16^S[O>>8&255]<<8^S[N&255]^C[ee+3],c[v]=de(s^f),c[v+1]=de(p^m),c[v+2]=de(g^w),c[v+3]=de(a^y),f=Q,m=F,w=_,y=J,v=v+4}return c.buffer},U}()},"./src/crypt/decrypter.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return v});var K=D("./src/crypt/aes-crypto.ts"),P=D("./src/crypt/fast-aes-key.ts"),M=D("./src/crypt/aes-decryptor.ts"),U=D("./src/utils/logger.ts"),B=D("./src/utils/mp4-tools.ts"),I=D("./src/utils/typed-array.ts"),R=16,v=function(){function T(C,S,E){var u=E===void 0?{}:E,o=u.removePKCS7Padding,l=o===void 0?!0:o;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=C,this.config=S,this.removePKCS7Padding=l,l)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var L=T.prototype;return L.destroy=function(){this.observer=null},L.isSync=function(){return this.config.enableSoftwareAES},L.flush=function(){var S=this.currentResult;if(!S){this.reset();return}var E=new Uint8Array(S);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(E):E},L.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},L.decrypt=function(S,E,u,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(S),E,u);var l=this.flush();l&&o(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(S),E,u).then(o)},L.softwareDecrypt=function(S,E,u){var o=this.currentIV,l=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(S=Object(B.appendUint8Array)(d,S),this.remainderData=null);var A=this.getValidChunk(S);if(!A.length)return null;o&&(u=o);var f=this.softwareDecrypter;f||(f=this.softwareDecrypter=new M.default),f.expandKey(E);var m=l;return this.currentResult=f.decrypt(A.buffer,0,u),this.currentIV=Object(I.sliceUint8)(A,-16).buffer,m||null},L.webCryptoDecrypt=function(S,E,u){var o=this,l=this.subtle;return(this.key!==E||!this.fastAesKey)&&(this.key=E,this.fastAesKey=new P.default(l,E)),this.fastAesKey.expandKey().then(function(d){if(!l)return Promise.reject(new Error("web crypto not initialized"));var A=new K.default(l,u);return A.decrypt(S.buffer,d)}).catch(function(d){return o.onWebCryptoError(d,S,E,u)})},L.onWebCryptoError=function(S,E,u,o){return U.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",S),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(E,u,o)},L.getValidChunk=function(S){var E=S,u=S.length-S.length%R;return u!==S.length&&(E=Object(I.sliceUint8)(S,0,u),this.remainderData=Object(I.sliceUint8)(S,u)),E},L.logOnce=function(S){if(!this.logEnabled)return;U.logger.log("[decrypter.ts]: "+S),this.logEnabled=!1},T}()},"./src/crypt/fast-aes-key.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(U,B){this.subtle=void 0,this.key=void 0,this.subtle=U,this.key=B}var M=P.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/demux/base-audio-demuxer.ts"),P=D("./src/demux/adts.ts"),M=D("./src/utils/logger.ts"),U=D("./src/demux/id3.ts");function B(v,T){v.prototype=Object.create(T.prototype),v.prototype.constructor=v,I(v,T)}function I(v,T){return I=Object.setPrototypeOf||function(C,S){return C.__proto__=S,C},I(v,T)}var R=function(v){B(T,v);function T(C,S){var E;return E=v.call(this)||this,E.observer=void 0,E.config=void 0,E.observer=C,E.config=S,E}var L=T.prototype;return L.resetInitSegment=function(S,E,u){v.prototype.resetInitSegment.call(this,S,E,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:S,duration:u,inputTimeScale:9e4,dropped:0}},T.probe=function(S){if(!S)return!1;for(var E=U.getID3Data(S,0)||[],u=E.length,o=S.length;u<o;u++)if(P.probe(S,u))return M.logger.log("ADTS sync word found !"),!0;return!1},L.canParse=function(S,E){return P.canParse(S,E)},L.appendFrame=function(S,E,u){P.initTrackConfig(S,this.observer,E,u,S.manifestCodec);var o=P.appendFrame(S,E,u,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},T}(K.default);R.minProbeByteLength=9,G.default=R},"./src/demux/adts.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"getAudioConfig",function(){return U}),D.d(G,"isHeaderPattern",function(){return B}),D.d(G,"getHeaderLength",function(){return I}),D.d(G,"getFullFrameLength",function(){return R}),D.d(G,"canGetFrameLength",function(){return v}),D.d(G,"isHeader",function(){return T}),D.d(G,"canParse",function(){return L}),D.d(G,"probe",function(){return C}),D.d(G,"initTrackConfig",function(){return S}),D.d(G,"getFrameDuration",function(){return E}),D.d(G,"parseFrameHeader",function(){return u}),D.d(G,"appendFrame",function(){return o});var K=D("./src/utils/logger.ts"),P=D("./src/errors.ts"),M=D("./src/events.ts");function U(l,d,A,f){var m,w,y,h,c=navigator.userAgent.toLowerCase(),s=f,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((d[A+2]&192)>>>6)+1;var g=(d[A+2]&60)>>>2;if(g>a.length-1){l.trigger(M.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g});return}return y=(d[A+2]&1)<<2,y|=(d[A+3]&192)>>>6,K.logger.log("manifest codec:"+f+", ADTS type:"+m+", samplingIndex:"+g),/firefox/i.test(c)?g>=6?(m=5,h=new Array(4),w=g-3):(m=2,h=new Array(2),w=g):c.indexOf("android")!==-1?(m=2,h=new Array(2),w=g):(m=5,h=new Array(4),f&&(f.indexOf("mp4a.40.29")!==-1||f.indexOf("mp4a.40.5")!==-1)||!f&&g>=6?w=g-3:((f&&f.indexOf("mp4a.40.2")!==-1&&(g>=6&&y===1||/vivaldi/i.test(c))||!f&&y===1)&&(m=2,h=new Array(2)),w=g)),h[0]=m<<3,h[0]|=(g&14)>>1,h[1]|=(g&1)<<7,h[1]|=y<<3,m===5&&(h[1]|=(w&14)>>1,h[2]=(w&1)<<7,h[2]|=2<<2,h[3]=0),{config:h,samplerate:a[g],channelCount:y,codec:"mp4a.40."+m,manifestCodec:s}}function B(l,d){return l[d]===255&&(l[d+1]&246)===240}function I(l,d){return l[d+1]&1?7:9}function R(l,d){return(l[d+3]&3)<<11|l[d+4]<<3|(l[d+5]&224)>>>5}function v(l,d){return d+5<l.length}function T(l,d){return d+1<l.length&&B(l,d)}function L(l,d){return v(l,d)&&B(l,d)&&R(l,d)<=l.length-d}function C(l,d){if(T(l,d)){var A=I(l,d);if(d+A>=l.length)return!1;var f=R(l,d);if(f<=A)return!1;var m=d+f;return m===l.length||T(l,m)}return!1}function S(l,d,A,f,m){if(!l.samplerate){var w=U(d,A,f,m);if(!w)return;l.config=w.config,l.samplerate=w.samplerate,l.channelCount=w.channelCount,l.codec=w.codec,l.manifestCodec=w.manifestCodec,K.logger.log("parsed codec:"+l.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function E(l){return 1024*9e4/l}function u(l,d,A,f,m){var w=I(l,d),y=R(l,d);if(y-=w,y>0){var h=A+f*m;return{headerLength:w,frameLength:y,stamp:h}}}function o(l,d,A,f,m){var w=E(l.samplerate),y=u(d,A,f,m,w);if(y){var h=y.frameLength,c=y.headerLength,s=y.stamp,a=c+h,g=Math.max(0,A+a-d.length),p;g?(p=new Uint8Array(a-c),p.set(d.subarray(A+c,d.length),0)):p=d.subarray(A+c,A+a);var b={unit:p,pts:s};return g||l.samples.push(b),{sample:b,length:a,missing:g}}}},"./src/demux/base-audio-demuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"initPTSFn",function(){return R});var K=D("./src/polyfills/number.ts"),P=D("./src/demux/id3.ts"),M=D("./src/demux/dummy-demuxed-track.ts"),U=D("./src/utils/mp4-tools.ts"),B=D("./src/utils/typed-array.ts"),I=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var T=v.prototype;return T.resetInitSegment=function(C,S,E){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},T.resetTimeStamp=function(){},T.resetContiguity=function(){},T.canParse=function(C,S){return!1},T.appendFrame=function(C,S,E){},T.demux=function(C,S){this.cachedData&&(C=Object(U.appendUint8Array)(this.cachedData,C),this.cachedData=null);var E=P.getID3Data(C,0),u=E?E.length:0,o,l,d=this._audioTrack,A=this._id3Track,f=E?P.getTimeStamp(E):void 0,m=C.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(f,S)),E&&E.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:E}),l=this.initPTS;u<m;){if(this.canParse(C,u)){var w=this.appendFrame(d,C,u);w?(this.frameIndex++,l=w.sample.pts,u+=w.length,o=u):u=m}else P.canParse(C,u)?(E=P.getID3Data(C,u),A.samples.push({pts:l,dts:l,data:E}),u+=E.length,o=u):u++;if(u===m&&o!==m){var y=Object(B.sliceUint8)(C,o);this.cachedData?this.cachedData=Object(U.appendUint8Array)(this.cachedData,y):this.cachedData=y}}return{audioTrack:d,avcTrack:Object(M.dummyTrack)(),id3Track:A,textTrack:Object(M.dummyTrack)()}},T.demuxSampleAes=function(C,S,E){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},T.flush=function(C){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)()}},T.destroy=function(){},v}(),R=function(T,L){return Object(K.isFiniteNumber)(T)?T*90:L*9e4};G.default=I},"./src/demux/chunk-cache.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function M(){this.chunks=[],this.dataLength=0}var U=M.prototype;return U.push=function(I){this.chunks.push(I),this.dataLength+=I.length},U.flush=function(){var I=this.chunks,R=this.dataLength,v;if(I.length)I.length===1?v=I[0]:v=P(I,R);else return new Uint8Array(0);return this.reset(),v},U.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function P(M,U){for(var B=new Uint8Array(U),I=0,R=0;R<M.length;R++){var v=M[R];B.set(v,I),I+=v.length}return B}},"./src/demux/dummy-demuxed-track.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"dummyTrack",function(){return K});function K(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/logger.ts"),P=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 U=M.prototype;return U.loadWord=function(){var I=this.data,R=this.bytesAvailable,v=I.byteLength-R,T=new Uint8Array(4),L=Math.min(4,R);if(L===0)throw new Error("no bytes available");T.set(I.subarray(v,v+L)),this.word=new DataView(T.buffer).getUint32(0),this.bitsAvailable=L*8,this.bytesAvailable-=L},U.skipBits=function(I){var R;this.bitsAvailable>I?(this.word<<=I,this.bitsAvailable-=I):(I-=this.bitsAvailable,R=I>>3,I-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=I,this.bitsAvailable-=I)},U.readBits=function(I){var R=Math.min(this.bitsAvailable,I),v=this.word>>>32-R;return I>32&&K.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=I-R,R>0&&this.bitsAvailable?v<<R|this.readBits(R):v},U.skipLZ=function(){var I;for(I=0;I<this.bitsAvailable;++I)if((this.word&2147483648>>>I)!==0)return this.word<<=I,this.bitsAvailable-=I,I;return this.loadWord(),I+this.skipLZ()},U.skipUEG=function(){this.skipBits(1+this.skipLZ())},U.skipEG=function(){this.skipBits(1+this.skipLZ())},U.readUEG=function(){var I=this.skipLZ();return this.readBits(I+1)-1},U.readEG=function(){var I=this.readUEG();return 1&I?1+I>>>1:-1*(I>>>1)},U.readBoolean=function(){return this.readBits(1)===1},U.readUByte=function(){return this.readBits(8)},U.readUShort=function(){return this.readBits(16)},U.readUInt=function(){return this.readBits(32)},U.skipScalingList=function(I){for(var R=8,v=8,T,L=0;L<I;L++)v!==0&&(T=this.readEG(),v=(R+T+256)%256),R=v===0?R:v},U.readSPS=function(){var I=0,R=0,v=0,T=0,L,C,S,E=this.readUByte.bind(this),u=this.readBits.bind(this),o=this.readUEG.bind(this),l=this.readBoolean.bind(this),d=this.skipBits.bind(this),A=this.skipEG.bind(this),f=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);E();var w=E();if(u(5),d(3),E(),f(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var y=o();if(y===3&&d(1),f(),f(),d(1),l())for(C=y!==3?8:12,S=0;S<C;S++)l()&&(S<6?m(16):m(64))}f();var h=o();if(h===0)o();else if(h===1)for(d(1),A(),A(),L=o(),S=0;S<L;S++)A();f(),d(1);var c=o(),s=o(),a=u(1);a===0&&d(1),d(1),l()&&(I=o(),R=o(),v=o(),T=o());var g=[1,1];if(l()&&l()){var p=E();switch(p){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[E()<<8|E(),E()<<8|E()];break}}}return{width:Math.ceil((c+1)*16-I*2-R*2),height:(2-a)*(s+1)*16-(a?2:4)*(v+T),pixelRatio:g}},U.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();G.default=P},"./src/demux/id3.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isHeader",function(){return K}),D.d(G,"isFooter",function(){return P}),D.d(G,"getID3Data",function(){return M}),D.d(G,"canParse",function(){return B}),D.d(G,"getTimeStamp",function(){return I}),D.d(G,"isTimeStampFrame",function(){return R}),D.d(G,"getID3Frames",function(){return T}),D.d(G,"decodeFrame",function(){return L}),D.d(G,"utf8ArrayToStr",function(){return o}),D.d(G,"testables",function(){return l});var K=function(m,w){return w+10<=m.length&&(m[w]===73&&m[w+1]===68&&m[w+2]===51&&(m[w+3]<255&&m[w+4]<255&&(m[w+6]<128&&m[w+7]<128&&m[w+8]<128&&m[w+9]<128)))},P=function(m,w){return w+10<=m.length&&(m[w]===51&&m[w+1]===68&&m[w+2]===73&&(m[w+3]<255&&m[w+4]<255&&(m[w+6]<128&&m[w+7]<128&&m[w+8]<128&&m[w+9]<128)))},M=function(m,w){for(var y=w,h=0;K(m,w);){h+=10;var c=U(m,w+6);h+=c,P(m,w+10)&&(h+=10),w+=h}return h>0?m.subarray(y,y+h):void 0},U=function(m,w){var y=0;return y=(m[w]&127)<<21,y|=(m[w+1]&127)<<14,y|=(m[w+2]&127)<<7,y|=m[w+3]&127,y},B=function(m,w){return K(m,w)&&U(m,w+6)+10<=m.length-w},I=function(m){for(var w=T(m),y=0;y<w.length;y++){var h=w[y];if(R(h))return u(h)}return},R=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},v=function(m){var w=String.fromCharCode(m[0],m[1],m[2],m[3]),y=U(m,4),h=10;return{type:w,size:y,data:m.subarray(h,h+y)}},T=function(m){for(var w=0,y=[];K(m,w);){var h=U(m,w+6);w+=10;for(var c=w+h;w+8<c;){var s=v(m.subarray(w)),a=L(s);a&&y.push(a),w+=s.size+10}P(m,w)&&(w+=10)}return y},L=function(m){return m.type==="PRIV"?C(m):m.type[0]==="W"?E(m):S(m)},C=function(m){if(m.size<2)return;var w=o(m.data,!0),y=new Uint8Array(m.data.subarray(w.length+1));return{key:m.type,info:w,data:y.buffer}},S=function(m){if(m.size<2)return;if(m.type==="TXXX"){var w=1,y=o(m.data.subarray(w),!0);w+=y.length+1;var h=o(m.data.subarray(w));return{key:m.type,info:y,data:h}}var c=o(m.data.subarray(1));return{key:m.type,data:c}},E=function(m){if(m.type==="WXXX"){if(m.size<2)return;var w=1,y=o(m.data.subarray(w),!0);w+=y.length+1;var h=o(m.data.subarray(w));return{key:m.type,info:y,data:h}}var c=o(m.data);return{key:m.type,data:c}},u=function(m){if(m.data.byteLength===8){var w=new Uint8Array(m.data),y=w[3]&1,h=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return h/=45,y&&(h+=4772185884e-2),Math.round(h)}return},o=function(m,w){w===void 0&&(w=!1);var y=A();if(y){var h=y.decode(m);if(w){var c=h.indexOf("\0");return c!==-1?h.substring(0,c):h}return h.replace(/\0/g,"")}for(var s=m.length,a,g,p,b="",O=0;O<s;){if(a=m[O++],a===0&&w)return b;if(a===0||a===3)continue;switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(a);break;case 12:case 13:g=m[O++],b+=String.fromCharCode((a&31)<<6|g&63);break;case 14:g=m[O++],p=m[O++],b+=String.fromCharCode((a&15)<<12|(g&63)<<6|(p&63)<<0);break;default:}}return b},l={decodeTextFrame:S},d;function A(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/demux/base-audio-demuxer.ts"),P=D("./src/demux/id3.ts"),M=D("./src/utils/logger.ts"),U=D("./src/demux/mpegaudio.ts");function B(v,T){v.prototype=Object.create(T.prototype),v.prototype.constructor=v,I(v,T)}function I(v,T){return I=Object.setPrototypeOf||function(C,S){return C.__proto__=S,C},I(v,T)}var R=function(v){B(T,v);function T(){return v.apply(this,arguments)||this}var L=T.prototype;return L.resetInitSegment=function(S,E,u){v.prototype.resetInitSegment.call(this,S,E,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:S,duration:u,inputTimeScale:9e4,dropped:0}},T.probe=function(S){if(!S)return!1;for(var E=P.getID3Data(S,0)||[],u=E.length,o=S.length;u<o;u++)if(U.probe(S,u))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},L.canParse=function(S,E){return U.canParse(S,E)},L.appendFrame=function(S,E,u){return this.initPTS===null?void 0:U.appendFrame(S,E,u,this.initPTS,this.frameIndex)},T}(K.default);R.minProbeByteLength=4,G.default=R},"./src/demux/mp4demuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/mp4-tools.ts"),P=D("./src/demux/dummy-demuxed-track.ts"),M=function(){function U(I,R){this.remainderData=null,this.config=void 0,this.config=R}var B=U.prototype;return B.resetTimeStamp=function(){},B.resetInitSegment=function(){},B.resetContiguity=function(){},U.probe=function(R){return Object(K.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},B.demux=function(R){var v=R,T=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(K.appendUint8Array)(this.remainderData,R));var L=Object(K.segmentValidRange)(v);this.remainderData=L.remainder,T.samples=L.valid||new Uint8Array}else T.samples=v;return{audioTrack:Object(P.dummyTrack)(),avcTrack:T,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},B.flush=function(){var R=Object(P.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:R,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},B.demuxSampleAes=function(R,v,T){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},B.destroy=function(){},U}();M.minProbeByteLength=1024,G.default=M},"./src/demux/mpegaudio.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"appendFrame",function(){return I}),D.d(G,"parseHeader",function(){return R}),D.d(G,"isHeaderPattern",function(){return v}),D.d(G,"isHeader",function(){return T}),D.d(G,"canParse",function(){return L}),D.d(G,"probe",function(){return C});var K=null,P=[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],U=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],B=[0,1,1,4];function I(S,E,u,o,l){if(u+24>E.length)return;var d=R(E,u);if(d&&u+d.frameLength<=E.length){var A=d.samplesPerFrame*9e4/d.sampleRate,f=o+l*A,m={unit:E.subarray(u,u+d.frameLength),pts:f,dts:f};return S.config=[],S.channelCount=d.channelCount,S.samplerate=d.sampleRate,S.samples.push(m),{sample:m,length:d.frameLength,missing:0}}}function R(S,E){var u=S[E+1]>>3&3,o=S[E+1]>>1&3,l=S[E+2]>>4&15,d=S[E+2]>>2&3;if(u!==1&&l!==0&&l!==15&&d!==3){var A=S[E+2]>>1&1,f=S[E+3]>>6,m=u===3?3-o:o===3?3:4,w=P[m*14+l-1]*1e3,y=u===3?0:u===2?1:2,h=M[y*3+d],c=f===3?1:2,s=U[u][o],a=B[o],g=s*8*a,p=Math.floor(s*w/h+A)*a;if(K===null){var b=navigator.userAgent||"",O=b.match(/Chrome\/(\d+)/i);K=O?parseInt(O[1]):0}var N=!!K&&K<=87;return N&&o===2&&w>=224e3&&f===0&&(S[E+3]=S[E+3]|128),{sampleRate:h,channelCount:c,frameLength:p,samplesPerFrame:g}}}function v(S,E){return S[E]===255&&(S[E+1]&224)===224&&(S[E+1]&6)!==0}function T(S,E){return E+1<S.length&&v(S,E)}function L(S,E){var u=4;return v(S,E)&&u<=S.length-E}function C(S,E){if(E+1<S.length&&v(S,E)){var u=4,o=R(S,E),l=u;o!=null&&o.frameLength&&(l=o.frameLength);var d=E+l;return d===S.length||T(S,d)}return!1}},"./src/demux/sample-aes.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/crypt/decrypter.ts"),P=D("./src/demux/tsdemuxer.ts"),M=function(){function U(I,R,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new K.default(I,R,{removePKCS7Padding:!1})}var B=U.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,T,L){var C=R[v].unit,S=C.subarray(16,C.length-C.length%16),E=S.buffer.slice(S.byteOffset,S.byteOffset+S.length),u=this;this.decryptBuffer(E,function(o){var l=new Uint8Array(o);C.set(l,16),L||u.decryptAacSamples(R,v+1,T)})},B.decryptAacSamples=function(R,v,T){for(;;v++){if(v>=R.length){T();return}if(R[v].unit.length<32)continue;var L=this.decrypter.isSync();if(this.decryptAacSample(R,v,T,L),!L)return}},B.getAvcEncryptedData=function(R){for(var v=Math.floor((R.length-48)/160)*16+16,T=new Int8Array(v),L=0,C=32;C<=R.length-16;C+=160,L+=16)T.set(R.subarray(C,C+16),L);return T},B.getAvcDecryptedUnit=function(R,v){for(var T=new Uint8Array(v),L=0,C=32;C<=R.length-16;C+=160,L+=16)R.set(T.subarray(L,L+16),C);return R},B.decryptAvcSample=function(R,v,T,L,C,S){var E=Object(P.discardEPB)(C.data),u=this.getAvcEncryptedData(E),o=this;this.decryptBuffer(u.buffer,function(l){C.data=o.getAvcDecryptedUnit(E,l),S||o.decryptAvcSamples(R,v,T+1,L)})},B.decryptAvcSamples=function(R,v,T,L){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,T=0){if(v>=R.length){L();return}for(var C=R[v].units;!(T>=C.length);T++){var S=C[T];if(S.data.length<=48||S.type!==1&&S.type!==5)continue;var E=this.decrypter.isSync();if(this.decryptAvcSample(R,v,T,L,S,E),!E)return}}},U}();G.default=M},"./src/demux/transmuxer-interface.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C});var K=D("./node_modules/webworkify-webpack/index.js"),P=D.n(K),M=D("./src/events.ts"),U=D("./src/demux/transmuxer.ts"),B=D("./src/utils/logger.ts"),I=D("./src/errors.ts"),R=D("./src/utils/mediasource-helper.ts"),v=D("./node_modules/eventemitter3/index.js"),T=D.n(v),L=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},C=function(){function S(u,o,l,d){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=u,this.id=o,this.onTransmuxComplete=l,this.onFlush=d;var f=u.config,m=function(s,a){a=a||{},a.frag=A.frag,a.id=A.id,u.trigger(s,a)};this.observer=new v.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,m),this.observer.on(M.Events.ERROR,m);var w={mp4:L.isTypeSupported("video/mp4"),mpeg:L.isTypeSupported("audio/mpeg"),mp3:L.isTypeSupported('audio/mp4; codecs="mp3"')},y=navigator.vendor;if(f.enableWorker&&typeof Worker!="undefined"){B.logger.log("demuxing in webworker");var h;try{h=this.worker=K("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),h.addEventListener("message",this.onwmsg),h.onerror=function(c){u.trigger(M.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},h.postMessage({cmd:"init",typeSupported:w,vendor:y,id:o,config:JSON.stringify(f)})}catch(c){B.logger.warn("Error in worker:",c),B.logger.error("Error while initializing DemuxerWorker, fallback to inline"),h&&self.URL.revokeObjectURL(h.objectURL),this.transmuxer=new U.default(this.observer,w,f,y,o),this.worker=null}}else this.transmuxer=new U.default(this.observer,w,f,y,o)}var E=S.prototype;return E.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},E.push=function(o,l,d,A,f,m,w,y,h,c){var s=this;h.transmuxing.start=self.performance.now();var a=this.transmuxer,g=this.worker,p=m?m.start:f.start,b=f.decryptdata,O=this.frag,N=!(O&&f.cc===O.cc),W=!(O&&h.level===O.level),Q=O?h.sn-O.sn:-1,F=this.part?h.part-this.part.index:1,_=!W&&(Q===1||Q===0&&F===1),J=self.performance.now();(W||Q||f.stats.parsing.start===0)&&(f.stats.parsing.start=J),m&&(F||!_)&&(m.stats.parsing.start=J);var ee=new U.TransmuxState(N,_,y,W,p);if(!_||N){B.logger.log("[transmuxer-interface, "+f.type+"]: Starting new transmux session for sn: "+h.sn+" p: "+h.part+" level: "+h.level+" id: "+h.id+`
|
|
discontinuity: `+N+`
|
|
trackSwitch: `+W+`
|
|
contiguous: `+_+`
|
|
accurateTimeOffset: `+y+`
|
|
timeOffset: `+p);var re=new U.TransmuxConfig(d,A,l,w,c);this.configureTransmuxer(re)}if(this.frag=f,this.part=m,g)g.postMessage({cmd:"demux",data:o,decryptdata:b,chunkMeta:h,state:ee},o instanceof ArrayBuffer?[o]:[]);else if(a){var de=a.push(o,b,h,ee);Object(U.isPromise)(de)?de.then(function(Te){s.handleTransmuxComplete(Te)}):this.handleTransmuxComplete(de)}},E.flush=function(o){var l=this;o.transmuxing.start=self.performance.now();var d=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:o});else if(d){var f=d.flush(o);Object(U.isPromise)(f)?f.then(function(m){l.handleFlushResult(m,o)}):this.handleFlushResult(f,o)}},E.handleFlushResult=function(o,l){var d=this;o.forEach(function(A){d.handleTransmuxComplete(A)}),this.onFlush(l)},E.onWorkerMessage=function(o){var l=o.data,d=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,d.trigger(l.event,l.data);break}}},E.configureTransmuxer=function(o){var l=this.worker,d=this.transmuxer;l?l.postMessage({cmd:"configure",config:o}):d&&d.configure(o)},E.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},S}()},"./src/demux/transmuxer-worker.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return I});var K=D("./src/demux/transmuxer.ts"),P=D("./src/events.ts"),M=D("./src/utils/logger.ts"),U=D("./node_modules/eventemitter3/index.js"),B=D.n(U);function I(C){var S=new U.EventEmitter,E=function(o,l){C.postMessage({event:o,data:l})};S.on(P.Events.FRAG_DECRYPTED,E),S.on(P.Events.ERROR,E),C.addEventListener("message",function(u){var o=u.data;switch(o.cmd){case"init":{var l=JSON.parse(o.config);C.transmuxer=new K.default(S,o.typeSupported,l,o.vendor,o.id),Object(M.enableLogs)(l.debug),E("init",null);break}case"configure":{C.transmuxer.configure(o.config);break}case"demux":{var d=C.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(K.isPromise)(d)?d.then(function(m){R(C,m)}):R(C,d);break}case"flush":{var A=o.chunkMeta,f=C.transmuxer.flush(A);Object(K.isPromise)(f)?f.then(function(m){T(C,m,A)}):T(C,f,A);break}default:break}})}function R(C,S){if(L(S.remuxResult))return;var E=[],u=S.remuxResult,o=u.audio,l=u.video;o&&v(E,o),l&&v(E,l),C.postMessage({event:"transmuxComplete",data:S},E)}function v(C,S){S.data1&&C.push(S.data1.buffer),S.data2&&C.push(S.data2.buffer)}function T(C,S,E){S.forEach(function(u){R(C,u)}),C.postMessage({event:"flush",data:E})}function L(C){return!C.audio&&!C.video&&!C.text&&!C.id3&&!C.initSegment}},"./src/demux/transmuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return l}),D.d(G,"isPromise",function(){return f}),D.d(G,"TransmuxConfig",function(){return m}),D.d(G,"TransmuxState",function(){return w});var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/crypt/decrypter.ts"),U=D("./src/demux/aacdemuxer.ts"),B=D("./src/demux/mp4demuxer.ts"),I=D("./src/demux/tsdemuxer.ts"),R=D("./src/demux/mp3demuxer.ts"),v=D("./src/remux/mp4-remuxer.ts"),T=D("./src/remux/passthrough-remuxer.ts"),L=D("./src/demux/chunk-cache.ts"),C=D("./src/utils/mp4-tools.ts"),S=D("./src/utils/logger.ts"),E;try{E=self.performance.now.bind(self.performance)}catch(y){S.logger.debug("Unable to use Performance API on this environment"),E=self.Date.now}var u=[{demux:I.default,remux:v.default},{demux:B.default,remux:T.default},{demux:U.default,remux:v.default},{demux:R.default,remux:v.default}],o=1024;u.forEach(function(y){var h=y.demux;o=Math.max(o,h.minProbeByteLength)});var l=function(){function y(c,s,a,g,p){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 L.default,this.observer=c,this.typeSupported=s,this.config=a,this.vendor=g,this.id=p}var h=y.prototype;return h.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},h.push=function(s,a,g,p){var b=this,O=g.transmuxing;O.executeStart=E();var N=new Uint8Array(s),W=this.cache,Q=this.config,F=this.currentTransmuxState,_=this.transmuxConfig;p&&(this.currentTransmuxState=p);var J=d(N,a);if(J&&J.method==="AES-128"){var ee=this.getDecrypter();if(Q.enableSoftwareAES){var re=ee.softwareDecrypt(N,J.key.buffer,J.iv.buffer);if(!re)return O.executeEnd=E(),A(g);N=new Uint8Array(re)}else return this.decryptionPromise=ee.webCryptoDecrypt(N,J.key.buffer,J.iv.buffer).then(function(De){var ke=b.push(De,null,g);return b.decryptionPromise=null,ke}),this.decryptionPromise}var de=p||F,Te=de.contiguous,ve=de.discontinuity,pe=de.trackSwitch,he=de.accurateTimeOffset,me=de.timeOffset,ae=_.audioCodec,ue=_.videoCodec,be=_.defaultInitPts,Ue=_.duration,Pe=_.initSegmentData;if((ve||pe)&&this.resetInitSegment(Pe,ae,ue,Ue),ve&&this.resetInitialTimestamp(be),Te||this.resetContiguity(),this.needsProbing(N,ve,pe)){if(W.dataLength){var He=W.flush();N=Object(C.appendUint8Array)(He,N)}this.configureTransmuxer(N,_)}var Je=this.transmux(N,J,me,he,g),Le=this.currentTransmuxState;return Le.contiguous=!0,Le.discontinuity=!1,Le.trackSwitch=!1,O.executeEnd=E(),Je},h.flush=function(s){var a=this,g=s.transmuxing;g.executeStart=E();var p=this.decrypter,b=this.cache,O=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return a.flush(s)});var W=[],Q=O.timeOffset;if(p){var F=p.flush();F&&W.push(this.push(F,null,s))}var _=b.dataLength;b.reset();var J=this.demuxer,ee=this.remuxer;if(!J||!ee)return _>=o&&this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),g.executeEnd=E(),[A(s)];var re=J.flush(Q);return f(re)?re.then(function(de){return a.flushRemux(W,de,s),W}):(this.flushRemux(W,re,s),W)},h.flushRemux=function(s,a,g){var p=a.audioTrack,b=a.avcTrack,O=a.id3Track,N=a.textTrack,W=this.currentTransmuxState,Q=W.accurateTimeOffset,F=W.timeOffset;S.logger.log("[transmuxer.ts]: Flushed fragment "+g.sn+(g.part>-1?" p: "+g.part:"")+" of level "+g.level);var _=this.remuxer.remux(p,b,O,N,F,Q,!0,this.id);s.push({remuxResult:_,chunkMeta:g}),g.transmuxing.executeEnd=E()},h.resetInitialTimestamp=function(s){var a=this.demuxer,g=this.remuxer;if(!a||!g)return;a.resetTimeStamp(s),g.resetTimeStamp(s)},h.resetContiguity=function(){var s=this.demuxer,a=this.remuxer;if(!s||!a)return;s.resetContiguity(),a.resetNextTimestamp()},h.resetInitSegment=function(s,a,g,p){var b=this.demuxer,O=this.remuxer;if(!b||!O)return;b.resetInitSegment(a,g,p),O.resetInitSegment(s,a,g)},h.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},h.transmux=function(s,a,g,p,b){var O;return a&&a.method==="SAMPLE-AES"?O=this.transmuxSampleAes(s,a,g,p,b):O=this.transmuxUnencrypted(s,g,p,b),O},h.transmuxUnencrypted=function(s,a,g,p){var b=this.demuxer.demux(s,a,!1,!this.config.progressive),O=b.audioTrack,N=b.avcTrack,W=b.id3Track,Q=b.textTrack,F=this.remuxer.remux(O,N,W,Q,a,g,!1,this.id);return{remuxResult:F,chunkMeta:p}},h.transmuxSampleAes=function(s,a,g,p,b){var O=this;return this.demuxer.demuxSampleAes(s,a,g).then(function(N){var W=O.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,g,p,!1,O.id);return{remuxResult:W,chunkMeta:b}})},h.configureTransmuxer=function(s,a){for(var g=this.config,p=this.observer,b=this.typeSupported,O=this.vendor,N=a.audioCodec,W=a.defaultInitPts,Q=a.duration,F=a.initSegmentData,_=a.videoCodec,J,ee=0,re=u.length;ee<re;ee++)if(u[ee].demux.probe(s)){J=u[ee];break}J||(S.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),J={demux:B.default,remux:T.default});var de=this.demuxer,Te=this.remuxer,ve=J.remux,pe=J.demux;(!Te||!(Te instanceof ve))&&(this.remuxer=new ve(p,g,b,O)),(!de||!(de instanceof pe))&&(this.demuxer=new pe(p,g,b),this.probe=pe.probe),this.resetInitSegment(F,N,_,Q),this.resetInitialTimestamp(W)},h.needsProbing=function(s,a,g){return!this.demuxer||!this.remuxer||a||g},h.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new M.default(this.observer,this.config)),s},y}();function d(y,h){var c=null;return y.byteLength>0&&h!=null&&h.key!=null&&h.iv!==null&&h.method!=null&&(c=h),c}var A=function(h){return{remuxResult:{},chunkMeta:h}};function f(y){return"then"in y&&y.then instanceof Function}var m=function(h,c,s,a,g){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=h,this.videoCodec=c,this.initSegmentData=s,this.duration=a,this.defaultInitPts=g},w=function(h,c,s,a,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=h,this.contiguous=c,this.accurateTimeOffset=s,this.trackSwitch=a,this.timeOffset=g}},"./src/demux/tsdemuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"discardEPB",function(){return A});var K=D("./src/demux/adts.ts"),P=D("./src/demux/mpegaudio.ts"),M=D("./src/demux/exp-golomb.ts"),U=D("./src/demux/id3.ts"),B=D("./src/demux/sample-aes.ts"),I=D("./src/events.ts"),R=D("./src/utils/mp4-tools.ts"),v=D("./src/utils/logger.ts"),T=D("./src/errors.ts"),L={video:1,audio:2,id3:3,text:4},C=function(){function f(w,y,h){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=w,this.config=y,this.typeSupported=h}f.probe=function(y){var h=f.syncOffset(y);return h<0?!1:(h&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+h+", junk ahead ?"),!0)},f.syncOffset=function(y){for(var h=Math.min(1e3,y.length-3*188),c=0;c<h;){if(y[c]===71&&y[c+188]===71&&y[c+2*188]===71)return c;c++}return-1},f.createTrack=function(y,h){return{container:y==="video"||y==="audio"?"video/mp2t":void 0,type:y,id:L[y],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:y==="audio"?h:void 0}};var m=f.prototype;return m.resetInitSegment=function(y,h,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=f.createTrack("video",c),this._audioTrack=f.createTrack("audio",c),this._id3Track=f.createTrack("id3",c),this._txtTrack=f.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=y,this.videoCodec=h,this._duration=c},m.resetTimeStamp=function(){},m.resetContiguity=function(){var y=this._audioTrack,h=this._avcTrack,c=this._id3Track;y&&(y.pesData=null),h&&(h.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(y,h,c,s){c===void 0&&(c=!1),s===void 0&&(s=!1),c||(this.sampleAes=null);var a,g=this._avcTrack,p=this._audioTrack,b=this._id3Track,O=g.pid,N=g.pesData,W=p.pid,Q=b.pid,F=p.pesData,_=b.pesData,J=!1,ee=this.pmtParsed,re=this._pmtId,de=y.length;if(this.remainderData&&(y=Object(R.appendUint8Array)(this.remainderData,y),de=y.length,this.remainderData=null),de<188&&!s)return this.remainderData=y,{audioTrack:p,avcTrack:g,id3Track:b,textTrack:this._txtTrack};var Te=Math.max(0,f.syncOffset(y));de-=(de+Te)%188,de<y.byteLength&&!s&&(this.remainderData=new Uint8Array(y.buffer,de,y.buffer.byteLength-de));for(var ve=Te;ve<de;ve+=188)if(y[ve]===71){var pe=!!(y[ve+1]&64),he=((y[ve+1]&31)<<8)+y[ve+2],me=(y[ve+3]&48)>>4,ae=void 0;if(me>1){if(ae=ve+5+y[ve+4],ae===ve+188)continue}else ae=ve+4;switch(he){case O:pe&&(N&&(a=o(N))&&this.parseAVCPES(a,!1),N={data:[],size:0}),N&&(N.data.push(y.subarray(ae,ve+188)),N.size+=ve+188-ae);break;case W:pe&&(F&&(a=o(F))&&(p.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),F={data:[],size:0}),F&&(F.data.push(y.subarray(ae,ve+188)),F.size+=ve+188-ae);break;case Q:pe&&(_&&(a=o(_))&&this.parseID3PES(a),_={data:[],size:0}),_&&(_.data.push(y.subarray(ae,ve+188)),_.size+=ve+188-ae);break;case 0:pe&&(ae+=y[ae]+1),re=this._pmtId=E(y,ae);break;case re:{pe&&(ae+=y[ae]+1);var ue=u(y,ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);O=ue.avc,O>0&&(g.pid=O),W=ue.audio,W>0&&(p.pid=W,p.isAAC=ue.isAAC),Q=ue.id3,Q>0&&(b.pid=Q),J&&!ee&&(v.logger.log("reparse from beginning"),J=!1,ve=Te-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=!0;break}}else this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});g.pesData=N,p.pesData=F,b.pesData=_;var be={audioTrack:p,avcTrack:g,id3Track:b,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(be),be},m.flush=function(){var y=this.remainderData;this.remainderData=null;var h;return y?h=this.demux(y,-1,!1,!0):h={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(h),this.sampleAes?this.decrypt(h,this.sampleAes):h},m.extractRemainingSamples=function(y){var h=y.audioTrack,c=y.avcTrack,s=y.id3Track,a=c.pesData,g=h.pesData,p=s.pesData,b;a&&(b=o(a))?(this.parseAVCPES(b,!0),c.pesData=null):c.pesData=a,g&&(b=o(g))?(h.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),h.pesData=null):(g!=null&&g.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),h.pesData=g),p&&(b=o(p))?(this.parseID3PES(b),s.pesData=null):s.pesData=p},m.demuxSampleAes=function(y,h,c){var s=this.demux(y,c,!0,!this.config.progressive),a=this.sampleAes=new B.default(this.observer,this.config,h);return this.decrypt(s,a)},m.decrypt=function(y,h){return new Promise(function(c){var s=y.audioTrack,a=y.avcTrack;s.samples&&s.isAAC?h.decryptAacSamples(s.samples,0,function(){a.samples?h.decryptAvcSamples(a.samples,0,0,function(){c(y)}):c(y)}):a.samples&&h.decryptAvcSamples(a.samples,0,0,function(){c(y)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(y,h){var c=this,s=this._avcTrack,a=this.parseAVCNALu(y.data),g=!1,p=this.avcSample,b,O=!1;y.data=null,p&&a.length&&!s.audFound&&(l(p,s),p=this.avcSample=S(!1,y.pts,y.dts,"")),a.forEach(function(N){switch(N.type){case 1:{b=!0,p||(p=c.avcSample=S(!0,y.pts,y.dts,"")),g&&(p.debug+="NDR "),p.frame=!0;var W=N.data;if(O&&W.length>4){var Q=new M.default(W).readSliceType();(Q===2||Q===4||Q===7||Q===9)&&(p.key=!0)}break}case 5:b=!0,p||(p=c.avcSample=S(!0,y.pts,y.dts,"")),g&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{b=!0,g&&p&&(p.debug+="SEI ");var F=new M.default(A(N.data));F.readUByte();for(var _=0,J=0,ee=!1,re=0;!ee&&F.bytesAvailable>1;){_=0;do re=F.readUByte(),_+=re;while(re===255);J=0;do re=F.readUByte(),J+=re;while(re===255);if(_===4&&F.bytesAvailable!==0){ee=!0;var de=F.readUByte();if(de===181){var Te=F.readUShort();if(Te===49){var ve=F.readUInt();if(ve===1195456820){var pe=F.readUByte();if(pe===3){for(var he=F.readUByte(),me=F.readUByte(),ae=31&he,ue=[he,me],be=0;be<ae;be++)ue.push(F.readUByte()),ue.push(F.readUByte()),ue.push(F.readUByte());d(c._txtTrack.samples,{type:3,pts:y.pts,bytes:ue})}}}}}else if(_===5&&F.bytesAvailable!==0){if(ee=!0,J>16){for(var Ue=[],Pe=0;Pe<16;Pe++)Ue.push(F.readUByte().toString(16)),(Pe===3||Pe===5||Pe===7||Pe===9)&&Ue.push("-");for(var He=J-16,Je=new Uint8Array(He),Le=0;Le<He;Le++)Je[Le]=F.readUByte();d(c._txtTrack.samples,{pts:y.pts,payloadType:_,uuid:Ue.join(""),userData:Object(U.utf8ArrayToStr)(Je),userDataBytes:Je})}}else if(J<F.bytesAvailable)for(var De=0;De<J;De++)F.readUByte()}break}case 7:if(b=!0,O=!0,g&&p&&(p.debug+="SPS "),!s.sps){var ke=new M.default(N.data),ze=ke.readSPS();s.width=ze.width,s.height=ze.height,s.pixelRatio=ze.pixelRatio,s.sps=[N.data],s.duration=c._duration;for(var Ge=N.data.subarray(1,4),Ie="avc1.",we=0;we<3;we++){var Ze=Ge[we].toString(16);Ze.length<2&&(Ze="0"+Ze),Ie+=Ze}s.codec=Ie}break;case 8:b=!0,g&&p&&(p.debug+="PPS "),s.pps||(s.pps=[N.data]);break;case 9:b=!1,s.audFound=!0,p&&l(p,s),p=c.avcSample=S(!1,y.pts,y.dts,g?"AUD ":"");break;case 12:b=!1;break;default:b=!1,p&&(p.debug+="unknown NAL "+N.type+" ");break}if(p&&b){var qe=p.units;qe.push(N)}}),h&&p&&(l(p,s),this.avcSample=null)},m.getLastNalUnit=function(){var y,h=this.avcSample,c;if(!h||h.units.length===0){var s=this._avcTrack.samples;h=s[s.length-1]}if((y=h)!==null&&y!==void 0&&y.units){var a=h.units;c=a[a.length-1]}return c},m.parseAVCNALu=function(y){var h=y.byteLength,c=this._avcTrack,s=c.naluState||0,a=s,g=[],p=0,b,O,N,W=-1,Q=0;for(s===-1&&(W=0,Q=y[0]&31,s=0,p=1);p<h;){if(b=y[p++],!s){s=b?0:1;continue}if(s===1){s=b?0:2;continue}if(!b)s=3;else if(b===1){if(W>=0){var F={data:y.subarray(W,p-s-1),type:Q};g.push(F)}else{var _=this.getLastNalUnit();if(_&&(a&&p<=4-a&&(_.state&&(_.data=_.data.subarray(0,_.data.byteLength-a))),O=p-s-1,O>0)){var J=new Uint8Array(_.data.byteLength+O);J.set(_.data,0),J.set(y.subarray(0,O),_.data.byteLength),_.data=J,_.state=0}}p<h?(N=y[p]&31,W=p,Q=N,s=0):s=-1}else s=0}if(W>=0&&s>=0){var ee={data:y.subarray(W,h),type:Q,state:s};g.push(ee)}if(g.length===0){var re=this.getLastNalUnit();if(re){var de=new Uint8Array(re.data.byteLength+y.byteLength);de.set(re.data,0),de.set(y,re.data.byteLength),re.data=de}}return c.naluState=s,g},m.parseAACPES=function(y){var h=0,c=this._audioTrack,s=this.aacOverFlow,a=y.data;if(s){this.aacOverFlow=null;var g=s.sample.unit.byteLength,p=Math.min(s.missing,g),b=g-p;s.sample.unit.set(a.subarray(0,p),b),c.samples.push(s.sample),h=s.missing}var O,N;for(O=h,N=a.length;O<N-1&&!K.isHeader(a,O);O++);if(O!==h){var W,Q;if(O<N-1?(W="AAC PES did not start with ADTS header,offset:"+O,Q=!1):(W="no ADTS header found in AAC PES",Q=!0),v.logger.warn("parsing error:"+W),this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:Q,reason:W}),Q)return}K.initTrackConfig(c,this.observer,a,O,this.audioCodec);var F;if(y.pts!==void 0)F=y.pts;else if(s){var _=K.getFrameDuration(c.samplerate);F=s.sample.pts+_}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0;O<N;)if(K.isHeader(a,O)){if(O+5<N){var ee=K.appendFrame(c,a,O,F,J);if(ee)if(ee.missing)this.aacOverFlow=ee;else{O+=ee.length,J++;continue}}break}else O++},m.parseMPEGPES=function(y){var h=y.data,c=h.length,s=0,a=0,g=y.pts;if(g===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<c;)if(P.isHeader(h,a)){var p=P.appendFrame(this._audioTrack,h,a,g,s);if(p)a+=p.length,s++;else break}else a++},m.parseID3PES=function(y){if(y.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(y)},f}();C.minProbeByteLength=188;function S(f,m,w,y){return{key:f,frame:!1,pts:m,dts:w,units:[],debug:y,length:0}}function E(f,m){return(f[m+10]&31)<<8|f[m+11]}function u(f,m,w,y){var h={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(f[m+1]&15)<<8|f[m+2],s=m+3+c-4,a=(f[m+10]&15)<<8|f[m+11];for(m+=12+a;m<s;){var g=(f[m+1]&31)<<8|f[m+2];switch(f[m]){case 207:if(!y){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:h.audio===-1&&(h.audio=g);break;case 21:h.id3===-1&&(h.id3=g);break;case 219:if(!y){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:h.avc===-1&&(h.avc=g);break;case 3:case 4:w?h.audio===-1&&(h.audio=g,h.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}m+=((f[m+3]&15)<<8|f[m+4])+5}return h}function o(f){var m=0,w,y,h,c,s,a=f.data;if(!f||f.size===0)return null;for(;a[0].length<19&&a.length>1;){var g=new Uint8Array(a[0].length+a[1].length);g.set(a[0]),g.set(a[1],a[0].length),a[0]=g,a.splice(1,1)}w=a[0];var p=(w[0]<<16)+(w[1]<<8)+w[2];if(p===1){if(y=(w[4]<<8)+w[5],y&&y>f.size-6)return null;var b=w[7];b&192&&(c=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,b&64?(s=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,c-s>60*9e4&&(v.logger.warn(Math.round((c-s)/9e4)+"s delta between PTS and DTS, align them"),c=s)):s=c),h=w[8];var O=h+9;if(f.size<=O)return null;f.size-=O;for(var N=new Uint8Array(f.size),W=0,Q=a.length;W<Q;W++){w=a[W];var F=w.byteLength;if(O)if(O>F){O-=F;continue}else w=w.subarray(O),F-=O,O=0;N.set(w,m),m+=F}return y&&(y-=h+3),{data:N,pts:c,dts:s,len:y}}return null}function l(f,m){if(f.units.length&&f.frame){if(f.pts===void 0){var w=m.samples,y=w.length;if(y){var h=w[y-1];f.pts=h.pts,f.dts=h.dts}else{m.dropped++;return}}m.samples.push(f)}f.debug.length&&v.logger.log(f.pts+"/"+f.dts+":"+f.debug)}function d(f,m){var w=f.length;if(w>0){if(m.pts>=f[w-1].pts)f.push(m);else for(var y=w-1;y>=0;y--)if(m.pts<f[y].pts){f.splice(y,0,m);break}}else f.push(m)}function A(f){for(var m=f.byteLength,w=[],y=1;y<m-2;)f[y]===0&&f[y+1]===0&&f[y+2]===3?(w.push(y+2),y+=2):y++;if(w.length===0)return f;var h=m-w.length,c=new Uint8Array(h),s=0;for(y=0;y<h;s++,y++)s===w[0]&&(s++,w.shift()),c[y]=f[s];return c}G.default=C},"./src/errors.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"ErrorTypes",function(){return K}),D.d(G,"ErrorDetails",function(){return P});var K;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(K||(K={}));var P;(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"})(P||(P={}))},"./src/events.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"Events",function(){return K});var K;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(K||(K={}))},"./src/hls.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return f});var K=D("./node_modules/url-toolkit/src/url-toolkit.js"),P=D.n(K),M=D("./src/loader/playlist-loader.ts"),U=D("./src/loader/key-loader.ts"),B=D("./src/controller/id3-track-controller.ts"),I=D("./src/controller/latency-controller.ts"),R=D("./src/controller/level-controller.ts"),v=D("./src/controller/fragment-tracker.ts"),T=D("./src/controller/stream-controller.ts"),L=D("./src/is-supported.ts"),C=D("./src/utils/logger.ts"),S=D("./src/config.ts"),E=D("./node_modules/eventemitter3/index.js"),u=D.n(E),o=D("./src/events.ts"),l=D("./src/errors.ts");function d(m,w){for(var y=0;y<w.length;y++){var h=w[y];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(m,h.key,h)}}function A(m,w,y){return w&&d(m.prototype,w),y&&d(m,y),m}var f=function(){m.isSupported=function(){return Object(L.isSupported)()};function m(y){y===void 0&&(y={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new E.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 h=this.config=Object(S.mergeConfig)(m.DefaultConfig,y);this.userConfig=y,Object(C.enableLogs)(h.debug),this._autoLevelCapping=-1,h.progressive&&Object(S.enableStreamingMode)(h);var c=h.abrController,s=h.bufferController,a=h.capLevelController,g=h.fpsController,p=this.abrController=new c(this),b=this.bufferController=new s(this),O=this.capLevelController=new a(this),N=new g(this),W=new M.default(this),Q=new U.default(this),F=new B.default(this),_=this.levelController=new R.default(this),J=new v.FragmentTracker(this),ee=this.streamController=new T.default(this,J);O.setStreamController(ee),N.setStreamController(ee);var re=[_,ee];this.networkControllers=re;var de=[W,Q,p,b,O,N,F,J];this.audioTrackController=this.createController(h.audioTrackController,null,re),this.createController(h.audioStreamController,J,re),this.subtitleTrackController=this.createController(h.subtitleTrackController,null,re),this.createController(h.subtitleStreamController,J,re),this.createController(h.timelineController,null,de),this.emeController=this.createController(h.emeController,null,de),this.cmcdController=this.createController(h.cmcdController,null,de),this.latencyController=this.createController(I.default,null,de),this.coreComponents=de}var w=m.prototype;return w.createController=function(h,c,s){if(h){var a=c?new h(this,c):new h(this);return s&&s.push(a),a}return null},w.on=function(h,c,s){s===void 0&&(s=this),this._emitter.on(h,c,s)},w.once=function(h,c,s){s===void 0&&(s=this),this._emitter.once(h,c,s)},w.removeAllListeners=function(h){this._emitter.removeAllListeners(h)},w.off=function(h,c,s,a){s===void 0&&(s=this),this._emitter.off(h,c,s,a)},w.listeners=function(h){return this._emitter.listeners(h)},w.emit=function(h,c,s){return this._emitter.emit(h,c,s)},w.trigger=function(h,c){if(this.config.debug)return this.emit(h,h,c);try{return this.emit(h,h,c)}catch(s){C.logger.error("An internal error happened while handling event "+h+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(o.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:h,error:s})}return!1},w.listenerCount=function(h){return this._emitter.listenerCount(h)},w.destroy=function(){C.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(h){return h.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(h){return h.destroy()}),this.coreComponents.length=0},w.attachMedia=function(h){C.logger.log("attachMedia"),this._media=h,this.trigger(o.Events.MEDIA_ATTACHING,{media:h})},w.detachMedia=function(){C.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(h){this.stopLoad();var c=this.media,s=this.url,a=this.url=K.buildAbsoluteURL(self.location.href,h,{alwaysNormalize:!0});C.logger.log("loadSource:"+a),c&&s&&s!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(o.Events.MANIFEST_LOADING,{url:h})},w.startLoad=function(h){h===void 0&&(h=-1),C.logger.log("startLoad("+h+")"),this.networkControllers.forEach(function(c){c.startLoad(h)})},w.stopLoad=function(){C.logger.log("stopLoad"),this.networkControllers.forEach(function(h){h.stopLoad()})},w.swapAudioCodec=function(){C.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){C.logger.log("recoverMediaError");var h=this._media;this.detachMedia(),h&&this.attachMedia(h)},w.removeLevel=function(h,c){c===void 0&&(c=0),this.levelController.removeLevel(h,c)},A(m,[{key:"levels",get:function(){var h=this.levelController.levels;return h||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(h){C.logger.log("set currentLevel:"+h),this.loadLevel=h,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(h){C.logger.log("set nextLevel:"+h),this.levelController.manualLevel=h,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(h){C.logger.log("set loadLevel:"+h),this.levelController.manualLevel=h}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(h){this.levelController.nextLoadLevel=h}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(h){C.logger.log("set firstLevel:"+h),this.levelController.firstLevel=h}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(h){C.logger.log("set startLevel:"+h),h!==-1&&(h=Math.max(h,this.minAutoLevel)),this.levelController.startLevel=h}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(h){var c=!!h;c!==this.config.capLevelToPlayerSize&&(c?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=c)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(h){this._autoLevelCapping!==h&&(C.logger.log("set autoLevelCapping:"+h),this._autoLevelCapping=h)}},{key:"bandwidthEstimate",get:function(){var h=this.abrController.bwEstimator;return h?h.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var h=this.levels,c=this.config.minAutoBitrate;if(!h)return 0;for(var s=h.length,a=0;a<s;a++)if(h[a].maxBitrate>c)return a;return 0}},{key:"maxAutoLevel",get:function(){var h=this.levels,c=this.autoLevelCapping,s;return c===-1&&h&&h.length?s=h.length-1:s=c,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(h){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,h)}},{key:"audioTracks",get:function(){var h=this.audioTrackController;return h?h.audioTracks:[]}},{key:"audioTrack",get:function(){var h=this.audioTrackController;return h?h.audioTrack:-1},set:function(h){var c=this.audioTrackController;c&&(c.audioTrack=h)}},{key:"subtitleTracks",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTrack:-1},set:function(h){var c=this.subtitleTrackController;c&&(c.subtitleTrack=h)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var h=this.subtitleTrackController;return h?h.subtitleDisplay:!1},set:function(h){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=h)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(h){this.config.lowLatencyMode=h}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return o.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:S.hlsDefaultConfig},set:function(h){m.defaultConfig=h}}]),m}();f.defaultConfig=void 0},"./src/is-supported.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isSupported",function(){return M}),D.d(G,"changeTypeSupported",function(){return U});var K=D("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var B=Object(K.getMediaSource)();if(!B)return!1;var I=P(),R=B&&typeof B.isTypeSupported=="function"&&B.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!I||I.prototype&&typeof I.prototype.appendBuffer=="function"&&typeof I.prototype.remove=="function";return!!R&&!!v}function U(){var B,I=P();return typeof(I==null||((B=I.prototype)===null||B===void 0)?void 0:B.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return C}),D.d(G,"LoadError",function(){return E});var K=D("./src/polyfills/number.ts"),P=D("./src/errors.ts");function M(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,v(u,o)}function U(u){var o=typeof Map=="function"?new Map:void 0;return U=function(d){if(d===null||!R(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(d))return o.get(d);o.set(d,A)}function A(){return B(d,arguments,T(this).constructor)}return A.prototype=Object.create(d.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),v(A,d)},U(u)}function B(u,o,l){return I()?B=Reflect.construct:B=function(A,f,m){var w=[null];w.push.apply(w,f);var y=Function.bind.apply(A,w),h=new y;return m&&v(h,m.prototype),h},B.apply(null,arguments)}function I(){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(u){return!1}}function R(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function v(u,o){return v=Object.setPrototypeOf||function(d,A){return d.__proto__=A,d},v(u,o)}function T(u){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},T(u)}var L=Math.pow(2,17),C=function(){function u(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var o=u.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(d,A){var f=this,m=d.url;if(!m)return Promise.reject(new E({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var w=this.config,y=w.fLoader,h=w.loader;return new Promise(function(c,s){f.loader&&f.loader.destroy();var a=f.loader=d.loader=y?new y(w):new h(w),g=S(d),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:L};d.stats=a.stats,a.load(g,p,{onSuccess:function(O,N,W,Q){f.resetLoader(d,a),c({frag:d,part:null,payload:O.data,networkDetails:Q})},onError:function(O,N,W){f.resetLoader(d,a),s(new E({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:O,networkDetails:W}))},onAbort:function(O,N,W){f.resetLoader(d,a),s(new E({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:W}))},onTimeout:function(O,N,W){f.resetLoader(d,a),s(new E({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:W}))},onProgress:function(O,N,W,Q){A&&A({frag:d,part:null,payload:W,networkDetails:Q})}})})},o.loadPart=function(d,A,f){var m=this;this.abort();var w=this.config,y=w.fLoader,h=w.loader;return new Promise(function(c,s){m.loader&&m.loader.destroy();var a=m.loader=d.loader=y?new y(w):new h(w),g=S(d,A),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:L};A.stats=a.stats,a.load(g,p,{onSuccess:function(O,N,W,Q){m.resetLoader(d,a),m.updateStatsFromPart(d,A);var F={frag:d,part:A,payload:O.data,networkDetails:Q};f(F),c(F)},onError:function(O,N,W){m.resetLoader(d,a),s(new E({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:A,response:O,networkDetails:W}))},onAbort:function(O,N,W){d.stats.aborted=A.stats.aborted,m.resetLoader(d,a),s(new E({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:A,networkDetails:W}))},onTimeout:function(O,N,W){m.resetLoader(d,a),s(new E({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:A,networkDetails:W}))}})})},o.updateStatsFromPart=function(d,A){var f=d.stats,m=A.stats,w=m.total;if(f.loaded+=m.loaded,w){var y=Math.round(d.duration/A.duration),h=Math.min(Math.round(f.loaded/w),y),c=y-h,s=c*Math.round(f.loaded/h);f.total=f.loaded+s}else f.total=Math.max(f.loaded,f.total);var a=f.loading,g=m.loading;a.start?a.first+=g.first-g.start:(a.start=g.start,a.first=g.first),a.end=g.end},o.resetLoader=function(d,A){d.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},u}();function S(u,o){o===void 0&&(o=null);var l=o||u,d={frag:u,part:o,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},A=l.byteRangeStartOffset,f=l.byteRangeEndOffset;return Object(K.isFiniteNumber)(A)&&Object(K.isFiniteNumber)(f)&&(d.rangeStart=A,d.rangeEnd=f),d}var E=function(u){M(o,u);function o(l){for(var d,A=arguments.length,f=new Array(A>1?A-1:0),m=1;m<A;m++)f[m-1]=arguments[m];return d=u.call.apply(u,[this].concat(f))||this,d.data=void 0,d.data=l,d}return o}(U(Error))},"./src/loader/fragment.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"ElementaryStreamTypes",function(){return C}),D.d(G,"BaseSegment",function(){return S}),D.d(G,"Fragment",function(){return E}),D.d(G,"Part",function(){return u});var K=D("./src/polyfills/number.ts"),P=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(P),U=D("./src/utils/logger.ts"),B=D("./src/loader/level-key.ts"),I=D("./src/loader/load-stats.ts");function R(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,v(o,l)}function v(o,l){return v=Object.setPrototypeOf||function(A,f){return A.__proto__=f,A},v(o,l)}function T(o,l){for(var d=0;d<l.length;d++){var A=l[d];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(o,A.key,A)}}function L(o,l,d){return l&&T(o.prototype,l),d&&T(o,d),o}var C;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(C||(C={}));var S=function(){function o(d){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[C.AUDIO]=null,A[C.VIDEO]=null,A[C.AUDIOVIDEO]=null,A),this.baseurl=d}var l=o.prototype;return l.setByteRange=function(A,f){var m=A.split("@",2),w=[];m.length===1?w[0]=f?f.byteRangeEndOffset:0:w[0]=parseInt(m[1]),w[1]=parseInt(m[0])+w[0],this._byteRange=w},L(o,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),o}(),E=function(o){R(l,o);function l(A,f){var m;return m=o.call(this,f)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new I.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=A,m}var d=l.prototype;return d.createInitializationVector=function(f){for(var m=new Uint8Array(16),w=12;w<16;w++)m[w]=f>>8*(15-w)&255;return m},d.setDecryptDataFromLevelKey=function(f,m){var w=f;return(f==null?void 0:f.method)==="AES-128"&&f.uri&&!f.iv&&(w=B.LevelKey.fromURI(f.uri),w.method=f.method,w.iv=this.createInitializationVector(m),w.keyFormat="identity"),w},d.setElementaryStreamInfo=function(f,m,w,y,h,c){c===void 0&&(c=!1);var s=this.elementaryStreams,a=s[f];if(!a){s[f]={startPTS:m,endPTS:w,startDTS:y,endDTS:h,partial:c};return}a.startPTS=Math.min(a.startPTS,m),a.endPTS=Math.max(a.endPTS,w),a.startDTS=Math.min(a.startDTS,y),a.endDTS=Math.max(a.endDTS,h)},d.clearElementaryStreamInfo=function(){var f=this.elementaryStreams;f[C.AUDIO]=null,f[C.VIDEO]=null,f[C.AUDIOVIDEO]=null},L(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var f=this.sn;typeof f!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&U.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),f=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,f)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(K.isFiniteNumber)(this.programDateTime))return null;var f=Object(K.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+f*1e3}},{key:"encrypted",get:function(){var f;return!!((f=this.decryptdata)!==null&&f!==void 0&&f.keyFormat&&this.decryptdata.uri)}}]),l}(S),u=function(o){R(l,o);function l(d,A,f,m,w){var y;y=o.call(this,f)||this,y.fragOffset=0,y.duration=0,y.gap=!1,y.independent=!1,y.relurl=void 0,y.fragment=void 0,y.index=void 0,y.stats=new I.LoadStats,y.duration=d.decimalFloatingPoint("DURATION"),y.gap=d.bool("GAP"),y.independent=d.bool("INDEPENDENT"),y.relurl=d.enumeratedString("URI"),y.fragment=A,y.index=m;var h=d.enumeratedString("BYTERANGE");return h&&y.setByteRange(h,w),w&&(y.fragOffset=w.fragOffset+w.duration),y}return L(l,[{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)}}]),l}(S)},"./src/loader/key-loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return U});var K=D("./src/events.ts"),P=D("./src/errors.ts"),M=D("./src/utils/logger.ts"),U=function(){function B(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var I=B.prototype;return I._registerListeners=function(){this.hls.on(K.Events.KEY_LOADING,this.onKeyLoading,this)},I._unregisterListeners=function(){this.hls.off(K.Events.KEY_LOADING,this.onKeyLoading)},I.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var T=this.loaders[v];T&&T.destroy()}this.loaders={}},I.onKeyLoading=function(v,T){var L=T.frag,C=L.type,S=this.loaders[C];if(!L.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var E=L.decryptdata.uri;if(E!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(S&&(M.logger.warn("abort previous key loader for type:"+C),S.abort()),!E){M.logger.warn("key uri is falsy");return}var o=u.loader,l=L.loader=this.loaders[C]=new o(u);this.decrypturl=E,this.decryptkey=null;var d={url:E,frag:L,responseType:"arraybuffer"},A={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(d,A,f)}else this.decryptkey&&(L.decryptdata.key=this.decryptkey,this.hls.trigger(K.Events.KEY_LOADED,{frag:L}))},I.loadsuccess=function(v,T,L){var C=L.frag;if(!C.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=C.decryptdata.key=new Uint8Array(v.data),C.loader=null,delete this.loaders[C.type],this.hls.trigger(K.Events.KEY_LOADED,{frag:C})},I.loaderror=function(v,T){var L=T.frag,C=L.loader;C&&C.abort(),delete this.loaders[L.type],this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:L,response:v})},I.loadtimeout=function(v,T){var L=T.frag,C=L.loader;C&&C.abort(),delete this.loaders[L.type],this.hls.trigger(K.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:L})},B}()},"./src/loader/level-details.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"LevelDetails",function(){return B});var K=D("./src/polyfills/number.ts");function P(I,R){for(var v=0;v<R.length;v++){var T=R[v];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(I,T.key,T)}}function M(I,R,v){return R&&P(I.prototype,R),v&&P(I,v),I}var U=10,B=function(){function I(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=I.prototype;return R.reloaded=function(T){if(!T){this.advanced=!0,this.updated=!0;return}var L=this.lastPartSn-T.lastPartSn,C=this.lastPartIndex-T.lastPartIndex;this.updated=this.endSN!==T.endSN||!!C||!!L,this.advanced=this.endSN>T.endSN||L>0||L===0&&C>0,this.updated||this.advanced?this.misses=Math.floor(T.misses*.6):this.misses=T.misses+1,this.availabilityDelay=T.availabilityDelay},M(I,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(K.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||U}},{key:"drift",get:function(){var T=this.driftEndTime-this.driftStartTime;if(T>0){var L=this.driftEnd-this.driftStart;return L*1e3/T}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var T;return(T=this.fragments)!==null&&T!==void 0&&T.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 T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var T;return(T=this.partList)!==null&&T!==void 0&&T.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),I}()},"./src/loader/level-key.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"LevelKey",function(){return B});var K=D("./node_modules/url-toolkit/src/url-toolkit.js"),P=D.n(K);function M(I,R){for(var v=0;v<R.length;v++){var T=R[v];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(I,T.key,T)}}function U(I,R,v){return R&&M(I.prototype,R),v&&M(I,v),I}var B=function(){I.fromURL=function(v,T){return new I(v,T)},I.fromURI=function(v){return new I(v)};function I(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(K.buildAbsoluteURL)(R,v,{alwaysNormalize:!0}):this._uri=R}return U(I,[{key:"uri",get:function(){return this._uri}}]),I}()},"./src/loader/load-stats.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"LoadStats",function(){return K});var K=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(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return l});var K=D("./src/polyfills/number.ts"),P=D("./node_modules/url-toolkit/src/url-toolkit.js"),M=D.n(P),U=D("./src/loader/fragment.ts"),B=D("./src/loader/level-details.ts"),I=D("./src/loader/level-key.ts"),R=D("./src/utils/attr-list.ts"),v=D("./src/utils/logger.ts"),T=D("./src/utils/codecs.ts"),L=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,C=/#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"),E=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("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function o(w){var y,h;return u.test((y=(h=P.parseURL(w))===null||h===void 0?void 0:h.path)!=null?y:"")}var l=function(){function w(){}return w.findGroup=function(h,c){for(var s=0;s<h.length;s++){var a=h[s];if(a.id===c)return a}},w.convertAVC1ToAVCOTI=function(h){var c=h.split(".");if(c.length>2){var s=c.shift()+".";return s+=parseInt(c.shift()).toString(16),s+=("000"+parseInt(c.shift()).toString(16)).substr(-4),s}return h},w.resolve=function(h,c){return P.buildAbsoluteURL(c,h,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(h,c){var s=[],a={},g=!1;L.lastIndex=0;for(var p;(p=L.exec(h))!=null;)if(p[1]){var b=new R.AttrList(p[1]),O={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:w.resolve(p[2],c)},N=b.decimalResolution("RESOLUTION");N&&(O.width=N.width,O.height=N.height),d((b.CODECS||"").split(/[ ,]+/).filter(function(Q){return Q}),O),O.videoCodec&&O.videoCodec.indexOf("avc1")!==-1&&(O.videoCodec=w.convertAVC1ToAVCOTI(O.videoCodec)),s.push(O)}else if(p[3]){var W=new R.AttrList(p[3]);W["DATA-ID"]&&(g=!0,a[W["DATA-ID"]]=W)}return{levels:s,sessionData:g?a:null}},w.parseMasterPlaylistMedia=function(h,c,s,a){a===void 0&&(a=[]);var g,p=[],b=0;for(C.lastIndex=0;(g=C.exec(h))!==null;){var O=new R.AttrList(g[1]);if(O.TYPE===s){var N={attrs:O,bitrate:0,id:b++,groupId:O["GROUP-ID"],instreamId:O["INSTREAM-ID"],name:O.NAME||O.LANGUAGE||"",type:s,default:O.bool("DEFAULT"),autoselect:O.bool("AUTOSELECT"),forced:O.bool("FORCED"),lang:O.LANGUAGE,url:O.URI?w.resolve(O.URI,c):""};if(a.length){var W=w.findGroup(a,N.groupId)||a[0];A(N,W,"audioCodec"),A(N,W,"textCodec")}p.push(N)}}return p},w.parseLevelPlaylist=function(h,c,s,a,g){var p=new B.LevelDetails(c),b=p.fragments,O=null,N=0,W=0,Q=0,F=0,_=null,J=new U.Fragment(a,c),ee,re,de,Te=-1,ve=!1;for(S.lastIndex=0,p.m3u8=h;(ee=S.exec(h))!==null;){ve&&(ve=!1,J=new U.Fragment(a,c),J.start=Q,J.sn=N,J.cc=F,J.level=s,O&&(J.initSegment=O,J.rawProgramDateTime=O.rawProgramDateTime));var pe=ee[1];if(pe){J.duration=parseFloat(pe);var he=(" "+ee[2]).slice(1);J.title=he||null,J.tagList.push(he?["INF",pe,he]:["INF",pe])}else if(ee[3])Object(K.isFiniteNumber)(J.duration)&&(J.start=Q,de&&(J.levelkey=de),J.sn=N,J.level=s,J.cc=F,J.urlId=g,b.push(J),J.relurl=(" "+ee[3]).slice(1),m(J,_),_=J,Q+=J.duration,N++,W=0,ve=!0);else if(ee[4]){var me=(" "+ee[4]).slice(1);_?J.setByteRange(me,_):J.setByteRange(me)}else if(ee[5])J.rawProgramDateTime=(" "+ee[5]).slice(1),J.tagList.push(["PROGRAM-DATE-TIME",J.rawProgramDateTime]),Te===-1&&(Te=b.length);else{if(ee=ee[0].match(E),!ee){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re<ee.length&&!(typeof ee[re]!="undefined");re++);var ae=(" "+ee[re]).slice(1),ue=(" "+ee[re+1]).slice(1),be=ee[re+2]?(" "+ee[re+2]).slice(1):"";switch(ae){case"PLAYLIST-TYPE":p.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":N=p.startSN=parseInt(ue);break;case"SKIP":{var Ue=new R.AttrList(ue),Pe=Ue.decimalInteger("SKIPPED-SEGMENTS");if(Object(K.isFiniteNumber)(Pe)){p.skippedSegments=Pe;for(var He=Pe;He--;)b.unshift(null);N+=Pe}var Je=Ue.enumeratedString("RECENTLY-REMOVED-DATERANGES");Je&&(p.recentlyRemovedDateranges=Je.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(ue);break;case"VERSION":p.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(ue||be)&&J.tagList.push(be?[ue,be]:[ue]);break;case"DIS":F++;case"GAP":J.tagList.push([ae]);break;case"BITRATE":J.tagList.push([ae,ue]);break;case"DISCONTINUITY-SEQ":F=parseInt(ue);break;case"KEY":{var Le,De=new R.AttrList(ue),ke=De.enumeratedString("METHOD"),ze=De.URI,Ge=De.hexadecimalInteger("IV"),Ie=De.enumeratedString("KEYFORMATVERSIONS"),we=De.enumeratedString("KEYID"),Ze=(Le=De.enumeratedString("KEYFORMAT"))!=null?Le:"identity",qe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(qe.indexOf(Ze)>-1){v.logger.warn("Keyformat "+Ze+" is not supported from the manifest");continue}else if(Ze!=="identity")continue;ke&&(de=I.LevelKey.fromURL(c,ze),ze&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ke)>=0&&(de.method=ke,de.keyFormat=Ze,we&&(de.keyID=we),Ie&&(de.keyFormatVersions=Ie),de.iv=Ge));break}case"START":{var Qe=new R.AttrList(ue),Ve=Qe.decimalFloatingPoint("TIME-OFFSET");Object(K.isFiniteNumber)(Ve)&&(p.startTimeOffset=Ve);break}case"MAP":{var tt=new R.AttrList(ue);J.relurl=tt.URI,tt.BYTERANGE&&J.setByteRange(tt.BYTERANGE),J.level=s,J.sn="initSegment",de&&(J.levelkey=de),J.initSegment=null,O=J,ve=!0;break}case"SERVER-CONTROL":{var Xe=new R.AttrList(ue);p.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),p.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new R.AttrList(ue);p.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ge=p.partList;ge||(ge=p.partList=[]);var Fe=W>0?ge[ge.length-1]:void 0,je=W++,Ee=new U.Part(new R.AttrList(ue),J,c,je,Fe);ge.push(Ee),J.duration+=Ee.duration;break}case"PRELOAD-HINT":{var Oe=new R.AttrList(ue);p.preloadHint=Oe;break}case"RENDITION-REPORT":{var le=new R.AttrList(ue);p.renditionReports=p.renditionReports||[],p.renditionReports.push(le);break}default:v.logger.warn("line parsed but not handled: "+ee);break}}}_&&!_.relurl?(b.pop(),Q-=_.duration,p.partList&&(p.fragmentHint=_)):p.partList&&(m(J,_),J.cc=F,p.fragmentHint=J);var ie=b.length,oe=b[0],Y=b[ie-1];if(Q+=p.skippedSegments*p.targetduration,Q>0&&ie&&Y){p.averagetargetduration=Q/ie;var X=Y.sn;p.endSN=X!=="initSegment"?X:0,oe&&(p.startCC=oe.cc,oe.initSegment||p.fragments.every(function(Z){return Z.relurl&&o(Z.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),J=new U.Fragment(a,c),J.relurl=Y.relurl,J.level=s,J.sn="initSegment",oe.initSegment=J,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(Q+=p.fragmentHint.duration),p.totalduration=Q,p.endCC=F,Te>0&&f(b,Te),p},w}();function d(w,y){["video","audio","text"].forEach(function(h){var c=w.filter(function(a){return Object(T.isCodecType)(a,h)});if(c.length){var s=c.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});y[h+"Codec"]=s.length>0?s[0]:c[0],w=w.filter(function(a){return c.indexOf(a)===-1})}}),y.unknownCodecs=w}function A(w,y,h){var c=y[h];c&&(w[h]=c)}function f(w,y){for(var h=w[y],c=y;c--;){var s=w[c];if(!s)return;s.programDateTime=h.programDateTime-s.duration*1e3,h=s}}function m(w,y){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):y!=null&&y.programDateTime&&(w.programDateTime=y.endProgramDateTime),Object(K.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/events.ts"),M=D("./src/errors.ts"),U=D("./src/utils/logger.ts"),B=D("./src/utils/mp4-tools.ts"),I=D("./src/loader/m3u8-parser.ts"),R=D("./src/types/loader.ts"),v=D("./src/utils/attr-list.ts");function T(S){var E=S.type;switch(E){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function L(S,E){var u=S.url;return(u===void 0||u.indexOf("data:")===0)&&(u=E.url),u}var C=function(){function S(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var E=S.prototype;return E.registerListeners=function(){var o=this.hls;o.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},E.unregisterListeners=function(){var o=this.hls;o.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},E.createInternalLoader=function(o){var l=this.hls.config,d=l.pLoader,A=l.loader,f=d||A,m=new f(l);return o.loader=m,this.loaders[o.type]=m,m},E.getInternalLoader=function(o){return this.loaders[o.type]},E.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},E.destroyInternalLoaders=function(){for(var o in this.loaders){var l=this.loaders[o];l&&l.destroy(),this.resetInternalLoader(o)}},E.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},E.onManifestLoading=function(o,l){var d=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},E.onLevelLoading=function(o,l){var d=l.id,A=l.level,f=l.url,m=l.deliveryDirectives;this.load({id:d,groupId:null,level:A,responseType:"text",type:R.PlaylistContextType.LEVEL,url:f,deliveryDirectives:m})},E.onAudioTrackLoading=function(o,l){var d=l.id,A=l.groupId,f=l.url,m=l.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:f,deliveryDirectives:m})},E.onSubtitleTrackLoading=function(o,l){var d=l.id,A=l.groupId,f=l.url,m=l.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:f,deliveryDirectives:m})},E.load=function(o){var l,d=this.hls.config,A=this.getInternalLoader(o);if(A){var f=A.context;if(f&&f.url===o.url){U.logger.trace("[playlist-loader]: playlist request ongoing");return}U.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),A.abort()}var m,w,y,h;switch(o.type){case R.PlaylistContextType.MANIFEST:m=d.manifestLoadingMaxRetry,w=d.manifestLoadingTimeOut,y=d.manifestLoadingRetryDelay,h=d.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:m=0,w=d.levelLoadingTimeOut;break;default:m=d.levelLoadingMaxRetry,w=d.levelLoadingTimeOut,y=d.levelLoadingRetryDelay,h=d.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(o),(l=o.deliveryDirectives)!==null&&l!==void 0&&l.part){var c;if(o.type===R.PlaylistContextType.LEVEL&&o.level!==null?c=this.hls.levels[o.level].details:o.type===R.PlaylistContextType.AUDIO_TRACK&&o.id!==null?c=this.hls.audioTracks[o.id].details:o.type===R.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(c=this.hls.subtitleTracks[o.id].details),c){var s=c.partTarget,a=c.targetduration;s&&a&&(w=Math.min(Math.max(s*3,a*.8)*1e3,w))}}var g={timeout:w,maxRetry:m,retryDelay:y,maxRetryDelay:h,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(o,g,p)},E.loadsuccess=function(o,l,d,A){if(A===void 0&&(A=null),d.isSidxRequest){this.handleSidxRequest(o,d),this.handlePlaylistLoaded(o,l,d,A);return}this.resetInternalLoader(d.type);var f=o.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,d,"no EXTM3U delimiter",A);return}l.parsing.start=performance.now(),f.indexOf("#EXTINF:")>0||f.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,l,d,A):this.handleMasterPlaylist(o,l,d,A)},E.loaderror=function(o,l,d){d===void 0&&(d=null),this.handleNetworkError(l,d,!1,o)},E.loadtimeout=function(o,l,d){d===void 0&&(d=null),this.handleNetworkError(l,d,!0)},E.handleMasterPlaylist=function(o,l,d,A){var f=this.hls,m=o.data,w=L(o,d),y=I.default.parseMasterPlaylist(m,w),h=y.levels,c=y.sessionData;if(!h.length){this.handleManifestParsingError(o,d,"no level found in manifest",A);return}var s=h.map(function(N){return{id:N.attrs.AUDIO,audioCodec:N.audioCodec}}),a=h.map(function(N){return{id:N.attrs.SUBTITLES,textCodec:N.textCodec}}),g=I.default.parseMasterPlaylistMedia(m,w,"AUDIO",s),p=I.default.parseMasterPlaylistMedia(m,w,"SUBTITLES",a),b=I.default.parseMasterPlaylistMedia(m,w,"CLOSED-CAPTIONS");if(g.length){var O=g.some(function(N){return!N.url});!O&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(U.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}f.trigger(P.Events.MANIFEST_LOADED,{levels:h,audioTracks:g,subtitles:p,captions:b,url:w,stats:l,networkDetails:A,sessionData:c})},E.handleTrackOrLevelPlaylist=function(o,l,d,A){var f=this.hls,m=d.id,w=d.level,y=d.type,h=L(o,d),c=Object(K.isFiniteNumber)(m)?m:0,s=Object(K.isFiniteNumber)(w)?w:c,a=T(d),g=I.default.parseLevelPlaylist(o.data,h,s,a,c);if(!g.fragments.length){f.trigger(P.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:h,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(y===R.PlaylistContextType.MANIFEST){var p={attrs:new v.AttrList({}),bitrate:0,details:g,name:"",url:h};f.trigger(P.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:h,stats:l,networkDetails:A,sessionData:null})}if(l.parsing.end=performance.now(),g.needSidxRanges){var b,O=(b=g.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:O,isSidxRequest:!0,type:y,level:w,levelDetails:g,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=g,this.handlePlaylistLoaded(o,l,d,A)},E.handleSidxRequest=function(o,l){var d=Object(B.parseSegmentIndex)(new Uint8Array(o.data));if(!d)return;var A=d.references,f=l.levelDetails;A.forEach(function(m,w){var y=m.info,h=f.fragments[w];h.byteRange.length===0&&h.setByteRange(String(1+y.end-y.start)+"@"+String(y.start)),h.initSegment&&h.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},E.handleManifestParsingError=function(o,l,d,A){this.hls.trigger(P.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===R.PlaylistContextType.MANIFEST,url:o.url,reason:d,response:o,context:l,networkDetails:A})},E.handleNetworkError=function(o,l,d,A){d===void 0&&(d=!1),U.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var f=M.ErrorDetails.UNKNOWN,m=!1,w=this.getInternalLoader(o);switch(o.type){case R.PlaylistContextType.MANIFEST:f=d?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case R.PlaylistContextType.LEVEL:f=d?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case R.PlaylistContextType.AUDIO_TRACK:f=d?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:f=d?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}w&&this.resetInternalLoader(o.type);var y={type:M.ErrorTypes.NETWORK_ERROR,details:f,fatal:m,url:o.url,loader:w,context:o,networkDetails:l};A&&(y.response=A),this.hls.trigger(P.Events.ERROR,y)},E.handlePlaylistLoaded=function(o,l,d,A){var f=d.type,m=d.level,w=d.id,y=d.groupId,h=d.loader,c=d.levelDetails,s=d.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(o,d,"invalid target duration",A);return}if(!h)return;c.live&&(h.getCacheAge&&(c.ageHeader=h.getCacheAge()||0),(!h.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(f){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:c,level:m||0,id:w||0,stats:l,networkDetails:A,deliveryDirectives:s});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:c,id:w||0,groupId:y||"",stats:l,networkDetails:A,deliveryDirectives:s});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:c,id:w||0,groupId:y||"",stats:l,networkDetails:A,deliveryDirectives:s});break}},S}();G.default=C},"./src/polyfills/number.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isFiniteNumber",function(){return K}),D.d(G,"MAX_SAFE_INTEGER",function(){return P});var K=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,G,D){"use strict";D.r(G);var K=function(){function P(){}return P.getSilentFrame=function(U,B){switch(U){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},P}();G.default=K},"./src/remux/mp4-generator.ts":function(q,G,D){"use strict";D.r(G);var K=Math.pow(2,32)-1,P=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 I=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),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:I,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]),T=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=T,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 L=new Uint8Array([105,115,111,109]),C=new Uint8Array([97,118,99,49]),S=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,L,S,L,C),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,v))},M.box=function(B){for(var I=8,R=arguments.length,v=new Array(R>1?R-1:0),T=1;T<R;T++)v[T-1]=arguments[T];for(var L=v.length,C=L;L--;)I+=v[L].byteLength;var S=new Uint8Array(I);for(S[0]=I>>24&255,S[1]=I>>16&255,S[2]=I>>8&255,S[3]=I&255,S.set(B,4),L=0,I=8;L<C;L++)S.set(v[L],I),I+=v[L].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,I){I*=B;var R=Math.floor(I/(K+1)),v=Math.floor(I%(K+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,I,R){return M.box(M.types.moof,M.mfhd(B),M.traf(R,I))},M.moov=function(B){for(var I=B.length,R=[];I--;)R[I]=M.trak(B[I]);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 I=B.length,R=[];I--;)R[I]=M.trex(B[I]);return M.box.apply(null,[M.types.mvex].concat(R))},M.mvhd=function(B,I){I*=B;var R=Math.floor(I/(K+1)),v=Math.floor(I%(K+1)),T=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,T)},M.sdtp=function(B){var I=B.samples||[],R=new Uint8Array(4+I.length),v,T;for(v=0;v<I.length;v++)T=I[v].flags,R[v+4]=T.dependsOn<<4|T.isDependedOn<<2|T.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 I=[],R=[],v,T,L;for(v=0;v<B.sps.length;v++)T=B.sps[v],L=T.byteLength,I.push(L>>>8&255),I.push(L&255),I=I.concat(Array.prototype.slice.call(T));for(v=0;v<B.pps.length;v++)T=B.pps[v],L=T.byteLength,R.push(L>>>8&255),R.push(L&255),R=R.concat(Array.prototype.slice.call(T));var C=M.box(M.types.avcC,new Uint8Array([1,I[3],I[4],I[5],252|3,224|B.sps.length].concat(I).concat([B.pps.length]).concat(R))),S=B.width,E=B.height,u=B.pixelRatio[0],o=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,E>>8&255,E&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]),C,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([u>>24,u>>16&255,u>>8&255,u&255,o>>24,o>>16&255,o>>8&255,o&255])))},M.esds=function(B){var I=B.config.length;return new Uint8Array([0,0,0,0,3,23+I,0,1,0,4,15+I,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([I]).concat(B.config).concat([6,1,2]))},M.mp4a=function(B){var I=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,I>>8&255,I&255,0,0]),M.box(M.types.esds,M.esds(B)))},M.mp3=function(B){var I=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,I>>8&255,I&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 I=B.id,R=B.duration*B.timescale,v=B.width,T=B.height,L=Math.floor(R/(K+1)),C=Math.floor(R%(K+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,I>>24&255,I>>16&255,I>>8&255,I&255,0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,C>>24,C>>16&255,C>>8&255,C&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,T>>8&255,T&255,0,0]))},M.traf=function(B,I){var R=M.sdtp(B),v=B.id,T=Math.floor(I/(K+1)),L=Math.floor(I%(K+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,T>>24,T>>16&255,T>>8&255,T&255,L>>24,L>>16&255,L>>8&255,L&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 I=B.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(B,I){var R=B.samples||[],v=R.length,T=12+16*v,L=new Uint8Array(T),C,S,E,u,o,l;for(I+=8+T,L.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255],0),C=0;C<v;C++)S=R[C],E=S.duration,u=S.size,o=S.flags,l=S.cts,L.set([E>>>24&255,E>>>16&255,E>>>8&255,E&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*C);return M.box(M.types.trun,L)},M.initSegment=function(B){M.types||M.init();var I=M.moov(B),R=new Uint8Array(M.FTYP.byteLength+I.byteLength);return R.set(M.FTYP),R.set(I,M.FTYP.byteLength),R},M}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,G.default=P},"./src/remux/mp4-remuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return l}),D.d(G,"normalizePts",function(){return d});var K=D("./src/polyfills/number.ts"),P=D("./src/remux/aac-helper.ts"),M=D("./src/remux/mp4-generator.ts"),U=D("./src/events.ts"),B=D("./src/errors.ts"),I=D("./src/utils/logger.ts"),R=D("./src/types/loader.ts"),v=D("./src/utils/timescale-conversion.ts");function T(){return T=Object.assign||function(w){for(var y=1;y<arguments.length;y++){var h=arguments[y];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(w[c]=h[c])}return w},T.apply(this,arguments)}var L=10*1e3,C=1024,S=1152,E=null,u=null,o=!1,l=function(){function w(h,c,s,a){if(a===void 0&&(a=""),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=h,this.config=c,this.typeSupported=s,this.ISGenerated=!1,E===null){var g=navigator.userAgent||"",p=g.match(/Chrome\/(\d+)/i);E=p?parseInt(p[1]):0}if(u===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);u=b?parseInt(b[1]):0}o=!!E&&E<75||!!u&&u<600}var y=w.prototype;return y.destroy=function(){},y.resetTimeStamp=function(c){I.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},y.resetNextTimestamp=function(){I.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},y.resetInitSegment=function(){I.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},y.getVideoStartPts=function(c){var s=!1,a=c.reduce(function(g,p){var b=p.pts-g;return b<-4294967296?(s=!0,d(g,p.pts)):b>0?g:p.pts},c[0].pts);return s&&I.logger.debug("PTS rollover detected"),a},y.remux=function(c,s,a,g,p,b,O,N){var W,Q,F,_,J,ee,re=p,de=p,Te=c.pid>-1,ve=s.pid>-1,pe=s.samples.length,he=c.samples.length>0,me=pe>1,ae=(!Te||he)&&(!ve||me)||this.ISGenerated||O;if(ae){this.ISGenerated||(F=this.generateIS(c,s,p));var ue=this.isVideoContiguous,be=-1;if(me&&(be=A(s.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,be>0){I.logger.warn("[mp4-remuxer]: Dropped "+be+" out of "+pe+" video samples due to a missing keyframe");var Ue=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(be),s.dropped+=be,de+=(s.samples[0].pts-Ue)/(s.timescale||9e4)}else be===-1&&(I.logger.warn("[mp4-remuxer]: No keyframe found out of "+pe+" video samples"),ee=!1);if(this.ISGenerated){if(he&&me){var Pe=this.getVideoStartPts(s.samples),He=d(c.samples[0].pts,Pe)-Pe,Je=He/s.inputTimeScale;re+=Math.max(0,Je),de+=Math.max(0,-Je)}if(he){if(c.samplerate||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(c,s,p)),Q=this.remuxAudio(c,re,this.isAudioContiguous,b,ve||me||N===R.PlaylistLevelType.AUDIO?de:void 0),me){var Le=Q?Q.endPTS-Q.startPTS:0;s.inputTimeScale||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(c,s,p)),W=this.remuxVideo(s,de,ue,Le)}}else me&&(W=this.remuxVideo(s,de,ue,0));W&&(W.firstKeyFrame=be,W.independent=be!==-1)}}return this.ISGenerated&&(a.samples.length&&(J=this.remuxID3(a,p)),g.samples.length&&(_=this.remuxText(g,p))),{audio:Q,video:W,initSegment:F,independent:ee,text:_,id3:J}},y.generateIS=function(c,s,a){var g=c.samples,p=s.samples,b=this.typeSupported,O={},N=!Object(K.isFiniteNumber)(this._initPTS),W="audio/mp4",Q,F,_;if(N&&(Q=F=Infinity),c.config&&g.length&&(c.timescale=c.samplerate,c.isAAC||(b.mpeg?(W="audio/mpeg",c.codec=""):b.mp3&&(c.codec="mp3")),O.audio={id:"audio",container:W,codec:c.codec,initSegment:!c.isAAC&&b.mpeg?new Uint8Array(0):M.default.initSegment([c]),metadata:{channelCount:c.channelCount}},N&&(_=c.inputTimeScale,Q=F=g[0].pts-Math.round(_*a))),s.sps&&s.pps&&p.length&&(s.timescale=s.inputTimeScale,O.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:M.default.initSegment([s]),metadata:{width:s.width,height:s.height}},N)){_=s.inputTimeScale;var J=this.getVideoStartPts(p),ee=Math.round(_*a);F=Math.min(F,d(p[0].dts,J)-ee),Q=Math.min(Q,J-ee)}if(Object.keys(O).length)return this.ISGenerated=!0,N&&(this._initPTS=Q,this._initDTS=F),{tracks:O,initPTS:Q,timescale:_}},y.remuxVideo=function(c,s,a,g){var p=c.inputTimeScale,b=c.samples,O=[],N=b.length,W=this._initPTS,Q=this.nextAvcDts,F=8,_,J,ee,re=Number.POSITIVE_INFINITY,de=Number.NEGATIVE_INFINITY,Te=0,ve=!1;if(!a||Q===null){var pe=s*p,he=b[0].pts-d(b[0].dts,b[0].pts);Q=pe-he}for(var me=0;me<N;me++){var ae=b[me];if(ae.pts=d(ae.pts-W,Q),ae.dts=d(ae.dts-W,Q),ae.dts>ae.pts){var ue=9e4*.2;Te=Math.max(Math.min(Te,ae.pts-ae.dts),-1*ue)}ae.dts<b[me>0?me-1:me].dts&&(ve=!0)}ve&&b.sort(function(xt,ht){var st=xt.dts-ht.dts,Ct=xt.pts-ht.pts;return st||Ct}),J=b[0].dts,ee=b[b.length-1].dts;var be=Math.round((ee-J)/(N-1));if(Te<0){if(Te<be*-2){I.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-be,!0)+" ms");for(var Ue=Te,Pe=0;Pe<N;Pe++)b[Pe].dts=Ue=Math.max(Ue,b[Pe].pts-be),b[Pe].pts=Math.max(Ue,b[Pe].pts)}else{I.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Te,!0)+" ms to overcome this issue");for(var He=0;He<N;He++)b[He].dts=b[He].dts+Te}J=b[0].dts}if(a){var Je=J-Q,Le=Je>be,De=Je<-1;if(Le||De){Le?I.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Je,!0)+" ms ("+Je+"dts) hole between fragments detected, filling it"):I.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Je,!0)+" ms ("+Je+"dts) overlapping between fragments detected"),J=Q;var ke=b[0].pts-Je;b[0].dts=J,b[0].pts=ke,I.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(ke,!0)+"/"+Object(v.toMsFromMpegTsClock)(J,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Je,!0)+" ms")}}o&&(J=Math.max(0,J));for(var ze=0,Ge=0,Ie=0;Ie<N;Ie++){for(var we=b[Ie],Ze=we.units,qe=Ze.length,Qe=0,Ve=0;Ve<qe;Ve++)Qe+=Ze[Ve].data.length;Ge+=Qe,ze+=qe,we.length=Qe,we.dts=Math.max(we.dts,J),we.pts=Math.max(we.pts,we.dts,0),re=Math.min(we.pts,re),de=Math.max(we.pts,de)}ee=b[N-1].dts;var tt=Ge+4*ze+8,Xe;try{Xe=new Uint8Array(tt)}catch(xt){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:tt,reason:"fail allocating video mdat "+tt});return}var Ne=new DataView(Xe.buffer);Ne.setUint32(0,tt),Xe.set(M.default.types.mdat,4);for(var ge=0;ge<N;ge++){for(var Fe=b[ge],je=Fe.units,Ee=0,Oe=0,le=je.length;Oe<le;Oe++){var ie=je[Oe],oe=ie.data,Y=ie.data.byteLength;Ne.setUint32(F,Y),F+=4,Xe.set(oe,F),F+=Y,Ee+=4+Y}if(ge<N-1)_=b[ge+1].dts-Fe.dts;else{var X=this.config,Z=Fe.dts-b[ge>0?ge-1:ge].dts;if(X.stretchShortVideoTrack&&this.nextAudioPts!==null){var te=Math.floor(X.maxBufferHole*p),se=(g?re+g*p:this.nextAudioPts)-Fe.pts;se>te?(_=se-Z,_<0&&(_=Z),I.logger.log("[mp4-remuxer]: It is approximately "+se/90+" ms to the next segment; using duration "+_/90+" ms for the last video frame.")):_=Z}else _=Z}var ye=Math.round(Fe.pts-Fe.dts);O.push(new f(Fe.key,_,Ee,ye))}if(O.length&&E&&E<70){var Ce=O[0].flags;Ce.dependsOn=2,Ce.isNonSync=0}console.assert(_!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Q=ee+_,this.isVideoContiguous=!0;var Ye=M.default.moof(c.sequenceNumber++,J,T({},c,{samples:O})),at="video",rt={data1:Ye,data2:Xe,startPTS:re/p,endPTS:(de+_)/p,startDTS:J/p,endDTS:Q/p,type:at,hasAudio:!1,hasVideo:!0,nb:O.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(Xe.length,"MDAT length must not be zero"),rt},y.remuxAudio=function(c,s,a,g,p){var b=c.inputTimeScale,O=c.samplerate?c.samplerate:b,N=b/O,W=c.isAAC?C:S,Q=W*N,F=this._initPTS,_=!c.isAAC&&this.typeSupported.mpeg,J=[],ee=c.samples,re=_?0:8,de=this.nextAudioPts||-1,Te=s*b;if(this.isAudioContiguous=a=a||ee.length&&de>0&&(g&&Math.abs(Te-de)<9e3||Math.abs(d(ee[0].pts-F,Te)-de)<20*Q),ee.forEach(function(oe){oe.pts=d(oe.pts-F,Te)}),!a||de<0){if(ee=ee.filter(function(oe){return oe.pts>=0}),!ee.length)return;p===0?de=0:g?de=Math.max(0,Te):de=ee[0].pts}if(c.isAAC)for(var ve=p!==void 0,pe=this.config.maxAudioFramesDrift,he=0,me=de;he<ee.length;he++){var ae=ee[he],ue=ae.pts,be=ue-me,Ue=Math.abs(1e3*be/b);if(be<=-pe*Q&&ve)he===0&&(I.logger.warn("Audio frame @ "+(ue/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*be/b)+" ms."),this.nextAudioPts=de=me=ue);else if(be>=pe*Q&&Ue<L&&ve){var Pe=Math.round(be/Q);me=ue-Pe*Q,me<0&&(Pe--,me+=Q),he===0&&(this.nextAudioPts=de=me),I.logger.warn("[mp4-remuxer]: Injecting "+Pe+" audio frame @ "+(me/b).toFixed(3)+"s due to "+Math.round(1e3*be/b)+" ms gap.");for(var He=0;He<Pe;He++){var Je=Math.max(me,0),Le=P.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);Le||(I.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Le=ae.unit.subarray()),ee.splice(he,0,{unit:Le,pts:Je}),me+=Q,he++}}ae.pts=me,me+=Q}for(var De=null,ke=null,ze,Ge=0,Ie=ee.length;Ie--;)Ge+=ee[Ie].unit.byteLength;for(var we=0,Ze=ee.length;we<Ze;we++){var qe=ee[we],Qe=qe.unit,Ve=qe.pts;if(ke!==null){var tt=J[we-1];tt.duration=Math.round((Ve-ke)/N)}else if(a&&c.isAAC&&(Ve=de),De=Ve,Ge>0){Ge+=re;try{ze=new Uint8Array(Ge)}catch(oe){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ge,reason:"fail allocating audio mdat "+Ge});return}if(!_){var Xe=new DataView(ze.buffer);Xe.setUint32(0,Ge),ze.set(M.default.types.mdat,4)}}else return;ze.set(Qe,re);var Ne=Qe.byteLength;re+=Ne,J.push(new f(!0,W,Ne,0)),ke=Ve}var ge=J.length;if(!ge)return;var Fe=J[J.length-1];this.nextAudioPts=de=ke+N*Fe.duration;var je=_?new Uint8Array(0):M.default.moof(c.sequenceNumber++,De/N,T({},c,{samples:J}));c.samples=[];var Ee=De/b,Oe=de/b,le="audio",ie={data1:je,data2:ze,startPTS:Ee,endPTS:Oe,startDTS:Ee,endDTS:Oe,type:le,hasAudio:!0,hasVideo:!1,nb:ge};return this.isAudioContiguous=!0,console.assert(ze.length,"MDAT length must not be zero"),ie},y.remuxEmptyAudio=function(c,s,a,g){var p=c.inputTimeScale,b=c.samplerate?c.samplerate:p,O=p/b,N=this.nextAudioPts,W=(N!==null?N:g.startDTS*p)+this._initDTS,Q=g.endDTS*p+this._initDTS,F=O*C,_=Math.ceil((Q-W)/F),J=P.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(I.logger.warn("[mp4-remuxer]: remux empty Audio"),!J){I.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],re=0;re<_;re++){var de=W+re*F;ee.push({unit:J,pts:de,dts:de})}return c.samples=ee,this.remuxAudio(c,s,a,!1)},y.remuxID3=function(c,s){var a=c.samples.length;if(!a)return;for(var g=c.inputTimeScale,p=this._initPTS,b=this._initDTS,O=0;O<a;O++){var N=c.samples[O];N.pts=d(N.pts-p,s*g)/g,N.dts=d(N.dts-b,s*g)/g}var W=c.samples;return c.samples=[],{samples:W}},y.remuxText=function(c,s){var a=c.samples.length;if(!a)return;for(var g=c.inputTimeScale,p=this._initPTS,b=0;b<a;b++){var O=c.samples[b];O.pts=d(O.pts-p,s*g)/g}c.samples.sort(function(W,Q){return W.pts-Q.pts});var N=c.samples;return c.samples=[],{samples:N}},w}();function d(w,y){var h;if(y===null)return w;for(y<w?h=-8589934592:h=8589934592;Math.abs(w-y)>4294967296;)w+=h;return w}function A(w){for(var y=0;y<w.length;y++)if(w[y].key)return y;return-1}var f=function(y,h,c,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=h,this.size=c,this.cts=s,this.flags=new m(y)},m=function(y){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=y?2:1,this.isNonSync=y?0:1}},"./src/remux/passthrough-remuxer.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/polyfills/number.ts"),P=D("./src/utils/mp4-tools.ts"),M=D("./src/loader/fragment.ts"),U=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 T=v.prototype;return T.destroy=function(){},T.resetTimeStamp=function(C){this.initPTS=C,this.lastEndDTS=null},T.resetNextTimestamp=function(){this.lastEndDTS=null},T.resetInitSegment=function(C,S,E){this.audioCodec=S,this.videoCodec=E,this.generateInitSegment(C),this.emitInitSegment=!0},T.generateInitSegment=function(C){var S=this.audioCodec,E=this.videoCodec;if(!C||!C.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(P.parseInitSegment)(C);S||(S=R(u.audio,M.ElementaryStreamTypes.AUDIO)),E||(E=R(u.video,M.ElementaryStreamTypes.VIDEO));var o={};u.audio&&u.video?o.audiovideo={container:"video/mp4",codec:S+","+E,initSegment:C,id:"main"}:u.audio?o.audio={container:"audio/mp4",codec:S,initSegment:C,id:"audio"}:u.video?o.video={container:"video/mp4",codec:E,initSegment:C,id:"main"}:U.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},T.remux=function(C,S,E,u,o){var l=this.initPTS,d=this.lastEndDTS,A={audio:void 0,video:void 0,text:u,id3:E,initSegment:void 0};Object(K.isFiniteNumber)(d)||(d=this.lastEndDTS=o||0);var f=S.samples;if(!f||!f.length)return A;var m={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(f),w=this.initData),!w||!w.length)return U.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(K.isFiniteNumber)(l)||(this.initPTS=m.initPTS=l=I(w,f,d));var y=Object(P.getDuration)(f,w),h=d,c=y+h;Object(P.offsetStartDTS)(w,f,l),y>0?this.lastEndDTS=c:(U.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!w.audio,a=!!w.video,g="";s&&(g+="audio"),a&&(g+="video");var p={data1:f,startPTS:h,startDTS:h,endPTS:c,endDTS:c,type:g,hasAudio:s,hasVideo:a,nb:1,dropped:0};return A.audio=p.type==="audio"?p:void 0,A.video=p.type!=="audio"?p:void 0,A.text=u,A.id3=E,A.initSegment=m,A},v}(),I=function(T,L,C){return Object(P.getStartDTS)(T,L)-C};function R(v,T){var L=v==null?void 0:v.codec;return L&&L.length>4?L:L==="hvc1"?"hvc1.1.c.L120.90":L==="av01"?"av01.0.04M.08":L==="avc1"||T===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}G.default=B},"./src/task-loop.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=P.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(){},P}()},"./src/types/cmcd.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"CMCDVersion",function(){return K}),D.d(G,"CMCDObjectType",function(){return P}),D.d(G,"CMCDStreamingFormat",function(){return M}),D.d(G,"CMCDStreamType",function(){return U});var K=1,P;(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"})(P||(P={}));var M;(function(B){B.DASH="d",B.HLS="h",B.SMOOTH="s",B.OTHER="o"})(M||(M={}));var U;(function(B){B.VOD="v",B.LIVE="l"})(U||(U={}))},"./src/types/level.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"HlsSkip",function(){return M}),D.d(G,"getSkipValue",function(){return U}),D.d(G,"HlsUrlParameters",function(){return B}),D.d(G,"Level",function(){return I});function K(R,v){for(var T=0;T<v.length;T++){var L=v[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}function P(R,v,T){return v&&K(R.prototype,v),T&&K(R,T),R}var M;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(M||(M={}));function U(R,v){var T=R.canSkipUntil,L=R.canSkipDateRanges,C=R.endSN,S=v!==void 0?v-C:0;return T&&S<T?L?M.v2:M.Yes:M.No}var B=function(){function R(T,L,C){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=T,this.part=L,this.skip=C}var v=R.prototype;return v.addDirectives=function(L){var C=new self.URL(L);return this.msn!==void 0&&C.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&C.searchParams.set("_HLS_part",this.part.toString()),this.skip&&C.searchParams.set("_HLS_skip",this.skip),C.toString()},R}(),I=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(T){return T}).join(",").replace(/\.[^.,]+/g,"")}return P(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(T){var L=T%this.url.length;this._urlId!==L&&(this.details=void 0,this._urlId=L)}}]),R}()},"./src/types/loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"PlaylistContextType",function(){return K}),D.d(G,"PlaylistLevelType",function(){return P});var K;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(K||(K={}));var P;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"ChunkMetadata",function(){return K});var K=function(U,B,I,R,v,T){R===void 0&&(R=0),v===void 0&&(v=-1),T===void 0&&(T=!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=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=U,this.sn=B,this.id=I,this.size=R,this.part=v,this.partial=T};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"AttrList",function(){return M});var K=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function U(I){typeof I=="string"&&(I=U.parseAttrList(I));for(var R in I)I.hasOwnProperty(R)&&(this[R]=I[R])}var B=U.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 T=new Uint8Array(v.length/2),L=0;L<v.length/2;L++)T[L]=parseInt(v.slice(L*2,L*2+2),16);return T}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 T=this[R];return T?parseFloat(T):v},B.enumeratedString=function(R){return this[R]},B.bool=function(R){return this[R]==="YES"},B.decimalResolution=function(R){var v=K.exec(this[R]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},U.parseAttrList=function(R){var v,T={},L='"';for(P.lastIndex=0;(v=P.exec(R))!==null;){var C=v[2];C.indexOf(L)===0&&C.lastIndexOf(L)===C.length-1&&(C=C.slice(1,-1)),T[v[1]]=C}return T},U}()},"./src/utils/binary-search.ts":function(q,G,D){"use strict";D.r(G);var K={search:function(M,U){for(var B=0,I=M.length-1,R=null,v=null;B<=I;){R=(B+I)/2|0,v=M[R];var T=U(v);if(T>0)B=R+1;else if(T<0)I=R-1;else return v}return null}};G.default=K},"./src/utils/buffer-helper.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"BufferHelper",function(){return M});var K=D("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function U(){}return U.isBuffered=function(I,R){try{if(I){for(var v=U.getBuffered(I),T=0;T<v.length;T++)if(R>=v.start(T)&&R<=v.end(T))return!0}}catch(L){}return!1},U.bufferInfo=function(I,R,v){try{if(I){var T=U.getBuffered(I),L=[],C;for(C=0;C<T.length;C++)L.push({start:T.start(C),end:T.end(C)});return this.bufferedInfo(L,R,v)}}catch(S){}return{len:0,start:R,end:R,nextStart:void 0}},U.bufferedInfo=function(I,R,v){R=Math.max(0,R),I.sort(function(m,w){var y=m.start-w.start;return y||w.end-m.end});var T=[];if(v)for(var L=0;L<I.length;L++){var C=T.length;if(C){var S=T[C-1].end;I[L].start-S<v?I[L].end>S&&(T[C-1].end=I[L].end):T.push(I[L])}else T.push(I[L])}else T=I;for(var E=0,u,o=R,l=R,d=0;d<T.length;d++){var A=T[d].start,f=T[d].end;if(R+v>=A&&R<f)o=A,l=f,E=l-R;else if(R+v<A){u=A;break}}return{len:E,start:o||0,end:l||0,nextStart:u}},U.getBuffered=function(I){try{return I.buffered}catch(R){return K.logger.log("failed to get media.buffered",R),P}},U}()},"./src/utils/cea-608-parser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"Row",function(){return l}),D.d(G,"CaptionScreen",function(){return d});var K=D("./src/utils/logger.ts"),P={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(c){var s=c;return P.hasOwnProperty(c)&&(s=P[c]),String.fromCharCode(s)},U=15,B=100,I={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},T={25:2,26:4,29:6,30:8,31:10,27:13,28:15},L=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],C;(function(h){h[h.ERROR=0]="ERROR",h[h.TEXT=1]="TEXT",h[h.WARNING=2]="WARNING",h[h.INFO=2]="INFO",h[h.DEBUG=3]="DEBUG",h[h.DATA=3]="DATA"})(C||(C={}));var S=function(){function h(){this.time=null,this.verboseLevel=C.ERROR}var c=h.prototype;return c.log=function(a,g){this.verboseLevel>=a&&K.logger.log(this.time+" ["+a+"] "+g)},h}(),E=function(c){for(var s=[],a=0;a<c.length;a++)s.push(c[a].toString(16));return s},u=function(){function h(s,a,g,p,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=a||!1,this.italics=g||!1,this.background=p||"black",this.flash=b||!1}var c=h.prototype;return c.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},c.setStyles=function(a){for(var g=["foreground","underline","italics","background","flash"],p=0;p<g.length;p++){var b=g[p];a.hasOwnProperty(b)&&(this[b]=a[b])}},c.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},c.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},c.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},c.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},h}(),o=function(){function h(s,a,g,p,b,O){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new u(a,g,p,b,O)}var c=h.prototype;return c.reset=function(){this.uchar=" ",this.penState.reset()},c.setChar=function(a,g){this.uchar=a,this.penState.copy(g)},c.setPenState=function(a){this.penState.copy(a)},c.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},c.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},c.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},h}(),l=function(){function h(s){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var a=0;a<B;a++)this.chars.push(new o);this.logger=s,this.pos=0,this.currPenState=new u}var c=h.prototype;return c.equals=function(a){for(var g=!0,p=0;p<B;p++)if(!this.chars[p].equals(a.chars[p])){g=!1;break}return g},c.copy=function(a){for(var g=0;g<B;g++)this.chars[g].copy(a.chars[g])},c.isEmpty=function(){for(var a=!0,g=0;g<B;g++)if(!this.chars[g].isEmpty()){a=!1;break}return a},c.setCursor=function(a){this.pos!==a&&(this.pos=a),this.pos<0?(this.logger.log(C.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>B&&(this.logger.log(C.DEBUG,"Too large cursor position "+this.pos),this.pos=B)},c.moveCursor=function(a){var g=this.pos+a;if(a>1)for(var p=this.pos+1;p<g+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(g)},c.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},c.insertChar=function(a){a>=144&&this.backSpace();var g=M(a);if(this.pos>=B){this.logger.log(C.ERROR,"Cannot insert "+a.toString(16)+" ("+g+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(g,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(a){var g;for(g=a;g<B;g++)this.chars[g].reset()},c.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},c.clearToEndOfRow=function(){this.clearFromPos(this.pos)},c.getTextString=function(){for(var a=[],g=!0,p=0;p<B;p++){var b=this.chars[p].uchar;b!==" "&&(g=!1),a.push(b)}return g?"":a.join("")},c.setPenStyles=function(a){this.currPenState.setStyles(a);var g=this.chars[this.pos];g.setPenState(this.currPenState)},h}(),d=function(){function h(s){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var a=0;a<U;a++)this.rows.push(new l(s));this.logger=s,this.currRow=U-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=h.prototype;return c.reset=function(){for(var a=0;a<U;a++)this.rows[a].clear();this.currRow=U-1},c.equals=function(a){for(var g=!0,p=0;p<U;p++)if(!this.rows[p].equals(a.rows[p])){g=!1;break}return g},c.copy=function(a){for(var g=0;g<U;g++)this.rows[g].copy(a.rows[g])},c.isEmpty=function(){for(var a=!0,g=0;g<U;g++)if(!this.rows[g].isEmpty()){a=!1;break}return a},c.backSpace=function(){var a=this.rows[this.currRow];a.backSpace()},c.clearToEndOfRow=function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},c.insertChar=function(a){var g=this.rows[this.currRow];g.insertChar(a)},c.setPen=function(a){var g=this.rows[this.currRow];g.setPenStyles(a)},c.moveCursor=function(a){var g=this.rows[this.currRow];g.moveCursor(a)},c.setCursor=function(a){this.logger.log(C.INFO,"setCursor: "+a);var g=this.rows[this.currRow];g.setCursor(a)},c.setPAC=function(a){this.logger.log(C.INFO,"pacData = "+JSON.stringify(a));var g=a.row-1;if(this.nrRollUpRows&&g<this.nrRollUpRows-1&&(g=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==g){for(var p=0;p<U;p++)this.rows[p].clear();var b=this.currRow+1-this.nrRollUpRows,O=this.lastOutputScreen;if(O){var N=O.rows[b].cueStartTime,W=this.logger.time;if(N&&W!==null&&N<W)for(var Q=0;Q<this.nrRollUpRows;Q++)this.rows[g-this.nrRollUpRows+Q+1].copy(O.rows[b+Q])}}this.currRow=g;var F=this.rows[this.currRow];if(a.indent!==null){var _=a.indent,J=Math.max(_-1,0);F.setCursor(a.indent),a.color=F.chars[J].penState.foreground}var ee={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(ee)},c.setBkgData=function(a){this.logger.log(C.INFO,"bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},c.setRollUpRows=function(a){this.nrRollUpRows=a},c.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(C.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(C.TEXT,this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,g=this.rows.splice(a,1)[0];g.clear(),this.rows.splice(this.currRow,0,g),this.logger.log(C.INFO,"Rolling up")},c.getDisplayText=function(a){a=a||!1;for(var g=[],p="",b=-1,O=0;O<U;O++){var N=this.rows[O].getTextString();N&&(b=O+1,a?g.push("Row "+b+": '"+N+"'"):g.push(N.trim()))}return g.length>0&&(a?p="["+g.join(" | ")+"]":p=g.join(`
|
|
`)),p},c.getTextAndFormat=function(){return this.rows},h}(),A=function(){function h(s,a,g){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=s,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new d(g),this.nonDisplayedMemory=new d(g),this.lastOutputScreen=new d(g),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=g}var c=h.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(a){this.outputFilter=a},c.setPAC=function(a){this.writeScreen.setPAC(a)},c.setBkgData=function(a){this.writeScreen.setBkgData(a)},c.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(C.INFO,"MODE="+a),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=a},c.insertChars=function(a){for(var g=0;g<a.length;g++)this.writeScreen.insertChar(a[g]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(C.INFO,p+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(C.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(C.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(C.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},c.ccAOF=function(){},c.ccAON=function(){},c.ccDER=function(){this.logger.log(C.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(a){this.logger.log(C.INFO,"RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},c.ccFON=function(){this.logger.log(C.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(C.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(C.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(C.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(C.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(C.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(C.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(C.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,this.logger.log(C.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(a){this.logger.log(C.INFO,"TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},c.ccMIDROW=function(a){var g={flash:!1};if(g.underline=a%2===1,g.italics=a>=46,g.italics)g.foreground="white";else{var p=Math.floor(a/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];g.foreground=b[p]}this.logger.log(C.INFO,"MIDROW: "+JSON.stringify(g)),this.writeScreen.setPen(g)},c.outputDataUpdate=function(a){a===void 0&&(a=!1);var g=this.logger.time;if(g===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=g:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,g,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:g),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},h}(),f=function(){function h(s,a,g){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new S;this.channels=[null,new A(s,a,p),new A(s+1,g,p)],this.cmdHistory=y(),this.logger=p}var c=h.prototype;return c.getHandler=function(a){return this.channels[a].getHandler()},c.setHandler=function(a,g){this.channels[a].setHandler(g)},c.addData=function(a,g){var p,b,O,N=!1;this.logger.time=a;for(var W=0;W<g.length;W+=2){if(b=g[W]&127,O=g[W+1]&127,b===0&&O===0)continue;if(this.logger.log(C.DATA,"["+E([g[W],g[W+1]])+"] -> ("+E([b,O])+")"),p=this.parseCmd(b,O),p||(p=this.parseMidrow(b,O)),p||(p=this.parsePAC(b,O)),p||(p=this.parseBackgroundAttributes(b,O)),!p&&(N=this.parseChars(b,O),N)){var Q=this.currentChannel;if(Q&&Q>0){var F=this.channels[Q];F.insertChars(N)}else this.logger.log(C.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!N&&this.logger.log(C.WARNING,"Couldn't parse cleaned data "+E([b,O])+" orig: "+E([g[W],g[W+1]]))}},c.parseCmd=function(a,g){var p=this.cmdHistory,b=(a===20||a===28||a===21||a===29)&&g>=32&&g<=47,O=(a===23||a===31)&&g>=33&&g<=35;if(!(b||O))return!1;if(w(a,g,p))return m(null,null,p),this.logger.log(C.DEBUG,"Repeated command ("+E([a,g])+") is dropped"),!0;var N=a===20||a===21||a===23?1:2,W=this.channels[N];return a===20||a===21||a===28||a===29?g===32?W.ccRCL():g===33?W.ccBS():g===34?W.ccAOF():g===35?W.ccAON():g===36?W.ccDER():g===37?W.ccRU(2):g===38?W.ccRU(3):g===39?W.ccRU(4):g===40?W.ccFON():g===41?W.ccRDC():g===42?W.ccTR():g===43?W.ccRTD():g===44?W.ccEDM():g===45?W.ccCR():g===46?W.ccENM():g===47&&W.ccEOC():W.ccTO(g-32),m(a,g,p),this.currentChannel=N,!0},c.parseMidrow=function(a,g){var p=0;if((a===17||a===25)&&g>=32&&g<=47){if(a===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(C.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[p];return b?(b.ccMIDROW(g),this.logger.log(C.DEBUG,"MIDROW ("+E([a,g])+")"),!0):!1}return!1},c.parsePAC=function(a,g){var p,b=this.cmdHistory,O=(a>=17&&a<=23||a>=25&&a<=31)&&g>=64&&g<=127,N=(a===16||a===24)&&g>=64&&g<=95;if(!(O||N))return!1;if(w(a,g,b))return m(null,null,b),!0;var W=a<=23?1:2;g>=64&&g<=95?p=W===1?I[a]:v[a]:p=W===1?R[a]:T[a];var Q=this.channels[W];return Q?(Q.setPAC(this.interpretPAC(p,g)),m(a,g,b),this.currentChannel=W,!0):!1},c.interpretPAC=function(a,g){var p,b={color:null,italics:!1,indent:null,underline:!1,row:a};return g>95?p=g-96:p=g-64,b.underline=(p&1)===1,p<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((p-16)/2)*4,b},c.parseChars=function(a,g){var p,b=null,O=null;if(a>=25?(p=2,O=a-8):(p=1,O=a),O>=17&&O<=19){var N;O===17?N=g+80:O===18?N=g+112:N=g+144,this.logger.log(C.INFO,"Special char '"+M(N)+"' in channel "+p),b=[N]}else a>=32&&a<=127&&(b=g===0?[a]:[a,g]);if(b){var W=E(b);this.logger.log(C.DEBUG,"Char codes = "+W.join(",")),m(a,g,this.cmdHistory)}return b},c.parseBackgroundAttributes=function(a,g){var p=(a===16||a===24)&&g>=32&&g<=47,b=(a===23||a===31)&&g>=45&&g<=47;if(!(p||b))return!1;var O,N={};a===16||a===24?(O=Math.floor((g-32)/2),N.background=L[O],g%2===1&&(N.background=N.background+"_semi")):g===45?N.background="transparent":(N.foreground="black",g===47&&(N.underline=!0));var W=a<=23?1:2,Q=this.channels[W];return Q.setBkgData(N),m(a,g,this.cmdHistory),!0},c.reset=function(){for(var a=0;a<Object.keys(this.channels).length;a++){var g=this.channels[a];g&&g.reset()}this.cmdHistory=y()},c.cueSplitAtTime=function(a){for(var g=0;g<this.channels.length;g++){var p=this.channels[g];p&&p.cueSplitAtTime(a)}},h}();function m(h,c,s){s.a=h,s.b=c}function w(h,c,s){return s.a===h&&s.b===c}function y(){return{a:null,b:null}}G.default=f},"./src/utils/codecs.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"isCodecType",function(){return P}),D.d(G,"isCodecSupportedInMp4",function(){return M});var K={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 P(U,B){var I=K[B];return!!I&&I[U.slice(0,4)]===!0}function M(U,B){return MediaSource.isTypeSupported((B||"video")+'/mp4;codecs="'+U+'"')}},"./src/utils/cues.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/vttparser.ts"),P=D("./src/utils/webvtt-parser.ts"),M=D("./src/utils/texttrack-utils.ts"),U=/\s/,B={newCue:function(R,v,T,L){for(var C=[],S,E,u,o,l,d=self.VTTCue||self.TextTrackCue,A=0;A<L.rows.length;A++)if(S=L.rows[A],u=!0,o=0,l="",!S.isEmpty()){for(var f=0;f<S.chars.length;f++)U.test(S.chars[f].uchar)&&u?o++:(l+=S.chars[f].uchar,u=!1);S.cueStartTime=v,v===T&&(T+=1e-4),o>=16?o--:o++;var m=Object(K.fixLineBreaks)(l.trim()),w=Object(P.generateCueId)(v,T,m);(!R||!R.cues||!R.cues.getCueById(w))&&(E=new d(v,T,m),E.id=w,E.line=A+1,E.align="left",E.position=10+Math.min(80,Math.floor(o*8/32)*10),C.push(E))}return R&&C.length&&(C.sort(function(y,h){return y.line==="auto"||h.line==="auto"?0:y.line>8&&h.line>8?h.line-y.line:y.line-h.line}),C.forEach(function(y){return Object(M.addCueToTrack)(R,y)})),C}};G.default=B},"./src/utils/discontinuities.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"findFirstFragWithCC",function(){return U}),D.d(G,"shouldAlignOnDiscontinuities",function(){return B}),D.d(G,"findDiscontinuousReferenceFrag",function(){return I}),D.d(G,"adjustSlidingStart",function(){return v}),D.d(G,"alignStream",function(){return T}),D.d(G,"alignPDT",function(){return C}),D.d(G,"alignFragmentByPDTDelta",function(){return S}),D.d(G,"alignMediaPlaylistByPDT",function(){return E});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/logger.ts"),M=D("./src/controller/level-helper.ts");function U(u,o){for(var l=null,d=0,A=u.length;d<A;d++){var f=u[d];if(f&&f.cc===o){l=f;break}}return l}function B(u,o,l){return!!(o.details&&(l.endCC>l.startCC||u&&u.cc<l.startCC))}function I(u,o){var l=u.fragments,d=o.fragments;if(!d.length||!l.length){P.logger.log("No fragments to align");return}var A=U(l,d[0].cc);if(!A||A&&!A.startPTS){P.logger.log("No frag in previous level to align on");return}return A}function R(u,o){if(u){var l=u.start+o;u.start=u.startPTS=l,u.endPTS=l+u.duration}}function v(u,o){for(var l=o.fragments,d=0,A=l.length;d<A;d++)R(l[d],u);o.fragmentHint&&R(o.fragmentHint,u),o.alignedSliding=!0}function T(u,o,l){if(!o)return;L(u,l,o),!l.alignedSliding&&o.details&&C(l,o.details),!l.alignedSliding&&o.details&&!l.skippedSegments&&Object(M.adjustSliding)(o.details,l)}function L(u,o,l){if(B(u,l,o)){var d=I(l.details,o);d&&Object(K.isFiniteNumber)(d.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),v(d.start,o))}}function C(u,o){if(!o.fragments.length||!u.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,d=u.fragments[0].programDateTime,A=(d-l)/1e3+o.fragments[0].start;A&&Object(K.isFiniteNumber)(A)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(d-l)+"ms, sliding:"+A.toFixed(3)+" "+u.url+" "),v(A,u))}function S(u,o){var l=u.programDateTime;if(!l)return;var d=(l-o)/1e3;u.start=u.startPTS=d,u.endPTS=d+u.duration}function E(u,o){if(!o.fragments.length||!u.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,d=o.fragments[0].start,A=l-d*1e3;u.fragments.forEach(function(f){S(f,A)}),u.fragmentHint&&S(u.fragmentHint,A),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/ewma.ts"),P=function(){function M(B,I,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 K.default(B),this.fast_=new K.default(I)}var U=M.prototype;return U.update=function(I,R){var v=this.slow_,T=this.fast_;this.slow_.halfLife!==I&&(this.slow_=new K.default(I,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new K.default(R,T.getEstimate(),T.getTotalWeight()))},U.sample=function(I,R){I=Math.max(I,this.minDelayMs_);var v=8*R,T=I/1e3,L=v/T;this.fast_.sample(T,L),this.slow_.sample(T,L)},U.canEstimate=function(){var I=this.fast_;return I&&I.getTotalWeight()>=this.minWeight_},U.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},U.destroy=function(){},M}();G.default=P},"./src/utils/ewma.ts":function(q,G,D){"use strict";D.r(G);var K=function(){function P(U,B,I){B===void 0&&(B=0),I===void 0&&(I=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=U,this.alpha_=U?Math.exp(Math.log(.5)/U):0,this.estimate_=B,this.totalWeight_=I}var M=P.prototype;return M.sample=function(B,I){var R=Math.pow(this.alpha_,B);this.estimate_=I*(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_},P}();G.default=K},"./src/utils/fetch-loader.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"fetchSupported",function(){return S});var K=D("./src/polyfills/number.ts"),P=D("./src/loader/load-stats.ts"),M=D("./src/demux/chunk-cache.ts");function U(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,T(d,A)}function B(d){var A=typeof Map=="function"?new Map:void 0;return B=function(m){if(m===null||!v(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(m))return A.get(m);A.set(m,w)}function w(){return I(m,arguments,L(this).constructor)}return w.prototype=Object.create(m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),T(w,m)},B(d)}function I(d,A,f){return R()?I=Reflect.construct:I=function(w,y,h){var c=[null];c.push.apply(c,y);var s=Function.bind.apply(w,c),a=new s;return h&&T(a,h.prototype),a},I.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(d){return!1}}function v(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function T(d,A){return T=Object.setPrototypeOf||function(m,w){return m.__proto__=w,m},T(d,A)}function L(d){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},L(d)}function C(){return C=Object.assign||function(d){for(var A=1;A<arguments.length;A++){var f=arguments[A];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(d[m]=f[m])}return d},C.apply(this,arguments)}function S(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var E=function(){function d(f){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=f.fetchSetup||o,this.controller=new self.AbortController,this.stats=new P.LoadStats}var A=d.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(m,w,y){var h=this,c=this.stats;if(c.loading.start)throw new Error("Loader can only be used once.");c.loading.start=self.performance.now();var s=u(m,this.controller.signal),a=y.onProgress,g=m.responseType==="arraybuffer",p=g?"byteLength":"length";this.context=m,this.config=w,this.callbacks=y,this.request=this.fetchSetup(m,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){h.abortInternal(),y.onTimeout(c,m,h.response)},w.timeout),self.fetch(this.request).then(function(b){if(h.response=h.loader=b,!b.ok){var O=b.status,N=b.statusText;throw new l(N||"fetch, bad network response",O,b)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(b.headers.get("Content-Length")||"0"),a&&Object(K.isFiniteNumber)(w.highWaterMark)?h.loadProgressively(b,c,m,w.highWaterMark,a):g?b.arrayBuffer():b.text()}).then(function(b){var O=h.response;self.clearTimeout(h.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=b[p];var N={url:O.url,data:b};a&&!Object(K.isFiniteNumber)(w.highWaterMark)&&a(c,m,b,O),y.onSuccess(N,c,m,O)}).catch(function(b){if(self.clearTimeout(h.requestTimeout),c.aborted)return;var O=b.code||0;y.onError({code:O,text:b.message},m,b.details)})},A.getCacheAge=function(){var m=null;if(this.response){var w=this.response.headers.get("age");m=w?parseFloat(w):null}return m},A.loadProgressively=function(m,w,y,h,c){h===void 0&&(h=0);var s=new M.default,a=m.body.getReader(),g=function p(){return a.read().then(function(b){if(b.done)return s.dataLength&&c(w,y,s.flush(),m),Promise.resolve(new ArrayBuffer(0));var O=b.value,N=O.length;return w.loaded+=N,N<h||s.dataLength?(s.push(O),s.dataLength>=h&&c(w,y,s.flush(),m)):c(w,y,O,m),p()}).catch(function(){return Promise.reject()})};return g()},d}();function u(d,A){var f={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(C({},d.headers))};return d.rangeEnd&&f.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),f}function o(d,A){return new self.Request(d.url,A)}var l=function(d){U(A,d);function A(f,m,w){var y;return y=d.call(this,f)||this,y.code=void 0,y.details=void 0,y.code=m,y.details=w,y}return A}(B(Error));G.default=E},"./src/utils/imsc1-ttml-parser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"IMSC1_CODEC",function(){return v}),D.d(G,"parseIMSC1",function(){return S});var K=D("./src/utils/mp4-tools.ts"),P=D("./src/utils/vttparser.ts"),M=D("./src/utils/vttcue.ts"),U=D("./src/demux/id3.ts"),B=D("./src/utils/timescale-conversion.ts"),I=D("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var s=arguments[c];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(h[a]=s[a])}return h},R.apply(this,arguments)}var v="stpp.ttml.im1t",T=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,L=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,C={left:"start",center:"center",right:"end",start:"start",end:"end"};function S(h,c,s,a,g){var p=Object(K.findBox)(new Uint8Array(h),["mdat"]);if(p.length===0){g(new Error("Could not parse IMSC1 mdat"));return}var b=p[0],O=Object(U.utf8ArrayToStr)(new Uint8Array(h,b.start,b.end-b.start)),N=Object(B.toTimescaleFromScale)(c,1,s);try{a(E(O,N))}catch(W){g(W)}}function E(h,c){var s=new DOMParser,a=s.parseFromString(h,"text/xml"),g=a.getElementsByTagName("tt")[0];if(!g)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(p).reduce(function(F,_){return F[_]=g.getAttribute("ttp:"+_)||p[_],F},{}),O=g.getAttribute("xml:space")!=="preserve",N=o(u(g,"styling","style")),W=o(u(g,"layout","region")),Q=u(g,"body","[begin]");return[].map.call(Q,function(F){var _=l(F,O);if(!_||!F.hasAttribute("begin"))return null;var J=m(F.getAttribute("begin"),b),ee=m(F.getAttribute("dur"),b),re=m(F.getAttribute("end"),b);if(J===null)throw f(F);if(re===null){if(ee===null)throw f(F);re=J+ee}var de=new M.default(J-c,re-c,_);de.id=Object(I.generateCueId)(de.startTime,de.endTime,de.text);var Te=W[F.getAttribute("region")],ve=N[F.getAttribute("style")];de.position=10,de.size=80;var pe=d(Te,ve),he=pe.textAlign;if(he){var me=C[he];me&&(de.lineAlign=me),de.align=he}return R(de,pe),de}).filter(function(F){return F!==null})}function u(h,c,s){var a=h.getElementsByTagName(c)[0];return a?[].slice.call(a.querySelectorAll(s)):[]}function o(h){return h.reduce(function(c,s){var a=s.getAttribute("xml:id");return a&&(c[a]=s),c},{})}function l(h,c){return[].slice.call(h.childNodes).reduce(function(s,a,g){var p;return a.nodeName==="br"&&g?s+`
|
|
`:(p=a.childNodes)!==null&&p!==void 0&&p.length?l(a,c):c?s+a.textContent.trim().replace(/\s+/g," "):s+a.textContent},"")}function d(h,c){var s="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(g,p){var b=A(c,s,p)||A(h,s,p);return b&&(g[p]=b),g},{})}function A(h,c,s){return h.hasAttributeNS(c,s)?h.getAttributeNS(c,s):null}function f(h){return new Error("Could not parse ttml timestamp "+h)}function m(h,c){if(!h)return null;var s=Object(P.parseTimeStamp)(h);return s===null&&(T.test(h)?s=w(h,c):L.test(h)&&(s=y(h,c))),s}function w(h,c){var s=T.exec(h),a=(s[4]|0)+(s[5]|0)/c.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+a/c.frameRate}function y(h,c){var s=L.exec(h),a=Number(s[1]),g=s[2];switch(g){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/c.frameRate;case"t":return a/c.tickRate}return a}},"./src/utils/logger.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"enableLogs",function(){return I}),D.d(G,"logger",function(){return R});var K=function(){},P={trace:K,debug:K,log:K,warn:K,info:K,error:K},M=P;function U(v){var T=self.console[v];return T?T.bind(self.console,"["+v+"] >"):K}function B(v){for(var T=arguments.length,L=new Array(T>1?T-1:0),C=1;C<T;C++)L[C-1]=arguments[C];L.forEach(function(S){M[S]=v[S]?v[S].bind(v):U(S)})}function I(v){if(self.console&&v===!0||typeof v=="object"){B(v,"debug","log","info","warn","error");try{M.log()}catch(T){M=P}}else M=P}var R=M},"./src/utils/mediakeys-helper.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"KeySystems",function(){return K}),D.d(G,"requestMediaKeySystemAccess",function(){return P});var K;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(K||(K={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"getMediaSource",function(){return K});function K(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"bin2str",function(){return B}),D.d(G,"readUint16",function(){return I}),D.d(G,"readUint32",function(){return R}),D.d(G,"writeUint32",function(){return v}),D.d(G,"findBox",function(){return T}),D.d(G,"parseSegmentIndex",function(){return L}),D.d(G,"parseInitSegment",function(){return C}),D.d(G,"getStartDTS",function(){return S}),D.d(G,"getDuration",function(){return E}),D.d(G,"computeRawDurationFromSamples",function(){return u}),D.d(G,"offsetStartDTS",function(){return o}),D.d(G,"segmentValidRange",function(){return l}),D.d(G,"appendUint8Array",function(){return d});var K=D("./src/utils/typed-array.ts"),P=D("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,U=[].push;function B(A){return String.fromCharCode.apply(null,A)}function I(A,f){"data"in A&&(f+=A.start,A=A.data);var m=A[f]<<8|A[f+1];return m<0?65536+m:m}function R(A,f){"data"in A&&(f+=A.start,A=A.data);var m=A[f]<<24|A[f+1]<<16|A[f+2]<<8|A[f+3];return m<0?4294967296+m:m}function v(A,f,m){"data"in A&&(f+=A.start,A=A.data),A[f]=m>>24,A[f+1]=m>>16&255,A[f+2]=m>>8&255,A[f+3]=m&255}function T(A,f){var m=[];if(!f.length)return m;var w,y,h;"data"in A?(w=A.data,y=A.start,h=A.end):(w=A,y=0,h=w.byteLength);for(var c=y;c<h;){var s=R(w,c),a=B(w.subarray(c+4,c+8)),g=s>1?c+s:h;if(a===f[0])if(f.length===1)m.push({data:w,start:c+8,end:g});else{var p=T({data:w,start:c+8,end:g},f.slice(1));p.length&&U.apply(m,p)}c=g}return m}function L(A){var f=T(A,["moov"]),m=f[0],w=m?m.end:null,y=T(A,["sidx"]);if(!y||!y[0])return null;var h=[],c=y[0],s=c.data[0],a=s===0?8:16,g=R(c,a);a+=4;var p=0,b=0;s===0?a+=8:a+=16,a+=2;var O=c.end+b,N=I(c,a);a+=2;for(var W=0;W<N;W++){var Q=a,F=R(c,Q);Q+=4;var _=F&2147483647,J=(F&2147483648)>>>31;if(J===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=R(c,Q);Q+=4,h.push({referenceSize:_,subsegmentDuration:ee,info:{duration:ee/g,start:O,end:O+_-1}}),O+=_,Q+=4,a=Q}return{earliestPresentationTime:p,timescale:g,version:s,referencesCount:N,references:h,moovEndOffset:w}}function C(A){for(var f=[],m=T(A,["moov","trak"]),w=0;w<m.length;w++){var y=m[w],h=T(y,["tkhd"])[0];if(h){var c=h.data[h.start],s=c===0?12:20,a=R(h,s),g=T(y,["mdia","mdhd"])[0];if(g){c=g.data[g.start],s=c===0?12:20;var p=R(g,s),b=T(y,["mdia","hdlr"])[0];if(b){var O=B(b.data.subarray(b.start+8,b.start+12)),N={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[O];if(N){var W=T(y,["mdia","minf","stbl","stsd"])[0],Q=void 0;W&&(Q=B(W.data.subarray(W.start+12,W.start+16))),f[a]={timescale:p,type:N},f[N]={timescale:p,id:a,codec:Q}}}}}}var F=T(A,["moov","mvex","trex"]);return F.forEach(function(_){var J=R(_,4),ee=f[J];ee&&(ee.default={duration:R(_,12),flags:R(_,20)})}),f}function S(A,f){return T(f,["moof","traf"]).reduce(function(m,w){var y=T(w,["tfdt"])[0],h=y.data[y.start],c=T(w,["tfhd"]).reduce(function(s,a){var g=R(a,4),p=A[g];if(p){var b=R(y,4);h===1&&(b*=Math.pow(2,32),b+=R(y,8));var O=p.timescale||9e4,N=b/O;if(isFinite(N)&&(s===null||N<s))return N}return s},null);return c!==null&&isFinite(c)&&(m===null||c<m)?c:m},null)||0}function E(A,f){for(var m=0,w=0,y=0,h=T(A,["moof","traf"]),c=0;c<h.length;c++){var s=h[c],a=T(s,["tfhd"])[0],g=R(a,4),p=f[g];if(!p)continue;var b=p.default,O=R(a,0)|(b==null?void 0:b.flags),N=b==null?void 0:b.duration;O&8&&(O&2?N=R(a,12):N=R(a,8));for(var W=p.timescale||9e4,Q=T(s,["trun"]),F=0;F<Q.length;F++){if(N){var _=R(Q[F],4);m=N*_}else m=u(Q[F]);p.type===P.ElementaryStreamTypes.VIDEO?w+=m/W:p.type===P.ElementaryStreamTypes.AUDIO&&(y+=m/W)}}if(w===0&&y===0){var J=L(A);if(J!=null&&J.references)return J.references.reduce(function(ee,re){return ee+re.info.duration||0},0)}return w||y}function u(A){var f=R(A,0),m=8;f&1&&(m+=4),f&4&&(m+=4);for(var w=0,y=R(A,4),h=0;h<y;h++){if(f&256){var c=R(A,m);w+=c,m+=4}f&512&&(m+=4),f&1024&&(m+=4),f&2048&&(m+=4)}return w}function o(A,f,m){T(f,["moof","traf"]).forEach(function(w){T(w,["tfhd"]).forEach(function(y){var h=R(y,4),c=A[h];if(!c)return;var s=c.timescale||9e4;T(w,["tfdt"]).forEach(function(a){var g=a.data[a.start],p=R(a,4);if(g===0)v(a,4,p-m*s);else{p*=Math.pow(2,32),p+=R(a,8),p-=m*s,p=Math.max(p,0);var b=Math.floor(p/(M+1)),O=Math.floor(p%(M+1));v(a,4,b),v(a,8,O)}})})})}function l(A){var f={valid:null,remainder:null},m=T(A,["moof"]);if(m){if(m.length<2)return f.remainder=A,f}else return f;var w=m[m.length-1];return f.valid=Object(K.sliceUint8)(A,0,w.start-8),f.remainder=Object(K.sliceUint8)(A,w.start-8),f}function d(A,f){var m=new Uint8Array(A.length+f.length);return m.set(A),m.set(f,A.length),m}},"./src/utils/output-filter.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"default",function(){return K});var K=function(){function P(U,B){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=U,this.trackName=B}var M=P.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,I,R){(this.startTime===null||this.startTime>B)&&(this.startTime=B),this.endTime=I,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"sendAddTrackEvent",function(){return P}),D.d(G,"addCueToTrack",function(){return M}),D.d(G,"clearCurrentCues",function(){return U}),D.d(G,"removeCuesInRange",function(){return B}),D.d(G,"getCuesInRange",function(){return R});var K=D("./src/utils/logger.ts");function P(v,T){var L;try{L=new Event("addtrack")}catch(C){L=document.createEvent("Event"),L.initEvent("addtrack",!1,!1)}L.track=v,T.dispatchEvent(L)}function M(v,T){var L=v.mode;if(L==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(T.id))try{if(v.addCue(T),!v.cues.getCueById(T.id))throw new Error("addCue is failed for: "+T)}catch(S){K.logger.debug("[texttrack-utils]: "+S);var C=new self.TextTrackCue(T.startTime,T.endTime,T.text);C.id=T.id,v.addCue(C)}L==="disabled"&&(v.mode=L)}function U(v){var T=v.mode;if(T==="disabled"&&(v.mode="hidden"),v.cues)for(var L=v.cues.length;L--;)v.removeCue(v.cues[L]);T==="disabled"&&(v.mode=T)}function B(v,T,L){var C=v.mode;if(C==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var S=R(v.cues,T,L),E=0;E<S.length;E++)v.removeCue(S[E]);C==="disabled"&&(v.mode=C)}function I(v,T){if(T<v[0].startTime)return 0;var L=v.length-1;if(T>v[L].endTime)return-1;for(var C=0,S=L;C<=S;){var E=Math.floor((S+C)/2);if(T<v[E].startTime)S=E-1;else if(T>v[E].startTime&&C<L)C=E+1;else return E}return v[C].startTime-T<T-v[S].startTime?C:S}function R(v,T,L){var C=[],S=I(v,T);if(S>-1)for(var E=S,u=v.length;E<u;E++){var o=v[E];if(o.startTime>=T&&o.endTime<=L)C.push(o);else if(o.startTime>L)return C}return C}},"./src/utils/time-ranges.ts":function(q,G,D){"use strict";D.r(G);var K={toString:function(M){for(var U="",B=M.length,I=0;I<B;I++)U+="["+M.start(I).toFixed(3)+","+M.end(I).toFixed(3)+"]";return U}};G.default=K},"./src/utils/timescale-conversion.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"toTimescaleFromBase",function(){return P}),D.d(G,"toTimescaleFromScale",function(){return M}),D.d(G,"toMsFromMpegTsClock",function(){return U}),D.d(G,"toMpegTsClockFromTimescale",function(){return B});var K=9e4;function P(I,R,v,T){v===void 0&&(v=1),T===void 0&&(T=!1);var L=I*R*v;return T?Math.round(L):L}function M(I,R,v,T){return v===void 0&&(v=1),T===void 0&&(T=!1),P(I,R,1/v,T)}function U(I,R){return R===void 0&&(R=!1),P(I,1e3,1/K,R)}function B(I,R){return R===void 0&&(R=1),P(I,K,1/R)}},"./src/utils/typed-array.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"sliceUint8",function(){return K});function K(P,M,U){return Uint8Array.prototype.slice?P.slice(M,U):new Uint8Array(Array.prototype.slice.call(P,M,U))}},"./src/utils/vttcue.ts":function(q,G,D){"use strict";D.r(G),G.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var K=["","lr","rl"],P=["start","middle","end","left","right"];function M(v,T){if(typeof T!="string")return!1;if(!Array.isArray(v))return!1;var L=T.toLowerCase();return~v.indexOf(L)?L:!1}function U(v){return M(K,v)}function B(v){return M(P,v)}function I(v){for(var T=arguments.length,L=new Array(T>1?T-1:0),C=1;C<T;C++)L[C-1]=arguments[C];for(var S=1;S<arguments.length;S++){var E=arguments[S];for(var u in E)v[u]=E[u]}return v}function R(v,T,L){var C=this,S={enumerable:!0};C.hasBeenReset=!1;var E="",u=!1,o=v,l=T,d=L,A=null,f="",m=!0,w="auto",y="start",h=50,c="middle",s=50,a="middle";Object.defineProperty(C,"id",I({},S,{get:function(){return E},set:function(p){E=""+p}})),Object.defineProperty(C,"pauseOnExit",I({},S,{get:function(){return u},set:function(p){u=!!p}})),Object.defineProperty(C,"startTime",I({},S,{get:function(){return o},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");o=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"endTime",I({},S,{get:function(){return l},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");l=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"text",I({},S,{get:function(){return d},set:function(p){d=""+p,this.hasBeenReset=!0}})),Object.defineProperty(C,"region",I({},S,{get:function(){return A},set:function(p){A=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"vertical",I({},S,{get:function(){return f},set:function(p){var b=U(p);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");f=b,this.hasBeenReset=!0}})),Object.defineProperty(C,"snapToLines",I({},S,{get:function(){return m},set:function(p){m=!!p,this.hasBeenReset=!0}})),Object.defineProperty(C,"line",I({},S,{get:function(){return w},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"lineAlign",I({},S,{get:function(){return y},set:function(p){var b=B(p);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");y=b,this.hasBeenReset=!0}})),Object.defineProperty(C,"position",I({},S,{get:function(){return h},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");h=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"positionAlign",I({},S,{get:function(){return c},set:function(p){var b=B(p);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),Object.defineProperty(C,"size",I({},S,{get:function(){return s},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");s=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"align",I({},S,{get:function(){return a},set:function(p){var b=B(p);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");a=b,this.hasBeenReset=!0}})),C.displayState=void 0}return R.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"parseTimeStamp",function(){return M}),D.d(G,"fixLineBreaks",function(){return T}),D.d(G,"VTTParser",function(){return L});var K=D("./src/utils/vttcue.ts"),P=function(){function C(){}var S=C.prototype;return S.decode=function(u,o){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},C}();function M(C){function S(u,o,l,d){return(u|0)*3600+(o|0)*60+(l|0)+parseFloat(d||0)}var E=C.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return E?parseFloat(E[2])>59?S(E[2],E[3],0,E[4]):S(E[1],E[2],E[3],E[4]):null}var U=function(){function C(){this.values=Object.create(null)}var S=C.prototype;return S.set=function(u,o){!this.get(u)&&o!==""&&(this.values[u]=o)},S.get=function(u,o,l){return l?this.has(u)?this.values[u]:o[l]:this.has(u)?this.values[u]:o},S.has=function(u){return u in this.values},S.alt=function(u,o,l){for(var d=0;d<l.length;++d)if(o===l[d]){this.set(u,o);break}},S.integer=function(u,o){/^-?\d+$/.test(o)&&this.set(u,parseInt(o,10))},S.percent=function(u,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var l=parseFloat(o);if(l>=0&&l<=100)return this.set(u,l),!0}return!1},C}();function B(C,S,E,u){var o=u?C.split(u):[C];for(var l in o){if(typeof o[l]!="string")continue;var d=o[l].split(E);if(d.length!==2)continue;var A=d[0],f=d[1];S(A,f)}}var I=new K.default(0,0,""),R=I.align==="middle"?"middle":"center";function v(C,S,E){var u=C;function o(){var A=M(C);if(A===null)throw new Error("Malformed timestamp: "+u);return C=C.replace(/^[^\sa-zA-Z-]+/,""),A}function l(A,f){var m=new U;B(A,function(h,c){var s;switch(h){case"region":for(var a=E.length-1;a>=0;a--)if(E[a].id===c){m.set(h,E[a].region);break}break;case"vertical":m.alt(h,c,["rl","lr"]);break;case"line":s=c.split(","),m.integer(h,s[0]),m.percent(h,s[0])&&m.set("snapToLines",!1),m.alt(h,s[0],["auto"]),s.length===2&&m.alt("lineAlign",s[1],["start",R,"end"]);break;case"position":s=c.split(","),m.percent(h,s[0]),s.length===2&&m.alt("positionAlign",s[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":m.percent(h,c);break;case"align":m.alt(h,c,["start",R,"end","left","right"]);break}},/:/,/\s/),f.region=m.get("region",null),f.vertical=m.get("vertical","");var w=m.get("line","auto");w==="auto"&&I.line===-1&&(w=-1),f.line=w,f.lineAlign=m.get("lineAlign","start"),f.snapToLines=m.get("snapToLines",!0),f.size=m.get("size",100),f.align=m.get("align",R);var y=m.get("position","auto");y==="auto"&&I.position===50&&(y=f.align==="start"||f.align==="left"?0:f.align==="end"||f.align==="right"?100:50),f.position=y}function d(){C=C.replace(/^\s+/,"")}if(d(),S.startTime=o(),d(),C.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);C=C.substr(3),d(),S.endTime=o(),d(),l(C,S)}function T(C){return C.replace(/<br(?: \/)?>/gi,`
|
|
`)}var L=function(){function C(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var S=C.prototype;return S.parse=function(u){var o=this;u&&(o.buffer+=o.decoder.decode(u,{stream:!0}));function l(){var y=o.buffer,h=0;for(y=T(y);h<y.length&&y[h]!=="\r"&&y[h]!==`
|
|
`;)++h;var c=y.substr(0,h);return y[h]==="\r"&&++h,y[h]===`
|
|
`&&++h,o.buffer=y.substr(h),c}function d(y){B(y,function(h,c){},/:/)}try{var A="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;A=l();var f=A.match(/^()?WEBVTT([ \t].*)?$/);if(!f||!f[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var m=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;m?m=!1:A=l();switch(o.state){case"HEADER":/:/.test(A)?d(A):A||(o.state="ID");continue;case"NOTE":A||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){o.state="NOTE";break}if(!A)continue;if(o.cue=new K.default(0,0,""),o.state="CUE",A.indexOf("-->")===-1){o.cue.id=A;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{v(A,o.cue,o.regionList)}catch(y){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var w=A.indexOf("-->")!==-1;if(!A||w&&(m=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
|
|
`),o.cue.text+=A}continue;case"BADCUE":A||(o.state="ID")}}}catch(y){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},S.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
|
|
|
|
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){u.onparsingerror&&u.onparsingerror(o)}return u.onflush&&u.onflush(),this},C}()},"./src/utils/webvtt-parser.ts":function(q,G,D){"use strict";D.r(G),D.d(G,"generateCueId",function(){return L}),D.d(G,"parseWebVTT",function(){return S});var K=D("./src/polyfills/number.ts"),P=D("./src/utils/vttparser.ts"),M=D("./src/demux/id3.ts"),U=D("./src/utils/timescale-conversion.ts"),B=D("./src/remux/mp4-remuxer.ts"),I=/\r\n|\n\r|\n|\r/g,R=function(u,o,l){return l===void 0&&(l=0),u.substr(l,o.length)===o},v=function(u){var o=parseInt(u.substr(-3)),l=parseInt(u.substr(-6,2)),d=parseInt(u.substr(-9,2)),A=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(K.isFiniteNumber)(o)||!Object(K.isFiniteNumber)(l)||!Object(K.isFiniteNumber)(d)||!Object(K.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return o+=1e3*l,o+=60*1e3*d,o+=60*60*1e3*A,o},T=function(u){for(var o=5381,l=u.length;l;)o=o*33^u.charCodeAt(--l);return(o>>>0).toString()};function L(E,u,o){return T(E.toString())+T(u.toString())+T(o)}var C=function(u,o,l){var d=u[o],A=u[d.prevCC];if(!A||!A.new&&d.new){u.ccOffset=u.presentationOffset=d.start,d.new=!1;return}for(;(f=A)!==null&&f!==void 0&&f.new;){var f;u.ccOffset+=d.start-A.start,d.new=!1,d=A,A=u[d.prevCC]}u.presentationOffset=l};function S(E,u,o,l,d,A,f,m){var w=new P.VTTParser,y=Object(M.utf8ArrayToStr)(new Uint8Array(E)).trim().replace(I,`
|
|
`).split(`
|
|
`),h=[],c=Object(U.toMpegTsClockFromTimescale)(u,o),s="00:00.000",a=0,g=0,p,b=!0,O=!1;w.oncue=function(N){var W=l[d],Q=l.ccOffset,F=(a-c)/9e4;if(W!=null&&W.new&&(g!==void 0?Q=l.ccOffset=W.start:C(l,d,F)),F&&(Q=F-l.presentationOffset),O){var _=N.endTime-N.startTime,J=Object(B.normalizePts)((N.startTime+Q-g)*9e4,A*9e4)/9e4;N.startTime=J,N.endTime=J+_}var ee=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(ee)),N.id||(N.id=L(N.startTime,N.endTime,ee)),N.endTime>0&&h.push(N)},w.onparsingerror=function(N){p=N},w.onflush=function(){if(p){m(p);return}f(h)},y.forEach(function(N){if(b)if(R(N,"X-TIMESTAMP-MAP=")){b=!1,O=!0,N.substr(16).split(",").forEach(function(W){R(W,"LOCAL:")?s=W.substr(6):R(W,"MPEGTS:")&&(a=parseInt(W.substr(7)))});try{g=v(s)/1e3}catch(W){O=!1,p=W}return}else N===""&&(b=!1);w.parse(N+`
|
|
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(q,G,D){"use strict";D.r(G);var K=D("./src/utils/logger.ts"),P=D("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,U=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 P.LoadStats,this.retryDelay=0}var I=B.prototype;return I.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},I.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()))},I.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},I.load=function(v,T,L){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=T,this.callbacks=L,this.retryDelay=T.retryDelay,this.loadInternal()},I.loadInternal=function(){var v=this.config,T=this.context;if(!v)return;var L=this.loader=new self.XMLHttpRequest,C=this.stats;C.loading.first=0,C.loaded=0;var S=this.xhrSetup;try{if(S)try{S(L,T.url)}catch(o){L.open("GET",T.url,!0),S(L,T.url)}L.readyState||L.open("GET",T.url,!0);var E=this.context.headers;if(E)for(var u in E)L.setRequestHeader(u,E[u])}catch(o){this.callbacks.onError({code:L.status,text:o.message},T,L);return}T.rangeEnd&&L.setRequestHeader("Range","bytes="+T.rangeStart+"-"+(T.rangeEnd-1)),L.onreadystatechange=this.readystatechange.bind(this),L.onprogress=this.loadprogress.bind(this),L.responseType=T.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),L.send()},I.readystatechange=function(){var v=this.context,T=this.loader,L=this.stats;if(!v||!T)return;var C=T.readyState,S=this.config;if(L.aborted)return;if(C>=2)if(self.clearTimeout(this.requestTimeout),L.loading.first===0&&(L.loading.first=Math.max(self.performance.now(),L.loading.start)),C===4){T.onreadystatechange=null,T.onprogress=null;var E=T.status;if(E>=200&&E<300){L.loading.end=Math.max(self.performance.now(),L.loading.first);var u,o;if(v.responseType==="arraybuffer"?(u=T.response,o=u.byteLength):(u=T.responseText,o=u.length),L.loaded=L.total=o,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(L,v,u,T),!this.callbacks)return;var d={url:T.responseURL,data:u};this.callbacks.onSuccess(d,L,v,T)}else L.retry>=S.maxRetry||E>=400&&E<499?(K.logger.error(E+" while loading "+v.url),this.callbacks.onError({code:E,text:T.statusText},v,T)):(K.logger.warn(E+" 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),L.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),S.timeout)},I.loadtimeout=function(){K.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},I.loadprogress=function(v){var T=this.stats;T.loaded=v.loaded,v.lengthComputable&&(T.total=v.total)},I.getCacheAge=function(){var v=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var T=this.loader.getResponseHeader("age");v=T?parseFloat(T):null}return v},B}();G.default=U}}).default})},yslc:function(Se,xe){Se.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bwUhoa2YB4dNT1CHIzkoEkZzDYrrLtvkCeU0aBsULTw7WntRbtARoQrGbWHtBVw/Vpaggq9t1Rh9F7qwOM0ZA45fDgJp7PmJ0i4hCegU3AabjAc9qmF24r14JeXP+MZ4GEN+/69NmVvD0rGn8zThWYghF7XE7JFN+0wL0x5BQfVZLL60D1XE5JUNfxTqEZqC/C7Zgumeh96EvvqMP6ppNpvSCTM/Zx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