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

361 lines
993 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[248,7,9,10],{"+NIl":function(Pe,Re,$){(function(he){he($("VrN/"))})(function(he){"use strict";he.defineMode("stex",function(Y,k){"use strict";function V(w,A){w.cmdState.push(A)}function _(w){return w.cmdState.length>0?w.cmdState[w.cmdState.length-1]:null}function R(w){var A=w.cmdState.pop();A&&A.closeBracket()}function W(w){for(var A=w.cmdState,C=A.length-1;C>=0;C--){var h=A[C];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function F(w,A,C){return function(){this.name=w,this.bracketNo=0,this.style=A,this.styles=C,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=F("importmodule","tag",["string","builtin"]),O.documentclass=F("documentclass","tag",["","atom"]),O.usepackage=F("usepackage","tag",["atom"]),O.begin=F("begin","tag",["atom"]),O.end=F("end","tag",["atom"]),O.label=F("label","tag",["atom"]),O.ref=F("ref","tag",["atom"]),O.eqref=F("eqref","tag",["atom"]),O.cite=F("cite","tag",["atom"]),O.bibitem=F("bibitem","tag",["atom"]),O.Bibitem=F("Bibitem","tag",["atom"]),O.RBibitem=F("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function M(w,A){w.f=A}function g(w,A){var C;if(w.match(/^\\[a-zA-Z@]+/)){var h=w.current().slice(1);return C=O.hasOwnProperty(h)?O[h]:O.DEFAULT,C=new C,V(A,C),M(A,I),C.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return M(A,function(s,u){return S(s,u,"\\]")}),"keyword";if(w.match("\\("))return M(A,function(s,u){return S(s,u,"\\)")}),"keyword";if(w.match("$$"))return M(A,function(s,u){return S(s,u,"$$")}),"keyword";if(w.match("$"))return M(A,function(s,u){return S(s,u,"$")}),"keyword";var o=w.next();if(o=="%")return w.skipToEnd(),"comment";if(o=="}"||o=="]"){if(C=_(A),C)C.closeBracket(o),M(A,I);else return"error";return"bracket"}else return o=="{"||o=="["?(C=O.DEFAULT,C=new C,V(A,C),"bracket"):/\d/.test(o)?(w.eatWhile(/[\w.%]/),"atom"):(w.eatWhile(/[\w\-_]/),C=W(A),C.name=="begin"&&(C.argument=w.current()),C.styleIdentifier())}function S(w,A,C){if(w.eatSpace())return null;if(C&&w.match(C))return M(A,g),"keyword";if(w.match(/^\\[a-zA-Z@]+/))return"tag";if(w.match(/^[a-zA-Z]+/))return"variable-2";if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/]/))return"tag";if(w.match(/^[\^_&]/))return"tag";if(w.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(w.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=w.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(w.skipToEnd(),"comment"):"error"}function I(w,A){var C=w.peek(),h;return C=="{"||C=="["?(h=_(A),h.openBracket(C),w.eat(C),M(A,g),"bracket"):/[ \t\r]/.test(C)?(w.eat(C),null):(M(A,g),R(A),g(w,A))}return{startState:function(){var w=k.inMathMode?function(A,C){return S(A,C)}:g;return{cmdState:[],f:w}},copyState:function(w){return{cmdState:w.cmdState.slice(),f:w.f}},token:function(w,A){return A.f(w,A)},blankLine:function(w){w.f=g,w.cmdState.length=0},lineComment:"%"}}),he.defineMIME("text/x-stex","stex"),he.defineMIME("text/x-latex","stex")})},"/GNS":function(Pe,Re,$){Pe.exports=$.p+"static/search1.c4136dd4.png"},"19Vz":function(Pe,Re,$){(function(he){he($("VrN/"))})(function(he){he.defineOption("placeholder","",function(F,O,M){var g=M&&M!=he.Init;if(O&&!g)F.on("blur",_),F.on("change",R),F.on("swapDoc",R),he.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){V(F)}),R(F);else if(!O&&g){F.off("blur",_),F.off("change",R),F.off("swapDoc",R),he.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),Y(F);var S=F.getWrapperElement();S.className=S.className.replace(" CodeMirror-empty","")}O&&!F.hasFocus()&&_(F)});function Y(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function k(F){Y(F);var O=F.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=F.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var M=F.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),O.appendChild(M),F.display.lineSpace.insertBefore(O,F.display.lineSpace.firstChild)}function V(F){setTimeout(function(){var O=!1,M=F.getInputField();M.nodeName=="TEXTAREA"?O=!M.value:F.lineCount()==1&&(O=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),O?k(F):Y(F)},20)}function _(F){W(F)&&k(F)}function R(F){var O=F.getWrapperElement(),M=W(F);O.className=O.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?k(F):Y(F)}function W(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(Pe,Re,$){(function(he){he($("VrN/"))})(function(he){"use strict";var Y={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},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};he.defineMode("xml",function(V,_){var R=V.indentUnit,W={},F=_.htmlMode?Y:k;for(var O in F)W[O]=F[O];for(var O in _)W[O]=_[O];var M,g;function S(a,v){function f(H){return v.tokenize=H,H(a,v)}var E=a.next();if(E=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?f(A("atom","]]>")):null:a.match("--")?f(A("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),f(C(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),v.tokenize=A("meta","?>"),"meta"):(M=a.eat("/")?"closeTag":"openTag",v.tokenize=I,"tag bracket");if(E=="&"){var P;return a.eat("#")?a.eat("x")?P=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):P=a.eatWhile(/[\d]/)&&a.eat(";"):P=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),P?"atom":"error"}else return a.eatWhile(/[^&<]/),null}S.isInText=!0;function I(a,v){var f=a.next();if(f==">"||f=="/"&&a.eat(">"))return v.tokenize=S,M=f==">"?"endTag":"selfcloseTag","tag bracket";if(f=="=")return M="equals",null;if(f=="<"){v.tokenize=S,v.state=u,v.tagName=v.tagStart=null;var E=v.tokenize(a,v);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(f)?(v.tokenize=w(f),v.stringStartCol=a.column(),v.tokenize(a,v)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(a){var v=function(f,E){for(;!f.eol();)if(f.next()==a){E.tokenize=I;break}return"string"};return v.isInAttribute=!0,v}function A(a,v){return function(f,E){for(;!f.eol();){if(f.match(v)){E.tokenize=S;break}f.next()}return a}}function C(a){return function(v,f){for(var E;(E=v.next())!=null;){if(E=="<")return f.tokenize=C(a+1),f.tokenize(v,f);if(E==">")if(a==1){f.tokenize=S;break}else return f.tokenize=C(a-1),f.tokenize(v,f)}return"meta"}}function h(a,v,f){this.prev=a.context,this.tagName=v,this.indent=a.indented,this.startOfLine=f,(W.doNotIndent.hasOwnProperty(v)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function s(a,v){for(var f;;){if(!a.context)return;if(f=a.context.tagName,!W.contextGrabbers.hasOwnProperty(f)||!W.contextGrabbers[f].hasOwnProperty(v))return;o(a)}}function u(a,v,f){return a=="openTag"?(f.tagStart=v.column(),y):a=="closeTag"?m:u}function y(a,v,f){return a=="word"?(f.tagName=v.current(),g="tag",b):W.allowMissingTagName&&a=="endTag"?(g="tag bracket",b(a,v,f)):(g="error",y)}function m(a,v,f){if(a=="word"){var E=v.current();return f.context&&f.context.tagName!=E&&W.implicitlyClosed.hasOwnProperty(f.context.tagName)&&o(f),f.context&&f.context.tagName==E||W.matchClosing===!1?(g="tag",p):(g="tag error",D)}else return W.allowMissingTagName&&a=="endTag"?(g="tag bracket",p(a,v,f)):(g="error",D)}function p(a,v,f){return a!="endTag"?(g="error",p):(o(f),u)}function D(a,v,f){return g="error",p(a,v,f)}function b(a,v,f){if(a=="word")return g="attribute",c;if(a=="endTag"||a=="selfcloseTag"){var E=f.tagName,P=f.tagStart;return f.tagName=f.tagStart=null,a=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(E)?s(f,E):(s(f,E),f.context=new h(f,E,P==f.indented)),u}return g="error",b}function c(a,v,f){return a=="equals"?d:(W.allowMissing||(g="error"),b(a,v,f))}function d(a,v,f){return a=="string"?l:a=="word"&&W.allowUnquoted?(g="string",b):(g="error",b(a,v,f))}function l(a,v,f){return a=="string"?l:b(a,v,f)}return{startState:function(a){var v={tokenize:S,state:u,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(v.baseIndent=a),v},token:function(a,v){if(!v.tagName&&a.sol()&&(v.indented=a.indentation()),a.eatSpace())return null;M=null;var f=v.tokenize(a,v);return(f||M)&&f!="comment"&&(g=null,v.state=v.state(M||f,a,v),g&&(f=g=="error"?f+" error":g)),f},indent:function(a,v,f){var E=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+R;if(E&&E.noIndent)return he.Pass;if(a.tokenize!=I&&a.tokenize!=S)return f?f.match(/^(\s*)/)[0].length:0;if(a.tagName)return W.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+R*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(v))return 0;var P=v&&/^<(\/)?([\w_:\.-]*)/.exec(v);if(P&&P[1])for(;E;)if(E.tagName==P[2]){E=E.prev;break}else if(W.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(P)for(;E;){var H=W.contextGrabbers[E.tagName];if(H&&H.hasOwnProperty(P[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+R:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(a){a.state==d&&(a.state=b)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var v=[],f=a.context;f;f=f.prev)f.tagName&&v.push(f.tagName);return v.reverse()}}}),he.defineMIME("text/xml","xml"),he.defineMIME("application/xml","xml"),he.mimeModes.hasOwnProperty("text/html")||he.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"4YB9":function(Pe,Re,$){"use strict";var he=$("q1tI"),Y=$.n(he),k=$("Ty5D"),V=$("55Ip"),_=$("W1YM"),R=$.n(_);Re.a=function(W){var F=W.activeIndex,O=Object(k.i)(),M=O.id,g=O.challengesId,S=Object(he.useMemo)(function(){return[{name:"1\u3001\u672C\u5173\u4EFB\u52A1",url:"/shixuns/".concat(M,"/challenges/").concat(g,"/editcheckpoint")},{name:"2\u3001\u8BC4\u6D4B\u8BBE\u7F6E",url:"/shixuns/".concat(M,"/challenges/").concat(g,"/tab=2")},{name:"3\u3001\u53C2\u8003\u7B54\u6848",url:"/shixuns/".concat(M,"/challenges/").concat(g,"/tab=3")},{name:"4\u3001\u5173\u5361\u6392\u884C\u699C",url:"/shixuns/".concat(M,"/challenges/").concat(g,"/tab=4")}]},[M,g]);return Y.a.createElement("ul",{className:"challenge-nav"},S.map(function(I,w){return F===w?Y.a.createElement("li",{key:I.url}," ",Y.a.createElement("a",{className:"active"},I.name)," "):Y.a.createElement("li",{key:I.url}," ",Y.a.createElement(V.a,{to:I.url},I.name)," ")}))}},"4qgm":function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq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80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return s});var he=$("Ty5D"),Y=$("dI71"),k=$("q1tI"),V=$.n(k),_=$("YS25"),R=$("17x9"),W=$.n(R),F=$("wx14"),O=$("zLVn"),M=$("9R94"),g=function(d){Object(Y.a)(l,d);function l(){for(var v,f=arguments.length,E=new Array(f),P=0;P<f;P++)E[P]=arguments[P];return v=d.call.apply(d,[this].concat(E))||this,v.history=Object(_.a)(v.props),v}var a=l.prototype;return a.render=function(){return V.a.createElement(he.c,{history:this.history,children:this.props.children})},l}(V.a.Component),S=function(d){Object(Y.a)(l,d);function l(){for(var v,f=arguments.length,E=new Array(f),P=0;P<f;P++)E[P]=arguments[P];return v=d.call.apply(d,[this].concat(E))||this,v.history=Object(_.b)(v.props),v}var a=l.prototype;return a.render=function(){return V.a.createElement(he.c,{history:this.history,children:this.props.children})},l}(V.a.Component),I=function(l,a){return typeof l=="function"?l(a):l},w=function(l,a){return typeof l=="string"?Object(_.c)(l,null,null,a):l},A=function(l){return l},C=V.a.forwardRef;typeof C=="undefined"&&(C=A);function h(d){return!!(d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)}var o=C(function(d,l){var a=d.innerRef,v=d.navigate,f=d.onClick,E=Object(O.a)(d,["innerRef","navigate","onClick"]),P=E.target,H=Object(F.a)({},E,{onClick:function(re){try{f&&f(re)}catch(z){throw re.preventDefault(),z}!re.defaultPrevented&&re.button===0&&(!P||P==="_self")&&!h(re)&&(re.preventDefault(),v())}});return A!==C?H.ref=l||a:H.ref=a,V.a.createElement("a",H)}),s=C(function(d,l){var a=d.component,v=a===void 0?o:a,f=d.replace,E=d.to,P=d.innerRef,H=Object(O.a)(d,["component","replace","to","innerRef"]);return V.a.createElement(he.e.Consumer,null,function(Q){Q||Object(M.a)(!1);var re=Q.history,z=w(I(E,Q.location),Q.location),U=z?re.createHref(z):"",ae=Object(F.a)({},H,{href:U,navigate:function(){var ge=I(E,Q.location),Ee=f?re.replace:re.push;Ee(ge)}});return A!==C?ae.ref=l||P:ae.innerRef=P,V.a.createElement(v,ae)})});if(!1)var u,y;var m=function(l){return l},p=V.a.forwardRef;typeof p=="undefined"&&(p=m);function D(){for(var d=arguments.length,l=new Array(d),a=0;a<d;a++)l[a]=arguments[a];return l.filter(function(v){return v}).join(" ")}var b=p(function(d,l){var a=d["aria-current"],v=a===void 0?"page":a,f=d.activeClassName,E=f===void 0?"active":f,P=d.activeStyle,H=d.className,Q=d.exact,re=d.isActive,z=d.location,U=d.sensitive,ae=d.strict,fe=d.style,ge=d.to,Ee=d.innerRef,Ne=Object(O.a)(d,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(he.e.Consumer,null,function(Se){Se||Object(M.a)(!1);var Ie=z||Se.location,Ae=w(I(ge,Ie),Ie),we=Ae.pathname,ve=we&&we.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),j=ve?Object(he.f)(Ie.pathname,{path:ve,exact:Q,sensitive:U,strict:ae}):null,T=!!(re?re(j,Ie):j),L=T?D(H,E):H,G=T?Object(F.a)({},fe,{},P):fe,q=Object(F.a)({"aria-current":T&&v||null,className:L,style:G,to:Ae},Ne);return m!==p?q.ref=l||Ee:q.innerRef=Ee,V.a.createElement(s,q)})});if(!1)var c},"5D2P":function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFTklEQVRoQ91aS4xURRQ993UzUUZcqFEc4meh0cQFSlwgrvAHSgQWhOhCk4GZqmdw+ERUWDkrBMUBnIzzqqYjcTaaGBLFxA8MjIk/3PhZCCa6UAyKC11ARnDo6Wvu+HrS0/R7r96nWVBJpxfv3nPPrbp169aHUEAzxsxl5gcB3AdgAREtkH8AXSH87wBOMfMp+QfwFREd0Vr/k9c8ZQUwxixi5mWe5y1l5qUAyimxqkQ0XqvVxonoE631Nyn1p8VTO7B///75Fy5c2MzMWwB0ZDHaQmeSiPbMmTNnb3d39+k0mKkcMMZsBiC/W9IYSSH7K4C9Wuu9rjpODoyMjNxQq9VGADzuCpxT7gPP83p7e3v/TMJJdCAIgoVEdBDAzUlgBX8/ycwrfd//Pg431gFr7RPM/HbBxFLBEdGTSql3opQiHQiCoI+IXk9lrU3CzLzR9/3BVvAtHbDWPsrMH7aJTyZYInpMKfVRs/JFDlQqlduq1eoxIro2k6U2KTHzX+VyeXFPT8/PjSYucsBae4iZH24Tj1ywRHRYKfVIpANhnt+Ty0r7lbc0rhMzI2CMuRHAlwBubT+HXBZ+AbBEa/3HrFLCWruTmV/MBZ1N+TiAdyNUX2qZeYh2KaW2zThQqVTumZqaOlZgbePqynEiWquU+qFZwRjzBoBnIoAmS6WSTOhvp0PIGPMcgN2uVguSiyQfBIFPRMMJdrZqrV+bdsBa+x4zryqImAtMJHlr7RJmPgxgbhwQEb2vlFpNAwMDV3Z2dp7JUM+7EG0lE0l+dHS089y5c4dkkjqAVycmJq4ma+0yZv7YQaEIkUjyAh4EwTAR+a6GiGg5BUGwg4i2uyrlkEsi7xL3s8wz88syAm8x89M5iLmoxpIP4348bRYkolEyxowBkA25S1sLQJbyHhfhUCaWvMT9+fPnx5h5cQrMuugRceAEgDsdlKfTVph2rwMgC4mk37gWSz5L3DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"5EEG":function(Pe,Re,$){"use strict";$.r(Re);var he=$("+L6B"),Y=$("2/Rp"),k=$("oBTY"),V=$("giR+"),_=$("fyUT"),R=$("k1fw"),W=$("5Dmo"),F=$("3S7+"),O=$("miYZ"),M=$("tsqr"),g=$("9og8"),S=$("tJVT"),I=$("PpiC"),w=$("5NDa"),A=$("5rEg"),C=$("OaEy"),h=$("2fM7"),o=$("WmNS"),s=$.n(o),u=$("q1tI"),y=$.n(u),m=$("9kvl"),p=$("Ot1p"),D=$("HBuW"),b=$("E3HF"),c=$.n(b),d=$("9ZNV"),l=$("CJF0"),a=$("4YB9"),v=h.a.Option,f=A.a.TextArea,E=function(H){var Q=H.shixunsDetail,re=H.dispatch,z=H.loading,U=H.match,ae=Object(I.a)(H,["shixunsDetail","dispatch","loading","match"]),fe=Object(u.useState)({}),ge=Object(S.a)(fe,2),Ee=ge[0],Ne=ge[1],Se=Object(u.useState)([]),Ie=Object(S.a)(Se,2),Ae=Ie[0],we=Ie[1];Object(u.useEffect)(function(){return re({type:"globalSetting/footerToggle",payload:!1}),function(){re({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(u.useEffect)(function(){ve(),j()},[]);var ve=function(){var L=Object(g.a)(s.a.mark(function G(){var q;return s.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(D.J)({id:U.params.id,challengeId:U.params.challengesId,tab:2});case 2:q=ue.sent,q&&Ne(q);case 4:case"end":return ue.stop()}},G)}));return function(){return L.apply(this,arguments)}}(),j=function(){var L=Object(g.a)(s.a.mark(function G(){var q;return s.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(D.K)({id:U.params.id,challengeId:U.params.challengesId});case 2:q=ue.sent,q&&we(q);case 4:case"end":return ue.stop()}},G)}));return function(){return L.apply(this,arguments)}}(),T=function(){var L=Object(g.a)(s.a.mark(function G(){var q,N,ue;return s.a.wrap(function(Te){for(;;)switch(Te.prev=Te.next){case 0:if(q=Ae.map(function(Be){return Be.score}),N=q.reduce(function(Be,ke){return Be+ke},0),!(N!==100&&Ae!==null&&Ae!==void 0&&Ae.length)){Te.next=5;break}return M.b.info("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Te.abrupt("return");case 5:if(Ae.every(function(Be){return Be.name})){Te.next=8;break}return M.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u540D\u79F0"),Te.abrupt("return");case 8:if(Ae.every(function(Be){return Be.contents})){Te.next=11;break}return M.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u5185\u5BB9"),Te.abrupt("return");case 11:return Te.next=13,Object(D.Nb)({id:U.params.id,challengeId:U.params.challengesId,challenge_answer:Ae});case 13:ue=Te.sent,ue!=null&&ue.message&&M.b.info(ue.message),ue.status===1&&m.d.push("/shixuns/".concat(U.params.id,"/challenges/").concat(U.params.challengesId,"/tab=4"));case 16:case"end":return Te.stop()}},G)}));return function(){return L.apply(this,arguments)}}();return y.a.createElement("section",{className:c.a.bg},y.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 "},y.a.createElement(l.a,{data:Ee,title:"\u5B9E\u8DF5\u9898"})),y.a.createElement(a.a,{activeIndex:2}),y.a.createElement("div",{className:c.a.fieldWrap},y.a.createElement("p",{className:"font14"},"\u53EF\u4EE5\u5C06\u53C2\u8003\u7B54\u6848\u5206\u7EA7\u8BBE\u7F6E\uFF0C\u8BA9\u5B66\u5458\u81EA\u884C\u9009\u62E9\u7EA7\u522B\uFF0C\u6BCF\u7EA7\u67E5\u770B\u540E\u6309\u7167\u6BD4\u4F8B\u6263\u5206\u503C\uFF08\u5B66\u5458\u5DF2\u5B8C\u6210\u4EFB\u52A1\u518D\u67E5\u770B\uFF0C\u5219\u4E0D\u5F71\u54CD\u5B66\u5458\u5DF2\u83B7\u5F97\u7684\u6210\u7EE9\uFF09"),y.a.createElement("div",null,y.a.createElement("div",null,"\u793A\u4F8B\uFF1A\u7EA7\u522B1\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD425%\uFF1B\u7EA7\u522B2\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD435%\uFF1B\u7EA7\u522B3\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD440%\uFF1B"),y.a.createElement("div",{className:"mt5 ml40"},"\u82E5\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7EA7\u522B1\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF25%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B2\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF60%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B3\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF100%\u7684\u5206\u503C\u3002")),Ae==null?void 0:Ae.map(function(L,G){return y.a.createElement("div",{className:"mt30"},y.a.createElement("div",{className:c.a.flexRow},y.a.createElement("div",{className:"font16"},"\u7EA7\u522B\uFF1A",G+1),y.a.createElement("div",{className:"tr flex1"},y.a.createElement(F.a,{placement:"bottom",title:"\u5220\u9664"},y.a.createElement("i",{className:"iconfont icon-shanchu_Hover font16 c-red current",onClick:function(){we(Ae.filter(function(N,ue){return ue!==G}))}})))),y.a.createElement("div",{className:c.a.contentWrap},y.a.createElement("div",{className:c.a.flexRow},y.a.createElement("div",null,y.a.createElement("p",{className:"font16"},"\u540D\u79F0\uFF1A"),y.a.createElement(A.a,{style:{width:"200px"},value:L.name,onChange:function(N){var ue=Ae.map(function(be,Te){return Te===G?Object(R.a)(Object(R.a)({},be),{},{name:N.target.value}):be});we(ue)}})),y.a.createElement("div",{className:"ml10"},y.a.createElement("p",{className:"font16"},"\u6263\u51CF\u5206\u503C\u5360\u6BD4\uFF1A"),y.a.createElement(_.a,{style:{width:"200px"},value:L.score,onChange:function(N){var ue=Ae.map(function(be,Te){return Te===G?Object(R.a)(Object(R.a)({},be),{},{score:N}):be});we(ue)}})," ","%"))),y.a.createElement("div",{className:"mt10 mb10"},y.a.createElement("div",{className:"font16 mb10"},"\u5185\u5BB9\uFF1A"),y.a.createElement(p.a,{defaultValue:L.contents,onChange:function(N){var ue=Ae.map(function(be,Te){return Te===G?Object(R.a)(Object(R.a)({},be),{},{contents:N}):be});we(ue)}})))}),y.a.createElement("div",{className:"tc"},y.a.createElement(Y.a,{type:"primary",ghost:!0,className:"mt10",onClick:function(){we([].concat(Object(k.a)(Ae),[{name:"\u89E3\u9898\u601D\u8DEF".concat(Ae.length+1),contents:"",score:10,id:null,level:null}]))}},"\u65B0\u589E\u53C2\u8003\u7B54\u6848"))),y.a.createElement(d.a,{onOk:T,onCancel:function(){return m.d.push("/shixuns/".concat(U.params.id,"/challenges"))}}))};Re.default=Object(m.a)(function(P){var H=P.shixunsDetail,Q=P.newCourse,re=P.loading,z=P.globalSetting;return{shixunsDetail:H,newCourse:Q,globalSetting:z,loading:re.effects}})(E)},"7Cbv":function(Pe,Re,$){"use strict";var he=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function k(){if(!he)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return he(Y)}var V=/^(?:[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 _(I){return typeof I=="string"&&V.test(I)}for(var R=_,W=[],F=0;F<256;++F)W.push((F+256).toString(16).substr(1));function O(I){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(W[I[w+0]]+W[I[w+1]]+W[I[w+2]]+W[I[w+3]]+"-"+W[I[w+4]]+W[I[w+5]]+"-"+W[I[w+6]]+W[I[w+7]]+"-"+W[I[w+8]]+W[I[w+9]]+"-"+W[I[w+10]]+W[I[w+11]]+W[I[w+12]]+W[I[w+13]]+W[I[w+14]]+W[I[w+15]]).toLowerCase();if(!R(A))throw TypeError("Stringified UUID is invalid");return A}var M=O;function g(I,w,A){I=I||{};var C=I.random||(I.rng||k)();if(C[6]=C[6]&15|64,C[8]=C[8]&63|128,w){A=A||0;for(var h=0;h<16;++h)w[A+h]=C[h];return w}return M(C)}var S=Re.a=g},"7ZXX":function(Pe,Re,$){Pe.exports=$.p+"static/err.6e7c5817.png"},"7ahc":function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return y});var he=$("k1fw"),Y=$("0Owb"),k=$("+L6B"),V=$("2/Rp"),_=$("y8nQ"),R=$("Vl3Y"),W=$("tJVT"),F=$("OaEy"),O=$("2fM7"),M=$("q1tI"),g=$.n(M),S=$("VrN/"),I=$.n(S),w=$("p77/"),A=$.n(w),C=$("c5Ni"),h=$.n(C),o=O.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},u={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"]};Re.b=function(m){var p=m.callback,D=m.onCancel,b=Object(M.useState)("python"),c=Object(W.a)(b,2),d=c[0],l=c[1];function a(f){l(u[f][1])}function v(f){p(f)}return g.a.createElement(R.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:v}),g.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(O.a,{onChange:a},Object.keys(u).map(function(f){return g.a.createElement(o,{key:f,value:f},u[f][0])}))),g.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(y,{mode:d})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(V.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function y(m){var p=m.value,D=m.onChange,b=m.mode,c=m.options,d=c===void 0?{}:c,l=Object(M.useRef)(),a=Object(M.useState)(),v=Object(W.a)(a,2),f=v[0],E=v[1];return Object(M.useEffect)(function(){if(f){function P(H){var Q=H.getValue();D&&D(Q)}return f.on("change",P),function(){f.off("change",P)}}},[f,D]),Object(M.useEffect)(function(){f&&f.setOption("mode",b)},[f,b]),Object(M.useEffect)(function(){f&&((p!==f.getValue()||p==="")&&setTimeout(function(){f.setValue(p||" ")},300))},[f,p]),Object(M.useEffect)(function(){if(l.current&&!f){var P=I.a.fromTextArea(l.current,Object(he.a)({mode:b,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},d));E(P)}},[l.current,f]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:l}))}},"7ixt":function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return k});var he={adjustX:1,adjustY:1},Y=[0,0],k={left:{points:["cr","cl"],overflow:he,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:he,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:he,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:he,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:he,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:he,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:he,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:he,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:he,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:he,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:he,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:he,offset:[-4,0],targetOffset:Y}},V=k},"7v3h":function(Pe,Re,$){Pe.exports=$.p+"static/empty2.dd73f390.png"},"8/bI":function(Pe,Re,$){Pe.exports=$.p+"static/empty.8918e228.png"},"8EBN":function(Pe,Re,$){(function(he){he($("VrN/"))})(function(he){"use strict";he.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 Y=0;Y<he.modeInfo.length;Y++){var k=he.modeInfo[Y];k.mimes&&(k.mime=k.mimes[0])}he.findModeByMIME=function(V){V=V.toLowerCase();for(var _=0;_<he.modeInfo.length;_++){var R=he.modeInfo[_];if(R.mime==V)return R;if(R.mimes){for(var W=0;W<R.mimes.length;W++)if(R.mimes[W]==V)return R}}if(/\+xml$/.test(V))return he.findModeByMIME("application/xml");if(/\+json$/.test(V))return he.findModeByMIME("application/json")},he.findModeByExtension=function(V){V=V.toLowerCase();for(var _=0;_<he.modeInfo.length;_++){var R=he.modeInfo[_];if(R.ext){for(var W=0;W<R.ext.length;W++)if(R.ext[W]==V)return R}}},he.findModeByFileName=function(V){for(var _=0;_<he.modeInfo.length;_++){var R=he.modeInfo[_];if(R.file&&R.file.test(V))return R}var W=V.lastIndexOf("."),F=W>-1&&V.substring(W+1,V.length);if(F)return he.findModeByExtension(F)},he.findModeByName=function(V){V=V.toLowerCase();for(var _=0;_<he.modeInfo.length;_++){var R=he.modeInfo[_];if(R.name.toLowerCase()==V)return R;if(R.alias){for(var W=0;W<R.alias.length;W++)if(R.alias[W].toLowerCase()==V)return R}}}})},"8hTe":function(Pe,Re,$){Pe.exports={button:"button___1wy9m"}},"9Bee":function(Pe,Re,$){"use strict";var he=$("DYRE"),Y=$("zeV3"),k=$("+L6B"),V=$("2/Rp"),_=$("k1fw"),R=$("9og8"),W=$("tJVT"),F=$("WmNS"),O=$.n(F),M=$("q1tI"),g=$.n(M),S=$("vg9a"),I=$("DlQD"),w=$.n(I),A=$("rUJ1");function C(oe,Z){var J=oe.match(/^(\s+)(?:```)/);if(J===null)return Z;var ne=J[1];return Z.split(`
`).map(function(se){var ee=se.match(/^\s+/);if(ee===null)return se;var ie=Object(W.a)(ee,1),le=ie[0];return le.length>=ne.length?se.slice(ne.length):se}).join(`
`)}var h=[],o=["<ul>"],s=new w.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function y(){h.length=0,o=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function p(oe,Z,J,ne){if(Z>=oe.length||oe[Z].level<=J)return Z;var se=oe[Z];ne.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),Z++;var ee=[];return Z=p(oe,Z,se.level,ee),ee.length>0&&(ne.push("<ul>"),ee.forEach(function(ie){ne.push(ie)}),ne.push("</ul>")),ne.push("</li>"),Z=p(oe,Z,J,ne),Z}function D(){return p(h,0,0,o),o.push("</ul>"),o.join("")}var b={heading:function(Z){var J=u.exec(Z);if(J)return{type:"heading",raw:J[0],depth:J[1].length,text:J[2]}},fences:function(Z){var J=this.rules.block.fences.exec(Z);if(J){var ne=J[0],se=C(ne,J[3]||""),ee=J[2]?J[2].trim():J[2];if(["latex","katex","math"].indexOf(ee)>=0){var ie=l(),le=se;se=ie,a[ie]={type:"block",expression:le}}return{type:"code",raw:ne,lang:ee,text:se}}}},c=/(?:\${2})([^\n`]+?)(?:\${2})/gi,d=0,l=function(){return"__special_katext_id_".concat(d++,"__")},a={};function v(){return a}function f(){d=0,a={}}function E(oe){return oe=oe.replace(c,function(Z,J){var ne=l();return a[ne]={type:"inline",expression:J},ne}),oe}var P=s.listitem;s.listitem=function(oe){return P(E(oe))};var H=s.paragraph;s.paragraph=function(oe){return H(E(oe))};var Q=s.tablecell;s.tablecell=function(oe,Z){return Q(E(oe),Z)},s.code=function(oe,Z,J){var ne=(Z||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?"<p class='editormd-tex'>".concat(oe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Z,'">').concat(J?oe:Object(A.escape)(oe,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(J?oe:Object(A.escape)(oe,!0))+"</code></pre>"},s.heading=function(oe,Z,J){var ne=this.options.headerPrefix+J.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:ne,level:Z,text:oe}),"<h"+Z+' id="'+ne+'">'+oe+"</h"+Z+">"},w.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),w.a.use({tokenizer:b,renderer:s});var re=w.a,z=$("SJMd"),U=$("ulZh"),ae=$.n(U),fe=$("m3rI"),ge=$("Oy/b"),Ee=$("p5ED"),Ne=$("ErOA"),Se=$("STEk");/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ie=function(oe,Z){return(Ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,ne){J.__proto__=ne}||function(J,ne){for(var se in ne)Object.prototype.hasOwnProperty.call(ne,se)&&(J[se]=ne[se])})(oe,Z)};function Ae(oe,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");function J(){this.constructor=oe}Ie(oe,Z),oe.prototype=Z===null?Object.create(Z):(J.prototype=Z.prototype,new J)}function we(oe,Z,J,ne){return new(J||(J=Promise))(function(se,ee){function ie(me){try{de(ne.next(me))}catch(ye){ee(ye)}}function le(me){try{de(ne.throw(me))}catch(ye){ee(ye)}}function de(me){var ye;me.done?se(me.value):(ye=me.value,ye instanceof J?ye:new J(function(Le){Le(ye)})).then(ie,le)}de((ne=ne.apply(oe,Z||[])).next())})}function ve(oe,Z){var J,ne,se,ee,ie={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return ee={next:le(0),throw:le(1),return:le(2)},typeof Symbol=="function"&&(ee[Symbol.iterator]=function(){return this}),ee;function le(de){return function(me){return function(ye){if(J)throw new TypeError("Generator is already executing.");for(;ie;)try{if(J=1,ne&&(se=2&ye[0]?ne.return:ye[0]?ne.throw||((se=ne.return)&&se.call(ne),0):ne.next)&&!(se=se.call(ne,ye[1])).done)return se;switch(ne=0,se&&(ye=[2&ye[0],se.value]),ye[0]){case 0:case 1:se=ye;break;case 4:return ie.label++,{value:ye[1],done:!1};case 5:ie.label++,ne=ye[1],ye=[0];continue;case 7:ye=ie.ops.pop(),ie.trys.pop();continue;default:if(!(se=ie.trys,(se=se.length>0&&se[se.length-1])||ye[0]!==6&&ye[0]!==2)){ie=0;continue}if(ye[0]===3&&(!se||ye[1]>se[0]&&ye[1]<se[3])){ie.label=ye[1];break}if(ye[0]===6&&ie.label<se[1]){ie.label=se[1],se=ye;break}if(se&&ie.label<se[2]){ie.label=se[2],ie.ops.push(ye);break}se[2]&&ie.ops.pop(),ie.trys.pop();continue}ye=Z.call(oe,ie)}catch(Le){ye=[6,Le],ne=0}finally{J=se=0}if(5&ye[0])throw ye[1];return{value:ye[0]?ye[1]:void 0,done:!0}}([de,me])}}}var j=function(){function oe(){}return oe.addKey=function(Z){oe.key=Z},Object.defineProperty(oe,"isLicensed",{get:function(){return!!oe.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(oe.key)},enumerable:!1,configurable:!0}),oe}(),T=function(){function oe(){}return oe.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},oe.setAttributes=function(Z,J){for(var ne=0,se=J;ne<se.length;ne++){var ee=se[ne],ie=ee[0],le=ee[1];Z.setAttribute(ie,le)}},oe.createRect=function(Z,J,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",Z.toString()),se.setAttribute("height",J.toString()),ne&&oe.setAttributes(se,ne),se},oe.createLine=function(Z,J,ne,se,ee){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",Z.toString()),ie.setAttribute("y1",J.toString()),ie.setAttribute("x2",ne.toString()),ie.setAttribute("y2",se.toString()),ee&&oe.setAttributes(ie,ee),ie},oe.createPolygon=function(Z,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ne.setAttribute("points",Z),J&&oe.setAttributes(ne,J),ne},oe.createCircle=function(Z,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","circle");return ne.setAttribute("cx",(Z/2).toString()),ne.setAttribute("cy",(Z/2).toString()),ne.setAttribute("r",Z.toString()),J&&oe.setAttributes(ne,J),ne},oe.createEllipse=function(Z,J,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(Z/2).toString()),se.setAttribute("cy",(J/2).toString()),se.setAttribute("rx",(Z/2).toString()),se.setAttribute("ry",(J/2).toString()),ne&&oe.setAttributes(se,ne),se},oe.createGroup=function(Z){var J=document.createElementNS("http://www.w3.org/2000/svg","g");return Z&&oe.setAttributes(J,Z),J},oe.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},oe.createMarker=function(Z,J,ne,se,ee,ie,le){var de=document.createElementNS("http://www.w3.org/2000/svg","marker");return oe.setAttributes(de,[["id",Z],["orient",J],["markerWidth",ne.toString()],["markerHeight",se.toString()],["refX",ee.toString()],["refY",ie.toString()]]),de.appendChild(le),de},oe.createText=function(Z){var J=document.createElementNS("http://www.w3.org/2000/svg","text");return J.setAttribute("x","0"),J.setAttribute("y","0"),Z&&oe.setAttributes(J,Z),J},oe.createTSpan=function(Z,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ne.textContent=Z,J&&oe.setAttributes(ne,J),ne},oe.createImage=function(Z){var J=document.createElementNS("http://www.w3.org/2000/svg","image");return Z&&oe.setAttributes(J,Z),J},oe.createPoint=function(Z,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ne.x=Z,ne.y=J,ne},oe.createPath=function(Z,J){var ne=document.createElementNS("http://www.w3.org/2000/svg","path");return ne.setAttribute("d",Z),J&&oe.setAttributes(ne,J),ne},oe.createElement=function(Z,J){var ne=document.createElementNS("http://www.w3.org/2000/svg",Z);return J&&oe.setAttributes(ne,J),ne},oe.getHollowRectanglePath=function(Z,J,ne,se,ee,ie,le,de){return"M"+Z+","+J+"V"+(J+se)+"H"+(Z+ne)+"V"+J+"H"+ee+"V"+ie+"H"+(ee+le)+"V"+(ie+de)+"H"+ee+"V"+J+"Z"},oe}(),L=function(){function oe(Z){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Z+"_"}return Object.defineProperty(oe.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),oe.prototype.addClass=function(Z){return this.styleSheet===void 0&&this.addStyleSheet(),Z.name=""+this.classNamePrefix+Z.localName,this.classes.push(Z),this.styleSheet.sheet.insertRule("."+Z.name+" {"+Z.style+"}",this.styleSheet.sheet.cssRules.length),Z},oe.prototype.addRule=function(Z){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Z),this.styleSheet.sheet.insertRule(Z.selector+" {"+Z.style+"}",this.styleSheet.sheet.cssRules.length)},oe.prototype.addStyleSheet=function(){var Z;this.styleSheet=document.createElement("style"),((Z=this.styleSheetRoot)!==null&&Z!==void 0?Z:document.head).appendChild(this.styleSheet),this.addRule(new G("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new G("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new G("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new q("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new q("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},oe.prototype.removeStyleSheet=function(){var Z;this.styleSheet&&(((Z=this.styleSheetRoot)!==null&&Z!==void 0?Z:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},oe}(),G=function(oe,Z){this.selector=oe,this.style=Z},q=function(oe,Z){this.localName=oe,this.style=Z},N=function(){function oe(){this.blocks=[],this.display=""}return oe.prototype.addButtonBlock=function(Z){Z.className=this.blockClassName,Z.buttonClassName=this.buttonClassName,Z.buttonColorsClassName=this.buttonColorsClassName,Z.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(Z)},oe.prototype.addElementBlock=function(Z){Z.className===void 0&&(Z.className=this.blockClassName),this.blocks.push(Z)},oe.prototype.getUI=function(){var Z=document.createElement("div");return Z.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,Z.style.display=this.display,this.blocks.forEach(function(J){return Z.appendChild(J.getUI())}),Z},oe}(),ue=function(){function oe(){}return oe.prototype.getUI=function(){var Z=document.createElement("div");if(Z.className=this.className,this.minWidth!==void 0&&(Z.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":Z.style.justifyContent="flex-start";break;case"center":Z.style.justifyContent="center";break;case"end":Z.style.justifyContent="flex-end"}return Z.style.whiteSpace="nowrap",Z},oe}(),be=function(oe){function Z(){var J=oe!==null&&oe.apply(this,arguments)||this;return J.buttons=[],J}return Ae(Z,oe),Z.prototype.addButton=function(J){J.className=this.buttonClassName,J.colorsClassName=this.buttonColorsClassName,J.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(J)},Z.prototype.getUI=function(){var J=oe.prototype.getUI.call(this);return this.buttons.forEach(function(ne){return J.appendChild(ne.getUI())}),J},Z}(ue),Te=function(){function oe(Z,J){this._isActive=!1,this._isHidden=!1,this._icon=Z,this.title=J,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(oe.prototype,"icon",{get:function(){return this._icon},set:function(Z){this._icon=Z,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isActive",{get:function(){return this._isActive},set:function(Z){this._isActive=Z,this.adjustClassName()},enumerable:!1,configurable:!0}),oe.prototype.getUI=function(){var Z=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return Z.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},oe.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},oe.prototype.hide=function(){this._isHidden=!0},oe}(),Be=function(oe){function Z(){var J=oe!==null&&oe.apply(this,arguments)||this;return J.elements=[],J}return Ae(Z,oe),Z.prototype.addElement=function(J){this.elements.push(J)},Z.prototype.getUI=function(){var J=oe.prototype.getUI.call(this);return this.elements.forEach(function(ne){return J.appendChild(ne)}),J},Z}(ue),ke=function(){function oe(Z,J){this.horizontal=Z,this.vertical=J}return Object.defineProperty(oe.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),oe.prototype.getVerticalLength=function(Z){return Z/this.ratio},oe.prototype.getHorizontalLength=function(Z){return Z*this.ratio},oe}(),Oe=function(){function oe(){}return oe.getIcon=function(Z,J){if(Z>0&&J>0){var ne=new ke(Z,J),se=ne.ratio>=1?20:ne.getHorizontalLength(20),ee=ne.ratio<1?20:ne.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var le=T.createDefs();ie.appendChild(le);var de=T.createElement("clipPath",[["id","text-bg-clip"]]);le.appendChild(de);var me=T.createPath(T.getHollowRectanglePath((24-se)/2,(24-ee)/2,se,ee,(24-se)/2+2,(24-ee)/2+2,se-4,ee-4));ie.appendChild(me);var ye=T.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ye.appendChild(T.createTSpan(Z+":"+J)),ie.appendChild(ye);var Le=ye.getBBox();T.setAttributes(ye,[["x",((24-Le.width)/2).toString()],["y",((24-Le.height)/2-Le.y).toString()]]);var He=T.createPath(T.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Le.width))/2,(24-Math.ceil(Le.height))/2,Math.ceil(Le.width),Math.ceil(Le.height)));return de.appendChild(He),T.setAttributes(me,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},oe}(),_e=function(oe){function Z(J,ne,se){var ee=oe.call(this,J,ne)||this;return ee.isDropdownOpen=!1,ee.onClick=ee.dropdownButtonClicked,ee.dropdownButtons=se,ee}return Ae(Z,oe),Z.prototype.setupDropdown=function(){var J=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ne){ne.className=J.className,ne.colorsClassName=J.colorsClassName,J.dropdownBlock.appendChild(ne.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},Z.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},Z.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},Z.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},Z.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},Z.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},Z}(Te),Ge=function(){function oe(Z,J){this.GRIP_SIZE=10,this.color=Z,this.fillColor=J,this.visual=T.createGroup(),this.visual.appendChild(T.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(T.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return oe.prototype.ownsTarget=function(Z){return Z===this.visual||Z===this.visual.childNodes[0]||Z===this.visual.childNodes[1]},oe.prototype.setCenter=function(Z,J){this.visual.childNodes.forEach(function(ne){return T.setAttributes(ne,[["cx",Z.toString()],["cy",J.toString()]])})},oe}(),Ve=function(){function oe(Z,J,ne,se){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=Z,this.canvasHeight=J,this.margin=ne,this.container=se,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(oe.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(Z){this._aspectRatio=Z,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Z){this._isGridVisible=Z,this.gridContainer&&T.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(Z){this._zoomFactor=Z,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),oe.prototype.open=function(){var Z=this;this.cropShadeElement=T.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=T.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var J=0;J<this.numberOfGridLines;J++)this.horizontalGridLines.push(T.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(T.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ne){return Z.gridContainer.appendChild(ne)}),this.verticalGridLines.forEach(function(ne){return Z.gridContainer.appendChild(ne)}),this.cropRectElement=T.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ge(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},oe.prototype.setCropRectangle=function(Z){this.cropRect=Z;var J=Object.assign({},this.cropRect);this.zoomFactor!==1&&(J.width=this.cropRect.width*this.zoomFactor,J.height=this.cropRect.height*this.zoomFactor,J.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-J.width/2,J.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-J.height/2),T.setAttributes(this.cropRectElement,[["x",J.x.toString()],["y",J.y.toString()],["width",J.width.toString()],["height",J.height.toString()]]);var ne=J.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ee,ie){var le=J.y+ne*(ie+1);T.setAttributes(ee,[["x1",""+J.x],["y1",""+le],["x2",""+(J.x+J.width)],["y2",""+le]])});var se=J.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ee,ie){var le=J.x+se*(ie+1);T.setAttributes(ee,[["x1",""+le],["y1",""+J.y],["x2",""+le],["y2",""+(J.y+J.height)]])}),T.setAttributes(this.cropShadeElement,[["d",T.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,J.x,J.y,J.width,J.height)]]),this.topLeftGrip.setCenter(J.x,J.y),this.topRightGrip.setCenter(J.x+J.width,J.y),this.bottomLeftGrip.setCenter(J.x,J.y+J.height),this.bottomRightGrip.setCenter(J.x+J.width,J.y+J.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},oe.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},oe.prototype.clientToLocalCoordinates=function(Z,J){var ne=this.container.getBoundingClientRect();return{x:Z-ne.left+this.margin,y:J-ne.top+this.margin}},oe.prototype.onPointerDown=function(Z){this.container.setPointerCapture(Z.pointerId),this.previousPoint=this.clientToLocalCoordinates(Z.clientX,Z.clientY),this.cropRectElement===Z.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(Z.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(Z.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(Z.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(Z.target)&&(this.activeGrip=this.bottomRightGrip)},oe.prototype.onPointerMove=function(Z){if(this.isMoving)this.move(this.clientToLocalCoordinates(Z.clientX,Z.clientY));else if(this.activeGrip){var J=this.clientToLocalCoordinates(Z.clientX,Z.clientY);this.resize(J)}Z.preventDefault()},oe.prototype.onPointerUp=function(Z){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(Z.pointerId)},oe.prototype.move=function(Z){var J=Z.x-this.previousPoint.x,ne=Z.y-this.previousPoint.y;this.zoomFactor!==1&&(J=-J/this.zoomFactor,ne=-ne/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+J),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ne),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=Z},oe.prototype.resize=function(Z){var J=Object.assign({},this.cropRect),ne=Z.x-this.previousPoint.x,se=Z.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:J.x+ne<this.margin&&(ne=this.margin-J.x),J.x+=ne,J.width=this.cropRect.x+this.cropRect.width-J.x;break;case this.bottomRightGrip:case this.topRightGrip:J.width+ne>this.canvasWidth*this.zoomFactor&&(ne=this.canvasWidth*this.zoomFactor-J.width),J.width+=ne}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(J.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ne),J.height=this.aspectRatio.getVerticalLength(J.width)):(J.y+=se,J.height=this.cropRect.y+this.cropRect.height-J.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?J.height=this.aspectRatio.getVerticalLength(J.width):J.height+=se}J.width<10&&(J.x=this.cropRect.x,J.width=10),J.height<10&&(J.y=this.cropRect.y,J.height=10),this.previousPoint=Z,J.x>=this.margin&&J.y>=this.margin&&J.x-this.margin+J.width<=this.canvasWidth&&J.y-this.margin+J.height<=this.canvasHeight&&(this.cropRect=J,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},oe.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var Z=this.cropRect.x+this.cropRect.width/2,J=this.cropRect.y+this.cropRect.height/2,ne=this.aspectRatio.getHorizontalLength(this.cropRect.height),se=this.aspectRatio.getVerticalLength(this.cropRect.width);ne/this.canvasWidth<se/this.canvasHeight?this.cropRect.width=ne:this.cropRect.height=se,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=Z-this.cropRect.width/2,this.cropRect.y=J-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},oe.prototype.getRescaledRect=function(Z,J,ne,se,ee,ie){var le=ne/Z,de=se/J;return{x:(ee.x-ie)*le+ie,y:(ee.y-ie)*de+ie,width:ee.width*le,height:ee.height*de}},oe.prototype.scaleCanvas=function(Z,J){var ne=this.getRescaledRect(this.canvasWidth,this.canvasHeight,Z,J,this.cropRect,this.margin);this.canvasWidth=Z,this.canvasHeight=J,this.onCropChange&&this.onCropChange(ne),this.setCropRectangle(ne)},oe}(),Qe=function(){function oe(Z){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=Z,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(oe.prototype,"angle",{get:function(){return this._angle},set:function(Z){this._angle=Z,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),oe.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},oe.prototype.onPointerDown=function(Z){this.controlContainer.setPointerCapture(Z.pointerId),this.isDragging=!0,this.previousPoint={x:Z.clientX,y:Z.clientY}},oe.prototype.onPointerMove=function(Z){this.isDragging&&(this.onAngleChange&&this.onAngleChange((Z.clientX-this.previousPoint.x)/5),this.previousPoint.x=Z.clientX)},oe.prototype.onPointerUp=function(Z){this.isDragging&&this.onAngleChange&&this.onAngleChange((Z.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(Z.pointerId)},oe.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var Z=this.angleLabelText.getBBox();T.setAttributes(this.angleLabelElement,[["x",((this.width-Z.width)/2).toString()],["y",(this.height/2).toString()]])}},oe.prototype.positionScaleShape=function(){if(this.scaleShape){var Z=this.scaleShape.transform.baseVal.getItem(0);Z.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(Z,0)}},oe.prototype.getVisual=function(){var Z=document.createElementNS("http://www.w3.org/2000/svg","svg");Z.setAttribute("xmlns","http://www.w3.org/2000/svg"),Z.setAttribute("width",this.width+"px"),Z.setAttribute("height",this.height+"px"),Z.setAttribute("viewBox","0 0 "+this.width+" "+this.height),Z.style.flexShrink="0",document.body.appendChild(Z);for(var J="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ne=1;ne<=this.width/5+10;ne++){var se=ne%5==0?this.height/3:this.height/6;J+="h4v"+-se+"h1v"+se}J+="v1H0Z",this.scaleShape=T.createPath(J);var ee=T.createTransform();this.scaleShape.transform.baseVal.appendItem(ee),Z.appendChild(this.scaleShape),this.angleLabelElement=T.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=T.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=T.createTSpan("");return ie.innerHTML="&deg;",this.angleLabelElement.appendChild(ie),Z.appendChild(this.angleLabelElement),document.body.removeChild(Z),Z},oe}(),Ye=function(){function oe(){this.naturalSize=!1,this.imageType="image/png"}return oe.prototype.rasterize=function(Z,J,ne,se,ee,ie,le){var de=this;return new Promise(function(me){var ye=document.createElement("canvas");ye.width=Z.width.baseVal.value-2*se,ye.height=Z.height.baseVal.value-2*se;var Le=1,He=1;de.naturalSize===!0?(Le=J.naturalWidth/(Z.width.baseVal.value-2*se)/ie,He=J.naturalHeight/(Z.height.baseVal.value-2*se)/le,ye.width=J.naturalWidth/ie,ye.height=J.naturalHeight/le):de.width!==void 0&&de.height!==void 0&&(Le=de.width/ne.width,He=de.height/ne.height,ye.width*=Le,ye.height*=He);var et=ye.getContext("2d");et.translate(ye.width/2,ye.height/2),et.rotate(ee*Math.PI/180),et.scale(ie,le),et.translate(-ye.width/2,-ye.height/2),et.drawImage(J,0,0,ye.width,ye.height);var rt=document.createElement("canvas");rt.width=ne.width*Le,rt.height=ne.height*He,rt.getContext("2d").putImageData(et.getImageData((ne.x-se)*Le,(ne.y-se)*He,ne.width*Le,ne.height*He),0,0),me(rt.toDataURL(de.imageType,de.imageQuality))})},oe}(),ot=function(){function oe(Z){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=oe.instanceCounter++,this.styles=new L(this.instanceNo),this.target=Z,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(oe.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(Z){this._zoomToCropEnabled=Z,Z?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Z){this._isGridVisible=Z,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"gridLines",{get:function(){return this._gridLines},set:function(Z){this._gridLines=Z,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(Z){this._rotationAngle=Z,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"aspectRatio",{get:function(){var Z;return(Z=this._aspectRatio)!==null&&Z!==void 0?Z:this.aspectRatios[0]},set:function(Z){this._aspectRatio=Z},enumerable:!1,configurable:!0}),oe.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},oe.prototype.show=function(){this.showUI(),this.open()},oe.prototype.close=function(Z){Z===void 0&&(Z=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),Z||this.closeEventListeners.forEach(function(J){return J()}),this._isOpen=!1)},oe.prototype.addRenderEventListener=function(Z){this.renderEventListeners.push(Z)},oe.prototype.removeRenderEventListener=function(Z){this.renderEventListeners.indexOf(Z)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(Z),1)},oe.prototype.addCloseEventListener=function(Z){this.closeEventListeners.push(Z)},oe.prototype.removeCloseEventListener=function(Z){this.closeEventListeners.indexOf(Z)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(Z),1)},oe.prototype.setupResizeObserver=function(){var Z=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Z.resize(Z.target.clientWidth,Z.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},oe.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var Z=1*this.target.clientWidth/this.target.clientHeight,J=this.contentDiv.clientWidth/Z>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*Z:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ne=J+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/Z;this.resize(J,ne)}},oe.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},oe.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",T.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},oe.prototype.resize=function(Z,J){this.imageWidth=Math.round(Z),this.imageHeight=Math.round(J),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},oe.prototype.setEditingTarget=function(){var Z=document.createElement("canvas");Z.width=this.target.naturalWidth,Z.height=this.target.naturalHeight,Z.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var J=Z.toDataURL();T.setAttributes(this.editingTarget,[["href",J]]),this.setEditingTargetSize()},oe.prototype.setTopLeft=function(){var Z=this.target.getBoundingClientRect(),J=this.editorCanvas.getBoundingClientRect();this.left=Z.left-J.left-this.CANVAS_MARGIN,this.top=Z.top-J.top-this.CANVAS_MARGIN},oe.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=T.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=T.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=T.createGroup(),this.editingTargetRotationScaleContainer=T.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var Z=T.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(Z);var J=T.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(J),this.editingTargetContainer=T.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},oe.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},oe.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=T.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ve(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},oe.prototype.zoomToCrop=function(){if(this.cropRect){var Z=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,J=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=Z+"px "+J+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-Z+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-J+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},oe.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},oe.prototype.cropRectChanged=function(Z){this.cropRect=Z,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},oe.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},oe.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},oe.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},oe.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var Z=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,J=this.target.offsetTop>Z+this.CANVAS_MARGIN?this.target.offsetTop-(Z+this.CANVAS_MARGIN):0;this.coverDiv.style.top=J+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},oe.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},oe.prototype.addTopToolbar=function(){var Z=this;this.topToolbar=new N,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var J=new be;J.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(J);var ne=[];this.aspectRatios.forEach(function(He){var et=new Te(Oe.getIcon(He.horizontal,He.vertical),He.horizontal===0&&He.vertical===0?"FREE":He.horizontal+":"+He.vertical);et.onClick=function(){return Z.ratioButtonClicked(He)},ne.push(et)}),this.aspectRatioButton=new _e(Oe.getIcon(0,0),"Aspect ratio",ne),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,J.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var se=new Te('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");se.isActive=this.isGridVisible,se.onClick=function(){Z.isGridVisible=!Z.isGridVisible,se.isActive=Z.isGridVisible},J.addButton(se);var ee=new Te('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(ee.isActive=this.zoomToCropEnabled,ee.onClick=function(){Z.zoomToCropEnabled=!Z.zoomToCropEnabled,ee.isActive=Z.zoomToCropEnabled},J.addButton(ee),!j.isLicensed){var ie=new Be;this.topToolbar.addElementBlock(ie);var le=document.createElement("div");le.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var de=document.createElement("a");de.style.color="currentColor",de.href="https://markerjs.com/products/cropro",de.target="_blank",de.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',le.appendChild(de),ie.addElement(le)}var me=new be;me.minWidth=3*this.toolbarHeight+"px",me.contentAlign="end",this.topToolbar.addButtonBlock(me);var ye=new Te('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ye.onClick=this.startRenderAndClose,me.addButton(ye),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ye.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Le=new Te('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Le.onClick=this.close,me.addButton(Le),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Le.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},oe.prototype.addBottomToolbar=function(){var Z=this;this.bottomToolbar=new N,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var J=new be;J.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(J);var ne=new Te('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ne.onClick=this.rotateLeftButtonClicked,J.addButton(ne);var se=new Te('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");se.onClick=this.rotateRightButtonClicked,J.addButton(se);var ee=new Be;ee.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ee),this.straightener=new Qe("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(me){Z.rotateBy(me),Z.straightener.angle=Z.rotationAngle},ee.addElement(this.straightener.getUI());var ie=new be;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var le=new Te('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");le.onClick=this.flipHorizontallyButtonClicked,ie.addButton(le);var de=new Te('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");de.onClick=this.flipVerticallyButtonClicked,ie.addButton(de)},oe.prototype.ratioButtonClicked=function(Z){this.aspectRatio=Z,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},oe.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Oe.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},oe.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ke(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},oe.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},oe.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},oe.prototype.restoreState=function(Z){if(Z){var J=this.cropLayer.getRescaledRect(Z.width,Z.height,this.imageWidth,this.imageHeight,Z.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(J),this.cropRectChanged(J),this.flippedHorizontally=Z.flippedHorizontally,this.flippedVertically=Z.flippedVertically,this.applyFlip(),this.rotationAngle=Z.rotationAngle,this.applyRotation()}},oe.prototype.clientToLocalCoordinates=function(Z,J){var ne=this.cropImage.getBoundingClientRect();return{x:Z-ne.left,y:J-ne.top}},oe.prototype.onWindowResize=function(){this.positionUI()},oe.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var Z=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=Z+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},oe.prototype.rotateLeftButtonClicked=function(){var Z=this.rotationAngle-90;this.rotationAngle%90!=0&&(Z+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(Z)},oe.prototype.rotateRightButtonClicked=function(){var Z=this.rotationAngle+90;this.rotationAngle%90!=0&&(Z-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(Z)},oe.prototype.rotateTo=function(Z){Z=(Z=Z>180?Z-360:Z)<=-180?Z+360:Z,this.rotationAngle=Z,this.applyRotation()},oe.prototype.rotateBy=function(Z){this.rotateTo((this.rotationAngle+Z)%360)},oe.prototype.applyRotation=function(){var Z=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var J=this.editingTargetRotationContainer.transform.baseVal.getItem(0);J.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(J,0);var ne=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ne.width,this.imageHeight/ne.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=Z},oe.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},oe.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},oe.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},oe.prototype.startRenderAndClose=function(){return we(this,void 0,void 0,function(){var Z,J;return ve(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return Z=ne.sent(),J=this.getState(),this.renderEventListeners.forEach(function(se){return se(Z,J)}),this.close(!0),[2]}})})},oe.prototype.render=function(){return we(this,void 0,void 0,function(){var Z;return ve(this,function(J){switch(J.label){case 0:return(Z=new Ye).naturalSize=this.renderAtNaturalSize,Z.imageType=this.renderImageType,Z.imageQuality=this.renderImageQuality,Z.width=this.renderWidth,Z.height=this.renderHeight,this.unzoomFromCrop(),T.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,Z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return J.sent(),[4,Z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,J.sent()]}})})},oe.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new q("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new q("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new q("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var Z=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new q("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*Z)+`px;
height: `+(this.toolbarHeight-2*Z)+`px;
padding: `+Z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new q("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new q("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new G("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new G("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new q("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new q("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new q("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new q("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*Z)+`px;
padding: `+Z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new q("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},oe.instanceCounter=0,oe}(),Xe=$("8hTe"),Ze=$.n(Xe),De=/<pre[^>]*>/g;function it(oe){var Z=document.createElement("div");return Z.innerHTML=oe,Z.childNodes.length===0?"":Z.childNodes[0].nodeValue}var $e=Re.a=function(oe){var Z=oe.value,J=Z===void 0?"":Z,ne=oe.edit,se=ne===void 0?!1:ne,ee=oe.className,ie=oe.showTextOnly,le=oe.showLines,de=oe.replaces,me=oe.zoomImg,ye=oe.hasMask,Le=oe.style,He=Le===void 0?{}:Le,et=oe.stylesPrev,rt=et===void 0?{}:et,vt=String(J),st=Object(M.useRef)(),nt=Object(M.useRef)(),Tt=Object(M.useState)(""),Et=Object(W.a)(Tt,2),_t=Et[0],Mt=Et[1],xt=Object(M.useState)("office"),mr=Object(W.a)(xt,2),Sr=mr[0],Yt=mr[1],gr=function(){var St=new ot(nt.current);St.displayMode="popup",St.addRenderEventListener(function(){var Jt=Object(R.a)(O.a.mark(function mt(pt){var wt;return O.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return st.current.style.display="none",Ft.next=3,Object(Ne.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt}});case 3:wt=Ft.sent,wt!=null&&wt.id&&de(nt.current.getAttribute("src").replace(fe.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 5:case"end":return Ft.stop()}},mt)}));return function(mt){return Jt.apply(this,arguments)}}()),St.show()},cr=function(){var St=new Se.a(nt.current);St.settings.displayMode="popup",St.addEventListener("render",function(){var Jt=Object(R.a)(O.a.mark(function mt(pt){var wt;return O.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:if(st.current.style.display="none",!nt.current){Ft.next=6;break}return Ft.next=4,Object(Ne.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt.dataUrl}});case 4:wt=Ft.sent,wt!=null&&wt.id&&de(nt.current.getAttribute("src").replace(fe.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 6:case"end":return Ft.stop()}},mt)}));return function(mt){return Jt.apply(this,arguments)}}()),St.show(),window.markerArea=St},zr=Object(M.useMemo)(function(){st.current&&(st.current.style.zIndex=-1);try{var Je=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,St=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Jt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;vt=vt.replace(Je,"("+fe.a.API_SERVER+"/api/attachments/").replace(St,'"'+fe.a.API_SERVER+"/api/attachments/").replace(Jt,'"'+fe.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(vr){}var mt=re(vt),pt=v();if(vt.match(/\[TOC\]/)&&(mt=mt.replace("<p>[TOC]</p>",D()),y()),mt=mt.replace(/(__special_katext_id_\d+__)/g,function(vr,Ft){var Fe=pt[Ft],dt=Fe.type,ri=Fe.expression;return Object(ge.renderToString)(it(ri)||"",{displayMode:dt==="block",throwOnError:!1,output:"html"})}),mt=mt.replace(/▁/g,"\u2581\u2581\u2581"),f(),ie){var wt=document.createElement("div");return wt.innerHTML=mt,wt.innerText}return setTimeout(function(){return ti()},500),mt},[vt]),Xt=Object(M.useRef)();m.WebkitLineClamp=le,le&&(He=Object(_.a)(Object(_.a)({},He),m));function Br(Je){var St=Je.target;if(St.tagName.toUpperCase()==="IMG"){if(me){var Jt=St.getAttribute("src");Mt(Jt),Yt("image")}}else if(St.tagName.toUpperCase()==="A"){var mt=St.getAttribute("href");if(mt.indexOf("office")>-1)Je.preventDefault(),Mt(mt),Yt("office");else if(mt.indexOf("application/pdf")>-1)Je.preventDefault(),Mt(mt),Yt("pdf");else if(mt.indexOf("text/html")>-1)Je.preventDefault(),Mt(mt),Yt("html");else if(mt.startsWith("#")){Je.preventDefault();var pt=document.getElementById(mt.replace("#",""));pt&&pt.scrollIntoView(!0)}}}var ti=function(){var St,Jt=(St=Xt.current)===null||St===void 0?void 0:St.querySelectorAll("video");Jt==null||Jt.forEach(function(mt){if(mt.oncontextmenu=function(){return!1},mt.src.indexOf(".m3u8")>-1&&!mt.canPlayType("application/vnd.apple.mpegurl")){if(ae.a.isSupported()){var pt=new ae.a;pt.loadSource(mt.src),pt.attachMedia(mt)}}})};Object(M.useEffect)(function(){if(Xt.current&&zr&&(zr.match(De)&&window.PR.prettyPrint()),Xt.current)return Xt.current.addEventListener("click",Br),function(){Xt.current.removeEventListener("click",Br),f(),y()}},[zr,Xt.current,Br]);var Ot=function(St){if(!se)return;St.target.nodeName==="IMG"?(st.current.style.zIndex=1,st.current.style.display="flex",st.current.style.width=St.target.clientWidth+"px",st.current.style.height=St.target.clientHeight+"px",st.current.style.top=St.target.offsetTop+"px",st.current.style.left=St.target.offsetLeft+"px",nt.current.src=St.target.getAttribute("src")):st.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:Xt,style:Object(_.a)({},He),className:"".concat(ee||""," markdown-body ").concat(Ze.a.mdBody),onMouseOver:Ot,dangerouslySetInnerHTML:{__html:zr}}),g.a.createElement("div",{ref:st,className:Ze.a.button},g.a.createElement(Y.a,null,g.a.createElement(V.a,{onClick:function(){return gr()}},"\u88C1\u526A"),g.a.createElement(V.a,{onClick:function(){return cr()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:nt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(Ee.a,{close:!0,data:_t,type:_t!=null&&_t.length?Sr:"",style:Object(_.a)({},rt),onClose:function(){return Mt("")}}))}},"9VGf":function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return k});var he=$("q1tI"),Y=$.n(he);function k(V,_){var R=Object(he.useRef)();Object(he.useEffect)(function(){R.current=V}),Object(he.useEffect)(function(){function W(){R.current()}if(_!==null){var F=setInterval(W,_);return function(){return clearInterval(F)}}},[_])}},"9ZNV":function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return M});var he=$("0Owb"),Y=$("+L6B"),k=$("2/Rp"),V=$("q1tI"),_=$.n(V),R=$("UUDw"),W=$.n(R),F=$("TSYQ"),O=$.n(F),M=function(S){var I=S.cancelText,w=I===void 0?"\u53D6\u6D88":I,A=S.okText,C=A===void 0?"\u786E\u5B9A":A,h=S.loading,o=h===void 0?!1:h,s=S.hasOkBtn,u=s===void 0?!0:s,y=S.okButtonProps,m=y===void 0?{}:y,p=S.onCancel,D=p===void 0?function(){}:p,b=S.onOk,c=b===void 0?function(){}:b,d=S.className,l=d===void 0?"":d;return _.a.createElement("div",{className:O()(W.a.buttonFixed,l)},_.a.createElement("div",{className:W.a.buttonWrap},_.a.createElement(k.a,{size:"large",className:"".concat(W.a.button," mr20"),onClick:D},w),u&&_.a.createElement(k.a,Object(he.a)({size:"large",type:"primary",className:"".concat(W.a.button," mr20"),loading:o,onClick:c},m),C)))}},"A/g1":function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvI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8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Pe,Re,$){(function(he){he($("VrN/"),$("osHv"))})(function(he){he.defineOption("autoCloseTags",!1,function(O,M,g){if(g!=he.Init&&g&&O.removeKeyMap("autoCloseTags"),!M)return;var S={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(S["'/'"]=function(I){return R(I)}),(typeof M!="object"||M.whenOpening!==!1)&&(S["'>'"]=function(I){return V(I)}),O.addKeyMap(S)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["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 V(O){if(O.getOption("disableInput"))return he.Pass;for(var M=O.listSelections(),g=[],S=O.getOption("autoCloseTags"),I=0;I<M.length;I++){if(!M[I].empty())return he.Pass;var w=M[I].head,A=O.getTokenAt(w),C=he.innerMode(O.getMode(),A.state),h=C.state,o=C.mode.xmlCurrentTag&&C.mode.xmlCurrentTag(h),s=o&&o.name;if(!s)return he.Pass;var u=C.mode.configuration=="html",y=typeof S=="object"&&S.dontCloseTags||u&&Y,m=typeof S=="object"&&S.indentTags||u&&k;A.end>w.ch&&(s=s.slice(0,s.length-A.end+w.ch));var p=s.toLowerCase();if(!s||A.type=="string"&&(A.end!=w.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&o.close||A.string.indexOf("/")==w.ch-A.start-1||y&&W(y,p)>-1||F(O,C.mode.xmlCurrentContext&&C.mode.xmlCurrentContext(h)||[],s,w,!0))return he.Pass;var D=typeof S=="object"&&S.emptyTags;if(D&&W(D,s)>-1){g[I]={text:"/>",newPos:he.Pos(w.line,w.ch+2)};continue}var b=m&&W(m,p)>-1;g[I]={indent:b,text:">"+(b?`
`:"")+"</"+s+">",newPos:b?he.Pos(w.line+1,0):he.Pos(w.line,w.ch+1)}}for(var c=typeof S=="object"&&S.dontIndentOnAutoClose,I=M.length-1;I>=0;I--){var d=g[I];O.replaceRange(d.text,M[I].head,M[I].anchor,"+insert");var l=O.listSelections().slice(0);l[I]={head:d.newPos,anchor:d.newPos},O.setSelections(l),!c&&d.indent&&(O.indentLine(d.newPos.line,null,!0),O.indentLine(d.newPos.line+1,null,!0))}}function _(O,M){for(var g=O.listSelections(),S=[],I=M?"/":"</",w=O.getOption("autoCloseTags"),A=typeof w=="object"&&w.dontIndentOnSlash,C=0;C<g.length;C++){if(!g[C].empty())return he.Pass;var h=g[C].head,o=O.getTokenAt(h),s=he.innerMode(O.getMode(),o.state),u=s.state;if(M&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=h.ch-1))return he.Pass;var y,m=s.mode.name!="xml"&&O.getMode().name=="htmlmixed";if(m&&s.mode.name=="javascript")y=I+"script";else if(m&&s.mode.name=="css")y=I+"style";else{var p=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(u);if(!p||p.length&&F(O,p,p[p.length-1],h))return he.Pass;y=I+p[p.length-1]}O.getLine(h.line).charAt(o.end)!=">"&&(y+=">"),S[C]=y}if(O.replaceSelections(S),g=O.listSelections(),!A)for(var C=0;C<g.length;C++)(C==g.length-1||g[C].head.line<g[C+1].head.line)&&O.indentLine(g[C].head.line)}function R(O){return O.getOption("disableInput")?he.Pass:_(O,!0)}he.commands.closeTag=function(O){return _(O)};function W(O,M){if(O.indexOf)return O.indexOf(M);for(var g=0,S=O.length;g<S;++g)if(O[g]==M)return g;return-1}function F(O,M,g,S,I){if(!he.scanForClosingTag)return!1;var w=Math.min(O.lastLine()+1,S.line+500),A=he.scanForClosingTag(O,S,null,w);if(!A||A.tag!=g)return!1;for(var C=I?1:0,h=M.length-1;h>=0&&M[h]==g;h--)++C;S=A.to;for(var h=1;h<C;h++){var o=he.scanForClosingTag(O,S,null,w);if(!o||o.tag!=g)return!1;S=o.to}return!0}})},BjJ7:function(Pe,Re,$){"use strict";$.d(Re,"d",function(){return Y}),$.d(Re,"c",function(){return k}),$.d(Re,"e",function(){return V}),$.d(Re,"b",function(){return _}),$.d(Re,"a",function(){return W});var he=$("m3rI");function Y(F){var O=!0;if(F.length>0){for(var M=0;M<F.length;M++)if(F[M].compile_success==0||!F[M].compile_success){O=!1;break}}else O=!1;return O}function k(F){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",M=[],g=0;g<F.length;g++){var S=F[g],I=O?"".concat(O,"/").concat(S.name):"".concat(S.name);M.push({title:S.name,isLeaf:!(S.type==="tree"),key:I})}return M}function V(F,O,M){for(var g=0;g<F.length;g++){var S=F[g];if(S.key===O){S.children=M;break}S.children&&V(S.children,O,M)}return F}function _(F,O,M){var g;return function(){var S=this,I=arguments,w=function(){g=null,M||F.apply(S,I)},A=M&&!g;clearTimeout(g),g=setTimeout(w,O),A&&F.apply(S,I)}}var R=!0,W=he.a.API_SERVER},"C+DQ":function(Pe,Re,$){},CJF0:function(Pe,Re,$){"use strict";var he=$("14J3"),Y=$("BMrR"),k=$("+L6B"),V=$("2/Rp"),_=$("jCWc"),R=$("kPKH"),W=$("PpiC"),F=$("q1tI"),O=$.n(F),M=$("Ty5D"),g=$("9kvl"),S=$("55Ip"),I=$("lzim"),w=$("nZ20"),A=$.n(w),C=function(o){var s,u,y,m,p=o.shixunsDetail,D=o.dispatch,b=o.loading,c=o.match,d=o.data,l=d===void 0?{}:d,a=o.title,v=Object(W.a)(o,["shixunsDetail","dispatch","loading","match","data","title"]),f=Object(M.i)(),E=!(((s=p.detail)===null||s===void 0?void 0:s.identity)>4||((u=p.detail)===null||u===void 0?void 0:u.identity)===void 0||((y=p.detail)===null||y===void 0?void 0:y.shixun_status)===2||((m=p.detail)===null||m===void 0?void 0:m.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(A.a.wrap)},O.a.createElement(Y.a,{gutter:[20,20],align:"middle"},O.a.createElement(R.a,{flex:1},O.a.createElement("span",{className:A.a.icons},O.a.createElement("img",{src:I.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",l==null?void 0:l.position," \u5173\uFF1A",a)),O.a.createElement(R.a,null,(l==null?void 0:l.prev_challenge)&&O.a.createElement(V.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,Q=l.prev_challenge.st===0?"/editcheckpoint":"/editquestion",re="/shixuns/".concat(f.id,"/challenges/").concat(l==null||((H=l.prev_challenge)===null||H===void 0)?void 0:H.id).concat(Q);g.d.replace(re)}},"\u4E0A\u4E00\u5173"),l.next_challenge&&O.a.createElement(V.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var H,Q=l.next_challenge.st===0?"/editcheckpoint":"/editquestion",re="/shixuns/".concat(f.id,"/challenges/").concat(l==null||((H=l.next_challenge)===null||H===void 0)?void 0:H.id).concat(Q);g.d.replace(re)}},"\u4E0B\u4E00\u5173"),E&&O.a.createElement(V.a,{type:"primary"},O.a.createElement(S.a,{to:"/shixuns/".concat(f.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),E&&O.a.createElement(V.a,{type:"primary",className:"ml5"},O.a.createElement(S.a,{to:"/shixuns/".concat(f.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(V.a,{type:"primary",className:"ml5"},O.a.createElement(S.a,{to:"/shixuns/".concat(f.id,"/challenges")},"\u8FD4\u56DE")))))};Re.a=Object(g.a)(function(h){var o=h.shixunsDetail,s=h.newCourse,u=h.loading,y=h.globalSetting;return{shixunsDetail:o,newCourse:s,globalSetting:y,loading:u.effects}})(C)},DlQD:function(Pe,Re,$){(function(he,Y){Pe.exports=Y()})(this,function(){"use strict";function he(J,ne){for(var se=0;se<ne.length;se++){var ee=ne[se];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(J,ee.key,ee)}}function Y(J,ne,se){return ne&&he(J.prototype,ne),se&&he(J,se),J}function k(J,ne){if(!J)return;if(typeof J=="string")return V(J,ne);var se=Object.prototype.toString.call(J).slice(8,-1);if(se==="Object"&&J.constructor&&(se=J.constructor.name),se==="Map"||se==="Set")return Array.from(J);if(se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(se))return V(J,ne)}function V(J,ne){(ne==null||ne>J.length)&&(ne=J.length);for(var se=0,ee=new Array(ne);se<ne;se++)ee[se]=J[se];return ee}function _(J,ne){var se;if(typeof Symbol=="undefined"||J[Symbol.iterator]==null){if(Array.isArray(J)||(se=k(J))||ne&&J&&typeof J.length=="number"){se&&(J=se);var ee=0;return function(){return ee>=J.length?{done:!0}:{done:!1,value:J[ee++]}}}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 se=J[Symbol.iterator](),se.next.bind(se)}function R(J,ne){return ne={exports:{}},J(ne,ne.exports),ne.exports}var W=R(function(J){function ne(){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 se(ee){J.exports.defaults=ee}J.exports={defaults:ne(),getDefaults:ne,changeDefaults:se}}),F=W.defaults,O=W.getDefaults,M=W.changeDefaults,g=/[&<>"']/,S=/[&<>"']/g,I=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,A={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},C=function(ne){return A[ne]};function h(J,ne){if(ne){if(g.test(J))return J.replace(S,C)}else if(I.test(J))return J.replace(w,C);return J}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(J){return J.replace(o,function(ne,se){return se=se.toLowerCase(),se==="colon"?":":se.charAt(0)==="#"?se.charAt(1)==="x"?String.fromCharCode(parseInt(se.substring(2),16)):String.fromCharCode(+se.substring(1)):""})}var u=/(^|[^\[])\^/g;function y(J,ne){J=J.source||J,ne=ne||"";var se={replace:function(ie,le){return le=le.source||le,le=le.replace(u,"$1"),J=J.replace(ie,le),se},getRegex:function(){return new RegExp(J,ne)}};return se}var m=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(J,ne,se){if(J){var ee;try{ee=decodeURIComponent(s(se)).replace(m,"").toLowerCase()}catch(ie){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}ne&&!p.test(se)&&(se=a(ne,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch(ie){return null}return se}var b={},c=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(J,ne){b[" "+J]||(c.test(J)?b[" "+J]=J+"/":b[" "+J]=P(J,"/",!0)),J=b[" "+J];var se=J.indexOf(":")===-1;return ne.substring(0,2)==="//"?se?ne:J.replace(d,"$1")+ne:ne.charAt(0)==="/"?se?ne:J.replace(l,"$1")+ne:J+ne}var v={exec:function(){}};function f(J){for(var ne=1,se,ee;ne<arguments.length;ne++){se=arguments[ne];for(ee in se)Object.prototype.hasOwnProperty.call(se,ee)&&(J[ee]=se[ee])}return J}function E(J,ne){var se=J.replace(/\|/g,function(le,de,me){for(var ye=!1,Le=de;--Le>=0&&me[Le]==="\\";)ye=!ye;return ye?"|":" |"}),ee=se.split(/ \|/),ie=0;if(ee.length>ne)ee.splice(ne);else for(;ee.length<ne;)ee.push("");for(;ie<ee.length;ie++)ee[ie]=ee[ie].trim().replace(/\\\|/g,"|");return ee}function P(J,ne,se){var ee=J.length;if(ee===0)return"";for(var ie=0;ie<ee;){var le=J.charAt(ee-ie-1);if(le===ne&&!se)ie++;else if(le!==ne&&se)ie++;else break}return J.substr(0,ee-ie)}function H(J,ne){if(J.indexOf(ne[1])===-1)return-1;for(var se=J.length,ee=0,ie=0;ie<se;ie++)if(J[ie]==="\\")ie++;else if(J[ie]===ne[0])ee++;else if(J[ie]===ne[1]&&(ee--,ee<0))return ie;return-1}function Q(J){J&&J.sanitize&&!J.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 re={escape:h,unescape:s,edit:y,cleanUrl:D,resolveUrl:a,noopTest:v,merge:f,splitCells:E,rtrim:P,findClosingBracket:H,checkSanitizeDeprecation:Q},z=W.defaults,U=re.rtrim,ae=re.splitCells,fe=re.escape,ge=re.findClosingBracket;function Ee(J,ne,se){var ee=ne.href,ie=ne.title?fe(ne.title):null,le=J[1].replace(/\\([\[\]])/g,"$1");return J[0].charAt(0)!=="!"?{type:"link",raw:se,href:ee,title:ie,text:le}:{type:"image",raw:se,href:ee,title:ie,text:fe(le)}}function Ne(J,ne){var se=J.match(/^(\s+)(?:```)/);if(se===null)return ne;var ee=se[1];return ne.split(`
`).map(function(ie){var le=ie.match(/^\s+/);if(le===null)return ie;var de=le[0];return de.length>=ee.length?ie.slice(ee.length):ie}).join(`
`)}var Se=function(){function J(se){this.options=se||z}var ne=J.prototype;return ne.space=function(ee){var ie=this.rules.block.newline.exec(ee);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ne.code=function(ee,ie){var le=this.rules.block.code.exec(ee);if(le){var de=ie[ie.length-1];if(de&&de.type==="paragraph")return{raw:le[0],text:le[0].trimRight()};var me=le[0].replace(/^ {4}/gm,"");return{type:"code",raw:le[0],codeBlockStyle:"indented",text:this.options.pedantic?me:U(me,`
`)}}},ne.fences=function(ee){var ie=this.rules.block.fences.exec(ee);if(ie){var le=ie[0],de=Ne(le,ie[3]||"");return{type:"code",raw:le,lang:ie[2]?ie[2].trim():ie[2],text:de}}},ne.heading=function(ee){var ie=this.rules.block.heading.exec(ee);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ne.nptable=function(ee){var ie=this.rules.block.nptable.exec(ee);if(ie){var le={type:"table",header:ae(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(le.header.length===le.align.length){var de=le.align.length,me;for(me=0;me<de;me++)/^ *-+: *$/.test(le.align[me])?le.align[me]="right":/^ *:-+: *$/.test(le.align[me])?le.align[me]="center":/^ *:-+ *$/.test(le.align[me])?le.align[me]="left":le.align[me]=null;for(de=le.cells.length,me=0;me<de;me++)le.cells[me]=ae(le.cells[me],le.header.length);return le}}},ne.hr=function(ee){var ie=this.rules.block.hr.exec(ee);if(ie)return{type:"hr",raw:ie[0]}},ne.blockquote=function(ee){var ie=this.rules.block.blockquote.exec(ee);if(ie){var le=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:le}}},ne.list=function(ee){var ie=this.rules.block.list.exec(ee);if(ie){for(var le=ie[0],de=ie[2],me=de.length>1,ye=de[de.length-1]===")",Le={type:"list",raw:le,ordered:me,start:me?+de.slice(0,-1):"",loose:!1,items:[]},He=ie[0].match(this.rules.block.item),et=!1,rt,vt,st,nt,Tt,Et,_t,Mt=He.length,xt=0;xt<Mt;xt++)rt=He[xt],le=rt,vt=rt.length,rt=rt.replace(/^ *([*+-]|\d+[.)]) */,""),~rt.indexOf(`
`)&&(vt-=rt.length,rt=this.options.pedantic?rt.replace(/^ {1,4}/gm,""):rt.replace(new RegExp("^ {1,"+vt+"}","gm"),"")),xt!==Mt-1&&(st=this.rules.block.bullet.exec(He[xt+1])[0],(me?st.length===1||!ye&&st[st.length-1]===")":st.length>1||this.options.smartLists&&st!==de)&&(nt=He.slice(xt+1).join(`
`),Le.raw=Le.raw.substring(0,Le.raw.length-nt.length),xt=Mt-1)),Tt=et||/\n\n(?!\s*$)/.test(rt),xt!==Mt-1&&(et=rt.charAt(rt.length-1)===`
`,Tt||(Tt=et)),Tt&&(Le.loose=!0),Et=/^\[[ xX]\] /.test(rt),_t=void 0,Et&&(_t=rt[1]!==" ",rt=rt.replace(/^\[[ xX]\] +/,"")),Le.items.push({type:"list_item",raw:le,task:Et,checked:_t,loose:Tt,text:rt});return Le}},ne.html=function(ee){var ie=this.rules.block.html.exec(ee);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):fe(ie[0]):ie[0]}},ne.def=function(ee){var ie=this.rules.block.def.exec(ee);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var le=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:le,raw:ie[0],href:ie[2],title:ie[3]}}},ne.table=function(ee){var ie=this.rules.block.table.exec(ee);if(ie){var le={type:"table",header:ae(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(le.header.length===le.align.length){le.raw=ie[0];var de=le.align.length,me;for(me=0;me<de;me++)/^ *-+: *$/.test(le.align[me])?le.align[me]="right":/^ *:-+: *$/.test(le.align[me])?le.align[me]="center":/^ *:-+ *$/.test(le.align[me])?le.align[me]="left":le.align[me]=null;for(de=le.cells.length,me=0;me<de;me++)le.cells[me]=ae(le.cells[me].replace(/^ *\| *| *\| *$/g,""),le.header.length);return le}}},ne.lheading=function(ee){var ie=this.rules.block.lheading.exec(ee);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},ne.paragraph=function(ee){var ie=this.rules.block.paragraph.exec(ee);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
`?ie[1].slice(0,-1):ie[1]}},ne.text=function(ee,ie){var le=this.rules.block.text.exec(ee);if(le){var de=ie[ie.length-1];return de&&de.type==="text"?{raw:le[0],text:le[0]}:{type:"text",raw:le[0],text:le[0]}}},ne.escape=function(ee){var ie=this.rules.inline.escape.exec(ee);if(ie)return{type:"escape",raw:ie[0],text:fe(ie[1])}},ne.tag=function(ee,ie,le){var de=this.rules.inline.tag.exec(ee);if(de)return!ie&&/^<a /i.test(de[0])?ie=!0:ie&&/^<\/a>/i.test(de[0])&&(ie=!1),!le&&/^<(pre|code|kbd|script)(\s|>)/i.test(de[0])?le=!0:le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(de[0])&&(le=!1),{type:this.options.sanitize?"text":"html",raw:de[0],inLink:ie,inRawBlock:le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):fe(de[0]):de[0]}},ne.link=function(ee){var ie=this.rules.inline.link.exec(ee);if(ie){var le=ge(ie[2],"()");if(le>-1){var de=ie[0].indexOf("!")===0?5:4,me=de+ie[1].length+le;ie[2]=ie[2].substring(0,le),ie[0]=ie[0].substring(0,me).trim(),ie[3]=""}var ye=ie[2],Le="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ye);He?(ye=He[1],Le=He[3]):Le=""}else Le=ie[3]?ie[3].slice(1,-1):"";ye=ye.trim().replace(/^<([\s\S]*)>$/,"$1");var et=Ee(ie,{href:ye&&ye.replace(this.rules.inline._escapes,"$1"),title:Le&&Le.replace(this.rules.inline._escapes,"$1")},ie[0]);return et}},ne.reflink=function(ee,ie){var le;if((le=this.rules.inline.reflink.exec(ee))||(le=this.rules.inline.nolink.exec(ee))){var de=(le[2]||le[1]).replace(/\s+/g," ");if(de=ie[de.toLowerCase()],!de||!de.href){var me=le[0].charAt(0);return{type:"text",raw:me,text:me}}var ye=Ee(le,de,le[0]);return ye}},ne.strong=function(ee,ie,le){le===void 0&&(le="");var de=this.rules.inline.strong.start.exec(ee);if(de&&(!de[1]||de[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*ee.length);var me=de[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var ye;(de=me.exec(ie))!=null;)if(ye=this.rules.inline.strong.middle.exec(ie.slice(0,de.index+3)),ye)return{type:"strong",raw:ee.slice(0,ye[0].length),text:ee.slice(2,ye[0].length-2)}}},ne.em=function(ee,ie,le){le===void 0&&(le="");var de=this.rules.inline.em.start.exec(ee);if(de&&(!de[1]||de[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*ee.length);var me=de[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var ye;(de=me.exec(ie))!=null;)if(ye=this.rules.inline.em.middle.exec(ie.slice(0,de.index+2)),ye)return{type:"em",raw:ee.slice(0,ye[0].length),text:ee.slice(1,ye[0].length-1)}}},ne.codespan=function(ee){var ie=this.rules.inline.code.exec(ee);if(ie){var le=ie[2].replace(/\n/g," "),de=/[^ ]/.test(le),me=le.startsWith(" ")&&le.endsWith(" ");return de&&me&&(le=le.substring(1,le.length-1)),le=fe(le,!0),{type:"codespan",raw:ie[0],text:le}}},ne.br=function(ee){var ie=this.rules.inline.br.exec(ee);if(ie)return{type:"br",raw:ie[0]}},ne.del=function(ee){var ie=this.rules.inline.del.exec(ee);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ne.autolink=function(ee,ie){var le=this.rules.inline.autolink.exec(ee);if(le){var de,me;return le[2]==="@"?(de=fe(this.options.mangle?ie(le[1]):le[1]),me="mailto:"+de):(de=fe(le[1]),me=de),{type:"link",raw:le[0],text:de,href:me,tokens:[{type:"text",raw:de,text:de}]}}},ne.url=function(ee,ie){var le;if(le=this.rules.inline.url.exec(ee)){var de,me;if(le[2]==="@")de=fe(this.options.mangle?ie(le[0]):le[0]),me="mailto:"+de;else{var ye;do ye=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(ye!==le[0]);de=fe(le[0]),le[1]==="www."?me="http://"+de:me=de}return{type:"link",raw:le[0],text:de,href:me,tokens:[{type:"text",raw:de,text:de}]}}},ne.inlineText=function(ee,ie,le){var de=this.rules.inline.text.exec(ee);if(de){var me;return ie?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):fe(de[0]):de[0]:me=fe(this.options.smartypants?le(de[0]):de[0]),{type:"text",raw:de[0],text:me}}},J}(),Ie=re.noopTest,Ae=re.edit,we=re.merge,ve={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:Ie,table:Ie,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=Ae(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=Ae(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Ae(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=/<!--(?!-?>)[\s\S]*?-->/,ve.html=Ae(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Ae(ve._paragraph).replace("hr",ve.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",ve._tag).getRegex(),ve.blockquote=Ae(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=we({},ve),ve.gfm=we({},ve.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*|$)"}),ve.gfm.nptable=Ae(ve.gfm.nptable).replace("hr",ve.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",ve._tag).getRegex(),ve.gfm.table=Ae(ve.gfm.table).replace("hr",ve.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",ve._tag).getRegex(),ve.pedantic=we({},ve.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._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:Ie,paragraph:Ae(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var j={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ie,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:Ie,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};j._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",j.punctuation=Ae(j.punctuation).replace(/punctuation/g,j._punctuation).getRegex(),j._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",j._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",j.em.start=Ae(j.em.start).replace(/punctuation/g,j._punctuation).getRegex(),j.em.middle=Ae(j.em.middle).replace(/punctuation/g,j._punctuation).replace(/overlapSkip/g,j._overlapSkip).getRegex(),j.em.endAst=Ae(j.em.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.em.endUnd=Ae(j.em.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.start=Ae(j.strong.start).replace(/punctuation/g,j._punctuation).getRegex(),j.strong.middle=Ae(j.strong.middle).replace(/punctuation/g,j._punctuation).replace(/blockSkip/g,j._blockSkip).getRegex(),j.strong.endAst=Ae(j.strong.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.endUnd=Ae(j.strong.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.blockSkip=Ae(j._blockSkip,"g").getRegex(),j.overlapSkip=Ae(j._overlapSkip,"g").getRegex(),j._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,j._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,j._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])?)+(?![-_])/,j.autolink=Ae(j.autolink).replace("scheme",j._scheme).replace("email",j._email).getRegex(),j._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,j.tag=Ae(j.tag).replace("comment",ve._comment).replace("attribute",j._attribute).getRegex(),j._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,j._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,j._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,j.link=Ae(j.link).replace("label",j._label).replace("href",j._href).replace("title",j._title).getRegex(),j.reflink=Ae(j.reflink).replace("label",j._label).getRegex(),j.reflinkSearch=Ae(j.reflinkSearch,"g").replace("reflink",j.reflink).replace("nolink",j.nolink).getRegex(),j.normal=we({},j),j.pedantic=we({},j.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:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",j._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j._label).getRegex()}),j.gfm=we({},j.normal,{escape:Ae(j.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),j.gfm.url=Ae(j.gfm.url,"i").replace("email",j.gfm._extended_email).getRegex(),j.breaks=we({},j.gfm,{br:Ae(j.br).replace("{2,}","*").getRegex(),text:Ae(j.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var T={block:ve,inline:j},L=W.defaults,G=T.block,q=T.inline;function N(J){return J.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 ue(J){var ne="",se,ee,ie=J.length;for(se=0;se<ie;se++)ee=J.charCodeAt(se),Math.random()>.5&&(ee="x"+ee.toString(16)),ne+="&#"+ee+";";return ne}var be=function(){function J(se){this.tokens=[],this.tokens.links=Object.create(null),this.options=se||L,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:G.normal,inline:q.normal};this.options.pedantic?(ee.block=G.pedantic,ee.inline=q.pedantic):this.options.gfm&&(ee.block=G.gfm,this.options.breaks?ee.inline=q.breaks:ee.inline=q.gfm),this.tokenizer.rules=ee}J.lex=function(ee,ie){var le=new J(ie);return le.lex(ee)};var ne=J.prototype;return ne.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},ne.blockTokens=function(ee,ie,le){ie===void 0&&(ie=[]),le===void 0&&(le=!0),ee=ee.replace(/^ +$/gm,"");for(var de,me,ye,Le;ee;){if(de=this.tokenizer.space(ee)){ee=ee.substring(de.raw.length),de.type&&ie.push(de);continue}if(de=this.tokenizer.code(ee,ie)){ee=ee.substring(de.raw.length),de.type?ie.push(de):(Le=ie[ie.length-1],Le.raw+=`
`+de.raw,Le.text+=`
`+de.text);continue}if(de=this.tokenizer.fences(ee)){ee=ee.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.heading(ee)){ee=ee.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.nptable(ee)){ee=ee.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.hr(ee)){ee=ee.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.blockquote(ee)){ee=ee.substring(de.raw.length),de.tokens=this.blockTokens(de.text,[],le),ie.push(de);continue}if(de=this.tokenizer.list(ee)){for(ee=ee.substring(de.raw.length),ye=de.items.length,me=0;me<ye;me++)de.items[me].tokens=this.blockTokens(de.items[me].text,[],!1);ie.push(de);continue}if(de=this.tokenizer.html(ee)){ee=ee.substring(de.raw.length),ie.push(de);continue}if(le&&(de=this.tokenizer.def(ee))){ee=ee.substring(de.raw.length),this.tokens.links[de.tag]||(this.tokens.links[de.tag]={href:de.href,title:de.title});continue}if(de=this.tokenizer.table(ee)){ee=ee.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.lheading(ee)){ee=ee.substring(de.raw.length),ie.push(de);continue}if(le&&(de=this.tokenizer.paragraph(ee))){ee=ee.substring(de.raw.length),ie.push(de);continue}if(de=this.tokenizer.text(ee,ie)){ee=ee.substring(de.raw.length),de.type?ie.push(de):(Le=ie[ie.length-1],Le.raw+=`
`+de.raw,Le.text+=`
`+de.text);continue}if(ee){var He="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(He);break}else throw new Error(He)}}return ie},ne.inline=function(ee){var ie,le,de,me,ye,Le,He=ee.length;for(ie=0;ie<He;ie++){Le=ee[ie];switch(Le.type){case"paragraph":case"text":case"heading":{Le.tokens=[],this.inlineTokens(Le.text,Le.tokens);break}case"table":{for(Le.tokens={header:[],cells:[]},me=Le.header.length,le=0;le<me;le++)Le.tokens.header[le]=[],this.inlineTokens(Le.header[le],Le.tokens.header[le]);for(me=Le.cells.length,le=0;le<me;le++)for(ye=Le.cells[le],Le.tokens.cells[le]=[],de=0;de<ye.length;de++)Le.tokens.cells[le][de]=[],this.inlineTokens(ye[de],Le.tokens.cells[le][de]);break}case"blockquote":{this.inline(Le.tokens);break}case"list":{for(me=Le.items.length,le=0;le<me;le++)this.inline(Le.items[le].tokens);break}}}return ee},ne.inlineTokens=function(ee,ie,le,de,me){ie===void 0&&(ie=[]),le===void 0&&(le=!1),de===void 0&&(de=!1),me===void 0&&(me="");var ye,Le=ee,He;if(this.tokens.links){var et=Object.keys(this.tokens.links);if(et.length>0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(Le))!=null;)et.includes(He[0].slice(He[0].lastIndexOf("[")+1,-1))&&(Le=Le.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(He=this.tokenizer.rules.inline.blockSkip.exec(Le))!=null;)Le=Le.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(ye=this.tokenizer.escape(ee)){ee=ee.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.tag(ee,le,de)){ee=ee.substring(ye.raw.length),le=ye.inLink,de=ye.inRawBlock,ie.push(ye);continue}if(ye=this.tokenizer.link(ee)){ee=ee.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,de)),ie.push(ye);continue}if(ye=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,de)),ie.push(ye);continue}if(ye=this.tokenizer.strong(ee,Le,me)){ee=ee.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,de),ie.push(ye);continue}if(ye=this.tokenizer.em(ee,Le,me)){ee=ee.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,de),ie.push(ye);continue}if(ye=this.tokenizer.codespan(ee)){ee=ee.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.br(ee)){ee=ee.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.del(ee)){ee=ee.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,de),ie.push(ye);continue}if(ye=this.tokenizer.autolink(ee,ue)){ee=ee.substring(ye.raw.length),ie.push(ye);continue}if(!le&&(ye=this.tokenizer.url(ee,ue))){ee=ee.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.inlineText(ee,de,N)){ee=ee.substring(ye.raw.length),me=ye.raw.slice(-1),ie.push(ye);continue}if(ee){var rt="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return ie},Y(J,null,[{key:"rules",get:function(){return{block:G,inline:q}}}]),J}(),Te=W.defaults,Be=re.cleanUrl,ke=re.escape,Oe=function(){function J(se){this.options=se||Te}var ne=J.prototype;return ne.code=function(ee,ie,le){var de=(ie||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(ee,de);me!=null&&me!==ee&&(le=!0,ee=me)}return de?'<pre><code class="'+this.options.langPrefix+ke(de,!0)+'">'+(le?ee:ke(ee,!0))+`</code></pre>
`:"<pre><code>"+(le?ee:ke(ee,!0))+`</code></pre>
`},ne.blockquote=function(ee){return`<blockquote>
`+ee+`</blockquote>
`},ne.html=function(ee){return ee},ne.heading=function(ee,ie,le,de){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+de.slug(le)+'">'+ee+"</h"+ie+`>
`:"<h"+ie+">"+ee+"</h"+ie+`>
`},ne.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ne.list=function(ee,ie,le){var de=ie?"ol":"ul",me=ie&&le!==1?' start="'+le+'"':"";return"<"+de+me+`>
`+ee+"</"+de+`>
`},ne.listitem=function(ee){return"<li>"+ee+`</li>
`},ne.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ne.paragraph=function(ee){return"<p>"+ee+`</p>
`},ne.table=function(ee,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
<thead>
`+ee+`</thead>
`+ie+`</table>
`},ne.tablerow=function(ee){return`<tr>
`+ee+`</tr>
`},ne.tablecell=function(ee,ie){var le=ie.header?"th":"td",de=ie.align?"<"+le+' align="'+ie.align+'">':"<"+le+">";return de+ee+"</"+le+`>
`},ne.strong=function(ee){return"<strong>"+ee+"</strong>"},ne.em=function(ee){return"<em>"+ee+"</em>"},ne.codespan=function(ee){return"<code>"+ee+"</code>"},ne.br=function(){return this.options.xhtml?"<br/>":"<br>"},ne.del=function(ee){return"<del>"+ee+"</del>"},ne.link=function(ee,ie,le){if(ee=Be(this.options.sanitize,this.options.baseUrl,ee),ee===null)return le;var de='<a href="'+ke(ee)+'"';return ie&&(de+=' title="'+ie+'"'),de+=">"+le+"</a>",de},ne.image=function(ee,ie,le){if(ee=Be(this.options.sanitize,this.options.baseUrl,ee),ee===null)return le;var de='<img src="'+ee+'" alt="'+le+'"';return ie&&(de+=' title="'+ie+'"'),de+=this.options.xhtml?"/>":">",de},ne.text=function(ee){return ee},J}(),_e=function(){function J(){}var ne=J.prototype;return ne.strong=function(ee){return ee},ne.em=function(ee){return ee},ne.codespan=function(ee){return ee},ne.del=function(ee){return ee},ne.html=function(ee){return ee},ne.text=function(ee){return ee},ne.link=function(ee,ie,le){return""+le},ne.image=function(ee,ie,le){return""+le},ne.br=function(){return""},J}(),Ge=function(){function J(){this.seen={}}var ne=J.prototype;return ne.slug=function(ee){var ie=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var le=ie;do this.seen[le]++,ie=le+"-"+this.seen[le];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},J}(),Ve=W.defaults,Qe=re.unescape,Ye=function(){function J(se){this.options=se||Ve,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _e,this.slugger=new Ge}J.parse=function(ee,ie){var le=new J(ie);return le.parse(ee)};var ne=J.prototype;return ne.parse=function(ee,ie){ie===void 0&&(ie=!0);var le="",de,me,ye,Le,He,et,rt,vt,st,nt,Tt,Et,_t,Mt,xt,mr,Sr,Yt,gr=ee.length;for(de=0;de<gr;de++){nt=ee[de];switch(nt.type){case"space":continue;case"hr":{le+=this.renderer.hr();continue}case"heading":{le+=this.renderer.heading(this.parseInline(nt.tokens),nt.depth,Qe(this.parseInline(nt.tokens,this.textRenderer)),this.slugger);continue}case"code":{le+=this.renderer.code(nt.text,nt.lang,nt.escaped);continue}case"table":{for(vt="",rt="",Le=nt.header.length,me=0;me<Le;me++)rt+=this.renderer.tablecell(this.parseInline(nt.tokens.header[me]),{header:!0,align:nt.align[me]});for(vt+=this.renderer.tablerow(rt),st="",Le=nt.cells.length,me=0;me<Le;me++){for(et=nt.tokens.cells[me],rt="",He=et.length,ye=0;ye<He;ye++)rt+=this.renderer.tablecell(this.parseInline(et[ye]),{header:!1,align:nt.align[ye]});st+=this.renderer.tablerow(rt)}le+=this.renderer.table(vt,st);continue}case"blockquote":{st=this.parse(nt.tokens),le+=this.renderer.blockquote(st);continue}case"list":{for(Tt=nt.ordered,Et=nt.start,_t=nt.loose,Le=nt.items.length,st="",me=0;me<Le;me++)xt=nt.items[me],mr=xt.checked,Sr=xt.task,Mt="",xt.task&&(Yt=this.renderer.checkbox(mr),_t?xt.tokens.length>0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=Yt+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=Yt+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:Yt}):Mt+=Yt),Mt+=this.parse(xt.tokens,_t),st+=this.renderer.listitem(Mt,Sr,mr);le+=this.renderer.list(st,Tt,Et);continue}case"html":{le+=this.renderer.html(nt.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(nt.tokens));continue}case"text":{for(st=nt.tokens?this.parseInline(nt.tokens):nt.text;de+1<gr&&ee[de+1].type==="text";)nt=ee[++de],st+=`
`+(nt.tokens?this.parseInline(nt.tokens):nt.text);le+=ie?this.renderer.paragraph(st):st;continue}default:{var cr='Token with "'+nt.type+'" type was not found.';if(this.options.silent){console.error(cr);return}else throw new Error(cr)}}}return le},ne.parseInline=function(ee,ie){ie=ie||this.renderer;var le="",de,me,ye=ee.length;for(de=0;de<ye;de++){me=ee[de];switch(me.type){case"escape":{le+=ie.text(me.text);break}case"html":{le+=ie.html(me.text);break}case"link":{le+=ie.link(me.href,me.title,this.parseInline(me.tokens,ie));break}case"image":{le+=ie.image(me.href,me.title,me.text);break}case"strong":{le+=ie.strong(this.parseInline(me.tokens,ie));break}case"em":{le+=ie.em(this.parseInline(me.tokens,ie));break}case"codespan":{le+=ie.codespan(me.text);break}case"br":{le+=ie.br();break}case"del":{le+=ie.del(this.parseInline(me.tokens,ie));break}case"text":{le+=ie.text(me.text);break}default:{var Le='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(Le);return}else throw new Error(Le)}}}return le},J}(),ot=re.merge,Xe=re.checkSanitizeDeprecation,Ze=re.escape,De=W.getDefaults,it=W.changeDefaults,$e=W.defaults;function oe(J,ne,se){if(typeof J=="undefined"||J===null)throw new Error("marked(): input parameter is undefined or null");if(typeof J!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(J)+", string expected");if(typeof ne=="function"&&(se=ne,ne=null),ne=ot({},oe.defaults,ne||{}),Xe(ne),se){var ee=ne.highlight,ie;try{ie=be.lex(J,ne)}catch(ye){return se(ye)}var le=function(Le){var He;if(!Le)try{He=Ye.parse(ie,ne)}catch(et){Le=et}return ne.highlight=ee,Le?se(Le):se(null,He)};if(!ee||ee.length<3)return le();if(delete ne.highlight,!ie.length)return le();var de=0;oe.walkTokens(ie,function(ye){ye.type==="code"&&(de++,setTimeout(function(){ee(ye.text,ye.lang,function(Le,He){if(Le)return le(Le);He!=null&&He!==ye.text&&(ye.text=He,ye.escaped=!0),de--,de===0&&le()})},0))}),de===0&&le();return}try{var me=be.lex(J,ne);return ne.walkTokens&&oe.walkTokens(me,ne.walkTokens),Ye.parse(me,ne)}catch(ye){if(ye.message+=`
Please report this to https://github.com/markedjs/marked.`,ne.silent)return"<p>An error occurred:</p><pre>"+Ze(ye.message+"",!0)+"</pre>";throw ye}}oe.options=oe.setOptions=function(J){return ot(oe.defaults,J),it(oe.defaults),oe},oe.getDefaults=De,oe.defaults=$e,oe.use=function(J){var ne=ot({},J);if(J.renderer&&function(){var ee=oe.defaults.renderer||new Oe,ie=function(me){var ye=ee[me];ee[me]=function(){for(var Le=arguments.length,He=new Array(Le),et=0;et<Le;et++)He[et]=arguments[et];var rt=J.renderer[me].apply(ee,He);return rt===!1&&(rt=ye.apply(ee,He)),rt}};for(var le in J.renderer)ie(le);ne.renderer=ee}(),J.tokenizer&&function(){var ee=oe.defaults.tokenizer||new Se,ie=function(me){var ye=ee[me];ee[me]=function(){for(var Le=arguments.length,He=new Array(Le),et=0;et<Le;et++)He[et]=arguments[et];var rt=J.tokenizer[me].apply(ee,He);return rt===!1&&(rt=ye.apply(ee,He)),rt}};for(var le in J.tokenizer)ie(le);ne.tokenizer=ee}(),J.walkTokens){var se=oe.defaults.walkTokens;ne.walkTokens=function(ee){J.walkTokens(ee),se&&se(ee)}}oe.setOptions(ne)},oe.walkTokens=function(J,ne){for(var se=_(J),ee;!(ee=se()).done;){var ie=ee.value;ne(ie);switch(ie.type){case"table":{for(var le=_(ie.tokens.header),de;!(de=le()).done;){var me=de.value;oe.walkTokens(me,ne)}for(var ye=_(ie.tokens.cells),Le;!(Le=ye()).done;)for(var He=Le.value,et=_(He),rt;!(rt=et()).done;){var vt=rt.value;oe.walkTokens(vt,ne)}break}case"list":{oe.walkTokens(ie.items,ne);break}default:ie.tokens&&oe.walkTokens(ie.tokens,ne)}}},oe.Parser=Ye,oe.parser=Ye.parse,oe.Renderer=Oe,oe.TextRenderer=_e,oe.Lexer=be,oe.lexer=be.lex,oe.Tokenizer=Se,oe.Slugger=Ge,oe.parse=oe;var Z=oe;return Z})},E3HF:function(Pe,Re,$){Pe.exports={flex_box_center:"flex_box_center___9yD0l",flex_space_between:"flex_space_between___12_t1",flex_box_vertical_center:"flex_box_vertical_center____RzXy",flex_box_center_end:"flex_box_center_end___w5V55",flex_box_column:"flex_box_column___1O69H",bg:"bg___1SAB4",flexRow:"flexRow___TGonw",flexJustifyCenter:"flexJustifyCenter___FdZYv",flexAlignEnd:"flexAlignEnd___2MQGW",flexAlingCenter:"flexAlingCenter___HR4pS",flexAlignCenter:"flexAlignCenter___2tpRP",flexColumn:"flexColumn___2x5QM",formWrap:"formWrap___3nPVX",titleWrap:"titleWrap___2I_px",fieldWrap:"fieldWrap___q51w8",mdWrap:"mdWrap___1_3Z7",backgroundFa:"backgroundFa___3eVc8",button:"button___BK_yA",icons:"icons___FzVfz",navBar:"navBar___3G5De",active:"active___15cJu",tipWrap:"tipWrap___20yI4",tip:"tip___2Y6MS",width300:"width300___-1o3l",popover:"popover___2-F6L",groupWrap:"groupWrap___2_3AK"}},E7E6:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBC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i32YhxBv19fUD9yLku3BZ8i8oQJLrcurUiWt6e8Wi3l7CyBiO8JvicXkXS/EOEokWv582+/2ypaZm3IFCrXhBA5Is9La2trqenp6biGi2lJhv0eZcxhVq4xRIuU8Qid1CCKyB31VSUrK1trY2WiBlz1rMQQVIqtpeuHBidEcHzZIy/iLSXtfyWrGsupEQIb7WiT4iot1CxF9Dh9LuESPGnTGXUmHFHvSApGoOzLm0tbU19vb2TpVSThGCphLJKVLSVCFoYrHCAwikpCNC0MdE4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Pe,Re,$){(function(he){he($("VrN/"))})(function(he){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},k=he.Pos;he.defineOption("autoCloseBrackets",!1,function(A,C,h){h&&h!=he.Init&&(A.removeKeyMap(_),A.state.closeBrackets=null),C&&(R(V(C,"pairs")),A.state.closeBrackets=C,A.addKeyMap(_))});function V(A,C){return C=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[C]!=null?A[C]:Y[C]}var _={Backspace:O,Enter:M};function R(A){for(var C=0;C<A.length;C++){var h=A.charAt(C),o="'"+h+"'";_[o]||(_[o]=W(h))}}R(Y.pairs+"`");function W(A){return function(C){return S(C,A)}}function F(A){var C=A.state.closeBrackets;if(!C||C.override)return C;var h=A.getModeAt(A.getCursor());return h.closeBrackets||C}function O(A){var C=F(A);if(!C||A.getOption("disableInput"))return he.Pass;for(var h=V(C,"pairs"),o=A.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return he.Pass;var u=I(A,o[s].head);if(!u||h.indexOf(u)%2!=0)return he.Pass}for(var s=o.length-1;s>=0;s--){var y=o[s].head;A.replaceRange("",k(y.line,y.ch-1),k(y.line,y.ch+1),"+delete")}}function M(A){var C=F(A),h=C&&V(C,"explode");if(!h||A.getOption("disableInput"))return he.Pass;for(var o=A.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return he.Pass;var u=I(A,o[s].head);if(!u||h.indexOf(u)%2!=0)return he.Pass}A.operation(function(){var y=A.lineSeparator()||`
`;A.replaceSelection(y+y,null),A.execCommand("goCharLeft"),o=A.listSelections();for(var m=0;m<o.length;m++){var p=o[m].head.line;A.indentLine(p,null,!0),A.indentLine(p+1,null,!0)}})}function g(A){var C=he.cmpPos(A.anchor,A.head)>0;return{anchor:new k(A.anchor.line,A.anchor.ch+(C?-1:1)),head:new k(A.head.line,A.head.ch+(C?1:-1))}}function S(A,C){var h=F(A);if(!h||A.getOption("disableInput"))return he.Pass;var o=V(h,"pairs"),s=o.indexOf(C);if(s==-1)return he.Pass;for(var u=V(h,"closeBefore"),y=V(h,"triples"),m=o.charAt(s+1)==C,p=A.listSelections(),D=s%2==0,b,c=0;c<p.length;c++){var d=p[c],l=d.head,a,v=A.getRange(l,k(l.line,l.ch+1));if(D&&!d.empty())a="surround";else if((m||!D)&&v==C)m&&w(A,l)?a="both":y.indexOf(C)>=0&&A.getRange(l,k(l.line,l.ch+3))==C+C+C?a="skipThree":a="skip";else if(m&&l.ch>1&&y.indexOf(C)>=0&&A.getRange(k(l.line,l.ch-2),l)==C+C){if(l.ch>2&&/\bstring/.test(A.getTokenTypeAt(k(l.line,l.ch-2))))return he.Pass;a="addFour"}else if(m){var f=l.ch==0?" ":A.getRange(k(l.line,l.ch-1),l);if(!he.isWordChar(v)&&f!=C&&!he.isWordChar(f))a="both";else return he.Pass}else if(D&&(v.length===0||/\s/.test(v)||u.indexOf(v)>-1))a="both";else return he.Pass;if(!b)b=a;else if(b!=a)return he.Pass}var E=s%2?o.charAt(s-1):C,P=s%2?C:o.charAt(s+1);A.operation(function(){if(b=="skip")A.execCommand("goCharRight");else if(b=="skipThree")for(var H=0;H<3;H++)A.execCommand("goCharRight");else if(b=="surround"){for(var Q=A.getSelections(),H=0;H<Q.length;H++)Q[H]=E+Q[H]+P;A.replaceSelections(Q,"around"),Q=A.listSelections().slice();for(var H=0;H<Q.length;H++)Q[H]=g(Q[H]);A.setSelections(Q)}else b=="both"?(A.replaceSelection(E+P,null),A.triggerElectric(E+P),A.execCommand("goCharLeft")):b=="addFour"&&(A.replaceSelection(E+E+E+E,"before"),A.execCommand("goCharRight"))})}function I(A,C){var h=A.getRange(k(C.line,C.ch-1),k(C.line,C.ch+1));return h.length==2?h:null}function w(A,C){var h=A.getTokenAt(k(C.line,C.ch+1));return/\bstring/.test(h.type)&&h.start==C.ch&&(C.ch==0||!/\bstring/.test(A.getTokenTypeAt(C)))}})},FOrL:function(Pe,Re,$){Pe.exports=$.p+"static/nodata.a6b3f948.png"},FPkq:function(Pe,Re,$){Pe.exports=$.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKS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UVORK5CYII="},Gytx:function(Pe,Re){Pe.exports=function(he,Y,k,V){var _=k?k.call(V,he,Y):void 0;if(_!==void 0)return!!_;if(he===Y)return!0;if(typeof he!="object"||!he||typeof Y!="object"||!Y)return!1;var R=Object.keys(he),W=Object.keys(Y);if(R.length!==W.length)return!1;for(var F=Object.prototype.hasOwnProperty.bind(Y),O=0;O<R.length;O++){var M=R[O];if(!F(M))return!1;var g=he[M],S=Y[M];if(_=k?k.call(V,g,S,M):void 0,_===!1||_===void 0&&g!==S)return!1}return!0}},HmJG:function(Pe,Re,$){},HpTS:function(Pe,Re,$){Pe.exports=$.p+"static/small_program.f74069ec.png"},JWDV:function(Pe,Re,$){Pe.exports=$.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r48eigdtz+TUKIF05GOSL3JKSUDwN4SALYXBRQwqzIrUNBvQ1DAIYm4BHAJxMz0TPOLoJu9BFClJxsglVVVWXGx8d/IYTIOl4rsSCnGvNzarCvIghLAl5NoN6WuKVPAu4dkMj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yuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(Pe,Re,$){Pe.exports=$.p+"static/qrcode.2267e4d5.png"},LdHM:function(Pe,Re,$){"use strict";$.d(Re,"b",function(){return u}),$.d(Re,"a",function(){return m});var he=$("1OyB"),Y=$("vuIU"),k=$("Ji7U"),V=$("LK+K"),_=$("q1tI"),R=$("rePB"),W=$("Ff2n"),F=$("ODXe"),O=$("4IlW"),M=$("bX4T"),g=$("YrtM"),S=$("TSYQ"),I=$.n(S),w=$("+nKL"),A=$("8OUc"),C=function(ae,fe){var ge=ae.prefixCls,Ee=ae.id,Ne=ae.flattenOptions,Se=ae.childrenAsData,Ie=ae.values,Ae=ae.searchValue,we=ae.multiple,ve=ae.defaultActiveFirstOption,j=ae.height,T=ae.itemHeight,L=ae.notFoundContent,G=ae.open,q=ae.menuItemSelectedIcon,N=ae.virtual,ue=ae.onSelect,be=ae.onToggleOpen,Te=ae.onActiveValue,Be=ae.onScroll,ke=ae.onMouseEnter,Oe="".concat(ge,"-item"),_e=Object(g.a)(function(){return Ne},[G,Ne],function(Z,J){return J[0]&&Z[1]!==J[1]}),Ge=_.useRef(null),Ve=function(J){J.preventDefault()},Qe=function(J){Ge.current&&Ge.current.scrollTo({index:J})},Ye=function(J){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,se=_e.length,ee=0;ee<se;ee+=1){var ie=(J+ee*ne+se)%se,le=_e[ie],de=le.group,me=le.data;if(!de&&!me.disabled)return ie}return-1},ot=_.useState(function(){return Ye(0)}),Xe=Object(F.a)(ot,2),Ze=Xe[0],De=Xe[1],it=function(J){De(J);var ne=_e[J];if(!ne){Te(null,-1);return}Te(ne.data.value,J)};_.useEffect(function(){it(ve!==!1?Ye(0):-1)},[_e.length,Ae]),_.useEffect(function(){var Z=setTimeout(function(){if(!we&&G&&Ie.size===1){var J=Array.from(Ie)[0],ne=_e.findIndex(function(se){var ee=se.data;return ee.value===J});it(ne),Qe(ne)}});return function(){return clearTimeout(Z)}},[G]);var $e=function(J){J!==void 0&&ue(J,{selected:!Ie.has(J)}),we||be(!1)};if(_.useImperativeHandle(fe,function(){return{onKeyDown:function(J){var ne=J.which;switch(ne){case O.a.UP:case O.a.DOWN:{var se=0;if(ne===O.a.UP?se=-1:ne===O.a.DOWN&&(se=1),se!==0){var ee=Ye(Ze+se,se);Qe(ee),it(ee)}break}case O.a.ENTER:{var ie=_e[Ze];ie&&!ie.data.disabled?$e(ie.data.value):$e(void 0),G&&J.preventDefault();break}case O.a.ESC:be(!1)}},onKeyUp:function(){},scrollTo:function(J){Qe(J)}}}),_e.length===0)return _.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),className:"".concat(Oe,"-empty"),onMouseDown:Ve},L);function oe(Z){var J=_e[Z];if(!J)return null;var ne=J.data||{},se=ne.value,ee=ne.label,ie=ne.children,le=Object(M.a)(ne,!0),de=Se?ie:ee;return J?_.createElement("div",Object.assign({"aria-label":typeof de=="string"?de:null},le,{key:Z,role:"option",id:"".concat(Ee,"_list_").concat(Z),"aria-selected":Ie.has(se)}),se):null}return _.createElement(_.Fragment,null,_.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},oe(Ze-1),oe(Ze),oe(Ze+1)),_.createElement(w.a,{itemKey:"key",ref:Ge,data:_e,height:j,itemHeight:T,fullHeight:!1,onMouseDown:Ve,onScroll:Be,virtual:N,onMouseEnter:ke},function(Z,J){var ne,se=Z.group,ee=Z.groupOption,ie=Z.data,le=ie.label,de=ie.key;if(se)return _.createElement("div",{className:I()(Oe,"".concat(Oe,"-group"))},le!==void 0?le:de);var me=ie.disabled,ye=ie.value,Le=ie.title,He=ie.children,et=ie.style,rt=ie.className,vt=Object(W.a)(ie,["disabled","value","title","children","style","className"]),st=Ie.has(ye),nt="".concat(Oe,"-option"),Tt=I()(Oe,nt,rt,(ne={},Object(R.a)(ne,"".concat(nt,"-grouped"),ee),Object(R.a)(ne,"".concat(nt,"-active"),Ze===J&&!me),Object(R.a)(ne,"".concat(nt,"-disabled"),me),Object(R.a)(ne,"".concat(nt,"-selected"),st),ne)),Et=Se?He:le,_t=!q||typeof q=="function"||st;return _.createElement("div",Object.assign({},vt,{"aria-selected":st,className:Tt,title:Le,onMouseMove:function(){if(Ze===J||me)return;it(J)},onClick:function(){me||$e(ye)},style:et}),_.createElement("div",{className:"".concat(nt,"-content")},Et||ye),_.isValidElement(q)||st,_t&&_.createElement(A.a,{className:"".concat(Oe,"-option-state"),customizeIcon:q,customizeIconProps:{isSelected:st}},st?"\u2713":null))}))},h=_.forwardRef(C);h.displayName="OptionList";var o=h,s=function(){return null};s.isSelectOption=!0;var u=s,y=function(){return null};y.isSelectOptGroup=!0;var m=y,p=$("VTBJ"),D=$("Zm9Q");function b(U){var ae=U.key,fe=U.props,ge=fe.children,Ee=fe.value,Ne=Object(W.a)(fe,["children","value"]);return Object(p.a)({key:ae,value:Ee!==void 0?Ee:ae,children:ge},Ne)}function c(U){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(U).map(function(fe,ge){if(!_.isValidElement(fe)||!fe.type)return null;var Ee=fe.type.isSelectOptGroup,Ne=fe.key,Se=fe.props,Ie=Se.children,Ae=Object(W.a)(Se,["children"]);return ae||!Ee?b(fe):Object(p.a)(Object(p.a)({key:"__RC_SELECT_GRP__".concat(Ne===null?ge:Ne,"__"),label:Ne},Ae),{},{options:c(Ie)})}).filter(function(fe){return fe})}var d=$("2Qr1"),l=$("qNPg"),a=$("U8pU"),v=$("Kwbf"),f=$("WKfj");function E(U){var ae=U.mode,fe=U.options,ge=U.children,Ee=U.backfill,Ne=U.allowClear,Se=U.placeholder,Ie=U.getInputElement,Ae=U.showSearch,we=U.onSearch,ve=U.defaultOpen,j=U.autoFocus,T=U.labelInValue,L=U.value,G=U.inputValue,q=U.optionLabelProp,N=ae==="multiple"||ae==="tags",ue=Ae!==void 0?Ae:N||ae==="combobox",be=fe||c(ge);if(Object(v.a)(ae!=="tags"||be.every(function(Oe){return!Oe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ae==="tags"||ae==="combobox"){var Te=be.some(function(Oe){return Oe.options?Oe.options.some(function(_e){return typeof("value"in _e?_e.value:_e.key)=="number"}):typeof("value"in Oe?Oe.value:Oe.key)=="number"});Object(v.a)(!Te,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(ae!=="combobox"||!q,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(ae==="combobox"||!Ee,"`backfill` only works with `combobox` mode."),Object(v.a)(ae==="combobox"||!Ie,"`getInputElement` only work with `combobox` mode."),Object(v.b)(ae!=="combobox"||!Ie||!Ne||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!ue&&ae!=="combobox"&&ae!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!ve||j,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),L!=null){var Be=Object(f.d)(L);Object(v.a)(!T||Be.every(function(Oe){return Object(a.a)(Oe)==="object"&&("key"in Oe||"value"in Oe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!N||Array.isArray(L),"`value` should be array when `mode` is `multiple` or `tags`")}if(ge){var ke=null;Object(D.a)(ge).some(function(Oe){if(!_.isValidElement(Oe)||!Oe.type)return!1;var _e=Oe.type;if(_e.isSelectOption)return!1;if(_e.isSelectOptGroup){var Ge=Object(D.a)(Oe.props.children).every(function(Ve){return!_.isValidElement(Ve)||!Oe.type||Ve.type.isSelectOption?!0:(ke=Ve.type,!1)});return!Ge}return ke=_e,!0}),ke&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ke.displayName||ke.name||ke,"`.")),Object(v.a)(G===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=E,H=Object(l.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:c,flattenOptions:d.d,getLabeledValue:d.e,filterOptions:d.b,isValueDisabled:d.g,findValueOption:d.c,warningProps:P,fillOptionsWithMissingValue:d.a}),Q=function(U){Object(k.a)(fe,U);var ae=Object(V.a)(fe);function fe(){var ge;return Object(he.a)(this,fe),ge=ae.apply(this,arguments),ge.selectRef=_.createRef(),ge.focus=function(){ge.selectRef.current.focus()},ge.blur=function(){ge.selectRef.current.blur()},ge}return Object(Y.a)(fe,[{key:"render",value:function(){return _.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),fe}(_.Component);Q.Option=u,Q.OptGroup=m;var re=Q,z=Re.c=re},M8RZ:function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return O});var he=$("fWQN"),Y=$("mtLc"),k=$("yKVA"),V=$("879j"),_=$("q1tI"),R=$.n(_),W=$("i8i4"),F=$.n(W),O=function(M){Object(k.a)(S,M);var g=Object(V.a)(S);function S(I){var w;Object(he.a)(this,S),w=g.call(this,I);var A=window.document;return w.node=A.createElement("div"),A.body.appendChild(w.node),w}return Object(Y.a)(S,[{key:"render",value:function(){var w=this.props.children;return Object(W.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),S}(R.a.Component)},Nmxd:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ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lFWyYFJ7jUDnC7UHU1iz7qurxBlmDlrxlb5Pl5z8iC8LIVuHmjoueEtqjvddBwDa6JWHCQlnwyjjAu7wtxjPRK+4Ta7Y6XPskpvDqJLUdoMdTWTJOX9kWs+2bL9pN89U3GTdn3WKKxpvTmRuWglmPpKOtK91IiQ73vvJFL/YCa5UbLaVaDzXXTP2p4tmjvGREYnbruOgrn7MwKvlEg9gvLpG1E2000ntKNh5O82EznQobvkVF9S732LIgus6rg0RHTNCsdYJA7oWB7jLJdlOIxzfUwwbTHY+zSy+ccldAkbtRjimThroCYAzA46bqUl6JmxOh+IH8mbq1K65NXLuIIAnymqAMQbyNRrhtvT0qkQgqe4lRof7RHKdEe6Y9XEe0NVDBLzsnrMwcmbp/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(Pe,Re,$){"use strict";var he=$("U8pU"),Y=$("VTBJ"),k=$("Ff2n"),V=$("q1tI"),_=$("uciX"),R=$("7ixt"),W=function(I){var w=I.overlay,A=I.prefixCls,C=I.id,h=I.overlayInnerStyle;return V.createElement("div",{className:"".concat(A,"-inner"),id:C,role:"tooltip",style:h},typeof w=="function"?w():w)},F=W,O=function(I,w){var A=I.overlayClassName,C=I.trigger,h=C===void 0?["hover"]:C,o=I.mouseEnterDelay,s=o===void 0?0:o,u=I.mouseLeaveDelay,y=u===void 0?.1:u,m=I.overlayStyle,p=I.prefixCls,D=p===void 0?"rc-tooltip":p,b=I.children,c=I.onVisibleChange,d=I.afterVisibleChange,l=I.transitionName,a=I.animation,v=I.placement,f=v===void 0?"right":v,E=I.align,P=E===void 0?{}:E,H=I.destroyTooltipOnHide,Q=H===void 0?!1:H,re=I.defaultVisible,z=I.getTooltipContainer,U=I.overlayInnerStyle,ae=Object(k.a)(I,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),fe=Object(V.useRef)(null);Object(V.useImperativeHandle)(w,function(){return fe.current});var ge=Object(Y.a)({},ae);"visible"in I&&(ge.popupVisible=I.visible);var Ee=function(){var we=I.arrowContent,ve=we===void 0?null:we,j=I.overlay,T=I.id;return[V.createElement("div",{className:"".concat(D,"-arrow"),key:"arrow"},ve),V.createElement(F,{key:"content",prefixCls:D,id:T,overlay:j,overlayInnerStyle:U})]},Ne=!1,Se=!1;if(typeof Q=="boolean")Ne=Q;else if(Q&&Object(he.a)(Q)==="object"){var Ie=Q.keepParent;Ne=Ie===!0,Se=Ie===!1}return V.createElement(_.a,Object.assign({popupClassName:A,prefixCls:D,popup:Ee,action:h,builtinPlacements:R.a,popupPlacement:f,ref:fe,popupAlign:P,getPopupContainer:z,onPopupVisibleChange:c,afterPopupVisibleChange:d,popupTransitionName:l,popupAnimation:a,defaultPopupVisible:re,destroyPopupOnHide:Ne,autoDestroy:Se,mouseLeaveDelay:y,popupStyle:m,mouseEnterDelay:s},ge),b)},M=Object(V.forwardRef)(O),g=Re.a=M},Ohmc:function(Pe,Re,$){Pe.exports=$.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Pe,Re,$){"use strict";var he=$("2qtc"),Y=$("kLXV"),k=$("rAM+"),V=$("miYZ"),_=$("tsqr"),R=$("9og8"),W=$("tJVT"),F=$("jrin"),O=$("WmNS"),M=$.n(O),g=$("q1tI"),S=$.n(g),I=$("VrN/"),w=$.n(I),A=$("bdgK"),C=$("p77/"),h=$("Bd2K"),o=$("ELLl"),s=$("19Vz"),u=$("lZu9"),y=$("+NIl"),m=$("kSUc"),p=$("9Bee"),D=function(me){var ye=me.value,Le=ye===void 0?"":ye,He=me.className,et=me.showTextOnly,rt=me.showLines,vt=me.style,st=vt===void 0?{}:vt,nt=Object(g.useMemo)(function(){return""},[Le]);return S.a.createElement(S.a.Fragment,null,S.a.createElement("div",{dangerouslySetInnerHTML:{__html:nt}}))},b=$("0Owb"),c=$("dejd"),d=$("C+DQ"),l=$("1vsH"),a=$("m3rI"),v=[{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 f(me){var ye=me.onActionCallback,Le=me.title,He=me.icon,et=me.actionName,rt=me.className,vt=rt===void 0?"":rt,st=me.children;function nt(){ye(et)}return S.a.createElement("a",{title:Le,className:vt,onClick:nt},S.a.createElement("i",{className:"md-iconfont ".concat(He)}),st)}var E=function(me){var ye=me.watch,Le=me.showNullButton,He=me.onActionCallback,et=me.fullScreen,rt=me.insertTemp,vt=me.hidetoolBar,st=me.uuid,nt=me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(l.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(l.F)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Tt=[].concat(v,[{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 S.a.createElement("ul",{className:"markdown-toolbar-container"},!vt&&Tt.map(function(Et,_t){return S.a.createElement("li",{key:_t},Et.actionName?S.a.createElement(f,Object(b.a)({},Et,{onActionCallback:He})):S.a.createElement("span",{className:"v-line"}))}),Le?S.a.createElement("li",null,S.a.createElement(f,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:He},S.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,rt&&S.a.createElement("li",null,S.a.createElement(f,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(rt),onActionCallback:He},S.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),S.a.createElement("li",{className:"btn-full-screen"},S.a.createElement(f,{icon:"".concat(et?"icon-shrink":"icon-enlarge"),title:et?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:He})))},P=$("M8RZ"),H=$("+L6B"),Q=$("2/Rp"),re=$("y8nQ"),z=$("Vl3Y"),U=$("5NDa"),ae=$("5rEg"),fe={labelCol:{span:4},wrapperCol:{span:20}},ge=function(me){var ye=me.callback,Le=me.onCancel;function He(et){ye(et)}return S.a.createElement(z.a,Object(b.a)({},fe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:He}),S.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},S.a.createElement(ae.a,null)),S.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},S.a.createElement(ae.a,null)),S.a.createElement("div",{className:"flex-container flex-end"},S.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(Q.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},Ee=$("7ahc"),Ne=$("HmJG"),Se=$("BjJ7"),Ie=z.a.useForm,Ae={width:280,marginRight:10},we={labelCol:{span:5},wrapperCol:{span:19}},ve=function(me){var ye=me.callback,Le=me.onCancel,He=Ie(),et=Object(W.a)(He,1),rt=et[0];function vt(Tt){ye(Tt)}function st(Tt,Et){if(Tt.status===-1){_.b.error(Tt.message);return}rt.setFieldsValue({src:"/api/attachments/".concat(Tt.id),type:Et.type})}function nt(Tt){var Et=Tt.target.files[0];T(Et,st)}return S.a.createElement(z.a,Object(b.a)({form:rt},we,{className:"upload-image-panel",onFinish:vt}),S.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},S.a.createElement("div",{className:"flex-container"},S.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},S.a.createElement(ae.a,{style:Ae})),S.a.createElement(j,{onFileChange:nt}))),S.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},S.a.createElement(ae.a,{style:{width:264}})),S.a.createElement(z.a.Item,{style:{textAlign:"right"}},S.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(Q.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))};function j(me){var ye=me.onFileChange;return S.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",S.a.createElement("input",{type:"file",onChange:ye}))}function T(me,ye){if(!me)throw new String("\u6CA1\u6709\u6587\u4EF6");var Le=new FormData;Le.append("editormd-image-file",me),Le.append("file_param_name","editormd-image-file"),Le.append("byxhr","true");var He=new window.XMLHttpRequest;He.withCredentials=!0,He.addEventListener("load",function(et){ye(JSON.parse(et.target.responseText),me)},!1),He.addEventListener("error",function(et){console.error(et)},!1),He.open("POST","".concat(Se.a,"/api/attachments.json")),He.send(Le)}var L=$("giR+"),G=$("fyUT"),q=$("7Kak"),N=$("9yH6"),ue=N.a.Group,be={margin:"0 8px"},Te=function(me){var ye=me.callback,Le=me.onCancel;function He(et){ye(et)}return S.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:He},S.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},S.a.createElement("span",{style:be},"\u5355\u5143\u683C\u6570\uFF1A"),S.a.createElement("span",{style:be},"\u884C\u6570"),S.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},S.a.createElement(G.a,null)),S.a.createElement("span",{style:be},"\u5217\u6570"),S.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},S.a.createElement(G.a,null))),S.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},S.a.createElement("span",{style:be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),S.a.createElement(z.a.Item,{name:"align"},S.a.createElement(ue,null,S.a.createElement(N.a,{value:"default"},S.a.createElement("i",{className:"fa fa-align-justify"})),S.a.createElement(N.a,{value:"left"},S.a.createElement("i",{className:"fa fa-align-left"})),S.a.createElement(N.a,{value:"center"},S.a.createElement("i",{className:"fa fa-align-center"})),S.a.createElement(N.a,{value:"right"},S.a.createElement("i",{className:"fa fa-align-right"}))))),S.a.createElement("div",{className:"flex-container flex-end"},S.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(Q.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},Be=$("ErOA"),ke=$("7Cbv"),Oe="link",_e="upload-image",Ge="code-block",Ve="add-table",Qe="------------",Ye={default:Qe,left:":".concat(Qe),center:":".concat(Qe,":"),right:"".concat(Qe,":")},ot=$("9VGf"),Xe,Ze;function De(){}var it=0,$e=1e4,oe="\u2581",Z=`
**\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 J(me){return/^\d+$/.test(me)?"".concat(me,"px"):me}var ne=navigator.platform.toUpperCase().indexOf("MAC")>=0,se=ne?"Cmd":"Ctrl",ee=["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"],ie=(Xe={},Object(F.a)(Xe,se+"-B","bold"),Object(F.a)(Xe,se+"-I","italic"),Xe),le=(Ze={},Object(F.a)(Ze,Oe,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Ze,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Ze,_e,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Ze,Ve,"\u6DFB\u52A0\u8868\u683C"),Ze),de=Re.a=function(me){var ye=me.defaultValue,Le=ye===void 0?"":ye,He=me.onChange,et=me.width,rt=et===void 0?"100%":et,vt=me.height,st=vt===void 0?400:vt,nt=me.miniToolbar,Tt=nt===void 0?!1:nt,Et=me.isFocus,_t=Et===void 0?!1:Et,Mt=me.watch,xt=me.insertTemp,mr=me.mode,Sr=mr===void 0?"markdown":mr,Yt=me.id,gr=Yt===void 0?"markdown-editor-id":Yt,cr=me.showResizeBar,zr=cr===void 0?!1:cr,Xt=me.noStorage,Br=Xt===void 0?!1:Xt,ti=me.showNullButton,Ot=ti===void 0?!1:ti,Je=me.hidetoolBar,St=Je===void 0?!1:Je,Jt=me.fullScreen,mt=Jt===void 0?!1:Jt,pt=me.onBlur,wt=me.onCMBeforeChange,vr=me.onFullScreen,Ft=me.className,Fe=Ft===void 0?"":Ft,dt=me.disablePaste,ri=dt===void 0?!1:dt,bi=me.placeholder,Ei=bi===void 0?"":bi,ii=me.values,xi=ii===void 0?"":ii,ft=Object(g.useState)(null),Dn=Object(W.a)(ft,2),We=Dn[0],Ci=Dn[1],xr=Object(g.useState)(Le),Ki=Object(W.a)(xr,2),ni=Ki[0],Ar=Ki[1],Vi=Object(g.useState)(Mt),Qi=Object(W.a)(Vi,2),Tr=Qi[0],Yi=Qi[1],Ln=Object(g.useState)(mt),Xi=Object(W.a)(Ln,2),wr=Xi[0],kn=Xi[1],aa=Object(g.useState)(""),Ji=Object(W.a)(aa,2),rr=Ji[0],Kr=Ji[1],oa=Object(g.useState)(0),ai=Object(W.a)(oa,2),Dr=ai[0],Zi=ai[1],sa=Object(g.useState)(st),Rn=Object(W.a)(sa,2),In=Rn[0],Si=Rn[1],Mn=Object(g.useState)(!1),On=Object(W.a)(Mn,2),la=On[0],Ai=On[1],oi=Object(g.useRef)(Object(ke.a)()),si=Object(g.useRef)(!1),Ti=Object(g.useRef)(),Nr=Object(g.useRef)(),Ur=Object(g.useRef)(),Fr=Object(g.useRef)(),wi=Object(g.useRef)(),Pn=function(){var at=Object(R.a)(M.a.mark(function ct(){var ut,yt;return M.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return Rt.next=2,Object(Be.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:yt=Rt.sent,yt!=null&&(ut=yt.attachments)!==null&&ut!==void 0&&ut.length&&(console.log("cm:",We,Nr),yt.attachments.map(function(Ct){Ct.content_type.indexOf("image")>-1?We.replaceSelection("![,](/api/attachments/".concat(Ct.id,"?type=").concat(Ct.content_type,")")):Ct.content_type.indexOf("video")>-1?We.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ct.content_type.indexOf("pdf")>-1?We.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Ct.id,"?type=").concat(Ct.content_type,'&disposition=inline" target="_blank">').concat(Ct.name,"</a>")):We.replaceSelection("[".concat(Ct.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ct.id,"?type=").concat(Ct.content_type,")"))}));case 4:case"end":return Rt.stop()}},ct)}));return function(){return at.apply(this,arguments)}}();Object(g.useEffect)(function(){Ar(xi),We==null||We.setValue(xi)},[xi]),Object(g.useEffect)(function(){vr==null||vr(wr)},[wr]),Object(g.useEffect)(function(){if(Nr.current){var at=w.a.fromTextArea(Nr.current,{mode:Sr,lineNumbers:!Tt,lineWrapping:!0,value:Le,autoCloseTags:!0,autoCloseBrackets:!0});_t&&at.focus();function ct(ut,yt){if(ri){yt.preventDefault();return}var At=yt.clipboardData;if(At){var Rt=At.types.toString(),Ct=At.items;if(Rt==="Files"||At.types.indexOf("Files")>-1){if(yt.preventDefault(),Sr=="stex")return;try{var Ht,ar=Ct[1];((Ht=Ct[0])===null||Ht===void 0?void 0:Ht.kind)==="file"&&(ar=Ct[0]);var bt=ar.getAsFile(),Wr=bt.name.split(".").pop();T(bt,function(Dt){if(Dt.id){var or,$t,Cr;(bt==null||((or=bt.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?at.replaceSelection("![,](/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type,")")):(bt==null||(($t=bt.type)===null||$t===void 0)?void 0:$t.indexOf("video"))>-1?at.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'"></video>')):(bt==null||((Cr=bt.type)===null||Cr===void 0)?void 0:Cr.indexOf("pdf"))>-1?at.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(bt.type,'&disposition=inline" target="_blank">').concat(bt.name,"</a>")):ee.includes(Wr)?at.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'?type=office&disposition=inline" target="_blank">').concat(bt.name,"</a>")):at.replaceSelection("[".concat(bt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}else(Dt==null?void 0:Dt.status)===401&&(document.location.href="/user/login")})}catch(Dt){_.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return at.on("paste",ct),at.on("dragleave",function(ut,yt){Ur.current.classList.remove("mouse-hover-md")}),at.on("dragover",function(ut,yt){Ur.current.classList.add("mouse-hover-md")}),at.on("drop",function(ut,yt){Ur.current.classList.add("mouse-hover-md");var At;if(At=yt.dataTransfer.files,At.length>0){yt.preventDefault(),yt.stopPropagation();for(var Rt=function(ar){var bt=At[ar],Wr=bt.name.split(".").pop();T(bt,function(Dt){if(Dt.id){var or,$t,Cr;(bt==null||((or=bt.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?at.replaceSelection("![,](/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type,")")):(bt==null||(($t=bt.type)===null||$t===void 0)?void 0:$t.indexOf("video"))>-1?at.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'"></video>')):(bt==null||((Cr=bt.type)===null||Cr===void 0)?void 0:Cr.indexOf("pdf"))>-1?at.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(bt.type,'&disposition=inline" target="_blank">').concat(bt.name,"</a>")):ee.includes(Wr)?at.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,'?type=office&disposition=inline" target="_blank">').concat(bt.name,"</a>")):at.replaceSelection("[".concat(bt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}else(Dt==null?void 0:Dt.status)===401&&(document.location.href="/user/login")})},Ct=0;Ct<At.length;Ct++)Rt(Ct)}}),Ci(at),function(){at.off("paste",ct)}}},[]);var yr=Object(g.useCallback)(function(){if(Ur.current)try{}catch(at){console.log(at,"---- to set md editor body height")}},[In,Ur,wr]);Object(g.useEffect)(function(){function at(){var ut=new A.default(function(yt){var At=Object(k.a)(yt),Rt;try{for(At.s();!(Rt=At.n()).done;){var Ct=Rt.value;(Ct.target.offsetHeight>0||Ct.target.offsetWidth>0)&&(yr(),We.setSize("100%","100%"),We.refresh())}}catch(Ht){At.e(Ht)}finally{At.f()}});return ut.observe(Nr.current.parentElement),ut}if(We){var ct=at();return function(){ct.unobserve(Nr.current.parentElement)}}},[We,yr]),Object(g.useEffect)(function(){if(We){for(var at=[],ct=function(){var Ct=yt[ut];At=Object(W.a)(Ct,2);var Ht=At[0],ar=At[1],bt=Object(F.a)({},Ht,function(){_n(ar)});at.push(bt),We.addKeyMap(bt)},ut=0,yt=Object.entries(ie);ut<yt.length;ut++){var At;ct()}return Ti.current=setInterval(function(){si.current&&Pn()},4e3),function(){clearInterval(Ti.current);var Rt=Object(k.a)(at),Ct;try{for(Rt.s();!(Ct=Rt.n()).done;){var Ht=Ct.value;We.removeKeyMap(Ht)}}catch(ar){Rt.e(ar)}finally{Rt.f()}}}},[We]),Object(g.useEffect)(function(){mt!==wr&&kn(mt)},[mt]),Object(ot.a)(function(){if(!Br&&Dr>0){var at=new Date().getTime(),ct=window.sessionStorage.getItem(gr);at>=Dr+$e&&(!ct||ct!==ni)&&(window.sessionStorage.setItem(gr,ni),Ai(!0))}},$e),Object(g.useEffect)(function(){Yi(Mt)},[We,Mt]),Object(g.useEffect)(function(){We&&(_t&&We.focus())},[We,_t]),Object(g.useEffect)(function(){if(Tr&&We){var at=We.getScrollerElement();function ct(ut){var yt=ut.target;if(wi.current){var At=yt.scrollTop/yt.scrollHeight;wi.current.scrollTop=wi.current.scrollHeight*At}}return at.addEventListener("scroll",ct),function(){at.removeEventListener("scroll",ct)}}},[We,Tr]),Object(g.useEffect)(function(){if(We&&wt){function at(ct,ut){wt(ct,ut)}return We.on("beforeChange",at),function(){We.off("beforeChange",at)}}},[We,wt]),Object(g.useEffect)(function(){if(We&&pt){function at(){pt(We.getValue())}return We.on("blur",at),function(){We.off("blur",at)}}},[We,pt]),Object(g.useEffect)(function(){if(We){function at(ct){var ut=ct.getValue();Ar(ut),Zi(new Date().getTime()),ct.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),He&&He(ut)}return We.on("change",at),function(){We.off("change",at)}}},[We,He]),Object(g.useEffect)(function(){We&&(Le==null?(We.setValue(""),Ar("")):Le!==We.getValue()&&(We.setValue(Le),Ar(Le),We.setCursor(We.lineCount(),0)))},[We,Le]);var _n=Object(g.useCallback)(function(at){var ct=We.getCursor(),ut=We.getSelection(),yt=ut.split(`
`);switch(at){case"bold":return We.replaceSelection("**"+ut+"**"),ut===""&&We.setCursor(ct.line,ct.ch+2),We.focus();case"italic":return We.replaceSelection("*"+ut+"*"),ut===""&&We.setCursor(ct.line,ct.ch+1),We.focus();case"code":return We.replaceSelection("`"+ut+"`"),ut===""&&We.setCursor(ct.line,ct.ch+1),We.focus();case"inline-latex":return We.replaceSelection("`$$"+ut+"$$`"),ut===""&&We.setCursor(ct.line,ct.ch+3),We.focus();case"latex":return We.replaceSelection("```latex\n"+ut+"\n```"),We.setCursor(ct.line+1,ut.length+1),We.focus();case"line-break":return We.replaceSelection(`<br/>
`),We.focus();case"list-ul":return ut===""?We.replaceSelection("- "+ut):We.replaceSelection(yt.map(function(At){return At===""?"":"- ".concat(At)}).join(`
`)),We.focus();case"list-ol":return ut===""?We.replaceSelection("1. "+ut):We.replaceSelection(yt.map(function(At,Rt){return At===""?"":"".concat(Rt+1,". ").concat(At)}).join(`
`)),We.focus();case"add-null-ch":return ut===""&&We.setCursor(ct.line,ct.ch+1),We.replaceSelection(oe),We.focus();case"inster-template-1":return ut===""&&We.setCursor(ct.line,ct.ch),We.replaceSelection(Z),We.focus();case"eraser":return We.setValue(""),We.focus();case"trigger-watch":return Yi(!Tr),We.focus();case"trigger-full-screen":return kn(!wr),We.focus();case Oe:Kr(Oe);return;case Ge:Kr(Ge);return;case _e:Kr(_e);return;case Ve:Kr(Ve);return;default:throw new Error}},[We,Tr,wr]),Di=Object(g.useCallback)(function(at){Kr("");switch(rr){case Oe:var ct=at.title,ut=at.link;return We.replaceSelection("[".concat(ct,"](").concat(ut,")")),We.focus();case Ge:var yt=at.language,At=at.content;return We.replaceSelection(["```"+yt,At,"```"].join(`
`)),We.focus();case _e:var Rt=at.src,Ct=at.alt;return Ct?We.replaceSelection("![ ".concat(Ct," ]( ").concat(Rt,' "').concat(Ct,'" )')):We.replaceSelection("![,](".concat(Rt,")")),We.focus();case Ve:for(var Ht=at.row,ar=at.col,bt=at.align,Wr=`
`,Dt=0;Dt<Ht;Dt++){for(var or=[],$t=[],Cr=0;Cr<ar;Cr++)Dt===1&&$t.push(Ye[bt]),or.push(" ");Dt===1&&(Wr+="| ".concat($t.join(" | "),` |
`)),Wr+="| ".concat(or.join(ar===1?"":" | "),` |
`)}return We.replaceSelection(Wr+`
`),We.focus();default:throw new Error}},[We,rr]),qi=Object(g.useMemo)(function(){switch(rr){case Oe:return S.a.createElement(ge,{callback:Di,onCancel:Vr});case Ge:return S.a.createElement(Ee.b,{callback:Di,onCancel:Vr});case _e:return S.a.createElement(ve,{callback:Di,onCancel:Vr});case Ve:return S.a.createElement(Te,{callback:Di,onCancel:Vr});default:return null}},[rr]);function Vr(){Kr("")}Object(g.useEffect)(function(){if(Fr.current){var at=Fr.current,ct=!1,ut=0;function yt(Ct){ct=!0,ut=Ct.pageY}function At(){ct=!1}function Rt(Ct){if(ct){var Ht=Ct.pageY-ut;Ht<0&&(Ht=0),Ht>300&&(Ht=300);var ar=st+Ht+"px";Si(ar)}}return at.addEventListener("mousedown",yt),document.addEventListener("mousemove",Rt),document.addEventListener("mouseup",At),function(){at.removeEventListener("mousedown",yt),document.removeEventListener("mousemove",Rt),document.removeEventListener("mouseup",At)}}},[We,Fr]),Object(g.useEffect)(function(){Si(st)},[st]);var Mr=J(rt),$i=J(In),Lr={width:Mr,height:$i},en=Object(g.useMemo)(function(){if(Dr){var at=new Date(Dr),ct=at.getHours(),ut=at.getMinutes(),yt=at.getSeconds();return ct=ct<10?"0"+ct:ct,ut=ut<10?"0"+ut:ut,yt=yt<10?"0"+yt:yt,"".concat(ct,":").concat(ut,":").concat(yt)}return 0},[Dr]);function Bn(){window.sessionStorage.removeItem(gr),Ai(!1),Zi(0)}function li(){Ai(!1),Zi(0),We.setValue(window.sessionStorage.getItem(gr))}function ua(at,ct){var ut=We.getValue();ut=ut.replace(at,ct),Ar(ut),We==null||We.setValue(ut)}return S.a.createElement(g.Fragment,null,S.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ur},S.a.createElement("div",{className:"markdown-editor-container ".concat(Fe," ").concat(Tr?"on-preview":""," ").concat(Tt?"mini":""," ").concat(wr?"full-screen":""),style:Lr},S.a.createElement(E,{insertTemp:xt,watch:Tr,fullScreen:wr,showNullButton:Ot,onActionCallback:_n,hidetoolBar:St,uuid:oi.current,setOpenPhones:function(){si.current=!0}}),S.a.createElement("div",{className:"markdown-editor-body"},S.a.createElement("div",{className:"codemirror-container"},S.a.createElement("textarea",{ref:Nr,placeholder:Ei})),Tr?S.a.createElement("div",{ref:wi,className:"preview-container"},Sr==="stex"&&S.a.createElement(D,{value:ni}),Sr!=="stex"&&S.a.createElement(p.a,{edit:!0,value:ni,replaces:ua})):null))),zr?S.a.createElement("a",{ref:Fr,className:"editor-resize"}):null,S.a.createElement(P.a,null,le[rr]?S.a.createElement(Y.a,{centered:!0,title:le[rr],visible:!0,onCancel:Vr,footer:null,className:"markdown-popup-form"},qi):null))}},RMFE:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0QIEAgKiDQ0cNYiwABAgLtGyBAgEBUQKCjh7EWAQIEBNo3QIAAgaiAQEcPYy0CBAh8/5Tg6+vrp3/q7wgQIEDgPwKfz+c/v92v/Ac9CxMBAgRSAgKdOodlCBAgMAGBnoWJAAECKQGBTp3DMgQIEJiAQM/CRIAAgZSAQKfOYRkCBAhMQKBnYSJAgE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z/dJvP5/PTP/V3BAgQIHAg4D/oA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Pe,Re){/**
* @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 $,he,Y,k=!1,V,_;window.PR_SHOULD_USE_CONTINUATION=!0;var R,W;(function(){var F=window,O=["break,continue,do,else,for,if,return,while"],M=[O,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],S=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],I=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],A="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",C=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",o=[O,"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"],s=[O,"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"],u=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],y=[S,w,I,C,h,o,s,u],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",D="kwd",b="com",c="typ",d="lit",l="pun",a="pln",v="tag",f="dec",E="src",P="atn",H="atv",Q="nocode",re="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(ue){for(var be=0,Te=!1,Be=!1,ke=0,Oe=ue.length;ke<Oe;++ke){var _e=ue[ke];if(_e.ignoreCase)Be=!0;else if(/[a-z]/i.test(_e.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Te=!0,Be=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(Ze){var De=Ze.charCodeAt(0);if(De!==92)return De;var it=Ze.charAt(1);return De=Ge[it],De||("0"<=it&&it<="7"?parseInt(Ze.substring(1),8):it==="u"||it==="x"?parseInt(Ze.substring(2),16):Ze.charCodeAt(1))}function Qe(Ze){if(Ze<32)return(Ze<16?"\\x0":"\\x")+Ze.toString(16);var De=String.fromCharCode(Ze);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function Ye(Ze){var De=Ze.substring(1,Ze.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")),it=[],$e=De[0]==="^",oe=["["];$e&&oe.push("^");for(var Z=$e?1:0,J=De.length;Z<J;++Z){var ne=De[Z];if(/\\[bdsw]/i.test(ne))oe.push(ne);else{var se=Ve(ne),ee;Z+2<J&&De[Z+1]==="-"?(ee=Ve(De[Z+2]),Z+=2):ee=se,it.push([se,ee]),ee<65||se>122||(ee<65||se>90||it.push([Math.max(65,se)|32,Math.min(ee,90)|32]),ee<97||se>122||it.push([Math.max(97,se)&~32,Math.min(ee,122)&~32]))}}it.sort(function(me,ye){return me[0]-ye[0]||ye[1]-me[1]});for(var ie=[],le=[],Z=0;Z<it.length;++Z){var de=it[Z];de[0]<=le[1]+1?le[1]=Math.max(le[1],de[1]):ie.push(le=de)}for(var Z=0;Z<ie.length;++Z){var de=ie[Z];oe.push(Qe(de[0])),de[1]>de[0]&&(de[1]+1>de[0]&&oe.push("-"),oe.push(Qe(de[1])))}return oe.push("]"),oe.join("")}function ot(Ze){for(var De=Ze.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")),it=De.length,$e=[],oe=0,Z=0;oe<it;++oe){var J=De[oe];if(J==="(")++Z;else if(J.charAt(0)==="\\"){var ne=+J.substring(1);ne&&(ne<=Z?$e[ne]=-1:De[oe]=Qe(ne))}}for(var oe=1;oe<$e.length;++oe)$e[oe]===-1&&($e[oe]=++be);for(var oe=0,Z=0;oe<it;++oe){var J=De[oe];if(J==="(")++Z,$e[Z]||(De[oe]="(?:");else if(J.charAt(0)==="\\"){var ne=+J.substring(1);ne&&ne<=Z&&(De[oe]="\\"+$e[ne])}}for(var oe=0;oe<it;++oe)De[oe]==="^"&&De[oe+1]!=="^"&&(De[oe]="");if(Ze.ignoreCase&&Te)for(var oe=0;oe<it;++oe){var J=De[oe],se=J.charAt(0);J.length>=2&&se==="["?De[oe]=Ye(J):se!=="\\"&&(De[oe]=J.replace(/[a-zA-Z]/g,function(le){var de=le.charCodeAt(0);return"["+String.fromCharCode(de&~32,de|32)+"]"}))}return De.join("")}for(var Xe=[],ke=0,Oe=ue.length;ke<Oe;++ke){var _e=ue[ke];if(_e.global||_e.multiline)throw new Error(""+_e);Xe.push("(?:"+ot(_e)+")")}return new RegExp(Xe.join("|"),Be?"gi":"g")}function U(ue,be){var Te=/(?:^|\s)nocode(?:\s|$)/,Be=[],ke=0,Oe=[],_e=0;function Ge(Ve){var Qe=Ve.nodeType;if(Qe==1){if(Te.test(Ve.className))return;for(var Ye=Ve.firstChild;Ye;Ye=Ye.nextSibling)Ge(Ye);var ot=Ve.nodeName.toLowerCase();(ot==="br"||ot==="li")&&(Be[_e]=`
`,Oe[_e<<1]=ke++,Oe[_e++<<1|1]=Ve)}else if(Qe==3||Qe==4){var Xe=Ve.nodeValue;Xe.length&&(be?Xe=Xe.replace(/\r\n?/g,`
`):Xe=Xe.replace(/[ \t\r\n]+/g," "),Be[_e]=Xe,Oe[_e<<1]=ke,ke+=Xe.length,Oe[_e++<<1|1]=Ve)}}return Ge(ue),{sourceCode:Be.join("").replace(/\n$/,""),spans:Oe}}function ae(ue,be,Te,Be,ke){if(!Te)return;var Oe={sourceNode:ue,pre:1,langExtension:null,numberLines:null,sourceCode:Te,spans:null,basePos:be,decorations:null};Be(Oe),ke.push.apply(ke,Oe.decorations)}var fe=/\S/;function ge(ue){for(var be=void 0,Te=ue.firstChild;Te;Te=Te.nextSibling){var Be=Te.nodeType;be=Be===1?be?ue:Te:Be===3&&fe.test(Te.nodeValue)?ue:be}return be===ue?void 0:be}function Ee(ue,be){var Te={},Be;(function(){for(var _e=ue.concat(be),Ge=[],Ve={},Qe=0,Ye=_e.length;Qe<Ye;++Qe){var ot=_e[Qe],Xe=ot[3];if(Xe)for(var Ze=Xe.length;--Ze>=0;)Te[Xe.charAt(Ze)]=ot;var De=ot[1],it=""+De;Ve.hasOwnProperty(it)||(Ge.push(De),Ve[it]=null)}Ge.push(/[\0-\uffff]/),Be=z(Ge)})();var ke=be.length,Oe=function(_e){for(var Ge=_e.sourceCode,Ve=_e.basePos,Qe=_e.sourceNode,Ye=[Ve,a],ot=0,Xe=Ge.match(Be)||[],Ze={},De=0,it=Xe.length;De<it;++De){var $e=Xe[De],oe=Ze[$e],Z=void 0,J;if(typeof oe=="string")J=!1;else{var ne=Te[$e.charAt(0)];if(ne)Z=$e.match(ne[1]),oe=ne[0];else{for(var se=0;se<ke;++se)if(ne=be[se],Z=$e.match(ne[1]),Z){oe=ne[0];break}Z||(oe=a)}J=oe.length>=5&&oe.substring(0,5)==="lang-",J&&!(Z&&typeof Z[1]=="string")&&(J=!1,oe=E),J||(Ze[$e]=oe)}var ee=ot;if(ot+=$e.length,!J)Ye.push(Ve+ee,oe);else{var ie=Z[1],le=$e.indexOf(ie),de=le+ie.length;Z[2]&&(de=$e.length-Z[2].length,le=de-ie.length);var me=oe.substring(5);ae(Qe,Ve+ee,$e.substring(0,le),Oe,Ye),ae(Qe,Ve+ee+le,ie,j(me,ie),Ye),ae(Qe,Ve+ee+de,$e.substring(de),Oe,Ye)}}_e.decorations=Ye};return Oe}function Ne(ue){var be=[],Te=[];ue.tripleQuotedStrings?be.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ue.multiLineStrings?be.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):be.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ue.verbatimStrings&&Te.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Be=ue.hashComments;Be&&(ue.cStyleComments?(Be>1?be.push([b,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):be.push([b,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Te.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):be.push([b,/^#[^\r\n]*/,null,"#"])),ue.cStyleComments&&(Te.push([b,/^\/\/[^\r\n]*/,null]),Te.push([b,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ke=ue.regexLiterals;if(ke){var Oe=ke>1?"":`
\r`,_e=Oe?".":"[\\S\\s]",Ge="/(?=[^/*"+Oe+"])(?:[^/\\x5B\\x5C"+Oe+"]|\\x5C"+_e+"|\\x5B(?:[^\\x5C\\x5D"+Oe+"]|\\x5C"+_e+")*(?:\\x5D|$))+/";Te.push(["lang-regex",RegExp("^"+re+"("+Ge+")")])}var Ve=ue.types;Ve&&Te.push([c,Ve]);var Qe=(""+ue.keywords).replace(/^ | $/g,"");Qe.length&&Te.push([D,new RegExp("^(?:"+Qe.replace(/[\s,]+/g,"|")+")\\b"),null]),be.push([a,/^\s+/,null,` \r
\xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return ue.regexLiterals&&(Ye+="(?!s*/)"),Te.push([d,/^@[a-z_$][a-z_$@0-9]*/i,null],[c,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[d,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[l,new RegExp(Ye),null]),Ee(be,Te)}var Se=Ne({keywords:y,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ie(ue,be,Te){for(var Be=/(?:^|\s)nocode(?:\s|$)/,ke=/\r\n?|\n/,Oe=ue.ownerDocument,_e=Oe.createElement("li");ue.firstChild;)_e.appendChild(ue.firstChild);var Ge=[_e];function Ve(De){var it=De.nodeType;if(it==1&&!Be.test(De.className))if(De.nodeName==="br")Qe(De),De.parentNode&&De.parentNode.removeChild(De);else for(var $e=De.firstChild;$e;$e=$e.nextSibling)Ve($e);else if((it==3||it==4)&&Te){var oe=De.nodeValue,Z=oe.match(ke);if(Z){var J=oe.substring(0,Z.index);De.nodeValue=J;var ne=oe.substring(Z.index+Z[0].length);if(ne){var se=De.parentNode;se.insertBefore(Oe.createTextNode(ne),De.nextSibling)}Qe(De),J||De.parentNode.removeChild(De)}}}function Qe(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function it(Z,J){var ne=J?Z.cloneNode(!1):Z,se=Z.parentNode;if(se){var ee=it(se,1),ie=Z.nextSibling;ee.appendChild(ne);for(var le=ie;le;le=ie)ie=le.nextSibling,ee.appendChild(le)}return ne}for(var $e=it(De.nextSibling,0),oe;(oe=$e.parentNode)&&oe.nodeType===1;)$e=oe;Ge.push($e)}for(var Ye=0;Ye<Ge.length;++Ye)Ve(Ge[Ye]);be===(be|0)&&Ge[0].setAttribute("value",be);var ot=Oe.createElement("ol");ot.className="linenums";for(var Xe=Math.max(0,be-1|0)||0,Ye=0,Ze=Ge.length;Ye<Ze;++Ye)_e=Ge[Ye],_e.className="L"+(Ye+Xe)%10,_e.firstChild||_e.appendChild(Oe.createTextNode("\xA0")),ot.appendChild(_e);ue.appendChild(ot)}function Ae(ue){var be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);be=be&&+be[1]<=8;var Te=/\n/g,Be=ue.sourceCode,ke=Be.length,Oe=0,_e=ue.spans,Ge=_e.length,Ve=0,Qe=ue.decorations,Ye=Qe.length,ot=0;Qe[Ye]=ke;var Xe,Ze;for(Ze=Xe=0;Ze<Ye;)Qe[Ze]!==Qe[Ze+2]?(Qe[Xe++]=Qe[Ze++],Qe[Xe++]=Qe[Ze++]):Ze+=2;for(Ye=Xe,Ze=Xe=0;Ze<Ye;){for(var De=Qe[Ze],it=Qe[Ze+1],$e=Ze+2;$e+2<=Ye&&Qe[$e+1]===it;)$e+=2;Qe[Xe++]=De,Qe[Xe++]=it,Ze=$e}Ye=Qe.length=Xe;var oe=ue.sourceNode,Z="";oe&&(Z=oe.style.display,oe.style.display="none");try{for(var J=null;Ve<Ge;){var ne=_e[Ve],se=_e[Ve+2]||ke,ee=Qe[ot+2]||ke,$e=Math.min(se,ee),ie=_e[Ve+1],le;if(ie.nodeType!==1&&(le=Be.substring(Oe,$e))){be&&(le=le.replace(Te,"\r")),ie.nodeValue=le;var de=ie.ownerDocument,me=de.createElement("span");me.className=Qe[ot+1];var ye=ie.parentNode;ye.replaceChild(me,ie),me.appendChild(ie),Oe<se&&(_e[Ve+1]=ie=de.createTextNode(Be.substring($e,se)),ye.insertBefore(ie,me.nextSibling))}Oe=$e,Oe>=se&&(Ve+=2),Oe>=ee&&(ot+=2)}}finally{oe&&(oe.style.display=Z)}}var we={};function ve(ue,be){for(var Te=be.length;--Te>=0;){var Be=be[Te];we.hasOwnProperty(Be)?F.console&&console.warn("cannot override language handler %s",Be):we[Be]=ue}}function j(ue,be){return ue&&we.hasOwnProperty(ue)||(ue=/^\s*</.test(be)?"default-markup":"default-code"),we[ue]}ve(Se,["default-code"]),ve(Ee([],[[a,/^[^<?]+/],[f,/^<!\w[^>]*(?:>|$)/],[b,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[l,/^(?:<[%?]|[%?]>)/],["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"]),ve(Ee([[a,/^[\s]+/,null,` \r
`],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[l,/^[=<>\/]+/],["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"]),ve(Ee([],[[H,/^[\s\S]+/]]),["uq.val"]),ve(Ne({keywords:S,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),ve(Ne({keywords:"null,true,false"}),["json"]),ve(Ne({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),ve(Ne({keywords:I,cStyleComments:!0}),["java"]),ve(Ne({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve(Ne({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve(Ne({keywords:h,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(Ne({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(Ne({keywords:C,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve(Ne({keywords:A,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(Ee([],[[p,/^[\s\S]+/]]),["regex"]);function T(ue){var be=ue.langExtension;try{var Te=U(ue.sourceNode,ue.pre),Be=Te.sourceCode;ue.sourceCode=Be,ue.spans=Te.spans,ue.basePos=0,j(be,Be)(ue),Ae(ue)}catch(ke){F.console&&console.log(ke&&ke.stack||ke)}}function L(ue,be,Te){var Be=Te||!1,ke=be||null,Oe=document.createElement("div");Oe.innerHTML="<pre>"+ue+"</pre>",Oe=Oe.firstChild,Be&&Ie(Oe,Be,!0);var _e={langExtension:ke,numberLines:Be,sourceNode:Oe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return T(_e),Oe.innerHTML}function G(ue,be){var Te=be||document.body,Be=Te.ownerDocument||document;function ke(ne){return Te.getElementsByTagName(ne)}for(var Oe=[ke("pre"),ke("code"),ke("xmp")],_e=[],Ge=0;Ge<Oe.length;++Ge)for(var Ve=0,Qe=Oe[Ge].length;Ve<Qe;++Ve)_e.push(Oe[Ge][Ve]);Oe=null;var Ye=Date;Ye.now||(Ye={now:function(){return+new Date}});var ot=0,Xe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ze=/\bprettyprint\b/,De=/\bprettyprinted\b/,it=/pre|xmp/i,$e=/^code$/i,oe=/^(?:pre|code|xmp)$/i,Z={};function J(){for(var ne=F.PR_SHOULD_USE_CONTINUATION?Ye.now()+250:Infinity;ot<_e.length&&Ye.now()<ne;ot++){for(var se=_e[ot],ee=Z,ie=se;ie=ie.previousSibling;){var le=ie.nodeType,de=(le===7||le===8)&&ie.nodeValue;if(de?!/^\??prettify\b/.test(de):le!==3||/\S/.test(ie.nodeValue))break;if(de){ee={},de.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Mt,xt,mr){ee[xt]=mr});break}}var me=se.className;if((ee!==Z||Ze.test(me))&&!De.test(me)){for(var ye=!1,Le=se.parentNode;Le;Le=Le.parentNode){var He=Le.tagName;if(oe.test(He)&&Le.className&&Ze.test(Le.className)){ye=!0;break}}if(!ye){se.className+=" prettyprinted";var et=ee.lang;if(!et){et=me.match(Xe);var rt;!et&&(rt=ge(se))&&$e.test(rt.tagName)&&(et=rt.className.match(Xe)),et&&(et=et[1])}var vt;if(it.test(se.tagName))vt=1;else{var st=se.currentStyle,nt=Be.defaultView,Tt=st?st.whiteSpace:nt&&nt.getComputedStyle?nt.getComputedStyle(se,null).getPropertyValue("white-space"):0;vt=Tt&&Tt.substring(0,3)==="pre"}var Et=ee.linenums;(Et=Et==="true"||+Et)||(Et=me.match(/\blinenums\b(?::(\d+))?/),Et=Et?Et[1]&&Et[1].length?+Et[1]:!0:!1),Et&&Ie(se,Et,vt);var _t={langExtension:et,sourceNode:se,numberLines:Et,pre:vt,sourceCode:null,basePos:null,spans:null,decorations:null};T(_t)}}}ot<_e.length?F.setTimeout(J,250):typeof ue=="function"&&ue()}J()}var q=F.PR={createSimpleLexer:Ee,registerLangHandler:ve,sourceDecorator:Ne,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:H,PR_COMMENT:b,PR_DECLARATION:f,PR_KEYWORD:D,PR_LITERAL:d,PR_NOCODE:Q,PR_PLAIN:a,PR_PUNCTUATION:l,PR_SOURCE:E,PR_STRING:p,PR_TAG:v,PR_TYPE:c,prettyPrintOne:k?F.prettyPrintOne=L:R=L,prettyPrint:W=k?F.prettyPrint=G:W=G},N=F.define;typeof N=="function"&&N.amd&&N("google-code-prettify",[],function(){return q})})()},SMhR:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5I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JEkSeNEkiSNE0mSNE4kSdL4yZdrm28G5JO1zQ0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},STEk:function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return ve});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var he=function(j,T){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,G){L.__proto__=G}||function(L,G){for(var q in G)Object.prototype.hasOwnProperty.call(G,q)&&(L[q]=G[q])})(j,T)};function Y(j,T){function L(){this.constructor=j}he(j,T),j.prototype=T===null?Object.create(T):(L.prototype=T.prototype,new L)}function k(j,T,L,G){return new(L||(L=Promise))(function(q,N){function ue(Be){try{Te(G.next(Be))}catch(ke){N(ke)}}function be(Be){try{Te(G.throw(Be))}catch(ke){N(ke)}}function Te(Be){var ke;Be.done?q(Be.value):(ke=Be.value,ke instanceof L?ke:new L(function(Oe){Oe(ke)})).then(ue,be)}Te((G=G.apply(j,T||[])).next())})}function V(j,T){var L,G,q,N,ue={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return N={next:be(0),throw:be(1),return:be(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function be(Te){return function(Be){return function(ke){if(L)throw new TypeError("Generator is already executing.");for(;ue;)try{if(L=1,G&&(q=2&ke[0]?G.return:ke[0]?G.throw||((q=G.return)&&q.call(G),0):G.next)&&!(q=q.call(G,ke[1])).done)return q;switch(G=0,q&&(ke=[2&ke[0],q.value]),ke[0]){case 0:case 1:q=ke;break;case 4:return ue.label++,{value:ke[1],done:!1};case 5:ue.label++,G=ke[1],ke=[0];continue;case 7:ke=ue.ops.pop(),ue.trys.pop();continue;default:if(!(q=ue.trys,(q=q.length>0&&q[q.length-1])||ke[0]!==6&&ke[0]!==2)){ue=0;continue}if(ke[0]===3&&(!q||ke[1]>q[0]&&ke[1]<q[3])){ue.label=ke[1];break}if(ke[0]===6&&ue.label<q[1]){ue.label=q[1],q=ke;break}if(q&&ue.label<q[2]){ue.label=q[2],ue.ops.push(ke);break}q[2]&&ue.ops.pop(),ue.trys.pop();continue}ke=T.call(j,ue)}catch(Oe){ke=[6,Oe],G=0}finally{L=q=0}if(5&ke[0])throw ke[1];return{value:ke[0]?ke[1]:void 0,done:!0}}([Te,Be])}}}function _(){for(var j=0,T=0,L=arguments.length;T<L;T++)j+=arguments[T].length;var G=Array(j),q=0;for(T=0;T<L;T++)for(var N=arguments[T],ue=0,be=N.length;ue<be;ue++,q++)G[q]=N[ue];return G}var R=function(){function j(){}return j.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},j.setAttributes=function(T,L){for(var G=0,q=L;G<q.length;G++){var N=q[G],ue=N[0],be=N[1];T.setAttribute(ue,be)}},j.createRect=function(T,L,G){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",T.toString()),q.setAttribute("height",L.toString()),G&&j.setAttributes(q,G),q},j.createLine=function(T,L,G,q,N){var ue=document.createElementNS("http://www.w3.org/2000/svg","line");return ue.setAttribute("x1",T.toString()),ue.setAttribute("y1",L.toString()),ue.setAttribute("x2",G.toString()),ue.setAttribute("y2",q.toString()),N&&j.setAttributes(ue,N),ue},j.createPolygon=function(T,L){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",T),L&&j.setAttributes(G,L),G},j.createCircle=function(T,L){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("r",T.toString()),L&&j.setAttributes(G,L),G},j.createEllipse=function(T,L,G){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(T/2).toString()),q.setAttribute("cy",(L/2).toString()),q.setAttribute("rx",(T/2).toString()),q.setAttribute("ry",(L/2).toString()),G&&j.setAttributes(q,G),q},j.createGroup=function(T){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&j.setAttributes(L,T),L},j.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},j.createMarker=function(T,L,G,q,N,ue,be){var Te=document.createElementNS("http://www.w3.org/2000/svg","marker");return j.setAttributes(Te,[["id",T],["orient",L],["markerWidth",G.toString()],["markerHeight",q.toString()],["refX",N.toString()],["refY",ue.toString()]]),Te.appendChild(be),Te},j.createText=function(T){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),T&&j.setAttributes(L,T),L},j.createTSpan=function(T,L){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=T,L&&j.setAttributes(G,L),G},j.createImage=function(T){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&j.setAttributes(L,T),L},j.createPoint=function(T,L){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=T,G.y=L,G},j.createPath=function(T,L){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",T),L&&j.setAttributes(G,L),G},j}(),W=function(){function j(){}return j.addKey=function(T){j.key=T},Object.defineProperty(j,"isLicensed",{get:function(){return!!j.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(j.key)},enumerable:!1,configurable:!0}),j}(),F=function(){function j(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return j.prototype.rasterize=function(T,L,G){var q=this;return new Promise(function(N){var ue=G!==void 0?G:document.createElement("canvas");T===null&&(q.markersOnly=!0,q.naturalSize=!1);var be=document.createElementNS("http://www.w3.org/2000/svg","svg");be.setAttribute("xmlns","http://www.w3.org/2000/svg"),be.setAttribute("width",L.width.baseVal.valueAsString),be.setAttribute("height",L.height.baseVal.valueAsString),be.setAttribute("viewBox","0 0 "+L.viewBox.baseVal.width.toString()+" "+L.viewBox.baseVal.height.toString()),be.innerHTML=L.innerHTML,q.naturalSize===!0?(be.width.baseVal.value=T.naturalWidth,be.height.baseVal.value=T.naturalHeight):q.width!==void 0&&q.height!==void 0&&(be.width.baseVal.value=q.width,be.height.baseVal.value=q.height),ue.width=be.width.baseVal.value,ue.height=be.height.baseVal.value;var Te=be.outerHTML,Be=ue.getContext("2d");q.markersOnly!==!0&&Be.drawImage(T,0,0,ue.width,ue.height);var ke=window.URL,Oe=new Image(ue.width,ue.height);Oe.setAttribute("crossOrigin","anonymous");var _e=new Blob([Te],{type:"image/svg+xml"}),Ge=ke.createObjectURL(_e);Oe.onload=function(){Be.drawImage(Oe,0,0),ke.revokeObjectURL(Ge);var Ve=ue.toDataURL(q.imageType,q.imageQuality);N(Ve)},Oe.src=Ge})},j}(),O=function(){},M=function(){function j(T){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(j.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),j.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},j.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},j.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new S("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new S("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},j.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},j}(),g=function(j,T){this.selector=j,this.style=T},S=function(j,T){this.localName=j,this.style=T},I=function(){function j(T,L,G,q,N){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=L,this.markerItems=G,this.uiStyleSettings=q,this.styles=N,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return j.prototype.show=function(T){var L=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",this.uiContainer.appendChild(G),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(G,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(N){var ue=document.createElement("div");ue.className=""+L.toolbarButtonStyleClass.name,ue.setAttribute("data-type-name",N.typeName),ue.innerHTML=N.icon,ue.addEventListener("click",function(){L.markerToolbarButtonClicked(ue,N)}),L.buttons.push(ue),L.markerButtons.push(ue)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},j.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},j.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},j.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},j.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L<this.markerButtons.length;L++)L<T||L===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[L]):(L===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[L]))}},j.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},j.prototype.resetButtonStyles=function(){var T=this;this.buttons.forEach(function(L){L.className=L.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),L.className=L.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),L.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},j.prototype.addActionButton=function(T,L,G){var q=this,N=document.createElement("div");switch(N.className=""+this.toolbarButtonStyleClass.name,N.innerHTML=L,N.setAttribute("data-action",G),N.addEventListener("click",function(){q.actionToolbarButtonClicked(N,G)}),G){case"select":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":N.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":N.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":N.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":N.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(N),this.buttons.push(N)},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new S("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new S("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new S("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new S("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new S("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new S("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
padding: `+T+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new S("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new S("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},j.prototype.markerToolbarButtonClicked=function(T,L){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},j.prototype.actionToolbarButtonClicked=function(T,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},j.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},j.prototype.setActiveMarkerButton=function(T){var L=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===T});L&&this.setActiveButton(L)},j.prototype.setCurrentMarker=function(T){var L=this;this.currentMarker=T,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){L.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},j}(),w=function(){function j(T,L,G,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=L,this.uiStyleSettings=G,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return j.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new S("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new S("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new S("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new S("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new S("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new S("toolbox-panel-row_colors",`
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new S("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new S("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new S("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},j.prototype.show=function(T){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},j.prototype.setPanelButtons=function(T){var L,G,q=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(N){var ue;N.uiStyleSettings=q.uiStyleSettings;var be=document.createElement("div");be.className=q.toolboxButtonStyleClass.name+" "+((ue=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ue!==void 0?ue:q.toolboxButtonStyleColorsClass.name),be.innerHTML=N.icon,be.title=N.title,be.addEventListener("click",function(){q.panelButtonClick(N)}),q.panelButtons.push(be),q.buttonRow.appendChild(be)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},j.prototype.panelButtonClick=function(T){var L=this,G=-1;if(T!==this.activePanel){G=this.panels.indexOf(T),this.panelRow.innerHTML="";var q=T.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(N,ue){var be,Te;N.className=L.toolboxButtonStyleClass.name+" "+(ue===G?""+((be=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&be!==void 0?be:L.toolboxActiveButtonStyleColorsClass.name):""+((Te=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Te!==void 0?Te:L.toolboxButtonStyleColorsClass.name))})},j}(),A=function(j,T){this.title=j,this.icon=T},C=function(j){function T(L,G,q,N){var ue=j.call(this,L,N||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ue.colors=[],ue.addTransparent=!1,ue.colorBoxes=[],ue.colors=G,ue.currentColor=q,ue.setCurrentColor=ue.setCurrentColor.bind(ue),ue.getColorBox=ue.getColorBox.bind(ue),ue}return Y(T,j),T.prototype.getUi=function(){var L=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(q){var N=L.getColorBox(q);G.appendChild(N),L.colorBoxes.push(N)}),G},T.prototype.getColorBox=function(L){var G=this,q=this.uiStyleSettings.toolbarHeight/4,N=this.uiStyleSettings.toolbarHeight-q,ue=document.createElement("div");ue.style.display="inline-block",ue.style.boxSizing="content-box",ue.style.width=N-2+"px",ue.style.height=N-2+"px",ue.style.padding="1px",ue.style.marginRight="2px",ue.style.marginBottom="2px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderRadius=(N+2)/2+"px",ue.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){G.setCurrentColor(L,ue)});var be=document.createElement("div");return be.style.display="inline-block",be.style.width=N-2+"px",be.style.height=N-2+"px",be.style.backgroundColor=L,be.style.borderRadius=N/2+"px",L==="transparent"&&(be.style.fill=this.uiStyleSettings.toolboxAccentColor,be.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ue.appendChild(be),ue},T.prototype.setCurrentColor=function(L,G){var q=this;this.currentColor=L,this.colorBoxes.forEach(function(N){N.style.borderColor=N===G?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},T}(A),h=function(){function j(T,L,G){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=L,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(j.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(T){return!1},Object.defineProperty(j.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},j.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},j.prototype.pointerDown=function(T,L){},j.prototype.dblClick=function(T,L){},j.prototype.manipulate=function(T){},j.prototype.pointerUp=function(T){this.stateChanged()},j.prototype.dispose=function(){},j.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},j.prototype.getState=function(){return{typeName:j.typeName,state:this.state,notes:this.notes}},j.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},j.prototype.scale=function(T,L){},j.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},j.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},j.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},j.typeName="MarkerBase",j}(),o=function(){function j(){this.findGripByVisual=this.findGripByVisual.bind(this)}return j.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},j}(),s=function(){function j(){this.GRIP_SIZE=10,this.visual=R.createGroup(),this.visual.appendChild(R.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(R.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},j}(),u=function(){function j(){}return j.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},j.toSVGMatrix=function(T,L){return T.a=L.a,T.b=L.b,T.c=L.c,T.d=L.d,T.e=L.e,T.f=L.f,T},j}(),y=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.left=0,N.top=0,N.width=0,N.height=0,N.defaultSize={x:50,y:20},N.offsetX=0,N.offsetY=0,N.rotationAngle=0,N.CB_DISTANCE=10,N._suppressMarkerCreateEvent=!1,N.container.transform.baseVal.appendItem(R.createTransform()),N.setupControlBox(),N}return Y(T,j),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var G=R.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(L){return!!j.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(L);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var N=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=N.x-this.width/2,this.top=N.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ue=this.container.transform.baseVal.getItem(0);ue.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ue,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(L){var G=this.state;j.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},T.prototype.manipulate=function(L){var G=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(L)},T.prototype.resize=function(L){var G=this.manipulationStartLeft,q=this.manipulationStartWidth,N=this.manipulationStartTop,ue=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+L.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:N=this.manipulationStartTop+L.y-this.manipulationStartY,ue=this.manipulationStartHeight+this.manipulationStartTop-N;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ue=this.manipulationStartHeight+L.y-this.manipulationStartY}q>=0?(this.left=G,this.width=q):(this.left=G+q,this.width=-q),ue>=0?(this.top=N,this.height=ue):(this.top=N+ue,this.height=-ue),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var G=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},T.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},T.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var G=this.container.getCTM(),q=R.createPoint(L.x,L.y);return{x:(q=q.matrixTransform(G)).x,y:q.y}},T.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var G=this.container.getCTM();G=G.inverse();var q=R.createPoint(L.x,L.y);return{x:(q=q.matrixTransform(G)).x,y:q.y}},T.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=R.createGroup();var L=R.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=R.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=R.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new o,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},T.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},T.prototype.createGrip=function(){var L=new s;return L.visual.transform.baseVal.appendItem(R.createTransform()),this.controlBox.appendChild(L.visual),L},T.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,G=-L/2,q=G,N=(this.width+this.CB_DISTANCE)/2-L/2,ue=(this.height+this.CB_DISTANCE)/2-L/2,be=this.height+this.CB_DISTANCE-L/2,Te=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,G,q),this.positionGrip(this.controlGrips.topCenter.visual,N,q),this.positionGrip(this.controlGrips.topRight.visual,Te,q),this.positionGrip(this.controlGrips.centerLeft.visual,G,ue),this.positionGrip(this.controlGrips.centerRight.visual,Te,ue),this.positionGrip(this.controlGrips.bottomLeft.visual,G,be),this.positionGrip(this.controlGrips.bottomCenter.visual,N,be),this.positionGrip(this.controlGrips.bottomRight.visual,Te,be),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,N,q-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(L,G,q){var N=L.transform.baseVal.getItem(0);N.setTranslate(G,q),L.transform.baseVal.replaceItem(N,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:u.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:u.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},j.prototype.getState.call(this))},T.prototype.restoreState=function(L){j.prototype.restoreState.call(this,L);var G=L;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(u.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(u.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},T.prototype.scale=function(L,G){j.prototype.scale.call(this,L,G);var q=this.rotatePoint({x:this.left,y:this.top}),N=this.unrotatePoint({x:q.x*L,y:q.y*G});this.left=N.x,this.top=N.y,this.width=this.width*L,this.height=this.height*G,this.adjustControlBox()},T}(h),m=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.fillColor="transparent",N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.opacity=1,N.setStrokeColor=N.setStrokeColor.bind(N),N.setFillColor=N.setFillColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.createVisual=N.createVisual.bind(N),N}return Y(T,j),T.prototype.ownsTarget=function(L){return!(!j.prototype.ownsTarget.call(this,L)&&L!==this.visual)},T.prototype.createVisual=function(){this.visual=R.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},T.prototype.manipulate=function(L){j.prototype.manipulate.call(this,L)},T.prototype.resize=function(L){j.prototype.resize.call(this,L),this.setSize()},T.prototype.setSize=function(){j.prototype.setSize.call(this),R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(L){j.prototype.pointerUp.call(this,L),this.setSize()},T.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},T.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&R.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this))},T.prototype.restoreState=function(L){var G=L;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),j.prototype.restoreState.call(this,L),this.setSize()},T.prototype.scale=function(L,G){j.prototype.scale.call(this,L,G),this.setSize()},T.title="Rectangle marker",T}(y),p=function(j){function T(L,G,q,N){var ue=j.call(this,L,N||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ue.widths=[],ue.widthBoxes=[],ue.widths=G,ue.currentWidth=q,ue.setCurrentWidth=ue.setCurrentWidth.bind(ue),ue}return Y(T,j),T.prototype.getUi=function(){var L=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(q){var N=document.createElement("div");N.style.display="flex",N.style.flexGrow="2",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.borderColor=q===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){L.setCurrentWidth(q,N)}),G.appendChild(N);var ue=document.createElement("div");ue.innerText=q.toString(),ue.style.marginRight="5px",N.appendChild(ue);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.display="flex",be.style.alignItems="center";var Te=document.createElement("hr");Te.style.minWidth="20px",Te.style.border="0px",Te.style.borderTop=q+"px solid "+L.uiStyleSettings.toolboxColor,Te.style.flexGrow="2",be.appendChild(Te),N.appendChild(be),L.widthBoxes.push(N)}),G},T.prototype.setCurrentWidth=function(L,G){var q=this;this.currentWidth=L,this.widthBoxes.forEach(function(N){N.style.borderColor=N===G?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(A),D=function(j){function T(L,G,q,N){var ue=j.call(this,L,N||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ue.styles=[],ue.styleBoxes=[],ue.styles=G,ue.currentStyle=q,ue.setCurrentStyle=ue.setCurrentStyle.bind(ue),ue}return Y(T,j),T.prototype.getUi=function(){var L=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(q){var N=document.createElement("div");N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.overflow="hidden",N.style.maxWidth=100/L.styles.length-5+"%",N.style.borderColor=q===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){L.setCurrentStyle(q,N)}),G.appendChild(N);var ue=document.createElement("div");ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.overflow="hidden";var be=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+L.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
</svg>`;ue.innerHTML=be,N.appendChild(ue),L.styleBoxes.push(N)}),G},T.prototype.setCurrentStyle=function(L,G){var q=this;this.currentStyle=L,this.styleBoxes.forEach(function(N){N.style.borderColor=N===G?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(A),b=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.strokeColor=q.defaultColor,N.strokeWidth=q.defaultStrokeWidth,N.strokeDasharray=q.defaultStrokeDasharray,N.strokePanel=new C("Line color",q.defaultColorSet,q.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new p("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Y(T,j),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=j.prototype.getState.call(this);return L.typeName=T.typeName,L},T.typeName="FrameMarker",T.title="Frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',T}(m),c=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},d=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.x1=0,N.y1=0,N.x2=0,N.y2=0,N.defaultLength=50,N.manipulationStartX=0,N.manipulationStartY=0,N.manipulationStartX1=0,N.manipulationStartY1=0,N.manipulationStartX2=0,N.manipulationStartY2=0,N.setupControlBox(),N}return Y(T,j),T.prototype.ownsTarget=function(L){return!!j.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(L){var G=this.state;j.prototype.pointerUp.call(this,L),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(L),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},T.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=R.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){this.positionGrips()},T.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},T.prototype.createGrip=function(){var L=new s;return L.visual.transform.baseVal.appendItem(R.createTransform()),this.controlBox.appendChild(L.visual),L},T.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},T.prototype.positionGrip=function(L,G,q){var N=L.transform.baseVal.getItem(0);N.setTranslate(G,q),L.transform.baseVal.replaceItem(N,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},j.prototype.getState.call(this))},T.prototype.restoreState=function(L){j.prototype.restoreState.call(this,L);var G=L;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},T.prototype.scale=function(L,G){j.prototype.scale.call(this,L,G),this.x1=this.x1*L,this.y1=this.y1*G,this.x2=this.x2*L,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},T}(h),l=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.setStrokeColor=N.setStrokeColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.strokeColor=q.defaultColor,N.strokeWidth=q.defaultStrokeWidth,N.strokeDasharray=q.defaultStrokeDasharray,N.strokePanel=new C("Line color",q.defaultColorSet,q.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new p("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Y(T,j),T.prototype.ownsTarget=function(L){return!(!j.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=R.createGroup(),this.selectorLine=R.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=R.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),R.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},T.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},T.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},j.prototype.getState.call(this));return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){j.prototype.restoreState.call(this,L);var G=L;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',T}(d),a=function(j){function T(L,G,q,N){var ue=j.call(this,L,N||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ue.fonts=[],ue.fontBoxes=[],ue.fonts=G,ue.currentFont=q,ue.setCurrentFont=ue.setCurrentFont.bind(ue),ue}return Y(T,j),T.prototype.getUi=function(){var L=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(q){var N=document.createElement("div");N.style.display="inline-block",N.style.alignItems="center",N.style.justifyContent="space-between",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.overflow="hidden",N.style.maxWidth=100/L.fonts.length-5+"%",N.style.borderColor=q===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){L.setCurrentFont(q,N)}),G.appendChild(N);var ue=document.createElement("div");ue.style.display="flex",ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.fontFamily=q,ue.style.overflow="hidden";var be=document.createElement("div");be.style.whiteSpace="nowrap",be.style.overflow="hidden",be.style.textOverflow="ellipsis",be.innerHTML="The quick brown fox jumps over the lazy dog",ue.appendChild(be),N.appendChild(ue),L.fontBoxes.push(N)}),G},T.prototype.setCurrentFont=function(L,G){var q=this;this.currentFont=L,this.fontBoxes.forEach(function(N){N.style.borderColor=N===G?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(A),v=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.color="transparent",N.padding=5,N.DEFAULT_TEXT="your text here",N.text=N.DEFAULT_TEXT,N.isMoved=!1,N.color=q.defaultColor,N.fontFamily=q.defaultFontFamily,N.defaultSize={x:100,y:30},N.setColor=N.setColor.bind(N),N.setFont=N.setFont.bind(N),N.renderText=N.renderText.bind(N),N.sizeText=N.sizeText.bind(N),N.textEditDivClicked=N.textEditDivClicked.bind(N),N.showTextEditor=N.showTextEditor.bind(N),N.setSize=N.setSize.bind(N),N.positionTextEditor=N.positionTextEditor.bind(N),N.colorPanel=new C("Color",q.defaultColorSet,q.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.fontFamilyPanel=new a("Font",q.defaultFontFamilies,q.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N}return Y(T,j),T.prototype.ownsTarget=function(L){if(j.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(q){q===L&&(G=!0)}),G},T.prototype.createVisual=function(){this.visual=R.createGroup(),this.bgRectangle=R.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=R.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(R.createTransform()),this.textElement.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},T.prototype.renderText=function(){var L=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(G){L.textElement.appendChild(R.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var L=this.textElement.getBBox(),G=1;if(L.width>0&&L.height>0){var q=(1*this.width-this.width*this.padding*2/100)/L.width,N=(1*this.height-this.height*this.padding*2/100)/L.height;G=Math.min(q,N)}return G},T.prototype.getTextPosition=function(L){var G=this.textElement.getBBox(),q=0,N=0;return G.width>0&&G.height>0&&(q=(this.width-G.width*L)/2,N=this.height/2-G.height*L/2),{x:q,y:N}},T.prototype.sizeText=function(){var L=this.textElement.getBBox(),G=this.getTextScale(),q=this.getTextPosition(G);q.y-=L.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},T.prototype.manipulate=function(L){j.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(L){j.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){j.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(L){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),j.prototype.pointerUp.call(this,L),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var L=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&G>.9;)G-=.1,L.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var q=G.clipboardData.getData("text"),N=window.getSelection();if(!N.rangeCount)return!1;N.deleteFromDocument(),N.getRangeAt(0).insertNode(document.createTextNode(q)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),N={x:q.width*L,y:q.height*L};G.x-=N.x/2,G.y-=N.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){j.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),j.prototype.deselect.call(this)},T.prototype.dblClick=function(L,G){j.prototype.dblClick.call(this,L,G),this.showTextEditor()},T.prototype.setColor=function(L){this.textElement&&R.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},T.prototype.setFont=function(L){this.textElement&&R.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},T.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},T.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},j.prototype.getState.call(this));return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){var G=L;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),j.prototype.restoreState.call(this,L),this.setSize()},T.prototype.scale=function(L,G){j.prototype.scale.call(this,L,G),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',T}(y),f=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.color="transparent",N.lineWidth=3,N.drawing=!1,N.pixelRatio=1,N.color=q.defaultColor,N.lineWidth=q.defaultStrokeWidth,N.pixelRatio=q.freehandPixelRatio,N.setColor=N.setColor.bind(N),N.addCanvas=N.addCanvas.bind(N),N.finishCreation=N.finishCreation.bind(N),N.setLineWidth=N.setLineWidth.bind(N),N.colorPanel=new C("Color",q.defaultColorSet,q.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.lineWidthPanel=new p("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),N.lineWidthPanel.onWidthChanged=N.setLineWidth,N}return Y(T,j),T.prototype.ownsTarget=function(L){return!(!j.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=R.createGroup(),this.drawingImage=R.createImage(),this.visual.appendChild(this.drawingImage);var L=R.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(L,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(L.x,L.y),this.drawing=!0):j.prototype.pointerDown.call(this,L,G)},T.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):j.prototype.manipulate.call(this,L)},T.prototype.resize=function(L){j.prototype.resize.call(this,L),R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):j.prototype.pointerUp.call(this,L)},T.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),j.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),j.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=G[0],N=G[1],ue=G[2],be=G[3],Te=!1,Be=0;Be<this.canvasElement.height;Be++)for(var ke=0;ke<this.canvasElement.width;ke++)L.data[Be*this.canvasElement.width*4+4*ke+3]>0&&(Te=!0,Be<N&&(N=Be),ke<q&&(q=ke),Be>be&&(be=Be),ke>ue&&(ue=ke));if(Te){this.left=q/this.pixelRatio,this.top=N/this.pixelRatio,this.width=(ue-q)/this.pixelRatio,this.height=(be-N)/this.pixelRatio;var Oe=document.createElement("canvas");Oe.width=ue-q,Oe.height=be-N,Oe.getContext("2d").putImageData(this.canvasContext.getImageData(q,N,ue-q,be-N),0,0),this.drawingImgUrl=Oe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){R.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),R.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},T.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},j.prototype.getState.call(this));return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){this.createVisual(),j.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(L,G){j.prototype.scale.call(this,L,G),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',T}(y),E=function(j){function T(L,G,q){var N=j.call(this,L,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return N.typeBoxes=[],N.currentType=G,N.setCurrentType=N.setCurrentType.bind(N),N}return Y(T,j),T.prototype.getUi=function(){var L=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var q=function(be){var Te="both";switch(be){case 0:Te="both";break;case 1:Te="start";break;case 2:Te="end";break;case 3:Te="none"}var Be=document.createElement("div");if(Be.style.display="flex",Be.style.flexGrow="2",Be.style.alignItems="center",Be.style.justifyContent="space-between",Be.style.padding="5px",Be.style.borderWidth="2px",Be.style.borderStyle="solid",Be.style.borderColor=Te===N.currentType?N.uiStyleSettings.toolboxAccentColor:"transparent",Be.addEventListener("click",function(){L.setCurrentType(Te,Be)}),G.appendChild(Be),Te==="both"||Te==="start"){var ke=document.createElement("div");ke.style.display="flex",ke.style.alignItems="center",ke.style.minHeight="20px",ke.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ke.style.marginLeft="5px",Be.appendChild(ke)}var Oe=document.createElement("div");Oe.style.display="flex",Oe.style.alignItems="center",Oe.style.minHeight="20px",Oe.style.flexGrow="2";var _e=document.createElement("hr");if(_e.style.minWidth="20px",_e.style.border="0px",_e.style.borderTop="3px solid "+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee"),_e.style.flexGrow="2",Oe.appendChild(_e),Be.appendChild(Oe),Te==="both"||Te==="end"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ge.style.marginRight="5px",Be.appendChild(Ge)}N.typeBoxes.push(Be)},N=this,ue=0;ue<4;ue++)q(ue);return G},T.prototype.setCurrentType=function(L,G){var q=this;this.currentType=L,this.typeBoxes.forEach(function(N){N.style.borderColor=N===G?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(A),P=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.arrowType="end",N.arrowBaseHeight=10,N.arrowBaseWidth=10,N.getArrowPoints=N.getArrowPoints.bind(N),N.setArrowType=N.setArrowType.bind(N),N.arrowTypePanel=new E("Arrow type","end"),N.arrowTypePanel.onArrowTypeChanged=N.setArrowType,N}return Y(T,j),T.prototype.ownsTarget=function(L){return!(!j.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},T.prototype.getArrowPoints=function(L,G){var q=this.arrowBaseWidth+2*this.strokeWidth,N=this.arrowBaseHeight+2*this.strokeWidth;return L-q/2+","+(G+N/2)+" "+L+","+(G-N/2)+" "+(L+q/2)+","+(G+N/2)},T.prototype.createTips=function(){this.arrow1=R.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=R.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",R.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),R.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},T.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},j.prototype.getState.call(this));return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){j.prototype.restoreState.call(this,L);var G=L;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',T}(l),H=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.fillColor=q.defaultFillColor,N.strokeWidth=0,N.fillPanel=new C("Color",q.defaultColorSet,q.defaultFillColor),N.fillPanel.onColorChanged=N.setFillColor,N}return Y(T,j),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=j.prototype.getState.call(this);return L.typeName=T.typeName,L},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(m),Q=function(j){function T(L,G,q,N){var ue=j.call(this,L,N||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ue.opacities=[],ue.opacityBoxes=[],ue.opacities=G,ue.currentOpacity=q,ue.setCurrentOpacity=ue.setCurrentOpacity.bind(ue),ue}return Y(T,j),T.prototype.getUi=function(){var L=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function(q){var N=document.createElement("div");N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="center",N.style.padding="5px",N.style.borderWidth="2px",N.style.borderStyle="solid",N.style.borderColor=q===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){L.setCurrentOpacity(q,N)}),G.appendChild(N);var ue=document.createElement("div");ue.innerText=100*q+"%",N.appendChild(ue),L.opacityBoxes.push(N)}),G},T.prototype.setCurrentOpacity=function(L,G){var q=this;this.currentOpacity=L,this.opacityBoxes.forEach(function(N){N.style.borderColor=N===G?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(A),re=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.setOpacity=N.setOpacity.bind(N),N.fillColor=q.defaultHighlightColor,N.strokeWidth=0,N.opacity=q.defaultHighlightOpacity,N.fillPanel=new C("Color",q.defaultColorSet,N.fillColor),N.fillPanel.onColorChanged=N.setFillColor,N.opacityPanel=new Q("Opacity",q.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return Y(T,j),T.prototype.setOpacity=function(L){this.opacity=L,this.visual&&R.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=j.prototype.getState.call(this);return L.typeName=T.typeName,L},T.typeName="HighlightMarker",T.title="Highlight marker",T.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',T}(H),z='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',U=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.bgColor="transparent",N.tipPosition={x:0,y:0},N.tipBase1Position={x:0,y:0},N.tipBase2Position={x:0,y:0},N.tipMoving=!1,N.color=q.defaultStrokeColor,N.bgColor=q.defaultFillColor,N.fontFamily=q.defaultFontFamily,N.defaultSize={x:100,y:30},N.setBgColor=N.setBgColor.bind(N),N.getTipPoints=N.getTipPoints.bind(N),N.positionTip=N.positionTip.bind(N),N.setTipPoints=N.setTipPoints.bind(N),N.colorPanel=new C("Text color",q.defaultColorSet,N.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),N.colorPanel.onColorChanged=N.setColor,N.bgColorPanel=new C("Fill color",q.defaultColorSet,N.bgColor,z),N.bgColorPanel.onColorChanged=N.setBgColor,N.fontFamilyPanel=new a("Font",q.defaultFontFamilies,q.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N.tipGrip=new s,N.tipGrip.visual.transform.baseVal.appendItem(R.createTransform()),N.controlBox.appendChild(N.tipGrip.visual),N}return Y(T,j),T.prototype.ownsTarget=function(L){return j.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},T.prototype.createTip=function(){R.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=R.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(L,G){this.state==="new"&&j.prototype.pointerDown.call(this,L,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):j.prototype.pointerDown.call(this,L,G)},T.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,j.prototype.pointerUp.call(this,L);else{var G=this.state==="creating";j.prototype.pointerUp.call(this,L),this.setTipPoints(G),this.positionTip()}},T.prototype.manipulate=function(L){if(this.tipMoving){var G=this.unrotatePoint(L);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else j.prototype.manipulate.call(this,L)},T.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(R.setAttributes(this.bgRectangle,[["fill",L]]),R.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},T.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},T.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var G=Math.min(this.height/2,15),q=this.height/5;L&&(this.tipPosition={x:G+q/2,y:this.height+20});var N=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?N<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:0},this.tipBase2Position={x:G+q,y:0}):(this.tipBase1Position={x:0,y:G},this.tipBase2Position={x:0,y:G+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?N<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-q,y:0},this.tipBase2Position={x:this.width-G,y:0}):(this.tipBase1Position={x:this.width,y:G},this.tipBase2Position={x:this.width,y:G+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?N<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-q,y:this.height},this.tipBase2Position={x:this.width-G,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-G-q},this.tipBase2Position={x:this.width,y:this.height-G}):N<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:this.height},this.tipBase2Position={x:G+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-G},this.tipBase2Position={x:0,y:this.height-G-q})},T.prototype.resize=function(L){j.prototype.resize.call(this,L),this.positionTip()},T.prototype.positionTip=function(){R.setAttributes(this.tip,[["points",this.getTipPoints()]]);var L=this.tipGrip.visual.transform.baseVal.getItem(0);L.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(L,0)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.select=function(){this.positionTip(),j.prototype.select.call(this)},T.prototype.getState=function(){var L=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},j.prototype.getState.call(this));return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){var G=L;this.bgColor=G.bgColor,this.tipPosition=G.tipPosition,j.prototype.restoreState.call(this,L),this.createTip(),this.setTipPoints()},T.prototype.scale=function(L,G){j.prototype.scale.call(this,L,G),this.tipPosition={x:this.tipPosition.x*L,y:this.tipPosition.y*G},this.positionTip()},T.typeName="CalloutMarker",T.title="Callout marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',T}(v),ae=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.fillColor="transparent",N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.opacity=1,N.strokeColor=q.defaultColor,N.strokeWidth=q.defaultStrokeWidth,N.strokeDasharray=q.defaultStrokeDasharray,N.fillColor=q.defaultFillColor,N.setStrokeColor=N.setStrokeColor.bind(N),N.setFillColor=N.setFillColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.setOpacity=N.setOpacity.bind(N),N.createVisual=N.createVisual.bind(N),N.strokePanel=new C("Line color",_(q.defaultColorSet,["transparent"]),q.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.fillPanel=new C("Fill color",_(q.defaultColorSet,["transparent"]),N.fillColor,z),N.fillPanel.onColorChanged=N.setFillColor,N.strokeWidthPanel=new p("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N.opacityPanel=new Q("Opacity",q.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return Y(T,j),T.prototype.ownsTarget=function(L){return!(!j.prototype.ownsTarget.call(this,L)&&L!==this.visual)},T.prototype.createVisual=function(){this.visual=R.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},T.prototype.manipulate=function(L){j.prototype.manipulate.call(this,L)},T.prototype.resize=function(L){j.prototype.resize.call(this,L),this.setSize()},T.prototype.setSize=function(){j.prototype.setSize.call(this),R.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},T.prototype.pointerUp=function(L){j.prototype.pointerUp.call(this,L),this.setSize()},T.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},T.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},T.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&R.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(L){this.opacity=L,this.visual&&R.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this));return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){var G=L;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),j.prototype.restoreState.call(this,L),this.setSize()},T.prototype.scale=function(L,G){j.prototype.scale.call(this,L,G),this.setSize()},T.typeName="EllipseMarker",T.title="Ellipse marker",T.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',T}(y),fe=function(j){function T(L,G,q){return j.call(this,L,G,q)||this}return Y(T,j),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(L){return!(!j.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},T.prototype.createTips=function(){this.tip1=R.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.tip1),this.tip2=R.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(R.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=j.prototype.getState.call(this);return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){j.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',T}(l),ge=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.strokePanel.colors=q.defaultColorSet,N.fillColor="transparent",N}return Y(T,j),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=j.prototype.getState.call(this);return L.typeName=T.typeName,L},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',T}(ae),Ee=function(){function j(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),j.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},j.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},j.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},j.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},j.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},j}(),Ne=function(j){function T(L,G,q){var N=j.call(this,L,G,q)||this;return N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.curveX=0,N.curveY=0,N.manipulationStartCurveX=0,N.manipulationStartCurveY=0,N.setStrokeColor=N.setStrokeColor.bind(N),N.setStrokeWidth=N.setStrokeWidth.bind(N),N.setStrokeDasharray=N.setStrokeDasharray.bind(N),N.positionGrips=N.positionGrips.bind(N),N.addControlGrips=N.addControlGrips.bind(N),N.adjustVisual=N.adjustVisual.bind(N),N.setupControlBox=N.setupControlBox.bind(N),N.resize=N.resize.bind(N),N.strokeColor=q.defaultColor,N.strokeWidth=q.defaultStrokeWidth,N.strokeDasharray=q.defaultStrokeDasharray,N.strokePanel=new C("Line color",q.defaultColorSet,q.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new p("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Y(T,j),T.prototype.ownsTarget=function(L){return!(!j.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},T.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},T.prototype.createVisual=function(){this.visual=R.createGroup(),this.selectorCurve=R.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=R.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(L,G){j.prototype.pointerDown.call(this,L,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),R.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){j.prototype.setupControlBox.call(this),this.curveControlLine1=R.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=R.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,j.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){j.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},T.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),j.prototype.manipulate.call(this,L)},T.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),j.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},T.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},T.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},T.prototype.scale=function(L,G){this.curveX=this.curveX*L,this.curveY=this.curveY*G,j.prototype.scale.call(this,L,G)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},j.prototype.getState.call(this));return L.typeName=T.typeName,L},T.prototype.restoreState=function(L){j.prototype.restoreState.call(this,L);var G=L;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',T}(d),Se=function(){function j(T,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=L}return Object.defineProperty(j.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),j.prototype.preventDefault=function(){this._defaultPrevented=!0},j}(),Ie=function(j){function T(L,G,q){var N=j.call(this,L,!1)||this;return N.dataUrl=G,N.state=q,N}return Y(T,j),T}(Se),Ae=function(j){function T(L,G,q){q===void 0&&(q=!1);var N=j.call(this,L,q)||this;return N.marker=G,N}return Y(T,j),T}(Se),we=function(){function j(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return j.prototype.addEventListener=function(T,L){this[T].push(L)},j.prototype.removeEventListener=function(T,L){var G=this[T].indexOf(L);G>-1&&this[T].splice(G,1)},j}(),ve=function(){function j(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new c,this._isOpen=!1,this.undoRedoManager=new Ee,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new we,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=j.instanceCounter++,this.styles=new M(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(j.prototype,"ALL_MARKER_TYPES",{get:function(){return[b,f,P,v,ge,ae,re,U,fe,H,l,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[b,f,P,v,ae,re,U]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"BASIC_MARKER_TYPES",{get:function(){return[b,f,P,v,re]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var L=this;this._availableMarkerTypes.splice(0),T.forEach(function(G){if(typeof G=="string"){var q=L.ALL_MARKER_TYPES.find(function(N){return N.typeName===G});q!==void 0&&L._availableMarkerTypes.push(q)}else L._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},j.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&O.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=O.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new Se(T))})},j.prototype.render=function(){return k(this,void 0,void 0,function(){var T;return V(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(T=new F).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.markersOnly=this.renderMarkersOnly,T.width=this.renderWidth,T.height=this.renderHeight,[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},j.prototype.close=function(T){var L=this;if(T===void 0&&(T=!1),this.isOpen){var G=!1;T||this.eventListeners.beforeclose.forEach(function(q){var N=new Se(L,!0);q(N),N.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(q){return q(new Se(L))}),this.detachEvents(),this._isOpen=!1)}},j.prototype.addMarkersToToolbar=function(){for(var T,L=[],G=0;G<arguments.length;G++)L[G]=arguments[G];(T=this._availableMarkerTypes).push.apply(T,L)},j.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(L){T(L.dataUrl,L.state)})},j.prototype.removeRenderEventListener=function(T){},j.prototype.addCloseEventListener=function(T){this.addEventListener("close",function(){T()})},j.prototype.removeCloseEventListener=function(T){},j.prototype.setupResizeObserver=function(){var T=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return T.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},j.prototype.onPopupTargetResize=function(){var T=1*this.target.clientWidth/this.target.clientHeight,L=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,G=L<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(L,G)},j.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},j.prototype.resize=function(T,L){this._isResizing=!0;var G=T/this.imageWidth,q=L/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(L),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(G,q),this._isResizing=!1},j.prototype.scaleMarkers=function(T,L){var G,q=this;this._currentMarker&&this._currentMarker instanceof v?this._currentMarker.scale(T,L):(G=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(N){N!==q._currentMarker&&N.scale(T,L)}),G!==void 0&&this.setCurrentMarker(G)},j.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},j.prototype.setTopLeft=function(){var T=this.editingTarget.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=T.left-L.left,this.top=T.top-L.top},j.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},j.prototype.addDefs=function(){for(var T,L=[],G=0;G<arguments.length;G++)L[G]=arguments[G];this.defs=R.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,L)},j.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},j.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},j.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},j.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},j.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},j.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},j.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},j.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var T=document.createElement("a");T.href="https://markerjs.com/",T.target="_blank",T.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},j.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},j.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new I(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new w(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},j.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.removeMarker=function(T){this.markerImage.removeChild(T.container),this.markers.indexOf(T)>-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},j.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},j.prototype.toolbarButtonClicked=function(T,L){if(T==="marker"&&L!==void 0)this.createNewMarker(L);else if(T==="action")switch(L){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},j.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var N=new Ae(T,T._currentMarker,!0);q(N),N.defaultPrevented&&(L=!0)}),!L){var G=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(q){return q(new Ae(T,G))})}}},j.prototype.clear=function(){var T=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ue){var be=new Ae(T,void 0,!0);ue(be),be.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var G=function(ue){var be=q.markers[ue];q.setCurrentMarker(q.markers[ue]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(Te){return Te(new Ae(T,be))})},q=this,N=this.markers.length-1;N>=0;N--)G(N);this.addUndoStep()}},Object.defineProperty(j.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),j.prototype.showNotesEditor=function(){var T;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},j.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},j.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},j.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===L.width&&G.height===L.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(N){return N(new Se(T))})}else this.undoRedoManager.replaceLastUndoStep(L),this.eventListeners.statechange.forEach(function(N){return N(new Se(T))})}},j.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},j.prototype.undoStep=function(){var T=this,L=this.undoRedoManager.undo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new Se(T))}))},j.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},j.prototype.redoStep=function(){var T=this,L=this.undoRedoManager.redo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new Se(T))}))},j.prototype.stepZoom=function(){var T=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=T<this.zoomSteps.length-1?this.zoomSteps[T+1]:this.zoomSteps[0]},j.prototype.panTo=function(T){this.contentDiv.scrollBy({left:this.prevPanPoint.x-T.x,top:this.prevPanPoint.y-T.y}),this.prevPanPoint=T},j.prototype.startRenderAndClose=function(){return k(this,void 0,void 0,function(){var T,L,G=this;return V(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return T=q.sent(),L=this.getState(),this.eventListeners.render.forEach(function(N){return N(new Ie(G,T,L))}),this.close(!0),[2]}})})},j.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var L={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(G){return L.markers.push(G.getState())}),L},j.prototype.restoreState=function(T){var L=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(G){var q=L._availableMarkerTypes.find(function(ue){return ue.typeName===G.typeName});if(q!==void 0){var N=L.addNewMarker(q);N.restoreState(G),L.markers.push(N)}}),T.width&&T.height&&(T.width!==this.imageWidth||T.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/T.width,this.imageHeight/T.height),this.eventListeners.restorestate.forEach(function(G){return G(new Se(L))})},j.prototype.addNewMarker=function(T){var L=R.createGroup();return this.markerImage.appendChild(L),new T(L,this.overlayContainer,this.settings)},j.prototype.createNewMarker=function(T){var L,G=this;(L=typeof T=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(L),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(L.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new Ae(G,G._currentMarker))}))},j.prototype.markerCreated=function(T){var L=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof f&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(f):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(G){return G(new Ae(L,L._currentMarker))})},j.prototype.colorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=T,this.settings.defaultStrokeColor=T)},j.prototype.fillColorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=T)},j.prototype.markerStateChanged=function(T){var L=this;this.eventListeners.markerchange.forEach(function(G){return G(new Ae(L,T))})},j.prototype.setCurrentMarker=function(T){var L=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(G){return G(new Ae(L,L._currentMarker))})),this._currentMarker=T,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(G){return G(new Ae(L,L._currentMarker))}))},j.prototype.onPointerDown=function(T){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||T.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var L=this.markers.find(function(G){return G.ownsTarget(T.target)});L!==void 0?(this.setCurrentMarker(L),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:T.clientX,y:T.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY))},j.prototype.onDblClick=function(T){if(this._isFocused||this.focus(),this.mode==="select"){var L=this.markers.find(function(G){return G.ownsTarget(T.target)});L!==void 0&&L!==this._currentMarker&&this.setCurrentMarker(L),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target):this.setCurrentMarker()}},j.prototype.onPointerMove=function(T){this.touchPoints!==1&&T.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||T.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(T.clientX,T.clientY)):this.zoomLevel>1&&this.panTo({x:T.clientX,y:T.clientY}))},j.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},j.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},j.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},j.prototype.clientToLocalCoordinates=function(T,L){var G=this.markerImage.getBoundingClientRect();return{x:(T-G.left)/this.zoomLevel,y:(L-G.top)/this.zoomLevel}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},j.prototype.addLicenseKey=function(T){W.addKey(T)},j.prototype.addEventListener=function(T,L){this.eventListeners.addEventListener(T,L)},j.prototype.removeEventListener=function(T,L){this.eventListeners.removeEventListener(T,L)},j.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(j.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),j.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new Se(T))}))},j.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new Se(T))}))},j.instanceCounter=0,j}()},TGq3:function(Pe,Re,$){Pe.exports=$.p+"static/lockclose.365036e8.svg"},UUDw:function(Pe,Re,$){Pe.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},"VrN/":function(Pe,Re,$){(function(he,Y){Pe.exports=Y()})(this,function(){"use strict";var he=navigator.userAgent,Y=navigator.platform,k=/gecko\/\d/i.test(he),V=/MSIE \d/.test(he),_=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(he),R=/Edge\/(\d+)/.exec(he),W=V||_||R,F=W&&(V?document.documentMode||6:+(R||_)[1]),O=!R&&/WebKit\//.test(he),M=O&&/Qt\/\d+\.\d+/.test(he),g=!R&&/Chrome\//.test(he),S=/Opera\//.test(he),I=/Apple Computer/.test(navigator.vendor),w=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(he),A=/PhantomJS/.test(he),C=!R&&/AppleWebKit/.test(he)&&/Mobile\/\w+/.test(he),h=/Android/.test(he),o=C||h||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(he),s=C||/Mac/.test(Y),u=/\bCrOS\b/.test(he),y=/win/i.test(Y),m=S&&he.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(S=!1,O=!0);var p=s&&(M||S&&(m==null||m<12.11)),D=k||W&&F>=9;function b(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var c=function(e,t){var i=e.className,r=b(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function d(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function l(e,t){return d(e).appendChild(t)}function a(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var x=0;x<t.length;++x)n.appendChild(t[x]);return n}function v(e,t,i,r){var n=a(e,t,i,r);return n.setAttribute("role","presentation"),n}var f;document.createRange?f=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:f=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(n){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function E(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var i=e.className;b(t).test(i)||(e.className+=(i?" ":"")+t)}function Q(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!b(i[r]).test(t)&&(t+=" "+i[r]);return t}var re=function(e){e.select()};C?re=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(re=function(e){try{e.select()}catch(t){}});function z(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function U(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function ae(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var x=r||0,B=n||0;;){var K=e.indexOf(" ",x);if(K<0||K>=t)return B+(t-x);B+=K-x,B+=i-B%i,x=K+1}}var fe=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};fe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},fe.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ge(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ee=50,Ne={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},Ie={origin:"*mouse"},Ae={origin:"+move"};function we(e,t,i){for(var r=0,n=0;;){var x=e.indexOf(" ",r);x==-1&&(x=e.length);var B=x-r;if(x==e.length||n+B>=t)return r+Math.min(B,t-n);if(n+=x-r,n+=i-n%i,r=x+1,n>=t)return r}}var ve=[""];function j(e){for(;ve.length<=e;)ve.push(T(ve)+" ");return ve[e]}function T(e){return e[e.length-1]}function L(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function G(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function q(){}function N(e,t){var i;return Object.create?i=Object.create(e):(q.prototype=e,i=new q),t&&U(t,i),i}var ue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function be(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ue.test(e))}function Te(e,t){return t?t.source.indexOf("\\w")>-1&&be(e)?!0:t.test(e):be(e)}function Be(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ke=/[\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 Oe(e){return e.charCodeAt(0)>=768&&ke.test(e)}function _e(e,t,i){for(;(i<0?t>0:t<e.length)&&Oe(e.charAt(t));)t+=i;return t}function Ge(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,x=r<0?Math.ceil(n):Math.floor(n);if(x==t)return e(x)?t:i;e(x)?i=x:t=x+r}}function Ve(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,x=0;x<e.length;++x){var B=e[x];(B.from<i&&B.to>t||t==i&&B.to==t)&&(r(Math.max(B.from,t),Math.min(B.to,i),B.level==1?"rtl":"ltr",x),n=!0)}n||r(t,i,"ltr")}var Qe=null;function Ye(e,t,i){var r;Qe=null;for(var n=0;n<e.length;++n){var x=e[n];if(x.from<t&&x.to>t)return n;x.to==t&&(x.from!=x.to&&i=="before"?r=n:Qe=n),x.from==t&&(x.from!=x.to&&i!="before"?r=n:Qe=n)}return r!=null?r:Qe}var ot=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,x=/[LRr]/,B=/[Lb1n]/,K=/[1n]/;function X(te,ce,pe){this.level=te,this.from=ce,this.to=pe}return function(te,ce){var pe=ce=="ltr"?"L":"R";if(te.length==0||ce=="ltr"&&!r.test(te))return!1;for(var Ce=te.length,xe=[],Me=0;Me<Ce;++Me)xe.push(i(te.charCodeAt(Me)));for(var Ue=0,je=pe;Ue<Ce;++Ue){var ze=xe[Ue];ze=="m"?xe[Ue]=je:je=ze}for(var qe=0,Ke=pe;qe<Ce;++qe){var tt=xe[qe];tt=="1"&&Ke=="r"?xe[qe]="n":x.test(tt)&&(Ke=tt,tt=="r"&&(xe[qe]="R"))}for(var ht=1,lt=xe[0];ht<Ce-1;++ht){var gt=xe[ht];gt=="+"&&lt=="1"&&xe[ht+1]=="1"?xe[ht]="1":gt==","&&lt==xe[ht+1]&&(lt=="1"||lt=="n")&&(xe[ht]=lt),lt=gt}for(var It=0;It<Ce;++It){var Vt=xe[It];if(Vt==",")xe[It]="N";else if(Vt=="%"){var Bt=void 0;for(Bt=It+1;Bt<Ce&&xe[Bt]=="%";++Bt);for(var pr=It&&xe[It-1]=="!"||Bt<Ce&&xe[Bt]=="1"?"1":"N",ur=It;ur<Bt;++ur)xe[ur]=pr;It=Bt-1}}for(var Wt=0,hr=pe;Wt<Ce;++Wt){var qt=xe[Wt];hr=="L"&&qt=="1"?xe[Wt]="L":x.test(qt)&&(hr=qt)}for(var Gt=0;Gt<Ce;++Gt)if(n.test(xe[Gt])){var jt=void 0;for(jt=Gt+1;jt<Ce&&n.test(xe[jt]);++jt);for(var Nt=(Gt?xe[Gt-1]:pe)=="L",dr=(jt<Ce?xe[jt]:pe)=="L",Gi=Nt==dr?Nt?"L":"R":pe,ei=Gt;ei<jt;++ei)xe[ei]=Gi;Gt=jt-1}for(var tr=[],_r,Qt=0;Qt<Ce;)if(B.test(xe[Qt])){var Va=Qt;for(++Qt;Qt<Ce&&B.test(xe[Qt]);++Qt);tr.push(new X(0,Va,Qt))}else{var Gr=Qt,vi=tr.length,yi=ce=="rtl"?1:0;for(++Qt;Qt<Ce&&xe[Qt]!="L";++Qt);for(var nr=Gr;nr<Qt;)if(K.test(xe[nr])){Gr<nr&&(tr.splice(vi,0,new X(1,Gr,nr)),vi+=yi);var zi=nr;for(++nr;nr<Qt&&K.test(xe[nr]);++nr);tr.splice(vi,0,new X(2,zi,nr)),vi+=yi,Gr=nr}else++nr;Gr<Qt&&tr.splice(vi,0,new X(1,Gr,Qt))}return ce=="ltr"&&(tr[0].level==1&&(_r=te.match(/^\s+/))&&(tr[0].from=_r[0].length,tr.unshift(new X(0,0,_r[0].length))),T(tr).level==1&&(_r=te.match(/\s+$/))&&(T(tr).to-=_r[0].length,tr.push(new X(0,Ce-_r[0].length,Ce)))),ce=="rtl"?tr.reverse():tr}}();function Xe(e,t){var i=e.order;return i==null&&(i=e.order=ot(e.text,t)),i}var Ze=[],De=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ze).concat(i)}};function it(e,t){return e._handlers&&e._handlers[t]||Ze}function $e(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var x=ge(n,i);x>-1&&(r[t]=n.slice(0,x).concat(n.slice(x+1)))}}}function oe(e,t){var i=it(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function Z(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),oe(e,i||t.type,e,t),le(t)||t.codemirrorIgnore}function J(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ge(i,t[r])==-1&&i.push(t[r])}function ne(e,t){return it(e,t).length>0}function se(e){e.prototype.on=function(t,i){De(this,t,i)},e.prototype.off=function(t,i){$e(this,t,i)}}function ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function de(e){ee(e),ie(e)}function me(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)),s&&e.ctrlKey&&t==1&&(t=3),t}var Le=function(){if(W&&F<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),He;function et(e){if(He==null){var t=a("span","\u200B");l(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(He=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&F<8))}var i=He?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var rt;function vt(e){if(rt!=null)return rt;var t=l(e,document.createTextNode("A\u062EA")),i=f(t,0,1).getBoundingClientRect(),r=f(t,1,2).getBoundingClientRect();return d(e),!i||i.left==i.right?!1:rt=r.right-i.right<3}var st=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
`,t);n==-1&&(n=e.length);var x=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),B=x.indexOf("\r");B!=-1?(i.push(x.slice(0,B)),t+=B+1):(i.push(x),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},nt=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Tt=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Et=null;function _t(e){if(Et!=null)return Et;var t=l(e,a("span","x")),i=t.getBoundingClientRect(),r=f(t,0,1).getBoundingClientRect();return Et=Math.abs(i.left-r.left)>1}var Mt={},xt={};function mr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mt[e]=t}function Sr(e,t){xt[e]=t}function Yt(e){if(typeof e=="string"&&xt.hasOwnProperty(e))e=xt[e];else if(e&&typeof e.name=="string"&&xt.hasOwnProperty(e.name)){var t=xt[e.name];typeof t=="string"&&(t={name:t}),e=N(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gr(e,t){t=Yt(t);var i=Mt[t.name];if(!i)return gr(e,"text/plain");var r=i(e,t);if(cr.hasOwnProperty(t.name)){var n=cr[t.name];for(var x in n){if(!n.hasOwnProperty(x))continue;r.hasOwnProperty(x)&&(r["_"+x]=r[x]),r[x]=n[x]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var B in t.modeProps)r[B]=t.modeProps[B];return r}var cr={};function zr(e,t){var i=cr.hasOwnProperty(e)?cr[e]:cr[e]={};U(t,i)}function Xt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Br(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function ti(e,t,i){return e.startState?e.startState(t,i):!0}var Ot=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};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),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)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=ae(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ae(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.indentation=function(){return ae(this.string,null,this.tabSize)-(this.lineStart?ae(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(B){return i?B.toLowerCase():B},n=this.string.substr(this.pos,e.length);if(r(n)==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 Je(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 i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],x=n.chunkSize();if(t<x){i=n;break}t-=x}return i.lines[t]}function St(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(x){var B=x.text;n==i.line&&(B=B.slice(0,i.ch)),n==t.line&&(B=B.slice(t.ch)),r.push(B),++n}),r}function Jt(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function mt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function pt(e){if(e.parent==null)return null;for(var t=e.parent,i=ge(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;!(r.children[n]==t);++n)i+=r.children[n].chunkSize();return i+t.first}function wt(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],x=n.height;if(t<x){e=n;continue e}t-=x,i+=n.chunkSize()}return i}while(!e.lines);for(var B=0;B<e.lines.length;++B){var K=e.lines[B],X=K.height;if(t<X)break;t-=X}return i+B}function vr(e,t){return t>=e.first&&t<e.first+e.size}function Ft(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Fe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Fe))return new Fe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function dt(e,t){return e.line-t.line||e.ch-t.ch}function ri(e,t){return e.sticky==t.sticky&&dt(e,t)==0}function bi(e){return Fe(e.line,e.ch)}function Ei(e,t){return dt(e,t)<0?t:e}function ii(e,t){return dt(e,t)<0?e:t}function xi(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 Fe(e.first,0);var i=e.first+e.size-1;return t.line>i?Fe(i,Je(e,i).text.length):Dn(t,Je(e,t.line).text.length)}function Dn(e,t){var i=e.ch;return i==null||i>t?Fe(e.line,t):i<0?Fe(e.line,0):e}function We(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=ft(e,t[r]);return i}var Ci=function(e,t){this.state=e,this.lookAhead=t},xr=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};xr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},xr.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}},xr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},xr.fromSaved=function(e,t,i){return t instanceof Ci?new xr(e,Xt(e.mode,t.state),i,t.lookAhead):new xr(e,Xt(e.mode,t),i)},xr.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ci(t,this.maxLookAhead):t};function Ki(e,t,i,r){var n=[e.state.modeGen],x={};wr(e,t.text,e.doc.mode,i,function(te,ce){return n.push(te,ce)},x,r);for(var B=i.state,K=function(te){i.baseTokens=n;var ce=e.state.overlays[te],pe=1,Ce=0;i.state=!0,wr(e,t.text,ce.mode,i,function(xe,Me){for(var Ue=pe;Ce<xe;){var je=n[pe];je>xe&&n.splice(pe,1,xe,n[pe+1],je),pe+=2,Ce=Math.min(xe,je)}if(!Me)return;if(ce.opaque)n.splice(Ue,pe-Ue,xe,"overlay "+Me),pe=Ue+2;else for(;Ue<pe;Ue+=2){var ze=n[Ue+1];n[Ue+1]=(ze?ze+" ":"")+"overlay "+Me}},x),i.state=B,i.baseTokens=null,i.baseTokenPos=1},X=0;X<e.state.overlays.length;++X)K(X);return{styles:n,classes:x.bgClass||x.textClass?x:null}}function ni(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ar(e,pt(t)),n=t.text.length>e.options.maxHighlightLength&&Xt(e.doc.mode,r.state),x=Ki(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=x.styles,x.classes?t.styleClasses=x.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ar(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new xr(r,!0,t);var x=kn(e,t,i),B=x>r.first&&Je(r,x-1).stateAfter,K=B?xr.fromSaved(r,B,x):new xr(r,ti(r.mode),x);return r.iter(x,t,function(X){Vi(e,X.text,K);var te=K.line;X.stateAfter=te==t-1||te%5==0||te>=n.viewFrom&&te<n.viewTo?K.save():null,K.nextLine()}),i&&(r.modeFrontier=K.line),K}function Vi(e,t,i,r){var n=e.doc.mode,x=new Ot(t,e.options.tabSize,i);for(x.start=x.pos=r||0,t==""&&Qi(n,i.state);!x.eol();)Tr(n,x,i.state),x.start=x.pos}function Qi(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Br(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Tr(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Br(e,i).mode);var x=e.token(t,i);if(t.pos>t.start)return x}throw new Error("Mode "+e.name+" failed to advance stream.")}var Yi=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Ln(e,t,i,r){var n=e.doc,x=n.mode,B;t=ft(n,t);var K=Je(n,t.line),X=Ar(e,t.line,i),te=new Ot(K.text,e.options.tabSize,X),ce;for(r&&(ce=[]);(r||te.pos<t.ch)&&!te.eol();)te.start=te.pos,B=Tr(x,te,X.state),r&&ce.push(new Yi(te,B,Xt(n.mode,X.state)));return r?ce:new Yi(te,B,X.state)}function Xi(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function wr(e,t,i,r,n,x,B){var K=i.flattenSpans;K==null&&(K=e.options.flattenSpans);var X=0,te=null,ce=new Ot(t,e.options.tabSize,r),pe,Ce=e.options.addModeClass&&[null];for(t==""&&Xi(Qi(i,r.state),x);!ce.eol();){if(ce.pos>e.options.maxHighlightLength?(K=!1,B&&Vi(e,t,r,ce.pos),ce.pos=t.length,pe=null):pe=Xi(Tr(i,ce,r.state,Ce),x),Ce){var xe=Ce[0].name;xe&&(pe="m-"+(pe?xe+" "+pe:xe))}if(!K||te!=pe){for(;X<ce.start;)X=Math.min(ce.start,X+5e3),n(X,te);te=pe}ce.start=ce.pos}for(;X<ce.pos;){var Me=Math.min(ce.pos,X+5e3);n(Me,te),X=Me}}function kn(e,t,i){for(var r,n,x=e.doc,B=i?-1:t-(e.doc.mode.innerMode?1e3:100),K=t;K>B;--K){if(K<=x.first)return x.first;var X=Je(x,K-1),te=X.stateAfter;if(te&&(!i||K+(te instanceof Ci?te.lookAhead:0)<=x.modeFrontier))return K;var ce=ae(X.text,null,e.options.tabSize);(n==null||r>ce)&&(n=K-1,r=ce)}return n}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,r=t-1;r>i;r--){var n=Je(e,r).stateAfter;if(n&&(!(n instanceof Ci)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Ji=!1,rr=!1;function Kr(){Ji=!0}function oa(){rr=!0}function ai(e,t,i){this.marker=e,this.from=t,this.to=i}function Dr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Zi(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function sa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Rn(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var x=e[n],B=x.marker,K=x.from==null||(B.inclusiveLeft?x.from<=t:x.from<t);if(K||x.from==t&&B.type=="bookmark"&&(!i||!x.marker.insertLeft)){var X=x.to==null||(B.inclusiveRight?x.to>=t:x.to>t);(r||(r=[])).push(new ai(B,x.from,X?null:x.to))}}return r}function In(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var x=e[n],B=x.marker,K=x.to==null||(B.inclusiveRight?x.to>=t:x.to>t);if(K||x.from==t&&B.type=="bookmark"&&(!i||x.marker.insertLeft)){var X=x.from==null||(B.inclusiveLeft?x.from<=t:x.from<t);(r||(r=[])).push(new ai(B,X?null:x.from-t,x.to==null?null:x.to-t))}}return r}function Si(e,t){if(t.full)return null;var i=vr(e,t.from.line)&&Je(e,t.from.line).markedSpans,r=vr(e,t.to.line)&&Je(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,x=t.to.ch,B=dt(t.from,t.to)==0,K=Rn(i,n,B),X=In(r,x,B),te=t.text.length==1,ce=T(t.text).length+(te?n:0);if(K)for(var pe=0;pe<K.length;++pe){var Ce=K[pe];if(Ce.to==null){var xe=Dr(X,Ce.marker);xe?te&&(Ce.to=xe.to==null?null:xe.to+ce):Ce.to=n}}if(X)for(var Me=0;Me<X.length;++Me){var Ue=X[Me];if(Ue.to!=null&&(Ue.to+=ce),Ue.from==null){var je=Dr(K,Ue.marker);je||(Ue.from=ce,te&&(K||(K=[])).push(Ue))}else Ue.from+=ce,te&&(K||(K=[])).push(Ue)}K&&(K=Mn(K)),X&&X!=K&&(X=Mn(X));var ze=[K];if(!te){var qe=t.text.length-2,Ke;if(qe>0&&K)for(var tt=0;tt<K.length;++tt)K[tt].to==null&&(Ke||(Ke=[])).push(new ai(K[tt].marker,null,null));for(var ht=0;ht<qe;++ht)ze.push(Ke);ze.push(X)}return ze}function Mn(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function On(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(xe){if(xe.markedSpans)for(var Me=0;Me<xe.markedSpans.length;++Me){var Ue=xe.markedSpans[Me].marker;Ue.readOnly&&(!r||ge(r,Ue)==-1)&&(r||(r=[])).push(Ue)}}),!r)return null;for(var n=[{from:t,to:i}],x=0;x<r.length;++x)for(var B=r[x],K=B.find(0),X=0;X<n.length;++X){var te=n[X];if(dt(te.to,K.from)<0||dt(te.from,K.to)>0)continue;var ce=[X,1],pe=dt(te.from,K.from),Ce=dt(te.to,K.to);(pe<0||!B.inclusiveLeft&&!pe)&&ce.push({from:te.from,to:K.from}),(Ce>0||!B.inclusiveRight&&!Ce)&&ce.push({from:K.to,to:te.to}),n.splice.apply(n,ce),X+=ce.length-3}return n}function la(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Ai(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function oi(e){return e.inclusiveLeft?-1:0}function si(e){return e.inclusiveRight?1:0}function Ti(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),x=dt(r.from,n.from)||oi(e)-oi(t);if(x)return-x;var B=dt(r.to,n.to)||si(e)-si(t);return B||t.id-e.id}function Nr(e,t){var i=rr&&e.markedSpans,r;if(i)for(var n=void 0,x=0;x<i.length;++x)n=i[x],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||Ti(r,n.marker)<0)&&(r=n.marker);return r}function Ur(e){return Nr(e,!0)}function Fr(e){return Nr(e,!1)}function wi(e,t){var i=rr&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var x=i[n];x.marker.collapsed&&(x.from==null||x.from<t)&&(x.to==null||x.to>t)&&(!r||Ti(r,x.marker)<0)&&(r=x.marker)}return r}function Pn(e,t,i,r,n){var x=Je(e,t),B=rr&&x.markedSpans;if(B)for(var K=0;K<B.length;++K){var X=B[K];if(!X.marker.collapsed)continue;var te=X.marker.find(0),ce=dt(te.from,i)||oi(X.marker)-oi(n),pe=dt(te.to,r)||si(X.marker)-si(n);if(ce>=0&&pe<=0||ce<=0&&pe>=0)continue;if(ce<=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?dt(te.to,i)>=0:dt(te.to,i)>0)||ce>=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?dt(te.from,r)<=0:dt(te.from,r)<0))return!0}}function yr(e){for(var t;t=Ur(e);)e=t.find(-1,!0).line;return e}function _n(e){for(var t;t=Fr(e);)e=t.find(1,!0).line;return e}function Di(e){for(var t,i;t=Fr(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qi(e,t){var i=Je(e,t),r=yr(i);return i==r?t:pt(r)}function Vr(e,t){if(t>e.lastLine())return t;var i=Je(e,t),r;if(!Mr(e,i))return t;for(;r=Fr(i);)i=r.find(1,!0).line;return pt(i)+1}function Mr(e,t){var i=rr&&t.markedSpans;if(i)for(var r=void 0,n=0;n<i.length;++n){if(r=i[n],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&$i(e,t,r))return!0}}function $i(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return $i(e,r.line,Dr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,x=0;x<t.markedSpans.length;++x)if(n=t.markedSpans[x],n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&$i(e,t,n))return!0}function Lr(e){e=yr(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var x=i.parent;x;i=x,x=i.parent)for(var B=0;B<x.children.length;++B){var K=x.children[B];if(K==i)break;t+=K.height}return t}function en(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=Ur(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=Fr(r);){var x=i.find(0,!0);t-=r.text.length-x.from.ch,r=x.to.line,t+=r.text.length-x.to.ch}return t}function Bn(e){var t=e.display,i=e.doc;t.maxLine=Je(i,i.first),t.maxLineLength=en(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=en(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var li=function(e,t,i){this.text=e,Ai(this,t),this.height=i?i(this):1};li.prototype.lineNo=function(){return pt(this)},se(li);function ua(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),Ai(e,i);var n=r?r(e):1;n!=e.height&&mt(e,n)}function at(e){e.parent=null,la(e)}var ct={},ut={};function yt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ut:ct;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function At(e,t){var i=v("span",null,null,O?"padding-right: .1px":null),r={pre:v("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var x=n?t.rest[n-1]:t.line,B=void 0;r.pos=0,r.addToken=Ct,vt(e.display.measure)&&(B=Xe(x,e.doc.direction))&&(r.addToken=ar(r.addToken,B)),r.map=[];var K=t!=e.display.externalMeasured&&pt(x);Wr(x,r,ni(e,x,K)),x.styleClasses&&(x.styleClasses.bgClass&&(r.bgClass=Q(x.styleClasses.bgClass,r.bgClass||"")),x.styleClasses.textClass&&(r.textClass=Q(x.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(et(e.display.measure))),n==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(O){var X=r.content.lastChild;(/\bcm-tab\b/.test(X.className)||X.querySelector&&X.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return oe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Q(r.pre.className,r.textClass||"")),r}function Rt(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 Ct(e,t,i,r,n,x,B){if(!t)return;var K=e.splitSpaces?Ht(t,e.trailingSpace):t,X=e.cm.state.specialChars,te=!1,ce;if(!X.test(t))e.col+=t.length,ce=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,ce),W&&F<9&&(te=!0),e.pos+=t.length;else{ce=document.createDocumentFragment();for(var pe=0;;){X.lastIndex=pe;var Ce=X.exec(t),xe=Ce?Ce.index-pe:t.length-pe;if(xe){var Me=document.createTextNode(K.slice(pe,pe+xe));W&&F<9?ce.appendChild(a("span",[Me])):ce.appendChild(Me),e.map.push(e.pos,e.pos+xe,Me),e.col+=xe,e.pos+=xe}if(!Ce)break;pe+=xe+1;var Ue=void 0;if(Ce[0]==" "){var je=e.cm.options.tabSize,ze=je-e.col%je;Ue=ce.appendChild(a("span",j(ze),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=ze}else Ce[0]=="\r"||Ce[0]==`
`?(Ue=ce.appendChild(a("span",Ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ue.setAttribute("cm-text",Ce[0]),e.col+=1):(Ue=e.cm.options.specialCharPlaceholder(Ce[0]),Ue.setAttribute("cm-text",Ce[0]),W&&F<9?ce.appendChild(a("span",[Ue])):ce.appendChild(Ue),e.col+=1);e.map.push(e.pos,e.pos+1,Ue),e.pos++}}if(e.trailingSpace=K.charCodeAt(t.length-1)==32,i||r||n||te||x||B){var qe=i||"";r&&(qe+=r),n&&(qe+=n);var Ke=a("span",[ce],qe,x);if(B)for(var tt in B)B.hasOwnProperty(tt)&&tt!="style"&&tt!="class"&&Ke.setAttribute(tt,B[tt]);return e.content.appendChild(Ke)}e.content.appendChild(ce)}function Ht(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var x=e.charAt(n);x==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(x="\xA0"),r+=x,i=x==" "}return r}function ar(e,t){return function(i,r,n,x,B,K,X){n=n?n+" cm-force-border":"cm-force-border";for(var te=i.pos,ce=te+r.length;;){for(var pe=void 0,Ce=0;Ce<t.length&&!(pe=t[Ce],pe.to>te&&pe.from<=te);Ce++);if(pe.to>=ce)return e(i,r,n,x,B,K,X);e(i,r.slice(0,pe.to-te),n,x,null,K,X),x=null,r=r.slice(pe.to-te),te=pe.to}}}function bt(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function Wr(e,t,i){var r=e.markedSpans,n=e.text,x=0;if(!r){for(var B=1;B<i.length;B+=2)t.addToken(t,n.slice(x,x=i[B]),yt(i[B+1],t.cm.options));return}for(var K=n.length,X=0,te=1,ce="",pe,Ce,xe=0,Me,Ue,je,ze,qe;;){if(xe==X){Me=Ue=je=Ce="",qe=null,ze=null,xe=Infinity;for(var Ke=[],tt=void 0,ht=0;ht<r.length;++ht){var lt=r[ht],gt=lt.marker;if(gt.type=="bookmark"&&lt.from==X&&gt.widgetNode)Ke.push(gt);else if(lt.from<=X&&(lt.to==null||lt.to>X||gt.collapsed&&lt.to==X&&lt.from==X)){if(lt.to!=null&&lt.to!=X&&xe>lt.to&&(xe=lt.to,Ue=""),gt.className&&(Me+=" "+gt.className),gt.css&&(Ce=(Ce?Ce+";":"")+gt.css),gt.startStyle&&lt.from==X&&(je+=" "+gt.startStyle),gt.endStyle&&lt.to==xe&&(tt||(tt=[])).push(gt.endStyle,lt.to),gt.title&&((qe||(qe={})).title=gt.title),gt.attributes)for(var It in gt.attributes)(qe||(qe={}))[It]=gt.attributes[It];gt.collapsed&&(!ze||Ti(ze.marker,gt)<0)&&(ze=lt)}else lt.from>X&&xe>lt.from&&(xe=lt.from)}if(tt)for(var Vt=0;Vt<tt.length;Vt+=2)tt[Vt+1]==xe&&(Ue+=" "+tt[Vt]);if(!ze||ze.from==X)for(var Bt=0;Bt<Ke.length;++Bt)bt(t,0,Ke[Bt]);if(ze&&(ze.from||0)==X){if(bt(t,(ze.to==null?K+1:ze.to)-X,ze.marker,ze.from==null),ze.to==null)return;ze.to==X&&(ze=!1)}}if(X>=K)break;for(var pr=Math.min(K,xe);;){if(ce){var ur=X+ce.length;if(!ze){var Wt=ur>pr?ce.slice(0,pr-X):ce;t.addToken(t,Wt,pe?pe+Me:Me,je,X+Wt.length==xe?Ue:"",Ce,qe)}if(ur>=pr){ce=ce.slice(pr-X),X=pr;break}X=ur,je=""}ce=n.slice(x,x=i[te++]),pe=yt(i[te++],t.cm.options)}}}function Dt(e,t,i){this.line=t,this.rest=Di(t),this.size=this.rest?pt(T(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Mr(e,t)}function or(e,t,i){for(var r=[],n,x=t;x<i;x=n){var B=new Dt(e.doc,Je(e.doc,x),x);n=x+B.size,r.push(B)}return r}var $t=null;function Cr(e){$t?$t.ops.push(e):e.ownsGroup=$t={ops:[e],delayedCallbacks:[]}}function Rs(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function Is(e,t){var i=e.ownsGroup;if(!i)return;try{Rs(i)}finally{$t=null,t(i)}}var tn=null;function Zt(e,t){var i=it(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),n;$t?n=$t.delayedCallbacks:tn?n=tn:(n=tn=[],setTimeout(Ms,0));for(var x=function(K){n.push(function(){return i[K].apply(null,r)})},B=0;B<i.length;++B)x(B)}function Ms(){var e=tn;tn=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,i,r){for(var n=0;n<t.changes.length;n++){var x=t.changes[n];x=="text"?Ps(e,t):x=="gutter"?Ja(e,t,i,r):x=="class"?ha(e,t):x=="widget"&&_s(e,t,r)}t.changes=null}function rn(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),W&&F<8&&(e.node.style.zIndex=2)),e.node}function Os(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=rn(t);t.background=r.insertBefore(a("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function Xa(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):At(e,t)}function Ps(e,t){var i=t.text.className,r=Xa(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,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){Os(e,t),t.line.wrapClass?rn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,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 n=rn(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),n.insertBefore(t.gutterBackground,t.text)}var x=t.line.gutterMarkers;if(e.options.lineNumbers||x){var B=rn(t),K=t.gutter=a("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(K),B.insertBefore(K,t.text),t.line.gutterClass&&(K.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!x||!x["CodeMirror-linenumbers"])&&(t.lineNumber=K.appendChild(a("div",Ft(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),x)for(var X=0;X<e.display.gutterSpecs.length;++X){var te=e.display.gutterSpecs[X].className,ce=x.hasOwnProperty(te)&&x[te];ce&&K.appendChild(a("div",[ce],"CodeMirror-gutter-elt","left: "+r.gutterLeft[te]+"px; width: "+r.gutterWidth[te]+"px"))}}}function _s(e,t,i){t.alignable&&(t.alignable=null);for(var r=b("CodeMirror-linewidget"),n=t.node.firstChild,x=void 0;n;n=x)x=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);Za(e,t,i)}function Bs(e,t,i,r){var n=Xa(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),ha(e,t),Ja(e,t,i,r),Za(e,t,r),t.node}function Za(e,t,i){if(qa(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)qa(e,t.rest[r],t,i,!1)}function qa(e,t,i,r,n){if(!t.widgets)return;for(var x=rn(i),B=0,K=t.widgets;B<K.length;++B){var X=K[B],te=a("div",[X.node],"CodeMirror-linewidget"+(X.className?" "+X.className:""));X.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Ns(X,te,i,r),e.display.input.setUneditable(te),n&&X.above?x.insertBefore(te,i.gutter||i.text):x.appendChild(te),Zt(X,"redraw")}}function Ns(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function nn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),l(t.display.measure,a("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function jr(e,t){for(var i=me(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Nn(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=l(e.measure,a("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Or(e){return Ee-e.display.nativeBarWidth}function ui(e){return e.display.scroller.clientWidth-Or(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-Or(e)-e.display.barHeight}function Us(e,t,i){var r=e.options.lineWrapping,n=r&&ui(e);if(!t.measure.heights||r&&t.measure.width!=n){var x=t.measure.heights=[];if(r){t.measure.width=n;for(var B=t.text.firstChild.getClientRects(),K=0;K<B.length-1;K++){var X=B[K],te=B[K+1];Math.abs(X.bottom-te.bottom)>2&&x.push((X.bottom+te.top)/2-i.top)}}x.push(i.bottom-i.top)}}function eo(e,t,i){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 n=0;n<e.rest.length;n++)if(pt(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Fs(e,t){t=yr(t);var i=pt(t),r=e.display.externalMeasured=new Dt(e.doc,t,i);r.lineN=i;var n=r.built=At(e,r);return r.text=n.pre,l(e.display.lineMeasure,n.pre),r}function to(e,t,i,r){return Pr(e,Li(e,t),i,r)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ci(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Li(e,t){var i=pt(t),r=fa(e,i);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,i,ba(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var n=eo(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Pr(e,t,i,r,n){t.before&&(i=-1);var x=i+(r||""),B;return t.cache.hasOwnProperty(x)?B=t.cache[x]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),B=js(e,t,i,r),B.bogus||(t.cache[x]=B)),{left:B.left,right:B.right,top:n?B.rtop:B.top,bottom:n?B.rbottom:B.bottom}}var ro={left:0,right:0,top:0,bottom:0};function io(e,t,i){for(var r,n,x,B,K,X,te=0;te<e.length;te+=3)if(K=e[te],X=e[te+1],t<K?(n=0,x=1,B="left"):t<X?(n=t-K,x=n+1):(te==e.length-3||t==X&&e[te+3]>t)&&(x=X-K,n=x-1,t>=X&&(B="right")),n!=null){if(r=e[te+2],K==X&&i==(r.insertLeft?"left":"right")&&(B=i),i=="left"&&n==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)r=e[(te-=3)+2],B="left";if(i=="right"&&n==X-K)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)r=e[(te+=3)+2],B="right";break}return{node:r,start:n,end:x,collapse:B,coverStart:K,coverEnd:X}}function Ws(e,t){var i=ro;if(t=="left")for(var r=0;r<e.length&&!((i=e[r]).left!=i.right);r++);else for(var n=e.length-1;n>=0&&!((i=e[n]).left!=i.right);n--);return i}function js(e,t,i,r){var n=io(t.map,i,r),x=n.node,B=n.start,K=n.end,X=n.collapse,te;if(x.nodeType==3){for(var ce=0;ce<4;ce++){for(;B&&Oe(t.line.text.charAt(n.coverStart+B));)--B;for(;n.coverStart+K<n.coverEnd&&Oe(t.line.text.charAt(n.coverStart+K));)++K;if(W&&F<9&&B==0&&K==n.coverEnd-n.coverStart?te=x.parentNode.getBoundingClientRect():te=Ws(f(x,B,K).getClientRects(),r),te.left||te.right||B==0)break;K=B,B=B-1,X="right"}W&&F<11&&(te=Hs(e.display.measure,te))}else{B>0&&(X=r="right");var pe;e.options.lineWrapping&&(pe=x.getClientRects()).length>1?te=pe[r=="right"?pe.length-1:0]:te=x.getBoundingClientRect()}if(W&&F<9&&!B&&(!te||!te.left&&!te.right)){var Ce=x.parentNode.getClientRects()[0];Ce?te={left:Ce.left,right:Ce.left+Ri(e.display),top:Ce.top,bottom:Ce.bottom}:te=ro}for(var xe=te.top-t.rect.top,Me=te.bottom-t.rect.top,Ue=(xe+Me)/2,je=t.view.measure.heights,ze=0;ze<je.length-1&&!(Ue<je[ze]);ze++);var qe=ze?je[ze-1]:0,Ke=je[ze],tt={left:(X=="right"?te.right:te.left)-t.rect.left,right:(X=="left"?te.left:te.right)-t.rect.left,top:qe,bottom:Ke};return!te.left&&!te.right&&(tt.bogus=!0),e.options.singleCursorHeightPerLine||(tt.rtop=xe,tt.rbottom=Me),tt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!_t(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function no(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,d(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)no(e.display.view[t])}function an(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 g&&h?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return g&&h?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=nn(e.widgets[i]));return t}function Un(e,t,i,r,n){if(!n){var x=pa(t);i.top+=x,i.bottom+=x}if(r=="line")return i;r||(r="local");var B=Lr(t);if(r=="local"?B+=Nn(e.display):B-=e.display.viewOffset,r=="page"||r=="window"){var K=e.display.lineSpace.getBoundingClientRect();B+=K.top+(r=="window"?0:so());var X=K.left+(r=="window"?0:oo());i.left+=X,i.right+=X}return i.top+=B,i.bottom+=B,i}function lo(e,t,i){if(i=="div")return t;var r=t.left,n=t.top;if(i=="page")r-=oo(),n-=so();else if(i=="local"||!i){var x=e.display.sizer.getBoundingClientRect();r+=x.left,n+=x.top}var B=e.display.lineSpace.getBoundingClientRect();return{left:r-B.left,top:n-B.top}}function ma(e,t,i,r,n){return r||(r=Je(e.doc,t.line)),Un(e,r,to(e,r,t.ch,n),i)}function kr(e,t,i,r,n,x){r=r||Je(e.doc,t.line),n||(n=Li(e,r));function B(Me,Ue){var je=Pr(e,n,Me,Ue?"right":"left",x);return Ue?je.left=je.right:je.right=je.left,Un(e,r,je,i)}var K=Xe(r,e.doc.direction),X=t.ch,te=t.sticky;if(X>=r.text.length?(X=r.text.length,te="before"):X<=0&&(X=0,te="after"),!K)return B(te=="before"?X-1:X,te=="before");function ce(Me,Ue,je){var ze=K[Ue],qe=ze.level==1;return B(je?Me-1:Me,qe!=je)}var pe=Ye(K,X,te),Ce=Qe,xe=ce(X,pe,te=="before");return Ce!=null&&(xe.other=ce(X,Ce,te!="before")),xe}function uo(e,t){var i=0;t=ft(e.doc,t),e.options.lineWrapping||(i=Ri(e.display)*t.ch);var r=Je(e.doc,t.line),n=Lr(r)+Nn(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function ga(e,t,i,r,n){var x=Fe(e,t,i);return x.xRel=n,r&&(x.outside=r),x}function va(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return ga(r.first,0,null,-1,-1);var n=wt(r,i),x=r.first+r.size-1;if(n>x)return ga(r.first+r.size-1,Je(r,x).text.length,null,1,1);t<0&&(t=0);for(var B=Je(r,n);;){var K=Gs(e,B,n,t,i),X=wi(B,K.ch+(K.xRel>0||K.outside>0?1:0));if(!X)return K;var te=X.find(1);if(te.line==n)return te;B=Je(r,n=te.line)}}function ho(e,t,i,r){r-=pa(t);var n=t.text.length,x=Ge(function(B){return Pr(e,i,B-1).bottom<=r},n,0);return n=Ge(function(B){return Pr(e,i,B).top>r},x,n),{begin:x,end:n}}function co(e,t,i,r){i||(i=Li(e,t));var n=Un(e,t,Pr(e,i,r),"line").top;return ho(e,t,i,n)}function ya(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Gs(e,t,i,r,n){n-=Lr(t);var x=Li(e,t),B=pa(t),K=0,X=t.text.length,te=!0,ce=Xe(t,e.doc.direction);if(ce){var pe=(e.options.lineWrapping?Ks:zs)(e,t,i,x,ce,r,n);te=pe.level!=1,K=te?pe.from:pe.to-1,X=te?pe.to:pe.from-1}var Ce=null,xe=null,Me=Ge(function(ht){var lt=Pr(e,x,ht);return lt.top+=B,lt.bottom+=B,ya(lt,r,n,!1)?(lt.top<=n&&lt.left<=r&&(Ce=ht,xe=lt),!0):!1},K,X),Ue,je,ze=!1;if(xe){var qe=r-xe.left<xe.right-r,Ke=qe==te;Me=Ce+(Ke?0:1),je=Ke?"after":"before",Ue=qe?xe.left:xe.right}else{!te&&(Me==X||Me==K)&&Me++,je=Me==0?"after":Me==t.text.length?"before":Pr(e,x,Me-(te?1:0)).bottom+B<=n==te?"after":"before";var tt=kr(e,Fe(i,Me,je),"line",t,x);Ue=tt.left,ze=n<tt.top?-1:n>=tt.bottom?1:0}return Me=_e(t.text,Me,1),ga(i,Me,je,ze,r-Ue)}function zs(e,t,i,r,n,x,B){var K=Ge(function(pe){var Ce=n[pe],xe=Ce.level!=1;return ya(kr(e,Fe(i,xe?Ce.to:Ce.from,xe?"before":"after"),"line",t,r),x,B,!0)},0,n.length-1),X=n[K];if(K>0){var te=X.level!=1,ce=kr(e,Fe(i,te?X.from:X.to,te?"after":"before"),"line",t,r);ya(ce,x,B,!0)&&ce.top>B&&(X=n[K-1])}return X}function Ks(e,t,i,r,n,x,B){var K=ho(e,t,r,B),X=K.begin,te=K.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var ce=null,pe=null,Ce=0;Ce<n.length;Ce++){var xe=n[Ce];if(xe.from>=te||xe.to<=X)continue;var Me=xe.level!=1,Ue=Pr(e,r,Me?Math.min(te,xe.to)-1:Math.max(X,xe.from)).right,je=Ue<x?x-Ue+1e9:Ue-x;(!ce||pe>je)&&(ce=xe,pe=je)}return ce||(ce=n[n.length-1]),ce.from<X&&(ce={from:X,to:ce.to,level:ce.level}),ce.to>te&&(ce={from:ce.from,to:te,level:ce.level}),ce}var hi;function ki(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(hi==null){hi=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)hi.appendChild(document.createTextNode("x")),hi.appendChild(a("br"));hi.appendChild(document.createTextNode("x"))}l(e.measure,hi);var i=hi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),d(e.measure),i||1}function Ri(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),i=a("pre",[t],"CodeMirror-line-like");l(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function ba(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,x=t.gutters.firstChild,B=0;x;x=x.nextSibling,++B){var K=e.display.gutterSpecs[B].className;i[K]=x.offsetLeft+x.clientLeft+n,r[K]=x.clientWidth}return{fixedPos:Ea(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ea(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fo(e){var t=ki(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Ri(e.display)-3);return function(n){if(Mr(e.doc,n))return 0;var x=0;if(n.widgets)for(var B=0;B<n.widgets.length;B++)n.widgets[B].height&&(x+=n.widgets[B].height);return i?x+(Math.ceil(n.text.length/r)||1)*t:x+t}}function xa(e){var t=e.doc,i=fo(e);t.iter(function(r){var n=i(r);n!=r.height&&mt(r,n)})}function di(e,t,i,r){var n=e.display;if(!i&&me(t).getAttribute("cm-not-content")=="true")return null;var x,B,K=n.lineSpace.getBoundingClientRect();try{x=t.clientX-K.left,B=t.clientY-K.top}catch(pe){return null}var X=va(e,x,B),te;if(r&&X.xRel>0&&(te=Je(e.doc,X.line).text).length==X.ch){var ce=ae(te,te.length,e.options.tabSize)-te.length;X=Fe(X.line,Math.max(0,Math.round((x-$a(e.display).left)/Ri(e.display))-ce))}return X}function ci(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function sr(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)rr&&qi(e.doc,t)<n.viewTo&&Yr(e);else if(i<=n.viewFrom)rr&&Vr(e.doc,i+r)>n.viewFrom?Yr(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Yr(e);else if(t<=n.viewFrom){var x=Fn(e,i,i+r,1);x?(n.view=n.view.slice(x.index),n.viewFrom=x.lineN,n.viewTo+=r):Yr(e)}else if(i>=n.viewTo){var B=Fn(e,t,t,-1);B?(n.view=n.view.slice(0,B.index),n.viewTo=B.lineN):Yr(e)}else{var K=Fn(e,t,t,-1),X=Fn(e,i,i+r,1);K&&X?(n.view=n.view.slice(0,K.index).concat(or(e,K.lineN,X.lineN)).concat(n.view.slice(X.index)),n.viewTo+=r):Yr(e)}var te=n.externalMeasured;te&&(i<te.lineN?te.lineN+=r:t<te.lineN+te.size&&(n.externalMeasured=null))}function Qr(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var x=r.view[ci(e,t)];if(x.node==null)return;var B=x.changes||(x.changes=[]);ge(B,i)==-1&&B.push(i)}function Yr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fn(e,t,i,r){var n=ci(e,t),x,B=e.display.view;if(!rr||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var K=e.display.viewFrom,X=0;X<n;X++)K+=B[X].size;if(K!=t){if(r>0){if(n==B.length-1)return null;x=K+B[n].size-t,n++}else x=K-t;t+=x,i+=x}for(;qi(e.doc,i)!=i;){if(n==(r<0?0:B.length-1))return null;i+=r*B[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Vs(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=or(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=or(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ci(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(or(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,ci(e,i)))),r.viewTo=i}function po(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function on(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mo(e,t){t===void 0&&(t=!0);for(var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),x=r.selection=document.createDocumentFragment(),B=0;B<i.sel.ranges.length;B++){if(!t&&B==i.sel.primIndex)continue;var K=i.sel.ranges[B];if(K.from().line>=e.display.viewTo||K.to().line<e.display.viewFrom)continue;var X=K.empty();(X||e.options.showCursorWhenSelecting)&&go(e,K.head,n),X||Qs(e,K,x)}return r}function go(e,t,i){var r=kr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(a("div","\xA0","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var x=i.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 Wn(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,i){var r=e.display,n=e.doc,x=document.createDocumentFragment(),B=$a(e.display),K=B.left,X=Math.max(r.sizerWidth,ui(e)-r.sizer.offsetLeft)-B.right,te=n.direction=="ltr";function ce(Ke,tt,ht,lt){tt<0&&(tt=0),tt=Math.round(tt),lt=Math.round(lt),x.appendChild(a("div",null,"CodeMirror-selected","position: absolute; left: "+Ke+`px;
top: `+tt+"px; width: "+(ht==null?X-Ke:ht)+`px;
height: `+(lt-tt)+"px"))}function pe(Ke,tt,ht){var lt=Je(n,Ke),gt=lt.text.length,It,Vt;function Bt(Wt,hr){return ma(e,Fe(Ke,Wt),"div",lt,hr)}function pr(Wt,hr,qt){var Gt=co(e,lt,null,Wt),jt=hr=="ltr"==(qt=="after")?"left":"right",Nt=qt=="after"?Gt.begin:Gt.end-(/\s/.test(lt.text.charAt(Gt.end-1))?2:1);return Bt(Nt,jt)[jt]}var ur=Xe(lt,n.direction);return Ve(ur,tt||0,ht==null?gt:ht,function(Wt,hr,qt,Gt){var jt=qt=="ltr",Nt=Bt(Wt,jt?"left":"right"),dr=Bt(hr-1,jt?"right":"left"),Gi=tt==null&&Wt==0,ei=ht==null&&hr==gt,tr=Gt==0,_r=!ur||Gt==ur.length-1;if(dr.top-Nt.top<=3){var Qt=(te?Gi:ei)&&tr,Va=(te?ei:Gi)&&_r,Gr=Qt?K:(jt?Nt:dr).left,vi=Va?X:(jt?dr:Nt).right;ce(Gr,Nt.top,vi-Gr,Nt.bottom)}else{var yi,nr,zi,Qa;jt?(yi=te&&Gi&&tr?K:Nt.left,nr=te?X:pr(Wt,qt,"before"),zi=te?K:pr(hr,qt,"after"),Qa=te&&ei&&_r?X:dr.right):(yi=te?pr(Wt,qt,"before"):K,nr=!te&&Gi&&tr?X:Nt.right,zi=!te&&ei&&_r?K:dr.left,Qa=te?pr(hr,qt,"after"):X),ce(yi,Nt.top,nr-yi,Nt.bottom),Nt.bottom<dr.top&&ce(K,Nt.bottom,null,dr.top),ce(zi,dr.top,Qa-zi,dr.bottom)}(!It||Wn(Nt,It)<0)&&(It=Nt),Wn(dr,It)<0&&(It=dr),(!Vt||Wn(Nt,Vt)<0)&&(Vt=Nt),Wn(dr,Vt)<0&&(Vt=dr)}),{start:It,end:Vt}}var Ce=t.from(),xe=t.to();if(Ce.line==xe.line)pe(Ce.line,Ce.ch,xe.ch);else{var Me=Je(n,Ce.line),Ue=Je(n,xe.line),je=yr(Me)==yr(Ue),ze=pe(Ce.line,Ce.ch,je?Me.text.length+1:null).end,qe=pe(xe.line,je?0:null,xe.ch).start;je&&(ze.top<qe.top-2?(ce(ze.right,ze.top,null,ze.bottom),ce(K,qe.top,qe.left,qe.bottom)):ce(ze.right,ze.top,qe.left-ze.right,ze.bottom)),ze.bottom<qe.top&&ce(K,ze.bottom,null,qe.top)}i.appendChild(x)}function Ca(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ii(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Sa(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ii(e))},100)}function Sa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(oe(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ca(e)}function Ii(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(oe(e,"blur",e,t),e.state.focused=!1,c(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function jn(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var n=t.view[r],x=e.options.lineWrapping,B=void 0,K=0;if(n.hidden)continue;if(W&&F<8){var X=n.node.offsetTop+n.node.offsetHeight;B=X-i,i=X}else{var te=n.node.getBoundingClientRect();B=te.bottom-te.top,!x&&n.text.firstChild&&(K=n.text.firstChild.getBoundingClientRect().right-te.left-1)}var ce=n.line.height-B;if((ce>.005||ce<-.005)&&(mt(n.line,B),bo(n.line),n.rest))for(var pe=0;pe<n.rest.length;pe++)bo(n.rest[pe]);if(K>e.display.sizerWidth){var Ce=Math.ceil(K/Ri(e.display));Ce>e.display.maxLineLength&&(e.display.maxLineLength=Ce,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}}function bo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Hn(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Nn(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,x=wt(t,r),B=wt(t,n);if(i&&i.ensure){var K=i.ensure.from.line,X=i.ensure.to.line;K<x?(x=K,B=wt(t,Lr(Je(t,K))+e.wrapper.clientHeight)):Math.min(X,t.lastLine())>=B&&(x=wt(t,Lr(Je(t,X))-e.wrapper.clientHeight),B=X)}return{from:x,to:Math.max(B,x+1)}}function Ys(e,t){if(Z(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),n=null;if(t.top+r.top<0?n=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),n!=null&&!A){var x=a("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Nn(e.display))+`px;
height: `+(t.bottom-t.top+Or(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(x),x.scrollIntoView(n),e.display.lineSpace.removeChild(x)}}function Xs(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(t=t.ch?Fe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Fe(t.line,t.ch+1,"before"):t);for(var x=0;x<5;x++){var B=!1,K=kr(e,t),X=!i||i==t?K:kr(e,i);n={left:Math.min(K.left,X.left),top:Math.min(K.top,X.top)-r,right:Math.max(K.left,X.left),bottom:Math.max(K.bottom,X.bottom)+r};var te=Aa(e,n),ce=e.doc.scrollTop,pe=e.doc.scrollLeft;if(te.scrollTop!=null&&(ln(e,te.scrollTop),Math.abs(e.doc.scrollTop-ce)>1&&(B=!0)),te.scrollLeft!=null&&(fi(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-pe)>1&&(B=!0)),!B)break}return n}function Js(e,t){var i=Aa(e,t);i.scrollTop!=null&&ln(e,i.scrollTop),i.scrollLeft!=null&&fi(e,i.scrollLeft)}function Aa(e,t){var i=e.display,r=ki(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,x=ca(e),B={};t.bottom-t.top>x&&(t.bottom=t.top+x);var K=e.doc.height+da(i),X=t.top<r,te=t.bottom>K-r;if(t.top<n)B.scrollTop=X?0:t.top;else if(t.bottom>n+x){var ce=Math.min(t.top,(te?K:t.bottom)-x);ce!=n&&(B.scrollTop=ce)}var pe=e.options.fixedGutter?0:i.gutters.offsetWidth,Ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-pe,xe=ui(e)-i.gutters.offsetWidth,Me=t.right-t.left>xe;return Me&&(t.right=t.left+xe),t.left<10?B.scrollLeft=0:t.left<Ce?B.scrollLeft=Math.max(0,t.left+pe-(Me?0:10)):t.right>xe+Ce-3&&(B.scrollLeft=t.right+(Me?0:10)-xe),B}function Ta(e,t){if(t==null)return;Gn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Mi(e){Gn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sn(e,t,i){(t!=null||i!=null)&&Gn(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Gn(e),e.curOp.scrollToPos=t}function Gn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=uo(e,t.from),r=uo(e,t.to);Eo(e,i,r,t.margin)}}function Eo(e,t,i,r){var n=Aa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});sn(e,n.scrollLeft,n.scrollTop)}function ln(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;k||Da(e,{top:t}),xo(e,t,!0),k&&Da(e),dn(e,100)}function xo(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function fi(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?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 un(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+da(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?i:0,docHeight:r,scrollHeight:r+Or(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var pi=function(e,t,i){this.cm=i;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),De(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),De(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var x=e.viewWidth-e.barLeft-(i?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:i?r:0,bottom:t?r:0}},pi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pi.prototype.zeroWidthHack=function(){var e=s&&!w?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new fe,this.disableVert=new fe},pi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),x=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);x!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},pi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hn=function(){};hn.prototype.update=function(){return{bottom:0,right:0}},hn.prototype.setScrollLeft=function(){},hn.prototype.setScrollTop=function(){},hn.prototype.clear=function(){};function Oi(e,t){t||(t=un(e));var i=e.display.barWidth,r=e.display.barHeight;Co(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&jn(e),Co(e,un(e)),i=e.display.barWidth,r=e.display.barHeight}function Co(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var So={native:pi,null:hn};function Ao(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&c(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new So[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),De(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?fi(e,t):ln(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function mi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},Cr(e.curOp)}function gi(e){var t=e.curOp;t&&Is(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;$s(i)})}function $s(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var r=0;r<t.length;r++)tl(t[r]);for(var n=0;n<t.length;n++)rl(t[n]);for(var x=0;x<t.length;x++)il(t[x]);for(var B=0;B<t.length;B++)nl(t[B])}function el(e){var t=e.cm,i=t.display;ol(t),e.updateMaxLine&&Bn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new zn(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,i=t.display;e.updatedDisplay&&jn(t),e.barMeasure=un(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Or(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-ui(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&fi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Oi(t,e.barMeasure),e.updatedDisplay&&ka(t,e.barMeasure),e.selectionChanged&&Ca(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&vo(e.cm)}function nl(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&To(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&fi(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=Xs(t,ft(r,e.scrollToPos.from),ft(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,n)}var x=e.maybeHiddenMarkers,B=e.maybeUnhiddenMarkers;if(x)for(var K=0;K<x.length;++K)x[K].lines.length||oe(x[K],"hide");if(B)for(var X=0;X<B.length;++X)B[X].lines.length&&oe(B[X],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&oe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function fr(e,t){if(e.curOp)return t();mi(e);try{return t()}finally{gi(e)}}function zt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);mi(e);try{return t.apply(e,arguments)}finally{gi(e)}}}function ir(e){return function(){if(this.curOp)return e.apply(this,arguments);mi(this);try{return e.apply(this,arguments)}finally{gi(this)}}}function Kt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);mi(t);try{return e.apply(this,arguments)}finally{gi(t)}}}function dn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,z(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=Ar(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(x){if(r.line>=e.display.viewFrom){var B=x.styles,K=x.text.length>e.options.maxHighlightLength?Xt(t.mode,r.state):null,X=Ki(e,x,r,!0);K&&(r.state=K),x.styles=X.styles;var te=x.styleClasses,ce=X.classes;ce?x.styleClasses=ce:te&&(x.styleClasses=null);for(var pe=!B||B.length!=x.styles.length||te!=ce&&(!te||!ce||te.bgClass!=ce.bgClass||te.textClass!=ce.textClass),Ce=0;!pe&&Ce<B.length;++Ce)pe=B[Ce]!=x.styles[Ce];pe&&n.push(r.line),x.stateAfter=r.save(),r.nextLine()}else x.text.length<=e.options.maxHighlightLength&&Vi(e,x.text,r),x.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return dn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&fr(e,function(){for(var x=0;x<n.length;x++)Qr(e,n[x],"text")})}var zn=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Hn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ui(e),this.force=i,this.dims=ba(e),this.events=[]};zn.prototype.signal=function(e,t){ne(e,t)&&this.events.push(arguments)},zn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)oe.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=Or(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Or(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!E(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function wa(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Yr(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&po(e)==0)return!1;Do(e)&&(Yr(e),t.dims=ba(e));var n=r.first+r.size,x=Math.max(t.visible.from-e.options.viewportMargin,r.first),B=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<x&&x-i.viewFrom<20&&(x=Math.max(r.first,i.viewFrom)),i.viewTo>B&&i.viewTo-B<20&&(B=Math.min(n,i.viewTo)),rr&&(x=qi(e.doc,x),B=Vr(e.doc,B));var K=x!=i.viewFrom||B!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,x,B),i.viewOffset=Lr(Je(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var X=po(e);if(!K&&X==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var te=sl(e);return X>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),X>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(te),d(i.cursorDiv),d(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,K&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,dn(e,400)),i.updateLineNumbers=null,!0}function To(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ui(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+da(e.display)-ca(e),i.top)}),t.visible=Hn(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Hn(e.display,e.doc,i));if(!wa(e,t))break;jn(e);var n=un(e);on(e),Oi(e,n),ka(e,n),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 i=new zn(e,t);if(wa(e,i)){jn(e),To(e,i);var r=un(e);on(e),Oi(e,r),ka(e,r),i.finish()}}function ul(e,t,i){var r=e.display,n=e.options.lineNumbers,x=r.lineDiv,B=x.firstChild;function K(Me){var Ue=Me.nextSibling;return O&&s&&e.display.currentWheelTarget==Me?Me.style.display="none":Me.parentNode.removeChild(Me),Ue}for(var X=r.view,te=r.viewFrom,ce=0;ce<X.length;ce++){var pe=X[ce];if(!pe.hidden)if(!pe.node||pe.node.parentNode!=x){var Ce=Bs(e,pe,te,i);x.insertBefore(Ce,B)}else{for(;B!=pe.node;)B=K(B);var xe=n&&t!=null&&t<=te&&pe.lineNumber;pe.changes&&(ge(pe.changes,"gutter")>-1&&(xe=!1),Ya(e,pe,te,i)),xe&&(d(pe.lineNumber),pe.lineNumber.appendChild(document.createTextNode(Ft(e.options,te)))),B=pe.node.nextSibling}te+=pe.size}for(;B;)B=K(B)}function La(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ka(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+Or(e)+"px"}function wo(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,x=r+"px",B=0;B<i.length;B++)if(!i[B].hidden){e.options.fixedGutter&&(i[B].gutter&&(i[B].gutter.style.left=x),i[B].gutterBackground&&(i[B].gutterBackground.style.left=x));var K=i[B].alignable;if(K)for(var X=0;X<K.length;X++)K[X].style.left=x}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Ft(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(a("div",[a("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),x=n.firstChild.offsetWidth,B=n.offsetWidth-x;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(x,r.lineGutter.offsetWidth-B)+1,r.lineNumWidth=r.lineNumInnerWidth+B,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",La(e.display),!0}return!1}function Ra(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var x=e[n],B=null;if(typeof x!="string"&&(B=x.style,x=x.className),x=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:x,style:B})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Lo(e){var t=e.gutters,i=e.gutterSpecs;d(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],x=n.className,B=n.style,K=t.appendChild(a("div",null,"CodeMirror-gutter "+x));B&&(K.style.cssText=B),x=="CodeMirror-linenumbers"&&(e.lineGutter=K,K.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",La(e)}function cn(e){Lo(e.display),sr(e),wo(e)}function hl(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=a("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=a("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=v("div",null,"CodeMirror-code"),n.selectionDiv=a("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=a("div",null,"CodeMirror-cursors"),n.measure=a("div",null,"CodeMirror-measure"),n.lineMeasure=a("div",null,"CodeMirror-measure"),n.lineSpace=v("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var x=v("div",[n.lineSpace],"CodeMirror-lines");n.mover=a("div",[x],null,"position: relative"),n.sizer=a("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=a("div",null,null,"position: absolute; height: "+Ee+"px; width: 1px;"),n.gutters=a("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=a("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=a("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),W&&F<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!O&&!(k&&o)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=Ra(r.gutters,r.lineNumbers),Lo(n),i.init(n)}var Kn=0,br=null;W?br=-.53:k?br=15:g?br=-.7:I&&(br=-1/3);function ko(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=ko(e);return t.x*=br,t.y*=br,t}function Ro(e,t){var i=ko(t),r=i.x,n=i.y,x=e.display,B=x.scroller,K=B.scrollWidth>B.clientWidth,X=B.scrollHeight>B.clientHeight;if(!(r&&K||n&&X))return;if(n&&s&&O){e:for(var te=t.target,ce=x.view;te!=B;te=te.parentNode)for(var pe=0;pe<ce.length;pe++)if(ce[pe].node==te){e.display.currentWheelTarget=te;break e}}if(r&&!k&&!S&&br!=null){n&&X&&ln(e,Math.max(0,B.scrollTop+n*br)),fi(e,Math.max(0,B.scrollLeft+r*br)),(!n||n&&X)&&ee(t),x.wheelStartX=null;return}if(n&&br!=null){var Ce=n*br,xe=e.doc.scrollTop,Me=xe+x.wrapper.clientHeight;Ce<0?xe=Math.max(0,xe+Ce-50):Me=Math.min(e.doc.height,Me+Ce+50),Da(e,{top:xe,bottom:Me})}Kn<20&&(x.wheelStartX==null?(x.wheelStartX=B.scrollLeft,x.wheelStartY=B.scrollTop,x.wheelDX=r,x.wheelDY=n,setTimeout(function(){if(x.wheelStartX==null)return;var Ue=B.scrollLeft-x.wheelStartX,je=B.scrollTop-x.wheelStartY,ze=je&&x.wheelDY&&je/x.wheelDY||Ue&&x.wheelDX&&Ue/x.wheelDX;if(x.wheelStartX=x.wheelStartY=null,!ze)return;br=(br*Kn+ze)/(Kn+1),++Kn},200)):(x.wheelDX+=r,x.wheelDY+=n))}var Er=function(e,t){this.ranges=e,this.primIndex=t};Er.prototype.primary=function(){return this.ranges[this.primIndex]},Er.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 i=this.ranges[t],r=e.ranges[t];if(!ri(i.anchor,r.anchor)||!ri(i.head,r.head))return!1}return!0},Er.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Lt(bi(this.ranges[t].anchor),bi(this.ranges[t].head));return new Er(e,this.primIndex)},Er.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Er.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(dt(t,r.from())>=0&&dt(e,r.to())<=0)return i}return-1};var Lt=function(e,t){this.anchor=e,this.head=t};Lt.prototype.from=function(){return ii(this.anchor,this.head)},Lt.prototype.to=function(){return Ei(this.anchor,this.head)},Lt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Rr(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(Ce,xe){return dt(Ce.from(),xe.from())}),i=ge(t,n);for(var x=1;x<t.length;x++){var B=t[x],K=t[x-1],X=dt(K.to(),B.from());if(r&&!B.empty()?X>0:X>=0){var te=ii(K.from(),B.from()),ce=Ei(K.to(),B.to()),pe=K.empty()?B.from()==B.head:K.from()==K.head;x<=i&&--i,t.splice(--x,2,new Lt(pe?ce:te,pe?te:ce))}}return new Er(t,i)}function Xr(e,t){return new Er([new Lt(e,t||e)],0)}function Jr(e){return e.text?Fe(e.from.line+e.text.length-1,T(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Io(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return Jr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Jr(t).ch-t.to.ch),Fe(i,r)}function Ia(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new Lt(Io(n.anchor,t),Io(n.head,t)))}return Rr(e.cm,i,e.sel.primIndex)}function Mo(e,t,i){return e.line==t.line?Fe(i.line,e.ch-t.ch+i.ch):Fe(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var r=[],n=Fe(e.first,0),x=n,B=0;B<t.length;B++){var K=t[B],X=Mo(K.from,n,x),te=Mo(Jr(K),n,x);if(n=K.to,x=te,i=="around"){var ce=e.sel.ranges[B],pe=dt(ce.head,ce.anchor)<0;r[B]=new Lt(pe?te:X,pe?X:te)}else r[B]=new Lt(X,X)}return new Er(r,e.sel.primIndex)}function Ma(e){e.doc.mode=gr(e.options,e.doc.modeOption),fn(e)}function fn(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,dn(e,100),e.state.modeGen++,e.curOp&&sr(e)}function Oo(e,t){return t.from.ch==0&&t.to.ch==0&&T(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Oa(e,t,i,r){function n(qe){return i?i[qe]:null}function x(qe,Ke,tt){ua(qe,Ke,tt,r),Zt(qe,"change",qe,t)}function B(qe,Ke){for(var tt=[],ht=qe;ht<Ke;++ht)tt.push(new li(te[ht],n(ht),r));return tt}var K=t.from,X=t.to,te=t.text,ce=Je(e,K.line),pe=Je(e,X.line),Ce=T(te),xe=n(te.length-1),Me=X.line-K.line;if(t.full)e.insert(0,B(0,te.length)),e.remove(te.length,e.size-te.length);else if(Oo(e,t)){var Ue=B(0,te.length-1);x(pe,pe.text,xe),Me&&e.remove(K.line,Me),Ue.length&&e.insert(K.line,Ue)}else if(ce==pe)if(te.length==1)x(ce,ce.text.slice(0,K.ch)+Ce+ce.text.slice(X.ch),xe);else{var je=B(1,te.length-1);je.push(new li(Ce+ce.text.slice(X.ch),xe,r)),x(ce,ce.text.slice(0,K.ch)+te[0],n(0)),e.insert(K.line+1,je)}else if(te.length==1)x(ce,ce.text.slice(0,K.ch)+te[0]+pe.text.slice(X.ch),n(0)),e.remove(K.line+1,Me);else{x(ce,ce.text.slice(0,K.ch)+te[0],n(0)),x(pe,Ce+pe.text.slice(X.ch),xe);var ze=B(1,te.length-1);Me>1&&e.remove(K.line+1,Me-1),e.insert(K.line+1,ze)}Zt(e,"change",e,t)}function Zr(e,t,i){function r(n,x,B){if(n.linked)for(var K=0;K<n.linked.length;++K){var X=n.linked[K];if(X.doc==x)continue;var te=B&&X.sharedHist;if(i&&!te)continue;t(X.doc,te),r(X.doc,n,te)}}r(e,null,!0)}function Po(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||Bn(e),e.options.mode=t.modeOption,sr(e)}function _o(e){(e.doc.direction=="rtl"?H:c)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){fr(e,function(){_o(e),sr(e)})}function Vn(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 Pa(e,t){var i={from:bi(t.from),to:Jr(t),text:St(e,t.from,t.to)};return Uo(e,i,t.from.line,t.to.line+1),Zr(e,function(r){return Uo(r,i,t.from.line,t.to.line+1)},!0),i}function Bo(e){for(;e.length;){var t=T(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Bo(e.done),T(e.done);if(e.done.length&&!T(e.done).ranges)return T(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),T(e.done)}function No(e,t,i,r){var n=e.history;n.undone.length=0;var x=+new Date,B,K;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>x-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(B=pl(n,n.lastOp==r)))K=T(B.changes),dt(t.from,t.to)==0&&dt(t.from,K.to)==0?K.to=Jr(t):B.changes.push(Pa(e,t));else{var X=T(n.done);for((!X||!X.ranges)&&Qn(e.sel,n.done),B={changes:[Pa(e,t)],generation:n.generation},n.done.push(B);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=x,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,K||oe(e,"historyAdded")}function ml(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var n=e.history,x=r&&r.origin;i==n.lastSelOp||x&&n.lastSelOrigin==x&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==x||ml(e,x,T(n.done),t))?n.done[n.done.length-1]=t:Qn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=x,n.lastSelOp=i,r&&r.clearRedo!==!1&&Bo(n.undone)}function Qn(e,t){var i=T(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Uo(e,t,i,r){var n=t["spans_"+e.id],x=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(B){B.markedSpans&&((n||(n=t["spans_"+e.id]={}))[x]=B.markedSpans),++x})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(vl(i[n]));return r}function Fo(e,t){var i=yl(e,t),r=Si(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var x=i[n],B=r[n];if(x&&B){e:for(var K=0;K<B.length;++K){for(var X=B[K],te=0;te<x.length;++te)if(x[te].marker==X.marker)continue e;x.push(X)}}else B&&(i[n]=B)}return i}function Pi(e,t,i){for(var r=[],n=0;n<e.length;++n){var x=e[n];if(x.ranges){r.push(i?Er.prototype.deepCopy.call(x):x);continue}var B=x.changes,K=[];r.push({changes:K});for(var X=0;X<B.length;++X){var te=B[X],ce=void 0;if(K.push({from:te.from,to:te.to,text:te.text}),t)for(var pe in te)(ce=pe.match(/^spans_(\d+)$/))&&(ge(t,Number(ce[1]))>-1&&(T(K)[pe]=te[pe],delete te[pe]))}}return r}function _a(e,t,i,r){if(r){var n=e.anchor;if(i){var x=dt(t,n)<0;x!=dt(i,n)<0?(n=t,t=i):x!=dt(t,i)<0&&(t=i)}return new Lt(n,t)}else return new Lt(i||t,t)}function Yn(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),er(e,new Er([_a(e.sel.primary(),t,i,n)],0),r)}function Wo(e,t,i){for(var r=[],n=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,n);var B=Rr(e.cm,r,e.sel.primIndex);er(e,B,i)}function Ba(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,er(e,Rr(e.cm,n,e.sel.primIndex),r)}function jo(e,t,i,r){er(e,Xr(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var x=0;x<n.length;x++)this.ranges[x]=new Lt(ft(e,n[x].anchor),ft(e,n[x].head))},origin:i&&i.origin};return oe(e,"beforeSelectionChange",e,r),e.cm&&oe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Rr(e.cm,r.ranges,r.ranges.length-1):t}function Ho(e,t,i){var r=e.history.done,n=T(r);n&&n.ranges?(r[r.length-1]=t,Xn(e,t,i)):er(e,t,i)}function er(e,t,i){Xn(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Xn(e,t,i){(ne(e,"beforeSelectionChange")||e.cm&&ne(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(dt(t.primary().head,e.sel.primary().head)<0?-1:1);Go(e,Ko(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&Mi(e.cm)}function Go(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,J(e.cm)),Zt(e,"cursorActivity",e)}function zo(e){Go(e,Ko(e,e.sel,null,!1))}function Ko(e,t,i,r){for(var n,x=0;x<t.ranges.length;x++){var B=t.ranges[x],K=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[x],X=Jn(e,B.anchor,K&&K.anchor,i,r),te=Jn(e,B.head,K&&K.head,i,r);(n||X!=B.anchor||te!=B.head)&&(n||(n=t.ranges.slice(0,x)),n[x]=new Lt(X,te))}return n?Rr(e.cm,n,t.primIndex):t}function _i(e,t,i,r,n){var x=Je(e,t.line);if(x.markedSpans)for(var B=0;B<x.markedSpans.length;++B){var K=x.markedSpans[B],X=K.marker,te="selectLeft"in X?!X.selectLeft:X.inclusiveLeft,ce="selectRight"in X?!X.selectRight:X.inclusiveRight;if((K.from==null||(te?K.from<=t.ch:K.from<t.ch))&&(K.to==null||(ce?K.to>=t.ch:K.to>t.ch))){if(n&&(oe(X,"beforeCursorEnter"),X.explicitlyCleared))if(x.markedSpans){--B;continue}else break;if(!X.atomic)continue;if(i){var pe=X.find(r<0?1:-1),Ce=void 0;if((r<0?ce:te)&&(pe=Vo(e,pe,-r,pe&&pe.line==t.line?x:null)),pe&&pe.line==t.line&&(Ce=dt(pe,i))&&(r<0?Ce<0:Ce>0))return _i(e,pe,t,r,n)}var xe=X.find(r<0?-1:1);return(r<0?te:ce)&&(xe=Vo(e,xe,r,xe.line==t.line?x:null)),xe?_i(e,xe,t,r,n):null}}return t}function Jn(e,t,i,r,n){var x=r||1,B=_i(e,t,i,x,n)||!n&&_i(e,t,i,x,!0)||_i(e,t,i,-x,n)||!n&&_i(e,t,i,-x,!0);return B||(e.cantEdit=!0,Fe(e.first,0))}function Vo(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ft(e,Fe(t.line-1)):null:i>0&&t.ch==(r||Je(e,t.line)).text.length?t.line<e.first+e.size-1?Fe(t.line+1,0):null:new Fe(t.line,t.ch+i)}function Qo(e){e.setSelection(Fe(e.firstLine(),0),Fe(e.lastLine()),Se)}function Yo(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,x,B,K){n&&(r.from=ft(e,n)),x&&(r.to=ft(e,x)),B&&(r.text=B),K!==void 0&&(r.origin=K)}),oe(e,"beforeChange",e,r),e.cm&&oe(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 Bi(e,t,i){if(e.cm){if(!e.cm.curOp)return zt(e.cm,Bi)(e,t,i);if(e.cm.state.suppressEdits)return}if((ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var r=Ji&&!i&&On(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)Xo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Xo(e,t)}function Xo(e,t){if(t.text.length==1&&t.text[0]==""&&dt(t.from,t.to)==0)return;var i=Ia(e,t);No(e,t,i,e.cm?e.cm.curOp.id:NaN),pn(e,t,i,Si(e,t));var r=[];Zr(e,function(n,x){!x&&ge(r,n.history)==-1&&($o(n.history,t),r.push(n.history)),pn(n,t,null,Si(n,t))})}function Zn(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var n=e.history,x,B=e.sel,K=t=="undo"?n.done:n.undone,X=t=="undo"?n.undone:n.done,te=0;te<K.length&&!(x=K[te],i?x.ranges&&!x.equals(e.sel):!x.ranges);te++);if(te==K.length)return;for(n.lastOrigin=n.lastSelOrigin=null;;)if(x=K.pop(),x.ranges){if(Qn(x,X),i&&!x.equals(e.sel)){er(e,x,{clearRedo:!1});return}B=x}else if(r){K.push(x);return}else break;var ce=[];Qn(B,X),X.push({changes:ce,generation:n.generation}),n.generation=x.generation||++n.maxGeneration;for(var pe=ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"),Ce=function(Ue){var je=x.changes[Ue];if(je.origin=t,pe&&!Yo(e,je,!1))return K.length=0,{};ce.push(Pa(e,je));var ze=Ue?Ia(e,je):T(K);pn(e,je,ze,Fo(e,je)),!Ue&&e.cm&&e.cm.scrollIntoView({from:je.from,to:Jr(je)});var qe=[];Zr(e,function(Ke,tt){!tt&&ge(qe,Ke.history)==-1&&($o(Ke.history,je),qe.push(Ke.history)),pn(Ke,je,null,Fo(Ke,je))})},xe=x.changes.length-1;xe>=0;--xe){var Me=Ce(xe);if(Me)return Me.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Er(L(e.sel.ranges,function(n){return new Lt(Fe(n.anchor.line+t,n.anchor.ch),Fe(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm){sr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Qr(e.cm,r,"gutter")}}function pn(e,t,i,r){if(e.cm&&!e.cm.curOp)return zt(e.cm,pn)(e,t,i,r);if(t.to.line<e.first){Jo(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 n=t.text.length-1-(e.first-t.from.line);Jo(e,n),t={from:Fe(e.first,0),to:Fe(t.to.line+n,t.to.ch),text:[T(t.text)],origin:t.origin}}var x=e.lastLine();t.to.line>x&&(t={from:t.from,to:Fe(x,Je(e,x).text.length),text:[t.text[0]],origin:t.origin}),t.removed=St(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?El(e.cm,t,r):Oa(e,t,r),Xn(e,i,Se),e.cantEdit&&Jn(e,Fe(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,n=e.display,x=t.from,B=t.to,K=!1,X=x.line;e.options.lineWrapping||(X=pt(yr(Je(r,x.line))),r.iter(X,B.line+1,function(xe){if(xe==n.maxLine)return K=!0,!0})),r.sel.contains(t.from,t.to)>-1&&J(e),Oa(r,t,i,fo(e)),e.options.lineWrapping||(r.iter(X,x.line+t.text.length,function(xe){var Me=en(xe);Me>n.maxLineLength&&(n.maxLine=xe,n.maxLineLength=Me,n.maxLineChanged=!0,K=!1)}),K&&(e.curOp.updateMaxLine=!0)),aa(r,x.line),dn(e,400);var te=t.text.length-(B.line-x.line)-1;t.full?sr(e):x.line==B.line&&t.text.length==1&&!Oo(e.doc,t)?Qr(e,x.line,"text"):sr(e,x.line,B.line+1,te);var ce=ne(e,"changes"),pe=ne(e,"change");if(pe||ce){var Ce={from:x,to:B,text:t.text,removed:t.removed,origin:t.origin};pe&&Zt(e,"change",e,Ce),ce&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ce)}e.display.selForContextMenu=null}function Ni(e,t,i,r,n){var x;r||(r=i),dt(r,i)<0&&(x=[r,i],i=x[0],r=x[1]),typeof t=="string"&&(t=e.splitLines(t)),Bi(e,{from:i,to:r,text:t,origin:n})}function Zo(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function qo(e,t,i,r){for(var n=0;n<e.length;++n){var x=e[n],B=!0;if(x.ranges){x.copied||(x=e[n]=x.deepCopy(),x.copied=!0);for(var K=0;K<x.ranges.length;K++)Zo(x.ranges[K].anchor,t,i,r),Zo(x.ranges[K].head,t,i,r);continue}for(var X=0;X<x.changes.length;++X){var te=x.changes[X];if(i<te.from.line)te.from=Fe(te.from.line+r,te.from.ch),te.to=Fe(te.to.line+r,te.to.ch);else if(t<=te.to.line){B=!1;break}}B||(e.splice(0,n+1),n=0)}}function $o(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;qo(e.done,i,r,n),qo(e.undone,i,r,n)}function mn(e,t,i,r){var n=t,x=t;return typeof t=="number"?x=Je(e,xi(e,t)):n=pt(t),n==null?null:(r(x,n)&&e.cm&&Qr(e.cm,n,i),x)}function gn(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}gn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,at(n),Zt(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,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,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function vn(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}vn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var x=Math.min(t,n-e),B=r.height;if(r.removeInner(e,x),this.height-=B-r.height,n==x&&(this.children.splice(i--,1),r.parent=null),(t-=x)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof gn))){var K=[];this.collapse(K),this.children=[new gn(K)],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,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],x=n.chunkSize();if(e<=x){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var B=n.lines.length%25+25,K=B;K<n.lines.length;){var X=new gn(n.lines.slice(K,K+=25));n.height-=X.height,this.children.splice(++r,0,X),X.parent=this}n.lines=n.lines.slice(0,B),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),i=new vn(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=ge(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new vn(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],x=n.chunkSize();if(e<x){var B=Math.min(t,x-e);if(n.iterN(e,B,i))return!0;if((t-=B)==0)break;e=0}else e-=x}}};var yn=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};yn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=pt(i);if(r==null||!t)return;for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var x=nn(this);mt(i,Math.max(0,i.height-x)),e&&(fr(e,function(){es(e,i,-x),Qr(e,r,"widget")}),Zt(e,"lineWidgetCleared",e,this,r))},yn.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=nn(this)-t;if(!n)return;Mr(this.doc,r)||mt(r,r.height+n),i&&fr(i,function(){i.curOp.forceUpdate=!0,es(i,r,n),Zt(i,"lineWidgetChanged",i,e,pt(r))})},se(yn);function es(e,t,i){Lr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ta(e,i)}function xl(e,t,i,r){var n=new yn(e,i,r),x=e.cm;return x&&n.noHScroll&&(x.display.alignWidgets=!0),mn(e,t,"widget",function(B){var K=B.widgets||(B.widgets=[]);if(n.insertAt==null?K.push(n):K.splice(Math.min(K.length-1,Math.max(0,n.insertAt)),0,n),n.line=B,x&&!Mr(e,B)){var X=Lr(B)<e.scrollTop;mt(B,B.height+nn(n)),X&&Ta(x,n.height),x.curOp.forceUpdate=!0}return!0}),x&&Zt(x,"lineWidgetAdded",x,n,typeof t=="number"?t:pt(t)),n}var ts=0,qr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};qr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&mi(e),ne(this,"clear")){var i=this.find();i&&Zt(this,"clear",i.from,i.to)}for(var r=null,n=null,x=0;x<this.lines.length;++x){var B=this.lines[x],K=Dr(B.markedSpans,this);e&&!this.collapsed?Qr(e,pt(B),"text"):e&&(K.to!=null&&(n=pt(B)),K.from!=null&&(r=pt(B))),B.markedSpans=Zi(B.markedSpans,K),K.from==null&&this.collapsed&&!Mr(this.doc,B)&&e&&mt(B,ki(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var X=0;X<this.lines.length;++X){var te=yr(this.lines[X]),ce=en(te);ce>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=ce,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&sr(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&zo(e.doc)),e&&Zt(e,"markerCleared",e,this,r,n),t&&gi(e),this.parent&&this.parent.clear()},qr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var x=this.lines[n],B=Dr(x.markedSpans,this);if(B.from!=null&&(i=Fe(t?x:pt(x),B.from),e==-1))return i;if(B.to!=null&&(r=Fe(t?x:pt(x),B.to),e==1))return r}return i&&{from:i,to:r}},qr.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;fr(r,function(){var n=t.line,x=pt(t.line),B=fa(r,x);if(B&&(no(B),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Mr(i.doc,n)&&i.height!=null){var K=i.height;i.height=null;var X=nn(i)-K;X&&mt(n,n.height+X)}Zt(r,"markerChanged",r,e)})},qr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ge(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qr.prototype.detachLine=function(e){if(this.lines.splice(ge(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},se(qr);function Ui(e,t,i,r,n){if(r&&r.shared)return Cl(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return zt(e.cm,Ui)(e,t,i,r,n);var x=new qr(e,n),B=dt(t,i);if(r&&U(r,x,!1),B>0||B==0&&x.clearWhenEmpty!==!1)return x;if(x.replacedWith&&(x.collapsed=!0,x.widgetNode=v("span",[x.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||x.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(x.widgetNode.insertLeft=!0)),x.collapsed){if(Pn(e,t.line,t,i,x)||t.line!=i.line&&Pn(e,i.line,t,i,x))throw new Error("Inserting collapsed marker partially overlapping an existing one");oa()}x.addToHistory&&No(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var K=t.line,X=e.cm,te;if(e.iter(K,i.line+1,function(pe){X&&x.collapsed&&!X.options.lineWrapping&&yr(pe)==X.display.maxLine&&(te=!0),x.collapsed&&K!=t.line&&mt(pe,0),sa(pe,new ai(x,K==t.line?t.ch:null,K==i.line?i.ch:null)),++K}),x.collapsed&&e.iter(t.line,i.line+1,function(pe){Mr(e,pe)&&mt(pe,0)}),x.clearOnEnter&&De(x,"beforeCursorEnter",function(){return x.clear()}),x.readOnly&&(Kr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),x.collapsed&&(x.id=++ts,x.atomic=!0),X){if(te&&(X.curOp.updateMaxLine=!0),x.collapsed)sr(X,t.line,i.line+1);else if(x.className||x.startStyle||x.endStyle||x.css||x.attributes||x.title)for(var ce=t.line;ce<=i.line;ce++)Qr(X,ce,"text");x.atomic&&zo(X.doc),Zt(X,"markerAdded",X,x)}return x}var bn=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};bn.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Zt(this,"clear")},bn.prototype.find=function(e,t){return this.primary.find(e,t)},se(bn);function Cl(e,t,i,r,n){r=U(r),r.shared=!1;var x=[Ui(e,t,i,r,n)],B=x[0],K=r.widgetNode;return Zr(e,function(X){K&&(r.widgetNode=K.cloneNode(!0)),x.push(Ui(X,ft(X,t),ft(X,i),r,n));for(var te=0;te<X.linked.length;++te)if(X.linked[te].isParent)return;B=T(x)}),new bn(x,B)}function rs(e){return e.findMarks(Fe(e.first,0),e.clipPos(Fe(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),x=e.clipPos(n.from),B=e.clipPos(n.to);if(dt(x,B)){var K=Ui(e,x,B,r.primary,r.primary.type);r.markers.push(K),K.parent=r}}}function Al(e){for(var t=function(r){var n=e[r],x=[n.primary.doc];Zr(n.primary.doc,function(X){return x.push(X)});for(var B=0;B<n.markers.length;B++){var K=n.markers[B];ge(x,K.doc)==-1&&(K.parent=null,n.markers.splice(B--,1))}},i=0;i<e.length;i++)t(i)}var Tl=0,lr=function(e,t,i,r,n){if(!(this instanceof lr))return new lr(e,t,i,r,n);i==null&&(i=0),vn.call(this,[new gn([new li("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var x=Fe(i,0);this.sel=Xr(x),this.history=new Vn(null),this.id=++Tl,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Oa(this,{from:x,to:x,text:e}),er(this,Xr(x),Se)};lr.prototype=N(vn.prototype,{constructor:lr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Jt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Kt(function(e){var t=Fe(this.first,0),i=this.first+this.size-1;Bi(this,{from:t,to:Fe(i,Je(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&sn(this.cm,0,0),er(this,Xr(t),Se)}),replaceRange:function(e,t,i,r){t=ft(this,t),i=i?ft(this,i):t,Ni(this,e,t,i,r)},getRange:function(e,t,i){var r=St(this,ft(this,e),ft(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(vr(this,e))return Je(this,e)},getLineNumber:function(e){return pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Je(this,e)),yr(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(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Kt(function(e,t,i){jo(this,ft(this,typeof e=="number"?Fe(e,t||0):e),null,i)}),setSelection:Kt(function(e,t,i){jo(this,ft(this,e),ft(this,t||e),i)}),extendSelection:Kt(function(e,t,i){Yn(this,ft(this,e),t&&ft(this,t),i)}),extendSelections:Kt(function(e,t){Wo(this,We(this,e),t)}),extendSelectionsBy:Kt(function(e,t){var i=L(this.sel.ranges,e);Wo(this,We(this,i),t)}),setSelections:Kt(function(e,t,i){if(!e.length)return;for(var r=[],n=0;n<e.length;n++)r[n]=new Lt(ft(this,e[n].anchor),ft(this,e[n].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),er(this,Rr(this.cm,r,t),i)}),addSelection:Kt(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Lt(ft(this,e),ft(this,t||e))),er(this,Rr(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=St(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=St(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:Kt(function(e,t,i){for(var r=[],n=this.sel,x=0;x<n.ranges.length;x++){var B=n.ranges[x];r[x]={from:B.from(),to:B.to(),text:this.splitLines(e[x]),origin:i}}for(var K=t&&t!="end"&&cl(this,r,t),X=r.length-1;X>=0;X--)Bi(this,r[X]);K?Ho(this,K):this.cm&&Mi(this.cm)}),undo:Kt(function(){Zn(this,"undo")}),redo:Kt(function(){Zn(this,"redo")}),undoSelection:Kt(function(){Zn(this,"undo",!0)}),redoSelection:Kt(function(){Zn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Vn(this.history.maxGeneration),Zr(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:Pi(this.history.done),undone:Pi(this.history.undone)}},setHistory:function(e){var t=this.history=new Vn(this.history.maxGeneration);t.done=Pi(e.done.slice(0),null,!0),t.undone=Pi(e.undone.slice(0),null,!0)},setGutterMarker:Kt(function(e,t,i){return mn(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Be(n)&&(r.gutterMarkers=null),!0})}),clearGutter:Kt(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&mn(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Be(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!vr(this,e))return null;if(t=e,e=Je(this,e),!e)return null}else if(t=pt(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:Kt(function(e,t,i){return mn(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(b(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:Kt(function(e,t,i){return mn(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",x=r[n];if(x)if(i==null)r[n]=null;else{var B=x.match(b(i));if(!B)return!1;var K=B.index+B[0].length;r[n]=x.slice(0,B.index)+(!B.index||K==x.length?"":" ")+x.slice(K)||null}else return!1;return!0})}),addLineWidget:Kt(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ui(this,ft(this,e),ft(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={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),Ui(this,e,e,i,"bookmark")},findMarksAt:function(e){e=ft(this,e);var t=[],i=Je(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ft(this,e),t=ft(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(x){var B=x.markedSpans;if(B)for(var K=0;K<B.length;K++){var X=B[K];!(X.to!=null&&n==e.line&&e.ch>=X.to||X.from==null&&n!=e.line||X.from!=null&&n==t.line&&X.from>=t.ch)&&(!i||i(X.marker))&&r.push(X.marker.parent||X.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var x=n.text.length+r;if(x>e)return t=e,!0;e-=x,++i}),ft(this,Fe(i,t))},indexFromPos:function(e){e=ft(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new lr(Jt(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new lr(Jt(this,t,i),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}],Sl(r,rs(this)),r},unlinkDoc:function(e){if(e instanceof Pt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Al(rs(this));break}if(e.history==this.history){var r=[e.id];Zr(e,function(n){return r.push(n.id)},!0),e.history=new Vn(null),e.history.done=Pi(this.history.done,r),e.history.undone=Pi(this.history.undone,r)}},iterLinkedDocs:function(e){Zr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):st(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Kt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),lr.prototype.eachLine=lr.prototype.iter;var is=0;function wl(e){var t=this;if(ns(t),Z(t,e)||jr(t.display,e))return;ee(e),W&&(is=+new Date);var i=di(t,e,!0),r=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,x=Array(n),B=0,K=function(){++B==n&&zt(t,function(){i=ft(t.doc,i);var xe={from:i,to:i,text:t.doc.splitLines(x.filter(function(Me){return Me!=null}).join(t.doc.lineSeparator())),origin:"paste"};Bi(t.doc,xe),Ho(t.doc,Xr(ft(t.doc,i),ft(t.doc,Jr(xe))))})()},X=function(xe,Me){if(t.options.allowDropFileTypes&&ge(t.options.allowDropFileTypes,xe.type)==-1){K();return}var Ue=new FileReader;Ue.onerror=function(){return K()},Ue.onload=function(){var je=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(je)){K();return}x[Me]=je,K()},Ue.readAsText(xe)},te=0;te<r.length;te++)X(r[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ce=e.dataTransfer.getData("Text");if(ce){var pe;if(t.state.draggingText&&!t.state.draggingText.copy&&(pe=t.listSelections()),Xn(t.doc,Xr(i,i)),pe)for(var Ce=0;Ce<pe.length;++Ce)Ni(t.doc,"",pe[Ce].anchor,pe[Ce].head,"drag");t.replaceSelection(ce,"around","paste"),t.display.input.focus()}}catch(xe){}}}function Dl(e,t){if(W&&(!e.state.draggingText||+new Date-is<100)){de(t);return}if(Z(e,t)||jr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!I){var i=a("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",S&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),S&&i.parentNode.removeChild(i)}}function Ll(e,t){var i=di(e,t);if(!i)return;var r=document.createDocumentFragment();go(e,i,r),e.display.dragCursor||(e.display.dragCursor=a("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),l(e.display.dragCursor,r)}function ns(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"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var x=0;x<i.length;x++)e(i[x])})}var os=!1;function kl(){if(os)return;Rl(),os=!0}function Rl(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Il)},100))}),De(window,"blur",function(){return as(Ii)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var $r={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"},En=0;En<10;En++)$r[En+48]=$r[En+96]=String(En);for(var qn=65;qn<=90;qn++)$r[qn]=String.fromCharCode(qn);for(var xn=1;xn<=12;xn++)$r[xn+111]=$r[xn+63235]="F"+xn;var Hr={};Hr.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"},Hr.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"},Hr.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"},Hr.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"]},Hr.default=s?Hr.macDefault:Hr.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,x,B=0;B<t.length-1;B++){var K=t[B];if(/^(cmd|meta|m)$/i.test(K))x=!0;else if(/^a(lt)?$/i.test(K))i=!0;else if(/^(c|ctrl|control)$/i.test(K))r=!0;else if(/^s(hift)?$/i.test(K))n=!0;else throw new Error("Unrecognized modifier name: "+K)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),x&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Ol(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=L(i.split(" "),Ml),x=0;x<n.length;x++){var B=void 0,K=void 0;x==n.length-1?(K=n.join(" "),B=r):(K=n.slice(0,x+1).join(" "),B="...");var X=t[K];if(!X)t[K]=B;else if(X!=B)throw new Error("Inconsistent bindings for "+K)}delete e[i]}for(var te in t)e[te]=t[te];return e}function Fi(e,t,i,r){t=$n(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Fi(e,t.fallthrough,i,r);for(var x=0;x<t.fallthrough.length;x++){var B=Fi(e,t.fallthrough[x],i,r);if(B)return B}}}function ss(e){var t=typeof e=="string"?e:$r[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(p?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(p?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(S&&e.keyCode==34&&e.char)return!1;var i=$r[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),ls(i,e,t))}function $n(e){return typeof e=="string"?Hr[e]:e}function Wi(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var x=t(i[n]);r.length&&dt(x.from,T(r).to)<=0;){var B=r.pop();if(dt(B.from,x.from)<0){x.from=B.from;break}}r.push(x)}fr(e,function(){for(var K=r.length-1;K>=0;K--)Ni(e.doc,"",r[K].from,r[K].to,"+delete");Mi(e)})}function Na(e,t,i){var r=_e(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ua(e,t,i){var r=Na(e,t.ch,i);return r==null?null:new Fe(t.line,r,i<0?"after":"before")}function Fa(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var x=Xe(i,t.doc.direction);if(x){var B=n<0?T(x):x[0],K=n<0==(B.level==1),X=K?"after":"before",te;if(B.level>0||t.doc.direction=="rtl"){var ce=Li(t,i);te=n<0?i.text.length-1:0;var pe=Pr(t,ce,te).top;te=Ge(function(Ce){return Pr(t,ce,Ce).top==pe},n<0==(B.level==1)?B.from:B.to-1,te),X=="before"&&(te=Na(i,te,1))}else te=n<0?B.to:B.from;return new Fe(r,te,X)}}return new Fe(r,n<0?i.text.length:0,n<0?"before":"after")}function Pl(e,t,i,r){var n=Xe(t,e.doc.direction);if(!n)return Ua(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var x=Ye(n,i.ch,i.sticky),B=n[x];if(e.doc.direction=="ltr"&&B.level%2==0&&(r>0?B.to>i.ch:B.from<i.ch))return Ua(t,i,r);var K=function(ze,qe){return Na(t,ze instanceof Fe?ze.ch:ze,qe)},X,te=function(ze){return e.options.lineWrapping?(X=X||Li(e,t),co(e,t,X,ze)):{begin:0,end:t.text.length}},ce=te(i.sticky=="before"?K(i,-1):i.ch);if(e.doc.direction=="rtl"||B.level==1){var pe=B.level==1==r<0,Ce=K(i,pe?1:-1);if(Ce!=null&&(pe?Ce<=B.to&&Ce<=ce.end:Ce>=B.from&&Ce>=ce.begin)){var xe=pe?"before":"after";return new Fe(i.line,Ce,xe)}}var Me=function(ze,qe,Ke){for(var tt=function(It,Vt){return Vt?new Fe(i.line,K(It,1),"before"):new Fe(i.line,It,"after")};ze>=0&&ze<n.length;ze+=qe){var ht=n[ze],lt=qe>0==(ht.level!=1),gt=lt?Ke.begin:K(Ke.end,-1);if(ht.from<=gt&&gt<ht.to)return tt(gt,lt);if(gt=lt?ht.from:K(ht.to,-1),Ke.begin<=gt&&gt<Ke.end)return tt(gt,lt)}},Ue=Me(x+r,r,ce);if(Ue)return Ue;var je=r>0?ce.end:K(ce.begin,-1);return je!=null&&!(r>0&&je==t.text.length)&&(Ue=Me(r>0?0:n.length-1,r,te(je)),Ue)?Ue:null}var Cn={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return Wi(e,function(t){if(t.empty()){var i=Je(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Fe(t.head.line+1,0)}:{from:t.head,to:Fe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Wi(e,function(t){return{from:Fe(t.from().line,0),to:ft(e.doc,Fe(t.to().line+1,0))}})},delLineLeft:function(e){return Wi(e,function(t){return{from:Fe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Wi(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Wi(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"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(Fe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Fe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return hs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ds(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 i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?ds(e,t.head):r},Ae)},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=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var x=i[n].from(),B=ae(e.getLine(x.line),x.ch,r);t.push(j(r-B%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return fr(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var n=t[r].head,x=Je(e.doc,n.line).text;if(x){if(n.ch==x.length&&(n=new Fe(n.line,n.ch-1)),n.ch>0)n=new Fe(n.line,n.ch+1),e.replaceRange(x.charAt(n.ch-1)+x.charAt(n.ch-2),Fe(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var B=Je(e.doc,n.line-1).text;B&&(n=new Fe(n.line,1),e.replaceRange(x.charAt(0)+e.doc.lineSeparator()+B.charAt(B.length-1),Fe(n.line-1,B.length-1),n,"+transpose"))}}i.push(new Lt(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return fr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Mi(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function hs(e,t){var i=Je(e.doc,t),r=yr(i);return r!=i&&(t=pt(r)),Fa(!0,e,r,t,1)}function _l(e,t){var i=Je(e.doc,t),r=_n(i);return r!=i&&(t=pt(r)),Fa(!0,e,i,t,-1)}function ds(e,t){var i=hs(e,t.line),r=Je(e.doc,i.line),n=Xe(r,e.doc.direction);if(!n||n[0].level==0){var x=Math.max(i.ch,r.text.search(/\S/)),B=t.line==i.line&&t.ch<=x&&t.ch;return Fe(i.line,B?0:x,i.sticky)}return i}function ea(e,t,i){if(typeof t=="string"&&(t=Cn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=Ne}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function Bl(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Fi(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&Fi(t,e.options.extraKeys,i,e)||Fi(t,e.options.keyMap,i,e)}var Nl=new fe;function Sn(e,t,i,r){var n=e.state.keySeq;if(n){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Nl.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),cs(e,n+" "+t,i,r))return!0}return cs(e,t,i,r)}function cs(e,t,i,r){var n=Bl(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&Zt(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(ee(i),Ca(e)),!!n}function fs(e,t){var i=us(t,!0);return i?t.shiftKey&&!e.state.keySeq?Sn(e,"Shift-"+i,t,function(r){return ea(e,r,!0)})||Sn(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ea(e,r)}):Sn(e,i,t,function(r){return ea(e,r)}):!1}function Ul(e,t,i){return Sn(e,"'"+i+"'",t,function(r){return ea(e,r,!0)})}var Wa=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),Z(t,e))return;W&&F<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=fs(t,e);S&&(Wa=r?i:null,!r&&i==88&&!Tt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),k&&!s&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;H(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(c(t,"CodeMirror-crosshair"),$e(document,"keyup",i),$e(document,"mouseover",i))}De(document,"keyup",i),De(document,"mouseover",i)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),Z(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(jr(t.display,e)||Z(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(S&&i==Wa){Wa=null,ee(e);return}if(S&&(!e.which||e.which<10)&&fs(t,e))return;var n=String.fromCharCode(r==null?i:r);if(n=="\b")return;if(Ul(t,e,n))return;t.display.input.onKeyPress(e)}var Wl=400,ja=function(e,t,i){this.time=e,this.pos=t,this.button=i};ja.prototype.compare=function(e,t,i){return this.time+Wl>e&&dt(t,this.pos)==0&&i==this.button};var An,Tn;function jl(e,t){var i=+new Date;return Tn&&Tn.compare(i,e,t)?(An=Tn=null,"triple"):An&&An.compare(i,e,t)?(Tn=new ja(i,e,t),An=null,"double"):(An=new ja(i,e,t),Tn=null,"single")}function vs(e){var t=this,i=t.display;if(Z(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,jr(i,e)){O||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Ha(t,e))return;var r=di(t,e),n=ye(e),x=r?jl(r,n):"single";if(window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,n,r,x,e))return;n==1?r?zl(t,r,x,e):me(e)==i.scroller&&ee(e):n==2?(r&&Yn(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(D?t.display.input.onContextMenu(e):yo(t))}function Hl(e,t,i,r,n){var x="Click";return r=="double"?x="Double"+x:r=="triple"&&(x="Triple"+x),x=(t==1?"Left":t==2?"Middle":"Right")+x,Sn(e,ls(x,n),n,function(B){if(typeof B=="string"&&(B=Cn[B]),!B)return!1;var K=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),K=B(e,i)!=Ne}finally{e.state.suppressEdits=!1}return K})}function Gl(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var x=u?i.shiftKey&&i.metaKey:i.altKey;n.unit=x?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=s?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(s?i.altKey:i.ctrlKey)),n}function zl(e,t,i,r){W?setTimeout(z(vo,e),0):e.curOp.focus=P();var n=Gl(e,i,r),x=e.doc.sel,B;e.options.dragDrop&&Le&&!e.isReadOnly()&&i=="single"&&(B=x.contains(t))>-1&&(dt((B=x.ranges[B]).from(),t)<0||t.xRel>0)&&(dt(B.to(),t)>0||t.xRel<0)?Kl(e,r,t,n):Vl(e,r,t,n)}function Kl(e,t,i,r){var n=e.display,x=!1,B=zt(e,function(te){O&&(n.scroller.draggable=!1),e.state.draggingText=!1,$e(n.wrapper.ownerDocument,"mouseup",B),$e(n.wrapper.ownerDocument,"mousemove",K),$e(n.scroller,"dragstart",X),$e(n.scroller,"drop",B),x||(ee(te),r.addNew||Yn(e.doc,i,null,null,r.extend),O&&!I||W&&F==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),K=function(te){x=x||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},X=function(){return x=!0};O&&(n.scroller.draggable=!0),e.state.draggingText=B,B.copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),De(n.wrapper.ownerDocument,"mouseup",B),De(n.wrapper.ownerDocument,"mousemove",K),De(n.scroller,"dragstart",X),De(n.scroller,"drop",B),yo(e),setTimeout(function(){return n.input.focus()},20)}function ys(e,t,i){if(i=="char")return new Lt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Lt(Fe(t.line,0),ft(e.doc,Fe(t.line+1,0)));var r=i(e,t);return new Lt(r.from,r.to)}function Vl(e,t,i,r){var n=e.display,x=e.doc;ee(t);var B,K,X=x.sel,te=X.ranges;if(r.addNew&&!r.extend?(K=x.sel.contains(i),K>-1?B=te[K]:B=new Lt(i,i)):(B=x.sel.primary(),K=x.sel.primIndex),r.unit=="rectangle")r.addNew||(B=new Lt(i,i)),i=di(e,t,!0,!0),K=-1;else{var ce=ys(e,i,r.unit);r.extend?B=_a(B,ce.anchor,ce.head,r.extend):B=ce}r.addNew?K==-1?(K=te.length,er(x,Rr(e,te.concat([B]),K),{scroll:!1,origin:"*mouse"})):te.length>1&&te[K].empty()&&r.unit=="char"&&!r.extend?(er(x,Rr(e,te.slice(0,K).concat(te.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),X=x.sel):Ba(x,K,B,Ie):(K=0,er(x,new Er([B],0),Ie),X=x.sel);var pe=i;function Ce(Ke){if(dt(pe,Ke)==0)return;if(pe=Ke,r.unit=="rectangle"){for(var tt=[],ht=e.options.tabSize,lt=ae(Je(x,i.line).text,i.ch,ht),gt=ae(Je(x,Ke.line).text,Ke.ch,ht),It=Math.min(lt,gt),Vt=Math.max(lt,gt),Bt=Math.min(i.line,Ke.line),pr=Math.min(e.lastLine(),Math.max(i.line,Ke.line));Bt<=pr;Bt++){var ur=Je(x,Bt).text,Wt=we(ur,It,ht);It==Vt?tt.push(new Lt(Fe(Bt,Wt),Fe(Bt,Wt))):ur.length>Wt&&tt.push(new Lt(Fe(Bt,Wt),Fe(Bt,we(ur,Vt,ht))))}tt.length||tt.push(new Lt(i,i)),er(x,Rr(e,X.ranges.slice(0,K).concat(tt),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ke)}else{var hr=B,qt=ys(e,Ke,r.unit),Gt=hr.anchor,jt;dt(qt.anchor,Gt)>0?(jt=qt.head,Gt=ii(hr.from(),qt.anchor)):(jt=qt.anchor,Gt=Ei(hr.to(),qt.head));var Nt=X.ranges.slice(0);Nt[K]=Ql(e,new Lt(ft(x,Gt),jt)),er(x,Rr(e,Nt,K),Ie)}}var xe=n.wrapper.getBoundingClientRect(),Me=0;function Ue(Ke){var tt=++Me,ht=di(e,Ke,!0,r.unit=="rectangle");if(!ht)return;if(dt(ht,pe)!=0){e.curOp.focus=P(),Ce(ht);var lt=Hn(n,x);(ht.line>=lt.to||ht.line<lt.from)&&setTimeout(zt(e,function(){Me==tt&&Ue(Ke)}),150)}else{var gt=Ke.clientY<xe.top?-20:Ke.clientY>xe.bottom?20:0;gt&&setTimeout(zt(e,function(){if(Me!=tt)return;n.scroller.scrollTop+=gt,Ue(Ke)}),50)}}function je(Ke){e.state.selectingText=!1,Me=Infinity,Ke&&(ee(Ke),n.input.focus()),$e(n.wrapper.ownerDocument,"mousemove",ze),$e(n.wrapper.ownerDocument,"mouseup",qe),x.history.lastSelOrigin=null}var ze=zt(e,function(Ke){Ke.buttons===0||!ye(Ke)?je(Ke):Ue(Ke)}),qe=zt(e,je);e.state.selectingText=qe,De(n.wrapper.ownerDocument,"mousemove",ze),De(n.wrapper.ownerDocument,"mouseup",qe)}function Ql(e,t){var i=t.anchor,r=t.head,n=Je(e.doc,i.line);if(dt(i,r)==0&&i.sticky==r.sticky)return t;var x=Xe(n);if(!x)return t;var B=Ye(x,i.ch,i.sticky),K=x[B];if(K.from!=i.ch&&K.to!=i.ch)return t;var X=B+(K.from==i.ch==(K.level!=1)?0:1);if(X==0||X==x.length)return t;var te;if(r.line!=i.line)te=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ce=Ye(x,r.ch,r.sticky),pe=ce-B||(r.ch-i.ch)*(K.level==1?-1:1);ce==X-1||ce==X?te=pe<0:te=pe>0}var Ce=x[X+(te?-1:0)],xe=te==(Ce.level==1),Me=xe?Ce.from:Ce.to,Ue=xe?"after":"before";return i.ch==Me&&i.sticky==Ue?t:new Lt(new Fe(i.line,Me,Ue),r)}function bs(e,t,i,r){var n,x;if(t.touches)n=t.touches[0].clientX,x=t.touches[0].clientY;else try{n=t.clientX,x=t.clientY}catch(Ce){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ee(t);var B=e.display,K=B.lineDiv.getBoundingClientRect();if(x>K.bottom||!ne(e,i))return le(t);x-=K.top-B.viewOffset;for(var X=0;X<e.display.gutterSpecs.length;++X){var te=B.gutters.childNodes[X];if(te&&te.getBoundingClientRect().right>=n){var ce=wt(e.doc,x),pe=e.display.gutterSpecs[X];return oe(e,i,e,ce,pe.className,t),le(t)}}}function Ha(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(jr(e.display,t)||Yl(e,t))return;if(Z(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return ne(e,"gutterContextMenu")?bs(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-"),an(e)}var ji={toString:function(){return"CodeMirror.Init"}},Cs={},ta={};function Xl(e){var t=e.optionHandlers;function i(r,n,x,B){e.defaults[r]=n,x&&(t[r]=B?function(K,X,te){te!=ji&&x(K,X,te)}:x)}e.defineOption=i,e.Init=ji,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Ma(r)},!0),i("indentUnit",2,Ma,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){fn(r),an(r),sr(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!n)return;var x=[],B=r.doc.first;r.doc.iter(function(X){for(var te=0;;){var ce=X.text.indexOf(n,te);if(ce==-1)break;te=ce+n.length,x.push(Fe(B,ce))}B++});for(var K=x.length-1;K>=0;K--)Ni(r.doc,n,x[K],Fe(x[K].line,x[K].ch+n.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,n,x){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),x!=ji&&r.refresh()}),i("specialCharPlaceholder",Rt,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!y),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){xs(r),cn(r)},!0),i("keyMap","default",function(r,n,x){var B=$n(n),K=x!=ji&&$n(x);K&&K.detach&&K.detach(r,B),B.attach&&B.attach(r,K||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=Ra(n,r.options.lineNumbers),cn(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?Ea(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Oi(r)},!0),i("scrollbarStyle","native",function(r){Ao(r),Oi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=Ra(r.options.gutters,n),cn(r)},!0),i("firstLineNumber",1,cn,!0),i("lineNumberFormatter",function(r){return r},cn,!0),i("showCursorWhenSelecting",!1,on,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Ii(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,on,!0),i("singleCursorHeightPerLine",!0,on,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,fn,!0),i("addModeClass",!1,fn,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,fn,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=ji;if(!t!=!r){var n=e.display.dragFunctions,x=t?De:$e;x(e.display.scroller,"dragstart",n.start),x(e.display.scroller,"dragenter",n.enter),x(e.display.scroller,"dragover",n.over),x(e.display.scroller,"dragleave",n.leave),x(e.display.scroller,"drop",n.drop)}}function Zl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(c(e.display.wrapper,"CodeMirror-wrap"),Bn(e)),xa(e),sr(e),an(e),setTimeout(function(){return Oi(e)},100)}function Pt(e,t){var i=this;if(!(this instanceof Pt))return new Pt(e,t);this.options=t=t?U(t):{},U(Cs,t,!1);var r=t.value;typeof r=="string"?r=new lr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Pt.inputStyles[t.inputStyle](this),x=this.display=new hl(e,r,n,t);x.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ao(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 fe,keySeq:null,specialChars:null},t.autofocus&&!o&&x.input.focus(),W&&F<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),kl(),mi(this),this.curOp.forceUpdate=!0,Po(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Sa(i)},20):Ii(this);for(var B in ta)ta.hasOwnProperty(B)&&ta[B](this,t[B],ji);Do(this),t.finishInit&&t.finishInit(this);for(var K=0;K<Ga.length;++K)Ga[K](this);gi(this),O&&t.lineWrapping&&getComputedStyle(x.lineDiv).textRendering=="optimizelegibility"&&(x.lineDiv.style.textRendering="auto")}Pt.defaults=Cs,Pt.optionHandlers=ta;function ql(e){var t=e.display;De(t.scroller,"mousedown",zt(e,vs)),W&&F<11?De(t.scroller,"dblclick",zt(e,function(X){if(Z(e,X))return;var te=di(e,X);if(!te||Ha(e,X)||jr(e.display,X))return;ee(X);var ce=e.findWordAt(te);Yn(e.doc,ce.anchor,ce.head)})):De(t.scroller,"dblclick",function(X){return Z(e,X)||ee(X)}),De(t.scroller,"contextmenu",function(X){return Es(e,X)}),De(t.input.getField(),"contextmenu",function(X){t.scroller.contains(X.target)||Es(e,X)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function x(X){if(X.touches.length!=1)return!1;var te=X.touches[0];return te.radiusX<=1&&te.radiusY<=1}function B(X,te){if(te.left==null)return!0;var ce=te.left-X.left,pe=te.top-X.top;return ce*ce+pe*pe>20*20}De(t.scroller,"touchstart",function(X){if(!Z(e,X)&&!x(X)&&!Ha(e,X)){t.input.ensurePolled(),clearTimeout(i);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-r.end<=300?r:null},X.touches.length==1&&(t.activeTouch.left=X.touches[0].pageX,t.activeTouch.top=X.touches[0].pageY)}}),De(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),De(t.scroller,"touchend",function(X){var te=t.activeTouch;if(te&&!jr(t,X)&&te.left!=null&&!te.moved&&new Date-te.start<300){var ce=e.coordsChar(t.activeTouch,"page"),pe;!te.prev||B(te,te.prev)?pe=new Lt(ce,ce):!te.prev.prev||B(te,te.prev.prev)?pe=e.findWordAt(ce):pe=new Lt(Fe(ce.line,0),ft(e.doc,Fe(ce.line+1,0))),e.setSelection(pe.anchor,pe.head),e.focus(),ee(X)}n()}),De(t.scroller,"touchcancel",n),De(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ln(e,t.scroller.scrollTop),fi(e,t.scroller.scrollLeft,!0),oe(e,"scroll",e))}),De(t.scroller,"mousewheel",function(X){return Ro(e,X)}),De(t.scroller,"DOMMouseScroll",function(X){return Ro(e,X)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){Z(e,X)||de(X)},over:function(X){Z(e,X)||(Ll(e,X),de(X))},start:function(X){return Dl(e,X)},drop:zt(e,wl),leave:function(X){Z(e,X)||ns(e)}};var K=t.input.getField();De(K,"keyup",function(X){return ms.call(e,X)}),De(K,"keydown",zt(e,ps)),De(K,"keypress",zt(e,gs)),De(K,"focus",function(X){return Sa(e,X)}),De(K,"blur",function(X){return Ii(e,X)})}var Ga=[];Pt.defineInitHook=function(e){return Ga.push(e)};function wn(e,t,i,r){var n=e.doc,x;i==null&&(i="add"),i=="smart"&&(n.mode.indent?x=Ar(e,t).state:i="prev");var B=e.options.tabSize,K=Je(n,t),X=ae(K.text,null,B);K.stateAfter&&(K.stateAfter=null);var te=K.text.match(/^\s*/)[0],ce;if(!r&&!/\S/.test(K.text))ce=0,i="not";else if(i=="smart"&&(ce=n.mode.indent(x,K.text.slice(te.length),K.text),ce==Ne||ce>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?ce=ae(Je(n,t-1).text,null,B):ce=0:i=="add"?ce=X+e.options.indentUnit:i=="subtract"?ce=X-e.options.indentUnit:typeof i=="number"&&(ce=X+i),ce=Math.max(0,ce);var pe="",Ce=0;if(e.options.indentWithTabs)for(var xe=Math.floor(ce/B);xe;--xe)Ce+=B,pe+=" ";if(Ce<ce&&(pe+=j(ce-Ce)),pe!=te)return Ni(n,pe,Fe(t,0),Fe(t,te.length),"+input"),K.stateAfter=null,!0;for(var Me=0;Me<n.sel.ranges.length;Me++){var Ue=n.sel.ranges[Me];if(Ue.head.line==t&&Ue.head.ch<te.length){var je=Fe(t,te.length);Ba(n,Me,new Lt(je,je));break}}}var Ir=null;function ra(e){Ir=e}function za(e,t,i,r,n){var x=e.doc;e.display.shift=!1,r||(r=x.sel);var B=+new Date-200,K=n=="paste"||e.state.pasteIncoming>B,X=st(t),te=null;if(K&&r.ranges.length>1)if(Ir&&Ir.text.join(`
`)==t){if(r.ranges.length%Ir.text.length==0){te=[];for(var ce=0;ce<Ir.text.length;ce++)te.push(x.splitLines(Ir.text[ce]))}}else X.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(te=L(X,function(ze){return[ze]}));for(var pe=e.curOp.updateInput,Ce=r.ranges.length-1;Ce>=0;Ce--){var xe=r.ranges[Ce],Me=xe.from(),Ue=xe.to();xe.empty()&&(i&&i>0?Me=Fe(Me.line,Me.ch-i):e.state.overwrite&&!K?Ue=Fe(Ue.line,Math.min(Je(x,Ue.line).text.length,Ue.ch+T(X).length)):K&&Ir&&Ir.lineWise&&Ir.text.join(`
`)==X.join(`
`)&&(Me=Ue=Fe(Me.line,0)));var je={from:Me,to:Ue,text:te?te[Ce%te.length]:X,origin:n||(K?"paste":e.state.cutIncoming>B?"cut":"+input")};Bi(e.doc,je),Zt(e,"inputRead",e,je)}t&&!K&&As(e,t),Mi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=pe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ss(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&fr(t,function(){return za(t,i,0,null,"paste")}),!0}function As(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)continue;var x=e.getModeAt(n.head),B=!1;if(x.electricChars){for(var K=0;K<x.electricChars.length;K++)if(t.indexOf(x.electricChars.charAt(K))>-1){B=wn(e,n.head.line,"smart");break}}else x.electricInput&&(x.electricInput.test(Je(e.doc,n.head.line).text.slice(0,n.head.ch))&&(B=wn(e,n.head.line,"smart")));B&&Zt(e,"electricInput",e,n.head.line)}}function Ts(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,x={anchor:Fe(n,0),head:Fe(n+1,0)};i.push(x),t.push(e.getRange(x.anchor,x.head))}return{text:t,ranges:i}}function ws(e,t,i,r){e.setAttribute("autocorrect",i?"":"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 O?e.style.width="1000px":e.setAttribute("wrap","off"),C&&(e.style.border="1px solid black"),ws(e),t}function $l(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,n){var x=this.options,B=x[r];if(x[r]==n&&r!="mode")return;x[r]=n,t.hasOwnProperty(r)&&zt(this,t[r])(this,n,B),oe(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"]($n(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,x=0;x<n.length;++x)if(n[x]==r||n[x].name==r)return n.splice(x,1),!0},addOverlay:ir(function(r,n){var x=r.token?r:e.getMode(this.options,r);if(x.startState)throw new Error("Overlays may not be stateful.");G(this.state.overlays,{mode:x,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(B){return B.priority}),this.state.modeGen++,sr(this)}),removeOverlay:ir(function(r){for(var n=this.state.overlays,x=0;x<n.length;++x){var B=n[x].modeSpec;if(B==r||typeof r=="string"&&B.name==r){n.splice(x,1),this.state.modeGen++,sr(this);return}}}),indentLine:ir(function(r,n,x){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),vr(this.doc,r)&&wn(this,r,n,x)}),indentSelection:ir(function(r){for(var n=this.doc.sel.ranges,x=-1,B=0;B<n.length;B++){var K=n[B];if(K.empty())K.head.line>x&&(wn(this,K.head.line,r,!0),x=K.head.line,B==this.doc.sel.primIndex&&Mi(this));else{var X=K.from(),te=K.to(),ce=Math.max(x,X.line);x=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var pe=ce;pe<x;++pe)wn(this,pe,r);var Ce=this.doc.sel.ranges;X.ch==0&&n.length==Ce.length&&Ce[B].from().ch>0&&Ba(this.doc,B,new Lt(X,Ce[B].to()),Se)}}}),getTokenAt:function(r,n){return Ln(this,r,n)},getLineTokens:function(r,n){return Ln(this,Fe(r),n,!0)},getTokenTypeAt:function(r){r=ft(this.doc,r);var n=ni(this,Je(this.doc,r.line)),x=0,B=(n.length-1)/2,K=r.ch,X;if(K==0)X=n[2];else for(;;){var te=x+B>>1;if((te?n[te*2-1]:0)>=K)B=te;else if(n[te*2+1]<K)x=te+1;else{X=n[te*2+2];break}}var ce=X?X.indexOf("overlay "):-1;return ce<0?X:ce==0?null:X.slice(0,ce-1)},getModeAt:function(r){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(r).state).mode:n},getHelper:function(r,n){return this.getHelpers(r,n)[0]},getHelpers:function(r,n){var x=[];if(!i.hasOwnProperty(n))return x;var B=i[n],K=this.getModeAt(r);if(typeof K[n]=="string")B[K[n]]&&x.push(B[K[n]]);else if(K[n])for(var X=0;X<K[n].length;X++){var te=B[K[n][X]];te&&x.push(te)}else K.helperType&&B[K.helperType]?x.push(B[K.helperType]):B[K.name]&&x.push(B[K.name]);for(var ce=0;ce<B._global.length;ce++){var pe=B._global[ce];pe.pred(K,this)&&ge(x,pe.val)==-1&&x.push(pe.val)}return x},getStateAfter:function(r,n){var x=this.doc;return r=xi(x,r==null?x.first+x.size-1:r),Ar(this,r+1,n).state},cursorCoords:function(r,n){var x,B=this.doc.sel.primary();return r==null?x=B.head:typeof r=="object"?x=ft(this.doc,r):x=r?B.from():B.to(),kr(this,x,n||"page")},charCoords:function(r,n){return ma(this,ft(this.doc,r),n||"page")},coordsChar:function(r,n){return r=lo(this,r,n||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,n){return r=lo(this,{top:r,left:0},n||"page").top,wt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,x){var B=!1,K;if(typeof r=="number"){var X=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>X&&(r=X,B=!0),K=Je(this.doc,r)}else K=r;return Un(this,K,{top:0,left:0},n||"page",x||B).top+(B?this.doc.height-Lr(K):0)},defaultTextHeight:function(){return ki(this.display)},defaultCharWidth:function(){return Ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,x,B,K){var X=this.display;r=kr(this,ft(this.doc,r));var te=r.bottom,ce=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),X.sizer.appendChild(n),B=="over")te=r.top;else if(B=="above"||B=="near"){var pe=Math.max(X.wrapper.clientHeight,this.doc.height),Ce=Math.max(X.sizer.clientWidth,X.lineSpace.clientWidth);(B=="above"||r.bottom+n.offsetHeight>pe)&&r.top>n.offsetHeight?te=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=pe&&(te=r.bottom),ce+n.offsetWidth>Ce&&(ce=Ce-n.offsetWidth)}n.style.top=te+"px",n.style.left=n.style.right="",K=="right"?(ce=X.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(K=="left"?ce=0:K=="middle"&&(ce=(X.sizer.clientWidth-n.offsetWidth)/2),n.style.left=ce+"px"),x&&Js(this,{left:ce,top:te,right:ce+n.offsetWidth,bottom:te+n.offsetHeight})},triggerOnKeyDown:ir(ps),triggerOnKeyPress:ir(gs),triggerOnKeyUp:ms,triggerOnMouseDown:ir(vs),execCommand:function(r){if(Cn.hasOwnProperty(r))return Cn[r].call(null,this)},triggerElectric:ir(function(r){As(this,r)}),findPosH:function(r,n,x,B){var K=1;n<0&&(K=-1,n=-n);for(var X=ft(this.doc,r),te=0;te<n&&!(X=Ka(this.doc,X,K,x,B),X.hitSide);++te);return X},moveH:ir(function(r,n){var x=this;this.extendSelectionsBy(function(B){return x.display.shift||x.doc.extend||B.empty()?Ka(x.doc,B.head,r,n,x.options.rtlMoveVisually):r<0?B.from():B.to()},Ae)}),deleteH:ir(function(r,n){var x=this.doc.sel,B=this.doc;x.somethingSelected()?B.replaceSelection("",null,"+delete"):Wi(this,function(K){var X=Ka(B,K.head,r,n,!1);return r<0?{from:X,to:K.head}:{from:K.head,to:X}})}),findPosV:function(r,n,x,B){var K=1,X=B;n<0&&(K=-1,n=-n);for(var te=ft(this.doc,r),ce=0;ce<n;++ce){var pe=kr(this,te,"div");if(X==null?X=pe.left:pe.left=X,te=Ls(this,pe,K,x),te.hitSide)break}return te},moveV:ir(function(r,n){var x=this,B=this.doc,K=[],X=!this.display.shift&&!B.extend&&B.sel.somethingSelected();if(B.extendSelectionsBy(function(ce){if(X)return r<0?ce.from():ce.to();var pe=kr(x,ce.head,"div");ce.goalColumn!=null&&(pe.left=ce.goalColumn),K.push(pe.left);var Ce=Ls(x,pe,r,n);return n=="page"&&ce==B.sel.primary()&&Ta(x,ma(x,Ce,"div").top-pe.top),Ce},Ae),K.length)for(var te=0;te<B.sel.ranges.length;te++)B.sel.ranges[te].goalColumn=K[te]}),findWordAt:function(r){var n=this.doc,x=Je(n,r.line).text,B=r.ch,K=r.ch;if(x){var X=this.getHelper(r,"wordChars");(r.sticky=="before"||K==x.length)&&B?--B:++K;for(var te=x.charAt(B),ce=Te(te,X)?function(pe){return Te(pe,X)}:/\s/.test(te)?function(pe){return/\s/.test(pe)}:function(pe){return!/\s/.test(pe)&&!Te(pe)};B>0&&ce(x.charAt(B-1));)--B;for(;K<x.length&&ce(x.charAt(K));)++K}return new Lt(Fe(r.line,B),Fe(r.line,K))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):c(this.display.cursorDiv,"CodeMirror-overwrite"),oe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ir(function(r,n){sn(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Or(this)-this.display.barHeight,width:r.scrollWidth-Or(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:ui(this)}},scrollIntoView:ir(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Fe(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?Zs(this,r):Eo(this,r.from,r.to,r.margin)}),setSize:ir(function(r,n){var x=this,B=function(X){return typeof X=="number"||/^\d+$/.test(String(X))?X+"px":X};r!=null&&(this.display.wrapper.style.width=B(r)),n!=null&&(this.display.wrapper.style.height=B(n)),this.options.lineWrapping&&ao(this);var K=this.display.viewFrom;this.doc.iter(K,this.display.viewTo,function(X){if(X.widgets){for(var te=0;te<X.widgets.length;te++)if(X.widgets[te].noHScroll){Qr(x,K,"widget");break}}++K}),this.curOp.forceUpdate=!0,oe(this,"refresh",this)}),operation:function(r){return fr(this,r)},startOperation:function(){return mi(this)},endOperation:function(){return gi(this)},refresh:ir(function(){var r=this.display.cachedTextHeight;sr(this),this.curOp.forceUpdate=!0,an(this),sn(this,this.doc.scrollLeft,this.doc.scrollTop),La(this.display),(r==null||Math.abs(r-ki(this.display))>.5||this.options.lineWrapping)&&xa(this),oe(this,"refresh",this)}),swapDoc:ir(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Po(this,r),an(this),this.display.input.reset(),sn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Zt(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[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}},se(e),e.registerHelper=function(r,n,x){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=x},e.registerGlobalHelper=function(r,n,x,B){e.registerHelper(r,n,B),i[r]._global.push({pred:x,val:B})}}function Ka(e,t,i,r,n){var x=t,B=i,K=Je(e,t.line),X=n&&e.direction=="rtl"?-i:i;function te(){var qe=t.line+X;return qe<e.first||qe>=e.first+e.size?!1:(t=new Fe(qe,t.ch,t.sticky),K=Je(e,qe))}function ce(qe){var Ke;if(r=="codepoint"){var tt=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(tt)?Ke=null:Ke=new Fe(t.line,Math.max(0,Math.min(K.text.length,t.ch+i*(tt>=55296&&tt<56320?2:1))),-i)}else n?Ke=Pl(e.cm,K,t,i):Ke=Ua(K,t,i);if(Ke==null)if(!qe&&te())t=Fa(n,e.cm,K,t.line,X);else return!1;else t=Ke;return!0}if(r=="char"||r=="codepoint")ce();else if(r=="column")ce(!0);else if(r=="word"||r=="group")for(var pe=null,Ce=r=="group",xe=e.cm&&e.cm.getHelper(t,"wordChars"),Me=!0;!(i<0&&!ce(!Me));Me=!1){var Ue=K.text.charAt(t.ch)||`
`,je=Te(Ue,xe)?"w":Ce&&Ue==`
`?"n":!Ce||/\s/.test(Ue)?null:"p";if(Ce&&!Me&&!je&&(je="s"),pe&&pe!=je){i<0&&(i=1,ce(),t.sticky="after");break}if(je&&(pe=je),i>0&&!ce(!Me))break}var ze=Jn(e,t,x,B,!0);return ri(x,ze)&&(ze.hitSide=!0),ze}function Ls(e,t,i,r){var n=e.doc,x=t.left,B;if(r=="page"){var K=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(K-.5*ki(e.display),3);B=(i>0?t.bottom:t.top)+i*X}else r=="line"&&(B=i>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,x,B),!te.outside);){if(i<0?B<=0:B>=n.height){te.hitSide=!0;break}B+=i*5}return te}var kt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new fe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};kt.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;ws(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function x(K){for(var X=K.target;X;X=X.parentNode){if(X==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(X.className))break}return!1}De(n,"paste",function(K){if(!x(K)||Z(r,K)||Ss(K,r))return;F<=11&&setTimeout(zt(r,function(){return t.updateFromDOM()}),20)}),De(n,"compositionstart",function(K){t.composing={data:K.data,done:!1}}),De(n,"compositionupdate",function(K){t.composing||(t.composing={data:K.data,done:!1})}),De(n,"compositionend",function(K){t.composing&&(K.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),De(n,"touchstart",function(){return i.forceCompositionEnd()}),De(n,"input",function(){t.composing||t.readFromDOMSoon()});function B(K){if(!x(K)||Z(r,K))return;if(r.somethingSelected())ra({lineWise:!1,text:r.getSelections()}),K.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var X=Ts(r);ra({lineWise:!0,text:X.text}),K.type=="cut"&&r.operation(function(){r.setSelections(X.ranges,0,Se),r.replaceSelection("",null,"cut")})}else return;if(K.clipboardData){K.clipboardData.clearData();var te=Ir.text.join(`
`);if(K.clipboardData.setData("Text",te),K.clipboardData.getData("Text")==te){K.preventDefault();return}}var ce=Ds(),pe=ce.firstChild;r.display.lineSpace.insertBefore(ce,r.display.lineSpace.firstChild),pe.value=Ir.text.join(`
`);var Ce=document.activeElement;re(pe),setTimeout(function(){r.display.lineSpace.removeChild(ce),Ce.focus(),Ce==n&&i.showPrimarySelection()},50)}De(n,"copy",B),De(n,"cut",B)},kt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},kt.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},kt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},kt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},kt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line<t.display.viewFrom){e.removeAllRanges();return}var x=ia(t,e.anchorNode,e.anchorOffset),B=ia(t,e.focusNode,e.focusOffset);if(x&&!x.bad&&B&&!B.bad&&dt(ii(x,B),r)==0&&dt(Ei(x,B),n)==0)return;var K=t.display.view,X=r.line>=t.display.viewFrom&&ks(t,r)||{node:K[0].measure.map[2],offset:0},te=n.line<t.display.viewTo&&ks(t,n);if(!te){var ce=K[K.length-1].measure,pe=ce.maps?ce.maps[ce.maps.length-1]:ce.map;te={node:pe[pe.length-1],offset:pe[pe.length-2]-pe[pe.length-3]}}if(!X||!te){e.removeAllRanges();return}var Ce=e.rangeCount&&e.getRangeAt(0),xe;try{xe=f(X.node,X.offset,te.offset,te.node)}catch(Me){}xe&&(!k&&t.state.focused?(e.collapse(X.node,X.offset),xe.collapsed||(e.removeAllRanges(),e.addRange(xe))):(e.removeAllRanges(),e.addRange(xe)),Ce&&e.anchorNode==null?e.addRange(Ce):k&&this.startGracePeriod()),this.rememberSelection()},kt.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)},kt.prototype.showMultipleSelections=function(e){l(this.cm.display.cursorDiv,e.cursors),l(this.cm.display.selectionDiv,e.selection)},kt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},kt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},kt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},kt.prototype.blur=function(){this.div.blur()},kt.prototype.getField=function(){return this.div},kt.prototype.supportsTouch=function(){return!0},kt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():fr(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)},kt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},kt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(h&&g&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=ia(t,e.anchorNode,e.anchorOffset),r=ia(t,e.focusNode,e.focusOffset);i&&r&&fr(t,function(){er(t.doc,Xr(i,r),Se),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},kt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Fe(r.line-1,Je(e.doc,r.line-1).length)),n.ch==Je(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=Fe(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var x,B,K;r.line==t.viewFrom||(x=ci(e,r.line))==0?(B=pt(t.view[0].line),K=t.view[0].node):(B=pt(t.view[x].line),K=t.view[x-1].node.nextSibling);var X=ci(e,n.line),te,ce;if(X==t.view.length-1?(te=t.viewTo-1,ce=t.lineDiv.lastChild):(te=pt(t.view[X+1].line)-1,ce=t.view[X+1].node.previousSibling),!K)return!1;for(var pe=e.doc.splitLines(tu(e,K,ce,B,te)),Ce=St(e.doc,Fe(B,0),Fe(te,Je(e.doc,te).text.length));pe.length>1&&Ce.length>1;)if(T(pe)==T(Ce))pe.pop(),Ce.pop(),te--;else if(pe[0]==Ce[0])pe.shift(),Ce.shift(),B++;else break;for(var xe=0,Me=0,Ue=pe[0],je=Ce[0],ze=Math.min(Ue.length,je.length);xe<ze&&Ue.charCodeAt(xe)==je.charCodeAt(xe);)++xe;for(var qe=T(pe),Ke=T(Ce),tt=Math.min(qe.length-(pe.length==1?xe:0),Ke.length-(Ce.length==1?xe:0));Me<tt&&qe.charCodeAt(qe.length-Me-1)==Ke.charCodeAt(Ke.length-Me-1);)++Me;if(pe.length==1&&Ce.length==1&&B==r.line)for(;xe&&xe>r.ch&&qe.charCodeAt(qe.length-Me-1)==Ke.charCodeAt(Ke.length-Me-1);)xe--,Me++;pe[pe.length-1]=qe.slice(0,qe.length-Me).replace(/^\u200b+/,""),pe[0]=pe[0].slice(xe).replace(/\u200b+$/,"");var ht=Fe(B,xe),lt=Fe(te,Ce.length?T(Ce).length-Me:0);if(pe.length>1||pe[0]||dt(ht,lt))return Ni(e.doc,pe,ht,lt,"+input"),!0},kt.prototype.ensurePolled=function(){this.forceCompositionEnd()},kt.prototype.reset=function(){this.forceCompositionEnd()},kt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},kt.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)},kt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&fr(this.cm,function(){return sr(e.cm)})},kt.prototype.setUneditable=function(e){e.contentEditable="false"},kt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||zt(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},kt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},kt.prototype.onContextMenu=function(){},kt.prototype.resetPosition=function(){},kt.prototype.needsContentAttribute=!0;function ks(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=Je(e.doc,t.line),n=eo(i,r,t.line),x=Xe(r,e.doc.direction),B="left";if(x){var K=Ye(x,t.ch);B=K%2?"right":"left"}var X=io(n.map,t.ch,B);return X.offset=X.collapse=="right"?X.end:X.start,X}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Hi(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,n){var x="",B=!1,K=e.doc.lineSeparator(),X=!1;function te(xe){return function(Me){return Me.id==xe}}function ce(){B&&(x+=K,X&&(x+=K),B=X=!1)}function pe(xe){xe&&(ce(),x+=xe)}function Ce(xe){if(xe.nodeType==1){var Me=xe.getAttribute("cm-text");if(Me){pe(Me);return}var Ue=xe.getAttribute("cm-marker"),je;if(Ue){var ze=e.findMarks(Fe(r,0),Fe(n+1,0),te(+Ue));ze.length&&(je=ze[0].find(0))&&pe(St(e.doc,je.from,je.to).join(K));return}if(xe.getAttribute("contenteditable")=="false")return;var qe=/^(pre|div|p|li|table|br)$/i.test(xe.nodeName);if(!/^br$/i.test(xe.nodeName)&&xe.textContent.length==0)return;qe&&ce();for(var Ke=0;Ke<xe.childNodes.length;Ke++)Ce(xe.childNodes[Ke]);/^(pre|p)$/i.test(xe.nodeName)&&(X=!0),qe&&(B=!0)}else xe.nodeType==3&&pe(xe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ce(t),t==i);)t=t.nextSibling,X=!1;return x}function ia(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Hi(e.clipPos(Fe(e.display.viewTo-1)),!0);t=null,i=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 n=0;n<e.display.view.length;n++){var x=e.display.view[n];if(x.node==r)return ru(x,t,i)}}function ru(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!E(r,t))return Hi(Fe(pt(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var x=e.rest?T(e.rest):e.line;return Hi(Fe(pt(x),x.text.length),n)}var B=t.nodeType==3?t:null,K=t;for(!B&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(B=t.firstChild,i&&(i=B.nodeValue.length));K.parentNode!=r;)K=K.parentNode;var X=e.measure,te=X.maps;function ce(je,ze,qe){for(var Ke=-1;Ke<(te?te.length:0);Ke++)for(var tt=Ke<0?X.map:te[Ke],ht=0;ht<tt.length;ht+=3){var lt=tt[ht+2];if(lt==je||lt==ze){var gt=pt(Ke<0?e.line:e.rest[Ke]),It=tt[ht]+qe;return(qe<0||lt!=je)&&(It=tt[ht+(qe?1:0)]),Fe(gt,It)}}}var pe=ce(B,K,i);if(pe)return Hi(pe,n);for(var Ce=K.nextSibling,xe=B?B.nodeValue.length-i:0;Ce;Ce=Ce.nextSibling){if(pe=ce(Ce,Ce.firstChild,0),pe)return Hi(Fe(pe.line,pe.ch-xe),n);xe+=Ce.textContent.length}for(var Me=K.previousSibling,Ue=i;Me;Me=Me.previousSibling){if(pe=ce(Me,Me.firstChild,-1),pe)return Hi(Fe(pe.line,pe.ch+Ue),n);Ue+=Me.textContent.length}}var Ut=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new fe,this.hasSelection=!1,this.composing=null};Ut.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),C&&(n.style.width="0px"),De(n,"input",function(){W&&F>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),De(n,"paste",function(B){if(Z(r,B)||Ss(B,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function x(B){if(Z(r,B))return;if(r.somethingSelected())ra({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var K=Ts(r);ra({lineWise:!0,text:K.text}),B.type=="cut"?r.setSelections(K.ranges,null,Se):(i.prevInput="",n.value=K.text.join(`
`),re(n))}else return;B.type=="cut"&&(r.state.cutIncoming=+new Date)}De(n,"cut",x),De(n,"copy",x),De(e.scroller,"paste",function(B){if(jr(e,B)||Z(r,B))return;if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var K=new Event("paste");K.clipboardData=B.clipboardData,n.dispatchEvent(K)}),De(e.lineSpace,"selectstart",function(B){jr(e,B)||ee(B)}),De(n,"compositionstart",function(){var B=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:B,range:r.markText(B,r.getCursor("to"),{className:"CodeMirror-composing"})}}),De(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ut.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},Ut.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ut.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var n=kr(e,i.sel.primary().head,"div"),x=t.wrapper.getBoundingClientRect(),B=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+B.top-x.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+B.left-x.left))}return r},Ut.prototype.showSelection=function(e){var t=this.cm,i=t.display;l(i.cursorDiv,e.cursors),l(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ut.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&re(this.textarea),W&&F>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",W&&F>=9&&(this.hasSelection=null))},Ut.prototype.getField=function(){return this.textarea},Ut.prototype.supportsTouch=function(){return!1},Ut.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ut.prototype.blur=function(){this.textarea.blur()},Ut.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ut.prototype.receivedFocus=function(){this.slowPoll()},Ut.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()})},Ut.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ut.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||nt(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(W&&F>=9&&this.hasSelection===n||s&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var x=n.charCodeAt(0);if(x==8203&&!r&&(r="\u200B"),x==8666)return this.reset(),this.cm.execCommand("undo")}for(var B=0,K=Math.min(r.length,n.length);B<K&&r.charCodeAt(B)==n.charCodeAt(B);)++B;return fr(t,function(){za(t,n.slice(B),r.length-B,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ut.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ut.prototype.onKeyPress=function(){W&&F>=9&&(this.hasSelection=null),this.fastPoll()},Ut.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var x=di(i,e),B=r.scroller.scrollTop;if(!x||S)return;var K=i.options.resetSelectionOnContextMenu;K&&i.doc.sel.contains(x)==-1&&zt(i,er)(i.doc,Xr(x),Se);var X=n.style.cssText,te=t.wrapper.style.cssText,ce=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ce.top-5)+"px; left: "+(e.clientX-ce.left-5)+`px;
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var pe;O&&(pe=window.scrollY),r.input.focus(),O&&window.scrollTo(null,pe),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=xe,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function Ce(){if(n.selectionStart!=null){var Ue=i.somethingSelected(),je="\u200B"+(Ue?n.value:"");n.value="\u21DA",n.value=je,t.prevInput=Ue?"":"\u200B",n.selectionStart=1,n.selectionEnd=je.length,r.selForContextMenu=i.doc.sel}}function xe(){if(t.contextMenuPending!=xe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,n.style.cssText=X,W&&F<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=B),n.selectionStart!=null){(!W||W&&F<9)&&Ce();var Ue=0,je=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?zt(i,Qo)(i):Ue++<10?r.detectingSelectAll=setTimeout(je,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(je,200)}}if(W&&F>=9&&Ce(),D){de(e);var Me=function(){$e(window,"mouseup",Me),setTimeout(xe,20)};De(window,"mouseup",Me)}else setTimeout(xe,50)},Ut.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ut.prototype.setUneditable=function(){},Ut.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?U(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=P();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=K.getValue()}var n;if(e.form&&(De(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var x=e.form;n=x.submit;try{var B=x.submit=function(){r(),x.submit=n,x.submit(),x.submit=B}}catch(X){}}t.finishInit=function(X){X.save=r,X.getTextArea=function(){return e},X.toTextArea=function(){X.toTextArea=isNaN,r(),e.parentNode.removeChild(X.getWrapperElement()),e.style.display="",e.form&&($e(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var K=Pt(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return K}function nu(e){e.off=$e,e.on=De,e.wheelEventPixels=dl,e.Doc=lr,e.splitLines=st,e.countColumn=ae,e.findColumn=we,e.isWordChar=be,e.Pass=Ne,e.signal=oe,e.Line=li,e.changeEnd=Jr,e.scrollbarModel=So,e.Pos=Fe,e.cmpPos=dt,e.modes=Mt,e.mimeModes=xt,e.resolveMode=Yt,e.getMode=gr,e.modeExtensions=cr,e.extendMode=zr,e.copyState=Xt,e.startState=ti,e.innerMode=Br,e.commands=Cn,e.keyMap=Hr,e.keyName=us,e.isModifierKey=ss,e.lookupKey=Fi,e.normalizeKeyMap=Ol,e.StringStream=Ot,e.SharedTextMarker=bn,e.TextMarker=qr,e.LineWidget=yn,e.e_preventDefault=ee,e.e_stopPropagation=ie,e.e_stop=de,e.addClass=H,e.contains=E,e.rmClass=c,e.keyNames=$r}Xl(Pt),$l(Pt);var au="iter insert remove copy getEditor constructor".split(" ");for(var na in lr.prototype)lr.prototype.hasOwnProperty(na)&&ge(au,na)<0&&(Pt.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(lr.prototype[na]));return se(lr),Pt.inputStyles={textarea:Ut,contenteditable:kt},Pt.defineMode=function(e){!Pt.defaults.mode&&e!="null"&&(Pt.defaults.mode=e),mr.apply(this,arguments)},Pt.defineMIME=Sr,Pt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Pt.defineMIME("text/plain","null"),Pt.defineExtension=function(e,t){Pt.prototype[e]=t},Pt.defineDocExtension=function(e,t){lr.prototype[e]=t},Pt.fromTextArea=iu,nu(Pt),Pt.version="5.58.2",Pt})},W1YM:function(Pe,Re,$){},W6BS:function(Pe,Re){Pe.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/NDwJZlXiqBKlc7AEjg1aI2iVDXZpoeS9AFXlkmV1W8z+VACLE7dbMiWLE2CFADLgqig6SakCSs4jizcvAvBHMVkqxxhKkePqAs8S1mxyLUxqw6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bF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(Pe,Re,$){Pe.exports=$.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Pe,Re,$){"use strict";$.r(Re),$.d(Re,"ResizableTextArea",function(){return ge});var he=$("wx14"),Y=$("1OyB"),k=$("vuIU"),V=$("Ji7U"),_=$("LK+K"),R=$("q1tI"),W=$("VTBJ"),F=$("rePB"),O=$("Zm9Q"),M=$("Kwbf"),g=$("c+Xe"),S=$("m+aA"),I=$("bdgK"),w=new Map;function A(Se){Se.forEach(function(Ie){var Ae,we=Ie.target;(Ae=w.get(we))===null||Ae===void 0||Ae.forEach(function(ve){return ve(we)})})}var C=new I.default(A),h=null,o=null;function s(Se,Ie){w.has(Se)||(w.set(Se,new Set),C.observe(Se)),w.get(Se).add(Ie)}function u(Se,Ie){w.has(Se)&&(w.get(Se).delete(Ie),w.get(Se).size||(C.unobserve(Se),w.delete(Se)))}var y=function(Se){Object(V.a)(Ae,Se);var Ie=Object(_.a)(Ae);function Ae(){return Object(Y.a)(this,Ae),Ie.apply(this,arguments)}return Object(k.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(R.Component),m=R.createContext(null);function p(Se){var Ie=Se.children,Ae=Se.onBatchResize,we=R.useRef(0),ve=R.useRef([]),j=R.useContext(m),T=R.useCallback(function(L,G,q){we.current+=1;var N=we.current;ve.current.push({size:L,element:G,data:q}),Promise.resolve().then(function(){N===we.current&&(Ae==null||Ae(ve.current),ve.current=[])}),j==null||j(L,G,q)},[Ae,j]);return R.createElement(m.Provider,{value:T},Ie)}function D(Se){var Ie=Se.children,Ae=Se.disabled,we=R.useRef(null),ve=R.useRef(null),j=R.useContext(m),T=R.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),L=R.isValidElement(Ie)&&Object(g.c)(Ie),G=L?Ie.ref:null,q=R.useMemo(function(){return Object(g.a)(G,we)},[G,we]),N=R.useRef(Se);N.current=Se;var ue=R.useCallback(function(be){var Te=N.current,Be=Te.onResize,ke=Te.data,Oe=be.getBoundingClientRect(),_e=Oe.width,Ge=Oe.height,Ve=be.offsetWidth,Qe=be.offsetHeight,Ye=Math.floor(_e),ot=Math.floor(Ge);if(T.current.width!==Ye||T.current.height!==ot||T.current.offsetWidth!==Ve||T.current.offsetHeight!==Qe){var Xe={width:Ye,height:ot,offsetWidth:Ve,offsetHeight:Qe};T.current=Xe;var Ze=Ve===Math.round(_e)?_e:Ve,De=Qe===Math.round(Ge)?Ge:Qe,it=Object(W.a)(Object(W.a)({},Xe),{},{offsetWidth:Ze,offsetHeight:De});j==null||j(it,be,ke),Be&&Promise.resolve().then(function(){Be(it,be)})}},[]);return R.useEffect(function(){var be=Object(S.a)(we.current)||Object(S.a)(ve.current);return be&&!Ae&&s(be,ue),function(){return u(be,ue)}},[we.current,Ae]),R.createElement(y,{ref:ve},L?R.cloneElement(Ie,{ref:q}):Ie)}var b="rc-observer-key";function c(Se){var Ie=Se.children,Ae=Object(O.a)(Ie);return Ae.map(function(we,ve){var j=(we==null?void 0:we.key)||"".concat(b,"-").concat(ve);return R.createElement(D,Object(he.a)({},Se,{key:j}),we)})}c.Collection=p;var d=c,l=$("bT9E"),a=$("TSYQ"),v=$.n(a),f=`
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
`,E=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},H;function Q(Se){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(Ie&&P[Ae])return P[Ae];var we=window.getComputedStyle(Se),ve=we.getPropertyValue("box-sizing")||we.getPropertyValue("-moz-box-sizing")||we.getPropertyValue("-webkit-box-sizing"),j=parseFloat(we.getPropertyValue("padding-bottom"))+parseFloat(we.getPropertyValue("padding-top")),T=parseFloat(we.getPropertyValue("border-bottom-width"))+parseFloat(we.getPropertyValue("border-top-width")),L=E.map(function(q){return"".concat(q,":").concat(we.getPropertyValue(q))}).join(";"),G={sizingStyle:L,paddingSize:j,borderSize:T,boxSizing:ve};return Ie&&Ae&&(P[Ae]=G),G}function re(Se){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,we=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),Se.getAttribute("wrap")?H.setAttribute("wrap",Se.getAttribute("wrap")):H.removeAttribute("wrap");var ve=Q(Se,Ie),j=ve.paddingSize,T=ve.borderSize,L=ve.boxSizing,G=ve.sizingStyle;H.setAttribute("style","".concat(G,";").concat(f)),H.value=Se.value||Se.placeholder||"";var q=Number.MIN_SAFE_INTEGER,N=Number.MAX_SAFE_INTEGER,ue=H.scrollHeight,be;if(L==="border-box"?ue+=T:L==="content-box"&&(ue-=j),Ae!==null||we!==null){H.value=" ";var Te=H.scrollHeight-j;Ae!==null&&(q=Te*Ae,L==="border-box"&&(q=q+j+T),ue=Math.max(q,ue)),we!==null&&(N=Te*we,L==="border-box"&&(N=N+j+T),be=ue>N?"":"hidden",ue=Math.min(N,ue))}return{height:ue,minHeight:q,maxHeight:N,overflowY:be,resize:"none"}}var z=$("Gytx"),U=$.n(z),ae;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(ae||(ae={}));var fe=function(Se){Object(V.a)(Ae,Se);var Ie=Object(_.a)(Ae);function Ae(we){var ve;return Object(Y.a)(this,Ae),ve=Ie.call(this,we),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(j){ve.textArea=j},ve.handleResize=function(j){var T=ve.state.resizeStatus,L=ve.props,G=L.autoSize,q=L.onResize;if(T!==ae.NONE)return;typeof q=="function"&&q(j),G&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var j=ve.props.autoSize;if(!j||!ve.textArea)return;var T=j.minRows,L=j.maxRows,G=re(ve.textArea,!1,T,L);ve.setState({textareaStyles:G,resizeStatus:ae.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:ae.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:ae.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var j=ve.props,T=j.prefixCls,L=T===void 0?"rc-textarea":T,G=j.autoSize,q=j.onResize,N=j.className,ue=j.disabled,be=ve.state,Te=be.textareaStyles,Be=be.resizeStatus,ke=Object(l.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Oe=v()(L,N,Object(F.a)({},"".concat(L,"-disabled"),ue));"value"in ke&&(ke.value=ke.value||"");var _e=Object(W.a)(Object(W.a)(Object(W.a)({},ve.props.style),Te),Be===ae.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return R.createElement(d,{onResize:ve.handleResize,disabled:!(G||q)},R.createElement("textarea",Object(he.a)({},ke,{className:Oe,style:_e,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:ae.NONE},ve}return Object(k.a)(Ae,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!U()(ve.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 ve=this.textArea.selectionStart,j=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,j)}}catch(T){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(R.Component),ge=fe,Ee=function(Se){Object(V.a)(Ae,Se);var Ie=Object(_.a)(Ae);function Ae(we){var ve;Object(Y.a)(this,Ae),ve=Ie.call(this,we),ve.resizableTextArea=void 0,ve.focus=function(){ve.resizableTextArea.textArea.focus()},ve.saveTextArea=function(T){ve.resizableTextArea=T},ve.handleChange=function(T){var L=ve.props.onChange;ve.setValue(T.target.value,function(){ve.resizableTextArea.resizeTextarea()}),L&&L(T)},ve.handleKeyDown=function(T){var L=ve.props,G=L.onPressEnter,q=L.onKeyDown;T.keyCode===13&&G&&G(T),q&&q(T)};var j=typeof we.value=="undefined"||we.value===null?we.defaultValue:we.value;return ve.state={value:j},ve}return Object(k.a)(Ae,[{key:"setValue",value:function(ve,j){"value"in this.props||this.setState({value:ve},j)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return R.createElement(ge,Object(he.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ve){return"value"in ve?{value:ve.value}:null}}]),Ae}(R.Component),Ne=Re.default=Ee},bT9E:function(Pe,Re,$){"use strict";$.d(Re,"a",function(){return Y});var he=$("VTBJ");function Y(k,V){var _=Object(he.a)({},k);return Array.isArray(V)&&V.forEach(function(R){delete _[R]}),_}},c5Ni:function(Pe,Re,$){},cRFk:function(Pe,Re,$){Pe.exports=$.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Pe,Re,$){Pe.exports=$.p+"static/choose.4ad1045f.svg"},dejd:function(Pe,Re,$){},djh8:function(Pe,Re,$){Pe.exports=$.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Pe,Re,$){"use strict";var he=$("Ff2n"),Y=$("rePB"),k=$("1OyB"),V=$("vuIU"),_=$("Ji7U"),R=$("md7G"),W=$("foSv"),F=$("q1tI"),O=$.n(F),M=$("TSYQ"),g=$.n(M),S=$("4IlW");function I(l,a){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(l);a&&(f=f.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,f)}return v}function w(l){for(var a=1;a<arguments.length;a++){var v=arguments[a]!=null?arguments[a]:{};a%2?I(Object(v),!0).forEach(function(f){Object(Y.a)(l,f,v[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):I(Object(v)).forEach(function(f){Object.defineProperty(l,f,Object.getOwnPropertyDescriptor(v,f))})}return l}function A(l){var a=C();return function(){var f=Object(W.a)(l),E;if(a){var P=Object(W.a)(this).constructor;E=Reflect.construct(f,arguments,P)}else E=f.apply(this,arguments);return Object(R.a)(this,E)}}function C(){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(l){return!1}}function h(){}function o(l){l.preventDefault()}var s=function(a){return a.replace(/[^\w.-]+/g,"")},u=200,y=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,p=function(a){return a!=null},D=function(a,v){return v===a||typeof v=="number"&&typeof a=="number"&&isNaN(v)&&isNaN(a)},b=function(l){Object(_.a)(v,l);var a=A(v);function v(f){var E;Object(k.a)(this,v),E=a.call(this,f),E.onKeyDown=function(Q){var re=E.props,z=re.onKeyDown,U=re.onPressEnter;if(Q.keyCode===S.a.UP){var ae=E.getRatio(Q);E.up(Q,ae,null),E.stop()}else if(Q.keyCode===S.a.DOWN){var fe=E.getRatio(Q);E.down(Q,fe,null),E.stop()}else Q.keyCode===S.a.ENTER&&U&&U(Q);if(E.recordCursorPosition(),E.lastKeyCode=Q.keyCode,z){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),Ne=1;Ne<ge;Ne++)Ee[Ne-1]=arguments[Ne];z.apply(void 0,[Q].concat(Ee))}},E.onKeyUp=function(Q){var re=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),re){for(var z=arguments.length,U=new Array(z>1?z-1:0),ae=1;ae<z;ae++)U[ae-1]=arguments[ae];re.apply(void 0,[Q].concat(U))}},E.onChange=function(Q){var re=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(Q)),E.setState({inputValue:E.rawInput}),re(E.toNumber(E.rawInput))},E.onMouseUp=function(){var Q=E.props.onMouseUp;E.recordCursorPosition(),Q&&Q.apply(void 0,arguments)},E.onFocus=function(){var Q;E.setState({focused:!0}),(Q=E.props).onFocus.apply(Q,arguments)},E.onBlur=function(){var Q=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var re=E.getCurrentValidValue(E.state.inputValue),z=E.setValue(re,h);if(Q){var U=E.input.value,ae=E.getInputDisplayValue({focus:!1,value:z});E.input.value=ae&&Number(ae),Q.apply(void 0,arguments),E.input.value=U}},E.getRatio=function(Q){var re=1;return Q.metaKey||Q.ctrlKey?re=.1:Q.shiftKey&&(re=10),re},E.getFullNum=function(Q){return isNaN(Q)?Q:/e/i.test(String(Q))?Number(Q).toFixed(18).replace(/\.?0+$/,""):Q},E.getPrecision=function(Q){if(p(E.props.precision))return E.props.precision;var re=String(Q);if(re.indexOf("e-")>=0)return parseInt(re.slice(re.indexOf("e-")+2),10);var z=0;return re.indexOf(".")>=0&&(z=re.length-re.indexOf(".")-1),z},E.getInputDisplayValue=function(Q){var re=Q||E.state,z=re.focused,U=re.inputValue,ae=re.value,fe;z?fe=U:fe=E.toPrecisionAsStep(ae),fe==null&&(fe="");var ge=E.formatWrapper(fe);return p(E.props.decimalSeparator)&&(ge=ge.toString().replace(".",E.props.decimalSeparator)),ge},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(Q){}},E.restoreByAfter=function(Q){if(Q===void 0)return!1;var re=E.input.value,z=re.lastIndexOf(Q);if(z===-1)return!1;var U=E.cursorBefore.length;return E.lastKeyCode===S.a.DELETE&&E.cursorBefore.charAt(U-1)===Q[0]?(E.fixCaret(U,U),!0):z+Q.length===re.length?(E.fixCaret(z,z),!0):!1},E.partRestoreByAfter=function(Q){return Q===void 0?!1:Array.prototype.some.call(Q,function(re,z){var U=Q.substring(z);return E.restoreByAfter(U)})},E.isNotCompleteNumber=function(Q){return isNaN(Q)||Q===""||Q===null||Q&&Q.toString().indexOf(".")===Q.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(Q,re,z){E.pressingUpOrDown=!0,E.step("down",Q,re,z)},E.up=function(Q,re,z){E.pressingUpOrDown=!0,E.step("up",Q,re,z)},E.saveInput=function(Q){E.input=Q};var P=f.value;P===void 0&&(P=f.defaultValue),E.state={focused:f.autoFocus};var H=E.getValidValue(E.toNumber(P));return E.state=w(w({},E.state),{},{inputValue:E.toPrecisionAsStep(H),value:H}),E}return Object(V.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var P=this.props,H=P.value,Q=P.onChange,re=P.max,z=P.min,U=this.state.focused;if(E){if(!D(E.value,H)||!D(E.max,re)||!D(E.min,z)){var ae=U?H:this.getValidValue(H),fe;this.pressingUpOrDown?fe=ae:this.inputting?fe=this.rawInput:fe=this.toPrecisionAsStep(ae),this.setState({value:ae,inputValue:fe})}var ge="value"in this.props?H:this.state.value;"max"in this.props&&E.max!==re&&typeof ge=="number"&&ge>re&&Q&&Q(re),"min"in this.props&&E.min!==z&&typeof ge=="number"&&ge<z&&Q&&Q(z)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===S.a.BACKSPACE?Ee=this.cursorStart-1:this.lastKeyCode===S.a.DELETE&&(Ee=this.cursorStart):Ee=this.input.value.length,this.fixCaret(Ee,Ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case S.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case S.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ne){}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(E){var P=E;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(E){var P=E.target.value.trim().replace(/。/g,".");return p(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,Q=parseFloat(E);return isNaN(Q)?E:(Q<P&&(Q=P),Q>H&&(Q=H),Q)}},{key:"setValue",value:function(E,P){var H=this.props.precision,Q=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),re=this.state.value,z=re===void 0?null:re,U=this.state.inputValue,ae=U===void 0?null:U,fe=typeof Q=="number"?Q.toFixed(H):"".concat(Q),ge=Q!==z||fe!=="".concat(ae);return"value"in this.props?(ae=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ae},P)):this.setState({value:Q,inputValue:this.toPrecisionAsStep(E)},P),ge&&this.props.onChange(Q),Q}},{key:"getMaxPrecision",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,Q=H.precision,re=H.step;if(p(Q))return Q;var z=this.getPrecision(P),U=this.getPrecision(re),ae=this.getPrecision(E);return E?Math.max(ae,z+U):z+U}},{key:"getPrecisionFactor",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(E,P);return Math.pow(10,H)}},{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(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var P=Math.abs(this.getMaxPrecision(E));return isNaN(P)?E.toString():Number(E).toFixed(P)}},{key:"toNumber",value:function(E){var P=this.props.precision,H=this.state.focused,Q=E&&E.length>16&&H;return this.isNotCompleteNumber(E)||Q?E:p(P)?Math.round(E*Math.pow(10,P))/Math.pow(10,P):Number(E)}},{key:"upStep",value:function(E,P){var H=this.props.step,Q=this.getPrecisionFactor(E,P),re=Math.abs(this.getMaxPrecision(E,P)),z=((Q*E+Q*H*P)/Q).toFixed(re);return this.toNumber(z)}},{key:"downStep",value:function(E,P){var H=this.props.step,Q=this.getPrecisionFactor(E,P),re=Math.abs(this.getMaxPrecision(E,P)),z=((Q*E-Q*H*P)/Q).toFixed(re);return this.toNumber(z)}},{key:"step",value:function(E,P){var H=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,re=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var z=this.props;if(z.disabled)return;var U=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(U))return;var ae=this["".concat(E,"Step")](U,Q),fe=ae>z.max||ae<z.min;if(ae>z.max?ae=z.max:ae<z.min&&(ae=z.min),this.setValue(ae,null),this.setState({focused:!0},function(){H.pressingUpOrDown=!1}),fe)return;this.autoStepTimer=setTimeout(function(){H[E](P,Q,!0)},re?u:y)}},{key:"fixCaret",value:function(E,P){if(E===void 0||P===void 0||!this.input||!this.input.value)return;try{var H=this.input.selectionStart,Q=this.input.selectionEnd;(E!==H||P!==Q)&&this.input.setSelectionRange(E,P)}catch(re){}}},{key:"render",value:function(){var E,P=this.props,H=P.prefixCls,Q=P.disabled,re=P.readOnly,z=P.useTouch,U=P.autoComplete,ae=P.upHandler,fe=P.downHandler,ge=P.className,Ee=P.max,Ne=P.min,Se=P.style,Ie=P.title,Ae=P.onMouseEnter,we=P.onMouseLeave,ve=P.onMouseOver,j=P.onMouseOut,T=P.required,L=P.onClick,G=P.tabIndex,q=P.type,N=P.placeholder,ue=P.id,be=P.inputMode,Te=P.pattern,Be=P.step,ke=P.maxLength,Oe=P.autoFocus,_e=P.name,Ge=P.onPaste,Ve=P.onInput,Qe=Object(he.a)(P,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Ye=this.state,ot=Ye.value,Xe=Ye.focused,Ze=g()(H,(E={},Object(Y.a)(E,ge,!!ge),Object(Y.a)(E,"".concat(H,"-disabled"),Q),Object(Y.a)(E,"".concat(H,"-focused"),Xe),E)),De={};Object.keys(Qe).forEach(function(de){(de.substr(0,5)==="data-"||de.substr(0,5)==="aria-"||de==="role")&&(De[de]=Qe[de])});var it=!re&&!Q,$e=this.getInputDisplayValue(null),oe=(ot||ot===0)&&(isNaN(ot)||Number(ot)>=Ee),Z=(ot||ot===0)&&(isNaN(ot)||Number(ot)<=Ne),J=oe||Q||re,ne=Z||Q||re,se=g()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(Y.a)({},"".concat(H,"-handler-up-disabled"),J)),ee=g()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(Y.a)({},"".concat(H,"-handler-down-disabled"),ne)),ie=z?{onTouchStart:J?h:this.up,onTouchEnd:this.stop}:{onMouseDown:J?h:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},le=z?{onTouchStart:ne?h:this.down,onTouchEnd:this.stop}:{onMouseDown:ne?h:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:Ze,style:Se,title:Ie,onMouseEnter:Ae,onMouseLeave:we,onMouseOver:ve,onMouseOut:j,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(H,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":J,className:se}),ae||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:o})),O.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Decrease Value","aria-disabled":ne,className:ee}),fe||O.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:o}))),O.a.createElement("div",{className:"".concat(H,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ne,"aria-valuemax":Ee,"aria-valuenow":ot,required:T,type:q,placeholder:N,onPaste:Ge,onClick:L,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:G,autoComplete:U,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:h,onKeyUp:it?this.onKeyUp:h,autoFocus:Oe,maxLength:ke,readOnly:re,disabled:Q,max:Ee,min:Ne,step:Be,name:_e,title:Ie,id:ue,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum($e),pattern:Te,inputMode:be,onInput:Ve},De))))}}]),v}(O.a.Component);b.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:h,onKeyDown:h,onPressEnter:h,onFocus:h,onBlur:h,parser:s,required:!1,autoComplete:"off"};var c=b,d=Re.a=c},ji0R:function(Pe,Re,$){Pe.exports=$.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Pe,Re,$){Pe.exports=$.p+"static/question.cb52bef9.gif"},kPYp:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPfDncPmdihV6Y9nkA+Ot4nrIXaDSGElH6KfjdzpBSpVo8ttVU8Xitx/7hw/imWmYD4wXy6Iqjje9mOGYj/uX0bjYf/5nsaLcpY9fqDZ5hNTD8/wi+27b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x3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Pe,Re,$){},l2Kq:function(Pe,Re,$){Pe.exports=$.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Pe,Re,$){(function(he){he($("VrN/"),$("1eCo"),$("8EBN"))})(function(he){"use strict";he.defineMode("markdown",function(Y,k){var V=he.getMode(Y,"text/html"),_=V.name=="null";function R(z){if(he.findModeByName){var U=he.findModeByName(z);U&&(z=U.mime||U.mimes[0])}var ae=he.getMode(Y,z);return ae.name=="null"?null:ae}k.highlightFormatting===void 0&&(k.highlightFormatting=!1),k.maxBlockquoteDepth===void 0&&(k.maxBlockquoteDepth=0),k.taskLists===void 0&&(k.taskLists=!1),k.strikethrough===void 0&&(k.strikethrough=!1),k.emoji===void 0&&(k.emoji=!1),k.fencedCodeBlockHighlighting===void 0&&(k.fencedCodeBlockHighlighting=!0),k.fencedCodeBlockDefaultMode===void 0&&(k.fencedCodeBlockDefaultMode="text/plain"),k.xml===void 0&&(k.xml=!0),k.tokenTypeOverrides===void 0&&(k.tokenTypeOverrides={});var W={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var F in W)W.hasOwnProperty(F)&&k.tokenTypeOverrides[F]&&(W[F]=k.tokenTypeOverrides[F]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,S=k.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,I=/^ {0,3}(?:\={1,}|-{2,})\s*$/,w=/^[^#!\[\]*_\\<>` "'(~:]+/,A=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,C=/^\s*\[[^\]]+?\]:.*$/,h=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 s(z,U,ae){return U.f=U.inline=ae,ae(z,U)}function u(z,U,ae){return U.f=U.block=ae,ae(z,U)}function y(z){return!z||!/\S/.test(z.string)}function m(z){if(z.linkTitle=!1,z.linkHref=!1,z.linkText=!1,z.em=!1,z.strong=!1,z.strikethrough=!1,z.quote=0,z.indentedCode=!1,z.f==D){var U=_;if(!U){var ae=he.innerMode(V,z.htmlState);U=ae.mode.name=="xml"&&ae.state.tagStart===null&&!ae.state.context&&ae.state.tokenize.isInText}U&&(z.f=l,z.block=p,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function p(z,U){var ae=z.column()===U.indentation,fe=y(U.prevLine.stream),ge=U.indentedCode,Ee=U.prevLine.hr,Ne=U.list!==!1,Se=(U.listStack[U.listStack.length-1]||0)+3;U.indentedCode=!1;var Ie=U.indentation;if(U.indentationDiff===null&&(U.indentationDiff=U.indentation,Ne)){for(U.list=null;Ie<U.listStack[U.listStack.length-1];)U.listStack.pop(),U.listStack.length?U.indentation=U.listStack[U.listStack.length-1]:U.list=!1;U.list!==!1&&(U.indentationDiff=Ie-U.listStack[U.listStack.length-1])}var Ae=!fe&&!Ee&&!U.prevLine.header&&(!Ne||!ge)&&!U.prevLine.fencedCodeEnd,we=(U.list===!1||Ee||fe)&&U.indentation<=Se&&z.match(O),ve=null;if(U.indentationDiff>=4&&(ge||U.prevLine.fencedCodeEnd||U.prevLine.header||fe))return z.skipToEnd(),U.indentedCode=!0,W.code;if(z.eatSpace())return null;if(ae&&U.indentation<=Se&&(ve=z.match(S))&&ve[1].length<=6)return U.quote=0,U.header=ve[1].length,U.thisLine.header=!0,k.highlightFormatting&&(U.formatting="header"),U.f=U.inline,c(U);if(U.indentation<=Se&&z.eat(">"))return U.quote=ae?1:U.quote+1,k.highlightFormatting&&(U.formatting="quote"),z.eatSpace(),c(U);if(!we&&!U.setext&&ae&&U.indentation<=Se&&(ve=z.match(M))){var j=ve[1]?"ol":"ul";return U.indentation=Ie+z.current().length,U.list=!0,U.quote=0,U.listStack.push(U.indentation),U.em=!1,U.strong=!1,U.code=!1,U.strikethrough=!1,k.taskLists&&z.match(g,!1)&&(U.taskList=!0),U.f=U.inline,k.highlightFormatting&&(U.formatting=["list","list-"+j]),c(U)}else{if(ae&&U.indentation<=Se&&(ve=z.match(A,!0)))return U.quote=0,U.fencedEndRE=new RegExp(ve[1]+"+ *$"),U.localMode=k.fencedCodeBlockHighlighting&&R(ve[2]||k.fencedCodeBlockDefaultMode),U.localMode&&(U.localState=he.startState(U.localMode)),U.f=U.block=b,k.highlightFormatting&&(U.formatting="code-block"),U.code=-1,c(U);if(U.setext||(!Ae||!Ne)&&!U.quote&&U.list===!1&&!U.code&&!we&&!C.test(z.string)&&(ve=z.lookAhead(1))&&(ve=ve.match(I)))return U.setext?(U.header=U.setext,U.setext=0,z.skipToEnd(),k.highlightFormatting&&(U.formatting="header")):(U.header=ve[0].charAt(0)=="="?1:2,U.setext=U.header),U.thisLine.header=!0,U.f=U.inline,c(U);if(we)return z.skipToEnd(),U.hr=!0,U.thisLine.hr=!0,W.hr;if(z.peek()==="[")return s(z,U,P)}return s(z,U,U.inline)}function D(z,U){var ae=V.token(z,U.htmlState);if(!_){var fe=he.innerMode(V,U.htmlState);(fe.mode.name=="xml"&&fe.state.tagStart===null&&!fe.state.context&&fe.state.tokenize.isInText||U.md_inside&&z.current().indexOf(">")>-1)&&(U.f=l,U.block=p,U.htmlState=null)}return ae}function b(z,U){var ae=U.listStack[U.listStack.length-1]||0,fe=U.indentation<ae,ge=ae+3;if(U.fencedEndRE&&U.indentation<=ge&&(fe||z.match(U.fencedEndRE))){k.highlightFormatting&&(U.formatting="code-block");var Ee;return fe||(Ee=c(U)),U.localMode=U.localState=null,U.block=p,U.f=l,U.fencedEndRE=null,U.code=0,U.thisLine.fencedCodeEnd=!0,fe?u(z,U,U.block):Ee}else return U.localMode?U.localMode.token(z,U.localState):(z.skipToEnd(),W.code)}function c(z){var U=[];if(z.formatting){U.push(W.formatting),typeof z.formatting=="string"&&(z.formatting=[z.formatting]);for(var ae=0;ae<z.formatting.length;ae++)U.push(W.formatting+"-"+z.formatting[ae]),z.formatting[ae]==="header"&&U.push(W.formatting+"-"+z.formatting[ae]+"-"+z.header),z.formatting[ae]==="quote"&&(!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=z.quote?U.push(W.formatting+"-"+z.formatting[ae]+"-"+z.quote):U.push("error"))}if(z.taskOpen)return U.push("meta"),U.length?U.join(" "):null;if(z.taskClosed)return U.push("property"),U.length?U.join(" "):null;if(z.linkHref?U.push(W.linkHref,"url"):(z.strong&&U.push(W.strong),z.em&&U.push(W.em),z.strikethrough&&U.push(W.strikethrough),z.emoji&&U.push(W.emoji),z.linkText&&U.push(W.linkText),z.code&&U.push(W.code),z.image&&U.push(W.image),z.imageAltText&&U.push(W.imageAltText,"link"),z.imageMarker&&U.push(W.imageMarker)),z.header&&U.push(W.header,W.header+"-"+z.header),z.quote&&(U.push(W.quote),!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=z.quote?U.push(W.quote+"-"+z.quote):U.push(W.quote+"-"+k.maxBlockquoteDepth)),z.list!==!1){var fe=(z.listStack.length-1)%3;fe?fe===1?U.push(W.list2):U.push(W.list3):U.push(W.list1)}return z.trailingSpaceNewLine?U.push("trailing-space-new-line"):z.trailingSpace&&U.push("trailing-space-"+(z.trailingSpace%2?"a":"b")),U.length?U.join(" "):null}function d(z,U){return z.match(w,!0)?c(U):void 0}function l(z,U){var ae=U.text(z,U);if(typeof ae!="undefined")return ae;if(U.list)return U.list=null,c(U);if(U.taskList){var fe=z.match(g,!0)[1]===" ";return fe?U.taskOpen=!0:U.taskClosed=!0,k.highlightFormatting&&(U.formatting="task"),U.taskList=!1,c(U)}if(U.taskOpen=!1,U.taskClosed=!1,U.header&&z.match(/^#+$/,!0))return k.highlightFormatting&&(U.formatting="header"),c(U);var ge=z.next();if(U.linkTitle){U.linkTitle=!1;var Ee=ge;ge==="("&&(Ee=")"),Ee=(Ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ne="^\\s*(?:[^"+Ee+"\\\\]+|\\\\\\\\|\\\\.)"+Ee;if(z.match(new RegExp(Ne),!0))return W.linkHref}if(ge==="`"){var Se=U.formatting;k.highlightFormatting&&(U.formatting="code"),z.eatWhile("`");var Ie=z.current().length;if(U.code==0&&(!U.quote||Ie==1))return U.code=Ie,c(U);if(Ie==U.code){var Ae=c(U);return U.code=0,Ae}else return U.formatting=Se,c(U)}else if(U.code)return c(U);if(ge==="\\"&&(z.next(),k.highlightFormatting)){var we=c(U),ve=W.formatting+"-escape";return we?we+" "+ve:ve}if(ge==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return U.imageMarker=!0,U.image=!0,k.highlightFormatting&&(U.formatting="image"),c(U);if(ge==="["&&U.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return U.imageMarker=!1,U.imageAltText=!0,k.highlightFormatting&&(U.formatting="image"),c(U);if(ge==="]"&&U.imageAltText){k.highlightFormatting&&(U.formatting="image");var we=c(U);return U.imageAltText=!1,U.image=!1,U.inline=U.f=v,we}if(ge==="["&&!U.image)return U.linkText&&z.match(/^.*?\]/)||(U.linkText=!0,k.highlightFormatting&&(U.formatting="link")),c(U);if(ge==="]"&&U.linkText){k.highlightFormatting&&(U.formatting="link");var we=c(U);return U.linkText=!1,U.inline=U.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?v:l,we}if(ge==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=a,k.highlightFormatting&&(U.formatting="link");var we=c(U);return we?we+=" ":we="",we+W.linkInline}if(ge==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){U.f=U.inline=a,k.highlightFormatting&&(U.formatting="link");var we=c(U);return we?we+=" ":we="",we+W.linkEmail}if(k.xml&&ge==="<"&&z.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var j=z.string.indexOf(">",z.pos);if(j!=-1){var T=z.string.substring(z.start,j);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(T)&&(U.md_inside=!0)}return z.backUp(1),U.htmlState=he.startState(V),u(z,U,D)}if(k.xml&&ge==="<"&&z.match(/^\/\w*?>/))return U.md_inside=!1,"tag";if(ge==="*"||ge==="_"){for(var L=1,G=z.pos==1?" ":z.string.charAt(z.pos-2);L<3&&z.eat(ge);)L++;var q=z.peek()||" ",N=!/\s/.test(q)&&(!h.test(q)||/\s/.test(G)||h.test(G)),ue=!/\s/.test(G)&&(!h.test(G)||/\s/.test(q)||h.test(q)),be=null,Te=null;if(L%2&&(!U.em&&N&&(ge==="*"||!ue||h.test(G))?be=!0:U.em==ge&&ue&&(ge==="*"||!N||h.test(q))&&(be=!1)),L>1&&(!U.strong&&N&&(ge==="*"||!ue||h.test(G))?Te=!0:U.strong==ge&&ue&&(ge==="*"||!N||h.test(q))&&(Te=!1)),Te!=null||be!=null){k.highlightFormatting&&(U.formatting=be==null?"strong":Te==null?"em":"strong em"),be===!0&&(U.em=ge),Te===!0&&(U.strong=ge);var Ae=c(U);return be===!1&&(U.em=!1),Te===!1&&(U.strong=!1),Ae}}else if(ge===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return c(U);z.backUp(1)}if(k.strikethrough){if(ge==="~"&&z.eatWhile(ge)){if(U.strikethrough){k.highlightFormatting&&(U.formatting="strikethrough");var Ae=c(U);return U.strikethrough=!1,Ae}else if(z.match(/^[^\s]/,!1))return U.strikethrough=!0,k.highlightFormatting&&(U.formatting="strikethrough"),c(U)}else if(ge===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return c(U);z.backUp(2)}}if(k.emoji&&ge===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){U.emoji=!0,k.highlightFormatting&&(U.formatting="emoji");var Be=c(U);return U.emoji=!1,Be}return ge===" "&&(z.match(/^ +$/,!1)?U.trailingSpace++:U.trailingSpace&&(U.trailingSpaceNewLine=!0)),c(U)}function a(z,U){var ae=z.next();if(ae===">"){U.f=U.inline=l,k.highlightFormatting&&(U.formatting="link");var fe=c(U);return fe?fe+=" ":fe="",fe+W.linkInline}return z.match(/^[^>]+/,!0),W.linkInline}function v(z,U){if(z.eatSpace())return null;var ae=z.next();return ae==="("||ae==="["?(U.f=U.inline=E(ae==="("?")":"]"),k.highlightFormatting&&(U.formatting="link-string"),U.linkHref=!0,c(U)):"error"}var f={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(z){return function(U,ae){var fe=U.next();if(fe===z){ae.f=ae.inline=l,k.highlightFormatting&&(ae.formatting="link-string");var ge=c(ae);return ae.linkHref=!1,ge}return U.match(f[z]),ae.linkHref=!0,c(ae)}}function P(z,U){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(U.f=H,z.next(),k.highlightFormatting&&(U.formatting="link"),U.linkText=!0,c(U)):s(z,U,l)}function H(z,U){if(z.match(/^\]:/,!0)){U.f=U.inline=Q,k.highlightFormatting&&(U.formatting="link");var ae=c(U);return U.linkText=!1,ae}return z.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function Q(z,U){return z.eatSpace()?null:(z.match(/^[^\s]+/,!0),z.peek()===void 0?U.linkTitle=!0:z.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),U.f=U.inline=l,W.linkHref+" url")}var re={startState:function(){return{f:p,prevLine:{stream:null},thisLine:{stream:null},block:p,htmlState:null,indentation:0,inline:l,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(z){return{f:z.f,prevLine:z.prevLine,thisLine:z.thisLine,block:z.block,htmlState:z.htmlState&&he.copyState(V,z.htmlState),indentation:z.indentation,localMode:z.localMode,localState:z.localMode?he.copyState(z.localMode,z.localState):null,inline:z.inline,text:z.text,formatting:!1,linkText:z.linkText,linkTitle:z.linkTitle,linkHref:z.linkHref,code:z.code,em:z.em,strong:z.strong,strikethrough:z.strikethrough,emoji:z.emoji,header:z.header,setext:z.setext,hr:z.hr,taskList:z.taskList,list:z.list,listStack:z.listStack.slice(0),quote:z.quote,indentedCode:z.indentedCode,trailingSpace:z.trailingSpace,trailingSpaceNewLine:z.trailingSpaceNewLine,md_inside:z.md_inside,fencedEndRE:z.fencedEndRE}},token:function(z,U){if(U.formatting=!1,z!=U.thisLine.stream){if(U.header=0,U.hr=!1,z.match(/^\s*$/,!0))return m(U),null;if(U.prevLine=U.thisLine,U.thisLine={stream:z},U.taskList=!1,U.trailingSpace=0,U.trailingSpaceNewLine=!1,!U.localState&&(U.f=U.block,U.f!=D)){var ae=z.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(U.indentation=ae,U.indentationDiff=null,ae>0)return null}}return U.f(z,U)},innerMode:function(z){return z.block==D?{state:z.htmlState,mode:V}:z.localState?{state:z.localState,mode:z.localMode}:{state:z,mode:re}},indent:function(z,U,ae){return z.block==D&&V.indent?V.indent(z.htmlState,U,ae):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,U,ae):he.Pass},blankLine:m,getType:c,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return re},"xml"),he.defineMIME("text/markdown","markdown"),he.defineMIME("text/x-markdown","markdown")})},lzim:function(Pe,Re,$){"use strict";var he=$("E7E6"),Y=$.n(he);$.d(Re,"w",function(){return Y.a});var k=$("/GNS"),V=$.n(k);$.d(Re,"v",function(){return V.a});var _=$("FOrL"),R=$.n(_);$.d(Re,"q",function(){return R.a});var W=$("HpTS"),F=$.n(W);$.d(Re,"x",function(){return F.a});var O=$("tWlo"),M=$.n(O);$.d(Re,"a",function(){return M.a});var g=$("7ZXX"),S=$.n(g);$.d(Re,"l",function(){return S.a});var I=$("GABl"),w=$.n(I);$.d(Re,"e",function(){return w.a});var A=$("onxn"),C=$.n(A);$.d(Re,"n",function(){return C.a});var h=$("nKGa"),o=$.n(h);$.d(Re,"m",function(){return o.a});var s=$("4qgm"),u=$.n(s);$.d(Re,"y",function(){return u.a});var y=$("JeFH"),m=$.n(y);$.d(Re,"b",function(){return m.a});var p=$("ji0R"),D=$.n(p);$.d(Re,"i",function(){return D.a});var b=$("W6BS"),c=$.n(b);$.d(Re,"z",function(){return c.a});var d=$("kPYp"),l=$.n(d);$.d(Re,"A",function(){return l.a});var a=$("nukY"),v=$.n(a),f=$("4u4S"),E=$.n(f),P=$("yslc"),H=$.n(P),Q=$("l2Kq"),re=$.n(Q),z=$("RMFE"),U=$.n(z);$.d(Re,"o",function(){return U.a});var ae=$("TGq3"),fe=$.n(ae),ge=$("SMhR"),Ee=$.n(ge),Ne=$("8/bI"),Se=$.n(Ne);$.d(Re,"j",function(){return Se.a});var Ie=$("JWDV"),Ae=$.n(Ie),we=$("Xsq0"),ve=$.n(we);$.d(Re,"p",function(){return ve.a});var j=$("Ohmc"),T=$.n(j);$.d(Re,"c",function(){return T.a});var L=$("csWT"),G=$.n(L);$.d(Re,"d",function(){return G.a});var q=$("7v3h"),N=$.n(q);$.d(Re,"k",function(){return N.a});var ue=$("cRFk"),be=$.n(ue);$.d(Re,"u",function(){return be.a});var Te=$("kPWJ"),Be=$.n(Te);$.d(Re,"t",function(){return Be.a});var ke=$("qgvg"),Oe=$.n(ke);$.d(Re,"r",function(){return Oe.a});var _e=$("FPkq"),Ge=$.n(_e);$.d(Re,"s",function(){return Ge.a});var Ve=$("A/g1"),Qe=$.n(Ve);$.d(Re,"f",function(){return Qe.a});var Ye=$("Nmxd"),ot=$.n(Ye);$.d(Re,"g",function(){return ot.a});var Xe=$("5D2P"),Ze=$.n(Xe);$.d(Re,"h",function(){return Ze.a});var De=$("djh8"),it=$.n(De),$e=$("Jq4h"),oe=$.n($e)},nKGa:function(Pe,Re,$){Pe.exports=$.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(Pe,Re,$){Pe.exports={icons:"icons___3O80F"}},nukY:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLOAa9CLsB4ioLSW6azUyZAFPoBdh/w4RvZYhG2lVU2ABz6AXYf8FEb2cAv21ChmxgC/Qu7q6moeHh/9KRB/JiJ20mnVuAV+gQ+fu7u4FQ0ND/yGiLXVuAy1+BizgG/Ri2HEjEZ1k5kUZsJVWsY4tEAh06N3e3v7B8fHxt4hoWh3bIRbRm5qaaHx83NOzDcMg/DCz+RNlamhoMKtXSkX5mJrUHRh0SCml/CIzn8D+mJpInYKHNDY20p49e2hoaIguX75MIyMjrrRatWoVLVu2jJ48eUJnzpxxV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qlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Pe,Re,$){(function(he){he($("VrN/"))})(function(he){"use strict";var Y=he.Pos;function k(h,o){return h.line-o.line||h.ch-o.ch}var V="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",_=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",R=new RegExp("<(/?)(["+V+"]["+_+"]*)","g");function W(h,o,s,u){this.line=o,this.ch=s,this.cm=h,this.text=h.getLine(o),this.min=u?Math.max(u.from,h.firstLine()):h.firstLine(),this.max=u?Math.min(u.to-1,h.lastLine()):h.lastLine()}function F(h,o){var s=h.cm.getTokenTypeAt(Y(h.line,o));return s&&/\btag\b/.test(s)}function O(h){return h.line>=h.max?void 0:(h.ch=0,h.text=h.cm.getLine(++h.line),!0)}function M(h){return h.line<=h.min?void 0:(h.text=h.cm.getLine(--h.line),h.ch=h.text.length,!0)}function g(h){for(;;){var o=h.text.indexOf(">",h.ch);if(o==-1){if(O(h))continue;return}if(!F(h,o+1)){h.ch=o+1;continue}var s=h.text.lastIndexOf("/",o),u=s>-1&&!/\S/.test(h.text.slice(s+1,o));return h.ch=o+1,u?"selfClose":"regular"}}function S(h){for(;;){var o=h.ch?h.text.lastIndexOf("<",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!F(h,o+1)){h.ch=o;continue}R.lastIndex=o,h.ch=o;var s=R.exec(h.text);if(s&&s.index==o)return s}}function I(h){for(;;){R.lastIndex=h.ch;var o=R.exec(h.text);if(!o){if(O(h))continue;return}if(!F(h,o.index+1)){h.ch=o.index+1;continue}return h.ch=o.index+o[0].length,o}}function w(h){for(;;){var o=h.ch?h.text.lastIndexOf(">",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!F(h,o+1)){h.ch=o;continue}var s=h.text.lastIndexOf("/",o),u=s>-1&&!/\S/.test(h.text.slice(s+1,o));return h.ch=o+1,u?"selfClose":"regular"}}function A(h,o){for(var s=[];;){var u=I(h),y,m=h.line,p=h.ch-(u?u[0].length:0);if(!u||!(y=g(h)))return;if(y=="selfClose")continue;if(u[1]){for(var D=s.length-1;D>=0;--D)if(s[D]==u[2]){s.length=D;break}if(D<0&&(!o||o==u[2]))return{tag:u[2],from:Y(m,p),to:Y(h.line,h.ch)}}else s.push(u[2])}}function C(h,o){for(var s=[];;){var u=w(h);if(!u)return;if(u=="selfClose"){S(h);continue}var y=h.line,m=h.ch,p=S(h);if(!p)return;if(p[1])s.push(p[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==p[2]){s.length=D;break}if(D<0&&(!o||o==p[2]))return{tag:p[2],from:Y(h.line,h.ch),to:Y(y,m)}}}}he.registerHelper("fold","xml",function(h,o){for(var s=new W(h,o.line,0);;){var u=I(s);if(!u||s.line!=o.line)return;var y=g(s);if(!y)return;if(!u[1]&&y!="selfClose"){var m=Y(s.line,s.ch),p=A(s,u[2]);return p&&k(p.from,m)>0?{from:m,to:p.from}:null}}}),he.findMatchingTag=function(h,o,s){var u=new W(h,o.line,o.ch,s);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var y=g(u),m=y&&Y(u.line,u.ch),p=y&&S(u);if(!y||!p||k(u,o)>0)return;var D={from:Y(u.line,u.ch),to:m,tag:p[2]};return y=="selfClose"?{open:D,close:null,at:"open"}:p[1]?{open:C(u,p[2]),close:D,at:"close"}:(u=new W(h,m.line,m.ch,s),{open:D,close:A(u,p[2]),at:"open"})},he.findEnclosingTag=function(h,o,s,u){for(var y=new W(h,o.line,o.ch,s);;){var m=C(y,u);if(!m)break;var p=new W(h,o.line,o.ch,s),D=A(p,m.tag);if(D)return{open:m,close:D}}},he.scanForClosingTag=function(h,o,s,u){var y=new W(h,o.line,o.ch,u?{from:0,to:u}:null);return A(y,s)}})},p5ED:function(Pe,Re,$){"use strict";var he=$("+L6B"),Y=$("2/Rp"),k=$("5Dmo"),V=$("3S7+"),_=$("k1fw"),R=$("9og8"),W=$("tJVT"),F=$("WmNS"),O=$.n(F),M=$("q1tI"),g=$.n(M),S=$("vHTk"),I=$.n(S),w=$("yEEn"),A=$("ZW9T"),C=$("1vsH"),h=$("V0Rq"),o=$("m3rI");Re.a=function(s){var u,y,m,p,D,b,c,d=s.editOffice,l=d===void 0?"view":d,a=s.data,v=s.theme,f=s.type,E=s.filename,P=s.monacoEditor,H=s.className,Q=s.style,re=s.close,z=s.onClose,U=s.hasMask,ae=s.disabledDownload,fe=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ge=Object(W.a)(fe,2),Ee=ge[0],Ne=ge[1],Se=Object(M.useState)(""),Ie=Object(W.a)(Se,2),Ae=Ie[0],we=Ie[1],ve=Object(M.useState)(),j=Object(W.a)(ve,2),T=j[0],L=j[1],G=window.ENV==="build"?"/react/build":"",q=o.a.PROXY_SERVER||location.origin,N,ue=1024*1024,be=10*ue,Te=Object(M.useRef)();(u=a)!==null&&u!==void 0&&u.startsWith("/api")&&f!=="txt"&&(a=(o.a.API_SERVER||location.origin)+a),f==="office"&&(N=Object(C.T)(a).filesize,N>be&&(f="other")),E&&P&&(P.filename=E),Object(M.useEffect)(function(){var _e,Ge,Ve=(_e=document.cookie)===null||_e===void 0||((Ge=_e.replace(/\s/g,""))===null||Ge===void 0)?void 0:Ge.split(";");Ve==null||Ve.map(function(Qe){var Ye=Qe.split("=");Ye[0]==="_educoder_session"&&we(Ye[1])})},[]),Object(M.useEffect)(function(){f==="office"&&Be()},[f,a]);var Be=function(){var _e=Object(R.a)(O.a.mark(function Ge(){var Ve,Qe,Ye;return O.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return console.log("data:",a),Ve=a,a.startsWith("http")||(Ve=location.origin+Ve),Qe=new URL(Ve).pathname.split("/").pop(),Xe.next=6,Object(h.V)({attachment_id:Qe});case 6:Ye=Xe.sent,L(Ye);case 8:case"end":return Xe.stop()}},Ge)}));return function(){return _e.apply(this,arguments)}}(),ke=function(){if(a.startsWith("http")||a.startsWith("blob:")){Oe();return}Object(C.z)(E||"educoder",a,E)},Oe=function(){Object(C.x)(E||"educoder",decodeURIComponent(a))};return g.a.createElement("div",{style:Object(_.a)({},Q||{}),className:"".concat(U&&I.a.bgBlack," ").concat(f?I.a.wrp:"hide")},re&&g.a.createElement("div",{className:I.a.close,ref:Te},!ae&&g.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Te.current}},g.a.createElement("span",{onClick:Oe},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Te.current}},g.a.createElement("span",{className:"",onClick:z},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(I.a[H]," ").concat(H," ").concat(I.a.monaco," ").concat(f==="txt"?"show":"hide")},f==="txt"&&g.a.createElement(A.b,P)),f==="audio"&&g.a.createElement("audio",{src:"".concat(((y=a)===null||y===void 0?void 0:y.indexOf("http://"))>-1||((m=a)===null||m===void 0?void 0:m.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(a),autoPlay:!0}),f==="video"&&g.a.createElement(g.a.Fragment,null,((p=a)===null||p===void 0?void 0:p.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),f==="office"&&T&&g.a.createElement("iframe",{src:"".concat(G,"/office.html?key=").concat(T.key,"&url=").concat(q+T.url,"&callbackUrl=").concat(q+T.callbackUrl,"&fileType=").concat(T.fileType,"&title=").concat(T.title,"&model=").concat(l,"&officeServer=").concat(o.a.OFFICE_SERVER,"&disabledDownload=").concat(!!ae)}),f==="html"&&g.a.createElement("iframe",{src:a+"&disposition=inline"}),f==="pdf"&&g.a.createElement("iframe",{src:"".concat(G,"/js/pdfview/index.html?url=").concat(a,"&disabledDownload=").concat(!!ae)}),f==="image"&&g.a.createElement("img",{src:"".concat(((D=a)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((b=a)===null||b===void 0?void 0:b.indexOf("https://"))>-1||(c=a)!==null&&c!==void 0&&c.startsWith("/api")?"":"data:image/png;base64,").concat(a)}),f==="other"&&g.a.createElement("div",null,g.a.createElement(Y.a,{type:"primary",size:"large",onClick:ke},g.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),f==="download"&&g.a.createElement(Y.a,{type:"primary",size:"large",onClick:ke},g.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Pe,Re,$){},qgvg:function(Pe,Re){Pe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2V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TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Pe,Re){const $=/[&<>"']/,he=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_=b=>V[b];function R(b,c){if(c){if($.test(b))return b.replace(he,_)}else if(Y.test(b))return b.replace(k,_);return b}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(b){return b.replace(W,(c,d)=>(d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""))}const O=/(^|[^\[])\^/g;function M(b,c){b=b.source||b,c=c||"";const d={replace:(l,a)=>(a=a.source||a,a=a.replace(O,"$1"),b=b.replace(l,a),d),getRegex:()=>new RegExp(b,c)};return d}const g=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function I(b,c,d){if(b){let l;try{l=decodeURIComponent(F(d)).replace(g,"").toLowerCase()}catch(a){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}c&&!S.test(d)&&(d=o(c,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch(l){return null}return d}const w={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(b,c){w[" "+b]||(A.test(b)?w[" "+b]=b+"/":w[" "+b]=m(b,"/",!0)),b=w[" "+b];const d=b.indexOf(":")===-1;return c.substring(0,2)==="//"?d?c:b.replace(C,"$1")+c:c.charAt(0)==="/"?d?c:b.replace(h,"$1")+c:b+c}const s={exec:function(){}};function u(b){let c=1,d,l;for(;c<arguments.length;c++){d=arguments[c];for(l in d)Object.prototype.hasOwnProperty.call(d,l)&&(b[l]=d[l])}return b}function y(b,c){const d=b.replace(/\|/g,(v,f,E)=>{let P=!1,H=f;for(;--H>=0&&E[H]==="\\";)P=!P;return P?"|":" |"}),l=d.split(/ \|/);let a=0;if(l.length>c)l.splice(c);else for(;l.length<c;)l.push("");for(;a<l.length;a++)l[a]=l[a].trim().replace(/\\\|/g,"|");return l}function m(b,c,d){const l=b.length;if(l===0)return"";let a=0;for(;a<l;){const v=b.charAt(l-a-1);if(v===c&&!d)a++;else if(v!==c&&d)a++;else break}return b.substr(0,l-a)}function p(b,c){if(b.indexOf(c[1])===-1)return-1;const d=b.length;let l=0,a=0;for(;a<d;a++)if(b[a]==="\\")a++;else if(b[a]===c[0])l++;else if(b[a]===c[1]&&(l--,l<0))return a;return-1}function D(b){b&&b.sanitize&&!b.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")}Pe.exports={escape:R,unescape:F,edit:M,cleanUrl:I,resolveUrl:o,noopTest:s,merge:u,splitCells:y,rtrim:m,findClosingBracket:p,checkSanitizeDeprecation:D}},tWlo:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi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//9R4RYzxZOtZTwK0C2vEjHjT2Ov3sx2d3TA7ZxPzuhrB5nVdiQ8pNPPvKP+XkEjjbYKtXm0VOpHe5x01KDDI72dFtmI+EGz1IkDyOeIvnlETH/T/digqKoLXeLLts3UNgY0REXGQZpmpqtCmrjV1/ZWcrEzIzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(Pe,Re,$){typeof window!="undefined"&&function(Y,k){Pe.exports=k()}(this,function(){return function(he){var Y={};function k(V){if(Y[V])return Y[V].exports;var _=Y[V]={i:V,l:!1,exports:{}};return he[V].call(_.exports,_,_.exports,k),_.l=!0,_.exports}return k.m=he,k.c=Y,k.d=function(V,_,R){k.o(V,_)||Object.defineProperty(V,_,{enumerable:!0,get:R})},k.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},k.t=function(V,_){if(_&1&&(V=k(V)),_&8)return V;if(_&4&&typeof V=="object"&&V&&V.__esModule)return V;var R=Object.create(null);if(k.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:V}),_&2&&typeof V!="string")for(var W in V)k.d(R,W,function(F){return V[F]}.bind(null,W));return R},k.n=function(V){var _=V&&V.__esModule?function(){return V.default}:function(){return V};return k.d(_,"a",_),_},k.o=function(V,_){return Object.prototype.hasOwnProperty.call(V,_)},k.p="/dist/",k(k.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(he,Y,k){"use strict";var V=Object.prototype.hasOwnProperty,_="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(_=!1));function W(g,S,I){this.fn=g,this.context=S,this.once=I||!1}function F(g,S,I,w,A){if(typeof I!="function")throw new TypeError("The listener must be a function");var C=new W(I,w||g,A),h=_?_+S:S;return g._events[h]?g._events[h].fn?g._events[h]=[g._events[h],C]:g._events[h].push(C):(g._events[h]=C,g._eventsCount++),g}function O(g,S){--g._eventsCount===0?g._events=new R:delete g._events[S]}function M(){this._events=new R,this._eventsCount=0}M.prototype.eventNames=function(){var S=[],I,w;if(this._eventsCount===0)return S;for(w in I=this._events)V.call(I,w)&&S.push(_?w.slice(1):w);return Object.getOwnPropertySymbols?S.concat(Object.getOwnPropertySymbols(I)):S},M.prototype.listeners=function(S){var I=_?_+S:S,w=this._events[I];if(!w)return[];if(w.fn)return[w.fn];for(var A=0,C=w.length,h=new Array(C);A<C;A++)h[A]=w[A].fn;return h},M.prototype.listenerCount=function(S){var I=_?_+S:S,w=this._events[I];return w?w.fn?1:w.length:0},M.prototype.emit=function(S,I,w,A,C,h){var o=_?_+S:S;if(!this._events[o])return!1;var s=this._events[o],u=arguments.length,y,m;if(s.fn){s.once&&this.removeListener(S,s.fn,void 0,!0);switch(u){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,I),!0;case 3:return s.fn.call(s.context,I,w),!0;case 4:return s.fn.call(s.context,I,w,A),!0;case 5:return s.fn.call(s.context,I,w,A,C),!0;case 6:return s.fn.call(s.context,I,w,A,C,h),!0}for(m=1,y=new Array(u-1);m<u;m++)y[m-1]=arguments[m];s.fn.apply(s.context,y)}else{var p=s.length,D;for(m=0;m<p;m++){s[m].once&&this.removeListener(S,s[m].fn,void 0,!0);switch(u){case 1:s[m].fn.call(s[m].context);break;case 2:s[m].fn.call(s[m].context,I);break;case 3:s[m].fn.call(s[m].context,I,w);break;case 4:s[m].fn.call(s[m].context,I,w,A);break;default:if(!y)for(D=1,y=new Array(u-1);D<u;D++)y[D-1]=arguments[D];s[m].fn.apply(s[m].context,y)}}}return!0},M.prototype.on=function(S,I,w){return F(this,S,I,w,!1)},M.prototype.once=function(S,I,w){return F(this,S,I,w,!0)},M.prototype.removeListener=function(S,I,w,A){var C=_?_+S:S;if(!this._events[C])return this;if(!I)return O(this,C),this;var h=this._events[C];if(h.fn)h.fn===I&&(!A||h.once)&&(!w||h.context===w)&&O(this,C);else{for(var o=0,s=[],u=h.length;o<u;o++)(h[o].fn!==I||A&&!h[o].once||w&&h[o].context!==w)&&s.push(h[o]);s.length?this._events[C]=s.length===1?s[0]:s:O(this,C)}return this},M.prototype.removeAllListeners=function(S){var I;return S?(I=_?_+S:S,this._events[I]&&O(this,I)):(this._events=new R,this._eventsCount=0),this},M.prototype.off=M.prototype.removeListener,M.prototype.addListener=M.prototype.on,M.prefixed=_,M.EventEmitter=M,he.exports=M},"./node_modules/url-toolkit/src/url-toolkit.js":function(he,Y,k){(function(V){var _=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O={buildAbsoluteURL:function(M,g,S){if(S=S||{},M=M.trim(),g=g.trim(),!g){if(!S.alwaysNormalize)return M;var I=O.parseURL(M);if(!I)throw new Error("Error trying to parse base URL.");return I.path=O.normalizePath(I.path),O.buildURLFromParts(I)}var w=O.parseURL(g);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return S.alwaysNormalize?(w.path=O.normalizePath(w.path),O.buildURLFromParts(w)):g;var A=O.parseURL(M);if(!A)throw new Error("Error trying to parse base URL.");if(!A.netLoc&&A.path&&A.path[0]!=="/"){var C=R.exec(A.path);A.netLoc=C[1],A.path=C[2]}A.netLoc&&!A.path&&(A.path="/");var h={scheme:A.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(h.netLoc=A.netLoc,w.path[0]!=="/"))if(!w.path)h.path=A.path,w.params||(h.params=A.params,w.query||(h.query=A.query));else{var o=A.path,s=o.substring(0,o.lastIndexOf("/")+1)+w.path;h.path=O.normalizePath(s)}return h.path===null&&(h.path=S.alwaysNormalize?O.normalizePath(w.path):w.path),O.buildURLFromParts(h)},parseURL:function(M){var g=_.exec(M);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(M){for(M=M.split("").reverse().join("").replace(W,"");M.length!==(M=M.replace(F,"")).length;);return M.split("").reverse().join("")},buildURLFromParts:function(M){return M.scheme+M.netLoc+M.path+M.params+M.query+M.fragment}};he.exports=O})(this)},"./node_modules/webworkify-webpack/index.js":function(he,Y,k){function V(S){var I={};function w(C){if(I[C])return I[C].exports;var h=I[C]={i:C,l:!1,exports:{}};return S[C].call(h.exports,h,h.exports,w),h.l=!0,h.exports}w.m=S,w.c=I,w.i=function(C){return C},w.d=function(C,h,o){w.o(C,h)||Object.defineProperty(C,h,{configurable:!1,enumerable:!0,get:o})},w.r=function(C){Object.defineProperty(C,"__esModule",{value:!0})},w.n=function(C){var h=C&&C.__esModule?function(){return C.default}:function(){return C};return w.d(h,"a",h),h},w.o=function(C,h){return Object.prototype.hasOwnProperty.call(C,h)},w.p="/",w.oe=function(C){throw console.error(C),C};var A=w(w.s=ENTRY_MODULE);return A.default||A}var _="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+_+").*?\\)";function W(S){return(S+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function F(S){return!isNaN(1*S)}function O(S,I,w){var A={};A[w]=[];var C=I.toString(),h=C.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return A;for(var o=h[1],s=new RegExp("(\\\\n|\\W)"+W(o)+R,"g"),u;u=s.exec(C);){if(u[3]==="dll-reference")continue;A[w].push(u[3])}for(s=new RegExp("\\("+W(o)+'\\("(dll-reference\\s('+_+'))"\\)\\)'+R,"g");u=s.exec(C);)S[u[2]]||(A[w].push(u[1]),S[u[2]]=k(u[1]).m),A[u[2]]=A[u[2]]||[],A[u[2]].push(u[4]);for(var y=Object.keys(A),m=0;m<y.length;m++)for(var p=0;p<A[y[m]].length;p++)F(A[y[m]][p])&&(A[y[m]][p]=1*A[y[m]][p]);return A}function M(S){var I=Object.keys(S);return I.reduce(function(w,A){return w||S[A].length>0},!1)}function g(S,I){for(var w={main:[I]},A={main:[]},C={main:{}};M(w);)for(var h=Object.keys(w),o=0;o<h.length;o++){var s=h[o],u=w[s],y=u.pop();if(C[s]=C[s]||{},C[s][y]||!S[s][y])continue;C[s][y]=!0,A[s]=A[s]||[],A[s].push(y);for(var m=O(S,S[s][y],s),p=Object.keys(m),D=0;D<p.length;D++)w[p[D]]=w[p[D]]||[],w[p[D]]=w[p[D]].concat(m[p[D]])}return A}he.exports=function(S,I){I=I||{};var w={main:k.m},A=I.all?{main:Object.keys(w.main)}:g(w,S),C="";Object.keys(A).filter(function(y){return y!=="main"}).forEach(function(y){for(var m=0;A[y][m];)m++;A[y].push(m),w[y][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",C=C+"var "+y+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+A[y].map(function(p){return""+JSON.stringify(p)+": "+w[y][p].toString()}).join(",")+`});
`}),C=C+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+A.main.map(function(y){return""+JSON.stringify(y)+": "+w.main[y].toString()}).join(",")+"}))(self);";var h=new window.Blob([C],{type:"text/javascript"});if(I.bare)return h;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,s=o.createObjectURL(h),u=new window.Worker(s);return u.objectURL=s,u}},"./src/config.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"hlsDefaultConfig",function(){return D}),k.d(Y,"mergeConfig",function(){return c}),k.d(Y,"enableStreamingMode",function(){return d});var V=k("./src/controller/abr-controller.ts"),_=k("./src/controller/audio-stream-controller.ts"),R=k("./src/controller/audio-track-controller.ts"),W=k("./src/controller/subtitle-stream-controller.ts"),F=k("./src/controller/subtitle-track-controller.ts"),O=k("./src/controller/buffer-controller.ts"),M=k("./src/controller/timeline-controller.ts"),g=k("./src/controller/cap-level-controller.ts"),S=k("./src/controller/fps-controller.ts"),I=k("./src/controller/eme-controller.ts"),w=k("./src/controller/cmcd-controller.ts"),A=k("./src/utils/xhr-loader.ts"),C=k("./src/utils/fetch-loader.ts"),h=k("./src/utils/cues.ts"),o=k("./src/utils/mediakeys-helper.ts"),s=k("./src/utils/logger.ts");function u(){return u=Object.assign||function(l){for(var a=1;a<arguments.length;a++){var v=arguments[a];for(var f in v)Object.prototype.hasOwnProperty.call(v,f)&&(l[f]=v[f])}return l},u.apply(this,arguments)}function y(l,a){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(l);a&&(f=f.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,f)}return v}function m(l){for(var a=1;a<arguments.length;a++){var v=arguments[a]!=null?arguments[a]:{};a%2?y(Object(v),!0).forEach(function(f){p(l,f,v[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):y(Object(v)).forEach(function(f){Object.defineProperty(l,f,Object.getOwnPropertyDescriptor(v,f))})}return l}function p(l,a,v){return a in l?Object.defineProperty(l,a,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[a]=v,l}var D=m(m({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:A.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:O.default,capLevelController:g.default,fpsController:S.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},b()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:F.default,timelineController:M.TimelineController,audioStreamController:_.default,audioTrackController:R.default,emeController:I.default,cmcdController:w.default});function b(){return{cueHandler:h.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 c(l,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 u({},l,a)}function d(l){var a=l.loader;if(a!==C.default&&a!==A.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),l.progressive=!1;else{var v=Object(C.fetchSupported)();v&&(l.loader=C.default,l.progressive=!0,l.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/polyfills/number.ts"),_=k("./src/utils/ewma-bandwidth-estimator.ts"),R=k("./src/events.ts"),W=k("./src/utils/buffer-helper.ts"),F=k("./src/errors.ts"),O=k("./src/types/loader.ts"),M=k("./src/utils/logger.ts");function g(w,A){for(var C=0;C<A.length;C++){var h=A[C];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(w,h.key,h)}}function S(w,A,C){return A&&g(w.prototype,A),C&&g(w,C),w}var I=function(){function w(C){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=C;var h=C.config;this.bwEstimator=new _.default(h.abrEwmaSlowVoD,h.abrEwmaFastVoD,h.abrEwmaDefaultEstimate),this.registerListeners()}var A=w.prototype;return A.registerListeners=function(){var h=this.hls;h.on(R.Events.FRAG_LOADING,this.onFragLoading,this),h.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),h.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(R.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var h=this.hls;h.off(R.Events.FRAG_LOADING,this.onFragLoading,this),h.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(R.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},A.onFragLoading=function(h,o){var s=o.frag;if(s.type===O.PlaylistLevelType.MAIN&&!this.timer){var u;this.fragCurrent=s,this.partCurrent=(u=o.part)!=null?u:null,this.timer=self.setInterval(this.onCheck,100)}},A.onLevelLoaded=function(h,o){var s=this.hls.config;o.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},A._abandonRulesCheck=function(){var h=this.fragCurrent,o=this.partCurrent,s=this.hls,u=s.autoLevelEnabled,y=s.config,m=s.media;if(!h||!m)return;var p=o?o.stats:h.stats,D=o?o.duration:h.duration;if(p.aborted){M.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!u||m.paused||!m.playbackRate||!m.readyState)return;var b=performance.now()-p.loading.start,c=Math.abs(m.playbackRate);if(b<=500*D/c)return;var d=s.levels,l=s.minAutoLevel,a=d[h.level],v=p.total||Math.max(p.loaded,Math.round(D*a.maxBitrate/8)),f=Math.max(1,p.bwEstimate?p.bwEstimate/8:p.loaded*1e3/b),E=(v-p.loaded)/f,P=m.currentTime,H=(W.BufferHelper.bufferInfo(m,P,y.maxBufferHole).end-P)/c;if(H>=2*D/c||E<=H)return;var Q=Number.POSITIVE_INFINITY,re;for(re=h.level-1;re>l;re--){var z=d[re].maxBitrate;if(Q=D*z/(8*.8*f),Q<H)break}if(Q>=E)return;var U=this.bwEstimator.getEstimate();M.logger.warn("Fragment "+h.sn+(o?" part "+o.index:"")+" of level "+h.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+re+`
Current BW estimate: `+(Object(V.isFiniteNumber)(U)?(U/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+E.toFixed(3)+` s
Estimated load time for the next fragment: `+Q.toFixed(3)+` s
Time to underbuffer: `+H.toFixed(3)+" s"),s.nextLoadLevel=re,this.bwEstimator.sample(b,p.loaded),this.clearTimer(),h.loader&&(this.fragCurrent=this.partCurrent=null,h.loader.abort()),s.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:h,part:o,stats:p})},A.onFragLoaded=function(h,o){var s=o.frag,u=o.part;if(s.type===O.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(s.sn)){var y=u?u.stats:s.stats,m=u?u.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var p=this.hls.levels[s.level],D=(p.loaded?p.loaded.bytes:0)+y.loaded,b=(p.loaded?p.loaded.duration:0)+m;p.loaded={bytes:D,duration:b},p.realBitrate=Math.round(8*D/b)}if(s.bitrateTest){var c={stats:y,frag:s,part:u,id:s.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,c),s.bitrateTest=!1}}},A.onFragBuffered=function(h,o){var s=o.frag,u=o.part,y=u?u.stats:s.stats;if(y.aborted)return;if(s.type!==O.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var m=y.parsing.end-y.loading.start;this.bwEstimator.sample(m,y.loaded),y.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},A.onError=function(h,o){switch(o.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},A.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},A.getNextABRAutoLevel=function(){var h=this.fragCurrent,o=this.partCurrent,s=this.hls,u=s.maxAutoLevel,y=s.config,m=s.minAutoLevel,p=s.media,D=o?o.duration:h?h.duration:0,b=p?p.currentTime:0,c=p&&p.playbackRate!==0?Math.abs(p.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():y.abrEwmaDefaultEstimate,l=(W.BufferHelper.bufferInfo(p,b,y.maxBufferHole).end-b)/c,a=this.findBestLevel(d,m,u,l,y.abrBandWidthFactor,y.abrBandWidthUpFactor);if(a>=0)return a;M.logger.trace((l?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=D?Math.min(D,y.maxStarvationDelay):y.maxStarvationDelay,f=y.abrBandWidthFactor,E=y.abrBandWidthUpFactor;if(!l){var P=this.bitrateTestDelay;if(P){var H=D?Math.min(D,y.maxLoadingDelay):y.maxLoadingDelay;v=H-P,M.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),f=E=1}}return a=this.findBestLevel(d,m,u,l+v,f,E),Math.max(a,0)},A.findBestLevel=function(h,o,s,u,y,m){for(var p,D=this.fragCurrent,b=this.partCurrent,c=this.lastLoadedFragLevel,d=this.hls.levels,l=d[c],a=!!(l!=null&&(p=l.details)!==null&&p!==void 0&&p.live),v=l==null?void 0:l.codecSet,f=b?b.duration:D?D.duration:0,E=s;E>=o;E--){var P=d[E];if(!P||v&&P.codecSet!==v)continue;var H=P.details,Q=(b?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||f,re=void 0;E<=c?re=y*h:re=m*h;var z=d[E].maxBitrate,U=z*Q/re;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round(re)+"/"+z+"/"+Q+"/"+u+"/"+U),re>z&&(!U||a&&!this.bitrateTestDelay||U<u))return E}return-1},S(w,[{key:"nextAutoLevel",get:function(){var h=this._nextAutoLevel,o=this.bwEstimator;if(h!==-1&&(!o||!o.canEstimate()))return h;var s=this.getNextABRAutoLevel();return h!==-1&&(s=Math.min(h,s)),s},set:function(h){this._nextAutoLevel=h}}]),w}();Y.default=I},"./src/controller/audio-stream-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/polyfills/number.ts"),_=k("./src/controller/base-stream-controller.ts"),R=k("./src/events.ts"),W=k("./src/utils/buffer-helper.ts"),F=k("./src/controller/fragment-tracker.ts"),O=k("./src/types/level.ts"),M=k("./src/types/loader.ts"),g=k("./src/loader/fragment.ts"),S=k("./src/demux/chunk-cache.ts"),I=k("./src/demux/transmuxer-interface.ts"),w=k("./src/types/transmuxer.ts"),A=k("./src/controller/fragment-finders.ts"),C=k("./src/utils/discontinuities.ts"),h=k("./src/errors.ts"),o=k("./src/utils/logger.ts");function s(){return s=Object.assign||function(D){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(D[d]=c[d])}return D},s.apply(this,arguments)}function u(D,b){D.prototype=Object.create(b.prototype),D.prototype.constructor=D,y(D,b)}function y(D,b){return y=Object.setPrototypeOf||function(d,l){return d.__proto__=l,d},y(D,b)}var m=100,p=function(D){u(b,D);function b(d,l){var a;return a=D.call(this,d,l,"[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 c=b.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var l=this.hls;l.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(R.Events.ERROR,this.onError,this),l.on(R.Events.BUFFER_RESET,this.onBufferReset,this),l.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c._unregisterListeners=function(){var l=this.hls;l.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(R.Events.ERROR,this.onError,this),l.off(R.Events.BUFFER_RESET,this.onBufferReset,this),l.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c.onInitPtsFound=function(l,a){var v=a.frag,f=a.id,E=a.initPTS;if(f==="main"){var P=v.cc;this.initPTS[v.cc]=E,this.log("InitPTS for cc: "+P+" found from main: "+E),this.videoTrackCC=P,this.state===_.State.WAITING_INIT_PTS&&this.tick()}},c.startLoad=function(l){if(!this.levels){this.startPosition=l,this.state=_.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,a>0&&l===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=_.State.IDLE):(this.loadedmetadata=!1,this.state=_.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()},c.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_TRACK:{var l,a=this.levels,v=this.trackId,f=a==null||((l=a[v])===null||l===void 0)?void 0:l.details;if(f){if(this.waitForCdnTuneIn(f))break;this.state=_.State.WAITING_INIT_PTS}break}case _.State.FRAG_LOADING_WAITING_RETRY:{var E,P=performance.now(),H=this.retryDate;(!H||P>=H||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=_.State.IDLE);break}case _.State.WAITING_INIT_PTS:{var Q=this.waitingData;if(Q){var re=Q.frag,z=Q.part,U=Q.cache,ae=Q.complete;if(this.initPTS[re.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.FRAG_LOADING;var fe=U.flush(),ge={frag:re,part:z,payload:fe,networkDetails:null};this._handleFragmentLoadProgress(ge),ae&&D.prototype._handleFragmentLoadComplete.call(this,ge)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+re.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Ee=this.getLoadPosition(),Ne=W.BufferHelper.bufferInfo(this.mediaBuffer,Ee,this.config.maxBufferHole),Se=Object(A.fragmentWithinToleranceTest)(Ne.end,this.config.maxFragLookUpTolerance,re);Se<0&&(o.logger.log("Waiting fragment cc ("+re.cc+") @ "+re.start+" cancelled because another fragment at "+Ne.end+" is needed"),this.clearWaitingFragment())}}else this.state=_.State.IDLE}}this.onTickEnd()},c.clearWaitingFragment=function(){var l=this.waitingData;l&&(this.fragmentTracker.removeFragment(l.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.IDLE)},c.onTickEnd=function(){var l=this.media;if(!l||!l.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:l,v=a.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=l.currentTime},c.doTickIdle=function(){var l,a,v=this.hls,f=this.levels,E=this.media,P=this.trackId,H=v.config;if(!f||!f[P])return;if(!E&&(this.startFragRequested||!H.startFragPrefetch))return;var Q=f[P],re=Q.details;if(!re||re.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(re)){this.state=_.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,M.PlaylistLevelType.AUDIO));var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,M.PlaylistLevelType.AUDIO);if(z===null)return;var U=z.len,ae=this.getMaxBufferLength(),fe=this.audioSwitch;if(U>=ae&&!fe)return;if(!fe&&this._streamEnded(z,re)){v.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=_.State.ENDED;return}var ge=re.fragments,Ee=ge[0].start,Ne=z.end;if(fe){var Se=this.getLoadPosition();Ne=Se,re.PTSKnown&&Se<Ee&&((z.end>Ee||z.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),E.currentTime=Ee+.05))}var Ie=this.getNextFragment(Ne,re);if(!Ie){this.bufferFlushed=!0;return}((l=Ie.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((a=Ie.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Ie,re):this.loadFragment(Ie,re,Ne)},c.getMaxBufferLength=function(){var l=D.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return a===null?l:Math.max(l,a.len)},c.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},c.onAudioTracksUpdated=function(l,a){var v=a.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(f){return new O.Level(f)})},c.onAudioTrackSwitching=function(l,a){var v=!!a.url;this.trackId=a.id;var f=this.fragCurrent;f!=null&&f.loader&&f.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(m):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=_.State.IDLE):this.state=_.State.STOPPED,this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},c.onLevelLoaded=function(l,a){this.mainDetails=a.details},c.onAudioTrackLoaded=function(l,a){var v,f=this.levels,E=a.details,P=a.id;if(!f){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var H=f[P],Q=0;if(E.live||(v=H.details)!==null&&v!==void 0&&v.live){var re=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!re)return;!H.details&&E.hasProgramDateTime&&re.hasProgramDateTime?(Object(C.alignMediaPlaylistByPDT)(E,re),Q=E.fragments[0].start):Q=this.alignPlaylists(E,H.details)}H.details=E,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(H.details,Q),this.state===_.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=_.State.IDLE),this.tick()},c._handleFragmentLoadProgress=function(l){var a,v=l.frag,f=l.part,E=l.payload,P=this.config,H=this.trackId,Q=this.levels;if(!Q){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var re=Q[H];console.assert(re,"Audio track is defined on fragment load progress");var z=re.details;console.assert(z,"Audio track details are defined on fragment load progress");var U=P.defaultAudioCodec||re.audioCodec||"mp4a.40.2",ae=this.transmuxer;ae||(ae=this.transmuxer=new I.default(this.hls,M.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var fe=this.initPTS[v.cc],ge=(a=v.initSegment)===null||a===void 0?void 0:a.data;if(fe!==void 0){var Ee=!1,Ne=f?f.index:-1,Se=Ne!==-1,Ie=new w.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,E.byteLength,Ne,Se);ae.push(E,ge,U,"",v,f,z.totalduration,Ee,Ie,fe)}else{o.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+z.startSN+" ,"+z.endSN+"],track "+H);var Ae=this.waitingData=this.waitingData||{frag:v,part:f,cache:new S.default,complete:!1},we=Ae.cache;we.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=_.State.WAITING_INIT_PTS}},c._handleFragmentLoadComplete=function(l){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,l)},c.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},c.onBufferCreated=function(l,a){var v=a.tracks.audio;v&&(this.mediaBuffer=v.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},c.onFragBuffered=function(l,a){var v=a.frag,f=a.part;if(v.type!==M.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(f?" p: "+f.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,f)},c.onError=function(l,a){switch(a.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.AUDIO,a);break;case h.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case h.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==_.State.ERROR&&this.state!==_.State.STOPPED&&(this.state=a.fatal?_.State.ERROR:_.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var v=!0,f=this.getFwdBufferInfo(this.mediaBuffer,M.PlaylistLevelType.AUDIO);f&&f.len>.5&&(v=!this.reduceMaxBufferLength(f.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},c.onBufferFlushed=function(l,a){var v=a.type;v===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},c._handleTransmuxComplete=function(l){var a,v="audio",f=this.hls,E=l.remuxResult,P=l.chunkMeta,H=this.getCurrentContext(P);if(!H){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var Q=H.frag,re=H.part,z=E.audio,U=E.text,ae=E.id3,fe=E.initSegment;if(this.fragContextChanged(Q))return;if(this.state=_.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),fe!=null&&fe.tracks&&(this._bufferInitSegment(fe.tracks,Q,P),f.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:Q,id:v,tracks:fe.tracks})),z){var ge=z.startPTS,Ee=z.endPTS,Ne=z.startDTS,Se=z.endDTS;re&&(re.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ge,endPTS:Ee,startDTS:Ne,endDTS:Se}),Q.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ge,Ee,Ne,Se),this.bufferFragmentData(z,Q,re,P)}if(ae!=null&&(a=ae.samples)!==null&&a!==void 0&&a.length){var Ie=s({frag:Q,id:v},ae);f.trigger(R.Events.FRAG_PARSING_METADATA,Ie)}if(U){var Ae=s({frag:Q,id:v},U);f.trigger(R.Events.FRAG_PARSING_USERDATA,Ae)}},c._bufferInitSegment=function(l,a,v){if(this.state!==_.State.PARSING)return;l.video&&delete l.video;var f=l.audio;if(!f)return;f.levelCodec=f.codec,f.id="audio",this.log("Init audio buffer, container:"+f.container+", codecs[parsed]=["+f.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,l);var E=f.initSegment;if(E!=null&&E.byteLength){var P={type:"audio",frag:a,part:null,chunkMeta:v,parent:a.type,data:E};this.hls.trigger(R.Events.BUFFER_APPENDING,P)}this.tick()},c.loadFragment=function(l,a,v){var f=this.fragmentTracker.getState(l);this.fragCurrent=l,(this.audioSwitch||f===F.FragmentState.NOT_LOADED||f===F.FragmentState.PARTIAL)&&(l.sn==="initSegment"?this._loadInitSegment(l):a.live&&!Object(V.isFiniteNumber)(this.initPTS[l.cc])?(this.log("Waiting for video PTS in continuity counter "+l.cc+" of live stream before loading audio fragment "+l.sn+" of level "+this.trackId),this.state=_.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,l,a,v)))},c.completeAudioSwitch=function(){var l=this.hls,a=this.media,v=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,l.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:v})},b}(_.default);Y.default=p},"./src/controller/audio-track-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/events.ts"),_=k("./src/errors.ts"),R=k("./src/controller/base-playlist-controller.ts"),W=k("./src/types/loader.ts");function F(I,w){for(var A=0;A<w.length;A++){var C=w[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(I,C.key,C)}}function O(I,w,A){return w&&F(I.prototype,w),A&&F(I,A),I}function M(I,w){I.prototype=Object.create(w.prototype),I.prototype.constructor=I,g(I,w)}function g(I,w){return g=Object.setPrototypeOf||function(C,h){return C.__proto__=h,C},g(I,w)}var S=function(I){M(w,I);function w(C){var h;return h=I.call(this,C,"[audio-track-controller]")||this,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.trackName="",h.selectDefaultTrack=!0,h.registerListeners(),h}var A=w.prototype;return A.registerListeners=function(){var h=this.hls;h.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(V.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var h=this.hls;h.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(V.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,I.prototype.destroy.call(this)},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},A.onManifestParsed=function(h,o){this.tracks=o.audioTracks||[]},A.onAudioTrackLoaded=function(h,o){var s=o.id,u=o.details,y=this.tracksInGroup[s];if(!y){this.warn("Invalid audio track id "+s);return}var m=y.details;y.details=o.details,this.log("audioTrack "+s+" loaded ["+u.startSN+"-"+u.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,o,m))},A.onLevelLoading=function(h,o){this.switchLevel(o.level)},A.onLevelSwitching=function(h,o){this.switchLevel(o.level)},A.switchLevel=function(h){var o=this.hls.levels[h];if(!(o!=null&&o.audioGroupIds))return;var s=o.audioGroupIds[o.urlId];if(this.groupId!==s){this.groupId=s;var u=this.tracks.filter(function(m){return!s||m.groupId===s});this.selectDefaultTrack&&!u.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=u;var y={audioTracks:u};this.log("Updating audio tracks, "+u.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,y),this.selectInitialTrack()}},A.onError=function(h,o){if(I.prototype.onError.call(this,h,o),o.fatal||!o.context)return;o.context.type===W.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},A.setAudioTrack=function(h){var o=this.tracksInGroup;if(h<0||h>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=o[this.trackId];this.log("Now switching to audio-track index "+h);var u=o[h],y=u.id,m=u.groupId,p=m===void 0?"":m,D=u.name,b=u.type,c=u.url;if(this.trackId=h,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:y,groupId:p,name:D,type:b,url:c}),u.details&&!u.details.live)return;var d=this.switchParams(u.url,s==null?void 0:s.details);this.loadPlaylist(d)},A.selectInitialTrack=function(){var h=this.tracksInGroup;console.assert(h.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,s=this.findTrackId(o)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},A.findTrackId=function(h){for(var o=this.tracksInGroup,s=0;s<o.length;s++){var u=o[s];if((!this.selectDefaultTrack||u.default)&&(!h||h===u.name))return u.id}return-1},A.loadPlaylist=function(h){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var s=o.id,u=o.groupId,y=o.url;if(h)try{y=h.addDirectives(y)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:y,id:s,groupId:u,deliveryDirectives:h||null})}},O(w,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1,this.setAudioTrack(h)}}]),w}(R.default);Y.default=S},"./src/controller/base-playlist-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return O});var V=k("./src/polyfills/number.ts"),_=k("./src/types/level.ts"),R=k("./src/controller/level-helper.ts"),W=k("./src/utils/logger.ts"),F=k("./src/errors.ts"),O=function(){function M(S,I){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,I+":"),this.warn=W.logger.warn.bind(W.logger,I+":"),this.hls=S}var g=M.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(I,w){w.fatal&&w.type===F.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(I,w){var A=w==null?void 0:w.renditionReports;if(A)for(var C=0;C<A.length;C++){var h=A[C],o=""+h.URI;if(o===I.substr(-o.length)){var s=parseInt(h["LAST-MSN"]),u=parseInt(h["LAST-PART"]);if(w&&this.hls.config.lowLatencyMode){var y=Math.min(w.age-w.partTarget,w.targetduration);u!==void 0&&y>w.partTarget&&(u+=1)}if(Object(V.isFiniteNumber)(s))return new _.HlsUrlParameters(s,Object(V.isFiniteNumber)(u)?u:void 0,_.HlsSkip.No)}}},g.loadPlaylist=function(I){},g.shouldLoadTrack=function(I){return this.canLoad&&I&&!!I.url&&(!I.details||I.details.live)},g.playlistLoaded=function(I,w,A){var C=this,h=w.details,o=w.stats,s=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(h.advancedDateTime=Date.now()-s,h.live||A!=null&&A.live){if(h.reloaded(A),A&&this.log("live playlist "+I+" "+(h.advanced?"REFRESHED "+h.lastPartSn+"-"+h.lastPartIndex:"MISSED")),A&&h.fragments.length>0&&Object(R.mergeDetails)(A,h),!this.canLoad||!h.live)return;var u,y=void 0,m=void 0;if(h.canBlockReload&&h.endSN&&h.advanced){var p=this.hls.config.lowLatencyMode,D=h.lastPartSn,b=h.endSN,c=h.lastPartIndex,d=c!==-1,l=D===b,a=p?0:c;d?(y=l?b+1:D,m=l?a:c+1):y=b+1;var v=h.age,f=v+h.ageHeader,E=Math.min(f-h.partTarget,h.targetduration*1.5);if(E>0){if(A&&E>A.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+A.tuneInGoal+" to: "+E+" with playlist age: "+h.age),E=0;else{var P=Math.floor(E/h.targetduration);if(y+=P,m!==void 0){var H=Math.round(E%h.targetduration/h.partTarget);m+=H}this.log("CDN Tune-in age: "+h.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+E+" skip sn "+P+" to part "+m)}h.tuneInGoal=E}if(u=this.getDeliveryDirectives(h,w.deliveryDirectives,y,m),p||!l){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(h,w.deliveryDirectives,y,m);var Q=Object(R.computeReloadInterval)(h,o);y!==void 0&&h.canBlockReload&&(Q-=h.partTarget||1),this.log("reload live playlist "+I+" in "+Math.round(Q)+" ms"),this.timer=self.setTimeout(function(){return C.loadPlaylist(u)},Q)}else this.clearTimer()},g.getDeliveryDirectives=function(I,w,A,C){var h=Object(_.getSkipValue)(I,A);return w!=null&&w.skip&&I.deltaUpdateFailed&&(A=w.msn,C=w.part,h=_.HlsSkip.No),new _.HlsUrlParameters(A,C,h)},g.retryLoadingOrFail=function(I){var w=this,A=this.hls.config,C=this.retryCount<A.levelLoadingMaxRetry;if(C){var h;if(this.retryCount++,I.details.indexOf("LoadTimeOut")>-1&&(h=I.context)!==null&&h!==void 0&&h.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+I.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*A.levelLoadingRetryDelay,A.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return w.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+I.details+'"')}}else this.warn('cannot recover from error "'+I.details+'"'),this.clearTimer(),I.fatal=!0;return C},M}()},"./src/controller/base-stream-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"State",function(){return b}),k.d(Y,"default",function(){return c});var V=k("./src/polyfills/number.ts"),_=k("./src/task-loop.ts"),R=k("./src/controller/fragment-tracker.ts"),W=k("./src/utils/buffer-helper.ts"),F=k("./src/utils/logger.ts"),O=k("./src/events.ts"),M=k("./src/errors.ts"),g=k("./src/types/transmuxer.ts"),S=k("./src/utils/mp4-tools.ts"),I=k("./src/utils/discontinuities.ts"),w=k("./src/controller/fragment-finders.ts"),A=k("./src/controller/level-helper.ts"),C=k("./src/loader/fragment-loader.ts"),h=k("./src/crypt/decrypter.ts"),o=k("./src/utils/time-ranges.ts"),s=k("./src/types/loader.ts");function u(d,l){for(var a=0;a<l.length;a++){var v=l[a];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(d,v.key,v)}}function y(d,l,a){return l&&u(d.prototype,l),a&&u(d,a),d}function m(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function p(d,l){d.prototype=Object.create(l.prototype),d.prototype.constructor=d,D(d,l)}function D(d,l){return D=Object.setPrototypeOf||function(v,f){return v.__proto__=f,v},D(d,l)}var b={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"},c=function(d){p(l,d);function l(v,f,E){var P;return P=d.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=b.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=E,P.log=F.logger.log.bind(F.logger,E+":"),P.warn=F.logger.warn.bind(F.logger,E+":"),P.hls=v,P.fragmentLoader=new C.default(v.config),P.fragmentTracker=f,P.config=v.config,P.decrypter=new h.default(v,v.config),v.on(O.Events.KEY_LOADED,P.onKeyLoaded,m(P)),P}var a=l.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(f){},a.stopLoad=function(){this.fragmentLoader.abort();var f=this.fragCurrent;f&&this.fragmentTracker.removeFragment(f),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=b.STOPPED},a._streamEnded=function(f,E){var P=this.fragCurrent,H=this.fragmentTracker;if(!E.live&&P&&P.sn===E.endSN&&!f.nextStart){var Q=H.getState(P);return Q===R.FragmentState.PARTIAL||Q===R.FragmentState.OK}return!1},a.onMediaAttached=function(f,E){var P=this.media=this.mediaBuffer=E.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var H=this.config;this.levels&&H.autoStartLoad&&this.state===b.STOPPED&&this.startLoad(H.startPosition)},a.onMediaDetaching=function(){var f=this.media;f!=null&&f.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),f&&(f.removeEventListener("seeking",this.onvseeking),f.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 f=this.config,E=this.fragCurrent,P=this.media,H=this.mediaBuffer,Q=this.state,re=P?P.currentTime:0,z=W.BufferHelper.bufferInfo(H||P,re,f.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(re)?re.toFixed(3):re)+", state: "+Q),Q===b.ENDED)this.resetLoadingState();else if(E&&!z.len){var U=f.maxFragLookUpTolerance,ae=E.start-U,fe=E.start+E.duration+U,ge=re>fe;(re<ae||ge)&&(ge&&E.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),E.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=re),!this.loadedmetadata&&!z.len&&(this.nextLoadPosition=this.startPosition=re),this.tickImmediate()},a.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},a.onKeyLoaded=function(f,E){if(this.state!==b.KEY_LOADING||E.frag!==this.fragCurrent||!this.levels)return;this.state=b.IDLE;var P=this.levels[E.frag.level].details;P&&this.loadFragment(E.frag,P,E.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),d.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=b.STOPPED,this.hls.off(O.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,d.prototype.onHandlerDestroyed.call(this)},a.loadKey=function(f,E){this.log("Loading key for "+f.sn+" of ["+E.startSN+"-"+E.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+f.level),this.state=b.KEY_LOADING,this.fragCurrent=f,this.hls.trigger(O.Events.KEY_LOADING,{frag:f})},a.loadFragment=function(f,E,P){this._loadFragForPlayback(f,E,P)},a._loadFragForPlayback=function(f,E,P){var H=this,Q=function(z){if(H.fragContextChanged(f)){H.warn("Fragment "+f.sn+(z.part?" p: "+z.part.index:"")+" of level "+f.level+" was dropped during download."),H.fragmentTracker.removeFragment(f);return}f.stats.chunkCount++,H._handleFragmentLoadProgress(z)};this._doFragLoad(f,E,P,Q).then(function(re){if(!re)return;H.fragLoadError=0;var z=H.state;if(H.fragContextChanged(f)){(z===b.FRAG_LOADING||z===b.BACKTRACKING||!H.fragCurrent&&z===b.PARSING)&&(H.fragmentTracker.removeFragment(f),H.state=b.IDLE);return}if("payload"in re&&(H.log("Loaded fragment "+f.sn+" of level "+f.level),H.hls.trigger(O.Events.FRAG_LOADED,re),H.state===b.BACKTRACKING)){H.fragmentTracker.backtrack(f,re),H.resetFragmentLoading(f);return}H._handleFragmentLoadComplete(re)}).catch(function(re){H.warn(re),H.resetFragmentLoading(f)})},a.flushMainBuffer=function(f,E,P){if(P===void 0&&(P=null),!(f-E))return;var H={startOffset:f,endOffset:E,type:P};this.fragLoadError=0,this.hls.trigger(O.Events.BUFFER_FLUSHING,H)},a._loadInitSegment=function(f){var E=this;this._doFragLoad(f).then(function(P){if(!P||E.fragContextChanged(f)||!E.levels)throw new Error("init load aborted");return P}).then(function(P){var H=E.hls,Q=P.payload,re=f.decryptdata;if(Q&&Q.byteLength>0&&re&&re.key&&re.iv&&re.method==="AES-128"){var z=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(Q),re.key.buffer,re.iv.buffer).then(function(U){var ae=self.performance.now();return H.trigger(O.Events.FRAG_DECRYPTED,{frag:f,payload:U,stats:{tstart:z,tdecrypt:ae}}),P.payload=U,P})}return P}).then(function(P){var H=E.fragCurrent,Q=E.hls,re=E.levels;if(!re)throw new Error("init load aborted, missing levels");var z=re[f.level].details;console.assert(z,"Level details are defined when init segment is loaded");var U=f.stats;E.state=b.IDLE,E.fragLoadError=0,f.data=new Uint8Array(P.payload),U.parsing.start=U.buffering.start=self.performance.now(),U.parsing.end=U.buffering.end=self.performance.now(),P.frag===H&&Q.trigger(O.Events.FRAG_BUFFERED,{stats:U,frag:H,part:null,id:f.type}),E.tick()}).catch(function(P){E.warn(P),E.resetFragmentLoading(f)})},a.fragContextChanged=function(f){var E=this.fragCurrent;return!f||!E||f.level!==E.level||f.sn!==E.sn||f.urlId!==E.urlId},a.fragBufferedComplete=function(f,E){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+f.type+" sn: "+f.sn+(E?" part: "+E.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+f.level+" "+o.default.toString(W.BufferHelper.getBuffered(P))),this.state=b.IDLE,this.tick()},a._handleFragmentLoadComplete=function(f){var E=this.transmuxer;if(!E)return;var P=f.frag,H=f.part,Q=f.partsLoaded,re=!Q||Q.length===0||Q.some(function(U){return!U}),z=new g.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,H?H.index:-1,!re);E.flush(z)},a._handleFragmentLoadProgress=function(f){},a._doFragLoad=function(f,E,P,H){var Q=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(f.start,P||0),this.config.lowLatencyMode&&E){var re=E.partList;if(re&&H){P>f.end&&E.fragmentHint&&(f=E.fragmentHint);var z=this.getNextPart(re,f,P);if(z>-1){var U=re[z];return this.log("Loading part sn: "+f.sn+" p: "+U.index+" cc: "+f.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+z+"-"+(re.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+f.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=U.start+U.duration,this.state=b.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:f,part:re[z],targetBufferTime:P}),this.doFragPartsLoad(f,re,z,H).catch(function(ae){return Q.handleFragLoadError(ae)})}else if(!f.url||this.loadedEndOfParts(re,P))return Promise.resolve(null)}}return this.log("Loading fragment "+f.sn+" cc: "+f.cc+" "+(E?"of ["+E.startSN+"-"+E.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+f.level+", target: "+parseFloat(P.toFixed(3))),Object(V.isFiniteNumber)(f.sn)&&!this.bitrateTest&&(this.nextLoadPosition=f.start+f.duration),this.state=b.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:f,targetBufferTime:P}),this.fragmentLoader.load(f,H).catch(function(ae){return Q.handleFragLoadError(ae)})},a.doFragPartsLoad=function(f,E,P,H){var Q=this;return new Promise(function(re,z){var U=[],ae=function fe(ge){var Ee=E[ge];Q.fragmentLoader.loadPart(f,Ee,H).then(function(Ne){U[Ee.index]=Ne;var Se=Ne.part;Q.hls.trigger(O.Events.FRAG_LOADED,Ne);var Ie=E[ge+1];if(Ie&&Ie.fragment===f)fe(ge+1);else return re({frag:f,part:Se,partsLoaded:U})}).catch(z)};ae(P)})},a.handleFragLoadError=function(f){var E=f.data;return E&&E.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(O.Events.ERROR,E),null},a._handleTransmuxerFlush=function(f){var E=this.getCurrentContext(f);if(!E||this.state!==b.PARSING){this.fragCurrent||(this.state=b.IDLE);return}var P=E.frag,H=E.part,Q=E.level,re=self.performance.now();P.stats.parsing.end=re,H&&(H.stats.parsing.end=re),this.updateLevelTiming(P,H,Q,f.partial)},a.getCurrentContext=function(f){var E=this.levels,P=f.level,H=f.sn,Q=f.part;if(!E||!E[P])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+P+". The current chunk will not be buffered."),null;var re=E[P],z=Q>-1?Object(A.getPartWith)(re,H,Q):null,U=z?z.fragment:Object(A.getFragmentWithSN)(re,H,this.fragCurrent);return U?{frag:U,part:z,level:re}:null},a.bufferFragmentData=function(f,E,P,H){if(!f||this.state!==b.PARSING)return;var Q=f.data1,re=f.data2,z=Q;if(Q&&re&&(z=Object(S.appendUint8Array)(Q,re)),!z||!z.length)return;var U={type:f.type,frag:E,part:P,chunkMeta:H,parent:E.type,data:z};this.hls.trigger(O.Events.BUFFER_APPENDING,U),f.dropped&&f.independent&&!P&&this.flushBufferGap(E)},a.flushBufferGap=function(f){var E=this.media;if(!E)return;if(!W.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,f.start);return}var P=E.currentTime,H=W.BufferHelper.bufferInfo(E,P,0),Q=f.duration,re=Math.min(this.config.maxFragLookUpTolerance*2,Q*.25),z=Math.max(Math.min(f.start-re,H.end-re),P+re);f.start-z>re&&this.flushMainBuffer(z,f.start)},a.getFwdBufferInfo=function(f,E){var P=this.config,H=this.getLoadPosition();if(!Object(V.isFiniteNumber)(H))return null;var Q=W.BufferHelper.bufferInfo(f,H,P.maxBufferHole);if(Q.len===0&&Q.nextStart!==void 0){var re=this.fragmentTracker.getBufferedFrag(H,E);if(re&&Q.nextStart<re.end)return W.BufferHelper.bufferInfo(f,H,Math.max(Q.nextStart,P.maxBufferHole))}return Q},a.getMaxBufferLength=function(f){var E=this.config,P;return f?P=Math.max(8*E.maxBufferSize/f,E.maxBufferLength):P=E.maxBufferLength,Math.min(P,E.maxMaxBufferLength)},a.reduceMaxBufferLength=function(f){var E=this.config,P=f||E.maxBufferLength;return E.maxMaxBufferLength>=P?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(f,E){var P,H,Q=E.fragments,re=Q.length;if(!re)return null;var z=this.config,U=Q[0].start,ae;if(E.live){var fe=z.initialLiveManifestSize;if(re<fe)return this.warn("Not enough fragments to start playback (have: "+re+", need: "+fe+")"),null;!E.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(ae=this.getInitialLiveFragment(E,Q),this.startPosition=ae?this.hls.liveSyncPosition||ae.start:f)}else f<=U&&(ae=Q[0]);if(!ae){var ge=z.lowLatencyMode?E.partEnd:E.fragmentEnd;ae=this.getFragmentAtPosition(f,ge,E)}return(P=ae)!==null&&P!==void 0&&P.initSegment&&!((H=ae)!==null&&H!==void 0&&H.initSegment.data)&&!this.bitrateTest&&(ae=ae.initSegment),ae},a.getNextPart=function(f,E,P){for(var H=-1,Q=!1,re=!0,z=0,U=f.length;z<U;z++){var ae=f[z];if(re=re&&!ae.independent,H>-1&&P<ae.start)break;var fe=ae.loaded;!fe&&(Q||ae.independent||re)&&ae.fragment===E&&(H=z),Q=fe}return H},a.loadedEndOfParts=function(f,E){var P=f[f.length-1];return P&&E>P.start&&P.loaded},a.getInitialLiveFragment=function(f,E){var P=this.fragPrevious,H=null;if(P){if(f.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),H=Object(w.findFragmentByPDT)(E,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var Q=P.sn+1;if(Q>=f.startSN&&Q<=f.endSN){var re=E[Q-f.startSN];P.cc===re.cc&&(H=re,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(w.findFragWithCC)(E,P.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(H=this.getFragmentAtPosition(z,this.bitrateTest?f.fragmentEnd:f.edge,f))}return H},a.getFragmentAtPosition=function(f,E,P){var H=this.config,Q=this.fragPrevious,re=P.fragments,z=P.endSN,U=P.fragmentHint,ae=H.maxFragLookUpTolerance,fe=!!(H.lowLatencyMode&&P.partList&&U);fe&&U&&!this.bitrateTest&&(re=re.concat(U),z=U.sn);var ge;if(f<E){var Ee=f>E-ae?0:ae;ge=Object(w.findFragmentByPTS)(Q,re,f,Ee)}else ge=re[re.length-1];if(ge){var Ne=ge.sn-P.startSN,Se=Q&&ge.level===Q.level,Ie=re[Ne+1],Ae=this.fragmentTracker.getState(ge);if(Ae===R.FragmentState.BACKTRACKED){ge=null;for(var we=Ne;re[we]&&this.fragmentTracker.getState(re[we])===R.FragmentState.BACKTRACKED;)Q?ge=re[we--]:ge=re[--we];ge||(ge=Ie)}else Q&&ge.sn===Q.sn&&!fe&&(Se&&(ge.sn<z&&this.fragmentTracker.getState(Ie)!==R.FragmentState.OK?(this.log("SN "+ge.sn+" just loaded, load next one: "+Ie.sn),ge=Ie):ge=null))}return ge},a.synchronizeToLiveEdge=function(f){var E=this.config,P=this.media;if(!P)return;var H=this.hls.liveSyncPosition,Q=P.currentTime,re=f.fragments[0].start,z=f.edge,U=Q>=re-E.maxFragLookUpTolerance&&Q<=z;if(H!==null&&P.duration>H&&(Q<H||!U)){var ae=E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:E.liveMaxLatencyDurationCount*f.targetduration;(!U&&P.readyState<4||Q<z-ae)&&(this.loadedmetadata||(this.nextLoadPosition=H),P.readyState&&(this.warn("Playback: "+Q.toFixed(3)+" is located too far from the end of live sliding playlist: "+z+", reset currentTime to : "+H.toFixed(3)),P.currentTime=H))}},a.alignPlaylists=function(f,E){var P=this.levels,H=this.levelLastLoaded,Q=this.fragPrevious,re=H!==null?P[H]:null,z=f.fragments.length;if(!z)return this.warn("No fragments in live playlist"),0;var U=f.fragments[0].start,ae=!E,fe=f.alignedSliding&&Object(V.isFiniteNumber)(U);if(ae||!fe&&!U){Object(I.alignStream)(Q,re,f);var ge=f.fragments[0].start;return this.log("Live playlist sliding: "+ge.toFixed(2)+" start-sn: "+(E?E.startSN:"na")+"->"+f.startSN+" prev-sn: "+(Q?Q.sn:"na")+" fragments: "+z),ge}return U},a.waitForCdnTuneIn=function(f){var E=3;return f.live&&f.canBlockReload&&f.tuneInGoal>Math.max(f.partHoldBack,f.partTarget*E)},a.setStartPosition=function(f,E){var P=this.startPosition;if(P<E&&(P=-1),P===-1||this.lastCurrentTime===-1){var H=f.startTimeOffset;Object(V.isFiniteNumber)(H)?(P=E+H,H<0&&(P+=f.totalduration),P=Math.min(Math.max(E,P),E+f.totalduration),this.log("Start time offset "+H+" found in playlist, adjust startPosition to "+P),this.startPosition=P):f.live?P=this.hls.liveSyncPosition||E:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},a.getLoadPosition=function(){var f=this.media,E=0;return this.loadedmetadata&&f?E=f.currentTime:this.nextLoadPosition&&(E=this.nextLoadPosition),E},a.handleFragLoadAborted=function(f,E){this.transmuxer&&f.sn!=="initSegment"&&f.stats.aborted&&(this.warn("Fragment "+f.sn+(E?" part"+E.index:"")+" of level "+f.level+" was aborted"),this.resetFragmentLoading(f))},a.resetFragmentLoading=function(f){(!this.fragCurrent||!this.fragContextChanged(f))&&(this.state=b.IDLE)},a.onFragmentOrKeyLoadError=function(f,E){if(E.fatal)return;var P=E.frag;if(!P||P.type!==f)return;var H=this.fragCurrent;console.assert(H&&P.sn===H.sn&&P.level===H.level&&P.urlId===H.urlId,"Frag load error must match current frag to retry");var Q=this.config;if(this.fragLoadError+1<=Q.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var re=Math.min(Math.pow(2,this.fragLoadError)*Q.fragLoadingRetryDelay,Q.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+f+" "+P.level+" failed to load, retrying in "+re+"ms"),this.retryDate=self.performance.now()+re,this.fragLoadError++,this.state=b.FRAG_LOADING_WAITING_RETRY}else E.levelRetry?(f===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=b.IDLE):(F.logger.error(E.details+" reaches max retry, redispatch as fatal ..."),E.fatal=!0,this.hls.stopLoad(),this.state=b.ERROR)},a.afterBufferFlushed=function(f,E,P){if(!f)return;var H=W.BufferHelper.getBuffered(f);this.fragmentTracker.detectEvictedFragments(E,H,P),this.state===b.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=b.IDLE},a.resetLiveStartWhenNotLoaded=function(f){if(!this.loadedmetadata){this.startFragRequested=!1;var E=this.levels?this.levels[f].details:null;if(E!=null&&E.live)return this.startPosition=-1,this.setStartPosition(E,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(f,E,P,H){var Q=this,re=P.details;console.assert(!!re,"level.details must be defined");var z=Object.keys(f.elementaryStreams).reduce(function(U,ae){var fe=f.elementaryStreams[ae];if(fe){var ge=fe.endPTS-fe.startPTS;if(ge<=0)return Q.warn("Could not parse fragment "+f.sn+" "+ae+" duration reliably ("+ge+") resetting transmuxer to fallback to playlist timing"),Q.resetTransmuxer(),U||!1;var Ee=H?0:Object(A.updateFragPTSDTS)(re,f,fe.startPTS,fe.endPTS,fe.startDTS,fe.endDTS);return Q.hls.trigger(O.Events.LEVEL_PTS_UPDATED,{details:re,level:P,drift:Ee,type:ae,frag:f,start:fe.startPTS,end:fe.endPTS}),!0}return U},!1);z?(this.state=b.PARSED,this.hls.trigger(O.Events.FRAG_PARSED,{frag:f,part:E})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},y(l,[{key:"state",get:function(){return this._state},set:function(f){var E=this._state;E!==f&&(this._state=f,this.log(E+"->"+f))}}]),l}(_.default)},"./src/controller/buffer-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return w});var V=k("./src/polyfills/number.ts"),_=k("./src/events.ts"),R=k("./src/utils/logger.ts"),W=k("./src/errors.ts"),F=k("./src/utils/buffer-helper.ts"),O=k("./src/utils/mediasource-helper.ts"),M=k("./src/loader/fragment.ts"),g=k("./src/controller/buffer-operation-queue.ts"),S=Object(O.getMediaSource)(),I=/([ha]vc.)(?:\.[^.,]+)+/,w=function(){function A(h){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 s=o.hls,u=o.media,y=o.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),u&&(o.updateMediaElementDuration(),s.trigger(_.Events.MEDIA_ATTACHED,{media:u})),y&&y.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=h,this._initSourceBuffer(),this.registerListeners()}var C=A.prototype;return C.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},C.destroy=function(){this.unregisterListeners(),this.details=null},C.registerListeners=function(){var o=this.hls;o.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(_.Events.BUFFER_RESET,this.onBufferReset,this),o.on(_.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(_.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(_.Events.BUFFER_EOS,this.onBufferEos,this),o.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(_.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(_.Events.FRAG_PARSED,this.onFragParsed,this),o.on(_.Events.FRAG_CHANGED,this.onFragChanged,this)},C.unregisterListeners=function(){var o=this.hls;o.off(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(_.Events.BUFFER_RESET,this.onBufferReset,this),o.off(_.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(_.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(_.Events.BUFFER_EOS,this.onBufferEos,this),o.off(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(_.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(_.Events.FRAG_PARSED,this.onFragParsed,this),o.off(_.Events.FRAG_CHANGED,this.onFragChanged,this)},C._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},C.onManifestParsed=function(o,s){var u=2;(s.audio&&!s.video||!s.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},C.onMediaAttaching=function(o,s){var u=this.media=s.media;if(u&&S){var y=this.mediaSource=new S;y.addEventListener("sourceopen",this._onMediaSourceOpen),y.addEventListener("sourceended",this._onMediaSourceEnded),y.addEventListener("sourceclose",this._onMediaSourceClose),u.src=self.URL.createObjectURL(y),this._objectUrl=u.src}},C.onMediaDetaching=function(){var o=this.media,s=this.mediaSource,u=this._objectUrl;if(s){if(R.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(y){R.logger.warn("[buffer-controller]: onMediaDetaching: "+y.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(u&&self.URL.revokeObjectURL(u),o.src===u?(o.removeAttribute("src"),o.load()):R.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(_.Events.MEDIA_DETACHED,void 0)},C.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(s){var u=o.sourceBuffer[s];try{u&&(o.removeBufferListeners(s),o.mediaSource&&o.mediaSource.removeSourceBuffer(u),o.sourceBuffer[s]=void 0)}catch(y){R.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",y)}}),this._initSourceBuffer()},C.onBufferCodecs=function(o,s){var u=this,y=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(m){if(y){var p=u.tracks[m];if(p&&typeof p.buffer.changeType=="function"){var D=s[m],b=D.codec,c=D.levelCodec,d=D.container,l=(p.levelCodec||p.codec).replace(I,"$1"),a=(c||b).replace(I,"$1");if(l!==a){var v=d+";codecs="+(c||b);u.appendChangeType(m,v)}}}else u.pendingTracks[m]=s[m]}),y)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},C.appendChangeType=function(o,s){var u=this,y=this.operationQueue,m={execute:function(){var D=u.sourceBuffer[o];D&&(R.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+s),D.changeType(s)),y.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(D){R.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",D)}};y.append(m,o)},C.onBufferAppending=function(o,s){var u=this,y=this.hls,m=this.operationQueue,p=this.tracks,D=s.data,b=s.type,c=s.frag,d=s.part,l=s.chunkMeta,a=l.buffering[b],v=self.performance.now();a.start=v;var f=c.stats.buffering,E=d?d.stats.buffering:null;f.start===0&&(f.start=v),E&&E.start===0&&(E.start=v);var P=p.audio,H=b==="audio"&&l.id===1&&(P==null?void 0:P.container)==="audio/mpeg",Q={execute:function(){if(a.executeStart=self.performance.now(),H){var z=u.sourceBuffer[b];if(z){var U=c.start-z.timestampOffset;Math.abs(U)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+c.start+" (delta: "+U+") sn: "+c.sn+")"),z.timestampOffset=c.start)}}u.appendExecutor(D,b)},onStart:function(){},onComplete:function(){var z=self.performance.now();a.executeEnd=a.end=z,f.first===0&&(f.first=z),E&&E.first===0&&(E.first=z);var U=u.sourceBuffer,ae={};for(var fe in U)ae[fe]=F.BufferHelper.getBuffered(U[fe]);u.appendError=0,u.hls.trigger(_.Events.BUFFER_APPENDED,{type:b,frag:c,part:d,chunkMeta:l,parent:c.type,timeRanges:ae})},onError:function(z){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+b+" SourceBuffer",z);var U={type:W.ErrorTypes.MEDIA_ERROR,parent:c.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?U.details=W.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,U.details=W.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>y.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+y.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),U.fatal=!0)),y.trigger(_.Events.ERROR,U)}};m.append(Q,b)},C.onBufferFlushing=function(o,s){var u=this,y=this.operationQueue,m=function(D){return{execute:u.removeExecutor.bind(u,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(_.Events.BUFFER_FLUSHED,{type:D})},onError:function(c){R.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",c)}}};s.type?y.append(m(s.type),s.type):this.getSourceBufferTypes().forEach(function(p){y.append(m(p),p)})},C.onFragParsed=function(o,s){var u=this,y=s.frag,m=s.part,p=[],D=m?m.elementaryStreams:y.elementaryStreams;D[M.ElementaryStreamTypes.AUDIOVIDEO]?p.push("audiovideo"):(D[M.ElementaryStreamTypes.AUDIO]&&p.push("audio"),D[M.ElementaryStreamTypes.VIDEO]&&p.push("video"));var b=function(){var d=self.performance.now();y.stats.buffering.end=d,m&&(m.stats.buffering.end=d);var l=m?m.stats:y.stats;u.hls.trigger(_.Events.FRAG_BUFFERED,{frag:y,part:m,stats:l,id:y.type})};p.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+y.type+" level: "+y.level+" sn: "+y.sn),this.blockBuffers(b,p)},C.onFragChanged=function(o,s){this.flushBackBuffer()},C.onBufferEos=function(o,s){var u=this,y=this.getSourceBufferTypes().reduce(function(m,p){var D=u.sourceBuffer[p];return(!s.type||s.type===p)&&(D&&!D.ended&&(D.ended=!0,R.logger.log("[buffer-controller]: "+p+" sourceBuffer now EOS"))),m&&!!(!D||D.ended)},!0);y&&this.blockBuffers(function(){var m=u.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},C.onLevelUpdated=function(o,s){var u=s.details;if(!u.fragments.length)return;this.details=u,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},C.flushBackBuffer=function(){var o=this.hls,s=this.details,u=this.media,y=this.sourceBuffer;if(!u||s===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var p=s.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(V.isFiniteNumber)(p)||p<0)return;var D=u.currentTime,b=s.levelTargetDuration,c=Math.max(p,b),d=Math.floor(D/b)*b-c;m.forEach(function(l){var a=y[l];if(a){var v=F.BufferHelper.getBuffered(a);v.length>0&&d>v.start(0)&&(o.trigger(_.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),s.live&&o.trigger(_.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),o.trigger(_.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:l}))}})},C.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,s=this.hls,u=this.media,y=this.mediaSource,m=o.fragments[0].start+o.totalduration,p=u.duration,D=Object(V.isFiniteNumber)(y.duration)?y.duration:0;o.live&&s.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),y.duration=Infinity,this.updateSeekableRange(o)):(m>D&&m>p||!Object(V.isFiniteNumber)(p))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),y.duration=m)},C.updateSeekableRange=function(o){var s=this.mediaSource,u=o.fragments,y=u.length;if(y&&o.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var m=Math.max(0,u[0].start),p=Math.max(m,m+o.totalduration);s.setLiveSeekableRange(m,p)}},C.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,s=this.operationQueue,u=this.pendingTracks,y=Object.keys(u).length;if(y&&!o||y===2){this.createSourceBuffers(u),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(_.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(p){s.executeNext(p)})}},C.createSourceBuffers=function(o){var s=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var y=0;for(var m in o)if(!s[m]){var p=o[m];if(!p)throw Error("source buffer exists for track "+m+", however track does not");var D=p.levelCodec||p.codec,b=p.container+";codecs="+D;R.logger.log("[buffer-controller]: creating sourceBuffer("+b+")");try{var c=s[m]=u.addSourceBuffer(b),d=m;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[m]={buffer:c,codec:D,container:p.container,levelCodec:p.levelCodec,id:p.id},y++}catch(l){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+l.message),this.hls.trigger(_.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:b})}}y&&this.hls.trigger(_.Events.BUFFER_CREATED,{tracks:this.tracks})},C._onSBUpdateStart=function(o){var s=this.operationQueue,u=s.current(o);u.onStart()},C._onSBUpdateEnd=function(o){var s=this.operationQueue,u=s.current(o);u.onComplete(),s.shiftAndExecuteNext(o)},C._onSBUpdateError=function(o,s){R.logger.error("[buffer-controller]: "+o+" SourceBuffer error",s),this.hls.trigger(_.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(o);u&&u.onError(s)},C.removeExecutor=function(o,s,u){var y=this.media,m=this.mediaSource,p=this.operationQueue,D=this.sourceBuffer,b=D[o];if(!y||!m||!b){R.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(o);return}var c=Object(V.isFiniteNumber)(y.duration)?y.duration:Infinity,d=Object(V.isFiniteNumber)(m.duration)?m.duration:Infinity,l=Math.max(0,s),a=Math.min(u,c,d);a>l?(R.logger.log("[buffer-controller]: Removing ["+l+","+a+"] from the "+o+" SourceBuffer"),console.assert(!b.updating,o+" sourceBuffer must not be updating"),b.remove(l,a)):p.shiftAndExecuteNext(o)},C.appendExecutor=function(o,s){var u=this.operationQueue,y=this.sourceBuffer,m=y[s];if(!m){R.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(s);return}m.ended=!1,console.assert(!m.updating,s+" sourceBuffer must not be updating"),m.appendBuffer(o)},C.blockBuffers=function(o,s){var u=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var y=this.operationQueue,m=s.map(function(p){return y.appendBlocker(p)});Promise.all(m).then(function(){o(),s.forEach(function(p){var D=u.sourceBuffer[p];(!D||!D.updating)&&y.shiftAndExecuteNext(p)})})},C.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},C.addBufferListener=function(o,s,u){var y=this.sourceBuffer[o];if(!y)return;var m=u.bind(this,o);this.listeners[o].push({event:s,listener:m}),y.addEventListener(s,m)},C.removeBufferListeners=function(o){var s=this.sourceBuffer[o];if(!s)return;this.listeners[o].forEach(function(u){s.removeEventListener(u.event,u.listener)})},A}()},"./src/controller/buffer-operation-queue.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return _});var V=k("./src/utils/logger.ts"),_=function(){function R(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var W=R.prototype;return W.append=function(O,M){var g=this.queues[M];g.push(O),g.length===1&&this.buffers[M]&&this.executeNext(M)},W.insertAbort=function(O,M){var g=this.queues[M];g.unshift(O),this.executeNext(M)},W.appendBlocker=function(O){var M,g=new Promise(function(I){M=I}),S={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(S,O),g},W.executeNext=function(O){var M=this.buffers,g=this.queues,S=M[O],I=g[O];if(I.length){var w=I[0];try{w.execute()}catch(A){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),w.onError(A),(!S||!S.updating)&&(I.shift(),this.executeNext(O))}}},W.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},W.current=function(O){return this.queues[O][0]},R}()},"./src/controller/cap-level-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/events.ts");function _(F,O){for(var M=0;M<O.length;M++){var g=O[M];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(F,g.key,g)}}function R(F,O,M){return O&&_(F.prototype,O),M&&_(F,M),F}var W=function(){function F(M){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=M,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var O=F.prototype;return O.setStreamController=function(g){this.streamController=g},O.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},O.registerListeners=function(){var g=this.hls;g.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.unregisterListener=function(){var g=this.hls;g.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.onFpsDropLevelCapping=function(g,S){F.isLevelAllowed(S.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(S.droppedLevel)},O.onMediaAttaching=function(g,S){this.media=S.media instanceof HTMLVideoElement?S.media:null},O.onManifestParsed=function(g,S){var I=this.hls;this.restrictedLevels=[],this.firstLevel=S.firstLevel,I.config.capLevelToPlayerSize&&S.video&&this.startCapping()},O.onBufferCodecs=function(g,S){var I=this.hls;I.config.capLevelToPlayerSize&&S.video&&this.startCapping()},O.onMediaDetaching=function(){this.stopCapping()},O.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var S=this.hls;S.autoLevelCapping=this.getMaxLevel(g.length-1),S.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=S.autoLevelCapping}}},O.getMaxLevel=function(g){var S=this,I=this.hls.levels;if(!I.length)return-1;var w=I.filter(function(A,C){return F.isLevelAllowed(C,S.restrictedLevels)&&C<=g});return this.clientRect=null,F.getMaxLevelByMediaSize(w,this.mediaWidth,this.mediaHeight)},O.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()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,S={width:0,height:0};if(g){var I=g.getBoundingClientRect();S.width=I.width,S.height=I.height,!S.width&&!S.height&&(S.width=I.right-I.left||g.width||0,S.height=I.bottom-I.top||g.height||0)}return this.clientRect=S,S},F.isLevelAllowed=function(g,S){return S===void 0&&(S=[]),S.indexOf(g)===-1},F.getMaxLevelByMediaSize=function(g,S,I){if(!g||!g.length)return-1;for(var w=function(s,u){return u?s.width!==u.width||s.height!==u.height:!0},A=g.length-1,C=0;C<g.length;C+=1){var h=g[C];if((h.width>=S||h.height>=I)&&w(h,g[C+1])){A=C;break}}return A},R(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(S){}return g}}]),F}();Y.default=W},"./src/controller/cmcd-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return w});var V=k("./src/events.ts"),_=k("./src/types/cmcd.ts"),R=k("./src/utils/buffer-helper.ts"),W=k("./src/utils/logger.ts");function F(A,C){for(var h=0;h<C.length;h++){var o=C[h];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(A,o.key,o)}}function O(A,C,h){return C&&F(A.prototype,C),h&&F(A,h),A}function M(A,C){var h=typeof Symbol!="undefined"&&A[Symbol.iterator]||A["@@iterator"];if(h)return(h=h.call(A)).next.bind(h);if(Array.isArray(A)||(h=g(A))||C&&A&&typeof A.length=="number"){h&&(A=h);var o=0;return function(){return o>=A.length?{done:!0}:{done:!1,value:A[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(A,C){if(!A)return;if(typeof A=="string")return S(A,C);var h=Object.prototype.toString.call(A).slice(8,-1);if(h==="Object"&&A.constructor&&(h=A.constructor.name),h==="Map"||h==="Set")return Array.from(A);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return S(A,C)}function S(A,C){(C==null||C>A.length)&&(C=A.length);for(var h=0,o=new Array(C);h<C;h++)o[h]=A[h];return o}function I(){return I=Object.assign||function(A){for(var C=1;C<arguments.length;C++){var h=arguments[C];for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(A[o]=h[o])}return A},I.apply(this,arguments)}var w=function(){function A(h){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(y){try{o.apply(y,{ot:_.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(m){W.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(y){try{var m=y.frag,p=o.hls.levels[m.level],D=o.getObjectType(m),b={d:m.duration*1e3,ot:D};(D===_.CMCDObjectType.VIDEO||D===_.CMCDObjectType.AUDIO||D==_.CMCDObjectType.MUXED)&&(b.br=p.bitrate/1e3,b.tb=o.getTopBandwidth(D),b.bl=o.getBufferLength(D)),o.apply(y,b)}catch(c){W.logger.warn("Could not generate segment CMCD data.",c)}},this.hls=h;var s=this.config=h.config,u=s.cmcd;u!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=u.sessionId||A.uuid(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.registerListeners())}var C=A.prototype;return C.registerListeners=function(){var o=this.hls;o.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},C.unregisterListeners=function(){var o=this.hls;o.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(V.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},C.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},C.onMediaAttached=function(o,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},C.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},C.onBufferCreated=function(o,s){var u,y;this.audioBuffer=(u=s.tracks.audio)===null||u===void 0?void 0:u.buffer,this.videoBuffer=(y=s.tracks.video)===null||y===void 0?void 0:y.buffer},C.createData=function(){var o;return{v:_.CMCDVersion,sf:_.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}},C.apply=function(o,s){s===void 0&&(s={}),I(s,this.createData());var u=s.ot===_.CMCDObjectType.INIT||s.ot===_.CMCDObjectType.VIDEO||s.ot===_.CMCDObjectType.MUXED;if(this.starved&&u&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var y=A.toHeaders(s);if(!Object.keys(y).length)return;o.headers||(o.headers={}),I(o.headers,y)}else{var m=A.toQuery(s);if(!m)return;o.url=A.appendQueryToUri(o.url,m)}},C.getObjectType=function(o){var s=o.type;return s==="subtitle"?_.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?_.CMCDObjectType.INIT:s==="audio"?_.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?_.CMCDObjectType.VIDEO:_.CMCDObjectType.MUXED:void 0},C.getTopBandwidth=function(o){for(var s=0,u=o===_.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,y=M(u),m;!(m=y()).done;){var p=m.value;p.bitrate>s&&(s=p.bitrate)}return s>0?s:NaN},C.getBufferLength=function(o){var s=this.hls.media,u=o===_.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!s)return NaN;var y=R.BufferHelper.bufferInfo(u,s.currentTime,this.config.maxBufferHole);return y.len*1e3},C.createPlaylistLoader=function(){var o=this.config.pLoader,s=this.applyPlaylistData,u=o||this.config.loader;return function(){function y(p){this.loader=void 0,this.loader=new u(p)}var m=y.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(D,b,c){s(D),this.loader.load(D,b,c)},O(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},C.createFragmentLoader=function(){var o=this.config.fLoader,s=this.applyFragmentData,u=o||this.config.loader;return function(){function y(p){this.loader=void 0,this.loader=new u(p)}var m=y.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(D,b,c){s(D),this.loader.load(D,b,c)},O(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},A.uuid=function(){var o=URL.createObjectURL(new Blob),s=o.toString();return URL.revokeObjectURL(o),s.substr(s.lastIndexOf("/")+1)},A.serialize=function(o){for(var s=[],u=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},y=function(H){return Math.round(H)},m=function(H){return y(H/100)*100},p=function(H){return encodeURIComponent(H)},D={br:y,d:y,bl:m,dl:m,mtp:m,nor:p,rtp:m,tb:y},b=Object.keys(o||{}).sort(),c=M(b),d;!(d=c()).done;){var l=d.value,a=o[l];if(!u(a))continue;if(l==="v"&&a===1)continue;if(l=="pr"&&a===1)continue;var v=D[l];v&&(a=v(a));var f=typeof a,E=void 0;l==="ot"||l==="sf"||l==="st"?E=l+"="+a:f==="boolean"?E=l:f==="number"?E=l+"="+a:E=l+"="+JSON.stringify(a),s.push(E)}return s.join(",")},A.toHeaders=function(o){for(var s=Object.keys(o),u={},y=["Object","Request","Session","Status"],m=[{},{},{},{}],p={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},D=0,b=s;D<b.length;D++){var c=b[D],d=p[c]!=null?p[c]:1;m[d][c]=o[c]}for(var l=0;l<m.length;l++){var a=A.serialize(m[l]);a&&(u["CMCD-"+y[l]]=a)}return u},A.toQuery=function(o){return"CMCD="+encodeURIComponent(A.serialize(o))},A.appendQueryToUri=function(o,s){if(!s)return o;var u=o.includes("?")?"&":"?";return""+o+u+s},A}()},"./src/controller/eme-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/events.ts"),_=k("./src/errors.ts"),R=k("./src/utils/logger.ts"),W=k("./src/utils/mediakeys-helper.ts");function F(w,A){for(var C=0;C<A.length;C++){var h=A[C];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(w,h.key,h)}}function O(w,A,C){return A&&F(w.prototype,A),C&&F(w,C),w}var M=3,g=function(A,C,h){var o={audioCapabilities:[],videoCapabilities:[]};return A.forEach(function(s){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:h.audioRobustness||""})}),C.forEach(function(s){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:h.videoRobustness||""})}),[o]},S=function(A,C,h,o){switch(A){case W.KeySystems.WIDEVINE:return g(C,h,o);default:throw new Error("Unknown key-system: "+A)}},I=function(){function w(C){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=C,this._config=C.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 A=w.prototype;return A.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},A._registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A._unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A.getLicenseServerUrl=function(h){switch(h){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+h+'"')},A._attemptKeySystemAccess=function(h,o,s){var u=this,y=S(h,o,s,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(h,y);this.mediaKeysPromise=m.then(function(p){return u._onMediaKeySystemAccessObtained(h,p)}),m.catch(function(p){R.logger.error('Failed to obtain key-system "'+h+'" access:',p)})},A._onMediaKeySystemAccessObtained=function(h,o){var s=this;R.logger.log('Access for key-system "'+h+'" obtained');var u={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:h};this._mediaKeysList.push(u);var y=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(m){return u.mediaKeys=m,R.logger.log('Media-keys created for key-system "'+h+'"'),s._onMediaKeysCreated(),m});return y.catch(function(m){R.logger.error("Failed to create media-keys:",m)}),y},A._onMediaKeysCreated=function(){var h=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),h._onNewMediaKeySession(o.mediaKeysSession))})},A._onNewMediaKeySession=function(h){var o=this;R.logger.log("New key-system session "+h.sessionId),h.addEventListener("message",function(s){o._onKeySessionMessage(h,s.message)},!1)},A._onKeySessionMessage=function(h,o){R.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(s){R.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),h.update(s)})},A.onMediaEncrypted=function(h){var o=this;if(R.logger.log('Media is encrypted using "'+h.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(y){if(!o._media)return;o._attemptSetMediaKeys(y),o._generateRequestWithPreferredKeySession(h.initDataType,h.initData)};this.mediaKeysPromise.then(s).catch(s)},A._attemptSetMediaKeys=function(h){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},A._generateRequestWithPreferredKeySession=function(h,o){var s=this,u=this._mediaKeysList[0];if(!u){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(u.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var y=u.mediaKeysSession;if(!y){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+h+'" init data type'),u.mediaKeysSessionInitialized=!0,y.generateRequest(h,o).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(m){R.logger.error("Error generating key-session request:",m),s.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},A._createLicenseXhr=function(h,o,s){var u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,u,h,o,s);var y=this._licenseXhrSetup;if(y)try{y.call(this.hls,u,h),y=void 0}catch(m){R.logger.error(m)}try{u.readyState||u.open("POST",h,!0),y&&y.call(this.hls,u,h)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return u},A._onLicenseRequestReadyStageChange=function(h,o,s,u){switch(h.readyState){case 4:if(h.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var y=h.response,m=this._licenseResponseCallback;if(m)try{y=m.call(this.hls,h,o)}catch(D){R.logger.error(D)}u(y)}else{if(R.logger.error("License Request XHR failed ("+o+"). Status: "+h.status+" ("+h.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>M){this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var p=M-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+p+" attempts left"),this._requestLicense(s,u)}break}},A._generateLicenseRequestChallenge=function(h,o){switch(h.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+h.mediaKeySystemDomain)},A._requestLicense=function(h,o){R.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var u=this.getLicenseServerUrl(s.mediaKeySystemDomain),y=this._createLicenseXhr(u,h,o);R.logger.log("Sending license request to URL: "+u);var m=this._generateLicenseRequestChallenge(s,h);y.send(m)}catch(p){R.logger.error("Failure requesting DRM license: "+p),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},A.onMediaAttached=function(h,o){if(!this._emeEnabled)return;var s=o.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},A.onMediaDetached=function(){var h=this._media,o=this._mediaKeysList;if(!h)return;h.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return h.setMediaKeys(null)}).catch(function(){})},A.onManifestParsed=function(h,o){if(!this._emeEnabled)return;var s=o.levels.map(function(y){return y.audioCodec}).filter(function(y){return!!y}),u=o.levels.map(function(y){return y.videoCodec}).filter(function(y){return!!y});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,s,u)},O(w,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),w}();Y.default=I},"./src/controller/fps-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/events.ts"),_=k("./src/utils/logger.ts"),R=function(){function W(O){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=O,this.registerListeners()}var F=W.prototype;return F.setStreamController=function(M){this.streamController=M},F.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(M,g){var S=this.hls.config;if(S.capLevelOnFPSDrop){var I=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=I,I&&typeof I.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),S.fpsDroppedMonitoringPeriod)}},F.checkFPS=function(M,g,S){var I=performance.now();if(g){if(this.lastTime){var w=I-this.lastTime,A=S-this.lastDroppedFrames,C=g-this.lastDecodedFrames,h=1e3*A/w,o=this.hls;if(o.trigger(V.Events.FPS_DROP,{currentDropped:A,currentDecoded:C,totalDroppedFrames:S}),h>0&&A>o.config.fpsDroppedMonitoringThreshold*C){var s=o.currentLevel;_.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=s)&&(s=s-1,o.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:o.currentLevel}),o.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=I,this.lastDroppedFrames=S,this.lastDecodedFrames=g}},F.checkFPSInterval=function(){var M=this.media;if(M)if(this.isVideoPlaybackQualityAvailable){var g=M.getVideoPlaybackQuality();this.checkFPS(M,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(M,M.webkitDecodedFrameCount,M.webkitDroppedFrameCount)},W}();Y.default=R},"./src/controller/fragment-finders.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"findFragmentByPDT",function(){return R}),k.d(Y,"findFragmentByPTS",function(){return W}),k.d(Y,"fragmentWithinToleranceTest",function(){return F}),k.d(Y,"pdtWithinToleranceTest",function(){return O}),k.d(Y,"findFragWithCC",function(){return M});var V=k("./src/polyfills/number.ts"),_=k("./src/utils/binary-search.ts");function R(g,S,I){if(S===null||!Array.isArray(g)||!g.length||!Object(V.isFiniteNumber)(S))return null;var w=g[0].programDateTime;if(S<(w||0))return null;var A=g[g.length-1].endProgramDateTime;if(S>=(A||0))return null;I=I||0;for(var C=0;C<g.length;++C){var h=g[C];if(O(S,I,h))return h}return null}function W(g,S,I,w){I===void 0&&(I=0),w===void 0&&(w=0);var A=null;if(g?A=S[g.sn-S[0].sn+1]||null:I===0&&S[0].start===0&&(A=S[0]),A&&F(I,w,A)===0)return A;var C=_.default.search(S,F.bind(null,I,w));return C||A}function F(g,S,I){g===void 0&&(g=0),S===void 0&&(S=0);var w=Math.min(S,I.duration+(I.deltaPTS?I.deltaPTS:0));return I.start+I.duration-w<=g?1:I.start-w>g&&I.start?-1:0}function O(g,S,I){var w=Math.min(S,I.duration+(I.deltaPTS?I.deltaPTS:0))*1e3,A=I.endProgramDateTime||0;return A-w>g}function M(g,S){return _.default.search(g,function(I){return I.cc<S?1:I.cc>S?-1:0})}},"./src/controller/fragment-tracker.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"FragmentState",function(){return R}),k.d(Y,"FragmentTracker",function(){return W});var V=k("./src/events.ts"),_=k("./src/types/loader.ts"),R;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(R||(R={}));var W=function(){function M(S){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=S,this._registerListeners()}var g=M.prototype;return g._registerListeners=function(){var I=this.hls;I.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),I.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var I=this.hls;I.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),I.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(I,w){if(w===_.PlaylistLevelType.MAIN){var A=this.activeFragment,C=this.activeParts;if(!A)return null;if(C)for(var h=C.length;h--;){var o=C[h],s=o?o.end:A.appendedPTS;if(o.start<=I&&s!==void 0&&I<=s)return h>9&&(this.activeParts=C.slice(h-9)),o}else if(A.start<=I&&A.appendedPTS!==void 0&&I<=A.appendedPTS)return A}return this.getBufferedFrag(I,w)},g.getBufferedFrag=function(I,w){for(var A=this.fragments,C=Object.keys(A),h=C.length;h--;){var o=A[C[h]];if((o==null?void 0:o.body.type)===w&&o.buffered){var s=o.body;if(s.start<=I&&I<=s.end)return s}}return null},g.detectEvictedFragments=function(I,w,A){var C=this;Object.keys(this.fragments).forEach(function(h){var o=C.fragments[h];if(!o)return;if(!o.buffered){o.body.type===A&&C.removeFragment(o.body);return}var s=o.range[I];if(!s)return;s.time.some(function(u){var y=!C.isTimeBuffered(u.startPTS,u.endPTS,w);return y&&C.removeFragment(o.body),y})})},g.detectPartialFragments=function(I){var w=this,A=this.timeRanges,C=I.frag,h=I.part;if(!A||C.sn==="initSegment")return;var o=O(C),s=this.fragments[o];if(!s)return;Object.keys(A).forEach(function(u){var y=C.elementaryStreams[u];if(!y)return;var m=A[u],p=h!==null||y.partial===!0;s.range[u]=w.getBufferedTimes(C,h,p,m)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},g.fragBuffered=function(I){var w=O(I),A=this.fragments[w];A&&(A.backtrack=A.loaded=null,A.buffered=!0)},g.getBufferedTimes=function(I,w,A,C){for(var h={time:[],partial:A},o=w?w.start:I.start,s=w?w.end:I.end,u=I.minEndPTS||s,y=I.maxStartPTS||o,m=0;m<C.length;m++){var p=C.start(m)-this.bufferPadding,D=C.end(m)+this.bufferPadding;if(y>=p&&u<=D){h.time.push({startPTS:Math.max(o,C.start(m)),endPTS:Math.min(s,C.end(m))});break}else if(o<D&&s>p)h.partial=!0,h.time.push({startPTS:Math.max(o,C.start(m)),endPTS:Math.min(s,C.end(m))});else if(s<=p)break}return h},g.getPartialFragment=function(I){var w=null,A,C,h,o=0,s=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(y){var m=u[y];if(!m)return;F(m)&&(C=m.body.start-s,h=m.body.end+s,I>=C&&I<=h&&(A=Math.min(I-C,h-I),o<=A&&(w=m.body,o=A)))}),w},g.getState=function(I){var w=O(I),A=this.fragments[w];return A?A.buffered?F(A)?R.PARTIAL:R.OK:A.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},g.backtrack=function(I,w){var A=O(I),C=this.fragments[A];if(!C||C.backtrack)return null;var h=C.backtrack=w||C.loaded;return C.loaded=null,h},g.getBacktrackData=function(I){var w=O(I),A=this.fragments[w];if(A){var C,h=A.backtrack;if(h!=null&&(C=h.payload)!==null&&C!==void 0&&C.byteLength)return h;this.removeFragment(I)}return null},g.isTimeBuffered=function(I,w,A){for(var C,h,o=0;o<A.length;o++){if(C=A.start(o)-this.bufferPadding,h=A.end(o)+this.bufferPadding,I>=C&&w<=h)return!0;if(w<=C)return!1}return!1},g.onFragLoaded=function(I,w){var A=w.frag,C=w.part;if(A.sn==="initSegment"||A.bitrateTest||C)return;var h=O(A);this.fragments[h]={body:A,loaded:w,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(I,w){var A=this,C=w.frag,h=w.part,o=w.timeRanges;if(C.type===_.PlaylistLevelType.MAIN)if(this.activeFragment=C,h){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(h)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(u){var y=o[u];if(A.detectEvictedFragments(u,y),!h)for(var m=0;m<y.length;m++)C.appendedPTS=Math.max(y.end(m),C.appendedPTS||0)})},g.onFragBuffered=function(I,w){this.detectPartialFragments(w)},g.hasFragment=function(I){var w=O(I);return!!this.fragments[w]},g.removeFragmentsInRange=function(I,w,A){var C=this;Object.keys(this.fragments).forEach(function(h){var o=C.fragments[h];if(!o)return;if(o.buffered){var s=o.body;s.type===A&&s.start<w&&s.end>I&&C.removeFragment(s)}})},g.removeFragment=function(I){var w=O(I);I.stats.loaded=0,I.clearElementaryStreamInfo(),delete this.fragments[w]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},M}();function F(M){var g,S;return M.buffered&&(((g=M.range.video)===null||g===void 0?void 0:g.partial)||((S=M.range.audio)===null||S===void 0?void 0:S.partial))}function O(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return F}),k.d(Y,"MAX_START_GAP_JUMP",function(){return O}),k.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),k.d(Y,"SKIP_BUFFER_RANGE_START",function(){return g}),k.d(Y,"default",function(){return S});var V=k("./src/utils/buffer-helper.ts"),_=k("./src/errors.ts"),R=k("./src/events.ts"),W=k("./src/utils/logger.ts"),F=250,O=2,M=.1,g=.05,S=function(){function I(A,C,h,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=A,this.media=C,this.fragmentTracker=h,this.hls=o}var w=I.prototype;return w.destroy=function(){this.hls=this.fragmentTracker=this.media=null},w.poll=function(C){var h=this.config,o=this.media,s=this.stalled,u=o.currentTime,y=o.seeking,m=this.seeking&&!y,p=!this.seeking&&y;if(this.seeking=y,u!==C){if(this.moved=!0,s!==null){if(this.stallReported){var D=self.performance.now()-s;W.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((p||m)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!V.BufferHelper.getBuffered(o).length)return;var b=V.BufferHelper.bufferInfo(o,u,0),c=b.len>0,d=b.nextStart||0;if(!c&&!d)return;if(y){var l=b.len>O,a=!d||d-u>O&&!this.fragmentTracker.getPartialFragment(u);if(l||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,f=Math.max(d,b.start||0)-u,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=E==null||((v=E.details)===null||v===void 0)?void 0:v.live,H=P?E.details.targetduration*2:O;if(f>0&&f<=H){this._trySkipBufferHole(null);return}}var Q=self.performance.now();if(s===null){this.stalled=Q;return}var re=Q-s;!y&&re>=F&&this._reportStall(b.len);var z=V.BufferHelper.bufferInfo(o,u,h.maxBufferHole);this._tryFixBufferStall(z,re)},w._tryFixBufferStall=function(C,h){var o=this.config,s=this.fragmentTracker,u=this.media,y=u.currentTime,m=s.getPartialFragment(y);if(m){var p=this._trySkipBufferHole(m);if(p)return}C.len>o.maxBufferHole&&h>o.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},w._reportStall=function(C){var h=this.hls,o=this.media,s=this.stallReported;s||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+C+")"),h.trigger(R.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:C}))},w._trySkipBufferHole=function(C){for(var h=this.config,o=this.hls,s=this.media,u=s.currentTime,y=0,m=V.BufferHelper.getBuffered(s),p=0;p<m.length;p++){var D=m.start(p);if(u+h.maxBufferHole>=y&&u<D){var b=Math.max(D+g,s.currentTime+M);return W.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+b),this.moved=!0,this.stalled=null,s.currentTime=b,C&&o.trigger(R.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+u+" to "+b,frag:C}),b}y=m.end(p)}return 0},w._tryNudgeBuffer=function(){var C=this.config,h=this.hls,o=this.media,s=o.currentTime,u=(this.nudgeRetry||0)+1;if(this.nudgeRetry=u,u<C.nudgeMaxRetry){var y=s+u*C.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+s+" to "+y),o.currentTime=y,h.trigger(R.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+C.nudgeMaxRetry+" nudges"),h.trigger(R.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},I}()},"./src/controller/id3-track-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/events.ts"),_=k("./src/utils/texttrack-utils.ts"),R=k("./src/demux/id3.ts"),W=.25,F=function(){function O(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var M=O.prototype;return M.destroy=function(){this._unregisterListeners()},M._registerListeners=function(){var S=this.hls;S.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),S.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M._unregisterListeners=function(){var S=this.hls;S.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),S.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M.onMediaAttached=function(S,I){this.media=I.media},M.onMediaDetaching=function(){if(!this.id3Track)return;Object(_.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},M.getID3Track=function(S){if(!this.media)return;for(var I=0;I<S.length;I++){var w=S[I];if(w.kind==="metadata"&&w.label==="id3")return Object(_.sendAddTrackEvent)(w,this.media),w}return this.media.addTextTrack("metadata","id3")},M.onFragParsingMetadata=function(S,I){if(!this.media)return;var w=I.frag,A=I.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var C=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,h=0;h<A.length;h++){var o=R.getID3Frames(A[h].data);if(o){var s=A[h].pts,u=h<A.length-1?A[h+1].pts:w.end,y=u-s;y<=0&&(u=s+W);for(var m=0;m<o.length;m++){var p=o[m];if(!R.isTimeStampFrame(p)){var D=new C(s,u,"");D.value=p,this.id3Track.addCue(D)}}}}},M.onBufferFlushing=function(S,I){var w=I.startOffset,A=I.endOffset,C=I.type;if(!C||C==="audio"){var h=this.id3Track;h&&Object(_.removeCuesInRange)(h,w,A)}},O}();Y.default=F},"./src/controller/latency-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return O});var V=k("./src/errors.ts"),_=k("./src/events.ts"),R=k("./src/utils/logger.ts");function W(M,g){for(var S=0;S<g.length;S++){var I=g[S];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(M,I.key,I)}}function F(M,g,S){return g&&W(M.prototype,g),S&&W(M,S),M}var O=function(){function M(S){var I=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 I.timeupdate()},this.hls=S,this.config=S.config,this.registerListeners()}var g=M.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(_.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(_.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(_.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(_.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(_.Events.ERROR,this.onError)},g.onMediaAttached=function(I,w){this.media=w.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(I,w){var A=w.details;this.levelDetails=A,A.advanced&&this.timeupdate(),!A.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(I,w){if(w.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var I=this.media,w=this.levelDetails;if(!I||!w)return;this.currentTime=I.currentTime;var A=this.computeLatency();if(A===null)return;this._latency=A;var C=this.config,h=C.lowLatencyMode,o=C.maxLiveSyncPlaybackRate;if(!h||o===1)return;var s=this.targetLatency;if(s===null)return;var u=A-s,y=Math.min(this.maxLatency,s+w.targetduration),m=u<y;if(w.live&&m&&u>.05&&this.forwardBufferLength>1){var p=Math.min(2,Math.max(1,o)),D=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;I.playbackRate=Math.min(p,Math.max(1,D))}else I.playbackRate!==1&&I.playbackRate!==0&&(I.playbackRate=1)},g.estimateLiveEdge=function(){var I=this.levelDetails;return I===null?null:I.edge+I.age},g.computeLatency=function(){var I=this.estimateLiveEdge();return I===null?null:I-this.currentTime},F(M,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var I=this.config,w=this.levelDetails;return I.liveMaxLatencyDuration!==void 0?I.liveMaxLatencyDuration:w?I.liveMaxLatencyDurationCount*w.targetduration:0}},{key:"targetLatency",get:function(){var I=this.levelDetails;if(I===null)return null;var w=I.holdBack,A=I.partHoldBack,C=I.targetduration,h=this.config,o=h.liveSyncDuration,s=h.liveSyncDurationCount,u=h.lowLatencyMode,y=this.hls.userConfig,m=u&&A||w;(y.liveSyncDuration||y.liveSyncDurationCount||m===0)&&(m=o!==void 0?o:s*C);var p=C,D=1;return m+Math.min(this.stallCount*D,p)}},{key:"liveSyncPosition",get:function(){var I=this.estimateLiveEdge(),w=this.targetLatency,A=this.levelDetails;if(I===null||w===null||A===null)return null;var C=A.edge,h=I-w-this.edgeStalled,o=C-A.totalduration,s=C-(this.config.lowLatencyMode&&A.partTarget||A.targetduration);return Math.min(Math.max(o,h),s)}},{key:"drift",get:function(){var I=this.levelDetails;return I===null?1:I.drift}},{key:"edgeStalled",get:function(){var I=this.levelDetails;if(I===null)return 0;var w=(this.config.lowLatencyMode&&I.partTarget||I.targetduration)*3;return Math.max(I.age-w,0)}},{key:"forwardBufferLength",get:function(){var I=this.media,w=this.levelDetails;if(!I||!w)return 0;var A=I.buffered.length;return A?I.buffered.end(A-1):w.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return h});var V=k("./src/types/level.ts"),_=k("./src/events.ts"),R=k("./src/errors.ts"),W=k("./src/utils/codecs.ts"),F=k("./src/controller/level-helper.ts"),O=k("./src/controller/base-playlist-controller.ts"),M=k("./src/types/loader.ts");function g(){return g=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var u=arguments[s];for(var y in u)Object.prototype.hasOwnProperty.call(u,y)&&(o[y]=u[y])}return o},g.apply(this,arguments)}function S(o,s){for(var u=0;u<s.length;u++){var y=s[u];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(o,y.key,y)}}function I(o,s,u){return s&&S(o.prototype,s),u&&S(o,u),o}function w(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,A(o,s)}function A(o,s){return A=Object.setPrototypeOf||function(y,m){return y.__proto__=m,y},A(o,s)}var C=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),h=function(o){w(s,o);function s(y){var m;return m=o.call(this,y,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var u=s.prototype;return u._registerListeners=function(){var m=this.hls;m.on(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(_.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(_.Events.ERROR,this.onError,this)},u._unregisterListeners=function(){var m=this.hls;m.off(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(_.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(_.Events.ERROR,this.onError,this)},u.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,o.prototype.destroy.call(this)},u.startLoad=function(){var m=this._levels;m.forEach(function(p){p.loadError=0}),o.prototype.startLoad.call(this)},u.onManifestLoaded=function(m,p){var D=[],b=[],c=[],d,l={},a,v=!1,f=!1,E=!1;if(p.levels.forEach(function(re){var z=re.attrs;v=v||!!(re.width&&re.height),f=f||!!re.videoCodec,E=E||!!re.audioCodec,C&&re.audioCodec&&re.audioCodec.indexOf("mp4a.40.34")!==-1&&(re.audioCodec=void 0);var U=re.bitrate+"-"+re.attrs.RESOLUTION+"-"+re.attrs.CODECS;a=l[U],a?a.url.push(re.url):(a=new V.Level(re),l[U]=a,D.push(a)),z&&(z.AUDIO&&Object(F.addGroupId)(a,"audio",z.AUDIO),z.SUBTITLES&&Object(F.addGroupId)(a,"text",z.SUBTITLES))}),(v||f)&&E&&(D=D.filter(function(re){var z=re.videoCodec,U=re.width,ae=re.height;return!!z||!!(U&&ae)})),D=D.filter(function(re){var z=re.audioCodec,U=re.videoCodec;return(!z||Object(W.isCodecSupportedInMp4)(z,"audio"))&&(!U||Object(W.isCodecSupportedInMp4)(U,"video"))}),p.audioTracks&&(b=p.audioTracks.filter(function(re){return!re.audioCodec||Object(W.isCodecSupportedInMp4)(re.audioCodec,"audio")}),Object(F.assignTrackIdsByGroup)(b)),p.subtitles&&(c=p.subtitles,Object(F.assignTrackIdsByGroup)(c)),D.length>0){d=D[0].bitrate,D.sort(function(re,z){return re.bitrate-z.bitrate}),this._levels=D;for(var P=0;P<D.length;P++)if(D[P].bitrate===d){this._firstLevel=P,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+d);break}var H=E&&!f,Q={levels:D,audioTracks:b,subtitleTracks:c,firstLevel:this._firstLevel,stats:p.stats,audio:E,video:f,altAudio:!H&&b.some(function(re){return!!re.url})};this.hls.trigger(_.Events.MANIFEST_PARSED,Q),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(_.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:p.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(m,p){if(o.prototype.onError.call(this,m,p),p.fatal)return;var D=p.context,b=this._levels[this.currentLevelIndex];if(D&&(D.type===M.PlaylistContextType.AUDIO_TRACK&&b.audioGroupIds&&D.groupId===b.audioGroupIds[b.urlId]||D.type===M.PlaylistContextType.SUBTITLE_TRACK&&b.textGroupIds&&D.groupId===b.textGroupIds[b.urlId])){this.redundantFailover(this.currentLevelIndex);return}var c=!1,d=!0,l;switch(p.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(p.frag){var a=this._levels[p.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(l=p.frag.level)):l=p.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(d=!1),l=D.level),c=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:l=p.level,c=!0;break}l!==void 0&&this.recoverLevel(p,l,c,d)},u.recoverLevel=function(m,p,D,b){var c=m.details,d=this._levels[p];if(d.loadError++,D){var l=this.retryLoadingOrFail(m);if(l)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(b){var a=d.url.length;if(a>1&&d.loadError<a)m.levelRetry=!0,this.redundantFailover(p);else if(this.manualLevelIndex===-1){var v=p===0?this._levels.length-1:p-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(c+": switch to "+v),m.levelRetry=!0,this.hls.nextAutoLevel=v)}}},u.redundantFailover=function(m){var p=this._levels[m],D=p.url.length;if(D>1){var b=(p.urlId+1)%D;this.warn("Switching to redundant URL-id "+b),this._levels.forEach(function(c){c.urlId=b}),this.level=m}},u.onFragLoaded=function(m,p){var D=p.frag;if(D!==void 0&&D.type===M.PlaylistLevelType.MAIN){var b=this._levels[D.level];b!==void 0&&(b.fragmentError=0,b.loadError=0)}},u.onLevelLoaded=function(m,p){var D,b=p.level,c=p.details,d=this._levels[b];if(!d){var l;this.warn("Invalid level index "+b),(l=p.deliveryDirectives)!==null&&l!==void 0&&l.skip&&(c.deltaUpdateFailed=!0);return}b===this.currentLevelIndex?(d.fragmentError===0&&(d.loadError=0,this.retryCount=0),this.playlistLoaded(b,p,d.details)):(D=p.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(c.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(m,p){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var b=-1,c=this.hls.audioTracks[p.id].groupId,d=0;d<D.audioGroupIds.length;d++)if(D.audioGroupIds[d]===c){b=d;break}b!==D.urlId&&(D.urlId=b,this.startLoad())}},u.loadPlaylist=function(m){var p=this.currentLevelIndex,D=this._levels[p];if(this.canLoad&&D&&D.url.length>0){var b=D.urlId,c=D.url[b];if(m)try{c=m.addDirectives(c)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("Attempt loading level index "+p+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+b+" "+c),this.clearTimer(),this.hls.trigger(_.Events.LEVEL_LOADING,{url:c,level:p,id:b,deliveryDirectives:m||null})}},u.removeLevel=function(m,p){var D=function(d,l){return l!==p},b=this._levels.filter(function(c,d){return d!==m?!0:c.url.length>1&&p!==void 0?(c.url=c.url.filter(D),c.audioGroupIds&&(c.audioGroupIds=c.audioGroupIds.filter(D)),c.textGroupIds&&(c.textGroupIds=c.textGroupIds.filter(D)),c.urlId=0,!0):!1}).map(function(c,d){var l=c.details;return l!=null&&l.fragments&&l.fragments.forEach(function(a){a.level=d}),c});this._levels=b,this.hls.trigger(_.Events.LEVELS_UPDATED,{levels:b})},I(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var p,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===m&&(p=D[m])!==null&&p!==void 0&&p.details)return;if(m<0||m>=D.length){var b=m<0;if(this.hls.trigger(_.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:b,reason:"invalid level idx"}),b)return;m=Math.min(m,D.length-1)}this.clearTimer();var c=this.currentLevelIndex,d=D[c],l=D[m];this.log("switching to level "+m+" from "+c),this.currentLevelIndex=m;var a=g({},l,{level:m,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete a._urlId,this.hls.trigger(_.Events.LEVEL_SWITCHING,a);var v=l.details;if(!v||v.live){var f=this.switchParams(l.uri,d==null?void 0:d.details);this.loadPlaylist(f)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),s}(O.default)},"./src/controller/level-helper.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"addGroupId",function(){return R}),k.d(Y,"assignTrackIdsByGroup",function(){return W}),k.d(Y,"updatePTS",function(){return F}),k.d(Y,"updateFragPTSDTS",function(){return M}),k.d(Y,"mergeDetails",function(){return g}),k.d(Y,"mapPartIntersection",function(){return S}),k.d(Y,"mapFragmentIntersection",function(){return I}),k.d(Y,"adjustSliding",function(){return w}),k.d(Y,"addSliding",function(){return A}),k.d(Y,"computeReloadInterval",function(){return C}),k.d(Y,"getFragmentWithSN",function(){return h}),k.d(Y,"getPartWith",function(){return o});var V=k("./src/polyfills/number.ts"),_=k("./src/utils/logger.ts");function R(s,u,y){switch(u){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(y);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(y);break}}function W(s){var u={};s.forEach(function(y){var m=y.groupId||"";y.id=u[m]=u[m]||0,u[m]++})}function F(s,u,y){var m=s[u],p=s[y];O(m,p)}function O(s,u){var y=u.startPTS;if(Object(V.isFiniteNumber)(y)){var m=0,p;u.sn>s.sn?(m=y-s.start,p=s):(m=s.start-y,p=u),p.duration!==m&&(p.duration=m)}else if(u.sn>s.sn){var D=s.cc===u.cc;D&&s.minEndPTS?u.start=s.start+(s.minEndPTS-s.start):u.start=s.start+s.duration}else u.start=Math.max(s.start-u.duration,0)}function M(s,u,y,m,p,D){var b=m-y;b<=0&&(_.logger.warn("Fragment should have a positive duration",u),m=y+u.duration,D=p+u.duration);var c=y,d=m,l=u.startPTS,a=u.endPTS;if(Object(V.isFiniteNumber)(l)){var v=Math.abs(l-y);Object(V.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(v,u.deltaPTS):u.deltaPTS=v,c=Math.max(y,l),y=Math.min(y,l),p=Math.min(p,u.startDTS),d=Math.min(m,a),m=Math.max(m,a),D=Math.max(D,u.endDTS)}u.duration=m-y;var f=y-u.start;u.appendedPTS=m,u.start=u.startPTS=y,u.maxStartPTS=c,u.startDTS=p,u.endPTS=m,u.minEndPTS=d,u.endDTS=D;var E=u.sn;if(!s||E<s.startSN||E>s.endSN)return 0;var P,H=E-s.startSN,Q=s.fragments;for(Q[H]=u,P=H;P>0;P--)O(Q[P],Q[P-1]);for(P=H;P<Q.length-1;P++)O(Q[P],Q[P+1]);return s.fragmentHint&&O(Q[Q.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,f}function g(s,u){for(var y=null,m=s.fragments,p=m.length-1;p>=0;p--){var D=m[p].initSegment;if(D){y=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var b=0,c;if(I(s,u,function(P,H){P.relurl&&(b=P.cc-H.cc),Object(V.isFiniteNumber)(P.startPTS)&&Object(V.isFiniteNumber)(P.endPTS)&&(H.start=H.startPTS=P.startPTS,H.startDTS=P.startDTS,H.appendedPTS=P.appendedPTS,H.maxStartPTS=P.maxStartPTS,H.endPTS=P.endPTS,H.endDTS=P.endDTS,H.minEndPTS=P.minEndPTS,H.duration=P.endPTS-P.startPTS,H.duration&&(c=H),u.PTSKnown=u.alignedSliding=!0),H.elementaryStreams=P.elementaryStreams,H.loader=P.loader,H.stats=P.stats,H.urlId=P.urlId,P.initSegment&&(H.initSegment=P.initSegment,y=P.initSegment)}),y){var d=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;d.forEach(function(P){var H;(!P.initSegment||P.initSegment.relurl===((H=y)===null||H===void 0?void 0:H.relurl))&&(P.initSegment=y)})}if(u.skippedSegments&&(u.deltaUpdateFailed=u.fragments.some(function(P){return!P}),u.deltaUpdateFailed)){_.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var l=u.skippedSegments;l--;)u.fragments.shift();u.startSN=u.fragments[0].sn,u.startCC=u.fragments[0].cc}var a=u.fragments;if(b){_.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<a.length;v++)a[v].cc+=b}u.skippedSegments&&(u.startCC=u.fragments[0].cc),S(s.partList,u.partList,function(P,H){H.elementaryStreams=P.elementaryStreams,H.stats=P.stats}),c?M(u,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS):w(s,u),a.length&&(u.totalduration=u.edge-a[0].start),u.driftStartTime=s.driftStartTime,u.driftStart=s.driftStart;var f=u.advancedDateTime;if(u.advanced&&f){var E=u.edge;u.driftStart||(u.driftStartTime=f,u.driftStart=E),u.driftEndTime=f,u.driftEnd=E}else u.driftEndTime=s.driftEndTime,u.driftEnd=s.driftEnd,u.advancedDateTime=s.advancedDateTime}function S(s,u,y){if(s&&u)for(var m=0,p=0,D=s.length;p<=D;p++){var b=s[p],c=u[p+m];b&&c&&b.index===c.index&&b.fragment.sn===c.fragment.sn?y(b,c):m--}}function I(s,u,y){for(var m=u.skippedSegments,p=Math.max(s.startSN,u.startSN)-u.startSN,D=(s.fragmentHint?1:0)+(m?u.endSN:Math.min(s.endSN,u.endSN))-u.startSN,b=u.startSN-s.startSN,c=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,d=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,l=p;l<=D;l++){var a=d[b+l],v=c[l];m&&!v&&l<m&&(v=u.fragments[l]=a),a&&v&&y(a,v)}}function w(s,u){var y=u.startSN+u.skippedSegments-s.startSN,m=s.fragments;if(y<0||y>=m.length)return;A(u,m[y].start)}function A(s,u){if(u){for(var y=s.fragments,m=s.skippedSegments;m<y.length;m++)y[m].start+=u;s.fragmentHint&&(s.fragmentHint.start+=u)}}function C(s,u){var y=1e3*s.levelTargetDuration,m=y/2,p=s.age,D=p>0&&p<y*3,b=u.loading.end-u.loading.start,c,d=s.availabilityDelay;if(s.updated===!1)if(D){var l=333*s.misses;c=Math.max(Math.min(m,b*2),l),s.availabilityDelay=(s.availabilityDelay||0)+c}else c=m;else D?(d=Math.min(d||y/2,p),s.availabilityDelay=d,c=d+y-p):c=y-b;return Math.round(c)}function h(s,u,y){if(!s||!s.details)return null;var m=s.details,p=m.fragments[u-m.startSN];return p||(p=m.fragmentHint,p&&p.sn===u?p:u<m.startSN&&y&&y.sn===u?y:null)}function o(s,u,y){if(!s||!s.details)return null;var m=s.details.partList;if(m)for(var p=m.length;p--;){var D=m[p];if(D.index===y&&D.fragment.sn===u)return D}return null}},"./src/controller/stream-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return m});var V=k("./src/polyfills/number.ts"),_=k("./src/controller/base-stream-controller.ts"),R=k("./src/is-supported.ts"),W=k("./src/events.ts"),F=k("./src/utils/buffer-helper.ts"),O=k("./src/controller/fragment-tracker.ts"),M=k("./src/types/loader.ts"),g=k("./src/loader/fragment.ts"),S=k("./src/demux/transmuxer-interface.ts"),I=k("./src/types/transmuxer.ts"),w=k("./src/controller/gap-controller.ts"),A=k("./src/errors.ts"),C=k("./src/utils/logger.ts");function h(p,D){for(var b=0;b<D.length;b++){var c=D[b];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(p,c.key,c)}}function o(p,D,b){return D&&h(p.prototype,D),b&&h(p,b),p}function s(p,D){p.prototype=Object.create(D.prototype),p.prototype.constructor=p,u(p,D)}function u(p,D){return u=Object.setPrototypeOf||function(c,d){return c.__proto__=d,c},u(p,D)}var y=100,m=function(p){s(D,p);function D(c,d){var l;return l=p.call(this,c,d,"[stream-controller]")||this,l.audioCodecSwap=!1,l.gapController=null,l.level=-1,l._forceStartLoad=!1,l.altAudio=!1,l.audioOnly=!1,l.fragPlaying=null,l.onvplaying=null,l.onvseeked=null,l.fragLastKbps=0,l.stalled=!1,l.couldBacktrack=!1,l.audioCodecSwitch=!1,l.videoBuffer=null,l._registerListeners(),l}var b=D.prototype;return b._registerListeners=function(){var d=this.hls;d.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.on(W.Events.ERROR,this.onError,this),d.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var d=this.hls;d.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),d.off(W.Events.ERROR,this.onError,this),d.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),d.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},b.startLoad=function(d){if(this.levels){var l=this.lastCurrentTime,a=this.hls;if(this.stopLoad(),this.setInterval(y),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=a.startLevel;v===-1&&(a.config.testBandwidth?(v=0,this.bitrateTest=!0):v=a.nextAutoLevel),this.level=a.nextLoadLevel=v,this.loadedmetadata=!1}l>0&&d===-1&&(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),d=l),this.state=_.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()}else this._forceStartLoad=!0,this.state=_.State.STOPPED},b.stopLoad=function(){this._forceStartLoad=!1,p.prototype.stopLoad.call(this)},b.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_LEVEL:{var d,l=this.levels,a=this.level,v=l==null||((d=l[a])===null||d===void 0)?void 0:d.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=_.State.IDLE;break}break}case _.State.FRAG_LOADING_WAITING_RETRY:{var f,E=self.performance.now(),P=this.retryDate;(!P||E>=P||(f=this.media)!==null&&f!==void 0&&f.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=_.State.IDLE)}break;default:break}this.onTickEnd()},b.onTickEnd=function(){p.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},b.doTickIdle=function(){var d,l,a=this.hls,v=this.levelLastLoaded,f=this.levels,E=this.media,P=a.config,H=a.nextLoadLevel;if(v===null||!E&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!f||!f[H])return;var Q=f[H];this.level=a.nextLoadLevel=H;var re=Q.details;if(!re||this.state===_.State.WAITING_LEVEL||re.live&&this.levelLastLoaded!==H){this.state=_.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,M.PlaylistLevelType.MAIN);if(z===null)return;var U=z.len,ae=this.getMaxBufferLength(Q.maxBitrate);if(U>=ae)return;if(this._streamEnded(z,re)){var fe={};this.altAudio&&(fe.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,fe),this.state=_.State.ENDED;return}var ge=z.end,Ee=this.getNextFragment(ge,re);if(this.couldBacktrack&&!this.fragPrevious&&Ee&&Ee.sn!=="initSegment"){var Ne=Ee.sn-re.startSN;Ne>1&&(Ee=re.fragments[Ne-1],this.fragmentTracker.removeFragment(Ee))}if(Ee&&this.fragmentTracker.getState(Ee)===O.FragmentState.OK&&this.nextLoadPosition>ge){var Se=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,Se,M.PlaylistLevelType.MAIN),Ee=this.getNextFragment(this.nextLoadPosition,re)}if(!Ee)return;Ee.initSegment&&!Ee.initSegment.data&&!this.bitrateTest&&(Ee=Ee.initSegment),((d=Ee.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((l=Ee.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(Ee,re):this.loadFragment(Ee,re,ge)},b.loadFragment=function(d,l,a){var v,f=this.fragmentTracker.getState(d);if(this.fragCurrent=d,f===O.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(d);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else f=O.FragmentState.NOT_LOADED}f===O.FragmentState.NOT_LOADED||f===O.FragmentState.PARTIAL?d.sn==="initSegment"?this._loadInitSegment(d):this.bitrateTest?(d.bitrateTest=!0,this.log("Fragment "+d.sn+" of level "+d.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(d)):(this.startFragRequested=!0,p.prototype.loadFragment.call(this,d,l,a)):f===O.FragmentState.APPENDING?this.reduceMaxBufferLength(d.duration)&&this.fragmentTracker.removeFragment(d):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},b.getAppendedFrag=function(d){var l=this.fragmentTracker.getAppendedFrag(d,M.PlaylistLevelType.MAIN);return l&&"fragment"in l?l.fragment:l},b.getBufferedFrag=function(d){return this.fragmentTracker.getBufferedFrag(d,M.PlaylistLevelType.MAIN)},b.followingBufferedFrag=function(d){return d?this.getBufferedFrag(d.end+.5):null},b.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},b.nextLevelSwitch=function(){var d=this.levels,l=this.media;if(l!=null&&l.readyState){var a,v=this.getAppendedFrag(l.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!l.paused&&d){var f=this.hls.nextLoadLevel,E=d[f],P=this.fragLastKbps;P&&this.fragCurrent?a=this.fragCurrent.duration*E.maxBitrate/(1e3*P)+1:a=0}else a=0;var H=this.getBufferedFrag(l.currentTime+a);if(H){var Q=this.followingBufferedFrag(H);if(Q){this.abortCurrentFrag();var re=Q.maxStartPTS?Q.maxStartPTS:Q.start,z=Q.duration,U=Math.max(H.end,re+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(U,Number.POSITIVE_INFINITY)}}}},b.abortCurrentFrag=function(){var d=this.fragCurrent;this.fragCurrent=null,d!=null&&d.loader&&d.loader.abort(),this.state===_.State.KEY_LOADING&&(this.state=_.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},b.flushMainBuffer=function(d,l){p.prototype.flushMainBuffer.call(this,d,l,this.altAudio?"video":null)},b.onMediaAttached=function(d,l){p.prototype.onMediaAttached.call(this,d,l);var a=l.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 w.default(this.config,a,this.fragmentTracker,this.hls)},b.onMediaDetaching=function(){var d=this.media;d&&(d.removeEventListener("playing",this.onvplaying),d.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),p.prototype.onMediaDetaching.call(this)},b.onMediaPlaying=function(){this.tick()},b.onMediaSeeked=function(){var d=this.media,l=d?d.currentTime:null;Object(V.isFiniteNumber)(l)&&this.log("Media seeked to "+l.toFixed(3)),this.tick()},b.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},b.onManifestParsed=function(d,l){var a=!1,v=!1,f;l.levels.forEach(function(E){f=E.audioCodec,f&&(f.indexOf("mp4a.40.2")!==-1&&(a=!0),f.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=a&&v&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=l.levels,this.startFragRequested=!1},b.onLevelLoading=function(d,l){var a=this.levels;if(!a||this.state!==_.State.IDLE)return;var v=a[l.level];(!v.details||v.details.live&&this.levelLastLoaded!==l.level||this.waitForCdnTuneIn(v.details))&&(this.state=_.State.WAITING_LEVEL)},b.onLevelLoaded=function(d,l){var a,v=this.levels,f=l.level,E=l.details,P=E.totalduration;if(!v){this.warn("Levels were reset while loading level "+f);return}this.log("Level "+f+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+P);var H=this.fragCurrent;H&&(this.state===_.State.FRAG_LOADING||this.state===_.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==l.level&&H.loader&&(this.state=_.State.IDLE,H.loader.abort()));var Q=v[f],re=0;if(E.live||(a=Q.details)!==null&&a!==void 0&&a.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;re=this.alignPlaylists(E,Q.details)}if(Q.details=E,this.levelLastLoaded=f,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:E,level:f}),this.state===_.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=_.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,re),this.tick()},b._handleFragmentLoadProgress=function(d){var l,a=d.frag,v=d.part,f=d.payload,E=this.levels;if(!E){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var P=E[a.level],H=P.details;if(!H){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var Q=P.videoCodec,re=H.PTSKnown||!H.live,z=(l=a.initSegment)===null||l===void 0?void 0:l.data,U=this._getAudioCodec(P),ae=this.transmuxer=this.transmuxer||new S.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),fe=v?v.index:-1,ge=fe!==-1,Ee=new I.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,f.byteLength,fe,ge),Ne=this.initPTS[a.cc];ae.push(f,z,U,Q,a,v,H.totalduration,re,Ee,Ne)},b.onAudioTrackSwitching=function(d,l){var a=this.altAudio,v=!!l.url,f=l.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var E=this.fragCurrent;E!=null&&E.loader&&(this.log("Switching to main audio track, cancel main fragment load"),E.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;a&&P.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:f})}},b.onAudioTrackSwitched=function(d,l){var a=l.id,v=!!this.hls.audioTracks[a].url;if(v){var f=this.videoBuffer;f&&this.mediaBuffer!==f&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=f)}this.altAudio=v,this.tick()},b.onBufferCreated=function(d,l){var a=l.tracks,v,f,E=!1;for(var P in a){var H=a[P];if(H.id==="main"){if(f=P,v=H,P==="video"){var Q=a[P];Q&&(this.videoBuffer=Q.buffer)}}else E=!0}E&&v?(this.log("Alternate track found, use "+f+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},b.onFragBuffered=function(d,l){var a=l.frag,v=l.part;if(a&&a.type!==M.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(v?" p: "+v.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===_.State.PARSED&&(this.state=_.State.IDLE);return}var f=v?v.stats:a.stats;this.fragLastKbps=Math.round(8*f.total/(f.buffering.end-f.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,v)},b.onError=function(d,l){switch(l.details){case A.ErrorDetails.FRAG_LOAD_ERROR:case A.ErrorDetails.FRAG_LOAD_TIMEOUT:case A.ErrorDetails.KEY_LOAD_ERROR:case A.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,l);break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==_.State.ERROR&&(l.fatal?(this.warn(""+l.details),this.state=_.State.ERROR):!l.levelRetry&&this.state===_.State.WAITING_LEVEL&&(this.state=_.State.IDLE));break;case A.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="main"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var a=!0,v=this.getFwdBufferInfo(this.media,M.PlaylistLevelType.MAIN);v&&v.len>.5&&(a=!this.reduceMaxBufferLength(v.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},b.checkBuffer=function(){var d=this.media,l=this.gapController;if(!d||!l||!d.readyState)return;var a=F.BufferHelper.getBuffered(d);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):l.poll(this.lastCurrentTime),this.lastCurrentTime=d.currentTime},b.onFragLoadEmergencyAborted=function(){this.state=_.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},b.onBufferFlushed=function(d,l){var a=l.type;if(a!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(a===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,a,M.PlaylistLevelType.MAIN)}},b.onLevelsUpdated=function(d,l){this.levels=l.levels},b.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},b.seekToStartPos=function(){var d=this.media,l=d.currentTime,a=this.startPosition;if(a>=0&&l<a){if(d.seeking){C.logger.log("could not seek to "+a+", already seeking at "+l);return}var v=F.BufferHelper.getBuffered(d),f=v.length?v.start(0):0,E=f-a;E>0&&(E<this.config.maxBufferHole||E<this.config.maxFragLookUpTolerance)&&(C.logger.log("adjusting start position by "+E+" to match buffer start"),a+=E,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+l),d.currentTime=a}},b._getAudioCodec=function(d){var l=this.config.defaultAudioCodec||d.audioCodec;return this.audioCodecSwap&&l&&(this.log("Swapping audio codec"),l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5"),l},b._loadBitrateTestFrag=function(d){var l=this;this._doFragLoad(d).then(function(a){var v=l.hls;if(!a||v.nextLoadLevel||l.fragContextChanged(d))return;l.fragLoadError=0,l.state=_.State.IDLE,l.startFragRequested=!1,l.bitrateTest=!1;var f=d.stats;f.parsing.start=f.parsing.end=f.buffering.start=f.buffering.end=self.performance.now(),v.trigger(W.Events.FRAG_LOADED,a)})},b._handleTransmuxComplete=function(d){var l,a="main",v=this.hls,f=d.remuxResult,E=d.chunkMeta,P=this.getCurrentContext(E);if(!P){this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(E.level);return}var H=P.frag,Q=P.part,re=P.level,z=f.video,U=f.text,ae=f.id3,fe=f.initSegment,ge=this.altAudio?void 0:f.audio;if(this.fragContextChanged(H))return;if(this.state=_.State.PARSING,fe){fe.tracks&&(this._bufferInitSegment(re,fe.tracks,H,E),v.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:a,tracks:fe.tracks}));var Ee=fe.initPTS,Ne=fe.timescale;Object(V.isFiniteNumber)(Ee)&&(this.initPTS[H.cc]=Ee,v.trigger(W.Events.INIT_PTS_FOUND,{frag:H,id:a,initPTS:Ee,timescale:Ne}))}if(z&&f.independent!==!1){if(re.details){var Se=z.startPTS,Ie=z.endPTS,Ae=z.startDTS,we=z.endDTS;if(Q)Q.elementaryStreams[z.type]={startPTS:Se,endPTS:Ie,startDTS:Ae,endDTS:we};else if(z.firstKeyFrame&&z.independent&&(this.couldBacktrack=!0),z.dropped&&z.independent){var ve=this.getLoadPosition()+this.config.maxBufferHole;if(ve<Se){this.backtrack(H);return}H.setElementaryStreamInfo(z.type,H.start,Ie,H.start,we,!0)}H.setElementaryStreamInfo(z.type,Se,Ie,Ae,we),this.bufferFragmentData(z,H,Q,E)}}else if(f.independent===!1){this.backtrack(H);return}if(ge){var j=ge.startPTS,T=ge.endPTS,L=ge.startDTS,G=ge.endDTS;Q&&(Q.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:j,endPTS:T,startDTS:L,endDTS:G}),H.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,j,T,L,G),this.bufferFragmentData(ge,H,Q,E)}if(ae!=null&&(l=ae.samples)!==null&&l!==void 0&&l.length){var q={frag:H,id:a,samples:ae.samples};v.trigger(W.Events.FRAG_PARSING_METADATA,q)}if(U){var N={frag:H,id:a,samples:U.samples};v.trigger(W.Events.FRAG_PARSING_USERDATA,N)}},b._bufferInitSegment=function(d,l,a,v){var f=this;if(this.state!==_.State.PARSING)return;this.audioOnly=!!l.audio&&!l.video,this.altAudio&&!this.audioOnly&&delete l.audio;var E=l.audio,P=l.video,H=l.audiovideo;if(E){var Q=d.audioCodec,re=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(Q&&(Q.indexOf("mp4a.40.5")!==-1?Q="mp4a.40.2":Q="mp4a.40.5"),E.metadata.channelCount!==1&&re.indexOf("firefox")===-1&&(Q="mp4a.40.5")),re.indexOf("android")!==-1&&E.container!=="audio/mpeg"&&(Q="mp4a.40.2",this.log("Android: force audio codec to "+Q)),d.audioCodec&&d.audioCodec!==Q&&this.log('Swapping manifest audio codec "'+d.audioCodec+'" for "'+Q+'"'),E.levelCodec=Q,E.id="main",this.log("Init audio buffer, container:"+E.container+", codecs[selected/level/parsed]=["+(Q||"")+"/"+(d.audioCodec||"")+"/"+E.codec+"]")}P&&(P.levelCodec=d.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(d.videoCodec||"")+"/"+P.codec+"]")),H&&this.log("Init audiovideo buffer, container:"+H.container+", codecs[level/parsed]=["+(d.attrs.CODECS||"")+"/"+H.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,l),Object.keys(l).forEach(function(z){var U=l[z],ae=U.initSegment;ae!=null&&ae.byteLength&&f.hls.trigger(W.Events.BUFFER_APPENDING,{type:z,data:ae,frag:a,part:null,chunkMeta:v,parent:a.type})}),this.tick()},b.backtrack=function(d){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(d);var l=this.fragmentTracker.backtrack(d);this.fragPrevious=null,this.nextLoadPosition=d.start,l?this.resetFragmentLoading(d):this.state=_.State.BACKTRACKING},b.checkFragmentChanged=function(){var d=this.media,l=null;if(d&&d.readyState>1&&d.seeking===!1){var a=d.currentTime;if(F.BufferHelper.isBuffered(d,a)?l=this.getAppendedFrag(a):F.BufferHelper.isBuffered(d,a+.1)&&(l=this.getAppendedFrag(a+.1)),l){var v=this.fragPlaying,f=l.level;(!v||l.sn!==v.sn||v.level!==f||l.urlId!==v.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:l}),(!v||v.level!==f)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:f}),this.fragPlaying=l)}}},o(D,[{key:"nextLevel",get:function(){var d=this.nextBufferedFrag;return d?d.level:-1}},{key:"currentLevel",get:function(){var d=this.media;if(d){var l=this.getAppendedFrag(d.currentTime);if(l)return l.level}return-1}},{key:"nextBufferedFrag",get:function(){var d=this.media;if(d){var l=this.getAppendedFrag(d.currentTime);return this.followingBufferedFrag(l)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(_.default)},"./src/controller/subtitle-stream-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"SubtitleStreamController",function(){return s});var V=k("./src/events.ts"),_=k("./src/utils/logger.ts"),R=k("./src/utils/buffer-helper.ts"),W=k("./src/controller/fragment-finders.ts"),F=k("./src/utils/discontinuities.ts"),O=k("./src/controller/level-helper.ts"),M=k("./src/controller/fragment-tracker.ts"),g=k("./src/controller/base-stream-controller.ts"),S=k("./src/types/loader.ts"),I=k("./src/types/level.ts");function w(u,y){for(var m=0;m<y.length;m++){var p=y[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(u,p.key,p)}}function A(u,y,m){return y&&w(u.prototype,y),m&&w(u,m),u}function C(u,y){u.prototype=Object.create(y.prototype),u.prototype.constructor=u,h(u,y)}function h(u,y){return h=Object.setPrototypeOf||function(p,D){return p.__proto__=D,p},h(u,y)}var o=500,s=function(u){C(y,u);function y(p,D){var b;return b=u.call(this,p,D,"[subtitle-stream-controller]")||this,b.levels=[],b.currentTrackId=-1,b.tracksBuffered=[],b.mainDetails=null,b._registerListeners(),b}var m=y.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var D=this.hls;D.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(V.Events.ERROR,this.onError,this),D.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var D=this.hls;D.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(V.Events.ERROR,this.onError,this),D.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(o),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(D,b){this.mainDetails=b.details},m.onSubtitleFragProcessed=function(D,b){var c=b.frag,d=b.success;if(this.fragPrevious=c,this.state=g.State.IDLE,!d)return;var l=this.tracksBuffered[this.currentTrackId];if(!l)return;for(var a,v=c.start,f=0;f<l.length;f++)if(v>=l[f].start&&v<=l[f].end){a=l[f];break}var E=c.start+c.duration;a?a.end=E:(a={start:v,end:E},l.push(a)),this.fragmentTracker.fragBuffered(c)},m.onBufferFlushing=function(D,b){var c=b.startOffset,d=b.endOffset;if(c===0&&d!==Number.POSITIVE_INFINITY){var l=this.currentTrackId,a=this.levels;if(!a.length||!a[l]||!a[l].details)return;var v=a[l].details,f=v.targetduration,E=d-f;if(E<=0)return;b.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(P){for(var H=0;H<P.length;){if(P[H].end<=E){P.shift();continue}else if(P[H].start<E)P[H].start=E;else break;H++}}),this.fragmentTracker.removeFragmentsInRange(c,E,S.PlaylistLevelType.SUBTITLE)}},m.onError=function(D,b){var c,d=b.frag;if(!d||d.type!==S.PlaylistLevelType.SUBTITLE)return;(c=this.fragCurrent)!==null&&c!==void 0&&c.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},m.onSubtitleTracksUpdated=function(D,b){var c=this,d=b.subtitleTracks;this.tracksBuffered=[],this.levels=d.map(function(l){return new I.Level(l)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(l){c.tracksBuffered[l.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(D,b){if(this.currentTrackId=b.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var c=this.levels[this.currentTrackId];c!=null&&c.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,c&&this.setInterval(o)},m.onSubtitleTrackLoaded=function(D,b){var c,d=b.details,l=b.id,a=this.currentTrackId,v=this.levels;if(!v.length)return;var f=v[a];if(l>=v.length||l!==a||!f)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,d.live||(c=f.details)!==null&&c!==void 0&&c.live){var E=this.mainDetails;if(d.deltaUpdateFailed||!E)return;var P=E.fragments[0];if(!f.details)d.hasProgramDateTime&&E.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(d,E):P&&Object(O.addSliding)(d,P.start);else{var H=this.alignPlaylists(d,f.details);H===0&&P&&Object(O.addSliding)(d,P.start)}}if(f.details=d,this.levelLastLoaded=l,this.tick(),d.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var Q=Object(W.findFragmentByPTS)(null,d.fragments,this.media.currentTime,0);Q||(this.warn("Subtitle playlist not aligned with playback"),f.details=void 0)}},m._handleFragmentLoadComplete=function(D){var b=D.frag,c=D.payload,d=b.decryptdata,l=this.hls;if(this.fragContextChanged(b))return;if(c&&c.byteLength>0&&d&&d.key&&d.iv&&d.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(c),d.key.buffer,d.iv.buffer).then(function(v){var f=performance.now();l.trigger(V.Events.FRAG_DECRYPTED,{frag:b,payload:v,stats:{tstart:a,tdecrypt:f}})})}},m.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var D,b=this.currentTrackId,c=this.levels;if(!c.length||!c[b]||!c[b].details)return;var d=c[b].details,l=d.targetduration,a=this.config,v=this.media,f=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-l,a.maxBufferHole),E=f.end,P=f.len,H=this.getMaxBufferLength()+l;if(P>H)return;console.assert(d,"Subtitle track details are defined on idle subtitle stream controller tick");var Q=d.fragments,re=Q.length,z=d.edge,U,ae=this.fragPrevious;if(E<z){var fe=a.maxFragLookUpTolerance;ae&&d.hasProgramDateTime&&(U=Object(W.findFragmentByPDT)(Q,ae.endProgramDateTime,fe)),U||(U=Object(W.findFragmentByPTS)(ae,Q,E,fe),!U&&ae&&ae.start<Q[0].start&&(U=Q[0]))}else U=Q[re-1];(D=U)!==null&&D!==void 0&&D.encrypted?(_.logger.log("Loading key for "+U.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:U})):U&&this.fragmentTracker.getState(U)===M.FragmentState.NOT_LOADED&&this.loadFragment(U,d,E)}},m.loadFragment=function(D,b,c){this.fragCurrent=D,u.prototype.loadFragment.call(this,D,b,c)},A(y,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),y}(g.default)},"./src/controller/subtitle-track-controller.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/events.ts"),_=k("./src/utils/texttrack-utils.ts"),R=k("./src/controller/base-playlist-controller.ts"),W=k("./src/types/loader.ts");function F(w,A){for(var C=0;C<A.length;C++){var h=A[C];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(w,h.key,h)}}function O(w,A,C){return A&&F(w.prototype,A),C&&F(w,C),w}function M(w,A){w.prototype=Object.create(A.prototype),w.prototype.constructor=w,g(w,A)}function g(w,A){return g=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},g(w,A)}var S=function(w){M(A,w);function A(h){var o;return o=w.call(this,h,"[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 C=A.prototype;return C.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,w.prototype.destroy.call(this)},C.registerListeners=function(){var o=this.hls;o.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(V.Events.ERROR,this.onError,this)},C.unregisterListeners=function(){var o=this.hls;o.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(V.Events.ERROR,this.onError,this)},C.onMediaAttached=function(o,s){if(this.media=s.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)},C.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},C.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=I(this.media.textTracks);o.forEach(function(s){Object(_.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},C.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},C.onManifestParsed=function(o,s){this.tracks=s.subtitleTracks},C.onSubtitleTrackLoaded=function(o,s){var u=s.id,y=s.details,m=this.trackId,p=this.tracksInGroup[m];if(!p){this.warn("Invalid subtitle track id "+u);return}var D=p.details;p.details=s.details,this.log("subtitle track "+u+" loaded ["+y.startSN+"-"+y.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,s,D))},C.onLevelLoading=function(o,s){this.switchLevel(s.level)},C.onLevelSwitching=function(o,s){this.switchLevel(s.level)},C.switchLevel=function(o){var s=this.hls.levels[o];if(!(s!=null&&s.textGroupIds))return;var u=s.textGroupIds[s.urlId];if(this.groupId!==u){var y=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(b){return!u||b.groupId===u});this.tracksInGroup=m;var p=this.findTrackId(y==null?void 0:y.name)||this.findTrackId();this.groupId=u;var D={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,D),p!==-1&&this.setSubtitleTrack(p,y)}},C.findTrackId=function(o){for(var s=this.tracksInGroup,u=0;u<s.length;u++){var y=s[u];if((!this.selectDefaultTrack||y.default)&&(!o||o===y.name))return y.id}return-1},C.onError=function(o,s){if(w.prototype.onError.call(this,o,s),s.fatal||!s.context)return;s.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},C.loadPlaylist=function(o){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var u=s.id,y=s.groupId,m=s.url;if(o)try{m=o.addDirectives(m)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("Loading subtitle playlist for id "+u),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:m,id:u,groupId:y,deliveryDirectives:o||null})}},C.toggleTrackModes=function(o){var s=this,u=this.media,y=this.subtitleDisplay,m=this.trackId;if(!u)return;var p=I(u.textTracks),D=p.filter(function(d){return d.groupId===s.groupId});if(o===-1)[].slice.call(p).forEach(function(d){d.mode="disabled"});else{var b=D[m];b&&(b.mode="disabled")}var c=D[o];c&&(c.mode=y?"showing":"hidden")},C.setSubtitleTrack=function(o,s){var u,y=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(u=y[o])!==null&&u!==void 0&&u.details)||o<-1||o>=y.length)return;this.clearTimer();var m=y[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,m){var p=m.id,D=m.groupId,b=D===void 0?"":D,c=m.name,d=m.type,l=m.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:p,groupId:b,name:c,type:d,url:l});var a=this.switchParams(m.url,s==null?void 0:s.details);this.loadPlaylist(a)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:o})},C.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,s=I(this.media.textTracks),u=0;u<s.length;u++)if(s[u].mode==="hidden")o=u;else if(s[u].mode==="showing"){o=u;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},O(A,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,s)}}]),A}(R.default);function I(w){for(var A=[],C=0;C<w.length;C++){var h=w[C];h.kind==="subtitles"&&h.label&&A.push(w[C])}return A}Y.default=S},"./src/controller/timeline-controller.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"TimelineController",function(){return I});var V=k("./src/polyfills/number.ts"),_=k("./src/events.ts"),R=k("./src/utils/cea-608-parser.ts"),W=k("./src/utils/output-filter.ts"),F=k("./src/utils/webvtt-parser.ts"),O=k("./src/utils/texttrack-utils.ts"),M=k("./src/utils/imsc1-ttml-parser.ts"),g=k("./src/types/loader.ts"),S=k("./src/utils/logger.ts"),I=function(){function h(s){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=C(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.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 u=new W.default(this,"textTrack1"),y=new W.default(this,"textTrack2"),m=new W.default(this,"textTrack3"),p=new W.default(this,"textTrack4");this.cea608Parser1=new R.default(1,u,y),this.cea608Parser2=new R.default(3,m,p)}s.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(_.Events.FRAG_LOADING,this.onFragLoading,this),s.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(_.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(_.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(_.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=h.prototype;return o.destroy=function(){var u=this.hls;u.off(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.off(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.off(_.Events.FRAG_LOADING,this.onFragLoading,this),u.off(_.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(_.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.off(_.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.off(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(_.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.off(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(u,y,m,p,D){for(var b=!1,c=D.length;c--;){var d=D[c],l=A(d[0],d[1],y,m);if(l>=0&&(d[0]=Math.min(d[0],y),d[1]=Math.max(d[1],m),b=!0,l/(m-y)>.5))return}if(b||D.push([y,m]),this.config.renderTextTracksNatively){var a=this.captionsTracks[u];this.Cues.newCue(a,y,m,p)}else{var v=this.Cues.newCue(null,y,m,p);this.hls.trigger(_.Events.CUES_PARSED,{type:"captions",cues:v,track:u})}},o.onInitPtsFound=function(u,y){var m=this,p=y.frag,D=y.id,b=y.initPTS,c=y.timescale,d=this.unparsedVttFrags;D==="main"&&(this.initPTS[p.cc]=b,this.timescale[p.cc]=c),d.length&&(this.unparsedVttFrags=[],d.forEach(function(l){m.onFragLoaded(_.Events.FRAG_LOADED,l)}))},o.getExistingTrack=function(u){var y=this.media;if(y)for(var m=0;m<y.textTracks.length;m++){var p=y.textTracks[m];if(p[u])return p}return null},o.createCaptionsTrack=function(u){this.config.renderTextTracksNatively?this.createNativeTrack(u):this.createNonNativeTrack(u)},o.createNativeTrack=function(u){if(this.captionsTracks[u])return;var y=this.captionsProperties,m=this.captionsTracks,p=this.media,D=y[u],b=D.label,c=D.languageCode,d=this.getExistingTrack(u);if(d)m[u]=d,Object(O.clearCurrentCues)(m[u]),Object(O.sendAddTrackEvent)(m[u],p);else{var l=this.createTextTrack("captions",b,c);l&&(l[u]=!0,m[u]=l)}},o.createNonNativeTrack=function(u){if(this.nonNativeCaptionsTracks[u])return;var y=this.captionsProperties[u];if(!y)return;var m=y.label,p={_id:u,label:m,kind:"captions",default:y.media?!!y.media.default:!1,closedCaptions:y.media};this.nonNativeCaptionsTracks[u]=p,this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[p]})},o.createTextTrack=function(u,y,m){var p=this.media;return p?p.addTextTrack(u,y,m):void 0},o.onMediaAttaching=function(u,y){this.media=y.media,this._cleanTracks()},o.onMediaDetaching=function(){var u=this.captionsTracks;Object.keys(u).forEach(function(y){Object(O.clearCurrentCues)(u[y]),delete u[y]}),this.nonNativeCaptionsTracks={}},o.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=C(),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 u=this.media;if(!u)return;var y=u.textTracks;if(y)for(var m=0;m<y.length;m++)Object(O.clearCurrentCues)(y[m])},o.onSubtitleTracksUpdated=function(u,y){var m=this;this.textTracks=[];var p=y.subtitleTracks||[],D=p.some(function(l){return l.textCodec===M.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var b=this.tracks&&p&&this.tracks.length===p.length;if(this.tracks=p||[],this.config.renderTextTracksNatively){var c=this.media?this.media.textTracks:[];this.tracks.forEach(function(l,a){var v;if(a<c.length){for(var f=null,E=0;E<c.length;E++)if(w(c[E],l)){f=c[E];break}f&&(v=f)}v?Object(O.clearCurrentCues)(v):(v=m.createTextTrack("subtitles",l.name,l.lang),v&&(v.mode="disabled")),v&&(v.groupId=l.groupId,m.textTracks.push(v))})}else if(!b&&this.tracks&&this.tracks.length){var d=this.tracks.map(function(l){return{label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}});this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:d})}}},o.onManifestLoaded=function(u,y){var m=this;this.config.enableCEA708Captions&&y.captions&&y.captions.forEach(function(p){var D=/(?:CC|SERVICE)([1-4])/.exec(p.instreamId);if(!D)return;var b="textTrack"+D[1],c=m.captionsProperties[b];if(!c)return;c.label=p.name,p.lang&&(c.languageCode=p.lang),c.media=p})},o.onFragLoading=function(u,y){var m=this.cea608Parser1,p=this.cea608Parser2,D=this.lastSn,b=this.lastPartIndex;if(!this.enabled||!(m&&p))return;if(y.frag.type===g.PlaylistLevelType.MAIN){var c,d,l=y.frag.sn,a=(c=y==null||((d=y.part)===null||d===void 0)?void 0:d.index)!=null?c:-1;l===D+1||l===D&&a===b+1||(m.reset(),p.reset()),this.lastSn=l,this.lastPartIndex=a}},o.onFragLoaded=function(u,y){var m=y.frag,p=y.payload,D=this.initPTS,b=this.unparsedVttFrags;if(m.type===g.PlaylistLevelType.SUBTITLE)if(p.byteLength){if(!Object(V.isFiniteNumber)(D[m.cc])){b.push(y),D.length&&this.hls.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var c=m.decryptdata;if(c==null||c.key==null||c.method!=="AES-128"){var d=this.tracks[m.level],l=this.vttCCs;l[m.cc]||(l[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),d&&d.textCodec===M.IMSC1_CODEC?this._parseIMSC1(m,p):this._parseVTTs(m,p,l)}}else this.hls.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(u,y){var m=this,p=this.hls;Object(M.parseIMSC1)(y,this.initPTS[u.cc],this.timescale[u.cc],function(D){m._appendCues(D,u.level),p.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(D){S.logger.log("Failed to parse IMSC1: "+D),p.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:D})})},o._parseVTTs=function(u,y,m){var p=this,D=this.hls;Object(F.parseWebVTT)(y,this.initPTS[u.cc],this.timescale[u.cc],m,u.cc,u.start,function(b){p._appendCues(b,u.level),D.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(b){p._fallbackToIMSC1(u,y),S.logger.log("Failed to parse VTT cue: "+b),D.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:b})})},o._fallbackToIMSC1=function(u,y){var m=this,p=this.tracks[u.level];p.textCodec||Object(M.parseIMSC1)(y,this.initPTS[u.cc],this.timescale[u.cc],function(){p.textCodec=M.IMSC1_CODEC,m._parseIMSC1(u,y)},function(){p.textCodec="wvtt"})},o._appendCues=function(u,y){var m=this.hls;if(this.config.renderTextTracksNatively){var p=this.textTracks[y];if(p.mode==="disabled")return;u.forEach(function(c){return Object(O.addCueToTrack)(p,c)})}else{var D=this.tracks[y],b=D.default?"default":"subtitles"+y;m.trigger(_.Events.CUES_PARSED,{type:"subtitles",cues:u,track:b})}},o.onFragDecrypted=function(u,y){var m=y.frag;if(m.type===g.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(y);return}this.onFragLoaded(_.Events.FRAG_LOADED,y)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(u,y){var m=this.cea608Parser1,p=this.cea608Parser2;if(!this.enabled||!(m&&p))return;for(var D=0;D<y.samples.length;D++){var b=y.samples[D].bytes;if(b){var c=this.extractCea608Data(b);m.addData(y.samples[D].pts,c[0]),p.addData(y.samples[D].pts,c[1])}}},o.onBufferFlushing=function(u,y){var m=y.startOffset,p=y.endOffset,D=y.endOffsetSubtitles,b=y.type,c=this.media;if(!c||c.currentTime<p)return;if(!b||b==="video"){var d=this.captionsTracks;Object.keys(d).forEach(function(a){return Object(O.removeCuesInRange)(d[a],m,p)})}if(this.config.renderTextTracksNatively&&(m===0&&D!==void 0)){var l=this.textTracks;Object.keys(l).forEach(function(a){return Object(O.removeCuesInRange)(l[a],m,D)})}},o.extractCea608Data=function(u){for(var y=u[0]&31,m=2,p=[[],[]],D=0;D<y;D++){var b=u[m++],c=127&u[m++],d=127&u[m++],l=(4&b)!==0,a=3&b;if(c===0&&d===0)continue;l&&((a===0||a===1)&&(p[a].push(c),p[a].push(d)))}return p},h}();function w(h,o){return h&&h.label===o.name&&!(h.textTrack1||h.textTrack2)}function A(h,o,s,u){return Math.min(o,u)-Math.max(h,s)}function C(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return V});var V=function(){function _(W,F){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=F}var R=_.prototype;return R.decrypt=function(F,O){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},O,F)},_}()},"./src/crypt/aes-decryptor.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"removePadding",function(){return _}),k.d(Y,"default",function(){return R});var V=k("./src/utils/typed-array.ts");function _(W){var F=W.byteLength,O=F&&new DataView(W.buffer).getUint8(F-1);return O?Object(V.sliceUint8)(W,0,F-O):W}var R=function(){function W(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var F=W.prototype;return F.uint8ArrayToUint32Array_=function(M){for(var g=new DataView(M),S=new Uint32Array(4),I=0;I<4;I++)S[I]=g.getUint32(I*4);return S},F.initTable=function(){var M=this.sBox,g=this.invSBox,S=this.subMix,I=S[0],w=S[1],A=S[2],C=S[3],h=this.invSubMix,o=h[0],s=h[1],u=h[2],y=h[3],m=new Uint32Array(256),p=0,D=0,b=0;for(b=0;b<256;b++)b<128?m[b]=b<<1:m[b]=b<<1^283;for(b=0;b<256;b++){var c=D^D<<1^D<<2^D<<3^D<<4;c=c>>>8^c&255^99,M[p]=c,g[c]=p;var d=m[p],l=m[d],a=m[l],v=m[c]*257^c*16843008;I[p]=v<<24|v>>>8,w[p]=v<<16|v>>>16,A[p]=v<<8|v>>>24,C[p]=v,v=a*16843009^l*65537^d*257^p*16843008,o[c]=v<<24|v>>>8,s[c]=v<<16|v>>>16,u[c]=v<<8|v>>>24,y[c]=v,p?(p=d^m[m[m[a^d]]],D^=m[m[D]]):p=D=1}},F.expandKey=function(M){for(var g=this.uint8ArrayToUint32Array_(M),S=!0,I=0;I<g.length&&S;)S=g[I]===this.key[I],I++;if(S)return;this.key=g;var w=this.keySize=g.length;if(w!==4&&w!==6&&w!==8)throw new Error("Invalid aes key size="+w);var A=this.ksRows=(w+6+1)*4,C,h,o=this.keySchedule=new Uint32Array(A),s=this.invKeySchedule=new Uint32Array(A),u=this.sBox,y=this.rcon,m=this.invSubMix,p=m[0],D=m[1],b=m[2],c=m[3],d,l;for(C=0;C<A;C++){if(C<w){d=o[C]=g[C];continue}l=d,C%w===0?(l=l<<8|l>>>24,l=u[l>>>24]<<24|u[l>>>16&255]<<16|u[l>>>8&255]<<8|u[l&255],l^=y[C/w|0]<<24):w>6&&C%w===4&&(l=u[l>>>24]<<24|u[l>>>16&255]<<16|u[l>>>8&255]<<8|u[l&255]),o[C]=d=(o[C-w]^l)>>>0}for(h=0;h<A;h++)C=A-h,h&3?l=o[C]:l=o[C-4],h<4||C<=4?s[h]=l:s[h]=p[u[l>>>24]]^D[u[l>>>16&255]]^b[u[l>>>8&255]]^c[u[l&255]],s[h]=s[h]>>>0},F.networkToHostOrderSwap=function(M){return M<<24|(M&65280)<<8|(M&16711680)>>8|M>>>24},F.decrypt=function(M,g,S){for(var I=this.keySize+6,w=this.invKeySchedule,A=this.invSBox,C=this.invSubMix,h=C[0],o=C[1],s=C[2],u=C[3],y=this.uint8ArrayToUint32Array_(S),m=y[0],p=y[1],D=y[2],b=y[3],c=new Int32Array(M),d=new Int32Array(c.length),l,a,v,f,E,P,H,Q,re,z,U,ae,fe,ge,Ee=this.networkToHostOrderSwap;g<c.length;){for(re=Ee(c[g]),z=Ee(c[g+1]),U=Ee(c[g+2]),ae=Ee(c[g+3]),E=re^w[0],P=ae^w[1],H=U^w[2],Q=z^w[3],fe=4,ge=1;ge<I;ge++)l=h[E>>>24]^o[P>>16&255]^s[H>>8&255]^u[Q&255]^w[fe],a=h[P>>>24]^o[H>>16&255]^s[Q>>8&255]^u[E&255]^w[fe+1],v=h[H>>>24]^o[Q>>16&255]^s[E>>8&255]^u[P&255]^w[fe+2],f=h[Q>>>24]^o[E>>16&255]^s[P>>8&255]^u[H&255]^w[fe+3],E=l,P=a,H=v,Q=f,fe=fe+4;l=A[E>>>24]<<24^A[P>>16&255]<<16^A[H>>8&255]<<8^A[Q&255]^w[fe],a=A[P>>>24]<<24^A[H>>16&255]<<16^A[Q>>8&255]<<8^A[E&255]^w[fe+1],v=A[H>>>24]<<24^A[Q>>16&255]<<16^A[E>>8&255]<<8^A[P&255]^w[fe+2],f=A[Q>>>24]<<24^A[E>>16&255]<<16^A[P>>8&255]<<8^A[H&255]^w[fe+3],d[g]=Ee(l^m),d[g+1]=Ee(f^p),d[g+2]=Ee(v^D),d[g+3]=Ee(a^b),m=re,p=z,D=U,b=ae,g=g+4}return d.buffer},W}()},"./src/crypt/decrypter.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return g});var V=k("./src/crypt/aes-crypto.ts"),_=k("./src/crypt/fast-aes-key.ts"),R=k("./src/crypt/aes-decryptor.ts"),W=k("./src/utils/logger.ts"),F=k("./src/utils/mp4-tools.ts"),O=k("./src/utils/typed-array.ts"),M=16,g=function(){function S(w,A,C){var h=C===void 0?{}:C,o=h.removePKCS7Padding,s=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=w,this.config=A,this.removePKCS7Padding=s,s)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(y){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var I=S.prototype;return I.destroy=function(){this.observer=null},I.isSync=function(){return this.config.enableSoftwareAES},I.flush=function(){var A=this.currentResult;if(!A){this.reset();return}var C=new Uint8Array(A);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(C):C},I.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},I.decrypt=function(A,C,h,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(A),C,h);var s=this.flush();s&&o(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(A),C,h).then(o)},I.softwareDecrypt=function(A,C,h){var o=this.currentIV,s=this.currentResult,u=this.remainderData;this.logOnce("JS AES decrypt"),u&&(A=Object(F.appendUint8Array)(u,A),this.remainderData=null);var y=this.getValidChunk(A);if(!y.length)return null;o&&(h=o);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new R.default),m.expandKey(C);var p=s;return this.currentResult=m.decrypt(y.buffer,0,h),this.currentIV=Object(O.sliceUint8)(y,-16).buffer,p||null},I.webCryptoDecrypt=function(A,C,h){var o=this,s=this.subtle;return(this.key!==C||!this.fastAesKey)&&(this.key=C,this.fastAesKey=new _.default(s,C)),this.fastAesKey.expandKey().then(function(u){if(!s)return Promise.reject(new Error("web crypto not initialized"));var y=new V.default(s,h);return y.decrypt(A.buffer,u)}).catch(function(u){return o.onWebCryptoError(u,A,C,h)})},I.onWebCryptoError=function(A,C,h,o){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",A),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(C,h,o)},I.getValidChunk=function(A){var C=A,h=A.length-A.length%M;return h!==A.length&&(C=Object(O.sliceUint8)(A,0,h),this.remainderData=Object(O.sliceUint8)(A,h)),C},I.logOnce=function(A){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+A),this.logEnabled=!1},S}()},"./src/crypt/fast-aes-key.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return V});var V=function(){function _(W,F){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=F}var R=_.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},_}()},"./src/demux/aacdemuxer.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/demux/base-audio-demuxer.ts"),_=k("./src/demux/adts.ts"),R=k("./src/utils/logger.ts"),W=k("./src/demux/id3.ts");function F(g,S){g.prototype=Object.create(S.prototype),g.prototype.constructor=g,O(g,S)}function O(g,S){return O=Object.setPrototypeOf||function(w,A){return w.__proto__=A,w},O(g,S)}var M=function(g){F(S,g);function S(w,A){var C;return C=g.call(this)||this,C.observer=void 0,C.config=void 0,C.observer=w,C.config=A,C}var I=S.prototype;return I.resetInitSegment=function(A,C,h){g.prototype.resetInitSegment.call(this,A,C,h),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:A,duration:h,inputTimeScale:9e4,dropped:0}},S.probe=function(A){if(!A)return!1;for(var C=W.getID3Data(A,0)||[],h=C.length,o=A.length;h<o;h++)if(_.probe(A,h))return R.logger.log("ADTS sync word found !"),!0;return!1},I.canParse=function(A,C){return _.canParse(A,C)},I.appendFrame=function(A,C,h){_.initTrackConfig(A,this.observer,C,h,A.manifestCodec);var o=_.appendFrame(A,C,h,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},S}(V.default);M.minProbeByteLength=9,Y.default=M},"./src/demux/adts.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"getAudioConfig",function(){return W}),k.d(Y,"isHeaderPattern",function(){return F}),k.d(Y,"getHeaderLength",function(){return O}),k.d(Y,"getFullFrameLength",function(){return M}),k.d(Y,"canGetFrameLength",function(){return g}),k.d(Y,"isHeader",function(){return S}),k.d(Y,"canParse",function(){return I}),k.d(Y,"probe",function(){return w}),k.d(Y,"initTrackConfig",function(){return A}),k.d(Y,"getFrameDuration",function(){return C}),k.d(Y,"parseFrameHeader",function(){return h}),k.d(Y,"appendFrame",function(){return o});var V=k("./src/utils/logger.ts"),_=k("./src/errors.ts"),R=k("./src/events.ts");function W(s,u,y,m){var p,D,b,c,d=navigator.userAgent.toLowerCase(),l=m,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];p=((u[y+2]&192)>>>6)+1;var v=(u[y+2]&60)>>>2;if(v>a.length-1){s.trigger(R.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return b=(u[y+2]&1)<<2,b|=(u[y+3]&192)>>>6,V.logger.log("manifest codec:"+m+", ADTS type:"+p+", samplingIndex:"+v),/firefox/i.test(d)?v>=6?(p=5,c=new Array(4),D=v-3):(p=2,c=new Array(2),D=v):d.indexOf("android")!==-1?(p=2,c=new Array(2),D=v):(p=5,c=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&v>=6?D=v-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(v>=6&&b===1||/vivaldi/i.test(d))||!m&&b===1)&&(p=2,c=new Array(2)),D=v)),c[0]=p<<3,c[0]|=(v&14)>>1,c[1]|=(v&1)<<7,c[1]|=b<<3,p===5&&(c[1]|=(D&14)>>1,c[2]=(D&1)<<7,c[2]|=2<<2,c[3]=0),{config:c,samplerate:a[v],channelCount:b,codec:"mp4a.40."+p,manifestCodec:l}}function F(s,u){return s[u]===255&&(s[u+1]&246)===240}function O(s,u){return s[u+1]&1?7:9}function M(s,u){return(s[u+3]&3)<<11|s[u+4]<<3|(s[u+5]&224)>>>5}function g(s,u){return u+5<s.length}function S(s,u){return u+1<s.length&&F(s,u)}function I(s,u){return g(s,u)&&F(s,u)&&M(s,u)<=s.length-u}function w(s,u){if(S(s,u)){var y=O(s,u);if(u+y>=s.length)return!1;var m=M(s,u);if(m<=y)return!1;var p=u+m;return p===s.length||S(s,p)}return!1}function A(s,u,y,m,p){if(!s.samplerate){var D=W(u,y,m,p);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,V.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function C(s){return 1024*9e4/s}function h(s,u,y,m,p){var D=O(s,u),b=M(s,u);if(b-=D,b>0){var c=y+m*p;return{headerLength:D,frameLength:b,stamp:c}}}function o(s,u,y,m,p){var D=C(s.samplerate),b=h(u,y,m,p,D);if(b){var c=b.frameLength,d=b.headerLength,l=b.stamp,a=d+c,v=Math.max(0,y+a-u.length),f;v?(f=new Uint8Array(a-d),f.set(u.subarray(y+d,u.length),0)):f=u.subarray(y+d,y+a);var E={unit:f,pts:l};return v||s.samples.push(E),{sample:E,length:a,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"initPTSFn",function(){return M});var V=k("./src/polyfills/number.ts"),_=k("./src/demux/id3.ts"),R=k("./src/demux/dummy-demuxed-track.ts"),W=k("./src/utils/mp4-tools.ts"),F=k("./src/utils/typed-array.ts"),O=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var S=g.prototype;return S.resetInitSegment=function(w,A,C){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},S.resetTimeStamp=function(){},S.resetContiguity=function(){},S.canParse=function(w,A){return!1},S.appendFrame=function(w,A,C){},S.demux=function(w,A){this.cachedData&&(w=Object(W.appendUint8Array)(this.cachedData,w),this.cachedData=null);var C=_.getID3Data(w,0),h=C?C.length:0,o,s,u=this._audioTrack,y=this._id3Track,m=C?_.getTimeStamp(C):void 0,p=w.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(m,A)),C&&C.length>0&&y.samples.push({pts:this.initPTS,dts:this.initPTS,data:C}),s=this.initPTS;h<p;){if(this.canParse(w,h)){var D=this.appendFrame(u,w,h);D?(this.frameIndex++,s=D.sample.pts,h+=D.length,o=h):h=p}else _.canParse(w,h)?(C=_.getID3Data(w,h),y.samples.push({pts:s,dts:s,data:C}),h+=C.length,o=h):h++;if(h===p&&o!==p){var b=Object(F.sliceUint8)(w,o);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,b):this.cachedData=b}}return{audioTrack:u,avcTrack:Object(R.dummyTrack)(),id3Track:y,textTrack:Object(R.dummyTrack)()}},S.demuxSampleAes=function(w,A,C){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},S.flush=function(w){var A=this.cachedData;return A&&(this.cachedData=null,this.demux(A,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},S.destroy=function(){},g}(),M=function(S,I){return Object(V.isFiniteNumber)(S)?S*90:I*9e4};Y.default=O},"./src/demux/chunk-cache.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return V});var V=function(){function R(){this.chunks=[],this.dataLength=0}var W=R.prototype;return W.push=function(O){this.chunks.push(O),this.dataLength+=O.length},W.flush=function(){var O=this.chunks,M=this.dataLength,g;if(O.length)O.length===1?g=O[0]:g=_(O,M);else return new Uint8Array(0);return this.reset(),g},W.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function _(R,W){for(var F=new Uint8Array(W),O=0,M=0;M<R.length;M++){var g=R[M];F.set(g,O),O+=g.length}return F}},"./src/demux/dummy-demuxed-track.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"dummyTrack",function(){return V});function V(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/utils/logger.ts"),_=function(){function R(F){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=F,this.bytesAvailable=F.byteLength,this.word=0,this.bitsAvailable=0}var W=R.prototype;return W.loadWord=function(){var O=this.data,M=this.bytesAvailable,g=O.byteLength-M,S=new Uint8Array(4),I=Math.min(4,M);if(I===0)throw new Error("no bytes available");S.set(O.subarray(g,g+I)),this.word=new DataView(S.buffer).getUint32(0),this.bitsAvailable=I*8,this.bytesAvailable-=I},W.skipBits=function(O){var M;this.bitsAvailable>O?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,M=O>>3,O-=M>>3,this.bytesAvailable-=M,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},W.readBits=function(O){var M=Math.min(this.bitsAvailable,O),g=this.word>>>32-M;return O>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=M,this.bitsAvailable>0?this.word<<=M:this.bytesAvailable>0&&this.loadWord(),M=O-M,M>0&&this.bitsAvailable?g<<M|this.readBits(M):g},W.skipLZ=function(){var O;for(O=0;O<this.bitsAvailable;++O)if((this.word&2147483648>>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},W.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(O){for(var M=8,g=8,S,I=0;I<O;I++)g!==0&&(S=this.readEG(),g=(M+S+256)%256),M=g===0?M:g},W.readSPS=function(){var O=0,M=0,g=0,S=0,I,w,A,C=this.readUByte.bind(this),h=this.readBits.bind(this),o=this.readUEG.bind(this),s=this.readBoolean.bind(this),u=this.skipBits.bind(this),y=this.skipEG.bind(this),m=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);C();var D=C();if(h(5),u(3),C(),m(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var b=o();if(b===3&&u(1),m(),m(),u(1),s())for(w=b!==3?8:12,A=0;A<w;A++)s()&&(A<6?p(16):p(64))}m();var c=o();if(c===0)o();else if(c===1)for(u(1),y(),y(),I=o(),A=0;A<I;A++)y();m(),u(1);var d=o(),l=o(),a=h(1);a===0&&u(1),u(1),s()&&(O=o(),M=o(),g=o(),S=o());var v=[1,1];if(s()&&s()){var f=C();switch(f){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[C()<<8|C(),C()<<8|C()];break}}}return{width:Math.ceil((d+1)*16-O*2-M*2),height:(2-a)*(l+1)*16-(a?2:4)*(g+S),pixelRatio:v}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();Y.default=_},"./src/demux/id3.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"isHeader",function(){return V}),k.d(Y,"isFooter",function(){return _}),k.d(Y,"getID3Data",function(){return R}),k.d(Y,"canParse",function(){return F}),k.d(Y,"getTimeStamp",function(){return O}),k.d(Y,"isTimeStampFrame",function(){return M}),k.d(Y,"getID3Frames",function(){return S}),k.d(Y,"decodeFrame",function(){return I}),k.d(Y,"utf8ArrayToStr",function(){return o}),k.d(Y,"testables",function(){return s});var V=function(p,D){return D+10<=p.length&&(p[D]===73&&p[D+1]===68&&p[D+2]===51&&(p[D+3]<255&&p[D+4]<255&&(p[D+6]<128&&p[D+7]<128&&p[D+8]<128&&p[D+9]<128)))},_=function(p,D){return D+10<=p.length&&(p[D]===51&&p[D+1]===68&&p[D+2]===73&&(p[D+3]<255&&p[D+4]<255&&(p[D+6]<128&&p[D+7]<128&&p[D+8]<128&&p[D+9]<128)))},R=function(p,D){for(var b=D,c=0;V(p,D);){c+=10;var d=W(p,D+6);c+=d,_(p,D+10)&&(c+=10),D+=c}return c>0?p.subarray(b,b+c):void 0},W=function(p,D){var b=0;return b=(p[D]&127)<<21,b|=(p[D+1]&127)<<14,b|=(p[D+2]&127)<<7,b|=p[D+3]&127,b},F=function(p,D){return V(p,D)&&W(p,D+6)+10<=p.length-D},O=function(p){for(var D=S(p),b=0;b<D.length;b++){var c=D[b];if(M(c))return h(c)}return},M=function(p){return p&&p.key==="PRIV"&&p.info==="com.apple.streaming.transportStreamTimestamp"},g=function(p){var D=String.fromCharCode(p[0],p[1],p[2],p[3]),b=W(p,4),c=10;return{type:D,size:b,data:p.subarray(c,c+b)}},S=function(p){for(var D=0,b=[];V(p,D);){var c=W(p,D+6);D+=10;for(var d=D+c;D+8<d;){var l=g(p.subarray(D)),a=I(l);a&&b.push(a),D+=l.size+10}_(p,D)&&(D+=10)}return b},I=function(p){return p.type==="PRIV"?w(p):p.type[0]==="W"?C(p):A(p)},w=function(p){if(p.size<2)return;var D=o(p.data,!0),b=new Uint8Array(p.data.subarray(D.length+1));return{key:p.type,info:D,data:b.buffer}},A=function(p){if(p.size<2)return;if(p.type==="TXXX"){var D=1,b=o(p.data.subarray(D),!0);D+=b.length+1;var c=o(p.data.subarray(D));return{key:p.type,info:b,data:c}}var d=o(p.data.subarray(1));return{key:p.type,data:d}},C=function(p){if(p.type==="WXXX"){if(p.size<2)return;var D=1,b=o(p.data.subarray(D),!0);D+=b.length+1;var c=o(p.data.subarray(D));return{key:p.type,info:b,data:c}}var d=o(p.data);return{key:p.type,data:d}},h=function(p){if(p.data.byteLength===8){var D=new Uint8Array(p.data),b=D[3]&1,c=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return c/=45,b&&(c+=4772185884e-2),Math.round(c)}return},o=function(p,D){D===void 0&&(D=!1);var b=y();if(b){var c=b.decode(p);if(D){var d=c.indexOf("\0");return d!==-1?c.substring(0,d):c}return c.replace(/\0/g,"")}for(var l=p.length,a,v,f,E="",P=0;P<l;){if(a=p[P++],a===0&&D)return E;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:E+=String.fromCharCode(a);break;case 12:case 13:v=p[P++],E+=String.fromCharCode((a&31)<<6|v&63);break;case 14:v=p[P++],f=p[P++],E+=String.fromCharCode((a&15)<<12|(v&63)<<6|(f&63)<<0);break;default:}}return E},s={decodeTextFrame:A},u;function y(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/demux/base-audio-demuxer.ts"),_=k("./src/demux/id3.ts"),R=k("./src/utils/logger.ts"),W=k("./src/demux/mpegaudio.ts");function F(g,S){g.prototype=Object.create(S.prototype),g.prototype.constructor=g,O(g,S)}function O(g,S){return O=Object.setPrototypeOf||function(w,A){return w.__proto__=A,w},O(g,S)}var M=function(g){F(S,g);function S(){return g.apply(this,arguments)||this}var I=S.prototype;return I.resetInitSegment=function(A,C,h){g.prototype.resetInitSegment.call(this,A,C,h),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:A,duration:h,inputTimeScale:9e4,dropped:0}},S.probe=function(A){if(!A)return!1;for(var C=_.getID3Data(A,0)||[],h=C.length,o=A.length;h<o;h++)if(W.probe(A,h))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},I.canParse=function(A,C){return W.canParse(A,C)},I.appendFrame=function(A,C,h){return this.initPTS===null?void 0:W.appendFrame(A,C,h,this.initPTS,this.frameIndex)},S}(V.default);M.minProbeByteLength=4,Y.default=M},"./src/demux/mp4demuxer.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/utils/mp4-tools.ts"),_=k("./src/demux/dummy-demuxed-track.ts"),R=function(){function W(O,M){this.remainderData=null,this.config=void 0,this.config=M}var F=W.prototype;return F.resetTimeStamp=function(){},F.resetInitSegment=function(){},F.resetContiguity=function(){},W.probe=function(M){return Object(V.findBox)({data:M,start:0,end:Math.min(M.length,16384)},["moof"]).length>0},F.demux=function(M){var g=M,S=Object(_.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(V.appendUint8Array)(this.remainderData,M));var I=Object(V.segmentValidRange)(g);this.remainderData=I.remainder,S.samples=I.valid||new Uint8Array}else S.samples=g;return{audioTrack:Object(_.dummyTrack)(),avcTrack:S,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},F.flush=function(){var M=Object(_.dummyTrack)();return M.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(_.dummyTrack)(),avcTrack:M,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},F.demuxSampleAes=function(M,g,S){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},W}();R.minProbeByteLength=1024,Y.default=R},"./src/demux/mpegaudio.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"appendFrame",function(){return O}),k.d(Y,"parseHeader",function(){return M}),k.d(Y,"isHeaderPattern",function(){return g}),k.d(Y,"isHeader",function(){return S}),k.d(Y,"canParse",function(){return I}),k.d(Y,"probe",function(){return w});var V=null,_=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function O(A,C,h,o,s){if(h+24>C.length)return;var u=M(C,h);if(u&&h+u.frameLength<=C.length){var y=u.samplesPerFrame*9e4/u.sampleRate,m=o+s*y,p={unit:C.subarray(h,h+u.frameLength),pts:m,dts:m};return A.config=[],A.channelCount=u.channelCount,A.samplerate=u.sampleRate,A.samples.push(p),{sample:p,length:u.frameLength,missing:0}}}function M(A,C){var h=A[C+1]>>3&3,o=A[C+1]>>1&3,s=A[C+2]>>4&15,u=A[C+2]>>2&3;if(h!==1&&s!==0&&s!==15&&u!==3){var y=A[C+2]>>1&1,m=A[C+3]>>6,p=h===3?3-o:o===3?3:4,D=_[p*14+s-1]*1e3,b=h===3?0:h===2?1:2,c=R[b*3+u],d=m===3?1:2,l=W[h][o],a=F[o],v=l*8*a,f=Math.floor(l*D/c+y)*a;if(V===null){var E=navigator.userAgent||"",P=E.match(/Chrome\/(\d+)/i);V=P?parseInt(P[1]):0}var H=!!V&&V<=87;return H&&o===2&&D>=224e3&&m===0&&(A[C+3]=A[C+3]|128),{sampleRate:c,channelCount:d,frameLength:f,samplesPerFrame:v}}}function g(A,C){return A[C]===255&&(A[C+1]&224)===224&&(A[C+1]&6)!==0}function S(A,C){return C+1<A.length&&g(A,C)}function I(A,C){var h=4;return g(A,C)&&h<=A.length-C}function w(A,C){if(C+1<A.length&&g(A,C)){var h=4,o=M(A,C),s=h;o!=null&&o.frameLength&&(s=o.frameLength);var u=C+s;return u===A.length||S(A,u)}return!1}},"./src/demux/sample-aes.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/crypt/decrypter.ts"),_=k("./src/demux/tsdemuxer.ts"),R=function(){function W(O,M,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new V.default(O,M,{removePKCS7Padding:!1})}var F=W.prototype;return F.decryptBuffer=function(M,g){this.decrypter.decrypt(M,this.keyData.key.buffer,this.keyData.iv.buffer,g)},F.decryptAacSample=function(M,g,S,I){var w=M[g].unit,A=w.subarray(16,w.length-w.length%16),C=A.buffer.slice(A.byteOffset,A.byteOffset+A.length),h=this;this.decryptBuffer(C,function(o){var s=new Uint8Array(o);w.set(s,16),I||h.decryptAacSamples(M,g+1,S)})},F.decryptAacSamples=function(M,g,S){for(;;g++){if(g>=M.length){S();return}if(M[g].unit.length<32)continue;var I=this.decrypter.isSync();if(this.decryptAacSample(M,g,S,I),!I)return}},F.getAvcEncryptedData=function(M){for(var g=Math.floor((M.length-48)/160)*16+16,S=new Int8Array(g),I=0,w=32;w<=M.length-16;w+=160,I+=16)S.set(M.subarray(w,w+16),I);return S},F.getAvcDecryptedUnit=function(M,g){for(var S=new Uint8Array(g),I=0,w=32;w<=M.length-16;w+=160,I+=16)M.set(S.subarray(I,I+16),w);return M},F.decryptAvcSample=function(M,g,S,I,w,A){var C=Object(_.discardEPB)(w.data),h=this.getAvcEncryptedData(C),o=this;this.decryptBuffer(h.buffer,function(s){w.data=o.getAvcDecryptedUnit(C,s),A||o.decryptAvcSamples(M,g,S+1,I)})},F.decryptAvcSamples=function(M,g,S,I){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,S=0){if(g>=M.length){I();return}for(var w=M[g].units;!(S>=w.length);S++){var A=w[S];if(A.data.length<=48||A.type!==1&&A.type!==5)continue;var C=this.decrypter.isSync();if(this.decryptAvcSample(M,g,S,I,A,C),!C)return}}},W}();Y.default=R},"./src/demux/transmuxer-interface.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return w});var V=k("./node_modules/webworkify-webpack/index.js"),_=k.n(V),R=k("./src/events.ts"),W=k("./src/demux/transmuxer.ts"),F=k("./src/utils/logger.ts"),O=k("./src/errors.ts"),M=k("./src/utils/mediasource-helper.ts"),g=k("./node_modules/eventemitter3/index.js"),S=k.n(g),I=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},w=function(){function A(h,o,s,u){var y=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=h,this.id=o,this.onTransmuxComplete=s,this.onFlush=u;var m=h.config,p=function(l,a){a=a||{},a.frag=y.frag,a.id=y.id,h.trigger(l,a)};this.observer=new g.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,p),this.observer.on(R.Events.ERROR,p);var D={mp4:I.isTypeSupported("video/mp4"),mpeg:I.isTypeSupported("audio/mpeg"),mp3:I.isTypeSupported('audio/mp4; codecs="mp3"')},b=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var c;try{c=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),c.addEventListener("message",this.onwmsg),c.onerror=function(d){h.trigger(R.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(d.message+" ("+d.filename+":"+d.lineno+")")})},c.postMessage({cmd:"init",typeSupported:D,vendor:b,id:o,config:JSON.stringify(m)})}catch(d){F.logger.warn("Error in worker:",d),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new W.default(this.observer,D,m,b,o),this.worker=null}}else this.transmuxer=new W.default(this.observer,D,m,b,o)}var C=A.prototype;return C.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.observer=null},C.push=function(o,s,u,y,m,p,D,b,c,d){var l=this;c.transmuxing.start=self.performance.now();var a=this.transmuxer,v=this.worker,f=p?p.start:m.start,E=m.decryptdata,P=this.frag,H=!(P&&m.cc===P.cc),Q=!(P&&c.level===P.level),re=P?c.sn-P.sn:-1,z=this.part?c.part-this.part.index:1,U=!Q&&(re===1||re===0&&z===1),ae=self.performance.now();(Q||re||m.stats.parsing.start===0)&&(m.stats.parsing.start=ae),p&&(z||!U)&&(p.stats.parsing.start=ae);var fe=new W.TransmuxState(H,U,b,Q,f);if(!U||H){F.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+`
discontinuity: `+H+`
trackSwitch: `+Q+`
contiguous: `+U+`
accurateTimeOffset: `+b+`
timeOffset: `+f);var ge=new W.TransmuxConfig(u,y,s,D,d);this.configureTransmuxer(ge)}if(this.frag=m,this.part=p,v)v.postMessage({cmd:"demux",data:o,decryptdata:E,chunkMeta:c,state:fe},o instanceof ArrayBuffer?[o]:[]);else if(a){var Ee=a.push(o,E,c,fe);Object(W.isPromise)(Ee)?Ee.then(function(Ne){l.handleTransmuxComplete(Ne)}):this.handleTransmuxComplete(Ee)}},C.flush=function(o){var s=this;o.transmuxing.start=self.performance.now();var u=this.transmuxer,y=this.worker;if(y)y.postMessage({cmd:"flush",chunkMeta:o});else if(u){var m=u.flush(o);Object(W.isPromise)(m)?m.then(function(p){s.handleFlushResult(p,o)}):this.handleFlushResult(m,o)}},C.handleFlushResult=function(o,s){var u=this;o.forEach(function(y){u.handleTransmuxComplete(y)}),this.onFlush(s)},C.onWorkerMessage=function(o){var s=o.data,u=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,u.trigger(s.event,s.data);break}}},C.configureTransmuxer=function(o){var s=this.worker,u=this.transmuxer;s?s.postMessage({cmd:"configure",config:o}):u&&u.configure(o)},C.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},A}()},"./src/demux/transmuxer-worker.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return O});var V=k("./src/demux/transmuxer.ts"),_=k("./src/events.ts"),R=k("./src/utils/logger.ts"),W=k("./node_modules/eventemitter3/index.js"),F=k.n(W);function O(w){var A=new W.EventEmitter,C=function(o,s){w.postMessage({event:o,data:s})};A.on(_.Events.FRAG_DECRYPTED,C),A.on(_.Events.ERROR,C),w.addEventListener("message",function(h){var o=h.data;switch(o.cmd){case"init":{var s=JSON.parse(o.config);w.transmuxer=new V.default(A,o.typeSupported,s,o.vendor,o.id),Object(R.enableLogs)(s.debug),C("init",null);break}case"configure":{w.transmuxer.configure(o.config);break}case"demux":{var u=w.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(V.isPromise)(u)?u.then(function(p){M(w,p)}):M(w,u);break}case"flush":{var y=o.chunkMeta,m=w.transmuxer.flush(y);Object(V.isPromise)(m)?m.then(function(p){S(w,p,y)}):S(w,m,y);break}default:break}})}function M(w,A){if(I(A.remuxResult))return;var C=[],h=A.remuxResult,o=h.audio,s=h.video;o&&g(C,o),s&&g(C,s),w.postMessage({event:"transmuxComplete",data:A},C)}function g(w,A){A.data1&&w.push(A.data1.buffer),A.data2&&w.push(A.data2.buffer)}function S(w,A,C){A.forEach(function(h){M(w,h)}),w.postMessage({event:"flush",data:C})}function I(w){return!w.audio&&!w.video&&!w.text&&!w.id3&&!w.initSegment}},"./src/demux/transmuxer.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return s}),k.d(Y,"isPromise",function(){return m}),k.d(Y,"TransmuxConfig",function(){return p}),k.d(Y,"TransmuxState",function(){return D});var V=k("./src/events.ts"),_=k("./src/errors.ts"),R=k("./src/crypt/decrypter.ts"),W=k("./src/demux/aacdemuxer.ts"),F=k("./src/demux/mp4demuxer.ts"),O=k("./src/demux/tsdemuxer.ts"),M=k("./src/demux/mp3demuxer.ts"),g=k("./src/remux/mp4-remuxer.ts"),S=k("./src/remux/passthrough-remuxer.ts"),I=k("./src/demux/chunk-cache.ts"),w=k("./src/utils/mp4-tools.ts"),A=k("./src/utils/logger.ts"),C;try{C=self.performance.now.bind(self.performance)}catch(b){A.logger.debug("Unable to use Performance API on this environment"),C=self.Date.now}var h=[{demux:O.default,remux:g.default},{demux:F.default,remux:S.default},{demux:W.default,remux:g.default},{demux:M.default,remux:g.default}],o=1024;h.forEach(function(b){var c=b.demux;o=Math.max(o,c.minProbeByteLength)});var s=function(){function b(d,l,a,v,f){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 I.default,this.observer=d,this.typeSupported=l,this.config=a,this.vendor=v,this.id=f}var c=b.prototype;return c.configure=function(l){this.transmuxConfig=l,this.decrypter&&this.decrypter.reset()},c.push=function(l,a,v,f){var E=this,P=v.transmuxing;P.executeStart=C();var H=new Uint8Array(l),Q=this.cache,re=this.config,z=this.currentTransmuxState,U=this.transmuxConfig;f&&(this.currentTransmuxState=f);var ae=u(H,a);if(ae&&ae.method==="AES-128"){var fe=this.getDecrypter();if(re.enableSoftwareAES){var ge=fe.softwareDecrypt(H,ae.key.buffer,ae.iv.buffer);if(!ge)return P.executeEnd=C(),y(v);H=new Uint8Array(ge)}else return this.decryptionPromise=fe.webCryptoDecrypt(H,ae.key.buffer,ae.iv.buffer).then(function(be){var Te=E.push(be,null,v);return E.decryptionPromise=null,Te}),this.decryptionPromise}var Ee=f||z,Ne=Ee.contiguous,Se=Ee.discontinuity,Ie=Ee.trackSwitch,Ae=Ee.accurateTimeOffset,we=Ee.timeOffset,ve=U.audioCodec,j=U.videoCodec,T=U.defaultInitPts,L=U.duration,G=U.initSegmentData;if((Se||Ie)&&this.resetInitSegment(G,ve,j,L),Se&&this.resetInitialTimestamp(T),Ne||this.resetContiguity(),this.needsProbing(H,Se,Ie)){if(Q.dataLength){var q=Q.flush();H=Object(w.appendUint8Array)(q,H)}this.configureTransmuxer(H,U)}var N=this.transmux(H,ae,we,Ae,v),ue=this.currentTransmuxState;return ue.contiguous=!0,ue.discontinuity=!1,ue.trackSwitch=!1,P.executeEnd=C(),N},c.flush=function(l){var a=this,v=l.transmuxing;v.executeStart=C();var f=this.decrypter,E=this.cache,P=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return a.flush(l)});var Q=[],re=P.timeOffset;if(f){var z=f.flush();z&&Q.push(this.push(z,null,l))}var U=E.dataLength;E.reset();var ae=this.demuxer,fe=this.remuxer;if(!ae||!fe)return U>=o&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=C(),[y(l)];var ge=ae.flush(re);return m(ge)?ge.then(function(Ee){return a.flushRemux(Q,Ee,l),Q}):(this.flushRemux(Q,ge,l),Q)},c.flushRemux=function(l,a,v){var f=a.audioTrack,E=a.avcTrack,P=a.id3Track,H=a.textTrack,Q=this.currentTransmuxState,re=Q.accurateTimeOffset,z=Q.timeOffset;A.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var U=this.remuxer.remux(f,E,P,H,z,re,!0,this.id);l.push({remuxResult:U,chunkMeta:v}),v.transmuxing.executeEnd=C()},c.resetInitialTimestamp=function(l){var a=this.demuxer,v=this.remuxer;if(!a||!v)return;a.resetTimeStamp(l),v.resetTimeStamp(l)},c.resetContiguity=function(){var l=this.demuxer,a=this.remuxer;if(!l||!a)return;l.resetContiguity(),a.resetNextTimestamp()},c.resetInitSegment=function(l,a,v,f){var E=this.demuxer,P=this.remuxer;if(!E||!P)return;E.resetInitSegment(a,v,f),P.resetInitSegment(l,a,v)},c.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},c.transmux=function(l,a,v,f,E){var P;return a&&a.method==="SAMPLE-AES"?P=this.transmuxSampleAes(l,a,v,f,E):P=this.transmuxUnencrypted(l,v,f,E),P},c.transmuxUnencrypted=function(l,a,v,f){var E=this.demuxer.demux(l,a,!1,!this.config.progressive),P=E.audioTrack,H=E.avcTrack,Q=E.id3Track,re=E.textTrack,z=this.remuxer.remux(P,H,Q,re,a,v,!1,this.id);return{remuxResult:z,chunkMeta:f}},c.transmuxSampleAes=function(l,a,v,f,E){var P=this;return this.demuxer.demuxSampleAes(l,a,v).then(function(H){var Q=P.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,v,f,!1,P.id);return{remuxResult:Q,chunkMeta:E}})},c.configureTransmuxer=function(l,a){for(var v=this.config,f=this.observer,E=this.typeSupported,P=this.vendor,H=a.audioCodec,Q=a.defaultInitPts,re=a.duration,z=a.initSegmentData,U=a.videoCodec,ae,fe=0,ge=h.length;fe<ge;fe++)if(h[fe].demux.probe(l)){ae=h[fe];break}ae||(A.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),ae={demux:F.default,remux:S.default});var Ee=this.demuxer,Ne=this.remuxer,Se=ae.remux,Ie=ae.demux;(!Ne||!(Ne instanceof Se))&&(this.remuxer=new Se(f,v,E,P)),(!Ee||!(Ee instanceof Ie))&&(this.demuxer=new Ie(f,v,E),this.probe=Ie.probe),this.resetInitSegment(z,H,U,re),this.resetInitialTimestamp(Q)},c.needsProbing=function(l,a,v){return!this.demuxer||!this.remuxer||a||v},c.getDecrypter=function(){var l=this.decrypter;return l||(l=this.decrypter=new R.default(this.observer,this.config)),l},b}();function u(b,c){var d=null;return b.byteLength>0&&c!=null&&c.key!=null&&c.iv!==null&&c.method!=null&&(d=c),d}var y=function(c){return{remuxResult:{},chunkMeta:c}};function m(b){return"then"in b&&b.then instanceof Function}var p=function(c,d,l,a,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=c,this.videoCodec=d,this.initSegmentData=l,this.duration=a,this.defaultInitPts=v},D=function(c,d,l,a,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=c,this.contiguous=d,this.accurateTimeOffset=l,this.trackSwitch=a,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"discardEPB",function(){return y});var V=k("./src/demux/adts.ts"),_=k("./src/demux/mpegaudio.ts"),R=k("./src/demux/exp-golomb.ts"),W=k("./src/demux/id3.ts"),F=k("./src/demux/sample-aes.ts"),O=k("./src/events.ts"),M=k("./src/utils/mp4-tools.ts"),g=k("./src/utils/logger.ts"),S=k("./src/errors.ts"),I={video:1,audio:2,id3:3,text:4},w=function(){function m(D,b,c){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=D,this.config=b,this.typeSupported=c}m.probe=function(b){var c=m.syncOffset(b);return c<0?!1:(c&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+c+", junk ahead ?"),!0)},m.syncOffset=function(b){for(var c=Math.min(1e3,b.length-3*188),d=0;d<c;){if(b[d]===71&&b[d+188]===71&&b[d+2*188]===71)return d;d++}return-1},m.createTrack=function(b,c){return{container:b==="video"||b==="audio"?"video/mp2t":void 0,type:b,id:I[b],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:b==="audio"?c:void 0}};var p=m.prototype;return p.resetInitSegment=function(b,c,d){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",d),this._audioTrack=m.createTrack("audio",d),this._id3Track=m.createTrack("id3",d),this._txtTrack=m.createTrack("text",d),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=b,this.videoCodec=c,this._duration=d},p.resetTimeStamp=function(){},p.resetContiguity=function(){var b=this._audioTrack,c=this._avcTrack,d=this._id3Track;b&&(b.pesData=null),c&&(c.pesData=null),d&&(d.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},p.demux=function(b,c,d,l){d===void 0&&(d=!1),l===void 0&&(l=!1),d||(this.sampleAes=null);var a,v=this._avcTrack,f=this._audioTrack,E=this._id3Track,P=v.pid,H=v.pesData,Q=f.pid,re=E.pid,z=f.pesData,U=E.pesData,ae=!1,fe=this.pmtParsed,ge=this._pmtId,Ee=b.length;if(this.remainderData&&(b=Object(M.appendUint8Array)(this.remainderData,b),Ee=b.length,this.remainderData=null),Ee<188&&!l)return this.remainderData=b,{audioTrack:f,avcTrack:v,id3Track:E,textTrack:this._txtTrack};var Ne=Math.max(0,m.syncOffset(b));Ee-=(Ee+Ne)%188,Ee<b.byteLength&&!l&&(this.remainderData=new Uint8Array(b.buffer,Ee,b.buffer.byteLength-Ee));for(var Se=Ne;Se<Ee;Se+=188)if(b[Se]===71){var Ie=!!(b[Se+1]&64),Ae=((b[Se+1]&31)<<8)+b[Se+2],we=(b[Se+3]&48)>>4,ve=void 0;if(we>1){if(ve=Se+5+b[Se+4],ve===Se+188)continue}else ve=Se+4;switch(Ae){case P:Ie&&(H&&(a=o(H))&&this.parseAVCPES(a,!1),H={data:[],size:0}),H&&(H.data.push(b.subarray(ve,Se+188)),H.size+=Se+188-ve);break;case Q:Ie&&(z&&(a=o(z))&&(f.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),z={data:[],size:0}),z&&(z.data.push(b.subarray(ve,Se+188)),z.size+=Se+188-ve);break;case re:Ie&&(U&&(a=o(U))&&this.parseID3PES(a),U={data:[],size:0}),U&&(U.data.push(b.subarray(ve,Se+188)),U.size+=Se+188-ve);break;case 0:Ie&&(ve+=b[ve]+1),ge=this._pmtId=C(b,ve);break;case ge:{Ie&&(ve+=b[ve]+1);var j=h(b,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,d);P=j.avc,P>0&&(v.pid=P),Q=j.audio,Q>0&&(f.pid=Q,f.isAAC=j.isAAC),re=j.id3,re>0&&(E.pid=re),ae&&!fe&&(g.logger.log("reparse from beginning"),ae=!1,Se=Ne-188),fe=this.pmtParsed=!0;break}case 17:case 8191:break;default:ae=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=H,f.pesData=z,E.pesData=U;var T={audioTrack:f,avcTrack:v,id3Track:E,textTrack:this._txtTrack};return l&&this.extractRemainingSamples(T),T},p.flush=function(){var b=this.remainderData;this.remainderData=null;var c;return b?c=this.demux(b,-1,!1,!0):c={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(c),this.sampleAes?this.decrypt(c,this.sampleAes):c},p.extractRemainingSamples=function(b){var c=b.audioTrack,d=b.avcTrack,l=b.id3Track,a=d.pesData,v=c.pesData,f=l.pesData,E;a&&(E=o(a))?(this.parseAVCPES(E,!0),d.pesData=null):d.pesData=a,v&&(E=o(v))?(c.isAAC?this.parseAACPES(E):this.parseMPEGPES(E),c.pesData=null):(v!=null&&v.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),c.pesData=v),f&&(E=o(f))?(this.parseID3PES(E),l.pesData=null):l.pesData=f},p.demuxSampleAes=function(b,c,d){var l=this.demux(b,d,!0,!this.config.progressive),a=this.sampleAes=new F.default(this.observer,this.config,c);return this.decrypt(l,a)},p.decrypt=function(b,c){return new Promise(function(d){var l=b.audioTrack,a=b.avcTrack;l.samples&&l.isAAC?c.decryptAacSamples(l.samples,0,function(){a.samples?c.decryptAvcSamples(a.samples,0,0,function(){d(b)}):d(b)}):a.samples&&c.decryptAvcSamples(a.samples,0,0,function(){d(b)})})},p.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},p.parseAVCPES=function(b,c){var d=this,l=this._avcTrack,a=this.parseAVCNALu(b.data),v=!1,f=this.avcSample,E,P=!1;b.data=null,f&&a.length&&!l.audFound&&(s(f,l),f=this.avcSample=A(!1,b.pts,b.dts,"")),a.forEach(function(H){switch(H.type){case 1:{E=!0,f||(f=d.avcSample=A(!0,b.pts,b.dts,"")),v&&(f.debug+="NDR "),f.frame=!0;var Q=H.data;if(P&&Q.length>4){var re=new R.default(Q).readSliceType();(re===2||re===4||re===7||re===9)&&(f.key=!0)}break}case 5:E=!0,f||(f=d.avcSample=A(!0,b.pts,b.dts,"")),v&&(f.debug+="IDR "),f.key=!0,f.frame=!0;break;case 6:{E=!0,v&&f&&(f.debug+="SEI ");var z=new R.default(y(H.data));z.readUByte();for(var U=0,ae=0,fe=!1,ge=0;!fe&&z.bytesAvailable>1;){U=0;do ge=z.readUByte(),U+=ge;while(ge===255);ae=0;do ge=z.readUByte(),ae+=ge;while(ge===255);if(U===4&&z.bytesAvailable!==0){fe=!0;var Ee=z.readUByte();if(Ee===181){var Ne=z.readUShort();if(Ne===49){var Se=z.readUInt();if(Se===1195456820){var Ie=z.readUByte();if(Ie===3){for(var Ae=z.readUByte(),we=z.readUByte(),ve=31&Ae,j=[Ae,we],T=0;T<ve;T++)j.push(z.readUByte()),j.push(z.readUByte()),j.push(z.readUByte());u(d._txtTrack.samples,{type:3,pts:b.pts,bytes:j})}}}}}else if(U===5&&z.bytesAvailable!==0){if(fe=!0,ae>16){for(var L=[],G=0;G<16;G++)L.push(z.readUByte().toString(16)),(G===3||G===5||G===7||G===9)&&L.push("-");for(var q=ae-16,N=new Uint8Array(q),ue=0;ue<q;ue++)N[ue]=z.readUByte();u(d._txtTrack.samples,{pts:b.pts,payloadType:U,uuid:L.join(""),userData:Object(W.utf8ArrayToStr)(N),userDataBytes:N})}}else if(ae<z.bytesAvailable)for(var be=0;be<ae;be++)z.readUByte()}break}case 7:if(E=!0,P=!0,v&&f&&(f.debug+="SPS "),!l.sps){var Te=new R.default(H.data),Be=Te.readSPS();l.width=Be.width,l.height=Be.height,l.pixelRatio=Be.pixelRatio,l.sps=[H.data],l.duration=d._duration;for(var ke=H.data.subarray(1,4),Oe="avc1.",_e=0;_e<3;_e++){var Ge=ke[_e].toString(16);Ge.length<2&&(Ge="0"+Ge),Oe+=Ge}l.codec=Oe}break;case 8:E=!0,v&&f&&(f.debug+="PPS "),l.pps||(l.pps=[H.data]);break;case 9:E=!1,l.audFound=!0,f&&s(f,l),f=d.avcSample=A(!1,b.pts,b.dts,v?"AUD ":"");break;case 12:E=!1;break;default:E=!1,f&&(f.debug+="unknown NAL "+H.type+" ");break}if(f&&E){var Ve=f.units;Ve.push(H)}}),c&&f&&(s(f,l),this.avcSample=null)},p.getLastNalUnit=function(){var b,c=this.avcSample,d;if(!c||c.units.length===0){var l=this._avcTrack.samples;c=l[l.length-1]}if((b=c)!==null&&b!==void 0&&b.units){var a=c.units;d=a[a.length-1]}return d},p.parseAVCNALu=function(b){var c=b.byteLength,d=this._avcTrack,l=d.naluState||0,a=l,v=[],f=0,E,P,H,Q=-1,re=0;for(l===-1&&(Q=0,re=b[0]&31,l=0,f=1);f<c;){if(E=b[f++],!l){l=E?0:1;continue}if(l===1){l=E?0:2;continue}if(!E)l=3;else if(E===1){if(Q>=0){var z={data:b.subarray(Q,f-l-1),type:re};v.push(z)}else{var U=this.getLastNalUnit();if(U&&(a&&f<=4-a&&(U.state&&(U.data=U.data.subarray(0,U.data.byteLength-a))),P=f-l-1,P>0)){var ae=new Uint8Array(U.data.byteLength+P);ae.set(U.data,0),ae.set(b.subarray(0,P),U.data.byteLength),U.data=ae,U.state=0}}f<c?(H=b[f]&31,Q=f,re=H,l=0):l=-1}else l=0}if(Q>=0&&l>=0){var fe={data:b.subarray(Q,c),type:re,state:l};v.push(fe)}if(v.length===0){var ge=this.getLastNalUnit();if(ge){var Ee=new Uint8Array(ge.data.byteLength+b.byteLength);Ee.set(ge.data,0),Ee.set(b,ge.data.byteLength),ge.data=Ee}}return d.naluState=l,v},p.parseAACPES=function(b){var c=0,d=this._audioTrack,l=this.aacOverFlow,a=b.data;if(l){this.aacOverFlow=null;var v=l.sample.unit.byteLength,f=Math.min(l.missing,v),E=v-f;l.sample.unit.set(a.subarray(0,f),E),d.samples.push(l.sample),c=l.missing}var P,H;for(P=c,H=a.length;P<H-1&&!V.isHeader(a,P);P++);if(P!==c){var Q,re;if(P<H-1?(Q="AAC PES did not start with ADTS header,offset:"+P,re=!1):(Q="no ADTS header found in AAC PES",re=!0),g.logger.warn("parsing error:"+Q),this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.FRAG_PARSING_ERROR,fatal:re,reason:Q}),re)return}V.initTrackConfig(d,this.observer,a,P,this.audioCodec);var z;if(b.pts!==void 0)z=b.pts;else if(l){var U=V.getFrameDuration(d.samplerate);z=l.sample.pts+U}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var ae=0;P<H;)if(V.isHeader(a,P)){if(P+5<H){var fe=V.appendFrame(d,a,P,z,ae);if(fe)if(fe.missing)this.aacOverFlow=fe;else{P+=fe.length,ae++;continue}}break}else P++},p.parseMPEGPES=function(b){var c=b.data,d=c.length,l=0,a=0,v=b.pts;if(v===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<d;)if(_.isHeader(c,a)){var f=_.appendFrame(this._audioTrack,c,a,v,l);if(f)a+=f.length,l++;else break}else a++},p.parseID3PES=function(b){if(b.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(b)},m}();w.minProbeByteLength=188;function A(m,p,D,b){return{key:m,frame:!1,pts:p,dts:D,units:[],debug:b,length:0}}function C(m,p){return(m[p+10]&31)<<8|m[p+11]}function h(m,p,D,b){var c={audio:-1,avc:-1,id3:-1,isAAC:!0},d=(m[p+1]&15)<<8|m[p+2],l=p+3+d-4,a=(m[p+10]&15)<<8|m[p+11];for(p+=12+a;p<l;){var v=(m[p+1]&31)<<8|m[p+2];switch(m[p]){case 207:if(!b){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:c.audio===-1&&(c.audio=v);break;case 21:c.id3===-1&&(c.id3=v);break;case 219:if(!b){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:c.avc===-1&&(c.avc=v);break;case 3:case 4:D?c.audio===-1&&(c.audio=v,c.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}p+=((m[p+3]&15)<<8|m[p+4])+5}return c}function o(m){var p=0,D,b,c,d,l,a=m.data;if(!m||m.size===0)return null;for(;a[0].length<19&&a.length>1;){var v=new Uint8Array(a[0].length+a[1].length);v.set(a[0]),v.set(a[1],a[0].length),a[0]=v,a.splice(1,1)}D=a[0];var f=(D[0]<<16)+(D[1]<<8)+D[2];if(f===1){if(b=(D[4]<<8)+D[5],b&&b>m.size-6)return null;var E=D[7];E&192&&(d=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,E&64?(l=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,d-l>60*9e4&&(g.logger.warn(Math.round((d-l)/9e4)+"s delta between PTS and DTS, align them"),d=l)):l=d),c=D[8];var P=c+9;if(m.size<=P)return null;m.size-=P;for(var H=new Uint8Array(m.size),Q=0,re=a.length;Q<re;Q++){D=a[Q];var z=D.byteLength;if(P)if(P>z){P-=z;continue}else D=D.subarray(P),z-=P,P=0;H.set(D,p),p+=z}return b&&(b-=c+3),{data:H,pts:d,dts:l,len:b}}return null}function s(m,p){if(m.units.length&&m.frame){if(m.pts===void 0){var D=p.samples,b=D.length;if(b){var c=D[b-1];m.pts=c.pts,m.dts=c.dts}else{p.dropped++;return}}p.samples.push(m)}m.debug.length&&g.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function u(m,p){var D=m.length;if(D>0){if(p.pts>=m[D-1].pts)m.push(p);else for(var b=D-1;b>=0;b--)if(p.pts<m[b].pts){m.splice(b,0,p);break}}else m.push(p)}function y(m){for(var p=m.byteLength,D=[],b=1;b<p-2;)m[b]===0&&m[b+1]===0&&m[b+2]===3?(D.push(b+2),b+=2):b++;if(D.length===0)return m;var c=p-D.length,d=new Uint8Array(c),l=0;for(b=0;b<c;l++,b++)l===D[0]&&(l++,D.shift()),d[b]=m[l];return d}Y.default=w},"./src/errors.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"ErrorTypes",function(){return V}),k.d(Y,"ErrorDetails",function(){return _});var V;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(V||(V={}));var _;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(_||(_={}))},"./src/events.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"Events",function(){return V});var V;(function(_){_.MEDIA_ATTACHING="hlsMediaAttaching",_.MEDIA_ATTACHED="hlsMediaAttached",_.MEDIA_DETACHING="hlsMediaDetaching",_.MEDIA_DETACHED="hlsMediaDetached",_.BUFFER_RESET="hlsBufferReset",_.BUFFER_CODECS="hlsBufferCodecs",_.BUFFER_CREATED="hlsBufferCreated",_.BUFFER_APPENDING="hlsBufferAppending",_.BUFFER_APPENDED="hlsBufferAppended",_.BUFFER_EOS="hlsBufferEos",_.BUFFER_FLUSHING="hlsBufferFlushing",_.BUFFER_FLUSHED="hlsBufferFlushed",_.MANIFEST_LOADING="hlsManifestLoading",_.MANIFEST_LOADED="hlsManifestLoaded",_.MANIFEST_PARSED="hlsManifestParsed",_.LEVEL_SWITCHING="hlsLevelSwitching",_.LEVEL_SWITCHED="hlsLevelSwitched",_.LEVEL_LOADING="hlsLevelLoading",_.LEVEL_LOADED="hlsLevelLoaded",_.LEVEL_UPDATED="hlsLevelUpdated",_.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",_.LEVELS_UPDATED="hlsLevelsUpdated",_.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",_.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",_.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",_.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",_.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",_.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",_.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",_.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",_.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",_.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",_.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",_.CUES_PARSED="hlsCuesParsed",_.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",_.INIT_PTS_FOUND="hlsInitPtsFound",_.FRAG_LOADING="hlsFragLoading",_.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",_.FRAG_LOADED="hlsFragLoaded",_.FRAG_DECRYPTED="hlsFragDecrypted",_.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",_.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",_.FRAG_PARSING_METADATA="hlsFragParsingMetadata",_.FRAG_PARSED="hlsFragParsed",_.FRAG_BUFFERED="hlsFragBuffered",_.FRAG_CHANGED="hlsFragChanged",_.FPS_DROP="hlsFpsDrop",_.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",_.ERROR="hlsError",_.DESTROYING="hlsDestroying",_.KEY_LOADING="hlsKeyLoading",_.KEY_LOADED="hlsKeyLoaded",_.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",_.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return m});var V=k("./node_modules/url-toolkit/src/url-toolkit.js"),_=k.n(V),R=k("./src/loader/playlist-loader.ts"),W=k("./src/loader/key-loader.ts"),F=k("./src/controller/id3-track-controller.ts"),O=k("./src/controller/latency-controller.ts"),M=k("./src/controller/level-controller.ts"),g=k("./src/controller/fragment-tracker.ts"),S=k("./src/controller/stream-controller.ts"),I=k("./src/is-supported.ts"),w=k("./src/utils/logger.ts"),A=k("./src/config.ts"),C=k("./node_modules/eventemitter3/index.js"),h=k.n(C),o=k("./src/events.ts"),s=k("./src/errors.ts");function u(p,D){for(var b=0;b<D.length;b++){var c=D[b];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(p,c.key,c)}}function y(p,D,b){return D&&u(p.prototype,D),b&&u(p,b),p}var m=function(){p.isSupported=function(){return Object(I.isSupported)()};function p(b){b===void 0&&(b={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new C.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 c=this.config=Object(A.mergeConfig)(p.DefaultConfig,b);this.userConfig=b,Object(w.enableLogs)(c.debug),this._autoLevelCapping=-1,c.progressive&&Object(A.enableStreamingMode)(c);var d=c.abrController,l=c.bufferController,a=c.capLevelController,v=c.fpsController,f=this.abrController=new d(this),E=this.bufferController=new l(this),P=this.capLevelController=new a(this),H=new v(this),Q=new R.default(this),re=new W.default(this),z=new F.default(this),U=this.levelController=new M.default(this),ae=new g.FragmentTracker(this),fe=this.streamController=new S.default(this,ae);P.setStreamController(fe),H.setStreamController(fe);var ge=[U,fe];this.networkControllers=ge;var Ee=[Q,re,f,E,P,H,z,ae];this.audioTrackController=this.createController(c.audioTrackController,null,ge),this.createController(c.audioStreamController,ae,ge),this.subtitleTrackController=this.createController(c.subtitleTrackController,null,ge),this.createController(c.subtitleStreamController,ae,ge),this.createController(c.timelineController,null,Ee),this.emeController=this.createController(c.emeController,null,Ee),this.cmcdController=this.createController(c.cmcdController,null,Ee),this.latencyController=this.createController(O.default,null,Ee),this.coreComponents=Ee}var D=p.prototype;return D.createController=function(c,d,l){if(c){var a=d?new c(this,d):new c(this);return l&&l.push(a),a}return null},D.on=function(c,d,l){l===void 0&&(l=this),this._emitter.on(c,d,l)},D.once=function(c,d,l){l===void 0&&(l=this),this._emitter.once(c,d,l)},D.removeAllListeners=function(c){this._emitter.removeAllListeners(c)},D.off=function(c,d,l,a){l===void 0&&(l=this),this._emitter.off(c,d,l,a)},D.listeners=function(c){return this._emitter.listeners(c)},D.emit=function(c,d,l){return this._emitter.emit(c,d,l)},D.trigger=function(c,d){if(this.config.debug)return this.emit(c,c,d);try{return this.emit(c,c,d)}catch(l){w.logger.error("An internal error happened while handling event "+c+'. Error message: "'+l.message+'". Here is a stacktrace:',l),this.trigger(o.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:c,error:l})}return!1},D.listenerCount=function(c){return this._emitter.listenerCount(c)},D.destroy=function(){w.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(c){return c.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(c){return c.destroy()}),this.coreComponents.length=0},D.attachMedia=function(c){w.logger.log("attachMedia"),this._media=c,this.trigger(o.Events.MEDIA_ATTACHING,{media:c})},D.detachMedia=function(){w.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(c){this.stopLoad();var d=this.media,l=this.url,a=this.url=V.buildAbsoluteURL(self.location.href,c,{alwaysNormalize:!0});w.logger.log("loadSource:"+a),d&&l&&l!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(d)),this.trigger(o.Events.MANIFEST_LOADING,{url:c})},D.startLoad=function(c){c===void 0&&(c=-1),w.logger.log("startLoad("+c+")"),this.networkControllers.forEach(function(d){d.startLoad(c)})},D.stopLoad=function(){w.logger.log("stopLoad"),this.networkControllers.forEach(function(c){c.stopLoad()})},D.swapAudioCodec=function(){w.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){w.logger.log("recoverMediaError");var c=this._media;this.detachMedia(),c&&this.attachMedia(c)},D.removeLevel=function(c,d){d===void 0&&(d=0),this.levelController.removeLevel(c,d)},y(p,[{key:"levels",get:function(){var c=this.levelController.levels;return c||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(c){w.logger.log("set currentLevel:"+c),this.loadLevel=c,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(c){w.logger.log("set nextLevel:"+c),this.levelController.manualLevel=c,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(c){w.logger.log("set loadLevel:"+c),this.levelController.manualLevel=c}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(c){this.levelController.nextLoadLevel=c}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(c){w.logger.log("set firstLevel:"+c),this.levelController.firstLevel=c}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(c){w.logger.log("set startLevel:"+c),c!==-1&&(c=Math.max(c,this.minAutoLevel)),this.levelController.startLevel=c}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(c){var d=!!c;d!==this.config.capLevelToPlayerSize&&(d?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=d)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(c){this._autoLevelCapping!==c&&(w.logger.log("set autoLevelCapping:"+c),this._autoLevelCapping=c)}},{key:"bandwidthEstimate",get:function(){var c=this.abrController.bwEstimator;return c?c.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var c=this.levels,d=this.config.minAutoBitrate;if(!c)return 0;for(var l=c.length,a=0;a<l;a++)if(c[a].maxBitrate>d)return a;return 0}},{key:"maxAutoLevel",get:function(){var c=this.levels,d=this.autoLevelCapping,l;return d===-1&&c&&c.length?l=c.length-1:l=d,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(c){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,c)}},{key:"audioTracks",get:function(){var c=this.audioTrackController;return c?c.audioTracks:[]}},{key:"audioTrack",get:function(){var c=this.audioTrackController;return c?c.audioTrack:-1},set:function(c){var d=this.audioTrackController;d&&(d.audioTrack=c)}},{key:"subtitleTracks",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTrack:-1},set:function(c){var d=this.subtitleTrackController;d&&(d.subtitleTrack=c)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var c=this.subtitleTrackController;return c?c.subtitleDisplay:!1},set:function(c){var d=this.subtitleTrackController;d&&(d.subtitleDisplay=c)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(c){this.config.lowLatencyMode=c}},{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 s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return p.defaultConfig?p.defaultConfig:A.hlsDefaultConfig},set:function(c){p.defaultConfig=c}}]),p}();m.defaultConfig=void 0},"./src/is-supported.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"isSupported",function(){return R}),k.d(Y,"changeTypeSupported",function(){return W});var V=k("./src/utils/mediasource-helper.ts");function _(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var F=Object(V.getMediaSource)();if(!F)return!1;var O=_(),M=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!M&&!!g}function W(){var F,O=_();return typeof(O==null||((F=O.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return w}),k.d(Y,"LoadError",function(){return C});var V=k("./src/polyfills/number.ts"),_=k("./src/errors.ts");function R(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,g(h,o)}function W(h){var o=typeof Map=="function"?new Map:void 0;return W=function(u){if(u===null||!M(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(u))return o.get(u);o.set(u,y)}function y(){return F(u,arguments,S(this).constructor)}return y.prototype=Object.create(u.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g(y,u)},W(h)}function F(h,o,s){return O()?F=Reflect.construct:F=function(y,m,p){var D=[null];D.push.apply(D,m);var b=Function.bind.apply(y,D),c=new b;return p&&g(c,p.prototype),c},F.apply(null,arguments)}function O(){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(h){return!1}}function M(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function g(h,o){return g=Object.setPrototypeOf||function(u,y){return u.__proto__=y,u},g(h,o)}function S(h){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},S(h)}var I=Math.pow(2,17),w=function(){function h(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var o=h.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(u,y){var m=this,p=u.url;if(!p)return Promise.reject(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,networkDetails:null},"Fragment does not have a "+(p?"part list":"url")));this.abort();var D=this.config,b=D.fLoader,c=D.loader;return new Promise(function(d,l){m.loader&&m.loader.destroy();var a=m.loader=u.loader=b?new b(D):new c(D),v=A(u),f={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:I};u.stats=a.stats,a.load(v,f,{onSuccess:function(P,H,Q,re){m.resetLoader(u,a),d({frag:u,part:null,payload:P.data,networkDetails:re})},onError:function(P,H,Q){m.resetLoader(u,a),l(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:P,networkDetails:Q}))},onAbort:function(P,H,Q){m.resetLoader(u,a),l(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:Q}))},onTimeout:function(P,H,Q){m.resetLoader(u,a),l(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:Q}))},onProgress:function(P,H,Q,re){y&&y({frag:u,part:null,payload:Q,networkDetails:re})}})})},o.loadPart=function(u,y,m){var p=this;this.abort();var D=this.config,b=D.fLoader,c=D.loader;return new Promise(function(d,l){p.loader&&p.loader.destroy();var a=p.loader=u.loader=b?new b(D):new c(D),v=A(u,y),f={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:I};y.stats=a.stats,a.load(v,f,{onSuccess:function(P,H,Q,re){p.resetLoader(u,a),p.updateStatsFromPart(u,y);var z={frag:u,part:y,payload:P.data,networkDetails:re};m(z),d(z)},onError:function(P,H,Q){p.resetLoader(u,a),l(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:y,response:P,networkDetails:Q}))},onAbort:function(P,H,Q){u.stats.aborted=y.stats.aborted,p.resetLoader(u,a),l(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:y,networkDetails:Q}))},onTimeout:function(P,H,Q){p.resetLoader(u,a),l(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:y,networkDetails:Q}))}})})},o.updateStatsFromPart=function(u,y){var m=u.stats,p=y.stats,D=p.total;if(m.loaded+=p.loaded,D){var b=Math.round(u.duration/y.duration),c=Math.min(Math.round(m.loaded/D),b),d=b-c,l=d*Math.round(m.loaded/c);m.total=m.loaded+l}else m.total=Math.max(m.loaded,m.total);var a=m.loading,v=p.loading;a.start?a.first+=v.first-v.start:(a.start=v.start,a.first=v.first),a.end=v.end},o.resetLoader=function(u,y){u.loader=null,this.loader===y&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),y.destroy()},h}();function A(h,o){o===void 0&&(o=null);var s=o||h,u={frag:h,part:o,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},y=s.byteRangeStartOffset,m=s.byteRangeEndOffset;return Object(V.isFiniteNumber)(y)&&Object(V.isFiniteNumber)(m)&&(u.rangeStart=y,u.rangeEnd=m),u}var C=function(h){R(o,h);function o(s){for(var u,y=arguments.length,m=new Array(y>1?y-1:0),p=1;p<y;p++)m[p-1]=arguments[p];return u=h.call.apply(h,[this].concat(m))||this,u.data=void 0,u.data=s,u}return o}(W(Error))},"./src/loader/fragment.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"ElementaryStreamTypes",function(){return w}),k.d(Y,"BaseSegment",function(){return A}),k.d(Y,"Fragment",function(){return C}),k.d(Y,"Part",function(){return h});var V=k("./src/polyfills/number.ts"),_=k("./node_modules/url-toolkit/src/url-toolkit.js"),R=k.n(_),W=k("./src/utils/logger.ts"),F=k("./src/loader/level-key.ts"),O=k("./src/loader/load-stats.ts");function M(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,g(o,s)}function g(o,s){return g=Object.setPrototypeOf||function(y,m){return y.__proto__=m,y},g(o,s)}function S(o,s){for(var u=0;u<s.length;u++){var y=s[u];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(o,y.key,y)}}function I(o,s,u){return s&&S(o.prototype,s),u&&S(o,u),o}var w;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(w||(w={}));var A=function(){function o(u){var y;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(y={},y[w.AUDIO]=null,y[w.VIDEO]=null,y[w.AUDIOVIDEO]=null,y),this.baseurl=u}var s=o.prototype;return s.setByteRange=function(y,m){var p=y.split("@",2),D=[];p.length===1?D[0]=m?m.byteRangeEndOffset:0:D[0]=parseInt(p[1]),D[1]=parseInt(p[0])+D[0],this._byteRange=D},I(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(_.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(y){this._url=y}}]),o}(),C=function(o){M(s,o);function s(y,m){var p;return p=o.call(this,m)||this,p._decryptdata=null,p.rawProgramDateTime=null,p.programDateTime=null,p.tagList=[],p.duration=0,p.sn=0,p.levelkey=void 0,p.type=void 0,p.loader=null,p.level=-1,p.cc=0,p.startPTS=void 0,p.endPTS=void 0,p.appendedPTS=void 0,p.startDTS=void 0,p.endDTS=void 0,p.start=0,p.deltaPTS=void 0,p.maxStartPTS=void 0,p.minEndPTS=void 0,p.stats=new O.LoadStats,p.urlId=0,p.data=void 0,p.bitrateTest=!1,p.title=null,p.initSegment=null,p.type=y,p}var u=s.prototype;return u.createInitializationVector=function(m){for(var p=new Uint8Array(16),D=12;D<16;D++)p[D]=m>>8*(15-D)&255;return p},u.setDecryptDataFromLevelKey=function(m,p){var D=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(D=F.LevelKey.fromURI(m.uri),D.method=m.method,D.iv=this.createInitializationVector(p),D.keyFormat="identity"),D},u.setElementaryStreamInfo=function(m,p,D,b,c,d){d===void 0&&(d=!1);var l=this.elementaryStreams,a=l[m];if(!a){l[m]={startPTS:p,endPTS:D,startDTS:b,endDTS:c,partial:d};return}a.startPTS=Math.min(a.startPTS,p),a.endPTS=Math.max(a.endPTS,D),a.startDTS=Math.min(a.startDTS,b),a.endDTS=Math.max(a.endDTS,c)},u.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[w.AUDIO]=null,m[w.VIDEO]=null,m[w.AUDIOVIDEO]=null},I(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var m=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),s}(A),h=function(o){M(s,o);function s(u,y,m,p,D){var b;b=o.call(this,m)||this,b.fragOffset=0,b.duration=0,b.gap=!1,b.independent=!1,b.relurl=void 0,b.fragment=void 0,b.index=void 0,b.stats=new O.LoadStats,b.duration=u.decimalFloatingPoint("DURATION"),b.gap=u.bool("GAP"),b.independent=u.bool("INDEPENDENT"),b.relurl=u.enumeratedString("URI"),b.fragment=y,b.index=p;var c=u.enumeratedString("BYTERANGE");return c&&b.setByteRange(c,D),D&&(b.fragOffset=D.fragOffset+D.duration),b}return I(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var y=this.elementaryStreams;return!!(y.audio||y.video||y.audiovideo)}}]),s}(A)},"./src/loader/key-loader.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return W});var V=k("./src/events.ts"),_=k("./src/errors.ts"),R=k("./src/utils/logger.ts"),W=function(){function F(M){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=M,this._registerListeners()}var O=F.prototype;return O._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var S=this.loaders[g];S&&S.destroy()}this.loaders={}},O.onKeyLoading=function(g,S){var I=S.frag,w=I.type,A=this.loaders[w];if(!I.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var C=I.decryptdata.uri;if(C!==this.decrypturl||this.decryptkey===null){var h=this.hls.config;if(A&&(R.logger.warn("abort previous key loader for type:"+w),A.abort()),!C){R.logger.warn("key uri is falsy");return}var o=h.loader,s=I.loader=this.loaders[w]=new o(h);this.decrypturl=C,this.decryptkey=null;var u={url:C,frag:I,responseType:"arraybuffer"},y={timeout:h.fragLoadingTimeOut,maxRetry:0,retryDelay:h.fragLoadingRetryDelay,maxRetryDelay:h.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(u,y,m)}else this.decryptkey&&(I.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:I}))},O.loadsuccess=function(g,S,I){var w=I.frag;if(!w.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=w.decryptdata.key=new Uint8Array(g.data),w.loader=null,delete this.loaders[w.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:w})},O.loaderror=function(g,S){var I=S.frag,w=I.loader;w&&w.abort(),delete this.loaders[I.type],this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:I,response:g})},O.loadtimeout=function(g,S){var I=S.frag,w=I.loader;w&&w.abort(),delete this.loaders[I.type],this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:I})},F}()},"./src/loader/level-details.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"LevelDetails",function(){return F});var V=k("./src/polyfills/number.ts");function _(O,M){for(var g=0;g<M.length;g++){var S=M[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(O,S.key,S)}}function R(O,M,g){return M&&_(O.prototype,M),g&&_(O,g),O}var W=10,F=function(){function O(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var M=O.prototype;return M.reloaded=function(S){if(!S){this.advanced=!0,this.updated=!0;return}var I=this.lastPartSn-S.lastPartSn,w=this.lastPartIndex-S.lastPartIndex;this.updated=this.endSN!==S.endSN||!!w||!!I,this.advanced=this.endSN>S.endSN||I>0||I===0&&w>0,this.updated||this.advanced?this.misses=Math.floor(S.misses*.6):this.misses=S.misses+1,this.availabilityDelay=S.availabilityDelay},R(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var S=this.driftEndTime-this.driftStartTime;if(S>0){var I=this.driftEnd-this.driftStart;return I*1e3/S}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var S;return(S=this.partList)!==null&&S!==void 0&&S.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var S;return(S=this.fragments)!==null&&S!==void 0&&S.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 S;return(S=this.partList)!==null&&S!==void 0&&S.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var S;return(S=this.partList)!==null&&S!==void 0&&S.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"LevelKey",function(){return F});var V=k("./node_modules/url-toolkit/src/url-toolkit.js"),_=k.n(V);function R(O,M){for(var g=0;g<M.length;g++){var S=M[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(O,S.key,S)}}function W(O,M,g){return M&&R(O.prototype,M),g&&R(O,g),O}var F=function(){O.fromURL=function(g,S){return new O(g,S)},O.fromURI=function(g){return new O(g)};function O(M,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(V.buildAbsoluteURL)(M,g,{alwaysNormalize:!0}):this._uri=M}return W(O,[{key:"uri",get:function(){return this._uri}}]),O}()},"./src/loader/load-stats.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"LoadStats",function(){return V});var V=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(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return s});var V=k("./src/polyfills/number.ts"),_=k("./node_modules/url-toolkit/src/url-toolkit.js"),R=k.n(_),W=k("./src/loader/fragment.ts"),F=k("./src/loader/level-details.ts"),O=k("./src/loader/level-key.ts"),M=k("./src/utils/attr-list.ts"),g=k("./src/utils/logger.ts"),S=k("./src/utils/codecs.ts"),I=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,w=/#EXT-X-MEDIA:(.*)/g,A=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),C=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("|")),h=/\.(mp4|m4s|m4v|m4a)$/i;function o(D){var b,c;return h.test((b=(c=_.parseURL(D))===null||c===void 0?void 0:c.path)!=null?b:"")}var s=function(){function D(){}return D.findGroup=function(c,d){for(var l=0;l<c.length;l++){var a=c[l];if(a.id===d)return a}},D.convertAVC1ToAVCOTI=function(c){var d=c.split(".");if(d.length>2){var l=d.shift()+".";return l+=parseInt(d.shift()).toString(16),l+=("000"+parseInt(d.shift()).toString(16)).substr(-4),l}return c},D.resolve=function(c,d){return _.buildAbsoluteURL(d,c,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(c,d){var l=[],a={},v=!1;I.lastIndex=0;for(var f;(f=I.exec(c))!=null;)if(f[1]){var E=new M.AttrList(f[1]),P={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:D.resolve(f[2],d)},H=E.decimalResolution("RESOLUTION");H&&(P.width=H.width,P.height=H.height),u((E.CODECS||"").split(/[ ,]+/).filter(function(re){return re}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=D.convertAVC1ToAVCOTI(P.videoCodec)),l.push(P)}else if(f[3]){var Q=new M.AttrList(f[3]);Q["DATA-ID"]&&(v=!0,a[Q["DATA-ID"]]=Q)}return{levels:l,sessionData:v?a:null}},D.parseMasterPlaylistMedia=function(c,d,l,a){a===void 0&&(a=[]);var v,f=[],E=0;for(w.lastIndex=0;(v=w.exec(c))!==null;){var P=new M.AttrList(v[1]);if(P.TYPE===l){var H={attrs:P,bitrate:0,id:E++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:l,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?D.resolve(P.URI,d):""};if(a.length){var Q=D.findGroup(a,H.groupId)||a[0];y(H,Q,"audioCodec"),y(H,Q,"textCodec")}f.push(H)}}return f},D.parseLevelPlaylist=function(c,d,l,a,v){var f=new F.LevelDetails(d),E=f.fragments,P=null,H=0,Q=0,re=0,z=0,U=null,ae=new W.Fragment(a,d),fe,ge,Ee,Ne=-1,Se=!1;for(A.lastIndex=0,f.m3u8=c;(fe=A.exec(c))!==null;){Se&&(Se=!1,ae=new W.Fragment(a,d),ae.start=re,ae.sn=H,ae.cc=z,ae.level=l,P&&(ae.initSegment=P,ae.rawProgramDateTime=P.rawProgramDateTime));var Ie=fe[1];if(Ie){ae.duration=parseFloat(Ie);var Ae=(" "+fe[2]).slice(1);ae.title=Ae||null,ae.tagList.push(Ae?["INF",Ie,Ae]:["INF",Ie])}else if(fe[3])Object(V.isFiniteNumber)(ae.duration)&&(ae.start=re,Ee&&(ae.levelkey=Ee),ae.sn=H,ae.level=l,ae.cc=z,ae.urlId=v,E.push(ae),ae.relurl=(" "+fe[3]).slice(1),p(ae,U),U=ae,re+=ae.duration,H++,Q=0,Se=!0);else if(fe[4]){var we=(" "+fe[4]).slice(1);U?ae.setByteRange(we,U):ae.setByteRange(we)}else if(fe[5])ae.rawProgramDateTime=(" "+fe[5]).slice(1),ae.tagList.push(["PROGRAM-DATE-TIME",ae.rawProgramDateTime]),Ne===-1&&(Ne=E.length);else{if(fe=fe[0].match(C),!fe){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ge=1;ge<fe.length&&!(typeof fe[ge]!="undefined");ge++);var ve=(" "+fe[ge]).slice(1),j=(" "+fe[ge+1]).slice(1),T=fe[ge+2]?(" "+fe[ge+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":f.type=j.toUpperCase();break;case"MEDIA-SEQUENCE":H=f.startSN=parseInt(j);break;case"SKIP":{var L=new M.AttrList(j),G=L.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(G)){f.skippedSegments=G;for(var q=G;q--;)E.unshift(null);H+=G}var N=L.enumeratedString("RECENTLY-REMOVED-DATERANGES");N&&(f.recentlyRemovedDateranges=N.split(" "));break}case"TARGETDURATION":f.targetduration=parseFloat(j);break;case"VERSION":f.version=parseInt(j);break;case"EXTM3U":break;case"ENDLIST":f.live=!1;break;case"#":(j||T)&&ae.tagList.push(T?[j,T]:[j]);break;case"DIS":z++;case"GAP":ae.tagList.push([ve]);break;case"BITRATE":ae.tagList.push([ve,j]);break;case"DISCONTINUITY-SEQ":z=parseInt(j);break;case"KEY":{var ue,be=new M.AttrList(j),Te=be.enumeratedString("METHOD"),Be=be.URI,ke=be.hexadecimalInteger("IV"),Oe=be.enumeratedString("KEYFORMATVERSIONS"),_e=be.enumeratedString("KEYID"),Ge=(ue=be.enumeratedString("KEYFORMAT"))!=null?ue:"identity",Ve=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ve.indexOf(Ge)>-1){g.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;Te&&(Ee=O.LevelKey.fromURL(d,Be),Be&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Te)>=0&&(Ee.method=Te,Ee.keyFormat=Ge,_e&&(Ee.keyID=_e),Oe&&(Ee.keyFormatVersions=Oe),Ee.iv=ke));break}case"START":{var Qe=new M.AttrList(j),Ye=Qe.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(Ye)&&(f.startTimeOffset=Ye);break}case"MAP":{var ot=new M.AttrList(j);ae.relurl=ot.URI,ot.BYTERANGE&&ae.setByteRange(ot.BYTERANGE),ae.level=l,ae.sn="initSegment",Ee&&(ae.levelkey=Ee),ae.initSegment=null,P=ae,Se=!0;break}case"SERVER-CONTROL":{var Xe=new M.AttrList(j);f.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),f.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),f.canSkipDateRanges=f.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),f.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),f.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ze=new M.AttrList(j);f.partTarget=Ze.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=f.partList;De||(De=f.partList=[]);var it=Q>0?De[De.length-1]:void 0,$e=Q++,oe=new W.Part(new M.AttrList(j),ae,d,$e,it);De.push(oe),ae.duration+=oe.duration;break}case"PRELOAD-HINT":{var Z=new M.AttrList(j);f.preloadHint=Z;break}case"RENDITION-REPORT":{var J=new M.AttrList(j);f.renditionReports=f.renditionReports||[],f.renditionReports.push(J);break}default:g.logger.warn("line parsed but not handled: "+fe);break}}}U&&!U.relurl?(E.pop(),re-=U.duration,f.partList&&(f.fragmentHint=U)):f.partList&&(p(ae,U),ae.cc=z,f.fragmentHint=ae);var ne=E.length,se=E[0],ee=E[ne-1];if(re+=f.skippedSegments*f.targetduration,re>0&&ne&&ee){f.averagetargetduration=re/ne;var ie=ee.sn;f.endSN=ie!=="initSegment"?ie:0,se&&(f.startCC=se.cc,se.initSegment||f.fragments.every(function(le){return le.relurl&&o(le.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),ae=new W.Fragment(a,d),ae.relurl=ee.relurl,ae.level=l,ae.sn="initSegment",se.initSegment=ae,f.needSidxRanges=!0))}else f.endSN=0,f.startCC=0;return f.fragmentHint&&(re+=f.fragmentHint.duration),f.totalduration=re,f.endCC=z,Ne>0&&m(E,Ne),f},D}();function u(D,b){["video","audio","text"].forEach(function(c){var d=D.filter(function(a){return Object(S.isCodecType)(a,c)});if(d.length){var l=d.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});b[c+"Codec"]=l.length>0?l[0]:d[0],D=D.filter(function(a){return d.indexOf(a)===-1})}}),b.unknownCodecs=D}function y(D,b,c){var d=b[c];d&&(D[c]=d)}function m(D,b){for(var c=D[b],d=b;d--;){var l=D[d];if(!l)return;l.programDateTime=c.programDateTime-l.duration*1e3,c=l}}function p(D,b){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):b!=null&&b.programDateTime&&(D.programDateTime=b.endProgramDateTime),Object(V.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/polyfills/number.ts"),_=k("./src/events.ts"),R=k("./src/errors.ts"),W=k("./src/utils/logger.ts"),F=k("./src/utils/mp4-tools.ts"),O=k("./src/loader/m3u8-parser.ts"),M=k("./src/types/loader.ts"),g=k("./src/utils/attr-list.ts");function S(A){var C=A.type;switch(C){case M.PlaylistContextType.AUDIO_TRACK:return M.PlaylistLevelType.AUDIO;case M.PlaylistContextType.SUBTITLE_TRACK:return M.PlaylistLevelType.SUBTITLE;default:return M.PlaylistLevelType.MAIN}}function I(A,C){var h=A.url;return(h===void 0||h.indexOf("data:")===0)&&(h=C.url),h}var w=function(){function A(h){this.hls=void 0,this.loaders=Object.create(null),this.hls=h,this.registerListeners()}var C=A.prototype;return C.registerListeners=function(){var o=this.hls;o.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(_.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(_.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(_.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},C.unregisterListeners=function(){var o=this.hls;o.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(_.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(_.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(_.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},C.createInternalLoader=function(o){var s=this.hls.config,u=s.pLoader,y=s.loader,m=u||y,p=new m(s);return o.loader=p,this.loaders[o.type]=p,p},C.getInternalLoader=function(o){return this.loaders[o.type]},C.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},C.destroyInternalLoaders=function(){for(var o in this.loaders){var s=this.loaders[o];s&&s.destroy(),this.resetInternalLoader(o)}},C.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},C.onManifestLoading=function(o,s){var u=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:M.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},C.onLevelLoading=function(o,s){var u=s.id,y=s.level,m=s.url,p=s.deliveryDirectives;this.load({id:u,groupId:null,level:y,responseType:"text",type:M.PlaylistContextType.LEVEL,url:m,deliveryDirectives:p})},C.onAudioTrackLoading=function(o,s){var u=s.id,y=s.groupId,m=s.url,p=s.deliveryDirectives;this.load({id:u,groupId:y,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:p})},C.onSubtitleTrackLoading=function(o,s){var u=s.id,y=s.groupId,m=s.url,p=s.deliveryDirectives;this.load({id:u,groupId:y,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:p})},C.load=function(o){var s,u=this.hls.config,y=this.getInternalLoader(o);if(y){var m=y.context;if(m&&m.url===o.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),y.abort()}var p,D,b,c;switch(o.type){case M.PlaylistContextType.MANIFEST:p=u.manifestLoadingMaxRetry,D=u.manifestLoadingTimeOut,b=u.manifestLoadingRetryDelay,c=u.manifestLoadingMaxRetryTimeout;break;case M.PlaylistContextType.LEVEL:case M.PlaylistContextType.AUDIO_TRACK:case M.PlaylistContextType.SUBTITLE_TRACK:p=0,D=u.levelLoadingTimeOut;break;default:p=u.levelLoadingMaxRetry,D=u.levelLoadingTimeOut,b=u.levelLoadingRetryDelay,c=u.levelLoadingMaxRetryTimeout;break}if(y=this.createInternalLoader(o),(s=o.deliveryDirectives)!==null&&s!==void 0&&s.part){var d;if(o.type===M.PlaylistContextType.LEVEL&&o.level!==null?d=this.hls.levels[o.level].details:o.type===M.PlaylistContextType.AUDIO_TRACK&&o.id!==null?d=this.hls.audioTracks[o.id].details:o.type===M.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(d=this.hls.subtitleTracks[o.id].details),d){var l=d.partTarget,a=d.targetduration;l&&a&&(D=Math.min(Math.max(l*3,a*.8)*1e3,D))}}var v={timeout:D,maxRetry:p,retryDelay:b,maxRetryDelay:c,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};y.load(o,v,f)},C.loadsuccess=function(o,s,u,y){if(y===void 0&&(y=null),u.isSidxRequest){this.handleSidxRequest(o,u),this.handlePlaylistLoaded(o,s,u,y);return}this.resetInternalLoader(u.type);var m=o.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,u,"no EXTM3U delimiter",y);return}s.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,s,u,y):this.handleMasterPlaylist(o,s,u,y)},C.loaderror=function(o,s,u){u===void 0&&(u=null),this.handleNetworkError(s,u,!1,o)},C.loadtimeout=function(o,s,u){u===void 0&&(u=null),this.handleNetworkError(s,u,!0)},C.handleMasterPlaylist=function(o,s,u,y){var m=this.hls,p=o.data,D=I(o,u),b=O.default.parseMasterPlaylist(p,D),c=b.levels,d=b.sessionData;if(!c.length){this.handleManifestParsingError(o,u,"no level found in manifest",y);return}var l=c.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),a=c.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),v=O.default.parseMasterPlaylistMedia(p,D,"AUDIO",l),f=O.default.parseMasterPlaylistMedia(p,D,"SUBTITLES",a),E=O.default.parseMasterPlaylistMedia(p,D,"CLOSED-CAPTIONS");if(v.length){var P=v.some(function(H){return!H.url});!P&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}m.trigger(_.Events.MANIFEST_LOADED,{levels:c,audioTracks:v,subtitles:f,captions:E,url:D,stats:s,networkDetails:y,sessionData:d})},C.handleTrackOrLevelPlaylist=function(o,s,u,y){var m=this.hls,p=u.id,D=u.level,b=u.type,c=I(o,u),d=Object(V.isFiniteNumber)(p)?p:0,l=Object(V.isFiniteNumber)(D)?D:d,a=S(u),v=O.default.parseLevelPlaylist(o.data,c,l,a,d);if(!v.fragments.length){m.trigger(_.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:c,reason:"no fragments found in level",level:typeof u.level=="number"?u.level:void 0});return}if(b===M.PlaylistContextType.MANIFEST){var f={attrs:new g.AttrList({}),bitrate:0,details:v,name:"",url:c};m.trigger(_.Events.MANIFEST_LOADED,{levels:[f],audioTracks:[],url:c,stats:s,networkDetails:y,sessionData:null})}if(s.parsing.end=performance.now(),v.needSidxRanges){var E,P=(E=v.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:P,isSidxRequest:!0,type:b,level:D,levelDetails:v,id:p,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=v,this.handlePlaylistLoaded(o,s,u,y)},C.handleSidxRequest=function(o,s){var u=Object(F.parseSegmentIndex)(new Uint8Array(o.data));if(!u)return;var y=u.references,m=s.levelDetails;y.forEach(function(p,D){var b=p.info,c=m.fragments[D];c.byteRange.length===0&&c.setByteRange(String(1+b.end-b.start)+"@"+String(b.start)),c.initSegment&&c.initSegment.setByteRange(String(u.moovEndOffset)+"@0")})},C.handleManifestParsingError=function(o,s,u,y){this.hls.trigger(_.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===M.PlaylistContextType.MANIFEST,url:o.url,reason:u,response:o,context:s,networkDetails:y})},C.handleNetworkError=function(o,s,u,y){u===void 0&&(u=!1),W.logger.warn("[playlist-loader]: A network "+(u?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var m=R.ErrorDetails.UNKNOWN,p=!1,D=this.getInternalLoader(o);switch(o.type){case M.PlaylistContextType.MANIFEST:m=u?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,p=!0;break;case M.PlaylistContextType.LEVEL:m=u?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,p=!1;break;case M.PlaylistContextType.AUDIO_TRACK:m=u?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,p=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:m=u?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,p=!1;break}D&&this.resetInternalLoader(o.type);var b={type:R.ErrorTypes.NETWORK_ERROR,details:m,fatal:p,url:o.url,loader:D,context:o,networkDetails:s};y&&(b.response=y),this.hls.trigger(_.Events.ERROR,b)},C.handlePlaylistLoaded=function(o,s,u,y){var m=u.type,p=u.level,D=u.id,b=u.groupId,c=u.loader,d=u.levelDetails,l=u.deliveryDirectives;if(!(d!=null&&d.targetduration)){this.handleManifestParsingError(o,u,"invalid target duration",y);return}if(!c)return;d.live&&(c.getCacheAge&&(d.ageHeader=c.getCacheAge()||0),(!c.getCacheAge||isNaN(d.ageHeader))&&(d.ageHeader=0));switch(m){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(_.Events.LEVEL_LOADED,{details:d,level:p||0,id:D||0,stats:s,networkDetails:y,deliveryDirectives:l});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(_.Events.AUDIO_TRACK_LOADED,{details:d,id:D||0,groupId:b||"",stats:s,networkDetails:y,deliveryDirectives:l});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(_.Events.SUBTITLE_TRACK_LOADED,{details:d,id:D||0,groupId:b||"",stats:s,networkDetails:y,deliveryDirectives:l});break}},A}();Y.default=w},"./src/polyfills/number.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"isFiniteNumber",function(){return V}),k.d(Y,"MAX_SAFE_INTEGER",function(){return _});var V=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},_=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(he,Y,k){"use strict";k.r(Y);var V=function(){function _(){}return _.getSilentFrame=function(W,F){switch(W){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===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(F===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(F===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(F===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(F===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},_}();Y.default=V},"./src/remux/mp4-generator.ts":function(he,Y,k){"use strict";k.r(Y);var V=Math.pow(2,32)-1,_=function(){function R(){}return R.init=function(){R.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var F;for(F in R.types)R.types.hasOwnProperty(F)&&(R.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var O=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]),M=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);R.HDLR_TYPES={video:O,audio:M};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),S=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=S,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var I=new Uint8Array([105,115,111,109]),w=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,I,A,I,w),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,g))},R.box=function(F){for(var O=8,M=arguments.length,g=new Array(M>1?M-1:0),S=1;S<M;S++)g[S-1]=arguments[S];for(var I=g.length,w=I;I--;)O+=g[I].byteLength;var A=new Uint8Array(O);for(A[0]=O>>24&255,A[1]=O>>16&255,A[2]=O>>8&255,A[3]=O&255,A.set(F,4),I=0,O=8;I<w;I++)A.set(g[I],O),O+=g[I].byteLength;return A},R.hdlr=function(F){return R.box(R.types.hdlr,R.HDLR_TYPES[F])},R.mdat=function(F){return R.box(R.types.mdat,F)},R.mdhd=function(F,O){O*=F;var M=Math.floor(O/(V+1)),g=Math.floor(O%(V+1));return R.box(R.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,M>>24,M>>16&255,M>>8&255,M&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},R.mdia=function(F){return R.box(R.types.mdia,R.mdhd(F.timescale,F.duration),R.hdlr(F.type),R.minf(F))},R.mfhd=function(F){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},R.minf=function(F){return F.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(F)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(F))},R.moof=function(F,O,M){return R.box(R.types.moof,R.mfhd(F),R.traf(M,O))},R.moov=function(F){for(var O=F.length,M=[];O--;)M[O]=R.trak(F[O]);return R.box.apply(null,[R.types.moov,R.mvhd(F[0].timescale,F[0].duration)].concat(M).concat(R.mvex(F)))},R.mvex=function(F){for(var O=F.length,M=[];O--;)M[O]=R.trex(F[O]);return R.box.apply(null,[R.types.mvex].concat(M))},R.mvhd=function(F,O){O*=F;var M=Math.floor(O/(V+1)),g=Math.floor(O%(V+1)),S=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,M>>24,M>>16&255,M>>8&255,M&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return R.box(R.types.mvhd,S)},R.sdtp=function(F){var O=F.samples||[],M=new Uint8Array(4+O.length),g,S;for(g=0;g<O.length;g++)S=O[g].flags,M[g+4]=S.dependsOn<<4|S.isDependedOn<<2|S.hasRedundancy;return R.box(R.types.sdtp,M)},R.stbl=function(F){return R.box(R.types.stbl,R.stsd(F),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(F){var O=[],M=[],g,S,I;for(g=0;g<F.sps.length;g++)S=F.sps[g],I=S.byteLength,O.push(I>>>8&255),O.push(I&255),O=O.concat(Array.prototype.slice.call(S));for(g=0;g<F.pps.length;g++)S=F.pps[g],I=S.byteLength,M.push(I>>>8&255),M.push(I&255),M=M.concat(Array.prototype.slice.call(S));var w=R.box(R.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|F.sps.length].concat(O).concat([F.pps.length]).concat(M))),A=F.width,C=F.height,h=F.pixelRatio[0],o=F.pixelRatio[1];return R.box(R.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,A>>8&255,A&255,C>>8&255,C&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]),w,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&255])))},R.esds=function(F){var O=F.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(F.config).concat([6,1,2]))},R.mp4a=function(F){var O=F.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),R.box(R.types.esds,R.esds(F)))},R.mp3=function(F){var O=F.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},R.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(F)):R.box(R.types.stsd,R.STSD,R.mp4a(F)):R.box(R.types.stsd,R.STSD,R.avc1(F))},R.tkhd=function(F){var O=F.id,M=F.duration*F.timescale,g=F.width,S=F.height,I=Math.floor(M/(V+1)),w=Math.floor(M%(V+1));return R.box(R.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,w>>24,w>>16&255,w>>8&255,w&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,S>>8&255,S&255,0,0]))},R.traf=function(F,O){var M=R.sdtp(F),g=F.id,S=Math.floor(O/(V+1)),I=Math.floor(O%(V+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,S>>24,S>>16&255,S>>8&255,S&255,I>>24,I>>16&255,I>>8&255,I&255])),R.trun(F,M.length+16+20+8+16+8+8),M)},R.trak=function(F){return F.duration=F.duration||4294967295,R.box(R.types.trak,R.tkhd(F),R.mdia(F))},R.trex=function(F){var O=F.id;return R.box(R.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},R.trun=function(F,O){var M=F.samples||[],g=M.length,S=12+16*g,I=new Uint8Array(S),w,A,C,h,o,s;for(O+=8+S,I.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),w=0;w<g;w++)A=M[w],C=A.duration,h=A.size,o=A.flags,s=A.cts,I.set([C>>>24&255,C>>>16&255,C>>>8&255,C&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*w);return R.box(R.types.trun,I)},R.initSegment=function(F){R.types||R.init();var O=R.moov(F),M=new Uint8Array(R.FTYP.byteLength+O.byteLength);return M.set(R.FTYP),M.set(O,R.FTYP.byteLength),M},R}();_.types=void 0,_.HDLR_TYPES=void 0,_.STTS=void 0,_.STSC=void 0,_.STCO=void 0,_.STSZ=void 0,_.VMHD=void 0,_.SMHD=void 0,_.STSD=void 0,_.FTYP=void 0,_.DINF=void 0,Y.default=_},"./src/remux/mp4-remuxer.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return s}),k.d(Y,"normalizePts",function(){return u});var V=k("./src/polyfills/number.ts"),_=k("./src/remux/aac-helper.ts"),R=k("./src/remux/mp4-generator.ts"),W=k("./src/events.ts"),F=k("./src/errors.ts"),O=k("./src/utils/logger.ts"),M=k("./src/types/loader.ts"),g=k("./src/utils/timescale-conversion.ts");function S(){return S=Object.assign||function(D){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(D[d]=c[d])}return D},S.apply(this,arguments)}var I=10*1e3,w=1024,A=1152,C=null,h=null,o=!1,s=function(){function D(c,d,l,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=c,this.config=d,this.typeSupported=l,this.ISGenerated=!1,C===null){var v=navigator.userAgent||"",f=v.match(/Chrome\/(\d+)/i);C=f?parseInt(f[1]):0}if(h===null){var E=navigator.userAgent.match(/Safari\/(\d+)/i);h=E?parseInt(E[1]):0}o=!!C&&C<75||!!h&&h<600}var b=D.prototype;return b.destroy=function(){},b.resetTimeStamp=function(d){O.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=d},b.resetNextTimestamp=function(){O.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},b.resetInitSegment=function(){O.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},b.getVideoStartPts=function(d){var l=!1,a=d.reduce(function(v,f){var E=f.pts-v;return E<-4294967296?(l=!0,u(v,f.pts)):E>0?v:f.pts},d[0].pts);return l&&O.logger.debug("PTS rollover detected"),a},b.remux=function(d,l,a,v,f,E,P,H){var Q,re,z,U,ae,fe,ge=f,Ee=f,Ne=d.pid>-1,Se=l.pid>-1,Ie=l.samples.length,Ae=d.samples.length>0,we=Ie>1,ve=(!Ne||Ae)&&(!Se||we)||this.ISGenerated||P;if(ve){this.ISGenerated||(z=this.generateIS(d,l,f));var j=this.isVideoContiguous,T=-1;if(we&&(T=y(l.samples),!j&&this.config.forceKeyFrameOnDiscontinuity))if(fe=!0,T>0){O.logger.warn("[mp4-remuxer]: Dropped "+T+" out of "+Ie+" video samples due to a missing keyframe");var L=this.getVideoStartPts(l.samples);l.samples=l.samples.slice(T),l.dropped+=T,Ee+=(l.samples[0].pts-L)/(l.timescale||9e4)}else T===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ie+" video samples"),fe=!1);if(this.ISGenerated){if(Ae&&we){var G=this.getVideoStartPts(l.samples),q=u(d.samples[0].pts,G)-G,N=q/l.inputTimeScale;ge+=Math.max(0,N),Ee+=Math.max(0,-N)}if(Ae){if(d.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(d,l,f)),re=this.remuxAudio(d,ge,this.isAudioContiguous,E,Se||we||H===M.PlaylistLevelType.AUDIO?Ee:void 0),we){var ue=re?re.endPTS-re.startPTS:0;l.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(d,l,f)),Q=this.remuxVideo(l,Ee,j,ue)}}else we&&(Q=this.remuxVideo(l,Ee,j,0));Q&&(Q.firstKeyFrame=T,Q.independent=T!==-1)}}return this.ISGenerated&&(a.samples.length&&(ae=this.remuxID3(a,f)),v.samples.length&&(U=this.remuxText(v,f))),{audio:re,video:Q,initSegment:z,independent:fe,text:U,id3:ae}},b.generateIS=function(d,l,a){var v=d.samples,f=l.samples,E=this.typeSupported,P={},H=!Object(V.isFiniteNumber)(this._initPTS),Q="audio/mp4",re,z,U;if(H&&(re=z=Infinity),d.config&&v.length&&(d.timescale=d.samplerate,d.isAAC||(E.mpeg?(Q="audio/mpeg",d.codec=""):E.mp3&&(d.codec="mp3")),P.audio={id:"audio",container:Q,codec:d.codec,initSegment:!d.isAAC&&E.mpeg?new Uint8Array(0):R.default.initSegment([d]),metadata:{channelCount:d.channelCount}},H&&(U=d.inputTimeScale,re=z=v[0].pts-Math.round(U*a))),l.sps&&l.pps&&f.length&&(l.timescale=l.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:l.codec,initSegment:R.default.initSegment([l]),metadata:{width:l.width,height:l.height}},H)){U=l.inputTimeScale;var ae=this.getVideoStartPts(f),fe=Math.round(U*a);z=Math.min(z,u(f[0].dts,ae)-fe),re=Math.min(re,ae-fe)}if(Object.keys(P).length)return this.ISGenerated=!0,H&&(this._initPTS=re,this._initDTS=z),{tracks:P,initPTS:re,timescale:U}},b.remuxVideo=function(d,l,a,v){var f=d.inputTimeScale,E=d.samples,P=[],H=E.length,Q=this._initPTS,re=this.nextAvcDts,z=8,U,ae,fe,ge=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,Ne=0,Se=!1;if(!a||re===null){var Ie=l*f,Ae=E[0].pts-u(E[0].dts,E[0].pts);re=Ie-Ae}for(var we=0;we<H;we++){var ve=E[we];if(ve.pts=u(ve.pts-Q,re),ve.dts=u(ve.dts-Q,re),ve.dts>ve.pts){var j=9e4*.2;Ne=Math.max(Math.min(Ne,ve.pts-ve.dts),-1*j)}ve.dts<E[we>0?we-1:we].dts&&(Se=!0)}Se&&E.sort(function(vt,st){var nt=vt.dts-st.dts,Tt=vt.pts-st.pts;return nt||Tt}),ae=E[0].dts,fe=E[E.length-1].dts;var T=Math.round((fe-ae)/(H-1));if(Ne<0){if(Ne<T*-2){O.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-T,!0)+" ms");for(var L=Ne,G=0;G<H;G++)E[G].dts=L=Math.max(L,E[G].pts-T),E[G].pts=Math.max(L,E[G].pts)}else{O.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(Ne,!0)+" ms to overcome this issue");for(var q=0;q<H;q++)E[q].dts=E[q].dts+Ne}ae=E[0].dts}if(a){var N=ae-re,ue=N>T,be=N<-1;if(ue||be){ue?O.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(N,!0)+" ms ("+N+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-N,!0)+" ms ("+N+"dts) overlapping between fragments detected"),ae=re;var Te=E[0].pts-N;E[0].dts=ae,E[0].pts=Te,O.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Te,!0)+"/"+Object(g.toMsFromMpegTsClock)(ae,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(N,!0)+" ms")}}o&&(ae=Math.max(0,ae));for(var Be=0,ke=0,Oe=0;Oe<H;Oe++){for(var _e=E[Oe],Ge=_e.units,Ve=Ge.length,Qe=0,Ye=0;Ye<Ve;Ye++)Qe+=Ge[Ye].data.length;ke+=Qe,Be+=Ve,_e.length=Qe,_e.dts=Math.max(_e.dts,ae),_e.pts=Math.max(_e.pts,_e.dts,0),ge=Math.min(_e.pts,ge),Ee=Math.max(_e.pts,Ee)}fe=E[H-1].dts;var ot=ke+4*Be+8,Xe;try{Xe=new Uint8Array(ot)}catch(vt){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ot,reason:"fail allocating video mdat "+ot});return}var Ze=new DataView(Xe.buffer);Ze.setUint32(0,ot),Xe.set(R.default.types.mdat,4);for(var De=0;De<H;De++){for(var it=E[De],$e=it.units,oe=0,Z=0,J=$e.length;Z<J;Z++){var ne=$e[Z],se=ne.data,ee=ne.data.byteLength;Ze.setUint32(z,ee),z+=4,Xe.set(se,z),z+=ee,oe+=4+ee}if(De<H-1)U=E[De+1].dts-it.dts;else{var ie=this.config,le=it.dts-E[De>0?De-1:De].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var de=Math.floor(ie.maxBufferHole*f),me=(v?ge+v*f:this.nextAudioPts)-it.pts;me>de?(U=me-le,U<0&&(U=le),O.logger.log("[mp4-remuxer]: It is approximately "+me/90+" ms to the next segment; using duration "+U/90+" ms for the last video frame.")):U=le}else U=le}var ye=Math.round(it.pts-it.dts);P.push(new m(it.key,U,oe,ye))}if(P.length&&C&&C<70){var Le=P[0].flags;Le.dependsOn=2,Le.isNonSync=0}console.assert(U!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=re=fe+U,this.isVideoContiguous=!0;var He=R.default.moof(d.sequenceNumber++,ae,S({},d,{samples:P})),et="video",rt={data1:He,data2:Xe,startPTS:ge/f,endPTS:(Ee+U)/f,startDTS:ae/f,endDTS:re/f,type:et,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:d.dropped};return d.samples=[],d.dropped=0,console.assert(Xe.length,"MDAT length must not be zero"),rt},b.remuxAudio=function(d,l,a,v,f){var E=d.inputTimeScale,P=d.samplerate?d.samplerate:E,H=E/P,Q=d.isAAC?w:A,re=Q*H,z=this._initPTS,U=!d.isAAC&&this.typeSupported.mpeg,ae=[],fe=d.samples,ge=U?0:8,Ee=this.nextAudioPts||-1,Ne=l*E;if(this.isAudioContiguous=a=a||fe.length&&Ee>0&&(v&&Math.abs(Ne-Ee)<9e3||Math.abs(u(fe[0].pts-z,Ne)-Ee)<20*re),fe.forEach(function(se){se.pts=u(se.pts-z,Ne)}),!a||Ee<0){if(fe=fe.filter(function(se){return se.pts>=0}),!fe.length)return;f===0?Ee=0:v?Ee=Math.max(0,Ne):Ee=fe[0].pts}if(d.isAAC)for(var Se=f!==void 0,Ie=this.config.maxAudioFramesDrift,Ae=0,we=Ee;Ae<fe.length;Ae++){var ve=fe[Ae],j=ve.pts,T=j-we,L=Math.abs(1e3*T/E);if(T<=-Ie*re&&Se)Ae===0&&(O.logger.warn("Audio frame @ "+(j/E).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*T/E)+" ms."),this.nextAudioPts=Ee=we=j);else if(T>=Ie*re&&L<I&&Se){var G=Math.round(T/re);we=j-G*re,we<0&&(G--,we+=re),Ae===0&&(this.nextAudioPts=Ee=we),O.logger.warn("[mp4-remuxer]: Injecting "+G+" audio frame @ "+(we/E).toFixed(3)+"s due to "+Math.round(1e3*T/E)+" ms gap.");for(var q=0;q<G;q++){var N=Math.max(we,0),ue=_.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);ue||(O.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ue=ve.unit.subarray()),fe.splice(Ae,0,{unit:ue,pts:N}),we+=re,Ae++}}ve.pts=we,we+=re}for(var be=null,Te=null,Be,ke=0,Oe=fe.length;Oe--;)ke+=fe[Oe].unit.byteLength;for(var _e=0,Ge=fe.length;_e<Ge;_e++){var Ve=fe[_e],Qe=Ve.unit,Ye=Ve.pts;if(Te!==null){var ot=ae[_e-1];ot.duration=Math.round((Ye-Te)/H)}else if(a&&d.isAAC&&(Ye=Ee),be=Ye,ke>0){ke+=ge;try{Be=new Uint8Array(ke)}catch(se){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ke,reason:"fail allocating audio mdat "+ke});return}if(!U){var Xe=new DataView(Be.buffer);Xe.setUint32(0,ke),Be.set(R.default.types.mdat,4)}}else return;Be.set(Qe,ge);var Ze=Qe.byteLength;ge+=Ze,ae.push(new m(!0,Q,Ze,0)),Te=Ye}var De=ae.length;if(!De)return;var it=ae[ae.length-1];this.nextAudioPts=Ee=Te+H*it.duration;var $e=U?new Uint8Array(0):R.default.moof(d.sequenceNumber++,be/H,S({},d,{samples:ae}));d.samples=[];var oe=be/E,Z=Ee/E,J="audio",ne={data1:$e,data2:Be,startPTS:oe,endPTS:Z,startDTS:oe,endDTS:Z,type:J,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(Be.length,"MDAT length must not be zero"),ne},b.remuxEmptyAudio=function(d,l,a,v){var f=d.inputTimeScale,E=d.samplerate?d.samplerate:f,P=f/E,H=this.nextAudioPts,Q=(H!==null?H:v.startDTS*f)+this._initDTS,re=v.endDTS*f+this._initDTS,z=P*w,U=Math.ceil((re-Q)/z),ae=_.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!ae){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var fe=[],ge=0;ge<U;ge++){var Ee=Q+ge*z;fe.push({unit:ae,pts:Ee,dts:Ee})}return d.samples=fe,this.remuxAudio(d,l,a,!1)},b.remuxID3=function(d,l){var a=d.samples.length;if(!a)return;for(var v=d.inputTimeScale,f=this._initPTS,E=this._initDTS,P=0;P<a;P++){var H=d.samples[P];H.pts=u(H.pts-f,l*v)/v,H.dts=u(H.dts-E,l*v)/v}var Q=d.samples;return d.samples=[],{samples:Q}},b.remuxText=function(d,l){var a=d.samples.length;if(!a)return;for(var v=d.inputTimeScale,f=this._initPTS,E=0;E<a;E++){var P=d.samples[E];P.pts=u(P.pts-f,l*v)/v}d.samples.sort(function(Q,re){return Q.pts-re.pts});var H=d.samples;return d.samples=[],{samples:H}},D}();function u(D,b){var c;if(b===null)return D;for(b<D?c=-8589934592:c=8589934592;Math.abs(D-b)>4294967296;)D+=c;return D}function y(D){for(var b=0;b<D.length;b++)if(D[b].key)return b;return-1}var m=function(b,c,d,l){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=c,this.size=d,this.cts=l,this.flags=new p(b)},p=function(b){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=b?2:1,this.isNonSync=b?0:1}},"./src/remux/passthrough-remuxer.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/polyfills/number.ts"),_=k("./src/utils/mp4-tools.ts"),R=k("./src/loader/fragment.ts"),W=k("./src/utils/logger.ts"),F=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var S=g.prototype;return S.destroy=function(){},S.resetTimeStamp=function(w){this.initPTS=w,this.lastEndDTS=null},S.resetNextTimestamp=function(){this.lastEndDTS=null},S.resetInitSegment=function(w,A,C){this.audioCodec=A,this.videoCodec=C,this.generateInitSegment(w),this.emitInitSegment=!0},S.generateInitSegment=function(w){var A=this.audioCodec,C=this.videoCodec;if(!w||!w.byteLength){this.initTracks=void 0,this.initData=void 0;return}var h=this.initData=Object(_.parseInitSegment)(w);A||(A=M(h.audio,R.ElementaryStreamTypes.AUDIO)),C||(C=M(h.video,R.ElementaryStreamTypes.VIDEO));var o={};h.audio&&h.video?o.audiovideo={container:"video/mp4",codec:A+","+C,initSegment:w,id:"main"}:h.audio?o.audio={container:"audio/mp4",codec:A,initSegment:w,id:"audio"}:h.video?o.video={container:"video/mp4",codec:C,initSegment:w,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},S.remux=function(w,A,C,h,o){var s=this.initPTS,u=this.lastEndDTS,y={audio:void 0,video:void 0,text:h,id3:C,initSegment:void 0};Object(V.isFiniteNumber)(u)||(u=this.lastEndDTS=o||0);var m=A.samples;if(!m||!m.length)return y;var p={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(m),D=this.initData),!D||!D.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),y;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(s)||(this.initPTS=p.initPTS=s=O(D,m,u));var b=Object(_.getDuration)(m,D),c=u,d=b+c;Object(_.offsetStartDTS)(D,m,s),b>0?this.lastEndDTS=d:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var l=!!D.audio,a=!!D.video,v="";l&&(v+="audio"),a&&(v+="video");var f={data1:m,startPTS:c,startDTS:c,endPTS:d,endDTS:d,type:v,hasAudio:l,hasVideo:a,nb:1,dropped:0};return y.audio=f.type==="audio"?f:void 0,y.video=f.type!=="audio"?f:void 0,y.text=h,y.id3=C,y.initSegment=p,y},g}(),O=function(S,I,w){return Object(_.getStartDTS)(S,I)-w};function M(g,S){var I=g==null?void 0:g.codec;return I&&I.length>4?I:I==="hvc1"?"hvc1.1.c.L120.90":I==="av01"?"av01.0.04M.08":I==="avc1"||S===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=F},"./src/task-loop.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return V});var V=function(){function _(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=_.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},_}()},"./src/types/cmcd.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"CMCDVersion",function(){return V}),k.d(Y,"CMCDObjectType",function(){return _}),k.d(Y,"CMCDStreamingFormat",function(){return R}),k.d(Y,"CMCDStreamType",function(){return W});var V=1,_;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(_||(_={}));var R;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(R||(R={}));var W;(function(F){F.VOD="v",F.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"HlsSkip",function(){return R}),k.d(Y,"getSkipValue",function(){return W}),k.d(Y,"HlsUrlParameters",function(){return F}),k.d(Y,"Level",function(){return O});function V(M,g){for(var S=0;S<g.length;S++){var I=g[S];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(M,I.key,I)}}function _(M,g,S){return g&&V(M.prototype,g),S&&V(M,S),M}var R;(function(M){M.No="",M.Yes="YES",M.v2="v2"})(R||(R={}));function W(M,g){var S=M.canSkipUntil,I=M.canSkipDateRanges,w=M.endSN,A=g!==void 0?g-w:0;return S&&A<S?I?R.v2:R.Yes:R.No}var F=function(){function M(S,I,w){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=S,this.part=I,this.skip=w}var g=M.prototype;return g.addDirectives=function(I){var w=new self.URL(I);return this.msn!==void 0&&w.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&w.searchParams.set("_HLS_part",this.part.toString()),this.skip&&w.searchParams.set("_HLS_skip",this.skip),w.toString()},M}(),O=function(){function M(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(S){return S}).join(",").replace(/\.[^.,]+/g,"")}return _(M,[{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(S){var I=S%this.url.length;this._urlId!==I&&(this.details=void 0,this._urlId=I)}}]),M}()},"./src/types/loader.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"PlaylistContextType",function(){return V}),k.d(Y,"PlaylistLevelType",function(){return _});var V;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var _;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(_||(_={}))},"./src/types/transmuxer.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"ChunkMetadata",function(){return V});var V=function(W,F,O,M,g,S){M===void 0&&(M=0),g===void 0&&(g=-1),S===void 0&&(S=!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=_(),this.buffering={audio:_(),video:_(),audiovideo:_()},this.level=W,this.sn=F,this.id=O,this.size=M,this.part=g,this.partial=S};function _(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"AttrList",function(){return R});var V=/^(\d+)x(\d+)$/,_=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function W(O){typeof O=="string"&&(O=W.parseAttrList(O));for(var M in O)O.hasOwnProperty(M)&&(this[M]=O[M])}var F=W.prototype;return F.decimalInteger=function(M){var g=parseInt(this[M],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},F.hexadecimalInteger=function(M){if(this[M]){var g=(this[M]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var S=new Uint8Array(g.length/2),I=0;I<g.length/2;I++)S[I]=parseInt(g.slice(I*2,I*2+2),16);return S}else return null},F.hexadecimalIntegerAsNumber=function(M){var g=parseInt(this[M],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},F.decimalFloatingPoint=function(M){return parseFloat(this[M])},F.optionalFloat=function(M,g){var S=this[M];return S?parseFloat(S):g},F.enumeratedString=function(M){return this[M]},F.bool=function(M){return this[M]==="YES"},F.decimalResolution=function(M){var g=V.exec(this[M]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},W.parseAttrList=function(M){var g,S={},I='"';for(_.lastIndex=0;(g=_.exec(M))!==null;){var w=g[2];w.indexOf(I)===0&&w.lastIndexOf(I)===w.length-1&&(w=w.slice(1,-1)),S[g[1]]=w}return S},W}()},"./src/utils/binary-search.ts":function(he,Y,k){"use strict";k.r(Y);var V={search:function(R,W){for(var F=0,O=R.length-1,M=null,g=null;F<=O;){M=(F+O)/2|0,g=R[M];var S=W(g);if(S>0)F=M+1;else if(S<0)O=M-1;else return g}return null}};Y.default=V},"./src/utils/buffer-helper.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"BufferHelper",function(){return R});var V=k("./src/utils/logger.ts"),_={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function W(){}return W.isBuffered=function(O,M){try{if(O){for(var g=W.getBuffered(O),S=0;S<g.length;S++)if(M>=g.start(S)&&M<=g.end(S))return!0}}catch(I){}return!1},W.bufferInfo=function(O,M,g){try{if(O){var S=W.getBuffered(O),I=[],w;for(w=0;w<S.length;w++)I.push({start:S.start(w),end:S.end(w)});return this.bufferedInfo(I,M,g)}}catch(A){}return{len:0,start:M,end:M,nextStart:void 0}},W.bufferedInfo=function(O,M,g){M=Math.max(0,M),O.sort(function(p,D){var b=p.start-D.start;return b||D.end-p.end});var S=[];if(g)for(var I=0;I<O.length;I++){var w=S.length;if(w){var A=S[w-1].end;O[I].start-A<g?O[I].end>A&&(S[w-1].end=O[I].end):S.push(O[I])}else S.push(O[I])}else S=O;for(var C=0,h,o=M,s=M,u=0;u<S.length;u++){var y=S[u].start,m=S[u].end;if(M+g>=y&&M<m)o=y,s=m,C=s-M;else if(M+g<y){h=y;break}}return{len:C,start:o||0,end:s||0,nextStart:h}},W.getBuffered=function(O){try{return O.buffered}catch(M){return V.logger.log("failed to get media.buffered",M),_}},W}()},"./src/utils/cea-608-parser.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"Row",function(){return s}),k.d(Y,"CaptionScreen",function(){return u});var V=k("./src/utils/logger.ts"),_={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},R=function(d){var l=d;return _.hasOwnProperty(d)&&(l=_[d]),String.fromCharCode(l)},W=15,F=100,O={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},M={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},S={25:2,26:4,29:6,30:8,31:10,27:13,28:15},I=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],w;(function(c){c[c.ERROR=0]="ERROR",c[c.TEXT=1]="TEXT",c[c.WARNING=2]="WARNING",c[c.INFO=2]="INFO",c[c.DEBUG=3]="DEBUG",c[c.DATA=3]="DATA"})(w||(w={}));var A=function(){function c(){this.time=null,this.verboseLevel=w.ERROR}var d=c.prototype;return d.log=function(a,v){this.verboseLevel>=a&&V.logger.log(this.time+" ["+a+"] "+v)},c}(),C=function(d){for(var l=[],a=0;a<d.length;a++)l.push(d[a].toString(16));return l},h=function(){function c(l,a,v,f,E){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=l||"white",this.underline=a||!1,this.italics=v||!1,this.background=f||"black",this.flash=E||!1}var d=c.prototype;return d.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},d.setStyles=function(a){for(var v=["foreground","underline","italics","background","flash"],f=0;f<v.length;f++){var E=v[f];a.hasOwnProperty(E)&&(this[E]=a[E])}},d.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},d.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},d.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},d.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},c}(),o=function(){function c(l,a,v,f,E,P){this.uchar=void 0,this.penState=void 0,this.uchar=l||" ",this.penState=new h(a,v,f,E,P)}var d=c.prototype;return d.reset=function(){this.uchar=" ",this.penState.reset()},d.setChar=function(a,v){this.uchar=a,this.penState.copy(v)},d.setPenState=function(a){this.penState.copy(a)},d.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},d.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},d.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},c}(),s=function(){function c(l){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<F;a++)this.chars.push(new o);this.logger=l,this.pos=0,this.currPenState=new h}var d=c.prototype;return d.equals=function(a){for(var v=!0,f=0;f<F;f++)if(!this.chars[f].equals(a.chars[f])){v=!1;break}return v},d.copy=function(a){for(var v=0;v<F;v++)this.chars[v].copy(a.chars[v])},d.isEmpty=function(){for(var a=!0,v=0;v<F;v++)if(!this.chars[v].isEmpty()){a=!1;break}return a},d.setCursor=function(a){this.pos!==a&&(this.pos=a),this.pos<0?(this.logger.log(w.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>F&&(this.logger.log(w.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},d.moveCursor=function(a){var v=this.pos+a;if(a>1)for(var f=this.pos+1;f<v+1;f++)this.chars[f].setPenState(this.currPenState);this.setCursor(v)},d.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},d.insertChar=function(a){a>=144&&this.backSpace();var v=R(a);if(this.pos>=F){this.logger.log(w.ERROR,"Cannot insert "+a.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},d.clearFromPos=function(a){var v;for(v=a;v<F;v++)this.chars[v].reset()},d.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},d.clearToEndOfRow=function(){this.clearFromPos(this.pos)},d.getTextString=function(){for(var a=[],v=!0,f=0;f<F;f++){var E=this.chars[f].uchar;E!==" "&&(v=!1),a.push(E)}return v?"":a.join("")},d.setPenStyles=function(a){this.currPenState.setStyles(a);var v=this.chars[this.pos];v.setPenState(this.currPenState)},c}(),u=function(){function c(l){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<W;a++)this.rows.push(new s(l));this.logger=l,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var d=c.prototype;return d.reset=function(){for(var a=0;a<W;a++)this.rows[a].clear();this.currRow=W-1},d.equals=function(a){for(var v=!0,f=0;f<W;f++)if(!this.rows[f].equals(a.rows[f])){v=!1;break}return v},d.copy=function(a){for(var v=0;v<W;v++)this.rows[v].copy(a.rows[v])},d.isEmpty=function(){for(var a=!0,v=0;v<W;v++)if(!this.rows[v].isEmpty()){a=!1;break}return a},d.backSpace=function(){var a=this.rows[this.currRow];a.backSpace()},d.clearToEndOfRow=function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},d.insertChar=function(a){var v=this.rows[this.currRow];v.insertChar(a)},d.setPen=function(a){var v=this.rows[this.currRow];v.setPenStyles(a)},d.moveCursor=function(a){var v=this.rows[this.currRow];v.moveCursor(a)},d.setCursor=function(a){this.logger.log(w.INFO,"setCursor: "+a);var v=this.rows[this.currRow];v.setCursor(a)},d.setPAC=function(a){this.logger.log(w.INFO,"pacData = "+JSON.stringify(a));var v=a.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var f=0;f<W;f++)this.rows[f].clear();var E=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var H=P.rows[E].cueStartTime,Q=this.logger.time;if(H&&Q!==null&&H<Q)for(var re=0;re<this.nrRollUpRows;re++)this.rows[v-this.nrRollUpRows+re+1].copy(P.rows[E+re])}}this.currRow=v;var z=this.rows[this.currRow];if(a.indent!==null){var U=a.indent,ae=Math.max(U-1,0);z.setCursor(a.indent),a.color=z.chars[ae].penState.foreground}var fe={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(fe)},d.setBkgData=function(a){this.logger.log(w.INFO,"bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},d.setRollUpRows=function(a){this.nrRollUpRows=a},d.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(w.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(w.TEXT,this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(a,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(w.INFO,"Rolling up")},d.getDisplayText=function(a){a=a||!1;for(var v=[],f="",E=-1,P=0;P<W;P++){var H=this.rows[P].getTextString();H&&(E=P+1,a?v.push("Row "+E+": '"+H+"'"):v.push(H.trim()))}return v.length>0&&(a?f="["+v.join(" | ")+"]":f=v.join(`
`)),f},d.getTextAndFormat=function(){return this.rows},c}(),y=function(){function c(l,a,v){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=l,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new u(v),this.nonDisplayedMemory=new u(v),this.lastOutputScreen=new u(v),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var d=c.prototype;return d.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},d.getHandler=function(){return this.outputFilter},d.setHandler=function(a){this.outputFilter=a},d.setPAC=function(a){this.writeScreen.setPAC(a)},d.setBkgData=function(a){this.writeScreen.setBkgData(a)},d.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(w.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},d.insertChars=function(a){for(var v=0;v<a.length;v++)this.writeScreen.insertChar(a[v]);var f=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(w.INFO,f+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(w.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},d.ccRCL=function(){this.logger.log(w.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},d.ccBS=function(){if(this.logger.log(w.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},d.ccAOF=function(){},d.ccAON=function(){},d.ccDER=function(){this.logger.log(w.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},d.ccRU=function(a){this.logger.log(w.INFO,"RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},d.ccFON=function(){this.logger.log(w.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},d.ccRDC=function(){this.logger.log(w.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},d.ccTR=function(){this.logger.log(w.INFO,"TR"),this.setMode("MODE_TEXT")},d.ccRTD=function(){this.logger.log(w.INFO,"RTD"),this.setMode("MODE_TEXT")},d.ccEDM=function(){this.logger.log(w.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},d.ccCR=function(){this.logger.log(w.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},d.ccENM=function(){this.logger.log(w.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},d.ccEOC=function(){if(this.logger.log(w.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(w.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},d.ccTO=function(a){this.logger.log(w.INFO,"TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},d.ccMIDROW=function(a){var v={flash:!1};if(v.underline=a%2===1,v.italics=a>=46,v.italics)v.foreground="white";else{var f=Math.floor(a/2)-16,E=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=E[f]}this.logger.log(w.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},d.outputDataUpdate=function(a){a===void 0&&(a=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},d.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},c}(),m=function(){function c(l,a,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var f=new A;this.channels=[null,new y(l,a,f),new y(l+1,v,f)],this.cmdHistory=b(),this.logger=f}var d=c.prototype;return d.getHandler=function(a){return this.channels[a].getHandler()},d.setHandler=function(a,v){this.channels[a].setHandler(v)},d.addData=function(a,v){var f,E,P,H=!1;this.logger.time=a;for(var Q=0;Q<v.length;Q+=2){if(E=v[Q]&127,P=v[Q+1]&127,E===0&&P===0)continue;if(this.logger.log(w.DATA,"["+C([v[Q],v[Q+1]])+"] -> ("+C([E,P])+")"),f=this.parseCmd(E,P),f||(f=this.parseMidrow(E,P)),f||(f=this.parsePAC(E,P)),f||(f=this.parseBackgroundAttributes(E,P)),!f&&(H=this.parseChars(E,P),H)){var re=this.currentChannel;if(re&&re>0){var z=this.channels[re];z.insertChars(H)}else this.logger.log(w.WARNING,"No channel found yet. TEXT-MODE?")}!f&&!H&&this.logger.log(w.WARNING,"Couldn't parse cleaned data "+C([E,P])+" orig: "+C([v[Q],v[Q+1]]))}},d.parseCmd=function(a,v){var f=this.cmdHistory,E=(a===20||a===28||a===21||a===29)&&v>=32&&v<=47,P=(a===23||a===31)&&v>=33&&v<=35;if(!(E||P))return!1;if(D(a,v,f))return p(null,null,f),this.logger.log(w.DEBUG,"Repeated command ("+C([a,v])+") is dropped"),!0;var H=a===20||a===21||a===23?1:2,Q=this.channels[H];return a===20||a===21||a===28||a===29?v===32?Q.ccRCL():v===33?Q.ccBS():v===34?Q.ccAOF():v===35?Q.ccAON():v===36?Q.ccDER():v===37?Q.ccRU(2):v===38?Q.ccRU(3):v===39?Q.ccRU(4):v===40?Q.ccFON():v===41?Q.ccRDC():v===42?Q.ccTR():v===43?Q.ccRTD():v===44?Q.ccEDM():v===45?Q.ccCR():v===46?Q.ccENM():v===47&&Q.ccEOC():Q.ccTO(v-32),p(a,v,f),this.currentChannel=H,!0},d.parseMidrow=function(a,v){var f=0;if((a===17||a===25)&&v>=32&&v<=47){if(a===17?f=1:f=2,f!==this.currentChannel)return this.logger.log(w.ERROR,"Mismatch channel in midrow parsing"),!1;var E=this.channels[f];return E?(E.ccMIDROW(v),this.logger.log(w.DEBUG,"MIDROW ("+C([a,v])+")"),!0):!1}return!1},d.parsePAC=function(a,v){var f,E=this.cmdHistory,P=(a>=17&&a<=23||a>=25&&a<=31)&&v>=64&&v<=127,H=(a===16||a===24)&&v>=64&&v<=95;if(!(P||H))return!1;if(D(a,v,E))return p(null,null,E),!0;var Q=a<=23?1:2;v>=64&&v<=95?f=Q===1?O[a]:g[a]:f=Q===1?M[a]:S[a];var re=this.channels[Q];return re?(re.setPAC(this.interpretPAC(f,v)),p(a,v,E),this.currentChannel=Q,!0):!1},d.interpretPAC=function(a,v){var f,E={color:null,italics:!1,indent:null,underline:!1,row:a};return v>95?f=v-96:f=v-64,E.underline=(f&1)===1,f<=13?E.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(f/2)]:f<=15?(E.italics=!0,E.color="white"):E.indent=Math.floor((f-16)/2)*4,E},d.parseChars=function(a,v){var f,E=null,P=null;if(a>=25?(f=2,P=a-8):(f=1,P=a),P>=17&&P<=19){var H;P===17?H=v+80:P===18?H=v+112:H=v+144,this.logger.log(w.INFO,"Special char '"+R(H)+"' in channel "+f),E=[H]}else a>=32&&a<=127&&(E=v===0?[a]:[a,v]);if(E){var Q=C(E);this.logger.log(w.DEBUG,"Char codes = "+Q.join(",")),p(a,v,this.cmdHistory)}return E},d.parseBackgroundAttributes=function(a,v){var f=(a===16||a===24)&&v>=32&&v<=47,E=(a===23||a===31)&&v>=45&&v<=47;if(!(f||E))return!1;var P,H={};a===16||a===24?(P=Math.floor((v-32)/2),H.background=I[P],v%2===1&&(H.background=H.background+"_semi")):v===45?H.background="transparent":(H.foreground="black",v===47&&(H.underline=!0));var Q=a<=23?1:2,re=this.channels[Q];return re.setBkgData(H),p(a,v,this.cmdHistory),!0},d.reset=function(){for(var a=0;a<Object.keys(this.channels).length;a++){var v=this.channels[a];v&&v.reset()}this.cmdHistory=b()},d.cueSplitAtTime=function(a){for(var v=0;v<this.channels.length;v++){var f=this.channels[v];f&&f.cueSplitAtTime(a)}},c}();function p(c,d,l){l.a=c,l.b=d}function D(c,d,l){return l.a===c&&l.b===d}function b(){return{a:null,b:null}}Y.default=m},"./src/utils/codecs.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"isCodecType",function(){return _}),k.d(Y,"isCodecSupportedInMp4",function(){return R});var V={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 _(W,F){var O=V[F];return!!O&&O[W.slice(0,4)]===!0}function R(W,F){return MediaSource.isTypeSupported((F||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/utils/vttparser.ts"),_=k("./src/utils/webvtt-parser.ts"),R=k("./src/utils/texttrack-utils.ts"),W=/\s/,F={newCue:function(M,g,S,I){for(var w=[],A,C,h,o,s,u=self.VTTCue||self.TextTrackCue,y=0;y<I.rows.length;y++)if(A=I.rows[y],h=!0,o=0,s="",!A.isEmpty()){for(var m=0;m<A.chars.length;m++)W.test(A.chars[m].uchar)&&h?o++:(s+=A.chars[m].uchar,h=!1);A.cueStartTime=g,g===S&&(S+=1e-4),o>=16?o--:o++;var p=Object(V.fixLineBreaks)(s.trim()),D=Object(_.generateCueId)(g,S,p);(!M||!M.cues||!M.cues.getCueById(D))&&(C=new u(g,S,p),C.id=D,C.line=y+1,C.align="left",C.position=10+Math.min(80,Math.floor(o*8/32)*10),w.push(C))}return M&&w.length&&(w.sort(function(b,c){return b.line==="auto"||c.line==="auto"?0:b.line>8&&c.line>8?c.line-b.line:b.line-c.line}),w.forEach(function(b){return Object(R.addCueToTrack)(M,b)})),w}};Y.default=F},"./src/utils/discontinuities.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"findFirstFragWithCC",function(){return W}),k.d(Y,"shouldAlignOnDiscontinuities",function(){return F}),k.d(Y,"findDiscontinuousReferenceFrag",function(){return O}),k.d(Y,"adjustSlidingStart",function(){return g}),k.d(Y,"alignStream",function(){return S}),k.d(Y,"alignPDT",function(){return w}),k.d(Y,"alignFragmentByPDTDelta",function(){return A}),k.d(Y,"alignMediaPlaylistByPDT",function(){return C});var V=k("./src/polyfills/number.ts"),_=k("./src/utils/logger.ts"),R=k("./src/controller/level-helper.ts");function W(h,o){for(var s=null,u=0,y=h.length;u<y;u++){var m=h[u];if(m&&m.cc===o){s=m;break}}return s}function F(h,o,s){return!!(o.details&&(s.endCC>s.startCC||h&&h.cc<s.startCC))}function O(h,o){var s=h.fragments,u=o.fragments;if(!u.length||!s.length){_.logger.log("No fragments to align");return}var y=W(s,u[0].cc);if(!y||y&&!y.startPTS){_.logger.log("No frag in previous level to align on");return}return y}function M(h,o){if(h){var s=h.start+o;h.start=h.startPTS=s,h.endPTS=s+h.duration}}function g(h,o){for(var s=o.fragments,u=0,y=s.length;u<y;u++)M(s[u],h);o.fragmentHint&&M(o.fragmentHint,h),o.alignedSliding=!0}function S(h,o,s){if(!o)return;I(h,s,o),!s.alignedSliding&&o.details&&w(s,o.details),!s.alignedSliding&&o.details&&!s.skippedSegments&&Object(R.adjustSliding)(o.details,s)}function I(h,o,s){if(F(h,s,o)){var u=O(s.details,o);u&&Object(V.isFiniteNumber)(u.start)&&(_.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),g(u.start,o))}}function w(h,o){if(!o.fragments.length||!h.hasProgramDateTime||!o.hasProgramDateTime)return;var s=o.fragments[0].programDateTime,u=h.fragments[0].programDateTime,y=(u-s)/1e3+o.fragments[0].start;y&&Object(V.isFiniteNumber)(y)&&(_.logger.log("Adjusting PTS using programDateTime delta "+(u-s)+"ms, sliding:"+y.toFixed(3)+" "+h.url+" "),g(y,h))}function A(h,o){var s=h.programDateTime;if(!s)return;var u=(s-o)/1e3;h.start=h.startPTS=u,h.endPTS=u+h.duration}function C(h,o){if(!o.fragments.length||!h.hasProgramDateTime||!o.hasProgramDateTime)return;var s=o.fragments[0].programDateTime,u=o.fragments[0].start,y=s-u*1e3;h.fragments.forEach(function(m){A(m,y)}),h.fragmentHint&&A(h.fragmentHint,y),h.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/utils/ewma.ts"),_=function(){function R(F,O,M){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=M,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(F),this.fast_=new V.default(O)}var W=R.prototype;return W.update=function(O,M){var g=this.slow_,S=this.fast_;this.slow_.halfLife!==O&&(this.slow_=new V.default(O,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==M&&(this.fast_=new V.default(M,S.getEstimate(),S.getTotalWeight()))},W.sample=function(O,M){O=Math.max(O,this.minDelayMs_);var g=8*M,S=O/1e3,I=g/S;this.fast_.sample(S,I),this.slow_.sample(S,I)},W.canEstimate=function(){var O=this.fast_;return O&&O.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},R}();Y.default=_},"./src/utils/ewma.ts":function(he,Y,k){"use strict";k.r(Y);var V=function(){function _(W,F,O){F===void 0&&(F=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=F,this.totalWeight_=O}var R=_.prototype;return R.sample=function(F,O){var M=Math.pow(this.alpha_,F);this.estimate_=O*(1-M)+M*this.estimate_,this.totalWeight_+=F},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},_}();Y.default=V},"./src/utils/fetch-loader.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"fetchSupported",function(){return A});var V=k("./src/polyfills/number.ts"),_=k("./src/loader/load-stats.ts"),R=k("./src/demux/chunk-cache.ts");function W(u,y){u.prototype=Object.create(y.prototype),u.prototype.constructor=u,S(u,y)}function F(u){var y=typeof Map=="function"?new Map:void 0;return F=function(p){if(p===null||!g(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof y!="undefined"){if(y.has(p))return y.get(p);y.set(p,D)}function D(){return O(p,arguments,I(this).constructor)}return D.prototype=Object.create(p.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),S(D,p)},F(u)}function O(u,y,m){return M()?O=Reflect.construct:O=function(D,b,c){var d=[null];d.push.apply(d,b);var l=Function.bind.apply(D,d),a=new l;return c&&S(a,c.prototype),a},O.apply(null,arguments)}function M(){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 g(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function S(u,y){return S=Object.setPrototypeOf||function(p,D){return p.__proto__=D,p},S(u,y)}function I(u){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},I(u)}function w(){return w=Object.assign||function(u){for(var y=1;y<arguments.length;y++){var m=arguments[y];for(var p in m)Object.prototype.hasOwnProperty.call(m,p)&&(u[p]=m[p])}return u},w.apply(this,arguments)}function A(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(u){}return!1}var C=function(){function u(m){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=m.fetchSetup||o,this.controller=new self.AbortController,this.stats=new _.LoadStats}var y=u.prototype;return y.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},y.abortInternal=function(){var p=this.response;(!p||!p.ok)&&(this.stats.aborted=!0,this.controller.abort())},y.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},y.load=function(p,D,b){var c=this,d=this.stats;if(d.loading.start)throw new Error("Loader can only be used once.");d.loading.start=self.performance.now();var l=h(p,this.controller.signal),a=b.onProgress,v=p.responseType==="arraybuffer",f=v?"byteLength":"length";this.context=p,this.config=D,this.callbacks=b,this.request=this.fetchSetup(p,l),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){c.abortInternal(),b.onTimeout(d,p,c.response)},D.timeout),self.fetch(this.request).then(function(E){if(c.response=c.loader=E,!E.ok){var P=E.status,H=E.statusText;throw new s(H||"fetch, bad network response",P,E)}return d.loading.first=Math.max(self.performance.now(),d.loading.start),d.total=parseInt(E.headers.get("Content-Length")||"0"),a&&Object(V.isFiniteNumber)(D.highWaterMark)?c.loadProgressively(E,d,p,D.highWaterMark,a):v?E.arrayBuffer():E.text()}).then(function(E){var P=c.response;self.clearTimeout(c.requestTimeout),d.loading.end=Math.max(self.performance.now(),d.loading.first),d.loaded=d.total=E[f];var H={url:P.url,data:E};a&&!Object(V.isFiniteNumber)(D.highWaterMark)&&a(d,p,E,P),b.onSuccess(H,d,p,P)}).catch(function(E){if(self.clearTimeout(c.requestTimeout),d.aborted)return;var P=E.code||0;b.onError({code:P,text:E.message},p,E.details)})},y.getCacheAge=function(){var p=null;if(this.response){var D=this.response.headers.get("age");p=D?parseFloat(D):null}return p},y.loadProgressively=function(p,D,b,c,d){c===void 0&&(c=0);var l=new R.default,a=p.body.getReader(),v=function f(){return a.read().then(function(E){if(E.done)return l.dataLength&&d(D,b,l.flush(),p),Promise.resolve(new ArrayBuffer(0));var P=E.value,H=P.length;return D.loaded+=H,H<c||l.dataLength?(l.push(P),l.dataLength>=c&&d(D,b,l.flush(),p)):d(D,b,P,p),f()}).catch(function(){return Promise.reject()})};return v()},u}();function h(u,y){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:y,headers:new self.Headers(w({},u.headers))};return u.rangeEnd&&m.headers.set("Range","bytes="+u.rangeStart+"-"+String(u.rangeEnd-1)),m}function o(u,y){return new self.Request(u.url,y)}var s=function(u){W(y,u);function y(m,p,D){var b;return b=u.call(this,m)||this,b.code=void 0,b.details=void 0,b.code=p,b.details=D,b}return y}(F(Error));Y.default=C},"./src/utils/imsc1-ttml-parser.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"IMSC1_CODEC",function(){return g}),k.d(Y,"parseIMSC1",function(){return A});var V=k("./src/utils/mp4-tools.ts"),_=k("./src/utils/vttparser.ts"),R=k("./src/utils/vttcue.ts"),W=k("./src/demux/id3.ts"),F=k("./src/utils/timescale-conversion.ts"),O=k("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(c){for(var d=1;d<arguments.length;d++){var l=arguments[d];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(c[a]=l[a])}return c},M.apply(this,arguments)}var g="stpp.ttml.im1t",S=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,I=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,w={left:"start",center:"center",right:"end",start:"start",end:"end"};function A(c,d,l,a,v){var f=Object(V.findBox)(new Uint8Array(c),["mdat"]);if(f.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var E=f[0],P=Object(W.utf8ArrayToStr)(new Uint8Array(c,E.start,E.end-E.start)),H=Object(F.toTimescaleFromScale)(d,1,l);try{a(C(P,H))}catch(Q){v(Q)}}function C(c,d){var l=new DOMParser,a=l.parseFromString(c,"text/xml"),v=a.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var f={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},E=Object.keys(f).reduce(function(z,U){return z[U]=v.getAttribute("ttp:"+U)||f[U],z},{}),P=v.getAttribute("xml:space")!=="preserve",H=o(h(v,"styling","style")),Q=o(h(v,"layout","region")),re=h(v,"body","[begin]");return[].map.call(re,function(z){var U=s(z,P);if(!U||!z.hasAttribute("begin"))return null;var ae=p(z.getAttribute("begin"),E),fe=p(z.getAttribute("dur"),E),ge=p(z.getAttribute("end"),E);if(ae===null)throw m(z);if(ge===null){if(fe===null)throw m(z);ge=ae+fe}var Ee=new R.default(ae-d,ge-d,U);Ee.id=Object(O.generateCueId)(Ee.startTime,Ee.endTime,Ee.text);var Ne=Q[z.getAttribute("region")],Se=H[z.getAttribute("style")];Ee.position=10,Ee.size=80;var Ie=u(Ne,Se),Ae=Ie.textAlign;if(Ae){var we=w[Ae];we&&(Ee.lineAlign=we),Ee.align=Ae}return M(Ee,Ie),Ee}).filter(function(z){return z!==null})}function h(c,d,l){var a=c.getElementsByTagName(d)[0];return a?[].slice.call(a.querySelectorAll(l)):[]}function o(c){return c.reduce(function(d,l){var a=l.getAttribute("xml:id");return a&&(d[a]=l),d},{})}function s(c,d){return[].slice.call(c.childNodes).reduce(function(l,a,v){var f;return a.nodeName==="br"&&v?l+`
`:(f=a.childNodes)!==null&&f!==void 0&&f.length?s(a,d):d?l+a.textContent.trim().replace(/\s+/g," "):l+a.textContent},"")}function u(c,d){var l="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(v,f){var E=y(d,l,f)||y(c,l,f);return E&&(v[f]=E),v},{})}function y(c,d,l){return c.hasAttributeNS(d,l)?c.getAttributeNS(d,l):null}function m(c){return new Error("Could not parse ttml timestamp "+c)}function p(c,d){if(!c)return null;var l=Object(_.parseTimeStamp)(c);return l===null&&(S.test(c)?l=D(c,d):I.test(c)&&(l=b(c,d))),l}function D(c,d){var l=S.exec(c),a=(l[4]|0)+(l[5]|0)/d.subFrameRate;return(l[1]|0)*3600+(l[2]|0)*60+(l[3]|0)+a/d.frameRate}function b(c,d){var l=I.exec(c),a=Number(l[1]),v=l[2];switch(v){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/d.frameRate;case"t":return a/d.tickRate}return a}},"./src/utils/logger.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"enableLogs",function(){return O}),k.d(Y,"logger",function(){return M});var V=function(){},_={trace:V,debug:V,log:V,warn:V,info:V,error:V},R=_;function W(g){var S=self.console[g];return S?S.bind(self.console,"["+g+"] >"):V}function F(g){for(var S=arguments.length,I=new Array(S>1?S-1:0),w=1;w<S;w++)I[w-1]=arguments[w];I.forEach(function(A){R[A]=g[A]?g[A].bind(g):W(A)})}function O(g){if(self.console&&g===!0||typeof g=="object"){F(g,"debug","log","info","warn","error");try{R.log()}catch(S){R=_}}else R=_}var M=R},"./src/utils/mediakeys-helper.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"KeySystems",function(){return V}),k.d(Y,"requestMediaKeySystemAccess",function(){return _});var V;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(V||(V={}));var _=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"bin2str",function(){return F}),k.d(Y,"readUint16",function(){return O}),k.d(Y,"readUint32",function(){return M}),k.d(Y,"writeUint32",function(){return g}),k.d(Y,"findBox",function(){return S}),k.d(Y,"parseSegmentIndex",function(){return I}),k.d(Y,"parseInitSegment",function(){return w}),k.d(Y,"getStartDTS",function(){return A}),k.d(Y,"getDuration",function(){return C}),k.d(Y,"computeRawDurationFromSamples",function(){return h}),k.d(Y,"offsetStartDTS",function(){return o}),k.d(Y,"segmentValidRange",function(){return s}),k.d(Y,"appendUint8Array",function(){return u});var V=k("./src/utils/typed-array.ts"),_=k("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,W=[].push;function F(y){return String.fromCharCode.apply(null,y)}function O(y,m){"data"in y&&(m+=y.start,y=y.data);var p=y[m]<<8|y[m+1];return p<0?65536+p:p}function M(y,m){"data"in y&&(m+=y.start,y=y.data);var p=y[m]<<24|y[m+1]<<16|y[m+2]<<8|y[m+3];return p<0?4294967296+p:p}function g(y,m,p){"data"in y&&(m+=y.start,y=y.data),y[m]=p>>24,y[m+1]=p>>16&255,y[m+2]=p>>8&255,y[m+3]=p&255}function S(y,m){var p=[];if(!m.length)return p;var D,b,c;"data"in y?(D=y.data,b=y.start,c=y.end):(D=y,b=0,c=D.byteLength);for(var d=b;d<c;){var l=M(D,d),a=F(D.subarray(d+4,d+8)),v=l>1?d+l:c;if(a===m[0])if(m.length===1)p.push({data:D,start:d+8,end:v});else{var f=S({data:D,start:d+8,end:v},m.slice(1));f.length&&W.apply(p,f)}d=v}return p}function I(y){var m=S(y,["moov"]),p=m[0],D=p?p.end:null,b=S(y,["sidx"]);if(!b||!b[0])return null;var c=[],d=b[0],l=d.data[0],a=l===0?8:16,v=M(d,a);a+=4;var f=0,E=0;l===0?a+=8:a+=16,a+=2;var P=d.end+E,H=O(d,a);a+=2;for(var Q=0;Q<H;Q++){var re=a,z=M(d,re);re+=4;var U=z&2147483647,ae=(z&2147483648)>>>31;if(ae===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var fe=M(d,re);re+=4,c.push({referenceSize:U,subsegmentDuration:fe,info:{duration:fe/v,start:P,end:P+U-1}}),P+=U,re+=4,a=re}return{earliestPresentationTime:f,timescale:v,version:l,referencesCount:H,references:c,moovEndOffset:D}}function w(y){for(var m=[],p=S(y,["moov","trak"]),D=0;D<p.length;D++){var b=p[D],c=S(b,["tkhd"])[0];if(c){var d=c.data[c.start],l=d===0?12:20,a=M(c,l),v=S(b,["mdia","mdhd"])[0];if(v){d=v.data[v.start],l=d===0?12:20;var f=M(v,l),E=S(b,["mdia","hdlr"])[0];if(E){var P=F(E.data.subarray(E.start+8,E.start+12)),H={soun:_.ElementaryStreamTypes.AUDIO,vide:_.ElementaryStreamTypes.VIDEO}[P];if(H){var Q=S(b,["mdia","minf","stbl","stsd"])[0],re=void 0;Q&&(re=F(Q.data.subarray(Q.start+12,Q.start+16))),m[a]={timescale:f,type:H},m[H]={timescale:f,id:a,codec:re}}}}}}var z=S(y,["moov","mvex","trex"]);return z.forEach(function(U){var ae=M(U,4),fe=m[ae];fe&&(fe.default={duration:M(U,12),flags:M(U,20)})}),m}function A(y,m){return S(m,["moof","traf"]).reduce(function(p,D){var b=S(D,["tfdt"])[0],c=b.data[b.start],d=S(D,["tfhd"]).reduce(function(l,a){var v=M(a,4),f=y[v];if(f){var E=M(b,4);c===1&&(E*=Math.pow(2,32),E+=M(b,8));var P=f.timescale||9e4,H=E/P;if(isFinite(H)&&(l===null||H<l))return H}return l},null);return d!==null&&isFinite(d)&&(p===null||d<p)?d:p},null)||0}function C(y,m){for(var p=0,D=0,b=0,c=S(y,["moof","traf"]),d=0;d<c.length;d++){var l=c[d],a=S(l,["tfhd"])[0],v=M(a,4),f=m[v];if(!f)continue;var E=f.default,P=M(a,0)|(E==null?void 0:E.flags),H=E==null?void 0:E.duration;P&8&&(P&2?H=M(a,12):H=M(a,8));for(var Q=f.timescale||9e4,re=S(l,["trun"]),z=0;z<re.length;z++){if(H){var U=M(re[z],4);p=H*U}else p=h(re[z]);f.type===_.ElementaryStreamTypes.VIDEO?D+=p/Q:f.type===_.ElementaryStreamTypes.AUDIO&&(b+=p/Q)}}if(D===0&&b===0){var ae=I(y);if(ae!=null&&ae.references)return ae.references.reduce(function(fe,ge){return fe+ge.info.duration||0},0)}return D||b}function h(y){var m=M(y,0),p=8;m&1&&(p+=4),m&4&&(p+=4);for(var D=0,b=M(y,4),c=0;c<b;c++){if(m&256){var d=M(y,p);D+=d,p+=4}m&512&&(p+=4),m&1024&&(p+=4),m&2048&&(p+=4)}return D}function o(y,m,p){S(m,["moof","traf"]).forEach(function(D){S(D,["tfhd"]).forEach(function(b){var c=M(b,4),d=y[c];if(!d)return;var l=d.timescale||9e4;S(D,["tfdt"]).forEach(function(a){var v=a.data[a.start],f=M(a,4);if(v===0)g(a,4,f-p*l);else{f*=Math.pow(2,32),f+=M(a,8),f-=p*l,f=Math.max(f,0);var E=Math.floor(f/(R+1)),P=Math.floor(f%(R+1));g(a,4,E),g(a,8,P)}})})})}function s(y){var m={valid:null,remainder:null},p=S(y,["moof"]);if(p){if(p.length<2)return m.remainder=y,m}else return m;var D=p[p.length-1];return m.valid=Object(V.sliceUint8)(y,0,D.start-8),m.remainder=Object(V.sliceUint8)(y,D.start-8),m}function u(y,m){var p=new Uint8Array(y.length+m.length);return p.set(y),p.set(m,y.length),p}},"./src/utils/output-filter.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"default",function(){return V});var V=function(){function _(W,F){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=F}var R=_.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(F,O,M){(this.startTime===null||this.startTime>F)&&(this.startTime=F),this.endTime=O,this.screen=M,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},_}()},"./src/utils/texttrack-utils.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"sendAddTrackEvent",function(){return _}),k.d(Y,"addCueToTrack",function(){return R}),k.d(Y,"clearCurrentCues",function(){return W}),k.d(Y,"removeCuesInRange",function(){return F}),k.d(Y,"getCuesInRange",function(){return M});var V=k("./src/utils/logger.ts");function _(g,S){var I;try{I=new Event("addtrack")}catch(w){I=document.createEvent("Event"),I.initEvent("addtrack",!1,!1)}I.track=g,S.dispatchEvent(I)}function R(g,S){var I=g.mode;if(I==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(S.id))try{if(g.addCue(S),!g.cues.getCueById(S.id))throw new Error("addCue is failed for: "+S)}catch(A){V.logger.debug("[texttrack-utils]: "+A);var w=new self.TextTrackCue(S.startTime,S.endTime,S.text);w.id=S.id,g.addCue(w)}I==="disabled"&&(g.mode=I)}function W(g){var S=g.mode;if(S==="disabled"&&(g.mode="hidden"),g.cues)for(var I=g.cues.length;I--;)g.removeCue(g.cues[I]);S==="disabled"&&(g.mode=S)}function F(g,S,I){var w=g.mode;if(w==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var A=M(g.cues,S,I),C=0;C<A.length;C++)g.removeCue(A[C]);w==="disabled"&&(g.mode=w)}function O(g,S){if(S<g[0].startTime)return 0;var I=g.length-1;if(S>g[I].endTime)return-1;for(var w=0,A=I;w<=A;){var C=Math.floor((A+w)/2);if(S<g[C].startTime)A=C-1;else if(S>g[C].startTime&&w<I)w=C+1;else return C}return g[w].startTime-S<S-g[A].startTime?w:A}function M(g,S,I){var w=[],A=O(g,S);if(A>-1)for(var C=A,h=g.length;C<h;C++){var o=g[C];if(o.startTime>=S&&o.endTime<=I)w.push(o);else if(o.startTime>I)return w}return w}},"./src/utils/time-ranges.ts":function(he,Y,k){"use strict";k.r(Y);var V={toString:function(R){for(var W="",F=R.length,O=0;O<F;O++)W+="["+R.start(O).toFixed(3)+","+R.end(O).toFixed(3)+"]";return W}};Y.default=V},"./src/utils/timescale-conversion.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"toTimescaleFromBase",function(){return _}),k.d(Y,"toTimescaleFromScale",function(){return R}),k.d(Y,"toMsFromMpegTsClock",function(){return W}),k.d(Y,"toMpegTsClockFromTimescale",function(){return F});var V=9e4;function _(O,M,g,S){g===void 0&&(g=1),S===void 0&&(S=!1);var I=O*M*g;return S?Math.round(I):I}function R(O,M,g,S){return g===void 0&&(g=1),S===void 0&&(S=!1),_(O,M,1/g,S)}function W(O,M){return M===void 0&&(M=!1),_(O,1e3,1/V,M)}function F(O,M){return M===void 0&&(M=1),_(O,V,1/M)}},"./src/utils/typed-array.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"sliceUint8",function(){return V});function V(_,R,W){return Uint8Array.prototype.slice?_.slice(R,W):new Uint8Array(Array.prototype.slice.call(_,R,W))}},"./src/utils/vttcue.ts":function(he,Y,k){"use strict";k.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],_=["start","middle","end","left","right"];function R(g,S){if(typeof S!="string")return!1;if(!Array.isArray(g))return!1;var I=S.toLowerCase();return~g.indexOf(I)?I:!1}function W(g){return R(V,g)}function F(g){return R(_,g)}function O(g){for(var S=arguments.length,I=new Array(S>1?S-1:0),w=1;w<S;w++)I[w-1]=arguments[w];for(var A=1;A<arguments.length;A++){var C=arguments[A];for(var h in C)g[h]=C[h]}return g}function M(g,S,I){var w=this,A={enumerable:!0};w.hasBeenReset=!1;var C="",h=!1,o=g,s=S,u=I,y=null,m="",p=!0,D="auto",b="start",c=50,d="middle",l=50,a="middle";Object.defineProperty(w,"id",O({},A,{get:function(){return C},set:function(f){C=""+f}})),Object.defineProperty(w,"pauseOnExit",O({},A,{get:function(){return h},set:function(f){h=!!f}})),Object.defineProperty(w,"startTime",O({},A,{get:function(){return o},set:function(f){if(typeof f!="number")throw new TypeError("Start time must be set to a number.");o=f,this.hasBeenReset=!0}})),Object.defineProperty(w,"endTime",O({},A,{get:function(){return s},set:function(f){if(typeof f!="number")throw new TypeError("End time must be set to a number.");s=f,this.hasBeenReset=!0}})),Object.defineProperty(w,"text",O({},A,{get:function(){return u},set:function(f){u=""+f,this.hasBeenReset=!0}})),Object.defineProperty(w,"region",O({},A,{get:function(){return y},set:function(f){y=f,this.hasBeenReset=!0}})),Object.defineProperty(w,"vertical",O({},A,{get:function(){return m},set:function(f){var E=W(f);if(E===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=E,this.hasBeenReset=!0}})),Object.defineProperty(w,"snapToLines",O({},A,{get:function(){return p},set:function(f){p=!!f,this.hasBeenReset=!0}})),Object.defineProperty(w,"line",O({},A,{get:function(){return D},set:function(f){if(typeof f!="number"&&f!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=f,this.hasBeenReset=!0}})),Object.defineProperty(w,"lineAlign",O({},A,{get:function(){return b},set:function(f){var E=F(f);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");b=E,this.hasBeenReset=!0}})),Object.defineProperty(w,"position",O({},A,{get:function(){return c},set:function(f){if(f<0||f>100)throw new Error("Position must be between 0 and 100.");c=f,this.hasBeenReset=!0}})),Object.defineProperty(w,"positionAlign",O({},A,{get:function(){return d},set:function(f){var E=F(f);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");d=E,this.hasBeenReset=!0}})),Object.defineProperty(w,"size",O({},A,{get:function(){return l},set:function(f){if(f<0||f>100)throw new Error("Size must be between 0 and 100.");l=f,this.hasBeenReset=!0}})),Object.defineProperty(w,"align",O({},A,{get:function(){return a},set:function(f){var E=F(f);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");a=E,this.hasBeenReset=!0}})),w.displayState=void 0}return M.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},M}()},"./src/utils/vttparser.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"parseTimeStamp",function(){return R}),k.d(Y,"fixLineBreaks",function(){return S}),k.d(Y,"VTTParser",function(){return I});var V=k("./src/utils/vttcue.ts"),_=function(){function w(){}var A=w.prototype;return A.decode=function(h,o){if(!h)return"";if(typeof h!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(h))},w}();function R(w){function A(h,o,s,u){return(h|0)*3600+(o|0)*60+(s|0)+parseFloat(u||0)}var C=w.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return C?parseFloat(C[2])>59?A(C[2],C[3],0,C[4]):A(C[1],C[2],C[3],C[4]):null}var W=function(){function w(){this.values=Object.create(null)}var A=w.prototype;return A.set=function(h,o){!this.get(h)&&o!==""&&(this.values[h]=o)},A.get=function(h,o,s){return s?this.has(h)?this.values[h]:o[s]:this.has(h)?this.values[h]:o},A.has=function(h){return h in this.values},A.alt=function(h,o,s){for(var u=0;u<s.length;++u)if(o===s[u]){this.set(h,o);break}},A.integer=function(h,o){/^-?\d+$/.test(o)&&this.set(h,parseInt(o,10))},A.percent=function(h,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var s=parseFloat(o);if(s>=0&&s<=100)return this.set(h,s),!0}return!1},w}();function F(w,A,C,h){var o=h?w.split(h):[w];for(var s in o){if(typeof o[s]!="string")continue;var u=o[s].split(C);if(u.length!==2)continue;var y=u[0],m=u[1];A(y,m)}}var O=new V.default(0,0,""),M=O.align==="middle"?"middle":"center";function g(w,A,C){var h=w;function o(){var y=R(w);if(y===null)throw new Error("Malformed timestamp: "+h);return w=w.replace(/^[^\sa-zA-Z-]+/,""),y}function s(y,m){var p=new W;F(y,function(c,d){var l;switch(c){case"region":for(var a=C.length-1;a>=0;a--)if(C[a].id===d){p.set(c,C[a].region);break}break;case"vertical":p.alt(c,d,["rl","lr"]);break;case"line":l=d.split(","),p.integer(c,l[0]),p.percent(c,l[0])&&p.set("snapToLines",!1),p.alt(c,l[0],["auto"]),l.length===2&&p.alt("lineAlign",l[1],["start",M,"end"]);break;case"position":l=d.split(","),p.percent(c,l[0]),l.length===2&&p.alt("positionAlign",l[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":p.percent(c,d);break;case"align":p.alt(c,d,["start",M,"end","left","right"]);break}},/:/,/\s/),m.region=p.get("region",null),m.vertical=p.get("vertical","");var D=p.get("line","auto");D==="auto"&&O.line===-1&&(D=-1),m.line=D,m.lineAlign=p.get("lineAlign","start"),m.snapToLines=p.get("snapToLines",!0),m.size=p.get("size",100),m.align=p.get("align",M);var b=p.get("position","auto");b==="auto"&&O.position===50&&(b=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=b}function u(){w=w.replace(/^\s+/,"")}if(u(),A.startTime=o(),u(),w.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+h);w=w.substr(3),u(),A.endTime=o(),u(),s(w,A)}function S(w){return w.replace(/<br(?: \/)?>/gi,`
`)}var I=function(){function w(){this.state="INITIAL",this.buffer="",this.decoder=new _,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var A=w.prototype;return A.parse=function(h){var o=this;h&&(o.buffer+=o.decoder.decode(h,{stream:!0}));function s(){var b=o.buffer,c=0;for(b=S(b);c<b.length&&b[c]!=="\r"&&b[c]!==`
`;)++c;var d=b.substr(0,c);return b[c]==="\r"&&++c,b[c]===`
`&&++c,o.buffer=b.substr(c),d}function u(b){F(b,function(c,d){},/:/)}try{var y="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;y=s();var m=y.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var p=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;p?p=!1:y=s();switch(o.state){case"HEADER":/:/.test(y)?u(y):y||(o.state="ID");continue;case"NOTE":y||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(y)){o.state="NOTE";break}if(!y)continue;if(o.cue=new V.default(0,0,""),o.state="CUE",y.indexOf("-->")===-1){o.cue.id=y;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{g(y,o.cue,o.regionList)}catch(b){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var D=y.indexOf("-->")!==-1;if(!y||D&&(p=!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+=y}continue;case"BADCUE":y||(o.state="ID")}}}catch(b){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},A.flush=function(){var h=this;try{if((h.cue||h.state==="HEADER")&&(h.buffer+=`
`,h.parse()),h.state==="INITIAL"||h.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){h.onparsingerror&&h.onparsingerror(o)}return h.onflush&&h.onflush(),this},w}()},"./src/utils/webvtt-parser.ts":function(he,Y,k){"use strict";k.r(Y),k.d(Y,"generateCueId",function(){return I}),k.d(Y,"parseWebVTT",function(){return A});var V=k("./src/polyfills/number.ts"),_=k("./src/utils/vttparser.ts"),R=k("./src/demux/id3.ts"),W=k("./src/utils/timescale-conversion.ts"),F=k("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,M=function(h,o,s){return s===void 0&&(s=0),h.substr(s,o.length)===o},g=function(h){var o=parseInt(h.substr(-3)),s=parseInt(h.substr(-6,2)),u=parseInt(h.substr(-9,2)),y=h.length>9?parseInt(h.substr(0,h.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(o)||!Object(V.isFiniteNumber)(s)||!Object(V.isFiniteNumber)(u)||!Object(V.isFiniteNumber)(y))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+h);return o+=1e3*s,o+=60*1e3*u,o+=60*60*1e3*y,o},S=function(h){for(var o=5381,s=h.length;s;)o=o*33^h.charCodeAt(--s);return(o>>>0).toString()};function I(C,h,o){return S(C.toString())+S(h.toString())+S(o)}var w=function(h,o,s){var u=h[o],y=h[u.prevCC];if(!y||!y.new&&u.new){h.ccOffset=h.presentationOffset=u.start,u.new=!1;return}for(;(m=y)!==null&&m!==void 0&&m.new;){var m;h.ccOffset+=u.start-y.start,u.new=!1,u=y,y=h[u.prevCC]}h.presentationOffset=s};function A(C,h,o,s,u,y,m,p){var D=new _.VTTParser,b=Object(R.utf8ArrayToStr)(new Uint8Array(C)).trim().replace(O,`
`).split(`
`),c=[],d=Object(W.toMpegTsClockFromTimescale)(h,o),l="00:00.000",a=0,v=0,f,E=!0,P=!1;D.oncue=function(H){var Q=s[u],re=s.ccOffset,z=(a-d)/9e4;if(Q!=null&&Q.new&&(v!==void 0?re=s.ccOffset=Q.start:w(s,u,z)),z&&(re=z-s.presentationOffset),P){var U=H.endTime-H.startTime,ae=Object(F.normalizePts)((H.startTime+re-v)*9e4,y*9e4)/9e4;H.startTime=ae,H.endTime=ae+U}var fe=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(fe)),H.id||(H.id=I(H.startTime,H.endTime,fe)),H.endTime>0&&c.push(H)},D.onparsingerror=function(H){f=H},D.onflush=function(){if(f){p(f);return}m(c)},b.forEach(function(H){if(E)if(M(H,"X-TIMESTAMP-MAP=")){E=!1,P=!0,H.substr(16).split(",").forEach(function(Q){M(Q,"LOCAL:")?l=Q.substr(6):M(Q,"MPEGTS:")&&(a=parseInt(Q.substr(7)))});try{v=g(l)/1e3}catch(Q){P=!1,f=Q}return}else H===""&&(E=!1);D.parse(H+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(he,Y,k){"use strict";k.r(Y);var V=k("./src/utils/logger.ts"),_=k("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,W=function(){function F(M){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=M?M.xhrSetup:null,this.stats=new _.LoadStats,this.retryDelay=0}var O=F.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},O.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(g,S,I){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=S,this.callbacks=I,this.retryDelay=S.retryDelay,this.loadInternal()},O.loadInternal=function(){var g=this.config,S=this.context;if(!g)return;var I=this.loader=new self.XMLHttpRequest,w=this.stats;w.loading.first=0,w.loaded=0;var A=this.xhrSetup;try{if(A)try{A(I,S.url)}catch(o){I.open("GET",S.url,!0),A(I,S.url)}I.readyState||I.open("GET",S.url,!0);var C=this.context.headers;if(C)for(var h in C)I.setRequestHeader(h,C[h])}catch(o){this.callbacks.onError({code:I.status,text:o.message},S,I);return}S.rangeEnd&&I.setRequestHeader("Range","bytes="+S.rangeStart+"-"+(S.rangeEnd-1)),I.onreadystatechange=this.readystatechange.bind(this),I.onprogress=this.loadprogress.bind(this),I.responseType=S.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),I.send()},O.readystatechange=function(){var g=this.context,S=this.loader,I=this.stats;if(!g||!S)return;var w=S.readyState,A=this.config;if(I.aborted)return;if(w>=2)if(self.clearTimeout(this.requestTimeout),I.loading.first===0&&(I.loading.first=Math.max(self.performance.now(),I.loading.start)),w===4){S.onreadystatechange=null,S.onprogress=null;var C=S.status;if(C>=200&&C<300){I.loading.end=Math.max(self.performance.now(),I.loading.first);var h,o;if(g.responseType==="arraybuffer"?(h=S.response,o=h.byteLength):(h=S.responseText,o=h.length),I.loaded=I.total=o,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(I,g,h,S),!this.callbacks)return;var u={url:S.responseURL,data:h};this.callbacks.onSuccess(u,I,g,S)}else I.retry>=A.maxRetry||C>=400&&C<499?(V.logger.error(C+" while loading "+g.url),this.callbacks.onError({code:C,text:S.statusText},g,S)):(V.logger.warn(C+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,A.maxRetryDelay),I.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.timeout)},O.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(g){var S=this.stats;S.loaded=g.loaded,g.lengthComputable&&(S.total=g.total)},O.getCacheAge=function(){var g=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var S=this.loader.getResponseHeader("age");g=S?parseFloat(S):null}return g},F}();Y.default=W}}).default})},vHTk:function(Pe,Re,$){Pe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(Pe,Re){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD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