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
1004 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[251,7,9,10],{"+NIl":function(_e,Ie,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(Y,L){"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 k(w){var A=w.cmdState.pop();A&&A.closeBracket()}function j(w){for(var A=w.cmdState,C=A.length-1;C>=0;C--){var d=A[C];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function U(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=U("importmodule","tag",["string","builtin"]),O.documentclass=U("documentclass","tag",["","atom"]),O.usepackage=U("usepackage","tag",["atom"]),O.begin=U("begin","tag",["atom"]),O.end=U("end","tag",["atom"]),O.label=U("label","tag",["atom"]),O.ref=U("ref","tag",["atom"]),O.eqref=U("eqref","tag",["atom"]),O.cite=U("cite","tag",["atom"]),O.bibitem=U("bibitem","tag",["atom"]),O.Bibitem=U("Bibitem","tag",["atom"]),O.RBibitem=U("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(w,A){w.f=A}function v(w,A){var C;if(w.match(/^\\[a-zA-Z@]+/)){var d=w.current().slice(1);return C=O.hasOwnProperty(d)?O[d]:O.DEFAULT,C=new C,V(A,C),I(A,M),C.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return I(A,function(l,u){return S(l,u,"\\]")}),"keyword";if(w.match("\\("))return I(A,function(l,u){return S(l,u,"\\)")}),"keyword";if(w.match("$$"))return I(A,function(l,u){return S(l,u,"$$")}),"keyword";if(w.match("$"))return I(A,function(l,u){return S(l,u,"$")}),"keyword";var o=w.next();if(o=="%")return w.skipToEnd(),"comment";if(o=="}"||o=="]"){if(C=_(A),C)C.closeBracket(o),I(A,M);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=j(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 I(A,v),"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 d=w.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(w.skipToEnd(),"comment"):"error"}function M(w,A){var C=w.peek(),d;return C=="{"||C=="["?(d=_(A),d.openBracket(C),w.eat(C),I(A,v),"bracket"):/[ \t\r]/.test(C)?(w.eat(C),null):(I(A,v),k(A),v(w,A))}return{startState:function(){var w=L.inMathMode?function(A,C){return S(A,C)}:v;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=v,w.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"/GNS":function(_e,Ie,q){_e.exports=q.p+"static/search1.c4136dd4.png"},"19Vz":function(_e,Ie,q){(function(ue){ue(q("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(U,O,I){var v=I&&I!=ue.Init;if(O&&!v)U.on("blur",_),U.on("change",k),U.on("swapDoc",k),ue.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){V(U)}),k(U);else if(!O&&v){U.off("blur",_),U.off("change",k),U.off("swapDoc",k),ue.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),Y(U);var S=U.getWrapperElement();S.className=S.className.replace(" CodeMirror-empty","")}O&&!U.hasFocus()&&_(U)});function Y(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function L(U){Y(U);var O=U.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=U.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var I=U.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),O.appendChild(I),U.display.lineSpace.insertBefore(O,U.display.lineSpace.firstChild)}function V(U){setTimeout(function(){var O=!1,I=U.getInputField();I.nodeName=="TEXTAREA"?O=!I.value:U.lineCount()==1&&(O=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),O?L(U):Y(U)},20)}function _(U){j(U)&&L(U)}function k(U){var O=U.getWrapperElement(),I=j(U);O.className=O.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?L(U):Y(U)}function j(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(_e,Ie,q){(function(ue){ue(q("VrN/"))})(function(ue){"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},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function(V,_){var k=V.indentUnit,j={},U=_.htmlMode?Y:L;for(var O in U)j[O]=U[O];for(var O in _)j[O]=_[O];var I,v;function S(a,g){function p(G){return g.tokenize=G,G(a,g)}var y=a.next();if(y=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?p(A("atom","]]>")):null:a.match("--")?p(A("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),p(C(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),g.tokenize=A("meta","?>"),"meta"):(I=a.eat("/")?"closeTag":"openTag",g.tokenize=M,"tag bracket");if(y=="&"){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 M(a,g){var p=a.next();if(p==">"||p=="/"&&a.eat(">"))return g.tokenize=S,I=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return I="equals",null;if(p=="<"){g.tokenize=S,g.state=u,g.tagName=g.tagStart=null;var y=g.tokenize(a,g);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(p)?(g.tokenize=w(p),g.stringStartCol=a.column(),g.tokenize(a,g)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(a){var g=function(p,y){for(;!p.eol();)if(p.next()==a){y.tokenize=M;break}return"string"};return g.isInAttribute=!0,g}function A(a,g){return function(p,y){for(;!p.eol();){if(p.match(g)){y.tokenize=S;break}p.next()}return a}}function C(a){return function(g,p){for(var y;(y=g.next())!=null;){if(y=="<")return p.tokenize=C(a+1),p.tokenize(g,p);if(y==">")if(a==1){p.tokenize=S;break}else return p.tokenize=C(a-1),p.tokenize(g,p)}return"meta"}}function d(a,g,p){this.prev=a.context,this.tagName=g,this.indent=a.indented,this.startOfLine=p,(j.doNotIndent.hasOwnProperty(g)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,g){for(var p;;){if(!a.context)return;if(p=a.context.tagName,!j.contextGrabbers.hasOwnProperty(p)||!j.contextGrabbers[p].hasOwnProperty(g))return;o(a)}}function u(a,g,p){return a=="openTag"?(p.tagStart=g.column(),x):a=="closeTag"?m:u}function x(a,g,p){return a=="word"?(p.tagName=g.current(),v="tag",b):j.allowMissingTagName&&a=="endTag"?(v="tag bracket",b(a,g,p)):(v="error",x)}function m(a,g,p){if(a=="word"){var y=g.current();return p.context&&p.context.tagName!=y&&j.implicitlyClosed.hasOwnProperty(p.context.tagName)&&o(p),p.context&&p.context.tagName==y||j.matchClosing===!1?(v="tag",f):(v="tag error",D)}else return j.allowMissingTagName&&a=="endTag"?(v="tag bracket",f(a,g,p)):(v="error",D)}function f(a,g,p){return a!="endTag"?(v="error",f):(o(p),u)}function D(a,g,p){return v="error",f(a,g,p)}function b(a,g,p){if(a=="word")return v="attribute",c;if(a=="endTag"||a=="selfcloseTag"){var y=p.tagName,P=p.tagStart;return p.tagName=p.tagStart=null,a=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(y)?l(p,y):(l(p,y),p.context=new d(p,y,P==p.indented)),u}return v="error",b}function c(a,g,p){return a=="equals"?h:(j.allowMissing||(v="error"),b(a,g,p))}function h(a,g,p){return a=="string"?s:a=="word"&&j.allowUnquoted?(v="string",b):(v="error",b(a,g,p))}function s(a,g,p){return a=="string"?s:b(a,g,p)}return{startState:function(a){var g={tokenize:S,state:u,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(g.baseIndent=a),g},token:function(a,g){if(!g.tagName&&a.sol()&&(g.indented=a.indentation()),a.eatSpace())return null;I=null;var p=g.tokenize(a,g);return(p||I)&&p!="comment"&&(v=null,g.state=g.state(I||p,a,g),v&&(p=v=="error"?p+" error":v)),p},indent:function(a,g,p){var y=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+k;if(y&&y.noIndent)return ue.Pass;if(a.tokenize!=M&&a.tokenize!=S)return p?p.match(/^(\s*)/)[0].length:0;if(a.tagName)return j.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+k*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/<!\[CDATA\[/.test(g))return 0;var P=g&&/^<(\/)?([\w_:\.-]*)/.exec(g);if(P&&P[1])for(;y;)if(y.tagName==P[2]){y=y.prev;break}else if(j.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(P)for(;y;){var G=j.contextGrabbers[y.tagName];if(G&&G.hasOwnProperty(P[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+k:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(a){a.state==h&&(a.state=b)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var g=[],p=a.context;p;p=p.prev)p.tagName&&g.push(p.tagName);return g.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(_e,Ie,q){"use strict";var ue=q("Awhp"),Y=q("KrTs"),L=q("+L6B"),V=q("2/Rp"),_=q("5NDa"),k=q("5rEg"),j=q("0Owb"),U=q("oBTY"),O=q("tJVT"),I=q("PpiC"),v=q("q1tI"),S=q.n(v),M=function(A){var C=A.InputRight,d=A.value,o=d===void 0?[]:d,l=A.onChange,u=l===void 0?function(){}:l,x=Object(I.a)(A,["InputRight","value","onChange"]),m=Object(v.useState)(),f=Object(O.a)(m,2),D=f[0],b=f[1],c=function(a){var g=o.filter(function(p,y){return y!==a});u(g)},h=function(a){if(a.preventDefault(),!D)return;u([].concat(Object(U.a)(o),[D])),b(null)};return S.a.createElement("div",null,S.a.createElement(k.a,Object(j.a)({},x,{value:D,onChange:function(a){return b(a.target.value)},onPressEnter:h,onBlur:h})),C,S.a.createElement("div",{className:"mt20"},o==null?void 0:o.map(function(s,a){return S.a.createElement(Y.a,{className:"ml10 mr10",count:"x",onClick:function(){return c(a)}},S.a.createElement(V.a,{type:"primary",ghost:!0},s))})))};Ie.a=M},"4qgm":function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqL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G5/LgKxQ+A80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(_e,Ie,q){"use strict";q.d(Ie,"a",function(){return l});var ue=q("Ty5D"),Y=q("dI71"),L=q("q1tI"),V=q.n(L),_=q("YS25"),k=q("17x9"),j=q.n(k),U=q("wx14"),O=q("zLVn"),I=q("9R94"),v=function(h){Object(Y.a)(s,h);function s(){for(var g,p=arguments.length,y=new Array(p),P=0;P<p;P++)y[P]=arguments[P];return g=h.call.apply(h,[this].concat(y))||this,g.history=Object(_.a)(g.props),g}var a=s.prototype;return a.render=function(){return V.a.createElement(ue.c,{history:this.history,children:this.props.children})},s}(V.a.Component),S=function(h){Object(Y.a)(s,h);function s(){for(var g,p=arguments.length,y=new Array(p),P=0;P<p;P++)y[P]=arguments[P];return g=h.call.apply(h,[this].concat(y))||this,g.history=Object(_.b)(g.props),g}var a=s.prototype;return a.render=function(){return V.a.createElement(ue.c,{history:this.history,children:this.props.children})},s}(V.a.Component),M=function(s,a){return typeof s=="function"?s(a):s},w=function(s,a){return typeof s=="string"?Object(_.c)(s,null,null,a):s},A=function(s){return s},C=V.a.forwardRef;typeof C=="undefined"&&(C=A);function d(h){return!!(h.metaKey||h.altKey||h.ctrlKey||h.shiftKey)}var o=C(function(h,s){var a=h.innerRef,g=h.navigate,p=h.onClick,y=Object(O.a)(h,["innerRef","navigate","onClick"]),P=y.target,G=Object(U.a)({},y,{onClick:function(re){try{p&&p(re)}catch(z){throw re.preventDefault(),z}!re.defaultPrevented&&re.button===0&&(!P||P==="_self")&&!d(re)&&(re.preventDefault(),g())}});return A!==C?G.ref=s||a:G.ref=a,V.a.createElement("a",G)}),l=C(function(h,s){var a=h.component,g=a===void 0?o:a,p=h.replace,y=h.to,P=h.innerRef,G=Object(O.a)(h,["component","replace","to","innerRef"]);return V.a.createElement(ue.e.Consumer,null,function(Q){Q||Object(I.a)(!1);var re=Q.history,z=w(M(y,Q.location),Q.location),F=z?re.createHref(z):"",ne=Object(U.a)({},G,{href:F,navigate:function(){var ge=M(y,Q.location),be=p?re.replace:re.push;be(ge)}});return A!==C?ne.ref=s||P:ne.innerRef=P,V.a.createElement(g,ne)})});if(!1)var u,x;var m=function(s){return s},f=V.a.forwardRef;typeof f=="undefined"&&(f=m);function D(){for(var h=arguments.length,s=new Array(h),a=0;a<h;a++)s[a]=arguments[a];return s.filter(function(g){return g}).join(" ")}var b=f(function(h,s){var a=h["aria-current"],g=a===void 0?"page":a,p=h.activeClassName,y=p===void 0?"active":p,P=h.activeStyle,G=h.className,Q=h.exact,re=h.isActive,z=h.location,F=h.sensitive,ne=h.strict,ce=h.style,ge=h.to,be=h.innerRef,Be=Object(O.a)(h,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(ue.e.Consumer,null,function(Se){Se||Object(I.a)(!1);var Le=z||Se.location,Te=w(M(ge,Le),Le),we=Te.pathname,ve=we&&we.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),H=ve?Object(ue.f)(Le.pathname,{path:ve,exact:Q,sensitive:F,strict:ne}):null,T=!!(re?re(H,Le):H),R=T?D(G,y):G,W=T?Object(U.a)({},ce,{},P):ce,$=Object(U.a)({"aria-current":T&&g||null,className:R,style:W,to:Te},Be);return m!==f?$.ref=s||be:$.innerRef=be,V.a.createElement(l,$)})});if(!1)var c},"5D2P":function(_e,Ie){_e.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="},"7Cbv":function(_e,Ie,q){"use strict";var ue=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 L(){if(!ue)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ue(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 _(M){return typeof M=="string"&&V.test(M)}for(var k=_,j=[],U=0;U<256;++U)j.push((U+256).toString(16).substr(1));function O(M){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(j[M[w+0]]+j[M[w+1]]+j[M[w+2]]+j[M[w+3]]+"-"+j[M[w+4]]+j[M[w+5]]+"-"+j[M[w+6]]+j[M[w+7]]+"-"+j[M[w+8]]+j[M[w+9]]+"-"+j[M[w+10]]+j[M[w+11]]+j[M[w+12]]+j[M[w+13]]+j[M[w+14]]+j[M[w+15]]).toLowerCase();if(!k(A))throw TypeError("Stringified UUID is invalid");return A}var I=O;function v(M,w,A){M=M||{};var C=M.random||(M.rng||L)();if(C[6]=C[6]&15|64,C[8]=C[8]&63|128,w){A=A||0;for(var d=0;d<16;++d)w[A+d]=C[d];return w}return I(C)}var S=Ie.a=v},"7ZXX":function(_e,Ie,q){_e.exports=q.p+"static/err.6e7c5817.png"},"7ahc":function(_e,Ie,q){"use strict";q.d(Ie,"a",function(){return x});var ue=q("k1fw"),Y=q("0Owb"),L=q("+L6B"),V=q("2/Rp"),_=q("y8nQ"),k=q("Vl3Y"),j=q("tJVT"),U=q("OaEy"),O=q("2fM7"),I=q("q1tI"),v=q.n(I),S=q("VrN/"),M=q.n(S),w=q("p77/"),A=q.n(w),C=q("c5Ni"),d=q.n(C),o=O.a.Option,l={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"]};Ie.b=function(m){var f=m.callback,D=m.onCancel,b=Object(I.useState)("python"),c=Object(j.a)(b,2),h=c[0],s=c[1];function a(p){s(u[p][1])}function g(p){f(p)}return v.a.createElement(k.a,Object(Y.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:g}),v.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(O.a,{onChange:a},Object.keys(u).map(function(p){return v.a.createElement(o,{key:p,value:p},u[p][0])}))),v.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(x,{mode:h})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(V.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function x(m){var f=m.value,D=m.onChange,b=m.mode,c=m.options,h=c===void 0?{}:c,s=Object(I.useRef)(),a=Object(I.useState)(),g=Object(j.a)(a,2),p=g[0],y=g[1];return Object(I.useEffect)(function(){if(p){function P(G){var Q=G.getValue();D&&D(Q)}return p.on("change",P),function(){p.off("change",P)}}},[p,D]),Object(I.useEffect)(function(){p&&p.setOption("mode",b)},[p,b]),Object(I.useEffect)(function(){p&&((f!==p.getValue()||f==="")&&setTimeout(function(){p.setValue(f||" ")},300))},[p,f]),Object(I.useEffect)(function(){if(s.current&&!p){var P=M.a.fromTextArea(s.current,Object(ue.a)({mode:b,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},h));y(P)}},[s.current,p]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:s}))}},"7ixt":function(_e,Ie,q){"use strict";q.d(Ie,"a",function(){return L});var ue={adjustX:1,adjustY:1},Y=[0,0],L={left:{points:["cr","cl"],overflow:ue,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:ue,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:ue,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:ue,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:ue,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:ue,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:ue,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:ue,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:ue,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:ue,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:ue,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:ue,offset:[-4,0],targetOffset:Y}},V=L},"7v3h":function(_e,Ie,q){_e.exports=q.p+"static/empty2.dd73f390.png"},"8/bI":function(_e,Ie,q){_e.exports=q.p+"static/empty.8918e228.png"},"8EBN":function(_e,Ie,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";ue.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<ue.modeInfo.length;Y++){var L=ue.modeInfo[Y];L.mimes&&(L.mime=L.mimes[0])}ue.findModeByMIME=function(V){V=V.toLowerCase();for(var _=0;_<ue.modeInfo.length;_++){var k=ue.modeInfo[_];if(k.mime==V)return k;if(k.mimes){for(var j=0;j<k.mimes.length;j++)if(k.mimes[j]==V)return k}}if(/\+xml$/.test(V))return ue.findModeByMIME("application/xml");if(/\+json$/.test(V))return ue.findModeByMIME("application/json")},ue.findModeByExtension=function(V){V=V.toLowerCase();for(var _=0;_<ue.modeInfo.length;_++){var k=ue.modeInfo[_];if(k.ext){for(var j=0;j<k.ext.length;j++)if(k.ext[j]==V)return k}}},ue.findModeByFileName=function(V){for(var _=0;_<ue.modeInfo.length;_++){var k=ue.modeInfo[_];if(k.file&&k.file.test(V))return k}var j=V.lastIndexOf("."),U=j>-1&&V.substring(j+1,V.length);if(U)return ue.findModeByExtension(U)},ue.findModeByName=function(V){V=V.toLowerCase();for(var _=0;_<ue.modeInfo.length;_++){var k=ue.modeInfo[_];if(k.name.toLowerCase()==V)return k;if(k.alias){for(var j=0;j<k.alias.length;j++)if(k.alias[j].toLowerCase()==V)return k}}}})},"8hTe":function(_e,Ie,q){_e.exports={button:"button___1wy9m"}},"9Bee":function(_e,Ie,q){"use strict";var ue=q("DYRE"),Y=q("zeV3"),L=q("+L6B"),V=q("2/Rp"),_=q("k1fw"),k=q("9og8"),j=q("tJVT"),U=q("WmNS"),O=q.n(U),I=q("q1tI"),v=q.n(I),S=q("vg9a"),M=q("DlQD"),w=q.n(M),A=q("rUJ1");function C(oe,J){var Z=oe.match(/^(\s+)(?:```)/);if(Z===null)return J;var ae=Z[1];return J.split(`
`).map(function(se){var ee=se.match(/^\s+/);if(ee===null)return se;var ie=Object(j.a)(ee,1),le=ie[0];return le.length>=ae.length?se.slice(ae.length):se}).join(`
`)}var d=[],o=["<ul>"],l=new w.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function x(){d.length=0,o=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(oe,J,Z,ae){if(J>=oe.length||oe[J].level<=Z)return J;var se=oe[J];ae.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),J++;var ee=[];return J=f(oe,J,se.level,ee),ee.length>0&&(ae.push("<ul>"),ee.forEach(function(ie){ae.push(ie)}),ae.push("</ul>")),ae.push("</li>"),J=f(oe,J,Z,ae),J}function D(){return f(d,0,0,o),o.push("</ul>"),o.join("")}var b={heading:function(J){var Z=u.exec(J);if(Z)return{type:"heading",raw:Z[0],depth:Z[1].length,text:Z[2]}},fences:function(J){var Z=this.rules.block.fences.exec(J);if(Z){var ae=Z[0],se=C(ae,Z[3]||""),ee=Z[2]?Z[2].trim():Z[2];if(["latex","katex","math"].indexOf(ee)>=0){var ie=s(),le=se;se=ie,a[ie]={type:"block",expression:le}}return{type:"code",raw:ae,lang:ee,text:se}}}},c=/(?:\${2})([^\n`]+?)(?:\${2})/gi,h=0,s=function(){return"__special_katext_id_".concat(h++,"__")},a={};function g(){return a}function p(){h=0,a={}}function y(oe){return oe=oe.replace(c,function(J,Z){var ae=s();return a[ae]={type:"inline",expression:Z},ae}),oe}var P=l.listitem;l.listitem=function(oe){return P(y(oe))};var G=l.paragraph;l.paragraph=function(oe){return G(y(oe))};var Q=l.tablecell;l.tablecell=function(oe,J){return Q(y(oe),J)},l.code=function(oe,J,Z){var ae=(J||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(oe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(J,'">').concat(Z?oe:Object(A.escape)(oe,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(Z?oe:Object(A.escape)(oe,!0))+"</code></pre>"},l.heading=function(oe,J,Z){var ae=this.options.headerPrefix+Z.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:ae,level:J,text:oe}),"<h"+J+' id="'+ae+'">'+oe+"</h"+J+">"},w.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),w.a.use({tokenizer:b,renderer:l});var re=w.a,z=q("SJMd"),F=q("ulZh"),ne=q.n(F),ce=q("m3rI"),ge=q("Oy/b"),be=q("p5ED"),Be=q("ErOA"),Se=q("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 Le=function(oe,J){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,ae){Z.__proto__=ae}||function(Z,ae){for(var se in ae)Object.prototype.hasOwnProperty.call(ae,se)&&(Z[se]=ae[se])})(oe,J)};function Te(oe,J){if(typeof J!="function"&&J!==null)throw new TypeError("Class extends value "+String(J)+" is not a constructor or null");function Z(){this.constructor=oe}Le(oe,J),oe.prototype=J===null?Object.create(J):(Z.prototype=J.prototype,new Z)}function we(oe,J,Z,ae){return new(Z||(Z=Promise))(function(se,ee){function ie(me){try{he(ae.next(me))}catch(ye){ee(ye)}}function le(me){try{he(ae.throw(me))}catch(ye){ee(ye)}}function he(me){var ye;me.done?se(me.value):(ye=me.value,ye instanceof Z?ye:new Z(function(ke){ke(ye)})).then(ie,le)}he((ae=ae.apply(oe,J||[])).next())})}function ve(oe,J){var Z,ae,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(he){return function(me){return function(ye){if(Z)throw new TypeError("Generator is already executing.");for(;ie;)try{if(Z=1,ae&&(se=2&ye[0]?ae.return:ye[0]?ae.throw||((se=ae.return)&&se.call(ae),0):ae.next)&&!(se=se.call(ae,ye[1])).done)return se;switch(ae=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++,ae=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=J.call(oe,ie)}catch(ke){ye=[6,ke],ae=0}finally{Z=se=0}if(5&ye[0])throw ye[1];return{value:ye[0]?ye[1]:void 0,done:!0}}([he,me])}}}var H=function(){function oe(){}return oe.addKey=function(J){oe.key=J},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(J,Z){for(var ae=0,se=Z;ae<se.length;ae++){var ee=se[ae],ie=ee[0],le=ee[1];J.setAttribute(ie,le)}},oe.createRect=function(J,Z,ae){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",J.toString()),se.setAttribute("height",Z.toString()),ae&&oe.setAttributes(se,ae),se},oe.createLine=function(J,Z,ae,se,ee){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",J.toString()),ie.setAttribute("y1",Z.toString()),ie.setAttribute("x2",ae.toString()),ie.setAttribute("y2",se.toString()),ee&&oe.setAttributes(ie,ee),ie},oe.createPolygon=function(J,Z){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",J),Z&&oe.setAttributes(ae,Z),ae},oe.createCircle=function(J,Z){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(J/2).toString()),ae.setAttribute("cy",(J/2).toString()),ae.setAttribute("r",J.toString()),Z&&oe.setAttributes(ae,Z),ae},oe.createEllipse=function(J,Z,ae){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(J/2).toString()),se.setAttribute("cy",(Z/2).toString()),se.setAttribute("rx",(J/2).toString()),se.setAttribute("ry",(Z/2).toString()),ae&&oe.setAttributes(se,ae),se},oe.createGroup=function(J){var Z=document.createElementNS("http://www.w3.org/2000/svg","g");return J&&oe.setAttributes(Z,J),Z},oe.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},oe.createMarker=function(J,Z,ae,se,ee,ie,le){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return oe.setAttributes(he,[["id",J],["orient",Z],["markerWidth",ae.toString()],["markerHeight",se.toString()],["refX",ee.toString()],["refY",ie.toString()]]),he.appendChild(le),he},oe.createText=function(J){var Z=document.createElementNS("http://www.w3.org/2000/svg","text");return Z.setAttribute("x","0"),Z.setAttribute("y","0"),J&&oe.setAttributes(Z,J),Z},oe.createTSpan=function(J,Z){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=J,Z&&oe.setAttributes(ae,Z),ae},oe.createImage=function(J){var Z=document.createElementNS("http://www.w3.org/2000/svg","image");return J&&oe.setAttributes(Z,J),Z},oe.createPoint=function(J,Z){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=J,ae.y=Z,ae},oe.createPath=function(J,Z){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",J),Z&&oe.setAttributes(ae,Z),ae},oe.createElement=function(J,Z){var ae=document.createElementNS("http://www.w3.org/2000/svg",J);return Z&&oe.setAttributes(ae,Z),ae},oe.getHollowRectanglePath=function(J,Z,ae,se,ee,ie,le,he){return"M"+J+","+Z+"V"+(Z+se)+"H"+(J+ae)+"V"+Z+"H"+ee+"V"+ie+"H"+(ee+le)+"V"+(ie+he)+"H"+ee+"V"+Z+"Z"},oe}(),R=function(){function oe(J){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+J+"_"}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(J){return this.styleSheet===void 0&&this.addStyleSheet(),J.name=""+this.classNamePrefix+J.localName,this.classes.push(J),this.styleSheet.sheet.insertRule("."+J.name+" {"+J.style+"}",this.styleSheet.sheet.cssRules.length),J},oe.prototype.addRule=function(J){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(J),this.styleSheet.sheet.insertRule(J.selector+" {"+J.style+"}",this.styleSheet.sheet.cssRules.length)},oe.prototype.addStyleSheet=function(){var J;this.styleSheet=document.createElement("style"),((J=this.styleSheetRoot)!==null&&J!==void 0?J:document.head).appendChild(this.styleSheet),this.addRule(new W("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new W("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new W("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new $("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new $("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},oe.prototype.removeStyleSheet=function(){var J;this.styleSheet&&(((J=this.styleSheetRoot)!==null&&J!==void 0?J:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},oe}(),W=function(oe,J){this.selector=oe,this.style=J},$=function(oe,J){this.localName=oe,this.style=J},N=function(){function oe(){this.blocks=[],this.display=""}return oe.prototype.addButtonBlock=function(J){J.className=this.blockClassName,J.buttonClassName=this.buttonClassName,J.buttonColorsClassName=this.buttonColorsClassName,J.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(J)},oe.prototype.addElementBlock=function(J){J.className===void 0&&(J.className=this.blockClassName),this.blocks.push(J)},oe.prototype.getUI=function(){var J=document.createElement("div");return J.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,J.style.display=this.display,this.blocks.forEach(function(Z){return J.appendChild(Z.getUI())}),J},oe}(),de=function(){function oe(){}return oe.prototype.getUI=function(){var J=document.createElement("div");if(J.className=this.className,this.minWidth!==void 0&&(J.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":J.style.justifyContent="flex-start";break;case"center":J.style.justifyContent="center";break;case"end":J.style.justifyContent="flex-end"}return J.style.whiteSpace="nowrap",J},oe}(),xe=function(oe){function J(){var Z=oe!==null&&oe.apply(this,arguments)||this;return Z.buttons=[],Z}return Te(J,oe),J.prototype.addButton=function(Z){Z.className=this.buttonClassName,Z.colorsClassName=this.buttonColorsClassName,Z.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(Z)},J.prototype.getUI=function(){var Z=oe.prototype.getUI.call(this);return this.buttons.forEach(function(ae){return Z.appendChild(ae.getUI())}),Z},J}(de),Ae=function(){function oe(J,Z){this._isActive=!1,this._isHidden=!1,this._icon=J,this.title=Z,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(oe.prototype,"icon",{get:function(){return this._icon},set:function(J){this._icon=J,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isActive",{get:function(){return this._isActive},set:function(J){this._isActive=J,this.adjustClassName()},enumerable:!1,configurable:!0}),oe.prototype.getUI=function(){var J=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 J.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}(),Ne=function(oe){function J(){var Z=oe!==null&&oe.apply(this,arguments)||this;return Z.elements=[],Z}return Te(J,oe),J.prototype.addElement=function(Z){this.elements.push(Z)},J.prototype.getUI=function(){var Z=oe.prototype.getUI.call(this);return this.elements.forEach(function(ae){return Z.appendChild(ae)}),Z},J}(de),Me=function(){function oe(J,Z){this.horizontal=J,this.vertical=Z}return Object.defineProperty(oe.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),oe.prototype.getVerticalLength=function(J){return J/this.ratio},oe.prototype.getHorizontalLength=function(J){return J*this.ratio},oe}(),Re=function(){function oe(){}return oe.getIcon=function(J,Z){if(J>0&&Z>0){var ae=new Me(J,Z),se=ae.ratio>=1?20:ae.getHorizontalLength(20),ee=ae.ratio<1?20:ae.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 he=T.createElement("clipPath",[["id","text-bg-clip"]]);le.appendChild(he);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(J+":"+Z)),ie.appendChild(ye);var ke=ye.getBBox();T.setAttributes(ye,[["x",((24-ke.width)/2).toString()],["y",((24-ke.height)/2-ke.y).toString()]]);var He=T.createPath(T.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ke.width))/2,(24-Math.ceil(ke.height))/2,Math.ceil(ke.width),Math.ceil(ke.height)));return he.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}(),Pe=function(oe){function J(Z,ae,se){var ee=oe.call(this,Z,ae)||this;return ee.isDropdownOpen=!1,ee.onClick=ee.dropdownButtonClicked,ee.dropdownButtons=se,ee}return Te(J,oe),J.prototype.setupDropdown=function(){var Z=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=Z.className,ae.colorsClassName=Z.colorsClassName,Z.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},J.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},J.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},J.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},J.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},J.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},J}(Ae),We=function(){function oe(J,Z){this.GRIP_SIZE=10,this.color=J,this.fillColor=Z,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(J){return J===this.visual||J===this.visual.childNodes[0]||J===this.visual.childNodes[1]},oe.prototype.setCenter=function(J,Z){this.visual.childNodes.forEach(function(ae){return T.setAttributes(ae,[["cx",J.toString()],["cy",Z.toString()]])})},oe}(),Qe=function(){function oe(J,Z,ae,se){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=J,this.canvasHeight=Z,this.margin=ae,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(J){this._aspectRatio=J,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(J){this._isGridVisible=J,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(J){this._zoomFactor=J,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),oe.prototype.open=function(){var J=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 Z=0;Z<this.numberOfGridLines;Z++)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(ae){return J.gridContainer.appendChild(ae)}),this.verticalGridLines.forEach(function(ae){return J.gridContainer.appendChild(ae)}),this.cropRectElement=T.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new We(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new We(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new We(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new We(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},oe.prototype.setCropRectangle=function(J){this.cropRect=J;var Z=Object.assign({},this.cropRect);this.zoomFactor!==1&&(Z.width=this.cropRect.width*this.zoomFactor,Z.height=this.cropRect.height*this.zoomFactor,Z.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-Z.width/2,Z.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-Z.height/2),T.setAttributes(this.cropRectElement,[["x",Z.x.toString()],["y",Z.y.toString()],["width",Z.width.toString()],["height",Z.height.toString()]]);var ae=Z.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ee,ie){var le=Z.y+ae*(ie+1);T.setAttributes(ee,[["x1",""+Z.x],["y1",""+le],["x2",""+(Z.x+Z.width)],["y2",""+le]])});var se=Z.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ee,ie){var le=Z.x+se*(ie+1);T.setAttributes(ee,[["x1",""+le],["y1",""+Z.y],["x2",""+le],["y2",""+(Z.y+Z.height)]])}),T.setAttributes(this.cropShadeElement,[["d",T.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,Z.x,Z.y,Z.width,Z.height)]]),this.topLeftGrip.setCenter(Z.x,Z.y),this.topRightGrip.setCenter(Z.x+Z.width,Z.y),this.bottomLeftGrip.setCenter(Z.x,Z.y+Z.height),this.bottomRightGrip.setCenter(Z.x+Z.width,Z.y+Z.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(J,Z){var ae=this.container.getBoundingClientRect();return{x:J-ae.left+this.margin,y:Z-ae.top+this.margin}},oe.prototype.onPointerDown=function(J){this.container.setPointerCapture(J.pointerId),this.previousPoint=this.clientToLocalCoordinates(J.clientX,J.clientY),this.cropRectElement===J.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(J.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(J.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(J.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(J.target)&&(this.activeGrip=this.bottomRightGrip)},oe.prototype.onPointerMove=function(J){if(this.isMoving)this.move(this.clientToLocalCoordinates(J.clientX,J.clientY));else if(this.activeGrip){var Z=this.clientToLocalCoordinates(J.clientX,J.clientY);this.resize(Z)}J.preventDefault()},oe.prototype.onPointerUp=function(J){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(J.pointerId)},oe.prototype.move=function(J){var Z=J.x-this.previousPoint.x,ae=J.y-this.previousPoint.y;this.zoomFactor!==1&&(Z=-Z/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+Z),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=J},oe.prototype.resize=function(J){var Z=Object.assign({},this.cropRect),ae=J.x-this.previousPoint.x,se=J.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:Z.x+ae<this.margin&&(ae=this.margin-Z.x),Z.x+=ae,Z.width=this.cropRect.x+this.cropRect.width-Z.x;break;case this.bottomRightGrip:case this.topRightGrip:Z.width+ae>this.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-Z.width),Z.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(Z.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),Z.height=this.aspectRatio.getVerticalLength(Z.width)):(Z.y+=se,Z.height=this.cropRect.y+this.cropRect.height-Z.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?Z.height=this.aspectRatio.getVerticalLength(Z.width):Z.height+=se}Z.width<10&&(Z.x=this.cropRect.x,Z.width=10),Z.height<10&&(Z.y=this.cropRect.y,Z.height=10),this.previousPoint=J,Z.x>=this.margin&&Z.y>=this.margin&&Z.x-this.margin+Z.width<=this.canvasWidth&&Z.y-this.margin+Z.height<=this.canvasHeight&&(this.cropRect=Z,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 J=this.cropRect.x+this.cropRect.width/2,Z=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),se=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidth<se/this.canvasHeight?this.cropRect.width=ae: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=J-this.cropRect.width/2,this.cropRect.y=Z-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(J,Z,ae,se,ee,ie){var le=ae/J,he=se/Z;return{x:(ee.x-ie)*le+ie,y:(ee.y-ie)*he+ie,width:ee.width*le,height:ee.height*he}},oe.prototype.scaleCanvas=function(J,Z){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,J,Z,this.cropRect,this.margin);this.canvasWidth=J,this.canvasHeight=Z,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},oe}(),Ve=function(){function oe(J){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=J,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(J){this._angle=J,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(J){this.controlContainer.setPointerCapture(J.pointerId),this.isDragging=!0,this.previousPoint={x:J.clientX,y:J.clientY}},oe.prototype.onPointerMove=function(J){this.isDragging&&(this.onAngleChange&&this.onAngleChange((J.clientX-this.previousPoint.x)/5),this.previousPoint.x=J.clientX)},oe.prototype.onPointerUp=function(J){this.isDragging&&this.onAngleChange&&this.onAngleChange((J.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(J.pointerId)},oe.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var J=this.angleLabelText.getBBox();T.setAttributes(this.angleLabelElement,[["x",((this.width-J.width)/2).toString()],["y",(this.height/2).toString()]])}},oe.prototype.positionScaleShape=function(){if(this.scaleShape){var J=this.scaleShape.transform.baseVal.getItem(0);J.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(J,0)}},oe.prototype.getVisual=function(){var J=document.createElementNS("http://www.w3.org/2000/svg","svg");J.setAttribute("xmlns","http://www.w3.org/2000/svg"),J.setAttribute("width",this.width+"px"),J.setAttribute("height",this.height+"px"),J.setAttribute("viewBox","0 0 "+this.width+" "+this.height),J.style.flexShrink="0",document.body.appendChild(J);for(var Z="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var se=ae%5==0?this.height/3:this.height/6;Z+="h4v"+-se+"h1v"+se}Z+="v1H0Z",this.scaleShape=T.createPath(Z);var ee=T.createTransform();this.scaleShape.transform.baseVal.appendItem(ee),J.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),J.appendChild(this.angleLabelElement),document.body.removeChild(J),J},oe}(),Ge=function(){function oe(){this.naturalSize=!1,this.imageType="image/png"}return oe.prototype.rasterize=function(J,Z,ae,se,ee,ie,le){var he=this;return new Promise(function(me){var ye=document.createElement("canvas");ye.width=J.width.baseVal.value-2*se,ye.height=J.height.baseVal.value-2*se;var ke=1,He=1;he.naturalSize===!0?(ke=Z.naturalWidth/(J.width.baseVal.value-2*se)/ie,He=Z.naturalHeight/(J.height.baseVal.value-2*se)/le,ye.width=Z.naturalWidth/ie,ye.height=Z.naturalHeight/le):he.width!==void 0&&he.height!==void 0&&(ke=he.width/ae.width,He=he.height/ae.height,ye.width*=ke,ye.height*=He);var $e=ye.getContext("2d");$e.translate(ye.width/2,ye.height/2),$e.rotate(ee*Math.PI/180),$e.scale(ie,le),$e.translate(-ye.width/2,-ye.height/2),$e.drawImage(Z,0,0,ye.width,ye.height);var et=document.createElement("canvas");et.width=ae.width*ke,et.height=ae.height*He,et.getContext("2d").putImageData($e.getImageData((ae.x-se)*ke,(ae.y-se)*He,ae.width*ke,ae.height*He),0,0),me(et.toDataURL(he.imageType,he.imageQuality))})},oe}(),at=function(){function oe(J){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 R(this.instanceNo),this.target=J,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(J){this._zoomToCropEnabled=J,J?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(J){this._isGridVisible=J,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"gridLines",{get:function(){return this._gridLines},set:function(J){this._gridLines=J,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(oe.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(J){this._rotationAngle=J,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 J;return(J=this._aspectRatio)!==null&&J!==void 0?J:this.aspectRatios[0]},set:function(J){this._aspectRatio=J},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(J){J===void 0&&(J=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),J||this.closeEventListeners.forEach(function(Z){return Z()}),this._isOpen=!1)},oe.prototype.addRenderEventListener=function(J){this.renderEventListeners.push(J)},oe.prototype.removeRenderEventListener=function(J){this.renderEventListeners.indexOf(J)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(J),1)},oe.prototype.addCloseEventListener=function(J){this.closeEventListeners.push(J)},oe.prototype.removeCloseEventListener=function(J){this.closeEventListeners.indexOf(J)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(J),1)},oe.prototype.setupResizeObserver=function(){var J=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){J.resize(J.target.clientWidth,J.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 J=1*this.target.clientWidth/this.target.clientHeight,Z=this.contentDiv.clientWidth/J>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*J:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=Z+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/J;this.resize(Z,ae)}},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(J,Z){this.imageWidth=Math.round(J),this.imageHeight=Math.round(Z),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 J=document.createElement("canvas");J.width=this.target.naturalWidth,J.height=this.target.naturalHeight,J.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var Z=J.toDataURL();T.setAttributes(this.editingTarget,[["href",Z]]),this.setEditingTargetSize()},oe.prototype.setTopLeft=function(){var J=this.target.getBoundingClientRect(),Z=this.editorCanvas.getBoundingClientRect();this.left=J.left-Z.left-this.CANVAS_MARGIN,this.top=J.top-Z.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 J=T.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(J);var Z=T.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(Z),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 Qe(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 J=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,Z=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=J+"px "+Z+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-J+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-Z+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(J){this.cropRect=J,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 J=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,Z=this.target.offsetTop>J+this.CANVAS_MARGIN?this.target.offsetTop-(J+this.CANVAS_MARGIN):0;this.coverDiv.style.top=Z+"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 J=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 Z=new xe;Z.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(Z);var ae=[];this.aspectRatios.forEach(function(He){var $e=new Ae(Re.getIcon(He.horizontal,He.vertical),He.horizontal===0&&He.vertical===0?"FREE":He.horizontal+":"+He.vertical);$e.onClick=function(){return J.ratioButtonClicked(He)},ae.push($e)}),this.aspectRatioButton=new Pe(Re.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,Z.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var se=new Ae('<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(){J.isGridVisible=!J.isGridVisible,se.isActive=J.isGridVisible},Z.addButton(se);var ee=new Ae('<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(){J.zoomToCropEnabled=!J.zoomToCropEnabled,ee.isActive=J.zoomToCropEnabled},Z.addButton(ee),!H.isLicensed){var ie=new Ne;this.topToolbar.addElementBlock(ie);var le=document.createElement("div");le.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var he=document.createElement("a");he.style.color="currentColor",he.href="https://markerjs.com/products/cropro",he.target="_blank",he.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(he),ie.addElement(le)}var me=new xe;me.minWidth=3*this.toolbarHeight+"px",me.contentAlign="end",this.topToolbar.addButtonBlock(me);var ye=new Ae('<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 ke=new Ae('<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");ke.onClick=this.close,me.addButton(ke),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ke.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},oe.prototype.addBottomToolbar=function(){var J=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 Z=new xe;Z.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(Z);var ae=new Ae('<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");ae.onClick=this.rotateLeftButtonClicked,Z.addButton(ae);var se=new Ae('<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,Z.addButton(se);var ee=new Ne;ee.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ee),this.straightener=new Ve("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){J.rotateBy(me),J.straightener.angle=J.rotationAngle},ee.addElement(this.straightener.getUI());var ie=new xe;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var le=new Ae('<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 he=new Ae('<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");he.onClick=this.flipVerticallyButtonClicked,ie.addButton(he)},oe.prototype.ratioButtonClicked=function(J){this.aspectRatio=J,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},oe.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Re.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 Me(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(J){if(J){var Z=this.cropLayer.getRescaledRect(J.width,J.height,this.imageWidth,this.imageHeight,J.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(Z),this.cropRectChanged(Z),this.flippedHorizontally=J.flippedHorizontally,this.flippedVertically=J.flippedVertically,this.applyFlip(),this.rotationAngle=J.rotationAngle,this.applyRotation()}},oe.prototype.clientToLocalCoordinates=function(J,Z){var ae=this.cropImage.getBoundingClientRect();return{x:J-ae.left,y:Z-ae.top}},oe.prototype.onWindowResize=function(){this.positionUI()},oe.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var J=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=J+"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 J=this.rotationAngle-90;this.rotationAngle%90!=0&&(J+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(J)},oe.prototype.rotateRightButtonClicked=function(){var J=this.rotationAngle+90;this.rotationAngle%90!=0&&(J-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(J)},oe.prototype.rotateTo=function(J){J=(J=J>180?J-360:J)<=-180?J+360:J,this.rotationAngle=J,this.applyRotation()},oe.prototype.rotateBy=function(J){this.rotateTo((this.rotationAngle+J)%360)},oe.prototype.applyRotation=function(){var J=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var Z=this.editingTargetRotationContainer.transform.baseVal.getItem(0);Z.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(Z,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=J},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 J,Z;return ve(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return J=ae.sent(),Z=this.getState(),this.renderEventListeners.forEach(function(se){return se(J,Z)}),this.close(!0),[2]}})})},oe.prototype.render=function(){return we(this,void 0,void 0,function(){var J;return ve(this,function(Z){switch(Z.label){case 0:return(J=new Ge).naturalSize=this.renderAtNaturalSize,J.imageType=this.renderImageType,J.imageQuality=this.renderImageQuality,J.width=this.renderWidth,J.height=this.renderHeight,this.unzoomFromCrop(),T.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,J.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 Z.sent(),[4,J.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,Z.sent()]}})})},oe.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new $("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 $("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new $("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var J=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*J)+`px;
height: `+(this.toolbarHeight-2*J)+`px;
padding: `+J+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new $("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new $("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new W("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new W("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new $("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 $("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new $("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 $("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*J)+`px;
padding: `+J+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new $("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},oe.instanceCounter=0,oe}(),Xe=q("8hTe"),Ze=q.n(Xe),De=/<pre[^>]*>/g;function rt(oe){var J=document.createElement("div");return J.innerHTML=oe,J.childNodes.length===0?"":J.childNodes[0].nodeValue}var qe=Ie.a=function(oe){var J=oe.value,Z=J===void 0?"":J,ae=oe.edit,se=ae===void 0?!1:ae,ee=oe.className,ie=oe.showTextOnly,le=oe.showLines,he=oe.replaces,me=oe.zoomImg,ye=oe.hasMask,ke=oe.style,He=ke===void 0?{}:ke,$e=oe.stylesPrev,et=$e===void 0?{}:$e,St=String(Z),ot=Object(I.useRef)(),nt=Object(I.useRef)(),Mt=Object(I.useState)(""),xt=Object(j.a)(Mt,2),It=xt[0],Ct=xt[1],ht=Object(I.useState)("office"),At=Object(j.a)(ht,2),Ot=At[0],Rt=At[1],Wt=function(){var ft=new at(nt.current);ft.displayMode="popup",ft.addRenderEventListener(function(){var ut=Object(k.a)(O.a.mark(function gt(yt){var wt;return O.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return ot.current.style.display="none",zt.next=3,Object(Be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yt}});case 3:wt=zt.sent,wt!=null&&wt.id&&he(nt.current.getAttribute("src").replace(ce.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 5:case"end":return zt.stop()}},gt)}));return function(gt){return ut.apply(this,arguments)}}()),ft.show()},qt=function(){var ft=new Se.a(nt.current);ft.settings.displayMode="popup",ft.addEventListener("render",function(){var ut=Object(k.a)(O.a.mark(function gt(yt){var wt;return O.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:if(ot.current.style.display="none",!nt.current){zt.next=6;break}return zt.next=4,Object(Be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yt.dataUrl}});case 4:wt=zt.sent,wt!=null&&wt.id&&he(nt.current.getAttribute("src").replace(ce.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 6:case"end":return zt.stop()}},gt)}));return function(gt){return ut.apply(this,arguments)}}()),ft.show(),window.markerArea=ft},hr=Object(I.useMemo)(function(){ot.current&&(ot.current.style.zIndex=-1);try{var Fe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,ft=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ut=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;St=St.replace(Fe,"("+ce.a.API_SERVER+"/api/attachments/").replace(ft,'"'+ce.a.API_SERVER+"/api/attachments/").replace(ut,'"'+ce.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(st){}var gt=re(St),yt=g();if(St.match(/\[TOC\]/)&&(gt=gt.replace("<p>[TOC]</p>",D()),x()),gt=gt.replace(/(__special_katext_id_\d+__)/g,function(st,zt){var je=yt[zt],vt=je.type,ri=je.expression;return Object(ge.renderToString)(rt(ri)||"",{displayMode:vt==="block",throwOnError:!1,output:"html"})}),gt=gt.replace(/▁/g,"\u2581\u2581\u2581"),p(),ie){var wt=document.createElement("div");return wt.innerHTML=gt,wt.innerText}return setTimeout(function(){return Ut()},500),gt},[St]),Yt=Object(I.useRef)();m.WebkitLineClamp=le,le&&(He=Object(_.a)(Object(_.a)({},He),m));function wr(Fe){var ft=Fe.target;if(ft.tagName.toUpperCase()==="IMG"){if(me){var ut=ft.getAttribute("src");Ct(ut),Rt("image")}}else if(ft.tagName.toUpperCase()==="A"){var gt=ft.getAttribute("href");if(gt.indexOf("office")>-1)Fe.preventDefault(),Ct(gt),Rt("office");else if(gt.indexOf("application/pdf")>-1)Fe.preventDefault(),Ct(gt),Rt("pdf");else if(gt.indexOf("text/html")>-1)Fe.preventDefault(),Ct(gt),Rt("html");else if(gt.startsWith("#")){Fe.preventDefault();var yt=document.getElementById(gt.replace("#",""));yt&&yt.scrollIntoView(!0)}}}var Ut=function(){var ft,ut=(ft=Yt.current)===null||ft===void 0?void 0:ft.querySelectorAll("video");ut==null||ut.forEach(function(gt){if(gt.oncontextmenu=function(){return!1},gt.src.indexOf(".m3u8")>-1&&!gt.canPlayType("application/vnd.apple.mpegurl")){if(ne.a.isSupported()){var yt=new ne.a;yt.loadSource(gt.src),yt.attachMedia(gt)}}})};Object(I.useEffect)(function(){if(Yt.current&&hr&&(hr.match(De)&&window.PR.prettyPrint()),Yt.current)return Yt.current.addEventListener("click",wr),function(){Yt.current.removeEventListener("click",wr),p(),x()}},[hr,Yt.current,wr]);var mt=function(ft){if(!se)return;ft.target.nodeName==="IMG"?(ot.current.style.zIndex=1,ot.current.style.display="flex",ot.current.style.width=ft.target.clientWidth+"px",ot.current.style.height=ft.target.clientHeight+"px",ot.current.style.top=ft.target.offsetTop+"px",ot.current.style.left=ft.target.offsetLeft+"px",nt.current.src=ft.target.getAttribute("src")):ot.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Yt,style:Object(_.a)({},He),className:"".concat(ee||""," markdown-body ").concat(Ze.a.mdBody),onMouseOver:mt,dangerouslySetInnerHTML:{__html:hr}}),v.a.createElement("div",{ref:ot,className:Ze.a.button},v.a.createElement(Y.a,null,v.a.createElement(V.a,{onClick:function(){return Wt()}},"\u88C1\u526A"),v.a.createElement(V.a,{onClick:function(){return qt()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:nt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(be.a,{close:!0,data:It,type:It!=null&&It.length?Ot:"",style:Object(_.a)({},et),onClose:function(){return Ct("")}}))}},"9VGf":function(_e,Ie,q){"use strict";q.d(Ie,"a",function(){return L});var ue=q("q1tI"),Y=q.n(ue);function L(V,_){var k=Object(ue.useRef)();Object(ue.useEffect)(function(){k.current=V}),Object(ue.useEffect)(function(){function j(){k.current()}if(_!==null){var U=setInterval(j,_);return function(){return clearInterval(U)}}},[_])}},"A/g1":function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9uc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vjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(_e,Ie,q){(function(ue){ue(q("VrN/"),q("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(O,I,v){if(v!=ue.Init&&v&&O.removeKeyMap("autoCloseTags"),!I)return;var S={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(S["'/'"]=function(M){return k(M)}),(typeof I!="object"||I.whenOpening!==!1)&&(S["'>'"]=function(M){return V(M)}),O.addKeyMap(S)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],L=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function V(O){if(O.getOption("disableInput"))return ue.Pass;for(var I=O.listSelections(),v=[],S=O.getOption("autoCloseTags"),M=0;M<I.length;M++){if(!I[M].empty())return ue.Pass;var w=I[M].head,A=O.getTokenAt(w),C=ue.innerMode(O.getMode(),A.state),d=C.state,o=C.mode.xmlCurrentTag&&C.mode.xmlCurrentTag(d),l=o&&o.name;if(!l)return ue.Pass;var u=C.mode.configuration=="html",x=typeof S=="object"&&S.dontCloseTags||u&&Y,m=typeof S=="object"&&S.indentTags||u&&L;A.end>w.ch&&(l=l.slice(0,l.length-A.end+w.ch));var f=l.toLowerCase();if(!l||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||x&&j(x,f)>-1||U(O,C.mode.xmlCurrentContext&&C.mode.xmlCurrentContext(d)||[],l,w,!0))return ue.Pass;var D=typeof S=="object"&&S.emptyTags;if(D&&j(D,l)>-1){v[M]={text:"/>",newPos:ue.Pos(w.line,w.ch+2)};continue}var b=m&&j(m,f)>-1;v[M]={indent:b,text:">"+(b?`
`:"")+"</"+l+">",newPos:b?ue.Pos(w.line+1,0):ue.Pos(w.line,w.ch+1)}}for(var c=typeof S=="object"&&S.dontIndentOnAutoClose,M=I.length-1;M>=0;M--){var h=v[M];O.replaceRange(h.text,I[M].head,I[M].anchor,"+insert");var s=O.listSelections().slice(0);s[M]={head:h.newPos,anchor:h.newPos},O.setSelections(s),!c&&h.indent&&(O.indentLine(h.newPos.line,null,!0),O.indentLine(h.newPos.line+1,null,!0))}}function _(O,I){for(var v=O.listSelections(),S=[],M=I?"/":"</",w=O.getOption("autoCloseTags"),A=typeof w=="object"&&w.dontIndentOnSlash,C=0;C<v.length;C++){if(!v[C].empty())return ue.Pass;var d=v[C].head,o=O.getTokenAt(d),l=ue.innerMode(O.getMode(),o.state),u=l.state;if(I&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=d.ch-1))return ue.Pass;var x,m=l.mode.name!="xml"&&O.getMode().name=="htmlmixed";if(m&&l.mode.name=="javascript")x=M+"script";else if(m&&l.mode.name=="css")x=M+"style";else{var f=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(u);if(!f||f.length&&U(O,f,f[f.length-1],d))return ue.Pass;x=M+f[f.length-1]}O.getLine(d.line).charAt(o.end)!=">"&&(x+=">"),S[C]=x}if(O.replaceSelections(S),v=O.listSelections(),!A)for(var C=0;C<v.length;C++)(C==v.length-1||v[C].head.line<v[C+1].head.line)&&O.indentLine(v[C].head.line)}function k(O){return O.getOption("disableInput")?ue.Pass:_(O,!0)}ue.commands.closeTag=function(O){return _(O)};function j(O,I){if(O.indexOf)return O.indexOf(I);for(var v=0,S=O.length;v<S;++v)if(O[v]==I)return v;return-1}function U(O,I,v,S,M){if(!ue.scanForClosingTag)return!1;var w=Math.min(O.lastLine()+1,S.line+500),A=ue.scanForClosingTag(O,S,null,w);if(!A||A.tag!=v)return!1;for(var C=M?1:0,d=I.length-1;d>=0&&I[d]==v;d--)++C;S=A.to;for(var d=1;d<C;d++){var o=ue.scanForClosingTag(O,S,null,w);if(!o||o.tag!=v)return!1;S=o.to}return!0}})},BjJ7:function(_e,Ie,q){"use strict";q.d(Ie,"d",function(){return Y}),q.d(Ie,"c",function(){return L}),q.d(Ie,"e",function(){return V}),q.d(Ie,"b",function(){return _}),q.d(Ie,"a",function(){return j});var ue=q("m3rI");function Y(U){var O=!0;if(U.length>0){for(var I=0;I<U.length;I++)if(U[I].compile_success==0||!U[I].compile_success){O=!1;break}}else O=!1;return O}function L(U){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],v=0;v<U.length;v++){var S=U[v],M=O?"".concat(O,"/").concat(S.name):"".concat(S.name);I.push({title:S.name,isLeaf:!(S.type==="tree"),key:M})}return I}function V(U,O,I){for(var v=0;v<U.length;v++){var S=U[v];if(S.key===O){S.children=I;break}S.children&&V(S.children,O,I)}return U}function _(U,O,I){var v;return function(){var S=this,M=arguments,w=function(){v=null,I||U.apply(S,M)},A=I&&!v;clearTimeout(v),v=setTimeout(w,O),A&&U.apply(S,M)}}var k=!0,j=ue.a.API_SERVER},"C+DQ":function(_e,Ie,q){},CJF0:function(_e,Ie,q){"use strict";var ue=q("14J3"),Y=q("BMrR"),L=q("+L6B"),V=q("2/Rp"),_=q("jCWc"),k=q("kPKH"),j=q("PpiC"),U=q("q1tI"),O=q.n(U),I=q("Ty5D"),v=q("9kvl"),S=q("55Ip"),M=q("lzim"),w=q("nZ20"),A=q.n(w),C=function(o){var l,u,x,m,f=o.shixunsDetail,D=o.dispatch,b=o.loading,c=o.match,h=o.data,s=h===void 0?{}:h,a=o.title,g=Object(j.a)(o,["shixunsDetail","dispatch","loading","match","data","title"]),p=Object(I.i)(),y=!(((l=f.detail)===null||l===void 0?void 0:l.identity)>4||((u=f.detail)===null||u===void 0?void 0:u.identity)===void 0||((x=f.detail)===null||x===void 0?void 0:x.shixun_status)===2||((m=f.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(k.a,{flex:1},O.a.createElement("span",{className:A.a.icons},O.a.createElement("img",{src:M.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",s==null?void 0:s.position," \u5173\uFF1A",a)),O.a.createElement(k.a,null,(s==null?void 0:s.prev_challenge)&&O.a.createElement(V.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,Q=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",re="/shixuns/".concat(p.id,"/challenges/").concat(s==null||((G=s.prev_challenge)===null||G===void 0)?void 0:G.id).concat(Q);v.d.replace(re)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&O.a.createElement(V.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,Q=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",re="/shixuns/".concat(p.id,"/challenges/").concat(s==null||((G=s.next_challenge)===null||G===void 0)?void 0:G.id).concat(Q);v.d.replace(re)}},"\u4E0B\u4E00\u5173"),y&&O.a.createElement(V.a,{type:"primary"},O.a.createElement(S.a,{to:"/shixuns/".concat(p.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),y&&O.a.createElement(V.a,{type:"primary",className:"ml5"},O.a.createElement(S.a,{to:"/shixuns/".concat(p.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(p.id,"/challenges")},"\u8FD4\u56DE")))))};Ie.a=Object(v.a)(function(d){var o=d.shixunsDetail,l=d.newCourse,u=d.loading,x=d.globalSetting;return{shixunsDetail:o,newCourse:l,globalSetting:x,loading:u.effects}})(C)},DlQD:function(_e,Ie,q){(function(ue,Y){_e.exports=Y()})(this,function(){"use strict";function ue(Z,ae){for(var se=0;se<ae.length;se++){var ee=ae[se];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(Z,ee.key,ee)}}function Y(Z,ae,se){return ae&&ue(Z.prototype,ae),se&&ue(Z,se),Z}function L(Z,ae){if(!Z)return;if(typeof Z=="string")return V(Z,ae);var se=Object.prototype.toString.call(Z).slice(8,-1);if(se==="Object"&&Z.constructor&&(se=Z.constructor.name),se==="Map"||se==="Set")return Array.from(Z);if(se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(se))return V(Z,ae)}function V(Z,ae){(ae==null||ae>Z.length)&&(ae=Z.length);for(var se=0,ee=new Array(ae);se<ae;se++)ee[se]=Z[se];return ee}function _(Z,ae){var se;if(typeof Symbol=="undefined"||Z[Symbol.iterator]==null){if(Array.isArray(Z)||(se=L(Z))||ae&&Z&&typeof Z.length=="number"){se&&(Z=se);var ee=0;return function(){return ee>=Z.length?{done:!0}:{done:!1,value:Z[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=Z[Symbol.iterator](),se.next.bind(se)}function k(Z,ae){return ae={exports:{}},Z(ae,ae.exports),ae.exports}var j=k(function(Z){function ae(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function se(ee){Z.exports.defaults=ee}Z.exports={defaults:ae(),getDefaults:ae,changeDefaults:se}}),U=j.defaults,O=j.getDefaults,I=j.changeDefaults,v=/[&<>"']/,S=/[&<>"']/g,M=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,A={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},C=function(ae){return A[ae]};function d(Z,ae){if(ae){if(v.test(Z))return Z.replace(S,C)}else if(M.test(Z))return Z.replace(w,C);return Z}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Z){return Z.replace(o,function(ae,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 x(Z,ae){Z=Z.source||Z,ae=ae||"";var se={replace:function(ie,le){return le=le.source||le,le=le.replace(u,"$1"),Z=Z.replace(ie,le),se},getRegex:function(){return new RegExp(Z,ae)}};return se}var m=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Z,ae,se){if(Z){var ee;try{ee=decodeURIComponent(l(se)).replace(m,"").toLowerCase()}catch(ie){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}ae&&!f.test(se)&&(se=a(ae,se));try{se=encodeURI(se).replace(/%25/g,"%")}catch(ie){return null}return se}var b={},c=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(Z,ae){b[" "+Z]||(c.test(Z)?b[" "+Z]=Z+"/":b[" "+Z]=P(Z,"/",!0)),Z=b[" "+Z];var se=Z.indexOf(":")===-1;return ae.substring(0,2)==="//"?se?ae:Z.replace(h,"$1")+ae:ae.charAt(0)==="/"?se?ae:Z.replace(s,"$1")+ae:Z+ae}var g={exec:function(){}};function p(Z){for(var ae=1,se,ee;ae<arguments.length;ae++){se=arguments[ae];for(ee in se)Object.prototype.hasOwnProperty.call(se,ee)&&(Z[ee]=se[ee])}return Z}function y(Z,ae){var se=Z.replace(/\|/g,function(le,he,me){for(var ye=!1,ke=he;--ke>=0&&me[ke]==="\\";)ye=!ye;return ye?"|":" |"}),ee=se.split(/ \|/),ie=0;if(ee.length>ae)ee.splice(ae);else for(;ee.length<ae;)ee.push("");for(;ie<ee.length;ie++)ee[ie]=ee[ie].trim().replace(/\\\|/g,"|");return ee}function P(Z,ae,se){var ee=Z.length;if(ee===0)return"";for(var ie=0;ie<ee;){var le=Z.charAt(ee-ie-1);if(le===ae&&!se)ie++;else if(le!==ae&&se)ie++;else break}return Z.substr(0,ee-ie)}function G(Z,ae){if(Z.indexOf(ae[1])===-1)return-1;for(var se=Z.length,ee=0,ie=0;ie<se;ie++)if(Z[ie]==="\\")ie++;else if(Z[ie]===ae[0])ee++;else if(Z[ie]===ae[1]&&(ee--,ee<0))return ie;return-1}function Q(Z){Z&&Z.sanitize&&!Z.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:d,unescape:l,edit:x,cleanUrl:D,resolveUrl:a,noopTest:g,merge:p,splitCells:y,rtrim:P,findClosingBracket:G,checkSanitizeDeprecation:Q},z=j.defaults,F=re.rtrim,ne=re.splitCells,ce=re.escape,ge=re.findClosingBracket;function be(Z,ae,se){var ee=ae.href,ie=ae.title?ce(ae.title):null,le=Z[1].replace(/\\([\[\]])/g,"$1");return Z[0].charAt(0)!=="!"?{type:"link",raw:se,href:ee,title:ie,text:le}:{type:"image",raw:se,href:ee,title:ie,text:ce(le)}}function Be(Z,ae){var se=Z.match(/^(\s+)(?:```)/);if(se===null)return ae;var ee=se[1];return ae.split(`
`).map(function(ie){var le=ie.match(/^\s+/);if(le===null)return ie;var he=le[0];return he.length>=ee.length?ie.slice(ee.length):ie}).join(`
`)}var Se=function(){function Z(se){this.options=se||z}var ae=Z.prototype;return ae.space=function(ee){var ie=this.rules.block.newline.exec(ee);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ae.code=function(ee,ie){var le=this.rules.block.code.exec(ee);if(le){var he=ie[ie.length-1];if(he&&he.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:F(me,`
`)}}},ae.fences=function(ee){var ie=this.rules.block.fences.exec(ee);if(ie){var le=ie[0],he=Be(le,ie[3]||"");return{type:"code",raw:le,lang:ie[2]?ie[2].trim():ie[2],text:he}}},ae.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]}},ae.nptable=function(ee){var ie=this.rules.block.nptable.exec(ee);if(ie){var le={type:"table",header:ne(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 he=le.align.length,me;for(me=0;me<he;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(he=le.cells.length,me=0;me<he;me++)le.cells[me]=ne(le.cells[me],le.header.length);return le}}},ae.hr=function(ee){var ie=this.rules.block.hr.exec(ee);if(ie)return{type:"hr",raw:ie[0]}},ae.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}}},ae.list=function(ee){var ie=this.rules.block.list.exec(ee);if(ie){for(var le=ie[0],he=ie[2],me=he.length>1,ye=he[he.length-1]===")",ke={type:"list",raw:le,ordered:me,start:me?+he.slice(0,-1):"",loose:!1,items:[]},He=ie[0].match(this.rules.block.item),$e=!1,et,St,ot,nt,Mt,xt,It,Ct=He.length,ht=0;ht<Ct;ht++)et=He[ht],le=et,St=et.length,et=et.replace(/^ *([*+-]|\d+[.)]) */,""),~et.indexOf(`
`)&&(St-=et.length,et=this.options.pedantic?et.replace(/^ {1,4}/gm,""):et.replace(new RegExp("^ {1,"+St+"}","gm"),"")),ht!==Ct-1&&(ot=this.rules.block.bullet.exec(He[ht+1])[0],(me?ot.length===1||!ye&&ot[ot.length-1]===")":ot.length>1||this.options.smartLists&&ot!==he)&&(nt=He.slice(ht+1).join(`
`),ke.raw=ke.raw.substring(0,ke.raw.length-nt.length),ht=Ct-1)),Mt=$e||/\n\n(?!\s*$)/.test(et),ht!==Ct-1&&($e=et.charAt(et.length-1)===`
`,Mt||(Mt=$e)),Mt&&(ke.loose=!0),xt=/^\[[ xX]\] /.test(et),It=void 0,xt&&(It=et[1]!==" ",et=et.replace(/^\[[ xX]\] +/,"")),ke.items.push({type:"list_item",raw:le,task:xt,checked:It,loose:Mt,text:et});return ke}},ae.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]):ce(ie[0]):ie[0]}},ae.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]}}},ae.table=function(ee){var ie=this.rules.block.table.exec(ee);if(ie){var le={type:"table",header:ne(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 he=le.align.length,me;for(me=0;me<he;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(he=le.cells.length,me=0;me<he;me++)le.cells[me]=ne(le.cells[me].replace(/^ *\| *| *\| *$/g,""),le.header.length);return le}}},ae.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]}},ae.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]}},ae.text=function(ee,ie){var le=this.rules.block.text.exec(ee);if(le){var he=ie[ie.length-1];return he&&he.type==="text"?{raw:le[0],text:le[0]}:{type:"text",raw:le[0],text:le[0]}}},ae.escape=function(ee){var ie=this.rules.inline.escape.exec(ee);if(ie)return{type:"escape",raw:ie[0],text:ce(ie[1])}},ae.tag=function(ee,ie,le){var he=this.rules.inline.tag.exec(ee);if(he)return!ie&&/^<a /i.test(he[0])?ie=!0:ie&&/^<\/a>/i.test(he[0])&&(ie=!1),!le&&/^<(pre|code|kbd|script)(\s|>)/i.test(he[0])?le=!0:le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(he[0])&&(le=!1),{type:this.options.sanitize?"text":"html",raw:he[0],inLink:ie,inRawBlock:le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ce(he[0]):he[0]}},ae.link=function(ee){var ie=this.rules.inline.link.exec(ee);if(ie){var le=ge(ie[2],"()");if(le>-1){var he=ie[0].indexOf("!")===0?5:4,me=he+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],ke="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ye);He?(ye=He[1],ke=He[3]):ke=""}else ke=ie[3]?ie[3].slice(1,-1):"";ye=ye.trim().replace(/^<([\s\S]*)>$/,"$1");var $e=be(ie,{href:ye&&ye.replace(this.rules.inline._escapes,"$1"),title:ke&&ke.replace(this.rules.inline._escapes,"$1")},ie[0]);return $e}},ae.reflink=function(ee,ie){var le;if((le=this.rules.inline.reflink.exec(ee))||(le=this.rules.inline.nolink.exec(ee))){var he=(le[2]||le[1]).replace(/\s+/g," ");if(he=ie[he.toLowerCase()],!he||!he.href){var me=le[0].charAt(0);return{type:"text",raw:me,text:me}}var ye=be(le,he,le[0]);return ye}},ae.strong=function(ee,ie,le){le===void 0&&(le="");var he=this.rules.inline.strong.start.exec(ee);if(he&&(!he[1]||he[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*ee.length);var me=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var ye;(he=me.exec(ie))!=null;)if(ye=this.rules.inline.strong.middle.exec(ie.slice(0,he.index+3)),ye)return{type:"strong",raw:ee.slice(0,ye[0].length),text:ee.slice(2,ye[0].length-2)}}},ae.em=function(ee,ie,le){le===void 0&&(le="");var he=this.rules.inline.em.start.exec(ee);if(he&&(!he[1]||he[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*ee.length);var me=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var ye;(he=me.exec(ie))!=null;)if(ye=this.rules.inline.em.middle.exec(ie.slice(0,he.index+2)),ye)return{type:"em",raw:ee.slice(0,ye[0].length),text:ee.slice(1,ye[0].length-1)}}},ae.codespan=function(ee){var ie=this.rules.inline.code.exec(ee);if(ie){var le=ie[2].replace(/\n/g," "),he=/[^ ]/.test(le),me=le.startsWith(" ")&&le.endsWith(" ");return he&&me&&(le=le.substring(1,le.length-1)),le=ce(le,!0),{type:"codespan",raw:ie[0],text:le}}},ae.br=function(ee){var ie=this.rules.inline.br.exec(ee);if(ie)return{type:"br",raw:ie[0]}},ae.del=function(ee){var ie=this.rules.inline.del.exec(ee);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ae.autolink=function(ee,ie){var le=this.rules.inline.autolink.exec(ee);if(le){var he,me;return le[2]==="@"?(he=ce(this.options.mangle?ie(le[1]):le[1]),me="mailto:"+he):(he=ce(le[1]),me=he),{type:"link",raw:le[0],text:he,href:me,tokens:[{type:"text",raw:he,text:he}]}}},ae.url=function(ee,ie){var le;if(le=this.rules.inline.url.exec(ee)){var he,me;if(le[2]==="@")he=ce(this.options.mangle?ie(le[0]):le[0]),me="mailto:"+he;else{var ye;do ye=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(ye!==le[0]);he=ce(le[0]),le[1]==="www."?me="http://"+he:me=he}return{type:"link",raw:le[0],text:he,href:me,tokens:[{type:"text",raw:he,text:he}]}}},ae.inlineText=function(ee,ie,le){var he=this.rules.inline.text.exec(ee);if(he){var me;return ie?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ce(he[0]):he[0]:me=ce(this.options.smartypants?le(he[0]):he[0]),{type:"text",raw:he[0],text:me}}},Z}(),Le=re.noopTest,Te=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:Le,table:Le,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=Te(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=Te(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Te(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=Te(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Te(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=Te(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=Te(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=Te(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:Te(`^ *(?: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:Le,paragraph:Te(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 H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};H._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",H.punctuation=Te(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex(),H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",H.em.start=Te(H.em.start).replace(/punctuation/g,H._punctuation).getRegex(),H.em.middle=Te(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex(),H.em.endAst=Te(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.em.endUnd=Te(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.start=Te(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex(),H.strong.middle=Te(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/blockSkip/g,H._blockSkip).getRegex(),H.strong.endAst=Te(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.endUnd=Te(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.blockSkip=Te(H._blockSkip,"g").getRegex(),H.overlapSkip=Te(H._overlapSkip,"g").getRegex(),H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,H._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])?)+(?![-_])/,H.autolink=Te(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex(),H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,H.tag=Te(H.tag).replace("comment",ve._comment).replace("attribute",H._attribute).getRegex(),H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,H.link=Te(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex(),H.reflink=Te(H.reflink).replace("label",H._label).getRegex(),H.reflinkSearch=Te(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex(),H.normal=we({},H),H.pedantic=we({},H.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()}),H.gfm=we({},H.normal,{escape:Te(H.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),H.gfm.url=Te(H.gfm.url,"i").replace("email",H.gfm._extended_email).getRegex(),H.breaks=we({},H.gfm,{br:Te(H.br).replace("{2,}","*").getRegex(),text:Te(H.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var T={block:ve,inline:H},R=j.defaults,W=T.block,$=T.inline;function N(Z){return Z.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 de(Z){var ae="",se,ee,ie=Z.length;for(se=0;se<ie;se++)ee=Z.charCodeAt(se),Math.random()>.5&&(ee="x"+ee.toString(16)),ae+="&#"+ee+";";return ae}var xe=function(){function Z(se){this.tokens=[],this.tokens.links=Object.create(null),this.options=se||R,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:W.normal,inline:$.normal};this.options.pedantic?(ee.block=W.pedantic,ee.inline=$.pedantic):this.options.gfm&&(ee.block=W.gfm,this.options.breaks?ee.inline=$.breaks:ee.inline=$.gfm),this.tokenizer.rules=ee}Z.lex=function(ee,ie){var le=new Z(ie);return le.lex(ee)};var ae=Z.prototype;return ae.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},ae.blockTokens=function(ee,ie,le){ie===void 0&&(ie=[]),le===void 0&&(le=!0),ee=ee.replace(/^ +$/gm,"");for(var he,me,ye,ke;ee;){if(he=this.tokenizer.space(ee)){ee=ee.substring(he.raw.length),he.type&&ie.push(he);continue}if(he=this.tokenizer.code(ee,ie)){ee=ee.substring(he.raw.length),he.type?ie.push(he):(ke=ie[ie.length-1],ke.raw+=`
`+he.raw,ke.text+=`
`+he.text);continue}if(he=this.tokenizer.fences(ee)){ee=ee.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.heading(ee)){ee=ee.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.nptable(ee)){ee=ee.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.hr(ee)){ee=ee.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.blockquote(ee)){ee=ee.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],le),ie.push(he);continue}if(he=this.tokenizer.list(ee)){for(ee=ee.substring(he.raw.length),ye=he.items.length,me=0;me<ye;me++)he.items[me].tokens=this.blockTokens(he.items[me].text,[],!1);ie.push(he);continue}if(he=this.tokenizer.html(ee)){ee=ee.substring(he.raw.length),ie.push(he);continue}if(le&&(he=this.tokenizer.def(ee))){ee=ee.substring(he.raw.length),this.tokens.links[he.tag]||(this.tokens.links[he.tag]={href:he.href,title:he.title});continue}if(he=this.tokenizer.table(ee)){ee=ee.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.lheading(ee)){ee=ee.substring(he.raw.length),ie.push(he);continue}if(le&&(he=this.tokenizer.paragraph(ee))){ee=ee.substring(he.raw.length),ie.push(he);continue}if(he=this.tokenizer.text(ee,ie)){ee=ee.substring(he.raw.length),he.type?ie.push(he):(ke=ie[ie.length-1],ke.raw+=`
`+he.raw,ke.text+=`
`+he.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},ae.inline=function(ee){var ie,le,he,me,ye,ke,He=ee.length;for(ie=0;ie<He;ie++){ke=ee[ie];switch(ke.type){case"paragraph":case"text":case"heading":{ke.tokens=[],this.inlineTokens(ke.text,ke.tokens);break}case"table":{for(ke.tokens={header:[],cells:[]},me=ke.header.length,le=0;le<me;le++)ke.tokens.header[le]=[],this.inlineTokens(ke.header[le],ke.tokens.header[le]);for(me=ke.cells.length,le=0;le<me;le++)for(ye=ke.cells[le],ke.tokens.cells[le]=[],he=0;he<ye.length;he++)ke.tokens.cells[le][he]=[],this.inlineTokens(ye[he],ke.tokens.cells[le][he]);break}case"blockquote":{this.inline(ke.tokens);break}case"list":{for(me=ke.items.length,le=0;le<me;le++)this.inline(ke.items[le].tokens);break}}}return ee},ae.inlineTokens=function(ee,ie,le,he,me){ie===void 0&&(ie=[]),le===void 0&&(le=!1),he===void 0&&(he=!1),me===void 0&&(me="");var ye,ke=ee,He;if(this.tokens.links){var $e=Object.keys(this.tokens.links);if($e.length>0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(ke))!=null;)$e.includes(He[0].slice(He[0].lastIndexOf("[")+1,-1))&&(ke=ke.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(He=this.tokenizer.rules.inline.blockSkip.exec(ke))!=null;)ke=ke.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+ke.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,he)){ee=ee.substring(ye.raw.length),le=ye.inLink,he=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,he)),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,he)),ie.push(ye);continue}if(ye=this.tokenizer.strong(ee,ke,me)){ee=ee.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,he),ie.push(ye);continue}if(ye=this.tokenizer.em(ee,ke,me)){ee=ee.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],le,he),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,he),ie.push(ye);continue}if(ye=this.tokenizer.autolink(ee,de)){ee=ee.substring(ye.raw.length),ie.push(ye);continue}if(!le&&(ye=this.tokenizer.url(ee,de))){ee=ee.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.inlineText(ee,he,N)){ee=ee.substring(ye.raw.length),me=ye.raw.slice(-1),ie.push(ye);continue}if(ee){var et="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(et);break}else throw new Error(et)}}return ie},Y(Z,null,[{key:"rules",get:function(){return{block:W,inline:$}}}]),Z}(),Ae=j.defaults,Ne=re.cleanUrl,Me=re.escape,Re=function(){function Z(se){this.options=se||Ae}var ae=Z.prototype;return ae.code=function(ee,ie,le){var he=(ie||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(ee,he);me!=null&&me!==ee&&(le=!0,ee=me)}return he?'<pre><code class="'+this.options.langPrefix+Me(he,!0)+'">'+(le?ee:Me(ee,!0))+`</code></pre>
`:"<pre><code>"+(le?ee:Me(ee,!0))+`</code></pre>
`},ae.blockquote=function(ee){return`<blockquote>
`+ee+`</blockquote>
`},ae.html=function(ee){return ee},ae.heading=function(ee,ie,le,he){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+he.slug(le)+'">'+ee+"</h"+ie+`>
`:"<h"+ie+">"+ee+"</h"+ie+`>
`},ae.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ae.list=function(ee,ie,le){var he=ie?"ol":"ul",me=ie&&le!==1?' start="'+le+'"':"";return"<"+he+me+`>
`+ee+"</"+he+`>
`},ae.listitem=function(ee){return"<li>"+ee+`</li>
`},ae.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ae.paragraph=function(ee){return"<p>"+ee+`</p>
`},ae.table=function(ee,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
<thead>
`+ee+`</thead>
`+ie+`</table>
`},ae.tablerow=function(ee){return`<tr>
`+ee+`</tr>
`},ae.tablecell=function(ee,ie){var le=ie.header?"th":"td",he=ie.align?"<"+le+' align="'+ie.align+'">':"<"+le+">";return he+ee+"</"+le+`>
`},ae.strong=function(ee){return"<strong>"+ee+"</strong>"},ae.em=function(ee){return"<em>"+ee+"</em>"},ae.codespan=function(ee){return"<code>"+ee+"</code>"},ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},ae.del=function(ee){return"<del>"+ee+"</del>"},ae.link=function(ee,ie,le){if(ee=Ne(this.options.sanitize,this.options.baseUrl,ee),ee===null)return le;var he='<a href="'+Me(ee)+'"';return ie&&(he+=' title="'+ie+'"'),he+=">"+le+"</a>",he},ae.image=function(ee,ie,le){if(ee=Ne(this.options.sanitize,this.options.baseUrl,ee),ee===null)return le;var he='<img src="'+ee+'" alt="'+le+'"';return ie&&(he+=' title="'+ie+'"'),he+=this.options.xhtml?"/>":">",he},ae.text=function(ee){return ee},Z}(),Pe=function(){function Z(){}var ae=Z.prototype;return ae.strong=function(ee){return ee},ae.em=function(ee){return ee},ae.codespan=function(ee){return ee},ae.del=function(ee){return ee},ae.html=function(ee){return ee},ae.text=function(ee){return ee},ae.link=function(ee,ie,le){return""+le},ae.image=function(ee,ie,le){return""+le},ae.br=function(){return""},Z}(),We=function(){function Z(){this.seen={}}var ae=Z.prototype;return ae.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},Z}(),Qe=j.defaults,Ve=re.unescape,Ge=function(){function Z(se){this.options=se||Qe,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new We}Z.parse=function(ee,ie){var le=new Z(ie);return le.parse(ee)};var ae=Z.prototype;return ae.parse=function(ee,ie){ie===void 0&&(ie=!0);var le="",he,me,ye,ke,He,$e,et,St,ot,nt,Mt,xt,It,Ct,ht,At,Ot,Rt,Wt=ee.length;for(he=0;he<Wt;he++){nt=ee[he];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,Ve(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(St="",et="",ke=nt.header.length,me=0;me<ke;me++)et+=this.renderer.tablecell(this.parseInline(nt.tokens.header[me]),{header:!0,align:nt.align[me]});for(St+=this.renderer.tablerow(et),ot="",ke=nt.cells.length,me=0;me<ke;me++){for($e=nt.tokens.cells[me],et="",He=$e.length,ye=0;ye<He;ye++)et+=this.renderer.tablecell(this.parseInline($e[ye]),{header:!1,align:nt.align[ye]});ot+=this.renderer.tablerow(et)}le+=this.renderer.table(St,ot);continue}case"blockquote":{ot=this.parse(nt.tokens),le+=this.renderer.blockquote(ot);continue}case"list":{for(Mt=nt.ordered,xt=nt.start,It=nt.loose,ke=nt.items.length,ot="",me=0;me<ke;me++)ht=nt.items[me],At=ht.checked,Ot=ht.task,Ct="",ht.task&&(Rt=this.renderer.checkbox(At),It?ht.tokens.length>0&&ht.tokens[0].type==="text"?(ht.tokens[0].text=Rt+" "+ht.tokens[0].text,ht.tokens[0].tokens&&ht.tokens[0].tokens.length>0&&ht.tokens[0].tokens[0].type==="text"&&(ht.tokens[0].tokens[0].text=Rt+" "+ht.tokens[0].tokens[0].text)):ht.tokens.unshift({type:"text",text:Rt}):Ct+=Rt),Ct+=this.parse(ht.tokens,It),ot+=this.renderer.listitem(Ct,Ot,At);le+=this.renderer.list(ot,Mt,xt);continue}case"html":{le+=this.renderer.html(nt.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(nt.tokens));continue}case"text":{for(ot=nt.tokens?this.parseInline(nt.tokens):nt.text;he+1<Wt&&ee[he+1].type==="text";)nt=ee[++he],ot+=`
`+(nt.tokens?this.parseInline(nt.tokens):nt.text);le+=ie?this.renderer.paragraph(ot):ot;continue}default:{var qt='Token with "'+nt.type+'" type was not found.';if(this.options.silent){console.error(qt);return}else throw new Error(qt)}}}return le},ae.parseInline=function(ee,ie){ie=ie||this.renderer;var le="",he,me,ye=ee.length;for(he=0;he<ye;he++){me=ee[he];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 ke='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(ke);return}else throw new Error(ke)}}}return le},Z}(),at=re.merge,Xe=re.checkSanitizeDeprecation,Ze=re.escape,De=j.getDefaults,rt=j.changeDefaults,qe=j.defaults;function oe(Z,ae,se){if(typeof Z=="undefined"||Z===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Z!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Z)+", string expected");if(typeof ae=="function"&&(se=ae,ae=null),ae=at({},oe.defaults,ae||{}),Xe(ae),se){var ee=ae.highlight,ie;try{ie=xe.lex(Z,ae)}catch(ye){return se(ye)}var le=function(ke){var He;if(!ke)try{He=Ge.parse(ie,ae)}catch($e){ke=$e}return ae.highlight=ee,ke?se(ke):se(null,He)};if(!ee||ee.length<3)return le();if(delete ae.highlight,!ie.length)return le();var he=0;oe.walkTokens(ie,function(ye){ye.type==="code"&&(he++,setTimeout(function(){ee(ye.text,ye.lang,function(ke,He){if(ke)return le(ke);He!=null&&He!==ye.text&&(ye.text=He,ye.escaped=!0),he--,he===0&&le()})},0))}),he===0&&le();return}try{var me=xe.lex(Z,ae);return ae.walkTokens&&oe.walkTokens(me,ae.walkTokens),Ge.parse(me,ae)}catch(ye){if(ye.message+=`
Please report this to https://github.com/markedjs/marked.`,ae.silent)return"<p>An error occurred:</p><pre>"+Ze(ye.message+"",!0)+"</pre>";throw ye}}oe.options=oe.setOptions=function(Z){return at(oe.defaults,Z),rt(oe.defaults),oe},oe.getDefaults=De,oe.defaults=qe,oe.use=function(Z){var ae=at({},Z);if(Z.renderer&&function(){var ee=oe.defaults.renderer||new Re,ie=function(me){var ye=ee[me];ee[me]=function(){for(var ke=arguments.length,He=new Array(ke),$e=0;$e<ke;$e++)He[$e]=arguments[$e];var et=Z.renderer[me].apply(ee,He);return et===!1&&(et=ye.apply(ee,He)),et}};for(var le in Z.renderer)ie(le);ae.renderer=ee}(),Z.tokenizer&&function(){var ee=oe.defaults.tokenizer||new Se,ie=function(me){var ye=ee[me];ee[me]=function(){for(var ke=arguments.length,He=new Array(ke),$e=0;$e<ke;$e++)He[$e]=arguments[$e];var et=Z.tokenizer[me].apply(ee,He);return et===!1&&(et=ye.apply(ee,He)),et}};for(var le in Z.tokenizer)ie(le);ae.tokenizer=ee}(),Z.walkTokens){var se=oe.defaults.walkTokens;ae.walkTokens=function(ee){Z.walkTokens(ee),se&&se(ee)}}oe.setOptions(ae)},oe.walkTokens=function(Z,ae){for(var se=_(Z),ee;!(ee=se()).done;){var ie=ee.value;ae(ie);switch(ie.type){case"table":{for(var le=_(ie.tokens.header),he;!(he=le()).done;){var me=he.value;oe.walkTokens(me,ae)}for(var ye=_(ie.tokens.cells),ke;!(ke=ye()).done;)for(var He=ke.value,$e=_(He),et;!(et=$e()).done;){var St=et.value;oe.walkTokens(St,ae)}break}case"list":{oe.walkTokens(ie.items,ae);break}default:ie.tokens&&oe.walkTokens(ie.tokens,ae)}}},oe.Parser=Ge,oe.parser=Ge.parse,oe.Renderer=Re,oe.TextRenderer=Pe,oe.Lexer=xe,oe.lexer=xe.lex,oe.Tokenizer=Se,oe.Slugger=We,oe.parse=oe;var J=oe;return J})},E7E6:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRYJ5J95JFHyq9cuaJZACHEJCklIOgHQUqZ0QIAACg/FB+//niPwxD/H3793QqwJkePHqW2tjaSUsKinCOibwWDwfVulcFIPgyIESm5FGfDhg0lBw8ehOM7qbe3dxIggCXAe58VgBOcts0AgP6XfwCACho2bBgNGTLEpZoYz6arq4vee2+PBooQosvv999y//33bzaegrMxGRBn5ZuQOpR77dq1dVB4BQCsQB8AgGB8JicY3RsAgNewYQO//EOHDnPdAtgttr1736cjR44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fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(_e,Ie,q){(function(ue){ue(q("VrN/"))})(function(ue){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},L=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(A,C,d){d&&d!=ue.Init&&(A.removeKeyMap(_),A.state.closeBrackets=null),C&&(k(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:I};function k(A){for(var C=0;C<A.length;C++){var d=A.charAt(C),o="'"+d+"'";_[o]||(_[o]=j(d))}}k(Y.pairs+"`");function j(A){return function(C){return S(C,A)}}function U(A){var C=A.state.closeBrackets;if(!C||C.override)return C;var d=A.getModeAt(A.getCursor());return d.closeBrackets||C}function O(A){var C=U(A);if(!C||A.getOption("disableInput"))return ue.Pass;for(var d=V(C,"pairs"),o=A.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return ue.Pass;var u=M(A,o[l].head);if(!u||d.indexOf(u)%2!=0)return ue.Pass}for(var l=o.length-1;l>=0;l--){var x=o[l].head;A.replaceRange("",L(x.line,x.ch-1),L(x.line,x.ch+1),"+delete")}}function I(A){var C=U(A),d=C&&V(C,"explode");if(!d||A.getOption("disableInput"))return ue.Pass;for(var o=A.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return ue.Pass;var u=M(A,o[l].head);if(!u||d.indexOf(u)%2!=0)return ue.Pass}A.operation(function(){var x=A.lineSeparator()||`
`;A.replaceSelection(x+x,null),A.execCommand("goCharLeft"),o=A.listSelections();for(var m=0;m<o.length;m++){var f=o[m].head.line;A.indentLine(f,null,!0),A.indentLine(f+1,null,!0)}})}function v(A){var C=ue.cmpPos(A.anchor,A.head)>0;return{anchor:new L(A.anchor.line,A.anchor.ch+(C?-1:1)),head:new L(A.head.line,A.head.ch+(C?1:-1))}}function S(A,C){var d=U(A);if(!d||A.getOption("disableInput"))return ue.Pass;var o=V(d,"pairs"),l=o.indexOf(C);if(l==-1)return ue.Pass;for(var u=V(d,"closeBefore"),x=V(d,"triples"),m=o.charAt(l+1)==C,f=A.listSelections(),D=l%2==0,b,c=0;c<f.length;c++){var h=f[c],s=h.head,a,g=A.getRange(s,L(s.line,s.ch+1));if(D&&!h.empty())a="surround";else if((m||!D)&&g==C)m&&w(A,s)?a="both":x.indexOf(C)>=0&&A.getRange(s,L(s.line,s.ch+3))==C+C+C?a="skipThree":a="skip";else if(m&&s.ch>1&&x.indexOf(C)>=0&&A.getRange(L(s.line,s.ch-2),s)==C+C){if(s.ch>2&&/\bstring/.test(A.getTokenTypeAt(L(s.line,s.ch-2))))return ue.Pass;a="addFour"}else if(m){var p=s.ch==0?" ":A.getRange(L(s.line,s.ch-1),s);if(!ue.isWordChar(g)&&p!=C&&!ue.isWordChar(p))a="both";else return ue.Pass}else if(D&&(g.length===0||/\s/.test(g)||u.indexOf(g)>-1))a="both";else return ue.Pass;if(!b)b=a;else if(b!=a)return ue.Pass}var y=l%2?o.charAt(l-1):C,P=l%2?C:o.charAt(l+1);A.operation(function(){if(b=="skip")A.execCommand("goCharRight");else if(b=="skipThree")for(var G=0;G<3;G++)A.execCommand("goCharRight");else if(b=="surround"){for(var Q=A.getSelections(),G=0;G<Q.length;G++)Q[G]=y+Q[G]+P;A.replaceSelections(Q,"around"),Q=A.listSelections().slice();for(var G=0;G<Q.length;G++)Q[G]=v(Q[G]);A.setSelections(Q)}else b=="both"?(A.replaceSelection(y+P,null),A.triggerElectric(y+P),A.execCommand("goCharLeft")):b=="addFour"&&(A.replaceSelection(y+y+y+y,"before"),A.execCommand("goCharRight"))})}function M(A,C){var d=A.getRange(L(C.line,C.ch-1),L(C.line,C.ch+1));return d.length==2?d:null}function w(A,C){var d=A.getTokenAt(L(C.line,C.ch+1));return/\bstring/.test(d.type)&&d.start==C.ch&&(C.ch==0||!/\bstring/.test(A.getTokenTypeAt(C)))}})},FOrL:function(_e,Ie,q){_e.exports=q.p+"static/nodata.a6b3f948.png"},FPkq:function(_e,Ie,q){_e.exports=q.p+"static/qrCode.dd0fe9b2.png"},GABl:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCBrO0IrqYcApx1xsV6XLt2nWl43kyQqyB38dQJPZ7MY56qdLsHGIL/iY3m24R0p2jc6BDZrkVHf3XTiBFfMy9PdbSgNotCYv6kDAPGVhCTT3vz3zCNT7o9PhHJsRoIwUJN518TS0qKrWI62q4xQ/H5uTsB+Q3I0521zrcfGf/KuTMDBrguXar7or2mSuCCRm1q4t6SN5sGOGZBTQ9DsRdgJEFpQeo8pRv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I0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},Gytx:function(_e,Ie){_e.exports=function(ue,Y,L,V){var _=L?L.call(V,ue,Y):void 0;if(_!==void 0)return!!_;if(ue===Y)return!0;if(typeof ue!="object"||!ue||typeof Y!="object"||!Y)return!1;var k=Object.keys(ue),j=Object.keys(Y);if(k.length!==j.length)return!1;for(var U=Object.prototype.hasOwnProperty.bind(Y),O=0;O<k.length;O++){var I=k[O];if(!U(I))return!1;var v=ue[I],S=Y[I];if(_=L?L.call(V,v,S,I):void 0,_===!1||_===void 0&&v!==S)return!1}return!0}},HmJG:function(_e,Ie,q){},HpTS:function(_e,Ie,q){_e.exports=q.p+"static/small_program.f74069ec.png"},JWDV:function(_e,Ie,q){_e.exports=q.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5Q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U26Y3JHeNwXhcfsuL4/p9pQTdIzfP9ngPuc6SU3AU7mo0bgCYrXg/Hi2dETrHyXVa+HS2l5Ft21+6usMBuhMtidE/UECdlDYSggk6oV1psa893Qb3rlCW54ZepouXg37l3d0aAfzL/cNSYZcT0LvEYnuqyvnIrIChHo/dbZYjDbPxslSFLAfGUEIIcZ3gppTpvd6zLqweOVZuI0TUVDRgSOzjVy5yWFKSmTNn6vv2LxlMx7jdEMtiZcbR6h/kdmh7nkIlctlUCiLnQNL7Xs7W5g6mrq+sTExNDg6gM9eE5xFEM4HhLL4pJKYdwvg5msCsgg4AwFceueyptKZ/XNO3pkIdqkPaXVdAGjfwkt1FTzeXveCAN7QYNp/gMDEzxYFhaLAaneaH8xTY5hrvasu1/5ebmzuvcuXOTn8KRUpLZ5sQpWVD+EgvfAKEcBWQ1mjUK554XYFvnw7YEhAhCSr6pYULTv2R6aklBAwC5Y3uJief2VyqtEoHGG5rT/4nVVN+EPaCsBB0pkT0gyyyDpq+HEB8DWNTSa/PNbbgt/yal5NkxyzI90VRVdI3+HSFpmyuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(_e,Ie,q){_e.exports=q.p+"static/qrcode.2267e4d5.png"},LdHM:function(_e,Ie,q){"use strict";q.d(Ie,"b",function(){return u}),q.d(Ie,"a",function(){return m});var ue=q("1OyB"),Y=q("vuIU"),L=q("Ji7U"),V=q("LK+K"),_=q("q1tI"),k=q("rePB"),j=q("Ff2n"),U=q("ODXe"),O=q("4IlW"),I=q("bX4T"),v=q("YrtM"),S=q("TSYQ"),M=q.n(S),w=q("+nKL"),A=q("8OUc"),C=function(ne,ce){var ge=ne.prefixCls,be=ne.id,Be=ne.flattenOptions,Se=ne.childrenAsData,Le=ne.values,Te=ne.searchValue,we=ne.multiple,ve=ne.defaultActiveFirstOption,H=ne.height,T=ne.itemHeight,R=ne.notFoundContent,W=ne.open,$=ne.menuItemSelectedIcon,N=ne.virtual,de=ne.onSelect,xe=ne.onToggleOpen,Ae=ne.onActiveValue,Ne=ne.onScroll,Me=ne.onMouseEnter,Re="".concat(ge,"-item"),Pe=Object(v.a)(function(){return Be},[W,Be],function(J,Z){return Z[0]&&J[1]!==Z[1]}),We=_.useRef(null),Qe=function(Z){Z.preventDefault()},Ve=function(Z){We.current&&We.current.scrollTo({index:Z})},Ge=function(Z){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,se=Pe.length,ee=0;ee<se;ee+=1){var ie=(Z+ee*ae+se)%se,le=Pe[ie],he=le.group,me=le.data;if(!he&&!me.disabled)return ie}return-1},at=_.useState(function(){return Ge(0)}),Xe=Object(U.a)(at,2),Ze=Xe[0],De=Xe[1],rt=function(Z){De(Z);var ae=Pe[Z];if(!ae){Ae(null,-1);return}Ae(ae.data.value,Z)};_.useEffect(function(){rt(ve!==!1?Ge(0):-1)},[Pe.length,Te]),_.useEffect(function(){var J=setTimeout(function(){if(!we&&W&&Le.size===1){var Z=Array.from(Le)[0],ae=Pe.findIndex(function(se){var ee=se.data;return ee.value===Z});rt(ae),Ve(ae)}});return function(){return clearTimeout(J)}},[W]);var qe=function(Z){Z!==void 0&&de(Z,{selected:!Le.has(Z)}),we||xe(!1)};if(_.useImperativeHandle(ce,function(){return{onKeyDown:function(Z){var ae=Z.which;switch(ae){case O.a.UP:case O.a.DOWN:{var se=0;if(ae===O.a.UP?se=-1:ae===O.a.DOWN&&(se=1),se!==0){var ee=Ge(Ze+se,se);Ve(ee),rt(ee)}break}case O.a.ENTER:{var ie=Pe[Ze];ie&&!ie.data.disabled?qe(ie.data.value):qe(void 0),W&&Z.preventDefault();break}case O.a.ESC:xe(!1)}},onKeyUp:function(){},scrollTo:function(Z){Ve(Z)}}}),Pe.length===0)return _.createElement("div",{role:"listbox",id:"".concat(be,"_list"),className:"".concat(Re,"-empty"),onMouseDown:Qe},R);function oe(J){var Z=Pe[J];if(!Z)return null;var ae=Z.data||{},se=ae.value,ee=ae.label,ie=ae.children,le=Object(I.a)(ae,!0),he=Se?ie:ee;return Z?_.createElement("div",Object.assign({"aria-label":typeof he=="string"?he:null},le,{key:J,role:"option",id:"".concat(be,"_list_").concat(J),"aria-selected":Le.has(se)}),se):null}return _.createElement(_.Fragment,null,_.createElement("div",{role:"listbox",id:"".concat(be,"_list"),style:{height:0,width:0,overflow:"hidden"}},oe(Ze-1),oe(Ze),oe(Ze+1)),_.createElement(w.a,{itemKey:"key",ref:We,data:Pe,height:H,itemHeight:T,fullHeight:!1,onMouseDown:Qe,onScroll:Ne,virtual:N,onMouseEnter:Me},function(J,Z){var ae,se=J.group,ee=J.groupOption,ie=J.data,le=ie.label,he=ie.key;if(se)return _.createElement("div",{className:M()(Re,"".concat(Re,"-group"))},le!==void 0?le:he);var me=ie.disabled,ye=ie.value,ke=ie.title,He=ie.children,$e=ie.style,et=ie.className,St=Object(j.a)(ie,["disabled","value","title","children","style","className"]),ot=Le.has(ye),nt="".concat(Re,"-option"),Mt=M()(Re,nt,et,(ae={},Object(k.a)(ae,"".concat(nt,"-grouped"),ee),Object(k.a)(ae,"".concat(nt,"-active"),Ze===Z&&!me),Object(k.a)(ae,"".concat(nt,"-disabled"),me),Object(k.a)(ae,"".concat(nt,"-selected"),ot),ae)),xt=Se?He:le,It=!$||typeof $=="function"||ot;return _.createElement("div",Object.assign({},St,{"aria-selected":ot,className:Mt,title:ke,onMouseMove:function(){if(Ze===Z||me)return;rt(Z)},onClick:function(){me||qe(ye)},style:$e}),_.createElement("div",{className:"".concat(nt,"-content")},xt||ye),_.isValidElement($)||ot,It&&_.createElement(A.a,{className:"".concat(Re,"-option-state"),customizeIcon:$,customizeIconProps:{isSelected:ot}},ot?"\u2713":null))}))},d=_.forwardRef(C);d.displayName="OptionList";var o=d,l=function(){return null};l.isSelectOption=!0;var u=l,x=function(){return null};x.isSelectOptGroup=!0;var m=x,f=q("VTBJ"),D=q("Zm9Q");function b(F){var ne=F.key,ce=F.props,ge=ce.children,be=ce.value,Be=Object(j.a)(ce,["children","value"]);return Object(f.a)({key:ne,value:be!==void 0?be:ne,children:ge},Be)}function c(F){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(F).map(function(ce,ge){if(!_.isValidElement(ce)||!ce.type)return null;var be=ce.type.isSelectOptGroup,Be=ce.key,Se=ce.props,Le=Se.children,Te=Object(j.a)(Se,["children"]);return ne||!be?b(ce):Object(f.a)(Object(f.a)({key:"__RC_SELECT_GRP__".concat(Be===null?ge:Be,"__"),label:Be},Te),{},{options:c(Le)})}).filter(function(ce){return ce})}var h=q("2Qr1"),s=q("qNPg"),a=q("U8pU"),g=q("Kwbf"),p=q("WKfj");function y(F){var ne=F.mode,ce=F.options,ge=F.children,be=F.backfill,Be=F.allowClear,Se=F.placeholder,Le=F.getInputElement,Te=F.showSearch,we=F.onSearch,ve=F.defaultOpen,H=F.autoFocus,T=F.labelInValue,R=F.value,W=F.inputValue,$=F.optionLabelProp,N=ne==="multiple"||ne==="tags",de=Te!==void 0?Te:N||ne==="combobox",xe=ce||c(ge);if(Object(g.a)(ne!=="tags"||xe.every(function(Re){return!Re.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ne==="tags"||ne==="combobox"){var Ae=xe.some(function(Re){return Re.options?Re.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Re?Re.value:Re.key)=="number"});Object(g.a)(!Ae,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(g.a)(ne!=="combobox"||!$,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(g.a)(ne==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(g.a)(ne==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(g.b)(ne!=="combobox"||!Le||!Be||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!de&&ne!=="combobox"&&ne!=="tags"&&Object(g.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(g.b)(!ve||H,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),R!=null){var Ne=Object(p.d)(R);Object(g.a)(!T||Ne.every(function(Re){return Object(a.a)(Re)==="object"&&("key"in Re||"value"in Re)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(g.a)(!N||Array.isArray(R),"`value` should be array when `mode` is `multiple` or `tags`")}if(ge){var Me=null;Object(D.a)(ge).some(function(Re){if(!_.isValidElement(Re)||!Re.type)return!1;var Pe=Re.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var We=Object(D.a)(Re.props.children).every(function(Qe){return!_.isValidElement(Qe)||!Re.type||Qe.type.isSelectOption?!0:(Me=Qe.type,!1)});return!We}return Me=Pe,!0}),Me&&Object(g.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Me.displayName||Me.name||Me,"`.")),Object(g.a)(W===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=y,G=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:c,flattenOptions:h.d,getLabeledValue:h.e,filterOptions:h.b,isValueDisabled:h.g,findValueOption:h.c,warningProps:P,fillOptionsWithMissingValue:h.a}),Q=function(F){Object(L.a)(ce,F);var ne=Object(V.a)(ce);function ce(){var ge;return Object(ue.a)(this,ce),ge=ne.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)(ce,[{key:"render",value:function(){return _.createElement(G,Object.assign({ref:this.selectRef},this.props))}}]),ce}(_.Component);Q.Option=u,Q.OptGroup=m;var re=Q,z=Ie.c=re},M8RZ:function(_e,Ie,q){"use strict";q.d(Ie,"a",function(){return O});var ue=q("fWQN"),Y=q("mtLc"),L=q("yKVA"),V=q("879j"),_=q("q1tI"),k=q.n(_),j=q("i8i4"),U=q.n(j),O=function(I){Object(L.a)(S,I);var v=Object(V.a)(S);function S(M){var w;Object(ue.a)(this,S),w=v.call(this,M);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(j.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),S}(k.a.Component)},Nmxd:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3wbwnrN0FYveYoTj7xdiL2ggqKsvMnCyYnJcEBPw0nA4/kUuNM9AINX9MMnMIEDzXeSpIISvs/A1pJu2/TgzSZ4BRVf7ALxQQSVeqPuNcLy5qIHJcb7HS4ZKYxncN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h+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(_e,Ie,q){"use strict";var ue=q("U8pU"),Y=q("VTBJ"),L=q("Ff2n"),V=q("q1tI"),_=q("uciX"),k=q("7ixt"),j=function(M){var w=M.overlay,A=M.prefixCls,C=M.id,d=M.overlayInnerStyle;return V.createElement("div",{className:"".concat(A,"-inner"),id:C,role:"tooltip",style:d},typeof w=="function"?w():w)},U=j,O=function(M,w){var A=M.overlayClassName,C=M.trigger,d=C===void 0?["hover"]:C,o=M.mouseEnterDelay,l=o===void 0?0:o,u=M.mouseLeaveDelay,x=u===void 0?.1:u,m=M.overlayStyle,f=M.prefixCls,D=f===void 0?"rc-tooltip":f,b=M.children,c=M.onVisibleChange,h=M.afterVisibleChange,s=M.transitionName,a=M.animation,g=M.placement,p=g===void 0?"right":g,y=M.align,P=y===void 0?{}:y,G=M.destroyTooltipOnHide,Q=G===void 0?!1:G,re=M.defaultVisible,z=M.getTooltipContainer,F=M.overlayInnerStyle,ne=Object(L.a)(M,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ce=Object(V.useRef)(null);Object(V.useImperativeHandle)(w,function(){return ce.current});var ge=Object(Y.a)({},ne);"visible"in M&&(ge.popupVisible=M.visible);var be=function(){var we=M.arrowContent,ve=we===void 0?null:we,H=M.overlay,T=M.id;return[V.createElement("div",{className:"".concat(D,"-arrow"),key:"arrow"},ve),V.createElement(U,{key:"content",prefixCls:D,id:T,overlay:H,overlayInnerStyle:F})]},Be=!1,Se=!1;if(typeof Q=="boolean")Be=Q;else if(Q&&Object(ue.a)(Q)==="object"){var Le=Q.keepParent;Be=Le===!0,Se=Le===!1}return V.createElement(_.a,Object.assign({popupClassName:A,prefixCls:D,popup:be,action:d,builtinPlacements:k.a,popupPlacement:p,ref:ce,popupAlign:P,getPopupContainer:z,onPopupVisibleChange:c,afterPopupVisibleChange:h,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:re,destroyPopupOnHide:Be,autoDestroy:Se,mouseLeaveDelay:x,popupStyle:m,mouseEnterDelay:l},ge),b)},I=Object(V.forwardRef)(O),v=Ie.a=I},Ohmc:function(_e,Ie,q){_e.exports=q.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(_e,Ie,q){"use strict";var ue=q("2qtc"),Y=q("kLXV"),L=q("rAM+"),V=q("miYZ"),_=q("tsqr"),k=q("9og8"),j=q("tJVT"),U=q("jrin"),O=q("WmNS"),I=q.n(O),v=q("q1tI"),S=q.n(v),M=q("VrN/"),w=q.n(M),A=q("bdgK"),C=q("p77/"),d=q("Bd2K"),o=q("ELLl"),l=q("19Vz"),u=q("lZu9"),x=q("+NIl"),m=q("kSUc"),f=q("9Bee"),D=function(me){var ye=me.value,ke=ye===void 0?"":ye,He=me.className,$e=me.showTextOnly,et=me.showLines,St=me.style,ot=St===void 0?{}:St,nt=Object(v.useMemo)(function(){return""},[ke]);return S.a.createElement(S.a.Fragment,null,S.a.createElement("div",{dangerouslySetInnerHTML:{__html:nt}}))},b=q("0Owb"),c=q("dejd"),h=q("C+DQ"),s=q("1vsH"),a=q("m3rI"),g=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function p(me){var ye=me.onActionCallback,ke=me.title,He=me.icon,$e=me.actionName,et=me.className,St=et===void 0?"":et,ot=me.children;function nt(){ye($e)}return S.a.createElement("a",{title:ke,className:St,onClick:nt},S.a.createElement("i",{className:"md-iconfont ".concat(He)}),ot)}var y=function(me){var ye=me.watch,ke=me.showNullButton,He=me.onActionCallback,$e=me.fullScreen,et=me.insertTemp,St=me.hidetoolBar,ot=me.uuid,nt=me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(ot,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Mt=[].concat(g,[{title:"".concat(ye?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ye?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return S.a.createElement("ul",{className:"markdown-toolbar-container"},!St&&Mt.map(function(xt,It){return S.a.createElement("li",{key:It},xt.actionName?S.a.createElement(p,Object(b.a)({},xt,{onActionCallback:He})):S.a.createElement("span",{className:"v-line"}))}),ke?S.a.createElement("li",null,S.a.createElement(p,{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,et&&S.a.createElement("li",null,S.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(et),onActionCallback:He},S.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),S.a.createElement("li",{className:"btn-full-screen"},S.a.createElement(p,{icon:"".concat($e?"icon-shrink":"icon-enlarge"),title:$e?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:He})))},P=q("M8RZ"),G=q("+L6B"),Q=q("2/Rp"),re=q("y8nQ"),z=q("Vl3Y"),F=q("5NDa"),ne=q("5rEg"),ce={labelCol:{span:4},wrapperCol:{span:20}},ge=function(me){var ye=me.callback,ke=me.onCancel;function He($e){ye($e)}return S.a.createElement(z.a,Object(b.a)({},ce,{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(ne.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(ne.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:ke},"\u53D6\u6D88")))},be=q("7ahc"),Be=q("HmJG"),Se=q("BjJ7"),Le=z.a.useForm,Te={width:280,marginRight:10},we={labelCol:{span:5},wrapperCol:{span:19}},ve=function(me){var ye=me.callback,ke=me.onCancel,He=Le(),$e=Object(j.a)(He,1),et=$e[0];function St(Mt){ye(Mt)}function ot(Mt,xt){if(Mt.status===-1){_.b.error(Mt.message);return}et.setFieldsValue({src:"/api/attachments/".concat(Mt.id),type:xt.type})}function nt(Mt){var xt=Mt.target.files[0];T(xt,ot)}return S.a.createElement(z.a,Object(b.a)({form:et},we,{className:"upload-image-panel",onFinish:St}),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(ne.a,{style:Te})),S.a.createElement(H,{onFileChange:nt}))),S.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},S.a.createElement(ne.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:ke},"\u53D6\u6D88")))};function H(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 ke=new FormData;ke.append("editormd-image-file",me),ke.append("file_param_name","editormd-image-file"),ke.append("byxhr","true");var He=new window.XMLHttpRequest;He.withCredentials=!0,He.addEventListener("load",function($e){ye(JSON.parse($e.target.responseText),me)},!1),He.addEventListener("error",function($e){console.error($e)},!1),He.open("POST","".concat(Se.a,"/api/attachments.json")),He.send(ke)}var R=q("giR+"),W=q("fyUT"),$=q("7Kak"),N=q("9yH6"),de=N.a.Group,xe={margin:"0 8px"},Ae=function(me){var ye=me.callback,ke=me.onCancel;function He($e){ye($e)}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:xe},"\u5355\u5143\u683C\u6570\uFF1A"),S.a.createElement("span",{style:xe},"\u884C\u6570"),S.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},S.a.createElement(W.a,null)),S.a.createElement("span",{style:xe},"\u5217\u6570"),S.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},S.a.createElement(W.a,null))),S.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},S.a.createElement("span",{style:xe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),S.a.createElement(z.a.Item,{name:"align"},S.a.createElement(de,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:ke},"\u53D6\u6D88")))},Ne=q("ErOA"),Me=q("7Cbv"),Re="link",Pe="upload-image",We="code-block",Qe="add-table",Ve="------------",Ge={default:Ve,left:":".concat(Ve),center:":".concat(Ve,":"),right:"".concat(Ve,":")},at=q("9VGf"),Xe,Ze;function De(){}var rt=0,qe=1e4,oe="\u2581",J=`
**\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 Z(me){return/^\d+$/.test(me)?"".concat(me,"px"):me}var ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,se=ae?"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(U.a)(Xe,se+"-B","bold"),Object(U.a)(Xe,se+"-I","italic"),Xe),le=(Ze={},Object(U.a)(Ze,Re,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(Ze,We,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(Ze,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(Ze,Qe,"\u6DFB\u52A0\u8868\u683C"),Ze),he=Ie.a=function(me){var ye=me.defaultValue,ke=ye===void 0?"":ye,He=me.onChange,$e=me.width,et=$e===void 0?"100%":$e,St=me.height,ot=St===void 0?400:St,nt=me.miniToolbar,Mt=nt===void 0?!1:nt,xt=me.isFocus,It=xt===void 0?!1:xt,Ct=me.watch,ht=me.insertTemp,At=me.mode,Ot=At===void 0?"markdown":At,Rt=me.id,Wt=Rt===void 0?"markdown-editor-id":Rt,qt=me.showResizeBar,hr=qt===void 0?!1:qt,Yt=me.noStorage,wr=Yt===void 0?!1:Yt,Ut=me.showNullButton,mt=Ut===void 0?!1:Ut,Fe=me.hidetoolBar,ft=Fe===void 0?!1:Fe,ut=me.fullScreen,gt=ut===void 0?!1:ut,yt=me.onBlur,wt=me.onCMBeforeChange,st=me.onFullScreen,zt=me.className,je=zt===void 0?"":zt,vt=me.disablePaste,ri=vt===void 0?!1:vt,bi=me.placeholder,Ei=bi===void 0?"":bi,ii=me.values,xi=ii===void 0?"":ii,Et=Object(v.useState)(null),Dn=Object(j.a)(Et,2),ze=Dn[0],Ci=Dn[1],Ar=Object(v.useState)(ke),Ki=Object(j.a)(Ar,2),ni=Ki[0],Dr=Ki[1],Vi=Object(v.useState)(Ct),Qi=Object(j.a)(Vi,2),Rr=Qi[0],Xi=Qi[1],Rn=Object(v.useState)(gt),Yi=Object(j.a)(Rn,2),Lr=Yi[0],Ln=Yi[1],aa=Object(v.useState)(""),Ji=Object(j.a)(aa,2),lr=Ji[0],Vr=Ji[1],oa=Object(v.useState)(0),ai=Object(j.a)(oa,2),kr=ai[0],Zi=ai[1],sa=Object(v.useState)(ot),kn=Object(j.a)(sa,2),Mn=kn[0],Si=kn[1],In=Object(v.useState)(!1),On=Object(j.a)(In,2),la=On[0],Ai=On[1],oi=Object(v.useRef)(Object(Me.a)()),si=Object(v.useRef)(!1),Ti=Object(v.useRef)(),Fr=Object(v.useRef)(),jr=Object(v.useRef)(),Wr=Object(v.useRef)(),wi=Object(v.useRef)(),Pn=function(){var lt=Object(k.a)(I.a.mark(function bt(){var ct,Dt;return I.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Object(Ne.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:Dt=Ft.sent,Dt!=null&&(ct=Dt.attachments)!==null&&ct!==void 0&&ct.length&&(console.log("cm:",ze,Fr),Dt.attachments.map(function(kt){kt.content_type.indexOf("image")>-1?ze.replaceSelection("![,](/api/attachments/".concat(kt.id,"?type=").concat(kt.content_type,")")):kt.content_type.indexOf("video")>-1?ze.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):kt.content_type.indexOf("pdf")>-1?ze.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(kt.content_type,'&disposition=inline" target="_blank">').concat(kt.name,"</a>")):ze.replaceSelection("[".concat(kt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(kt.id,"?type=").concat(kt.content_type,")"))}));case 4:case"end":return Ft.stop()}},bt)}));return function(){return lt.apply(this,arguments)}}();Object(v.useEffect)(function(){Dr(xi),ze==null||ze.setValue(xi)},[xi]),Object(v.useEffect)(function(){st==null||st(Lr)},[Lr]),Object(v.useEffect)(function(){if(Fr.current){var lt=w.a.fromTextArea(Fr.current,{mode:Ot,lineNumbers:!Mt,lineWrapping:!0,value:ke,autoCloseTags:!0,autoCloseBrackets:!0});It&&lt.focus();function bt(ct,Dt){if(ri){Dt.preventDefault();return}var Pt=Dt.clipboardData;if(Pt){var Ft=Pt.types.toString(),kt=Pt.items;if(Ft==="Files"||Pt.types.indexOf("Files")>-1){if(Dt.preventDefault(),Ot=="stex")return;try{var Jt,cr=kt[1];((Jt=kt[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(cr=kt[0]);var Lt=cr.getAsFile(),Hr=Lt.name.split(".").pop();T(Lt,function(_t){if(_t.id){var fr,ar,Tr;(Lt==null||((fr=Lt.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?lt.replaceSelection("![,](/api/attachments/".concat(_t.id,"?type=").concat(_t.content_type,")")):(Lt==null||((ar=Lt.type)===null||ar===void 0)?void 0:ar.indexOf("video"))>-1?lt.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,'"></video>')):(Lt==null||((Tr=Lt.type)===null||Tr===void 0)?void 0:Tr.indexOf("pdf"))>-1?lt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,"?type=").concat(Lt.type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):ee.includes(Hr)?lt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,'?type=office&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):lt.replaceSelection("[".concat(Lt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,"?type=").concat(_t.content_type,")"))}else(_t==null?void 0:_t.status)===401&&(document.location.href="/user/login")})}catch(_t){_.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return lt.on("paste",bt),lt.on("dragleave",function(ct,Dt){jr.current.classList.remove("mouse-hover-md")}),lt.on("dragover",function(ct,Dt){jr.current.classList.add("mouse-hover-md")}),lt.on("drop",function(ct,Dt){jr.current.classList.add("mouse-hover-md");var Pt;if(Pt=Dt.dataTransfer.files,Pt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Ft=function(cr){var Lt=Pt[cr],Hr=Lt.name.split(".").pop();T(Lt,function(_t){if(_t.id){var fr,ar,Tr;(Lt==null||((fr=Lt.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?lt.replaceSelection("![,](/api/attachments/".concat(_t.id,"?type=").concat(_t.content_type,")")):(Lt==null||((ar=Lt.type)===null||ar===void 0)?void 0:ar.indexOf("video"))>-1?lt.replaceSelection('<video width="100%" controls src="'.concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,'"></video>')):(Lt==null||((Tr=Lt.type)===null||Tr===void 0)?void 0:Tr.indexOf("pdf"))>-1?lt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,"?type=").concat(Lt.type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):ee.includes(Hr)?lt.replaceSelection('<a href="'.concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,'?type=office&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):lt.replaceSelection("[".concat(Lt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(_t.id,"?type=").concat(_t.content_type,")"))}else(_t==null?void 0:_t.status)===401&&(document.location.href="/user/login")})},kt=0;kt<Pt.length;kt++)Ft(kt)}}),Ci(lt),function(){lt.off("paste",bt)}}},[]);var xr=Object(v.useCallback)(function(){if(jr.current)try{}catch(lt){console.log(lt,"---- to set md editor body height")}},[Mn,jr,Lr]);Object(v.useEffect)(function(){function lt(){var ct=new A.default(function(Dt){var Pt=Object(L.a)(Dt),Ft;try{for(Pt.s();!(Ft=Pt.n()).done;){var kt=Ft.value;(kt.target.offsetHeight>0||kt.target.offsetWidth>0)&&(xr(),ze.setSize("100%","100%"),ze.refresh())}}catch(Jt){Pt.e(Jt)}finally{Pt.f()}});return ct.observe(Fr.current.parentElement),ct}if(ze){var bt=lt();return function(){bt.unobserve(Fr.current.parentElement)}}},[ze,xr]),Object(v.useEffect)(function(){if(ze){for(var lt=[],bt=function(){var kt=Dt[ct];Pt=Object(j.a)(kt,2);var Jt=Pt[0],cr=Pt[1],Lt=Object(U.a)({},Jt,function(){_n(cr)});lt.push(Lt),ze.addKeyMap(Lt)},ct=0,Dt=Object.entries(ie);ct<Dt.length;ct++){var Pt;bt()}return Ti.current=setInterval(function(){si.current&&Pn()},4e3),function(){clearInterval(Ti.current);var Ft=Object(L.a)(lt),kt;try{for(Ft.s();!(kt=Ft.n()).done;){var Jt=kt.value;ze.removeKeyMap(Jt)}}catch(cr){Ft.e(cr)}finally{Ft.f()}}}},[ze]),Object(v.useEffect)(function(){gt!==Lr&&Ln(gt)},[gt]),Object(at.a)(function(){if(!wr&&kr>0){var lt=new Date().getTime(),bt=window.sessionStorage.getItem(Wt);lt>=kr+qe&&(!bt||bt!==ni)&&(window.sessionStorage.setItem(Wt,ni),Ai(!0))}},qe),Object(v.useEffect)(function(){Xi(Ct)},[ze,Ct]),Object(v.useEffect)(function(){ze&&(It&&ze.focus())},[ze,It]),Object(v.useEffect)(function(){if(Rr&&ze){var lt=ze.getScrollerElement();function bt(ct){var Dt=ct.target;if(wi.current){var Pt=Dt.scrollTop/Dt.scrollHeight;wi.current.scrollTop=wi.current.scrollHeight*Pt}}return lt.addEventListener("scroll",bt),function(){lt.removeEventListener("scroll",bt)}}},[ze,Rr]),Object(v.useEffect)(function(){if(ze&&wt){function lt(bt,ct){wt(bt,ct)}return ze.on("beforeChange",lt),function(){ze.off("beforeChange",lt)}}},[ze,wt]),Object(v.useEffect)(function(){if(ze&&yt){function lt(){yt(ze.getValue())}return ze.on("blur",lt),function(){ze.off("blur",lt)}}},[ze,yt]),Object(v.useEffect)(function(){if(ze){function lt(bt){var ct=bt.getValue();Dr(ct),Zi(new Date().getTime()),bt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),He&&He(ct)}return ze.on("change",lt),function(){ze.off("change",lt)}}},[ze,He]),Object(v.useEffect)(function(){ze&&(ke==null?(ze.setValue(""),Dr("")):ke!==ze.getValue()&&(ze.setValue(ke),Dr(ke),ze.setCursor(ze.lineCount(),0)))},[ze,ke]);var _n=Object(v.useCallback)(function(lt){var bt=ze.getCursor(),ct=ze.getSelection(),Dt=ct.split(`
`);switch(lt){case"bold":return ze.replaceSelection("**"+ct+"**"),ct===""&&ze.setCursor(bt.line,bt.ch+2),ze.focus();case"italic":return ze.replaceSelection("*"+ct+"*"),ct===""&&ze.setCursor(bt.line,bt.ch+1),ze.focus();case"code":return ze.replaceSelection("`"+ct+"`"),ct===""&&ze.setCursor(bt.line,bt.ch+1),ze.focus();case"inline-latex":return ze.replaceSelection("`$$"+ct+"$$`"),ct===""&&ze.setCursor(bt.line,bt.ch+3),ze.focus();case"latex":return ze.replaceSelection("```latex\n"+ct+"\n```"),ze.setCursor(bt.line+1,ct.length+1),ze.focus();case"line-break":return ze.replaceSelection(`<br/>
`),ze.focus();case"list-ul":return ct===""?ze.replaceSelection("- "+ct):ze.replaceSelection(Dt.map(function(Pt){return Pt===""?"":"- ".concat(Pt)}).join(`
`)),ze.focus();case"list-ol":return ct===""?ze.replaceSelection("1. "+ct):ze.replaceSelection(Dt.map(function(Pt,Ft){return Pt===""?"":"".concat(Ft+1,". ").concat(Pt)}).join(`
`)),ze.focus();case"add-null-ch":return ct===""&&ze.setCursor(bt.line,bt.ch+1),ze.replaceSelection(oe),ze.focus();case"inster-template-1":return ct===""&&ze.setCursor(bt.line,bt.ch),ze.replaceSelection(J),ze.focus();case"eraser":return ze.setValue(""),ze.focus();case"trigger-watch":return Xi(!Rr),ze.focus();case"trigger-full-screen":return Ln(!Lr),ze.focus();case Re:Vr(Re);return;case We:Vr(We);return;case Pe:Vr(Pe);return;case Qe:Vr(Qe);return;default:throw new Error}},[ze,Rr,Lr]),Di=Object(v.useCallback)(function(lt){Vr("");switch(lr){case Re:var bt=lt.title,ct=lt.link;return ze.replaceSelection("[".concat(bt,"](").concat(ct,")")),ze.focus();case We:var Dt=lt.language,Pt=lt.content;return ze.replaceSelection(["```"+Dt,Pt,"```"].join(`
`)),ze.focus();case Pe:var Ft=lt.src,kt=lt.alt;return kt?ze.replaceSelection("![ ".concat(kt," ]( ").concat(Ft,' "').concat(kt,'" )')):ze.replaceSelection("![,](".concat(Ft,")")),ze.focus();case Qe:for(var Jt=lt.row,cr=lt.col,Lt=lt.align,Hr=`
`,_t=0;_t<Jt;_t++){for(var fr=[],ar=[],Tr=0;Tr<cr;Tr++)_t===1&&ar.push(Ge[Lt]),fr.push(" ");_t===1&&(Hr+="| ".concat(ar.join(" | "),` |
`)),Hr+="| ".concat(fr.join(cr===1?"":" | "),` |
`)}return ze.replaceSelection(Hr+`
`),ze.focus();default:throw new Error}},[ze,lr]),qi=Object(v.useMemo)(function(){switch(lr){case Re:return S.a.createElement(ge,{callback:Di,onCancel:Qr});case We:return S.a.createElement(be.b,{callback:Di,onCancel:Qr});case Pe:return S.a.createElement(ve,{callback:Di,onCancel:Qr});case Qe:return S.a.createElement(Ae,{callback:Di,onCancel:Qr});default:return null}},[lr]);function Qr(){Vr("")}Object(v.useEffect)(function(){if(Wr.current){var lt=Wr.current,bt=!1,ct=0;function Dt(kt){bt=!0,ct=kt.pageY}function Pt(){bt=!1}function Ft(kt){if(bt){var Jt=kt.pageY-ct;Jt<0&&(Jt=0),Jt>300&&(Jt=300);var cr=ot+Jt+"px";Si(cr)}}return lt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Ft),document.addEventListener("mouseup",Pt),function(){lt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Ft),document.removeEventListener("mouseup",Pt)}}},[ze,Wr]),Object(v.useEffect)(function(){Si(ot)},[ot]);var _r=Z(et),$i=Z(Mn),Mr={width:_r,height:$i},en=Object(v.useMemo)(function(){if(kr){var lt=new Date(kr),bt=lt.getHours(),ct=lt.getMinutes(),Dt=lt.getSeconds();return bt=bt<10?"0"+bt:bt,ct=ct<10?"0"+ct:ct,Dt=Dt<10?"0"+Dt:Dt,"".concat(bt,":").concat(ct,":").concat(Dt)}return 0},[kr]);function Bn(){window.sessionStorage.removeItem(Wt),Ai(!1),Zi(0)}function li(){Ai(!1),Zi(0),ze.setValue(window.sessionStorage.getItem(Wt))}function ua(lt,bt){var ct=ze.getValue();ct=ct.replace(lt,bt),Dr(ct),ze==null||ze.setValue(ct)}return S.a.createElement(v.Fragment,null,S.a.createElement("div",{className:"markdown-editor-wrapper",ref:jr},S.a.createElement("div",{className:"markdown-editor-container ".concat(je," ").concat(Rr?"on-preview":""," ").concat(Mt?"mini":""," ").concat(Lr?"full-screen":""),style:Mr},S.a.createElement(y,{insertTemp:ht,watch:Rr,fullScreen:Lr,showNullButton:mt,onActionCallback:_n,hidetoolBar:ft,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:Fr,placeholder:Ei})),Rr?S.a.createElement("div",{ref:wi,className:"preview-container"},Ot==="stex"&&S.a.createElement(D,{value:ni}),Ot!=="stex"&&S.a.createElement(f.a,{edit:!0,value:ni,replaces:ua})):null))),hr?S.a.createElement("a",{ref:Wr,className:"editor-resize"}):null,S.a.createElement(P.a,null,le[lr]?S.a.createElement(Y.a,{centered:!0,title:le[lr],visible:!0,onCancel:Qr,footer:null,className:"markdown-popup-form"},qi):null))}},RMFE:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAo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QLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(_e,Ie){/**
* @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 q,ue,Y,L=!1,V,_;window.PR_SHOULD_USE_CONTINUATION=!0;var k,j;(function(){var U=window,O=["break,continue,do,else,for,if,return,while"],I=[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"],v=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],S=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],M=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],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=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="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"],l=[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"],x=[S,w,M,C,d,o,l,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/,f="str",D="kwd",b="com",c="typ",h="lit",s="pun",a="pln",g="tag",p="dec",y="src",P="atn",G="atv",Q="nocode",re="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(de){for(var xe=0,Ae=!1,Ne=!1,Me=0,Re=de.length;Me<Re;++Me){var Pe=de[Me];if(Pe.ignoreCase)Ne=!0;else if(/[a-z]/i.test(Pe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ae=!0,Ne=!1;break}}var We={b:8,t:9,n:10,v:11,f:12,r:13};function Qe(Ze){var De=Ze.charCodeAt(0);if(De!==92)return De;var rt=Ze.charAt(1);return De=We[rt],De||("0"<=rt&&rt<="7"?parseInt(Ze.substring(1),8):rt==="u"||rt==="x"?parseInt(Ze.substring(2),16):Ze.charCodeAt(1))}function Ve(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 Ge(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")),rt=[],qe=De[0]==="^",oe=["["];qe&&oe.push("^");for(var J=qe?1:0,Z=De.length;J<Z;++J){var ae=De[J];if(/\\[bdsw]/i.test(ae))oe.push(ae);else{var se=Qe(ae),ee;J+2<Z&&De[J+1]==="-"?(ee=Qe(De[J+2]),J+=2):ee=se,rt.push([se,ee]),ee<65||se>122||(ee<65||se>90||rt.push([Math.max(65,se)|32,Math.min(ee,90)|32]),ee<97||se>122||rt.push([Math.max(97,se)&~32,Math.min(ee,122)&~32]))}}rt.sort(function(me,ye){return me[0]-ye[0]||ye[1]-me[1]});for(var ie=[],le=[],J=0;J<rt.length;++J){var he=rt[J];he[0]<=le[1]+1?le[1]=Math.max(le[1],he[1]):ie.push(le=he)}for(var J=0;J<ie.length;++J){var he=ie[J];oe.push(Ve(he[0])),he[1]>he[0]&&(he[1]+1>he[0]&&oe.push("-"),oe.push(Ve(he[1])))}return oe.push("]"),oe.join("")}function at(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")),rt=De.length,qe=[],oe=0,J=0;oe<rt;++oe){var Z=De[oe];if(Z==="(")++J;else if(Z.charAt(0)==="\\"){var ae=+Z.substring(1);ae&&(ae<=J?qe[ae]=-1:De[oe]=Ve(ae))}}for(var oe=1;oe<qe.length;++oe)qe[oe]===-1&&(qe[oe]=++xe);for(var oe=0,J=0;oe<rt;++oe){var Z=De[oe];if(Z==="(")++J,qe[J]||(De[oe]="(?:");else if(Z.charAt(0)==="\\"){var ae=+Z.substring(1);ae&&ae<=J&&(De[oe]="\\"+qe[ae])}}for(var oe=0;oe<rt;++oe)De[oe]==="^"&&De[oe+1]!=="^"&&(De[oe]="");if(Ze.ignoreCase&&Ae)for(var oe=0;oe<rt;++oe){var Z=De[oe],se=Z.charAt(0);Z.length>=2&&se==="["?De[oe]=Ge(Z):se!=="\\"&&(De[oe]=Z.replace(/[a-zA-Z]/g,function(le){var he=le.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return De.join("")}for(var Xe=[],Me=0,Re=de.length;Me<Re;++Me){var Pe=de[Me];if(Pe.global||Pe.multiline)throw new Error(""+Pe);Xe.push("(?:"+at(Pe)+")")}return new RegExp(Xe.join("|"),Ne?"gi":"g")}function F(de,xe){var Ae=/(?:^|\s)nocode(?:\s|$)/,Ne=[],Me=0,Re=[],Pe=0;function We(Qe){var Ve=Qe.nodeType;if(Ve==1){if(Ae.test(Qe.className))return;for(var Ge=Qe.firstChild;Ge;Ge=Ge.nextSibling)We(Ge);var at=Qe.nodeName.toLowerCase();(at==="br"||at==="li")&&(Ne[Pe]=`
`,Re[Pe<<1]=Me++,Re[Pe++<<1|1]=Qe)}else if(Ve==3||Ve==4){var Xe=Qe.nodeValue;Xe.length&&(xe?Xe=Xe.replace(/\r\n?/g,`
`):Xe=Xe.replace(/[ \t\r\n]+/g," "),Ne[Pe]=Xe,Re[Pe<<1]=Me,Me+=Xe.length,Re[Pe++<<1|1]=Qe)}}return We(de),{sourceCode:Ne.join("").replace(/\n$/,""),spans:Re}}function ne(de,xe,Ae,Ne,Me){if(!Ae)return;var Re={sourceNode:de,pre:1,langExtension:null,numberLines:null,sourceCode:Ae,spans:null,basePos:xe,decorations:null};Ne(Re),Me.push.apply(Me,Re.decorations)}var ce=/\S/;function ge(de){for(var xe=void 0,Ae=de.firstChild;Ae;Ae=Ae.nextSibling){var Ne=Ae.nodeType;xe=Ne===1?xe?de:Ae:Ne===3&&ce.test(Ae.nodeValue)?de:xe}return xe===de?void 0:xe}function be(de,xe){var Ae={},Ne;(function(){for(var Pe=de.concat(xe),We=[],Qe={},Ve=0,Ge=Pe.length;Ve<Ge;++Ve){var at=Pe[Ve],Xe=at[3];if(Xe)for(var Ze=Xe.length;--Ze>=0;)Ae[Xe.charAt(Ze)]=at;var De=at[1],rt=""+De;Qe.hasOwnProperty(rt)||(We.push(De),Qe[rt]=null)}We.push(/[\0-\uffff]/),Ne=z(We)})();var Me=xe.length,Re=function(Pe){for(var We=Pe.sourceCode,Qe=Pe.basePos,Ve=Pe.sourceNode,Ge=[Qe,a],at=0,Xe=We.match(Ne)||[],Ze={},De=0,rt=Xe.length;De<rt;++De){var qe=Xe[De],oe=Ze[qe],J=void 0,Z;if(typeof oe=="string")Z=!1;else{var ae=Ae[qe.charAt(0)];if(ae)J=qe.match(ae[1]),oe=ae[0];else{for(var se=0;se<Me;++se)if(ae=xe[se],J=qe.match(ae[1]),J){oe=ae[0];break}J||(oe=a)}Z=oe.length>=5&&oe.substring(0,5)==="lang-",Z&&!(J&&typeof J[1]=="string")&&(Z=!1,oe=y),Z||(Ze[qe]=oe)}var ee=at;if(at+=qe.length,!Z)Ge.push(Qe+ee,oe);else{var ie=J[1],le=qe.indexOf(ie),he=le+ie.length;J[2]&&(he=qe.length-J[2].length,le=he-ie.length);var me=oe.substring(5);ne(Ve,Qe+ee,qe.substring(0,le),Re,Ge),ne(Ve,Qe+ee+le,ie,H(me,ie),Ge),ne(Ve,Qe+ee+he,qe.substring(he),Re,Ge)}}Pe.decorations=Ge};return Re}function Be(de){var xe=[],Ae=[];de.tripleQuotedStrings?xe.push([f,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):de.multiLineStrings?xe.push([f,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):xe.push([f,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),de.verbatimStrings&&Ae.push([f,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=de.hashComments;Ne&&(de.cStyleComments?(Ne>1?xe.push([b,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):xe.push([b,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ae.push([f,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):xe.push([b,/^#[^\r\n]*/,null,"#"])),de.cStyleComments&&(Ae.push([b,/^\/\/[^\r\n]*/,null]),Ae.push([b,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Me=de.regexLiterals;if(Me){var Re=Me>1?"":`
\r`,Pe=Re?".":"[\\S\\s]",We="/(?=[^/*"+Re+"])(?:[^/\\x5B\\x5C"+Re+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Re+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";Ae.push(["lang-regex",RegExp("^"+re+"("+We+")")])}var Qe=de.types;Qe&&Ae.push([c,Qe]);var Ve=(""+de.keywords).replace(/^ | $/g,"");Ve.length&&Ae.push([D,new RegExp("^(?:"+Ve.replace(/[\s,]+/g,"|")+")\\b"),null]),xe.push([a,/^\s+/,null,` \r
\xA0`]);var Ge="^.[^\\s\\w.$@'\"`/\\\\]*";return de.regexLiterals&&(Ge+="(?!s*/)"),Ae.push([h,/^@[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],[h,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(Ge),null]),be(xe,Ae)}var Se=Be({keywords:x,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(de,xe,Ae){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,Me=/\r\n?|\n/,Re=de.ownerDocument,Pe=Re.createElement("li");de.firstChild;)Pe.appendChild(de.firstChild);var We=[Pe];function Qe(De){var rt=De.nodeType;if(rt==1&&!Ne.test(De.className))if(De.nodeName==="br")Ve(De),De.parentNode&&De.parentNode.removeChild(De);else for(var qe=De.firstChild;qe;qe=qe.nextSibling)Qe(qe);else if((rt==3||rt==4)&&Ae){var oe=De.nodeValue,J=oe.match(Me);if(J){var Z=oe.substring(0,J.index);De.nodeValue=Z;var ae=oe.substring(J.index+J[0].length);if(ae){var se=De.parentNode;se.insertBefore(Re.createTextNode(ae),De.nextSibling)}Ve(De),Z||De.parentNode.removeChild(De)}}}function Ve(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function rt(J,Z){var ae=Z?J.cloneNode(!1):J,se=J.parentNode;if(se){var ee=rt(se,1),ie=J.nextSibling;ee.appendChild(ae);for(var le=ie;le;le=ie)ie=le.nextSibling,ee.appendChild(le)}return ae}for(var qe=rt(De.nextSibling,0),oe;(oe=qe.parentNode)&&oe.nodeType===1;)qe=oe;We.push(qe)}for(var Ge=0;Ge<We.length;++Ge)Qe(We[Ge]);xe===(xe|0)&&We[0].setAttribute("value",xe);var at=Re.createElement("ol");at.className="linenums";for(var Xe=Math.max(0,xe-1|0)||0,Ge=0,Ze=We.length;Ge<Ze;++Ge)Pe=We[Ge],Pe.className="L"+(Ge+Xe)%10,Pe.firstChild||Pe.appendChild(Re.createTextNode("\xA0")),at.appendChild(Pe);de.appendChild(at)}function Te(de){var xe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);xe=xe&&+xe[1]<=8;var Ae=/\n/g,Ne=de.sourceCode,Me=Ne.length,Re=0,Pe=de.spans,We=Pe.length,Qe=0,Ve=de.decorations,Ge=Ve.length,at=0;Ve[Ge]=Me;var Xe,Ze;for(Ze=Xe=0;Ze<Ge;)Ve[Ze]!==Ve[Ze+2]?(Ve[Xe++]=Ve[Ze++],Ve[Xe++]=Ve[Ze++]):Ze+=2;for(Ge=Xe,Ze=Xe=0;Ze<Ge;){for(var De=Ve[Ze],rt=Ve[Ze+1],qe=Ze+2;qe+2<=Ge&&Ve[qe+1]===rt;)qe+=2;Ve[Xe++]=De,Ve[Xe++]=rt,Ze=qe}Ge=Ve.length=Xe;var oe=de.sourceNode,J="";oe&&(J=oe.style.display,oe.style.display="none");try{for(var Z=null;Qe<We;){var ae=Pe[Qe],se=Pe[Qe+2]||Me,ee=Ve[at+2]||Me,qe=Math.min(se,ee),ie=Pe[Qe+1],le;if(ie.nodeType!==1&&(le=Ne.substring(Re,qe))){xe&&(le=le.replace(Ae,"\r")),ie.nodeValue=le;var he=ie.ownerDocument,me=he.createElement("span");me.className=Ve[at+1];var ye=ie.parentNode;ye.replaceChild(me,ie),me.appendChild(ie),Re<se&&(Pe[Qe+1]=ie=he.createTextNode(Ne.substring(qe,se)),ye.insertBefore(ie,me.nextSibling))}Re=qe,Re>=se&&(Qe+=2),Re>=ee&&(at+=2)}}finally{oe&&(oe.style.display=J)}}var we={};function ve(de,xe){for(var Ae=xe.length;--Ae>=0;){var Ne=xe[Ae];we.hasOwnProperty(Ne)?U.console&&console.warn("cannot override language handler %s",Ne):we[Ne]=de}}function H(de,xe){return de&&we.hasOwnProperty(de)||(de=/^\s*</.test(xe)?"default-markup":"default-code"),we[de]}ve(Se,["default-code"]),ve(be([],[[a,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[b,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ve(be([[a,/^[\s]+/,null,` \r
`],[G,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[g,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ve(be([],[[G,/^[\s\S]+/]]),["uq.val"]),ve(Be({keywords:S,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),ve(Be({keywords:"null,true,false"}),["json"]),ve(Be({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),ve(Be({keywords:M,cStyleComments:!0}),["java"]),ve(Be({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve(Be({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve(Be({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(Be({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(Be({keywords:C,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve(Be({keywords:A,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(be([],[[f,/^[\s\S]+/]]),["regex"]);function T(de){var xe=de.langExtension;try{var Ae=F(de.sourceNode,de.pre),Ne=Ae.sourceCode;de.sourceCode=Ne,de.spans=Ae.spans,de.basePos=0,H(xe,Ne)(de),Te(de)}catch(Me){U.console&&console.log(Me&&Me.stack||Me)}}function R(de,xe,Ae){var Ne=Ae||!1,Me=xe||null,Re=document.createElement("div");Re.innerHTML="<pre>"+de+"</pre>",Re=Re.firstChild,Ne&&Le(Re,Ne,!0);var Pe={langExtension:Me,numberLines:Ne,sourceNode:Re,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return T(Pe),Re.innerHTML}function W(de,xe){var Ae=xe||document.body,Ne=Ae.ownerDocument||document;function Me(ae){return Ae.getElementsByTagName(ae)}for(var Re=[Me("pre"),Me("code"),Me("xmp")],Pe=[],We=0;We<Re.length;++We)for(var Qe=0,Ve=Re[We].length;Qe<Ve;++Qe)Pe.push(Re[We][Qe]);Re=null;var Ge=Date;Ge.now||(Ge={now:function(){return+new Date}});var at=0,Xe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ze=/\bprettyprint\b/,De=/\bprettyprinted\b/,rt=/pre|xmp/i,qe=/^code$/i,oe=/^(?:pre|code|xmp)$/i,J={};function Z(){for(var ae=U.PR_SHOULD_USE_CONTINUATION?Ge.now()+250:Infinity;at<Pe.length&&Ge.now()<ae;at++){for(var se=Pe[at],ee=J,ie=se;ie=ie.previousSibling;){var le=ie.nodeType,he=(le===7||le===8)&&ie.nodeValue;if(he?!/^\??prettify\b/.test(he):le!==3||/\S/.test(ie.nodeValue))break;if(he){ee={},he.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ct,ht,At){ee[ht]=At});break}}var me=se.className;if((ee!==J||Ze.test(me))&&!De.test(me)){for(var ye=!1,ke=se.parentNode;ke;ke=ke.parentNode){var He=ke.tagName;if(oe.test(He)&&ke.className&&Ze.test(ke.className)){ye=!0;break}}if(!ye){se.className+=" prettyprinted";var $e=ee.lang;if(!$e){$e=me.match(Xe);var et;!$e&&(et=ge(se))&&qe.test(et.tagName)&&($e=et.className.match(Xe)),$e&&($e=$e[1])}var St;if(rt.test(se.tagName))St=1;else{var ot=se.currentStyle,nt=Ne.defaultView,Mt=ot?ot.whiteSpace:nt&&nt.getComputedStyle?nt.getComputedStyle(se,null).getPropertyValue("white-space"):0;St=Mt&&Mt.substring(0,3)==="pre"}var xt=ee.linenums;(xt=xt==="true"||+xt)||(xt=me.match(/\blinenums\b(?::(\d+))?/),xt=xt?xt[1]&&xt[1].length?+xt[1]:!0:!1),xt&&Le(se,xt,St);var It={langExtension:$e,sourceNode:se,numberLines:xt,pre:St,sourceCode:null,basePos:null,spans:null,decorations:null};T(It)}}}at<Pe.length?U.setTimeout(Z,250):typeof de=="function"&&de()}Z()}var $=U.PR={createSimpleLexer:be,registerLangHandler:ve,sourceDecorator:Be,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:G,PR_COMMENT:b,PR_DECLARATION:p,PR_KEYWORD:D,PR_LITERAL:h,PR_NOCODE:Q,PR_PLAIN:a,PR_PUNCTUATION:s,PR_SOURCE:y,PR_STRING:f,PR_TAG:g,PR_TYPE:c,prettyPrintOne:L?U.prettyPrintOne=R:k=R,prettyPrint:j=L?U.prettyPrint=W:j=W},N=U.define;typeof N=="function"&&N.amd&&N("google-code-prettify",[],function(){return $})})()},SMhR:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTD9c2nwzIk9pmA2TTNjeAPAnIpm1uANm0zQbIDSBPAXIDyKZtPhmQG22zAfLN2uaTAflUJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGT74ckCe1zZOAbNpm0zYbIDfaZgPkRts8qW1utM0GyKZtntI2GyBPArJpmw2QTds8CcimbW4A+WRAntQ23+pEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0viJXtU2T2qbDZA3Adm0zZOAbNpm0zYbIJu2+VZtswGyaZsbbbMBsmmbDZBN29xoG32mE0mSNE4kSdI4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IkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},STEk:function(_e,Ie,q){"use strict";q.d(Ie,"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 ue=function(H,T){return(ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,W){R.__proto__=W}||function(R,W){for(var $ in W)Object.prototype.hasOwnProperty.call(W,$)&&(R[$]=W[$])})(H,T)};function Y(H,T){function R(){this.constructor=H}ue(H,T),H.prototype=T===null?Object.create(T):(R.prototype=T.prototype,new R)}function L(H,T,R,W){return new(R||(R=Promise))(function($,N){function de(Ne){try{Ae(W.next(Ne))}catch(Me){N(Me)}}function xe(Ne){try{Ae(W.throw(Ne))}catch(Me){N(Me)}}function Ae(Ne){var Me;Ne.done?$(Ne.value):(Me=Ne.value,Me instanceof R?Me:new R(function(Re){Re(Me)})).then(de,xe)}Ae((W=W.apply(H,T||[])).next())})}function V(H,T){var R,W,$,N,de={label:0,sent:function(){if(1&$[0])throw $[1];return $[1]},trys:[],ops:[]};return N={next:xe(0),throw:xe(1),return:xe(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function xe(Ae){return function(Ne){return function(Me){if(R)throw new TypeError("Generator is already executing.");for(;de;)try{if(R=1,W&&($=2&Me[0]?W.return:Me[0]?W.throw||(($=W.return)&&$.call(W),0):W.next)&&!($=$.call(W,Me[1])).done)return $;switch(W=0,$&&(Me=[2&Me[0],$.value]),Me[0]){case 0:case 1:$=Me;break;case 4:return de.label++,{value:Me[1],done:!1};case 5:de.label++,W=Me[1],Me=[0];continue;case 7:Me=de.ops.pop(),de.trys.pop();continue;default:if(!($=de.trys,($=$.length>0&&$[$.length-1])||Me[0]!==6&&Me[0]!==2)){de=0;continue}if(Me[0]===3&&(!$||Me[1]>$[0]&&Me[1]<$[3])){de.label=Me[1];break}if(Me[0]===6&&de.label<$[1]){de.label=$[1],$=Me;break}if($&&de.label<$[2]){de.label=$[2],de.ops.push(Me);break}$[2]&&de.ops.pop(),de.trys.pop();continue}Me=T.call(H,de)}catch(Re){Me=[6,Re],W=0}finally{R=$=0}if(5&Me[0])throw Me[1];return{value:Me[0]?Me[1]:void 0,done:!0}}([Ae,Ne])}}}function _(){for(var H=0,T=0,R=arguments.length;T<R;T++)H+=arguments[T].length;var W=Array(H),$=0;for(T=0;T<R;T++)for(var N=arguments[T],de=0,xe=N.length;de<xe;de++,$++)W[$]=N[de];return W}var k=function(){function H(){}return H.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},H.setAttributes=function(T,R){for(var W=0,$=R;W<$.length;W++){var N=$[W],de=N[0],xe=N[1];T.setAttribute(de,xe)}},H.createRect=function(T,R,W){var $=document.createElementNS("http://www.w3.org/2000/svg","rect");return $.setAttribute("width",T.toString()),$.setAttribute("height",R.toString()),W&&H.setAttributes($,W),$},H.createLine=function(T,R,W,$,N){var de=document.createElementNS("http://www.w3.org/2000/svg","line");return de.setAttribute("x1",T.toString()),de.setAttribute("y1",R.toString()),de.setAttribute("x2",W.toString()),de.setAttribute("y2",$.toString()),N&&H.setAttributes(de,N),de},H.createPolygon=function(T,R){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",T),R&&H.setAttributes(W,R),W},H.createCircle=function(T,R){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(T/2).toString()),W.setAttribute("cy",(T/2).toString()),W.setAttribute("r",T.toString()),R&&H.setAttributes(W,R),W},H.createEllipse=function(T,R,W){var $=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return $.setAttribute("cx",(T/2).toString()),$.setAttribute("cy",(R/2).toString()),$.setAttribute("rx",(T/2).toString()),$.setAttribute("ry",(R/2).toString()),W&&H.setAttributes($,W),$},H.createGroup=function(T){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&H.setAttributes(R,T),R},H.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},H.createMarker=function(T,R,W,$,N,de,xe){var Ae=document.createElementNS("http://www.w3.org/2000/svg","marker");return H.setAttributes(Ae,[["id",T],["orient",R],["markerWidth",W.toString()],["markerHeight",$.toString()],["refX",N.toString()],["refY",de.toString()]]),Ae.appendChild(xe),Ae},H.createText=function(T){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),T&&H.setAttributes(R,T),R},H.createTSpan=function(T,R){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=T,R&&H.setAttributes(W,R),W},H.createImage=function(T){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&H.setAttributes(R,T),R},H.createPoint=function(T,R){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=T,W.y=R,W},H.createPath=function(T,R){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",T),R&&H.setAttributes(W,R),W},H}(),j=function(){function H(){}return H.addKey=function(T){H.key=T},Object.defineProperty(H,"isLicensed",{get:function(){return!!H.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(H.key)},enumerable:!1,configurable:!0}),H}(),U=function(){function H(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return H.prototype.rasterize=function(T,R,W){var $=this;return new Promise(function(N){var de=W!==void 0?W:document.createElement("canvas");T===null&&($.markersOnly=!0,$.naturalSize=!1);var xe=document.createElementNS("http://www.w3.org/2000/svg","svg");xe.setAttribute("xmlns","http://www.w3.org/2000/svg"),xe.setAttribute("width",R.width.baseVal.valueAsString),xe.setAttribute("height",R.height.baseVal.valueAsString),xe.setAttribute("viewBox","0 0 "+R.viewBox.baseVal.width.toString()+" "+R.viewBox.baseVal.height.toString()),xe.innerHTML=R.innerHTML,$.naturalSize===!0?(xe.width.baseVal.value=T.naturalWidth,xe.height.baseVal.value=T.naturalHeight):$.width!==void 0&&$.height!==void 0&&(xe.width.baseVal.value=$.width,xe.height.baseVal.value=$.height),de.width=xe.width.baseVal.value,de.height=xe.height.baseVal.value;var Ae=xe.outerHTML,Ne=de.getContext("2d");$.markersOnly!==!0&&Ne.drawImage(T,0,0,de.width,de.height);var Me=window.URL,Re=new Image(de.width,de.height);Re.setAttribute("crossOrigin","anonymous");var Pe=new Blob([Ae],{type:"image/svg+xml"}),We=Me.createObjectURL(Pe);Re.onload=function(){Ne.drawImage(Re,0,0),Me.revokeObjectURL(We);var Qe=de.toDataURL($.imageType,$.imageQuality);N(Qe)},Re.src=We})},H}(),O=function(){},I=function(){function H(T){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(H.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(H.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(H.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),H.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},H.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)},H.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 v("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new v("@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;
`))},H.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},H}(),v=function(H,T){this.selector=H,this.style=T},S=function(H,T){this.localName=H,this.style=T},M=function(){function H(T,R,W,$,N){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=R,this.markerItems=W,this.uiStyleSettings=$,this.styles=N,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return H.prototype.show=function(T){var R=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 W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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 de=document.createElement("div");de.className=""+R.toolbarButtonStyleClass.name,de.setAttribute("data-type-name",N.typeName),de.innerHTML=N.icon,de.addEventListener("click",function(){R.markerToolbarButtonClicked(de,N)}),R.buttons.push(de),R.markerButtons.push(de)}),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 $=document.createElement("div");$.className=this.toolbarBlockStyleClass.name,$.style.whiteSpace="nowrap",$.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild($),this.addActionButton($,'<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($,'<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()},H.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},H.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},H.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},H.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 R=0;R<this.markerButtons.length;R++)R<T||R===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[R]):(R===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[R]))}},H.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")},H.prototype.resetButtonStyles=function(){var T=this;this.buttons.forEach(function(R){R.className=R.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),R.className=R.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),R.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},H.prototype.addActionButton=function(T,R,W){var $=this,N=document.createElement("div");switch(N.className=""+this.toolbarButtonStyleClass.name,N.innerHTML=R,N.setAttribute("data-action",W),N.addEventListener("click",function(){$.actionToolbarButtonClicked(N,W)}),W){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)},H.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 v("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},H.prototype.markerToolbarButtonClicked=function(T,R){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",R)}),this.markerButtonOverflowBlock.style.display="none"},H.prototype.actionToolbarButtonClicked=function(T,R){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",R)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},H.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)},H.prototype.setActiveMarkerButton=function(T){var R=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===T});R&&this.setActiveButton(R)},H.prototype.setCurrentMarker=function(T){var R=this;this.currentMarker=T,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){R.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},H}(),w=function(){function H(T,R,W,$){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=R,this.uiStyleSettings=W,this.styles=$,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return H.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 R=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*R)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
padding: `+R+`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 v("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},H.prototype.show=function(T){var R;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((R=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},H.prototype.setPanelButtons=function(T){var R,W,$=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((R=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(N){var de;N.uiStyleSettings=$.uiStyleSettings;var xe=document.createElement("div");xe.className=$.toolboxButtonStyleClass.name+" "+((de=$.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&de!==void 0?de:$.toolboxButtonStyleColorsClass.name),xe.innerHTML=N.icon,xe.title=N.title,xe.addEventListener("click",function(){$.panelButtonClick(N)}),$.panelButtons.push(xe),$.buttonRow.appendChild(xe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},H.prototype.panelButtonClick=function(T){var R=this,W=-1;if(T!==this.activePanel){W=this.panels.indexOf(T),this.panelRow.innerHTML="";var $=T.getUi();$.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild($),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(){R.displayMode==="inline"?R.panelRow.style.display="none":R.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(N,de){var xe,Ae;N.className=R.toolboxButtonStyleClass.name+" "+(de===W?""+((xe=R.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&xe!==void 0?xe:R.toolboxActiveButtonStyleColorsClass.name):""+((Ae=R.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:R.toolboxButtonStyleColorsClass.name))})},H}(),A=function(H,T){this.title=H,this.icon=T},C=function(H){function T(R,W,$,N){var de=H.call(this,R,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 de.colors=[],de.addTransparent=!1,de.colorBoxes=[],de.colors=W,de.currentColor=$,de.setCurrentColor=de.setCurrentColor.bind(de),de.getColorBox=de.getColorBox.bind(de),de}return Y(T,H),T.prototype.getUi=function(){var R=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function($){var N=R.getColorBox($);W.appendChild(N),R.colorBoxes.push(N)}),W},T.prototype.getColorBox=function(R){var W=this,$=this.uiStyleSettings.toolbarHeight/4,N=this.uiStyleSettings.toolbarHeight-$,de=document.createElement("div");de.style.display="inline-block",de.style.boxSizing="content-box",de.style.width=N-2+"px",de.style.height=N-2+"px",de.style.padding="1px",de.style.marginRight="2px",de.style.marginBottom="2px",de.style.borderWidth="2px",de.style.borderStyle="solid",de.style.borderRadius=(N+2)/2+"px",de.style.borderColor=R===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",de.addEventListener("click",function(){W.setCurrentColor(R,de)});var xe=document.createElement("div");return xe.style.display="inline-block",xe.style.width=N-2+"px",xe.style.height=N-2+"px",xe.style.backgroundColor=R,xe.style.borderRadius=N/2+"px",R==="transparent"&&(xe.style.fill=this.uiStyleSettings.toolboxAccentColor,xe.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>`),de.appendChild(xe),de},T.prototype.setCurrentColor=function(R,W){var $=this;this.currentColor=R,this.colorBoxes.forEach(function(N){N.style.borderColor=N===W?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(R)},T}(A),d=function(){function H(T,R,W){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=R,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(H.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),H.prototype.ownsTarget=function(T){return!1},Object.defineProperty(H.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),H.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},H.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},H.prototype.pointerDown=function(T,R){},H.prototype.dblClick=function(T,R){},H.prototype.manipulate=function(T){},H.prototype.pointerUp=function(T){this.stateChanged()},H.prototype.dispose=function(){},H.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},H.prototype.getState=function(){return{typeName:H.typeName,state:this.state,notes:this.notes}},H.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},H.prototype.scale=function(T,R){},H.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},H.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},H.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)}},H.typeName="MarkerBase",H}(),o=function(){function H(){this.findGripByVisual=this.findGripByVisual.bind(this)}return H.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},H}(),l=function(){function H(){this.GRIP_SIZE=10,this.visual=k.createGroup(),this.visual.appendChild(k.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(k.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return H.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},H}(),u=function(){function H(){}return H.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},H.toSVGMatrix=function(T,R){return T.a=R.a,T.b=R.b,T.c=R.c,T.d=R.d,T.e=R.e,T.f=R.f,T},H}(),x=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||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(k.createTransform()),N.setupControlBox(),N}return Y(T,H),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(R){this._visual=R;var W=k.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(R){return!!H.prototype.ownsTarget.call(this,R)||!!(this.controlGrips.findGripByVisual(R)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(R))},T.prototype.pointerDown=function(R,W){H.prototype.pointerDown.call(this,R,W),this.state==="new"&&(this.left=R.x,this.top=R.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var $=this.unrotatePoint(R);if(this.manipulationStartX=$.x,this.manipulationStartY=$.y,this.offsetX=$.x-this.left,this.offsetY=$.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){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 de=this.container.transform.baseVal.getItem(0);de.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(de,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(R){var W=this.state;H.prototype.pointerUp.call(this,R),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(R),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(R){this.visual.style.transform="translate("+R.x+"px, "+R.y+"px)"},T.prototype.manipulate=function(R){var W=this.unrotatePoint(R);this.state==="creating"?this.resize(R):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(R)},T.prototype.resize=function(R){var W=this.manipulationStartLeft,$=this.manipulationStartWidth,N=this.manipulationStartTop,de=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+R.x-this.manipulationStartX,$=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:$=this.manipulationStartWidth+R.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:N=this.manipulationStartTop+R.y-this.manipulationStartY,de=this.manipulationStartHeight+this.manipulationStartTop-N;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:de=this.manipulationStartHeight+R.y-this.manipulationStartY}$>=0?(this.left=W,this.width=$):(this.left=W+$,this.width=-$),de>=0?(this.top=N,this.height=de):(this.top=N+de,this.height=-de),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(R){if(Math.abs(R.x-this.centerX)>.1){var W=Math.sign(R.x-this.centerX);this.rotationAngle=180*Math.atan((R.y-this.centerY)/(R.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},T.prototype.applyRotation=function(){var R=this.container.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(R,0)},T.prototype.rotatePoint=function(R){if(this.rotationAngle===0)return R;var W=this.container.getCTM(),$=k.createPoint(R.x,R.y);return{x:($=$.matrixTransform(W)).x,y:$.y}},T.prototype.unrotatePoint=function(R){if(this.rotationAngle===0)return R;var W=this.container.getCTM();W=W.inverse();var $=k.createPoint(R.x,R.y);return{x:($=$.matrixTransform(W)).x,y:$.y}},T.prototype.select=function(){H.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){H.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=k.createGroup();var R=k.createTransform();R.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(R),this.container.appendChild(this.controlBox),this.controlRect=k.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=k.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 R=this.controlBox.transform.baseVal.getItem(0);R.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(R,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 R=new l;return R.visual.transform.baseVal.appendItem(k.createTransform()),this.controlBox.appendChild(R.visual),R},T.prototype.positionGrips=function(){var R=this.controlGrips.topLeft.GRIP_SIZE,W=-R/2,$=W,N=(this.width+this.CB_DISTANCE)/2-R/2,de=(this.height+this.CB_DISTANCE)/2-R/2,xe=this.height+this.CB_DISTANCE-R/2,Ae=this.width+this.CB_DISTANCE-R/2;this.positionGrip(this.controlGrips.topLeft.visual,W,$),this.positionGrip(this.controlGrips.topCenter.visual,N,$),this.positionGrip(this.controlGrips.topRight.visual,Ae,$),this.positionGrip(this.controlGrips.centerLeft.visual,W,de),this.positionGrip(this.controlGrips.centerRight.visual,Ae,de),this.positionGrip(this.controlGrips.bottomLeft.visual,W,xe),this.positionGrip(this.controlGrips.bottomCenter.visual,N,xe),this.positionGrip(this.controlGrips.bottomRight.visual,Ae,xe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,N,$-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(R,W,$){var N=R.transform.baseVal.getItem(0);N.setTranslate(W,$),R.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)},H.prototype.getState.call(this))},T.prototype.restoreState=function(R){H.prototype.restoreState.call(this,R);var W=R;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(u.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(u.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},T.prototype.scale=function(R,W){H.prototype.scale.call(this,R,W);var $=this.rotatePoint({x:this.left,y:this.top}),N=this.unrotatePoint({x:$.x*R,y:$.y*W});this.left=N.x,this.top=N.y,this.width=this.width*R,this.height=this.height*W,this.adjustControlBox()},T}(d),m=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||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,H),T.prototype.ownsTarget=function(R){return!(!H.prototype.ownsTarget.call(this,R)&&R!==this.visual)},T.prototype.createVisual=function(){this.visual=k.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(R,W){H.prototype.pointerDown.call(this,R,W),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},T.prototype.manipulate=function(R){H.prototype.manipulate.call(this,R)},T.prototype.resize=function(R){H.prototype.resize.call(this,R),this.setSize()},T.prototype.setSize=function(){H.prototype.setSize.call(this),k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(R){H.prototype.pointerUp.call(this,R),this.setSize()},T.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&k.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},T.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&k.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&k.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&k.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},H.prototype.getState.call(this))},T.prototype.restoreState=function(R){var W=R;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),H.prototype.restoreState.call(this,R),this.setSize()},T.prototype.scale=function(R,W){H.prototype.scale.call(this,R,W),this.setSize()},T.title="Rectangle marker",T}(x),f=function(H){function T(R,W,$,N){var de=H.call(this,R,N||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return de.widths=[],de.widthBoxes=[],de.widths=W,de.currentWidth=$,de.setCurrentWidth=de.setCurrentWidth.bind(de),de}return Y(T,H),T.prototype.getUi=function(){var R=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function($){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=$===R.currentWidth?R.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){R.setCurrentWidth($,N)}),W.appendChild(N);var de=document.createElement("div");de.innerText=$.toString(),de.style.marginRight="5px",N.appendChild(de);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.display="flex",xe.style.alignItems="center";var Ae=document.createElement("hr");Ae.style.minWidth="20px",Ae.style.border="0px",Ae.style.borderTop=$+"px solid "+R.uiStyleSettings.toolboxColor,Ae.style.flexGrow="2",xe.appendChild(Ae),N.appendChild(xe),R.widthBoxes.push(N)}),W},T.prototype.setCurrentWidth=function(R,W){var $=this;this.currentWidth=R,this.widthBoxes.forEach(function(N){N.style.borderColor=N===W?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(A),D=function(H){function T(R,W,$,N){var de=H.call(this,R,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 de.styles=[],de.styleBoxes=[],de.styles=W,de.currentStyle=$,de.setCurrentStyle=de.setCurrentStyle.bind(de),de}return Y(T,H),T.prototype.getUi=function(){var R=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function($){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/R.styles.length-5+"%",N.style.borderColor=$===R.currentStyle?R.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){R.setCurrentStyle($,N)}),W.appendChild(N);var de=document.createElement("div");de.style.minHeight="20px",de.style.flexGrow="2",de.style.overflow="hidden";var xe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+R.uiStyleSettings.toolboxColor+'" stroke-width="3" '+($!==""?'stroke-dasharray="'+$+'"':"")+` />
</svg>`;de.innerHTML=xe,N.appendChild(de),R.styleBoxes.push(N)}),W},T.prototype.setCurrentStyle=function(R,W){var $=this;this.currentStyle=R,this.styleBoxes.forEach(function(N){N.style.borderColor=N===W?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(A),b=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||this;return N.strokeColor=$.defaultColor,N.strokeWidth=$.defaultStrokeWidth,N.strokeDasharray=$.defaultStrokeDasharray,N.strokePanel=new C("Line color",$.defaultColorSet,$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Y(T,H),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var R=H.prototype.getState.call(this);return R.typeName=T.typeName,R},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},h=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||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,H),T.prototype.ownsTarget=function(R){return!!H.prototype.ownsTarget.call(this,R)||!(!this.grip1.ownsTarget(R)&&!this.grip2.ownsTarget(R))},T.prototype.pointerDown=function(R,W){H.prototype.pointerDown.call(this,R,W),this.manipulationStartX=R.x,this.manipulationStartY=R.y,this.state==="new"&&(this.x1=R.x,this.y1=R.y,this.x2=R.x,this.y2=R.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(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(R){var W=this.state;H.prototype.pointerUp.call(this,R),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(R),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(R){this.state==="creating"?this.resize(R):this.state==="move"?(this.x1=this.manipulationStartX1+R.x-this.manipulationStartX,this.y1=this.manipulationStartY1+R.y-this.manipulationStartY,this.x2=this.manipulationStartX2+R.x-this.manipulationStartX,this.y2=this.manipulationStartY2+R.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(R)},T.prototype.resize=function(R){switch(this.activeGrip){case this.grip1:this.x1=R.x,this.y1=R.y;break;case this.grip2:case void 0:this.x2=R.x,this.y2=R.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){H.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){H.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=k.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 R=new l;return R.visual.transform.baseVal.appendItem(k.createTransform()),this.controlBox.appendChild(R.visual),R},T.prototype.positionGrips=function(){var R=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-R/2,this.y1-R/2),this.positionGrip(this.grip2.visual,this.x2-R/2,this.y2-R/2)},T.prototype.positionGrip=function(R,W,$){var N=R.transform.baseVal.getItem(0);N.setTranslate(W,$),R.transform.baseVal.replaceItem(N,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},H.prototype.getState.call(this))},T.prototype.restoreState=function(R){H.prototype.restoreState.call(this,R);var W=R;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},T.prototype.scale=function(R,W){H.prototype.scale.call(this,R,W),this.x1=this.x1*R,this.y1=this.y1*W,this.x2=this.x2*R,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},T}(d),s=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||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=$.defaultColor,N.strokeWidth=$.defaultStrokeWidth,N.strokeDasharray=$.defaultStrokeDasharray,N.strokePanel=new C("Line color",$.defaultColorSet,$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Y(T,H),T.prototype.ownsTarget=function(R){return!(!H.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorLine&&R!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=k.createGroup(),this.selectorLine=k.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=k.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(R,W){H.prototype.pointerDown.call(this,R,W),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()),k.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),k.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),k.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},T.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},T.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,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 R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},H.prototype.getState.call(this));return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){H.prototype.restoreState.call(this,R);var W=R;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.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}(h),a=function(H){function T(R,W,$,N){var de=H.call(this,R,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 de.fonts=[],de.fontBoxes=[],de.fonts=W,de.currentFont=$,de.setCurrentFont=de.setCurrentFont.bind(de),de}return Y(T,H),T.prototype.getUi=function(){var R=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function($){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/R.fonts.length-5+"%",N.style.borderColor=$===R.currentFont?R.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){R.setCurrentFont($,N)}),W.appendChild(N);var de=document.createElement("div");de.style.display="flex",de.style.minHeight="20px",de.style.flexGrow="2",de.style.fontFamily=$,de.style.overflow="hidden";var xe=document.createElement("div");xe.style.whiteSpace="nowrap",xe.style.overflow="hidden",xe.style.textOverflow="ellipsis",xe.innerHTML="The quick brown fox jumps over the lazy dog",de.appendChild(xe),N.appendChild(de),R.fontBoxes.push(N)}),W},T.prototype.setCurrentFont=function(R,W){var $=this;this.currentFont=R,this.fontBoxes.forEach(function(N){N.style.borderColor=N===W?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(A),g=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||this;return N.color="transparent",N.padding=5,N.DEFAULT_TEXT="your text here",N.text=N.DEFAULT_TEXT,N.isMoved=!1,N.color=$.defaultColor,N.fontFamily=$.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",$.defaultColorSet,$.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.fontFamilyPanel=new a("Font",$.defaultFontFamilies,$.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N}return Y(T,H),T.prototype.ownsTarget=function(R){if(H.prototype.ownsTarget.call(this,R)||R===this.visual||R===this.textElement||R===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function($){$===R&&(W=!0)}),W},T.prototype.createVisual=function(){this.visual=k.createGroup(),this.bgRectangle=k.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=k.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(k.createTransform()),this.textElement.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(R,W){H.prototype.pointerDown.call(this,R,W),this.isMoved=!1,this.pointerDownPoint=R,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},T.prototype.renderText=function(){var R=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(W){R.textElement.appendChild(k.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var R=this.textElement.getBBox(),W=1;if(R.width>0&&R.height>0){var $=(1*this.width-this.width*this.padding*2/100)/R.width,N=(1*this.height-this.height*this.padding*2/100)/R.height;W=Math.min($,N)}return W},T.prototype.getTextPosition=function(R){var W=this.textElement.getBBox(),$=0,N=0;return W.width>0&&W.height>0&&($=(this.width-W.width*R)/2,N=this.height/2-W.height*R/2),{x:$,y:N}},T.prototype.sizeText=function(){var R=this.textElement.getBBox(),W=this.getTextScale(),$=this.getTextPosition(W);$.y-=R.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+$.x+"px, "+$.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate($.x,$.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},T.prototype.manipulate=function(R){H.prototype.manipulate.call(this,R),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(R.x-this.pointerDownPoint.x)>5||Math.abs(R.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(R){H.prototype.resize.call(this,R),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){H.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(R){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),H.prototype.pointerUp.call(this,R),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var R=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(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(R.textEditor.style.fontSize);R.textEditor.clientWidth>=Number.parseInt(R.textEditor.style.maxWidth)&&W>.9;)W-=.1,R.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var $=W.clipboardData.getData("text"),N=window.getSelection();if(!N.rangeCount)return!1;N.deleteFromDocument(),N.getRangeAt(0).insertNode(document.createTextNode($)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){R.textEditDivClicked(R.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 R=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),$=this.textElement.getBBox(),N={x:$.width*R,y:$.height*R};W.x-=N.x/2,W.y-=N.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*R,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(R){this.text=R.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){H.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),H.prototype.deselect.call(this)},T.prototype.dblClick=function(R,W){H.prototype.dblClick.call(this,R,W),this.showTextEditor()},T.prototype.setColor=function(R){this.textElement&&k.setAttributes(this.textElement,[["fill",R]]),this.color=R,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(R)},T.prototype.setFont=function(R){this.textElement&&k.setAttributes(this.textElement,[["font-family",R]]),this.fontFamily=R,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 R=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},H.prototype.getState.call(this));return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){var W=R;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),H.prototype.restoreState.call(this,R),this.setSize()},T.prototype.scale=function(R,W){H.prototype.scale.call(this,R,W),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}(x),p=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||this;return N.color="transparent",N.lineWidth=3,N.drawing=!1,N.pixelRatio=1,N.color=$.defaultColor,N.lineWidth=$.defaultStrokeWidth,N.pixelRatio=$.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",$.defaultColorSet,$.defaultColor),N.colorPanel.onColorChanged=N.setColor,N.lineWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.lineWidthPanel.onWidthChanged=N.setLineWidth,N}return Y(T,H),T.prototype.ownsTarget=function(R){return!(!H.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=k.createGroup(),this.drawingImage=k.createImage(),this.visual.appendChild(this.drawingImage);var R=k.createTransform();this.visual.transform.baseVal.appendItem(R),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(R,W){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(R.x,R.y),this.drawing=!0):H.prototype.pointerDown.call(this,R,W)},T.prototype.manipulate=function(R){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(R.x,R.y),this.canvasContext.stroke()):H.prototype.manipulate.call(this,R)},T.prototype.resize=function(R){H.prototype.resize.call(this,R),k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(R){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):H.prototype.pointerUp.call(this,R)},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(),H.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),H.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var R=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],$=W[0],N=W[1],de=W[2],xe=W[3],Ae=!1,Ne=0;Ne<this.canvasElement.height;Ne++)for(var Me=0;Me<this.canvasElement.width;Me++)R.data[Ne*this.canvasElement.width*4+4*Me+3]>0&&(Ae=!0,Ne<N&&(N=Ne),Me<$&&($=Me),Ne>xe&&(xe=Ne),Me>de&&(de=Me));if(Ae){this.left=$/this.pixelRatio,this.top=N/this.pixelRatio,this.width=(de-$)/this.pixelRatio,this.height=(xe-N)/this.pixelRatio;var Re=document.createElement("canvas");Re.width=de-$,Re.height=xe-N,Re.getContext("2d").putImageData(this.canvasContext.getImageData($,N,de-$,xe-N),0,0),this.drawingImgUrl=Re.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){k.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(R){this.color=R,this.colorChanged(R)},T.prototype.setLineWidth=function(R){this.lineWidth=R},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 R=Object.assign({drawingImgUrl:this.drawingImgUrl},H.prototype.getState.call(this));return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){this.createVisual(),H.prototype.restoreState.call(this,R),this.drawingImgUrl=R.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(R,W){H.prototype.scale.call(this,R,W),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}(x),y=function(H){function T(R,W,$){var N=H.call(this,R,$||'<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=W,N.setCurrentType=N.setCurrentType.bind(N),N}return Y(T,H),T.prototype.getUi=function(){var R=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var $=function(xe){var Ae="both";switch(xe){case 0:Ae="both";break;case 1:Ae="start";break;case 2:Ae="end";break;case 3:Ae="none"}var Ne=document.createElement("div");if(Ne.style.display="flex",Ne.style.flexGrow="2",Ne.style.alignItems="center",Ne.style.justifyContent="space-between",Ne.style.padding="5px",Ne.style.borderWidth="2px",Ne.style.borderStyle="solid",Ne.style.borderColor=Ae===N.currentType?N.uiStyleSettings.toolboxAccentColor:"transparent",Ne.addEventListener("click",function(){R.setCurrentType(Ae,Ne)}),W.appendChild(Ne),Ae==="both"||Ae==="start"){var Me=document.createElement("div");Me.style.display="flex",Me.style.alignItems="center",Me.style.minHeight="20px",Me.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>`,Me.style.marginLeft="5px",Ne.appendChild(Me)}var Re=document.createElement("div");Re.style.display="flex",Re.style.alignItems="center",Re.style.minHeight="20px",Re.style.flexGrow="2";var Pe=document.createElement("hr");if(Pe.style.minWidth="20px",Pe.style.border="0px",Pe.style.borderTop="3px solid "+(N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxColor:"#eeeeee"),Pe.style.flexGrow="2",Re.appendChild(Pe),Ne.appendChild(Re),Ae==="both"||Ae==="end"){var We=document.createElement("div");We.style.display="flex",We.style.alignItems="center",We.style.minHeight="20px",We.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>`,We.style.marginRight="5px",Ne.appendChild(We)}N.typeBoxes.push(Ne)},N=this,de=0;de<4;de++)$(de);return W},T.prototype.setCurrentType=function(R,W){var $=this;this.currentType=R,this.typeBoxes.forEach(function(N){N.style.borderColor=N===W?$.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(A),P=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||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 y("Arrow type","end"),N.arrowTypePanel.onArrowTypeChanged=N.setArrowType,N}return Y(T,H),T.prototype.ownsTarget=function(R){return!(!H.prototype.ownsTarget.call(this,R)&&R!==this.arrow1&&R!==this.arrow2)},T.prototype.getArrowPoints=function(R,W){var $=this.arrowBaseWidth+2*this.strokeWidth,N=this.arrowBaseHeight+2*this.strokeWidth;return R-$/2+","+(W+N/2)+" "+R+","+(W-N/2)+" "+(R+$/2)+","+(W+N/2)},T.prototype.createTips=function(){this.arrow1=k.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=k.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(R,W){H.prototype.pointerDown.call(this,R,W),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(H.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",k.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),k.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(R,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var $=this.arrow2.transform.baseVal.getItem(0);$.setRotate(R+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem($,0)}},T.prototype.setArrowType=function(R){this.arrowType=R,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 R=Object.assign({arrowType:this.arrowType},H.prototype.getState.call(this));return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){H.prototype.restoreState.call(this,R);var W=R;this.arrowType=W.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}(s),G=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||this;return N.fillColor=$.defaultFillColor,N.strokeWidth=0,N.fillPanel=new C("Color",$.defaultColorSet,$.defaultFillColor),N.fillPanel.onColorChanged=N.setFillColor,N}return Y(T,H),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var R=H.prototype.getState.call(this);return R.typeName=T.typeName,R},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(m),Q=function(H){function T(R,W,$,N){var de=H.call(this,R,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 de.opacities=[],de.opacityBoxes=[],de.opacities=W,de.currentOpacity=$,de.setCurrentOpacity=de.setCurrentOpacity.bind(de),de}return Y(T,H),T.prototype.getUi=function(){var R=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function($){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=$===R.currentOpacity?R.uiStyleSettings.toolboxAccentColor:"transparent",N.addEventListener("click",function(){R.setCurrentOpacity($,N)}),W.appendChild(N);var de=document.createElement("div");de.innerText=100*$+"%",N.appendChild(de),R.opacityBoxes.push(N)}),W},T.prototype.setCurrentOpacity=function(R,W){var $=this;this.currentOpacity=R,this.opacityBoxes.forEach(function(N){N.style.borderColor=N===W?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(A),re=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||this;return N.setOpacity=N.setOpacity.bind(N),N.fillColor=$.defaultHighlightColor,N.strokeWidth=0,N.opacity=$.defaultHighlightOpacity,N.fillPanel=new C("Color",$.defaultColorSet,N.fillColor),N.fillPanel.onColorChanged=N.setFillColor,N.opacityPanel=new Q("Opacity",$.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return Y(T,H),T.prototype.setOpacity=function(R){this.opacity=R,this.visual&&k.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 R=H.prototype.getState.call(this);return R.typeName=T.typeName,R},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}(G),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>',F=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||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=$.defaultStrokeColor,N.bgColor=$.defaultFillColor,N.fontFamily=$.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",$.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",$.defaultColorSet,N.bgColor,z),N.bgColorPanel.onColorChanged=N.setBgColor,N.fontFamilyPanel=new a("Font",$.defaultFontFamilies,$.defaultFontFamily),N.fontFamilyPanel.onFontChanged=N.setFont,N.tipGrip=new l,N.tipGrip.visual.transform.baseVal.appendItem(k.createTransform()),N.controlBox.appendChild(N.tipGrip.visual),N}return Y(T,H),T.prototype.ownsTarget=function(R){return H.prototype.ownsTarget.call(this,R)||this.tipGrip.ownsTarget(R)||this.tip===R},T.prototype.createTip=function(){k.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=k.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(R,W){this.state==="new"&&H.prototype.pointerDown.call(this,R,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):H.prototype.pointerDown.call(this,R,W)},T.prototype.pointerUp=function(R){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,H.prototype.pointerUp.call(this,R);else{var W=this.state==="creating";H.prototype.pointerUp.call(this,R),this.setTipPoints(W),this.positionTip()}},T.prototype.manipulate=function(R){if(this.tipMoving){var W=this.unrotatePoint(R);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else H.prototype.manipulate.call(this,R)},T.prototype.setBgColor=function(R){this.bgRectangle&&this.tip&&(k.setAttributes(this.bgRectangle,[["fill",R]]),k.setAttributes(this.tip,[["fill",R]])),this.bgColor=R,this.fillColorChanged(R)},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(R){R===void 0&&(R=!1);var W=Math.min(this.height/2,15),$=this.height/5;R&&(this.tipPosition={x:W+$/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))?($=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+$,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+$}):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))?($=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-$,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+$}):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))?($=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-$,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-$},this.tipBase2Position={x:this.width,y:this.height-W}):N<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?($=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+$,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-$})},T.prototype.resize=function(R){H.prototype.resize.call(this,R),this.positionTip()},T.prototype.positionTip=function(){k.setAttributes(this.tip,[["points",this.getTipPoints()]]);var R=this.tipGrip.visual.transform.baseVal.getItem(0);R.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(R,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(),H.prototype.select.call(this)},T.prototype.getState=function(){var R=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},H.prototype.getState.call(this));return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){var W=R;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,H.prototype.restoreState.call(this,R),this.createTip(),this.setTipPoints()},T.prototype.scale=function(R,W){H.prototype.scale.call(this,R,W),this.tipPosition={x:this.tipPosition.x*R,y:this.tipPosition.y*W},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}(g),ne=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||this;return N.fillColor="transparent",N.strokeColor="transparent",N.strokeWidth=0,N.strokeDasharray="",N.opacity=1,N.strokeColor=$.defaultColor,N.strokeWidth=$.defaultStrokeWidth,N.strokeDasharray=$.defaultStrokeDasharray,N.fillColor=$.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",_($.defaultColorSet,["transparent"]),$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.fillPanel=new C("Fill color",_($.defaultColorSet,["transparent"]),N.fillColor,z),N.fillPanel.onColorChanged=N.setFillColor,N.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N.opacityPanel=new Q("Opacity",$.defaultOpacitySteps,N.opacity),N.opacityPanel.onOpacityChanged=N.setOpacity,N}return Y(T,H),T.prototype.ownsTarget=function(R){return!(!H.prototype.ownsTarget.call(this,R)&&R!==this.visual)},T.prototype.createVisual=function(){this.visual=k.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(R,W){H.prototype.pointerDown.call(this,R,W),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},T.prototype.manipulate=function(R){H.prototype.manipulate.call(this,R)},T.prototype.resize=function(R){H.prototype.resize.call(this,R),this.setSize()},T.prototype.setSize=function(){H.prototype.setSize.call(this),k.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(R){H.prototype.pointerUp.call(this,R),this.setSize()},T.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&k.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},T.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&k.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(R),this.stateChanged()},T.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&k.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&k.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(R){this.opacity=R,this.visual&&k.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 R=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},H.prototype.getState.call(this));return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){var W=R;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),H.prototype.restoreState.call(this,R),this.setSize()},T.prototype.scale=function(R,W){H.prototype.scale.call(this,R,W),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}(x),ce=function(H){function T(R,W,$){return H.call(this,R,W,$)||this}return Y(T,H),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(R){return!(!H.prototype.ownsTarget.call(this,R)&&R!==this.tip1&&R!==this.tip2)},T.prototype.createTips=function(){this.tip1=k.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(k.createTransform()),this.visual.appendChild(this.tip1),this.tip2=k.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(k.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(R,W){H.prototype.pointerDown.call(this,R,W),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(H.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(k.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()]]),k.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 R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(R,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var $=this.tip2.transform.baseVal.getItem(0);$.setRotate(R+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem($,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var R=H.prototype.getState.call(this);return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){H.prototype.restoreState.call(this,R),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}(s),ge=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||this;return N.strokePanel.colors=$.defaultColorSet,N.fillColor="transparent",N}return Y(T,H),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var R=H.prototype.getState.call(this);return R.typeName=T.typeName,R},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}(ne),be=function(){function H(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(H.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),H.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))},H.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},H.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},H.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}},H.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},H}(),Be=function(H){function T(R,W,$){var N=H.call(this,R,W,$)||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=$.defaultColor,N.strokeWidth=$.defaultStrokeWidth,N.strokeDasharray=$.defaultStrokeDasharray,N.strokePanel=new C("Line color",$.defaultColorSet,$.defaultColor),N.strokePanel.onColorChanged=N.setStrokeColor,N.strokeWidthPanel=new f("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),N.strokeWidthPanel.onWidthChanged=N.setStrokeWidth,N.strokeStylePanel=new D("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),N.strokeStylePanel.onStyleChanged=N.setStrokeDasharray,N}return Y(T,H),T.prototype.ownsTarget=function(R){return!(!H.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorCurve&&R!==this.visibleCurve&&!this.curveGrip.ownsTarget(R))},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=k.createGroup(),this.selectorCurve=k.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=k.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(R,W){H.prototype.pointerDown.call(this,R,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=R.x,this.curveY=R.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(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()),k.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),k.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),k.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){H.prototype.setupControlBox.call(this),this.curveControlLine1=k.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=k.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,H.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){H.prototype.positionGrips.call(this);var R=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-R/2,this.curveY-R/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(R){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+R.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+R.y-this.manipulationStartY),H.prototype.manipulate.call(this,R)},T.prototype.resize=function(R){this.activeGrip===this.curveGrip&&(this.curveX=R.x,this.curveY=R.y),H.prototype.resize.call(this,R),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(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},T.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},T.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual()},T.prototype.scale=function(R,W){this.curveX=this.curveX*R,this.curveY=this.curveY*W,H.prototype.scale.call(this,R,W)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},H.prototype.getState.call(this));return R.typeName=T.typeName,R},T.prototype.restoreState=function(R){H.prototype.restoreState.call(this,R);var W=R;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.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}(h),Se=function(){function H(T,R){R===void 0&&(R=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=R}return Object.defineProperty(H.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),H.prototype.preventDefault=function(){this._defaultPrevented=!0},H}(),Le=function(H){function T(R,W,$){var N=H.call(this,R,!1)||this;return N.dataUrl=W,N.state=$,N}return Y(T,H),T}(Se),Te=function(H){function T(R,W,$){$===void 0&&($=!1);var N=H.call(this,R,$)||this;return N.marker=W,N}return Y(T,H),T}(Se),we=function(){function H(){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 H.prototype.addEventListener=function(T,R){this[T].push(R)},H.prototype.removeEventListener=function(T,R){var W=this[T].indexOf(R);W>-1&&this[T].splice(W,1)},H}(),ve=function(){function H(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 be,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=H.instanceCounter++,this.styles=new I(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(H.prototype,"ALL_MARKER_TYPES",{get:function(){return[b,p,P,g,ge,ne,re,F,ce,G,s,Be]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[b,p,P,g,ne,re,F]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"BASIC_MARKER_TYPES",{get:function(){return[b,p,P,g,re]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var R=this;this._availableMarkerTypes.splice(0),T.forEach(function(W){if(typeof W=="string"){var $=R.ALL_MARKER_TYPES.find(function(N){return N.typeName===W});$!==void 0&&R._availableMarkerTypes.push($)}else R._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(H.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(H.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),H.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),j.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},H.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(R){return R(new Se(T))})},H.prototype.render=function(){return L(this,void 0,void 0,function(){var T;return V(this,function(R){switch(R.label){case 0:return this.setCurrentMarker(),(T=new U).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 R.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,R.sent()]}})})},H.prototype.close=function(T){var R=this;if(T===void 0&&(T=!1),this.isOpen){var W=!1;T||this.eventListeners.beforeclose.forEach(function($){var N=new Se(R,!0);$(N),N.defaultPrevented&&(W=!0)}),W||(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($){return $(new Se(R))}),this.detachEvents(),this._isOpen=!1)}},H.prototype.addMarkersToToolbar=function(){for(var T,R=[],W=0;W<arguments.length;W++)R[W]=arguments[W];(T=this._availableMarkerTypes).push.apply(T,R)},H.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(R){T(R.dataUrl,R.state)})},H.prototype.removeRenderEventListener=function(T){},H.prototype.addCloseEventListener=function(T){this.addEventListener("close",function(){T()})},H.prototype.removeCloseEventListener=function(T){},H.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))},H.prototype.onPopupTargetResize=function(){var T=1*this.target.clientWidth/this.target.clientHeight,R=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,W=R<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(R,W)},H.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},H.prototype.resize=function(T,R){this._isResizing=!0;var W=T/this.imageWidth,$=R/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(R),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(W,$),this._isResizing=!1},H.prototype.scaleMarkers=function(T,R){var W,$=this;this._currentMarker&&this._currentMarker instanceof g?this._currentMarker.scale(T,R):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(N){N!==$._currentMarker&&N.scale(T,R)}),W!==void 0&&this.setCurrentMarker(W)},H.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"},H.prototype.setTopLeft=function(){var T=this.editingTarget.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=T.left-R.left,this.top=T.top-R.top},H.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)},H.prototype.addDefs=function(){for(var T,R=[],W=0;W<arguments.length;W++)R[W]=arguments[W];this.defs=k.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,R)},H.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},H.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)},H.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},H.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},H.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)},H.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},H.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)},H.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()},H.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")},H.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"},H.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},H.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 M(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")},H.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},H.prototype.removeMarker=function(T){this.markerImage.removeChild(T.container),this.markers.indexOf(T)>-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},H.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())},H.prototype.toolbarButtonClicked=function(T,R){if(T==="marker"&&R!==void 0)this.createNewMarker(R);else if(T==="action")switch(R){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()}},H.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var R=!1;if(this.eventListeners.markerbeforedelete.forEach(function($){var N=new Te(T,T._currentMarker,!0);$(N),N.defaultPrevented&&(R=!0)}),!R){var W=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($){return $(new Te(T,W))})}}},H.prototype.clear=function(){var T=this,R=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(de){var xe=new Te(T,void 0,!0);de(xe),xe.defaultPrevented&&(R=!0)}),!R)){this.setCurrentMarker();for(var W=function(de){var xe=$.markers[de];$.setCurrentMarker($.markers[de]),$._currentMarker.dispose(),$.markerImage.removeChild($._currentMarker.container),$.markers.splice($.markers.indexOf($._currentMarker),1),$.eventListeners.markerdelete.forEach(function(Ae){return Ae(new Te(T,xe))})},$=this,N=this.markers.length-1;N>=0;N--)W(N);this.addUndoStep()}},Object.defineProperty(H.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),H.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))},H.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)},H.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},H.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var R=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===R.width&&W.height===R.height){var $=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(R),$<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(N){return N(new Se(T))})}else this.undoRedoManager.replaceLastUndoStep(R),this.eventListeners.statechange.forEach(function(N){return N(new Se(T))})}},H.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},H.prototype.undoStep=function(){var T=this,R=this.undoRedoManager.undo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Se(T))}))},H.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},H.prototype.redoStep=function(){var T=this,R=this.undoRedoManager.redo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Se(T))}))},H.prototype.stepZoom=function(){var T=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=T<this.zoomSteps.length-1?this.zoomSteps[T+1]:this.zoomSteps[0]},H.prototype.panTo=function(T){this.contentDiv.scrollBy({left:this.prevPanPoint.x-T.x,top:this.prevPanPoint.y-T.y}),this.prevPanPoint=T},H.prototype.startRenderAndClose=function(){return L(this,void 0,void 0,function(){var T,R,W=this;return V(this,function($){switch($.label){case 0:return[4,this.render()];case 1:return T=$.sent(),R=this.getState(),this.eventListeners.render.forEach(function(N){return N(new Le(W,T,R))}),this.close(!0),[2]}})})},H.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var R={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return R.markers.push(W.getState())}),R},H.prototype.restoreState=function(T){var R=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(W){var $=R._availableMarkerTypes.find(function(de){return de.typeName===W.typeName});if($!==void 0){var N=R.addNewMarker($);N.restoreState(W),R.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(W){return W(new Se(R))})},H.prototype.addNewMarker=function(T){var R=k.createGroup();return this.markerImage.appendChild(R),new T(R,this.overlayContainer,this.settings)},H.prototype.createNewMarker=function(T){var R,W=this;(R=typeof T=="string"?this._availableMarkerTypes.find(function($){return $.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(R),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(R.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function($){return $(new Te(W,W._currentMarker))}))},H.prototype.markerCreated=function(T){var R=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof p&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(p):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new Te(R,R._currentMarker))})},H.prototype.colorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=T,this.settings.defaultStrokeColor=T)},H.prototype.fillColorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=T)},H.prototype.markerStateChanged=function(T){var R=this;this.eventListeners.markerchange.forEach(function(W){return W(new Te(R,T))})},H.prototype.setCurrentMarker=function(T){var R=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new Te(R,R._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(W){return W(new Te(R,R._currentMarker))}))},H.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 R=this.markers.find(function(W){return W.ownsTarget(T.target)});R!==void 0?(this.setCurrentMarker(R),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))},H.prototype.onDblClick=function(T){if(this._isFocused||this.focus(),this.mode==="select"){var R=this.markers.find(function(W){return W.ownsTarget(T.target)});R!==void 0&&R!==this._currentMarker&&this.setCurrentMarker(R),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target):this.setCurrentMarker()}},H.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}))},H.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()},H.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},H.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},H.prototype.clientToLocalCoordinates=function(T,R){var W=this.markerImage.getBoundingClientRect();return{x:(T-W.left)/this.zoomLevel,y:(R-W.top)/this.zoomLevel}},H.prototype.onWindowResize=function(){this.positionUI()},H.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()},H.prototype.addLicenseKey=function(T){j.addKey(T)},H.prototype.addEventListener=function(T,R){this.eventListeners.addEventListener(T,R)},H.prototype.removeEventListener=function(T,R){this.eventListeners.removeEventListener(T,R)},H.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(H.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),H.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(R){return R(new Se(T))}))},H.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(R){return R(new Se(T))}))},H.instanceCounter=0,H}()},TGq3:function(_e,Ie,q){_e.exports=q.p+"static/lockclose.365036e8.svg"},"VrN/":function(_e,Ie,q){(function(ue,Y){_e.exports=Y()})(this,function(){"use strict";var ue=navigator.userAgent,Y=navigator.platform,L=/gecko\/\d/i.test(ue),V=/MSIE \d/.test(ue),_=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ue),k=/Edge\/(\d+)/.exec(ue),j=V||_||k,U=j&&(V?document.documentMode||6:+(k||_)[1]),O=!k&&/WebKit\//.test(ue),I=O&&/Qt\/\d+\.\d+/.test(ue),v=!k&&/Chrome\//.test(ue),S=/Opera\//.test(ue),M=/Apple Computer/.test(navigator.vendor),w=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ue),A=/PhantomJS/.test(ue),C=!k&&/AppleWebKit/.test(ue)&&/Mobile\/\w+/.test(ue),d=/Android/.test(ue),o=C||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ue),l=C||/Mac/.test(Y),u=/\bCrOS\b/.test(ue),x=/win/i.test(Y),m=S&&ue.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(S=!1,O=!0);var f=l&&(I||S&&(m==null||m<12.11)),D=L||j&&U>=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 h(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return h(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 E=0;E<t.length;++E)n.appendChild(t[E]);return n}function g(e,t,i,r){var n=a(e,t,i,r);return n.setAttribute("role","presentation"),n}var p;document.createRange?p=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:p=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 y(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 G(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}:j&&(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 F(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 ne(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var E=r||0,B=n||0;;){var K=e.indexOf(" ",E);if(K<0||K>=t)return B+(t-E);B+=K-E,B+=i-B%i,E=K+1}}var ce=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};ce.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ce.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 be=50,Be={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},Le={origin:"*mouse"},Te={origin:"+move"};function we(e,t,i){for(var r=0,n=0;;){var E=e.indexOf(" ",r);E==-1&&(E=e.length);var B=E-r;if(E==e.length||n+B>=t)return r+Math.min(B,t-n);if(n+=E-r,n+=i-n%i,r=E+1,n>=t)return r}}var ve=[""];function H(e){for(;ve.length<=e;)ve.push(T(ve)+" ");return ve[e]}function T(e){return e[e.length-1]}function R(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function W(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function $(){}function N(e,t){var i;return Object.create?i=Object.create(e):($.prototype=e,i=new $),t&&F(t,i),i}var de=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function xe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||de.test(e))}function Ae(e,t){return t?t.source.indexOf("\\w")>-1&&xe(e)?!0:t.test(e):xe(e)}function Ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Me=/[\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 Re(e){return e.charCodeAt(0)>=768&&Me.test(e)}function Pe(e,t,i){for(;(i<0?t>0:t<e.length)&&Re(e.charAt(t));)t+=i;return t}function We(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,E=r<0?Math.ceil(n):Math.floor(n);if(E==t)return e(E)?t:i;e(E)?i=E:t=E+r}}function Qe(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,E=0;E<e.length;++E){var B=e[E];(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",E),n=!0)}n||r(t,i,"ltr")}var Ve=null;function Ge(e,t,i){var r;Ve=null;for(var n=0;n<e.length;++n){var E=e[n];if(E.from<t&&E.to>t)return n;E.to==t&&(E.from!=E.to&&i=="before"?r=n:Ve=n),E.from==t&&(E.from!=E.to&&i!="before"?r=n:Ve=n)}return r!=null?r:Ve}var at=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]/,E=/[LRr]/,B=/[Lb1n]/,K=/[1n]/;function X(te,fe,pe){this.level=te,this.from=fe,this.to=pe}return function(te,fe){var pe=fe=="ltr"?"L":"R";if(te.length==0||fe=="ltr"&&!r.test(te))return!1;for(var Ce=te.length,Ee=[],Oe=0;Oe<Ce;++Oe)Ee.push(i(te.charCodeAt(Oe)));for(var Ue=0,Ke=pe;Ue<Ce;++Ue){var Ye=Ee[Ue];Ye=="m"?Ee[Ue]=Ke:Ke=Ye}for(var tt=0,Je=pe;tt<Ce;++tt){var it=Ee[tt];it=="1"&&Je=="r"?Ee[tt]="n":E.test(it)&&(Je=it,it=="r"&&(Ee[tt]="R"))}for(var pt=1,dt=Ee[0];pt<Ce-1;++pt){var Tt=Ee[pt];Tt=="+"&&dt=="1"&&Ee[pt+1]=="1"?Ee[pt]="1":Tt==","&&dt==Ee[pt+1]&&(dt=="1"||dt=="n")&&(Ee[pt]=dt),dt=Tt}for(var jt=0;jt<Ce;++jt){var tr=Ee[jt];if(tr==",")Ee[jt]="N";else if(tr=="%"){var Gt=void 0;for(Gt=jt+1;Gt<Ce&&Ee[Gt]=="%";++Gt);for(var Er=jt&&Ee[jt-1]=="!"||Gt<Ce&&Ee[Gt]=="1"?"1":"N",gr=jt;gr<Gt;++gr)Ee[gr]=Er;jt=Gt-1}}for(var Qt=0,vr=pe;Qt<Ce;++Qt){var nr=Ee[Qt];vr=="L"&&nr=="1"?Ee[Qt]="L":E.test(nr)&&(vr=nr)}for(var Zt=0;Zt<Ce;++Zt)if(n.test(Ee[Zt])){var Xt=void 0;for(Xt=Zt+1;Xt<Ce&&n.test(Ee[Xt]);++Xt);for(var Kt=(Zt?Ee[Zt-1]:pe)=="L",yr=(Xt<Ce?Ee[Xt]:pe)=="L",Gi=Kt==yr?Kt?"L":"R":pe,ti=Zt;ti<Xt;++ti)Ee[ti]=Gi;Zt=Xt-1}for(var sr=[],Ur,rr=0;rr<Ce;)if(B.test(Ee[rr])){var Va=rr;for(++rr;rr<Ce&&B.test(Ee[rr]);++rr);sr.push(new X(0,Va,rr))}else{var Kr=rr,vi=sr.length,yi=fe=="rtl"?1:0;for(++rr;rr<Ce&&Ee[rr]!="L";++rr);for(var dr=Kr;dr<rr;)if(K.test(Ee[dr])){Kr<dr&&(sr.splice(vi,0,new X(1,Kr,dr)),vi+=yi);var zi=dr;for(++dr;dr<rr&&K.test(Ee[dr]);++dr);sr.splice(vi,0,new X(2,zi,dr)),vi+=yi,Kr=dr}else++dr;Kr<rr&&sr.splice(vi,0,new X(1,Kr,rr))}return fe=="ltr"&&(sr[0].level==1&&(Ur=te.match(/^\s+/))&&(sr[0].from=Ur[0].length,sr.unshift(new X(0,0,Ur[0].length))),T(sr).level==1&&(Ur=te.match(/\s+$/))&&(T(sr).to-=Ur[0].length,sr.push(new X(0,Ce-Ur[0].length,Ce)))),fe=="rtl"?sr.reverse():sr}}();function Xe(e,t){var i=e.order;return i==null&&(i=e.order=at(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 rt(e,t){return e._handlers&&e._handlers[t]||Ze}function qe(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 E=ge(n,i);E>-1&&(r[t]=n.slice(0,E).concat(n.slice(E+1)))}}}function oe(e,t){var i=rt(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 J(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 Z(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 ae(e,t){return rt(e,t).length>0}function se(e){e.prototype.on=function(t,i){De(this,t,i)},e.prototype.off=function(t,i){qe(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 he(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)),l&&e.ctrlKey&&t==1&&(t=3),t}var ke=function(){if(j&&U<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),He;function $e(e){if(He==null){var t=a("span","\u200B");s(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(He=t.offsetWidth<=1&&t.offsetHeight>2&&!(j&&U<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 et;function St(e){if(et!=null)return et;var t=s(e,document.createTextNode("A\u062EA")),i=p(t,0,1).getBoundingClientRect(),r=p(t,1,2).getBoundingClientRect();return h(e),!i||i.left==i.right?!1:et=r.right-i.right<3}var ot=`
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 E=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),B=E.indexOf("\r");B!=-1?(i.push(E.slice(0,B)),t+=B+1):(i.push(E),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},Mt=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),xt=null;function It(e){if(xt!=null)return xt;var t=s(e,a("span","x")),i=t.getBoundingClientRect(),r=p(t,0,1).getBoundingClientRect();return xt=Math.abs(i.left-r.left)>1}var Ct={},ht={};function At(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ct[e]=t}function Ot(e,t){ht[e]=t}function Rt(e){if(typeof e=="string"&&ht.hasOwnProperty(e))e=ht[e];else if(e&&typeof e.name=="string"&&ht.hasOwnProperty(e.name)){var t=ht[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 Rt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Rt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Wt(e,t){t=Rt(t);var i=Ct[t.name];if(!i)return Wt(e,"text/plain");var r=i(e,t);if(qt.hasOwnProperty(t.name)){var n=qt[t.name];for(var E in n){if(!n.hasOwnProperty(E))continue;r.hasOwnProperty(E)&&(r["_"+E]=r[E]),r[E]=n[E]}}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 qt={};function hr(e,t){var i=qt.hasOwnProperty(e)?qt[e]:qt[e]={};F(t,i)}function Yt(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 wr(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 Ut(e,t,i){return e.startState?e.startState(t,i):!0}var mt=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};mt.prototype.eol=function(){return this.pos>=this.string.length},mt.prototype.sol=function(){return this.pos==this.lineStart},mt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mt.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},mt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},mt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mt.prototype.skipToEnd=function(){this.pos=this.string.length},mt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mt.prototype.backUp=function(e){this.pos-=e},mt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ne(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ne(this.string,this.lineStart,this.tabSize):0)},mt.prototype.indentation=function(){return ne(this.string,null,this.tabSize)-(this.lineStart?ne(this.string,this.lineStart,this.tabSize):0)},mt.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 E=this.string.slice(this.pos).match(e);return E&&E.index>0?null:(E&&t!==!1&&(this.pos+=E[0].length),E)}},mt.prototype.current=function(){return this.string.slice(this.start,this.pos)},mt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Fe(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],E=n.chunkSize();if(t<E){i=n;break}t-=E}return i.lines[t]}function ft(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(E){var B=E.text;n==i.line&&(B=B.slice(0,i.ch)),n==t.line&&(B=B.slice(t.ch)),r.push(B),++n}),r}function ut(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function gt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function yt(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],E=n.height;if(t<E){e=n;continue e}t-=E,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 st(e,t){return t>=e.first&&t<e.first+e.size}function zt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function je(e,t,i){if(i===void 0&&(i=null),!(this instanceof je))return new je(e,t,i);this.line=e,this.ch=t,this.sticky=i}function vt(e,t){return e.line-t.line||e.ch-t.ch}function ri(e,t){return e.sticky==t.sticky&&vt(e,t)==0}function bi(e){return je(e.line,e.ch)}function Ei(e,t){return vt(e,t)<0?t:e}function ii(e,t){return vt(e,t)<0?e:t}function xi(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Et(e,t){if(t.line<e.first)return je(e.first,0);var i=e.first+e.size-1;return t.line>i?je(i,Fe(e,i).text.length):Dn(t,Fe(e,t.line).text.length)}function Dn(e,t){var i=e.ch;return i==null||i>t?je(e.line,t):i<0?je(e.line,0):e}function ze(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=Et(e,t[r]);return i}var Ci=function(e,t){this.state=e,this.lookAhead=t},Ar=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ar.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ar.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}},Ar.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ar.fromSaved=function(e,t,i){return t instanceof Ci?new Ar(e,Yt(e.mode,t.state),i,t.lookAhead):new Ar(e,Yt(e.mode,t),i)},Ar.prototype.save=function(e){var t=e!==!1?Yt(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],E={};Lr(e,t.text,e.doc.mode,i,function(te,fe){return n.push(te,fe)},E,r);for(var B=i.state,K=function(te){i.baseTokens=n;var fe=e.state.overlays[te],pe=1,Ce=0;i.state=!0,Lr(e,t.text,fe.mode,i,function(Ee,Oe){for(var Ue=pe;Ce<Ee;){var Ke=n[pe];Ke>Ee&&n.splice(pe,1,Ee,n[pe+1],Ke),pe+=2,Ce=Math.min(Ee,Ke)}if(!Oe)return;if(fe.opaque)n.splice(Ue,pe-Ue,Ee,"overlay "+Oe),pe=Ue+2;else for(;Ue<pe;Ue+=2){var Ye=n[Ue+1];n[Ue+1]=(Ye?Ye+" ":"")+"overlay "+Oe}},E),i.state=B,i.baseTokens=null,i.baseTokenPos=1},X=0;X<e.state.overlays.length;++X)K(X);return{styles:n,classes:E.bgClass||E.textClass?E:null}}function ni(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Dr(e,yt(t)),n=t.text.length>e.options.maxHighlightLength&&Yt(e.doc.mode,r.state),E=Ki(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=E.styles,E.classes?t.styleClasses=E.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 Dr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new Ar(r,!0,t);var E=Ln(e,t,i),B=E>r.first&&Fe(r,E-1).stateAfter,K=B?Ar.fromSaved(r,B,E):new Ar(r,Ut(r.mode),E);return r.iter(E,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,E=new mt(t,e.options.tabSize,i);for(E.start=E.pos=r||0,t==""&&Qi(n,i.state);!E.eol();)Rr(n,E,i.state),E.start=E.pos}function Qi(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=wr(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Rr(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=wr(e,i).mode);var E=e.token(t,i);if(t.pos>t.start)return E}throw new Error("Mode "+e.name+" failed to advance stream.")}var Xi=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Rn(e,t,i,r){var n=e.doc,E=n.mode,B;t=Et(n,t);var K=Fe(n,t.line),X=Dr(e,t.line,i),te=new mt(K.text,e.options.tabSize,X),fe;for(r&&(fe=[]);(r||te.pos<t.ch)&&!te.eol();)te.start=te.pos,B=Rr(E,te,X.state),r&&fe.push(new Xi(te,B,Yt(n.mode,X.state)));return r?fe:new Xi(te,B,X.state)}function Yi(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 Lr(e,t,i,r,n,E,B){var K=i.flattenSpans;K==null&&(K=e.options.flattenSpans);var X=0,te=null,fe=new mt(t,e.options.tabSize,r),pe,Ce=e.options.addModeClass&&[null];for(t==""&&Yi(Qi(i,r.state),E);!fe.eol();){if(fe.pos>e.options.maxHighlightLength?(K=!1,B&&Vi(e,t,r,fe.pos),fe.pos=t.length,pe=null):pe=Yi(Rr(i,fe,r.state,Ce),E),Ce){var Ee=Ce[0].name;Ee&&(pe="m-"+(pe?Ee+" "+pe:Ee))}if(!K||te!=pe){for(;X<fe.start;)X=Math.min(fe.start,X+5e3),n(X,te);te=pe}fe.start=fe.pos}for(;X<fe.pos;){var Oe=Math.min(fe.pos,X+5e3);n(Oe,te),X=Oe}}function Ln(e,t,i){for(var r,n,E=e.doc,B=i?-1:t-(e.doc.mode.innerMode?1e3:100),K=t;K>B;--K){if(K<=E.first)return E.first;var X=Fe(E,K-1),te=X.stateAfter;if(te&&(!i||K+(te instanceof Ci?te.lookAhead:0)<=E.modeFrontier))return K;var fe=ne(X.text,null,e.options.tabSize);(n==null||r>fe)&&(n=K-1,r=fe)}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=Fe(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,lr=!1;function Vr(){Ji=!0}function oa(){lr=!0}function ai(e,t,i){this.marker=e,this.from=t,this.to=i}function kr(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 kn(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var E=e[n],B=E.marker,K=E.from==null||(B.inclusiveLeft?E.from<=t:E.from<t);if(K||E.from==t&&B.type=="bookmark"&&(!i||!E.marker.insertLeft)){var X=E.to==null||(B.inclusiveRight?E.to>=t:E.to>t);(r||(r=[])).push(new ai(B,E.from,X?null:E.to))}}return r}function Mn(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var E=e[n],B=E.marker,K=E.to==null||(B.inclusiveRight?E.to>=t:E.to>t);if(K||E.from==t&&B.type=="bookmark"&&(!i||E.marker.insertLeft)){var X=E.from==null||(B.inclusiveLeft?E.from<=t:E.from<t);(r||(r=[])).push(new ai(B,X?null:E.from-t,E.to==null?null:E.to-t))}}return r}function Si(e,t){if(t.full)return null;var i=st(e,t.from.line)&&Fe(e,t.from.line).markedSpans,r=st(e,t.to.line)&&Fe(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,E=t.to.ch,B=vt(t.from,t.to)==0,K=kn(i,n,B),X=Mn(r,E,B),te=t.text.length==1,fe=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 Ee=kr(X,Ce.marker);Ee?te&&(Ce.to=Ee.to==null?null:Ee.to+fe):Ce.to=n}}if(X)for(var Oe=0;Oe<X.length;++Oe){var Ue=X[Oe];if(Ue.to!=null&&(Ue.to+=fe),Ue.from==null){var Ke=kr(K,Ue.marker);Ke||(Ue.from=fe,te&&(K||(K=[])).push(Ue))}else Ue.from+=fe,te&&(K||(K=[])).push(Ue)}K&&(K=In(K)),X&&X!=K&&(X=In(X));var Ye=[K];if(!te){var tt=t.text.length-2,Je;if(tt>0&&K)for(var it=0;it<K.length;++it)K[it].to==null&&(Je||(Je=[])).push(new ai(K[it].marker,null,null));for(var pt=0;pt<tt;++pt)Ye.push(Je);Ye.push(X)}return Ye}function In(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(Ee){if(Ee.markedSpans)for(var Oe=0;Oe<Ee.markedSpans.length;++Oe){var Ue=Ee.markedSpans[Oe].marker;Ue.readOnly&&(!r||ge(r,Ue)==-1)&&(r||(r=[])).push(Ue)}}),!r)return null;for(var n=[{from:t,to:i}],E=0;E<r.length;++E)for(var B=r[E],K=B.find(0),X=0;X<n.length;++X){var te=n[X];if(vt(te.to,K.from)<0||vt(te.from,K.to)>0)continue;var fe=[X,1],pe=vt(te.from,K.from),Ce=vt(te.to,K.to);(pe<0||!B.inclusiveLeft&&!pe)&&fe.push({from:te.from,to:K.from}),(Ce>0||!B.inclusiveRight&&!Ce)&&fe.push({from:K.to,to:te.to}),n.splice.apply(n,fe),X+=fe.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(),E=vt(r.from,n.from)||oi(e)-oi(t);if(E)return-E;var B=vt(r.to,n.to)||si(e)-si(t);return B||t.id-e.id}function Fr(e,t){var i=lr&&e.markedSpans,r;if(i)for(var n=void 0,E=0;E<i.length;++E)n=i[E],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||Ti(r,n.marker)<0)&&(r=n.marker);return r}function jr(e){return Fr(e,!0)}function Wr(e){return Fr(e,!1)}function wi(e,t){var i=lr&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var E=i[n];E.marker.collapsed&&(E.from==null||E.from<t)&&(E.to==null||E.to>t)&&(!r||Ti(r,E.marker)<0)&&(r=E.marker)}return r}function Pn(e,t,i,r,n){var E=Fe(e,t),B=lr&&E.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),fe=vt(te.from,i)||oi(X.marker)-oi(n),pe=vt(te.to,r)||si(X.marker)-si(n);if(fe>=0&&pe<=0||fe<=0&&pe>=0)continue;if(fe<=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?vt(te.to,i)>=0:vt(te.to,i)>0)||fe>=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?vt(te.from,r)<=0:vt(te.from,r)<0))return!0}}function xr(e){for(var t;t=jr(e);)e=t.find(-1,!0).line;return e}function _n(e){for(var t;t=Wr(e);)e=t.find(1,!0).line;return e}function Di(e){for(var t,i;t=Wr(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qi(e,t){var i=Fe(e,t),r=xr(i);return i==r?t:yt(r)}function Qr(e,t){if(t>e.lastLine())return t;var i=Fe(e,t),r;if(!_r(e,i))return t;for(;r=Wr(i);)i=r.find(1,!0).line;return yt(i)+1}function _r(e,t){var i=lr&&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,kr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,E=0;E<t.markedSpans.length;++E)if(n=t.markedSpans[E],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 Mr(e){e=xr(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 E=i.parent;E;i=E,E=i.parent)for(var B=0;B<E.children.length;++B){var K=E.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=jr(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=Wr(r);){var E=i.find(0,!0);t-=r.text.length-E.from.ch,r=E.to.line,t+=r.text.length-E.to.ch}return t}function Bn(e){var t=e.display,i=e.doc;t.maxLine=Fe(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 yt(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&&gt(e,n)}function lt(e){e.parent=null,la(e)}var bt={},ct={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ct:bt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Pt(e,t){var i=g("span",null,null,O?"padding-right: .1px":null),r={pre:g("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 E=n?t.rest[n-1]:t.line,B=void 0;r.pos=0,r.addToken=kt,St(e.display.measure)&&(B=Xe(E,e.doc.direction))&&(r.addToken=cr(r.addToken,B)),r.map=[];var K=t!=e.display.externalMeasured&&yt(E);Hr(E,r,ni(e,E,K)),E.styleClasses&&(E.styleClasses.bgClass&&(r.bgClass=Q(E.styleClasses.bgClass,r.bgClass||"")),E.styleClasses.textClass&&(r.textClass=Q(E.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild($e(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 Ft(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 kt(e,t,i,r,n,E,B){if(!t)return;var K=e.splitSpaces?Jt(t,e.trailingSpace):t,X=e.cm.state.specialChars,te=!1,fe;if(!X.test(t))e.col+=t.length,fe=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,fe),j&&U<9&&(te=!0),e.pos+=t.length;else{fe=document.createDocumentFragment();for(var pe=0;;){X.lastIndex=pe;var Ce=X.exec(t),Ee=Ce?Ce.index-pe:t.length-pe;if(Ee){var Oe=document.createTextNode(K.slice(pe,pe+Ee));j&&U<9?fe.appendChild(a("span",[Oe])):fe.appendChild(Oe),e.map.push(e.pos,e.pos+Ee,Oe),e.col+=Ee,e.pos+=Ee}if(!Ce)break;pe+=Ee+1;var Ue=void 0;if(Ce[0]==" "){var Ke=e.cm.options.tabSize,Ye=Ke-e.col%Ke;Ue=fe.appendChild(a("span",H(Ye),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=Ye}else Ce[0]=="\r"||Ce[0]==`
`?(Ue=fe.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]),j&&U<9?fe.appendChild(a("span",[Ue])):fe.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||E||B){var tt=i||"";r&&(tt+=r),n&&(tt+=n);var Je=a("span",[fe],tt,E);if(B)for(var it in B)B.hasOwnProperty(it)&&it!="style"&&it!="class"&&Je.setAttribute(it,B[it]);return e.content.appendChild(Je)}e.content.appendChild(fe)}function Jt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var E=e.charAt(n);E==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(E="\xA0"),r+=E,i=E==" "}return r}function cr(e,t){return function(i,r,n,E,B,K,X){n=n?n+" cm-force-border":"cm-force-border";for(var te=i.pos,fe=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>=fe)return e(i,r,n,E,B,K,X);e(i,r.slice(0,pe.to-te),n,E,null,K,X),E=null,r=r.slice(pe.to-te),te=pe.to}}}function Lt(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 Hr(e,t,i){var r=e.markedSpans,n=e.text,E=0;if(!r){for(var B=1;B<i.length;B+=2)t.addToken(t,n.slice(E,E=i[B]),Dt(i[B+1],t.cm.options));return}for(var K=n.length,X=0,te=1,fe="",pe,Ce,Ee=0,Oe,Ue,Ke,Ye,tt;;){if(Ee==X){Oe=Ue=Ke=Ce="",tt=null,Ye=null,Ee=Infinity;for(var Je=[],it=void 0,pt=0;pt<r.length;++pt){var dt=r[pt],Tt=dt.marker;if(Tt.type=="bookmark"&&dt.from==X&&Tt.widgetNode)Je.push(Tt);else if(dt.from<=X&&(dt.to==null||dt.to>X||Tt.collapsed&&dt.to==X&&dt.from==X)){if(dt.to!=null&&dt.to!=X&&Ee>dt.to&&(Ee=dt.to,Ue=""),Tt.className&&(Oe+=" "+Tt.className),Tt.css&&(Ce=(Ce?Ce+";":"")+Tt.css),Tt.startStyle&&dt.from==X&&(Ke+=" "+Tt.startStyle),Tt.endStyle&&dt.to==Ee&&(it||(it=[])).push(Tt.endStyle,dt.to),Tt.title&&((tt||(tt={})).title=Tt.title),Tt.attributes)for(var jt in Tt.attributes)(tt||(tt={}))[jt]=Tt.attributes[jt];Tt.collapsed&&(!Ye||Ti(Ye.marker,Tt)<0)&&(Ye=dt)}else dt.from>X&&Ee>dt.from&&(Ee=dt.from)}if(it)for(var tr=0;tr<it.length;tr+=2)it[tr+1]==Ee&&(Ue+=" "+it[tr]);if(!Ye||Ye.from==X)for(var Gt=0;Gt<Je.length;++Gt)Lt(t,0,Je[Gt]);if(Ye&&(Ye.from||0)==X){if(Lt(t,(Ye.to==null?K+1:Ye.to)-X,Ye.marker,Ye.from==null),Ye.to==null)return;Ye.to==X&&(Ye=!1)}}if(X>=K)break;for(var Er=Math.min(K,Ee);;){if(fe){var gr=X+fe.length;if(!Ye){var Qt=gr>Er?fe.slice(0,Er-X):fe;t.addToken(t,Qt,pe?pe+Oe:Oe,Ke,X+Qt.length==Ee?Ue:"",Ce,tt)}if(gr>=Er){fe=fe.slice(Er-X),X=Er;break}X=gr,Ke=""}fe=n.slice(E,E=i[te++]),pe=Dt(i[te++],t.cm.options)}}}function _t(e,t,i){this.line=t,this.rest=Di(t),this.size=this.rest?yt(T(this.rest))-i+1:1,this.node=this.text=null,this.hidden=_r(e,t)}function fr(e,t,i){for(var r=[],n,E=t;E<i;E=n){var B=new _t(e.doc,Fe(e.doc,E),E);n=E+B.size,r.push(B)}return r}var ar=null;function Tr(e){ar?ar.ops.push(e):e.ownsGroup=ar={ops:[e],delayedCallbacks:[]}}function ks(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 Ms(e,t){var i=e.ownsGroup;if(!i)return;try{ks(i)}finally{ar=null,t(i)}}var tn=null;function ir(e,t){var i=rt(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),n;ar?n=ar.delayedCallbacks:tn?n=tn:(n=tn=[],setTimeout(Is,0));for(var E=function(K){n.push(function(){return i[K].apply(null,r)})},B=0;B<i.length;++B)E(B)}function Is(){var e=tn;tn=null;for(var t=0;t<e.length;++t)e[t]()}function Xa(e,t,i,r){for(var n=0;n<t.changes.length;n++){var E=t.changes[n];E=="text"?Ps(e,t):E=="gutter"?Ja(e,t,i,r):E=="class"?da(e,t):E=="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),j&&U<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 Ya(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Pt(e,t)}function Ps(e,t){var i=t.text.className,r=Ya(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,da(e,t)):i&&(t.text.className=i)}function da(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 E=t.line.gutterMarkers;if(e.options.lineNumbers||E){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&&(!E||!E["CodeMirror-linenumbers"])&&(t.lineNumber=K.appendChild(a("div",zt(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),E)for(var X=0;X<e.display.gutterSpecs.length;++X){var te=e.display.gutterSpecs[X].className,fe=E.hasOwnProperty(te)&&E[te];fe&&K.appendChild(a("div",[fe],"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,E=void 0;n;n=E)E=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);Za(e,t,i)}function Bs(e,t,i,r){var n=Ya(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),da(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 E=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?E.insertBefore(te,i.gutter||i.text):E.appendChild(te),ir(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(!y(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;"),s(t.display.measure,a("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Gr(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 ha(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,a("pre","x","CodeMirror-line-like")),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 Br(e){return be-e.display.nativeBarWidth}function ui(e){return e.display.scroller.clientWidth-Br(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-Br(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 E=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&&E.push((X.bottom+te.top)/2-i.top)}}E.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(yt(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Fs(e,t){t=xr(t);var i=yt(t),r=e.display.externalMeasured=new _t(e.doc,t,i);r.lineN=i;var n=r.built=Pt(e,r);return r.text=n.pre,s(e.display.lineMeasure,n.pre),r}function to(e,t,i,r){return Nr(e,Ri(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 Ri(e,t){var i=yt(t),r=fa(e,i);r&&!r.text?r=null:r&&r.changes&&(Xa(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 Nr(e,t,i,r,n){t.before&&(i=-1);var E=i+(r||""),B;return t.cache.hasOwnProperty(E)?B=t.cache[E]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),B=Ws(e,t,i,r),B.bogus||(t.cache[E]=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,E,B,K,X,te=0;te<e.length;te+=3)if(K=e[te],X=e[te+1],t<K?(n=0,E=1,B="left"):t<X?(n=t-K,E=n+1):(te==e.length-3||t==X&&e[te+3]>t)&&(E=X-K,n=E-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:E,collapse:B,coverStart:K,coverEnd:X}}function js(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 Ws(e,t,i,r){var n=io(t.map,i,r),E=n.node,B=n.start,K=n.end,X=n.collapse,te;if(E.nodeType==3){for(var fe=0;fe<4;fe++){for(;B&&Re(t.line.text.charAt(n.coverStart+B));)--B;for(;n.coverStart+K<n.coverEnd&&Re(t.line.text.charAt(n.coverStart+K));)++K;if(j&&U<9&&B==0&&K==n.coverEnd-n.coverStart?te=E.parentNode.getBoundingClientRect():te=js(p(E,B,K).getClientRects(),r),te.left||te.right||B==0)break;K=B,B=B-1,X="right"}j&&U<11&&(te=Hs(e.display.measure,te))}else{B>0&&(X=r="right");var pe;e.options.lineWrapping&&(pe=E.getClientRects()).length>1?te=pe[r=="right"?pe.length-1:0]:te=E.getBoundingClientRect()}if(j&&U<9&&!B&&(!te||!te.left&&!te.right)){var Ce=E.parentNode.getClientRects()[0];Ce?te={left:Ce.left,right:Ce.left+ki(e.display),top:Ce.top,bottom:Ce.bottom}:te=ro}for(var Ee=te.top-t.rect.top,Oe=te.bottom-t.rect.top,Ue=(Ee+Oe)/2,Ke=t.view.measure.heights,Ye=0;Ye<Ke.length-1&&!(Ue<Ke[Ye]);Ye++);var tt=Ye?Ke[Ye-1]:0,Je=Ke[Ye],it={left:(X=="right"?te.right:te.left)-t.rect.left,right:(X=="left"?te.left:te.right)-t.rect.left,top:tt,bottom:Je};return!te.left&&!te.right&&(it.bogus=!0),e.options.singleCursorHeightPerLine||(it.rtop=Ee,it.rbottom=Oe),it}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!It(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,h(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 v&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return v&&d?-(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 E=pa(t);i.top+=E,i.bottom+=E}if(r=="line")return i;r||(r="local");var B=Mr(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 E=e.display.sizer.getBoundingClientRect();r+=E.left,n+=E.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=Fe(e.doc,t.line)),Un(e,r,to(e,r,t.ch,n),i)}function Ir(e,t,i,r,n,E){r=r||Fe(e.doc,t.line),n||(n=Ri(e,r));function B(Oe,Ue){var Ke=Nr(e,n,Oe,Ue?"right":"left",E);return Ue?Ke.left=Ke.right:Ke.right=Ke.left,Un(e,r,Ke,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 fe(Oe,Ue,Ke){var Ye=K[Ue],tt=Ye.level==1;return B(Ke?Oe-1:Oe,tt!=Ke)}var pe=Ge(K,X,te),Ce=Ve,Ee=fe(X,pe,te=="before");return Ce!=null&&(Ee.other=fe(X,Ce,te!="before")),Ee}function uo(e,t){var i=0;t=Et(e.doc,t),e.options.lineWrapping||(i=ki(e.display)*t.ch);var r=Fe(e.doc,t.line),n=Mr(r)+Nn(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function ga(e,t,i,r,n){var E=je(e,t,i);return E.xRel=n,r&&(E.outside=r),E}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),E=r.first+r.size-1;if(n>E)return ga(r.first+r.size-1,Fe(r,E).text.length,null,1,1);t<0&&(t=0);for(var B=Fe(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=Fe(r,n=te.line)}}function ho(e,t,i,r){r-=pa(t);var n=t.text.length,E=We(function(B){return Nr(e,i,B-1).bottom<=r},n,0);return n=We(function(B){return Nr(e,i,B).top>r},E,n),{begin:E,end:n}}function co(e,t,i,r){i||(i=Ri(e,t));var n=Un(e,t,Nr(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-=Mr(t);var E=Ri(e,t),B=pa(t),K=0,X=t.text.length,te=!0,fe=Xe(t,e.doc.direction);if(fe){var pe=(e.options.lineWrapping?Ks:zs)(e,t,i,E,fe,r,n);te=pe.level!=1,K=te?pe.from:pe.to-1,X=te?pe.to:pe.from-1}var Ce=null,Ee=null,Oe=We(function(pt){var dt=Nr(e,E,pt);return dt.top+=B,dt.bottom+=B,ya(dt,r,n,!1)?(dt.top<=n&&dt.left<=r&&(Ce=pt,Ee=dt),!0):!1},K,X),Ue,Ke,Ye=!1;if(Ee){var tt=r-Ee.left<Ee.right-r,Je=tt==te;Oe=Ce+(Je?0:1),Ke=Je?"after":"before",Ue=tt?Ee.left:Ee.right}else{!te&&(Oe==X||Oe==K)&&Oe++,Ke=Oe==0?"after":Oe==t.text.length?"before":Nr(e,E,Oe-(te?1:0)).bottom+B<=n==te?"after":"before";var it=Ir(e,je(i,Oe,Ke),"line",t,E);Ue=it.left,Ye=n<it.top?-1:n>=it.bottom?1:0}return Oe=Pe(t.text,Oe,1),ga(i,Oe,Ke,Ye,r-Ue)}function zs(e,t,i,r,n,E,B){var K=We(function(pe){var Ce=n[pe],Ee=Ce.level!=1;return ya(Ir(e,je(i,Ee?Ce.to:Ce.from,Ee?"before":"after"),"line",t,r),E,B,!0)},0,n.length-1),X=n[K];if(K>0){var te=X.level!=1,fe=Ir(e,je(i,te?X.from:X.to,te?"after":"before"),"line",t,r);ya(fe,E,B,!0)&&fe.top>B&&(X=n[K-1])}return X}function Ks(e,t,i,r,n,E,B){var K=ho(e,t,r,B),X=K.begin,te=K.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var fe=null,pe=null,Ce=0;Ce<n.length;Ce++){var Ee=n[Ce];if(Ee.from>=te||Ee.to<=X)continue;var Oe=Ee.level!=1,Ue=Nr(e,r,Oe?Math.min(te,Ee.to)-1:Math.max(X,Ee.from)).right,Ke=Ue<E?E-Ue+1e9:Ue-E;(!fe||pe>Ke)&&(fe=Ee,pe=Ke)}return fe||(fe=n[n.length-1]),fe.from<X&&(fe={from:X,to:fe.to,level:fe.level}),fe.to>te&&(fe={from:fe.from,to:te,level:fe.level}),fe}var di;function Li(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(di==null){di=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)di.appendChild(document.createTextNode("x")),di.appendChild(a("br"));di.appendChild(document.createTextNode("x"))}s(e.measure,di);var i=di.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),h(e.measure),i||1}function ki(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),i=a("pre",[t],"CodeMirror-line-like");s(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,E=t.gutters.firstChild,B=0;E;E=E.nextSibling,++B){var K=e.display.gutterSpecs[B].className;i[K]=E.offsetLeft+E.clientLeft+n,r[K]=E.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=Li(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/ki(e.display)-3);return function(n){if(_r(e.doc,n))return 0;var E=0;if(n.widgets)for(var B=0;B<n.widgets.length;B++)n.widgets[B].height&&(E+=n.widgets[B].height);return i?E+(Math.ceil(n.text.length/r)||1)*t:E+t}}function xa(e){var t=e.doc,i=fo(e);t.iter(function(r){var n=i(r);n!=r.height&&gt(r,n)})}function hi(e,t,i,r){var n=e.display;if(!i&&me(t).getAttribute("cm-not-content")=="true")return null;var E,B,K=n.lineSpace.getBoundingClientRect();try{E=t.clientX-K.left,B=t.clientY-K.top}catch(pe){return null}var X=va(e,E,B),te;if(r&&X.xRel>0&&(te=Fe(e.doc,X.line).text).length==X.ch){var fe=ne(te,te.length,e.options.tabSize)-te.length;X=je(X.line,Math.max(0,Math.round((E-$a(e.display).left)/ki(e.display))-fe))}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 pr(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)lr&&qi(e.doc,t)<n.viewTo&&Yr(e);else if(i<=n.viewFrom)lr&&Qr(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 E=Fn(e,i,i+r,1);E?(n.view=n.view.slice(E.index),n.viewFrom=E.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(fr(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 Xr(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 E=r.view[ci(e,t)];if(E.node==null)return;var B=E.changes||(E.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),E,B=e.display.view;if(!lr||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;E=K+B[n].size-t,n++}else E=K-t;t+=E,i+=E}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=fr(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=fr(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(fr(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(),E=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,E)}return r}function go(e,t,i){var r=Ir(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 E=i.appendChild(a("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));E.style.display="",E.style.left=r.other.left+"px",E.style.top=r.other.top+"px",E.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function jn(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,i){var r=e.display,n=e.doc,E=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 fe(Je,it,pt,dt){it<0&&(it=0),it=Math.round(it),dt=Math.round(dt),E.appendChild(a("div",null,"CodeMirror-selected","position: absolute; left: "+Je+`px;
top: `+it+"px; width: "+(pt==null?X-Je:pt)+`px;
height: `+(dt-it)+"px"))}function pe(Je,it,pt){var dt=Fe(n,Je),Tt=dt.text.length,jt,tr;function Gt(Qt,vr){return ma(e,je(Je,Qt),"div",dt,vr)}function Er(Qt,vr,nr){var Zt=co(e,dt,null,Qt),Xt=vr=="ltr"==(nr=="after")?"left":"right",Kt=nr=="after"?Zt.begin:Zt.end-(/\s/.test(dt.text.charAt(Zt.end-1))?2:1);return Gt(Kt,Xt)[Xt]}var gr=Xe(dt,n.direction);return Qe(gr,it||0,pt==null?Tt:pt,function(Qt,vr,nr,Zt){var Xt=nr=="ltr",Kt=Gt(Qt,Xt?"left":"right"),yr=Gt(vr-1,Xt?"right":"left"),Gi=it==null&&Qt==0,ti=pt==null&&vr==Tt,sr=Zt==0,Ur=!gr||Zt==gr.length-1;if(yr.top-Kt.top<=3){var rr=(te?Gi:ti)&&sr,Va=(te?ti:Gi)&&Ur,Kr=rr?K:(Xt?Kt:yr).left,vi=Va?X:(Xt?yr:Kt).right;fe(Kr,Kt.top,vi-Kr,Kt.bottom)}else{var yi,dr,zi,Qa;Xt?(yi=te&&Gi&&sr?K:Kt.left,dr=te?X:Er(Qt,nr,"before"),zi=te?K:Er(vr,nr,"after"),Qa=te&&ti&&Ur?X:yr.right):(yi=te?Er(Qt,nr,"before"):K,dr=!te&&Gi&&sr?X:Kt.right,zi=!te&&ti&&Ur?K:yr.left,Qa=te?Er(vr,nr,"after"):X),fe(yi,Kt.top,dr-yi,Kt.bottom),Kt.bottom<yr.top&&fe(K,Kt.bottom,null,yr.top),fe(zi,yr.top,Qa-zi,yr.bottom)}(!jt||jn(Kt,jt)<0)&&(jt=Kt),jn(yr,jt)<0&&(jt=yr),(!tr||jn(Kt,tr)<0)&&(tr=Kt),jn(yr,tr)<0&&(tr=yr)}),{start:jt,end:tr}}var Ce=t.from(),Ee=t.to();if(Ce.line==Ee.line)pe(Ce.line,Ce.ch,Ee.ch);else{var Oe=Fe(n,Ce.line),Ue=Fe(n,Ee.line),Ke=xr(Oe)==xr(Ue),Ye=pe(Ce.line,Ce.ch,Ke?Oe.text.length+1:null).end,tt=pe(Ee.line,Ke?0:null,Ee.ch).start;Ke&&(Ye.top<tt.top-2?(fe(Ye.right,Ye.top,null,Ye.bottom),fe(K,tt.top,tt.left,tt.bottom)):fe(Ye.right,Ye.top,tt.left-Ye.right,Ye.bottom)),Ye.bottom<tt.top&&fe(K,Ye.bottom,null,tt.top)}i.appendChild(E)}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()||Mi(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,Mi(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,G(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 Mi(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 Wn(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var n=t.view[r],E=e.options.lineWrapping,B=void 0,K=0;if(n.hidden)continue;if(j&&U<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,!E&&n.text.firstChild&&(K=n.text.firstChild.getBoundingClientRect().right-te.left-1)}var fe=n.line.height-B;if((fe>.005||fe<-.005)&&(gt(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/ki(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,E=wt(t,r),B=wt(t,n);if(i&&i.ensure){var K=i.ensure.from.line,X=i.ensure.to.line;K<E?(E=K,B=wt(t,Mr(Fe(t,K))+e.wrapper.clientHeight)):Math.min(X,t.lastLine())>=B&&(E=wt(t,Mr(Fe(t,X))-e.wrapper.clientHeight),B=X)}return{from:E,to:Math.max(B,E+1)}}function Xs(e,t){if(J(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 E=a("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Nn(e.display))+`px;
height: `+(t.bottom-t.top+Br(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(E),E.scrollIntoView(n),e.display.lineSpace.removeChild(E)}}function Ys(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(t=t.ch?je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?je(t.line,t.ch+1,"before"):t);for(var E=0;E<5;E++){var B=!1,K=Ir(e,t),X=!i||i==t?K:Ir(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),fe=e.doc.scrollTop,pe=e.doc.scrollLeft;if(te.scrollTop!=null&&(ln(e,te.scrollTop),Math.abs(e.doc.scrollTop-fe)>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=Li(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,E=ca(e),B={};t.bottom-t.top>E&&(t.bottom=t.top+E);var K=e.doc.height+ha(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+E){var fe=Math.min(t.top,(te?K:t.bottom)-E);fe!=n&&(B.scrollTop=fe)}var pe=e.options.fixedGutter?0:i.gutters.offsetWidth,Ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-pe,Ee=ui(e)-i.gutters.offsetWidth,Oe=t.right-t.left>Ee;return Oe&&(t.right=t.left+Ee),t.left<10?B.scrollLeft=0:t.left<Ce?B.scrollLeft=Math.max(0,t.left+pe-(Oe?0:10)):t.right>Ee+Ce-3&&(B.scrollLeft=t.right+(Oe?0:10)-Ee),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 Ii(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;L||Da(e,{top:t}),xo(e,t,!0),L&&Da(e),hn(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+ha(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+Br(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,j&&U<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 E=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+E)+"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=l&&!w?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ce,this.disableVert=new ce},pi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),E=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);E!=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 dn=function(){};dn.prototype.update=function(){return{bottom:0,right:0}},dn.prototype.setScrollLeft=function(){},dn.prototype.setScrollTop=function(){},dn.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&&Wn(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:dn};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&&G(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},Tr(e.curOp)}function gi(e){var t=e.curOp;t&&Ms(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 E=0;E<t.length;E++)il(t[E]);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&&Wn(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+Br(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&&La(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=Ys(t,Et(r,e.scrollToPos.from),Et(r,e.scrollToPos.to),e.scrollToPos.margin);Xs(t,n)}var E=e.maybeHiddenMarkers,B=e.maybeUnhiddenMarkers;if(E)for(var K=0;K<E.length;++K)E[K].lines.length||oe(E[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 br(e,t){if(e.curOp)return t();mi(e);try{return t()}finally{gi(e)}}function $t(e,t){return function(){if(e.curOp)return t.apply(e,arguments);mi(e);try{return t.apply(e,arguments)}finally{gi(e)}}}function ur(e){return function(){if(this.curOp)return e.apply(this,arguments);mi(this);try{return e.apply(this,arguments)}finally{gi(this)}}}function er(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 hn(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=Dr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(E){if(r.line>=e.display.viewFrom){var B=E.styles,K=E.text.length>e.options.maxHighlightLength?Yt(t.mode,r.state):null,X=Ki(e,E,r,!0);K&&(r.state=K),E.styles=X.styles;var te=E.styleClasses,fe=X.classes;fe?E.styleClasses=fe:te&&(E.styleClasses=null);for(var pe=!B||B.length!=E.styles.length||te!=fe&&(!te||!fe||te.bgClass!=fe.bgClass||te.textClass!=fe.textClass),Ce=0;!pe&&Ce<B.length;++Ce)pe=B[Ce]!=E.styles[Ce];pe&&n.push(r.line),E.stateAfter=r.save(),r.nextLine()}else E.text.length<=e.options.maxHighlightLength&&Vi(e,E.text,r),E.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return hn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&br(e,function(){for(var E=0;E<n.length;E++)Xr(e,n[E],"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){ae(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=Br(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Br(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!y(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&y(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&&y(document.body,e.anchorNode)&&y(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,E=Math.max(t.visible.from-e.options.viewportMargin,r.first),B=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<E&&E-i.viewFrom<20&&(E=Math.max(r.first,i.viewFrom)),i.viewTo>B&&i.viewTo-B<20&&(B=Math.min(n,i.viewTo)),lr&&(E=qi(e.doc,E),B=Qr(e.doc,B));var K=E!=i.viewFrom||B!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,E,B),i.viewOffset=Mr(Fe(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),h(i.cursorDiv),h(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,K&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,hn(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+ha(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;Wn(e);var n=un(e);on(e),Oi(e,n),La(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)){Wn(e),To(e,i);var r=un(e);on(e),Oi(e,r),La(e,r),i.finish()}}function ul(e,t,i){var r=e.display,n=e.options.lineNumbers,E=r.lineDiv,B=E.firstChild;function K(Oe){var Ue=Oe.nextSibling;return O&&l&&e.display.currentWheelTarget==Oe?Oe.style.display="none":Oe.parentNode.removeChild(Oe),Ue}for(var X=r.view,te=r.viewFrom,fe=0;fe<X.length;fe++){var pe=X[fe];if(!pe.hidden)if(!pe.node||pe.node.parentNode!=E){var Ce=Bs(e,pe,te,i);E.insertBefore(Ce,B)}else{for(;B!=pe.node;)B=K(B);var Ee=n&&t!=null&&t<=te&&pe.lineNumber;pe.changes&&(ge(pe.changes,"gutter")>-1&&(Ee=!1),Xa(e,pe,te,i)),Ee&&(h(pe.lineNumber),pe.lineNumber.appendChild(document.createTextNode(zt(e.options,te)))),B=pe.node.nextSibling}te+=pe.size}for(;B;)B=K(B)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function La(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+Br(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,E=r+"px",B=0;B<i.length;B++)if(!i[B].hidden){e.options.fixedGutter&&(i[B].gutter&&(i[B].gutter.style.left=E),i[B].gutterBackground&&(i[B].gutterBackground.style.left=E));var K=i[B].alignable;if(K)for(var X=0;X<K.length;X++)K[X].style.left=E}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=zt(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")),E=n.firstChild.offsetWidth,B=n.offsetWidth-E;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(E,r.lineGutter.offsetWidth-B)+1,r.lineNumWidth=r.lineNumInnerWidth+B,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ra(e.display),!0}return!1}function ka(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var E=e[n],B=null;if(typeof E!="string"&&(B=E.style,E=E.className),E=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:E,style:B})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ro(e){var t=e.gutters,i=e.gutterSpecs;h(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],E=n.className,B=n.style,K=t.appendChild(a("div",null,"CodeMirror-gutter "+E));B&&(K.style.cssText=B),E=="CodeMirror-linenumbers"&&(e.lineGutter=K,K.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ra(e)}function cn(e){Ro(e.display),pr(e),wo(e)}function dl(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=g("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=g("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var E=g("div",[n.lineSpace],"CodeMirror-lines");n.mover=a("div",[E],null,"position: relative"),n.sizer=a("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=a("div",null,null,"position: absolute; height: "+be+"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"),j&&U<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!O&&!(L&&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=ka(r.gutters,r.lineNumbers),Ro(n),i.init(n)}var Kn=0,Cr=null;j?Cr=-.53:L?Cr=15:v?Cr=-.7:M&&(Cr=-1/3);function Lo(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 hl(e){var t=Lo(e);return t.x*=Cr,t.y*=Cr,t}function ko(e,t){var i=Lo(t),r=i.x,n=i.y,E=e.display,B=E.scroller,K=B.scrollWidth>B.clientWidth,X=B.scrollHeight>B.clientHeight;if(!(r&&K||n&&X))return;if(n&&l&&O){e:for(var te=t.target,fe=E.view;te!=B;te=te.parentNode)for(var pe=0;pe<fe.length;pe++)if(fe[pe].node==te){e.display.currentWheelTarget=te;break e}}if(r&&!L&&!S&&Cr!=null){n&&X&&ln(e,Math.max(0,B.scrollTop+n*Cr)),fi(e,Math.max(0,B.scrollLeft+r*Cr)),(!n||n&&X)&&ee(t),E.wheelStartX=null;return}if(n&&Cr!=null){var Ce=n*Cr,Ee=e.doc.scrollTop,Oe=Ee+E.wrapper.clientHeight;Ce<0?Ee=Math.max(0,Ee+Ce-50):Oe=Math.min(e.doc.height,Oe+Ce+50),Da(e,{top:Ee,bottom:Oe})}Kn<20&&(E.wheelStartX==null?(E.wheelStartX=B.scrollLeft,E.wheelStartY=B.scrollTop,E.wheelDX=r,E.wheelDY=n,setTimeout(function(){if(E.wheelStartX==null)return;var Ue=B.scrollLeft-E.wheelStartX,Ke=B.scrollTop-E.wheelStartY,Ye=Ke&&E.wheelDY&&Ke/E.wheelDY||Ue&&E.wheelDX&&Ue/E.wheelDX;if(E.wheelStartX=E.wheelStartY=null,!Ye)return;Cr=(Cr*Kn+Ye)/(Kn+1),++Kn},200)):(E.wheelDX+=r,E.wheelDY+=n))}var Sr=function(e,t){this.ranges=e,this.primIndex=t};Sr.prototype.primary=function(){return this.ranges[this.primIndex]},Sr.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},Sr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Bt(bi(this.ranges[t].anchor),bi(this.ranges[t].head));return new Sr(e,this.primIndex)},Sr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Sr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(vt(t,r.from())>=0&&vt(e,r.to())<=0)return i}return-1};var Bt=function(e,t){this.anchor=e,this.head=t};Bt.prototype.from=function(){return ii(this.anchor,this.head)},Bt.prototype.to=function(){return Ei(this.anchor,this.head)},Bt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Or(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(Ce,Ee){return vt(Ce.from(),Ee.from())}),i=ge(t,n);for(var E=1;E<t.length;E++){var B=t[E],K=t[E-1],X=vt(K.to(),B.from());if(r&&!B.empty()?X>0:X>=0){var te=ii(K.from(),B.from()),fe=Ei(K.to(),B.to()),pe=K.empty()?B.from()==B.head:K.from()==K.head;E<=i&&--i,t.splice(--E,2,new Bt(pe?fe:te,pe?te:fe))}}return new Sr(t,i)}function Jr(e,t){return new Sr([new Bt(e,t||e)],0)}function Zr(e){return e.text?je(e.from.line+e.text.length-1,T(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Mo(e,t){if(vt(e,t.from)<0)return e;if(vt(e,t.to)<=0)return Zr(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+=Zr(t).ch-t.to.ch),je(i,r)}function Ma(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new Bt(Mo(n.anchor,t),Mo(n.head,t)))}return Or(e.cm,i,e.sel.primIndex)}function Io(e,t,i){return e.line==t.line?je(i.line,e.ch-t.ch+i.ch):je(i.line+(e.line-t.line),e.ch)}function cl(e,t,i){for(var r=[],n=je(e.first,0),E=n,B=0;B<t.length;B++){var K=t[B],X=Io(K.from,n,E),te=Io(Zr(K),n,E);if(n=K.to,E=te,i=="around"){var fe=e.sel.ranges[B],pe=vt(fe.head,fe.anchor)<0;r[B]=new Bt(pe?te:X,pe?X:te)}else r[B]=new Bt(X,X)}return new Sr(r,e.sel.primIndex)}function Ia(e){e.doc.mode=Wt(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,hn(e,100),e.state.modeGen++,e.curOp&&pr(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(tt){return i?i[tt]:null}function E(tt,Je,it){ua(tt,Je,it,r),ir(tt,"change",tt,t)}function B(tt,Je){for(var it=[],pt=tt;pt<Je;++pt)it.push(new li(te[pt],n(pt),r));return it}var K=t.from,X=t.to,te=t.text,fe=Fe(e,K.line),pe=Fe(e,X.line),Ce=T(te),Ee=n(te.length-1),Oe=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);E(pe,pe.text,Ee),Oe&&e.remove(K.line,Oe),Ue.length&&e.insert(K.line,Ue)}else if(fe==pe)if(te.length==1)E(fe,fe.text.slice(0,K.ch)+Ce+fe.text.slice(X.ch),Ee);else{var Ke=B(1,te.length-1);Ke.push(new li(Ce+fe.text.slice(X.ch),Ee,r)),E(fe,fe.text.slice(0,K.ch)+te[0],n(0)),e.insert(K.line+1,Ke)}else if(te.length==1)E(fe,fe.text.slice(0,K.ch)+te[0]+pe.text.slice(X.ch),n(0)),e.remove(K.line+1,Oe);else{E(fe,fe.text.slice(0,K.ch)+te[0],n(0)),E(pe,Ce+pe.text.slice(X.ch),Ee);var Ye=B(1,te.length-1);Oe>1&&e.remove(K.line+1,Oe-1),e.insert(K.line+1,Ye)}ir(e,"change",e,t)}function qr(e,t,i){function r(n,E,B){if(n.linked)for(var K=0;K<n.linked.length;++K){var X=n.linked[K];if(X.doc==E)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),Ia(e),_o(e),e.options.lineWrapping||Bn(e),e.options.mode=t.modeOption,pr(e)}function _o(e){(e.doc.direction=="rtl"?G:c)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){br(e,function(){_o(e),pr(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:Zr(t),text:ft(e,t.from,t.to)};return Uo(e,i,t.from.line,t.to.line+1),qr(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 E=+new Date,B,K;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>E-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(B=pl(n,n.lastOp==r)))K=T(B.changes),vt(t.from,t.to)==0&&vt(t.from,K.to)==0?K.to=Zr(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=E,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,E=r&&r.origin;i==n.lastSelOp||E&&n.lastSelOrigin==E&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==E||ml(e,E,T(n.done),t))?n.done[n.done.length-1]=t:Qn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=E,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],E=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]={}))[E]=B.markedSpans),++E})}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 E=i[n],B=r[n];if(E&&B){e:for(var K=0;K<B.length;++K){for(var X=B[K],te=0;te<E.length;++te)if(E[te].marker==X.marker)continue e;E.push(X)}}else B&&(i[n]=B)}return i}function Pi(e,t,i){for(var r=[],n=0;n<e.length;++n){var E=e[n];if(E.ranges){r.push(i?Sr.prototype.deepCopy.call(E):E);continue}var B=E.changes,K=[];r.push({changes:K});for(var X=0;X<B.length;++X){var te=B[X],fe=void 0;if(K.push({from:te.from,to:te.to,text:te.text}),t)for(var pe in te)(fe=pe.match(/^spans_(\d+)$/))&&(ge(t,Number(fe[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 E=vt(t,n)<0;E!=vt(i,n)<0?(n=t,t=i):E!=vt(t,i)<0&&(t=i)}return new Bt(n,t)}else return new Bt(i||t,t)}function Xn(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),or(e,new Sr([_a(e.sel.primary(),t,i,n)],0),r)}function jo(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),E=0;E<e.sel.ranges.length;E++)r[E]=_a(e.sel.ranges[E],t[E],null,n);var B=Or(e.cm,r,e.sel.primIndex);or(e,B,i)}function Ba(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,or(e,Or(e.cm,n,e.sel.primIndex),r)}function Wo(e,t,i,r){or(e,Jr(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var E=0;E<n.length;E++)this.ranges[E]=new Bt(Et(e,n[E].anchor),Et(e,n[E].head))},origin:i&&i.origin};return oe(e,"beforeSelectionChange",e,r),e.cm&&oe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Or(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,Yn(e,t,i)):or(e,t,i)}function or(e,t,i){Yn(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Yn(e,t,i){(ae(e,"beforeSelectionChange")||e.cm&&ae(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(vt(t.primary().head,e.sel.primary().head)<0?-1:1);Go(e,Ko(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&Ii(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,Z(e.cm)),ir(e,"cursorActivity",e)}function zo(e){Go(e,Ko(e,e.sel,null,!1))}function Ko(e,t,i,r){for(var n,E=0;E<t.ranges.length;E++){var B=t.ranges[E],K=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[E],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,E)),n[E]=new Bt(X,te))}return n?Or(e.cm,n,t.primIndex):t}function _i(e,t,i,r,n){var E=Fe(e,t.line);if(E.markedSpans)for(var B=0;B<E.markedSpans.length;++B){var K=E.markedSpans[B],X=K.marker,te="selectLeft"in X?!X.selectLeft:X.inclusiveLeft,fe="selectRight"in X?!X.selectRight:X.inclusiveRight;if((K.from==null||(te?K.from<=t.ch:K.from<t.ch))&&(K.to==null||(fe?K.to>=t.ch:K.to>t.ch))){if(n&&(oe(X,"beforeCursorEnter"),X.explicitlyCleared))if(E.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?fe:te)&&(pe=Vo(e,pe,-r,pe&&pe.line==t.line?E:null)),pe&&pe.line==t.line&&(Ce=vt(pe,i))&&(r<0?Ce<0:Ce>0))return _i(e,pe,t,r,n)}var Ee=X.find(r<0?-1:1);return(r<0?te:fe)&&(Ee=Vo(e,Ee,r,Ee.line==t.line?E:null)),Ee?_i(e,Ee,t,r,n):null}}return t}function Jn(e,t,i,r,n){var E=r||1,B=_i(e,t,i,E,n)||!n&&_i(e,t,i,E,!0)||_i(e,t,i,-E,n)||!n&&_i(e,t,i,-E,!0);return B||(e.cantEdit=!0,je(e.first,0))}function Vo(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?Et(e,je(t.line-1)):null:i>0&&t.ch==(r||Fe(e,t.line)).text.length?t.line<e.first+e.size-1?je(t.line+1,0):null:new je(t.line,t.ch+i)}function Qo(e){e.setSelection(je(e.firstLine(),0),je(e.lastLine()),Se)}function Xo(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,E,B,K){n&&(r.from=Et(e,n)),E&&(r.to=Et(e,E)),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 $t(e.cm,Bi)(e,t,i);if(e.cm.state.suppressEdits)return}if((ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"))&&(t=Xo(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)Yo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Yo(e,t)}function Yo(e,t){if(t.text.length==1&&t.text[0]==""&&vt(t.from,t.to)==0)return;var i=Ma(e,t);No(e,t,i,e.cm?e.cm.curOp.id:NaN),pn(e,t,i,Si(e,t));var r=[];qr(e,function(n,E){!E&&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,E,B=e.sel,K=t=="undo"?n.done:n.undone,X=t=="undo"?n.undone:n.done,te=0;te<K.length&&!(E=K[te],i?E.ranges&&!E.equals(e.sel):!E.ranges);te++);if(te==K.length)return;for(n.lastOrigin=n.lastSelOrigin=null;;)if(E=K.pop(),E.ranges){if(Qn(E,X),i&&!E.equals(e.sel)){or(e,E,{clearRedo:!1});return}B=E}else if(r){K.push(E);return}else break;var fe=[];Qn(B,X),X.push({changes:fe,generation:n.generation}),n.generation=E.generation||++n.maxGeneration;for(var pe=ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"),Ce=function(Ue){var Ke=E.changes[Ue];if(Ke.origin=t,pe&&!Xo(e,Ke,!1))return K.length=0,{};fe.push(Pa(e,Ke));var Ye=Ue?Ma(e,Ke):T(K);pn(e,Ke,Ye,Fo(e,Ke)),!Ue&&e.cm&&e.cm.scrollIntoView({from:Ke.from,to:Zr(Ke)});var tt=[];qr(e,function(Je,it){!it&&ge(tt,Je.history)==-1&&($o(Je.history,Ke),tt.push(Je.history)),pn(Je,Ke,null,Fo(Je,Ke))})},Ee=E.changes.length-1;Ee>=0;--Ee){var Oe=Ce(Ee);if(Oe)return Oe.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Sr(R(e.sel.ranges,function(n){return new Bt(je(n.anchor.line+t,n.anchor.ch),je(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm){pr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Xr(e.cm,r,"gutter")}}function pn(e,t,i,r){if(e.cm&&!e.cm.curOp)return $t(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:je(e.first,0),to:je(t.to.line+n,t.to.ch),text:[T(t.text)],origin:t.origin}}var E=e.lastLine();t.to.line>E&&(t={from:t.from,to:je(E,Fe(e,E).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ft(e,t.from,t.to),i||(i=Ma(e,t)),e.cm?El(e.cm,t,r):Oa(e,t,r),Yn(e,i,Se),e.cantEdit&&Jn(e,je(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,n=e.display,E=t.from,B=t.to,K=!1,X=E.line;e.options.lineWrapping||(X=yt(xr(Fe(r,E.line))),r.iter(X,B.line+1,function(Ee){if(Ee==n.maxLine)return K=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Z(e),Oa(r,t,i,fo(e)),e.options.lineWrapping||(r.iter(X,E.line+t.text.length,function(Ee){var Oe=en(Ee);Oe>n.maxLineLength&&(n.maxLine=Ee,n.maxLineLength=Oe,n.maxLineChanged=!0,K=!1)}),K&&(e.curOp.updateMaxLine=!0)),aa(r,E.line),hn(e,400);var te=t.text.length-(B.line-E.line)-1;t.full?pr(e):E.line==B.line&&t.text.length==1&&!Oo(e.doc,t)?Xr(e,E.line,"text"):pr(e,E.line,B.line+1,te);var fe=ae(e,"changes"),pe=ae(e,"change");if(pe||fe){var Ce={from:E,to:B,text:t.text,removed:t.removed,origin:t.origin};pe&&ir(e,"change",e,Ce),fe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ce)}e.display.selForContextMenu=null}function Ni(e,t,i,r,n){var E;r||(r=i),vt(r,i)<0&&(E=[r,i],i=E[0],r=E[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 E=e[n],B=!0;if(E.ranges){E.copied||(E=e[n]=E.deepCopy(),E.copied=!0);for(var K=0;K<E.ranges.length;K++)Zo(E.ranges[K].anchor,t,i,r),Zo(E.ranges[K].head,t,i,r);continue}for(var X=0;X<E.changes.length;++X){var te=E.changes[X];if(i<te.from.line)te.from=je(te.from.line+r,te.from.ch),te.to=je(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,E=t;return typeof t=="number"?E=Fe(e,xi(e,t)):n=yt(t),n==null?null:(r(E,n)&&e.cm&&Xr(e.cm,n,i),E)}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,lt(n),ir(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 E=Math.min(t,n-e),B=r.height;if(r.removeInner(e,E),this.height-=B-r.height,n==E&&(this.children.splice(i--,1),r.parent=null),(t-=E)==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],E=n.chunkSize();if(e<=E){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-=E}},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],E=n.chunkSize();if(e<E){var B=Math.min(t,E-e);if(n.iterN(e,B,i))return!0;if((t-=B)==0)break;e=0}else e-=E}}};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=yt(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 E=nn(this);gt(i,Math.max(0,i.height-E)),e&&(br(e,function(){es(e,i,-E),Xr(e,r,"widget")}),ir(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;_r(this.doc,r)||gt(r,r.height+n),i&&br(i,function(){i.curOp.forceUpdate=!0,es(i,r,n),ir(i,"lineWidgetChanged",i,e,yt(r))})},se(yn);function es(e,t,i){Mr(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),E=e.cm;return E&&n.noHScroll&&(E.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,E&&!_r(e,B)){var X=Mr(B)<e.scrollTop;gt(B,B.height+nn(n)),X&&Ta(E,n.height),E.curOp.forceUpdate=!0}return!0}),E&&ir(E,"lineWidgetAdded",E,n,typeof t=="number"?t:yt(t)),n}var ts=0,$r=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};$r.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&mi(e),ae(this,"clear")){var i=this.find();i&&ir(this,"clear",i.from,i.to)}for(var r=null,n=null,E=0;E<this.lines.length;++E){var B=this.lines[E],K=kr(B.markedSpans,this);e&&!this.collapsed?Xr(e,yt(B),"text"):e&&(K.to!=null&&(n=yt(B)),K.from!=null&&(r=yt(B))),B.markedSpans=Zi(B.markedSpans,K),K.from==null&&this.collapsed&&!_r(this.doc,B)&&e&&gt(B,Li(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var X=0;X<this.lines.length;++X){var te=xr(this.lines[X]),fe=en(te);fe>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=fe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&pr(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&&ir(e,"markerCleared",e,this,r,n),t&&gi(e),this.parent&&this.parent.clear()},$r.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var E=this.lines[n],B=kr(E.markedSpans,this);if(B.from!=null&&(i=je(t?E:yt(E),B.from),e==-1))return i;if(B.to!=null&&(r=je(t?E:yt(E),B.to),e==1))return r}return i&&{from:i,to:r}},$r.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;br(r,function(){var n=t.line,E=yt(t.line),B=fa(r,E);if(B&&(no(B),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!_r(i.doc,n)&&i.height!=null){var K=i.height;i.height=null;var X=nn(i)-K;X&&gt(n,n.height+X)}ir(r,"markerChanged",r,e)})},$r.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)},$r.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($r);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 $t(e.cm,Ui)(e,t,i,r,n);var E=new $r(e,n),B=vt(t,i);if(r&&F(r,E,!1),B>0||B==0&&E.clearWhenEmpty!==!1)return E;if(E.replacedWith&&(E.collapsed=!0,E.widgetNode=g("span",[E.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||E.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(E.widgetNode.insertLeft=!0)),E.collapsed){if(Pn(e,t.line,t,i,E)||t.line!=i.line&&Pn(e,i.line,t,i,E))throw new Error("Inserting collapsed marker partially overlapping an existing one");oa()}E.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&&E.collapsed&&!X.options.lineWrapping&&xr(pe)==X.display.maxLine&&(te=!0),E.collapsed&&K!=t.line&&gt(pe,0),sa(pe,new ai(E,K==t.line?t.ch:null,K==i.line?i.ch:null)),++K}),E.collapsed&&e.iter(t.line,i.line+1,function(pe){_r(e,pe)&&gt(pe,0)}),E.clearOnEnter&&De(E,"beforeCursorEnter",function(){return E.clear()}),E.readOnly&&(Vr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),E.collapsed&&(E.id=++ts,E.atomic=!0),X){if(te&&(X.curOp.updateMaxLine=!0),E.collapsed)pr(X,t.line,i.line+1);else if(E.className||E.startStyle||E.endStyle||E.css||E.attributes||E.title)for(var fe=t.line;fe<=i.line;fe++)Xr(X,fe,"text");E.atomic&&zo(X.doc),ir(X,"markerAdded",X,E)}return E}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();ir(this,"clear")},bn.prototype.find=function(e,t){return this.primary.find(e,t)},se(bn);function Cl(e,t,i,r,n){r=F(r),r.shared=!1;var E=[Ui(e,t,i,r,n)],B=E[0],K=r.widgetNode;return qr(e,function(X){K&&(r.widgetNode=K.cloneNode(!0)),E.push(Ui(X,Et(X,t),Et(X,i),r,n));for(var te=0;te<X.linked.length;++te)if(X.linked[te].isParent)return;B=T(E)}),new bn(E,B)}function rs(e){return e.findMarks(je(e.first,0),e.clipPos(je(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(),E=e.clipPos(n.from),B=e.clipPos(n.to);if(vt(E,B)){var K=Ui(e,E,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],E=[n.primary.doc];qr(n.primary.doc,function(X){return E.push(X)});for(var B=0;B<n.markers.length;B++){var K=n.markers[B];ge(E,K.doc)==-1&&(K.parent=null,n.markers.splice(B--,1))}},i=0;i<e.length;i++)t(i)}var Tl=0,mr=function(e,t,i,r,n){if(!(this instanceof mr))return new mr(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 E=je(i,0);this.sel=Jr(E),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:E,to:E,text:e}),or(this,Jr(E),Se)};mr.prototype=N(vn.prototype,{constructor:mr,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=ut(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:er(function(e){var t=je(this.first,0),i=this.first+this.size-1;Bi(this,{from:t,to:je(i,Fe(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&sn(this.cm,0,0),or(this,Jr(t),Se)}),replaceRange:function(e,t,i,r){t=Et(this,t),i=i?Et(this,i):t,Ni(this,e,t,i,r)},getRange:function(e,t,i){var r=ft(this,Et(this,e),Et(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(st(this,e))return Fe(this,e)},getLineNumber:function(e){return yt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Fe(this,e)),xr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Et(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:er(function(e,t,i){Wo(this,Et(this,typeof e=="number"?je(e,t||0):e),null,i)}),setSelection:er(function(e,t,i){Wo(this,Et(this,e),Et(this,t||e),i)}),extendSelection:er(function(e,t,i){Xn(this,Et(this,e),t&&Et(this,t),i)}),extendSelections:er(function(e,t){jo(this,ze(this,e),t)}),extendSelectionsBy:er(function(e,t){var i=R(this.sel.ranges,e);jo(this,ze(this,i),t)}),setSelections:er(function(e,t,i){if(!e.length)return;for(var r=[],n=0;n<e.length;n++)r[n]=new Bt(Et(this,e[n].anchor),Et(this,e[n].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),or(this,Or(this.cm,r,t),i)}),addSelection:er(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Bt(Et(this,e),Et(this,t||e))),or(this,Or(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=ft(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=ft(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:er(function(e,t,i){for(var r=[],n=this.sel,E=0;E<n.ranges.length;E++){var B=n.ranges[E];r[E]={from:B.from(),to:B.to(),text:this.splitLines(e[E]),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&&Ii(this.cm)}),undo:er(function(){Zn(this,"undo")}),redo:er(function(){Zn(this,"redo")}),undoSelection:er(function(){Zn(this,"undo",!0)}),redoSelection:er(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),qr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done: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:er(function(e,t,i){return mn(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Ne(n)&&(r.gutterMarkers=null),!0})}),clearGutter:er(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&mn(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ne(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!st(this,e))return null;if(t=e,e=Fe(this,e),!e)return null}else if(t=yt(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:er(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:er(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",E=r[n];if(E)if(i==null)r[n]=null;else{var B=E.match(b(i));if(!B)return!1;var K=B.index+B[0].length;r[n]=E.slice(0,B.index)+(!B.index||K==E.length?"":" ")+E.slice(K)||null}else return!1;return!0})}),addLineWidget:er(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ui(this,Et(this,e),Et(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=Et(this,e),Ui(this,e,e,i,"bookmark")},findMarksAt:function(e){e=Et(this,e);var t=[],i=Fe(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=Et(this,e),t=Et(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(E){var B=E.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 E=n.text.length+r;if(E>e)return t=e,!0;e-=E,++i}),Et(this,je(i,t))},indexFromPos:function(e){e=Et(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 mr(ut(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 mr(ut(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 Ht&&(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];qr(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){qr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ot(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:er(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)})}),mr.prototype.eachLine=mr.prototype.iter;var is=0;function wl(e){var t=this;if(ns(t),J(t,e)||Gr(t.display,e))return;ee(e),j&&(is=+new Date);var i=hi(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,E=Array(n),B=0,K=function(){++B==n&&$t(t,function(){i=Et(t.doc,i);var Ee={from:i,to:i,text:t.doc.splitLines(E.filter(function(Oe){return Oe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Bi(t.doc,Ee),Ho(t.doc,Jr(Et(t.doc,i),Et(t.doc,Zr(Ee))))})()},X=function(Ee,Oe){if(t.options.allowDropFileTypes&&ge(t.options.allowDropFileTypes,Ee.type)==-1){K();return}var Ue=new FileReader;Ue.onerror=function(){return K()},Ue.onload=function(){var Ke=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ke)){K();return}E[Oe]=Ke,K()},Ue.readAsText(Ee)},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 fe=e.dataTransfer.getData("Text");if(fe){var pe;if(t.state.draggingText&&!t.state.draggingText.copy&&(pe=t.listSelections()),Yn(t.doc,Jr(i,i)),pe)for(var Ce=0;Ce<pe.length;++Ce)Ni(t.doc,"",pe[Ce].anchor,pe[Ce].head,"drag");t.replaceSelection(fe,"around","paste"),t.display.input.focus()}}catch(Ee){}}}function Dl(e,t){if(j&&(!e.state.draggingText||+new Date-is<100)){he(t);return}if(J(e,t)||Gr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!M){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 Rl(e,t){var i=hi(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)),s(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 E=0;E<i.length;E++)e(i[E])})}var os=!1;function Ll(){if(os)return;kl(),os=!0}function kl(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Ml)},100))}),De(window,"blur",function(){return as(Mi)})}function Ml(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ei={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++)ei[En+48]=ei[En+96]=String(En);for(var qn=65;qn<=90;qn++)ei[qn]=String.fromCharCode(qn);for(var xn=1;xn<=12;xn++)ei[xn+111]=ei[xn+63235]="F"+xn;var zr={};zr.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"},zr.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"},zr.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"},zr.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"]},zr.default=l?zr.macDefault:zr.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,E,B=0;B<t.length-1;B++){var K=t[B];if(/^(cmd|meta|m)$/i.test(K))E=!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),E&&(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=R(i.split(" "),Il),E=0;E<n.length;E++){var B=void 0,K=void 0;E==n.length-1?(K=n.join(" "),B=r):(K=n.slice(0,E+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 E=0;E<t.fallthrough.length;E++){var B=Fi(e,t.fallthrough[E],i,r);if(B)return B}}}function ss(e){var t=typeof e=="string"?e:ei[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),(f?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(f?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=ei[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"?zr[e]:e}function ji(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var E=t(i[n]);r.length&&vt(E.from,T(r).to)<=0;){var B=r.pop();if(vt(B.from,E.from)<0){E.from=B.from;break}}r.push(E)}br(e,function(){for(var K=r.length-1;K>=0;K--)Ni(e.doc,"",r[K].from,r[K].to,"+delete");Ii(e)})}function Na(e,t,i){var r=Pe(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 je(t.line,r,i<0?"after":"before")}function Fa(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var E=Xe(i,t.doc.direction);if(E){var B=n<0?T(E):E[0],K=n<0==(B.level==1),X=K?"after":"before",te;if(B.level>0||t.doc.direction=="rtl"){var fe=Ri(t,i);te=n<0?i.text.length-1:0;var pe=Nr(t,fe,te).top;te=We(function(Ce){return Nr(t,fe,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 je(r,te,X)}}return new je(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 E=Ge(n,i.ch,i.sticky),B=n[E];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(Ye,tt){return Na(t,Ye instanceof je?Ye.ch:Ye,tt)},X,te=function(Ye){return e.options.lineWrapping?(X=X||Ri(e,t),co(e,t,X,Ye)):{begin:0,end:t.text.length}},fe=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<=fe.end:Ce>=B.from&&Ce>=fe.begin)){var Ee=pe?"before":"after";return new je(i.line,Ce,Ee)}}var Oe=function(Ye,tt,Je){for(var it=function(jt,tr){return tr?new je(i.line,K(jt,1),"before"):new je(i.line,jt,"after")};Ye>=0&&Ye<n.length;Ye+=tt){var pt=n[Ye],dt=tt>0==(pt.level!=1),Tt=dt?Je.begin:K(Je.end,-1);if(pt.from<=Tt&&Tt<pt.to)return it(Tt,dt);if(Tt=dt?pt.from:K(pt.to,-1),Je.begin<=Tt&&Tt<Je.end)return it(Tt,dt)}},Ue=Oe(E+r,r,fe);if(Ue)return Ue;var Ke=r>0?fe.end:K(fe.begin,-1);return Ke!=null&&!(r>0&&Ke==t.text.length)&&(Ue=Oe(r>0?0:n.length-1,r,te(Ke)),Ue)?Ue:null}var Cn={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return ji(e,function(t){if(t.empty()){var i=Fe(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:je(t.head.line+1,0)}:{from:t.head,to:je(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ji(e,function(t){return{from:je(t.from().line,0),to:Et(e.doc,je(t.to().line+1,0))}})},delLineLeft:function(e){return ji(e,function(t){return{from:je(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ji(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 ji(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(je(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(je(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return hs(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")},Te)},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")},Te)},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/)?hs(e,t.head):r},Te)},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 E=i[n].from(),B=ne(e.getLine(E.line),E.ch,r);t.push(H(r-B%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return br(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var n=t[r].head,E=Fe(e.doc,n.line).text;if(E){if(n.ch==E.length&&(n=new je(n.line,n.ch-1)),n.ch>0)n=new je(n.line,n.ch+1),e.replaceRange(E.charAt(n.ch-1)+E.charAt(n.ch-2),je(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var B=Fe(e.doc,n.line-1).text;B&&(n=new je(n.line,1),e.replaceRange(E.charAt(0)+e.doc.lineSeparator()+B.charAt(B.length-1),je(n.line-1,B.length-1),n,"+transpose"))}}i.push(new Bt(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return br(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);Ii(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var i=Fe(e.doc,t),r=xr(i);return r!=i&&(t=yt(r)),Fa(!0,e,r,t,1)}function _l(e,t){var i=Fe(e.doc,t),r=_n(i);return r!=i&&(t=yt(r)),Fa(!0,e,i,t,-1)}function hs(e,t){var i=ds(e,t.line),r=Fe(e.doc,i.line),n=Xe(r,e.doc.direction);if(!n||n[0].level==0){var E=Math.max(i.ch,r.text.search(/\S/)),B=t.line==i.line&&t.ch<=E&&t.ch;return je(i.line,B?0:E,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)!=Be}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 ce;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"&&ir(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 ja=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),J(t,e))return;j&&U<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=fs(t,e);S&&(ja=r?i:null,!r&&i==88&&!Mt&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),L&&!l&&!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;G(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(c(t,"CodeMirror-crosshair"),qe(document,"keyup",i),qe(document,"mouseover",i))}De(document,"keyup",i),De(document,"mouseover",i)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),J(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Gr(t.display,e)||J(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(S&&i==ja){ja=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 jl=400,Wa=function(e,t,i){this.time=e,this.pos=t,this.button=i};Wa.prototype.compare=function(e,t,i){return this.time+jl>e&&vt(t,this.pos)==0&&i==this.button};var An,Tn;function Wl(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 Wa(i,e,t),An=null,"double"):(An=new Wa(i,e,t),Tn=null,"single")}function vs(e){var t=this,i=t.display;if(J(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Gr(i,e)){O||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Ha(t,e))return;var r=hi(t,e),n=ye(e),E=r?Wl(r,n):"single";if(window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,n,r,E,e))return;n==1?r?zl(t,r,E,e):me(e)==i.scroller&&ee(e):n==2?(r&&Xn(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 E="Click";return r=="double"?E="Double"+E:r=="triple"&&(E="Triple"+E),E=(t==1?"Left":t==2?"Middle":"Right")+E,Sn(e,ls(E,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)!=Be}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 E=u?i.shiftKey&&i.metaKey:i.altKey;n.unit=E?"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=l?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(l?i.altKey:i.ctrlKey)),n}function zl(e,t,i,r){j?setTimeout(z(vo,e),0):e.curOp.focus=P();var n=Gl(e,i,r),E=e.doc.sel,B;e.options.dragDrop&&ke&&!e.isReadOnly()&&i=="single"&&(B=E.contains(t))>-1&&(vt((B=E.ranges[B]).from(),t)<0||t.xRel>0)&&(vt(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,E=!1,B=$t(e,function(te){O&&(n.scroller.draggable=!1),e.state.draggingText=!1,qe(n.wrapper.ownerDocument,"mouseup",B),qe(n.wrapper.ownerDocument,"mousemove",K),qe(n.scroller,"dragstart",X),qe(n.scroller,"drop",B),E||(ee(te),r.addNew||Xn(e.doc,i,null,null,r.extend),O&&!M||j&&U==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),K=function(te){E=E||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},X=function(){return E=!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 Bt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Bt(je(t.line,0),Et(e.doc,je(t.line+1,0)));var r=i(e,t);return new Bt(r.from,r.to)}function Vl(e,t,i,r){var n=e.display,E=e.doc;ee(t);var B,K,X=E.sel,te=X.ranges;if(r.addNew&&!r.extend?(K=E.sel.contains(i),K>-1?B=te[K]:B=new Bt(i,i)):(B=E.sel.primary(),K=E.sel.primIndex),r.unit=="rectangle")r.addNew||(B=new Bt(i,i)),i=hi(e,t,!0,!0),K=-1;else{var fe=ys(e,i,r.unit);r.extend?B=_a(B,fe.anchor,fe.head,r.extend):B=fe}r.addNew?K==-1?(K=te.length,or(E,Or(e,te.concat([B]),K),{scroll:!1,origin:"*mouse"})):te.length>1&&te[K].empty()&&r.unit=="char"&&!r.extend?(or(E,Or(e,te.slice(0,K).concat(te.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),X=E.sel):Ba(E,K,B,Le):(K=0,or(E,new Sr([B],0),Le),X=E.sel);var pe=i;function Ce(Je){if(vt(pe,Je)==0)return;if(pe=Je,r.unit=="rectangle"){for(var it=[],pt=e.options.tabSize,dt=ne(Fe(E,i.line).text,i.ch,pt),Tt=ne(Fe(E,Je.line).text,Je.ch,pt),jt=Math.min(dt,Tt),tr=Math.max(dt,Tt),Gt=Math.min(i.line,Je.line),Er=Math.min(e.lastLine(),Math.max(i.line,Je.line));Gt<=Er;Gt++){var gr=Fe(E,Gt).text,Qt=we(gr,jt,pt);jt==tr?it.push(new Bt(je(Gt,Qt),je(Gt,Qt))):gr.length>Qt&&it.push(new Bt(je(Gt,Qt),je(Gt,we(gr,tr,pt))))}it.length||it.push(new Bt(i,i)),or(E,Or(e,X.ranges.slice(0,K).concat(it),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Je)}else{var vr=B,nr=ys(e,Je,r.unit),Zt=vr.anchor,Xt;vt(nr.anchor,Zt)>0?(Xt=nr.head,Zt=ii(vr.from(),nr.anchor)):(Xt=nr.anchor,Zt=Ei(vr.to(),nr.head));var Kt=X.ranges.slice(0);Kt[K]=Ql(e,new Bt(Et(E,Zt),Xt)),or(E,Or(e,Kt,K),Le)}}var Ee=n.wrapper.getBoundingClientRect(),Oe=0;function Ue(Je){var it=++Oe,pt=hi(e,Je,!0,r.unit=="rectangle");if(!pt)return;if(vt(pt,pe)!=0){e.curOp.focus=P(),Ce(pt);var dt=Hn(n,E);(pt.line>=dt.to||pt.line<dt.from)&&setTimeout($t(e,function(){Oe==it&&Ue(Je)}),150)}else{var Tt=Je.clientY<Ee.top?-20:Je.clientY>Ee.bottom?20:0;Tt&&setTimeout($t(e,function(){if(Oe!=it)return;n.scroller.scrollTop+=Tt,Ue(Je)}),50)}}function Ke(Je){e.state.selectingText=!1,Oe=Infinity,Je&&(ee(Je),n.input.focus()),qe(n.wrapper.ownerDocument,"mousemove",Ye),qe(n.wrapper.ownerDocument,"mouseup",tt),E.history.lastSelOrigin=null}var Ye=$t(e,function(Je){Je.buttons===0||!ye(Je)?Ke(Je):Ue(Je)}),tt=$t(e,Ke);e.state.selectingText=tt,De(n.wrapper.ownerDocument,"mousemove",Ye),De(n.wrapper.ownerDocument,"mouseup",tt)}function Ql(e,t){var i=t.anchor,r=t.head,n=Fe(e.doc,i.line);if(vt(i,r)==0&&i.sticky==r.sticky)return t;var E=Xe(n);if(!E)return t;var B=Ge(E,i.ch,i.sticky),K=E[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==E.length)return t;var te;if(r.line!=i.line)te=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var fe=Ge(E,r.ch,r.sticky),pe=fe-B||(r.ch-i.ch)*(K.level==1?-1:1);fe==X-1||fe==X?te=pe<0:te=pe>0}var Ce=E[X+(te?-1:0)],Ee=te==(Ce.level==1),Oe=Ee?Ce.from:Ce.to,Ue=Ee?"after":"before";return i.ch==Oe&&i.sticky==Ue?t:new Bt(new je(i.line,Oe,Ue),r)}function bs(e,t,i,r){var n,E;if(t.touches)n=t.touches[0].clientX,E=t.touches[0].clientY;else try{n=t.clientX,E=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(E>K.bottom||!ae(e,i))return le(t);E-=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 fe=wt(e.doc,E),pe=e.display.gutterSpecs[X];return oe(e,i,e,fe,pe.className,t),le(t)}}}function Ha(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(Gr(e.display,t)||Xl(e,t))return;if(J(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return ae(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 Wi={toString:function(){return"CodeMirror.Init"}},Cs={},ta={};function Yl(e){var t=e.optionHandlers;function i(r,n,E,B){e.defaults[r]=n,E&&(t[r]=B?function(K,X,te){te!=Wi&&E(K,X,te)}:E)}e.defineOption=i,e.Init=Wi,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Ia(r)},!0),i("indentUnit",2,Ia,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){fn(r),an(r),pr(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!n)return;var E=[],B=r.doc.first;r.doc.iter(function(X){for(var te=0;;){var fe=X.text.indexOf(n,te);if(fe==-1)break;te=fe+n.length,E.push(je(B,fe))}B++});for(var K=E.length-1;K>=0;K--)Ni(r.doc,n,E[K],je(E[K].line,E[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,E){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),E!=Wi&&r.refresh()}),i("specialCharPlaceholder",Ft,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",!x),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){xs(r),cn(r)},!0),i("keyMap","default",function(r,n,E){var B=$n(n),K=E!=Wi&&$n(E);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=ka(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=ka(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"&&(Mi(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!=Wi;if(!t!=!r){var n=e.display.dragFunctions,E=t?De:qe;E(e.display.scroller,"dragstart",n.start),E(e.display.scroller,"dragenter",n.enter),E(e.display.scroller,"dragover",n.over),E(e.display.scroller,"dragleave",n.leave),E(e.display.scroller,"drop",n.drop)}}function Zl(e){e.options.lineWrapping?(G(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(c(e.display.wrapper,"CodeMirror-wrap"),Bn(e)),xa(e),pr(e),an(e),setTimeout(function(){return Oi(e)},100)}function Ht(e,t){var i=this;if(!(this instanceof Ht))return new Ht(e,t);this.options=t=t?F(t):{},F(Cs,t,!1);var r=t.value;typeof r=="string"?r=new mr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ht.inputStyles[t.inputStyle](this),E=this.display=new dl(e,r,n,t);E.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 ce,keySeq:null,specialChars:null},t.autofocus&&!o&&E.input.focus(),j&&U<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Ll(),mi(this),this.curOp.forceUpdate=!0,Po(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Sa(i)},20):Mi(this);for(var B in ta)ta.hasOwnProperty(B)&&ta[B](this,t[B],Wi);Do(this),t.finishInit&&t.finishInit(this);for(var K=0;K<Ga.length;++K)Ga[K](this);gi(this),O&&t.lineWrapping&&getComputedStyle(E.lineDiv).textRendering=="optimizelegibility"&&(E.lineDiv.style.textRendering="auto")}Ht.defaults=Cs,Ht.optionHandlers=ta;function ql(e){var t=e.display;De(t.scroller,"mousedown",$t(e,vs)),j&&U<11?De(t.scroller,"dblclick",$t(e,function(X){if(J(e,X))return;var te=hi(e,X);if(!te||Ha(e,X)||Gr(e.display,X))return;ee(X);var fe=e.findWordAt(te);Xn(e.doc,fe.anchor,fe.head)})):De(t.scroller,"dblclick",function(X){return J(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 E(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 fe=te.left-X.left,pe=te.top-X.top;return fe*fe+pe*pe>20*20}De(t.scroller,"touchstart",function(X){if(!J(e,X)&&!E(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&&!Gr(t,X)&&te.left!=null&&!te.moved&&new Date-te.start<300){var fe=e.coordsChar(t.activeTouch,"page"),pe;!te.prev||B(te,te.prev)?pe=new Bt(fe,fe):!te.prev.prev||B(te,te.prev.prev)?pe=e.findWordAt(fe):pe=new Bt(je(fe.line,0),Et(e.doc,je(fe.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 ko(e,X)}),De(t.scroller,"DOMMouseScroll",function(X){return ko(e,X)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){J(e,X)||he(X)},over:function(X){J(e,X)||(Rl(e,X),he(X))},start:function(X){return Dl(e,X)},drop:$t(e,wl),leave:function(X){J(e,X)||ns(e)}};var K=t.input.getField();De(K,"keyup",function(X){return ms.call(e,X)}),De(K,"keydown",$t(e,ps)),De(K,"keypress",$t(e,gs)),De(K,"focus",function(X){return Sa(e,X)}),De(K,"blur",function(X){return Mi(e,X)})}var Ga=[];Ht.defineInitHook=function(e){return Ga.push(e)};function wn(e,t,i,r){var n=e.doc,E;i==null&&(i="add"),i=="smart"&&(n.mode.indent?E=Dr(e,t).state:i="prev");var B=e.options.tabSize,K=Fe(n,t),X=ne(K.text,null,B);K.stateAfter&&(K.stateAfter=null);var te=K.text.match(/^\s*/)[0],fe;if(!r&&!/\S/.test(K.text))fe=0,i="not";else if(i=="smart"&&(fe=n.mode.indent(E,K.text.slice(te.length),K.text),fe==Be||fe>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?fe=ne(Fe(n,t-1).text,null,B):fe=0:i=="add"?fe=X+e.options.indentUnit:i=="subtract"?fe=X-e.options.indentUnit:typeof i=="number"&&(fe=X+i),fe=Math.max(0,fe);var pe="",Ce=0;if(e.options.indentWithTabs)for(var Ee=Math.floor(fe/B);Ee;--Ee)Ce+=B,pe+=" ";if(Ce<fe&&(pe+=H(fe-Ce)),pe!=te)return Ni(n,pe,je(t,0),je(t,te.length),"+input"),K.stateAfter=null,!0;for(var Oe=0;Oe<n.sel.ranges.length;Oe++){var Ue=n.sel.ranges[Oe];if(Ue.head.line==t&&Ue.head.ch<te.length){var Ke=je(t,te.length);Ba(n,Oe,new Bt(Ke,Ke));break}}}var Pr=null;function ra(e){Pr=e}function za(e,t,i,r,n){var E=e.doc;e.display.shift=!1,r||(r=E.sel);var B=+new Date-200,K=n=="paste"||e.state.pasteIncoming>B,X=ot(t),te=null;if(K&&r.ranges.length>1)if(Pr&&Pr.text.join(`
`)==t){if(r.ranges.length%Pr.text.length==0){te=[];for(var fe=0;fe<Pr.text.length;fe++)te.push(E.splitLines(Pr.text[fe]))}}else X.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(te=R(X,function(Ye){return[Ye]}));for(var pe=e.curOp.updateInput,Ce=r.ranges.length-1;Ce>=0;Ce--){var Ee=r.ranges[Ce],Oe=Ee.from(),Ue=Ee.to();Ee.empty()&&(i&&i>0?Oe=je(Oe.line,Oe.ch-i):e.state.overwrite&&!K?Ue=je(Ue.line,Math.min(Fe(E,Ue.line).text.length,Ue.ch+T(X).length)):K&&Pr&&Pr.lineWise&&Pr.text.join(`
`)==X.join(`
`)&&(Oe=Ue=je(Oe.line,0)));var Ke={from:Oe,to:Ue,text:te?te[Ce%te.length]:X,origin:n||(K?"paste":e.state.cutIncoming>B?"cut":"+input")};Bi(e.doc,Ke),ir(e,"inputRead",e,Ke)}t&&!K&&As(e,t),Ii(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&&br(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 E=e.getModeAt(n.head),B=!1;if(E.electricChars){for(var K=0;K<E.electricChars.length;K++)if(t.indexOf(E.electricChars.charAt(K))>-1){B=wn(e,n.head.line,"smart");break}}else E.electricInput&&(E.electricInput.test(Fe(e.doc,n.head.line).text.slice(0,n.head.ch))&&(B=wn(e,n.head.line,"smart")));B&&ir(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,E={anchor:je(n,0),head:je(n+1,0)};i.push(E),t.push(e.getRange(E.anchor,E.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 E=this.options,B=E[r];if(E[r]==n&&r!="mode")return;E[r]=n,t.hasOwnProperty(r)&&$t(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,E=0;E<n.length;++E)if(n[E]==r||n[E].name==r)return n.splice(E,1),!0},addOverlay:ur(function(r,n){var E=r.token?r:e.getMode(this.options,r);if(E.startState)throw new Error("Overlays may not be stateful.");W(this.state.overlays,{mode:E,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(B){return B.priority}),this.state.modeGen++,pr(this)}),removeOverlay:ur(function(r){for(var n=this.state.overlays,E=0;E<n.length;++E){var B=n[E].modeSpec;if(B==r||typeof r=="string"&&B.name==r){n.splice(E,1),this.state.modeGen++,pr(this);return}}}),indentLine:ur(function(r,n,E){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),st(this.doc,r)&&wn(this,r,n,E)}),indentSelection:ur(function(r){for(var n=this.doc.sel.ranges,E=-1,B=0;B<n.length;B++){var K=n[B];if(K.empty())K.head.line>E&&(wn(this,K.head.line,r,!0),E=K.head.line,B==this.doc.sel.primIndex&&Ii(this));else{var X=K.from(),te=K.to(),fe=Math.max(E,X.line);E=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var pe=fe;pe<E;++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 Bt(X,Ce[B].to()),Se)}}}),getTokenAt:function(r,n){return Rn(this,r,n)},getLineTokens:function(r,n){return Rn(this,je(r),n,!0)},getTokenTypeAt:function(r){r=Et(this.doc,r);var n=ni(this,Fe(this.doc,r.line)),E=0,B=(n.length-1)/2,K=r.ch,X;if(K==0)X=n[2];else for(;;){var te=E+B>>1;if((te?n[te*2-1]:0)>=K)B=te;else if(n[te*2+1]<K)E=te+1;else{X=n[te*2+2];break}}var fe=X?X.indexOf("overlay "):-1;return fe<0?X:fe==0?null:X.slice(0,fe-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 E=[];if(!i.hasOwnProperty(n))return E;var B=i[n],K=this.getModeAt(r);if(typeof K[n]=="string")B[K[n]]&&E.push(B[K[n]]);else if(K[n])for(var X=0;X<K[n].length;X++){var te=B[K[n][X]];te&&E.push(te)}else K.helperType&&B[K.helperType]?E.push(B[K.helperType]):B[K.name]&&E.push(B[K.name]);for(var fe=0;fe<B._global.length;fe++){var pe=B._global[fe];pe.pred(K,this)&&ge(E,pe.val)==-1&&E.push(pe.val)}return E},getStateAfter:function(r,n){var E=this.doc;return r=xi(E,r==null?E.first+E.size-1:r),Dr(this,r+1,n).state},cursorCoords:function(r,n){var E,B=this.doc.sel.primary();return r==null?E=B.head:typeof r=="object"?E=Et(this.doc,r):E=r?B.from():B.to(),Ir(this,E,n||"page")},charCoords:function(r,n){return ma(this,Et(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,E){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=Fe(this.doc,r)}else K=r;return Un(this,K,{top:0,left:0},n||"page",E||B).top+(B?this.doc.height-Mr(K):0)},defaultTextHeight:function(){return Li(this.display)},defaultCharWidth:function(){return ki(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,E,B,K){var X=this.display;r=Ir(this,Et(this.doc,r));var te=r.bottom,fe=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),fe+n.offsetWidth>Ce&&(fe=Ce-n.offsetWidth)}n.style.top=te+"px",n.style.left=n.style.right="",K=="right"?(fe=X.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(K=="left"?fe=0:K=="middle"&&(fe=(X.sizer.clientWidth-n.offsetWidth)/2),n.style.left=fe+"px"),E&&Js(this,{left:fe,top:te,right:fe+n.offsetWidth,bottom:te+n.offsetHeight})},triggerOnKeyDown:ur(ps),triggerOnKeyPress:ur(gs),triggerOnKeyUp:ms,triggerOnMouseDown:ur(vs),execCommand:function(r){if(Cn.hasOwnProperty(r))return Cn[r].call(null,this)},triggerElectric:ur(function(r){As(this,r)}),findPosH:function(r,n,E,B){var K=1;n<0&&(K=-1,n=-n);for(var X=Et(this.doc,r),te=0;te<n&&!(X=Ka(this.doc,X,K,E,B),X.hitSide);++te);return X},moveH:ur(function(r,n){var E=this;this.extendSelectionsBy(function(B){return E.display.shift||E.doc.extend||B.empty()?Ka(E.doc,B.head,r,n,E.options.rtlMoveVisually):r<0?B.from():B.to()},Te)}),deleteH:ur(function(r,n){var E=this.doc.sel,B=this.doc;E.somethingSelected()?B.replaceSelection("",null,"+delete"):ji(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,E,B){var K=1,X=B;n<0&&(K=-1,n=-n);for(var te=Et(this.doc,r),fe=0;fe<n;++fe){var pe=Ir(this,te,"div");if(X==null?X=pe.left:pe.left=X,te=Rs(this,pe,K,E),te.hitSide)break}return te},moveV:ur(function(r,n){var E=this,B=this.doc,K=[],X=!this.display.shift&&!B.extend&&B.sel.somethingSelected();if(B.extendSelectionsBy(function(fe){if(X)return r<0?fe.from():fe.to();var pe=Ir(E,fe.head,"div");fe.goalColumn!=null&&(pe.left=fe.goalColumn),K.push(pe.left);var Ce=Rs(E,pe,r,n);return n=="page"&&fe==B.sel.primary()&&Ta(E,ma(E,Ce,"div").top-pe.top),Ce},Te),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,E=Fe(n,r.line).text,B=r.ch,K=r.ch;if(E){var X=this.getHelper(r,"wordChars");(r.sticky=="before"||K==E.length)&&B?--B:++K;for(var te=E.charAt(B),fe=Ae(te,X)?function(pe){return Ae(pe,X)}:/\s/.test(te)?function(pe){return/\s/.test(pe)}:function(pe){return!/\s/.test(pe)&&!Ae(pe)};B>0&&fe(E.charAt(B-1));)--B;for(;K<E.length&&fe(E.charAt(K));)++K}return new Bt(je(r.line,B),je(r.line,K))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?G(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:ur(function(r,n){sn(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Br(this)-this.display.barHeight,width:r.scrollWidth-Br(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:ui(this)}},scrollIntoView:ur(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:je(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:ur(function(r,n){var E=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){Xr(E,K,"widget");break}}++K}),this.curOp.forceUpdate=!0,oe(this,"refresh",this)}),operation:function(r){return br(this,r)},startOperation:function(){return mi(this)},endOperation:function(){return gi(this)},refresh:ur(function(){var r=this.display.cachedTextHeight;pr(this),this.curOp.forceUpdate=!0,an(this),sn(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(r==null||Math.abs(r-Li(this.display))>.5||this.options.lineWrapping)&&xa(this),oe(this,"refresh",this)}),swapDoc:ur(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,ir(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,E){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=E},e.registerGlobalHelper=function(r,n,E,B){e.registerHelper(r,n,B),i[r]._global.push({pred:E,val:B})}}function Ka(e,t,i,r,n){var E=t,B=i,K=Fe(e,t.line),X=n&&e.direction=="rtl"?-i:i;function te(){var tt=t.line+X;return tt<e.first||tt>=e.first+e.size?!1:(t=new je(tt,t.ch,t.sticky),K=Fe(e,tt))}function fe(tt){var Je;if(r=="codepoint"){var it=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(it)?Je=null:Je=new je(t.line,Math.max(0,Math.min(K.text.length,t.ch+i*(it>=55296&&it<56320?2:1))),-i)}else n?Je=Pl(e.cm,K,t,i):Je=Ua(K,t,i);if(Je==null)if(!tt&&te())t=Fa(n,e.cm,K,t.line,X);else return!1;else t=Je;return!0}if(r=="char"||r=="codepoint")fe();else if(r=="column")fe(!0);else if(r=="word"||r=="group")for(var pe=null,Ce=r=="group",Ee=e.cm&&e.cm.getHelper(t,"wordChars"),Oe=!0;!(i<0&&!fe(!Oe));Oe=!1){var Ue=K.text.charAt(t.ch)||`
`,Ke=Ae(Ue,Ee)?"w":Ce&&Ue==`
`?"n":!Ce||/\s/.test(Ue)?null:"p";if(Ce&&!Oe&&!Ke&&(Ke="s"),pe&&pe!=Ke){i<0&&(i=1,fe(),t.sticky="after");break}if(Ke&&(pe=Ke),i>0&&!fe(!Oe))break}var Ye=Jn(e,t,E,B,!0);return ri(E,Ye)&&(Ye.hitSide=!0),Ye}function Rs(e,t,i,r){var n=e.doc,E=t.left,B;if(r=="page"){var K=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(K-.5*Li(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,E,B),!te.outside);){if(i<0?B<=0:B>=n.height){te.hitSide=!0;break}B+=i*5}return te}var Nt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ce,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Nt.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 E(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(!E(K)||J(r,K)||Ss(K,r))return;U<=11&&setTimeout($t(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(!E(K)||J(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=Pr.text.join(`
`);if(K.clipboardData.setData("Text",te),K.clipboardData.getData("Text")==te){K.preventDefault();return}}var fe=Ds(),pe=fe.firstChild;r.display.lineSpace.insertBefore(fe,r.display.lineSpace.firstChild),pe.value=Pr.text.join(`
`);var Ce=document.activeElement;re(pe),setTimeout(function(){r.display.lineSpace.removeChild(fe),Ce.focus(),Ce==n&&i.showPrimarySelection()},50)}De(n,"copy",B),De(n,"cut",B)},Nt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Nt.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Nt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Nt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Nt.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 E=ia(t,e.anchorNode,e.anchorOffset),B=ia(t,e.focusNode,e.focusOffset);if(E&&!E.bad&&B&&!B.bad&&vt(ii(E,B),r)==0&&vt(Ei(E,B),n)==0)return;var K=t.display.view,X=r.line>=t.display.viewFrom&&Ls(t,r)||{node:K[0].measure.map[2],offset:0},te=n.line<t.display.viewTo&&Ls(t,n);if(!te){var fe=K[K.length-1].measure,pe=fe.maps?fe.maps[fe.maps.length-1]:fe.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),Ee;try{Ee=p(X.node,X.offset,te.offset,te.node)}catch(Oe){}Ee&&(!L&&t.state.focused?(e.collapse(X.node,X.offset),Ee.collapsed||(e.removeAllRanges(),e.addRange(Ee))):(e.removeAllRanges(),e.addRange(Ee)),Ce&&e.anchorNode==null?e.addRange(Ce):L&&this.startGracePeriod()),this.rememberSelection()},Nt.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)},Nt.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},Nt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Nt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},Nt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Nt.prototype.blur=function(){this.div.blur()},Nt.prototype.getField=function(){return this.div},Nt.prototype.supportsTouch=function(){return!0},Nt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():br(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)},Nt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Nt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(d&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=ia(t,e.anchorNode,e.anchorOffset),r=ia(t,e.focusNode,e.focusOffset);i&&r&&br(t,function(){or(t.doc,Jr(i,r),Se),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Nt.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=je(r.line-1,Fe(e.doc,r.line-1).length)),n.ch==Fe(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=je(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var E,B,K;r.line==t.viewFrom||(E=ci(e,r.line))==0?(B=yt(t.view[0].line),K=t.view[0].node):(B=yt(t.view[E].line),K=t.view[E-1].node.nextSibling);var X=ci(e,n.line),te,fe;if(X==t.view.length-1?(te=t.viewTo-1,fe=t.lineDiv.lastChild):(te=yt(t.view[X+1].line)-1,fe=t.view[X+1].node.previousSibling),!K)return!1;for(var pe=e.doc.splitLines(tu(e,K,fe,B,te)),Ce=ft(e.doc,je(B,0),je(te,Fe(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 Ee=0,Oe=0,Ue=pe[0],Ke=Ce[0],Ye=Math.min(Ue.length,Ke.length);Ee<Ye&&Ue.charCodeAt(Ee)==Ke.charCodeAt(Ee);)++Ee;for(var tt=T(pe),Je=T(Ce),it=Math.min(tt.length-(pe.length==1?Ee:0),Je.length-(Ce.length==1?Ee:0));Oe<it&&tt.charCodeAt(tt.length-Oe-1)==Je.charCodeAt(Je.length-Oe-1);)++Oe;if(pe.length==1&&Ce.length==1&&B==r.line)for(;Ee&&Ee>r.ch&&tt.charCodeAt(tt.length-Oe-1)==Je.charCodeAt(Je.length-Oe-1);)Ee--,Oe++;pe[pe.length-1]=tt.slice(0,tt.length-Oe).replace(/^\u200b+/,""),pe[0]=pe[0].slice(Ee).replace(/\u200b+$/,"");var pt=je(B,Ee),dt=je(te,Ce.length?T(Ce).length-Oe:0);if(pe.length>1||pe[0]||vt(pt,dt))return Ni(e.doc,pe,pt,dt,"+input"),!0},Nt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Nt.prototype.reset=function(){this.forceCompositionEnd()},Nt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Nt.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)},Nt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&br(this.cm,function(){return pr(e.cm)})},Nt.prototype.setUneditable=function(e){e.contentEditable="false"},Nt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||$t(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Nt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Nt.prototype.onContextMenu=function(){},Nt.prototype.resetPosition=function(){},Nt.prototype.needsContentAttribute=!0;function Ls(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=Fe(e.doc,t.line),n=eo(i,r,t.line),E=Xe(r,e.doc.direction),B="left";if(E){var K=Ge(E,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 E="",B=!1,K=e.doc.lineSeparator(),X=!1;function te(Ee){return function(Oe){return Oe.id==Ee}}function fe(){B&&(E+=K,X&&(E+=K),B=X=!1)}function pe(Ee){Ee&&(fe(),E+=Ee)}function Ce(Ee){if(Ee.nodeType==1){var Oe=Ee.getAttribute("cm-text");if(Oe){pe(Oe);return}var Ue=Ee.getAttribute("cm-marker"),Ke;if(Ue){var Ye=e.findMarks(je(r,0),je(n+1,0),te(+Ue));Ye.length&&(Ke=Ye[0].find(0))&&pe(ft(e.doc,Ke.from,Ke.to).join(K));return}if(Ee.getAttribute("contenteditable")=="false")return;var tt=/^(pre|div|p|li|table|br)$/i.test(Ee.nodeName);if(!/^br$/i.test(Ee.nodeName)&&Ee.textContent.length==0)return;tt&&fe();for(var Je=0;Je<Ee.childNodes.length;Je++)Ce(Ee.childNodes[Je]);/^(pre|p)$/i.test(Ee.nodeName)&&(X=!0),tt&&(B=!0)}else Ee.nodeType==3&&pe(Ee.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ce(t),t==i);)t=t.nextSibling,X=!1;return E}function ia(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Hi(e.clipPos(je(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 E=e.display.view[n];if(E.node==r)return ru(E,t,i)}}function ru(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!y(r,t))return Hi(je(yt(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var E=e.rest?T(e.rest):e.line;return Hi(je(yt(E),E.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 fe(Ke,Ye,tt){for(var Je=-1;Je<(te?te.length:0);Je++)for(var it=Je<0?X.map:te[Je],pt=0;pt<it.length;pt+=3){var dt=it[pt+2];if(dt==Ke||dt==Ye){var Tt=yt(Je<0?e.line:e.rest[Je]),jt=it[pt]+tt;return(tt<0||dt!=Ke)&&(jt=it[pt+(tt?1:0)]),je(Tt,jt)}}}var pe=fe(B,K,i);if(pe)return Hi(pe,n);for(var Ce=K.nextSibling,Ee=B?B.nodeValue.length-i:0;Ce;Ce=Ce.nextSibling){if(pe=fe(Ce,Ce.firstChild,0),pe)return Hi(je(pe.line,pe.ch-Ee),n);Ee+=Ce.textContent.length}for(var Oe=K.previousSibling,Ue=i;Oe;Oe=Oe.previousSibling){if(pe=fe(Oe,Oe.firstChild,-1),pe)return Hi(je(pe.line,pe.ch+Ue),n);Ue+=Oe.textContent.length}}var Vt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ce,this.hasSelection=!1,this.composing=null};Vt.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(){j&&U>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),De(n,"paste",function(B){if(J(r,B)||Ss(B,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function E(B){if(J(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",E),De(n,"copy",E),De(e.scroller,"paste",function(B){if(Gr(e,B)||J(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){Gr(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)})},Vt.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},Vt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Vt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var n=Ir(e,i.sel.primary().head,"div"),E=t.wrapper.getBoundingClientRect(),B=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+B.top-E.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+B.left-E.left))}return r},Vt.prototype.showSelection=function(e){var t=this.cm,i=t.display;s(i.cursorDiv,e.cursors),s(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vt.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),j&&U>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",j&&U>=9&&(this.hasSelection=null))},Vt.prototype.getField=function(){return this.textarea},Vt.prototype.supportsTouch=function(){return!1},Vt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vt.prototype.blur=function(){this.textarea.blur()},Vt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vt.prototype.receivedFocus=function(){this.slowPoll()},Vt.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()})},Vt.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)},Vt.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(j&&U>=9&&this.hasSelection===n||l&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var E=n.charCodeAt(0);if(E==8203&&!r&&(r="\u200B"),E==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 br(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},Vt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vt.prototype.onKeyPress=function(){j&&U>=9&&(this.hasSelection=null),this.fastPoll()},Vt.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var E=hi(i,e),B=r.scroller.scrollTop;if(!E||S)return;var K=i.options.resetSelectionOnContextMenu;K&&i.doc.sel.contains(E)==-1&&$t(i,or)(i.doc,Jr(E),Se);var X=n.style.cssText,te=t.wrapper.style.cssText,fe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-fe.top-5)+"px; left: "+(e.clientX-fe.left-5)+`px;
z-index: 1000; background: `+(j?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var pe;O&&(pe=window.scrollY),r.input.focus(),O&&window.scrollTo(null,pe),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=Ee,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function Ce(){if(n.selectionStart!=null){var Ue=i.somethingSelected(),Ke="\u200B"+(Ue?n.value:"");n.value="\u21DA",n.value=Ke,t.prevInput=Ue?"":"\u200B",n.selectionStart=1,n.selectionEnd=Ke.length,r.selForContextMenu=i.doc.sel}}function Ee(){if(t.contextMenuPending!=Ee)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,n.style.cssText=X,j&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=B),n.selectionStart!=null){(!j||j&&U<9)&&Ce();var Ue=0,Ke=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?$t(i,Qo)(i):Ue++<10?r.detectingSelectAll=setTimeout(Ke,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ke,200)}}if(j&&U>=9&&Ce(),D){he(e);var Oe=function(){qe(window,"mouseup",Oe),setTimeout(Ee,20)};De(window,"mouseup",Oe)}else setTimeout(Ee,50)},Vt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Vt.prototype.setUneditable=function(){},Vt.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?F(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 E=e.form;n=E.submit;try{var B=E.submit=function(){r(),E.submit=n,E.submit(),E.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&&(qe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var K=Ht(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return K}function nu(e){e.off=qe,e.on=De,e.wheelEventPixels=hl,e.Doc=mr,e.splitLines=ot,e.countColumn=ne,e.findColumn=we,e.isWordChar=xe,e.Pass=Be,e.signal=oe,e.Line=li,e.changeEnd=Zr,e.scrollbarModel=So,e.Pos=je,e.cmpPos=vt,e.modes=Ct,e.mimeModes=ht,e.resolveMode=Rt,e.getMode=Wt,e.modeExtensions=qt,e.extendMode=hr,e.copyState=Yt,e.startState=Ut,e.innerMode=wr,e.commands=Cn,e.keyMap=zr,e.keyName=us,e.isModifierKey=ss,e.lookupKey=Fi,e.normalizeKeyMap=Ol,e.StringStream=mt,e.SharedTextMarker=bn,e.TextMarker=$r,e.LineWidget=yn,e.e_preventDefault=ee,e.e_stopPropagation=ie,e.e_stop=he,e.addClass=G,e.contains=y,e.rmClass=c,e.keyNames=ei}Yl(Ht),$l(Ht);var au="iter insert remove copy getEditor constructor".split(" ");for(var na in mr.prototype)mr.prototype.hasOwnProperty(na)&&ge(au,na)<0&&(Ht.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(mr.prototype[na]));return se(mr),Ht.inputStyles={textarea:Vt,contenteditable:Nt},Ht.defineMode=function(e){!Ht.defaults.mode&&e!="null"&&(Ht.defaults.mode=e),At.apply(this,arguments)},Ht.defineMIME=Ot,Ht.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ht.defineMIME("text/plain","null"),Ht.defineExtension=function(e,t){Ht.prototype[e]=t},Ht.defineDocExtension=function(e,t){mr.prototype[e]=t},Ht.fromTextArea=iu,nu(Ht),Ht.version="5.58.2",Ht})},W6BS:function(_e,Ie){_e.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+VACLE7dbMiWLE2CFADLgqig6SakCSs4jizcvAvBHMVkqxxhKkePqAs8S1mxyLUxqw6AYKLdtbMtGINpiKKUM07bc96dk9BUBykIFoNYVC/JewMkCDDh18p0so6w+GzfT+FoWC7Yl11curQpFVCoyJQsvDThP6crNdVldi0KLcwogyzJGssVrxYWXAOWzwWg84eXd92UByoK0WHEJqBCA4oC6ChstYHRJIW6lZHWQlsoYQH6rypyOLZ5Xuahx3NIi1TAvLBIcHIlUw8rfcWFLFmzhmPBUxi0NKIRdAVi5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b7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(_e,Ie,q){_e.exports=q.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(_e,Ie,q){"use strict";q.r(Ie),q.d(Ie,"ResizableTextArea",function(){return ge});var ue=q("wx14"),Y=q("1OyB"),L=q("vuIU"),V=q("Ji7U"),_=q("LK+K"),k=q("q1tI"),j=q("VTBJ"),U=q("rePB"),O=q("Zm9Q"),I=q("Kwbf"),v=q("c+Xe"),S=q("m+aA"),M=q("bdgK"),w=new Map;function A(Se){Se.forEach(function(Le){var Te,we=Le.target;(Te=w.get(we))===null||Te===void 0||Te.forEach(function(ve){return ve(we)})})}var C=new M.default(A),d=null,o=null;function l(Se,Le){w.has(Se)||(w.set(Se,new Set),C.observe(Se)),w.get(Se).add(Le)}function u(Se,Le){w.has(Se)&&(w.get(Se).delete(Le),w.get(Se).size||(C.unobserve(Se),w.delete(Se)))}var x=function(Se){Object(V.a)(Te,Se);var Le=Object(_.a)(Te);function Te(){return Object(Y.a)(this,Te),Le.apply(this,arguments)}return Object(L.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(k.Component),m=k.createContext(null);function f(Se){var Le=Se.children,Te=Se.onBatchResize,we=k.useRef(0),ve=k.useRef([]),H=k.useContext(m),T=k.useCallback(function(R,W,$){we.current+=1;var N=we.current;ve.current.push({size:R,element:W,data:$}),Promise.resolve().then(function(){N===we.current&&(Te==null||Te(ve.current),ve.current=[])}),H==null||H(R,W,$)},[Te,H]);return k.createElement(m.Provider,{value:T},Le)}function D(Se){var Le=Se.children,Te=Se.disabled,we=k.useRef(null),ve=k.useRef(null),H=k.useContext(m),T=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),R=k.isValidElement(Le)&&Object(v.c)(Le),W=R?Le.ref:null,$=k.useMemo(function(){return Object(v.a)(W,we)},[W,we]),N=k.useRef(Se);N.current=Se;var de=k.useCallback(function(xe){var Ae=N.current,Ne=Ae.onResize,Me=Ae.data,Re=xe.getBoundingClientRect(),Pe=Re.width,We=Re.height,Qe=xe.offsetWidth,Ve=xe.offsetHeight,Ge=Math.floor(Pe),at=Math.floor(We);if(T.current.width!==Ge||T.current.height!==at||T.current.offsetWidth!==Qe||T.current.offsetHeight!==Ve){var Xe={width:Ge,height:at,offsetWidth:Qe,offsetHeight:Ve};T.current=Xe;var Ze=Qe===Math.round(Pe)?Pe:Qe,De=Ve===Math.round(We)?We:Ve,rt=Object(j.a)(Object(j.a)({},Xe),{},{offsetWidth:Ze,offsetHeight:De});H==null||H(rt,xe,Me),Ne&&Promise.resolve().then(function(){Ne(rt,xe)})}},[]);return k.useEffect(function(){var xe=Object(S.a)(we.current)||Object(S.a)(ve.current);return xe&&!Te&&l(xe,de),function(){return u(xe,de)}},[we.current,Te]),k.createElement(x,{ref:ve},R?k.cloneElement(Le,{ref:$}):Le)}var b="rc-observer-key";function c(Se){var Le=Se.children,Te=Object(O.a)(Le);return Te.map(function(we,ve){var H=(we==null?void 0:we.key)||"".concat(b,"-").concat(ve);return k.createElement(D,Object(ue.a)({},Se,{key:H}),we)})}c.Collection=f;var h=c,s=q("bT9E"),a=q("TSYQ"),g=q.n(a),p=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,y=["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={},G;function Q(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(Le&&P[Te])return P[Te];var we=window.getComputedStyle(Se),ve=we.getPropertyValue("box-sizing")||we.getPropertyValue("-moz-box-sizing")||we.getPropertyValue("-webkit-box-sizing"),H=parseFloat(we.getPropertyValue("padding-bottom"))+parseFloat(we.getPropertyValue("padding-top")),T=parseFloat(we.getPropertyValue("border-bottom-width"))+parseFloat(we.getPropertyValue("border-top-width")),R=y.map(function($){return"".concat($,":").concat(we.getPropertyValue($))}).join(";"),W={sizingStyle:R,paddingSize:H,borderSize:T,boxSizing:ve};return Le&&Te&&(P[Te]=W),W}function re(Se){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,we=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;G||(G=document.createElement("textarea"),G.setAttribute("tab-index","-1"),G.setAttribute("aria-hidden","true"),document.body.appendChild(G)),Se.getAttribute("wrap")?G.setAttribute("wrap",Se.getAttribute("wrap")):G.removeAttribute("wrap");var ve=Q(Se,Le),H=ve.paddingSize,T=ve.borderSize,R=ve.boxSizing,W=ve.sizingStyle;G.setAttribute("style","".concat(W,";").concat(p)),G.value=Se.value||Se.placeholder||"";var $=Number.MIN_SAFE_INTEGER,N=Number.MAX_SAFE_INTEGER,de=G.scrollHeight,xe;if(R==="border-box"?de+=T:R==="content-box"&&(de-=H),Te!==null||we!==null){G.value=" ";var Ae=G.scrollHeight-H;Te!==null&&($=Ae*Te,R==="border-box"&&($=$+H+T),de=Math.max($,de)),we!==null&&(N=Ae*we,R==="border-box"&&(N=N+H+T),xe=de>N?"":"hidden",de=Math.min(N,de))}return{height:de,minHeight:$,maxHeight:N,overflowY:xe,resize:"none"}}var z=q("Gytx"),F=q.n(z),ne;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(ne||(ne={}));var ce=function(Se){Object(V.a)(Te,Se);var Le=Object(_.a)(Te);function Te(we){var ve;return Object(Y.a)(this,Te),ve=Le.call(this,we),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(H){ve.textArea=H},ve.handleResize=function(H){var T=ve.state.resizeStatus,R=ve.props,W=R.autoSize,$=R.onResize;if(T!==ne.NONE)return;typeof $=="function"&&$(H),W&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var H=ve.props.autoSize;if(!H||!ve.textArea)return;var T=H.minRows,R=H.maxRows,W=re(ve.textArea,!1,T,R);ve.setState({textareaStyles:W,resizeStatus:ne.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:ne.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:ne.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var H=ve.props,T=H.prefixCls,R=T===void 0?"rc-textarea":T,W=H.autoSize,$=H.onResize,N=H.className,de=H.disabled,xe=ve.state,Ae=xe.textareaStyles,Ne=xe.resizeStatus,Me=Object(s.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Re=g()(R,N,Object(U.a)({},"".concat(R,"-disabled"),de));"value"in Me&&(Me.value=Me.value||"");var Pe=Object(j.a)(Object(j.a)(Object(j.a)({},ve.props.style),Ae),Ne===ne.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(h,{onResize:ve.handleResize,disabled:!(W||$)},k.createElement("textarea",Object(ue.a)({},Me,{className:Re,style:Pe,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:ne.NONE},ve}return Object(L.a)(Te,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!F()(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,H=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,H)}}catch(T){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(k.Component),ge=ce,be=function(Se){Object(V.a)(Te,Se);var Le=Object(_.a)(Te);function Te(we){var ve;Object(Y.a)(this,Te),ve=Le.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 R=ve.props.onChange;ve.setValue(T.target.value,function(){ve.resizableTextArea.resizeTextarea()}),R&&R(T)},ve.handleKeyDown=function(T){var R=ve.props,W=R.onPressEnter,$=R.onKeyDown;T.keyCode===13&&W&&W(T),$&&$(T)};var H=typeof we.value=="undefined"||we.value===null?we.defaultValue:we.value;return ve.state={value:H},ve}return Object(L.a)(Te,[{key:"setValue",value:function(ve,H){"value"in this.props||this.setState({value:ve},H)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return k.createElement(ge,Object(ue.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}}]),Te}(k.Component),Be=Ie.default=be},bT9E:function(_e,Ie,q){"use strict";q.d(Ie,"a",function(){return Y});var ue=q("VTBJ");function Y(L,V){var _=Object(ue.a)({},L);return Array.isArray(V)&&V.forEach(function(k){delete _[k]}),_}},c5Ni:function(_e,Ie,q){},cRFk:function(_e,Ie,q){_e.exports=q.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(_e,Ie,q){_e.exports=q.p+"static/choose.4ad1045f.svg"},dejd:function(_e,Ie,q){},djh8:function(_e,Ie,q){_e.exports=q.p+"static/qrCode.d852fdfc.png"},dmUQ:function(_e,Ie,q){"use strict";var ue=q("Ff2n"),Y=q("rePB"),L=q("1OyB"),V=q("vuIU"),_=q("Ji7U"),k=q("md7G"),j=q("foSv"),U=q("q1tI"),O=q.n(U),I=q("TSYQ"),v=q.n(I),S=q("4IlW");function M(s,a){var g=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);a&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(s,y).enumerable})),g.push.apply(g,p)}return g}function w(s){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?M(Object(g),!0).forEach(function(p){Object(Y.a)(s,p,g[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(g)):M(Object(g)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(g,p))})}return s}function A(s){var a=C();return function(){var p=Object(j.a)(s),y;if(a){var P=Object(j.a)(this).constructor;y=Reflect.construct(p,arguments,P)}else y=p.apply(this,arguments);return Object(k.a)(this,y)}}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(s){return!1}}function d(){}function o(s){s.preventDefault()}var l=function(a){return a.replace(/[^\w.-]+/g,"")},u=200,x=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,f=function(a){return a!=null},D=function(a,g){return g===a||typeof g=="number"&&typeof a=="number"&&isNaN(g)&&isNaN(a)},b=function(s){Object(_.a)(g,s);var a=A(g);function g(p){var y;Object(L.a)(this,g),y=a.call(this,p),y.onKeyDown=function(Q){var re=y.props,z=re.onKeyDown,F=re.onPressEnter;if(Q.keyCode===S.a.UP){var ne=y.getRatio(Q);y.up(Q,ne,null),y.stop()}else if(Q.keyCode===S.a.DOWN){var ce=y.getRatio(Q);y.down(Q,ce,null),y.stop()}else Q.keyCode===S.a.ENTER&&F&&F(Q);if(y.recordCursorPosition(),y.lastKeyCode=Q.keyCode,z){for(var ge=arguments.length,be=new Array(ge>1?ge-1:0),Be=1;Be<ge;Be++)be[Be-1]=arguments[Be];z.apply(void 0,[Q].concat(be))}},y.onKeyUp=function(Q){var re=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),re){for(var z=arguments.length,F=new Array(z>1?z-1:0),ne=1;ne<z;ne++)F[ne-1]=arguments[ne];re.apply(void 0,[Q].concat(F))}},y.onChange=function(Q){var re=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(Q)),y.setState({inputValue:y.rawInput}),re(y.toNumber(y.rawInput))},y.onMouseUp=function(){var Q=y.props.onMouseUp;y.recordCursorPosition(),Q&&Q.apply(void 0,arguments)},y.onFocus=function(){var Q;y.setState({focused:!0}),(Q=y.props).onFocus.apply(Q,arguments)},y.onBlur=function(){var Q=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var re=y.getCurrentValidValue(y.state.inputValue),z=y.setValue(re,d);if(Q){var F=y.input.value,ne=y.getInputDisplayValue({focus:!1,value:z});y.input.value=ne&&Number(ne),Q.apply(void 0,arguments),y.input.value=F}},y.getRatio=function(Q){var re=1;return Q.metaKey||Q.ctrlKey?re=.1:Q.shiftKey&&(re=10),re},y.getFullNum=function(Q){return isNaN(Q)?Q:/e/i.test(String(Q))?Number(Q).toFixed(18).replace(/\.?0+$/,""):Q},y.getPrecision=function(Q){if(f(y.props.precision))return y.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},y.getInputDisplayValue=function(Q){var re=Q||y.state,z=re.focused,F=re.inputValue,ne=re.value,ce;z?ce=F:ce=y.toPrecisionAsStep(ne),ce==null&&(ce="");var ge=y.formatWrapper(ce);return f(y.props.decimalSeparator)&&(ge=ge.toString().replace(".",y.props.decimalSeparator)),ge},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(Q){}},y.restoreByAfter=function(Q){if(Q===void 0)return!1;var re=y.input.value,z=re.lastIndexOf(Q);if(z===-1)return!1;var F=y.cursorBefore.length;return y.lastKeyCode===S.a.DELETE&&y.cursorBefore.charAt(F-1)===Q[0]?(y.fixCaret(F,F),!0):z+Q.length===re.length?(y.fixCaret(z,z),!0):!1},y.partRestoreByAfter=function(Q){return Q===void 0?!1:Array.prototype.some.call(Q,function(re,z){var F=Q.substring(z);return y.restoreByAfter(F)})},y.isNotCompleteNumber=function(Q){return isNaN(Q)||Q===""||Q===null||Q&&Q.toString().indexOf(".")===Q.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(Q,re,z){y.pressingUpOrDown=!0,y.step("down",Q,re,z)},y.up=function(Q,re,z){y.pressingUpOrDown=!0,y.step("up",Q,re,z)},y.saveInput=function(Q){y.input=Q};var P=p.value;P===void 0&&(P=p.defaultValue),y.state={focused:p.autoFocus};var G=y.getValidValue(y.toNumber(P));return y.state=w(w({},y.state),{},{inputValue:y.toPrecisionAsStep(G),value:G}),y}return Object(V.a)(g,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var P=this.props,G=P.value,Q=P.onChange,re=P.max,z=P.min,F=this.state.focused;if(y){if(!D(y.value,G)||!D(y.max,re)||!D(y.min,z)){var ne=F?G:this.getValidValue(G),ce;this.pressingUpOrDown?ce=ne:this.inputting?ce=this.rawInput:ce=this.toPrecisionAsStep(ne),this.setState({value:ne,inputValue:ce})}var ge="value"in this.props?G:this.state.value;"max"in this.props&&y.max!==re&&typeof ge=="number"&&ge>re&&Q&&Q(re),"min"in this.props&&y.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 be=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===S.a.BACKSPACE?be=this.cursorStart-1:this.lastKeyCode===S.a.DELETE&&(be=this.cursorStart):be=this.input.value.length,this.fixCaret(be,be)}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(Be){}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(y){var P=y;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(y){var P=y.target.value.trim().replace(/。/g,".");return f(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,Q=parseFloat(y);return isNaN(Q)?y:(Q<P&&(Q=P),Q>G&&(Q=G),Q)}},{key:"setValue",value:function(y,P){var G=this.props.precision,Q=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),re=this.state.value,z=re===void 0?null:re,F=this.state.inputValue,ne=F===void 0?null:F,ce=typeof Q=="number"?Q.toFixed(G):"".concat(Q),ge=Q!==z||ce!=="".concat(ne);return"value"in this.props?(ne=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ne},P)):this.setState({value:Q,inputValue:this.toPrecisionAsStep(y)},P),ge&&this.props.onChange(Q),Q}},{key:"getMaxPrecision",value:function(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,G=this.props,Q=G.precision,re=G.step;if(f(Q))return Q;var z=this.getPrecision(P),F=this.getPrecision(re),ne=this.getPrecision(y);return y?Math.max(ne,z+F):z+F}},{key:"getPrecisionFactor",value:function(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,G=this.getMaxPrecision(y,P);return Math.pow(10,G)}},{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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var P=Math.abs(this.getMaxPrecision(y));return isNaN(P)?y.toString():Number(y).toFixed(P)}},{key:"toNumber",value:function(y){var P=this.props.precision,G=this.state.focused,Q=y&&y.length>16&&G;return this.isNotCompleteNumber(y)||Q?y:f(P)?Math.round(y*Math.pow(10,P))/Math.pow(10,P):Number(y)}},{key:"upStep",value:function(y,P){var G=this.props.step,Q=this.getPrecisionFactor(y,P),re=Math.abs(this.getMaxPrecision(y,P)),z=((Q*y+Q*G*P)/Q).toFixed(re);return this.toNumber(z)}},{key:"downStep",value:function(y,P){var G=this.props.step,Q=this.getPrecisionFactor(y,P),re=Math.abs(this.getMaxPrecision(y,P)),z=((Q*y-Q*G*P)/Q).toFixed(re);return this.toNumber(z)}},{key:"step",value:function(y,P){var G=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 F=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(F))return;var ne=this["".concat(y,"Step")](F,Q),ce=ne>z.max||ne<z.min;if(ne>z.max?ne=z.max:ne<z.min&&(ne=z.min),this.setValue(ne,null),this.setState({focused:!0},function(){G.pressingUpOrDown=!1}),ce)return;this.autoStepTimer=setTimeout(function(){G[y](P,Q,!0)},re?u:x)}},{key:"fixCaret",value:function(y,P){if(y===void 0||P===void 0||!this.input||!this.input.value)return;try{var G=this.input.selectionStart,Q=this.input.selectionEnd;(y!==G||P!==Q)&&this.input.setSelectionRange(y,P)}catch(re){}}},{key:"render",value:function(){var y,P=this.props,G=P.prefixCls,Q=P.disabled,re=P.readOnly,z=P.useTouch,F=P.autoComplete,ne=P.upHandler,ce=P.downHandler,ge=P.className,be=P.max,Be=P.min,Se=P.style,Le=P.title,Te=P.onMouseEnter,we=P.onMouseLeave,ve=P.onMouseOver,H=P.onMouseOut,T=P.required,R=P.onClick,W=P.tabIndex,$=P.type,N=P.placeholder,de=P.id,xe=P.inputMode,Ae=P.pattern,Ne=P.step,Me=P.maxLength,Re=P.autoFocus,Pe=P.name,We=P.onPaste,Qe=P.onInput,Ve=Object(ue.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"]),Ge=this.state,at=Ge.value,Xe=Ge.focused,Ze=v()(G,(y={},Object(Y.a)(y,ge,!!ge),Object(Y.a)(y,"".concat(G,"-disabled"),Q),Object(Y.a)(y,"".concat(G,"-focused"),Xe),y)),De={};Object.keys(Ve).forEach(function(he){(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(De[he]=Ve[he])});var rt=!re&&!Q,qe=this.getInputDisplayValue(null),oe=(at||at===0)&&(isNaN(at)||Number(at)>=be),J=(at||at===0)&&(isNaN(at)||Number(at)<=Be),Z=oe||Q||re,ae=J||Q||re,se=v()("".concat(G,"-handler"),"".concat(G,"-handler-up"),Object(Y.a)({},"".concat(G,"-handler-up-disabled"),Z)),ee=v()("".concat(G,"-handler"),"".concat(G,"-handler-down"),Object(Y.a)({},"".concat(G,"-handler-down-disabled"),ae)),ie=z?{onTouchStart:Z?d:this.up,onTouchEnd:this.stop}:{onMouseDown:Z?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},le=z?{onTouchStart:ae?d:this.down,onTouchEnd:this.stop}:{onMouseDown:ae?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:Ze,style:Se,title:Le,onMouseEnter:Te,onMouseLeave:we,onMouseOver:ve,onMouseOut:H,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(G,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":Z,className:se}),ne||O.a.createElement("span",{unselectable:"on",className:"".concat(G,"-handler-up-inner"),onClick:o})),O.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Decrease Value","aria-disabled":ae,className:ee}),ce||O.a.createElement("span",{unselectable:"on",className:"".concat(G,"-handler-down-inner"),onClick:o}))),O.a.createElement("div",{className:"".concat(G,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Be,"aria-valuemax":be,"aria-valuenow":at,required:T,type:$,placeholder:N,onPaste:We,onClick:R,onMouseUp:this.onMouseUp,className:"".concat(G,"-input"),tabIndex:W,autoComplete:F,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:rt?this.onKeyDown:d,onKeyUp:rt?this.onKeyUp:d,autoFocus:Re,maxLength:Me,readOnly:re,disabled:Q,max:be,min:Be,step:Ne,name:Pe,title:Le,id:de,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(qe),pattern:Ae,inputMode:xe,onInput:Qe},De))))}}]),g}(O.a.Component);b.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:l,required:!1,autoComplete:"off"};var c=b,h=Ie.a=c},is8o:function(_e,Ie,q){_e.exports={flex_box_center:"flex_box_center___45jij",flex_space_between:"flex_space_between___2rBtS",flex_box_vertical_center:"flex_box_vertical_center___B3dEI",flex_box_center_end:"flex_box_center_end___1hlbx",flex_box_column:"flex_box_column___n3oa5",wrap:"wrap___2Ebga",modal:"modal___37ZgF",titleWrap:"titleWrap___dEwT4",required:"required___4a1a5",title:"title___1MHB3",colorGray:"colorGray___1tQ38",choiceWrap:"choiceWrap___2Ik_w",answer:"answer___3N5FQ",activeAnswer:"activeAnswer___3zdHK",deleteIcon:"deleteIcon___U7nIS",addIcon:"addIcon___2tuSF",editorWrap:"editorWrap___ZOK2K",htmlWrap:"htmlWrap___3X_dl",radio:"radio___wS7N0",color333:"color333___S1zDX",color999:"color999___VJwGv",questionType:"questionType___BHDve",questionChoices:"questionChoices___3YAfc"}},ji0R:function(_e,Ie,q){_e.exports=q.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(_e,Ie,q){_e.exports=q.p+"static/question.cb52bef9.gif"},kPYp:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPf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3E0id1lMlR1hRJnk8PK+H0mqu7DmHBDB4vw6HtneQ8N06YNalIp4HmF6X8EfV6ljRfk5EmNxJvIdn09ksdYIs7oV2d7h7uGrhUOEzP14ibzoNgXmC3wjQx3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(_e,Ie,q){},kvPc:function(_e,Ie,q){"use strict";q.r(Ie);var ue=q("5Dmo"),Y=q("3S7+"),L=q("P2fV"),V=q("NJEC"),_=q("14J3"),k=q("BMrR"),j=q("jCWc"),U=q("kPKH"),O=q("OaEy"),I=q("2fM7"),v=q("7Kak"),S=q("9yH6"),M=q("+L6B"),w=q("2/Rp"),A=q("5NDa"),C=q("5rEg"),d=q("miYZ"),o=q("tsqr"),l=q("k1fw"),u=q("9og8"),x=q("y8nQ"),m=q("Vl3Y"),f=q("tJVT"),D=q("PpiC"),b=q("WmNS"),c=q.n(b),h=q("q1tI"),s=q.n(h),a=q("9kvl"),g=q("Ot1p"),p=q("HBuW"),y=q("oBTY"),P=q("2qtc"),G=q("kLXV"),Q=q("Ty5D"),re=q("V0Rq"),z=q("9Bee"),F=q("is8o"),ne=q.n(F),ce=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ge=function(W,$){var N=W.problemset,de=W.globalSetting,xe=W.loading,Ae=W.dispatch,Ne=W.onRef,Me=Ne===void 0?function(){}:Ne,Re=W.editData,Pe=Object(D.a)(W,["problemset","globalSetting","loading","dispatch","onRef","editData"]),We=Object(h.useState)([]),Qe=Object(f.a)(We,2),Ve=Qe[0],Ge=Qe[1],at=Object(h.useState)(),Xe=Object(f.a)(at,2),Ze=Xe[0],De=Xe[1],rt=Object(h.useState)([]),qe=Object(f.a)(rt,2),oe=qe[0],J=qe[1],Z=Object(h.useState)(""),ae=Object(f.a)(Z,2),se=ae[0],ee=ae[1],ie=Object(h.useState)(5),le=Object(f.a)(ie,2),he=le[0],me=le[1],ye=Object(h.useState)(!1),ke=Object(f.a)(ye,2),He=ke[0],$e=ke[1],et=Object(Q.i)();Object(h.useEffect)(function(){Ge(["","","",""])},[]),Object(h.useEffect)(function(){var It,Ct;if(!(Re!=null&&Re.challenge_id)){$e(!0);return}ee(Re==null?void 0:Re.subject),me(parseInt(Re==null?void 0:Re.question_score)),Ge(Re==null||((It=Re.choose_contents)===null||It===void 0)?void 0:It.map(function(At){return At.option_name}));var ht=[];Re==null||((Ct=Re.standard_answer)===null||Ct===void 0)||Ct.split("").map(function(At,Ot){ht.push(ce.indexOf(At))}),J(ht)},[Re]),Object(h.useImperativeHandle)($,function(){return{onSave:ot,onReset:St,isEdit:He}});var St=function(){Ge(["","","",""]),ee(""),J([])},ot=function(){var It=Object(u.a)(c.a.mark(function Ct(){var ht,At;return c.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:if(se){Rt.next=3;break}return o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Rt.abrupt("return",!1);case 3:if(ht=Ve.findIndex(function(Wt){return!Wt}),!(ht>-1)){Rt.next=7;break}return o.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ce[ht]," \u9009\u9879\u7684\u5185\u5BB9")),Rt.abrupt("return",!1);case 7:if(oe.length){Rt.next=10;break}return o.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Rt.abrupt("return",!1);case 10:if(!(oe.length<1)){Rt.next=13;break}return o.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Rt.abrupt("return",!1);case 13:return At=Ve.map(function(Wt,qt){return{choice_text:Wt,is_answer:!!oe.includes(qt)}}),Rt.abrupt("return",{subject:se,question:{cnt:At.map(function(Wt){return Wt.choice_text})},choice:{answer:At.map(function(Wt){return Wt.is_answer})}});case 15:case"end":return Rt.stop()}},Ct)}));return function(){return It.apply(this,arguments)}}(),nt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Mt=function(){var It=Object(u.a)(c.a.mark(function Ct(ht){return c.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:Ot.t0=ht.id,Ot.next=Ot.t0==="del"?3:Ot.t0==="up"||Ot.t0==="down"?5:Ot.t0==="edit"?9:11;break;case 3:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(u.a)(c.a.mark(function Wt(){return c.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:return hr.next=2,Object(re.n)({id:Re.question_id});case 2:Ae({type:"exercise/editExercise",payload:Object(l.a)({},et)});case 3:case"end":return hr.stop()}},Wt)}))()}}),Ot.abrupt("break",11);case 5:return Ot.next=7,Ae({type:"exercise/exeriseMoveUpDown",payload:{id:Re.question_id,opr:ht.id}});case 7:return Ae({type:"exercise/editExercise",payload:Object(l.a)({},et)}),Ot.abrupt("break",11);case 9:return $e(!0),Ot.abrupt("break",11);case 11:case"end":return Ot.stop()}},Ct)}));return function(ht){return It.apply(this,arguments)}}(),xt=function(){var Ct;return s.a.createElement("aside",null,s.a.createElement("p",{className:ne.a.titleWrap},s.a.createElement("span",{className:ne.a.required},"*"),s.a.createElement("span",{className:ne.a.title},"\u9898\u5E72\uFF1A")),s.a.createElement(g.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:se,onChange:function(At){return ee(At)}}),s.a.createElement("p",{className:ne.a.titleWrap},s.a.createElement("span",{className:ne.a.required},"*"),s.a.createElement("span",{className:ne.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",s.a.createElement("span",{className:ne.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ve.map(function(ht,At){return s.a.createElement("div",{className:ne.a.choiceWrap,key:At},s.a.createElement(Y.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},s.a.createElement("div",{className:"".concat(ne.a.answer," ").concat(oe.includes(At)?ne.a.activeAnswer:""),onClick:function(){oe.includes(At)?J(oe.filter(function(Rt){return Rt!==At})):J([].concat(Object(y.a)(oe),[At]))}},ce[At])),s.a.createElement("div",{className:ne.a.editorWrap},Ze===At?s.a.createElement(g.a,{id:"single-question-option-".concat(At),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:ht,onChange:function(Rt){Ve[At]=Rt,Ge(Ve)}}):s.a.createElement("div",{className:ne.a.htmlWrap,onClick:function(){return De(At)}},s.a.createElement(z.a,{value:ht}))),At>1&&s.a.createElement(Y.a,{title:"\u5220\u9664"},s.a.createElement("i",{className:"".concat(ne.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Ge(Ve.filter(function(Rt,Wt){return Wt!==At}))}})),At<7&&At===Ve.length-1&&s.a.createElement(Y.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},s.a.createElement("i",{className:"".concat(ne.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Ge([].concat(Object(y.a)(Ve),[""]))}})))}),s.a.createElement(k.a,{className:"mt10"},s.a.createElement(U.a,{flex:"1"},s.a.createElement("p",{className:"c-grey-999"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898")),s.a.createElement(U.a,null,"\u6807\u51C6\u7B54\u6848\uFF1A",s.a.createElement("span",{className:"c-orange"},oe==null||((Ct=oe.sort(function(ht,At){return ht-At}))===null||Ct===void 0)?void 0:Ct.map(function(ht){return ce[ht]})))))};return s.a.createElement("section",{className:ne.a.wrap},xt())},be=Object(a.a)(function(R){var W=R.problemset,$=R.loading,N=R.globalSetting;return{problemset:W,globalSetting:N,loading:$.effects}},null,null,{forwardRef:!0})(Object(h.forwardRef)(ge)),Be=q("1vsH"),Se=q("zEei"),Le=q.n(Se),Te=q("CJF0"),we=q("2RCv"),ve={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},H=function(W){var $,N=W.shixunsDetail,de=W.dispatch,xe=W.loading,Ae=W.match,Ne=W.location,Me=Object(D.a)(W,["shixunsDetail","dispatch","loading","match","location"]),Re=m.a.useForm(),Pe=Object(f.a)(Re,1),We=Pe[0],Qe=Object(h.useState)({}),Ve=Object(f.a)(Qe,2),Ge=Ve[0],at=Ve[1],Xe=Object(h.useState)(!1),Ze=Object(f.a)(Xe,2),De=Ze[0],rt=Ze[1],qe=Object(h.useState)(!0),oe=Object(f.a)(qe,2),J=oe[0],Z=oe[1],ae=Object(h.useState)(),se=Object(f.a)(ae,2),ee=se[0],ie=se[1],le=Object(h.useState)([10,20]),he=Object(f.a)(le,2),me=he[0],ye=he[1],ke=Object(h.useState)(!1),He=Object(f.a)(ke,2),$e=He[0],et=He[1],St=Object(h.useState)({}),ot=Object(f.a)(St,2),nt=ot[0],Mt=ot[1],xt=N.challengesEdit,It=N.editChallengesQuestion,Ct=Object(h.useRef)(),ht=function(){var Ut=Object(u.a)(c.a.mark(function mt(){var Fe;return c.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,de({type:"shixunsDetail/getChallengesEdit",payload:Object(l.a)({},Ae.params)});case 2:Fe=ut.sent,We.setFieldsValue(Object(l.a)({},Fe));case 4:case"end":return ut.stop()}},mt)}));return function(){return Ut.apply(this,arguments)}}(),At=function(){var Ut=Object(u.a)(c.a.mark(function mt(){var Fe;return c.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(!Ae.params.questionId){ut.next=7;break}return ut.next=3,de({type:"shixunsDetail/getEditChallengesQuestion",payload:Object(l.a)({},Ae.params)});case 3:Fe=ut.sent,We.setFieldsValue({challenge_tag:Fe.tags,difficult:Fe.difficult,score:Fe.score,answer:Fe.answer}),ye(ve[Fe.difficult]),Mt(Fe);case 7:case"end":return ut.stop()}},mt)}));return function(){return Ut.apply(this,arguments)}}();Object(h.useEffect)(function(){ht(),Ae.params.questionId&&(ie(!0),At(),rt(!0))},[Ne.pathname]);var Ot=function(){var Ut=Object(u.a)(c.a.mark(function mt(){var Fe,ft,ut,gt;return c.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return ft="",ut=Object(l.a)({},Ge),wt.next=4,Ct.current.onSave();case 4:return gt=wt.sent,(Fe=gt.choice)===null||Fe===void 0||Fe.answer.map(function(st,zt){st&&(ft+=Be.o[zt])}),wt.abrupt("return",{challenge_choose:{subject:gt.subject,answer:Ge.task_pass,standard_answer:ft,score:Ge.score,difficult:Ge.difficult},challenge_tag:Ge.challenge_tag,question:gt.question,choice:gt.choice});case 7:case"end":return wt.stop()}},mt)}));return function(){return Ut.apply(this,arguments)}}(),Rt=function(mt){var Fe=ve[mt],ft=Fe==null?void 0:Fe[0];ye(Fe),We.setFieldsValue({score:ft}),at(Object(l.a)(Object(l.a)({},We.getFieldsValue()),{score:ft}))},Wt=function(mt,Fe){at(Object(l.a)({},We.getFieldsValue())),"difficult"in mt&&Rt(mt.difficult)},qt=function(){var Ut=Object(u.a)(c.a.mark(function mt(){var Fe;return c.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.t0=p.w,ut.t1=l.a,ut.t2=l.a,ut.t3={},ut.next=6,Ot();case 6:return ut.t4=ut.sent,ut.t5=(0,ut.t2)(ut.t3,ut.t4),ut.t6=Ae.params,ut.t7=(0,ut.t1)(ut.t5,ut.t6),ut.next=12,(0,ut.t0)(ut.t7);case 12:Fe=ut.sent,(Fe==null?void 0:Fe.status)===1&&o.b.success("\u5220\u9664\u6210\u529F"),Me.history.replace("/shixuns/".concat(Ae.params.id,"/challenges/").concat(Ae.params.challengesId,"/editquestion"));case 15:case"end":return ut.stop()}},mt)}));return function(){return Ut.apply(this,arguments)}}(),hr=function(){var Ut=Object(u.a)(c.a.mark(function mt(Fe){var ft,ut,gt,yt;return c.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(ft=Object(l.a)({},Ge),et(!0),J){st.next=20;break}return st.t0=p.c,st.t1=l.a,st.t2=l.a,st.t3={},st.next=9,Ot();case 9:return st.t4=st.sent,st.t5=(0,st.t2)(st.t3,st.t4),st.t6=Ae.params,st.t7=(0,st.t1)(st.t5,st.t6),st.next=15,(0,st.t0)(st.t7);case 15:ut=st.sent,et(!1),ut.challenge_choose_id&&(o.b.success("\u64CD\u4F5C\u6210\u529F"),Me.history.replace("/shixuns/".concat(Ae.params.id,"/challenges/").concat(Ae.params.challengesId,"/editquestion/").concat(ut.challenge_choose_id))),st.next=45;break;case 20:if(!Ae.params.questionId){st.next=38;break}return st.t8=p.Pb,st.t9=l.a,st.t10=l.a,st.t11={},st.next=27,Ot();case 27:return st.t12=st.sent,st.t13=(0,st.t10)(st.t11,st.t12),st.t14=Ae.params,st.t15=(0,st.t9)(st.t13,st.t14),st.next=33,(0,st.t8)(st.t15);case 33:gt=st.sent,et(!1),gt.challenge_choose_id&&o.b.success("\u64CD\u4F5C\u6210\u529F"),st.next=45;break;case 38:return ft.identifier=Ae.params.id,ft.st=1,st.next=42,Object(p.Ob)(Object(l.a)(Object(l.a)({},ft),Ae.params));case 42:yt=st.sent,et(!1),yt.challenge_id&&o.b.success("\u64CD\u4F5C\u6210\u529F");case 45:case"end":return st.stop()}},mt)}));return function(Fe){return Ut.apply(this,arguments)}}(),Yt=function(){var mt;return s.a.createElement("div",null,s.a.createElement("div",{className:Le.a.fieldWrap},s.a.createElement(m.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},s.a.createElement(C.a,{maxLength:60,suffix:"".concat(((mt=Ge.subject)===null||mt===void 0?void 0:mt.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),s.a.createElement("div",{className:Le.a.mdWrap},s.a.createElement(m.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(g.a,{watch:!0,defaultValue:xt.task_pass}))),s.a.createElement("div",{className:Le.a.backgroundFa},s.a.createElement("div",{className:"pt40 mb30"},s.a.createElement(m.a.Item,null,s.a.createElement(w.a,{size:"large",type:"primary",className:"".concat(Le.a.button," mr20"),htmlType:"submit",loading:$e},"\u63D0\u4EA4"),s.a.createElement(w.a,{size:"large",type:"primary",ghost:!0,className:Le.a.button,onClick:function(){return a.d.push("/shixuns/".concat(Ae.params.id,"/challenges"))}},"\u53D6\u6D88")))))},wr=function(){var mt,Fe;return s.a.createElement("div",null,s.a.createElement("div",{className:"bg-white"},s.a.createElement(be,{ref:Ct,editData:nt})),s.a.createElement("div",{className:Le.a.mdWrap},s.a.createElement(m.a.Item,{name:"task_pass",label:"\u53C2\u8003\u7B54\u6848:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(g.a,{watch:!0,defaultValue:J?It.answer:""})),s.a.createElement(m.a.Item,{name:"difficult",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},s.a.createElement(S.a.Group,{disabled:((mt=N.detail)===null||mt===void 0?void 0:mt.shixun_status)===2},s.a.createElement(S.a,{value:1},"\u7B80\u5355"),s.a.createElement(S.a,{value:2},"\u4E2D\u7B49"),s.a.createElement(S.a,{value:3},"\u56F0\u96BE"))),s.a.createElement(k.a,null,s.a.createElement(U.a,null,s.a.createElement(m.a.Item,{name:"score",label:"\u5956\u52B1\u7ECF\u9A8C\u503C:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},s.a.createElement(I.a,{disabled:((Fe=N.detail)===null||Fe===void 0?void 0:Fe.shixun_status)===2},me.map(function(ft){return s.a.createElement(I.a.Option,{key:ft,value:ft},ft)})))),s.a.createElement(U.a,{flex:1},s.a.createElement("div",{className:"font12 c-light-black ml10 mt20"},"\u5982\u679C\u5B66\u5458\u7B54\u9898\u9519\u8BEF\uFF0C\u5219\u4E0D\u80FD\u5F97\u5230\u76F8\u5E94\u7684\u7ECF\u9A8C\u503C",s.a.createElement("br",null),"\u5982\u679C\u5B66\u5458\u6210\u529F\u5F97\u5230\u7ECF\u9A8C\u503C\uFF0C\u90A3\u4E48\u5C06\u540C\u65F6\u83B7\u5F97\u7B49\u503C\u7684\u91D1\u5E01\u5956\u52B1\uFF0C\u5982\uFF1A+10\u7ECF\u9A8C\u503C\u3001+10\u91D1\u5E01"))),s.a.createElement(m.a.Item,{name:"challenge_tag",label:s.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E"," ",s.a.createElement("span",{className:"pl20 font12 c-light-black"},"\u5B66\u5458\u7B54\u9898\u6B63\u786E\u5C06\u83B7\u5F97\u6280\u80FD\uFF0C\u5426\u5219\u4E0D\u80FD\u83B7\u5F97\u6280\u80FD\uFF08\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E\uFF09")),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6280\u80FD\u6807\u7B7E"}]},s.a.createElement(we.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E"}))),s.a.createElement("div",{className:Le.a.backgroundFa},s.a.createElement(k.a,{className:"pt40 mb30"},s.a.createElement(U.a,{flex:1},s.a.createElement(m.a.Item,null,s.a.createElement(w.a,{size:"large",type:"primary",className:"".concat(Le.a.button," mr20"),htmlType:"submit",loading:$e},"\u63D0\u4EA4"),s.a.createElement(w.a,{size:"large",type:"primary",ghost:!0,className:Le.a.button,onClick:function(){return a.d.push("/shixuns/".concat(Ae.params.id,"/challenges"))}},"\u53D6\u6D88"))),s.a.createElement(U.a,null,ee&&s.a.createElement(w.a,{size:"large",ghost:!0,className:"".concat(Le.a.button," ").concat(Le.a.deleteButton),onClick:qt},"\u5220\u9664")))))};return s.a.createElement("section",{className:Le.a.bg},s.a.createElement(Te.a,{data:xt,title:"\u9009\u62E9\u9898"}),s.a.createElement(m.a,{form:We,className:Le.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Wt,onFinish:hr,initialValues:{difficult:1,score:10}},s.a.createElement("aside",{className:["bg-white",Le.a.navBar].join(" ")},s.a.createElement(V.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){a.d.replace("/shixuns/".concat(Ae.params.id,"/challenges/").concat(Ae.params.challengesId,"/editquestion"))}},s.a.createElement("strong",{className:"current"},"\u672C\u5173\u4EFB\u52A1")),xt==null||(($=xt.chooses)===null||$===void 0)?void 0:$.map(function(Ut,mt){return s.a.createElement(V.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){a.d.replace("/shixuns/".concat(Ae.params.id,"/challenges/").concat(Ae.params.challengesId,"/editquestion/").concat(Ut.choose_id))}},s.a.createElement("strong",{className:"current ".concat(Ae.params.questionId==Ut.choose_id&&J?Le.a.actived:"")},Ut.type===1?"\u5355\u9009\u9898":"\u591A\u9009\u9898"))}),J&&s.a.createElement(V.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){rt(!0),Z(!1),Mt({}),Ct.current&&Ct.current.onReset(),We.resetFields()}},s.a.createElement(Y.a,{title:"\u65B0\u589E\u9009\u62E9\u9898"},s.a.createElement("span",{className:Le.a.addButton,onClick:function(){}},"+"))),!J&&s.a.createElement("strong",{className:Le.a.actived},"\u9009\u62E9\u9898")),!De&&Yt(),De&&wr()))},T=Ie.default=Object(a.a)(function(R){var W=R.shixunsDetail,$=R.newCourse,N=R.loading,de=R.globalSetting;return{shixunsDetail:W,newCourse:$,globalSetting:de,loading:N.effects}})(H)},l2Kq:function(_e,Ie,q){_e.exports=q.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(_e,Ie,q){(function(ue){ue(q("VrN/"),q("1eCo"),q("8EBN"))})(function(ue){"use strict";ue.defineMode("markdown",function(Y,L){var V=ue.getMode(Y,"text/html"),_=V.name=="null";function k(z){if(ue.findModeByName){var F=ue.findModeByName(z);F&&(z=F.mime||F.mimes[0])}var ne=ue.getMode(Y,z);return ne.name=="null"?null:ne}L.highlightFormatting===void 0&&(L.highlightFormatting=!1),L.maxBlockquoteDepth===void 0&&(L.maxBlockquoteDepth=0),L.taskLists===void 0&&(L.taskLists=!1),L.strikethrough===void 0&&(L.strikethrough=!1),L.emoji===void 0&&(L.emoji=!1),L.fencedCodeBlockHighlighting===void 0&&(L.fencedCodeBlockHighlighting=!0),L.fencedCodeBlockDefaultMode===void 0&&(L.fencedCodeBlockDefaultMode="text/plain"),L.xml===void 0&&(L.xml=!0),L.tokenTypeOverrides===void 0&&(L.tokenTypeOverrides={});var j={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var U in j)j.hasOwnProperty(U)&&L.tokenTypeOverrides[U]&&(j[U]=L.tokenTypeOverrides[U]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,S=L.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,M=/^ {0,3}(?:\={1,}|-{2,})\s*$/,w=/^[^#!\[\]*_\\<>` "'(~:]+/,A=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,C=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,o=" ";function l(z,F,ne){return F.f=F.inline=ne,ne(z,F)}function u(z,F,ne){return F.f=F.block=ne,ne(z,F)}function x(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 F=_;if(!F){var ne=ue.innerMode(V,z.htmlState);F=ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText}F&&(z.f=s,z.block=f,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function f(z,F){var ne=z.column()===F.indentation,ce=x(F.prevLine.stream),ge=F.indentedCode,be=F.prevLine.hr,Be=F.list!==!1,Se=(F.listStack[F.listStack.length-1]||0)+3;F.indentedCode=!1;var Le=F.indentation;if(F.indentationDiff===null&&(F.indentationDiff=F.indentation,Be)){for(F.list=null;Le<F.listStack[F.listStack.length-1];)F.listStack.pop(),F.listStack.length?F.indentation=F.listStack[F.listStack.length-1]:F.list=!1;F.list!==!1&&(F.indentationDiff=Le-F.listStack[F.listStack.length-1])}var Te=!ce&&!be&&!F.prevLine.header&&(!Be||!ge)&&!F.prevLine.fencedCodeEnd,we=(F.list===!1||be||ce)&&F.indentation<=Se&&z.match(O),ve=null;if(F.indentationDiff>=4&&(ge||F.prevLine.fencedCodeEnd||F.prevLine.header||ce))return z.skipToEnd(),F.indentedCode=!0,j.code;if(z.eatSpace())return null;if(ne&&F.indentation<=Se&&(ve=z.match(S))&&ve[1].length<=6)return F.quote=0,F.header=ve[1].length,F.thisLine.header=!0,L.highlightFormatting&&(F.formatting="header"),F.f=F.inline,c(F);if(F.indentation<=Se&&z.eat(">"))return F.quote=ne?1:F.quote+1,L.highlightFormatting&&(F.formatting="quote"),z.eatSpace(),c(F);if(!we&&!F.setext&&ne&&F.indentation<=Se&&(ve=z.match(I))){var H=ve[1]?"ol":"ul";return F.indentation=Le+z.current().length,F.list=!0,F.quote=0,F.listStack.push(F.indentation),F.em=!1,F.strong=!1,F.code=!1,F.strikethrough=!1,L.taskLists&&z.match(v,!1)&&(F.taskList=!0),F.f=F.inline,L.highlightFormatting&&(F.formatting=["list","list-"+H]),c(F)}else{if(ne&&F.indentation<=Se&&(ve=z.match(A,!0)))return F.quote=0,F.fencedEndRE=new RegExp(ve[1]+"+ *$"),F.localMode=L.fencedCodeBlockHighlighting&&k(ve[2]||L.fencedCodeBlockDefaultMode),F.localMode&&(F.localState=ue.startState(F.localMode)),F.f=F.block=b,L.highlightFormatting&&(F.formatting="code-block"),F.code=-1,c(F);if(F.setext||(!Te||!Be)&&!F.quote&&F.list===!1&&!F.code&&!we&&!C.test(z.string)&&(ve=z.lookAhead(1))&&(ve=ve.match(M)))return F.setext?(F.header=F.setext,F.setext=0,z.skipToEnd(),L.highlightFormatting&&(F.formatting="header")):(F.header=ve[0].charAt(0)=="="?1:2,F.setext=F.header),F.thisLine.header=!0,F.f=F.inline,c(F);if(we)return z.skipToEnd(),F.hr=!0,F.thisLine.hr=!0,j.hr;if(z.peek()==="[")return l(z,F,P)}return l(z,F,F.inline)}function D(z,F){var ne=V.token(z,F.htmlState);if(!_){var ce=ue.innerMode(V,F.htmlState);(ce.mode.name=="xml"&&ce.state.tagStart===null&&!ce.state.context&&ce.state.tokenize.isInText||F.md_inside&&z.current().indexOf(">")>-1)&&(F.f=s,F.block=f,F.htmlState=null)}return ne}function b(z,F){var ne=F.listStack[F.listStack.length-1]||0,ce=F.indentation<ne,ge=ne+3;if(F.fencedEndRE&&F.indentation<=ge&&(ce||z.match(F.fencedEndRE))){L.highlightFormatting&&(F.formatting="code-block");var be;return ce||(be=c(F)),F.localMode=F.localState=null,F.block=f,F.f=s,F.fencedEndRE=null,F.code=0,F.thisLine.fencedCodeEnd=!0,ce?u(z,F,F.block):be}else return F.localMode?F.localMode.token(z,F.localState):(z.skipToEnd(),j.code)}function c(z){var F=[];if(z.formatting){F.push(j.formatting),typeof z.formatting=="string"&&(z.formatting=[z.formatting]);for(var ne=0;ne<z.formatting.length;ne++)F.push(j.formatting+"-"+z.formatting[ne]),z.formatting[ne]==="header"&&F.push(j.formatting+"-"+z.formatting[ne]+"-"+z.header),z.formatting[ne]==="quote"&&(!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=z.quote?F.push(j.formatting+"-"+z.formatting[ne]+"-"+z.quote):F.push("error"))}if(z.taskOpen)return F.push("meta"),F.length?F.join(" "):null;if(z.taskClosed)return F.push("property"),F.length?F.join(" "):null;if(z.linkHref?F.push(j.linkHref,"url"):(z.strong&&F.push(j.strong),z.em&&F.push(j.em),z.strikethrough&&F.push(j.strikethrough),z.emoji&&F.push(j.emoji),z.linkText&&F.push(j.linkText),z.code&&F.push(j.code),z.image&&F.push(j.image),z.imageAltText&&F.push(j.imageAltText,"link"),z.imageMarker&&F.push(j.imageMarker)),z.header&&F.push(j.header,j.header+"-"+z.header),z.quote&&(F.push(j.quote),!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=z.quote?F.push(j.quote+"-"+z.quote):F.push(j.quote+"-"+L.maxBlockquoteDepth)),z.list!==!1){var ce=(z.listStack.length-1)%3;ce?ce===1?F.push(j.list2):F.push(j.list3):F.push(j.list1)}return z.trailingSpaceNewLine?F.push("trailing-space-new-line"):z.trailingSpace&&F.push("trailing-space-"+(z.trailingSpace%2?"a":"b")),F.length?F.join(" "):null}function h(z,F){return z.match(w,!0)?c(F):void 0}function s(z,F){var ne=F.text(z,F);if(typeof ne!="undefined")return ne;if(F.list)return F.list=null,c(F);if(F.taskList){var ce=z.match(v,!0)[1]===" ";return ce?F.taskOpen=!0:F.taskClosed=!0,L.highlightFormatting&&(F.formatting="task"),F.taskList=!1,c(F)}if(F.taskOpen=!1,F.taskClosed=!1,F.header&&z.match(/^#+$/,!0))return L.highlightFormatting&&(F.formatting="header"),c(F);var ge=z.next();if(F.linkTitle){F.linkTitle=!1;var be=ge;ge==="("&&(be=")"),be=(be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Be="^\\s*(?:[^"+be+"\\\\]+|\\\\\\\\|\\\\.)"+be;if(z.match(new RegExp(Be),!0))return j.linkHref}if(ge==="`"){var Se=F.formatting;L.highlightFormatting&&(F.formatting="code"),z.eatWhile("`");var Le=z.current().length;if(F.code==0&&(!F.quote||Le==1))return F.code=Le,c(F);if(Le==F.code){var Te=c(F);return F.code=0,Te}else return F.formatting=Se,c(F)}else if(F.code)return c(F);if(ge==="\\"&&(z.next(),L.highlightFormatting)){var we=c(F),ve=j.formatting+"-escape";return we?we+" "+ve:ve}if(ge==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return F.imageMarker=!0,F.image=!0,L.highlightFormatting&&(F.formatting="image"),c(F);if(ge==="["&&F.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return F.imageMarker=!1,F.imageAltText=!0,L.highlightFormatting&&(F.formatting="image"),c(F);if(ge==="]"&&F.imageAltText){L.highlightFormatting&&(F.formatting="image");var we=c(F);return F.imageAltText=!1,F.image=!1,F.inline=F.f=g,we}if(ge==="["&&!F.image)return F.linkText&&z.match(/^.*?\]/)||(F.linkText=!0,L.highlightFormatting&&(F.formatting="link")),c(F);if(ge==="]"&&F.linkText){L.highlightFormatting&&(F.formatting="link");var we=c(F);return F.linkText=!1,F.inline=F.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?g:s,we}if(ge==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,L.highlightFormatting&&(F.formatting="link");var we=c(F);return we?we+=" ":we="",we+j.linkInline}if(ge==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=a,L.highlightFormatting&&(F.formatting="link");var we=c(F);return we?we+=" ":we="",we+j.linkEmail}if(L.xml&&ge==="<"&&z.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var H=z.string.indexOf(">",z.pos);if(H!=-1){var T=z.string.substring(z.start,H);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(T)&&(F.md_inside=!0)}return z.backUp(1),F.htmlState=ue.startState(V),u(z,F,D)}if(L.xml&&ge==="<"&&z.match(/^\/\w*?>/))return F.md_inside=!1,"tag";if(ge==="*"||ge==="_"){for(var R=1,W=z.pos==1?" ":z.string.charAt(z.pos-2);R<3&&z.eat(ge);)R++;var $=z.peek()||" ",N=!/\s/.test($)&&(!d.test($)||/\s/.test(W)||d.test(W)),de=!/\s/.test(W)&&(!d.test(W)||/\s/.test($)||d.test($)),xe=null,Ae=null;if(R%2&&(!F.em&&N&&(ge==="*"||!de||d.test(W))?xe=!0:F.em==ge&&de&&(ge==="*"||!N||d.test($))&&(xe=!1)),R>1&&(!F.strong&&N&&(ge==="*"||!de||d.test(W))?Ae=!0:F.strong==ge&&de&&(ge==="*"||!N||d.test($))&&(Ae=!1)),Ae!=null||xe!=null){L.highlightFormatting&&(F.formatting=xe==null?"strong":Ae==null?"em":"strong em"),xe===!0&&(F.em=ge),Ae===!0&&(F.strong=ge);var Te=c(F);return xe===!1&&(F.em=!1),Ae===!1&&(F.strong=!1),Te}}else if(ge===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return c(F);z.backUp(1)}if(L.strikethrough){if(ge==="~"&&z.eatWhile(ge)){if(F.strikethrough){L.highlightFormatting&&(F.formatting="strikethrough");var Te=c(F);return F.strikethrough=!1,Te}else if(z.match(/^[^\s]/,!1))return F.strikethrough=!0,L.highlightFormatting&&(F.formatting="strikethrough"),c(F)}else if(ge===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return c(F);z.backUp(2)}}if(L.emoji&&ge===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){F.emoji=!0,L.highlightFormatting&&(F.formatting="emoji");var Ne=c(F);return F.emoji=!1,Ne}return ge===" "&&(z.match(/^ +$/,!1)?F.trailingSpace++:F.trailingSpace&&(F.trailingSpaceNewLine=!0)),c(F)}function a(z,F){var ne=z.next();if(ne===">"){F.f=F.inline=s,L.highlightFormatting&&(F.formatting="link");var ce=c(F);return ce?ce+=" ":ce="",ce+j.linkInline}return z.match(/^[^>]+/,!0),j.linkInline}function g(z,F){if(z.eatSpace())return null;var ne=z.next();return ne==="("||ne==="["?(F.f=F.inline=y(ne==="("?")":"]"),L.highlightFormatting&&(F.formatting="link-string"),F.linkHref=!0,c(F)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(z){return function(F,ne){var ce=F.next();if(ce===z){ne.f=ne.inline=s,L.highlightFormatting&&(ne.formatting="link-string");var ge=c(ne);return ne.linkHref=!1,ge}return F.match(p[z]),ne.linkHref=!0,c(ne)}}function P(z,F){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(F.f=G,z.next(),L.highlightFormatting&&(F.formatting="link"),F.linkText=!0,c(F)):l(z,F,s)}function G(z,F){if(z.match(/^\]:/,!0)){F.f=F.inline=Q,L.highlightFormatting&&(F.formatting="link");var ne=c(F);return F.linkText=!1,ne}return z.match(/^([^\]\\]|\\.)+/,!0),j.linkText}function Q(z,F){return z.eatSpace()?null:(z.match(/^[^\s]+/,!0),z.peek()===void 0?F.linkTitle=!0:z.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),F.f=F.inline=s,j.linkHref+" url")}var re={startState:function(){return{f,prevLine:{stream:null},thisLine:{stream:null},block:f,htmlState:null,indentation:0,inline:s,text:h,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&&ue.copyState(V,z.htmlState),indentation:z.indentation,localMode:z.localMode,localState:z.localMode?ue.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,F){if(F.formatting=!1,z!=F.thisLine.stream){if(F.header=0,F.hr=!1,z.match(/^\s*$/,!0))return m(F),null;if(F.prevLine=F.thisLine,F.thisLine={stream:z},F.taskList=!1,F.trailingSpace=0,F.trailingSpaceNewLine=!1,!F.localState&&(F.f=F.block,F.f!=D)){var ne=z.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(F.indentation=ne,F.indentationDiff=null,ne>0)return null}}return F.f(z,F)},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,F,ne){return z.block==D&&V.indent?V.indent(z.htmlState,F,ne):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,F,ne):ue.Pass},blankLine:m,getType:c,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return re},"xml"),ue.defineMIME("text/markdown","markdown"),ue.defineMIME("text/x-markdown","markdown")})},lzim:function(_e,Ie,q){"use strict";var ue=q("E7E6"),Y=q.n(ue);q.d(Ie,"w",function(){return Y.a});var L=q("/GNS"),V=q.n(L);q.d(Ie,"v",function(){return V.a});var _=q("FOrL"),k=q.n(_);q.d(Ie,"q",function(){return k.a});var j=q("HpTS"),U=q.n(j);q.d(Ie,"x",function(){return U.a});var O=q("tWlo"),I=q.n(O);q.d(Ie,"a",function(){return I.a});var v=q("7ZXX"),S=q.n(v);q.d(Ie,"l",function(){return S.a});var M=q("GABl"),w=q.n(M);q.d(Ie,"e",function(){return w.a});var A=q("onxn"),C=q.n(A);q.d(Ie,"n",function(){return C.a});var d=q("nKGa"),o=q.n(d);q.d(Ie,"m",function(){return o.a});var l=q("4qgm"),u=q.n(l);q.d(Ie,"y",function(){return u.a});var x=q("JeFH"),m=q.n(x);q.d(Ie,"b",function(){return m.a});var f=q("ji0R"),D=q.n(f);q.d(Ie,"i",function(){return D.a});var b=q("W6BS"),c=q.n(b);q.d(Ie,"z",function(){return c.a});var h=q("kPYp"),s=q.n(h);q.d(Ie,"A",function(){return s.a});var a=q("nukY"),g=q.n(a),p=q("4u4S"),y=q.n(p),P=q("yslc"),G=q.n(P),Q=q("l2Kq"),re=q.n(Q),z=q("RMFE"),F=q.n(z);q.d(Ie,"o",function(){return F.a});var ne=q("TGq3"),ce=q.n(ne),ge=q("SMhR"),be=q.n(ge),Be=q("8/bI"),Se=q.n(Be);q.d(Ie,"j",function(){return Se.a});var Le=q("JWDV"),Te=q.n(Le),we=q("Xsq0"),ve=q.n(we);q.d(Ie,"p",function(){return ve.a});var H=q("Ohmc"),T=q.n(H);q.d(Ie,"c",function(){return T.a});var R=q("csWT"),W=q.n(R);q.d(Ie,"d",function(){return W.a});var $=q("7v3h"),N=q.n($);q.d(Ie,"k",function(){return N.a});var de=q("cRFk"),xe=q.n(de);q.d(Ie,"u",function(){return xe.a});var Ae=q("kPWJ"),Ne=q.n(Ae);q.d(Ie,"t",function(){return Ne.a});var Me=q("qgvg"),Re=q.n(Me);q.d(Ie,"r",function(){return Re.a});var Pe=q("FPkq"),We=q.n(Pe);q.d(Ie,"s",function(){return We.a});var Qe=q("A/g1"),Ve=q.n(Qe);q.d(Ie,"f",function(){return Ve.a});var Ge=q("Nmxd"),at=q.n(Ge);q.d(Ie,"g",function(){return at.a});var Xe=q("5D2P"),Ze=q.n(Xe);q.d(Ie,"h",function(){return Ze.a});var De=q("djh8"),rt=q.n(De),qe=q("Jq4h"),oe=q.n(qe)},nKGa:function(_e,Ie,q){_e.exports=q.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(_e,Ie,q){_e.exports={icons:"icons___3O80F"}},nukY:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAA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zMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(_e,Ie,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";var Y=ue.Pos;function L(d,o){return d.line-o.line||d.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",k=new RegExp("<(/?)(["+V+"]["+_+"]*)","g");function j(d,o,l,u){this.line=o,this.ch=l,this.cm=d,this.text=d.getLine(o),this.min=u?Math.max(u.from,d.firstLine()):d.firstLine(),this.max=u?Math.min(u.to-1,d.lastLine()):d.lastLine()}function U(d,o){var l=d.cm.getTokenTypeAt(Y(d.line,o));return l&&/\btag\b/.test(l)}function O(d){return d.line>=d.max?void 0:(d.ch=0,d.text=d.cm.getLine(++d.line),!0)}function I(d){return d.line<=d.min?void 0:(d.text=d.cm.getLine(--d.line),d.ch=d.text.length,!0)}function v(d){for(;;){var o=d.text.indexOf(">",d.ch);if(o==-1){if(O(d))continue;return}if(!U(d,o+1)){d.ch=o+1;continue}var l=d.text.lastIndexOf("/",o),u=l>-1&&!/\S/.test(d.text.slice(l+1,o));return d.ch=o+1,u?"selfClose":"regular"}}function S(d){for(;;){var o=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(o==-1){if(I(d))continue;return}if(!U(d,o+1)){d.ch=o;continue}k.lastIndex=o,d.ch=o;var l=k.exec(d.text);if(l&&l.index==o)return l}}function M(d){for(;;){k.lastIndex=d.ch;var o=k.exec(d.text);if(!o){if(O(d))continue;return}if(!U(d,o.index+1)){d.ch=o.index+1;continue}return d.ch=o.index+o[0].length,o}}function w(d){for(;;){var o=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(o==-1){if(I(d))continue;return}if(!U(d,o+1)){d.ch=o;continue}var l=d.text.lastIndexOf("/",o),u=l>-1&&!/\S/.test(d.text.slice(l+1,o));return d.ch=o+1,u?"selfClose":"regular"}}function A(d,o){for(var l=[];;){var u=M(d),x,m=d.line,f=d.ch-(u?u[0].length:0);if(!u||!(x=v(d)))return;if(x=="selfClose")continue;if(u[1]){for(var D=l.length-1;D>=0;--D)if(l[D]==u[2]){l.length=D;break}if(D<0&&(!o||o==u[2]))return{tag:u[2],from:Y(m,f),to:Y(d.line,d.ch)}}else l.push(u[2])}}function C(d,o){for(var l=[];;){var u=w(d);if(!u)return;if(u=="selfClose"){S(d);continue}var x=d.line,m=d.ch,f=S(d);if(!f)return;if(f[1])l.push(f[2]);else{for(var D=l.length-1;D>=0;--D)if(l[D]==f[2]){l.length=D;break}if(D<0&&(!o||o==f[2]))return{tag:f[2],from:Y(d.line,d.ch),to:Y(x,m)}}}}ue.registerHelper("fold","xml",function(d,o){for(var l=new j(d,o.line,0);;){var u=M(l);if(!u||l.line!=o.line)return;var x=v(l);if(!x)return;if(!u[1]&&x!="selfClose"){var m=Y(l.line,l.ch),f=A(l,u[2]);return f&&L(f.from,m)>0?{from:m,to:f.from}:null}}}),ue.findMatchingTag=function(d,o,l){var u=new j(d,o.line,o.ch,l);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var x=v(u),m=x&&Y(u.line,u.ch),f=x&&S(u);if(!x||!f||L(u,o)>0)return;var D={from:Y(u.line,u.ch),to:m,tag:f[2]};return x=="selfClose"?{open:D,close:null,at:"open"}:f[1]?{open:C(u,f[2]),close:D,at:"close"}:(u=new j(d,m.line,m.ch,l),{open:D,close:A(u,f[2]),at:"open"})},ue.findEnclosingTag=function(d,o,l,u){for(var x=new j(d,o.line,o.ch,l);;){var m=C(x,u);if(!m)break;var f=new j(d,o.line,o.ch,l),D=A(f,m.tag);if(D)return{open:m,close:D}}},ue.scanForClosingTag=function(d,o,l,u){var x=new j(d,o.line,o.ch,u?{from:0,to:u}:null);return A(x,l)}})},p5ED:function(_e,Ie,q){"use strict";var ue=q("+L6B"),Y=q("2/Rp"),L=q("5Dmo"),V=q("3S7+"),_=q("k1fw"),k=q("9og8"),j=q("tJVT"),U=q("WmNS"),O=q.n(U),I=q("q1tI"),v=q.n(I),S=q("vHTk"),M=q.n(S),w=q("yEEn"),A=q("ZW9T"),C=q("1vsH"),d=q("V0Rq"),o=q("m3rI");Ie.a=function(l){var u,x,m,f,D,b,c,h=l.editOffice,s=h===void 0?"view":h,a=l.data,g=l.theme,p=l.type,y=l.filename,P=l.monacoEditor,G=l.className,Q=l.style,re=l.close,z=l.onClose,F=l.hasMask,ne=l.disabledDownload,ce=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ge=Object(j.a)(ce,2),be=ge[0],Be=ge[1],Se=Object(I.useState)(""),Le=Object(j.a)(Se,2),Te=Le[0],we=Le[1],ve=Object(I.useState)(),H=Object(j.a)(ve,2),T=H[0],R=H[1],W=window.ENV==="build"?"/react/build":"",$=o.a.PROXY_SERVER||location.origin,N,de=1024*1024,xe=10*de,Ae=Object(I.useRef)();(u=a)!==null&&u!==void 0&&u.startsWith("/api")&&p!=="txt"&&(a=(o.a.API_SERVER||location.origin)+a),p==="office"&&(N=Object(C.T)(a).filesize,N>xe&&(p="other")),y&&P&&(P.filename=y),Object(I.useEffect)(function(){var Pe,We,Qe=(Pe=document.cookie)===null||Pe===void 0||((We=Pe.replace(/\s/g,""))===null||We===void 0)?void 0:We.split(";");Qe==null||Qe.map(function(Ve){var Ge=Ve.split("=");Ge[0]==="_educoder_session"&&we(Ge[1])})},[]),Object(I.useEffect)(function(){p==="office"&&Ne()},[p,a]);var Ne=function(){var Pe=Object(k.a)(O.a.mark(function We(){var Qe,Ve,Ge;return O.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return console.log("data:",a),Qe=a,a.startsWith("http")||(Qe=location.origin+Qe),Ve=new URL(Qe).pathname.split("/").pop(),Xe.next=6,Object(d.V)({attachment_id:Ve});case 6:Ge=Xe.sent,R(Ge);case 8:case"end":return Xe.stop()}},We)}));return function(){return Pe.apply(this,arguments)}}(),Me=function(){if(a.startsWith("http")||a.startsWith("blob:")){Re();return}Object(C.z)(y||"educoder",a,y)},Re=function(){Object(C.x)(y||"educoder",decodeURIComponent(a))};return v.a.createElement("div",{style:Object(_.a)({},Q||{}),className:"".concat(F&&M.a.bgBlack," ").concat(p?M.a.wrp:"hide")},re&&v.a.createElement("div",{className:M.a.close,ref:Ae},!ne&&v.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ae.current}},v.a.createElement("span",{onClick:Re},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ae.current}},v.a.createElement("span",{className:"",onClick:z},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(M.a[G]," ").concat(G," ").concat(M.a.monaco," ").concat(p==="txt"?"show":"hide")},p==="txt"&&v.a.createElement(A.b,P)),p==="audio"&&v.a.createElement("audio",{src:"".concat(((x=a)===null||x===void 0?void 0:x.indexOf("http://"))>-1||((m=a)===null||m===void 0?void 0:m.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(a),autoPlay:!0}),p==="video"&&v.a.createElement(v.a.Fragment,null,((f=a)===null||f===void 0?void 0:f.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),p==="office"&&T&&v.a.createElement("iframe",{src:"".concat(W,"/office.html?key=").concat(T.key,"&url=").concat($+T.url,"&callbackUrl=").concat($+T.callbackUrl,"&fileType=").concat(T.fileType,"&title=").concat(T.title,"&model=").concat(s,"&officeServer=").concat(o.a.OFFICE_SERVER,"&disabledDownload=").concat(!!ne)}),p==="html"&&v.a.createElement("iframe",{src:a+"&disposition=inline"}),p==="pdf"&&v.a.createElement("iframe",{src:"".concat(W,"/js/pdfview/index.html?url=").concat(a,"&disabledDownload=").concat(!!ne)}),p==="image"&&v.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)}),p==="other"&&v.a.createElement("div",null,v.a.createElement(Y.a,{type:"primary",size:"large",onClick:Me},v.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),p==="download"&&v.a.createElement(Y.a,{type:"primary",size:"large",onClick:Me},v.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(_e,Ie,q){},qgvg:function(_e,Ie){_e.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9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&gt;",'"':"&quot;","'":"&#39;"},_=b=>V[b];function k(b,c){if(c){if(q.test(b))return b.replace(ue,_)}else if(Y.test(b))return b.replace(L,_);return b}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(b){return b.replace(j,(c,h)=>(h=h.toLowerCase(),h==="colon"?":":h.charAt(0)==="#"?h.charAt(1)==="x"?String.fromCharCode(parseInt(h.substring(2),16)):String.fromCharCode(+h.substring(1)):""))}const O=/(^|[^\[])\^/g;function I(b,c){b=b.source||b,c=c||"";const h={replace:(s,a)=>(a=a.source||a,a=a.replace(O,"$1"),b=b.replace(s,a),h),getRegex:()=>new RegExp(b,c)};return h}const v=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function M(b,c,h){if(b){let s;try{s=decodeURIComponent(U(h)).replace(v,"").toLowerCase()}catch(a){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}c&&!S.test(h)&&(h=o(c,h));try{h=encodeURI(h).replace(/%25/g,"%")}catch(s){return null}return h}const w={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(b,c){w[" "+b]||(A.test(b)?w[" "+b]=b+"/":w[" "+b]=m(b,"/",!0)),b=w[" "+b];const h=b.indexOf(":")===-1;return c.substring(0,2)==="//"?h?c:b.replace(C,"$1")+c:c.charAt(0)==="/"?h?c:b.replace(d,"$1")+c:b+c}const l={exec:function(){}};function u(b){let c=1,h,s;for(;c<arguments.length;c++){h=arguments[c];for(s in h)Object.prototype.hasOwnProperty.call(h,s)&&(b[s]=h[s])}return b}function x(b,c){const h=b.replace(/\|/g,(g,p,y)=>{let P=!1,G=p;for(;--G>=0&&y[G]==="\\";)P=!P;return P?"|":" |"}),s=h.split(/ \|/);let a=0;if(s.length>c)s.splice(c);else for(;s.length<c;)s.push("");for(;a<s.length;a++)s[a]=s[a].trim().replace(/\\\|/g,"|");return s}function m(b,c,h){const s=b.length;if(s===0)return"";let a=0;for(;a<s;){const g=b.charAt(s-a-1);if(g===c&&!h)a++;else if(g!==c&&h)a++;else break}return b.substr(0,s-a)}function f(b,c){if(b.indexOf(c[1])===-1)return-1;const h=b.length;let s=0,a=0;for(;a<h;a++)if(b[a]==="\\")a++;else if(b[a]===c[0])s++;else if(b[a]===c[1]&&(s--,s<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")}_e.exports={escape:k,unescape:U,edit:I,cleanUrl:M,resolveUrl:o,noopTest:l,merge:u,splitCells:x,rtrim:m,findClosingBracket:f,checkSanitizeDeprecation:D}},tWlo:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tL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ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(_e,Ie,q){typeof window!="undefined"&&function(Y,L){_e.exports=L()}(this,function(){return function(ue){var Y={};function L(V){if(Y[V])return Y[V].exports;var _=Y[V]={i:V,l:!1,exports:{}};return ue[V].call(_.exports,_,_.exports,L),_.l=!0,_.exports}return L.m=ue,L.c=Y,L.d=function(V,_,k){L.o(V,_)||Object.defineProperty(V,_,{enumerable:!0,get:k})},L.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},L.t=function(V,_){if(_&1&&(V=L(V)),_&8)return V;if(_&4&&typeof V=="object"&&V&&V.__esModule)return V;var k=Object.create(null);if(L.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:V}),_&2&&typeof V!="string")for(var j in V)L.d(k,j,function(U){return V[U]}.bind(null,j));return k},L.n=function(V){var _=V&&V.__esModule?function(){return V.default}:function(){return V};return L.d(_,"a",_),_},L.o=function(V,_){return Object.prototype.hasOwnProperty.call(V,_)},L.p="/dist/",L(L.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,Y,L){"use strict";var V=Object.prototype.hasOwnProperty,_="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(_=!1));function j(v,S,M){this.fn=v,this.context=S,this.once=M||!1}function U(v,S,M,w,A){if(typeof M!="function")throw new TypeError("The listener must be a function");var C=new j(M,w||v,A),d=_?_+S:S;return v._events[d]?v._events[d].fn?v._events[d]=[v._events[d],C]:v._events[d].push(C):(v._events[d]=C,v._eventsCount++),v}function O(v,S){--v._eventsCount===0?v._events=new k:delete v._events[S]}function I(){this._events=new k,this._eventsCount=0}I.prototype.eventNames=function(){var S=[],M,w;if(this._eventsCount===0)return S;for(w in M=this._events)V.call(M,w)&&S.push(_?w.slice(1):w);return Object.getOwnPropertySymbols?S.concat(Object.getOwnPropertySymbols(M)):S},I.prototype.listeners=function(S){var M=_?_+S:S,w=this._events[M];if(!w)return[];if(w.fn)return[w.fn];for(var A=0,C=w.length,d=new Array(C);A<C;A++)d[A]=w[A].fn;return d},I.prototype.listenerCount=function(S){var M=_?_+S:S,w=this._events[M];return w?w.fn?1:w.length:0},I.prototype.emit=function(S,M,w,A,C,d){var o=_?_+S:S;if(!this._events[o])return!1;var l=this._events[o],u=arguments.length,x,m;if(l.fn){l.once&&this.removeListener(S,l.fn,void 0,!0);switch(u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,M),!0;case 3:return l.fn.call(l.context,M,w),!0;case 4:return l.fn.call(l.context,M,w,A),!0;case 5:return l.fn.call(l.context,M,w,A,C),!0;case 6:return l.fn.call(l.context,M,w,A,C,d),!0}for(m=1,x=new Array(u-1);m<u;m++)x[m-1]=arguments[m];l.fn.apply(l.context,x)}else{var f=l.length,D;for(m=0;m<f;m++){l[m].once&&this.removeListener(S,l[m].fn,void 0,!0);switch(u){case 1:l[m].fn.call(l[m].context);break;case 2:l[m].fn.call(l[m].context,M);break;case 3:l[m].fn.call(l[m].context,M,w);break;case 4:l[m].fn.call(l[m].context,M,w,A);break;default:if(!x)for(D=1,x=new Array(u-1);D<u;D++)x[D-1]=arguments[D];l[m].fn.apply(l[m].context,x)}}}return!0},I.prototype.on=function(S,M,w){return U(this,S,M,w,!1)},I.prototype.once=function(S,M,w){return U(this,S,M,w,!0)},I.prototype.removeListener=function(S,M,w,A){var C=_?_+S:S;if(!this._events[C])return this;if(!M)return O(this,C),this;var d=this._events[C];if(d.fn)d.fn===M&&(!A||d.once)&&(!w||d.context===w)&&O(this,C);else{for(var o=0,l=[],u=d.length;o<u;o++)(d[o].fn!==M||A&&!d[o].once||w&&d[o].context!==w)&&l.push(d[o]);l.length?this._events[C]=l.length===1?l[0]:l:O(this,C)}return this},I.prototype.removeAllListeners=function(S){var M;return S?(M=_?_+S:S,this._events[M]&&O(this,M)):(this._events=new k,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=_,I.EventEmitter=I,ue.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(ue,Y,L){(function(V){var _=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,k=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O={buildAbsoluteURL:function(I,v,S){if(S=S||{},I=I.trim(),v=v.trim(),!v){if(!S.alwaysNormalize)return I;var M=O.parseURL(I);if(!M)throw new Error("Error trying to parse base URL.");return M.path=O.normalizePath(M.path),O.buildURLFromParts(M)}var w=O.parseURL(v);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)):v;var A=O.parseURL(I);if(!A)throw new Error("Error trying to parse base URL.");if(!A.netLoc&&A.path&&A.path[0]!=="/"){var C=k.exec(A.path);A.netLoc=C[1],A.path=C[2]}A.netLoc&&!A.path&&(A.path="/");var d={scheme:A.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(d.netLoc=A.netLoc,w.path[0]!=="/"))if(!w.path)d.path=A.path,w.params||(d.params=A.params,w.query||(d.query=A.query));else{var o=A.path,l=o.substring(0,o.lastIndexOf("/")+1)+w.path;d.path=O.normalizePath(l)}return d.path===null&&(d.path=S.alwaysNormalize?O.normalizePath(w.path):w.path),O.buildURLFromParts(d)},parseURL:function(I){var v=_.exec(I);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(j,"");I.length!==(I=I.replace(U,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};ue.exports=O})(this)},"./node_modules/webworkify-webpack/index.js":function(ue,Y,L){function V(S){var M={};function w(C){if(M[C])return M[C].exports;var d=M[C]={i:C,l:!1,exports:{}};return S[C].call(d.exports,d,d.exports,w),d.l=!0,d.exports}w.m=S,w.c=M,w.i=function(C){return C},w.d=function(C,d,o){w.o(C,d)||Object.defineProperty(C,d,{configurable:!1,enumerable:!0,get:o})},w.r=function(C){Object.defineProperty(C,"__esModule",{value:!0})},w.n=function(C){var d=C&&C.__esModule?function(){return C.default}:function(){return C};return w.d(d,"a",d),d},w.o=function(C,d){return Object.prototype.hasOwnProperty.call(C,d)},w.p="/",w.oe=function(C){throw console.error(C),C};var A=w(w.s=ENTRY_MODULE);return A.default||A}var _="[\\.|\\-|\\+|\\w|/|@]+",k="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+_+").*?\\)";function j(S){return(S+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(S){return!isNaN(1*S)}function O(S,M,w){var A={};A[w]=[];var C=M.toString(),d=C.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!d)return A;for(var o=d[1],l=new RegExp("(\\\\n|\\W)"+j(o)+k,"g"),u;u=l.exec(C);){if(u[3]==="dll-reference")continue;A[w].push(u[3])}for(l=new RegExp("\\("+j(o)+'\\("(dll-reference\\s('+_+'))"\\)\\)'+k,"g");u=l.exec(C);)S[u[2]]||(A[w].push(u[1]),S[u[2]]=L(u[1]).m),A[u[2]]=A[u[2]]||[],A[u[2]].push(u[4]);for(var x=Object.keys(A),m=0;m<x.length;m++)for(var f=0;f<A[x[m]].length;f++)U(A[x[m]][f])&&(A[x[m]][f]=1*A[x[m]][f]);return A}function I(S){var M=Object.keys(S);return M.reduce(function(w,A){return w||S[A].length>0},!1)}function v(S,M){for(var w={main:[M]},A={main:[]},C={main:{}};I(w);)for(var d=Object.keys(w),o=0;o<d.length;o++){var l=d[o],u=w[l],x=u.pop();if(C[l]=C[l]||{},C[l][x]||!S[l][x])continue;C[l][x]=!0,A[l]=A[l]||[],A[l].push(x);for(var m=O(S,S[l][x],l),f=Object.keys(m),D=0;D<f.length;D++)w[f[D]]=w[f[D]]||[],w[f[D]]=w[f[D]].concat(m[f[D]])}return A}ue.exports=function(S,M){M=M||{};var w={main:L.m},A=M.all?{main:Object.keys(w.main)}:v(w,S),C="";Object.keys(A).filter(function(x){return x!=="main"}).forEach(function(x){for(var m=0;A[x][m];)m++;A[x].push(m),w[x][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",C=C+"var "+x+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+A[x].map(function(f){return""+JSON.stringify(f)+": "+w[x][f].toString()}).join(",")+`});
`}),C=C+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+A.main.map(function(x){return""+JSON.stringify(x)+": "+w.main[x].toString()}).join(",")+"}))(self);";var d=new window.Blob([C],{type:"text/javascript"});if(M.bare)return d;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,l=o.createObjectURL(d),u=new window.Worker(l);return u.objectURL=l,u}},"./src/config.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"hlsDefaultConfig",function(){return D}),L.d(Y,"mergeConfig",function(){return c}),L.d(Y,"enableStreamingMode",function(){return h});var V=L("./src/controller/abr-controller.ts"),_=L("./src/controller/audio-stream-controller.ts"),k=L("./src/controller/audio-track-controller.ts"),j=L("./src/controller/subtitle-stream-controller.ts"),U=L("./src/controller/subtitle-track-controller.ts"),O=L("./src/controller/buffer-controller.ts"),I=L("./src/controller/timeline-controller.ts"),v=L("./src/controller/cap-level-controller.ts"),S=L("./src/controller/fps-controller.ts"),M=L("./src/controller/eme-controller.ts"),w=L("./src/controller/cmcd-controller.ts"),A=L("./src/utils/xhr-loader.ts"),C=L("./src/utils/fetch-loader.ts"),d=L("./src/utils/cues.ts"),o=L("./src/utils/mediakeys-helper.ts"),l=L("./src/utils/logger.ts");function u(){return u=Object.assign||function(s){for(var a=1;a<arguments.length;a++){var g=arguments[a];for(var p in g)Object.prototype.hasOwnProperty.call(g,p)&&(s[p]=g[p])}return s},u.apply(this,arguments)}function x(s,a){var g=Object.keys(s);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(s);a&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(s,y).enumerable})),g.push.apply(g,p)}return g}function m(s){for(var a=1;a<arguments.length;a++){var g=arguments[a]!=null?arguments[a]:{};a%2?x(Object(g),!0).forEach(function(p){f(s,p,g[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(g)):x(Object(g)).forEach(function(p){Object.defineProperty(s,p,Object.getOwnPropertyDescriptor(g,p))})}return s}function f(s,a,g){return a in s?Object.defineProperty(s,a,{value:g,enumerable:!0,configurable:!0,writable:!0}):s[a]=g,s}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:v.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:j.SubtitleStreamController,subtitleTrackController:U.default,timelineController:I.TimelineController,audioStreamController:_.default,audioTrackController:k.default,emeController:M.default,cmcdController:w.default});function b(){return{cueHandler:d.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(s,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return u({},s,a)}function h(s){var a=s.loader;if(a!==C.default&&a!==A.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var g=Object(C.fetchSupported)();g&&(s.loader=C.default,s.progressive=!0,s.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/polyfills/number.ts"),_=L("./src/utils/ewma-bandwidth-estimator.ts"),k=L("./src/events.ts"),j=L("./src/utils/buffer-helper.ts"),U=L("./src/errors.ts"),O=L("./src/types/loader.ts"),I=L("./src/utils/logger.ts");function v(w,A){for(var C=0;C<A.length;C++){var d=A[C];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(w,d.key,d)}}function S(w,A,C){return A&&v(w.prototype,A),C&&v(w,C),w}var M=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 d=C.config;this.bwEstimator=new _.default(d.abrEwmaSlowVoD,d.abrEwmaFastVoD,d.abrEwmaDefaultEstimate),this.registerListeners()}var A=w.prototype;return A.registerListeners=function(){var d=this.hls;d.on(k.Events.FRAG_LOADING,this.onFragLoading,this),d.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(k.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var d=this.hls;d.off(k.Events.FRAG_LOADING,this.onFragLoading,this),d.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(k.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(d,o){var l=o.frag;if(l.type===O.PlaylistLevelType.MAIN&&!this.timer){var u;this.fragCurrent=l,this.partCurrent=(u=o.part)!=null?u:null,this.timer=self.setInterval(this.onCheck,100)}},A.onLevelLoaded=function(d,o){var l=this.hls.config;o.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},A._abandonRulesCheck=function(){var d=this.fragCurrent,o=this.partCurrent,l=this.hls,u=l.autoLevelEnabled,x=l.config,m=l.media;if(!d||!m)return;var f=o?o.stats:d.stats,D=o?o.duration:d.duration;if(f.aborted){I.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()-f.loading.start,c=Math.abs(m.playbackRate);if(b<=500*D/c)return;var h=l.levels,s=l.minAutoLevel,a=h[d.level],g=f.total||Math.max(f.loaded,Math.round(D*a.maxBitrate/8)),p=Math.max(1,f.bwEstimate?f.bwEstimate/8:f.loaded*1e3/b),y=(g-f.loaded)/p,P=m.currentTime,G=(j.BufferHelper.bufferInfo(m,P,x.maxBufferHole).end-P)/c;if(G>=2*D/c||y<=G)return;var Q=Number.POSITIVE_INFINITY,re;for(re=d.level-1;re>s;re--){var z=h[re].maxBitrate;if(Q=D*z/(8*.8*p),Q<G)break}if(Q>=y)return;var F=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+d.sn+(o?" part "+o.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+re+`
Current BW estimate: `+(Object(V.isFiniteNumber)(F)?(F/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+y.toFixed(3)+` s
Estimated load time for the next fragment: `+Q.toFixed(3)+` s
Time to underbuffer: `+G.toFixed(3)+" s"),l.nextLoadLevel=re,this.bwEstimator.sample(b,f.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),l.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:o,stats:f})},A.onFragLoaded=function(d,o){var l=o.frag,u=o.part;if(l.type===O.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(l.sn)){var x=u?u.stats:l.stats,m=u?u.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var f=this.hls.levels[l.level],D=(f.loaded?f.loaded.bytes:0)+x.loaded,b=(f.loaded?f.loaded.duration:0)+m;f.loaded={bytes:D,duration:b},f.realBitrate=Math.round(8*D/b)}if(l.bitrateTest){var c={stats:x,frag:l,part:u,id:l.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,c),l.bitrateTest=!1}}},A.onFragBuffered=function(d,o){var l=o.frag,u=o.part,x=u?u.stats:l.stats;if(x.aborted)return;if(l.type!==O.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var m=x.parsing.end-x.loading.start;this.bwEstimator.sample(m,x.loaded),x.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},A.onError=function(d,o){switch(o.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},A.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},A.getNextABRAutoLevel=function(){var d=this.fragCurrent,o=this.partCurrent,l=this.hls,u=l.maxAutoLevel,x=l.config,m=l.minAutoLevel,f=l.media,D=o?o.duration:d?d.duration:0,b=f?f.currentTime:0,c=f&&f.playbackRate!==0?Math.abs(f.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():x.abrEwmaDefaultEstimate,s=(j.BufferHelper.bufferInfo(f,b,x.maxBufferHole).end-b)/c,a=this.findBestLevel(h,m,u,s,x.abrBandWidthFactor,x.abrBandWidthUpFactor);if(a>=0)return a;I.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=D?Math.min(D,x.maxStarvationDelay):x.maxStarvationDelay,p=x.abrBandWidthFactor,y=x.abrBandWidthUpFactor;if(!s){var P=this.bitrateTestDelay;if(P){var G=D?Math.min(D,x.maxLoadingDelay):x.maxLoadingDelay;g=G-P,I.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),p=y=1}}return a=this.findBestLevel(h,m,u,s+g,p,y),Math.max(a,0)},A.findBestLevel=function(d,o,l,u,x,m){for(var f,D=this.fragCurrent,b=this.partCurrent,c=this.lastLoadedFragLevel,h=this.hls.levels,s=h[c],a=!!(s!=null&&(f=s.details)!==null&&f!==void 0&&f.live),g=s==null?void 0:s.codecSet,p=b?b.duration:D?D.duration:0,y=l;y>=o;y--){var P=h[y];if(!P||g&&P.codecSet!==g)continue;var G=P.details,Q=(b?G==null?void 0:G.partTarget:G==null?void 0:G.averagetargetduration)||p,re=void 0;y<=c?re=x*d:re=m*d;var z=h[y].maxBitrate,F=z*Q/re;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(re)+"/"+z+"/"+Q+"/"+u+"/"+F),re>z&&(!F||a&&!this.bitrateTestDelay||F<u))return y}return-1},S(w,[{key:"nextAutoLevel",get:function(){var d=this._nextAutoLevel,o=this.bwEstimator;if(d!==-1&&(!o||!o.canEstimate()))return d;var l=this.getNextABRAutoLevel();return d!==-1&&(l=Math.min(d,l)),l},set:function(d){this._nextAutoLevel=d}}]),w}();Y.default=M},"./src/controller/audio-stream-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/polyfills/number.ts"),_=L("./src/controller/base-stream-controller.ts"),k=L("./src/events.ts"),j=L("./src/utils/buffer-helper.ts"),U=L("./src/controller/fragment-tracker.ts"),O=L("./src/types/level.ts"),I=L("./src/types/loader.ts"),v=L("./src/loader/fragment.ts"),S=L("./src/demux/chunk-cache.ts"),M=L("./src/demux/transmuxer-interface.ts"),w=L("./src/types/transmuxer.ts"),A=L("./src/controller/fragment-finders.ts"),C=L("./src/utils/discontinuities.ts"),d=L("./src/errors.ts"),o=L("./src/utils/logger.ts");function l(){return l=Object.assign||function(D){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(D[h]=c[h])}return D},l.apply(this,arguments)}function u(D,b){D.prototype=Object.create(b.prototype),D.prototype.constructor=D,x(D,b)}function x(D,b){return x=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},x(D,b)}var m=100,f=function(D){u(b,D);function b(h,s){var a;return a=D.call(this,h,s,"[audio-stream-controller]")||this,a.videoBuffer=null,a.videoTrackCC=-1,a.waitingVideoCC=-1,a.audioSwitch=!1,a.trackId=-1,a.waitingData=null,a.mainDetails=null,a.bufferFlushed=!1,a._registerListeners(),a}var c=b.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var s=this.hls;s.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(k.Events.ERROR,this.onError,this),s.on(k.Events.BUFFER_RESET,this.onBufferReset,this),s.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c._unregisterListeners=function(){var s=this.hls;s.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(k.Events.ERROR,this.onError,this),s.off(k.Events.BUFFER_RESET,this.onBufferReset,this),s.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c.onInitPtsFound=function(s,a){var g=a.frag,p=a.id,y=a.initPTS;if(p==="main"){var P=g.cc;this.initPTS[g.cc]=y,this.log("InitPTS for cc: "+P+" found from main: "+y),this.videoTrackCC=P,this.state===_.State.WAITING_INIT_PTS&&this.tick()}},c.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=_.State.STOPPED;return}var a=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,a>0&&s===-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=s,this.tick()},c.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_TRACK:{var s,a=this.levels,g=this.trackId,p=a==null||((s=a[g])===null||s===void 0)?void 0:s.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=_.State.WAITING_INIT_PTS}break}case _.State.FRAG_LOADING_WAITING_RETRY:{var y,P=performance.now(),G=this.retryDate;(!G||P>=G||(y=this.media)!==null&&y!==void 0&&y.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,F=Q.cache,ne=Q.complete;if(this.initPTS[re.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.FRAG_LOADING;var ce=F.flush(),ge={frag:re,part:z,payload:ce,networkDetails:null};this._handleFragmentLoadProgress(ge),ne&&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 be=this.getLoadPosition(),Be=j.BufferHelper.bufferInfo(this.mediaBuffer,be,this.config.maxBufferHole),Se=Object(A.fragmentWithinToleranceTest)(Be.end,this.config.maxFragLookUpTolerance,re);Se<0&&(o.logger.log("Waiting fragment cc ("+re.cc+") @ "+re.start+" cancelled because another fragment at "+Be.end+" is needed"),this.clearWaitingFragment())}}else this.state=_.State.IDLE}}this.onTickEnd()},c.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=_.State.IDLE)},c.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:s,g=a.buffered;!this.loadedmetadata&&g.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},c.doTickIdle=function(){var s,a,g=this.hls,p=this.levels,y=this.media,P=this.trackId,G=g.config;if(!p||!p[P])return;if(!y&&(this.startFragRequested||!G.startFragPrefetch))return;var Q=p[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,v.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(z===null)return;var F=z.len,ne=this.getMaxBufferLength(),ce=this.audioSwitch;if(F>=ne&&!ce)return;if(!ce&&this._streamEnded(z,re)){g.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=_.State.ENDED;return}var ge=re.fragments,be=ge[0].start,Be=z.end;if(ce){var Se=this.getLoadPosition();Be=Se,re.PTSKnown&&Se<be&&((z.end>be||z.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=be+.05))}var Le=this.getNextFragment(Be,re);if(!Le){this.bufferFlushed=!0;return}((s=Le.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((a=Le.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Le,re):this.loadFragment(Le,re,Be)},c.getMaxBufferLength=function(){var s=D.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return a===null?s:Math.max(s,a.len)},c.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},c.onAudioTracksUpdated=function(s,a){var g=a.audioTracks;this.resetTransmuxer(),this.levels=g.map(function(p){return new O.Level(p)})},c.onAudioTrackSwitching=function(s,a){var g=!!a.url;this.trackId=a.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),g?this.setInterval(m):this.resetTransmuxer(),g?(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(s,a){this.mainDetails=a.details},c.onAudioTrackLoaded=function(s,a){var g,p=this.levels,y=a.details,P=a.id;if(!p){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var G=p[P],Q=0;if(y.live||(g=G.details)!==null&&g!==void 0&&g.live){var re=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!re)return;!G.details&&y.hasProgramDateTime&&re.hasProgramDateTime?(Object(C.alignMediaPlaylistByPDT)(y,re),Q=y.fragments[0].start):Q=this.alignPlaylists(y,G.details)}G.details=y,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(G.details,Q),this.state===_.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=_.State.IDLE),this.tick()},c._handleFragmentLoadProgress=function(s){var a,g=s.frag,p=s.part,y=s.payload,P=this.config,G=this.trackId,Q=this.levels;if(!Q){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var re=Q[G];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 F=P.defaultAudioCodec||re.audioCodec||"mp4a.40.2",ne=this.transmuxer;ne||(ne=this.transmuxer=new M.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ce=this.initPTS[g.cc],ge=(a=g.initSegment)===null||a===void 0?void 0:a.data;if(ce!==void 0){var be=!1,Be=p?p.index:-1,Se=Be!==-1,Le=new w.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,y.byteLength,Be,Se);ne.push(y,ge,F,"",g,p,z.totalduration,be,Le,ce)}else{o.logger.log("Unknown video PTS for cc "+g.cc+", waiting for video PTS before demuxing audio frag "+g.sn+" of ["+z.startSN+" ,"+z.endSN+"],track "+G);var Te=this.waitingData=this.waitingData||{frag:g,part:p,cache:new S.default,complete:!1},we=Te.cache;we.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=_.State.WAITING_INIT_PTS}},c._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,s)},c.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},c.onBufferCreated=function(s,a){var g=a.tracks.audio;g&&(this.mediaBuffer=g.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},c.onFragBuffered=function(s,a){var g=a.frag,p=a.part;if(g.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(p?" p: "+p.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}g.sn!=="initSegment"&&(this.fragPrevious=g,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(g,p)},c.onError=function(s,a){switch(a.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,a);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.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 d.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var g=!0,p=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);p&&p.len>.5&&(g=!this.reduceMaxBufferLength(p.len)),g&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},c.onBufferFlushed=function(s,a){var g=a.type;g===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},c._handleTransmuxComplete=function(s){var a,g="audio",p=this.hls,y=s.remuxResult,P=s.chunkMeta,G=this.getCurrentContext(P);if(!G){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=G.frag,re=G.part,z=y.audio,F=y.text,ne=y.id3,ce=y.initSegment;if(this.fragContextChanged(Q))return;if(this.state=_.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),ce!=null&&ce.tracks&&(this._bufferInitSegment(ce.tracks,Q,P),p.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:Q,id:g,tracks:ce.tracks})),z){var ge=z.startPTS,be=z.endPTS,Be=z.startDTS,Se=z.endDTS;re&&(re.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ge,endPTS:be,startDTS:Be,endDTS:Se}),Q.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ge,be,Be,Se),this.bufferFragmentData(z,Q,re,P)}if(ne!=null&&(a=ne.samples)!==null&&a!==void 0&&a.length){var Le=l({frag:Q,id:g},ne);p.trigger(k.Events.FRAG_PARSING_METADATA,Le)}if(F){var Te=l({frag:Q,id:g},F);p.trigger(k.Events.FRAG_PARSING_USERDATA,Te)}},c._bufferInitSegment=function(s,a,g){if(this.state!==_.State.PARSING)return;s.video&&delete s.video;var p=s.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(k.Events.BUFFER_CODECS,s);var y=p.initSegment;if(y!=null&&y.byteLength){var P={type:"audio",frag:a,part:null,chunkMeta:g,parent:a.type,data:y};this.hls.trigger(k.Events.BUFFER_APPENDING,P)}this.tick()},c.loadFragment=function(s,a,g){var p=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||p===U.FragmentState.NOT_LOADED||p===U.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):a.live&&!Object(V.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=_.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,s,a,g)))},c.completeAudioSwitch=function(){var s=this.hls,a=this.media,g=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:g})},b}(_.default);Y.default=f},"./src/controller/audio-track-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/events.ts"),_=L("./src/errors.ts"),k=L("./src/controller/base-playlist-controller.ts"),j=L("./src/types/loader.ts");function U(M,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(M,C.key,C)}}function O(M,w,A){return w&&U(M.prototype,w),A&&U(M,A),M}function I(M,w){M.prototype=Object.create(w.prototype),M.prototype.constructor=M,v(M,w)}function v(M,w){return v=Object.setPrototypeOf||function(C,d){return C.__proto__=d,C},v(M,w)}var S=function(M){I(w,M);function w(C){var d;return d=M.call(this,C,"[audio-track-controller]")||this,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.trackName="",d.selectDefaultTrack=!0,d.registerListeners(),d}var A=w.prototype;return A.registerListeners=function(){var d=this.hls;d.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(V.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var d=this.hls;d.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(V.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,M.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(d,o){this.tracks=o.audioTracks||[]},A.onAudioTrackLoaded=function(d,o){var l=o.id,u=o.details,x=this.tracksInGroup[l];if(!x){this.warn("Invalid audio track id "+l);return}var m=x.details;x.details=o.details,this.log("audioTrack "+l+" loaded ["+u.startSN+"-"+u.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,o,m))},A.onLevelLoading=function(d,o){this.switchLevel(o.level)},A.onLevelSwitching=function(d,o){this.switchLevel(o.level)},A.switchLevel=function(d){var o=this.hls.levels[d];if(!(o!=null&&o.audioGroupIds))return;var l=o.audioGroupIds[o.urlId];if(this.groupId!==l){this.groupId=l;var u=this.tracks.filter(function(m){return!l||m.groupId===l});this.selectDefaultTrack&&!u.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=u;var x={audioTracks:u};this.log("Updating audio tracks, "+u.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,x),this.selectInitialTrack()}},A.onError=function(d,o){if(M.prototype.onError.call(this,d,o),o.fatal||!o.context)return;o.context.type===j.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},A.setAudioTrack=function(d){var o=this.tracksInGroup;if(d<0||d>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=o[this.trackId];this.log("Now switching to audio-track index "+d);var u=o[d],x=u.id,m=u.groupId,f=m===void 0?"":m,D=u.name,b=u.type,c=u.url;if(this.trackId=d,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:x,groupId:f,name:D,type:b,url:c}),u.details&&!u.details.live)return;var h=this.switchParams(u.url,l==null?void 0:l.details);this.loadPlaylist(h)},A.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,l=this.findTrackId(o)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},A.findTrackId=function(d){for(var o=this.tracksInGroup,l=0;l<o.length;l++){var u=o[l];if((!this.selectDefaultTrack||u.default)&&(!d||d===u.name))return u.id}return-1},A.loadPlaylist=function(d){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var l=o.id,u=o.groupId,x=o.url;if(d)try{x=d.addDirectives(x)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:x,id:l,groupId:u,deliveryDirectives:d||null})}},O(w,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1,this.setAudioTrack(d)}}]),w}(k.default);Y.default=S},"./src/controller/base-playlist-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return O});var V=L("./src/polyfills/number.ts"),_=L("./src/types/level.ts"),k=L("./src/controller/level-helper.ts"),j=L("./src/utils/logger.ts"),U=L("./src/errors.ts"),O=function(){function I(S,M){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,M+":"),this.warn=j.logger.warn.bind(j.logger,M+":"),this.hls=S}var v=I.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(M,w){w.fatal&&w.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(M,w){var A=w==null?void 0:w.renditionReports;if(A)for(var C=0;C<A.length;C++){var d=A[C],o=""+d.URI;if(o===M.substr(-o.length)){var l=parseInt(d["LAST-MSN"]),u=parseInt(d["LAST-PART"]);if(w&&this.hls.config.lowLatencyMode){var x=Math.min(w.age-w.partTarget,w.targetduration);u!==void 0&&x>w.partTarget&&(u+=1)}if(Object(V.isFiniteNumber)(l))return new _.HlsUrlParameters(l,Object(V.isFiniteNumber)(u)?u:void 0,_.HlsSkip.No)}}},v.loadPlaylist=function(M){},v.shouldLoadTrack=function(M){return this.canLoad&&M&&!!M.url&&(!M.details||M.details.live)},v.playlistLoaded=function(M,w,A){var C=this,d=w.details,o=w.stats,l=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(d.advancedDateTime=Date.now()-l,d.live||A!=null&&A.live){if(d.reloaded(A),A&&this.log("live playlist "+M+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),A&&d.fragments.length>0&&Object(k.mergeDetails)(A,d),!this.canLoad||!d.live)return;var u,x=void 0,m=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var f=this.hls.config.lowLatencyMode,D=d.lastPartSn,b=d.endSN,c=d.lastPartIndex,h=c!==-1,s=D===b,a=f?0:c;h?(x=s?b+1:D,m=s?a:c+1):x=b+1;var g=d.age,p=g+d.ageHeader,y=Math.min(p-d.partTarget,d.targetduration*1.5);if(y>0){if(A&&y>A.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+A.tuneInGoal+" to: "+y+" with playlist age: "+d.age),y=0;else{var P=Math.floor(y/d.targetduration);if(x+=P,m!==void 0){var G=Math.round(y%d.targetduration/d.partTarget);m+=G}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+y+" skip sn "+P+" to part "+m)}d.tuneInGoal=y}if(u=this.getDeliveryDirectives(d,w.deliveryDirectives,x,m),f||!s){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(d,w.deliveryDirectives,x,m);var Q=Object(k.computeReloadInterval)(d,o);x!==void 0&&d.canBlockReload&&(Q-=d.partTarget||1),this.log("reload live playlist "+M+" in "+Math.round(Q)+" ms"),this.timer=self.setTimeout(function(){return C.loadPlaylist(u)},Q)}else this.clearTimer()},v.getDeliveryDirectives=function(M,w,A,C){var d=Object(_.getSkipValue)(M,A);return w!=null&&w.skip&&M.deltaUpdateFailed&&(A=w.msn,C=w.part,d=_.HlsSkip.No),new _.HlsUrlParameters(A,C,d)},v.retryLoadingOrFail=function(M){var w=this,A=this.hls.config,C=this.retryCount<A.levelLoadingMaxRetry;if(C){var d;if(this.retryCount++,M.details.indexOf("LoadTimeOut")>-1&&(d=M.context)!==null&&d!==void 0&&d.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+M.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 "'+M.details+'"')}}else this.warn('cannot recover from error "'+M.details+'"'),this.clearTimer(),M.fatal=!0;return C},I}()},"./src/controller/base-stream-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"State",function(){return b}),L.d(Y,"default",function(){return c});var V=L("./src/polyfills/number.ts"),_=L("./src/task-loop.ts"),k=L("./src/controller/fragment-tracker.ts"),j=L("./src/utils/buffer-helper.ts"),U=L("./src/utils/logger.ts"),O=L("./src/events.ts"),I=L("./src/errors.ts"),v=L("./src/types/transmuxer.ts"),S=L("./src/utils/mp4-tools.ts"),M=L("./src/utils/discontinuities.ts"),w=L("./src/controller/fragment-finders.ts"),A=L("./src/controller/level-helper.ts"),C=L("./src/loader/fragment-loader.ts"),d=L("./src/crypt/decrypter.ts"),o=L("./src/utils/time-ranges.ts"),l=L("./src/types/loader.ts");function u(h,s){for(var a=0;a<s.length;a++){var g=s[a];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function x(h,s,a){return s&&u(h.prototype,s),a&&u(h,a),h}function m(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function f(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,D(h,s)}function D(h,s){return D=Object.setPrototypeOf||function(g,p){return g.__proto__=p,g},D(h,s)}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(h){f(s,h);function s(g,p,y){var P;return P=h.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=y,P.log=U.logger.log.bind(U.logger,y+":"),P.warn=U.logger.warn.bind(U.logger,y+":"),P.hls=g,P.fragmentLoader=new C.default(g.config),P.fragmentTracker=p,P.config=g.config,P.decrypter=new d.default(g,g.config),g.on(O.Events.KEY_LOADED,P.onKeyLoaded,m(P)),P}var a=s.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(p){},a.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=b.STOPPED},a._streamEnded=function(p,y){var P=this.fragCurrent,G=this.fragmentTracker;if(!y.live&&P&&P.sn===y.endSN&&!p.nextStart){var Q=G.getState(P);return Q===k.FragmentState.PARTIAL||Q===k.FragmentState.OK}return!1},a.onMediaAttached=function(p,y){var P=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var G=this.config;this.levels&&G.autoStartLoad&&this.state===b.STOPPED&&this.startLoad(G.startPosition)},a.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},a.onMediaSeeking=function(){var p=this.config,y=this.fragCurrent,P=this.media,G=this.mediaBuffer,Q=this.state,re=P?P.currentTime:0,z=j.BufferHelper.bufferInfo(G||P,re,p.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(re)?re.toFixed(3):re)+", state: "+Q),Q===b.ENDED)this.resetLoadingState();else if(y&&!z.len){var F=p.maxFragLookUpTolerance,ne=y.start-F,ce=y.start+y.duration+F,ge=re>ce;(re<ne||ge)&&(ge&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.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(p,y){if(this.state!==b.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=b.IDLE;var P=this.levels[y.frag.level].details;P&&this.loadFragment(y.frag,P,y.frag.start)},a.onHandlerDestroying=function(){this.stopLoad(),h.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,h.prototype.onHandlerDestroyed.call(this)},a.loadKey=function(p,y){this.log("Loading key for "+p.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=b.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(O.Events.KEY_LOADING,{frag:p})},a.loadFragment=function(p,y,P){this._loadFragForPlayback(p,y,P)},a._loadFragForPlayback=function(p,y,P){var G=this,Q=function(z){if(G.fragContextChanged(p)){G.warn("Fragment "+p.sn+(z.part?" p: "+z.part.index:"")+" of level "+p.level+" was dropped during download."),G.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,G._handleFragmentLoadProgress(z)};this._doFragLoad(p,y,P,Q).then(function(re){if(!re)return;G.fragLoadError=0;var z=G.state;if(G.fragContextChanged(p)){(z===b.FRAG_LOADING||z===b.BACKTRACKING||!G.fragCurrent&&z===b.PARSING)&&(G.fragmentTracker.removeFragment(p),G.state=b.IDLE);return}if("payload"in re&&(G.log("Loaded fragment "+p.sn+" of level "+p.level),G.hls.trigger(O.Events.FRAG_LOADED,re),G.state===b.BACKTRACKING)){G.fragmentTracker.backtrack(p,re),G.resetFragmentLoading(p);return}G._handleFragmentLoadComplete(re)}).catch(function(re){G.warn(re),G.resetFragmentLoading(p)})},a.flushMainBuffer=function(p,y,P){if(P===void 0&&(P=null),!(p-y))return;var G={startOffset:p,endOffset:y,type:P};this.fragLoadError=0,this.hls.trigger(O.Events.BUFFER_FLUSHING,G)},a._loadInitSegment=function(p){var y=this;this._doFragLoad(p).then(function(P){if(!P||y.fragContextChanged(p)||!y.levels)throw new Error("init load aborted");return P}).then(function(P){var G=y.hls,Q=P.payload,re=p.decryptdata;if(Q&&Q.byteLength>0&&re&&re.key&&re.iv&&re.method==="AES-128"){var z=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(Q),re.key.buffer,re.iv.buffer).then(function(F){var ne=self.performance.now();return G.trigger(O.Events.FRAG_DECRYPTED,{frag:p,payload:F,stats:{tstart:z,tdecrypt:ne}}),P.payload=F,P})}return P}).then(function(P){var G=y.fragCurrent,Q=y.hls,re=y.levels;if(!re)throw new Error("init load aborted, missing levels");var z=re[p.level].details;console.assert(z,"Level details are defined when init segment is loaded");var F=p.stats;y.state=b.IDLE,y.fragLoadError=0,p.data=new Uint8Array(P.payload),F.parsing.start=F.buffering.start=self.performance.now(),F.parsing.end=F.buffering.end=self.performance.now(),P.frag===G&&Q.trigger(O.Events.FRAG_BUFFERED,{stats:F,frag:G,part:null,id:p.type}),y.tick()}).catch(function(P){y.warn(P),y.resetFragmentLoading(p)})},a.fragContextChanged=function(p){var y=this.fragCurrent;return!p||!y||p.level!==y.level||p.sn!==y.sn||p.urlId!==y.urlId},a.fragBufferedComplete=function(p,y){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+o.default.toString(j.BufferHelper.getBuffered(P))),this.state=b.IDLE,this.tick()},a._handleFragmentLoadComplete=function(p){var y=this.transmuxer;if(!y)return;var P=p.frag,G=p.part,Q=p.partsLoaded,re=!Q||Q.length===0||Q.some(function(F){return!F}),z=new v.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,G?G.index:-1,!re);y.flush(z)},a._handleFragmentLoadProgress=function(p){},a._doFragLoad=function(p,y,P,G){var Q=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(p.start,P||0),this.config.lowLatencyMode&&y){var re=y.partList;if(re&&G){P>p.end&&y.fragmentHint&&(p=y.fragmentHint);var z=this.getNextPart(re,p,P);if(z>-1){var F=re[z];return this.log("Loading part sn: "+p.sn+" p: "+F.index+" cc: "+p.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+z+"-"+(re.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=F.start+F.duration,this.state=b.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:p,part:re[z],targetBufferTime:P}),this.doFragPartsLoad(p,re,z,G).catch(function(ne){return Q.handleFragLoadError(ne)})}else if(!p.url||this.loadedEndOfParts(re,P))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(P.toFixed(3))),Object(V.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=b.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:p,targetBufferTime:P}),this.fragmentLoader.load(p,G).catch(function(ne){return Q.handleFragLoadError(ne)})},a.doFragPartsLoad=function(p,y,P,G){var Q=this;return new Promise(function(re,z){var F=[],ne=function ce(ge){var be=y[ge];Q.fragmentLoader.loadPart(p,be,G).then(function(Be){F[be.index]=Be;var Se=Be.part;Q.hls.trigger(O.Events.FRAG_LOADED,Be);var Le=y[ge+1];if(Le&&Le.fragment===p)ce(ge+1);else return re({frag:p,part:Se,partsLoaded:F})}).catch(z)};ne(P)})},a.handleFragLoadError=function(p){var y=p.data;return y&&y.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(O.Events.ERROR,y),null},a._handleTransmuxerFlush=function(p){var y=this.getCurrentContext(p);if(!y||this.state!==b.PARSING){this.fragCurrent||(this.state=b.IDLE);return}var P=y.frag,G=y.part,Q=y.level,re=self.performance.now();P.stats.parsing.end=re,G&&(G.stats.parsing.end=re),this.updateLevelTiming(P,G,Q,p.partial)},a.getCurrentContext=function(p){var y=this.levels,P=p.level,G=p.sn,Q=p.part;if(!y||!y[P])return this.warn("Levels object was unset while buffering fragment "+G+" of level "+P+". The current chunk will not be buffered."),null;var re=y[P],z=Q>-1?Object(A.getPartWith)(re,G,Q):null,F=z?z.fragment:Object(A.getFragmentWithSN)(re,G,this.fragCurrent);return F?{frag:F,part:z,level:re}:null},a.bufferFragmentData=function(p,y,P,G){if(!p||this.state!==b.PARSING)return;var Q=p.data1,re=p.data2,z=Q;if(Q&&re&&(z=Object(S.appendUint8Array)(Q,re)),!z||!z.length)return;var F={type:p.type,frag:y,part:P,chunkMeta:G,parent:y.type,data:z};this.hls.trigger(O.Events.BUFFER_APPENDING,F),p.dropped&&p.independent&&!P&&this.flushBufferGap(y)},a.flushBufferGap=function(p){var y=this.media;if(!y)return;if(!j.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,p.start);return}var P=y.currentTime,G=j.BufferHelper.bufferInfo(y,P,0),Q=p.duration,re=Math.min(this.config.maxFragLookUpTolerance*2,Q*.25),z=Math.max(Math.min(p.start-re,G.end-re),P+re);p.start-z>re&&this.flushMainBuffer(z,p.start)},a.getFwdBufferInfo=function(p,y){var P=this.config,G=this.getLoadPosition();if(!Object(V.isFiniteNumber)(G))return null;var Q=j.BufferHelper.bufferInfo(p,G,P.maxBufferHole);if(Q.len===0&&Q.nextStart!==void 0){var re=this.fragmentTracker.getBufferedFrag(G,y);if(re&&Q.nextStart<re.end)return j.BufferHelper.bufferInfo(p,G,Math.max(Q.nextStart,P.maxBufferHole))}return Q},a.getMaxBufferLength=function(p){var y=this.config,P;return p?P=Math.max(8*y.maxBufferSize/p,y.maxBufferLength):P=y.maxBufferLength,Math.min(P,y.maxMaxBufferLength)},a.reduceMaxBufferLength=function(p){var y=this.config,P=p||y.maxBufferLength;return y.maxMaxBufferLength>=P?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(p,y){var P,G,Q=y.fragments,re=Q.length;if(!re)return null;var z=this.config,F=Q[0].start,ne;if(y.live){var ce=z.initialLiveManifestSize;if(re<ce)return this.warn("Not enough fragments to start playback (have: "+re+", need: "+ce+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(ne=this.getInitialLiveFragment(y,Q),this.startPosition=ne?this.hls.liveSyncPosition||ne.start:p)}else p<=F&&(ne=Q[0]);if(!ne){var ge=z.lowLatencyMode?y.partEnd:y.fragmentEnd;ne=this.getFragmentAtPosition(p,ge,y)}return(P=ne)!==null&&P!==void 0&&P.initSegment&&!((G=ne)!==null&&G!==void 0&&G.initSegment.data)&&!this.bitrateTest&&(ne=ne.initSegment),ne},a.getNextPart=function(p,y,P){for(var G=-1,Q=!1,re=!0,z=0,F=p.length;z<F;z++){var ne=p[z];if(re=re&&!ne.independent,G>-1&&P<ne.start)break;var ce=ne.loaded;!ce&&(Q||ne.independent||re)&&ne.fragment===y&&(G=z),Q=ce}return G},a.loadedEndOfParts=function(p,y){var P=p[p.length-1];return P&&y>P.start&&P.loaded},a.getInitialLiveFragment=function(p,y){var P=this.fragPrevious,G=null;if(P){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),G=Object(w.findFragmentByPDT)(y,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!G){var Q=P.sn+1;if(Q>=p.startSN&&Q<=p.endSN){var re=y[Q-p.startSN];P.cc===re.cc&&(G=re,this.log("Live playlist, switching playlist, load frag with next SN: "+G.sn))}G||(G=Object(w.findFragWithCC)(y,P.cc),G&&this.log("Live playlist, switching playlist, load frag with same CC: "+G.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(G=this.getFragmentAtPosition(z,this.bitrateTest?p.fragmentEnd:p.edge,p))}return G},a.getFragmentAtPosition=function(p,y,P){var G=this.config,Q=this.fragPrevious,re=P.fragments,z=P.endSN,F=P.fragmentHint,ne=G.maxFragLookUpTolerance,ce=!!(G.lowLatencyMode&&P.partList&&F);ce&&F&&!this.bitrateTest&&(re=re.concat(F),z=F.sn);var ge;if(p<y){var be=p>y-ne?0:ne;ge=Object(w.findFragmentByPTS)(Q,re,p,be)}else ge=re[re.length-1];if(ge){var Be=ge.sn-P.startSN,Se=Q&&ge.level===Q.level,Le=re[Be+1],Te=this.fragmentTracker.getState(ge);if(Te===k.FragmentState.BACKTRACKED){ge=null;for(var we=Be;re[we]&&this.fragmentTracker.getState(re[we])===k.FragmentState.BACKTRACKED;)Q?ge=re[we--]:ge=re[--we];ge||(ge=Le)}else Q&&ge.sn===Q.sn&&!ce&&(Se&&(ge.sn<z&&this.fragmentTracker.getState(Le)!==k.FragmentState.OK?(this.log("SN "+ge.sn+" just loaded, load next one: "+Le.sn),ge=Le):ge=null))}return ge},a.synchronizeToLiveEdge=function(p){var y=this.config,P=this.media;if(!P)return;var G=this.hls.liveSyncPosition,Q=P.currentTime,re=p.fragments[0].start,z=p.edge,F=Q>=re-y.maxFragLookUpTolerance&&Q<=z;if(G!==null&&P.duration>G&&(Q<G||!F)){var ne=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*p.targetduration;(!F&&P.readyState<4||Q<z-ne)&&(this.loadedmetadata||(this.nextLoadPosition=G),P.readyState&&(this.warn("Playback: "+Q.toFixed(3)+" is located too far from the end of live sliding playlist: "+z+", reset currentTime to : "+G.toFixed(3)),P.currentTime=G))}},a.alignPlaylists=function(p,y){var P=this.levels,G=this.levelLastLoaded,Q=this.fragPrevious,re=G!==null?P[G]:null,z=p.fragments.length;if(!z)return this.warn("No fragments in live playlist"),0;var F=p.fragments[0].start,ne=!y,ce=p.alignedSliding&&Object(V.isFiniteNumber)(F);if(ne||!ce&&!F){Object(M.alignStream)(Q,re,p);var ge=p.fragments[0].start;return this.log("Live playlist sliding: "+ge.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+p.startSN+" prev-sn: "+(Q?Q.sn:"na")+" fragments: "+z),ge}return F},a.waitForCdnTuneIn=function(p){var y=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*y)},a.setStartPosition=function(p,y){var P=this.startPosition;if(P<y&&(P=-1),P===-1||this.lastCurrentTime===-1){var G=p.startTimeOffset;Object(V.isFiniteNumber)(G)?(P=y+G,G<0&&(P+=p.totalduration),P=Math.min(Math.max(y,P),y+p.totalduration),this.log("Start time offset "+G+" found in playlist, adjust startPosition to "+P),this.startPosition=P):p.live?P=this.hls.liveSyncPosition||y:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},a.getLoadPosition=function(){var p=this.media,y=0;return this.loadedmetadata&&p?y=p.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},a.handleFragLoadAborted=function(p,y){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(y?" part"+y.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},a.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=b.IDLE)},a.onFragmentOrKeyLoadError=function(p,y){if(y.fatal)return;var P=y.frag;if(!P||P.type!==p)return;var G=this.fragCurrent;console.assert(G&&P.sn===G.sn&&P.level===G.level&&P.urlId===G.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 "+p+" "+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 y.levelRetry?(p===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=b.IDLE):(U.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=b.ERROR)},a.afterBufferFlushed=function(p,y,P){if(!p)return;var G=j.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(y,G,P),this.state===b.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=b.IDLE},a.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[p].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},a.updateLevelTiming=function(p,y,P,G){var Q=this,re=P.details;console.assert(!!re,"level.details must be defined");var z=Object.keys(p.elementaryStreams).reduce(function(F,ne){var ce=p.elementaryStreams[ne];if(ce){var ge=ce.endPTS-ce.startPTS;if(ge<=0)return Q.warn("Could not parse fragment "+p.sn+" "+ne+" duration reliably ("+ge+") resetting transmuxer to fallback to playlist timing"),Q.resetTransmuxer(),F||!1;var be=G?0:Object(A.updateFragPTSDTS)(re,p,ce.startPTS,ce.endPTS,ce.startDTS,ce.endDTS);return Q.hls.trigger(O.Events.LEVEL_PTS_UPDATED,{details:re,level:P,drift:be,type:ne,frag:p,start:ce.startPTS,end:ce.endPTS}),!0}return F},!1);z?(this.state=b.PARSED,this.hls.trigger(O.Events.FRAG_PARSED,{frag:p,part:y})):this.resetLoadingState()},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},x(s,[{key:"state",get:function(){return this._state},set:function(p){var y=this._state;y!==p&&(this._state=p,this.log(y+"->"+p))}}]),s}(_.default)},"./src/controller/buffer-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return w});var V=L("./src/polyfills/number.ts"),_=L("./src/events.ts"),k=L("./src/utils/logger.ts"),j=L("./src/errors.ts"),U=L("./src/utils/buffer-helper.ts"),O=L("./src/utils/mediasource-helper.ts"),I=L("./src/loader/fragment.ts"),v=L("./src/controller/buffer-operation-queue.ts"),S=Object(O.getMediaSource)(),M=/([ha]vc.)(?:\.[^.,]+)+/,w=function(){function A(d){var o=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var l=o.hls,u=o.media,x=o.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),u&&(o.updateMediaElementDuration(),l.trigger(_.Events.MEDIA_ATTACHED,{media:u})),x&&x.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){k.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){k.logger.log("[buffer-controller]: Media source ended")},this.hls=d,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 v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},C.onManifestParsed=function(o,l){var u=2;(l.audio&&!l.video||!l.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},C.onMediaAttaching=function(o,l){var u=this.media=l.media;if(u&&S){var x=this.mediaSource=new S;x.addEventListener("sourceopen",this._onMediaSourceOpen),x.addEventListener("sourceended",this._onMediaSourceEnded),x.addEventListener("sourceclose",this._onMediaSourceClose),u.src=self.URL.createObjectURL(x),this._objectUrl=u.src}},C.onMediaDetaching=function(){var o=this.media,l=this.mediaSource,u=this._objectUrl;if(l){if(k.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(x){k.logger.warn("[buffer-controller]: onMediaDetaching: "+x.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(u&&self.URL.revokeObjectURL(u),o.src===u?(o.removeAttribute("src"),o.load()):k.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(l){var u=o.sourceBuffer[l];try{u&&(o.removeBufferListeners(l),o.mediaSource&&o.mediaSource.removeSourceBuffer(u),o.sourceBuffer[l]=void 0)}catch(x){k.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",x)}}),this._initSourceBuffer()},C.onBufferCodecs=function(o,l){var u=this,x=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(m){if(x){var f=u.tracks[m];if(f&&typeof f.buffer.changeType=="function"){var D=l[m],b=D.codec,c=D.levelCodec,h=D.container,s=(f.levelCodec||f.codec).replace(M,"$1"),a=(c||b).replace(M,"$1");if(s!==a){var g=h+";codecs="+(c||b);u.appendChangeType(m,g)}}}else u.pendingTracks[m]=l[m]}),x)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},C.appendChangeType=function(o,l){var u=this,x=this.operationQueue,m={execute:function(){var D=u.sourceBuffer[o];D&&(k.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+l),D.changeType(l)),x.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(D){k.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",D)}};x.append(m,o)},C.onBufferAppending=function(o,l){var u=this,x=this.hls,m=this.operationQueue,f=this.tracks,D=l.data,b=l.type,c=l.frag,h=l.part,s=l.chunkMeta,a=s.buffering[b],g=self.performance.now();a.start=g;var p=c.stats.buffering,y=h?h.stats.buffering:null;p.start===0&&(p.start=g),y&&y.start===0&&(y.start=g);var P=f.audio,G=b==="audio"&&s.id===1&&(P==null?void 0:P.container)==="audio/mpeg",Q={execute:function(){if(a.executeStart=self.performance.now(),G){var z=u.sourceBuffer[b];if(z){var F=c.start-z.timestampOffset;Math.abs(F)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+c.start+" (delta: "+F+") 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,p.first===0&&(p.first=z),y&&y.first===0&&(y.first=z);var F=u.sourceBuffer,ne={};for(var ce in F)ne[ce]=U.BufferHelper.getBuffered(F[ce]);u.appendError=0,u.hls.trigger(_.Events.BUFFER_APPENDED,{type:b,frag:c,part:h,chunkMeta:s,parent:c.type,timeRanges:ne})},onError:function(z){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+b+" SourceBuffer",z);var F={type:j.ErrorTypes.MEDIA_ERROR,parent:c.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?F.details=j.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,F.details=j.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>x.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+x.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),F.fatal=!0)),x.trigger(_.Events.ERROR,F)}};m.append(Q,b)},C.onBufferFlushing=function(o,l){var u=this,x=this.operationQueue,m=function(D){return{execute:u.removeExecutor.bind(u,D,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(_.Events.BUFFER_FLUSHED,{type:D})},onError:function(c){k.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",c)}}};l.type?x.append(m(l.type),l.type):this.getSourceBufferTypes().forEach(function(f){x.append(m(f),f)})},C.onFragParsed=function(o,l){var u=this,x=l.frag,m=l.part,f=[],D=m?m.elementaryStreams:x.elementaryStreams;D[I.ElementaryStreamTypes.AUDIOVIDEO]?f.push("audiovideo"):(D[I.ElementaryStreamTypes.AUDIO]&&f.push("audio"),D[I.ElementaryStreamTypes.VIDEO]&&f.push("video"));var b=function(){var h=self.performance.now();x.stats.buffering.end=h,m&&(m.stats.buffering.end=h);var s=m?m.stats:x.stats;u.hls.trigger(_.Events.FRAG_BUFFERED,{frag:x,part:m,stats:s,id:x.type})};f.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+x.type+" level: "+x.level+" sn: "+x.sn),this.blockBuffers(b,f)},C.onFragChanged=function(o,l){this.flushBackBuffer()},C.onBufferEos=function(o,l){var u=this,x=this.getSourceBufferTypes().reduce(function(m,f){var D=u.sourceBuffer[f];return(!l.type||l.type===f)&&(D&&!D.ended&&(D.ended=!0,k.logger.log("[buffer-controller]: "+f+" sourceBuffer now EOS"))),m&&!!(!D||D.ended)},!0);x&&this.blockBuffers(function(){var m=u.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},C.onLevelUpdated=function(o,l){var u=l.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,l=this.details,u=this.media,x=this.sourceBuffer;if(!u||l===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var f=l.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(V.isFiniteNumber)(f)||f<0)return;var D=u.currentTime,b=l.levelTargetDuration,c=Math.max(f,b),h=Math.floor(D/b)*b-c;m.forEach(function(s){var a=x[s];if(a){var g=U.BufferHelper.getBuffered(a);g.length>0&&h>g.start(0)&&(o.trigger(_.Events.BACK_BUFFER_REACHED,{bufferEnd:h}),l.live&&o.trigger(_.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h}),o.trigger(_.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:h,type:s}))}})},C.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,l=this.hls,u=this.media,x=this.mediaSource,m=o.fragments[0].start+o.totalduration,f=u.duration,D=Object(V.isFiniteNumber)(x.duration)?x.duration:0;o.live&&l.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),x.duration=Infinity,this.updateSeekableRange(o)):(m>D&&m>f||!Object(V.isFiniteNumber)(f))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),x.duration=m)},C.updateSeekableRange=function(o){var l=this.mediaSource,u=o.fragments,x=u.length;if(x&&o.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var m=Math.max(0,u[0].start),f=Math.max(m,m+o.totalduration);l.setLiveSeekableRange(m,f)}},C.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,l=this.operationQueue,u=this.pendingTracks,x=Object.keys(u).length;if(x&&!o||x===2){this.createSourceBuffers(u),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(_.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(f){l.executeNext(f)})}},C.createSourceBuffers=function(o){var l=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var x=0;for(var m in o)if(!l[m]){var f=o[m];if(!f)throw Error("source buffer exists for track "+m+", however track does not");var D=f.levelCodec||f.codec,b=f.container+";codecs="+D;k.logger.log("[buffer-controller]: creating sourceBuffer("+b+")");try{var c=l[m]=u.addSourceBuffer(b),h=m;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.tracks[m]={buffer:c,codec:D,container:f.container,levelCodec:f.levelCodec,id:f.id},x++}catch(s){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(_.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:b})}}x&&this.hls.trigger(_.Events.BUFFER_CREATED,{tracks:this.tracks})},C._onSBUpdateStart=function(o){var l=this.operationQueue,u=l.current(o);u.onStart()},C._onSBUpdateEnd=function(o){var l=this.operationQueue,u=l.current(o);u.onComplete(),l.shiftAndExecuteNext(o)},C._onSBUpdateError=function(o,l){k.logger.error("[buffer-controller]: "+o+" SourceBuffer error",l),this.hls.trigger(_.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(o);u&&u.onError(l)},C.removeExecutor=function(o,l,u){var x=this.media,m=this.mediaSource,f=this.operationQueue,D=this.sourceBuffer,b=D[o];if(!x||!m||!b){k.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(o);return}var c=Object(V.isFiniteNumber)(x.duration)?x.duration:Infinity,h=Object(V.isFiniteNumber)(m.duration)?m.duration:Infinity,s=Math.max(0,l),a=Math.min(u,c,h);a>s?(k.logger.log("[buffer-controller]: Removing ["+s+","+a+"] from the "+o+" SourceBuffer"),console.assert(!b.updating,o+" sourceBuffer must not be updating"),b.remove(s,a)):f.shiftAndExecuteNext(o)},C.appendExecutor=function(o,l){var u=this.operationQueue,x=this.sourceBuffer,m=x[l];if(!m){k.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(l);return}m.ended=!1,console.assert(!m.updating,l+" sourceBuffer must not be updating"),m.appendBuffer(o)},C.blockBuffers=function(o,l){var u=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var x=this.operationQueue,m=l.map(function(f){return x.appendBlocker(f)});Promise.all(m).then(function(){o(),l.forEach(function(f){var D=u.sourceBuffer[f];(!D||!D.updating)&&x.shiftAndExecuteNext(f)})})},C.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},C.addBufferListener=function(o,l,u){var x=this.sourceBuffer[o];if(!x)return;var m=u.bind(this,o);this.listeners[o].push({event:l,listener:m}),x.addEventListener(l,m)},C.removeBufferListeners=function(o){var l=this.sourceBuffer[o];if(!l)return;this.listeners[o].forEach(function(u){l.removeEventListener(u.event,u.listener)})},A}()},"./src/controller/buffer-operation-queue.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return _});var V=L("./src/utils/logger.ts"),_=function(){function k(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var j=k.prototype;return j.append=function(O,I){var v=this.queues[I];v.push(O),v.length===1&&this.buffers[I]&&this.executeNext(I)},j.insertAbort=function(O,I){var v=this.queues[I];v.unshift(O),this.executeNext(I)},j.appendBlocker=function(O){var I,v=new Promise(function(M){I=M}),S={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(S,O),v},j.executeNext=function(O){var I=this.buffers,v=this.queues,S=I[O],M=v[O];if(M.length){var w=M[0];try{w.execute()}catch(A){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),w.onError(A),(!S||!S.updating)&&(M.shift(),this.executeNext(O))}}},j.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},j.current=function(O){return this.queues[O][0]},k}()},"./src/controller/cap-level-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/events.ts");function _(U,O){for(var I=0;I<O.length;I++){var v=O[I];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(U,v.key,v)}}function k(U,O,I){return O&&_(U.prototype,O),I&&_(U,I),U}var j=function(){function U(I){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=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var O=U.prototype;return O.setStreamController=function(v){this.streamController=v},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 v=this.hls;v.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.unregisterListener=function(){var v=this.hls;v.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.onFpsDropLevelCapping=function(v,S){U.isLevelAllowed(S.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(S.droppedLevel)},O.onMediaAttaching=function(v,S){this.media=S.media instanceof HTMLVideoElement?S.media:null},O.onManifestParsed=function(v,S){var M=this.hls;this.restrictedLevels=[],this.firstLevel=S.firstLevel,M.config.capLevelToPlayerSize&&S.video&&this.startCapping()},O.onBufferCodecs=function(v,S){var M=this.hls;M.config.capLevelToPlayerSize&&S.video&&this.startCapping()},O.onMediaDetaching=function(){this.stopCapping()},O.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var S=this.hls;S.autoLevelCapping=this.getMaxLevel(v.length-1),S.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=S.autoLevelCapping}}},O.getMaxLevel=function(v){var S=this,M=this.hls.levels;if(!M.length)return-1;var w=M.filter(function(A,C){return U.isLevelAllowed(C,S.restrictedLevels)&&C<=v});return this.clientRect=null,U.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 v=this.media,S={width:0,height:0};if(v){var M=v.getBoundingClientRect();S.width=M.width,S.height=M.height,!S.width&&!S.height&&(S.width=M.right-M.left||v.width||0,S.height=M.bottom-M.top||v.height||0)}return this.clientRect=S,S},U.isLevelAllowed=function(v,S){return S===void 0&&(S=[]),S.indexOf(v)===-1},U.getMaxLevelByMediaSize=function(v,S,M){if(!v||!v.length)return-1;for(var w=function(l,u){return u?l.width!==u.width||l.height!==u.height:!0},A=v.length-1,C=0;C<v.length;C+=1){var d=v[C];if((d.width>=S||d.height>=M)&&w(d,v[C+1])){A=C;break}}return A},k(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(S){}return v}}]),U}();Y.default=j},"./src/controller/cmcd-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return w});var V=L("./src/events.ts"),_=L("./src/types/cmcd.ts"),k=L("./src/utils/buffer-helper.ts"),j=L("./src/utils/logger.ts");function U(A,C){for(var d=0;d<C.length;d++){var o=C[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(A,o.key,o)}}function O(A,C,d){return C&&U(A.prototype,C),d&&U(A,d),A}function I(A,C){var d=typeof Symbol!="undefined"&&A[Symbol.iterator]||A["@@iterator"];if(d)return(d=d.call(A)).next.bind(d);if(Array.isArray(A)||(d=v(A))||C&&A&&typeof A.length=="number"){d&&(A=d);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 v(A,C){if(!A)return;if(typeof A=="string")return S(A,C);var d=Object.prototype.toString.call(A).slice(8,-1);if(d==="Object"&&A.constructor&&(d=A.constructor.name),d==="Map"||d==="Set")return Array.from(A);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return S(A,C)}function S(A,C){(C==null||C>A.length)&&(C=A.length);for(var d=0,o=new Array(C);d<C;d++)o[d]=A[d];return o}function M(){return M=Object.assign||function(A){for(var C=1;C<arguments.length;C++){var d=arguments[C];for(var o in d)Object.prototype.hasOwnProperty.call(d,o)&&(A[o]=d[o])}return A},M.apply(this,arguments)}var w=function(){function A(d){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(x){try{o.apply(x,{ot:_.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(m){j.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(x){try{var m=x.frag,f=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=f.bitrate/1e3,b.tb=o.getTopBandwidth(D),b.bl=o.getBufferLength(D)),o.apply(x,b)}catch(c){j.logger.warn("Could not generate segment CMCD data.",c)}},this.hls=d;var l=this.config=d.config,u=l.cmcd;u!=null&&(l.pLoader=this.createPlaylistLoader(),l.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,l){this.media=l.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,l){var u,x;this.audioBuffer=(u=l.tracks.audio)===null||u===void 0?void 0:u.buffer,this.videoBuffer=(x=l.tracks.video)===null||x===void 0?void 0:x.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,l){l===void 0&&(l={}),M(l,this.createData());var u=l.ot===_.CMCDObjectType.INIT||l.ot===_.CMCDObjectType.VIDEO||l.ot===_.CMCDObjectType.MUXED;if(this.starved&&u&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var x=A.toHeaders(l);if(!Object.keys(x).length)return;o.headers||(o.headers={}),M(o.headers,x)}else{var m=A.toQuery(l);if(!m)return;o.url=A.appendQueryToUri(o.url,m)}},C.getObjectType=function(o){var l=o.type;return l==="subtitle"?_.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?_.CMCDObjectType.INIT:l==="audio"?_.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?_.CMCDObjectType.VIDEO:_.CMCDObjectType.MUXED:void 0},C.getTopBandwidth=function(o){for(var l=0,u=o===_.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,x=I(u),m;!(m=x()).done;){var f=m.value;f.bitrate>l&&(l=f.bitrate)}return l>0?l:NaN},C.getBufferLength=function(o){var l=this.hls.media,u=o===_.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!l)return NaN;var x=k.BufferHelper.bufferInfo(u,l.currentTime,this.config.maxBufferHole);return x.len*1e3},C.createPlaylistLoader=function(){var o=this.config.pLoader,l=this.applyPlaylistData,u=o||this.config.loader;return function(){function x(f){this.loader=void 0,this.loader=new u(f)}var m=x.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(D,b,c){l(D),this.loader.load(D,b,c)},O(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},C.createFragmentLoader=function(){var o=this.config.fLoader,l=this.applyFragmentData,u=o||this.config.loader;return function(){function x(f){this.loader=void 0,this.loader=new u(f)}var m=x.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(D,b,c){l(D),this.loader.load(D,b,c)},O(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},A.uuid=function(){var o=URL.createObjectURL(new Blob),l=o.toString();return URL.revokeObjectURL(o),l.substr(l.lastIndexOf("/")+1)},A.serialize=function(o){for(var l=[],u=function(G){return!Number.isNaN(G)&&G!=null&&G!==""&&G!==!1},x=function(G){return Math.round(G)},m=function(G){return x(G/100)*100},f=function(G){return encodeURIComponent(G)},D={br:x,d:x,bl:m,dl:m,mtp:m,nor:f,rtp:m,tb:x},b=Object.keys(o||{}).sort(),c=I(b),h;!(h=c()).done;){var s=h.value,a=o[s];if(!u(a))continue;if(s==="v"&&a===1)continue;if(s=="pr"&&a===1)continue;var g=D[s];g&&(a=g(a));var p=typeof a,y=void 0;s==="ot"||s==="sf"||s==="st"?y=s+"="+a:p==="boolean"?y=s:p==="number"?y=s+"="+a:y=s+"="+JSON.stringify(a),l.push(y)}return l.join(",")},A.toHeaders=function(o){for(var l=Object.keys(o),u={},x=["Object","Request","Session","Status"],m=[{},{},{},{}],f={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=l;D<b.length;D++){var c=b[D],h=f[c]!=null?f[c]:1;m[h][c]=o[c]}for(var s=0;s<m.length;s++){var a=A.serialize(m[s]);a&&(u["CMCD-"+x[s]]=a)}return u},A.toQuery=function(o){return"CMCD="+encodeURIComponent(A.serialize(o))},A.appendQueryToUri=function(o,l){if(!l)return o;var u=o.includes("?")?"&":"?";return""+o+u+l},A}()},"./src/controller/eme-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/events.ts"),_=L("./src/errors.ts"),k=L("./src/utils/logger.ts"),j=L("./src/utils/mediakeys-helper.ts");function U(w,A){for(var C=0;C<A.length;C++){var d=A[C];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(w,d.key,d)}}function O(w,A,C){return A&&U(w.prototype,A),C&&U(w,C),w}var I=3,v=function(A,C,d){var o={audioCapabilities:[],videoCapabilities:[]};return A.forEach(function(l){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:d.audioRobustness||""})}),C.forEach(function(l){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:d.videoRobustness||""})}),[o]},S=function(A,C,d,o){switch(A){case j.KeySystems.WIDEVINE:return v(C,d,o);default:throw new Error("Unknown key-system: "+A)}},M=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(d){switch(d){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+d+'"')},A._attemptKeySystemAccess=function(d,o,l){var u=this,x=S(d,o,l,this._drmSystemOptions);k.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(d,x);this.mediaKeysPromise=m.then(function(f){return u._onMediaKeySystemAccessObtained(d,f)}),m.catch(function(f){k.logger.error('Failed to obtain key-system "'+d+'" access:',f)})},A._onMediaKeySystemAccessObtained=function(d,o){var l=this;k.logger.log('Access for key-system "'+d+'" obtained');var u={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:d};this._mediaKeysList.push(u);var x=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(m){return u.mediaKeys=m,k.logger.log('Media-keys created for key-system "'+d+'"'),l._onMediaKeysCreated(),m});return x.catch(function(m){k.logger.error("Failed to create media-keys:",m)}),x},A._onMediaKeysCreated=function(){var d=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),d._onNewMediaKeySession(o.mediaKeysSession))})},A._onNewMediaKeySession=function(d){var o=this;k.logger.log("New key-system session "+d.sessionId),d.addEventListener("message",function(l){o._onKeySessionMessage(d,l.message)},!1)},A._onKeySessionMessage=function(d,o){k.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(l){k.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),d.update(l)})},A.onMediaEncrypted=function(d){var o=this;if(k.logger.log('Media is encrypted using "'+d.initDataType+'" init data type'),!this.mediaKeysPromise){k.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 l=function(x){if(!o._media)return;o._attemptSetMediaKeys(x),o._generateRequestWithPreferredKeySession(d.initDataType,d.initData)};this.mediaKeysPromise.then(l).catch(l)},A._attemptSetMediaKeys=function(d){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){k.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}k.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},A._generateRequestWithPreferredKeySession=function(d,o){var l=this,u=this._mediaKeysList[0];if(!u){k.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){k.logger.warn("Key-Session already initialized but requested again");return}var x=u.mediaKeysSession;if(!x){k.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){k.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}k.logger.log('Generating key-session request for "'+d+'" init data type'),u.mediaKeysSessionInitialized=!0,x.generateRequest(d,o).then(function(){k.logger.debug("Key-session generation succeeded")}).catch(function(m){k.logger.error("Error generating key-session request:",m),l.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},A._createLicenseXhr=function(d,o,l){var u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,u,d,o,l);var x=this._licenseXhrSetup;if(x)try{x.call(this.hls,u,d),x=void 0}catch(m){k.logger.error(m)}try{u.readyState||u.open("POST",d,!0),x&&x.call(this.hls,u,d)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return u},A._onLicenseRequestReadyStageChange=function(d,o,l,u){switch(d.readyState){case 4:if(d.status===200){this._requestLicenseFailureCount=0,k.logger.log("License request succeeded");var x=d.response,m=this._licenseResponseCallback;if(m)try{x=m.call(this.hls,d,o)}catch(D){k.logger.error(D)}u(x)}else{if(k.logger.error("License Request XHR failed ("+o+"). Status: "+d.status+" ("+d.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var f=I-this._requestLicenseFailureCount+1;k.logger.warn("Retrying license request, "+f+" attempts left"),this._requestLicense(l,u)}break}},A._generateLicenseRequestChallenge=function(d,o){switch(d.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},A._requestLicense=function(d,o){k.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){k.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(l.mediaKeySystemDomain),x=this._createLicenseXhr(u,d,o);k.logger.log("Sending license request to URL: "+u);var m=this._generateLicenseRequestChallenge(l,d);x.send(m)}catch(f){k.logger.error("Failure requesting DRM license: "+f),this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.KEY_SYSTEM_ERROR,details:_.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},A.onMediaAttached=function(d,o){if(!this._emeEnabled)return;var l=o.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},A.onMediaDetached=function(){var d=this._media,o=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},A.onManifestParsed=function(d,o){if(!this._emeEnabled)return;var l=o.levels.map(function(x){return x.audioCodec}).filter(function(x){return!!x}),u=o.levels.map(function(x){return x.videoCodec}).filter(function(x){return!!x});this._attemptKeySystemAccess(j.KeySystems.WIDEVINE,l,u)},O(w,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),w}();Y.default=M},"./src/controller/fps-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/events.ts"),_=L("./src/utils/logger.ts"),k=function(){function j(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 U=j.prototype;return U.setStreamController=function(I){this.streamController=I},U.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(I,v){var S=this.hls.config;if(S.capLevelOnFPSDrop){var M=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=M,M&&typeof M.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),S.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(I,v,S){var M=performance.now();if(v){if(this.lastTime){var w=M-this.lastTime,A=S-this.lastDroppedFrames,C=v-this.lastDecodedFrames,d=1e3*A/w,o=this.hls;if(o.trigger(V.Events.FPS_DROP,{currentDropped:A,currentDecoded:C,totalDroppedFrames:S}),d>0&&A>o.config.fpsDroppedMonitoringThreshold*C){var l=o.currentLevel;_.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=l)&&(l=l-1,o.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:o.currentLevel}),o.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=M,this.lastDroppedFrames=S,this.lastDecodedFrames=v}},U.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var v=I.getVideoPlaybackQuality();this.checkFPS(I,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},j}();Y.default=k},"./src/controller/fragment-finders.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"findFragmentByPDT",function(){return k}),L.d(Y,"findFragmentByPTS",function(){return j}),L.d(Y,"fragmentWithinToleranceTest",function(){return U}),L.d(Y,"pdtWithinToleranceTest",function(){return O}),L.d(Y,"findFragWithCC",function(){return I});var V=L("./src/polyfills/number.ts"),_=L("./src/utils/binary-search.ts");function k(v,S,M){if(S===null||!Array.isArray(v)||!v.length||!Object(V.isFiniteNumber)(S))return null;var w=v[0].programDateTime;if(S<(w||0))return null;var A=v[v.length-1].endProgramDateTime;if(S>=(A||0))return null;M=M||0;for(var C=0;C<v.length;++C){var d=v[C];if(O(S,M,d))return d}return null}function j(v,S,M,w){M===void 0&&(M=0),w===void 0&&(w=0);var A=null;if(v?A=S[v.sn-S[0].sn+1]||null:M===0&&S[0].start===0&&(A=S[0]),A&&U(M,w,A)===0)return A;var C=_.default.search(S,U.bind(null,M,w));return C||A}function U(v,S,M){v===void 0&&(v=0),S===void 0&&(S=0);var w=Math.min(S,M.duration+(M.deltaPTS?M.deltaPTS:0));return M.start+M.duration-w<=v?1:M.start-w>v&&M.start?-1:0}function O(v,S,M){var w=Math.min(S,M.duration+(M.deltaPTS?M.deltaPTS:0))*1e3,A=M.endProgramDateTime||0;return A-w>v}function I(v,S){return _.default.search(v,function(M){return M.cc<S?1:M.cc>S?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"FragmentState",function(){return k}),L.d(Y,"FragmentTracker",function(){return j});var V=L("./src/events.ts"),_=L("./src/types/loader.ts"),k;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(k||(k={}));var j=function(){function I(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 v=I.prototype;return v._registerListeners=function(){var M=this.hls;M.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),M.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),M.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var M=this.hls;M.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),M.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),M.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(M,w){if(w===_.PlaylistLevelType.MAIN){var A=this.activeFragment,C=this.activeParts;if(!A)return null;if(C)for(var d=C.length;d--;){var o=C[d],l=o?o.end:A.appendedPTS;if(o.start<=M&&l!==void 0&&M<=l)return d>9&&(this.activeParts=C.slice(d-9)),o}else if(A.start<=M&&A.appendedPTS!==void 0&&M<=A.appendedPTS)return A}return this.getBufferedFrag(M,w)},v.getBufferedFrag=function(M,w){for(var A=this.fragments,C=Object.keys(A),d=C.length;d--;){var o=A[C[d]];if((o==null?void 0:o.body.type)===w&&o.buffered){var l=o.body;if(l.start<=M&&M<=l.end)return l}}return null},v.detectEvictedFragments=function(M,w,A){var C=this;Object.keys(this.fragments).forEach(function(d){var o=C.fragments[d];if(!o)return;if(!o.buffered){o.body.type===A&&C.removeFragment(o.body);return}var l=o.range[M];if(!l)return;l.time.some(function(u){var x=!C.isTimeBuffered(u.startPTS,u.endPTS,w);return x&&C.removeFragment(o.body),x})})},v.detectPartialFragments=function(M){var w=this,A=this.timeRanges,C=M.frag,d=M.part;if(!A||C.sn==="initSegment")return;var o=O(C),l=this.fragments[o];if(!l)return;Object.keys(A).forEach(function(u){var x=C.elementaryStreams[u];if(!x)return;var m=A[u],f=d!==null||x.partial===!0;l.range[u]=w.getBufferedTimes(C,d,f,m)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},v.fragBuffered=function(M){var w=O(M),A=this.fragments[w];A&&(A.backtrack=A.loaded=null,A.buffered=!0)},v.getBufferedTimes=function(M,w,A,C){for(var d={time:[],partial:A},o=w?w.start:M.start,l=w?w.end:M.end,u=M.minEndPTS||l,x=M.maxStartPTS||o,m=0;m<C.length;m++){var f=C.start(m)-this.bufferPadding,D=C.end(m)+this.bufferPadding;if(x>=f&&u<=D){d.time.push({startPTS:Math.max(o,C.start(m)),endPTS:Math.min(l,C.end(m))});break}else if(o<D&&l>f)d.partial=!0,d.time.push({startPTS:Math.max(o,C.start(m)),endPTS:Math.min(l,C.end(m))});else if(l<=f)break}return d},v.getPartialFragment=function(M){var w=null,A,C,d,o=0,l=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(x){var m=u[x];if(!m)return;U(m)&&(C=m.body.start-l,d=m.body.end+l,M>=C&&M<=d&&(A=Math.min(M-C,d-M),o<=A&&(w=m.body,o=A)))}),w},v.getState=function(M){var w=O(M),A=this.fragments[w];return A?A.buffered?U(A)?k.PARTIAL:k.OK:A.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},v.backtrack=function(M,w){var A=O(M),C=this.fragments[A];if(!C||C.backtrack)return null;var d=C.backtrack=w||C.loaded;return C.loaded=null,d},v.getBacktrackData=function(M){var w=O(M),A=this.fragments[w];if(A){var C,d=A.backtrack;if(d!=null&&(C=d.payload)!==null&&C!==void 0&&C.byteLength)return d;this.removeFragment(M)}return null},v.isTimeBuffered=function(M,w,A){for(var C,d,o=0;o<A.length;o++){if(C=A.start(o)-this.bufferPadding,d=A.end(o)+this.bufferPadding,M>=C&&w<=d)return!0;if(w<=C)return!1}return!1},v.onFragLoaded=function(M,w){var A=w.frag,C=w.part;if(A.sn==="initSegment"||A.bitrateTest||C)return;var d=O(A);this.fragments[d]={body:A,loaded:w,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(M,w){var A=this,C=w.frag,d=w.part,o=w.timeRanges;if(C.type===_.PlaylistLevelType.MAIN)if(this.activeFragment=C,d){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(d)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(u){var x=o[u];if(A.detectEvictedFragments(u,x),!d)for(var m=0;m<x.length;m++)C.appendedPTS=Math.max(x.end(m),C.appendedPTS||0)})},v.onFragBuffered=function(M,w){this.detectPartialFragments(w)},v.hasFragment=function(M){var w=O(M);return!!this.fragments[w]},v.removeFragmentsInRange=function(M,w,A){var C=this;Object.keys(this.fragments).forEach(function(d){var o=C.fragments[d];if(!o)return;if(o.buffered){var l=o.body;l.type===A&&l.start<w&&l.end>M&&C.removeFragment(l)}})},v.removeFragment=function(M){var w=O(M);M.stats.loaded=0,M.clearElementaryStreamInfo(),delete this.fragments[w]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function U(I){var v,S;return I.buffered&&(((v=I.range.video)===null||v===void 0?void 0:v.partial)||((S=I.range.audio)===null||S===void 0?void 0:S.partial))}function O(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return U}),L.d(Y,"MAX_START_GAP_JUMP",function(){return O}),L.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),L.d(Y,"SKIP_BUFFER_RANGE_START",function(){return v}),L.d(Y,"default",function(){return S});var V=L("./src/utils/buffer-helper.ts"),_=L("./src/errors.ts"),k=L("./src/events.ts"),j=L("./src/utils/logger.ts"),U=250,O=2,I=.1,v=.05,S=function(){function M(A,C,d,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=d,this.hls=o}var w=M.prototype;return w.destroy=function(){this.hls=this.fragmentTracker=this.media=null},w.poll=function(C){var d=this.config,o=this.media,l=this.stalled,u=o.currentTime,x=o.seeking,m=this.seeking&&!x,f=!this.seeking&&x;if(this.seeking=x,u!==C){if(this.moved=!0,l!==null){if(this.stallReported){var D=self.performance.now()-l;j.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((f||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,h=b.nextStart||0;if(!c&&!h)return;if(x){var s=b.len>O,a=!h||h-u>O&&!this.fragmentTracker.getPartialFragment(u);if(s||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g,p=Math.max(h,b.start||0)-u,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=y==null||((g=y.details)===null||g===void 0)?void 0:g.live,G=P?y.details.targetduration*2:O;if(p>0&&p<=G){this._trySkipBufferHole(null);return}}var Q=self.performance.now();if(l===null){this.stalled=Q;return}var re=Q-l;!x&&re>=U&&this._reportStall(b.len);var z=V.BufferHelper.bufferInfo(o,u,d.maxBufferHole);this._tryFixBufferStall(z,re)},w._tryFixBufferStall=function(C,d){var o=this.config,l=this.fragmentTracker,u=this.media,x=u.currentTime,m=l.getPartialFragment(x);if(m){var f=this._trySkipBufferHole(m);if(f)return}C.len>o.maxBufferHole&&d>o.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},w._reportStall=function(C){var d=this.hls,o=this.media,l=this.stallReported;l||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+C+")"),d.trigger(k.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:C}))},w._trySkipBufferHole=function(C){for(var d=this.config,o=this.hls,l=this.media,u=l.currentTime,x=0,m=V.BufferHelper.getBuffered(l),f=0;f<m.length;f++){var D=m.start(f);if(u+d.maxBufferHole>=x&&u<D){var b=Math.max(D+v,l.currentTime+I);return j.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+b),this.moved=!0,this.stalled=null,l.currentTime=b,C&&o.trigger(k.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}x=m.end(f)}return 0},w._tryNudgeBuffer=function(){var C=this.config,d=this.hls,o=this.media,l=o.currentTime,u=(this.nudgeRetry||0)+1;if(this.nudgeRetry=u,u<C.nudgeMaxRetry){var x=l+u*C.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+l+" to "+x),o.currentTime=x,d.trigger(k.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+C.nudgeMaxRetry+" nudges"),d.trigger(k.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},M}()},"./src/controller/id3-track-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/events.ts"),_=L("./src/utils/texttrack-utils.ts"),k=L("./src/demux/id3.ts"),j=.25,U=function(){function O(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var I=O.prototype;return I.destroy=function(){this._unregisterListeners()},I._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)},I._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)},I.onMediaAttached=function(S,M){this.media=M.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(_.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(S){if(!this.media)return;for(var M=0;M<S.length;M++){var w=S[M];if(w.kind==="metadata"&&w.label==="id3")return Object(_.sendAddTrackEvent)(w,this.media),w}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(S,M){if(!this.media)return;var w=M.frag,A=M.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var C=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,d=0;d<A.length;d++){var o=k.getID3Frames(A[d].data);if(o){var l=A[d].pts,u=d<A.length-1?A[d+1].pts:w.end,x=u-l;x<=0&&(u=l+j);for(var m=0;m<o.length;m++){var f=o[m];if(!k.isTimeStampFrame(f)){var D=new C(l,u,"");D.value=f,this.id3Track.addCue(D)}}}}},I.onBufferFlushing=function(S,M){var w=M.startOffset,A=M.endOffset,C=M.type;if(!C||C==="audio"){var d=this.id3Track;d&&Object(_.removeCuesInRange)(d,w,A)}},O}();Y.default=U},"./src/controller/latency-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return O});var V=L("./src/errors.ts"),_=L("./src/events.ts"),k=L("./src/utils/logger.ts");function j(I,v){for(var S=0;S<v.length;S++){var M=v[S];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(I,M.key,M)}}function U(I,v,S){return v&&j(I.prototype,v),S&&j(I,S),I}var O=function(){function I(S){var M=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 M.timeupdate()},this.hls=S,this.config=S.config,this.registerListeners()}var v=I.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.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)},v.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)},v.onMediaAttached=function(M,w){this.media=w.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(M,w){var A=w.details;this.levelDetails=A,A.advanced&&this.timeupdate(),!A.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(M,w){if(w.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,k.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var M=this.media,w=this.levelDetails;if(!M||!w)return;this.currentTime=M.currentTime;var A=this.computeLatency();if(A===null)return;this._latency=A;var C=this.config,d=C.lowLatencyMode,o=C.maxLiveSyncPlaybackRate;if(!d||o===1)return;var l=this.targetLatency;if(l===null)return;var u=A-l,x=Math.min(this.maxLatency,l+w.targetduration),m=u<x;if(w.live&&m&&u>.05&&this.forwardBufferLength>1){var f=Math.min(2,Math.max(1,o)),D=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;M.playbackRate=Math.min(f,Math.max(1,D))}else M.playbackRate!==1&&M.playbackRate!==0&&(M.playbackRate=1)},v.estimateLiveEdge=function(){var M=this.levelDetails;return M===null?null:M.edge+M.age},v.computeLatency=function(){var M=this.estimateLiveEdge();return M===null?null:M-this.currentTime},U(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var M=this.config,w=this.levelDetails;return M.liveMaxLatencyDuration!==void 0?M.liveMaxLatencyDuration:w?M.liveMaxLatencyDurationCount*w.targetduration:0}},{key:"targetLatency",get:function(){var M=this.levelDetails;if(M===null)return null;var w=M.holdBack,A=M.partHoldBack,C=M.targetduration,d=this.config,o=d.liveSyncDuration,l=d.liveSyncDurationCount,u=d.lowLatencyMode,x=this.hls.userConfig,m=u&&A||w;(x.liveSyncDuration||x.liveSyncDurationCount||m===0)&&(m=o!==void 0?o:l*C);var f=C,D=1;return m+Math.min(this.stallCount*D,f)}},{key:"liveSyncPosition",get:function(){var M=this.estimateLiveEdge(),w=this.targetLatency,A=this.levelDetails;if(M===null||w===null||A===null)return null;var C=A.edge,d=M-w-this.edgeStalled,o=C-A.totalduration,l=C-(this.config.lowLatencyMode&&A.partTarget||A.targetduration);return Math.min(Math.max(o,d),l)}},{key:"drift",get:function(){var M=this.levelDetails;return M===null?1:M.drift}},{key:"edgeStalled",get:function(){var M=this.levelDetails;if(M===null)return 0;var w=(this.config.lowLatencyMode&&M.partTarget||M.targetduration)*3;return Math.max(M.age-w,0)}},{key:"forwardBufferLength",get:function(){var M=this.media,w=this.levelDetails;if(!M||!w)return 0;var A=M.buffered.length;return A?M.buffered.end(A-1):w.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return d});var V=L("./src/types/level.ts"),_=L("./src/events.ts"),k=L("./src/errors.ts"),j=L("./src/utils/codecs.ts"),U=L("./src/controller/level-helper.ts"),O=L("./src/controller/base-playlist-controller.ts"),I=L("./src/types/loader.ts");function v(){return v=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var x in u)Object.prototype.hasOwnProperty.call(u,x)&&(o[x]=u[x])}return o},v.apply(this,arguments)}function S(o,l){for(var u=0;u<l.length;u++){var x=l[u];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(o,x.key,x)}}function M(o,l,u){return l&&S(o.prototype,l),u&&S(o,u),o}function w(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,A(o,l)}function A(o,l){return A=Object.setPrototypeOf||function(x,m){return x.__proto__=m,x},A(o,l)}var C=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=function(o){w(l,o);function l(x){var m;return m=o.call(this,x,"[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=l.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(f){f.loadError=0}),o.prototype.startLoad.call(this)},u.onManifestLoaded=function(m,f){var D=[],b=[],c=[],h,s={},a,g=!1,p=!1,y=!1;if(f.levels.forEach(function(re){var z=re.attrs;g=g||!!(re.width&&re.height),p=p||!!re.videoCodec,y=y||!!re.audioCodec,C&&re.audioCodec&&re.audioCodec.indexOf("mp4a.40.34")!==-1&&(re.audioCodec=void 0);var F=re.bitrate+"-"+re.attrs.RESOLUTION+"-"+re.attrs.CODECS;a=s[F],a?a.url.push(re.url):(a=new V.Level(re),s[F]=a,D.push(a)),z&&(z.AUDIO&&Object(U.addGroupId)(a,"audio",z.AUDIO),z.SUBTITLES&&Object(U.addGroupId)(a,"text",z.SUBTITLES))}),(g||p)&&y&&(D=D.filter(function(re){var z=re.videoCodec,F=re.width,ne=re.height;return!!z||!!(F&&ne)})),D=D.filter(function(re){var z=re.audioCodec,F=re.videoCodec;return(!z||Object(j.isCodecSupportedInMp4)(z,"audio"))&&(!F||Object(j.isCodecSupportedInMp4)(F,"video"))}),f.audioTracks&&(b=f.audioTracks.filter(function(re){return!re.audioCodec||Object(j.isCodecSupportedInMp4)(re.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(b)),f.subtitles&&(c=f.subtitles,Object(U.assignTrackIdsByGroup)(c)),D.length>0){h=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===h){this._firstLevel=P,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+h);break}var G=y&&!p,Q={levels:D,audioTracks:b,subtitleTracks:c,firstLevel:this._firstLevel,stats:f.stats,audio:y,video:p,altAudio:!G&&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:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:f.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(m,f){if(o.prototype.onError.call(this,m,f),f.fatal)return;var D=f.context,b=this._levels[this.currentLevelIndex];if(D&&(D.type===I.PlaylistContextType.AUDIO_TRACK&&b.audioGroupIds&&D.groupId===b.audioGroupIds[b.urlId]||D.type===I.PlaylistContextType.SUBTITLE_TRACK&&b.textGroupIds&&D.groupId===b.textGroupIds[b.urlId])){this.redundantFailover(this.currentLevelIndex);return}var c=!1,h=!0,s;switch(f.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:case k.ErrorDetails.KEY_LOAD_ERROR:case k.ErrorDetails.KEY_LOAD_TIMEOUT:if(f.frag){var a=this._levels[f.frag.level];a?(a.fragmentError++,a.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=f.frag.level)):s=f.frag.level}break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(h=!1),s=D.level),c=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:s=f.level,c=!0;break}s!==void 0&&this.recoverLevel(f,s,c,h)},u.recoverLevel=function(m,f,D,b){var c=m.details,h=this._levels[f];if(h.loadError++,D){var s=this.retryLoadingOrFail(m);if(s)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(b){var a=h.url.length;if(a>1&&h.loadError<a)m.levelRetry=!0,this.redundantFailover(f);else if(this.manualLevelIndex===-1){var g=f===0?this._levels.length-1:f-1;this.currentLevelIndex!==g&&this._levels[g].loadError===0&&(this.warn(c+": switch to "+g),m.levelRetry=!0,this.hls.nextAutoLevel=g)}}},u.redundantFailover=function(m){var f=this._levels[m],D=f.url.length;if(D>1){var b=(f.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,f){var D=f.frag;if(D!==void 0&&D.type===I.PlaylistLevelType.MAIN){var b=this._levels[D.level];b!==void 0&&(b.fragmentError=0,b.loadError=0)}},u.onLevelLoaded=function(m,f){var D,b=f.level,c=f.details,h=this._levels[b];if(!h){var s;this.warn("Invalid level index "+b),(s=f.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(c.deltaUpdateFailed=!0);return}b===this.currentLevelIndex?(h.fragmentError===0&&(h.loadError=0,this.retryCount=0),this.playlistLoaded(b,f,h.details)):(D=f.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(c.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(m,f){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var b=-1,c=this.hls.audioTracks[f.id].groupId,h=0;h<D.audioGroupIds.length;h++)if(D.audioGroupIds[h]===c){b=h;break}b!==D.urlId&&(D.urlId=b,this.startLoad())}},u.loadPlaylist=function(m){var f=this.currentLevelIndex,D=this._levels[f];if(this.canLoad&&D&&D.url.length>0){var b=D.urlId,c=D.url[b];if(m)try{c=m.addDirectives(c)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Attempt loading level index "+f+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+b+" "+c),this.clearTimer(),this.hls.trigger(_.Events.LEVEL_LOADING,{url:c,level:f,id:b,deliveryDirectives:m||null})}},u.removeLevel=function(m,f){var D=function(h,s){return s!==f},b=this._levels.filter(function(c,h){return h!==m?!0:c.url.length>1&&f!==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,h){var s=c.details;return s!=null&&s.fragments&&s.fragments.forEach(function(a){a.level=h}),c});this._levels=b,this.hls.trigger(_.Events.LEVELS_UPDATED,{levels:b})},M(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var f,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===m&&(f=D[m])!==null&&f!==void 0&&f.details)return;if(m<0||m>=D.length){var b=m<0;if(this.hls.trigger(_.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.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,h=D[c],s=D[m];this.log("switching to level "+m+" from "+c),this.currentLevelIndex=m;var a=v({},s,{level:m,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete a._urlId,this.hls.trigger(_.Events.LEVEL_SWITCHING,a);var g=s.details;if(!g||g.live){var p=this.switchParams(s.uri,h==null?void 0:h.details);this.loadPlaylist(p)}}},{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)}}]),l}(O.default)},"./src/controller/level-helper.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"addGroupId",function(){return k}),L.d(Y,"assignTrackIdsByGroup",function(){return j}),L.d(Y,"updatePTS",function(){return U}),L.d(Y,"updateFragPTSDTS",function(){return I}),L.d(Y,"mergeDetails",function(){return v}),L.d(Y,"mapPartIntersection",function(){return S}),L.d(Y,"mapFragmentIntersection",function(){return M}),L.d(Y,"adjustSliding",function(){return w}),L.d(Y,"addSliding",function(){return A}),L.d(Y,"computeReloadInterval",function(){return C}),L.d(Y,"getFragmentWithSN",function(){return d}),L.d(Y,"getPartWith",function(){return o});var V=L("./src/polyfills/number.ts"),_=L("./src/utils/logger.ts");function k(l,u,x){switch(u){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(x);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(x);break}}function j(l){var u={};l.forEach(function(x){var m=x.groupId||"";x.id=u[m]=u[m]||0,u[m]++})}function U(l,u,x){var m=l[u],f=l[x];O(m,f)}function O(l,u){var x=u.startPTS;if(Object(V.isFiniteNumber)(x)){var m=0,f;u.sn>l.sn?(m=x-l.start,f=l):(m=l.start-x,f=u),f.duration!==m&&(f.duration=m)}else if(u.sn>l.sn){var D=l.cc===u.cc;D&&l.minEndPTS?u.start=l.start+(l.minEndPTS-l.start):u.start=l.start+l.duration}else u.start=Math.max(l.start-u.duration,0)}function I(l,u,x,m,f,D){var b=m-x;b<=0&&(_.logger.warn("Fragment should have a positive duration",u),m=x+u.duration,D=f+u.duration);var c=x,h=m,s=u.startPTS,a=u.endPTS;if(Object(V.isFiniteNumber)(s)){var g=Math.abs(s-x);Object(V.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(g,u.deltaPTS):u.deltaPTS=g,c=Math.max(x,s),x=Math.min(x,s),f=Math.min(f,u.startDTS),h=Math.min(m,a),m=Math.max(m,a),D=Math.max(D,u.endDTS)}u.duration=m-x;var p=x-u.start;u.appendedPTS=m,u.start=u.startPTS=x,u.maxStartPTS=c,u.startDTS=f,u.endPTS=m,u.minEndPTS=h,u.endDTS=D;var y=u.sn;if(!l||y<l.startSN||y>l.endSN)return 0;var P,G=y-l.startSN,Q=l.fragments;for(Q[G]=u,P=G;P>0;P--)O(Q[P],Q[P-1]);for(P=G;P<Q.length-1;P++)O(Q[P],Q[P+1]);return l.fragmentHint&&O(Q[Q.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,p}function v(l,u){for(var x=null,m=l.fragments,f=m.length-1;f>=0;f--){var D=m[f].initSegment;if(D){x=D;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var b=0,c;if(M(l,u,function(P,G){P.relurl&&(b=P.cc-G.cc),Object(V.isFiniteNumber)(P.startPTS)&&Object(V.isFiniteNumber)(P.endPTS)&&(G.start=G.startPTS=P.startPTS,G.startDTS=P.startDTS,G.appendedPTS=P.appendedPTS,G.maxStartPTS=P.maxStartPTS,G.endPTS=P.endPTS,G.endDTS=P.endDTS,G.minEndPTS=P.minEndPTS,G.duration=P.endPTS-P.startPTS,G.duration&&(c=G),u.PTSKnown=u.alignedSliding=!0),G.elementaryStreams=P.elementaryStreams,G.loader=P.loader,G.stats=P.stats,G.urlId=P.urlId,P.initSegment&&(G.initSegment=P.initSegment,x=P.initSegment)}),x){var h=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;h.forEach(function(P){var G;(!P.initSegment||P.initSegment.relurl===((G=x)===null||G===void 0?void 0:G.relurl))&&(P.initSegment=x)})}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 s=u.skippedSegments;s--;)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 g=0;g<a.length;g++)a[g].cc+=b}u.skippedSegments&&(u.startCC=u.fragments[0].cc),S(l.partList,u.partList,function(P,G){G.elementaryStreams=P.elementaryStreams,G.stats=P.stats}),c?I(u,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS):w(l,u),a.length&&(u.totalduration=u.edge-a[0].start),u.driftStartTime=l.driftStartTime,u.driftStart=l.driftStart;var p=u.advancedDateTime;if(u.advanced&&p){var y=u.edge;u.driftStart||(u.driftStartTime=p,u.driftStart=y),u.driftEndTime=p,u.driftEnd=y}else u.driftEndTime=l.driftEndTime,u.driftEnd=l.driftEnd,u.advancedDateTime=l.advancedDateTime}function S(l,u,x){if(l&&u)for(var m=0,f=0,D=l.length;f<=D;f++){var b=l[f],c=u[f+m];b&&c&&b.index===c.index&&b.fragment.sn===c.fragment.sn?x(b,c):m--}}function M(l,u,x){for(var m=u.skippedSegments,f=Math.max(l.startSN,u.startSN)-u.startSN,D=(l.fragmentHint?1:0)+(m?u.endSN:Math.min(l.endSN,u.endSN))-u.startSN,b=u.startSN-l.startSN,c=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,h=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,s=f;s<=D;s++){var a=h[b+s],g=c[s];m&&!g&&s<m&&(g=u.fragments[s]=a),a&&g&&x(a,g)}}function w(l,u){var x=u.startSN+u.skippedSegments-l.startSN,m=l.fragments;if(x<0||x>=m.length)return;A(u,m[x].start)}function A(l,u){if(u){for(var x=l.fragments,m=l.skippedSegments;m<x.length;m++)x[m].start+=u;l.fragmentHint&&(l.fragmentHint.start+=u)}}function C(l,u){var x=1e3*l.levelTargetDuration,m=x/2,f=l.age,D=f>0&&f<x*3,b=u.loading.end-u.loading.start,c,h=l.availabilityDelay;if(l.updated===!1)if(D){var s=333*l.misses;c=Math.max(Math.min(m,b*2),s),l.availabilityDelay=(l.availabilityDelay||0)+c}else c=m;else D?(h=Math.min(h||x/2,f),l.availabilityDelay=h,c=h+x-f):c=x-b;return Math.round(c)}function d(l,u,x){if(!l||!l.details)return null;var m=l.details,f=m.fragments[u-m.startSN];return f||(f=m.fragmentHint,f&&f.sn===u?f:u<m.startSN&&x&&x.sn===u?x:null)}function o(l,u,x){if(!l||!l.details)return null;var m=l.details.partList;if(m)for(var f=m.length;f--;){var D=m[f];if(D.index===x&&D.fragment.sn===u)return D}return null}},"./src/controller/stream-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return m});var V=L("./src/polyfills/number.ts"),_=L("./src/controller/base-stream-controller.ts"),k=L("./src/is-supported.ts"),j=L("./src/events.ts"),U=L("./src/utils/buffer-helper.ts"),O=L("./src/controller/fragment-tracker.ts"),I=L("./src/types/loader.ts"),v=L("./src/loader/fragment.ts"),S=L("./src/demux/transmuxer-interface.ts"),M=L("./src/types/transmuxer.ts"),w=L("./src/controller/gap-controller.ts"),A=L("./src/errors.ts"),C=L("./src/utils/logger.ts");function d(f,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(f,c.key,c)}}function o(f,D,b){return D&&d(f.prototype,D),b&&d(f,b),f}function l(f,D){f.prototype=Object.create(D.prototype),f.prototype.constructor=f,u(f,D)}function u(f,D){return u=Object.setPrototypeOf||function(c,h){return c.__proto__=h,c},u(f,D)}var x=100,m=function(f){l(D,f);function D(c,h){var s;return s=f.call(this,c,h,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var b=D.prototype;return b._registerListeners=function(){var h=this.hls;h.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.on(j.Events.ERROR,this.onError,this),h.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var h=this.hls;h.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.off(j.Events.ERROR,this.onError,this),h.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},b.startLoad=function(h){if(this.levels){var s=this.lastCurrentTime,a=this.hls;if(this.stopLoad(),this.setInterval(x),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var g=a.startLevel;g===-1&&(a.config.testBandwidth?(g=0,this.bitrateTest=!0):g=a.nextAutoLevel),this.level=a.nextLoadLevel=g,this.loadedmetadata=!1}s>0&&h===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),h=s),this.state=_.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()}else this._forceStartLoad=!0,this.state=_.State.STOPPED},b.stopLoad=function(){this._forceStartLoad=!1,f.prototype.stopLoad.call(this)},b.doTick=function(){switch(this.state){case _.State.IDLE:this.doTickIdle();break;case _.State.WAITING_LEVEL:{var h,s=this.levels,a=this.level,g=s==null||((h=s[a])===null||h===void 0)?void 0:h.details;if(g&&(!g.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(g))break;this.state=_.State.IDLE;break}break}case _.State.FRAG_LOADING_WAITING_RETRY:{var p,y=self.performance.now(),P=this.retryDate;(!P||y>=P||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=_.State.IDLE)}break;default:break}this.onTickEnd()},b.onTickEnd=function(){f.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},b.doTickIdle=function(){var h,s,a=this.hls,g=this.levelLastLoaded,p=this.levels,y=this.media,P=a.config,G=a.nextLoadLevel;if(g===null||!y&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[G])return;var Q=p[G];this.level=a.nextLoadLevel=G;var re=Q.details;if(!re||this.state===_.State.WAITING_LEVEL||re.live&&this.levelLastLoaded!==G){this.state=_.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,I.PlaylistLevelType.MAIN);if(z===null)return;var F=z.len,ne=this.getMaxBufferLength(Q.maxBitrate);if(F>=ne)return;if(this._streamEnded(z,re)){var ce={};this.altAudio&&(ce.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,ce),this.state=_.State.ENDED;return}var ge=z.end,be=this.getNextFragment(ge,re);if(this.couldBacktrack&&!this.fragPrevious&&be&&be.sn!=="initSegment"){var Be=be.sn-re.startSN;Be>1&&(be=re.fragments[Be-1],this.fragmentTracker.removeFragment(be))}if(be&&this.fragmentTracker.getState(be)===O.FragmentState.OK&&this.nextLoadPosition>ge){var Se=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,Se,I.PlaylistLevelType.MAIN),be=this.getNextFragment(this.nextLoadPosition,re)}if(!be)return;be.initSegment&&!be.initSegment.data&&!this.bitrateTest&&(be=be.initSegment),((h=be.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((s=be.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(be,re):this.loadFragment(be,re,ge)},b.loadFragment=function(h,s,a){var g,p=this.fragmentTracker.getState(h);if(this.fragCurrent=h,p===O.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(h);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else p=O.FragmentState.NOT_LOADED}p===O.FragmentState.NOT_LOADED||p===O.FragmentState.PARTIAL?h.sn==="initSegment"?this._loadInitSegment(h):this.bitrateTest?(h.bitrateTest=!0,this.log("Fragment "+h.sn+" of level "+h.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(h)):(this.startFragRequested=!0,f.prototype.loadFragment.call(this,h,s,a)):p===O.FragmentState.APPENDING?this.reduceMaxBufferLength(h.duration)&&this.fragmentTracker.removeFragment(h):((g=this.media)===null||g===void 0?void 0:g.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},b.getAppendedFrag=function(h){var s=this.fragmentTracker.getAppendedFrag(h,I.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},b.getBufferedFrag=function(h){return this.fragmentTracker.getBufferedFrag(h,I.PlaylistLevelType.MAIN)},b.followingBufferedFrag=function(h){return h?this.getBufferedFrag(h.end+.5):null},b.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},b.nextLevelSwitch=function(){var h=this.levels,s=this.media;if(s!=null&&s.readyState){var a,g=this.getAppendedFrag(s.currentTime);if(g&&g.start>1&&this.flushMainBuffer(0,g.start-1),!s.paused&&h){var p=this.hls.nextLoadLevel,y=h[p],P=this.fragLastKbps;P&&this.fragCurrent?a=this.fragCurrent.duration*y.maxBitrate/(1e3*P)+1:a=0}else a=0;var G=this.getBufferedFrag(s.currentTime+a);if(G){var Q=this.followingBufferedFrag(G);if(Q){this.abortCurrentFrag();var re=Q.maxStartPTS?Q.maxStartPTS:Q.start,z=Q.duration,F=Math.max(G.end,re+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(F,Number.POSITIVE_INFINITY)}}}},b.abortCurrentFrag=function(){var h=this.fragCurrent;this.fragCurrent=null,h!=null&&h.loader&&h.loader.abort(),this.state===_.State.KEY_LOADING&&(this.state=_.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},b.flushMainBuffer=function(h,s){f.prototype.flushMainBuffer.call(this,h,s,this.altAudio?"video":null)},b.onMediaAttached=function(h,s){f.prototype.onMediaAttached.call(this,h,s);var a=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new w.default(this.config,a,this.fragmentTracker,this.hls)},b.onMediaDetaching=function(){var h=this.media;h&&(h.removeEventListener("playing",this.onvplaying),h.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),f.prototype.onMediaDetaching.call(this)},b.onMediaPlaying=function(){this.tick()},b.onMediaSeeked=function(){var h=this.media,s=h?h.currentTime:null;Object(V.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},b.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},b.onManifestParsed=function(h,s){var a=!1,g=!1,p;s.levels.forEach(function(y){p=y.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(a=!0),p.indexOf("mp4a.40.5")!==-1&&(g=!0))}),this.audioCodecSwitch=a&&g&&!Object(k.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},b.onLevelLoading=function(h,s){var a=this.levels;if(!a||this.state!==_.State.IDLE)return;var g=a[s.level];(!g.details||g.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(g.details))&&(this.state=_.State.WAITING_LEVEL)},b.onLevelLoaded=function(h,s){var a,g=this.levels,p=s.level,y=s.details,P=y.totalduration;if(!g){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+P);var G=this.fragCurrent;G&&(this.state===_.State.FRAG_LOADING||this.state===_.State.FRAG_LOADING_WAITING_RETRY)&&(G.level!==s.level&&G.loader&&(this.state=_.State.IDLE,G.loader.abort()));var Q=g[p],re=0;if(y.live||(a=Q.details)!==null&&a!==void 0&&a.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;re=this.alignPlaylists(y,Q.details)}if(Q.details=y,this.levelLastLoaded=p,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:y,level:p}),this.state===_.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=_.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,re),this.tick()},b._handleFragmentLoadProgress=function(h){var s,a=h.frag,g=h.part,p=h.payload,y=this.levels;if(!y){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=y[a.level],G=P.details;if(!G){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var Q=P.videoCodec,re=G.PTSKnown||!G.live,z=(s=a.initSegment)===null||s===void 0?void 0:s.data,F=this._getAudioCodec(P),ne=this.transmuxer=this.transmuxer||new S.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ce=g?g.index:-1,ge=ce!==-1,be=new M.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,p.byteLength,ce,ge),Be=this.initPTS[a.cc];ne.push(p,z,F,Q,a,g,G.totalduration,re,be,Be)},b.onAudioTrackSwitching=function(h,s){var a=this.altAudio,g=!!s.url,p=s.id;if(!g){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;a&&P.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:p})}},b.onAudioTrackSwitched=function(h,s){var a=s.id,g=!!this.hls.audioTracks[a].url;if(g){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=g,this.tick()},b.onBufferCreated=function(h,s){var a=s.tracks,g,p,y=!1;for(var P in a){var G=a[P];if(G.id==="main"){if(p=P,g=G,P==="video"){var Q=a[P];Q&&(this.videoBuffer=Q.buffer)}}else y=!0}y&&g?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=g.buffer):this.mediaBuffer=this.media},b.onFragBuffered=function(h,s){var a=s.frag,g=s.part;if(a&&a.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(g?" p: "+g.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===_.State.PARSED&&(this.state=_.State.IDLE);return}var p=g?g.stats:a.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,g)},b.onError=function(h,s){switch(s.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(I.PlaylistLevelType.MAIN,s);break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==_.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=_.State.ERROR):!s.levelRetry&&this.state===_.State.WAITING_LEVEL&&(this.state=_.State.IDLE));break;case A.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===_.State.PARSING||this.state===_.State.PARSED)){var a=!0,g=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);g&&g.len>.5&&(a=!this.reduceMaxBufferLength(g.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},b.checkBuffer=function(){var h=this.media,s=this.gapController;if(!h||!s||!h.readyState)return;var a=U.BufferHelper.getBuffered(h);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=h.currentTime},b.onFragLoadEmergencyAborted=function(){this.state=_.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},b.onBufferFlushed=function(h,s){var a=s.type;if(a!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var g=(a===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(g,a,I.PlaylistLevelType.MAIN)}},b.onLevelsUpdated=function(h,s){this.levels=s.levels},b.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},b.seekToStartPos=function(){var h=this.media,s=h.currentTime,a=this.startPosition;if(a>=0&&s<a){if(h.seeking){C.logger.log("could not seek to "+a+", already seeking at "+s);return}var g=U.BufferHelper.getBuffered(h),p=g.length?g.start(0):0,y=p-a;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(C.logger.log("adjusting start position by "+y+" to match buffer start"),a+=y,this.startPosition=a),this.log("seek to target start position "+a+" from current time "+s),h.currentTime=a}},b._getAudioCodec=function(h){var s=this.config.defaultAudioCodec||h.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},b._loadBitrateTestFrag=function(h){var s=this;this._doFragLoad(h).then(function(a){var g=s.hls;if(!a||g.nextLoadLevel||s.fragContextChanged(h))return;s.fragLoadError=0,s.state=_.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var p=h.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),g.trigger(j.Events.FRAG_LOADED,a)})},b._handleTransmuxComplete=function(h){var s,a="main",g=this.hls,p=h.remuxResult,y=h.chunkMeta,P=this.getCurrentContext(y);if(!P){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var G=P.frag,Q=P.part,re=P.level,z=p.video,F=p.text,ne=p.id3,ce=p.initSegment,ge=this.altAudio?void 0:p.audio;if(this.fragContextChanged(G))return;if(this.state=_.State.PARSING,ce){ce.tracks&&(this._bufferInitSegment(re,ce.tracks,G,y),g.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:G,id:a,tracks:ce.tracks}));var be=ce.initPTS,Be=ce.timescale;Object(V.isFiniteNumber)(be)&&(this.initPTS[G.cc]=be,g.trigger(j.Events.INIT_PTS_FOUND,{frag:G,id:a,initPTS:be,timescale:Be}))}if(z&&p.independent!==!1){if(re.details){var Se=z.startPTS,Le=z.endPTS,Te=z.startDTS,we=z.endDTS;if(Q)Q.elementaryStreams[z.type]={startPTS:Se,endPTS:Le,startDTS:Te,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(G);return}G.setElementaryStreamInfo(z.type,G.start,Le,G.start,we,!0)}G.setElementaryStreamInfo(z.type,Se,Le,Te,we),this.bufferFragmentData(z,G,Q,y)}}else if(p.independent===!1){this.backtrack(G);return}if(ge){var H=ge.startPTS,T=ge.endPTS,R=ge.startDTS,W=ge.endDTS;Q&&(Q.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:H,endPTS:T,startDTS:R,endDTS:W}),G.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,H,T,R,W),this.bufferFragmentData(ge,G,Q,y)}if(ne!=null&&(s=ne.samples)!==null&&s!==void 0&&s.length){var $={frag:G,id:a,samples:ne.samples};g.trigger(j.Events.FRAG_PARSING_METADATA,$)}if(F){var N={frag:G,id:a,samples:F.samples};g.trigger(j.Events.FRAG_PARSING_USERDATA,N)}},b._bufferInitSegment=function(h,s,a,g){var p=this;if(this.state!==_.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var y=s.audio,P=s.video,G=s.audiovideo;if(y){var Q=h.audioCodec,re=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(Q&&(Q.indexOf("mp4a.40.5")!==-1?Q="mp4a.40.2":Q="mp4a.40.5"),y.metadata.channelCount!==1&&re.indexOf("firefox")===-1&&(Q="mp4a.40.5")),re.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(Q="mp4a.40.2",this.log("Android: force audio codec to "+Q)),h.audioCodec&&h.audioCodec!==Q&&this.log('Swapping manifest audio codec "'+h.audioCodec+'" for "'+Q+'"'),y.levelCodec=Q,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(Q||"")+"/"+(h.audioCodec||"")+"/"+y.codec+"]")}P&&(P.levelCodec=h.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(h.videoCodec||"")+"/"+P.codec+"]")),G&&this.log("Init audiovideo buffer, container:"+G.container+", codecs[level/parsed]=["+(h.attrs.CODECS||"")+"/"+G.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(z){var F=s[z],ne=F.initSegment;ne!=null&&ne.byteLength&&p.hls.trigger(j.Events.BUFFER_APPENDING,{type:z,data:ne,frag:a,part:null,chunkMeta:g,parent:a.type})}),this.tick()},b.backtrack=function(h){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(h);var s=this.fragmentTracker.backtrack(h);this.fragPrevious=null,this.nextLoadPosition=h.start,s?this.resetFragmentLoading(h):this.state=_.State.BACKTRACKING},b.checkFragmentChanged=function(){var h=this.media,s=null;if(h&&h.readyState>1&&h.seeking===!1){var a=h.currentTime;if(U.BufferHelper.isBuffered(h,a)?s=this.getAppendedFrag(a):U.BufferHelper.isBuffered(h,a+.1)&&(s=this.getAppendedFrag(a+.1)),s){var g=this.fragPlaying,p=s.level;(!g||s.sn!==g.sn||g.level!==p||s.urlId!==g.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:s}),(!g||g.level!==p)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=s)}}},o(D,[{key:"nextLevel",get:function(){var h=this.nextBufferedFrag;return h?h.level:-1}},{key:"currentLevel",get:function(){var h=this.media;if(h){var s=this.getAppendedFrag(h.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var h=this.media;if(h){var s=this.getAppendedFrag(h.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(_.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"SubtitleStreamController",function(){return l});var V=L("./src/events.ts"),_=L("./src/utils/logger.ts"),k=L("./src/utils/buffer-helper.ts"),j=L("./src/controller/fragment-finders.ts"),U=L("./src/utils/discontinuities.ts"),O=L("./src/controller/level-helper.ts"),I=L("./src/controller/fragment-tracker.ts"),v=L("./src/controller/base-stream-controller.ts"),S=L("./src/types/loader.ts"),M=L("./src/types/level.ts");function w(u,x){for(var m=0;m<x.length;m++){var f=x[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}function A(u,x,m){return x&&w(u.prototype,x),m&&w(u,m),u}function C(u,x){u.prototype=Object.create(x.prototype),u.prototype.constructor=u,d(u,x)}function d(u,x){return d=Object.setPrototypeOf||function(f,D){return f.__proto__=D,f},d(u,x)}var o=500,l=function(u){C(x,u);function x(f,D){var b;return b=u.call(this,f,D,"[subtitle-stream-controller]")||this,b.levels=[],b.currentTrackId=-1,b.tracksBuffered=[],b.mainDetails=null,b._registerListeners(),b}var m=x.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=v.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,h=b.success;if(this.fragPrevious=c,this.state=v.State.IDLE,!h)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var a,g=c.start,p=0;p<s.length;p++)if(g>=s[p].start&&g<=s[p].end){a=s[p];break}var y=c.start+c.duration;a?a.end=y:(a={start:g,end:y},s.push(a)),this.fragmentTracker.fragBuffered(c)},m.onBufferFlushing=function(D,b){var c=b.startOffset,h=b.endOffset;if(c===0&&h!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,a=this.levels;if(!a.length||!a[s]||!a[s].details)return;var g=a[s].details,p=g.targetduration,y=h-p;if(y<=0)return;b.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(P){for(var G=0;G<P.length;){if(P[G].end<=y){P.shift();continue}else if(P[G].start<y)P[G].start=y;else break;G++}}),this.fragmentTracker.removeFragmentsInRange(c,y,S.PlaylistLevelType.SUBTITLE)}},m.onError=function(D,b){var c,h=b.frag;if(!h||h.type!==S.PlaylistLevelType.SUBTITLE)return;(c=this.fragCurrent)!==null&&c!==void 0&&c.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},m.onSubtitleTracksUpdated=function(D,b){var c=this,h=b.subtitleTracks;this.tracksBuffered=[],this.levels=h.map(function(s){return new M.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){c.tracksBuffered[s.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,h=b.details,s=b.id,a=this.currentTrackId,g=this.levels;if(!g.length)return;var p=g[a];if(s>=g.length||s!==a||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,h.live||(c=p.details)!==null&&c!==void 0&&c.live){var y=this.mainDetails;if(h.deltaUpdateFailed||!y)return;var P=y.fragments[0];if(!p.details)h.hasProgramDateTime&&y.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(h,y):P&&Object(O.addSliding)(h,P.start);else{var G=this.alignPlaylists(h,p.details);G===0&&P&&Object(O.addSliding)(h,P.start)}}if(p.details=h,this.levelLastLoaded=s,this.tick(),h.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var Q=Object(j.findFragmentByPTS)(null,h.fragments,this.media.currentTime,0);Q||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},m._handleFragmentLoadComplete=function(D){var b=D.frag,c=D.payload,h=b.decryptdata,s=this.hls;if(this.fragContextChanged(b))return;if(c&&c.byteLength>0&&h&&h.key&&h.iv&&h.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(c),h.key.buffer,h.iv.buffer).then(function(g){var p=performance.now();s.trigger(V.Events.FRAG_DECRYPTED,{frag:b,payload:g,stats:{tstart:a,tdecrypt:p}})})}},m.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,b=this.currentTrackId,c=this.levels;if(!c.length||!c[b]||!c[b].details)return;var h=c[b].details,s=h.targetduration,a=this.config,g=this.media,p=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,g.currentTime-s,a.maxBufferHole),y=p.end,P=p.len,G=this.getMaxBufferLength()+s;if(P>G)return;console.assert(h,"Subtitle track details are defined on idle subtitle stream controller tick");var Q=h.fragments,re=Q.length,z=h.edge,F,ne=this.fragPrevious;if(y<z){var ce=a.maxFragLookUpTolerance;ne&&h.hasProgramDateTime&&(F=Object(j.findFragmentByPDT)(Q,ne.endProgramDateTime,ce)),F||(F=Object(j.findFragmentByPTS)(ne,Q,y,ce),!F&&ne&&ne.start<Q[0].start&&(F=Q[0]))}else F=Q[re-1];(D=F)!==null&&D!==void 0&&D.encrypted?(_.logger.log("Loading key for "+F.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:F})):F&&this.fragmentTracker.getState(F)===I.FragmentState.NOT_LOADED&&this.loadFragment(F,h,y)}},m.loadFragment=function(D,b,c){this.fragCurrent=D,u.prototype.loadFragment.call(this,D,b,c)},A(x,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),x}(v.default)},"./src/controller/subtitle-track-controller.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/events.ts"),_=L("./src/utils/texttrack-utils.ts"),k=L("./src/controller/base-playlist-controller.ts"),j=L("./src/types/loader.ts");function U(w,A){for(var C=0;C<A.length;C++){var d=A[C];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(w,d.key,d)}}function O(w,A,C){return A&&U(w.prototype,A),C&&U(w,C),w}function I(w,A){w.prototype=Object.create(A.prototype),w.prototype.constructor=w,v(w,A)}function v(w,A){return v=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},v(w,A)}var S=function(w){I(A,w);function A(d){var o;return o=w.call(this,d,"[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,l){if(this.media=l.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},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=M(this.media.textTracks);o.forEach(function(l){Object(_.clearCurrentCues)(l)}),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,l){this.tracks=l.subtitleTracks},C.onSubtitleTrackLoaded=function(o,l){var u=l.id,x=l.details,m=this.trackId,f=this.tracksInGroup[m];if(!f){this.warn("Invalid subtitle track id "+u);return}var D=f.details;f.details=l.details,this.log("subtitle track "+u+" loaded ["+x.startSN+"-"+x.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,l,D))},C.onLevelLoading=function(o,l){this.switchLevel(l.level)},C.onLevelSwitching=function(o,l){this.switchLevel(l.level)},C.switchLevel=function(o){var l=this.hls.levels[o];if(!(l!=null&&l.textGroupIds))return;var u=l.textGroupIds[l.urlId];if(this.groupId!==u){var x=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(b){return!u||b.groupId===u});this.tracksInGroup=m;var f=this.findTrackId(x==null?void 0:x.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),f!==-1&&this.setSubtitleTrack(f,x)}},C.findTrackId=function(o){for(var l=this.tracksInGroup,u=0;u<l.length;u++){var x=l[u];if((!this.selectDefaultTrack||x.default)&&(!o||o===x.name))return x.id}return-1},C.onError=function(o,l){if(w.prototype.onError.call(this,o,l),l.fatal||!l.context)return;l.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},C.loadPlaylist=function(o){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var u=l.id,x=l.groupId,m=l.url;if(o)try{m=o.addDirectives(m)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Loading subtitle playlist for id "+u),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:m,id:u,groupId:x,deliveryDirectives:o||null})}},C.toggleTrackModes=function(o){var l=this,u=this.media,x=this.subtitleDisplay,m=this.trackId;if(!u)return;var f=M(u.textTracks),D=f.filter(function(h){return h.groupId===l.groupId});if(o===-1)[].slice.call(f).forEach(function(h){h.mode="disabled"});else{var b=D[m];b&&(b.mode="disabled")}var c=D[o];c&&(c.mode=x?"showing":"hidden")},C.setSubtitleTrack=function(o,l){var u,x=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(u=x[o])!==null&&u!==void 0&&u.details)||o<-1||o>=x.length)return;this.clearTimer();var m=x[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,m){var f=m.id,D=m.groupId,b=D===void 0?"":D,c=m.name,h=m.type,s=m.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:f,groupId:b,name:c,type:h,url:s});var a=this.switchParams(m.url,l==null?void 0:l.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,l=M(this.media.textTracks),u=0;u<l.length;u++)if(l[u].mode==="hidden")o=u;else if(l[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 l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,l)}}]),A}(k.default);function M(w){for(var A=[],C=0;C<w.length;C++){var d=w[C];d.kind==="subtitles"&&d.label&&A.push(w[C])}return A}Y.default=S},"./src/controller/timeline-controller.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"TimelineController",function(){return M});var V=L("./src/polyfills/number.ts"),_=L("./src/events.ts"),k=L("./src/utils/cea-608-parser.ts"),j=L("./src/utils/output-filter.ts"),U=L("./src/utils/webvtt-parser.ts"),O=L("./src/utils/texttrack-utils.ts"),I=L("./src/utils/imsc1-ttml-parser.ts"),v=L("./src/types/loader.ts"),S=L("./src/utils/logger.ts"),M=function(){function d(l){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=C(),this.captionsProperties=void 0,this.hls=l,this.config=l.config,this.Cues=l.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var u=new j.default(this,"textTrack1"),x=new j.default(this,"textTrack2"),m=new j.default(this,"textTrack3"),f=new j.default(this,"textTrack4");this.cea608Parser1=new k.default(1,u,x),this.cea608Parser2=new k.default(3,m,f)}l.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(_.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(_.Events.FRAG_LOADING,this.onFragLoading,this),l.on(_.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(_.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(_.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(_.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(_.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=d.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,x,m,f,D){for(var b=!1,c=D.length;c--;){var h=D[c],s=A(h[0],h[1],x,m);if(s>=0&&(h[0]=Math.min(h[0],x),h[1]=Math.max(h[1],m),b=!0,s/(m-x)>.5))return}if(b||D.push([x,m]),this.config.renderTextTracksNatively){var a=this.captionsTracks[u];this.Cues.newCue(a,x,m,f)}else{var g=this.Cues.newCue(null,x,m,f);this.hls.trigger(_.Events.CUES_PARSED,{type:"captions",cues:g,track:u})}},o.onInitPtsFound=function(u,x){var m=this,f=x.frag,D=x.id,b=x.initPTS,c=x.timescale,h=this.unparsedVttFrags;D==="main"&&(this.initPTS[f.cc]=b,this.timescale[f.cc]=c),h.length&&(this.unparsedVttFrags=[],h.forEach(function(s){m.onFragLoaded(_.Events.FRAG_LOADED,s)}))},o.getExistingTrack=function(u){var x=this.media;if(x)for(var m=0;m<x.textTracks.length;m++){var f=x.textTracks[m];if(f[u])return f}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 x=this.captionsProperties,m=this.captionsTracks,f=this.media,D=x[u],b=D.label,c=D.languageCode,h=this.getExistingTrack(u);if(h)m[u]=h,Object(O.clearCurrentCues)(m[u]),Object(O.sendAddTrackEvent)(m[u],f);else{var s=this.createTextTrack("captions",b,c);s&&(s[u]=!0,m[u]=s)}},o.createNonNativeTrack=function(u){if(this.nonNativeCaptionsTracks[u])return;var x=this.captionsProperties[u];if(!x)return;var m=x.label,f={_id:u,label:m,kind:"captions",default:x.media?!!x.media.default:!1,closedCaptions:x.media};this.nonNativeCaptionsTracks[u]=f,this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[f]})},o.createTextTrack=function(u,x,m){var f=this.media;return f?f.addTextTrack(u,x,m):void 0},o.onMediaAttaching=function(u,x){this.media=x.media,this._cleanTracks()},o.onMediaDetaching=function(){var u=this.captionsTracks;Object.keys(u).forEach(function(x){Object(O.clearCurrentCues)(u[x]),delete u[x]}),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 x=u.textTracks;if(x)for(var m=0;m<x.length;m++)Object(O.clearCurrentCues)(x[m])},o.onSubtitleTracksUpdated=function(u,x){var m=this;this.textTracks=[];var f=x.subtitleTracks||[],D=f.some(function(s){return s.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var b=this.tracks&&f&&this.tracks.length===f.length;if(this.tracks=f||[],this.config.renderTextTracksNatively){var c=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,a){var g;if(a<c.length){for(var p=null,y=0;y<c.length;y++)if(w(c[y],s)){p=c[y];break}p&&(g=p)}g?Object(O.clearCurrentCues)(g):(g=m.createTextTrack("subtitles",s.name,s.lang),g&&(g.mode="disabled")),g&&(g.groupId=s.groupId,m.textTracks.push(g))})}else if(!b&&this.tracks&&this.tracks.length){var h=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(_.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:h})}}},o.onManifestLoaded=function(u,x){var m=this;this.config.enableCEA708Captions&&x.captions&&x.captions.forEach(function(f){var D=/(?:CC|SERVICE)([1-4])/.exec(f.instreamId);if(!D)return;var b="textTrack"+D[1],c=m.captionsProperties[b];if(!c)return;c.label=f.name,f.lang&&(c.languageCode=f.lang),c.media=f})},o.onFragLoading=function(u,x){var m=this.cea608Parser1,f=this.cea608Parser2,D=this.lastSn,b=this.lastPartIndex;if(!this.enabled||!(m&&f))return;if(x.frag.type===v.PlaylistLevelType.MAIN){var c,h,s=x.frag.sn,a=(c=x==null||((h=x.part)===null||h===void 0)?void 0:h.index)!=null?c:-1;s===D+1||s===D&&a===b+1||(m.reset(),f.reset()),this.lastSn=s,this.lastPartIndex=a}},o.onFragLoaded=function(u,x){var m=x.frag,f=x.payload,D=this.initPTS,b=this.unparsedVttFrags;if(m.type===v.PlaylistLevelType.SUBTITLE)if(f.byteLength){if(!Object(V.isFiniteNumber)(D[m.cc])){b.push(x),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 h=this.tracks[m.level],s=this.vttCCs;s[m.cc]||(s[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),h&&h.textCodec===I.IMSC1_CODEC?this._parseIMSC1(m,f):this._parseVTTs(m,f,s)}}else this.hls.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(u,x){var m=this,f=this.hls;Object(I.parseIMSC1)(x,this.initPTS[u.cc],this.timescale[u.cc],function(D){m._appendCues(D,u.level),f.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(D){S.logger.log("Failed to parse IMSC1: "+D),f.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:D})})},o._parseVTTs=function(u,x,m){var f=this,D=this.hls;Object(U.parseWebVTT)(x,this.initPTS[u.cc],this.timescale[u.cc],m,u.cc,u.start,function(b){f._appendCues(b,u.level),D.trigger(_.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(b){f._fallbackToIMSC1(u,x),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,x){var m=this,f=this.tracks[u.level];f.textCodec||Object(I.parseIMSC1)(x,this.initPTS[u.cc],this.timescale[u.cc],function(){f.textCodec=I.IMSC1_CODEC,m._parseIMSC1(u,x)},function(){f.textCodec="wvtt"})},o._appendCues=function(u,x){var m=this.hls;if(this.config.renderTextTracksNatively){var f=this.textTracks[x];if(f.mode==="disabled")return;u.forEach(function(c){return Object(O.addCueToTrack)(f,c)})}else{var D=this.tracks[x],b=D.default?"default":"subtitles"+x;m.trigger(_.Events.CUES_PARSED,{type:"subtitles",cues:u,track:b})}},o.onFragDecrypted=function(u,x){var m=x.frag;if(m.type===v.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(x);return}this.onFragLoaded(_.Events.FRAG_LOADED,x)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(u,x){var m=this.cea608Parser1,f=this.cea608Parser2;if(!this.enabled||!(m&&f))return;for(var D=0;D<x.samples.length;D++){var b=x.samples[D].bytes;if(b){var c=this.extractCea608Data(b);m.addData(x.samples[D].pts,c[0]),f.addData(x.samples[D].pts,c[1])}}},o.onBufferFlushing=function(u,x){var m=x.startOffset,f=x.endOffset,D=x.endOffsetSubtitles,b=x.type,c=this.media;if(!c||c.currentTime<f)return;if(!b||b==="video"){var h=this.captionsTracks;Object.keys(h).forEach(function(a){return Object(O.removeCuesInRange)(h[a],m,f)})}if(this.config.renderTextTracksNatively&&(m===0&&D!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(a){return Object(O.removeCuesInRange)(s[a],m,D)})}},o.extractCea608Data=function(u){for(var x=u[0]&31,m=2,f=[[],[]],D=0;D<x;D++){var b=u[m++],c=127&u[m++],h=127&u[m++],s=(4&b)!==0,a=3&b;if(c===0&&h===0)continue;s&&((a===0||a===1)&&(f[a].push(c),f[a].push(h)))}return f},d}();function w(d,o){return d&&d.label===o.name&&!(d.textTrack1||d.textTrack2)}function A(d,o,l,u){return Math.min(o,u)-Math.max(d,l)}function C(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return V});var V=function(){function _(j,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=U}var k=_.prototype;return k.decrypt=function(U,O){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},O,U)},_}()},"./src/crypt/aes-decryptor.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"removePadding",function(){return _}),L.d(Y,"default",function(){return k});var V=L("./src/utils/typed-array.ts");function _(j){var U=j.byteLength,O=U&&new DataView(j.buffer).getUint8(U-1);return O?Object(V.sliceUint8)(j,0,U-O):j}var k=function(){function j(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=j.prototype;return U.uint8ArrayToUint32Array_=function(I){for(var v=new DataView(I),S=new Uint32Array(4),M=0;M<4;M++)S[M]=v.getUint32(M*4);return S},U.initTable=function(){var I=this.sBox,v=this.invSBox,S=this.subMix,M=S[0],w=S[1],A=S[2],C=S[3],d=this.invSubMix,o=d[0],l=d[1],u=d[2],x=d[3],m=new Uint32Array(256),f=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,I[f]=c,v[c]=f;var h=m[f],s=m[h],a=m[s],g=m[c]*257^c*16843008;M[f]=g<<24|g>>>8,w[f]=g<<16|g>>>16,A[f]=g<<8|g>>>24,C[f]=g,g=a*16843009^s*65537^h*257^f*16843008,o[c]=g<<24|g>>>8,l[c]=g<<16|g>>>16,u[c]=g<<8|g>>>24,x[c]=g,f?(f=h^m[m[m[a^h]]],D^=m[m[D]]):f=D=1}},U.expandKey=function(I){for(var v=this.uint8ArrayToUint32Array_(I),S=!0,M=0;M<v.length&&S;)S=v[M]===this.key[M],M++;if(S)return;this.key=v;var w=this.keySize=v.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,d,o=this.keySchedule=new Uint32Array(A),l=this.invKeySchedule=new Uint32Array(A),u=this.sBox,x=this.rcon,m=this.invSubMix,f=m[0],D=m[1],b=m[2],c=m[3],h,s;for(C=0;C<A;C++){if(C<w){h=o[C]=v[C];continue}s=h,C%w===0?(s=s<<8|s>>>24,s=u[s>>>24]<<24|u[s>>>16&255]<<16|u[s>>>8&255]<<8|u[s&255],s^=x[C/w|0]<<24):w>6&&C%w===4&&(s=u[s>>>24]<<24|u[s>>>16&255]<<16|u[s>>>8&255]<<8|u[s&255]),o[C]=h=(o[C-w]^s)>>>0}for(d=0;d<A;d++)C=A-d,d&3?s=o[C]:s=o[C-4],d<4||C<=4?l[d]=s:l[d]=f[u[s>>>24]]^D[u[s>>>16&255]]^b[u[s>>>8&255]]^c[u[s&255]],l[d]=l[d]>>>0},U.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},U.decrypt=function(I,v,S){for(var M=this.keySize+6,w=this.invKeySchedule,A=this.invSBox,C=this.invSubMix,d=C[0],o=C[1],l=C[2],u=C[3],x=this.uint8ArrayToUint32Array_(S),m=x[0],f=x[1],D=x[2],b=x[3],c=new Int32Array(I),h=new Int32Array(c.length),s,a,g,p,y,P,G,Q,re,z,F,ne,ce,ge,be=this.networkToHostOrderSwap;v<c.length;){for(re=be(c[v]),z=be(c[v+1]),F=be(c[v+2]),ne=be(c[v+3]),y=re^w[0],P=ne^w[1],G=F^w[2],Q=z^w[3],ce=4,ge=1;ge<M;ge++)s=d[y>>>24]^o[P>>16&255]^l[G>>8&255]^u[Q&255]^w[ce],a=d[P>>>24]^o[G>>16&255]^l[Q>>8&255]^u[y&255]^w[ce+1],g=d[G>>>24]^o[Q>>16&255]^l[y>>8&255]^u[P&255]^w[ce+2],p=d[Q>>>24]^o[y>>16&255]^l[P>>8&255]^u[G&255]^w[ce+3],y=s,P=a,G=g,Q=p,ce=ce+4;s=A[y>>>24]<<24^A[P>>16&255]<<16^A[G>>8&255]<<8^A[Q&255]^w[ce],a=A[P>>>24]<<24^A[G>>16&255]<<16^A[Q>>8&255]<<8^A[y&255]^w[ce+1],g=A[G>>>24]<<24^A[Q>>16&255]<<16^A[y>>8&255]<<8^A[P&255]^w[ce+2],p=A[Q>>>24]<<24^A[y>>16&255]<<16^A[P>>8&255]<<8^A[G&255]^w[ce+3],h[v]=be(s^m),h[v+1]=be(p^f),h[v+2]=be(g^D),h[v+3]=be(a^b),m=re,f=z,D=F,b=ne,v=v+4}return h.buffer},j}()},"./src/crypt/decrypter.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return v});var V=L("./src/crypt/aes-crypto.ts"),_=L("./src/crypt/fast-aes-key.ts"),k=L("./src/crypt/aes-decryptor.ts"),j=L("./src/utils/logger.ts"),U=L("./src/utils/mp4-tools.ts"),O=L("./src/utils/typed-array.ts"),I=16,v=function(){function S(w,A,C){var d=C===void 0?{}:C,o=d.removePKCS7Padding,l=o===void 0?!0:o;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=w,this.config=A,this.removePKCS7Padding=l,l)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(x){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var M=S.prototype;return M.destroy=function(){this.observer=null},M.isSync=function(){return this.config.enableSoftwareAES},M.flush=function(){var A=this.currentResult;if(!A){this.reset();return}var C=new Uint8Array(A);return this.reset(),this.removePKCS7Padding?Object(k.removePadding)(C):C},M.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},M.decrypt=function(A,C,d,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(A),C,d);var l=this.flush();l&&o(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(A),C,d).then(o)},M.softwareDecrypt=function(A,C,d){var o=this.currentIV,l=this.currentResult,u=this.remainderData;this.logOnce("JS AES decrypt"),u&&(A=Object(U.appendUint8Array)(u,A),this.remainderData=null);var x=this.getValidChunk(A);if(!x.length)return null;o&&(d=o);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new k.default),m.expandKey(C);var f=l;return this.currentResult=m.decrypt(x.buffer,0,d),this.currentIV=Object(O.sliceUint8)(x,-16).buffer,f||null},M.webCryptoDecrypt=function(A,C,d){var o=this,l=this.subtle;return(this.key!==C||!this.fastAesKey)&&(this.key=C,this.fastAesKey=new _.default(l,C)),this.fastAesKey.expandKey().then(function(u){if(!l)return Promise.reject(new Error("web crypto not initialized"));var x=new V.default(l,d);return x.decrypt(A.buffer,u)}).catch(function(u){return o.onWebCryptoError(u,A,C,d)})},M.onWebCryptoError=function(A,C,d,o){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",A),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(C,d,o)},M.getValidChunk=function(A){var C=A,d=A.length-A.length%I;return d!==A.length&&(C=Object(O.sliceUint8)(A,0,d),this.remainderData=Object(O.sliceUint8)(A,d)),C},M.logOnce=function(A){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+A),this.logEnabled=!1},S}()},"./src/crypt/fast-aes-key.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return V});var V=function(){function _(j,U){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=U}var k=_.prototype;return k.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},_}()},"./src/demux/aacdemuxer.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/demux/base-audio-demuxer.ts"),_=L("./src/demux/adts.ts"),k=L("./src/utils/logger.ts"),j=L("./src/demux/id3.ts");function U(v,S){v.prototype=Object.create(S.prototype),v.prototype.constructor=v,O(v,S)}function O(v,S){return O=Object.setPrototypeOf||function(w,A){return w.__proto__=A,w},O(v,S)}var I=function(v){U(S,v);function S(w,A){var C;return C=v.call(this)||this,C.observer=void 0,C.config=void 0,C.observer=w,C.config=A,C}var M=S.prototype;return M.resetInitSegment=function(A,C,d){v.prototype.resetInitSegment.call(this,A,C,d),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:A,duration:d,inputTimeScale:9e4,dropped:0}},S.probe=function(A){if(!A)return!1;for(var C=j.getID3Data(A,0)||[],d=C.length,o=A.length;d<o;d++)if(_.probe(A,d))return k.logger.log("ADTS sync word found !"),!0;return!1},M.canParse=function(A,C){return _.canParse(A,C)},M.appendFrame=function(A,C,d){_.initTrackConfig(A,this.observer,C,d,A.manifestCodec);var o=_.appendFrame(A,C,d,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},S}(V.default);I.minProbeByteLength=9,Y.default=I},"./src/demux/adts.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"getAudioConfig",function(){return j}),L.d(Y,"isHeaderPattern",function(){return U}),L.d(Y,"getHeaderLength",function(){return O}),L.d(Y,"getFullFrameLength",function(){return I}),L.d(Y,"canGetFrameLength",function(){return v}),L.d(Y,"isHeader",function(){return S}),L.d(Y,"canParse",function(){return M}),L.d(Y,"probe",function(){return w}),L.d(Y,"initTrackConfig",function(){return A}),L.d(Y,"getFrameDuration",function(){return C}),L.d(Y,"parseFrameHeader",function(){return d}),L.d(Y,"appendFrame",function(){return o});var V=L("./src/utils/logger.ts"),_=L("./src/errors.ts"),k=L("./src/events.ts");function j(l,u,x,m){var f,D,b,c,h=navigator.userAgent.toLowerCase(),s=m,a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];f=((u[x+2]&192)>>>6)+1;var g=(u[x+2]&60)>>>2;if(g>a.length-1){l.trigger(k.Events.ERROR,{type:_.ErrorTypes.MEDIA_ERROR,details:_.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g});return}return b=(u[x+2]&1)<<2,b|=(u[x+3]&192)>>>6,V.logger.log("manifest codec:"+m+", ADTS type:"+f+", samplingIndex:"+g),/firefox/i.test(h)?g>=6?(f=5,c=new Array(4),D=g-3):(f=2,c=new Array(2),D=g):h.indexOf("android")!==-1?(f=2,c=new Array(2),D=g):(f=5,c=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&g>=6?D=g-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(g>=6&&b===1||/vivaldi/i.test(h))||!m&&b===1)&&(f=2,c=new Array(2)),D=g)),c[0]=f<<3,c[0]|=(g&14)>>1,c[1]|=(g&1)<<7,c[1]|=b<<3,f===5&&(c[1]|=(D&14)>>1,c[2]=(D&1)<<7,c[2]|=2<<2,c[3]=0),{config:c,samplerate:a[g],channelCount:b,codec:"mp4a.40."+f,manifestCodec:s}}function U(l,u){return l[u]===255&&(l[u+1]&246)===240}function O(l,u){return l[u+1]&1?7:9}function I(l,u){return(l[u+3]&3)<<11|l[u+4]<<3|(l[u+5]&224)>>>5}function v(l,u){return u+5<l.length}function S(l,u){return u+1<l.length&&U(l,u)}function M(l,u){return v(l,u)&&U(l,u)&&I(l,u)<=l.length-u}function w(l,u){if(S(l,u)){var x=O(l,u);if(u+x>=l.length)return!1;var m=I(l,u);if(m<=x)return!1;var f=u+m;return f===l.length||S(l,f)}return!1}function A(l,u,x,m,f){if(!l.samplerate){var D=j(u,x,m,f);if(!D)return;l.config=D.config,l.samplerate=D.samplerate,l.channelCount=D.channelCount,l.codec=D.codec,l.manifestCodec=D.manifestCodec,V.logger.log("parsed codec:"+l.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function C(l){return 1024*9e4/l}function d(l,u,x,m,f){var D=O(l,u),b=I(l,u);if(b-=D,b>0){var c=x+m*f;return{headerLength:D,frameLength:b,stamp:c}}}function o(l,u,x,m,f){var D=C(l.samplerate),b=d(u,x,m,f,D);if(b){var c=b.frameLength,h=b.headerLength,s=b.stamp,a=h+c,g=Math.max(0,x+a-u.length),p;g?(p=new Uint8Array(a-h),p.set(u.subarray(x+h,u.length),0)):p=u.subarray(x+h,x+a);var y={unit:p,pts:s};return g||l.samples.push(y),{sample:y,length:a,missing:g}}}},"./src/demux/base-audio-demuxer.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"initPTSFn",function(){return I});var V=L("./src/polyfills/number.ts"),_=L("./src/demux/id3.ts"),k=L("./src/demux/dummy-demuxed-track.ts"),j=L("./src/utils/mp4-tools.ts"),U=L("./src/utils/typed-array.ts"),O=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var S=v.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(j.appendUint8Array)(this.cachedData,w),this.cachedData=null);var C=_.getID3Data(w,0),d=C?C.length:0,o,l,u=this._audioTrack,x=this._id3Track,m=C?_.getTimeStamp(C):void 0,f=w.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(m,A)),C&&C.length>0&&x.samples.push({pts:this.initPTS,dts:this.initPTS,data:C}),l=this.initPTS;d<f;){if(this.canParse(w,d)){var D=this.appendFrame(u,w,d);D?(this.frameIndex++,l=D.sample.pts,d+=D.length,o=d):d=f}else _.canParse(w,d)?(C=_.getID3Data(w,d),x.samples.push({pts:l,dts:l,data:C}),d+=C.length,o=d):d++;if(d===f&&o!==f){var b=Object(U.sliceUint8)(w,o);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,b):this.cachedData=b}}return{audioTrack:u,avcTrack:Object(k.dummyTrack)(),id3Track:x,textTrack:Object(k.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(k.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(k.dummyTrack)()}},S.destroy=function(){},v}(),I=function(S,M){return Object(V.isFiniteNumber)(S)?S*90:M*9e4};Y.default=O},"./src/demux/chunk-cache.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return V});var V=function(){function k(){this.chunks=[],this.dataLength=0}var j=k.prototype;return j.push=function(O){this.chunks.push(O),this.dataLength+=O.length},j.flush=function(){var O=this.chunks,I=this.dataLength,v;if(O.length)O.length===1?v=O[0]:v=_(O,I);else return new Uint8Array(0);return this.reset(),v},j.reset=function(){this.chunks.length=0,this.dataLength=0},k}();function _(k,j){for(var U=new Uint8Array(j),O=0,I=0;I<k.length;I++){var v=k[I];U.set(v,O),O+=v.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(ue,Y,L){"use strict";L.r(Y),L.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(ue,Y,L){"use strict";L.r(Y);var V=L("./src/utils/logger.ts"),_=function(){function k(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var j=k.prototype;return j.loadWord=function(){var O=this.data,I=this.bytesAvailable,v=O.byteLength-I,S=new Uint8Array(4),M=Math.min(4,I);if(M===0)throw new Error("no bytes available");S.set(O.subarray(v,v+M)),this.word=new DataView(S.buffer).getUint32(0),this.bitsAvailable=M*8,this.bytesAvailable-=M},j.skipBits=function(O){var I;this.bitsAvailable>O?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,I=O>>3,O-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},j.readBits=function(O){var I=Math.min(this.bitsAvailable,O),v=this.word>>>32-I;return O>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=O-I,I>0&&this.bitsAvailable?v<<I|this.readBits(I):v},j.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()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},j.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(O){for(var I=8,v=8,S,M=0;M<O;M++)v!==0&&(S=this.readEG(),v=(I+S+256)%256),I=v===0?I:v},j.readSPS=function(){var O=0,I=0,v=0,S=0,M,w,A,C=this.readUByte.bind(this),d=this.readBits.bind(this),o=this.readUEG.bind(this),l=this.readBoolean.bind(this),u=this.skipBits.bind(this),x=this.skipEG.bind(this),m=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);C();var D=C();if(d(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),l())for(w=b!==3?8:12,A=0;A<w;A++)l()&&(A<6?f(16):f(64))}m();var c=o();if(c===0)o();else if(c===1)for(u(1),x(),x(),M=o(),A=0;A<M;A++)x();m(),u(1);var h=o(),s=o(),a=d(1);a===0&&u(1),u(1),l()&&(O=o(),I=o(),v=o(),S=o());var g=[1,1];if(l()&&l()){var p=C();switch(p){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[C()<<8|C(),C()<<8|C()];break}}}return{width:Math.ceil((h+1)*16-O*2-I*2),height:(2-a)*(s+1)*16-(a?2:4)*(v+S),pixelRatio:g}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},k}();Y.default=_},"./src/demux/id3.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"isHeader",function(){return V}),L.d(Y,"isFooter",function(){return _}),L.d(Y,"getID3Data",function(){return k}),L.d(Y,"canParse",function(){return U}),L.d(Y,"getTimeStamp",function(){return O}),L.d(Y,"isTimeStampFrame",function(){return I}),L.d(Y,"getID3Frames",function(){return S}),L.d(Y,"decodeFrame",function(){return M}),L.d(Y,"utf8ArrayToStr",function(){return o}),L.d(Y,"testables",function(){return l});var V=function(f,D){return D+10<=f.length&&(f[D]===73&&f[D+1]===68&&f[D+2]===51&&(f[D+3]<255&&f[D+4]<255&&(f[D+6]<128&&f[D+7]<128&&f[D+8]<128&&f[D+9]<128)))},_=function(f,D){return D+10<=f.length&&(f[D]===51&&f[D+1]===68&&f[D+2]===73&&(f[D+3]<255&&f[D+4]<255&&(f[D+6]<128&&f[D+7]<128&&f[D+8]<128&&f[D+9]<128)))},k=function(f,D){for(var b=D,c=0;V(f,D);){c+=10;var h=j(f,D+6);c+=h,_(f,D+10)&&(c+=10),D+=c}return c>0?f.subarray(b,b+c):void 0},j=function(f,D){var b=0;return b=(f[D]&127)<<21,b|=(f[D+1]&127)<<14,b|=(f[D+2]&127)<<7,b|=f[D+3]&127,b},U=function(f,D){return V(f,D)&&j(f,D+6)+10<=f.length-D},O=function(f){for(var D=S(f),b=0;b<D.length;b++){var c=D[b];if(I(c))return d(c)}return},I=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},v=function(f){var D=String.fromCharCode(f[0],f[1],f[2],f[3]),b=j(f,4),c=10;return{type:D,size:b,data:f.subarray(c,c+b)}},S=function(f){for(var D=0,b=[];V(f,D);){var c=j(f,D+6);D+=10;for(var h=D+c;D+8<h;){var s=v(f.subarray(D)),a=M(s);a&&b.push(a),D+=s.size+10}_(f,D)&&(D+=10)}return b},M=function(f){return f.type==="PRIV"?w(f):f.type[0]==="W"?C(f):A(f)},w=function(f){if(f.size<2)return;var D=o(f.data,!0),b=new Uint8Array(f.data.subarray(D.length+1));return{key:f.type,info:D,data:b.buffer}},A=function(f){if(f.size<2)return;if(f.type==="TXXX"){var D=1,b=o(f.data.subarray(D),!0);D+=b.length+1;var c=o(f.data.subarray(D));return{key:f.type,info:b,data:c}}var h=o(f.data.subarray(1));return{key:f.type,data:h}},C=function(f){if(f.type==="WXXX"){if(f.size<2)return;var D=1,b=o(f.data.subarray(D),!0);D+=b.length+1;var c=o(f.data.subarray(D));return{key:f.type,info:b,data:c}}var h=o(f.data);return{key:f.type,data:h}},d=function(f){if(f.data.byteLength===8){var D=new Uint8Array(f.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(f,D){D===void 0&&(D=!1);var b=x();if(b){var c=b.decode(f);if(D){var h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}for(var s=f.length,a,g,p,y="",P=0;P<s;){if(a=f[P++],a===0&&D)return y;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:y+=String.fromCharCode(a);break;case 12:case 13:g=f[P++],y+=String.fromCharCode((a&31)<<6|g&63);break;case 14:g=f[P++],p=f[P++],y+=String.fromCharCode((a&15)<<12|(g&63)<<6|(p&63)<<0);break;default:}}return y},l={decodeTextFrame:A},u;function x(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/demux/base-audio-demuxer.ts"),_=L("./src/demux/id3.ts"),k=L("./src/utils/logger.ts"),j=L("./src/demux/mpegaudio.ts");function U(v,S){v.prototype=Object.create(S.prototype),v.prototype.constructor=v,O(v,S)}function O(v,S){return O=Object.setPrototypeOf||function(w,A){return w.__proto__=A,w},O(v,S)}var I=function(v){U(S,v);function S(){return v.apply(this,arguments)||this}var M=S.prototype;return M.resetInitSegment=function(A,C,d){v.prototype.resetInitSegment.call(this,A,C,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:A,duration:d,inputTimeScale:9e4,dropped:0}},S.probe=function(A){if(!A)return!1;for(var C=_.getID3Data(A,0)||[],d=C.length,o=A.length;d<o;d++)if(j.probe(A,d))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},M.canParse=function(A,C){return j.canParse(A,C)},M.appendFrame=function(A,C,d){return this.initPTS===null?void 0:j.appendFrame(A,C,d,this.initPTS,this.frameIndex)},S}(V.default);I.minProbeByteLength=4,Y.default=I},"./src/demux/mp4demuxer.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/utils/mp4-tools.ts"),_=L("./src/demux/dummy-demuxed-track.ts"),k=function(){function j(O,I){this.remainderData=null,this.config=void 0,this.config=I}var U=j.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},j.probe=function(I){return Object(V.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},U.demux=function(I){var v=I,S=Object(_.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(V.appendUint8Array)(this.remainderData,I));var M=Object(V.segmentValidRange)(v);this.remainderData=M.remainder,S.samples=M.valid||new Uint8Array}else S.samples=v;return{audioTrack:Object(_.dummyTrack)(),avcTrack:S,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},U.flush=function(){var I=Object(_.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(_.dummyTrack)(),avcTrack:I,id3Track:Object(_.dummyTrack)(),textTrack:Object(_.dummyTrack)()}},U.demuxSampleAes=function(I,v,S){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},j}();k.minProbeByteLength=1024,Y.default=k},"./src/demux/mpegaudio.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"appendFrame",function(){return O}),L.d(Y,"parseHeader",function(){return I}),L.d(Y,"isHeaderPattern",function(){return v}),L.d(Y,"isHeader",function(){return S}),L.d(Y,"canParse",function(){return M}),L.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],k=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function O(A,C,d,o,l){if(d+24>C.length)return;var u=I(C,d);if(u&&d+u.frameLength<=C.length){var x=u.samplesPerFrame*9e4/u.sampleRate,m=o+l*x,f={unit:C.subarray(d,d+u.frameLength),pts:m,dts:m};return A.config=[],A.channelCount=u.channelCount,A.samplerate=u.sampleRate,A.samples.push(f),{sample:f,length:u.frameLength,missing:0}}}function I(A,C){var d=A[C+1]>>3&3,o=A[C+1]>>1&3,l=A[C+2]>>4&15,u=A[C+2]>>2&3;if(d!==1&&l!==0&&l!==15&&u!==3){var x=A[C+2]>>1&1,m=A[C+3]>>6,f=d===3?3-o:o===3?3:4,D=_[f*14+l-1]*1e3,b=d===3?0:d===2?1:2,c=k[b*3+u],h=m===3?1:2,s=j[d][o],a=U[o],g=s*8*a,p=Math.floor(s*D/c+x)*a;if(V===null){var y=navigator.userAgent||"",P=y.match(/Chrome\/(\d+)/i);V=P?parseInt(P[1]):0}var G=!!V&&V<=87;return G&&o===2&&D>=224e3&&m===0&&(A[C+3]=A[C+3]|128),{sampleRate:c,channelCount:h,frameLength:p,samplesPerFrame:g}}}function v(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&&v(A,C)}function M(A,C){var d=4;return v(A,C)&&d<=A.length-C}function w(A,C){if(C+1<A.length&&v(A,C)){var d=4,o=I(A,C),l=d;o!=null&&o.frameLength&&(l=o.frameLength);var u=C+l;return u===A.length||S(A,u)}return!1}},"./src/demux/sample-aes.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/crypt/decrypter.ts"),_=L("./src/demux/tsdemuxer.ts"),k=function(){function j(O,I,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new V.default(O,I,{removePKCS7Padding:!1})}var U=j.prototype;return U.decryptBuffer=function(I,v){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,v)},U.decryptAacSample=function(I,v,S,M){var w=I[v].unit,A=w.subarray(16,w.length-w.length%16),C=A.buffer.slice(A.byteOffset,A.byteOffset+A.length),d=this;this.decryptBuffer(C,function(o){var l=new Uint8Array(o);w.set(l,16),M||d.decryptAacSamples(I,v+1,S)})},U.decryptAacSamples=function(I,v,S){for(;;v++){if(v>=I.length){S();return}if(I[v].unit.length<32)continue;var M=this.decrypter.isSync();if(this.decryptAacSample(I,v,S,M),!M)return}},U.getAvcEncryptedData=function(I){for(var v=Math.floor((I.length-48)/160)*16+16,S=new Int8Array(v),M=0,w=32;w<=I.length-16;w+=160,M+=16)S.set(I.subarray(w,w+16),M);return S},U.getAvcDecryptedUnit=function(I,v){for(var S=new Uint8Array(v),M=0,w=32;w<=I.length-16;w+=160,M+=16)I.set(S.subarray(M,M+16),w);return I},U.decryptAvcSample=function(I,v,S,M,w,A){var C=Object(_.discardEPB)(w.data),d=this.getAvcEncryptedData(C),o=this;this.decryptBuffer(d.buffer,function(l){w.data=o.getAvcDecryptedUnit(C,l),A||o.decryptAvcSamples(I,v,S+1,M)})},U.decryptAvcSamples=function(I,v,S,M){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,S=0){if(v>=I.length){M();return}for(var w=I[v].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(I,v,S,M,A,C),!C)return}}},j}();Y.default=k},"./src/demux/transmuxer-interface.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return w});var V=L("./node_modules/webworkify-webpack/index.js"),_=L.n(V),k=L("./src/events.ts"),j=L("./src/demux/transmuxer.ts"),U=L("./src/utils/logger.ts"),O=L("./src/errors.ts"),I=L("./src/utils/mediasource-helper.ts"),v=L("./node_modules/eventemitter3/index.js"),S=L.n(v),M=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},w=function(){function A(d,o,l,u){var x=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=d,this.id=o,this.onTransmuxComplete=l,this.onFlush=u;var m=d.config,f=function(s,a){a=a||{},a.frag=x.frag,a.id=x.id,d.trigger(s,a)};this.observer=new v.EventEmitter,this.observer.on(k.Events.FRAG_DECRYPTED,f),this.observer.on(k.Events.ERROR,f);var D={mp4:M.isTypeSupported("video/mp4"),mpeg:M.isTypeSupported("audio/mpeg"),mp3:M.isTypeSupported('audio/mp4; codecs="mp3"')},b=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){U.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(h){d.trigger(k.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(h.message+" ("+h.filename+":"+h.lineno+")")})},c.postMessage({cmd:"init",typeSupported:D,vendor:b,id:o,config:JSON.stringify(m)})}catch(h){U.logger.warn("Error in worker:",h),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new j.default(this.observer,D,m,b,o),this.worker=null}}else this.transmuxer=new j.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 l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.observer=null},C.push=function(o,l,u,x,m,f,D,b,c,h){var s=this;c.transmuxing.start=self.performance.now();var a=this.transmuxer,g=this.worker,p=f?f.start:m.start,y=m.decryptdata,P=this.frag,G=!(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,F=!Q&&(re===1||re===0&&z===1),ne=self.performance.now();(Q||re||m.stats.parsing.start===0)&&(m.stats.parsing.start=ne),f&&(z||!F)&&(f.stats.parsing.start=ne);var ce=new j.TransmuxState(G,F,b,Q,p);if(!F||G){U.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+`
discontinuity: `+G+`
trackSwitch: `+Q+`
contiguous: `+F+`
accurateTimeOffset: `+b+`
timeOffset: `+p);var ge=new j.TransmuxConfig(u,x,l,D,h);this.configureTransmuxer(ge)}if(this.frag=m,this.part=f,g)g.postMessage({cmd:"demux",data:o,decryptdata:y,chunkMeta:c,state:ce},o instanceof ArrayBuffer?[o]:[]);else if(a){var be=a.push(o,y,c,ce);Object(j.isPromise)(be)?be.then(function(Be){s.handleTransmuxComplete(Be)}):this.handleTransmuxComplete(be)}},C.flush=function(o){var l=this;o.transmuxing.start=self.performance.now();var u=this.transmuxer,x=this.worker;if(x)x.postMessage({cmd:"flush",chunkMeta:o});else if(u){var m=u.flush(o);Object(j.isPromise)(m)?m.then(function(f){l.handleFlushResult(f,o)}):this.handleFlushResult(m,o)}},C.handleFlushResult=function(o,l){var u=this;o.forEach(function(x){u.handleTransmuxComplete(x)}),this.onFlush(l)},C.onWorkerMessage=function(o){var l=o.data,u=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,u.trigger(l.event,l.data);break}}},C.configureTransmuxer=function(o){var l=this.worker,u=this.transmuxer;l?l.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(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return O});var V=L("./src/demux/transmuxer.ts"),_=L("./src/events.ts"),k=L("./src/utils/logger.ts"),j=L("./node_modules/eventemitter3/index.js"),U=L.n(j);function O(w){var A=new j.EventEmitter,C=function(o,l){w.postMessage({event:o,data:l})};A.on(_.Events.FRAG_DECRYPTED,C),A.on(_.Events.ERROR,C),w.addEventListener("message",function(d){var o=d.data;switch(o.cmd){case"init":{var l=JSON.parse(o.config);w.transmuxer=new V.default(A,o.typeSupported,l,o.vendor,o.id),Object(k.enableLogs)(l.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(f){I(w,f)}):I(w,u);break}case"flush":{var x=o.chunkMeta,m=w.transmuxer.flush(x);Object(V.isPromise)(m)?m.then(function(f){S(w,f,x)}):S(w,m,x);break}default:break}})}function I(w,A){if(M(A.remuxResult))return;var C=[],d=A.remuxResult,o=d.audio,l=d.video;o&&v(C,o),l&&v(C,l),w.postMessage({event:"transmuxComplete",data:A},C)}function v(w,A){A.data1&&w.push(A.data1.buffer),A.data2&&w.push(A.data2.buffer)}function S(w,A,C){A.forEach(function(d){I(w,d)}),w.postMessage({event:"flush",data:C})}function M(w){return!w.audio&&!w.video&&!w.text&&!w.id3&&!w.initSegment}},"./src/demux/transmuxer.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return l}),L.d(Y,"isPromise",function(){return m}),L.d(Y,"TransmuxConfig",function(){return f}),L.d(Y,"TransmuxState",function(){return D});var V=L("./src/events.ts"),_=L("./src/errors.ts"),k=L("./src/crypt/decrypter.ts"),j=L("./src/demux/aacdemuxer.ts"),U=L("./src/demux/mp4demuxer.ts"),O=L("./src/demux/tsdemuxer.ts"),I=L("./src/demux/mp3demuxer.ts"),v=L("./src/remux/mp4-remuxer.ts"),S=L("./src/remux/passthrough-remuxer.ts"),M=L("./src/demux/chunk-cache.ts"),w=L("./src/utils/mp4-tools.ts"),A=L("./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 d=[{demux:O.default,remux:v.default},{demux:U.default,remux:S.default},{demux:j.default,remux:v.default},{demux:I.default,remux:v.default}],o=1024;d.forEach(function(b){var c=b.demux;o=Math.max(o,c.minProbeByteLength)});var l=function(){function b(h,s,a,g,p){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new M.default,this.observer=h,this.typeSupported=s,this.config=a,this.vendor=g,this.id=p}var c=b.prototype;return c.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},c.push=function(s,a,g,p){var y=this,P=g.transmuxing;P.executeStart=C();var G=new Uint8Array(s),Q=this.cache,re=this.config,z=this.currentTransmuxState,F=this.transmuxConfig;p&&(this.currentTransmuxState=p);var ne=u(G,a);if(ne&&ne.method==="AES-128"){var ce=this.getDecrypter();if(re.enableSoftwareAES){var ge=ce.softwareDecrypt(G,ne.key.buffer,ne.iv.buffer);if(!ge)return P.executeEnd=C(),x(g);G=new Uint8Array(ge)}else return this.decryptionPromise=ce.webCryptoDecrypt(G,ne.key.buffer,ne.iv.buffer).then(function(xe){var Ae=y.push(xe,null,g);return y.decryptionPromise=null,Ae}),this.decryptionPromise}var be=p||z,Be=be.contiguous,Se=be.discontinuity,Le=be.trackSwitch,Te=be.accurateTimeOffset,we=be.timeOffset,ve=F.audioCodec,H=F.videoCodec,T=F.defaultInitPts,R=F.duration,W=F.initSegmentData;if((Se||Le)&&this.resetInitSegment(W,ve,H,R),Se&&this.resetInitialTimestamp(T),Be||this.resetContiguity(),this.needsProbing(G,Se,Le)){if(Q.dataLength){var $=Q.flush();G=Object(w.appendUint8Array)($,G)}this.configureTransmuxer(G,F)}var N=this.transmux(G,ne,we,Te,g),de=this.currentTransmuxState;return de.contiguous=!0,de.discontinuity=!1,de.trackSwitch=!1,P.executeEnd=C(),N},c.flush=function(s){var a=this,g=s.transmuxing;g.executeStart=C();var p=this.decrypter,y=this.cache,P=this.currentTransmuxState,G=this.decryptionPromise;if(G)return G.then(function(){return a.flush(s)});var Q=[],re=P.timeOffset;if(p){var z=p.flush();z&&Q.push(this.push(z,null,s))}var F=y.dataLength;y.reset();var ne=this.demuxer,ce=this.remuxer;if(!ne||!ce)return F>=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"}),g.executeEnd=C(),[x(s)];var ge=ne.flush(re);return m(ge)?ge.then(function(be){return a.flushRemux(Q,be,s),Q}):(this.flushRemux(Q,ge,s),Q)},c.flushRemux=function(s,a,g){var p=a.audioTrack,y=a.avcTrack,P=a.id3Track,G=a.textTrack,Q=this.currentTransmuxState,re=Q.accurateTimeOffset,z=Q.timeOffset;A.logger.log("[transmuxer.ts]: Flushed fragment "+g.sn+(g.part>-1?" p: "+g.part:"")+" of level "+g.level);var F=this.remuxer.remux(p,y,P,G,z,re,!0,this.id);s.push({remuxResult:F,chunkMeta:g}),g.transmuxing.executeEnd=C()},c.resetInitialTimestamp=function(s){var a=this.demuxer,g=this.remuxer;if(!a||!g)return;a.resetTimeStamp(s),g.resetTimeStamp(s)},c.resetContiguity=function(){var s=this.demuxer,a=this.remuxer;if(!s||!a)return;s.resetContiguity(),a.resetNextTimestamp()},c.resetInitSegment=function(s,a,g,p){var y=this.demuxer,P=this.remuxer;if(!y||!P)return;y.resetInitSegment(a,g,p),P.resetInitSegment(s,a,g)},c.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},c.transmux=function(s,a,g,p,y){var P;return a&&a.method==="SAMPLE-AES"?P=this.transmuxSampleAes(s,a,g,p,y):P=this.transmuxUnencrypted(s,g,p,y),P},c.transmuxUnencrypted=function(s,a,g,p){var y=this.demuxer.demux(s,a,!1,!this.config.progressive),P=y.audioTrack,G=y.avcTrack,Q=y.id3Track,re=y.textTrack,z=this.remuxer.remux(P,G,Q,re,a,g,!1,this.id);return{remuxResult:z,chunkMeta:p}},c.transmuxSampleAes=function(s,a,g,p,y){var P=this;return this.demuxer.demuxSampleAes(s,a,g).then(function(G){var Q=P.remuxer.remux(G.audioTrack,G.avcTrack,G.id3Track,G.textTrack,g,p,!1,P.id);return{remuxResult:Q,chunkMeta:y}})},c.configureTransmuxer=function(s,a){for(var g=this.config,p=this.observer,y=this.typeSupported,P=this.vendor,G=a.audioCodec,Q=a.defaultInitPts,re=a.duration,z=a.initSegmentData,F=a.videoCodec,ne,ce=0,ge=d.length;ce<ge;ce++)if(d[ce].demux.probe(s)){ne=d[ce];break}ne||(A.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),ne={demux:U.default,remux:S.default});var be=this.demuxer,Be=this.remuxer,Se=ne.remux,Le=ne.demux;(!Be||!(Be instanceof Se))&&(this.remuxer=new Se(p,g,y,P)),(!be||!(be instanceof Le))&&(this.demuxer=new Le(p,g,y),this.probe=Le.probe),this.resetInitSegment(z,G,F,re),this.resetInitialTimestamp(Q)},c.needsProbing=function(s,a,g){return!this.demuxer||!this.remuxer||a||g},c.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new k.default(this.observer,this.config)),s},b}();function u(b,c){var h=null;return b.byteLength>0&&c!=null&&c.key!=null&&c.iv!==null&&c.method!=null&&(h=c),h}var x=function(c){return{remuxResult:{},chunkMeta:c}};function m(b){return"then"in b&&b.then instanceof Function}var f=function(c,h,s,a,g){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=c,this.videoCodec=h,this.initSegmentData=s,this.duration=a,this.defaultInitPts=g},D=function(c,h,s,a,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=c,this.contiguous=h,this.accurateTimeOffset=s,this.trackSwitch=a,this.timeOffset=g}},"./src/demux/tsdemuxer.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"discardEPB",function(){return x});var V=L("./src/demux/adts.ts"),_=L("./src/demux/mpegaudio.ts"),k=L("./src/demux/exp-golomb.ts"),j=L("./src/demux/id3.ts"),U=L("./src/demux/sample-aes.ts"),O=L("./src/events.ts"),I=L("./src/utils/mp4-tools.ts"),v=L("./src/utils/logger.ts"),S=L("./src/errors.ts"),M={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&&v.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),h=0;h<c;){if(b[h]===71&&b[h+188]===71&&b[h+2*188]===71)return h;h++}return-1},m.createTrack=function(b,c){return{container:b==="video"||b==="audio"?"video/mp2t":void 0,type:b,id:M[b],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:b==="audio"?c:void 0}};var f=m.prototype;return f.resetInitSegment=function(b,c,h){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",h),this._audioTrack=m.createTrack("audio",h),this._id3Track=m.createTrack("id3",h),this._txtTrack=m.createTrack("text",h),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=b,this.videoCodec=c,this._duration=h},f.resetTimeStamp=function(){},f.resetContiguity=function(){var b=this._audioTrack,c=this._avcTrack,h=this._id3Track;b&&(b.pesData=null),c&&(c.pesData=null),h&&(h.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},f.demux=function(b,c,h,s){h===void 0&&(h=!1),s===void 0&&(s=!1),h||(this.sampleAes=null);var a,g=this._avcTrack,p=this._audioTrack,y=this._id3Track,P=g.pid,G=g.pesData,Q=p.pid,re=y.pid,z=p.pesData,F=y.pesData,ne=!1,ce=this.pmtParsed,ge=this._pmtId,be=b.length;if(this.remainderData&&(b=Object(I.appendUint8Array)(this.remainderData,b),be=b.length,this.remainderData=null),be<188&&!s)return this.remainderData=b,{audioTrack:p,avcTrack:g,id3Track:y,textTrack:this._txtTrack};var Be=Math.max(0,m.syncOffset(b));be-=(be+Be)%188,be<b.byteLength&&!s&&(this.remainderData=new Uint8Array(b.buffer,be,b.buffer.byteLength-be));for(var Se=Be;Se<be;Se+=188)if(b[Se]===71){var Le=!!(b[Se+1]&64),Te=((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(Te){case P:Le&&(G&&(a=o(G))&&this.parseAVCPES(a,!1),G={data:[],size:0}),G&&(G.data.push(b.subarray(ve,Se+188)),G.size+=Se+188-ve);break;case Q:Le&&(z&&(a=o(z))&&(p.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:Le&&(F&&(a=o(F))&&this.parseID3PES(a),F={data:[],size:0}),F&&(F.data.push(b.subarray(ve,Se+188)),F.size+=Se+188-ve);break;case 0:Le&&(ve+=b[ve]+1),ge=this._pmtId=C(b,ve);break;case ge:{Le&&(ve+=b[ve]+1);var H=d(b,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,h);P=H.avc,P>0&&(g.pid=P),Q=H.audio,Q>0&&(p.pid=Q,p.isAAC=H.isAAC),re=H.id3,re>0&&(y.pid=re),ne&&!ce&&(v.logger.log("reparse from beginning"),ne=!1,Se=Be-188),ce=this.pmtParsed=!0;break}case 17:case 8191:break;default:ne=!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"});g.pesData=G,p.pesData=z,y.pesData=F;var T={audioTrack:p,avcTrack:g,id3Track:y,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(T),T},f.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},f.extractRemainingSamples=function(b){var c=b.audioTrack,h=b.avcTrack,s=b.id3Track,a=h.pesData,g=c.pesData,p=s.pesData,y;a&&(y=o(a))?(this.parseAVCPES(y,!0),h.pesData=null):h.pesData=a,g&&(y=o(g))?(c.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),c.pesData=null):(g!=null&&g.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),c.pesData=g),p&&(y=o(p))?(this.parseID3PES(y),s.pesData=null):s.pesData=p},f.demuxSampleAes=function(b,c,h){var s=this.demux(b,h,!0,!this.config.progressive),a=this.sampleAes=new U.default(this.observer,this.config,c);return this.decrypt(s,a)},f.decrypt=function(b,c){return new Promise(function(h){var s=b.audioTrack,a=b.avcTrack;s.samples&&s.isAAC?c.decryptAacSamples(s.samples,0,function(){a.samples?c.decryptAvcSamples(a.samples,0,0,function(){h(b)}):h(b)}):a.samples&&c.decryptAvcSamples(a.samples,0,0,function(){h(b)})})},f.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},f.parseAVCPES=function(b,c){var h=this,s=this._avcTrack,a=this.parseAVCNALu(b.data),g=!1,p=this.avcSample,y,P=!1;b.data=null,p&&a.length&&!s.audFound&&(l(p,s),p=this.avcSample=A(!1,b.pts,b.dts,"")),a.forEach(function(G){switch(G.type){case 1:{y=!0,p||(p=h.avcSample=A(!0,b.pts,b.dts,"")),g&&(p.debug+="NDR "),p.frame=!0;var Q=G.data;if(P&&Q.length>4){var re=new k.default(Q).readSliceType();(re===2||re===4||re===7||re===9)&&(p.key=!0)}break}case 5:y=!0,p||(p=h.avcSample=A(!0,b.pts,b.dts,"")),g&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{y=!0,g&&p&&(p.debug+="SEI ");var z=new k.default(x(G.data));z.readUByte();for(var F=0,ne=0,ce=!1,ge=0;!ce&&z.bytesAvailable>1;){F=0;do ge=z.readUByte(),F+=ge;while(ge===255);ne=0;do ge=z.readUByte(),ne+=ge;while(ge===255);if(F===4&&z.bytesAvailable!==0){ce=!0;var be=z.readUByte();if(be===181){var Be=z.readUShort();if(Be===49){var Se=z.readUInt();if(Se===1195456820){var Le=z.readUByte();if(Le===3){for(var Te=z.readUByte(),we=z.readUByte(),ve=31&Te,H=[Te,we],T=0;T<ve;T++)H.push(z.readUByte()),H.push(z.readUByte()),H.push(z.readUByte());u(h._txtTrack.samples,{type:3,pts:b.pts,bytes:H})}}}}}else if(F===5&&z.bytesAvailable!==0){if(ce=!0,ne>16){for(var R=[],W=0;W<16;W++)R.push(z.readUByte().toString(16)),(W===3||W===5||W===7||W===9)&&R.push("-");for(var $=ne-16,N=new Uint8Array($),de=0;de<$;de++)N[de]=z.readUByte();u(h._txtTrack.samples,{pts:b.pts,payloadType:F,uuid:R.join(""),userData:Object(j.utf8ArrayToStr)(N),userDataBytes:N})}}else if(ne<z.bytesAvailable)for(var xe=0;xe<ne;xe++)z.readUByte()}break}case 7:if(y=!0,P=!0,g&&p&&(p.debug+="SPS "),!s.sps){var Ae=new k.default(G.data),Ne=Ae.readSPS();s.width=Ne.width,s.height=Ne.height,s.pixelRatio=Ne.pixelRatio,s.sps=[G.data],s.duration=h._duration;for(var Me=G.data.subarray(1,4),Re="avc1.",Pe=0;Pe<3;Pe++){var We=Me[Pe].toString(16);We.length<2&&(We="0"+We),Re+=We}s.codec=Re}break;case 8:y=!0,g&&p&&(p.debug+="PPS "),s.pps||(s.pps=[G.data]);break;case 9:y=!1,s.audFound=!0,p&&l(p,s),p=h.avcSample=A(!1,b.pts,b.dts,g?"AUD ":"");break;case 12:y=!1;break;default:y=!1,p&&(p.debug+="unknown NAL "+G.type+" ");break}if(p&&y){var Qe=p.units;Qe.push(G)}}),c&&p&&(l(p,s),this.avcSample=null)},f.getLastNalUnit=function(){var b,c=this.avcSample,h;if(!c||c.units.length===0){var s=this._avcTrack.samples;c=s[s.length-1]}if((b=c)!==null&&b!==void 0&&b.units){var a=c.units;h=a[a.length-1]}return h},f.parseAVCNALu=function(b){var c=b.byteLength,h=this._avcTrack,s=h.naluState||0,a=s,g=[],p=0,y,P,G,Q=-1,re=0;for(s===-1&&(Q=0,re=b[0]&31,s=0,p=1);p<c;){if(y=b[p++],!s){s=y?0:1;continue}if(s===1){s=y?0:2;continue}if(!y)s=3;else if(y===1){if(Q>=0){var z={data:b.subarray(Q,p-s-1),type:re};g.push(z)}else{var F=this.getLastNalUnit();if(F&&(a&&p<=4-a&&(F.state&&(F.data=F.data.subarray(0,F.data.byteLength-a))),P=p-s-1,P>0)){var ne=new Uint8Array(F.data.byteLength+P);ne.set(F.data,0),ne.set(b.subarray(0,P),F.data.byteLength),F.data=ne,F.state=0}}p<c?(G=b[p]&31,Q=p,re=G,s=0):s=-1}else s=0}if(Q>=0&&s>=0){var ce={data:b.subarray(Q,c),type:re,state:s};g.push(ce)}if(g.length===0){var ge=this.getLastNalUnit();if(ge){var be=new Uint8Array(ge.data.byteLength+b.byteLength);be.set(ge.data,0),be.set(b,ge.data.byteLength),ge.data=be}}return h.naluState=s,g},f.parseAACPES=function(b){var c=0,h=this._audioTrack,s=this.aacOverFlow,a=b.data;if(s){this.aacOverFlow=null;var g=s.sample.unit.byteLength,p=Math.min(s.missing,g),y=g-p;s.sample.unit.set(a.subarray(0,p),y),h.samples.push(s.sample),c=s.missing}var P,G;for(P=c,G=a.length;P<G-1&&!V.isHeader(a,P);P++);if(P!==c){var Q,re;if(P<G-1?(Q="AAC PES did not start with ADTS header,offset:"+P,re=!1):(Q="no ADTS header found in AAC PES",re=!0),v.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(h,this.observer,a,P,this.audioCodec);var z;if(b.pts!==void 0)z=b.pts;else if(s){var F=V.getFrameDuration(h.samplerate);z=s.sample.pts+F}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var ne=0;P<G;)if(V.isHeader(a,P)){if(P+5<G){var ce=V.appendFrame(h,a,P,z,ne);if(ce)if(ce.missing)this.aacOverFlow=ce;else{P+=ce.length,ne++;continue}}break}else P++},f.parseMPEGPES=function(b){var c=b.data,h=c.length,s=0,a=0,g=b.pts;if(g===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<h;)if(_.isHeader(c,a)){var p=_.appendFrame(this._audioTrack,c,a,g,s);if(p)a+=p.length,s++;else break}else a++},f.parseID3PES=function(b){if(b.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(b)},m}();w.minProbeByteLength=188;function A(m,f,D,b){return{key:m,frame:!1,pts:f,dts:D,units:[],debug:b,length:0}}function C(m,f){return(m[f+10]&31)<<8|m[f+11]}function d(m,f,D,b){var c={audio:-1,avc:-1,id3:-1,isAAC:!0},h=(m[f+1]&15)<<8|m[f+2],s=f+3+h-4,a=(m[f+10]&15)<<8|m[f+11];for(f+=12+a;f<s;){var g=(m[f+1]&31)<<8|m[f+2];switch(m[f]){case 207:if(!b){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:c.audio===-1&&(c.audio=g);break;case 21:c.id3===-1&&(c.id3=g);break;case 219:if(!b){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:c.avc===-1&&(c.avc=g);break;case 3:case 4:D?c.audio===-1&&(c.audio=g,c.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}f+=((m[f+3]&15)<<8|m[f+4])+5}return c}function o(m){var f=0,D,b,c,h,s,a=m.data;if(!m||m.size===0)return null;for(;a[0].length<19&&a.length>1;){var g=new Uint8Array(a[0].length+a[1].length);g.set(a[0]),g.set(a[1],a[0].length),a[0]=g,a.splice(1,1)}D=a[0];var p=(D[0]<<16)+(D[1]<<8)+D[2];if(p===1){if(b=(D[4]<<8)+D[5],b&&b>m.size-6)return null;var y=D[7];y&192&&(h=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,y&64?(s=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,h-s>60*9e4&&(v.logger.warn(Math.round((h-s)/9e4)+"s delta between PTS and DTS, align them"),h=s)):s=h),c=D[8];var P=c+9;if(m.size<=P)return null;m.size-=P;for(var G=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;G.set(D,f),f+=z}return b&&(b-=c+3),{data:G,pts:h,dts:s,len:b}}return null}function l(m,f){if(m.units.length&&m.frame){if(m.pts===void 0){var D=f.samples,b=D.length;if(b){var c=D[b-1];m.pts=c.pts,m.dts=c.dts}else{f.dropped++;return}}f.samples.push(m)}m.debug.length&&v.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function u(m,f){var D=m.length;if(D>0){if(f.pts>=m[D-1].pts)m.push(f);else for(var b=D-1;b>=0;b--)if(f.pts<m[b].pts){m.splice(b,0,f);break}}else m.push(f)}function x(m){for(var f=m.byteLength,D=[],b=1;b<f-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=f-D.length,h=new Uint8Array(c),s=0;for(b=0;b<c;s++,b++)s===D[0]&&(s++,D.shift()),h[b]=m[s];return h}Y.default=w},"./src/errors.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"ErrorTypes",function(){return V}),L.d(Y,"ErrorDetails",function(){return _});var V;(function(k){k.NETWORK_ERROR="networkError",k.MEDIA_ERROR="mediaError",k.KEY_SYSTEM_ERROR="keySystemError",k.MUX_ERROR="muxError",k.OTHER_ERROR="otherError"})(V||(V={}));var _;(function(k){k.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",k.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",k.KEY_SYSTEM_NO_SESSION="keySystemNoSession",k.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",k.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",k.MANIFEST_LOAD_ERROR="manifestLoadError",k.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",k.MANIFEST_PARSING_ERROR="manifestParsingError",k.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",k.LEVEL_EMPTY_ERROR="levelEmptyError",k.LEVEL_LOAD_ERROR="levelLoadError",k.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",k.LEVEL_SWITCH_ERROR="levelSwitchError",k.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",k.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",k.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",k.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",k.FRAG_LOAD_ERROR="fragLoadError",k.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",k.FRAG_DECRYPT_ERROR="fragDecryptError",k.FRAG_PARSING_ERROR="fragParsingError",k.REMUX_ALLOC_ERROR="remuxAllocError",k.KEY_LOAD_ERROR="keyLoadError",k.KEY_LOAD_TIMEOUT="keyLoadTimeOut",k.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",k.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",k.BUFFER_APPEND_ERROR="bufferAppendError",k.BUFFER_APPENDING_ERROR="bufferAppendingError",k.BUFFER_STALLED_ERROR="bufferStalledError",k.BUFFER_FULL_ERROR="bufferFullError",k.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",k.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",k.INTERNAL_EXCEPTION="internalException",k.INTERNAL_ABORTED="aborted",k.UNKNOWN="unknown"})(_||(_={}))},"./src/events.ts":function(ue,Y,L){"use strict";L.r(Y),L.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(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return m});var V=L("./node_modules/url-toolkit/src/url-toolkit.js"),_=L.n(V),k=L("./src/loader/playlist-loader.ts"),j=L("./src/loader/key-loader.ts"),U=L("./src/controller/id3-track-controller.ts"),O=L("./src/controller/latency-controller.ts"),I=L("./src/controller/level-controller.ts"),v=L("./src/controller/fragment-tracker.ts"),S=L("./src/controller/stream-controller.ts"),M=L("./src/is-supported.ts"),w=L("./src/utils/logger.ts"),A=L("./src/config.ts"),C=L("./node_modules/eventemitter3/index.js"),d=L.n(C),o=L("./src/events.ts"),l=L("./src/errors.ts");function u(f,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(f,c.key,c)}}function x(f,D,b){return D&&u(f.prototype,D),b&&u(f,b),f}var m=function(){f.isSupported=function(){return Object(M.isSupported)()};function f(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)(f.DefaultConfig,b);this.userConfig=b,Object(w.enableLogs)(c.debug),this._autoLevelCapping=-1,c.progressive&&Object(A.enableStreamingMode)(c);var h=c.abrController,s=c.bufferController,a=c.capLevelController,g=c.fpsController,p=this.abrController=new h(this),y=this.bufferController=new s(this),P=this.capLevelController=new a(this),G=new g(this),Q=new k.default(this),re=new j.default(this),z=new U.default(this),F=this.levelController=new I.default(this),ne=new v.FragmentTracker(this),ce=this.streamController=new S.default(this,ne);P.setStreamController(ce),G.setStreamController(ce);var ge=[F,ce];this.networkControllers=ge;var be=[Q,re,p,y,P,G,z,ne];this.audioTrackController=this.createController(c.audioTrackController,null,ge),this.createController(c.audioStreamController,ne,ge),this.subtitleTrackController=this.createController(c.subtitleTrackController,null,ge),this.createController(c.subtitleStreamController,ne,ge),this.createController(c.timelineController,null,be),this.emeController=this.createController(c.emeController,null,be),this.cmcdController=this.createController(c.cmcdController,null,be),this.latencyController=this.createController(O.default,null,be),this.coreComponents=be}var D=f.prototype;return D.createController=function(c,h,s){if(c){var a=h?new c(this,h):new c(this);return s&&s.push(a),a}return null},D.on=function(c,h,s){s===void 0&&(s=this),this._emitter.on(c,h,s)},D.once=function(c,h,s){s===void 0&&(s=this),this._emitter.once(c,h,s)},D.removeAllListeners=function(c){this._emitter.removeAllListeners(c)},D.off=function(c,h,s,a){s===void 0&&(s=this),this._emitter.off(c,h,s,a)},D.listeners=function(c){return this._emitter.listeners(c)},D.emit=function(c,h,s){return this._emitter.emit(c,h,s)},D.trigger=function(c,h){if(this.config.debug)return this.emit(c,c,h);try{return this.emit(c,c,h)}catch(s){w.logger.error("An internal error happened while handling event "+c+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(o.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:c,error:s})}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 h=this.media,s=this.url,a=this.url=V.buildAbsoluteURL(self.location.href,c,{alwaysNormalize:!0});w.logger.log("loadSource:"+a),h&&s&&s!==a&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(h)),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(h){h.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,h){h===void 0&&(h=0),this.levelController.removeLevel(c,h)},x(f,[{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 h=!!c;h!==this.config.capLevelToPlayerSize&&(h?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=h)}},{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,h=this.config.minAutoBitrate;if(!c)return 0;for(var s=c.length,a=0;a<s;a++)if(c[a].maxBitrate>h)return a;return 0}},{key:"maxAutoLevel",get:function(){var c=this.levels,h=this.autoLevelCapping,s;return h===-1&&c&&c.length?s=c.length-1:s=h,s}},{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 h=this.audioTrackController;h&&(h.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 h=this.subtitleTrackController;h&&(h.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 h=this.subtitleTrackController;h&&(h.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 l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return f.defaultConfig?f.defaultConfig:A.hlsDefaultConfig},set:function(c){f.defaultConfig=c}}]),f}();m.defaultConfig=void 0},"./src/is-supported.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"isSupported",function(){return k}),L.d(Y,"changeTypeSupported",function(){return j});var V=L("./src/utils/mediasource-helper.ts");function _(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var U=Object(V.getMediaSource)();if(!U)return!1;var O=_(),I=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!I&&!!v}function j(){var U,O=_();return typeof(O==null||((U=O.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return w}),L.d(Y,"LoadError",function(){return C});var V=L("./src/polyfills/number.ts"),_=L("./src/errors.ts");function k(d,o){d.prototype=Object.create(o.prototype),d.prototype.constructor=d,v(d,o)}function j(d){var o=typeof Map=="function"?new Map:void 0;return j=function(u){if(u===null||!I(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,x)}function x(){return U(u,arguments,S(this).constructor)}return x.prototype=Object.create(u.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v(x,u)},j(d)}function U(d,o,l){return O()?U=Reflect.construct:U=function(x,m,f){var D=[null];D.push.apply(D,m);var b=Function.bind.apply(x,D),c=new b;return f&&v(c,f.prototype),c},U.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(d){return!1}}function I(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function v(d,o){return v=Object.setPrototypeOf||function(u,x){return u.__proto__=x,u},v(d,o)}function S(d){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},S(d)}var M=Math.pow(2,17),w=function(){function d(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var o=d.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,x){var m=this,f=u.url;if(!f)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 "+(f?"part list":"url")));this.abort();var D=this.config,b=D.fLoader,c=D.loader;return new Promise(function(h,s){m.loader&&m.loader.destroy();var a=m.loader=u.loader=b?new b(D):new c(D),g=A(u),p={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:M};u.stats=a.stats,a.load(g,p,{onSuccess:function(P,G,Q,re){m.resetLoader(u,a),h({frag:u,part:null,payload:P.data,networkDetails:re})},onError:function(P,G,Q){m.resetLoader(u,a),s(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:P,networkDetails:Q}))},onAbort:function(P,G,Q){m.resetLoader(u,a),s(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:Q}))},onTimeout:function(P,G,Q){m.resetLoader(u,a),s(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:Q}))},onProgress:function(P,G,Q,re){x&&x({frag:u,part:null,payload:Q,networkDetails:re})}})})},o.loadPart=function(u,x,m){var f=this;this.abort();var D=this.config,b=D.fLoader,c=D.loader;return new Promise(function(h,s){f.loader&&f.loader.destroy();var a=f.loader=u.loader=b?new b(D):new c(D),g=A(u,x),p={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:M};x.stats=a.stats,a.load(g,p,{onSuccess:function(P,G,Q,re){f.resetLoader(u,a),f.updateStatsFromPart(u,x);var z={frag:u,part:x,payload:P.data,networkDetails:re};m(z),h(z)},onError:function(P,G,Q){f.resetLoader(u,a),s(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:x,response:P,networkDetails:Q}))},onAbort:function(P,G,Q){u.stats.aborted=x.stats.aborted,f.resetLoader(u,a),s(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:x,networkDetails:Q}))},onTimeout:function(P,G,Q){f.resetLoader(u,a),s(new C({type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:x,networkDetails:Q}))}})})},o.updateStatsFromPart=function(u,x){var m=u.stats,f=x.stats,D=f.total;if(m.loaded+=f.loaded,D){var b=Math.round(u.duration/x.duration),c=Math.min(Math.round(m.loaded/D),b),h=b-c,s=h*Math.round(m.loaded/c);m.total=m.loaded+s}else m.total=Math.max(m.loaded,m.total);var a=m.loading,g=f.loading;a.start?a.first+=g.first-g.start:(a.start=g.start,a.first=g.first),a.end=g.end},o.resetLoader=function(u,x){u.loader=null,this.loader===x&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),x.destroy()},d}();function A(d,o){o===void 0&&(o=null);var l=o||d,u={frag:d,part:o,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},x=l.byteRangeStartOffset,m=l.byteRangeEndOffset;return Object(V.isFiniteNumber)(x)&&Object(V.isFiniteNumber)(m)&&(u.rangeStart=x,u.rangeEnd=m),u}var C=function(d){k(o,d);function o(l){for(var u,x=arguments.length,m=new Array(x>1?x-1:0),f=1;f<x;f++)m[f-1]=arguments[f];return u=d.call.apply(d,[this].concat(m))||this,u.data=void 0,u.data=l,u}return o}(j(Error))},"./src/loader/fragment.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"ElementaryStreamTypes",function(){return w}),L.d(Y,"BaseSegment",function(){return A}),L.d(Y,"Fragment",function(){return C}),L.d(Y,"Part",function(){return d});var V=L("./src/polyfills/number.ts"),_=L("./node_modules/url-toolkit/src/url-toolkit.js"),k=L.n(_),j=L("./src/utils/logger.ts"),U=L("./src/loader/level-key.ts"),O=L("./src/loader/load-stats.ts");function I(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,v(o,l)}function v(o,l){return v=Object.setPrototypeOf||function(x,m){return x.__proto__=m,x},v(o,l)}function S(o,l){for(var u=0;u<l.length;u++){var x=l[u];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(o,x.key,x)}}function M(o,l,u){return l&&S(o.prototype,l),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 x;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(x={},x[w.AUDIO]=null,x[w.VIDEO]=null,x[w.AUDIOVIDEO]=null,x),this.baseurl=u}var l=o.prototype;return l.setByteRange=function(x,m){var f=x.split("@",2),D=[];f.length===1?D[0]=m?m.byteRangeEndOffset:0:D[0]=parseInt(f[1]),D[1]=parseInt(f[0])+D[0],this._byteRange=D},M(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(x){this._url=x}}]),o}(),C=function(o){I(l,o);function l(x,m){var f;return f=o.call(this,m)||this,f._decryptdata=null,f.rawProgramDateTime=null,f.programDateTime=null,f.tagList=[],f.duration=0,f.sn=0,f.levelkey=void 0,f.type=void 0,f.loader=null,f.level=-1,f.cc=0,f.startPTS=void 0,f.endPTS=void 0,f.appendedPTS=void 0,f.startDTS=void 0,f.endDTS=void 0,f.start=0,f.deltaPTS=void 0,f.maxStartPTS=void 0,f.minEndPTS=void 0,f.stats=new O.LoadStats,f.urlId=0,f.data=void 0,f.bitrateTest=!1,f.title=null,f.initSegment=null,f.type=x,f}var u=l.prototype;return u.createInitializationVector=function(m){for(var f=new Uint8Array(16),D=12;D<16;D++)f[D]=m>>8*(15-D)&255;return f},u.setDecryptDataFromLevelKey=function(m,f){var D=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(D=U.LevelKey.fromURI(m.uri),D.method=m.method,D.iv=this.createInitializationVector(f),D.keyFormat="identity"),D},u.setElementaryStreamInfo=function(m,f,D,b,c,h){h===void 0&&(h=!1);var s=this.elementaryStreams,a=s[m];if(!a){s[m]={startPTS:f,endPTS:D,startDTS:b,endDTS:c,partial:h};return}a.startPTS=Math.min(a.startPTS,f),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},M(l,[{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&&j.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)}}]),l}(A),d=function(o){I(l,o);function l(u,x,m,f,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=x,b.index=f;var c=u.enumeratedString("BYTERANGE");return c&&b.setByteRange(c,D),D&&(b.fragOffset=D.fragOffset+D.duration),b}return M(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var x=this.elementaryStreams;return!!(x.audio||x.video||x.audiovideo)}}]),l}(A)},"./src/loader/key-loader.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return j});var V=L("./src/events.ts"),_=L("./src/errors.ts"),k=L("./src/utils/logger.ts"),j=function(){function U(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var O=U.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 v in this.loaders){var S=this.loaders[v];S&&S.destroy()}this.loaders={}},O.onKeyLoading=function(v,S){var M=S.frag,w=M.type,A=this.loaders[w];if(!M.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var C=M.decryptdata.uri;if(C!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(A&&(k.logger.warn("abort previous key loader for type:"+w),A.abort()),!C){k.logger.warn("key uri is falsy");return}var o=d.loader,l=M.loader=this.loaders[w]=new o(d);this.decrypturl=C,this.decryptkey=null;var u={url:C,frag:M,responseType:"arraybuffer"},x={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(u,x,m)}else this.decryptkey&&(M.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:M}))},O.loadsuccess=function(v,S,M){var w=M.frag;if(!w.decryptdata){k.logger.error("after key load, decryptdata unset");return}this.decryptkey=w.decryptdata.key=new Uint8Array(v.data),w.loader=null,delete this.loaders[w.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:w})},O.loaderror=function(v,S){var M=S.frag,w=M.loader;w&&w.abort(),delete this.loaders[M.type],this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:M,response:v})},O.loadtimeout=function(v,S){var M=S.frag,w=M.loader;w&&w.abort(),delete this.loaders[M.type],this.hls.trigger(V.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:M})},U}()},"./src/loader/level-details.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"LevelDetails",function(){return U});var V=L("./src/polyfills/number.ts");function _(O,I){for(var v=0;v<I.length;v++){var S=I[v];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(O,S.key,S)}}function k(O,I,v){return I&&_(O.prototype,I),v&&_(O,v),O}var j=10,U=function(){function O(v){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=v}var I=O.prototype;return I.reloaded=function(S){if(!S){this.advanced=!0,this.updated=!0;return}var M=this.lastPartSn-S.lastPartSn,w=this.lastPartIndex-S.lastPartIndex;this.updated=this.endSN!==S.endSN||!!w||!!M,this.advanced=this.endSN>S.endSN||M>0||M===0&&w>0,this.updated||this.advanced?this.misses=Math.floor(S.misses*.6):this.misses=S.misses+1,this.availabilityDelay=S.availabilityDelay},k(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||j}},{key:"drift",get:function(){var S=this.driftEndTime-this.driftStartTime;if(S>0){var M=this.driftEnd-this.driftStart;return M*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(ue,Y,L){"use strict";L.r(Y),L.d(Y,"LevelKey",function(){return U});var V=L("./node_modules/url-toolkit/src/url-toolkit.js"),_=L.n(V);function k(O,I){for(var v=0;v<I.length;v++){var S=I[v];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(O,S.key,S)}}function j(O,I,v){return I&&k(O.prototype,I),v&&k(O,v),O}var U=function(){O.fromURL=function(v,S){return new O(v,S)},O.fromURI=function(v){return new O(v)};function O(I,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(V.buildAbsoluteURL)(I,v,{alwaysNormalize:!0}):this._uri=I}return j(O,[{key:"uri",get:function(){return this._uri}}]),O}()},"./src/loader/load-stats.ts":function(ue,Y,L){"use strict";L.r(Y),L.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(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return l});var V=L("./src/polyfills/number.ts"),_=L("./node_modules/url-toolkit/src/url-toolkit.js"),k=L.n(_),j=L("./src/loader/fragment.ts"),U=L("./src/loader/level-details.ts"),O=L("./src/loader/level-key.ts"),I=L("./src/utils/attr-list.ts"),v=L("./src/utils/logger.ts"),S=L("./src/utils/codecs.ts"),M=/#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("|")),d=/\.(mp4|m4s|m4v|m4a)$/i;function o(D){var b,c;return d.test((b=(c=_.parseURL(D))===null||c===void 0?void 0:c.path)!=null?b:"")}var l=function(){function D(){}return D.findGroup=function(c,h){for(var s=0;s<c.length;s++){var a=c[s];if(a.id===h)return a}},D.convertAVC1ToAVCOTI=function(c){var h=c.split(".");if(h.length>2){var s=h.shift()+".";return s+=parseInt(h.shift()).toString(16),s+=("000"+parseInt(h.shift()).toString(16)).substr(-4),s}return c},D.resolve=function(c,h){return _.buildAbsoluteURL(h,c,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(c,h){var s=[],a={},g=!1;M.lastIndex=0;for(var p;(p=M.exec(c))!=null;)if(p[1]){var y=new I.AttrList(p[1]),P={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:D.resolve(p[2],h)},G=y.decimalResolution("RESOLUTION");G&&(P.width=G.width,P.height=G.height),u((y.CODECS||"").split(/[ ,]+/).filter(function(re){return re}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=D.convertAVC1ToAVCOTI(P.videoCodec)),s.push(P)}else if(p[3]){var Q=new I.AttrList(p[3]);Q["DATA-ID"]&&(g=!0,a[Q["DATA-ID"]]=Q)}return{levels:s,sessionData:g?a:null}},D.parseMasterPlaylistMedia=function(c,h,s,a){a===void 0&&(a=[]);var g,p=[],y=0;for(w.lastIndex=0;(g=w.exec(c))!==null;){var P=new I.AttrList(g[1]);if(P.TYPE===s){var G={attrs:P,bitrate:0,id:y++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:s,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?D.resolve(P.URI,h):""};if(a.length){var Q=D.findGroup(a,G.groupId)||a[0];x(G,Q,"audioCodec"),x(G,Q,"textCodec")}p.push(G)}}return p},D.parseLevelPlaylist=function(c,h,s,a,g){var p=new U.LevelDetails(h),y=p.fragments,P=null,G=0,Q=0,re=0,z=0,F=null,ne=new j.Fragment(a,h),ce,ge,be,Be=-1,Se=!1;for(A.lastIndex=0,p.m3u8=c;(ce=A.exec(c))!==null;){Se&&(Se=!1,ne=new j.Fragment(a,h),ne.start=re,ne.sn=G,ne.cc=z,ne.level=s,P&&(ne.initSegment=P,ne.rawProgramDateTime=P.rawProgramDateTime));var Le=ce[1];if(Le){ne.duration=parseFloat(Le);var Te=(" "+ce[2]).slice(1);ne.title=Te||null,ne.tagList.push(Te?["INF",Le,Te]:["INF",Le])}else if(ce[3])Object(V.isFiniteNumber)(ne.duration)&&(ne.start=re,be&&(ne.levelkey=be),ne.sn=G,ne.level=s,ne.cc=z,ne.urlId=g,y.push(ne),ne.relurl=(" "+ce[3]).slice(1),f(ne,F),F=ne,re+=ne.duration,G++,Q=0,Se=!0);else if(ce[4]){var we=(" "+ce[4]).slice(1);F?ne.setByteRange(we,F):ne.setByteRange(we)}else if(ce[5])ne.rawProgramDateTime=(" "+ce[5]).slice(1),ne.tagList.push(["PROGRAM-DATE-TIME",ne.rawProgramDateTime]),Be===-1&&(Be=y.length);else{if(ce=ce[0].match(C),!ce){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ge=1;ge<ce.length&&!(typeof ce[ge]!="undefined");ge++);var ve=(" "+ce[ge]).slice(1),H=(" "+ce[ge+1]).slice(1),T=ce[ge+2]?(" "+ce[ge+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":p.type=H.toUpperCase();break;case"MEDIA-SEQUENCE":G=p.startSN=parseInt(H);break;case"SKIP":{var R=new I.AttrList(H),W=R.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(W)){p.skippedSegments=W;for(var $=W;$--;)y.unshift(null);G+=W}var N=R.enumeratedString("RECENTLY-REMOVED-DATERANGES");N&&(p.recentlyRemovedDateranges=N.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(H);break;case"VERSION":p.version=parseInt(H);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(H||T)&&ne.tagList.push(T?[H,T]:[H]);break;case"DIS":z++;case"GAP":ne.tagList.push([ve]);break;case"BITRATE":ne.tagList.push([ve,H]);break;case"DISCONTINUITY-SEQ":z=parseInt(H);break;case"KEY":{var de,xe=new I.AttrList(H),Ae=xe.enumeratedString("METHOD"),Ne=xe.URI,Me=xe.hexadecimalInteger("IV"),Re=xe.enumeratedString("KEYFORMATVERSIONS"),Pe=xe.enumeratedString("KEYID"),We=(de=xe.enumeratedString("KEYFORMAT"))!=null?de:"identity",Qe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Qe.indexOf(We)>-1){v.logger.warn("Keyformat "+We+" is not supported from the manifest");continue}else if(We!=="identity")continue;Ae&&(be=O.LevelKey.fromURL(h,Ne),Ne&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ae)>=0&&(be.method=Ae,be.keyFormat=We,Pe&&(be.keyID=Pe),Re&&(be.keyFormatVersions=Re),be.iv=Me));break}case"START":{var Ve=new I.AttrList(H),Ge=Ve.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(Ge)&&(p.startTimeOffset=Ge);break}case"MAP":{var at=new I.AttrList(H);ne.relurl=at.URI,at.BYTERANGE&&ne.setByteRange(at.BYTERANGE),ne.level=s,ne.sn="initSegment",be&&(ne.levelkey=be),ne.initSegment=null,P=ne,Se=!0;break}case"SERVER-CONTROL":{var Xe=new I.AttrList(H);p.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),p.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ze=new I.AttrList(H);p.partTarget=Ze.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=p.partList;De||(De=p.partList=[]);var rt=Q>0?De[De.length-1]:void 0,qe=Q++,oe=new j.Part(new I.AttrList(H),ne,h,qe,rt);De.push(oe),ne.duration+=oe.duration;break}case"PRELOAD-HINT":{var J=new I.AttrList(H);p.preloadHint=J;break}case"RENDITION-REPORT":{var Z=new I.AttrList(H);p.renditionReports=p.renditionReports||[],p.renditionReports.push(Z);break}default:v.logger.warn("line parsed but not handled: "+ce);break}}}F&&!F.relurl?(y.pop(),re-=F.duration,p.partList&&(p.fragmentHint=F)):p.partList&&(f(ne,F),ne.cc=z,p.fragmentHint=ne);var ae=y.length,se=y[0],ee=y[ae-1];if(re+=p.skippedSegments*p.targetduration,re>0&&ae&&ee){p.averagetargetduration=re/ae;var ie=ee.sn;p.endSN=ie!=="initSegment"?ie:0,se&&(p.startCC=se.cc,se.initSegment||p.fragments.every(function(le){return le.relurl&&o(le.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),ne=new j.Fragment(a,h),ne.relurl=ee.relurl,ne.level=s,ne.sn="initSegment",se.initSegment=ne,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(re+=p.fragmentHint.duration),p.totalduration=re,p.endCC=z,Be>0&&m(y,Be),p},D}();function u(D,b){["video","audio","text"].forEach(function(c){var h=D.filter(function(a){return Object(S.isCodecType)(a,c)});if(h.length){var s=h.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});b[c+"Codec"]=s.length>0?s[0]:h[0],D=D.filter(function(a){return h.indexOf(a)===-1})}}),b.unknownCodecs=D}function x(D,b,c){var h=b[c];h&&(D[c]=h)}function m(D,b){for(var c=D[b],h=b;h--;){var s=D[h];if(!s)return;s.programDateTime=c.programDateTime-s.duration*1e3,c=s}}function f(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(ue,Y,L){"use strict";L.r(Y);var V=L("./src/polyfills/number.ts"),_=L("./src/events.ts"),k=L("./src/errors.ts"),j=L("./src/utils/logger.ts"),U=L("./src/utils/mp4-tools.ts"),O=L("./src/loader/m3u8-parser.ts"),I=L("./src/types/loader.ts"),v=L("./src/utils/attr-list.ts");function S(A){var C=A.type;switch(C){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function M(A,C){var d=A.url;return(d===void 0||d.indexOf("data:")===0)&&(d=C.url),d}var w=function(){function A(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,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 l=this.hls.config,u=l.pLoader,x=l.loader,m=u||x,f=new m(l);return o.loader=f,this.loaders[o.type]=f,f},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 l=this.loaders[o];l&&l.destroy(),this.resetInternalLoader(o)}},C.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},C.onManifestLoading=function(o,l){var u=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},C.onLevelLoading=function(o,l){var u=l.id,x=l.level,m=l.url,f=l.deliveryDirectives;this.load({id:u,groupId:null,level:x,responseType:"text",type:I.PlaylistContextType.LEVEL,url:m,deliveryDirectives:f})},C.onAudioTrackLoading=function(o,l){var u=l.id,x=l.groupId,m=l.url,f=l.deliveryDirectives;this.load({id:u,groupId:x,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:f})},C.onSubtitleTrackLoading=function(o,l){var u=l.id,x=l.groupId,m=l.url,f=l.deliveryDirectives;this.load({id:u,groupId:x,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:f})},C.load=function(o){var l,u=this.hls.config,x=this.getInternalLoader(o);if(x){var m=x.context;if(m&&m.url===o.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),x.abort()}var f,D,b,c;switch(o.type){case I.PlaylistContextType.MANIFEST:f=u.manifestLoadingMaxRetry,D=u.manifestLoadingTimeOut,b=u.manifestLoadingRetryDelay,c=u.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:f=0,D=u.levelLoadingTimeOut;break;default:f=u.levelLoadingMaxRetry,D=u.levelLoadingTimeOut,b=u.levelLoadingRetryDelay,c=u.levelLoadingMaxRetryTimeout;break}if(x=this.createInternalLoader(o),(l=o.deliveryDirectives)!==null&&l!==void 0&&l.part){var h;if(o.type===I.PlaylistContextType.LEVEL&&o.level!==null?h=this.hls.levels[o.level].details:o.type===I.PlaylistContextType.AUDIO_TRACK&&o.id!==null?h=this.hls.audioTracks[o.id].details:o.type===I.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(h=this.hls.subtitleTracks[o.id].details),h){var s=h.partTarget,a=h.targetduration;s&&a&&(D=Math.min(Math.max(s*3,a*.8)*1e3,D))}}var g={timeout:D,maxRetry:f,retryDelay:b,maxRetryDelay:c,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};x.load(o,g,p)},C.loadsuccess=function(o,l,u,x){if(x===void 0&&(x=null),u.isSidxRequest){this.handleSidxRequest(o,u),this.handlePlaylistLoaded(o,l,u,x);return}this.resetInternalLoader(u.type);var m=o.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,u,"no EXTM3U delimiter",x);return}l.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,l,u,x):this.handleMasterPlaylist(o,l,u,x)},C.loaderror=function(o,l,u){u===void 0&&(u=null),this.handleNetworkError(l,u,!1,o)},C.loadtimeout=function(o,l,u){u===void 0&&(u=null),this.handleNetworkError(l,u,!0)},C.handleMasterPlaylist=function(o,l,u,x){var m=this.hls,f=o.data,D=M(o,u),b=O.default.parseMasterPlaylist(f,D),c=b.levels,h=b.sessionData;if(!c.length){this.handleManifestParsingError(o,u,"no level found in manifest",x);return}var s=c.map(function(G){return{id:G.attrs.AUDIO,audioCodec:G.audioCodec}}),a=c.map(function(G){return{id:G.attrs.SUBTITLES,textCodec:G.textCodec}}),g=O.default.parseMasterPlaylistMedia(f,D,"AUDIO",s),p=O.default.parseMasterPlaylistMedia(f,D,"SUBTITLES",a),y=O.default.parseMasterPlaylistMedia(f,D,"CLOSED-CAPTIONS");if(g.length){var P=g.some(function(G){return!G.url});!P&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(j.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}m.trigger(_.Events.MANIFEST_LOADED,{levels:c,audioTracks:g,subtitles:p,captions:y,url:D,stats:l,networkDetails:x,sessionData:h})},C.handleTrackOrLevelPlaylist=function(o,l,u,x){var m=this.hls,f=u.id,D=u.level,b=u.type,c=M(o,u),h=Object(V.isFiniteNumber)(f)?f:0,s=Object(V.isFiniteNumber)(D)?D:h,a=S(u),g=O.default.parseLevelPlaylist(o.data,c,s,a,h);if(!g.fragments.length){m.trigger(_.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.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===I.PlaylistContextType.MANIFEST){var p={attrs:new v.AttrList({}),bitrate:0,details:g,name:"",url:c};m.trigger(_.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:c,stats:l,networkDetails:x,sessionData:null})}if(l.parsing.end=performance.now(),g.needSidxRanges){var y,P=(y=g.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:P,isSidxRequest:!0,type:b,level:D,levelDetails:g,id:f,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=g,this.handlePlaylistLoaded(o,l,u,x)},C.handleSidxRequest=function(o,l){var u=Object(U.parseSegmentIndex)(new Uint8Array(o.data));if(!u)return;var x=u.references,m=l.levelDetails;x.forEach(function(f,D){var b=f.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,l,u,x){this.hls.trigger(_.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===I.PlaylistContextType.MANIFEST,url:o.url,reason:u,response:o,context:l,networkDetails:x})},C.handleNetworkError=function(o,l,u,x){u===void 0&&(u=!1),j.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=k.ErrorDetails.UNKNOWN,f=!1,D=this.getInternalLoader(o);switch(o.type){case I.PlaylistContextType.MANIFEST:m=u?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,f=!0;break;case I.PlaylistContextType.LEVEL:m=u?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,f=!1;break;case I.PlaylistContextType.AUDIO_TRACK:m=u?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:m=u?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,f=!1;break}D&&this.resetInternalLoader(o.type);var b={type:k.ErrorTypes.NETWORK_ERROR,details:m,fatal:f,url:o.url,loader:D,context:o,networkDetails:l};x&&(b.response=x),this.hls.trigger(_.Events.ERROR,b)},C.handlePlaylistLoaded=function(o,l,u,x){var m=u.type,f=u.level,D=u.id,b=u.groupId,c=u.loader,h=u.levelDetails,s=u.deliveryDirectives;if(!(h!=null&&h.targetduration)){this.handleManifestParsingError(o,u,"invalid target duration",x);return}if(!c)return;h.live&&(c.getCacheAge&&(h.ageHeader=c.getCacheAge()||0),(!c.getCacheAge||isNaN(h.ageHeader))&&(h.ageHeader=0));switch(m){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(_.Events.LEVEL_LOADED,{details:h,level:f||0,id:D||0,stats:l,networkDetails:x,deliveryDirectives:s});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(_.Events.AUDIO_TRACK_LOADED,{details:h,id:D||0,groupId:b||"",stats:l,networkDetails:x,deliveryDirectives:s});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(_.Events.SUBTITLE_TRACK_LOADED,{details:h,id:D||0,groupId:b||"",stats:l,networkDetails:x,deliveryDirectives:s});break}},A}();Y.default=w},"./src/polyfills/number.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"isFiniteNumber",function(){return V}),L.d(Y,"MAX_SAFE_INTEGER",function(){return _});var V=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},_=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,Y,L){"use strict";L.r(Y);var V=function(){function _(){}return _.getSilentFrame=function(j,U){switch(j){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===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(U===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(U===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(U===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(U===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(ue,Y,L){"use strict";L.r(Y);var V=Math.pow(2,32)-1,_=function(){function k(){}return k.init=function(){k.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 U;for(U in k.types)k.types.hasOwnProperty(U)&&(k.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.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]),I=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]);k.HDLR_TYPES={video:O,audio:I};var v=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]);k.STTS=k.STSC=k.STCO=S,k.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),k.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),k.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),k.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var M=new Uint8Array([105,115,111,109]),w=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,M,A,M,w),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,v))},k.box=function(U){for(var O=8,I=arguments.length,v=new Array(I>1?I-1:0),S=1;S<I;S++)v[S-1]=arguments[S];for(var M=v.length,w=M;M--;)O+=v[M].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(U,4),M=0,O=8;M<w;M++)A.set(v[M],O),O+=v[M].byteLength;return A},k.hdlr=function(U){return k.box(k.types.hdlr,k.HDLR_TYPES[U])},k.mdat=function(U){return k.box(k.types.mdat,U)},k.mdhd=function(U,O){O*=U;var I=Math.floor(O/(V+1)),v=Math.floor(O%(V+1));return k.box(k.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,I>>24,I>>16&255,I>>8&255,I&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},k.mdia=function(U){return k.box(k.types.mdia,k.mdhd(U.timescale,U.duration),k.hdlr(U.type),k.minf(U))},k.mfhd=function(U){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},k.minf=function(U){return U.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(U)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(U))},k.moof=function(U,O,I){return k.box(k.types.moof,k.mfhd(U),k.traf(I,O))},k.moov=function(U){for(var O=U.length,I=[];O--;)I[O]=k.trak(U[O]);return k.box.apply(null,[k.types.moov,k.mvhd(U[0].timescale,U[0].duration)].concat(I).concat(k.mvex(U)))},k.mvex=function(U){for(var O=U.length,I=[];O--;)I[O]=k.trex(U[O]);return k.box.apply(null,[k.types.mvex].concat(I))},k.mvhd=function(U,O){O*=U;var I=Math.floor(O/(V+1)),v=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,U>>24&255,U>>16&255,U>>8&255,U&255,I>>24,I>>16&255,I>>8&255,I&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return k.box(k.types.mvhd,S)},k.sdtp=function(U){var O=U.samples||[],I=new Uint8Array(4+O.length),v,S;for(v=0;v<O.length;v++)S=O[v].flags,I[v+4]=S.dependsOn<<4|S.isDependedOn<<2|S.hasRedundancy;return k.box(k.types.sdtp,I)},k.stbl=function(U){return k.box(k.types.stbl,k.stsd(U),k.box(k.types.stts,k.STTS),k.box(k.types.stsc,k.STSC),k.box(k.types.stsz,k.STSZ),k.box(k.types.stco,k.STCO))},k.avc1=function(U){var O=[],I=[],v,S,M;for(v=0;v<U.sps.length;v++)S=U.sps[v],M=S.byteLength,O.push(M>>>8&255),O.push(M&255),O=O.concat(Array.prototype.slice.call(S));for(v=0;v<U.pps.length;v++)S=U.pps[v],M=S.byteLength,I.push(M>>>8&255),I.push(M&255),I=I.concat(Array.prototype.slice.call(S));var w=k.box(k.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|U.sps.length].concat(O).concat([U.pps.length]).concat(I))),A=U.width,C=U.height,d=U.pixelRatio[0],o=U.pixelRatio[1];return k.box(k.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,k.box(k.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),k.box(k.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,o>>24,o>>16&255,o>>8&255,o&255])))},k.esds=function(U){var O=U.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(U.config).concat([6,1,2]))},k.mp4a=function(U){var O=U.samplerate;return k.box(k.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),k.box(k.types.esds,k.esds(U)))},k.mp3=function(U){var O=U.samplerate;return k.box(k.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},k.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(U)):k.box(k.types.stsd,k.STSD,k.mp4a(U)):k.box(k.types.stsd,k.STSD,k.avc1(U))},k.tkhd=function(U){var O=U.id,I=U.duration*U.timescale,v=U.width,S=U.height,M=Math.floor(I/(V+1)),w=Math.floor(I%(V+1));return k.box(k.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,M>>24,M>>16&255,M>>8&255,M&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,v>>8&255,v&255,0,0,S>>8&255,S&255,0,0]))},k.traf=function(U,O){var I=k.sdtp(U),v=U.id,S=Math.floor(O/(V+1)),M=Math.floor(O%(V+1));return k.box(k.types.traf,k.box(k.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),k.box(k.types.tfdt,new Uint8Array([1,0,0,0,S>>24,S>>16&255,S>>8&255,S&255,M>>24,M>>16&255,M>>8&255,M&255])),k.trun(U,I.length+16+20+8+16+8+8),I)},k.trak=function(U){return U.duration=U.duration||4294967295,k.box(k.types.trak,k.tkhd(U),k.mdia(U))},k.trex=function(U){var O=U.id;return k.box(k.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]))},k.trun=function(U,O){var I=U.samples||[],v=I.length,S=12+16*v,M=new Uint8Array(S),w,A,C,d,o,l;for(O+=8+S,M.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),w=0;w<v;w++)A=I[w],C=A.duration,d=A.size,o=A.flags,l=A.cts,M.set([C>>>24&255,C>>>16&255,C>>>8&255,C&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*w);return k.box(k.types.trun,M)},k.initSegment=function(U){k.types||k.init();var O=k.moov(U),I=new Uint8Array(k.FTYP.byteLength+O.byteLength);return I.set(k.FTYP),I.set(O,k.FTYP.byteLength),I},k}();_.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(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return l}),L.d(Y,"normalizePts",function(){return u});var V=L("./src/polyfills/number.ts"),_=L("./src/remux/aac-helper.ts"),k=L("./src/remux/mp4-generator.ts"),j=L("./src/events.ts"),U=L("./src/errors.ts"),O=L("./src/utils/logger.ts"),I=L("./src/types/loader.ts"),v=L("./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 h in c)Object.prototype.hasOwnProperty.call(c,h)&&(D[h]=c[h])}return D},S.apply(this,arguments)}var M=10*1e3,w=1024,A=1152,C=null,d=null,o=!1,l=function(){function D(c,h,s,a){if(a===void 0&&(a=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=c,this.config=h,this.typeSupported=s,this.ISGenerated=!1,C===null){var g=navigator.userAgent||"",p=g.match(/Chrome\/(\d+)/i);C=p?parseInt(p[1]):0}if(d===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);d=y?parseInt(y[1]):0}o=!!C&&C<75||!!d&&d<600}var b=D.prototype;return b.destroy=function(){},b.resetTimeStamp=function(h){O.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=h},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(h){var s=!1,a=h.reduce(function(g,p){var y=p.pts-g;return y<-4294967296?(s=!0,u(g,p.pts)):y>0?g:p.pts},h[0].pts);return s&&O.logger.debug("PTS rollover detected"),a},b.remux=function(h,s,a,g,p,y,P,G){var Q,re,z,F,ne,ce,ge=p,be=p,Be=h.pid>-1,Se=s.pid>-1,Le=s.samples.length,Te=h.samples.length>0,we=Le>1,ve=(!Be||Te)&&(!Se||we)||this.ISGenerated||P;if(ve){this.ISGenerated||(z=this.generateIS(h,s,p));var H=this.isVideoContiguous,T=-1;if(we&&(T=x(s.samples),!H&&this.config.forceKeyFrameOnDiscontinuity))if(ce=!0,T>0){O.logger.warn("[mp4-remuxer]: Dropped "+T+" out of "+Le+" video samples due to a missing keyframe");var R=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(T),s.dropped+=T,be+=(s.samples[0].pts-R)/(s.timescale||9e4)}else T===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+Le+" video samples"),ce=!1);if(this.ISGenerated){if(Te&&we){var W=this.getVideoStartPts(s.samples),$=u(h.samples[0].pts,W)-W,N=$/s.inputTimeScale;ge+=Math.max(0,N),be+=Math.max(0,-N)}if(Te){if(h.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(h,s,p)),re=this.remuxAudio(h,ge,this.isAudioContiguous,y,Se||we||G===I.PlaylistLevelType.AUDIO?be:void 0),we){var de=re?re.endPTS-re.startPTS:0;s.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(h,s,p)),Q=this.remuxVideo(s,be,H,de)}}else we&&(Q=this.remuxVideo(s,be,H,0));Q&&(Q.firstKeyFrame=T,Q.independent=T!==-1)}}return this.ISGenerated&&(a.samples.length&&(ne=this.remuxID3(a,p)),g.samples.length&&(F=this.remuxText(g,p))),{audio:re,video:Q,initSegment:z,independent:ce,text:F,id3:ne}},b.generateIS=function(h,s,a){var g=h.samples,p=s.samples,y=this.typeSupported,P={},G=!Object(V.isFiniteNumber)(this._initPTS),Q="audio/mp4",re,z,F;if(G&&(re=z=Infinity),h.config&&g.length&&(h.timescale=h.samplerate,h.isAAC||(y.mpeg?(Q="audio/mpeg",h.codec=""):y.mp3&&(h.codec="mp3")),P.audio={id:"audio",container:Q,codec:h.codec,initSegment:!h.isAAC&&y.mpeg?new Uint8Array(0):k.default.initSegment([h]),metadata:{channelCount:h.channelCount}},G&&(F=h.inputTimeScale,re=z=g[0].pts-Math.round(F*a))),s.sps&&s.pps&&p.length&&(s.timescale=s.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:k.default.initSegment([s]),metadata:{width:s.width,height:s.height}},G)){F=s.inputTimeScale;var ne=this.getVideoStartPts(p),ce=Math.round(F*a);z=Math.min(z,u(p[0].dts,ne)-ce),re=Math.min(re,ne-ce)}if(Object.keys(P).length)return this.ISGenerated=!0,G&&(this._initPTS=re,this._initDTS=z),{tracks:P,initPTS:re,timescale:F}},b.remuxVideo=function(h,s,a,g){var p=h.inputTimeScale,y=h.samples,P=[],G=y.length,Q=this._initPTS,re=this.nextAvcDts,z=8,F,ne,ce,ge=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,Be=0,Se=!1;if(!a||re===null){var Le=s*p,Te=y[0].pts-u(y[0].dts,y[0].pts);re=Le-Te}for(var we=0;we<G;we++){var ve=y[we];if(ve.pts=u(ve.pts-Q,re),ve.dts=u(ve.dts-Q,re),ve.dts>ve.pts){var H=9e4*.2;Be=Math.max(Math.min(Be,ve.pts-ve.dts),-1*H)}ve.dts<y[we>0?we-1:we].dts&&(Se=!0)}Se&&y.sort(function(St,ot){var nt=St.dts-ot.dts,Mt=St.pts-ot.pts;return nt||Mt}),ne=y[0].dts,ce=y[y.length-1].dts;var T=Math.round((ce-ne)/(G-1));if(Be<0){if(Be<T*-2){O.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-T,!0)+" ms");for(var R=Be,W=0;W<G;W++)y[W].dts=R=Math.max(R,y[W].pts-T),y[W].pts=Math.max(R,y[W].pts)}else{O.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Be,!0)+" ms to overcome this issue");for(var $=0;$<G;$++)y[$].dts=y[$].dts+Be}ne=y[0].dts}if(a){var N=ne-re,de=N>T,xe=N<-1;if(de||xe){de?O.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(N,!0)+" ms ("+N+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-N,!0)+" ms ("+N+"dts) overlapping between fragments detected"),ne=re;var Ae=y[0].pts-N;y[0].dts=ne,y[0].pts=Ae,O.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Ae,!0)+"/"+Object(v.toMsFromMpegTsClock)(ne,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(N,!0)+" ms")}}o&&(ne=Math.max(0,ne));for(var Ne=0,Me=0,Re=0;Re<G;Re++){for(var Pe=y[Re],We=Pe.units,Qe=We.length,Ve=0,Ge=0;Ge<Qe;Ge++)Ve+=We[Ge].data.length;Me+=Ve,Ne+=Qe,Pe.length=Ve,Pe.dts=Math.max(Pe.dts,ne),Pe.pts=Math.max(Pe.pts,Pe.dts,0),ge=Math.min(Pe.pts,ge),be=Math.max(Pe.pts,be)}ce=y[G-1].dts;var at=Me+4*Ne+8,Xe;try{Xe=new Uint8Array(at)}catch(St){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:at,reason:"fail allocating video mdat "+at});return}var Ze=new DataView(Xe.buffer);Ze.setUint32(0,at),Xe.set(k.default.types.mdat,4);for(var De=0;De<G;De++){for(var rt=y[De],qe=rt.units,oe=0,J=0,Z=qe.length;J<Z;J++){var ae=qe[J],se=ae.data,ee=ae.data.byteLength;Ze.setUint32(z,ee),z+=4,Xe.set(se,z),z+=ee,oe+=4+ee}if(De<G-1)F=y[De+1].dts-rt.dts;else{var ie=this.config,le=rt.dts-y[De>0?De-1:De].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var he=Math.floor(ie.maxBufferHole*p),me=(g?ge+g*p:this.nextAudioPts)-rt.pts;me>he?(F=me-le,F<0&&(F=le),O.logger.log("[mp4-remuxer]: It is approximately "+me/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=le}else F=le}var ye=Math.round(rt.pts-rt.dts);P.push(new m(rt.key,F,oe,ye))}if(P.length&&C&&C<70){var ke=P[0].flags;ke.dependsOn=2,ke.isNonSync=0}console.assert(F!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=re=ce+F,this.isVideoContiguous=!0;var He=k.default.moof(h.sequenceNumber++,ne,S({},h,{samples:P})),$e="video",et={data1:He,data2:Xe,startPTS:ge/p,endPTS:(be+F)/p,startDTS:ne/p,endDTS:re/p,type:$e,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:h.dropped};return h.samples=[],h.dropped=0,console.assert(Xe.length,"MDAT length must not be zero"),et},b.remuxAudio=function(h,s,a,g,p){var y=h.inputTimeScale,P=h.samplerate?h.samplerate:y,G=y/P,Q=h.isAAC?w:A,re=Q*G,z=this._initPTS,F=!h.isAAC&&this.typeSupported.mpeg,ne=[],ce=h.samples,ge=F?0:8,be=this.nextAudioPts||-1,Be=s*y;if(this.isAudioContiguous=a=a||ce.length&&be>0&&(g&&Math.abs(Be-be)<9e3||Math.abs(u(ce[0].pts-z,Be)-be)<20*re),ce.forEach(function(se){se.pts=u(se.pts-z,Be)}),!a||be<0){if(ce=ce.filter(function(se){return se.pts>=0}),!ce.length)return;p===0?be=0:g?be=Math.max(0,Be):be=ce[0].pts}if(h.isAAC)for(var Se=p!==void 0,Le=this.config.maxAudioFramesDrift,Te=0,we=be;Te<ce.length;Te++){var ve=ce[Te],H=ve.pts,T=H-we,R=Math.abs(1e3*T/y);if(T<=-Le*re&&Se)Te===0&&(O.logger.warn("Audio frame @ "+(H/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*T/y)+" ms."),this.nextAudioPts=be=we=H);else if(T>=Le*re&&R<M&&Se){var W=Math.round(T/re);we=H-W*re,we<0&&(W--,we+=re),Te===0&&(this.nextAudioPts=be=we),O.logger.warn("[mp4-remuxer]: Injecting "+W+" audio frame @ "+(we/y).toFixed(3)+"s due to "+Math.round(1e3*T/y)+" ms gap.");for(var $=0;$<W;$++){var N=Math.max(we,0),de=_.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);de||(O.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),de=ve.unit.subarray()),ce.splice(Te,0,{unit:de,pts:N}),we+=re,Te++}}ve.pts=we,we+=re}for(var xe=null,Ae=null,Ne,Me=0,Re=ce.length;Re--;)Me+=ce[Re].unit.byteLength;for(var Pe=0,We=ce.length;Pe<We;Pe++){var Qe=ce[Pe],Ve=Qe.unit,Ge=Qe.pts;if(Ae!==null){var at=ne[Pe-1];at.duration=Math.round((Ge-Ae)/G)}else if(a&&h.isAAC&&(Ge=be),xe=Ge,Me>0){Me+=ge;try{Ne=new Uint8Array(Me)}catch(se){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Me,reason:"fail allocating audio mdat "+Me});return}if(!F){var Xe=new DataView(Ne.buffer);Xe.setUint32(0,Me),Ne.set(k.default.types.mdat,4)}}else return;Ne.set(Ve,ge);var Ze=Ve.byteLength;ge+=Ze,ne.push(new m(!0,Q,Ze,0)),Ae=Ge}var De=ne.length;if(!De)return;var rt=ne[ne.length-1];this.nextAudioPts=be=Ae+G*rt.duration;var qe=F?new Uint8Array(0):k.default.moof(h.sequenceNumber++,xe/G,S({},h,{samples:ne}));h.samples=[];var oe=xe/y,J=be/y,Z="audio",ae={data1:qe,data2:Ne,startPTS:oe,endPTS:J,startDTS:oe,endDTS:J,type:Z,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(Ne.length,"MDAT length must not be zero"),ae},b.remuxEmptyAudio=function(h,s,a,g){var p=h.inputTimeScale,y=h.samplerate?h.samplerate:p,P=p/y,G=this.nextAudioPts,Q=(G!==null?G:g.startDTS*p)+this._initDTS,re=g.endDTS*p+this._initDTS,z=P*w,F=Math.ceil((re-Q)/z),ne=_.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!ne){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ce=[],ge=0;ge<F;ge++){var be=Q+ge*z;ce.push({unit:ne,pts:be,dts:be})}return h.samples=ce,this.remuxAudio(h,s,a,!1)},b.remuxID3=function(h,s){var a=h.samples.length;if(!a)return;for(var g=h.inputTimeScale,p=this._initPTS,y=this._initDTS,P=0;P<a;P++){var G=h.samples[P];G.pts=u(G.pts-p,s*g)/g,G.dts=u(G.dts-y,s*g)/g}var Q=h.samples;return h.samples=[],{samples:Q}},b.remuxText=function(h,s){var a=h.samples.length;if(!a)return;for(var g=h.inputTimeScale,p=this._initPTS,y=0;y<a;y++){var P=h.samples[y];P.pts=u(P.pts-p,s*g)/g}h.samples.sort(function(Q,re){return Q.pts-re.pts});var G=h.samples;return h.samples=[],{samples:G}},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 x(D){for(var b=0;b<D.length;b++)if(D[b].key)return b;return-1}var m=function(b,c,h,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=c,this.size=h,this.cts=s,this.flags=new f(b)},f=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(ue,Y,L){"use strict";L.r(Y);var V=L("./src/polyfills/number.ts"),_=L("./src/utils/mp4-tools.ts"),k=L("./src/loader/fragment.ts"),j=L("./src/utils/logger.ts"),U=function(){function v(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var S=v.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 d=this.initData=Object(_.parseInitSegment)(w);A||(A=I(d.audio,k.ElementaryStreamTypes.AUDIO)),C||(C=I(d.video,k.ElementaryStreamTypes.VIDEO));var o={};d.audio&&d.video?o.audiovideo={container:"video/mp4",codec:A+","+C,initSegment:w,id:"main"}:d.audio?o.audio={container:"audio/mp4",codec:A,initSegment:w,id:"audio"}:d.video?o.video={container:"video/mp4",codec:C,initSegment:w,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},S.remux=function(w,A,C,d,o){var l=this.initPTS,u=this.lastEndDTS,x={audio:void 0,video:void 0,text:d,id3:C,initSegment:void 0};Object(V.isFiniteNumber)(u)||(u=this.lastEndDTS=o||0);var m=A.samples;if(!m||!m.length)return x;var f={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(m),D=this.initData),!D||!D.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),x;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(l)||(this.initPTS=f.initPTS=l=O(D,m,u));var b=Object(_.getDuration)(m,D),c=u,h=b+c;Object(_.offsetStartDTS)(D,m,l),b>0?this.lastEndDTS=h:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!D.audio,a=!!D.video,g="";s&&(g+="audio"),a&&(g+="video");var p={data1:m,startPTS:c,startDTS:c,endPTS:h,endDTS:h,type:g,hasAudio:s,hasVideo:a,nb:1,dropped:0};return x.audio=p.type==="audio"?p:void 0,x.video=p.type!=="audio"?p:void 0,x.text=d,x.id3=C,x.initSegment=f,x},v}(),O=function(S,M,w){return Object(_.getStartDTS)(S,M)-w};function I(v,S){var M=v==null?void 0:v.codec;return M&&M.length>4?M:M==="hvc1"?"hvc1.1.c.L120.90":M==="av01"?"av01.0.04M.08":M==="avc1"||S===k.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=U},"./src/task-loop.ts":function(ue,Y,L){"use strict";L.r(Y),L.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 k=_.prototype;return k.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},k.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},k.onHandlerDestroyed=function(){},k.hasInterval=function(){return!!this._tickInterval},k.hasNextTick=function(){return!!this._tickTimer},k.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},k.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},k.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},k.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},k.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},k.doTick=function(){},_}()},"./src/types/cmcd.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"CMCDVersion",function(){return V}),L.d(Y,"CMCDObjectType",function(){return _}),L.d(Y,"CMCDStreamingFormat",function(){return k}),L.d(Y,"CMCDStreamType",function(){return j});var V=1,_;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(_||(_={}));var k;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(k||(k={}));var j;(function(U){U.VOD="v",U.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"HlsSkip",function(){return k}),L.d(Y,"getSkipValue",function(){return j}),L.d(Y,"HlsUrlParameters",function(){return U}),L.d(Y,"Level",function(){return O});function V(I,v){for(var S=0;S<v.length;S++){var M=v[S];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(I,M.key,M)}}function _(I,v,S){return v&&V(I.prototype,v),S&&V(I,S),I}var k;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(k||(k={}));function j(I,v){var S=I.canSkipUntil,M=I.canSkipDateRanges,w=I.endSN,A=v!==void 0?v-w:0;return S&&A<S?M?k.v2:k.Yes:k.No}var U=function(){function I(S,M,w){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=S,this.part=M,this.skip=w}var v=I.prototype;return v.addDirectives=function(M){var w=new self.URL(M);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()},I}(),O=function(){function I(v){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(S){return S}).join(",").replace(/\.[^.,]+/g,"")}return _(I,[{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 M=S%this.url.length;this._urlId!==M&&(this.details=void 0,this._urlId=M)}}]),I}()},"./src/types/loader.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"PlaylistContextType",function(){return V}),L.d(Y,"PlaylistLevelType",function(){return _});var V;(function(k){k.MANIFEST="manifest",k.LEVEL="level",k.AUDIO_TRACK="audioTrack",k.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var _;(function(k){k.MAIN="main",k.AUDIO="audio",k.SUBTITLE="subtitle"})(_||(_={}))},"./src/types/transmuxer.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"ChunkMetadata",function(){return V});var V=function(j,U,O,I,v,S){I===void 0&&(I=0),v===void 0&&(v=-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=j,this.sn=U,this.id=O,this.size=I,this.part=v,this.partial=S};function _(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"AttrList",function(){return k});var V=/^(\d+)x(\d+)$/,_=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,k=function(){function j(O){typeof O=="string"&&(O=j.parseAttrList(O));for(var I in O)O.hasOwnProperty(I)&&(this[I]=O[I])}var U=j.prototype;return U.decimalInteger=function(I){var v=parseInt(this[I],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},U.hexadecimalInteger=function(I){if(this[I]){var v=(this[I]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var S=new Uint8Array(v.length/2),M=0;M<v.length/2;M++)S[M]=parseInt(v.slice(M*2,M*2+2),16);return S}else return null},U.hexadecimalIntegerAsNumber=function(I){var v=parseInt(this[I],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},U.decimalFloatingPoint=function(I){return parseFloat(this[I])},U.optionalFloat=function(I,v){var S=this[I];return S?parseFloat(S):v},U.enumeratedString=function(I){return this[I]},U.bool=function(I){return this[I]==="YES"},U.decimalResolution=function(I){var v=V.exec(this[I]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},j.parseAttrList=function(I){var v,S={},M='"';for(_.lastIndex=0;(v=_.exec(I))!==null;){var w=v[2];w.indexOf(M)===0&&w.lastIndexOf(M)===w.length-1&&(w=w.slice(1,-1)),S[v[1]]=w}return S},j}()},"./src/utils/binary-search.ts":function(ue,Y,L){"use strict";L.r(Y);var V={search:function(k,j){for(var U=0,O=k.length-1,I=null,v=null;U<=O;){I=(U+O)/2|0,v=k[I];var S=j(v);if(S>0)U=I+1;else if(S<0)O=I-1;else return v}return null}};Y.default=V},"./src/utils/buffer-helper.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"BufferHelper",function(){return k});var V=L("./src/utils/logger.ts"),_={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function j(){}return j.isBuffered=function(O,I){try{if(O){for(var v=j.getBuffered(O),S=0;S<v.length;S++)if(I>=v.start(S)&&I<=v.end(S))return!0}}catch(M){}return!1},j.bufferInfo=function(O,I,v){try{if(O){var S=j.getBuffered(O),M=[],w;for(w=0;w<S.length;w++)M.push({start:S.start(w),end:S.end(w)});return this.bufferedInfo(M,I,v)}}catch(A){}return{len:0,start:I,end:I,nextStart:void 0}},j.bufferedInfo=function(O,I,v){I=Math.max(0,I),O.sort(function(f,D){var b=f.start-D.start;return b||D.end-f.end});var S=[];if(v)for(var M=0;M<O.length;M++){var w=S.length;if(w){var A=S[w-1].end;O[M].start-A<v?O[M].end>A&&(S[w-1].end=O[M].end):S.push(O[M])}else S.push(O[M])}else S=O;for(var C=0,d,o=I,l=I,u=0;u<S.length;u++){var x=S[u].start,m=S[u].end;if(I+v>=x&&I<m)o=x,l=m,C=l-I;else if(I+v<x){d=x;break}}return{len:C,start:o||0,end:l||0,nextStart:d}},j.getBuffered=function(O){try{return O.buffered}catch(I){return V.logger.log("failed to get media.buffered",I),_}},j}()},"./src/utils/cea-608-parser.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"Row",function(){return l}),L.d(Y,"CaptionScreen",function(){return u});var V=L("./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},k=function(h){var s=h;return _.hasOwnProperty(h)&&(s=_[h]),String.fromCharCode(s)},j=15,U=100,O={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},S={25:2,26:4,29:6,30:8,31:10,27:13,28:15},M=["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 h=c.prototype;return h.log=function(a,g){this.verboseLevel>=a&&V.logger.log(this.time+" ["+a+"] "+g)},c}(),C=function(h){for(var s=[],a=0;a<h.length;a++)s.push(h[a].toString(16));return s},d=function(){function c(s,a,g,p,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=a||!1,this.italics=g||!1,this.background=p||"black",this.flash=y||!1}var h=c.prototype;return h.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},h.setStyles=function(a){for(var g=["foreground","underline","italics","background","flash"],p=0;p<g.length;p++){var y=g[p];a.hasOwnProperty(y)&&(this[y]=a[y])}},h.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},h.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},h.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},h.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},c}(),o=function(){function c(s,a,g,p,y,P){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new d(a,g,p,y,P)}var h=c.prototype;return h.reset=function(){this.uchar=" ",this.penState.reset()},h.setChar=function(a,g){this.uchar=a,this.penState.copy(g)},h.setPenState=function(a){this.penState.copy(a)},h.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},h.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},h.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},c}(),l=function(){function c(s){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var a=0;a<U;a++)this.chars.push(new o);this.logger=s,this.pos=0,this.currPenState=new d}var h=c.prototype;return h.equals=function(a){for(var g=!0,p=0;p<U;p++)if(!this.chars[p].equals(a.chars[p])){g=!1;break}return g},h.copy=function(a){for(var g=0;g<U;g++)this.chars[g].copy(a.chars[g])},h.isEmpty=function(){for(var a=!0,g=0;g<U;g++)if(!this.chars[g].isEmpty()){a=!1;break}return a},h.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>U&&(this.logger.log(w.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},h.moveCursor=function(a){var g=this.pos+a;if(a>1)for(var p=this.pos+1;p<g+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(g)},h.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},h.insertChar=function(a){a>=144&&this.backSpace();var g=k(a);if(this.pos>=U){this.logger.log(w.ERROR,"Cannot insert "+a.toString(16)+" ("+g+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(g,this.currPenState),this.moveCursor(1)},h.clearFromPos=function(a){var g;for(g=a;g<U;g++)this.chars[g].reset()},h.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},h.clearToEndOfRow=function(){this.clearFromPos(this.pos)},h.getTextString=function(){for(var a=[],g=!0,p=0;p<U;p++){var y=this.chars[p].uchar;y!==" "&&(g=!1),a.push(y)}return g?"":a.join("")},h.setPenStyles=function(a){this.currPenState.setStyles(a);var g=this.chars[this.pos];g.setPenState(this.currPenState)},c}(),u=function(){function c(s){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var a=0;a<j;a++)this.rows.push(new l(s));this.logger=s,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var h=c.prototype;return h.reset=function(){for(var a=0;a<j;a++)this.rows[a].clear();this.currRow=j-1},h.equals=function(a){for(var g=!0,p=0;p<j;p++)if(!this.rows[p].equals(a.rows[p])){g=!1;break}return g},h.copy=function(a){for(var g=0;g<j;g++)this.rows[g].copy(a.rows[g])},h.isEmpty=function(){for(var a=!0,g=0;g<j;g++)if(!this.rows[g].isEmpty()){a=!1;break}return a},h.backSpace=function(){var a=this.rows[this.currRow];a.backSpace()},h.clearToEndOfRow=function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},h.insertChar=function(a){var g=this.rows[this.currRow];g.insertChar(a)},h.setPen=function(a){var g=this.rows[this.currRow];g.setPenStyles(a)},h.moveCursor=function(a){var g=this.rows[this.currRow];g.moveCursor(a)},h.setCursor=function(a){this.logger.log(w.INFO,"setCursor: "+a);var g=this.rows[this.currRow];g.setCursor(a)},h.setPAC=function(a){this.logger.log(w.INFO,"pacData = "+JSON.stringify(a));var g=a.row-1;if(this.nrRollUpRows&&g<this.nrRollUpRows-1&&(g=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==g){for(var p=0;p<j;p++)this.rows[p].clear();var y=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var G=P.rows[y].cueStartTime,Q=this.logger.time;if(G&&Q!==null&&G<Q)for(var re=0;re<this.nrRollUpRows;re++)this.rows[g-this.nrRollUpRows+re+1].copy(P.rows[y+re])}}this.currRow=g;var z=this.rows[this.currRow];if(a.indent!==null){var F=a.indent,ne=Math.max(F-1,0);z.setCursor(a.indent),a.color=z.chars[ne].penState.foreground}var ce={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(ce)},h.setBkgData=function(a){this.logger.log(w.INFO,"bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},h.setRollUpRows=function(a){this.nrRollUpRows=a},h.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,g=this.rows.splice(a,1)[0];g.clear(),this.rows.splice(this.currRow,0,g),this.logger.log(w.INFO,"Rolling up")},h.getDisplayText=function(a){a=a||!1;for(var g=[],p="",y=-1,P=0;P<j;P++){var G=this.rows[P].getTextString();G&&(y=P+1,a?g.push("Row "+y+": '"+G+"'"):g.push(G.trim()))}return g.length>0&&(a?p="["+g.join(" | ")+"]":p=g.join(`
`)),p},h.getTextAndFormat=function(){return this.rows},c}(),x=function(){function c(s,a,g){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=s,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new u(g),this.nonDisplayedMemory=new u(g),this.lastOutputScreen=new u(g),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=g}var h=c.prototype;return h.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},h.getHandler=function(){return this.outputFilter},h.setHandler=function(a){this.outputFilter=a},h.setPAC=function(a){this.writeScreen.setPAC(a)},h.setBkgData=function(a){this.writeScreen.setBkgData(a)},h.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},h.insertChars=function(a){for(var g=0;g<a.length;g++)this.writeScreen.insertChar(a[g]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(w.INFO,p+": "+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())},h.ccRCL=function(){this.logger.log(w.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},h.ccBS=function(){if(this.logger.log(w.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},h.ccAOF=function(){},h.ccAON=function(){},h.ccDER=function(){this.logger.log(w.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},h.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)},h.ccFON=function(){this.logger.log(w.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},h.ccRDC=function(){this.logger.log(w.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},h.ccTR=function(){this.logger.log(w.INFO,"TR"),this.setMode("MODE_TEXT")},h.ccRTD=function(){this.logger.log(w.INFO,"RTD"),this.setMode("MODE_TEXT")},h.ccEDM=function(){this.logger.log(w.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},h.ccCR=function(){this.logger.log(w.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},h.ccENM=function(){this.logger.log(w.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},h.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)},h.ccTO=function(a){this.logger.log(w.INFO,"TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},h.ccMIDROW=function(a){var g={flash:!1};if(g.underline=a%2===1,g.italics=a>=46,g.italics)g.foreground="white";else{var p=Math.floor(a/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];g.foreground=y[p]}this.logger.log(w.INFO,"MIDROW: "+JSON.stringify(g)),this.writeScreen.setPen(g)},h.outputDataUpdate=function(a){a===void 0&&(a=!1);var g=this.logger.time;if(g===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=g:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,g,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:g),this.lastOutputScreen.copy(this.displayedMemory))},h.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(s,a,g){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new A;this.channels=[null,new x(s,a,p),new x(s+1,g,p)],this.cmdHistory=b(),this.logger=p}var h=c.prototype;return h.getHandler=function(a){return this.channels[a].getHandler()},h.setHandler=function(a,g){this.channels[a].setHandler(g)},h.addData=function(a,g){var p,y,P,G=!1;this.logger.time=a;for(var Q=0;Q<g.length;Q+=2){if(y=g[Q]&127,P=g[Q+1]&127,y===0&&P===0)continue;if(this.logger.log(w.DATA,"["+C([g[Q],g[Q+1]])+"] -> ("+C([y,P])+")"),p=this.parseCmd(y,P),p||(p=this.parseMidrow(y,P)),p||(p=this.parsePAC(y,P)),p||(p=this.parseBackgroundAttributes(y,P)),!p&&(G=this.parseChars(y,P),G)){var re=this.currentChannel;if(re&&re>0){var z=this.channels[re];z.insertChars(G)}else this.logger.log(w.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!G&&this.logger.log(w.WARNING,"Couldn't parse cleaned data "+C([y,P])+" orig: "+C([g[Q],g[Q+1]]))}},h.parseCmd=function(a,g){var p=this.cmdHistory,y=(a===20||a===28||a===21||a===29)&&g>=32&&g<=47,P=(a===23||a===31)&&g>=33&&g<=35;if(!(y||P))return!1;if(D(a,g,p))return f(null,null,p),this.logger.log(w.DEBUG,"Repeated command ("+C([a,g])+") is dropped"),!0;var G=a===20||a===21||a===23?1:2,Q=this.channels[G];return a===20||a===21||a===28||a===29?g===32?Q.ccRCL():g===33?Q.ccBS():g===34?Q.ccAOF():g===35?Q.ccAON():g===36?Q.ccDER():g===37?Q.ccRU(2):g===38?Q.ccRU(3):g===39?Q.ccRU(4):g===40?Q.ccFON():g===41?Q.ccRDC():g===42?Q.ccTR():g===43?Q.ccRTD():g===44?Q.ccEDM():g===45?Q.ccCR():g===46?Q.ccENM():g===47&&Q.ccEOC():Q.ccTO(g-32),f(a,g,p),this.currentChannel=G,!0},h.parseMidrow=function(a,g){var p=0;if((a===17||a===25)&&g>=32&&g<=47){if(a===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(w.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[p];return y?(y.ccMIDROW(g),this.logger.log(w.DEBUG,"MIDROW ("+C([a,g])+")"),!0):!1}return!1},h.parsePAC=function(a,g){var p,y=this.cmdHistory,P=(a>=17&&a<=23||a>=25&&a<=31)&&g>=64&&g<=127,G=(a===16||a===24)&&g>=64&&g<=95;if(!(P||G))return!1;if(D(a,g,y))return f(null,null,y),!0;var Q=a<=23?1:2;g>=64&&g<=95?p=Q===1?O[a]:v[a]:p=Q===1?I[a]:S[a];var re=this.channels[Q];return re?(re.setPAC(this.interpretPAC(p,g)),f(a,g,y),this.currentChannel=Q,!0):!1},h.interpretPAC=function(a,g){var p,y={color:null,italics:!1,indent:null,underline:!1,row:a};return g>95?p=g-96:p=g-64,y.underline=(p&1)===1,p<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((p-16)/2)*4,y},h.parseChars=function(a,g){var p,y=null,P=null;if(a>=25?(p=2,P=a-8):(p=1,P=a),P>=17&&P<=19){var G;P===17?G=g+80:P===18?G=g+112:G=g+144,this.logger.log(w.INFO,"Special char '"+k(G)+"' in channel "+p),y=[G]}else a>=32&&a<=127&&(y=g===0?[a]:[a,g]);if(y){var Q=C(y);this.logger.log(w.DEBUG,"Char codes = "+Q.join(",")),f(a,g,this.cmdHistory)}return y},h.parseBackgroundAttributes=function(a,g){var p=(a===16||a===24)&&g>=32&&g<=47,y=(a===23||a===31)&&g>=45&&g<=47;if(!(p||y))return!1;var P,G={};a===16||a===24?(P=Math.floor((g-32)/2),G.background=M[P],g%2===1&&(G.background=G.background+"_semi")):g===45?G.background="transparent":(G.foreground="black",g===47&&(G.underline=!0));var Q=a<=23?1:2,re=this.channels[Q];return re.setBkgData(G),f(a,g,this.cmdHistory),!0},h.reset=function(){for(var a=0;a<Object.keys(this.channels).length;a++){var g=this.channels[a];g&&g.reset()}this.cmdHistory=b()},h.cueSplitAtTime=function(a){for(var g=0;g<this.channels.length;g++){var p=this.channels[g];p&&p.cueSplitAtTime(a)}},c}();function f(c,h,s){s.a=c,s.b=h}function D(c,h,s){return s.a===c&&s.b===h}function b(){return{a:null,b:null}}Y.default=m},"./src/utils/codecs.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"isCodecType",function(){return _}),L.d(Y,"isCodecSupportedInMp4",function(){return k});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 _(j,U){var O=V[U];return!!O&&O[j.slice(0,4)]===!0}function k(j,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/utils/vttparser.ts"),_=L("./src/utils/webvtt-parser.ts"),k=L("./src/utils/texttrack-utils.ts"),j=/\s/,U={newCue:function(I,v,S,M){for(var w=[],A,C,d,o,l,u=self.VTTCue||self.TextTrackCue,x=0;x<M.rows.length;x++)if(A=M.rows[x],d=!0,o=0,l="",!A.isEmpty()){for(var m=0;m<A.chars.length;m++)j.test(A.chars[m].uchar)&&d?o++:(l+=A.chars[m].uchar,d=!1);A.cueStartTime=v,v===S&&(S+=1e-4),o>=16?o--:o++;var f=Object(V.fixLineBreaks)(l.trim()),D=Object(_.generateCueId)(v,S,f);(!I||!I.cues||!I.cues.getCueById(D))&&(C=new u(v,S,f),C.id=D,C.line=x+1,C.align="left",C.position=10+Math.min(80,Math.floor(o*8/32)*10),w.push(C))}return I&&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(k.addCueToTrack)(I,b)})),w}};Y.default=U},"./src/utils/discontinuities.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"findFirstFragWithCC",function(){return j}),L.d(Y,"shouldAlignOnDiscontinuities",function(){return U}),L.d(Y,"findDiscontinuousReferenceFrag",function(){return O}),L.d(Y,"adjustSlidingStart",function(){return v}),L.d(Y,"alignStream",function(){return S}),L.d(Y,"alignPDT",function(){return w}),L.d(Y,"alignFragmentByPDTDelta",function(){return A}),L.d(Y,"alignMediaPlaylistByPDT",function(){return C});var V=L("./src/polyfills/number.ts"),_=L("./src/utils/logger.ts"),k=L("./src/controller/level-helper.ts");function j(d,o){for(var l=null,u=0,x=d.length;u<x;u++){var m=d[u];if(m&&m.cc===o){l=m;break}}return l}function U(d,o,l){return!!(o.details&&(l.endCC>l.startCC||d&&d.cc<l.startCC))}function O(d,o){var l=d.fragments,u=o.fragments;if(!u.length||!l.length){_.logger.log("No fragments to align");return}var x=j(l,u[0].cc);if(!x||x&&!x.startPTS){_.logger.log("No frag in previous level to align on");return}return x}function I(d,o){if(d){var l=d.start+o;d.start=d.startPTS=l,d.endPTS=l+d.duration}}function v(d,o){for(var l=o.fragments,u=0,x=l.length;u<x;u++)I(l[u],d);o.fragmentHint&&I(o.fragmentHint,d),o.alignedSliding=!0}function S(d,o,l){if(!o)return;M(d,l,o),!l.alignedSliding&&o.details&&w(l,o.details),!l.alignedSliding&&o.details&&!l.skippedSegments&&Object(k.adjustSliding)(o.details,l)}function M(d,o,l){if(U(d,l,o)){var u=O(l.details,o);u&&Object(V.isFiniteNumber)(u.start)&&(_.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),v(u.start,o))}}function w(d,o){if(!o.fragments.length||!d.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,u=d.fragments[0].programDateTime,x=(u-l)/1e3+o.fragments[0].start;x&&Object(V.isFiniteNumber)(x)&&(_.logger.log("Adjusting PTS using programDateTime delta "+(u-l)+"ms, sliding:"+x.toFixed(3)+" "+d.url+" "),v(x,d))}function A(d,o){var l=d.programDateTime;if(!l)return;var u=(l-o)/1e3;d.start=d.startPTS=u,d.endPTS=u+d.duration}function C(d,o){if(!o.fragments.length||!d.hasProgramDateTime||!o.hasProgramDateTime)return;var l=o.fragments[0].programDateTime,u=o.fragments[0].start,x=l-u*1e3;d.fragments.forEach(function(m){A(m,x)}),d.fragmentHint&&A(d.fragmentHint,x),d.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/utils/ewma.ts"),_=function(){function k(U,O,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(U),this.fast_=new V.default(O)}var j=k.prototype;return j.update=function(O,I){var v=this.slow_,S=this.fast_;this.slow_.halfLife!==O&&(this.slow_=new V.default(O,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new V.default(I,S.getEstimate(),S.getTotalWeight()))},j.sample=function(O,I){O=Math.max(O,this.minDelayMs_);var v=8*I,S=O/1e3,M=v/S;this.fast_.sample(S,M),this.slow_.sample(S,M)},j.canEstimate=function(){var O=this.fast_;return O&&O.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},k}();Y.default=_},"./src/utils/ewma.ts":function(ue,Y,L){"use strict";L.r(Y);var V=function(){function _(j,U,O){U===void 0&&(U=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=U,this.totalWeight_=O}var k=_.prototype;return k.sample=function(U,O){var I=Math.pow(this.alpha_,U);this.estimate_=O*(1-I)+I*this.estimate_,this.totalWeight_+=U},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},_}();Y.default=V},"./src/utils/fetch-loader.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"fetchSupported",function(){return A});var V=L("./src/polyfills/number.ts"),_=L("./src/loader/load-stats.ts"),k=L("./src/demux/chunk-cache.ts");function j(u,x){u.prototype=Object.create(x.prototype),u.prototype.constructor=u,S(u,x)}function U(u){var x=typeof Map=="function"?new Map:void 0;return U=function(f){if(f===null||!v(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof x!="undefined"){if(x.has(f))return x.get(f);x.set(f,D)}function D(){return O(f,arguments,M(this).constructor)}return D.prototype=Object.create(f.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),S(D,f)},U(u)}function O(u,x,m){return I()?O=Reflect.construct:O=function(D,b,c){var h=[null];h.push.apply(h,b);var s=Function.bind.apply(D,h),a=new s;return c&&S(a,c.prototype),a},O.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function v(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function S(u,x){return S=Object.setPrototypeOf||function(f,D){return f.__proto__=D,f},S(u,x)}function M(u){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},M(u)}function w(){return w=Object.assign||function(u){for(var x=1;x<arguments.length;x++){var m=arguments[x];for(var f in m)Object.prototype.hasOwnProperty.call(m,f)&&(u[f]=m[f])}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 x=u.prototype;return x.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},x.abortInternal=function(){var f=this.response;(!f||!f.ok)&&(this.stats.aborted=!0,this.controller.abort())},x.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},x.load=function(f,D,b){var c=this,h=this.stats;if(h.loading.start)throw new Error("Loader can only be used once.");h.loading.start=self.performance.now();var s=d(f,this.controller.signal),a=b.onProgress,g=f.responseType==="arraybuffer",p=g?"byteLength":"length";this.context=f,this.config=D,this.callbacks=b,this.request=this.fetchSetup(f,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){c.abortInternal(),b.onTimeout(h,f,c.response)},D.timeout),self.fetch(this.request).then(function(y){if(c.response=c.loader=y,!y.ok){var P=y.status,G=y.statusText;throw new l(G||"fetch, bad network response",P,y)}return h.loading.first=Math.max(self.performance.now(),h.loading.start),h.total=parseInt(y.headers.get("Content-Length")||"0"),a&&Object(V.isFiniteNumber)(D.highWaterMark)?c.loadProgressively(y,h,f,D.highWaterMark,a):g?y.arrayBuffer():y.text()}).then(function(y){var P=c.response;self.clearTimeout(c.requestTimeout),h.loading.end=Math.max(self.performance.now(),h.loading.first),h.loaded=h.total=y[p];var G={url:P.url,data:y};a&&!Object(V.isFiniteNumber)(D.highWaterMark)&&a(h,f,y,P),b.onSuccess(G,h,f,P)}).catch(function(y){if(self.clearTimeout(c.requestTimeout),h.aborted)return;var P=y.code||0;b.onError({code:P,text:y.message},f,y.details)})},x.getCacheAge=function(){var f=null;if(this.response){var D=this.response.headers.get("age");f=D?parseFloat(D):null}return f},x.loadProgressively=function(f,D,b,c,h){c===void 0&&(c=0);var s=new k.default,a=f.body.getReader(),g=function p(){return a.read().then(function(y){if(y.done)return s.dataLength&&h(D,b,s.flush(),f),Promise.resolve(new ArrayBuffer(0));var P=y.value,G=P.length;return D.loaded+=G,G<c||s.dataLength?(s.push(P),s.dataLength>=c&&h(D,b,s.flush(),f)):h(D,b,P,f),p()}).catch(function(){return Promise.reject()})};return g()},u}();function d(u,x){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:x,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,x){return new self.Request(u.url,x)}var l=function(u){j(x,u);function x(m,f,D){var b;return b=u.call(this,m)||this,b.code=void 0,b.details=void 0,b.code=f,b.details=D,b}return x}(U(Error));Y.default=C},"./src/utils/imsc1-ttml-parser.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"IMSC1_CODEC",function(){return v}),L.d(Y,"parseIMSC1",function(){return A});var V=L("./src/utils/mp4-tools.ts"),_=L("./src/utils/vttparser.ts"),k=L("./src/utils/vttcue.ts"),j=L("./src/demux/id3.ts"),U=L("./src/utils/timescale-conversion.ts"),O=L("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(c){for(var h=1;h<arguments.length;h++){var s=arguments[h];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(c[a]=s[a])}return c},I.apply(this,arguments)}var v="stpp.ttml.im1t",S=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,M=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,w={left:"start",center:"center",right:"end",start:"start",end:"end"};function A(c,h,s,a,g){var p=Object(V.findBox)(new Uint8Array(c),["mdat"]);if(p.length===0){g(new Error("Could not parse IMSC1 mdat"));return}var y=p[0],P=Object(j.utf8ArrayToStr)(new Uint8Array(c,y.start,y.end-y.start)),G=Object(U.toTimescaleFromScale)(h,1,s);try{a(C(P,G))}catch(Q){g(Q)}}function C(c,h){var s=new DOMParser,a=s.parseFromString(c,"text/xml"),g=a.getElementsByTagName("tt")[0];if(!g)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(p).reduce(function(z,F){return z[F]=g.getAttribute("ttp:"+F)||p[F],z},{}),P=g.getAttribute("xml:space")!=="preserve",G=o(d(g,"styling","style")),Q=o(d(g,"layout","region")),re=d(g,"body","[begin]");return[].map.call(re,function(z){var F=l(z,P);if(!F||!z.hasAttribute("begin"))return null;var ne=f(z.getAttribute("begin"),y),ce=f(z.getAttribute("dur"),y),ge=f(z.getAttribute("end"),y);if(ne===null)throw m(z);if(ge===null){if(ce===null)throw m(z);ge=ne+ce}var be=new k.default(ne-h,ge-h,F);be.id=Object(O.generateCueId)(be.startTime,be.endTime,be.text);var Be=Q[z.getAttribute("region")],Se=G[z.getAttribute("style")];be.position=10,be.size=80;var Le=u(Be,Se),Te=Le.textAlign;if(Te){var we=w[Te];we&&(be.lineAlign=we),be.align=Te}return I(be,Le),be}).filter(function(z){return z!==null})}function d(c,h,s){var a=c.getElementsByTagName(h)[0];return a?[].slice.call(a.querySelectorAll(s)):[]}function o(c){return c.reduce(function(h,s){var a=s.getAttribute("xml:id");return a&&(h[a]=s),h},{})}function l(c,h){return[].slice.call(c.childNodes).reduce(function(s,a,g){var p;return a.nodeName==="br"&&g?s+`
`:(p=a.childNodes)!==null&&p!==void 0&&p.length?l(a,h):h?s+a.textContent.trim().replace(/\s+/g," "):s+a.textContent},"")}function u(c,h){var s="http://www.w3.org/ns/ttml#styling",a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return a.reduce(function(g,p){var y=x(h,s,p)||x(c,s,p);return y&&(g[p]=y),g},{})}function x(c,h,s){return c.hasAttributeNS(h,s)?c.getAttributeNS(h,s):null}function m(c){return new Error("Could not parse ttml timestamp "+c)}function f(c,h){if(!c)return null;var s=Object(_.parseTimeStamp)(c);return s===null&&(S.test(c)?s=D(c,h):M.test(c)&&(s=b(c,h))),s}function D(c,h){var s=S.exec(c),a=(s[4]|0)+(s[5]|0)/h.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+a/h.frameRate}function b(c,h){var s=M.exec(c),a=Number(s[1]),g=s[2];switch(g){case"h":return a*3600;case"m":return a*60;case"ms":return a*1e3;case"f":return a/h.frameRate;case"t":return a/h.tickRate}return a}},"./src/utils/logger.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"enableLogs",function(){return O}),L.d(Y,"logger",function(){return I});var V=function(){},_={trace:V,debug:V,log:V,warn:V,info:V,error:V},k=_;function j(v){var S=self.console[v];return S?S.bind(self.console,"["+v+"] >"):V}function U(v){for(var S=arguments.length,M=new Array(S>1?S-1:0),w=1;w<S;w++)M[w-1]=arguments[w];M.forEach(function(A){k[A]=v[A]?v[A].bind(v):j(A)})}function O(v){if(self.console&&v===!0||typeof v=="object"){U(v,"debug","log","info","warn","error");try{k.log()}catch(S){k=_}}else k=_}var I=k},"./src/utils/mediakeys-helper.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"KeySystems",function(){return V}),L.d(Y,"requestMediaKeySystemAccess",function(){return _});var V;(function(k){k.WIDEVINE="com.widevine.alpha",k.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(ue,Y,L){"use strict";L.r(Y),L.d(Y,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"bin2str",function(){return U}),L.d(Y,"readUint16",function(){return O}),L.d(Y,"readUint32",function(){return I}),L.d(Y,"writeUint32",function(){return v}),L.d(Y,"findBox",function(){return S}),L.d(Y,"parseSegmentIndex",function(){return M}),L.d(Y,"parseInitSegment",function(){return w}),L.d(Y,"getStartDTS",function(){return A}),L.d(Y,"getDuration",function(){return C}),L.d(Y,"computeRawDurationFromSamples",function(){return d}),L.d(Y,"offsetStartDTS",function(){return o}),L.d(Y,"segmentValidRange",function(){return l}),L.d(Y,"appendUint8Array",function(){return u});var V=L("./src/utils/typed-array.ts"),_=L("./src/loader/fragment.ts"),k=Math.pow(2,32)-1,j=[].push;function U(x){return String.fromCharCode.apply(null,x)}function O(x,m){"data"in x&&(m+=x.start,x=x.data);var f=x[m]<<8|x[m+1];return f<0?65536+f:f}function I(x,m){"data"in x&&(m+=x.start,x=x.data);var f=x[m]<<24|x[m+1]<<16|x[m+2]<<8|x[m+3];return f<0?4294967296+f:f}function v(x,m,f){"data"in x&&(m+=x.start,x=x.data),x[m]=f>>24,x[m+1]=f>>16&255,x[m+2]=f>>8&255,x[m+3]=f&255}function S(x,m){var f=[];if(!m.length)return f;var D,b,c;"data"in x?(D=x.data,b=x.start,c=x.end):(D=x,b=0,c=D.byteLength);for(var h=b;h<c;){var s=I(D,h),a=U(D.subarray(h+4,h+8)),g=s>1?h+s:c;if(a===m[0])if(m.length===1)f.push({data:D,start:h+8,end:g});else{var p=S({data:D,start:h+8,end:g},m.slice(1));p.length&&j.apply(f,p)}h=g}return f}function M(x){var m=S(x,["moov"]),f=m[0],D=f?f.end:null,b=S(x,["sidx"]);if(!b||!b[0])return null;var c=[],h=b[0],s=h.data[0],a=s===0?8:16,g=I(h,a);a+=4;var p=0,y=0;s===0?a+=8:a+=16,a+=2;var P=h.end+y,G=O(h,a);a+=2;for(var Q=0;Q<G;Q++){var re=a,z=I(h,re);re+=4;var F=z&2147483647,ne=(z&2147483648)>>>31;if(ne===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ce=I(h,re);re+=4,c.push({referenceSize:F,subsegmentDuration:ce,info:{duration:ce/g,start:P,end:P+F-1}}),P+=F,re+=4,a=re}return{earliestPresentationTime:p,timescale:g,version:s,referencesCount:G,references:c,moovEndOffset:D}}function w(x){for(var m=[],f=S(x,["moov","trak"]),D=0;D<f.length;D++){var b=f[D],c=S(b,["tkhd"])[0];if(c){var h=c.data[c.start],s=h===0?12:20,a=I(c,s),g=S(b,["mdia","mdhd"])[0];if(g){h=g.data[g.start],s=h===0?12:20;var p=I(g,s),y=S(b,["mdia","hdlr"])[0];if(y){var P=U(y.data.subarray(y.start+8,y.start+12)),G={soun:_.ElementaryStreamTypes.AUDIO,vide:_.ElementaryStreamTypes.VIDEO}[P];if(G){var Q=S(b,["mdia","minf","stbl","stsd"])[0],re=void 0;Q&&(re=U(Q.data.subarray(Q.start+12,Q.start+16))),m[a]={timescale:p,type:G},m[G]={timescale:p,id:a,codec:re}}}}}}var z=S(x,["moov","mvex","trex"]);return z.forEach(function(F){var ne=I(F,4),ce=m[ne];ce&&(ce.default={duration:I(F,12),flags:I(F,20)})}),m}function A(x,m){return S(m,["moof","traf"]).reduce(function(f,D){var b=S(D,["tfdt"])[0],c=b.data[b.start],h=S(D,["tfhd"]).reduce(function(s,a){var g=I(a,4),p=x[g];if(p){var y=I(b,4);c===1&&(y*=Math.pow(2,32),y+=I(b,8));var P=p.timescale||9e4,G=y/P;if(isFinite(G)&&(s===null||G<s))return G}return s},null);return h!==null&&isFinite(h)&&(f===null||h<f)?h:f},null)||0}function C(x,m){for(var f=0,D=0,b=0,c=S(x,["moof","traf"]),h=0;h<c.length;h++){var s=c[h],a=S(s,["tfhd"])[0],g=I(a,4),p=m[g];if(!p)continue;var y=p.default,P=I(a,0)|(y==null?void 0:y.flags),G=y==null?void 0:y.duration;P&8&&(P&2?G=I(a,12):G=I(a,8));for(var Q=p.timescale||9e4,re=S(s,["trun"]),z=0;z<re.length;z++){if(G){var F=I(re[z],4);f=G*F}else f=d(re[z]);p.type===_.ElementaryStreamTypes.VIDEO?D+=f/Q:p.type===_.ElementaryStreamTypes.AUDIO&&(b+=f/Q)}}if(D===0&&b===0){var ne=M(x);if(ne!=null&&ne.references)return ne.references.reduce(function(ce,ge){return ce+ge.info.duration||0},0)}return D||b}function d(x){var m=I(x,0),f=8;m&1&&(f+=4),m&4&&(f+=4);for(var D=0,b=I(x,4),c=0;c<b;c++){if(m&256){var h=I(x,f);D+=h,f+=4}m&512&&(f+=4),m&1024&&(f+=4),m&2048&&(f+=4)}return D}function o(x,m,f){S(m,["moof","traf"]).forEach(function(D){S(D,["tfhd"]).forEach(function(b){var c=I(b,4),h=x[c];if(!h)return;var s=h.timescale||9e4;S(D,["tfdt"]).forEach(function(a){var g=a.data[a.start],p=I(a,4);if(g===0)v(a,4,p-f*s);else{p*=Math.pow(2,32),p+=I(a,8),p-=f*s,p=Math.max(p,0);var y=Math.floor(p/(k+1)),P=Math.floor(p%(k+1));v(a,4,y),v(a,8,P)}})})})}function l(x){var m={valid:null,remainder:null},f=S(x,["moof"]);if(f){if(f.length<2)return m.remainder=x,m}else return m;var D=f[f.length-1];return m.valid=Object(V.sliceUint8)(x,0,D.start-8),m.remainder=Object(V.sliceUint8)(x,D.start-8),m}function u(x,m){var f=new Uint8Array(x.length+m.length);return f.set(x),f.set(m,x.length),f}},"./src/utils/output-filter.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"default",function(){return V});var V=function(){function _(j,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=U}var k=_.prototype;return k.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},k.newCue=function(U,O,I){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=O,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[]},_}()},"./src/utils/texttrack-utils.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"sendAddTrackEvent",function(){return _}),L.d(Y,"addCueToTrack",function(){return k}),L.d(Y,"clearCurrentCues",function(){return j}),L.d(Y,"removeCuesInRange",function(){return U}),L.d(Y,"getCuesInRange",function(){return I});var V=L("./src/utils/logger.ts");function _(v,S){var M;try{M=new Event("addtrack")}catch(w){M=document.createEvent("Event"),M.initEvent("addtrack",!1,!1)}M.track=v,S.dispatchEvent(M)}function k(v,S){var M=v.mode;if(M==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(S.id))try{if(v.addCue(S),!v.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,v.addCue(w)}M==="disabled"&&(v.mode=M)}function j(v){var S=v.mode;if(S==="disabled"&&(v.mode="hidden"),v.cues)for(var M=v.cues.length;M--;)v.removeCue(v.cues[M]);S==="disabled"&&(v.mode=S)}function U(v,S,M){var w=v.mode;if(w==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var A=I(v.cues,S,M),C=0;C<A.length;C++)v.removeCue(A[C]);w==="disabled"&&(v.mode=w)}function O(v,S){if(S<v[0].startTime)return 0;var M=v.length-1;if(S>v[M].endTime)return-1;for(var w=0,A=M;w<=A;){var C=Math.floor((A+w)/2);if(S<v[C].startTime)A=C-1;else if(S>v[C].startTime&&w<M)w=C+1;else return C}return v[w].startTime-S<S-v[A].startTime?w:A}function I(v,S,M){var w=[],A=O(v,S);if(A>-1)for(var C=A,d=v.length;C<d;C++){var o=v[C];if(o.startTime>=S&&o.endTime<=M)w.push(o);else if(o.startTime>M)return w}return w}},"./src/utils/time-ranges.ts":function(ue,Y,L){"use strict";L.r(Y);var V={toString:function(k){for(var j="",U=k.length,O=0;O<U;O++)j+="["+k.start(O).toFixed(3)+","+k.end(O).toFixed(3)+"]";return j}};Y.default=V},"./src/utils/timescale-conversion.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"toTimescaleFromBase",function(){return _}),L.d(Y,"toTimescaleFromScale",function(){return k}),L.d(Y,"toMsFromMpegTsClock",function(){return j}),L.d(Y,"toMpegTsClockFromTimescale",function(){return U});var V=9e4;function _(O,I,v,S){v===void 0&&(v=1),S===void 0&&(S=!1);var M=O*I*v;return S?Math.round(M):M}function k(O,I,v,S){return v===void 0&&(v=1),S===void 0&&(S=!1),_(O,I,1/v,S)}function j(O,I){return I===void 0&&(I=!1),_(O,1e3,1/V,I)}function U(O,I){return I===void 0&&(I=1),_(O,V,1/I)}},"./src/utils/typed-array.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"sliceUint8",function(){return V});function V(_,k,j){return Uint8Array.prototype.slice?_.slice(k,j):new Uint8Array(Array.prototype.slice.call(_,k,j))}},"./src/utils/vttcue.ts":function(ue,Y,L){"use strict";L.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],_=["start","middle","end","left","right"];function k(v,S){if(typeof S!="string")return!1;if(!Array.isArray(v))return!1;var M=S.toLowerCase();return~v.indexOf(M)?M:!1}function j(v){return k(V,v)}function U(v){return k(_,v)}function O(v){for(var S=arguments.length,M=new Array(S>1?S-1:0),w=1;w<S;w++)M[w-1]=arguments[w];for(var A=1;A<arguments.length;A++){var C=arguments[A];for(var d in C)v[d]=C[d]}return v}function I(v,S,M){var w=this,A={enumerable:!0};w.hasBeenReset=!1;var C="",d=!1,o=v,l=S,u=M,x=null,m="",f=!0,D="auto",b="start",c=50,h="middle",s=50,a="middle";Object.defineProperty(w,"id",O({},A,{get:function(){return C},set:function(p){C=""+p}})),Object.defineProperty(w,"pauseOnExit",O({},A,{get:function(){return d},set:function(p){d=!!p}})),Object.defineProperty(w,"startTime",O({},A,{get:function(){return o},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");o=p,this.hasBeenReset=!0}})),Object.defineProperty(w,"endTime",O({},A,{get:function(){return l},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");l=p,this.hasBeenReset=!0}})),Object.defineProperty(w,"text",O({},A,{get:function(){return u},set:function(p){u=""+p,this.hasBeenReset=!0}})),Object.defineProperty(w,"region",O({},A,{get:function(){return x},set:function(p){x=p,this.hasBeenReset=!0}})),Object.defineProperty(w,"vertical",O({},A,{get:function(){return m},set:function(p){var y=j(p);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=y,this.hasBeenReset=!0}})),Object.defineProperty(w,"snapToLines",O({},A,{get:function(){return f},set:function(p){f=!!p,this.hasBeenReset=!0}})),Object.defineProperty(w,"line",O({},A,{get:function(){return D},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=p,this.hasBeenReset=!0}})),Object.defineProperty(w,"lineAlign",O({},A,{get:function(){return b},set:function(p){var y=U(p);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");b=y,this.hasBeenReset=!0}})),Object.defineProperty(w,"position",O({},A,{get:function(){return c},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");c=p,this.hasBeenReset=!0}})),Object.defineProperty(w,"positionAlign",O({},A,{get:function(){return h},set:function(p){var y=U(p);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");h=y,this.hasBeenReset=!0}})),Object.defineProperty(w,"size",O({},A,{get:function(){return s},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");s=p,this.hasBeenReset=!0}})),Object.defineProperty(w,"align",O({},A,{get:function(){return a},set:function(p){var y=U(p);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");a=y,this.hasBeenReset=!0}})),w.displayState=void 0}return I.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"parseTimeStamp",function(){return k}),L.d(Y,"fixLineBreaks",function(){return S}),L.d(Y,"VTTParser",function(){return M});var V=L("./src/utils/vttcue.ts"),_=function(){function w(){}var A=w.prototype;return A.decode=function(d,o){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},w}();function k(w){function A(d,o,l,u){return(d|0)*3600+(o|0)*60+(l|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 j=function(){function w(){this.values=Object.create(null)}var A=w.prototype;return A.set=function(d,o){!this.get(d)&&o!==""&&(this.values[d]=o)},A.get=function(d,o,l){return l?this.has(d)?this.values[d]:o[l]:this.has(d)?this.values[d]:o},A.has=function(d){return d in this.values},A.alt=function(d,o,l){for(var u=0;u<l.length;++u)if(o===l[u]){this.set(d,o);break}},A.integer=function(d,o){/^-?\d+$/.test(o)&&this.set(d,parseInt(o,10))},A.percent=function(d,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var l=parseFloat(o);if(l>=0&&l<=100)return this.set(d,l),!0}return!1},w}();function U(w,A,C,d){var o=d?w.split(d):[w];for(var l in o){if(typeof o[l]!="string")continue;var u=o[l].split(C);if(u.length!==2)continue;var x=u[0],m=u[1];A(x,m)}}var O=new V.default(0,0,""),I=O.align==="middle"?"middle":"center";function v(w,A,C){var d=w;function o(){var x=k(w);if(x===null)throw new Error("Malformed timestamp: "+d);return w=w.replace(/^[^\sa-zA-Z-]+/,""),x}function l(x,m){var f=new j;U(x,function(c,h){var s;switch(c){case"region":for(var a=C.length-1;a>=0;a--)if(C[a].id===h){f.set(c,C[a].region);break}break;case"vertical":f.alt(c,h,["rl","lr"]);break;case"line":s=h.split(","),f.integer(c,s[0]),f.percent(c,s[0])&&f.set("snapToLines",!1),f.alt(c,s[0],["auto"]),s.length===2&&f.alt("lineAlign",s[1],["start",I,"end"]);break;case"position":s=h.split(","),f.percent(c,s[0]),s.length===2&&f.alt("positionAlign",s[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":f.percent(c,h);break;case"align":f.alt(c,h,["start",I,"end","left","right"]);break}},/:/,/\s/),m.region=f.get("region",null),m.vertical=f.get("vertical","");var D=f.get("line","auto");D==="auto"&&O.line===-1&&(D=-1),m.line=D,m.lineAlign=f.get("lineAlign","start"),m.snapToLines=f.get("snapToLines",!0),m.size=f.get("size",100),m.align=f.get("align",I);var b=f.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 '-->'): "+d);w=w.substr(3),u(),A.endTime=o(),u(),l(w,A)}function S(w){return w.replace(/<br(?: \/)?>/gi,`
`)}var M=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(d){var o=this;d&&(o.buffer+=o.decoder.decode(d,{stream:!0}));function l(){var b=o.buffer,c=0;for(b=S(b);c<b.length&&b[c]!=="\r"&&b[c]!==`
`;)++c;var h=b.substr(0,c);return b[c]==="\r"&&++c,b[c]===`
`&&++c,o.buffer=b.substr(c),h}function u(b){U(b,function(c,h){},/:/)}try{var x="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;x=l();var m=x.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var f=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;f?f=!1:x=l();switch(o.state){case"HEADER":/:/.test(x)?u(x):x||(o.state="ID");continue;case"NOTE":x||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(x)){o.state="NOTE";break}if(!x)continue;if(o.cue=new V.default(0,0,""),o.state="CUE",x.indexOf("-->")===-1){o.cue.id=x;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{v(x,o.cue,o.regionList)}catch(b){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var D=x.indexOf("-->")!==-1;if(!x||D&&(f=!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+=x}continue;case"BADCUE":x||(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 d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=`
`,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){d.onparsingerror&&d.onparsingerror(o)}return d.onflush&&d.onflush(),this},w}()},"./src/utils/webvtt-parser.ts":function(ue,Y,L){"use strict";L.r(Y),L.d(Y,"generateCueId",function(){return M}),L.d(Y,"parseWebVTT",function(){return A});var V=L("./src/polyfills/number.ts"),_=L("./src/utils/vttparser.ts"),k=L("./src/demux/id3.ts"),j=L("./src/utils/timescale-conversion.ts"),U=L("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,I=function(d,o,l){return l===void 0&&(l=0),d.substr(l,o.length)===o},v=function(d){var o=parseInt(d.substr(-3)),l=parseInt(d.substr(-6,2)),u=parseInt(d.substr(-9,2)),x=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(o)||!Object(V.isFiniteNumber)(l)||!Object(V.isFiniteNumber)(u)||!Object(V.isFiniteNumber)(x))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return o+=1e3*l,o+=60*1e3*u,o+=60*60*1e3*x,o},S=function(d){for(var o=5381,l=d.length;l;)o=o*33^d.charCodeAt(--l);return(o>>>0).toString()};function M(C,d,o){return S(C.toString())+S(d.toString())+S(o)}var w=function(d,o,l){var u=d[o],x=d[u.prevCC];if(!x||!x.new&&u.new){d.ccOffset=d.presentationOffset=u.start,u.new=!1;return}for(;(m=x)!==null&&m!==void 0&&m.new;){var m;d.ccOffset+=u.start-x.start,u.new=!1,u=x,x=d[u.prevCC]}d.presentationOffset=l};function A(C,d,o,l,u,x,m,f){var D=new _.VTTParser,b=Object(k.utf8ArrayToStr)(new Uint8Array(C)).trim().replace(O,`
`).split(`
`),c=[],h=Object(j.toMpegTsClockFromTimescale)(d,o),s="00:00.000",a=0,g=0,p,y=!0,P=!1;D.oncue=function(G){var Q=l[u],re=l.ccOffset,z=(a-h)/9e4;if(Q!=null&&Q.new&&(g!==void 0?re=l.ccOffset=Q.start:w(l,u,z)),z&&(re=z-l.presentationOffset),P){var F=G.endTime-G.startTime,ne=Object(U.normalizePts)((G.startTime+re-g)*9e4,x*9e4)/9e4;G.startTime=ne,G.endTime=ne+F}var ce=G.text.trim();G.text=decodeURIComponent(encodeURIComponent(ce)),G.id||(G.id=M(G.startTime,G.endTime,ce)),G.endTime>0&&c.push(G)},D.onparsingerror=function(G){p=G},D.onflush=function(){if(p){f(p);return}m(c)},b.forEach(function(G){if(y)if(I(G,"X-TIMESTAMP-MAP=")){y=!1,P=!0,G.substr(16).split(",").forEach(function(Q){I(Q,"LOCAL:")?s=Q.substr(6):I(Q,"MPEGTS:")&&(a=parseInt(Q.substr(7)))});try{g=v(s)/1e3}catch(Q){P=!1,p=Q}return}else G===""&&(y=!1);D.parse(G+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ue,Y,L){"use strict";L.r(Y);var V=L("./src/utils/logger.ts"),_=L("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,j=function(){function U(I){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=I?I.xhrSetup:null,this.stats=new _.LoadStats,this.retryDelay=0}var O=U.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},O.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(v,S,M){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=S,this.callbacks=M,this.retryDelay=S.retryDelay,this.loadInternal()},O.loadInternal=function(){var v=this.config,S=this.context;if(!v)return;var M=this.loader=new self.XMLHttpRequest,w=this.stats;w.loading.first=0,w.loaded=0;var A=this.xhrSetup;try{if(A)try{A(M,S.url)}catch(o){M.open("GET",S.url,!0),A(M,S.url)}M.readyState||M.open("GET",S.url,!0);var C=this.context.headers;if(C)for(var d in C)M.setRequestHeader(d,C[d])}catch(o){this.callbacks.onError({code:M.status,text:o.message},S,M);return}S.rangeEnd&&M.setRequestHeader("Range","bytes="+S.rangeStart+"-"+(S.rangeEnd-1)),M.onreadystatechange=this.readystatechange.bind(this),M.onprogress=this.loadprogress.bind(this),M.responseType=S.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),M.send()},O.readystatechange=function(){var v=this.context,S=this.loader,M=this.stats;if(!v||!S)return;var w=S.readyState,A=this.config;if(M.aborted)return;if(w>=2)if(self.clearTimeout(this.requestTimeout),M.loading.first===0&&(M.loading.first=Math.max(self.performance.now(),M.loading.start)),w===4){S.onreadystatechange=null,S.onprogress=null;var C=S.status;if(C>=200&&C<300){M.loading.end=Math.max(self.performance.now(),M.loading.first);var d,o;if(v.responseType==="arraybuffer"?(d=S.response,o=d.byteLength):(d=S.responseText,o=d.length),M.loaded=M.total=o,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(M,v,d,S),!this.callbacks)return;var u={url:S.responseURL,data:d};this.callbacks.onSuccess(u,M,v,S)}else M.retry>=A.maxRetry||C>=400&&C<499?(V.logger.error(C+" while loading "+v.url),this.callbacks.onError({code:C,text:S.statusText},v,S)):(V.logger.warn(C+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,A.maxRetryDelay),M.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 v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(v){var S=this.stats;S.loaded=v.loaded,v.lengthComputable&&(S.total=v.total)},O.getCacheAge=function(){var v=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var S=this.loader.getResponseHeader("age");v=S?parseFloat(S):null}return v},U}();Y.default=j}}).default})},vHTk:function(_e,Ie,q){_e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(_e,Ie){_e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3Ioi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SNwOOhX7whXjU1NKz5e4DdcubH4ZOJgw0Fbrl7c9fg5B7ZYKRwWAMOLgio89+CwTTGTeMATkxYDui63OyQPglcgLIsDAGKAPXhF6YfQvM3HeBENKZdQ1jQGoGLEIvmJ0EvnZ/c79ES2owzB5jwBkDHGhIZ/2R7QC5g9HEGJArAxzyde8D5Gm5AmS4GAO2c3TGB2OgFTLALR1KA6e5SByvUpEp7s+6tELwrMnKYcCl0DmYVOCyzOM3L2dCV44mZInUhdBrVFCPMmdt3MCmLrLsemWBcih0DlfVBMNNWVu2WdlgI7qydCE7tE2FzpVpVOqhdZkbaJSKhsSELruuVxYgG6FzOK+Bekjd+I16exaY0JWlC9mhbRA6h5PBCBpUM369w1jdTOiy63plAaoX+rEQNTewetzmEmfomdCVpQvZoeWWDi3UctrBlePXnHHpTZcdcgZIUQxErnk43vjI2ovuQP8faDGikjbF4FsAAAAASUVORK5CYII="},zEei:function(_e,Ie,q){_e.exports={flex_box_center:"flex_box_center___3trsE",flex_space_between:"flex_space_between___vYNfG",flex_box_vertical_center:"flex_box_vertical_center___267W4",flex_box_center_end:"flex_box_center_end___35F4i",flex_box_column:"flex_box_column___1cLWS",bg:"bg___13rUr",flexRow:"flexRow___geim6",flexJustifyCenter:"flexJustifyCenter___2SLQ2",flexAlignEnd:"flexAlignEnd___2-3OH",flexAlignCenter:"flexAlignCenter___2PK_9",flexColumn:"flexColumn___pc_D1",formWrap:"formWrap___3ozw6",titleWrap:"titleWrap___3JSLu",fieldWrap:"fieldWrap___1M8-z",mdWrap:"mdWrap___3iPl2",backgroundFa:"backgroundFa___2Wd1f",button:"button___3ie7q",icons:"icons___-WSHu",addButton:"addButton___1qx7n",navBar:"navBar___xDlWA",actived:"actived___dZNDy",deleteButton:"deleteButton___3Ethm"}}}]);